diff --git a/Contrib/PCC/.gitignore b/Contrib/PCC/.gitignore new file mode 100644 index 0000000000..84be62f0d6 --- /dev/null +++ b/Contrib/PCC/.gitignore @@ -0,0 +1,2 @@ +processLibDevs +checkLibDevs diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation130.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation130.pg index ddd5b84e89..5434940279 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation130.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation130.pg @@ -37,7 +37,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation140.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation140.pg index b5203bc8bb..ed2022764b 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation140.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation140.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("FiniteSolutionSets"); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality10.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality10.pg index 7542a86d05..ad2ffc2f9d 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality10.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality10.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality100.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality100.pg index 812f4f0986..596d1e8ce5 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality100.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality100.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg index 4e20aabcd2..ca8ba7d312 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg index 5cfdc2dfaa..e139b74b62 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality130.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality130.pg index 02e370f6cd..86da9ce003 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality130.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality130.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality140.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality140.pg index d2a0074890..07cec1a0bb 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality140.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality140.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality150.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality150.pg index 4505334f04..a7ce2cd55f 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality150.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality150.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality20.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality20.pg index 36988b2ac9..3677abf8ca 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality20.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality20.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg index 831657b252..2666a2bee2 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg index efeba0f26d..1a81249693 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality50.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality50.pg index bf85883617..a8177f9de5 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality50.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality50.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg index 541c4c64ec..619c3f9718 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality70.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality70.pg index 42d5e15017..b8d0628096 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality70.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality70.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg index df16e0c9e1..465a1458f1 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg index 813c033a00..f7274951c5 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityApplication10.pg b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityApplication10.pg index 51597feb80..920d713978 100644 --- a/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityApplication10.pg +++ b/Contrib/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityApplication10.pg @@ -33,7 +33,6 @@ loadMacros( ############################################## TEXT(beginproblem()); -#$refreshCachedImages = 1; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/Calculator/CalculatorQuadraticFunctionApplication10.pg b/Contrib/PCC/BasicAlgebra/Calculator/CalculatorQuadraticFunctionApplication10.pg index 5b732eafeb..8d39662199 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/CalculatorQuadraticFunctionApplication10.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/CalculatorQuadraticFunctionApplication10.pg @@ -36,7 +36,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality10.pg b/Contrib/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality10.pg index 9f8cdca954..83147d05eb 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality10.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality10.pg @@ -39,7 +39,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + do { $a = non_zero_random(-3,3,1); diff --git a/Contrib/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality20.pg b/Contrib/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality20.pg index eaea330162..6f1888b8b1 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality20.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality20.pg @@ -39,7 +39,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + do { $a = non_zero_random(-3,3,1); diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosFindingDomain10.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosFindingDomain10.pg new file mode 100644 index 0000000000..6bc1242d72 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosFindingDomain10.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(1,10,1); +$a2 = $a**2; +$b = non_zero_random(-10,10,1); +$c = random(-1,1,2); +$d = random(-10,10,1); +$func = Compute("$c*sqrt((x-$d)**2-$a2)+$b")->reduce; +$xd0 = -$a+$d; +$xd1 = $a+$d; + +$domain = Compute("(-inf,$xd0]U[$xd1,inf)"); +$range = $c>0 ? Compute("[$b,inf)") : Compute("(-inf,$b]"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xd0,$xd1],[2*$b,-$b]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +$xfunc = sub { my $t = shift(); + return $a/cos($t)+$d; }; +$yfunc = sub { my $t = shift(); + return $a*tan($t)+$b; }; +if ($c>0) { + $fn1 = new Fun( $xfunc, $yfunc, $gr ); + $fn1->domain(0,pi/2-0.1); + $fn2 = new Fun( $xfunc, $yfunc, $gr ); + $fn2->domain(pi,3*pi/2-0.1); +} else { + $fn1 = new Fun( $xfunc, $yfunc, $gr ); + $fn1->domain(pi/2,pi-0.1); + $fn2 = new Fun( $xfunc, $yfunc, $gr ); + $fn2->domain(3*pi/2,2*pi-0.1); +} + +$tb = $c>0 ? "top" : "bottom"; +$gr->stamps( closed_circle($xd0,$b,'blue') ); +$gr->lb( new Label($xd0,$b,"($xd0,$b)", 'blue','center',$tb,large)); +$gr->stamps( closed_circle($xd1,$b,'blue') ); +$gr->lb( new Label($xd1,$b,"($xd1,$b)", 'blue','center',$tb,large)); + +$ud = $c>0 ? "up" : "down"; +$alt = "This is the graph of f(x)=$func. Its graph starts at ($xd0,$b) and goes $ud and outward, and starts at ($xd1,$b) and goes $ud and outward."; + +############################################## + +BEGIN_PGML + +Use technology to find the domain and range of + + [``f(x)=[$func]``] + +use technology to determine the following. Use *inf* to represent infinity. + + [@KeyboardInstructions(q?Use interval notation.?)@]** + + Domain: [__]{$domain}{width => 30} + + Range: [__]{$range}{width => 30} + +END_PGML + +############################################################ +# Solution +############################################################ + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer those questions. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func] `]. + +Step 3: If needed, zoom out to see the function's critical points. + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +The domain is [`[$domain]`]. The range is [`[$range]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosFindingDomain20.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosFindingDomain20.pg new file mode 100644 index 0000000000..d156a758a7 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosFindingDomain20.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(1,10,1); +$a2 = $a**2; +$b = random(-10,10,1); +$c = random(-1,1,2); +$d = random(-10,10,1); +$func = Compute("$c*sqrt((x-$d)**2-$a2)-$c*x+$b")->reduce; +$xd0 = -$a+$d; +$xd1 = $a+$d; +$yb0 = -$c*$xd0+$b; +$yb1 = -$c*$xd1+$b; +$hor = -$c*$d+$b; + +$domain = Compute("(-inf,$xd0]U[$xd1,inf)"); +$range = $c>0 ? Compute("[$yb1,$hor)U[$yb0,inf)") : Compute("(-inf,$yb0]U($hor,$yb1]"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xd0, $xd0*2,$xd1,2*$xd1],[$yb0,$yb0*2,$yb1,2*$yb1]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +$xfunc = sub { my $t = shift(); + return $a/cos($t)+$d; }; +$yfunc = sub { my $t = shift(); + return $c*$a*tan($t)-$c*$a/cos($t)+$b; }; +add_functions($gr, "$func for x in <$min[0],$max[0]> using color:blue and weight:2"); +($gr->fn)[0]->steps(400); + +$tb = $c>0 ? "top" : "bottom"; +$gr->stamps( closed_circle($xd0,$yb0,'blue') ); +$gr->lb( new Label($xd0,$yb0,"($xd0,$yb0)", 'blue','center',$tb,large)); +$gr->stamps( closed_circle($xd1,$yb1,'blue') ); +$gr->lb( new Label($xd1,$yb1,"($xd1,$yb1)", 'blue','center',$tb,large)); + +$ud = $c>0 ? "up" : "down"; +$alt = "This is the graph of f(x)=$func. Its graph starts at ($xd0,$yb0) and goes $ud and outward, and starts at ($xd1,$yb1) and goes $ud and outward, approaching y=$b as x approaches infinity."; + +############################################## + +BEGIN_PGML + +[`[$test]`] + +Use technology to find the domain and range of + + [``f(x)=[$func]``] + +use technology to determine the following. Use *inf* to represent infinity. + + [@KeyboardInstructions(q?Use interval notation.?)@]** + + Domain: [__]{$domain}{width => 30} + + Range: [__]{$range}{width => 30} + +END_PGML + +############################################################ +# Solution +############################################################ + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer those questions. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func] `]. + +Step 3: If needed, zoom out to see the function's critical points. + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +Notice that when [`x`] approaches [`\infty`], the function's value approaches [`[$hor]`]. Or, [`y=[$hor]`] is a horizontal asymptote. + +The domain is [`[$domain]`]. The range is [`[$range]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction100.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction100.pg index 0829302a22..199ca820d7 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction100.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction100.pg @@ -177,8 +177,8 @@ if ($s[0]>0) { $ans3 = ($i0==0) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); $ans4 = ($i1==2) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); } else { - $ans3 = ($i1==2) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); - $ans4 = ($i0==0) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); + $ans3 = ($i0==0) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); + $ans4 = ($i1==2) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); } diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction40.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction40.pg index 6728806628..e0d9daf673 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction40.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction40.pg @@ -36,7 +36,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Point"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction50.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction50.pg index 6649f0c20b..1203ef2ad8 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction50.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction50.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(w => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction60.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction60.pg index 559a11b601..24faf43245 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction60.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction60.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosRationalFunction30.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosRationalFunction30.pg index 39f1fab654..4760c9d248 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosRationalFunction30.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosRationalFunction30.pg @@ -117,7 +117,7 @@ $left = -$spaceLR; $right = (int(($base+$spaceLR)/10))*10; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingCubicEquation10.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingCubicEquation10.pg index 1b29d615c1..3e22649df0 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingCubicEquation10.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingCubicEquation10.pg @@ -49,7 +49,7 @@ Context()->variables->are($var=>'Real'); $x0 = random(-20,-10,1); $x1 = non_zero_random(-9,9,1); $x2 = random(10,20,1); - $a = random(-0.09,0.09,0.01); + $a = non_zero_random(-0.09,0.09,0.01); $b = -$a*($x0+$x1+$x2); $slope = non_zero_random(-2,2,0.1); $c = $a*($x0*$x1+$x0*$x2+$x1*$x2)+$slope; @@ -112,8 +112,7 @@ Use graphing technology to solve this equation: [`` [$func0] = [$func1] ``] -* Write your answers in the format of *[$var]=#* or in set notation. -* If there are more than one solution, use a comma to separate them. +* Enter your answer(s) in set notation. The equation's solutions are [__________]{$ans}. diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation10.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation10.pg index 300eb3bc83..4d25e3d0ca 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation10.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation10.pg @@ -103,11 +103,11 @@ We will use desmos.com to solve this equation. Step 1: Go to desmos.com, click on Start Graphing. -Step 2: In the first textbox, enter [` f(x)=[$func0] `]. +Step 2: In the first textbox, enter [` f([$var])=[$func0] `]. -Step 3: In the second textbox, enter [` g(x)=[$func1] `]. +Step 3: In the second textbox, enter [` g([$var])=[$func1] `]. -Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f([$var])`] and [`g([$var])`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. Step 5: Click on the intersection, and desmos shows the solution [`([$xSolution],[$ySolution])`]. diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation20.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation20.pg index b5f25afea3..9e15b81684 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation20.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation20.pg @@ -122,11 +122,11 @@ We will use desmos.com to solve this equation. Step 1: Go to desmos.com, click on Start Graphing. -Step 2: In the first textbox, enter [` f(x)=[$func0] `]. +Step 2: In the first textbox, enter [` f([$var])=[$func0] `]. -Step 3: In the second textbox, enter [` g(x)=[$func1] `]. +Step 3: In the second textbox, enter [` g([$var])=[$func1] `]. -Step 4: Zoom out on the window, if needed, until you can see the intersections of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. +Step 4: Zoom out on the window, if needed, until you can see the intersections of [`f([$var])`] and [`g([$var])`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. Step 5: Click on the intersections, and desmos shows the solution [`([$x0Show],[$y0Show])`] and [`([$x1Show],[$y1Show])`]. diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation10.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation10.pg index 8066ed0cba..0c7d7e95cd 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation10.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation10.pg @@ -74,9 +74,6 @@ $commonD = Formula("$var+$a")->reduce; $left = Formula("$var/($var+$a)")->reduce; $right = Formula("$b")->reduce; -$leftX = Formula("x/(x+$a)")->reduce; -$rightX = Formula("$b")->reduce; - $ans = Formula("$var=$x"); $y = $left->eval($var=>$x); @@ -104,11 +101,11 @@ We will use desmos.com to solve this equation. Step 1: Go to desmos.com, click on Start Graphing. -Step 2: In the first textbox, enter [` f(x)=[$leftX] `]. Note that we need to replace [`[$var]`] with [`x`]. +Step 2: In the first textbox, enter [` f([$var])=[$left] `]. -Step 3: In the second textbox, enter [` g(x)=[$rightX] `]. +Step 3: In the second textbox, enter [` g([$var])=[$right] `]. -Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f([$var])`] and [`g([$var])`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. Step 5: Click on the intersection, and desmos shows the solution [`([$x],[$y])`]. diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation20.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation20.pg index bfd1e33c48..0a9df68c45 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation20.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation20.pg @@ -87,9 +87,6 @@ Context()->flags->set( tolType => "absolute", ); - $leftX = Formula("$a/($b*x+$c)")->reduce; - $rightX = Formula("$d*x")->reduce; - $ans = List(Formula("$var=$x1"),Formula("$var=$x2")); $x1Show = Round($x1,3); @@ -105,7 +102,7 @@ Use graphing technology to solve this equation: [`` [$left] = [$right] ``] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] +* Enter multiple answers separated by commas, such as [`[$var]=1,[$var]=-1`] * Round your answers to two decimal places. This equation's solutions are [__________]{$ans}. @@ -120,11 +117,11 @@ We will use desmos.com to solve this equation. Step 1: Go to desmos.com, click on Start Graphing. -Step 2: In the first textbox, enter [` f(x)=[$leftX] `]. Note that we need to replace [`[$var]`] with [`x`]. +Step 2: In the first textbox, enter [` f([$var])=[$left] `]. -Step 3: In the second textbox, enter [` g(x)=[$rightX] `]. +Step 3: In the second textbox, enter [` g([$var])=[$right] `]. -Step 4: Zoom out on the window, if needed, until you can see the intersections of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. +Step 4: Zoom out on the window, if needed, until you can see the intersections of [`f([$var])`] and [`g([$var])`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. Step 5: Click on the intersections, and desmos shows the solution [`([$x1Show],[$y1Show])`] and [`([$x2Show],[$y1Show])`]. diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosTable10.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosTable10.pg index 2ccc3a865a..0a4b5ef8ed 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosTable10.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosTable10.pg @@ -1,23 +1,3 @@ -####################################### -### Generated from PreTeXt source -### on 2018-08-20T01:24:28-07:00 -### -### http://mathbook.pugetsound.edu -### -####################################### -## DBsubject() -## DBchapter() -## DBsection() -## Level() -## KEYWORDS() -## TitleText1() -## EditionText1() -## AuthorText1() -## Section1(not reported) -## Problem1(10.3.1) -## Author() -## Institution() -## Language(en-US) DOCUMENT(); @@ -38,7 +18,6 @@ loadMacros( ############################################################ # Header ############################################################ -COMMENT('Authored in PreTeXt'); TEXT(beginproblem()); ############################################################ diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosTable20.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosTable20.pg index 408b1ee6ed..40c6daa825 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosTable20.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosTable20.pg @@ -1,23 +1,3 @@ -####################################### -### Generated from PreTeXt source -### on 2018-08-20T01:24:28-07:00 -### -### http://mathbook.pugetsound.edu -### -####################################### -## DBsubject() -## DBchapter() -## DBsection() -## Level() -## KEYWORDS() -## TitleText1() -## EditionText1() -## AuthorText1() -## Section1(not reported) -## Problem1(10.3.1) -## Author() -## Institution() -## Language(en-US) DOCUMENT(); @@ -38,7 +18,6 @@ loadMacros( ############################################################ # Header ############################################################ -COMMENT('Authored in PreTeXt'); TEXT(beginproblem()); ############################################################ diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosWindowView10.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosWindowView10.pg index b1bb016a04..129c7f4d69 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosWindowView10.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosWindowView10.pg @@ -1,23 +1,3 @@ -####################################### -### Generated from PreTeXt source -### on 2018-08-20T01:24:29-07:00 -### -### http://mathbook.pugetsound.edu -### -####################################### -## DBsubject() -## DBchapter() -## DBsection() -## Level() -## KEYWORDS() -## TitleText1() -## EditionText1() -## AuthorText1() -## Section1(not reported) -## Problem1(10.3.7) -## Author() -## Institution() -## Language(en-US) DOCUMENT(); @@ -39,7 +19,6 @@ loadMacros( ############################################################ # Header ############################################################ -COMMENT('Authored in PreTeXt'); TEXT(beginproblem()); ############################################################ diff --git a/Contrib/PCC/BasicAlgebra/Calculator/DesmosWindowView20.pg b/Contrib/PCC/BasicAlgebra/Calculator/DesmosWindowView20.pg index edafd9a7ac..f5266dcf38 100644 --- a/Contrib/PCC/BasicAlgebra/Calculator/DesmosWindowView20.pg +++ b/Contrib/PCC/BasicAlgebra/Calculator/DesmosWindowView20.pg @@ -1,23 +1,3 @@ -####################################### -### Generated from PreTeXt source -### on 2018-08-20T01:24:29-07:00 -### -### http://mathbook.pugetsound.edu -### -####################################### -## DBsubject() -## DBchapter() -## DBsection() -## Level() -## KEYWORDS() -## TitleText1() -## EditionText1() -## AuthorText1() -## Section1(not reported) -## Problem1(10.3.11) -## Author() -## Institution() -## Language(en-US) DOCUMENT(); @@ -39,7 +19,6 @@ loadMacros( ############################################################ # Header ############################################################ -COMMENT('Authored in PreTeXt'); TEXT(beginproblem()); ############################################################ diff --git a/Contrib/PCC/BasicAlgebra/ComplexNumber/complexSolutions50.pg b/Contrib/PCC/BasicAlgebra/ComplexNumber/complexSolutions50.pg index bb6db5ae88..af4b52f01c 100644 --- a/Contrib/PCC/BasicAlgebra/ComplexNumber/complexSolutions50.pg +++ b/Contrib/PCC/BasicAlgebra/ComplexNumber/complexSolutions50.pg @@ -42,7 +42,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #These arrays decide values in y=a(x-b)^2+h. #$a[0], $b[0], $h[0], $a[1], $b[1], $h[1] are for the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg index 48e43f1760..d692fd408b 100644 --- a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg @@ -41,7 +41,7 @@ TEXT(beginproblem()); $symbol = '\geq'; Context("Numeric"); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg index 83675270da..61d9d99179 100644 --- a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg @@ -42,7 +42,7 @@ $symbol = '\leq'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg index a02adb937a..d11a3308ff 100644 --- a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg @@ -42,7 +42,7 @@ $symbol = '<'; Context("Currency"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg index 35b6140ad9..bfb1c13377 100644 --- a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg @@ -41,7 +41,7 @@ TEXT(beginproblem()); $symbol = '<'; Context("Numeric"); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg index 6c04afad93..afa96e5465 100644 --- a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg @@ -42,7 +42,7 @@ $symbol = '>'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg index cd95e1de84..bedfab2a8f 100644 --- a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg @@ -42,7 +42,7 @@ $symbol = '\le'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg index ab1626dcf1..9e179401c5 100644 --- a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg @@ -42,7 +42,7 @@ $symbol = '\ge'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg index db5bba7a51..6c31cdd7f9 100644 --- a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg @@ -42,7 +42,7 @@ $symbol = '<'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg index 0fe9f45352..0afc0e147e 100644 --- a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg @@ -42,7 +42,7 @@ $symbol = '>'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg index 4604ba9ecf..adfd1c1231 100644 --- a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg @@ -42,7 +42,7 @@ $symbol = '\leq'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg index 25572dc12e..194bdee18a 100644 --- a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg @@ -42,7 +42,7 @@ $symbol = '<'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMXPlusB.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMXPlusB.pg new file mode 100644 index 0000000000..0f0f08d0f3 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMXPlusB.pg @@ -0,0 +1,78 @@ +# Plot four points with a simple linear relation. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +my $m = list_random(-4..-2,2..4); +my $b = non_zero_random(-7,7,1); +$f = Formula("$m x+$b")->reduce; + +@xs = num_sort(-8,8,int((-8-$b)/$m),int((8-$b)/$m)); +$minx = $xs[1]; +$maxx = $xs[2]; +$n = $maxx - $minx + 1; + +@point = map {Point($_,$f->eval(x=>$_))} ($minx..$maxx); +$points = '{point,'.join('},{point,',@point).'}'; + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $extra = 0; + my $distinct = 0; + my @errors; + my $count = 0; + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) ne 'point' || ($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The $nth plotted point is incorrect."); + $extra++; + next STUDENTS; + } + for my $i (0..($count-2)) { + next STUDENTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinct++; + } + push(@errors, "You've only plotted $distinct correct point".(($distinct > 1)?'s':'').".") if ($distinct > 0 && $distinct < $n); + return (scalar(@{$correct})*min($distinct,$n)/$n/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Graph as many points as fit in the given viewing window for the equation [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMinusXPlusB.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMinusXPlusB.pg new file mode 100644 index 0000000000..94e5566e09 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMinusXPlusB.pg @@ -0,0 +1,73 @@ +# Plot four points with a simple linear relation. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +my $b = non_zero_random(-7,7,1); +$f = Formula("-x+$b")->reduce; +$minx = max(-8,$b-8); +$maxx = min(8,$b+8); +@point = map {Point($_,$f->eval(x=>$_))} ($minx..$maxx); +$points = '{point,'.join('},{point,',@point).'}'; + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $extra = 0; + my $distinct = 0; + my @errors; + my $count = 0; + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) ne 'point' || ($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The $nth plotted point is incorrect."); + $extra++; + next STUDENTS; + } + for my $i (0..($count-2)) { + next STUDENTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinct++; + } + push(@errors, "You've only plotted $distinct correct point".(($distinct > 1)?'s':'').".") if ($distinct > 0 && $distinct < 4); + return (scalar(@{$correct})*min($distinct,4)/4/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Graph at least four points for the equation [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotXSquaredMinusB.pg b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotXSquaredMinusB.pg new file mode 100644 index 0000000000..181c547606 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotXSquaredMinusB.pg @@ -0,0 +1,77 @@ +# Plot four points with a simple linear relation. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +$b = random(-6,-1,1); +$f = Formula("x^2+$b")->reduce; + +@xs = num_sort(-8,8,int(sqrt(8-$b)),int(-sqrt(8-$b))); +$minx = $xs[1]; +$maxx = $xs[2]; +$n = $maxx - $minx + 1; + +@point = map {Point($_,$f->eval(x=>$_))} ($minx..$maxx); +$points = '{point,'.join('},{point,',@point).'}'; + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $extra = 0; + my $distinct = 0; + my @errors; + my $count = 0; + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) ne 'point' || ($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The $nth plotted point is incorrect."); + $extra++; + next STUDENTS; + } + for my $i (0..($count-2)) { + next STUDENTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinct++; + } + push(@errors, "You've only plotted $distinct correct point".(($distinct > 1)?'s':'').".") if ($distinct > 0 && $distinct < $n); + return (scalar(@{$correct})*min($distinct,$n)/$n/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Graph as many points as fit in the given viewing window for the equation [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula100.pg b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula100.pg index 234d8d4ba1..d768bfaaa1 100644 --- a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula100.pg +++ b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula100.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## -$refreshCachedImages = 1; + Context("Numeric"); Context()->flags->set(reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula50.pg b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula50.pg index 79f4c5f32e..6729edccef 100644 --- a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula50.pg +++ b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula50.pg @@ -36,7 +36,7 @@ loadMacros( ############################################## -$refreshCachedImages = 1; + Context("Numeric"); diff --git a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula60.pg b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula60.pg index c5aee3f6a4..f763d76320 100644 --- a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula60.pg +++ b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula60.pg @@ -100,7 +100,7 @@ $areaU = NumberWithUnits("$area ft^2"); $text = "a triangle with one side parallel to the ground; this side is marked as h; the height is marked as h"; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula70.pg b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula70.pg index 6f66ee40ec..bea0a41151 100644 --- a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula70.pg +++ b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula70.pg @@ -36,7 +36,7 @@ loadMacros( ############################################## -$refreshCachedImages = 1; + Context("Numeric"); diff --git a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula80.pg b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula80.pg index 53a52f214b..4255c7691c 100644 --- a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula80.pg +++ b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula80.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## -$refreshCachedImages = 1; + Context("Numeric"); $xmin = 0; #The viewing window diff --git a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula90.pg b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula90.pg index aee32dd60f..c6786dda0a 100644 --- a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula90.pg +++ b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula90.pg @@ -36,7 +36,7 @@ loadMacros( ############################################## -$refreshCachedImages = 1; + Context("Numeric"); diff --git a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg index 73d6a4b666..70ad243b9c 100644 --- a/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg +++ b/Contrib/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg @@ -41,7 +41,7 @@ loadMacros( ########Begin Problem Setup############ -$refreshCachedImages = 1; + Context("Currency"); #Create some random integers. diff --git a/Contrib/PCC/BasicAlgebra/Exponents/exponentsMultiplication55.pg b/Contrib/PCC/BasicAlgebra/Exponents/exponentsMultiplication55.pg index 4e7d9485c1..a698c1c0d3 100644 --- a/Contrib/PCC/BasicAlgebra/Exponents/exponentsMultiplication55.pg +++ b/Contrib/PCC/BasicAlgebra/Exponents/exponentsMultiplication55.pg @@ -1,23 +1,3 @@ -####################################### -### Generated from PreTeXt source -### on 2017-11-29T13:56:31-08:00 -### -### http://mathbook.pugetsound.edu -### -####################################### -## DBsubject() -## DBchapter() -## DBsection() -## Level() -## KEYWORDS() -## TitleText1() -## EditionText1() -## AuthorText1() -## Section1(not reported) -## Problem1(6.1.6) -## Author() -## Institution() -## Language(en-US) DOCUMENT(); @@ -38,7 +18,6 @@ loadMacros( ############################################################ # Header ############################################################ -COMMENT('Authored in PreTeXt'); TEXT(beginproblem()); ############################################################ diff --git a/Contrib/PCC/BasicAlgebra/Factoring/factoring120.pg b/Contrib/PCC/BasicAlgebra/Factoring/factoring120.pg index fbc258d7be..594bf5b162 100644 --- a/Contrib/PCC/BasicAlgebra/Factoring/factoring120.pg +++ b/Contrib/PCC/BasicAlgebra/Factoring/factoring120.pg @@ -56,7 +56,7 @@ $a = random(2,10,1); $b = random(2,10,1); $c = $b; $c = random(2,10,1)*random(-1,1,2) while(gcd($b,$c)!=1); -$m = random(2,10,1); +do {$m = random(2,10,1)} until ($a != 8 || $m % 3 != 0); $question = Formula("$a$var^$m($b$var+$c)+$b$var+$c")->reduce; $ans = Formula("($a$var^$m+1)*($b$var+$c)")->reduce; ############################################## diff --git a/Contrib/PCC/BasicAlgebra/Factoring/factoring165.pg b/Contrib/PCC/BasicAlgebra/Factoring/factoring165.pg index 3ec5917977..2390c82135 100644 --- a/Contrib/PCC/BasicAlgebra/Factoring/factoring165.pg +++ b/Contrib/PCC/BasicAlgebra/Factoring/factoring165.pg @@ -118,7 +118,7 @@ $picture->fillRegion([ ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + BEGIN_PGML The square below has side [`[$a]x`]. Find the area diff --git a/Contrib/PCC/BasicAlgebra/Factoring/factoring380.pg b/Contrib/PCC/BasicAlgebra/Factoring/factoring380.pg index 35134daa55..77314e680c 100644 --- a/Contrib/PCC/BasicAlgebra/Factoring/factoring380.pg +++ b/Contrib/PCC/BasicAlgebra/Factoring/factoring380.pg @@ -61,14 +61,12 @@ $a = 1; $b = 100; $c = 1; $d = 1; -# this next condition ensures the numbers don't get too big -while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) -{ +do { $a = 1; $b = random(1,10,1)*random(-1,1,2); $c = random(1,10,1)*abs($b)/$b*-1; $d = random(2,10,1); -} +} until (abs($d*$b+$d*$a*$c)+abs($d*$b*$c) <= 50 && $b+$a*$c != 0); $leading = $a; $middle = $b+$a*$c; diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction130.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction130.pg index cdaf62977a..4802cce47c 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction130.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction130.pg @@ -56,9 +56,9 @@ $answer2 = Fraction($n,$d); $fractioncubed = $answer2 * $answer2 * $answer2; Context("LimitedNumeric"); -Context()->strings->add("undefined"=>{}, - "none"=>{alias=>'no real solutions'}, - ); +#Context()->strings->add("undefined"=>{}, + # "none"=>{alias=>'no real solutions'}, + #); $answer1 = Compute($answer1); diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction85.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction85.pg index 525abf4422..634860f19c 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction85.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction85.pg @@ -44,7 +44,6 @@ $fname = RandomVariableName(type=>function); Context("Numeric"); Context()->strings->add("undefined"=>{}, - "none"=>{alias=>'no real solutions'}, ); $y1 = non_zero_random(-10,10,1); diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionComposition67.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionComposition67.pg index 33a7eac52c..f61cec1ea2 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionComposition67.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionComposition67.pg @@ -52,7 +52,7 @@ Context()->operators->set( 'u-' => {class => 'bizarro::UOP::minus', isCommand => 1}, ); -$ans1 = Formula("-$a*x-$b")->reduce; +$ans1 = Compute("-$a*x-$b")->reduce; $evaluator1 = $ans1->cmp( checker=>sub{ my ( $correct, $student, $ansHash ) = @_; @@ -66,7 +66,7 @@ $evaluator1 = $ans1->cmp( return $OK; }); -$ans2 = Formula("-$a*x+$b")->reduce; +$ans2 = Compute("-$a*x+$b")->reduce; $evaluator2 = $ans2->cmp( checker=>sub{ my ( $correct, $student, $ansHash ) = @_; diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionComposition68.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionComposition68.pg index 20df4ee5a2..ee0c9e73ea 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionComposition68.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionComposition68.pg @@ -42,7 +42,7 @@ $a = random(2,5,1)*random(-1,1,2); $b = random(2,5,1)*random(-1,1,2); Context("Numeric"); -Context()->noreduce('(-x)-y','(-x)+y', 'x-(-y)'); +Context()->noreduce('(-x)-y','(-x)+y'); Context()->operators->set( '*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, @@ -51,9 +51,9 @@ Context()->operators->set( 'u-' => {class => 'bizarro::UOP::minus', isCommand => 1}, ); -$f = Formula("$a*x**2+$b*x")->reduce; +$f = Compute("$a*x**2+$b*x")->reduce; -$ans1 = Formula("-$a*x**2-$b*x")->reduce; +$ans1 = Compute("-$a*x**2-$b*x")->reduce; $evaluator1 = $ans1->cmp( checker=>sub{ my ( $correct, $student, $ansHash ) = @_; @@ -67,7 +67,7 @@ $evaluator1 = $ans1->cmp( return $OK; }); -$ans2 = Formula("$a*x**2-$b*x")->reduce; +$ans2 = Compute("$a*x**2-$b*x")->reduce; $evaluator2 = $ans2->cmp( checker=>sub{ my ( $correct, $student, $ansHash ) = @_; diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg index e62b505718..fee9db776d 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg @@ -32,6 +32,9 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "PCCgraphMacros.pl", + "PGchoicemacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -39,7 +42,7 @@ loadMacros( TEXT(beginproblem()); Context("Interval"); -$refreshCachedImages=1; + #Decide the number of points in the graph. $numPoints = 3; @@ -55,9 +58,13 @@ for my $i (0..$numPoints-1) { } #Intentionally create a duplicate y value in two points. +#But make sure x-values are separated by at least 3 so labels do not overlap $dup0 = random(0,$numPoints-1); do {$dup1=random(0,$numPoints-1);} until ($dup0!=$dup1); $py[$dup0]=$py[$dup1]; +if (abs($px[$dup0] - $px[$dup1]) < 3) { + ($px[$dup0],$px[$dup1]) = (-8..8)[NchooseK(17,2)]; +} #Duplicated y-value should have a corresponding x-value that is at least 2 away form the other x-value, to avoid coordinates crowding in image. while (abs($px[$dup0] - $px[$dup1]) < 2) @@ -85,31 +92,26 @@ for my $i (0..$numPoints-1) { @yticks = @$yticks_ref; $ALTPoints=""; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, 0, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); - - - for my $j (0..$numPoints-1) { - $gr[$i]->stamps( closed_circle($px[$j],$py[$j],'blue') ); - $gr[$i]->lb( new Label($px[$j],$py[$j]-$sign*$marksep[1]/8, "($px[$j],$py[$j])", 'blue','center','top','large')); - $ALTPoints .= "($px[$j],$py[$j]), "; - } + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[soliddot] coordinates {($px[0],$py[0]) ($px[1],$py[1]) ($px[2],$py[2])}; +\end{axis} +END_TIKZ + +for my $j (0,1,2) { + $ALTPoints .= "($px[$j],$py[$j]), " } $ALTPoints =~ s/, $//; @@ -126,10 +128,10 @@ A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< -[@KeyboardInstructions('To write an answer using set notation, write the elements between braces (the [`\{`] symbol and the [`\}`] symbol).')@]** +[@KeyboardInstructions('To write an answer using set notation, write the elements between braces (for example [|{1,2,4}|]*).')@]** This function has domain [______________]{$domain} and range [______________]{$range}. diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg index f49ecca520..2a08b2a386 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg @@ -31,6 +31,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PCCmacros.pl", "PGcourse.pl", ); @@ -39,7 +42,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $m = non_zero_random(-3,3,1); $b = random(-4,4,1); @@ -93,32 +96,28 @@ if ($m>0) { @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j,0, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); - - - if ($m>0) {$pos1 = 'top'; $pos2 = 'bottom'; $sign = -1;} - else {$pos1 = 'bottom'; $pos2 = 'top'; $sign = 1;} - $gr[$i]->lb( new Label($domainLowX,$domainLowY+$sign*$marksep[1]/8,"($domainLowX,$domainLowY)", 'blue','center',$pos1,'large')); - $gr[$i]->lb( new Label($domainHighX,$domainHighY-$sign*$marksep[1]/8,"($domainHighX,$domainHighY)", 'blue','center',$pos2,'large')); -} +$left = ($leftOpen==1) ? 'hollowdot' : 'soliddot'; +$right = ($rightOpen==1) ? 'hollowdot' : 'soliddot'; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+[-] coordinates {($domainLowX,$domainLowY) ($domainHighX,$domainHighY)}; + \addplot[$left] coordinates {($domainLowX,$domainLowY)} node[below left] {\(($domainLowX,$domainLowY)\)}; + \addplot[$right] coordinates {($domainHighX,$domainHighY)} node[below right] {\(($domainHighX,$domainHighY)\)}; +\end{axis} +END_TIKZ + $ALT = "graph of a linear segment from ($domainLowX,$domainLowY) to ($domainHighX,$domainHighY), with the point ($domainLowX,$domainLowY) $leftOpenClose and the point ($domainHighX,$domainHighY) $rightOpenClose"; @@ -127,22 +126,17 @@ Context("Interval"); if (($leftOpen==1) && ($rightOpen==1)) { $intDomain = Compute("($domainLowX,$domainHighX)"); $intRange = Compute("($rangeLowY,$rangeHighY)"); - add_functions($gr[0], "$m*x+$b for x in ($domainLowX,$domainHighX) using color:blue and weight:1"); } elsif (($leftOpen==0) && ($rightOpen==1)) { $intDomain = Compute("[$domainLowX,$domainHighX)"); $intRange = $m>0 ? Compute("[$rangeLowY,$rangeHighY)") : Compute("($rangeLowY,$rangeHighY]"); - add_functions($gr[0], "$m*x+$b for x in [$domainLowX,$domainHighX) using color:blue and weight:1"); } elsif (($leftOpen==1) && ($rightOpen==0)) { $intDomain = Compute("($domainLowX,$domainHighX]"); $intRange = $m>0 ? Compute("($rangeLowY,$rangeHighY]") : Compute("[$rangeLowY,$rangeHighY)"); - add_functions($gr[0], "$m*x+$b for x in ($domainLowX,$domainHighX] using color:blue and weight:1"); } else { $intDomain = Compute("[$domainLowX,$domainHighX]"); $intRange = Compute("[$rangeLowY,$rangeHighY]"); - add_functions($gr[0], "$m*x+$b for x in [$domainLowX,$domainHighX] using color:blue and weight:1"); } - ############################################## Context("LimitedNumeric"); BEGIN_PGML @@ -152,7 +146,7 @@ A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< [@KeyboardInstructions('Use interval notation.')@]** @@ -164,23 +158,14 @@ END_PGML BEGIN_PGML_SOLUTION -First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. - -The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. - -The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. +First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. Any [`x`]-value in between [`[$domainLowX]`] and [`[$domainHighX]`] is a valid input. So the domain of the function is [`[$intDomain]`]. ----- - -Next, let's find the range of this function. A function's range is the collection of possible outputs. These are the [`y`]-values of all of the points that we see shaded on the segment. - -The end-point at the bottom is [`([$rangeLowX],[$rangeLowY])`]. This point is [$bottomOpenClose], so the value [`[$rangeLowY]`] is [$bottomInclusive] in the range. -The end-point on the top is [`([$rangeHighX],[$rangeHighY])`]. This point is [$topOpenClose], so the value [`[$rangeHighY]`] is [$topInclusive] in the range. +Next, let's find the range of this function. A function's range is the collection of possible outputs. These are the [`y`]-values of all of the points that we see shaded on the segment. The end-point at the bottom is [`([$rangeLowX],[$rangeLowY])`]. This point is [$bottomOpenClose], so the value [`[$rangeLowY]`] is [$bottomInclusive] in the range. The end-point on the top is [`([$rangeHighX],[$rangeHighY])`]. This point is [$topOpenClose], so the value [`[$rangeHighY]`] is [$topInclusive] in the range. -Every [`y`] value between [`[$rangeLowY]`] and [`[$rangeHighY]`] is a possible output, so the range of the function is [`[$intRange]`]. +Every [`y`]-value between [`[$rangeLowY]`] and [`[$rangeHighY]`] is a possible output, so the range of the function is [`[$intRange]`]. END_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg index 294e2d9c1d..9e94021a3e 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg @@ -31,6 +31,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PCCmacros.pl", "PGcourse.pl", ); @@ -39,7 +42,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $m = 0; $b = non_zero_random(-4,4,1); @@ -84,30 +87,30 @@ if ($rightOpen) { @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j,0, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); - - $pos1 = 'bottom'; $pos2 = 'bottom'; $sign = 1; - $gr[$i]->lb( new Label($domainLowX,$domainLowY+$sign*$marksep[1]/8,"($domainLowX,$domainLowY)", 'blue','center',$pos1,'large')); - $gr[$i]->lb( new Label($domainHighX,$domainHighY+$sign*$marksep[1]/8,"($domainHighX,$domainHighY)", 'blue','center',$pos2,'large')); -} +$left = ($leftOpen==1) ? 'hollowdot' : 'soliddot'; +$right = ($rightOpen==1) ? 'hollowdot' : 'soliddot'; + + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+[-] coordinates {($domainLowX,$domainLowY) ($domainHighX,$domainHighY)}; + \addplot[$left] coordinates {($domainLowX,$domainLowY)} node[below left] {\(($domainLowX,$domainLowY)\)}; + \addplot[$right] coordinates {($domainHighX,$domainHighY)} node[below right] {\(($domainHighX,$domainHighY)\)}; +\end{axis} +END_TIKZ + + $ALT = "graph of a linear segment from ($domainLowX,$domainLowY) to ($domainHighX,$domainHighY), with the point ($domainLowX,$domainLowY) $leftOpenClose and the point ($domainHighX,$domainHighY) $rightOpenClose"; @@ -117,16 +120,12 @@ $intRange = Set($domainLowY); if (($leftOpen==1) && ($rightOpen==1)) { $intDomain = Compute("($domainLowX,$domainHighX)"); - add_functions($gr[0], "$m*x+$b for x in ($domainLowX,$domainHighX) using color:blue and weight:1"); } elsif (($leftOpen==0) && ($rightOpen==1)) { $intDomain = Compute("[$domainLowX,$domainHighX)"); - add_functions($gr[0], "$m*x+$b for x in [$domainLowX,$domainHighX) using color:blue and weight:1"); } elsif (($leftOpen==1) && ($rightOpen==0)) { $intDomain = Compute("($domainLowX,$domainHighX]"); - add_functions($gr[0], "$m*x+$b for x in ($domainLowX,$domainHighX] using color:blue and weight:1"); } else { $intDomain = Compute("[$domainLowX,$domainHighX]"); - add_functions($gr[0], "$m*x+$b for x in [$domainLowX,$domainHighX] using color:blue and weight:1"); } @@ -138,7 +137,7 @@ A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< [@KeyboardInstructions('Use interval notation or set notation.')@]** @@ -150,15 +149,10 @@ END_PGML BEGIN_PGML_SOLUTION -First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. - -The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. - -The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. +First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. Any [`x`]-value in between [`[$domainLowX]`] and [`[$domainHighX]`] is a valid input. So the domain of the function is [`[$intDomain]`]. ----- Next, let's find the range of this function. A function's range is the collection of possible outputs. These are the [`y`]-values of all of the points that we see shaded on the segment. diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg index 083a725c5e..4eba97a560 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg @@ -26,11 +26,13 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGtikz.pl", + "ORCCA.pl", "PCCgraphMacros.pl", + "PCCmacros.pl", "PGcourse.pl", ); @@ -39,7 +41,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $a = random(-1,1,2); $h = random(-2,2,1); @@ -91,37 +93,31 @@ if ($a>0) { ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$domainLowX,$domainHighX],[$rangeLowY,$rangeHighY,$k]); -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; - - $gr = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr->lb( new Label($j,0, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - $gr->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr->lb(new Label(0,$max[1],'y','black','left','top','large')); +$left = ($leftOpen==1) ? 'hollowdot' : 'soliddot'; +$right = ($rightOpen==1) ? 'hollowdot' : 'soliddot'; - if ($a>0) {$pos1 = 'top'; $pos2 = 'bottom'; $sign = 1;} - else {$pos1 = 'bottom'; $pos2 = 'top'; $sign = -1;} +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+[-,domain=$domainLowX:$domainHighX] {$a*(x-$h)^2+$k}; + \addplot[soliddot] coordinates {($h,$k)} node[above] {\(($h,$k)\)}; + \addplot[$left] coordinates {($domainLowX,$domainLowY)} node[below left] {\(($domainLowX,$domainLowY)\)}; + \addplot[$right] coordinates {($domainHighX,$domainHighY)} node[below right] {\(($domainHighX,$domainHighY)\)}; +\end{axis} +END_TIKZ - $gr->stamps( closed_circle($h,$k,'blue') ); - $gr->lb( new Label($h,$k-$sign*$marksep[1]/8,"($h,$k)", 'blue','center',$pos1,'large')); - $gr->lb( new Label($domainLowX,$domainLowY+$sign*$marksep[1]/8,"($domainLowX,$domainLowY)", 'blue','center',$pos2,'large')); - $gr->lb( new Label($domainHighX,$domainHighY+$sign*$marksep[1]/8,"($domainHighX,$domainHighY)", 'blue','center',$pos2,'large')); $upDown = ($a < 0) ? 'up' : 'down'; $downUp = ($a < 0) ? 'down' : 'up'; @@ -134,7 +130,6 @@ if (($leftOpen==1) && ($rightOpen==1)) { $intDomain = Compute("($domainLowX,$domainHighX)"); if ($a>0) {$intRange = Compute("[$k,$rangeHighY)");} else {$intRange = Compute("($rangeLowY,$k]");} - add_functions($gr, "$a*(x-$h)**2+$k for x in ($domainLowX,$domainHighX) using color:blue and weight:1"); } elsif (($leftOpen==0) && ($rightOpen==1)) { $intDomain = Compute("[$domainLowX,$domainHighX)"); @@ -147,7 +142,6 @@ if (($leftOpen==1) && ($rightOpen==1)) { if (($a<0)&&($domainLowY<$domainHighY)) { $intRange = Compute("[$rangeLowY,$k]");} - add_functions($gr, "$a*(x-$h)**2+$k for x in [$domainLowX,$domainHighX) using color:blue and weight:1"); } elsif (($leftOpen==1) && ($rightOpen==0)) { $intDomain = Compute("($domainLowX,$domainHighX]"); @@ -160,12 +154,10 @@ if (($leftOpen==1) && ($rightOpen==1)) { if (($a<0)&&($domainLowY<$domainHighY)) { $intRange = Compute("($rangeLowY,$k]");} - add_functions($gr, "$a*(x-$h)**2+$k for x in ($domainLowX,$domainHighX] using color:blue and weight:1"); } else { $intDomain = Compute("[$domainLowX,$domainHighX]"); if ($a>0) {$intRange = Compute("[$k,$rangeHighY]");} else {$intRange = Compute("[$rangeLowY,$k]");} - add_functions($gr, "$a*(x-$h)**2+$k for x in [$domainLowX,$domainHighX] using color:blue and weight:1"); } @@ -178,7 +170,7 @@ A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< [@KeyboardInstructions('Use interval notation.')@]** @@ -216,21 +208,12 @@ END_PGML_SOLUTION BEGIN_PGML_SOLUTION -First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. - -The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. - -The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. +First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. Any [`x`]-value in between [`[$domainLowX]`] and [`[$domainHighX]`] is a valid input. So the domain of the function is [`[$intDomain]`]. ----- - -Next, let's find the range of this function. A function's range is the collection of possible outputs. These are the [`y`]-values of all of the points that we see shaded on the segment. - -The end-point at the bottom is [`([$rangeLowX],[$rangeLowY])`]. This point is [$bottomOpenClose], so the value [`[$rangeLowY]`] is [$bottomInclusive] in the range. -The end-point on the top is the parabola's vertex [`([$h],[$k])`]. The value [`[$k]`] is included in the range. +Next, let's find the range of this function. A function's range is the collection of possible outputs. These are the [`y`]-values of all of the points that we see shaded on the segment. The end-point at the bottom is [`([$rangeLowX],[$rangeLowY])`]. This point is [$bottomOpenClose], so the value [`[$rangeLowY]`] is [$bottomInclusive] in the range. The end-point on the top is the parabola's vertex [`([$h],[$k])`]. The value [`[$k]`] is included in the range. So the range of the function is [`[$intRange]`]. diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg index 43da234653..e9ddfc75d7 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg @@ -26,12 +26,13 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -40,7 +41,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $xAsymptote = random(-3,3,1); $yAsymptote = random(-3,3,1); @@ -52,48 +53,29 @@ $func = Compute("$k/(x-$xAsymptote)+$yAsymptote")->reduce; @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j,0, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); - - - $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); - - $gr[$i]->moveTo($xAsymptote,$min[0]); - $gr[$i]->lineTo($xAsymptote,$max[0],'red',2,'dashed'); - - $gr[$i]->moveTo($min[1],$yAsymptote); - $gr[$i]->lineTo($max[1],$yAsymptote,'red',2,'dashed'); - $xplot1= ($k < 1) ? $k/($max[1]-$yAsymptote)+$xAsymptote : $k/($min[1]-$yAsymptote)+$xAsymptote; $xplot2= ($k < 1) ? $k/($min[1]-$yAsymptote)+$xAsymptote : $k/($max[1]-$yAsymptote)+$xAsymptote; - add_functions($gr[$i], "$func for x in <$min[0],$xplot1> using color:blue and weight:1"); - add_functions($gr[$i], "$func for x in <$xplot2,$max[0]> using color:blue and weight:1"); -} - $gr[$i]->moveTo($xplot1-0.1,$func->eval(x=>"$xplot1-0.1")); - $gr[$i]->arrowTo($xplot1,$func->eval(x=>"$xplot1"),'blue',1); - $gr[$i]->moveTo($xplot2+0.1,$func->eval(x=>"$xplot2+0.1")); - $gr[$i]->arrowTo($xplot2,$func->eval(x=>"$xplot2"),'blue',1); - $gr[$i]->moveTo($min[0]+0.1,$func->eval(x=>"$min[0]+0.1")); - $gr[$i]->arrowTo($min[0],$func->eval(x=>"$min[0]"),'blue',1); - $gr[$i]->moveTo($max[0]-0.1,$func->eval(x=>"$max[0]-0.1")); - $gr[$i]->arrowTo($max[0],$func->eval(x=>"$max[0]"),'blue',1); + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot[firstcurve,domain=$min[0]:$xplot1,samples=50] {$k/(x-$xAsymptote)+$yAsymptote}; + \addplot[firstcurve,domain=$xplot2:$max[0],samples=50] {$k/(x-$xAsymptote)+$yAsymptote}; + \addplot[asymptote] coordinates {($xAsymptote,$min[0]) ($xAsymptote,$max[0])}; + \addplot[asymptote] coordinates {($min[1],$yAsymptote) ($max[1],$yAsymptote)}; +\end{axis} +END_TIKZ + if ($k>0) { @@ -116,7 +98,7 @@ A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< [@KeyboardInstructions('Use interval notation.')@]** diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg index 7ba06a7ad9..f8bc50caef 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg @@ -40,7 +40,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $xAsymptote = random(-3,3,1); $yAsymptote = random(-3,3,1); diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg index 604d26214b..4be5859a4d 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg @@ -28,10 +28,11 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "PGgraphmacros.pl", "PGML.pl", "PCCmacros.pl", "PCCgraphMacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -65,33 +66,22 @@ $ymin = min(-5,$y[2]-2); $ymax = $y[1]+4; -$gr = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[240,240] -); - - $gr->lb('reset'); - for my $j ($xmin+1..$xmax-1) { - if ($j % 2 == 1 or $j == 0) {next;} - $gr->lb( new Label($j, 0, $j,'black','center','top','large')); - } - - for my $j ($ymin+1..$ymax-1) { - if ($j % 2 == 1 or $j == 0) {next;} - $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); - $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); - - -$gr->moveTo($x[0],$y[0]); -$gr->arrowTo($xmin+1,$ymax,'blue','1'); -$gr->moveTo($x[0],$y[0],); -$gr->lineTo($x[1],$y[1],'blue','1'); -$gr->lineTo($x[2],$y[2],'blue','1'); -$gr->arrowTo($xmax-0.5,$ymax,'blue','1'); +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+ coordinates {($xmin+1,$ymax) ($x[0],$y[0]) ($x[1],$y[1]) ($x[2],$y[2]) ($xmax-0.5,$ymax)}; +\end{axis} +END_TIKZ $ALT = "a graph of a curve resembling the letter W, except that arrows indicate the arms of the W extend forever up and to the left, and up and to the right; the corners of the W are at ($x[0],$y[0]), ($x[1],$y[1]), and ($x[2],$y[2])"; @@ -102,7 +92,7 @@ A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr), width=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< [@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the capital letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext50.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext50.pg index 3e22d03e62..8d792ddeb5 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext50.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext50.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext60.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext60.pg index f9a4a8d215..0a7ad97a9c 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext60.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext60.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext70.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext70.pg index 0fbaaa0603..5dbde1b5aa 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext70.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext70.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(w => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation10.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation10.pg index db56217a57..f7fe3e9f37 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation10.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation10.pg @@ -69,7 +69,7 @@ BEGIN_PGML Solve for [`x`], where [`[$fname](x)=[$func]`]. -[@KeyboardInstructions('If there is no real solution, type no [|real solution|]*.')@]** +[@KeyboardInstructions('If there is no real solution, type [|no real solution|]*.')@]** a. [`[$fname](x)=[$y1]`] [____________]{$ans1} diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation20.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation20.pg index d5d9cf16c2..7e86309506 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation20.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation20.pg @@ -58,7 +58,7 @@ BEGIN_PGML Solve for [`x`], where [`[$fname](x)=[$func]`]. -[@KeyboardInstructions('If there is no real solution, type no [|real solution|]*.')@]** +[@KeyboardInstructions('If there is no real solution, type [|no real solution|]*.')@]** a. [`[$fname](x)=[$y1]`] [____________]{$ans1} diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation30.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation30.pg index bc43a4a2d1..e2ccdbed36 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation30.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionEquation30.pg @@ -73,7 +73,7 @@ BEGIN_PGML Solve for [`x`], where [`[$fname](x)=[$func]`]. -[@KeyboardInstructions('If there is no real solution, type no [|real solution|]*.')@]** +[@KeyboardInstructions('If there is no real solution, type [|no real solution|]*.')@]** [`[$fname](x)=[$y1]`] [____________]{$ans} diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionInContext20.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionInContext20.pg index 3f61a292fe..b58b85a032 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionInContext20.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionInContext20.pg @@ -87,10 +87,12 @@ for my $i (0..3) { $correctAns = $answersShuffled[$inverse[0]]; $radio = RadioButtons( -[[ "Each pass costs ".math_ev3($x1C).", and it works for ".math_ev3($y1)." days.", +[[ + "If a pass costs ".math_ev3($x1C).", it will work for ".math_ev3($y1)." days.", + "Each pass costs ".math_ev3($x1C).", and it works for ".math_ev3($y1)." days.", "Each pass costs ".math_ev3($y1C).", and it works for ".math_ev3($x1)." days.", "If a pass costs ".math_ev3($y1C).", it will work for ".math_ev3($x1)." days.", - "If a pass costs ".math_ev3($x1C).", it will work for ".math_ev3($y1)." days.",]], +]], 0, labels => "ABC", ); diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg index 9bf847c9c1..cd60e88969 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg @@ -26,12 +26,14 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "parserPopUp.pl", + "PGtikz.pl", + "PCCmacros.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -39,7 +41,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + #Decide the number of points in the graph. $numPoints = 3; @@ -92,32 +94,90 @@ for my $i (2..3) { @xticks = @$xticks_ref; @yticks = @$yticks_ref; + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[soliddot] coordinates {($px[0][0],$py[0][0]) ($px[0][1],$py[0][1]) ($px[0][2],$py[0][2])}; +\end{axis} +END_TIKZ + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[soliddot] coordinates {($px[1][0],$py[1][0]) ($px[1][1],$py[1][1]) ($px[1][2],$py[1][2])}; +\end{axis} +END_TIKZ + +$gr[2] = createTikZImage(); +$gr[2]->addToPreamble(latexImagePreamble()); +$gr[2]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[soliddot] coordinates {($px[2][0],$py[2][0]) ($px[2][1],$py[2][1]) ($px[2][2],$py[2][2])}; + \addplot[verticallinetest] coordinates {($px[2][0],$min[1]) ($px[2][0],$max[1])}; + \addplot[verticallinetest] coordinates {($px[2][1],$min[1]) ($px[2][1],$max[1])}; + \addplot[verticallinetest] coordinates {($px[2][2],$min[1]) ($px[2][2],$max[1])}; +\end{axis} +END_TIKZ + +$gr[3] = createTikZImage(); +$gr[3]->addToPreamble(latexImagePreamble()); +$gr[3]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[soliddot] coordinates {($px[3][0],$py[3][0]) ($px[3][1],$py[3][1]) ($px[3][2],$py[3][2])}; + \addplot[verticallinetest] coordinates {($px[3][0],$min[1]) ($px[3][0],$max[1])}; + \addplot[verticallinetest] coordinates {($px[3][1],$min[1]) ($px[3][1],$max[1])}; + \addplot[verticallinetest] coordinates {($px[3][2],$min[1]) ($px[3][2],$max[1])}; +\end{axis} +END_TIKZ + + + + @ALT=(); @ALTPoints=(); for my $i (0..3) { $ALTPoints[$i]=""; - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j,0, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - $gr[$i]->lb( new Label($max[0], 0, 'x','black','right','bottom','large')); - $gr[$i]->lb( new Label(0, $max[1], 'y','black','left','top','large')); for my $j (0..$numPoints-1) { - $gr[$i]->stamps( closed_circle($px[$i][$j],$py[$i][$j],'blue') ); - $gr[$i]->lb( new Label($px[$i][$j],$py[$i][$j]-$sign*$marksep[1]/8, "($px[$i][$j],$py[$i][$j])", 'blue','center','top','large')); $ALTPoints[$i] .= "($px[$i][$j],$py[$i][$j]), "; } @@ -140,7 +200,7 @@ Decide whether each graph shows a relationship where [`y`] is a function of [`x` [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@image(insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]* << +>>[@image($gr[0], width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@image($gr[1], width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]* << The first graph [__]{$popup[0]} give a function of [`x`]. The second graph [__]{$popup[1]} give a function of [`x`]. @@ -151,13 +211,6 @@ END_PGML $showPartialCorrectAnswers = 0; -for my $i (2..3) { - for my $j (0..$numPoints-1) { - $gr[$i]->moveTo($px[$i][$j],$min[1]); - $gr[$i]->lineTo($px[$i][$j],$max[1],'red',2,'dashed'); - } -} - ####################################################### $graph1Output1 = $isFunction[0] ? "passed" : "did not pass"; @@ -174,18 +227,14 @@ BEGIN_PGML_SOLUTION If a graph shows a relationship where [`y`] is a function of [`x`], it has to pass the vertical line test. -The first fraph [$graph1Output1] the test, and thus it [$graph1Output2] [`y`] as a function of [`x`]. +>> [@image($gr[2], width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@image($gr[3], width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT3' title = '$ALT3'") @]* << ->>### Graph 1 ### << +The first graph [$graph1Output1] the test, and thus it [$graph1Output2] [`y`] as a function of [`x`]. ->>[@image(insertGraph($gr[2]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< The second graph [$graph2Output1] the test, and thus it [$graph2Output2] [`y`] as a function of [`x`]. ->>### Graph 2 ### << - ->>[@image(insertGraph($gr[3]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT3' title = '$ALT3'") @]*<< END_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg index dd5054e315..c8a8c60f70 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg @@ -32,6 +32,9 @@ loadMacros( "PGML.pl", "PCCgraphMacros.pl", "parserPopUp.pl", + "PGtikz.pl", + "PCCmacros.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -39,7 +42,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + #Decide whether each graphs shows a function or non-function. @@ -93,79 +96,79 @@ for my $i (2..3) { ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$h+1, $h-1,$b+1, $b-1],[$k+1, $k-1,$c, $c+1, $c-1],centerOrigin=>1); -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; - -@gr=(); - -for my $i (0..3) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, 0, $j,'black','center','top','large')); - } +if ($a > 0) {@top = (sqrt(($max[1]-$k)/$a)+$h, -sqrt(($max[1]-$k)/$a)+$h)} + else {@top = (sqrt(($min[1]-$k)/$a)+$h, -sqrt(($min[1]-$k)/$a)+$h)}; +if ($d > 0) {@right = (sqrt(($max[0]+$b)*$d)+$c, -sqrt(($max[0]+$b)*$d)+$c)} + else {@right = (sqrt(($min[0]+$b)*$d)+$c, -sqrt(($min[0]+$b)*$d)+$c)}; + + +@xvaluesfunc = num_sort($min[0],$max[0],@top); +@yvaluesnonfunc = num_sort($min[1],$max[1],@right); + +for my $i (0,1) { + +$plot[$i] = ($isFunction[$i]) ? "\\addplot+[domain=$xvaluesfunc[1]:$xvaluesfunc[2]] {$a*(x-$h)^2+$k};" : "\\addplot+[domain=$yvaluesnonfunc[1]:$yvaluesnonfunc[2]] ({(x-$c)^2/$d-$b},{x});"; +$points[$i] = "\\addplot[soliddot] coordinates " . (($isFunction[$i]) ? "{($h,$k) ($h-1,$k+$a) ($h+1,$k+$a) ($h-2,$k+4*$a) ($h+2,$k+4*$a)}" : "{(-$b+1/$d,$c+1) (-$b+1/$d,$c-1) (-$b+4/$d,$c+2) (-$b+4/$d,$c-2) (-$b+9/$d,$c+3) (-$b+9/$d,$c-3)}") . ";"; +$guidelines[$i] = "\\addplot[verticallinetest] coordinates " . (($isFunction[$i]) ? "{($h-2,$min[1]) ($h-2,$max[1])}" : "{(-$b+1/$d,$min[1]) (-$b+1/$d,$max[1])}") . ";"; +$guidelines[$i] .= "\\addplot[verticallinetest] coordinates " . (($isFunction[$i]) ? "{($h-1,$min[1]) ($h-1,$max[1])}" : "{(-$b+4/$d,$min[1]) (-$b+4/$d,$max[1])}") . ";"; +$guidelines[$i] .= "\\addplot[verticallinetest] coordinates " . (($isFunction[$i]) ? "{($h,$min[1]) ($h,$max[1])}" : "{(-$b+9/$d,$min[1]) (-$b+9/$d,$max[1])}") . ";"; +$guidelines[$i] .= "\\addplot[verticallinetest] coordinates {($h,$min[1]) ($h,$max[1])};" if ($isFunction[$i]); +$guidelines[$i] .= "\\addplot[verticallinetest] coordinates {($h+1,$min[1]) ($h+1,$max[1])};" if ($isFunction[$i]); +$guidelines[$i] .= "\\addplot[verticallinetest] coordinates {($h+2,$min[1]) ($h+2,$max[1])};" if ($isFunction[$i]); + +$gr[$i] = createTikZImage(); +$gr[$i]->addToPreamble(latexImagePreamble()); +$gr[$i]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + $plot[$i] +\end{axis} +END_TIKZ + + +$gr[$i+2] = createTikZImage(); +$gr[$i+2]->addToPreamble(latexImagePreamble()); +$gr[$i+2]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + $plot[$i] + $points[$i] + $guidelines[$i] +\end{axis} +END_TIKZ - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - for my $j (0..1) { - $fn[$i] = new Fun( $xfunc[$i], $yfunc[$i], $gr[$i] ); - $fn[$i] -> domain(0,6.28); - $fn[$i] -> weight(1); - } +} - $gr[$i]->lb( new Label($max[0], 0, 'x','black','right','bottom','large')); - $gr[$i]->lb( new Label(0, $max[1], 'y','black','left','top','large')); - - if ($isFunction[$i]==1 and $a > 0) { - @ends = num_sort($min[0],$max[0],sqrt(($max[1]-$k)/$a)+$h,-sqrt(($max[1]-$k)/$a)+$h); - $start = $ends[1]; $stop = $ends[2]; - $pixel = ($max[0]-$min[0])/240; - $gr[$i]->moveTo($start+2*$pixel,$a*($start+2*$pixel-$h)**2+$k); - $gr[$i]->arrowTo($start,$a*($start-$h)**2+$k,'blue',1); - $gr[$i]->moveTo($stop-2*$pixel,$a*($stop-2*$pixel-$h)**2+$k); - $gr[$i]->arrowTo($stop,$a*($stop-$h)**2+$k,'blue',1); - } - elsif ($isFunction[$i]==1 and $a < 0) { - @ends = num_sort($min[0],$max[0],sqrt(($min[1]-$k)/$a)+$h,-sqrt(($min[1]-$k)/$a)+$h); - $start = $ends[1]; $stop = $ends[2]; - $pixel = ($max[0]-$min[0])/240; - $gr[$i]->moveTo($start+2*$pixel,$a*($start+2*$pixel-$h)**2+$k); - $gr[$i]->arrowTo($start,$a*($start-$h)**2+$k,'blue',1); - $gr[$i]->moveTo($stop-2*$pixel,$a*($stop-2*$pixel-$h)**2+$k); - $gr[$i]->arrowTo($stop,$a*($stop-$h)**2+$k,'blue',1); - } - elsif ($isFunction[$i]==0 and $d > 0) { - @ends = num_sort($min[1],$max[1],sqrt(($max[0]+$b)*$d)+$c,-sqrt(($max[0]+$b)*$d)+$c); - $start = $ends[1]; $stop = $ends[2]; - $pixel = ($max[1]-$min[1])/240; - $gr[$i]->moveTo(($start+2*$pixel-$c)**2/$d-$b,$start+2*$pixel); - $gr[$i]->arrowTo(($start-$c)**2/$d-$b,$start,'blue',1); - $gr[$i]->moveTo(($stop-2*$pixel-$c)**2/$d-$b,$stop-2*$pixel); - $gr[$i]->arrowTo(($stop-$c)**2/$d-$b,$stop,'blue',1); - } - elsif ($isFunction[$i]==0 and $d < 0) { - @ends = num_sort($min[1],$max[1],sqrt(($min[0]+$b)*$d)+$c,-sqrt(($min[0]+$b)*$d)+$c); - $start = $ends[1]; $stop = $ends[2]; - $pixel = ($max[1]-$min[1])/240; - $gr[$i]->moveTo(($start+2*$pixel-$c)**2/$d-$b,$start+2*$pixel); - $gr[$i]->arrowTo(($start-$c)**2/$d-$b,$start,'blue',1); - $gr[$i]->moveTo(($stop-2*$pixel-$c)**2/$d-$b,$stop-2*$pixel); - $gr[$i]->arrowTo(($stop-$c)**2/$d-$b,$stop,'blue',1); - } -} $ALT0 = $ALT[0]; $ALT1 = $ALT[1]; +for my $i (2..3) { + if ($isFunction[$i-2]==1) { + $ALT[$i] .= " No vertical line crosses it more than once."; + } else { + $ALT[$i] .= " A vertical line crosses it at more than one point."; + } +} + ############################################## BEGIN_PGML @@ -174,7 +177,7 @@ The following graphs show two relationships. Decide whether each graph shows a r [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@image(insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]* << +>>[@image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]* << The first graph [__]{$popup[0]} give a function of [`x`]. The second graph [__]{$popup[1]} give a function of [`x`]. @@ -186,26 +189,6 @@ $showPartialCorrectAnswers = 0; ####################################################### -for my $i (2..3) { - if ($isFunction[$i-2]==1) { - for my $j (-1..1) { - $gr[$i]->moveTo($h+$j,$min[1]); - $gr[$i]->lineTo($h+$j,$max[1],'red',2,'dashed'); - $gr[$i]->stamps( closed_circle($h+$j,$functions[$i][1]->eval(x=>($h+$j)),'blue') ); - } - $ALT[$i] .= " No vertical line crosses it more than once."; - } else { - $gr[$i]->moveTo(1/$d-$b,$min[1]); - $gr[$i]->lineTo(1/$d-$b,$max[1],'red',2,'dashed'); - $x1 = 1/$d-$b; - $y1 = $c+1; - $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); - $x2 = 1/$d-$b; - $y2 = $functions[$i][1]->eval(x=>$x2); - $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); - $ALT[$i] .= " A vertical line crosses it at more than one point."; - } -} $graph1Output1 = $isFunction[0] ? "passed" : "did not pass"; $graph2Output1 = $isFunction[1] ? "passed" : "did not pass"; @@ -221,18 +204,10 @@ BEGIN_PGML_SOLUTION If a graph represents [`y`] as a function of [`x`], it has to pass the vertical line test. -Graph 1 [$graph1Output1] the test, and thus it [$graph1Output2] [`y`] as a function of [`x`]. - ->>###Graph 1 ### << - ->>[@image(insertGraph($gr[2]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< - - -Graph 2 [$graph2Output1] the test, and thus it [$graph2Output2] [`y`] as a function of [`x`]. - ->>###Graph 2 ### << +>>[@image($gr[2], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@image($gr[3], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT3' title = '$ALT3'") @]*<< ->>[@image(insertGraph($gr[3]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT3' title = '$ALT3'") @]*<< +The first graph [$graph1Output1] the test, and thus it [$graph1Output2] [`y`] as a function of [`x`]. +The second graph [$graph2Output1] the test, and thus it [$graph2Output2] [`y`] as a function of [`x`]. END_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg index 75fc9a9673..0496130baf 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg @@ -40,7 +40,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + #parameters for graphs $a = random(-6,-3,1); diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg index c858470b7e..85555ff252 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg @@ -34,6 +34,8 @@ loadMacros( "answerHints.pl", "PCCmacros.pl", "contextFiniteSolutionSets.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -44,7 +46,7 @@ TEXT(beginproblem()); Context("Numeric"); $var = "x"; -$refreshCachedImages=1; + Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); parser::Assignment->Allow; @@ -116,33 +118,26 @@ $ansXDup1 = $ansXDups[1]; @yticks = @$yticks_ref; $ALTPoints=""; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, 0, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - for my $j (0..$numPoints-1) { - $gr[$i]->stamps( closed_circle($px[$j],$py[$j],'blue') ); - $gr[$i]->lb( new Label($px[$j],$py[$j]-$sign*$marksep[1]/8, "($px[$j],$py[$j])", 'blue','center','top','large')); - $ALTPoints .= "($px[$j],$py[$j]), "; - } - - $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); -} + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[soliddot] coordinates {($px[0],$py[0]) ($px[1],$py[1]) ($px[2],$py[2])}; + \legend{\(y=f(x)\)}; +\end{axis} +END_TIKZ + $ALTPoints =~ s/, $//; $ALTPoints =~ s|(.+), |$1 and |; @@ -171,7 +166,7 @@ Function [`f`] is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< a. Find [``f([$ansXNoDup])``]. [_]{Compute($ansYNoDup)}{10} diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg index e856d4cfb9..e4d4327a3a 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg @@ -32,7 +32,10 @@ loadMacros( "PCCgraphMacros.pl", "parserAssignment.pl", "answerHints.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -43,7 +46,7 @@ TEXT(beginproblem()); Context("Numeric"); $var = "x"; -$refreshCachedImages=1; + Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); parser::Assignment->Allow; @@ -85,50 +88,71 @@ $func = Compute("$m*x+$b")->reduce; @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..2) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j,0, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - @xvalues = num_sort($min[0],$max[0],($min[1]-$b)/$m,($max[1]-$b)/$m); - $midx = ($xvalues[1]+$xvalues[2])/2; - $midy = $m*$midx+$b; - $gr[$i]->moveTo($midx,$midy); - $gr[$i]->arrowTo($xvalues[1],$m*$xvalues[1]+$b,'blue',1); - $gr[$i]->moveTo($midx,$midy); - $gr[$i]->arrowTo($xvalues[2],$m*$xvalues[2]+$b,'blue',1); - - $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); - -} +@xvalues = num_sort($min[0],$max[0],($min[1]-$b)/$m,($max[1]-$b)/$m); + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; +\end{axis} +END_TIKZ + + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; + \addplot[soliddot] coordinates {($p0x,$p0y)} node[right] {\(($p0x,$p0y)\)}; + \addplot[asymptote] coordinates {($p0x,$min[1]) ($p0x,$max[1])}; +\end{axis} +END_TIKZ + + +$gr[2] = createTikZImage(); +$gr[2]->addToPreamble(latexImagePreamble()); +$gr[2]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; + \addplot[soliddot] coordinates {($p1x,$p1y)} node[below] {\(($p1x,$p1y)\)}; + \addplot[asymptote] coordinates {($min[0],$p1y) ($max[0],$p1y)}; +\end{axis} +END_TIKZ -$ALT0 = "graph of a line passing through the points ($p0x,$p0y) and ($p1x,$p1y)"; -#the graph used in solution to find f(x)=? -$gr[1]->stamps( closed_circle($p0x,$p0y,'red') ); -$gr[1]->lb( new Label($p0x+$marksep[1]/8,$p0y+$marksep[1]/8,"($p0x,$p0y)",'red','left','bottom','large')); -$gr[1]->moveTo($p0x,$min[1]); -$gr[1]->lineTo($p0x,$max[1],'red',2,'dashed'); +$ALT0 = "graph of a line passing through the points ($p0x,$p0y) and ($p1x,$p1y)"; $ALT1 = "This is the graph of a line passing through the points ($p0x,$p0y) and ($p1x,$p1y). A dashed vertical line x=$p0x crosses the line at ($p0x,$p0y)."; - -#the graph used in solution to find f(?)=$p1y -$gr[2]->stamps( closed_circle($p1x,$p1y,'red') ); -$gr[2]->lb( new Label($p1x,$p1y+$marksep[1]/8,"($p1x,$p1y)",'red','center','bottom','large')); -$gr[2]->moveTo($min[0],$p1y); -$gr[2]->lineTo($max[0],$p1y,'red',2,'dashed'); $ALT2 = "This is the graph of a line passing through the points ($p0x,$p0y) and ($p1x,$p1y). A dashed horizontal line y=$p1y crosses the line at ($p1x,$p1y)."; $xeqp1x = Compute("x=$p1x"); @@ -142,11 +166,9 @@ Function [`f`] is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< +>>[@image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< -[@KeyboardInstructions('If there is more than one answer to a question, you can use commas and the word [|or|]*. When solving an equation for the variable [`x`], your answer should be in the form [|x=___|]*.')@]** - -a. Find [``f([$p0x])={}``]. +a. Find [``f([$p0x])``]. [__________] a. Solve [``f(x)=[$p1y]``]. @@ -158,47 +180,12 @@ END_PGML $showPartialCorrectAnswers = 1; ANS(Compute($p0y)->cmp); -ANS($xeqp1x->cmp( - checker => sub { - my ($correct,$student,$ans) = @_; - # count the number of student answers - my $fullStudent = $ans->{student_formula}; - my @fullStudentValue = $fullStudent->value; - my $n = scalar(@fullStudentValue); # number of student answers - if($n>1) - { - $student->context->setError("Does this equation have more than one unique solution?","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # if the student has said no real solutions, ask them about it - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try factoring or using the quadratic formula","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # check that the student has written x= - if ($student->type ne "Assignment" && $ans->{student_formula}->type ne "Assignment") { - $student->context->setError("Your entry should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return $correct == $student; - } -)->withPostFilter(sub { - my $ansHash = shift; - if ($ansHash->{score}) { - my ($cvar,$cfrac) = $ansHash->{correct_value}->value; # get - my ($svar,$sfrac) = $ansHash->{student_value}->value; # get - my $check = $cfrac->cmp->evaluate($sfrac->string); # do a - $ansHash->{score} = $check->{score}; - $ansHash->{ans_message} = $check->{ans_message}; # and any - } - return $ansHash; - }, - ), -); + +Context("FiniteSolutionSets"); +$solset = Formula("{$p1x}"); + +ANS($solset->cmp()); + ############################################## @@ -209,11 +196,11 @@ BEGIN_PGML_SOLUTION To evaluate [`f([$p0x])`], we understand that we have been given an [`x`]-value of [`[$p0x]`]. On the graph, we draw a dotted vertical line at [`x=[$p0x]`], and it intersects the function's graph at [`([$p0x],[$p0y])`]. This implies [`f([$p0x])=[$p0y]`]. See the graph below. ->>[@image(insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]*<< +>>[@image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]*<< To solve [`f(x)=[$p1y]`], we understand that we have been given a [`y`]-value of [`[$p1y]`]. On the graph, we draw a dotted horizontal line at [`y=[$p1y]`], and it intersects the function's graph at [`([$p1x],[$p1y])`]. This implies [`f([$p1x])=[$p1y]`]. See the graph below. ->>[@image(insertGraph($gr[2]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< +>>[@image($gr[2], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< END_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg index b76de9e1df..bd34250b66 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg @@ -33,6 +33,9 @@ loadMacros( "parserAssignment.pl", "answerHints.pl", "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "contextFiniteSolutionSets.pl", "PGcourse.pl", ); @@ -43,7 +46,7 @@ TEXT(beginproblem()); Context("Numeric"); $var = "x"; -$refreshCachedImages=1; + Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); parser::Assignment->Allow; @@ -95,58 +98,76 @@ $ansList = List($p1x,$p2x); @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..2) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, 0, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - add_functions($gr[$i], "$a*(x-$b)**2+$c for x in [$min[0],$max[0]] using color:blue and weight:1"); - - if ($a > 0) - {@xvalues = num_sort($min[0], $max[0], sqrt(($max[0]-$c)/$a)+$b, -sqrt(($max[0]-$c)/$a)+$b)} - else - {@xvalues = num_sort($min[0], $max[0], sqrt(($min[0]-$c)/$a)+$b, -sqrt(($min[0]-$c)/$a)+$b)} - $start = $xvalues[1]; - $stop = $xvalues[2]; - $pixel = ($max[0]-$min[0])/240; - $gr[$i]->moveTo($start+$pixel, $a*($start+$pixel-$b)**2+$c); - $gr[$i]->arrowTo($start,$a*($start-$b)**2+$c,'blue',1); - $gr[$i]->moveTo($stop-$pixel, $a*($stop-$pixel-$b)**2+$c); - $gr[$i]->arrowTo($stop,$a*($start-$b)**2+$c,'blue',1); - - $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); - -} +if ($a > 0) + {@xvalues = num_sort($min[0], $max[0], sqrt(($max[0]-$c)/$a)+$b, -sqrt(($max[0]-$c)/$a)+$b)} +else + {@xvalues = num_sort($min[0], $max[0], sqrt(($min[0]-$c)/$a)+$b, -sqrt(($min[0]-$c)/$a)+$b)} + + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; +\end{axis} +END_TIKZ + + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; + \addplot[soliddot] coordinates {($p0x,$p0y)} node[right] {\(($p0x,$p0y)\)}; + \addplot[asymptote] coordinates {($p0x,$min[1]) ($p0x,$max[1])}; +\end{axis} +END_TIKZ + + +$gr[2] = createTikZImage(); +$gr[2]->addToPreamble(latexImagePreamble()); +$gr[2]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; + \addplot[soliddot] coordinates {($p1x,$p1y)} node[below] {\(($p1x,$p1y)\)}; + \addplot[soliddot] coordinates {($p2x,$p2y)} node[below] {\(($p2x,$p2y)\)}; + \addplot[asymptote] coordinates {($min[0],$p1y) ($max[0],$p1y)}; +\end{axis} +END_TIKZ -$ALT0 = "graph of a parabola passing through the points ($p0x,$p0y), ($p1x,$p1y) and ($p2x,$p2y)"; -#the graph used in solution to find f(x)=? -$gr[1]->stamps( closed_circle($p0x,$p0y,'red') ); -$gr[1]->lb( new Label($p0x+$marksep[1]/8,$p0y+$marksep[1]/8,"($p0x,$p0y)",'red','left','bottom','large')); -$gr[1]->moveTo($p0x,$min[1]); -$gr[1]->lineTo($p0x,$max[1],'red',2,'dashed'); +$ALT0 = "graph of a parabola passing through the points ($p0x,$p0y), ($p1x,$p1y) and ($p2x,$p2y)"; $ALT1 = "This is the graph of aparabola passing through the points ($p0x,$p0y), ($p1x,$p1y) and ($p2x,$p2y). A dashed vertical line x=$p0x intersects the parabola at ($p0x,$p0y)."; - -#the graph used in solution to find f(?)=$p1y -$gr[2]->stamps( closed_circle($p1x,$p1y,'red') ); -$gr[2]->lb( new Label($p1x,$p1y+$marksep[1]/8,"($p1x,$p1y)",'red','center','bottom','large')); -$gr[2]->stamps( closed_circle($p2x,$p2y,'red') ); -$gr[2]->lb( new Label($p2x,$p2y+$marksep[1]/8,"($p2x,$p2y)",'red','center','bottom','large')); -$gr[2]->moveTo($min[0],$p1y); -$gr[2]->lineTo($max[0],$p1y,'red',2,'dashed'); $ALT2 = "This is the graph of a parabola passing through the points ($p0x,$p0y), ($p1x,$p1y) and ($p2x,$p2y). A dashed horizontal line y=$p1y intersects the parabola at ($p1x,$p1y) and ($p2x,$p2y)."; @@ -160,6 +181,9 @@ Context()->operators->set(","=>{string=>"or",TeX=>"or ",perl=>","}); $xeqansList = List(Formula("x=$p1x"),Formula("x=$p2x")); +Context("FiniteSolutionSets"); +$solset = Formula("{$p1x,$p2x}"); + ############################################## Context("LimitedNumeric"); BEGIN_PGML @@ -169,15 +193,14 @@ Function [`f`] is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< +>>[@image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< -[@KeyboardInstructions('If there is more than one answer to a question, you can use commas and the word [|or|]*. When solving an equation for the variable [`x`], your answer should be in the form [|x=___|]*.')@]** -a. Find [``f([$p0x])={}``]. +a. Find [``f([$p0x])``]. [_]{Compute($p0y)}{10} a. Solve [``f(x)=[$p1y]``]. - [_]{$xeqansList}{20} + [_]{$solset}{20} END_PGML @@ -188,11 +211,11 @@ BEGIN_PGML_SOLUTION To evaluate [`f([$p0x])`], we understand that we have been given an [`x`]-value of [`[$p0x]`]. On the graph, we draw a dotted vertical line at [`x=[$p0x]`], and it intersects the function's graph at [`([$p0x],[$p0y])`]. This implies [`f([$p0x])=[$p0y]`]. See the graph below. ->>[@image(insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]*<< +>>[@image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]*<< To solve [`f(x)=[$p1y]`], we understand that we have been given a [`y`]-value of [`[$p1y]`]. On the graph, we draw a dotted horizontal line at [`y=[$p1y]`], and it intersects the function's graph at [`([$p1x],[$p1y])`] and [`([$p2x],[$p2y])`]. This implies [`f([$p1x])=[$p1y]`] and [`f([$p2x])=[$p2y]`]. See the graph below. ->>[@image(insertGraph($gr[2]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< +>>[@image($gr[2], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< END_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg index 26291ef2a8..308d98e4ca 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg @@ -40,7 +40,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + do { $xMin = -4; diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph45.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph45.pg index 2329805543..90c0a5a693 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph45.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph45.pg @@ -32,13 +32,16 @@ loadMacros( "PCCgraphMacros.pl", "parserRadioButtons.pl", "PGchoicemacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PCCmacros.pl", "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); @@ -75,36 +78,50 @@ $y2 = $y3; @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..1) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[240,144] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (Real($j) == 0) {next;} - $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - add_functions($gr[$i], "$func1 for x in <0,$e1> using color:blue and weight:1"); - add_functions($gr[$i], "$e1*$m1 for x in <$e1,$e2> using color:blue and weight:1"); - add_functions($gr[$i], "$func2 for x in <$e2,$e3> using color:blue and weight:1"); - - $gr[$i]->lb( new Label($max[0], 0, "t (seconds)",'black','right','bottom','large')); - $gr[$i]->lb( new Label($max[0]/50, $max[1], "y (feet)",'black','left','top','large')); -} - -$gr[1]->stamps( closed_circle($x1,$y1,'red') ); -$gr[1]->lb( new Label($x1+$max[0]/50, $y1, "($x1,$y1)",'red','left','bottom','large')); -$gr[1]->stamps( closed_circle($x2,$y2,'red') ); -$gr[1]->lb( new Label($x2+$max[0]/50, $y2, "($x2,$y2)",'red','left','bottom','large')); -$gr[1]->stamps( closed_circle($x3,$y3,'red') ); -$gr[1]->lb( new Label($x3-$max[0]/50, $y3, "($x3,$y3)",'red','right','bottom','large')); + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + xlabel = {\(t\) (seconds)}, + ylabel = {\(y\) (feet)}, + ] + \addplot+[-] coordinates {(0,0) ($px1,$py1) ($px2,$py2) (10,0)}; +\end{axis} +END_TIKZ + + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + xlabel = {\(t\) (seconds)}, + ylabel = {\(y\) (feet)}, + ] + \addplot+[-] coordinates {(0,0) ($px1,$py1) ($px2,$py2) (10,0)}; + \addplot[soliddot] coordinates {($x1,$y1)} node[above] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[below right] {\(($x2,$y2)\)}; + \addplot[soliddot] coordinates {($x3,$y3)} node[below left] {\(($x3,$y3)\)}; +\end{axis} +END_TIKZ + + $alt[0] = "This is a graph with the x axis labeled as t in seconds, and y axis labeled as y in feet. There are 3 line segments. The first segments starts at (0,0) and ends at ($px1,$py1). The second segment starts at ($px1,$py1) and ends at ($px2,$py2). The third segment starts at ($px2,$py2) and ends at ($e3,0)."; @@ -176,7 +193,7 @@ The following figure has the graph [`y=d(t)`], which models a particle's distanc [@EnlargeImageStatementPGML@]** ->>[@ image(insertGraph( $gr[0] ), width=>240, +>>[@ image( $gr[0], width=>300, extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" ) @]*<< @@ -211,7 +228,7 @@ BEGIN_PGML_SOLUTION [@EnlargeImageStatementPGML@]** ->>[@ image(insertGraph( $gr[1] ), tex_size=>400, width=>240, +>>[@ image( $gr[1], tex_size=>400, width=>300, extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" ) @]*<< diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph50.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph50.pg index bef9af980f..4658d436ef 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph50.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph50.pg @@ -27,12 +27,13 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -41,7 +42,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $x0 = non_zero_random(-3,3,1); $y0 = non_zero_random(-3,3,1); @@ -131,54 +132,34 @@ $range = Union($range0,$range1); Context("Numeric"); -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, 0, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); - - - add_functions($gr[$i], "$func0 for x in [$x2,$x0] using color:blue and weight:1"); - add_functions($gr[$i], "$func1 for x in [$x1,$x3] using color:blue and weight:1"); - - if ($x0Included==1) { - $gr[$i]->stamps( closed_circle($x0,$y0,'blue') ); - } else { - $gr[$i]->stamps( open_circle($x0,$y0,'blue') ); - } +$x0style = ($x0Included) ? 'soliddot' : 'hollowdot'; +$x1style = ($x1Included) ? 'soliddot' : 'hollowdot'; +$x2style = ($x2Included) ? 'soliddot' : 'hollowdot'; +$x3style = ($x3Included) ? 'soliddot' : 'hollowdot'; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[firstcurve,domain=$x2:$x0,-] {$m0*(x-$x0)+$y0}; + \addplot[firstcurve,domain=$x1:$x3,-] {$m1*(x-$x1)+$y1}; + \addplot[firstcolor,$x0style] coordinates {($x0,$y0)}; + \addplot[firstcolor,$x1style] coordinates {($x1,$y1)}; + \addplot[firstcolor,$x2style] coordinates {($x2,$y2)}; + \addplot[firstcolor,$x3style] coordinates {($x3,$y3)}; +\end{axis} +END_TIKZ - if ($x1Included==1) { - $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); - } else { - $gr[$i]->stamps( open_circle($x1,$y1,'blue') ); - } - if ($x2Included==1) { - $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); - } else { - $gr[$i]->stamps( open_circle($x2,$y2,'blue') ); - } - - if ($x3Included==1) { - $gr[$i]->stamps( closed_circle($x3,$y3,'blue') ); - } else { - $gr[$i]->stamps( open_circle($x3,$y3,'blue') ); - } - -} $ALT0 = "This is the graph of a piecewise function with two line segments. The first segment starts from the $x2Text point ($x2,$y2), and ends at the $x0Text point ($x0,$y0). The second segment starts from the $x1Text point ($x1,$y1), and ends at the $x3Text point ($x3,$y3)."; @@ -192,7 +173,7 @@ A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< +>>[@image($gr, width=>300, extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< [@KeyboardInstructions("If needed, use the upper case letter [|U|]* to represent the union symbol.")@]** diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg index 84e6d80b96..e19788c515 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg @@ -40,7 +40,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg index 72c8d3d3fd..41c436a39a 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg @@ -40,7 +40,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg index 50b45e261d..008f6e5740 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg @@ -41,7 +41,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg index 9849ec4fac..039c3f5b78 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg @@ -39,7 +39,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg index 7d11c3c4d9..72b140a98a 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg @@ -40,7 +40,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg index 58650c9f34..f05b6b0746 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg @@ -38,7 +38,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + do { #define f(x) @@ -74,7 +74,13 @@ do { #find the right-side intersection $rightInterceptX = ($gMidY-$fMidY+$gMidX+$fMidX)/2; $rightInterceptY = ($gMidX-$fMidX+$gMidY+$fMidY)/2; -} until ( (int($rightInterceptX)==$rightInterceptX) && ($rightInterceptX!=$gRightX) ); +} until ( + (int($rightInterceptX)==$rightInterceptX) && + ($rightInterceptX<$gRightX) && + ($leftInterceptX>$gLeftX) && + ($rightInterceptX<$fRightX) && + ($leftInterceptX>$fLeftX) + ); $border = 8; ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-$border,$border],[-$border,$border],centerOrigin=>1); diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg index ddc7f1787b..d38cb40a4f 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg @@ -39,7 +39,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; @@ -94,24 +94,16 @@ $ALT0 = "This graph has a function f(x), which is a straight line colored in blu #the graph used in solution -if ($p2x>$p1x) { add_functions($gr[1], "$f for x in <$p1x,$p2x> using color:blue and weight:2"); $gr[1]->stamps( closed_circle($p1x,$p1y,'blue') ); $gr[1]->stamps( open_circle($p2x,$p2y,'blue') ); $ALT1 = "This graph has a function f(x), which is a straight line colored in blue. Only the part in the domain ($p1x,$p2x) is graphed. There are two horizontal lines, colored in red, at y=$p1y and y=$p2y. The graph of f(x) crosses those two horizontal lines at ($p1x,$p1y) and ($p2x,$p2y). The point ($p1x,$p1y) is closed, and the point ($p2x,$p2y) is open."; -} else { - add_functions($gr[1], "$f for x in <$p2x,$p1x> using color:blue and weight:2"); - $gr[1]->stamps( open_circle($p1x,$p1y,'blue') ); - $gr[1]->stamps( closed_circle($p2x,$p2y,'blue') ); - $ALT1 = "This graph has a function f(x), which is a straight line colored in blue. Only the part in the domain ($p1x,$p2x) is graphed. There are two horizontal lines, colored in red, at y=$p1y and y=$p2y. The graph of f(x) crosses those two horizontal lines at ($p2x,$p2y) and ($p1x,$p1y). The point ($p2x,$p2y) is closed, and the point ($p1x,$p1y) is open."; -} - Context("Interval"); -$ans1 = ($p1x<$p2x) ? Compute("[$p1x,$p2x)") : Compute("[$p2x,$p1x)"); +$ans1 = ($p1x<$p2x) ? Compute("[$p1x,$p2x)") : Compute("($p2x,$p1x]"); $ans2 = ($p1x<$p2x) ? Compute("(-infinity,$p1x)U[$p2x,infinity)") : Compute("(-infinity,$p2x]U($p1x,infinity)"); $ans3 = ($p1x<$p2x) ? Compute("(-infinity,$p2x]") : Compute("[$p2x,infinity)"); - + ############################################## Context("LimitedNumeric"); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg index 8a33c0eb66..f6c74bfba6 100644 --- a/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg @@ -39,7 +39,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotAbsValuePoints.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotAbsValuePoints.pg new file mode 100644 index 0000000000..83ccff0753 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotAbsValuePoints.pg @@ -0,0 +1,96 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +($h,$k) = (1..3)[NchooseK(3,2)]; +$k *= -1; +$f = Formula("|x - $h| + $k")->reduce; + +@pts = (); +for my $x (0..5) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 4); +} +$n = scalar @pts; +$points = join(',',@pts); + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + bBox => [-0.5, 4, 5.5, -4], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points and other (which there shouldn't be any of) + my @studentpoints; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "Your answer includes an object that is not a point.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the function [`f`] where [`f(x)=[$f]`]. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotAlternatingPoints.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotAlternatingPoints.pg new file mode 100644 index 0000000000..1f40768577 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotAlternatingPoints.pg @@ -0,0 +1,97 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y','x*n'); +($a,$b) = (2..4)[NchooseK(3,2)]; +$b *= list_random(-1,1); +$f = Formula("(-1)^x*$a+$b")->reduce; + +@pts = (); +for my $x (-3..3) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 8); +} +$n = scalar @pts; +$points = join(',',@pts); + + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + bBox => [-3.5, 8, 3.5, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points, and other (which there shouldn't be any of) + my @studentpoints; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "Your answer includes an object that is not a point.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the function [`f`] where [`f(x)=[$f]`]. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotNegQuadraticPoints.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotNegQuadraticPoints.pg new file mode 100644 index 0000000000..b4dec93eae --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotNegQuadraticPoints.pg @@ -0,0 +1,134 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +($h,$k) = (1..5)[NchooseK(5,2)]; +$h *= list_random(-1,1); +$f = Formula("-x^2 + 2*$h x + (-($h)^2+$k)")->reduce; + +@pts = (); +push(@pts, "{point,(-8," . $f->eval(x=>-8) . ")}") if (abs($f->eval(x=>-8)) <= 7); +for my $x (-7..7) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 8); +} +push(@pts, "{point,(8," . $f->eval(x=>8) . ")}") if (abs($f->eval(x=>8)) <= 7); +$n = scalar @pts; +$points = join(',',@pts); + +$u = $h+1; +$v = $f->eval(x=>$u); + +$gt = GraphTool($points.",{parabola,solid,vertical,($h,$k),($u,$v)}")->with( + availableTools => ["PointTool","VerticalParabolaTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points, parabolas, and other (which there shouldn't be any of) + my @studentpoints; + my @studentparabolas; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } elsif ($_->extract(1) eq 'parabola' && $_->extract(3) eq 'vertical') { + push(@studentparabolas, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "You haven't plotted a curve yet.") unless (@studentparabolas); + push(@errors, "Your answer includes an object that is neither a point nor a vertical parabola.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $extraprbs = 0; + my $distinctprbs = 0; + my $countprbs = 0; + STUDENTPARABOLAS: + for my $j (@studentparabolas) { + ++$countprbs; + if (($j->extract(4) != Point($h,$k)) || ($j->extract(5)->value)[1] != $f->eval(x=>(($j->extract(5)->value)[0]))) { + push(@errors, "The parabola with vertex at " . $j->extract(4) . " passing through " . $j->extract(5) . " is incorrect."); + $extraprbs++; + next STUDENTPARABOLAS; + } + for my $i (0..($countprbs-2)) { + my ($hj,$kj) = $j->extract(4)->value; + my ($xj,$yj) = $j->extract(5)->value; + my ($hi,$ki) = $studentparabolas[$i]->extract(4)->value; + my ($xi,$yi) = $studentparabolas[$i]->extract(5)->value; + next STUDENTPARABOLAS if ( + # has same vertex as an earlier parabola + ($hj == $hi && $kj == $ki) && + # assuming same vertex, yields same parabola + ($yi - $ki)*($xj - $hj)**2 == ($yj - $kj)*($xi - $hi)**2 + ); + } + $distinctprbs++; + } + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + $score /= 2 unless ($distinctprbs == 1); + $score /= 2 if ($extraprbs); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the function [`f`] where [`f(x)=[$f]`]. +Then graph a curve that passes through these points. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotQuadraticPoints.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotQuadraticPoints.pg new file mode 100644 index 0000000000..d83a9211eb --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotQuadraticPoints.pg @@ -0,0 +1,134 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +($h,$k) = (-5..-1)[NchooseK(5,2)]; +$h *= list_random(-1,1); +$f = Formula("x^2 - 2*$h x + (($h)^2+$k)")->reduce; + +@pts = (); +push(@pts, "{point,(-8," . $f->eval(x=>-8) . ")}") if (abs($f->eval(x=>-8)) <= 7); +for my $x (-7..7) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 8); +} +push(@pts, "{point,(8," . $f->eval(x=>8) . ")}") if (abs($f->eval(x=>8)) <= 7); +$n = scalar @pts; +$points = join(',',@pts); + +$u = $h+1; +$v = $f->eval(x=>$u); + +$gt = GraphTool($points.",{parabola,solid,vertical,($h,$k),($u,$v)}")->with( + availableTools => ["PointTool","VerticalParabolaTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points, parabolas, and other (which there shouldn't be any of) + my @studentpoints; + my @studentparabolas; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } elsif ($_->extract(1) eq 'parabola' && $_->extract(3) eq 'vertical') { + push(@studentparabolas, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "You haven't plotted a curve yet.") unless (@studentparabolas); + push(@errors, "Your answer includes an object that is neither a point nor a vertical parabola.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $extraprbs = 0; + my $distinctprbs = 0; + my $countprbs = 0; + STUDENTPARABOLAS: + for my $j (@studentparabolas) { + ++$countprbs; + if (($j->extract(4) != Point($h,$k)) || ($j->extract(5)->value)[1] != $f->eval(x=>(($j->extract(5)->value)[0]))) { + push(@errors, "The parabola with vertex at " . $j->extract(4) . " passing through " . $j->extract(5) . " is incorrect."); + $extraprbs++; + next STUDENTPARABOLAS; + } + for my $i (0..($countprbs-2)) { + my ($hj,$kj) = $j->extract(4)->value; + my ($xj,$yj) = $j->extract(5)->value; + my ($hi,$ki) = $studentparabolas[$i]->extract(4)->value; + my ($xi,$yi) = $studentparabolas[$i]->extract(5)->value; + next STUDENTPARABOLAS if ( + # has same vertex as an earlier parabola + ($hj == $hi && $kj == $ki) && + # assuming same vertex, yields same parabola + ($yi - $ki)*($xj - $hj)**2 == ($yj - $kj)*($xi - $hi)**2 + ); + } + $distinctprbs++; + } + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + $score /= 2 unless ($distinctprbs == 1); + $score /= 2 if ($extraprbs); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the equation [`y=[$f]`]. +Then graph a curve that passes through these points. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotRemainder.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotRemainder.pg new file mode 100644 index 0000000000..bccbe1f0e2 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotRemainder.pg @@ -0,0 +1,107 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +$m = random(3,5,1); + +package NewFunc; +our @ISA = qw(Parser::Function::numeric2); + +sub modm { + shift; my $x = shift; my $mod = shift; + return $x % $mod; +} + +package main; + +Context()->functions->add(modm => {class => 'NewFunc'}); +$f = Formula("modm(x,$m)"); + +@pts = (); +for my $x (0..7) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 6); +} +$n = scalar @pts; +$points = join(',',@pts); + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + bBox => [-0.5, 6, 7.5, -0.5], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points, and other (which there shouldn't be any of) + my @studentpoints; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "Your answer includes an object that is not a point.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the funciton [`f`] where [`f(x)`] is the remainder when you divide [`x`] by [`[$m]`]. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotZigZag.pg b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotZigZag.pg new file mode 100644 index 0000000000..e57b3fd19f --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/FunctionBasics/PlotZigZag.pg @@ -0,0 +1,95 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +($h,$k) = (-2..2)[NchooseK(5,2)]; +$f = Formula("|x-$h| - |x-$k|")->reduce; + +@pts = (); +for my $x (-4..4) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 8); +} +$n = scalar @pts; +$points = join(',',@pts); + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + bBox => [-4.5, 8, 4.5, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points, and other (which there shouldn't be any of) + my @studentpoints; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "Your answer includes an object that is not a point.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the function [`f`] where [`f(x)=[$f]`]. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea40.pg b/Contrib/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea40.pg index 4755b01d24..b5becebd0e 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea40.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea40.pg @@ -32,24 +32,26 @@ loadMacros( "parserNumberWithUnits.pl", "parserFormulaWithUnits.pl", "answerHints.pl", + "PCCmacros.pl", "PGcourse.pl", ); ############################################## Context("Numeric"); -Context()->flags->set( - tolerance => 0.005, - tolType => "absolute", -); +# An earlier version of this problem required rounding to hundredths place. +# Bad, because when some students use 3.14 instead of something closer to pi, +# they could be marked incorrect. Using relative tolerance in the usual way +# means it is OK to use 3.14 in place of pi. If students are now not showing +# enough digits and being marked incorrect, that should be handled globally, +# not in the problem code. For exampl, more studnet education about rounding +# explectations, or a tooltip that always reminds students of the roudning +# convention. $circum = random(30,50,1); $diameter = $circum/pi; $radius = $diameter/2; -$diameter = sprintf("%.2f", $diameter); -$radius = sprintf("%.2f", $radius); - $circumU = NumberWithUnits("$circum cm"); $radiusU = NumberWithUnits("$radius cm"); $diameterU = NumberWithUnits("$diameter cm"); @@ -60,11 +62,13 @@ TEXT(beginproblem()); BEGIN_PGML -A circle's circumference is [`[$circumU]`]. Find the following values. Round your answer to at least 2 decimal places. +A circle's circumference is [`[$circumU]`]. -a) This circle's diameter is [_____________]{$diameterU}. +a. What is this circle's diameter? + [_]{$diameterU}{15} -b) This circle's radius is [_____________]{$radiusU}. +a. What is this circle's radius? + [_]{$radiusU}{15} END_PGML @@ -79,21 +83,21 @@ A circle's circumference formula is [` C= \pi d `] or [` C= 2 \pi r `]. When you enter [`\pi`]'s value in a calculator, don't round it to [`3.14`]. Use the [`\pi`] button on your calculator instead. This way, your result is more accurate. -a) To find the diameter, we substitute the given numbers into the first formula for circumference: +a. To find the diameter, we substitute the given numbers into the first formula for circumference: [``` \begin{aligned} C & = \pi d \\ [$circum] & = \pi d \\ \frac{[$circum]}{\pi} &= \frac{\pi d}{\pi} \\ - \frac{[$circum]}{3.1415926 \ldots} &= \frac{\pi d}{3.1415926 \ldots} \\ + \frac{[$circum]}{3.1415926 \ldots} &= d \\ [$diameter] & \approx d \end{aligned} ```] This circle's diameter is approximately [`[$diameterU]`]. Don't forget the length unit [`\textrm{cm}`]. -b) Once we find the diameter, the radius is simply half of it: [`[$radiusU]`]. +a. Once we find the diameter, the radius is simply half of it: [`[$radiusU]`]. END_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea10.pg b/Contrib/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea10.pg index 0b182a1eb9..2003b2ef7c 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea10.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea10.pg @@ -119,7 +119,7 @@ $picture->lineTo($x[1]-$cornersize,$y[1], red,1,'dashed'); $alt = "The graph shows a polygon with a rectangle at the bottom and a triangle on top of it. The base of the triangle overlaps the top base of the rectangle. For the rectangle, its base is $baseU, and its height is $heightRectangleU. For the triangle, its height is $heightTriangleU, both its left side and right side are $leftSideU."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea20.pg b/Contrib/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea20.pg index 052b9ab356..1f3a6c19db 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea20.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea20.pg @@ -128,7 +128,7 @@ $alt[0] = "The graph shows a shape with a rectangle at the bottom and a semicirc $alt[1] = $alt[0]." The radius of the semicircle is marked as $base/2=$radiusU."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea10.pg b/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea10.pg index b4d3bba30c..b70e9f5403 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea10.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea10.pg @@ -104,7 +104,7 @@ BEGIN_PGML END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION We usually use the following formulas for rectangles: diff --git a/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea40.pg b/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea40.pg index c77f60d7ff..53dd84dfce 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea40.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea40.pg @@ -208,7 +208,7 @@ $picture[2]->lineTo($connectLineX[$corner][2],$connectLineY[$corner][2], red,1,' ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + BEGIN_PGML Find the perimeter and area of this shape. diff --git a/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea50.pg b/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea50.pg index 9de7b579ff..2508a64813 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea50.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea50.pg @@ -148,7 +148,7 @@ $alt[1] = "The graph shows a rectangle with one rectangular piece missing. Start $alt[2] = "The graph shows a rectangle with one rectangular piece missing. Starting at the bottom left corner, a vertical segment travels up for a distance, turns right and travels for $baseLeftU, goes down for $heightCutU, turns right for a distance marked as $base-2*$baseLeft=$baseCutU, goes up for a distance, turns right and travels for $baseLeftU, goes down for $heightU, and finally turns left for $baseU. A dashed line connects the top of the missing rectangle, making it clear this polygon is a bigger rectangle with a smaller rectangle taken out."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/RectangularPrismVolume10.pg b/Contrib/PCC/BasicAlgebra/Geometry/RectangularPrismVolume10.pg index 5678cb7ce5..c0a878e095 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/RectangularPrismVolume10.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/RectangularPrismVolume10.pg @@ -103,7 +103,7 @@ $ans = NumberWithUnits("$volume in^3"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_TEXT diff --git a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles10.pg b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles10.pg index ef1de2b296..9d98301feb 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles10.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles10.pg @@ -106,7 +106,7 @@ $ans = $baseLong[0]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles20.pg b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles20.pg index 951b5738b9..c73e3b0f61 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles20.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles20.pg @@ -111,7 +111,7 @@ $ans = $baseLong[1]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles30.pg b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles30.pg index af4cac95a8..4fe5a25d48 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles30.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles30.pg @@ -115,7 +115,7 @@ $ans = $hypotenuse[0]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles40.pg b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles40.pg index 3cd7b07244..33478aec27 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles40.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles40.pg @@ -115,7 +115,7 @@ $ans = $hypotenuse[1]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles50.pg b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles50.pg index 994bc67d1e..fb033aa51c 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles50.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles50.pg @@ -341,7 +341,7 @@ $ans = $baseShort[0]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles60.pg b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles60.pg index a99391f451..b07c292e1a 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles60.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles60.pg @@ -339,7 +339,7 @@ $ans = $baseShort[1]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles70.pg b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles70.pg index 771132ce2b..0d7c37daff 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles70.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles70.pg @@ -312,7 +312,7 @@ $ans = $hypotenuse[1]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles80.pg b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles80.pg index 2461ff1d36..29b117148e 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles80.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles80.pg @@ -312,7 +312,7 @@ $ans = $hypotenuse[0]; $ansU = NumberWithUnits("$ans ft"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles90.pg b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles90.pg index 30ea8331ce..4409e16268 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles90.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/SimilarTriangles90.pg @@ -341,7 +341,7 @@ $ans1 = $baseShort[1]; $ans1U = NumberWithUnits("$ans1 $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Geometry/Trapezoid10.pg b/Contrib/PCC/BasicAlgebra/Geometry/Trapezoid10.pg index 49fd949e0b..cbd4613c14 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/Trapezoid10.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/Trapezoid10.pg @@ -1,23 +1,3 @@ -####################################### -### Generated from PreTeXt source -### on 2017-10-02T18:11:53-07:00 -### -### http://mathbook.pugetsound.edu -### -####################################### -## DBsubject() -## DBchapter() -## DBsection() -## Level() -## KEYWORDS() -## TitleText1(ORCCA (Draft)) -## EditionText1(Fall 2017 MTH 60 Pilot) -## AuthorText1(Ann Cary, Alex Jordan, Carl Yao) -## Section1(not reported) -## Problem1(B.4.3) -## Author() -## Institution() -## Language(en-US) DOCUMENT(); @@ -33,18 +13,17 @@ loadMacros( "parserNumberWithUnits.pl", "PGcourse.pl", ); -$refreshCachedImages= 1; + ############################################################ # Header ############################################################ -COMMENT('Authored in PreTeXt'); TEXT(beginproblem()); ############################################################ # PG Setup ############################################################ Context("Numeric"); -$refreshCachedImages = 1; + $unit = "cm"; @@ -102,7 +81,7 @@ $ansA = NumberWithUnits("$area $unit^2"); BEGIN_PGML Find the area of the traepzoid. ->> [@image(insertGraph($picture), width=>600, extra_html_tags=>qq!alt=""!)@]* << +>> [@image(insertGraph($picture), width=>600, extra_html_tags => "alt = '$alt' title = '$alt' ")@]* << Its area is [________]{$ansA}. @@ -118,7 +97,7 @@ BEGIN_PGML_SOLUTION A trapezoid's area can be calculated by this formula: >> [``\newcommand{\amp}{&}\begin{aligned} -\text{trapezoid area}\amp= \frac{1}{2}(\text{base1}+\text{base2})cdot\text{height}\\ +\text{trapezoid area}\amp= \frac{1}{2}(\text{base1}+\text{base2})\cdot\text{height}\\ \amp= \frac{1}{2}([$base1U]+[$base2U])([$heightU])\\ \amp = [$ansA] \end{aligned}``] << diff --git a/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea10.pg b/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea10.pg index d7829255cd..a2e530229a 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea10.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea10.pg @@ -90,7 +90,7 @@ $ansA = NumberWithUnits("$area ft^2"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); $text = "a triangle with one side parallel to the ground; this side is $base ft long; the left side is $leftSide ft long; the right side is $rightSide ft long; the height is $height ft"; diff --git a/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea20.pg b/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea20.pg index 571dc063e6..291333717a 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea20.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea20.pg @@ -84,7 +84,7 @@ $ansP = NumberWithUnits("$perimeter cm"); $ansA = NumberWithUnits("$area cm^2"); ############################################## -$refreshCachedImages=1; + TEXT(beginproblem()); $text = "a right triangle with legs of lengths $base cm and $height cm, and hypotenuse of length $hypotenuse cm"; diff --git a/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea30.pg b/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea30.pg index 3fa7b474a1..081ff08c30 100644 --- a/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea30.pg +++ b/Contrib/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea30.pg @@ -89,7 +89,7 @@ $ansA = NumberWithUnits($area,"m^2"); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + $text = "an obtuse triangle with legs of lengths $base m, $rightSide m, and $leftSide m; its height perpendicular to the side of length $base m is $height m"; diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines10.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines10.pg index 4cb31a660d..5134c5d8fb 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines10.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines10.pg @@ -37,7 +37,7 @@ loadMacros( Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $m=random(1,3,1)*random(-1,1,2); $b=non_zero_random(-4,4,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines20.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines20.pg index 1e4fbfc919..a0ee2c1f4e 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines20.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines20.pg @@ -38,7 +38,7 @@ loadMacros( Context("Fraction"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + do { $num=random(1,3,1)*random(-1,1,2); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines30.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines30.pg index 69014d7a09..12a8d9eb98 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines30.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines30.pg @@ -39,7 +39,7 @@ loadMacros( Context("Fraction"); Context()->noreduce('(-x)-y','(-x)+y'); Context()->variables->add(y=>"Real"); -$refreshCachedImages=1; + do { $num=random(1,3,1)*random(-1,1,2); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines40.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines40.pg index c57dc58b01..4275a4fe6b 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines40.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines40.pg @@ -39,7 +39,7 @@ loadMacros( Context("Fraction"); Context()->noreduce('(-x)-y','(-x)+y'); Context()->variables->add(y=>"Real"); -$refreshCachedImages=1; + do { $num=random(1,3,1)*random(-1,1,2); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines50.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines50.pg index d5a50490c5..9f02bec50c 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines50.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines50.pg @@ -38,7 +38,7 @@ sub PF {PGML::Format(@_)}; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $a = non_zero_random(-3,3,1); $direction = (random(-1,1,2)>0) ? "horizontal" : "vertical"; diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg index fa88d7fa7b..1d987630b0 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg @@ -23,7 +23,8 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", @@ -36,7 +37,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = random(1,5,1); $b = random(-4,4,1); @@ -58,48 +59,45 @@ Context("Numeric"); ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([3*$x2,0,$x1],[$m*3*$x2+$b,0,$y1]); -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; - -my @ticksep; -for my $i (0,1) { - $ticksep[$i] = ($max[$i] - $min[$i])/$ticknum[$i]; -}; - -#Make sure the grid lines cover the two points -$scale[0] = 1; -while ((Real($scale[0]*$x1 / $ticksep[0]) != Real(int($scale[0]*$x1 / $ticksep[0]))) or (Real($scale[0]*$x2 / $ticksep[0]) != Real(int($scale[0]*$x2 / $ticksep[0])))) {$scale[0] = $scale[0] + 1}; -$scale[1] = 1; -while ((Real($scale[1]*$y1 / $ticksep[1]) != Real(int($scale[1]*$y1 / $ticksep[1]))) or (Real($scale[1]*$y2 / $ticksep[1]) != Real(int($scale[1]*$y2 / $ticksep[1])))) {$scale[1] = $scale[1] + 1}; - -for my $i (0,1) { - $ticknum[$i] = $ticknum[$i]*$scale[$i]; -}; - -for my $i (0,1) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (Real($j) == 0) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle','large')); - } - ($start,$stop) = (num_sort($min[0],$max[0],($min[1]-$b)/$m,($max[1]-$b)/$m))[1,2]; -$gr[$i]->moveTo($x1,$y1); -$gr[$i]->arrowTo($start,$m*$start+$b,'blue',1); -$gr[$i]->moveTo($x1,$y1); -$gr[$i]->arrowTo($stop,$m*$stop+$b,'blue',1); -} +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; +\end{axis} +END_TIKZ + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[above] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[above] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ + ############################################## Context("LimitedNumeric"); @@ -112,7 +110,7 @@ END_PGML BEGIN_TEXT $PAR $BCENTER -\{image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)"') \} +\{image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)"') \} $ECENTER $PAR END_TEXT @@ -123,27 +121,6 @@ BEGIN_PGML END_PGML ############################################## -if ($m > 0) -{$p1vert = 'bottom'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'left';} -else {$p1vert = 'top'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'right';}; - -$gr[1]->stamps( closed_circle($x1,$y1,'red') ); -$gr[1]->lb( new Label($x1,$y1,"$pt1",'red',$p1hor,$p1vert)); -$gr[1]->stamps( closed_circle($x2,$y2,'red') ); -$gr[1]->lb( new Label($x2,$y2,"$pt2",'red',$p2hor,$p2vert)); - -$gr[1]->moveTo($x1,$y1); -$gr[1]->lineTo($x2,$y1,'red',2); -$gr[1]->lineTo($x2,$y2,'red',2); -$gr[1]->lb( new Label(($x1+$x2)/2,$y1,"$run",'red','center','top')); -$gr[1]->lb( new Label($x2,($y1+$y2)/2,"$rise",'red','left','middle')); - BEGIN_SOLUTION @@ -152,7 +129,7 @@ To find the slope of a line from its graph, we first need to identify two points Next, we sketch a slope triangle and find the $BITALIC rise$EITALIC and $BITALIC run$EITALIC. In the sketch below, the rise is \($rise\) and the run is \($run\). $BCENTER -\{ image( insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) +\{ image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) \} $ECENTER $PAR diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg index ba67f11a73..7bb80cc596 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg @@ -38,7 +38,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = -random(1,5,1); $b = random(-4,4,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg index d0c1c03ac9..c31b4c513d 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg @@ -3,7 +3,7 @@ # # Given a graph, find a line's slope. Slope is a positive fraction. # -# Last edited: Jordan 8/18/13 +# Last edited: Jordan 4/23/21 # # ENDDESCRIPTION @@ -25,13 +25,14 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", "contextFraction.pl", "PCCmacros.pl", "PCCgraphMacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -39,17 +40,16 @@ loadMacros( TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; -$num=random(1,9,1); -do {$den=random(2,9,1);} until (gcd($den,$num)==1); +$num=random(3,9,1); +do {$den=random(3,9,1);} until (gcd($den,$num)==1); $m = Fraction($num,$den); $mperl = $num/$den; Context("Numeric"); -$b = random(-4,4,1); +$b = non_zero_random(-4,4,1); $x1 = 0; $y1 = $b; @@ -67,115 +67,84 @@ $pt2=Compute("($x2,$y2)"); ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([1.5*$x2,0,$x1],[$m*1.5*$x2+$b,0,$y1]); -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; - -my @ticksep; -for my $i (0,1) { - $ticksep[$i] = ($max[$i] - $min[$i])/$ticknum[$i]; -}; +($start,$stop) = (num_sort($min[0],$max[0],($min[1]-$b)/$mperl,($max[1]-$b)/$mperl))[1,2]; -#Make sure the grid lines cover the two points -$scale[0] = 1; -while ((Real($scale[0]*$x1 / $ticksep[0]) != Real(int($scale[0]*$x1 / $ticksep[0]))) or (Real($scale[0]*$x2 / $ticksep[0]) != Real(int($scale[0]*$x2 / $ticksep[0])))) {$scale[0] = $scale[0] + 1}; -$scale[1] = 1; -while ((Real($scale[1]*$y1 / $ticksep[1]) != Real(int($scale[1]*$y1 / $ticksep[1]))) or (Real($scale[1]*$y2 / $ticksep[1]) != Real(int($scale[1]*$y2 / $ticksep[1])))) {$scale[1] = $scale[1] + 1}; +$firstx = $min[0]+1; +$firsty = $min[1]+1; + +$tikz = <<"END_TIKZ"; +\begin{axis} + [ + width = 0.47\linewidth, + xmin = $min[0], + ymin = $min[1], + xmax = $max[0], + ymax = $max[1], + xtick = {}, + ytick = {}, + minor xtick = {$min[0],$firstx,...,$max[0]}, + minor ytick = {$min[1],$firsty,...,$max[1]}, + grid=both, + ] + \addplot+[domain = $start:$stop] {$mperl*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1) ($x2,$y2)}; +END_TIKZ +# note final \end{axis} not yet written for my $i (0,1) { - $ticknum[$i] = $ticknum[$i]*$scale[$i]; -}; + $gr[$i] = createTikZImage(); + $gr[$i]->addToPreamble(latexImagePreamble()); +} +$gr[0]->tex($tikz. '\end{axis}'); -for my $i (0,1) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top', 'large')); - } - - for my $j (@yticks) { - if (Real($j) == 0) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle','large')); - } +if ($m > 0) +{$p1vert = 'above'; + $p2vert = 'above'; + $p1hor = 'left'; + $p2hor = 'left';} +else {$p1vert = 'below'; + $p2vert = 'below'; + $p1hor = 'left'; + $p2hor = 'left';}; -($start,$stop) = (num_sort($min[0],$max[0],($min[1]-$b)/$mperl,($max[1]-$b)/$mperl))[1,2]; -$gr[$i]->moveTo($x1,$y1); -$gr[$i]->arrowTo($start,$mperl*$start+$b,'blue',1); -$gr[$i]->moveTo($x1,$y1); -$gr[$i]->arrowTo($stop,$mperl*$stop+$b,'blue',1); -$gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); -$gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); +$tikz .= <<"END_TIKZ"; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1)} node[pos=0.5,below] {\($run\)}; + \addplot[guideline] coordinates {($x2,$y1) ($x2,$y2)} node[pos=0.5,right] {\($rise\)}; + \addplot[soliddot] coordinates {($x1,$y1)} node[$p1vert $p1hor] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[$p2vert $p2hor] {\(($x2,$y2)\)}; +END_TIKZ -} +$gr[1]->tex($tikz.'\end{axis}'); ############################################## Context("LimitedFraction"); BEGIN_PGML -Below is a line's graph. [@EnlargeImageStatementPGML()@]** +Find the slope of the line. +>>[@image(insertGraph($gr[0]), width=>280, tex_size=>1000, alt => "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)")@]*<< -END_PGML -BEGIN_TEXT -$PAR -$BCENTER -\{image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)"') \} -$ECENTER -$PAR -END_TEXT -BEGIN_PGML +[@KeyboardInstructions('(If the slope does not exist, enter [|DNE|]* or [|NONE|]*.)')@]** - The slope of this line is [___________]{$m}. [@KeyboardInstructions('(If the slope does not exist, enter [|DNE|]* or [|NONE|]*.)')@]** +[_]{$m}{10} END_PGML ############################################## -if ($m > 0) -{$p1vert = 'bottom'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'left';} -else {$p1vert = 'top'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'right';}; - -$gr[1]->stamps( closed_circle($x1,$y1,'red') ); -$gr[1]->lb( new Label($x1,$y1,"$pt1",'red',$p1hor,$p1vert,'large')); -$gr[1]->stamps( closed_circle($x2,$y2,'red') ); -$gr[1]->lb( new Label($x2,$y2,"$pt2",'red',$p2hor,$p2vert,'large')); - -$gr[1]->moveTo($x1,$y1); -$gr[1]->lineTo($x2,$y1,'red',2); -$gr[1]->lineTo($x2,$y2,'red',2); -$gr[1]->lb( new Label(($x1+$x2)/2,$y1,"$run",'red','center','top','small')); -$gr[1]->lb( new Label($x2,($y1+$y2)/2,"$rise",'red','left','middle','small')); - -Context()->texStrings; -BEGIN_SOLUTION +BEGIN_PGML_SOLUTION -To find the slope of a line from its graph, we first need to identify two points that the line passes through. It is wise to choose points with integer coordinates. For this problem, we choose \(($x1,$y1)\) and \(($x2,$y2)\). +To find the slope of a line from its graph, we first need to identify two points that the line passes through. It is wise to choose points with integer coordinates. For this problem, we choose [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. -Next, we sketch a slope triangle and find the $BITALIC rise$EITALIC and $BITALIC run$EITALIC. In the sketch below, the rise is \($rise\) and the run is \($run\). +Next, we sketch a slope triangle and find the _rise_ and _run_. In the sketch below, the rise is [`[$rise]`] and the run is [`[$run]`]. -$BCENTER -\{ image( insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) - \} -$ECENTER -$PAR +>>[@image(insertGraph($gr[1]), width=>280, tex_size=>1000, alt => "graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)")@]*<< -\[\begin{aligned}\text{slope}&=\frac{\text{rise}}{\text{run}}\\ -&=\frac{$rise}{$run}\\ -\end{aligned}\] +[```\text{slope}=\frac{\text{rise}}{\text{run}}=\frac{[$rise]}{[$run]}```] -This line's slope is \($m\). +This line's slope is [`[$m]`]. -END_SOLUTION +END_PGML_SOLUTION Context()->normalStrings; ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg index 441bcfed1b..ee63e9489a 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg @@ -25,7 +25,8 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", @@ -39,7 +40,7 @@ loadMacros( TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num=random(1,9,1); @@ -66,53 +67,50 @@ $pt1=Compute("($x1,$y1)"); $pt2=Compute("($x2,$y2)"); ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([1.5*$x2,0,$x1],[$m*1.5*$x2+$b,0,$y1]); - -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; - -my @ticksep; -for my $i (0,1) { - $ticksep[$i] = ($max[$i] - $min[$i])/$ticknum[$i]; -}; - -#Make sure the grid lines cover the two points -$scale[0] = 1; -while ((Real($scale[0]*$x1 / $ticksep[0]) != Real(int($scale[0]*$x1 / $ticksep[0]))) or (Real($scale[0]*$x2 / $ticksep[0]) != Real(int($scale[0]*$x2 / $ticksep[0])))) {$scale[0] = $scale[0] + 1}; -$scale[1] = 1; -while ((Real($scale[1]*$y1 / $ticksep[1]) != Real(int($scale[1]*$y1 / $ticksep[1]))) or (Real($scale[1]*$y2 / $ticksep[1]) != Real(int($scale[1]*$y2 / $ticksep[1])))) {$scale[1] = $scale[1] + 1}; - -for my $i (0,1) { - $ticknum[$i] = $ticknum[$i]*$scale[$i]; -}; - - -for my $i (0,1) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (Real($j) == 0) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle','large')); - } +$min[1] = int($min[1]); +$max[1] = int($max[1]); ($start,$stop) = (num_sort($min[0],$max[0],($min[1]-$b)/$mperl,($max[1]-$b)/$mperl))[1,2]; -$gr[$i]->moveTo($x1,$y1); -$gr[$i]->arrowTo($start,$mperl*$start+$b,'blue',1); -$gr[$i]->moveTo($x1,$y1); -$gr[$i]->arrowTo($stop,$mperl*$stop+$b,'blue',1); -$gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); -$gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)}; + \addplot[soliddot] coordinates {($x2,$y2)}; +\end{axis} +END_TIKZ + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[above] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[above] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ -} ############################################## Context("LimitedFraction"); @@ -125,7 +123,7 @@ END_PGML BEGIN_TEXT $PAR $BCENTER -\{image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line has an downward slant and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line has an downward slant and also passes through the point ($x2,$y2)"') \} +\{image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line has an downward slant and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line has an downward slant and also passes through the point ($x2,$y2)"') \} $ECENTER $PAR END_TEXT @@ -136,26 +134,6 @@ BEGIN_PGML END_PGML ############################################## -if ($m > 0) -{$p1vert = 'bottom'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'left';} -else {$p1vert = 'top'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'right';}; - -$gr[1]->stamps( closed_circle($x1,$y1,'red') ); -$gr[1]->lb( new Label($x1,$y1,"$pt1",'red',$p1hor,$p1vert)); -$gr[1]->stamps( closed_circle($x2,$y2,'red') ); -$gr[1]->lb( new Label($x2,$y2,"$pt2",'red',$p2hor,$p2vert)); - -$gr[1]->moveTo($x1,$y1); -$gr[1]->lineTo($x2,$y1,'red',2); -$gr[1]->lineTo($x2,$y2,'red',2); -$gr[1]->lb( new Label(($x1+$x2)/2,$y1,"$run",'red','center','top')); -$gr[1]->lb( new Label($x2,($y1+$y2)/2,"$rise",'red','left','middle')); Context()->texStrings; BEGIN_SOLUTION @@ -165,7 +143,7 @@ To find the slope of a line from its graph, we first need to identify two points Next, we sketch a slope triangle and find the $BITALIC rise$EITALIC and $BITALIC run$EITALIC. In the sketch below, the rise is \($rise\) and the run is \($run\). $BCENTER -\{ image( insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) +\{ image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) \} $ECENTER $PAR diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg index 3a86d9d321..e80caff2e5 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg @@ -25,7 +25,8 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", @@ -38,7 +39,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = 0; $b = non_zero_random(-4,4,1); @@ -60,48 +61,48 @@ Context("Numeric"); ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([3*$x2,0,$x1],[$m*3*$x2+$b,0,$y1]); -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; - -my @ticksep; -for my $i (0,1) { - $ticksep[$i] = ($max[$i] - $min[$i])/$ticknum[$i]; -}; - -#Make sure the grid lines cover the two points -$scale[0] = 1; -while ((Real($scale[0]*$x1 / $ticksep[0]) != Real(int($scale[0]*$x1 / $ticksep[0]))) or (Real($scale[0]*$x2 / $ticksep[0]) != Real(int($scale[0]*$x2 / $ticksep[0])))) {$scale[0] = $scale[0] + 1}; -$scale[1] = 1; -while ((Real($scale[1]*$y1 / $ticksep[1]) != Real(int($scale[1]*$y1 / $ticksep[1]))) or (Real($scale[1]*$y2 / $ticksep[1]) != Real(int($scale[1]*$y2 / $ticksep[1])))) {$scale[1] = $scale[1] + 1}; - -for my $i (0,1) { - $ticknum[$i] = $ticknum[$i]*$scale[$i]; -}; - -for my $i (0,1) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle','large')); - } - -($start,$stop) = ($min[0],$max[0])[1,2]; -$gr[$i]->moveTo($x1,$y1); -$gr[$i]->arrowTo($start,$mperl*$start+$b,'blue',1); -$gr[$i]->moveTo($x1,$y1); -$gr[$i]->arrowTo($stop,$mperl*$stop+$b,'blue',1); - -} +TEXT(@$yticks_ref); +$xticks = join(',',@$xticks_ref); +$yticks = join(',',@$yticks_ref); + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$xticks}, + minor ytick = {$yticks}, + grid = minor, + ] + \addplot+[domain=$min[0]:$max[0]] {$m*x+$b}; +\end{axis} +END_TIKZ + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$xticks}, + minor ytick = {$yticks}, + grid = minor, + ] + \addplot+[domain=$min[0]:$max[0]] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[above left] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[above right] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ ############################################## @@ -115,7 +116,7 @@ END_PGML BEGIN_TEXT $PAR $BCENTER -\{image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line is horizontal and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line is horizontal and also passes through the point ($x2,$y2)"') \} +\{image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line is horizontal and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line is horizontal and also passes through the point ($x2,$y2)"') \} $ECENTER $PAR END_TEXT @@ -126,27 +127,6 @@ BEGIN_PGML END_PGML ############################################## -if ($m > 0) -{$p1vert = 'bottom'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'left';} -else {$p1vert = 'top'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'right';}; - -$gr[1]->stamps( closed_circle($x1,$y1,'red') ); -$gr[1]->lb( new Label($x1,$y1,"$pt1",'red',$p1hor,$p1vert)); -$gr[1]->stamps( closed_circle($x2,$y2,'red') ); -$gr[1]->lb( new Label($x2,$y2,"$pt2",'red',$p2hor,$p2vert)); - -$gr[1]->moveTo($x1,$y1); -$gr[1]->lineTo($x2,$y1,'red',2); -$gr[1]->lineTo($x2,$y2,'red',2); -$gr[1]->lb( new Label(($x1+$x2)/2,$y1,"$run",'red','center','top')); -$gr[1]->lb( new Label($x2,($y1+$y2)/2,"$rise",'red','left','middle')); - Context()->texStrings; BEGIN_SOLUTION @@ -158,7 +138,7 @@ To be more consistent with how you might approach problems like this that do not Next, we sketch a slope triangle and find the $BITALIC rise$EITALIC and $BITALIC run$EITALIC. In the sketch below, the rise is \($rise\) and the run is \($run\). $BCENTER -\{ image( insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) +\{ image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) \} $ECENTER $PAR diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg index 0a9b74e6b2..2b6f63afda 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg @@ -39,7 +39,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = OneOf("DNE","NONE"); $a = non_zero_random(-4,4,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg index b8501ed062..2fac87ad4f 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = random(2,6,1); do {$b = random(2,6,1);} until ($a!=$b); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg index 03ba7a9efd..2b10250488 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = random(2,6,1); do {$b = random(2,6,1);} until ($a!=$b); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg index 4c07803d78..5cf768fd65 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = random(2,6,1); do {$b = random(2,6,1);} until ($a!=$b); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg index b468f2435c..8872a6e797 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = random(2,6,1); do {$b = random(2,6,1);} until ($a!=$b); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg index eccd9065ea..12317ec53c 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = 1; $b = non_zero_random(-6,6,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg index 74b17d7a33..d4ae170c06 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = non_zero_random(2,6,1); $b = 1; diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg index 59e7aa6d23..cc9d5c9c09 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m=random(2,5,1); @ar_m = ($m,1/$m,2*$m,$m-1,$m); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg index a9ac740bca..fc070f8c0b 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m= -random(2,5,1); @ar_m = ($m,$m+1,-$m,-1/$m,$m); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg index c38720869b..0d3a8ead0e 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m=random(2,5,1); $b=non_zero_random(-4,4,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg index e7465fa348..e871e8605f 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m= -random(2,5,1); $b=non_zero_random(-4,4,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg index 9607760579..11d0fda32d 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m=1; do {$b=non_zero_random(-4,4,1)} until ($b != 1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg index 5b3ed085fc..080c7fb2dd 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m= -1; do {$b=non_zero_random(-4,4,1)} until ($b != -1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg index a1ff377479..1ceee82779 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## Context("Fraction"); -$refreshCachedImages=1; + $num = random(1,5,1); do {$den=random(2,5,1);} until (gcd($num,$den)==1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg index b33c905575..d27dd56cee 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## -$refreshCachedImages=1; + Context("Fraction"); $num = -random(1,5,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints10.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints10.pg index 79b7ec0a9b..e149df8554 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints10.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints10.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m=random(2,5,1); @ar_m = ($m,$m+1,-$m,-$m-1,$m); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg index f4adda4085..aeb0934edf 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = 0; $b=non_zero_random(-5,5,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg index b0cbf8e303..3df129f5e2 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = 0; $b=non_zero_random(-5,5,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints20.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints20.pg index cc5d667522..6db7516433 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints20.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints20.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m= -random(2,5,1); @ar_m = ($m,$m+1,-$m,-$m-1,$m); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg index 0c56a03495..de4ba45fae 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num = random(2,9,1); do {$den = random(2,9,1);} until (gcd($num,$den)==1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints35.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints35.pg index b6483e2569..c12e18ce62 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints35.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints35.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num = 3; $den = 1; diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg index c21fabe695..12f82bd3f1 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num = 1; diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg index 1f0be36357..a828b22db8 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m=random(2,5,1); $b=non_zero_random(-5,5,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg index 44091cd5ad..b8a37069a0 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m=-random(2,5,1); $b=non_zero_random(-5,5,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints70.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints70.pg index e8cd72efb8..7f6b415adb 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints70.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints70.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num = 2; $den = 1; diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg index 9a6a122ad7..d031f76359 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num = 2; $den = 1; diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg index b06b9918b9..31a588afd2 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = 0; $b=non_zero_random(-5,5,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg index 76854d38ba..5e59a9757d 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = 0; $b=non_zero_random(-5,5,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg index 8492227945..a7663289d7 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $x = non_zero_random(-8,8,1); do {$y = non_zero_random(-8,8,1);} until (abs($x)!=abs($y)); @@ -200,7 +200,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $x = non_zero_random(-8,8,1); do {$y = non_zero_random(-8,8,1);} until (abs($x)!=abs($y)); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg index 37ab89db80..6d1e740eff 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $x = non_zero_random(-8,8,1); $y = 0; @@ -197,7 +197,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $x = non_zero_random(-8,8,1); #do {$y = non_zero_random(-8,8,1);} until (abs($x)!=abs($y)); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg index 85bde7a281..af4d0a70bc 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $x = 0; $y = non_zero_random(-8,8,1); @@ -197,7 +197,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $x = 0; #do {$y = non_zero_random(-8,8,1);} until (abs($x)!=abs($y)); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg index cf1e3bc723..e92ab2d542 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $x = non_zero_random(-8.5,8.5,1); do {$y = non_zero_random(-8.5,8.5,1);} until (abs($x)!=abs($y)); @@ -202,7 +202,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $x = non_zero_random(-8.5,8.5,1); do {$y = non_zero_random(-8.5,8.5,1);} until (abs($x)!=abs($y)); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs50.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs50.pg index 09e9cee43c..ab67bdb390 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs50.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs50.pg @@ -36,7 +36,7 @@ loadMacros( ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $px1 = random(3,8,1)*random(-1,1,2); $py1 = random(3,8,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotDouble.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotDouble.pg new file mode 100644 index 0000000000..e9be9f3156 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotDouble.pg @@ -0,0 +1,68 @@ +# Plot a point where one coordinate is doubled from a given plotted point. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric"); + +@xy = (1..7)[NchooseK(7,2)]; +$point = Point(@xy); +$reflection = list_random( + ['first',Point(2*$xy[0],$xy[1])], + ['second',Point($xy[0],2*$xy[1])] +); + +$gt = GraphTool("{point,$reflection->[1]}")->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-1, 15, 15, -1], + staticObjects => [ "{point,$point}"], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $score = 0; + my @errors; + my $count = 0; + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) eq $correct->[0]->extract(1) && $j->extract(2) eq $correct->[0]->extract(2)) { + $score += 1; + next; + } + push(@errors, "The $nth plotted point is incorrect."); + } + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +A point is plotted. Graph the point that comes from doubling the [@$reflection->[0]@] coordinate. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMX.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMX.pg new file mode 100644 index 0000000000..071ea3d870 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMX.pg @@ -0,0 +1,96 @@ +# Plot y = mx for positive integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +$m = random(2,7,1); +($h,$k) = (0,0); +($u,$v) = ($h+1,$k+$m); + +Context("Numeric"); +$f = Formula("$m x")->reduce; +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMXPlusB.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMXPlusB.pg new file mode 100644 index 0000000000..ff0b113fe3 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMXPlusB.pg @@ -0,0 +1,102 @@ +# Plot y = mx+b for positive integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([2..7],[1]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerPointSlope.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerPointSlope.pg new file mode 100644 index 0000000000..59c9658157 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerPointSlope.pg @@ -0,0 +1,104 @@ +# Plot y = m(x-h)+k for positive integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +do { + ($rise,$run) = random_coprime([2..7],[1]); + Context("Fraction"); + $m = Fraction($rise,$run); + ($h,$k) = (-7..-1,1..7)[NchooseK(14,2)]; + ($u,$v) = ($h+$run,$k+$rise); + ($p,$q) = ($h-$run,$k-$rise); + Context()->flags->set(reduceConstants=>0); + $f = Formula("$m (x - $h) + $k")->reduce; + $b = $f->eval(x=>0); +} until (abs($b) > 8 && ((abs($u) < 8 && abs($v) < 8) || (abs($p) < 8 && abs($q) < 8))); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`] by identifying the slope and one point on the line. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMX.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMX.pg new file mode 100644 index 0000000000..dfc4ece4ad --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMX.pg @@ -0,0 +1,101 @@ +# Plot y = mx for positive fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([1..7],[2..7]); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,0); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +$f = Formula("$m x"); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMXPlusB.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMXPlusB.pg new file mode 100644 index 0000000000..785f5a0bf5 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMXPlusB.pg @@ -0,0 +1,102 @@ +# Plot y = mx+b for positive fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([1..7],[2..7]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMX.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMX.pg new file mode 100644 index 0000000000..d51eb91ee3 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMX.pg @@ -0,0 +1,96 @@ +# Plot y = mx for negative integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +$m = -random(2,7,1); +($h,$k) = (0,0); +($u,$v) = ($h+1,$k+$m); + +Context("Numeric"); +$f = Formula("$m x")->reduce; +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMXPlusB.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMXPlusB.pg new file mode 100644 index 0000000000..2f62231f58 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMXPlusB.pg @@ -0,0 +1,103 @@ +# Plot y = mx+b for negative integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([-7..-2],[1]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +Context()->noreduce('(-x)+y','(-x)-y'); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerPointSlope.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerPointSlope.pg new file mode 100644 index 0000000000..6259850cbb --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerPointSlope.pg @@ -0,0 +1,105 @@ +# Plot y = m(x-h)+k for negative integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +do { + ($rise,$run) = random_coprime([-7..-2],[1]); + Context("Fraction"); + $m = Fraction($rise,$run); + ($h,$k) = (-7..-1,1..7)[NchooseK(14,2)]; + ($u,$v) = ($h+$run,$k+$rise); + ($p,$q) = ($h-$run,$k-$rise); + Context()->flags->set(reduceConstants=>0); + Context()->noreduce('(-x)-y','(-x)+y'); + $f = Formula("$m (x - $h) + $k")->reduce; + $b = $f->eval(x=>0); +} until (abs($b) > 8 && ((abs($u) < 8 && abs($v) < 8) || (abs($p) < 8 && abs($q) < 8))); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`] by identifying the slope and one point on the line. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMX.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMX.pg new file mode 100644 index 0000000000..18ebf85961 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMX.pg @@ -0,0 +1,101 @@ +# Plot y = mx for negative fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([-7..-1],[2..7]); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,0); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +$f = Formula("$m x"); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMXPlusB.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMXPlusB.pg new file mode 100644 index 0000000000..efd529f6a4 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMXPlusB.pg @@ -0,0 +1,103 @@ +# Plot y = mx+b for negative fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([-7..-1],[2..7]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +Context()->noreduce('(-x)+y','(-x)-y'); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegPointSlope.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegPointSlope.pg new file mode 100644 index 0000000000..1625773d8f --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegPointSlope.pg @@ -0,0 +1,104 @@ +# Plot y = m(x-h)+k for negative fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +do { + ($rise,$run) = random_coprime([-7..-1],[2..7]); + Context("Fraction"); + $m = Fraction($rise,$run); + ($h,$k) = (-7..-1,1..7)[NchooseK(14,2)]; + ($u,$v) = ($h+$run,$k+$rise); + ($p,$q) = ($h-$run,$k-$rise); + Context()->flags->set(reduceConstants=>0); + $f = Formula("$m (x - $h) + $k")->reduce; + $b = $f->eval(x=>0); +} until (int($b) != $b && ((abs($u) < 8 && abs($v) < 8) || (abs($p) < 8 && abs($q) < 8))); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`] by identifying the slope and one point on the line. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegSlopeThroughPoint.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegSlopeThroughPoint.pg new file mode 100644 index 0000000000..d67d0d091a --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegSlopeThroughPoint.pg @@ -0,0 +1,101 @@ +# Plot a line of a given negative fraction slope that passes through a given +# point in [-3,3]x[-3,3]. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise, $run) = random_coprime([-5..-1],[2..5]); +($h,$k) = (-3..-1,1..3)[NchooseK(6,2)]; +($u,$v) = ($h+$run,$k+$rise); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + +Context("Fraction"); +$m = Fraction($rise,$run); + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + push(@errors, "The $nth plotted line does not pass through $A."); + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot a line through the point [`[$A]`] that has slope [`[$m]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegXPlusB.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegXPlusB.pg new file mode 100644 index 0000000000..9f7bc809d3 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegXPlusB.pg @@ -0,0 +1,103 @@ +# Plot y = -x+b +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([-1],[1]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +Context()->noreduce('(-x)+y','(-x)-y'); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotPointSlope.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotPointSlope.pg new file mode 100644 index 0000000000..943a525e1e --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotPointSlope.pg @@ -0,0 +1,104 @@ +# Plot y = m(x-h)+k for positive fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +do { + ($rise,$run) = random_coprime([1..7],[2..7]); + Context("Fraction"); + $m = Fraction($rise,$run); + ($h,$k) = (-7..-1,1..7)[NchooseK(14,2)]; + ($u,$v) = ($h+$run,$k+$rise); + ($p,$q) = ($h-$run,$k-$rise); + Context()->flags->set(reduceConstants=>0); + $f = Formula("$m (x - $h) + $k")->reduce; + $b = $f->eval(x=>0); +} until (int($b) != $b && ((abs($u) < 8 && abs($v) < 8) || (abs($p) < 8 && abs($q) < 8))); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`] by identifying the slope and one point on the line. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotReflection.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotReflection.pg new file mode 100644 index 0000000000..9c0a22ebc6 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotReflection.pg @@ -0,0 +1,68 @@ +# Plot a point where one coordinate is negated from a given plotted point. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric"); + +@xy = (1..7)[NchooseK(7,2)]; +$point = Point(@xy); +$reflection = list_random( + ['first',Point(-$xy[0],$xy[1])], + ['second',Point($xy[0],-$xy[1])] +); + +$gt = GraphTool("{point,$reflection->[1]}")->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + staticObjects => [ "{point,$point}"], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $score = 0; + my @errors; + my $count = 0; + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) eq $correct->[0]->extract(1) && $j->extract(2) eq $correct->[0]->extract(2)) { + $score += 1; + next; + } + push(@errors, "The $nth plotted point is incorrect."); + } + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +A point is plotted. Graph the point that comes from negating the [@$reflection->[0]@] coordinate. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotRelation.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotRelation.pg new file mode 100644 index 0000000000..77c24359d4 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotRelation.pg @@ -0,0 +1,75 @@ +# Plot four points with a simple linear relation. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric"); + +my $b = non_zero_random(-7,7,1); +$absb = abs($b); +$cmp = ($b > 0) ? 'more' : 'less'; +$minx = max(-8,-8-$b); +$maxx = min(8,8-$b); +@point = map {Point($_,$_+$b)} ($minx..$maxx); +$points = '{point,'.join('},{point,',@point).'}'; + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $extra = 0; + my $distinct = 0; + my @errors; + my $count = 0; + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) ne 'point' || ($j->extract(2)->value)[1] != ($j->extract(2)->value)[0] + $b) { + push(@errors, "The $nth plotted point is incorrect."); + $extra++; + next STUDENTS; + } + for my $i (0..($count-2)) { + next STUDENTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinct++; + } + push(@errors, "You've only plotted $distinct correct point".(($distinct > 1)?'s':'').".") if ($distinct > 0 && $distinct < 4); + return (scalar(@{$correct})*min($distinct,4)/4/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Graph at least four distinct points where the [`y`]-coordinate is [`[$absb]`] [$cmp] than the [`x`]-coordinate. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlope.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlope.pg new file mode 100644 index 0000000000..bff33a7468 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlope.pg @@ -0,0 +1,103 @@ +# Plot three lines that each have the given slope. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise, $run) = random_coprime([1..5],[2..5]); + +Context("Numeric"); +@A = (); +for my $x (-8..(8-$run)) { + for my $y (-8..(-9+$rise)) { + push(@A, Point($x,$y)); + } +} +for my $x (-8..(-9+$run)) { + for my $y ((-8+$rise)..(8-$rise)) { + push(@A, Point($x,$y)); + } +} +%B = map{$_ => $_+Point($run,$rise)}(@A); +@gtlines = map{'{line,solid,' . $_ . ',' . $B{$_} .'}'} (@A); + + +Context("Fraction"); +$m = Fraction($rise,$run); + +$gt = GraphTool(join(',',@gtlines))->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $extra = 0; + my $distinct = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + push(@errors, "You've only plotted $distinct correct line".(($distinct > 1)?'s':'').".") if ($distinct > 0 && $distinct < 3); + return (scalar(@{$correct})*min($distinct,3)/3/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot at least three lines that each have slope [`[$m]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlopeThroughPoint.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlopeThroughPoint.pg new file mode 100644 index 0000000000..c3de374901 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlopeThroughPoint.pg @@ -0,0 +1,101 @@ +# Plot a line of a given positive fraction slope that passes through a given +# point in [-3,3]x[-3,3]. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise, $run) = random_coprime([1..5],[2..5]); +($h,$k) = (-5..-1,1..3)[NchooseK(8,2)]; +($u,$v) = ($h+$run,$k+$rise); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + +Context("Fraction"); +$m = Fraction($rise,$run); + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + push(@errors, "The $nth plotted line does not pass through $A."); + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot a line through the point [`[$A]`] that has slope [`[$m]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSmallPoints.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSmallPoints.pg new file mode 100644 index 0000000000..62757a183f --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSmallPoints.pg @@ -0,0 +1,74 @@ +# Plot four points on the [-7,7]x[-7,7] plane. +# One in each quadrant, except one moved onto an axis. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric"); + +@xy = (0..7)[NchooseK(8,8)]; +$point[0] = Point($xy[0],$xy[1]); +$point[1] = Point(-$xy[2],$xy[3]); +$point[2] = Point($xy[4],-$xy[5]); +$point[3] = Point(-$xy[6],-$xy[7]); +@point = (@point)[NchooseK(4,4)]; + +$gt = GraphTool("{point,$point[0]},{point,$point[1]},{point,$point[2]},{point,$point[3]}")->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @score = (0,0,0,0); + my @errors; + my $count = 0; + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + for my $i (0..3) { + if ($j->extract(1) eq $correct->[$i]->extract(1) && $j->extract(2) eq $correct->[$i]->extract(2)) { + $score[$i] += 1; + next STUDENTS; + } + } + push(@errors, "The $nth plotted point is incorrect."); + } + my $numerator = ($score[0] ? 1 : 0) + ($score[1] ? 1 : 0) + ($score[2] ? 1 : 0) + ($score[3] ? 1 : 0); + push(@errors, "You have only plotted $numerator of the given points.") if ($numerator > 0 && $numerator < 4); + my $denominator = 4 + $count - ($score[0] + $score[1] + $score[2] + $score[3]); + return ($numerator/$denominator*$count, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Graph the points [`[$point[0]]`], [`[$point[1]]`], [`[$point[2]]`], and [`[$point[3]]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotXPlusB.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotXPlusB.pg new file mode 100644 index 0000000000..d3c0777d53 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/PlotXPlusB.pg @@ -0,0 +1,102 @@ +# Plot y = x+b +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([1],[1]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant20.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant20.pg index 43fc4683f3..690ab5ba5b 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant20.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant20.pg @@ -28,14 +28,15 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserPopUp.pl", - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PCCgraphMacros.pl", "PGcourse.pl", ); ############################################## -$refreshCachedImages=1; + Context("Numeric"); @conditions = ( @@ -73,49 +74,33 @@ $ymark = 2; $shift = 0.2; -$gr = init_graph($xmin,$ymin,$xmax,$ymax, - axes=>[0,0], - grid=>[($xmax-$xmin)/$xmark,($ymax-$ymin)/$ymark], - size=>[xPixels(),yPixels()] -); - -$gr->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - if (Real($j) == 0) {$gr->lb( new Label(0.1, -0.1, ' '.$j,'black','left','top'));} - else {$gr->lb( new Label($j, -0.1, $j,'black','center','top'));} -} -for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $gr->lb( new Label(0, $j,' '.$j,'black','left','middle')); -} -$gr->lb( new Label($xmax, $shift, "x ",'black','right','bottom')); -$gr->lb( new Label(0, $ymax-$shift, " y",'black','left','top')); - -$sample1 = 3; -$sample2 = 5; -$sample3 = 6; -$gr->stamps(closed_circle($sample1,$sample1,'blue')); -$gr->stamps(closed_circle(-$sample1,$sample1,'blue')); -$gr->stamps(closed_circle(-$sample1,-$sample1,'blue')); -$gr->stamps(closed_circle($sample1,-$sample1,'blue')); -$gr->stamps(closed_circle(0,$sample2,'blue')); -$gr->stamps(closed_circle(0,-$sample2,'blue')); -$gr->stamps(closed_circle($sample2,0,'blue')); -$gr->stamps(closed_circle(-$sample2,0,'blue')); - -$gr->lb( new Label($sample1, $sample1+$shift, "($sample1,$sample1)",'blue','center','bottom')); -$gr->lb( new Label(-$sample1, $sample1+$shift, "(-$sample1,$sample1)",'blue','center','bottom')); -$gr->lb( new Label(-$sample1, -$sample1-$shift, "(-$sample1,-$sample1)",'blue','center','top')); -$gr->lb( new Label($sample1, -$sample1-$shift, "($sample1,-$sample1)",'blue','center','top')); -$gr->lb( new Label(-$shift, $sample2, "(0,$sample2)",'blue','right','middle')); -$gr->lb( new Label(-$shift, -$sample2, "(0,-$sample2)",'blue','right','middle')); -$gr->lb( new Label($sample2, $shift, "($sample2,0)",'blue','center','bottom')); -$gr->lb( new Label(-$sample2, $shift, "(-$sample2,0)",'blue','center','bottom')); - -$gr->lb( new Label($sample3, $sample3, "Quadrant I",'red','right','middle')); -$gr->lb( new Label(-$sample3, $sample3, "Quadrant II",'red','left','middle')); -$gr->lb( new Label(-$sample3, -$sample3, "Quadrant III",'red','left','middle')); -$gr->lb( new Label($sample3, -$sample3, "Quadrant IV",'red','right','middle')); +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + ] + \addplot[soliddot] coordinates {(5,0)} node[above] {\((5,0)\)}; + \addplot[soliddot] coordinates {(3,3)} node[above] {\((3,3)\)}; + \addplot[soliddot] coordinates {(0,5)} node[right] {\((0,5)\)}; + \addplot[soliddot] coordinates {(-3,3)} node[above] {\((-3,3)\)}; + \addplot[soliddot] coordinates {(-5,0)} node[above] {\((-5,0)\)}; + \addplot[soliddot] coordinates {(-3,-3)} node[above] {\((-3,-3)\)}; + \addplot[soliddot] coordinates {(0,-5)} node[right] {\((0,-5)\)}; + \addplot[soliddot] coordinates {(3,-3)} node[above] {\((3,-3)\)}; + \node[above left] at (axis cs: 6,6) {Quadrant I}; + \node[above right] at (axis cs: -6,6) {Quadrant II}; + \node[below right] at (axis cs: -6,-6) {Quadrant III}; + \node[below left] at (axis cs: 6,-6) {Quadrant IV}; +\end{axis} +END_TIKZ $alt = "This is a coordinate system with the x-axis and y-axis. The following points are marked and labeled: ($sample1, $sample1) in Quadrant I, (-$sample1, $sample1) in Quadrant II, (-$sample1, -$sample1) in Quadrant III, ($sample1, -$sample1) in Quadrant IV, ($sample2, 0) and (-$sample2, 0) on the x-axis, and (0, $sample2) and (0, -$sample2) on the y-axis."; @@ -161,17 +146,17 @@ The following graph has some points and their coordinates. They should help you The correct answers are: - For the point [`(x,y)`], if [$conditions[$scramble{0}][0]], then the point is in/on [@$popup0->correct_ans()@]*. + For the point [`(x,y)`], if [`[$conditions[$scramble{0}][0]]`], then the point is in/on [@$popup0->correct_ans()@]*. - For the point [`(x,y)`], if [$conditions[$scramble{1}][0]], then the point is in/on [@$popup1->correct_ans()@]*. + For the point [`(x,y)`], if [`[$conditions[$scramble{1}][0]]`], then the point is in/on [@$popup1->correct_ans()@]*. - For the point [`(x,y)`], if [$conditions[$scramble{2}][0]], then the point is in/on [@$popup2->correct_ans()@]*. + For the point [`(x,y)`], if [`[$conditions[$scramble{2}][0]]`], then the point is in/on [@$popup2->correct_ans()@]*. - For the point [`(x,y)`], if [$conditions[$scramble{3}][0]], then the point is in/on [@$popup3->correct_ans()@]*. + For the point [`(x,y)`], if [`[$conditions[$scramble{3}][0]]`], then the point is in/on [@$popup3->correct_ans()@]*. - For the point [`(x,y)`], if [$conditions[$scramble{4}][0]], then the point is in/on [@$popup4->correct_ans()@]*. + For the point [`(x,y)`], if [`[$conditions[$scramble{4}][0]]`], then the point is in/on [@$popup4->correct_ans()@]*. - For the point [`(x,y)`], if [$conditions[$scramble{5}][0]], then the point is in/on [@$popup5->correct_ans()@]*. + For the point [`(x,y)`], if [`[$conditions[$scramble{5}][0]]`], then the point is in/on [@$popup5->correct_ans()@]*. END_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant30.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant30.pg index c857d173ab..47cb2a4188 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant30.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant30.pg @@ -33,7 +33,7 @@ loadMacros( ############################################## -$refreshCachedImages=1; + Context("Numeric"); @conditions = ( diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg index 5075da55d4..7d00bf5474 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m= -1; do {$b=non_zero_random(-4,4,1)} until ($b != -1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg index f491c864ae..c9160504b2 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## Context("Fraction"); -$refreshCachedImages=1; + $a= random(2,6,1); do {$d= -random(2,6,1);} until (gcd($a,$d)==1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg index fc8f10b1d9..bada7227d6 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## Context("Fraction"); -$refreshCachedImages=1; + $a= -random(2,6,1); do {$d= -random(2,6,1);} until (gcd($a,$d)==1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg index 31e11fe4ce..5fd8a4fecb 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## Context("Fraction"); -$refreshCachedImages=1; + $a=random(2,6,1); do {$d=random(2,6,1)*random(-1,1,2);} until (gcd($a,$d)==1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg index 823e5cc286..c770bf2df5 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m=1; do {$b=non_zero_random(-4,4,1)} until ($b != 1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg index b4bb5ca62a..db256c8846 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## Context("Fraction"); -$refreshCachedImages=1; + $m=random(2,5,1)*random(-1,1,2); do {$b=non_zero_random(-4,4,1)} until ($b != $m); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg index 688cb400b8..072bb4e11c 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## Context("Fraction"); -$refreshCachedImages=1; + $m=random(2,5,1)*random(-1,1,2); $b=non_zero_random(-4,4,1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg index a6855053ae..be65e9dfd5 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## Context("Fraction"); -$refreshCachedImages=1; + $d=random(2,5,1); $c=non_zero_random(-3,3,1)*$d; diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg index f90e8e8a68..4e47491424 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## Context("Fraction"); -$refreshCachedImages=1; + $d= -random(2,5,1); $c=non_zero_random(-3,3,1)*$d; diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg index df24eec84c..22a1c2cf5d 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## Context("Fraction"); -$refreshCachedImages=1; + #ax+dy=c diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg index 67b0ed7641..9db6ae138b 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## Context("Fraction"); -$refreshCachedImages=1; + $a=random(2,6,1); do {$d=random(2,6,1);} until (gcd($a,$d)==1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg index 74e0861fec..f2113847c4 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## Context("Fraction"); -$refreshCachedImages=1; + $a= -random(2,6,1); do {$d=random(2,6,1);} until (gcd($a,$d)==1); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg index 10c5b63d8e..4528a91f93 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg @@ -43,7 +43,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=ax^2. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg index a47b5e6961..056500d3f1 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg @@ -43,7 +43,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=ax^2. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20ORCCACheckpoint.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20ORCCACheckpoint.pg index 99cc85461c..58637cbafd 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20ORCCACheckpoint.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20ORCCACheckpoint.pg @@ -43,7 +43,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=ax^2. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg index 86620ae90d..9d8f655c64 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg @@ -44,7 +44,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=(x+a)^2. #$gr[0] shows y=(x+a)^2 diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg index 00eae18555..bb2c9a79a5 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg @@ -43,7 +43,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg index 0180a2185d..6fc8f5e710 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg @@ -43,7 +43,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=ax^2. #$a[0], $b[0], $c[0] are used in the correct graph. @@ -199,12 +199,12 @@ for ($i=0;$i<=4;$i++) { $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); add_functions($gr[$i], "$a[$i]*x**2+$b[$i]*x+$c[$i] for x in <$xmin,$xmax> using color:red and weight:1"); - $xpoint1 = $xmin; + $xpoint1 = $xmin+1; $xpoint2 = 0; - $xpoint3 = $xmax; - $ypoint1 = $xpoint1**2 + $a[$i]*$xpoint1; - $ypoint2 = $xpoint2**2 + $a[$i]*$xpoint2; - $ypoint3 = $xpoint3**2 + $a[$i]*$xpoint3; + $xpoint3 = $xmax-1; + $ypoint1 = $a[$i]*($xpoint1)**2 + $b[$i]*$xpoint1 + $c[$i]; + $ypoint2 = $a[$i]*($xpoint2)**2 + $b[$i]*$xpoint2 + $c[$i]; + $ypoint3 = $a[$i]*($xpoint3)**2 + $b[$i]*$xpoint3 + $c[$i]; if($i==4) { push(@alt,"Graph $ALPHABET[$inverse{0}]: graph of a parabola passing through the points ($xpoint1,$ypoint1), ($xpoint2,$ypoint2) and ($xpoint3,$ypoint3). Its vertex is $vertex[$i]."); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg index 24f319e6e9..e138933754 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg @@ -41,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg index 9481f0b2b4..e88c921bc2 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg @@ -41,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a and b in y= -(x+a)^2+b. #$a[0], b[0] are the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg index 3471d23f52..7e7865bf13 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Fraction"); @a=(); @@ -54,7 +54,7 @@ $a[3] = $a[0]; Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of b in y=ax^2+b. #b[0] is in the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg index 16ec9e5eae..cb6bdf3e83 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg @@ -43,7 +43,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of b in y=ax^2+b. #a[0],b[0] is in the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg index e78d18090e..18642e1179 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg @@ -41,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #These arrays store value of a,h,k in y= a(x+h)^2+k. # [0] are used in the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg index 55fbbf6b84..ed2ef98780 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg @@ -41,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg index db61db84d4..4e97f26375 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg @@ -41,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg index 3eea15cb7e..0b16411d5e 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg @@ -41,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg index 7190021120..d39d1860b0 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg @@ -41,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg index 43ab7aeff7..7ffbf1f31f 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg @@ -41,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg index bfe4aeae1a..1ecc64f58d 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg @@ -41,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg index 97de839c73..4e1b818bfa 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg @@ -41,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg index 3cfb3c215b..1e3d7e7b21 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg @@ -41,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a and b in y=(x+a)^2+b. #$a[0], b[0] are the correct graph. The others are used in wrong graphs. diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola10.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola10.pg index be5cc9f358..e08a53021b 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola10.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola10.pg @@ -44,7 +44,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola100.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola100.pg index 84cdd5b942..b0fcad24b0 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola100.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola100.pg @@ -44,7 +44,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola110.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola110.pg index c7e9acfbf2..bc3320657b 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola110.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola110.pg @@ -45,7 +45,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola20.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola20.pg index f184db7620..427225a133 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola20.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola20.pg @@ -44,7 +44,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola30.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola30.pg index 3ab6aec30a..09de1c1cbb 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola30.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola30.pg @@ -44,7 +44,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola40.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola40.pg index 7ee53b0c3f..b0f4bec02f 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola40.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola40.pg @@ -44,7 +44,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola50.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola50.pg index 992977f6a8..6a45166a03 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola50.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola50.pg @@ -44,7 +44,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola60.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola60.pg index 3d1e82e487..c4ce55540e 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola60.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola60.pg @@ -44,7 +44,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola70.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola70.pg index 71de0e5c51..97a06de0a6 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola70.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola70.pg @@ -44,7 +44,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola80.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola80.pg index e48c37776f..efde14626d 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola80.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola80.pg @@ -44,7 +44,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola90.pg b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola90.pg index 9dc7d9b480..92abd899d9 100644 --- a/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola90.pg +++ b/Contrib/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola90.pg @@ -44,7 +44,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation100.pg b/Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation100.pg index fbbea114ad..aee768fb33 100644 --- a/Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation100.pg +++ b/Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation100.pg @@ -28,6 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", + "parserNumberWithUnits.pl", "contextTypeset.pl", "PGcourse.pl", ); @@ -39,13 +40,15 @@ Context()->variables->are(h=>"Real"); Context()->flags->set(reduceConstants=>0); Context()->flags->set(showExtraParens=>0); -$base1 = random(1,2,0.5)*12; -$base2 = random(1,2,0.5)*12; -$height = random(1,2,0.5)*12; -$volume = $base1*$base2*$height/1728; -$volumeInch = $volume*1728; +$base1 = random(1,2,0.1); +$base2 = Round($base1*1.6,1); +$b1U = NumberWithUnits("$base1 ft"); +$b2U = NumberWithUnits("$base2 ft"); +$volume = Round($base1*$base2*random(0.25,0.75,0.05)); +$vU = NumberWithUnits("$volume ft^3"); +$height = $volume/($base1*$base2); -$ansString = "$base1*$base2*h=$volumeInch"; +$ansString = "$volume=$base1*$base2*h"; $ans = Compute("$ansString"); @@ -55,9 +58,9 @@ TEXT(beginproblem()); BEGIN_PGML -A cat litter box has a rectangular base that is [`[$base1]`] inches by [`[$base2]`] inches. What will the height of the cat litter be if [`[$volume]`] cubic feet of cat litter is poured? (Hint: [`1 \text{ ft}^3 = 1728 \text{ in}^3`]) +The base of a cat litter box is [`[$b1U]`] by [`[$b2U]`]. What will be the height of the cat litter if [`[$vU]`] of cat litter is poured? (The volume of a rectangular box is [`wdh`], where [`w`] is the width, [`d`] is the depth, and [`h`] is the height.) -Assume [`h`] inches will be the height of the cat litter if [`[$volume]`] cubic feet of cat litter is poured. Write an equation to model this scenario. There is no need to solve it. +Let [`h`] be the number of ft high that the cat litter will occupy if [`[$vU]`] of cat litter is poured. Write an equation to model this scenario. There is no need to solve it. [_________________________] @@ -91,13 +94,9 @@ The volume of a rectangular prism can be calculated by the formula: [``\text{Volume}=\text{base1}\cdot\text{base2}\cdot\text{height}``] -In this problem, we must first convert all units to the same. It's easier to convert [`[$volume]`] cubic feet to cubic inches: +So we can write an equation based on the volume formula: - [``[$volume]\text{ ft}^3\cdot\frac{1728\text{ in}^3}{1\text{ ft}^3}=[$volume]\cdot1728\text{ in}^3=[$volumeInch]\text{ in}^3``] - -Next, we can write an equation based on the volume formula: - - [``[$base1]\cdot[$base2]h=[$volumeInch]``] + [``[$volume]=[$base1]\cdot[$base2]h``] END_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality140.pg b/Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality140.pg index 5a3a019415..e042e7dc1d 100644 --- a/Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality140.pg +++ b/Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality140.pg @@ -96,8 +96,8 @@ $evaluator = $ans->cmp( Value::Error('Write an inequality, not an equation.') if ($sign eq '='); Value::Error('Your inequality is not using the correct sign.') if ($sign eq '<' or $sign eq '>'); # distinguish between good/bad uses of >=/<= - my $left = Formula($student->{tree}->{lop})->eval(h=>0); - my $right = Formula($student->{tree}->{rop})->eval(h=>0); + my $left = Formula($student->{tree}->{lop})->eval(h=>10); + my $right = Formula($student->{tree}->{rop})->eval(h=>10); $OK = ($sign eq '>=') ? ($left >= $right) : ($left <= $right); Value::Error('Your inequality is not using the correct sign.') unless ($OK); return $OK; diff --git a/Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints60.pg b/Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints60.pg index 550e148645..35ea86380d 100644 --- a/Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints60.pg +++ b/Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints60.pg @@ -95,12 +95,12 @@ Context("Numeric"); Context()->flags->set(reduceConstants=>0); Context()->noreduce('(-x)-y','(-x)+y'); $fname = 'P'; -Context()->variables->add(t=>'Real'); +Context()->variables->are(t => 'Real'); parser::Assignment->Allow; parser::Assignment->Function("$fname"); $m = Real(($b[1] - $b[0])/($a[1] - $a[0])); $yint = $b[0] - $m*$a[0]; -$f = Formula("$fname(x) = $m x + $yint")->reduce; +$f = Formula("$fname(t) = $m t + $yint")->reduce; ############################################################ # Body @@ -138,19 +138,19 @@ To find the equation of [`[$fname](t)=m t+b`], we first try to find the line's s By the given conditions, the line passes the points [`([$a[0]],[$b[0]])`] and [`([$a[1]],[$b[1]])`]. We will use the slope formula: - [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + [`` \text{slope}=\frac{y_{2}-y_{1}}{t_{2}-t_{1}} ``] First, we mark which number corresponds to which variable in the formula: - [`` ([$a[0]],[$b[0]]) \longrightarrow (x_{1},y_{1}) ``] + [`` ([$a[0]],[$b[0]]) \longrightarrow (t_{1},y_{1}) ``] - [`` ([$a[1]],[$b[1]]) \longrightarrow (x_{2},y_{2}) ``] + [`` ([$a[1]],[$b[1]]) \longrightarrow (t_{2},y_{2}) ``] Now we substitute these numbers into the corresponding variables in the slope formula: [`` \begin{aligned} \text{slope} - &=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{y_{2}-y_{1}}{t_{2}-t_{1}}\\ &=\frac{[$b[1]]-[$s6]}{[$a[1]]-[$s7]}\\ &=\frac{[$s8]}{[$a[1]-$a[0]]}\\ &=[$m] diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg index 73b4da98c4..03beb63b42 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg index 172764402c..773a0c4035 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg index 5e39e66af4..31a0eea1f0 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg @@ -74,7 +74,7 @@ BEGIN_PGML Solve the compound inequality algebraically. -[@KeyboardInstructions('For the [`\infty`] symbol, type [|INF|]*. For the union symbol [`\cup`], type [|U|]*. For [`\leq`], type [|<=|]*. For [`\geq`], type [|>=|]*. For the such that symbol in set-builder notation, [|||]* is usually above the [|Enter|]* key')@]** +[@KeyboardInstructions('For the [`\infty`] symbol, type [|INF|]*. For the union symbol [`\cup`], type [|U|]*. For [`\leq`], type [|<=|]*. For [`\geq`], type [|>=|]*. For the such that symbol in set-builder notation, [| | |]* is usually above the [|Enter|]* key')@]** [`` [$left] [$comp0] \frac{[$b]}{[$c]}x [$comp1] [$right] ``] diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg index a70c1fe45b..ecc2447759 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg @@ -81,7 +81,7 @@ Solve the compound inequality algebraically. [`` [$left] [$comp0] [$b]-\frac{[$c]}{[$d]}x [$comp1] [$right] ``] -[@KeyboardInstructions('For the [`\infty`] symbol, type [|INF|]*. For the union symbol [`\cup`], type [|U|]*. For [`\leq`], type [|<=|]*. For [`\geq`], type [|>=|]*. For the such that symbol in set-builder notation, [|||]* is usually above the [|Enter|]* key')@]** +[@KeyboardInstructions('For the [`\infty`] symbol, type [|INF|]*. For the union symbol [`\cup`], type [|U|]*. For [`\leq`], type [|<=|]*. For [`\geq`], type [|>=|]*. For the such that symbol in set-builder notation, [| | |]* is usually above the [|Enter|]* key')@]** In set-builder notation, the solution set is [______________]{$setans}. diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg index 814feffc04..f778906335 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg index 546a2bae74..538e5c2f0e 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg index ff749814a8..3239e5511c 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg index e5a5f58f84..c27fe967dd 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg index e42ad373f5..6635a03798 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg index 33298a3c79..1d608af1e9 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg index 2157646e21..ef84012d08 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg @@ -38,7 +38,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg index 55156d8504..5ba55514aa 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg @@ -37,7 +37,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg index 9ac19c929a..1318ad7ad3 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg @@ -37,7 +37,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg index 66c3b18ea0..b9c219fa19 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg @@ -37,7 +37,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation50.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation50.pg new file mode 100644 index 0000000000..158abf304a --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation50.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,2,1); +$b = random($a+1,4,1); +$leftType = random(0,1,1)==0 ? ')' : ']'; +$rightType = random(0,1,1)==0 ? '(' : '['; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$a $leftType U $rightType $b,inf)"); + +Context("Numeric"); + +$aspectRatio = 1/5; +$horPixel = 240; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 6; +$pixel = 2*$reach/240; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); + +#make the graphs +$gr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, + size=>[$horPixel,$verPixel]); +$gr->moveTo(0,0); +$gr->arrowTo($reach-2*$pixel,0,'black',1); +$gr->moveTo(0,0); +$gr->arrowTo(-$reach+2*$pixel,0,'black',1); + +@ticks = (); +for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); +$gr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); +$gr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); + +$shadingoffset = $verticalSpace/1.2; +$gr->lb( new Label($a,$shadingoffset,$leftType,'blue','center','middle','giant')); +$gr->moveTo($a,$shadingoffset); +$gr->arrowTo(-$reach+2*$pixel,$shadingoffset,'blue',1); + +$gr->lb( new Label($b,$shadingoffset,$rightType,'blue','center','middle','giant')); +$gr->moveTo($b,$shadingoffset); +$gr->arrowTo($reach-2*$pixel,$shadingoffset,'blue',1); + + +$alt = "This is graph of an interval on a number line. There is a $leftType at $a and everything to the left of $a is shaded; there is a $rightType at $b and everything to the right of $b is shaded."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it in interval notation. + +>> [@image( insertGraph($gr), width=>$screenXSize, tex_size=>$hardCopyPercent, + extra_html_tags=>"title='$alt' alt= '$alt' align='top'" ) @]* << + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], [|>=|]* for [`\geq`], capitalized U for the union symbol.!)@]** + + In interval notation: [_____________________]{$intans} + + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation60.pg new file mode 100644 index 0000000000..4a1eba1143 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation60.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,2,1); +$b = random($a+1,4,1); +$leftType = random(0,1,1)==0 ? '(' : '['; +$rightType = random(0,1,1)==0 ? ')' : ']'; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("$leftType $a,$b $rightType"); + +Context("Numeric"); + +$aspectRatio = 1/5; +$horPixel = 240; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 6; +$pixel = 2*$reach/240; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); + +#make the graphs +$gr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, + size=>[$horPixel,$verPixel]); +$gr->moveTo(0,0); +$gr->arrowTo($reach-2*$pixel,0,'black',1); +$gr->moveTo(0,0); +$gr->arrowTo(-$reach+2*$pixel,0,'black',1); + +@ticks = (); +for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); +$gr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); +$gr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); + +$shadingoffset = $verticalSpace/1.2; +$gr->lb( new Label($a,$shadingoffset,$leftType,'blue','center','middle','giant')); +$gr->moveTo($a,$shadingoffset); +$gr->lineTo($b,$shadingoffset,'blue',1); +$gr->lb( new Label($b,$shadingoffset,$rightType,'blue','center','middle','giant')); + +$alt = "This is graph of an interval on a number line. There is a $leftType at $a and a $rightType at $b. The segment in between is shaded."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it in interval notation. + +>> [@image( insertGraph($gr), width=>$screenXSize, tex_size=>$hardCopyPercent, + extra_html_tags=>"title='$alt' alt= '$alt' align='top'" ) @]* << + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], [|>=|]* for [`\geq`], capitalized U for the union symbol.!)@]** + + In interval notation: [_____________________]{$intans} + + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg index 0889eb4f50..8c6f2d9514 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg @@ -33,6 +33,8 @@ loadMacros( "parserPopUp.pl", "contextInequalitySetBuilder.pl", "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -46,7 +48,7 @@ $symbol = '>'; InequalitySetBuilder::UseVerticalSuchThat(); Context("InequalitySetBuilder-Only"); -do {$var = RandomVariableName();} until ($var ne 'y' and $var ne 'p' and $var ne 'q' and $var ne 'g'); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); $setans = Compute("{ $var | $var $symbol $a}"); @@ -55,96 +57,42 @@ Context()->flags->set("formatStudentAnswer"=>'parsed'); $intans = Compute("($a,inf)"); Context("Numeric"); -%answer = (leftType => 'open', - rightType => 'inf', #use 'inf' regardles of +/- inf - ); - - -$aspectRatio = 1/5; -$horPixel = 240; -$verPixel = $horPixel*$aspectRatio; -$screenXSize = $horPixel; -$screenYSize = $screenXSize*$aspectRatio; -$reach = 6; -$pixel = 2*$reach/240; -$verticalSpace = $reach*$aspectRatio; -$hardCopyPercent = 1000; #meaning 100% - - -#initializing... -@gr=(); - -#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. -@indices=(); - - -#make the graphs -for $leftType ('open','closed', 'inf') -{ - for $rightType ('open','closed', 'inf') - { - my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, - size=>[$horPixel,$verPixel] - ); - $tempgr->moveTo(0,0); - $tempgr->arrowTo($reach-2*$pixel,0,'black',1); - $tempgr->moveTo(0,0); - $tempgr->arrowTo(-$reach+2*$pixel,0,'black',1); - $tempgr->lb( new Label($reach-$pixel,-$verticalSpace/5,$var,'black','right','top','large')); - @ticks = (); - for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; - - $tempgr->h_ticks(0,"black",@ticks); - $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); - $tempgr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); - $tempgr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); - - $shadingoffset = $verticalSpace/2; - if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) - { - $tempgr->lb( new Label($a,$verticalSpace,$a,'blue','center','bottom','large')); - if ($leftType eq 'open' or $rightType eq 'open') - { - my $bracket = ($leftType eq 'open') ? '(' : ')'; - my $halign = ($leftType eq 'open') ? 'left' : 'right'; - $pixeloffset = ($leftType eq 'open') ? -2*$pixel : 4*$pixel; - $tempgr->lb( new Label($a+$pixeloffset,$shadingoffset,$bracket,'blue',$halign,'middle','giant')); - } - else - { - my $bracket = ($leftType eq 'closed') ? '[' : ']'; - my $halign = ($leftType eq 'closed') ? 'left' : 'right'; - $pixeloffset = ($leftType eq 'closed') ? -2*$pixel : 4*$pixel; - $tempgr->lb( new Label($a+$pixeloffset,$shadingoffset,$bracket,'blue',$halign,'middle','giant')); - }; - $tempgr->moveTo($a,$shadingoffset); - if ($leftType eq 'inf') {$tempgr->arrowTo(-$reach+2*$pixel,$shadingoffset,'blue',1)} - else {$tempgr->arrowTo($reach-2*$pixel,$shadingoffset,'blue',1)}; - push(@gr,$tempgr); - if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) - {push(@indices, $#gr);} - else {unshift(@indices, $#gr);} - } - -}}; +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[openinfiniteinterval] coordinates {($a,0) (6,0)}; +\end{axis} +END_TIKZ + $alt = "Graph of an interval on a number line. There is a left parenthesis at $a and everything right of that is shaded. To the right of the axis, there is a letter $var."; ############################################## -$refreshCachedImages = 1; + BEGIN_PGML For the interval expressed in the number line, write it using set-builder notation and interval notation. ->> [@image( insertGraph($gr[ $indices[0] ]), width=>$screenXSize, tex_size=>$hardCopyPercent, - extra_html_tags=>'title="$alt" alt= "$alt" align="top"' ) @]* << +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << + +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** -[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** - In set-builder notation: [_____________________] +[_]{$setans}{30} - In interval notation: [_____________________] +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** +[_]{$intans}{30} END_PGML @@ -153,9 +101,6 @@ END_PGML ############################################## -ANS( $setans->cmp() ); - -ANS( $intans->cmp() ); BEGIN_PGML_SOLUTION @@ -168,3 +113,4 @@ The corresponding interval notation is [`[$intans]`]. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg index a50b40240b..eef96ac55e 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg @@ -33,6 +33,8 @@ loadMacros( "parserPopUp.pl", "contextInequalitySetBuilder.pl", "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -46,7 +48,7 @@ $symbol = '\ge'; InequalitySetBuilder::UseVerticalSuchThat(); Context("InequalitySetBuilder-Only"); -do {$var = RandomVariableName();} until ($var ne 'y' and $var ne 'p' and $var ne 'q' and $var ne 'g'); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); $setans = Compute("{ $var | $var >= $a}"); @@ -55,98 +57,42 @@ Context()->flags->set("formatStudentAnswer"=>'parsed'); $intans = Compute("[$a,inf)"); Context("Numeric"); -%answer = (leftType => 'closed', - rightType => 'inf', #use 'inf' regardles of +/- inf - ); - - -$aspectRatio = 1/5; -$horPixel = 240; -$verPixel = $horPixel*$aspectRatio; -$screenXSize = $horPixel; -$screenYSize = $screenXSize*$aspectRatio; -$reach = 6; -$pixel = 2*$reach/240; -$verticalSpace = $reach*$aspectRatio; -$hardCopyPercent = 1000; #meaning 100% - - -#initializing... -@gr=(); - -#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. -@indices=(); - - -#make the graphs -for $leftType ('open','closed', 'inf') -{ - for $rightType ('open','closed', 'inf') - { - my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, - size=>[$horPixel,$verPixel] - ); - $tempgr->moveTo(0,0); - $tempgr->arrowTo($reach-2*$pixel,0,'black',1); - $tempgr->moveTo(0,0); - $tempgr->arrowTo(-$reach+2*$pixel,0,'black',1); - $tempgr->lb( new Label($reach-$pixel,-$verticalSpace/5,$var,'black','right','top','large')); - @ticks = (); - for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; - - $tempgr->h_ticks(0,"black",@ticks); - $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); - $tempgr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); - $tempgr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); - - $shadingoffset = $verticalSpace/2; - if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) - { - $tempgr->lb( new Label($a,$verticalSpace,$a,'blue','center','bottom','large')); - if ($leftType eq 'open' or $rightType eq 'open') - { - my $bracket = ($leftType eq 'open') ? '(' : ')'; - my $halign = ($leftType eq 'open') ? 'left' : 'right'; - $pixeloffset = ($leftType eq 'open') ? -2*$pixel : 4*$pixel; - $tempgr->lb( new Label($a+$pixeloffset,$shadingoffset,$bracket,'blue',$halign,'middle','giant')); - } - else - { - my $bracket = ($leftType eq 'closed') ? '[' : ']'; - my $halign = ($leftType eq 'closed') ? 'left' : 'right'; - $pixeloffset = ($leftType eq 'closed') ? -2*$pixel : 4*$pixel; - $tempgr->lb( new Label($a+$pixeloffset,$shadingoffset,$bracket,'blue',$halign,'middle','giant')); - }; - $tempgr->moveTo($a,$shadingoffset); - if ($leftType eq 'inf') {$tempgr->arrowTo(-$reach+2*$pixel,$shadingoffset,'blue',1)} - else {$tempgr->arrowTo($reach-2*$pixel,$shadingoffset,'blue',1)}; - push(@gr,$tempgr); - if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) - {push(@indices, $#gr);} - else {unshift(@indices, $#gr);} - } - -}}; +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[closedinfiniteinterval] coordinates {($a,0) (6,0)}; +\end{axis} +END_TIKZ + $alt = "Graph of an interval on a number line. There is a left bracket at $a and everything right of that is shaded. To the right of the axis, there is a letter $var."; ############################################## -$refreshCachedImages = 1; + BEGIN_PGML For the interval expressed in the number line, write it using set-builder notation and interval notation. ->> [@image( insertGraph($gr[ $indices[0] ]), width=>$screenXSize, tex_size=>$hardCopyPercent, - extra_html_tags=>'title="$alt" alt= "$alt" align="top"' ) @]* << - -[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << - In set-builder notation: [_____________________] +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** - In interval notation: [_____________________] +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** +[_]{$setans}{30} +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** +[_]{$intans}{30} END_PGML @@ -154,10 +100,6 @@ END_PGML ############################################## -ANS( $setans->cmp() ); - -ANS( $intans->cmp() ); - BEGIN_PGML_SOLUTION Since the given graph shades all the values greater than [`[$a]`] (and equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg index 9e26419018..11039f4549 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg @@ -33,6 +33,8 @@ loadMacros( "parserPopUp.pl", "contextInequalitySetBuilder.pl", "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -46,7 +48,7 @@ $symbol = '<'; InequalitySetBuilder::UseVerticalSuchThat(); Context("InequalitySetBuilder-Only"); -do {$var = RandomVariableName();} until ($var ne 'y' and $var ne 'p' and $var ne 'q' and $var ne 'g'); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); $setans = Compute("{ $var | $var $symbol $a}"); @@ -55,96 +57,41 @@ Context()->flags->set("formatStudentAnswer"=>'parsed'); $intans = Compute("(-inf,$a)"); Context("Numeric"); -%answer = (leftType => 'inf', - rightType => 'open', #use 'inf' regardles of +/- inf - ); - - -$aspectRatio = 1/5; -$horPixel = 240; -$verPixel = $horPixel*$aspectRatio; -$screenXSize = $horPixel; -$screenYSize = $screenXSize*$aspectRatio; -$reach = 6; -$pixel = 2*$reach/240; -$verticalSpace = $reach*$aspectRatio; -$hardCopyPercent = 1000; #meaning 100% - - -#initializing... -@gr=(); - -#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. -@indices=(); - - -#make the graphs -for $leftType ('open','closed', 'inf') -{ - for $rightType ('open','closed', 'inf') - { - my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, - size=>[$horPixel,$verPixel] - ); - $tempgr->moveTo(0,0); - $tempgr->arrowTo($reach-2*$pixel,0,'black',1); - $tempgr->moveTo(0,0); - $tempgr->arrowTo(-$reach+2*$pixel,0,'black',1); - $tempgr->lb( new Label($reach-$pixel,-$verticalSpace/5,$var,'black','right','top','large')); - @ticks = (); - for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; - - $tempgr->h_ticks(0,"black",@ticks); - $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); - $tempgr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); - $tempgr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); - - $shadingoffset = $verticalSpace/2; - if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) - { - $tempgr->lb( new Label($a,$verticalSpace,$a,'blue','center','bottom','large')); - if ($leftType eq 'open' or $rightType eq 'open') - { - my $bracket = ($leftType eq 'open') ? '(' : ')'; - my $halign = ($leftType eq 'open') ? 'left' : 'right'; - $pixeloffset = ($leftType eq 'open') ? -2*$pixel : 4*$pixel; - $tempgr->lb( new Label($a+$pixeloffset,$shadingoffset,$bracket,'blue',$halign,'middle','giant')); - } - else - { - my $bracket = ($leftType eq 'closed') ? '[' : ']'; - my $halign = ($leftType eq 'closed') ? 'left' : 'right'; - $pixeloffset = ($leftType eq 'closed') ? -2*$pixel : 4*$pixel; - $tempgr->lb( new Label($a+$pixeloffset,$shadingoffset,$bracket,'blue',$halign,'middle','giant')); - }; - $tempgr->moveTo($a,$shadingoffset); - if ($leftType eq 'inf') {$tempgr->arrowTo(-$reach+2*$pixel,$shadingoffset,'blue',1)} - else {$tempgr->arrowTo($reach-2*$pixel,$shadingoffset,'blue',1)}; - push(@gr,$tempgr); - if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) - {push(@indices, $#gr);} - else {unshift(@indices, $#gr);} - } - -}}; +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[infiniteopeninterval] coordinates {(-6,0) ($a,0)}; +\end{axis} +END_TIKZ $alt = "Graph of an interval on a number line. There is a right parenthesis at $a and everything left of that is shaded. To the right of the axis, there is a letter $var."; ############################################## -$refreshCachedImages = 1; + BEGIN_PGML For the interval expressed in the number line, write it using set-builder notation and interval notation. ->> [@image( insertGraph($gr[ $indices[0] ]), width=>$screenXSize, tex_size=>$hardCopyPercent, - extra_html_tags=>'title="$alt" alt= "$alt" align="top"' ) @]* << +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << + +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** -[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** - In set-builder notation: [_____________________] +[_]{$setans}{30} - In interval notation: [_____________________] +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** +[_]{$intans}{30} END_PGML @@ -153,10 +100,6 @@ END_PGML ############################################## -ANS( $setans->cmp() ); - -ANS( $intans->cmp() ); - BEGIN_PGML_SOLUTION Since the given graph shades all the values less than [`[$a]`] (but not equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. @@ -168,3 +111,4 @@ The corresponding interval notation is [`[$intans]`]. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg index 9f71535cf3..50758c6a8b 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg @@ -33,6 +33,8 @@ loadMacros( "parserPopUp.pl", "contextInequalitySetBuilder.pl", "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -42,120 +44,61 @@ Context("Numeric"); $a = random(-4,4,0.5); -$symbol = '<'; +$symbol = '\leq'; InequalitySetBuilder::UseVerticalSuchThat(); Context("InequalitySetBuilder-Only"); -do {$var = RandomVariableName();} until ($var ne 'y' and $var ne 'p' and $var ne 'q' and $var ne 'g'); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); -$setans = Compute("{ $var | $var<= $a}"); +$setans = Compute("{ $var | $var <= $a}"); Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); $intans = Compute("(-inf,$a]"); Context("Numeric"); -%answer = (leftType => 'inf', - rightType => 'closed', #use 'inf' regardles of +/- inf - ); - - -$aspectRatio = 1/5; -$horPixel = 240; -$verPixel = $horPixel*$aspectRatio; -$screenXSize = $horPixel; -$screenYSize = $screenXSize*$aspectRatio; -$reach = 6; -$pixel = 2*$reach/240; -$verticalSpace = $reach*$aspectRatio; -$hardCopyPercent = 1000; #meaning 100% - - -#initializing... -@gr=(); - -#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. -@indices=(); - - -#make the graphs -for $leftType ('open','closed', 'inf') -{ - for $rightType ('open','closed', 'inf') - { - my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, - size=>[$horPixel,$verPixel] - ); - $tempgr->moveTo(0,0); - $tempgr->arrowTo($reach-2*$pixel,0,'black',1); - $tempgr->moveTo(0,0); - $tempgr->arrowTo(-$reach+2*$pixel,0,'black',1); - $tempgr->lb( new Label($reach-$pixel,-$verticalSpace/5,$var,'black','right','top','large')); - @ticks = (); - for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; - - $tempgr->h_ticks(0,"black",@ticks); - $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); - $tempgr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); - $tempgr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); - - $shadingoffset = $verticalSpace/2; - if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) - { - $tempgr->lb( new Label($a,$verticalSpace,$a,'blue','center','bottom','large')); - if ($leftType eq 'open' or $rightType eq 'open') - { - my $bracket = ($leftType eq 'open') ? '(' : ')'; - my $halign = ($leftType eq 'open') ? 'left' : 'right'; - $pixeloffset = ($leftType eq 'open') ? -2*$pixel : 4*$pixel; - $tempgr->lb( new Label($a+$pixeloffset,$shadingoffset,$bracket,'blue',$halign,'middle','giant')); - } - else - { - my $bracket = ($leftType eq 'closed') ? '[' : ']'; - my $halign = ($leftType eq 'closed') ? 'left' : 'right'; - $pixeloffset = ($leftType eq 'closed') ? -2*$pixel : 4*$pixel; - $tempgr->lb( new Label($a+$pixeloffset,$shadingoffset,$bracket,'blue',$halign,'middle','giant')); - }; - $tempgr->moveTo($a,$shadingoffset); - if ($leftType eq 'inf') {$tempgr->arrowTo(-$reach+2*$pixel,$shadingoffset,'blue',1)} - else {$tempgr->arrowTo($reach-2*$pixel,$shadingoffset,'blue',1)}; - push(@gr,$tempgr); - if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) - {push(@indices, $#gr);} - else {unshift(@indices, $#gr);} - } - -}}; +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[infiniteclosedinterval] coordinates {(-6,0) ($a,0)}; +\end{axis} +END_TIKZ $alt = "Graph of an interval on a number line. There is a right bracket at $a and everything left of that is shaded. To the right of the axis, there is a letter $var."; ############################################## -$refreshCachedImages = 1; + BEGIN_PGML For the interval expressed in the number line, write it using set-builder notation and interval notation. ->> [@image( insertGraph($gr[ $indices[0] ]), width=>$screenXSize, tex_size=>$hardCopyPercent, - extra_html_tags=>'title="$alt" alt= "$alt" align="top"' ) @]* << +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << -[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** - In set-builder notation: [_____________________] +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** - In interval notation: [_____________________] +[_]{$setans}{30} +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** +[_]{$intans}{30} END_PGML -############################################## - -ANS( $setans->cmp() ); -ANS( $intans->cmp() ); +############################################## BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg index 44bd4ebaaa..9cf187b10d 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg @@ -137,7 +137,7 @@ $pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); Context()->texStrings; diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph20.pg index e52006c6fe..381ea62bf4 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph20.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph20.pg @@ -137,7 +137,7 @@ $pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); Context()->texStrings; diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph30.pg index a7a0310b3d..b90149dd07 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph30.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph30.pg @@ -137,7 +137,7 @@ $pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); Context()->texStrings; diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg index a9a1bc613c..f195f5ee0a 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg @@ -137,7 +137,7 @@ $pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); Context()->texStrings; diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality10.pg index 93ade51ed4..4be7945a5a 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality10.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality10.pg @@ -52,7 +52,7 @@ InequalitySetBuilder::UseVerticalSuchThat(); Context("InequalitySetBuilder-Only"); $setans = Compute("{ x | x > $c}"); $alt = Compute("{ x | $c < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality100.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality100.pg index f1ed0b0146..dab5d865d5 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality100.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality100.pg @@ -50,7 +50,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x >= -$b}"); $alt = Compute("{ x | -$b <= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality110.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality110.pg index cec29914bc..9ce7cf92cc 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality110.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality110.pg @@ -57,7 +57,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x > $b}"); $alt = Compute("{ x | $b < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality120.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality120.pg index 87432e1aee..2438e2f972 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality120.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality120.pg @@ -57,7 +57,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x >= -$b}"); $alt = Compute("{ x | -$b <= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality130.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality130.pg index e20270e7b2..a282217f52 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality130.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality130.pg @@ -57,7 +57,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x > -$b}"); $alt = Compute("{ x | -$b < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality140.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality140.pg index d183dcc4b9..7d62fb0735 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality140.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality140.pg @@ -57,7 +57,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x < $b}"); $alt = Compute("{ x | $b > x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality150.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality150.pg index 01acdc13e5..977abbd903 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality150.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality150.pg @@ -52,7 +52,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x > -$c}"); $alt = Compute("{ x | -$c < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality160.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality160.pg index 1e797f0cf0..e81dfd249f 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality160.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality160.pg @@ -52,7 +52,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x < $c}"); $alt = Compute("{ x | $c > x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg index 6f9e685c7b..c018d9caf7 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg @@ -54,7 +54,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x > $v}"); $alt = Compute("{ x | $v < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality180.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality180.pg index d669318196..844f9893ed 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality180.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality180.pg @@ -54,7 +54,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x <= $v}"); $alt = Compute("{ x | $v >= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality190.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality190.pg index a173ac6655..bdd4c98da8 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality190.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality190.pg @@ -54,7 +54,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x <= -$v}"); $alt = Compute("{ x | -$v >= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality20.pg index dc7a810b5c..20a26f08ab 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality20.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality20.pg @@ -53,7 +53,7 @@ Context("InequalitySetBuilder-Only"); $setans = Compute("{ x | x <= $c}"); $alt = Compute("{ x | $c >= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality200.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality200.pg index 2e82238b78..f2a9df6bd8 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality200.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality200.pg @@ -54,7 +54,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x > $v}"); $alt = Compute("{ x | $v < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality210.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality210.pg index 4b0139c455..27314f618c 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality210.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality210.pg @@ -53,7 +53,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x >= 0}"); $alt = Compute("{ x | 0 <= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality220.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality220.pg index 71310f97ad..90e83ff65f 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality220.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality220.pg @@ -53,7 +53,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x > $v}"); $alt = Compute("{ x | $v < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality230.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality230.pg index 6ecb3bf863..09eaa89998 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality230.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality230.pg @@ -54,7 +54,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x >= $v}"); $alt = Compute("{ x | $v <= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality240.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality240.pg index db9a6dbde0..a334c36c1a 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality240.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality240.pg @@ -57,7 +57,7 @@ Context()->variables->are(t=>"Real"); $setans = Compute("{ t | t < $crit}"); $alt = Compute("{ t | $crit>= t}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality250.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality250.pg index 5383da1246..0453c62912 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality250.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality250.pg @@ -62,7 +62,7 @@ Context()->variables->are(z=>"Real"); $setans = Compute("{ z | z >= $crit}"); $alt = Compute("{ z | $crit <= z}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality260.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality260.pg index d6fd5a91bf..ad5fedf8e1 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality260.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality260.pg @@ -65,7 +65,7 @@ Context()->variables->are(a=>"Real"); $setans = Compute("{ a | a > $crit}"); $alt = Compute("{ a | $crit < a}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality270.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality270.pg index 7b66d7582a..7d77dec3fa 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality270.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality270.pg @@ -60,7 +60,7 @@ Context()->variables->are(p=>"Real"); $setans = Compute("{ p | p <= 0}"); $alt = Compute("{ p | 0 >= p}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality280.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality280.pg index 6d0519eb53..578ae84fe1 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality280.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality280.pg @@ -56,7 +56,7 @@ Context()->variables->add(p=>"Real"); $setans = Compute("{ p | p < $crit}"); $alt = Compute("{ p | $crit > p}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality290.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality290.pg index 23dbd7ad19..4b2fd1aa3a 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality290.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality290.pg @@ -55,7 +55,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x <= $crit }"); $alt = Compute("{ x | $crit >= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality30.pg index 7e00a14106..7222e34172 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality30.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality30.pg @@ -52,7 +52,7 @@ Context("InequalitySetBuilder-Only"); $setans = Compute("{ x | x >= $c}"); $alt = Compute("{ x | $c <= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality300.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality300.pg index fdd6a1f2b6..55e5e3df83 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality300.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality300.pg @@ -57,7 +57,7 @@ Context()->variables->are(z=>"Real"); $setans = Compute("{ z | z <= $crit}"); $alt = Compute("{ z | $crit >= z}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality310.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality310.pg index 867db53b94..ee368200f9 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality310.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality310.pg @@ -56,7 +56,7 @@ Context()->variables->are(y=>"Real"); $setans = Compute("{ y | y > $crit}"); $alt = Compute("{ y | $crit < y}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality320.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality320.pg index 944a7bd52d..8f5cadb719 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality320.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality320.pg @@ -58,7 +58,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x < $crit}"); $alt = Compute("{ x | $crit > x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality40.pg index 8975612e39..6533f5148d 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality40.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality40.pg @@ -52,7 +52,7 @@ Context("InequalitySetBuilder-Only"); $setans = Compute("{ x | x < $c}"); $alt = Compute("{ x | $c > x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality41.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality41.pg index d608614a03..04282acd13 100755 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality41.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality41.pg @@ -52,7 +52,7 @@ Context("InequalitySetBuilder-Only"); $setans = Compute("{ x | x < $c}"); $alt = Compute("{ x | $c > x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality50.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality50.pg index 2e8eea2a38..f3db36aed6 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality50.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality50.pg @@ -51,7 +51,7 @@ Context("InequalitySetBuilder-Only"); $setans = Compute("{ x | x <= $c}"); $alt = Compute("{ x | $c >= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality60.pg index 9715e6dc54..736da4b9d7 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality60.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality60.pg @@ -63,7 +63,7 @@ Context()->flags->set( $setans = Compute("{ x | x > $c}"); $alt = Compute("{ x | $c < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; $ansLatexString="\left\{ x \mid x > ".$c->TeX."\right\}"; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality70.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality70.pg index f924e2ad42..4fb074045f 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality70.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality70.pg @@ -52,7 +52,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x <= -$c}"); $alt = Compute("{ x | -$c >= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality80.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality80.pg index 7ee2f0384c..cf6aaff4cd 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality80.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality80.pg @@ -52,7 +52,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x >= -$c}"); $alt = Compute("{ x | -$c <= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality90.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality90.pg index fede26956d..c96be29090 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality90.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality90.pg @@ -50,7 +50,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x < -$b}"); $alt = Compute("{ x | -$b > x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg index 413b8b36dc..8543f428e0 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg @@ -57,7 +57,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x <= $crit}"); $alt = Compute("{ x | $crit >= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction20.pg index d65ea1b9c1..0d1762125d 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction20.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction20.pg @@ -70,7 +70,7 @@ Context()->flags->set( Context()->variables->are(y=>"Real"); $setans = Compute("{ y | y > -($critNum/$critDen)}"); $alt = Compute("{ y | -($critNum/$critDen) < y}"); -$ans = OneOf($setans, $alt); +$ans = $setans; $ansLatexString = "\left\{ y \mid y > ".$crit->TeX."\right\}"; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg index 50dfe1569b..7a824b171d 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg @@ -72,7 +72,7 @@ Context()->variables->are(t=>"Real"); $setans = Compute("{ t | t< $ans}"); $alt = Compute("{ t | $ans > t}"); -$options = OneOf($setans, $alt); +$options = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction40.pg index ebeeff63de..1f0271396a 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction40.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction40.pg @@ -59,7 +59,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x<= $ans}"); $alt = Compute("{ x | $ans >= x}"); -$options = OneOf($setans, $alt); +$options = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg index fa4caa3ea6..e4fe5a9c74 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg @@ -60,7 +60,7 @@ Context()->variables->are(z=>'Real'); $setans = Compute("{ z | z> $ans}"); $alt = Compute("{ z | $ans < z}"); -$options = OneOf($setans, $alt); +$options = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg index 24248eb3da..bcae192e46 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg @@ -57,7 +57,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x>= -$ans}"); $alt = Compute("{ x | -$ans <= x}"); -$options = OneOf($setans, $alt); +$options = $setans; Context("Interval"); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg index 2fc2202e66..32b249b9e2 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg @@ -60,7 +60,7 @@ Context()->variables->are(y=>'Real'); $setans = Compute("{ y | y<= $ans}"); $alt = Compute("{ y | $ans >= y}"); -$options = OneOf($setans, $alt); +$options = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction80.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction80.pg index 4ed5ccc6f9..55d2d9aece 100644 --- a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction80.pg +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction80.pg @@ -73,7 +73,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x> $ans}"); $alt = Compute("{ x | $ans < x}"); -$options = OneOf($setans, $alt); +$options = $setans; diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph10.pg new file mode 100644 index 0000000000..1ff8a1a60e --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph10.pg @@ -0,0 +1,204 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context('Numeric'); + +do { + $numerator = random(1,5,1); + $denominator = random(1,5,1); + $h = non_zero_random(-6,6,1); + do {$k = non_zero_random(-6,6,1);} until ($h != $k); + $m = $numerator/$denominator*$h*$k/abs($h*$k); + $k2 = ($k > 0) ? $k - $numerator : $k + $numerator; + $h2 = ($k2-$k)/$m+$h; +} until ($k2 != $h2); + +@k = num_sort($k,$k2); +@h = num_sort($h,$h2); +$f = Formula("$m*(x - $h)+$k")->reduce; + +@gr = ( ); +@xvalues = num_sort(-7,7,(7-$k)/$m+$h,(-7-$k)/$m+$h); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i]->lb('reset'); + for $j (-6..6){ + if ($j==0 or $j%2!=0) {next;} + $gr[$i]->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i]->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + $gr[$i]->moveTo($h,$k); + $gr[$i]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'blue',1); + $gr[$i]->moveTo($h,$k); + $gr[$i]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'blue',1); +} + +$alt[0] = "This is the graph of a straight line which passes the points ($h,$k) and ($h2,$k2)."; + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +$i0 = random(0,3,1); +if (random(0,1,1)==0) { + $i1 = 0; + $i2 = 1; +} else { + $i1 = 1; + $i2 = 0; +} +$symbol0 = $symbols[$i0]; +$symbol1 = $symbols[$i1]; +$symbol2 = $symbols[$i2]; + +@leftBrackets = ('(','['); +@rightBrackets = (')',']'); + +@ans = ( ); + +$gr[1]->moveTo($h,$k); +if ($m > 0) { + if ($i0 == 0) { + $ans[0] = Interval("(-inf,$h)"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is open."; + } elsif ($i0 == 1) { + $ans[0] = Interval("(-inf,$h]"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is closed."; + } elsif ($i0 == 2) { + $ans[0] = Interval("($h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is open."; + } else { + $ans[0] = Interval("[$h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is closed."; + } +} else { + if ($i0 == 0) { + $ans[0] = Interval("($h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is open."; + } elsif ($i0 == 1) { + $ans[0] = Interval("[$h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is closed."; + } elsif ($i0 == 2) { + $ans[0] = Interval("(-inf,$h)"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is open."; + } else { + $ans[0] = Interval("(-inf,$h]"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is closed."; + } +} + +$y0 = $f->eval(x=>$h[0]); +$y1 = $f->eval(x=>$h[1]); +$ans[1] = Interval("$leftBrackets[$i2] $h[0],$h[1] $rightBrackets[$i1]"); +$gr[2]->moveTo($h[0],$y0); +$gr[2]->lineTo($h[1],$y1,'red',1); +$alt[2] = $alt[0]." The segment from ($h[0],$y0) to ($h[1],$y1) is highlighted in red."; +if ($i1==1) { + $gr[2]->stamps( open_circle($h[0],$y0,'red') ); + $alt[2] .= " The point ($h[0],$y1) is open,"; +} else { + $gr[2]->stamps( closed_circle($h[0],$y0,'red') ); + $alt[2] .= " The point ($h[0],$y0) is closed,"; +} +if ($i2==1) { + $gr[2]->stamps( open_circle($h[1],$y1,'red') ); + $alt[2] .= " and the point ($h[1],$y1) is open."; +} else { + $gr[2]->stamps( closed_circle($h[1],$y1,'red') ); + $alt[2] .= " and the point ($h[1],$y1) is closed."; +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbols[$i0]] [$k]`] + + [__________]{$ans[0]} + +1. [`[$k[0]] [$symbols[$i1]] f(x) [$symbols[$i2]] [$k[1]]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + + + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbols[$i0]] [$k]`], the function's [`y`]-value must be [$words[$i0]] [`[$k]`]. The corresponding segment is highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`[$k[0]] [$symbols[$i1]] f(x) [$symbols[$i2]] [$k[1]]`], the function's [`y`]-value must be between [`[$k[0]]`] and [`[$k[1]]`]. The corresponding segment is highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph20.pg new file mode 100644 index 0000000000..e82945ef36 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph20.pg @@ -0,0 +1,230 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ + + +Context('Numeric'); +$h = random(-4,4,1); +$k = random(-4,4,1); +$x = ($h < 0) ? random(-6,$h-1,1) : random($h+1,6,1); +$y = ($k < 0) ? random($k+1,6,1) : random(-6,$k-1,1); +$c = ($y-$k)/($x - $h)**2; +$f = Formula("$c*(x-$h)^2+$k"); + +@gr = (); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i]->lb('reset'); + for $j (-6..6){ + if (Real($j)==0) {next;} + $gr[$i]->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i]->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + $yexit = ($c < 0) ? -7 : 7; + @xvalues = num_sort(-7,7,sqrt(($yexit-$k)/$c)+$h,-sqrt(($yexit-$k)/$c)+$h); + add_functions($gr[$i], "$f for x in <$xvalues[1],$xvalues[2]> using color:blue and weight:1"); + $px = 14/240; + + $gr[$i]->moveTo($xvalues[1]+$px,$c*($xvalues[1]+$px-$h)**2+$k); + $gr[$i]->arrowTo($xvalues[1],$c*($xvalues[1]-$h)**2+$k,'blue',1); + $gr[$i]->moveTo($xvalues[2]-$px,$c*($xvalues[2]-$px-$h)**2+$k); + $gr[$i]->arrowTo($xvalues[2],$c*($xvalues[2]-$h)**2+$k,'blue',1); +} + +@x = num_sort($x,2*$h-$x); + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +@in = (); +if (random(0,1,1)==0) { + $in[0] = random(0,1,1); + $in[1] = random(2,3,1); +} else { + $in[0] = random(2,3,1); + $in[1] = random(0,1,1); +} +$symbol0 = $symbols[$in[0]]; +$symbol1 = $symbols[$in[1]]; + +@alt = ( ); +$uod = $c > 0 ? 'upward' : 'downward'; +$alt[0] = "This is the graph of a parabola with its vertex at ($h,$k). The parabola faces $uod. It passes the points ($x[0],$y) and ($x[1],$y)."; + +@s0 = ( + " Those two points are open.", + " Those two points are closed." +); + +@s1 = ( + " On the parabola, the segment between x=$x[0] to x=$x[1] are highlighted.", + " On the parabola, the segment from negative infinity to x=$x[0], and the segment from x=$x[1] to infinity are highlighted.", +); + +@s2 = ( + Interval("($x[0],$x[1])"), + Interval("[$x[0],$x[1]]"), + Union("(-inf,$x[0])U($x[1],inf)"), + Union("(-inf,$x[0]]U[$x[1],inf)"), +); + +sub graphOpenDots { + my $p = shift; + $gr[$p]->stamps( open_circle($x[0],$y,'red') ); + $gr[$p]->stamps( open_circle($x[1],$y,'red') ); +} + +sub graphClosedDots { + my $p = shift; + $gr[$p]->stamps( closed_circle($x[0],$y,'red') ); + $gr[$p]->stamps( closed_circle($x[1],$y,'red') ); +} + +sub highlightBetween { + my $p = shift; + add_functions($gr[$p], "$f for x in <$x[0],$x[1]> using color:red and weight:1"); +} + +sub highlightEnds { + my $p = shift; + add_functions($gr[$p], "$f for x in <$xvalues[1],$x[0]> using color:red and weight:1"); + add_functions($gr[$p], "$f for x in <$x[1],$xvalues[2]> using color:red and weight:1"); + $px = 14/240; + $gr[$p]->moveTo($xvalues[1]+$px,$c*($xvalues[1]+$px-$h)**2+$k); + $gr[$p]->arrowTo($xvalues[1],$c*($xvalues[1]-$h)**2+$k,'red',1); + $gr[$p]->moveTo($xvalues[2]-$px,$c*($xvalues[2]-$px-$h)**2+$k); + $gr[$p]->arrowTo($xvalues[2],$c*($xvalues[2]-$h)**2+$k,'red',1); +} + +$alt[1] .= $alt[0]; +$alt[2] .= $alt[0]; +@ans = (); +for my $i (0..1) { + if ($in[$i]==0) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } else { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } + &graphOpenDots($i+1); + } elsif ($in[$i]==1) { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } else { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } + &graphClosedDots($i+1); + } elsif ($in[$i]==2) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } else { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } + &graphOpenDots($i+1); + } else { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } else { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } + &graphClosedDots($i+1); + } +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbol0] [$y]`] + + [__________]{$ans[0]} + +1. [`f(x) [$symbol1] [$y]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbol0] [$y]`], the function's [`y`]-value must be [$words[$in[0]]] [`[$y]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`f(x) [$symbol1] [$y]`], the function's [`y`]-value must be [$words[$in[1]]] [`[$y]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph30.pg new file mode 100644 index 0000000000..6dfa2465bc --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph30.pg @@ -0,0 +1,241 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context('Numeric'); + +$s = Real(random(-3,3,1)); +$r = $s - random(1,3,1); +$t = $s + random(2,3,1); + +$f = Formula("(x-$r)(x-$s)(x-$t)"); +@hts = map{abs($f->eval(x=>$_))}($r..$t); +$amplitude = random(1,3,1); +$c = $amplitude/max(@hts)*random(-1,1,2); +$k = random(1,6-$amplitude,1)*random(-1,1,2); +$f = $c*$f+$k; + +@gr = (); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i] ->lb('reset'); + for $j (-6..6){ + if (Real($j)==0) {next;} + $gr[$i] ->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i] ->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + + $start = $r; + while (abs($f->eval(x=>$start-0.1))<7 and $start > -7) {$start = $start - 0.1}; + $stop = $t; + while (abs($f->eval(x=>$stop+0.1))<7 and $stop < 7) {$stop = $stop + 0.1}; + + add_functions($gr[$i] , "$f for x in <$start,$stop> using color:blue and weight:1"); + $px = 14/240; + $gr[$i] ->moveTo($start+$px,$f->eval(x=>$start+$px)); + $gr[$i] ->arrowTo($start,$f->eval(x=>$start),'blue',1); + $gr[$i] ->moveTo($stop-$px,$f->eval(x=>$stop-$px)); + $gr[$i] ->arrowTo($stop,$f->eval(x=>$stop),'blue',1); +} + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +@in = (); +if (random(0,1,1)==0) { + $in[0] = random(0,1,1); + $in[1] = random(2,3,1); +} else { + $in[0] = random(2,3,1); + $in[1] = random(0,1,1); +} +$symbol0 = $symbols[$in[0]]; +$symbol1 = $symbols[$in[1]]; + +@alt = ( ); +$startL = $c > 0 ? 'negative infinity' : 'positive infinity'; +$endR = $c > 0 ? 'positive infinity' : 'negative infinity'; +$uod0 = $c > 0 ? 'up' : 'down'; +$uod1 = $c > 0 ? 'down' : 'up'; +$alt[0] = "This is the graph of a cubic function which starts at $startL as x-value approaches negative infinity, going $uod0 through the point ($r,$k), curving $uod1 to pass ($s,$k), curving $uod0 to pass ($t,$k), and finally approaching $endR as x-value approaches positive infinity."; + +@s0 = ( + " Those three points are open.", + " Those three points are closed." +); + +@s1 = ( + " On the function, the segment between infinity and x=$r, and the segment from to x=$s to x=$t are highlighted.", + " On the function, the segment from x=$r and x=$s, and the segment from x=$t to infinity are highlighted.", +); + +@s2 = ( + Union("(-inf,$r)U($s,$t)"), + Union("(-inf,$r]U[$s,$t]"), + Union("($r,$s)U($t,inf)"), + Union("[$r,$s]U[$t,inf)"), +); + +sub graphOpenDots { + my $p = shift; + $gr[$p]->stamps( open_circle($r,$k,'red') ); + $gr[$p]->stamps( open_circle($s,$k,'red') ); + $gr[$p]->stamps( open_circle($t,$k,'red') ); +} + +sub graphClosedDots { + my $p = shift; + $gr[$p]->stamps( closed_circle($r,$k,'red') ); + $gr[$p]->stamps( closed_circle($s,$k,'red') ); + $gr[$p]->stamps( closed_circle($t,$k,'red') ); +} + +sub highlightLeft { + my $p = shift; + add_functions($gr[$p] , "$f for x in <$start,$r> using color:red and weight:1"); + add_functions($gr[$p] , "$f for x in <$s,$t> using color:red and weight:1"); + $px = 14/240; + $gr[$p] ->moveTo($start+$px,$f->eval(x=>$start+$px)); + $gr[$p] ->arrowTo($start,$f->eval(x=>$start),'red',1); +} + +sub highlightRight { + my $p = shift; + add_functions($gr[$p] , "$f for x in <$r,$s> using color:red and weight:1"); + add_functions($gr[$p] , "$f for x in <$t,$stop> using color:red and weight:1"); + $px = 14/240; + $gr[$p] ->moveTo($stop-$px,$f->eval(x=>$stop-$px)); + $gr[$p] ->arrowTo($stop,$f->eval(x=>$stop),'red',1); +} + +$alt[1] .= $alt[0]; +$alt[2] .= $alt[0]; +@ans = (); +for my $i (0..1) { + if ($in[$i]==0) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } else { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } + &graphOpenDots($i+1); + } elsif ($in[$i]==1) { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } else { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } + &graphClosedDots($i+1); + } elsif ($in[$i]==2) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } else { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } + &graphOpenDots($i+1); + } else { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } else { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } + &graphClosedDots($i+1); + } +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbol0] [$k]`] + + [__________]{$ans[0]} + +1. [`f(x) [$symbol1] [$k]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbol0] [$k]`], the function's [`y`]-value must be [$words[$in[0]]] [`[$k]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`f(x) [$symbol1] [$k]`], the function's [`y`]-value must be [$words[$in[1]]] [`[$k]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd10.pg new file mode 100644 index 0000000000..4e98f8db20 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd10.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 4 < 2x <= 10 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,5,1); +$a=$b*random(1,4,1); +$c=$b*random($a+1,$a+5,1); +$left = Compute("$a"); +$comp0 = "\lt"; +$middle = Compute("$b*x"); +$comp1 = "\leq"; +$right = Compute("$c"); + +$leftEnd = $a/$b; +$rightEnd = $c/$b; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \lt [$b]x \leq [$c] \\ + \frac{[$a]}{[$b]} & \lt \frac{[$b]x}{[$b]} \leq \frac{[$c]}{[$b]} \\ + [$leftEnd] & \lt x \leq [$rightEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd100.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd100.pg new file mode 100644 index 0000000000..03beb63b42 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd100.pg @@ -0,0 +1,202 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: -2x-1<=7 and 3x+3<30. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +#$reach is the maximum value shown on the graph. +$reach = 7; + +$a = random(-$reach+2,-$reach+10,1); +$c0 = random(-5,-2,1); +$c1 = non_zero_random(-5,5,1); +$c2 = $c0*$a+$c1; + +# $symbol0 is the inequality symbol in the solution. +# $symbol0Original is the symbol in the inequality. +$left0 = Compute("$c0*x+$c1")->reduce; +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$right0 = Compute("$c2"); +$symbol0Original = ($symbol0 eq '>') ? '<' : '\leq'; + +$b = random($a+1,$reach-2,1); +$d0 = random(2,5,1); +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +$left1 = Compute("$d0*x+$d1")->reduce; +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$right1 = Compute("$d2"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("$leftEnd $a,$b $rightEnd"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->lineTo($b,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of an interval on a number line. The segment from $a to $b is shaded. The endpoint $a is $leftEndType, and the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0Original] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + [$c0]x+[$c1] &[$symbol0Original] [$c2] & [$d0]x+[$d1] &[$symbol1] [$d2] \\ + [$c0]x+[$c1] \mathbf{{}-[$c1]} &[$symbol0Original] [$c2] \mathbf{{}-[$c1]} & [$d0]x+[$d1]\mathbf{{}-[$d1]} &[$symbol1] [$d2] \mathbf{{}-[$d1]}\\ + [$c0]x &[$symbol0Original] [$c2-$c1] & [$d0]x &[$symbol1] [$d2-$d1] \\ + \frac{[$c0]x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & \frac{[$d0]x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + x &[$symbol0] [$a] & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that, in the first inequality, the direction of inequality symbol changed from [`[$symbol0Original]`] to [`[$symbol0]`] once we divided a negative number on both sides. + +Notice that the keyword *"and"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ and } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the left endpoint is [$leftEndType]; the right endpoint is [$rightEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd110.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd110.pg new file mode 100644 index 0000000000..773a0c4035 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd110.pg @@ -0,0 +1,246 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: -2x<=4 and -3x-4<1. +# +# Last edited by Carl Yao 07/27/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 7; + +# $direction decides whether the problem is x>1 and x>2 +# or x<1 and x<2 +$direction = (random(-1,1,2)==1) ? 'left' : 'right'; + +# $symbol0 is the inequality symbol in the solution. +# $symbol0Original is the symbol in the inequality. + +$a = random(-$reach+2,-$reach+7,1); +$c0 = random(-5,-2,1); +$c1 = non_zero_random(-5,5,1); +$c2 = $c0*$a+$c1; + +$b = random($a+1,$reach-2,1); +do {$d0 = random(-5,-2,1);} until ($d0!=$c0); +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +if ($direction eq 'left') { + $symbol0 = random(-1,1,2)>0 ? "<" : "\leq"; + $symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; + $aEndType = ($symbol0 eq '<') ? "open" : "closed"; + $bEndType = ($symbol1 eq '<') ? "open" : "closed"; + $symbol0Original = ($symbol0 eq '<') ? '>' : '\geq'; + $symbol1Original = ($symbol1 eq '<') ? '>' : '\geq'; +} else { + $symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; + $symbol1 = random(-1,1,2)>0 ? ">" : "\geq"; + $aEndType = ($symbol0 eq '>') ? "open" : "closed"; + $bEndType = ($symbol1 eq '>') ? "open" : "closed"; + $symbol0Original = ($symbol0 eq '>') ? '<' : '\leq'; + $symbol1Original = ($symbol1 eq '>') ? '<' : '\leq'; +} + + +$left0 = Compute("$c0*x+$c1")->reduce; +$right0 = Compute("$c2"); + +$left1 = Compute("$d0*x+$d1")->reduce; +$right1 = Compute("$d2"); + + +#These are needed to show inequality symbols in dynamic images. +if ($direction eq 'left') { + $symbol0Show = $symbol0 eq '<' ? '<' : '<='; + $symbol1Show = $symbol1 eq '<' ? '<' : '<='; +} else { + $symbol0Show = $symbol0 eq '>' ? '>' : '>='; + $symbol1Show = $symbol1 eq '>' ? '>' : '>='; +} + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +if ($direction eq 'left') { + $endpoint = ($symbol0 eq '<') ? ')' : ']'; + $numberLineEndType = ($symbol0 eq '<') ? 'open' : 'closed'; + $ans = Compute("(-inf, $a $endpoint"); +} else { + $endpoint = ($symbol1 eq '>') ? '(' : '['; + $numberLineEndType = ($symbol1 eq '>') ? 'open' : 'closed'; + $ans = Compute("$endpoint $b, inf)"); +} + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); + + +if ($direction eq 'left') { + if ($symbol0 eq '<') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + $gr->stamps( open_circle($a,0,'blue') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + $gr->stamps( closed_circle($a,0,'blue') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); + + if ($symbol1 eq '<') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); + + $gr->moveTo($a,0); + $gr->arrowTo(-0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $a to negative infinity is shaded. The endpoint $a is $aEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward negative infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $bEndType."; + +} else { + + if ($symbol1 eq '>') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + $gr->stamps( open_circle($b,0,'blue') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + $gr->stamps( closed_circle($b,0,'blue') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); + + if ($symbol0 eq '>') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); + + $gr->moveTo($b,0); + $gr->arrowTo(0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $b to positive infinity is shaded. The endpoint $b is $bEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward positive infinity, while the endpoint $b is $bEndType."; +} + + + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0Original] [$right0] \text{ and } [$left1] [$symbol1Original] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + [$c0]x+[$c1] &[$symbol0Original] [$c2] & [$d0]x+[$d1] &[$symbol1Original] [$d2] \\ + [$c0]x+[$c1] \mathbf{{}-[$c1]} &[$symbol0Original] [$c2] \mathbf{{}-[$c1]} & [$d0]x+[$d1]\mathbf{{}-[$d1]} &[$symbol1Original] [$d2] \mathbf{{}-[$d1]}\\ + [$c0]x &[$symbol0Original] [$c2-$c1] & [$d0] x &[$symbol1Original] [$d2-$d1] \\ + \frac{[$c0]x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & \frac{[$d0] x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + x &[$symbol0] [$a] & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that, in both inequalities, the direction of inequality symbol changed once we divided a negative number on both sides. + +Notice that the keyword *"and"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ and } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the right endpoint is [$numberLineEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd20.pg new file mode 100644 index 0000000000..d6c03f43de --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd20.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 >= 2x > 4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,5,1); +$c=$b*random(1,4,1); +$a=$b*random($c+1,$c+5,1); +$left = Compute("$a"); +$comp0 = "\geq"; +$middle = Compute("$b*x"); +$comp1 = "\gt"; +$right = Compute("$c"); + +$leftEnd = $c/$b; +$rightEnd = $a/$b; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \geq [$b]x \gt [$c] \\ + \frac{[$a]}{[$b]} & \geq \frac{[$b]x}{[$b]} \gt \frac{[$c]}{[$b]} \\ + [$rightEnd] & \geq x \gt [$leftEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd30.pg new file mode 100644 index 0000000000..17f2be20fa --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd30.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 > -x > -4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +do {$c=random(-5,-1,1);} until (abs($c)!=abs($a)); +$b=-1; +$left = Compute("$a"); +$comp0 = "\gt"; +$middle = Compute("-x"); +$comp1 = "\gt"; +$right = Compute("$c"); + +$leftEnd = -$a; +$rightEnd = -$c; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x < $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \gt -x \gt [$c] \\ + (-1)\cdot [$a] & \lt (-1)\cdot (-x) \lt (-1)\cdot ([$c]) \\ + [$leftEnd] & \lt x \lt [$rightEnd] \\ +\end{aligned} + ``] + +Note that the direction of an inequality symbol changes when we multiply a negative number on both sides. + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd40.pg new file mode 100644 index 0000000000..19202d421b --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd40.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 5 <= 1-2x <= 11 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +do { + $c=random(2,5,1); + + $dMinusB = -$c*random(2,5,1); + $b = non_zero_random(-5,5,1); + $d = $b+$dMinusB; + + $aMinusB = -$c*random(2,10,1); + $a = $b+$aMinusB; +} until ($a<$d); + +$left = Compute("$a"); +$comp0 = "\leq"; +$middle = Compute("$b-$c*x"); +$comp1 = "\leq"; +$right = Compute("$d"); + +$leftEnd = ($d-$b)/(-$c); +$rightEnd = ($a-$b)/(-$c); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd <= x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \leq [$b]-[$c]x \leq [$d] \\ + [$a]\mathbf{{}-[$b]} & \leq [$b]-[$c]x \mathbf{{}-[$b]} \leq [$d] \mathbf{{}-[$b]}\\ + [$aMinusB] & \leq -[$c]x \leq [$dMinusB]\\ + \frac{[$aMinusB]}{-[$c]} & \geq \frac{-[$c]x}{-[$c]} \geq \frac{[$dMinusB]}{-[$c]} \\ + [$rightEnd] & \geq x \geq [$leftEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd50.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd50.pg new file mode 100644 index 0000000000..2fcf26ba91 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd50.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like -3 > 1-(2-2x) >= -11 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +do { + $d=random(2,5,1); + $bMinusC=random(2,5,1); + $c = random(1,5,1); + $b = $c+$bMinusC; + + $right1 = $d*random(-5,-1,1); + $e = $right1+$b-$c; + + $left1 = $d*random(-5,-1,1); + $a = $left1+$b-$c; +} until (($e<0) && ($a>$e)); + +$left = Compute("$a"); +$comp0 = "\gt"; +$middle = Compute("$b-($c-$d*x)"); +$comp1 = "\geq"; +$right = Compute("$e"); + +$leftEnd = ($e-$bMinusC)/($d); +$rightEnd = ($a-$bMinusC)/($d); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd <= x < $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$leftEnd,$rightEnd)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \gt [$b]-([$c]-[$d]x) \geq [$e] \\ + [$a] & \gt [$b]-[$c]+[$d]x \geq [$e] \\ + [$a] & \gt [$b-$c]+[$d]x \geq [$e] \\ + [$a]\mathbf{{}-[$b-$c]}& \gt [$b-$c]+[$d]x \mathbf{{}-[$b-$c]} \geq [$e] \mathbf{{}-[$b-$c]}\\ + [$left1] & \gt [$d]x \geq [$right1] \\ + \frac{[$left1]}{[$d]} & \gt \frac{[$d]x}{[$d]} \geq \frac{[$right1]}{[$d]} \\ + [$rightEnd] & \gt x \geq [$leftEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd60.pg new file mode 100644 index 0000000000..31a0eea1f0 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd60.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 >= (2/3)x > 4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + $b=random(2,5,1); + $c=random(2,8,1); +} until (gcd($b,$c)==1); + +$a=$b*random(1,5,1); +$d=$b*random($a+1,$a+5,1); + +$left = Compute("$a"); +$comp0 = "\lt"; + +$comp1 = "\lt"; +$right = Compute("$d"); + +$leftEnd = $a*$c/$b; +$rightEnd = $d*$c/$b; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x < $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the compound inequality algebraically. + +[@KeyboardInstructions('For the [`\infty`] symbol, type [|INF|]*. For the union symbol [`\cup`], type [|U|]*. For [`\leq`], type [|<=|]*. For [`\geq`], type [|>=|]*. For the such that symbol in set-builder notation, [| | |]* is usually above the [|Enter|]* key')@]** + + [`` [$left] [$comp0] \frac{[$b]}{[$c]}x [$comp1] [$right] ``] + + In set-builder notation, the solution set is [______________]{$setans}. + + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \lt \frac{[$b]}{[$c]}x \lt [$d] \\ + \mathbf{[$c]\cdot{}} [$a] & \lt \mathbf{[$c]\cdot{}}\frac{[$b]}{[$c]}x \lt \mathbf{[$c]\cdot{}}[$d] \\ + [$a*$c] & \lt [$b]x \lt [$d*$c] \\ + \frac{[$a*$c]}{[$b]} & \lt \frac{[$b]x}{[$b]} \lt \frac{[$d*$c]}{[$b]} \\ + [$leftEnd] & \lt x \lt [$rightEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd70.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd70.pg new file mode 100644 index 0000000000..ecc2447759 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd70.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 > 1-(2/3)x >= 4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + $c=random(2,5,1); + $d=random(2,8,1); +} until (gcd($c,$d)==1); +$b=non_zero_random(-5,5,1); + +do { + $aMinusB=(-$c)*random(2,5,1)*random(-1,1,2); + $eMinusB=(-$c)*random(2,5,1)*random(-1,1,2); +} until ($eMinusB<$aMinusB); +$a = $b+$aMinusB; +$e = $b+$eMinusB; + +$left = Compute("$a"); +$comp0 = "\gt"; + +$comp1 = "\geq"; +$right = Compute("$e"); + +$leftEnd = ($a-$b)*$d/(-$c); +$rightEnd = ($e-$b)*$d/(-$c); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the compound inequality algebraically. + + [`` [$left] [$comp0] [$b]-\frac{[$c]}{[$d]}x [$comp1] [$right] ``] + +[@KeyboardInstructions('For the [`\infty`] symbol, type [|INF|]*. For the union symbol [`\cup`], type [|U|]*. For [`\leq`], type [|<=|]*. For [`\geq`], type [|>=|]*. For the such that symbol in set-builder notation, [| | |]* is usually above the [|Enter|]* key')@]** + + In set-builder notation, the solution set is [______________]{$setans}. + + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \gt [$b]-\frac{[$c]}{[$d]}x \geq [$e] \\ + \mathbf{[$d]\cdot{}}[$a] & \gt \mathbf{[$d]\cdot{}}([$b])-\mathbf{[$d]\cdot{}}\frac{[$c]}{[$d]}x \geq \mathbf{[$d]\cdot{}}[$e] \\ + [$a*$d] & \gt [$b*$d]-[$c]x \geq [$e*$d] \\ + [$a*$d] \mathbf{{}-[$b*$d]} & \gt [$b*$d]-[$c]x\mathbf{{}-[$b*$d]} \geq [$e*$d] \mathbf{{}-[$b*$d]}\\ + [$a*$d-$b*$d] & \gt -[$c]x \geq [$e*$d-$b*$d] \\ + \frac{[$a*$d-$b*$d]}{-[$c]} & \lt \frac{-[$c]x}{-[$c]} \leq \frac{[$e*$d-$b*$d]}{-[$c]} \\ + [$leftEnd] & \lt x \leq [$rightEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd80.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd80.pg new file mode 100644 index 0000000000..d325e9ad25 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd80.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 >= (1+2x)/3 > 4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { +$c=random(2,5,1); +$right1 = $c*random(-3,3,1); +$left1 = $right1+$c*random(2,5,1); + +$b=random(1,5,1); +$d=random(2,5,1); +$a=($left1+$b)/$d; +$e=($right1+$b)/$d; +} until ( ($a==int($a)) && ($e==int($e)) ); + +$left = Compute("$a"); +$comp0 = "\geq"; + +$comp1 = "\gt"; +$right = Compute("$e"); + +$rightEnd = ($a*$d-$b)/$c; +$leftEnd = ($e*$d-$b)/$c; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] \frac{[$b]+[$c]x}{[$d]} [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \geq \frac{[$b]+[$c]x}{[$d]} \gt [$e] \\ + \mathbf{[$d]\cdot{}}[$a] & \geq \mathbf{[$d]\cdot{}}\frac{[$b]+[$c]x}{[$d]} \gt \mathbf{[$d]\cdot{}}[$e] \\ + [$a*$d] & \geq [$b]+[$c]x \gt [$e*$d] \\ + [$a*$d] \mathbf{{}-[$b]}& \geq [$b]+[$c]x \mathbf{{}-[$b]} \gt [$e*$d]\mathbf{{}-[$b]} \\ + [$left1] & \geq [$c]x \gt [$e*$d-$b] \\ + \frac{[$left1]}{[$c]} & \geq \frac{[$c]x}{[$c]} \gt \frac{[$e*$d-$b]}{[$c]} \\ + [$rightEnd] & \geq x \gt [$leftEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd85.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd85.pg new file mode 100644 index 0000000000..31a7de27a4 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd85.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Solve compound linear inequality ("and" type) application problem. +# The equation looks like 10 >= (1+2x)/3 > 4 +# +# Last updated: Yao, 06/28/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(30,50,5); +$b = random(450,600,10); +$ans1 = random(2030,2050,5); +$ans2 = random(2055,2085,5); + +$func = Compute("$a*(x-2000)+$b"); +$small = $func->eval(x=>$ans1); +$big = $func->eval(x=>$ans2); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A city's homeless population since the year 2000 can be modeled by this function: + + [`` f(x)=[$func] ``] + +where [`x`] represents the number of year passed since 2000, and [`f(x)`] represents the number of homeless people. Estimate the years when this city's homeless population will be between [`[$small]`] and [`[$big]`] people. Use an inequality to solve this problem. + +*Solution*: This city's homeless population will be between [`[$small]`] and [`[$big]`] people between the year [__________]{$ans1} (smaller value) and the year [__________]{$ans2} (bigger value). + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +It's given that the function [`[f(x)]`] represents this city's homeless population. To make this value between [`[$small]`] and [`[$big]`] people, we write the compound inequality [`[$small] \le [$func] \le [$big]`], and then solve it: + + [`` +\begin{aligned} + [$small] &\le [$func] \le [$big] \\ + [$small] \mathbf{-[$b]} &\le [$func] \mathbf{-[$b]} \le [$big] \mathbf{-[$b]} \\ + [$small-$b] & \le [$a](x-2000) \le [$big-$b] \\ + \frac{[$small-$b]}{[$a]} & \le \frac{[$a](x-2000)}{[$a]} \le \frac{[$big-$b]}{[$a]} \\ + [$ans1-2000] & \le x-2000 \le [$ans2-2000] \\ + [$ans1-2000] \mathbf{+2000} & \le x-2000 \mathbf{+2000} \le [$ans2-2000] \mathbf{+2000} \\ + [$ans1] &\le x \le [$ans2] +\end{aligned} + ``] + +*Solution*: This city's homeless population will be between [`[$small]`] and [`[$big]`] people between the year [`[$ans1]`] and the year [`[$ans2]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd86.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd86.pg new file mode 100644 index 0000000000..c51b8fe1a7 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd86.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Solve compound linear inequality ("and" type) application problem. +# The equation looks like 10 >= (1+2x)/3 > 4 +# +# Last updated: Yao, 06/28/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(2,6,1); +$b = random(2,6,1); +$ans1 = random(2,5,1); +$ans2 = random(6,10,1); + +$small = (2*$a+2)*$ans1-2*$b; +$big = (2*$a+2)*$ans2-2*$b; + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A rectangle's length is [`[$b]`] yards less than [`[$a]`] times of its width. If the rectangle's perimeter must be between [`[$small]`] and [`[$big]`] yards, what is the range of its width? Use an inequality to solve this problem. + +*Solution*: The rectangle's width must be between [__________]{$ans1} yards (smaller value) and [__________]{$ans2} yards (bigger value). + +END_PGML + +############################################## + +$t1 = 2*$a+2; +$t2 = $b*2; + +BEGIN_PGML_SOLUTION + +Assume the rectangle's width is [`w`] yards, then its length is [`[$a]w-[$b]`] yards, and its perimeter is: + + [`` 2([$a]w-[$b])+2w = [$t1]w-[$t2] ``] yards. + +Since the rectangle's perimeter is limited to [`[$small]`] and [`[$big]`] yards, we can write an inequality and then solve it: + + [`` +\begin{aligned} + [$small] &\le [$t1]w-[$t2] \le [$big] \\ + [$small] \mathbf{+[$t2]} &\le [$t1]w-[$t2] \mathbf{+[$t2]} \le [$big] \mathbf{+[$t2]} \\ + [$small+$t2] & \le [$t1]w \le [$big+$t2] \\ + \frac{[$small+2*$b]}{[$t1]} & \le \frac{[$t1]w}{[$t1]} \le \frac{[$big+2*$b]}{[$t1]} \\ + [$ans1] &\le w \le [$ans2] +\end{aligned} + ``] + +*Solution*: The rectangle's width must be between [`[$ans1]`] yards (smaller value) and [`[$ans2]`] yards (bigger value). + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd90.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd90.pg new file mode 100644 index 0000000000..f778906335 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd90.pg @@ -0,0 +1,195 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: 2x-1>=7 and 3x+3<30. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$a = random(-$reach+2,-$reach+10,1); +$c0 = random(2,5,1); +$c1 = non_zero_random(-5,5,1); +$c2 = $c0*$a+$c1; + +$left0 = Compute("$c0*x+$c1")->reduce; +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$right0 = Compute("$c2"); + +$b = random($a+1,$reach-2,1); +$d0 = random(2,5,1); +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +$left1 = Compute("$d0*x+$d1")->reduce; +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$right1 = Compute("$d2"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("$leftEnd $a,$b $rightEnd"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->lineTo($b,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of an interval on a number line. The segment from $a to $b is shaded. The endpoint $a is $leftEndType, and the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + [$c0]x+[$c1] &[$symbol0] [$c2] & [$d0]x+[$d1] &[$symbol1] [$d2] \\ + [$c0]x+[$c1] \mathbf{{}-[$c1]} &[$symbol0] [$c2] \mathbf{{}-[$c1]} & [$d0]x+[$d1]\mathbf{{}-[$d1]} &[$symbol1] [$d2] \mathbf{{}-[$d1]}\\ + [$c0]x &[$symbol0] [$c2-$c1] & [$d0]x &[$symbol1] [$d2-$d1] \\ + \frac{[$c0]x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & \frac{[$d0]x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + x &[$symbol0] [$a] & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that the keyword *"and"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ and } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the left endpoint is [$leftEndType]; the right endpoint is [$rightEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics10.pg new file mode 100644 index 0000000000..538e5c2f0e --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics10.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>=4 and x<9. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$left0 = Compute("x"); +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$a = random(-$reach+3,2,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$b = random($a+1,$reach-3,1); +$right1 = Compute("$b"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("$leftEnd $a,$b $rightEnd"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->lineTo($b,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of an interval on a number line. The segment from $a to $b is shaded. The endpoint $a is $leftEndType, and the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the left endpoint is [$leftEndType]; the right endpoint is [$rightEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics20.pg new file mode 100644 index 0000000000..3239e5511c --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics20.pg @@ -0,0 +1,212 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>=4 and x>1. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +# $direction decides whether the problem is x>1 and x>2 +# or x<1 and x<2 +$direction = (random(-1,1,2)==1) ? 'left' : 'right'; + +$left0 = Compute("x"); +if ($direction eq 'left') { + $symbol0 = random(-1,1,2)>0 ? "<" : "\leq"; + $symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; + $aEndType = ($symbol0 eq '<') ? "open" : "closed"; + $bEndType = ($symbol1 eq '<') ? "open" : "closed"; +} else { + $symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; + $symbol1 = random(-1,1,2)>0 ? ">" : "\geq"; + $aEndType = ($symbol0 eq '>') ? "open" : "closed"; + $bEndType = ($symbol1 eq '>') ? "open" : "closed"; +} +$a = random(-$reach+3,2,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$b = random($a+1,$reach-3,1); +$right1 = Compute("$b"); + + + +#These are needed to show inequality symbols in dynamic images. +if ($direction eq 'left') { + $symbol0Show = $symbol0 eq '<' ? '<' : '<='; + $symbol1Show = $symbol1 eq '<' ? '<' : '<='; +} else { + $symbol0Show = $symbol0 eq '>' ? '>' : '>='; + $symbol1Show = $symbol1 eq '>' ? '>' : '>='; +} + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +if ($direction eq 'left') { + $endpoint = ($symbol0 eq '<') ? ')' : ']'; + $numberLineEndType = ($symbol0 eq '<') ? 'open' : 'closed'; + $ans = Compute("(-inf, $a $endpoint"); +} else { + $endpoint = ($symbol1 eq '>') ? '(' : '['; + $numberLineEndType = ($symbol1 eq '>') ? 'open' : 'closed'; + $ans = Compute("$endpoint $b, inf)"); +} + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); + + +if ($direction eq 'left') { + if ($symbol0 eq '<') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + $gr->stamps( open_circle($a,0,'blue') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + $gr->stamps( closed_circle($a,0,'blue') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); + + if ($symbol1 eq '<') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); + + $gr->moveTo($a,0); + $gr->arrowTo(-0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $a to negative infinity is shaded. The endpoint $a is $aEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward negative infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $bEndType."; + +} else { + + if ($symbol1 eq '>') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + $gr->stamps( open_circle($b,0,'blue') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + $gr->stamps( closed_circle($b,0,'blue') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); + + if ($symbol0 eq '>') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); + + $gr->moveTo($b,0); + $gr->arrowTo(0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $b to positive infinity is shaded. The endpoint $b is $bEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward positive infinity, while the endpoint $b is $bEndType."; +} + + + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the right endpoint is [$numberLineEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics30.pg new file mode 100644 index 0000000000..c27fe967dd --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics30.pg @@ -0,0 +1,172 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>3 and x<1. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$left0 = Compute("x"); +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$a = random($reach-5,$reach-1,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$b = random(-$reach+1,$a-1,1); +$right1 = Compute("$b"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("DNE"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { +# $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { +# $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { +# $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { +# $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +#$gr->moveTo($a,0); +#$gr->lineTo($b,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. Nothing on the number line is shaded. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. + +Notice that no number can meet the conditions of both inequalities, so the solution is an empty set, or DNE (Does Not Exist). + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics40.pg new file mode 100644 index 0000000000..6635a03798 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics40.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>=4 or x<9. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$left0 = Compute("x"); +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$a = random(-$reach+3,2,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$b = random($a+1,$reach-3,1); +$right1 = Compute("$b"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("(-inf,inf)"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { +# $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { +# $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { +# $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { +# $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo(0,0); +$gr->arrowTo(0.99*$reach,0,'blue',3); +$gr->moveTo(0,0); +$gr->arrowTo(-0.99*$reach,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. The whole number line is shaded. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in either solution set will be in the final solution. In other words, we are look for the union of both sets. In this case, the final solution covers the whole number line, so the solution is [`(-\infty,\infty)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics50.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics50.pg new file mode 100644 index 0000000000..1d608af1e9 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics50.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>=4 or x<1. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$left0 = Compute("x"); +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$a = random($reach-10,$reach-1,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$b = random(-$reach+1,$a-1,1); +$right1 = Compute("$b"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("(-inf,$b $rightEnd U $leftEnd $a, inf)"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->arrowTo(0.99*$reach,0,'blue',3); +$gr->moveTo($b,0); +$gr->arrowTo(-0.99*$reach,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. Two segments are shaded. The first segment starts at $a, and goes toward positive infinity, while the endpoint $a is $leftEndType. The second segment starts at $b, and goes toward negative infinity, while the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in either solution set will be in the final solution. In other words, we are look for the union of both given sets. The solution is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics60.pg new file mode 100644 index 0000000000..ef84012d08 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics60.pg @@ -0,0 +1,212 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>=4 or x>1. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +# $direction decides whether the problem is x>1 or x>2 +# or x<1 or x<2 +$direction = (random(-1,1,2)==1) ? 'left' : 'right'; + +$left0 = Compute("x"); +if ($direction eq 'left') { + $symbol0 = random(-1,1,2)>0 ? "<" : "\leq"; + $symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; + $aEndType = ($symbol0 eq '<') ? "open" : "closed"; + $bEndType = ($symbol1 eq '<') ? "open" : "closed"; +} else { + $symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; + $symbol1 = random(-1,1,2)>0 ? ">" : "\geq"; + $aEndType = ($symbol0 eq '>') ? "open" : "closed"; + $bEndType = ($symbol1 eq '>') ? "open" : "closed"; +} +$a = random(-$reach+3,2,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$b = random($a+1,$reach-3,1); +$right1 = Compute("$b"); + + + +#These are needed to show inequality symbols in dynamic images. +if ($direction eq 'left') { + $symbol0Show = $symbol0 eq '<' ? '<' : '<='; + $symbol1Show = $symbol1 eq '<' ? '<' : '<='; +} else { + $symbol0Show = $symbol0 eq '>' ? '>' : '>='; + $symbol1Show = $symbol1 eq '>' ? '>' : '>='; +} + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +if ($direction eq 'left') { + $endpoint = ($symbol1 eq '<') ? ')' : ']'; + $numberLineEndType = ($symbol1 eq '<') ? 'open' : 'closed'; + $ans = Compute("(-inf, $b $endpoint"); +} else { + $endpoint = ($symbol0 eq '>') ? '(' : '['; + $numberLineEndType = ($symbol0 eq '>') ? 'open' : 'closed'; + $ans = Compute("$endpoint $a, inf)"); +} + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); + + +if ($direction eq 'left') { + if ($symbol1 eq '<') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + $gr->stamps( open_circle($b,0,'blue') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + $gr->stamps( closed_circle($b,0,'blue') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); + + if ($symbol0 eq '<') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); + + $gr->moveTo($b,0); + $gr->arrowTo(-0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $b to negative infinity is shaded. The endpoint $b is $bEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward negative infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $bEndType."; + +} else { + + if ($symbol0 eq '>') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + $gr->stamps( open_circle($a,0,'blue') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + $gr->stamps( closed_circle($a,0,'blue') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); + + if ($symbol1 eq '>') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); + + $gr->moveTo($a,0); + $gr->arrowTo(0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $a to positive infinity is shaded. The endpoint $a is $aEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward positive infinity, while the endpoint $b is $bEndType."; +} + + + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in the solution set need to meet the conditions of either inequality. In other words, we are look for the union of both given sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the right endpoint is [$numberLineEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr10.pg new file mode 100644 index 0000000000..5ba55514aa --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr10.pg @@ -0,0 +1,206 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: 2x+2>=8 or -x+3>-2. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +#$reach is the maximum value shown on the graph. +$reach = 7; + +$a = random($reach-10,$reach-1,1); +$c0 = random(2,5,1); +$c1 = non_zero_random(-5,5,1); +$c2 = $c0*$a+$c1; + +$left0 = Compute("$c0*x+$c1")->reduce; +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$right0 = Compute("$c2"); + +# $symbol1 is the inequality symbol in the solution. +# $symbol1Original is the symbol in the inequality. + +$b = random(-$reach+1,$a-1,1); +$d0 = -1; +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +$left1 = Compute("$d0*x+$d1")->reduce; +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$right1 = Compute("$d2"); +$symbol1Original = ($symbol1 eq '<') ? '>' : '\geq'; + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("(-inf,$b $rightEnd U $leftEnd $a, inf)"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->arrowTo(0.99*$reach,0,'blue',3); +$gr->moveTo($b,0); +$gr->arrowTo(-0.99*$reach,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. Two segments are shaded. The first segment starts at $a, and goes toward positive infinity, while the endpoint $a is $leftEndType. The second segment starts at $b, and goes toward negative infinity, while the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +Please type: + +* *inf* for [`\infty`], +* [|DNE|]* for "no solution" +* *U* for the union symbol [`\cup`] + + [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1Original] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + [$c0]x+[$c1] &[$symbol0] [$c2] & -x+[$d1] &[$symbol1Original] [$d2] \\ + [$c0]x+[$c1] \mathbf{{}-[$c1]} &[$symbol0] [$c2] \mathbf{{}-[$c1]} & -x+[$d1]\mathbf{{}-[$d1]} &[$symbol1Original] [$d2] \mathbf{{}-[$d1]}\\ + [$c0]x &[$symbol0] [$c2-$c1] & [$d0]\cdot x &[$symbol1Original] [$d2-$d1] \\ + \frac{[$c0]x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & \frac{[$d0] \cdot x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + x &[$symbol0] [$a] & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that, in the second inequality, the direction of inequality symbol changed from [`[$symbol1Original]`] to [`[$symbol1]`] once we divided a negative number on both sides. + +Notice that the keyword *"or"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ or } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in either solution set will be in the final solution. In other words, we are look for the union of both sets. The solution is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr20.pg new file mode 100644 index 0000000000..1318ad7ad3 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr20.pg @@ -0,0 +1,210 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: -2x+2<=-4 or -x+3>-2. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +#$reach is the maximum value shown on the graph. +$reach = 7; + +# $symbol0 is the inequality symbol in the solution. +# $symbol0Original is the symbol in the inequality. + +$a = random($reach-10,$reach-1,1); +$c0 = random(-5,-2,1); +$c1 = non_zero_random(-5,5,1); +$c2 = $c0*$a+$c1; + +$left0 = Compute("$c0*x+$c1")->reduce; +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$right0 = Compute("$c2"); +$symbol0Original = ($symbol0 eq '>') ? '<' : '\leq'; + +# $symbol1 is the inequality symbol in the solution. +# $symbol1Original is the symbol in the inequality. + +$b = random(-$reach+1,$a-1,1); +$d0 = -1; +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +$left1 = Compute("$d0*x+$d1")->reduce; +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$right1 = Compute("$d2"); +$symbol1Original = ($symbol1 eq '<') ? '>' : '\geq'; + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("(-inf,$b $rightEnd U $leftEnd $a, inf)"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->arrowTo(0.99*$reach,0,'blue',3); +$gr->moveTo($b,0); +$gr->arrowTo(-0.99*$reach,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. Two segments are shaded. The first segment starts at $a, and goes toward positive infinity, while the endpoint $a is $leftEndType. The second segment starts at $b, and goes toward negative infinity, while the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +Please type: + +* *inf* for [`\infty`], +* [|DNE|]* for "no solution" +* *U* for the union symbol [`\cup`] + + [`` [$left0] [$symbol0Original] [$right0] \text{ or } [$left1] [$symbol1Original] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + [$c0]x+[$c1] &[$symbol0Original] [$c2] & -x+[$d1] &[$symbol1Original] [$d2] \\ + [$c0]x+[$c1] \mathbf{{}-[$c1]} &[$symbol0Original] [$c2] \mathbf{{}-[$c1]} & -x+[$d1]\mathbf{{}-[$d1]} &[$symbol1Original] [$d2] \mathbf{{}-[$d1]}\\ + [$c0]x &[$symbol0Original] [$c2-$c1] & [$d0]\cdot x &[$symbol1Original] [$d2-$d1] \\ + \frac{[$c0]x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & \frac{[$d0] \cdot x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + x &[$symbol0] [$a] & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that, in both inequalities, the direction of inequality symbol changed once we divided a negative number on both sides. + +Notice that the keyword *"or"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ or } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in either solution set will be in the final solution. In other words, we are look for the union of both sets. The solution is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr30.pg new file mode 100644 index 0000000000..b9c219fa19 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr30.pg @@ -0,0 +1,250 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: -x+3<=4 or -2x<10. +# +# Last edited by Carl Yao 07/27/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 7; + +# $direction decides whether the problem is x>1 or x>2 +# or x<1 or x<2 +$direction = (random(-1,1,2)==1) ? 'left' : 'right'; + +# $symbol0 is the inequality symbol in the solution. +# $symbol0Original is the symbol in the inequality. + +$a = random(-$reach+2,-$reach+7,1); +$c0 = -1; +$c1 = 0; +$c2 = $c0*$a+$c1; + +$b = random($a+1,$reach-2,1); +do {$d0 = random(-5,-2,1);} until ($d0!=$c0); +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +$left0 = Compute("x"); +if ($direction eq 'left') { + $symbol0 = random(-1,1,2)>0 ? "<" : "\leq"; + $symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; + $aEndType = ($symbol0 eq '<') ? "open" : "closed"; + $bEndType = ($symbol1 eq '<') ? "open" : "closed"; + $symbol0Original = ($symbol0 eq '<') ? '>' : '\geq'; + $symbol1Original = ($symbol1 eq '<') ? '>' : '\geq'; +} else { + $symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; + $symbol1 = random(-1,1,2)>0 ? ">" : "\geq"; + $aEndType = ($symbol0 eq '>') ? "open" : "closed"; + $bEndType = ($symbol1 eq '>') ? "open" : "closed"; + $symbol0Original = ($symbol0 eq '>') ? '<' : '\leq'; + $symbol1Original = ($symbol1 eq '>') ? '<' : '\leq'; +} + +$left0 = Compute("$c0*x+$c1")->reduce; +$right0 = Compute("$c2"); + +$left1 = Compute("$d0*x+$d1")->reduce; +$right1 = Compute("$d2"); + + + +#These are needed to show inequality symbols in dynamic images. +if ($direction eq 'left') { + $symbol0Show = $symbol0 eq '<' ? '<' : '<='; + $symbol1Show = $symbol1 eq '<' ? '<' : '<='; +} else { + $symbol0Show = $symbol0 eq '>' ? '>' : '>='; + $symbol1Show = $symbol1 eq '>' ? '>' : '>='; +} + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +if ($direction eq 'left') { + $endpoint = ($symbol1 eq '<') ? ')' : ']'; + $numberLineEndType = ($symbol1 eq '<') ? 'open' : 'closed'; + $ans = Compute("(-inf, $b $endpoint"); +} else { + $endpoint = ($symbol0 eq '>') ? '(' : '['; + $numberLineEndType = ($symbol0 eq '>') ? 'open' : 'closed'; + $ans = Compute("$endpoint $a, inf)"); +} + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); + + +if ($direction eq 'left') { + if ($symbol1 eq '<') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + $gr->stamps( open_circle($b,0,'blue') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + $gr->stamps( closed_circle($b,0,'blue') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); + + if ($symbol0 eq '<') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); + + $gr->moveTo($b,0); + $gr->arrowTo(-0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $b to negative infinity is shaded. The endpoint $b is $bEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward negative infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $bEndType."; + +} else { + + if ($symbol0 eq '>') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + $gr->stamps( open_circle($a,0,'blue') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + $gr->stamps( closed_circle($a,0,'blue') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); + + if ($symbol1 eq '>') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); + + $gr->moveTo($a,0); + $gr->arrowTo(0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $a to positive infinity is shaded. The endpoint $a is $aEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward positive infinity, while the endpoint $b is $bEndType."; +} + + + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +Please type: + +* *inf* for [`\infty`], +* [|DNE|]* for "no solution" +* *U* for the union symbol [`\cup`] + + [`` [$left0] [$symbol0Original] [$right0] \text{ or } [$left1] [$symbol1Original] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + -x &[$symbol0Original] [$c2] & [$d0]x+[$d1] &[$symbol1Original] [$d2] \\ + [$c0] \cdot x &[$symbol0Original] [$c2] & [$d0]x+[$d1]\mathbf{{}-[$d1]} &[$symbol1Original] [$d2] \mathbf{{}-[$d1]}\\ + \frac{[$c0] \cdot x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & [$d0] x &[$symbol1Original] [$d2-$d1] \\ + x &[$symbol0] [$a] & \frac{[$d0] x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + & & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that, in both inequalities, the direction of inequality symbol changed once we divided a negative number on both sides. + +Notice that the keyword *"or"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ or } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in the solution set need to meet the conditions of either inequality. In other words, we are look for the union of both given sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the right endpoint is [$numberLineEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation50.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation50.pg new file mode 100644 index 0000000000..158abf304a --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation50.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,2,1); +$b = random($a+1,4,1); +$leftType = random(0,1,1)==0 ? ')' : ']'; +$rightType = random(0,1,1)==0 ? '(' : '['; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$a $leftType U $rightType $b,inf)"); + +Context("Numeric"); + +$aspectRatio = 1/5; +$horPixel = 240; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 6; +$pixel = 2*$reach/240; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); + +#make the graphs +$gr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, + size=>[$horPixel,$verPixel]); +$gr->moveTo(0,0); +$gr->arrowTo($reach-2*$pixel,0,'black',1); +$gr->moveTo(0,0); +$gr->arrowTo(-$reach+2*$pixel,0,'black',1); + +@ticks = (); +for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); +$gr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); +$gr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); + +$shadingoffset = $verticalSpace/1.2; +$gr->lb( new Label($a,$shadingoffset,$leftType,'blue','center','middle','giant')); +$gr->moveTo($a,$shadingoffset); +$gr->arrowTo(-$reach+2*$pixel,$shadingoffset,'blue',1); + +$gr->lb( new Label($b,$shadingoffset,$rightType,'blue','center','middle','giant')); +$gr->moveTo($b,$shadingoffset); +$gr->arrowTo($reach-2*$pixel,$shadingoffset,'blue',1); + + +$alt = "This is graph of an interval on a number line. There is a $leftType at $a and everything to the left of $a is shaded; there is a $rightType at $b and everything to the right of $b is shaded."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it in interval notation. + +>> [@image( insertGraph($gr), width=>$screenXSize, tex_size=>$hardCopyPercent, + extra_html_tags=>"title='$alt' alt= '$alt' align='top'" ) @]* << + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], [|>=|]* for [`\geq`], capitalized U for the union symbol.!)@]** + + In interval notation: [_____________________]{$intans} + + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation60.pg new file mode 100644 index 0000000000..4a1eba1143 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation60.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,2,1); +$b = random($a+1,4,1); +$leftType = random(0,1,1)==0 ? '(' : '['; +$rightType = random(0,1,1)==0 ? ')' : ']'; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("$leftType $a,$b $rightType"); + +Context("Numeric"); + +$aspectRatio = 1/5; +$horPixel = 240; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 6; +$pixel = 2*$reach/240; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); + +#make the graphs +$gr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, + size=>[$horPixel,$verPixel]); +$gr->moveTo(0,0); +$gr->arrowTo($reach-2*$pixel,0,'black',1); +$gr->moveTo(0,0); +$gr->arrowTo(-$reach+2*$pixel,0,'black',1); + +@ticks = (); +for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); +$gr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); +$gr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); + +$shadingoffset = $verticalSpace/1.2; +$gr->lb( new Label($a,$shadingoffset,$leftType,'blue','center','middle','giant')); +$gr->moveTo($a,$shadingoffset); +$gr->lineTo($b,$shadingoffset,'blue',1); +$gr->lb( new Label($b,$shadingoffset,$rightType,'blue','center','middle','giant')); + +$alt = "This is graph of an interval on a number line. There is a $leftType at $a and a $rightType at $b. The segment in between is shaded."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it in interval notation. + +>> [@image( insertGraph($gr), width=>$screenXSize, tex_size=>$hardCopyPercent, + extra_html_tags=>"title='$alt' alt= '$alt' align='top'" ) @]* << + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], [|>=|]* for [`\geq`], capitalized U for the union symbol.!)@]** + + In interval notation: [_____________________]{$intans} + + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation10.pg new file mode 100644 index 0000000000..8c6f2d9514 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation10.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Give a graph of an inequality, write the set notation and interval notation. +# Answer is like (3, inf). +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,4,0.5); + +$symbol = '>'; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var $symbol $a}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($a,inf)"); +Context("Numeric"); + +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[openinfiniteinterval] coordinates {($a,0) (6,0)}; +\end{axis} +END_TIKZ + + +$alt = "Graph of an interval on a number line. There is a left parenthesis at $a and everything right of that is shaded. To the right of the axis, there is a letter $var."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it using set-builder notation and interval notation. + +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << + +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** + +[_]{$setans}{30} + +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** + +[_]{$intans}{30} + + +END_PGML + + + +############################################## + + +BEGIN_PGML_SOLUTION + +Since the given graph shades all the values greater than [`[$a]`] (but not equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. + +The corresponding set notation is [`[$setans]`]. + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation20.pg new file mode 100644 index 0000000000..eef96ac55e --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation20.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Give a graph of an inequality, write the set notation and interval notation. +# Answer is like [3, inf). +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,4,0.5); + +$symbol = '\ge'; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var >= $a}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$a,inf)"); +Context("Numeric"); + +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[closedinfiniteinterval] coordinates {($a,0) (6,0)}; +\end{axis} +END_TIKZ + + +$alt = "Graph of an interval on a number line. There is a left bracket at $a and everything right of that is shaded. To the right of the axis, there is a letter $var."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it using set-builder notation and interval notation. + +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << + +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** + +[_]{$setans}{30} + +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** + +[_]{$intans}{30} + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +Since the given graph shades all the values greater than [`[$a]`] (and equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. + +The corresponding set notation is [`[$setans]`]. + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation30.pg new file mode 100644 index 0000000000..11039f4549 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation30.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Give a graph of an inequality, write the set notation and interval notation. +# Answer is like (-inf,3). +# +# Last edited by Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,4,0.5); + +$symbol = '<'; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var $symbol $a}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$a)"); +Context("Numeric"); + +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[infiniteopeninterval] coordinates {(-6,0) ($a,0)}; +\end{axis} +END_TIKZ + +$alt = "Graph of an interval on a number line. There is a right parenthesis at $a and everything left of that is shaded. To the right of the axis, there is a letter $var."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it using set-builder notation and interval notation. + +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << + +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** + +[_]{$setans}{30} + +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** + +[_]{$intans}{30} + + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +Since the given graph shades all the values less than [`[$a]`] (but not equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. + +The corresponding set notation is [`[$setans]`]. + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation40.pg new file mode 100644 index 0000000000..50758c6a8b --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation40.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Give a graph of an inequality, write the set notation and interval notation. +# Answer is like (-inf,3]. +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,4,0.5); + +$symbol = '\leq'; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var <= $a}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$a]"); +Context("Numeric"); + +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[infiniteclosedinterval] coordinates {(-6,0) ($a,0)}; +\end{axis} +END_TIKZ + +$alt = "Graph of an interval on a number line. There is a right bracket at $a and everything left of that is shaded. To the right of the axis, there is a letter $var."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it using set-builder notation and interval notation. + +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << + +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** + +[_]{$setans}{30} + +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** + +[_]{$intans}{30} + +END_PGML + + + + +############################################## + +BEGIN_PGML_SOLUTION + +Since the given graph shades all the values less than [`[$a]`] (and equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. + +The corresponding set notation is [`[$setans]`]. + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot10.pg new file mode 100644 index 0000000000..db10e77b45 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot10.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Tell whether a number x is a solution of an inequality ax+b>c. +# a, b, c are positive or negative integers. +# +# Last updated: Jordan 8/28/13; Carl Yao, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear') +## DBCCSS('7.EE.4','A-REI.3','6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unionTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +$symbol = '>'; + +$a=random(2,5,1)*random(-1,1,2); +$cMinusB = random(1,5,1)*$a; +$c=random(-10,10,1); +$b=$c-$cMinusB; + +$critical = ($c-$b)/$a; + +$popupYes = PopUp( + ['?',"is","is not"], + 1, +); + +$popupNo = PopUp( + ['?',"is","is not"], + 2, +); + + + +do {$x1=random($critical-10,$critical-1,1);} until ($x1!=0); +if ($a*$x1+$b>$c) { +$popup1 = $popupYes; +} +else { +$popup1 = $popupNo; +} + +$x2=$critical; +$popup2 = $popupNo; + +$x3=0; +if ($a*$x3+$b>$c) { +$popup3 = $popupYes; +} +else { +$popup3 = $popupNo; +} + + +do {$x4=random($critical+1,$critical+10,1);} until ($x4!=0); +if ($a*$x4+$b>$c) { +$popup4 = $popupYes; +} +else { +$popup4 = $popupNo; +} + + +if ($popup1 == $popupYes) {$trueFalse1 = 'true'; $isIsNot1 = 'is';} + else {$trueFalse1 = 'not true'; $isIsNot1 = 'is not';}; +if ($popup2 == $popupYes) {$trueFalse2 = 'true'; $isIsNot2 = 'is';} + else {$trueFalse2 = 'not true'; $isIsNot2 = 'is not';}; +if ($popup3 == $popupYes) {$trueFalse3 = 'true'; $isIsNot3 = 'is';} + else {$trueFalse3 = 'not true'; $isIsNot3 = 'is not';} +if ($popup4 == $popupYes) {$trueFalse4 = 'true'; $isIsNot4 = 'is';} + else {$trueFalse4 = 'not true'; $isIsNot4 = 'is not';}; + +#randomize the answers +$ref_ans = [ + [ $x1, $popup1, $trueFalse1, $isIsNot1], + [ $x2, $popup2, $trueFalse2, $isIsNot2], + [ $x3, $popup3, $trueFalse3, $isIsNot3], + [ $x4, $popup4, $trueFalse4, $isIsNot4], +]; + +for ($i=0;$i<=2;$i++) { + $j=random(0,3,1); + do {$k=random(0,3,1);} until ($j!=$k); + $temp=$ref_ans->[$j]; + $ref_ans->[$j]=$ref_ans->[$k]; + $ref_ans->[$k]=$temp; +} + +($x0,$x1,$x2,$x3) = ($ref_ans->[0][0],$ref_ans->[1][0],$ref_ans->[2][0],$ref_ans->[3][0]); +($popup0,$popup1,$popup2,$popup3) = ($ref_ans->[0][1],$ref_ans->[1][1],$ref_ans->[2][1],$ref_ans->[3][1]); +($trueFalse0,$trueFalse1,$trueFalse2,$trueFalse3) = ($ref_ans->[0][2],$ref_ans->[1][2],$ref_ans->[2][2],$ref_ans->[3][2]); +($isIsNot0,$isIsNot1,$isIsNot2,$isIsNot3) = ($ref_ans->[0][3],$ref_ans->[1][3],$ref_ans->[2][3],$ref_ans->[3][3]); + + + +############################################## + +TEXT(beginproblem()); + + +BEGIN_PGML + +Decide whether each value is a solution to the given inequality. + +[`` [$a] x +[$b] [$symbol] [$c] ``] +a. [`x=[$x0]`] [__]{$popup0} a solution. + +b. [`x=[$x1]`] [__]{$popup1} a solution. + +c. [`x=[$x2]`] [__]{$popup2} a solution. + +d. [`x=[$x3]`] [__]{$popup3} a solution. + + + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +We substitute each [`x`] value into the inequality [` [$a] x + [$b] [$symbol] [$c]`] and see whether the inequality is true. + +a. [` \begin{aligned}[t] + [$a] ([$x0]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x0+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse0], [$x0] [$isIsNot0] a solution to the inequality. +---- +b. [` \begin{aligned}[t] + [$a] ([$x1]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x1+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse1], [$x1] [$isIsNot1] a solution to the inequality. +---- +c. [` \begin{aligned}[t] + [$a] ([$x2]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x2+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse2], [$x2] [$isIsNot2] a solution to the inequality. +---- +d. [` \begin{aligned}[t] + [$a] ([$x3]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x3+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse3], [$x3] [$isIsNot3] a solution to the inequality. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot20.pg new file mode 100644 index 0000000000..fae79dcba9 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot20.pg @@ -0,0 +1,178 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Tell whether a number x is a solution of an inequality ax+b>=c. +# a, b, c are positive or negative integers. +# +# Last updated: Jordan 8/29/13; Carl Yao, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear') +## DBCCSS('7.EE.4','A-REI.3',,'6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unionTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +$symbol = '\ge'; + +$a=random(2,5,1)*random(-1,1,2); +$cMinusB = random(1,5,1)*$a; +$c=random(-10,10,1); +$b=$c-$cMinusB; + +$critical = ($c-$b)/$a; + +$popupYes = PopUp( + ['?',"is","is not"], + 1, +); + +$popupNo = PopUp( + ['?',"is","is not"], + 2, +); + + + +do {$x1=random($critical-10,$critical-1,1);} until ($x1!=0); +if ($a*$x1+$b>=$c) { +$popup1 = $popupYes; +} +else { +$popup1 = $popupNo; +} + +$x2=$critical; +if ($a*$x2+$b>=$c) { +$popup2 = $popupYes; +} +else { +$popup2 = $popupNo; +} + + +$x3=0; +if ($a*$x3+$b>=$c) { +$popup3 = $popupYes; +} +else { +$popup3 = $popupNo; +} + + +do {$x4=random($critical+1,$critical+10,1);} until ($x4!=0); +if ($a*$x4+$b>=$c) { +$popup4 = $popupYes; +} +else { +$popup4 = $popupNo; +} + + +if ($popup1 == $popupYes) {$trueFalse1 = 'true'; $isIsNot1 = 'is';} + else {$trueFalse1 = 'not true'; $isIsNot1 = 'is not';}; +if ($popup2 == $popupYes) {$trueFalse2 = 'true'; $isIsNot2 = 'is';} + else {$trueFalse2 = 'not true'; $isIsNot2 = 'is not';}; +if ($popup3 == $popupYes) {$trueFalse3 = 'true'; $isIsNot3 = 'is';} + else {$trueFalse3 = 'not true'; $isIsNot3 = 'is not';} +if ($popup4 == $popupYes) {$trueFalse4 = 'true'; $isIsNot4 = 'is';} + else {$trueFalse4 = 'not true'; $isIsNot4 = 'is not';}; + +#randomize the answers +$ref_ans = [ + [ $x1, $popup1, $trueFalse1, $isIsNot1], + [ $x2, $popup2, $trueFalse2, $isIsNot2], + [ $x3, $popup3, $trueFalse3, $isIsNot3], + [ $x4, $popup4, $trueFalse4, $isIsNot4], +]; + +for ($i=0;$i<=2;$i++) { + $j=random(0,3,1); + do {$k=random(0,3,1);} until ($j!=$k); + $temp=$ref_ans->[$j]; + $ref_ans->[$j]=$ref_ans->[$k]; + $ref_ans->[$k]=$temp; +} + +($x0,$x1,$x2,$x3) = ($ref_ans->[0][0],$ref_ans->[1][0],$ref_ans->[2][0],$ref_ans->[3][0]); +($popup0,$popup1,$popup2,$popup3) = ($ref_ans->[0][1],$ref_ans->[1][1],$ref_ans->[2][1],$ref_ans->[3][1]); +($trueFalse0,$trueFalse1,$trueFalse2,$trueFalse3) = ($ref_ans->[0][2],$ref_ans->[1][2],$ref_ans->[2][2],$ref_ans->[3][2]); +($isIsNot0,$isIsNot1,$isIsNot2,$isIsNot3) = ($ref_ans->[0][3],$ref_ans->[1][3],$ref_ans->[2][3],$ref_ans->[3][3]); + + +############################################## + +TEXT(beginproblem()); + + +BEGIN_PGML + +Decide whether each value is a solution to the given inequality. + +[`` [$a] x +[$b] [$symbol] [$c] ``] +a. [`x=[$x0]`] [__]{$popup0} a solution. + +b. [`x=[$x1]`] [__]{$popup1} a solution. + +c. [`x=[$x2]`] [__]{$popup2} a solution. + +d. [`x=[$x3]`] [__]{$popup3} a solution. + + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We substitute each [`x`] value into the inequality [` [$a] x + [$b] [$symbol] [$c]`] and see whether the inequality is true. + +a. [` \begin{aligned}[t] + [$a] ([$x0]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x0+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse0], [$x0] [$isIsNot0] a solution to the inequality. +---- +b. [` \begin{aligned}[t] + [$a] ([$x1]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x1+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse1], [$x1] [$isIsNot1] a solution to the inequality. +---- +c. [` \begin{aligned}[t] + [$a] ([$x2]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x2+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse2], [$x2] [$isIsNot2] a solution to the inequality. +---- +d. [` \begin{aligned}[t] + [$a] ([$x3]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x3+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse3], [$x3] [$isIsNot3] a solution to the inequality. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot30.pg new file mode 100644 index 0000000000..78d6413919 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot30.pg @@ -0,0 +1,180 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Tell whether a number x is a solution of an inequality c<=b+ax. +# a, b, c are positive or negative integers. +# +# Last updated: Jordan 8/29/13; Carl Yao, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear') +## DBCCSS('7.EE.4','A-REI.3',,'6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unionTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +$symbol = '\le'; + +$a=random(2,5,1)*random(-1,1,2); +$cMinusB = random(1,5,1)*$a; +$c=random(-10,10,1); +$b=$c-$cMinusB; + +$critical = ($c-$b)/$a; + + +$popupYes = PopUp( + ['?',"is","is not"], + 1, +); + +$popupNo = PopUp( + ['?',"is","is not"], + 2, +); + + +do {$x1=random($critical-10,$critical-1,1);} until ($x1!=0); +if ($a*$x1+$b<=$c) { +$popup1 = $popupYes; +} +else { +$popup1 = $popupNo; +} + +$x2=$critical; +if ($a*$x2+$b<=$c) { +$popup2 = $popupYes; +} +else { +$popup2 = $popupNo; +} + + +$x3=0; +if ($a*$x3+$b<=$c) { +$popup3 = $popupYes; +} +else { +$popup3 = $popupNo; +} + + +do {$x4=random($critical+1,$critical+10,1);} until ($x4!=0); +if ($a*$x4+$b<=$c) { +$popup4 = $popupYes; +} +else { +$popup4 = $popupNo; +} + + +if ($popup1 == $popupYes) {$trueFalse1 = 'true'; $isIsNot1 = 'is';} + else {$trueFalse1 = 'not true'; $isIsNot1 = 'is not';}; +if ($popup2 == $popupYes) {$trueFalse2 = 'true'; $isIsNot2 = 'is';} + else {$trueFalse2 = 'not true'; $isIsNot2 = 'is not';}; +if ($popup3 == $popupYes) {$trueFalse3 = 'true'; $isIsNot3 = 'is';} + else {$trueFalse3 = 'not true'; $isIsNot3 = 'is not';} +if ($popup4 == $popupYes) {$trueFalse4 = 'true'; $isIsNot4 = 'is';} + else {$trueFalse4 = 'not true'; $isIsNot4 = 'is not';}; + +#randomize the answers +$ref_ans = [ + [ $x1, $popup1, $trueFalse1, $isIsNot1], + [ $x2, $popup2, $trueFalse2, $isIsNot2], + [ $x3, $popup3, $trueFalse3, $isIsNot3], + [ $x4, $popup4, $trueFalse4, $isIsNot4], +]; + +for ($i=0;$i<=2;$i++) { + $j=random(0,3,1); + do {$k=random(0,3,1);} until ($j!=$k); + $temp=$ref_ans->[$j]; + $ref_ans->[$j]=$ref_ans->[$k]; + $ref_ans->[$k]=$temp; +} + +($x0,$x1,$x2,$x3) = ($ref_ans->[0][0],$ref_ans->[1][0],$ref_ans->[2][0],$ref_ans->[3][0]); +($popup0,$popup1,$popup2,$popup3) = ($ref_ans->[0][1],$ref_ans->[1][1],$ref_ans->[2][1],$ref_ans->[3][1]); +($trueFalse0,$trueFalse1,$trueFalse2,$trueFalse3) = ($ref_ans->[0][2],$ref_ans->[1][2],$ref_ans->[2][2],$ref_ans->[3][2]); +($isIsNot0,$isIsNot1,$isIsNot2,$isIsNot3) = ($ref_ans->[0][3],$ref_ans->[1][3],$ref_ans->[2][3],$ref_ans->[3][3]); + + +############################################## + +TEXT(beginproblem()); + + +BEGIN_PGML + +Decide whether each value is a solution to the given inequality. + +[`` [$a] x +[$b] [$symbol] [$c] ``] +a. [`x=[$x0]`] [__]{$popup0} a solution. + +b. [`x=[$x1]`] [__]{$popup1} a solution. + +c. [`x=[$x2]`] [__]{$popup2} a solution. + +d. [`x=[$x3]`] [__]{$popup3} a solution. + + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +We substitute each [`x`] value into the inequality [` [$a] x + [$b] [$symbol] [$c]`] and see whether the inequality is true. + +a. [` \begin{aligned}[t] + [$a] ([$x0]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x0+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse0], [$x0] [$isIsNot0] a solution to the inequality. +---- +b. [` \begin{aligned}[t] + [$a] ([$x1]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x1+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse1], [$x1] [$isIsNot1] a solution to the inequality. +---- +c. [` \begin{aligned}[t] + [$a] ([$x2]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x2+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse2], [$x2] [$isIsNot2] a solution to the inequality. +---- +d. [` \begin{aligned}[t] + [$a] ([$x3]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x3+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse3], [$x3] [$isIsNot3] a solution to the inequality. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem10.pg new file mode 100644 index 0000000000..c632237ceb --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem10.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear inequality to solve word problems. +# +# Last updated: Jordan 7/27/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','interval notation','subtract','divide') +## DBCCSS('7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserMultiAnswer.pl", + "parserNumberWithUnits.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +package MultiAnswer; +our $separator = ' '; +package main; + +$a=random(20,40,5); +$b=random(2.5,3.5,0.1); +$m=random(30,70,10); +$m=Compute($m); +$mmi = NumberWithUnits($m, 'mi'); +$c=$a+$b*$m; + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); +$ac = Currency("$a"); +$bc = Currency("$b"); +$cc = Currency("$c"); + + +Context("Interval"); +$interval = Interval("[0,$m]"); + +$left = Formula("$a+$b x"); +$right = Formula("$c"); +Context()->strings->add("<"=>{}, ">"=>{}, "="=>{}, "<="=>{}, ">="=>{}, "!="=>{}); + +$comparitor = String("<="); +$opposite = String(">="); + + +$multians = MultiAnswer($left, $comparitor, $right)->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $stuLeft, $stuComp, $stuRight ) = @{$student}; + my ( $corLeft, $corComp, $corRight ) = @{$correct}; + if ( ($corLeft == $stuLeft && $corComp == $stuComp && $corRight == $stuRight) || + ($corLeft == $stuRight && $opposite == $stuComp && $corRight == $stuLeft) ) { + return 1; + } + } +); + +$newUnits = [ + {name=>'miles',conversion=>{factor=>5280*12*2.54/100,m=>1}}, + {name=>'mile',conversion=>{factor=>5280*12*2.54/100,m=>1}}, + {name=>'mi',conversion=>{factor=>5280*12*2.54/100,m=>1}}, +]; +$miles = NumberWithUnits("$m miles",{newUnit=>$newUnits}); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +You are riding in a taxi and can only pay with cash. You have to pay a flat fee of [`[$ac]`], and then pay [`[$bc]`] per mile. You have a total of [`[$cc]`] in your pocket. Let [`x`] be the number of miles the taxi will drive you. You want to know how many miles you can afford. + +a. Write an inequality to represent this situation in terms of how many miles you can afford. + [@KeyboardInstructions(q?Your inequality has three parts, a left side, a right side, and a comparison operator in the middle: [`<`], [`>`], [`\leq`], [`\geq`], [`=`], or [`\neq`]. Enter these as [|<|], [|>|]*, [|<=|]*, [|>=|]*, [|=|]*, and [|!=|]*.?)@]** + [__]{$multians}{width=>10} [__]{$multians}{width=>2} [__]{$multians}{width=>10} + +a. Solve this inequality. At most how many miles can you afford? + [___]{$miles} + +a. Use interval notation to express the number of miles you can afford. + [________]{$interval} + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; + + + +$s1=$c-$a; + +BEGIN_PGML_SOLUTION + +Let [`x`] be the number of miles the taxi will drive. + + [` +\begin{aligned} + [$b]x+[$a] & \leq [$c] \\ + [$b]x+[$a]\mathbf{{}-[$a]} & \leq [$c]\mathbf{{}-[$a]} \\ + [$b]x & \leq [$s1] \\ + \frac{[$b]x}{[$b]} & \leq \frac{[$s1]}{[$b]} \\ + x & \leq [$m] +\end{aligned} +`] + +You can afford at most [`[$m]`] miles. + +The interval that represents the number of miles that you can afford is [`[$interval]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem20.pg new file mode 100644 index 0000000000..a93193f02f --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem20.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear inequality to solve word problems. +# +# Last updated: Jordan 8/29/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','multiply','subtract') +## DBCCSS('7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserMultiAnswer.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +package MultiAnswer; +our $separator = ' '; +package main; + +Context("Numeric"); + +$a=random(70,75,1); +$b=random(85,90,1); +$m=random(76,84,1); +$ans2=Compute($m*3-$a-$b); +while ($ans2==($a+$b)/2) { + $m=random(76,84,1); + $ans2=Compute($m*3-$a-$b); +} + +Context("Interval"); +$interval = Interval("[$ans2,100]"); + +$left = Formula("($a+$b+x)/3"); +$right = Formula("$m"); + +Context()->strings->add("<"=>{}, ">"=>{}, "="=>{}, "<="=>{}, ">="=>{}, "!="=>{}); + +$comparitor = String(">="); +$opposite = String("<="); + + +$multians = MultiAnswer($left, $comparitor, $right)->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $stuLeft, $stuComp, $stuRight ) = @{$student}; + my ( $corLeft, $corComp, $corRight ) = @{$correct}; + if ( ($corLeft == $stuLeft && $corComp == $stuComp && $corRight == $stuRight) || + ($corLeft == $stuRight && $opposite == $stuComp && $corRight == $stuLeft) ) { + return 1; + } + } +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[%Not using percentages to avoid confusion%] +Your grade in a class is determined by the average of three test scores. You scored [`[$a]`] and [`[$b]`] on the first two tests. To earn at least [`[$m]`] for this course, how much do you have to score on the third test? Let [`x`] be the score you will earn on the third test. + +a. Write an inequality to represent this situation. + [@KeyboardInstructions(q?Your inequality has three parts, a left side, a right side, and a comparison operator in the middle: [`<`], [`>`], [`\leq`], [`\geq`], [`=`], or [`\neq`]. Enter these as [|<|]*, [|>|]*, [|<=|]*, [|>=|]*, [|=|]*, and [|!=|]*.?)@]** + [__]{$multians}{width=>10} [__]{$multians}{width=>2} [__]{$multians}{width=>10} + +a. Solve this inequality. What is the minimum that you have to earn on the third test in order to earn a [`[$m]`] for the course? + [___________]{$ans2} + +a. You cannot score over [`100`] on the third test. Use interval notation to represent the range of scores you can earn on the third test in order to earn at least [`[$m]`] for this course. + [______________]{$interval} + + + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; + + +$s1=3*$m; +$s2=$a+$b; + +BEGIN_PGML_SOLUTION + +Let [`x`] be the score you will earn on the third test. + + [` +\begin{aligned} + \frac{[$a]+[$b]+x}{3} & \geq [$m] \\ + 3 \cdot \frac{[$a]+[$b]+x}{3} & \geq 3 \cdot [$m] \\ + [$a]+[$b]+x & \geq [$s1] \\ + [$s2] +x & \geq [$s1] \\ + [$s2] +x \mathbf{{}-[$s2]}& \geq [$s1]\mathbf{{}-[$s2]} \\ + x & \geq [$ans2] +\end{aligned} +`] + +You have to score at least [`[$ans2]`] on the third test in order to earn [`[$m]`] in this course. + +To earn at least [`[$m]`] in this course, the interval for your score on the third test is [`[$interval]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation10.pg new file mode 100644 index 0000000000..1bde95f4fd --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation10.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#]. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\leq'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("(-inf,$right]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation100.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation100.pg new file mode 100644 index 0000000000..e3abfcca71 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation100.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#]. The number is a fraction. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFraction"); +Context()->flags->set(allowMixedNumbers=>0); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} + +$left = Compute("x"); +$comp = '\leq'; +$right = Fraction(-$num,$den); + +Context("Interval"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +($num, $den) = abs($right)->value; +$ans_latex_string = "\left(-\infty,{-\frac{$num}{$den}}\right]"; +$ans_string = "(-inf, $right]"; +$ans = Compute("(-inf, $right]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \left\{ x \mid {[$left]} [$comp] [$right] \right\} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans->cmp(correct_ans=>$ans_string, correct_ans_latex_string=>$ans_latex_string)} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [`[$right]`]. Shading these on a number line may help you to see that the interval notation is [`[$ans_latex_string]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation110.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation110.pg new file mode 100644 index 0000000000..61c0e905c4 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation110.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,0]. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\leq'; +$right = 0; + +Context("Interval"); +$ans = Compute("(-inf,$right]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid [$left] [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [`[$right]`]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation120.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation120.pg new file mode 100644 index 0000000000..2d83ad3f12 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation120.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (0,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = 0; +$comp = '\lt'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("($left,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid [$left] [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [`[$left]`] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation20.pg new file mode 100644 index 0000000000..9923a4b0cd --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation20.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like [#,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\geq'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("[$right,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation30.pg new file mode 100644 index 0000000000..e0c31af91e --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation30.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\lt'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("(-inf,$right)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid{[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation40.pg new file mode 100644 index 0000000000..9562bff81e --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation40.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (#,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\gt'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("($right,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation50.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation50.pg new file mode 100644 index 0000000000..7ca6c1e27f --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation50.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = non_zero_random(-10,10,1); +$comp = '\gt'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("(-inf,$left)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [$left] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation60.pg new file mode 100644 index 0000000000..fafdf08896 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation60.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#]. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = non_zero_random(-10,10,1); +$comp = '\geq'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("(-inf,$left]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [$left] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation70.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation70.pg new file mode 100644 index 0000000000..d1fdde4326 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation70.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like [#,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = non_zero_random(-10,10,1); +$comp = '\leq'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("[$left,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x\mid{[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [$left] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation80.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation80.pg new file mode 100644 index 0000000000..25b7e0f947 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation80.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (#,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = non_zero_random(-10,10,1); +$comp = '\lt'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("($left,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [$left] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation90.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation90.pg new file mode 100644 index 0000000000..f15d50a801 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation90.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (#,inf). The number is a fraction. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->flags->set(allowMixedNumbers=>0); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} + +$left = Fraction($num,$den); +$comp = '\lt'; +$right = Compute("x"); + +Context("Interval"); +($num, $den) = $left->value; +$ans_latex_string = "\left(\frac{$num}{$den},\infty\right)"; +$ans_string = "($left, inf)"; +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("($left,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \left\{ x \mid {[$left]} [$comp] [$right] \right\} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans->cmp(correct_ans=>$ans_string, correct_ans_latex_string=>$ans_latex_string)} + +END_PGML + + + + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [`[$left]`] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans_latex_string]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph10.pg new file mode 100644 index 0000000000..9cf187b10d --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph10.pg @@ -0,0 +1,189 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change set notation to graph: x>3 +# +# Last edited by Jordan 8/29/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(-4,4,1); + +$symbol = $GTS; #Don't use < or > directly. + +%answer = (leftType => 'open', + rightType => 'inf', #use 'inf' regardles of +/- inf + ); + + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 5; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); +@alts=(); + +#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. +@indices=(); + + +#make the graphs +for $leftType ('open','closed', 'inf') +{ + for $rightType ('open','closed', 'inf') + { + my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] + ); + @ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + + $tempgr->h_ticks(0,"black",@ticks); + $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); + + if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) + { + $altText = ""; + $altText = "This is the graph of a number line. "; + $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); + if ($leftType eq 'open' or $rightType eq 'open') + { + $altText = $altText."It has a hollow circle at $a, "; + $tempgr->stamps( open_circle($a,0,'blue') ) + } + else + { + $altText = $altText."It has a filled circle at $a, "; + $tempgr->stamps( closed_circle($a,0,'blue') ) + }; + $tempgr->moveTo($a,0); + if ($leftType eq 'inf') { + $altText = $altText."and the number line is shaded everywhere left from $a."; + $tempgr->arrowTo(-0.99*$reach,0,'blue',3); + } else { + $altText = $altText."and the number line is shaded everywhere right from $a."; + $tempgr->arrowTo(0.99*$reach,0,'blue',3); + } + push(@gr,$tempgr);push(@alts,$altText); + if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) + {push(@indices, $#gr);} + else {unshift(@indices, $#gr);} + } + +}}; + +#A permutation function +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + my %map = (); + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #$zero is the preimage of 0. + + +@ar_choice = ("A","B","C","D"); + +$pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); + + +############################################## + +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing the solutions to \(x $symbol $a\). +$PAR + +A. \{ image( insertGraph($gr[ $indices[$shuffle->{0}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{0}] ]" alt="$alts[ $indices[$shuffle->{0}] ]" align="top" ' ) \} +$PAR + +B. \{ image( insertGraph($gr[ $indices[$shuffle->{1}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{1}] ]" alt="$alts[ $indices[$shuffle->{1}] ]" align="top" ' ) \} +$PAR +C. \{ image( insertGraph($gr[ $indices[$shuffle->{2}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{2}] ]" alt="$alts[ $indices[$shuffle->{2}] ]" align="top" ' ) \} +$PAR +D. \{ image( insertGraph($gr[ $indices[$shuffle->{3}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{3}] ]" alt="$alts[ $indices[$shuffle->{3}] ]" align="top" ' ) \} + +$PAR + +$SPACE $SPACE $SPACE \{ $pop->menu() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $pop->cmp() ); + +BEGIN_PGML_SOLUTION + +The inequality is [`x [$symbol] [$a]`]. + +Since [`x`] needs to be greater than [`[$a]`], we should shade all numbers to the _right_ of [`[$a]`], moving toward [` +\infty `]. + +Since the inequality symbol is [`[$symbol]`], we should use an open ending at [`[$a]`]. + +The correct answer is [@ $pop->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph20.pg new file mode 100644 index 0000000000..381ea62bf4 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph20.pg @@ -0,0 +1,190 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change set notation to graph: x<3 +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(-4,4,1); + +$symbol = $LTS; #Don't use < or > directly. + +%answer = (leftType => 'inf', + rightType => 'open', #use 'inf' regardles of +/- inf + ); + + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 5; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); +@alts=(); + +#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. +@indices=(); + + +#make the graphs +for $leftType ('open','closed', 'inf') +{ + for $rightType ('open','closed', 'inf') + { + my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] + ); + @ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + + $tempgr->h_ticks(0,"black",@ticks); + $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); + + if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) + { + $altText = ""; + $altText = "This is the graph of a number line. "; + $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); + if ($leftType eq 'open' or $rightType eq 'open') + { + $altText = $altText."It has a hollow circle at $a, "; + $tempgr->stamps( open_circle($a,0,'blue') ) + } + else + { + $altText = $altText."It has a filled circle at $a, "; + $tempgr->stamps( closed_circle($a,0,'blue') ) + }; + $tempgr->moveTo($a,0); + if ($leftType eq 'inf') { + $altText = $altText."and the number line is shaded everywhere left from $a."; + $tempgr->arrowTo(-0.99*$reach,0,'blue',3); + } else { + $altText = $altText."and the number line is shaded everywhere right from $a."; + $tempgr->arrowTo(0.99*$reach,0,'blue',3); + } + push(@gr,$tempgr);push(@alts,$altText); + if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) + {push(@indices, $#gr);} + else {unshift(@indices, $#gr);} + } + +}}; + +#A permutation function +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + my %map = (); + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #$zero is the preimage of 0. + + +@ar_choice = ("A","B","C","D"); + +$pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); + + +############################################## + +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing the solutions to \(x $symbol $a\). +$PAR + +A. \{ image( insertGraph($gr[ $indices[$shuffle->{0}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{0}] ]" alt="$alts[ $indices[$shuffle->{0}] ]" align="top" ' ) \} +$PAR + +B. \{ image( insertGraph($gr[ $indices[$shuffle->{1}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{1}] ]" alt="$alts[ $indices[$shuffle->{1}] ]" align="top" ' ) \} +$PAR +C. \{ image( insertGraph($gr[ $indices[$shuffle->{2}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{2}] ]" alt="$alts[ $indices[$shuffle->{2}] ]" align="top" ' ) \} +$PAR +D. \{ image( insertGraph($gr[ $indices[$shuffle->{3}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{3}] ]" alt="$alts[ $indices[$shuffle->{3}] ]" align="top" ' ) \} + + +$PAR + +$SPACE $SPACE $SPACE \{ $pop->menu() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $pop->cmp() ); + +BEGIN_PGML_SOLUTION + +The inequality is [`x [$symbol] [$a]`]. + +Since [`x`] needs to be smaller than [`[$a]`], we should shade all numbers to the _left_ of [`[$a]`], moving toward [` -\infty `]. + +Since the inequality symbol is [`[$symbol]`], we should use an open ending at [`[$a]`]. + +The correct answer is [@ $pop->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph30.pg new file mode 100644 index 0000000000..b90149dd07 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph30.pg @@ -0,0 +1,190 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change set notation to graph: x>=3 +# +# Last edited by Jordan 8/29/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(-4,4,1); + +$symbol = '\ge'; + +%answer = (leftType => 'closed', + rightType => 'inf', #use 'inf' regardles of +/- inf + ); + + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 5; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); +@alts=(); + +#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. +@indices=(); + + +#make the graphs +for $leftType ('open','closed', 'inf') +{ + for $rightType ('open','closed', 'inf') + { + my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] + ); + @ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + + $tempgr->h_ticks(0,"black",@ticks); + $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); + + if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) + { + $altText = ""; + $altText = "This is the graph of a number line. "; + $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); + if ($leftType eq 'open' or $rightType eq 'open') + { + $altText = $altText."It has a hollow circle at $a, "; + $tempgr->stamps( open_circle($a,0,'blue') ) + } + else + { + $altText = $altText."It has a filled circle at $a, "; + $tempgr->stamps( closed_circle($a,0,'blue') ) + }; + $tempgr->moveTo($a,0); + if ($leftType eq 'inf') { + $altText = $altText."and the number line is shaded everywhere left from $a."; + $tempgr->arrowTo(-0.99*$reach,0,'blue',3); + } else { + $altText = $altText."and the number line is shaded everywhere right from $a."; + $tempgr->arrowTo(0.99*$reach,0,'blue',3); + } + push(@gr,$tempgr);push(@alts,$altText); + if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) + {push(@indices, $#gr);} + else {unshift(@indices, $#gr);} + } + +}}; + +#A permutation function +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + my %map = (); + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #$zero is the preimage of 0. + + +@ar_choice = ("A","B","C","D"); + +$pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); + + +############################################## + +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing the solutions to \(x $symbol $a\). +$PAR + +A. \{ image( insertGraph($gr[ $indices[$shuffle->{0}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{0}] ]" alt="$alts[ $indices[$shuffle->{0}] ]" align="top" ' ) \} +$PAR + +B. \{ image( insertGraph($gr[ $indices[$shuffle->{1}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{1}] ]" alt="$alts[ $indices[$shuffle->{1}] ]" align="top" ' ) \} +$PAR +C. \{ image( insertGraph($gr[ $indices[$shuffle->{2}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{2}] ]" alt="$alts[ $indices[$shuffle->{2}] ]" align="top" ' ) \} +$PAR +D. \{ image( insertGraph($gr[ $indices[$shuffle->{3}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{3}] ]" alt="$alts[ $indices[$shuffle->{3}] ]" align="top" ' ) \} + + +$PAR + +$SPACE $SPACE $SPACE \{ $pop->menu() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $pop->cmp() ); + +BEGIN_PGML_SOLUTION + +The inequality is [`x [$symbol] [$a]`]. + +Since [`x`] needs to be greater than [`[$a]`], we should shade all numbers to the _right_ of [`[$a]`], moving toward [` +\infty `]. + +Since the inequality symbol is [`[$symbol]`], we should use a closed ending at [`[$a]`]. + +The correct answer is [@ $pop->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph40.pg new file mode 100644 index 0000000000..f195f5ee0a --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph40.pg @@ -0,0 +1,189 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change set notation to graph: x<=3 +# +# Last edited by Jordan 8/29/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(-4,4,1); + +$symbol = '\le'; + +%answer = (leftType => 'inf', + rightType => 'closed', #use 'inf' regardles of +/- inf + ); + + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 5; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); +@alts=(); + +#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. +@indices=(); + + +#make the graphs +for $leftType ('open','closed', 'inf') +{ + for $rightType ('open','closed', 'inf') + { + my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] + ); + @ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + + $tempgr->h_ticks(0,"black",@ticks); + $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); + + if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) + { + $altText = ""; + $altText = "This is the graph of a number line. "; + $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); + if ($leftType eq 'open' or $rightType eq 'open') + { + $altText = $altText."It has a hollow circle at $a, "; + $tempgr->stamps( open_circle($a,0,'blue') ) + } + else + { + $altText = $altText."It has a filled circle at $a, "; + $tempgr->stamps( closed_circle($a,0,'blue') ) + }; + $tempgr->moveTo($a,0); + if ($leftType eq 'inf') { + $altText = $altText."and the number line is shaded everywhere left from $a."; + $tempgr->arrowTo(-0.99*$reach,0,'blue',3); + } else { + $altText = $altText."and the number line is shaded everywhere right from $a."; + $tempgr->arrowTo(0.99*$reach,0,'blue',3); + } + push(@gr,$tempgr);push(@alts,$altText); + if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) + {push(@indices, $#gr);} + else {unshift(@indices, $#gr);} + } + +}}; + +#A permutation function +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + my %map = (); + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #$zero is the preimage of 0. + + +@ar_choice = ("A","B","C","D"); + +$pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); + + +############################################## + +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing the solutions to \(x $symbol $a\). +$PAR + +A. \{ image( insertGraph($gr[ $indices[$shuffle->{0}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{0}] ]" alt="$alts[ $indices[$shuffle->{0}] ]" align="top" ' ) \} +$PAR + +B. \{ image( insertGraph($gr[ $indices[$shuffle->{1}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{1}] ]" alt="$alts[ $indices[$shuffle->{1}] ]" align="top" ' ) \} +$PAR +C. \{ image( insertGraph($gr[ $indices[$shuffle->{2}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{2}] ]" alt="$alts[ $indices[$shuffle->{2}] ]" align="top" ' ) \} +$PAR +D. \{ image( insertGraph($gr[ $indices[$shuffle->{3}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{3}] ]" alt="$alts[ $indices[$shuffle->{3}] ]" align="top" ' ) \} + +$PAR + +$SPACE $SPACE $SPACE \{ $pop->menu() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $pop->cmp() ); + +BEGIN_PGML_SOLUTION + +The inequality is [`x [$symbol] [$a]`]. + +Since [`x`] needs to be smaller than [`[$a]`], we should shade all numbers to the _left_ of [`[$a]`], moving toward [` -\infty `]. + +Since the inequality symbol is [`[$symbol]`], we should use a closed ending at [`[$a]`]. + +The correct answer is [@ $pop->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality10.pg new file mode 100644 index 0000000000..93ade51ed4 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality10.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like x+a>b. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextArbitraryString.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(6,10,1); +$left = Compute("x+$a"); +$comp = '>'; +$right = Compute("$b"); + +$c = $b-$a; +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +$setans = Compute("{ x | x > $c}"); +$alt = Compute("{ x | $c < x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($c,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + x+[$a] &> [$b]\\ + x+[$a]\mathbf{{}-[$a]} &> [$b]\mathbf{{}-[$a]} \\ + x &> [$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality100.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality100.pg new file mode 100644 index 0000000000..f1ed0b0146 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality100.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -x <= a +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','multiply','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,10,1); +$left = Compute("-x"); +$comp = "\leq"; +$right = Compute("$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= -$b}"); +$alt = Compute("{ x | -$b <= x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[-$b,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -x & \leq [$b] \\ + -1(-x) & \geq -1([$b]) \\ + x & \geq -[$b] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality110.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality110.pg new file mode 100644 index 0000000000..cec29914bc --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality110.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like (a/b)x > c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} +$frac = Fraction($num,$den); + +$a=$num*list_random((1,2,3,4)); +$left = Compute("$frac*x"); +$comp = ">"; +$right = Compute("$a"); +$b=$a/$num*$den; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > $b}"); +$alt = Compute("{ x | $b < x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($b,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +$s1=$den*$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{[$num]}{[$den]}x &> [$a] \\ + [$den] \cdot \frac{[$num]}{[$den]}x &> [$den] \cdot [$a] \\ + [$num]x &> [$s1] \\ + \frac{[$num]x}{[$num]} &> \frac{[$s1]}{[$num]} \\ + x &> [$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality120.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality120.pg new file mode 100644 index 0000000000..87432e1aee --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality120.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -(a/b)x <= c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} +$frac = Fraction($num,$den); + +$a=$num*list_random((1,2,3,4)); +$left = Compute("-$frac*x"); +$comp = "\leq"; +$right = Compute("$a"); +$b=$a/$num*$den; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= -$b}"); +$alt = Compute("{ x | -$b <= x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[-$b,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +$s1=$den*$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -\frac{[$num]}{[$den]}x & \leq [$a] \\ + [$den] \cdot -\frac{[$num]}{[$den]}x & \leq [$den] \cdot [$a] \\ + -[$num]x & \leq [$s1] \\ + (-1) \cdot -[$num]x & \geq (-1) \cdot [$s1] \\ + [$num]x & \geq -[$s1] \\ + \frac{[$num]x}{[$num]} & \geq \frac{-[$s1]}{[$num]} \\ + x & \geq -[$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality130.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality130.pg new file mode 100644 index 0000000000..e20270e7b2 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality130.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -a < (b/c) x +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} +$frac = Fraction($num,$den); + +$a=$num*list_random((1,2,3,4)); +$left = Compute("-$a"); +$comp = "<"; +$right = Compute("$frac*x"); +$b=$a/$num*$den; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > -$b}"); +$alt = Compute("{ x | -$b < x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-$b,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +$s1=$den*$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a] & < \frac{[$num]}{[$den]}x \\ + [$den] \cdot (-[$a]) & < [$den] \cdot \frac{[$num]}{[$den]}x \\ + -[$s1] & < [$num]x \\ + \frac{-[$s1]}{[$num]} & < \frac{[$num]x}{[$num]} \\ + -[$b] & < x \\ + x & > -[$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality140.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality140.pg new file mode 100644 index 0000000000..d183dcc4b9 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality140.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -a < -(a/b) x +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} +$frac = Fraction($num,$den); + +$a=$num*list_random((1,2,3,4)); +$left = Compute("-$a"); +$comp = "<"; +$right = Compute("-$frac*x"); +$b=$a/$num*$den; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x < $b}"); +$alt = Compute("{ x | $b > x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$b)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +$s1=$den*$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a] & < -\frac{[$num]}{[$den]}x \\ + [$den] \cdot (-[$a]) & < [$den] \cdot (-\frac{[$num]}{[$den]}x) \\ + -[$s1] & < -[$num]x \\ + (-1) \cdot (-[$s1]) & > (-1) \cdot (-[$num]x) \\ + [$s1] & > [$num]x \\ + \frac{[$s1]}{[$num]} & > \frac{[$num]x}{[$num]} \\ + [$b] & > x \\ + x & < [$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality150.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality150.pg new file mode 100644 index 0000000000..01acdc13e5 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality150.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax > -b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("$a*x"); +$comp = ">"; +$right = Compute("-$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > -$c}"); +$alt = Compute("{ x | -$c < x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-$c,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a]x & > -[$b] \\ + \frac{[$a]x}{[$a]} & > \frac{-[$b]}{[$a]} \\ + x & > -[$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality160.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality160.pg new file mode 100644 index 0000000000..1e797f0cf0 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality160.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -a < -bx +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("-$b"); +$comp = "<"; +$right = Compute("-$a*x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x < $c}"); +$alt = Compute("{ x | $c > x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$b] & < -[$a]x \\ + \frac{-[$b]}{-[$a]} & > \frac{-[$a]x}{-[$a]} \\ + [$c] & > x \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality170.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality170.pg new file mode 100644 index 0000000000..6f9e685c7b --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality170.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax+b > c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,10,1); +$b=random(2,10,1); +$v=random(2,10,1); +$c=$a*$v+$b; +$left = Compute("$a*x+$b"); +$comp = ">"; +$right = Compute("$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > $v}"); +$alt = Compute("{ x | $v < x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($v,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions('The [| | |]* symbol is above the [|Enter|]* key.')@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a]x + [$b] & > [$c] \\ + -[$b] & \phantom{>} -[$b] \\ + [$a]x & > [$c-$b] \\ + \frac{[$a]x}{[$a]} & > \frac{[$c-$b]}{[$a]} \\ + x & > [$v] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality180.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality180.pg new file mode 100644 index 0000000000..d669318196 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality180.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a>= bx-c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','add','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(3,10,1); +$b=random(2,5,1); +$v=random(2,10,1); +$c=$a*$v-$b; + +$left = Compute("$c"); +$comp = "\geq"; +$right = Compute("$a*x-$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= $v}"); +$alt = Compute("{ x | $v >= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$v]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$c] & \geq [$a]x -[$b] \\ + [$c] \mathbf{{} +[$b]} & \geq [$a]x -[$b]\mathbf{{} +[$b]} \\ + [$c+$b] & \geq [$a]x \\ + \frac{[$c+$b] }{[$a]} & \geq \frac{[$a]x}{[$a]} \\ + [$v] & \geq x \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality190.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality190.pg new file mode 100644 index 0000000000..a173ac6655 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality190.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a <= b-cx +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,10,1); +$b=random(1,10,1); +$v=random(2,10,1); +$c=$b+$a*$v; + +$left = Compute("$c"); +$comp = "\leq"; +$right = Compute("$b-$a*x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= -$v}"); +$alt = Compute("{ x | -$v >= x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,-$v]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$c] & \leq [$b]-[$a]x \\ + [$c] \mathbf{{} -[$b]} & \leq [$b]-[$a]x\mathbf{{} -[$b]} \\ + [$c-$b] & \leq -[$a]x \\ + \frac{[$c-$b] }{-[$a]} & \geq \frac{-[$a]x}{-[$a]} \\ + -[$v] & \geq x \\ + x & \leq -[$v] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality20.pg new file mode 100644 index 0000000000..dc7a810b5c --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality20.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like x-a <= b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextArbitraryString.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(6,10,1); +$left = Compute("x-$a"); +$comp = "\leq"; +$right = Compute("$b"); + +$c = $b+$a; +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x <= $c}"); +$alt = Compute("{ x | $c >= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + x-[$a] & \leq [$b] \\ + x-[$a]\mathbf{{}+[$a]} & \leq [$b]\mathbf{{}+[$a]} \\ + x & \leq [$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality200.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality200.pg new file mode 100644 index 0000000000..2e82238b78 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality200.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -ax-b < -c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','add','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,10,1); +$b=random(1,10,1); +$v=random(2,10,1); +$c=$b+$a*$v; + +$left = Compute("-$a*x-$b"); +$comp = "<"; +$right = Compute("-$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > $v}"); +$alt = Compute("{ x | $v < x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($v,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a]x-[$b] &< -[$c] \\ + -[$a]x-[$b]\mathbf{{}+[$b]} &< -[$c]\mathbf{{}+[$b]} \\ + -[$a]x &< [$b-$c] \\ + \frac{-[$a]x}{-[$a]} &> \frac{[$b-$c]}{-[$a]} \\ + x & > [$v] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality210.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality210.pg new file mode 100644 index 0000000000..4b0139c455 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality210.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a > -bx+c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +#0 is the critical point +Context("Numeric"); + +$a=random(3,10,1); +$b=random(2,5,1); + +$left = Compute("$b"); +$comp = "\geq"; +$right = Compute("-$a*x+$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= 0}"); +$alt = Compute("{ x | 0 <= x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[0,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$b] & \geq -[$a]x +[$b] \\ + [$b]\mathbf{{} -[$b]} & \geq -[$a]x +[$b]\mathbf{{} -[$b]} \\ + 0 & \geq -[$a]x \\ + \frac{0}{-[$a]} & \leq \frac{-[$a]x}{-[$a]} \\ + 0 & \leq x \\ + x & \geq 0 +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality220.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality220.pg new file mode 100644 index 0000000000..71310f97ad --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality220.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -a > b-x +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','negative','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(1,5,1); +$v=random(6,10,1); +$c=$b-$v; + +$left = Compute("$c"); +$comp = ">"; +$right = Compute("$b-x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > $v}"); +$alt = Compute("{ x | $v < x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($v,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$c] & > [$b]-x \\ + [$c] \mathbf{{}-[$b]} & > [$b]-x\mathbf{{}-[$b]} \\ + [$c-$b] & > -x \\ + -1 \cdot ([$c-$b]) & < -1 \cdot (-x) \\ + [$v] & < x \\ + x & > [$v] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality230.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality230.pg new file mode 100644 index 0000000000..6ecb3bf863 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality230.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a(x+b) >= c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,10,1); +$v = random(2,10,1); +$b=random(1,10,1); +$c= $a*($v+$b); + +$left = Compute("$a*(x+$b)"); +$comp = "\geq"; +$right = Compute("$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= $v}"); +$alt = Compute("{ x | $v <= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$v,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $a*$b; +$step2 = $c-$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a](x{}+ [$b]) & \geq [$c] \\ + [$a]x {}+[$step1] & \geq [$c] \\ + [$a]x {}+[$step1]\mathbf{{} -[$step1]} & \geq [$c]\mathbf{{} -[$step1]} \\ + [$a]x & \geq [$step2] \\ + \frac{[$a]x}{[$a]} & \geq \frac{[$step2]}{[$a]} \\ + x & \geq [$v] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality240.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality240.pg new file mode 100644 index 0000000000..db9a6dbde0 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality240.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax+b < cx+d +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(t=>"Real"); + +$a=random(6,10,1); +$b=random(2,10,1); +$c=random(1,5,1); +$crit=random(2,10,1); +$d=$a*$crit+$b-$c*$crit; + +$left = Compute("$a*t+$b"); +$comp = "<"; +$right = Compute("$c*t+$d"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(t=>"Real"); + +$setans = Compute("{ t | t < $crit}"); +$alt = Compute("{ t | $crit>= t}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->variables->are(t=>"Real"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a]t {}+[$b] & < [$c]t {}+[$d] \\ + [$a]t {}+[$b]\mathbf{{}-[$c]t {}-[$b]} & < [$c]t {}+[$d]\mathbf{{}-[$c]t {}-[$b]} \\ + [$a-$c]t & < [$d-$b] \\ + \frac{[$a-$c]t}{[$a-$c]} & < \frac{[$d-$b]}{[$a-$c]} \\ + t & < [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality250.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality250.pg new file mode 100644 index 0000000000..5383da1246 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality250.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -ax +b <= -z -c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','add','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(z=>"Real"); + +#make sure $d is negative +do { + $a=random(2,10,1); + $b=random(2,10,1); + $crit=random(1,10,1); + $ans=random(1,10,1); + $d=$b-($a-1)*$crit; +} until ($d<0); + +$d=abs($d); + +$left = Compute("-$a*z+$b"); +$comp = "\leq"; +$right = Compute("-z-$d"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(z=>"Real"); + +$setans = Compute("{ z | z >= $crit}"); +$alt = Compute("{ z | $crit <= z}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$crit,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a]z {}+[$b] & \leq -z {}-[$d] \\ + -[$a]z {}+[$b] \mathbf{{}+[$a]z {}+[$d]}& \leq -z {}-[$d]\mathbf{{}+[$a]z {}+[$d]} \\ + [$b+$d] & \leq [$a-1]z \\ + \frac{[$b+$d]}{[$a-1]} & \leq \frac{[$a-1]z}{[$a-1]} \\ + [$crit] & \leq z\\ +z & \geq [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality260.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality260.pg new file mode 100644 index 0000000000..d6fd5a91bf --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality260.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like x-a-bx > -c-dx+e +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','combine','add','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(a=>"Real"); + +do{ +$a=random(2,10,1); +$b=random(2,10,1); +$c=random(2,10,1); +$d=random(2,10,1);} until (1 - $b + $d >1); +$crit=random(-10,10,1); + +#make sure $e is positive +$e=$crit-$a-$b*$crit+$c+$d*$crit; +while ($e<=0) { + $crit=random(-10,10,1); + $e=$crit-$a-$b*$crit+$c+$d*$crit; +} + +$left = Compute("a-$a-$b*a"); +$comp = ">"; +$right = Compute("-$c-$d*a+$e"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(a=>"Real"); + +$setans = Compute("{ a | a > $crit}"); +$alt = Compute("{ a | $crit < a}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($crit,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = 1-$b; +$step2 = 1-$b+$d; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + a -[$a] -[$b]a & > -[$c] -[$d]a +[$e] \\ + [$step1]a -[$a] & > [$e-$c] -[$d]a \\ + [$step1]a -[$a]\mathbf{{}+[$a] +[$d]a} & > [$e-$c] -[$d]a\mathbf{{}+[$a] +[$d]a} \\ + [$step2]a & > [$e-$c+$a] \\ + \frac{[$step2]a}{[$step2]} &> \frac{[$e-$c+$a]}{[$step2]} \\ + a &> [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality270.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality270.pg new file mode 100644 index 0000000000..7b66d7582a --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality270.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -ax+b-cx >= dx+e +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','combine','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +#make the critical point 0 +Context("Numeric"); +Context()->variables->are(p=>"Real"); + +$a=random(2,10,1); +$b=random(2,10,1); +$c=random(2,10,1); +$d=$b; +$e=random(2,10,1); +#make sure x terms are not cancelled +while (($a+$c)==(-$e)) {$e=random(2,10,1);} + +$left = Compute("-$c*p+$d-$e*p"); +$comp = "\geq"; +$right = Compute("$a*p+$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(p=>"Real"); + +$setans = Compute("{ p | p <= 0}"); +$alt = Compute("{ p | 0 >= p}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,0]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = abs(-$c-$e); +$step2 = $a+$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$c]p +[$d] -[$e]p & \geq [$a]p+[$b] \\ + (-[$c]-[$e])p +[$d] & \geq [$a]p+[$b] \\ + -[$step1]p +[$d] & \geq [$a]p+[$b] \\ + -[$step1]p +[$d]\mathbf{{}+[$step1]p-[$b]} & \geq [$a]p+[$b]\mathbf{{}+[$step1]p-[$b]} \\ + [$d-$b] & \geq [$step2]p \\ + \frac{[$d-$b]}{[$step2]} & \geq \frac{[$step2]p}{[$step2]} \\ + 0 & \geq p \\ + p & \leq 0 +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality280.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality280.pg new file mode 100644 index 0000000000..6d0519eb53 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality280.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a < -b(x-c) +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(p=>"Real"); + +$a=random(2,10,1); +$b=random(1,10,1); +$crit = non_zero_random(-10,10,1); +$c= -$a*($crit -$b); + +$left = Compute("$c"); +$comp = "<"; +$right = Compute("-$a*(p-$b)"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->add(p=>"Real"); + +$setans = Compute("{ p | p < $crit}"); +$alt = Compute("{ p | $crit > p}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit )"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $a*$b; +$step2 = $c-$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$c] & < -[$a](p -[$b]) \\ + [$c] & < -[$a](p +(-[$b])) \\ + [$c] & < -[$a]p +(-[$a]) \cdot (-[$b]) \\ + [$c] & < -[$a]p +[$step1] \\ + [$c]\mathbf{{}-[$step1]}& < -[$a]p +[$step1]\mathbf{{}-[$step1]} \\ + [$step2] & < -[$a]p \\ + \frac{[$step2]}{-[$a]} & > \frac{-[$a]p}{-[$a]} \\ + [$crit] & > p \\ + p &< [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality290.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality290.pg new file mode 100644 index 0000000000..23dbd7ad19 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality290.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -(x-a) >= b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','negative','distributive','subtract','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +do { + $crit = random(-10,-2,1); + $b=random(1,10,1); + $c= -($crit -$b); +} until ($c>0); + +$left = Compute("-(x-$b)"); +$comp = "\geq"; +$right = Compute("$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= $crit }"); +$alt = Compute("{ x | $crit >= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $a*$b; +$step2 = $c+$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -(x- [$b]) & \geq [$c] \\ + (-1) \cdot (x+(-[$b])) & \geq [$c] \\ + -x +(-1) \cdot (-[$b]) & \geq [$c] \\ + -x +[$b] & \geq [$c] \\ + -x +[$b]\mathbf{{} -[$b]}& \geq [$c]\mathbf{{} -[$b]} \\ + -x & \geq [$c-$b] \\ + (-1) \cdot (-x) & \leq (-1) \cdot ([$c-$b]) \\ + x & \leq [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality30.pg new file mode 100644 index 0000000000..7e00a14106 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality30.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a <= x + b +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(6,10,1); +$left = Compute("$a"); +$comp = "\leq"; +$right = Compute("x+$b"); + +$c = $a-$b; +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x >= $c}"); +$alt = Compute("{ x | $c <= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$c,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a] & \leq x +[$b] \\ + [$a]\mathbf{{}-[$b]} & \leq x +[$b]\mathbf{{}-[$b]} \\ + [$c] & \leq x \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality300.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality300.pg new file mode 100644 index 0000000000..fdd6a1f2b6 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality300.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a <= b-c(x-d) +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(z=>"Real"); + +$a=random(1,10,1); +$b=random(2,10,1); +$crit = non_zero_random(-10,10,1); +$c=random(1,10,1); +$d= $a-$b*($crit -$c); + +$left = Compute("$d"); +$comp = "\leq"; +$right = Compute("$a-$b*(z-$c)"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(z=>"Real"); + +$setans = Compute("{ z | z <= $crit}"); +$alt = Compute("{ z | $crit >= z}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit ]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $b*$c; +$step2 = $a+$step1; +$step3 = $d-$step2; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$d] & \leq [$a]-[$b](z-[$c]) \\ + [$d] & \leq [$a]+(-[$b]) \cdot (z+(-[$c])) \\ + [$d] & \leq [$a]+(-[$b]) \cdot z+(-[$b]) \cdot (-[$c]) \\ + [$d] & \leq [$a]-[$b]z +[$step1] \\ + [$d] & \leq -[$b]z +([$a]+[$step1]) \\ + [$d] & \leq -[$b]z +[$step2] \\ + [$d]\mathbf{{}-[$step2]} & \leq -[$b]z +[$step2]\mathbf{{}-[$step2]} \\ + [$step3] & \leq -[$b]z \\ + \frac{[$step3]}{-[$b]} & \geq \frac{-[$b]z}{-[$b]} \\ + [$crit ] & \geq z \\ + z & \leq [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality310.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality310.pg new file mode 100644 index 0000000000..867db53b94 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality310.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a-(x+b) < c +# +# Last updated: Jordan 7/30/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(y=>"Real"); + +$a=random(1,5,1); +$b=random(6,10,1); +$crit = random(-10,10,1); +$c= $a-($crit+$b); + +$left = Compute("$a-(y+$b)"); +$comp = "<"; +$right = Compute("$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(y=>"Real"); + +$setans = Compute("{ y | y > $crit}"); +$alt = Compute("{ y | $crit < y}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($crit,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $c+$b-$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a] -(y + [$b]) & < [$c] \\ + [$a] +(-1) \cdot (y + [$b]) & < [$c] \\ + [$a] +(-1) \cdot y + (-1) \cdot [$b] & < [$c] \\ + [$a] -y - [$b] & < [$c] \\ + -y +([$a]-[$b]) & < [$c] \\ + -y -[$b-$a] & < [$c] \\ + -y -[$b-$a]\mathbf{{}+[$b-$a]} & < [$c]\mathbf{{}+[$b-$a]} \\ + -y & < [$step1] \\ +-1 \cdot (-y) & > -1 \cdot ([$step1]) \\ + y & > [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality320.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality320.pg new file mode 100644 index 0000000000..944a7bd52d --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality320.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a+b(x-c) < -d-(e-fx) +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(7,10,1); +$c=random(3,10,1); +$crit = random(-10,10,1); + +$e=random(1,10,1); +$f=random(2,5,1); +$d= $a+$b*($crit-$c)+$e-$f*$crit; + +$left = Compute("$a+$b*(x-$c)"); +$comp = "<"; +$right = Compute("$d-($e-$f*x)"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x < $crit}"); +$alt = Compute("{ x | $crit > x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $b*$c; +$step2 = abs($a-$step1); +$step3 = $d-$e; +$step4 = $b-$f; +$step5 = $step3+$step2; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} +[$a]+[$b](x-[$c]) &<[$d]-([$e]-[$f]x) \\ +[$a]+[$b](x+(-[$c])) &<[$d]+(-1) \cdot ([$e]+(-[$f]x)) \\ +[$a]+[$b] \cdot x+[$b] \cdot (-[$c]) &<[$d]+(-1) \cdot [$e]+(-1) \cdot (-[$f]x) \\ +[$a]+[$b]x-[$step1] &<[$d]-[$e]+[$f]x \\ +[$a]-[$step1]+[$b]x &<[$d]-[$e]+[$f]x \\ +-[$step2]+[$b]x &<[$step3]+[$f]x \\ +-[$step2]+[$b]x\mathbf{{}+[$step2]-[$f]x} &<[$step3]+[$f]x\mathbf{{}+[$step2]-[$f]x} \\ +[$step4]x &<[$step5] \\ +\frac{[$step4]x}{[$step4]} &<\frac{[$step5]}{[$step4]} \\ + x &< [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality40.pg new file mode 100644 index 0000000000..8975612e39 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality40.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a > x + b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(6,10,1); +$left = Compute("$a"); +$comp = ">"; +$right = Compute("x+$b"); + +$c = $a-$b; +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x < $c}"); +$alt = Compute("{ x | $c > x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a] & > x +[$b] \\ + [$a]\mathbf{{}-[$b]} & > x +[$b]\mathbf{{}-[$b]} \\ + [$c] & > x \\ + x & < [$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality41.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality41.pg new file mode 100644 index 0000000000..d608614a03 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality41.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a > x + b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(6,10,1); +$left = Compute("$a"); +$comp = ">"; +$right = Compute("x-$b"); + +$c = $a+$b; +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x < $c}"); +$alt = Compute("{ x | $c > x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a] & > x -[$b] \\ + [$a]\mathbf{{}+[$b]} & > x -[$b]\mathbf{{}+[$b]} \\ + [$c] & > x \\ + x & < [$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality50.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality50.pg new file mode 100644 index 0000000000..2e8eea2a38 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality50.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax <= b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("$a*x"); +$comp = "\leq"; +$right = Compute("$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x <= $c}"); +$alt = Compute("{ x | $c >= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a]x & \leq [$b] \\ + \frac{[$a]x}{[$a]} & \leq \frac{[$b]}{[$a]} \\ + x & \leq [$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality60.pg new file mode 100644 index 0000000000..9715e6dc54 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality60.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax>b. Fraction/decimal is in answer. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($den,$num)!=1) {$den=random(1,10,1);} +$c=Fraction($num,$den); + +$left = Compute("$den*x"); +$comp = ">"; +$right = Compute("$num"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + showExtraParens => 0, + reduceConstants => 0 +); + +$setans = Compute("{ x | x > $c}"); +$alt = Compute("{ x | $c < x}"); +$ans = OneOf($setans, $alt); +$ansLatexString="\left\{ x \mid x > ".$c->TeX."\right\}"; + +Context("Interval"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); +$intans = Interval("($c,inf)"); +$intansLatexString = "\left(".$c->TeX.",\infty\right)"; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans->cmp(correct_ans_latex_string=>$ansLatexString)}. + In interval notation, the solution set is [______________]{$intans->cmp(correct_ans_latex_string=>$intansLatexString)}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$den]x & > [$num] \\ + \frac{[$den]x}{[$den]} &> \frac{[$num]}{[$den]} \\ + x & > \frac{[$num]}{[$den]} \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`\left([$c],\infty\right)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality70.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality70.pg new file mode 100644 index 0000000000..f924e2ad42 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality70.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -ax>=b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("-$a*x"); +$comp = "\geq"; +$right = Compute("$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= -$c}"); +$alt = Compute("{ x | -$c >= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,-$c]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a]x & \geq [$b] \\ + \frac{-[$a]x}{-[$a]} & \leq \frac{[$b]}{-[$a]} \\ + x & \leq -[$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality80.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality80.pg new file mode 100644 index 0000000000..7ee2f0384c --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality80.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a>=-bx +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("$b"); +$comp = "\geq"; +$right = Compute("-$a*x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= -$c}"); +$alt = Compute("{ x | -$c <= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[-$c,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$b] & \geq -[$a]x \\ + \frac{[$b]}{-[$a]} & \leq \frac{-[$a]x}{-[$a]} \\ + -[$c] & \leq x \\ + x & \geq -[$c] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality90.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality90.pg new file mode 100644 index 0000000000..fede26956d --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality90.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a < -x +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','multiply','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,10,1); +$left = Compute("$b"); +$comp = "<"; +$right = Compute("-x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x < -$b}"); +$alt = Compute("{ x | -$b > x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,-$b)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$b] & < -x \\ + -1 \cdot ([$b]) & < -1 \cdot (-x) \\ + -[$b] & > x \\ + x & < -[$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction10.pg new file mode 100644 index 0000000000..413b8b36dc --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction10.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like x/a + b >= cx +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$a=random(2,10,1); +$crit = $a*list_random((2,3,4,5,6)); +$c=random(2,5,1); +$b= $c*$crit-$crit/$a; + +$frac = Fraction(x,$a); + +$left = Compute("$frac+$b"); +$comp = "\geq"; +$right = Compute("$c*x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= $crit}"); +$alt = Compute("{ x | $crit >= x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $a*$b; +$step2 = $a*$c; +$s3=$step2-1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{x}{[$a]} +[$b] &\geq [$c]x \\ + [$a] \cdot \frac{x}{[$a]} +[$a] \cdot [$b] &\geq [$a] \cdot [$c]x \\ + x +[$step1] &\geq [$step2]x \\ + x +[$step1]\mathbf{{}-x} & \geq [$step2]x\mathbf{{}-x} \\ + [$step1] &\geq [$s3]x \\ + \frac{[$step1]}{[$s3]} &\geq \frac{[$s3]x}{[$s3]} \\ + [$crit] &\geq x +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction20.pg new file mode 100644 index 0000000000..d65ea1b9c1 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction20.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a/b -cx < d. Fraction is in answer. +# +# Last updated: Jordan 10/25/13, 7/30/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','negative','divide','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->variables->are(y=>"Real"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); + +$den = random(2,6,2); +$num=random(3,5,2); +while (gcd($den,$num)!=1) {$num=random(3,5,2);} +$frac = Fraction($num,$den); + +$a=random(2,6,1); +$b=random(2,6,1); +$crit = Fraction($num-$b*$den,$a*$den); + +$critNum = -($crit->value)[0]; +$critDen = ($crit->value)[1]; + +$left = Compute("$frac-$a*y"); +$comp = "<"; +$right = Compute("$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); +Context()->variables->are(y=>"Real"); +$setans = Compute("{ y | y > -($critNum/$critDen)}"); +$alt = Compute("{ y | -($critNum/$critDen) < y}"); +$ans = OneOf($setans, $alt); +$ansLatexString = "\left\{ y \mid y > ".$crit->TeX."\right\}"; + +Context("Interval"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); +$intans = Compute("($crit,inf)"); +$intansLatexString = "\left(".$crit->TeX.",\infty\right)"; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans->cmp(correct_ans_latex_string=>$ansLatexString)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans->cmp(correct_ans_latex_string=>$intansLatexString)}. + + +END_PGML + +############################################## + +$step1 = $den*$a; +$step2 = $den*$b; +$step3 = $step2-$num; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{[$num]}{[$den]} -[$a]y &< [$b] \\ +[$den] \cdot \left(\frac{[$num]}{[$den]} - [$a]y\right) &< [$den] \cdot [$b] \\ + [$den] \cdot \frac{[$num]}{[$den]} - [$den] \cdot [$a]y &< [$den] \cdot [$b] \\ + [$num] -[$step1]y &< [$step2] \\ + [$num]-[$step1]y\mathbf{{} -[$num]} &< [$step2]\mathbf{{} -[$num]} \\ + -[$step1]y &<[$step3] \\ + \frac{-[$step1]y}{-[$step1]} &< \frac{[$step3]}{-[$step1]} \\ + y &< -\frac{[$critNum]}{[$critDen]} +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`\left(-\frac{[$critNum]}{[$critDen]},\infty\right)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction30.pg new file mode 100644 index 0000000000..50dfe1569b --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction30.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like (-a/b)x > (c/d)x - e +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','negative','multiply','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->variables->are(t=>"Real"); + + +$den1 = random(3,7,2); +$num1 = random(2,6,2); +while (gcd($den1,$num1)!=1) {$num1=random(2,6,2);} + +$den2 = random(2,6,2); +$num2 = random(1,5,2); +while (gcd($den2,$num2)!=1) {$num2=random(1,5,2);} + +$com=lcm($den1,$den2); +$ans = $com*list_random((1,2,3)); +$a= $num1*$ans/$den1+$num2*$ans/$den2; +while ($a==0) { + $ans = $com*list_random((1,2,3)); + $a= $num1*$ans/$den1+$num2*$ans/$den2; +} + +$frac1=Fraction($num1,$den1); +$frac2=Fraction($num2,$den2); + +$left = Compute("-$frac2*t"); +$comp = ">"; +$right = Compute("$frac1*t - $a"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(t=>"Real"); + +$setans = Compute("{ t | t< $ans}"); +$alt = Compute("{ t | $ans > t}"); +$options = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$ans)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $num1*$com/$den1; +$step2 = $num2*$com/$den2; +$step3 = $com*$a; +$step4 = $step2+$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -\frac{[$num2]}{[$den2]}t &> \frac{[$num1]}{[$den1]}t - [$a] \\ +[$com] \cdot \left(-\frac{[$num2]}{[$den2]}t\right) &> [$com] \cdot \left(\frac{[$num1]}{[$den1]}t - [$a]\right) \\ + [$com] \cdot \left(-\frac{[$num2]}{[$den2]}t\right) &> [$com] \cdot \frac{[$num1]}{[$den1]}t - [$com] \cdot [$a] \\ + -[$step2]t &> [$step1]t - [$step3] \\ + -[$step2]t\mathbf{{} -[$step1]t} &> [$step1]t - [$step3]\mathbf{{} -[$step1]t} \\ + -[$step4]t &> -[$step3] \\ + \frac{-[$step4]t}{-[$step4]} &> \frac{-[$step3]}{-[$step4]} \\ + t &< [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction40.pg new file mode 100644 index 0000000000..ebeeff63de --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction40.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a/b >= x/c +# +# Last updated: Jordan 10/25/13, Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den1 = random(2,10,2); +$num1 = random(3,9,2); +while (gcd($den1,$num1)!=1) {$num1 = random(3,9,2);} + +$den2 = $den1*random(2,6,1); +$ans = $den2*$num1/$den1; + +Context()->flags->set(reduceConstants=>0); +$left = Formula("$num1/$den1"); +$comp = "\geq"; +$right = Formula("x/$den2"); + + + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x<= $ans}"); +$alt = Compute("{ x | $ans >= x}"); +$options = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$ans]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{[$num1]}{[$den1]} & \geq \frac{x}{[$den2]} \\ + [$den2] \cdot \frac{[$num1]}{[$den1]} & \geq [$den2] \cdot \frac{x}{[$den2]} \\ + [$ans] & \geq x\\ + x & \leq [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction50.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction50.pg new file mode 100644 index 0000000000..fa4caa3ea6 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction50.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -x/a < -b/c +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','negative','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den1 = random(2,10,2); +$num1 = random(3,9,2); +while (gcd($den1,$num1)!=1) {$num1 = random(3,9,2);} + +$den2 = $den1*random(2,6,1); +$ans = $den2*$num1/$den1; + +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(z=>'Real'); +$left = Formula("-(z/$den2)"); +$comp = "<"; +$right = Formula("-($num1/$den1)"); + + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(z=>'Real'); + +$setans = Compute("{ z | z> $ans}"); +$alt = Compute("{ z | $ans < z}"); +$options = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($ans,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -\frac{z}{[$den2]} &< -\frac{[$num1]}{[$den1]} \\ + (-1) \cdot \left(-\frac{z}{[$den2]}\right) &> (-1) \cdot \left(-\frac{[$num1]}{[$den1]}\right) \\ + \frac{z}{[$den2]} &> \frac{[$num1]}{[$den1]} \\ + [$den2] \cdot \frac{z}{[$den2]} &> [$den2] \cdot \frac{[$num1]}{[$den1]} \\ + z &> [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction60.pg new file mode 100644 index 0000000000..24248eb3da --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction60.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like x/a -b <= x/c +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','add','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den1 = random(3,7,2); +$den2 = random($den1+2,10,1); +$com = lcm($den1,$den2); + +$ans = $com*list_random((1,2,3)); +$a= $ans/$den1-$ans/$den2; + +Context()->flags->set(reduceConstants=>0); +$left = Formula("x/$den2-$a"); +$comp = "\leq"; +$right = Formula("x/$den1"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x>= -$ans}"); +$alt = Compute("{ x | -$ans <= x}"); +$options = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[-$ans,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$s1 = $com*$a; +$s2 = $com/$den1; +$s3 = $com/$den2; +$s4 = $s2-$s3; + +$s3x = Formula("$s3 x")->reduce; +$s4x = Formula("$s4 x")->reduce; + +$solnString = ''; +if ($s4 != 1) +{$solnString = "\frac{-$s1}{$s4} & \leq \frac{$s4 x}{$s4} \\ + -$ans & \leq x\\";}; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{x}{[$den2]} - [$a] & \leq \frac{x}{[$den1]} \\ + [$com] \cdot \left(\frac{x}{[$den2]} - [$a]\right) & \leq [$com] \cdot \frac{x}{[$den1]} \\ +[$com] \cdot \frac{x}{[$den2]} - [$com] \cdot [$a] & \leq [$com] \cdot \frac{x}{[$den1]} \\ + [$s3x] - [$s1] & \leq [$s2]x \\ + [$s3x] - [$s1]\mathbf{{}-[$s3x]} & \leq [$s2]x\mathbf{{}-[$s3x]} \\ + -[$s1] & \leq [$s4x] \\ +[$solnString]* x & \geq -[$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction70.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction70.pg new file mode 100644 index 0000000000..2fc2202e66 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction70.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like (x-a)/b >= (x+c)/d +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','add','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den2 = random(2,6,2); +$den1 = $den2+2; +$num1 = random(1,10,1); +$num2 = random(1,10,1); + +$ans = (-$num1*$den2-$den2*$num2-2*$num2)/2; +$com = lcm($den1,$den2); + +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(y=>'Real'); +$left = Formula("(y-$num1)/$den1"); +$comp = "\geq"; +$right = Formula("(y+$num2)/$den2"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(y=>'Real'); + +$setans = Compute("{ y | y<= $ans}"); +$alt = Compute("{ y | $ans >= y}"); +$options = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$ans]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$s1 = $com/$den1; +$s2 = $com/$den2; +$s3 = $s1*$num1; +$s4 = $s2*$num2; +$s5 = $s2-$s1; +$s6 = $s3+$s4; + +Context()->variables->are(y=>'Real'); +$s5y = Formula("$s5 y")->reduce; + +$solnString = ''; +if ($s5 != 1) +{ $solnString = " -$s6 & \geq $s5y \\ \frac{-$s6}{$s5} & \geq \frac{$s5y}{$s5} \\"}; + +$s7 = Compute("$s1*(y-$num1)")->reduce; +$s8 = Compute("$s2*(y+$num2)")->reduce; +$s9 = Compute("$s1*y")->reduce; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{y-[$num1]}{[$den1]} & \geq \frac{y+[$num2]}{[$den2]} \\ + [$com] \cdot \frac{y-[$num1]}{[$den1]} & \geq [$com] \cdot \frac{y+[$num2]}{[$den2]} \\ + [$s7] & \geq [$s8] \\ + [$s9] - [$s3] & \geq [$s2]y+[$s4] \\ + [$s9] - [$s3]\mathbf{{} -[$s9]-[$s4]} & \geq [$s2]y+[$s4]\mathbf{{} -[$s9]-[$s4]} \\ [$solnstring]* + [$ans] & \geq y\\ + y & \leq [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction80.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction80.pg new file mode 100644 index 0000000000..4ed5ccc6f9 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction80.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a/b < (x+c)/d - (x-e)/f +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','combine','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den1 = random(2,6,2); +$den2 = $den1*2; +$num1 = random(1,10,1); +$num2 = random(1,10,1); + +$ans = non_zero_random(-10,10,1); +Context("Fraction"); +$frac = Fraction($ans+2*$num1+$num2,2*$den1)->reduce; +@fract = $frac->value; +$num3 = $fract[0]; +$den3 = $fract[1]; +while ($den3==1) { + $ans = random(-10,10,1); + Context("Fraction"); + $frac = Fraction($ans+2*$num1+$num2,2*$den1)->reduce; + @fract = $frac->value; + $num3 = $fract[0]; + $den3 = $fract[1]; +} + +$com = lcm(lcm($den1,$den2),$den3); + +Context()->flags->set(reduceConstants=>0); +$left = Formula("$num3/$den3"); +$comp = "<"; +$right = Formula("(x+$num1)/$den1-(x-$num2)/$den2"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x> $ans}"); +$alt = Compute("{ x | $ans < x}"); +$options = OneOf($setans, $alt); + + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($ans,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$s1 = $com/$den1; +$s2 = $com/$den2; +$s3 = $com*$num3/$den3; +$s4 = $s1*$num1; +$s5 = $s2*$num2; +$s7 = $s4+$s5; + +$s9 = Compute("$s2*x")->reduce; + +$s8 = Compute("-$s2*(x-$num2)")->reduce; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{[$num3]}{[$den3]} &< \frac{x+[$num1]}{[$den1]} - \frac{x-[$num2]}{[$den2]} \\ + [$com] \cdot \frac{[$num3]}{[$den3]} &< [$com] \cdot \frac{x+[$num1]}{[$den1]} - [$com] \cdot \frac{x-[$num2]}{[$den2]} \\ + [$s3] &<[$s1](x+[$num1]) [$s8] \\ + [$s3] &< [$s1]x+[$s4] - [$s9] + [$s5] \\ + [$s3] &< x + [$s7] \\ + [$s3]\mathbf{{} -[$s7]} &< x + [$s7]\mathbf{{} -[$s7]} \\ + [$ans] &< x \\ + x & > [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality10.pg new file mode 100644 index 0000000000..9e62c2b048 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality10.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in interval notation. +# There is no solution. +# +# Last updated: Jordan 7/28/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserOneOf.pl", #needed if the answer is "all real numbers" or "(-inf, inf)", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(1,9,1); + +$ans = Compute('no solution'); +#$ans = OneOf("(-inf,inf), all real numbers"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` [$a]x > [$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + [$a]x &> [$a]x +[$b] \\ + [$a]x \mathbf{{} -[$a]x} &> [$a]x +[$b]\mathbf{{} -[$a]x} \\ + 0 &> [$b] +\end{aligned} +`] + +Since [`0>[$b]`] is false no matter what the value of [`x`] is, this inequality has *no solution*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality20.pg new file mode 100644 index 0000000000..01a208dfe6 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality20.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# There is no solution. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','add','no solution') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +# solve inequality with no solutions +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(-10,-1,1); + +$ans = Compute("no solution"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` -[$a]x \leq -[$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -[$a]x & \leq -[$a]x {}+[$b] \\ + -[$a]x\mathbf{{}+[$a]x} & \leq -[$a]x {}+[$b]\mathbf{{}+[$a]x} \\ + 0 & \leq [$b] +\end{aligned} +`] + +Since [`0 \leq [$b]`] is false, this inequality has *no solution*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality30.pg new file mode 100644 index 0000000000..08f6f8dd62 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality30.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The solution set is "all real numbers". +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','combine','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +# solve inequality with no solutions + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(1,10,1); +$c=random(1,10,1); +$d=$b+$c; + +$ans = OneOf("(-inf,inf), all real numbers"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` -[$c]+[$a]x+[$d] \geq [$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -[$c]+[$a]x+[$d] &\geq [$a]x+[$b] \\ + [$a]x+[$b] &\geq [$a]x+[$b] \\ + [$a]x+[$b] \mathbf{{}-[$a]x-[$b]}&\geq [$a]x+[$b]\mathbf{{}-[$a]x-[$b]} \\ + 0 & \geq 0 +\end{aligned} +`] + +Since [`0 \geq 0`] is true, the solution set for this inequality is *all real numbers*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality40.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality40.pg new file mode 100644 index 0000000000..94f3afed86 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality40.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# There is no solution. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(1,10,1); +$c=random(1,10,1); +$d=$b+$c; + +$ans = Compute("no solution"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` -[$c]+[$a]x+[$d] < [$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -[$c]+[$a]x+[$d] &< [$a]x+[$b] \\ + [$a]x+[$b] &< [$a]x+[$b] \\ + [$a]x+[$b]\mathbf{{} -[$a]x-[$b]} &< [$a]x+[$b]\mathbf{{} -[$a]x-[$b]} \\ + 0 & < 0 +\end{aligned} +`] + +Since [`0 < 0`] is not true, this inequality has *no solution*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality50.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality50.pg new file mode 100644 index 0000000000..a22b6c01c2 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality50.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# There is no solution. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','combine','no solution') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(5,10,1); +$b=random(5,10,1); +$c=random(1,$a,1); +$e=random(-$a+$c+1,20,1); +$f=$b-1; + +$ans = Compute("no solution"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` -[$a]-[$b]z+[$c] > -z+[$e]-[$f]z ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +$s1 = abs(-$a+$c); +$s2 = $e+$s1; + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -[$a]-[$b]z+[$c] &> -z+[$e]-[$f]z \\ + (-[$a]+[$c])-[$b]z &> (-1-[$f])z+[$e] \\ + (-[$a]+[$c])-[$b]z &> (-1-[$f])z+[$e] \\ + -[$s1] -[$b]z &> -[$b]z+[$e] \\ + -[$s1]-[$b]z\mathbf{{}+[$b]z+[$s1]} &> -[$b]z+[$e]\mathbf{{}+[$b]z+[$s1]} \\ + 0 &> [$s2] +\end{aligned} +`] + +Since [`0 > [$s2] `] is not true, this inequality has *no solution*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality60.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality60.pg new file mode 100644 index 0000000000..f63cfbe55d --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality60.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The solution set is "all real numbers". +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,5,1); +$b=random(1,9,1); +$c=random(2,10,2); +$d=random(2,10,2); +$e=random(1,10,1); + +$h=random(1,10,1); +$i=($a*$c+$d)/2; +$f=random(1,20,1); +#make sure the solution is "all real numbers" +while ($f>=$a*$b+$e+2*$h) {$f=random(1,20,1);} + +$ans = OneOf("(-inf,inf), all real numbers"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` [$a]([$b]-[$c]m)-([$d]m-[$e]) > [$f]-2([$h]+[$i]m) ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +$s1=$a*$b; +$s2=$a*$c; +$s3=2*$h; +$s4=2*$i; +$s5=$s1+$e; +$s6=$s2+$d; +$s7=$f-$s3; +$s8=$s5-$s7; + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + [$a]([$b]-[$c]m)-([$d]m-[$e]) &> [$f]-2([$h]+[$i]m) \\ + [$a]([$b]+(-[$c]m))+ (-1) \cdot ([$d]m+(-[$e])) &> [$f]+(-2) \cdot ([$h]+[$i]m) \\ + [$a] \cdot [$b]+ [$a] \cdot (-[$c]m)+ (-1) \cdot [$d]m+ (-1) \cdot(-[$e]) &\> [$f]+(-2) \cdot [$h]+(-2) \cdot [$i]m \\ + [$s1] - [$s2]m -[$d]m+ [$e] &> [$f]-[$s3]-[$s4]m \\ + [$s1]+ [$e] +(- [$s2] -[$d])m &> ([$f]-[$s3])-[$s4]m \\ + [$s5] -[$s6]m &> [$s7]-[$s4]m \\ + [$s5] -[$s6]m\mathbf{{} -[$s7]+[$s6]m} &> [$s7]-[$s4]m\mathbf{{} -[$s7]+[$s6]m} \\ + [$s8] &> 0 +\end{aligned} +`] + +Since [`[$s8] > 0 `] is true, the solution set for this inequality is *all real numbers*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality70.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality70.pg new file mode 100644 index 0000000000..75a4d7a962 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality70.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The solution set is "all real numbers". +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','no solution') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(5,10,1); +$c=random(1,4,1); + +$ans = OneOf("(-inf,inf), all real numbers"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` [$a](k-[$b]) \leq [$a](k-[$c]) ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +$s1=$a*$b; +$s2=$a*$c; +$s3=$s1-$s2; + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + [$a](k-[$b]) & \leq [$a](k-[$c]) \\ + [$a]k-[$a] \cdot [$b] & \leq [$a]k-[$a] \cdot [$c] \\ + [$a]k-[$s1] & \leq [$a]k-[$s2] \\ + [$a]k-[$s1]\mathbf{{} -[$a]k+[$s1]} & \leq [$a]k-[$s2]\mathbf{{} -[$a]k+[$s1]} \\ + 0 & \leq [$s3] +\end{aligned} +`] + +Since [`0 \leq [$s3]`] is true, the solution set for this inequality is *all real numbers*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality80.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality80.pg new file mode 100644 index 0000000000..9b66817bf4 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality80.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The solution set is "all real numbers". +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','all real numbers') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(1,9,1); + +$ans = OneOf("(-inf,inf), all real numbers"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` [$a]x \leq [$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + [$a]x & \leq [$a]x +[$b] \\ + [$a]x \mathbf{{} -[$a]x} & \leq [$a]x +[$b]\mathbf{{} -[$a]x} \\ + 0 & \leq [$b] +\end{aligned} +`] + +Since [`0 \leq [$b]`] is true, the solution set for this inequality is *all real numbers*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph10.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph10.pg new file mode 100644 index 0000000000..1ff8a1a60e --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph10.pg @@ -0,0 +1,204 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context('Numeric'); + +do { + $numerator = random(1,5,1); + $denominator = random(1,5,1); + $h = non_zero_random(-6,6,1); + do {$k = non_zero_random(-6,6,1);} until ($h != $k); + $m = $numerator/$denominator*$h*$k/abs($h*$k); + $k2 = ($k > 0) ? $k - $numerator : $k + $numerator; + $h2 = ($k2-$k)/$m+$h; +} until ($k2 != $h2); + +@k = num_sort($k,$k2); +@h = num_sort($h,$h2); +$f = Formula("$m*(x - $h)+$k")->reduce; + +@gr = ( ); +@xvalues = num_sort(-7,7,(7-$k)/$m+$h,(-7-$k)/$m+$h); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i]->lb('reset'); + for $j (-6..6){ + if ($j==0 or $j%2!=0) {next;} + $gr[$i]->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i]->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + $gr[$i]->moveTo($h,$k); + $gr[$i]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'blue',1); + $gr[$i]->moveTo($h,$k); + $gr[$i]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'blue',1); +} + +$alt[0] = "This is the graph of a straight line which passes the points ($h,$k) and ($h2,$k2)."; + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +$i0 = random(0,3,1); +if (random(0,1,1)==0) { + $i1 = 0; + $i2 = 1; +} else { + $i1 = 1; + $i2 = 0; +} +$symbol0 = $symbols[$i0]; +$symbol1 = $symbols[$i1]; +$symbol2 = $symbols[$i2]; + +@leftBrackets = ('(','['); +@rightBrackets = (')',']'); + +@ans = ( ); + +$gr[1]->moveTo($h,$k); +if ($m > 0) { + if ($i0 == 0) { + $ans[0] = Interval("(-inf,$h)"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is open."; + } elsif ($i0 == 1) { + $ans[0] = Interval("(-inf,$h]"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is closed."; + } elsif ($i0 == 2) { + $ans[0] = Interval("($h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is open."; + } else { + $ans[0] = Interval("[$h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is closed."; + } +} else { + if ($i0 == 0) { + $ans[0] = Interval("($h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is open."; + } elsif ($i0 == 1) { + $ans[0] = Interval("[$h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is closed."; + } elsif ($i0 == 2) { + $ans[0] = Interval("(-inf,$h)"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is open."; + } else { + $ans[0] = Interval("(-inf,$h]"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is closed."; + } +} + +$y0 = $f->eval(x=>$h[0]); +$y1 = $f->eval(x=>$h[1]); +$ans[1] = Interval("$leftBrackets[$i2] $h[0],$h[1] $rightBrackets[$i1]"); +$gr[2]->moveTo($h[0],$y0); +$gr[2]->lineTo($h[1],$y1,'red',1); +$alt[2] = $alt[0]." The segment from ($h[0],$y0) to ($h[1],$y1) is highlighted in red."; +if ($i1==1) { + $gr[2]->stamps( open_circle($h[0],$y0,'red') ); + $alt[2] .= " The point ($h[0],$y1) is open,"; +} else { + $gr[2]->stamps( closed_circle($h[0],$y0,'red') ); + $alt[2] .= " The point ($h[0],$y0) is closed,"; +} +if ($i2==1) { + $gr[2]->stamps( open_circle($h[1],$y1,'red') ); + $alt[2] .= " and the point ($h[1],$y1) is open."; +} else { + $gr[2]->stamps( closed_circle($h[1],$y1,'red') ); + $alt[2] .= " and the point ($h[1],$y1) is closed."; +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbols[$i0]] [$k]`] + + [__________]{$ans[0]} + +1. [`[$k[0]] [$symbols[$i1]] f(x) [$symbols[$i2]] [$k[1]]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + + + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbols[$i0]] [$k]`], the function's [`y`]-value must be [$words[$i0]] [`[$k]`]. The corresponding segment is highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`[$k[0]] [$symbols[$i1]] f(x) [$symbols[$i2]] [$k[1]]`], the function's [`y`]-value must be between [`[$k[0]]`] and [`[$k[1]]`]. The corresponding segment is highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph20.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph20.pg new file mode 100644 index 0000000000..e82945ef36 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph20.pg @@ -0,0 +1,230 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ + + +Context('Numeric'); +$h = random(-4,4,1); +$k = random(-4,4,1); +$x = ($h < 0) ? random(-6,$h-1,1) : random($h+1,6,1); +$y = ($k < 0) ? random($k+1,6,1) : random(-6,$k-1,1); +$c = ($y-$k)/($x - $h)**2; +$f = Formula("$c*(x-$h)^2+$k"); + +@gr = (); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i]->lb('reset'); + for $j (-6..6){ + if (Real($j)==0) {next;} + $gr[$i]->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i]->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + $yexit = ($c < 0) ? -7 : 7; + @xvalues = num_sort(-7,7,sqrt(($yexit-$k)/$c)+$h,-sqrt(($yexit-$k)/$c)+$h); + add_functions($gr[$i], "$f for x in <$xvalues[1],$xvalues[2]> using color:blue and weight:1"); + $px = 14/240; + + $gr[$i]->moveTo($xvalues[1]+$px,$c*($xvalues[1]+$px-$h)**2+$k); + $gr[$i]->arrowTo($xvalues[1],$c*($xvalues[1]-$h)**2+$k,'blue',1); + $gr[$i]->moveTo($xvalues[2]-$px,$c*($xvalues[2]-$px-$h)**2+$k); + $gr[$i]->arrowTo($xvalues[2],$c*($xvalues[2]-$h)**2+$k,'blue',1); +} + +@x = num_sort($x,2*$h-$x); + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +@in = (); +if (random(0,1,1)==0) { + $in[0] = random(0,1,1); + $in[1] = random(2,3,1); +} else { + $in[0] = random(2,3,1); + $in[1] = random(0,1,1); +} +$symbol0 = $symbols[$in[0]]; +$symbol1 = $symbols[$in[1]]; + +@alt = ( ); +$uod = $c > 0 ? 'upward' : 'downward'; +$alt[0] = "This is the graph of a parabola with its vertex at ($h,$k). The parabola faces $uod. It passes the points ($x[0],$y) and ($x[1],$y)."; + +@s0 = ( + " Those two points are open.", + " Those two points are closed." +); + +@s1 = ( + " On the parabola, the segment between x=$x[0] to x=$x[1] are highlighted.", + " On the parabola, the segment from negative infinity to x=$x[0], and the segment from x=$x[1] to infinity are highlighted.", +); + +@s2 = ( + Interval("($x[0],$x[1])"), + Interval("[$x[0],$x[1]]"), + Union("(-inf,$x[0])U($x[1],inf)"), + Union("(-inf,$x[0]]U[$x[1],inf)"), +); + +sub graphOpenDots { + my $p = shift; + $gr[$p]->stamps( open_circle($x[0],$y,'red') ); + $gr[$p]->stamps( open_circle($x[1],$y,'red') ); +} + +sub graphClosedDots { + my $p = shift; + $gr[$p]->stamps( closed_circle($x[0],$y,'red') ); + $gr[$p]->stamps( closed_circle($x[1],$y,'red') ); +} + +sub highlightBetween { + my $p = shift; + add_functions($gr[$p], "$f for x in <$x[0],$x[1]> using color:red and weight:1"); +} + +sub highlightEnds { + my $p = shift; + add_functions($gr[$p], "$f for x in <$xvalues[1],$x[0]> using color:red and weight:1"); + add_functions($gr[$p], "$f for x in <$x[1],$xvalues[2]> using color:red and weight:1"); + $px = 14/240; + $gr[$p]->moveTo($xvalues[1]+$px,$c*($xvalues[1]+$px-$h)**2+$k); + $gr[$p]->arrowTo($xvalues[1],$c*($xvalues[1]-$h)**2+$k,'red',1); + $gr[$p]->moveTo($xvalues[2]-$px,$c*($xvalues[2]-$px-$h)**2+$k); + $gr[$p]->arrowTo($xvalues[2],$c*($xvalues[2]-$h)**2+$k,'red',1); +} + +$alt[1] .= $alt[0]; +$alt[2] .= $alt[0]; +@ans = (); +for my $i (0..1) { + if ($in[$i]==0) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } else { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } + &graphOpenDots($i+1); + } elsif ($in[$i]==1) { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } else { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } + &graphClosedDots($i+1); + } elsif ($in[$i]==2) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } else { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } + &graphOpenDots($i+1); + } else { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } else { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } + &graphClosedDots($i+1); + } +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbol0] [$y]`] + + [__________]{$ans[0]} + +1. [`f(x) [$symbol1] [$y]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbol0] [$y]`], the function's [`y`]-value must be [$words[$in[0]]] [`[$y]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`f(x) [$symbol1] [$y]`], the function's [`y`]-value must be [$words[$in[1]]] [`[$y]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph30.pg b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph30.pg new file mode 100644 index 0000000000..6dfa2465bc --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph30.pg @@ -0,0 +1,241 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context('Numeric'); + +$s = Real(random(-3,3,1)); +$r = $s - random(1,3,1); +$t = $s + random(2,3,1); + +$f = Formula("(x-$r)(x-$s)(x-$t)"); +@hts = map{abs($f->eval(x=>$_))}($r..$t); +$amplitude = random(1,3,1); +$c = $amplitude/max(@hts)*random(-1,1,2); +$k = random(1,6-$amplitude,1)*random(-1,1,2); +$f = $c*$f+$k; + +@gr = (); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i] ->lb('reset'); + for $j (-6..6){ + if (Real($j)==0) {next;} + $gr[$i] ->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i] ->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + + $start = $r; + while (abs($f->eval(x=>$start-0.1))<7 and $start > -7) {$start = $start - 0.1}; + $stop = $t; + while (abs($f->eval(x=>$stop+0.1))<7 and $stop < 7) {$stop = $stop + 0.1}; + + add_functions($gr[$i] , "$f for x in <$start,$stop> using color:blue and weight:1"); + $px = 14/240; + $gr[$i] ->moveTo($start+$px,$f->eval(x=>$start+$px)); + $gr[$i] ->arrowTo($start,$f->eval(x=>$start),'blue',1); + $gr[$i] ->moveTo($stop-$px,$f->eval(x=>$stop-$px)); + $gr[$i] ->arrowTo($stop,$f->eval(x=>$stop),'blue',1); +} + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +@in = (); +if (random(0,1,1)==0) { + $in[0] = random(0,1,1); + $in[1] = random(2,3,1); +} else { + $in[0] = random(2,3,1); + $in[1] = random(0,1,1); +} +$symbol0 = $symbols[$in[0]]; +$symbol1 = $symbols[$in[1]]; + +@alt = ( ); +$startL = $c > 0 ? 'negative infinity' : 'positive infinity'; +$endR = $c > 0 ? 'positive infinity' : 'negative infinity'; +$uod0 = $c > 0 ? 'up' : 'down'; +$uod1 = $c > 0 ? 'down' : 'up'; +$alt[0] = "This is the graph of a cubic function which starts at $startL as x-value approaches negative infinity, going $uod0 through the point ($r,$k), curving $uod1 to pass ($s,$k), curving $uod0 to pass ($t,$k), and finally approaching $endR as x-value approaches positive infinity."; + +@s0 = ( + " Those three points are open.", + " Those three points are closed." +); + +@s1 = ( + " On the function, the segment between infinity and x=$r, and the segment from to x=$s to x=$t are highlighted.", + " On the function, the segment from x=$r and x=$s, and the segment from x=$t to infinity are highlighted.", +); + +@s2 = ( + Union("(-inf,$r)U($s,$t)"), + Union("(-inf,$r]U[$s,$t]"), + Union("($r,$s)U($t,inf)"), + Union("[$r,$s]U[$t,inf)"), +); + +sub graphOpenDots { + my $p = shift; + $gr[$p]->stamps( open_circle($r,$k,'red') ); + $gr[$p]->stamps( open_circle($s,$k,'red') ); + $gr[$p]->stamps( open_circle($t,$k,'red') ); +} + +sub graphClosedDots { + my $p = shift; + $gr[$p]->stamps( closed_circle($r,$k,'red') ); + $gr[$p]->stamps( closed_circle($s,$k,'red') ); + $gr[$p]->stamps( closed_circle($t,$k,'red') ); +} + +sub highlightLeft { + my $p = shift; + add_functions($gr[$p] , "$f for x in <$start,$r> using color:red and weight:1"); + add_functions($gr[$p] , "$f for x in <$s,$t> using color:red and weight:1"); + $px = 14/240; + $gr[$p] ->moveTo($start+$px,$f->eval(x=>$start+$px)); + $gr[$p] ->arrowTo($start,$f->eval(x=>$start),'red',1); +} + +sub highlightRight { + my $p = shift; + add_functions($gr[$p] , "$f for x in <$r,$s> using color:red and weight:1"); + add_functions($gr[$p] , "$f for x in <$t,$stop> using color:red and weight:1"); + $px = 14/240; + $gr[$p] ->moveTo($stop-$px,$f->eval(x=>$stop-$px)); + $gr[$p] ->arrowTo($stop,$f->eval(x=>$stop),'red',1); +} + +$alt[1] .= $alt[0]; +$alt[2] .= $alt[0]; +@ans = (); +for my $i (0..1) { + if ($in[$i]==0) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } else { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } + &graphOpenDots($i+1); + } elsif ($in[$i]==1) { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } else { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } + &graphClosedDots($i+1); + } elsif ($in[$i]==2) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } else { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } + &graphOpenDots($i+1); + } else { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } else { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } + &graphClosedDots($i+1); + } +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbol0] [$k]`] + + [__________]{$ans[0]} + +1. [`f(x) [$symbol1] [$k]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbol0] [$k]`], the function's [`y`]-value must be [$words[$in[0]]] [`[$k]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`f(x) [$symbol1] [$k]`], the function's [`y`]-value must be [$words[$in[1]]] [`[$k]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine10.pg b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine10.pg index 77e6e42a92..5988dfcda1 100644 --- a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine10.pg +++ b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine10.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); diff --git a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine20.pg b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine20.pg index 5d39bad590..54b008fbd2 100644 --- a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine20.pg +++ b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine20.pg @@ -36,7 +36,7 @@ loadMacros( ); ############################################## -$refreshCachedImages = 1; + Context("Numeric"); $a=random(-9.5,-2.5,1); diff --git a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine30.pg b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine30.pg index 25f7ead3d8..2a52bd5f17 100644 --- a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine30.pg +++ b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine30.pg @@ -37,7 +37,7 @@ loadMacros( ); ############################################## -$refreshCachedImages = 1; + Context("Fraction"); $a=Fraction(random(-33,-13,4),4); diff --git a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine40.pg b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine40.pg index 50f757525c..3b29d06866 100644 --- a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine40.pg +++ b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine40.pg @@ -37,7 +37,7 @@ loadMacros( ); ############################################## -$refreshCachedImages=1; + Context("Fraction"); $a=Fraction(random(15,31,4),4); diff --git a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine50.pg b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine50.pg index 95289a3be9..1f655075e9 100644 --- a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine50.pg +++ b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine50.pg @@ -36,7 +36,7 @@ loadMacros( ); ############################################## -$refreshCachedImages=1; + Context("Numeric"); $a=random(3.4,7.4,1); diff --git a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine60.pg b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine60.pg index 03743ccbb5..b2fae6d806 100644 --- a/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine60.pg +++ b/Contrib/PCC/BasicAlgebra/NumberBasics/NumberLine60.pg @@ -36,7 +36,7 @@ loadMacros( ); ############################################## -$refreshCachedImages=1; + Context("Numeric"); $n = list_random(2,3,5,6,7,8,10,11,12,13,14,15); diff --git a/Contrib/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg b/Contrib/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg index 05e3d2c4cd..a64c099daf 100644 --- a/Contrib/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg +++ b/Contrib/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg @@ -53,7 +53,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write the following percentages as decimals. +Write the following decimals as percentages. a. [`` [$a] = ``] [_____]{$ans1} diff --git a/Contrib/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg b/Contrib/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg index 464f363114..09ec5ef1c1 100644 --- a/Contrib/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg +++ b/Contrib/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg @@ -53,7 +53,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write the following decimals as percentages. +Write the following percentages as decimals. a. [`` [$d]% = ``] [_______]{$ans1} diff --git a/Contrib/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract50.pg b/Contrib/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract50.pg index eef7ff80a6..6742081841 100644 --- a/Contrib/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract50.pg +++ b/Contrib/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract50.pg @@ -147,7 +147,7 @@ We combine like terms as follows [` \begin{aligned} - &{\phantom{{}=}\left([$poly1]\right)+\left([$poly2]\right) \\ + &\phantom{{}=}\left([$poly1]\right)+\left([$poly2]\right) \\ & = ([$aOut]+[$eOut])+[$bOut]+[$fOut]+[$cOut]+([$d]+[$gOut])\\ & = [$ans] \end{aligned} diff --git a/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25testing.pg b/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25testing.pg index 4377f229c5..f962985214 100644 --- a/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25testing.pg +++ b/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25testing.pg @@ -99,7 +99,7 @@ END_PGML # the Generic Rectangle Method # -$refreshCachedImages = 1; + # This subroutine fills empty terms in the parameter array like ['x',2,1,0] # with 1 if the variable is missing, and diff --git a/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication30.pg b/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication30.pg index c7dcc86560..557cda3290 100644 --- a/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication30.pg +++ b/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication30.pg @@ -76,7 +76,7 @@ The trapezoid's height is [`h`] feet. Since the trapezoid's top base is [`[$a]`] A &= \frac{1}{2}(a+b)h \\ &= \frac{1}{2}(h+[$a]+h+[$b])h \\ &= \frac{1}{2}h(2h+[$a+$b]) \\ - &= \frac{1}{2}2h^2+\frac{1}{2}[$a+$b] \\ + &= \frac{1}{2}2h^2+\frac{1}{2}[$a+$b]h \\ &= [$ans] \end{aligned} ``] diff --git a/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar145.pg b/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar145.pg index 7e58e49e11..1215b436dd 100644 --- a/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar145.pg +++ b/Contrib/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar145.pg @@ -84,9 +84,7 @@ BEGIN_PGML Multiply the polynomials. - [`` - ([$poly1])([$poly2]) = -``][____________________________]{$ans} + [``([$poly1])([$poly2]) = ``][____________________________]{$ans} END_PGML diff --git a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem10.pg b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem10.pg index 7233103403..a83fd97c0c 100644 --- a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem10.pg +++ b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem10.pg @@ -205,7 +205,7 @@ Find the value of [`x`]. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By the Pythagorean Theorem, we have: diff --git a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem20.pg b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem20.pg index ce7b4af864..6bbebf1b82 100644 --- a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem20.pg +++ b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem20.pg @@ -204,7 +204,7 @@ Find the value of [`x`]. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By the Pythagorean Theorem, we have: diff --git a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem30.pg b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem30.pg index 60296a5a00..f99abf6636 100644 --- a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem30.pg +++ b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem30.pg @@ -190,7 +190,7 @@ Find the value of [`x`], accurate to at least two decimal places. END_PGML ############################################## -$refreshCachedImages = 1; + $ansShow = sprintf "%.2f", $ans; diff --git a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem40.pg b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem40.pg index 39f89edd2a..6adfe96f51 100644 --- a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem40.pg +++ b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem40.pg @@ -304,7 +304,7 @@ if ($corner==0) { $text = "This is a right triangle. Right angle C is at the $cPosition corner of the picture. Acute angle A is at the $aPosition, and acute angle B is at the $bPosition. The length of the side facing Angle A is $base; the length of the side facing Angle B is $height; the length of the side facing Angle C is x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem50.pg b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem50.pg index ed7f7fb5f6..5c4fc9bb34 100644 --- a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem50.pg +++ b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem50.pg @@ -307,7 +307,7 @@ if ($corner==0) { $text = "This is a right triangle. Right angle C is at the $cPosition corner of the picture. Acute angle A is at the $aPosition, and acute angle B is at the $bPosition. The length of the side facing Angle A is x (unknown); the length of the side facing Angle B is $height; the length of the side facing Angle C is $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem60.pg b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem60.pg index 02c07ff8ec..7c340d21f5 100644 --- a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem60.pg +++ b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem60.pg @@ -196,7 +196,7 @@ END_PGML $s1 = $hypotenuseLength**2/($ratioBase**2+$ratioHeight**2); $x = sqrt($s1); -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION We will draw a diagram for the garden. diff --git a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem70.pg b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem70.pg index 650e0720da..beaa1a0fc3 100644 --- a/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem70.pg +++ b/Contrib/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem70.pg @@ -196,7 +196,7 @@ $s1 = $ratioHypotenuse**2-$ratioHeight**2; $s2 = $baseLength**2/$s1; $x = sqrt($s2); -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION We will draw a diagram for the garden. diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg index df0ff2969c..5408f46efa 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp15.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp15.pg index d8021b1746..a27964db13 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp15.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp15.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg index a547f10a6e..3b40c034b1 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp25.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp25.pg index ab64910bf1..a4e3135764 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp25.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp25.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg index 55c1482140..51821d1efb 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); #Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg index fc92a44664..950c08454c 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg index 56bb8704b8..9dbe3e436f 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(w => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg index 23c0aef5d7..f998ec3808 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg @@ -43,7 +43,7 @@ loadMacros( $numPens = 2; TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(w => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg index 92650da5fd..7c8e0540c8 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg @@ -43,7 +43,7 @@ loadMacros( $numPens = 4; TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(w => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication60.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication60.pg index 027a3aefe7..0b83862550 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication60.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication60.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg index a8501ec638..8f059f52c3 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(w => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication60.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication60.pg index 7a814134bd..5e8bf1fcc8 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication60.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication60.pg @@ -39,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->noreduce("(-x)-y","(-x)+y"); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication70.pg b/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication70.pg index b8120185e6..2516ab1905 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication70.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication70.pg @@ -37,7 +37,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad100.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad100.pg index 153494a68e..6cffda2a48 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad100.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad100.pg @@ -32,6 +32,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", , "PGcourse.pl", @@ -71,12 +72,13 @@ $b = $a; $b = non_zero_random(-12,12,1) while($b==$a or $b==-$a); $soln1 = $a*-1; $soln2 = $b*-1; -$ans = List(Formula("$var=$soln1"),Formula("$var=$soln2")); $aPlusB = $a+$b; $ab = $a*$b; $question = Formula("$var**2+$aPlusB*$var+$ab")->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); ############################################## TEXT(beginproblem()); @@ -85,9 +87,9 @@ Solve the equation. [` [$question]= 0 `] - [__________________________________] + [__________________________________]{$ans} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -95,7 +97,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad105.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad105.pg index aed1716ad9..504da41319 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad105.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad105.pg @@ -33,8 +33,8 @@ loadMacros( "PGML.pl", "contextLimitedRadical.pl", "PCCmacros.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## @@ -81,6 +81,8 @@ $ab = $a*$b; $question = Formula("$var**2+$aPlusB*$var+$abPlusC")->reduce; $question1 = Formula("$var**2+$aPlusB*$var+$ab")->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); ############################################## TEXT(beginproblem()); @@ -89,9 +91,9 @@ Solve the equation. [` [$question]= [$c] `] - [__________________________________] + [__________________________________]{$ans} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -99,7 +101,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad110.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad110.pg index 7e9337af14..f13149d997 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad110.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad110.pg @@ -92,7 +92,7 @@ $triangle->lineTo(-0.45,-0.5+0.1,"darkblue",1); $triangle->lineTo(-0.5,-0.5+0.1,"darkblue",1); ############################################## -$refreshCachedImages=1; + TEXT(beginproblem()); BEGIN_TEXT diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad115.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad115.pg index 7e678e4015..428b736504 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad115.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad115.pg @@ -33,6 +33,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", "PGcourse.pl", ); @@ -77,6 +78,10 @@ $c = non_zero_random(-10,10,1); $d = -$c; $ans = List(Formula("$var=$d+$a sqrt($b)"),Formula("$var=$d-$a sqrt($b)")); +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$d+$a sqrt($b),$d-$a sqrt($b)}"); + ############################################## TEXT(beginproblem()); @@ -85,9 +90,10 @@ Solve the equation. [` ([$var]+[$c])^2 = [$a**2 * $b] `] - [_______________________] + [_______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -96,7 +102,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad160.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad160.pg index 8a053de240..c488994698 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad160.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad160.pg @@ -52,6 +52,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", , "PGcourse.pl", @@ -130,6 +131,8 @@ $questionFormula = Formula("$a*$var^2+$b*$var+$c")->reduce; $b1 = $b*-1; $a1 = 2*$a; +Context("FiniteSolutionSets"); + if($B==2*round($B/2)) { # B is even @@ -138,17 +141,18 @@ if($B==2*round($B/2)) # this check shouldn't really be necessary, but reduce seems to go too far if($d1==1) { - $ans = List(Formula("$var=$b1-sqrt($C)"),Formula("$var=$b1+sqrt($C)")); + $ans = Formula("{$b1-sqrt($C),$b1+sqrt($C)}"); } else { - $ans = List(Formula("$var=$b1-$d1*sqrt($C)"),Formula("$var=$b1+$d1*sqrt($C)")); + $ans = Formula("{$b1-$d1*sqrt($C),$b1+$d1*sqrt($C)}"); } } else { # B is odd $ans = List(Formula("$var=($b1-$D*sqrt($C))/$a1"),Formula("$var=($b1+$D*sqrt($C))/$a1")); + $ans = Formula("{($b1-$D*sqrt($C))/$a1,($b1+$D*sqrt($C))/$a1}"); } ############################################## TEXT(beginproblem()); @@ -157,9 +161,11 @@ Solve the equation. [` [$questionFormula]= 0 `] - [_____________________________] + [_____________________________]{$ans} + +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** + -[@KeyboardInstructions("Enter multiple answers separated by commas, like [|x=1, x=-1|]*. Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -168,7 +174,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad165.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad165.pg index cab2e1feb3..e5338cce61 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad165.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad165.pg @@ -26,6 +26,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", "PGcourse.pl", ); @@ -78,6 +79,9 @@ $frac1 = Fraction(-$b,$a); $frac2 = Fraction(-$d,$c); $ans = Compute("$var = $frac1, $var = $frac2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$frac1,$frac2}"); + ############################################## TEXT(beginproblem()); @@ -86,50 +90,16 @@ Solve the equation. [` [$questionFormula]=0`] - [__________________________] + [__________________________]{$ans} + +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** + -[@KeyboardInstructions("Enter multiple answers separated by commas, like [|x=1, x=-1|]*. Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## $showPartialCorrectAnswers = 1; -ANS($ans->cmp( - entry_type => "a solution", - checker => sub { - my ($correct,$student,$ans,$nth,$value) = @_; - if ($correct->type eq "Assignment") { - my ($svar,$sfrac) = $student->value; # get the variable and fraction - return 0 unless Value::classMatch($sfrac,'Fraction') && $sfrac->isReduced; - } - return $correct == $student; - }, - extra => sub { - my ($student,$ansHash,$nth,$value) = @_; - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try factoring or using the quadratic formula","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { - $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - my ($svar,$sfrac) = $student->value; # get the variable and fraction - if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { - $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return Value::Real->typeMatch($student); - } -)->withPostFilter(AnswerHints( - ["$var=$frac1","$var=$frac2"] => "Are you sure you have all the solutions?", - [$frac1,$frac2] => ["Your solution is a correct one, but you should write $var = $US$US$US
Are you sure you have all the solutions?",replaceMessage=>1], - ["$frac1,$frac2","$frac2,$frac1"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], -))); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad170.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad170.pg index 714b6db745..d80b0d8501 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad170.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad170.pg @@ -37,6 +37,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", , "PGcourse.pl", @@ -90,6 +91,9 @@ $questionFormula = Formula("$a*$var^2+$b*$var+$c")->reduce; $b1 = $b*-1; $a1 = 2*$a; $ans = List(Formula("$var=($b1-sqrt($discriminant))/$a1"),Formula("$var=($b1+sqrt($discriminant))/$a1")); + +Context("FiniteSolutionSets"); +$ans = Formula("{($b1-sqrt($discriminant))/$a1,($b1+sqrt($discriminant))/$a1}"); ############################################## TEXT(beginproblem()); @@ -98,9 +102,9 @@ Solve the equation. [` [$questionFormula]= 0 `] - [_____________________________] + [_____________________________]{$ans} -[@KeyboardInstructions("Enter multiple answers separated by commas, like [|x=1, x=-1|]*. Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -109,7 +113,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad175.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad175.pg index 00348ed207..abc4027a4e 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad175.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad175.pg @@ -52,6 +52,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", , "PGcourse.pl", @@ -124,6 +125,9 @@ $b1 = $B*-1; $ans = List(Formula("$var=($b1-$D*sqrt($C))/$A"),Formula("$var=($b1+$D*sqrt($C))/$A")); +Context("FiniteSolutionSets"); +$ans = Formula("{($b1-$D*sqrt($C))/$A,($b1+$D*sqrt($C))/$A}"); + ############################################## TEXT(beginproblem()); BEGIN_PGML @@ -131,9 +135,10 @@ Solve the equation. [` [$questionFormula]= 0 `] - [_____________________________] + [_____________________________]{$ans} + +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, like [|x=1, x=-1|]*. Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -142,7 +147,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad176.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad176.pg index 27e0242533..04f22b9268 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad176.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad176.pg @@ -108,7 +108,7 @@ Solve the equation. [_______________________]{$evaluator} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad185.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad185.pg index 22398d01e8..7a794a7cf3 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad185.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad185.pg @@ -41,6 +41,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", , "PGcourse.pl", @@ -97,6 +98,9 @@ $questionFormula1 = Formula("$a*$var^2")->reduce; $questionFormula2 = Formula("$b1*$var+$c1")->reduce; $a1 = 2*$a; $ans = List(Formula("$var=($b1-sqrt($discriminant))/$a1"),Formula("$var=($b1+sqrt($discriminant))/$a1")); + +Context("FiniteSolutionSets"); +$ans = Formula("{($b1-sqrt($discriminant))/$a1,($b1+sqrt($discriminant))/$a1}"); ############################################## TEXT(beginproblem()); @@ -105,9 +109,10 @@ Solve the equation. [` [$questionFormula1]= [$questionFormula2] `] - [_____________________________] + [_____________________________]{$ans} + +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, like [|x=1, x=-1|]*. Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -116,7 +121,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad210.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad210.pg index dd7e577c72..822d18553d 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad210.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad210.pg @@ -32,6 +32,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", , "PGcourse.pl", @@ -71,6 +72,9 @@ $soln1 = 0; $soln2 = $a*-1; $ans = List(Formula("$var=$soln1"),Formula("$var=$soln2")); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + ############################################## TEXT(beginproblem()); @@ -79,9 +83,10 @@ Solve the equation. [` [$var]^2+[$a][$var]= 0 `] - [__________________________________] + [__________________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -89,7 +94,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad230.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad230.pg index c2117f9d04..21972ff8ba 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad230.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad230.pg @@ -35,8 +35,9 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", - "PCCmacros.pl", + "contextFiniteSolutionSets.pl", "PGcourse.pl", + "PCCmacros.pl", ); ############################################## @@ -76,7 +77,8 @@ Context()->strings->add("no real solutions"=>{}, $soln1 = Fraction(-$b,1); $soln2 = Fraction(-$d,$c); -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Compute("{$soln1, $soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -84,52 +86,10 @@ Solve the equation. [` [$question] = 0 `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp( - entry_type => "a solution", - checker => sub { - my ($correct,$student,$ans,$nth,$value) = @_; - if ($correct->type eq "Assignment") { - my ($svar,$sfrac) = $student->value; # get the variable and fraction - #return 0 unless Value::classMatch($sfrac,'Fraction') && $sfrac->isReduced; - if(Value::classMatch($sfrac,'Fraction')) - { - return 0 unless $sfrac->isReduced; - } - } - return $correct == $student; - }, - extra => sub { - my ($student,$ansHash,$nth,$value) = @_; - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try using the square root method","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { - $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - my ($svar,$sfrac) = $student->value; # get the variable and fraction - if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { - $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return Value::Real->typeMatch($student); - } -)->withPostFilter(AnswerHints( - ["$var=$a","$var=-$a"] => "Are you sure you have all the solutions?", - [$a,-$a] => ["Your solution is a correct one, but you should write $var = $US$US$US
Are you sure you have all the solutions?",replaceMessage=>1], - ["$a,-$a","-$a,$a"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], -))); BEGIN_PGML_SOLUTION There are a few ways to solve quadratic equations- the easiest way to solve this particular diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad235.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad235.pg index 407f25e775..86be99a2ce 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad235.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad235.pg @@ -36,9 +36,9 @@ loadMacros( "parserAssignment.pl", "answerHints.pl", "PGML.pl", - "contextFraction.pl", - "PCCmacros.pl", - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -79,7 +79,8 @@ Context()->strings->add("no real solutions"=>{}, $soln1 = Fraction(-$b,1); $soln2 = Fraction(-$d,$c); -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -87,52 +88,10 @@ Solve the equation. [` [$question] = 0 `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp( - entry_type => "a solution", - checker => sub { - my ($correct,$student,$ans,$nth,$value) = @_; - if ($correct->type eq "Assignment") { - my ($svar,$sfrac) = $student->value; # get the variable and fraction - #return 0 unless Value::classMatch($sfrac,'Fraction') && $sfrac->isReduced; - if(Value::classMatch($sfrac,'Fraction')) - { - return 0 unless $sfrac->isReduced; - } - } - return $correct == $student; - }, - extra => sub { - my ($student,$ansHash,$nth,$value) = @_; - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try using the square root method","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { - $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - my ($svar,$sfrac) = $student->value; # get the variable and fraction - if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { - $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return Value::Real->typeMatch($student); - } -)->withPostFilter(AnswerHints( - ["$var=$a","$var=-$a"] => "Are you sure you have all the solutions?", - [$a,-$a] => ["Your solution is a correct one, but you should write $var = $US$US$US
Are you sure you have all the solutions?",replaceMessage=>1], - ["$a,-$a","-$a,$a"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], -))); BEGIN_PGML_SOLUTION There are a few ways to solve quadratic equations- the easiest way to solve this particular diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad240.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad240.pg index dbf75d02da..f8af62cbfc 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad240.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad240.pg @@ -39,38 +39,12 @@ loadMacros( "answerHints.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedRadical.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set(reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0, - ); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - $var = "x"; $a = 1; $b = random(1,10,1); @@ -81,7 +55,8 @@ $d = random(1,10,1)while($d==$b); $soln1 = -$b; $soln2 = -$d; $question = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -89,13 +64,10 @@ Solve the equation. [` [$question] = 0 `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); $step = Formula("($a$var+$b)($c$var+$d)")->reduce; BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad245.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad245.pg index 9bd9a507b3..2ebf39c8cf 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad245.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad245.pg @@ -39,39 +39,13 @@ loadMacros( "answerHints.pl", "PCCmacros.pl", "PGML.pl", - "contextLimitedRadical.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set( - reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0); -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); -Context()->operators->redefine('or',using=>',',from=>'Numeric'); -Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); -Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - - $var = "x"; $a = 1; $b = non_zero_random(-10,10,1); @@ -82,21 +56,18 @@ $d = random(1,10,1)*abs($b)/$b*-1 while(abs($d)==abs($b)); $soln1 = -$b; $soln2 = -$d; $question = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); TEXT(beginproblem()); BEGIN_PGML Solve the equation. [` [$question] = 0 `] - - [____________________] -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -END_PGML + [_]{$ans}{20} -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); +END_PGML $step = Formula("($a$var+$b)($c$var+$d)")->reduce; BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad250.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad250.pg index 34c0b565dc..108871c55e 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad250.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad250.pg @@ -39,39 +39,12 @@ loadMacros( "answerHints.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedRadical.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set( - reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); -Context()->operators->redefine('or',using=>',',from=>'Numeric'); -Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); -Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - - $var = "x"; $a = 1; $b = random(-10,-1,1); @@ -82,7 +55,8 @@ $d = random(-10,-1,1)while($d==$b); $soln1 = -$b; $soln2 = -$d; $question = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -90,13 +64,10 @@ Solve the equation. [` [$question] = 0 `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); $step = Formula("($a$var+$b)($c$var+$d)")->reduce; BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad255.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad255.pg index 5772be43d5..f898e483c5 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad255.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad255.pg @@ -43,39 +43,12 @@ loadMacros( "answerHints.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedRadical.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set( - reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); -Context()->operators->redefine('or',using=>',',from=>'Numeric'); -Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); -Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - - $var = "x"; $a = 1; $b = random(1,10,1); @@ -87,7 +60,8 @@ $soln1 = -$b; $soln2 = -$d; $question = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var")->reduce->reduce; $rhs = Formula("-$b*$d")->reduce->reduce; -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -95,13 +69,11 @@ Solve the equation. [` [$question] = [$rhs] `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); +Context("Numeric"); $step0 = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; $step = Formula("($a$var+$b)($c$var+$d)")->reduce; diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad265.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad265.pg index 2bd4f79fb9..8574a060d8 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad265.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad265.pg @@ -43,38 +43,12 @@ loadMacros( "answerHints.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedRadical.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set( - reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); -Context()->operators->redefine('or',using=>',',from=>'Numeric'); -Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); -Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - $var = "x"; $a = 1; $b = random(-10,-1,1); @@ -86,7 +60,8 @@ $soln1 = -$b; $soln2 = -$d; $question = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var")->reduce->reduce; $rhs = Formula("-$b*$d")->reduce->reduce; -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -94,14 +69,11 @@ Solve the equation. [` [$question] = [$rhs] `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - +Context("Numeric"); $step0 = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; $step = Formula("($a$var+$b)($c$var+$d)")->reduce; BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad270.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad270.pg index 79dd8a2030..d3abea6a39 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad270.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad270.pg @@ -43,38 +43,12 @@ loadMacros( "answerHints.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedRadical.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set( - reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); -Context()->operators->redefine('or',using=>',',from=>'Numeric'); -Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); -Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - $var = "x"; $a = 1; $b = 0; @@ -87,7 +61,8 @@ $soln2 = -$d; $complete = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; $lhs = Formula("$a*$c*$var^2")->reduce->reduce; $rhs = Formula("-($a*$d+$b*$c)*$var")->reduce->reduce; -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -95,13 +70,10 @@ Solve the equation. [` [$lhs] = [$rhs] `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); $step = Formula("($a$var+$b)($c$var+$d)")->reduce; BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad275.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad275.pg index bc2deb9cda..fd1190f869 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad275.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad275.pg @@ -43,38 +43,12 @@ loadMacros( "answerHints.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedRadical.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set( - reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); -Context()->operators->redefine('or',using=>',',from=>'Numeric'); -Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); -Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - $var = "x"; $a = random(2,10,1); @@ -89,7 +63,8 @@ $complete = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; $step = Formula("($a$var+$b)($c$var+$d)")->reduce; $lhs = Formula("$a*$c*$var^2")->reduce->reduce; $rhs = Formula("-($a*$d+$b*$c)*$var")->reduce->reduce; -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -97,13 +72,10 @@ Solve the equation. [` [$lhs] = [$rhs] `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); BEGIN_PGML_SOLUTION There are a few ways to solve quadratic equations- the easiest way to solve this particular diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad280.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad280.pg index 99ee3d2c90..3b60bd52a2 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad280.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad280.pg @@ -43,6 +43,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", "PGcourse.pl", ); @@ -93,58 +94,22 @@ $soln1 = Fraction(-$b,1); $soln2 = Fraction(-$d,$c); $ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + TEXT(beginproblem()); BEGIN_PGML Solve the equation. [` [$lhs] = [$rhs] `] - [____________________] + [____________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp( - entry_type => "a solution", - checker => sub { - my ($correct,$student,$ans,$nth,$value) = @_; - if ($correct->type eq "Assignment") { - my ($svar,$sfrac) = $student->value; # get the variable and fraction - #return 0 unless Value::classMatch($sfrac,'Fraction') && $sfrac->isReduced; - if(Value::classMatch($sfrac,'Fraction')) - { - return 0 unless $sfrac->isReduced; - } - } - return $correct == $student; - }, - extra => sub { - my ($student,$ansHash,$nth,$value) = @_; - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try using the square root method","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { - $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - my ($svar,$sfrac) = $student->value; # get the variable and fraction - if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { - $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return Value::Real->typeMatch($student); - } -)->withPostFilter(AnswerHints( - ["$var=$a","$var=-$a"] => "Are you sure you have all the solutions?", - [$a,-$a] => ["Your solution is a correct one, but you should write $var = $US$US$US
Are you sure you have all the solutions?",replaceMessage=>1], - ["$a,-$a","-$a,$a"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], -))); BEGIN_PGML_SOLUTION There are a few ways to solve quadratic equations- the easiest way to solve this particular diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad285.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad285.pg index a7f2f5faa5..15e48cf7c0 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad285.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad285.pg @@ -39,8 +39,9 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", - "PCCmacros.pl", - "PGcourse.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## @@ -94,7 +95,8 @@ Context()->strings->add("no real solutions"=>{}, ); $b1 = $b*-1; -$ans = Compute("$var = $b1/$a"); +Context("FiniteSolutionSets"); +$ans = ($a == 1) ? Formula("{$b1}") : Formula("{$b1/$a}"); ############################################## @@ -104,54 +106,10 @@ Solve the equation. [` [$questionFormula]=0`] - [__________________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -############################################## -ANS($ans->cmp( - checker => sub { - my ($correct,$student,$ans) = @_; - # count the number of student answers - my $fullStudent = $ans->{student_formula}; - my @fullStudentValue = $fullStudent->value; - my $n = scalar(@fullStudentValue); # number of student answers - if($n>1) - { - $student->context->setError("Does this equation have more than one unique solution?","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # if the student has said no real solutions, ask them about it - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try factoring or using the quadratic formula","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # check that the student has written x= - if ($student->type ne "Assignment" && $ans->{student_formula}->type ne "Assignment") { - $student->context->setError("Your entry should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return $correct == $student; - } -)->withPostFilter(sub { - my $ansHash = shift; - if ($ansHash->{score}) { - my ($cvar,$cfrac) = $ansHash->{correct_value}->value; # get - my ($svar,$sfrac) = $ansHash->{student_value}->value; # get - my $check = $cfrac->cmp->evaluate($sfrac->string); # do a - $ansHash->{score} = $check->{score}; - $ansHash->{ans_message} = $check->{ans_message}; # and any - } - return $ansHash; - }, - ), -); - ############################################## $A = $a*$c; diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad290.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad290.pg index 4b07b94f2c..3e98d0d673 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad290.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad290.pg @@ -39,8 +39,9 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", - "PCCmacros.pl", - "PGcourse.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## @@ -97,7 +98,8 @@ Context()->strings->add("no real solutions"=>{}, ); $b1 = $b*-1; -$ans = Compute("$var = $b1/$a"); +Context("FiniteSolutionSets"); +$ans = ($a == 1) ? Formula("{$b1}") : Formula("{$b1/$a}"); ############################################## @@ -107,54 +109,10 @@ Solve the equation. [` [$questionFormula]=0`] - [__________________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -############################################## -ANS($ans->cmp( - checker => sub { - my ($correct,$student,$ans) = @_; - # count the number of student answers - my $fullStudent = $ans->{student_formula}; - my @fullStudentValue = $fullStudent->value; - my $n = scalar(@fullStudentValue); # number of student answers - if($n>1) - { - $student->context->setError("Does this equation have more than one unique solution?","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # if the student has said no real solutions, ask them about it - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try factoring or using the quadratic formula","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # check that the student has written x= - if ($student->type ne "Assignment" && $ans->{student_formula}->type ne "Assignment") { - $student->context->setError("Your entry should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return $correct == $student; - } -)->withPostFilter(sub { - my $ansHash = shift; - if ($ansHash->{score}) { - my ($cvar,$cfrac) = $ansHash->{correct_value}->value; # get - my ($svar,$sfrac) = $ansHash->{student_value}->value; # get - my $check = $cfrac->cmp->evaluate($sfrac->string); # do a - $ansHash->{score} = $check->{score}; - $ansHash->{ans_message} = $check->{ans_message}; # and any - } - return $ansHash; - }, - ), -); - ############################################## $A = $a*$c; diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad295.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad295.pg index 11f9d38b27..7cc86a985a 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad295.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad295.pg @@ -38,9 +38,10 @@ loadMacros( "parserAssignment.pl", "answerHints.pl", "PGML.pl", + "contextFiniteSolutionSets.pl", "contextFraction.pl", - "PCCmacros.pl", - "PGcourse.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -99,7 +100,8 @@ Context()->strings->add("no real solutions"=>{}, ); $b1 = $b*-1; -$ans = Compute("$var = $b1/$a"); +Context("FiniteSolutionSets"); +$ans = ($a == 1) ? Formula("{$b1}") : Formula("{$b1/$a}"); ############################################## @@ -109,53 +111,11 @@ Solve the equation. [` [$lhs]=[$rhs]`] - [__________________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## -ANS($ans->cmp( - checker => sub { - my ($correct,$student,$ans) = @_; - # count the number of student answers - my $fullStudent = $ans->{student_formula}; - my @fullStudentValue = $fullStudent->value; - my $n = scalar(@fullStudentValue); # number of student answers - if($n>1) - { - $student->context->setError("Does this equation have more than one unique solution?","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # if the student has said no real solutions, ask them about it - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try factoring or using the quadratic formula","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # check that the student has written x= - if ($student->type ne "Assignment" && $ans->{student_formula}->type ne "Assignment") { - $student->context->setError("Your entry should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return $correct == $student; - } -)->withPostFilter(sub { - my $ansHash = shift; - if ($ansHash->{score}) { - my ($cvar,$cfrac) = $ansHash->{correct_value}->value; # get - my ($svar,$sfrac) = $ansHash->{student_value}->value; # get - my $check = $cfrac->cmp->evaluate($sfrac->string); # do a - $ansHash->{score} = $check->{score}; - $ansHash->{ans_message} = $check->{ans_message}; # and any - } - return $ansHash; - }, - ), -); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad30.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad30.pg index e2e84f9fba..9b60ab8a8d 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad30.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad30.pg @@ -33,6 +33,7 @@ loadMacros( "PGML.pl", "contextLimitedRadical.pl", "PCCmacros.pl", + "contextFiniteSolutionSets.pl", , "PGcourse.pl", ); @@ -65,6 +66,9 @@ $var = "x"; $a = random(2,12,1); $ans = List(Formula("$var=$a"),Formula("$var=-$a")); +Context("FiniteSolutionSets"); +$ans = Formula("{$a,-$a}"); + ############################################## TEXT(beginproblem()); @@ -73,9 +77,9 @@ Solve the equation. [` [$var]^2 = [$a**2] `] - [__________________________________] + [__________________________________]{$ans} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -83,7 +87,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad300.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad300.pg index 8b777df279..f41e09e03e 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad300.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad300.pg @@ -39,6 +39,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", "PGcourse.pl", ); @@ -102,6 +103,9 @@ Context()->strings->add("no real solutions"=>{}, $b1 = $b*-1; $ans = Compute("$var = $b1/$a"); +Context("FiniteSolutionSets"); +$ans = Formula("{$b1/$a}"); + ############################################## TEXT(beginproblem()); @@ -110,53 +114,13 @@ Solve the equation. [` [$lhs]=[$rhs]`] - [__________________________] + [__________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## -ANS($ans->cmp( - checker => sub { - my ($correct,$student,$ans) = @_; - # count the number of student answers - my $fullStudent = $ans->{student_formula}; - my @fullStudentValue = $fullStudent->value; - my $n = scalar(@fullStudentValue); # number of student answers - if($n>1) - { - $student->context->setError("Does this equation have more than one unique solution?","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # if the student has said no real solutions, ask them about it - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try factoring or using the quadratic formula","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # check that the student has written x= - if ($student->type ne "Assignment" && $ans->{student_formula}->type ne "Assignment") { - $student->context->setError("Your entry should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return $correct == $student; - } -)->withPostFilter(sub { - my $ansHash = shift; - if ($ansHash->{score}) { - my ($cvar,$cfrac) = $ansHash->{correct_value}->value; # get - my ($svar,$sfrac) = $ansHash->{student_value}->value; # get - my $check = $cfrac->cmp->evaluate($sfrac->string); # do a - $ansHash->{score} = $check->{score}; - $ansHash->{ans_message} = $check->{ans_message}; # and any - } - return $ansHash; - }, - ), -); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad305.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad305.pg index b0adc442ea..e16f485005 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad305.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad305.pg @@ -39,8 +39,9 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", - "PCCmacros.pl", - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -100,7 +101,8 @@ Context()->strings->add("no real solutions"=>{}, $soln1 = Fraction(-$b,$a); $soln2 = Fraction(-$d,$c); -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); ############################################## @@ -110,53 +112,11 @@ Solve the equation. [` [$lhs]=[$rhs]`] - [__________________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## -$showPartialCorrectAnswers = 1; -ANS($ans->cmp( - entry_type => "a solution", - checker => sub { - my ($correct,$student,$ans,$nth,$value) = @_; - if ($correct->type eq "Assignment") { - my ($svar,$sfrac) = $student->value; # get the variable and fraction - #return 0 unless Value::classMatch($sfrac,'Fraction') && $sfrac->isReduced; - if(Value::classMatch($sfrac,'Fraction')) - { - return 0 unless $sfrac->isReduced; - } - } - return $correct == $student; - }, - extra => sub { - my ($student,$ansHash,$nth,$value) = @_; - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try using the square root method","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { - $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - my ($svar,$sfrac) = $student->value; # get the variable and fraction - if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { - $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return Value::Real->typeMatch($student); - } -)->withPostFilter(AnswerHints( - ["$var=$soln1","$var=$soln2"] => "Are you sure you have all the solutions?", - [$soln1,$soln2] => ["Your solution is a correct one, but you should write $var = $US$US$US
Are you sure you have all the solutions?",replaceMessage=>1], - ["$soln1,$soln2","$soln2,$soln1"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], -))); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad310.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad310.pg index 7160c5b057..16daa41021 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad310.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad310.pg @@ -35,38 +35,12 @@ loadMacros( "answerHints.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedRadical.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set(reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0, - ); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - $var = "x"; $a = 1; @@ -78,7 +52,8 @@ $soln1 = -$b; $soln2 = -$d; $questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; $questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -86,13 +61,10 @@ Solve the equation. [` [$questionFormula] = 0 `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad315.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad315.pg index 531ed2fae8..78217d5e86 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad315.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad315.pg @@ -39,6 +39,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", "PGcourse.pl", ); @@ -97,6 +98,9 @@ $soln1 = Fraction(-$b,$a); $soln2 = Fraction(-$d,$c); $ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + ############################################## TEXT(beginproblem()); @@ -105,53 +109,14 @@ Solve the equation. [` [$questionFormula]=0`] - [__________________________] + [__________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## $showPartialCorrectAnswers = 1; -ANS($ans->cmp( - entry_type => "a solution", - checker => sub { - my ($correct,$student,$ans,$nth,$value) = @_; - if ($correct->type eq "Assignment") { - my ($svar,$sfrac) = $student->value; # get the variable and fraction - #return 0 unless Value::classMatch($sfrac,'Fraction') && $sfrac->isReduced; - if(Value::classMatch($sfrac,'Fraction')) - { - return 0 unless $sfrac->isReduced; - } - } - return $correct == $student; - }, - extra => sub { - my ($student,$ansHash,$nth,$value) = @_; - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try using the square root method","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { - $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - my ($svar,$sfrac) = $student->value; # get the variable and fraction - if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { - $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return Value::Real->typeMatch($student); - } -)->withPostFilter(AnswerHints( - ["$var=$soln1","$var=$soln2"] => "Are you sure you have all the solutions?", - [$soln1,$soln2] => ["Your solution is a correct one, but you should write $var = $US$US$US
Are you sure you have all the solutions?",replaceMessage=>1], - ["$soln1,$soln2","$soln2,$soln1"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], -))); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad320.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad320.pg index 77782d88cb..dd3b81e58b 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad320.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad320.pg @@ -39,8 +39,9 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", - "PCCmacros.pl", - "PGcourse.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## @@ -97,7 +98,8 @@ Context()->strings->add("no real solutions"=>{}, $soln1 = Fraction(-$b,$a); $soln2 = Fraction(-$d,$c); -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); ############################################## @@ -107,53 +109,11 @@ Solve the equation. [` [$lhs]=[$rhs]`] - [__________________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## -$showPartialCorrectAnswers = 1; -ANS($ans->cmp( - entry_type => "a solution", - checker => sub { - my ($correct,$student,$ans,$nth,$value) = @_; - if ($correct->type eq "Assignment") { - my ($svar,$sfrac) = $student->value; # get the variable and fraction - #return 0 unless Value::classMatch($sfrac,'Fraction') && $sfrac->isReduced; - if(Value::classMatch($sfrac,'Fraction')) - { - return 0 unless $sfrac->isReduced; - } - } - return $correct == $student; - }, - extra => sub { - my ($student,$ansHash,$nth,$value) = @_; - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try using the square root method","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { - $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - my ($svar,$sfrac) = $student->value; # get the variable and fraction - if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { - $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return Value::Real->typeMatch($student); - } -)->withPostFilter(AnswerHints( - ["$var=$soln1","$var=$soln2"] => "Are you sure you have all the solutions?", - [$soln1,$soln2] => ["Your solution is a correct one, but you should write $var = $US$US$US
Are you sure you have all the solutions?",replaceMessage=>1], - ["$soln1,$soln2","$soln2,$soln1"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], -))); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad325.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad325.pg index 7706d30cee..57850f1a23 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad325.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad325.pg @@ -43,38 +43,12 @@ loadMacros( "answerHints.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedRadical.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set( - reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); -Context()->operators->redefine('or',using=>',',from=>'Numeric'); -Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); -Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - $var = "x"; $a = 1; @@ -87,7 +61,8 @@ $soln1 = -$b; $soln2 = -$d; $question = Formula("$a*$c*$var($var+($a*$d+$b*$c))")->reduce->reduce; $rhs = Formula("-$b*$d")->reduce->reduce; -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -95,14 +70,11 @@ Solve the equation. [` [$question] = [$rhs] `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - +Context("Numeric"); $step0 = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; $step = Formula("($a$var+$b)($c$var+$d)")->reduce; BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad330.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad330.pg index 25347c24b2..6997186f6e 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad330.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad330.pg @@ -39,8 +39,9 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", - "PCCmacros.pl", - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", + "PCCmacros.pl", ); ############################################## @@ -100,7 +101,8 @@ Context()->strings->add("no real solutions"=>{}, $soln1 = Fraction(-$b,$a); $soln2 = Fraction(-$d,$c); -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); ############################################## @@ -110,53 +112,11 @@ Solve the equation. [` [$lhs]=[$rhs]`] - [__________________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## -$showPartialCorrectAnswers = 1; -ANS($ans->cmp( - entry_type => "a solution", - checker => sub { - my ($correct,$student,$ans,$nth,$value) = @_; - if ($correct->type eq "Assignment") { - my ($svar,$sfrac) = $student->value; # get the variable and fraction - #return 0 unless Value::classMatch($sfrac,'Fraction') && $sfrac->isReduced; - if(Value::classMatch($sfrac,'Fraction')) - { - return 0 unless $sfrac->isReduced; - } - } - return $correct == $student; - }, - extra => sub { - my ($student,$ansHash,$nth,$value) = @_; - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try using the square root method","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { - $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - my ($svar,$sfrac) = $student->value; # get the variable and fraction - if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { - $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return Value::Real->typeMatch($student); - } -)->withPostFilter(AnswerHints( - ["$var=$soln1","$var=$soln2"] => "Are you sure you have all the solutions?", - [$soln1,$soln2] => ["Your solution is a correct one, but you should write $var = $US$US$US
Are you sure you have all the solutions?",replaceMessage=>1], - ["$soln1,$soln2","$soln2,$soln1"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], -))); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad335.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad335.pg index 06c6ccbffc..fb55894457 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad335.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad335.pg @@ -41,38 +41,12 @@ loadMacros( "answerHints.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedRadical.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set(reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0, - ); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - $var = "x"; $a = 1; @@ -103,7 +77,8 @@ $rhs = Formula("$E")->reduce; $step1 = Formula("$A*$C*$var**2+($B*$C+$A*$D)*$var+$B*$D")->reduce->reduce; $step2 = Formula("$a*$c*$var**2+($b*$c+$a*$d)*$var+$b*$d")->reduce->reduce; $question = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -111,14 +86,10 @@ Solve the equation. [` [$lhs] = [$rhs] `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad340.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad340.pg index 3b4b8232d8..a8f433ef03 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad340.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad340.pg @@ -41,37 +41,12 @@ loadMacros( "answerHints.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedRadical.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set(reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0, - ); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); $var = "x"; @@ -105,7 +80,8 @@ $rhs = Formula("$E+($A*$C-1)*$var^2")->reduce; $step1 = Formula("$A*$C*$var^2+($B*$C+$A*$D)*$var+$B*$D")->reduce->reduce; $step2 = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+$b*$d")->reduce->reduce; $question = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; -$ans = Compute("$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); TEXT(beginproblem()); BEGIN_PGML @@ -113,14 +89,10 @@ Solve the equation. [` [$lhs] = [$rhs] `] - [____________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad345.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad345.pg index e033ce0857..5929e0cec2 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad345.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad345.pg @@ -34,6 +34,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", "PGcourse.pl", ); @@ -98,6 +99,13 @@ Context()->strings->add("no real solutions"=>{}, $b1 = $b*-1; $ans = Compute("$var = $b1/$a"); + +Context("Fraction"); +$ans = Fraction($b1,$a); + +Context("FiniteSolutionSets"); +$ans = Formula("{$ans}"); + ############################################## TEXT(beginproblem()); @@ -106,53 +114,13 @@ Solve the equation. [` [$lhs]=[$rhs]`] - [__________________________] + [__________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## -ANS($ans->cmp( - checker => sub { - my ($correct,$student,$ans) = @_; - # count the number of student answers - my $fullStudent = $ans->{student_formula}; - my @fullStudentValue = $fullStudent->value; - my $n = scalar(@fullStudentValue); # number of student answers - if($n>1) - { - $student->context->setError("Does this equation have more than one unique solution?","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # if the student has said no real solutions, ask them about it - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try factoring or using the quadratic formula","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # check that the student has written x= - if ($student->type ne "Assignment" && $ans->{student_formula}->type ne "Assignment") { - $student->context->setError("Your entry should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return $correct == $student; - } -)->withPostFilter(sub { - my $ansHash = shift; - if ($ansHash->{score}) { - my ($cvar,$cfrac) = $ansHash->{correct_value}->value; # get - my ($svar,$sfrac) = $ansHash->{student_value}->value; # get - my $check = $cfrac->cmp->evaluate($sfrac->string); # do a - $ansHash->{score} = $check->{score}; - $ansHash->{ans_message} = $check->{ans_message}; # and any - } - return $ansHash; - }, - ), -); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad35.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad35.pg index a3d4ce29bd..3720a1cc40 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad35.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad35.pg @@ -31,6 +31,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", "PGcourse.pl", ); @@ -62,6 +63,8 @@ $var = "x"; $a = Fraction(1,random(2,12,1)); $ans = Compute("$var = -$a, $var = $a"); +Context("FiniteSolutionSets"); +$ans = Formula("{-$a,$a}"); ############################################## TEXT(beginproblem()); @@ -70,51 +73,14 @@ Solve the equation. [` [$var]^2 = [$a**2] `] - [______________________] + [______________________]{$ans} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## $showPartialCorrectAnswers = 1; -ANS($ans->cmp( - entry_type => "a solution", - checker => sub { - my ($correct,$student,$ans,$nth,$value) = @_; - if ($correct->type eq "Assignment") { - my ($svar,$sfrac) = $student->value; # get the variable and fraction - return 0 unless Value::classMatch($sfrac,'Fraction') && $sfrac->isReduced; - } - return $correct == $student; - }, - extra => sub { - my ($student,$ansHash,$nth,$value) = @_; - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try using the square root method","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { - $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - my ($svar,$sfrac) = $student->value; # get the variable and fraction - if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { - $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return Value::Real->typeMatch($student); - } -)->withPostFilter(AnswerHints( - ["$var=$a","$var=-$a"] => "Are you sure you have all the solutions?", - [$a,-$a] => ["Your solution is a correct one, but you should write $var = $US$US$US
Are you sure you have all the solutions?",replaceMessage=>1], - ["$a,-$a","-$a,$a"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], -))); - ############################################## BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad350.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad350.pg index ffc776a3a9..00b5d173bc 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad350.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad350.pg @@ -39,6 +39,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", "PGcourse.pl", ); @@ -96,6 +97,12 @@ Context()->strings->add("no real solutions"=>{}, $b1 = $b*-1; $ans = Compute("$var = $b1/$a"); +Context("Fraction"); +$ans = Fraction($b1,$a); + +Context("FiniteSolutionSets"); +$ans = Formula("{$ans}"); + ############################################## TEXT(beginproblem()); @@ -104,53 +111,14 @@ Solve the equation. [` [$questionFormula]=0`] - [__________________________] + [__________________________]{$ans} + + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## -ANS($ans->cmp( - checker => sub { - my ($correct,$student,$ans) = @_; - # count the number of student answers - my $fullStudent = $ans->{student_formula}; - my @fullStudentValue = $fullStudent->value; - my $n = scalar(@fullStudentValue); # number of student answers - if($n>1) - { - $student->context->setError("Does this equation have more than one unique solution?","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # if the student has said no real solutions, ask them about it - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try factoring or using the quadratic formula","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # check that the student has written x= - if ($student->type ne "Assignment" && $ans->{student_formula}->type ne "Assignment") { - $student->context->setError("Your entry should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return $correct == $student; - } -)->withPostFilter(sub { - my $ansHash = shift; - if ($ansHash->{score}) { - my ($cvar,$cfrac) = $ansHash->{correct_value}->value; # get - my ($svar,$sfrac) = $ansHash->{student_value}->value; # get - my $check = $cfrac->cmp->evaluate($sfrac->string); # do a - $ansHash->{score} = $check->{score}; - $ansHash->{ans_message} = $check->{ans_message}; # and any - } - return $ansHash; - }, - ), -); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad355.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad355.pg index 3a86e46194..bff7d40261 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad355.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad355.pg @@ -40,6 +40,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", , "PGcourse.pl", ); @@ -86,19 +87,22 @@ $soln3 = -$e; $question = Formula("($var+$e)($a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d)")->reduce->reduce; $ans = Compute("$var = $soln1, $var = $soln2, $var=$soln3"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2,$soln3}"); + TEXT(beginproblem()); BEGIN_PGML Solve the equation. [` [$question] = 0 `] - [____________________] + [____________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); $step = Formula("($var+$e)($a$var+$b)($c$var+$d)")->reduce; BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad360.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad360.pg index 6ed0c6c992..63a3fac678 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad360.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad360.pg @@ -40,6 +40,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", , "PGcourse.pl", ); @@ -84,19 +85,22 @@ $soln3 = -$e; $question = Formula("($var+$e)($a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d)")->reduce->reduce; $ans = Compute("$var = $soln1, $var = $soln2, $var=$soln3"); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2,$soln3}"); + TEXT(beginproblem()); BEGIN_PGML Solve the equation. [` [$question] = 0 `] - [____________________] + [____________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); $step = Formula("($var+$e)($a$var+$b)($c$var+$d)")->reduce; BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad365.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad365.pg index e84bae5684..b76604357c 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad365.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad365.pg @@ -40,6 +40,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", , "PGcourse.pl", ); @@ -83,19 +84,22 @@ $soln2 = -$d; $question = Formula("$a*$c*$var^3+($a*$d+$b*$c)*$var^2+$b*$d$var")->reduce->reduce; $ans = Compute("$var=0,$var = $soln1, $var = $soln2"); +Context("FiniteSolutionSets"); +$ans = Formula("{0,$soln1,$soln2}"); + TEXT(beginproblem()); BEGIN_PGML Solve the equation. [` [$question] = 0 `] - [____________________] + [____________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); $step = Formula("$var($a$var+$b)($c$var+$d)")->reduce; BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad40.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad40.pg index b02ba0d5d6..8882c0db68 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad40.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad40.pg @@ -32,6 +32,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", , "PGcourse.pl", @@ -71,6 +72,10 @@ $b=9; $b = random(3,11,2) while($b==9); $ans = List(Formula("$var=$a sqrt($b)"),Formula("$var=-$a sqrt($b)")); +Context("FiniteSolutionSets"); +$ans = Formula("{$a sqrt($b),-$a sqrt($b)}"); + + ############################################## TEXT(beginproblem()); @@ -79,9 +84,10 @@ Solve the equation. [` [$var]^2 = [$a**2 * $b] `] - [_______________________] + [_______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -90,7 +96,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad45.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad45.pg index 1069dc569d..05e55fa4ed 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad45.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad45.pg @@ -33,6 +33,7 @@ loadMacros( "PGML.pl", "contextLimitedRadical.pl", "PCCmacros.pl", + "contextFiniteSolutionSets.pl", , "PGcourse.pl", ); @@ -68,6 +69,9 @@ $index = random(0,$#primes,1); $a = $primes[$index]; $ans = List(Formula("$var=sqrt($a)"),Formula("$var=-sqrt($a)")); +Context("FiniteSolutionSets"); +$ans = Formula("{sqrt($a),-sqrt($a)}"); + ############################################## TEXT(beginproblem()); @@ -76,9 +80,9 @@ Solve the equation. [` [$var]^2 = [$a] `] - [_______________________] + [_______________________]{$ans} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -87,7 +91,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad55.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad55.pg index ba263cbb5c..02f7e82dde 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad55.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad55.pg @@ -34,6 +34,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", "PGcourse.pl", ); @@ -80,6 +81,9 @@ else $a = Fraction($a,$b); $ans = Compute("$var = -$a, $var = $a"); +Context("FiniteSolutionSets"); +$ans = Formula("{-$a,$a}"); + ############################################## TEXT(beginproblem()); @@ -88,51 +92,15 @@ Solve the equation. [` [$var]^2 = [$a**2] `] - [______________________] + [______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## $showPartialCorrectAnswers = 1; -ANS($ans->cmp( - entry_type => "a solution", - checker => sub { - my ($correct,$student,$ans,$nth,$value) = @_; - if ($correct->type eq "Assignment") { - my ($svar,$sfrac) = $student->value; # get the variable and fraction - return 0 unless Value::classMatch($sfrac,'Fraction') && $sfrac->isReduced; - } - return $correct == $student; - }, - extra => sub { - my ($student,$ansHash,$nth,$value) = @_; - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try using the square root method","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { - $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - my ($svar,$sfrac) = $student->value; # get the variable and fraction - if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { - $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return Value::Real->typeMatch($student); - } -)->withPostFilter(AnswerHints( - ["$var=$a","$var=-$a"] => "Are you sure you have all the solutions?", - [$a,-$a] => ["Your solution is a correct one, but you should write $var = $US$US$US
Are you sure you have all the solutions?",replaceMessage=>1], - ["$a,-$a","-$a,$a"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], -))); - ############################################## BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad60.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad60.pg index 5d78ab693f..3aa17d7e2a 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad60.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad60.pg @@ -34,6 +34,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", "PGcourse.pl", ); @@ -77,6 +78,9 @@ else $c = Fraction($a,$b); $ans = Compute("$var = -$c, $var = $c"); +Context("FiniteSolutionSets"); +$ans = Formula("{-$c,$c}"); + ############################################## TEXT(beginproblem()); @@ -85,51 +89,15 @@ Solve the equation. [` [$b**2][$var]^2 = [$a**2] `] - [______________________] + [______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## $showPartialCorrectAnswers = 1; -ANS($ans->cmp( - entry_type => "a solution", - checker => sub { - my ($correct,$student,$ans,$nth,$value) = @_; - if ($correct->type eq "Assignment") { - my ($svar,$sfrac) = $student->value; # get the variable and fraction - return 0 unless Value::classMatch($sfrac,'Fraction') && $sfrac->isReduced; - } - return $correct == $student; - }, - extra => sub { - my ($student,$ansHash,$nth,$value) = @_; - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try using the square root method","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { - $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - my ($svar,$sfrac) = $student->value; # get the variable and fraction - if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { - $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return Value::Real->typeMatch($student); - } -)->withPostFilter(AnswerHints( - ["$var=$c","$var=-$c"] => "This is correct, but are you sure you have all the solutions?", - [$c,-$c] => ["Your solution is a correct one, but you should write $var = $US$US$US
Are you sure you have all the solutions?",replaceMessage=>1], - ["$c,-$c","-$c,$c"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], -))); - ############################################## BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad65.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad65.pg index d5e530d8a8..26308f6e11 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad65.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad65.pg @@ -27,46 +27,28 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", - "PGML.pl", - "contextLimitedRadical.pl", - "PCCmacros.pl", - , + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); +Context("FiniteSolutionSets"); $var = "x"; #Context()->variables->are($var=>'Real'); $a = random(2,10,1); $b = random(2,5,1); $c = non_zero_random(-10,10,1); -$ans = List(Formula("$var=$b"),Formula("$var=-$b")); + +$ans = Formula("{-$b,$b}"); ############################################## @@ -76,7 +58,7 @@ Solve the equation. [` [$a][$var]^2 +[$c]= [$a*$b**2+$c] `] - [__________________________________] + [__________________________________]{$ans} [@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** @@ -86,7 +68,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad70.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad70.pg index d6c54e95ca..ac6d28dd92 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad70.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad70.pg @@ -33,6 +33,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", , "PGcourse.pl", @@ -72,6 +73,9 @@ $b = list_random(2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67) while($b= $c = $a*$b; $ans = List(Formula("$var=sqrt($c)/$b"), Formula("$var=-sqrt($c)/$b")); +Context("FiniteSolutionSets"); +$ans = Formula("{sqrt($c)/$b,-sqrt($c)/$b}"); + ############################################## TEXT(beginproblem()); @@ -80,9 +84,9 @@ Solve the equation. [` [$b][$var]^2 - [$a]= 0`] - [_______________________] + [_______________________]{$ans} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*. Rationalizing denominators is part of completely simplifying.")@]** +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -91,7 +95,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad71.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad71.pg index 55594bc6de..4cec544c01 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad71.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad71.pg @@ -28,6 +28,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "PCCmacros.pl", + "contextFiniteSolutionSets.pl", "contextLimitedRadical.pl", "PGcourse.pl", ); @@ -72,6 +73,9 @@ $a = $c+$aMinusC; $ans = Compute("$var = -sqrt($d)/$b, $var = sqrt($d)/$b"); +Context("FiniteSolutionSets"); +$ans = Formula("{-sqrt($d)/$b,sqrt($d)/$b}"); + ############################################## TEXT(beginproblem()); @@ -80,16 +84,15 @@ Solve the equation. [` [$a]-[$b][$var]^2 = [$c] `] - [______________________] + [______________________]{$ans} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*. Rationalizing denominators is part of completely simplifying.")@]** +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad75.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad75.pg index b6f21a635a..9cdb26bad4 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad75.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad75.pg @@ -33,6 +33,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", , "PGcourse.pl", @@ -74,6 +75,8 @@ $a = $primes[$index1]; $b = $primes[$index2]; # for the answer + +Context("FiniteSolutionSets"); $ans = Compute("no real solutions"); ############################################## @@ -84,26 +87,14 @@ Solve the equation. [` [$b][$var]^2 + [$a]= 0`] - [_______________________] + [_______________________]{$ans} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## -ANS($ans->cmp(checker=>sub { - my ($correct,$student,$ansHash) = @_; - if(!Value::String->typeMatch($student)) - { - Value->Error("$mymsg"); - return 0; - } - $check = ($student->value eq "no real solutions"); - Value->Error("$mymsg") unless($check); - return $check; - }, -)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad90.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad90.pg index 392a89c28a..6460878f08 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad90.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad90.pg @@ -34,6 +34,7 @@ loadMacros( "answerHints.pl", "PGML.pl", "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", , "PGcourse.pl", @@ -79,6 +80,9 @@ $c = -$b; # the answer $ans = List(Formula("$var=$c+sqrt($a)"), Formula("$var=$c-sqrt($a)")); +Context("FiniteSolutionSets"); +$ans = Formula("{$c+sqrt($a),$c-sqrt($a)}"); + ############################################## TEXT(beginproblem()); @@ -87,9 +91,9 @@ Solve the equation. [` ([$var]+[$b])^2 = [$a]`] - [_______________________] + [_______________________]{$ans} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML @@ -98,7 +102,6 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad95.pg b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad95.pg index b4fe0260b6..882df5450e 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad95.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad95.pg @@ -31,39 +31,12 @@ loadMacros( "parserAssignment.pl", "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", - "PCCmacros.pl", - , - "PGcourse.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); -Context()->flags->set(reduceConstants=>0, - reduceConstantFunctions=>0, - formatStudentAnswer=>parsed, - showExtraParens=>0, - ); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - $var = "x"; #Context()->variables->are($var=>'Real'); $a = non_zero_random(-12,12,1); @@ -71,7 +44,8 @@ $b = $a; $b = non_zero_random(-12,12,1) while($b==$a); $soln1 = $a*-1; $soln2 = $b*-1; -$ans = List(Formula("$var=$soln1"),Formula("$var=$soln2")); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); ############################################## @@ -81,17 +55,14 @@ Solve the equation. [` ([$var]+[$a])([$var]+[$b]) = 0 `] - [__________________________________] + [_]{$ans}{20} -[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** END_PGML ############################################## -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/Contrib/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg b/Contrib/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg index fd9e2fe61c..efd53339cb 100644 --- a/Contrib/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg +++ b/Contrib/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg @@ -121,7 +121,7 @@ $evaluator = $ans -> cmp( return $OK; }); -$refreshCachedImages= 1; + ############################################## BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation100.pg b/Contrib/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation100.pg index 6d9281ebaa..70da719b02 100644 --- a/Contrib/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation100.pg +++ b/Contrib/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation100.pg @@ -40,7 +40,7 @@ do { $r = non_zero_random(-10,10,1); do {$p = non_zero_random(-10,10,1);} until (abs($r)!=abs($p)); $s = ($r**2-$p)/(2*$r); - } until ( $s>0 ); + } until ( $s>0 && ($r**2+$p)/(2*$r) < 0); } until (sqrt($s)==int(sqrt($s))); $solution = $s**2; diff --git a/Contrib/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent10.pg b/Contrib/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent10.pg index 82ae6b5e64..14463754b6 100644 --- a/Contrib/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent10.pg +++ b/Contrib/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent10.pg @@ -50,7 +50,7 @@ BEGIN_PGML Use rational exponents to write the expression. -[@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.@]** +[@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.')@]** [`` \sqrt[$text]{[$var]} = ``][____________]{$ans} diff --git a/Contrib/PCC/BasicAlgebra/RadicalsAndRationalExponents/radicalFunctionGraph10.pg b/Contrib/PCC/BasicAlgebra/RadicalsAndRationalExponents/radicalFunctionGraph10.pg index 95bac55f68..6b1abae441 100644 --- a/Contrib/PCC/BasicAlgebra/RadicalsAndRationalExponents/radicalFunctionGraph10.pg +++ b/Contrib/PCC/BasicAlgebra/RadicalsAndRationalExponents/radicalFunctionGraph10.pg @@ -43,7 +43,7 @@ TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xmin = -5; $ymin = -5; diff --git a/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions110.pg b/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions110.pg index a9a273752e..d929d39233 100644 --- a/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions110.pg +++ b/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions110.pg @@ -86,6 +86,7 @@ $s3 = Formula("($a*$var1+$g+$c*$var1+$h)/(($var1+$b)($var1+$d))")->reduce; ################################################### +$final = Formula("($e*$var1+$f)/( ($var1+$b)*($var1+$d))")->reduce; BEGIN_PGML_SOLUTION [`` @@ -94,7 +95,7 @@ BEGIN_PGML_SOLUTION &= [$frac1] \cdot \frac{([$var1]+[$d])}{([$var1]+[$d])} [$s1] \\ &= [$s2] \\ &= [$s3] \\ - &= [$ans] + &= [$final] \end{aligned} ``] diff --git a/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions40.pg b/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions40.pg index 09546c34e1..7abee6d8d5 100644 --- a/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions40.pg +++ b/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions40.pg @@ -40,7 +40,7 @@ do { $b = non_zero_random(-6,6,1); $c = random(1,6,1); $d = non_zero_random(-6,6,1); -} until ( (gcd($c,abs($d))==1) && (abs($a*$d*$c)<=40) ); +} until ( (gcd($c,abs($d))==1) && (abs($a*$d*$c)<=40) && ($c*$b != $d)); $commonDenominator = Formula("$var1*$var2"); diff --git a/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions40.pg b/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions40.pg index 2568d62265..8002bf4066 100644 --- a/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions40.pg +++ b/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions40.pg @@ -89,7 +89,7 @@ BEGIN_PGML_SOLUTION [`` \begin{aligned} [$frac1] \cdot [$frac2] &= \frac{[$num1] \cdot [$num2]}{[$den1] \cdot [$den2]} \\ - &= \frac{[$a] \cdot [$c] \cdot [$var1]^{[$e1+$e4]} \cdot [$var2]^{[$e2+$e4]}}{[$b] \cdot [$d] \cdot [$var1][$s1] \cdot [$var2][$s2]} \\ + &= \frac{[$a] \cdot [$c] \cdot [$var1]^{[$e1+$e4]} \cdot [$var2]^{[$e2+$e5]}}{[$b] \cdot [$d] \cdot [$var1][$s1] \cdot [$var2][$s2]} \\ &= [$ans] \end{aligned} ``] diff --git a/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140nodomain.pg b/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140nodomain.pg index 408007876a..bb635dd649 100644 --- a/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140nodomain.pg +++ b/Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140nodomain.pg @@ -36,7 +36,7 @@ Context()->variables->are($var=>'Real'); Context()->noreduce('(-x)-y', '(-x)+y'); $a = random(1,6,1)*random(-1,1,2); -do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b); +do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b and $a!=-$b); $num = Formula("-$var**2-($a+$b)*$var-($a*$b)")->reduce; $den = Formula("$var**2-($b*$b)")->reduce; diff --git a/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg b/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg index ab61a75279..161a8248d2 100644 --- a/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg +++ b/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg @@ -86,7 +86,10 @@ a. If there are [`[$y2r]`] customers waiting in line, approximately how many cus We will use a graphing calculator's [|solve()|]* function to solve this equation. For a TI-89, press [|Home|]*, [|F2|]*, choose [|solve(|]*, press [|Enter|]*. Then, type in the equation: - [|solve([`[$y2r]`]=[`x`]^2/([$a2]-[$a]x),x)\}* + [@ MODES( + HTML => "
solve($y2r = x^2/($a2 - ${a}x), x)
", + TeX => "\\verb!solve($y2r = x^2/($a2 - ${a}x), x)!") + @]* For Casio ClassPad 300, tap [|Main|]*, [|Action|]* in the menu, [|Advanced|]*, [|solve|]*, and then type in the same equation above. diff --git a/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain40.pg b/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain40.pg index f655d56384..e251a71480 100644 --- a/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain40.pg +++ b/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain40.pg @@ -26,12 +26,14 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGasu.pl", + "PGasu.pl", + "PCCmacros.pl", "contextInequalities.pl", "PGcourse.pl", ); @@ -41,11 +43,10 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $a = non_zero_random(-4,4,1); $exclude1 = random(-6,6,1); -@exclude1 = ($exclude1-0.01,$exclude1+0.01); $func = Compute("($a)/(x-$exclude1)")->reduce; $xLimit1 = -10; @@ -55,51 +56,29 @@ $yLimit2 = 10; ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xLimit1,$xLimit2],[min($yLimit1,$yLimit2),max($yLimit1,$yLimit2)]); +@exclude1 = num_sort($a/$min[1] + $exclude1,$a/$max[1] + $exclude1); + @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$max[0]-$min[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','right','middle','large')); - } - $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); - - - $g = FEQ("$func for x in <$min[0], $exclude1[0]> using color:blue and weight:1"); - ($fref) = plot_functions( $gr[$i], $g); - - $g = FEQ("$func for x in <$exclude1[1], $max[0]> using color:blue and weight:1"); - ($fref) = plot_functions( $gr[$i], $g); - - $gr[$i]->moveTo($exclude1,$min[1]); - $gr[$i]->lineTo($exclude1,$max[1], 'red', 1, 'dashed'); - - $px = ($max[0]-$min[0])/240; - $gr[$i]->moveTo($min[0]+$px,$func->eval(x=>$min[0]+$px)); - $gr[$i]->arrowTo($min[0],$func->eval(x=>$min[0]),'blue',1); - $gr[$i]->moveTo($max[0]-$px,$func->eval(x=>$max[0]-$px)); - $gr[$i]->arrowTo($max[0],$func->eval(x=>$max[0]),'blue',1); - ($xout, $xin) = num_sort($a/$min[1]+$exclude1,$a/$max[1]+$exclude1); - $gr[$i]->moveTo($xin+$px,$func->eval(x=>$xin+$px)); - $gr[$i]->arrowTo($xin,$func->eval(x=>$xin),'blue',1); - $gr[$i]->moveTo($xout-$px,$func->eval(x=>$xout-$px)); - $gr[$i]->arrowTo($xout,$func->eval(x=>$xout),'blue',1); - - -} +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick =, + ] + \addplot[firstcurve,domain=$min[0]:$exclude1[0],samples=50] {$a/(x - $exclude1)}; + \addplot[firstcurve,domain=$exclude1[1]:$max[0],samples=50] {$a/(x - $exclude1)}; + \addplot[asymptote] coordinates {($exclude1,$min[1]) ($exclude1,$max[1])}; +\end{axis} +END_TIKZ $ALT = "graph of a function, with an asymptote at x=$exclude1"; @@ -117,7 +96,7 @@ A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< +>>[@image($gr, width=>300, height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< What is its domain? diff --git a/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain50.pg b/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain50.pg index 522f70d3b1..7765d66513 100644 --- a/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain50.pg +++ b/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain50.pg @@ -26,12 +26,14 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGasu.pl", + "PGasu.pl", + "PCCmacros.pl", "contextInequalities.pl", "PGcourse.pl", ); @@ -41,13 +43,11 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $a = 6; $exclude1 = random(-6,-1,1); -@exclude1 = ($exclude1-0.01,$exclude1+0.01); $exclude2 = random(1,6,1);; -@exclude2 = ($exclude2-0.01,$exclude2+0.01); $func = Compute("($a)/((x-$exclude1)*(x-$exclude2))")->reduce; $xLimit1 = -10; @@ -57,63 +57,41 @@ $yLimit2 = 10; ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xLimit1,$xLimit2],[min($yLimit1,$yLimit2),max($yLimit1,$yLimit2)]); +@exc = num_sort( + ($exclude1+$exclude2+sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$min[1])))/2, + ($exclude1+$exclude2-sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$min[1])))/2, + ($exclude1+$exclude2+sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$max[1])))/2, + ($exclude1+$exclude2-sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$max[1])))/2, +); + +@exclude1 = (@exc)[0,1]; +@exclude2 = (@exc)[2,3]; + + @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$max[0]-$min[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top','large')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','right','middle','large')); - } - $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); - $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); - - - $g = FEQ("$func for x in <$min[0], $exclude1[0]> using color:blue and weight:1"); - ($fref) = plot_functions( $gr[$i], $g); - ($fref) = plot_functions( $gr[$i], $g); - - $g = FEQ("$func for x in <$exclude1[1], $exclude2[0]> using color:blue and weight:1"); - ($fref) = plot_functions( $gr[$i], $g); - - $g = FEQ("$func for x in <$exclude2[1], $max[0]> using color:blue and weight:1"); - ($fref) = plot_functions( $gr[$i], $g); - - $gr[$i]->moveTo($exclude1,$min[1]); - $gr[$i]->lineTo($exclude1,$max[1], 'red', 1, 'dashed'); - - $gr[$i]->moveTo($exclude2,$min[1]); - $gr[$i]->lineTo($exclude2,$max[1], 'red', 1, 'dashed'); - - $px = ($max[0]-$min[0])/240; - $gr[$i]->moveTo($min[0]+$px,$func->eval(x=>$min[0]+$px)); - $gr[$i]->arrowTo($min[0],$func->eval(x=>$min[0]),'blue',1); - $gr[$i]->moveTo($max[0]-$px,$func->eval(x=>$max[0]-$px)); - $gr[$i]->arrowTo($max[0],$func->eval(x=>$max[0]),'blue',1); - ($xout1, $xin1, $xout2, $xin2) = num_sort(($exclude1+$exclude2)/2 - sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$min[1]))/2, - ($exclude1+$exclude2)/2 + sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$min[1]))/2, - ($exclude1+$exclude2)/2 - sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$max[1]))/2, - ($exclude1+$exclude2)/2 + sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$max[1]))/2); - $gr[$i]->moveTo($xin1+$px,$func->eval(x=>$xin1+$px)); - $gr[$i]->arrowTo($xin1,$func->eval(x=>$xin1),'blue',1); - $gr[$i]->moveTo($xout1-$px,$func->eval(x=>$xout1-$px)); - $gr[$i]->arrowTo($xout1,$func->eval(x=>$xout1),'blue',1); - $gr[$i]->moveTo($xin2+$px,$func->eval(x=>$xin2+$px)); - $gr[$i]->arrowTo($xin2,$func->eval(x=>$xin2),'blue',1); - $gr[$i]->moveTo($xout2-$px,$func->eval(x=>$xout2-$px)); - $gr[$i]->arrowTo($xout2,$func->eval(x=>$xout2),'blue',1); -} +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick =, + ] + \addplot[firstcurve,domain=$min[0]:$exclude1[0],samples=50] {$a/(x - $exclude1)/(x - $exclude2)}; + \addplot[firstcurve,domain=$exclude1[1]:$exclude2[0],samples=50] {$a/(x - $exclude1)/(x - $exclude2)}; + \addplot[firstcurve,domain=$exclude2[1]:$max[0],samples=50] {$a/(x - $exclude1)/(x - $exclude2)}; + \addplot[asymptote] coordinates {($exclude1,$min[1]) ($exclude1,$max[1])}; + \addplot[asymptote] coordinates {($exclude2,$min[1]) ($exclude2,$max[1])}; +\end{axis} +END_TIKZ + $ALT = "graph of a function, with two asymptotes at x=$exclude1 and x=$exclude2"; @@ -131,7 +109,7 @@ A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< +>>[@image($gr, width=>300, height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< What is its domain? diff --git a/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionGraph10.pg b/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionGraph10.pg index 664defd2b8..d20e6a828c 100644 --- a/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionGraph10.pg +++ b/Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionGraph10.pg @@ -42,7 +42,7 @@ TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xmin = -5; $ymin = -5; diff --git a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg index 7420ba7445..655a6faedc 100644 --- a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg +++ b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg @@ -48,7 +48,8 @@ $b=random(300,500,10); $ans = $a+$b; -$UnitAns = NumberWithUnits($a+$b,"ft"); +$UnitAns = NumberWithUnits("$ans ft"); +$wrong = NumberWithUnits("$a-$b ft"); ############################################## @@ -58,19 +59,18 @@ BEGIN_PGML A mountain is [`[$a]`] feet _above_ sea level. A trench is [`[$b]`] feet _below_ sea level. What is the difference in elevation between the mountain top and the bottom of the trench? - [_________] + [_]{$UnitAns}{16} END_PGML ############################################## - -$wrong = NumberWithUnits("$a-$b ft");; -ANS($UnitAns -> cmp() -> - withPostFilter(AnswerHints( - $wrong => - "Remember that the trench is *below* sea level - does that mean its height has a positive or negative value?"))); +# AnswerHints causing bug; temporarily commenting out +#ANS($UnitAns -> cmp() -> +# withPostFilter(AnswerHints( +# $wrong => +# "Remember that the trench is *below* sea level - does that mean its height has a positive or negative value?"))); BEGIN_PGML_SOLUTION diff --git a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg index c6477ca935..1ec4fa0564 100644 --- a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg +++ b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg @@ -84,7 +84,7 @@ $absA = abs($a); $absB = abs($b); $absAns1 = abs($ans1); -$refreshCachedImages=1; + $gr = init_graph($a-5,-1,$a+5,1, axes=>[$a-6,0], #grid=>[5,5], diff --git a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg index cf7458ef42..540f0a538e 100644 --- a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg +++ b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg @@ -84,7 +84,7 @@ $absA = abs($a); $absB = abs($b); $absAns1 = abs($ans1); -$refreshCachedImages = 1; + $gr = init_graph($a-12,-1,$a+12,1, axes=>[$a-13,0], #grid=>[5,5], diff --git a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg index 31af71d377..3fdeea4121 100644 --- a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg +++ b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg @@ -84,7 +84,7 @@ $absA = abs($a); $absB = abs($b); $absAns1 = abs($ans1); -$refreshCachedImages=1; + $gr = init_graph($a-8,-1,$a+8,1, axes=>[$a-9,0], #grid=>[5,5], diff --git a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers40.pg b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers40.pg index c56cc590b5..e8ff5cdf8d 100644 --- a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers40.pg +++ b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers40.pg @@ -85,7 +85,7 @@ $absA = abs($a); $absB = abs($b); $absAns1 = abs($ans1); -$refreshCachedImages=1; + $gr = init_graph($a-8,-1,$a+8,1, axes=>[$a-9,0], #grid=>[5,5], diff --git a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg index b5fae3ff04..bfac831536 100644 --- a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg +++ b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg @@ -84,7 +84,7 @@ END_PGML $negB = -$b; $absAns1 = abs($ans1); -$refreshCachedImages=1; + $gr = init_graph($a-12,-1,$a+12,1, axes=>[$a-13,0], #grid=>[5,5], diff --git a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg index d466a6b8b8..21a3023ac6 100644 --- a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg +++ b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg @@ -83,7 +83,7 @@ $absA = abs($a); $negB = -$b; $absAns1 = abs($ans1); -$refreshCachedImages=1; + $gr = init_graph($a-6,-1,$a+6,1, axes=>[$a-7,0], #grid=>[5,5], diff --git a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg index fcc73c7d31..5d024f18f8 100644 --- a/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg +++ b/Contrib/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg @@ -83,7 +83,7 @@ $absA = abs($a); $negB = -$b; $absAns1 = abs($ans1); -$refreshCachedImages=1; + $gr = init_graph(-$a-12,-1,-$a+12,1, axes=>[-$a-13,0], #grid=>[5,5], diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula10.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula10.pg index 13249399bc..0d91ff4d5d 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula10.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula10.pg @@ -52,7 +52,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q(If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.))@]** +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** [_______]{$m} diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg index 4e731a11a1..ec8bb43a4c 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg @@ -52,7 +52,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q(If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.))@]** +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** [_______]{$m} diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula30.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula30.pg index e09cb7ccad..cfe74415b6 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula30.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula30.pg @@ -52,7 +52,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q(If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.))@]** +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** [_______]{$m} diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg index 5284fa5399..c8d0132a7f 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg @@ -52,7 +52,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q(If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.))@]** +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** [_______]{$m} diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula50.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula50.pg index 2a7db948a7..d44b529c45 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula50.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula50.pg @@ -52,7 +52,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q(If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.))@]** +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** [_______]{$m} diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula60.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula60.pg index ef378cf782..55c1757502 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula60.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula60.pg @@ -60,7 +60,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q(If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.))@]** +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** [_______]{$m} diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg index 6c03fdc6f3..89bdda91c0 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg @@ -60,7 +60,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q(If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.))@]** +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** [_______]{$m} diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg index 7971a801f8..8bbedf7452 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg @@ -53,7 +53,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q(If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.))@]** +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** [_______]{$m} END_PGML diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg index b8a30fb131..757c9ad1a9 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg @@ -51,7 +51,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$a],[$y1])`] and [`([$a],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q(If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.))@]** +A line passes through the points [`([$a],[$y1])`] and [`([$a],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** [_______]{$m} diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation40.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation40.pg index eb02aa29ad..bdbe63b97a 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation40.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation40.pg @@ -46,9 +46,9 @@ while (gcd($num,$den)!=1) {$den=random(2,9,1);} $m=Fraction($num,$den); $b=random(1,10,1); -$x1=$den*random(-3,3,1); +$x1=$den*non_zero_random(-3,3,1); $y1=$m*$x1+$b; -$x2=$den*random(-3,3,1); +$x2=$den*non_zero_random(-3,3,1); while ($x2==$x1) {$x2=$den*random(-3,3,1);} $y2=$m*$x2+$b; diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation50.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation50.pg index aeae2c7f23..ccb576e2a5 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation50.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation50.pg @@ -46,9 +46,9 @@ while (gcd($num,$den)!=1) {$den=random(2,9,1);} $m= -Fraction($num,$den); $b=random(1,10,1); -$x1=$den*random(-3,3,1); +$x1=$den*non_zero_random(-3,3,1); $y1=$m*$x1+$b; -$x2=$den*random(-3,3,1); +$x2=$den*non_zero_random(-3,3,1); while ($x2==$x1) {$x2=$den*random(-3,3,1);} $y2=$m*$x2+$b; diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg index 952099157e..c3fc4123c0 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg @@ -25,7 +25,8 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", @@ -38,7 +39,7 @@ loadMacros( Context("Numeric"); TEXT(beginproblem()); -$refreshCachedImages=1; + $m = random(1,5,1); $b = random(-4,4,1); @@ -70,54 +71,26 @@ $ymax = -$ymin; $sizex = 240; $sizey = 240; -#These two variables decide how many labels are on each axis. -$xmark = ceil($xmax/10); -$ymark = ceil($ymax/10); - -#These variables adjust the label positions in the solution graph. -if ($m>0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = -0.3; - $runXShift = 0.1; -} -if ($m<0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = 0.4; - $runXShift = 0.1; -} - -$gr = init_graph($xmin,$ymin,$xmax,$ymax, - axes=>[0,0], - grid=>[$xmax-$xmin,$ymax-$ymin], - size=>[$sizex,$sizey] -); -$gr->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $gr->lb( new Label($j, -0.1, $j,'black','center','top','large')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $gr->lb( new Label(0, $j,' '.$j,'black','left','middle','large')); -} ($start,$stop) = (num_sort($xmin,$xmax,($ymin-$b)/$m+$h,($ymax-$b)/$m+$h))[1,2]; -$gr->moveTo(0,$b); -$gr->arrowTo($start,$m*($start)+$b,'blue',1); -$gr->moveTo(0,$b); -$gr->arrowTo($stop,$m*($stop)+$b,'blue',1); +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; +\end{axis} +END_TIKZ $ALTtext = "Graph of a coordinate system with a linear function that goes through ($x1,$y1) and ($x2,$y2)."; ############################################## @@ -128,7 +101,7 @@ A line's graph is given. What is this line's slope-intercept equation? [@EnlargeImageStatementPGML()@]* ->>[@image( insertGraph($gr), width=>240, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< +>>[@image($gr, width=>300, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< [__]{Compute($ansSI)}{width => 15} @@ -138,30 +111,26 @@ END_PGML Context("Numeric"); -$grCorrect = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[$sizex,$sizey] -); -$grCorrect->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $grCorrect->lb( new Label($j, -0.1, $j,'black','center','top')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $grCorrect->lb( new Label(0, $j,' '.$j,'black','left','middle')); -} -add_functions($grCorrect, "$m*x+$b for x in <$xmin,$xmax> using color:blue and weight:1"); -$grCorrect->stamps( closed_circle($x1,$y1,'red') ); -$grCorrect->lb( new Label($x1+$x1labelx,$y1+$y1labely,"$pt1",'red',"$pt1shift",'middle')); -$grCorrect->stamps( closed_circle($x2,$y2,'red') ); -$grCorrect->lb( new Label($x2+$x2labelx,$y2+$y2labely,"$pt2",'red',"$pt2shift",'middle')); - -$grCorrect->moveTo($x1,$y1); -$grCorrect->lineTo($x2,$y1,'red',2); -$grCorrect->lineTo($x2,$y2,'red',2); -$grCorrect->lb( new Label(($x1+$x2)/2,$y1+$riseYShift,"$run",'red','center','middle')); -$grCorrect->lb( new Label($x2+$runXShift,,($y1+$y2)/2,"$rise",'red','left','middle')); +$grCorrect = createTikZImage(); +$grCorrect->addToPreamble(latexImagePreamble()); +$grCorrect->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[left] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[left] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ Context()->texStrings; BEGIN_SOLUTION @@ -176,7 +145,7 @@ Next, we draw a slope triangle and find the "rise" and "run". In this problem, t $PAR $BCENTER -\{ image( insertGraph($grCorrect), width=>400, height=>400, tex_size=>400, +\{ image($grCorrect, width=>300, tex_size=>400, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} $ECENTER $PAR diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg index d60c86443d..8851f131a5 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg @@ -25,7 +25,8 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", @@ -39,7 +40,7 @@ loadMacros( Context("Numeric"); TEXT(beginproblem()); Context()->flags->set(showExtraParens=>0); -$refreshCachedImages=1; + $m = -random(1,5,1); $b = random(-4,4,1); @@ -73,53 +74,25 @@ $ymax = -$ymin; $sizex = 240; $sizey = 240; -#These two variables decide how many labels are on each axis. -$xmark = ceil($xmax/10); -$ymark = ceil($ymax/10); - -#These variables adjust the label positions in the solution graph. -if ($m>0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = -0.3; - $runXShift = 0.1; -} -if ($m<0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = 0.4; - $runXShift = 0.1; -} - -$gr = init_graph($xmin,$ymin,$xmax,$ymax, - axes=>[0,0], - grid=>[$xmax-$xmin,$ymax-$ymin], - size=>[$sizex,$sizey] -); -$gr->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $gr->lb( new Label($j, -0.1, $j,'black','center','top','large')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $gr->lb( new Label(0, $j,' '.$j,'black','left','middle','large')); -} - ($start,$stop) = (num_sort($xmin,$xmax,($ymin-$b)/$m+$h,($ymax-$b)/$m+$h))[1,2]; -$gr->moveTo(0,$b); -$gr->arrowTo($start,$m*($start)+$b,'blue',1); -$gr->moveTo(0,$b); -$gr->arrowTo($stop,$m*($stop)+$b,'blue',1); + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; +\end{axis} +END_TIKZ $ALTtext = "Graph of a coordinate system with a linear function that goes through ($x1,$y1) and ($x2,$y2)."; ############################################## @@ -130,7 +103,7 @@ A line's graph is given. What is this line's slope-intercept equation? [@EnlargeImageStatementPGML()@]* ->>[@image( insertGraph($gr), width=>240, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< +>>[@image($gr, width=>300, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< [__]{$ansSI}{width => 15} @@ -140,30 +113,26 @@ END_PGML Context("Numeric"); -$grCorrect = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[$sizex,$sizey] -); -$grCorrect->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $grCorrect->lb( new Label($j, -0.1, $j,'black','center','top')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $grCorrect->lb( new Label(0, $j,' '.$j,'black','left','middle')); -} -add_functions($grCorrect, "$m*x+$b for x in <$xmin,$xmax> using color:blue and weight:1"); -$grCorrect->stamps( closed_circle($x1,$y1,'red') ); -$grCorrect->lb( new Label($x1+$x1labelx,$y1+$y1labely,"$pt1",'red',"$pt1shift",'middle')); -$grCorrect->stamps( closed_circle($x2,$y2,'red') ); -$grCorrect->lb( new Label($x2+$x2labelx,$y2+$y2labely,"$pt2",'red',"$pt2shift",'middle')); - -$grCorrect->moveTo($x1,$y1); -$grCorrect->lineTo($x2,$y1,'red',2); -$grCorrect->lineTo($x2,$y2,'red',2); -$grCorrect->lb( new Label(($x1+$x2)/2,$y1+$riseYShift,"$run",'red','center','middle')); -$grCorrect->lb( new Label($x2+$runXShift,,($y1+$y2)/2,"$rise",'red','left','middle')); +$grCorrect = createTikZImage(); +$grCorrect->addToPreamble(latexImagePreamble()); +$grCorrect->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[left] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[left] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ Context()->texStrings; BEGIN_SOLUTION @@ -178,7 +147,7 @@ Next, we draw a slope triangle and find the "rise" and "run". In this problem, t $PAR $BCENTER -\{ image( insertGraph($grCorrect), width=>400, height=>400, tex_size=>400, +\{ image($grCorrect, width=>300, tex_size=>400, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} $ECENTER $PAR diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg index a829cfeada..3d444775a4 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg @@ -25,7 +25,8 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", @@ -39,7 +40,7 @@ loadMacros( Context("Fraction"); TEXT(beginproblem()); -$refreshCachedImages=1; + $num=random(1,9,1); @@ -78,56 +79,26 @@ $ymax = -$ymin; $sizex = 240; $sizey = 240; -#These two variables decide how many labels are on each axis. -$xmark = ceil($xmax/10); -$ymark = ceil($ymax/10); - -#These variables adjust the label positions in the solution graph. -if ($m>0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = -0.3; - $runXShift = 0.1; -} -if ($m<0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = 0.4; - $runXShift = 0.1; -} - -$gr = init_graph($xmin,$ymin,$xmax,$ymax, - axes=>[0,0], - grid=>[$xmax-$xmin,$ymax-$ymin], - size=>[$sizex,$sizey] -); -$gr->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $gr->lb( new Label($j, -0.1, $j,'black','center','top','large')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $gr->lb( new Label(0, $j,' '.$j,'black','left','middle','large')); -} - ($start,$stop) = (num_sort($xmin,$xmax,($ymin-$b)/$mperl+$h,($ymax-$b)/$mperl+$h))[1,2]; -$gr->moveTo($x1,$y1); -$gr->arrowTo($start,$mperl*($start)+$b,'blue',1); -$gr->moveTo($x1,$y1); -$gr->arrowTo($stop,$mperl*($stop)+$b,'blue',1); -$gr->stamps( closed_circle($x1,$y1,'blue') ); -$gr->stamps( closed_circle($x2,$y2,'blue') ); +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ $ALTtext = "Graph of a coordinate system with a linear function that goes through ($x1,$y1) and ($x2,$y2)."; #The variable ansSIRight is for displaying correct answer. @@ -147,7 +118,7 @@ A line's graph is given. What is this line's slope-intercept equation? [@EnlargeImageStatementPGML()@]* ->>[@image( insertGraph($gr), width=>240, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< +>>[@image($gr, width=>300, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< [__]{$evaluator}{width => 15} @@ -157,30 +128,26 @@ END_PGML Context("Numeric"); -$grCorrect = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[$sizex,$sizey] -); -$grCorrect->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $grCorrect->lb( new Label($j, -0.1, $j,'black','center','top')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $grCorrect->lb( new Label(0, $j,' '.$j,'black','left','middle')); -} -add_functions($grCorrect, "$m*x+$b for x in <$xmin,$xmax> using color:blue and weight:1"); -$grCorrect->stamps( closed_circle($x1,$y1,'red') ); -$grCorrect->lb( new Label($x1+$x1labelx,$y1+$y1labely,"$pt1",'red',"$pt1shift",'middle')); -$grCorrect->stamps( closed_circle($x2,$y2,'red') ); -$grCorrect->lb( new Label($x2+$x2labelx,$y2+$y2labely,"$pt2",'red',"$pt2shift",'middle')); - -$grCorrect->moveTo($x1,$y1); -$grCorrect->lineTo($x2,$y1,'red',2); -$grCorrect->lineTo($x2,$y2,'red',2); -$grCorrect->lb( new Label(($x1+$x2)/2,$y1+$riseYShift,"$run",'red','center','middle')); -$grCorrect->lb( new Label($x2+$runXShift,,($y1+$y2)/2,"$rise",'red','left','middle')); +$grCorrect = createTikZImage(); +$grCorrect->addToPreamble(latexImagePreamble()); +$grCorrect->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[left] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[left] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ Context()->texStrings; BEGIN_SOLUTION @@ -195,7 +162,7 @@ Next, we draw a slope triangle and find the "rise" and "run". In this problem, t $PAR $BCENTER -\{ image( insertGraph($grCorrect), width=>400, height=>400, tex_size=>400, +\{ image($grCorrect, width=>300, tex_size=>400, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} $ECENTER $PAR diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg index a805d455f1..7381d16b5f 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg @@ -25,7 +25,8 @@ DOCUMENT(); loadMacros( - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", @@ -39,7 +40,7 @@ loadMacros( Context("Fraction"); TEXT(beginproblem()); -$refreshCachedImages=1; + $num=random(1,9,1); @@ -78,56 +79,27 @@ $ymax = -$ymin; $sizex = 240; $sizey = 240; -#These two variables decide how many labels are on each axis. -$xmark = ceil($xmax/10); -$ymark = ceil($ymax/10); - -#These variables adjust the label positions in the solution graph. -if ($m>0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = -0.3; - $runXShift = 0.1; -} -if ($m<0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = 0.4; - $runXShift = 0.1; -} - -$gr = init_graph($xmin,$ymin,$xmax,$ymax, - axes=>[0,0], - grid=>[$xmax-$xmin,$ymax-$ymin], - size=>[$sizex,$sizey] -); -$gr->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $gr->lb( new Label($j, -0.1, $j,'black','center','top','large')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $gr->lb( new Label(0, $j,' '.$j,'black','left','middle','large')); -} - ($start,$stop) = (num_sort($xmin,$xmax,($ymin-$b)/$mperl+$h,($ymax-$b)/$mperl+$h))[1,2]; -$gr->moveTo($x1,$y1); -$gr->arrowTo($start,$mperl*($start)+$b,'blue',1); -$gr->moveTo($x1,$y1); -$gr->arrowTo($stop,$mperl*($stop)+$b,'blue',1); -$gr->stamps( closed_circle($x1,$y1,'blue') ); -$gr->stamps( closed_circle($x2,$y2,'blue') ); +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ + $ALTtext = "Graph of a coordinate system with a linear function that goes through ($x1,$y1) and ($x2,$y2)."; @@ -147,7 +119,7 @@ A line's graph is given. What is this line's slope-intercept equation? [@EnlargeImageStatementPGML()@]* ->>[@image( insertGraph($gr), width=>240, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< +>>[@image($gr, width=>300, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< [__]{$evaluator}{width => 15} @@ -157,30 +129,26 @@ END_PGML Context("Numeric"); -$grCorrect = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[$sizex,$sizey] -); -$grCorrect->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $grCorrect->lb( new Label($j, -0.1, $j,'black','center','top')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $grCorrect->lb( new Label(0, $j,' '.$j,'black','left','middle')); -} -add_functions($grCorrect, "$m*x+$b for x in <$xmin,$xmax> using color:blue and weight:1"); -$grCorrect->stamps( closed_circle($x1,$y1,'red') ); -$grCorrect->lb( new Label($x1+$x1labelx,$y1+$y1labely,"$pt1",'red',"$pt1shift",'middle')); -$grCorrect->stamps( closed_circle($x2,$y2,'red') ); -$grCorrect->lb( new Label($x2+$x2labelx,$y2+$y2labely,"$pt2",'red',"$pt2shift",'middle')); - -$grCorrect->moveTo($x1,$y1); -$grCorrect->lineTo($x2,$y1,'red',2); -$grCorrect->lineTo($x2,$y2,'red',2); -$grCorrect->lb( new Label(($x1+$x2)/2,$y1+$riseYShift,"$run",'red','center','middle')); -$grCorrect->lb( new Label($x2+$runXShift,,($y1+$y2)/2,"$rise",'red','left','middle')); +$grCorrect = createTikZImage(); +$grCorrect->addToPreamble(latexImagePreamble()); +$grCorrect->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[left] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[left] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ Context()->texStrings; BEGIN_SOLUTION @@ -195,7 +163,7 @@ Next, we draw a slope triangle and find the "rise" and "run". In this problem, t $PAR $BCENTER -\{ image( insertGraph($grCorrect), width=>400, height=>400, tex_size=>400, +\{ image($grCorrect, width=>300, tex_size=>400, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} $ECENTER $PAR diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg index 14b9db203a..df93b9db9a 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg @@ -37,7 +37,7 @@ loadMacros( Context("Numeric"); TEXT(beginproblem()); -$refreshCachedImages=1; + $m = 0; $b = non_zero_random(-4,4,1); diff --git a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg index 95b2c097a1..794c61ed72 100644 --- a/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg +++ b/Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg @@ -37,7 +37,7 @@ loadMacros( Context("Numeric"); TEXT(beginproblem()); -$refreshCachedImages=1; + $a = non_zero_random(-4,4,1); diff --git a/Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation190.pg b/Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation190.pg index 78e285281e..a197309540 100644 --- a/Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation190.pg +++ b/Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation190.pg @@ -86,7 +86,7 @@ BEGIN_PGML_SOLUTION [` \begin{aligned} [$var4] &= [$var3]-\frac{[$a][$var1]}{[$var2]} \\ -[$var2] \cdot [$var4] &= [$var2] \cdot\left( [$var3]- [$var2] \frac{[$a][$var1]}{[$var2]}\right) \\ +[$var2] \cdot [$var4] &= [$var2] \cdot\left( [$var3]- \frac{[$a][$var1]}{[$var2]}\right) \\ [$var2] \cdot [$var4] &= [$var2] \cdot [$var3] - [$var2] \cdot \frac{[$a][$var1]}{[$var2]} \\ [$var2][$var4] &= [$var2][$var3] -[$a][$var1] \\ [$var2][$var4] \mathbf{{} -[$var2][$var3]}&= [$var2][$var3] -[$a][$var1]\mathbf{{} -[$var2][$var3]} \\ diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg index 09684acd8f..41432f3db1 100644 --- a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg @@ -41,7 +41,7 @@ loadMacros( Context("Point"); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #These two arrays store the coordinates of the intersections. #(x[0],y[0]) is the correct solution in the correct graph. diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg index cc6a08c38b..3304bf0feb 100644 --- a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## Context("Point"); -$refreshCachedImages=1; + #These two arrays store the coordinates of the intersections. #(x[0],y[0]) is the correct solution in the correct graph. diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg index 13c46d4ac3..b2e524edc5 100644 --- a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg @@ -40,7 +40,7 @@ loadMacros( ############################################## Context("Point"); -$refreshCachedImages=1; + #These two arrays store the coordinates of the intersections. #(x[0],y[0]) is the correct solution in the correct graph. diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg index 47c0e17adc..bc922fc53a 100644 --- a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## Context("Point"); -$refreshCachedImages=1; + #These two arrays store the coordinates of the intersections. #(x[0],y[0]) is the correct solution in the correct graph. diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg index 16a1ae482f..3609b74a34 100644 --- a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## Context("Point"); -$refreshCachedImages=1; + #These two arrays store the coordinates of the intersections. #(x[0],y[0]) is the correct solution in the correct graph. diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg index 3e2560c43a..e185686bc1 100644 --- a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg @@ -53,7 +53,7 @@ Context("Point"); ); $intersection = Compute("no solution"); -$refreshCachedImages=1; + Context("Fraction"); Context()->variables->add(y => "Real"); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg index 524ee77461..8babd0c44c 100644 --- a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## -$refreshCachedImages=1; + Context("Point"); Context()->strings->add("no solution"=>{}, "no solutions"=>{alias=>'no solution'}, diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg index 860e44f7a9..539186f51f 100644 --- a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg @@ -41,7 +41,7 @@ loadMacros( ############################################## -$refreshCachedImages=1; + Context("Point"); Context()->strings->add("no solution"=>{}, diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub10.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub10.pg new file mode 100644 index 0000000000..a07c17b1eb --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub10.pg @@ -0,0 +1,292 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Solve the system of linear equations +# a x + b y = e +# c x + d y = f +# where a, b, c, d are (positive) integer values on the interval [1,5] +# +# The solution, (x,y), where x and y are both integers on the interval +# [-10,10]. +# +# Last updated: Carl Yao, 6/25/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->parens->undefine('['); +Context()->parens->undefine('{'); +Context()->parens->undefine('|'); +Context()->parens->undefine('<'); +#This approach guarantees integer solutions + +# start with the solution +$x=random(-10,10,1); +$y=random(-10,10,1); + +# set up the system +# a x + b y =e +# c x + d y = f +# need to make sure that +# ad - bc != 0 + +# initialize the variables +$a=1; +$b=1; +$c=1; +$d=1; + +# set up $a, $b, $c, $d +while($a*$d -$c*$b == 0){ +$a=random(2,5,1); +$b=random(2,5,1); +$c=random(2,5,1); +$d=random(2,5,1); +# guarantee one is 1 so substitution is the right method +if (list_random(1,0,0,0)) {$a = 1;} +elsif (list_random(1,0,0)) {$b = 1;} +elsif (list_random(1,0,)) {$c = 1;} +else {$d = 1;} +} + +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$topLeft = Formula("$a*x+$b*y")->reduce; +$e = $topLeft->eval(x=>$x,y=>$y); + +$botLeft = Formula("$c*x+$d*y")->reduce; +$f = $botLeft->eval(x=>$x,y=>$y); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "infinite number of solutions"=>{}, + "infinite"=>{alias=>'infinite number of solutions'}, + "infinite solutions"=>{alias=>'infinite number of solutions'}); + +$ans = Compute("($x,$y)"); + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{\begin{aligned} + [$topLeft] & = [$e] \\ + [$botLeft] & = [$f] +\end{aligned}\right.```] + +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** + +[_________________________________] + +END_PGML + +ANS($ans -> cmp() -> + withPostFilter(AnswerHints( + ["infinity"] => + "It doesn't make sense to say 'infinity' here- did you mean 'infinite number of solutions'?."))); + +$commonConclusion = "The solution to the system is [`($x,$y)`]. It is left as an exercise to check. Please also note that you may have solved this problem a different way."; + +if($a==1 and $a!=$c and $b!=$d) +{ + # x + by = e should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$e-$b*y")->reduce; + $lhs=Formula("$c*$e-$c*$b*y+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +1. From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. + +1. This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. + +1. Now that we have [`y`], we find [`x`] using the _first_ equation: + + [```\begin{aligned} + x&=[$e]-([$b])\cdot([$y])\\ + &=[$x] + \end{aligned}```] + +1. [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==1 and $b!=$d and $a!=$c) +{ + # ax + y = e should be solved for y + # provided that $b and $d are not equal- in this case we should use subtraction. + $lhs=Formula("$c*x+$d*$e-$d*$a*x")->reduce; + $rhs=Formula("$e-$a*x")->reduce; + +BEGIN_PGML_SOLUTION +1. From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. + +1. This gives [`[$lhs]=[$f]`] so [`x=[$x]`] + +1. Now that we have [`x`], we find [`y`] using the first equation: + + [``` + \begin{aligned} + y&=[$e]-([$a])\cdot([$x])\\ + &=[$y] + \end{aligned}```] + +1. [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==1 and $a!=$c and $b!=$d) +{ + # x + dy = f should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$f-$d*y")->reduce; + $lhs=Formula("$a*$f-$a*$d*y+$b*y")->reduce; +BEGIN_PGML_SOLUTION +1. From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. + +1. This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. + +1. Now that we have [`y`], we find [`x`] using the _second_ equation: + + [``` + \begin{aligned} + x&=[$f]-([$d])\cdot([$y])\\ + &=[$x] + \end{aligned}```] + +1. [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==1 and $d!=$b and $a!=$c) +{ + # cx + y = f should be solved for y + $rhs=Formula("$f-$c*x")->reduce; + $lhs=Formula("$a*x+$b*$f-$b*$c*x")->reduce; + +BEGIN_PGML_SOLUTION +1. From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. + +1. This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. + +1. Now that we have [`x`], we find [`y`] using the _second_ equation: + + [``` + \begin{aligned} + y&=[$f]-([$c])\cdot([$x])\\ + &=[$y] + \end{aligned}```] + +1. [$commonConclusion]** +END_PGML_SOLUTION +} +else +{ + if($a==$c) + { + # ax + by = e + # ax + dy = f + # should be solved using subtraction + $lhs=Formula("$b*y-$d*y")->reduce; + $lhs1=Formula("$a*x+$b*($y)")->reduce; +BEGIN_PGML_SOLUTION +1. We subtract the two equations, which will cancel the terms in involving [`x`] and give [`[$lhs]=[$e]-([$f])`]. + +1. This gives [`y=[$y]`]. + +1. Now that we have [`y`], we find [`x`] using either equation. Let's use the first: [`[$lhs1]=[$e]`], so [`x=[$x]`]. + +1. [$commonConclusion]** +END_PGML_SOLUTION + } + elsif($b==$d) + { + # ax + by = e + # cx + by = f + # should be solved using subtraction + $lhs=Formula("$a*x-$c*x")->reduce; + $lhs1=Formula("$a*($x)+$b*y")->reduce; +BEGIN_PGML_SOLUTION +1. We subtract the two equations, which will cancel the terms in involving [`y`] and give [`[$lhs]=[$e]-([$f])`]. + +1. This gives [`x=[$x]`]. + +1. Now that we have [`x`], we find [`y`] using either equation. Let's use the first: [`[$lhs1]=[$e]`], so [`y=[$y]`]. + +1. [$commonConclusion]** +END_PGML_SOLUTION + } + else + { + # otherwise use elimination + + # multiply the first equation by $c + $topleft=Formula("$c*$a*x+$c*$b*y")->reduce; + $topright=$c*$e; + + # multiply the second equation by $a + $bottomleft=Formula("$a*$c*x+$a*$d*y")->reduce; + $bottomright=$a*$f; + + $lhs=Formula("$c*$b*y-$a*$d*y")->reduce; + $rhs=$c*$e-$a*$f; + + # put them together +BEGIN_PGML_SOLUTION +1. Let's multiply the _first_ equation by [$c] and the _second_ equation by [$a] + + [```\begin{aligned} + [$topleft] &= [$topright]\\ + [$bottomleft] &=[$bottomright] + \end{aligned}```] + +1. Subtracting these two equations gives [`[$lhs]=[$rhs]`], so [`y=[$y]`]. + +1. Now that we have [`y`], we can use either equation to find [`x`]; let's use the first one: + + [```[$a]*x+([$b])\cdot([$y])=[$e]```] + + so [`x=[$x]`]. + +1. [$commonConclusion]** +END_PGML_SOLUTION + } +} + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub30.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub30.pg new file mode 100644 index 0000000000..12663ae371 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub30.pg @@ -0,0 +1,263 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Solve the system of linear equations +# a x + b y =e +# c x + d y = f +# where a, b, c, d are NEGATIVE integer values on the interval [-5,1] +# +# The solution, (x,y), where x and y are both integers on the interval +# [-10,10]. +# +# Last updated: Carl Yao, 6/25/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); + +#This approach guarantees integer solutions + +# start with the solution +$x=random(-10,10,1); +$y=random(-10,10,1); + +# set up the system +# a x + b y =e +# c x + d y = f +# need to make sure that +# ad - bc != 0 + +# initialize the variables +$a=1; +$b=1; +$c=1; +$d=1; + +while($a*$d -$c*$b == 0){ +$a=random(-5,-1,1); +$b=random(-5,-1,1); +$c=random(-5,-1,1); +$d=random(-5,-1,1); +# guarantee one is 1 so substitution is the right method +if (list_random(1,0,0,0)) {$a = 1;} +elsif (list_random(1,0,0)) {$b = 1;} +elsif (list_random(1,0,)) {$c = 1;} +else {$d = 1;} + +} + +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$topLeft = Formula("$a*x+$b*y")->reduce; +$e = $topLeft->eval(x=>$x,y=>$y); + +$botLeft = Formula("$c*x+$d*y")->reduce; +$f = $botLeft->eval(x=>$x,y=>$y); + +$commonConclusion = "The solution to the system is [`($x,$y)`]. It is left as an exercise to check. Please also note that you may have solved this problem a different way."; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "infinite number of solutions"=>{}, + "infinite"=>{alias=>'infinite number of solutions'}, + "infinite solutions"=>{alias=>'infinite number of solutions'}); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{\begin{aligned} + [$topLeft] & = [$e] \\ + [$botLeft] & = [$f] +\end{aligned}\right.```] + +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** + +[_________________________________]{Compute("($x,$y)")} + +END_PGML + + +if($a==-1 and $a != $c and $b!=$d) +{ + # - x + by = e should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$b*y-$e")->reduce; + $lhs=Formula("$c*$b*y-$c*$e+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. +* This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. +* We find [`x`] using the _first_ equation: + + [`\begin{aligned} + x&=([$b])\cdot([$y])-([$e])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==-1 and $b!=$d and $a!=$c) +{ + # ax - y = e should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$a*x-$e")->reduce; + $lhs=Formula("$c*x+$d*$a*x-$d*$e")->reduce; +BEGIN_PGML_SOLUTION +* From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$f]`] so [`x=[$x]`]. +* We find [`y`] using the first equation: + + [`\begin{aligned} + y&=([$a])\cdot([$x])-([$e]) \\ + &=[$y]\end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==-1 and $a!=$c and $b!=$d) +{ + # - x + dy = f should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$d*y-$f")->reduce; + $lhs=Formula("$a*$d*y-$a*$f+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. +* This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. +* We find [`x`] using the _second_ equation: + + [`\begin{aligned} + x&=([$d])\cdot([$y])-([$f])\\ + &=[$x] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==-1 and $b!=$d and $a!=$c) +{ + # cx - y = f should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$c*x-$f")->reduce; + $lhs=Formula("$a*x+$b*$c*x-$b*$f")->reduce; + +BEGIN_PGML_SOLUTION +* From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. +* We find [`y`] using the _second_ equation: + + [`\begin{aligned} + y&=([$c])\cdot([$x])-([$f])\\ + &=[$y] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +else +{ + if($a==$c) + { + # ax + by = e + # ax + dy = f + # should be solved using subtraction + $lhs=Formula("$b*y-$d*y")->reduce; + $lhs1=Formula("$a*x+$b*$y")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms involving [`x`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`y=[$y]`]. +* We find [`x`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + elsif($b==$d) + { + # ax + by = e + # cx + by = f + # should be solved using subtraction + $lhs=Formula("$a*x-$c*x")->reduce; + $lhs1=Formula("$a*($x)+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms involving [`y`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`x=[$x]`]. +* We find [`y`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + else + { + # otherwise use elimination + + # multiply the first equation by $c + $topleft=Formula("$c*$a*x+$c*$b*y")->reduce; + $topright=$c*$e; + + # multiply the second equation by $a + $bottomleft=Formula("$a*$c*x+$a*$d*y")->reduce; + $bottomright=$a*$f; + + $lhs=Formula("$c*$b*y-$a*$d*y")->reduce; + $rhs=$c*$e-$a*$f; + + # put them together +BEGIN_PGML_SOLUTION +* Let's multiply the _first_ equation by [$c] and the _second_ equation by [$a] + + [`\begin{aligned} + [$topleft] &= [$topright]\\ + [$bottomleft] &=[$bottomright] + \end{aligned}`] +* Subtracting these two equations gives [`[$lhs]=[$rhs]`], so [`y=[$y]`]. + +* Now that we have [`y`], we can use either equation to find [`x`]; let's use the first one: + + [`[$a]*x+([$b])\cdot([$y])=[$e]`] + + so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } +} + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub40.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub40.pg new file mode 100644 index 0000000000..182c5254a6 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub40.pg @@ -0,0 +1,238 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Solve the system of linear equations +# a x + b y =e +# c x + d y = f +# where only ONE of a, b, c, d is ZERO, and the rest will be (non-zero) integer values on the interval [-5,5] +# +# The solution is, (x,y), where x and y are both integers on the interval +# [-10,10]. +# +# Last updated: Carl Yao, 6/25/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); + +#This approach guarantees integer solutions + +# start with the solution +$x=random(-10,10,1); +$y=random(-10,10,1); + +# set up the system +# a x + b y = e +# c x + d y = f +# need to make sure that +# ad - bc != 0 + +# initialize the variables +$a=1; +$c=1; +$b=1; +$d=1; + +while($a*$d -$c*$b == 0){ +$a=random(-5,5,1); +if($a==0) +{ + # if $a==0 then we don't want any of the other variables + # to be 0 + $b=non_zero_random(-5,5,1); +} +else +{ + # otherwise $b can be anything + $b=random(-5,5,1); +} +if($a*$b==0) +{ + # if one of $a or $b is 0, then we don't want $c to be 0 + $c=non_zero_random(-5,5,1); +} +else +{ + # otherwise $c can be zero + $c=random(-5,5,1); +} +if($a*$b*$c==0) +{ + # if one of $a, $b, or $c is 0, then we don't want $d to be 0 + $d=non_zero_random(-5,5,1); +} +else +{ + # otherwise it must be 0 for this particular problem + $d=0 +} +} + +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$topLeft = Formula("$a*x+$b*y")->reduce; +$e = $topLeft->eval(x=>$x,y=>$y); + +$botLeft = Formula("$c*x+$d*y")->reduce; +$f = $botLeft->eval(x=>$x,y=>$y); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "infinite number of solutions"=>{}, + "infinite"=>{alias=>'infinite number of solutions'}, + "infinite solutions"=>{alias=>'infinite number of solutions'}); + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{\begin{aligned} + [$topLeft] & = [$e] \\ + [$botLeft] & = [$f] +\end{aligned}\right.```] + +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** + +[_________________________________]{Compute("($x,$y)")} + +END_PGML + +$commonConclusion = "The solution to the system is [`($x,$y)`]. It is left as an exercise to check. Please also note that you may have solved this problem a different way."; + +# solution key +if($a==0) +{ + # by = e + # ax + dy = f + # should be solved by using y from the first equation + $lhs=Formula("$c*x+$d*$y")->reduce; + # the first step depends on if |$b|=1 + if(abs($b)!=1) + { + $firststep="Let's solve the first equation for [`y`]; we divide both sides of the equation by [`$b`], so [`y=$y`]."; + } + else + { + $firststep="Clearly the first equation tells us that [`y=$y`]"; + } +BEGIN_PGML_SOLUTION +* [$firststep]** +* We find [`x`] by substituting this value of [`y`] in to the second equation: [`[$lhs]=[$f]`], and solving for [`x`]. +* This gives [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==0) +{ + # ax = e + # ax + dy = f + # should be solved by using x from the first equation + $lhs=Formula("$c*$x+$d*y")->reduce; + + # the first step depends on if |$a|=1 + if(abs($a)!=1) + { + $firststep="Let's solve the first equation for [`x`]; we divide both sides of the equation by [`$a`], so [`x=$x`]."; + } + else + { + $firststep="Clearly the first equation tells us that [`x=$x`]."; + } +BEGIN_PGML_SOLUTION +* [$firststep]** +* We find [`y`] by substituting this value of [`x`] in to the second equation: [`[$lhs]=[$f]`], and solving for [`y`]. +* This gives [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==0) +{ + # ax + by = e + # dy = f + # should be solved by using y from the second equation + $lhs=Formula("$a*x+$b*$y")->reduce; + # the first step depends on if |$d|=1 + if(abs($d)!=1) + { + $firststep="Let's solve the second equation for [`y`]; we divide both sides of the equation by [`$d`], so [`y=$y`]."; + } + else + { + $firststep="Clearly the second equation tells us that [`y=$y`]."; + } +BEGIN_PGML_SOLUTION +* [$firststep]** +* We find [`x`] by substituting this value of [`y`] in to the first equation: [`[$lhs]=[$e]`], and solving for [`x`]. +* This gives [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==0) +{ + # ax + by = e + # cx = f + # should be solved by using x from the second equation + $lhs=Formula("$a*$x+$b*y")->reduce; + + # the first step depends on if |$c|=1 + if(abs($c)!=1) + { + $firststep="Let's solve the second equation for [`x`]; we divide both sides of the equation by [`$c`], so [`x=$x`]."; + } + else + { + $firststep="Clearly the second equation tells us that [`x=$x`]."; + } +BEGIN_PGML_SOLUTION +* [$firststep]** +* We find [`y`] by substituting this value of [`x`] in to the first equation: [`[$lhs]=[$e]`], and solving for [`y`]. +* This gives [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} + +TEXT(PGML::Format2(<<'END_PGML_HINT')); +*Hint* +* The solution is an ordered pair, so you'll write it in the form [`(x,y)`] +* Both [`x`] and [`y`] are integers between [`-10`] and [`10`] +END_PGML_HINT + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub05.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub05.pg new file mode 100644 index 0000000000..f8e20b9865 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub05.pg @@ -0,0 +1,167 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -exactly one of the four coefficients is 0 +# -its partner coefficient is +- 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +# One of the equations is simply variable = number +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1), $b = Fraction(1,1)}; +if ($zero == 1) {$b = Fraction(0,1), $a = Fraction(1,1)}; +if ($zero == 2) {$c = Fraction(0,1), $d = Fraction(1,1)}; +if ($zero == 3) {$d = Fraction(0,1), $c = Fraction(1,1)}; + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub10.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub10.pg new file mode 100644 index 0000000000..8bd6904570 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub10.pg @@ -0,0 +1,166 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -exactly one of the four coefficients is 0 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +# One of the equations is simply const*var = const +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1)}; +if ($zero == 1) {$b = Fraction(0,1)}; +if ($zero == 2) {$c = Fraction(0,1)}; +if ($zero == 3) {$d = Fraction(0,1)}; + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub11.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub11.pg new file mode 100644 index 0000000000..114cfc6001 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub11.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like y=-2x+8, y=7x-10 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,-1,1), random(1,1,1)); +$d = Fraction(non_zero_random(1,1,1), random(1,1,1)); +# Above means some coefficients are 1, and solution will use substitution method + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(1,1,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub12.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub12.pg new file mode 100644 index 0000000000..fe5347832b --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub12.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like y=2x+1, 2x+3y=# +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(1,5,1), random(1,1,1)); +# Above means one coefficient will be 1, and substitution method will be used + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub13.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub13.pg new file mode 100644 index 0000000000..42f5b406ac --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub13.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like y=-2x-1, 2x-3y=# +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,-1,1), random(1,1,1)); +# Above means one coefficient will be 1, and substitution method will be used + +$det = $a*$d-$b*$c; + +$e = $det*non_zero_random(-3,3,1); +$f = $det*non_zero_random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub14.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub14.pg new file mode 100644 index 0000000000..edf5fe8336 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub14.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like x=2y-3, 2x+5y=# +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +# Above means one coefficient will be 1, and substitution method will be used + +$det = $a*$d-$b*$c; + +$e = $det*non_zero_random(-3,3,1); +$f = $det*non_zero_random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,0,1), random(1,1,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub15.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub15.pg new file mode 100644 index 0000000000..6721ed3485 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub15.pg @@ -0,0 +1,171 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -one of the coefficients is 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(-1,1)} else {$a = Fraction(1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(-1,1)} else {$b = Fraction(1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(-1,1)} else {$c = Fraction(1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(-1,1)} else {$d = Fraction(1,1)}}; +# Above means one coefficient will be 1, and substitution method will be used + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub16.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub16.pg new file mode 100644 index 0000000000..b57f12d827 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub16.pg @@ -0,0 +1,161 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -no solutions +# like y=(2/3)x+a, y=(2/3)x+b (no solution) +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = $a; +$d = Fraction(non_zero_random(1,1,1), random(1,1,1)); +# Above means the equations have the same slope, so solution is a quick recognition + +$det = $a*$d-$b*$c; + +$e = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +do {$f = Fraction(non_zero_random(-5,5,1), random(1,5,1));} until ($f != $e); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(1,1,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +#SystemOfLinearEquationsProblemSolutionSetup(); +$Attack = "Since these two lines have the same slope, but different [`y`]-intercepts, they are parallel lines. They never intersect and therefore the system has no solution."; + + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub17.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub17.pg new file mode 100644 index 0000000000..70ebe5b9c6 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub17.pg @@ -0,0 +1,163 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# integer coefficients +# fraction solutions +# both equations in standard form +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +$x = 'x'; +$y = 'y'; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +$det = $a*$d-$b*$c; + +$e = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +do {$f = Fraction(non_zero_random(-5,5,1), random(1,1,1));} until ($f != $e); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,0,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub20.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub20.pg new file mode 100644 index 0000000000..8d76b6c2ae --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub20.pg @@ -0,0 +1,171 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -one of the coefficients is -1, none of the others are 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(1,1)} else {$a = Fraction(-1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(1,1)} else {$b = Fraction(-1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(1,1)} else {$c = Fraction(-1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(1,1)} else {$d = Fraction(-1,1)}}; +# Above means one coefficient will be 1, and substitution method will be used + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub25.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub25.pg new file mode 100644 index 0000000000..ec1e313773 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub25.pg @@ -0,0 +1,169 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -solutions can be fractions +# -one coefficient is 0 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1)}; +if ($zero == 1) {$b = Fraction(0,1)}; +if ($zero == 2) {$c = Fraction(0,1)}; +if ($zero == 3) {$d = Fraction(0,1)}; +# Above means one coefficient will be 0, so one variable is quickly solved for + +$e = Fraction(random(-5,5,1), random(1,1,1)); +$f = Fraction(random(-5,5,1), random(1,1,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub30.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub30.pg new file mode 100644 index 0000000000..1ad0f44d92 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub30.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -solutions can be fractions +# -no coefficient is 0 +# -one coefficient is 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(-1,1)} else {$a = Fraction(1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(-1,1)} else {$b = Fraction(1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(-1,1)} else {$c = Fraction(1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(-1,1)} else {$d = Fraction(1,1)}}; +# Above means one coefficient will be 1, and substitution method will be used + +$e = Fraction(random(-5,5,1), random(1,1,1)); +$f = Fraction(random(-5,5,1), random(1,1,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub35.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub35.pg new file mode 100644 index 0000000000..9b5d76b991 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub35.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -solutions can be fractions +# -no coefficient is 0 +# -one coefficient is -1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(1,1)} else {$a = Fraction(-1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(1,1)} else {$b = Fraction(-1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(1,1)} else {$c = Fraction(-1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(1,1)} else {$d = Fraction(-1,1)}}; +# Above means one coefficient will be 1, and substitution method will be used + +$e = Fraction(random(-5,5,1), random(1,1,1)); +$f = Fraction(random(-5,5,1), random(1,1,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub40.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub40.pg new file mode 100644 index 0000000000..60daad767e --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub40.pg @@ -0,0 +1,165 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -fraction coefficients +# -exactly one of the four coefficients is 0 +# -its partner coefficient is +- 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,5,1)); + +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1), $b = Fraction(1,1)}; +if ($zero == 1) {$b = Fraction(0,1), $a = Fraction(1,1)}; +if ($zero == 2) {$c = Fraction(0,1), $d = Fraction(1,1)}; +if ($zero == 3) {$d = Fraction(0,1), $c = Fraction(1,1)}; +# Above means one coefficient will be 0, and one variable can be solved for immediately + +$e = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$f = Fraction(non_zero_random(-5,5,1), random(1,5,1)); + +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub45.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub45.pg new file mode 100644 index 0000000000..b0a2a98670 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub45.pg @@ -0,0 +1,163 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -fraction coefficients +# -exactly one of the four coefficients is 0 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,5,1)); + +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1)}; +if ($zero == 1) {$b = Fraction(0,1)}; +if ($zero == 2) {$c = Fraction(0,1)}; +if ($zero == 3) {$d = Fraction(0,1)}; +# Above means one coefficient will be 0, and a variable can be solved for immediately + +$e = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$f = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations70.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations70.pg index eec4e8120b..a15c860c54 100644 --- a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations70.pg +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations70.pg @@ -88,9 +88,9 @@ $d=1; # set up $a, $b, $c, $d while($a*$d -$c*$b == 0){ $a=random(1,5,1)*random(-1,1,2); -$b=random(1,5,1)*random(-1,1,2);; -$c=random(1,5,1)*random(-1,1,2);; -$d=random(1,5,1)*random(-1,1,2);; +$b=random(1,5,1)*random(-1,1,2); +$c=random(1,5,1)*random(-1,1,2); +$d=random(1,5,1)*random(-1,1,2); } $topLeft = Formula("$a*x+$b*y")->reduce; diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub70.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub70.pg new file mode 100644 index 0000000000..0749e94b7d --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub70.pg @@ -0,0 +1,399 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Solve the system of linear equations +# a x + b y = e +# c x + d y = f +# where a, b, c, d are integer values on the interval [1,5] +# +# The solution is (x,y) where x and y are both fractions with numerators +# and denominators on the interval [-10,10]. +# +# Last updated: Hughes 7/30/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','fraction') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction-NoDecimals"); + Context()->{precedence}{Fraction} = 2.5; + Context()->parens->set('(' => {type => "Point"} ); + Context()->flags->set(reduceFractions=>0,allowMixedNumbers=>1,requirePureFractions=>1); +Context()->{error}{msg}{"Mixed numbers are not allowed; you must use a pure fraction"} + = "Mixed numbers are not allowed; you must use a pure fraction, for example you should enter 5/4 and not 1 1/4"; + +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->are(x=>'Real',y=>'Real'); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "infinite number of solutions"=>{}, + "infinite"=>{alias=>'infinite number of solutions'}, + "infinite solutions"=>{alias=>'infinite number of solutions'}); + +# the solution +$xnumerator = random(2,10,2); # even number +$xdenominator = random(3,11,2); # odd number +$ynumerator = random(3,11,2); # odd number +$ydenominator = random(2,10,2); # even number + +$x = Fraction($xnumerator,$xdenominator)->reduce; +$y = Fraction($ynumerator,$ydenominator)->reduce; +$ans = List("($x,$y)"); + +# set up the system +# a x + b y =e +# c x + d y = f +# need to make sure that +# ad - bc != 0 + +# initialize the variables +$a=1; +$b=1; +$c=1; +$d=1; + +# set up $a, $b, $c, $d +while($a*$d -$c*$b == 0){ +$a=random(2,5,1)*random(-1,1,2); +$b=random(2,5,1)*random(-1,1,2);; +$c=random(2,5,1)*random(-1,1,2);; +$d=random(2,5,1)*random(-1,1,2);; +#make sure one of them is 1 +if (list_random(1,0,0,0)) {$a = 1;} +elsif (list_random(1,0,0)) {$b = 1;} +elsif (list_random(1,0)) {$c = 1} +else {$d = 1}; +} + +$topLeft = Formula("$a*x+$b*y")->reduce; +$e = $topLeft->eval(x=>$x,y=>$y)->reduce; + +$botLeft = Formula("$c*x+$d*y")->reduce; +$f = $botLeft->eval(x=>$x,y=>$y)->reduce; + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{\begin{aligned} + [$topLeft] & = [$e] \\ + [$botLeft] & = [$f] +\end{aligned}\right.```] + +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** + +[_________________________________] + +END_PGML + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp( + checker => sub { + my ($correct, $student, $ans, $nth, $value) = @_; + $student->context->setError("Your $nth $value contains an unreduced fraction","",undef,undef,$Value::CMP_WARNING) + if $student->{notReduced}; + return 0 unless $correct == $student; + my $reduced = 1; + foreach $x ($student->value) { + if (Value::classMatch($x,'Fraction') && !$x->isReduced) { + $reduced = 0; + break; + } + } + $student->{notReduced} = 1 unless $reduced || $ans->{isPreview}; + return $reduced; + } + )->withPostFilter(AnswerHints( + ["infinity"] => ["Infinity doesn't make sense here- do you mean infinite number of solutions?",replaceMessage=>1], +))); + +$commonConclusion = "The solution to the system is [`$ans`]. It is left as an exercise to check. Please also note that you may have solved this problem a different way."; + +if($a==-$c) +{ + # ax + by = e + # -ax + dy = f + # should be solved by addition + $lhs=Formula("$b*y+$d*y")->reduce; + $lhs1=Formula("$a*x+$b*$y")->reduce; +BEGIN_PGML_SOLUTION +* Let's add the two equations, which will cancel the terms involving [`x`] and give [`[$lhs]=[$e]+[$f]`]. +* This gives [`y=[$y]`]. +* We find [`x`] using either equation - let's use the first one: [`[$lhs1]=[$e]`], so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==-$d) +{ + # ax + by = e + # cx + -by = f + # should be solved by addition + $lhs=Formula("$a*x+$c*x")->reduce; + $lhs1=Formula("$a*($x)+($b)*(y)")->reduce; +BEGIN_PGML_SOLUTION +* Let's add the two equations, which will cancel the terms involving [`y`] and give [`[$lhs]=[$e]+([$f])`]. +* This gives [`x=[$x]`]. +* We find [`y`] using either equation - let's use the first one: [`[$lhs1]=[$e]`], so [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($a==1 and $a!=$c and $b!=$d) +{ + # x + by = e should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$e-$b*y")->reduce; + $lhs=Formula("$c*$e-$c*$b*y+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. +* This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using the _first_ equation: + + [`\begin{aligned} + x&=[$e]-([$b])\cdot([$y])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==1 and $b!=$d and $a!=$c) +{ + # ax + y = e should be solved for y + # provided that $b and $d are not equal- in this case we should use subtraction. + $lhs=Formula("$c*x+$d*$e-$d*$a*x")->reduce; + $rhs=Formula("$e-$a*x")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$f]`] so [`x=[$x]`] +* Now that we have [`x`], we find [`y`] using the first equation: + + [` + \begin{aligned} + y&=[$e]-([$a])\cdot([$x])\\ + &=[$y] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==1 and $a!=$c and $b!=$d) +{ + # x + dy = f should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$f-$d*y")->reduce; + $lhs=Formula("$a*$f-$a*$d*y+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. +* This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using the _second_ equation: + + [` + \begin{aligned} + x&=[$f]-([$d])\cdot([$y])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==1 and $d!=$b and $a!=$c) +{ + # cx + y = f should be solved for y + $rhs=Formula("$f-$c*x")->reduce; + $lhs=Formula("$a*x+$b*$f-$b*$c*x")->reduce; + +BEGIN_PGML_SOLUTION +* From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. +* Now that we have [`x`], we find [`y`] using the _second_ equation: + + [` + \begin{aligned} + y&=[$f]-([$c])\cdot([$x])\\ + &=[$y] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($a==-1 and $a != $c and $b!=$d) +{ + # - x + by = e should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$b*y-$e")->reduce; + $lhs=Formula("$c*$b*y-$c*$e+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. +* This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. +* We find [`x`] using the _first_ equation: + + [`\begin{aligned} + x&=([$b])\cdot([$y])-([$e])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==-1 and $b!=$d and $a!=$c) +{ + # ax - y = e should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$a*x-$e")->reduce; + $lhs=Formula("$c*x+$d*$a*x-$d*$e")->reduce; +BEGIN_PGML_SOLUTION +* From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$f]`] so [`x=[$x]`]. +* We find [`y`] using the first equation: + + [`\begin{aligned} + y&=([$a])\cdot([$x])-([$e]) \\ + &=[$y]\end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==-1 and $a!=$c and $b!=$d) +{ + # - x + dy = f should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$d*y-$f")->reduce; + $lhs=Formula("$a*$d*y-$a*$f+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. +* This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. +* We find [`x`] using the _second_ equation: + + [`\begin{aligned} + x&=([$d])\cdot([$y])-([$f])\\ + &=[$x] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==-1 and $b!=$d and $a!=$c) +{ + # cx - y = f should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$c*x-$f")->reduce; + $lhs=Formula("$a*x+$b*$c*x-$b*$f")->reduce; + +BEGIN_PGML_SOLUTION +* From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. +* We find [`y`] using the _second_ equation: + + [`\begin{aligned} + y&=([$c])\cdot([$x])-([$f])\\ + &=[$y] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +else +{ + if($a==$c) + { + # ax + by = e + # ax + dy = f + # should be solved using subtraction + $lhs=Formula("$b*y-$d*y")->reduce; + $lhs1=Formula("$a*x+$b*($y)")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms in involving [`x`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + elsif($b==$d) + { + # ax + by = e + # cx + by = f + # should be solved using subtraction + $lhs=Formula("$a*x-$c*x")->reduce; + $lhs1=Formula("$a*($x)+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms in involving [`y`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`x=[$x]`]. +* Now that we have [`x`], we find [`y`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + else + { + # otherwise use elimination + + # multiply the first equation by $c + $topleft=Formula("$c*$a*x+$c*$b*y")->reduce; + $topright=$c*$e; + + # multiply the second equation by $a + $bottomleft=Formula("$a*$c*x+$a*$d*y")->reduce; + $bottomright=$a*$f; + + $lhs=Formula("$c*$b*y-$a*$d*y")->reduce; + $rhs=$c*$e-$a*$f; + + # put them together +BEGIN_PGML_SOLUTION +* Let's multiply the _first_ equation by [$c] and the _second_ equation by [$a] + + [`\begin{aligned} + [$topleft] &= [$topright]\\ + [$bottomleft] &=[$bottomright] + \end{aligned}`] +* Subtracting these two equations gives [`[$lhs]=[$rhs]`], so [`y=[$y]`]. + +* Now that we have [`y`], we can use either equation to find [`x`]; let's use the first one: + + [`[$a]*x+([$b])\cdot([$y])=[$e]`] + + so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } +} + +############################################## + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub80.pg b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub80.pg new file mode 100644 index 0000000000..95d1149be6 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub80.pg @@ -0,0 +1,394 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Solve the system of linear equations +# a x + b y = e +# c x + d y = f +# where a, b, c, d are fractions. +# +# The solution is (x,y) where x and y are both fractions with numerators +# and denominators on the interval [-10,10]. +# +# Last updated: Hughes 7/30/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','fraction') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction-NoDecimals"); + Context()->{precedence}{Fraction} = 2.5; + Context()->parens->set('(' => {type => "Point"} ); + Context()->flags->set(reduceFractions=>0,allowMixedNumbers=>1,requirePureFractions=>1); +Context()->{error}{msg}{"Mixed numbers are not allowed; you must use a pure fraction"} + = "Mixed numbers are not allowed; you must use a pure fraction, for example you should enter 5/4 and not 1 1/4"; + +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->are(x=>'Real',y=>'Real'); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "infinite number of solutions"=>{}, + "infinite"=>{alias=>'infinite number of solutions'}, + "infinite solutions"=>{alias=>'infinite number of solutions'}); + +# the solution +$xnumerator = random(2,10,2); # even number +$xdenominator = random(3,11,2); # odd number +$ynumerator = random(3,11,2); # odd number +$ydenominator = random(2,10,2); # even number + +$x = Fraction($xnumerator,$xdenominator)->reduce; +$y = Fraction($ynumerator,$ydenominator)->reduce; +$ans = List("($x,$y)"); + +# set up the system +# a x + b y =e +# c x + d y = f +# need to make sure that +# ad - bc != 0 + +# initialize the variables +$a=1; +$b=1; +$c=1; +$d=1; + +# set up $a, $b, $c, $d +while(1/$a*1/$d -1/$c*1/$b == 0){ +$a=Fraction(1,random(2,5,1)*random(-1,1,2)); +$b=Fraction(1,random(2,5,1)*random(-1,1,2)); +$c=Fraction(1,random(2,5,1)*random(-1,1,2)); +$d=Fraction(1,random(2,5,1)*random(-1,1,2)); +} + +$topLeft = Formula("$a*x+$b*y")->reduce; +$e = $topLeft->eval(x=>$x,y=>$y)->reduce; + +$botLeft = Formula("$c*x+$d*y")->reduce; +$f = $botLeft->eval(x=>$x,y=>$y)->reduce; + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{\begin{aligned} + [$topLeft] & = [$e] \\ + [$botLeft] & = [$f] +\end{aligned}\right.```] + +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** + +[_________________________________] + +END_PGML + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp( + checker => sub { + my ($correct, $student, $ans, $nth, $value) = @_; + $student->context->setError("Your $nth $value contains an unreduced fraction","",undef,undef,$Value::CMP_WARNING) + if $student->{notReduced}; + return 0 unless $correct == $student; + my $reduced = 1; + foreach $x ($student->value) { + if (Value::classMatch($x,'Fraction') && !$x->isReduced) { + $reduced = 0; + break; + } + } + $student->{notReduced} = 1 unless $reduced || $ans->{isPreview}; + return $reduced; + } + )->withPostFilter(AnswerHints( + ["infinity"] => ["Infinity doesn't make sense here- do you mean infinite number of solutions?",replaceMessage=>1], +))); + +$commonConclusion = "The solution to the system is [`$ans`]. It is left as an exercise to check. Please also note that you may have solved this problem a different way."; + +if($a==-$c) +{ + # ax + by = e + # -ax + dy = f + # should be solved by addition + $lhs=Formula("$b*y+$d*y")->reduce; + $lhs1=Formula("$a*x+$b*$y")->reduce; +BEGIN_PGML_SOLUTION +* Let's add the two equations, which will cancel the terms involving [`x`] and give [`[$lhs]=[$e]+[$f]`]. +* This gives [`y=[$y]`]. +* We find [`x`] using either equation - let's use the first one: [`[$lhs1]=[$e]`], so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==-$d) +{ + # ax + by = e + # cx + -by = f + # should be solved by addition + $lhs=Formula("$a*x+$c*x")->reduce; + $lhs1=Formula("$a*($x)+($b)*(y)")->reduce; +BEGIN_PGML_SOLUTION +* Let's add the two equations, which will cancel the terms involving [`y`] and give [`[$lhs]=[$e]+([$f])`]. +* This gives [`x=[$x]`]. +* We find [`y`] using either equation - let's use the first one: [`[$lhs1]=[$e]`], so [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($a==1 and $a!=$c and $b!=$d) +{ + # x + by = e should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$e-$b*y")->reduce; + $lhs=Formula("$c*$e-$c*$b*y+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. +* This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using the _first_ equation: + + [`\begin{aligned} + x&=[$e]-([$b])\cdot([$y])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==1 and $b!=$d and $a!=$c) +{ + # ax + y = e should be solved for y + # provided that $b and $d are not equal- in this case we should use subtraction. + $lhs=Formula("$c*x+$d*$e-$d*$a*x")->reduce; + $rhs=Formula("$e-$a*x")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$f]`] so [`x=[$x]`] +* Now that we have [`x`], we find [`y`] using the first equation: + + [` + \begin{aligned} + y&=[$e]-([$a])\cdot([$x])\\ + &=[$y] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==1 and $a!=$c and $b!=$d) +{ + # x + dy = f should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$f-$d*y")->reduce; + $lhs=Formula("$a*$f-$a*$d*y+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. +* This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using the _second_ equation: + + [` + \begin{aligned} + x&=[$f]-([$d])\cdot([$y])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==1 and $d!=$b and $a!=$c) +{ + # cx + y = f should be solved for y + $rhs=Formula("$f-$c*x")->reduce; + $lhs=Formula("$a*x+$b*$f-$b*$c*x")->reduce; + +BEGIN_PGML_SOLUTION +* From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. +* Now that we have [`x`], we find [`y`] using the _second_ equation: + + [` + \begin{aligned} + y&=[$f]-([$c])\cdot([$x])\\ + &=[$y] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($a==-1 and $a != $c and $b!=$d) +{ + # - x + by = e should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$b*y-$e")->reduce; + $lhs=Formula("$c*$b*y-$c*$e+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. +* This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. +* We find [`x`] using the _first_ equation: + + [`\begin{aligned} + x&=([$b])\cdot([$y])-([$e])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==-1 and $b!=$d and $a!=$c) +{ + # ax - y = e should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$a*x-$e")->reduce; + $lhs=Formula("$c*x+$d*$a*x-$d*$e")->reduce; +BEGIN_PGML_SOLUTION +* From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$f]`] so [`x=[$x]`]. +* We find [`y`] using the first equation: + + [`\begin{aligned} + y&=([$a])\cdot([$x])-([$e]) \\ + &=[$y]\end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==-1 and $a!=$c and $b!=$d) +{ + # - x + dy = f should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$d*y-$f")->reduce; + $lhs=Formula("$a*$d*y-$a*$f+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. +* This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. +* We find [`x`] using the _second_ equation: + + [`\begin{aligned} + x&=([$d])\cdot([$y])-([$f])\\ + &=[$x] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==-1 and $b!=$d and $a!=$c) +{ + # cx - y = f should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$c*x-$f")->reduce; + $lhs=Formula("$a*x+$b*$c*x-$b*$f")->reduce; + +BEGIN_PGML_SOLUTION +* From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. +* We find [`y`] using the _second_ equation: + + [`\begin{aligned} + y&=([$c])\cdot([$x])-([$f])\\ + &=[$y] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +else +{ + if($a==$c) + { + # ax + by = e + # ax + dy = f + # should be solved using subtraction + $lhs=Formula("$b*y-$d*y")->reduce; + $lhs1=Formula("$a*x+$b*($y)")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms in involving [`x`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + elsif($b==$d) + { + # ax + by = e + # cx + by = f + # should be solved using subtraction + $lhs=Formula("$a*x-$c*x")->reduce; + $lhs1=Formula("$a*($x)+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms in involving [`y`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`x=[$x]`]. +* Now that we have [`x`], we find [`y`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + else + { + # otherwise use elimination + + # multiply the first equation by $c + $topleft=Formula("$c*$a*x+$c*$b*y")->reduce; + $topright=$c*$e; + + # multiply the second equation by $a + $bottomleft=Formula("$a*$c*x+$a*$d*y")->reduce; + $bottomright=$a*$f; + + $lhs=Formula("$c*$b*y-$a*$d*y")->reduce; + $rhs=$c*$e-$a*$f; + + # put them together +BEGIN_PGML_SOLUTION +* Let's multiply the _first_ equation by [$c] and the _second_ equation by [$a] + + [`\begin{aligned} + [$topleft] &= [$topright]\\ + [$bottomleft] &=[$bottomright] + \end{aligned}`] +* Subtracting these two equations gives [`[$lhs]=[$rhs]`], so [`y=[$y]`]. + +* Now that we have [`y`], we can use either equation to find [`x`]; let's use the first one: + + [`[$a]*x+([$b])\cdot([$y])=[$e]`] + + so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } +} + +############################################## + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/Cofunction10.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/Cofunction10.pg new file mode 100644 index 0000000000..dc028bd092 --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/Cofunction10.pg @@ -0,0 +1,184 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# +# ENDDESCRIPTION + +## DBsubject('Precalculus') +## DBchapter('Trigonometry') +## DBsection('') +## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub output { + my $n = shift; + if ($n==1) {return "";} + elsif ($n==-1) {return "-";} + else {return $n;} +} + +Context("Fraction"); + +do { + $den = list_random(3,5,6,7,8,9); + $num = random(1,int($den/2),1); +} until gcd($num,$den)==1; + +@angle = (); +$angle[0] = Fraction($num,$den); +$angle[1] = (Fraction(1,2)-$angle[0])->reduce; + +@num = (); +@den = (); +($num[0],$den[0]) = $angle[0]->value; +($num[1],$den[1]) = $angle[1]->value; + +@numShow = (); +for my $i (0..1) { + $numShow[$i] = &output($num[$i]); +} + +@values = ( + ["\sin \left( \frac{$numShow[0]\pi}{$den[0]} \right)", + "\cos \left( \frac{$numShow[1]\pi}{$den[1]} \right)"], + ["\sin \left( \frac{$numShow[1]\pi}{$den[1]} \right)", + "\cos \left( \frac{$numShow[0]\pi}{$den[0]} \right)"], + ["\tan \left( \frac{$numShow[0]\pi}{$den[0]} \right)", + "\cot \left( \frac{$numShow[1]\pi}{$den[1]} \right)"], + ["\tan \left( \frac{$numShow[1]\pi}{$den[1]} \right)", + "\cot \left( \frac{$numShow[0]\pi}{$den[0]} \right)"], + ["\sec \left( \frac{$numShow[0]\pi}{$den[0]} \right)", + "\csc \left( \frac{$numShow[1]\pi}{$den[1]} \right)"], + ["\sec \left( \frac{$numShow[1]\pi}{$den[1]} \right)", + "\csc \left( \frac{$numShow[0]\pi}{$den[0]} \right)"], +); + +$in0 = random(0,3,1); +$in1 = random(0,1,1); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Using your knowledge of cofunctions, find equivalent expressions of \( $values[$in0][$in1] \). There may be more than one correct answer.", + "\( $values[$in0][($in1+1)%2] \) $BR", +); + +$mc -> extra( + "\( $values[($in0+1)%4][0] \) $BR", + "\( $values[($in0+1)%4][1] \) $BR", + "\( $values[($in0+2)%4][0] \) $BR", + "\( $values[($in0+2)%4][1] \) $BR", + "\( $values[($in0+3)%4][0] \) $BR", + "\( $values[($in0+3)%4][1] \) $BR", +); + + +$graph = init_graph(0,0,5,5); +$graph->lb('reset'); + +$graph->moveTo(1,1); +$graph->lineTo(4, 1, red, 2); +$graph->lineTo(4, 3, red, 2); +$graph->lineTo(1, 1, red, 2); + +$graph->moveTo(4, 1.2); +$graph->lineTo(4-0.2, 1.2, red, 2); +$graph->lineTo(4-0.2, 1, red, 2); + +$graph->lb(new Label(1,1,"A",'red',"right","top",large)); +$graph->lb(new Label(4,3,"B",'red',"left","bottom",large)); +$graph->lb(new Label(4,1,"C",'red',"left","top",large)); + +$graph->lb(new Label(4,2,"a",'red',"left","middle",large)); +$graph->lb(new Label(2.5,1,"b",'red',"center","top",large)); +$graph->lb(new Label(2.5,2,"c",'red',"right","bottom",large)); + +$alt = "This is a right triangle ABC, with C being the right angle. Angle A faces side a, Angle B faces side b, and Angle C faces side c."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this right triangle, note that: + + [``\begin{aligned} + \sin(A) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{a}{c} \\ + \cos(B) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{a}{c} + \end{aligned}``] + +Because [`B=\frac{\pi}{2}-A`], we have: + + [`` \sin(A) = \cos \left( \frac{\pi}{2}-A \right), \cos(A) = \sin \left( \frac{\pi}{2}-A \right)``] + +Similarly: + + [``\begin{aligned} + \tan(A) &= \cot \left( \frac{\pi}{2}-A \right), \cot(A) = \tan \left( \frac{\pi}{2}-A \right) \\ + \sec(A) &= \csc \left( \frac{\pi}{2}-A \right), \csc(A) = \sec \left( \frac{\pi}{2}-A \right) + \end{aligned}``] + +Because of such relationships, + +* [`y=\sin(x)`] and [`y=\cos(x)`] are cofunctions. +* [`y=\tan(x)`] and [`y=\cot(x)`] are cofunctions. +* [`y=\sec(x)`] and [`y=\csc(x)`] are cofunctions. + +In this problem, since [` \frac{[$numShow[0]]\pi}{[$den[0]]} = \frac{\pi}{2}-\frac{[$numShow[1]]\pi}{[$den[1]]} `], we have: + + [`` [$values[$in0][$in1]] = [$values[$in0][($in1+1)%2]] ``] + +The correct answer is [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig10.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig10.pg index f00e06d777..42d4246a56 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig10.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig10.pg @@ -176,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the length of the side opposite to the right angle is marked as $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig15.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig15.pg index 63ffa4d9de..d5868b2415 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig15.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig15.pg @@ -176,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $base; the length of the side opposite to the right angle is marked as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig20.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig20.pg index 31df6416f5..3ff69cb591 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig20.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig20.pg @@ -176,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side adjacent to the given acute angle is marked as x (unknown); the length of the side opposite to the right angle is marked as $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig25.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig25.pg index a45776fc40..f2de86815e 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig25.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig25.pg @@ -176,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side adjacent to the given acute angle is marked as $height; the length of the side opposite to the right angle is marked as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig30.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig30.pg index 2ada0ad6cb..01c6fbdd02 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig30.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig30.pg @@ -176,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the length of the side adjacent to the given acute angle is marked as $height."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML @@ -187,7 +187,7 @@ BEGIN_PGML Find the length of [`x`]. Round your answer to two decimal places if needed. - [`x=`][___________]{$height} + [`x=`][___________]{$base} END_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig35.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig35.pg index 462b39544a..5e9026cb8f 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig35.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig35.pg @@ -176,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $base; the length of the side adjacent to the given acute angle is marked as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig40.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig40.pg index e85921a5da..ed0b897a99 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig40.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig40.pg @@ -176,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the length of the side adjacent to the given acute angle is marked as y (unknown); the length of the side opposite to the right angle is marked as $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig50.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig50.pg index 36e6aff8e0..692d70f2ef 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig50.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig50.pg @@ -176,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $base; the length of the side adjacent to the given acute angle is marked as x (unknown); the length of the side opposite to the right angle is marked as y (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig60.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig60.pg index 0119e118fa..ac1e98d85b 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig60.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig60.pg @@ -176,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the length of the side adjacent to the given acute angle is marked as $height; the length of the side opposite to the right angle is marked as y (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication05.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication05.pg index e22c62e5c8..c95450da92 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication05.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication05.pg @@ -187,7 +187,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees, and the vertex of this angle is labeled as Town A. The vertex of the acute angle at the $bPosition is labeled as Town B. The length of the side opposite to the given acute angle is marked as x (unknown); the length of the side opposite to the right angle is marked as $hypotenuseU."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication10.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication10.pg index ef5fb90e5c..9bf6a2cd51 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication10.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication10.pg @@ -183,7 +183,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown), and this same side is also labeled as the wall; the side adjacent to the given acute angle is labeled as the ground; the length of the side opposite to the right angle is marked as $hypotenuseU, and this side is also labeled as the ladder."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication100.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication100.pg index b71052c01e..fbcdb35808 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication100.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication100.pg @@ -175,7 +175,7 @@ if ($corner==0) { $text = "The graph shows a ramp set up from a trunk to the ground. A vertical line is drawn from upper end of the ramp (touching the trunk) straight down to the ground. A horizontal line is drawn from where the ramp touches the ground toward the trunk. The ramp, the vertical line and the horizontal line form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU; the side adjacent to the given acute angle is labeled as the ground; and the side opposite to the right angle is labeled as the ramp, and also labeled as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication110.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication110.pg index 1128da3e1b..af48d8da93 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication110.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication110.pg @@ -193,7 +193,7 @@ if ($corner==0) { $text = "The graph shows an airplane flying toward an airport. A line connects the airplane to the airport. A vertical line is drawn from the airplane to the ground, and a horizontal line is drawn from the airport toward to the airplane. Those three lines form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU; the side adjacent to the given acute angle is marked x (unknown). A dashed horizontal line is drawn from the airplane toward the airport; this line forms a $alpha-degree angle with the hypotenuse of the right triangle."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication120.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication120.pg index 7d0c9c4662..47686be776 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication120.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication120.pg @@ -213,7 +213,7 @@ if ($corner==0) { $text = "The graph shows a vertical line, representing a building. The bottom of the building is marked as C; the bottom of the second storey is marked as B; the top of the second storey is marked as A. There is an observation point, marked as D, on the ground $heightU from the bottom of the building (point C). A dashed line connects points D and B, and another dashed line connects points D and A. Angle ADC is $alpha2 degrees, and angle BDC is $alpha1 degrees. The segment AB is marked as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication130.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication130.pg index 2c9a175485..4a34550cf5 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication130.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication130.pg @@ -224,7 +224,7 @@ if ($corner==0) { $text = "The graph shows an airplane (represented by point A) looking over City 1 (point D) and City 2 (point C). A vertical line is drawn from point A down to the ground, crossing the ground at point B. Angle ACB is $alpha2 degrees, while Angle ADB is $alpha1 degrees. A horizontal dashed line is draw from the airplane toward those two cities. The horizontal line forms a $alpha2 degree angle with segment AC, and forms a $alpha1 degree angle with segment AD. Segment AB is labeled as $baseU. The segment between those two cities (segment CD) is labeled as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication140.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication140.pg new file mode 100644 index 0000000000..6413d270be --- /dev/null +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication140.pg @@ -0,0 +1,163 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Law of Sines +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + + +$B = random(31, 70, 1); +$C = 90; +$A = 180-$B-$C; +$a = random(50, 100, 1); +$b = $a*sin($B*pi/180)/sin($A*pi/180); +$c = $a*sin($C*pi/180)/sin($A*pi/180); +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$base = ($c*cos($B*pi/180)); +$xmax = ($base)*240/210; +$ymin = 0; +$ymax = (210*$h/$base+30)*$h/(210*$h/$base); + +$xLabelShift = $xmax/20; +$yLabelShift = $ymax/80; + +# Ax, Bx, Cx +@x = (($xmax+$base)/2, ($xmax-$base)/2, ($xmax-$base)/2+$a); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +for my $i (0..1) { +$picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +if ($i==0) { + $picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"$a miles",'black','center','top','large')); +} else { + $picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"c=$a miles",'black','center','top','large')); +} +if ($i==1) { + $picture[$i]->lb( new Label(($x[0]+$x[2])/2+0.5*$xLabelShift, ($y[0]+$y[1])/2,"a",'black','left','bottom','large')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"b",'black','right','bottom','large')); + $picture[$i]->lb( new Label( $x[0], $y[0],"C (boat)",'black','right','bottom','large')); +} else { + $picture[$i]->lb( new Label( $x[0], $y[0],"boat",'black','center','bottom','large')); +} + +$picture[$i]->lb( new Label( $x[1], $y[1],"A",'black','right','top','large')); +$picture[$i]->lb( new Label( $x[1]+2*$xLabelShift, $y[1]+$yLabelShift,$B,'black','left','bottom','large')); +$picture[$i]->lb( new Label( $x[2], $y[2],"B",'black','left','top','large')); +$picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2]+$yLabelShift,$C2,'black','left','bottom','large')); + +$picture[$i]->new_color("darkblue", 100,100,255); + +$picture[$i]->moveTo($x[0],$y[0]); +$picture[$i]->lineTo($x[1],$y[1], darkblue,3); +$picture[$i]->lineTo($x[2],$y[2], darkblue,3); +$picture[$i]->lineTo($x[0],$y[0], darkblue,3); + +$picture[$i]->moveTo($x[2],$y[2]); +$picture[$i]->lineTo($x[0],$y[2], darkblue,1,dashed); + +$xShift = $xmax/200; +$yShift = $xShift*210/240; +$picture[$i]->moveTo($x[0],$y[2]+10*$yShift); +$picture[$i]->lineTo($x[0]-10*$xShift,$y[2]+10*$yShift, darkblue,3); +$picture[$i]->lineTo($x[0]-10*$xShift,$y[2], darkblue,3); + +} + +$text[0] = "This is a right triangle with one side parallel to the ground; this side is marked as $a miles; the top point is marked as boat. The left endpoint is marked as A, and right endpoint is marked as B. The angle of elevation from A to the boat is $B degrees, and the angle of elevation from B to the boat is 90 degrees. The boat is right above Point B, making Angle B inside the triangle a right angle."; + +$text[1] = "This is a right triangle with one side parallel to the ground; this side is marked as c=$a miles; the top point is marked as C (boat). The left endpoint is marked as A, and right endpoint is marked as B. The angle of elevation from A to the boat is $B degrees, and the angle of elevation from B to the boat is 90 degrees. The boat is right above Point B, making Angle B inside the triangle a right angle. The side AC is marked as b, and the side BC is marked as a."; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +To determine how far a boat is from shore, two radar stations [`[$a]`] miles apart find the angles out to the boat, as shown in the figure. The angle of elevation from Station A to the boat is [`[$B]^{\circ}`], and angle of elevation from Station B to the boat is [`[$C]^{\circ}`]. + +Determine the distance of the boat from Station A and Station B. + +The distance from the boat to Station A is [____________]{$c} miles. + +The distance from the boat to Station B is [____________]{$b} miles. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the boat is at Point C. Assume the distance from the boat to Station A is [`b`] miles, and to Station B is [`a`] miles. Assume the distance between those two stations is [`c=[$a]`] miles. + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +We use trigonometry to calculate the length of [`b`]: + + [``\begin{aligned}[t] + \cos(A) &= \frac{c}{b} \\ + b\cdot\cos(A) &= c \\ + b &= \frac{c}{\cos(A)} \\ + b &= \frac{[$a]}{\cos([$B]^{\circ})} \\ + b &= [$c] + \end{aligned}``] + +The distance from the boat to Station A is [`[$c]`] miles. + +And, use trigonometry to calculate the length of [`a`]: + + [``\begin{aligned}[t] + \tan(A) &= \frac{a}{c} \\ + c\cdot\tan(A) &= a \\ + a &= c\cdot\tan(A) \\ + a &= [$a]\cdot{\tan([$B]^{\circ})} \\ + a &= [$b] + \end{aligned}``] + +The distance from the boat to Station B is [`[$b]`] miles. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication20.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication20.pg index 14f0a322a8..a21b7b50b7 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication20.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication20.pg @@ -183,7 +183,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown), and this same side is also labeled as the wall; the length of the side opposite to the right angle is marked as $hypotenuseU, and this side is also labeled as the ladder."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication30.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication30.pg index 97745b3374..ea1d6ece45 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication30.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication30.pg @@ -183,7 +183,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU, and this same side is also labeled as the pole; the side adjacent to the given acute angle is labeled as the ground; the length of the side opposite to the right angle is marked as x (unknown), and this side is also labeled as the wire."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication40.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication40.pg index a8d207c8b0..2c96129186 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication40.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication40.pg @@ -184,7 +184,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU, and this same side is also labeled as the pole; the side adjacent to the given acute angle is marked as x (unknown), and this same side is also labeled as the ground; the side opposite to the right angle is labeled as the wire."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication50.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication50.pg index a7e99bd1b1..50f887546f 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication50.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication50.pg @@ -184,7 +184,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU, and this same side is also labeled as the ground; the side adjacent to the given acute angle is marked as x (unknown), and this same side is also labeled as the wall; the side opposite to the right angle is labeled the light beam."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication60.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication60.pg index 37b50b3d7d..827d0ab773 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication60.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication60.pg @@ -204,7 +204,7 @@ if ($corner==0) { $text = "The graph shows a $heightPersonU person on the ground, looking up at a flying object. A horizontal line is drawn from his eyes toward the object, and a vertical line is drawn from the object downward. Another line is connected from his eyes to the object. These three lines form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the side adjacent to the given acute angle is marked $heightU."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication70.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication70.pg index f9a678d4e2..db21d5ddaa 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication70.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication70.pg @@ -187,7 +187,7 @@ if ($corner==0) { $text = "The graph has a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU, and this same side is also labeled as the ground; the side adjacent to the given acute angle is marked as x (unknown), and this same side is also labeled as the wall; the side opposite to the right angle is labeled the light beam. From the spotlight on the wall, a dashed horizontal line is drawn, and the angle between the triangle's hypotenuse and the horizontal line is $beta degrees."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication80.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication80.pg index 8b43aa7fb6..03982edd74 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication80.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication80.pg @@ -193,7 +193,7 @@ if ($corner==0) { $text = "The graph shows a lighthouse with a spotlight on its top, shining light at a boat on the sea. The lighthouse, the line connecting the boat to the lighthouse, and a line connecting the boat to the spotlight form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU (height of the lighthouse); the side adjacent to the given acute angle is marked x (unknown). A dashed horizontal line is drawn from the spotlight toward the boat; this line forms a $alpha-degree angle with the hypotenuse of the right triangle."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication90.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication90.pg index e43aac9b8b..d7557b34e5 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication90.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication90.pg @@ -205,7 +205,7 @@ if ($corner==0) { $text = "The graph shows a $heightPersonU person on the ground, looking up at a kite. A horizontal line is drawn from his hand (very close to his eyes) toward the kite, and a vertical line is drawn from the kite downward. Another line is connected from his hand to the kite. These three lines form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the side opposite to the right angle is marked $hypotenuseU."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg index 3c66f1e8a9..b8b2a87fa5 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg @@ -119,7 +119,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg index 8677cb038d..63aab95b2a 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg @@ -120,7 +120,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg index b53ff6f9a5..fa338bf2a0 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg @@ -120,7 +120,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg index be60ceb5e4..8106cd6353 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg @@ -120,7 +120,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg index 81ed6f6ba6..abf21a6abf 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg @@ -201,7 +201,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg index eb855610b4..99cb4bfb76 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg @@ -206,7 +206,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION First, we need to find the missing side. By the Pythagorean Theorem, we have: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg index 1fcfed6690..9373609b34 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg @@ -207,7 +207,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION First, we need to find the missing leg's length. By the Pythagorean Theorem, we have: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg index 9dc26aabf2..a6f8f67489 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg @@ -322,7 +322,7 @@ if ($corner==0) { $text = "This is a right triangle. Right angle C is at the $cPosition corner of the picture. Acute angle A is at the $aPosition, and acute angle B is at the $bPosition. The length of the side facing Angle A is $base; the length of the side facing Angle B is $height; the length of the side facing Angle C is x (unknown)."; ############################################## -$refreshCachedImages = 1; + BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg index 96e4d0f46f..fe896a79e7 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg @@ -326,7 +326,7 @@ if ($corner==0) { $text = "This is a right triangle. Right angle C is at the $cPosition corner of the picture. Acute angle A is at the $aPosition, and acute angle B is at the $bPosition. The length of the side facing Angle A is $base; the length of the side facing Angle B is x (unknown); the length of the side facing Angle C is $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek10.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek10.pg index 56f7e55780..22bde52958 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek10.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek10.pg @@ -137,7 +137,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek20.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek20.pg index d11ed34b74..0dff16c69d 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek20.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek20.pg @@ -135,7 +135,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek30.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek30.pg index a13e27a6cb..3fcc17fefc 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek30.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek30.pg @@ -138,7 +138,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek40.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek40.pg index e2bdadfa30..65213939ae 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek40.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek40.pg @@ -109,7 +109,7 @@ $ansTangentS = Compute("s/r"); $text = "This is a right triangle. The right angle is at the bottom right corner of the picture. Acute angle alpha is at the bottom left, and acute angle beta is at the top right. Angle alpha faces side r; Angle beta faces side s; the right angle faces side t."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek50.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek50.pg index 38c472480f..2c55464c9e 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek50.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek50.pg @@ -221,7 +221,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek60.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek60.pg index 46175aed05..04a5e4ecef 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek60.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek60.pg @@ -225,7 +225,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION First, we need to find the missing side. By the Pythagorean Theorem, we have: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek70.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek70.pg index b3c38bb676..84d995c16c 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek70.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek70.pg @@ -226,7 +226,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION First, we need to find the missing leg's length. By the Pythagorean Theorem, we have: diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek80.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek80.pg index 4e3b374811..24893d1a6d 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek80.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek80.pg @@ -341,7 +341,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. Acute angle alpha is at the $aPosition, and acute angle beta is at the $bPosition. The length of the side facing angle alpha is $base; the length of the side facing angle beta is $height; the length of the side facing the right angle is x (unknown)."; ############################################## -$refreshCachedImages = 1; + BEGIN_PGML diff --git a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek90.pg b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek90.pg index 89cf1acb21..728eb9582b 100644 --- a/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek90.pg +++ b/Contrib/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek90.pg @@ -346,7 +346,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. Acute angle alpha is at the $aPosition, and acute angle beta is at the $bPosition. The length of the side facing angle alpha is $base; the length of the side facing angle beta is x (unknown); the length of the side facing the right angle is $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); diff --git a/Contrib/PCC/BasicMath/FractionsCalculation/MixedNumberAddition130.pg b/Contrib/PCC/BasicMath/FractionsCalculation/MixedNumberAddition130.pg index 9ae2290bc9..564caf70b3 100644 --- a/Contrib/PCC/BasicMath/FractionsCalculation/MixedNumberAddition130.pg +++ b/Contrib/PCC/BasicMath/FractionsCalculation/MixedNumberAddition130.pg @@ -52,7 +52,7 @@ $den2 = $den1; do {$num1 = random(1,$den1-1,1);} until (gcd($num1,$den1)==1); $num2 = $numReduced*$multiple - $num1; -} until ((gcd($num2,$den2)==1) && ($num2<$den2)); +} until ((gcd($num2,$den2)==1) && ($num2<$den2) && ($num2 > 0) ); $int1 = random(1,5,1); $frac1 = Fraction($num1,$den1); diff --git a/Contrib/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction90.pg b/Contrib/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction90.pg index 7c51551f20..ed645d5377 100644 --- a/Contrib/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction90.pg +++ b/Contrib/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction90.pg @@ -53,7 +53,7 @@ $den2 = $den1; do {$num1 = random(1,$den1-1,1);} until (gcd($num1,$den1)==1); $num2 = $numReduced*$multiple - $num1; -} until ((gcd($num2,$den2)==1) && ($num2<$den2)); +} until ((gcd($num2,$den2)==1) && ($num2<$den2) && ($num2 >0) ); $int1 = random(1,5,1); $frac1 = Fraction($num1,$den1); diff --git a/Contrib/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph30.pg b/Contrib/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph30.pg index 36b37fd4de..974d597ec9 100644 --- a/Contrib/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph30.pg +++ b/Contrib/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph30.pg @@ -53,8 +53,9 @@ do { $p = -$a*($x1+$x2)/2; $q = $a*$x1*$x2; $d = ($p)**2-4*$o*$q; - $x3 = (-$p+sqrt($d))/(2*$o); - $x4 = (-$p-sqrt($d))/(2*$o); + $x3 = Real((-$p+sqrt($d))/(2*$o)); + $x4 = Real((-$p-sqrt($d))/(2*$o)); + ($x3,$x4) = num_sort($x3,$x4); $y3 = $func->eval(x=>$x3); $y4 = $func->eval(x=>$x4); } until ( (abs($y1)<10) && (abs($y2)<10) && (abs($y3)<10) && (abs($y4)<10) ); @@ -96,11 +97,11 @@ for my $i (0..0) { Context("Interval"); if ($a>0) { - $ALT = "This is a graph of a function starting at the top left, going down till the point ($x4,$y4), turning up to the inflection point ($x1,$y1), continuing up till the point (0,0), turning down to the inflection point ($x2,$y2), continuing down till the point ($x3,$y3), and finally turning up to the top right."; + $ALT = "This is a graph of a function starting at the top left, going down till the point ($x3,$y3), turning up to the inflection point ($x1,$y1), continuing up till the point (0,0), turning down to the inflection point ($x2,$y2), continuing down till the point ($x4,$y4), and finally turning up to the top right."; $ansDown = Compute("($x1,$x2)"); $ansUp = Compute("(-inf,$x1)U($x2,inf)"); } else { - $ALT = "This is a graph of a function starting at the bottom left, going up till the point ($x4,$y4), turning down to the inflection point ($x1,$y1), continuing down till the point (0,0), turning up to the inflection point ($x2,$y2), continuing up till the point ($x3,$y3), and finally turning down to the bottom right."; + $ALT = "This is a graph of a function starting at the bottom left, going up till the point ($x3,$y3), turning down to the inflection point ($x1,$y1), continuing down till the point (0,0), turning up to the inflection point ($x2,$y2), continuing up till the point ($x4,$y4), and finally turning down to the bottom right."; $ansUp = Compute("($x1,$x2)"); $ansDown = Compute("(-inf,$x1)U($x2,inf)"); } diff --git a/Contrib/PCC/CollegeAlgebra/Concavity/ConcavityInContext40.pg b/Contrib/PCC/CollegeAlgebra/Concavity/ConcavityInContext40.pg index 4d7253649c..30017eaa3b 100644 --- a/Contrib/PCC/CollegeAlgebra/Concavity/ConcavityInContext40.pg +++ b/Contrib/PCC/CollegeAlgebra/Concavity/ConcavityInContext40.pg @@ -67,7 +67,7 @@ $gr[1]->lb( new Label(0,9,'Distance','black','left','middle')); $gr[1]->lb( new Label(9,0,'Time','black','left','bottom')); @problems = ( - ["A runner completes a 100-meter dash race. The function models the runner's distance from the starting line as time passes.", + ["A runner completes a 100-meter dash race. He started from a speed of zero, and then sped up during the whole race. The function models the runner's distance from the starting line as time passes.", "increasing", "concave up", "The distance increases as time passes, so the function is increasing.", diff --git a/Contrib/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations40.pg b/Contrib/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations40.pg index e17ee23103..2888b8fba8 100644 --- a/Contrib/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations40.pg +++ b/Contrib/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations40.pg @@ -60,7 +60,7 @@ do { } until ( ($c2<0) && ($c2n != 1) && (abs($b2n)!=1) ); $f = Compute("$b1*$var+$c1")->reduce; - +$e1 = Compute("$b2h*$var")->reduce; ############################################## @@ -68,7 +68,7 @@ BEGIN_PGML Solve the exponential equation - [` e^{[$f]} = \frac{e^{[$var]^2}}{e^{[$c2n]}}\cdot \left(e^{[$b2h][$var]}\right)^2 `] + [` e^{[$f]} = \frac{e^{[$var]^2}}{e^{[$c2n]}}\cdot \left(e^{[$e1]}\right)^2 `] * Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. * If there are no real solutions, enter *no real solutions* diff --git a/Contrib/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations50.pg b/Contrib/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations50.pg new file mode 100644 index 0000000000..937ff16574 --- /dev/null +++ b/Contrib/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations50.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$a = random(2,9,1); +do {$b = random(2,9,1);} until ($b!=$a); +$left = Compute("e**(2*$var)+($b-$a)*e**($var)")->reduce->reduce; +$right = $a*$b; + +Context("FiniteSolutionSets"); +Context()->variables->are($var => 'Real'); +$ans = Formula("{ln($a)}"); + +############################################## + +BEGIN_PGML + +Solve the exponential equation + + [` [$left] = [$right] `] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left( e^{[$var]} \right)^2 +[$b-$a]e^{[$var]} - [$right] &= 0 \\ + \left( e^{[$var]}-[$a] \right) \left( e^{[$var]}+[$b] \right) &= 0 \\ + e^{[$var]}-[$a] &= 0 \text{ or } e^{[$var]}+[$b] = 0 \\ + e^{[$var]} &= [$a] \text{ or } e^{[$var]} = [$b*-1] \\ + [$var] &= \ln([$a]) \text{ or no solution} \\ +\end{aligned} + ``] + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations60.pg b/Contrib/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations60.pg new file mode 100644 index 0000000000..d09663cef4 --- /dev/null +++ b/Contrib/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations60.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $a = list_random(2,3,5); + $b = random(1,5,1);} +until gcd($b,$a)==1; +$c = random(1,5,1); +$d = $a*$c-$b; +$bc = $b*$c; +$left = Compute("$a*e**(2*$var)")->reduce; +$right = Compute("$bc-$d*e**{$var}")->reduce; +$ans1 = Fraction($b,$a); +$s1 = Compute("$d*e**{$var}")->reduce; + +Context("FiniteSolutionSets"); +Context()->variables->are($var => 'Real'); +$ans = Formula("{ln($ans1)}"); + +############################################## + +BEGIN_PGML + +Solve the exponential equation + + [` [$left] = [$right] `] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left( [$a]e^{[$var]} \right)^2 +[$s1] - [$bc] &= 0 \\ + \left( [$a]e^{[$var]}-[$b] \right) \left( e^{[$var]}+[$c] \right) &= 0 \\ + [$a]e^{[$var]}-[$b] &= 0 \text{ or } e^{[$var]}+[$c] = 0 \\ + e^{[$var]} &= [$ans1] \text{ or } e^{[$var]} = [$c*-1] \\ + [$var] &= \ln\left([$ans1]\right) \text{ or no solution} \\ +\end{aligned} + ``] + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve10.pg b/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve10.pg index b4e42cd8b3..2e5ef2ab00 100644 --- a/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve10.pg +++ b/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve10.pg @@ -26,6 +26,7 @@ loadMacros( "unionTables.pl", "parserAssignment.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "pccTables.pl", "PGML.pl", "PCCmacros.pl", @@ -65,6 +66,9 @@ Context()->operators->redefine('or',using=>',',from=>'Numeric'); Context()->operators->set(","=>{string=>"or",TeX=>"or ",perl=>","}); $formula = Formula("$var=$solvefequals0 "); +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$solvefequals0}"); ############################################## @@ -75,9 +79,8 @@ If [`[$f]`] is a function defined by [`[$f]([$var]) = [$function]`], a. Find [`[$f](0)`]. [_]{$fof0}{20} -a. Solve [`[$f]([$var])=0`]. - [@KeyboardInstructions("The answer should be in the form [|$var=23|]*, and not simply give the numerical value of the solution, like [|23|]*. If there are two solutions, use the word [|or|]*, as in [|$var=23 or $var=12|]*. If you need to use the square root sign, as in [`\\sqrt{23}`], type it like [|sqrt(23)|]*.")@]** - [_]{$formula}{20} +a. Solve [`[$f]([$var])=0`]. + [_]{$ans}{20} END_PGML diff --git a/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve20.pg b/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve20.pg index 17608d2d7f..a39b9e182b 100644 --- a/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve20.pg +++ b/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve20.pg @@ -26,6 +26,7 @@ loadMacros( "unionTables.pl", "parserAssignment.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "pccTables.pl", "PGML.pl", "PCCmacros.pl", @@ -89,6 +90,9 @@ if ($b == 1 and $c ne '') {$b = ''}; $solvefequals0 = Compute("$var=$b $c or $var=-$b $c"); +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$b $c, -$b $c}"); ############################################## @@ -99,9 +103,9 @@ If [`[$f]`] is a function defined by [`[$f]([$var]) = [$function]`], a. Find [`[$f](0)`]. [_]{$fof0}{20} -a. Solve [`[$f]([$var])=0`]. - [@KeyboardInstructions("The answer should be in the form [|$var=23|]*, and not simply give the numerical value of the solution, like [|23|]*. If there are two solutions, use the word [|or|]*, as in [|$var=23 or $var=12|]*. If you need to use the square root sign, as in [`\\sqrt{23}`], type it like [|sqrt(23)|]*.")@]** - [_]{$solvefequals0}{20} +a. Solve [`[$f]([$var])=0`]. + [@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + [_]{$ans}{20} END_PGML @@ -111,6 +115,38 @@ END_PGML $showPartialCorrectAnswers=1; +Context("Numeric")->variables->are($var=>'Real'); +$leading = Formula("$leadingCoefficient*$var^2")->reduce; + +$solve = ''; + +if ($leadingCoefficient == 1) { + $solve = '[$f]([$var]) &= 0\\ + [$function] &= 0\\ + [$var]^2 &= [$a]\\ + [$var] &= \pm\sqrt{[$a]}\\'; + if ($c eq '') {$solve .= '&= \pm [$b]';} + elsif ($b ne '') {$solve .= '&= \pm [$b] [$c]';} +} elsif ($den == 1 or $den == 4) { + $solve = '[$f]([$var]) &= 0\\ + [$function] &= 0\\ + [$leading] &= [$constant]\\ + [$var]^2 &= [$a]\\ + [$var] &= \pm\sqrt{[$a]}\\'; + if ($c eq '') {$solve .= '&= \pm [$b]';} + elsif ($b ne '') {$solve .= '&= \pm\sqrt{[$squarepart**2]\cdot[$newnewnum]}\\ &= \pm [$b] [$c]';} +} else { + $solve = '[$f]([$var]) &= 0\\ + [$function] &= 0\\ + [$leading] &= [$constant]\\ + [$var]^2 &= [$a]\\ + [$var] &= \pm\sqrt{[$a]}\\ + [$var] &= \pm\sqrt{[$a]\cdot\frac{[$den]}{[$den]}}\\ + [$var] &= \pm\sqrt{\frac{[$num*$den]}{[$den*$den]}}\\ + [$var] &= \pm\sqrt{\frac{[$squarepart**2]\cdot[$newnewnum]}{[$den*$den]}}\\'; + if ($c eq '') {$solve .= '&= \pm [$b]';} + elsif ($b ne '') {$solve .= '&= \pm [$b] [$c]';} +}; ############################################## @@ -120,8 +156,7 @@ BEGIN_PGML_SOLUTION To evaluate [`[$f](0)`], [`\begin{aligned} -[$f](0) -&= [$leadingCoefficient]*(0)^2-[$constant]\\ +[$f](0) &= [$leadingCoefficient]*(0)^2-[$constant]\\ &= [$leadingCoefficient]*(0)-[$constant]\\ &= 0-[$constant]\\ &= -[$constant]\\ @@ -131,20 +166,11 @@ To evaluate [`[$f](0)`], To solve [`[$f]([$var])=0`], [`\begin{aligned} -[$f]([$var]) -&= 0\\ -[$leadingCoefficient]*([$var])^2-[$constant] -&= 0\\ -[$leadingCoefficient]*([$var])^2 -&=[$constant]\\ -([$var])^2 -&=[$a]\\ -[$var] -&=\sqrt{[$a]}\mbox{ or }{-\sqrt{[$a]}}\\ -[$var] -&=[@sqrt($a)@]\mbox{ or }{-[@sqrt($a)@]}\\ +[$solve]** \end{aligned}`] +So the solution set is [`[$ans]`]. + END_PGML_SOLUTION ENDDOCUMENT(); diff --git a/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve30.pg b/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve30.pg index 56e365db4d..a02f666b5f 100644 --- a/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve30.pg +++ b/Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve30.pg @@ -26,6 +26,7 @@ loadMacros( "unionTables.pl", "parserAssignment.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "pccTables.pl", "PGML.pl", "PCCmacros.pl", @@ -69,7 +70,9 @@ Context()->operators->set(","=>{string=>"or",TeX=>"\text{ or }",perl=>","});Cont $solvefequals0 = Compute("$var=$root1 or $var=$root2"); - +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$root1, $root2}"); ############################################## @@ -81,8 +84,9 @@ a. Find [`[$f](0)`]. [_]{$fof0}{20} a. Solve [`[$f]([$var])=0`]. - [@KeyboardInstructions("The answer should be in the form [|$var=23|]*, and not simply give the numerical value of the solution, like [|23|]*. If there are two solutions, use the word [|or|]*, as in [|$var=23 or $var=12|]*. If you need to use the square root sign, as in [`\\sqrt{23}`], type it like [|sqrt(23)|]*.")@]** - [_]{$solvefequals0}{20} + [@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + [_]{$ans}{20} + END_PGML diff --git a/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin20.pg b/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin20.pg index 4c039b8bdf..231e62db5b 100644 --- a/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin20.pg +++ b/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin20.pg @@ -44,12 +44,12 @@ do { $x1 = random(-4,-2,1); $x2 = random(-1,1,1); $x3 = random(2,4,1); - $a = random(0.005,0.01,0.001)*random(-1,1,2); - $b = random(-5,5,1); - $func = Compute("$a/4*x**4-$a*($x1+$x2+$x3)/3*x**3+$a*($x1*$x2+$x1*$x3+$x2*$x3)/2*x**2-$a*$x1*$x2*$x3*x+$b"); - $y1 = $func->eval(x=>$x1); - $y2 = $func->eval(x=>$x2); - $y3 = $func->eval(x=>$x3); + $a = random(0.005,0.01,0.001)*random(-1,1,2); + $b = random(-5,5,1); + $func = Compute("$a/4*x**4-$a*($x1+$x2+$x3)/3*x**3+$a*($x1*$x2+$x1*$x3+$x2*$x3)/2*x**2-$a*$x1*$x2*$x3*x+$b"); + $y1 = $func->eval(x=>$x1); + $y2 = $func->eval(x=>$x2); + $y3 = $func->eval(x=>$x3); } until ( (abs($y1)<10) && (abs($y2)<10) && (abs($y3)<10) && ($x2-$x1>1) && ($x3-$x2>1) ); $x4 = $x1-1; @@ -64,11 +64,11 @@ $y4 = Round($y4,2); $y5 = Round($y5,2); %points = ( - $y1 => $x1, - $y2 => $x2, - $y3 => $x3, - $y4 => $x4, - $y5 => $x5, + $x1 => $y1, + $x2 => $y2, + $x3 => $y3, + $x4 => $y4, + $x5 => $y5, ); if ($a > 0) { @@ -80,9 +80,17 @@ if ($a > 0) { } $globalMinY = min($y1,$y2,$y3,$y4,$y5); -$globalMinX = Real($points{$globalMinY}); +my @minx; +for my $xx ($x1,$x2,$x3,$x4,$x5) { + push (@minx,$xx) if ($points{$xx} == $globalMinY); +} +$globalMinX = List(@minx); $globalMaxY = max($y1,$y2,$y3,$y4,$y5); -$globalMaxX = Real($points{$globalMaxY}); +my @maxx; +for my $xx ($x1,$x2,$x3,$x4,$x5) { + push (@maxx,$xx) if ($points{$xx} == $globalMaxY); +} +$globalMaxX = List(@maxx); ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x4,$x5],[$y1,$y2,$y3,$y4,$y5],centerOrigin=>0); @@ -133,7 +141,7 @@ A function's graph is shown below. A few points are highlighted for your referen >>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< -If a value doesn't exist, type *DNE* (meaning "does not exist"). Use commas to separate your answers if needed. +If a value doesn't exist, type [|DNE|]* (meaning "does not exist"). Use commas to separate your answers if needed. The function has a local minimum at [_______]{$localMinX}. diff --git a/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations10.pg b/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations10.pg index 28635ecd29..6602326beb 100644 --- a/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations10.pg +++ b/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations10.pg @@ -37,8 +37,6 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$mc = new_checkbox_multiple_choice(); - $a = random(2,5,1); $b = random(2,5,1); $c = (random(1,10,1))**2; @@ -52,8 +50,7 @@ $j = random(2,8,1); $k = $d+1; $l = random(3,9,1); -$mc -> qa ( -"Select all of the following relations that make \(y\) a function of \(x\). There are several correct answers.", +@fs = ( "\( y=x^{$a} \) $BR", "\( y=\frac{1}{x^{$b}} \) $BR", "\( y=\left| x \right| \) $BR", @@ -64,7 +61,7 @@ $mc -> qa ( "\( y=\sqrt[$l]{x} \) $BR", ); -$mc -> extra( +@notfs = ( "\( y=\pm\sqrt{$c-x^2} \) $BR", "\( x=y^{$d} \) $BR", "\( x^2+y^2=$e \) $BR", @@ -72,19 +69,51 @@ $mc -> extra( ); +@findices = NchooseK(8,8); +@notfindices = NchooseK(4,4); + +for my $i (0..3) { +$mc[$i] = new_checkbox_multiple_choice(); + +$mc[$i] -> qa ( +"Select all of the following relations that make \(y\) a function of \(x\).", +$fs[$findices[2*$i]], +$fs[$findices[2*$i + 1]], +); + +$mc[$i] -> extra( +$notfs[$notfindices[$i]] +); +} + ############################################## Context()->texStrings; BEGIN_TEXT +\{KeyboardInstructions("To receive credit you must get each checkbox correct. For this problem, WeBWorK will not tell you which parts you have right or wrong, or you could just change your checks after one submission, and you wouldn't have to think. If you do not get full credit, carefully review your response for each checkbox. If you do not have full credit after several attempts, contact a tutor or your instructor.")\} +$PAR +\{ $mc[0] -> print_q() \} $BR -\{ $mc -> print_q() \} +\{ $mc[0] -> print_a() \} +$BR + +\{ $mc[1] -> print_q() \} +$BR +\{ $mc[1] -> print_a() \} +$BR + +\{ $mc[2] -> print_q() \} +$BR +\{ $mc[2] -> print_a() \} +$BR + +\{ $mc[3] -> print_q() \} +$BR +\{ $mc[3] -> print_a() \} $BR -\{ $mc -> print_a() \} -$PAR -\{KeyboardInstructions("To receive credit you must get each checkbox correct. For this problem, WeBWorK will not tell you which parts you have right or wrong, or you could just change your checks after one submission, and you wouldn't have to think. If you do not get full credit, carefully review your response for each checkbox. If you do not have full credit after several attempts, contact a tutor or your instructor.")\} END_TEXT Context()->normalStrings; @@ -92,7 +121,10 @@ install_problem_grader(~~&std_problem_grader); $showPartialCorrectAnswers = 0; -ANS( checkbox_cmp( $mc->correct_ans() ) ); +ANS( checkbox_cmp( $mc[0]->correct_ans() ) ); +ANS( checkbox_cmp( $mc[1]->correct_ans() ) ); +ANS( checkbox_cmp( $mc[2]->correct_ans() ) ); +ANS( checkbox_cmp( $mc[3]->correct_ans() ) ); @@ -101,7 +133,7 @@ ANS( checkbox_cmp( $mc->correct_ans() ) ); BEGIN_SOLUTION -The correct answer is \{ $mc->correct_ans() \}. In each of those answers, whenever a value would be substituted in for \(x\), then either there is exactly one \(y\)-value that will make the relation true, or perhaps none at all. +The correct answers are \{ $mc[0]->correct_ans() \}, \{ $mc[1]->correct_ans() \}, \{ $mc[2]->correct_ans() \}, and \{ $mc[3]->correct_ans() \}. In each of those answers, whenever a value would be substituted in for \(x\), then either there is exactly one \(y\)-value that will make the relation true, or perhaps none at all. In the other answers, there can be an \(x\)-value where more than one \(y\)-value will make the relation true. diff --git a/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionVocabulary10.pg b/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionVocabulary10.pg index 156ab1c606..db127badb8 100644 --- a/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionVocabulary10.pg +++ b/Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionVocabulary10.pg @@ -52,8 +52,8 @@ Context()->strings->add( @questions = ( 'When we write [`y=f(x)`], we call [`x`] the [__________]{OneOf("independent, input, explanatory, argument")} variable, and we call [`y`] the [__________]{OneOf("dependent, output, response")} variable. ', -'The collection of all possible output values from a function is called the [__________]{range} of that function. ', -'The collection of all valid input values for a function is called the [__________]{domain} of that function. '); +'The collection of all possible output values from a function is called the [__________]{"range"} of that function. ', +'The collection of all valid input values for a function is called the [__________]{"domain"} of that function. '); @@ -92,4 +92,4 @@ If we write [`y=f(x)`], then [`x`] can be referred to as the _input_ variable, t END_PGML_SOLUTION -ENDDOCUMENT(); \ No newline at end of file +ENDDOCUMENT(); diff --git a/Contrib/PCC/CollegeAlgebra/FunctionBasics/Piecewise10.pg b/Contrib/PCC/CollegeAlgebra/FunctionBasics/Piecewise10.pg index 7241cfab40..28a6604c08 100644 --- a/Contrib/PCC/CollegeAlgebra/FunctionBasics/Piecewise10.pg +++ b/Contrib/PCC/CollegeAlgebra/FunctionBasics/Piecewise10.pg @@ -103,6 +103,8 @@ $gr->stamps( closed_circle($d,$a,'blue') ); $gr->stamps( closed_circle($co3,$a,'blue') ); $gr->stamps( closed_circle($ans5,$e,'red') ); +$altb = "This is a graph of a piecewise function. In ($xmin,$d), the function is $a*x**2+$b, with an open dot at $d. In [$d,$co3], the function is y=$a, with closed dots at $d and $co3. In ($co3,$xmax), the function is y=$c-x, with an open dot at $co3. A horizontal line y=$e is graphed, intersecting with y=$c-x at ($ans5,$e)."; + BEGIN_PGML_SOLUTION a) Since [`[$co1]<[$d]`], to find [`f([$co1])`], we apply the first rule. diff --git a/Contrib/PCC/CollegeAlgebra/FunctionBasics/Piecewise20.pg b/Contrib/PCC/CollegeAlgebra/FunctionBasics/Piecewise20.pg index e40f1b76a6..666487ccbb 100644 --- a/Contrib/PCC/CollegeAlgebra/FunctionBasics/Piecewise20.pg +++ b/Contrib/PCC/CollegeAlgebra/FunctionBasics/Piecewise20.pg @@ -86,9 +86,9 @@ $ans3 = List(Formula("x = $s1"), Formula("x = $s2")); BEGIN_PGML Let [` f(x)=\begin{cases} - [$f1] & [$x1] [$x3] + [$f3] & x \gt [$x3] \end{cases} `] @@ -129,6 +129,7 @@ $gr->stamps( open_circle($x1,$k1,'blue') ); $gr->stamps( closed_circle($s1,$y,'red') ); $gr->stamps( closed_circle($s2,$y,'red') ); +$altb = "This is a graph of a piecewise function. In ($x1,$x2], the function is $f1, with an open dot at $x1. In [$x2,$x3], the function is $f2. In [$x3,$xmax], the function is $f3. Those three functions are continuous. A horizontal line y=$y is graphed, intersecting with the piecewise function at ($s1,$y) and ($s2,$y)."; $sol1 = $f2->substitute(x=>Formula("$a")); $sol2 = $f3->substitute(x=>Formula("$b")); diff --git a/Contrib/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition140.pg b/Contrib/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition140.pg index 9b758717a7..6a2a167590 100644 --- a/Contrib/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition140.pg +++ b/Contrib/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition140.pg @@ -67,11 +67,11 @@ BEGIN_PGML The manufacturer of a computer is offering two discounts on last year's model computer. The first discount is at a [`\$[$rebate]`] rebate and the second discount is [`[$perc]%`] off the regular price [`p`]. -a) Write a formula for a function [`f`] that that represents the sale price as a function of the regular price if only the rebate applies. Your answer should be in the form *f(p)=...*. +a) Write a formula for a function [`f`] that represents the sale price as a function of the regular price if only the rebate applies. Your answer should be in the form *f(p)=...*. [______________________] -a) Write a formula for a function [`g`] that that represents the sale price as a function of the regular price if only the [`[$perc]%`] discount applies. Your answer should be in the form *g(p)=...*. +a) Write a formula for a function [`g`] that represents the sale price as a function of the regular price if only the [`[$perc]%`] discount applies. Your answer should be in the form *g(p)=...*. [______________________] diff --git a/Contrib/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions131.pg b/Contrib/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions131.pg new file mode 100644 index 0000000000..7d40985585 --- /dev/null +++ b/Contrib/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions131.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Inverse Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(q=>'Real', C=>'Real'); + + +$base = random(80,120,5); +$rate = random(0.1,0.2,0.1); + +$f = Formula("$base + $rate*q"); + +$inverse = Formula("(C-$base)/$rate"); + +############################################## + + +BEGIN_PGML + +The cost [`C`] (in thousands of dollars) of producing [`q\;\mathrm{kg}`] of a chemical is given by [`C=f(q)=[$f]`]. + +a) Find [`f(10)`]. + + [`f(10)={}`][_______________] + +a) Find [`f^{-1}(200)`]. + + [`f^{-1}(200)={}`][_______________] + + +a) Find [`f^{-1}(C)`]. + + [`f^{-1}(C)={}`][_______________] + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + + +ANS( $f->eval(q=>10)->cmp() ); +ANS( $inverse->eval(C=>200)->cmp() ); +ANS( Formula("q")->cmp() ); + +############################################## + +Context()->texStrings; +$bigCost = 1000*$f->eval(q=>10); + +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +f(10) &= [$f->substitute(q=>Formula("10"))]\\ +&= [$f->eval(q=>10)] +\end{aligned}`] + + This means that to produce [`10\;\mathrm{kg}`] of the chemical will cost [`\$[$bigCost]`]. + +a) To find [`f^{-1}(200)`], we solve the equation + + [`\begin{aligned}[t] +f(q) &= 200\\ +[$f] &= 200\\ +[$rate]q & = [@200-$base@]\\ +q &= [@$inverse->eval(C=>200)@] +\end{aligned}`] + + This means that if it had cost [`$200000`] to produce some amount of the chemical, then [`[@$inverse->eval(C=>200)@]\;\mathrm{kg}`] of the chemical was produced. + +a) Since [`C=f(q)`] is the original function, [`f^{-1}(C)=f^{-1}\left(f(q)\right)=q`] + + So [`f^{-1}(C)=q`]. In other words, [`C=f(q)`] and [`f^{-1}(C)`] canceled out each other. + +END_PGML_SOLUTION + +Context()->normalStrings; + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations50.pg b/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations50.pg index f4050d45f8..0deed4ab3f 100644 --- a/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations50.pg +++ b/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations50.pg @@ -59,7 +59,7 @@ $ans = Formula("$var=$x"); TEXT(beginproblem()); BEGIN_PGML -Solve the quadratic equation +Solve the equation [`` e^{[$var]}=[$a] ``] diff --git a/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations60.pg b/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations60.pg index d576773bda..6fda280046 100644 --- a/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations60.pg +++ b/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations60.pg @@ -65,7 +65,7 @@ $ans = Formula("$var=$x"); TEXT(beginproblem()); BEGIN_PGML -Solve the quadratic equation +Solve the equation [`` [$a]-[$b]e^{[$d][$var]}=[$c] ``] diff --git a/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations70.pg b/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations70.pg index 16b86eb6b5..fb42185163 100644 --- a/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations70.pg +++ b/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations70.pg @@ -65,7 +65,7 @@ $ans = Formula("$var=$x"); TEXT(beginproblem()); BEGIN_PGML -Solve the quadratic equation +Solve the equation [`` [$a]\cdot 10^{[$var]+[$d]}+[$b]=[$c] ``] diff --git a/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations80.pg b/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations80.pg index 95e0a549f6..a38a8b601e 100644 --- a/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations80.pg +++ b/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmEquations80.pg @@ -72,7 +72,7 @@ Context()->{error}{msg}{"Unexpected character '='"} TEXT(beginproblem()); BEGIN_PGML -Solve the quadratic equation +Solve the equation [`` 10^{[$c][$var]}+[$a]=[$b] ``] diff --git a/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmProperties80.pg b/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmProperties80.pg index b1e76bf406..99f134dfac 100644 --- a/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmProperties80.pg +++ b/Contrib/PCC/CollegeAlgebra/Logarithms/LogarithmProperties80.pg @@ -47,11 +47,10 @@ do { $a = random(2,9,1); $b = random(2,5,1); $c = $a**$b; -} until ($c < 100); + $ab = $a*$b; +} until ( ($c < 100) && ($c != $ab) ); $d = random(2,5,1); -$ab = $a*$b; - $question = "$b \log($a) - $d \log($var1)"; $s1 = "\log \left( $a^{$b} \right) - \log \left( $var1^{$d} \right)"; diff --git a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials17.pg b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials17.pg index be4af5f17b..5caccfa980 100644 --- a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials17.pg +++ b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials17.pg @@ -28,9 +28,6 @@ loadMacros( ); TEXT(beginproblem()); - -TEXT(beginproblem()); - ############################################## diff --git a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials18.pg b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials18.pg index 45f88ebe57..cae56af3c2 100644 --- a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials18.pg +++ b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials18.pg @@ -28,9 +28,6 @@ loadMacros( ); TEXT(beginproblem()); - -TEXT(beginproblem()); - ############################################## diff --git a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials28.pg b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials28.pg index f342a85065..caa297efe6 100644 --- a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials28.pg +++ b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials28.pg @@ -115,7 +115,7 @@ $size = 220; add_functions($graphs[$i], "$f[$i] for x in <-10,10> " . "using color:blue and weight:2"); - +($graphs[$i]->fn)[0]->steps(200); } sub shufflemap { diff --git a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials50.pg b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials50.pg new file mode 100644 index 0000000000..2235a99586 --- /dev/null +++ b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials50.pg @@ -0,0 +1,94 @@ +##DESCRIPTION +## Algebra problem: polynomial functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'polynomial function', 'end behavior') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; +$showPartialCredit = 1; + +############################# + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(2,8,2); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); +$d = non_zero_random(-10,10,1); + +$ex0 = random(6,9,1); +$ex1 = random(2,$ex0-1,1); + +$s = random(-1,1,2); +$a = $s*$a; + +$func = Compute("$a*x**$ex0+$b*x**$ex1+$c*x+$d")->reduce; + +if ($a>0) { + if ($ex0%2==1) { + $ans0 = Compute("-infinity"); + $ans1 = Compute("infinity"); + } else { + $ans0 = Compute("infinity"); + $ans1 = Compute("infinity"); + } +} else { + if ($ex0%2==1) { + $ans0 = Compute("infinity"); + $ans1 = Compute("-infinity"); + } else { + $ans0 = Compute("-infinity"); + $ans1 = Compute("-infinity"); + } +} + +############################# + +BEGIN_PGML + +Given [`P(x)=[$func]`], answer the following questions. + +[@KeyboardInstructions( +"\n".'* Enter [|inf|]* for [`\infty`].' +)@]** + +* As [`x \rightarrow -\infty`], [`P(x) \rightarrow `][________]{$ans0}. + +* As [`x \rightarrow \infty`], [`P(x) \rightarrow `][________]{$ans1}. + +END_PGML + +############################# + +BEGIN_PGML_SOLUTION + +A polynomial's leading term determines its end behaviors. You need to know that: + +* For [`y=x^2`] or other even power, [`y \rightarrow \infty`] as [`x \rightarrow -\infty`] or as [`x \rightarrow \infty`]. + +* For [`y=x^3`] or other odd power, [`y \rightarrow -\infty`] as [`x \rightarrow -\infty`], and [`y \rightarrow \infty`] as [`x \rightarrow \infty`]. + +For [`P(x)=[$func]`], the leading term is [`[$a]x^{[$ex0]}`], so: + +* As [`x \rightarrow -\infty`], [`P(x) \rightarrow [$ans0]`]. + +* As [`x \rightarrow \infty`], [`P(x) \rightarrow [$ans1]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials80.pg b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials80.pg new file mode 100644 index 0000000000..dcf046a880 --- /dev/null +++ b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials80.pg @@ -0,0 +1,73 @@ +##DESCRIPTION + + +##KEYWORDS('algebra') +## Type: evaluation +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$showPartialCredit = 1; +############################# + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$x0 = random(1,5,1); +$x1 = -$x0; +do {$x2 = random(1,5,1);} until ($x2 != $x1); +$x3 = -$x2; + +$x02 = $x0**2; +$x22 = $x2**2; + +$b = -$x22-$x02; +$c = $x02*$x22; + +$func = Compute("x**4+$b*x**2+$c")->reduce; +$ans = List($x0,$x1,$x2,$x3); + +############################# + +BEGIN_PGML + +Find all real zeroes of [`` f(x) = [$func] ``]. + +[@KeyboardInstructions( +"\n".'* If there is more than one answer, enter them separated by a comma, like [`1, 2`].' +)@]** + + [`x=`][______________________]{$ans} + +END_PGML + +############################# + +$s1 = Compute("x**2-$x02")->reduce; +$s2 = Compute("x**2-$x22")->reduce; + +BEGIN_PGML_SOLUTION + +To find zeroes of [`f(x)`], we solve for [`x`] in [`f(x)=0`]. + + [``\begin{aligned} + [$func] &= 0 \\ + ([$s1])([$s2]) &= 0 \\ + (x-[$x0])(x-[$x1])(x-[$x2])(x-[$x3]) &= 0 \\ + x &= [$x0] \text{ or } [$x1] \text{ or } [$x2] \text{ or } [$x3] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_103.pg b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_103.pg index 4c3cf1469f..cd5dd52a94 100644 --- a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_103.pg +++ b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_103.pg @@ -14,8 +14,8 @@ loadMacros( "MathObjects.pl", "unionTables.pl", "contextFraction.pl", - - + "PGML.pl", + "PGcourse.pl", ); @@ -52,9 +52,9 @@ $denominator = (-$a[0])**($m[0])*(-$a[1])**($m[1])*(-$a[2])**($m[2]);} $e = Fraction("$d","$denominator"); -Context("Numeric"); +#Context("Numeric"); -$f = Compute("$e (x-$a[0])^($m[0])(x-$a[1])^($m[1])(x-$a[2])^($m[2])")->reduce; +$f = Formula("$e (x-$a[0])^($m[0])(x-$a[1])^($m[1])(x-$a[2])^($m[2])")->reduce; @@ -94,8 +94,32 @@ Context()->normalStrings; $showPartialCorrectAnswers = 1; +$s1 = Compute("(x-$a[1])**$m[1]")->reduce; +if ($m[1]==1) {$s1 = "(".$s1->TeX.")";} +$s2 = Compute("(x-$a[2])**$m[2]")->reduce; +$s3 = $m[1]==1 ? "" : "^{$m[1]}"; ANS( $f->cmp() ); +BEGIN_PGML_SOLUTION + +Since [$a[0]] is a zero with multiplicity [$m[0]], [`(x-[$a[0]])^{[$m[0]]}`] is a factor. + +Similarly, [`[$s1]`] and [`([$s2])`] are factors. + +Now we have [`f(x)= a(x-[$a[0]])^{[$m[0]]}[$s1]([$s2])`]. + +It's given that the [`y`]-intercept is [`[$d]`], we can substitute in [`x=0`] and [`y=[$d]`], and we have: + + [``\begin{aligned} + f(x) &= a(x-[$a[0]])^{[$m[0]]}[$s1]([$s2]) \\ + [$d] &= a(0-[$a[0]])^{[$m[0]]}(0-[$a[1]])[$s3](0-[$a[2]]) \\ + [$d] &= [$denominator]a \\ + [$e] &= a + \end{aligned}``] + +The function is [`f(x)=[$f]`]. + +END_PGML_SOLUTION ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_120.pg b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_120.pg index 3a4b91d015..55f4495ed0 100644 --- a/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_120.pg +++ b/Contrib/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_120.pg @@ -16,8 +16,8 @@ loadMacros( "contextFraction.pl", "PGgraphmacros.pl", "parserRadioButtons.pl", - - + "PGML.pl", + "PGcourse.pl", ); @@ -27,11 +27,13 @@ loadMacros( TEXT(beginproblem()); Context("Fraction"); -$a = random(1,2,1); +$a = random(2,3,1); $b = $a+random(1,3,1); $c = $b+random(1,2,1); -$zeropower = list_random(0,1,1,2); +$zeropower = list_random(0,1,2); +$deg = 6+$zeropower; +$turn = $deg-1; $s = random(-1,1,2); @@ -140,4 +142,37 @@ ANS( $radiolead->cmp() ); ANS( $radiosym->cmp() ); ANS( Compute("$n")->cmp() ); +############################################## + +$s1 = ($deg%2==0) ? 'the same infinity' : 'opposite infinities'; +if ($s>0) { + $s2 = ($deg%2==0) ? '\infty' : '-\infty'; + $s3 = 'positive'; +} else { + $s2 = ($deg%2==0) ? '-\infty' : '\infty'; + $s3 = 'negative'; +} + +BEGIN_PGML_SOLUTION + +###Part a + +When [`x \rightarrow -\infty`] and [`x \rightarrow \infty`], the function is approaching [$s1], implying the function has [$degree] degrees. + +###Part b + +Recall the end behaviors of [`y=x^2`] and [`y=x^3`]. + +Since the function has [$degree] degrees, and [`y \rightarrow [$s2]`] as [`x \rightarrow -\infty`], we can tell the leading coefficient is [$s3]. + +###Part c + +By the graph, the function has [$sym]. + +###Part d + +The function's graph has [`[$turn]`] turns, implying its minimum degree is [`[$deg]`]. + +END_PGML_SOLUTION + ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/CollegeAlgebra/RationalFunctions/Formulas40.pg b/Contrib/PCC/CollegeAlgebra/RationalFunctions/Formulas40.pg index 2e99f772b7..116b24e540 100644 --- a/Contrib/PCC/CollegeAlgebra/RationalFunctions/Formulas40.pg +++ b/Contrib/PCC/CollegeAlgebra/RationalFunctions/Formulas40.pg @@ -38,10 +38,11 @@ TEXT(beginproblem()); Context("Numeric"); $r[0] = random(-4,-1,1); -for my $i (1..3) -{ - $r[$i] = $r[$i-1] + random(1,5,1); -} +do { + for my $i (1..3) { + $r[$i] = $r[$i-1] + random(1,5,1); + } +} until ( ($r[1]!=0) && ($r[2]!=0) ); $p = Compute("(x-$r[0])*(x-$r[3])/((x-$r[1])*(x-$r[2]))")->reduce; @@ -116,7 +117,7 @@ We need to see from the graph that there are zeros at [`[@$r[0]@]`] and [`[@$r[3 We also need to see that there are vertical asymptotes at [`[@$r[1]@]`] and [`[@$r[2]@]`]. Since the arms of the function go in opposite directions (one up, one down) as [`x`] approaches either of these, then the degree of the vertical asymptotes must be odd: [`1`], [`3`], [`5`], etc. -Since this is a rational function, having zeros at [`[@$r[0]@]`] and [`[@$r[2]@]`] means that [`(x-[@$r[0]@])`] and [`(x-[@$r[2]@])`] are factors of the numerator. +Since this is a rational function, having zeros at [`[@$r[0]@]`] and [`[@$r[3]@]`] means that [`(x-[@$r[0]@])`] and [`(x-[@$r[3]@])`] are factors of the numerator. Having vertical asymptotes at [`[@$r[1]@]`] and [`[@$r[2]@]`] means that [`(x-[@$r[1]@])`] and [`(x-[@$r[2]@])`] are factors of the denominator. diff --git a/Contrib/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions110.pg b/Contrib/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions110.pg index 23c9ebee0a..2176544661 100644 --- a/Contrib/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions110.pg +++ b/Contrib/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions110.pg @@ -53,7 +53,7 @@ $x1 = $b/$a; do {$x2 = non_zero_random(-4,-1,1);} until (abs($x1)!=abs($x2)); $x1N = -$x1; $x2N = -$x2; -do {$x3 = non_zero_random(-4,4,1);} until ($x3!=$x2); +do {$x3 = non_zero_random(-4,4,1);} until (abs($x3)!=abs($x2)); $x3N = -$x3; $x1p3 = -$b-$a*$x3; diff --git a/Contrib/PCC/CollegeAlgebra/Transformations/General4.pg b/Contrib/PCC/CollegeAlgebra/Transformations/General4.pg new file mode 100644 index 0000000000..2e732ec525 --- /dev/null +++ b/Contrib/PCC/CollegeAlgebra/Transformations/General4.pg @@ -0,0 +1,68 @@ +#DESCRIPTION +## Algebra problem: Transformations of functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'transformation of function') + +## tcao , PAID on 11-24-2003 + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Transformations of Functions') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Precalculus') +## EditionText1('3') +## AuthorText1('Stewart, Redlin, Watson') +## Section1('2.4') +## Problem1('25') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl" +); + +#TEXT(beginproblem()); +$showPartialCredit = 1; +$showHint = 3; + +$a=random(2,15,2); +$b=random(3,30,2); + +BEGIN_PGML +Start with [`f`], where [`f(x)=\sqrt{x} `]. Let [`g`] be the function that we have after performing the following transformations: + +1) reflect over the [`x`]-axis, + +2) stretch horizontally by a factor of [`[$b]`], and + +3) shift to the left [`[$a]`] units. + + +Using [|sqrt(x)|] for [`\sqrt{x}`], The new function has formula + + [`g(x)={}`][_____________________] + +END_PGML + +$ans1 = "-sqrt(1/$b *(x + $a))"; + +ANS(fun_cmp($ans1)); + + +BEGIN_PGML_SOLUTION + +1) Reflect over the [`x`]-axis, making the function [`f(x)=-\sqrt{x} `]. + +2) Stretch horizontally by a factor of [`[$b]`], making the function [`f(x)=-\sqrt{\frac{1}{[$b]}x} `]. + +3) Shift to the left [`[$a]`] units, making the function [`g(x) = -{\sqrt{\frac{1}{[$b]} (x + [$a])}}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/CollegeAlgebra/Transformations/GeneralTransformations40.pg b/Contrib/PCC/CollegeAlgebra/Transformations/GeneralTransformations40.pg index ddbd723db9..46f54c7ff7 100644 --- a/Contrib/PCC/CollegeAlgebra/Transformations/GeneralTransformations40.pg +++ b/Contrib/PCC/CollegeAlgebra/Transformations/GeneralTransformations40.pg @@ -76,12 +76,12 @@ BEGIN_PGML_SOLUTION a) If [`g(x) = f(x) + [$a1]`], then [`g`] has a modification from [`f`] that is external to [`f`]'s formula, so the transformation is of a vertical nature. Vertical transformations work in an intuitive way, where addition means shifting up and subtraction means shifting down. So The graph of [`g`] is obtained by shifting the graph of [`f`] [@$popupa->correct_ans@] one unit. -a) If [`g(x) = f(x+[$a2])`], then [`g`] has a modification from [`f`] that is internal to [`f`]'s formula, so the transformation is of a horizontal nature. Horizontal transformations work in a counterintuitive way, where addition means shifting left and subtraction means shifting right. So The graph of [`g`] is obtained by shifting the graph of [`f`] [@$popupa->correct_ans@] one unit. - -a) If [`g(x) = -f(x)`], then [`g`] has a modification from [`f`] that is external to [`f`]'s formula, so the transformation is of a vertical nature. The negation implies a reflection about one of the main axes, and a vertical reflection would be over the [`x`]-axis. +a) If [`g(x) = f(x+[$a2])`], then [`g`] has a modification from [`f`] that is internal to [`f`]'s formula, so the transformation is of a horizontal nature. Horizontal transformations work in a counterintuitive way, where addition means shifting left and subtraction means shifting right. So The graph of [`g`] is obtained by shifting the graph of [`f`] [@$popupb->correct_ans@] one unit. a) If [`g(x) = f(-x)`], then [`g`] has a modification from [`f`] that is internal to [`f`]'s formula, so the transformation is of a horizontal nature. The negation implies a reflection about one of the main axes, and a vertical reflection would be over the [`y`]-axis. +a) If [`g(x) = -f(x)`], then [`g`] has a modification from [`f`] that is external to [`f`]'s formula, so the transformation is of a vertical nature. The negation implies a reflection about one of the main axes, and a vertical reflection would be over the [`x`]-axis. + END_PGML_SOLUTION diff --git a/Contrib/PCC/CollegeAlgebra/Transformations/GeneralTransformations80.pg b/Contrib/PCC/CollegeAlgebra/Transformations/GeneralTransformations80.pg index d5e4dd2f7c..c7ee0a7287 100644 --- a/Contrib/PCC/CollegeAlgebra/Transformations/GeneralTransformations80.pg +++ b/Contrib/PCC/CollegeAlgebra/Transformations/GeneralTransformations80.pg @@ -200,13 +200,13 @@ $horshiftA = abs($horshift); BEGIN_PGML_SOLUTION -Identify that the parent function, before transformation, is [`y=\left| x\right|}`]. +Identify that the parent function, before transformation, is [`y=\left| x\right|`]. Before doing transformation for [`f(x)=[$f[0]]`], since there is a number in front of the independent variable [`x`], we need to factor the expression and convert the function to: [``f(x)=[$f[0]]=[$funcFactored]``] -To transform from [`y=\left| x\right|}`] to [`[$funcFactored]`], there is a horizontal [$soc] the [`y`]-axis by a factor of [`\frac{1}{[$a]}`], and a horizontal shift to the [$lor] by [`[$horshiftA]`] units. +To transform from [`y=\left| x\right|`] to [`[$funcFactored]`], there is a horizontal [$soc] the [`y`]-axis by a factor of [`\frac{1}{[$a]}`], and a horizontal shift to the [$lor] by [`[$horshiftA]`] units. By order of transformations, first we need to do the [$soc1] on [`y=\left| x\right|`], and then the shift. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. diff --git a/Contrib/PCC/CollegeAlgebra/Transformations/Shifting60.pg b/Contrib/PCC/CollegeAlgebra/Transformations/Shifting60.pg index 09092fe75b..f6dde6f195 100644 --- a/Contrib/PCC/CollegeAlgebra/Transformations/Shifting60.pg +++ b/Contrib/PCC/CollegeAlgebra/Transformations/Shifting60.pg @@ -214,7 +214,7 @@ $PAR (2,$a[4])&\to(2,$k[4]) \end{aligned}\] -And so we find \(k(-2)=$k[0]\), \(k(-1)=$k[1]\), \(k(0)=$k[2]\), \(k(1)=$k[3]\), and \(k(2)=$k[3]\), giving us all five values for the table for \(k\). +And so we find \(k(-2)=$k[0]\), \(k(-1)=$k[1]\), \(k(0)=$k[2]\), \(k(1)=$k[3]\), and \(k(2)=$k[4]\), giving us all five values for the table for \(k\). $PAR \(m\) is the function \(f\) shifted \(1\) unit to the right and \(3\) units up. So the points that are represented in the table for \(f\) need to be shifted \(1\) unit right and \(3\) up to get points that are on \(m\)'s graph: @@ -232,4 +232,4 @@ And so we find \(m(-1)=$k[0]\), \(m(0)=$k[1]\), \(m(1)=$k[2]\), and \(m(2)=$k[3] END_SOLUTION -ENDDOCUMENT(); \ No newline at end of file +ENDDOCUMENT(); diff --git a/Contrib/PCC/CompSci/CS161/problemSample.pg b/Contrib/PCC/CompSci/CS161/problemSample.pg new file mode 100644 index 0000000000..e917b969fc --- /dev/null +++ b/Contrib/PCC/CompSci/CS161/problemSample.pg @@ -0,0 +1,61 @@ +## DESCRIPTION +## Precalculus: function decomposition +## ENDDESCRIPTION +## KEYWORDS('precalculus', 'function decomposition') +## DBsubject('WeBWorK') +## DBchapter('WeBWorK Tutorial') +## DBsection('Fort Lewis Tutorial 2011') +## Date('01/30/2011') +## Author('Paul Pearson') +## Institution('Fort Lewis College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +########################### +# Initialization +DOCUMENT(); +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"answerComposition.pl", +"AnswerFormatHelp.pl", +); +TEXT(beginproblem()); +########################### +# Setup +Context("Numeric"); +Context()->variables->add(u=>"Real"); +$a = random(2,9,1); +$f = Formula("sqrt(u)"); +$g = Formula("x^2+$a"); +########################### +# Main text +Context()->texStrings; +BEGIN_TEXT +Express the function \( y = \sqrt{ x^2 + $a } \) +as a composition \( y = f(g(x)) \) of two simpler +functions \( y = f(u) \) and \( u = g(x) \). +$BR +$BR +\( f(u) \) = \{ ans_rule(20) \} +\{ AnswerFormatHelp("formulas") \} +$BR +\( g(x) \) = \{ ans_rule(20) \} +\{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; +############################ +# Answer evaluation +$showPartialCorrectAnswers = 1; +COMPOSITION_ANS( $f, $g, vars=>['u','x'], showVariableHints=>1); +############################ +# Solution +Context()->texStrings; +BEGIN_SOLUTION +Solution explanation goes here. +END_SOLUTION +Context()->normalStrings; +COMMENT('MathObject version.'); +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_01_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_01_AbsValEq.pg index 5ba2102c78..b326c22447 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_01_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_01_AbsValEq.pg @@ -62,8 +62,11 @@ $ans = Formula("{-$a, $a}"); # Main text BEGIN_PGML -Solve: [` \left\lvert [$var] \right\rvert = [$a] `] +Solve the equation. +[`` \left\lvert [$var] \right\rvert = [$a] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_02_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_02_AbsValEq.pg index 29c147dc3a..1cb0eca13a 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_02_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_02_AbsValEq.pg @@ -63,9 +63,11 @@ $ans = Formula("{$ans1, $ans2}"); # Main text BEGIN_PGML -Solve: [` \left\lvert [$var] - [$a] \right\rvert = [$b] `] +Solve the equation. +[`` \left\lvert [$var] - [$a] \right\rvert = [$b] ``] +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_03_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_03_AbsValEq.pg index e5d0fd5a6d..c4ee72db7d 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_03_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_03_AbsValEq.pg @@ -63,10 +63,11 @@ $ans = Formula("{$sol[0],$sol[1]}"); TEXT(beginproblem()); BEGIN_PGML -Solve: [` \left\lvert 2[$var] + [$a] \right\rvert = [$b] `] +Solve the eqation. -[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** +[`` \left\lvert 2[$var] + [$a] \right\rvert = [$b] ``] +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_04_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_04_AbsValEq.pg index 314476dd38..0be15c8490 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_04_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_04_AbsValEq.pg @@ -56,6 +56,7 @@ Context("Fraction"); $sol1 = Fraction($a-$b*$c,2); $sol2 = Fraction($a+$b*$c,2); Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); $ans = Formula("{$sol1,$sol2}"); ###################################### @@ -63,10 +64,11 @@ $ans = Formula("{$sol1,$sol2}"); TEXT(beginproblem()); BEGIN_PGML -Solve: [`\displaystyle \left\lvert\frac{2 [$var] - [$a]}{[$b]}\right\rvert = [$c] `] +Solve the equation. -[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** +[``\displaystyle \left\lvert\frac{2 [$var] - [$a]}{[$b]}\right\rvert = [$c] ``] +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_05_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_05_AbsValEq.pg index 7fa6202600..334c846a00 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_05_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_05_AbsValEq.pg @@ -47,7 +47,9 @@ $ans = Compute("no solutions"); # Main text BEGIN_PGML -Solve the equation: [` \left\lvert [$var] \right\rvert = [$a] `] +Solve the equation. + +[`` \left\lvert [$var] \right\rvert = [$a] ``] [@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_06_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_06_AbsValEq.pg index c46ca1f959..ab256718f0 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_06_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_06_AbsValEq.pg @@ -25,6 +25,7 @@ loadMacros( "contextInequalitiesAllowStrings.pl", "PGML.pl", "PCCmacros.pl", + "contextFiniteSolutionSets.pl", "PGcourse.pl" ); @@ -52,13 +53,19 @@ Context()->variables->are($var=>'Real'); Context()->strings->add("No solution"=>{NONE}); $ans = List(-$a); +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{-$a}"); + ###################################### # Main text BEGIN_PGML -Solve: [` \left\lvert [$var] + [$a] \right\rvert = 0 `] +Solve the equation. + +[`` \left\lvert [$var] + [$a] \right\rvert = 0 ``] -[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_07_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_07_AbsValEq.pg index eec32de2f5..ae9c7624d2 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_07_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_07_AbsValEq.pg @@ -68,8 +68,11 @@ $ans = Formula("{$v1, $v2}"); # Main text BEGIN_PGML -Solve: [` \left\lvert [$a] - 3[$var] \right\rvert = [$b] `] +Solve the equation. +[`` \left\lvert [$a] - 3[$var] \right\rvert = [$b] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_08_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_08_AbsValEq.pg index 1f4752d59c..cef7f6612e 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_08_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_08_AbsValEq.pg @@ -55,7 +55,9 @@ $ans = Formula("{$ans1,$ans2}"); # Main text BEGIN_PGML -Solve the equation: [` \left\lvert\frac{1}{[$a]}[$var] + [$b]\right\rvert = [$c] `] +Solve the equation. + +[`` \left\lvert\frac{1}{[$a]}[$var] + [$b]\right\rvert = [$c] ``] [@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_09_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_09_AbsValEq.pg index 3e674193a6..0cffba9659 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_09_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_09_AbsValEq.pg @@ -25,6 +25,8 @@ loadMacros( "contextInequalitiesAllowStrings.pl", "PGML.pl", "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", "PGcourse.pl" ); @@ -54,13 +56,24 @@ Context()->variables->are($var=>'Real'); Context()->strings->add("No solution"=>{NONE}); $ans = List(($c+$a)/$b, (-$c+$a)/$b); +Context("Fraction"); +$soln1 = Fraction(($c+$a)/$b); +$soln2 = Fraction((-$c+$a)/$b); + +Context("FiniteSolutionSets"); +#Context()->flags->remove("NumberCheck"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$soln1,$soln2}"); + ###################################### # Main text BEGIN_PGML -Solve: [` \left\lvert[$a]- [$b][$var]\right\rvert = [$c] `] +Solve the equation. + +[`` \left\lvert[$a]- [$b][$var]\right\rvert = [$c] ``] -[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_10_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_10_AbsValEq.pg index df7c402f12..8009b0d5c9 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_10_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_10_AbsValEq.pg @@ -23,7 +23,7 @@ DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGstandard.pl", "MathObjects.pl", - "contextInequalitiesAllowStrings.pl", + "contextFiniteSolutionSets.pl", "PGML.pl", "PCCmacros.pl", "PGcourse.pl" @@ -42,26 +42,21 @@ $a = random(1,9,2); $b = random(2,8,2); $c = random(2,6,2); -$RequiredFormat = "Enter your answer in the form: ". -"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". -"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". -"(include the word ${BBOLD}or$EBOLD between the solutions), ". -"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". -"For no solution, type ${BITALIC}NONE${EITALIC} and ". -"if all real numbers are solutions, ". -"type ${BITALIC}All real numbers${EITALIC}."; -Context("Inequalities-AllowStrings"); +Context("FiniteSolutionSets"); Context()->variables->are($var=>'Real'); -Context()->strings->add("No solution"=>{NONE}); -$ans = List(-$c-$b-$a, $c+$b-$a); +$d = -$c-$b-$a; +$e = $c+$b-$a; +$ans = Formula("{$d, $e}"); ###################################### # Main text BEGIN_PGML -Solve: [` \left\lvert [$var] + [$a]\right\rvert - [$b] = [$c] `] +Solve the equation. -[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** +[`` \left\lvert [$var] + [$a]\right\rvert - [$b] = [$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_12_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_12_AbsValEq.pg index 2fb232eeaa..e30e9c89e9 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_12_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_12_AbsValEq.pg @@ -26,6 +26,7 @@ loadMacros( "contextInequalitiesAllowStrings.pl", "PGML.pl", "PCCmacros.pl", + "contextFiniteSolutionSets.pl", "PGcourse.pl" ); @@ -55,13 +56,19 @@ Context()->variables->are($var=>'Real'); ## Context()->strings->add("No solution"); $ans = Compute("NONE"); +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); ## +$ans = Compute("no solutions"); + ###################################### # Main text BEGIN_PGML -Solve: [` \left\lvert [$var] + [$a] \right\rvert + [$b] = [$c] `] +Solve the equation. + +[`` \left\lvert [$var] + [$a] \right\rvert + [$b] = [$c] ``] -[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_13_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_13_AbsValEq.pg index c91d37b8d2..c15d8e3511 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_13_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_13_AbsValEq.pg @@ -24,7 +24,7 @@ DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGstandard.pl", "MathObjects.pl", - "contextInequalitiesAllowStrings.pl", + "contextFiniteSolutionSets.pl", "PGML.pl", "PCCmacros.pl", "PGcourse.pl" @@ -44,25 +44,19 @@ $c = random(2,6,2); $b = $c + random(1,5,1); #This gives a negative for the absolute value $d = random(2,8,2); -$RequiredFormat = "Enter your answer in the form: ". -"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". -"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". -"(include the word ${BBOLD}or$EBOLD between the solutions), ". -"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". -"For no solution, type ${BITALIC}NONE${EITALIC} and ". -"if all real numbers are solutions, ". -"type ${BITALIC}All real numbers${EITALIC}."; -Context("Inequalities-AllowStrings"); +Context("FiniteSolutionSets"); Context()->variables->are($var=>'Real'); -$ans = Compute("NONE"); +$ans = Compute("no solutions"); ###################################### # Main text BEGIN_PGML -Solve: [` \left\lvert [$d] [$var] + [$a]\right\rvert + [$b] = [$c] `] +Solve the equation. -[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** +[`` \left\lvert [$d] [$var] + [$a]\right\rvert + [$b] = [$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_14_AbsValEq.pg b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_14_AbsValEq.pg index f1122af2fd..e709dd4f26 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_14_AbsValEq.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/43IntAlg_14_AbsValEq.pg @@ -23,7 +23,7 @@ DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGstandard.pl", "MathObjects.pl", - "contextInequalitiesAllowStrings.pl", + "contextFiniteSolutionSets.pl", "PGML.pl", "PCCmacros.pl", "PGcourse.pl" @@ -43,25 +43,19 @@ $n = random(1,5,1); $b = $a * $n; $c = random(1,8,1); -$RequiredFormat = "Enter your answer in the form: ". -"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". -"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". -"(include the word ${BBOLD}or$EBOLD between the solutions), ". -"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". -"For no solution, type ${BITALIC}NONE${EITALIC} and ". -"if all real numbers are solutions, ". -"type ${BITALIC}All real numbers${EITALIC}."; -Context("Inequalities-AllowStrings"); +Context("FiniteSolutionSets"); Context()->variables->are($var=>'Real'); -$ans = List($n); +$ans = Formula("{$n}"); ###################################### # Main text BEGIN_PGML -Solve: [` \left\lvert[$a] [$var] - [$b]\right\rvert + [$c] = [$c] `] +Solve the equation. -[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** +[`` \left\lvert[$a] [$var] - [$b]\right\rvert + [$c] = [$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/MCH1-3-3-12-Absolute-value.pg b/Contrib/PCC/Math95/AbsValueEquations/MCH1-3-3-12-Absolute-value.pg index 9c429bc743..030f4088bb 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/MCH1-3-3-12-Absolute-value.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/MCH1-3-3-12-Absolute-value.pg @@ -34,6 +34,8 @@ loadMacros( "AnswerFormatHelp.pl", "PGML.pl", "PCCmacros.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PGcourse.pl" ); @@ -91,6 +93,12 @@ Context()->{error}{convert} = sub { return $message; }; +Context("Fraction"); +$soln1 = Fraction(($a+$b)/$c); +$soln2 = Fraction(-($a+$b)/$c); + +Context("FiniteSolutionSets"); +$sol = Formula("{$soln1,$soln2}"); ################################### # Main text @@ -98,10 +106,10 @@ Context()->{error}{convert} = sub { BEGIN_PGML a. Write the equation [`[$eqn]`] as two separate equations. Neither of your equations should use absolute value. - [__]{$multians}{width=>30} + [__]{$multians}{width=>30} [__]{$multians}{width=>30} -a. Solve both equations above. [@KeyboardInstructions('Enter your solutions as a comma-separated list.')@]** +a. Solve the original equation by solveing each of the equations above. [__]{$sol}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/MCH1-3-3-14-Absolute-value.pg b/Contrib/PCC/Math95/AbsValueEquations/MCH1-3-3-14-Absolute-value.pg index 1bfae126be..3f10907ec3 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/MCH1-3-3-14-Absolute-value.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/MCH1-3-3-14-Absolute-value.pg @@ -104,7 +104,7 @@ $sol = Formula("{$sol1,$sol2}"); BEGIN_PGML a. Write the equation [`[$eqn]`] as two separate equations. Neither of your equations should use absolute value. - [__]{$multians}{width=>30} + [__]{$multians}{width=>30} [__]{$multians}{width=>30} a. Solve the equation [`[$eqn]`], possibly by solving each equation from part a. diff --git a/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_60.pg b/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_60.pg index 12467fb744..54c0d0b161 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_60.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_60.pg @@ -52,9 +52,9 @@ $ans = Formula("{-$x}"); BEGIN_PGML Solve the equation _by inspection_ (meaning in your head). ->>[``\left\lvert [$a]x + [$b]\right\rvert = 0 ``]<< +[``\left\lvert [$a]x + [$b]\right\rvert = 0 ``] -[@KeyboardInstructions('If there are multiple solutions, enter the solutions as a comma-separated list.')@]** +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_70.pg b/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_70.pg index abc2e9bb19..84c305410b 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_70.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_70.pg @@ -72,9 +72,9 @@ $ans = Formula("{$an1, $an2}"); BEGIN_PGML The equation [` \lvert x\rvert =\lvert y\rvert `] is satisfied if [` x=y `] or [` x=-y `]. Use this fact to solve the following equation. ->>[``\left\lvert [$f] \right\rvert = \left\lvert [$g] \right\rvert``]<< +[``\left\lvert [$f] \right\rvert = \left\lvert [$g] \right\rvert``] -[@KeyboardInstructions('If there is more than one solution, enter the solutions as a comma-separated list.')@]** +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_72.pg b/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_72.pg index 4be5b9c6dd..a32178583b 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_72.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/ks_2_7_72.pg @@ -29,6 +29,8 @@ loadMacros( "MathObjects.pl", "unionLists.pl", "contextInequalities.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", "PGML.pl", "PCCmacros.pl", "PGcourse.pl" @@ -42,22 +44,24 @@ $showPartialCorrectAnswers = 1; ############################################################## -Context("Numeric"); -Context()->strings->add(none=>{},EmptySet=>{alias=>"none"}); - $a = random(2,6,2); $b = random(-5,-1,2); +$c = -$a-$b; + +Context("Fraction"); +$c = Fraction( -$a-$b,2); -$ans = List("(-$a-$b)/2"); +Context("FiniteSolutionSets"); +$ans = Formula("{$c}"); ############################################################## BEGIN_PGML The equation [` \lvert x\rvert =\lvert y\rvert `] is satisfied if [` x=y `] or [` x=-y `]. Use this fact to solve the following equation. ->>[``\left\lvert x + [$a] \right\rvert = \left\lvert x + [$b] \right\rvert``]<< +[``\left\lvert x + [$a] \right\rvert = \left\lvert x + [$b] \right\rvert``] -[@KeyboardInstructions('If there is more than one solution, enter the solutions as a comma-separated list.')@]** +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/lh1-6_66.pg b/Contrib/PCC/Math95/AbsValueEquations/lh1-6_66.pg index 0976d5fd61..def8cbd224 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/lh1-6_66.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/lh1-6_66.pg @@ -45,7 +45,11 @@ $answer = Formula("{$ans1,$ans2}"); BEGIN_PGML -Solve the equation [`\left\lvert [$a] x ? {[$b]}\right\rvert =[$c] `]. [@KeyboardInstructions('If there is more than one solution, enter the solutions as a comma-separated list.')@]** +Solve the equation. + +[``\left\lvert [$a] x ? {[$b]}\right\rvert =[$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$answer}{width=>20} END_PGML diff --git a/Contrib/PCC/Math95/AbsValueEquations/pn4.pg b/Contrib/PCC/Math95/AbsValueEquations/pn4.pg index 8c3e4f4a1e..93d7fa23d6 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/pn4.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/pn4.pg @@ -29,6 +29,8 @@ loadMacros( "extraAnswerEvaluators.pl", "PGML.pl", "PCCmacros.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PGcourse.pl" ); @@ -45,12 +47,21 @@ $e=-($b+$c); $ans1 = "$d/$a"; $ans2= "$e/$a"; +Context("Fraction"); +$ans1 = Fraction($d,$a); +$ans2 = Fraction($e,$a); + +Context("FiniteSolutionSets"); +$ans = Formula("{$ans1,$ans2}"); + BEGIN_PGML -Solve the following equation. [@KeyboardInstructions('If there is more than one solution, write them separated by commas.')@]** +Solve the equation. + +[`` \left\lvert [$pol] \right\rvert = [$c] ``] ->>[`` \left\lvert [$pol] \right\rvert = [$c] ``]<< +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** -[__]{List($ans1,$ans2)}{width=>20} +[__]{$ans}{width=>20} END_PGML diff --git a/Contrib/PCC/Math95/AbsValueEquations/s5p6.pg b/Contrib/PCC/Math95/AbsValueEquations/s5p6.pg index d78a2c1b73..03ed192dc6 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/s5p6.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/s5p6.pg @@ -20,6 +20,8 @@ loadMacros( "PGstandard.pl", "PGchoicemacros.pl", "PGML.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", "PCCmacros.pl", "PGcourse.pl" ); @@ -33,19 +35,22 @@ $a = random(2,8,2); $b = random(2,9,1); $c = random(3,9,2); $d = random(2,9,1); -$answer1 = ($b+$d)/($a-$c); -$answer2 = ($b-$d)/($a+$c); +Context("Fraction"); +$answer1 = Fraction($b+$d,$a-$c); +$answer2 = Fraction($b-$d,$a+$c); if ($answer2 < $answer1) { $dummy = $answer1; $answer1 = $answer2; $answer2 = $dummy; } -$ans = List($answer1,$answer2); +Context("FiniteSolutionSets"); +$ans = Formula("{$answer1,$answer2}"); BEGIN_PGML -Solve the equation: ->>[`` \left\lvert [$a] x - [$b] \right\rvert = \left\lvert [$c] x + [$d]\right\rvert ``]<< +Solve the equation. -[@KeyboardInstructions('If there is more than one solution, enter the solutions as a comma-separated list.')@]** +[`` \left\lvert [$a] x - [$b] \right\rvert = \left\lvert [$c] x + [$d]\right\rvert ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/AbsValueEquations/zhu3.pg b/Contrib/PCC/Math95/AbsValueEquations/zhu3.pg index 28790bcc14..b8747695c3 100644 --- a/Contrib/PCC/Math95/AbsValueEquations/zhu3.pg +++ b/Contrib/PCC/Math95/AbsValueEquations/zhu3.pg @@ -22,6 +22,8 @@ loadMacros( "PGML.pl", "MathObjects.pl", "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", "PGcourse.pl" ); @@ -39,14 +41,22 @@ $h=$a+$c; $ans1 = "$e/$f"; $ans2= "$g/$h"; $ans = List($ans1,$ans2); -$f = Formula("$a x + $b")->reduce; +$func = Formula("$a x + $b")->reduce; + +Context("Fraction"); +$ans1 = Fraction($e,$f); +$ans2 = Fraction($g,$h); + +Context("FiniteSolutionSets"); +$ans = Formula("{$ans1,$ans2}"); +if ($ans1 == $ans2) {$ans = Formula("{$ans1}");}; BEGIN_PGML -Solve the following equation. +Solve the equation. ->>[``\left\lvert [$f] \right\rvert = \left\lvert[$c] x +[$d]\right\rvert ``]<< +[``\left\lvert [$func] \right\rvert = \left\lvert[$c] x +[$d]\right\rvert ``] -[@KeyboardInstructions('If there is more than one solution, enter the solutions as a comma-separated list.')@]** +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** [__]{$ans}{width=>20} diff --git a/Contrib/PCC/Math95/Functions/Functions13.pg b/Contrib/PCC/Math95/Functions/Functions13.pg index 9ea84ea00e..93db162fc8 100644 --- a/Contrib/PCC/Math95/Functions/Functions13.pg +++ b/Contrib/PCC/Math95/Functions/Functions13.pg @@ -32,8 +32,9 @@ loadMacros( "PCCmacros.pl", "PCCgraphMacros.pl", "PGML.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", - ); @@ -64,38 +65,24 @@ $xmax = max($x2+3,5); $ymin = -5; $ymax = 5; +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + minor xtick = {$xmin,...,$xmax}, + trig format plots=rad, + ] + \addplot+[domain=$xmin:$xmax, smooth] {$f}; + \legend{\(y=$fname(x)\)}; +\end{axis} +END_TIKZ -$gr = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[240,240] -); - - $gr->lb('reset'); - for my $j ($xmin+1..$xmax-1) { - if (abs($j)<10**(-10) or $j%2 == 1) {next;} - $gr->lb( new Label($j,0, $j,'black','center','top','large')); - } - - for my $j ($ymin+1..$ymax-1) { - if (abs($j)<10**(-10)) {next;} - $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); - $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); - - -add_functions($gr, "$f for x in <$xmin,$xmax>" . - " using color:blue and weight:1"); -$start = $xmin; -$stop = $xmax; -$pixel = ($xmax-$xmin)/240; -$gr->moveTo($start+3*$pixel,$f->eval(x=>$start+3*$pixel)); -$gr->arrowTo($start,$f->eval(x=>$start),'blue',1); -$gr->moveTo($stop-3*$pixel,$f->eval(x=>$stop-3*$pixel)); -$gr->arrowTo($stop,$f->eval(x=>$stop),'blue',1); $peak = $q+$s; $trough = $peak+$q; @@ -109,12 +96,12 @@ Use the graph of [`[$fname]`] below to evaluate the given expressions. (Estimate [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< -a. [`[$fname]([$x1])={}`][_____]{$y1->cmp(tolType=>absolute, tolerance=>0.1)} +a. [`[$fname]([$x1])={}`][_____]{$y1->cmp(tolType=>'absolute', tolerance=>0.1)} -a. [`[$fname]([$x2])={}`][_____]{$y2->cmp(tolType=>absolute, tolerance=>0.1)} +a. [`[$fname]([$x2])={}`][_____]{$y2->cmp(tolType=>'absolute', tolerance=>0.1)} END_PGML diff --git a/Contrib/PCC/Math95/Functions/Functions14.pg b/Contrib/PCC/Math95/Functions/Functions14.pg index a3bd415e60..f2eb5ece4b 100644 --- a/Contrib/PCC/Math95/Functions/Functions14.pg +++ b/Contrib/PCC/Math95/Functions/Functions14.pg @@ -32,6 +32,8 @@ loadMacros( "PCCmacros.pl", "PCCgraphMacros.pl", "PGML.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -65,27 +67,6 @@ $ymin = -10; $ymax = 10; -$gr = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[240,240] -); - - $gr->lb('reset'); - for my $j ($xmin+1..$xmax-1) { - if (abs($j)<10**(-10) or $j%2 == 1) {next;} - $gr->lb( new Label($j,0, $j,'black','center','top','large')); - } - - for my $j ($ymin+1..$ymax-1) { - if (abs($j)<10**(-10) or $j%2 == 1) {next;} - $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); - $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); - - @xvalues = ($xmin,$xmax); if ($a > 0) { push(@xvalues,sqrt(($ymax-$k)/$a)+$h); @@ -98,15 +79,25 @@ else { @xvalues = num_sort(@xvalues); $start = $xvalues[1]; $stop = $xvalues[2]; -$pixel = ($xmax-$xmin)/240; -add_functions($gr, "$f for x in <$start,$stop>" . - " using color:blue and weight:1"); +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + ] + \addplot+[domain=$start:$stop, smooth] {$a*(x-$h)^2+$k}; + \legend{\(y=$fname(x)\)}; +\end{axis} +END_TIKZ -$gr->moveTo($start+$pixel,$a*($start+$pixel-$h)**2+$k); -$gr->arrowTo($start,$a*($start-$h)**2+$k,'blue',1); -$gr->moveTo($stop-$pixel,$a*($stop-$pixel-$h)**2+$k); -$gr->arrowTo($stop,$a*($stop-$h)**2+$k,'blue',1); $direction = ($a == 1) ? "upward" : "downward"; $yint = $f->eval(x=>0); @@ -121,7 +112,7 @@ Use the graph of [`[$fname]`] below to evaluate the given expressions. (Estimate [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< a. [`[$fname]([$x1])={}`][_____]{$y1->cmp(tolType=>absolute, tolerance=>0.1)} diff --git a/Contrib/PCC/Math95/Functions/Functions15.pg b/Contrib/PCC/Math95/Functions/Functions15.pg index 7afe931662..a28e820906 100644 --- a/Contrib/PCC/Math95/Functions/Functions15.pg +++ b/Contrib/PCC/Math95/Functions/Functions15.pg @@ -50,7 +50,7 @@ $x[$i] = $x[$i-1]+$s; } for my $i (0..4) { -Real($y[$i] = random(-2,10,0.1)); +Real($y[$i] = Real(random(-2,10,0.1))); } diff --git a/Contrib/PCC/Math95/Functions/Functions17.pg b/Contrib/PCC/Math95/Functions/Functions17.pg index fa117da356..c400318535 100644 --- a/Contrib/PCC/Math95/Functions/Functions17.pg +++ b/Contrib/PCC/Math95/Functions/Functions17.pg @@ -42,7 +42,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$fname = RandomVariableName(type=>function); +$fname = RandomVariableName(type=>'function'); Context("Numeric"); @@ -80,13 +80,13 @@ a. Give a numeric representation of [`[$fname]`]: [@ BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). AlignedRow([general_math_ev3('x'),general_math_ev3('0'),general_math_ev3('1'),general_math_ev3('2'),general_math_ev3('3'),general_math_ev3('4')], align=>LEFT, separation=>0). -AlignedRow([general_math_ev3("$fname(x)"), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1)], align=>RIGHT, separation=>0). +AlignedRow([general_math_ev3("$fname(x)"), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1)], align=>'RIGHT', separation=>0). EndTable() @]* a. Give a formula for [`[$fname]`]. - [@KeyboardInstructions(qw!Include the function's name and an equals sign in the formula.!)@]** + [@KeyboardInstructions(qq!Include the function's name and an equals sign in the formula.!)@]** [__________] diff --git a/Contrib/PCC/Math95/Functions/Functions20.pg b/Contrib/PCC/Math95/Functions/Functions20.pg index 5dd9e01b78..d54836f84a 100644 --- a/Contrib/PCC/Math95/Functions/Functions20.pg +++ b/Contrib/PCC/Math95/Functions/Functions20.pg @@ -27,10 +27,11 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "PGgraphmacros.pl", "PGML.pl", "PCCmacros.pl", "PCCgraphMacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -57,7 +58,8 @@ $f = Formula("$a x^3+$b x^2+$c x + $d"); $crit = (-2*$b+sqrt(4*$b**2-12*$a*$c))/(6*$a); $peak = random(2,5,1); -$f = $f*$peak/($f->eval(x=>$crit)); +$ch = $f->eval(x=>$crit); +$f = $f*$peak/$ch; Context("Interval"); $domain = Interval("[$r[0],$r[2])"); @@ -70,30 +72,24 @@ $ymin = -$peak-3; $ymax = $peak+3; -$gr = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[240,240] -); - - $gr->lb('reset'); - for my $j ($xmin+1..$xmax-1) { - if (abs($j)<10**(-10) or $j%2 != 0) {next;} - $gr->lb( new Label($j, 0, $j,'black','center','top','large')); - } - - for my $j ($ymin+1..$ymax-1) { - if (abs($j)<10**(-10) or $j%2 != 0) {next;} - $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); - $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); - -add_functions($gr, "$f for x in <$r[0],$r[2]>" . - " using color:blue and weight:1"); -$gr->stamps( closed_circle($r[0],0,'blue') ); -$gr->stamps( open_circle($r[2],0,'blue') ); +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+[-,domain=$r[0]:$r[2],samples=50] {($a*x^3+$b*x^2+$c*x + $d)*$peak/$ch}; + \addplot[soliddot] coordinates {($r[0],0)}; + \addplot[hollowdot] coordinates {($r[2],0)}; +\end{axis} +END_TIKZ $starty = $f->eval(x=>$r[0]); $endy = $f->eval(x=>$r[2]); @@ -107,9 +103,9 @@ A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< - [@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** +[@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** The function has domain [__________]{$domain} and range [__________]{$range}. diff --git a/Contrib/PCC/Math95/LinearEquations/LinearEquations3.pg b/Contrib/PCC/Math95/LinearEquations/LinearEquations3.pg index 41df236467..ab2ffa03b2 100644 --- a/Contrib/PCC/Math95/LinearEquations/LinearEquations3.pg +++ b/Contrib/PCC/Math95/LinearEquations/LinearEquations3.pg @@ -11,8 +11,8 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "contextFraction.pl" ); @@ -36,25 +36,24 @@ $xmax = max(6,$d+2); $ymin = -6; $ymax = 6; -$gr = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[240,240] -); -$gr->lb('reset'); -for my $i (floor($xmin/2)+1..-1,1..ceil($xmax/2)-1) { - $gr->lb( new Label(2*$i,0,2*$i,'black','center','top','large')); -} -for my $i ($ymin+1..-1,1..$ymax-1) { - $gr->lb( new Label(0,$i,$i,'black','right','middle','large')); -} -Context("Numeric"); ($start,$stop) = (num_sort($xmin,$xmax,($ymin-$bperl)/$mperl,($ymax-$bperl)/$mperl))[1,2]; -$gr->moveTo(0,$bperl); -$gr->arrowTo($start,$mperl*$start+$bperl,'blue',1); -$gr->moveTo(0,$bperl); -$gr->arrowTo($stop,$mperl*$stop+$bperl,'blue',1); +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + ] + \addplot+[domain=$start:$stop] {$mperl*x+$b}; +\end{axis} +END_TIKZ ############################################## @@ -67,16 +66,12 @@ BEGIN_TEXT Below is a line's graph. $PAR - -$BBLOCKQUOTE \{ image( insertGraph($gr), width=>240,height=>240,tex_size=>800 ) \} $PAR The slope of this line is \{ ans_rule(10) \}. -$EBLOCKQUOTE - END_TEXT Context()->normalStrings; diff --git a/Contrib/PCC/Math95/LinearEquations/LinearEquations4.pg b/Contrib/PCC/Math95/LinearEquations/LinearEquations4.pg index d270f1c7e1..5cdf3aa5d1 100644 --- a/Contrib/PCC/Math95/LinearEquations/LinearEquations4.pg +++ b/Contrib/PCC/Math95/LinearEquations/LinearEquations4.pg @@ -11,8 +11,8 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - - "PGgraphmacros.pl", + "PGtikz.pl", + "ORCCA.pl", "contextFraction.pl" ); @@ -36,27 +36,24 @@ $xmax = max(6,$d+2); $ymin = -6; $ymax = 6; -$gr = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[240,240] -); -$gr->lb('reset'); -for my $i (floor($xmin/2)+1..-1,1..ceil($xmax/2)-1) { - $gr->lb( new Label(2*$i,0,2*$i,'black','center','top','large')); -} -for my $i ($ymin+1..-1,1..$ymax-1) { - $gr->lb( new Label(0,$i,$i,'black','right','middle','large')); -} - -Context("Numeric"); -$h = non_zero_random(-3,3,1); -($start,$stop) = (num_sort($xmin,$xmax,($ymin-$bperl)/$mperl+$h,($ymax-$bperl)/$mperl+$h))[1,2]; -$gr->moveTo($h,$bperl); -$gr->arrowTo($start,$mperl*($start-$h)+$bperl,'blue',1); -$gr->moveTo($h,$bperl); -$gr->arrowTo($stop,$mperl*($stop-$h)+$bperl,'blue',1); - +($start,$stop) = (num_sort($xmin,$xmax,($ymin-$bperl)/$mperl,($ymax-$bperl)/$mperl))[1,2]; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + ] + \addplot+[domain=$start:$stop] {$mperl*x+$b}; +\end{axis} +END_TIKZ ############################################## diff --git a/Contrib/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg b/Contrib/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg index 4437f0a316..013bc6bd0d 100644 --- a/Contrib/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg +++ b/Contrib/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg @@ -32,10 +32,11 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "PGgraphmacros.pl", "PGML.pl", "PCCmacros.pl", "PCCgraphMacros.pl", + "PGtikz.pl", + "ORCCA.pl", "PGcourse.pl", ); @@ -69,32 +70,23 @@ $ymin = -5; $ymax = 5; -$gr = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[240,240] -); - - $gr->lb('reset'); - for my $j ($xmin+1..$xmax-1) { - if (abs($j)<10**(-10) or $j%2 != 0) {next;} - $gr->lb( new Label($j, 0, $j,'black','center','top','large')); - } - - for my $j ($ymin+1..$ymax-1) { - if (abs($j)<10**(-10) or $j%2 != 0) {next;} - $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); - } - - $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); - $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); - - -add_functions($gr, "$f for x in <$left,$right>" . - " using color:blue and weight:1"); -$gr->stamps( closed_circle($left,$f->eval(x=>$left),'blue') ); -$gr->moveTo($right-0.2,sqrt($right-0.2)); -$gr->arrowTo($right,sqrt($right),'blue',1); +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+[-{Kite},domain=$left:$right,smooth] {$f}; + \addplot[soliddot] coordinates {(0,0)}; +\end{axis} +END_TIKZ $starty = $f->eval(x=>$left); $endy = $f->eval(x=>$right); @@ -111,9 +103,9 @@ A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< - [@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** +[@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** The function has domain [__________]{$domain} and range [__________]{$range}. diff --git a/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg b/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg index a28a8e622b..e363c5dde1 100644 --- a/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg +++ b/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg @@ -60,7 +60,7 @@ BEGIN_PGML Simplify the expression. Do not assume the variables take only positive values. -[@KeyboardInstructions('To enter [`\sqrt{x}`], type [|sqrt(x)|]*. To enter [`|x|`], type [||x||]* or [|abs(x)|]*.@]** +[@KeyboardInstructions('To enter [`\sqrt{x}`], type [|sqrt(x)|]*. To enter [`|x|`], type [||x||]* or [|abs(x)|]*.')@]** >>[``[$display]``]<< diff --git a/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg b/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg index bdf8b17e79..7d17655eb3 100644 --- a/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg +++ b/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg @@ -53,7 +53,7 @@ BEGIN_PGML Use rational exponents to write the expression. -[@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.@]** +[@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.') @]** [``[$problem]``]=[_________________]{$ans} diff --git a/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg b/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg index 220b816680..3789a5de0d 100644 --- a/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg +++ b/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg @@ -59,7 +59,7 @@ BEGIN_PGML Use rational exponents to write the expression. -[@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.@]** +[@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.')@]** [``[$problem]=``][_________________]{$ans} diff --git a/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg b/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg index 2c6db63e98..dd73389936 100644 --- a/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg +++ b/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg @@ -40,7 +40,8 @@ Context()->operators->set( '//' => {class => 'bizarro::BOP::divide', isCommand => 1}, ); $var = list_random('x','y','z','t','r','m','n','a','b','c'); -Context()->variables->are($var=>'Real',limits=>[0,1]); +Context()->variables->are($var=>'Real'); +Context()->variables->set($var=>{limits=>[0,1]}); Context()->flags->set(reduceConstants=>0); $n = random(3,11,2); @@ -50,7 +51,6 @@ $n = random(3,11,2); Context()->functions->undefine('sqrt','abs'); - $ans = Formula("$var^(2/$n)"); $evaluator = $ans->cmp( diff --git a/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg b/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg index 4cb443b2d0..be03f4d96a 100644 --- a/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg +++ b/Contrib/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg @@ -59,7 +59,7 @@ BEGIN_PGML Simplify the expression. -[@KeyboardInstructions('To enter [`\sqrt{x}`], type [|sqrt(x)|]*. To enter [`|x|`], type [||x||]* or [|abs(x)|]*.@]** +[@KeyboardInstructions('To enter [`\sqrt{x}`], type [|sqrt(x)|]*. To enter [`|x|`], type [||x||]* or [|abs(x)|]*.')@]** >>[``[$display]``]<< diff --git a/Contrib/PCC/Math95/SimplifyRadicals/SimplifyRadicals24.pg b/Contrib/PCC/Math95/SimplifyRadicals/SimplifyRadicals24.pg index 9878789f89..327ad66d5c 100644 --- a/Contrib/PCC/Math95/SimplifyRadicals/SimplifyRadicals24.pg +++ b/Contrib/PCC/Math95/SimplifyRadicals/SimplifyRadicals24.pg @@ -19,7 +19,7 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "contextLimitedRadical.pl", + "contextForm.pl", "PGML.pl", "PCCmacros.pl", "PGcourse.pl", @@ -41,14 +41,18 @@ $e = $c**2-$b; $expression = "\dfrac{$a}{\sqrt{$b}+$c}"; $stringans = "($d-$a sqrt($b))/$e"; +if ($e == 1) {$stringans = "$d-$a sqrt($b)";}; +if ($e == -1) {$stringans = "-$d+$a sqrt($b)";}; $G = gcd($a,$d); $D = $d/$G; $A = $a/$G; $factored = "$G($D-$A sqrt($b))/$e"; +if ($e == 1) {$factored = "$G($D-$A sqrt($b))";}; +if ($e == -1) {$factored = "$G(-$D+$A sqrt($b))";}; -Context("LimitedRadical"); +Context("Form"); $ans = Formula("$stringans"); -if ($G != 1) {$ans = OneOf(Formula("$stringans"),Formula("$factored"));}; +#if ($G != 1) {$ans = OneOf(Formula("$stringans"),Formula("$factored"));}; ############################################## diff --git a/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg b/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg index 67c35455bd..3a72b55ead 100644 --- a/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg +++ b/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg @@ -47,6 +47,7 @@ $right = Formula("$b")->reduce; $r[0] = Fraction("$b**3+$a","1"); Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); $ans = Formula("{$r[0]}"); diff --git a/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg b/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg index 0531cad9cf..919c123a9e 100644 --- a/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg +++ b/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg @@ -52,6 +52,7 @@ $h2 = sqrt($a*$r[0]+$b); #helper variable 2 Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); $ans = Formula("{$r[0]}"); diff --git a/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg b/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg index aec6b9dce2..6260bce4ba 100644 --- a/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg +++ b/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg @@ -54,6 +54,7 @@ $h3 = sqrt($r[0]); # helper variable for checking solution $h4 = sqrt($h2); # helper variable for checking solution Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); $ans = Formula("{$r[0]}"); diff --git a/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg b/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg index b28a914a51..4e8cd05a2b 100644 --- a/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg +++ b/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg @@ -54,6 +54,7 @@ $h3 = sqrt($r[0]+$b); # helper variable for checking solution $h4 = sqrt($h2+$b); # helper variable for checking solution Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); $ans = Formula("{$r[0]}"); diff --git a/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg b/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg index 7f671cf649..78133298b0 100644 --- a/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg +++ b/Contrib/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg @@ -54,6 +54,7 @@ $h3 = sqrt($b-$r[0]); # helper variable for checking solution $h4 = sqrt($b-$h2); # helper variable for checking solution Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); $ans = Formula("{$r[0]}"); diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setAbsolute_Value.def b/Contrib/PCC/OldSetDefinitions/MTH060/setAbsolute_Value.def new file mode 100644 index 0000000000..d24431c409 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setAbsolute_Value.def @@ -0,0 +1,12 @@ + +openDate = 12/11/2013 at 12:12am PST +dueDate = 06/30/2014 at 01:06am PDT +answerDate = 06/30/2014 at 01:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AbsoluteValue.pg +description = basic absolute value calculations +problemList = +BasicAlgebra/NumberBasics/AbsoluteValue10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setAccount_Interest_Word_Problems.def b/Contrib/PCC/OldSetDefinitions/MTH060/setAccount_Interest_Word_Problems.def new file mode 100644 index 0000000000..567cc4e823 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setAccount_Interest_Word_Problems.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 01:28am PST +dueDate = 06/30/2014 at 02:38am PDT +answerDate = 06/30/2014 at 02:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AccountInterestWordProblems.pg +description = word problems involving accounts earning a net interest rate +problemList = +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setAdd_Subtract_Fractions.def b/Contrib/PCC/OldSetDefinitions/MTH060/setAdd_Subtract_Fractions.def new file mode 100644 index 0000000000..f21431ff96 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setAdd_Subtract_Fractions.def @@ -0,0 +1,42 @@ + +openDate = 12/11/2013 at 12:06am PST +dueDate = 06/30/2014 at 01:03am PDT +answerDate = 06/30/2014 at 01:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AddSubtractFractions.pg +description = adding and subtracting fractions +problemList = +BasicAlgebra/FractionArithmetic/AddFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions04.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions08.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions09.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions12.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions22.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions24.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions26.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions01.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions05.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions90.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions90.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions100.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def b/Contrib/PCC/OldSetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def new file mode 100644 index 0000000000..479a1ee2ac --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def @@ -0,0 +1,38 @@ + +openDate = 12/11/2013 at 12:42am PST +dueDate = 06/30/2014 at 01:44am PDT +answerDate = 06/30/2014 at 01:44am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicPercentageWordProblems.pg +description = percent and decimal conversion; percent calculations +problemList = +BasicAlgebra/NumberBasics/PercentDecimalConversion10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber110.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber120.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber90.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber100.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setBasic_Word_Problems.def b/Contrib/PCC/OldSetDefinitions/MTH060/setBasic_Word_Problems.def new file mode 100644 index 0000000000..2b1d8035de --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setBasic_Word_Problems.def @@ -0,0 +1,35 @@ + +openDate = 12/11/2013 at 12:36am PST +dueDate = 06/30/2014 at 01:40am PDT +answerDate = 06/30/2014 at 01:40am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicWordProblems.pg +description = translating English to math equations; solving some basic word problems +problemList = +BasicAlgebra/EnglishToMath/EnglishToMathEquation10.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation20.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation30.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation40.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation50.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation60.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation70.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation80.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation90.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation100.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation110.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation120.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation130.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation140.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation150.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation160.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation170.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation180.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation30.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation40.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setCoordinate_System.def b/Contrib/PCC/OldSetDefinitions/MTH060/setCoordinate_System.def new file mode 100644 index 0000000000..72a8c5a5dd --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setCoordinate_System.def @@ -0,0 +1,14 @@ + +openDate = 12/11/2013 at 01:00am PST +dueDate = 06/30/2014 at 02:10am PDT +answerDate = 06/30/2014 at 02:10am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/CoordinateSystem.pg +description = the basics of the Cartesian coordinate system +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/Quadrant10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setDistance_Word_Problems.def b/Contrib/PCC/OldSetDefinitions/MTH060/setDistance_Word_Problems.def new file mode 100644 index 0000000000..28b4367034 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setDistance_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 01:26am PST +dueDate = 06/30/2014 at 02:37am PDT +answerDate = 06/30/2014 at 02:37am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/DistanceWordProblems.pg +description = word problems involving distance traveled +problemList = +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setEvaluating_Expressions.def b/Contrib/PCC/OldSetDefinitions/MTH060/setEvaluating_Expressions.def new file mode 100644 index 0000000000..4dcf1a4cda --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setEvaluating_Expressions.def @@ -0,0 +1,27 @@ + +openDate = 12/11/2013 at 12:02am PST +dueDate = 06/30/2014 at 01:01am PDT +answerDate = 06/30/2014 at 01:01am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/EvaluatingExpressions.pg +description = evaluating symbols in mathematical expressions +problemList = +BasicAlgebra/EvaluateExpressions/evaluate10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate12.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate15.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate18.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate20.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate50.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate60.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate80.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate90.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar0.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar5.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluateInContext10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluateInContext20.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/FahrenheitCelsius10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula40.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setExponent_Basics.def b/Contrib/PCC/OldSetDefinitions/MTH060/setExponent_Basics.def new file mode 100644 index 0000000000..1451106031 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setExponent_Basics.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 12:18am PST +dueDate = 06/30/2014 at 01:14am PDT +answerDate = 06/30/2014 at 01:14am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentBasics.pg +description = the basics of exponents +problemList = +BasicAlgebra/Exponents/ExponentDefinition10.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition20.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setExponent_Rules.def b/Contrib/PCC/OldSetDefinitions/MTH060/setExponent_Rules.def new file mode 100644 index 0000000000..10b72c3844 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setExponent_Rules.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:20am PST +dueDate = 06/30/2014 at 01:16am PDT +answerDate = 06/30/2014 at 01:16am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentRules.pg +description = the rules of working with exponents +problemList = +BasicAlgebra/Exponents/exponentsMultiplication10.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication09.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication0.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication15.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication20.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication23.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication24.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Graph.def b/Contrib/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Graph.def new file mode 100644 index 0000000000..8e8987a989 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Graph.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 01:12am PST +dueDate = 06/30/2014 at 02:22am PDT +answerDate = 06/30/2014 at 02:22am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByGraph.pg +description = using a grpah to identify the equation of a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def b/Contrib/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def new file mode 100644 index 0000000000..a17e032d8a --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 01:14am PST +dueDate = 06/30/2014 at 02:24am PDT +answerDate = 06/30/2014 at 02:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByPointSlope.pg +description = use information about a point and slope to find an equation of a line +problemList = +BasicAlgebra/PointSlopeForm/PointSlopeBasics10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeBasics20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeBasics30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept40.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation40.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation50.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Two_Points.def b/Contrib/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Two_Points.def new file mode 100644 index 0000000000..d706a91dc2 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Two_Points.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 01:16am PST +dueDate = 06/30/2014 at 02:26am PDT +answerDate = 06/30/2014 at 02:26am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByTwoPoints.pg +description = use information about two points to find an equation for a line +problemList = +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation35.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setFunctions_Intro.def b/Contrib/PCC/OldSetDefinitions/MTH060/setFunctions_Intro.def new file mode 100644 index 0000000000..15afffba4f --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setFunctions_Intro.def @@ -0,0 +1,28 @@ +openDate = 12/11/2013 at 01:24am PST +dueDate = 06/30/2014 at 02:36am PDT +answerDate = 06/30/2014 at 02:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FunctionsIntro.pg +description = an introduction to functions +problemList = +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setGraph_Lines_by_Table.def b/Contrib/PCC/OldSetDefinitions/MTH060/setGraph_Lines_by_Table.def new file mode 100644 index 0000000000..cec8e9661b --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setGraph_Lines_by_Table.def @@ -0,0 +1,29 @@ + +openDate = 12/11/2013 at 01:02am PST +dueDate = 06/30/2014 at 02:12am PDT +answerDate = 06/30/2014 at 02:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphLineByTable.pg +description = graphing lines by making a table of values; checking if a point is on a line +problemList = +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable20.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine110.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot30.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot150.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def b/Contrib/PCC/OldSetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def new file mode 100644 index 0000000000..45c26f1206 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def @@ -0,0 +1,26 @@ + +openDate = 12/11/2013 at 01:22am PST +dueDate = 06/30/2014 at 02:34am PDT +answerDate = 06/30/2014 at 02:34am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphTwoVariableInequalities.pg +description = inequalities in two variables +problemList = +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot70.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot90.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setGraphing_Line_Summary.def b/Contrib/PCC/OldSetDefinitions/MTH060/setGraphing_Line_Summary.def new file mode 100644 index 0000000000..540c4ec403 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setGraphing_Line_Summary.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 01:10am PST +dueDate = 06/30/2014 at 02:20am PDT +answerDate = 06/30/2014 at 02:20am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphingLineSummary.pg +description = a summary of techniques that can be used to graph a line from its equation +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setInequality_Applications.def b/Contrib/PCC/OldSetDefinitions/MTH060/setInequality_Applications.def new file mode 100644 index 0000000000..eee2160463 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setInequality_Applications.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 12:58am PST +dueDate = 06/30/2014 at 01:52am PDT +answerDate = 06/30/2014 at 01:52am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/InequalityApplications.pg +description = applications of inequalities +problemList = +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setInteger_Operations.def b/Contrib/PCC/OldSetDefinitions/MTH060/setInteger_Operations.def new file mode 100644 index 0000000000..2ec3e34279 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setInteger_Operations.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 12:16am PST +dueDate = 06/30/2014 at 01:08am PDT +answerDate = 06/30/2014 at 01:08am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/IntegerOperations.pg +description = multiplying, dividing, adding, and subtracting with both positive and negative integers +problemList = +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/SignedNumberInterpretations10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setLinear_Equation_Applications.def b/Contrib/PCC/OldSetDefinitions/MTH060/setLinear_Equation_Applications.def new file mode 100644 index 0000000000..b378ac9e07 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setLinear_Equation_Applications.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 01:18am PST +dueDate = 06/30/2014 at 02:30am PDT +answerDate = 06/30/2014 at 02:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/LinearEquationApplications.pg +description = applications of finding equations of lines +problemList = +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication80.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def b/Contrib/PCC/OldSetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def new file mode 100644 index 0000000000..e928bef3ed --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 12:04am PST +dueDate = 06/30/2014 at 01:02am PDT +answerDate = 06/30/2014 at 01:02am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixedNumbersEquivalentFractions.pg +description = translating between mixed numbers and improper fractions; reducing fractions +problemList = +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction05.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction30.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setMixture_Word_Problems.def b/Contrib/PCC/OldSetDefinitions/MTH060/setMixture_Word_Problems.def new file mode 100644 index 0000000000..dbda55cc4f --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setMixture_Word_Problems.def @@ -0,0 +1,19 @@ + +openDate = 12/11/2013 at 01:30am PST +dueDate = 06/30/2014 at 02:39am PDT +answerDate = 06/30/2014 at 02:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixtureWordProblems.pg +description = word problems involving mixtures of solutions or populations +problemList = +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setMultiply_Divide_Fractions.def b/Contrib/PCC/OldSetDefinitions/MTH060/setMultiply_Divide_Fractions.def new file mode 100644 index 0000000000..984edc6dbb --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setMultiply_Divide_Fractions.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:08am PST +dueDate = 06/30/2014 at 01:04am PDT +answerDate = 06/30/2014 at 01:04am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MultiplyDivideFractions.pg +description = multiplying and dividing with fractions +problemList = +BasicAlgebra/FractionArithmetic/MultiplyFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setNumber_Sets.def b/Contrib/PCC/OldSetDefinitions/MTH060/setNumber_Sets.def new file mode 100644 index 0000000000..076f2c2bec --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setNumber_Sets.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 12:10am PST +dueDate = 06/30/2014 at 01:05am PDT +answerDate = 06/30/2014 at 01:05am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/NumberSets.pg +description = identifying types of numbers; using number lines +problemList = +BasicAlgebra/NumberBasics/TypesOfNumbers10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setOrder_of_Operations.def b/Contrib/PCC/OldSetDefinitions/MTH060/setOrder_of_Operations.def new file mode 100644 index 0000000000..e4ac385610 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setOrder_of_Operations.def @@ -0,0 +1,39 @@ + +openDate = 12/11/2013 at 12:22am PST +dueDate = 06/30/2014 at 01:18am PDT +answerDate = 06/30/2014 at 01:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/OrderOfOperations.pg +description = using the order of operations +problemList = +BasicAlgebra/OrderOfOperations/orderOfOperations10.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations20.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations30.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations40.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations50.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations60.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations70.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations80.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations90.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations100.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations110.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations120.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations140.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations130.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations150.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations160.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations170.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations180.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations190.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations230.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations200.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations210.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations220.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations240.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations250.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/OOOFractions10.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations260.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations270.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations280.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations290.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setParallel_Perpendicular_Lines.def b/Contrib/PCC/OldSetDefinitions/MTH060/setParallel_Perpendicular_Lines.def new file mode 100644 index 0000000000..6716f9f757 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setParallel_Perpendicular_Lines.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 01:20am PST +dueDate = 06/30/2014 at 02:32am PDT +answerDate = 06/30/2014 at 02:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ParallelPerpendicularLines.pg +description = questions regarding parallel or perpendicular pairs of lines and their slopes +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular90.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular100.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular110.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular120.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular130.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular140.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular150.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular160.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular170.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular180.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular190.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular200.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular210.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setPercent_of_Increase_Decrease.def b/Contrib/PCC/OldSetDefinitions/MTH060/setPercent_of_Increase_Decrease.def new file mode 100644 index 0000000000..1ea63d363f --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setPercent_of_Increase_Decrease.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 12:44am PST +dueDate = 06/30/2014 at 01:45am PDT +answerDate = 06/30/2014 at 01:45am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/PercentOfIncreaseDecrease.pg +description = calculating the percent increase or decrease of a change +problemList = +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setPerimeter_and_Area.def b/Contrib/PCC/OldSetDefinitions/MTH060/setPerimeter_and_Area.def new file mode 100644 index 0000000000..e2233ccacf --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setPerimeter_and_Area.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:46am PST +dueDate = 06/30/2014 at 01:46am PDT +answerDate = 06/30/2014 at 01:46am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/PerimeterArea.pg +description = questions about the areas and perimeters of basic two-dimensional shapes +problemList = +BasicAlgebra/Geometry/RectanglePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea40.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea40.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea50.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setProportion_Word_Problems.def b/Contrib/PCC/OldSetDefinitions/MTH060/setProportion_Word_Problems.def new file mode 100644 index 0000000000..7082c491b0 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setProportion_Word_Problems.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 12:52am PST +dueDate = 06/30/2014 at 01:49am PDT +answerDate = 06/30/2014 at 01:49am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ProportionWordProblems.pg +description = word problems that involve a proportional equation +problemList = +BasicAlgebra/LinearEquationApplications/ProportionWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem90.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem100.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem110.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem120.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def b/Contrib/PCC/OldSetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def new file mode 100644 index 0000000000..6e10a82e6e --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 12:40am PST +dueDate = 06/30/2014 at 01:43am PDT +answerDate = 06/30/2014 at 01:43am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/RateAndStartValueWordProblem.pg +description = word problems involving an initial value that cahnges with a fixed rate +problemList = +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSimplify_Expressions.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSimplify_Expressions.def new file mode 100644 index 0000000000..8cee679e94 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSimplify_Expressions.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 12:14am PST +dueDate = 06/30/2014 at 01:07am PDT +answerDate = 06/30/2014 at 01:07am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SimplifyExpressions.pg +description = simplifying expressions +problemList = +BasicAlgebra/PolynomialBasics/SimplifyExpression10.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression30.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty10.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty20.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty30.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty40.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty50.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty60.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty70.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty80.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty90.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/SimplifyInContext10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSlope.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSlope.def new file mode 100644 index 0000000000..5af94ddb27 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSlope.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 01:04am PST +dueDate = 06/30/2014 at 02:14am PDT +answerDate = 06/30/2014 at 02:14am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Slope.pg +description = using a graph to compute slope; using the slope formula to compute slope +problemList = +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSlope_Intercept_Equations.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSlope_Intercept_Equations.def new file mode 100644 index 0000000000..03f0a00beb --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSlope_Intercept_Equations.def @@ -0,0 +1,27 @@ + +openDate = 12/11/2013 at 01:06am PST +dueDate = 06/30/2014 at 02:16am PDT +answerDate = 06/30/2014 at 02:16am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SlopeInterceptEquation.pg +description = find the slope and y-intercept of a line; use the point-slope form to garph a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept90.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Equations_with_Fractions.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Equations_with_Fractions.def new file mode 100644 index 0000000000..dc490db970 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Equations_with_Fractions.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 12:32am PST +dueDate = 06/30/2014 at 01:36am PDT +answerDate = 06/30/2014 at 01:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveEquationsWithFractions.pg +description = solving linear equations that involve fractions +problemList = +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction05.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction290.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction300.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction310.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction210.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction220.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction240.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction260.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction270.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Inequalities.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Inequalities.def new file mode 100644 index 0000000000..296618b649 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Inequalities.def @@ -0,0 +1,45 @@ + +openDate = 12/11/2013 at 12:54am PST +dueDate = 06/30/2014 at 01:50am PDT +answerDate = 06/30/2014 at 01:50am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveInequalities.pg +description = set-builder and interval notation; solving linear inequalities +problemList = +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation110.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality150.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality180.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality200.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality220.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality260.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality280.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality320.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Multi_Step_Equations.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Multi_Step_Equations.def new file mode 100644 index 0000000000..c8d08d623e --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Multi_Step_Equations.def @@ -0,0 +1,35 @@ + +openDate = 12/11/2013 at 12:28am PST +dueDate = 06/30/2014 at 01:32am PDT +answerDate = 06/30/2014 at 01:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveMultiStepEquations.pg +description = solving linear equations that may require multiple steps +problemList = +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses200.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_One_Step_Equations.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_One_Step_Equations.def new file mode 100644 index 0000000000..054ba50db2 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_One_Step_Equations.def @@ -0,0 +1,52 @@ + +openDate = 12/11/2013 at 12:24am PST +dueDate = 06/30/2014 at 01:26am PDT +answerDate = 06/30/2014 at 01:26am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveOneStepEquation.pg +description = solving equations that only require one step to solve +problemList = +BasicAlgebra/VerifySolutionsOneVariable/solutionQ10.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ20.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ30.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ40.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ50.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ60.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ70.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv190.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Proportions.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Proportions.def new file mode 100644 index 0000000000..e10430de0d --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Proportions.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:50am PST +dueDate = 06/30/2014 at 01:48am PDT +answerDate = 06/30/2014 at 01:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveProportions.pg +description = solving proporiton equations +problemList = +BasicAlgebra/SolveLinearEquations/SolveProportion10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Two-Step_Equations.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Two-Step_Equations.def new file mode 100644 index 0000000000..d261d00360 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_Two-Step_Equations.def @@ -0,0 +1,19 @@ + +openDate = 12/11/2013 at 12:26am PST +dueDate = 06/30/2014 at 01:30am PDT +answerDate = 06/30/2014 at 01:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveTwoStepEquations.pg +description = solving equations that require two steps to solve +problemList = +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps130.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_for_Variable.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_for_Variable.def new file mode 100644 index 0000000000..eccdea6c6b --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSolve_for_Variable.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 12:34am PST +dueDate = 06/30/2014 at 01:38am PDT +answerDate = 06/30/2014 at 01:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveForVariable.pg +description = symbolically solving a linear equation to isolate a variable +problemList = +BasicAlgebra/SolveLinearEquations/LiteralEquation10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation190.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation210.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSpecial_Case_Inequalities.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSpecial_Case_Inequalities.def new file mode 100644 index 0000000000..75f08f8146 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSpecial_Case_Inequalities.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:56am PST +dueDate = 06/30/2014 at 01:51am PDT +answerDate = 06/30/2014 at 01:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialCaseInequalities.pg +description = linear inequalities that may have something special about them +problemList = +BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSpecial_Solutions.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSpecial_Solutions.def new file mode 100644 index 0000000000..0ed77f524d --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSpecial_Solutions.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:30am PST +dueDate = 06/30/2014 at 01:34am PDT +answerDate = 06/30/2014 at 01:34am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialSolutions.pg +description = linear equations that may have something special about them +problemList = +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation70.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setStandard_Form_Equations.def b/Contrib/PCC/OldSetDefinitions/MTH060/setStandard_Form_Equations.def new file mode 100644 index 0000000000..de8c027e91 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setStandard_Form_Equations.def @@ -0,0 +1,47 @@ + +openDate = 12/11/2013 at 01:08am PST +dueDate = 06/30/2014 at 02:18am PDT +answerDate = 06/30/2014 at 02:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/StandardFormEquations.pg +description = find the slope and y-intercept of a line; find a line's x- and y-intercepts; use intercepts to graph a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept110.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept120.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept130.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept140.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept150.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept160.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept170.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept180.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept190.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept200.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts150.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts130.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setSum_and_Part_Word_Problems.def b/Contrib/PCC/OldSetDefinitions/MTH060/setSum_and_Part_Word_Problems.def new file mode 100644 index 0000000000..b8d9aae6bc --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setSum_and_Part_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 12:38am PST +dueDate = 06/30/2014 at 01:42am PDT +answerDate = 06/30/2014 at 01:42am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SumAndPartWordProblems.pg +description = solving word problems involving two numbers that combine in some way +problemList = +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setTranslating_Words_into_Algebra.def b/Contrib/PCC/OldSetDefinitions/MTH060/setTranslating_Words_into_Algebra.def new file mode 100644 index 0000000000..1dc609ee0c --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setTranslating_Words_into_Algebra.def @@ -0,0 +1,31 @@ +openDate = 12/11/2013 at 12:00am PST +dueDate = 06/30/2014 at 01:00am PDT +answerDate = 06/30/2014 at 01:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/TranslatingWordsIntoAlgebra.pg +description = translating English into algebra +problemList = +BasicAlgebra/EnglishToMath/englishToMath10.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath20.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath25.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath30.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath40.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath45.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath50.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath55.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath60.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath70.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath140.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath150.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath160.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath170.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath80.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath82.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath84.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath90.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath100.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath110.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath120.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath130.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath180.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setTrigonometry.def b/Contrib/PCC/OldSetDefinitions/MTH060/setTrigonometry.def new file mode 100644 index 0000000000..ded9435294 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setTrigonometry.def @@ -0,0 +1,13 @@ +openDate = 12/11/2013 at 12:48am PST +dueDate = 06/30/2014 at 02:38am PDT +answerDate = 06/30/2014 at 02:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Trigonometry.pg +description = questions about the definition of trigonometry ratios (sine, cosine and tangent) +problemList = +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg, 1, -1, 0 diff --git a/Contrib/PCC/OldSetDefinitions/MTH060/setVolume.def b/Contrib/PCC/OldSetDefinitions/MTH060/setVolume.def new file mode 100644 index 0000000000..a35af66f6f --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH060/setVolume.def @@ -0,0 +1,16 @@ + +openDate = 12/11/2013 at 12:48am PST +dueDate = 06/30/2014 at 01:47am PDT +answerDate = 06/30/2014 at 01:47am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Volume.pg +description = questions about the volumes of prisms and cylinders +problemList = +BasicAlgebra/Geometry/RectangularPrismVolume10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectangularPrismVolume20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectangularPrismVolume30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume10.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume20.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setAdd_Subtract_Polynomials.def b/Contrib/PCC/OldSetDefinitions/MTH065/setAdd_Subtract_Polynomials.def new file mode 100644 index 0000000000..445d55a7e0 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setAdd_Subtract_Polynomials.def @@ -0,0 +1,26 @@ + +openDate = 12/11/2013 at 02:44am PST +dueDate = 06/30/2014 at 03:21am PDT +answerDate = 06/30/2014 at 03:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/AddSubtractPolynomials.pg +description = adding and subtracting polynomial expressions +problemList = +BasicAlgebra/PolynomialBasics/PolyAddSubtract0.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract5.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract10.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract15.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression30.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract25.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract35.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract85.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract90.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract95.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract100.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar25.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setDivide_Polynomials.def b/Contrib/PCC/OldSetDefinitions/MTH065/setDivide_Polynomials.def new file mode 100644 index 0000000000..11c2f3a665 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setDivide_Polynomials.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 02:48am PST +dueDate = 06/30/2014 at 03:30am PDT +answerDate = 06/30/2014 at 03:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/DividePolynomials.pg +description = division of polynomials by a monomial +problemList = +BasicAlgebra/Exponents/exponentDivision105.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision100.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision125.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision120.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision130.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision135.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision140.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision150.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setExponent_Review.def b/Contrib/PCC/OldSetDefinitions/MTH065/setExponent_Review.def new file mode 100644 index 0000000000..93c938dfcd --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setExponent_Review.def @@ -0,0 +1,31 @@ +openDate = 12/11/2013 at 02:42am PST +dueDate = 06/30/2014 at 03:15am PDT +answerDate = 06/30/2014 at 03:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ExponentReview.pg +description = rules of working with exponents +problemList = +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication20.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication50.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision75.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision70.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision60.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision105.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision100.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision50.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision80.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision10.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision0.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision15.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication35.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_Special_Polynomials.def b/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_Special_Polynomials.def new file mode 100644 index 0000000000..18ace46835 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_Special_Polynomials.def @@ -0,0 +1,33 @@ + +openDate = 12/11/2013 at 03:02am PST +dueDate = 06/30/2014 at 03:45am PDT +answerDate = 06/30/2014 at 03:45am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorSpecialPolynomials.pg +description = factoring special polynomials where a special form can be applied +problemList = +BasicAlgebra/Factoring/factoring445.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring450.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring455.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring460.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring465.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring470.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring475.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring480.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring485.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring490.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring495.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring500.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring505.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring520.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring525.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring530.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring535.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring540.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring555.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring560.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring590.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring595.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring600.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring615.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def b/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def new file mode 100644 index 0000000000..a00b17d07f --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def @@ -0,0 +1,29 @@ +openDate = 12/11/2013 at 02:58am PST +dueDate = 06/30/2014 at 03:39am PDT +answerDate = 06/30/2014 at 03:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialWhenAIs1.pg +description = factoring trinomials with a leading coefficient of 1 +problemList = +BasicAlgebra/Factoring/factoring170.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring175.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring180.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring170.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring175.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring180.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring355.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring360.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring365.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring370.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring360.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring365.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring370.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring375.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring385.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring390.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring400.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring405.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring410.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring415.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring420.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def b/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def new file mode 100644 index 0000000000..6a96d03b04 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:00am PST +dueDate = 06/30/2014 at 03:42am PDT +answerDate = 06/30/2014 at 03:42am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialsWhenAIsNot1.pg +description = factoring trinomials whose leading coefficient is not 1 +problemList = +BasicAlgebra/Factoring/factoring185.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring190.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring195.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring200.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring205.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring210.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring235.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring240.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring245.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring280.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring285.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring295.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring325.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_by_Grouping.def b/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_by_Grouping.def new file mode 100644 index 0000000000..a5d05392d2 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_by_Grouping.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 02:56am PST +dueDate = 06/30/2014 at 03:36am PDT +answerDate = 06/30/2014 at 03:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorByGrouping.pg +description = factoring polynomials using the grouping technique +problemList = +BasicAlgebra/Factoring/factoring105.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring110.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring115.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring120.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring125.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring130.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring135.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring140.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring150.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring120.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring125.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring135.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring140.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring150.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_out_Common_Factors.def b/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_out_Common_Factors.def new file mode 100644 index 0000000000..adcd221338 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setFactor_out_Common_Factors.def @@ -0,0 +1,28 @@ + +openDate = 12/11/2013 at 02:54am PST +dueDate = 06/30/2014 at 03:33am PDT +answerDate = 06/30/2014 at 03:33am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorOutCommonFactors.pg +description = factoring out the greatest common factor +problemList = +BasicAlgebra/Factoring/factoring5.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring10.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring15.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring20.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring25.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring30.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring36.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring37.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring38.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring41.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring56.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring71.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring76.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring77.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring80.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring85.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring90.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring95.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring100.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setFalling_Object_Applications.def b/Contrib/PCC/OldSetDefinitions/MTH065/setFalling_Object_Applications.def new file mode 100644 index 0000000000..5136393b3d --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setFalling_Object_Applications.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:36am PST +dueDate = 06/30/2014 at 04:36am PDT +answerDate = 06/30/2014 at 04:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FallingObjectApplications.pg +description = applications of quadratic expressions to falling objects +problemList = +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setFunctions.def b/Contrib/PCC/OldSetDefinitions/MTH065/setFunctions.def new file mode 100644 index 0000000000..4c3b2a8714 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setFunctions.def @@ -0,0 +1,29 @@ + +openDate = 12/11/2013 at 03:38am PST +dueDate = 06/30/2014 at 04:37am PDT +answerDate = 06/30/2014 at 04:37am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/Functions.pg +description = introduction to functions +problemList = +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setIntroduction_to_Square_Root.def b/Contrib/PCC/OldSetDefinitions/MTH065/setIntroduction_to_Square_Root.def new file mode 100644 index 0000000000..7f12438bf9 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setIntroduction_to_Square_Root.def @@ -0,0 +1,16 @@ + +openDate = 12/11/2013 at 03:04am PST +dueDate = 06/30/2014 at 03:48am PDT +answerDate = 06/30/2014 at 03:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/IntroductionToSquareRoot.pg +description = evaluating square roots +problemList = +BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setMaximum_Minimum_Applications.def b/Contrib/PCC/OldSetDefinitions/MTH065/setMaximum_Minimum_Applications.def new file mode 100644 index 0000000000..cb7a7aa3c0 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setMaximum_Minimum_Applications.def @@ -0,0 +1,14 @@ + +openDate = 12/11/2013 at 03:34am PST +dueDate = 06/30/2014 at 04:33am PDT +answerDate = 06/30/2014 at 04:33am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MaximumMinimumApplications.pg +description = applications of quadratic expressions to finding a maximal or minimal value +problemList = +BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setMoving_Parabola_Up_Down.def b/Contrib/PCC/OldSetDefinitions/MTH065/setMoving_Parabola_Up_Down.def new file mode 100644 index 0000000000..bf99a3b23e --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setMoving_Parabola_Up_Down.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 03:20am PST +dueDate = 06/30/2014 at 04:12am PDT +answerDate = 06/30/2014 at 04:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MovingParabolaUpDown.pg +description = shifting a parabola up and down +problemList = +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setMultiplying_Polynomials.def b/Contrib/PCC/OldSetDefinitions/MTH065/setMultiplying_Polynomials.def new file mode 100644 index 0000000000..2bbc293875 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setMultiplying_Polynomials.def @@ -0,0 +1,41 @@ + +openDate = 12/11/2013 at 02:46am PST +dueDate = 06/30/2014 at 03:24am PDT +answerDate = 06/30/2014 at 03:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MultiplyingPolynomials.pg +description = multiplication of polynomial expressions +problemList = +BasicAlgebra/PolynomialMultiplication/polyMultVar60.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication0.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication5.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication10.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication15.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication20.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication30.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication35.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication40.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication45.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication50.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication55.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication60.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication65.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication70.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication75.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication80.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication160.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication165.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication170.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication175.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication185.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication190.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication195.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication200.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication205.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication210.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication225.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar100.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar135.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar160.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setNegative_Exponents.def b/Contrib/PCC/OldSetDefinitions/MTH065/setNegative_Exponents.def new file mode 100644 index 0000000000..637b215a32 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setNegative_Exponents.def @@ -0,0 +1,32 @@ + +openDate = 12/11/2013 at 02:50am PST +dueDate = 06/30/2014 at 03:31am PDT +answerDate = 06/30/2014 at 03:31am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/NegativeExponents.pg +description = practice working with negative exponents +problemList = +BasicAlgebra/Exponents/negExp75.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp90.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp60.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp85.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp65.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp70.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp10.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp45.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp50.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp20.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp25.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp5.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp0.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp55.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp41.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp100.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp105.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp110.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp115.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp120.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp135.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp150.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp155.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Axis_and_Vertex.def b/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Axis_and_Vertex.def new file mode 100644 index 0000000000..53c889ea00 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Axis_and_Vertex.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 03:28am PST +dueDate = 06/30/2014 at 04:24am PDT +answerDate = 06/30/2014 at 04:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaAxisAndVertex.pg +description = identifying the vertex and axis of symmetry of a parabola +problemList = +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Intercepts.def b/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Intercepts.def new file mode 100644 index 0000000000..0a96aa5d43 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Intercepts.def @@ -0,0 +1,33 @@ + +openDate = 12/11/2013 at 03:30am PST +dueDate = 06/30/2014 at 04:27am PDT +answerDate = 06/30/2014 at 04:27am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaIntercepts.pg +description = identifying the intercepts of a parabola +problemList = +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts115.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts150.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts170.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts180.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts190.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts210.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts220.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts230.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Movement_Summary.def b/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Movement_Summary.def new file mode 100644 index 0000000000..ce70d11632 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Movement_Summary.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 03:26am PST +dueDate = 06/30/2014 at 04:21am PDT +answerDate = 06/30/2014 at 04:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaMovementSummary.pg +description = summary of graph transformations to a parabola +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Shifting_Left_Right.def b/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Shifting_Left_Right.def new file mode 100644 index 0000000000..682473e4e0 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Shifting_Left_Right.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:24am PST +dueDate = 06/30/2014 at 04:18am PDT +answerDate = 06/30/2014 at 04:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaShiftingLeftRight.pg +description = shifting a parabola left or right +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Thinner_Wider.def b/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Thinner_Wider.def new file mode 100644 index 0000000000..d3d29c9400 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setParabola_Thinner_Wider.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:22am PST +dueDate = 06/30/2014 at 04:15am PDT +answerDate = 06/30/2014 at 04:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaThinnerWider.pg +description = stretching a parabola vertically to make it appear thinner +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setQuadratic_Equation_Applications.def b/Contrib/PCC/OldSetDefinitions/MTH065/setQuadratic_Equation_Applications.def new file mode 100644 index 0000000000..0f58ce13dc --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setQuadratic_Equation_Applications.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 03:18am PST +dueDate = 06/30/2014 at 04:09am PDT +answerDate = 06/30/2014 at 04:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/QuadraticEquationApplications.pg +description = applications of quadratic equations +problemList = +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setRationalize_Denominator.def b/Contrib/PCC/OldSetDefinitions/MTH065/setRationalize_Denominator.def new file mode 100644 index 0000000000..c005bd45ce --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setRationalize_Denominator.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:10am PST +dueDate = 06/30/2014 at 03:57am PDT +answerDate = 06/30/2014 at 03:57am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/RationalizeDenominator.pg +description = rationalizing the denominator of a radical expression +problemList = +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator110.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setReview_Graphing_Lines.def b/Contrib/PCC/OldSetDefinitions/MTH065/setReview_Graphing_Lines.def new file mode 100644 index 0000000000..aee0c2126d --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setReview_Graphing_Lines.def @@ -0,0 +1,22 @@ +openDate = 12/11/2013 at 02:32am PST +dueDate = 06/30/2014 at 03:00am PDT +answerDate = 06/30/2014 at 03:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ReviewGraphingLines.pg +description = review of graphing lines +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setScientific_Notation.def b/Contrib/PCC/OldSetDefinitions/MTH065/setScientific_Notation.def new file mode 100644 index 0000000000..bfbf62dabc --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setScientific_Notation.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 02:52am PST +dueDate = 06/30/2014 at 03:32am PDT +answerDate = 06/30/2014 at 03:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ScientificNotation.pg +description = practice using scientific notation +problemList = +BasicAlgebra/NumberBasics/ScientificNotation10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation90.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation100.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation110.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation120.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setSimplify_Square_Roots.def b/Contrib/PCC/OldSetDefinitions/MTH065/setSimplify_Square_Roots.def new file mode 100644 index 0000000000..74d5cfc36c --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setSimplify_Square_Roots.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 03:06am PST +dueDate = 06/30/2014 at 03:51am PDT +answerDate = 06/30/2014 at 03:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SimplifySquareRoots.pg +description = simplifying expressions with square roots +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setSketching_Parabolas.def b/Contrib/PCC/OldSetDefinitions/MTH065/setSketching_Parabolas.def new file mode 100644 index 0000000000..27bd59b81c --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setSketching_Parabolas.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 03:32am PST +dueDate = 06/30/2014 at 04:30am PDT +answerDate = 06/30/2014 at 04:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SketchingParabolas.pg +description = sketching the graph of a quadratic expression +problemList = +BasicAlgebra/GraphingQuadratics/SketchParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def new file mode 100644 index 0000000000..c1019c39e7 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def @@ -0,0 +1,34 @@ + +openDate = 12/11/2013 at 03:14am PST +dueDate = 06/30/2014 at 04:03am PDT +answerDate = 06/30/2014 at 04:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByFactoring.pg +description = solve a quadratic equation by factoring +problemList = +BasicAlgebra/QuadraticEquations/solveQuad95.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad230.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad220.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad235.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad240.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad250.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad255.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad265.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad210.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad215.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad270.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad280.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad285.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad290.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad295.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad105.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad200.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad300.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad305.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad325.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad330.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad335.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad340.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def new file mode 100644 index 0000000000..bfe9283033 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 03:16am PST +dueDate = 06/30/2014 at 04:06am PDT +answerDate = 06/30/2014 at 04:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByQuadraticFormula.pg +description = solve a quadratic equation using the quadratic formula +problemList = +BasicAlgebra/QuadraticEquations/solveQuad145.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad150.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad155.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad185.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad375.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad380.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad385.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def new file mode 100644 index 0000000000..4e04c67950 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:12am PST +dueDate = 06/30/2014 at 04:00am PDT +answerDate = 06/30/2014 at 04:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationBySquareRootProperty.pg +description = solve a quadratic equation by using the square root +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad35.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad40.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad45.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad50.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad55.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad65.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad70.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad75.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad80.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad85.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Elimination.def b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Elimination.def new file mode 100644 index 0000000000..d204b7d870 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Elimination.def @@ -0,0 +1,20 @@ +openDate = 12/11/2013 at 02:38am PST +dueDate = 06/30/2014 at 03:09am PDT +answerDate = 06/30/2014 at 03:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByElimination.pg +description = solve a systme of linear equations using the elimination (aka addition) method +problemList = +BasicAlgebra/SystemsOfLinearEquations/SystemEquation10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations55.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Graphing.def b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Graphing.def new file mode 100644 index 0000000000..af48e49847 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Graphing.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 02:34am PST +dueDate = 06/30/2014 at 03:03am PDT +answerDate = 06/30/2014 at 03:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByGraphing.pg +description = solve a system of linear equations by graphing the lines +problemList = +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem40.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Substitution.def b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Substitution.def new file mode 100644 index 0000000000..94f347423e --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Substitution.def @@ -0,0 +1,14 @@ +openDate = 12/11/2013 at 02:36am PST +dueDate = 06/30/2014 at 03:06am PDT +answerDate = 06/30/2014 at 03:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemBySubstitution.pg +description = solve a system of linear equations by isolating one variable and using substitution +problemList = +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations11.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations12.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations13.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations14.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations16.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations25.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations30.pg, 1, -1, 0 diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setSquare_Root_Operations.def b/Contrib/PCC/OldSetDefinitions/MTH065/setSquare_Root_Operations.def new file mode 100644 index 0000000000..4b4ff93965 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setSquare_Root_Operations.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 03:08am PST +dueDate = 06/30/2014 at 03:54am PDT +answerDate = 06/30/2014 at 03:54am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SquareRootOperations.pg +description = simplifying radical expressions +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical1.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setSystem_Equation_Applications.def b/Contrib/PCC/OldSetDefinitions/MTH065/setSystem_Equation_Applications.def new file mode 100644 index 0000000000..8e99e61a60 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setSystem_Equation_Applications.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 02:40am PST +dueDate = 06/30/2014 at 03:12am PDT +answerDate = 06/30/2014 at 03:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SystemEquationApplications.pg +description = applications of solving systems of linear equations +problemList = +BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord5.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication70.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication80.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication90.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication100.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH065/setTrigonometryRatios.def b/Contrib/PCC/OldSetDefinitions/MTH065/setTrigonometryRatios.def new file mode 100644 index 0000000000..27f4a3ce63 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH065/setTrigonometryRatios.def @@ -0,0 +1,92 @@ +assignmentType = default +openDate = 12/11/2013 at 03:10am PST +dueDate = 06/30/2014 at 03:58am PDT +answerDate = 06/30/2014 at 03:58am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeaders_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/TrigonometryRatios.pg +description = +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 2 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 3 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 4 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 5 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 6 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 7 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 8 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 9 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def b/Contrib/PCC/OldSetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def new file mode 100644 index 0000000000..38c093ce74 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def @@ -0,0 +1,24 @@ +openDate = 12/01/2015 at 12:26am PST +dueDate = 03/01/2016 at 12:26am PST +answerDate = 03/01/2016 at 12:26am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Add_Subtract_Rational_Expressions.pg +description = subtract rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions110.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions120.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions130.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions140.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions150.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setCalculator_Basics.def b/Contrib/PCC/OldSetDefinitions/MTH095/setCalculator_Basics.def new file mode 100644 index 0000000000..9fdb03ef6f --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setCalculator_Basics.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:00am PST +dueDate = 03/01/2016 at 12:00am PST +answerDate = 03/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Calculator_Basics.pg +description = learning the basics about using graphing calculators +problemList = +BasicAlgebra/Calculator/CalculatorBasics10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics20.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics30.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics40.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics50.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics60.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics70.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics80.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics90.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorIntersection10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorIntersection20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setComplex_Number_Operations.def b/Contrib/PCC/OldSetDefinitions/MTH095/setComplex_Number_Operations.def new file mode 100644 index 0000000000..340fac9eed --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setComplex_Number_Operations.def @@ -0,0 +1,23 @@ +openDate = 12/01/2015 at 12:44am PST +dueDate = 03/01/2016 at 12:44am PST +answerDate = 03/01/2016 at 12:44am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Complex_Number_Operations.pg +description = add, subtract, multiply complex numbers +problemList = +BasicAlgebra/ComplexNumber/complexNumberBasics10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberBasics20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberBasics30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations40.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations50.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations60.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations70.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations80.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setDivide_Rational_Expressions.def b/Contrib/PCC/OldSetDefinitions/MTH095/setDivide_Rational_Expressions.def new file mode 100644 index 0000000000..598d861b47 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setDivide_Rational_Expressions.def @@ -0,0 +1,17 @@ +openDate = 12/01/2015 at 12:22am PST +dueDate = 03/01/2016 at 12:22am PST +answerDate = 03/01/2016 at 12:22am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Divide_Rational_Expressions.pg +description = divide rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions25.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions45.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions60.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setFunction_Domain_Range.def b/Contrib/PCC/OldSetDefinitions/MTH095/setFunction_Domain_Range.def new file mode 100644 index 0000000000..aa4e0dd9e3 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setFunction_Domain_Range.def @@ -0,0 +1,31 @@ +openDate = 12/01/2015 at 12:04am PST +dueDate = 03/01/2016 at 12:04am PST +answerDate = 03/01/2016 at 12:04am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Domain_Range.pg +description = finding the domain and range functions +problemList = +FunctionBasics/Functions90.pg, 1, -1, 0 +FunctionBasics/Functions100.pg, 1, -1, 0 +FunctionBasics/Functions110.pg, 1, -1, 0 +FunctionBasics/Functions120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg, 1, -1, 0 +FunctionBasics/Functions170.pg, 1, -1, 0 +FunctionBasics/Functions180.pg, 1, -1, 0 +FunctionBasics/Functions200.pg, 1, -1, 0 +FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg, 1, -1, 0 +FunctionBasics/Functions225.pg, 1, -1, 0 +FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setFunction_Notation.def b/Contrib/PCC/OldSetDefinitions/MTH095/setFunction_Notation.def new file mode 100644 index 0000000000..b00d94b3b3 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setFunction_Notation.def @@ -0,0 +1,32 @@ +openDate = 12/01/2015 at 12:02am PST +dueDate = 03/01/2016 at 12:02am PST +answerDate = 03/01/2016 at 12:02am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Notation.pg +description = learning and applying function notation +problemList = +BasicAlgebra/FunctionBasics/FunctionInContext10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction85.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition65.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition65.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition66.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition66.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools20.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorTable10.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setMultiply_Rational_Expressions.def b/Contrib/PCC/OldSetDefinitions/MTH095/setMultiply_Rational_Expressions.def new file mode 100644 index 0000000000..7236470059 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setMultiply_Rational_Expressions.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:20am PST +dueDate = 03/01/2016 at 12:20am PST +answerDate = 03/01/2016 at 12:20am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Multiply_Rational_Expressions.pg +description = multiply rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions100.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setOperations_with_Radicals.def b/Contrib/PCC/OldSetDefinitions/MTH095/setOperations_with_Radicals.def new file mode 100644 index 0000000000..2d26974f77 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setOperations_with_Radicals.def @@ -0,0 +1,43 @@ +openDate = 12/01/2015 at 12:37am PST +dueDate = 03/01/2016 at 12:37am PST +answerDate = 03/01/2016 at 12:37am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Operations_with_Radicals.pg +description = operations that include radicals +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals13.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals14.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals15.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals51.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals52.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals55.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals56.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals57.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals58.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals91.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals92.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals93.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals94.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals95.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals44.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals55.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals65.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty11.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty12.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty41.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty43.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty60.pg, 1, -1, 0 diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def b/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def new file mode 100644 index 0000000000..83ee97340c --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def @@ -0,0 +1,14 @@ +openDate = 12/01/2015 at 12:58am PST +dueDate = 03/01/2016 at 12:58am PST +answerDate = 03/01/2016 at 12:58am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Equations_with_Complex_Solutions.pg +description = find, understand, and interpret complex solutions of quadratic equations +problemList = +BasicAlgebra/ComplexNumber/complexSolutions10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions40.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions50.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Formula.def b/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Formula.def new file mode 100644 index 0000000000..0f5d59d87d --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Formula.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:56am PST +dueDate = 03/01/2016 at 12:56am PST +answerDate = 03/01/2016 at 12:56am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Formula.pg +description = solve a quadratic equation using the quadratic formula +problemList = +BasicAlgebra/QuadraticEquations/solveQuad375.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad380.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad385.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad185.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools30.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools40.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools50.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorQuadraticFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions.def b/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions.def new file mode 100644 index 0000000000..2e43c931df --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:50am PST +dueDate = 03/01/2016 at 12:50am PST +answerDate = 03/01/2016 at 12:50am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions.pg +description = quadratic functions their graphs +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def b/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def new file mode 100644 index 0000000000..a88a2e2d3f --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def @@ -0,0 +1,24 @@ +openDate = 12/01/2015 at 12:52am PST +dueDate = 03/01/2016 at 12:52am PST +answerDate = 03/01/2016 at 12:52am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions_Vertex_Form.pg +description = quadratic functions in vertex form and their graphs +problemList = +BasicAlgebra/QuadraticFunctions/CompleteSquare10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare40.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare50.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare60.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare70.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm40.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setRadical_Functions_Domain_Range.def b/Contrib/PCC/OldSetDefinitions/MTH095/setRadical_Functions_Domain_Range.def new file mode 100644 index 0000000000..abf0dc5bae --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setRadical_Functions_Domain_Range.def @@ -0,0 +1,23 @@ +openDate = 12/01/2015 at 12:34am PST +dueDate = 03/01/2016 at 12:34am PST +answerDate = 03/01/2016 at 12:34am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Radical_Functions_Domain_Range.pg +description = determine the domain and range of radical functions +problemList = +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions2.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions3.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions4.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions5.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions6.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions7.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions8.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically100.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically110.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically120.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically130.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically140.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically150.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setRational_Exponents.def b/Contrib/PCC/OldSetDefinitions/MTH095/setRational_Exponents.def new file mode 100644 index 0000000000..eb4b66091b --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setRational_Exponents.def @@ -0,0 +1,50 @@ +openDate = 12/01/2015 at 12:35am PST +dueDate = 03/01/2016 at 12:35am PST +answerDate = 03/01/2016 at 12:35am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Exponents.pg +description = using rational exponents to simplify radical expressions +problemList = +Math95/RadicalsRationalExponents/RadicalsRationalExponents7.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents8.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent26.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent40.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots35.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents9.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents14.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents15.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents16.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents17.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents18.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents19.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents21.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents24.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents27.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents28.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents29.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents31.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setRational_Functions_Domain.def b/Contrib/PCC/OldSetDefinitions/MTH095/setRational_Functions_Domain.def new file mode 100644 index 0000000000..bb6730e752 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setRational_Functions_Domain.def @@ -0,0 +1,29 @@ +openDate = 12/01/2015 at 12:16am PST +dueDate = 03/01/2016 at 12:16am PST +answerDate = 03/01/2016 at 12:16am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Functions_Domain.pg +description = determine the domain and range of rational functions +problemList = +BasicAlgebra/RationalFunctions/rationalFunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions211.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions212.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions213.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions214.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions215.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions216.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions217.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain40.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote30.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote40.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg, 1, -1, 0 diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def b/Contrib/PCC/OldSetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def new file mode 100644 index 0000000000..7947d00d13 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def @@ -0,0 +1,15 @@ +openDate = 12/01/2015 at 12:46am PST +dueDate = 03/01/2016 at 12:46am PST +answerDate = 03/01/2016 at 12:46am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Complex_Number_Denominators.pg +description = rationalize denominators that include complex numbers +problemList = +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setRationalize_Radical_Denominators.def b/Contrib/PCC/OldSetDefinitions/MTH095/setRationalize_Radical_Denominators.def new file mode 100644 index 0000000000..7ea176a347 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setRationalize_Radical_Denominators.def @@ -0,0 +1,35 @@ +openDate = 12/01/2015 at 12:38am PST +dueDate = 03/01/2016 at 12:38am PST +answerDate = 03/01/2016 at 12:38am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Radical_Denominators.pg +description = rationalize denominators that include radicals +problemList = +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator35.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator36.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator37.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator81.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator82.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator83.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator84.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator85.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator86.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator87.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator110.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator140.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator150.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication10.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication20.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication30.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals24.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals25.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals26.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator160.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator165.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator170.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator180.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator190.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator200.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator210.pg, 1, -1, 0 diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_1-1.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_1-1.def new file mode 100644 index 0000000000..3cf3e98ca6 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_1-1.def @@ -0,0 +1,54 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:00am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = evaluating formulaic functions; domain and range; graphs of functions +problemList = +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction110.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction140.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions110.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions150.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions160.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions170.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions200.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions225.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/Functions/Functions10.pg, 1, -1, 0 +Math95/Functions/Functions11.pg, 1, -1, 0 +Math95/Functions/Functions12.pg, 1, -1, 0 +Math95/Functions/Functions13.pg, 1, -1, 0 +Math95/Functions/Functions14.pg, 1, -1, 0 +Math95/Functions/Functions15.pg, 1, -1, 0 +Math95/Functions/Functions16.pg, 1, -1, 0 +Math95/Functions/Functions17.pg, 1, -1, 0 +Math95/Functions/Functions18.pg, 1, -1, 0 +Math95/Functions/Functions19.pg, 1, -1, 0 +Math95/Functions/Functions20.pg, 1, -1, 0 +Math95/Functions/Functions22.pg, 1, -1, 0 +Math95/Functions/Functions21.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_2-3.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_2-3.def new file mode 100644 index 0000000000..8f7407ea3e --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_2-3.def @@ -0,0 +1,60 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:01am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = inequalities with number lines, interval notation, and set-builder notation; solving linear inequalities; applications +problemList = +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality130.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality170.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality190.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality210.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality230.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality240.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality260.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality280.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality290.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality310.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 +Math95/LinearInequalities/LinearInequalities8.pg, 1, -1, 0 +Math95/LinearInequalities/LinearInequalities9.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_2-4.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_2-4.def new file mode 100644 index 0000000000..b3ced9082e --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_2-4.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:02am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = compound inequalities +problemList = +Math95/CompoundLinearInequalities/CompoundLinearInequalities1.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities2.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities3.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities4.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities5.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities6.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities11.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities10.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities7.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities8.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities9.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_2-5.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_2-5.def new file mode 100644 index 0000000000..fc9073ba2c --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_2-5.def @@ -0,0 +1,17 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:03am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = absolute value inequalities +problemList = +Math95/AbsValueInequalities/AbsValueInequalities1.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities4.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities6.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities7.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities2.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities3.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities5.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities9.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities8.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-1.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-1.def new file mode 100644 index 0000000000..3856fa3c8f --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-1.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:04am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = rational functions; easier rational equations +problemList = +Math95/Functions/Functions19.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions200.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations1.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations2.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations4.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations5.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations6.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations7.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations3.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-2.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-2.def new file mode 100644 index 0000000000..e09e4fd088 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-2.def @@ -0,0 +1,21 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:05am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = multiplication and division of rational expressions +problemList = +Math95/MultiplyingRationals/MultiplyingRationals1.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_15_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_18_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_22_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_20_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_19_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_16_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_23_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_24_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_25_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_27_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_26_MultDivRatExp.pg, 1, -1, 0 +Math95/MultiplyingRationals/MultiplyingRationals2.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-3.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-3.def new file mode 100644 index 0000000000..95dc9b7346 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-3.def @@ -0,0 +1,24 @@ + +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:06am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = addition and subtraction of rational expressions +problemList = +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_01_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_06_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_07_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_05_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_02_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_03_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_04_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_20_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_17_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_24_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_25_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_21_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_27_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_19_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_18_AddSubRatExp.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-4.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-4.def new file mode 100644 index 0000000000..92902cdd2a --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-4.def @@ -0,0 +1,32 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:07am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = more rational equations; applications +problemList = +Math95/MoreRationalEquations/MoreRationalEquations1.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations2.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations3.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations4.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations5.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations6.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations7.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations8.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations9.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations10.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations11.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations12.pg, 1, -1, 0 +Math95/Proportions/Proportions1.pg, 1, -1, 0 +Math95/Proportions/Proportions2.pg, 1, -1, 0 +Math95/Proportions/Proportions3.pg, 1, -1, 0 +Math95/Proportions/Proportions4.pg, 1, -1, 0 +Math95/Proportions/Proportions5.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications1.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications2.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications3.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications4.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications5.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications6.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications7.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-5.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-5.def new file mode 100644 index 0000000000..364f7293ed --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_4-5.def @@ -0,0 +1,18 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:08am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = "complex" fractions (rational expressions with more than two "levels") +problemList = +Math95/ComplexFractions/ComplexFractions1.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions2.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions3.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions4.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions5.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions6.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions7.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions8.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions9.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-1_5-2.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-1_5-2.def new file mode 100644 index 0000000000..7ecbfb27e8 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-1_5-2.def @@ -0,0 +1,40 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:09am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = square roots and radicals; rational exponents +problemList = +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents6.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents5.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents3.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents4.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents9.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents27.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents28.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents29.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents31.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents7.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents8.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents18.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p13.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p16.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p12.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-3.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-3.def new file mode 100644 index 0000000000..111ce86936 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-3.def @@ -0,0 +1,31 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:10am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = multiplying radical and rational exponent expressions +problemList = +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents14.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents15.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents16.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents17.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents21.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents24.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-4.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-4.def new file mode 100644 index 0000000000..bdde53a100 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-4.def @@ -0,0 +1,34 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:11am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = adding like radicals; reducing radicals; rationalizing denominators; binomial multiplication with radicals and rational exponents +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical1.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-5.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-5.def new file mode 100644 index 0000000000..f581cb19fe --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-5.def @@ -0,0 +1,20 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:12am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = radical functions +problemList = +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions225.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions2.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions3.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions4.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions5.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions6.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions7.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions8.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-6.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-6.def new file mode 100644 index 0000000000..f9bd162940 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-6.def @@ -0,0 +1,33 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:13am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = equations that radicals help solve; Pythagorean Theorem; equations with radicals in them +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad35.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad40.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad50.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad70.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad75.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad85.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad115.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad110.pg, 1, -1, 0 +Math95/EquationsNeedingRadicals/EquationsNeedingRadicals3.pg, 1, -1, 0 +Math95/EquationsNeedingRadicals/EquationsNeedingRadicals4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations1.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations5.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations8.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations9.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations10.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad135.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad140.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-7.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-7.def new file mode 100644 index 0000000000..c183d725ec --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_5-7.def @@ -0,0 +1,20 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:14am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = arithmetic with complex numbers; counting real and nonreal roots of quadratic polynomials +problemList = +Math95/ComplexNumbers/ComplexNumbers1.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers2.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers3.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers4.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers5.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers6.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers7.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers8.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-1.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-1.def new file mode 100644 index 0000000000..6d8014412d --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-1.def @@ -0,0 +1,24 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:15am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = graph quadratic functions; parabola axis of symmetry and vertex +problemList = +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-2.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-2.def new file mode 100644 index 0000000000..256be791df --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-2.def @@ -0,0 +1,25 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:16am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = transformations of y=x^2; quadratic data +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms10.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData1.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData2.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData3.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-3.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-3.def new file mode 100644 index 0000000000..11f4905628 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-3.def @@ -0,0 +1,46 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:17am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = solve quadratic equations using factoring, square root, and completing the square; find x-intercepts of parabolas; applications +problemList = +BasicAlgebra/QuadraticEquations/solveQuad95.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad230.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad220.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad235.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad240.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad120.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad180.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad265.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad270.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad280.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad285.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad295.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad335.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad330.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad325.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts220.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts230.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola100.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-4.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-4.def new file mode 100644 index 0000000000..8b77a87ae4 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSection_6-4.def @@ -0,0 +1,21 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:18am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = the quadratic formula; applications +problemList = +BasicAlgebra/QuadraticEquations/solveQuad145.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad150.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad176.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def new file mode 100644 index 0000000000..7c8e046444 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def @@ -0,0 +1,18 @@ +openDate = 12/01/2015 at 12:28am PST +dueDate = 03/01/2016 at 12:28am PST +answerDate = 03/01/2016 at 12:28am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Complex_Rational_Expressions.pg +description = simplify complex rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions11.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions12.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions70.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSimplify_Radical_Expressions.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSimplify_Radical_Expressions.def new file mode 100644 index 0000000000..207d476ffa --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSimplify_Radical_Expressions.def @@ -0,0 +1,28 @@ +openDate = 12/01/2015 at 12:36am PST +dueDate = 03/01/2016 at 12:36am PST +answerDate = 03/01/2016 at 12:36am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Radical_Expressions.pg +description = simplify radical expressions +problemList = +Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents3.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents4.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents5.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents6.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals07.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals09.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals150.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals160.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals170.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals180.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals185.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals190.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals200.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals210.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals220.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEstimateRadical10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEstimateRadical20.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSimplify_Rational_Expressions.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSimplify_Rational_Expressions.def new file mode 100644 index 0000000000..722ea2a715 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSimplify_Rational_Expressions.def @@ -0,0 +1,27 @@ +openDate = 12/01/2015 at 12:18am PST +dueDate = 03/01/2016 at 12:18am PST +answerDate = 03/01/2016 at 12:18am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Rational_Expressions.pg +description = simplify rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions100.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions110.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions120.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions130.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions150.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions160.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions170.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions180.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def new file mode 100644 index 0000000000..20167defb9 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:12am PST +dueDate = 03/01/2016 at 12:12am PST +answerDate = 03/01/2016 at 12:12am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Equations.pg +description = solve absolute value equations +problemList = +BasicAlgebra/AbsoluteValue/absoluteValueEquation10.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation20.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation30.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation40.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation50.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation60.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation65.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation70.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation80.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation90.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation95.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation100.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation110.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation120.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation130.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation140.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation150.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def new file mode 100644 index 0000000000..2c025f8c71 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:14am PST +dueDate = 03/01/2016 at 12:14am PST +answerDate = 03/01/2016 at 12:14am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Inequalities.pg +description = solve absolute value inequalities +problemList = +BasicAlgebra/AbsoluteValue/absoluteValueInequality10.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality20.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality50.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality70.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality100.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality130.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality140.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality150.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequalityApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveInequality10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveInequality20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Inequalities.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Inequalities.def new file mode 100644 index 0000000000..14a7378064 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Inequalities.def @@ -0,0 +1,34 @@ +openDate = 12/01/2015 at 12:08am PST +dueDate = 03/01/2016 at 12:08am PST +answerDate = 03/01/2016 at 12:08am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Inequalities.pg +description = solve inequalities and compound inequalities +problemList = +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality320.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality300.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def new file mode 100644 index 0000000000..6baeeeeadd --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def @@ -0,0 +1,17 @@ +openDate = 12/01/2015 at 12:32am PST +dueDate = 03/01/2016 at 12:32am PST +answerDate = 03/01/2016 at 12:32am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Literal_Rational_Equations.pg +description = solve literal rational equations +problemList = +BasicAlgebra/RationalLiteralEquations/LiteralEquation220.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation230.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation240.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation250.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation260.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation270.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation280.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation290.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Quadratic_Equations.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Quadratic_Equations.def new file mode 100644 index 0000000000..7093359a79 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Quadratic_Equations.def @@ -0,0 +1,21 @@ +openDate = 12/01/2015 at 12:54am PST +dueDate = 03/01/2016 at 12:54am PST +answerDate = 03/01/2016 at 12:54am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Quadratic_Equations.pg +description = learning more advanced skills for graphing calculators +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Radical_Equations.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Radical_Equations.def new file mode 100644 index 0000000000..878f61f5f0 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Radical_Equations.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:40am PST +dueDate = 03/01/2016 at 12:40am PST +answerDate = 03/01/2016 at 12:40am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Radical_Equations.pg +description = solve radical equations +problemList = +Math95/SolvingRadicalEquations/SolvingRadicalEquations1.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations5.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations8.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral90.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral100.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral110.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral120.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRadicalEquation10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRadicalEquation20.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication92.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication102.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication122.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication20.pg, 1, -1, 0 diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations.def new file mode 100644 index 0000000000..922baf84da --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations.def @@ -0,0 +1,25 @@ +openDate = 12/01/2015 at 12:30am PST +dueDate = 03/01/2016 at 12:30am PST +answerDate = 03/01/2016 at 12:30am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations.pg +description = solve rational equations +problemList = +BasicAlgebra/RationalEquations/solveRationalEquations10.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations20.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations25.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations27.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations28.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations30.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations40.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations50.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations55.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations60.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations61.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations65.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations66.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations70.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRationalEquation10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRationalEquation20.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def new file mode 100644 index 0000000000..a93cb61e19 --- /dev/null +++ b/Contrib/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def @@ -0,0 +1,22 @@ +openDate = 12/01/2015 at 12:31am PST +dueDate = 03/01/2016 at 12:31am PST +answerDate = 03/01/2016 at 12:31am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations_Applications.pg +description = solve rational equations +problemList = +BasicAlgebra/RationalEquations/rationalEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication15.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication25.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication35.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication44.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication45.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_1.1-2.3_header.pg b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_1.1-2.3_header.pg new file mode 100644 index 0000000000..d016f98a06 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_1.1-2.3_header.pg @@ -0,0 +1,87 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, sections 1.1 through 2.3. +$PAR + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_2.4-3.7_header.pg b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_2.4-3.7_header.pg new file mode 100644 index 0000000000..f1168a947c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_2.4-3.7_header.pg @@ -0,0 +1,87 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, sections 2.4 through 3.7. +$PAR + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Final_Exam_202003_30022_header.pg b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Final_Exam_202003_30022_header.pg new file mode 100644 index 0000000000..4d1a54fd8e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Final_Exam_202003_30022_header.pg @@ -0,0 +1,87 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, chapters 1 through 4. +$PAR + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Exam_ORCCA_ed2_10.1-11.2_header.pg b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Exam_ORCCA_ed2_10.1-11.2_header.pg new file mode 100644 index 0000000000..6a75b5ec83 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Exam_ORCCA_ed2_10.1-11.2_header.pg @@ -0,0 +1,89 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, sections 10.1 through 11.2. +$PAR + +The last question instructs you to write responses outside of WeBWorK +(such as on paper, using MS Word, etc) and upload them into an Assignment in D2L. + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Final_Exam_202004_40038_header.pg b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Final_Exam_202004_40038_header.pg new file mode 100644 index 0000000000..6a62b0bcb0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Final_Exam_202004_40038_header.pg @@ -0,0 +1,84 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, chapters 10 through 13. + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Midterm_Exam_202004_40038_header.pg b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Midterm_Exam_202004_40038_header.pg new file mode 100644 index 0000000000..6b8e633aa5 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Midterm_Exam_202004_40038_header.pg @@ -0,0 +1,84 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, chapters 10 and 11. + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg new file mode 100644 index 0000000000..2714f8bbb8 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg @@ -0,0 +1,113 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +Go to \{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH20Course!,"http://spot.pcc.edu/~cyao/MTH20Course", "TARGET='_blank'") \} for MTH20 lecture notes and video lectures. +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg new file mode 100644 index 0000000000..04856c28e8 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg @@ -0,0 +1,93 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +Go to \{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH60Course!,"http://spot.pcc.edu/~cyao/MTH60Course", "TARGET='_blank'") \} for MTH60 lecture notes and video lectures. +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg new file mode 100644 index 0000000000..7be5627b2c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg @@ -0,0 +1,93 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +Go to \{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH65Course!,"http://spot.pcc.edu/~cyao/MTH65Course", "TARGET='_blank'") \} for MTH65 lecture notes and video lectures. +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg new file mode 100644 index 0000000000..5cfc4b9436 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg @@ -0,0 +1,185 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. diff --git a/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg new file mode 100644 index 0000000000..5cfc4b9436 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg @@ -0,0 +1,185 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. diff --git a/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg new file mode 100644 index 0000000000..5cfc4b9436 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg @@ -0,0 +1,185 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractFractions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractFractions.pg new file mode 100644 index 0000000000..caefb6f84e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractFractions.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L2AddSubtractFractions.pdf +!,"Add/Subtract Fractions Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Add Fractions with Common Denominators Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/4pQIw5h8iUw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Fractions with Different Denominators Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/89eHMYsw8MU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Fractions with Different Denominators Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/N-TEyv7VNgY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Fractions with Different Denominators Involving Negative Numbers +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GgWnw4L9POA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractIntegers.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractIntegers.pg new file mode 100644 index 0000000000..cb19f79682 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractIntegers.pg @@ -0,0 +1,139 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U2L2AddSubtractIntegers.pdf +!,"Add and Subtract Integers Lecture Notes", "TARGET='_blank'") \}. + +$PAR +First Method to Add/Subtract Integers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/C38B33ZywWs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Second Method to Add Integers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/AIWPLvTNhXs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Second Method to Subtract Integers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/0sMIJkFV1uw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractMixedNumbers.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractMixedNumbers.pg new file mode 100644 index 0000000000..2e297725ed --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractMixedNumbers.pg @@ -0,0 +1,170 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L6AddSubtractMixedNumbers.pdf +!,"Add/Subtract Mixed Numbers Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Add Mixed Numbers with Common Denominators Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/MBZrYacUDyc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Mixed Numbers with Different Denominators Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CfBYGFm5gPA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Mixed Numbers with Common Denominators Involving Negative Numbers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Pj2LGQ2gHgw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Mixed Numbers with Uncommon Denominators Involving Negative Numbers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/MwqgHvdKlmQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Subtract Mixed Numbers Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/WF7L2waDwLw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Subtract Mixed Numbers Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/4LYtLMmDuzw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Subtract a Fraction from a Whole Number Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ZpdTfe30N1s +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAdditionSubtraction.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAdditionSubtraction.pg new file mode 100644 index 0000000000..a2807f71e6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAdditionSubtraction.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L2DecimalAdditionSubtraction.pdf +!,"Add/Subtract Decimals Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Add Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/-wJXRgTDghA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Subtract Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/kMD7M9MSbO0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add/Subtract Decimals Involving Negative Numbers Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/7QEmT3iJBtU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add/Subtract Decimals Involving Negative Numbers Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/qJzYcLE7_Mg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAndFraction.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAndFraction.pg new file mode 100644 index 0000000000..8fa4597963 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAndFraction.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L4DecimalAndFraction.pdf +!,"Decimals and Fractions Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Change Decimal to Fraction Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/bA5ZoFW1ztE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Change Decimal to Fraction Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/iOvxUXl3flc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Change Fraction to Decimal Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/I7L-vNLki5w +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Convert between Fractions and Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/5PYVMuI3qoc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalDefinition.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalDefinition.pg new file mode 100644 index 0000000000..8e2f6dd51f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalDefinition.pg @@ -0,0 +1,139 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L1DecimalDefinition.pdf +!,"Introduction to Decimals Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Introduction to Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/oCnZ6ZpafNg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Compare Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/VmaY9mNy4ak +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +$PAR +Round Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/g8hRCisK8to +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalMultiplicationDivision.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalMultiplicationDivision.pg new file mode 100644 index 0000000000..c09db8c05f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalMultiplicationDivision.pg @@ -0,0 +1,147 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L3DecimalMultiplicationDivision.pdf +!,"Multiply/Divide Decimals Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Multiply by Power of 10 Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/mV0RxDZG05A +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +$PAR +Divide by Power of 10 Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/W_VhVHRal6o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Multiply Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/xpuZIC3nolQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Divide Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/wYh0eUCdJWQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivideFractions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivideFractions.pg new file mode 100644 index 0000000000..b5ea98fafd --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivideFractions.pg @@ -0,0 +1,119 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L4DivideFractions.pdf +!,"Divide Fractions Lecture Notes", "TARGET='_blank'") \}. + +\{ scalableiframe("// +www.youtube.com/embed/7VGgnESa498 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivisibilityTest.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivisibilityTest.pg new file mode 100644 index 0000000000..d4867edb93 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivisibilityTest.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L5DivisivilityTest.pdf +!,"Divisibility Test Lecture Notes", "TARGET='_blank'") \}. + +\{ scalableiframe("// +www.youtube.com/embed/Df9h5t64NlQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Division.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Division.pg new file mode 100644 index 0000000000..e63977fcd6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Division.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L3Division.pdf +!,"Division Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Division Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/MTzTqvzWzm8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Division Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/8Ft5iHhauJ0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Remainder Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/fjAbh_LCxcI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Divide by Zero Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/UjRob36yuJI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/ExponentsAndRoundingWholeNumbers.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/ExponentsAndRoundingWholeNumbers.pg new file mode 100644 index 0000000000..69260f6d3a --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/ExponentsAndRoundingWholeNumbers.pg @@ -0,0 +1,131 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L1ExponentAndRoundingWholeNumber.pdf +!,"Exponent and Rounding Whole Numbers Lecture Notes", "TARGET='_blank'") \} + +$PAR +Exponent Definition Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/i4m9jMGv4AA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +$PAR +Round Whole Numbers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vNsmn4SMD4k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/FractionDefinition.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/FractionDefinition.pg new file mode 100644 index 0000000000..a1761b58cf --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/FractionDefinition.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L1FractionDefinition.pdf +!,"Fraction Definition and Equivalent Fractions Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Definition of Fractions Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/cmBdd_GmFh4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Reduce Fractions Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/eAzfN0o3CgY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Reduce Fractions Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/sznPsgkHEyA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Compare Fractions Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/nt-83HOnQHU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GCFAndLCM.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GCFAndLCM.pg new file mode 100644 index 0000000000..9fe7581d86 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GCFAndLCM.pg @@ -0,0 +1,136 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L7GCFAndLCM.pdf +!,"Greatest Common Factor and Least Common Multiple Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Greatest Common Factor Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ECFmsS7z9sE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Least Common Multiple Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/D6yHKOYJiso +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Least Common Multiple Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/znmPfDfsir8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Least Common Multiple Video Lecture 3 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/w_GwBDOSNp4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GeometryBasics.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GeometryBasics.pg new file mode 100644 index 0000000000..7c4370e760 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GeometryBasics.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L4GeometryBasics.pdf +!,"Geometry Basics Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/kqqmJiJez6o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/IntegersAndAbsoluteValue.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/IntegersAndAbsoluteValue.pg new file mode 100644 index 0000000000..10b1fca043 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/IntegersAndAbsoluteValue.pg @@ -0,0 +1,131 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U2L1IntegersAndAbsoluteValue.pdf +!,"Integers and Absolute Value Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Introduction to Negative Numbers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Hlal9ME2Aig +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Absolute Value Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/L8fGfc7Wcco +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MeanMedianMode.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MeanMedianMode.pg new file mode 100644 index 0000000000..4342283a11 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MeanMedianMode.pg @@ -0,0 +1,121 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L6MeanMedianMode.pdf +!,"Mean, Median and Mode Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/pk8_c0hAuRI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MixedNumberDefinition.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MixedNumberDefinition.pg new file mode 100644 index 0000000000..762b888d8d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MixedNumberDefinition.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L5MixedNumberDefinition.pdf +!,"Introduction to Mixed Numbers Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/HkELb2btWQQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Multiplication.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Multiplication.pg new file mode 100644 index 0000000000..4abbec3df2 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Multiplication.pg @@ -0,0 +1,138 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L2Multiplication.pdf +!,"Multiplication Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Multiplication Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/mvOkMYCygps +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Multiplication Table Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/xO_1bYgoQvA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Multiplication Table Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/qihoczo1Ujk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideIntegers.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideIntegers.pg new file mode 100644 index 0000000000..fa1f5f03ca --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideIntegers.pg @@ -0,0 +1,131 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U2L3MultiplyDivideIntegers.pdf +!,"Multiply and Divide Integers Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Multiply and Divide Integers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/d8lP5tR2R3Q +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Negative Number and Exponent Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/AneubQTnoL4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideMixedNumbers.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideMixedNumbers.pg new file mode 100644 index 0000000000..765026dbc4 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideMixedNumbers.pg @@ -0,0 +1,127 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L7MultiplyDivideMixedNumbers.pdf +!,"Multiply/Divide Mixed Numbers Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/BhUwTsPEZuM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vVx7qwUf5KU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyFractions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyFractions.pg new file mode 100644 index 0000000000..73af1c1fba --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyFractions.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L3MultiplyFractions.pdf +!,"Multiply Fractions Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/rxISl5boIuE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_1.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_1.pg new file mode 100644 index 0000000000..519146625d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_1.pg @@ -0,0 +1,132 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L8OrderOfOperations_1.pdf +!,"Order of Operations Part I (involving positive numbers only) Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ahwlw4OCEAc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/NCixeuWvLS0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/wTHSBsoDDqY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_2.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_2.pg new file mode 100644 index 0000000000..c7ba2f6179 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_2.pg @@ -0,0 +1,126 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U2L4OrderOfOperations_2.pdf +!,"Order of Operations Part II Lecture Notes (involving negative numbers and absolute values)", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/a329hvX8yDA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/UzQZfvYPlzI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_3.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_3.pg new file mode 100644 index 0000000000..00cc6e321e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_3.pg @@ -0,0 +1,126 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L8OrderOfOperations_3.pdf +!,"Order of Operations involving Fractions Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/EpX9ohiti6o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/a329hvX8yDA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentDefinition.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentDefinition.pg new file mode 100644 index 0000000000..2936c5dc20 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentDefinition.pg @@ -0,0 +1,155 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U6L1PercentDefinition.pdf +!,"Introduction to Percent Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Introduction to Percent Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/xB7d4SqI25M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +$PAR +Change Percent to Decimal Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/KBtjkblzbrw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Change Percent to Fraction Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/17sdYa0y1wo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Change Decimals/Fractions to Percent Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/eLBMph6iSiY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Percent, Fraction and Decimal Conversions Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Hkwfibux88s +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentFormula.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentFormula.pg new file mode 100644 index 0000000000..03b1e59bc8 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentFormula.pg @@ -0,0 +1,154 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U6L2PercentFormula.pdf +!,"Percent Formula Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Type I Percent Formula Problems Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/dKVOGoHMsfc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Type II Percent Formula Problems Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/N4kDzoQOngY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Type III Percent Formula Problems Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/DAikW24_O0A +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Solve Percent Problems with Proportion Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/T8dAK1RDexI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Solve Percent Problems with Proportion Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vuSMdL0Mke4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentOfIncreaseDecrease.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentOfIncreaseDecrease.pg new file mode 100644 index 0000000000..e4be0e6241 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentOfIncreaseDecrease.pg @@ -0,0 +1,130 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U6L4PercentOfIncreaseDecrease.pdf +!,"Percent of Increase/Decrease Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/KVfRWj5CU5E +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LP9UJmBxAnw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +$PAR +\{ scalableiframe("// +www.youtube.com/embed/wzLUsEU_fvE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentWordProblems.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentWordProblems.pg new file mode 100644 index 0000000000..2c4e582bc1 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentWordProblems.pg @@ -0,0 +1,130 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U6L3PercentWordProblem.pdf +!,"Percent Word Problems Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/cAPXFDev8B4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +$PAR +\{ scalableiframe("// +www.youtube.com/embed/STMZeuWT4Ss +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +$PAR +\{ scalableiframe("// +www.youtube.com/embed/1LtBcfk1uHg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PrimeNumbers.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PrimeNumbers.pg new file mode 100644 index 0000000000..10e32fc9a3 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PrimeNumbers.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L6PrimeNumber.pdf +!,"Prime Number Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Find Factors Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vcn2ruTOwFo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Prime Number Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/mIStB5X4U8M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Prime Number Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/3h4UK62Qrbo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Prime Factor Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/XpUCTicRBjQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Proportion.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Proportion.pg new file mode 100644 index 0000000000..6a12238e22 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Proportion.pg @@ -0,0 +1,138 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U5L2Proportion.pdf +!,"Proportion Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Solve Proportions Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/EdM-jYtAtAM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Solve Proportions Word Problem Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/89H0Vsn7oC4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Solve Proportions Word Problem Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/KaxpT_R9a-c +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/RateAndRatio.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/RateAndRatio.pg new file mode 100644 index 0000000000..5d243927f9 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/RateAndRatio.pg @@ -0,0 +1,130 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U5L1RateAndRatio.pdf +!,"Rate and Ratio Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Ratio Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/MTzTqvzWzm8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Rate and Ratio Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/8Ft5iHhauJ0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/SquareRoot.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/SquareRoot.pg new file mode 100644 index 0000000000..e02ad4fd9e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/SquareRoot.pg @@ -0,0 +1,130 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L5SquareRoot.pdf +!,"Square Root Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Introduction to Square Root Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/yVUtSYPYM5M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Evaluate Square Root Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CCd1HrPizmw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/UnitConversion.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/UnitConversion.pg new file mode 100644 index 0000000000..4315d6685f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/UnitConversion.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U5L3UnitConversion.pdf +!,"Unit Conversion Lecture Notes", "TARGET='_blank'") \}. + +$PAR +American Sytem Unit Conversion Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/bcM5J-wYHjE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Metric System Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/6sBmVPIJwrw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Unit Cancellation Method Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/OL7liIliMD0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Unit Cancellation Method Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/daVdxGfchWI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AbsoluteValue.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AbsoluteValue.pg new file mode 100644 index 0000000000..7a9c358d34 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AbsoluteValue.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L2_AbsoluteValue.pdf +!,"lecture notes on absolute value", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/L8fGfc7Wcco +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AccountInterestWordProblems.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AccountInterestWordProblems.pg new file mode 100644 index 0000000000..d5d06d3d78 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AccountInterestWordProblems.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U7L3_AccountInterestProblems.pdf +!,"lecture notes on account interest word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/7i_35zNMsjg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ieCNfN7Uwog +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AddSubtractFractions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AddSubtractFractions.pg new file mode 100644 index 0000000000..5bb75ed070 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AddSubtractFractions.pg @@ -0,0 +1,102 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH60Docs/U2L2_AddSubtractFractions.pdf!,"lecture notes on adding/subtracting fractions", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/89eHMYsw8MU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GgWnw4L9POA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicPercentageWordProblems.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicPercentageWordProblems.pg new file mode 100644 index 0000000000..c0458f16b1 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicPercentageWordProblems.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U7L1_BasicPercentProblems.pdf +!,"lecture notes on basic percentage word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/qs-5b2IBvB8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicWordProblems.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicWordProblems.pg new file mode 100644 index 0000000000..99fd9415c3 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicWordProblems.pg @@ -0,0 +1,130 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U5L1_BasicWordProblems.pdf +!,"lecture notes on basic word problems", "TARGET='_blank'") \} +$PAR + +First video lecture on number word problems +$PAR +\{ scalableiframe("// +www.youtube.com/embed/0Z5k2I-0mHo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Second video lecture on number word problems +$PAR +\{ scalableiframe("// +www.youtube.com/embed/UvOwDgZzxvw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on consecutive integers word problems +$PAR +\{ scalableiframe("// +www.youtube.com/embed/o5T6PYD5zmY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on consecutive odd/even integers word problems +$PAR +\{ scalableiframe("// +www.youtube.com/embed/d8De3xcVmnw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on rectangle perimeter word problems +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ja-g2qB9P9Y +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/CoordinateSystem.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/CoordinateSystem.pg new file mode 100644 index 0000000000..85ec0d6474 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/CoordinateSystem.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L1_CoordinateSystemBasics.pdf +!,"lecture notes on coordinate system basics", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/dzNHVMQVy84 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/DistanceWordProblems.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/DistanceWordProblems.pg new file mode 100644 index 0000000000..4f94911e91 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/DistanceWordProblems.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U7L2_DistanceWordProblems.pdf +!,"lecture notes on distance word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/SBTAFvqMlfk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/jcETNCbcGsY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/EvaluatingExpressions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/EvaluatingExpressions.pg new file mode 100644 index 0000000000..ee12ec36f1 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/EvaluatingExpressions.pg @@ -0,0 +1,105 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L5_EvaluateExpressions.pdf +!,"lecture notes on evaluating expressions", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/Sa6bBkztsoo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/7vt6IerxYdw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentBasics.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentBasics.pg new file mode 100644 index 0000000000..6dcc54efa0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentBasics.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L3_IntroductionToExponents.pdf +!,"lecture notes on exponent basics", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/AneubQTnoL4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentRules.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentRules.pg new file mode 100644 index 0000000000..ebc3368a55 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentRules.pg @@ -0,0 +1,102 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L3_ThreeExponentRules.pdf +!,"lecture notes on exponent rules", "TARGET='_blank'") \} +$PAR +\{ htmlLink(qq! +http://www.youtube.com/watch?v=jjajaVnVQKY +!,"a video lecture on product rule of exponents", "TARGET='_blank'") \} +$PAR +\{ htmlLink(qq! +http://www.youtube.com/watch?v=Y967TsThSGA +!,"a video lecture on some other exponent rules", "TARGET='_blank'") \} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByGraph.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByGraph.pg new file mode 100644 index 0000000000..c810f8336e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByGraph.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L7_WriteLinearEquationByGraph.pdf +!,"lecture notes on finding equation by graph", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/9wOalujeZf4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByPointSlope.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByPointSlope.pg new file mode 100644 index 0000000000..cfbe9da402 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByPointSlope.pg @@ -0,0 +1,114 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L7_GivenPointSlopeFindEquation.pdf +!,"lecture notes on finding equation by point and slope", "TARGET='_blank'") \} +$PAR + +First video lecture on finding equation by point and slope +$PAR +\{ scalableiframe("// +www.youtube.com/embed/9h78OnmH6gk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +Second video lecture on finding equation by point and slope +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GNEKDFKVBOc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +Video lecture on point-slope form equations +$PAR +\{ scalableiframe("// +www.youtube.com/embed/YGAN_b2anv0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByTwoPoints.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByTwoPoints.pg new file mode 100644 index 0000000000..7575d052f9 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByTwoPoints.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L7_GivenTwoPointsFindEquation.pdf +!,"lecture notes on finding equation by two points", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/U1oZU8Xzoik +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Ltapa5XJAkI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/gvwKv6F69F0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Functions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Functions.pg new file mode 100644 index 0000000000..179335b812 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Functions.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U11L1_IntroductionToFunctions.pdf +!,"lecture notes on functions", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/JZmIsxayvxY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FunctionsIntro.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FunctionsIntro.pg new file mode 100644 index 0000000000..b5191510a1 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FunctionsIntro.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U11L1_IntroductionToFunctions.pdf +!,"lecture notes on functions", "TARGET='_blank'") \} + +\{ scalableiframe("// +www.youtube.com/embed/JZmIsxayvxY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphLineByTable.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphLineByTable.pg new file mode 100644 index 0000000000..4acd9c9503 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphLineByTable.pg @@ -0,0 +1,125 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L2_GraphLineByTable.pdf +!,"lecture notes on graphing a line by table", "TARGET='_blank'") \} +$PAR + +Video lecture on graphing a line by table +$PAR +\{ scalableiframe("// +www.youtube.com/embed/8OUvFd-jMGY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L2_VerticalAndHorizontalLines.pdf +!,"lecture notes on vertical and horizontal lines", "TARGET='_blank'") \} +$PAR + +Video lecture on vertical and horizontal lines +$PAR +\{ scalableiframe("// +www.youtube.com/embed/8OUvFd-jMGY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L2_IsPointOnLine.pdf +!,"lecture notes on whether a point is on a line", "TARGET='_blank'") \} +$PAR +Video lecture on whether a point is on a line (start from 4:50) +$PAR +\{ scalableiframe("// +www.youtube.com/embed/l2veOwP9xr4?start=290 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphTwoVariableInequalities.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphTwoVariableInequalities.pg new file mode 100644 index 0000000000..5859ad3722 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphTwoVariableInequalities.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L10_GraphTwoVariableInequalities.pdf +!,"lecture notes on graphing two-variable inequalities", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/_E0GKBVkins +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphingLineSummary.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphingLineSummary.pg new file mode 100644 index 0000000000..1c1ba555aa --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphingLineSummary.pg @@ -0,0 +1,101 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L6_SummaryOfGraphingLines.pdf +!,"lecture notes on summary of graphing lines", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/hs7BxU2strY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/InequalityApplications.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/InequalityApplications.pg new file mode 100644 index 0000000000..e80872fc1e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/InequalityApplications.pg @@ -0,0 +1,105 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U6L3_InequalityApplications.pdf +!,"lecture notes on inequality applications", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/yzv1JyywmSk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/2dSExvlPj3Y +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/IntegerOperations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/IntegerOperations.pg new file mode 100644 index 0000000000..cf53be0329 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/IntegerOperations.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH60Docs/U1L1_MultiplyDivideIntegers.pdf!,"Lecture notes on how to multiply/divide integers", "TARGET='_blank'") \} +$PAR +\{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH60Docs/U1L1_AddSubtractIntegers.pdf!,"lecture notes on how to add/subtract integers", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/JvoAnytWm7A +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/LinearEquationApplications.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/LinearEquationApplications.pg new file mode 100644 index 0000000000..4ebc0ff302 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/LinearEquationApplications.pg @@ -0,0 +1,105 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L8_LinearEquationApplications.pdf +!,"lecture notes on linear equation applications", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/sc6folGNeiY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/LT6-O-4pjg4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixedNumbersEquivalentFractions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixedNumbersEquivalentFractions.pg new file mode 100644 index 0000000000..7fcffb0961 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixedNumbersEquivalentFractions.pg @@ -0,0 +1,109 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH60Docs/U2L1_MixedNumbersAndEquivalentFractions.pdf!,"lecture notes on mixed numbers and how to reduce fractions", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/87DiYdRXZDI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/HkELb2btWQQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/eAzfN0o3CgY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixtureWordProblems.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixtureWordProblems.pg new file mode 100644 index 0000000000..8395a8d675 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixtureWordProblems.pg @@ -0,0 +1,115 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U7L4_MixtureProblems.pdf +!,"lecture notes on mixture word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/OBVGQt1Eeug +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/JVlfQEhzLMM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/QKiN9K2DXBI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/o1XpzeUpcRI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MultiplyDivideFractions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MultiplyDivideFractions.pg new file mode 100644 index 0000000000..fb6942e987 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MultiplyDivideFractions.pg @@ -0,0 +1,117 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U2L3_MultiplyDivideFractions.pdf +!,"lecture notes on multiplying/dividing fractions", "TARGET='_blank'") \} +$PAR + +Video lecture on multiplying fractions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/rxISl5boIuE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on dividing fractions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/zQMU-lsMb3U +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on multiplying and dividing fractions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/8zWZnNpEFY4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/NumberSets.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/NumberSets.pg new file mode 100644 index 0000000000..e6d4e1d6d9 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/NumberSets.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L1_SubsetsOfRealNumbers.pdf +!,"lecture notes on subsets of real numbers", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/4FyqMDHAo48 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/OrderOfOperations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/OrderOfOperations.pg new file mode 100644 index 0000000000..3f79c2c122 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/OrderOfOperations.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L4_OrderOfOperations.pdf +!,"lecture notes on order of operations", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/vDaIKB19TvY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/si_OegYqXDo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/OlVvUd1XVVg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ParallelPerpendicularLines.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ParallelPerpendicularLines.pg new file mode 100644 index 0000000000..b2b166ed0e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ParallelPerpendicularLines.pg @@ -0,0 +1,109 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L9_ParallelAndPerpendicularLines.pdf +!,"lecture notes on parallel and perpendicular lines", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/9hryH94KFJA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/O397kMqSBKI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Ad9fwGCJ6WU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PercentOfIncreaseDecrease.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PercentOfIncreaseDecrease.pg new file mode 100644 index 0000000000..28b4c08174 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PercentOfIncreaseDecrease.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U7L1_PercentOfIncreaseAndDecrease.pdf +!,"lecture notes on percent of increase/decrease word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/qs-5b2IBvB8?start=983 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PerimeterArea.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PerimeterArea.pg new file mode 100644 index 0000000000..b436a1cc80 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PerimeterArea.pg @@ -0,0 +1,115 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U9L1_PerimeterAndCircumference.pdf +!,"lecture notes on perimeter and circumference", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/CPNGuZsjDxA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U9L2_AreaOfCommonShapes.pdf +!,"lecture notes on area of common shapes", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/kqqmJiJez6o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/tCrDyJsSFok +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ProportionWordProblems.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ProportionWordProblems.pg new file mode 100644 index 0000000000..a5024c974d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ProportionWordProblems.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U8L2_ProportionWordProblems.pdf +!,"lecture notes on proportion word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/89H0Vsn7oC4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/PoEzBw7hJVU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/RateAndStartValueWordProblem.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/RateAndStartValueWordProblem.pg new file mode 100644 index 0000000000..e4931ae209 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/RateAndStartValueWordProblem.pg @@ -0,0 +1,109 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U5L3_RateAndStartingValueWordProblems.pdf +!,"lecture notes on Rate and Starting Value word problems", "TARGET='_blank'") \} +$PAR +First video lecture on Rate and Starting Value word problems (watch from 11:23 till 16:17) +$PAR +\{ scalableiframe("// +www.youtube.com/embed/qs-5b2IBvB8?start=683 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/cxGw0C9kXek +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/qPx7i1jwXX4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SimplifyExpressions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SimplifyExpressions.pg new file mode 100644 index 0000000000..14afc8dd48 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SimplifyExpressions.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L6_SimplifyExpressions.pdf +!,"lecture notes on simplifying expressions", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/xqLDbfbL7pI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/YURDKBg9-Aw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Slope.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Slope.pg new file mode 100644 index 0000000000..4eaff90270 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Slope.pg @@ -0,0 +1,111 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L3_Slope.pdf +!,"lecture notes on slope", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/fCIuiQz2Zv4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/SM3bj7zA0FM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/bploNzF7cxg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/hPryexyt6Sg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SlopeInterceptEquation.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SlopeInterceptEquation.pg new file mode 100644 index 0000000000..2b2f753e9d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SlopeInterceptEquation.pg @@ -0,0 +1,114 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L4_SlopeInterceptFormEquations.pdf +!,"lecture notes on slope-intercept equations", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/U6x-L49_P0k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +Second video lecture on slope-intercept equations (watch from 7:08 to 13:50) +$PAR +\{ scalableiframe("// +www.youtube.com/embed/OxAlSHlEpwk?start=428 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L4_GraphWithPointAndSlope.pdf +!,"lecture notes on graphing a line by slope and y-intercept", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/DBr4o6SVE2k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveEquationsWithFractions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveEquationsWithFractions.pg new file mode 100644 index 0000000000..a149417878 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveEquationsWithFractions.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L5_SolveLinearEquationsWithFractions.pdf +!,"lecture notes on solving linear equations with fractions", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/c8H1kqK1XnA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/1jjlful2BBY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveForVariable.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveForVariable.pg new file mode 100644 index 0000000000..f922b084c6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveForVariable.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L6_SolveForVariable.pdf +!,"lecture notes on solving for a variable", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/OQBJep7Gctw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/rS4JPQE4WHw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/IaE5RTnL8C8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveInequalities.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveInequalities.pg new file mode 100644 index 0000000000..9e8d40144c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveInequalities.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U6L1_SolveInequalities.pdf +!,"lecture notes on solving inequalities", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/XFggbIhEvvE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveMultiStepEquations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveMultiStepEquations.pg new file mode 100644 index 0000000000..d1390758c5 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveMultiStepEquations.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L3_SolveMultiStepLinearEquations.pdf +!,"lecture notes on solving multi-step equations", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/MA2-tCfmQnw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/VDIXnZH6q00 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/5lZDQnRcAVc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/typP7RBQ6ps +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveOneStepEquation.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveOneStepEquation.pg new file mode 100644 index 0000000000..b84bbbfd71 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveOneStepEquation.pg @@ -0,0 +1,123 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L1_SolveOneStepLinearEquations.pdf +!,"lecture notes on solving one-step equations", "TARGET='_blank'") \} +$PAR +Video lecture on how to check solutions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/BmzsG2LMUnI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on solving one-step equations +$PAR +\{ scalableiframe("// +www.youtube.com/embed/g6jeSuHYhyY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +First video lecture on solving one-step equations with fractions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/jWlEyVkqw_Q +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Second video lecture on solving one-step equations with fractions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LWV7bjoh4rQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveProportions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveProportions.pg new file mode 100644 index 0000000000..aa4a24041f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveProportions.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U8L1_SolveProportions.pdf +!,"lecture notes on solving proportions", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/l_s3t5zgnOs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveTwoStepEquations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveTwoStepEquations.pg new file mode 100644 index 0000000000..cb88f3274c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveTwoStepEquations.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L2_SolveTwoStepLinearEquations.pdf +!,"lecture notes on solving two-step equations", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/XdKQIKjV_LY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/1c5HY3z4k8M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/f15zA0PhSek +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialCaseInequalities.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialCaseInequalities.pg new file mode 100644 index 0000000000..5bc3aabaf9 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialCaseInequalities.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U6L2_SpecialCaseInequalities.pdf +!,"lecture notes on solving inequalities with special solutions", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/v=jNomYBR5rMU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialSolutions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialSolutions.pg new file mode 100644 index 0000000000..945964fe7a --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialSolutions.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L4_SpecialLinearEquations.pdf +!,"lecture notes on solving linear equations with special solutions", "TARGET='_blank'") \} +$PAR +First video lecture on solving linear equations with special solutions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GM76QU5Tr9k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.khanacademy.org/embed_video?v=qsL_5Y8uWPU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.khanacademy.org/embed_video?v=uQs100shv-A +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.khanacademy.org/embed_video?v=Dq0xFgQB9qo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/StandardFormEquations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/StandardFormEquations.pg new file mode 100644 index 0000000000..85e18982b6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/StandardFormEquations.pg @@ -0,0 +1,114 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L5_StandardFormEquation.pdf +!,"lecture notes on standard-form equations", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/V6Xynlqc_tc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/dZT203NHvaM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L5_GraphLineByIntercepts.pdf +!,"lecture notes on graphing a line by intercepts", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/0o4gps38dBU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SumAndPartWordProblems.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SumAndPartWordProblems.pg new file mode 100644 index 0000000000..fc217ea188 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SumAndPartWordProblems.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U5L2_GivenSumFindPartsWordProblems.pdf +!,"lecture notes on 'Given Sum, Find Parts' word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/GQhGGZc772E +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/TranslatingWordsIntoAlgebra.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/TranslatingWordsIntoAlgebra.pg new file mode 100644 index 0000000000..c38dd9e859 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/TranslatingWordsIntoAlgebra.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L7_TranslateWordsIntoAlgebraicExpressions.pdf +!,"lecture notes on translating words to Algebraic expressions", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/Gm8AaLLMepU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/g6jeSuHYhyY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Trigonometry.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Trigonometry.pg new file mode 100644 index 0000000000..b67d33f0bc --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Trigonometry.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U11L1_RightTriangleTrigonometry.pdf +!,"lecture notes on trigonometry", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Jsiy4TxgIME +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Volume.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Volume.pg new file mode 100644 index 0000000000..79ded627b1 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Volume.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U9L3_VolumeOfCommonSolids.pdf +!,"lecture notes on volume", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/b_JhWim9mR0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/AddSubtractPolynomials.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/AddSubtractPolynomials.pg new file mode 100644 index 0000000000..57f703c79b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/AddSubtractPolynomials.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U3L1_AddAndSubtractPolynomials.pdf +!,"lecture notes on adding/subtracting polynomials", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ZN-IzpUR8WQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/DividePolynomials.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/DividePolynomials.pg new file mode 100644 index 0000000000..61bd007289 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/DividePolynomials.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U3L3_DivideMonomials.pdf +!,"lecture notes on dividing polynomials", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/OZjqWAaUkFU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/uERRlY-WmmU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ExponentReview.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ExponentReview.pg new file mode 100644 index 0000000000..713be39cb8 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ExponentReview.pg @@ -0,0 +1,115 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U2L1_MoreExponentRules.pdf +!,"lecture notes on exponent rules", "TARGET='_blank'") \} +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U2L1_UseMultipleExponentRules.pdf +!,"lecture notes on using exponent rules", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/5oJobyGnhDk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/oHNe8AK0E9M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/heUUBzvYA1o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CrJEOQh5UXg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorByGrouping.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorByGrouping.pg new file mode 100644 index 0000000000..2f09ad6aec --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorByGrouping.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"lecture notes on factoring by grouping", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/N9Yg6pVGP7A +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/2MtsZRjxjMo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorOutCommonFactors.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorOutCommonFactors.pg new file mode 100644 index 0000000000..333e9bea77 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorOutCommonFactors.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U4L1_CommonFactors.pdf +!,"lecture notes on factoring out common factors", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/WOCCSoaZRv8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/bLI6NOZ8kdY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorSpecialPolynomials.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorSpecialPolynomials.pg new file mode 100644 index 0000000000..f6c2514361 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorSpecialPolynomials.pg @@ -0,0 +1,107 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U4L5_FactorSpecialPolynomials.pdf +!,"lecture notes on factoring special polynomials", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LdOgluTLBxQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Fwqh9vq0sq8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/icm6zjdOYek +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialWhenAIs1.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialWhenAIs1.pg new file mode 100644 index 0000000000..63ee61eba7 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialWhenAIs1.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U4L3_FactorTrinomialsPart1.pdf +!,"lecture notes on factoring trinomials with leading coefficient 1", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/06RdArZXthg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/BQaOVcJ7KmE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/BG53n9Ef4fM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialsWhenAIsNot1.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialsWhenAIsNot1.pg new file mode 100644 index 0000000000..21422a6b32 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialsWhenAIsNot1.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U4L4_FactorTrinomialsPart2.pdf +!,"lecture notes on factoring ax^2+bx+c", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/thMv6JovewA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/85a9bkP85ag +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ld4VT_ml3Nk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/a1VOMsR8iZo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FallingObjectApplications.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FallingObjectApplications.pg new file mode 100644 index 0000000000..c3d99a4be6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FallingObjectApplications.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L9_FallingObjectApplication.pdf +!,"lecture notes on falling object applications", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/3PfiCtfmJA8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/F--p_CeKJNQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/cNU8mnAlGus +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/Functions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/Functions.pg new file mode 100644 index 0000000000..179335b812 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/Functions.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U11L1_IntroductionToFunctions.pdf +!,"lecture notes on functions", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/JZmIsxayvxY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/IntroductionToSquareRoot.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/IntroductionToSquareRoot.pg new file mode 100644 index 0000000000..b5e78e31a5 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/IntroductionToSquareRoot.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U5L1_IntroductionToSquareRoot.pdf +!,"lecture notes on square roots", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/yVUtSYPYM5M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CCd1HrPizmw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MaximumMinimumApplications.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MaximumMinimumApplications.pg new file mode 100644 index 0000000000..0c8ea2f3ae --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MaximumMinimumApplications.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L8_ParabolaMinMaxApplications.pdf +!,"lecture notes on maximum/minimum value applications", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Qs_WqhoVBDI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ipBoVSMVzp0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MovingParabolaUpDown.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MovingParabolaUpDown.pg new file mode 100644 index 0000000000..4f2b4af756 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MovingParabolaUpDown.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L1_ParabolaUpDown.pdf +!,"lecture notes on moving parabola up/down", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/33CYnBnYsyk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MultiplyingPolynomials.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MultiplyingPolynomials.pg new file mode 100644 index 0000000000..4c3c02effd --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MultiplyingPolynomials.pg @@ -0,0 +1,117 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U3L2_MultiplyPolynomials.pdf +!,"lecture notes on multiplying polynomials", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/7eifTvsbU38 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/iQ6NaQOECTA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U3L2_SpecialProductOfPolynomials.pdf +!,"lecture notes on special product of polynomials", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/AecdR8wpIWM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/bRonwACbTnc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/NegativeExponents.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/NegativeExponents.pg new file mode 100644 index 0000000000..713be39cb8 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/NegativeExponents.pg @@ -0,0 +1,115 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U2L1_MoreExponentRules.pdf +!,"lecture notes on exponent rules", "TARGET='_blank'") \} +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U2L1_UseMultipleExponentRules.pdf +!,"lecture notes on using exponent rules", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/5oJobyGnhDk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/oHNe8AK0E9M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/heUUBzvYA1o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CrJEOQh5UXg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaAxisAndVertex.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaAxisAndVertex.pg new file mode 100644 index 0000000000..f161047df4 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaAxisAndVertex.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L5_ParabolaAxisAndVertex.pdf +!,"lecture notes on parabola axis and vertex", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/RkLSWfoYg98 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaIntercepts.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaIntercepts.pg new file mode 100644 index 0000000000..3224f0bf38 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaIntercepts.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L6_ParabolaIntercepts.pdf +!,"lecture notes on parabola intercepts", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Ep2Tdu6Xn5E +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaMovementSummary.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaMovementSummary.pg new file mode 100644 index 0000000000..be3fe3362c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaMovementSummary.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L4_ParabolaMovementPatterns.pdf +!,"lecture notes on parabola movement summary", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/HC5DDlEwTJw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Fw8vuktklwE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaShiftingLeftRight.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaShiftingLeftRight.pg new file mode 100644 index 0000000000..6d743f4564 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaShiftingLeftRight.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L3_ParabolaLeftRight.pdf +!,"lecture notes on parabolas shifting left or right", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/g_FXRRKg3UM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaThinnerWider.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaThinnerWider.pg new file mode 100644 index 0000000000..20795afec2 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaThinnerWider.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L2_ParabolaThinnerWider.pdf +!,"lecture notes on parabolas becoming thinner or wider", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/WtHgKSv02lM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/TGLjBgxvaFY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/QuadraticEquationApplications.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/QuadraticEquationApplications.pg new file mode 100644 index 0000000000..32dd9f482b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/QuadraticEquationApplications.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L4_QuadraticEquationApplications.pdf +!,"lecture notes on quadratic equation applications", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/uoT5gmF1HoQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/haJJLYT6lro +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/RationalizeDenominator.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/RationalizeDenominator.pg new file mode 100644 index 0000000000..65eda8710e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/RationalizeDenominator.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U5L4_RationalizeDenominator.pdf +!,"lecture notes on rationalizing denominator", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/mYiN8KzQ5n8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ReviewGraphingLines.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ReviewGraphingLines.pg new file mode 100644 index 0000000000..8ce52e0d44 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ReviewGraphingLines.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L6_SummaryOfGraphingLines.pdf +!,"lecture notes on summary of graphing lines", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/hs7BxU2strY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ScientificNotation.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ScientificNotation.pg new file mode 100644 index 0000000000..d24f0d48d8 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ScientificNotation.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U2L2_ScientificNotation.pdf +!,"lecture notes on scientific notations", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/b1HmilCg5Uw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SimplifySquareRoots.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SimplifySquareRoots.pg new file mode 100644 index 0000000000..723184dddb --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SimplifySquareRoots.pg @@ -0,0 +1,117 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U5L2_SimplifySquareRoot.pdf +!,"lecture notes on simplifying square roots", "TARGET='_blank'") \} +$PAR +First video lecture on simplifying square roots +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ZDyScPdbTNs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Second video lecture on simplifying square roots (watch from 2:08 to 4:48) +$PAR +\{ scalableiframe("// +www.youtube.com/embed/uL4uJ3BrTJw?start=128 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Video lecture on Quotient Rule of Radicals (watch till 3:20) +$PAR +\{ scalableiframe("// +www.youtube.com/embed/OhzCKJt4uQI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SketchingParabolas.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SketchingParabolas.pg new file mode 100644 index 0000000000..a4f6fc5503 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SketchingParabolas.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L7_SketchingParabolas.pdf +!,"lecture notes on sketching parabolas", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/BXkLUY5JxAE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/9HE1kWHMTEI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByFactoring.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByFactoring.pg new file mode 100644 index 0000000000..ba827c0bbf --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByFactoring.pg @@ -0,0 +1,107 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L2_SolveQuadraticEquationsByFactoring.pdf +!,"lecture notes on solving quadratic equation by factoring", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/2ZzuZvz33X0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/04RpkdaNzr8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vl9o9XEfXtw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByQuadraticFormula.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByQuadraticFormula.pg new file mode 100644 index 0000000000..1cb89802cb --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByQuadraticFormula.pg @@ -0,0 +1,116 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L3_SolveQuadraticEquationsByQuadraticFormula.pdf +!,"lecture notes on solving quadratic equation by Quadratic Formula", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LkmjnxZ-FuU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/uhHWlBLpvWA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CLrImGKeuEI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L3_NumberOfSolutionsOfQuadraticEquation.pdf +!,"lecture notes on the number of solutions of a quadratic equation", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/QOqA8KQMJhE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationBySquareRootProperty.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationBySquareRootProperty.pg new file mode 100644 index 0000000000..68d81513d3 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationBySquareRootProperty.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L1_SolveQuadraticEquationsBySquareRootProperty.pdf +!,"lecture notes on solving quadratic equation by square root property", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/6QTNwvnIoDk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/lpscRx-Mfdk?start=217 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByElimination.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByElimination.pg new file mode 100644 index 0000000000..324464e8a3 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByElimination.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U1L4_SolveSystemsByElimination.pdf +!,"lecture notes on solving system equations by elimination", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/sZJIzbxBQSg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByGraphing.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByGraphing.pg new file mode 100644 index 0000000000..783557f5ca --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByGraphing.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U1L2_SolveSystemByGraphing.pdf +!,"lecture notes on solving system equations by graphing", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/3VbpmoGCWPA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U1L2_CheckSolutionOfSystemEquation.pdf +!,"lecture notes on checking solution of a system equation", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Pe-7dgD6bRE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemBySubstitution.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemBySubstitution.pg new file mode 100644 index 0000000000..bfdd2c5279 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemBySubstitution.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U1L3_SolveSystemBySubstitution.pdf +!,"lecture notes on solving system equations by substitution", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Y3lx2S8uCX4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ZqEDFqX4OwE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SquareRootOperations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SquareRootOperations.pg new file mode 100644 index 0000000000..b5ab830247 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SquareRootOperations.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U5L3_SquareRootOperations.pdf +!,"lecture notes on square root operations", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/-4Z3cfQbSCk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/hmr73HQqEa0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SystemEquationApplications.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SystemEquationApplications.pg new file mode 100644 index 0000000000..00f0ef1dad --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SystemEquationApplications.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U1L5_SystemEquationApplications.pdf +!,"lecture notes on system equation applications", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CF_BCdOoxhk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/TrigonometryRatios.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/TrigonometryRatios.pg new file mode 100644 index 0000000000..0a21697878 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/TrigonometryRatios.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U5L5_TrigonometryValues.pdf +!,"lecture notes on trigonometry ratios", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Jsiy4TxgIME +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/G-T_6hCdMQc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Add_Subtract_Rational_Expressions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Add_Subtract_Rational_Expressions.pg new file mode 100644 index 0000000000..2077576e2d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Add_Subtract_Rational_Expressions.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/w7NhLkQynS8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/IKsi-DQU2zo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Calculator_Basics.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Calculator_Basics.pg new file mode 100644 index 0000000000..ad1541cd45 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Calculator_Basics.pg @@ -0,0 +1,96 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"There are unfortunately no videos available. Please use the Show Me Another button (which has solutions) and tutors for help.", "TARGET='_blank'") \} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Complex_Number_Operations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Complex_Number_Operations.pg new file mode 100644 index 0000000000..ca5ee30013 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Complex_Number_Operations.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/zK25rGJBfB0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/b9jIuySxN8c +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/My9MfX2dv54 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LuyODzozd44 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Divide_Rational_Expressions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Divide_Rational_Expressions.pg new file mode 100644 index 0000000000..2acb5776c6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Divide_Rational_Expressions.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/gcnk8TnzsLc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Domain_Range.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Domain_Range.pg new file mode 100644 index 0000000000..f0a8bb08b9 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Domain_Range.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/CTQK6Sthn7k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/QAxZEelInJc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Notation.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Notation.pg new file mode 100644 index 0000000000..ea53566efb --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Notation.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/j4t73jk2VzE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/EmTvdKkAUtE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/kzYtx_AqzjM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg new file mode 100644 index 0000000000..be4f013e69 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg @@ -0,0 +1,184 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. \ No newline at end of file diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Multiply_Rational_Expressions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Multiply_Rational_Expressions.pg new file mode 100644 index 0000000000..3f4afd04f6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Multiply_Rational_Expressions.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/f-wz_ZzSDdg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/3GL69IA2q4s +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Operations_with_Radicals.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Operations_with_Radicals.pg new file mode 100644 index 0000000000..8564b14e7c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Operations_with_Radicals.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/egNq4tSfi1I +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/qH4IQfDD1Nw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GEeKOeGHddY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/sBvRJUwXJPo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Equations_with_Complex_Solutions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Equations_with_Complex_Solutions.pg new file mode 100644 index 0000000000..6cdb26e1e0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Equations_with_Complex_Solutions.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/dnjK4DPqh0k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Formula.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Formula.pg new file mode 100644 index 0000000000..1cb89802cb --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Formula.pg @@ -0,0 +1,116 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L3_SolveQuadraticEquationsByQuadraticFormula.pdf +!,"lecture notes on solving quadratic equation by Quadratic Formula", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LkmjnxZ-FuU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/uhHWlBLpvWA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CLrImGKeuEI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L3_NumberOfSolutionsOfQuadraticEquation.pdf +!,"lecture notes on the number of solutions of a quadratic equation", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/QOqA8KQMJhE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions.pg new file mode 100644 index 0000000000..28514b713f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/02h9yhc7ruc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/w3OSfRSaVeQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions_Vertex_Form.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions_Vertex_Form.pg new file mode 100644 index 0000000000..7e087c5508 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions_Vertex_Form.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/aOS6OfB5-9o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/jP43EY-S_tg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Ur3mFyTKqQg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/lgWa6CvJjYw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/02h9yhc7ruc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/w3OSfRSaVeQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Radical_Functions_Domain_Range.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Radical_Functions_Domain_Range.pg new file mode 100644 index 0000000000..60cba97d92 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Radical_Functions_Domain_Range.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/4h54s7BBPpA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/hZEGZMb4uzQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Exponents.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Exponents.pg new file mode 100644 index 0000000000..7a4b22e603 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Exponents.pg @@ -0,0 +1,116 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/3YbwhlqlvPs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LoZn5mfbHr8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ry-oYLDi4L8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GJWekWPKopo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/AyS4qUtTYcA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Functions_Domain.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Functions_Domain.pg new file mode 100644 index 0000000000..5fb2c67649 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Functions_Domain.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/Gvhplmx9QPM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/v0IhvIzCc_I +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GeOZHxQRMvc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Complex_Number_Denominators.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Complex_Number_Denominators.pg new file mode 100644 index 0000000000..9e743b7199 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Complex_Number_Denominators.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/EyzepHsj7OI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/PCHqM_2rtbw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Radical_Denominators.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Radical_Denominators.pg new file mode 100644 index 0000000000..9509f5866b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Radical_Denominators.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/6864x4JSmxY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/zLS469sfcJI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Complex_Rational_Expressions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Complex_Rational_Expressions.pg new file mode 100644 index 0000000000..2b1bf155f5 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Complex_Rational_Expressions.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/S0LekyH8yVU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/q4aMMtSvsvI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/jSnHRp8TjXY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/aMswqN951OY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Radical_Expressions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Radical_Expressions.pg new file mode 100644 index 0000000000..7828e4f525 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Radical_Expressions.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/uggD8mwglyc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/c-wtvEdEoVs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Rational_Expressions.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Rational_Expressions.pg new file mode 100644 index 0000000000..d7ab4985db --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Rational_Expressions.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/7Uos1ED3KHI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/XChok8XlF90 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ey_b3aPsRl8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/dstNU7It-Ro +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Equations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Equations.pg new file mode 100644 index 0000000000..cf445b3a6b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Equations.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/iTV9CRmfA-w +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/1tbve9nAq-Y +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/sJWCz2UGuZg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/YW1vdoKDzjE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Inequalities.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Inequalities.pg new file mode 100644 index 0000000000..5772b07d8f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Inequalities.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/dArQeGaXOh0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/pqcCcj1UMPw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/s5Jr6RJBl28 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/wfFdzihH87s +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/SSWUbC9fQoQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/4u-s5mB6MDU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Inequalities.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Inequalities.pg new file mode 100644 index 0000000000..74af98e1e1 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Inequalities.pg @@ -0,0 +1,116 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/JBjMwlyaqnw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ewsTyLdgryw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/5P3kfiHpErs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/HX4YVZt9mgo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/S8Ul3rqVpVQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Literal_Rational_Equations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Literal_Rational_Equations.pg new file mode 100644 index 0000000000..ae48e9d5c0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Literal_Rational_Equations.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/iqneTqLbMfY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Quadratic_Equations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Quadratic_Equations.pg new file mode 100644 index 0000000000..a2bc6824b9 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Quadratic_Equations.pg @@ -0,0 +1,117 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR +$PAR +\{ scalableiframe("// +www.youtube.com/embed/6QTNwvnIoDk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/lpscRx-Mfdk?start=217 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/2ZzuZvz33X0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/04RpkdaNzr8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vl9o9XEfXtw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"There are unfortunately no videos available. Please use the Show Me Another button (which has solutions) and tutors for help.", "TARGET='_blank'") \} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Radical_Equations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Radical_Equations.pg new file mode 100644 index 0000000000..da8544cec5 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Radical_Equations.pg @@ -0,0 +1,116 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/n6NBXVUS29U +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ILBqcnXTDBE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/52xMzV5EqNE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/DNp5slhIh6k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/luQqQbBK2uo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations.pg new file mode 100644 index 0000000000..69ae3b3508 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/5vrUyeKemLs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/vvWAIdPHG68 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/MxnlmG61lXo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/R96n_Jze8E0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/Z50kmCwgivs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/dGM7obRrJqs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations_Applications.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations_Applications.pg new file mode 100644 index 0000000000..e5539b2c87 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations_Applications.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/B83AVXXJrdQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/E1j8W64NQ0Y +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/B0Z4s38YIgQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/G-JFTXtXSqk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg new file mode 100644 index 0000000000..be4f013e69 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg @@ -0,0 +1,184 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. \ No newline at end of file diff --git a/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg new file mode 100644 index 0000000000..be4f013e69 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg @@ -0,0 +1,184 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. \ No newline at end of file diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Fractions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Fractions.def new file mode 100644 index 0000000000..e755d94658 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Fractions.def @@ -0,0 +1,48 @@ +openDate = 01/01/2014 at 12:48am PST +dueDate = 06/30/2015 at 01:48am PDT +answerDate = 06/30/2015 at 01:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractFractions.pg +description = add and subtract fractions, not involving mixed numbers +problemList = +BasicAlgebra/FractionArithmetic/AddFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions08.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions12.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions24.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions01.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions05.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions90.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions90.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems60.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems70.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems60.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems70.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems75.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems80.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Integers.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Integers.def new file mode 100644 index 0000000000..0fb426d0af --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Integers.def @@ -0,0 +1,27 @@ +openDate = 01/01/2014 at 12:33am PST +dueDate = 06/30/2015 at 01:33am PDT +answerDate = 06/30/2015 at 01:33am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractIntegers.pg +description = add and subtract positive and negative numbers +problemList = +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Mixed_Numbers.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Mixed_Numbers.def new file mode 100644 index 0000000000..1d1c363f1f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Mixed_Numbers.def @@ -0,0 +1,49 @@ +openDate = 01/01/2014 at 01:03am PST +dueDate = 06/30/2015 at 02:03am PDT +answerDate = 06/30/2015 at 02:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractMixedNumbers.pg +description = add and subtract mixed numbers +problemList = +BasicMath/FractionsCalculation/MixedNumberAddition10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition40.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition46.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition48.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition49.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition60.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition70.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition80.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition90.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition110.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition120.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition160.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition190.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition220.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition230.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition240.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction60.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction70.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction80.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction140.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction160.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction190.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction210.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction220.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction230.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction240.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberAdditionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberAdditionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberAdditionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberAdditionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberAdditionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Addition_Subtraction.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Addition_Subtraction.def new file mode 100644 index 0000000000..7e25833db6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Addition_Subtraction.def @@ -0,0 +1,17 @@ +openDate = 01/01/2014 at 01:18am PST +dueDate = 06/30/2015 at 02:18am PDT +answerDate = 06/30/2015 at 02:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAdditionSubtraction.pg +description = add and subtract decimals +problemList = +BasicMath/Decimal/AddSubtractDecimals10.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals12.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals15.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals20.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals25.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals26.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals30.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals40.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Definition.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Definition.def new file mode 100644 index 0000000000..7e5bb43477 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Definition.def @@ -0,0 +1,38 @@ +openDate = 01/01/2014 at 01:15am PST +dueDate = 06/30/2015 at 02:15am PDT +answerDate = 06/30/2015 at 02:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalDefinition.pg +description = definition of decimals +problemList = +BasicMath/Decimal/WriteDecimalByGraph10.pg, 1, -1, 0 +BasicMath/Decimal/WriteDecimalByGraph20.pg, 1, -1, 0 +BasicMath/Decimal/DecimalAndMoney10.pg, 1, -1, 0 +BasicMath/Decimal/DecimalAndMoney20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine50.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine10.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine20.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine30.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine40.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine50.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine60.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals10.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals15.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals20.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals25.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals30.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals35.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals40.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals50.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals10.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals20.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals30.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals40.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals50.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals60.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals70.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals80.pg, 1, -1, 0 +BasicMath/Decimal/RoundingDecimals10.pg, 1, -1, 0 +BasicMath/Decimal/RoundingDecimals20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Multiplication_Division.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Multiplication_Division.def new file mode 100644 index 0000000000..fed2ad1720 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Multiplication_Division.def @@ -0,0 +1,28 @@ +openDate = 01/01/2014 at 01:21am PST +dueDate = 06/30/2015 at 02:21am PDT +answerDate = 06/30/2015 at 02:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalMultiplicationDivision.pg +description = multiply and divide decimals +problemList = +BasicMath/Decimal/MultiplyDivideDecimals10.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals20.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals30.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals40.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals50.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals60.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals70.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals80.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals140.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals150.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals160.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals170.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals180.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals190.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals200.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals210.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals220.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals230.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals240.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals250.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_and_Fraction.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_and_Fraction.def new file mode 100644 index 0000000000..0a5bcba842 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_and_Fraction.def @@ -0,0 +1,20 @@ +openDate = 01/01/2014 at 01:24am PST +dueDate = 06/30/2015 at 02:24am PDT +answerDate = 06/30/2015 at 02:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAndFraction.pg +description = convert between decimal and fraction +problemList = +BasicMath/FractionPercentDecimal/FractionToDecimal50.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToDecimal60.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToDecimal70.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToDecimal80.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToDecimal90.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction10.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction20.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction30.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction35.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction40.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction50.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivide_Fractions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivide_Fractions.def new file mode 100644 index 0000000000..b7a26f65bd --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivide_Fractions.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:57am PST +dueDate = 06/30/2015 at 01:57am PDT +answerDate = 06/30/2015 at 01:57am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivideFractions.pg +description = divide fractions, not including mixed numbers +problemList = +BasicAlgebra/FractionArithmetic/DivideFractions10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/DivideFractions11.pg, 1, -1, 0 +BasicMath/FractionsCalculation/DivideFractions12.pg, 1, -1, 0 +BasicMath/FractionsCalculation/DivideFractions32.pg, 1, -1, 0 +BasicMath/FractionsCalculation/DivideFractions42.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivisibility_Test.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivisibility_Test.def new file mode 100644 index 0000000000..f0f19b2a55 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivisibility_Test.def @@ -0,0 +1,16 @@ +openDate = 01/01/2014 at 12:15am PST +dueDate = 06/30/2015 at 01:15am PDT +answerDate = 06/30/2015 at 01:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivisibilityTest.pg +description = decide whether 2, 3, 5 and 9 can go into a given integer +problemList = +BasicMath/PrimeLCMGCF/divisibility10.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility20.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility40.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility60.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility70.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility80.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility80.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility80.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivision.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivision.def new file mode 100644 index 0000000000..3916b9bee3 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivision.def @@ -0,0 +1,29 @@ +openDate = 01/01/2014 at 12:09am PST +dueDate = 06/30/2015 at 01:09am PDT +answerDate = 06/30/2015 at 01:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/Division.pg +description = introduction to division and application problems +problemList = +BasicMath/MultiplicationDivision/multiplicationTable20.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/multiplicationTable25.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivideByZero10.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem10.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem20.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem30.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem40.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem50.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem52.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem60.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem62.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem70.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem80.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem90.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem100.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem110.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/RemainderWordProblem10.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/RemainderWordProblem20.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/RemainderWordProblem30.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/RemainderWordProblem40.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/RemainderWordProblem50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setExponents_and_Rounding_Whole_Numbers.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setExponents_and_Rounding_Whole_Numbers.def new file mode 100644 index 0000000000..a22c135317 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setExponents_and_Rounding_Whole_Numbers.def @@ -0,0 +1,15 @@ +openDate = 01/01/2014 at 12:03am PST +dueDate = 06/30/2015 at 01:03am PDT +answerDate = 06/30/2015 at 01:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/ExponentsAndRoundingWholeNumbers.pg +description = definition of exponent, and how to round whole numbers +problemList = +BasicMath/Miscellaneous/ExponentDefinition05.pg, 1, -1, 0 +BasicMath/Miscellaneous/ExponentDefinition05.pg, 1, -1, 0 +BasicMath/Miscellaneous/ExponentDefinition15.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/RoundWholeNumbers10.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/RoundWholeNumbers20.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/RoundWholeNumbers10.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/RoundWholeNumbers20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setFraction_Definition.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setFraction_Definition.def new file mode 100644 index 0000000000..e7bc6aa069 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setFraction_Definition.def @@ -0,0 +1,30 @@ +openDate = 01/01/2014 at 12:45am PST +dueDate = 06/30/2015 at 01:45am PDT +answerDate = 06/30/2015 at 01:45am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/FractionDefinition.pg +description = definition of fractions +problemList = +BasicMath/FractionsCalculation/WriteFractionByGraph10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/WriteFractionByGraph20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/WriteFractionByGraph30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/WriteFractionByGraph40.pg, 1, -1, 0 +BasicMath/FractionsCalculation/EquivalentFraction10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/EquivalentFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction05.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/ReduceFraction25.pg, 1, -1, 0 +BasicMath/FractionsCalculation/ReduceFraction50.pg, 1, -1, 0 +BasicMath/FractionsCalculation/FractionOnNumberLine10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/FractionOnNumberLine20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions40.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions50.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions60.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions70.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions80.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGCF_and_LCM.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGCF_and_LCM.def new file mode 100644 index 0000000000..adbd8cc1c8 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGCF_and_LCM.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:21am PST +dueDate = 06/30/2015 at 01:21am PDT +answerDate = 06/30/2015 at 01:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/GCFAndLCM.pg +description = find Great Common Factor and Least Common Multiple of a group of numbers +problemList = +BasicMath/PrimeLCMGCF/GCF10.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/GCF20.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/GCF30.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM10.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM10.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM20.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM20.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM25.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM30.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM30.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGeometry_Basics.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGeometry_Basics.def new file mode 100644 index 0000000000..7db1d8f28a --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGeometry_Basics.def @@ -0,0 +1,13 @@ +openDate = 01/01/2014 at 12:12am PST +dueDate = 06/30/2015 at 01:12am PDT +answerDate = 06/30/2015 at 01:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/GeometryBasics.pg +description = find perimeter and area of rectangles, squares and triangles +problemList = +BasicAlgebra/Geometry/RectanglePerimeterArea10.pg, 1, -1, 0 +BasicMath/Miscellaneous/SquarePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setIntegers_and_Absolute_Value.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setIntegers_and_Absolute_Value.def new file mode 100644 index 0000000000..aff2ba6dd4 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setIntegers_and_Absolute_Value.def @@ -0,0 +1,15 @@ +openDate = 01/01/2014 at 12:30am PST +dueDate = 06/30/2015 at 01:30am PDT +answerDate = 06/30/2015 at 01:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/IntegersAndAbsoluteValue.pg +description = introduction to negative numbers and absolute value +problemList = +BasicAlgebra/NumberBasics/NumberLine10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine10.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/CompareNumbers50.pg, 1, -1, 0 +BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue10.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/AbsoluteValue11.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/SignedNumberInterpretations10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMean_Median_Mode.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMean_Median_Mode.def new file mode 100644 index 0000000000..2cb661278d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMean_Median_Mode.def @@ -0,0 +1,31 @@ +openDate = 01/01/2014 at 01:30am PST +dueDate = 06/30/2015 at 02:30am PDT +answerDate = 06/30/2015 at 02:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/MeanMedianMode.pg +description = find mean, median and mode of data, when to use which +problemList = +BasicMath/MeanMedianMode/MeanMedianMode10.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode20.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode30.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode40.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode50.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode60.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode70.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode80.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode90.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode100.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode110.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode120.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode130.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode140.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode150.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode160.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode170.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode180.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode190.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode200.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode210.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode220.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode230.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMixed_Number_Definition.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMixed_Number_Definition.def new file mode 100644 index 0000000000..bab4b8b305 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMixed_Number_Definition.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 01:00am PST +dueDate = 06/30/2015 at 02:00am PDT +answerDate = 06/30/2015 at 02:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/MixedNumberDefinition.pg +description = introduction to mixed numbers, convert between mixed number and improper fraction +problemList = +BasicMath/FractionsCalculation/WriteFractionByGraph50.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction30.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction40.pg, 1, -1, 0 +BasicMath/FractionsCalculation/FractionOnNumberLine30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/FractionOnNumberLine40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiplication.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiplication.def new file mode 100644 index 0000000000..32a2e8016c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiplication.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:06am PST +dueDate = 06/30/2015 at 01:06am PDT +answerDate = 06/30/2015 at 01:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/Multiplication.pg +description = introduction to multiplication and application problems +problemList = +BasicMath/MultiplicationDivision/multiplicationTable10.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/multiplicationTable15.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem10.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem20.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem30.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem40.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem50.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem60.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem70.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem80.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Integers.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Integers.def new file mode 100644 index 0000000000..fb8b92c52c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Integers.def @@ -0,0 +1,18 @@ +openDate = 01/01/2014 at 12:36am PST +dueDate = 06/30/2015 at 01:36am PDT +answerDate = 06/30/2015 at 01:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideIntegers.pg +description = multiply and divide positive and negative numbers +problemList = +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers20.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/MultiplyWithNegativeIntegers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers20.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivideByZero10.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition10.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition20.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Mixed_Numbers.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Mixed_Numbers.def new file mode 100644 index 0000000000..5066f5c853 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Mixed_Numbers.def @@ -0,0 +1,33 @@ +openDate = 01/01/2014 at 01:06am PST +dueDate = 06/30/2015 at 02:06am PDT +answerDate = 06/30/2015 at 02:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideMixedNumbers.pg +description = multiply and divide mixed numbers +problemList = +BasicAlgebra/FractionArithmetic/MixedNumberMultiplication10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberMultiplication15.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberMultiplication20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberMultiplication25.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberMultiplication30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberMultiplication35.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MixedNumberDivision10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberDivision15.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberDivision20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberDivision25.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberDivision35.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems60.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Fractions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Fractions.def new file mode 100644 index 0000000000..254afdc1e4 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Fractions.def @@ -0,0 +1,23 @@ +openDate = 01/01/2014 at 12:51am PST +dueDate = 06/30/2015 at 01:51am PDT +answerDate = 06/30/2015 at 01:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyFractions.pg +description = multiply fractions, not including mixed numbers +problemList = +BasicAlgebra/FractionArithmetic/MultiplyFractions10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MultiplyFractions15.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MultiplyFractions16.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MultiplyThreeFractions10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MultiplyThreeFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions50.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MultiplyFractions69.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems60.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems70.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_1.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_1.def new file mode 100644 index 0000000000..ec98129e59 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_1.def @@ -0,0 +1,29 @@ +openDate = 01/01/2014 at 12:24am PST +dueDate = 06/30/2015 at 01:24am PDT +answerDate = 06/30/2015 at 01:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_1.pg +description = order of operations problems involving positive integers only +problemList = +BasicMath/OrderOfOperations_More/orderOfOperations09.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations20.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations30.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations70.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations120.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations170.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations21.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations23.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations24.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations25.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations26.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations27.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations28.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations29.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations46.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations53.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations108.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations109.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations163.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations164.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations165.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_2.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_2.def new file mode 100644 index 0000000000..03acf96950 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_2.def @@ -0,0 +1,35 @@ +openDate = 01/01/2014 at 12:39am PST +dueDate = 06/30/2015 at 01:39am PDT +answerDate = 06/30/2015 at 01:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_2.pg +description = order of operations problems involving positive and negative integers +problemList = +BasicAlgebra/OrderOfOperations/orderOfOperations40.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations50.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations60.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations22.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations47.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations48.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations49.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations80.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations90.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations100.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations110.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations140.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations150.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations160.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations180.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations190.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations51.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations52.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations54.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations82.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations199.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations241.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations240.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations200.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations210.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations220.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations230.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_3.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_3.def new file mode 100644 index 0000000000..78abbce50a --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_3.def @@ -0,0 +1,18 @@ +openDate = 01/01/2014 at 01:09am PST +dueDate = 06/30/2015 at 02:09am PDT +answerDate = 06/30/2015 at 02:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_3.pg +description = order of operations problems involving fractions +problemList = +BasicMath/Miscellaneous/ExponentDefinition40.pg, 1, -1, 0 +BasicMath/Miscellaneous/ExponentDefinition50.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations285.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations286.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations250.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/OOOFractions10.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations280.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations290.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations260.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations270.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Definition.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Definition.def new file mode 100644 index 0000000000..098366d793 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Definition.def @@ -0,0 +1,27 @@ +openDate = 01/01/2014 at 01:48am PST +dueDate = 06/30/2015 at 02:48am PDT +answerDate = 06/30/2015 at 02:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentDefinition.pg +description = introduction to percent +problemList = +BasicAlgebra/NumberBasics/PercentDecimalConversion10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToPercent10.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToPercent20.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToPercent30.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToPercent40.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/PercentToFraction10.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/PercentToFraction20.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/PercentToFraction30.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/PercentToFraction40.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionPercentDecimal10.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionPercentDecimal10.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionPercentDecimal10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Formula.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Formula.def new file mode 100644 index 0000000000..4200535a3b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Formula.def @@ -0,0 +1,31 @@ +openDate = 01/01/2014 at 01:51am PST +dueDate = 06/30/2015 at 02:51am PDT +answerDate = 06/30/2015 at 02:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentFormula.pg +description = use Percent Formula to solve basic percent problems +problemList = +BasicMath/Percent/MTH20PercentOfNumberType1_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_90.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Word_Problem.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Word_Problem.def new file mode 100644 index 0000000000..f6cc1b83c8 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Word_Problem.def @@ -0,0 +1,43 @@ +openDate = 01/01/2014 at 01:54am PST +dueDate = 06/30/2015 at 02:54am PDT +answerDate = 06/30/2015 at 02:54am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentWordProblems.pg +description = application problems involving percent +problemList = +BasicMath/Percent/MTH20PercentApplicationType1_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_90.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_100.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_110.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_120.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_90.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_100.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_110.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_120.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_90.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_100.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_of_Increase_Decrease.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_of_Increase_Decrease.def new file mode 100644 index 0000000000..1d2598bfdb --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_of_Increase_Decrease.def @@ -0,0 +1,26 @@ +openDate = 01/01/2014 at 01:57am PST +dueDate = 06/30/2015 at 02:57am PDT +answerDate = 06/30/2015 at 02:57am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentOfIncreaseDecrease.pg +description = percent of increase and decrease application problems +problemList = +BasicMath/Percent/MTH20PercentIncreaseDecrease10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease90.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease95.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease100.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease110.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease120.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease130.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease140.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease150.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease160.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease170.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPrime_Numbers.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPrime_Numbers.def new file mode 100644 index 0000000000..b9c2811cdf --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPrime_Numbers.def @@ -0,0 +1,15 @@ +openDate = 01/01/2014 at 12:18am PST +dueDate = 06/30/2015 at 01:18am PDT +answerDate = 06/30/2015 at 01:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/PrimeNumbers.pg +description = introduction to prime and composite numbers, prime factor an integer +problemList = +BasicMath/PrimeLCMGCF/primeOrComposite10.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/primeOrComposite10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/FactorInteger10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/FactorInteger20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/FactorInteger30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/FactorInteger40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/FactorInteger60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setProportion.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setProportion.def new file mode 100644 index 0000000000..ace52481ef --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setProportion.def @@ -0,0 +1,29 @@ +openDate = 01/01/2014 at 01:39am PST +dueDate = 06/30/2015 at 02:39am PDT +answerDate = 06/30/2015 at 02:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/Proportion.pg +description = introduction to proportion and proportion application problems +problemList = +BasicAlgebra/SolveLinearEquations/SolveProportion10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion40.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion10.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion11.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion13.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion14.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion20.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion21.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion30.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion31.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion40.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion41.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion50.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion51.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion60.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion61.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion70.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion71.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion80.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setRate_and_Ratio.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setRate_and_Ratio.def new file mode 100644 index 0000000000..38f785e2aa --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setRate_and_Ratio.def @@ -0,0 +1,31 @@ +openDate = 01/01/2014 at 01:36am PST +dueDate = 06/30/2015 at 02:36am PDT +answerDate = 06/30/2015 at 02:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/RateAndRatio.pg +description = definition of rate and ratio, find rate and ratio +problemList = +BasicMath/Rate/FindRateOfChange10.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange20.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange30.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange40.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange50.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange60.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange70.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange10.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange11.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange20.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange21.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange30.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange31.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange40.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange50.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange60.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/Ratio10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/Ratio20.pg, 1, -1, 0 +BasicMath/Rate/UseRatio10.pg, 1, -1, 0 +BasicMath/Rate/UseRatio11.pg, 1, -1, 0 +BasicMath/Rate/UseRatio20.pg, 1, -1, 0 +BasicMath/Rate/UseRatio21.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setSquare_Root.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setSquare_Root.def new file mode 100644 index 0000000000..5a51a418e0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setSquare_Root.def @@ -0,0 +1,17 @@ +openDate = 01/01/2014 at 01:27am PST +dueDate = 06/30/2015 at 02:27am PDT +answerDate = 06/30/2015 at 02:27am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/SquareRoot.pg +description = introduction to square root +problemList = +BasicMath/IntegerAndSquareRoot/identifySquareNumbers10.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers30.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers30.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers50.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers60.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setUnit_Conversion.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setUnit_Conversion.def new file mode 100644 index 0000000000..e3eb7babab --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setUnit_Conversion.def @@ -0,0 +1,45 @@ +openDate = 01/01/2014 at 01:42am PST +dueDate = 06/30/2015 at 02:42am PDT +answerDate = 06/30/2015 at 02:42am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/UnitConversion.pg +description = convert within English unit system and international unit system +problemList = +BasicMath/UnitConversion/UnitConversionAmerican10.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican30.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican40.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican60.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican70.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican100.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican120.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican130.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication10.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication20.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication30.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication40.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication50.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication60.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric30.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric90.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric100.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric150.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric210.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric250.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric320.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric350.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication10.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication20.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication30.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication40.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication50.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication60.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication70.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTime20.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTime40.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTime70.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTime100.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTimeApplication10.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTimeApplication20.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTimeApplication30.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTimeApplication40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAbsolute_Value.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAbsolute_Value.def new file mode 100644 index 0000000000..d24431c409 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAbsolute_Value.def @@ -0,0 +1,12 @@ + +openDate = 12/11/2013 at 12:12am PST +dueDate = 06/30/2014 at 01:06am PDT +answerDate = 06/30/2014 at 01:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AbsoluteValue.pg +description = basic absolute value calculations +problemList = +BasicAlgebra/NumberBasics/AbsoluteValue10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAccount_Interest_Word_Problems.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAccount_Interest_Word_Problems.def new file mode 100644 index 0000000000..567cc4e823 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAccount_Interest_Word_Problems.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 01:28am PST +dueDate = 06/30/2014 at 02:38am PDT +answerDate = 06/30/2014 at 02:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AccountInterestWordProblems.pg +description = word problems involving accounts earning a net interest rate +problemList = +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAdd_Subtract_Fractions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAdd_Subtract_Fractions.def new file mode 100644 index 0000000000..f21431ff96 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAdd_Subtract_Fractions.def @@ -0,0 +1,42 @@ + +openDate = 12/11/2013 at 12:06am PST +dueDate = 06/30/2014 at 01:03am PDT +answerDate = 06/30/2014 at 01:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AddSubtractFractions.pg +description = adding and subtracting fractions +problemList = +BasicAlgebra/FractionArithmetic/AddFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions04.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions08.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions09.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions12.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions22.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions24.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions26.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions01.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions05.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions90.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions90.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions100.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def new file mode 100644 index 0000000000..479a1ee2ac --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def @@ -0,0 +1,38 @@ + +openDate = 12/11/2013 at 12:42am PST +dueDate = 06/30/2014 at 01:44am PDT +answerDate = 06/30/2014 at 01:44am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicPercentageWordProblems.pg +description = percent and decimal conversion; percent calculations +problemList = +BasicAlgebra/NumberBasics/PercentDecimalConversion10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber110.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber120.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber90.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber100.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Word_Problems.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Word_Problems.def new file mode 100644 index 0000000000..2b1d8035de --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Word_Problems.def @@ -0,0 +1,35 @@ + +openDate = 12/11/2013 at 12:36am PST +dueDate = 06/30/2014 at 01:40am PDT +answerDate = 06/30/2014 at 01:40am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicWordProblems.pg +description = translating English to math equations; solving some basic word problems +problemList = +BasicAlgebra/EnglishToMath/EnglishToMathEquation10.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation20.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation30.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation40.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation50.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation60.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation70.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation80.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation90.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation100.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation110.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation120.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation130.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation140.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation150.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation160.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation170.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation180.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation30.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation40.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setCoordinate_System.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setCoordinate_System.def new file mode 100644 index 0000000000..72a8c5a5dd --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setCoordinate_System.def @@ -0,0 +1,14 @@ + +openDate = 12/11/2013 at 01:00am PST +dueDate = 06/30/2014 at 02:10am PDT +answerDate = 06/30/2014 at 02:10am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/CoordinateSystem.pg +description = the basics of the Cartesian coordinate system +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/Quadrant10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setDistance_Word_Problems.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setDistance_Word_Problems.def new file mode 100644 index 0000000000..28b4367034 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setDistance_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 01:26am PST +dueDate = 06/30/2014 at 02:37am PDT +answerDate = 06/30/2014 at 02:37am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/DistanceWordProblems.pg +description = word problems involving distance traveled +problemList = +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setEvaluating_Expressions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setEvaluating_Expressions.def new file mode 100644 index 0000000000..4dcf1a4cda --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setEvaluating_Expressions.def @@ -0,0 +1,27 @@ + +openDate = 12/11/2013 at 12:02am PST +dueDate = 06/30/2014 at 01:01am PDT +answerDate = 06/30/2014 at 01:01am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/EvaluatingExpressions.pg +description = evaluating symbols in mathematical expressions +problemList = +BasicAlgebra/EvaluateExpressions/evaluate10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate12.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate15.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate18.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate20.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate50.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate60.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate80.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate90.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar0.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar5.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluateInContext10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluateInContext20.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/FahrenheitCelsius10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula40.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_1.1-2.3.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_1.1-2.3.def new file mode 100644 index 0000000000..c2785b5976 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_1.1-2.3.def @@ -0,0 +1,124 @@ +assignmentType = gateway +openDate = 09/21/2020 at 12:00am PDT +reducedScoringDate =12/31/2025 at 11:59pm PDT +dueDate = 12/31/2025 at 11:59pm PDT +answerDate = 12/31/2025 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_1.1-2.3_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_1.1-2.3_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = This Exam includes questions covered in sections 1.1 through 2.3 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/EvaluateExpressions/evaluate130.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/EvaluateExpressions/FahrenheitCelsius10.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/1-Variables_Expressions_and_Equations/1_3-Comparison_Symbols_and_Notation_for_Intervals/1_3_4_19.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality130.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction200.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv160.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps110.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps50.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses150.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality250.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction300.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/LinearInequalities/LinearInequalities8.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicMath/Proportion/MTH20Proportion40.pg +value = 4 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_2.4-3.7.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_2.4-3.7.def new file mode 100644 index 0000000000..3a3207f7bb --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_2.4-3.7.def @@ -0,0 +1,124 @@ +assignmentType = gateway +openDate = 09/21/2020 at 12:00am PDT +reducedScoringDate =12/31/2025 at 11:59pm PDT +dueDate = 12/31/2025 at 11:59pm PDT +answerDate = 12/31/2025 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_2.4-3.7_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_2.4-3.7_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = This Exam includes questions covered in sections 2.4 through 3.7 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation80.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation170.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation200.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_1-Cartesian_Coordinates/3_1_2.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot140.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine60.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_3-Exploring_TwoVariable_Data_and_Rate_of_Change/3_3_5_1.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_3-Exploring_TwoVariable_Data_and_Rate_of_Change/3_3_5_15.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA50.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA20.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_6-PointSlope_Form/3_6_5_44.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_7-Standard_Form/3_7_5_4.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept140.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts80.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication50.pg +value = 4 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Basics.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Basics.def new file mode 100644 index 0000000000..1451106031 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Basics.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 12:18am PST +dueDate = 06/30/2014 at 01:14am PDT +answerDate = 06/30/2014 at 01:14am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentBasics.pg +description = the basics of exponents +problemList = +BasicAlgebra/Exponents/ExponentDefinition10.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition20.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Rules.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Rules.def new file mode 100644 index 0000000000..10b72c3844 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Rules.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:20am PST +dueDate = 06/30/2014 at 01:16am PDT +answerDate = 06/30/2014 at 01:16am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentRules.pg +description = the rules of working with exponents +problemList = +BasicAlgebra/Exponents/exponentsMultiplication10.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication09.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication0.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication15.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication20.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication23.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication24.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFinal_Exam_202003_30022.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFinal_Exam_202003_30022.def new file mode 100644 index 0000000000..446436bac6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFinal_Exam_202003_30022.def @@ -0,0 +1,144 @@ +assignmentType = gateway +openDate = 09/21/2020 at 12:00am PDT +reducedScoringDate =12/31/2025 at 11:59pm PDT +dueDate = 12/31/2025 at 11:59pm PDT +answerDate = 12/31/2025 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Final_Exam_202003_30022_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Final_Exam_202003_30022_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = A Final Exam with questions from chapters 1 through 4 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/EvaluateExpressions/evaluate130.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty70.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation70.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps130.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses90.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation50.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality270.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem50.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction290.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation120.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation210.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_1-Cartesian_Coordinates/3_1_1.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_3-Exploring_TwoVariable_Data_and_Rate_of_Change/3_3_5_1.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine60.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_6-PointSlope_Form/3_6_5_40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts90.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA150.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations16.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication90.pg +value = 4 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Graph.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Graph.def new file mode 100644 index 0000000000..8e8987a989 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Graph.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 01:12am PST +dueDate = 06/30/2014 at 02:22am PDT +answerDate = 06/30/2014 at 02:22am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByGraph.pg +description = using a grpah to identify the equation of a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def new file mode 100644 index 0000000000..a17e032d8a --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 01:14am PST +dueDate = 06/30/2014 at 02:24am PDT +answerDate = 06/30/2014 at 02:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByPointSlope.pg +description = use information about a point and slope to find an equation of a line +problemList = +BasicAlgebra/PointSlopeForm/PointSlopeBasics10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeBasics20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeBasics30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept40.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation40.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation50.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Two_Points.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Two_Points.def new file mode 100644 index 0000000000..d706a91dc2 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Two_Points.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 01:16am PST +dueDate = 06/30/2014 at 02:26am PDT +answerDate = 06/30/2014 at 02:26am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByTwoPoints.pg +description = use information about two points to find an equation for a line +problemList = +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation35.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFunctions_Intro.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFunctions_Intro.def new file mode 100644 index 0000000000..15afffba4f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFunctions_Intro.def @@ -0,0 +1,28 @@ +openDate = 12/11/2013 at 01:24am PST +dueDate = 06/30/2014 at 02:36am PDT +answerDate = 06/30/2014 at 02:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FunctionsIntro.pg +description = an introduction to functions +problemList = +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Lines_by_Table.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Lines_by_Table.def new file mode 100644 index 0000000000..cec8e9661b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Lines_by_Table.def @@ -0,0 +1,29 @@ + +openDate = 12/11/2013 at 01:02am PST +dueDate = 06/30/2014 at 02:12am PDT +answerDate = 06/30/2014 at 02:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphLineByTable.pg +description = graphing lines by making a table of values; checking if a point is on a line +problemList = +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable20.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine110.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot30.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot150.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def new file mode 100644 index 0000000000..45c26f1206 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def @@ -0,0 +1,26 @@ + +openDate = 12/11/2013 at 01:22am PST +dueDate = 06/30/2014 at 02:34am PDT +answerDate = 06/30/2014 at 02:34am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphTwoVariableInequalities.pg +description = inequalities in two variables +problemList = +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot70.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot90.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraphing_Line_Summary.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraphing_Line_Summary.def new file mode 100644 index 0000000000..540c4ec403 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraphing_Line_Summary.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 01:10am PST +dueDate = 06/30/2014 at 02:20am PDT +answerDate = 06/30/2014 at 02:20am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphingLineSummary.pg +description = a summary of techniques that can be used to graph a line from its equation +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInequality_Applications.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInequality_Applications.def new file mode 100644 index 0000000000..eee2160463 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInequality_Applications.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 12:58am PST +dueDate = 06/30/2014 at 01:52am PDT +answerDate = 06/30/2014 at 01:52am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/InequalityApplications.pg +description = applications of inequalities +problemList = +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInteger_Operations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInteger_Operations.def new file mode 100644 index 0000000000..2ec3e34279 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInteger_Operations.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 12:16am PST +dueDate = 06/30/2014 at 01:08am PDT +answerDate = 06/30/2014 at 01:08am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/IntegerOperations.pg +description = multiplying, dividing, adding, and subtracting with both positive and negative integers +problemList = +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/SignedNumberInterpretations10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setLinear_Equation_Applications.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setLinear_Equation_Applications.def new file mode 100644 index 0000000000..b378ac9e07 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setLinear_Equation_Applications.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 01:18am PST +dueDate = 06/30/2014 at 02:30am PDT +answerDate = 06/30/2014 at 02:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/LinearEquationApplications.pg +description = applications of finding equations of lines +problemList = +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication80.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def new file mode 100644 index 0000000000..e928bef3ed --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 12:04am PST +dueDate = 06/30/2014 at 01:02am PDT +answerDate = 06/30/2014 at 01:02am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixedNumbersEquivalentFractions.pg +description = translating between mixed numbers and improper fractions; reducing fractions +problemList = +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction05.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction30.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixture_Word_Problems.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixture_Word_Problems.def new file mode 100644 index 0000000000..dbda55cc4f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixture_Word_Problems.def @@ -0,0 +1,19 @@ + +openDate = 12/11/2013 at 01:30am PST +dueDate = 06/30/2014 at 02:39am PDT +answerDate = 06/30/2014 at 02:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixtureWordProblems.pg +description = word problems involving mixtures of solutions or populations +problemList = +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMultiply_Divide_Fractions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMultiply_Divide_Fractions.def new file mode 100644 index 0000000000..984edc6dbb --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMultiply_Divide_Fractions.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:08am PST +dueDate = 06/30/2014 at 01:04am PDT +answerDate = 06/30/2014 at 01:04am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MultiplyDivideFractions.pg +description = multiplying and dividing with fractions +problemList = +BasicAlgebra/FractionArithmetic/MultiplyFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setNumber_Sets.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setNumber_Sets.def new file mode 100644 index 0000000000..076f2c2bec --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setNumber_Sets.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 12:10am PST +dueDate = 06/30/2014 at 01:05am PDT +answerDate = 06/30/2014 at 01:05am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/NumberSets.pg +description = identifying types of numbers; using number lines +problemList = +BasicAlgebra/NumberBasics/TypesOfNumbers10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setOrder_of_Operations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setOrder_of_Operations.def new file mode 100644 index 0000000000..e4ac385610 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setOrder_of_Operations.def @@ -0,0 +1,39 @@ + +openDate = 12/11/2013 at 12:22am PST +dueDate = 06/30/2014 at 01:18am PDT +answerDate = 06/30/2014 at 01:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/OrderOfOperations.pg +description = using the order of operations +problemList = +BasicAlgebra/OrderOfOperations/orderOfOperations10.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations20.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations30.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations40.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations50.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations60.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations70.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations80.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations90.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations100.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations110.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations120.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations140.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations130.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations150.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations160.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations170.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations180.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations190.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations230.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations200.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations210.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations220.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations240.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations250.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/OOOFractions10.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations260.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations270.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations280.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations290.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setParallel_Perpendicular_Lines.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setParallel_Perpendicular_Lines.def new file mode 100644 index 0000000000..6716f9f757 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setParallel_Perpendicular_Lines.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 01:20am PST +dueDate = 06/30/2014 at 02:32am PDT +answerDate = 06/30/2014 at 02:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ParallelPerpendicularLines.pg +description = questions regarding parallel or perpendicular pairs of lines and their slopes +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular90.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular100.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular110.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular120.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular130.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular140.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular150.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular160.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular170.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular180.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular190.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular200.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular210.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPercent_of_Increase_Decrease.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPercent_of_Increase_Decrease.def new file mode 100644 index 0000000000..1ea63d363f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPercent_of_Increase_Decrease.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 12:44am PST +dueDate = 06/30/2014 at 01:45am PDT +answerDate = 06/30/2014 at 01:45am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/PercentOfIncreaseDecrease.pg +description = calculating the percent increase or decrease of a change +problemList = +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPerimeter_and_Area.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPerimeter_and_Area.def new file mode 100644 index 0000000000..e2233ccacf --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPerimeter_and_Area.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:46am PST +dueDate = 06/30/2014 at 01:46am PDT +answerDate = 06/30/2014 at 01:46am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/PerimeterArea.pg +description = questions about the areas and perimeters of basic two-dimensional shapes +problemList = +BasicAlgebra/Geometry/RectanglePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea40.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea40.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea50.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setProportion_Word_Problems.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setProportion_Word_Problems.def new file mode 100644 index 0000000000..7082c491b0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setProportion_Word_Problems.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 12:52am PST +dueDate = 06/30/2014 at 01:49am PDT +answerDate = 06/30/2014 at 01:49am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ProportionWordProblems.pg +description = word problems that involve a proportional equation +problemList = +BasicAlgebra/LinearEquationApplications/ProportionWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem90.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem100.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem110.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem120.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def new file mode 100644 index 0000000000..6e10a82e6e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 12:40am PST +dueDate = 06/30/2014 at 01:43am PDT +answerDate = 06/30/2014 at 01:43am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/RateAndStartValueWordProblem.pg +description = word problems involving an initial value that cahnges with a fixed rate +problemList = +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSimplify_Expressions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSimplify_Expressions.def new file mode 100644 index 0000000000..8cee679e94 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSimplify_Expressions.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 12:14am PST +dueDate = 06/30/2014 at 01:07am PDT +answerDate = 06/30/2014 at 01:07am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SimplifyExpressions.pg +description = simplifying expressions +problemList = +BasicAlgebra/PolynomialBasics/SimplifyExpression10.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression30.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty10.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty20.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty30.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty40.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty50.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty60.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty70.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty80.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty90.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/SimplifyInContext10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope.def new file mode 100644 index 0000000000..5af94ddb27 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 01:04am PST +dueDate = 06/30/2014 at 02:14am PDT +answerDate = 06/30/2014 at 02:14am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Slope.pg +description = using a graph to compute slope; using the slope formula to compute slope +problemList = +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope_Intercept_Equations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope_Intercept_Equations.def new file mode 100644 index 0000000000..03f0a00beb --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope_Intercept_Equations.def @@ -0,0 +1,27 @@ + +openDate = 12/11/2013 at 01:06am PST +dueDate = 06/30/2014 at 02:16am PDT +answerDate = 06/30/2014 at 02:16am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SlopeInterceptEquation.pg +description = find the slope and y-intercept of a line; use the point-slope form to garph a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept90.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Equations_with_Fractions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Equations_with_Fractions.def new file mode 100644 index 0000000000..dc490db970 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Equations_with_Fractions.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 12:32am PST +dueDate = 06/30/2014 at 01:36am PDT +answerDate = 06/30/2014 at 01:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveEquationsWithFractions.pg +description = solving linear equations that involve fractions +problemList = +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction05.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction290.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction300.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction310.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction210.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction220.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction240.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction260.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction270.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Inequalities.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Inequalities.def new file mode 100644 index 0000000000..296618b649 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Inequalities.def @@ -0,0 +1,45 @@ + +openDate = 12/11/2013 at 12:54am PST +dueDate = 06/30/2014 at 01:50am PDT +answerDate = 06/30/2014 at 01:50am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveInequalities.pg +description = set-builder and interval notation; solving linear inequalities +problemList = +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation110.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality150.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality180.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality200.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality220.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality260.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality280.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality320.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Multi_Step_Equations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Multi_Step_Equations.def new file mode 100644 index 0000000000..c8d08d623e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Multi_Step_Equations.def @@ -0,0 +1,35 @@ + +openDate = 12/11/2013 at 12:28am PST +dueDate = 06/30/2014 at 01:32am PDT +answerDate = 06/30/2014 at 01:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveMultiStepEquations.pg +description = solving linear equations that may require multiple steps +problemList = +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses200.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_One_Step_Equations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_One_Step_Equations.def new file mode 100644 index 0000000000..054ba50db2 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_One_Step_Equations.def @@ -0,0 +1,52 @@ + +openDate = 12/11/2013 at 12:24am PST +dueDate = 06/30/2014 at 01:26am PDT +answerDate = 06/30/2014 at 01:26am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveOneStepEquation.pg +description = solving equations that only require one step to solve +problemList = +BasicAlgebra/VerifySolutionsOneVariable/solutionQ10.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ20.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ30.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ40.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ50.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ60.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ70.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv190.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Proportions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Proportions.def new file mode 100644 index 0000000000..e10430de0d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Proportions.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:50am PST +dueDate = 06/30/2014 at 01:48am PDT +answerDate = 06/30/2014 at 01:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveProportions.pg +description = solving proporiton equations +problemList = +BasicAlgebra/SolveLinearEquations/SolveProportion10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Two-Step_Equations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Two-Step_Equations.def new file mode 100644 index 0000000000..d261d00360 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Two-Step_Equations.def @@ -0,0 +1,19 @@ + +openDate = 12/11/2013 at 12:26am PST +dueDate = 06/30/2014 at 01:30am PDT +answerDate = 06/30/2014 at 01:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveTwoStepEquations.pg +description = solving equations that require two steps to solve +problemList = +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps130.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_for_Variable.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_for_Variable.def new file mode 100644 index 0000000000..eccdea6c6b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_for_Variable.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 12:34am PST +dueDate = 06/30/2014 at 01:38am PDT +answerDate = 06/30/2014 at 01:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveForVariable.pg +description = symbolically solving a linear equation to isolate a variable +problemList = +BasicAlgebra/SolveLinearEquations/LiteralEquation10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation190.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation210.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Case_Inequalities.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Case_Inequalities.def new file mode 100644 index 0000000000..75f08f8146 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Case_Inequalities.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:56am PST +dueDate = 06/30/2014 at 01:51am PDT +answerDate = 06/30/2014 at 01:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialCaseInequalities.pg +description = linear inequalities that may have something special about them +problemList = +BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Solutions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Solutions.def new file mode 100644 index 0000000000..0ed77f524d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Solutions.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:30am PST +dueDate = 06/30/2014 at 01:34am PDT +answerDate = 06/30/2014 at 01:34am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialSolutions.pg +description = linear equations that may have something special about them +problemList = +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation70.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setStandard_Form_Equations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setStandard_Form_Equations.def new file mode 100644 index 0000000000..de8c027e91 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setStandard_Form_Equations.def @@ -0,0 +1,47 @@ + +openDate = 12/11/2013 at 01:08am PST +dueDate = 06/30/2014 at 02:18am PDT +answerDate = 06/30/2014 at 02:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/StandardFormEquations.pg +description = find the slope and y-intercept of a line; find a line's x- and y-intercepts; use intercepts to graph a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept110.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept120.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept130.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept140.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept150.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept160.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept170.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept180.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept190.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept200.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts150.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts130.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSum_and_Part_Word_Problems.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSum_and_Part_Word_Problems.def new file mode 100644 index 0000000000..b8d9aae6bc --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSum_and_Part_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 12:38am PST +dueDate = 06/30/2014 at 01:42am PDT +answerDate = 06/30/2014 at 01:42am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SumAndPartWordProblems.pg +description = solving word problems involving two numbers that combine in some way +problemList = +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTranslating_Words_into_Algebra.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTranslating_Words_into_Algebra.def new file mode 100644 index 0000000000..1dc609ee0c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTranslating_Words_into_Algebra.def @@ -0,0 +1,31 @@ +openDate = 12/11/2013 at 12:00am PST +dueDate = 06/30/2014 at 01:00am PDT +answerDate = 06/30/2014 at 01:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/TranslatingWordsIntoAlgebra.pg +description = translating English into algebra +problemList = +BasicAlgebra/EnglishToMath/englishToMath10.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath20.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath25.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath30.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath40.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath45.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath50.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath55.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath60.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath70.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath140.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath150.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath160.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath170.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath80.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath82.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath84.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath90.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath100.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath110.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath120.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath130.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath180.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTrigonometry.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTrigonometry.def new file mode 100644 index 0000000000..ded9435294 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTrigonometry.def @@ -0,0 +1,13 @@ +openDate = 12/11/2013 at 12:48am PST +dueDate = 06/30/2014 at 02:38am PDT +answerDate = 06/30/2014 at 02:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Trigonometry.pg +description = questions about the definition of trigonometry ratios (sine, cosine and tangent) +problemList = +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setVolume.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setVolume.def new file mode 100644 index 0000000000..a35af66f6f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setVolume.def @@ -0,0 +1,16 @@ + +openDate = 12/11/2013 at 12:48am PST +dueDate = 06/30/2014 at 01:47am PDT +answerDate = 06/30/2014 at 01:47am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Volume.pg +description = questions about the volumes of prisms and cylinders +problemList = +BasicAlgebra/Geometry/RectangularPrismVolume10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectangularPrismVolume20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectangularPrismVolume30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume10.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume20.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setAdd_Subtract_Polynomials.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setAdd_Subtract_Polynomials.def new file mode 100644 index 0000000000..445d55a7e0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setAdd_Subtract_Polynomials.def @@ -0,0 +1,26 @@ + +openDate = 12/11/2013 at 02:44am PST +dueDate = 06/30/2014 at 03:21am PDT +answerDate = 06/30/2014 at 03:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/AddSubtractPolynomials.pg +description = adding and subtracting polynomial expressions +problemList = +BasicAlgebra/PolynomialBasics/PolyAddSubtract0.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract5.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract10.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract15.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression30.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract25.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract35.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract85.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract90.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract95.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract100.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar25.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setDivide_Polynomials.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setDivide_Polynomials.def new file mode 100644 index 0000000000..11c2f3a665 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setDivide_Polynomials.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 02:48am PST +dueDate = 06/30/2014 at 03:30am PDT +answerDate = 06/30/2014 at 03:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/DividePolynomials.pg +description = division of polynomials by a monomial +problemList = +BasicAlgebra/Exponents/exponentDivision105.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision100.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision125.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision120.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision130.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision135.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision140.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision150.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setExponent_Review.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setExponent_Review.def new file mode 100644 index 0000000000..93c938dfcd --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setExponent_Review.def @@ -0,0 +1,31 @@ +openDate = 12/11/2013 at 02:42am PST +dueDate = 06/30/2014 at 03:15am PDT +answerDate = 06/30/2014 at 03:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ExponentReview.pg +description = rules of working with exponents +problemList = +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication20.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication50.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision75.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision70.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision60.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision105.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision100.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision50.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision80.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision10.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision0.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision15.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication35.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Special_Polynomials.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Special_Polynomials.def new file mode 100644 index 0000000000..18ace46835 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Special_Polynomials.def @@ -0,0 +1,33 @@ + +openDate = 12/11/2013 at 03:02am PST +dueDate = 06/30/2014 at 03:45am PDT +answerDate = 06/30/2014 at 03:45am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorSpecialPolynomials.pg +description = factoring special polynomials where a special form can be applied +problemList = +BasicAlgebra/Factoring/factoring445.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring450.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring455.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring460.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring465.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring470.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring475.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring480.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring485.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring490.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring495.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring500.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring505.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring520.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring525.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring530.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring535.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring540.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring555.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring560.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring590.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring595.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring600.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring615.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def new file mode 100644 index 0000000000..a00b17d07f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def @@ -0,0 +1,29 @@ +openDate = 12/11/2013 at 02:58am PST +dueDate = 06/30/2014 at 03:39am PDT +answerDate = 06/30/2014 at 03:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialWhenAIs1.pg +description = factoring trinomials with a leading coefficient of 1 +problemList = +BasicAlgebra/Factoring/factoring170.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring175.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring180.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring170.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring175.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring180.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring355.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring360.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring365.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring370.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring360.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring365.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring370.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring375.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring385.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring390.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring400.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring405.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring410.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring415.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring420.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def new file mode 100644 index 0000000000..6a96d03b04 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:00am PST +dueDate = 06/30/2014 at 03:42am PDT +answerDate = 06/30/2014 at 03:42am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialsWhenAIsNot1.pg +description = factoring trinomials whose leading coefficient is not 1 +problemList = +BasicAlgebra/Factoring/factoring185.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring190.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring195.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring200.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring205.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring210.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring235.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring240.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring245.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring280.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring285.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring295.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring325.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_by_Grouping.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_by_Grouping.def new file mode 100644 index 0000000000..a5d05392d2 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_by_Grouping.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 02:56am PST +dueDate = 06/30/2014 at 03:36am PDT +answerDate = 06/30/2014 at 03:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorByGrouping.pg +description = factoring polynomials using the grouping technique +problemList = +BasicAlgebra/Factoring/factoring105.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring110.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring115.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring120.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring125.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring130.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring135.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring140.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring150.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring120.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring125.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring135.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring140.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring150.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_out_Common_Factors.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_out_Common_Factors.def new file mode 100644 index 0000000000..adcd221338 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_out_Common_Factors.def @@ -0,0 +1,28 @@ + +openDate = 12/11/2013 at 02:54am PST +dueDate = 06/30/2014 at 03:33am PDT +answerDate = 06/30/2014 at 03:33am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorOutCommonFactors.pg +description = factoring out the greatest common factor +problemList = +BasicAlgebra/Factoring/factoring5.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring10.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring15.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring20.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring25.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring30.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring36.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring37.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring38.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring41.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring56.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring71.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring76.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring77.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring80.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring85.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring90.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring95.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring100.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFalling_Object_Applications.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFalling_Object_Applications.def new file mode 100644 index 0000000000..5136393b3d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFalling_Object_Applications.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:36am PST +dueDate = 06/30/2014 at 04:36am PDT +answerDate = 06/30/2014 at 04:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FallingObjectApplications.pg +description = applications of quadratic expressions to falling objects +problemList = +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFunctions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFunctions.def new file mode 100644 index 0000000000..4c3b2a8714 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFunctions.def @@ -0,0 +1,29 @@ + +openDate = 12/11/2013 at 03:38am PST +dueDate = 06/30/2014 at 04:37am PDT +answerDate = 06/30/2014 at 04:37am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/Functions.pg +description = introduction to functions +problemList = +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setIntroduction_to_Square_Root.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setIntroduction_to_Square_Root.def new file mode 100644 index 0000000000..7f12438bf9 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setIntroduction_to_Square_Root.def @@ -0,0 +1,16 @@ + +openDate = 12/11/2013 at 03:04am PST +dueDate = 06/30/2014 at 03:48am PDT +answerDate = 06/30/2014 at 03:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/IntroductionToSquareRoot.pg +description = evaluating square roots +problemList = +BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMaximum_Minimum_Applications.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMaximum_Minimum_Applications.def new file mode 100644 index 0000000000..cb7a7aa3c0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMaximum_Minimum_Applications.def @@ -0,0 +1,14 @@ + +openDate = 12/11/2013 at 03:34am PST +dueDate = 06/30/2014 at 04:33am PDT +answerDate = 06/30/2014 at 04:33am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MaximumMinimumApplications.pg +description = applications of quadratic expressions to finding a maximal or minimal value +problemList = +BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMoving_Parabola_Up_Down.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMoving_Parabola_Up_Down.def new file mode 100644 index 0000000000..bf99a3b23e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMoving_Parabola_Up_Down.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 03:20am PST +dueDate = 06/30/2014 at 04:12am PDT +answerDate = 06/30/2014 at 04:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MovingParabolaUpDown.pg +description = shifting a parabola up and down +problemList = +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMultiplying_Polynomials.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMultiplying_Polynomials.def new file mode 100644 index 0000000000..2bbc293875 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMultiplying_Polynomials.def @@ -0,0 +1,41 @@ + +openDate = 12/11/2013 at 02:46am PST +dueDate = 06/30/2014 at 03:24am PDT +answerDate = 06/30/2014 at 03:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MultiplyingPolynomials.pg +description = multiplication of polynomial expressions +problemList = +BasicAlgebra/PolynomialMultiplication/polyMultVar60.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication0.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication5.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication10.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication15.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication20.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication30.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication35.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication40.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication45.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication50.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication55.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication60.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication65.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication70.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication75.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication80.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication160.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication165.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication170.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication175.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication185.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication190.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication195.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication200.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication205.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication210.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication225.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar100.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar135.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar160.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setNegative_Exponents.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setNegative_Exponents.def new file mode 100644 index 0000000000..637b215a32 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setNegative_Exponents.def @@ -0,0 +1,32 @@ + +openDate = 12/11/2013 at 02:50am PST +dueDate = 06/30/2014 at 03:31am PDT +answerDate = 06/30/2014 at 03:31am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/NegativeExponents.pg +description = practice working with negative exponents +problemList = +BasicAlgebra/Exponents/negExp75.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp90.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp60.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp85.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp65.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp70.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp10.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp45.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp50.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp20.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp25.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp5.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp0.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp55.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp41.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp100.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp105.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp110.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp115.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp120.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp135.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp150.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp155.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Axis_and_Vertex.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Axis_and_Vertex.def new file mode 100644 index 0000000000..53c889ea00 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Axis_and_Vertex.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 03:28am PST +dueDate = 06/30/2014 at 04:24am PDT +answerDate = 06/30/2014 at 04:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaAxisAndVertex.pg +description = identifying the vertex and axis of symmetry of a parabola +problemList = +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Intercepts.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Intercepts.def new file mode 100644 index 0000000000..0a96aa5d43 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Intercepts.def @@ -0,0 +1,33 @@ + +openDate = 12/11/2013 at 03:30am PST +dueDate = 06/30/2014 at 04:27am PDT +answerDate = 06/30/2014 at 04:27am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaIntercepts.pg +description = identifying the intercepts of a parabola +problemList = +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts115.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts150.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts170.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts180.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts190.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts210.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts220.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts230.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Movement_Summary.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Movement_Summary.def new file mode 100644 index 0000000000..ce70d11632 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Movement_Summary.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 03:26am PST +dueDate = 06/30/2014 at 04:21am PDT +answerDate = 06/30/2014 at 04:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaMovementSummary.pg +description = summary of graph transformations to a parabola +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Shifting_Left_Right.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Shifting_Left_Right.def new file mode 100644 index 0000000000..682473e4e0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Shifting_Left_Right.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:24am PST +dueDate = 06/30/2014 at 04:18am PDT +answerDate = 06/30/2014 at 04:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaShiftingLeftRight.pg +description = shifting a parabola left or right +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Thinner_Wider.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Thinner_Wider.def new file mode 100644 index 0000000000..d3d29c9400 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Thinner_Wider.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:22am PST +dueDate = 06/30/2014 at 04:15am PDT +answerDate = 06/30/2014 at 04:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaThinnerWider.pg +description = stretching a parabola vertically to make it appear thinner +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setQuadratic_Equation_Applications.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setQuadratic_Equation_Applications.def new file mode 100644 index 0000000000..0f58ce13dc --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setQuadratic_Equation_Applications.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 03:18am PST +dueDate = 06/30/2014 at 04:09am PDT +answerDate = 06/30/2014 at 04:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/QuadraticEquationApplications.pg +description = applications of quadratic equations +problemList = +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setRationalize_Denominator.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setRationalize_Denominator.def new file mode 100644 index 0000000000..c005bd45ce --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setRationalize_Denominator.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:10am PST +dueDate = 06/30/2014 at 03:57am PDT +answerDate = 06/30/2014 at 03:57am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/RationalizeDenominator.pg +description = rationalizing the denominator of a radical expression +problemList = +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator110.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setReview_Graphing_Lines.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setReview_Graphing_Lines.def new file mode 100644 index 0000000000..aee0c2126d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setReview_Graphing_Lines.def @@ -0,0 +1,22 @@ +openDate = 12/11/2013 at 02:32am PST +dueDate = 06/30/2014 at 03:00am PDT +answerDate = 06/30/2014 at 03:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ReviewGraphingLines.pg +description = review of graphing lines +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setScientific_Notation.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setScientific_Notation.def new file mode 100644 index 0000000000..bfbf62dabc --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setScientific_Notation.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 02:52am PST +dueDate = 06/30/2014 at 03:32am PDT +answerDate = 06/30/2014 at 03:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ScientificNotation.pg +description = practice using scientific notation +problemList = +BasicAlgebra/NumberBasics/ScientificNotation10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation90.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation100.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation110.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation120.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSimplify_Square_Roots.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSimplify_Square_Roots.def new file mode 100644 index 0000000000..74d5cfc36c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSimplify_Square_Roots.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 03:06am PST +dueDate = 06/30/2014 at 03:51am PDT +answerDate = 06/30/2014 at 03:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SimplifySquareRoots.pg +description = simplifying expressions with square roots +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSketching_Parabolas.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSketching_Parabolas.def new file mode 100644 index 0000000000..27bd59b81c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSketching_Parabolas.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 03:32am PST +dueDate = 06/30/2014 at 04:30am PDT +answerDate = 06/30/2014 at 04:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SketchingParabolas.pg +description = sketching the graph of a quadratic expression +problemList = +BasicAlgebra/GraphingQuadratics/SketchParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def new file mode 100644 index 0000000000..c1019c39e7 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def @@ -0,0 +1,34 @@ + +openDate = 12/11/2013 at 03:14am PST +dueDate = 06/30/2014 at 04:03am PDT +answerDate = 06/30/2014 at 04:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByFactoring.pg +description = solve a quadratic equation by factoring +problemList = +BasicAlgebra/QuadraticEquations/solveQuad95.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad230.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad220.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad235.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad240.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad250.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad255.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad265.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad210.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad215.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad270.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad280.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad285.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad290.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad295.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad105.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad200.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad300.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad305.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad325.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad330.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad335.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad340.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def new file mode 100644 index 0000000000..bfe9283033 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 03:16am PST +dueDate = 06/30/2014 at 04:06am PDT +answerDate = 06/30/2014 at 04:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByQuadraticFormula.pg +description = solve a quadratic equation using the quadratic formula +problemList = +BasicAlgebra/QuadraticEquations/solveQuad145.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad150.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad155.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad185.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad375.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad380.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad385.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def new file mode 100644 index 0000000000..4e04c67950 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:12am PST +dueDate = 06/30/2014 at 04:00am PDT +answerDate = 06/30/2014 at 04:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationBySquareRootProperty.pg +description = solve a quadratic equation by using the square root +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad35.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad40.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad45.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad50.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad55.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad65.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad70.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad75.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad80.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad85.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Elimination.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Elimination.def new file mode 100644 index 0000000000..d204b7d870 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Elimination.def @@ -0,0 +1,20 @@ +openDate = 12/11/2013 at 02:38am PST +dueDate = 06/30/2014 at 03:09am PDT +answerDate = 06/30/2014 at 03:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByElimination.pg +description = solve a systme of linear equations using the elimination (aka addition) method +problemList = +BasicAlgebra/SystemsOfLinearEquations/SystemEquation10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations55.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Graphing.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Graphing.def new file mode 100644 index 0000000000..af48e49847 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Graphing.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 02:34am PST +dueDate = 06/30/2014 at 03:03am PDT +answerDate = 06/30/2014 at 03:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByGraphing.pg +description = solve a system of linear equations by graphing the lines +problemList = +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem40.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Substitution.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Substitution.def new file mode 100644 index 0000000000..94f347423e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Substitution.def @@ -0,0 +1,14 @@ +openDate = 12/11/2013 at 02:36am PST +dueDate = 06/30/2014 at 03:06am PDT +answerDate = 06/30/2014 at 03:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemBySubstitution.pg +description = solve a system of linear equations by isolating one variable and using substitution +problemList = +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations11.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations12.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations13.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations14.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations16.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations25.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations30.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSquare_Root_Operations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSquare_Root_Operations.def new file mode 100644 index 0000000000..4b4ff93965 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSquare_Root_Operations.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 03:08am PST +dueDate = 06/30/2014 at 03:54am PDT +answerDate = 06/30/2014 at 03:54am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SquareRootOperations.pg +description = simplifying radical expressions +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical1.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSystem_Equation_Applications.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSystem_Equation_Applications.def new file mode 100644 index 0000000000..8e99e61a60 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSystem_Equation_Applications.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 02:40am PST +dueDate = 06/30/2014 at 03:12am PDT +answerDate = 06/30/2014 at 03:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SystemEquationApplications.pg +description = applications of solving systems of linear equations +problemList = +BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord5.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication70.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication80.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication90.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication100.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setTrigonometryRatios.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setTrigonometryRatios.def new file mode 100644 index 0000000000..27f4a3ce63 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setTrigonometryRatios.def @@ -0,0 +1,92 @@ +assignmentType = default +openDate = 12/11/2013 at 03:10am PST +dueDate = 06/30/2014 at 03:58am PDT +answerDate = 06/30/2014 at 03:58am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeaders_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/TrigonometryRatios.pg +description = +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 2 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 3 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 4 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 5 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 6 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 7 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 8 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 9 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/Exam_ORCCA_ed2_10.1-11.2.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/Exam_ORCCA_ed2_10.1-11.2.pg new file mode 100644 index 0000000000..ff3e897005 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/Exam_ORCCA_ed2_10.1-11.2.pg @@ -0,0 +1,161 @@ +##DESCRIPTION +## Algebra problem: true or false for inequality +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'inequality', 'fraction') + +## DBsubject('Algebra') +## DBchapter('Fundamentals') +## DBsection('Real Numbers') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Precalculus') +## EditionText1('3') +## AuthorText1('Stewart, Redlin, Watson') +## Section1('1.1') +## Problem1('22') + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", + #"source.pl", # allows code to be displayed on certain sites. + #"PGcourse.pl", # Customization file for the course + "PGML.pl", + "PCCmacros.pl", +"contextLimitedFactor.pl", +); + +# Print problem number and point value (weight) for the problem +TEXT(beginproblem()); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# +# Setup +# +# +Context("Numeric"); +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + + +$pi = Real("pi"); +# the common term +$a = 1; +$b = 100; +$c = 1; +$d = 1; +# this next condition ensures the numbers don't get too big +while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) +{ + $a = 1; + $b = random(1,10,1)*random(-1,1,2); + $c = random(1,10,1)*abs($b)/$b*-1; + $d = random(2,10,1); +} + +$n = random(2,8,1); +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$d*$leading*$var^(2+$n)+$d*$middle*$var^($n+1)+$d*$end$var^$n")->reduce; +$RonStep1= +Formula("$d($leading*$var^(2+$n)+$middle*$var^($n+1)+$end$var^$n)")->reduce; +$RonStep2= +Formula("$d($leading*$var^($n+1)+$b$var^$n)($var+$c)")->reduce; +$DracoStep1= +Formula("$var^($n)($d*$leading*$var^(2)+$d*$middle*$var+$d*$end)")->reduce; +$DracoStep2= +Formula("$var^($n)($d*$leading*$var+$d*$b)($var+$c)")->reduce; +$ans = Formula("$d*$var^$n($a*$var+$b)*($var+$c)")->reduce; +$FillInBlankFirst= +Formula("$var^(2)")->reduce; +$FillInBlankLast= +Formula("abs($d*$end*2)")->reduce; +############################################## +############################################################## +# +# Text +# +# + +Context()->texStrings; +BEGIN_TEXT +Unless you have been instructed otherwise, complete the following problems outside of WeBWorK (on paper, using MS Word, using a Google Doc, etc.) and upload your answers as a PDF file in D2L under the Assignments tab. + +If you understand these directions, enter the value of \(\pi\) accurate to two decimal places. + + + +\{$pi->ans_rule\} + +END_TEXT +BEGIN_PGML +1. On a quiz is the following Question: + + Factor the given polynomial. + + [`[$question]`] + + Ron answered it like this: + + [`=[$RonStep1]`] + + [`=[$RonStep2]`] + + Draco answered it like this: + + [`=[$DracoStep1]`] + + [`=[$DracoStep2]`] + + + Who is correct? Ron? Draco? Both? Neither? + Are there any errors in the student work? + Give a full explanation of your judgement of the students' work. + +1. Fill in the blank with whole numbers so that the trinomial factors. Please create two different trinomials that factor. After creating each trinomial, show how it factors. + + [`[$FillInBlankFirst]+\underline{\phantom{12345}}{}-[$FillInBlankLast]`] + +1. Here is a graph describing a function of gas prices. + + [@ image( "chgaschart.png", width=>600, +tex_size=>1000, extra_html_tags=>'alt="Plot showing average retail price for one gallon of gasoline from October 2018 through April 2020"' ) @]* + + a. State the units of the input and the units of the output. + + a. Using a complete sentence in context, describe the domain. + + a. Using interval notation, state the range. + +END_PGML + +Context()->normalStrings; + +############################################################## +# +# Answers +# +# + +ANS($pi->with(tolerance=>.01)->cmp); +# relative tolerance --3.1412 is incorrect but 3.1413 is correct +# default tolerance is .01 or one percent. + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/chgaschart.png b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/chgaschart.png new file mode 100644 index 0000000000..58d9cfa7ac Binary files /dev/null and b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/chgaschart.png differ diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def new file mode 100644 index 0000000000..38c093ce74 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def @@ -0,0 +1,24 @@ +openDate = 12/01/2015 at 12:26am PST +dueDate = 03/01/2016 at 12:26am PST +answerDate = 03/01/2016 at 12:26am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Add_Subtract_Rational_Expressions.pg +description = subtract rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions110.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions120.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions130.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions140.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions150.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setCalculator_Basics.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setCalculator_Basics.def new file mode 100644 index 0000000000..9fdb03ef6f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setCalculator_Basics.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:00am PST +dueDate = 03/01/2016 at 12:00am PST +answerDate = 03/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Calculator_Basics.pg +description = learning the basics about using graphing calculators +problemList = +BasicAlgebra/Calculator/CalculatorBasics10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics20.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics30.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics40.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics50.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics60.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics70.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics80.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics90.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorIntersection10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorIntersection20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setComplex_Number_Operations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setComplex_Number_Operations.def new file mode 100644 index 0000000000..340fac9eed --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setComplex_Number_Operations.def @@ -0,0 +1,23 @@ +openDate = 12/01/2015 at 12:44am PST +dueDate = 03/01/2016 at 12:44am PST +answerDate = 03/01/2016 at 12:44am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Complex_Number_Operations.pg +description = add, subtract, multiply complex numbers +problemList = +BasicAlgebra/ComplexNumber/complexNumberBasics10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberBasics20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberBasics30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations40.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations50.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations60.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations70.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations80.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setDivide_Rational_Expressions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setDivide_Rational_Expressions.def new file mode 100644 index 0000000000..598d861b47 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setDivide_Rational_Expressions.def @@ -0,0 +1,17 @@ +openDate = 12/01/2015 at 12:22am PST +dueDate = 03/01/2016 at 12:22am PST +answerDate = 03/01/2016 at 12:22am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Divide_Rational_Expressions.pg +description = divide rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions25.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions45.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions60.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setExam_ORCCA_ed2_10.1-11.2.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setExam_ORCCA_ed2_10.1-11.2.def new file mode 100644 index 0000000000..c0a3192045 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setExam_ORCCA_ed2_10.1-11.2.def @@ -0,0 +1,96 @@ +assignmentType = gateway +openDate = 04/22/2020 at 07:00am PDT +reducedScoringDate =04/28/2020 at 11:59pm PDT +dueDate = 04/28/2020 at 11:59pm PDT +answerDate = 05/01/2020 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Exam_ORCCA_ed2_10.1-11.2_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Exam_ORCCA_ed2_10.1-11.2_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = This Exam includes questions covered in sections 10.1 through 11.2 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring71.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring100.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring125.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring135.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring175.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring390.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring470.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring560.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad95.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad235.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad340.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve10.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/Functions211.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext20.pg +value = 5 +problem_end +problem_start +source_file = PCCSetDefinitions/MTH095/Exam_ORCCA_ed2_10.1-11.2.pg +value = 1 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFinal_Exam_202004_40038.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFinal_Exam_202004_40038.def new file mode 100644 index 0000000000..29501fcb8a --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFinal_Exam_202004_40038.def @@ -0,0 +1,144 @@ +assignmentType = gateway +openDate = 04/22/2020 at 07:00am PDT +reducedScoringDate =04/28/2020 at 11:59pm PDT +dueDate = 04/28/2020 at 11:59pm PDT +answerDate = 05/01/2020 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Final_Exam_202004_40038_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Final_Exam_202004_40038_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = A Final Exam with questions from chapters 10 through 13 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/Functions213.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/Functions225.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/11-Functions/11_4-Simplifying_Expressions_with_Function_Notation/11_4_4_21.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/11-Functions/11_4-Simplifying_Expressions_with_Function_Notation/11_4_4_9.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/MultiplyingRationals/MultiplyingRationals2.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions70.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation290.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalEquations/solveRationalEquations60.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad260.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_3-Completing_the_Square/13_3_6_23.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/AbsValueEquations/lh1-6_66.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/AbsValueEquations/s5p6.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities3.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities12.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept55.pg +value = 4 +problem_end +problem_start +source_file = Library/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_3-Completing_the_Square/13_3_6_29.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange10.pg +value = 8 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_2-Quadratic_Graphs_and_Vertex_Form/13_2_6_85.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_7-Solving_Inequalities_Graphically/13_7_5_17.pg +value = 8 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_2-Quadratic_Graphs_and_Vertex_Form/13_2_6_29.pg +value = 16 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/12-Rational_Functions_and_Equations/12_1-Introduction_to_Rational_Functions/12_1_3_29.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication44.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_2-Quadratic_Graphs_and_Vertex_Form/13_2_6_35.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_2-Quadratic_Graphs_and_Vertex_Form/13_2_6_39.pg +value = 4 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Domain_Range.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Domain_Range.def new file mode 100644 index 0000000000..aa4e0dd9e3 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Domain_Range.def @@ -0,0 +1,31 @@ +openDate = 12/01/2015 at 12:04am PST +dueDate = 03/01/2016 at 12:04am PST +answerDate = 03/01/2016 at 12:04am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Domain_Range.pg +description = finding the domain and range functions +problemList = +FunctionBasics/Functions90.pg, 1, -1, 0 +FunctionBasics/Functions100.pg, 1, -1, 0 +FunctionBasics/Functions110.pg, 1, -1, 0 +FunctionBasics/Functions120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg, 1, -1, 0 +FunctionBasics/Functions170.pg, 1, -1, 0 +FunctionBasics/Functions180.pg, 1, -1, 0 +FunctionBasics/Functions200.pg, 1, -1, 0 +FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg, 1, -1, 0 +FunctionBasics/Functions225.pg, 1, -1, 0 +FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext60.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Notation.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Notation.def new file mode 100644 index 0000000000..b00d94b3b3 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Notation.def @@ -0,0 +1,32 @@ +openDate = 12/01/2015 at 12:02am PST +dueDate = 03/01/2016 at 12:02am PST +answerDate = 03/01/2016 at 12:02am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Notation.pg +description = learning and applying function notation +problemList = +BasicAlgebra/FunctionBasics/FunctionInContext10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction85.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition65.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition65.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition66.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition66.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools20.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorTable10.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setLinear_Functions_From_Data.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setLinear_Functions_From_Data.def new file mode 100644 index 0000000000..4eefb462e5 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setLinear_Functions_From_Data.def @@ -0,0 +1,52 @@ +openDate = 09/23/2019 at 12:00am +reducedScoringDate = 06/15/2029 at 10:00pm +dueDate = 08/17/2029 at 10:00pm +answerDate = 08/17/2029 at 10:00pm +enableReducedScoring = Y +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = find the formula for a linear function given two data points +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints10.pg +problem_id = 1 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints20.pg +problem_id = 2 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints30.pg +problem_id = 3 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints40.pg +problem_id = 4 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints50.pg +problem_id = 5 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints60.pg +problem_id = 6 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMidterm_Exam_202004_40038.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMidterm_Exam_202004_40038.def new file mode 100644 index 0000000000..48b82bee7b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMidterm_Exam_202004_40038.def @@ -0,0 +1,156 @@ +assignmentType = gateway +openDate = 04/22/2020 at 07:00am PDT +reducedScoringDate =04/28/2020 at 11:59pm PDT +dueDate = 04/28/2020 at 11:59pm PDT +answerDate = 05/01/2020 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Midterm_Exam_202004_40038_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Midterm_Exam_202004_30038_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = A Midterm Exam with questions from chapters 10 and 11 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring100.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring130.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring345.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring525.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring85.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring380.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring395.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring210.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring200.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring550.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring505.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring280.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad265.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad295.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad305.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad275.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionInContext10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction100.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction80.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction120.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve30.pg +value = 8 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg +value = 8 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph45.pg +value = 16 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/Functions200.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/Functions225.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionComposition66.pg +value = 16 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/11-Functions/11_3-Using_Technology_to_Explore_Functions/11_3_5_31.pg +value = 8 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/11-Functions/11_3-Using_Technology_to_Explore_Functions/11_3_5_25.pg +value = 8 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMultiply_Rational_Expressions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMultiply_Rational_Expressions.def new file mode 100644 index 0000000000..7236470059 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMultiply_Rational_Expressions.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:20am PST +dueDate = 03/01/2016 at 12:20am PST +answerDate = 03/01/2016 at 12:20am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Multiply_Rational_Expressions.pg +description = multiply rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions100.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setOperations_with_Radicals.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setOperations_with_Radicals.def new file mode 100644 index 0000000000..2d26974f77 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setOperations_with_Radicals.def @@ -0,0 +1,43 @@ +openDate = 12/01/2015 at 12:37am PST +dueDate = 03/01/2016 at 12:37am PST +answerDate = 03/01/2016 at 12:37am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Operations_with_Radicals.pg +description = operations that include radicals +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals13.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals14.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals15.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals51.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals52.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals55.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals56.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals57.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals58.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals91.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals92.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals93.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals94.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals95.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals44.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals55.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals65.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty11.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty12.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty41.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty43.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty60.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def new file mode 100644 index 0000000000..83ee97340c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def @@ -0,0 +1,14 @@ +openDate = 12/01/2015 at 12:58am PST +dueDate = 03/01/2016 at 12:58am PST +answerDate = 03/01/2016 at 12:58am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Equations_with_Complex_Solutions.pg +description = find, understand, and interpret complex solutions of quadratic equations +problemList = +BasicAlgebra/ComplexNumber/complexSolutions10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions40.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions50.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Formula.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Formula.def new file mode 100644 index 0000000000..0f5d59d87d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Formula.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:56am PST +dueDate = 03/01/2016 at 12:56am PST +answerDate = 03/01/2016 at 12:56am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Formula.pg +description = solve a quadratic equation using the quadratic formula +problemList = +BasicAlgebra/QuadraticEquations/solveQuad375.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad380.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad385.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad185.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools30.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools40.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools50.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorQuadraticFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions.def new file mode 100644 index 0000000000..2e43c931df --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:50am PST +dueDate = 03/01/2016 at 12:50am PST +answerDate = 03/01/2016 at 12:50am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions.pg +description = quadratic functions their graphs +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def new file mode 100644 index 0000000000..a88a2e2d3f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def @@ -0,0 +1,24 @@ +openDate = 12/01/2015 at 12:52am PST +dueDate = 03/01/2016 at 12:52am PST +answerDate = 03/01/2016 at 12:52am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions_Vertex_Form.pg +description = quadratic functions in vertex form and their graphs +problemList = +BasicAlgebra/QuadraticFunctions/CompleteSquare10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare40.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare50.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare60.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare70.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm40.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRadical_Functions_Domain_Range.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRadical_Functions_Domain_Range.def new file mode 100644 index 0000000000..abf0dc5bae --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRadical_Functions_Domain_Range.def @@ -0,0 +1,23 @@ +openDate = 12/01/2015 at 12:34am PST +dueDate = 03/01/2016 at 12:34am PST +answerDate = 03/01/2016 at 12:34am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Radical_Functions_Domain_Range.pg +description = determine the domain and range of radical functions +problemList = +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions2.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions3.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions4.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions5.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions6.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions7.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions8.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically100.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically110.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically120.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically130.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically140.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically150.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Exponents.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Exponents.def new file mode 100644 index 0000000000..eb4b66091b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Exponents.def @@ -0,0 +1,50 @@ +openDate = 12/01/2015 at 12:35am PST +dueDate = 03/01/2016 at 12:35am PST +answerDate = 03/01/2016 at 12:35am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Exponents.pg +description = using rational exponents to simplify radical expressions +problemList = +Math95/RadicalsRationalExponents/RadicalsRationalExponents7.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents8.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent26.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent40.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots35.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents9.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents14.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents15.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents16.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents17.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents18.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents19.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents21.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents24.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents27.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents28.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents29.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents31.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Functions_Domain.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Functions_Domain.def new file mode 100644 index 0000000000..bb6730e752 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Functions_Domain.def @@ -0,0 +1,29 @@ +openDate = 12/01/2015 at 12:16am PST +dueDate = 03/01/2016 at 12:16am PST +answerDate = 03/01/2016 at 12:16am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Functions_Domain.pg +description = determine the domain and range of rational functions +problemList = +BasicAlgebra/RationalFunctions/rationalFunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions211.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions212.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions213.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions214.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions215.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions216.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions217.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain40.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote30.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote40.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def new file mode 100644 index 0000000000..7947d00d13 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def @@ -0,0 +1,15 @@ +openDate = 12/01/2015 at 12:46am PST +dueDate = 03/01/2016 at 12:46am PST +answerDate = 03/01/2016 at 12:46am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Complex_Number_Denominators.pg +description = rationalize denominators that include complex numbers +problemList = +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Radical_Denominators.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Radical_Denominators.def new file mode 100644 index 0000000000..7ea176a347 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Radical_Denominators.def @@ -0,0 +1,35 @@ +openDate = 12/01/2015 at 12:38am PST +dueDate = 03/01/2016 at 12:38am PST +answerDate = 03/01/2016 at 12:38am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Radical_Denominators.pg +description = rationalize denominators that include radicals +problemList = +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator35.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator36.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator37.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator81.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator82.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator83.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator84.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator85.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator86.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator87.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator110.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator140.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator150.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication10.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication20.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication30.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals24.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals25.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals26.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator160.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator165.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator170.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator180.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator190.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator200.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator210.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_1-1.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_1-1.def new file mode 100644 index 0000000000..3cf3e98ca6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_1-1.def @@ -0,0 +1,54 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:00am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = evaluating formulaic functions; domain and range; graphs of functions +problemList = +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction110.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction140.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions110.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions150.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions160.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions170.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions200.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions225.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/Functions/Functions10.pg, 1, -1, 0 +Math95/Functions/Functions11.pg, 1, -1, 0 +Math95/Functions/Functions12.pg, 1, -1, 0 +Math95/Functions/Functions13.pg, 1, -1, 0 +Math95/Functions/Functions14.pg, 1, -1, 0 +Math95/Functions/Functions15.pg, 1, -1, 0 +Math95/Functions/Functions16.pg, 1, -1, 0 +Math95/Functions/Functions17.pg, 1, -1, 0 +Math95/Functions/Functions18.pg, 1, -1, 0 +Math95/Functions/Functions19.pg, 1, -1, 0 +Math95/Functions/Functions20.pg, 1, -1, 0 +Math95/Functions/Functions22.pg, 1, -1, 0 +Math95/Functions/Functions21.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-3.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-3.def new file mode 100644 index 0000000000..8f7407ea3e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-3.def @@ -0,0 +1,60 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:01am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = inequalities with number lines, interval notation, and set-builder notation; solving linear inequalities; applications +problemList = +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality130.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality170.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality190.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality210.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality230.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality240.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality260.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality280.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality290.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality310.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 +Math95/LinearInequalities/LinearInequalities8.pg, 1, -1, 0 +Math95/LinearInequalities/LinearInequalities9.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-4.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-4.def new file mode 100644 index 0000000000..b3ced9082e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-4.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:02am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = compound inequalities +problemList = +Math95/CompoundLinearInequalities/CompoundLinearInequalities1.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities2.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities3.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities4.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities5.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities6.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities11.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities10.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities7.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities8.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities9.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-5.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-5.def new file mode 100644 index 0000000000..fc9073ba2c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-5.def @@ -0,0 +1,17 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:03am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = absolute value inequalities +problemList = +Math95/AbsValueInequalities/AbsValueInequalities1.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities4.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities6.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities7.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities2.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities3.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities5.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities9.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities8.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-1.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-1.def new file mode 100644 index 0000000000..3856fa3c8f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-1.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:04am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = rational functions; easier rational equations +problemList = +Math95/Functions/Functions19.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions200.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations1.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations2.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations4.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations5.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations6.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations7.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations3.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-2.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-2.def new file mode 100644 index 0000000000..e09e4fd088 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-2.def @@ -0,0 +1,21 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:05am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = multiplication and division of rational expressions +problemList = +Math95/MultiplyingRationals/MultiplyingRationals1.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_15_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_18_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_22_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_20_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_19_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_16_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_23_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_24_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_25_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_27_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_26_MultDivRatExp.pg, 1, -1, 0 +Math95/MultiplyingRationals/MultiplyingRationals2.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-3.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-3.def new file mode 100644 index 0000000000..95dc9b7346 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-3.def @@ -0,0 +1,24 @@ + +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:06am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = addition and subtraction of rational expressions +problemList = +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_01_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_06_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_07_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_05_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_02_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_03_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_04_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_20_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_17_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_24_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_25_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_21_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_27_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_19_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_18_AddSubRatExp.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-4.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-4.def new file mode 100644 index 0000000000..92902cdd2a --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-4.def @@ -0,0 +1,32 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:07am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = more rational equations; applications +problemList = +Math95/MoreRationalEquations/MoreRationalEquations1.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations2.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations3.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations4.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations5.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations6.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations7.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations8.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations9.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations10.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations11.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations12.pg, 1, -1, 0 +Math95/Proportions/Proportions1.pg, 1, -1, 0 +Math95/Proportions/Proportions2.pg, 1, -1, 0 +Math95/Proportions/Proportions3.pg, 1, -1, 0 +Math95/Proportions/Proportions4.pg, 1, -1, 0 +Math95/Proportions/Proportions5.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications1.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications2.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications3.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications4.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications5.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications6.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications7.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-5.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-5.def new file mode 100644 index 0000000000..364f7293ed --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-5.def @@ -0,0 +1,18 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:08am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = "complex" fractions (rational expressions with more than two "levels") +problemList = +Math95/ComplexFractions/ComplexFractions1.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions2.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions3.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions4.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions5.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions6.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions7.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions8.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions9.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions10.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-1_5-2.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-1_5-2.def new file mode 100644 index 0000000000..7ecbfb27e8 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-1_5-2.def @@ -0,0 +1,40 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:09am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = square roots and radicals; rational exponents +problemList = +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents6.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents5.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents3.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents4.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents9.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents27.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents28.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents29.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents31.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents7.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents8.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents18.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p13.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p16.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p12.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-3.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-3.def new file mode 100644 index 0000000000..111ce86936 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-3.def @@ -0,0 +1,31 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:10am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = multiplying radical and rational exponent expressions +problemList = +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents14.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents15.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents16.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents17.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents21.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents24.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-4.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-4.def new file mode 100644 index 0000000000..bdde53a100 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-4.def @@ -0,0 +1,34 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:11am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = adding like radicals; reducing radicals; rationalizing denominators; binomial multiplication with radicals and rational exponents +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical1.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-5.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-5.def new file mode 100644 index 0000000000..f581cb19fe --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-5.def @@ -0,0 +1,20 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:12am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = radical functions +problemList = +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions225.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions2.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions3.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions4.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions5.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions6.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions7.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions8.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-6.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-6.def new file mode 100644 index 0000000000..f9bd162940 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-6.def @@ -0,0 +1,33 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:13am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = equations that radicals help solve; Pythagorean Theorem; equations with radicals in them +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad35.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad40.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad50.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad70.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad75.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad85.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad115.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad110.pg, 1, -1, 0 +Math95/EquationsNeedingRadicals/EquationsNeedingRadicals3.pg, 1, -1, 0 +Math95/EquationsNeedingRadicals/EquationsNeedingRadicals4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations1.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations5.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations8.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations9.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations10.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad135.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad140.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-7.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-7.def new file mode 100644 index 0000000000..c183d725ec --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-7.def @@ -0,0 +1,20 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:14am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = arithmetic with complex numbers; counting real and nonreal roots of quadratic polynomials +problemList = +Math95/ComplexNumbers/ComplexNumbers1.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers2.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers3.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers4.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers5.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers6.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers7.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers8.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-1.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-1.def new file mode 100644 index 0000000000..6d8014412d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-1.def @@ -0,0 +1,24 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:15am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = graph quadratic functions; parabola axis of symmetry and vertex +problemList = +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-2.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-2.def new file mode 100644 index 0000000000..256be791df --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-2.def @@ -0,0 +1,25 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:16am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = transformations of y=x^2; quadratic data +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms10.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData1.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData2.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData3.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-3.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-3.def new file mode 100644 index 0000000000..11f4905628 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-3.def @@ -0,0 +1,46 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:17am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = solve quadratic equations using factoring, square root, and completing the square; find x-intercepts of parabolas; applications +problemList = +BasicAlgebra/QuadraticEquations/solveQuad95.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad230.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad220.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad235.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad240.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad120.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad180.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad265.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad270.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad280.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad285.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad295.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad335.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad330.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad325.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts220.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts230.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola100.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-4.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-4.def new file mode 100644 index 0000000000..8b77a87ae4 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-4.def @@ -0,0 +1,21 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:18am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = the quadratic formula; applications +problemList = +BasicAlgebra/QuadraticEquations/solveQuad145.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad150.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad176.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def new file mode 100644 index 0000000000..7c8e046444 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def @@ -0,0 +1,18 @@ +openDate = 12/01/2015 at 12:28am PST +dueDate = 03/01/2016 at 12:28am PST +answerDate = 03/01/2016 at 12:28am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Complex_Rational_Expressions.pg +description = simplify complex rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions11.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions12.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions70.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Radical_Expressions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Radical_Expressions.def new file mode 100644 index 0000000000..207d476ffa --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Radical_Expressions.def @@ -0,0 +1,28 @@ +openDate = 12/01/2015 at 12:36am PST +dueDate = 03/01/2016 at 12:36am PST +answerDate = 03/01/2016 at 12:36am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Radical_Expressions.pg +description = simplify radical expressions +problemList = +Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents3.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents4.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents5.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents6.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals07.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals09.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals150.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals160.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals170.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals180.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals185.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals190.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals200.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals210.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals220.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEstimateRadical10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEstimateRadical20.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Rational_Expressions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Rational_Expressions.def new file mode 100644 index 0000000000..722ea2a715 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Rational_Expressions.def @@ -0,0 +1,27 @@ +openDate = 12/01/2015 at 12:18am PST +dueDate = 03/01/2016 at 12:18am PST +answerDate = 03/01/2016 at 12:18am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Rational_Expressions.pg +description = simplify rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions100.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions110.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions120.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions130.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions150.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions160.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions170.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions180.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def new file mode 100644 index 0000000000..20167defb9 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:12am PST +dueDate = 03/01/2016 at 12:12am PST +answerDate = 03/01/2016 at 12:12am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Equations.pg +description = solve absolute value equations +problemList = +BasicAlgebra/AbsoluteValue/absoluteValueEquation10.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation20.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation30.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation40.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation50.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation60.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation65.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation70.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation80.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation90.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation95.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation100.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation110.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation120.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation130.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation140.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation150.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def new file mode 100644 index 0000000000..2c025f8c71 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:14am PST +dueDate = 03/01/2016 at 12:14am PST +answerDate = 03/01/2016 at 12:14am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Inequalities.pg +description = solve absolute value inequalities +problemList = +BasicAlgebra/AbsoluteValue/absoluteValueInequality10.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality20.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality50.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality70.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality100.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality130.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality140.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality150.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequalityApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveInequality10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveInequality20.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Inequalities.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Inequalities.def new file mode 100644 index 0000000000..14a7378064 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Inequalities.def @@ -0,0 +1,34 @@ +openDate = 12/01/2015 at 12:08am PST +dueDate = 03/01/2016 at 12:08am PST +answerDate = 03/01/2016 at 12:08am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Inequalities.pg +description = solve inequalities and compound inequalities +problemList = +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality320.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality300.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def new file mode 100644 index 0000000000..6baeeeeadd --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def @@ -0,0 +1,17 @@ +openDate = 12/01/2015 at 12:32am PST +dueDate = 03/01/2016 at 12:32am PST +answerDate = 03/01/2016 at 12:32am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Literal_Rational_Equations.pg +description = solve literal rational equations +problemList = +BasicAlgebra/RationalLiteralEquations/LiteralEquation220.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation230.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation240.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation250.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation260.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation270.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation280.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation290.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Quadratic_Equations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Quadratic_Equations.def new file mode 100644 index 0000000000..7093359a79 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Quadratic_Equations.def @@ -0,0 +1,21 @@ +openDate = 12/01/2015 at 12:54am PST +dueDate = 03/01/2016 at 12:54am PST +answerDate = 03/01/2016 at 12:54am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Quadratic_Equations.pg +description = learning more advanced skills for graphing calculators +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare40.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Radical_Equations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Radical_Equations.def new file mode 100644 index 0000000000..878f61f5f0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Radical_Equations.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:40am PST +dueDate = 03/01/2016 at 12:40am PST +answerDate = 03/01/2016 at 12:40am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Radical_Equations.pg +description = solve radical equations +problemList = +Math95/SolvingRadicalEquations/SolvingRadicalEquations1.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations5.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations8.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral90.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral100.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral110.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral120.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRadicalEquation10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRadicalEquation20.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication92.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication102.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication122.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication20.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations.def new file mode 100644 index 0000000000..922baf84da --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations.def @@ -0,0 +1,25 @@ +openDate = 12/01/2015 at 12:30am PST +dueDate = 03/01/2016 at 12:30am PST +answerDate = 03/01/2016 at 12:30am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations.pg +description = solve rational equations +problemList = +BasicAlgebra/RationalEquations/solveRationalEquations10.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations20.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations25.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations27.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations28.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations30.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations40.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations50.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations55.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations60.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations61.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations65.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations66.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations70.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRationalEquation10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRationalEquation20.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def new file mode 100644 index 0000000000..a93cb61e19 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def @@ -0,0 +1,22 @@ +openDate = 12/01/2015 at 12:31am PST +dueDate = 03/01/2016 at 12:31am PST +answerDate = 03/01/2016 at 12:31am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations_Applications.pg +description = solve rational equations +problemList = +BasicAlgebra/RationalEquations/rationalEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication15.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication25.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication35.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication44.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication45.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setComposing_Functions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setComposing_Functions.def new file mode 100644 index 0000000000..fc17b4b96a --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setComposing_Functions.def @@ -0,0 +1,24 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/09/2014 at 10:03pm PDT +answerDate = 07/09/2014 at 10:03pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = composition of functions using formulas, tables, graphs, and verbal description +problemList = +CollegeAlgebra/FunctionComposition/FunctionComposition30.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition40.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition50.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition60.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition70.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition80.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition90.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition100.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition110.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition115.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition120.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition130.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition140.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition150.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition160.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition170.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setConcavity.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setConcavity.def new file mode 100644 index 0000000000..f0402d865c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setConcavity.def @@ -0,0 +1,12 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/30/2014 at 10:00pm PDT +answerDate = 07/30/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = concavity +problemList = +CollegeAlgebra/Concavity/ConcavityInContext10.pg, 1, -1, 0 +CollegeAlgebra/Concavity/ConcavityInContext20.pg, 1, -1, 0 +CollegeAlgebra/Concavity/ConcavityFromTable10.pg, 1, -1, 0 +CollegeAlgebra/Concavity/ConcavityFromGraph10.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setContinuous_Relative_Growth_Rate.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setContinuous_Relative_Growth_Rate.def new file mode 100644 index 0000000000..0494d15d98 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setContinuous_Relative_Growth_Rate.def @@ -0,0 +1,16 @@ +openDate = 06/23/2014 at 12:00am PDT +dueDate = 08/13/2014 at 10:01pm PDT +answerDate = 08/13/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = continuous relative growth rate +problemList = +CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates1.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates3.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/eForm1.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/ContPopulation.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/RadioDecay.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/HalvingTime.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/ContinuousDoublingTime.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDifference_Quotients.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDifference_Quotients.def new file mode 100644 index 0000000000..dd28727c21 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDifference_Quotients.def @@ -0,0 +1,15 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/09/2014 at 10:02pm PDT +answerDate = 07/09/2014 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = simplifying the difference quotient; some warm-up questions first +problemList = +CollegeAlgebra/FunctionComposition/FunctionComposition10.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition20.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient10.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient20.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient40.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient50.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient60.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDomain_and_Range.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDomain_and_Range.def new file mode 100644 index 0000000000..13413b00fd --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDomain_and_Range.def @@ -0,0 +1,31 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/02/2014 at 10:02pm PDT +answerDate = 07/02/2014 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = domain and range of a function +problemList = +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions170.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions200.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions225.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions235.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Domain10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Domain20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Domain30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionGraphs30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/graphs_of_functions_12.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Range20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Range30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Range40.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Range50.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/new_problem_337.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/new_problem_142.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setEulers_Constant_and_Natural_Log.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setEulers_Constant_and_Natural_Log.def new file mode 100644 index 0000000000..f2648884e9 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setEulers_Constant_and_Natural_Log.def @@ -0,0 +1,29 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 08/13/2014 at 10:00pm PDT +answerDate = 08/13/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = Euler's constant e; natural logarithm ln +problemList = +CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs3.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/CalculatorFreeLogs.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/ExponentsToLns.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/ExponentsToLogs2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/LnsToExponents2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/LnsToExponents.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Simplify2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Simplify3.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Simplify.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/SolveUsingLogs7.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/SolveUsingLogs8.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/MatchLogGraphs.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Solve.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/bForm1.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/bForm2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/bForm3.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Domain2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Domain3.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Domain.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setExponential_Function_Basics.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setExponential_Function_Basics.def new file mode 100644 index 0000000000..a243d199fe --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setExponential_Function_Basics.def @@ -0,0 +1,32 @@ +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/30/2014 at 10:02pm PDT +answerDate = 07/30/2014 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = exponential functions basics; relative growth rate; growth factor; find a formula given two points +problemList = +CollegeAlgebra/ExponentialFunctions/ExponentialBasics10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/ExponentialBasics20.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/CalculatorExponential10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/Modeling10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/Modeling20.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/Modeling30.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/AverageRateOfChange10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/GrowthFactor2.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/GrowthFactor.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints100.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/CompareGraphs2.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/CompareGraphs3.pg, 1, -1, 0 +Library/NAU/setExpLog/ExpEq2.pg, 1, -1, 0 +Library/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/1_Precalculus_Review/1.6_Exponential_and_Logarithmic_Functions/1.6.7.pg, 1, -1, 0 +Library/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/1_Precalculus_Review/1.6_Exponential_and_Logarithmic_Functions/1.6.31.pg, 1, -1, 0 +Library/NAU/setExpLog/ExpEq4.pg, 1, -1, 0 +Library/NAU/setExpLog/ExpEq1.pg, 1, -1, 0 +Library/ASU-topics/setLogarithmicFunctions/jj7.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/ExponentialTable.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints20.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/FindExponentialFromGraph.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/LinearTable.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/LinearVsExponential.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/FindRate2.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Arithmetic.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Arithmetic.def new file mode 100644 index 0000000000..00d2495df6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Arithmetic.def @@ -0,0 +1,13 @@ +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/09/2014 at 10:00pm PDT +answerDate = 07/09/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = adding, subtracting, multiplying, and dividing functions; the domain of the result +problemList = +CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains10.pg, 1, -1, 0 +CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains20.pg, 1, -1, 0 +CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains30.pg, 1, -1, 0 +CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains40.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_03_02_ProblemSolvingBusinessApp/32IntAlg_15_Functions_Review.pg, 1, -1, 0 +Library/UVA-Stew5e/setUVA-Stew5e-C01S03-NewFunctOld/1-3-31.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Basics.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Basics.def new file mode 100644 index 0000000000..a9a8c1e12d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Basics.def @@ -0,0 +1,33 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/02/2014 at 10:00pm PDT +answerDate = 07/02/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = function basics; evaluation +problemList = +CollegeAlgebra/FunctionBasics/FunctionVocabulary10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionRelations10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionRelations20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions160.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions150.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction140.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateFunction23.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve40.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve50.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve60.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Solve20.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/SolveInequality20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/SolveInequality30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Solve60.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/PositionVelocity10.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Transformations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Transformations.def new file mode 100644 index 0000000000..540ffd8961 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Transformations.def @@ -0,0 +1,30 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/16/2014 at 10:00pm PDT +answerDate = 07/16/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = function transformations, including shifts, reflections, and scaling; graphical, tabular, formulaic, and verbal examples +problemList = +CollegeAlgebra/Transformations/Shifting10.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Shifting20.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Shifting30.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Shifting40.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Shifting50.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Shifting60.pg, 1, -1, 0 +CollegeAlgebra/Transformations/ScalingAndReflecting10.pg, 1, -1, 0 +CollegeAlgebra/Transformations/GeneralTransformations10.pg, 1, -1, 0 +CollegeAlgebra/Transformations/ScalingAndReflecting20.pg, 1, -1, 0 +CollegeAlgebra/Transformations/ScalingAndReflecting30.pg, 1, -1, 0 +CollegeAlgebra/Transformations/MatchGraphsReflected.pg, 1, -1, 0 +CollegeAlgebra/Transformations/GeneralTransformations20.pg, 1, -1, 0 +CollegeAlgebra/Transformations/GeneralTransformations30.pg, 1, -1, 0 +CollegeAlgebra/Transformations/GeneralTransformations40.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Symmetry10.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Symmetry1.pg, 1, -1, 0 +CollegeAlgebra/Transformations/MatchGraphs2.pg, 1, -1, 0 +CollegeAlgebra/Transformations/General1.pg, 1, -1, 0 +CollegeAlgebra/Transformations/General3.pg, 1, -1, 0 +CollegeAlgebra/Transformations/ChooseGraph2.pg, 1, -1, 0 +CollegeAlgebra/Transformations/MatchGraphs1.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Painting.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInterest.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInterest.def new file mode 100644 index 0000000000..d81bb57576 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInterest.def @@ -0,0 +1,18 @@ +openDate = 06/23/2014 at 12:00am PDT +dueDate = 08/13/2014 at 10:02pm PDT +answerDate = 08/13/2014 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = interest compounded periodically and continuously +problemList = +CollegeAlgebra/Interest/NominalForm.pg, 1, -1, 0 +CollegeAlgebra/Interest/InterestChoice.pg, 1, -1, 0 +CollegeAlgebra/Interest/FindRate.pg, 1, -1, 0 +CollegeAlgebra/Interest/EffectiveRate.pg, 1, -1, 0 +CollegeAlgebra/Interest/ContVersusAnnual.pg, 1, -1, 0 +CollegeAlgebra/Interest/ContInterest.pg, 1, -1, 0 +CollegeAlgebra/Interest/Compounding.pg, 1, -1, 0 +CollegeAlgebra/Interest/Compounding2.pg, 1, -1, 0 +CollegeAlgebra/Interest/NominalForm.pg, 1, -1, 0 +CollegeAlgebra/Interest/Nominal.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInverses_of_Functions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInverses_of_Functions.def new file mode 100644 index 0000000000..2513cde748 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInverses_of_Functions.def @@ -0,0 +1,31 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/23/2014 at 10:01pm PDT +answerDate = 07/23/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = inverses of functions +problemList = +CollegeAlgebra/FunctionComposition/FunctionComposition180.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions10.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions20.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/OneToOne10.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions30.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions40.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions50.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions60.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions70.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions80.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions90.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions100.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions110.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions120.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions130.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions140.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions150.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions160.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions170.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions180.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/OneToOne20.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions190.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions200.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setLogarithms.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setLogarithms.def new file mode 100644 index 0000000000..e13ea2d642 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setLogarithms.def @@ -0,0 +1,22 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 08/06/2014 at 10:00pm PDT +answerDate = 08/06/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = logarithms; +problemList = +CollegeAlgebra/Logarithms/TrueFalse.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/ExponentsToLogs.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/LogsToExponents.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs2.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs3.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs4.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs5.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs6.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/Solve2.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/DrugInBody.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/Iodine.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/DoublingTime.pg, 1, -1, 0 + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPercentage_Review.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPercentage_Review.def new file mode 100644 index 0000000000..fcfcc01c4a --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPercentage_Review.def @@ -0,0 +1,11 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/30/2014 at 10:01pm PDT +answerDate = 07/30/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = review of percentages +problemList = +CollegeAlgebra/ExponentialFunctions/Percentage10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/Percentage20.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/RelativeGrowthRate10.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPiecewise_Defined_Functions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPiecewise_Defined_Functions.def new file mode 100644 index 0000000000..148c945f23 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPiecewise_Defined_Functions.def @@ -0,0 +1,17 @@ +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/09/2014 at 10:01pm PDT +answerDate = 07/09/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = piecewise-defined functions +problemList = +CollegeAlgebra/FunctionBasics/Piecewise10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Piecewise20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Piecewise30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Piecewise40.pg, 1, -1, 0 +Library/LoyolaChicago/Precalc/Chap2Sec3/Q04.pg, 1, -1, 0 +Library/Rochester/setAlgebra15Functions/ur_fn_1_6.pg, 1, -1, 0 +Library/Rochester/setAlgebra16FunctionGraphs/ns1_1_45.pg, 1, -1, 0 +Library/UVA-Stew5e/setUVA-Stew5e-C01S03-NewFunctOld/1-3-31.pg, 1, -1, 0 + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPolynomial_Functions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPolynomial_Functions.def new file mode 100644 index 0000000000..20c0cce9e1 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPolynomial_Functions.def @@ -0,0 +1,30 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/16/2014 at 10:01pm PDT +answerDate = 07/16/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = graphs ond other features of polynomial functions +problemList = +CollegeAlgebra/PolynomialFunctions/Polynomials1.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials6.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials9.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials12.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials13.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials14.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials15.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials16.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials19.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials20.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials21.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials22.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials23.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials24.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials25.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials26.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials27.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials28.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_49.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_97.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials29.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials30.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setRational_Functions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setRational_Functions.def new file mode 100644 index 0000000000..aa99e18ce6 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setRational_Functions.def @@ -0,0 +1,23 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/23/2014 at 10:00pm PDT +answerDate = 07/23/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = graphs and other features of rational functions +problemList = +CollegeAlgebra/RationalFunctions/Asymptotes10.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Asymptotes20.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Asymptotes30.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Asymptotes40.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Asymptotes50.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Asymptotes60.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Limits10.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Limits20.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Limits30.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas10.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas20.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas30.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas40.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas50.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas60.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.1.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.1.def new file mode 100644 index 0000000000..d7d646d3fc --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.1.def @@ -0,0 +1,373 @@ +assignmentType = default +openDate = 01/04/2016 at 12:00am PST +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 01/13/2016 at 11:59pm PST +answerDate = 01/14/2016 at 11:59pm PST +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = problems like those in Sullivan and Sullivan's 3rd edition Precalculus, section 1.1 +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +problem_id = 1 +source_file = CollegeAlgebra/FunctionBasics/FunctionVocabulary10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains02.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains50.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = BasicAlgebra/FunctionBasics/FunctionDefinition10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = CollegeAlgebra/FunctionBasics/FunctionRelations10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = CollegeAlgebra/FunctionBasics/FunctionRelations20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = CollegeAlgebra/FunctionBasics/EvaluateFunction23.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction60.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction80.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction120.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction130.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction140.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = CollegeAlgebra/FunctionComposition/FunctionComposition10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient60.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient50.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 21 +source_file = BasicAlgebra/FunctionBasics/Functions90.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 22 +source_file = BasicAlgebra/FunctionBasics/Functions170.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 23 +source_file = BasicAlgebra/FunctionBasics/Functions200.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 24 +source_file = BasicAlgebra/FunctionBasics/Functions210.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 25 +source_file = CollegeAlgebra/FunctionBasics/Domain10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 26 +source_file = CollegeAlgebra/FunctionBasics/Domain20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 27 +source_file = BasicAlgebra/FunctionBasics/Functions225.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 28 +source_file = BasicAlgebra/FunctionBasics/Functions235.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 29 +source_file = CollegeAlgebra/FunctionBasics/Domain30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 30 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 31 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 32 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 33 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 34 +source_file = CollegeAlgebra/FunctionBasics/PositionVelocity10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 35 +source_file = CollegeAlgebra/FunctionBasics/Solve60.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 36 +source_file = BasicAlgebra/FunctionBasics/Functions160.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 37 +source_file = BasicAlgebra/FunctionBasics/Functions150.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 38 +source_file = Library/LoyolaChicago/Precalc/Chap1Sec1/Q19.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 39 +source_file = Library/LoyolaChicago/Precalc/Chap1Review/Q34.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 40 +source_file = Library/FortLewis/Algebra/8-1-Domain-range/MCH1-8-1-14-Domain-range.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end \ No newline at end of file diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.2.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.2.def new file mode 100644 index 0000000000..35d1bea836 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.2.def @@ -0,0 +1,239 @@ +assignmentType = default +openDate = 01/04/2016 at 12:00am PST +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 01/20/2016 at 10:00pm PST +answerDate = 01/20/2016 at 10:00pm PST +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111Header.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = problems like those in Sullivan and Sullivan's 3rd edition Precalculus, section 1.2 +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +problem_id = 1 +source_file = BasicAlgebra/FunctionBasics/Functions100.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = BasicAlgebra/FunctionBasics/Functions110.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = BasicAlgebra/FunctionBasics/Functions120.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = Library/CollegeOfIdaho/setAlgebra_05_03_FactoringByGrouping/53IntAlg_32_Functions_Review.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = CollegeAlgebra/FunctionBasics/FunctionGraphs10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = CollegeAlgebra/FunctionBasics/FunctionGraphs30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = CollegeAlgebra/FunctionBasics/graphs_of_functions_12.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = CollegeAlgebra/FunctionBasics/FunctionGraphs20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = CollegeAlgebra/FunctionBasics/FunctionTables30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = CollegeAlgebra/FunctionBasics/VariousQuestions10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 21 +source_file = CollegeAlgebra/FunctionBasics/FunctionTables10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 22 +source_file = CollegeAlgebra/FunctionBasics/FunctionTables20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 23 +source_file = Library/LoyolaChicago/Precalc/Chap1Review/Q37.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 1 +problem_end +problem_start +problem_id = 24 +source_file = Library/Rochester/setAlgebra16FunctionGraphs/c0s1p4/c0s1p4.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 1 +problem_end +problem_start +problem_id = 25 +source_file = Library/CollegeOfIdaho/setAlgebra_02_01_IntroFunctions/21IntAlg_14_function.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 1 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.3.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.3.def new file mode 100644 index 0000000000..d6b69a986e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.3.def @@ -0,0 +1,285 @@ +assignmentType = default +openDate = 01/04/2016 at 12:00am PST +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 01/20/2016 at 10:00pm PST +answerDate = 01/20/2016 at 10:00pm PST +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111Header.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = problems like those in Sullivan and Sullivan's 3rd edition Precalculus, section 1.3 +restrictProbProgression = 0 +emailInstructor = 0 + + +problemListV2 +problem_start +problem_id = 1 +source_file = CollegeAlgebra/FunctionBasics/FunctionVocabulary20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = CollegeAlgebra/FunctionBasics/new_problem_142.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = CollegeAlgebra/FunctionBasics/new_problem_337.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = Library/Mizzou/Algebra/functions_increasing_decreasing/find_all_info_02.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = Library/Mizzou/College_Algebra/Functions_Increasing_Decreasing/Inc_Dec_Const_Dom_Range_01.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = Library/FortLewis/Algebra/8-1-Domain-range/MCH1-8-1-17-Domain-range.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = BasicAlgebra/FunctionBasics/FunctionValuesByGraph50.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = Library/ASU-topics/setGraphingCalculator/garcia1.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = Library/ASU-topics/setGraphingCalculator/garcia3.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = Library/ASU-topics/setGraphingCalculator/garcia7.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = CollegeAlgebra/FunctionBasics/DomainRange10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = CollegeAlgebra/FunctionBasics/Range30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = CollegeAlgebra/FunctionBasics/Range40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = CollegeAlgebra/FunctionBasics/VariousQuestions10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = Library/ASU-topics/setFirstDerivative/4-2-61.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = Library/ASU-topics/setFirstDerivative/4-2-65.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = Library/ASU-topics/setFirstDerivative/4-2-63.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 21 +source_file = Library/Mizzou/College_Algebra/Functions_Even_Odd_Symmetry/Graph_Even_Odd_Neither.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 22 +source_file = Library/maCalcDB/setAlgebra15Functions/srw2_2_55.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 23 +source_file = Library/maCalcDB/setAlgebra15Functions/srw2_2_53.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 24 +source_file = Library/LoyolaChicago/Precalc/Chap9Sec4/Q14a.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 25 +source_file = Library/ma117DB/set2/srw1_8_63.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 26 +source_file = Library/LoyolaChicago/Precalc/Chap5Sec2/Q03.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 27 +source_file = CollegeAlgebra/Transformations/Symmetry10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 28 +source_file = Library/LoyolaChicago/Precalc/Chap5Sec2/Q30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 29 +source_file = Library/Utah/AP_Calculus_I/set1_Reviews_of_Fundamentals/1210s2p5.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 30 +source_file = Library/LoyolaChicago/Precalc/Chap1Review/Q37.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.4.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.4.def new file mode 100644 index 0000000000..4cbe843160 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.4.def @@ -0,0 +1,194 @@ +assignmentType = default +openDate = 01/04/2016 at 12:00am PST +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 02/02/2016 at 10:00pm PST +answerDate = 02/02/2016 at 10:00pm PST +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111Header.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = problems like those in Sullivan and Sullivan's 3rd edition Precalculus, section 1.4 +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +problem_id = 1 +source_file = CollegeAlgebra/FunctionBasics/FunctionGraphs05.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = Library/Mizzou/Algebra/functions_piecewise/evaluate_at_a_point_01.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = Library/Rochester/setAlgebra15Functions/lh2-2_36.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = Library/Utah/Business_Algebra/set4_Quadratic_and_Other_Special_Functions/p02.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = CollegeAlgebra/FunctionBasics/Piecewise10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = Library/LoyolaChicago/Precalc/Chap2Sec3/Connally3-2-3-05-Piecewise-functions.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = Library/LoyolaChicago/Precalc/Chap2Sec3/Q06.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = CollegeAlgebra/FunctionBasics/Piecewise20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = CollegeAlgebra/FunctionBasics/Piecewise30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = Library/LoyolaChicago/Precalc/Chap2Sec3/Connally3-2-3-02-Piecewise-functions.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = Library/LoyolaChicago/Precalc/Chap2Sec3/Q01.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = Library/Mizzou/College_Algebra/Functions_Piecewise/MC_Three_Lines_Const_Left.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = Library/LoyolaChicago/Precalc/Chap2Sec3/Q04.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = Library/Mizzou/Algebra/functions_piecewise/determine_formula_from_graph_01.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = Library/Mizzou/Algebra/functions_piecewise/determine_formula_from_graph_02.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = Library/Mizzou/Algebra/functions_piecewise/app_03.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = Library/Mizzou/Algebra/functions_piecewise/app_02.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = Library/Mizzou/Algebra/functions_piecewise/app_01.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = CollegeAlgebra/Transformations/Symmetry10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = CollegeAlgebra/Transformations/Symmetry1.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.5.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.5.def new file mode 100644 index 0000000000..aa03f6c3a2 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.5.def @@ -0,0 +1,194 @@ +assignmentType = default +openDate = 01/04/2016 at 12:00am PST +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 02/09/2016 at 10:00pm PST +answerDate = 02/09/2016 at 10:00pm PST +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = problems like those in Sullivan and Sullivan's 3rd edition Precalculus, section 1.5 +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +problem_id = 1 +source_file = CollegeAlgebra/Transformations/Shifting10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = CollegeAlgebra/Transformations/Shifting20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = CollegeAlgebra/Transformations/Shifting30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = CollegeAlgebra/Transformations/Shifting40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = CollegeAlgebra/Transformations/Shifting50.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = CollegeAlgebra/Transformations/Shifting60.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = CollegeAlgebra/Transformations/ScalingAndReflecting10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = CollegeAlgebra/Transformations/GeneralTransformations10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = CollegeAlgebra/Transformations/ScalingAndReflecting20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = CollegeAlgebra/Transformations/ScalingAndReflecting30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = CollegeAlgebra/Transformations/MatchGraphsReflected.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = CollegeAlgebra/Transformations/GeneralTransformations20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = CollegeAlgebra/Transformations/GeneralTransformations30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = CollegeAlgebra/Transformations/GeneralTransformations40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = CollegeAlgebra/Transformations/MatchGraphs2.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = CollegeAlgebra/Transformations/General1.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = CollegeAlgebra/Transformations/General3.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = CollegeAlgebra/Transformations/ChooseGraph2.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = CollegeAlgebra/Transformations/MatchGraphs1.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = CollegeAlgebra/Transformations/Painting.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setTables_and_Graphs.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setTables_and_Graphs.def new file mode 100644 index 0000000000..23138c6dca --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setTables_and_Graphs.def @@ -0,0 +1,21 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/02/2014 at 10:01pm PDT +answerDate = 07/02/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = tables; graphs +problemList = +CollegeAlgebra/FunctionBasics/FunctionTables30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionGraphs10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionTables10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionTables20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/VariousQuestions10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionGraphs20.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasic_Probability.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasic_Probability.def new file mode 100644 index 0000000000..3397fa3bf8 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasic_Probability.def @@ -0,0 +1,21 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/26/2015 at 10:02pm PDT +answerDate = 04/26/2015 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = basic probability calculations +problemList = +Statistics/BasicProbability/dueck5_1_2.pg, 1, -1, 0 +Statistics/BasicProbability/dueck5_1_5.pg, 1, -1, 0 +Statistics/BasicProbability/kolossa5.pg, 1, -1, 0 +Statistics/BasicProbability/10Stats_01_Probability.pg, 1, -1, 0 +Statistics/BasicProbability/10Stats_02_Probability.pg, 1, -1, 0 +Statistics/BasicProbability/10Stats_04_Probability.pg, 1, -1, 0 +Statistics/BasicProbability/10Stats_12_Probability.pg, 1, -1, 0 +Statistics/BasicProbability/ur_dis_9_17.pg, 1, -1, 0 +Statistics/BasicProbability/ur_dis_9_19.pg, 1, -1, 0 +Statistics/BasicProbability/ur_pb_5_2.pg, 1, -1, 0 +Statistics/BasicProbability/stat212-HW03-17.pg, 1, -1, 0 +Statistics/BasicProbability/stat212-HW03-20.pg, 1, -1, 0 +Statistics/BasicProbability/stat212-HW04-03.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasics_of_Data.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasics_of_Data.def new file mode 100644 index 0000000000..fa3d7cab39 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasics_of_Data.def @@ -0,0 +1,16 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/08/2015 at 10:00pm PDT +answerDate = 04/08/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = types of data +problemList = +Statistics/TypesOfData/DataTypes1.pg, 1, -1, 0 +Statistics/TypesOfData/DataTypes2.pg, 1, -1, 0 +Statistics/TypesOfData/DataTypes3.pg, 1, -1, 0 +Statistics/TypesOfData/DataTypes4.pg, 1, -1, 0 +Statistics/TypesOfData/DataTypes6.pg, 1, -1, 0 +Statistics/TypesOfData/01Stats_04_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/TypesOfData/stat212-HW01-02.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_02_PictDistnsWGraphs.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBinomial_Distribution.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBinomial_Distribution.def new file mode 100644 index 0000000000..2fe6394e9e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBinomial_Distribution.def @@ -0,0 +1,22 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/13/2015 at 10:00pm PDT +answerDate = 05/13/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = exponential distribution; geometric distribution; binomial distribution; Normal approximation of the binomial distribution; continuity correction +problemList = +Statistics/BinomialDistribution/ur_pb_8_1.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_8_5.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_8_4.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_12_4.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_8_8.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_8_3.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_8_6.pg, 1, -1, 0 +Statistics/BinomialDistribution/stat212-HW07-16.pg, 1, -1, 0 +Statistics/BinomialDistribution/stat212-HW07-15.pg, 1, -1, 0 +Statistics/BinomialDistribution/stat212-HW07-14.pg, 1, -1, 0 +Statistics/BinomialDistribution/stat212-HW07-13.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_12_3.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_12_2.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_12_1.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setConditional_Probability.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setConditional_Probability.def new file mode 100644 index 0000000000..aabdb4f3a4 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setConditional_Probability.def @@ -0,0 +1,30 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/03/2015 at 10:02pm PDT +answerDate = 05/03/2015 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = conditional probability; problems where a tree diagram may help +problemList = +Statistics/ProbabilityRulesAndTools/spinner1.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_3_12.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW04-11.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW04-10.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW04-09.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW04-04.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-12.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-11.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-07.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_4_8.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_4_5.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_4_1.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/comprob10.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/Bayes7.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/Bayes3.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/Bayes2.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/Bayes1.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_4_2.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-13.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-15.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-14.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW04-20.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDisplaying_Data.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDisplaying_Data.def new file mode 100644 index 0000000000..ff67863148 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDisplaying_Data.def @@ -0,0 +1,31 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/08/2015 at 10:02pm PDT +answerDate = 04/08/2015 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = graphical displays; tabular displays +problemList = +Statistics/DisplayingData/gust11.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_10_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_11_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/ur_stt_1_5.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_06_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_07_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_08_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_09_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/stat212-HW02-01.pg, 1, -1, 0 +Statistics/DisplayingData/02Stats_01_DescrData.pg, 1, -1, 0 +Statistics/DisplayingData/stat212-HW01-18.pg, 1, -1, 0 +Statistics/DisplayingData/stat212-HW01-17.pg, 1, -1, 0 +Statistics/DisplayingData/histogram1.pg, 1, -1, 0 +Statistics/DisplayingData/easy_histogram.pg, 1, -1, 0 +Statistics/BasicOneVarStats/CenterMeasureFromStemAndLeaf.pg, 1, -1, 0 +Statistics/DisplayingData/gust30.pg, 1, -1, 0 +Statistics/DisplayingData/BoxPlotPercentBetween.pg, 1, -1, 0 +Statistics/DisplayingData/Boxplot.pg, 1, -1, 0 +Statistics/DisplayingData/FiveNumAndPlot.pg, 1, -1, 0 +Statistics/DisplayingData/FiveNumFromPlot.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_05_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/02Stats_08_DescrData.pg, 1, -1, 0 +Statistics/DisplayingData/02Stats_07_DescrData.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDistribution_of_Sample_Mean.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDistribution_of_Sample_Mean.def new file mode 100644 index 0000000000..61403272c1 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDistribution_of_Sample_Mean.def @@ -0,0 +1,23 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/20/2015 at 10:00pm PDT +answerDate = 05/20/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = distribution of the sample mean +problemList = +Statistics/CentralLimitTheorem/ur_pb_11_1.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/di1.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/di2.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/di3.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/di4.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/dueck7_3_4.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_07_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_10_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_13_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/ur_pb_11_5.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/ur_pb_11_6.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-06.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-08.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-09.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-12.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setEmpirical_Rule.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setEmpirical_Rule.def new file mode 100644 index 0000000000..d8467c22f9 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setEmpirical_Rule.def @@ -0,0 +1,12 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/15/2015 at 10:02pm PDT +answerDate = 04/15/2015 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = using the Empirical Rule to calculate probabilities and other values +problemList = +Statistics/zScoreEmpiricalRule/03Stats_04_NormalDist.pg, 1, -1, 0 +Statistics/DisplayingData/stat212-HW02-03.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/empirical_rule1.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/empirical_rule2.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExpected_Value_and_Variance.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExpected_Value_and_Variance.def new file mode 100644 index 0000000000..46cf390525 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExpected_Value_and_Variance.def @@ -0,0 +1,18 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/06/2015 at 10:00pm PDT +answerDate = 05/06/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = expected value and variance of discrete random variables +problemList = +Statistics/ExpectedValueAndVariance/stat212-HW05-05.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/stat212-HW05-06.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/stat212-HW05-08.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/ur_pb_7_9a.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/ur_pb_7_6.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/ur_pb_7_5.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/exval3.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/expectedvalue1.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/ExpectedValue.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/stat212-HW05-12.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExperimental_Design.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExperimental_Design.def new file mode 100644 index 0000000000..61e4f3cc04 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExperimental_Design.def @@ -0,0 +1,25 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/26/2015 at 10:01pm PDT +answerDate = 04/26/2015 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = experiments and observational studies; factors, levels, and treatments +problemList = +Statistics/ExperimentalDesign/dueck1_5_1.pg, 1, -1, 0 +Statistics/ExperimentalDesign/dueck1_5_2.pg, 1, -1, 0 +Statistics/ExperimentalDesign/dueck1_5_3.pg, 1, -1, 0 +Statistics/ExperimentalDesign/dueck1_5_4.pg, 1, -1, 0 +Statistics/ExperimentalDesign/dueck1_5_5.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_09_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_08_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_07_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_06_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_05_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_04_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_03_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_02_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_01_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/stat_inference4.pg, 1, -1, 0 +Statistics/ExperimentalDesign/stat_inference1.pg, 1, -1, 0 +Statistics/ExperimentalDesign/kolossa59.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setGeneral_Probability.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setGeneral_Probability.def new file mode 100644 index 0000000000..846f543806 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setGeneral_Probability.def @@ -0,0 +1,19 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/03/2015 at 10:00pm PDT +answerDate = 05/03/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = probability calculations; probability formulas; independent events +problemList = +Statistics/ProbabilityRulesAndTools/ur_pb_3_11.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/10Stats_05_Probability.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/10Stats_03_Probability.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/dueck5_2_4.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/10Stats_09_Probability.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/p1.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/dueck5_3_5.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/dueck5_3_6.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/kolossa7.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_4_9.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/kolossa27.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Area_for_Arbitrary_z.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Area_for_Arbitrary_z.def new file mode 100644 index 0000000000..84723c4a16 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Area_for_Arbitrary_z.def @@ -0,0 +1,25 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/15/2015 at 10:03pm PDT +answerDate = 04/15/2015 at 10:03pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = calculating with the Normal distribution when the Empirical Rule does not necessarily apply +problemList = +Statistics/zScoresInGeneral/normprob1.pg, 1, -1, 0 +Statistics/zScoresInGeneral/normal_dist3.pg, 1, -1, 0 +Statistics/zScoresInGeneral/normal_dist2.pg, 1, -1, 0 +Statistics/zScoresInGeneral/empirical_rule5.pg, 1, -1, 0 +Statistics/zScoresInGeneral/gust41.pg, 1, -1, 0 +Statistics/zScoresInGeneral/gust37.pg, 1, -1, 0 +Statistics/zScoresInGeneral/dueck6_3_3.pg, 1, -1, 0 +Statistics/zScoresInGeneral/dueck6_3_1.pg, 1, -1, 0 +Statistics/zScoresInGeneral/03Stats_11_NormalDist.pg, 1, -1, 0 +Statistics/zScoresInGeneral/03Stats_10_NormalDist.pg, 1, -1, 0 +Statistics/zScoresInGeneral/03Stats_09_NormalDist.pg, 1, -1, 0 +Statistics/zScoresInGeneral/03Stats_12_NormalDist.pg, 1, -1, 0 +Statistics/zScoresInGeneral/dueck6_2_5.pg, 1, -1, 0 +Statistics/zScoresInGeneral/empirical_rule3.pg, 1, -1, 0 +Statistics/zScoresInGeneral/normal_quartile1.pg, 1, -1, 0 +Statistics/zScoresInGeneral/normprob2.pg, 1, -1, 0 +Statistics/zScoresInGeneral/normprob3.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Distributions.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Distributions.def new file mode 100644 index 0000000000..42dc527bac --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Distributions.def @@ -0,0 +1,15 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/15/2015 at 10:01pm PDT +answerDate = 04/15/2015 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = some facts about a Normal distribution +problemList = +Statistics/zScoreEmpiricalRule/gust36.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/gust34.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/gust33.pg, 1, -1, 0 +Statistics/zScoresInGeneral/gust40.pg, 1, -1, 0 +Statistics/zScoresInGeneral/03Stats_02_NormalDist.pg, 1, -1, 0 +Statistics/zScoresInGeneral/gust39.pg, 1, -1, 0 +Statistics/zScoresInGeneral/gust38.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setOne_Variable_Calculations.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setOne_Variable_Calculations.def new file mode 100644 index 0000000000..7495987eee --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setOne_Variable_Calculations.def @@ -0,0 +1,27 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/08/2015 at 10:01pm PDT +answerDate = 04/08/2015 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = mean, median, mode; range, quartiles, inter-quartile range, standard deviation +problemList = +Statistics/BasicOneVarStats/stat212-HW02-17.pg, 1, -1, 0 +Statistics/BasicOneVarStats/dueck3_1_6.pg, 1, -1, 0 +Statistics/BasicOneVarStats/stat212-HW02-11.pg, 1, -1, 0 +Statistics/BasicOneVarStats/stat212-HW02-10.pg, 1, -1, 0 +Statistics/BasicOneVarStats/stat212-HW02-08.pg, 1, -1, 0 +Statistics/BasicOneVarStats/stat212-HW02-05.pg, 1, -1, 0 +Statistics/BasicOneVarStats/02Stats_02_DescrData.pg, 1, -1, 0 +Statistics/BasicOneVarStats/02Stats_05_DescrData.pg, 1, -1, 0 +Statistics/DisplayingData/02Stats_10_DescrData.pg, 1, -1, 0 +Statistics/DisplayingData/skew_dist1.pg, 1, -1, 0 +Statistics/DisplayingData/03Stats_01_NormalDist.pg, 1, -1, 0 +Statistics/BasicOneVarStats/data2.pg, 1, -1, 0 +Statistics/BasicOneVarStats/MeanStdDev.pg, 1, -1, 0 +Statistics/BasicOneVarStats/FiveNum.pg, 1, -1, 0 +Statistics/BasicOneVarStats/kolossa10.pg, 1, -1, 0 +Statistics/BasicOneVarStats/kolossa8.pg, 1, -1, 0 +Statistics/BasicOneVarStats/dueck3_4_3.pg, 1, -1, 0 +Statistics/BasicOneVarStats/dueck3_2_1.pg, 1, -1, 0 +Statistics/BasicOneVarStats/dueck3_4_4.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setProportion_and_Confidence_Intervals.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setProportion_and_Confidence_Intervals.def new file mode 100644 index 0000000000..23f866c778 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setProportion_and_Confidence_Intervals.def @@ -0,0 +1,27 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/27/2015 at 10:00pm PDT +answerDate = 05/27/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = confidence intervals for population proportion +problemList = +Statistics/BasicOneVarStats/19Stats_01_InferencePropn.pg, 1, -1, 0 +Statistics/BasicOneVarStats/kolossa48.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/central_limit_theorem1.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/central_limit_theorem2.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_14.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/gust50.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/gust51.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_13.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/gust52.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/kolossa49.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/kolossa50.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/kolossa51.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/kolossa55.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/19Stats_04_InferencePropn.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/19Stats_07_InferencePropn.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/19Stats_08_InferencePropn.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_15.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_18.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_19.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_Issues.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_Issues.def new file mode 100644 index 0000000000..7a3d29a4c3 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_Issues.def @@ -0,0 +1,25 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/26/2015 at 10:00pm PDT +answerDate = 04/26/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = surveys; population versus sample; sampling methods; sources of bias; parameters versus statistics +problemList = +Statistics/SamplingIssues/08Stats_08_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_07_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_06_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_05_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_03_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_02_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_01_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/stat212-HW03-02.pg, 1, -1, 0 +Statistics/SamplingIssues/stat212-HW03-01.pg, 1, -1, 0 +Statistics/SamplingIssues/stat_inference2.pg, 1, -1, 0 +Statistics/BasicOneVarStats/kolossa19.pg, 1, -1, 0 +Statistics/SamplingIssues/gust25.pg, 1, -1, 0 +Statistics/SamplingIssues/gust9.pg, 1, -1, 0 +Statistics/SamplingIssues/dueck1_4_1.pg, 1, -1, 0 +Statistics/SamplingIssues/dueck1_4_2.pg, 1, -1, 0 +Statistics/SamplingIssues/dueck1_4_3.pg, 1, -1, 0 +Statistics/SamplingIssues/dueck1_4_5.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_and_Central_Limit_Theorem.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_and_Central_Limit_Theorem.def new file mode 100644 index 0000000000..be0d86254a --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_and_Central_Limit_Theorem.def @@ -0,0 +1,19 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/20/2015 at 10:01pm PDT +answerDate = 05/20/2015 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = parameters versus statistics; the Central Limit Theorem +problemList = +Statistics/BasicOneVarStats/kolossa47.pg, 1, -1, 0 +Statistics/BasicOneVarStats/11Stats_01_SamplingDistns.pg, 1, -1, 0 +Statistics/BasicOneVarStats/11Stats_02_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_03_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_05_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_06_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_08_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/ur_pb_11_4.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-03.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-04.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-05.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setScatterplots_and_Linear_Regression.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setScatterplots_and_Linear_Regression.def new file mode 100644 index 0000000000..590b6a6acc --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setScatterplots_and_Linear_Regression.def @@ -0,0 +1,33 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 06/10/2015 at 10:00pm PDT +answerDate = 06/10/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = scatter plots; correlation; least-squares regression lines +problemList = +Statistics/ScatterplotsAndCorrelation/gust24.pg, 1, -1, 0 +Statistics/ScatterplotsAndCorrelation/Scatterplot.pg, 1, -1, 0 +Statistics/ScatterplotsAndCorrelation/ur_stt_6_2.pg, 1, -1, 0 +Statistics/ScatterplotsAndCorrelation/ur_stt_6_1.pg, 1, -1, 0 +Statistics/LinearRegression/gust16.pg, 1, -1, 0 +Statistics/LinearRegression/lines5.pg, 1, -1, 0 +Statistics/LinearRegression/lines4.pg, 1, -1, 0 +Statistics/LinearRegression/lines3.pg, 1, -1, 0 +Statistics/LinearRegression/lines2.pg, 1, -1, 0 +Statistics/LinearRegression/lines1.pg, 1, -1, 0 +Statistics/LinearRegression/dueck4_2_2.pg, 1, -1, 0 +Statistics/LinearRegression/dueck4_2_4.pg, 1, -1, 0 +Statistics/LinearRegression/gust17.pg, 1, -1, 0 +Statistics/LinearRegression/gust18.pg, 1, -1, 0 +Statistics/LinearRegression/gust19.pg, 1, -1, 0 +Statistics/LinearRegression/gust22.pg, 1, -1, 0 +Statistics/LinearRegression/gust23.pg, 1, -1, 0 +Statistics/LinearRegression/gust32.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_01_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_02_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_03_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_04_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_08_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_09_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_12_Regression.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSignificance_Testing.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSignificance_Testing.def new file mode 100644 index 0000000000..767c639002 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSignificance_Testing.def @@ -0,0 +1,28 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 06/03/2015 at 10:00pm PDT +answerDate = 06/03/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = significance testing for hypotheses about a population proportion; significance levels; type I and type II error +problemList = +Statistics/SignificanceTesting/kolossa54.pg, 1, -1, 0 +Statistics/SignificanceTesting/kolossa56.pg, 1, -1, 0 +Statistics/SignificanceTesting/kolossa57.pg, 1, -1, 0 +Statistics/SignificanceTesting/kolossa58.pg, 1, -1, 0 +Statistics/SignificanceTesting/19Stats_03_InferencePropn.pg, 1, -1, 0 +Statistics/SignificanceTesting/19Stats_05_InferencePropn.pg, 1, -1, 0 +Statistics/SignificanceTesting/19Stats_09_InferencePropn.pg, 1, -1, 0 +Statistics/SignificanceTesting/19Stats_10_InferencePropn.pg, 1, -1, 0 +Statistics/SignificanceTesting/19Stats_12_InferencePropn.pg, 1, -1, 0 +Statistics/SignificanceTesting/ur_stt_4_4.pg, 1, -1, 0 +Statistics/SignificanceTesting/dueck9_3_1.pg, 1, -1, 0 +Statistics/SignificanceTesting/kolossa30.pg, 1, -1, 0 +Statistics/SignificanceTesting/kolossa33.pg, 1, -1, 0 +Statistics/SignificanceTesting/14Stats_07_InferenceIntro.pg, 1, -1, 0 +Statistics/SignificanceTesting/14Stats_08_InferenceIntro.pg, 1, -1, 0 +Statistics/SignificanceTesting/di12.pg, 1, -1, 0 +Statistics/SignificanceTesting/di13.pg, 1, -1, 0 +Statistics/SignificanceTesting/di14.pg, 1, -1, 0 +Statistics/SignificanceTesting/dueck9_2_1.pg, 1, -1, 0 +Statistics/SignificanceTesting/ur_stt_4_10.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setVenn_Diagrams_and_Sample_Spaces.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setVenn_Diagrams_and_Sample_Spaces.def new file mode 100644 index 0000000000..5a131671d1 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setVenn_Diagrams_and_Sample_Spaces.def @@ -0,0 +1,16 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/03/2015 at 10:01pm PDT +answerDate = 05/03/2015 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = probability problems where it may help to use a Venn diagram or illustrate the sample space rather than use probability formulas +problemList = +Statistics/ProbabilityRulesAndTools/ur_pb_3_6.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_3_4.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_3_2.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/sspaces1.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/10Stats_12_Probability.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/dueck5_2_2.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/dueck5_2_5.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/compprob4.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setz_Score_Basics.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setz_Score_Basics.def new file mode 100644 index 0000000000..47d04a4e4f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setz_Score_Basics.def @@ -0,0 +1,13 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/15/2015 at 10:00pm PDT +answerDate = 04/15/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = calculating and interpreting z-scores +problemList = +Statistics/zScoreEmpiricalRule/03Stats_05_NormalDist.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/normprob6.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/kolossa20.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/03Stats_07_NormalDist.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/03Stats_06_NormalDist.pg, 1, -1, 0 diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz.def new file mode 100644 index 0000000000..bea0af5ad0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz.def @@ -0,0 +1,224 @@ +assignmentType = gateway +openDate = 06/08/2020 at 12:00am PDT +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 06/11/2020 at 10:00pm PDT +answerDate = 06/11/2020 at 10:00pm PDT +enableReducedScoring = N +paperHeaderFile = defaultHeader +screenHeaderFile = +attemptsPerVersion = 1 +timeInterval = 0 +versionsPerInterval = 0 +versionTimeLimit = 3600 +problemRandOrder = 1 +problemsPerPage = 1 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = A 20-question quiz on the derivative formulas for elementary functions. Does not include sum/difference/product/quotient/chain rules. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +problem_id = 1 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/constant.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/power_positive_integer.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/power_negative_integer.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/power_fraction.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/power_reciprocal.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/squareroot.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/sine.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/cosine.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/tangent.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/secant.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/cosecant.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/cotangent.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/arctangent.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/arcsine.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/arcsecant.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/exp.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/exp-base-integer.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/natural-log.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/absolute-value.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/nth-root.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 1 +problem_end + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/absolute-value.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/absolute-value.pg new file mode 100644 index 0000000000..aa616bb848 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/absolute-value.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("abs($x)"); +$df = $f->D($x); +$df->{test_at} = [[random(-5,-1,0.01)],[random(1,5,0.01)]]; + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arccosine.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arccosine.pg new file mode 100644 index 0000000000..c1049278ba --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arccosine.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +Context()->variables->set($x=>{limits=>[-1,1]}); +$f = Formula("cos^-1($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsecant.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsecant.pg new file mode 100644 index 0000000000..c3d1623c15 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsecant.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +Context()->variables->set($x=>{limits=>[1,10]}); +$f = Formula("sec^-1($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsine.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsine.pg new file mode 100644 index 0000000000..87773bc90f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsine.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +Context()->variables->set($x=>{limits=>[-1,1]}); +$f = Formula("sin^-1($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arctangent.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arctangent.pg new file mode 100644 index 0000000000..2f0922d51b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arctangent.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("tan^-1($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/constant.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/constant.pg new file mode 100644 index 0000000000..e3e7a8cc44 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/constant.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula(random(11,99,1)); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosecant.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosecant.pg new file mode 100644 index 0000000000..83bd47284d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosecant.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("csc($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosine.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosine.pg new file mode 100644 index 0000000000..03d03cc001 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosine.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("cos($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cotangent.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cotangent.pg new file mode 100644 index 0000000000..1ad507b7ab --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cotangent.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("cot($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp-base-integer.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp-base-integer.pg new file mode 100644 index 0000000000..56ae67d3de --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp-base-integer.pg @@ -0,0 +1,87 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$b = random(2,9,1); +$f = Formula("($b)^($x)"); +Context()->flags->set(reduceConstantFunctions=>0); +$df = Formula("ln($b) ($b)^($x)"); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp.pg new file mode 100644 index 0000000000..773d1c8464 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("e^($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/natural-log.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/natural-log.pg new file mode 100644 index 0000000000..079462a3ed --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/natural-log.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("ln($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/nth-root.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/nth-root.pg new file mode 100644 index 0000000000..e067d62509 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/nth-root.pg @@ -0,0 +1,90 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserRoot.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Fraction"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$n = random(3,9,1); +Context()->variables->set($x=>{limits=>[0.1,10]}); +parser::Root->Enable; +$f = Formula("root($n,$x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_fraction.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_fraction.pg new file mode 100644 index 0000000000..cb8cb2f916 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_fraction.pg @@ -0,0 +1,89 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Fraction"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +($m,$n) = num_sort((1..9)[NchooseK(9,2,1)]); +Context()->variables->set($x=>{limits=>[0.1,10]}); +$f = Formula("$x^($m/$n)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_negative_integer.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_negative_integer.pg new file mode 100644 index 0000000000..ac57c4eb3c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_negative_integer.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$n = random(5,20,1); +$f = Formula("$x^(-$n)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_positive_integer.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_positive_integer.pg new file mode 100644 index 0000000000..c484934f5b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_positive_integer.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$n = random(5,20,1); +$f = Formula("$x^$n"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_reciprocal.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_reciprocal.pg new file mode 100644 index 0000000000..ef878f4880 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_reciprocal.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$n = random(5,20,1); +$f = Formula("1/$x^$n"); +$df = Formula("-$n/$x^($n+1)"); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/secant.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/secant.pg new file mode 100644 index 0000000000..43fbd63bf0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/secant.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("sec($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/sine.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/sine.pg new file mode 100644 index 0000000000..50ee9983ec --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/sine.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("sin($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/squareroot.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/squareroot.pg new file mode 100644 index 0000000000..224c08e8f3 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/squareroot.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +Context()->variables->set($x=>{limits=>[0.1,10]}); +$f = Formula("sqrt($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/tangent.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/tangent.pg new file mode 100644 index 0000000000..c1005d9cb7 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/tangent.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("tan($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation01.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation01.pg new file mode 100644 index 0000000000..0dcdc156d4 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation01.pg @@ -0,0 +1,49 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("LimitedNumeric"); + + + +###################################### + + +BEGIN_PGML +## Entering an Answer and Reading Feedback ## + +Hello and welcome to the WeBWorK orientation. + +Most of the time, you will be using WeBWorK to submit answers to math questions. Answers will typically either be numbers or expressions with variables. + +Let's start off simple. What is the value of [`2+2`] ? Type your answer in the box below, but be patient and keep reading below. + + [_______]{Real(4)} + +Below, you have two buttons available: _Preview Answers_ and _Submit Answers_. +1. Push the _Submit Answers_ button, and see that you have the right answer. +2. Try typing in a number that is wrong and pushing the _Submit Answers_ button. +3. Sometimes you might completely misunderstand a question and your answer is way off base. WeBWorK will try to make you see this. Try typing in the expression [`x`] as the answer and pushing the _Submit Answers_ button. In the box above, _read the feedback message_ that arises. Do you understand what that feedback message is saying and how it applies to your answer? + +As you use WeBWorK and inevitably get some questions wrong on your first attempt, make sure that you read the feedback messages. + +If you are ready, move on to the next problem in this orientation. You my either use the _Next_ button above, or directly click on _Problem 2_ to the left. + + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation02.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation02.pg new file mode 100644 index 0000000000..25b1c089de --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation02.pg @@ -0,0 +1,108 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"contextLimitedRadical.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Fraction"); +$u = random(1,3); +$v = random(4,10); +$w = Fraction($u,$v); + +$a = random(2,8,1); +$b = random(2,8,1); +$c = random(2,8,1); +$d = $a*$b+$c; + +Context("Numeric"); +Context()->flags->set(reduceConstantFunctions=>0); +$e = Compute("$a/x"); +$h = Formula("sqrt(x)"); +$h->{limits} = [2,5]; + +Context("Numeric"); +Context()->variables->are(k=>'Real'); +$f = Compute("k^$a"); + +Context("Numeric"); +Context()->variables->are(K=>'Real'); +$g = Compute("$b^K"); + +Context("LimitedRadical"); +$i = Formula("root(4,11)"); + + +###################################### + + +BEGIN_PGML +## Basic Operations ## + +The four basic arithmetic operations are: + [`+, -, \times, \div`] + +Each of these has a corresponding character on the keyboard. The first two are found in the upper right area of most keyboards. For [`\times`] (which is also often denoted with [`\cdot`] on paper), we use the asterisk character: +: \* +This is the shift-8 key on most keyboards. + +Try literally entering [`[$a]\cdot[$b]+[$c]`] by typing it exactly as: +: [$a]\*[$b]+[$c] + + [_________]{Compute($a*$b+$c)->cmp(formatStudentAnswer=>'parsed')} + +Of course you could also simplify this to [`[$d]`]. + +Division is typed using the slash character: +: / +which is in the lower right of most keyboards. Try entering the following: + + + [::[$w]=::] [____]{$w} + + [::[$e]=::] [_________]{$e} + +Raising to a power is universally denoted with the caret symbol: +: [$CARET] +This is usually shift-6 on a keyboard. Try entering the following: + + [::[$f]=::] [____]{$f} + + [::[$g]=::] [____]{$g} + +This is a good time to point out that _capitalization matters_. In math, [`k\neq K`]. See what happens if you use the wrong capitalization in the above answers. If you are not getting one of these answers correct, is it because of capitalization? + +Another common basic operation is the square root, which is denoted with [`\sqrt{\phantom{x}}`] on paper. There is no square root character on most keyboards, so we do something else with this operation. We use: +: sqrt +and parentheses, as in: +: sqrt(x) +for [`\sqrt{x}`]. + +Try entering the following: + + [::[$h]=::] [_________]{$h} + +[%We also sometimes use radicals of higher order. For example the cube root of [`x`] is denoted [`\sqrt[3]{x}`], and this would be typed as: +: root(3,x) +This will only be an option in problems that are potentially expecting you to use it. Try entering the following:%] + +[% [``[$i]=``] [_________]{$i}%] + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg new file mode 100644 index 0000000000..a849a5f924 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg @@ -0,0 +1,61 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"parserNumberWithUnits.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Numeric"); +Context()->variables->add(t=>'Real'); + +$a = random(2,8,1); +$b = random(2,8,1); +$c = random(2,8,1); + +$f = Compute("sqrt($a x+ $b)"); +$f->{limits} = [-$b/$a + 1, -$b/$a + 10]; + +$g = Compute("(t-$b)/(4t+1)"); + +###################################### + + +BEGIN_PGML +## MathQuill ## + +In answer blanks, as you type, math expressions are built. For example if you type the characters [|5^2t|]* it will create [`5^{2t}`]. That is, it will put [|2t|]* up in the exponent and you don't have to see the [|^|]* character. + +Also when your cursor is in an answer blank, a math palette tool is available off to the side of the screen. This can help you construct math expressions. + +For practice, try typing or using the palette tool to enter these expressions: + + [`5^{2t}=`] [_____]{Compute("5^(2t)")} + + [``\frac{1}{[$a](x+[$c])}=``] [__________]{Compute("1/($a(x+[$c]))")} + + [``\sqrt{[$a] x + [$b]}=``] [__________]{$f} + + [``\frac{t-[$b]}{4t+1}=``] [__________]{$g} + +Sometimes you really want an answer to be exactly the way you typed it and not automatically turned into a nice-looking math expression. If this is the case, use the "Tt" button on the palette tool. Or you can type the " key. Either way, you enter what is called "text mode" and whatever you type in the answer blank will be left as it is. Try: + + [``23\,\text{degC}=``] [__________]{NumberWithUnits("23 degC")} + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg.bak b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg.bak new file mode 100644 index 0000000000..2a93126a7f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg.bak @@ -0,0 +1,65 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Numeric"); +Context()->variables->add(t=>'Real'); + +$a = random(2,8,1); +$b = random(2,8,1); +$c = random(2,8,1); + +$f = Compute("sqrt($a x+ $b)"); +$f->{limits} = [-$b/$a + 1, -$b/$a + 10]; + +$g = Compute("(t-$b)^(4t+1)"); +$g->{limits} = [$b + 1, $b + 10]; + +###################################### + + +BEGIN_PGML +## Preview Answer and Order of Operations ## + +WeBWorK understands the order of operations very well, and interprets what you type according to them. Sometimes students will intend to enter an expression like [`5^{2t}`], but not use the right order of operations when typing. WeBWorK wants you to confirm that what you intended to enter is what you actually entered, and so it provides an *Answer Preview* column when you submit any answers. For instance, try the following: + + [`5^{2t}=`] [_____]{Compute("5^(2t)")} + +but try entering it as: +: 5^2t +which is incorrect. Go ahead and push the _Submit Answers_ button. Note how the *Answer Preview* column is showing you what WeBWorK thinks you entered. It treats the [$CARET] as higher priority than the multiplication, and computes [`5^2`]. _Then_ it multiplies this by [`t`]. So it sees [`5^2t`]. The correct way to enter [`5^{2t}`] is: +: 5^(2t) +using parentheses to change the priorities according to the order of operations. + +The lesson is that if your answer is marked incorrect, along with looking for any feedback messages, you should also look at the *Answer Preview* column and you may see that you have not used grouping symbols well. + +Try entering the following correctly: + + [``\frac{1}{[$a](x+[$c])}=``] [__________]{Compute("1/($a(x+[$c]))")} + + [``\sqrt{[$a] x + [$b]}=``] [__________]{$f} + + [``(t-[$b])^{4t+1}=``] [__________]{$g} + +When you have an answer typed into an answer blank and you hit the _enter/return_ key on your keboard, the effect is the same as pushing the *Answer Preview* button. It does _not_ actually submit your answer to see if it is right or wrong; it only lets you see how WeBWorK would interpret what you have typed. + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation04.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation04.pg new file mode 100644 index 0000000000..8523ababad --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation04.pg @@ -0,0 +1,69 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("LimitedFraction"); +Context()->flags->set(allowMixedNumbers=>0); + +$a = Fraction(1,3); + +Context("Numeric"); + +$b = Real("$a"); + +Context("LimitedNumeric"); +Context()->constants->remove("pi"); + +$c = Real(1/9); +$d = sqrt(110); +$e = 3.1415926; +$f = Real(5/2); + +###################################### + + +BEGIN_PGML +## Decimal Approximations to Answers ## + +Imagine that the true answer to a problem is [:1/3:]. As you may know, this fraction is equal to the decimal number [`0.3333\ldots`], which is also written as [`0.\overline{3}`]. + +Sometimes, your instructor will require you to enter the answer _exactly_. In that case your only option is to enter [:1/3=:] [_________]{$a}. + +Sometimes, you will be allowed to get away with decimal _approximations_ to the real answer. So for instance, in _this_ answer blank we can get away with typing [`0.3333`] even though that is slightly different from the true value: [:1/3=:] [_________]{$b}. + +Here is what you need to know: _If_ a decimal approximation is acceptable at all, then your answer will be counted correct if you have the first _three_ significant digits correct. + +Take out a calculator and enter decimal approximations for these values. At first, try rounding your calculator's outputs to only two significant digits. Then move up to three. Three significant digits will be required for each and every one of these to count as correct. _These questions are trying to teach you that you should be in the habit of using three significant digits when entering decimal answers._ + + [`1/9 =0.11111111\ldots=`] [_________]{$c} (Try typing [|0.1|]*, [|0.11|]*, [|0.111|]*, etc. What is counted correct?) + + [`\sqrt{110} =10.4880885\ldots=`] [_________]{$d} (Try typing [|10|]*, [|10.4|]*, [|10.5|]*, etc. What is counted correct?) + + [`0.002038 =`] [_________]{0.002038} (Try typing [|0.002|]*, [|0.0020|]*, [|0.00203|]*, [|0.00204|]*, etc. What is counted correct?) + + [`20380.2 =`] [_________]{20380.2} (Try typing [|20000|]*, [|20300|]*, [|20400|]*, etc. What is counted correct?) + +With the third question, students sometimes feel they should be able to get away with [`0.002`], since that is only off by a tiny amount of [`0.000038`]. However, percentage-wise this would be off by over [`1.8%`], which is generally considered unacceptable. By always answering using three significant digits, your percentage error will always be very small. + +With the last question, students mistakenly believe they must enter the entire number. While that's fine, it's OK to round to three significant digits. So you may simply enter [`20400`]. + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation05.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation05.pg new file mode 100644 index 0000000000..1ab8a9ca7c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation05.pg @@ -0,0 +1,70 @@ +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); +$a = random(2,9,1); +$b = random(2,9,1); +$c = Real("$a+$b"); + + +Context("LimitedNumeric"); +$d = random(2,9,1); +$e = random(2,9,1); +$f = Real($d+$e); + +Context("LimitedFraction"); +$g = Fraction(1,3); + +Context("LimitedRadical"); +$h = Formula("2 sqrt(3)"); + + +###################################### + + +BEGIN_PGML +## Simplifying Answers ## + +Your instructor may require you to simplify answers sometimes, and other times simplifying might not be the point of the exercise. For instance, in the following: + [`[$a]+[$b]=`] [_____]{$c} + +You could certainly enter [`[$c]`]. But does it surprise you to learn that you could literally enter [`[$a]+[$b]`] and have it counted correct? In this answer blank, you could enter virtually any expression that would works out to [`[$c]`]. Try finding other creative ways to enter this answer. + +On the other hand, here that ability has been turned off; try entering the answer unsimplified: + [`[$d]+[$e]=`] [_____]{$f} + +Are you paying attention to the feedback messages that WeBWorK gives you? Try entering the following _without_ simplifying: + [``\frac{2}{6}=``] [_____]{$g} +and WeBWorK will tell you that your answer has not yet been simplified. + +You might know that [`\sqrt{12}`] can be simplified to [`2\sqrt{3}`]. (This is considered simpler because what is inside the radical is smaller.) But try entering [`\sqrt{12}`] without any simplification and seeing what the feedback message is: + [`\sqrt{12}=`] [_____]{$h} + + +Of course, there will be plenty of times when your instructor will not require answers like these to be simplified. You should just be aware that it is a possibility, and you should monitor WeBWorK's feedback messages. When you are ready, move on to the next question. + + + + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation06.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation06.pg new file mode 100644 index 0000000000..b653e0c566 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation06.pg @@ -0,0 +1,84 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); + +$a = random(5,10,1); + + +###################################### + + +BEGIN_PGML +## Navigating WeBWorK ## + +[@ if($envir{QUIZ_PREFIX}) {'*Important:* This page is informational only and features described applies mostly to homework (not used in this course) rather than quizzes.'} @]** + +That's enough for now about how you enter your answers. Let's spend some time learning how to navigate WeBWorK so that you can use it more effectively. + +By now you've had experience with the _Next_ button above. The _Previous_ button takes you to the previous problem, and the _Problem List_ button takes you back to the beginning of this problem set. + +At the bottom of a problem screen, you may see how many times you have attempted a problem, and how many times you have left. Sometimes you also see whether or not partial credit is possible, and if so how much do you have. This particular problem is lying about how many attempts you have used. How many attempts does it _say_ that you have used so far? [______]{Compute($a)} + +On the left of the screen there are three panels. The middle panel is just a quick way for you to jump to other problems in the problem set. The top panel lets you find your way to +* *Homework Sets*: this is the screen you were at when you first logged in. It shows you all of the homework sets that have been assigned to you and when they are due. +* *User Settings*: + * If you would like to change your password, go here. + * You may also change your contact email to something that you find more convenient here. However the law requires that your instructor is only permitted to communicate with you about grades using your official school email address. So we recommend that you leave your email address alone. Check your school email address often. + * There are some other settings that you can save for your account. +* *Grades*: Go here to see how you have performed in your assignments. +* *Achievements*: If your instructor is using Math Achievements, then you can earn badges and level up as you complete homework problems. Go here to view your level and badges. Also, if you have earned any items that can be applied to your homework sets, you will see them here. + +Also in *User Settings*, you may choose either to see or not see your previously entered answers, and choose whether or not to enable the math editing tool (this is only an option if the instructor has turned on that tool in the first place). + +When you are ready, move on to the next problem. + + + +END_PGML + + +###################################### + +install_problem_grader(sub { + my ($result,$state) = std_problem_grader(@_); + my $time = time(); + my $open = $time >= $openDate && $time <= $dueDate; + my $submit = $inputs_ref->{submitAnswers}; + my $attempts = $state->{num_of_correct_ans} + $state->{num_of_incorrect_ans}; + $attempts-- if $attempts && !$submit; + + my @msg = (); + push(@msg,"Your score was ".($open ? "" : "not "). "recorded.") if $submit; + push(@msg,"You have attempted this problem $a time".($a== 1 ? "." : "s.")); + push(@msg,"You have unlimited attempts remaining."); + if ($submit) { + if ($result->{score} == 1) { + push(@msg,"You received a score of 100% for this attempt."); + push(@msg,"Your overall recorded score is 100%."); + } else { + push(@msg,"Your answers are not yet fully correct."); + } + } + unless ($open) { + push(@msg,"The homework set is not yet open.") if $time < $openDate; + push(@msg,"The homework set is closed.") if $time > $dueDate; + } + + $state->{state_summary_msg} = join('
',@msg); + return ($result,$state); + }); + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation07.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation07.pg new file mode 100644 index 0000000000..57707ba5e1 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation07.pg @@ -0,0 +1,55 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); + + + +###################################### + + +BEGIN_PGML +## Seeking Help ## + +The primary purpose of WeBWorK is that it allows you to practice some math problems and immediately get feedback about your answers. This is much better than waiting a full week to learn about your answers from written homework. WeBWorK will even often give you _intelligent_ feedback if you are reading the feedback messages. + +If you become stuck on a problem, cannot get the answer correct, do not understand what the problem asks, think there is a bug with the problem, or all of the above, then... +1. Check that you have read any feedback messages WeBWorK is giving, and that you have not rounded your answer too much. +2. Reread the problem carefully to see if there are any instructions that you did not notice. +3. Check your textbook and notes to see if you can learn from them. +4. There is an *Email Instructor* button below: use it. + +When you use this button, you should write a message to your instructor (or TA) explaining what you have tried. It will help a lot if you write down the steps of the math that you have worked out too. You can even attach a file, for example a picture of your hand-written work. Then the instructor gets your message along with a link to the problem from _your perspective_, and they can also see all of your previously attempted answers. This way your instructor can write you back with good help/hints. + +Writing for help is OK! Yes, it is last on this list, but that is just because it is good for you to try to be self sufficient. There is a lot you can gain from WeBWorK's feedback, your textbook, and your notes. If you feel it is appropriate to contact your instructor for help, then do so! + +This answer blank is expecting a certain answer: [___________]{Real(112358)->cmp(tolType=>'absolute',tolerance=>0.1)}. The only way to get the answer is to use the *Email Instructor* button and politely ask for the answer to this Orientation Problem. The instructor will reply to your email as soon as they are able to, which may be the following day. (Instructors: you can check the box to show "Correct Answers" and then use the "Check" button to see the answer and write a response to your student.) + +If you don't get a reply within 12 hours, please check your SPAM folder. Google mail will sometimes direct WeBWorK emails to SPAM. This only happens to about 1 in 30 people, but it does happen. If this happens to you just click the option telling Google mail that email from that sender is not SPAM and you should be good for the rest of the term. If you do not find anything in your SPAM folder either, contact your instructor with email outside of WeBWorK. + + + + + + + +END_PGML + + +###################################### + + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation08.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation08.pg new file mode 100644 index 0000000000..bab282a5d9 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation08.pg @@ -0,0 +1,44 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); +$a = random(1000,9999,0.1); + + + +###################################### + + +BEGIN_PGML +## Printing off a Homework Set ## + +For many reasons, you might not be able to work through an entire problem set while sitting online in front of a computer screen. From the *Homework Sets* page, you may push the button to the left of a homework set to download a PDF version of the homework set. + +This file is something that you can read onscreen while you are not online. You can even print it off and take it to a tutoring center or your favorite coffee shop to work on. (Please do not waste paper by actually printing an assignment unless you feel that it is necessary.) + +To make sure that you understand how this works, download the PDF version of this Orientation assignment. At the end of this problem in the PDF, you will find the answer to this answer blank: [___________]{Compute("$a")->cmp(tolType=>'absolute',tolerance=>0.1)} + + +END_PGML + +if ($displayMode eq 'TeX') { +TEXT("The answer is $a."); +} + +###################################### + + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation09.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation09.pg new file mode 100644 index 0000000000..1c5915ef55 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation09.pg @@ -0,0 +1,57 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Interval"); +Context()->variables->add(a=>'Real',b=>'Real'); + + + +###################################### + + +BEGIN_PGML +## Miscellaneous ## + +Here are more WeBWorK features. + +* After an assignment is due, you typically will be able to see the answers to all questions. You must go back into the problem set and check the _Show correct answer_ box. This box is not visible before the due date, and quite possibly for just a little while after the due date too. +* Some problems have been coded with walk-through solutions. You will not be able to see these until it's also possible for you to see the answers. +* Some problems have been coded with hints. You will not be able to see these until you've used some number of attempts on the problem. +* Once the due date has passed, you can still enter answers in the answer blanks and WeBWorK will still give you the same feedback; just not for credit. +* Captial letters are different than lowercase letters when it comes to variables. In an answer to a WeBWorK question, [`\pi r^2`] might be correct while [`\pi R^2`] is not. +* When you click on a problem set, there is set-specific information from your instructor in a panel to the right. Always read this before you begin the problems set. It may give you important hints. +* Repeated guessing is not helpful. If you have gotten a problem incorrect several times, you should ask for help. That's what your instructor, TAs, and tutors are here for. +* Have we mentioned enough times that you should read the feedback messages? +* For decimal answers, get in the habit of using three significant digits. +* If you want to enter [`\pi`], you could type [|pi|]*, paste the π character, press [|option-p|]* on a Mac, or use the palette tool. +* If you want to enter [`\infty`], you could type [|inf|]*, type [|infinity|]*, paste the ∞ character, press [|option-%|]* on a Mac, or use the palette tool. +* All of your submissions are permanently recorded. That means you can log off at any time and all of your work will be saved. So you can do assignments in little bits at a time and work out of order if you like. +* WeBWorK can be used on tablets and smartphones. +* Most problems are coded with randomization. This means that while you and your classmate may have the same skeleton of a problem, the numbers invloved are different. This encourages you to teach each other the _process_ of answering a problem without being able to simply share the answers. + +The collection of all of the numbers between [`0`] and [`\pi`] including the endpoints is represented as [`[0,\pi]`] in interval notation. Practice entering [`[0,\pi]`] in the answer blank: [_____]{Compute("[0,pi]")}. + +What is the symbol that is used to represent a quantity that is conceptually larger than any number? [_____]{Compute("inf")} + +The answer to the following is something like [`\pi AB`], but that's not accepted because the actual answer has lowercase variables. Try entering both [`\pi AB`] and [`\pi ab`]: [_____]{Compute("pi a b")} + +END_PGML + + +###################################### + + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation10.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation10.pg new file mode 100644 index 0000000000..6bf90736d3 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation10.pg @@ -0,0 +1,95 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGchoicemacros.pl", +"unionTables.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); +$showPartialCorrectAnswers = 1; + +# +# Create a matching list and use popups +# +$ml = new_match_list(); +$ml->rf_print_q(~~&pop_up_list_print_q); +$ml->ra_pop_up_list([ +"No answer" => "?", +"A" => "A", "B" => "B", "C" => "C", +"D" => "D", "E" => "E", "F" => "F", +"G" => "G", "H" => "H", "I" => "I", +"J" => "J", "K" => "K", "L" => "L", +"M" => "M", "N" => "N", "O" => "O", +"P" => "P", "Q" => "Q", "R" => "R", +]); + +# +# Add correct questions and answers +# +$ml->qa( +"If your answer is marked incorrect, you should read ...", + "the feedback messages, if there are any", +"Raising to a power uses ...", + "the $CARET character", +"To confirm that you typed what you think you typed, look at ...", + "the Answer Preview column", +"If a decimal answer is acceptable, you should use ... significant digits", + "three", +"If you have an answer wrong after several attempts, have read any feedback messages, have not rounded your answer too much, and have tried using your textbook and/or notes, then you should use ...", "the Email Instructor button", +"If you email your instructor for help, you should include ...", + "what work you have tried", +"It's possible to create ... if you do not want to do the entire assignment on-line or on-screen", + "a PDF file", +"After a problem set is due, you can often see ...", + "the answers", +); +$ml->choose(8); + +# +# Add extra incorrect answers +# +$ml->extra( +"two", +"two decimal points", +"a robot", +"the source code", +"your email address", +"the * character", +"more attempts", +"the mood lighting", +"your watch", +); +$ml->choose_extra(9); + +#$ml->makeLast("None of the above"); + + +###################################### + + +BEGIN_PGML +## Quiz ## + +And now, a little check to see if you have learned the more important things from this orientation. + +[@ ColumnMatchTable($ml,valign => TOP) @]* + + + +END_PGML + + +###################################### + +ANS( str_cmp( $ml->ra_correct_ans ) ); + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation11.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation11.pg new file mode 100644 index 0000000000..d7c28786f0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation11.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Orientation problem about how to enter units +# +# +# +# ENDDESCRIPTION + +## DBsubject('Numbers') +## DBchapter('Real numbers') +## DBsection('Misc.') +## KEYWORDS('units') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + "parserNumberWithUnits.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +$length = random(1,99,1); +$lengthans = NumberWithUnits($length,"ft"); + +$area = $length; +$areaans = NumberWithUnits($area,"m^2"); + +$acceleration = random(5,10,1); + + +Context("Currency")->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); + +$finance1 = random(15,95,5); +$financeans1 = Currency($finance1); + +$finance2_dollar = random(1,99,1); +$finance2_cent = random(1,99,1); +$financeans2 = Currency($finance2_dollar+$finance2_cent/100); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +The following questions practice how to enter units in WeBWorK. Enter a number with a unit as your answer. Note that if a unit is already shown after the textbox, there is no need to enter the unit again. + +For finance related units, enter the dollar sign, followed by the money amount. + +For non-finance related units, enter the number first, followed by a space, and then followed by the unit. + + *Finance* + [@numberWord($finance1)@] dollars + + [_________]{$financeans1} + + [@numberWord($finance2_dollar)@] dollars and [@numberWord($finance2_cent)@] cents + + [_________]{$financeans2} + + *Length* + A rectangle's base is [@numberWord($length)@] feet long (WeBWorK recognizes *ft* as the unit feet). + + [_________]{$lengthans} + + *Area* + A rectangle's area is [@numberWord($area)@] square meters (WeBWorK recognizes *m^2* as the unit square meter). + + [_________]{$areaans} + + *Physics* + A car is accelerating at [@numberWord($acceleration)@] feet per second squared. + + [_________]{$acceleration} [` \frac{\text{ft}}{\text{s}^2} `] + +END_PGML + + + +############################################## +$showPartialCorrectAnswers=1; + +BEGIN_PGML_SOLUTION + +Here are the solutions: + + *Finance* + [@numberWord($finance1)@] dollars + + [`[$financeans1]`] + + [@numberWord($finance2_dollar)@] dollars and [@numberWord($finance2_cent)@] cents + + [`[$financeans2]`] + + *Length* + A rectangle's base is [@numberWord($length)@] feet long (WeBWorK recognizes *ft* as the unit feet). + + [`[$lengthans]`] + + *Area* + A rectangle's area is [@numberWord($area)@] square meters (WeBWorK recognizes *m^2* as the unit square meter). + + [`[$area] \text{ m^2}`] + + *Physics* + A car is accelerating at [@numberWord($acceleration)@] feet per second squared. + + [`[$acceleration]`] [` \frac{\text{ft}}{\text{s}^2} `] + +Note that there is no need to enter unit for the last problem, as the unit is already there. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation12.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation12.pg new file mode 100644 index 0000000000..f7bd573185 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation12.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Orientation problem on how to enter a mixed number. +# +# Last edited: Carl Yao 1/6/2015 +# +# ENDDESCRIPTION + +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>0); +Context()->flags->set(showMixedNumbers=>1); + +$int = random(1, 5, 1); +do { + $den = random(4, 9, 1); + $num = random(1, $den-1, 1); +} until (gcd($num,$den)==1); +$frac = Fraction($num,$den); + +$ans = $int + $frac ->reduce; + +if ($den==5) { + $ordinal = "fifth"; +} elsif ($den==8) { + $ordinal = "eighth"; +} elsif ($den==9) { + $ordinal = "ninth"; +} else { + $ordinal = numberWord($den)."th"; +} + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Enter the following mixed number: [@numberWord($int)@] and [@numberWord($num)@] [$ordinal] + +A space is needed between the integer and the fraction. + + [___________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Here is the way to enter the mixed number: + + [` [$int] \text{ } [$num]/[$den] `] + +Note that a space is needed between the integer and the fraction. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation15.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation15.pg new file mode 100644 index 0000000000..f522bdda28 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation15.pg @@ -0,0 +1,47 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("LimitedNumeric"); + +$a = random(1,5,1); +$ans = 2*$a; + +###################################### + + +BEGIN_PGML +## Learn from solution and try a different version. ## + +What is the value of [`[$a]+[$a]`] ? Let's intentionally type a wrong answer in the box below. + + [_______]{$ans} + +Check the text box _CorrectAnswers_, and then click on _Submit Answers_ button. Now you can see the solution to this problem. + +Once you learned how to do this problem, click on the button _Show Me Another_. Now you can do the same problem with different numbers. You can keep doing this until you feel you have learned the concept. + +Now go to the next problem in the orientation. + +END_PGML + + +###################################### + +BEGIN_PGML_SOLUTION + + [`` [$a]+[$a] = [$ans] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation20.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation20.pg new file mode 100644 index 0000000000..6f258fa2df --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation20.pg @@ -0,0 +1,85 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Fraction"); +$u = random(1,3); +$v = random(4,10); +$w = Fraction($u,$v); + +$a = random(2,8,1); +$b = random(2,8,1); +$c = random(2,8,1); +$d = $a*$b+$c; + +Context("Numeric"); +$e = Compute("(x+$a)/x"); +$h = Compute("sqrt(x+$b)"); + +Context("Numeric"); +Context()->variables->are(k=>'Real'); +$f = Compute("k^$a"); + +Context("Numeric"); +Context()->variables->are(K=>'Real'); +$g = Compute("$b^(K+1)"); + + + +###################################### + + +BEGIN_PGML +## Basic Operations ## + +The four basic arithmetic operations are: + [``+, -, \times, \div``] + +Each of these has a corresponding character on the keyboard. The first two are found in the upper right area of most keyboards. For [`\times`] (which is also often denoted with [`\cdot`] on paper), we use the asterisk character (\*). This is the shift-8 key on most keyboards. + +Try literally entering [`[$a]\cdot[$b]+[$c]`] + + [___________]{Compute($a*$b+$c)->cmp(formatStudentAnswer=>parsed)} + +Of course you could also simplify this to [`[$d]`]. + +Division is typed using the slash character (/), which is in the lower right of most keyboards. Try entering the following: + + + [::[$w]=::] [___________]{$w} + +Raising to a power is universally denoted with the caret symbol ([$CARET]). This is usually shift-6 on a keyboard. Try entering the following: + + [::[$f]=::] [___________]{$f} + + [::[$g]=::] [___________]{$g} + +For [::[$g]::], you need to enter a pair of parenthsis, like [`[$b]\wedge(K+1)`]. If you entered [`[$b]\wedge K+1`], WeBWorK would interpret it as [`[$b]^K+1`], which is incorrect. + +This is a good time to point out that capitalization matters. In math, [`k\neq K`]. See what happens if you use the wrong capitalization in the above answers. + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + +BEGIN_PGML_SOLUTION + +Re-read the instructions! :) + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation25.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation25.pg new file mode 100644 index 0000000000..deb944c512 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation25.pg @@ -0,0 +1,65 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Fraction"); + +$den = random(2,5,1); +$ans = random(1,5,1); +$num = $den*$ans; +$num1 = random(1,$num,1); +$num2 = $num - $num1; + +###################################### + + +BEGIN_PGML +## Using Parentheses ## + +Look at this fraction: + + [`` \frac{1+1}{2} ``] + +The value of this function should be 1. However, if you enter [` 1+1/2 `], the value will be [` 1.5 `]. This is because, by order of operations, the computer does division before doing addition: + + [`` 1+1/2 = 1+0.5 = 1.5 ``] + +This is not what we want the computer to do. So how can we tell the computer to do addition in the numerator first? We must use parentheses: + + [`` (1+1)/2 ``] + +By order of operations, the computer will handle parentheses before doing division. This time, the value is [` (1+1)/2=2/2=1 `]. + +Now, enter the fraction literally, without doing any calculation: + + [`` \frac{[$num1]+[$num2]}{[$den]} ``] = [________________]{$ans} + +If you forget to use parentheses, you will see [` [$num1] + \frac{[$num2]}{[$den]} `] in the Answer Preview field. This is incorrect. + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + +BEGIN_PGML_SOLUTION + +You should enter: _[` ([$num1]+[$num2])/[$den] `]_ + +Did you forget the parentheses? + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation26.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation26.pg new file mode 100644 index 0000000000..3c2e409388 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation26.pg @@ -0,0 +1,69 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Fraction"); +Context()->variables->are(a=>'Real',b=>'Real',c=>'Real', d=>'Real'); + +$den1 = random(1,5,1); +$den2 = random(1,5,1); +$ans1 = random(1,5,1); +$num1 = ($den1+$den2)*$ans1; + +$ans2 = Compute("(a+b)/(c-d)")->reduce; +$ans3 = Compute("a/(bc)")->reduce; +###################################### + + +BEGIN_PGML +## More about Using Parentheses ## + +Enter the fractions literally, without doing any calculation: + +1. [` \frac{[$num1]}{[$den1]+[$den2]} `] = [________________]{$ans1} + +2. [` \frac{a+b}{c-d} `] = [________________]{$ans2} + +3. [` \frac{a}{bc} `] = [________________]{$ans3} + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + +BEGIN_PGML_SOLUTION + +###Question 1 + +You should enter: [` [$num1]/([$den1]+[$den2]) `] + +If you forget to use parenthesis and entered [`[$num1]/[$den1]+[$den2]`], WeBWorK would interpret your expression as [` \frac{[$num1]}{[$den1]} + [$den2] `]. This is incorrect. + +###Question 2 + +You should enter: [` (a+b)/(c-d) `] + +If you forget to use parenthesis and entered [`a+b/c-d`], WeBWorK would interpret your expression as [` a+\frac{b}{c}-d `]. This is incorrect. + +###Question 3 + +You should enter: [` a/(bc) `] + +If you forget the parenthesis and entered [`a/bc`], WeBWorK would interpret your expression as [`\frac{a}{b}\cdot c`]. This is incorrect. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation28.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation28.pg new file mode 100644 index 0000000000..0bd2d61e85 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation28.pg @@ -0,0 +1,48 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Numeric"); +$b = random(1,10,1); +$h = Compute("sqrt(x+$b)"); +$i = Compute("sqrt(x)+$b"); + +###################################### + + +BEGIN_PGML +## square root ## + +Another common basic operation is the square root, which is denoted with [`\sqrt{\phantom{x}}`] on paper. There is no square root character on most keyboards, so we do something else with this operation. We use [|sqrt|] and parentheses, as in [|sqrt(x)|] for [`\sqrt{x}`]. Try entering the following: + +1. [::[$h]=::] [_________]{$h} +2. [::[$i]=::] [_________]{$i} + +END_PGML + + +###################################### + +BEGIN_PGML_SOLUTION + +###Question 1 + +You should enter _[$h]_ + +###Question 2 + +You should enter _[$i]_ + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation60.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation60.pg new file mode 100644 index 0000000000..1cd44e24d0 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation60.pg @@ -0,0 +1,52 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", + "parserRadioButtons.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); + +$a = random(5,10,1); + +$radio = RadioButtons( + ["Yes","No"], + "Yes", + last => ["No"], +); + + +###################################### + + +BEGIN_PGML +## Navigating WeBWorK ## + +That's enough for now about how you enter your answers. Let's spend some time learning how to navigate WeBWorK so that you can use it more effectively. + +By now you've had experience with the _Next_ button above. The _Prev_ button takes you to the previous problem, and the _Up_ button takes you back to the beginning of this problem set. + +On the left of the screen there are three panels. The middle panel is just a quick way for you to jump to other problems in the problem set. The top panel lets you find your way to +* *Homework Sets*: this is the screen you were at when you first logged in. It shows you all of the homework sets that have been assigned to you and when they are due. +* *Password/Email*: If you would like to change your password, go here. You may also change your contact email to something that you find more convenient here. However the law requires that your instructor is only permitted to communicate with you about grades using your official school email address. So we recommend that you leave your email address alone. Check your school email address often. + +Do you understand this problem's content? + +[@$radio->buttons()@]* + +END_PGML + +###################################### + +ANS( $radio->cmp() ); + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation80.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation80.pg new file mode 100644 index 0000000000..32dfdd4b2a --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation80.pg @@ -0,0 +1,48 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", + "parserRadioButtons.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); + +$radio = RadioButtons( + ["Yes","No"], + "Yes", + last => ["No"], +); + +###################################### + + +BEGIN_PGML +## Printing off a Homework Set ## + +For many reasons, you might not be able to work through an entire problem set while sitting online in front of a computer screen. From the *Homework Sets* page, you may select a problem set and click the _Download PDF or TeX Hardcopy for Selected Sets_ button. + +If you do this, one option is for you to download an Adobe PDF file. This file is something that you can read onscreen while you are not online. You can even print it off and take it to a tutoring center or your favorite coffee shop to work on. (Of course, you will need to eventually log back on to enter your answers.) + +Prove that you understand how this works by opening the PDF file for this Orientation assignment. Please do not waste paper by actually printing this Orientation assignment unless it is necessary. + +Do you understand this problem's content? + +[@$radio->buttons()@]* + +END_PGML + + +###################################### + +ANS( $radio->cmp() ); + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/PCCOrientationHeader.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/PCCOrientationHeader.pg new file mode 100644 index 0000000000..e4f5f67773 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/PCCOrientationHeader.pg @@ -0,0 +1,14 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGML.pl", +); + +BEGIN_PGML +This set of exercises is designed to orient you to WeBWorK. You will learn +how to enter answers to math problems, and you will learn how to use WeBWorK +feedback and tools to help you as you go. +END_PGML + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/parserOrientation.pl b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/parserOrientation.pl new file mode 100644 index 0000000000..5a847a8f08 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/parserOrientation.pl @@ -0,0 +1,626 @@ +#!/usr/local/bin/perl + +###################################################################### +# +# Macros used by the orientation problem set +# +###################################################################### + + +#loadMacros("PGcourse.pl"); + +# +# Special use of CARET to have it work in non-math mode +# +$CARET = MODES( + TeX => '\hbox{\texttt{\char94}}', + Latex2HTML => '^', + HTML => '^' +); + +# +# Functions to display student input and computer output +# (written as functions so that we change the style without +# recoding the problems themselves). +# +sub student { + my $message = shift; + MODES( + TeX => '\leavevmode\hbox{\texttt{'.$message.'}}', + Latex2HTML => + $bHTML.''.$eHTML.$message.$bHTML.''.$eHTML, + HTML => ''.$message.'' + ); +} + +sub computer { + my $message = shift; + MODES( + TeX => '\hbox{\texttt{'.$message.'}}', + Latex2HTML => + $bHTML.''.$eHTML.$message.$bHTML.''.$eHTML, + HTML => ''.$message.'' + ); +} + +# +# This prints things we need to fill in yet in red +# +sub moreWork { + my $message = shift; + MODES( + TeX => '{\sl ' . $message . '}', + Latex2HTML => $bHTML . '' . $eHTML . + $message . $bHTML . '' . $eHTML, + HTML => '' . $message . '' + ); +} + +# +# Temporary macros to mark comments in areas that we are +# working on. +# +$BCOMMENT = MODES( + TeX => '{\footnotesize\it', + Latex2HTML => $bHTML.'
'.$eHTML, + HTML => '
' +); + +$ECOMMENT = MODES( + TeX => '}', + Latex2HTML => $bHTML.'
'.$eHTML, + HTML => '
' +); + +# $BCOMMENT = MODES( +# TeX => '\iffalse', +# Latex2HTML => $bHTML.''.$eHTML, +# HTML => ' -->' +# ); + + +# +# Hack to get better spacing in HTML_tth math mode but without +# messing up the spacing in other modes. +# +$SP = MODES( + TeX => ' ', Latex2HTML => ' ', + HTML => ' ', HTML_tth => '\ ', + HTML_jsMath => ' ', HTML_dpng => ' ', +); + + +# +# Special table macros for questions that have +# displayed math expressions equal to an answer rule, +# with an accompanying explanation on a separate line. +# + +sub BeginExamples { + return "" if ($displayMode eq "TeX"); + BeginTable(@_); +} + +sub EndExamples { + return "" if ($displayMode eq "TeX"); + EndTable(); +} + +@ExampleDefaults = (ans_rule_len => 40, ans_rule_height => 1); + +sub BeginExample { + my $math = shift; + my $ans = shift; + my %options = (@ExampleDefaults, @_); + my ($cols,$rows) = ($options{ans_rule_len},$options{ans_rule_height}); + my $rule; + + if ($rows == 1) {$rule = ans_rule($cols)} + else {$rule = ans_box($rows,$cols)} + ANS($ans); + + # + # HTML_tth puts an unwanted
at the beginning, + # and uses a centered table. Remove the
and + # align the table to the right. + # + if ($displayMode eq "HTML_tth") { + $math = trimString(EV2('\['.$math.'\]')); + $math =~ s!
!!; + $math =~ s!table align="center"!table align="right"!; + } elsif ($displayMode eq "HTML") { + $math = '\('.$math.'\)' + } elsif ($displayMode =~ m/^HTML/) { + $math = '\(\displaystyle '.$math.'\)' + } + + MODES( + TeX => "\n".'\['.$math.'=\hbox to 8em{'.$rule.'}\]', + Latex2HTML => $bHTML.''.$eHTML. + '\(\displaystyle '.$math.'\)'.$bHTML.' =  '. + ''.$eHTML.$rule.$bHTML.''. + ''.$eHTML, + HTML => + ''.$math.' =  '. + ''.$rule.'' + ); +} + +sub EndExample { + MODES( + TeX => "\n", + Latex2HTML => $bHTML.'

'.$eHTML, + HTML => '

' + ); +} + +sub ExampleRule { + MODES( + TeX => '\par', + Latex2HTML => $bHTML.'
'.$eHTML, + HTML => '
' + ); +} + +# +# Produce a TeX version and an answer checker for the formula +# +sub DisplayQA {my $f = shift; return (DMATH($f->TeX),$f->cmp)} +sub QA {my $f = shift; return ($f->TeX,$f->cmp)} + +################################################## +# +# Insert an image of an equation (but use the equation +# in TeX mode). +# + +sub MathIMG { + my ($img,$text,$tex) = @_; + my $useTeX = MODES(TeX => 1, Latex2HTML => 0, HTML => 0, HTML_tth => 0, HTML_dpng => 1); + return '\('.$tex.'\)' if $useTeX; + $img = alias($img); + return qq{$text}; +} + + +################################################## +# +# A simple grader that always returns a score of 1. +# This is used in the tutorial to give students +# credit for reading a problem (even if it doesn't +# ask any questions). +# +sub forgiving_grader { + my $rh_evaluated_answers = shift; + my $rh_problem_state = shift; + my %form_options = @_; + my %evaluated_answers = %{$rh_evaluated_answers}; + my %problem_state = %{$rh_problem_state}; + + my %problem_result = ( + score => 1, # always return 1 + errors => '', + type => 'forgiving_grader', + msg => '', + ); + + return(\%problem_result,\%problem_state) + if (!$form_options{answers_submitted}); + + $problem_state{recorded_score} = $problem_result{score}; + $problem_state{num_of_correct_ans}++; + + (\%problem_result, \%problem_state); +} + +################################################## +# +# Syntactic sugar to avoid ugly ~~& construct in PG. +# +sub install_forgiving_grader {install_problem_grader(\&forgiving_grader)} + +# +# Shorthand for WeBWorK +# +$WW = "WeBWorK"; + + +# +# Shorthands for entering and leaving rawhtml mode in +# LaTeX2HTML (since they are so commonly used). +# +$bHTML = '\begin{rawhtml}'; +$eHTML = '\end{rawhtml}'; + +# +# HTML(htmlcode) +# HTML(htmlcode,texcode) +# +# Insert $html in HTML mode or \begin{rawhtml}$html\end{rawhtml} in +# Latex2HTML mode. In TeX mode, insert nothing for the first form, and +# $tex for the second form. +# +sub HTML { + my ($html,$tex) = @_; + return('') unless (defined($html) && $html ne ''); + $tex = '' unless (defined($tex)); + MODES(TeX => $tex, Latex2HTML => $bHTML.$html.$eHTML, HTML => $html); +} + + +# +# Begin and end indented text +# + +$BBLOCKQUOTE = HTML('
','\par\bgroup\advance\leftskip by 2em '); +$EBLOCKQUOTE = HTML('
','\par\egroup '); + +# +# Start and stop centering +# +$BCENTER = HTML('
','\begin{center}'); +$ECENTER = HTML('
','\end{center}'); + + +# +# Begin and end mode +# +$BTT = HTML('','\texttt{'); +$ETT = HTML('','}'); + +# +# Begin and end mode +# +$BSMALL = HTML('','{\small '); +$ESMALL = HTML('','}'); + +# +# Remove extra space in bold in latex2html mode +# +$BBOLD = HTML('','{\bf '); +$EBOLD = HTML('','}'); + +# +# tth doesn't seem to understand \colon +# +$COLON = MODES(TeX=>'\colon ',HTML=>':', HTML_dpng => '\colon '); + +# +# Alternatives to the standard WW versions of these +# +$LT = $LTS; +$GT = $GTS; + +$LE = $LTE; +$GE = $GTE; + +# +# Common math sets +# +$R = MODES(TeX => '{\bf R}', HTML_tth => '{\bf R}', HTML => 'R'); +$Z = MODES(TeX => '{\bf Z}', HTML_tth => '{\bf Z}', HTML => 'Z'); +$N = MODES(TeX => '{\bf N}', HTML_tth => '{\bf N}', HTML => 'N'); +$Q = MODES(TeX => '{\bf Q}', HTML_tth => '{\bf Q}', HTML => 'Q'); +$C = MODES(TeX => '{\bf C}', HTML_tth => '{\bf C}', HTML => 'C'); + +# +# Superscripts and subscript (mostly for if you want answer +# rules in these positions). +# +$BSUP = HTML('','$^{'); +$ESUP = HTML('','}$'); + +$BSUB = HTML('','$_{'); +$ESUB = HTML('','}$'); + +# +# Browser-only BR +# +$BBR = HTML('
'); + +# +# Broser-only \displaystyle +# +$DISPLAY = MODES(TeX => '', Latex2HTML => '\displaystyle ', + HTML_tth => '\displaystyle ', HTML => ''); + + +# +# Provides a title to the problem +# +sub Title { + my $title = shift; + + TEXT(MODES( + TeX => "\\par\\begin{centering}{\\bf $title}\\par\\end{centering}\\nobreak\n", + Latex2HTML => $bHTML.'

'.$title.'

'.$eHTML, + HTML => '

'.$title.'

' + )); +} + + +sub BeginList { + my $LIST = 'OL'; + $LIST = shift if (uc($_[0]) eq "OL" or uc($_[0]) eq "UL"); + my $enum = ($LIST eq 'OL' ? "enumerate" : "itemize"); + my %options = @_; + $LIST .= ' TYPE="'.$options{type}.'"' if defined($options{type}); + $LIST .= ' START="'.$options{value}.'"' if defined($options{value}); + $LIST = "<$LIST>"; + my $tex = ""; my $type = ""; my $top = ""; + $tex .= "\\parindent=0pt \\parskip=.75\\baselineskip\n" if $options{tex_par}; + $tex .= "\\setcounter{enumi}{".($options{value}-1)."}" if defined($options{value}) && $LIST eq 'OL'; + $type = "[\\quad $options{type}.]" if defined($options{type}) && $LIST eq 'OL'; + $top = '\vskip-\parskip\hrule height 0pt' if $options{noTopSkip}; + + MODES( + TeX => "\\par${top}{\\parskip=0pt\\begin{$enum}$type\n$tex", + Latex2HTML => $bHTML.$LIST.$eHTML, + HTML => $LIST."\n" + ); +} + +# +# Usage: EndList(type) +# +# where type is the list type (and must match the BeginList type). +# +sub EndList { + my $LIST = shift; $LIST = 'OL' unless defined $LIST; + my $enum = ($LIST eq 'OL' ? "enumerate" : "itemize"); + $LIST = ""; + MODES( + TeX => "\\end{$enum}}", + Latex2HTML => $bHTML.$LIST.$eHTML, + HTML => $LIST."\n" + ); +} + +# +# Syntactic sugar for making lists of paragraphs +# +sub BeginParList { + my $LIST = 'OL'; + $LIST = shift if (uc($_[0]) eq "OL" or uc($_[0]) eq "UL"); + BeginList($LIST,tex_par=>1,@_); +} + +sub EndParList {EndList(@_)}; + + +# +# Use $ITEM to introduce a new list item +# +$ITEM = MODES( + TeX => '\item\ignorespaces ', + Latex2HTML => $bHTML.'
  • '.$eHTML, + HTML => "
  • " +); + +# +# This is a hack for when you want MSIE to handle +# space between list items properly +# +$ITEMSEP = MODES( + TeX => '\par\vskip-\parskip\vskip\baselineskip ', + Latex2HTML => $bHTML."

    ".$eHTML, + HTML => "

    " +); + + +sub ColumnTable { + my $col1 = shift; my $col2 = shift; + my %options = (indent => 0, separation => 50, valign => "MIDDLE", @_); + my ($ind,$sep) = ($options{"indent"},$options{"separation"}); + my $valign = $options{"valign"}; + + my ($bhtml,$ehtml) = ('\begin{rawhtml}','\end{rawhtml}'); + ($bhtml,$ehtml) = ('','') unless ($displayMode eq "Latex2HTML"); + + my $HTMLtable = qq { + $bhtml +
     $ehtml + $col1 + $bhtml $ehtml + $col2 + $bhtml
    $ehtml + }; + + MODES( + TeX => '\par\medskip\hbox{\qquad\vtop{'. + '\advance\hsize by -3em '.$col1.'}}'. + '\medskip\hbox{\qquad\vtop{'. + '\advance\hsize by -3em '.$col2.'}}\medskip', + Latex2HTML => $HTMLtable, + HTML => $HTMLtable + ); +} + +# +# Use columns for a match-list output +# +# Usage: ColumnMatchTable($ml,options) +# +# where $ml is a math list reference and options are those +# allowed for ColumnTable above. +# +sub ColumnMatchTable { + my $ml = shift; + + ColumnTable($ml->print_q,$ml->print_a,@_); +} + + + +# +# Command for tables with no borders. +# +# Usage: BeginTable(options); +# +# Options are taken from: +# +# border => n value for BORDER attribute (default 0) +# spacing => n value for CELLSPACING attribute (default 0) +# padding => n value for CELLPADDING attribute (default 0) +# tex_spacing => dimen value for spacing between columns in TeX +# (e.g, tex_spacing => 2em) (default 1em) +# tex_border => dimen value for left- and right border in TeX (0pt) +# center => 0 or 1 center table or not (default 1) +# +sub BeginTable { + my %options = (border => 0, padding => 0, spacing => 0, center => 1, + tex_spacing => "1em", tex_border => "0pt", @_); + my ($bd,$pd,$sp) = ($options{border},$options{padding},$options{spacing}); + my ($tsp,$tbd) = ($options{tex_spacing},$options{tex_border}); + my ($center,$tcenter) = (' ALIGN="CENTER"','\centerline'); + ($center,$tcenter) = ('','') if (!$options{center}); + my $table = + qq{}; + + MODES( + TeX => '\par\medskip'.$tcenter.'{\kern '.$tbd. + '\vbox{\halign{#\hfil&&\kern '.$tsp.' #\hfil', + Latex2HTML => $bHTML.$table.$eHTML."\n", + HTML => $table."\n" + ); +} + +# +# Usage: EndTable(options) +# +# where options are taken from: +# +# tex_border => dimen extra vertical space in TeX mode (default 0pt) +# +sub EndTable { + my %options = (tex_border => "0pt", @_); + my $tbd = $options{tex_border}; + MODES( + TeX => '\cr}}\kern '.$tbd.'}\medskip'."\n", + Latex2HTML => $bHTML.'
    '.$eHTML."\n", + HTML => ''."\n" + ); +} + +# +# Creates a row in the table +# +# Usage: Row([item1,item2,...],options); +# +# Each item appears as a separate entry in the table. +# +# Options control how the row is displayed: +# +# indent => num Specifies size of blank column on the left +# (default: indent => 0) +# +# separation => num Specifies separation of columns +# (default: spearation => 30) +# +# tex_vspace => "dimen" Specifies additional vertical spacing for TeX +# +# align => "type" Specifies alignment of initial column +# (default: align => "LEFT") +# +# valign => "type" Specified vertical alignment of row +# (default: valign => "MIDDLE") +# +sub Row { + my $rowref = shift; my @row = @{$rowref}; + my %options = ( + indent => 0, separation => 30, + align => "LEFT", valign => "MIDDLE", + @_ + ); + my ($cind,$csep) = ($options{indent},$options{separation}); + my ($align,$valign) = ($options{align},$options{valign}); + my $sep = ' '; $sep = '' if ($csep < 1); + my $ind = ' '; $ind = '' if ($cind < 1); + my $fill = ''; + $fill = '\hfil' if (uc($align) eq "CENTER"); + $fill = '\hfill' if (uc($align) eq "RIGHT"); + my $vspace = ''; + $vspace = '\noalign{\vskip '.$options{tex_vspace}.'}' if $options{tex_vspace}; + + MODES( + TeX => '\cr'.$vspace."\n". $fill . join('& ',@row), + Latex2HTML => + $bHTML."$ind".$eHTML . + join($bHTML."$sep".$eHTML,@row) . + $bHTML.''.$eHTML."\n", + HTML => "$ind" . + join("$sep",@row) . ''."\n" + ); +} + + +sub TableSpace { + my $rsep = shift; + my $tsep = shift; + $rsep = $tsep if (defined($tsep) && $main::displayMode eq "TeX"); + return "" if ($rsep < 1); + MODES( + TeX => '\vadjust{\kern '.$rsep.'pt}' . "\n", + Latex2HTML => + $bHTML.''.$eHTML."\n", + HTML => ''."\n", + ); +} + + + +# +# A horizontal rule within a table. (Could have been a variable, +# but all the other table commands are subroutines, so kept it +# one to be consistent.) +# +sub TableLine { + MODES( + TeX => '\vadjust{\kern2pt\hrule\kern2pt}', + Latex2HTML => $bHTML. + '
    '. + $eHTML."\n", + HTML =>'
    '."\n" + ); +} + + +sub Image { + my $image = shift; my $ilink; + my %options = ( + size => [150,150], tex_size => 200, + link => 0, align => "BOTTOM", tex_center => 0, @_); + my ($w,$h) = @{$options{size}}; + my ($ratio,$link) = ($options{tex_size}*(.001),$options{link}); + my ($border,$align) = ($options{border},$options{align}); + my ($tcenter) = $options{tex_center}; + my $HTML; my $TeX; + ($image,$ilink) = @{$image} if (ref($image) eq "ARRAY"); + $image = alias(insertGraph($image)) if (ref($image) eq "WWPlot"); + $image = alias($image) unless ($image =~ m!^/!i); + if ($ilink) { + $ilink = alias(insertGraph($ilink)) if (ref($ilink) eq "WWPlot"); + $ilink = alias($ilink) unless ($ilink =~ m!^/!i); + } else {$ilink = $image} + $border = (($link || $ilink ne $image)? 2: 1) unless defined($border); + $HTML = ''; + $HTML = ''.$HTML.'' if $link or $ilink ne $image; + $TeX = '\includegraphics[width='.$ratio.'\linewidth]{'.$image.'}'; + $TeX = '\centerline{'.$TeX.'}' if $tcenter; + MODES( + TeX => $TeX."\n", + Latex2HTML => $bHTML.$HTML.$eHTML, + HTML => $HTML + ); +} + + + +1; diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob01.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob01.pg new file mode 100644 index 0000000000..c1ea0a4ceb --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob01.pg @@ -0,0 +1,67 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", + + +); + + +TEXT(beginproblem); + +Title("Understanding $WW Problem Pages"); + +############################################## +BEGIN_TEXT + +The $WW screen is divided into several areas, each used for a +different purpose. You will need to understand these +in order to use $WW effectively. +$PAR + +At the upper left are the navigation buttons that allow you to move +from problem to problem. The ${LQ}Next$RQ and ${LQ}Previous$RQ +buttons, naturally, send you to the next and previous problems. The +${LQ}Prob. List$RQ button takes you back to the opening +page for the homework set (the one that lists all the problems and +gives the instructions for the homework set). +$PAR + +The area below the navigation buttons is where $WW tells you about +your score for the current problem. (It will be shown on a grey +backgound to help make it stand out; you will see this later.) When you have submitted your answers, this is where you will be given information about what +answers you got right and wrong. This area also shows you how many points a problem is worth. +$PAR + +The main part of the page is the text of the problem you are trying to +answer, including blank boxes for you to enter your answers. $BR For example, 2 + 2 = $SPACE \{ans_rule(2)\} +$PAR + +Below the large white text area that you are reading right now is a message area where you may be informed about how partial credit is handled in multi-part problems. Other information might also appear there, such as a message that the due date is passed or that answers are available. +$PAR + +In the panel at the left, instead of the list of homework sets, you +now have a list of the problems within this assignment. You can go to +any problem just by clicking on it. The checkboxes at the bottom of +the panel are discussed in the next problem. +$PAR + +The buttons at the bottom of the screen, including the ${LQ}Submit +Answers$RQ button, are discussed in the next problem. At this point, +you can get credit for Problem 1 by typing $BBOLD 4$EBOLD into the answer box above, and pressing the ${LQ}Submit Answers$RQ button at the bottom of the page, and then pressing the ${LQ}Next$RQ button at the +top of the screen to go on to the next problem. + +END_TEXT + + +install_forgiving_grader(); +$showPartialCorrectAnswers = 1; + +############################################## +ANS(Compute(4)->cmp()); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob02.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob02.pg new file mode 100644 index 0000000000..0199dcc1b2 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob02.pg @@ -0,0 +1,98 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + + +TEXT(beginproblem); + +Title("Controlling $WW"); + +############################################## + +BEGIN_TEXT + +The buttons at the bottom of the screen are what cause $WW to process +your answers. Nothing that you type will have any effect until you +press one of these buttons. +$PAR + +The ${LQ}Submit Answers$RQ button causes $WW to check your answers and +report your score for the problem. Usually, your instructor will have granted you some number of attempts (maybe even unlimited). Each time you press the ${LQ}Submit Answers$RQ button, you use up one of your attempts. If the due date is passed and the answers are available, you can click the ${LQ}Show +Correct Answers$RQ button before pressing ${LQ}Submit$RQ. If you do, the correct answer(s) will be displayed in the answer area at the top of the screen along with the answers you have provided. +$PAR + +If you have typed in a complicated answer, or are being told your +answer is incorrect when you think it's right, you may want to use the +${LQ}Preview Answer$RQ button. This will make $WW display what $BITALIC it thinks $EITALIC you have entered, without using up an attempt. This can be used to help spot errors in your typing, and verify that $WW understands your answer the way you intend it to. (This is discussed further in a later problem.) +$PAR + +At the bottom panel on the left is a box that allows you to +change how the problem is displayed. The ${LQ}math${RQ} within the problem +can be printed on the screen in many different ways. Here, we'll discuss three of them: + +\{BeginParList("UL")\} + +$ITEM +${LQ}images${RQ} mode is the default choice (what $WW uses unless you tell +it otherwise). It produces the accurate mathematical notation, +with the disadvantages of being slightly slower, and not printing well +if you want to print out a single problem. +$ITEMSEP + +$ITEM +${LQ}formatted-text${RQ} mode produces results quickly, but more +complicated mathematics may be difficult to read in this +mode. For example, some fractions are not easy to read +in formatted-text mode. +$ITEMSEP + +$ITEM +${LQ}jsMath${RQ} mode uses a JavaScript program and Cascading Style +Sheets (CSS) to display the mathematics. This produces the nicest looking results, and is particularly nice if you need to change the size of the fonts +in your browser or wish to print out a single problem. For best +results, however, you should download and install some fonts that +jsMath uses; there is a link to the fonts on the jsMath control panel, +which you can activate using the small jsMath button that will appear +at the lower right of the screen when you activate this mode. The +first problem you view using jsMath may take a little longer to +appear, as the JavaScript program is being loaded into your browser, +but things should run faster after that. + +\{EndParList("UL")\} +$PAR + +Choose whichever mode is most comfortable for you. You can always +select a different mode if a particular problem needs it. Here is a +sample of some simple mathematics, \(x^2 + 3\), and a more complicated +expression, \(\frac{x(1-x)}{2x + 1}\). Try changing the display mode +by clicking the ${LQ}formatted-text$RQ or ${LQ}jsMath${RQ} +button and then pressing the ${LQ}Apply Options${RQ} button to cause +the page to be reformatted. Look how the math expressions change. Then change the display mode to back to +${LQ}images$RQ mode for the rest of the homework set. +$PAR + +The ${LQ}Show saved answers${RQ} checkbox tells whether you +want $WW to fill in the answer blanks with your previous answers or +not. (If you like, you can test this out on the next problem, since +there are no answer blanks in this one.) +$PAR + +You are now ready to learn how to enter answers into $WW. Press the +${LQ}Submit Answers${RQ} button to get credit for this problem, and +then press the ${LQ}Next$RQ button at the top of the page to go on to +the next one. + +END_TEXT + +install_forgiving_grader(); +$showPartialCorrectAnswers = 1; + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob03.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob03.pg new file mode 100644 index 0000000000..9be16d66eb --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob03.pg @@ -0,0 +1,140 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedNumeric.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Typing in Your Answers"); + +############################################## + +BEGIN_TEXT + +Here are the standard symbols that $WW, along with most other +computer software, uses for arithmetic operations: +$PAR + +\{ + BeginTable(). + Row([$BBOLD.'Symbol'.$EBOLD, + $BBOLD.'Meaning'.$EBOLD, + $BBOLD.'Example'.$EBOLD]). + TableLine(). + Row([computer("+"),'Addition',computer("3+4 = 7")],align=>"CENTER"). + Row([computer("-"),'Subtraction',computer("3-4 = -1")],align=>"CENTER"). + Row([computer("*"),'Multiplication',computer("3*4 = 12")],align=>"CENTER"). + Row([computer("/"),'Division',computer("3/4 = .75")],align=>"CENTER"). + Row([computer($CARET)." or ".computer("**"),'Exponentiation', + computer("3${CARET}4 = 81")." or ". + computer("3**4 = 81")],align=>"CENTER"). + TableLine(). + EndTable() +\} +$PAR + +END_TEXT + +################################################## + +$a = non_zero_random(-5,5,1); +$b = non_zero_random(-5,5,1); +$c = non_zero_random(-3,3,1) * 2; +$d = non_zero_random(-5,5,1); + +BEGIN_TEXT + +Sometimes $WW will insist that you calculate the value of an +expression as a single number before you enter it. For example, +calculate the value of \($c($a - $b) - ($c - $d)\) and enter it in +the following blank. +(Here you have to enter a single integer; the question is testing +whether you can do the operations correctly.) + +$PAR +$BBLOCKQUOTE +\($c($a - $b) - ($c - $d)\) = \{ans_rule(10)\} +$EBLOCKQUOTE +$PAR +END_TEXT + +Context("LimitedNumeric"); +$ans = $c*($a - $b) - ($c - $d); +ANS(Real($ans)->cmp); + +################################################## + +BEGIN_TEXT + +Sometimes you will not have to simplify your answer, and can let +$WW do this for you. The following blanks are all expecting +the value 16. Try entering it several different ways, such as +\{student "7+9"\}, \{student "18-2"\}, \{student "8*2"\}, +\{student "32/2"\}, and \{student "4${CARET}2"\}. Note: pressing +the ${LQ}Tab$RQ key on your keyboard will move you from one answer +box to the next. + +$PAR +$BBLOCKQUOTE +16 = \{ans_rule(8)\} or +\{ans_rule(8)\} or +\{ans_rule(8)\} or +\{ans_rule(8)\} or +\{ans_rule(8)\} +$EBLOCKQUOTE +$PAR + +END_TEXT + +Context("Numeric"); + +ANS( + Real(16)->cmp, + Real(16)->cmp, + Real(16)->cmp, + Real(16)->cmp, + Real(16)->cmp, +); + +################################################## + +BEGIN_TEXT + +$WW also understands that quantities written next to each other are +supposed to be multiplied. For example, you can enter \{student +"(9)(7)"\} instead of \{student "63"\}. Most often this is used when +one quantity is a number and the other a variable or function. For +instance, \{computer "2x"\} means \{computer "2*x"\}. The following blank is +expecting the value 100; try entering it as +\{student("4(30-5)")\}. + +$PAR +$BBLOCKQUOTE +100 = \{ans_rule(10)\} +$EBLOCKQUOTE +$PAR +END_TEXT + +ANS(Real(100)->cmp); + +################################################## + +BEGIN_TEXT + +${BITALIC}When you are ready, don't forget to press the ${LQ}Submit Answers${RQ} +button to ask $WW to check your work. Once you get the answers +correct, press ${LQ}Next${RQ} to go on.${EITALIC} + +END_TEXT + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob04.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob04.pg new file mode 100644 index 0000000000..4c369db42e --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob04.pg @@ -0,0 +1,99 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "alignedChoice.pl", + "contextLimitedNumeric.pl", + "parserOrientation.pl", + "PGcourse.pl", + "contextFraction.pl", + +); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Rules of Precedence"); + +############################################## + +BEGIN_TEXT + +The rules of precedence determine the order in which the mathematical +operations are performed by $WW. It is essential for you to understand +these so that you know how $WW interprets what you type in. If there +are no parentheses and no functions (such as \{computer "sin"\} or +\{computer "log"\}), then $WW computes the value of your answer by +dealing with exponents first, followed by multiplication and division +(from left to right), and finally addition and subtraction +(from left to right). +$PAR + +If there are expressions in grouping symbols, those expressions are +simplified first. We'll talk about functions (and give a more +complete list of rules) in a later problem. + +$PAR +Examples: +\{BeginList("UL")\} +$ITEM +\{student "4*3/6 = 12/6 = 2"\} (multiplications and divisions are done +from left to right) +$ITEM +\{student "4*3/6-2*7+10 = 2 - 14 + 10 = -2"\} (multiplications and divisions are done +before additions and subtractions) +$ITEM +\{student "12/3/2 = 4/2 = 2"\} (multiplications and divisions are done +from left to right) +$ITEM +\{student "12/(3/2) = 12/1.5 = 8"\} +(expressions inside parentheses are calculated before anything else) +$ITEM +\{student "2*4${CARET}2 = 2*16 = 32"\} (exponentiation is done before multiplication), +so \{student "2*4${CARET}2 - 3*4 = 2*16 - 3*4 = 32 - 12 = 20"\}. +\{EndList("UL")\} +$PAR + +To practice these rules, completely simplify the following +expressions. Because the point of this problem is for you to do the +numerical calculations correctly, $WW will only accept sufficiently +accurate decimal numbers or fractions as the answers to these problems. +$PAR + +END_TEXT + +$a = random(1,4,1); +$b = random(2,6,1); +$c = random(3,6,1); +$d = random(2,25,1); +$al = new_aligned_list(equals => 1); + +Context("LimitedFraction"); +$al->qa( + computer("$a+$b*$c"), Real($a+($b*$c))->cmp, +# computer("($a+$b)*$c"), Real(($a+$b)*$c)->cmp, +# computer("($a+$b)/$c"), Real(($a+$b)/$c)->cmp, +# computer("$a+$b/$c"), Real($a+($b/$c))->cmp, + computer("$a/$b*$c"), Fraction(($a/$b)*$c)->cmp, +# computer("$a/($b*$c)"), Real($a/($b*$c))->cmp, +# computer("$a/$b/$c"), Real(($a/$b)/$c)->cmp, + computer("3*$b+$d-$a/5"), Fraction((3*$b)-(($a/5))+$d)->cmp, + computer("2${CARET}$b+1"), Real((2**$b)+1)->cmp, + computer("2${CARET}($b+1)"), Real(2**($b+1))->cmp, +); + +BEGIN_TEXT +$BBLOCKQUOTE +\{$al->print_q\} +$EBLOCKQUOTE + +END_TEXT + +ANS($al->correct_ans); + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-a.gif b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-a.gif new file mode 100644 index 0000000000..d32ee11b3b Binary files /dev/null and b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-a.gif differ diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-b.gif b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-b.gif new file mode 100644 index 0000000000..b074b10281 Binary files /dev/null and b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-b.gif differ diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-c.gif b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-c.gif new file mode 100644 index 0000000000..71062c6f06 Binary files /dev/null and b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-c.gif differ diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05.pg new file mode 100644 index 0000000000..a076b0263f --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05.pg @@ -0,0 +1,125 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "alignedChoice.pl", + "../parserOrientation.pl", + "PGcourse.pl", +); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Common Errors to Avoid"); + +############################################## + +BEGIN_TEXT + +Many of the answers you enter into $WW will be expressions +that involve variables. Here are some important things to know. + +$PAR + +\{BeginParList("UL")\} + +$ITEM +It matters what letter you use. For example, if you are asked for a +function using the variable \(x\), then it won't work to enter the +function with the variable \(t\). Also, $WW considers upper- and +lower-case letters to be different, so don't use the capital letter +\(X\) in place of the lower-case letter \( x\). +The following blank is expecting the +expression \(x^3\), which you would enter as \{student "x${CARET}3"\} or +\{student "x**3"\}. Instead, try entering \{student "t${CARET}3"\} or \{student "X${CARET}3"\} and submitting your answer, just to see what happens. + +$PAR +$BBLOCKQUOTE +\{ans_rule(10)\} +$EBLOCKQUOTE +$PAR + +You should get an error message informing you that \{computer "t"\} +is not defined in this context. This tells you that $WW did not receive the +correct variable and doesn't know how to check your answer. Now enter +\{student "x${CARET}3"\} and resubmit to get credit for this part of +the problem. + +END_TEXT + +ANS(Formula("x^3")->cmp); + +################################################## + +$IMGA = MathIMG("prob05-a.gif","1/x+1","1/x+1"); +$IMGB = MathIMG("prob05-b.gif","1/(x+1)","\frac{1}{x+1}"); +$IMGC = MathIMG("prob05-c.gif","(1/x)+1","\frac{1}{x} + 1"); + +BEGIN_TEXT + +$ITEM +$WW requires that you think about how you present your answer. As we just saw, you need to be careful about the variables that you use. You must also be careful about how the order of operations apply to your answers. Often, this involves using parentheses appropriately. + +$PAR + +For example, you might intend to submit $IMGB, and write $IMGA on your paper. But that is actually incorrect. The expression $IMGA means $IMGC, +according to the rules of precedence. $WW will force you to be exact +with how you think and what you write. If you want +to enter something that means $IMGB, you must write \{student +"1/(x+1)"\}. + +$PAR + +This precision is important in your written work too. If the answer was $IMGB and you wrote $IMGA on paper or on a test, it is not correct. So the precision that $WW is demanding of you will help you outside of $WW. + +$PAR +END_TEXT + +################################################## + +BEGIN_TEXT + +\{EndParList("UL")\} + +$PAR +$HR +$PAR + +Now enter the following expressions: +$PAR +END_TEXT + +$al = new_aligned_list( + equals => 1, ans_rule_len => 30, + tex_spacing => "5pt", spacing => 10 +); + +Context("Numeric")->variables->are(t=>'Real'); $t = Formula("t"); +Context("Numeric")->variables->are(y=>'Real'); $y = Formula("y"); +Context("Numeric")->variables->are(x=>'Real'); $x = Formula("x"); + +$al->qa( + DisplayQA($t/(2*$t+6)), +# DisplayQA(2*$y*($y**2-$y+1)), +# DisplayQA(1/$x**2 - 3*(1/$x)), + DisplayQA(1/(2*($x-5))), + DisplayQA((2*$x-3)**4), +); + +BEGIN_TEXT + +$BBLOCKQUOTE +\{$al->print_q\} +$EBLOCKQUOTE + +END_TEXT + +ANS($al->correct_ans); + + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob06.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob06.pg new file mode 100644 index 0000000000..f959ef0a94 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob06.pg @@ -0,0 +1,131 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + +$showPartialCorrectAnswers = 1; + +Context("Numeric")->variables->are(y=>'Real'); $y = Formula('y'); +Context("Numeric")->variables->are(x=>'Real'); $x = Formula('x'); +Context()->flags->set(limits=>[0,2]); + +TEXT(beginproblem); + +Title("Using Parentheses Effectively"); + +############################################## + +BEGIN_TEXT + +${BCENTER} ${BBOLD} If you are in a math course numbered 70 or below, you might not need the information on this page. Feel free to move to the next page.${EBOLD} ${ECENTER} + +$PAR + +One of the hardest parts about using parentheses is making sure that +they match up correctly. Here are a couple of hints to help you with +this: + +$PAR +END_TEXT + +$BRACES = HTML('{}','\char123\char125'); + +BEGIN_TEXT + +\{BeginParList("UL")\} + +$ITEM +Several types of parentheses are allowed: \{student "()"\}, +\{student "[]"\}, and \{student $BRACES\}. When you need to nest +parentheses inside other parentheses, try using a different type for +each to make it easier to see which ones match up. +$ITEMSEP + +$ITEM +When you type a left parenthesis, type the corresponding right +parenthesis at the same time, then position your cursor between them and +type the expression that goes inside. This can save you a +lot of time hunting for mismatched parentheses. +$ITEMSEP + +$ITEM +When you have a complicated answer, type a template for +the structure of your result first. For example, suppose that you are +planning to enter the fraction +\[\frac{2x^2-5}{(x+1)(3x^{3x} - 22)}.\] +A good way to start would be to type in \{student "()/[()*()]"\}. +This shows a template of one number divided by the product of two +other numbers. (Note that \{student "()/()*()"\} would not be a good +way to start; do you see why?) Now when you fill in the expressions, you +will be sure your parentheses balance correctly. +$PAR + +Although $WW understands that numbers written next to each other are +meant to be multiplied (so you do not have to use \{student "*"\} to +indicate multiplication if you don't want to), it is often useful for +you to include the \{student "*"\} anyway, as it helps you keep track +of the structure of your answer. +$PAR + +$ITEM +To see how $WW is interpreting what you type, enter your answer and +then click the ${LQ}Preview Answers$RQ button, which is next to the +${LQ}Submit Answers$RQ button below. $WW will show you what $BITALIC it thinks$EITALIC you entered. (The preview appears in your answer area at the top of the page.) Previewing your answer $BITALIC does not $EITALIC submit it for credit or use up an attempt; that only +happens when you press the ${LQ}Submit Answers$RQ button. +$ITEMSEP + +$ITEM +When division or exponentiation are involved, it is a good idea to +use parentheses even in simple situations, rather than relying on the +order of operations. For example, 1/2x and (1/2)x both mean the same +thing (first divide 1 by 2, then multiply the result by x), but the +second makes it easier to see what is going on. Likewise, use +parentheses to clarify expressions involving exponentiation. Type +\{student "(e${CARET}x)${CARET}2"\} if you mean \((e^x)^2\), and type +\{student "e${CARET}(x${CARET}2)"\} if you mean \(e^{(x^2)}\). + +\{EndParList("UL")\} + +$PAR +$HR +$PAR + +Now enter the following expressions: + +$BBLOCKQUOTE + +\{@ExampleDefaults = (ans_rule_len => 50, ans_rule_height => 1); + BeginExamples\} + +\{BeginExample(QA(($x**(2*$x-1))/(($x**2-$x)*(3*$x+5))))\} +Start with the template \{student "[x${CARET}()]/[()*()]"\}. +\{EndExample\} +\{ExampleRule\} + +\{BeginExample(QA((($y+3)*($y**3+$y+1))/((2*$y**2-2)*(5*$y+4))))\} +Start by putting in an appropriate template. This means that you +should begin by looking at the function and thinking about how many +pieces are used to construct it and how those pieces are related. +Once you have entered your answer, try using the ${LQ}Preview$RQ button +to see how $WW is interpreting your answer. +\{EndExample\} +\{ExampleRule\} + +\{BeginExample(QA((($x+1)/($x-2))**4))\} +Start by putting in an appropriate template. +\{EndExample\} + +\{EndExamples\} + +$EBLOCKQUOTE + +END_TEXT + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob07.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob07.pg new file mode 100644 index 0000000000..fad9fc9b6b --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob07.pg @@ -0,0 +1,135 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "alignedChoice.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Constants and Functions in $WW"); + +############################################## + +BEGIN_TEXT + +$WW knows the value of \(\pi\), which you can enter as \{student +"pi"\}, and the value of \(e\) (the base of the natural logarithm, +\(e\approx 2.71828\)), which you can enter simply as the letter +\{student "e"\}. This answer blank is expecting the area formula for a circle, which is \(\pi r^2\). Try it: $SPACE \(A=\) \{ans_rule(8) \}. +END_TEXT +Context()->variables->add(r=>'Real'); +ANS(Compute("pi r^2")->cmp); +BEGIN_TEXT +$PAR + + +$WW also understands many standard functions, like square root. Here +is a partial list. Notice that function names use lower-case +letters. Capitalizing might lead to an error message. + +\{BeginParList("UL")\} + +$ITEM +The square root \(\sqrt{\ } \) is represented by \{student +"sqrt(x)"\}. Try entering the square root of seven: \{ans_rule(10) \}. +END_TEXT +ANS(Compute("sqrt(7)")->cmp); +BEGIN_TEXT +$ITEMSEP + +${BCENTER} ${BBOLD} If you are in a math course numbered 95 or below, you might not need the information on the rest of this page. Feel free to move on to the next page.${EBOLD} ${ECENTER} +$ITEMSEP + +$ITEM +$WW knows about \{student "sin(x)"\}, \{student "cos(x)"\}, \{student +"tan(x)"\}, \{student "arcsin(x)"\}, \{student "arccos(x)"\}, +\{student "arctan(x)"\} and the other trigonometric functions and their +inverses. $WW ${BITALIC}always$EITALIC uses radian mode for these +functions. $WW will evaluate trigonometric functions for you in many situations. For example, the following blank is expecting the value \(-1\). +Since \(\cos(\pi) = -1\), you can enter \{student "cos(pi)"\}. Try it: \{ans_rule(10)\} \(= -1\) + +$PAR + +END_TEXT + +ANS(Real(-1)->cmp); + +################################################## + +BEGIN_TEXT + + +$ITEM +The function \{student "ln(x)"\} means the natural logarithm of \(x\) (the logarithm with base \(e\)). In $WW, \{student "log(x)"\} $BITALIC also$EITALIC means the natural logarithm. Use \{student "log10(x)"\} for the base 10 +logarithm of \(x\). +$ITEMSEP + +$ITEM +The exponential function with base \(e\) can be entered as +\{student "e${CARET}x"\} or \{student "exp(x)"\}. The second method +is convenient if you have a long, complicated exponent. +$ITEMSEP + +$ITEM +The absolute value function, \(|x|\), should be entered as +\{student "|x|"\} or \{student "abs(x)"\}. +$ITEMSEP + +$ITEM +The inverse sine function, \(\sin${CARET}{-1}(x)\), can be written as +\{student "arcsin(x)"\} or \{student "asin(x)"\} or \{student "sin${CARET}(-1)(x)"\} +in $WW. Note that this is ${BITALIC}not$EITALIC the same as +\{student "(sin(x))${CARET}(-1)"\}, which means \(\frac{1}{\sin(x)}\). +The other inverse functions are handled similarly. + +\{EndParList("UL")\} + +$PAR +$HR +$PAR + +Now enter the following expressions: +$PAR +END_TEXT + +$al = new_aligned_list( + equals => 1, + ans_rule_len => 40, + tex_spacing => "5pt", + spacing => 10, +); + +Context("Numeric")->variables->are(t=>'Real'); $t = Formula('t'); +Context("Numeric")->variables->are(y=>'Real'); $y = Formula('y'); +Context("Numeric")->variables->are(x=>'Real'); $x = Formula('x'); +Context()->flags->set(limits=>[-2,10]); + +$al->qa( +# DisplayQA(sqrt($y**2+1)), +# DisplayQA(sin(3*$x+1)), + DisplayQA(1/tan($x)), + DisplayQA(asin($t+1)->with(limits=>[-2,0])), + DisplayQA((sin($x)-cos($x))/sqrt(2*$x-7)) +); + +BEGIN_TEXT + +$BBLOCKQUOTE +\{$al->print_q\} +$EBLOCKQUOTE + +END_TEXT + +ANS($al->correct_ans); + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob08.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob08.pg new file mode 100644 index 0000000000..5b0d6dbe5c --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob08.pg @@ -0,0 +1,155 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + +Context("Numeric")->variables->are(y=>'Real'); $y = Formula('y'); +Context("Numeric")->variables->are(x=>'Real'); $x = Formula('x'); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Rules of Precedence (Again)"); + +############################################## + +$Explanation = "${BITALIC}Explanation${EITALIC}"; +$Moral = "${BITALIC}Moral${EITALIC}"; + +BEGIN_TEXT +${BCENTER} ${BBOLD} If you are in a math course numbered 95 or below, you might not need the information on this page. Feel free to move on to the next page.${EBOLD} ${ECENTER} +$PAR + +At this point, we can give the complete rules of precedence for +how $WW computes the value of a mathematical formula. The operations +are handled in the following order: +$PAR + +\{BeginList\} +$ITEM Evaluate expressions within parentheses. +$ITEM Evaluate functions such as \{student "sin(x)"\}, +\{student "cos(x)"\}, \{student "log(x)"\}, \{student "sqrt(x)"\}. +$ITEM Perform exponentiation (from right to left). +$ITEM Perform multiplication and division, (from left to right). +$ITEM Perform addition and subtraction, (from left to right). +\{EndList\} +$PAR + +This can get a little subtle, so be careful. The following are some +typical traps for $WW users. +$PAR + +\{BeginParList("UL")\} + +$ITEM +$WW interprets \{student "sin 2x"\} to mean \((\sin${SP}2)*x\) +$PAR + +$Explanation: Rule 2 tells you that $WW does evaluation of functions +(like \{student "sin"\}) before multiplication. Thus $WW first +computes \(\sin${SP}2\), and then multiplies the result by \(x\). +$PAR + +$Moral: You must type \{student "sin(2x)"\} for the sine of \(2x\), +even though we often write it as \(\sin${SP}2x\). +Get in the habit of using parentheses for all your trigonometric +functions. +$PAR + +$PAR +$BBLOCKQUOTE +The cosine of \(5x\) is entered as \{ans_rule(15)\}. +$EBLOCKQUOTE +$PAR + +END_TEXT + +ANS(cos(5*$x)->cmp); + +BEGIN_TEXT + +$ITEM +$WW interprets \{student "cos t${CARET}3"\} to mean \((\cos${SP}t)^3\) +$PAR + +$Explanation: Rule 2 tells you that $WW does evaluation of functions +(like \{student "cos"\}) before exponentiation. Thus $WW first +computes \(\cos${SP}t\) and then raises the result to the power 3. +$PAR + +$Moral: You must type in \{student "cos(t${CARET}3)"\} if you mean the +cosine of \(t^3\), even though we sometimes write it as \(\cos${SP}t^3\). + + +$PAR +$BBLOCKQUOTE +The tangent of \(y^4\) is entered as \{ans_rule(15)\}. +$EBLOCKQUOTE +$PAR + +END_TEXT + +ANS(tan($y**4)->cmp); + +BEGIN_TEXT + +$ITEM +In mathematics, we often write \(\sin^2${SP}x\) to mean \((\sin x)^2\). +$WW will let you write \{student "sin${CARET}2(x)"\} for this, though +it is probably better to type \{student "(sin(x))${CARET}2"\} instead, +as this makes your intention clearer. Note that a power of \(-1\), as +in \{student "sin${CARET}(-1)(x)"\}, is a special case; it indicates the +${BITALIC}inverse${EITALIC} function \{student "arcsin(x)"\} rather +than a power. + + +$PAR +$BBLOCKQUOTE +\(\sin^2${SP}x + \cos^3${SP}x\) = \{ans_rule(30)\} +$EBLOCKQUOTE +$PAR + +END_TEXT + +ANS((sin($x)**2 + cos($x)**3)->cmp); + +BEGIN_TEXT + +$ITEM +\{student "e${CARET}3x"\} means \((e^3) x\) and not \(e^{(3x)}\) $PAR +$PAR + +$Explanation: Rule 3 says that $WW does exponentiation before multiplication. +Thus $WW first computes \{student "e${CARET}3"\}, with the result +\(e^3\), and then multiplies the result by \(x\). +$PAR + +$Moral: Always put parentheses around an exponent. +Type \{student "e${CARET}(3x)"\} if you want \(e^{3x}\). + +$PAR +$BBLOCKQUOTE +\(2^{4x^3}\) = \{ans_rule(30)\} +$EBLOCKQUOTE +$PAR + +END_TEXT + +ANS((2**(4*($x**3)))->cmp); + +BEGIN_TEXT + +\{EndParList("UL")\} + + +END_TEXT + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob09.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob09.pg new file mode 100644 index 0000000000..3c97379dc5 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob09.pg @@ -0,0 +1,112 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Non-Numeric Answers"); + +############################################## + +BEGIN_TEXT + +Sometimes you will be asked to enter answers that are not numbers. +For example, if you are asked to determine what is \(\frac{1}{0}\), the answer is that this $LQ\(\)number$RQ does not exist, so you might have to type \{student "DNE"\} to indicate this (the problem should tell you what words to +use). Note that upper- and lower-case letters are not the same to +$WW, so you might need to enter the answer exactly as indicated in the +problem. (Well-written problems will allow the answer to be +entered either way.) +$PAR + +$BBLOCKQUOTE +Please enter ${LQ}\{student "DNE"\}${RQ} here: \{ans_rule(10)\}. +$EBLOCKQUOTE + +END_TEXT + +ANS(String('DNE')->cmp); + +################################################## + +BEGIN_TEXT + +Other problems may require you to enter \(\infty\), which you do using +the word ${LQ}\{student "INFINITY"\}${RQ} (in upper- or lower-case) or +${LQ}\{student "INF"\}${RQ} for short. The problem should remind you +of how to do this. You can't add or multiply something by infinity. You +can, however, indicate \(-\infty\) by ${LQ}\{student "-INFINITY"\}${RQ}, +or ${LQ}\{student "-INF"\}${RQ}. +$PAR + +$BBLOCKQUOTE +Try entering \(-\infty\) here: \{ans_rule(10)\}. +$EBLOCKQUOTE + +END_TEXT + +ANS((-(Infinity))->cmp); + +################################################## + +Context("Interval"); + +$a = random(-5,5,1); +$I = Compute("(-infinity,$a)"); + +BEGIN_TEXT + +One common place where you use \(\infty\) is as an endpoint of +an interval. $WW allows you to enter intervals using standard +interval notation, including infinite endpoints. For example, +\{student "[-2,5)"\} represents an interval that is closed on the +left and open on the right, while \{student "[2,inf)"\} is an interval +that extends infinitely to the right. +$PAR + +$BBLOCKQUOTE +If you have learned interval notation, write the interval of points that are less than \($a\): \{ans_rule(20)\}. +$EBLOCKQUOTE + +END_TEXT + +ANS($I->cmp); + +################################################## + +Context("Interval"); + +$a = random(-8,-2,1); +$b = random($a+1,$a+5,1); +$c = random($b+1,$b+5,1); +$I = Compute("[$a,$b) U ($b,$c)"); + +BEGIN_TEXT + +${BCENTER} ${BBOLD} If you are in a math course numbered 70 or below, you might not need the information on the rest of this page. Feel free to move on to the next page.${EBOLD} ${ECENTER} +$PAR +Several intervals can be combined into one region using the ${LQ}set +union${RQ} operation, \(\cup\), which is represented as ${LQ}\{student +"U"\}${RQ} in $WW. For example, \{student "[-2,0] U (8,inf)"\} +represents the points from \(-2\) to \(0\) together with everything +bigger than 8. +$PAR + +$BBLOCKQUOTE +Write the set of points from \($a\) to \($c\) but excluding \($b\) and \($c\) +as a union of intervals: \{ans_rule(20)\}. +$EBLOCKQUOTE + +END_TEXT + +ANS($I->cmp); + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob10.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob10.pg new file mode 100644 index 0000000000..fd9237d64d --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob10.pg @@ -0,0 +1,132 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Points and Vectors"); + +############################################## + +Context("Vector"); + +$p0 = non_zero_point2D(); +$p1 = $p0 + 2*non_zero_point2D(2,2,1); + +Context()->texStrings; +BEGIN_TEXT + +Some problems will ask you to enter an answer that is a point (also known as an ordered pair) rather than a number. You enter points in $WW just as you would expect: by separating the coordinates by commas and enclosing them all in +parentheses. So \{student "(2,-3)"\} represents the point in the +plane that has an \(x\)-coordinate of \(2\) and \(y\)-coordinate of +\(-3\). +$PAR + +$BBLOCKQUOTE +What point is halfway between \($p0\) and \($p1\)? \{ans_rule(20)\}. +$EBLOCKQUOTE + +END_TEXT +Context()->normalStrings; + +ANS((($p0+$p1)/2)->cmp); + +################################################## + +$P = non_zero_point3D(); + +$LANGLE = HTML('<',"\char60 "); +$RANGLE = HTML('>',"\char62 "); + +Context()->flags->set(ijk=>1); +Context()->texStrings; +BEGIN_TEXT + + +${BCENTER} ${BBOLD} If you are in a math course numbered 199 or below, you might not need the information on the rest of this page. Feel free to move on to the next page. ${EBOLD} ${ECENTER} + +$PAR +Other problems require you to provide a vector as your answer. $WW +allows you to enter vectors either as a list of coordinates enclosed +in angle braces, \{student $LANGLE\} and \{student $RANGLE\}, or as a +sum of multiples of the coordinate unit vectors, \(\{i\}\), \(\{j\}\) +and \(\{k\}\), which you enter as \{student "i"\}, \{student "j"\} and +\{student "k"\}. For example, \{student "${LANGLE}1,3,-2${RANGLE}"\} +represents the same vector as \{student "i+3j-2k"\}. +$PAR + +$BBLOCKQUOTE +What vector points from the origin to the point \($P\)? \{ans_rule(20)\}. +$EBLOCKQUOTE + +END_TEXT +Context()->normalStrings; +Context()->flags->set(ijk=>0); + +ANS(Vector($P)->cmp); + +################################################## + +$v0 = non_zero_vector3D(); +$v1 = non_zero_vector3D(); + +$SPACING = HTML('  '); +$BNOBR = HTML(''); +$ENOBR = HTML(''); + +Context()->texStrings; +BEGIN_TEXT + +Just as you can enter a number by giving an expression that reduces to it, +$WW allows you to enter points and vectors by giving expressions for the +individual coordinates, or by using a vector-valued expression that +reduces to your answer. For example, +$PAR +$BCENTER +$BNOBR\{student "${LANGLE}1-(-3),2-sqrt(4),6/2${RANGLE}"\}$ENOBR +${SPACING} and ${SPACING} +$BNOBR\{student "[1-(-3)]i + [2-sqrt(4)]j + (6/2)k"\}$ENOBR +$ECENTER +$PAR +both represent the vector \(\{Vector(4,0,3)\}\), while +$BNOBR\{student "${LANGLE}1,0,-1${RANGLE} + ${LANGLE}2,-2,3${RANGLE}"\}$ENOBR +could be used to answer a question that asks for the vector \(\{Vector(3,-2,2)\}\). +$PAR + +$BBLOCKQUOTE +Try writing \(\{$v0+$v1\}\) as a sum of two vectors: \{ans_rule(30)\}. +$EBLOCKQUOTE + +END_TEXT +Context()->normalStrings; + +# +# Check that the result actually IS a sum (or difference). +# +sub checkAdd { + my $ans = shift; + if ($ans->{score} == 1 && !$ans->{isPreview}) { + my $item = $ans->{student_formula}->{tree}; + $ans->{correct_value}->cmp_Error + ($ans,"Your answer is not a sum of vectors") + unless $item->class eq 'BOP' && + ($item->{bop} eq '+' || $item->{bop} eq '-'); + } + return $ans; +} + +my $check = ($v0+$v1)->cmp; +$check->install_post_filter(~~&checkAdd); +ANS($check); + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob11.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob11.pg new file mode 100644 index 0000000000..1f2bafb041 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob11.pg @@ -0,0 +1,64 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Multiple Answers in One Blank"); + +############################################## + +Context("Numeric"); + + + +Context()->texStrings; +BEGIN_TEXT + +Sometimes you might be asked to provide more than one answer in a single +answer blank. In this case, you should separate your answers by commas. Such an answer is called a ${BITALIC}list${EITALIC} in $WW. Note that you don't $BITALIC have to $EITALIC enter multiple answers for a list; a single number is a legal response (it's a list with only one thing). +$PAR + +$BBLOCKQUOTE +The even integers between 1 and 9 are: \{ans_rule(20)\}. $BR +Try entering the answer in a different order. With lists, order won't matter. +$EBLOCKQUOTE + +END_TEXT +Context()->normalStrings; + +ANS(List(2,4,6,8)->cmp); + +################################################## + +$a = random(1,5,1); +$f = Formula("1/(x^2+$a^2)")->reduce; + +Context()->texStrings; +BEGIN_TEXT + +When you are asked for a list of numbers, another possible answer is +that there are ${BITALIC}no${EITALIC} numbers that satisfy the +requirements. In that case, you should enter ${LQ}\{student +"NONE"\}${RQ} as your answer. +$PAR + +$BBLOCKQUOTE +The expression \($f\) is not defined at these \(x\) values: \{ans_rule(20)\}. +$EBLOCKQUOTE + +END_TEXT +Context()->normalStrings; + +ANS(String('NONE')->cmp); + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob12.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob12.pg new file mode 100644 index 0000000000..def47308b8 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob12.pg @@ -0,0 +1,69 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "choiceUtils.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + +TEXT(beginproblem); + +Title("True/False Questions in $WW"); + +############################################## + +$a = random(1,5,1); +$b = random(6,10,1); +$c = random(-10,-1,1); +$d = random(-10,-1,1); +$e = random(1,10,1); + +$sl = new_select_list(); +$sl->{rf_print_q} = ~~&alt_print_q; +$sl->{separation} = 5; + +$sl->qa( + "\(-$a $LT -$b\)", "F", + "\($c $LE $c\)", "T", + "\($d $LT $d\)", "F", + "\(\pi $GE 3.2\)", "F", + "\($e-1 $LE $e\)", "T" +); + +$sl->choose(4); + +################################################## + +BEGIN_TEXT + +Enter a \{student "T"\} or an \{student "F"\} in each +answer space below to indicate whether the corresponding +statement is true or false. +$PAR + +$BBLOCKQUOTE +\{$sl->print_q\} +$EBLOCKQUOTE +$PAR + +END_TEXT + +ANS(str_cmp($sl->ra_correct_ans)); +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +BEGIN_TEXT + +In most multipart problems, if one or more of your answers is wrong, +then $WW tells you which ones they are. But for True/False or +multiple-choice questions, $WW usually only tells you whether +${BITALIC}all$EITALIC the answers are correct. It won't tell you +which ones are right or wrong. + +END_TEXT + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob13.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob13.pg new file mode 100644 index 0000000000..a4e2fa1cc2 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob13.pg @@ -0,0 +1,67 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "parserOrientation.pl", + "choiceUtils.pl", + "PGcourse.pl", +); + +TEXT(beginproblem); + +Title("Matching Lists in $WW"); + +############################################## + +$a = random(-10,10,1); +$b = random(1,3,1); + +$ml = new_match_list(); +$ml->rf_print_q(~~&alt_print_q); +$ml->rf_print_a(~~&alt_print_a); +$ml->{separation} = 5; + +$ml->qa( + "\(x\) is less than \($a\)", "\(x $LT $a\)", + "\(x\) is any real number", "\(-\infty $LT x $LT \infty\)", + "\(x\) is greater than \($a\)", "\($a $LT x\)", + "\(x\) is less than or equal to \($a\)", "\(x $LE $a\)", + "\(x\) is greater than or equal to \($a\)", "\(x $GE $a\)", + "The distance from \(x\) to \($a\) is at most $b", + "\(|x - $a| $LE $b\)", + "The distance from \(x\) to \($a\) is more than $b", + "\(|x - $a| $GT $b\)" +); + +$ml->choose(5); + +################################################## + +BEGIN_TEXT + +Match the statements defined below with the letters labeling their +equivalent expressions. +$PAR + +\{ColumnMatchTable($ml,indent => 30)\} +$PAR + +END_TEXT + +ANS(str_cmp($ml->ra_correct_ans)); +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +BEGIN_TEXT + +Usually with matching problems, +$WW tells you whether ${BITALIC}all$EITALIC +your answers are correct or not. If they are not all +correct, $WW will not tell you which ones are right +and which are wrong. +$PAR + +END_TEXT + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14-hint.html b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14-hint.html new file mode 100644 index 0000000000..9ad160d2da --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14-hint.html @@ -0,0 +1,35 @@ + +WeBWork Set 0 Problem 11 Hint + + + +
    + + +
    + +
    + +

    Graphs in WeBWorK

    + +Often in WeBWorK, the graphs are displayed as small thumbnail images. +These can be difficult to read, so in these cases, WeBWorK provides +you with a link to a larger copy of the graph. You can click on the +small version of the image to get the larger one. For example, click +on the diagram below to enlarge it. It will be displayed in a +separate window; close that window when you are done looking at the +larger graph. +

    + +

    + +
    +

    + +After you are done, press the "Back" button to go back to the problem page. + +

    +
    + + + diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.gif b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.gif new file mode 100644 index 0000000000..16461e6334 Binary files /dev/null and b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.gif differ diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.pg new file mode 100644 index 0000000000..2d476d0a20 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.pg @@ -0,0 +1,115 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "PGgraphmacros.pl", + "imageChoice.pl", + "../parserOrientation.pl", + "PGcourse.pl" +); + +# +# You need to change this to point to where you have stored the hint +# and graphic files. +# +$htmlWebworkURL = "http://omega.math.union.edu/webwork2_files/local"; +$hintURL = "${htmlWebworkURL}/parserOrientation/prob14-hint.html"; + +TEXT(beginproblem); + +Title("Matching Graphs in $WW"); + +############################################## + +$ml = new_image_match_list(link => 0, border => 0); +$ml->{separation} = 3; + +@Goptions = (-6,-6,6,6, axes => [0,0], grid => [6,6], size => [150,150]); +$G1 = init_graph(@Goptions); +$G2 = init_graph(@Goptions); +$G3 = init_graph(@Goptions); +$G4 = init_graph(@Goptions); + +$a1 = random(-6,2,.1); $b1 = random($a1+1,6,.1); $m1 = ($b1-$a1)/12; +$a2 = random(-2,6,.1); $b2 = random($a2-1,-6,.1); $m2 = ($b2-$a2)/12; +$a3 = non_zero_random(.5,5,.1)*non_zero_random(-1,1,1); +$a4 = non_zero_random(.5,5,.1)*non_zero_random(-1,1,1); + +$plotoptions = "using color:red and weight=2"; +plot_functions($G1,"$m1(x+6)+$a1 for x in <-5.8,5.8> $plotoptions"); +plot_functions($G2,"$m2(x+6)+$a2 for x in <-5.8,5.8> $plotoptions"); +plot_functions($G3,"$a3 for x in <-5.8,5.8> $plotoptions"); +plot_functions($G4,"10000(x-$a4) for x in <-5.8,5.8> $plotoptions"); + +$ml->qa( + "The line is increasing", $G1, + "The line is decreasing", $G2, + "The line is horizontal", $G3, + "The line is verical", $G4 +); + +$ml->choose(4); + +#BEGIN_TEXT +# +#The simplest functions are the ${BITALIC}linear$EITALIC ones --- +#the functions whose graphs are straight lines. They are important +#because many functions locally look like straight lines. (Looking +#like a line ${BITALIC}locally$EITALIC means that if we zoom in on the +#function and look at it at a very powerful magnification, it will look +#like a straight line.) +#$PAR + +BEGIN_TEXT + +Enter the letter of the graph that corresponds to each statement: +$PAR + +$BCENTER +$PAR +\{$ml->print_q\} +$PAR +$ECENTER + +\{$ml->print_a\} +$PAR + +END_TEXT + +ANS(str_cmp($ml->ra_correct_ans)); +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +################################################## + +BEGIN_TEXT + +As with the previous matching problems, you will not be told which of +your answers are correct when you submit your answers to this problem. +$WW will only tell you if ${BITALIC}all${EITALIC} your answers are +correct or not. +$PAR + +Some $WW problems display a link to additional information or a +\{htmlLink($hintURL,"hint")\}. Follow this link for a hint about +graphs in $WW. +$PAR + +END_TEXT + +#Occasionally, a problem includes a hint that will not be available +#immediately. Once you have submitted incorrect answers a certain +#number of times (determined by the problem), you will see a ${LQ}Show +#Hint$RQ button above the submit buttons at the bottom of the screen. +#Check the box and press ${LQ}Submit$RQ in order to get the hint. For +#this problem, the hint will be available after one wrong answer. +# +#END_TEXT +# +#$showHint = 1; +#HINT("$HINT Usually the hints are more helpful than this."); + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob15.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob15.pg new file mode 100644 index 0000000000..e57a9b18fd --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob15.pg @@ -0,0 +1,87 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem); + +Title("When You're Stuck..."); + +############################################## + +BEGIN_TEXT +The goal of $WW is to help you learn mathematics by giving +you immediate feedback on the correctness of your answer to a problem. +It is not designed to be a tutorial or to replace human teachers. As with any learning tool, it is up to you to make good use of it. + +Here are some things you can try when you are stuck on a problem. +$PAR + +\{BeginParList("UL")\} +$ITEM +Reread the problem carefully to see if there are any instructions +that you did not notice. +$ITEMSEP + +$ITEM +Check carefully for directions on the Problem List page. +You can get to this page by pressing the ${LQ}Prob. List$RQ button at the +top of any problem page. +$ITEMSEP + +$ITEM +Look in the textbook for similar problems or relevant methods. +$ITEMSEP + +$ITEM +Talk to your instructor during office hours. +$ITEMSEP + +$ITEM +Ask a fellow student for help. +$ITEMSEP + +$ITEM +Use the Student Learning Center. (Be sure to take a printout of +the problem with you if you won't be able to log on to $WW. The tutors will need the ${BITALIC}exact$EITALIC +wording of the problem.) +$ITEMSEP + +$ITEM +Use the ${LQ}Email instructor$RQ button at the bottom of the problem page +to send e-mail to your instructor. Include the details of +what you have tried so far. If you are having a software problem, +include details about the error messages you are getting. + +\{EndParList("UL")\} + +$PAR + +When you are truly stuck on a $WW problem, you should turn to other +sources (humans or books) for help, because it is not in your best +interest to guess repeatedly instead of thinking about what you might +be doing wrong. +$PAR + +To get credit for this problem, you must click the ${LQ}Submit +Answers$RQ button. Then you can use the ${LQ}Prob. List$RQ button at +the top of the page to return to the problem list page. You will see +that the problems you have done have been labeled as correct or +incorrect, and you can go back and do problems you skipped or couldn't +get right the first time. Once you have done a problem correctly, it +is ${BITALIC}always$EITALIC listed as correct even if you go back and +do it incorrectly later. This means you can use WeBWorK to review +course material without any danger of changing your grade. $PAR + +END_TEXT + +install_forgiving_grader(); +$showPartialCorrectAnswers = 1; + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setHeader.pg b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setHeader.pg new file mode 100644 index 0000000000..2ff7866c29 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setHeader.pg @@ -0,0 +1,107 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + + +if ($displayMode eq 'TeX') { + +TEXT($BEGIN_ONE_COLUMN, + '\noindent{\large\bf '.$studentName.'}\hfill{\large\bf '.$course.'}', + '\par\noindent', +" +This set of $WW problems is designed to orient you to the +$WW system and to help you learn how to communicate with the +software. You will learn how to understand what +you see on the screen and how to enter your answers when you do +the problems. You will practice entering numerical and variable +expressions and look at ways to find and correct errors in your +entries. + +", + "WeBWorK assignment $setNumber is due on $formattedDueDate.", + $END_ONE_COLUMN +); + +} else { + +BEGIN_TEXT + +${BBOLD}Orientation to WeBWorK${EBOLD} +$PAR + +${BCENTER}${BBOLD}READ THIS FIRST${EBOLD}${ECENTER} + + +This set of $WW problems will introduce you to the +$WW system and help you learn how to communicate with the +software. You will learn how to understand what +you see on the screen and how to enter your answers when you do +the problems. You will practice entering numerical and variable +expressions and look at ways to find and correct errors in your +entries. +$PAR + +Start by examining the features of this page you are on right now. The panels at the left and top help you to navigate to the different pages available in +WeBWorK. You have already seen the ${LQ}Homework Sets${RQ} page, +which lists all the homework assignments, and the +${LQ}Password/Email${RQ} page, which lets you change your password or +email address. The ${LQ}Grades${RQ} link takes you to a page that +shows your scores on the various assignments (but there is nothing +much to show at this point). +$PAR + + +The ${LQ}Report Bugs${RQ} button is for reporting bugs in the WeBWorK +System itself to the developers WeBWorK. It is unlikely that +you will need to use that yourself. If you are having difficulty with +WeBWorK, you should contact your professor using the ${LQ}Email +Instructor${RQ} button instead. This should be available on nearly +every page, so you always have a quick way to reach your professor. +$PAR + + +The middle panel is the list of homework sets that have +been assigned to you. These links allow you to go to any assignment +you want to work on. Right now, you might only have the Orientation set assigned to you, but as the term progresses, the list will grow. +$PAR + +The data in the panel at the top of the page tells you where you +are in WeBWorK's hierarchy of pages, but you can ignore that for the +most part. There is an additional logout button at the far right, +however, that you will need to use when you are done using $WW (don't +press it yet). +$PAR + +\{ +#The yellow question mark icon is a ${LQ}Help${RQ} +#button for system documentation, but there is not much of that +#available at the moment. +#$PAR +\} + +The main information on this page is located in the large white area +in the middle. It shows the status of the problems in this assignment, +and your score on the set so far. Since you haven't yet tried any of +the problems, your score is zero, but after you work on some of them, +the number of attempts and the score will reflect the work you have +done. +$PAR + +Each problem number is a link to that problem in the homework set. +You can click on one to get to any specific problem. To begin the +orientation assignment, click on the link for Problem 1. When you are +done working, be sure to dismiss your connection to the server by +clicking on ${LQ}Log Out${RQ}, so that no one else can gain access to +your account. +$PAR + +END_TEXT + +} + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setOrientation.def b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setOrientation.def new file mode 100644 index 0000000000..26eecf74d1 --- /dev/null +++ b/Contrib/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setOrientation.def @@ -0,0 +1,19 @@ + +openDate = 03/28/2016 at 12:00am PDT +dueDate = 06/01/2017 at 10:00pm PDT +answerDate = 06/01/2017 at 10:00pm PDT +paperHeaderFile = PCCSetDefinitions/Orientation/PCCOrientationHeader.pg +screenHeaderFile = PCCSetDefinitions/Orientation/PCCOrientationHeader.pg +description = problems to train students on how to use WeBWorK +problemList = +PCCSetDefinitions/Orientation/NewOrientation01.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation02.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation03.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation04.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation05.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation06.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation07.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation08.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation09.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation10.pg, 1, -1 + diff --git a/Contrib/PCC/README.txt b/Contrib/PCC/README.txt new file mode 100644 index 0000000000..337f4880bf --- /dev/null +++ b/Contrib/PCC/README.txt @@ -0,0 +1,17 @@ +This is a repository of problem libraries developed at Portland Community College. + +The most important copy of this repo lives at webwork.pcc.edu, in opt/webwork/libraries/PCC/. +Subfolders (like BasicMath, BasicAlgebra, etc.) are symlinked from typical courses' templates +folders. + +For problem development, each person working on problem development has their own LibDev course, +for example LibDev-jordan. These courses do *not* have symlinks to BasicMath, etc. Instead, they +have copies of the entire repo, stored in templates/local/PCC/. + +Developers work on problems from the web side of their LibDev course. As needed, development is +committed, and pushed to the repo at opt/webwork/libraries/PCC/, from which it is pushed back down +to all other LibDev courses. + +Lastly, the subfolders in opt/webwork/libraries/PCC/ are periodically *copied* (not using git in +any way) into webwork-open-problem-library/Contrib/PCC/, so that development can be committed to +that repo and shared with the world. diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/02Stats_02_DescrData.pg b/Contrib/PCC/Statistics/BasicOneVarStats/02Stats_02_DescrData.pg new file mode 100644 index 0000000000..9a6b399514 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/02Stats_02_DescrData.pg @@ -0,0 +1,108 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 2: Describing Distributions with Numbers') +## KEYWORDS('statistics', 'mean') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 2: Describing Distributions with Numbers') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"parserNumberWithUnits.pl", +"niceTables.pl", +); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@m = (random(6,7,.1), +random(7,8,.1), +random(8.5,9.5,.1), +random(9.5,10.5,.1), +random(9,10,.1), +random(9,9.7,.1)); + +@mo = (random(7.5,8.5,.1), +random(9,10,.1), +random(10,11,.1), +random(12,13,.1), +random(11.5,12.5,.1), +random(10,11.5,.1)); + +@e = (random(1.10,1.25,.01), +random(1,1.10,.01), +random(1.40,1.50,.01), +random(1.60,1.75,.01), +random(1,1.10,.01), +random(1.13,1.23,.01)); + +@eo = (random(0.9,1,.01), +random(1.30,1.45,.01), +random(1.10,1.20,.01), +random(1.40,1.50,.01), +random(1.20,1.30,.01), +random(1.30,1.38,.01)); + +################################################# +# Main + +BEGIN_TEXT +Animals and people that take in more energy than they expend will get fatter. Here are data on \(12\) rhesus monkeys: \(6\) lean monkeys (\(4$PERCENT\) to \(9$PERCENT\) body fat) and \(6\) obese monkeys (\(13$PERCENT\) to \(14$PERCENT\) body fat). The data report the energy expended in \(24\) hours (kilojoules per minute) and the lean body mass (kilograms, leaving out fat) for each monkey. +$PAR + +\{DataTable( +[ +[['Lean Monkeys Lean Body Mass (kg)', headerrow=>1, midrule=>1], 'Lean Monkeys Energy (kJ/min)', 'Obese Monkeys Lean Body Mass (kg)', 'Obese Monkeys Energy (kJ/min)'], +[' \($m[0]\) ','\($e[0]\)',' \($mo[0]\)','\($eo[0]\)'], +['\($m[1]\)','\($e[1]\)','\($mo[1]\)','\($eo[1]\)'], +['\($m[2]\)','\($e[2]\)','\($mo[2]\)','\($eo[2]\)'], +['\($m[3]\)','\($e[3]\)','\($mo[3]\)','\($eo[3]\)'], +['\($m[4]\)','\($e[4]\)','\($mo[4]\)','\($eo[4]\)'], +['\($m[5]\)','\($e[5]\)','\($mo[5]\)','\($eo[5]\)'], +], +align => 'XXXX', +tablecss => 'width:75%; ', +headercss => 'vertical-align:top; ', +)\} + +$PAR +(a) What is the mean lean body mass of the lean monkeys? $BR $SPACE $SPACE $SPACE \( \overline{LBM}_{\text{Lean}} = \) \{ans_rule(5)\}. + +$PAR +(b) What is the mean lean body mass of the obese monkeys? $BR $SPACE $SPACE $SPACE \( \overline{LBM}_{\text{Obese}} = \) \{ans_rule(5)\}. +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a1 = Compute(($m[0]+$m[1]+$m[2]+$m[3]+$m[4]+$m[5])/6); +ANS(NumberWithUnits("$ans_a1 kg")->cmp); +$ans_a2 = Compute(($mo[0]+$mo[1]+$mo[2]+$mo[3]+$mo[4]+$mo[5])/6); +ANS(NumberWithUnits("$ans_a2 kg")->cmp); + +################################################################# +BEGIN_SOLUTION + +(a) The mean lean body mass of the lean monkeys is, \(\overline{LBM}_{\text{Lean}}=\frac{$m[0]+$m[1]+$m[2]+$m[3]+$m[4]+$m[5]}{6}\approx$ans_a1 kg \). Don't forget units! +$PAR +(b) The mean lean body mass of the obese monkeys is, \(\overline{LBM}_{\text{Obese}}=\frac{$mo[0]+$mo[1]+$mo[2]+$mo[3]+$mo[4]+$mo[5]}{6} \approx $ans_a2 kg\). Don't forget units! + +END_SOLUTION +################################################### +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/02Stats_05_DescrData.pg b/Contrib/PCC/Statistics/BasicOneVarStats/02Stats_05_DescrData.pg new file mode 100644 index 0000000000..5b2ff28bf9 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/02Stats_05_DescrData.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch02DescribingData/02Stats_05_DescrData.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch02DescribingData/02Stats_05_DescrData.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/11Stats_01_SamplingDistns.pg b/Contrib/PCC/Statistics/BasicOneVarStats/11Stats_01_SamplingDistns.pg new file mode 100644 index 0000000000..2a92202a3c --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/11Stats_01_SamplingDistns.pg @@ -0,0 +1,77 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@TwoProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @TwoProblems[@scramble]; + +$percent = random(55, 80, 1); + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The unknown true percentage of American citizens who enjoy reality TV is a ","parameter."); + $mc[0]->extra("statistic. ", + "sample. ", + "population. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The number \($percent$PERCENT\) is a ","statistic. "); + $mc[1]->extra("sample. ", + "population. ", + "parameter. "); + +###################################### +# Main text + +BEGIN_TEXT +A phone-in poll conducted by a newspaper reported that \($percent$PERCENT\) of those who called in enjoyed reality TV. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); + +################################################### +BEGIN_SOLUTION + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/11Stats_02_SamplingDistns.pg b/Contrib/PCC/Statistics/BasicOneVarStats/11Stats_02_SamplingDistns.pg new file mode 100644 index 0000000000..f50e690b5e --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/11Stats_02_SamplingDistns.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch11SamplingDistributions/11Stats_02_SamplingDistns.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch11SamplingDistributions/11Stats_02_SamplingDistns.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/19Stats_01_InferencePropn.pg b/Contrib/PCC/Statistics/BasicOneVarStats/19Stats_01_InferencePropn.pg new file mode 100644 index 0000000000..7d59dcc37f --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/19Stats_01_InferencePropn.pg @@ -0,0 +1,75 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", +"contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$n = random(50,90,5); +$x= int($n*random(.2,.7,.1)); +$ansdec = Real($x/$n); + +###################################### +# Main text + +BEGIN_TEXT +An article in the Washington Post on March \(16\), \(1993\) stated that nearly \(45\) +percent of all Americans have brown eyes. A random sample of \(n = $n\) PCC +students found \($x\) with brown eyes. Give the numerical value of the statistic +\( \hat{p} \). + +$BR +\( \hat{p} = \) +\{ ans_rule(5)\} + +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +Context("Percent"); +$ans = Percent($x/$n); +ANS($ans->cmp->withPostFilter(AnswerHints( + Percent(.45) => ["Enter the statistic not the parameter."], + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01 ; + } => ["Close! Use more accuracy in our calculation."] +))); + +################################################### +BEGIN_SOLUTION + +Recall that a statistic \(\hat{p}\) is found using the form \(\hat{p} = \frac{x}{n}\) where \(x\), in this case, is the number of people with a certain quality out \(n\) total people. +$PAR +Thus \(\hat{p} =\frac{$x}{$n} = $ansdec\) or, \($ans\). + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/CenterMeasureFromStemAndLeaf.pg b/Contrib/PCC/Statistics/BasicOneVarStats/CenterMeasureFromStemAndLeaf.pg new file mode 100644 index 0000000000..cbc93e35a7 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/CenterMeasureFromStemAndLeaf.pg @@ -0,0 +1,54 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## KEYWORDS('center measures', 'stem and leaf') +## Author('Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/5/05 +# Location: Northern Arizona University + +DOCUMENT(); + +loadMacros("PGstandard.pl", + "PGnauStats.pl", + "extraAnswerEvaluators.pl", + "MathObjects.pl", + ); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; + +$count = random(20,30,1); +for ($i = 0; $i < $count; $i++){ + push @data, random(50,95,1); +} + +#($html, $tex) = PercentStemAndLeaf('single'=>0,'all'=>0, @data); +($html, $tex) = PercentStemAndLeaf(@data); +($mean, $tmp) = MeanDev(@data); +$median = Median(@data); +@modes = Mode(@data); +###################################### + +BEGIN_TEXT +From the stem plot below, determine the mean, median and mode(s) of the data. Record answers that are not integers to two decimal places. $BR $BR +${BBOLD} NOTES: $EBOLD $BR +(1) If there is more than one mode, list all of them, separated by commas. $BR +(2) If there is no mode, write $BBOLD None$EBOLD. + +$BR +$BR +Mean: \{ans_rule(10)\}, Median: \{ans_rule(10)\}, Mode: \{ans_rule(10)\}$BR$BR +END_TEXT + +TEXT(MODES(TeX => $tex, HTML => $html)); + +ANS(Compute($mean)->cmp); +ANS(Compute($median)->cmp); +ANS(number_list_cmp((join ", ", @modes), strings => ["None"])); + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/FiveNum.pg b/Contrib/PCC/Statistics/BasicOneVarStats/FiveNum.pg new file mode 100644 index 0000000000..b0e04fb2b1 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/FiveNum.pg @@ -0,0 +1,77 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## KEYWORDS('five number summary') +## Author('Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/6/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGnauStats.pl", + "MathObjects.pl", + "parserOneOf.pl", +); + +TEXT(&beginproblem) ; +$showPartialCorrectAnswers = 1; + +$n=random(10,30,1); + +for ($i = 0; $i < $n; $i++){ + push @dat, random(25,100,1); +} + +@ans = FiveNum(@dat); +@list = num_sort(@dat); +if ($n/2 - round($n/2) != 0) + {$q1exc = $ans[1]; + $q1inc = $ans[1]; + $q3exc = $ans[3]; + $q3inc = $ans[3];} +elsif ($n/4 - round($n/4) != 0) + {$q1exc = 0.25*$list[($n-2)/4-1]+0.75*$list[($n-2)/4+1-1]; + $q1inc = 0.25*$list[($n-2)/4+1]+0.75*$list[($n-2)/4+1-1]; + $q3exc = 0.25*$list[$n-($n-2)/4]+0.75*$list[$n-($n-2)/4-1]; + $q3inc = 0.25*$list[$n-($n-2)/4-2]+0.75*$list[$n-($n-2)/4-1];} +else + {$q1exc = 0.75*$list[($n)/4-1]+0.25*$list[($n)/4+1-1]; + $q1inc = 0.25*$list[($n)/4-1]+0.75*$list[($n)/4+1-1]; + $q3exc = 0.75*$list[$n-($n)/4]+0.25*$list[$n-($n)/4-1]; + $q3inc = 0.75*$list[$n-($n)/4]+0.25*$list[$n-($n)/4-1];} + + +BEGIN_TEXT +$BR +Consider the following data set. Give the five number summary listing values in numerical order. Different software applications may compute the quartiles differently than the by-hand method. This problem is coded so that any such method is acceptable.$PAR + + Data set: \{join ", ", @dat \} + +$PAR +The five-number summary is: +\{ans_rule(5)\} , \{ans_rule(5)\} , \{ans_rule(5)\} , \{ans_rule(5)\} , \{ans_rule(5)\} . +END_TEXT + +ANS(Compute($ans[0])->cmp); +ANS(Compute(OneOf($ans[1],$q1exc,$q1inc))->cmp); +ANS(Compute($ans[2])->cmp); +ANS(Compute(OneOf($ans[3],$q3exc,$q3inc))->cmp); +ANS(Compute($ans[4])->cmp); + +BEGIN_SOLUTION +Note that we should first sort all of the data from largest to smallest, seen below. +$PAR +\{join ", ", num_sort@dat \} +$PAR +In this data, the minimum is \($ans[0]\) and the maximum is \($ans[4]\). The median is \($ans[2]\). The values for \(Q_{1}\) and \(Q_{3}\) depend on if you include the median when finding the respective values or not. If you do not include the median, you find, \(Q_{1}=$q1exc\) and \(Q_{3}=$q3exc\). If you include the median, you find, \(Q_{1}=$q1inc\) and \(Q_{3}=$q3inc\). +$PAR +This means an acceptable \(5\)-number summary could be; +\($ans[0], $q1exc, $ans[2], $q3exc, $ans[4]\) or, \($ans[0], $q1inc, $ans[2], $q3inc, $ans[4]\) + +END_SOLUTION +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/MeanStdDev.pg b/Contrib/PCC/Statistics/BasicOneVarStats/MeanStdDev.pg new file mode 100644 index 0000000000..e4ea1c31ba --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/MeanStdDev.pg @@ -0,0 +1,43 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## KEYWORDS('center measures', 'mean', 'standard deviation') +## Author('Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/6/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGnauStats.pl", + "MathObjects.pl" +); + +TEXT(&beginproblem) ; +$showPartialCorrectAnswers = 1; + +$n=random(10,30,1); + +for ($i = 0; $i < $n; $i++){ +push @dat, random(25,100,1); +} + +@ans = MeanDev(@dat); + +BEGIN_TEXT +Consider the following data set. Find the mean and standard deviation.$PAR + Data set: \{join ", ", @dat;\} +$PAR +Mean: \{ans_rule(20) \}$BR +Standard deviation: \{ans_rule(20) \}$BR +END_TEXT + + +ANS(Compute($ans[0])->cmp); +ANS(Compute($ans[1])->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/data2.pg b/Contrib/PCC/Statistics/BasicOneVarStats/data2.pg new file mode 100644 index 0000000000..3ad8e44abf --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/data2.pg @@ -0,0 +1,98 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## KEYWORDS('') +## Author('Michael Ratliff ') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/3/05 +# from pl/setStatistics2Measures/ur_stt_2_1.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a[0] = random(10,15,1); +$a[1] = random(16,25,1); +$a[2] = $a[1]; +$c1 = $a[2]+1; +$c2 = $a[2]+3; +$a[3] = random($c1,$c2,1); +$d1 = $a[3]+1; +$d2 = $a[3]+3; +$a[4] = random($d1,$d2,1); +$e1 = $a[4]+1; +$e2 = $a[4]+3; +$a[5] = random($e1,$e2,1); +$f1 = $a[5]+3; +$f2 = $a[5]+6; +$a[6] = random($f1,$f2,1); +$g1 = $a[6]+3; +$g2 = $a[6]+6; +$a[7] = random($g1,$g2,1); +$h1 = $a[7]+3; +$h2 = $a[7]+6; +$a[8] = random($h1,$h2,1); +$n1 = $a[8]+5; +$n2 = $a[8]+8; +$a[9] = random($n1,$n2,1); +$m1 = $a[9]+5; +$m2 = $a[9]+8; +$a[10] = random($m1,$m2,1); +$val1 = random(10,15,1); +$mean = int(($a[0]+$a[1]+$a[2]+$a[3]+$a[4]+$a[5]+$a[6]+$a[7]+$a[8]+$a[9]+$a[10]+$val1)/12*1000+.5)/1000; + +@set = ($a[0], $a[1], $a[2], $a[3], $a[4], $a[5], $a[6], $a[7], $a[8], $a[9], $a[10]); +@slice = NchooseK(11,11); +@sset = @set[@slice]; + +$var = 0; +for ($i=0; $i<11; $i+=1) { + $b = ($a[$i] - $mean)**2; + $var = $var+$b; +} + + +$variance = ($var+($val1-$mean)**2)/11; +$sd = int(sqrt($variance)*1000+.5)/1000; + +BEGIN_TEXT +A data set consists of the data given below plus one more data point. When the additional point is included in the data set the sample mean of the resulting data set is \($mean\). What is the value of the additional data point? + $PAR +\[ $sset[0], \ $sset[1], \ $sset[2], \ $sset[3], \ $sset[4], \ $sset[5], \ $sset[6], \ $sset[7], \ $sset[8], \ +$sset[9], \ $sset[10] \]$PAR + +Value of additional data point \(=\) \{ans_rule(20)\}$BR + +END_TEXT +ANS(Compute($val1)->cmp); + +################################################### +BEGIN_SOLUTION + +If there were NO extra data point, to find the mean we would compute \(\overline{x}=\frac{$a[0]+$a[1]+$a[2]+$a[3]+$a[4]+$a[5]+$a[6]+$a[7]+$a[8]+$a[9]+$a[10]}{11}\) +$PAR +But there is an extra data point we do not know, thus there are actually \(12\) pieces of data, which changes our computation of the mean to \(\overline{x}=\frac{$a[0]+$a[1]+$a[2]+$a[3]+$a[4]+$a[5]+$a[6]+$a[7]+$a[8]+$a[9]+$a[10]+x}{12}\) +$PAR +Since is know the mean is \($mean\), we have \($mean=\frac{$a[0]+$a[1]+$a[2]+$a[3]+$a[4]+$a[5]+$a[6]+$a[7]+$a[8]+$a[9]+$a[10]+x}{12}\) +$PAR +This can be solved to find the missing data value to be \(x=$val1\). + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_1_6.pg b/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_1_6.pg new file mode 100644 index 0000000000..6a70d67501 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_1_6.pg @@ -0,0 +1,75 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Mode') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Mode') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +@data = ("F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F", + "Th","Th","Th","Th","Th","Th","Th","Th", + "Tu","Tu","Tu","Tu","Tu","Tu", + "W","W","W","W","W","W","W", + "M","M","M","M","M","M","M", + "Sa","Sa","Sa","Sa", + "Su","Su","Su","Su","Su"); + +@slice = NchooseK(60,47); +@sdata = @data[@slice]; + +$popup = PopUp(["?", "Su", "M", "Tu", "W", "Th", "F", "Sa"], "F"); + + +$out = ''; +for $j (@sdata) { + $out .= " $j,"; +} +chop($out); + + +BEGIN_TEXT + +The following data contains days when road rage occured according to a study. The goal of the study is to determine when road rage occurs most often. + +$BR$BR +$out +$BR$BR +Find the mode of the above data. +$BR $BR +The mode is \{ $popup->menu() \}. + +END_TEXT + +ANS( $popup->cmp() ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_2_1.pg b/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_2_1.pg new file mode 100644 index 0000000000..6230661489 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_2_1.pg @@ -0,0 +1,78 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Mean') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Sample Mean') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(1,3,.1); +$a2 = $a1+ .2; +$a3 = $a1 - .1; +$a4 = random(2,4,.1); +$b1 = $a1+.1; +$c1 = $a1+.3; +$a5 = random($b1,$c1,1); +$b3 = $a4+.4; +$c3 = $a4- .6; +$a6 = random($b3,$c3,1); + +@data = ($a1, $a2, $a3, $a4, $a5, $a6); +@slice = NchooseK(6,6); +@sdata = @data[@slice]; + +$sum = ($a1 + $a2 + $a3 + $a4 + $a5 + $a6); +$n=6; + +BEGIN_TEXT +For the given data, find \( \Sigma x\) and \(n\): +$PAR + +\[ x_1=$sdata[0], \ x_2=$sdata[1], \ x_3=$sdata[2], \ x_4=$sdata[3], \ x_5=$sdata[4], \ x_6=$sdata[5] \] + +$PAR +\( \Sigma x=\)\{ans_rule(10)\} $BR +\(n =\) \{ans_rule(10)\} + +END_TEXT + +ANS(Compute($sum)->cmp); +ANS(Compute($n)->cmp); + +################################################### +BEGIN_SOLUTION + +(a) Recall that \( \Sigma x\) is shorthand for asking you to add, or sum, all the data value available. Thus we find, +$PAR +\( \Sigma x = $a1 + $a2 + $a3 + $a4 + $a5 + $a6 =$sum\) +$PAR +(b) Recall that \(n\) is the number of pieces of data we have. In this case, \(n=$n\). +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_4_3.pg b/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_4_3.pg new file mode 100644 index 0000000000..a26c608a7e --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_4_3.pg @@ -0,0 +1,68 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Quartiles') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Quartiles') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + + +@event = ("Q1","Q2","Q3"); +@ans = (49, 73, 86); + +@slice = NchooseK(3,2); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + + +BEGIN_TEXT +Here is a list of \(27\) scores on a Statistics midterm exam: $BR $BR +\(20,\ 30,\ 31,\ 32,\ 46,\ 48,\ 49,\ 52,\ 54,\)$BR +\(59,\ 61,\ 69,\ 71,\ 73,\ 74,\ 79,\ 81,\ 81,\)$BR +\(81,\ 85,\ 86,\ 87,\ 88,\ 91,\ 94,\ 96,\ 97\)$BR $BR + + +Find $sevent[0]: \{ans_rule(10)\} $BR $BR +Find $sevent[1]: \{ans_rule(10)\} + +END_TEXT + +ANS(Compute($sans[0])->cmp); +ANS(Compute($sans[1])->cmp); + +################################################### +BEGIN_SOLUTION + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_4_4.pg b/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_4_4.pg new file mode 100644 index 0000000000..6e7d1444a1 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/dueck3_4_4.pg @@ -0,0 +1,140 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Quartiles') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Quartiles') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(20,50,1); +$a2 = $a1+1; +$a3 = $a1-2; +$b1 = $a1+5; +$c1 = $a1+3; +$a4 = random($b1,$c1,1); +$b2 = $a1-3; +$c2 = $a1-5; +$a5 = random($b2,$c2,1); +$b3 = $a1+7; +$c3 = $a1+8; +$a6 = random($b3,$c3,1); +$b4 = $a1-7; +$c4 = $a1-8; +$a7 = random($b4,$c4,1); +$b6 = $a1-11; +$c6 = $a1-9; +$a9 = random($b6,$c6,1); +$b5 = $a1+11; +$c5 = $a1+9; +$a8 = random($b5,$c5,1); +$b7 = $a1+15; +$c7 = $a1+19; +$a10 = random($b7,$c7,1); +$b8 = $a1-15; +$c8 = $a1-19; +$a11 = random($b8,$c8,1); +$b9 = $a1+21; +$c9 = $a1+24; +$a12 = random($b9,$c9,1); +$b10 = $a1-21; +$c10 = $a1-24; +$a13 = random($b10,$c10,1); +$b11 = $a1+27; +$c11 = $a1+31; +$a14 = random($b11,$c11,1); +$b12 = $a1-27; +$c12 = $a1-28; +$a15 = random($b12,$c12,1); + + +@data = ($a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8,$a9,$a10,$a11,$a12,$a13,$a14,$a15); +@slice = NchooseK(15,15); +@sdata = @data[@slice]; + +$Q1 = $a9; +$Q2 = $a1; +$Q3 = $a8; +$Min = $a15; +$Max = $a14; +$IQR = $Q3-$Q1; + +$mc = new_multiple_choice(); + +$mc->qa("There is a potential outlier in this data set according to the 1.5IQR rule.", +"False"); +$mc->makeLast("True"); + + +BEGIN_TEXT + + +Calculate the \(5\) number summary and the interquartile range of the following data: + +\[ $sdata[0], \ $sdata[1], \ $sdata[2], \ $sdata[3], \ $sdata[4], \ $sdata[5], \ $sdata[6], \ $sdata[7] ,\ $sdata[8],\ $sdata[9],\ $sdata[10],\ $sdata[11],\ $sdata[12],\ $sdata[13],\ $sdata[14] \] $BR $BR + +Min = \{ans_rule(10)\} $BR + +Q1 = \{ans_rule(10)\} $BR + +Q2 = \{ans_rule(10)\} $BR + +Q3 = \{ans_rule(10)\} $BR + +Max = \{ans_rule(10)\} $BR + +IQR = \{ans_rule(10)\} $BR + +$BR $HR $BR + +\{ $mc->print_q \} +\{ $mc->print_a \} + + +END_TEXT + +ANS(Compute($Min)->cmp); +ANS(Compute($Q1)->cmp); +ANS(Compute($Q2)->cmp); +ANS(Compute($Q3)->cmp); +ANS(Compute($Max)->cmp); +ANS(Compute($IQR)->cmp); + +ANS(radio_cmp($mc->correct_ans)); + +################################################### +BEGIN_SOLUTION + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/kolossa10.pg b/Contrib/PCC/Statistics/BasicOneVarStats/kolossa10.pg new file mode 100644 index 0000000000..e7e6256081 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/kolossa10.pg @@ -0,0 +1,64 @@ +##DESCRIPTION +## Statistics: basic measurements +##ENDDESCRIPTION + +##KEYWORDS('statistics', 'measures', 'standard deviation') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mc = new_multiple_choice(); + +$mc->qa("The standard deviation is preferable to the range as a measure of variation because it takes into account all the observations, not only the largest and the smallest ones", +"True"); +$mc->makeLast("False"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +$mc = new_multiple_choice(); + +$mc->qa("One major drawback to the standard deviation as a measure of variation is that it is ", +"Not resistant to outliers"); +$mc->extra("Decreasing", "Increasing"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT +$BR$HR$BR +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/kolossa19.pg b/Contrib/PCC/Statistics/BasicOneVarStats/kolossa19.pg new file mode 100644 index 0000000000..bb73343ea4 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/kolossa19.pg @@ -0,0 +1,89 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('statistics', 'introduction') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +@event = (' \(s \)', ' \( \sigma \)', ' \( \overline{x} \)', ' \( \mu \)'); +@ans = ("statistic","parameter","statistic", "parameter"); + +@slice = NchooseK(4,4); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + +for my $i (0..3) { + $popup[$i] = PopUp(["?", "parameter", "statistic"], $sans[$i]); +}; + + +BEGIN_TEXT + +Identify each quantity as a parameter or statistic. +$PAR + +(a) $sevent[0] is a \{$popup[0]->menu\}$PAR +(b) $sevent[1] is a \{$popup[1]->menu\}$PAR +(c) $sevent[2] is a \{$popup[2]->menu\}$PAR +(d) $sevent[3] is a \{$popup[3]->menu\}$PAR + + + +END_TEXT +for my $i (0..3) { + ANS($popup[$i]->cmp); +}; + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# + +ANS(num_cmp($ans1)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/kolossa47.pg b/Contrib/PCC/Statistics/BasicOneVarStats/kolossa47.pg new file mode 100644 index 0000000000..c19037e57e --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/kolossa47.pg @@ -0,0 +1,67 @@ +##DESCRIPTION +## Statistics: proportions +##ENDDESCRIPTION + +##KEYWORDS('percent') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("The population proportion is a", "parameter"); +$mc->extra("statistic"); +$mc->makeLast("statistic", "parameter", "None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +$BR +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +$mc = new_multiple_choice(); + +$mc->qa("The sample proportion is a", "statistic"); +$mc->extra("parameter"); +$mc->makeLast("statistic", "parameter", "None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/kolossa48.pg b/Contrib/PCC/Statistics/BasicOneVarStats/kolossa48.pg new file mode 100644 index 0000000000..3d2818ab38 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/kolossa48.pg @@ -0,0 +1,94 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('percent') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +# Capitalization changed by Tyler Diggans at NAU 7/2012 + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +$showPartialCorrectAnswers = 0; + + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("identify the population", "all No.1 draftpicks in the NBA since \(1966\)"); +$mc->extra("all NBA players since \(1966\)","all No.1 draftpick centers in the NBA since \(1966\)" ); +$mc->makeLast("None of the above"); + +BEGIN_TEXT +Since \(1966\), \(45$PERCENT\) of the No.1 draftpicks in the NBA have been centers. $BR + + +\{ $mc->print_q \} +\{ $mc->print_a \} +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +$mc = new_multiple_choice(); + +$mc->qa("identify the specified attribute", "being a center"); +$mc->extra("being an NBA player", "being a No.1 draftpicks in the NBA"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +$mc = new_multiple_choice(); + +$mc->qa("is the proportion \(0.45\) \((45$PERCENT)\) a population proportion or a sample proportion?", "population proportion"); +$mc->extra("sample proportion"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +################################################### +BEGIN_SOLUTION + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/kolossa8.pg b/Contrib/PCC/Statistics/BasicOneVarStats/kolossa8.pg new file mode 100644 index 0000000000..760be56197 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/kolossa8.pg @@ -0,0 +1,104 @@ +##DESCRIPTION +## Statistics: basic measurements +##ENDDESCRIPTION + +##KEYWORDS('statistics', 'measures') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a[0] = random(10,15,1); +$a[1] = random(16,25,1); +$a[2] = $a[1]; +$c1 = $a[2]+1; +$c2 = $a[2]+3; +$a[3] = random($c1,$c2,1); +$d1 = $a[3]+1; +$d2 = $a[3]+3; +$a[4] = random($d1,$d2,1); +$e1 = $a[4]+1; +$e2 = $a[4]+3; +$a[5] = random($e1,$e2,1); +$f1 = $a[5]+3; +$f2 = $a[5]+6; +$a[6] = random($f1,$f2,1); +$g1 = $a[6]+3; +$g2 = $a[6]+6; +$a[7] = random($g1,$g2,1); +$h1 = $a[7]+3; +$h2 = $a[7]+6; +$a[8] = 299; + + +$mean = ($a[0]+$a[1]+$a[2]+$a[3]+$a[4]+$a[5]+$a[6]+$a[7]+$a[8])/9; + +@set = ($a[0], $a[1], $a[2], $a[3], $a[4], $a[5], $a[6], $a[7], $a[8]); +@slice = NchooseK(9,9); +@sset = @set[@slice]; + +$var = 0; +for ($i=0; $i<9; $i+=1) { + $b = ($a[$i] - $mean)**2; + $var = $var+$b; +} + + +$range =$a[8]-$a[0] ; +$variance = $var/8; +$sd = sqrt($variance); + + +$mc = new_multiple_choice(); + +$mc->qa("The lack of what property of standard deviation accounts for its sensitivity to the one data value that is notably larger than the other ones?", +"Resistance"); +$mc->extra("Decreasing property"); +$mc->makeLast("All of the above"); + +BEGIN_TEXT +The length (in pages) of a sample of math research papers is given below. +Using this data, calculate the range, variance, and standard deviation. $PAR +\[ $sset[0], \ $sset[1], \ $sset[2], \ $sset[3], \ $sset[4], \ $sset[5], \ $sset[6], \ $sset[7], \ $sset[8] \]$PAR + +range \( =\) \{ans_rule(8)\}$BR +variance \( =\) \{ans_rule(8)\}$BR +standard deviation \( =\) \{ans_rule(8)\} + +$BR$HR$BR +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(Compute($range)->cmp); +ANS(Compute($variance)->cmp); +ANS(Compute($sd)->cmp); +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem + diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-05.pg b/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-05.pg new file mode 100644 index 0000000000..db4d1145da --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-05.pg @@ -0,0 +1,88 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics', 'standard deviation', 'variance') +## naw tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('06/01/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + +DOCUMENT(); +loadMacros("PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl" +); + +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +# True false questions are a special case of a "select list" +# Make a new select list + +$tf = new_select_list(); + +# $tf now "contains" the select list object. +# Insert some questions and whether or not they are true. + +$tf->rf_print_q(~~&pop_up_list_print_q); + +$tf -> ra_pop_up_list( [ No_answer => " ?", T => "True", F => "False"] ); + + +$tf -> qa ( # each entry has to end with a comma +"The difference between the largest and smallest values in an ordered +data set is called the range.", +"T", +"Quartiles divide the values in a data set into four parts of equal size.", +"T", +"The range is considered the weakest measure of variability.", +"T", +"The standard deviation will always be larger than the variance.", +"F", +"The standard deviation is the positive square root of the variance.", +"T", +"The interquartile range is found by taking the difference between the 1st +and 3rd quartiles and dividing that value by 2.", +"F", +"The standard deviation is expressed in terms of the original units of +measurement but the variance is not.", +"T", +"The value of the standard deviation may be either positive or negative, +while the value of the variance will always be positive.", +"F", +); + +# Choose four of the question and answer pairs at random. +$tf ->choose(4); + +# Now print the text using $ml->print_q for the questions +# and $ml->print_a to print the answers. +TEXT(beginproblem()); +BEGIN_TEXT +$PAR + +Select True or False from each pull-down menu, depending on whether +the corresponding statement is true or false. +$BR + +\{ $tf-> print_q \} + +$PAR + +END_TEXT + +# Enter the correct answers to be checked against the answers to the students. + +ANS(str_cmp( $tf->ra_correct_ans ) ) ; + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-08.pg b/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-08.pg new file mode 100644 index 0000000000..abcd4f40e9 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-08.pg @@ -0,0 +1,68 @@ +## DESCRIPTION +## Statistics: Numerical descriptive techniques +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'numerical', 'descriptive statistics', 'mean') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('6/1/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros("PG.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGauxiliaryFunctions.pl", + "MathObjects.pl"); + + +$numall = random(28,35,1); +do{$nummale = random(15,20,1); +$numfemale = $numall - $nummale;} until ($nummale != $numfemale); +$aveall = random(73,80,1); +$avemale = random(60,72,2); +$avefemale = ($aveall*$numall - $avemale*$nummale)/$numfemale; + +while ($avefemale > 100) { + $numall = random(28,35,1); + $nummale = random(15,20,1); + $numfemale = $numall - $nummale; + $aveall = random(73,80,1); + $avemale = random(60,72,2); + $avefemale = ($aveall*$numall - $avemale*$nummale)/$numfemale; +} + +TEXT(beginproblem()); + +TEXT(EV2(<cmp ); + +################################################### +BEGIN_SOLUTION + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-10.pg b/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-10.pg new file mode 100644 index 0000000000..59d2064431 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-10.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## Statistics: Numerical descriptive techniques +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'numerical', 'descriptive statistics', 'mean', 'median', 'mode') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('6/1/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$data[3] = random(200,220,2); +$data[4] = random(230,250,2); +$data[2] = $data[3] - random(2,20,2); +$data[1] = $data[3] - random(22,30,2); +$data[0] = $data[3] - random(32,50,2); +$data[5] = $data[4] + random(2,20,2); +$data[6] = $data[5]; +$data[7] = $data[4] + random(30,75,2); + +$mean = ($data[0]+$data[1]+$data[2]+$data[3]+$data[4]+$data[5]+$data[6]+$data[7])/8; +$median = ($data[3] + $data[4])/2; +$mode = $data[5]; + +@slice = NchooseK(8,8); +@shuffleddata = @data[@slice]; + + +BEGIN_TEXT +$PAR A sample of prices for eight television sets available at a local +electronics store is given below: +$PAR +\[ +$shuffleddata[0] \quad +$shuffleddata[1] \quad +$shuffleddata[2] \quad +$shuffleddata[3] \quad +$shuffleddata[4] \quad +$shuffleddata[5] \quad +$shuffleddata[6] \quad +$shuffleddata[7] +\] +$PAR +Find the mean, median, and mode for this sample. +$PAR +Sample Mean = \{ans_rule(15)\} +$PAR +Sample Median = \{ans_rule(15)\} +$PAR +Sample Mode = \{ans_rule(15)\} +$BR + + +END_TEXT + +ANS(Compute($mean)->cmp ); +ANS(Compute($median)->cmp ); +ANS(Compute($mode)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-11.pg b/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-11.pg new file mode 100644 index 0000000000..cd0b5d8143 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-11.pg @@ -0,0 +1,80 @@ +## DESCRIPTION +## Statistics: Numerical descriptive techniques +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'numerical', 'descriptive statistics', 'range', 'variance') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('6/1/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$data[2] = random(200,220,2); +$data[3] = random(230,250,2); +$data[1] = $data[2] - random(2,20,2); +$data[0] = $data[2] - random(20,30,2); +$data[4] = $data[3] + random(2,20,2); +$data[5] = $data[3] + random(30,75,2); + +$mean = ($data[0]+$data[1]+$data[2]+$data[3]+$data[4]+$data[5])/6; +$range = $data[5] - $data[0]; +$variance = (($data[0]-$mean)**2 + ($data[1]-$mean)**2 + ($data[2]-$mean)**2 + + ($data[3]-$mean)**2 + ($data[4]-$mean)**2 + ($data[5]-$mean)**2)/5; + +@slice = NchooseK(6,6); +@shuffleddata = @data[@slice]; + + +BEGIN_TEXT +$PAR A sample of prices for six cordless drills available at a local +home improvement store is given below: +$PAR +\[ +$shuffleddata[0] \quad +$shuffleddata[1] \quad +$shuffleddata[2] \quad +$shuffleddata[3] \quad +$shuffleddata[4] \quad +$shuffleddata[5] +\] +$PAR +Find the range and variance for this sample. +$PAR +Sample Range = \{ans_rule(15)\} +$PAR +Sample Variance = \{ans_rule(15)\} +$BR + + +END_TEXT + +ANS(Compute($range)->cmp ); +ANS(Compute($variance)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-17.pg b/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-17.pg new file mode 100644 index 0000000000..747e38dc07 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicOneVarStats/stat212-HW02-17.pg @@ -0,0 +1,120 @@ +## DESCRIPTION +## Statistics: Numerical descriptive techniques +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'numerical', 'descriptive statistics', 'quartile') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Quartiles') +## Date('6/1/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"parserOneOf.pl", +"parserMultiAnswer.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$data[3] = random(580,620,10); +$data[4] = random(630,650,10); +$data[2] = $data[3] - random(0,20,10); +$data[1] = $data[3] - random(30,50,10); +$data[0] = $data[3] - random(60,100,10); +$data[5] = $data[4] + random(0,20,10); +$data[6] = $data[4] + random(30,50,10); +$data[7] = $data[4] + random(60,100,10); + +$q1 = Real(0.5*$data[1] + 0.5*$data[2]); +$q1exc = Real(0.75*$data[1] + 0.25*$data[2]); +$q1inc = Real(0.25*$data[1] + 0.75*$data[2]); +$q3 = Real(0.5*$data[5] + 0.5*$data[6]); +$q3exc = Real(0.25*$data[5] + 0.75*$data[6]); +$q3inc = Real(0.75*$data[5] + 0.25*$data[6]); +$iqr = Real($q3 - $q1); +$with = ($data[5]-$data[3]); + +@slice = NchooseK(8,8); +@shuffleddata = @data[@slice]; + + +$multians = MultiAnswer($q1, $q3, $iqr)->with( + singleResult => 0, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $q1stu, $q3stu, $iqrstu ) = @{$student}; + my ( $q1cor, $q3cor, $iqrcor ) = @{$correct}; + if ( ($q1cor == $q1stu) || ($q1exc == $q1stu) || ($q1inc == $q1stu)) + {$q1OK = 1;} else {$q1OK = 0;}; + if ( ($q3cor == $q3stu) || ($q3exc == $q3stu) || ($q3inc == $q3stu)) + {$q3OK = 1;} else {$q3OK = 0;}; + if ($iqrstu == $q3stu-$q1stu) + {$iqrOK = 1;} else {$iqrOK = 0;}; + return [$q1OK, $q3OK, $iqrOK]; + } +); + +BEGIN_TEXT +$PAR A sample of eight math SAT scores is given below: +$PAR +\[ +$shuffleddata[0] \quad +$shuffleddata[1] \quad +$shuffleddata[2] \quad +$shuffleddata[3] \quad +$shuffleddata[4] \quad +$shuffleddata[5] \quad +$shuffleddata[6] \quad +$shuffleddata[7] +\] +$PAR +Find the first and third quartiles and the interquartile range for this sample. Different software applications may use slightly different formulas for finding quartiles than what a person would use by hand; this problem is coded so that any of the common methods that software or people would use will give correct answers. +$PAR +\(Q_1 ={}\) \{$multians->ans_rule(10)\} +$PAR +\(Q_3 ={}\) \{$multians->ans_rule(10)\} +$PAR +\(IQR ={}\) \{$multians->ans_rule(10)\} + +$BR + + +END_TEXT + +ANS( $multians->cmp() ); + +BEGIN_SOLUTION +Note that we should first organize the data from smallest to largest, as seen below, +$PAR +\($data[0], $data[1], $data[2], $data[3], $data[4], $data[5], $data[6], $data[7]\) +$PAR +(a) If you include the median in finding the lower quartile, we find \(Q_{1} =$data[3]\). If we do not include the median, we find \(Q_{1} =$q1\). +$PAR +(b) If you include the median in finding the upper quartile, we find \(Q_{3} =$data[5]\). If we do not include the median, we find \(Q_{3} =$q3\). +$PAR +The \(IQR\) is found by computing \(Q_{3}- Q_{1}\). Thus if we have included the median in our calculations, we find \(IQR = $iqr\), if we have not included the median, we find \(IQR =$with\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicProbability/10Stats_01_Probability.pg b/Contrib/PCC/Statistics/BasicProbability/10Stats_01_Probability.pg new file mode 100644 index 0000000000..c8e5f93c1d --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/10Stats_01_Probability.pg @@ -0,0 +1,84 @@ +## DESCRIPTION +## DBsubject(Probability) +## DBchapter(Counting and probability) +## DBsection(Probability) +## Institution(The College of Idaho) +## Author(R Cruz, L Danielson, J Guild) +## Level(1) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('10') +## Problem1('') +## KEYWORDS('statistics', 'probability') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$choose = random(0,1,1); #Pick the problem + +$mc = new_multiple_choice(); +if ($choose == 1) { + $mc->qa("A phenomenon is observed many, many times under identical conditions. The + proportion of times a particular event occurs is recorded. This proportion represents" + ,"the probability of the event. "); + $mc->extra("the distribution of the event.", + "the correlation of the event. ", + "the variance of the event. "); +}else{ + $mc->qa("The probability of any outcome of a random phenomenon is ","the proportion of a very long + series of repetitions in which the outcome occurs. "); + $mc->extra("the precise degree of randomness present in the phenomenon. ", + "either 0 or 1, depending on whether or not the phenomenon can actually occur. ", + "any number, as long as it is a value between 0 and 1. "); +} + +$mc1 = new_multiple_choice(); + $mc1->qa("The collection of all possible outcomes of a random phenomenon is called ","the sample space."); + $mc1->extra("the distribution. ", + "the probability.", + "a census. "); + $mc1->makeLast("None of the above."); + +###################################### +# Main text + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc -> print_q() \} +$BR +\{$mc -> print_a() \} + +$PAR +(b) \{ $mc1 -> print_q() \} +$BR +\{$mc1 -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc->correct_ans)); +ANS(radio_cmp($mc1->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + diff --git a/Contrib/PCC/Statistics/BasicProbability/10Stats_02_Probability.pg b/Contrib/PCC/Statistics/BasicProbability/10Stats_02_Probability.pg new file mode 100644 index 0000000000..04a5cde186 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/10Stats_02_Probability.pg @@ -0,0 +1,66 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('E Cabrera, R Cruz') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$fatchance = random(0.01,0.04,0.01); +$perhaps = random(0.4,0.45,0.01); +$maybe = random(0.55,0.6,0.01); +$probably = random(0.9,0.99,0.01); + +#make a new match list +$ml = new_match_list(); + +$ml -> qa ( + "It is basically not possible for this event to happen.", "0", + "This event is very unlikely to happen, but it will occur once in a while in a long sequence of trials.", "$fatchance", + "This event will occur a little less than half the time over a long sequence of trials.", "$perhaps", + "This event will occur more often than not.", "$maybe", + "This event is very likely to occur.", "$probably", + "This event is basically certain to happen on every trial.", "1" +); + +$ml -> choose(4); + +###################################### +# Main text + +BEGIN_TEXT +Probability is a measure of how likely an event is to occur. +Match one of the probabilities that follow with each statement of likelihood given. Type the correct $BBOLD letter $EBOLD in each box. You must get all of the answers correct to receive full credit. +$PAR + +\{ $ml -> print_q \} +$PAR + +\{$ml -> print_a \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS( str_cmp( $ml->ra_correct_ans ) ) ; + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicProbability/10Stats_04_Probability.pg b/Contrib/PCC/Statistics/BasicProbability/10Stats_04_Probability.pg new file mode 100644 index 0000000000..63a41aea98 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/10Stats_04_Probability.pg @@ -0,0 +1,60 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl",, + "answerHints.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$attempts = random(100, 250, 10); +$baskets = $attempts - random(20,50,5); + +###################################### +# Main text + +BEGIN_TEXT +A basketball player makes $baskets out of $attempts free throws. We would +estimate the probability that the player makes the next free throw to be +\{ans_rule(10)\} . +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +Context("Percent"); +$ans = Percent($baskets / $attempts); +ANS($ans->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + diff --git a/Contrib/PCC/Statistics/BasicProbability/10Stats_12_Probability.pg b/Contrib/PCC/Statistics/BasicProbability/10Stats_12_Probability.pg new file mode 100644 index 0000000000..75bc5176ae --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/10Stats_12_Probability.pg @@ -0,0 +1,101 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'sample space', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz') +## Institution('The College of Idaho') +## Date: 2009/03 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@event = ("\( X = 1\)", "\( X = 2\)"); +$choose = random(0,1,1); + +###################################### +# Main text + +BEGIN_TEXT +Suppose a couple planned to have three children. Let \( X \) be the number +of girls the couple has. + +$PAR +(a) List all possible arrangements of girls and boys. For example, if the + couple had 2 girls and then a boy, then their arrangement is $BBOLD GGB$EBOLD. Separate each + item in your list with a comma: \{ans_rule(60)\}. + +$PAR +(b) List the sample space for \( X \). (i.e. List the possible values that \( X \) + may take separated by commas.): \{ans_rule(20)\}. + +$PAR +(c) What is the probability that $event[$choose]? \{ans_rule(10)\} + +$PAR +(d) What is \(P(\)$event[$choose]\()\)? \{ans_rule(10)\} + +$PAR + +(e) Find the probability that the couple have three boys: \{ans_rule(15)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +Context()->strings->add("GGG"=>{}, + "GGB"=>{}, + "GBG"=>{}, + "BGG"=>{}, + "BBG"=>{}, + "BGB"=>{}, + "GBB"=>{}, + "BBB"=>{}); + +$ans_a = List("GGG", "GGB", "GBG", "BGG", "BBG", "BGB", "GBB", "BBB"); +ANS($ans_a->cmp); + +$ans_b = List(0, 1, 2, 3); +ANS($ans_b->cmp); + +Context("Percent"); +$ans_c = Percent(0.375); +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."]))); + +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."]))); + +$ans_e = Percent(1/8); +ANS($ans_e->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."]))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BasicProbability/dueck5_1_2.pg b/Contrib/PCC/Statistics/BasicProbability/dueck5_1_2.pg new file mode 100644 index 0000000000..a431cc7eae --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/dueck5_1_2.pg @@ -0,0 +1,57 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@quest1 = ('the DOI is included in the sample', 'the DOI and the CP are included in the sample', 'the DOI and the DOS are included in the sample', 'the DOI, DOS and the CP are included in the sample'); +$tag1 = random(0,1); +$tag2 = random(2,3); +$b = 3/10; +$c = 1/10; +$d= 6/10; +@ans1 = ($d, $b, $b, $c); + + +BEGIN_TEXT + +There are five school officials at PCC who might be able to serve on a committee to investigate improving success in math courses: The Dean of Instruction (DOI), the Dean of Students (DOS), the Vice President of Student and Academic Affairs (VPSAA), the Division Dean overseeing mathematics (DD), and the Campus President (CP). Consider all possible groups of size 3 that can be obtained from this population of five officials. (Note: there are 10 possible samples!) +$BR $BR + +(a) What is the probability that $quest1[$tag1]? \{ans_rule(15)\} +$BR$BR +(b) What is the probability that $quest1[$tag2]? \{ans_rule(15)\} + +END_TEXT + +ANS(num_cmp($ans1[$tag1])); +ANS(num_cmp($ans1[$tag2])); + +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file diff --git a/Contrib/PCC/Statistics/BasicProbability/dueck5_1_5.pg b/Contrib/PCC/Statistics/BasicProbability/dueck5_1_5.pg new file mode 100644 index 0000000000..02f51b9930 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/dueck5_1_5.pg @@ -0,0 +1,70 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); + +$a1 = random (7,12,1); +$blah1 = $a1-7; +$ans1 = 6-$blah1; +$ans1= $ans1/36; + +$a2 = random(7,12,1); +while($a1==$a2) {$a2 = random(7,12,1);} +$blah2 = $a2-7; +$ans2 = 6-$blah2; +$ans2 = $ans2/36; + +$ans3 = 6/36; + +BEGIN_TEXT +Two six-sided dice are rolled (one red and one green). Some possibilities are (Red=1,Green=5) or (Red=2,Green=2) etc. $PAR +(a) How many total possibilities are there? $BR +\{ ans_rule(10) \} +$PAR +For the rest of the questions, we will assume that the dice are fair and +that all of the possibilities in (a) are equally likely. $PAR +(b) What is the probability that the sum on the two dice comes out +to be $a1?$BR +\{ ans_rule(20) \} +$PAR +(c) What is the probability that the sum on the two dice comes out +to be $a2? $BR +\{ ans_rule(20) \} +$PAR +(d) What is the probability that the numbers on the two dice are equal? +$BR +\{ ans_rule(20) \} +END_TEXT + +ANS(num_cmp( 36 ) ); +ANS(num_cmp( $ans1 ) ); +ANS(num_cmp( $ans2 ) ); +ANS(num_cmp( $ans3 ) ); + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/Contrib/PCC/Statistics/BasicProbability/kolossa5.pg b/Contrib/PCC/Statistics/BasicProbability/kolossa5.pg new file mode 100644 index 0000000000..7a0aabb716 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/kolossa5.pg @@ -0,0 +1,79 @@ +##DESCRIPTION +##KEYWORDS('statistics', 'introduction', 'concepts') +## +##ENDDESCRIPTION + +## KEYWORDS ('Statistics, 'introduction', 'concepts') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGauxiliaryFunctions.pl", +"PGanswermacros.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(0.1,0.9,.1); +$a2 = random(3,4,.1); +$a3 = random(-3,-2,.1); +$nn = random(2,5); +$den = 6; $g = gcd($nn, $den); +$nn = $nn/$g; +$den = $den/ $g; + + +@event = ($a1, 1, $a2, $a3, 0); +@ans = ("could be a probability", "could be a probability", "could not be a probability", "could not be a probability", "could be a probability"); + +@slice = NchooseK(5,5); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + +for my $i (0..4) { + $popup[$i] = PopUp(["?", "could be a probability", "could not be a probability"],$sans[$i]); +}; + +$popupY = PopUp(["?", "could be a probability", "could not be a probability"],"could be a probability"); + +BEGIN_TEXT + +Determine whether the following number can possibly be probability. $PAR + + +(a) $sevent[0] \{$popup[0]->menu\} $PAR +(b) $sevent[1] \{$popup[1]->menu\} $PAR +(c) $sevent[2] \{$popup[2]->menu\} $PAR +(d) $sevent[3] \{$popup[3]->menu\} $PAR +(e) \(\frac{$nn}{$den}\) \{$popupY->menu\} $PAR +(f) $sevent[4] \{$popup[4]->menu\} + +END_TEXT + +for my $i (0..3) { +ANS($popup[$i]->cmp); +}; +ANS($popupY->cmp); +ANS($popup[4]->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BasicProbability/stat212-HW03-17.pg b/Contrib/PCC/Statistics/BasicProbability/stat212-HW03-17.pg new file mode 100644 index 0000000000..254a5740a7 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/stat212-HW03-17.pg @@ -0,0 +1,69 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('probability') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('6/9/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$a = random(40,55,1); +$b = random(10,15,1); +$c = random(20,25,1); +$d = $a+$b+$c; +$i = 100 - ($d); +$e = 0.01*$a; +$f = 0.01*$b; +$g = 0.01*$c; +$h = 0.01*$i; + + +BEGIN_TEXT +$PAR +A survey asks adults to report their marital status. Suppose that in the city which +the survey is conducted, $a$PERCENT of adults are married, $b$PERCENT are single, $c$PERCENT +are divorced, and $i$PERCENT are widowed. Find the probabilities of each of the following events: +$PAR +The adult is single: \{ans_rule(15)\} +$PAR +The adult is not divorced: \{ans_rule(15)\} +$PAR +The adult is either widowed or divorced: \{ans_rule(15)\} +$BR + +END_TEXT + +Context("Percent"); +ANS(Percent($f)->cmp ); +ANS(Percent(1-$g)->cmp ); +ANS(Percent($g+$h)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicProbability/stat212-HW03-20.pg b/Contrib/PCC/Statistics/BasicProbability/stat212-HW03-20.pg new file mode 100644 index 0000000000..e5d0593744 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/stat212-HW03-20.pg @@ -0,0 +1,72 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('probability') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('6/9/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$a = random(.3,.6,.01); +$b = random(.05,.10,.01); +$c = random(.2,.29,.01); +$d = 1 - ($a+$b+$c); + + +BEGIN_TEXT +$PAR +Four candidates are running for mayor. The four candidates are Adams, Brown, Collins, and Dalton. Employing the subjective approach, a political scientist has assigned the following probabilities: +$PAR +\(P(\)Adams wins\()\) = $a +$PAR +\(P(\)Brown wins\()\) = $b +$PAR +\(P(\)Collins wins\()\) = $c +$PAR +\(P(\)Dalton wins\()\) = $d +$PAR +Determine the following probabilities: +$PAR +\(P(\)Adams loses\()\) = \{ans_rule(15)\} +$PAR +\(P(\)Either Brown or Dalton wins\()\) = \{ans_rule(15)\} +$PAR +\(P(\)Either Adams, Brown, or Collins wins\()\) = \{ans_rule(15)\} +$BR + +END_TEXT + +Context("Percent"); +ANS(Percent(1-$a)->cmp ); +ANS(Percent($b+$d)->cmp ); +ANS(Percent($a+$b+$c)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicProbability/stat212-HW04-03.pg b/Contrib/PCC/Statistics/BasicProbability/stat212-HW04-03.pg new file mode 100644 index 0000000000..3fe326d7d7 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/stat212-HW04-03.pg @@ -0,0 +1,66 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/10/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$a = random(5,15,1); +$b = 1 - ($a); +$c = 0.01*$a; +$d = 1 - $c; + + +BEGIN_TEXT +$PAR +Approximately $a$PERCENT of people are left-handed. If two +people are selected at random, what is the probability of the following events? +$PAR +A. P(Both are right-handed) = \{ans_rule(15)\} +$PAR +B. P(Both are left-handed) = \{ans_rule(15)\} +$PAR +C. P(One is right-handed and the other is left-handed) = \{ans_rule(15)\} +$PAR +D. P(At least one is right-handed) = \{ans_rule(15)\} + +$BR + +END_TEXT +Context("Percent"); +ANS(Percent($d*$d)->cmp ); +ANS(Percent($c*$c)->with(decimalPlaces => 2,tolerance => .00005)->cmp); +ANS(Percent(($c*$d)+($c*$d))->cmp ); +ANS(Percent(($c*$d)+($c*$d)+($d*$d))->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BasicProbability/ur_dis_9_17.pg b/Contrib/PCC/Statistics/BasicProbability/ur_dis_9_17.pg new file mode 100644 index 0000000000..2a4e2bbd31 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/ur_dis_9_17.pg @@ -0,0 +1,54 @@ +## DESCRIPTION +## Card Probability Problem +## ENDDESCRIPTION + +## KEYWORDS('Card', 'Probability') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +#Numerical Answer + +$a =4/52; +$b =13/52; +$c =16/52; + +TEXT(beginproblem()); + +BEGIN_TEXT +A card is selected at random from a standard 52-card deck. +$BR$BR +(a) What is the probability that it is an ace? \{ ans_rule(10) \} +$BR$BR +(b) What is the probability that it is a heart? \{ ans_rule(10) \} +$BR$BR +(c) What is the probability that it is an ace or a heart? \{ ans_rule(20) \} +END_TEXT + +Context("Percent"); +ANS(Percent( $a )->cmp ); +ANS(Percent( $b )->cmp ); +ANS(Percent( $c )->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/Contrib/PCC/Statistics/BasicProbability/ur_dis_9_19.pg b/Contrib/PCC/Statistics/BasicProbability/ur_dis_9_19.pg new file mode 100644 index 0000000000..8cb4cb2b56 --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/ur_dis_9_19.pg @@ -0,0 +1,46 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl" +); + +$a = random(3,9,1); +$b = floor(100/$a); +$c = $b/100; + +TEXT(beginproblem()); + +BEGIN_TEXT +What is the probability that a randomly chosen (uniformly random) positive integer \( m \) in the range +\( 1 \leq m \leq 100 \) is divisible by $a? +$BR +\{ ans_rule(10) \} +$PAR +END_TEXT + +ANS(num_cmp( $c ) ); + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/Contrib/PCC/Statistics/BasicProbability/ur_pb_5_2.pg b/Contrib/PCC/Statistics/BasicProbability/ur_pb_5_2.pg new file mode 100644 index 0000000000..dd880e82ac --- /dev/null +++ b/Contrib/PCC/Statistics/BasicProbability/ur_pb_5_2.pg @@ -0,0 +1,59 @@ +## DESCRIPTION +## Basic Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + + +$p = random(1000,4000,1); +$q = random(6000,7000,1); + +Context("Percent"); +Context()->flags->set( + decimalPlaces => 3, + tolerance => .000005, + ); + +$ans1 = Percent(1/$q); + + +BEGIN_TEXT +A financial firm is performing an assessment test and relies on a random +sampling of their accounts. Suppose this firm has \($q\) customer accounts numbered from +\(0001\) to \($q\).$PAR +One account is to be chosen at random. What is the probability that the +selected account number is \($p\)? \{ans_rule(10) \} + +END_TEXT + +ANS($ans1->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-13.pg b/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-13.pg new file mode 100644 index 0000000000..d713b29f6a --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-13.pg @@ -0,0 +1,105 @@ +## DESCRIPTION +## Statistics: Probability +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'probability') +## naw tagged this problem. + +## DBchapter('Continuous Probability Distributions') +## DBsection() +## Date('6/30/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"PGnauStats.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserOneOf.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a = random(52,54,0.1); +$b = random(400,600,10); +$c = random(48,50,0.1); +$sigma = Real(sqrt($a/100*(1-$a/100)*$b)); +$mu = $a/100*$b; + +$sucdec = ($a/100); +$faildec = (1-$sucdec); + +$c1 = $c/100*$b; +$z = ($c1 - $mu)/$sigma; +$z2 = ($c1 - 0.5- $mu)/$sigma; + +$d = ceil($b*$c/100); +$exact = 0; +for my $i (0..($d-1)){ +$multiplier = 1; +for my $j (1..$i) { + $multiplier = $multiplier * ($b-$i+$j)/$j; +} + $exact= $exact+ $multiplier*(($a/100)**$i)*((1-$a/100)**($b-$i)); +} + +$diagram = DrawNormalDist($z, -99, $z, "", outside=>1); + +$ans1 = normal_prob('-infty', $z, mean=>0, deviation=>1); +$ans2 = normal_prob('-infty', $z2, mean=>0, deviation=>1); + +Context("Percent"); +$ans = OneOf(Percent($exact),Percent($ans1),Percent($ans2)); + + +BEGIN_TEXT +$PAR +The proportion of eligible voters in the next election who +will vote for the incumbent is assumed to be \($a$PERCENT\). +What is the probability that in a random sample of \($b\) voters, +less that \($c$PERCENT\) say they will vote for the incumbent? +$PAR +\{ans_rule(15)\} +$PAR + + +END_TEXT + +ANS($ans -> cmp()); + +################################################### +BEGIN_SOLUTION + +As we have large sample size, it would make sense to use the normal approximation of the binomial model if our "pass / fail" condition hold. Since \($b\cdot$sucdec >10\) and \($b\cdot$faildec >10\) we can can use our normal model approximation. +$PAR +With our normal model we have mean \(\mu=np\) and \(\sigma = \sqrt{npq}\). Thus, \(\mu=$mu\) and \(\sigma = $sigma\). +$PAR +The probability that less than \($c$PERCENT\) of people will vote for the incumbent, in a sample of \($b\), is the same saying less than \($c1\) people will vote for the incumbent. This allows us to find \(z=\frac{$c1-$mu}{$sigma} = $z\). +$PAR +Using our normal curve, seen below, with \(z<$z\). +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +We find that the probability is \($ans1\) + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-14.pg b/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-14.pg new file mode 100644 index 0000000000..a8f245d932 --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-14.pg @@ -0,0 +1,105 @@ +## DESCRIPTION +## Statistics: Probability +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'probability') +## naw tagged this problem. + +## DBchapter('Continuous Probability Distributions') +## DBsection() +## Date('6/30/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"PGnauStats.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserOneOf.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a = random(62,64,0.1); +$b = random(400,600,10); +$c = random(58,60,0.1); + +$sucdec = ($a/100); +$faildec = (1-$sucdec); + +$sigma = Real(sqrt($a/100*(1-$a/100)*$b)); +$mu = $a/100*$b; + +$c1 = $c/100*$b; +$z = ($c1 - $mu)/$sigma; +$z2 = ($c1 - 0.5- $mu)/$sigma; + +$d = ceil($b*$c/100); +$exact = 0; +for my $i (0..($d-1)){ +$multiplier = 1; +for my $j (1..$i) { + $multiplier = $multiplier * ($b-$i+$j)/$j; +} + $exact= $exact+ $multiplier*(($a/100)**$i)*((1-$a/100)**($b-$i)); +} + + +$diagram = DrawNormalDist($z, -99, $z, "", outside=>1); + +$ans1 = normal_prob('-infty', $z, mean=>0, deviation=>1); +$ans2 = normal_prob('-infty', $z2, mean=>0, deviation=>1); + +Context("Percent"); +$ans = OneOf(Percent($exact),Percent($ans1),Percent($ans2)); + +BEGIN_TEXT +$PAR +A manufacturer of aspirin claims that the proportion of +headache sufferers who get relief with just two aspirins +is \($a$PERCENT\). What is the probability that in a random +sample of \($b\) headache sufferers, less than \($c$PERCENT\) obtain relief? +$PAR +\{ans_rule(15)\} +$PAR + +END_TEXT + +ANS($ans->cmp()); + +################################################### +BEGIN_SOLUTION + +As we have large sample size, it would make sense to use the normal approximation of the binomial model if our "pass / fail" condition hold. Since \($b\cdot$sucdec >10\) and \($b\cdot$faildec >10\) we can can use our normal model approximation. +$PAR +With our normal model we have mean \(\mu=np\) and \(\sigma = \sqrt{npq}\). Thus, \(\mu=$mu\) and \(\sigma = $sigma\). +$PAR +The probability that less than \($c$PERCENT\) of surfers will have relief, in a sample of \($b\), is the same saying less than \($c1\) people will receive relief. This allows us to find \(z=\frac{$c1-$mu}{$sigma} = $z\). +$PAR +Using our normal curve, seen below, with \(z<$z\). +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +We find that the probability is \($ans1\) + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-15.pg b/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-15.pg new file mode 100644 index 0000000000..249c1e3218 --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-15.pg @@ -0,0 +1,91 @@ +## DESCRIPTION +## Statistics: Probability +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'probability') +## naw tagged this problem. + +## DBchapter('Continuous Probability Distributions') +## DBsection() +## Date('6/30/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a = random(76,81,1); +$b = random(30,40,2); +$c = random(70,73,1); +$a1 = .01*$a; +$c1 = .01*$c; +$a2 = 1-$a1; +$p = ((($a1*$a2)/$b))**(0.5); +$z = ($c1-$a1)/$p; + + +$d = ceil($b*$c/100); +$lessthan = ($d-1); +$exact = 0; +for my $i (0..($d-1)){ +$multiplier = 1; +for my $j (1..$i) { + $multiplier = $multiplier * ($b-$i+$j)/$j; +} + $exact= $exact+ $multiplier*(($a/100)**$i)*((1-$a/100)**($b-$i)); +} + +$exactreal = Real($exact); + +BEGIN_TEXT +$PAR +A psychologist believes that \($a$PERCENT\) of male drivers +when lost continue to drive, hoping to find the location +they seek rather than ask directions. To examine this +belief, he took a random sample of \($b\) male drivers and +asked each what they did when lost. If the belief is +true, determine the probability that less than \($c$PERCENT\) +said they continue driving. +$PAR +\{ans_rule(15)\} +$PAR + +END_TEXT + +Context("Percent"); +ANS(Percent($exact)->cmp); + +################################################### +BEGIN_SOLUTION + +The normal model is likely not appropriate here as the sample is only \($b\). Since we want to determine the probability that less than \($c$PERCENT\) continue to drive, this is the same as less than \($c1 \cdot $b=$d\) people continue to drive. As we are interested in the situation "less than," we will not include \($d\) in our calculation. +$PAR +In effect, this means we need to compute \(\text{P}(X\leq $lessthan) = \text{P}(X=0)+\text{P}(X=1)+...+...+\text{P}(X=$lessthan)=$exactreal\) + + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-16.pg b/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-16.pg new file mode 100644 index 0000000000..a923bfa155 --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/stat212-HW07-16.pg @@ -0,0 +1,97 @@ +## DESCRIPTION +## Statistics: Probability +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'probability') +## naw tagged this problem. + +## DBchapter('Continuous Probability Distributions') +## DBsection() +## Date('6/30/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"MathObjects.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"PGnauStats.pl", +"contextPercent.pl", +"parserOneOf.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$n = random(600,800,10); +$mu = ($n*0.25); +$sigma = Real(sqrt(0.1875*$n)); +$c = floor(0.25*$n + non_zero_random(-2,2,0.1)*$sigma); +$z = Real(($c-.5-$n/4)/$sigma); +$z2 = ($c-$n/4)/$sigma; + + +$exact = 0; +for my $i (0..($c-1)){ +$multiplier = 1; +for my $j (1..$i) { + $multiplier = $multiplier * ($n-$i+$j)/$j; +} + $exact= $exact+ $multiplier*((1/4)**$i)*((3/4)**($n-$i)); +} +$exact = 1- $exact; + +$diagram = DrawNormalDist(99, $z2, "", $z2, outside=>1); + +BEGIN_TEXT +$PAR +An accounting professor claims that no more than one +quarter of undergraduate business students will major +in accounting. What is the probability that in a random +sample of \($n\) undergraduate business students, \($c\) or more +will major in accounting? +$PAR +\{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +$ans1 = Percent(normal_prob($z, 'infty', mean=>0, deviation=>1)); +$ans2 = Percent($exact); +$ans3 = Percent(normal_prob($z2, 'infty', mean=>0, deviation=>1)); +$ans = OneOf($ans1,$ans2,$ans3); +ANS($ans->cmp()); + +################################################### +BEGIN_SOLUTION + +An accounting professor claims that no more than one quarter, which is \(25$PERCENT\), of undergraduate business students will major in accounting. This means we can use \(p=0.25\) and \(q=0.75\). As we have a large sample size, it would make sense to use the normal approximation of the binomial model if our "pass / fail" condition holds. Since \($n\cdot 0.25 >10\) and \($n\cdot 0.75 >10\) we can use our normal model approximation. +$PAR +We have mean \(\mu=np\) and \(\sigma = \sqrt{npq}\). Thus, \(\mu=$mu\) and \(\sigma = $sigma\). +$PAR +We wish to find the probability of more than \($c\) students majoring in accounting. This allows us to \(z=\frac{$c-$mu}{$sigma} = $z2\). +$PAR +Using our normal curve, seen below, with \(z>$z2\). +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +We find that the probability is \($ans3\) + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_1.pg b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_1.pg new file mode 100644 index 0000000000..14836637bb --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_1.pg @@ -0,0 +1,69 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem', 'Normal', 'Approximate') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(45,55,1); +@quest = ("at least", "exactly", "at most", "more than", "less than"); +$tag = random(0,4,1); + +$n1 = $n-0.5; +$n2 = $n+0.5; + +$ans[0] = normal_prob($n1, 'infty', mean=>50, deviation=>5); +$ans[1] = normal_prob($n1, $n2, mean=>50, deviation=>5); +$ans[2] = normal_prob('-infty', $n2, mean=>50, deviation=>5); +$ans[3] = normal_prob($n2, 'infty', mean=>50, deviation=>5); +$ans[4] = normal_prob('-infty', $n1, mean=>50, deviation=>5); + +BEGIN_TEXT + +Use normal approximation with the continuity correction to estimate the probability of getting $quest[$tag] \($n\) +girls in \(100\) births. +Assume that boys and girls are equally likely. $BR + +\{ans_rule(10)\} + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3,tolType=>relative,tolerance=>0.001,trimTrailingZeros=>1); +ANS(Percent($ans[$tag])->cmp); + +################################################### +BEGIN_SOLUTION + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_2.pg b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_2.pg new file mode 100644 index 0000000000..1523f3b413 --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_2.pg @@ -0,0 +1,65 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem', 'Normal', 'Approximate') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +"PGauxiliaryFunctions.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(50,80,2); +$p = random(55,65,5); + +$mean = $n/2; +$dev = sqrt($n)/2; +$a = ceil($n * $p / 100) -0.5; + +$ans = normal_prob($a,'infty', mean=>$mean, deviation=>$dev); + +BEGIN_TEXT + +Use normal approximation with the continuity correction to estimate the probability of passing a true/false test of \($n\) +questions if the minimum passing grade is \($p$PERCENT\) and all responses are random guesses. $BR + +\{ans_rule(10)\} + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3,tolType=>relative,tolerance=>0.001,trimTrailingZeros=>1); +ANS(Percent($ans)->cmp); + +################################################### +BEGIN_SOLUTION + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_3.pg b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_3.pg new file mode 100644 index 0000000000..5a52cab9b5 --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_3.pg @@ -0,0 +1,68 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +do { +$b = random(150,400,1); +$p = random(80,90,1); +$mean = $b * $p / 100; +$dev = sqrt ($b * $p / 100 * (100 - $p) / 100); +$z = random(1.7, 3.1, 0.01); +$s = 10*int(($z * $dev + $mean)/10+1); } until ($b - $s >= 8); + +$ans = normal_prob($s+0.5, 'infty', mean=>$mean, deviation=>$dev); + +BEGIN_TEXT + +An airline company is considering a new policy of booking as many as \($b\) persons on an +airplane that can seat only \($s\). +(Past studies have revealed that only \($p$PERCENT\) of the booked passengers actually arrive for the flight.) +Estimate the probability that if the company books \($b\) persons, not enough seats will be available. Use the Normal approximation to the binomial distribution with the continuity correction, even if you know how to find the exact answer.$BR + +\{ans_rule(10)\} + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>8,tolType=>relative,tolerance=>0.001,trimTrailingZeros=>1); +ANS(Percent($ans)->cmp); + + +################################################### +BEGIN_SOLUTION + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_4.pg b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_4.pg new file mode 100644 index 0000000000..30d46fc9c8 --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_12_4.pg @@ -0,0 +1,76 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(20,30,1); +@answers = ('a, b, c, and d', 'a, b, c, d, and e', 'a, b, c, d, e, and f'); +$tag = random(0,2,1); +$mean = $n/(4+$tag); +$low = int($mean + 4); +$high = int($mean + 8); +$corr = random($low, $high, 1); +$corr1 = $corr -0.5; + +$dev = sqrt( $n / (4+$tag) * (3+$tag) / (4+$tag)); + + +$prob = 0; +for my $i ($corr..$n) { + $prob = $prob + fact($n)/fact($i)/fact($n-$i)*(1/(4+$tag)**$i)*((3+$tag)/(4+$tag))**($n-$i); +} + +BEGIN_TEXT + +A multiple-choice test consists of \($n\) questions with possible answers of $answers[$tag]. +Estimate the probability that with random guessing, the number of correct answers +is at least \($corr\).$BR + +\{ans_rule(10)\} + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3, +tolType=>relative, +tolerance=>0.001, +trimTrailingZeros=>1); + +ANS(Percent($prob)->cmp); + +################################################### +BEGIN_SOLUTION + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_1.pg b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_1.pg new file mode 100644 index 0000000000..da268d7c38 --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_1.pg @@ -0,0 +1,106 @@ +##DESCRIPTION +##KEYWORDS('probability','binomial random variable', 'probability dist') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('3.4') +## Problem1('28') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +for ($i=0; $i<4; $i++) { + $n[$i] = random(3,6,1); +} + +for ($i=0; $i<4; $i++) { + $x[$i] = random(0,$n[$i],1); +} + +for ($i=0; $i<4; $i++) { + $p[$i] = random(.1,.9,.1); +} + +for ($i=0; $i<4; $i++){ + $comb[$i] = fact ($n[$i])/(fact ($x[$i])*fact ($n[$i]-$x[$i])); + $other[$i] = $p[$i]**($x[$i])*(1-$p[$i])**($n[$i]-$x[$i]); + $prob[$i] = $comb[$i]*$other[$i]; + $fail[$i] = $n[$i]-$x[$i]; + $q[$i] = (1-$p[$i]); +} + + +BEGIN_TEXT +If \(X\) is a binomial random variable, compute \(P(X=k)\) for each of the following cases: $PAR +(a) \( \) \( n = $n[0], k = $x[0], p = $p[0]\) +$BR +\(P(X=k) =\) \{ans_rule(10)\} $PAR + +(b) \( \) \( n = $n[1], k = $x[1], p = $p[1]\) +$BR +\(P(X=k) =\) \{ans_rule(10)\} $PAR + +(c) \( \) \( n = $n[2], k = $x[2], p = $p[2]\) +$BR +\(P(X=k) =\) \{ans_rule(10)\} $PAR + +(d) \( \) \( n = $n[3], k = $x[3], p = $p[3]\) +$BR +\(P(X=k) =\) \{ans_rule(10)\} +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3,tolerance=>0.00005,trimTrailingZeros=>1); +ANS(Percent($prob[0])->cmp); +ANS(Percent($prob[1])->cmp); +ANS(Percent($prob[2])->cmp); +ANS(Percent($prob[3])->cmp); + +################################################### +BEGIN_SOLUTION +Note that \(C_{n,k}\) stands for N choose K. +$PAR +(a) With \(n = $n[0], k = $x[0], p = $p[0]\), we find, +$PAR +\(\text{P}(X=$x[0])=C_{$n[0],$x[0]} \cdot ($p[0])^$x[0] \cdot ($q[0])^$fail[0] = $prob[0]\) +$PAR +(b) With \(n = $n[1], k = $x[1], p = $p[1]\), we find, +$PAR +\(\text{P}(X=$x[1])=C_{$n[1],$x[1]} \cdot ($p[1])^$x[1] \cdot ($q[1])^$fail[1] = $prob[1]\) +$PAR +(c) With \(n = $n[2], k = $x[2], p = $p[2]\), we find, +$PAR +\(\text{P}(X=$x[2])=C_{$n[2],$x[2]} \cdot ($p[2])^$x[2] \cdot ($q[2])^$fail[2] = $prob[2]\) +$PAR +(d) With \(n = $n[3], k = $x[3], p = $p[3]\), we find, +$PAR +\(\text{P}(X=$x[3])=C_{$n[3],$x[3]} \cdot ($p[3])^$x[3] \cdot ($q[3])^$fail[3] = $prob[3]\) +$PAR + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_3.pg b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_3.pg new file mode 100644 index 0000000000..39f5f87e29 --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_3.pg @@ -0,0 +1,134 @@ +##DESCRIPTION +##KEYWORDS('probability','binomial random variable', 'probability dist', 'mean', 'standard +##deviation') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('3.4') +## Problem1('26') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +for ($i=0; $i<4; $i++) { + $n[$i] = random(3,6,1); +} + +for ($i=0; $i<4; $i++) { + $p[$i] = random(.1,.9,.1); +} + +$mean0 = $n[0]*$p[0]; +$mean1 = $n[1]*$p[1]; +$mean2 = $n[2]*$p[2]; +$mean3 = $n[3]*$p[3]; + +$var0 = Real($n[0]*$p[0]*(1-$p[0])); +$var1 = Real($n[1]*$p[1]*(1-$p[1])); +$var2 = Real($n[2]*$p[2]*(1-$p[2])); +$var3 = Real($n[3]*$p[3]*(1-$p[3])); + +$sd0 = Real(sqrt($var0)); +$sd1 = Real(sqrt($var1)); +$sd2 = Real(sqrt($var2)); +$sd3 = Real(sqrt($var3)); + +BEGIN_TEXT +If \(X\) is a binomial random variable, compute the mean, the standard deviation, and the +variance for each of the following cases: $PAR +(a) \( n = $n[0], p = $p[0]\) +$BR +\(\mu_X = \) \{ans_rule(10)\} $BR +\(\sigma_X^2 = \) \{ans_rule(10)\} $BR +\(\sigma_X =\) \{ans_rule(10)\}$PAR +(b) \( n = $n[1], p = $p[1]\) +$BR +\(\mu_X = \) \{ans_rule(10)\} $BR +\(\sigma_X^2 = \) \{ans_rule(10)\} $BR +\(\sigma_X = \) \{ans_rule(10)\} $PAR +(c) \( n = $n[2], p = $p[2]\) +$BR +\(\mu_X = \) \{ans_rule(10)\} $BR +\(\sigma_X^2 = \) \{ans_rule(10)\} $BR +\(\sigma_X = \) \{ans_rule(10)\} $PAR +(d) \( n = $n[3], p = $p[3]\) +$BR +\(\mu_X = \) \{ans_rule(10)\} $BR +\(\sigma_X^2 = \) \{ans_rule(10)\} $BR +\(\sigma_X = \) \{ans_rule(10)\} +END_TEXT +Context("Numeric"); + +ANS(Real($mean0)->cmp); +ANS(Real($var0)->cmp); +ANS(Real($sd0)->cmp); + +ANS(Real($mean1)->cmp); +ANS(Real($var1)->cmp); +ANS(Real($sd1)->cmp); + +ANS(Real($mean2)->cmp); +ANS(Real($var2)->cmp); +ANS(Real($sd2)->cmp); + +ANS(Real($mean3)->cmp); +ANS(Real($var3)->cmp); +ANS(Real($sd3)->cmp); + +################################################### +BEGIN_SOLUTION +Note that for all questions, we can apply \(\mu_X=np\) and \(\sigma_X = \sqrt{npq}\). Additionally, \(\operatorname{VAR}(X) = (\sigma_X)^2\). +$PAR +(a) \(\mu_X = $n[0]\cdot $p[0]=$mean0\) +$PAR +\(\sigma_X = \sqrt{$n[0]*$p[0]*(1-$p[0])} = $sd0\) +$PAR +\((\sigma_X)^2 = ($sd0)^2 = $var0\) +$PAR +(b) \(\mu_X = $n[1]\cdot $p[1]=$mean1\) +$PAR +\(\sigma_X = \sqrt{$n[1]*$p[1]*(1-$p[1])} = $sd1\) +$PAR +\((\sigma_X)^2 = ($sd1)^2 = $var1\) +$PAR +(c) \(\mu_X = $n[2]\cdot $p[2]=$mean2\) +$PAR +\(\sigma_X = \sqrt{$n[2]*$p[2]*(1-$p[2])} = $sd2\) +$PAR +\((\sigma_X)^2 = ($sd2)^2 = $var2\) +$PAR$PAR +(d) \(\mu_X = $n[3]\cdot $p[3]=$mean3\) +$PAR +\(\sigma_X = \sqrt{$n[3]*$p[3]*(1-$p[3])} = $sd3\) +$PAR +\((\sigma_X)^2 = ($sd3)^2 = $var3\) +$PAR +END_SOLUTION +################################################### + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_4.pg b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_4.pg new file mode 100644 index 0000000000..b145298cf7 --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_4.pg @@ -0,0 +1,76 @@ +## DESCRIPTION +## Apply the Binomial Distribution +## ENDDESCRIPTION + +## KEYWORDS('Binomial Distribution') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl" + +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(10,20,10); +$a = random(4,6,1); +$p = random(5*floor(100/$a/5)+15,5*floor(100/$a/5)+20,5); +$pperc = ($p/100); +$suc = (1/$a); + +$must_guess = ceil($n * $p / 100); +$prob = 0; +for ($i=$must_guess; $i<$n+1; $i++) { + $prob = $prob + fact($n)/fact($i)/fact($n-$i)/($a**$i)*((($a-1)/$a)**($n-$i)); +} +$mgplus = ($must_guess+1); +$result = Real($prob); + +BEGIN_TEXT + +A quiz consists of \($n\) multiple-choice questions, each with \($a\) possible answers. +For someone who makes random guesses for all of the answers, find the probability of passing +if the minimum passing grade is \($p$PERCENT\). $BR +\{ans_rule(15)\}$BR + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3,tolType=>relative,tolerance=>0.001,trimTrailingZeros=>1); + +ANS(Percent($prob)->cmp); + +################################################### +BEGIN_SOLUTION + +Our sample size is too small to use the normal approximation. If the minimum passing grade is \($p$PERCENT\), then one must have at least \($p\cdot$pperc=$must_guess\) answers correct out of \($n\) questions. With \($a\) choices per question, the probability of success is \($suc\). +$PAR +This leaves us to find \(\text{P}(X\geq$must_guess)\). +$PAR +\(\text{P}(X\geq$must_guess) = \text{P}(X=$must_guess) + \text{P}(X=$mgplus)+...+...+\text{P}(X=$n)=$result\). + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_5.pg b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_5.pg new file mode 100644 index 0000000000..9798289715 --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_5.pg @@ -0,0 +1,113 @@ +##DESCRIPTION +##KEYWORDS('probability','binomial random variable', 'probability dist') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('3.4') +## Problem1('32') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +for ($i=0; $i<4; $i++) { + $n[$i] = random(3,9,1); + $p = $n[$i]-1; + $x[$i] = random(1,$p,1); + $p[$i] = random(.1,.9,.1); +} + +for ($i=0; $i<4; $i++){ + for ($j=0; $j<($n[$i]+1); $j++) { + $comb[$i][$j] = fact ($n[$i])/(fact ($j)*fact ($n[$i]-$j)); + $other[$i][$j] = $p[$i]**($j)*(1-$p[$i])**($n[$i]-$j); + $prob[$i][$j] = $comb[$i][$j]*$other[$i][$j]; +} +} + +$sum0 = 0; +for ($j=0; $j<($x[0]+1); $j+=1){ + $sum0 = $sum0+$prob[0][$j]; +} + +$sum1 = 0; +for ($j=($x[1]+1); $j<($n[1]+1); $j+=1){ + $sum1 = $sum1+$prob[1][$j]; +} + +$sum2 = 0; +for ($j=0; $j<$x[2]; $j+=1){ + $sum2 = $sum2+$prob[2][$j]; +} + +$sum3 = 0; +for ($j=$x[3]; $j<($n[3]+1); $j+=1){ + $sum3 = $sum3+$prob[3][$j]; +} + + +BEGIN_TEXT +If \(X\) is a binomial random variable, compute each of the following: $PAR +(a) \( n = $n[0] , p = $p[0] \) $BR +$BR +\( P(X\leq $x[0]) = \) \{ans_rule(10)\} $PAR +(b) \( n = $n[1] , p = $p[1] \) $BR +$BR +\( P(X> $x[1]) = \) \{ans_rule(10)\} $PAR +(c) \( n = $n[2] , p = $p[2] \) $BR +$BR +\( P(X< $x[2]) = \) \{ans_rule(10)\} $PAR +(d) \( n = $n[3] , p = $p[3] \) $BR +$BR + \( P(X\geq $x[3]) = \) \{ans_rule(10)\} +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3,tolType=>relative,tolerance=>0.001,trimTrailingZeros=>1); +ANS(Percent($sum0)->cmp); +ANS(Percent($sum1)->cmp); +ANS(Percent($sum2)->cmp); +ANS(Percent($sum3)->cmp); + +################################################### +BEGIN_SOLUTION +All probabilities can be found using Technology. Note that with MS Excel or a TI calculator, +$PAR + 1. Any question of the form, \(\text{P}(Xk)\) or \(\text{P}(X\geq k)\) will use \(n\) as the ''upper'' value. +$PAR +(a) \( P(X\leq $x[0]) = $sum0\) +$PAR +(b) \( P(X > $x[1]) = $sum1\) +$PAR +(c) \( P(X < $x[2]) = $sum2\) +$PAR +(d) \( P(X\geq $x[3]) = $sum3\) +$PAR +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_6.pg b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_6.pg new file mode 100644 index 0000000000..8347ce1a48 --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_6.pg @@ -0,0 +1,85 @@ +## DESCRIPTION +## Apply the Binomial Distribution +## ENDDESCRIPTION + +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/3/2002') +## TitleText1('Mathematical Statistics') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## EditionText1('6') +## Section1('3.4') +## Problem1('40') +## KEYWORDS('Binomial Distribution', 'Mean', 'Standard Deviation','probability','statistics','binomial') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(1100,1400,10); +$mean = $n * 0.82; +$dev = Real(sqrt($n*0.82*0.18)); +$low = int($mean - 4*$dev); +$high = int($mean + 4*$dev); +$s = random($low,$high,1); +$z = Real(($s-$mean)/$dev); + +if ($s < $mean - 2*$dev ) { $ans = 'low';} +elsif ($s > $mean + 2*$dev ) { $ans = 'high';} +else { $ans = 'neither'; } + +$popup = PopUp(['?','low','high','neither'],$ans); + +BEGIN_TEXT +The Census Bureau reports that \(82$PERCENT\) of Americans over the age of \(25\) are high school graduates. +A survey of randomly selected residents of certain county included \($n\) who were over the age of \(25\), +and \($s\) of them were high school graduates. $BR + +(a) Find the mean and standard deviation for the total number of high school graduates in random groups of \($n\) Americans who are over the age of \(25\). $BR + +Mean = \{ans_rule(15)\} $BR + +Standard deviation = \{ans_rule(15)\} $BR + +(b) Is that county result of \($s\) unusually high, or low, or neither? \{$popup->menu\} + + +END_TEXT + +ANS(Real($mean)->cmp); +ANS(Real($dev)->cmp); +ANS($popup->cmp); + +################################################### +BEGIN_SOLUTION + +For the binomial model we have mean \(\mu=np\) and standard deviation \(\sigma = \sqrt{npq}\). Thus, +$PAR +(a) \(\mu=$mean\) +$PAR +(b) \(\sigma = $dev\) +$PAR +(c) To decide if the county result of \($s\) is unusually high, low, or neither, we need to find a \(z\)-score. This assumes we should be able to use a normal model. Thus \(z=\frac{$s-$mean}{$dev}=$z\) +$PAR +Generally we think of any \(z<-3\) to be unusually low and \(z>3\) to be unusually high. In this case the result is "$ans." + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_8.pg b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_8.pg new file mode 100644 index 0000000000..a14e8b6c3f --- /dev/null +++ b/Contrib/PCC/Statistics/BinomialDistribution/ur_pb_8_8.pg @@ -0,0 +1,74 @@ +##DESCRIPTION +##KEYWORDS('probability', 'binomial distribution') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('3.4') +## Problem1('27') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(20,30,1); +$k = random(int(.7*$n), int(.9*$n),1); +$kplus = ($k+1); + +$ans = 0; +for ($i = $k; $i<($n+1); $i++){ + $ans = $ans + fact($n)/fact($i)/fact($n - $i)/2**$n; +} + +$ansdec = Real($ans/100); +BEGIN_TEXT + +A man claims to have extrasensory perception. As a test, a fair coin is flipped \($n\) times, and the man is asked to predict the outcome in +advance. He gets \($k\) out of \($n\) correct. What is the probability that he would have done at least this well if he had no ESP? Do not try to use Normal approximation.$BR + +\{ans_rule(20)\} + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3, +tolType=>relative, +tolerance=>0.001, +trimTrailingZeros=>1); + +ANS(Percent($ans)->cmp); + +################################################### +BEGIN_SOLUTION + +We cannot use the normal approximation and need to find the probability this person will predict the coin toss correctly at least \($k\) out of \($n\) times. Thus, we need to find, +$PAR +\(\text{P}(X\geq$k) = \text{P}(X=$k)+\text{P}(X=$kplus)+...+...+\text{P}(X=$n)=$ansdec\) + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_03_SamplingDistns.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_03_SamplingDistns.pg new file mode 100644 index 0000000000..f5c0691c63 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_03_SamplingDistns.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, E Cabrera') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The Bureau of Labor Statistics announces that last month it interviewed all members of the labor force in a sample of 60000 households; $BBOLD 4.9$PERCENT $EBOLD of the people interviewed were unemployed. The boldface number is a ", + "statistic. "); + $mc[0]->extra("parameter.", + "sampling distribution. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A study of voting chose 663 registered voters at random shortly after an election. Of these, 72$PERCENT said they had voted in the election. Election records show that only $BBOLD 56$PERCENT $EBOLD of registered voters voted in the election. The boldface number is a ", + "parameter. "); + $mc[1]->extra("statistic. ", + "sampling distribution." ); + $mc[1]->makeLast("None of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Annual returns on the more than 5000 common stocks available to investors vary a lot. In a recent year, the mean return was 8.3$PERCENT and the standard deviation of return was 28.5$PERCENT. The $BITALIC law of large numbers $EITALIC says that ", + "as you invest in more and more stocks chosen at random that year, your average return on these stocks gets ever closer to 8.3$PERCENT. "); + $mc[2]->extra("you can get an average return higher than the mean 8.3$PERCENT by investing in a large number of stocks. ", + "if you invest in a large number of stocks chosen at random, your average return will have approximately a Normal distribution. "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("The number of hours a light bulb burns before failing varies from bulb to bulb. The distribution of burnout times is skewed to the right. The $BITALIC central limit theorem $EITALIC says that ", + "the average burnout time of a large number of bulbs has a distribution that is close to Normal. "); + $mc[3]->extra("the average burnout time of a large number of bulbs has a distribution of the same shape (strongly skewed) as the distribution for individual bulbs. ", + "as we look at more and more bulbs, their average burnout time gets ever closer to the mean for all bulbs of this type. " ); + $mc[3]->makeLast("None of the above. "); + +################################################# +# Main + +BEGIN_TEXT +For the following problems, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_05_SamplingDistns.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_05_SamplingDistns.pg new file mode 100644 index 0000000000..affd2c6490 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_05_SamplingDistns.pg @@ -0,0 +1,81 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The sampling distribution of a statistic is ", + "the distribution of values taken by a statistic in all possible samples of the same size from the same population. "); + $mc[0]->extra("the probability that we obtain the statistic in repeated random samples. ", + "the mechanism that determines whether or not randomization was effective. ", + "the extent to which the sample results differ systematically from the truth. "); +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A statistic is said to be unbiased if ","the mean of its sampling distribution is equal to the true + value of the parameter being estimated. "); + $mc[1]->extra("the survey used to obtain the statistic was designed so as to avoid even the hint of racial or sexual prejudice. ", + "both the person who calculated the statistic and the subjects whose responses make up the statistic were truthful. ", + "it is used for only honest purposes. "); +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Sampling variation is caused by ","random selection of a sample. "); + $mc[2]->extra("changes in a population parameter from sample to sample. ", + "systematic errors in our procedure. ", + "changes in a population parameter that cannot be predicted. "); + +###################################### +# Main text + +BEGIN_TEXT +For the following problems, select the best response: + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_06_SamplingDistns.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_06_SamplingDistns.pg new file mode 100644 index 0000000000..67a101ebe4 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_06_SamplingDistns.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch11SamplingDistributions/11Stats_06_SamplingDistns.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch11SamplingDistributions/11Stats_06_SamplingDistns.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_07_SamplingDistns.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_07_SamplingDistns.pg new file mode 100644 index 0000000000..dd2738050d --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_07_SamplingDistns.pg @@ -0,0 +1,89 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$mu = random(0.7, 0.9, 0.1); +$sigma = random(0.15,0.2,0.01); + +$n = ($sigma / 0.01) ** 2; + +@a = ("larger", "smaller"); +@answer = ("smaller", "larger"); +$choose = random(0,1,1); +$ans2 = $answer[$choose]; + +$popup = PopUp([ "?", "smaller", "larger", "the same"], $ans2); + +###################################### +# Main text + +BEGIN_TEXT +The level of nitrogen oxides (NOX) in the exhaust of a particular car model varies with mean $mu +grams per mile and standard deviation $sigma grams per mile . + +$PAR +(a) What sample size is needed so that the standard deviation of the sampling +distribution is 0.01 grams per mile ? +$BR +\{ans_rule(10)\} + +$PAR +(b) If a $a[$choose] sample is considered, the standard deviation for \( \bar x\) +would be \{$popup->menu\} +$BR +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + + +$ans_a = Compute($n)->with(tolType=>'absolute', tolerance=>'0.001'); +ANS($ans_a->cmp(showTypeWarnings=>0)->withPostFilter(AnswerHints( +# sub { +# my ($correct,$student,$anshash) = @_; +# return abs($student-$correct) < .4; +# } => ["Your answer should be a number."], + sub { + my ($correct,$student,$anshash) = @_; + return if ($student =~ /a..z,A..Z/); + return abs($student-$correct) < .4; + } => ["Your answer is close. Use more accuracy in your calculation."]))); + +ANS($popup->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_08_SamplingDistns.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_08_SamplingDistns.pg new file mode 100644 index 0000000000..e995d081cf --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_08_SamplingDistns.pg @@ -0,0 +1,88 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, E Cabrera') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mean = random(450,600,1); +$sdev = random(100,120,1); + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("Scores on the mathematics part of the SAT exam in a recent year were roughly Normal with mean $mean and standard deviation $sdev. You choose an SRS of 100 students and average their SAT math scores. If you do this many times, with a sample of size 100 each time, the mean of the average scores will get close to ", + $mean); + $mc[0]->extra($mean/100, + $mean/sqrt(100)); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("Scores on the mathematics part of the SAT exam in a recent year were roughly Normal with mean $mean and standard deviation $sdev. You choose an SRS of 100 students and average their SAT math scores. If you do this many times, with a sample of size 100 each time, the standard deviation of the average scores will get close to ", + $sdev/sqrt(100)); + $mc[1]->extra($sdev, + $sdev/100); + $mc[1]->makeLast("None of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("A newborn baby has extremely low birth weight (ELBW) if it weighs less than 1000 grams. A study of the health of such children in later years examined a random sample of 219 children. Their mean weight at birth was \( \bar {x} = \) 810 grams. This sample mean is an unbiased estimator of the mean weight \( \mu \) in the population of all ELBW babies. This means that ", "the average sample mean \( \bar {x} \), over all possible samples, is equal to \( \mu \)." ); + $mc[2]->extra("the sample mean \( \bar {x} \) is always equal to \( \mu \). ", + "the sample mean \( \bar {x} \) will have a distribution that is close to Normal. "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("The length of human pregnancies from conception to birth varies according to a distribution that is approximately Normal with mean 266 days and standard deviation 16 days. The probability that the average pregnancy length for 6 randomly chosen women exceeds 270 days is about ", + 0.27); + $mc[3]->extra(0.40, + 0.07 ); + $mc[3]->makeLast("None of the above. "); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_10_SamplingDistns.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_10_SamplingDistns.pg new file mode 100644 index 0000000000..05cfbadef1 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_10_SamplingDistns.pg @@ -0,0 +1,131 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGstatisticsmacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$mu = random(530, 560, 0.1); +$sigma = random(25,30,0.1); +$n = random(25,35,5); +$sigmaSD = $sigma / sqrt($n); +$x = int($mu) + random(4,7,1); + +$zscore1 = ($x - $mu) / $sigma; +$pval1 = uprob(abs($zscore1)); + +$zscore2 = ($x - $mu) / $sigmaSD; +$pval2 = uprob(abs($zscore2)); + +###################################### +# Main text + +BEGIN_TEXT +The scores of students on the SAT college entrance examinations at a certain high school had +a normal distribution with mean \( \mu = $mu \) and standard deviation \( \sigma = $sigma \). + +$PAR +(a) What is the probability that a single student randomly chosen from all those taking +the test scores $x or higher? +$BR +\{ans_rule(10)\} + +$BR $BR +For parts (b) through (d), consider a simple random sample (SRS) of $n students who took the test. + +$PAR +(b) What are the mean and standard deviation of the sample mean score \( \bar x\), +of $n students? +$BR + The mean of the sampling distribution of \( \bar x \) is: \{ans_rule(10)\} +$BR + The standard deviation of the sampling distribution of \( \bar x \) is: \{ans_rule(10)\} + +$PAR +(c) What z-score corresponds to the mean score \( \bar x\) of $x? +$BR +\{ans_rule(10)\} + +$PAR +(d) What is the probability that the mean score \( \bar x\) of these students is $x or higher? +\{ans_rule(10)\} +$BR +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; +Context("Percent"); +$ans_a = Compute($pval1)->with(tolerance=>0.0005, tolType=> 'absolute'); +ANS(Percent($ans_a)->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .002; + } => ["Your answer is close. Try more accuracy in your calculation."] +))); + +$ans_b1 = Compute($mu)->with(tolerance=>0.001, tolType=> 'absolute'); +ANS($ans_b1->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) > .000001; + } => ["Consider the Central Limit Theorem."] +))); + +$ans_b2 = Compute($sigmaSD)->with(tolerance=>0.001, tolType=> 'absolute'); +ANS($ans_b2->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .005; + } => ["Your answer is close. Try more accuracy in your calculation."] +))); + +$ans_c = Compute($zscore2)->with(tolerance=>0.01, tolType=> 'absolute'); +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .04; + } => ["Your answer is close. Try more accuracy in your calculation."] +))); + +Context("Percent"); +$ans_d = Percent($pval2); +ANS($ans_d->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .002; + } => ["Your answer is close. Try more accuracy in your calculation."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_13_SamplingDistns.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_13_SamplingDistns.pg new file mode 100644 index 0000000000..ed7731c58f --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/11Stats_13_SamplingDistns.pg @@ -0,0 +1,111 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGstatisticsmacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$mu = random(7.7, 8.3, 0.1); +$sigma = random(0.1,0.2,0.01); +@n = ("three", "four", "five"); +$sampleSize = random(3,5,1); +$sigmaSD = $sigma / sqrt($sampleSize); + +#-----Part a-------------------- +$x1 = $mu - random(0.1,0.2,0.01); +$zscore1 = ($x1 - $mu) / $sigmaSD; +$pval1 = uprob(abs($zscore1)); #NOTE: The area is above the zscore +$x2 = $mu + random(0.1,0.2,0.01); +$zscore2 = ($x2 - $mu) / $sigmaSD; +$pval2 = 1 - uprob(abs($zscore2)); +$pval = $pval2 - $pval1; + +#-----Part b-------------------- +$p = random(1,5,1); +$zscore = -1*udistr($p / 100); +$xscore = $mu + $zscore * $sigmaSD; + +###################################### +# Main text + +BEGIN_TEXT +The distribution of actual weights of 8-oz chocolate bars produced by a certain machine is normal +with mean $mu ounces and standard deviation $sigma ounces. + +$PAR +(a) What is the probability that the average weight of an SRS of $n[$sampleSize-3] of these chocolate bars is +between $x1 and $x2 ounces? +$BR +\{ans_rule(10)\} + +$PAR +(b) For a SRS of $n[$sampleSize-3] of these chocolate bars, what is the weight \( L \) such that there is +a $p$PERCENT chance that the average weight is less than \( L \) ounces per bar? +$BR +\{ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; +Context("Percent")->flags->set(tolerance=>0.0011); +$ans_a = Percent($pval); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .005; + } => ["Close!"], + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct*100) < .2; + } => ["Enter the probability, but not in percent form."]))); + +$ans_b = Compute($xscore)->with(tolerance=>0.01, tolType=> 'absolute'); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .03; + } => ["Your answer is close. Try more accuracy in your calculation."], + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$zscore) < .03; + } => ["Enter the cutoff for the average weight of the sample not the z score."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/central_limit_theorem1.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/central_limit_theorem1.pg new file mode 100644 index 0000000000..4cbf6737e3 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/central_limit_theorem1.pg @@ -0,0 +1,43 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Central Limit Theorem') +## KEYWORDS('central limit') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 06/20/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl" + +); + +TEXT(&beginproblem); +$n = random( 50, 100, 1); +$per1 = random( 20, 50, 1 ); +$job = list_random ( 'pave new parking lots', 'build a new math building', ' build a new recreation center', +'build a new football stadium'); + +do{$per2 = random( 4, 100*0.5/sqrt($n)-0.1, .1 ); + $per3 = random(2, 7, .1 ); +} until( $per2 > $per3 ); + +$sd = ( $per2 / 100 ) * ( sqrt( $n ) ); +$ans = ceil( ( ( $sd * 100 ) / $per3 ) ** 2 ) ; + +BEGIN_TEXT + +A survey of $n students found that $per1$PERCENT were in favor of raising tution to $job. +The standard deviation of the sample proprortion is $per2$PERCENT. How large a sample (to the nearest person) would be required to reduce +this standard deviation to $per3$PERCENT? $PAR +\{ans_rule( 15 ) \} +END_TEXT + +ANS( num_cmp( $ans ) ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/central_limit_theorem2.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/central_limit_theorem2.pg new file mode 100644 index 0000000000..4505f6fb65 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/central_limit_theorem2.pg @@ -0,0 +1,45 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Central Limit Theorem') +## KEYWORDS('central limit') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 06/20/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", + +); + +TEXT(&beginproblem); + +$n = random( 50, 100, 1); +$newn = random(2* $n, 300, 1 ); +$per = random( 20, 50, 1 ); +$p1 = $per +non_zero_random(-10,30,5); +$psd = floor(100*sqrt($p1/100*(1-$p1/100)/$n)); +$job = list_random ( 'pave new parking lots', 'build a new math building', ' build a new recreation center', +'build a new football stadium'); + +$ans = $psd * sqrt($n/$newn ); + +BEGIN_TEXT + +A poll of $n students found that $per$PERCENT were in favor of raising tuition to $job. +The standard deviation of this poll is $psd$PERCENT. What would be the standard deviation +if the sample size were increased from $n to $newn? $PAR + \{ans_rule( 15 ) \} + +END_TEXT +Context("Percent"); +ANS( Percent( $ans/100)->cmp ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/di1.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/di1.pg new file mode 100644 index 0000000000..8ba0a0d498 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/di1.pg @@ -0,0 +1,76 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sample Mean') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Sample Mean') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# +$a = random(1,9); +$b = random(3,20); +$s = $a+$b; + +$m = new_multiple_choice(); + +#$m->qa("This is the question - what is $a+$b", "This is the right answer: $s"); +#$m->extra("Wrong 1", "Wrong 2", "Wrong 3"); +#$m->makeLast("Second to last answer", "Last Answer"); +$m ->qa("Although in general you cannot know the sampling distribution of the sample mean exactly, by what distribution can you often approximate it?", +"Normal"); +$m -> extra("Uniform", "J-shaped", "Reverse J-shaped"); + + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +\{ $m->print_q \} +$BR +\{ $m->print_a \} +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# + +ANS(radio_cmp($m->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/di2.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/di2.pg new file mode 100644 index 0000000000..050bda43a3 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/di2.pg @@ -0,0 +1,70 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sample Mean') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Sample Mean') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# +$a = random(1,9); +$b = random(3,20); +$s = $a+$b; + +$m = new_multiple_choice(); + +#$m->qa("This is the question - what is $a+$b", "This is the right answer: $s"); +#$m->extra("Wrong 1", "Wrong 2", "Wrong 3"); +#$m->makeLast("Second to last answer", "Last Answer"); +$m ->qa("What effect does the sample size have on the standard deviation of all possible sample means?", +"The standard deviation gets smaller as the sample size grows."); +$m -> extra("The standard deviation gets larger as the sample size grows.", +"The sample size has no effect on the standard deviation."); + +BEGIN_TEXT +\{ $m->print_q \} +$BR +\{ $m->print_a \} +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# + +ANS(radio_cmp($m->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/di3.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/di3.pg new file mode 100644 index 0000000000..17d119efad --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/di3.pg @@ -0,0 +1,77 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sample Mean') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Sample Mean') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# +$a = random(1,9); +$b = random(3,20); +$s = $a+$b; + +$m = new_multiple_choice(); + +#$m->qa("This is the question - what is $a+$b", "This is the right answer: $s"); +#$m->extra("Wrong 1", "Wrong 2", "Wrong 3"); +#$m->makeLast("Second to last answer", "Last Answer"); +$m ->qa("Explain why increasing the sample size tends to result in a smaller sampling error when a sample mean is used to estimate a population mean.", +"The larger the sample size, the more closely the possible values of \(\bar{x}\) cluster around the mean of \(\bar{x}\)"); +$m -> extra("If the sample size is larger, the possible values of \(\bar{x}\) are farther from the mean of \(\bar{x}\)", +"The above statement is incorrect, the sample size has no effect on the sampling error."); + + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +\{ $m->print_q \} +$BR +\{ $m->print_a \} +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# + +ANS(radio_cmp($m->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/di4.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/di4.pg new file mode 100644 index 0000000000..f892b4b0e5 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/di4.pg @@ -0,0 +1,99 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sample Mean') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Sample Mean') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# +$mu = random(100, 300, 50); +$sigma = random(21, 49, 7); +$stdev = $sigma / 7; + +#$m->qa("This is the question - what is $a+$b", "This is the right answer: $s"); +#$m->extra("Wrong 1", "Wrong 2", "Wrong 3"); +#$m->makeLast("Second to last answer", "Last Answer"); + +$m = new_multiple_choice(); +$m->qa("For part (a) to be true, what assumption did you make about the distribution of the variable under consideration?", +"No assumption was made."); +$m->extra("Normal distribution.", "Uniform distribution."); + +$m1 = new_multiple_choice(); +$m1->qa("Is the statement in part (a) still true if the sample size is 16 instead of 49? Why or why not?", +"No. Because the distribution of the variable under consideration is not specified, a sample size of at least 30 is needed for part (a) to be true." +); +$m1->extra("Yes, the sampling distribution of the sample mean is always normal.", +"No, the sampling distribution of the sample mean is never normal for sample size less than 30."); + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +A variable of a population has a mean of \(\mu = $mu \) and a standard deviation of \(\sigma= $sigma \). +$PAR +a. The sampling distribution of the sample mean for samples of size 49 is approximately normally distributed with mean \{ans_rule(10)\} and standard deviation \{ans_rule(10)\}. + +$PAR +b. +\{ $m->print_q \} +$BR +\{ $m->print_a \} + +$PAR +c. +\{ $m1->print_q \} +$BR +\{ $m1->print_a \} + +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# +Context("Numeric"); +ANS(Real($mu)->cmp); +ANS(Real($stdev)->cmp); +ANS(radio_cmp($m->correct_ans)); +ANS(radio_cmp($m1->correct_ans)); +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/dueck7_3_4.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/dueck7_3_4.pg new file mode 100644 index 0000000000..a4c56a5862 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/dueck7_3_4.pg @@ -0,0 +1,54 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Institution('Rochester') +## KEYWORDS('Probability','Normal Distribution', 'Central Limit Theorem', 'Normal', 'Mean', 'Standard Deviation') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(5,10,1); +$mean = random(12.09,12.15,0.01); +$dev = random(0.09,0.13,0.01); +$newdev = $dev/sqrt($n); +$ans = normal_prob($mean, 'infty', mean=>12, deviation=>$newdev); + +BEGIN_TEXT + +Cans of regular Coke are labeled as containing \(12 \mbox{ oz}\). $BR +Statistics students weighted the content of \($n\) randomly chosen cans, and found the mean +weight to be \($mean \mbox{ oz}\). $BR + +Assume that cans of Coke are filled so that the actual amounts are normally distributed with a mean of \(12.00 \mbox{ oz}\) +and a standard deviation of \($dev \mbox{ oz}\). Find the probability that a sample of \($n\) cans will +have a mean amount of at least \($mean \mbox{ oz}\). $BR + +\{ans_rule(10)\} + +END_TEXT + +Context("Percent")->flags->set(decimalPlaces=>2,tolerance=>0.00005); +ANS(Percent($ans)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-03.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-03.pg new file mode 100644 index 0000000000..b285cd2626 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-03.pg @@ -0,0 +1,128 @@ +## DESCRIPTION +## Binomial Distribution +## ENDDESCRIPTION + +## KEYWORDS('probability', 'binomial distribution') +## CMMK tagged this problem. + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/17/2005') +## Author('Cristina Murray-Krezan') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('If two random samples of sizes \(n_1\) +and \(n_2\) are selected independently from two non-normally +distributed populations, then the sampling distribution +of the sample mean difference \(\bar{X_1} - \bar{X_2}\), +is', + 'approximately normal only if \(n_1\) and \(n_2\) are both larger than 30' +); +$mc[1]->extra( + 'always non-normal', + 'always normal', + 'approximately normal regardless of \(n_1\) and \(n_2\)' +); + + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('Given that \(X\) is a binomial random variable, +the binomial probability \(P(X=x)\) is approximated by +the area under a normal curve between', + '\(x-0.5\) and \(x+0.5\)' +); +$mc[2]->extra( + '\(x-0.5\) and \(0.0\)', + '\(0.0\) and \(x+0.5\)', + '\(1-x\) and \(1+x\)' +); + + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('The central limit theorem states that, if a random +sample of size \(n\) is drawn from a population, then +the sampling distribution of the sample mean \(\bar{X}\):', + 'is approximately normal if \(n > 30\)' +); +$mc[3]->extra( + 'is approximately normal if \(n < 30\)', + 'is approximately normal if the underlying population is normal', + 'has the same variance as the population' +); + + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('The expected value of the sampling distribution of the +sample mean \(\bar{X}\) equals the population +mean \(\mu\): ', + 'for all populations' +); +$mc[4]->extra( + 'when the population is normally distributed', + 'when the population is symmetric', + 'when the population size \(N > 30\)' +); + + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('If all possible samples of size \(n\) are drawn +from an infinite population with a mean of \(\mu\) and a +standard deviation of \(\sigma\), then the standard error of +the sample mean is inversely proportional to', + '\(\sqrt{n}\)' +); +$mc[5]->extra( + '\(n\)', + '\(\sigma\)', + '\(\mu\)' +); + + +$a = random(1,5,1); +$b = random(1,5,1); +while ($a==$b){ + $b=random(1,5,1); +} + + +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-04.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-04.pg new file mode 100644 index 0000000000..61883bb237 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-04.pg @@ -0,0 +1,123 @@ +## DESCRIPTION +## Binomial Distribution +## ENDDESCRIPTION + +## KEYWORDS('probability', 'binomial distribution') +## CMMK tagged this problem. + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/17/2005') +## Author('Cristina Murray-Krezan') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('Given that \(X\) is a binomial random variable, +the binomial probability \(P(X \leq x)\) is approximated +by the area under a normal curve to the left of', + '\(x+0.5\)' +); +$mc[1]->extra( + '\(x\)', + '\(-x\)', + '\(x-5\)' +); + + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('The standard deviation of the sampling distribution +of the sample mean is also called the:', + 'standard error of the mean' +); +$mc[2]->extra( + 'central limit theorem', + 'finite population correction factor', + 'population standard deviation' +); + + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('If a random sample of size \(n\) is drawn from a +normal population, then the sampling distribution of +the sample mean \(\bar{X}\) will be:', + 'normal for all values of \(n\)' +); +$mc[3]->extra( + 'normal only for \(n > 30\)', + 'approximately normal for all values of \(n\)', + 'approximately normal only for \(n > 30\)' +); + + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('If all possible samples of size \(n\) are drawn +from a population, the probability distribution of the +sample mean \(\bar{X}\) is called the: ', + 'sampling distribution of \(\bar{X}\)' +); +$mc[4]->extra( + 'standard error of \(\bar{X}\)', + 'expected value of \(\bar{X}\)', + 'normal distribution' +); + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('Suppose that \(X\) is a binomial random variable with +n = 20 and p = 0.55. Using normal approximation with the continuity +correction, what is (approximately) \(P(X \geq 12)\)?', + '0.4111' +); +$mc[5]->extra( + '0.4143', + '0.3265', + '0.5000' +); + + +$a = random(1,5,1); +$b = random(1,5,1); +while ($a==$b){ + $b=random(1,5,1); +} + + +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-05.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-05.pg new file mode 100644 index 0000000000..18c92293cf --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-05.pg @@ -0,0 +1,112 @@ +## DESCRIPTION +## Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('probability', 'central limit theorem', 'normal', 'sample size', 'deviation') +## CMMK tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('6/17/2005') +## Author('Cristina Murray-Krezan') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +); + + +$shoPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +#True false questions are a special case of a "Select List" +#Make a new select list + +$tf = new_select_list(); + +#$tf now "contains" the select list object. +#Insert some questions and whether or not they are true. + +$tf->rf_print_q(~~&pop_up_list_print_q); + +$tf-> ra_pop_up_list( [No_answer => "?", T=> "True", F => "False"] ); + +$tf -> qa ( # each entry has to end with a comma +"In an effort to identify the true proportion of college freshmen +who are under 18 years of age, a random sample of +500 freshmen was taken. Only fifty of them were under the +age of 18. The value 0.10 would be used as a point +estimate to the true proportion of freshmen under the age of 18.", +"T", + +"The central limit theorem is basic to the concept of +statistical inference because it permits us to draw +conclusions about the population based strictly on sample data, +and without having any knowledge about the +distribution of the underlying population.", +"T", + +"When a great many simple random samples of size \(n\) +are drawn from a population that is normally distributed, the +sampling distribution of the sample means will be normal +regardless of the sample size \(n\).", +"T", + +"Recall the rule of thumb used to indicate when the +normal distribution is a good approximation of the sampling +distribution for the sample proportion \(\hat{p}\). +For the combination \(n=50; p=0.05\), the rule is satisfied.", +"F", + + +"The standard deviation of the sampling distribution of the +sample mean is also called the central limit theorem.", +"F", + +"If all possible samples of size \(n\) are drawn from a +population, the probability distribution of the sample mean +\(\bar{X}\) is referred to as the normal distribution.", +"F", + +"As a general rule, the normal distribution is used to +approximate the sampling distribution of the sample +proportion only if the sample size \(n\) is greater than or equal to 30.", +"F", +); + +#Choose four of the question/answer pairs at random. +$tf ->choose(4); + +#Now print the text using $ml->print_q for the questions and $ml->print_a +#to print the answers. + +BEGIN_TEXT +$PAR + +Select True or False from each pull-down menu, depending on whether +the corresponding statement is true or false. +$BR + +\{ $tf->print_q\} + +$PAR + +END_TEXT + +#Enter the correct answer to be checked against the answers of the students. + +ANS(str_cmp( $tf->ra_correct_ans ) ) ; + +ENDDOCUMENT(); #This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-06.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-06.pg new file mode 100644 index 0000000000..853cb9bb49 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-06.pg @@ -0,0 +1,78 @@ +## DESCRIPTION +## Statistics: Sampling Distributions +## ENDDESCRIPTION + +## CMMK tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Random Variables') +## Date('6/29/2005') +## Institution('UVA') +## Author('Cristina Murray-Krezan') +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('') +## Problem1('') +## KEYWORDS('statistics', 'sampling distributions','normal sampling distributions') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$n = random(10,25,1); +$mu = random(900,1100,10); +$sigma = random(150,250,10); +$a = floor($mu + ($sigma/sqrt($n))*random(1.5,2.3,0.1)); +$b = floor($mu - ($sigma/sqrt($n))*random(1.5,2.3,0.1)); +$c = floor($mu - ($sigma/sqrt($n))*random(0.1,1.4,0.1)); + +BEGIN_TEXT +$PAR +A sample of \(n= $n\) observations is drawn from a normal +population with \(\mu = $mu\) and \(\sigma = $sigma\). Find each of the following: +$PAR +A. \(P(\bar{X} > $a)\) +$PAR +Probability = \{ans_rule(15)\} +$PAR +B. \(P(\bar{X} < $b)\) +$PAR +Probability = \{ans_rule(15)\} +$PAR +C. \(P(\bar{X} > $c)\) +$PAR +Probability = \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +#A. +$ans1 = normal_prob($a,'infty',mean=>$mu, deviation =>$sigma/sqrt($n)); +ANS(Percent($ans1)->cmp); + +#B. +$ans2 = normal_prob('-infty',$b,mean=>$mu, deviation =>$sigma/sqrt($n)); +ANS(Percent($ans2)->cmp); + +#C. +$ans3 = normal_prob($c,'infty',mean=>$mu,deviation=>$sigma/sqrt($n)); +ANS(Percent($ans3)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-08.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-08.pg new file mode 100644 index 0000000000..efc467c8e0 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-08.pg @@ -0,0 +1,80 @@ +## DESCRIPTION +## Statistics: Sampling Distributions +## ENDDESCRIPTION + +## CMMK tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Random Variables') +## Date('6/29/2005') +## Institution('UVA') +## Author('Cristina Murray-Krezan') +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('') +## Problem1('') +## KEYWORDS('statistics', 'sampling distributions','normal sampling distributions') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$mu = random(110,120,1); +$sd = random(4.7,5.7,0.1); +$subnum = random(3,4,1); +$a = $mu + 2; + +BEGIN_TEXT +$PAR +An automatic machine in a manufacturing process is +operating properly if the lengths of an important +subcomponent are normally distributed with a mean +of $mu cm and a standard deviation of $sd cm. +$PAR +A. Find the probability that one selected subcomponent is longer than $a cm. +$PAR +Probability = \{ans_rule(15)\} +$PAR +B. Find the probability that if $subnum subcomponents are +randomly selected, their mean length exceeds $a cm. +$PAR +Probability = \{ans_rule(15)\} +$PAR +C. Find the probability that if $subnum are randomly selected, +all $subnum have lengths that exceed $a cm. +$PAR +Probability = \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +#A. +$ans1 = normal_prob($a,'infty',mean=>$mu, deviation =>$sd); +ANS(Percent($ans1)->cmp); + +#B. +$ans2 = normal_prob($a,'infty',mean=>$mu, deviation =>$sd/sqrt($subnum)); +ANS(Percent($ans2)->cmp); + +#C. +$ans3 = (normal_prob($a,'infty',mean=>$mu, deviation =>$sd))**$subnum; +ANS(Percent($ans3)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-09.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-09.pg new file mode 100644 index 0000000000..7d610bbe2c --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-09.pg @@ -0,0 +1,73 @@ +## DESCRIPTION +## Statistics: Sampling Distributions +## ENDDESCRIPTION + +## CMMK tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Random Variables') +## Date('6/29/2005') +## Institution('UVA') +## Author('Cristina Murray-Krezan') +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('') +## Problem1('') +## KEYWORDS('statistics', 'sampling distributions','normal sampling distributions') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$mu = random(6,14,1); +$sd = random(2,5,1); +$stunum = random(8,12,1); +$a = $mu + random(1,3,1); +$b = ($mu + non_zero_random(-2,2,1))*$stunum; + +BEGIN_TEXT +$PAR +The number of pizzas consumed per month by university +students is normally distributed with a mean of $mu +and a standard deviation of $sd. +$PAR +A. What proportion of students consume more than $a pizzas per month? +$PAR +Proportion= \{ans_rule(15)\} +$PAR +B. What is the probability that in a random sample of size +$stunum, a total of more than $b pizzas are consumed? (Hint: What +is the mean number of pizzas consumed by the sample of $stunum students?) +$PAR +Probability = \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +#A. +$ans1 = normal_prob($a,infty,mean=>$mu, deviation =>$sd); +ANS(Percent($ans1)->cmp); + +#B. +$ans2 = normal_prob(($b/$stunum),infty,mean=>$mu, deviation =>$sd/sqrt($stunum)); +ANS(Percent($ans2)->cmp); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-12.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-12.pg new file mode 100644 index 0000000000..46cc8c525a --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/stat212-HW07-12.pg @@ -0,0 +1,60 @@ +## DESCRIPTION +## Statistics: Sampling Distributions +## ENDDESCRIPTION + +## CMMK tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Random Variables') +## Date('07/01/2005') +## Institution('UVA') +## Author('Cristina Murray-Krezan') +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('') +## Problem1('') +## KEYWORDS('statistics', 'sampling distributions','normal sampling distributions') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$mu = random(4.6,5.0,0.1); +$sigma = random(1.7,2.5,0.2); +$stunum = random(55,65,1); + + +BEGIN_TEXT +$PAR +The time it takes for a statistics professor to mark +a single midterm test is normally distributed with a mean +of $mu minutes and a standard deviation of $sigma +minutes. There are $stunum students in the professor's +class. What is the probability that he needs more than +5 hours to mark all of the midterm tests? +$PAR +Probability = \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +$ans1 = normal_prob(300/$stunum,infty,mean=>$mu, deviation =>$sigma/sqrt($stunum)); +ANS(Percent($ans1)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_1.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_1.pg new file mode 100644 index 0000000000..9a0e3b5345 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_1.pg @@ -0,0 +1,92 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem', 'Normal', 'Mean', 'Standard Deviation') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(3,6,1); +$m = random(50,100,1); +$a = random(108,114,5); +$b = random(172,179,1); + +@quest = ("between \( $a \) lb and \( $b \) lb", + "above \( $b \)", + "below \( $a \)"); + + +$ans1[0] = normal_prob($a, $b, mean=>143, deviation=>29); +$ans1[1] = normal_prob($b, 'infty', mean=>143, deviation=>29); +$ans1[2] = normal_prob('-infty', $a, mean=>143, deviation=>29); + +$ndev = 29/sqrt($n); + +$ans2[0] = normal_prob($a, $b, mean=>143, deviation=>$ndev); +$ans2[1] = normal_prob($b, 'infty', mean=>143, deviation=>$ndev); +$ans2[2] = normal_prob('-infty', $a, mean=>143, deviation=>$ndev); + +$mdev = 29/sqrt($m); + +$ans3[0] = normal_prob($a, $b, mean=>143, deviation=>$mdev); +$ans3[1] = normal_prob($b, 'infty', mean=>143, deviation=>$mdev); +$ans3[2] = normal_prob('-infty', $a, mean=>143, deviation=>$mdev); + +$tag = random(0,2,1); + +BEGIN_TEXT + +Assume that women's weights are normally distributed with a mean given by \(\mu=143 \) lb +and a standard deviation given by \(\sigma=29 \) lb. $BR + +(a) If 1 woman is randomly selected, find the probability that her weight is $quest[$tag] $BR + +\{ans_rule(10)\}$BR + +(b) If \( $n \) women are randomly selected, find the probability that they have a mean weight $quest[$tag] $BR + +\{ans_rule(10)\}$BR + +(c) If \( $m \) women are randomly selected, find the probability that they have a mean weight $quest[$tag] $BR + +\{ans_rule(10)\}$BR + + + +END_TEXT +if ($ans3[$tag]<0.00005) {$ans3[$tag] == 0}; +Context("Percent")->flags->set(decimalPlaces=>2,tolerance=>0.00005); +ANS(Percent($ans1[$tag])->cmp); +ANS(Percent($ans2[$tag])->cmp); +ANS(Percent($ans3[$tag])->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_4.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_4.pg new file mode 100644 index 0000000000..f392541a47 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_4.pg @@ -0,0 +1,57 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$mc = new_multiple_choice(); + +$mc -> qa( "The Central Limit Theorem says", "When \(n>30\), the sampling distribution of + \(\overline{x}\) will be approximately normal."); +$mc -> extra("When \(n<30\), the sampling distribution of \(\overline{x}\) will be approximately normal.", + "When \(n>30\), the original population will have an approximately normal distribution.", + "When \(n<30\), the original population will have an approximately normal distribution."); + +$mc -> makeLast("None of the above"); + + +BEGIN_TEXT + +$PAR +\{ $mc->print_q() \} +\{ $mc->print_a() \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_5.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_5.pg new file mode 100644 index 0000000000..9eb90450f9 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_5.pg @@ -0,0 +1,72 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem', 'Mean', 'Standard Deviation') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$n = random(40,70,10); +$a = random(.1,1,.1); +$x = 157-$a; +$mean1 = random(157+$a,157+5*$a,$a); +$sd = random(1,4,.1); + +$sigma = 3/sqrt($n); +$sigma1 = $sd/sqrt($n); + +$ans1 = normal_prob(-infty, $x, mean=>157, deviation=>$sigma); +$ans2 = normal_prob(-infty, $x, mean=>$mean1, deviation=>$sigma); +$ans3 = normal_prob(-infty, $x, mean=>157, deviation=>$sigma1); + +BEGIN_TEXT +A soft drink bottler purchases glass bottles from a vendor. The bottles are required to have an internal pressure of at least \(150\) pounds per square inch (psi). A prospective bottle vendor claims that its production process yields bottles with a mean internal pressure of \(157\) psi and a standard deviation of \(3\) psi. The bottler strikes an agreement with the vendor that permits the bottler to sample from the production process to verify the claim. The bottler randomly selects \($n\) bottles from the last +\(10000\) produced, measures the internal pressure of each, and finds the mean pressure for the sample to be \($a\) psi below the process mean cited by the vendor. $PAR +(a) Assuming that the vendor is correct in his claim, what is the probability of obtaining a sample mean +this far or farther below the process mean? $BR +\{ans_rule(20)\} $PAR +(b) If the standard deviation were \(3\) psi as claimed, but the mean was \($mean1 \) psi, what is the +probability of obtaining a sample mean of \($x\) psi or below?$BR +\{ans_rule(20)\} $PAR +(c) If the process mean were \(157\) psi as claimed, but the standard deviation was \($sd\) psi, what is +the probability of obtaining a sample mean of \($x\) psi or below? $BR +\{ans_rule(20)\} + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Percent($ans3)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_6.pg b/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_6.pg new file mode 100644 index 0000000000..dcce417399 --- /dev/null +++ b/Contrib/PCC/Statistics/CentralLimitTheorem/ur_pb_11_6.pg @@ -0,0 +1,56 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem', 'Mean', 'Standard Deviation') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mean = random(60,75,1); +$dev = random(8, 11, .5); +$p = random(.94, .96, .05); +$a = random(1.5, 3, .5); + +$distr = udistr((1-$p)/2); +$n = int(($dev * $distr / $a)**2 + 1); + +BEGIN_TEXT + +Suppose that from the past experience a professor knows that the test score of a student taking his final examination is a random variable +with mean \($mean\) and standard deviation \($dev.\) How many students would have to take the examination to ensure, with probability at +least \($p\), that the class average would be within \($a\) of \($mean\)? $BR + +\{ans_rule(30)\} + +END_TEXT + +ANS(num_cmp($n, tol=>3)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_04_InferencePropn.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_04_InferencePropn.pg new file mode 100644 index 0000000000..4a0bba497e --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_04_InferencePropn.pg @@ -0,0 +1,76 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject(Statistics) +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); +@n = (650,675,700,725,775,800,850); +@x = (142, 138, 151, 139, 162, 175, 183); +$choose = random(0,6,1); +$y = $n[$choose]-$x[$choose]; +$phat = Real($x[$choose]/$n[$choose]); +$qhat = 1-$phat; +$C = Percent(.95); +$zstar = Real(1.959963985); +$moe = $zstar*sqrt($phat*(1-$phat)/$n[$choose]); +$upper = Percent($phat + $moe); +$lower = Percent($phat - $moe); + + +###################################### +# Main text + +BEGIN_TEXT +A recent survey showed that among \($n[$choose]\) randomly selected subjects who +completed \(4\) years of college, \($x[$choose]\) smoke and \($y\) do not smoke. +Determine a \($C\) confidence interval for the true proportion of the +given population that smokes. + +$PAR +\($C\) CI: $SPACE \{ ans_rule(10)\} to \{ ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans1 = Percent($lower); +ANS($ans1->cmp); + +$ans2 = Percent($upper); +ANS($ans2->cmp); + +###################################### + +BEGIN_SOLUTION + +We know that \( \hat{p} = $phat\), thus \( \hat{q} = $qhat\). For \($C\) confidence we have \(z^{*}=$zstar\). We also know that \(\text{MOE} = \operatorname{SE}(\hat{p})\cdot z^{*}\). Now we can find \(\text{MOE} = \sqrt{\frac{$phat\cdot$qhat}{$n[$choose]}}\cdot $zstar=$moe\). This makes our interval, as a percent, from \($lower\) to \($upper\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_07_InferencePropn.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_07_InferencePropn.pg new file mode 100644 index 0000000000..f128151907 --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_07_InferencePropn.pg @@ -0,0 +1,83 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextPercent.pl", + "answerHints.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); +@name = ("Beth", "Dylan", "Cora", "Kim"); +$person = random(0,3,1); +$pronoun = "she"; +if ($person==1) {$pronoun = "he";} +$m = random(0.02, 0.04,0.01); +@level = (.80,.90,.95,.99); +@z = (1.281551566, 1.644853627, 1.959963985, 2.575829304); +$choose = random(0,3,1); +$C= Percent($level[$choose]); +$zr = Real($z[0]); +$n = 0.25 * ($z[$choose] / $m) ** 2; +$nactual =Real(0.25 * ($z[$choose] / $m) ** 2); +$trunc = int($n); +if ($n > $trunc) {$n = $trunc + 1}; + +###################################### +# Main text + +BEGIN_TEXT +$name[$person] wants to determine a \($C\) confidence interval +for the true proportion of high school students in the area who attend +their home basketball games. How large of a sample must $pronoun have +to get a margin of error less than \($m\)? + +$PAR +\(n ={}\) \{ ans_rule(15)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans = Compute("$n")->with(tolType=>'absolute', tolerance=>'0.00000001'); +ANS($ans->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return int($student)-$student != 0 ; + } => ["n must be a whole number."], + $ans-1 => ["You must round up to make sure the margin of error is no more than 0.05."] +))); + +BEGIN_SOLUTION + +If $name[$person] wants an \($C\) confidence level, this will correspond to \(z^{*}=$zr\). We also know $pronoun wants a margin of error of less than \($m\). This means we can fill in the formula \(\text{MOE} = \sqrt{\frac{\hat{p}\hat{q}}{n}}\cdot z^{*}\) to obtain \($m = \sqrt{\frac{0.5\cdot 0.5}{n}}\cdot $zr\). Recall that when we do not know \(\hat{p}\) or \(\hat{q}\) we use the "worst case scenario" with \(\hat{p}=0.5\) and \(\hat{q}=0.5\). The previous equation is solved and and we find \(n=$nactual\). Note that our answer must be a whole number since it is sample size and that \(n=$nactual\) would give us a margin of error of exactly \($m\). But as we want the Margin of Error less than \($m\) we need to round up to \(n=$n\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_08_InferencePropn.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_08_InferencePropn.pg new file mode 100644 index 0000000000..7be35bcb6a --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_08_InferencePropn.pg @@ -0,0 +1,137 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject(Statistics) +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "contextPercent.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); +$z= Real(1.644853627); +$z95 = Real(1.959963985); + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("A radio talk show host with a large audience is interested in +the proportion \(p\) of adults in his listening area who think the drinking +age should be lowered to \(18\). He asks, 'Do you think the drinking age should +be reduced to \(18\) in light of the fact that \(18\) year olds are eligible for +military service?' He asks listeners to phone in and vote 'yes' if they agree +the drinking age should be lowered to \(18\), and 'no' if not. Of the \(100\) people +who phoned in, \(70\) answered 'yes.' Which of the following assumptions for +inference about a proportion using a confidence interval are violated?","The +data are an SRS from the population of interest."); + $mc[0]->extra("The population is at least ten times as large as the +sample.", + "The sample size is large enough so that the count of successes \( n\hat{p}\) +is \(10\) or more.", + "The sample size is large enough so that the count of failures \( +n(1-\hat{p})\) is \(10\) or more."); +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A newspaper conducted a statewide survey concerning the \(1998\) +race for state senator. The newspaper took a SRS of \(1200\) registered voters +and found that \(620\) would vote for the Republican candidate. Let \(p\) +represent the proportion of registered voters in the state who would vote for +the Republican candidate. A \(90$PERCENT\) confidence interval for \(p\) +is:","\(0.517 \pm 0.024\)"); + $mc[1]->extra("\(0.517 \pm 0.014\)", + "\(0.517 \pm 0.028\)", + "\(0.517 \pm 0.249\)"); +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("A newspaper conducted a statewide survey concerning the \(1998\) +race for state senator. The newspaper took a SRS of \(1200\) registered voters +and found that \(620\) would vote for the Republican candidate. Let \(p\) +represent the proportion of registered voters in the state who would vote for +the Republican candidate. How large a sample \(n\) would you need to estimate +\(p\) with a margin of error \(0.01\) with \(95$PERCENT\) confidence? Use the guess +\(\hat{p} = .5\) as the value of \(\hat{p}\).","\(9604\)"); + $mc[2]->extra("\(49\)", + "\(1500\)", + "\(4800\)"); + +@solutions = ("\(D.\) As this sample is comprised of people who both had to be listening to the radio AND had to call in to have their opinion counted, the data is not from an SRS.", + +"\(C.\) Since \(\hat{p}=\frac{620}{1200}=0.517\) and for \(90$PERCENT\) confidence we know that \(z^{*}\approx $z\). From there we can find that \(\text{MOE} = \sqrt{\frac{(0.517)(0.483)}{1200}}*$z \approx 0.0240\)", + +"\(D.\) As we are told that \(\hat{p}=0.5\), meaning that \(\hat{q}=0.5\), and \(\text{MOE} = 0.01\) and \(z^{*}\approx $z95\) for \(95$PERCENT\) confidence, this leaves us to solve the equation \(0.01 = \sqrt{\frac{(0.5)(0.5)}{n}}\) which gives \(n \approx 9604\)", +); + +@ssols = (@solutions[@order]); +###################################### +# Main text + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +###################################### + +BEGIN_SOLUTION + +(a) Option $ssols[0] + +$PAR + +(b) Option $ssols[1] + +$PAR + +(c) Option $ssols[2] + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust50.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust50.pg new file mode 100644 index 0000000000..f65cb9ef1c --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust50.pg @@ -0,0 +1,79 @@ +##DESCRIPTION +## Statistics: Confidence Intervals +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Estimation') +##DBsection('Small-Sample Confidence Intervals for u and u1-u2') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); + + +Context("Percent"); +$z= Real(1.644853627); +$z95 = Real(1.959963985); + +$mc = new_multiple_choice(); + +$mc->qa("What is the relationship between confidence level and precision of a confidence interval?", +"For a fixed sample size, decreasing the confidence level increases the precision"); +$mc->extra("For a fixed sample size, decreasing the confidence level decreases the precision", "For a fixed sample size, decreasing the confidence level has no effect on the precision"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); +################################################# +# Answers + +###################################### + +BEGIN_SOLUTION + +Option \(C\). Consider a sample of size \(n=100\), with \(\hat{p}=0.5\) and \(\hat{q}=0.5\) and \(z^{*} =$z95\), for \(95$PERCENT\) confidence. This gives us, +$PAR +\(\text{MOE}= $z95\sqrt{\frac{(0.5)(0.5)}{100}} \approx 0.098\) or \(9.8$PERCENT\). +$PAR +If we lower our confidence level to \(90$PERCENT\), or, \(z^{*}\approx$z\), we find, +$PAR +\(\text{MOE}= $z\sqrt{\frac{(0.5)(0.5)}{100}} \approx 0.082\) or, \(8.2$PERCENT\). +$PAR +This immediately rules out option \(B\). A lower level of confidence gives us a smaller margin of error and thus a smaller interval which \(p\) could be in. Therefore our precision is increased. + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust51.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust51.pg new file mode 100644 index 0000000000..b86fabf5e6 --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust51.pg @@ -0,0 +1,77 @@ +##DESCRIPTION +## Statistics: Confidence Intervals +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Estimation') +##DBsection('Confidence Intervals') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); + +Context("Percent"); +$z= Real(1.644853627); +$z95 = Real(1.959963985); + +$mc = new_multiple_choice(); + +$mc->qa("Increasing the confidence level while keeping the same sample size has what effect on the margin of error?", +"Increases the margin of error and hence decreases the precision"); +$mc->extra("Increases the margin of error and hence increases the precision", "Decreases the margin of error and hence increases the precision", "Decreases the margin of error and hence decreases the precision"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); +################################################# +# Answers + +###################################### + +BEGIN_SOLUTION + +Option \(D\). Consider a sample of size \(n=100\), with \(\hat{p}=0.5\) and \(\hat{q}=0.5\) and \(z^{*} =$z\), for \(90$PERCENT\) confidence. This gives us, +$PAR +\(\text{MOE}= $z\sqrt{\frac{(0.5)(0.5)}{100}} \approx 0.082\) or \(8.2$PERCENT\). +$PAR +If we raise our confidence level to \(95$PERCENT\), or, \(z^{*}=$z95\), we find, +$PAR +\(\text{MOE}= $z95\sqrt{\frac{(0.5)(0.5)}{100}} \approx 0.098\) or, \(9.8$PERCENT\). +$PAR +Increasing the confidence level increases the margin of error, therefore options \(A\) and \(B\) are not true. Also, since are a larger confidence level has a larger margin of error, we also have a larger interval which \(p\) could be in. This means we have less precision. + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust52.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust52.pg new file mode 100644 index 0000000000..ce82729251 --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust52.pg @@ -0,0 +1,71 @@ +##DESCRIPTION +## Statistics: Confidence Intervals +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Estimation') +##DBsection('Confidence Intervals') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Increasing the sample size while keeping the same confidence level has what effect on the margin of error?", +"Decreases the margin of error and hence increases the precision "); +$mc->extra("Increases the margin of error and hence increases the precision", "Increases the margin of error and hence decreases the precision", "Decreases the margin of error and hence decreases the precision"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +Option \(D\). Consider a sample of size \(n=100\), with \(\hat{p}=0.5\) and \(\hat{q}=0.5\) and for simplicity a confidence level corresponding to \(z^{*} =2\). This gives us, +$PAR +\(\text{MOE}= 2\sqrt{\frac{(0.5)(0.5)}{100}} = 0.10\) or 10$PERCENT. +$PAR +If we keep the same confidence level corresponding to \(z^{*} =2\) but increase the sample size to \(n=200\), we find, +$PAR +\(\text{MOE}= 2\sqrt{\frac{(0.5)(0.5)}{200}} \approx 0.071\) or, 7.1$PERCENT. +$PAR +This immediately rules out option \(A\) and \(C\). Increasing the sample size gives us a smaller margin of error. A smaller margin of error means we have a smaller interval which \(p\) could be in. Therefore, our precision is increased. + +END_SOLUTION +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa49.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa49.pg new file mode 100644 index 0000000000..168c5479c5 --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa49.pg @@ -0,0 +1,121 @@ +##DESCRIPTION +## Statistics: Confidence intervals +##ENDDESCRIPTION + +##KEYWORDS('large sample','confidence interval','statistics', 'population proportion') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Large-Sample Confidence Intervals') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$a = random(300,400,1); +$b = random(500,600,25); + +@conf = ("\(99$PERCENT\)", + "\(90$PERCENT\)", + "\(95$PERCENT\)", + "\(98$PERCENT\)", + "\(99$PERCENT\)"); +@slice = NchooseK(5,1); +@sconf = @conf[@slice]; + +$z1 = normal_distr(.495); +$z2 = normal_distr(.45); +$z3 = normal_distr(.475); +$z4 = normal_distr(.49); +$z5 = normal_distr(.495); + +@z = ($z1, $z2, $z3, $z4, $z5); +@sz = Real(@z[@slice]); +$p = Real($a/$b); +$q = (1-($a/$b)); +$moe = (sqrt($p*(1-$p)/$b)*$sz[0]); +$moeper = Percent(sqrt($p*(1-$p)/$b)*$sz[0]); +$lower = Percent($p - $moe); +$upper = Percent($p + $moe); + +$ans1 = ($p)-$sz[0]*sqrt($p*(1-$p)/$b); +$ans2 = ($p)+$sz[0]*sqrt($p*(1-$p)/$b); +$ans3 = $sz[0]*sqrt($p*(1-$p)/$b); + + +BEGIN_TEXT +A poll is taken in which \($a\) out of \($b\) randomly selected voters indicated their preference for a certain +candidate. $BR $BR (a) Find a $sconf[0] confidence interval for \(p\). $BR $BR +\{ans_rule(20)\} \(\leq p \leq\) \{ans_rule(20)\} +$BR $BR +(b) Find the margin of error for this $sconf[0] confidence interval for \(p\). $BR $BR +\{ans_rule(20)\} $BR $BR + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Percent($ans3)->cmp); + + +$mc = new_multiple_choice(); + +$mc->qa("(c) Without doing any calculations, indicate whether the margin of error is larger or smaller or the same for an 80$PERCENT confidence interval.", "smaller"); +$mc->extra("larger"); +$mc->makeLast("same"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +$BR $BR +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) We know that \(\hat{p}=$p\) and for $sconf[0] confidence we have \(z^{*}\approx $sz[0]\). +$PAR +To create a confidence interval for \(p\) we need the margin of error, which is \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). Using this, we obtain, +$PAR +\(\text{MOE} = $sz[0]\sqrt{\frac{($p)($q)}{$b}} \approx $moe\). +$PAR +Therefore, our interval is \($lower \leq p \leq $upper\). +$PAR +(b) Using our work from the previous question we know that \(\text{MOE} \approx $moeper\). +$PAR +(c) Option \(A\). Without doing work, we know that a smaller level of confidence, assuming all other variables stay the same, will result in a smaller confidence interval. A smaller confidence interval means we have a smaller margin of error. + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa50.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa50.pg new file mode 100644 index 0000000000..3f7e513921 --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa50.pg @@ -0,0 +1,107 @@ +##DESCRIPTION +## Statistics: Confidence intervals +##ENDDESCRIPTION + +##KEYWORDS('statistics','estimates','population','samples') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Large-Sample Confidence Intervals') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$perc = 99; + +$n = random(100,1000,100); +$x = random(50,(4*$n/5)); + +$p = Real($x/$n); +$q = 1- $p; +$z = Real(normal_distr($perc/200)); +$e = $z*sqrt($p*$q/$n); +$lower = Percent($p - $e); +$upper = Percent($p + $e); +$ans1 = $p-$e; +$ans2 = $p+$e; + +BEGIN_TEXT + +Construct the \( $perc$PERCENT\) confidence interval estimate of the population proportion +\( p \) if the sample size is \( n = $n \) and the number of successes in the sample is +\( x = $x. \) $PAR +$BCENTER +\{ans_rule(25)\} \( < p < \) \{ans_rule(25)\} +$ECENTER +$BR + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); + +$mc = new_multiple_choice(); + +$mc->qa("Which of the following is the correct interpretation for your answer in part (a)?", +"We can be \(99$PERCENT\) confident that the percentage of successes in the population lies in the interval"); +$mc->extra("There is a \(99$PERCENT\) chance that the percentage of successes in the population lies in the interval", "We can be \(99$PERCENT\) confident that the percentage of successes in the sample lies in the interval"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) We know that \(\hat{p}=$p\), therefore \(\hat{q}=$q\) and for \( $perc\)$PERCENT we have \(z^{*}\approx $z\). +$PAR +To create a confidence interval for \(p\) we need the margin of error, which is \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). Using this, we obtain, +$PAR +\(\text{MOE} = $z\sqrt{\frac{($p)($q)}{$n}} \approx $e\). +$PAR +Therefore, our interval is \($lower < p < $upper\). +$PAR +(b) Option \(C\). This interval was meant to estimate a population proportion, \(p\), this rules out Option \(A\) which is about a sample. We can also rule out Option \(B\) since we have no ability or right to make a statement about the specific percent chance that \(p\) is in our interval. However, we are allowed to say we are \(99$PERCENT\) confident the value of \(p\) is in our interval. + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa51.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa51.pg new file mode 100644 index 0000000000..bca03a6ead --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa51.pg @@ -0,0 +1,104 @@ +##DESCRIPTION +## Statistics: Confidence intervals +##ENDDESCRIPTION + +##KEYWORDS('statistics','estimates','population','samples') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Large-Sample Confidence Intervals') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$perc = 95; + +$n = random(400,1000,100); +$b = random (.78, .82, .01); +$x =$b*$n; + +$p = Real($x/$n); +$q = 1- $p; +$z = Real(normal_distr($perc/200)); +$e = $z * sqrt($p*$q/$n); +$lower = Percent($p - $e); +$upper = Percent($p + $e); +$ans1 = $p-$e; +$ans2 = $p+$e; + + +BEGIN_TEXT +(a) A random sample of elementary school children in New York state is to be +selected to estimate the proportion \(p\) who have received a medical +examination during the past year. The survey found that \( x = $x \) children were examined during the past year. Construct the \( $perc\)$PERCENT confidence interval estimate of the population proportion +\( p \) if the sample size was \( n = $n \) . + $PAR $PAR +$BCENTER +\{ans_rule(25)\} \( < p < \) \{ans_rule(25)\} +$ECENTER +$BR + +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); + +$mc = new_multiple_choice(); + +$mc->qa("(b) Which of the following is the correct interpretation for your answer in part (a)?", +"We can be \(95$PERCENT\) confident that the percentage of all elementary school children in NY who have received medical examination during the past year lies in the interval"); +$mc->extra("There is a \(95$PERCENT\) chance that the percentage of all elementary school children in NY who have received medical examination during the past year lies in the interval", "We can be \(95$PERCENT\) confident that the percentage of elementary school children in the sample who have received medical examination during the last year lies in the interval"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) We know that \(\hat{p}=$p\) and for \($perc\)$PERCENT we have \(z^{*}\approx$z\). +$PAR +To create a confidence interval for \(p\) we need the margin of error, which is \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). Using this, we obtain, +$PAR +\(\text{MOE} = $z\sqrt{\frac{($p)($q)}{$n}} \approx $e\). +$PAR +Therefore, our interval is \($lower < p < $upper\). +$PAR +(b) Option \(C\). This interval was meant to estimate the percent, \(p\), of all elementary school children, this rules out Option \(A\) which is about a sample. We can also rule out Option \(B\) since we have no ability or right to make a statement about the specific percent chance that \(p\) is in our interval. However, we are allowed to say we are \(95$PERCENT\) confident the value of \(p\) is in our interval. + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa55.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa55.pg new file mode 100644 index 0000000000..a54965d879 --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa55.pg @@ -0,0 +1,99 @@ +##DESCRIPTION +## Statistics: Sample sizes +##ENDDESCRIPTION + +## Tagged by sawblade + +## DBsubject(Statistics) +## DBchapter(Confidence intervals) +## DBsection(One sample proportion) +## Date(6/3/2002) +## Institution(ASU) +## MLT(CI_1p_01) +## Level(2) +## TitleText1('Mathematical Statistics') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## EditionText1('6') +## Section1('8.7') +## Problem1('58') +## KEYWORDS('statistics','estimation','samples') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"contextPercent.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); + +Context("Percent"); +$showPartialCorrectAnswers = 1; + +$b = random(.01,.09,.005); +$p = random(.7,.9,.1); +$q = 1-$p; + +@conf = ("\(95$PERCENT\)", + "\(90$PERCENT\)", + "\(95$PERCENT\)", + "\(98$PERCENT\)", + "\(99$PERCENT\)"); +@slice = NchooseK(5,1); +@sconf = @conf[@slice]; + +$z1 = normal_distr(.475); +$z2 = normal_distr(.45); +$z3 = normal_distr(.475); +$z4 = normal_distr(.49); +$z5 = normal_distr(.495); + +@z = ($z1, $z2, $z3, $z4, $z5); +@sz = Real(@z[@slice]); + +$ans1 = ceil(($sz[0]**2*.25)/$b**2); +$ans2 = ceil(($sz[0]**2*$p*$q)/$b**2); + +BEGIN_TEXT +A random sample of elementary school children in New York state is to be +selected to estimate the proportion \(p\) who have received a medical +examination during the past year. An interval estimate of the proportion \(p\) +with a margin of error of \($b\) and $sconf[0] confidence is required. $PAR +(a) \( \ \) Assuming no prior information about \(\hat{p}\) is available, +approximately how large of a sample size is needed? $BR +\( n = \) \{ans_rule(10)\} $PAR +(b) \( \ \) If a planning study indicates that \(\hat{p}\) is around \($p\), +approximately how large of a sample size is needed? $BR +\( n = \) \{ans_rule(10)\} +END_TEXT +ANS(num_cmp($ans1, tol=>3)); +ANS(num_cmp($ans2, tol=>3)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) Assuming no prior information is known about \(\hat{p}\), we should assume the "worst case" scenario with \(\hat{p}=0.5\) and thus \(\hat{q}=0.5\). Since we wish to have margin of error \($b\) and $sconf[0] confidence, which corresponds to \(z^{*}\approx$sz[0]\), we can find the needed sample size using the formula, \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). +$PAR +Using this we obtain, +$PAR +\($b = $sz[0]\sqrt{\frac{(0.5)(0.5)}{n}}\). Solving for \(n\), we find \(n=$ans1\). +$PAR +(b) Assuming our margin of error and confidence level have not changed, we now also know that \(\hat{p}=$p\) and therefore \(\hat{q}=$q\). Thus we can use the margin of error formula again to obtain, +$PAR +\($b = $sz[0]\sqrt{\frac{($p)($q)}{n}}\). Solving for \(n\), we find \(n=$ans2\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_13.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_13.pg new file mode 100644 index 0000000000..e5caf90c04 --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_13.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## Confidence Intervals +## ENDDESCRIPTION + +## KEYWORDS('Confidence Interval') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Large-Sample Confidence Intervals') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$a = random(300,400,1); +$b = random(500,600,25); + +@conf = ("\(80$PERCENT\)", + "\(90$PERCENT\)", + "\(95$PERCENT\)", + "\(98$PERCENT\)", + "\(99$PERCENT\)"); +@slice = NchooseK(5,1); +@sconf = @conf[@slice]; + +$z1 = normal_distr(.4); +$z2 = normal_distr(.45); +$z3 = normal_distr(.475); +$z4 = normal_distr(.49); +$z5 = normal_distr(.495); + +@z = ($z1, $z2, $z3, $z4, $z5); +@sz = Real(@z[@slice]); +$p = Real($a/$b); +$q = (1-$p); +$moe = ($sz[0]*sqrt($p*(1-$p)/$b)); + +$ans1 = Percent(($p)-$sz[0]*sqrt($p*(1-$p)/$b)); +$ans2 = Percent(($p)+$sz[0]*sqrt($p*(1-$p)/$b)); + +BEGIN_TEXT +A poll is taken in which \($a\) out of \($b\) randomly selected voters indicated their preference for a certain +candidate. Find a $sconf[0] confidence interval for \(p\). $BR +$BCENTER +\{ans_rule(20)\} \(\leq p \leq\) \{ans_rule(20)\} +$ECENTER +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) Since we know \($a\) out of \($b\) randomly selected voters indicated their preference for a certain candidate, we know that \(\hat{p}=$p\) and \(\hat{q}=$q\). We desire a $sconf[0] confidence interval, which corresponds to \(z^{*}\approx$sz[0]\). +$PAR +To create a confidence interval for \(p\), we need the margin of error, which is found with the formula \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). Using this, we obtain, +$PAR +\(\text{MOE} = $sz[0]\sqrt{\frac{($p)($q)}{$b}} \approx $moe\). +$PAR +Therefore, our interval is \($ans1 \leq p \leq $ans2\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_14.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_14.pg new file mode 100644 index 0000000000..720520a590 --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_14.pg @@ -0,0 +1,75 @@ +## DESCRIPTION +## Confidence Intervals +## ENDDESCRIPTION + +## KEYWORDS('Confidence Interval', 'Point Estimate', 'Margin of Error') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Large-Sample Confidence Intervals') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$p = random(0.100, 0.900, 0.010); +$e = random(0.01, 0.09, 0.01); +$min = $p - $e; +$max = $p + $e; + +BEGIN_TEXT + +A confidence interval for a population proportion \(p\) has been given. What was the sample proportion and what is the margin of error? $PAR + +\[ $min < p < $max \] $PAR + +\( \hat{p} = \) \{ans_rule(5)\} \( \ \ \ \ \) +$PAR +margin of error\(= \) \{ans_rule(5)\} + + +END_TEXT + +Context("Percent"); + +ANS(Percent($p)->cmp); +ANS(Percent($e)->cmp); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) As we know our interval in question is \($min < p < $max\), we can find \(\hat{p}\) using symmetry. A confidence interval is centered at \(\hat{p}\) and then created by finding a margin of error and going the same distance on either side of \(\hat{p}\). This means that the interval is centered exactly halfway between the lower and upper bounds of the interval. In our case, this would be \(\hat{p}=\frac{$min+$max}{2} = $p\) +$PAR +(b) Since we know the center of the our interval is \($p\), this means \(\hat{p}=$p\). We know that the lower bound of our interval is \(\text{Lower} = \hat{p} -\text{MOE}\). Using this we obtain, +$PAR +\($min = $p - \text{MOE}\), which can be solved to find \(\text{MOE} = $e\). Therefore our margin of error is \($e\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_15.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_15.pg new file mode 100644 index 0000000000..d6e27e4b1c --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_15.pg @@ -0,0 +1,97 @@ +##DESCRIPTION +##KEYWORDS('large sample', 'population proportion', estimates','confidence intervals') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Evaluating the Goodness of a Point Estimator') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('8.4') +## Problem1('24') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$n = random(60,90,5); +$a = random(40,$n-10,1,); +$p = Real($a/$n); +$q = 1-$p; + +@conf = ("\(80$PERCENT\)", + "\(90$PERCENT\)", + "\(95$PERCENT\)", + "\(98$PERCENT\)", + "\(99$PERCENT\)"); +@slice = NchooseK(5,1); +@sconf = @conf[@slice]; + +$z1 = normal_distr(.4); +$z2 = normal_distr(.45); +$z3 = normal_distr(.475); +$z4 = normal_distr(.49); +$z5 = normal_distr(.495); + +@z = ($z1, $z2, $z3, $z4, $z5); +@sz = Real(@z[@slice]); + +$moe = ($sz[0]*sqrt($p*$q/$n)); + +$ans1 = Percent($p-$sz[0]*sqrt($p*$q/$n)); +$ans2 = Percent($p+$sz[0]*sqrt($p*$q/$n)); + +BEGIN_TEXT +Astronauts often report that there are times when they become disoriented as they move around in zero-gravity. Therefore, they usually rely on bright colors and other visual information to help them establish a top-down orientation. A study was conducted to assess the potential of using color for body orienting. \($n\) college students, reclining on their backs in the dark, found it difficult to +establish orientation when positioned on under a rotating disk. This rotating disk was painted half black and half white. Out of the \($n\) students, \($a\) believed they were right side up when the white was on top. $PAR +Use this information to estimate the true proportion of subjects who use the white color as a cue for right-side-up orientation. That is, construct a $sconf[0] confidence interval for the true proportion. $BR +$BCENTER +\{ans_rule(20)\} \( \leq p \leq \) \{ans_rule(20)\} +$ECENTER +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); + + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) Based on the study we know that of \($n\) students, \($a\) believed they were right side up when the white was on top, meaning \(\hat{p}=$p\) and \(\hat{q}=$q\). We desire a $sconf[0] confidence interval, which corresponds to \(z^{*}\approx$sz[0]\). +$PAR +To create a confidence interval for \(p\) we need the margin of error, which is found with the formula \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). Using this, we obtain, +$PAR +\(\text{MOE} = $sz[0]\sqrt{\frac{($p)($q)}{$n}} \approx $moe\). +$PAR +Therefore, our interval is \($ans1 \leq p \leq $ans2\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_18.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_18.pg new file mode 100644 index 0000000000..bdca84e937 --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_18.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## Selecting Sample Size +## ENDDESCRIPTION + +## KEYWORDS('Sample Size', 'Confidence', 'Margin of Error') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Selecting Sample Size') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$perc = random(90,99,1); + +$a = random(4,7,1); +$p = Real($a/100); +$q = 1-$p; +$e = random(1.5,2,0.5); +$edec = ($e/100); + +$z = Real(normal_distr($perc/200)); +$n1 = $z**2*10000/4/$e**2; +$n2 = $z**2*10000*$p*$q/$e**2; +$ans1 = 5000 - int(5000 - $n1); +$ans2 = 5000 - int(5000 - $n2); + +BEGIN_TEXT + +College officials want to estimate the percentage of students who carry a gun, knife, or +other such weapon. How many randomly selected students must be surveyed in order to be +\( $perc$PERCENT\) confident that the sample percentage has a margin of error of +\( $e \) percentage points? $PAR + +(a) \( \ \) Assume that there is no available information that could be used as an estimate +of \( \hat{p} \). $PAR + +\(n=\) \{ ans_rule(15) \} $PAR + +(b) \( \ \) Assume that another study indicated that \( $a$PERCENT\) of college +students carry weapons.$PAR + +\(n=\) \{ ans_rule(15) \} $PAR + +END_TEXT +Context("Numeric"); + +ANS(Real($ans1)->cmp(tolType=>absolute,tolerance=>2)); +ANS(Real($ans2)->cmp(tolType=>absolute,tolerance=>2)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) Assuming no prior information is known about \(\hat{p}\), we should assume the "worst case" scenario with \(\hat{p}=0.5\) and thus \(\hat{q}=0.5\). Since we wish to have margin of error \($e\) percentage points, or \($edec\) as a decimal, and \( $perc$PERCENT\) confidence, which corresponds to \(z^{*}\approx$z\), we can find the needed sample size using the formula, \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). +$PAR +Using this we obtain, +$PAR +\($edec = $z\sqrt{\frac{(0.5)(0.5)}{n}}\). Solving for \(n\), we find \(n=$ans1\). +$PAR +(b) Assuming our margin of error and confidence level have not changed, we now also know that another study indicated that \($a$PERCENT\) of college students carry weapons, meaning \(\hat{p}=$p\) and therefore \(\hat{q}=$q\). Thus we can use the margin of error formula again to obtain, +$PAR +\($edec = $z\sqrt{\frac{($p)($q)}{n}}\). Solving for \(n\), we find \(n=$ans2\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_19.pg b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_19.pg new file mode 100644 index 0000000000..77375d4eca --- /dev/null +++ b/Contrib/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_19.pg @@ -0,0 +1,100 @@ +##DESCRIPTION +##KEYWORDS('') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Selecting Sample Size') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('8.7') +## Problem1('58') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +"MathObjects.pl" +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$b = random(.01,.09,.005); +$p = random(.1,.9,.1); +$q = 1-$p; + +@conf = ("\(80$PERCENT\)", + "\(90$PERCENT\)", + "\(95$PERCENT\)", + "\(98$PERCENT\)", + "\(99$PERCENT\)"); +@slice = NchooseK(5,1); +@sconf = (@conf[@slice]); + +$z1 = normal_distr(.4); +$z2 = normal_distr(.45); +$z3 = normal_distr(.475); +$z4 = normal_distr(.49); +$z5 = normal_distr(.495); + +@z = ($z1, $z2, $z3, $z4, $z5); +@sz = Real(@z[@slice]); + +$ans1 = ceil(($sz[0]**2*.25)/$b**2); +$ans2 = ceil(($sz[0]**2*$p*$q)/$b**2); + +BEGIN_TEXT +A random sample of elementary school children in New York state is to be +selected to estimate the proportion \(p\) who have received a medical +examination during the past year. An interval estimate of the proportion \(p\) +with a bound of \($b\) and $sconf[0] confidence is required. $PAR +(a) Assuming no prior information about \(p\) is available, +approximately how large of a sample size is needed? $BR +\( n = \) \{ans_rule(10)\} $PAR +(b) If a planning study indicates that \(p\) is around \($p\), +approximately how large of a sample size is needed? $BR +\( n = \) \{ans_rule(10)\} +END_TEXT +Context("Numeric"); +ANS(Real($ans1)->cmp(tolType=>absolute,tolerance=>2)); +ANS(Real($ans2)->cmp(tolType=>absolute,tolerance=>2)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) Assuming no prior information is known about \(\hat{p}\), we should assume the "worst case" scenario with \(\hat{p}=0.5\) and thus \(\hat{q}=0.5\). Since we wish to have margin of error \($b\) and $sconf[0] confidence, which corresponds to \(z^{*}\approx$sz[0]\), we can find the needed sample size using the formula, \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). +$PAR +Using this we obtain, +$PAR +\($b = $sz[0]\sqrt{\frac{(0.5)(0.5)}{n}}\). Solving for \(n\), we find \(n=$ans1\). +$PAR +(b) Assuming our margin of error and confidence level have not changed, we now also know that \(\hat{p}=$p\) and therefore \(\hat{q}=$q\). Thus we can use the margin of error formula again to obtain, +$PAR +\($b = $sz[0]\sqrt{\frac{($p)($q)}{n}}\). Solving for \(n\), we find \(n=$ans2\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/DisplayingData/01Stats_02_PictDistnsWGraphs.pg b/Contrib/PCC/Statistics/DisplayingData/01Stats_02_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..57a08997bb --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/01Stats_02_PictDistnsWGraphs.pg @@ -0,0 +1,130 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("To display the distribution of grades (A, B, C, D, F) in a course, it would be correct to use ", + "either a pie chart or a bar graph. "); + $mc[0]->extra("a pie chart but not a bar graph. ", + "a bar graph but not a pie chart. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A study of recent college graduates records the sex and total college debt in dollars for \(10,000\) people a year after they graduate from college. Which of the following is a true statement? ", + "Sex is a categorical variable and college debt is a quantitative variable. "); + $mc[1]->extra("Sex and college debt are both categorical variables. ", + "Sex and college debt are both quantitative variables. ", + "Sex is a quantitative variable and college debt is a categorical variable. "); + $mc[1]->makeLast("All of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("A political party's data bank includes the zip codes of past donors, such as +$BR +\[ \begin{array}{cccccccc} +\mbox{47906} & \mbox{34236} & \mbox{53075} & \mbox{10010} & \mbox{90210} & \mbox{75204} & \mbox{30304} & \mbox{99709} +\end{array} \] +$PAR $SPACE $SPACE $SPACE Zip code is a", + "Categorical variable. "); + $mc[2]->extra("Quantitative variable. ", + "Unit of Measurement. "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("Here are the amounts of money (cents) in coins carried by 10 students in a statistics class: +\[ \begin{array}{ccccccccccc} +\mbox{50} & \mbox{35} & \mbox{0} & \mbox{97} & \mbox{76} & \mbox{0} & \mbox{0} & \mbox{87} & \mbox{23} & \mbox{65} +\end{array} \] +$BR +To make a stemplot of these data, you would use stems ", + "0, 1, 2, 3, 4, 5, 6, 7, 8, 9. "); + $mc[3]->extra("0, 2, 3, 5, 6, 7, 8, 9. ", + "00, 10, 20, 30, 40, 50, 60, 70, 80, 90. "); + $mc[3]->makeLast("None of the above. "); + +@solutions = ("Since the grades are letters, this makes the data is qualitative. Thus a pie chart or a bar graph would suffice in this situation.", + +" ''Sex'' is male, female, or other. Thus it is qualitative data. Amount of debt in dollars is quantitative data.", + +"Although zip codes are numbers, they are not a quantity, that is, we cannot associate a unit with zip codes. Furthermore, a zip codes of \(95817\) does not mean there are \(95817\) of anything. Rather, zip codes are a quality, a certain number means you live in a certain area. Thus zip codes are categorical or qualitative data.", + +"The option with \(0, 2, 3, 5, 6, 7, 8, 9\) is tempting but it leaves out the \(1\), which would mean a gap in our data so to speak. This would misrepresent our data. We cannot use option with \(00\), etc, since it would actually represent three digit numbers since each of the ''stems'' is already two digits. Option \(\{$mc[$order[1]] -> correct_ans\}\) covers all our data with the given ''stems'' being the ten's place", +); + +@ssols = (@solutions[@order]); + +################################################# +# Main + +BEGIN_TEXT +Select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + + +###################################### + + +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +$PAR + +(c) Option \(\{$mc[$order[2]] -> correct_ans\}\). $ssols[2] + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/DisplayingData/01Stats_05_PictDistnsWGraphs.pg b/Contrib/PCC/Statistics/DisplayingData/01Stats_05_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..af2a28e566 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/01Stats_05_PictDistnsWGraphs.pg @@ -0,0 +1,136 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'time plot') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The maximum price per share for this time period was about "," \(41\) dollars. "); + $mc[0]->extra("\(45\) dollars. ", + "\(25\) dollars. ", + "\(20\) dollars. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("Which of the following is a true statement? ", + "There has been a general downward trend in the stock price over this time period."); + $mc[1]->extra("The price of General Electric stock has been stable for this year. ", + "The price should return to \(40\) dollars within six months because of the cycle. ", + "There has been a general upward trend in the stock price over this time period. "); + $mc[1]->makeLast("None of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("If you bought a single share of stock at the maximum price and sold it at the + minimum price during this one-year period, you would have lost about", + "\(15\) dollars."); + $mc[2]->extra("\(25\) dollars.", + "\(35\) dollars.", + "\(45\) dollars."); + $mc[2]->makeLast("Cannot be determined from the graph. "); + +@solutions = ("The value of the stock goes above \(40\) dollars but not close enough to \(45\) dollars to consider it the correct result.", + +"Overall the value of the stock has been going down. The data does not appear to be following a cycle and the value is not going up over time.", + +"The maximum value of the stock was about \(41\) dollars and the minimum value was about \(25\) dollars . Buying a single stock, at the end of one year, you would have lost about \(15\) dollars .", +); + +@ssols = (@solutions[@scramble]); + +###################################### +# Main text + +BEGIN_TEXT +The timeplot below gives the share price in dollars of General Electric stock, +with the bar chart giving the volume of trade in millions of shares. The plots are +for the one-year period of September \(2001\) through September \(2002\). +$PAR +$BCENTER +\{ image("Ref_1_1.gif", height=>300, width=>400, tex_size => 900) \} +$ECENTER +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +###################################### + +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +$PAR + +(c) Option \(\{$mc[$order[2]] -> correct_ans\}\). $ssols[2] + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + + + + + + diff --git a/Contrib/PCC/Statistics/DisplayingData/01Stats_06_PictDistnsWGraphs.pg b/Contrib/PCC/Statistics/DisplayingData/01Stats_06_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..00be485dba --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/01Stats_06_PictDistnsWGraphs.pg @@ -0,0 +1,88 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'histogram') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@TwoProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @TwoProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("When drawing a histogram it is important to ", + "label the vertical axis so the reader can determine the counts or percent in each bin. "); + $mc[0]->extra("have a separate bin for each observation to get the most informative plot. ", + "make sure the heights of the bars exceed the widths of the bins so that the bars are true rectangles. ", + "make certain the mean and median are contained in the same bin, so that the correct type of skewness can be identified. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("In drawing a histogram, which of the following suggestions should be followed? ", + "The heights of bars should equal the bin frequency or relative frequency."); + $mc[1]->extra("Leave large gaps between bars. This allows room for comments. ", + "Generally, bars should be square so that both the height and width equal the bin frequency. ", + "The scale of the vertical axis should be that of the variable whose distribution you are displaying. "); + +@solutions = ("The vertical axis should be labeled or else we would not know if we are dealing with count or percent.", + +"The heights of bars should equal the bin frequency or relative frequency, otherwise we would be leaving data out. Gaps are only included or seen if there is no data in that specific bin.", +); + +@ssols = (@solutions[@scramble]); +###################################### +# Main text + +BEGIN_TEXT +Select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); + +###################################### + +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/DisplayingData/01Stats_07_PictDistnsWGraphs.pg b/Contrib/PCC/Statistics/DisplayingData/01Stats_07_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..f2dacdc0a4 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/01Stats_07_PictDistnsWGraphs.pg @@ -0,0 +1,97 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data', 'histogram') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The interval that contains closest to \(10\) students is ","\(68-71\) inches. "); + $mc[0]->extra("\(59-65\) inches. ", + "\(56-68\) inches. ", + "\(74-80\) inches. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("Which of the following is a correct statement? ", + "None of the above are correct."); + $mc[1]->extra("The tallest person must have a height of at least \(79\) inches. ", + "The histogram is symmetric. ", + "Approximately half the students have heights between \(65\) and \(71\) inches. "); + $mc[1]->makeLast("None of the above are correct."); + +@solutions = ("\(68-71\) inches seems to have just about \(10\) students. The other ranges have too many students or include a height which is not in our graph.", + +"None! The tallest person is at least \(77\) inches tall but that is all we know. We cannot argue the histogram is symmetric due to the middle. Finally, only about \(20\) seem to be between heights of \(65\) and \(71\) and their are roughly \(60\) in total.", +); + +@ssols = (@solutions[@scramble]); + +###################################### +# Main text + +BEGIN_TEXT +Consider the histogram given below: +$PAR +$BCENTER +\{ image("Ref_1_2.gif", height=>300, width=>400, tex_size => 600) \} +$ECENTER +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); + +###################################### + +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/DisplayingData/01Stats_08_PictDistnsWGraphs.pg b/Contrib/PCC/Statistics/DisplayingData/01Stats_08_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..aeea20d797 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/01Stats_08_PictDistnsWGraphs.pg @@ -0,0 +1,111 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data', 'histogram') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The number of students with under \(10\) dollars in their possession is closest to ","\(60\) "); + $mc[0]->extra("\(50\) ", + "\(40\) ", + "\(70\) "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The histogram ","all of the above."); + $mc[1]->extra("is skewed right. ", + "has an outlier. ", + "is asymmetric. "); + $mc[1]->makeLast("all of the above."); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("The percentage of students with over \(10\) dollars in their possession is", + "over \(50$PERCENT\)."); + $mc[2]->extra("about \(10$PERCENT\).", + "about \(30$PERCENT\). ", + "about \(40$PERCENT\)."); + +@solutions = ("The first bin is the \(0-10\) dollar range (thus less than \(10\)) dollars. About \(60\) students are in the bin.", + +"All of the above! There is an outlier far on the right. We would say the graph is right skewed since if we were to draw a smooth curve over it the tail would go to the right. As such, the graph is also asymmetrical, which simply means not symmetrical.", + +"There are \(136\) students total, with about \(60\) of them having under \(10\) dollars. This means about half, or \(50$PERCENT\), of the students have more than \(10\) dollars.", +); + +@ssols = (@solutions[@scramble]); + +###################################### +# Main text + +BEGIN_TEXT +In a statistics class with \(136\) students, the professor records how much money +each student has in their possession during the first class of the semester. +The histogram below is of the data collected. +$PAR +$BCENTER +\{ image("Ref_1_4.gif", height=>320, width=>430, tex_size => 6) \} +$ECENTER +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +$PAR + +(c) Option \(\{$mc[$order[2]] -> correct_ans\}\). $ssols[2] + +END_SOLUTION +####################################### +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/DisplayingData/01Stats_09_PictDistnsWGraphs.pg b/Contrib/PCC/Statistics/DisplayingData/01Stats_09_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..46a0a26348 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/01Stats_09_PictDistnsWGraphs.pg @@ -0,0 +1,109 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data', 'histogram') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("This stemplot is most similar to", + "a histogram with class intervals between \(110\) and \(120\), between \(120\) and \(130\), etc. "); + $mc[0]->extra("a time plot of the data with the observations taken in increasing order. ", + "a boxplot of the data. ", + "reporting the \(5\)-point summary for the data, with the mean. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("To which of the following data sets does this stemplot correspond? ", + "\(116, 118, 121, 124, 128, 133, 137, 142, 146, 179\) "); + $mc[1]->extra("\(16, 18, 21, 24, 28, 33, 37, 42, 46, 79\) ", + "\(1, 2, 3, 4, 6, 6, 7, 8, 8, 9\) ", + "all integers between \(116\) and \(179\) "); + +@solutions = ("A stemplot is almost like an upright histogram. If we take our current stemplot and lay it down on the left side it will resemble a histogram with class intervals between \(110\) and \(120\), between \(120\) and \(130\), etc.", + +"Since the ''stem'' of data table is \(11\), etc, this means \(1\) in the hundred's and \(1\) in the ten's. The number after the bar is the one's place. However, we cannot say it is all integers between \(116\) and \(179\) since we only have \(10\) students.", +); + +@ssols = (@solutions[@scramble]); + +###################################### +# Main text + +BEGIN_TEXT +For a Physics course containing \(10\) students, +the maximum point total for the quarter was \(200\). +The point totals for the \(10\) students are given in the stemplot below. +$PAR +$BCENTER +\{ image("Ref_1_5.gif", height=>150, width=>100, tex_size => 200) \} +$ECENTER +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) The lowest score in the class as a percentage of the total + possible points is \{ans_rule(10)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +$ans_c = Real('.58'); +Context("Percent"); +ANS(Percent($ans_c)->cmp); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +$PAR + +(c) As the total points possible is \(200\) and the lowest number of points scored was \(116\), the lowest scores as a percentage is \(\frac{116}{200}\) or \($ans_c\) + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/DisplayingData/01Stats_10_PictDistnsWGraphs.pg b/Contrib/PCC/Statistics/DisplayingData/01Stats_10_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..8ce951d299 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/01Stats_10_PictDistnsWGraphs.pg @@ -0,0 +1,101 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data', 'histogram') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("Based on this pie chart, we may conclude that ", + "more than half of the cars in the study were from the United States. "); + $mc[0]->extra("Japanese cars get lower gas mileage than cars + of other countries. This is because their slice of the pie is at the + bottom of the chart. ", + "Italian and French cars get lower gas mileage than cars of other countries. This is because their slice of the pie is so thin.", + "Swedish cars get gas mileages that are between those of Japanese and American cars. ", + "Mercedes Benz, Audi, Porsche, and BMW represent approximately one quarter of the + cars tested. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A pie chart is equivalent to a ","bar chart."); + $mc[1]->extra("histogram. ", + "scatter plot. ", + "timeplot "); + $mc[1]->makeLast("None of the above. "); + +@solutions = ("Looking at the portion of the circle the U.S. has, we should conclude more than half of the cars in teh study were from the U.S.. Although this study is about the gas mileage of cars, the circle graph does not report gas mileage nor style of car, it only reports the country of manufacture.", + +"Since a pie chart is uses qualitative data, it is equivalent to a bar chart.", +); + +@ssols = (@solutions[@scramble]); + +###################################### +# Main text + +BEGIN_TEXT +Consumers Union measured the gas mileage in miles per gallon of \(38\) +\(1978-79\) model automobiles on a special test track. The pie chart +below provides information about the country-of-manufacture of the +models teseted by CU. +$PAR +$BCENTER +\{ image("Ref_1_6.gif", height=>270, width=>310, tex_size => 600) \} +$ECENTER + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/DisplayingData/01Stats_11_PictDistnsWGraphs.pg b/Contrib/PCC/Statistics/DisplayingData/01Stats_11_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..abf81a2b62 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/01Stats_11_PictDistnsWGraphs.pg @@ -0,0 +1,72 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data', 'bar graphs') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + + +###################################### +# Main text + +BEGIN_TEXT +Below is a bar graph of class standing for a Finance seminar +containing five students who are either freshman, sophomores, +juniors, or seniors. In the bar graph, the bar for the juniors +$BITALIC has been omitted$EITALIC. +$PAR +$BCENTER +\{ image("Ref_1_7.gif", height=>300, width=>350, tex_size => 600) \} +$ECENTER +$PAR +(a) The percentage of students in the seminar who are not juniors is \{ans_rule(10)\}. + +$PAR +(b) The number of students in the seminar who are juniors is \{ans_rule(10)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; +Context("Percent"); +ANS(Percent(0.8)->cmp); + +$ans_b = Real("1"); +ANS($ans_b->cmp); + + +###################################### +BEGIN_SOLUTION + +(a) Note that this question deals with $BITALIC percent $EITALIC of students. The question mentions five students total, with four students total who are not juniors. Since this is percent, it is \(\frac{4}{5}\) or \(80$PERCENT\). + +$PAR + +(b) Note that this question deals with $BITALIC number $EITALIC of students. The question mentions five students total, with four students total who are not juniors. This means that \($ans_b\) student is a junior. + + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/DisplayingData/02Stats_01_DescrData.pg b/Contrib/PCC/Statistics/DisplayingData/02Stats_01_DescrData.pg new file mode 100644 index 0000000000..84d0ddd7a6 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/02Stats_01_DescrData.pg @@ -0,0 +1,95 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 2: Describing Distributions with Numbers') +## KEYWORDS('statistics', 'skewed', 'mean', 'median') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 2: Describing Distributions with Numbers') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@pic= ("3-413210.gif", "3-118225.gif"); +@ANSWER1=("Skewed right", "Skewed left"); +@ANSWER2=("Mean", "Median"); +$choose = random(0,1,1); + +$popup1 = PopUp(["?", "Skewed right", "Skewed left", "Symmetric"], $ANSWER1[$choose]); + +$popup2 = PopUp(["?", "Mean", "Median", "They are about equal"], $ANSWER2[$choose]); + +###################################### +# Main text + +BEGIN_TEXT +Consider the histogram shown below. +$BR +$BCENTER +\{ image($pic[$choose], height=>300, width=>400, tex_size => 600) \} +$ECENTER +$PAR +(a) Is this data skewed to the right, symmetric, or skewed to the left? \{ $popup1->menu() \} +$BR + +$PAR +(b) Which is bigger for this data set, the mean or the median, or are they about equal? \{ $popup2->menu() \} +$BR + + +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + + +ANS( $popup1->cmp() ); +ANS( $popup2->cmp() ); + + +###################################### +BEGIN_SOLUTION + +(a) $popup1. If we were to draw a smooth curve over the histogram, the tail of that curve would go stretch further out to the left hand side than the right side. + +$PAR + +(b) $popup2. The small values, potentially outliers, would affect the mean and make it smaller, or drag it to the left graphically. The median would not be affected and would stay in the middle, making it larger than the mean. + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + + + + diff --git a/Contrib/PCC/Statistics/DisplayingData/02Stats_07_DescrData.pg b/Contrib/PCC/Statistics/DisplayingData/02Stats_07_DescrData.pg new file mode 100644 index 0000000000..8120907ece --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/02Stats_07_DescrData.pg @@ -0,0 +1,102 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 2: Describing Distributions with Numbers') +## KEYWORDS('statistics', 'quartiles', 'five number summary', 'median') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 2: Describing Distributions with Numbers') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@pic = ("8-714214.gif","8-317222.gif"); +@min=(5,2); +@Q1=(6,3); +@median=(7,6); +@Q3=(10.5,14); +@max=(13,16); + +$choose = random(0,1,1); + +################################################# +# Main + +BEGIN_TEXT +A boxplot for a set of data is given below. Find the five-number summary +$PAR +$BCENTER +\{ image($pic[$choose], height=>250, width=>350, tex_size => 600) \} +$ECENTER +$PAR +Find the minimum: \{ans_rule(5)\} +$PAR +Find \(Q_{1}\): \{ans_rule(5)\} +$PAR +Find the median: \{ans_rule(5)\} +$PAR +Find \(Q_{3}\): \{ans_rule(5)\} +$PAR +Find the maximum: \{ans_rule(5)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +ANS(Compute($min[$choose])->cmp); +ANS(Compute($Q1[$choose])->cmp); +ANS(Compute($median[$choose])->cmp); +ANS(Compute($Q3[$choose])->cmp); +ANS(Compute($max[$choose])->cmp); + +###################################### +BEGIN_SOLUTION + +(a) The minimum is the leftmost point of the boxplot, \($min[$choose]\) +$PAR +(b) \(Q_{1}\) is the first ''bar'' from left to right, \($Q1[$choose]\) +$PAR +(c) The median is the second ''bar'' from left to right, \($median[$choose]\) +$PAR +(d) \(Q_{3}\) is the third ''bar'' from left to right, \($Q3[$choose]\) +$PAR +(e) The maximum is the rightmost point of the boxplot, \($max[$choose]\) + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + + + + + + diff --git a/Contrib/PCC/Statistics/DisplayingData/02Stats_08_DescrData.pg b/Contrib/PCC/Statistics/DisplayingData/02Stats_08_DescrData.pg new file mode 100644 index 0000000000..c30b476d05 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/02Stats_08_DescrData.pg @@ -0,0 +1,73 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 2: Describing Distributions with Numbers') +## KEYWORDS('statistics', 'boxplot') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 2: Describing Distributions with Numbers') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + + +$n = random(6,24,1); +$number = 4 * $n; +@pic = ("9-213218.gif","9-312221.gif","9-613231.gif","9-511242.gif"); +$choose = random(0,3,1); +$perc = 25; +if ($choose == 3) { $perc = 50;} + +################################################# +# Main + +BEGIN_TEXT +A boxplot for a set of \($number\) scores is given below. +$PAR +$BCENTER +\{ image($pic[$choose], height=>250, width=>350, tex_size => 600) \} +$ECENTER +$PAR +How many scores are represented in the blue section of the boxplot? +$BR +Answer: \{ ans_rule(15)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans = $n; #The correct answer depends on the graph chosen. +if ($choose == 3) { $ans = 2 * $n;} + +ANS(Real($ans)->cmp->withPostFilter(AnswerHints( + Real(25) => ["Give the number of scores not the percent."], + Real(.25) => ["Give the number of scores not the fraction of scores."], + Real(50) => ["Give the number of scores not the percent."], + Real(.50) => ["Give the number of scores not the fraction of scores."] +))); + +###################################### +BEGIN_SOLUTION + +Recall that we want the number of test scores. Note that \($perc$PERCENT\) percent of the graph is blue. This means the portion in blue is \($perc$PERCENT\) percent of all \($number\) test scores. The blue portion is \($ans\) test scores. + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/DisplayingData/02Stats_10_DescrData.pg b/Contrib/PCC/Statistics/DisplayingData/02Stats_10_DescrData.pg new file mode 100644 index 0000000000..54ddde4129 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/02Stats_10_DescrData.pg @@ -0,0 +1,127 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Exploratory data analysis/descriptive statistics) +## DBsection(Summary statistics) +## Institution(The College of Idaho) +## Author(R Cruz, L Danielson, J Guild) +## MLT(stat-des-concepts) +## MLTleader(1) +## Level(2) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('2') +## Problem1('') +## KEYWORDS('statistics', 'skewed', 'five number summary', 'median', 'boxplot') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("If a distribution is skewed to the right, ", + "the mean is greater than the median."); + $mc[0]->extra("the mean is less than the median. ", + "the mean and median are equal. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("What percent of the observations in a distribution lie between the first quartile and the third quartile? ", + "\(50$PERCENT\). "); + $mc[1]->extra("\(25$PERCENT\). ", + "\(75$PERCENT\). "); + $mc[1]->makeLast("None of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("To make a boxplot of a distribution, you must know ","the five-number summary. "); + $mc[2]->extra("all of the individual observations. ", + "the mean and the standard deviation. "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("Which of the following is least affected if an extreme high outlier is added to your data? ", + "The median. "); + $mc[3]->extra("The mean. ", + "The standard deviation. "); + $mc[3]->makeLast("None of the above. "); + +@solutions = ("When a distribution is skewed the right, it normally means there is some extreme data on the right hand side, or at least enough data on the right hand side that makes the distribution not symmetric. This data on the right hand side will draw the mean (which is not resistant to outlier and large values) higher, and make it greater than the median.", + +"Since quartiles are broken up into quarters, \(50$PERCENT\) of the observations in a distribution lie between the first quartile and the third quartile, \(25$PERCENT\) from quartile one to the median and \(25$PERCENT\) from the median to quatile three.", + +"While havng all of the indivuadual observations is good, it is not necessary to construct a boxplot. As long as we have the \(5\)-number summary, we have all the needed information.", + +"The medain is least affected by adding large outlier. While its value will certainly change by adding new data, it will still be ''in the middle''.", +); + +@ssols = (@solutions[@scramble]); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +COMMENT('Questions selected randomly from a larger set. See source for full question list.'); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +$PAR + +(c) Option \(\{$mc[$order[2]] -> correct_ans\}\). $ssols[2] + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/DisplayingData/03Stats_01_NormalDist.pg b/Contrib/PCC/Statistics/DisplayingData/03Stats_01_NormalDist.pg new file mode 100644 index 0000000000..b857e63517 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/03Stats_01_NormalDist.pg @@ -0,0 +1,151 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@pic= ("1-815316.gif", "1-318321.gif", "1-712333.gif"); +@SHAPE=("Skewed right", "Skewed left", "Symmetric"); +@MEAN=("C", "A", "B"); +@MEDIAN=("B", "B", "B"); +$choose1 = random(0,2,1); +$choose2 = 2; +if ($choose1 == 2) {$choose2 = random(0,1,1);} + +$popup1 = PopUp(["?", "A", "B", "C"], $MEAN[$choose1]); +$popup2 = PopUp(["?", "A", "B", "C"], $MEDIAN[$choose1]); +$popup3 = PopUp(["?", "Skewed right", "Symmetric", "Skewed left"], $SHAPE[$choose1]); +$popup4 = PopUp(["?", "A", "B", "C"], $MEAN[$choose2]); +$popup5 = PopUp(["?", "A", "B", "C"], $MEDIAN[$choose2]); +$popup6 = PopUp(["?", "Skewed right", "Symmetric", "Skewed left"], $SHAPE[$choose2]); + +###################################### +# Main text 1 + +BEGIN_TEXT +For the distributions shown below, indicate which value is closest to the mean and +which value is closest to the median. State whether the distribution is skewed left, +skewed right or symmetric. +$BR +$BR +Graph \(1\). +$BR +\{ image($pic[$choose1], height=>250, width=>350, tex_size => 700) \} + +$PAR + (a) The mean is closest to: \{ $popup1->menu() \} +$PAR + (b) The median is closest to: \{ $popup2->menu() \} +$PAR + (c) Is this data skewed to the right, symmetric, or skewed to the left? \{ $popup3->menu() \} +$PAR +END_TEXT + +###################################### +# Answers 1 + +$showPartialCorrectAnswers = 1; + +ANS( $popup1->cmp() ); +ANS( $popup2->cmp() ); +ANS( $popup3->cmp() ); + +###################################### +# Main text 2 + +BEGIN_TEXT +$BR +Graph \(2\). +$BR +\{ image($pic[$choose2], height=>250, width=>350, tex_size => 700) \} + +$PAR + (a) The mean is closest to: \{ $popup4->menu() \} +$PAR + (b) The median is closest to: \{ $popup5->menu() \} +$PAR + + (c) Is this data skewed to the right, symmetric, or skewed to the left? \{ $popup6->menu() \} +$BR + +END_TEXT + +###################################### +# Answers 2 + +ANS( $popup4->cmp() ); +ANS( $popup5->cmp() ); +ANS( $popup6->cmp() ); + +###################################### +BEGIN_SOLUTION + +Graph \(1\) +$PAR +(a) Option \($popup1\). Recall that in general, for a symmetric graph, the mean is near the middle, for a left skewed graph the mean is further to the left and for a right skewed graph the mean is further to the right. + +$PAR + +(b) Option \($popup2\). Recall that for a symmetric graph, the median is near the middle, for a left skewed graph the median is still in the ''middle,'' which may be hard to see, but it will be higher, or larger than the mean. For a right skewed graph the median is still in the ''middle,'' which may be hard to see, but it will be lower, or smaller than the mean. + +$PAR + +(c) The data is \($popup3\). When skewed left, the tail of the curve extends futher on the left side. For skewed right, the tail extends further on the right side. For symmetric, the tail extends about the same amount on both sides. +$PAR +Graph \(2\) +$PAR +(a) Option \($popup4\) + +$PAR + +(b) Option \($popup5\) + +$PAR + +(c) The data is \($popup6\) + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + + + + + + diff --git a/Contrib/PCC/Statistics/DisplayingData/1-318321.gif b/Contrib/PCC/Statistics/DisplayingData/1-318321.gif new file mode 100644 index 0000000000..386193c451 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/1-318321.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/1-712333.gif b/Contrib/PCC/Statistics/DisplayingData/1-712333.gif new file mode 100644 index 0000000000..15b4c8cf7d Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/1-712333.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/1-815316.gif b/Contrib/PCC/Statistics/DisplayingData/1-815316.gif new file mode 100644 index 0000000000..5e6f785521 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/1-815316.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/3-118225.gif b/Contrib/PCC/Statistics/DisplayingData/3-118225.gif new file mode 100644 index 0000000000..d85ee1df55 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/3-118225.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/3-413210.gif b/Contrib/PCC/Statistics/DisplayingData/3-413210.gif new file mode 100644 index 0000000000..45e3479d74 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/3-413210.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/8-317222.gif b/Contrib/PCC/Statistics/DisplayingData/8-317222.gif new file mode 100644 index 0000000000..8b57e1e8ad Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/8-317222.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/8-714214.gif b/Contrib/PCC/Statistics/DisplayingData/8-714214.gif new file mode 100644 index 0000000000..7733ca9770 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/8-714214.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/9-213218.gif b/Contrib/PCC/Statistics/DisplayingData/9-213218.gif new file mode 100644 index 0000000000..2700357451 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/9-213218.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/9-312221.gif b/Contrib/PCC/Statistics/DisplayingData/9-312221.gif new file mode 100644 index 0000000000..c831cc9436 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/9-312221.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/9-511242.gif b/Contrib/PCC/Statistics/DisplayingData/9-511242.gif new file mode 100644 index 0000000000..45f709d7f9 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/9-511242.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/9-613231.gif b/Contrib/PCC/Statistics/DisplayingData/9-613231.gif new file mode 100644 index 0000000000..a08f027a9c Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/9-613231.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/BoxPlotPercentBetween.pg b/Contrib/PCC/Statistics/DisplayingData/BoxPlotPercentBetween.pg new file mode 100644 index 0000000000..af4d71ca3b --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/BoxPlotPercentBetween.pg @@ -0,0 +1,85 @@ +##DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Exploratory data analysis/descriptive statistics) +## DBsection(Graphical representations) +## Institution(NAU) +## Author(Edgar Fisher) +## Level(2) +## KEYWORDS('boxplot') +##ENDDESCRIPTION + +# File Created: 6/14/05 +# Location: Northern Arizona University + +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 annual salaries of attorneys in +thousands of dollars in Los Angeles. About what percentage +of the attorneys have salaries 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)); + +###################################### +BEGIN_SOLUTION + +Notice that both $from and $to are both either the minimum, \(Q_{1}\), the median, \(Q_{3}\), or the maximum. This means \(25$PERCENT\) of the observations are between the minimum and \(Q_{1}\), \(Q_{1}\) and the median, etc. Based on this we can conclude \($ans$PERCENT\) of salaries are between $from and $to. + + +END_SOLUTION +####################################### + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/DisplayingData/Boxplot.pg b/Contrib/PCC/Statistics/DisplayingData/Boxplot.pg new file mode 100644 index 0000000000..6841982298 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/Boxplot.pg @@ -0,0 +1,186 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## KEYWORDS('boxplot') +## Author('Ty Thompson/Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/02/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGgraphmacros.pl", + "PGnauStats.pl" +); + +TEXT(beginproblem()); + +{ +@low=(); +@high=(); +@Q1=(); +@Q3=(); +@mean=(); +@medn=(); +@corr=(); +@incorr=(); + +#randomly setup the data range +@datasets = ("D1", "D2", "D3"); + +for ($i=0; $i<3; $i++){ + $val = random(-100,100,1); + push @low, $val; + push @high, random($val + 10, $val + 110, 1); + + $val = ($high[$i] - $low[$i])/3; + push @mean, int random($low[$i] + $val, $high[$i] - $val, 1); + + push @Q1, int random($low[$i] + 2,$mean[$i] - 1, 1); + + push @Q3, int random($mean[$i] + 1,$high[$i] - 2,1); + + if ($Q3[$i] - $Q1[$i] == 2){ + push @medn, $Q3[$i] - 1; + } else { + do{ + $val = int random($Q1[$i] + 1,$Q3[$i] - 1, 0.1); + } while ($val == $mean[$i]); + push @medn, $val; + } + } + +if (random(1,2,1)>1){ + $medn[1] = ($Q3[1]+$Q1[1])/2; + } + +##### Answers. There are six possible answers, each might either be correct or incorrect. + +push @corr, "Which of the following are true?"; + +#The first answer +if ($low[0] > $medn[1]){ + push @corr, (join " ", "All the data values for set ", $datasets[0], " are greater than the median value for ", $datasets[1], "."); +} +else{ + push @incorr, (join " ", "All the data values for set ", $datasets[0], " are greater than the median value for ", $datasets[1], "."); +} + +#The second answer +if ($Q1[2] < $medn[1]){ + push @corr, (join " ", "At least one quarter of the data values for ", $datasets[2], " are less than the median value for ", $datasets[1]); +} +else{ + push @incorr, (join " ", "At least one quarter of the data values for ", $datasets[2], " are less than the median value for ", $datasets[1]); +} + +#The third answer +if ($medn[0] > $medn[2]){ + push @corr, ("The data for ". join " ", $datasets[0], " has a greater median value than the data for ", $datasets[2], "."); +} +else{ + push @incorr, ("The data for ". join " ", $datasets[0], " has a greater median value than the data for ", $datasets[2], "."); +} + + +#The fourth answer. +if ((abs(ln(($Q3[1] - $medn[1]) / ($medn[1] - $Q1[1]))) <= .2) +&& (abs(ln(($high[1] - $Q3[1]) / ($Q1[1] - $low[1]))) <= .3)){ + push @corr, ("The data represented in $datasets[1] is roughly symmetric."); +}else{ + push @incorr, ("The data represented in $datasets[1] is roughly symmetric."); +} + +#The fifth answer +# skew is not decidable from box plot Nandor +# if ($medn[2] < ($Q3[2]+$Q1[2])/2){ +# push @corr, ("The data represented in ". join " ", "boxplot ", $datasets[2], " is skewed to the right."); +# }else{ +# push @incorr, ("The data represented in ". join " ", "boxplot ", $datasets[2], " is skewed to the right."); +# } + +#The sixth answer +if ($Q1[0] > $medn[2]){ + push @corr, (join " ", "At least three quarters of the data values represented in ", $datasets[0], " are greater than the median value of ", $datasets[2], "."); +}else{ + push @incorr, (join " ", "At least three quarters of the data values represented in ", $datasets[0], " are greater than the median value of ", $datasets[2], "."); +} + +redo if (1==(scalar @corr)); # all the answers are false +} + +# find the minimum data value +$datamin = $low[0]; +for ($i = 1; $i < 3; $i++){ + if ($low[$i] < $datamin){$datamin = $low[$i];} + } + +# find the maximum data value +$datamax = $high[0]; +for ($i = 1; $i < 3; $i++){ + if ($high[$i] > $datamax){$datamax = $high[$i];} + } + +# adjust +$adjusted_datamin = $datamin - ($datamax-$datamin)/2 * 0.1; +$adjusted_datamax = $datamax + ($datamax-$datamin)/2 * 0.1; + +$graph1 = BoxPlot($low[0], $Q1[0], $medn[0], $Q3[0], $high[0], + winmin=>$adjusted_datamin, winmax=>$adjusted_datamax, + $low[0], $high[0], axis=>0, 'min', '', '', '', 'max'); + +$datalabel = new Label(110, 17, $datasets[0], 'black','center','center'); +$graph1->lb($datalabel); + +$graph2 = BoxPlot($low[1], $Q1[1], $medn[1], $Q3[1], $high[1], + winmin=>$adjusted_datamin, winmax=>$adjusted_datamax, + $low[1], $high[1], axis=>0, 'min', '', '', '', 'max'); + +$datalabel = new Label(110, 17, $datasets[1], 'black','center','center'); +$graph2->lb($datalabel); + +$graph3 = BoxPlot($low[2], $Q1[2], $medn[2], $Q3[2], $high[2], + winmin=>$adjusted_datamin, winmax=>$adjusted_datamax, + $low[2], $high[2], 'min', '', '', '', 'max'); + +$datalabel = new Label(110, 17, $datasets[2], 'black','center','center'); +$graph3->lb($datalabel); + +#The answer box +$cmc = new_checkbox_multiple_choice(); +$cmc -> qa (@corr); +$cmc -> extra (@incorr); + +BEGIN_TEXT +Data from three data sets are plotted in box plots for comparison. $PAR +$BCENTER +\{ Plot($graph1, tex_size=>900); \} +\{ Plot($graph2, tex_size=>900); \} +\{ Plot($graph3, tex_size=>900); \} +$ECENTER +$PAR +$BR +\{$cmc -> print_q \} +\{$cmc -> print_a \} +$BR + +END_TEXT + +ANS( checkbox_cmp( $cmc->correct_ans )); + + + +###################################### +BEGIN_SOLUTION + +Option \{$cmc->correct_ans\}. + +END_SOLUTION +####################################### + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/DisplayingData/FiveNumAndPlot.pg b/Contrib/PCC/Statistics/DisplayingData/FiveNumAndPlot.pg new file mode 100644 index 0000000000..5323258ac7 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/FiveNumAndPlot.pg @@ -0,0 +1,80 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## KEYWORDS('boxplot', 'five number summary') +## Author('Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/6/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PG.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGgraphmacros.pl", + "extraAnswerEvaluators.pl", + "PGnauStats.pl", + "parserPopUp.pl", +); + +TEXT(&beginproblem) ; +$showPartialCorrectAnswers = 1; + +push @dat, random(15, 30,1); +push @dat, random(35, 43,1); +push @dat, random(45, 70,1); +push @dat, random(72, 85,1); +push @dat, random(89, 100,1); + + +@names = ('Min', 'Q_{1}', 'Median', 'Q_{3}', 'Max'); +@labels = ('', '', '', '', ''); +@slice = NchooseK(5,3); + +$labels[$slice[0]] = 'Z'; +$labels[$slice[1]] = 'Y'; +$labels[$slice[2]] = 'X'; + +$popup0 = PopUp(["?", @names, "Mean", "Left Pivot", "Right Pivot"], $names[$slice[0]]); +$popup1 = PopUp(["?", @names, "Mean", "Left Pivot", "Right Pivot"], $names[$slice[1]]); +$popup2 = PopUp(["?", @names, "Mean", "Left Pivot", "Right Pivot"], $names[$slice[2]]); + + +$graph = BoxPlot(@dat, @labels); + +BEGIN_TEXT +Consider the following box and whisker plot. +$PAR +$BCENTER +\{Plot($graph);\} +$ECENTER +$labels[$slice[0]] is the \{ $popup0->menu() \} +$PAR +$labels[$slice[1]] is the \{ $popup1->menu() \} +$PAR +$labels[$slice[2]] is the \{ $popup2->menu() \} +$PAR +END_TEXT + +ANS( $popup0->cmp() ); +ANS( $popup1->cmp() ); +ANS( $popup2->cmp() ); + +###################################### +BEGIN_SOLUTION + +The markers from left to right on a boxplot are the minimum, \(Q_{1}\), the median, \(Q_{3}\) and the maximum. The mean can be estimated but we cannot find it explicitely based on just a boxplot. As such, we have the following, +$PAR +(a) $labels[$slice[0]] is the $popup0 +$PAR +(b) $labels[$slice[1]] is the $popup1 +$PAR +(c) $labels[$slice[2]] is the $popup2 + +END_SOLUTION +####################################### +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/DisplayingData/FiveNumFromPlot.pg b/Contrib/PCC/Statistics/DisplayingData/FiveNumFromPlot.pg new file mode 100644 index 0000000000..e14a4da465 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/FiveNumFromPlot.pg @@ -0,0 +1,61 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## KEYWORDS('boxplot', 'five number summary') +## Author('Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/6/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGnauStats.pl", + "MathObjects.pl", +); + +TEXT(&beginproblem) ; +$showPartialCorrectAnswers = 1; + +push @dat, random(15, 30,1); +push @dat, random(35, 43,1); +push @dat, random(45, 70,1); +push @dat, random(72, 85,1); +push @dat, random(89, 100,1); + +$graph = BoxPlot(@dat, @dat); + +@slice = num_sort(NchooseK(5,2)); + +@labels = ("Minimum", "First quartile", "Median", "Third quartile", "Maximum"); +@questions = @labels[@slice]; + +BEGIN_TEXT +Consider the following box and whisker plot. Find the indicated values of the represented data.$PAR +$BCENTER +\{Plot($graph);\} +$ECENTER +$PAR +$questions[0]: \{ans_rule(5) \}$BR +$questions[1]: \{ans_rule(5) \}$BR + +END_TEXT + +ANS(Compute($dat[$slice[0]])->cmp); +ANS(Compute($dat[$slice[1]])->cmp); + + +############################# +BEGIN_SOLUTION + +The markers from left to right on a boxplot are the minimum, quartile \(1\), the median, quartile \(3\) and the maximum. As such, we have the following, +$PAR +(a) The $questions[0] is \($dat[$slice[0]]\) +$PAR +(b) The $questions[1] is \($dat[$slice[1]]\) +END_SOLUTION +############################# +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/DisplayingData/Ref_1_1.gif b/Contrib/PCC/Statistics/DisplayingData/Ref_1_1.gif new file mode 100644 index 0000000000..eb14d322f7 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/Ref_1_1.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/Ref_1_2.gif b/Contrib/PCC/Statistics/DisplayingData/Ref_1_2.gif new file mode 100644 index 0000000000..5aa5baf094 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/Ref_1_2.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/Ref_1_4.gif b/Contrib/PCC/Statistics/DisplayingData/Ref_1_4.gif new file mode 100644 index 0000000000..197e2c952b Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/Ref_1_4.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/Ref_1_5.gif b/Contrib/PCC/Statistics/DisplayingData/Ref_1_5.gif new file mode 100644 index 0000000000..1151518cb0 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/Ref_1_5.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/Ref_1_6.gif b/Contrib/PCC/Statistics/DisplayingData/Ref_1_6.gif new file mode 100644 index 0000000000..2452fad412 Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/Ref_1_6.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/Ref_1_7.gif b/Contrib/PCC/Statistics/DisplayingData/Ref_1_7.gif new file mode 100644 index 0000000000..9234adbe0b Binary files /dev/null and b/Contrib/PCC/Statistics/DisplayingData/Ref_1_7.gif differ diff --git a/Contrib/PCC/Statistics/DisplayingData/easy_histogram.pg b/Contrib/PCC/Statistics/DisplayingData/easy_histogram.pg new file mode 100644 index 0000000000..be79af6ed7 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/easy_histogram.pg @@ -0,0 +1,75 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## KEYWORDS('histogram') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/11/05 +# Problem Author: +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGnauStats.pl", + "PGstatisticsmacros.pl", + "PGnumericalmacros.pl", + "MathObjects.pl", + "contextPercent.pl", +); +TEXT(&beginproblem); + +$n = 50; +$max = random( 29, 44, 5 ); +for( $i = 0; $i < $n; $i++ ){ $val = random( 0, $max, 1 ); + push @list, $val; +} +$name = list_random( 'Mathematics and Statistics', 'Chemistry', 'Biology', 'English' ); +$num = random( 5, $max - 10, 5 ); +@dir = ( $num.' or more ', ' less than '.$num ); +$ind = random( 0, 1 ); +foreach $val(@list){ + if( $val < $num ){ push @newlist1, $val + }else{ push @newlist2, $val } +} +if( $ind == 0 ){ $ans1 = ( 100 * scalar( @newlist2 ) ) / $n; +}else{ $ans1 = ( 100 * scalar( @newlist1 ) ) / $n;} + +if( $ind == 0 ){ $tot = ( scalar( @newlist2 ) ); +}else{ $tot = ( scalar( @newlist1 ) );} + + +BEGIN_TEXT + +The histogram below gives the length of service of members of the Department of $name at a particular +university. The classes, in years of service, are \(0-5\), \(5-10\), etc., and the vertical axis represents the +number of faculty in each bin. +$PAR + +What percent of the department faculty have $dir[$ind] years of service?$BR + +$PAR +$BCENTER +\{ Plot( Histogram( @list, bins => ( $max + 1 ) / 5, axislabel => 'Years of Service', + labelcount => $n, title => $name.' Faculty' ) ) \} +$ECENTER +$PAR + +\{ans_rule( 15 )\} of the department faculty have $dir[$ind] years of service. + +END_TEXT + +Context("Percent"); +ANS( Percent( $ans1/100 )->cmp ); + +############################# +BEGIN_SOLUTION + +We first need to find the total number of faculty, which \($n\). Then, we need to how many of those \($n\) have $dir[$ind] years of service. In this case, \($tot\) faculty have $dir[$ind] years of service, meaning \($ans1$PERCENT\) have $dir[$ind] years of service. +END_SOLUTION +############################# + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/DisplayingData/gust11.pg b/Contrib/PCC/Statistics/DisplayingData/gust11.pg new file mode 100644 index 0000000000..b8f06d6a1b --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/gust11.pg @@ -0,0 +1,137 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('What is Statistics?') +##DBsection('Characterizing a Set of Measurements: Numerical Methods') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +$r[0]=[random(1,6,1), random(1,7,1), random(1,6,1), random(1,7,1), random(1,7,1), random(1,1,1), random(1,6,1), random(2,6,1)]; +$r[1]=[random(1,5,1), random(2,6,1), random(3,5,1), random(1,7,1), random(1,7,1), random(1,7,1), random(1,7,1), random(1,7,1)]; +$r[2]=[random(3,5,1), random(1,4,1), random(1,7,1), random(1,4,1), random(1,7,1), random(3,5,1), random(1,5,1), random(2,6,1)]; +$r[3]=[random(1,5,1), random(1,5,1), random(1,7,1), random(1,7,1), random(1,7,1), random(2,6,1), random(1,7,1), random(2,6,1)]; +$r[4]=[random(1,7,1), random(1,5,1), random(1,4,1), random(3,5,1), random(1,7,1), random(1,7,1), random(3,5,1), random(2,6,1)]; + +@cnts=(0,0,0,0,0,0,0,0,0); +for $j (0..4) { + for $k (0..7) { + $cnts[$r[$j][$k]] += 1; + } +} + +$a = $cnts[1]; +$b = $cnts[2]; +$c = $cnts[3]; +$d = $cnts[4]; +$e = $cnts[5]; +$f = $cnts[6]; +$g = $cnts[7]; +$total = 40; + +$ans1= $a/$total; +$ans2= $b/$total; +$ans3= $c/$total; +$ans4= $d/$total; +$ans5= $e/$total; +$ans6= $f/$total; +$ans7= $g/$total; + +BEGIN_TEXT + +The U.S. Bureau of the Census conducts nationwide sureys on characteristics of U.S. households. The following are data on the number of people per household for a sample of \(40\) households. Construct a frequency and relative frequency table for these household sizes. (Relative frequencies may be entered as decimals, as with \(0.5\), or as percentages, as with \(50$PERCENT\).) +$PAR +$BCENTER +\{begintable(8)\} +\{row(@{$r[0]})\} +\{row(@{$r[1]})\} +\{row(@{$r[2]})\} +\{row(@{$r[3]})\} +\{row(@{$r[4]})\} +\{endtable()\} +$ECENTER + +$PAR +$BCENTER +\{begintable(3)\} +\{row("Household size", "Frequency", "Relative Frequency")\} +\{row("\(1\)", ans_rule(10), ans_rule(10))\} +\{row("\(2\)", ans_rule(10), ans_rule(10))\} +\{row("\(3\)", ans_rule(10), ans_rule(10))\} +\{row("\(4\)", ans_rule(10), ans_rule(10))\} +\{row("\(5\)", ans_rule(10), ans_rule(10))\} +\{row("\(6\)", ans_rule(10), ans_rule(10))\} +\{row("\(7\)", ans_rule(10), ans_rule(10))\} +\{row("${BBOLD}Total${EBOLD}", "\($total\)", "\(1\)")\} +\{endtable()\} +$ECENTER +END_TEXT + +Context("Percent"); + +ANS(Compute($a)->cmp); +ANS(Percent($ans1)->cmp); +ANS(Compute($b)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Compute($c)->cmp); +ANS(Percent($ans3)->cmp); +ANS(Compute($d)->cmp); +ANS(Percent($ans4)->cmp); +ANS(Compute($e)->cmp); +ANS(Percent($ans5)->cmp); +ANS(Compute($f)->cmp); +ANS(Percent($ans6)->cmp); +ANS(Compute($g)->cmp); +ANS(Percent($ans7)->cmp); + + +############################# +BEGIN_SOLUTION + +$BCENTER +\{begintable(3)\} +\{row("Household size", "Frequency", "Relative Frequency")\} +\{row("\(1\)", "\($a\)", "\($ans1\)")\} +\{row("\(2\)", "\($b\)", "\($ans2\)")\} +\{row("\(3\)", "\($c\)", "\($ans3\)")\} +\{row("\(4\)", "\($d\)", "\($ans4\)")\} +\{row("\(5\)", "\($e\)", "\($ans5\)")\} +\{row("\(6\)", "\($f\)", "\($ans6\)")\} +\{row("\(7\)", "\($g\)", "\($ans7\)")\} +\{row("${BBOLD}Total${EBOLD}", "\($total\)", "\(1\)")\} +\{endtable()\} +$ECENTER +END_SOLUTION +############################# + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/DisplayingData/gust30.pg b/Contrib/PCC/Statistics/DisplayingData/gust30.pg new file mode 100644 index 0000000000..ebdedb3513 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/gust30.pg @@ -0,0 +1,59 @@ +##DESCRIPTION +## Statistics: Characterizing a Set of Measurements +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('What is Statistics?') +##DBsection('Characterizing a Set of Measurements: Graphical Methods') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Which of the following is useful for qualitative data?", "Bar graph"); +$mc->extra("Histogram", "Dot plot"); +$mc->makeLast("All of the above", "None of the above"); + +BEGIN_TEXT +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + +############################# +BEGIN_SOLUTION + +Option \(\{ $mc->correct_ans \}\). Qualitative data should only be used with bar graph and circle graphs. + +END_SOLUTION +############################# + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/DisplayingData/histogram1.pg b/Contrib/PCC/Statistics/DisplayingData/histogram1.pg new file mode 100644 index 0000000000..b445d1a409 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/histogram1.pg @@ -0,0 +1,76 @@ +##DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Exploratory data analysis/descriptive statistics) +## DBsection(Description of distributions) +## Institution(NAU) +## Author(N.Spencer Sitton) +## Level(3) +## KEYWORDS('histogram') +##ENDDESCRIPTION + +# File Created: 07/12/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGnauStats.pl", + "PGstatisticsmacros.pl", + "PGnumericalmacros.pl" +); + + +TEXT(&beginproblem); + +@data = ( 'mean daily temperature in June for a particular city', 'mean daily temperature in November + for a particular city', 'age of incoming freshmen students at a particular high school', + 'age of graduating high school seniors at a particular high school' ); +$ind = random( 0, 3, 1 ); +@list2 = ( 'mean', 'median' ); +@slice = NchooseK( 2, 2); + +if( $ind == 0 ){ @list1 = SpecialData( 'left', count => 30, min => random(86,91,1), max => random(100,105,1) ); + $Hist = Histogram( @list1, bins => 10, axislabel => 'Temperature(F)', title =>'Mean Daily Temperature in June' ); +} +elsif( $ind == 1 ){ @list1 = SpecialData( 'right', count => 30, min => random(36,41,1), max =>random(50,55,1) ); + $Hist = Histogram( @list1, bins => 10, axislabel => 'Temperature(F)', title =>'Mean Daily Temperature in November' ); +} +elsif( $ind == 2 ){ @list1 = SpecialData( 'right', count => 500, min => 14.5, max => 17.5 ); + $Hist = Histogram( @list1, axislabel => 'Age(years)', title =>'Age of Incoming High school Freshmen' ); +} +elsif( $ind == 3 ){ @list1 = SpecialData( 'left', count => 500, min => 16, max => 19 ); + $Hist = Histogram( @list1, axislabel => 'Age(years)', title =>'Age of High School Seniors at Graduation' ); +} +if( $slice[0] == 0 ){ + if( $ind == 0 || $ind == 3 ){ $ans = 'less than the median'; + } else{ $ans = 'greater than the median'; + } +}else{if( $ind == 0 || $ind == 3 ){ $ans = 'greater than the mean'; + } else{ $ans = 'less than the mean'; + } +} +BEGIN_TEXT + +The Histogram below gives the $data[$ind].$BR +Based on the given distribution the $list2[$slice[0]] is +\{ pop_up_list(''=>'', 'less than the '.$list2[$slice[1]] => 'less than the '.$list2[$slice[1]], +'equal to the '.$list2[$slice[1]] => 'equal to the '.$list2[$slice[1]], +'greater than the '.$list2[$slice[1]] => 'greater than the '.$list2[$slice[1]], +'may fall anywhere relative to the '.$list2[$slice[1]] => 'may fall anywhere relative to the '.$list2[$slice[1]] ) \} +$PAR +$PAR \{ Plot( $Hist, tex_size=>900) \} + +END_TEXT + +ANS( str_cmp( $ans ) ); + +###################################### +BEGIN_SOLUTION + +Based on the given distribution the $list2[$slice[0]] is $ans. Recall that anytime our distribution is skewed right we would expect the mean to be larger than the median and anytime the distribution is skewed left we expect the mean to be smaller than the median. + +END_SOLUTION +####################################### + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/DisplayingData/skew_dist1.pg b/Contrib/PCC/Statistics/DisplayingData/skew_dist1.pg new file mode 100644 index 0000000000..f0ac68cf84 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/skew_dist1.pg @@ -0,0 +1,73 @@ +##DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Exploratory data analysis/descriptive statistics) +## DBsection(Description of distributions) +## Institution(NAU) +## Author(N.Spencer Sitton) +## Level(2) +## KEYWORDS('skew') +##ENDDESCRIPTION + +# File Created: 06/20/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGchoicemacros.pl" +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 0; +$mc = new_multiple_choice(); + +$city = list_random( 'Tucson', 'Phoenix', 'Flagstaff', 'Salt Lake City', 'Pleasent Grove' ); +@dir = ( 'left', 'right'); +$ind = random( 0, 1, 1 ); +$median = random( 150000, 350000, 10000 ); + +$th = int( $median / 1000 ); +$h = int( ( $median - ($th * 1000) ) / 100 ); +$t = int ( ( $median - ( $th * 1000 ) - ( $h * 100) ) / 10 ); +$o = int ( $median - ( $th * 1000 ) - ( $h * 100) - ( $t * 10 ) ); +$nmedian = $DOLLAR.$th.','.$h.$t.$o; + +if( $ind == 0 ){ + $mc -> qa( 'Specify the general location of the mean.', + 'lower than $nmedian' + ); + $mc -> extra( 'higher than $nmedian', + 'equal to $nmedian', + 'it may fall anywhere to $nmedian' + ); +}else{ + $mc -> qa( 'Specify the general location of the mean.', + 'higher than $nmedian' + ); + $mc -> extra( 'lower than $nmedian', + 'equal to $nmedian', + 'it may fall anywhere relative to $nmedian' + ); +} + +BEGIN_TEXT + +The distribution of home prices in $city is skewed to the $dir[$ind]. The median price is $nmedian. +\{ $mc -> print_q \} +$BR +\{ $mc -> print_a \} + +END_TEXT + +ANS( str_cmp( $mc -> correct_ans ) ); + +############################# +BEGIN_SOLUTION + +Option \(\{ $mc->correct_ans \}\). Recall that anytime a distribution is skewed to the left the mean is generally less, or smaller, than the median and anytime a distribution is skewed to the right the mean is generally more, or greater, than the median. + +END_SOLUTION +############################# + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/DisplayingData/stat212-HW01-17.pg b/Contrib/PCC/Statistics/DisplayingData/stat212-HW01-17.pg new file mode 100644 index 0000000000..27b8e8f939 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/stat212-HW01-17.pg @@ -0,0 +1,157 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics', 'stem and leaf') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## Date('5/25/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$b1 = random(1,4,1); +$b = 10*$b1; +$b2 = $b1 + 2; + +$c[0] = random(0,2,1); +$data[0] = $b + $c[0]; +$c[1] = $c[0]; +$data[1] = $data[0]; +$t = random(1,3,1); +$data[2] = $data[1] + $t; +$c[2] = $t + $c[1]; +$t = random(1,3,1); +$data[3] = $data[2] + $t; +$c[3] = $t + $c[2]; +$ans[1] = "$c[0]"."$c[1]"."$c[2]"."$c[3]"; + +$c[4] = 0; +$data[4] = $b + 10; +$c[5] = random(2,7,1); +$data[5] = $data[4] + $c[5]; +$c[6] = $c[5]; +$data[6] = $data[5]; +$c[7] = $c[6]; +$data[7] = $data[6]; +$t = random(1,2,1); +$data[8] = $data[7] + $t; +$c[8] = $t + $c[7]; +$ans[2] = "$c[4]"."$c[5]"."$c[6]"."$c[7]"."$c[8]"; + +$c[9] = random(3,6,1); +$data[9] = $b + 20 + $c[9]; +$t = random(0,2,1); +$data[10] = $data[9] + $t; +$c[10] = $t + $c[9]; +$c[11] = 9; +$data[11] = $b + 20 + $c[11]; +$c[12] = $c[11]; +$data[12] = $data[11]; +$ans[3] = "$c[9]"."$c[10]"."$c[11]"."$c[12]"; + +$c[13] = random(0,4,1); +$data[13] = $b + 30 + $c[13]; +$c[14] = random(8,9,1); +$data[14] = $b + 30 + $c[14]; +$ans[4] = "$c[13]"."$c[14]"; + +$c[15] = random(0,3,1); +$data[15] = $b + 40 + $c[15]; +$t = random(0,3,1); +$data[16] = $data[15] + $t; +$c[16] = $t + $c[15]; +$t = random(0,3,1); +$data[17] = $data[16] + $t; +$c[17] = $t + $c[16]; +$ans[5] = "$c[15]"."$c[16]"."$c[17]"; + +@slice = NchooseK(18,18); +@a = @data[@slice]; + +$b1is=$b1+1; +$b2is=$b2+1; +$b2iss=$b2+2; + +BEGIN_TEXT +$PAR Consider the following data set: +$PAR +\[ +\begin{array}{ccccccccc} +$a[0] & $a[1] & $a[2] & $a[3] & $a[4] & $a[5] & $a[6] & $a[7] & $a[8]\\ +$a[9] & $a[10] & $a[11] & $a[12] & $a[13] & $a[14] & $a[15] & $a[16] & $a[17] +\end{array} +\] +$BR +Below is a partially completed stem plot for this data set: + +$PAR +$BCENTER +\{begintable(2)\} +\{row("\($b1\)", ans_rule(20))\} +\{row(ans_rule(3), ans_rule(20))\} +\{row("\($b2\)", ans_rule(20))\} +\{row(ans_rule(3), "\($ans[4]\)")\} +\{row(ans_rule(3), ans_rule(20))\} +\{endtable()\} +$ECENTER +$PAR + +Determine the correct values for the missing entries, and fill them in. Do not use any commas; spaces are OK if you'd like to use them though. + + + +$PAR + +END_TEXT + +ANS(str_cmp($ans[1],'remove_whitespace')); +ANS(num_cmp($b1 + 1)); +ANS(str_cmp($ans[2],'remove_whitespace')); +ANS(str_cmp($ans[3],'remove_whitespace')); +ANS(num_cmp($b2 + 1)); +ANS(num_cmp($b2 + 2)); +ANS(str_cmp($ans[5],'remove_whitespace')); + +################################ +BEGIN_SOLUTION + +$PAR +$BCENTER +\{begintable(2)\} +\{row("\($b1\)", "\($ans[1]\)")\} +\{row("\($b1is\)", "\($ans[2]\)")\} +\{row("\($b2\)", "\($ans[3]\)")\} +\{row("\($b2is\)", "\($ans[4]\)")\} +\{row("\($b2iss\)", "\($ans[2]\)")\} +\{endtable()\} +$ECENTER +$PAR +END_SOLUTION +################################ + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/DisplayingData/stat212-HW01-18.pg b/Contrib/PCC/Statistics/DisplayingData/stat212-HW01-18.pg new file mode 100644 index 0000000000..bcee0d3b99 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/stat212-HW01-18.pg @@ -0,0 +1,176 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics', 'stem and leaf') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## Date('5/25/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$b1 = random(15,19,1); +$b = 10*$b1; +$b2 = $b1 + 1; + +$c[0] = random(0,1,1); +$data[0] = $b + $c[0]; +$t = $c[0] + 1; +$data[1] = $data[0] + $t; +$c[1] = $c[0] + $t; +$data[2] = $data[1]; +$c[2] = $c[1]; +$t = random(1,2,1); +$data[3] = $data[2] + $t; +$c[3] = $t + $c[2]; +$data[4] = $data[3]; +$c[4] = $c[3]; +if ($c[3] == 5) { + $ans[1] = "$c[0]"."$c[1]"."$c[2]"; +} +else { + $ans[1] = "$c[0]"."$c[1]"."$c[2]"."$c[3]"."$c[4]"; +} + +$c[5] = 5; +$data[5] = $b + 5; +$t = 5 + random(1,2,1); +$data[6] = $b + $t; +$c[6] = $t; +$data[7] = $data[6]; +$c[7] = $c[6]; +$t = 5 + random(3,4,1); +$data[8] = $b + $t; +$c[8] = $t; +$data[9] = $data[8]; +$c[9] = $c[8]; +if ($c[3] == 5) { + $ans[2] = "$c[3]"."$c[4]"."$c[5]"."$c[6]"."$c[7]"."$c[8]"."$c[9]"; +} +else { + $ans[2] = "$c[5]"."$c[6]"."$c[7]"."$c[8]"."$c[9]"; +} + +$ans[3] = ""; + +$c[10] = random(5,7,1); +$data[10] = $b + 10 + $c[10]; +$data[11] = $data[10]; +$c[11] = $c[10]; +$data[12] = $data[11]; +$c[12] = $c[11]; +$t = random(7,9,1); +$data[13] = $b + 10 + $t; +$c[13] = $t; +$data[14] = $data[13]; +$c[14] = $c[13]; +$ans[4] = "$c[10]"."$c[11]"."$c[12]"."$c[13]"."$c[14]"; + +$c[15] = random(0,2,1); +$data[15] = $b + 20 + $c[15]; +$c[16] = random(2,3,1); +$data[16] = $b + 20 + $c[16]; +$c[17] = $c[16]; +$data[17] = $data[16]; +$c[18] = $c[17]; +$data[18] = $data[17]; +$c[19] = $c[18]+1; +$data[19] = $b + 20 + $c[19]; +$ans[5] = "$c[15]"."$c[16]"."$c[17]"."$c[18]"."$c[19]"; + +$c[20] = random(5,7,1); +$data[20] = $b + 20 + $c[20]; +$c[21] = random(7,9,1); +$data[21] = $b + 20 + $c[21]; +$ans[6] = "$c[20]"."$c[21]"; + +@slice = NchooseK(22,22); +@a = @data[@slice]; + +$b2is=$b2+1; + +BEGIN_TEXT +$PAR Consider the following data set: +$PAR +\[ +\begin{array}{ccccccccccc} +$a[0] & $a[1] & $a[2] & $a[3] & $a[4] & $a[5] & $a[6] & $a[7] & $a[8]& $a[9] & $a[10] \\ +$a[11] & $a[12] & $a[13] & $a[14] & $a[15] & $a[16] & $a[17] & $a[18] & $a[19] & $a[20] & $a[21] +\end{array} +\] +$BR +Below is a partially completed split stem plot for this data set: + +$PAR +$BCENTER +\{begintable(2)\} +\{row("\($b1\)", ans_rule(20))\} +\{row("\($b1\)", ans_rule(20))\} +\{row(ans_rule(3), ans_rule(20))\} +\{row("\($b2\)", ans_rule(20))\} +\{row(ans_rule(3), ans_rule(20))\} +\{row(ans_rule(3), ans_rule(20))\} +\{endtable()\} +$ECENTER +$PAR + +Determine the correct values for the missing entries, and fill them in. Do not use any commas; spaces are OK if you'd like to use them though. + + +END_TEXT + +ANS(str_cmp($ans[1],'remove_whitespace')); +ANS(str_cmp($ans[2],'remove_whitespace')); +ANS(num_cmp($b2)); +ANS(str_cmp($ans[3],'remove_whitespace')); +ANS(str_cmp($ans[4],'remove_whitespace')); +ANS(num_cmp($b2+1)); +ANS(str_cmp($ans[5],'remove_whitespace')); +ANS(num_cmp($b2+1)); +ANS(str_cmp($ans[6],'remove_whitespace')); + +################################ +BEGIN_SOLUTION + +$PAR +$BCENTER +\{begintable(2)\} +\{row("\($b1\)", "\($ans[1]\)")\} +\{row("\($b1\)", "\($ans[2]\)")\} +\{row("\($b2\)", "\($ans[3]\)")\} +\{row("\($b2\)", "\($ans[4]\)")\} +\{row("\($b2is\)", "\($ans[5]\)")\} +\{row("\($b2is\)", "\($ans[6]\)")\} +\{endtable()\} +$ECENTER +$PAR + +END_SOLUTION +################################ + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/DisplayingData/stat212-HW02-01.pg b/Contrib/PCC/Statistics/DisplayingData/stat212-HW02-01.pg new file mode 100644 index 0000000000..e48aae7a13 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/stat212-HW02-01.pg @@ -0,0 +1,141 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics', 'mean', 'median') +## naw tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## Date('06/01/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('Which of the following statements about the mean is $BITALIC not$EITALIC always correct?', + 'Half of the observations are on either side of the mean' +); +$mc[1]->extra( + 'The sum of the deviations from the mean is zero', + 'The mean is a measure of the middle (center) of a distribution', + 'The value of the mean times the number of observations equals the sum of all of the observations' +); + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('In a histogram, the proportion of the total area which must be to the left +of the median is: ', + 'exactly \(0.50\)' +); +$mc[2]->extra( + 'less than \(0.50\) if the distribution is skewed to the left', + 'more than \(0.50\) if the distribution is skewed to the right', + 'between \(0.25\) and \(0.60\) if the distribution is symmetric and unimodal' +); + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('Which of the following statements is true?', + 'The sum of the deviations from the mean is always zero' +); +$mc[3]->extra( + 'The sum of the squared deviations from the mean is always zero', + 'The mean is always less than the geometric mean', + 'The standard deviation is always less than the variance', + 'The distance between the first and third quartiles is twice the distance between + the first quartile and the median' +); + + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('If two data sets have the same range:', + 'the distances from the smallest to largest observations in both sets will be the same' +); +$mc[4]->extra( + 'the smallest and the largest observations are the same in both sets', + 'both sets will have the same mean', + 'both sets will have the same interquartile range' +); + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('Which of the following statements is true?', + 'When the distribution is symmetric and unimodal, mean \(=\) median \(=\) mode' +); +$mc[5]->extra( + 'When the distribution is skewed to the left, mean \(>\) median \(>\) mode', + 'When the distribution is skewed to the right, mean \(<\) median \(<\) mode', + 'When the distribution is symmetric and bimodal, mean \(=\) median \(=\) mode' +); + +$a = random(1,5,1); +$b = random(1,5,1); +while ($a == $b) { + $b = random(1,5,1); +} + +@solutions = ("$BITALIC If $EITALIC we have a symmetric distribution, we could assume that half of the observations are on either side of the mean. Since it depends on the distribution, this statement is not always true. The mean $BITALIC is always $EITALIC a measure of the middle (center) of a distribution, but it might not be a good one!", + +"Since the median is $BITALIC always $EITALIC the middle, no matter the distribution, the proportion of the total area to the left if the median is \(0.50\).", + +"The sum of the deviations from the mean is always zero. No matter what the set of data, if we sum up the difference between the mean and every piece of data it will always be \(0\). It is tempting to say the standard deviation is always less than the variance, but we could have the variance be \(1\) and thus the standard deviation would also be \(1\), or any variance that is less than \(1\) would have a standard deviation greater than it. We cannot say the distance between the first and third quartiles is twice the distance between the first quartile and the median since quartiles deal in percent and thus we cannot comment on the distance in the numeric sense.", + +"The distances from the smallest to largest observations in both sets will be the same. We cannot say the mean and IQR will be the same since we don't know the data. We cannot say the smallest and the largest observations are the same in both sets, since we could have, \(120-20=100\) and \(200-100=100\).", + +"When the distribution is symmetric and unimodal, mean \(=\) median \(=\) mode. Unimodal means one peak or high point, thus the same does not hold for a bimodal graph, which would have two peaks or high points. When the distribution is skewed to the left, we should actually expect mean \(<\) median and when the distribution is skewed to the right, we should expect mean \(>\) median.", + +); + +$ssols1 = (@solutions[$a-1]); +$ssols2 = (@solutions[$b-1]); + +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$a] -> correct_ans\}\). $ssols1 + +$PAR + +(b) Option \(\{$mc[$b] -> correct_ans\}\). $ssols2 + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/DisplayingData/stat212-HW02-03.pg b/Contrib/PCC/Statistics/DisplayingData/stat212-HW02-03.pg new file mode 100644 index 0000000000..682e2f6463 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/stat212-HW02-03.pg @@ -0,0 +1,148 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics') +## naw tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Chebyshevs Theorem') +## Date('06/01/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('Chebyshevs Theorem states that the percentage of measurements +in a data set that fall within three standard deviations of their mean is: ', + 'at least 89$PERCENT' +); +$mc[1]->extra( + '75$PERCENT', + 'at least 75$PERCENT', + '89$PERCENT' +); + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('The Empirical Rule states that the approximate percentage of +measurements in a data set (providing that the data set has a bell-shaped distribution) +that fall within two standard deviations of their mean is approximately:', + '\(95$PERCENT\)' +); +$mc[2]->extra( + '\(68$PERCENT\)', + '\(75$PERCENT\)', + '\(99$PERCENT\)' +); + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('Which of the following summary measures is affected most by outliers?', + 'The range' +); +$mc[3]->extra( + 'The median', + 'The geometric mean', + 'The interquartile range' +); + +$mc[3]->makeLast( + 'All of the above' +); + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('Since the population is always larger than the sample, the population mean:', + 'can be smaller than, larger than, or equal to the sample mean' +); +$mc[4]->extra( + 'is always larger than the sample mean', + 'is always larger than or equal to the sample mean', + 'is always smaller than the sample mean', + 'is always smaller than or equal to the sample mean' +); + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('Which of the following summary measures cannot be easily +approximated from a box-and-whisker plot?', + 'The standard deviation' +); +$mc[5]->extra( + 'The range', + 'The interquartile range', + 'The second quartile' +); + +$mc[5]->makeLast( + 'All of the above' +); + +$a = random(2,5,1);#rule out Chebyshev question +$b = random(2,5,1); +while ($a == $b) { + $b = random(2,5,1); +} + +@solutions = ("The Empirical Rule states that the \(95$PERCENT\) of observations in a data set (providing that the data set has a bell-shaped distribution) fall within two standard deviations of the mean.", + +"While the mean is naturally the most affected by outliers, the range is also affected greatly by outliers. The range is the differenence between the maximum and minimum. An outlier will greatly increase that difference.", + +"We know our population means is a ''fixed value'' single value. As such, it could be anything, and therefore when we take a sample, we could have the population mean be smaller than, larger than, or equal to the sample mean. We include the ''equal to'' in case of the scenario where the sample $BITAL is $EITAL the population.", + +"A box and whisker plot does not help us estimate the standard deviation since it shows our data in quartiles. Outlier may greatly affect the standard deviation and although we can see skew in a box and whisker plot it does not help us estiamte the standard deviation.", +); + +$ssols1 = (@solutions[$a-2]); +$ssols2 = (@solutions[$b-2]); + +##################################### +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$a] -> correct_ans\}\). $ssols1 + +$PAR + +(b) Option \(\{$mc[$b] -> correct_ans\}\). $ssols2 + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/DisplayingData/ur_stt_1_5.pg b/Contrib/PCC/Statistics/DisplayingData/ur_stt_1_5.pg new file mode 100644 index 0000000000..7f1754b4c9 --- /dev/null +++ b/Contrib/PCC/Statistics/DisplayingData/ur_stt_1_5.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## Frequency and Relative Frequency +## ENDDESCRIPTION + +## KEYWORDS('Frequency, 'Relative') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(1,10,1); +$b = random(1,20,1); +$c = random(1,20,1); +$d = random(10,15,1); +$e = random(10,15,1); +$f = random(1,10,1); +$total = $a+$b+$c+$d+$e+$f; + +Context("Percent"); +$ans1= Percent($a/$total); +$ans2= Percent($b/$total); +$ans3= Percent($c/$total); +$ans4= Percent($d/$total); +$ans5= Percent($e/$total); +$ans6= Percent($f/$total); + +BEGIN_TEXT + +Complete the table below. +\{begintable(3)\} +\{row("Books read within the past year", "Frequency", "Relative Frequency")\} +\{row("none", "\($a \)", ans_rule(10))\} +\{row("\(0-4\)", "\($b \)", ans_rule(10))\} +\{row("\(5-9\)", "\($c \)", ans_rule(10))\} +\{row("\(10-14\)", ans_rule(10), "\($ans4\)")\} +\{row("\(15-19\)", "\($e \)", ans_rule(10))\} +\{row("\(20-25\)", "\($f \)", ans_rule(10))\} +\{row("total", "\($total\)", "\(1\)")\} +\{endtable()\} + +END_TEXT +ANS(Compute($ans1)->cmp); +ANS(Compute($ans2)->cmp); +ANS(Compute($ans3)->cmp); +ANS(Compute($d)->cmp); +ANS(Compute($ans5)->cmp); +ANS(Compute($ans6)->cmp); + +################################ +BEGIN_SOLUTION + +$PAR +$BCENTER +\{begintable(3)\} +\{row("Books read within the past year", "Frequency", "Relative Frequency")\} +\{row("none", "\($a \)", "\($ans1 \)")\} +\{row("\(0-4\)", "\($b \)", "\($ans2 \)")\} +\{row("\(5-9\)", "\($c \)", "\($ans3 \)")\} +\{row("\(10-14\)", "\($d \)", "\($ans4\)")\} +\{row("\(15-19\)", "\($e \)", "\($ans5 \)")\} +\{row("\(20-25\)", "\($f \)", "\($ans6 \)")\} +\{row("total", "\($total\)", "\(1\)")\} +\{endtable()\} +$ECENTER +$PAR + +END_SOLUTION +################################ + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ExpectedValueAndVariance/ExpectedValue.pg b/Contrib/PCC/Statistics/ExpectedValueAndVariance/ExpectedValue.pg new file mode 100644 index 0000000000..95f1276964 --- /dev/null +++ b/Contrib/PCC/Statistics/ExpectedValueAndVariance/ExpectedValue.pg @@ -0,0 +1,64 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Expected Value') +## KEYWORDS('probability', 'Expected Value') +## Author('C. Tyler Diggans') +## Institution('NAU') +##ENDDESCRIPTION + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"contextCurrency.pl", +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); + +$a=Currency(random(45000,65000,5000)); +$b=Currency(random(8000,15000,1000)); +$c=Currency(random(20,50,5)); +$d=random(8000,12000,200); +$e=random(2,6,1); +$prob0 = ($d-1-$e); + +@gprize=('Mercedes Benz E350','BMW M3','Lexus GS'); +@sprize=('Ducati','Kawasaki','Honda'); +$prize1=list_random(@gprize); +$prize2=list_random(@sprize); + +$ans= ($a-$c)*(1/$d)+($b-$c)*($e/$d)-$c*($d-1-$e)/$d; +$ans = Currency(Round($ans->value,2)); + +BEGIN_TEXT +A charity holds a raffle in which each ticket is sold for \($c\). A total of \($d\) tickets are sold. They raffle one grand prize which is a $prize1 valued at \($a\) along with \($e\) second prizes of $prize2 motorcycles valued at \($b\) each. What are the expected winnings for a single ticket buyer? \{ans_rule(20)\} + +END_TEXT +ANS($ans->cmp); + +BEGIN_SOLUTION +Using the above situation, we can create a probability model as seen below, +$PAR +$BCENTER +\{begintable(4)\} +\{row("Outcome", "Nothing", "$prize2", "$prize1")\} +\{row("\(X\)", "-$c", "$b", "$a")\} +\{row("\(P(X)\)", "\(\frac{$prob0}{$d}\)", "\(\frac{$e}{$d}\)", "\(\frac{1}{$d}\)")\} +\{endtable()\} +$ECENTER +$PAR +Using this table we can find \(\text{E}(X)=\mu = (-$c \cdot \frac{$prob0}{$d}) + ($b \cdot \frac{1}{$d}) + ($a \cdot \frac{$e}{$d}) = $ans\). +END_SOLUTION +ENDDOCUMENT(); diff --git a/Contrib/PCC/Statistics/ExpectedValueAndVariance/expectedvalue1.pg b/Contrib/PCC/Statistics/ExpectedValueAndVariance/expectedvalue1.pg new file mode 100644 index 0000000000..c4032f2581 --- /dev/null +++ b/Contrib/PCC/Statistics/ExpectedValueAndVariance/expectedvalue1.pg @@ -0,0 +1,62 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Expected Value') +## KEYWORDS('probability') +## Author('') +## Institution('NAU') +##ENDDESCRIPTION + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); + +$a=Currency(random(5000,15000,500)); +$b=Currency(random(500,1500,100)); +$c=Currency(random(2,5,1)); +$d=random(8000,12000,200); +$prob0 = ($d-2); + +@gprize=('a Caribbean cruise','An Alaskan cruise','a European cruise'); +@sprize=('Las Vegas getaway','Rocky Point vacation','Weekend in San Diego'); +$prize1=list_random(@gprize); +$prize2=list_random(@sprize); + +$ans=($a-$c)*(1/$d)+($b-$c)*(1/$d)-$c*($d-2)/$d; +BEGIN_TEXT +A raffle has a grand prize of $prize1 valued at \($a\) with a second prize of a $prize2 valued at \($b\). If each ticket costs \($c\) and \($d\) tickets are sold, what are the expected winnings far a ticket buyer? Round to the nearest penny. \{ans_rule(20)\} + + +END_TEXT + +BEGIN_SOLUTION +Using the above situation, we can create a probability model as seen below, +$PAR +$BCENTER +\{begintable(4)\} +\{row("Outcome", "Nothing", "$prize2", "$prize1")\} +\{row("\(X\)", "-$c", "$b", "$a")\} +\{row("\(P(X)\)", "\(\frac{$prob0}{$d}\)", "\(\frac{1}{$d}\)", "\(\frac{1}{$d}\)")\} +\{endtable()\} +$ECENTER +$PAR +Using this table we can find \(\text{E}(X)=\mu = (-$c \cdot \frac{$prob0}{$d}) + ($b \cdot \frac{1}{$d}) + ($a \cdot \frac{1}{$d}) = $ans\). +END_SOLUTION + +ANS($ans->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/ExpectedValueAndVariance/exval3.pg b/Contrib/PCC/Statistics/ExpectedValueAndVariance/exval3.pg new file mode 100644 index 0000000000..c3a9537a2b --- /dev/null +++ b/Contrib/PCC/Statistics/ExpectedValueAndVariance/exval3.pg @@ -0,0 +1,84 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Expected Value') +## KEYWORDS('probability') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/27/05 +# from pl/setProbability17Expectation/p1.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); + +$a = Currency(random(30,50,5)/100); +$b = Currency(random(55,70,5)/100); +$c = Currency(random(75,95,5)/100); +$z = Currency(0); + +@s = ("spade","diamond","heart","club"); +@ss = ("spades","diamonds","hearts","clubs"); +@f = ("ace","jack","queen","king"); +@art = ("an","a","a","a"); + +$ind1 = random(0,3,1); +$res = $s[$ind1]; +$ress = $ss[$ind1]; +$ind2 = random(0,3,1); +$ref = $f[$ind2]; +$reart = $art[$ind2]; + +BEGIN_TEXT +Mark draws one card from a standard deck of \(52\). He receives \($a\) for a $res and +\($b\) for $reart $ref, but \($c\) for the $ref of $ress. How much could he pay to play this game per draw if he expects to break even in the long run? \{ans_rule(30)\} + +END_TEXT + +$ans = $a*(12/52)+$b*(3/52)+$c/52; + + +ANS(Currency($ans)->cmp); + +BEGIN_SOLUTION +Using the above situation, we can create a probability model as seen below, +$PAR +$BCENTER +\{begintable(5)\} +\{row("Outcome", "Nothing", "$res", "$reart $ref" , "$ref of $ress")\} +\{row("\(X\)", "$z", "$a", "$b" , "$c")\} +\{row("\(P(X)\)", "\(\frac{36}{52}\)", "\(\frac{12}{52}\)" , "\(\frac{3}{52}\)", "\(\frac{1}{52}\)")\} +\{endtable()\} +$ECENTER +$PAR +Note there are \(13\) $ref\(\)s in a deck, where you win \($a\), but if you pick the $ref of $ress, you win \($c\), thus there are only \(12\) ways to win \($a\). Similarly, there are \(4\) $reart $ref\(\)s, but if you pick the $ref of $ress, you win \($c\) thus there are only \(3\) ways to win \($b\). +$PAR +Since we want to break even in the long run, whatever the expected value is of winning, we should be willing to pay that much to break even in the long run. Thus we can find, +$PAR +\(\text{E}(X)=\mu = ($z \cdot \frac{36}{52}) + ($a \cdot \frac{12}{52}) + ($b \cdot \frac{3}{52}) + ($c \cdot \frac{1}{52})=$ans\). Thus we should be willing to spend \($ans\). +END_SOLUTION +ENDDOCUMENT(); + diff --git a/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-05.pg b/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-05.pg new file mode 100644 index 0000000000..decf92d691 --- /dev/null +++ b/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-05.pg @@ -0,0 +1,97 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'mean', 'variance', 'standard deviation') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('6/15/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a1 = random(.55,.60,.001); +$a2 = random(.10,.15,.001); +$a3 = random(.2,.225,.001); +$a4 = 0.001*floor(1000*(1-($a1+$a2+$a3))+.5); + +$b1 = random(-5,0,1); +$b2 = random(2,7,1); +$b3 = random(8,12,1); +$b4 = $b3; +while ($b4 == $b3) { + $b4 = random(8,12,1); +} +$c4 = (($b1*$a1)+($b2*$a2)+($b3*$a3)+($b4*$a4)); +$c5 = Real(((($b1-$c4)**2)*$a1)+((($b2-$c4)**2)*$a2)+((($b3-$c4)**2)*$a3)+((($b4-$c4)**2)*$a4)); +$c6 = Real($c5)**(0.5); + +BEGIN_TEXT +$PAR +Find the mean, variance and standard deviation for the probability distribution given below: + +$PAR +$BCENTER +\{begintable(5)\} +\{row("\(X\)", "\($b1\)", "\($b2\)", "\($b3\)", "\($b4\)")\} +\{row("\(P(X)\)", "\($a1\)", "\($a2\)", "\($a3\)", "\($a4\)")\} +\{endtable()\} +$ECENTER +$PAR +A. Mean = \{ans_rule(15)\} +$PAR +B. Variance = \{ans_rule(15)\} +$PAR +C. Standard Deviation = \{ans_rule(15)\} +$PAR + + + + +END_TEXT + + +ANS(Compute($c4)->cmp); +ANS(Compute($c5)->cmp); +ANS(Compute($c6)->cmp); + +BEGIN_SOLUTION +For a smaller model like this, we can find all values in question by hand. +$PAR +(a) \(\text{E}(X)=\mu = ($b1 \cdot $a1 ) +($b2 \cdot $a2 ) + ($b3 \cdot $a3 ) + ($b4 \cdot $a4 ) = $c4\) +$PAR +(b) If desired, we can find the variance by hand, +$PAR +\(\text{VAR}(X) = $a1($b1-$c4)^2 + $a2($b2-$c4)^2 + $a3($b3-$c4)^2 + $a4($b4-$c4)^2 \approx $c5\) +$PAR +(c) Since standard deviation is the square root of the variance, +$PAR +\(\sigma_{x} = \sqrt{$c5} \approx $c6\) +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-06.pg b/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-06.pg new file mode 100644 index 0000000000..37f1e78003 --- /dev/null +++ b/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-06.pg @@ -0,0 +1,111 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'mean', 'standard deviation') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('6/15/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); +Context("Currency"); + +$a1 = random(.20,.24,.001); +$a2 = random(.10,.15,.001); +$a3 = random(.10,.13,.001); +$a4 = random(.075,.10,.001); +$a5 = random(.05,.07,.001); +$a6 = random(.02,.04,.001); +$a7 = random(.02,.04,.001); +$a8 = 0.001*floor(1000*(1-($a1+$a2+$a3+$a4+$a5+$a6+$a7))+.5); + +$c4 = Real((1*$a1)+(2*$a2)+(3*$a3)+(4*$a4)+(5*$a5)+(6*$a6)+(7*$a7)+(8*$a8)); +$c5 = ((((1-$c4)**2)*$a1)+(((2-$c4)**2)*$a2)+(((3-$c4)**2)*$a3)+(((4-$c4)**2)*$a4)+(((5-$c4)**2)*$a5)+(((6-$c4)**2)*$a6)+(((7-$c4)**2)*$a7)+(((8-$c4)**2)*$a8)); +$c6 = ($c5)**(0.5); +$c7 = random(2.00,5.00,.25); +$c8 = $c7**(2); + +$new = Currency($c7*$c4); +$new2 = Currency($c7*$c6); +BEGIN_TEXT +$PAR +When parking a car in a downtown parking lot, drivers +pay according to the number of hours or fraction thereof. +The probability distribution of the number of hours cars +are parked has been estimated as follows: + +$PAR +$BCENTER +\{begintable(9)\} +\{row("\(X\)", "\(1\)", "\(2\)", "\(3\)", "\(4\)", "\(5\)", "\(6\)", "\(7\)", "\(8\)")\} +\{row("\(P(X)\)", "\($a1\)", "\($a2\)", "\($a3\)", "\($a4\)", "\($a5\)", "\($a6\)", "\($a7\)", "\($a8\)")\} +\{endtable()\} +$ECENTER +$PAR +A. Mean = \{ans_rule(15)\} +$PAR +B. Standard Deviation = \{ans_rule(15)\} +$PAR +The cost of parking is \($c7\) dollars per hour. Calculate the mean and standard deviation of the amount of revenue each car generates. +$PAR +A. Mean = \{ans_rule(15)\} +$PAR +B. Standard Deviation = \{ans_rule(15)\} +$PAR + + + +END_TEXT + + +ANS(Compute($c4)->cmp); +ANS(Compute($c6)->cmp); + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); +ANS(Currency($c7*$c4)->cmp); +ANS(Currency(($c8*$c5)**(0.5))->cmp); + +BEGIN_SOLUTION +For a larger model like this, it makes more sense to do find the values in questions with technology. Both a calculator or MS Excel will suffice to find that, +$PAR +(a) \(\mu = $c4\) +$PAR +Still by hand, it can be found, \(\mu = (1*$a1)+(2*$a2)+(3*$a3)+(4*$a4)+(5*$a5)+(6*$a6)+(7*$a7)+(8*$a8)= $c4\) +$PAR +(b) Using technology we will find the standard deviation to be, \(\sigma_{x} \approx $c6\) +$PAR +(c) Note: Answers to parts (c) and (d) should be in $DOLLAR\(\)'s, rounded to the nearest penny. As the cost of parking is \($c7\) dollars per hour, we could now think of our model \(X\) above, as \($c7 X\). This means to find the average cost we have, \(\text{E}($c7 X)=$c7 \cdot \text{E}(X) = $c7 \cdot $c4 = $new\) +$PAR +(d) For standard deviation, we also find it is increased by a multiple of \($c7\). Therefore our new standard deviation is \(\sigma_{x} = $c7 \cdot $c6 = $new2\) +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-08.pg b/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-08.pg new file mode 100644 index 0000000000..052582560d --- /dev/null +++ b/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-08.pg @@ -0,0 +1,87 @@ +## DESCRIPTION +## Expected Value +## ENDDESCRIPTION + +## KEYWORDS('probability', 'expected value') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Expected Value') +## Date('6/15/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); +Context("Currency"); + +$a1 = random(1,3,1); +$a2 = random(4,6,1); +$a3 = random(10,15,1); +$b1 = 0.01*$a1; +$b2 = 0.01*$a2; +$b3 = 0.01*$a3; +$c1 = random(300,600,50); +$c2 = random(100,300,50); +$c3 = random(50,200,25); + +$left = (1-$b1-$b2-$b3); +$ans = Currency($b1*$c1)+($b2*$c2)+($b3*$c3); + +BEGIN_TEXT +$PAR +The owner of a small firm has just purchased a personal computer, which she expects will serve her for the next two years. The owner has been +told that she "must" buy a surge suppressor to provide protection for her new hardware against possible surges or variations in the electrical current, which have the capacity to damage the computer. The amount of damage to the computer +depends on the strength of the surge. It has been estimated that there is a \($a1$PERCENT\) chance of incurring \($c1\) dollar damage, \($a2$PERCENT\) chance of incurring \($c2\) dollar damage, and \($a3$PERCENT\) chance of \($c3\) dollar damage. An inexpensive suppressor, which would provide protection for only one surge, can be purchased. How much should the owner be willing to pay if she makes decisions on the basis of expected value? +$PAR +The expected cost due to surge damage is \{ans_rule(15)\}. +$PAR + + + + +END_TEXT + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); +ANS(Currency(($b1*$c1)+($b2*$c2)+($b3*$c3))->cmp); + +BEGIN_SOLUTION +We will need a model if we are to find the expected cost due to surge damage. Don't forget to include the probability that there is $BBOLD NO $EBOLD damage. +$PAR +$BCENTER +\{begintable(5)\} +\{row("\(X\)", "\($c1\)", "\($c2\)", "\($c3\)", "\(0\)")\} +\{row("\(P(X)\)", "\($b1\)", "\($b2\)", "\($b3\)", "\($left\)")\} +\{endtable()\} +$ECENTER +$PAR +Our answer should be in $DOLLAR\(\)'s. Using technology we find, +$PAR +\(\text{E}(X)=\mu = (0*$left)+($b1*$c1)+($b2*$c2)+($b3*$c3) \approx $ans\) +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-12.pg b/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-12.pg new file mode 100644 index 0000000000..468adc4df4 --- /dev/null +++ b/Contrib/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-12.pg @@ -0,0 +1,80 @@ +## DESCRIPTION +## Statistics: Probability +## ENDDESCRIPTION + +## CMMK tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Probability') +## Date('6/27/2005') +## Institution('UVA') +## Author('Cristina Murray-Krezan') +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('') +## Problem1('') +## KEYWORDS('statistics', 'probability', 'bivariate random variable') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$exp1 = random(16,18,1); +$var1 = random(6,8,1); +$exp2 = random(10,12,1); +$var2 = random(3,5,1); +$exp3 = random(24,27,1); +$var3 = random(4,6,1); +$exp4 = random(5,8,1); +$var4 = random(1,2,1); + +$etot = ($exp1+$exp2+$exp3+$exp4); +$vartot = ($var1+$var2+$var3+$var4); + +BEGIN_TEXT +There are four stages along the critical path for a construction project. The expected values and variances of the completion times of the stages are listed below. Determine the expected value and variance of the completion time of the project. +$PAR +$BCENTER +\[ +\begin{array}{c|c|c} +\mbox{Activity} & \mbox{Expected Completion Time (Days)} & \mbox{Variance} \\ \hline\hline +1 & $exp1 & $var1 \\ \hline +2 & $exp2 & $var2 \\ \hline +3 & $exp3 & $var3 \\ \hline +4 & $exp4 & $var4 \\ \hline +\end{array} +\] +$ECENTER +$PAR + +$PAR + Expected value of completion time of project = \{ans_rule(15)\} days +$PAR + Variance of completion time of project = \{ans_rule(15)\} days\(^2\) +END_TEXT + +BEGIN_SOLUTION +(a) Expected values, or averages, for random variables can be added. Meaning, \(\text{E}(X_{1}+X_{2}) = \text{E}(X_{1}) + \text{E}(X{2})\). Therefore, we can simply add all the expected times and find the total expected time to be \($exp1+$exp2+$exp3+$exp4 = $etot\). +$PAR +(b) Assuming our random variables are independent, we can also add variances. That is, \(\text{VAR}(X_{1}+X_{2}) = \text{VAR}(X_{1}) + \text{VAR}(X{2})\). Therefore, we can simply add the variances to find the total variance to be \($var1+$var2+$var3+$var4 = $vartot\). +END_SOLUTION + +ANS(num_cmp($exp1+$exp2+$exp3+$exp4)); #expected value +ANS(num_cmp($var1+$var2+$var3+$var4)); #variance + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_5.pg b/Contrib/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_5.pg new file mode 100644 index 0000000000..409cc2c100 --- /dev/null +++ b/Contrib/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_5.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## Expected Value +## ENDDESCRIPTION + +## KEYWORDS('Random Variable') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(3000,6000,1000); +$a2 = random(15000,30000,5000); +$a3 = random(15000,30000,5000); +while($a2==$a3) {$a3 = random(15000,30000,5000);} +$a4 = random(40000,60000,5000); + +$p1 = random(.1,.3,.1); +$p2 = random(.1,.3,.1); +$p3 = random(.1,.3,.1); +$p4 = int(100*(1-$p1-$p2-$p3)+.5)/100; + + +$a = random(10,30,5); +$b = random(150000,300000, 50000); +$c = random(40000,60000,5000); + +$ex = $p1*$a1+$p2*$a2+$p3*$a3+$p4*$a4; +$profit = ($ex*$a)-$b-$c; +$profitbef = ($ex*$a); + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); + +$a = Currency("$a"); +$b = Currency("$b"); +$c = Currency("$c"); +$profitbef = Currency("$profitbef"); +$profit = Currency("$profit"); + +BEGIN_TEXT +A concert producer has scheduled an outdoor concert. The producer estimates the attendance will depend on the weather according to the following table. +$PAR +$BCENTER +\{begintable(3)\} +\{row("Weather", "Attendance", "Probability")\} +\{row("wet, cold", "\($a1\)", "\($p1\)")\} +\{row("wet, warm", "\($a2\)", "\($p2\)")\} +\{row("dry, cold", "\($a3\)", "\($p3\)")\} +\{row("dry, warm", "\($a4\)", "\($p4\)")\} +\{endtable()\} +$ECENTER +$PAR +$PAR +(a) What is the expected attendance? \{ans_rule(10)\} $PAR +(b) If tickets cost \($a\) each, the band will cost \($b\), plus \($c\) for administration. What is the expected profit? \{ans_rule(10)\} + +END_TEXT + +ANS(Compute($ex)->cmp); +ANS(Currency($profit)->cmp); + +BEGIN_SOLUTION +(a) As we already have our probability model, we can proceed to finding the expected value immediately, +$PAR +\(\text{E}(X)=\mu = ($p1\cdot$a1)+($p2\cdot$a2)+($p3\cdot$a3)+($p4\cdot$a4) = $ex\) +$PAR +(b) Our solution in part (a) was the expected attendance. If each ticket costs \($a\), then the expected profit with $BBOLD no other $EBOLD expenses would be \($profitbef\). However, is since the band will cost \($b\), plus \($c\) for administration, the total profit will be \($profitbef-$b-$c=$profit\) +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_6.pg b/Contrib/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_6.pg new file mode 100644 index 0000000000..093fcf2ebb --- /dev/null +++ b/Contrib/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_6.pg @@ -0,0 +1,116 @@ +## DESCRIPTION +## Expected Value +## ENDDESCRIPTION + +## KEYWORDS('Random Variable') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextCurrency.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +Context("Currency"); + +$p1 = random(10,25,5); +$c1 = random(200,400,100); +$p2 = random(150,550,100); +$c2 = random(100,200,50); +$p3 = random(25,75,25); +$c3 = random(10,90,10); +$p4 = random(5,20,5); +$c4 = random(1,5,1); +$p5 = random(200,900,100); +$c5 = random(100,900,100); +$p6 = random(45,95,5); +$c6 = random(3,9,1); + +$missingp = Real(1-(1/($c1*1000000))-(1/($c2*1000000))-(1/($c3*1000000))-(1/($c4*1000000)) -(1/($c5*1000))-(1/($c6*1000))); + +$cost_of_stamp = random(30,50,1); +$costC = Currency($cost_of_stamp/100); + +$ans1 = Currency($p1/$c1 + $p2/$c2/1000 + $p3/$c3/1000 + $p4/$c4/1000 + $p5/$c5/1000 + $p6/$c6/1000); +$ans2 = Currency($ans1 - $cost_of_stamp/100); + + +BEGIN_TEXT + +Prizes and the chances of winning in a lottery are given in the table below. +$PAR +$BCENTER +\{begintable(2)\} +\{row('Prize', 'Chances')\} +\{row( '$DOLLAR$p1,000,000 ', '1 chance in $c1,000,000 ' ) \} +\{row( '$DOLLAR$p2,000 ', '1 chance in $c2,000,000 ' ) \} +\{row( '$DOLLAR$p3,000 ', '1 chance in $c3,000,000 ' ) \} +\{row( '$DOLLAR$p4,000 ', '1 chance in $c4,000,000 ' ) \} +\{row( '$DOLLAR$p5 ', '1 chance in $c5,000 ' ) \} +\{row( 'A watch valued at $DOLLAR$p6 ', '1 chance in $c6,000 ' ) \} +\{endtable()\} +$ECENTER +$PAR +(a) \( \) Find the expected value of the amount won by one entry. $BR +\{ans_rule\} $PAR +(b) \( \) Find the expected value if the cost of playing this lottery is \($cost_of_stamp\) cents for postage. $BR +\{ans_rule\} $BR + +END_TEXT +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); +ANS(Currency($ans1)->cmp); +ANS(Currency($ans2)->cmp); + +BEGIN_SOLUTION +Note that both answers should be in $DOLLAR\(\)'s, rounded to the nearest penny. +$PAR +(a) The given probability model does not include the chances that you win nothing. To find this we will need to subtract all chances in our probability model from 1. +$PAR +Therefore, \(\text{P}(\text{nothing})= 1 - \frac{1}{$c1,000,000} - \frac{1}{$c2,000,000} -\frac{1}{$c3,000,000} -\frac{1}{$c4,000,000} -\frac{1}{$c5,000} -\frac{1}{$c6,000} = $missingp\) +$PAR +From here, we can complete our probability model. +$PAR + +$BCENTER +\{begintable(2)\} +\{row("Prize", "Chances")\} +\{row( "$DOLLAR$p1,000,000 ", "\(\frac{1}{$c1,000,000}\)" ) \} +\{row( "$DOLLAR$p2,000 ", "\(\frac{1}{$c2,000,000}\)" ) \} +\{row( "$DOLLAR$p3,000 ", "\(\frac{1}{$c3,000,000}\)" ) \} +\{row( "$DOLLAR$p4,000 ", "\(\frac{1}{$c4,000,000}\)" ) \} +\{row( "$DOLLAR$p5 ", "\(\frac{1}{$c5,000}\)" ) \} +\{row( "$DOLLAR$p6 ", "\(\frac{1}{$c6,000}\)" ) \} +\{row( "$DOLLAR 0 ", "$missingp" ) \} +\{endtable()\} +$ECENTER +$PAR +Using technology, we find the expected value to be \(\text{E}(X)=\mu=$ans1\) +$PAR +(b) Since each stamp is \($costC\) cents, we would have to subtract this from our expected value since we would have to pay it each time. Thus the new expected value is \($ans1-$costC=$ans2\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_9a.pg b/Contrib/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_9a.pg new file mode 100644 index 0000000000..6422a66817 --- /dev/null +++ b/Contrib/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_9a.pg @@ -0,0 +1,112 @@ +## DESCRIPTION +## Expected Value and Variance +## ENDDESCRIPTION + +## KEYWORDS('Random Variable', 'Expected Value', 'Variance') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(30,40,1); +$b = random(41,50,1); +$c = random(25,35,1); +while($c == $a) { $c = random(25,35,1); } +$d = random(36,50,1); +while(($d == $a) or ($d == $b)) { $d = random(36,50,1); } + +$total = $a + $b + $c + $d; + +$ex = Real(($a**2 + $b**2 + $c**2 + $d**2)/$total); + +$ey = Real($total/4); + +$vx = ($a*($a - $ex)**2 + $b*($b - $ex)**2 + $c*($c - $ex)**2 + $d*($d - $ex)**2 )/$total; + +$varx = Real(($vx)**(1/2)); + +$vy = (($a - $ey)**2 + ($b - $ey)**2 + ($c - $ey)**2 + ($d - $ey)**2)/4; + +$vary = Real(($vy)**(1/2)); + +BEGIN_TEXT + +Four buses carrying \($total\) high school students arrive to Montreal. The buses carry, respectively, \($a\), \($b\), \($c\), and \($d\) students. One of the \($total\) students is randomly selected. Let \(X\) denote the number of students that were on the bus carrying this randomly selected student. One of the four bus drivers is also randomly selected. Let \(Y\) denote the number of students on his bus. Compute the expectations and variances of \(X\) and \(Y\): +$PAR +$PAR + +\(\operatorname{E}(X)=\)\{ans_rule(30)\} $BR + +\(\operatorname{Var}(X)=\)\{ans_rule(30)\} $PAR +$PAR + +\(\operatorname{E}(Y)=\)\{ans_rule(30)\} $BR + +\(\operatorname{Var}(Y)=\)\{ans_rule(30)\} + +END_TEXT + +ANS(Compute($ex)->cmp); +ANS(Compute($vx)->cmp); +ANS(Compute($ey)->cmp); +ANS(Compute($vy)->cmp); + +BEGIN_SOLUTION +First we need a probability model, \(X\), for the number of students that were on the bus carrying this randomly selected student. +$PAR +$BCENTER +\{begintable(2)\} +\{row("\(X\)", "\($a\)", "\($b\)", "\($c\)", "\($d\)")\} +\{row("\(\text{P}(X)\)", "\(\frac{$a}{$total}\)", "\(\frac{$b}{$total}\)", "\(\frac{$c}{$total}\)", "\(\frac{$d}{$total}\)")\} +\{endtable()\} +$ECENTER +(a) Now with technology we can compute the expected value, or, +$PAR +\(\text{E}(X)=\mu = ($a \cdot \frac{$a}{$total})+ ($b \cdot \frac{$b}{$total}) +($c \cdot \frac{$c}{$total}) + ($d \cdot \frac{$d}{$total}) \approx $ex\) +$PAR +(b) Using technology we find \(\sigma_{x}\approx $varx\), thus, \(\text{VAR}(X) \approx ($varx)^2 \approx $vx\) +$PAR +Again, we need a probability model, \(Y\), for the number of students that were on the bus carrying this randomly selected driver. This is made easier since there are only \(4\) drivers, one on each bus, and thus each driver has the same chance of being selected. +$PAR +$BCENTER +\{begintable(2)\} +\{row("\(Y\)", "\($a\)", "\($b\)", "\($c\)", "\($d\)")\} +\{row("\(\text{P}(Y)\)", "\(\frac{1}{4}\)", "\(\frac{1}{4}\)", "\(\frac{1}{4}\)", "\(\frac{1}{4}\)")\} +\{endtable()\} +$ECENTER +$PAR +(c) Now with technology we can compute the expected value, or, +$PAR +\(\text{E}(Y)=\mu = ($a \cdot \frac{1}{4})+ ($b \cdot \frac{1}{4}) +($c \cdot \frac{1}{4}) + ($d \cdot \frac{1}{4}) \approx $ey\) +$PAR +(d) Using technology we find \(\sigma_{x}\approx $vary\), thus, \(\text{VAR}(Y) \approx ($vary)^2 \approx $vy\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_01_Experiments.pg b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_01_Experiments.pg new file mode 100644 index 0000000000..17f84f6e57 --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_01_Experiments.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_01_Experiments.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_01_Experiments.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_02_Experiments.pg b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_02_Experiments.pg new file mode 100644 index 0000000000..5c604cdb78 --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_02_Experiments.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_02_Experiments.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_02_Experiments.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_03_Experiments.pg b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_03_Experiments.pg new file mode 100644 index 0000000000..174f52cb64 --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_03_Experiments.pg @@ -0,0 +1,92 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 9: Producing Data: Experiments') +## KEYWORDS('statistic', 'producing data', 'experiments') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 9: Producing Data: Experiments') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The factor in this study is ","which medication the volunteers receive. "); + $mc[0]->extra("the extent to which the depression was reduced. ", + "the use of randomization and the fact that this was a comparative study. ", + "the use of a psychiatrist to evaluate the severity of depression. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The study would be double blind if ","neither the volunteers nor the psychiatrist knew which + treatment any person had received. "); + $mc[1]->extra("neither drug had any identifying marks on it. ", + "all volunteers were not allowed to see the psychiatrist nor the psychiatrist allowed to see the volunteers + during the session in which the psychiatrist evaluated the severity of the depression. "); + $mc[1]->makeLast("All of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Suppose the volunteers were first divided into men and women, and then half of the men + were randomly assigned to the new drug and half of the women were assigned to the + new drug. The remaining volunteers received the other drug. This would be an example of ","a block design. "); + $mc[2]->extra("a matched pairs design. ", + "confounding. The effects of gender will be mixed up with the effects of the drugs. ", + "replication. "); + +################################################# +# Main + +BEGIN_TEXT +One hundred volunteers who suffer from severe depression are available for a study. Fifty are selected at random +and are given a new drug that is thought to be particularly effective in treating severe depression. The other fifty +are given an existing drug for treating severe depression. A psychiatrist evaluates the symptoms of all volunteers +after four weeks in order to determine if there has been substantial improvement in the severity of the depression. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_04_Experiments.pg b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_04_Experiments.pg new file mode 100644 index 0000000000..4a1039901e --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_04_Experiments.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_04_Experiments.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_04_Experiments.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_05_Experiments.pg b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_05_Experiments.pg new file mode 100644 index 0000000000..830e54c63d --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_05_Experiments.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_05_Experiments.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_05_Experiments.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_06_Experiments.pg b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_06_Experiments.pg new file mode 100644 index 0000000000..b1868926d1 --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_06_Experiments.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_06_Experiments.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_06_Experiments.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_07_Experiments.pg b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_07_Experiments.pg new file mode 100644 index 0000000000..adc07490b3 --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_07_Experiments.pg @@ -0,0 +1,56 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 9: Producing Data: Experiments') +## KEYWORDS('statistic', 'producing data', 'experiments') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 9: Producing Data: Experiments') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@numbers=("five", "four", "three"); +$choose = random(0,1,1); +$customers = random(35,50,5); +$high = random(4,8,1); + +################################################# +# Main + +BEGIN_TEXT +A marketing experiment compares $numbers[$choose] different types of packaging for +blank computer CDs. Each type of packaging can be presented in $numbers[$choose + 1] +different colors. Each combination of package type with a particular +color is shown to $customers potential customers, who rate the overall attractiveness +on a scale of 1 to $high. How many treatments are there? +$BR + \{ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +if ($choose == 1) { + $answer = 12; + } else { $answer = 20; + } + +ANS(Real($answer)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_08_Experiments.pg b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_08_Experiments.pg new file mode 100644 index 0000000000..0a00b9e7f8 --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_08_Experiments.pg @@ -0,0 +1,78 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 9: Producing Data: Experiments') +## KEYWORDS('statistic', 'producing data', 'experiments') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 9: Producing Data: Experiments') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("A study of the effects of running on personality involved 231 male +runners who each ran about 20 miles a week. The runners were given +the Cattell Sixteen Personality Factors Questionnaire, a 187-item +multiple-choice test often used by psychologists. A news report +(The New York Times, Feb. 15, 1988) stated that the researchers found +statistically significant personality differences between the runners +and the 30-year-old male population as a whole. A headline on the article +said that research has shown that running can alter one's moods. This study was ", "an observational study, but not an experiment."); + $mc[0]->extra("an experiment, but not a double-blind experiment.", + "a double-blind experiment, but not a randomized experiment.", + "a randomized, double-blind experiment."); + +$mc[1] = new_multiple_choice(); + $mc[1]->qa("Can pleasant aromas help a student learn better? Two researchers believed that the presence of a floral scent could improve a person's learning ability in certain situations. They had twenty-two people work through a pencil and paper maze six times, three times while wearing a floral-scented mask and three times while wearing an unscented mask. The three trials for each mask closely followed one another. Testers measured the length of time it took the subjects to complete each of the six trials. They reported that, on average, the subjects wearing the floral-scented mask completed the maze more quickly than those wearing the unscented mask, though the difference was not statistically significant. This study is ", "an experiment, but not a double-blind experiment."); + $mc[1]->extra("a convenience sample.", + "an observational study, but not an experiment.", + "a double-blind experiment."); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_09_Experiments.pg b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_09_Experiments.pg new file mode 100644 index 0000000000..ce94e0717b --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/09Stats_09_Experiments.pg @@ -0,0 +1,97 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 9: Producing Data: Experiments') +## KEYWORDS('statistic', 'producing data', 'experiments') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 9: Producing Data: Experiments') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The Nurses' Health Study has interviewed a sample of more than 100,000 female registered nurses every two years since 1976. The study finds that $LQ light-to-moderate drinkers had a significantly lower risk of death$RQ than either nondrinkers or heavy drinkers. The Nursers' Health Study is ", + "an observational study. "); + $mc[0]->extra("an experiment. "); + + $mc[0]->makeLast("Can't tell without more information. "); + + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("What electrical changes occur in muscles as they get tired? Student subjects hold their arms above their shoulders until they have to drop them. Meanwhile, the electrical activity in their arm muscles is measured. This is ", + "an experiment with no control group. "); + $mc[1]->extra("an observational study. ", + "a randomized comparative experiment. "); + + $mc[1]->makeLast("None of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Can changing diet reduce high blood pressure? Vegetarian diets and low-salt diets are both promising. Men with high blood pressure are assigned at random to one of four diets: (1) normal diet with unrestricted salt; (2) vegetarian with unrestricted salt; (3) normal with restricted salt; and (4) vegetarian with restricted salt. This experiment has ", + "two factors: normal/vegetarian diet and unrestricted/restricted salt. "); + $mc[2]->extra("one factor: the choice of diet. ", + "four factors: the four diets being compared. "); + + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("A marketing class designs two videos advertising an expensive Mercedes sports car. They test the videos by asking fellow students to view both (in random order) and say which makes them more likely to buy the car. Mercedes should be reluctant to agree that the video favored in this study will sell more cars because ", + "results from students may not generalize to the older and richer customers who might buy a Mercedes. "); + $mc[3]->extra("the study used matched pairs design instead of a completely randomized design. ", + "this is an observational study, not an experiment. "); + + $mc[3]->makeLast("None of the above. "); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_1.pg b/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_1.pg new file mode 100644 index 0000000000..19b56817f0 --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_1.pg @@ -0,0 +1,53 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("An experiment investigated the effect of length and repetition of TV ads on students choosing to eat at Del Taco. All 60 students watched a 40-minute television program that included ads for Del Taco. Some students saw a 30-second commerical; others a 90-second commerical. The same commerical was shown either 1, 3, or 5 times during the program. After the viewing, each student was asked to rate their craving for Del Taco on a scale of 0 to 10. What are the subjects of this experiment?", "60 students"); +$mc->extra("effect of length and repetion of TV ads", "40-minute television program", "craving for Del Taco on a scale of 0 to 10", "1, 3, or 5 commercials during the 40-minute television program"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_2.pg b/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_2.pg new file mode 100644 index 0000000000..eb295daba7 --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_2.pg @@ -0,0 +1,53 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("For the Del Taco experiment, what are the factors?", "length and repetition of TV ads"); +$mc->extra("60 students", "40-minute television program", "craving for Del Taco on a scale of 0 to 10", "1, 3, or 5 commercials during the 40-minute television program"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_3.pg b/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_3.pg new file mode 100644 index 0000000000..96020217ed --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_3.pg @@ -0,0 +1,54 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("For the Del Taco experiment, what are the levels of the length factor?", "30-second and 90-second commericals"); +$mc->extra("60 students", "40-minute television program", "craving for Del Taco on a scale of 0 to 10", "1, 3, or 5 commercials during the 40-minute television program"); + +BEGIN_TEXT + + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_4.pg b/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_4.pg new file mode 100644 index 0000000000..94b47079f5 --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_4.pg @@ -0,0 +1,53 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("For the Del Taco experiment, what is the response variable?", "craving for Del Taco on a scale of 0 to 10"); +$mc->extra("60 students", "40-minute television program", "30-second and 90-second commericials", "1, 3, or 5 commercials during the 40-minute television program"); + +BEGIN_TEXT + + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_5.pg b/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_5.pg new file mode 100644 index 0000000000..ca6b63e9da --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/dueck1_5_5.pg @@ -0,0 +1,51 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$ans1 = 6; + +BEGIN_TEXT +In the Del Taco experiment, how many treatments are there?$PAR +\{ans_rule(10) \} $PAR + + +END_TEXT + +ANS(num_cmp($ans1)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/kolossa59.pg b/Contrib/PCC/Statistics/ExperimentalDesign/kolossa59.pg new file mode 100644 index 0000000000..79f12c14fc --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/kolossa59.pg @@ -0,0 +1,89 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('percent') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +$showPartialCorrectAnswers = 0; + +$a = random(40,50,1); +$b = random(30,39,1); + + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Identify the two populations:", "teenage girls and teenage boys"); +$mc->extra("all teenagers","teenage girls and teenage boys who use sunscreen regularly" ); +$mc->makeLast("None of the above"); + +BEGIN_TEXT +Industry Research polled teenagers on sunscreen use. The survey revealed that $a$PERCENT of teenage girls and $b$PERCENT of teenage boys regularly use sunscreen before going out in the sun. $BR $BR + + +\{ $mc->print_q \} +\{ $mc->print_a \} +$BR $BR +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +$mc = new_multiple_choice(); + +$mc->qa("Identify the specified attribute:", "uses sunscreen before going out in the sun"); +$mc->extra("being a teenager", "being a teenage girl or a teenage boy"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +$BR $BR +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +$mc = new_multiple_choice(); + +$mc->qa("Are the proportions 0.$a ($a$PERCENT) and 0.$b ($b$PERCENT) population proportions or a sample proportions?", "sample proportions"); +$mc->extra("population proportions"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/stat_inference1.pg b/Contrib/PCC/Statistics/ExperimentalDesign/stat_inference1.pg new file mode 100644 index 0000000000..8760696670 --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/stat_inference1.pg @@ -0,0 +1,50 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Inference Samples') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/10/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGchoicemacros.pl" +); + +TEXT(&beginproblem); +$mc = new_multiple_choice(); +$meas = list_random( 'Cholesterol levels', 'Heart rates', 'Blood pressures' ); +$gend = list_random( 'adult men', 'adult women'); +$age = random( 28, 65, 1 ); +$num1 = list_random( 3, 4, 5 ); +$num2 = list_random( 'once', 'twice' ); + +$mc -> qa( "This an example of ", + " an observational study ", +); +$mc -> extra( " a case- controlled study", + " a comparative experiment", + " an uncontrolled experiment" +); + + +BEGIN_TEXT + +$meas of $age-year-old $gend who exercised $num1 or more times per week are compared to those of $age-year-old $gend who exercised no more than $num2 a week. +\{ $mc -> print_q \} +$BR + +\{ $mc -> print_a \} + + +END_TEXT + +ANS( str_cmp( $mc -> correct_ans ) ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/ExperimentalDesign/stat_inference4.pg b/Contrib/PCC/Statistics/ExperimentalDesign/stat_inference4.pg new file mode 100644 index 0000000000..ec196e4d7e --- /dev/null +++ b/Contrib/PCC/Statistics/ExperimentalDesign/stat_inference4.pg @@ -0,0 +1,49 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Inference Samples') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/15/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGchoicemacros.pl" +); + +TEXT(&beginproblem); +$mc = new_multiple_choice(); +$name = list_random( 'medical study', 'medical experiment', 'psychology study', 'psychology experiment'); +@list = ( 'treatment', 'control' ); +@slice = NchooseK( 2, 2 ); + +$mc -> qa( "to reduce", + " confounding ", +); +$mc -> extra( " the placebo effect", + " variability", + " bias", + " the sample size" +); + + +BEGIN_TEXT + +In a $name, a $list[$slice[0]] group is compared to a $list[$slice[1]] group + +\{ $mc -> print_q \} +$BR + +\{ $mc -> print_a \} + +END_TEXT + +ANS( str_cmp( $mc -> correct_ans ) ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/LinearRegression/05Stats_01_Regression.pg b/Contrib/PCC/Statistics/LinearRegression/05Stats_01_Regression.pg new file mode 100644 index 0000000000..cf68a9ac2a --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/05Stats_01_Regression.pg @@ -0,0 +1,105 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Regression) +## Institution(The College of Idaho) +## Author(R Cruz, L Danielson, J Guild) +## MLT(InterpretLine) +## Level(2) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('5') +## Problem1('') +## KEYWORDS('statistic', 'regression') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$m1 = random(1,9,1); +$b1 = random(1,9,1); +$r1 = random(400,700,50); +$r2 = random(50,200,25); + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The points on a scatterplot lie close to the line whose equation is \(y = $m1 x - $b1 \). The slope of the line is ", + $m1); + $mc[0]->extra(-$m1, + $b1, + $m1 + $b1); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("Smokers don't live as long (on the average) as nonsmokers, and heavy smokers don't live as long as light smokers. You regress the age at death of a group of male smokers on the number of packs per day they smoked. The slope of your regression line ", + "will be less than zero. "); + $mc[1]->extra("will be greater than zero. ", + "must be between -1 and 1. "); + $mc[1]->makeLast("can't tell without seeing the data. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Fred keeps his savings in his mattress. He began with $DOLLAR$r1 from his mother and adds $DOLLAR$r2 each year. His total savings \( y \) after \( x \) years are given by the equation ", + "\( y = $r1 + $r2 x \)"); + $mc[2]->extra("\( y = $r2 + $r1 x \)", + "\( y = $r2 + x \) ", + "\( y = $r1 - $r2 x \) "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("Measurements on young children in Mumbai, India, found this least-squares line for predicting height \( y \) from armspan \( x \): +$PAR +$BCENTER +\( \hat{y} = 6.4 + 0.93 x \) +$ECENTER +$PAR +$SPACE $SPACE All measurements are in centimeters (cm). How much on the average does height increase for each additional centimeter of armspan?", + "0.93 cm "); + $mc[3]->extra("6.4 cm ", + "7.33 cm ", + "0.64 cm "); + $mc[3]->makeLast("None of the above. "); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/LinearRegression/05Stats_02_Regression.pg b/Contrib/PCC/Statistics/LinearRegression/05Stats_02_Regression.pg new file mode 100644 index 0000000000..bb93d84433 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/05Stats_02_Regression.pg @@ -0,0 +1,61 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 5: Regression') +## KEYWORDS('statistic', 'regression') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 5: Regression') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +$b = random(2,3,.01); +$m = random(0,.0150,.0001); +$d = random(100,400,25); +$a = $d*$m + $b; + +################################################# +# Main + +BEGIN_TEXT +A study of king penguins looked for a relationship between how deep the penguins dive to seek food and how long they stay underwater. For all but the shallowest dives, there is a linear relationship that is different for different penguins. The study report gives a scatterplot for one penguin titled $LQ The relation of dive duration (DD) to depth (D).$RQ Dive duration DD is measured in minutes and depth D is in meters. The report then says, $LQ The regression equation for this bird is: DD = $b + $m D. + +$PAR +(a) What is the slope of the regression line?. +$BR \{ans_rule(5)\} minutes per meter. + +$PAR +(b) According to the regression line, how long does a typical dive to a depth of $d meters last? +$BR \{ans_rule(5)\} minutes. +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = Real($m); +ANS($ans_a->cmp); + +$ans_b = Real($a); +ANS($ans_b->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/LinearRegression/05Stats_03_Regression.pg b/Contrib/PCC/Statistics/LinearRegression/05Stats_03_Regression.pg new file mode 100644 index 0000000000..b458b693ba --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/05Stats_03_Regression.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 5: Regression') +## KEYWORDS('statistic', 'regression') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 5: Regression') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + + +for($i=0;$i<12;$i++) { +$x[$i] = random(36,55,0.1); +$y[$i] = random(900,1600,10); +} + +for($i=0;$i<12;$i++) { +$sum_x += $x[$i]; +$sum_y += $y[$i]; +} + +$mean_x = $sum_x/12; +$mean_y = $sum_y/12; + +for ($i=0; $i<12; $i++) { +$sx_squared += ($x[$i] - $mean_x)*($x[$i] - $mean_x);} + +$sx = sqrt($sx_squared/11); + +for ($i=0; $i<12; $i++) { +$sy_squared += ($y[$i] - $mean_y)*($y[$i] - $mean_y);} + +$sy = sqrt($sy_squared/11); + +for ($i=0; $i<12; $i++) { +$sum_r += (($x[$i] - $mean_x)/$sx)*(($y[$i] - $mean_y)/$sy);} + +$r = $sum_r/11; + +$b1 = $r*($sy/$sx); +$a = $mean_y - ($b1*$mean_x); +#$b1 = .1*int(10*($b1+0.05)); +#$a = .1*int(10*($a+0.05)); +#$r = .001*int(1000*($r+0.0005)); + +###################################### +# Main text + +BEGIN_TEXT +We have data on the lean body mass and resting metabolic rate for 12 women who are subjects in a study of dieting. Lean body mass, given in kilograms, is a person's weight leaving out all fat. Metabolic rate, in calories burned per 24 hours, is the rate at which the body consumes energy. +$PAR +$BCENTER +\{begintable(13)\} +\{row('$BBOLD Mass $EBOLD $SPACE ',$x[0],$x[1],$x[2],$x[3],$x[4],$x[5],$x[6],$x[7],$x[8],$x[9],$x[10],$x[11])\} +\{row('$BBOLD Rate $EBOLD $SPACE ',$y[0],$y[1],$y[2],$y[3],$y[4],$y[5],$y[6],$y[7],$y[8],$y[9],$y[10],$y[11])\} +\{endtable()\} +$ECENTER +$BR +Find the least-squares regression line for predicting metabolic rate from body mass. +$BR + \( \hat{y} = \) \{ans_rule(40)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +Context()->flags->set( + tolerance=>0.5, + tolType=> 'absolute' + ); + +$ans_a = Formula("$a + $b1 x"); +ANS($ans_a->cmp); + +###################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/LinearRegression/05Stats_04_Regression.pg b/Contrib/PCC/Statistics/LinearRegression/05Stats_04_Regression.pg new file mode 100644 index 0000000000..47442c7ccc --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/05Stats_04_Regression.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 5: Regression') +## KEYWORDS('statistic', 'regression') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 5: Regression') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@x = (random(56.1,57.8,.1), + random(43.2,47.9,.1), + random(40.3,43.8,.1), + random(43.2,48.9,.1), + random(52.1,58.7,.1)); + +@y = (random(189.4,193.3,.1), + random(150.5,155.7,.1), + random(143.1,149.8,.1), + random(161.1,166.9,.1), + random(168.0,175.7,.1)); + +$mean_x = ($x[0] + $x[1] + $x[2] + $x[3] + $x[4])/5; +$mean_y = ($y[0] + $y[1] + $y[2] + $y[3] + $y[4])/5; + +for ($i=0; $i<5; $i++) { +$sx_squared += ($x[$i] - $mean_x)*($x[$i] - $mean_x);} + +$sx = sqrt($sx_squared/4); + +for ($i=0; $i<5; $i++) { +$sy_squared += ($y[$i] - $mean_y)*($y[$i] - $mean_y);} + +$sy = sqrt($sy_squared/4); + +for ($i=0; $i<5; $i++) { +$sum_r += (($x[$i] - $mean_x)/$sx)*(($y[$i] - $mean_y)/$sy);} + +$r = $sum_r/4; + +$b = $r*($sy/$sx); +$a = $mean_y - ($b*$mean_x); + +###################################### +# Main text + +BEGIN_TEXT +Because elderly people may have difficulty standing to have their height measured, a study looked at the relationship between overall height and height to the knee. Here are data (in centimeters) for five elderly men: +$PAR +$BCENTER +\{begintable(6)\} +\{row('$BBOLD Knee Height $EBOLD $SPACE \( x \) $SPACE ',$x[0],$x[1],$x[2],$x[3],$x[4])\} +\{row('$BBOLD Height $EBOLD $SPACE \( y \) $SPACE',$y[0],$y[1],$y[2],$y[3],$y[4])\} +\{endtable()\} +$ECENTER +$BR + +What is the equation of the least-squares regression line for predicting height from knee height? +$PAR +\( \hat{y} = \) \{ ans_rule(15) \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = Formula("$a + $b x"); +ANS($ans_a->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/LinearRegression/05Stats_08_Regression.pg b/Contrib/PCC/Statistics/LinearRegression/05Stats_08_Regression.pg new file mode 100644 index 0000000000..20ef207a1f --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/05Stats_08_Regression.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 5: Regression') +## KEYWORDS('statistic', 'regression','correlation') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 5: Regression') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +#Keep the values "nice". +@possible_x=(1, 1, 2, 2, 3, 3, 5, 5, 5, 6, 6, 7, 7, 8, 8); +@possible_y=(9, 10, 9, 8, 8, 7, 7, 6, 5, 6, 4, 4, 3, 3, 2); + +@slice = NchooseK(15,7); +@x=@possible_x[@slice]; +@y=@possible_y[@slice]; + +$sx = 0; +$sy = 0; +$sxy = 0; +$sx2 = 0; +$sy2 = 0; +for($i=0; $i<7; $i++) { + $sx = $sx + $x[$i]; + $sy = $sy + $y[$i]; + $sxy = $sxy + ($x[$i]*$y[$i]); + $sx2 = $sx2 + ($x[$i]**2); + $sy2 = $sy2 + ($y[$i]**2); +} + +$ssxy = $sxy-(($sx*$sy)/7); +$ssx = $sx2-(($sx**2)/7); +$ssy = $sy2-(($sy**2)/7); + +$r = $ssxy/sqrt($ssx*$ssy); +$r_sq = 100 * $r ** 2; + +################################################# +# Main + +BEGIN_TEXT +Given the following data set, let \( x \) be the explanatory variable and \( y \) be the +response variable. +$BCENTER +\{begintable(8)\} +\{row("\( x \)", "$x[0]", "$x[1]", "$x[2]", "$x[3]", "$x[4]", "$x[5]", "$x[6]")\} +\{row("\(y\)", "$y[0]", " $y[1] ", "$y[2]", "$y[3]", "$y[4]", "$y[5]", "$y[6]")\} +\{endtable()\} +$ECENTER +$PAR +(a) If a least squares line was fitted to this data, what percentage of the variation in the \( y \)would be explained by the regression line? $BR + \{ans_rule(15)\} + +$PAR +(b) Compute the correlation coefficient: \(r = \) \{ans_rule(15)\} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 1; +Context("Percent"); +$ans_a = Percent($r_sq/100); + ANS($ans_a->cmp); + +$ans_b = Compute($r)->with(tolType=>'absolute', tolerance=>'0.005'); + ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01; + } => ["Your answer is close. Try the calculation using more accuracy."]))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/Contrib/PCC/Statistics/LinearRegression/05Stats_09_Regression.pg b/Contrib/PCC/Statistics/LinearRegression/05Stats_09_Regression.pg new file mode 100644 index 0000000000..686d427c4f --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/05Stats_09_Regression.pg @@ -0,0 +1,140 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 5: Regression') +## KEYWORDS('statistic', 'regression','residuals') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 5: Regression') +## Problem1('') +## Author('E Cabrera') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGchoicemacros.pl", + "PGgraphmacros.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@e = (random(35,45,1),random(45,55,1),random(35,45,1),random(50,65,1),random(52,65,1),random(56,67,1),random(58,68,1),random(45,55,1),random(40,49,1),random(42,54,1),random(52,70,1),random(60,80,1),random(10,28,1),random(58,72,1),random(25,37,1),random(100,120,1)); + +@brain = (random(-.130,-.100,.001),random(.380,.398,.001),random(.005,.020,.001),random(.360,.380,.001),random(.005,.035,.001),random(.400,.425,.001),random(.090,.115,.001),random(.506,.520,.001),random(.140,.160,.001),random(.735,.750,.001),random(.245,.260,.001),random(.560,.580,.001),random(.205,.225,.001),random(.712,.730,.001),random(.350,.371,.001),random(.760,.790,.001)); + + +for ($i=0; $i<16; $i++) { +$sum_x += $e[$i]; +$sum_y += $brain[$i]; +$j = $i + 1; +$subject[$i] = "subject $j"; +} + +$mean_x = $sum_x/16; +$mean_y = $sum_y/16; + +for ($i=0; $i<16; $i++) { +$sx_squared += ($e[$i] - $mean_x)*($e[$i] - $mean_x);} + +$sx = sqrt($sx_squared/15); + +for ($i=0; $i<16; $i++) { +$sy_squared += ($brain[$i] - $mean_y)*($brain[$i] - $mean_y);} + +$sy = sqrt($sy_squared/15); + +for ($i=0; $i<16; $i++) { +$sum_r += (($e[$i] - $mean_x)/$sx)*(($brain[$i] - $mean_y)/$sy);} + +$r = $sum_r/15; + +# Regression Line = y = a + bx +#---------------- +$b = $r*($sy/$sx); +$a = $mean_y - ($b*$mean_x); +$intb = .00001*int(100000*($b+.000005)); +if ($a<0) { +$inta = .00001*int(100000*($a-.000005)); +} +else { +$inta = $inta = .00001*int(100000*($a+.000005)); +} + +$f1 = Formula("$a + $b * x"); + +# Residuals +#--------------- +for($i=0;$i<16;$i++) { +$res[$i] = $brain[$i]-($e[$i]*$intb + $inta); +} + +$choose = list_random(0,1,2,4,6,7,8,9,10,11,12,13,14,15); #Pick the residual to calculate. + +# Grid +#--------------- + +$graph = +init_graph(-20,-.4,120,1.2,'grid'=>[14,16],'axes'=>[0,0],'size'=>[700,400]); + +# Draw circles +#--------------- +for($i=0;$i<16;$i++){ +$circle[$i] = closed_circle($e[$i],$brain[$i]); +$graph -> stamps($circle[$i]); +} +$circle[$choose]= closed_circle($e[$choose],$brain[$choose],'red'); +$graph -> stamps($circle[$choose]); + +add_functions($graph,"$f1 for x in [-30,130] using color=blue and weight=2"); + +$label1 = new Label($e[$choose]-8,$brain[$choose]+.03, "$subject[$choose]",'red','center'); +$graph->lb($label1); + +################################################# +# Main + +BEGIN_TEXT +Empathy means being able to understand what others feel. To see how the brain expresses empathy, researchers recruited 16 couples in their mid-twenties who were married or had been dating for at least two years. They zapped the man's hand with an electrode while the woman watched, and measured the activity in several parts of the woman's brain that would respond to her own pain. Brain activity was recorded as a fraction of the activity observed when the woman herself was zapped with the electrode. The women also completed a psychological test that measures empathy. +$BCENTER +\{ begintable(17)\} +\{row('$BBOLD Subject $EBOLD','$BBOLD 1 $EBOLD','$BBOLD 2 $EBOLD','$BBOLD 3 $EBOLD','$BBOLD 4 $EBOLD','$BBOLD 5 $EBOLD','$BBOLD 6 $EBOLD','$BBOLD 7 $EBOLD','$BBOLD 8 $EBOLD','$BBOLD 9 $EBOLD','$BBOLD 10 $EBOLD','$BBOLD 11 $EBOLD','$BBOLD 12 $EBOLD','$BBOLD 13 $EBOLD','$BBOLD 14 $EBOLD','$BBOLD 15 $EBOLD','$BBOLD 16 $EBOLD')\} +\{row('$BBOLD Empathy Score $EBOLD $SPACE $SPACE',$e[0],$e[1],$e[2],$e[3],$e[4],$e[5],$e[6],$e[7],$e[8],$e[9],$e[10],$e[11],$e[12],$e[13],$e[14],$e[15])\} +\{row('$BBOLD Brain Activity $EBOLD',$brain[0],$brain[1],$brain[2],$brain[3],$brain[4],$brain[5],$brain[6],$brain[7],$brain[8],$brain[9],$brain[10],$brain[11],$brain[12],$brain[13],$brain[14],$brain[15])\} +\{endtable()\} + +$BR +\{ image( insertGraph($graph), tex_size => 500, width=>625, height=>375) \} +$ECENTER +$BR +Given that the equation for the regression line is \( \hat{y} = $intb x + $inta \), what is the residual for $subject[$choose]? +$BR +\{ ans_rule(8) \} +END_TEXT + +###################################### +# Answer + +$showPartialCorrectAnswers = 1; + +$ans_a1 = Real($res[$choose])->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_a1->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$ansHash) = @_; + return abs(-1*$correct-$student) <= .02; + } => ["Remember that the formula is Observed - Expected, order matters in subtraction", score => 0], + sub { + my ($correct,$student,$ansHash) = @_; + return abs($correct-$student) <= .02; + } => ["Close! Try keeping more accuracy in your calculation.", score => 0] + +))); + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Statistics/LinearRegression/05Stats_12_Regression.pg b/Contrib/PCC/Statistics/LinearRegression/05Stats_12_Regression.pg new file mode 100644 index 0000000000..7a287a7395 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/05Stats_12_Regression.pg @@ -0,0 +1,100 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Correlation) +## Institution(The College of Idaho) +## Author(R Cruz, L Danielson, J Guild) +## Level(1) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('5') +## Problem1('') +## KEYWORDS('statistic', 'regression','correlation') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The owner of a chain of supermarkets notices that there is a positive correlation between the sales of beer + and the sales of ice cream over the course of the previous year. Seasons when sales of beer were above average, + sales of ice cream also tended to be above average. Likewise, during seasons when sales of beer were below + average, sales of ice cream also tended to be below average. Which of the following would be a valid conclusion + from these facts? ","The sale of beer and ice cream may both be affected by another variable such as the outside temperature."); + $mc[0]->extra("Sales records must be in error. There should be no association between beer and ice cream sales. ", + "Evidently, for a significant proportion of customers of these supermarkets, drinking beer causes a desire for + ice cream or eating ice cream causes a thirst for beer. ", + "A scatterplot of monthly ice cream sales versus monthly beer sales would show that a straight line describes the + pattern in the plot, but it would have to be a horizontal line. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A researcher observes that, on average, the number of divorces in cities with major league baseball + teams is larger than in cities without major league baseball teams. The most plausible explanation for + this observed association is ","the association is due to the presence of a lurking variable (major league + teams tend to be in large cities with more people, hence a greater number of divorces). "); + $mc[1]->extra("the observed association is purely coincidental. It is implausible to believe the observed association + could be anything other than accidental. ", + "the high number of divorces is responsible for the presence of a major league baseball teams (more + single men means potentially more fans at the ballpark, making it attractive for an owner to relocate to such cities). ", + "the presence of a major league baseball team causes the number of divorces to rise (perhaps husbands are + spending too much time at the ballpark). "); + $mc[1]->makeLast("None of the above."); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("When possible, the best way to establish that an observed association is the + result of a cause-and-effect relation is by means of ","a well designed experiment."); +$mc[2]->extra("the least squares regression line.", + "the correlation coefficient.", + "the square of the correlation coefficient."); +$mc[2]->makeLast("None of the above."); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/LinearRegression/dueck4_2_2.pg b/Contrib/PCC/Statistics/LinearRegression/dueck4_2_2.pg new file mode 100644 index 0000000000..281cc45866 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/dueck4_2_2.pg @@ -0,0 +1,19 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch05Regression/05Stats_06_Regression.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch05Regression/05Stats_06_Regression.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject(ZZZ-Inserted Text) +## DBchapter(ZZZ-Inserted Text) +## DBsection(ZZZ-Inserted Text) +## MLT(LineFromData) + diff --git a/Contrib/PCC/Statistics/LinearRegression/dueck4_2_4.pg b/Contrib/PCC/Statistics/LinearRegression/dueck4_2_4.pg new file mode 100644 index 0000000000..b0a70fd653 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/dueck4_2_4.pg @@ -0,0 +1,104 @@ +##DESCRIPTION +## Statistics: Simple Linear Regression +##ENDDESCRIPTION + +##KEYWORDS('Statistics','Regression Equation') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Simple Linear Regression') +##DBsection('Regression Equation') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +for($i=0; $i<10; $i++){ + $x[$i] = random(25,80,1); + $y[$i] = int(1.2*$x[$i] + random(-4,4)); +} + +$sx =0; +$sy =0; +$sxy =0; +$sx2 =0; +$sy2 =0; +$meanx =0; +$meany =0; + +for($i=0; $i<10; $i++) { + $sx = $sx + $x[$i]; + $sy = $sy + $y[$i]; + $sxy = $sxy + ($x[$i]*$y[$i]); + $sx2 = $sx2 + ($x[$i]**2); + $sy2 = $sy2 + ($y[$i]**2); + $meanx = $meanx+$x[$i]; + $meany = $meany+$y[$i]; + +} +$meanx = $meanx/10; +$meany = $meany/10; +$ssxy = $sxy-(($sx*$sy)/10); +$ssx = $sx2-(($sx**2)/10); +$ssy = $sy2-(($sy**2)/10); + +$r = $ssxy/sqrt($ssx*$ssy); +$b1 = $ssxy/$ssx; +$b0 = $meany-$b1*$meanx; + +$popup = PopUp(["?", "yes", "no"], "no" ); + +BEGIN_TEXT +A study was conducted to detemine whether a the final grade of a student in an introductory psychology +course is linearly related to his or her performance on the verbal ability test administered before +college entrance. The verbal scores and final grades for \( 10\) students are shown in the table below. +$BR +\{begintable(3)\} +\{row("Student", "Verbal Score \(x\)", "Final Grade \(y\)")\} +\{row("\(1\)", "\($x[0]\)", "\($y[0]\)")\} +\{row("\(2\)", "\($x[1]\)", "\($y[1]\)")\} +\{row("\(3\)", "\($x[2]\)", "\($y[2]\)")\} +\{row("\(4\)", "\($x[3]\)", "\($y[3]\)")\} +\{row("\(5\)", "\($x[4]\)", "\($y[4]\)")\} +\{row("\(6\)", "\($x[5]\)", "\($y[5]\)")\} +\{row("\(7\)", "\($x[6]\)", "\($y[6]\)")\} +\{row("\(8\)", "\($x[7]\)", "\($y[7]\)")\} +\{row("\(9\)", "\($x[8]\)", "\($y[8]\)")\} +\{row("\(10\)", "\($x[9]\)", "\($y[9]\)")\} +\{endtable()\} +$BR +Find the least squares line. $PAR +\(\hat{y} = \) \{ans_rule(10)\} \(+\) \{ans_rule(10)\} \(x \) $PAR + +Should the regression be used to predict the final grade of a student with a verbal score of 100? $BR +\{$popup->menu\} + +END_TEXT +ANS(num_cmp($b0)); +ANS(num_cmp($b1)); +ANS($popup->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/gust16.pg b/Contrib/PCC/Statistics/LinearRegression/gust16.pg new file mode 100644 index 0000000000..8774e416c6 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/gust16.pg @@ -0,0 +1,54 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('What is Statistics?') +##DBsection('Introduction') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("The coefficient of determination falls between", "0 and 1."); +$mc->extra("-1 and 0 ", "-1 and 1", "negative infinity to positive infinity"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/gust17.pg b/Contrib/PCC/Statistics/LinearRegression/gust17.pg new file mode 100644 index 0000000000..9a337eddd3 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/gust17.pg @@ -0,0 +1,54 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +##DBsection('Linear regression') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("The regression line is the straight line that bests fits a set of data points according to what?", "Least sum of squares of vertical distances between data and the line."); +$mc->extra("Least sum of squares of horizontal distances between data and the line.", "Least sum of squares of distances between data and the line.", "Greatest sum of squares of vertical distances between data and the line.", "Greatest sum of squares of horizontal distances between data and the line.", "Greatest sum of squares of distances between data and the line."); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/gust18.pg b/Contrib/PCC/Statistics/LinearRegression/gust18.pg new file mode 100644 index 0000000000..77cbef3506 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/gust18.pg @@ -0,0 +1,50 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##Tagged by up2p + +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Prediction) +## Institution(ASU) +## Level(1) +## KEYWORDS('Statistics') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Using the regression equation to make predictions for values of the predictor variable outside the range of the observed values of the predictor variable is called", "Extrapolation."); +$mc->extra("Interpolation", "Generalization", "Explaination"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/gust19.pg b/Contrib/PCC/Statistics/LinearRegression/gust19.pg new file mode 100644 index 0000000000..284985c753 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/gust19.pg @@ -0,0 +1,47 @@ +##DESCRIPTION +## Statistics: Regression +##ENDDESCRIPTION + +##Tagged by up2p + +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Regression) +## Institution(ASU) +## Level(2) +## KEYWORDS('Statistics') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Before determining a regression line, it is important to do what?", "Plot the data to make sure it appears somewhat linear."); +$mc->extra("Make sure that every x value has exactly one corresponding y value", "Plot the data to make sure it does not appear linear."); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/gust22.pg b/Contrib/PCC/Statistics/LinearRegression/gust22.pg new file mode 100644 index 0000000000..c49ac61a8c --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/gust22.pg @@ -0,0 +1,58 @@ +##DESCRIPTION +## Statistics: Regression +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +##DBsection('Linear regression') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); + +$pick = random(-.975,-.75,.025); +$ans = $pick**2; +$popup = PopUp(["?", "positive", "negative", "not enough information to tell"], "negative"); + +BEGIN_TEXT + +The linear correlation coefficient of a set of data points is \($pick\). $PAR +a) Is the slope of the regression line positive or negative? $BR +\{$popup->menu\}$PAR +b) Determine the coefficient of determination. $BR +\{ans_rule(20)\}$PAR + +END_TEXT +Context("Percent"); +ANS($popup->cmp); +ANS(Percent($ans)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/gust23.pg b/Contrib/PCC/Statistics/LinearRegression/gust23.pg new file mode 100644 index 0000000000..12d8b7a3e1 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/gust23.pg @@ -0,0 +1,52 @@ +##DESCRIPTION +## Statistics: Regression +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +##DBsection('Linear regression') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$pick = random(.75,.99,.01); +$pick2 = random(-10, -1, .02); +$ans = -1*($pick**.5); + +BEGIN_TEXT + +The coefficient of determination of a set of data points is \($pick\) and the slope of the regression line is \($pick2\). Determine the linear correlation coefficient of the data. $BR +\{ans_rule(20)\}$PAR + +END_TEXT + +ANS(num_cmp($ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/gust32.pg b/Contrib/PCC/Statistics/LinearRegression/gust32.pg new file mode 100644 index 0000000000..0c2c9e30c7 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/gust32.pg @@ -0,0 +1,98 @@ +##DESCRIPTION +## Statistics: Linear regression +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +##DBsection('Linear regression') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@b = (32.98, 49.72, 88.01, 97.34, 64.30, 106.27, 52.44, 70.29, 43.58); +@ab=('32.98', '49.72', '88.01', '97.34', '64.30', '106.27', '52.44', '70.29', '43.58'); +@t = ( 4.50, 5.28, 10.00, 16.00, 7.70, 16.00, 7.00, 10.00, 5.50); +@at =('4.50', '5.28', '10.00', '16.00', '7.70', '16.00', '7.00', '10.00', '5.50'); + +@slice = NchooseK(9,6); + +@sb = @b[@slice]; +@sab = @ab[@slice]; +@st = @t[@slice]; +@sat = @at[@slice]; + +$sx = 0; +$sy = 0; +$sxy = 0; +$sx2 = 0; +$sy2 = 0; + +for($i=0;$i<6;$i++){ + $sx = $sx + $sb[$i]; + $sy = $sy + $st[$i]; + $sxy = $sxy + $sb[$i] * $st[$i]; + $sx2 = $sx2 + ($sb[$i])**2; + $sy2 = $sy2 + ($st[$i])**2; +} + +$b0 = ($sy * $sx2 - $sx * $sxy)/(6 * $sx2 - ($sx)**2); + +$b1 = (6 * $sxy - $sx * $sy)/(6 * $sx2 - ($sx)**2); + +$bill = random(40,100,5); + +$tip = $b0 + $b1*$bill; + +BEGIN_TEXT + +The amounts of 6 restaurant bills and the corresponding amounts of the tips are given in +the table below. + +\[ \begin{array}{c|cccccc} +\mbox{Bill} & $sab[0] & $sab[1] & $sab[2] & $sab[3] & $sab[4] & $sab[5] \cr +\hline +\mbox{Tip} & $sat[0] & $sat[1] & $sat[2] & $sat[3] & $sat[4] & $sat[5] \cr +\end{array} \] + +Find the following: $PAR +The regression equation for predicting tip from bill is \(\hat{y}=\) \{ans_rule(10)\} \(+\) \{ans_rule(10)\} \(x.\) $BR + +If the amount of the bill is $DOLLAR\($bill,\) the best prediction for the amount of the tip is +\{ans_rule(20)\} $BR + +END_TEXT + +Context("Currency")->flags->set("trimTrailingZeros=>1"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(tolerance=>0.05); +ANS(num_cmp($b0)); +ANS(num_cmp($b1)); +ANS(Currency($tip)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/lines1.pg b/Contrib/PCC/Statistics/LinearRegression/lines1.pg new file mode 100644 index 0000000000..f3e50d3166 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/lines1.pg @@ -0,0 +1,108 @@ +##DESCRIPTION +## Statistics: Descriptive Methods in Regression and Correlation +##ENDDESCRIPTION + +##KEYWORDS('linear equation', 'slope', 'intercept') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +## DBsection('Linear regression') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +$mc1 = new_multiple_choice(); +$mc1->qa("Which is the general form of such an equation:", +"\( y = b_0 + b_1 x \)"); +$mc1->extra("\(y = b_0 + b_1 x^2 \)", "\(y = b_0 x^{b_1}\)", +"\(y = b_0 x + b_1 z\)", "\(y = \frac{b_0}{x} + b_1 \)"); + +$mc2 = new_multiple_choice(); +$mc2->qa(" ", "a constant"); +$mc2->extra("the independent variable", "the dependent variable"); +$mc2->makeLast("a constant", "the independent variable", "the dependent variable", "none of the above"); + +$mc22 = new_multiple_choice(); +$mc22->qa(" ", "a constant"); +$mc22->extra("the independent variable", "the dependent variable"); +$mc22->makeLast("a constant", "the independent variable", "the dependent variable", "none of the above"); + +$mc3 = new_multiple_choice(); +$mc3->qa(" ", "the independent variable"); +$mc3->extra("a constant", "the dependent variable"); +$mc3->makeLast("a constant", "the independent variable", "the dependent variable", "none of the above"); + +$mc4 = new_multiple_choice(); +$mc4->qa(" ", "the dependent variable"); +$mc4->extra("the independent variable", "a constant"); +$mc4->makeLast("a constant", "the independent variable", "the dependent variable", "none of the above"); + +BEGIN_TEXT +Regarding linear equations with one independent variable: +$PAR +\{$mc1->print_q()\} +$BR +\{$mc1->print_a()\} +$PAR +The rest of the problem refers to the expression you selected above. +$BR$BR +The letter \(b_0\) is +\{$mc2->print_q()\} +$BR +\{$mc2->print_a()\} +$PAR +The letter \(b_1\) is +\{$mc22->print_q()\} +$BR +\{$mc22->print_a()\} +$PAR +The letter \(x\) is +\{$mc3->print_q()\} +$BR +\{$mc3->print_a()\} +$PAR +The letter \(y\) is +\{$mc4->print_q()\} +$BR +\{$mc4->print_a()\} +END_TEXT +ANS(radio_cmp($mc1->correct_ans)); +ANS(radio_cmp($mc2->correct_ans)); +ANS(radio_cmp($mc22->correct_ans)); +ANS(radio_cmp($mc3->correct_ans)); +ANS(radio_cmp($mc4->correct_ans)); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/lines2.pg b/Contrib/PCC/Statistics/LinearRegression/lines2.pg new file mode 100644 index 0000000000..b2cf7c5f4b --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/lines2.pg @@ -0,0 +1,94 @@ +##DESCRIPTION +## Statistics: Descriptive Methods in Regression and Correlation +##ENDDESCRIPTION + +## Tagged by sawblade + +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Regression) +## Institution(ASU) +## Level(2) +## KEYWORDS('linear equation', 'slope', 'intercept') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +$mc1 = new_multiple_choice(); +$mc1->qa("\(b_0\) is", "the \(y\)-intercept"); +$mc1->extra("the slope", "the independent variable", "the dependent variable"); + +$mc2 = new_multiple_choice(); +$mc2->qa("\(b_1\) is", "the slope"); +$mc2->extra("the \(y\)-intercept", "the independent variable", "the dependent variable"); + +$mc3 = new_multiple_choice(); +$mc3->qa("Give the geometric interpretation of \(b_0\). It indicates", +"the \(y\)-value where the straight-line graph of the linear equation intersects the \(y\)-axis"); +$mc3->extra( +"the \(x\)-value where the straight-line graph of the linear equation intersects the \(x\)-axis", "how much the \(y\)-value on the straight line changes when the \(x\)-value increases by unit", +"how much the \(x\)-value on the straight line changes when the \(y\)-value increases by unit", +); + +$mc4 = new_multiple_choice(); +$mc4->qa("Give the geometric interpretation of \(b_1\). It indicates", +"how much the \(y\)-value on the straight line changes when the \(x\)-value increases by unit"); +$mc4->extra( +"the \(x\)-value where the straight-line graph of the linear equation intersects the \(x\)-axis", +"the \(y\)-value where the straight-line graph of the linear equation intersects the \(y\)-axis", +"how much the \(x\)-value on the straight line changes when the \(y\)-value increases by unit", +); + +BEGIN_TEXT +Consider the linear equation \(y = b_0 + b_1 x\). +$PAR +a. In the equation, +\{$mc1->print_q()\} +$BR +\{$mc1->print_a()\} +$PAR +b. In the equation, +\{$mc2->print_q()\} +$BR +\{$mc2->print_a()\} +$PAR +c. +\{$mc3->print_q()\} +$BR +\{$mc3->print_a()\} +$PAR +d. +\{$mc4->print_q()\} +$BR +\{$mc4->print_a()\} +END_TEXT +ANS(radio_cmp($mc1->correct_ans)); +ANS(radio_cmp($mc2->correct_ans)); +ANS(radio_cmp($mc3->correct_ans)); +ANS(radio_cmp($mc4->correct_ans)); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/lines3.pg b/Contrib/PCC/Statistics/LinearRegression/lines3.pg new file mode 100644 index 0000000000..07b9bf50ae --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/lines3.pg @@ -0,0 +1,100 @@ +##DESCRIPTION +## Statistics: Descriptive Methods in Regression and Correlation +##ENDDESCRIPTION + +##KEYWORDS('linear equation', 'slope', 'intercept') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +## DBsection('Linear regression') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Randomization of variables +# +$c1 = - random(10, 50, 1); +$c2 = random(10, 50, 1); +$c3 = random(20, 40, 1); + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +Measuring Temperature. The two most commonly used scales for measuring temperature are the Fahrenheit and Celsius scales. If you let \(y\) denote the Fahrenheit temperature and \(x\) denote Celsius temperature, you can express the relationship between those two scales with the linear equation \( y = 32 + 1.8 x \). +$PAR +a. Determine the \(y\)-intercept \(b_0\) and the slope \(b_1\). +$BR$BR +\(b_0\) = \{ans_rule(40)\} +$BR$BR +\(b_1\) = \{ans_rule(40)\} +$PAR +b. Find the Fahrenheit temperature corresponding to the Celsius temperature \($c1^{\circ}\). +$BR +\{ans_rule(40)\} degrees +$PAR +c. Find the Fahrenheit temperature corresponding to the Celsius temperature \(0^{\circ}\). +$BR +\{ans_rule(40)\} degrees +$PAR +d. Find the Fahrenheit temperature corresponding to the Celsius temperature \($c2^{\circ}\) . +$BR +\{ans_rule(40)\} degrees +$PAR +e. Find the Fahrenheit temperature corresponding to the Celsius temperature \(100^{\circ}\). +$BR +\{ans_rule(40)\} degrees +$PAR +f. Graph the linear equation \( y = 32 + 1.8 x \), using the four points found in (b), (c), (d) and (e). This is only for your own sake and cannot currently be assessed through WeBWorK. +$PAR +g. Apply the graph obtained in part (f) to estimate visually the Fahrenheit temperature corresponding to a Celsius temperature of \($c3^{\circ}\). Then calculate that temperature exactly by using the linear equation \( y = 32 + 1.8 x \). The exact Fahrenheit temperature corresponding to the Celsius temperature of \($c3^{\circ}\) is +$BR +\{ans_rule(40)\} degrees + +END_TEXT + +$ans_a1 = 32; +$ans_a2 = 1.8; +$ans_b = 32 + 1.8 * $c1; +$ans_c = 32 + 1.8 * 0; +$ans_d = 32 + 1.8 * $c2; +$ans_e = 32 + 1.8 * 100; +$ans_g = 32 + 1.8 * $c3; +ANS(num_cmp($ans_a1)); +ANS(num_cmp($ans_a2)); +ANS(num_cmp($ans_b)); +ANS(num_cmp($ans_c)); +ANS(num_cmp($ans_d)); +ANS(num_cmp($ans_e)); +ANS(num_cmp($ans_g)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/lines4.pg b/Contrib/PCC/Statistics/LinearRegression/lines4.pg new file mode 100644 index 0000000000..708c1eae1d --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/lines4.pg @@ -0,0 +1,83 @@ +##DESCRIPTION +## Statistics: Descriptive Methods in Regression and Correlation +##ENDDESCRIPTION + +##KEYWORDS('linear equation', 'slope', 'intercept') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +## DBsection('Linear regression') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# + +$b_0 = random(1,9); +$b_1 = random(2,9); + +$mc=new_multiple_choice(); +$mc->qa("The line", "slopes upward"); +$mc->extra("slopes downward", "is horizontal"); +$mc->makeLast("none of the above"); + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +$PAR +For the equation \(y = $b_0 + $b_1 x\), +$PAR +a. The \(y\)-intercept is \{ans_rule(20)\}, and the slope is \{ans_rule(20)\}. +$PAR +b. +\{ $mc->print_q() \} +$BR +\{ $mc->print_a() \} + +$PAR +c. Use two points to graph the equation. This is only for your own sake and cannot currently be assessed through WeBWorK. + +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# +$ans_a1 = $b_0; +$ans_a2 = $b_1; +ANS(num_cmp($ans_a1)); +ANS(num_cmp($ans_a2)); +ANS(radio_cmp($mc->correct_ans)); +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/LinearRegression/lines5.pg b/Contrib/PCC/Statistics/LinearRegression/lines5.pg new file mode 100644 index 0000000000..062950d2e8 --- /dev/null +++ b/Contrib/PCC/Statistics/LinearRegression/lines5.pg @@ -0,0 +1,82 @@ +##DESCRIPTION +## Statistics: Descriptive Methods in Regression and Correlation +##ENDDESCRIPTION + +##KEYWORDS('linear equation', 'slope', 'intercept') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +## DBsection('Linear regression') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# + +$b_1 = random(1,9) - 0.5; +$b_0 = random(1,9); +$mc=new_multiple_choice(); +$mc->qa("The line", "slopes upward"); +$mc->extra("slopes downward", "is horizontal"); +$mc->makeLast("none of the above"); + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +$PAR +For the equation \(y = $b_1 x - $b_0\), +$PAR +a. The \(y\)-intercept is \{ans_rule(20)\}, and the slope is \{ans_rule(20)\}. +$PAR +b. +\{ $mc->print_q() \} +$BR +\{ $mc->print_a() \} +$PAR +c. Use two points to graph the equation on paper. This is only for your own sake and cannot currently be assessed through WeBWorK. + +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# +$ans_a1 = - $b_0; +$ans_a2 = $b_1; +ANS(num_cmp($ans_a1)); +ANS(num_cmp($ans_a2)); +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_03_Probability.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_03_Probability.pg new file mode 100644 index 0000000000..ffd616f0b2 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_03_Probability.pg @@ -0,0 +1,76 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl",, + "answerHints.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(0.1, 0.5, 0.1); +$b = random(0.1, 0.4, 0.1); + +$mc = new_multiple_choice(); + $mc->qa("If the knowledge that an event A has occurred implies that a second event B cannot occur, + then the events A and B are said to be ","disjoint. "); + $mc->extra("independent. ", + "collectively exhaustive. ", + "the sample space. "); + +###################################### +# Main text + +BEGIN_TEXT +$PAR +(a) \{ $mc -> print_q() \} +$BR +\{$mc -> print_a() \} + +$PAR +(b) If event A and event B are as above and event A has probability $a and event B has probability $b, +then the probability that A or B occurs is \{ans_rule(15)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc->correct_ans)); + +Context("Percent"); +$ans_b = $a + $b; +ANS(Percent($ans_b)->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_05_Probability.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_05_Probability.pg new file mode 100644 index 0000000000..f50ae02a5a --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_05_Probability.pg @@ -0,0 +1,78 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl",, + "answerHints.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(0.3, 0.4, 0.01); +$b = random(0.15, 0.35, 0.1); + +###################################### +# Main text + +BEGIN_TEXT +Government data assign a single cause for each death that occurs in the United States. +In a certain city, the data show that the probability is $a that a randomly chosen death +was due to cardiovascular (mainly heart) disease, and $b that it was due to cancer. + +$PAR +(a) The probability that a death was due either to cardiovascular disease +or to cancer is \{ans_rule(15)\}. + +$PAR +(b) The probability that the death was due to some other cause is \{ans_rule(15)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = $a + $b; +Context("Percent"); +ANS(Percent($ans_a)->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +$ans_b = 1 - $ans_a; +ANS(Percent($ans_b)->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_09_Probability.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_09_Probability.pg new file mode 100644 index 0000000000..4942d2bea6 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_09_Probability.pg @@ -0,0 +1,139 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz, E Cabrera') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$p3 = random(.05,.1,.01); +$p4 = random(.2,.3,.01); +$p6 = random(.15,.2,.01); +$p7 = random(.03,.05,.01); +$p8 = random(.03,.05,.01); +$p9 = $p8 - random(.01,.02,.01); +$p10 = random(.01,.03,.01); +$p5 = 1 - $p3 - $p4 - $p6 - $p7 - $p8 - $p9 - $p10; + +@event = ("What is the probability that a unit chosen at random has three rooms? + \(P(X=3)=\)", + "What is the probability that a unit chosen at random has less than five + rooms? \(P(X<5)=\)", + "What is the probability that a unit chosen at random is not a 10-room unit? + \(P(X \neq 10)=\)", + "What is the probability that a unit chosen at random has more than 5 rooms? + \(P(X > 5)=\)", + "What is the probability that a unit chosen at random has between four and + six rooms? \(P(4 \leq X \leq 6)=\)"); + +@ans = ($p3, ($p3+$p4), ($p3+$p4+$p5+$p6+$p7+$p8+$p9), ($p6+$p7+$p8+$p9+$p10), + ($p4+$p5+$p6)); + +@slice = NchooseK(5,3); +@sevent = @event[@slice]; +@sans = @ans[@slice]; + +$popup = PopUp(["?","discrete","continuous"],"discrete"); + +###################################### +# Main text + +BEGIN_TEXT +Let the random variable \( X \) be the number of rooms in a randomly chosen owner-occupied housing unit in a certain city. The distribution for the units is given +below. +$PAR +$BCENTER +\{begintable(9)\} +\{row("\(X\)", "3", "4", "5", "6", "7", "8", "9", " 10 ")\} +\{row("\( P(X) \)", "\($p3\)", "\($p4\)", "\($p5\)", "\($p6\)", "\($p7\)", "\($p8\)", "\($p9\)", " ? " )\} +\{endtable()\} +$ECENTER +$PAR +(a) Is \(X\) a discrete or continuous random variable? \{$popup->menu\} + +$PAR +(b) What must be the probability of choosing a unit with 10 rooms? + \(P(X = 10) =\) \{ans_rule(10)\} + +$PAR +(c) $sevent[0] \{ans_rule(10)\} + +$PAR +(d) $sevent[1] \{ans_rule(10)\} + +$PAR +(e) $sevent[2] \{ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + + + +ANS($popup->cmp); + +Context("Percent"); +$ans_b = Percent($p10); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +$ans_c = Percent($sans[0]); +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +$ans_d = Percent($sans[1]); +ANS($ans_d->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +$ans_e = Percent($sans[2]); +ANS($ans_e->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_12_Probability.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_12_Probability.pg new file mode 100644 index 0000000000..0dcc3831e7 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/10Stats_12_Probability.pg @@ -0,0 +1,91 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'sample space', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz') +## Institution('The College of Idaho') +## Date: 2009/03 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@event = ("\( X = 1\)", "\( X = 2\)"); +$choose = random(0,1,1); + +###################################### +# Main text + +BEGIN_TEXT +Suppose a couple planned to have three children. Let \( X \) be the number +of girls the couple has.$PAR + +$PAR +(a) List all possible arrangements of girls and boys. For example, one possible arrangement is 2 girls and then a boy, which you would represent as $BBOLD GGB$EBOLD. (Separate each + item in your list with a comma.): \{ans_rule(60)\}. + +$PAR +(b) List the sample space for \( X \). (i.e. List the possible values that \( X \) + may take, separated by commas.): \{ans_rule(20)\}. + +$PAR +(c) What is the probability that $event[$choose]? \{ans_rule(10)\} $PAR + +$PAR +(d) Find the probability that the couple have three boys: \{ans_rule(15)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; +Context("Numeric"); +Context()->strings->add("GGG"=>{}, + "GGB"=>{}, + "GBG"=>{}, + "BGG"=>{}, + "BBG"=>{}, + "BGB"=>{}, + "GBB"=>{}, + "BBB"=>{}); + + +$ans_a = List("GGG", "GGB", "GBG", "BGG", "BBG", "BGB", "GBB", "BBB"); +ANS($ans_a->cmp); + +$ans_b = List(0, 1, 2, 3); +ANS($ans_b->cmp); + +Context("Percent"); +$ans_c = Percent(0.375); +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."]))); + +$ans_d = Percent("1/8"); +ANS($ans_d->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."]))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes1.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes1.pg new file mode 100644 index 0000000000..b0045f9ab7 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes1.pg @@ -0,0 +1,66 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Conditional Probability') +## KEYWORDS('Bayes' , 'probability', 'conditional') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/28/05 +# from pl/setProbability4Conditional/p3.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$pd = random(7,9,.5)/10; +$pdw = random(4,6,.5)/10; +$w = random(8,9,.1)/10; +$ww = $w*100; + +$ans1 = $w*$pdw + (1-$w)*$pd; +$ans2 = ((1-$w)*$pd)/($w * $pdw + (1-$w)*$pd); + +BEGIN_TEXT + +You ask a neighbor to water a sickly plant while you are on vacation. +Without water the plant will die with probability $pd. With water it will die +with probability $pdw. You are $ww$PERCENT certain the neighbor will remember +to water the plant. +$BR +When you are on vacation, find the probability that the plant will die. +$BR +\{ ans_rule(10) \} +$BR +$BR +You come back from the vacation and the plant is dead. What is the probability +the neighbor forgot to water it? +$BR +\{ ans_rule(10) \} +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); + +ANS(Percent($ans2)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes2.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes2.pg new file mode 100644 index 0000000000..c0041fdb73 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes2.pg @@ -0,0 +1,65 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Conditional Probability') +## KEYWORDS('Bayes' , 'probability', 'conditional') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/28/05 +# from pl/setProbability4Conditional/p2.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n1 = random(2,4,1); +$n2 = random(5,7,1); +$pda = random(10,40)/1000; +$pdb = random(20,50)/1000; +$pdc = random(30,60)/1000; + +@fac = ("A","B","C"); +$ind = random(0,2,1); +$refac = $fac[$ind]; + + +@num = ($n1*$pda,$n2*$pdb,$pdc); +$renum = $num[$ind]; +$denom = $n1*$pda+$n2*$pdb+$pdc; +$ans = $renum/$denom; + +BEGIN_TEXT +Factories A, B and C produce computers. Factory A produces $n1 times as many computers as factory C. And factory B produces $n2 times as many computers +as factory C. The probability that a computer produced by factory A is defective is $pda, the probability that a computer produced by factory B is defective is $pdb, and the probability that a computer produced by factory C is defective is $pdc. + +$BR +A computer is selected at random and it is found to be defective. What is the +probability it came from factory $refac? +$BR +\{ans_rule(20)\} $BR + +END_TEXT +Context("Percent"); + +ANS(Percent($ans)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes3.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes3.pg new file mode 100644 index 0000000000..388782fb4b --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes3.pg @@ -0,0 +1,102 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Conditional Probability') +## KEYWORDS('Bayes' , 'probability', 'conditional') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/28/05 +# from pl/setProbability4Conditional/p12.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PGasu.pl", +"PGauxiliaryFunctions.pl", +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserPopUp.pl", +); + +TEXT($BEGIN_ONE_COLUMN); +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(50,100); +$b = random(20,80); +$c = random(10,40); +$d = random(10,100); +$e = random(20,80); +$f = random(10,20); + +$total = $a + $b + $c + $d + $e + $f; +$Mtotal = $a + $b +$c; +$Ftotal = $d+ $e +$f; +$Rtotal = $a+$d; +$Dtotal = $b+ $e; +$Itotal = $c+$f; + +@event1 = ("Male","Female"); +@event2 = ("Republican","Democrat","Independent"); +@mrow = ($a,$b,$c); +@frow = ($d,$e,$f); +$ind1 = random(0,1,1); +$ind2 = random(0,2,1); +$reevent1 = $event1[$ind1]; +$reevent2 = $event2[$ind2]; + +if ($ind1 == 0) {@xrow = @mrow;} else {@xrow = @frow;} + +if ($xrow[$ind2]*$total == ($mrow[$ind2]+$frow[$ind2])*($xrow[0]+$xrow[1]+$xrow[2])) {$ans="Yes";} else {$ans="No";} + +$popup = PopUp(["?","Yes","No"],$ans); + +BEGIN_TEXT +In a survey of $total people, the following data were obtained relating +gender to political orientation: +$BCENTER +\{begintable(5)\} +\{row(" ", "Republican (R)", "Democrat (D)","Independent (I)", "Total" )\} +\{row("Male (M)", "$a", "$b", "$c","$Mtotal ") \} +\{row("Female (F)", "$d", "$e",,"$f"," $Ftotal ") \} +\{row("Total", "$Rtotal", "$Dtotal","$Itotal","$total")\} +\{endtable()\} +$ECENTER +$PAR +A person is randomly selected. What is the probability that the person is: +$BR +a) Male? \{ ans_rule(20) \} +$BR +b) Male and a Democrat? \{ ans_rule(20) \} +$BR +c) Male given that the person is a Democrat? \{ ans_rule(20) \} +$BR +d) Republican given that the person is Male? \{ ans_rule(20) \} +$BR +e) Female given that the person is an Independent? \{ ans_rule(20) \} +$BR +f) Are the events $reevent1 and $reevent2 independent? \{ $popup->menu \} + +END_TEXT +Context("Percent"); +ANS(Percent($Mtotal/$total)->cmp); +ANS(Percent($b/$total)->cmp); +ANS(Percent($b/$Dtotal)->cmp); +ANS(Percent($a/$Mtotal)->cmp); +ANS(Percent($f/$Itotal)->cmp); + +ANS($popup->cmp); +TEXT($END_ONE_COLUMN); +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes7.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes7.pg new file mode 100644 index 0000000000..f48a963aef --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/Bayes7.pg @@ -0,0 +1,96 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Conditional Probability') +## KEYWORDS('Bayes' , 'probability', 'conditional') +## Author('Monika Keindl') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/13/10 +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGgraphmacros.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "MathObjects.pl", + "contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$i = random(55,70,5)/100; #work values +$ni = 1-$i; + +$u = random(10,15,1)/100; +$n= random(21,25,1)/100; +$f=1-$u-$n; + +$nu=random(35,40,1)/100; +$nn=random(13,18,1)/100; +$nf=1-$nu-$nn; + +$di=$i*100; #display values +$dni=$ni*100; +$du=$u*100; +$dn=$n*100; +$df=$f*100; +$dnu=$nu*100; +$dnn=$nn*100; +$dnf=$nf*100; + + +$ans1 =$i*$f+$ni*$nf; +$ans2 =$i*$f/$ans1; +$ans3 =($ni*$nu)/($i*$u+$ni*$nu); + + +BEGIN_TEXT + +Scientific research on popular beverages consisted of +$di studies that were fully sponsored by the food industry, and $dni studies +that were conducted with no corporate ties. Of those that were fully +sponsored by the food industry, $du$PERCENT of the participants found +the products unfavorable, $dn$PERCENT were neutral, and $df$PERCENT +found the products favorable. Of those that had no industry funding, +$dnu$PERCENT found the products unfavorable, $dnn$PERCENT were neutral, and $dnf$PERCENT found the products favorable. +$BR +What is the probability that a participant selected at random found the +products favorable? +$BR + +\{ ans_rule(10) \} + +$BR +If a randomly selected participant found the product favorable, what is +the probability that the study was sponsored by the food industry? +$BR +\{ ans_rule(10) \} +$BR +If a randomly selected participant found the product unfavorable, what +is the probability that the study had no industry funding? +$BR +\{ ans_rule(10) \} + + +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp); + +ANS(Percent($ans2)->cmp); + +ANS(Percent($ans3)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/compprob4.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/compprob4.pg new file mode 100644 index 0000000000..77b3a415ed --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/compprob4.pg @@ -0,0 +1,71 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## KEYWORDS('probability') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/20/05 +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$marfrac = random(50,60,1); +$cgfrac = random(15,45,1); +@frac = ("1/6","1/5","1/4","1/3","1/2"); +@numfrac = (1/6,1/5,1/4,1/3,1/2); +$ind = random(0,4,1); +$refrac = $frac[$ind]; +$renumfrac = $numfrac[$ind]; + +$ansb = $marfrac - $cgfrac*$renumfrac; +$ansc = $marfrac + $cgfrac*(1-$renumfrac); +$ansa = 100-$ansc; + +BEGIN_TEXT +Employment data at a large company reveal that $marfrac$PERCENT of the workers are married, that $cgfrac$PERCENT are college graduates, and that $refrac of the college graduates are married. +$PAR +$PAR +What is the probability that a randomly chosen worker is: +$BR +a) neither married nor a college graduate? +$BR + \{ans_rule(10)\} +$BR +b) married but not a college graduate? +$BR + \{ans_rule(10)\} +$BR +c) married or a college graduate? +$BR + \{ans_rule(10)\} + +END_TEXT +Context("Percent"); +ANS(Percent($ansa/100)->cmp); +ANS(Percent($ansb/100)->cmp); +ANS(Percent($ansc/100)->cmp); + + + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/comprob10.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/comprob10.pg new file mode 100644 index 0000000000..949576add0 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/comprob10.pg @@ -0,0 +1,72 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Conditional Probability') +## KEYWORDS('probability') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/1/05 +# from pl/setProbability4Conditional/p11.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserPopUp.pl" +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; + +$r =random(0.1,0.9,0.1); +$d = random(0.1,0.9,0.1); +$b = random(0.1,1/(1+$r*(1-$d)),0.05); + + +$a = $r*$b; +$c = $r*$d; + +$pef = $c*$b; + +$ans1 = $a; +$ans2 = $b; +$ans3 = $a+$b - $pef; + +if ($a*$b == $pef ) {$ans="Yes";} else {$ans="No";} +$popup = PopUp(["?","Yes","No"],$ans); + +BEGIN_TEXT +$BR +If \( P(E \text{ and } F) = $pef \), \( P(E \mid F) = $c \), and \( P(F \mid E) = $d \), then $BR +(a) $SPACE \( P(E) = \)\{ans_rule(20)\} $BR +(b) $SPACE \( P(F) = \)\{ans_rule(20)\} $BR +(c) $SPACE \( P(E \text{ or } F) = \)\{ans_rule(20)\} $BR +(d) Are the events \( E \) and \( F \) independent? \{$popup->menu\} + + +END_TEXT + +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Percent($ans3)->cmp); + +ANS($popup->cmp); + + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_2.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_2.pg new file mode 100644 index 0000000000..38d06a37c1 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_2.pg @@ -0,0 +1,71 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGauxiliaryFunctions.pl", +"PGanswermacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(0.1,0.9,.1); +$a2 = random(3,4,.1); +$a3 = random(-3,-2,.1); +$nn = random(2,5); +$den = 6; $g = gcd($nn, $den); +$nn = $nn/$g; +$den = $den/ $g; + + +@event = ('event the die comes up even', 'event the die comes up odd', 'event the die comes up with a value of 4 or more', 'event the die comes up with a value at most 2' , 'event the die comes up with a value of 3'); +@ans = ("{2,4,6}", "{1,3,5}", "{4,5,6}", "{1,2}", "{3}"); + +@slice = NchooseK(5,3); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + +BEGIN_TEXT + +One die is rolled. List the outcomes comprising the following events: (use a comma between each outcome): +$PAR + +(a) $sevent[0] $BR +\{ans_rule(20)\} $PAR +(b) $sevent[1] $BR +\{ans_rule(20)\} $PAR +(c) $sevent[2] $BR +\{ans_rule(20)\} $PAR + +END_TEXT +Context("Numeric"); +ANS(Compute($sans[0])->cmp); +ANS(Compute($sans[1])->cmp); +ANS(Compute($sans[2])->cmp); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_4.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_4.pg new file mode 100644 index 0000000000..00f21eae50 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_4.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Mutual Exclusivity') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGauxiliaryFunctions.pl", +"PGanswermacros.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@event = ( +'Are events A and B disjoint?' , +'Are events A and C disjoint?', +'Are events B and C disjoint?', +'Are events A and D disjoint?' , +'Are events A and E disjoint?', +'Are events C and D disjoint?', +'Are events C and E disjoint?', +'Are events A , B and C disjoint?', +'Are events A , B and D disjoint?', +'Are events C, D and E disjoint?'); +@ans = ("Yes", "No", "No", "No", "Yes", "Yes", "Yes", "No", "No", "Yes"); + +@slice = NchooseK(10,5); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + +for my $i (0..4) {$popup[$i] = PopUp(["?","Yes","No"],$sans[$i]);}; + +BEGIN_TEXT + +One die is rolled. Let: $BR $BR + +A = event the die comes up even $BR +B = event the die comes up odd $BR +C = event the die comes up with a value of 4 or more $BR +D = event the die comes up with a value of at most 2 $BR +E = event the die comes up with a value of 3 $BR $BR + +$PAR + +(a) \( \) $sevent[0] +\{$popup[0]->menu\} $PAR +(b) \( \) $sevent[1] +\{$popup[1]->menu\} $PAR +(c) \( \) $sevent[2] +\{$popup[2]->menu\} $PAR +(d) \( \) $sevent[3] +\{$popup[3]->menu\} $PAR +(e) \( \) $sevent[4] +\{$popup[4]->menu\} $PAR + + +END_TEXT + +ANS($popup[0]->cmp); +ANS($popup[1]->cmp); +ANS($popup[2]->cmp); +ANS($popup[3]->cmp); +ANS($popup[4]->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_5.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_5.pg new file mode 100644 index 0000000000..6cebc4172e --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_5.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@quest1 = ('\( P(A) \)', '\( P(B) \)', '\( P(C) \)', + '\( P(\textrm{not }A) \)', '\( P(\textrm{not }B) \)', '\( P(\textrm{not }C) \)'); +@quest2 = ('\( P(A \textrm{ or } B) \)', '\( P(A \textrm{ and } B) \)', + '\( P(A \textrm{ or } C) \)', '\( P(A \textrm{ and } C) \)', + '\( P(B \textrm{ or } C) \)', '\( P(B \textrm{ and } C) \)', + '\( P(A \textrm{ or } (\textrm{not }B)) \)', '\( P((\textrm{not }A) \textrm{ and } B) \)', + '\( P((\textrm{not }A) \textrm{ or } C) \)', '\( P(A \textrm{ and } (\textrm{not }C)) \)', + '\( P(B \textrm{ or } (\textrm{not }C)) \)', '\( P((\textrm{not }B) \textrm{ and } C) \)',); +@quest3 = ('\( P(A \textrm{ or } B \textrm{ or } C) \)', '\( P(A \textrm{ and } B \textrm{ and } C) \)', + '\( P((\textrm{not }A) \textrm{ or } B \textrm{ or } C) \)', '\( P((\textrm{not }A) \textrm{ or } (\textrm{not }B) \textrm{ or } C) \)', + '\( P((\textrm{not }A) \textrm{ or } B \textrm{ or } (\textrm{not }C)) \)'); + +@ans1 = (7/8, 1/2, 1/2, 1/8, 1/2, 1/2); +@ans2 = (7/8, 1/2, 7/8, 1/2, 7/8, 1/8, 1, 0, 5/8, 3/8, 5/8, 3/8); +@ans3 = (7/8, 1/8, 1, 5/8, 5/8); + +$tag1 = random(0,5,1); +$tag2 = random(0,11,1); +$tag3 = random(0,4,1); + +$LEFT_BRACE = '\{'; +$RIGHT_BRACE = '\}'; + + +BEGIN_TEXT +$PAR +A fair coin is tossed three times and the events \(A\), \(B\), and \(C\) are defined as follows: +$PAR +\( A: $LEFT_BRACE \) At least one head is observed \( $RIGHT_BRACE \) $BR + +\( B: $LEFT_BRACE \) At least two heads are observed \( $RIGHT_BRACE \) $BR + +\( C: $LEFT_BRACE \) The number of heads observed is odd \( $RIGHT_BRACE \) $PAR + +Find the following probabilities by summing the probabilities of the appropriate outcomes: +$PAR +(a) $quest1[$tag1] \( = \) \{ans_rule(5)\} $BR + +(b) $quest2[$tag2] \( = \) \{ans_rule(5)\} $BR + +(c) $quest3[$tag3] \( = \) \{ans_rule(5)\} + +END_TEXT + +Context("Percent"); +ANS(Percent($ans1[$tag1])->cmp); +ANS(Percent($ans2[$tag2])->cmp); +ANS(Percent($ans3[$tag3])->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_5.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_5.pg new file mode 100644 index 0000000000..e340ccff73 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_5.pg @@ -0,0 +1,80 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$a = random(15,60,5)/100; +$b = 1-$a-.1; + + +BEGIN_TEXT +If \(A\) and \(B\) are two disjoint events with +\( P(A)= $a \) and \( P(B)=$b \), find the following probabilities: +$BR +a) $SPACE \(P(A \textrm{ and } B) = \) +\{ ans_rule(10) \} +$BR +b) $SPACE \(P(A \textrm{ or } B) = \) +\{ ans_rule(10) \} +$BR +c) $SPACE \(P( \textrm{not }A ) = \) +\{ ans_rule(10) \} +$BR +d) $SPACE \(P( \textrm{not }B ) = \) +\{ ans_rule(10) \} +$BR +e) $SPACE \(P( \textrm{not }(A \textrm{ or } B)) = \) +\{ ans_rule(10) \} +$BR +f) $SPACE \(P( A \textrm{ and } (\textrm{not }B) ) = \) +\{ ans_rule(10) \} +END_TEXT + +$ans2 = $a +$b; +$ans3 = 1-$a; +$ans4 = 1-$b; +$ans5 = 1-$ans2; +$ans6= $a; + +Context("Percent"); +ANS(Percent( 0 )->cmp ); +ANS(Percent( $ans2 )->cmp ); +ANS(Percent( $ans3 )->cmp ); +ANS(Percent( $ans4 )->cmp ); +ANS(Percent( $ans5 )->cmp ); +ANS(Percent( $ans6 )->cmp ); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_6.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_6.pg new file mode 100644 index 0000000000..49c4154560 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_6.pg @@ -0,0 +1,77 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl" +); + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$a = random(35,50,5)/100; +$c = random(5,20,5)/100; +$b = 1-$a -$c-.05; +$A = $a +$c; +$B = $b +$c; + +BEGIN_TEXT +If \(P(A)=$A, \) \(P(B)=$B \) and +\( P(A \textrm{ and } B)= $c, \) find the following probabilities: +$PAR +a) $SPACE \(P(A \textrm{ or } B) = \) +\{ ans_rule(10) \} +$BR +b) $SPACE \(P( \textrm{not }A ) = \) +\{ ans_rule(10) \} +$BR +c) $SPACE \(P( \textrm{not }B ) = \) +\{ ans_rule(10) \} +$BR +d) $SPACE \(P( A \textrm{ and } (\textrm{not }B) ) = \) +\{ ans_rule(10) \} +$BR +e) $SPACE \(P( \textrm{not }(A \textrm{ and } B)) = \) +\{ ans_rule(10) \} +END_TEXT + +$ans1 = $a+$b+$c; +$ans2 = 1-$A; +$ans3 = 1-$B; +$ans4 = $a; +$ans5 = 1-$c; + +Context("Percent"); +ANS(Percent( $ans1 )->cmp ); +ANS(Percent( $ans2 )->cmp ); +ANS(Percent( $ans3 )->cmp ); +ANS(Percent( $ans4 )->cmp ); +ANS(Percent( $ans5 )->cmp ); + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/kolossa27.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/kolossa27.pg new file mode 100644 index 0000000000..8515e17e74 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/kolossa27.pg @@ -0,0 +1,97 @@ +##DESCRIPTION +## Statistics: Random sampling +##ENDDESCRIPTION + +##KEYWORDS('probability','random sampling', 'probability distributions') +## Tagged by sawblade + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@event = ('\(A\)','\(B\)', '\(C\)','\(D\)', + 'not \(B\)', 'not \(D\)', 'not \(A\)', + '\(C\) and \(D\)', '\(B\) and \(D\)', + '\(A\) and \(D\)', 'not \(C\)', + '\(A\) or \(D\)', '\(A\) or \(C\)'); + +$a = .01; +$b = .41; +$c = .99; +$d = .56; +$e = .59; +$f = .44; +$g = .55; +$h = .42; +$k = 1; + +@ans = ($a, $b, $c, $d, $e, $f, $c, $g, $b,$a,$a, $d,$k); + +@slice = NchooseK(13,5); +@sevent = @event[@slice]; +@sans = @ans[@slice]; + +BEGIN_TEXT + +The age distribution for senators in the 104th U.S. Congress was as follows: $PAR +$BCENTER +\{begintable(6)\} +\{row("age", "under 40", "40-49", "50-59", "60-69", "70 and over")\} +\{row("no. of senators", "1", "14", "41", "27", "17")\} +\{endtable()\} +$ECENTER +$PAR +A senator from the 104th Congress is chosen at random. Consider the following four events: $PAR + +\(A\) = the senator is under 40 $BR +\(B\) = the senator is in his or her 50s $BR +\(C\) = the senator is 40 or older $BR +\(D\) = the senator is under 60 $BR + +$PAR + +Find each probability expressed below: $PAR $BR + +(a) \(P(\)$sevent[0]\() =\) \{ans_rule(10)\} $PAR +(b) \(P(\)$sevent[1]\() =\) \{ans_rule(10)\} $PAR +(c) \(P(\)$sevent[2]\() =\) \{ans_rule(10)\} $PAR +(d) \(P(\)$sevent[3]\() =\) \{ans_rule(10)\} $PAR +(e) \(P(\)$sevent[4]\() =\) \{ans_rule(10)\} + +END_TEXT + +Context("Percent"); +ANS(Percent($sans[0])->cmp); +ANS(Percent($sans[1])->cmp); +ANS(Percent($sans[2])->cmp); +ANS(Percent($sans[3])->cmp); +ANS(Percent($sans[4])->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/kolossa7.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/kolossa7.pg new file mode 100644 index 0000000000..93a77cfb4c --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/kolossa7.pg @@ -0,0 +1,90 @@ +##DESCRIPTION +##KEYWORDS('probability','random sampling', 'probability distributions') +## +##ENDDESCRIPTION + +## Tagged by sawblade + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(18,20,1); +$a2 = $a1+1; +$a3 = $a2+1; +$a4 = $a3+1; +$a5 = $a4+1; + +$f2 = random(1,10,1); +$f1 = random(5,25,1); +$f3 = random(4,14,1); +$f4 = random(2,8,1); +$f5 = random(1,5,1); + +$n = $f1+$f2+$f3+$f4+$f5; + +@event = ("P(x=$a3)", + "P(x>$a2)", + "P(x\ge $a2)", + "P(x\le $a4)", + "P(x\ge $a4 \mbox{ or } x<$a2)", + "P(x<$a5)", + "P(x=$a1)", + "P($a1\le x <$a3)"); + +@ans = ("$f3/$n", "($f3+$f4+$f5)/$n", "($f2+$f3+$f4+$f5)/$n", "($f1+$f2+$f3+$f4)/$n", "($f4+$f5+$f1)/$n", "($f1+$f2+$f3+$f4)/$n", "$f1/$n", +"($f1+$f2)/$n"); + +@slice = NchooseK(8,3); +@sevent = @event[@slice]; +@sans = @ans[@slice]; + +BEGIN_TEXT +Let \( x \) be the ages of students in a MTH 111 class. Given the frequency distribution \( F(x) \) below, determine the following probabilities: +$PAR +$BCENTER +\{begintable(6)\} +\{row("\(x\)", "\($a1\)", "\($a2\)", "\($a3\)", "\($a4\)", "\($a5\)")\} +\{row("\(F(x)\)", "\($f1\)", "\($f2\)", "\($f3\)", "\($f4\)", "\($f5\)")\} +\{endtable()\} +$ECENTER +$PAR +(a) \( $sevent[0] =\) \{ans_rule(10)\} $PAR +(b) \( $sevent[1] =\) \{ans_rule(10)\} $PAR +(c) \( $sevent[2]=\) \{ans_rule(10)\} + + +END_TEXT +Context("Percent"); + +ANS(Percent($sans[0])->cmp); +ANS(Percent($sans[1])->cmp); +ANS(Percent($sans[2])->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/p1.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/p1.pg new file mode 100644 index 0000000000..7c8131d98f --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/p1.pg @@ -0,0 +1,82 @@ +##DESCRIPTION +## Probability distributions +##ENDDESCRIPTION + +## KEYWORDS('Random Variable', 'Probability Density Function', 'PDF', 'Probability Distribution') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + + +$b[0] = random(0,.3,.1); +$b[1] = random(.1,.3,.1); +$b[2] = random(.1,.3,.1); +$b[3] = 1-$b[0]-$b[1]-$b[2]; + +$b1 = random(0,.3,.1); +$b2 = random(.1,.3,.1); +$b3 = random(-.3,-.1,.1); +$b4 = 1-$b1-$b2-$b3; + +$a = random(2,5,1); + + +@second_row = ($b[0], $b[1], $b[2], $b[3]); +@slice = NchooseK(4,4); +@ssecond_row = @second_row[@slice]; + +$popup1 = PopUp(["?","This is a valid probability model","This is not a valid probability model"],"This is a valid probability model"); +$popup2 = PopUp(["?","This is a valid probability model","This is not a valid probability model"],"This is not a valid probability model"); + +BEGIN_TEXT + +Determine whether the following are valid probability models or not. $PAR +(a) +\{begintable(5)\} +\{row("Event", "\( e_1\)", "\( e_2\)", "\(e_3\)", "\( e_4\)")\} +\{row(" Probability", "\($ssecond_row[0]\)", "\($ssecond_row[1]\)", "\($ssecond_row[2]\)", "\($ssecond_row[3]\)" )\} +\{endtable()\} + + \{$popup1->menu\}$PAR + +(b) +\{begintable(5)\} +\{row("Event", "\( e_1\)", "\( e_2\)", "\( e_3\)", "\( e_4\)")\} +\{row(" Probability ", "\($b1\)", "\($b2\)", "\($b3\)", "\($b4\)" )\} +\{endtable()\} + + \{$popup2->menu\} + +END_TEXT +ANS($popup1->cmp); +ANS($popup2->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/spinner1.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/spinner1.pg new file mode 100644 index 0000000000..6459cddfac --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/spinner1.pg @@ -0,0 +1,60 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## KEYWORDS('probability') +## Author('N. Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/15/05 +# Location: Northern Arizona University + +DOCUMENT(); + +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGnauStats.pl", + "MathObjects.pl", + "contextPercent.pl", +); + +TEXT(&beginproblem); +$n = random(3 ,4, 1 ); +for( $i = 0; $i < $n; $i++ ){ $val = random( 1, 4, 1 ); +push @list, $val; +} +$total = 0; +foreach $val(@list){$sum = $total + $val; + $total = $sum; +} +$pic = PieChart( @list ); +@letter = ( 'an A', 'a B', 'a C', 'a D' ); +$ind1 = random( 0, $n - 1, 1 ); +$ind2 = random( 0, $n - 1, 1 ); +@slice = NchooseK( $n, 2 ); +$ans1 = ( $list[$ind1] * $list[$ind2] ) / $sum ** 2; +$nss = $sum - $list[$slice[1]]; +$ans2 = $list[$slice[0]] / $nss; + +BEGIN_TEXT + +Based on the spinner below answer the following:$PAR +(a) In two consecutive spins what, is the probability of $letter[$ind1] followed by $letter[$ind2]? +$BR \{ ans_rule( 15 ) \} $PAR +(b) In a single spin, what is the probability of obtaining $letter[$slice[0]] given the spinner did not land on +$letter[$slice[1]]? +$BR \{ ans_rule( 15 ) \} $PAR +$PAR +$BCENTER +\{ Plot($pic) \} +$ECENTER +END_TEXT +Context("Percent"); + +ANS( Percent( $ans1 )->cmp ); +ANS( Percent( $ans2 )->cmp ); + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/sspaces1.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/sspaces1.pg new file mode 100644 index 0000000000..45c1d565da --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/sspaces1.pg @@ -0,0 +1,53 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## KEYWORDS('probability') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/17/05 +# from setProbability1Combinations/ur_pb_1_5.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,4,1); +$b = random(($a+1),9,1); + +$ans1 = 2**$a; +$ans2 = 2**$b; +$ans3 = "2^n"; + +BEGIN_TEXT + +Determine the size of the sample space that corresponds to the experiment of +tossing a coin the following number of times:$PAR +(a) $SPACE \($a\) times $PAR + \{ans_rule(10)\} $PAR +(b) $SPACE \($b\) times $PAR + \{ans_rule(10)\} $PAR +(c) $SPACE \(n\) times (the answer to this part is not a number; it is a formula with \(n\) in it)$PAR + \{ans_rule(10)\} + +END_TEXT +ANS(num_cmp($ans1)); +ANS(num_cmp($ans2)); +ANS(function_cmp($ans3, "n")); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-07.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-07.pg new file mode 100644 index 0000000000..434ddd9456 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-07.pg @@ -0,0 +1,57 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('conditional', 'probability') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/7/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +do {$a = random(.15,.35,.01); +$b = random(.59,.89,.01); +$banda = random(.26,.44,.01);} until (($banda < $a) and ($banda < $b) and ($a + $b - $banda) < 1); +# edited this way to preserve existing, unbroken versions + +BEGIN_TEXT +Suppose that \(A\) and \(B\) are two events for which +\(P(A) = $a\), \(P(B) = $b\), and \(P(A\;\mathrm{and}\;B) = $banda\) Find +\(P(A\mid B)\). +$PAR +\(P(A\mid B) = \) \{ans_rule(15)\} +$BR + + +END_TEXT +Context("Percent"); +ANS(Percent($banda/$b)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-11.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-11.pg new file mode 100644 index 0000000000..1b95785ca3 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-11.pg @@ -0,0 +1,62 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/7/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$a = random(.15,.35,.01); +$b = random(.55,.85,.01); + +BEGIN_TEXT +$PAR +Suppose that \(A\) and \(B\) are two independent events for which \(P(A) = $a\) and \(P(B) = $b\). Find each of the following: +$PAR +A. \(P(A\mid B) = \) \{ans_rule(15)\} +$PAR +B. \(P(B\mid A) = \) \{ans_rule(15)\} +$PAR +C. \(P(A\;\mathrm{and}\;B) = \) \{ans_rule(15)\} +$PAR +D. \(P(A\;\mathrm{or}\;B) = \) \{ans_rule(15)\} + + +END_TEXT +Context("Percent"); +ANS(Percent($a)->cmp); +ANS(Percent($b)->cmp); +ANS(Percent($a*$b)->cmp); +ANS(Percent($a+$b-$a*$b)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-12.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-12.pg new file mode 100644 index 0000000000..3a4d1d4b41 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-12.pg @@ -0,0 +1,60 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/7/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$a = random(.15,.35,.01); +$b = random(.55,.65,.01); +$bga = random(.36,.54,.01); + +BEGIN_TEXT +Suppose that \(A\) and \(B\) are two events for which \(P(A) = $a\), \(P(B) = $b\), and \(P(B\mid A) = $bga\) Find each of the following: +$PAR +A. \(P(A\;\mathrm{and}\;B) = \) \{ans_rule(15)\} +$PAR +B. \(P(A\;\mathrm{or}\;B) = \) \{ans_rule(15)\} +$PAR +C. \(P(A\mid B) = \) \{ans_rule(15)\} + + +END_TEXT +Context("Percent"); + +ANS(Percent($a*$bga)->cmp); +ANS(Percent($a+$b-$a*$bga)->cmp); +ANS(Percent($a*$bga/$b)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-13.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-13.pg new file mode 100644 index 0000000000..87ceed7582 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-13.pg @@ -0,0 +1,72 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/9/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a1 = random(.02,.08,.01); +$a2 = random(.48,.55,.01); +$c1 = random(.10,.16,.01); +$c2 = 0.01*floor(100*(1-($a1+$a2+$c1))+.5); + +BEGIN_TEXT +$PAR +A telephone company has classified its customers in two ways: according to whether their account is overdue and whether the account is new (less than 12 months) or old. An analysis of the company's records provided the input for the following table of joint probabilities: + +$PAR +$BCENTER +\{begintable(4)\} +\{row(" ", "Overdue", "Not overdue")\} +\{row("New", "$a1", "$c1")\} +\{row("Old", $a2, $c2)\} +\{endtable()\} +$ECENTER +$PAR +One account is selected at random. + + +$PAR +A. If the account is overdue, what is the probability that it is new? \{ans_rule(15)\} +$PAR +B. If the account is new, what is the probability that it is overdue? \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +ANS(Percent($a1/($a1+$a2))->cmp); +ANS(Percent($a1/($a1+$c1))->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-14.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-14.pg new file mode 100644 index 0000000000..e8f96c2984 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-14.pg @@ -0,0 +1,76 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/9/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a1 = random(.28,.34,.01); +$a2 = random(.20,.26,.01); +$c1 = random(.22,.27,.01); +$c2 = 0.01*floor(100*(1-($a1+$a2+$c1))+.5); + +#\multicolumn{1}{c}{} & \multicolumn{2}{c}{\mbox{Computer Usage}} \\ +BEGIN_TEXT +According to the U.S. National Center for Education Statistics, there are more +than 63 million American workers 18 years old and over who use computers at work. +From this study, which was conducted in 1994 and 1998 (Source: Statistical Abstract of the United States, 2000, Table 690), the following table of joint probabilities was developed. + +$PAR +$PAR + +\[ +\begin{array}{c||c|c} +& \mbox{Uses Spreadsheet Software} & \mbox{No Spreadsheet Use} \\ \hline +\mbox{Female} & $a1 & $c1 \\ \hline +\mbox{Male} & $a2 & $c2 +\end{array} +\] + +$PAR +A. What proportion of workers use spreadsheet software? \{ans_rule(15)\} +$PAR +B. What proportion of male workers use spreadsheet software? \{ans_rule(15)\} +$PAR +C. What proportion of spreadsheet users are female? \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +ANS(Percent($a1+$a2)->cmp); +ANS(Percent($a2/($a2+$c2))->cmp); +ANS(Percent($a1/($a1+$a2))->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-15.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-15.pg new file mode 100644 index 0000000000..0aab2895b4 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-15.pg @@ -0,0 +1,81 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/9/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a1 = random(.08,.12,.01); +$a2 = random(.14,.20,.01); +$c1 = random(.03,.05,.01); +$c2 = 0.01*floor(100*(1-($a1+$a2+$c1))+.5); + +BEGIN_TEXT +$PAR +The following table lists the joint probabilities associated with smoking and +lung disease among 60-to-65 year-old men. + +$PAR +$PAR + +\[ +\begin{array}{c|c|c} +& \mbox{Smoker} & \mbox{Nonsmoker} \\ \hline +\mbox{Has Lung Disease} & $a1 & $c1 \\ \hline +\mbox{No Lung Disease} & $a2 & $c2 +\end{array} +\] + +$PAR +One 60-to-65 year old man is selected at random. What is the probability of the following events? + +$PAR +A. He is a smoker: \{ans_rule(15)\} +$PAR +B. He does not have lung disease: \{ans_rule(15)\} +$PAR +C. He has lung disease given that he is a smoker: \{ans_rule(15)\} +$PAR +D. He has lung disease given that he does not smoke: \{ans_rule(15)\} + +END_TEXT +Context("Percent"); + +ANS(Percent($a1+$a2)->cmp); +ANS(Percent($a2+$c2)->cmp); +ANS(Percent($a1/($a1+$a2))->cmp); +ANS(Percent($c1/($c1+$c2))->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-04.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-04.pg new file mode 100644 index 0000000000..d396399e53 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-04.pg @@ -0,0 +1,74 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/10/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + + + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + + +$a = random(35,45,1); +$b = random(65,75,1); +$c = random(45,55,1); +$d = .01*$a; +$e = .01*$b; +$f = .01*$c; + +BEGIN_TEXT +$PAR +An aerospace company has submitted bids on two separate federal government defense contracts. The company president believes that there is a $a$PERCENT +probability of winning the first contract. If they win the first contract, the probability of winning the second is $b$PERCENT. However, if they lose the first contract, the president thinks that the probability of winning the second contract decreases to $c$PERCENT. +$PAR +A. What is the probability that they win both contracts? +\{ans_rule(15)\} +$PAR +B. What is the probability that they lose both contracts? +\{ans_rule(15)\} +$PAR +C. What is the probability that they win only one contract? +\{ans_rule(15)\} + +$BR + +END_TEXT + +Context("Percent"); +ANS(Percent($d*$e)->cmp ); +ANS(Percent((1-$d)*(1-$f))->cmp); +ANS(Percent($d*(1-$e)+(1-$d)*$f)->cmp ); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-09.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-09.pg new file mode 100644 index 0000000000..b405b5e2af --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-09.pg @@ -0,0 +1,63 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/10/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + + + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + + +$a = random(10,55,1); +$b = random(2,5,1); +$c = random(15,25,1); +$d = .01*$a; +$e = .01*$b; +$f = .01*$c; +$g = 1 - $d; + +BEGIN_TEXT +$PAR +A foreman for an injection-molding firm admits that on $a$PERCENT of his shifts, he forgets to shut off the injection machine on his line. This causes the machine to overheat, increasing the probability that a defective molding will be produced during the early morning run from $b$PERCENT to $c$PERCENT. If a molding is randomly selected from the early morning run of a random day, what is the probability that it is defective? +$PAR +The probability is \{ans_rule(15)\}. + +$BR + +END_TEXT +Context("Percent"); +ANS(Percent($d*$f+$g*$e)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-10.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-10.pg new file mode 100644 index 0000000000..3eb352e3a1 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-10.pg @@ -0,0 +1,63 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/10/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + + + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + + +$a = random(30,40,1); +$b = random(20,30,1); +$c = random(20,30,1); +$d = .01*$a; +$e = .01*$b; +$f = .01*$c; +$g = 1-$f; + +BEGIN_TEXT +$PAR +Researchers at the University of Pennsylvania School of Medicine have determined that children under 2 years old who sleep with the lights on have a $a$PERCENT chance of becoming myopic before they are 16. Children who sleep in darkness have a $b$PERCENT probability of becoming myopic. A survey indicates that $c$PERCENT of children under 2 sleep with some light on. Find the probability that a random child under 2 will become myopic before reaching 16 years old. +$PAR +The probability is \{ans_rule(15)\}. + +$BR + +END_TEXT +Context("Percent"); +ANS(Percent($d*$f+$g*$e)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-11.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-11.pg new file mode 100644 index 0000000000..d9d44feb1c --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-11.pg @@ -0,0 +1,64 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/13/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + + + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + + +$a = random(10,55,1); +$b = random(2,5,1); +$c = random(15,25,1); +$d = .01*$a; +$e = .01*$b; +$f = .01*$c; +$g = 1 - $d; + +BEGIN_TEXT +$PAR +A foreman for an injection-molding firm admits that on $a$PERCENT of his shifts, he forgets to shut off the injection machine on his line. This causes the machine to overheat, increasing the probability that a defective molding will be produced during the early morning run from $b$PERCENT to $c$PERCENT. The plant manager randomly selects a molding from the early morning run and discovers it is defective. What is the probability that the foreman +forgot to shut off the machine the previous night? +$PAR +The probability is \{ans_rule(15)\}. + +$BR + +END_TEXT +Context("Percent"); +ANS(Percent($d*$f/(($d*$f)+($g*$e)))->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-20.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-20.pg new file mode 100644 index 0000000000..cdb961282e --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-20.pg @@ -0,0 +1,74 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/14/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a1 = random(.20,.25,.01); +$a2 = random(.10,.15,.01); +$a3 = random(.50,.60,.01); +$a4 = 1-($a1+$a2+$a3); + +BEGIN_TEXT +$PAR +The owner of an appliance store is interested in the relationship between the price at which an item is sold (regular or sale price) and the customer's decision on whether to purchase and extended warranty. After analyzing her records, she produced the following joint probabilities: + +\[ +\begin{array}{c|c|c} + & \mbox{Purchased} & \mbox{Did not purchase} \\ + & \mbox{extended warranty} & \mbox{extended warranty} \\ \hline +\mbox{Regular Price} & $a1 & $a3 \\ \hline +\mbox{Sale Price} & $a2 & $a4 \\ +\end{array} +\] + + +$PAR +A. What is the probability that a customer who bought an item at the regular price purchased the extended warranty? +\{ans_rule(15)\} +$PAR +B. What is the probability that a customer buys an extended warranty? +\{ans_rule(15)\} + +$PAR + +END_TEXT +Context("Percent"); + +ANS(Percent($a1/($a1+$a3))->cmp); +ANS(Percent($a1+$a2)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_11.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_11.pg new file mode 100644 index 0000000000..b5fb1109b4 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_11.pg @@ -0,0 +1,66 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@a = (3,4,5); +@b = (4,5,6); + +@slice1 = NchooseK(3,1); +@slice2 = NchooseK(3,1); + +@sa = @a[@slice1]; +@sb = @b[@slice2]; + +$ans1 = (($sb[0]-1)/$sb[0])**($sa[0]); +$ans2 = (1/$sb[0])**($sa[0]); + +BEGIN_TEXT +A quick quiz consists of \($sa[0]\) multiple choice problems, each of which has \($sb[0]\) answers, only one of +which is correct. If you make random guesses on all \($sa[0]\) problems, +$PAR +(a) What is the probability that all \($sa[0]\) of your answers are incorrect? $PAR +\{ans_rule(10)\} $PAR +(b) What is the probability that all \($sa[0]\) of your answers are correct?$PAR +\{ans_rule(10)\} + +END_TEXT + +Context("Percent"); +ANS(Percent($ans1)->cmp); +Context("Percent")->flags->set( + decimalPlaces => 2, + tolerance => .00005, + ); +ANS(Percent($ans2)->cmp()); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_12.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_12.pg new file mode 100644 index 0000000000..b7b2f453c2 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_12.pg @@ -0,0 +1,90 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,4,1); +$b = random(8,13,1); +$c = random(2,4,1); +$d = random(3,6,1); +$e = random(15,25,1); +$f = random(10,20,1); +$g = random(6,15,1); + +$span = $e + $b + $a + $c; +$fren = $f + $b + $a + $d; +$ger = $c + $a + $d + $g; + +$sp_fr = $a + $b; +$sp_ger = $a + $c; +$fr_ger = $a + $d; + +$some = $a + $b + $c + $d + $e + $f + $g; + +$none = random(20,40,1); + +$total = $some + $none; + +@quest1 = ("not in any of these classes?", "taking exactly one language class?", "taking at least one language class?", + "taking exactly two language classes?", "taking at least two language classes?"); +@ans1 = ($none/$total, ($e + $f + $g)/$total, $some/$total, ($b + $c + $d)/$total, ($a + $b + $c + $d)/$total); + +$tag1 = random(0,4,1); + +@quest2 = ("at least one of them is taking a language class?", "neither of them is taking a language class?", + "both of them are taking French?", "neither of them is taking Spanish?", + "at least one of them is taking German?"); + +@ans2 = ( (1 - $none*($none - 1)/$total/($total - 1)), $none*($none - 1)/$total/($total - 1), + $fren/$total*($fren - 1)/($total - 1), ($total - $span)/$total*($total - $span - 1)/($total - 1), + (1 - ($total - $ger)/$total*($total - $ger - 1)/($total - 1))); + +$tag2 = random(0,4,1); + +BEGIN_TEXT + +An elementary school is offering 3 language classes: one in Spanish, one in French, and one in German. These classes are open to any of the $total students in the school. There are $span in the Spanish class, $fren in the French class, and $ger in the German class. There are $sp_fr students that in both Spanish and French, $sp_ger are in both Spanish and German, and $fr_ger are in both French and German. In addition, there are $a students taking all 3 classes. $BR + +If one student is chosen randomly, what is the probability that he or she is $quest1[$tag1] \{ans_rule(20)\} $BR + +If two students are chosen randomly, what is the probability that $quest2[$tag2] \{ans_rule(20)\} $BR + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1[$tag1])->cmp); +ANS(Percent($ans2[$tag2])->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_2.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_2.pg new file mode 100644 index 0000000000..e515eb7beb --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_2.pg @@ -0,0 +1,102 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(1,6,1); +$b = random(1,7,1); +$c = $b - 1; +$d = random(7,12,1); +$e = 13 - $d; + +@quest1 = ("A $a appears on each of the two dice", + "A $a appears on at least one of the dice", + "A $a appears on exactly one of the dice", + "A $a does not appear on either die"); + +@quest2 = ("The sum of the numbers is even", + "The sum of the numbers is odd"); + +@quest3 = ("The sum of the numbers is equal to $b", + "The sum of the numbers is equal to $d", + "The sum of the numbers is 10 or more", + "The sum of the numbers is 5 or less"); + +@quest4 = ("The difference of the numbers is 1", + "The difference of the numbers is 2", + "The difference of the numbers is 2 or less", + "The difference of the numbers is 3"); + +@ans1 = (1/36, 11/36, 5/18, 25/36); +@ans2 = (1/2, 1/2); +@ans3 = ($c/36, $e/36, 1/6, 5/18); +@ans4 = (5/18, 2/9, 2/3, 1/6); + +$tag1 = random(0,3,1); +$tag2 = random(0,1,1); +$tag3 = random(0,2,1); +$tag4 = random(0,3,1); + +@quest = ($quest1[$tag1],$quest2[$tag2],$quest3[$tag3],$quest4[$tag4]); +@ans = ($ans1[$tag1],$ans2[$tag2],$ans3[$tag3],$ans4[$tag4]); + +@slice = NchooseK(4,3); +@squest = @quest[@slice]; +@sans = @ans[@slice]; + +$LEFT_BRACE='\{'; +$RIGHT_BRACE='\}'; + +BEGIN_TEXT +$PAR + +Two fair dice are tossed, and the up face on each die is recorded. +Find the probability of observing each of the following events: $PAR + +\(A: $LEFT_BRACE \) $squest[0] \( $RIGHT_BRACE \) $BR + +\(B: $LEFT_BRACE \) $squest[1] \( $RIGHT_BRACE \) $BR + +\(C: $LEFT_BRACE \) $squest[2] \( $RIGHT_BRACE \) $PAR + +\(P(A)= \) \{ans_rule(5)\} $BR +\( P(B)= \) \{ans_rule(5)\} $BR +\( P(C)= \) \{ans_rule(5)\} $BR + +END_TEXT +Context("Percent"); +ANS(Percent($sans[0])->cmp); +ANS(Percent($sans[1])->cmp); +ANS(Percent($sans[2])->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_4.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_4.pg new file mode 100644 index 0000000000..5f35b6cebb --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_4.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@quest1 = ('\( P(A) \)', '\( P(B) \)', '\( P(C) \)', + '\( P(A^c) \)', '\( P(B^c) \)', '\( P(C^c) \)'); +@quest2 = ('\( P(A \cup B) \)', '\( P(A \cap B) \)', + '\( P(A \cup C) \)', '\( P(A \cap C) \)', + '\( P(B \cup C) \)', '\( P(B \cap C) \)', + '\( P(A \cup B^c) \)', '\( P(A^c \cap B) \)', + '\( P(A^c \cup C) \)', '\( P(A \cap C^c) \)', + '\( P(B \cup C^c) \)', '\( P(B^c \cap C) \)',); +@quest3 = ('\( P(A \cup B \cup C) \)', '\( P(A \cap B \cap C) \)', + '\( P(A^c \cup B \cup C) \)', '\( P(A^c \cup B^c \cup C) \)', + '\( P(A^c \cup B \cup C^c) \)'); + +@ans1 = (7/8, 1/2, 1/2, 1/8, 1/2, 1/2); +@ans2 = (7/8, 1/2, 7/8, 1/2, 7/8, 1/8, 1, 0, 5/8, 3/8, 5/8, 3/8); +@ans3 = (7/8, 1/8, 1, 5/8, 5/8); + +$tag1 = random(0,5,1); +$tag2 = random(0,11,1); +$tag3 = random(0,4,1); + +$LEFT_BRACE = '\{'; +$RIGHT_BRACE = '\}'; + + +BEGIN_TEXT +$PAR +A fair coin is tossed three times and the events \(A\), \(B\), and \(C\) are defined as +follows: +$PAR +\( A: $LEFT_BRACE \) At least one head is observed \( $RIGHT_BRACE \) $BR + +\( B: $LEFT_BRACE \) At least two heads are observed \( $RIGHT_BRACE \) $BR + +\( C: $LEFT_BRACE \) The number of heads observed is odd \( $RIGHT_BRACE \) $PAR + +Find the following probabilities by summing the probabilities of the appropriate outcomes: +$PAR +(a) $quest1[$tag1] \( = \) \{ans_rule(5)\} $BR + +(b) $quest2[$tag2] \( = \) \{ans_rule(5)\} $BR + +(c) $quest3[$tag3] \( = \) \{ans_rule(5)\} + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1[$tag1])->cmp); +ANS(Percent($ans2[$tag2])->cmp); +ANS(Percent($ans3[$tag3])->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_6.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_6.pg new file mode 100644 index 0000000000..dd51314d63 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_6.pg @@ -0,0 +1,129 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +#define the graph +$graph_object = init_graph(-10,-10,10,10); +$f1 = FEQ ("sqrt(25-(x-3)**2) for x in <-2, 8> using color=blue and weight=2"); +$f2 = FEQ ("-sqrt(25-(x-3)**2) for x in <-2, 8> using color=blue and weight=2"); +$f3 = FEQ ("sqrt(25-(x+3)**2) for x in <-8, 2> using color=blue and weight=2"); +$f4 = FEQ ("-sqrt(25-(x+3)**2) for x in <-8, 2> using color=blue and weight=2"); +($f1Ref, $f2Ref, $f3Ref, $f4Ref) = plot_functions($graph_object, $f1, $f2, $f3, $f4); + +#add labels to the graph +$label_point1= new Label (-4, 3, '1','black', ('center', 'middle')); +$label_point2= new Label (0, 2, '2','black', ('center', 'middle')); +$label_point3= new Label (0, -1, '3', 'black',('center', 'middle')); +$label_point4= new Label (4, 2.5, '4', 'black',('center', 'middle')); +$label_point5= new Label (-5, 0, '5', 'black',('center', 'middle')); +$label_point6= new Label (-4, -3, '6','black', ('center', 'middle')); +$label_point7= new Label (4, -2.5, '7', 'black',('center', 'middle')); +$label_point8= new Label (-3, 6.5, 'A', 'red',('center', 'middle')); +$label_point9= new Label (3, 6.5, 'B', 'red',('center', 'middle')); + +#insert labels into the graph +$graph_object->lb($label_point1, $label_point2, $label_point3, $label_point4, +$label_point5, $label_point6, $label_point7, $label_point8, $label_point9); + +#define the variables +$a = random(0.05,0.15,0.05); +$b = random(0.05,0.15,0.05); +while ($b == $a) {$b = random(0.05,0.1,0.05);} +$c = 1-4*$a-2*$b; + +#define the events +$event1 = '\( P(A) \)'; +$event2 = '\( P(B) \)'; +$event3 = '\( P(A \cup B) \)'; +$event4 = '\( P(A \cap B) \)'; +$event5 = '\( P(A^c) \)'; +$event6 = '\( P(B^c) \)'; +$event7 = '\( P(A \cup A^c) \)'; +$event8 = '\( P(A^c \cap B) \)'; + +#give the answers +$ans1 = (3*$a)+ $b+$c; +$ans2 = (3*$a)+ $b; +$ans3 = 1; +$ans4 = 2*$a; +$ans5 = 1- ((3*$a)+$b+$c); +$ans6 = 1- ((3*$a)+$b); +$ans7 = 1; +$ans8 = $a+$b; + +@events = ($event1, $event2, $event3, $event4, $event5, $event6, $event7, $event8); +@ans = ($ans1, $ans2, $ans3, $ans4, $ans5, $ans6, $ans7, $ans8); + +@slice = NchooseK(8,4); +@sevents = @events[@slice]; +@sans = @ans[@slice]; + + +BEGIN_TEXT + +A sample space contains 7 outcomes and events \(A\) and \(B\) as seen in +the Venn diagram. $PAR +Let: +$BR +\( P(1)=P(2)=P(3)=P(7)=$a \) $BR +\( P(4)=P(5)=$b \) $BR +and \( P(6)=$c \).$PAR + +$BCENTER +\{ image(insertGraph($graph_object), height=>400, width=>400) \} +$ECENTER + +$BR + +Use the Venn diagram and the probabilities of the outcomes to find: $PAR +(a) \( \) $sevents[0] \(=\) \{ans_rule(5)\} $BR + +(b) \( \) $sevents[1] \(=\) \{ans_rule(5)\} $BR + +(c) \( \) $sevents[2] \(=\) \{ans_rule(5)\} $BR + +(d) \( \) $sevents[3] \(=\) \{ans_rule(5)\}$PAR + + +END_TEXT +Context("Percent"); +Context()->flags->set( + decimalPlaces => 2, + tolerance => .00005, + ); +ANS(Percent($sans[0])->cmp); +ANS(Percent($sans[1])->cmp); +ANS(Percent($sans[2])->cmp); +ANS(Percent($sans[3])->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_1.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_1.pg new file mode 100644 index 0000000000..8143c9192d --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_1.pg @@ -0,0 +1,56 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('Conditional', 'Probability') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(0.2,0.5,0.1); +$b = random(0.6,0.9,0.1); +$d = 0; +if ($a + $b > 1 ) {$d = $a + $b -1;} +$c = random($d,$a,0.05); +$ans1 = $c / $b; +$ans2 = $c / $a; + +BEGIN_TEXT +If \( P(A) = $a \), \( \ P(B) = $b \), and \( \ P(A \cap B) = $c \), then $BR +(a) \( P(A\mid B) = \)\{ans_rule(10)\} and $BR +(b) \( P(B\mid A) = \)\{ans_rule(10)\} + +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_2.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_2.pg new file mode 100644 index 0000000000..b11afc0e00 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_2.pg @@ -0,0 +1,110 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('Conditional', 'Probability') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = Real(random(0.05,0.25,0.05)); +$ra = 1-$a; +$rra = $ra - 0.25; +$b = Real(random(0.05,$rra,0.05)); +$rb = $ra - $b; +$rrb = $rb - 0.2; +$c = Real(random(0.05,$rrb,0.05)); +$rc = $rb - $c; +$rrc = $rc-0.15; +$d = Real(random(0.05,$rrc,0.05)); +$rd = $rc - $d; +$rrd = $rd-0.05; +$e = Real(random(0.05,$rrd,0.05)); +$f = $rd - $e; + +$graph = init_graph(-12,-8,12,8); +$f1 = FEQ("sqrt(25-x^2) for x in <-5,5> using color:blue and weight:2"); +$f2 = FEQ("-sqrt(25-x^2) for x in <-5,5> using color:blue and weight:2"); +$f3 = FEQ("sqrt(25-(x-6)^2) for x in <1,11> using color:green and weight:2"); +$f4 = FEQ("-sqrt(25-(x-6)^2) for x in <1,11> using color:green and weight:2"); +$f5 = FEQ("sqrt(25-(x+6)^2) for x in <-11,-1> using color:red and weight:2"); +$f6 = FEQ("-sqrt(25-(x+6)^2) for x in <-11,-1> using color:red and weight:2"); + +($f1Ref,$f2Ref,$f3Ref,$f4Ref,$f5Ref,$f6Ref) = plot_functions($graph,$f1,$f2,$f3,$f4,$f5,$f6); + +$label_a = new Label (-0, 5, 'B', 'blue', 'center', 'bottom'); +$label_b = new Label (-6, 5, 'A', 'red', 'center', 'bottom'); +$label_c = new Label (6, 5, 'C', 'green', 'center', 'bottom'); + +$label_1 = new Label (-8, 2, '1', 'black', 'center', 'middle'); +$label_2 = new Label (-8, -2, '2', 'black', 'center', 'middle'); +$label_3 = new Label (-3, 0, '3', 'black', 'center', 'middle'); +$label_4 = new Label (0, 3, '4', 'black', 'center', 'middle'); +$label_5 = new Label (3, 0, '5', 'black', 'center', 'middle'); +$label_6 = new Label (7, 0, '6', 'black', 'center', 'middle'); + +$graph->lb($label_a,$label_b,$label_c,$label_1,$label_2,$label_3,$label_4,$label_5,$label_6); + +@quest1 = ('\( P(A) \)', '\( P(B) \)', '\( P(C) \)', + '\( P(A^c) \)', '\( P(B^c) \)', '\( P(C^c) \)'); +@ans1 = ($a+$b+$c, $c+$d+$e, $e+$f, $d+$e+$f, $a+$b+$f, $a+$b+$c+$d); +$tag1 = random(0,5,1); + +@quest2 = ('\( P(A\mid B) \)', '\( P(B\mid A) \)', '\( P(A\mid C) \)', '\( P(B\mid C) \)', '\( P(C\mid B) \)'); +@ans2 = ($c/($c+$d+$e), $c/($a+$b+$c), 0, $e/($e+$f), $e/($c+$d+$e)); +$tag2 = random(0,4,1); + +@quest3 = ('\( P(A^c\mid B) \)', '\( P(B^c\mid A) \)', ' \( P(C^c\mid A) \)', '\( P(C\mid A^c) \)', + '\( P(B^c|C^c) \)'); +@ans3 = (($d+$e)/($c+$d+$e), ($a+$b)/($a+$b+$c), 1, ($e+$f)/($d+$e+$f), + ($a+$b)/($a+$b+$c+$d)); +$tag3 = random(0,4,1); +while ($tag3 == $tag2) { $tag3 = random(0,4,1); }; + + +BEGIN_TEXT +$BCENTER +\{ image(insertGraph($graph),height=>400,width=>400) \} $ECENTER$PAR +A sample space contains six outcomes and events \( A \), \( B \), and \( C \) as shown in the Venn diagram. The probabilities of the outcomes are \( P(1)=$a, \) +\( P(2)=$b, \) \( P(3)=$c, \) \( P(4)=$d, \) \( P(5)=$e, \) \( P(6)=$f.\) $PAR +Use the Venn diagram and the probabilities of the outcomes to find: $BR + +(a) $quest1[$tag1] \(=\) \{ans_rule(15)\} $BR + +(b) $quest2[$tag2] \(=\) \{ans_rule(15)\} $BR + +(c) $quest3[$tag3] \(=\) \{ans_rule(15)\} + +END_TEXT +Context("Percent"); +ANS(Percent($ans1[$tag1])->cmp); +ANS(Percent($ans2[$tag2])->cmp); +ANS(Percent($ans3[$tag3])->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_5.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_5.pg new file mode 100644 index 0000000000..9006eb820c --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_5.pg @@ -0,0 +1,157 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('Conditional', 'Probability', 'Independant') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@b = (1,6); +$taga = random(0,1,1); +$a = $b[$taga]; + +@event = ("The numbers are equal", "A $a on the blue die", "The sum of the numbers is even", + "The difference of the numbers is 3 or more"); +$tag1 = random(0,3,1); +$tag2 = random(0,3,1); +while ( $tag2 == $tag1 ) {$tag2 = random(0,3,1);} + +@prob = (1/6, 1/6, 1/2, 1/3); +$ans1 = $prob[$tag1]; +$ans2 = $prob[$tag2]; + +@ans5 = ('yes','no','yes'); + +if ($tag1 == 0) { + if ($tag2 == 1) { + $ans3 = 1/36; + $tag5 = 0; + } + if ($tag2 == 2) { + $ans3 = 1/6; + $tag5 = 1; + } + if ($tag2 == 3) { + $ans3 = 0; + $tag5 = 1; + } +} + +if ($tag1 == 1) { + if ($tag2 == 0) { + $ans3 = 1/36; + $tag5 = 0; + } + if ($tag2 == 2) { + $ans3 = 1/12; + $tag5 = 0; + } + if ($tag2 == 3) { + $ans3 = 1/12; + $tag5 = 1; + } +} + + +if ($tag1 == 2) { + if ($tag2 == 0) { + $ans3 = 1/6; + $tag5 = 1; + } + if ($tag2 == 1) { + $ans3 = 1/12; + $tag5 = 0; + } + if ($tag2 == 3) { + $ans3 = 1/9; + $tag5 = 1; + } +} + +if ($tag1 == 3) { + if ($tag2 == 0) { + $ans3 = 0; + $tag5 = 1; + } + if ($tag2 == 1) { + $ans3 = 1/12; + $tag5 = 1; + } + if ($tag2 == 2) { + $ans3 = 1/9; + $tag5 = 1; + } +} + +$ans4 = $ans3 / $ans2; +$ans5 = $ans3 / $ans1; + +$mc = new_multiple_choice(); + +$mc->qa('Are events E and F independent?',$ans5[$tag5]); + +$tag6 = $tag5+1; + +$mc->extra($ans5[$tag6]); + +BEGIN_TEXT +Two fair dice, one blue and one red, are tossed, and the up face on each die is recorded. Define the following events: $PAR + +\(E: $LB \) $event[$tag1] \( $RB \) $BR + +\(F: $LB \) $event[$tag2] \( $RB \) $PAR + +Find the following probabilities: $BR + +(a) \( P(E) = \) \{ans_rule(10)\} $BR + +(b) \( P(F) = \) \{ans_rule(10)\} $BR + +(c) \( P(E \cap F) = \) \{ans_rule(10)\} $BR + +(d) \( P(E\mid F) = \) \{ans_rule(10)\} $BR + +(e) \( P(F\mid E) = \) \{ans_rule(10)\} $PAR + +\{ $mc->print_q() \} +\{ $mc->print_a() \} + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Percent($ans3)->cmp); +ANS(Percent($ans4)->cmp); +ANS(Percent($ans5)->cmp); + +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_8.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_8.pg new file mode 100644 index 0000000000..a03ea4efe5 --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_8.pg @@ -0,0 +1,85 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('Conditional', 'Probability', 'Independant', 'Dependant') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(0.2,0.8,0.1); +$b = random(0.1,0.4,0.1); +while ($b==$a) {$b = random(0.1,0.8,0.1);} + +$low = max(0.1,-int(-10*($a+$b-1)/$b)/10); +$high = min(0.9,int(10*$a/$b)/10); + +$c = random($low,$high,0.1); +if ($c == $a) { $c = $c - .05; } + +$ans11 = $a*$b; +$ans12 = $a; +$ans13 = $a+$b-$ans11; + +$ans21 = $c*$b; +$ans22 = ($c*$b)/$a; + +@event1 = ('\(P(A \cap B) \)', '\(P(A\mid B)\)', '\(P(A \cup B)\)'); +@event2 = ('\(P(A \cap B) \)', '\(P(B\mid A)\)'); +@ans1 = ($ans11, $ans12, $ans13); +@ans2 = ($ans21, $ans22); + +@slice1 = NchooseK(3,3); +@slice2 = NchooseK(2,2); + +@sevent1 = (@event1[@slice1]); +@sevent2 = (@event2[@slice2]); +@sans1 = (@ans1[@slice1]); +@sans2 = (@ans2[@slice2]); + + +BEGIN_TEXT +For two events \(A \) and \(B \), \(P(A) = $a\) and \(P(B) = $b\). $PAR +(a) If \(A\) and \(B\) are independent, then$PAR +$sevent1[0] \(=\) \{ans_rule(10)\}$PAR +$sevent1[1] \(=\) \{ans_rule(10)\}$PAR +$sevent1[2] \(=\) \{ans_rule(10)\}$PAR +(b) If \(A\) and \(B\) are dependent and \(P(A\mid B) = $c\), then $PAR +$sevent2[0] \(=\) \{ans_rule(10)\}$PAR +$sevent2[1] \(=\) \{ans_rule(10)\}$PAR + +END_TEXT +Context("Percent"); + +ANS(Percent($sans1[0])->cmp); +ANS(Percent($sans1[1])->cmp); +ANS(Percent($sans1[2])->cmp); +ANS(Percent($sans2[0])->cmp); +ANS(Percent($sans2[1])->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_9.pg b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_9.pg new file mode 100644 index 0000000000..92af17e11c --- /dev/null +++ b/Contrib/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_9.pg @@ -0,0 +1,77 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('Conditional', 'Probability', 'Independant', 'Mutually Exclusive') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$a = random(0.1,0.5,0.1); +$b = random(0.1,0.5,0.1); +$a1 = random(0,$a,0.1); +$b1 = random(0,$b,0.1); +$ans1 = $a1 * $b1; +$c = $a + $b - $ans1; + +if ( $ans1 == $a * $b ) { + $ans2 = 'Yes'; +} else { + $ans2 = 'No'; +} + +if ( $ans1 == 0 ) { + $ans3 = 'Yes'; +} else { + $ans3 = 'No'; +} + +$popup2 = PopUp(["?","Yes","No"],$ans2); +$popup3 = PopUp(["?","Yes","No"],$ans3); + +BEGIN_TEXT + +If \( P(A) = $a \), \( P(B) = $b \), and \( P(A \cup B) = $c \), then $BR + +\( P(A \cap B) = \) \{ans_rule(10)\}.$BR + +(a) Are events \( A \) and \( B \) independent? \{$popup2->menu\}$PAR + +(b) Are \( A \) and \( B \) mutually exclusive? \{$popup3->menu\}$PAR + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS($popup2->cmp); +ANS($popup3->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SamplingIssues/08Stats_01_Sampling.pg b/Contrib/PCC/Statistics/SamplingIssues/08Stats_01_Sampling.pg new file mode 100644 index 0000000000..2ea1814e75 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/08Stats_01_Sampling.pg @@ -0,0 +1,87 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II: From Exploring to Inference') +## DBsection('Chapter 8: Producing Data: Sampling') +## KEYWORDS('statistic', 'producing data', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 8: Producing Data: Sampling') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The population of interest is","all people who will vote on the sales tax increase on the date of the vote."); + $mc[0]->extra("the 2633 viewers who phoned in.", + "all regular viewers of the television station who own a phone and have participated + in similar phone surveys in the past.", + "the 1474 viewers who were opposed."); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The sample is","the 2633 viewers who phoned in."); + $mc[1]->extra("the 1474 viewers were opposed to the increase.", + "all regular viewers of the television station who own a phone and have participated in similar phone surveys in the past. ", + "all people who will vote on the sales tax increase on the data of the vote."); + +$mc[2] = new_multiple_choice(); + $mc[2]->qa("In this case, the sample obtained is ","a voluntary response sample. "); + $mc[2]->extra("a stratified random sample. ", + "a probability sample in which each person in the population has the same chance of being in the sample. ", + "a simple random sample. "); + +###################################### +# Main text + +BEGIN_TEXT +A television station is interested in predicting whether or not voters are in favor of an increase in the state sales tax. +It asks its viewers to phone in and indicate whether they support or are opposed to an increase in the state sales tax +in order to generate additional revenue for education. Of the 2633 viewers who phone in, 1474 (55.98$PERCENT) are opposed +to the increase. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/SamplingIssues/08Stats_02_Sampling.pg b/Contrib/PCC/Statistics/SamplingIssues/08Stats_02_Sampling.pg new file mode 100644 index 0000000000..03f4bb2736 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/08Stats_02_Sampling.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_02_Sampling.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_02_Sampling.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/SamplingIssues/08Stats_03_Sampling.pg b/Contrib/PCC/Statistics/SamplingIssues/08Stats_03_Sampling.pg new file mode 100644 index 0000000000..b1baff54b7 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/08Stats_03_Sampling.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_03_Sampling.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_03_Sampling.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/SamplingIssues/08Stats_05_Sampling.pg b/Contrib/PCC/Statistics/SamplingIssues/08Stats_05_Sampling.pg new file mode 100644 index 0000000000..9de71ad36e --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/08Stats_05_Sampling.pg @@ -0,0 +1,85 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II: From Exploring to Inference') +## DBsection('Chapter 8: Producing Data: Sampling') +## KEYWORDS('statistic', 'producing data', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 8: Producing Data: Sampling') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The sample is","the 15 students interviewed."); + $mc[0]->extra("all students approached by the reporter.", + "all students at universities with safety issues.", + "all those students walking on campus late at night."); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The method of sampling used is","convenience sampling."); + $mc[1]->extra("a census.", + "voluntary response.", + "simple random sampling."); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("The sample obtained is","probably biased."); + $mc[2]->extra("a probability sample of students with night classes.", + "a stratified random sample of students feeling safe.", + "a simple random sample of students feeling safe."); + +################################################# +# Main + +BEGIN_TEXT +In order to assess the opinion of students at the Ohio State University on +campus safety, a reporter for the student newspaper interviews 15 students +he meets walking on the campus late at night who are willing to give their opinion. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/SamplingIssues/08Stats_06_Sampling.pg b/Contrib/PCC/Statistics/SamplingIssues/08Stats_06_Sampling.pg new file mode 100644 index 0000000000..c320feee56 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/08Stats_06_Sampling.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_06_Sampling.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_06_Sampling.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/SamplingIssues/08Stats_07_Sampling.pg b/Contrib/PCC/Statistics/SamplingIssues/08Stats_07_Sampling.pg new file mode 100644 index 0000000000..6c9bae7f12 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/08Stats_07_Sampling.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_07_Sampling.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_07_Sampling.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/SamplingIssues/08Stats_08_Sampling.pg b/Contrib/PCC/Statistics/SamplingIssues/08Stats_08_Sampling.pg new file mode 100644 index 0000000000..c243deb1d8 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/08Stats_08_Sampling.pg @@ -0,0 +1,105 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II: From Exploring to Inference') +## DBsection('Chapter 8: Producing Data: Sampling') +## KEYWORDS('statistic', 'producing data', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 8: Producing Data: Sampling') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$m1 = random(1000,2000,1); +$m2 = random(500,700,1); + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("An opinion poll contacts $m1 adults and asks them, $LQ Which political party do you think has better ideas for leading the country in the 21st century?$RQ In all, $m2 of the $m1 say, $LQ The Democrats.$RQ The sample in this setting is ", + "the $m1 people interviewed. "); + $mc[0]->extra("all 235 million adults in the United States. ", + "the $m2 people who chose the Democrats. "); + + $mc[0]->makeLast("None of the above. "); + +$n1 = random(150,300,1); +$n2 = random(50,100,1); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A committee on community relations in a college town plans to survey local businesses about the importance of students as customers. From telephone book listings, the committee chooses $n1 businesses at random. Of these, $n2 return the questionnaire mailed by the committee. The population for this study is ", + "all businesses in the college town. "); + $mc[1]->extra("the $n1 businesses chosen. ", + "the $n2 businesses that returned the questionnaire. "); + $mc[1]->makeLast("None of the above. "); + +$o = random(2,5,1); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Archaeologists plan to examine a sample of $o-meter-square plots near an ancient Greek city for artifacts visible in the ground. They choose separate samples of plots from floodplain, coast, foothills, and high hills. What kind of sample is this? ", + "A stratified random sample. "); + $mc[2]->extra("A simple random sample. ", + "A voluntary response sample. "); + $mc[2]->makeLast("None of the above. "); + +$p = random(2,7,1); +$p1 = random(10,18,1); +$p2 = random(23,30,1); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("A sample of households in a community is selected at random from the telephone directory. In this community, $p% of households have no telephone, $p1% have only cell phones, and another $p2% have unlisted telephone numbers. The sample will certainly suffer from ", + "undercoverage. "); + $mc[3]->extra("nonresponse. ", + "false responses. "); + $mc[3]->makeLast("None of the above. "); + +################################################# +# Main + +BEGIN_TEXT +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR + +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_1.pg b/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_1.pg new file mode 100644 index 0000000000..b0af6c3b81 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_1.pg @@ -0,0 +1,112 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 0; + + +@event = ("A public opinion poll in Ohio wants to determine whether registered voters in the state approve of a measure to ban smoking in all public areas. They randomly select 50 voters in the state and ask whether they approve or disapprove of the measure.", + "A public opinion poll in Ohio wants to determine whether registered voters in the state approve of a measure to ban smoking in all public areas. They randomly select 50 voters from each county in the state and ask whether they approve or disapprove of the measure."); +$pick = random(0,1); +@ans = ("Simple random sample", "Stratified random sample"); + +$mc = new_multiple_choice(); + +$mc->qa("This is an example of a", $ans[$pick]); +$mc->extra($ans[1-$pick]); +$mc->makeLast($ans[1]); + +BEGIN_TEXT + +$event[$pick] + +$BR +\{ $mc->print_q \} +\{ $mc->print_a \} +$PAR + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +@event = ("At a party there are 30 students over age 21 and 20 students under age 21. You randomly select 5 students to interview about attitudes toward alcohol.", + "At a party there are 30 students over age 21 and 20 students under age 21. You randomly select 3 of those over 21 and 2 of those under 21 to interview about attitudes toward alcohol."); +$pick = random(0,1); +@ans = ("Simple random sample", "Stratified random sample"); + +$mc = new_multiple_choice(); + +$mc->qa("This is an example of a", $ans[$pick]); +$mc->extra($ans[1-$pick]); +$mc->makeLast($ans[0]); + +BEGIN_TEXT + +$event[$pick] + +$BR +\{ $mc->print_q \} +\{ $mc->print_a \} +$PAR + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + +@event = ("The Ministry of Health in the Canadian Province of Ontario conducted the Ontario Health Survey by conducting interviews with 30,000 randomly selected men and 35,000 randomly selected women who reside in Ontario.", + "The Ministry of Health in the Canadian Province of Ontario conducted the Ontario Health Survey by conducting interviews with 65,000 randomly selected residents of Ontario."); +$pick = random(0,1); +@ans = ("Stratified random sample","Simple random sample"); + +$mc = new_multiple_choice(); + +$mc->qa("This is an example of a", $ans[$pick]); +$mc->extra($ans[1-$pick]); +$mc->makeLast($ans[0]); + +BEGIN_TEXT + +$event[$pick] + +$BR +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_2.pg b/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_2.pg new file mode 100644 index 0000000000..436a237fa5 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_2.pg @@ -0,0 +1,52 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("To select 10 students out of the class of 40 students, I select every 4th name from the roster beginning with the 2nd student. What type of sample is this?", "Systematic Random Sample"); +$mc->extra("Stratified Random Sample", "Simple Random Sample", "Cluster Sample", "Multistage Sample"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_3.pg b/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_3.pg new file mode 100644 index 0000000000..c3c2e3d92f --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_3.pg @@ -0,0 +1,54 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("To select 10 students out of the class of 40 students, 40 names are placed in a hat and 10 names are drawn out of the hat. What type of sample is this?", "Simple Random Sample"); +$mc->extra("Stratified Random Sample", "Systematic Random Sample", "Cluster Sample", "Multistage Sample"); + +BEGIN_TEXT + + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_5.pg b/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_5.pg new file mode 100644 index 0000000000..4632069180 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/dueck1_4_5.pg @@ -0,0 +1,53 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("To conduct a door-to-door survey about crime victimization, a city official randomly selects 5 city blocks and surveys all the residents of these 5 city blocks. What type of sample is this?", "Cluster Sample"); +$mc->extra("Stratified Random Sample", "Systematic Random Sample", "Multistage Sample", "Simple Random Sample"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SamplingIssues/gust25.pg b/Contrib/PCC/Statistics/SamplingIssues/gust25.pg new file mode 100644 index 0000000000..4e73ee12ce --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/gust25.pg @@ -0,0 +1,54 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('What is Statistics?') +##DBsection('Introduction') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Why is a sample often a better way to obtain information about a population than a census?", "All of the above"); +$mc->extra("A census is too time consuming", "A census is more costly than taking a sample", "A census is frequently impractical"); +$mc->makeLast("All of the above", "None of the above"); + +BEGIN_TEXT + + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SamplingIssues/gust9.pg b/Contrib/PCC/Statistics/SamplingIssues/gust9.pg new file mode 100644 index 0000000000..86826aab97 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/gust9.pg @@ -0,0 +1,53 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('What is Statistics?') +##DBsection('Introduction') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("In sampling, why is obtaining a representative sample important?", +"Because we are using the sample to draw conclusions about the entire population"); +$mc->extra("Because representative samples guarantee that our results are reliable"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SamplingIssues/stat212-HW03-01.pg b/Contrib/PCC/Statistics/SamplingIssues/stat212-HW03-01.pg new file mode 100644 index 0000000000..325a06030d --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/stat212-HW03-01.pg @@ -0,0 +1,125 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## NAW tagged this problem. + +## DBsubject(Statistics) +## DBchapter(Sample survey methods) +## DBsection(Concepts) +## Date(6/7/2005) +## Institution(UVA) +## Author(Nolan A. Wages) +## Level(2) +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('.') +## Problem1('') +## KEYWORDS('statistics', 'descriptive statistics', 'experiment') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('The difference between a sample mean and the population mean is called: ', + 'sampling error' +); +$mc[1]->extra( + 'nonresponse error', + 'selection bias', + 'nonsampling error' +); + + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('Which of the following sampling plans uses random methods of selections? ', + 'All of the above' +); +$mc[2]->extra( + 'Simple random sampling', + 'Stratified random sampling', + 'Cluster sampling' +); + +$mc[2]->makeLast( + 'All of the above' +); + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('A pharmaceutical company, interested in measuring +how often physicians prescribe a certain drug, + has selected a simple random sample from each of two groups: + M.D. (medical doctors) and D.O. (doctors of Osteopathic). What type of sampling is this?', + 'Stratified random sampling' +); +$mc[3]->extra( + 'Simple random sampling', + 'Cluster sampling', +); + +$mc[3]->makeLast( + 'None of the above' +); + + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('Which of the following does not characterize stratified random sampling? ', + 'Nonrandom sampling is used' +); +$mc[4]->extra( + 'The population is divided into strata that are distinct', + 'The population is divided into strata that are mutually exclusive and exhaustive', + 'The population is divided into strata that are homogenous' +); + + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('When every possible sample with the same number of observations is equally likely to be chosen, the selected sample is called: ', + 'simple random sample' +); +$mc[5]->extra( + 'stratified sample', + 'cluster sample', + 'biased sample' +); + + +$a = random(1,5,1); +$b = random(1,5,1); +while ($a == $b) { + $b = random(1,5,1); +} + + +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/SamplingIssues/stat212-HW03-02.pg b/Contrib/PCC/Statistics/SamplingIssues/stat212-HW03-02.pg new file mode 100644 index 0000000000..e1abddd946 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/stat212-HW03-02.pg @@ -0,0 +1,112 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics', 'experiment') +## NAW tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('6/7/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('Which of the following is an example of primary data? ', + 'Financial data tapes that contain data compiled from the New York Stock Exchange' +); +$mc[1]->extra( + 'Data published by the U.S. Census Bureau', + 'Data published by Statistics Canada', + 'Data published by the New York Stock Exchange' +); + + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('Which of the following must be avoided in designing a questionnaire? ', + 'Leading questions' +); +$mc[2]->extra( + 'Dichotomous questions', + 'Open-ended questions', + 'Demographic questions' +); + + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('When the population is divided into mutually exclusive sets, +and then a simple random sample is drawn from each set, this is called:', + 'Stratified random sampling' +); +$mc[3]->extra( + 'Simple random sampling', + 'Cluster sampling', + 'Slection Bias' +); + + + + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('Which of the following statements is correct in questionnaire design? ', + 'All of the above are correct statements' +); +$mc[5]->extra( + 'The questionnaire should be kept as short as possible, and the questions + themselves should also be kept short', + 'A mixture of dichotomous, multiple-choice, and open-ended questions may be used', + 'Leading questions must be avoided' +); + +$mc[5]->makeLast( + 'All of the above are correct statements' +); + +do{ +$a = random(1,5,1); +$b = random(1,5,1); +while ($a == $b) { + $b = random(1,5,1); +}} until ($a != 4 and $b != 4); + + +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/SamplingIssues/stat_inference2.pg b/Contrib/PCC/Statistics/SamplingIssues/stat_inference2.pg new file mode 100644 index 0000000000..f6494cf689 --- /dev/null +++ b/Contrib/PCC/Statistics/SamplingIssues/stat_inference2.pg @@ -0,0 +1,51 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Inference Samples') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 06/20/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGchoicemacros.pl" +); + +TEXT(&beginproblem); +$mc = new_multiple_choice(); + +$name1 = list_random( 'survey', 'poll' ); +$num = random( 100, 200, 10 ); +@name2 = ( 'employees', 'students'); +$ind1 = random( 0 ,1 ); +@name3 = ( ' hostpital', 'medical clinic', 'university', 'high school'); +if( $ind1 == 0 ){ $ind2 = random( 0, 1 ); +} else{ $ind2 = random( 2, 3 ); } +$per = random( 15, 40, 1); +$mc->qa( 'This an example of', + 'nonresponse bias' +); +$mc->extra( 'undercoverage', + 'an insufficient sample size', + 'the placebo effect', + 'voluntary response bias' +); + +BEGIN_TEXT + +A $name1 is sent out to $num $name2[$ind1] at a $name3[$ind2]. Only $per$PERCENT bother to fill +them out and return them. +\{ $mc->print_q \} +$BR +\{ $mc->print_a \} + +END_TEXT + +ANS( str_cmp( $mc->correct_ans ) ); +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/Scatterplot.pg b/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/Scatterplot.pg new file mode 100644 index 0000000000..f458d67a00 --- /dev/null +++ b/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/Scatterplot.pg @@ -0,0 +1,82 @@ +##DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Correlation) +## Institution(NAU) +## Author(Edgar Fisher) +## MLT(EstimateRFromPlot) +## Level(3) +## KEYWORDS('scatterplot') +##ENDDESCRIPTION + +# File Created: 7/06/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGnauStats.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", +# "extraAnswerEvaluators.pl", +); + +TEXT($BEGIN_ONE_COLUMN); +TEXT(beginproblem()); + +################################################# + +push @corr, random (-.95, -.6, .01); +push @corr, random (-.45, -.25, .01); +push @corr, random (.6, .95, .01); +push @corr, random (.25, .45, .01); + +for ($i = 0; $i < 4; $i++){ + $scatter[$i]=Scatterplot($corr[$i]); +# push @scatter, $sp[$i]; +} + +$matching = new_match_list(); +for ($i = 0; $i < 4; $i++){ + push @match, "r = $corr[$i]", $i; #Plot($scatter[$i]); +} +$matching->qa(@match); +$matching->choose(4); +@list= split "\n", $matching->print_a; + +for ($i = 0; $i < 4; $i++){ + @tmp = split '', $list[$i + 1]; + push @order, $tmp[17]; # 5/6/09 format changed. This was 5 before. +} + +#@scatt = @scatter[@order]; +$scatt[0]=$scatter[$order[0]]; +$scatt[1]=$scatter[$order[1]]; +$scatt[2]=$scatter[$order[2]]; +$scatt[3]=$scatter[$order[3]]; + +$tex = "Images are not available for print out. Sorry for the inconvenience."; + +$html = begintable(2); +$html .= row(Plot($scatt[0]),Plot($scatt[1])); +$html .= row('A', 'B'); +$html .= row(Plot($scatt[2]),Plot($scatt[3])); +$html .= row('C', 'D'); +$html .= endtable(); +############################################## + +BEGIN_TEXT +Match the scatterplot to its corresponding correlation coefficient r. +$PAR +\{$matching->print_q\} +$BR + +END_TEXT + +TEXT(MODES(TeX =>$tex, HTML => $html)); + + +TEXT($END_ONE_COLUMN); + +ANS(str_cmp($matching->ra_correct_ans())); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/gust24.pg b/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/gust24.pg new file mode 100644 index 0000000000..1dadf9a27c --- /dev/null +++ b/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/gust24.pg @@ -0,0 +1,91 @@ +##DESCRIPTION +## Statistics: Regression +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +##DBsection('Linear regression') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; + +for($i=0; $i<5; $i++){ + $x[$i] = random(3,17,1); + $y[$i] = random(15,31,1); +} + +$sx =0; +$sy =0; +$sxy =0; +$sx2 =0; +$sy2 =0; +$meanx =0; +$meany =0; + +for($i=0; $i<5; $i++) { + $sx = $sx + $x[$i]; + $sy = $sy + $y[$i]; + $sxy = $sxy + ($x[$i]*$y[$i]); + $sx2 = $sx2 + ($x[$i]**2); + $sy2 = $sy2 + ($y[$i]**2); + $meanx = $meanx+$x[$i]; + $meany = $meany+$y[$i]; + +} +$meanx = $meanx/5; +$meany = $meany/5; +$ssxy = $sxy-(($sx*$sy)/5); +$ssx = $sx2-(($sx**2)/5); +$ssy = $sy2-(($sy**2)/5); + +$r = $ssxy/sqrt($ssx*$ssy); +$b1 = $ssxy/$ssx; +$b0 = $meany-$b1*$meanx; + +BEGIN_TEXT +Consider the following small data set.$BR +\{begintable(3)\} +\{row("Subject", "\(x\)", "\(y\)")\} +\{row("\(1\)", "\($x[0]\)", "\($y[0]\)")\} +\{row("\(2\)", "\($x[1]\)", "\($y[1]\)")\} +\{row("\(3\)", "\($x[2]\)", "\($y[2]\)")\} +\{row("\(4\)", "\($x[3]\)", "\($y[3]\)")\} +\{row("\(5\)", "\($x[4]\)", "\($y[4]\)")\} +\{endtable()\} +$BR +Find the correlation between \(x\) and \(y\). $PAR +\(r = \) \{ans_rule(10)\} $BR + +END_TEXT +ANS(num_cmp($r)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_1.pg b/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_1.pg new file mode 100644 index 0000000000..4d27d30da7 --- /dev/null +++ b/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_1.pg @@ -0,0 +1,68 @@ +## DESCRIPTION +## Correlation Coefficients +## ENDDESCRIPTION + +## KEYWORDS('Correlation', 'Coefficient') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Correlation and Regression') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +#make a new match list +$ml = new_match_list(); +$ml -> qa ( + "\(r = 1\)", + "a perfect positive relationship between \(x\) and \(y\)", + "\(r = -1\)", + "a perfect negative relationship between \(x\) and \(y\)", + "\(r = 0\)", + "no relationship between \(x\) and \(y\)", + "\(r = .92\)", + "a strong positive relationship between \(x\) and \(y\)", + "\(r = -.97\)", + "a strong negative relationship between \(x\) and \(y\)", + "\(r = .1\)", + "a weak positive relationship between \(x\) and \(y\)", + "\(r= -.15\)", + "a weak negative relationship between \(x\) and \(y\)" +); + +$ml -> choose(4); + +BEGIN_TEXT +Match the following sample correlation coefficients with the explaination of what that correlation +coeffiecient means. $PAR +\{ $ml -> print_q \} +$PAR +\{$ml -> print_a \} + +END_TEXT +ANS(str_cmp($ml->ra_correct_ans )) ; + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_2.pg b/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_2.pg new file mode 100644 index 0000000000..790eff46b9 --- /dev/null +++ b/Contrib/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_2.pg @@ -0,0 +1,120 @@ +## DESCRIPTION +## Correlation Coefficient +## ENDDESCRIPTION + +## KEYWORDS('Correlation', 'Coefficient') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Correlation and Regression') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$gen = random(0,5,1); + +@ans = ("a positive correlation between \(x\) and \(y\)", + "a perfect positive correlation between \(x\) and \(y\)", + "a negative correlation between \(x\) and \(y\)", + "a perfect negative correlation between \(x\) and \(y\)", + "no correlation between \(x\) and \(y\)", + "a nonlinear correlation between \(x\) and \(y\)", + "a positive correlation between \(x\) and \(y\)", + "a perfect positive correlation between \(x\) and \(y\)", + "a negative correlation between \(x\) and \(y\)", + "a perfect negative correlation between \(x\) and \(y\)", + "no correlation between \(x\) and \(y\)"); + +$sx = 0; +$sy = 0; +$sxy = 0; +$sx2 = 0; +$sy2 = 0; + +for($i=0;$i<15;$i++){ + $x[$i]=random($i,$i+0.9,0.1); + if ($gen==0) { + $y[$i] = $x[$i] + 2*sin(20*$x[$i]); + } + if ($gen==1) { + $y[$i] = $x[$i]; + } + if ($gen==2) { + $y[$i] = 15 - $x[$i] - 2*sin(20*$x[$i]); + } + if ($gen==3) { + $y[$i] = 15 - $x[$i]; + } + if ($gen==4) { + $y[$i] = random(0,15,0.1); + } + if ($gen==5) { + $y[$i] = 15/7.5**2*($x[$i]-7.5)**2; + } + $y[$i] = int($y[$i]*10+0.5)/10; + + $sx = $sx + $x[$i]; + $sy = $sy + $y[$i]; + $sxy = $sxy + $x[$i] * $y[$i]; + $sx2 = $sx2 + ($x[$i])**2; + $sy2 = $sy2 + ($y[$i])**2; +} + +$r = (15*$sxy - $sx * $sy)/sqrt(15*$sx2 - ($sx)**2)/sqrt(15*$sy2 - ($sy)**2); + +$mc = new_multiple_choice(); +$mc -> qa('There is ',$ans[$gen]); +$mc -> extra($ans[$gen+1], $ans[$gen+2],$ans[$gen+3],$ans[$gen+4],$ans[$gen+5]); + + +BEGIN_TEXT + +$BEGIN_ONE_COLUMN + +Use a scatterplot and the linear correlation coefficient \( r \) to determine what kind of correlation there is between the two variables. + + + +\[ \begin{array}{c|ccccccccccccccc} +x & $x[0] & $x[1] & $x[2] & $x[3] & $x[4] & $x[5] & $x[6] & $x[7] & $x[8] & $x[9] & $x[10] & $x[11] & $x[12] & $x[13] & $x[14] \cr +\hline +y & $y[0] & $y[1] & $y[2] & $y[3] & $y[4] & $y[5] & $y[6] & $y[7] & $y[8] & $y[9] & $y[10] & $y[11] & $y[12] & $y[13] & $y[14] \cr +\end{array} \] + + + +\( r= \) \{ans_rule(25)\} $BR + +\{$mc->print_q()\} +\{$mc->print_a()\} + +$END_ONE_COLUMN + +END_TEXT + +ANS(num_cmp($r)); +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SignificanceTesting/14Stats_07_InferenceIntro.pg b/Contrib/PCC/Statistics/SignificanceTesting/14Stats_07_InferenceIntro.pg new file mode 100644 index 0000000000..9bd556628e --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/14Stats_07_InferenceIntro.pg @@ -0,0 +1,110 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Hypothesis tests) +## DBsection(Concepts) +## Institution(The College of Idaho) +## Author(R Cruz, L Danielson, J Guild) +## Level(2) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('14') +## Problem1('') +## KEYWORDS('statistics', 'inference', 'confidence interval') +## Updated: 2010/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("In formulating hypotheses for a statistical test of significance, the null hypothesis is + often","a statement of ''no effect'' or ''no difference''."); + $mc[0]->extra("the probability of observing the data you actually obtained", + "a statement that the data are all \(0\).", + "\(0.05\)"); +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The \(P\)-value of a test of a null hypothesis is","the probability, assuming + the null hypothesis is true, that the test statistic will take a value at least as extreme as that actually observed."); + $mc[1]->extra("the probability, assuming the null hypothesis is false, that the test statistic will take a value at + least as extreme as that actually observed.", + "the probability the null hypothesis is true.", + "the probability the null hypothesis is false."); +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("In testing hypotheses, which of the following would be strong evidence against the null hypothesis?", + "Obtaining data with a small \(P\)-value."); + $mc[2]->extra("Obtaining data with a large \(P\)-value.", + "Using a small level of significance.", + "Using a large level of significance."); + +@solution= ("Option \(D\). Our null hypothesis is what we assume to be true. Using collected data, we can then decide if there is significant difference between our data and the hypothesis. If there is not, we often say ''no effect'' or ''no difference'' from what was expected or assumed to be true, which was our null hypothesis.", + +" Option \(C\). The definition of the \(P\)-value is the probability, assuming the null hypothesis is true, that the test statistic will take a value at least as extreme as that actually observed.", + +"Option \(D\). The smaller the \(P\)-value, the more rare our data set is. The rarer a data set is, the more evidence we have against null hypothesis.",) +; + +@ssols = (@solution[@order]); + +###################################### +# Main text + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +####################################### +BEGIN_SOLUTION + +(a) $ssols[0] +$PAR +(b) $ssols[1] +$PAR +(c) $ssols[2] + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + + diff --git a/Contrib/PCC/Statistics/SignificanceTesting/14Stats_08_InferenceIntro.pg b/Contrib/PCC/Statistics/SignificanceTesting/14Stats_08_InferenceIntro.pg new file mode 100644 index 0000000000..f0fe8e7cee --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/14Stats_08_InferenceIntro.pg @@ -0,0 +1,108 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Hypothesis tests) +## DBsection(Concepts) +## Institution(The College of Idaho) +## Author(J Guild) +## MLT(statethetest) +## MLTleader(1) +## Level(2) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('14') +## Problem1('') +## KEYWORDS('statistics', 'inference', 'confidence interval') +## Updated: 2011/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("A certain type of hummingbird is known to have an average weight of \(4.55\) grams. A researcher wonders if hummingbirds (of this same type) living in the Grand Canyon differ in weight from the population as a whole. The researcher finds a sample of \(30\) such hummingbirds from the Grand Canyon and calculates their average weight to be \(3.75\) grams.","\(H_0: \mu = 4.55\), \(\ \ H_a: \mu \neq 4.55\)"); + $mc[0]->extra("\(H_0: \mu = 4.55\), \(\ \ H_a: \mu < 4.55\)", + "\(H_0: \mu = 3.75\), \(\ \ H_a: \mu \neq 3.75\)", + "\(H_0: \mu < 4.55\), \(\ \ H_a: \mu = 4.55\)", + "\(H_0: {\bar x} = 3.75\), \(\ \ H_a: {\bar x} > 3.75\)", + "\(H_0: {\bar x} = 4.55\), \(\ \ H_a: {\bar x} < 4.55 \)"); +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The mean height of $BITALIC all$EITALIC adult American males is \(69\) inches (5ft 9in). A researcher wonders if $BITALIC young $EITALIC American males between the ages of \(18\) and \(21\) tend to be taller than \(69\) inches. A random sample of \(100\) young American males ages \(18\) to \(21\) yielded a sample mean of \(71\) inches.","\(H_0: \mu = 69 \) , \(\ \ H_a: \mu > 69 \)"); + $mc[1]->extra("\(H_0: \mu = 69 \), \(\ \ H_a: \mu \neq 69 \)", + "\(H_0: \mu = 71 \), \(\ \ H_a: \mu < 71 \)", + "\(H_0: \mu > 69 \), \(\ \ H_a: \mu < 69 \)", + "\(H_0: {\bar x} = 69 \), \(\ \ H_a: {\bar x} > 69 \)", + "\(H_0: {\bar x} = 71 \), \(\ \ H_a: {\bar x} < 71\)"); +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("According to the Merck Veterinary Manual, the average resting heart rate for a certain type of sheep dog is \(115\) beats per minute (bpm). A Montana farmer notices his aging sheep dog has been acting more lethargic than usual and wonders if her heart rate is slowing. He measures her heart rate on \(15\) occasions and finds a sample mean heart rate of \(118.2\) bpm. ", + "\(H_0: \mu = 115\), \(\ \ H_a: \mu < 115\)"); + $mc[2]->extra("\(H_0: \mu = 115\), \(\ \ H_a: \mu > 115\)", + "\(H_0: \mu = 115\), \(\ \ H_a: \mu \neq 115\)", + "\(H_0: \mu = 118.2\), \(\ \ H_a: \mu < 118.2\)", + "\(H_0: {\bar x} = 118.2\), \(\ \ H_a: {\bar x} \neq 118.2\)", + "\(H_0: {\bar x} = 115\), \(\ \ H_a: {\bar x} > 115\)"); + +@solution= ("Option \(E\). We do not base our null hypothesis on sample data, so Option \(D\) and \(F\) are ruled out. Our null hypothesis always uses \(H_0: \mu =\), so Option \(A\) is out. The researcher wonders if the weights differ from the population. Since this makes no mention of greater or less than we will use a two sided test, which uses \(H_a: \mu \neq\).", + +"Option \(A\). We do not base our null hypothesis on sample data, so Option \(B\) and \(E\) are ruled out. Our null hypothesis always uses \(H_0: \mu =\), so Option \(C\) is out. The researcher wonders if the heights are taller than \(69\) inches. We are therefore interested in a one sided test, using greater than, which uses \(H_a: \mu >\).", + +"Option \(C\). We do not base our null hypothesis on sample data, so Option \(A\) and \(B\) are ruled out. Our null hypothesis always uses \(H_0: \mu =\), so Option \(F\) is out. The farmer wonders if heart rates are slowing, meaning the values are becoming lower. We are therefore interested in a one sided test, using less than, which uses \(H_a: \mu <\).",) +; + +@ssols = (@solution[@order]); +###################################### +# Main text + +BEGIN_TEXT +For each statement, select the correct null hypothesis, \( H_0 \), and +alternative hypothesis, \( H_a \), in symbolic form. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +####################################### +BEGIN_SOLUTION + +(a) $ssols[0] +$PAR +(b) $ssols[1] +$PAR +(c) $ssols[2] + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/SignificanceTesting/19Stats_03_InferencePropn.pg b/Contrib/PCC/Statistics/SignificanceTesting/19Stats_03_InferencePropn.pg new file mode 100644 index 0000000000..a7a4f8c7a0 --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/19Stats_03_InferencePropn.pg @@ -0,0 +1,123 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +@n = (76,78,80,82,84); +@x = (28,30,30,30,31); + +@p = (0.15284816, 0.245747299, 0.177529852, 0.125613157, 0.135867745); +$p = Real(@p[0]); +$choose = random(0,4,1); +$phat = Real($x[$choose]/$n[$choose]); +$sigma = Real(sqrt(0.45*0.55/$n[$choose])); +$z = ($x[$choose]/$n[$choose] - 0.45)/$sigma; +$zneg = -(($x[$choose]/$n[$choose] - 0.45)/$sigma); +$pval = Percent(normal_prob(-infty, $z)); +$pvaltwo = 2*$pval; + + +$diagram = DrawNormalDist($z, $zneg, $z, $zneg, outside=>1); + +###################################### +# Main text + +BEGIN_TEXT +An article in the Washington Post on March \(16\), \(1993\) stated that nearly \(45$PERCENT\) of all Americans have brown eyes. A random sample of \( n = +$n[$choose] \) PCC +students found \($x[$choose]\) with brown eyes. + +$BR +We test +$BCENTER +\( H_0: p = .45 \) +$BR +\( H_a: p \neq .45 \) +$ECENTER + +$PAR +(a) What is the \(z\)-statistic for this test? \( \) +\{ ans_rule(10)\} + +$PAR +(b) What is the \(P\)-value of the test? \( \) +\{ ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = Compute($z)->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01 ; + } => ["Close! Use more accuracy in our calculation."] +))); + +Context("Percent"); +$ans_b = Percent($p[$choose]); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student) > 1 ; + } => ["Enter your answer in decimal form. It looks like you entered a percent."] +))); + + +############################################################# +BEGIN_SOLUTION +(a) In our random sample of \($n[$choose]\) PCC students, \($x[$choose]\) had brown eyes. This means \(\hat{p}\approx$phat\). Since we know \(p=0.45 \), this means \(q=0.55 \). Using our formula for \(\operatorname{SD}(\hat{p})=\sqrt{\frac{pq}{n}}\), we find that, +$PAR +\(\text{SD}(\hat{p})=\sqrt{\frac{(0.45)(0.55)}{$n[$choose]}} \approx $sigma\) +$PAR +This will allow to us to find our \(z\)-score using \(z=\frac{\hat{p}-p}{\operatorname{SD}(\hat{p})}\) +$PAR +\(z=\frac{$phat-0.45}{$sigma} \approx $z\). Therefore our \(z\)-statistic is \($z\). +$PAR +(b) For our \(P\)-value, we will need to use technology. When used as a one-sided test, we obtain \(P\)-value of \($pval\). However, since \( H_a: p \neq .45 \), we need a two-sided test. Therefore, we need to double our \(P\)-value to obtain a \(P\)-value of \($pvaltwo\). The two sided test shading is shown below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR + + + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file diff --git a/Contrib/PCC/Statistics/SignificanceTesting/19Stats_05_InferencePropn.pg b/Contrib/PCC/Statistics/SignificanceTesting/19Stats_05_InferencePropn.pg new file mode 100644 index 0000000000..501072d37e --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/19Stats_05_InferencePropn.pg @@ -0,0 +1,128 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@name = ("Pedro", "Julia", "Matt", "Albert"); +$m= random(0,3,1); +$pronoun = "he"; +if ($m==1) {$pronoun = "she";} +$s = random(1,6,1); +@n = (30,34,38,42,46,50); +@x = (6,7,8,9,10,11); +@p = (.383553, .334795, .293451, .258108,.227693,.20137); +$pval = 100*($p[$choose]); +@normalbased = (0.312103057, 0.269749098, 0.234079955, 0.203812974, 0.177969037, 0.155786037); +$null = Real(1/6); +$null2 = Real(5/6); +$phat = Real($x[$choose]/$n[$choose]); +$sigma = Real(sqrt($null*$null2)/$n[$choose]); +$z = ($x[$choose]/$n[$choose] - (1/6))/$sigma; + +$choose = random(0,5,1); + +$popup = PopUp(["?", "Yes", "No"], "No"); + +###################################### +# Main text + +BEGIN_TEXT + $name[$m] thinks that $pronoun has a special relationship with the number \($s\). +In particular, $name[$m] thinks that $pronoun would roll a \($s\) with a fair +\(6\)-sided die more often than you'd expect by chance alone. Suppose \(p\) is +the true proportion of the time $name[$m] will roll a \($s\). + +$PAR +(a) State the null and alternative hypotheses for testing $name[$m]'s claim. +(Type the symbol "p" for the population proportion, whichever symbols you need +of "<", ">", "=", "not =" and express any values as a fraction e.g. $BBOLD p = +1/3$EBOLD) +$BR + \( H_0:\) \{ ans_rule(15)\} +$BR + \( H_a:\) \{ ans_rule(15)\} +END_TEXT + +BEGIN_TEXT +$PAR +(b) Now suppose $name[$m] makes \($n[$choose]\) rolls, and a \($s\) comes up +\($x[$choose]\) times out of the \($n[$choose]\) rolls. Determine the \(P\)-value of the +test: +$BR +\(P\)-value = \{ ans_rule(10) \} + +$PAR +(c) Answer the question: Does this sample provide evidence at the \(5$PERCENT\) level +that $name[$m] rolls a \($s\) more often than you'd expect? +$BR + \{$popup->menu \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a1 = "p=1/6"; +ANS(ordered_str_cmp($ans_a1)); + +$ans_a2 = "p > 1/6"; +ANS(ordered_str_cmp($ans_a2)); + +Context("Percent"); +$ans_b = Percent("$p[$choose]"); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + Percent($normalbased[$choose]) => ["It looks like you computed using a Normal approximation, but what are the conditions for using a Normal approximation? They are not met here. You must work more directly with the binomial distribution."] +))); + + + +ANS($popup->cmp); + + +############################################################# + +BEGIN_SOLUTION +(a) As \(p\) is the true proportion of the time $name[$m] will roll a \($s\) and we know the die is fair, we have \(p=\frac{1}{6}\). This means we have \( H_0: p=\frac{1}{6}\). As $name[$m] claims they will roll \($s\)'s more than you would expect them to we, have \( H_A: p>\frac{1}{6}\) +$PAR +(b) Wait! Don't use the normal approximation! Check the conditions. We need to be able to have at least \(10\) successes, \(np>10\) and \(10\) failures, \(nq>10\). But since are only rolling \($n[$choose]\) times and the die is fair, this means we will have \($n[$choose]\cdot\frac{5}{6} > 10\) failures, but \($n[$choose]\cdot\frac{1}{6} < 10\) successes. This means we need to use the binomial model still. +$PAR +How likely is it that $name[$m] rolled a \($s\), \($x[$choose]\) times out of the \($n[$choose]\), or something more extreme? This is asking for a \(P\)-value. Since we cannot use the normal approximation, we will find the \(P\)-value using the binomial distribution. This amounts to finding, \(\text{P}(X \geq 7)\), +$PAR +\(\text{P}(X \geq 7) =\text{P}(X=7) +\text{P}(X=8) +...+... + \text{P}(X=$n[$choose])\) +$PAR +Via technology we find that \(\text{P}(X \geq 7)\approx $p[$choose]...\), or, a \(P\)-value of \($pval$PERCENT\) +$PAR +(c) Using the \(5$PERCENT\) level, if $name[$m] rolls a \($s\) more often than we would expect, then \(P\)-value \(< 5$PERCENT\). Otherwise, if a \($s\) is $BBOLD not $EBOLD rolled more often than we would expect, then \(P\)-value \(> 5$PERCENT\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + diff --git a/Contrib/PCC/Statistics/SignificanceTesting/19Stats_09_InferencePropn.pg b/Contrib/PCC/Statistics/SignificanceTesting/19Stats_09_InferencePropn.pg new file mode 100644 index 0000000000..c29c210aba --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/19Stats_09_InferencePropn.pg @@ -0,0 +1,115 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +@n = (1000, 1100, 1200, 1300, 1400); +@x = (520, 570, 620, 670, 720); +@z = (1.264911064, 1.206045378, 1.154700538, 1.109400392, 1.069044968); +@p = (0.102951605, 0.113899997, 0.124106539, 0.133628747, 0.142524704); +$choose = random(0,4,1); +$phat = Real($x[$choose]/$n[$choose]); +$sigma = Real(sqrt(0.50*0.50/$n[$choose])); +$z = ($x[$choose]/$n[$choose] - 0.50)/$sigma; +$zneg = -(($x[$choose]/$n[$choose] - 0.50)/$sigma); +$pval = Percent(normal_prob($z,infty)); + +$diagram = DrawNormalDist(99, $z, "", $z, outside=>1); +###################################### +# Main text + +BEGIN_TEXT +A newspaper conducted a statewide survey concerning the \(2014\) race for state senator. The newspaper took a SRS of \( n = $n[$choose] \) registered voters and found that \($x[$choose]\) would vote for the Republican candidate. Let \(p\) represent the proportion of registered voters in the state who would vote for +the Republican candidate. + +$BR +We test + +$BCENTER +\( H_0: p = 0.50 \) +$BR +\( H_a: p > 0.50\) +$ECENTER + +$PAR +(a) What is the \(z\)-statistic for this test? \( \) +\{ ans_rule(10)\} + +$PAR +(b) What is the \(P\)-value of the test? \( \) +\{ ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = Compute("$z[$choose]")->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01 ; + } => ["Close! Use more accuracy in our calculation."] +))); + +Context("Percent"); +$ans_b = Percent("$p[$choose]"); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student) > 1 ; + } => ["Enter your answer in decimal form. It looks like you entered a percent."] +))); + +############################################################# +BEGIN_SOLUTION +(a) In the SRS done by the newspaper it was found that out of \($n[$choose] \) registered voters, \($x[$choose]\) would vote for the Republican candidate. This means \(\hat{p}\approx$phat\). Since we know \(p=0.50 \), this means \(q=0.50 \). Using our formula for \(\operatorname{SD}(\hat{p})=\sqrt{\frac{pq}{n}}\), we find that, +$PAR +\(\text{SD}(\hat{p})=\sqrt{\frac{(0.50)(0.50)}{$n[$choose]}} \approx $sigma\) +$PAR +This will allow to us to find our \(z\)-score using \(z=\frac{\hat{p}-p}{\operatorname{SD}(\hat{p})}\) +$PAR +\(z=\frac{$phat-0.50}{$sigma} \approx $z\). Therefore our \(z\)-statistic is \($z\). +$PAR +(b) For our \(P\)-value, we will need to use technology. Since we have \( H_a: p > .50\), we will use one-sided test shaded to the right. With technology, we obtain \(P\)-value of \($pval\). The one sided test shading is shown below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file diff --git a/Contrib/PCC/Statistics/SignificanceTesting/19Stats_10_InferencePropn.pg b/Contrib/PCC/Statistics/SignificanceTesting/19Stats_10_InferencePropn.pg new file mode 100644 index 0000000000..4d94ea0a88 --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/19Stats_10_InferencePropn.pg @@ -0,0 +1,120 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +@n = (180,200,220,240,260); +@x = (43,49,52,65,70); +@z = (1.304372987, 1.590990258, 1.348399725, 2.743363204, 2.790781528); +@p = (0.09605322, 0.055805884, 0.088764926, 0.003040669, 0.002629048); +$choose = random(0,4,1); +$phat = Real($x[$choose]/$n[$choose]); +$sigma = Real(sqrt(0.20*0.80/$n[$choose])); +$z = Real(($phat - 0.20)/$sigma); +$pval = Percent(normal_prob($z,infty)); + + +$diagram = DrawNormalDist(99,$z,"", $z, outside=>1); + +###################################### +# Main text + +BEGIN_TEXT +A noted psychic was tested for ESP. The psychic was presented with +\($n[$choose]\) cards face down and was asked to determine if the card was one of +\(5\) symbols: a star, cross, circle, square, or three wavy lines. The psychic +was correct in \($x[$choose]\) cases. Let \(p\) represent the probability that +the psychic correctly identifies the symbol on the card in a random trial. +Assume the \($n[$choose]\) trials can be treated as an SRS from the population of +all guesses. + +$BR +To see if there is evidence that the psychic is doing better than just +guessing, we test +$BCENTER +\( H_0: p = 0.20 \) +$BR +\( H_a: p > 0.20 \) +$ECENTER + +$PAR +(a) What is the \(z\)-statistic for this test? \( \) +\{ ans_rule(10)\} + +$PAR +(b) What is the \(P\)-value of the test? \( \) +\{ ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = Compute("$z[$choose]")->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01 ; + } => ["Close! Use more accuracy in our calculation."] +))); + +Context("Percent"); +$ans_b = Percent($p[$choose]); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student) > 1 ; + } => ["Enter your answer in decimal form. It looks like you entered a percent."] +))); + +############################################################# +BEGIN_SOLUTION +(a) The psychic was presented with \($n[$choose]\) cards and they guessed the symbol correctly \($x[$choose]\) times. This means \(\hat{p}\approx$phat\). Since we know \(p=0.20 \), this means \(q=0.80 \). Using our formula for \(\operatorname{SD}(\hat{p})=\sqrt{\frac{pq}{n}}\), we find that, +$PAR +\(\text{SD}(\hat{p})=\sqrt{\frac{(0.20)(0.80)}{$n[$choose]}} \approx $sigma\) +$PAR +This will allow to us to find our \(z\)-score using \(z=\frac{\hat{p}-p}{\operatorname{SD}(\hat{p})}\) +$PAR +\(z=\frac{$phat-0.20}{$sigma} \approx $z\). Therefore our \(z\)-statistic is \($z\). +$PAR +(b) For our \(P\)-value, we will need to use technology. Since we have \( H_a: p > .20\), we will use one-sided test shaded to the right. With technology, we obtain \(P\)-value of \($pval\). The one sided test shading is shown below. +$PAR +\{Plot($diagram, tex_size=>900)\} + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/SignificanceTesting/19Stats_12_InferencePropn.pg b/Contrib/PCC/Statistics/SignificanceTesting/19Stats_12_InferencePropn.pg new file mode 100644 index 0000000000..2daa9573c9 --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/19Stats_12_InferencePropn.pg @@ -0,0 +1,138 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +$n = random(40,70,1); +$x = random(30,($n-5),1); +$p = Real($x/$n); +$q0 = (1-$p0); +$p0 = random(.4,.7,.1); +$perc = 100*$p0; +$sd = Real(sqrt(($p0*(1-$p0))/$n)); + +$alpha = random(.01,.05,.04); +$alphap = (100*$alpha); +$tot = (1-$alpha); +$totp = (100*$tot); + +$z = ($p-$p0)/$sd; + +$crit = udistr($alpha); + +$pval = Percent(normal_prob($z,infty)); + +$diagram = DrawNormalDist(99, $z, "", $z, outside=>1); + +@ans = ("We can reject the null hypothesis that \(p = $p0\) and accept that \(p > $p0 \). That is, the cream can improve the skin of more than \($perc$PERCENT\) of women over \(50\).", +"There is not sufficient evidence to reject the null hypothesis that \( p = $p0\). That is, +there is not sufficient evidence to reject that the cream can improve the skin of more than \($perc$PERCENT\) of women over \(50\)."); + +if ( $z > $crit) {$tag = 0;} else {$tag = 1;} + +$mc = new_multiple_choice(); +$mc -> qa('The final conclusion is', $ans[$tag]); +$mc -> extra($ans[1-$tag]); + + +###################################### +# Main text + +BEGIN_TEXT +A new cream that advertises that it can reduce wrinkles and improve skin was subject to a recent +study. A sample of \($n\) women over the age of \(50\) used the new cream for \(6\) months. Of those \($n\) +women, \($x\) of them reported skin improvement (as judged by a dermatologist). Is this evidence that +the cream will improve the skin of more than \($perc$PERCENT\) of women over the age of \(50\)? Test +using \(\alpha = $alpha\). +END_TEXT + +BEGIN_TEXT +$PAR +(a) Test statistic: \( z = \) \{ans_rule(20)\} + +$PAR +(b) Critical \(z\)-score for determining significance: \(z^* = \) \{ans_rule(20)\} + +$PAR +(c) \{ $mc->print_q() \} +$BR +\{ $mc->print_a() \} + +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +#ANS(num_cmp($rej, tol=>.005)); + +$ans_a = Compute("$z")->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01 ; + } => ["Close! Use more accuracy in our calculation."] +))); + +$ans_b = Compute("$crit")->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + $alpha => ["Enter the critical value not the significance level."] +))); + +ANS(radio_cmp($mc->correct_ans)); + +################################################# +BEGIN_SOLUTION +(a) Does the cream improve skin? This tells us we will have a one sided hypothesis test using the \(>\) sign in our alternative hypothesis. Since \($x\) out of \($n\) women reported improvement in skin we know that \(\hat{p} \approx $p\). We want to test if this is evidence that the cream will improve the skin of more than \($perc$PERCENT\) of women, which means \(p=$p0\). Thus we can find, \(\operatorname{SD}(\hat{p})=\sqrt{\frac{$p0\cdot$q0}{$n}}\approx$sd\). +$PAR +Therefore our test statistic is \(z=\frac{$p-$p0}{$sd}\approx$z\). +$PAR +(b) If our significance level is \(\alpha = $alpha\), since the question was if the cream improved skin, this means we want a right-tailed critical \(z^{*}\). This mean only \($alpha\), or, \($alphap$PERCENT\) is above the needed \(z^{*}\). Therefore, we can use the inverse technology command using an area of \($tot\). Recall we do this since our technology only can shade in left and if \($totp$PERCENT\) is below the \(z^{*}\) value in question, only \($alphap$PERCENT\) is above it . Thus, we find \(z^{*}\approx$crit\). +$PAR +(c) The final conclusion requires a \(P\)-value. Using technology and our test statistic of \(z\approx$z\), we find a \(P\)-value of \($pval\), also seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +The final conclusion is that: $ans[$tag] +$PAR +This conclusion is always based on the fact that if our \(p\)-value is less than \(\alpha\) we reject the null hypothesis and if our \(P\)-value is great than \(\alpha\) we do not reject the null hypothesis. +END_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SignificanceTesting/di12.pg b/Contrib/PCC/Statistics/SignificanceTesting/di12.pg new file mode 100644 index 0000000000..fbb7d46f2d --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/di12.pg @@ -0,0 +1,99 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## Tagged by dgt5v + +## DBsubject(Statistics) +## DBchapter(Hypothesis tests) +## DBsection(Type I/type II errors and power) +## Institution(ASU) +## Level(1) +## KEYWORDS('Statistics','Hypothesis Testing') +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc[0] = new_multiple_choice(); +$mc[0] -> qa('"The mean body temperature for humans in fact is \(98.6\) degrees Farenheit and the result of the sampling do not lead to the rejection of the fact that the mean body temperature is \(98.6\) degrees Farenheit" is a', "correct decision"); +$mc[0] -> extra("Type II error", "Type I error"); + +$mc[1] = new_multiple_choice(); +$mc[1] -> qa('"The mean body temperature for humans in fact is \(98.6\) degrees Farenheit but the result of the sampling lead to the conclusion that the mean body temprature for humans differ from \(98.6\) degrees Farenheit" is a', "Type I error"); +$mc[1] -> extra("Type II error", "correct decision"); + +$mc[2] = new_multiple_choice(); +$mc[2] -> qa('"The mean body temperature for humans in fact differs from \(98.6\) degrees Farenheit but the result of the sampling fail to lead that conclusion" is a', "Type II error"); +$mc[2] -> extra("Type I error", "correct decision"); + +$mc[3] = new_multiple_choice(); +$mc[3] -> qa('"The mean body temperature for humans in fact differs from \(98.6\) degrees Farenheit and the result of the sampling lead to that conclusion" is a', "correct decision"); +$mc[3] -> extra("Type II error", "Type I error"); + +@slice = NchooseK(4,4); +@smc = @mc[@slice]; + +@solutions= ("Option \(C\). The mean body temperature for humans in fact is \(98.6\) degrees Farenheit and our data supported that by not rejecting the null hypothesis. This confirms that we should not have rejected the null hypothesis and we didn't! Thus, we have made the correct decision.", + +"Option \(A\). The mean body temperature for humans in fact is \(98.6\) degrees Farenheit but our data did not support that. This resulted in us rejecting the null hypothesis when we should not have! This means we made a Type I error.", + +"Option \(C\). The mean body temperature for humans in fact differs from \(98.6\) degrees but our data did not lead us to that conclusion. This results in us not rejecting the null hypothesis when we should have! This means we made a Type II error.", + +"Option \(A\). The mean body temperature for humans in fact differs from \(98.6\) degrees Farenheit but our data did not support that conclusion. This means we should have rejected the null hypothesis but didn't! Therefore we made a Type II error.",) +; + +@ssols = @solutions[@slice]; + +BEGIN_TEXT +Consider the following hypothesis test. The null hypothesis is "The mean body temperature for humans is \(98.6\) degrees Farenheit." and the alternative hypothesis is "The mean body temperature for humans differs from \(98.6\) degrees Farenheit." Answer the following questions. +$PAR +a. +\{ $smc[0]-> print_q() \} $BR +\{ $smc[0]-> print_a() \} +$PAR +b. +\{ $smc[1]-> print_q() \} $BR +\{ $smc[1]-> print_a() \} +$PAR +c. +\{ $smc[2]-> print_q() \} $BR +\{ $smc[2]-> print_a() \} +$PAR +d. +\{ $smc[3]-> print_q() \} $BR +\{ $smc[3]-> print_a() \} +$PAR +END_TEXT + +ANS(radio_cmp($smc[0]->correct_ans)); +ANS(radio_cmp($smc[1]->correct_ans)); +ANS(radio_cmp($smc[2]->correct_ans)); +ANS(radio_cmp($smc[3]->correct_ans)); + +############################################## +BEGIN_SOLUTION +(a) $ssols[0] +$PAR +(b) $ssols[1] +$PAR +(c) $ssols[2] +$PAR +(d) $ssols[3] +END_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SignificanceTesting/di13.pg b/Contrib/PCC/Statistics/SignificanceTesting/di13.pg new file mode 100644 index 0000000000..a7cffac176 --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/di13.pg @@ -0,0 +1,110 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Hypothesis Testing') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Type I/Type II Errors') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +$a='"'; +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mc[0] = new_multiple_choice(); +$mc[0] -> qa("${a}The mean annual consumption of beer in the nation's captial is not less than the national mean and the result of the sampling does not lead to the conclusion that the mean annual consumption of beer in the nation's capital is less than the national mean$a is a", "Correct decision"); +$mc[0] -> extra("Type II error", "Type I error"); + +$mc[1] = new_multiple_choice(); +$mc[1] -> qa("${a}The mean annual consumption of beer in the nation's captial is not less than the national mean but the result of the sampling leads to the conclusion that the mean annual consumption of beer in the nation's capital is less than the national mean$a is a", "Type I error"); +$mc[1] -> extra("Type II error", "Correct decision"); + +$mc[2] = new_multiple_choice(); +$mc[2] -> qa("${a}The mean annual consumption of beer in the nation's captial is less than the national mean but the result of the sampling does not lead to the conclusion that the mean annual consumption of beer in the nation's capital is less than the national mean$a is a", "Type II error"); +$mc[2] -> extra("Type I error", "Correct decision"); + +$mc[3] = new_multiple_choice(); +$mc[3] -> qa("${a}The mean annual consumption of beer in the nation's captial is less than the national mean and the result of the sampling leads to the conclusion that the mean annul consumption of beer in the nation's capital is less than the national mean$a is a", "Correct decision"); +$mc[3] -> extra("Type II error", "Type I error"); + +@slice = NchooseK(4,4); +@smc = @mc[@slice]; + +@solutions= ("Option \(C\). The mean annual consumption of beer in the nation's captial is not less than the national mean and our data supported that by not rejecting the null hypothesis. This confirms that we should not have rejected the null hypothesis and we didn't! Thus, we have made the correct decision.", + +"Option \(A\). The mean annual consumption of beer in the nation's captial is not less than the national mean but our data makes us think it is. This resulted in us rejecting the null hypothesis when we should not have! This means we made a Type I error.", + +"Option \(C\). The mean annual consumption of beer in the nation's captial is less than the national mean but our data did not lead us to that conclusion. This results in us not rejecting the null hypothesis when we should have! This means we made a Type II error.", + +"Option \(A\). The mean annual consumption of beer in the nation's captial is less than the national mean and our data supported that conclusion. This means we made the correct decision.",) +; + +@ssols = @solutions[@slice]; + +BEGIN_TEXT +Consider a hypothesis test to decide whether the mean annual consumption of beer in the nation's capital is less than the national mean. Answer the following questions. +$PAR +a. +\{ $smc[0]-> print_q() \} $BR +\{ $smc[0]-> print_a() \} +$PAR +b. +\{ $smc[1]-> print_q() \} $BR +\{ $smc[1]-> print_a() \} +$PAR +c. +\{ $smc[2]-> print_q() \} $BR +\{ $smc[2]-> print_a() \} +$PAR +d. +\{ $smc[3]-> print_q() \} $BR +\{ $smc[3]-> print_a() \} +$PAR +END_TEXT + +ANS(radio_cmp($smc[0]->correct_ans)); +ANS(radio_cmp($smc[1]->correct_ans)); +ANS(radio_cmp($smc[2]->correct_ans)); +ANS(radio_cmp($smc[3]->correct_ans)); + +############################################## +BEGIN_SOLUTION +(a) $ssols[0] +$PAR +(b) $ssols[1] +$PAR +(c) $ssols[2] +$PAR +(d) $ssols[3] +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/Contrib/PCC/Statistics/SignificanceTesting/di14.pg b/Contrib/PCC/Statistics/SignificanceTesting/di14.pg new file mode 100644 index 0000000000..26dd13c9d8 --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/di14.pg @@ -0,0 +1,105 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Hypothesis Testing') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Type I/Type II Errors') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +$a='"'; +TEXT(beginproblem()); +$mc[0] = new_multiple_choice(); +$mc[0] -> qa("$a The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean and the result of the sampling does not lead to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean $a is a", "correct decision"); +$mc[0] -> extra("Type II error", "Type I error"); + +$mc[1] = new_multiple_choice(); +$mc[1] -> qa("$a The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean but the result of the sampling leads to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean $a is a", "Type I error"); +$mc[1] -> extra("Type II error", "correct decision"); + +$mc[2] = new_multiple_choice(); +$mc[2] -> qa("$a The mean cost to community hospitals per patient per day in Ohio exceeds the national mean but the result of the sampling does not lead to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean $a is a", "Type II error"); +$mc[2] -> extra("Type I error", "correct decision"); + +$mc[3] = new_multiple_choice(); +$mc[3] -> qa("$a The mean cost to community hospitals per patient per day in Ohio exceeds the national mean and the result of the sampling leads to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean $a is a", "correct decision"); +$mc[3] -> extra("Type II error", "Type I error"); + +@slice = NchooseK(4,4); +@smc = @mc[@slice]; + +@solutions= ("Option \(C\). The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean and our data supported that by not rejecting the null hypothesis. This confirms that we should not have rejected the null hypothesis and we didn't! Thus, we have made the correct decision.", + +"Option \(A\). The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean but our data did not support that. This resulted in us rejecting the null hypothesis when we should not have! This means we made a Type I error.", + +"Option \(C\). The mean cost to community hospitals per patient per day in Ohio exceeds the national mean but our data did not lead us to that conclusion. This results in us not rejecting the null hypothesis when we should have! This means we made a Type II error.", + +"Option \(A\). The mean cost to community hospitals per patient per day in Ohio exceeds the national mean and our data supported that conclusion. This means we made the correct decision.",) +; + +@ssols = @solutions[@slice]; + +BEGIN_TEXT +Consider a hypothesis test to decide whether the mean cost to community hospitals per patient per day in Ohio exceed the national mean. Answer the following questions. +$PAR +a. +\{ $smc[0]-> print_q() \} $BR +\{ $smc[0]-> print_a() \} +$PAR +b. +\{ $smc[1]-> print_q() \} $BR +\{ $smc[1]-> print_a() \} +$PAR +c. +\{ $smc[2]-> print_q() \} $BR +\{ $smc[2]-> print_a() \} +$PAR +d. +\{ $smc[3]-> print_q() \} $BR +\{ $smc[3]-> print_a() \} +$PAR +END_TEXT + +ANS(radio_cmp($smc[0]->correct_ans)); +ANS(radio_cmp($smc[1]->correct_ans)); +ANS(radio_cmp($smc[2]->correct_ans)); +ANS(radio_cmp($smc[3]->correct_ans)); + +############################################## +BEGIN_SOLUTION +(a) $ssols[0] +$PAR +(b) $ssols[1] +$PAR +(c) $ssols[2] +$PAR +(d) $ssols[3] +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SignificanceTesting/dueck9_2_1.pg b/Contrib/PCC/Statistics/SignificanceTesting/dueck9_2_1.pg new file mode 100644 index 0000000000..6d41b2038b --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/dueck9_2_1.pg @@ -0,0 +1,75 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Hypothesis Testing') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Type I/Type II Errors') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mc1 = new_multiple_choice(); +$mc1->qa('Type I error is:', + 'Deciding null hypothesis is false when it is true' +); +$mc1->extra( + 'Deciding null hypothesis is true when it is false', + 'Deciding alternative hypothesis is true when it is true' +); +$mc1->makeLast( + 'All of the above', + 'None of the above' +); + + +$mc2 = new_multiple_choice(); +$mc2->qa('Type II error is:', + 'None of the above' +); +$mc2->extra( + 'Deciding null hypothesis is false when it is true', + 'Deciding alternative hypothesis is false when it is true', + 'Deciding alternative hypothesis is true when it is true' +); +$mc2->makeLast( + 'All of the above', + 'None of the above' +); + + +BEGIN_TEXT +$PAR +\{ $mc1->print_q() \} +\{ $mc1->print_a() \} +$PAR +\{ $mc2->print_q() \} +\{ $mc2->print_a() \} +END_TEXT +ANS(radio_cmp($mc1->correct_ans)); +ANS(radio_cmp($mc2->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/SignificanceTesting/dueck9_3_1.pg b/Contrib/PCC/Statistics/SignificanceTesting/dueck9_3_1.pg new file mode 100644 index 0000000000..f12349a09f --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/dueck9_3_1.pg @@ -0,0 +1,68 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Hypothesis Testing') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Significance Levels') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = 0.01; +$z1 = -1*udistr($a); +$z2 = udistr($a); +$z3 = udistr($a/2); +$tot1 = ($a); + + +BEGIN_TEXT +Given the significance level \(\alpha = $a\) find the following: $PAR +(a) \( \ \) left-tailed critical \(z^{*}\) value $BR +\(z^{*} = \) \{ans_rule(10)\} $PAR +(b) \( \ \) right-tailed critical \(z^{*}\) value $BR +\(z^{*} = \) \{ans_rule(10)\} $PAR +(c) \( \ \) two-tailed critical \(z^{*}\) value $BR +\(|z^{*}| = \) \{ans_rule(10)\} +END_TEXT +ANS(num_cmp($z1, tol=>.01)); +ANS(num_cmp($z2, tol=>.01)); +ANS(num_cmp($z3, tol=>.01)); + +############################################### +BEGIN_SOLUTION + +(a) If our significance level is \(\alpha = $a\) and we want a left-tailed critical \(z^{*}\) value, this means there is only \($a\), or, \(1$PERCENT\) below the needed \(z^{*}\). Therefore, we can use the inverse technology command, using an area of \(0.01\), to find \(z^{*}\approx$z1\). +$PAR +(b) If our significance level is \(\alpha = $a\) and we want a right-tailed critical \(z^{*}\) value, this means there is only \($a\), or, \(1$PERCENT\) above the needed \(z^{*}\). Therefore, we can use the inverse technology command using an area of \(0.99\). Recall we do this since our technology only can shade in left and if \(0.99\) is below the \(z^{*}\) value in question, only \(0.01\) is above it . Thus, we find \(z^{*}\approx$z2\). +$PAR +A shortcut is to use the fact that the normal curve is symmetrical and thus, assuming the same \(\alpha\) level, the only difference between a left-tailed critical \(z^{*}\) value and a right-tailed critical \(z^{*}\) value is the sign of \(z^{*}\). +$PAR +(c) If our significance level is \(\alpha = $a\) and we want a two-tailed critical \(z^{*}\) value, this means there is only \(0.005\), or, \(0.5$PERCENT\) on each side. \(0.005\), or, \(0.5$PERCENT\) above the positive \(z^{*}\) value and \(0.005\) below the negative \(z^{*}\) value. We can thus use the inverse technology command, using an area of \(0.005\) OR an area of \(0.995\), to find \(|z^{*}|\approx$z3\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/SignificanceTesting/kolossa30.pg b/Contrib/PCC/Statistics/SignificanceTesting/kolossa30.pg new file mode 100644 index 0000000000..0a9e5f02ae --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/kolossa30.pg @@ -0,0 +1,76 @@ +##DESCRIPTION +## Statistics: hypothesis test critical regions +##ENDDESCRIPTION + +## KEYWORDS('alpha values') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Elements of a Statistical Test') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"contextPercent.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +$a = random(.01,.1,.01); +$z1 = -1*udistr($a); +$z2 = udistr($a); +$z3 = udistr($a/2); +$tot = (1-$a); +$aperc = Percent($a); +$totperc = Percent($tot); +$atwoside = ($a/2); +$atwosidex = (1-$atwoside); +$atwosideperc = Percent($atwoside); + + +BEGIN_TEXT +Given the significance level \(\alpha = $a\) find the following: $PAR +(a) \( \ \) left-tailed critical \(z^{*}\) value $BR +\(z^{*} = \) \{ans_rule(10)\} $PAR +(b) \( \ \) right-tailed critical \(z^{*}\) value $BR +\(z^{*} = \) \{ans_rule(10)\} $PAR +(c) \( \ \) two-tailed critical \(z^{*}\) value $BR +\(|z^{*}| = \) \{ans_rule(10)\} +END_TEXT +ANS(num_cmp($z1, tol=>.01)); +ANS(num_cmp($z2, tol=>.01)); +ANS(num_cmp($z3, tol=>.01)); + +################################################### +BEGIN_SOLUTION + +(a) If our significance level is \(\alpha = $a\) and we want a left-tailed critical \(z^{*}\) value, this means there is only \($a\), or, \($aperc\) below the needed \(z^{*}\). Therefore, we can use the inverse technology command, using an area of \($a\), to find \(z^{*}=$z1\) +$PAR +(b) If our significance level is \(\alpha = $a\) and we want a right-tailed critical \(z^{*}\) value, this means there is only \($a\), or, \($aperc\) above the needed \(z^{*}\). Therefore, we can use the inverse technology command using an area of \($tot\). Recall we do this since our technology only can shade in left and if \($totperc\) is below the \(z^{*}\) value in question, only \($a\) is above it . Thus, we find \(z^{*}=$z2\) +$PAR +A shortcut is to use the fact that the normal curve is symmetrical and thus, assuming the same \(\alpha\) level, the only difference between a left-tailed critical \(z^{*}\) value and a right-tailed critical \(z^{*}\) value is the sign of \(z^{*}\). +$PAR +(c) If our significance level is \(\alpha = $a\) and we want a two-tailed critical \(z^{*}\) value, this means there is only \($atwoside\), or, \($atwosideperc\) on each side. \($atwoside\), or, \($atwosideperc\) is above the positive \(z^{*}\) value and \($atwoside\) below the negative \(z^{*}\) value. We can thus use the inverse technology command, using an area of \($atwoside\) OR an area of \($atwosidex\), to find \(|z^{*}|=$z3\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/SignificanceTesting/kolossa33.pg b/Contrib/PCC/Statistics/SignificanceTesting/kolossa33.pg new file mode 100644 index 0000000000..7abaa79f3c --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/kolossa33.pg @@ -0,0 +1,76 @@ +##DESCRIPTION +## Statistics: hypothesis tests +##ENDDESCRIPTION + +##KEYWORDS('statistics','hypothesis testing') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Elements of a Statistical Test') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGauxiliaryFunctions.pl", +"PGanswermacros.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(0.07,0.10,.1); +$a2 = random(.01,.05,.1); + + +@event = (' \(\alpha = '."$a1".',\ P\)-value \(= 0.06\)', ' \(\alpha = '."$a2".',\ P\)-value \(= 0.06\)'); +@ans = ("reject null hypothesis", "do not reject null hypothesis"); + +@slice = NchooseK(2,2); +@sevent = @event[@slice]; +@sans = @ans[@slice]; + +$popup0 = PopUp(["?","reject null hypothesis","do not reject null hypothesis"],$sans[0]); + +$popup1 = PopUp(["?","reject null hypothesis","do not reject null hypothesis"],$sans[1]); + +BEGIN_TEXT + +In each part, we have given the significance level and the \(P\)-value for a hypothesis test. For each case determine if the null hypothesis should be rejected. + $PAR + +(a) \( \) $sevent[0] $BR +\{$popup0->menu\} $PAR +(b) \( \) $sevent[1] $BR +\{$popup1->menu\} + + +END_TEXT +ANS($popup0->cmp); +ANS($popup1->cmp); + +########################################### +BEGIN_SOLUTION +Recall that for hypothesis testing, when our \(P\)-value \(<\alpha\) we reject the null hypothesis in favor of the alternative. When our \(P\)-value \(>\alpha\), we do not reject the null hypothesis. +$PAR +(a) Therefore according to the above convention: $sans[0]. +$PAR +(b) Therefore according to the above convention: $sans[1]. + +END_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SignificanceTesting/kolossa54.pg b/Contrib/PCC/Statistics/SignificanceTesting/kolossa54.pg new file mode 100644 index 0000000000..a7d7bc53df --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/kolossa54.pg @@ -0,0 +1,109 @@ +##DESCRIPTION +## Statistics: Hypothesis testing +##ENDDESCRIPTION + +##KEYWORDS('statistics','hypothesis testing','samples') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Common Large-Sample Tests') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +$n = random(90,130,10); +$n1 = random($n/2+3,$n/2+7,1); +$p = Real($n1/$n); +$q = (1-$p); +$a = random(.01,.05,.04); +$ap = (100*$a); +$tot = (1-$a); +$totp = (100*$tot); +$sd = Real(sqrt(0.25/$n)); +$test = ($p-.5)/(sqrt (.25/$n)); +$z = udistr($a); +$pval = Percent(normal_prob($test,infty)); + +$diagram = DrawNormalDist(99, $test, "", $test, outside=>1); + + +$mc = new_multiple_choice(); + +@ans = ("there is sufficient evidence to conclude that more than half of the surveyed preferred Diet Pepsi over Diet Coke. ", + "There is not sufficient evidence to conclude that more than half of the surveyed preferred Diet Pepsi over Diet Coke. "); + +if ($test > $z ) {$tag = 0;} else {$tag = 1;} + +$mc -> qa('The final conclusion is that', $ans[$tag]); + +$mc -> extra($ans[1-$tag]); + + +BEGIN_TEXT +According to a recent marketing campaign, \($n\) drinkers of either Diet Coke or Diet Pepsi participated in a +blind taste test to see which of the drinks was their favorite. In one Pepsi television commercial, an +announcer states that "in recent blind taste tests, more than one half +of the surveyed preferred Diet Pepsi over Diet Coke." Suppose that out of those \($n\), \($n1\) +preferred Diet Pepsi. Using \(\alpha = $a\) as your benchmark for declaring significance, test the hypothesis that more than half of all participants will select Diet Pepsi in a blind taste test by giving the following: $BR +(a) the \(z\)-score for the sample is \{ans_rule(10)\} $BR +(b) the critical \(z\) score for declaring significant evidence is \{ans_rule(10)\} +$PAR +\{ $mc->print_q() \} +\{ $mc->print_a() \} + +END_TEXT + +ANS(num_cmp($test, tolType=>'absolute', tol=>0.01)); +ANS(num_cmp($z, tolType=>'absolute', tol=>0.01)); +ANS(radio_cmp($mc->correct_ans)); + +################################################# +BEGIN_SOLUTION +(a) Will more than half of all participants select Diet Pepsi as their preference? This tells us we will have a one sided hypothesis test using the \(>\) sign in our alternative hypothesis. Since \($n1\) out of \($n\) people selected Diet Pepsi we know that \(\hat{p} \approx $p\). We want to test if this is evidence that more than half of all participants select Diet Pepsi, which means we will use \(p=0.5\). Thus we can find, \(\operatorname{SD}(\hat{p})=\sqrt{\frac{0.5\cdot 0.5}{$n}} \approx $sd\). +$PAR +Therefore our test statistic is \(z=\frac{$p-0.5}{$sd}\approx$test\). +$PAR +(b) The critical \(z\)-score for declaring significant evidence is the same as saying ''beyond what \(z\)-score do we start rejecting the null hypothesis?'' Since our significance level is \(\alpha = $a\), and the question was if more than half of participants selected Diet Pepsi, this means we want a right-tailed critical \(z\)-score. This mean only \($a\), or, \($ap$PERCENT\) is above the needed critical \(z\)-score. Therefore, we can use the inverse technology command using an area of \($tot\). Recall we do this since our technology only can shade in left and if \($totp$PERCENT\) is below the critical \(z\)-score value in question, only \($ap$PERCENT\) is above it . Thus, we find a critical \(z\)-score of \(z\approx$z\). +$PAR +(c) The final conclusion requires a \(P\)-value. Using technology and our test statistic of \(z\approx$test\), we find a \(P\)-value of \($pval\), also seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +The final conclusion is that: $ans[$tag] +$PAR +This conclusion is always based on the fact that if our \(P\)-value is less than \(\alpha\) we reject the null hypothesis and if our \(P\)-value is great than \(\alpha\) we do not reject the null hypothesis. +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file diff --git a/Contrib/PCC/Statistics/SignificanceTesting/kolossa56.pg b/Contrib/PCC/Statistics/SignificanceTesting/kolossa56.pg new file mode 100644 index 0000000000..ac998114f7 --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/kolossa56.pg @@ -0,0 +1,112 @@ +##DESCRIPTION +## Statistics: Hypothesis testing +##ENDDESCRIPTION + +##KEYWORDS('statistics','hypothesis testing') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Common Large-Sample Tests') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +$n = random(1000, 2000, 5); +$p = random(8,12,1); +$pdec = ($p/100); +$qdec = (1-$pdec); +$sd = Real(sqrt($pdec*$qdec/$n)); +$x = random(int($n*$p/100)-25, int($n*$p/100)-5, 1); +$po = Real($x/$n); +$test = (($po-$pdec)/($sd)); +$alpha = random(0.01, 0.05, 0.04); +$alphap = Percent($alpha); + +$stat = ($x/$n - $p/100)*sqrt($n)/sqrt($p/100*(100-$p)/100); +$crit = udistr(1-$alpha); +$pvalue = 1-uprob($stat); +$pval = Percent(normal_prob(-infty,$test)); + +$diagram = DrawNormalDist($test,-99,$test,"", outside=>1); + +if ( $stat < $crit ) { $tag = 0; } else { $tag = 1; } + +@ans = ("There is sufficient evidence to support the claim that less than \($p$PERCENT\) + of vacations include a theme park visit.", + "There is not sufficient evidence to support the claim that less than \($p$PERCENT\) + of vacations include a theme park visit."); + +$mc = new_multiple_choice(); + +$mc -> qa ( "The conclusion is ", $ans[$tag]); + +$mc -> extra ($ans[1-$tag]); + +BEGIN_TEXT + +A survey of \($n\) people who took vacations revealed that \($x\) of them included +a visit to a theme park. Based on those survey results, a management consultant claims +that less than \($p$PERCENT\) of vacations include a theme park visit. +Test this claim using the \( \alpha = $alpha \) significance level. $BR$BR + +Assuming \(H_0\), the \(z\)-score of the sample is \{ans_rule(30)\} $BR$BR + +The critical \(z\)-score for declaring significant evidence is \{ans_rule(30)\} $BR$BR + +The \(P\)-value of the hypothesis test is \{ans_rule(30)\} $BR$BR + +\{ $mc -> print_q() \} $BR + +\{ $mc -> print_a() \} $BR + +END_TEXT +Context("Percent"); +ANS(Real($stat)->cmp); +ANS(Real($crit)->cmp); +ANS(Percent($pvalue)->cmp); +ANS(radio_cmp($mc->correct_ans)); + +################################################# +BEGIN_SOLUTION +(a) A management consultant claims that less than \($p$PERCENT\) of vacations include a theme park. This means we will have a one sided test with \(<\) in our alternative hypothesis. This also means we know that \(p=$pdec\) and since \($x\) out \($n\) vacations did visit a theme park, \(\hat{p}=$po\). Thus we can find, \(\operatorname{SD}(\hat{p})=\sqrt{\frac{$pdec\cdot $qdec}{$n}} \approx $sd\). +$PAR +Therefore our \(z\)-score is \(z=\frac{$po-$pdec}{$sd}\approx$test\). +$PAR +(b) The critical \(z\)-score for declaring significant evidence is the same as saying ''beyond what \(z\)-score do we start rejecting the null hypothesis?'' Since our significance level is \(\alpha = $alpha\), and the claims was that less than \($p$PERCENT\) of vacations include a theme park, this means we want a left-tailed critical \(z\)-score. This means only \($alpha\), or, \($alphap\) is below the needed critical \(z\)-score. Therefore, we can use the inverse technology command using an area of \($alpha\). Thus, we find \(z\approx$crit\). +$PAR +(c) We require technology to find our \(P\)-value. Using technology and our test statistic of \(z\approx$test\), we find a \(P\)-value of \($pval\), also seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +(d) The final conclusion is that: $ans[$tag] This conclusion is always based on the fact that if our \(P\)-value is less than \(\alpha\) we reject the null hypothesis and if our \(P\)-value is great than \(\alpha\) we do not reject the null hypothesis. +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/SignificanceTesting/kolossa57.pg b/Contrib/PCC/Statistics/SignificanceTesting/kolossa57.pg new file mode 100644 index 0000000000..94c6d26bdc --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/kolossa57.pg @@ -0,0 +1,93 @@ +##DESCRIPTION +## Statistics: Hypothesis testing +##ENDDESCRIPTION + +##KEYWORDS('statistics','hypothesis testing') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Common Large-Sample Tests') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + "PGanswermacros.pl", + "contextPercent.pl", + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGauxiliaryFunctions.pl", + "PGstatisticsmacros.pl", + "PGnumericalmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Percent"); +$n = random(800,1000,10); +$p1 = random(.5,.6,.01); +$a = (100*$p1); +$adec = ($a/100); +$m1 = $p1-.05; +$m2 = $p1-.01; +$p = random($m1,$m2,.01); +$q = (1-$p); +$sd = Real(sqrt(($p*$q)/$n)); +$z = Real(($p1-$p)/$sd); +$pvalue = uprob($z); + +$pvalperc = Percent($pvalue); + +$diagram = DrawNormalDist(99, $z,"",$z, outside=>1); + +BEGIN_TEXT +Physicians at a clinic gave what they thought were drugs to \($n\) patients. Although the doctors later learned that the drugs +were really placebos, \($a$PERCENT\) of the patients reported an improved +condition. Assume that if the placebo is ineffective, the probability of a +patient's condition improving is \($p\). Test the hypothesis that the proportion +of patients improving is greater than \($p\). $BR $BR + +Find the test statistic for the sample: $BR $BR + +\( z =\) \{ans_rule(10)\} $BR $BR + +Find the \(P\)-value of the hypothesis test.$PAR + +\( P =\) \{ans_rule(10)\} +END_TEXT +Context("Percent"); +ANS(Real($z)->cmp); +ANS(Percent($pvalue)->cmp); + +################################################# +BEGIN_SOLUTION +(a) We want to test the hypothesis that the proportion of patients improving is greater \($p\), this also means \(p=$p\). This mean we will use a one sided test with the \(>\) sign in our alternative hypothesis. Of the \($n\) patients, \($a$PERCENT\) reported improvement, this means \(\hat{p}= $adec\). Thus we can find, \(\operatorname{SD}(\hat{p})=\sqrt{\frac{($p)($q)}{$n}} \approx $sd\). +$PAR +Therefore our test statistic is \(z=\frac{$adec-$p}{$sd}\approx$z\). +$PAR +(b) We require technology to find a \(P\)-value. Using technology and our test statistic of \(z\approx$z\), we find a \(P\)-value of \($pvalue\), or, \($pvalperc\), also seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SignificanceTesting/kolossa58.pg b/Contrib/PCC/Statistics/SignificanceTesting/kolossa58.pg new file mode 100644 index 0000000000..cf6602fade --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/kolossa58.pg @@ -0,0 +1,120 @@ +##DESCRIPTION +## Statistics: Hypothesis testing +##ENDDESCRIPTION + +##KEYWORDS('hypothesis testing','population proportion','statistics') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Common Large-Sample Tests') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + "PGanswermacros.pl", + "contextPercent.pl", + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGauxiliaryFunctions.pl", + "PGstatisticsmacros.pl", + "PGnumericalmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +$n = random(1900,2500,100); +$a = random (.01, .05, .04); +$a2 = ($a/2); +$alower = (1-$a); +$alower2 = (1-$a2); +$phat = random(12.5,12.8,.1); +$x = int($n*.116); + +$p = Real($x/$n); +$ph = $phat/100; +$q = 1-$ph; +$sd = Real(sqrt ($ph*$q/$n)); +$z = Real(($p-$ph)/$sd); +$zneg = -$z; +$crit = udistr($a/2); + +$pval = (normal_prob(-infty,$z)); +$pvaltwo = (2*$pval); +$pper = ($pvaltwo*100); + +$diagram = DrawNormalDist($z, $zneg, $z, $zneg, outside=>1); + +if ( $pvaltwo > $a ) { $tag = 0; } else { $tag = 1; } + +@ans = ("There is not sufficient evidence to conclude that the percentage of \(18\text{-}25\)-year-olds who currently use marijuana or hashish has changed from the \(1997\) percentage of \($phat$PERCENT\).", + "There is sufficient evidence to conclude that the percentage of \(18\text{-}25\)-year-olds who currently use marijuana or hashish has changed from the \(1997\) percentage of \($phat$PERCENT\)."); + +$mc3 = new_multiple_choice(); + +$mc3 -> qa ("The conclusion is", $ans[$tag]); + +$mc3 -> extra ($ans[1-$tag]); + +BEGIN_TEXT +A recent poll of \($n\) randomly selected \(18\text{-}25\)-year-olds revealed that \($x\) currently use marijuana or hashish. According to a publication, \($phat$PERCENT\) of \(18\text{-}25\)-year-olds were current users of marijuana or hashish in \(1997\). Do the data provide sufficient evidence to conclude that the percentage of \(18\text{-}25\)-year-olds who currently use marijuana or hashish has changed from the \(1997\) percentage of \($phat$PERCENT\)? Use \(\alpha = $a\) as the level for declaring significance. $PAR + +the sample's test statistic \(z\) is \{ans_rule(10)\} $PAR +the positive critical \(z\) score for declaring significance is \( \ \) \{ans_rule(10)\} $PAR +the negative critical \(z\) score for declaring significance is \( \ \) \{ans_rule(10)\} $BR$BR +\{ $mc3->print_q() \} +$BR +\{ $mc3->print_a() \} + +END_TEXT + +ANS(num_cmp($z, tolType=>'absolute', tol=>0.01)); +ANS(num_cmp($crit, tolType=>'absolute', tol=>.01)); +ANS(num_cmp(-$crit, tolType=>'absolute', tol=>.01)); +ANS(radio_cmp($mc3->correct_ans)); + + +################################################# +BEGIN_SOLUTION +(a) We want to know if the data provides sufficient evidence to conclude that the percentage of \(18\text{-}25\)-year-olds who currently use marijuana or hashish has changed. As there is no mention of greater than or less than, this means we will have a two sided test with \(\neq\) in our alternative hypothesis. As the publication claimed \($phat$PERCENT\) of \(18\text{-}25\)-year-old are current users, we can say \(p=$ph\). Using the recent poll data, we also know \(\hat{p}=$p\). +Thus we can find, \(\operatorname{SD}(\hat{p})=\sqrt{\frac{($ph)($q)}{$n}} \approx $sd\). +$PAR +Therefore our \(z\)-score is \(z=\frac{$p-$ph}{$sd}\approx$z\). +$PAR +(b) The positive critical \(z\)-score for declaring significant evidence is the same as saying ''beyond what \(z\)-score do we start rejecting the null hypothesis?'' Since our significance level is \(\alpha = $a\), we might assume to use the inverse technology command with area \($alower\). But since we have two sided test, half of the \(\alpha\) value is on each side. So, this means we will use area \($alower2\). Thus we find a positive critical \(z\)-score of \($crit\). +$PAR +(c) For the negative critical \(z\)-score, we can use the symmetry of the normal curve to know that it will be the same value from part (b), but negative. Thus, it is \(-$crit\). +$PAR +(d) To conclude we need technology to find our \(p\)-value. Using our test statistic of \(z\approx$z\), we find a \(P\)-value of \($pval\). But we need a two-sided test. Therefore, we need to double our \(P\)-value to obtain a \(p\)-value of \($pvaltwo\), or, \($pper$PERCENT\). The two sided test shading is shown below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +The final conclusion is that: $ans[$tag] +$PAR +This conclusion is always based on the fact that if our \(P\)-value is less than \(\alpha\) we reject the null hypothesis and if our \(P\)-value is great than \(\alpha\) we do not reject the null hypothesis. +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/Contrib/PCC/Statistics/SignificanceTesting/ur_stt_4_10.pg b/Contrib/PCC/Statistics/SignificanceTesting/ur_stt_4_10.pg new file mode 100644 index 0000000000..dbcf24532e --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/ur_stt_4_10.pg @@ -0,0 +1,65 @@ +##DESCRIPTION +##KEYWORDS('statistics','hypothesis testing') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Elements of a Statistical Test') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('10.2') +## Problem1('2') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$truep = random(.41, .7, .01); +$n = random(31,50,1); +$p = $truep+random(.05, .1, .01); +$sigma = sqrt($p*(1-$p)/$n); + +$pcrit = $p-1.6448536*$sigma; + +$sigma1 = sqrt($truep*(1-$truep)/$n); + + +$z = ($pcrit - $truep)/$sigma1; +$ans = uprob($z); + +BEGIN_TEXT + +Assume you are using a significance level of \( \alpha = 0.05 \) to test the claim that +\(p < $p \) and that your sample is a random sample of \( $n \) values. +Find \( \beta \), the probability of making a type II error (failing to reject +a false null hypothesis), given that the population actually has \( p = $truep\).$BR + +\( \beta =\)\{ans_rule(20)\} + + +END_TEXT +Context("Percent"); +ANS(Percent($ans)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/SignificanceTesting/ur_stt_4_4.pg b/Contrib/PCC/Statistics/SignificanceTesting/ur_stt_4_4.pg new file mode 100644 index 0000000000..2b9c5e655b --- /dev/null +++ b/Contrib/PCC/Statistics/SignificanceTesting/ur_stt_4_4.pg @@ -0,0 +1,67 @@ +##DESCRIPTION +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject(Statistics) +## DBchapter(Hypothesis tests) +## DBsection(Concepts) +## Date(6/3/2002) +## MLT(sigvalues) +## Level(1) +## TitleText1('Mathematical Statistics') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## EditionText1('6') +## Section1('10.3') +## Problem1('14') +## KEYWORDS('statistics','hypothesis testing') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +@quest = ('right-tailed','left-tailed'); +$tag = random(0,1,1); +$a = random(0.01,0.10,0.01); +$tot = (1-$a); + +$ans = udistr($a) * (-1)**$tag; + +BEGIN_TEXT + +Find the critical \( z \) value for a $quest[$tag] test using a significance level of +\(\alpha = $a. \) + +\{ans_rule(5)\} + +END_TEXT + +ANS(num_cmp($ans,tol=>0.007)); + +########################################## +BEGIN_SOLUTION +Recall that the critical \(z\)-value for declaring significant evidence is the same as saying ''beyond what \(z\)-score do we start rejecting the null hypothesis?'' For a left side test we use the inverse technology command with the area \($a\). +$PAR +For a right sided test, our technology cannot shade in to the right when finding an inverse, therefore we need to have it shade in \(1-\alpha\), or, in this case, with the area \(1-\alpha=$tot\). +$PAR +Thus, in this situation we have a $quest[$tag] test. With technology, we find a critical \(z\)-value of \($ans\). +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/TypeITypeIIError/ErrorTypes10.pg b/Contrib/PCC/Statistics/TypeITypeIIError/ErrorTypes10.pg new file mode 100644 index 0000000000..146c0feea8 --- /dev/null +++ b/Contrib/PCC/Statistics/TypeITypeIIError/ErrorTypes10.pg @@ -0,0 +1,84 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Hypothesis Testing') + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Type I/Type II Errors') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +#################################################### +DOCUMENT(); + +#################################################### + +loadMacros( +"PGstandard.pl", +"PGchoicemacros.pl", +"PGasu.pl", +"PGML.pl", +"PGcourse.pl", +); + +#################################################### + +TEXT(beginproblem()); + +$mc[0] = new_multiple_choice(); +$mc[0] -> qa('"'."The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean, and the result of the sampling does not lead to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean".'"'." is a", "correct decision"); +$mc[0] -> makeLast("correct decision","Type I error", "Type II error"); + +$mc[1] = new_multiple_choice(); +$mc[1] -> qa('"'."The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean but the result of the sampling leads to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean".'"'." is a", "Type I error"); +$mc[1] -> makeLast("correct decision","Type I error", "Type II error"); + +$mc[2] = new_multiple_choice(); +$mc[2] -> qa('"'."The mean cost to community hospitals per patient per day in Ohio exceeds the national mean but the result of the sampling does not lead to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean".'"'." is a", "Type II error"); +$mc[2] -> makeLast("correct decision","Type I error", "Type II error"); + +$mc[3] = new_multiple_choice(); +$mc[3] -> qa('"'."The mean cost to community hospitals per patient per day in Ohio exceeds the national mean and the result of the sampling leads to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean".'"'." is a", "correct decision"); +$mc[3] -> makeLast("correct decision","Type I error", "Type II error"); + +@slice = NchooseK(4,4); +@smc = @mc[@slice]; + +#################################################### + +BEGIN_PGML +Consider a hypothesis test to decide whether the mean cost to community hospitals per patient per day in Ohio exceeds the national mean. Answer the following questions. + +a) [@$smc[0]-> print_q() @]* +[@ $smc[0]-> print_a() @]* + +a) [@$smc[1]-> print_q() @]* +[@ $smc[1]-> print_a() @]* + +a) [@$smc[2]-> print_q() @]* +[@ $smc[2]-> print_a() @]* + +a) [@$smc[3]-> print_q() @]* +[@ $smc[3]-> print_a() @]* + +END_PGML + +#################################################### + +ANS(radio_cmp($smc[0]->correct_ans)); +ANS(radio_cmp($smc[1]->correct_ans)); +ANS(radio_cmp($smc[2]->correct_ans)); +ANS(radio_cmp($smc[3]->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/TypesOfData/01Stats_04_PictDistnsWGraphs.pg b/Contrib/PCC/Statistics/TypesOfData/01Stats_04_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..d8d36fbc4d --- /dev/null +++ b/Contrib/PCC/Statistics/TypesOfData/01Stats_04_PictDistnsWGraphs.pg @@ -0,0 +1,111 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@event = ("The amount of bacteria on a piece of moldy bread.", + "The marital status of your coworkers.", + "The occupation of your neighbors.", + "The time it takes for your car to get an oil change.", + "How long it takes you to run a mile.", + "The condition of a used car you're thinking about purchasing."); +@ans = ("Quantitative", "Categorical", "Categorical", "Quantitative", "Quantitative", "Categorical"); + +@slice = NchooseK(4,4); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + +for my $i (0..3) +{$popup[$i] = PopUp(["?", "Quantitative", "Categorical"], $sans[$i]);}; + +@solutions = ("The amount of bacteria is a quantity, thus we have quantitative data.", + +"A marital status is really a yes or no question, you are married or you are not. So, with no quantity involved, it is categorical data.", + +"Your neighbors occupation could be anything, a janitor, a mechanic, a banker, etc. Each of these does not involve units or quantities, thus it is categorical.", + +"The number of minutes it takes for something to occur is a quantity. Therefore, it is quantitative data.", + +"The amount of time it takes to run a mile is a quantity, thus it is quantitative.", + +"When buying a car, the we mostly say the condition is poor, normal or good. Each of these are qualities and thus categorical data.", + +); + +@ssols = (@solutions[@slice]); + +###################################### +# Main text + +BEGIN_TEXT +Determine whether the following examples of data are quantitative or categorical. + +$PAR +(a) \( \) $sevent[0] +$BR +\{ $popup[0]->menu() \} + +$PAR +(b) \( \) $sevent[1] +$BR +\{ $popup[1]->menu() \} + +$PAR +(c) \( \) $sevent[2] +$BR +\{ $popup[2]->menu() \} + +$PAR +(d) \( \) $sevent[3] +$BR +\{ $popup[3]->menu() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +for my $i (0..3) +{ANS( $popup[$i]->cmp() );}; + + +#################################### +BEGIN_SOLUTION + +(a) $sans[0] data. $ssols[0] +$PAR +(b) $sans[1] data. $ssols[1] +$PAR +(c) $sans[2] data. $ssols[2] +$PAR +(d) $sans[3] data. $ssols[3] + +END_SOLUTION + +#################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/TypesOfData/DataTypes1.pg b/Contrib/PCC/Statistics/TypesOfData/DataTypes1.pg new file mode 100644 index 0000000000..4b6afed011 --- /dev/null +++ b/Contrib/PCC/Statistics/TypesOfData/DataTypes1.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variable is being studied? Check $BITALIC all$EITALIC that apply.", +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +); + +$mc -> extra( +"Quantitative (aka Interval) $BR", +"Rank (aka Ordinal) $BR", +"Discrete $BR", +"Continuous $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +A polling organization in the state of Oregon asked voters if they considered themselves members of the following political parties: "Democrat", "Republican", "Independent", "Libertarian", "Green", "Constitution", "Working Families", "Peace", or "none of the above". + +$PAR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +Will respondents be giving the pollsters numerical responses? Or will they be responding with a category? +END_HINT + + +Context()->normalStrings; + +############################################## + +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +The correct answer is \{ $mc->correct_ans() \}. Each possible response from an individual is not a number, so this data is not Quantitative or Rank. Discrete data and Continuous data are special cases of Quantitative data, so these are not correct answers either. Categorical and Qualitative mean exactly the same thing, and this data is of those types, since it effectively categorizes each respondent. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/Statistics/TypesOfData/DataTypes2.pg b/Contrib/PCC/Statistics/TypesOfData/DataTypes2.pg new file mode 100644 index 0000000000..c8650f5a60 --- /dev/null +++ b/Contrib/PCC/Statistics/TypesOfData/DataTypes2.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variable is being studied? Check $BITALIC all$EITALIC that apply.", +"Quantitative (aka Interval) $BR", +"Continuous $BR", +); + +$mc -> extra( +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +"Rank (aka Ordinal) $BR", +"Discrete $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +An agricultural research team is administering a fertilizer additive to corn plants in a particular field and later recording how heavy the ears of corn are. + +$PAR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +Is the recorded information for each individual a number or a category? For any given individual, what are the possibilities for a recorded datum? +END_HINT + + +Context()->normalStrings; + +############################################## + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +The correct answer is \{ $mc->correct_ans() \}. Each individual ear of corn will provide a numerical piece of information; its weight. So we have Quantitative data. More specifically, since the possible weights can take values with any number of decimal point precision, we have Continuous quantitative data. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/Statistics/TypesOfData/DataTypes3.pg b/Contrib/PCC/Statistics/TypesOfData/DataTypes3.pg new file mode 100644 index 0000000000..eb4726084d --- /dev/null +++ b/Contrib/PCC/Statistics/TypesOfData/DataTypes3.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variable is being studied? Check $BITALIC all$EITALIC that apply.", +"Rank (aka Ordinal) $BR", +); + +$mc -> extra( +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +"Continuous $BR", +"Quantitative (aka Interval) $BR", +"Discrete $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Patients in an intensive care unit in a hospital are asked to rate the pain that they are feeling on a scale of 1 to 10. + +$PAR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +Is the datum from each individual a number, a category, or somehow both? If it's a number, does arithmetic on data make much sense? +END_HINT + + +Context()->normalStrings; + +############################################## + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +The correct answer is \{ $mc->correct_ans() \}. Each individual is basically declaring themselves to be in one of ten possible categories, but the categories have a natural order: a pain assessment of 2 is more painful than a pain assessment of 1, etc. This means that we might have Quantitative Discrete data, or we might have Rank data. But arithmetic on the data doesn't make much sense. For example, is the difference in pain between a level-9 and level-10 the same as the difference in pain between a level-3 and level-4? Is the pain felt by a level-6 "twice as much" as the pain felt by a level-3? We cannot clearly answer yes to these questions. With arithmetic not really correlating to the values on the pain scale, we do not really have Quantitative data. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/Statistics/TypesOfData/DataTypes4.pg b/Contrib/PCC/Statistics/TypesOfData/DataTypes4.pg new file mode 100644 index 0000000000..3de0be3c85 --- /dev/null +++ b/Contrib/PCC/Statistics/TypesOfData/DataTypes4.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variable is being studied? Check $BITALIC all$EITALIC that apply.", +"Quantitative (aka Interval) $BR", +"Discrete $BR", +); + +$mc -> extra( +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +"Continuous $BR", +"Rank (aka Ordinal) $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +All of the students at Portland Community College are asked to provide their age, in years. + +$PAR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +Is the datum from each individual a number, a category, or somehow both? If it's a number, does arithmetic on data make much sense? +END_HINT + + +Context()->normalStrings; + +############################################## + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +The correct answer is \{ $mc->correct_ans() \}. Each individual is providing a number, so we do not have Qualitative (aka Categorical) data. The values of the data are whole numbers, so the data is not Continuous. And the values of the data really do correlate well to what is being measured: a 50-year-old really does have twice the age of a 25-year-old; the difference in age between a 28-year-old and a 32-year-old is the same as between a 38-year-old and a 42-year-old. So we do not have Rank data. We have Quantitative Discrete data. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/Statistics/TypesOfData/DataTypes5.pg b/Contrib/PCC/Statistics/TypesOfData/DataTypes5.pg new file mode 100644 index 0000000000..8262b8d43e --- /dev/null +++ b/Contrib/PCC/Statistics/TypesOfData/DataTypes5.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mcIndividuals = new_checkbox_multiple_choice(); + +$mcIndividuals -> qa ( +"What or who are the individuals being studied in this situation?", +"Periods of time between fillings at the gas station$BR", +); + +$mcIndividuals -> extra( +"Alex and the attendants who work at the gas station$BR", +"Cars that Alex owns/drives$BR", +"Readings from the gas pump and the car's trip meter$BR", +"Gas mileages, as computed by finding \(\frac{\mbox{miles traveled}}{\mbox{gallons used}}\)$BR", +); + +$mcIndividuals -> makeLast("None of the above"); + + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variables are being studied? Check all that apply.", +"Quantitative (aka Interval) $BR", +"Continuous $BR", +); + +$mc -> extra( +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +"Discrete $BR", +"Rank (aka Ordinal) $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Alex has been wondering how good the gas mileage is for his car. When he goes to the gas station, he writes down the number of miles in his trip meter, fills the tank, and writes down the number of gallons of gas to fill the tank. Then he resets the trip meter. + +$PAR +\{ $mcIndividuals -> print_q() \} +$BBLOCKQUOTE +\{ $mcIndividuals -> print_a() \} +$EBLOCKQUOTE + +$BR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +First ask what is being recorded: a number of miles driven, and a number of gallons of gas used. Each time those things are recorded, who or what are they describing? For example, would \(315\) miles and \(15\) gallons describe Alex or one of the attendants? Clearly not. +END_HINT + + +Context()->normalStrings; + +############################################## + +ANS( checkbox_cmp( $mcIndividuals->correct_ans() ) ); +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +Each time data is recorded here, it is a number that could take high decimal precision. So we have Continuous Quantitative data. And each time we record this data, we are describing a period of time between trips to the gas station. So the answer to the first question is \{ $mcIndividuals->correct_ans() \}, and to the second is \{ $mc->correct_ans() \}. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/Statistics/TypesOfData/DataTypes6.pg b/Contrib/PCC/Statistics/TypesOfData/DataTypes6.pg new file mode 100644 index 0000000000..e73e6728f4 --- /dev/null +++ b/Contrib/PCC/Statistics/TypesOfData/DataTypes6.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mcIndividuals = new_checkbox_multiple_choice(); + +$mcIndividuals -> qa ( +"What or who are the individuals being studied in this situation?", +"US households$BR", +); + +$mcIndividuals -> extra( +"People living in the US$BR", +"Three individuals: Houses as a group; apartments as a group; mobiles homes as a group$BR", +"Four individuals: Homes owned with a mortgage; homes owned without a mortgage; homes rented; homes occupied with no rent$BR", +"The US Census Bureau$BR", +); + +$mcIndividuals -> makeLast("None of the above"); + + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variables are being studied? Check $BITALIC all$EITALIC that apply.", +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +); + +$mc -> extra( +"Quantitative (aka Interval)$BR", +"Continuous $BR", +"Discrete $BR", +"Rank (aka Ordinal) $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +The US Census Bureau conducted its 2010 survey and among the questions that were sent to US households was "Is this house, apartment, or mobile home: owned with mortgage, owned without mortgage, rented, or occupied without rent?" + +$PAR +\{ $mcIndividuals -> print_q() \} +$BBLOCKQUOTE +\{ $mcIndividuals -> print_a() \} +$EBLOCKQUOTE + +$BR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +First ask what is being recorded: a home ownership/rentership status. Each time this thing is recorded, who or what is it describing? +END_HINT + + +Context()->normalStrings; + +############################################## + +ANS( checkbox_cmp( $mcIndividuals->correct_ans() ) ); +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +Each time data is recorded here, it is a ownership/rentership status, and not numerical at all. So we have Categorical data, aka Qualitative data. And each time we record this data, we are describing a household, not the individuals in that household or any of the other options presented. So the answer to the first question is \{ $mcIndividuals->correct_ans() \}, and to the second is \{ $mc->correct_ans() \}. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/Contrib/PCC/Statistics/TypesOfData/stat212-HW01-02.pg b/Contrib/PCC/Statistics/TypesOfData/stat212-HW01-02.pg new file mode 100644 index 0000000000..9d83950971 --- /dev/null +++ b/Contrib/PCC/Statistics/TypesOfData/stat212-HW01-02.pg @@ -0,0 +1,149 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## NAW tagged this problem. + +## DBsubject(Statistics) +## DBchapter(Exploratory data analysis/descriptive statistics) +## DBsection(Classifying data) +## Date(5/26/2005) +## Institution(UVA) +## Author(Nolan A. Wages) +## Level(3) +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('.') +## Problem1('') +## KEYWORDS('statistics', 'descriptive statistics', 'variable', 'quantitative') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('Quantitative Data: ', + 'are always numeric' +); +$mc[1]->extra( + 'are always nonnumeric', + 'may be either numeric or nonnumeric' +); +$mc[1]->makeLast( + 'None of the above answers is correct' +); + + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('In a questionnaire, respondents are asked to mark their gender as male or female. +Gender is an example of a: ', + 'qualitative variable' +); +$mc[2]->extra( + 'quantitative variable', + 'qualitative or quantitative variable, depending on how the respondents answered the question' + ); +$mc[2]->makeLast( + 'None of the above answers is correct' +); + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('Qualitative data: ', + 'are labels used to identify attributes of elements' +); +$mc[3]->extra( + 'indicate either how much or how many', + 'cannot be numeric', + 'must be nonnumeric' +); + + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('Qualitative data: ', + 'may be either numeric or nonnumeric' +); +$mc[4]->extra( + 'must be numeric', + 'must be nonnumeric', + 'cannot be numeric' +); + + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('Ordinary arithmetic operations are meaningful: ', + 'only with quantitative data' +); +$mc[5]->extra( + 'only with qualitative data', + 'either with quantitative or qualitative data' +); +$mc[5]->makeLast( + 'None of the above answers is correct' +); + + +$a = random(1,5,1); +$b = random(1,5,1); +while ($a == $b) { + $b = random(1,5,1); +} + +@solutions = ("Quantitative data is always numeric, since it always refers to a quantity with units, it must be numeric..", + +"Gender is an example of categorical data. Gender does not have a unit or quantity associated with it, only a ''type,'' thus it is categorical data.", + +"Qualitative data identifies attributes, such as hair color, method of transportation, etc.", + +"Qualitative data can be numeric or non-numeric. Your relationship status, single, married, dating, etc, is non-numeric. The area code of your cellular phone or home phone is numeric, but still qualitative. It does not measure anything, it is simply a code for where you live, which is an attribute, not a quantity.", + +"Arithmetic operations, such as addition, subtraction, etc, are only meaningful for quantitative data. For example, \(10$DOLLARS + 15$DOLLARS = 25$DOLLARS\). Blue eyes plus brown eyes is meaningless.", + +); + +$ssols1 = (@solutions[$a-1]); +$ssols2 = (@solutions[$b-1]); + +################################## +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +#################################### +BEGIN_SOLUTION + +(a) Option \{$mc[$a]->correct_ans\}. $ssols1 +$PAR +(b) Option \{$mc[$b]->correct_ans\}. $ssols2 +$PAR + +END_SOLUTION + +#################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_04_NormalDist.pg b/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_04_NormalDist.pg new file mode 100644 index 0000000000..1ac93ce53d --- /dev/null +++ b/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_04_NormalDist.pg @@ -0,0 +1,110 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + "parserNumberWithUnits.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@question = ("About what percent of men are taller than \(74\) inches?", + "About what percent of men are shorter than \(66.5\) inches?", + "About what percent of men are taller than \(69\) inches?", + "About what percent of men are between \(69\) and \(74\) inches?", + "About what percent of men are between \(64\) and \(66.5\) inches?", + "Fill in the blank: About \(2.5\) percent of all men are shorter than $US$US$US$US$US$US$US."); + +Context("Percent"); +@percents = (Percent("2.5 %"), Percent("16 %"), Percent("50 %"), Percent("47.5 %"), Percent("13.5 %")); + +Context("Numeric"); +@inches = NumberWithUnits("64 in"); + +@ans = (@percents, @inches); + +@solutions = ("A height of \(74\) inches corresponds to a \(z\)-score of \(z=\frac{74 - 69}{2.5} = 2\). According to the Empirical Rule, \(95$PERCENT\) of individuals fall within \(2\) standard deviations of the mean. So \(2.5$PERCENT\) of individuals fall above a \(z\)-score of \(2\). So \(2.5$PERCENT\) of men are taller than \(74\) inches", + +"A height of \(66.5\) inches corresponds to a \(z\)-score of \(z=\frac{66.5 - 69}{2.5} = -1\). According to the Empirical Rule, \(68$PERCENT\) of individuals fall within \(1\) standard deviation of the mean. So \(16$PERCENT\) of individuals fall below a \(z\)-score of \(-1\). So \(16$PERCENT\) of men are taller than \(66.5\) inches", + +"A height of \(69\) inches corresponds to a \(z\)-score of \(z=\frac{69 - 69}{2.5} = 0\). The center of the normal curve has a \(z\)-score of \(0\) with half of all individuals above and the other half below the center. So, \(50$PERCENT\) of individuals fall above a \(z\)-score of \(0\). So \(50$PERCENT\) of men are taller than \(69\) inches", + +"A height of \(69\) inches corresponds to a \(z\)-score of \(z=\frac{69 - 69}{2.5} = 0\) and \(74\) inches corresponds to a \(z\)-score of \(\frac{74 - 69}{2.5} = 2\). According to the Empirical Rule, \(95$PERCENT\) of individuals fall within \(2\) standard deviations of the mean. So half of this falls between a \(z\)-score of \(0\) and a \(z\)-score of \(2\). So, \(42.5$PERCENT\) of men are between \(69\) inches and \(74\) inches.", + +"A height of \(64\) inches corresponds to a \(z\)-score \(z=\frac{64 - 69}{2.5} = -2\) of and \(74\) inches corresponds to a \(z\)-score of \(\frac{66.5 - 69}{2.5} = -1\). According to the Empirical Rule, \(68$PERCENT\) of individuals fall within \(1\) standard deviation of the mean and \(95$PERCENT\) of individuals fall within \(2\) standard deviations from the mean. As such, to find the total percentage between \(-1\) and \(-2\) standard deviations from we the mean, we take \(95$PERCENT - 68$PERCENT = 27$PERCENT\), but this also counts the individuals between \(z=1\) and \(z=2\). So half of \(27$PERCENT\), or \(13.5$PERCENT\) of men are between \(64\) inches and \(66.5\) inches.", + +"This question will require we find a height, in inches. We know \(2.5$PERCENT\) of men are shorter than a particular height. Each height has a \(z\)-score, therefore we can find a \(z\)-score for this height. According to the Empirical Rule, a \(z\)-score of of \(-2\) corresponds to a value such that \(2.5$PERCENT\) of all individuals are shorter than this height. Thus, \(-2 = \frac{x-69}{2.5}\), which can be solved to reveal that \(x = 64\). Therefore \(2.5$PERCENT\) of men are shorter than \(64\) inches.", +); + +@slice = NchooseK(6,3); +@squestion = (@question[@slice]); +@sans = (@ans[@slice]); +@ssols = (@solutions[@slice]); +################################################# +# Main + +BEGIN_TEXT +The distribution of heights of adult men in the U.S. is approximately Normal with mean \(69\) inches and standard deviation \(2.5\) inches. Use what you know about a Normal distribution and the $BITALIC \(68\)-\(95\)-\(99.7\) rule$EITALIC to answer the following. +$PAR + +(a) $squestion[0] +$BR + \{ans_rule(20)\} + +$PAR +(b) $squestion[1] +$BR + \{ans_rule(20)\} + +$PAR +(c) $squestion[2] +$BR + \{ans_rule(20)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +ANS($sans[0]->cmp); +ANS($sans[1]->cmp); +ANS($sans[2]->cmp); + +###################################### + +BEGIN_SOLUTION + +(a) $ssols[0] + +$PAR +(b) $ssols[1] + +$PAR +(c) $ssols[2] + + + +END_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_05_NormalDist.pg b/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_05_NormalDist.pg new file mode 100644 index 0000000000..73c20f60d7 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_05_NormalDist.pg @@ -0,0 +1,81 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGstatisticsmacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + + +@Name = (Mary, Ted, Mike, Nick, Pam, Sam, Kate, John, Greg, Joe); +$tag = random(0,9,1); +$score = 100 + 3* ($tag + 1); + +$diff = Compute($score - 100); +$zscore = Compute($diff / 15); + +@solutions = ("The difference between $Name[$tag]'s IQ and the mean is \(121 - 100 = 21\)", + +"The \(z\)-score for $Name[$tag]'s IQ is \(z = \frac{121 - 100}{15} = 1.4\)",) +; + +@ssols = (@solutions); + +################################################# +# Main + +BEGIN_TEXT +IQ scores have a mean of \(100\) and a standard deviation of \(15\). $Name[$tag] has an IQ of \($score\). + +$PAR +(a) What is the difference between $Name[$tag]'s IQ and the mean? +$BR +\{ ans_rule(10) \} + +$PAR +(b) Convert $Name[$tag]'s IQ score to a \(z\)-score. +$BR +\{ ans_rule(10) \} +END_TEXT + +###################################### + +BEGIN_SOLUTION + +(a) $ssols[0] + +$PAR + +(b) $ssols[1] + +$PAR + +END_SOLUTION + +# Answers + +$showPartialCorrectAnswers = 1; + +ANS($diff->cmp); +ANS($zscore->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_06_NormalDist.pg b/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_06_NormalDist.pg new file mode 100644 index 0000000000..d92ed75c97 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_06_NormalDist.pg @@ -0,0 +1,92 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +$w = random(56,77,1); +$m = random(60,84,1); +$zw = ($w - 64) / 2.7; +$zm = ($m - 69.3) / 2.8; +$zm = Real($zm); +$zw = Real($zw); +@solutions = ("Using the \(z\)-score formula with regards to the data for women, we find, \(z_{$w} = \frac{$w - 64}{2.7} = $zw\).", + +"Again using the \(z\)-score formula with regards to the data for men, we find, \(z_{$m} = \frac{$m - 69.3}{2.8} = $zm\)",) +; + +@ssols = (@solutions); + +################################################# +# Main + +BEGIN_TEXT +The heights of women aged \(20\) to \(29\) are approximately Normal with mean \(64\) inches and standard deviation \(2.7\) inches. Men the same age have mean height \(69.3\) inches with standard deviation \(2.8\) inches. +$PAR +(a) What is the \(z\)-score for a woman \($w\) inches tall? +$BR \(z_{$w}\) = \{ans_rule(4)\} +$PAR +(b) What is the \(z\)-score for a man \($m\) inches tall? +$BR \(z_{$m}\) = \{ans_rule(4)\} + +END_TEXT + +################################################# + +###################################### + +BEGIN_SOLUTION + +(a) $ssols[0] + +$PAR + +(b) $ssols[1] + +$PAR + +END_SOLUTION + + +# Answers + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(tolerance=>0.005, tolType=>'absolute'); + +$ans_a = Compute(($w-64)/2.7); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01; + } => ["Your answer is close. Try the calculation using more accuracy."]))); + +$ans_b = Compute(($m-69.30)/2.8); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01; + } => ["Close! Try redoing the calculation using more accuracy."]))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_07_NormalDist.pg b/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_07_NormalDist.pg new file mode 100644 index 0000000000..35c5f7b9ad --- /dev/null +++ b/Contrib/PCC/Statistics/zScoreEmpiricalRule/03Stats_07_NormalDist.pg @@ -0,0 +1,132 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "parserPopUp.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@Name = ('Ted', 'Nick', 'Mike', 'Kary', 'Mary', 'Fred', 'Sam', 'Pam', 'Joe', 'John', + 'Joan', 'Lisa', 'Kate'); +$tag = random(0,12,1); + +@sub = ('Calculus', 'Biology', 'Spanish', 'History', 'Physics'); +@slice = NchooseK(5,5); +@ssub = @sub[@slice]; + +@mean = (70, 77, 44, 53, 60, 69); +@smean = @mean[@slice]; + +@dev = (12, 10, 12, 16, 14, 8); +@sdev = @dev[@slice]; + +@z = (-1, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2); +@zslice = NchooseK(13,13); +@sz = @z[@zslice]; + +$grade1 = $smean[1] + $sdev[1] * $sz[1]; +$grade2 = $smean[2] + $sdev[2] * $sz[2]; +$grade3 = $smean[3] + $sdev[3] * $sz[3]; +$grade4 = $smean[4] + $sdev[4] * $sz[4]; + +$best = 1; +if ($sz[2] > $sz[1]) { $best = 2;} +if ($sz[3] > $sz[$best]) { $best = 3;} +if ($sz[4] > $sz[$best]) { $best = 4;} + +$popup = PopUp(["?", @ssub], $ssub[$best]); + + +@solutions = ("Using the \(z\)-score formula with regards to the data for $ssub[1], we find, \(z_{$ssub[1]} = \frac{$grade1 - $smean[1]}{$sdev[1]} = $sz[1]\).", + +"Using the \(z\)-score formula with regards to the data for $ssub[2], we find, \(z_{$ssub[2]} = \frac{$grade2 - $smean[2]}{$sdev[2]} = $sz[2]\).", + +"Using the \(z\)-score formula with regards to the data for $ssub[3], we find, \(z_{$ssub[3]} = \frac{$grade3 - $smean[3]}{$sdev[3]} = $sz[3]\).", + +"Using the \(z\)-score formula with regards to the data for $ssub[4], we find, \(z_{$ssub[4]} = \frac{$grade4 - $smean[4]}{$sdev[4]} = $sz[4]\).",) +; + +@ssols = (@solutions); + +################################################# +# Main + +BEGIN_TEXT +$Name[$tag] took \(4\) courses last semester: $ssub[1], $ssub[2], $ssub[3], and $ssub[4]. +The means and standard deviations for the final exams, and $Name[$tag]'s scores are given +in the table below. Convert $Name[$tag]'s scores into \(z\)-scores. +$PAR + +\{begintable(5)\} +\{row('Subject','Mean','Stand. dev.',"$Name[$tag]'s score", "$Name[$tag]'s \(z\)-score")\} +\{row($ssub[1], $smean[1], $sdev[1], $grade1, ans_rule(10))\} +\{row($ssub[2], $smean[2], $sdev[2], $grade2, ans_rule(10))\} +\{row($ssub[3], $smean[3], $sdev[3], $grade3, ans_rule(10))\} +\{row($ssub[4], $smean[4], $sdev[4], $grade4, ans_rule(10))\} +\{endtable()\} + +$BR +On what exam did $Name[$tag] have the highest score relative to other exam takers? \{ $popup->menu() \} +END_TEXT + +###################################### +BEGIN_SOLUTION + +Recall that all classes in which Joe has taken an exam will have their own \(z\)-score. As such, we will find \(z_{$ssub[1]}\), \(z_{$ssub[2]}\), \(z_{$ssub[3]}\), \(z_{$ssub[4]}\) + +$PAR + +(a) $ssols[0] + +$PAR + +(b) $ssols[1] + +$PAR + +(c) $ssols[2] + +$PAR + +(d) $ssols[3] + +$PAR + +(e) Knowing the highest score relative to other exam takers would entail finding the highest positive \(z\)-score. In this case, it $sz[$best], which is his $ssub[$best] class. + +END_SOLUTION + +# +# Answers + +$showPartialCorrectAnswers = 1; + +Context()->strings->add("Calculus"=>{}, "Biology"=>{}, "Spanish"=>{}, "History"=>{}, "Physics"=>{}); + +ANS(Real($sz[1])->cmp); +ANS(Real($sz[2])->cmp); +ANS(Real($sz[3])->cmp); +ANS(Real($sz[4])->cmp); +ANS($popup->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoreEmpiricalRule/empirical_rule1.pg b/Contrib/PCC/Statistics/zScoreEmpiricalRule/empirical_rule1.pg new file mode 100644 index 0000000000..28222734dc --- /dev/null +++ b/Contrib/PCC/Statistics/zScoreEmpiricalRule/empirical_rule1.pg @@ -0,0 +1,67 @@ +##DESCRIPTION +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('empirical rule') +## Author('N.Spencer Sitton; Modified slightly by John Hagood') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/05/05; 07/28/10 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "MathObjects.pl", +); + + +TEXT( &beginproblem ); + +do{$mean = random(150, 600, 1); + $sd = random( 30, 100, 1); +} until( $mean - 3 * $sd > 0); +@per = ( 68, 95, 99.7 ); +$ind = random( 0, 2, 1 ); +$ans1 = $mean - ( $ind + 1 ) * $sd; +$ans2 = $mean + ( $ind + 1 ) * $sd; + +$realind1 = $ind +1; +$realind2 = $ind -1; +@solutions = ("The Empirical Rule tells us that \($per[$ind]$PERCENT\) of all observations fall between \($realind1\) and \($realind2\) standard deviations from the mean. As such, the integer value for \(z = $realind1\) is \($realind1 = \frac{x-$mean}{$sd}\). This can be solved to find \(x = $ans2\). Similarly, the integer value for \(z = $realind2\) is \($realind2 = \frac{x-$mean}{$sd}\). This can be solved to find \(x = $ans1\).", + +"Therefore, \($per[$ind]$PERCENT\) of the exam scores lie between \($ans1\) and \($ans2\).",) + +; + +@ssols = (@solutions); + +BEGIN_TEXT + +Suppose the scores of students on an exam are normally distributed with a mean of \($mean\) and a standard +deviation of \($sd\). Then approximately \($per[$ind]$PERCENT\) of the exam scores lie between the integers +\{ ans_rule( 15 ) \} and \{ ans_rule( 15 ) \} such that the mean is halfway between these two integers. + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +$ssols[0] + +$PAR + +$ssols[1] + +END_SOLUTION + +###################################### + +ANS(Compute( $ans1 )->cmp ); +ANS(Compute( $ans2 )->cmp ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/zScoreEmpiricalRule/empirical_rule2.pg b/Contrib/PCC/Statistics/zScoreEmpiricalRule/empirical_rule2.pg new file mode 100644 index 0000000000..46d1216e72 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoreEmpiricalRule/empirical_rule2.pg @@ -0,0 +1,66 @@ +##DESCRIPTION +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('empirical rule') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/05/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "MathObjects.pl", + "contextPercent.pl", + +); + +TEXT( &beginproblem ); + +do{$mean = random(150, 600, 1); + $sd = random( 30, 100, 1); + } until( $mean - 3 * $sd > 0 ); + +$ind = random( 0, 2, 1 ); +$indsol = ( $ind +1 ); +$lscore = $mean - ( $ind + 1 ) * $sd; +$hscore = $mean + ( $ind + 1 ) * $sd; +@ans = ( 68, 95, 99.7 ); +Context("Percent"); +$ans1 = Percent("$ans[$ind] %"); +$lz = ($lscore - $mean) / $sd; +$hz = ($hscore - $mean) / $sd; + +@solutions = ("Using the \(z\)-score formula, we can find \(z_{low score} = \frac{$lscore - $mean}{$sd} = $lz\) and \(z_{high score} = \frac{$hscore - $mean}{$sd} = $hz\). As both \(z\)-scores are \($indsol\) from the mean, we know that \($ans1\) of students scored between \($lscore\) and \($hscore\) points.",) +; + +@ssols = (@solutions); + +BEGIN_TEXT + +Suppose the scores of students on an exam are Normally distributed with a mean +of \($mean\) and a standard deviation of \($sd\). According to the empirical rule, what percentage of students scored between \($lscore\) and \($hscore\) on the exam? $PAR + \{ ans_rule( 15 ) \} of students scored between \($lscore\) and \($hscore\) on the exam. + +END_TEXT + +###################################### +BEGIN_SOLUTION + +Recall that according to Empirical Rule, approximately \(68%\) of observations fall within \(1\) deviation from the mean, \(95%\) of observations fall within \(2\) deviation from the mean and \(99.7%\) of observations fall within \(3\) deviation from the mean. + +$PAR + +$ssols[0] + + +END_SOLUTION + +ANS( $ans1->cmp ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/zScoreEmpiricalRule/gust33.pg b/Contrib/PCC/Statistics/zScoreEmpiricalRule/gust33.pg new file mode 100644 index 0000000000..3796f9aa4a --- /dev/null +++ b/Contrib/PCC/Statistics/zScoreEmpiricalRule/gust33.pg @@ -0,0 +1,61 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Which of the following Normal distributions has the widest spread?", +"A Normal distribution with mean \(1\) and standard deviation \(3\)"); +$mc->extra("A Normal distribution with mean \(0\) and standard deviation \(2\)", "A Normal distribution with mean \(2\) and standard deviation \(1\)", "A Normal distribution with mean \(3\) and standard deviation \(2\)"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +Recall that spread helps us think about how far each data value is from the mean. As we are working with Normal distributions, the widest spread will have the largest standard deviation. Therefore, the distribution with standard deviation \(3\) has the widest spread. + +END_SOLUTION + +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoreEmpiricalRule/gust34.pg b/Contrib/PCC/Statistics/zScoreEmpiricalRule/gust34.pg new file mode 100644 index 0000000000..eea3a648c6 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoreEmpiricalRule/gust34.pg @@ -0,0 +1,95 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$mu1 = random(-5,5,1); +$mu2 = $mu1 + non_zero_random(-3,3,1); + +$sigma1 = random(2,5,1); +$sigma2 = $sigma1+list_random(0,0,-1,1); + +$ans1 = ($mu1 == $mu2) ? "True" : "False"; +$ans2 = ($sigma1 == $sigma2) ? "True" : "False"; + +$sol1 = ($sigma1 == $sigma2) ? "True, since the standard deviations are equal, the spreads are the same." : "False, since the standard deviations are not equal, the spreads are not the same."; +$sol2 = ($mu1 == $mu2) ? "True, since the means are equal, the distributions are centered at the same place." : "False, since the means are not equal, the distributions are not centered at the same place."; +$sol3 = "True, all Normal distributions have the same shape. They be centered at different places and have different spreads but the shape is the same."; + +$popup1 = PopUp(["?", "True", "False"], $ans1); +$popup2 = PopUp(["?", "True", "False"], $ans2); +$popup3 = PopUp(["?", "True", "False"], "True"); + +BEGIN_TEXT + +Consider two Normal distributions, one with mean \($mu1\) and standard deviation \($sigma1\), the other with mean \($mu2\) and standard deviation \($sigma2\). + +$PAR +a) The two distributions have the same spread. $BR +True or False? \{ $popup2->menu() \} $PAR + +b) The two distributions are centered at the same place. $BR +True or False? \{ $popup1->menu() \} $PAR + +c) The two distributions have the same shape. $BR +True or False? \{ $popup3->menu() \} $PAR + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +(a) $sol1 + +$PAR + +(b) $sol2 + +$PAR + +(c) $sol3 + +END_SOLUTION + + +ANS( $popup2->cmp() ); +ANS( $popup1->cmp() ); +ANS( $popup3->cmp() ); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoreEmpiricalRule/gust36.pg b/Contrib/PCC/Statistics/zScoreEmpiricalRule/gust36.pg new file mode 100644 index 0000000000..dc23479b08 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoreEmpiricalRule/gust36.pg @@ -0,0 +1,62 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("What are the parameters for a Normal curve?", "the population mean and population standard deviation"); +$mc->extra("the sample mean and sample standard deviation", "the population mean and population variance", "the population median and population standard deviation"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +D. Parameters for the normal curve correspond to the population mean and population standard deviation. + +END_SOLUTION + +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoreEmpiricalRule/kolossa20.pg b/Contrib/PCC/Statistics/zScoreEmpiricalRule/kolossa20.pg new file mode 100644 index 0000000000..e7b44b21d3 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoreEmpiricalRule/kolossa20.pg @@ -0,0 +1,98 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('statistics', 'introduction','normal distribution') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mc = new_multiple_choice(); + +$mc->qa("A standardized variable always has", +"mean \(0\) and standard deviation \(1\)"); +$mc->extra(" changing mean and standard deviation \(1\)", "mean \(0\) and changing standard deviation"); +$mc->makeLast(" changing mean and changing standard deviation"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +$mc = new_multiple_choice(); + +$mc->qa("The \(z\)-score corresponding to an observed value of a variable tells you the number of standard deviations that the observation is from the mean", +"True"); +$mc->makeLast("False"); + +BEGIN_TEXT +$BR$HR$BR +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +$mc = new_multiple_choice(); + +$mc->qa("A positive \(z\)-score indicates that the observation is", +"above the mean"); +$mc->makeLast("below the mean"); + +BEGIN_TEXT +$BR$HR$BR +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +(a) Option \(C\). When not standardized, values for mean and standard deviation can always vary. However, when working with a Normal distribution, all standardized variables have a mean of \(0\) and a standard deviation of \(1\). + +$PAR + +(b) Option \(A\). The definition of a \(z\)-score is the number of standard deviations that the observation is from the mean. + +$PAR + +(c) Option \(A\). When working with Normal distributions and \(z\)-scores, any observation above the mean will be seen as a "positive" deviation and thus have a positive \(z\)-score. + +END_SOLUTION + + +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoreEmpiricalRule/normprob6.pg b/Contrib/PCC/Statistics/zScoreEmpiricalRule/normprob6.pg new file mode 100644 index 0000000000..3d808aef64 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoreEmpiricalRule/normprob6.pg @@ -0,0 +1,109 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/5/05 +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGcommonFunctions.pl", +"PGstandard.pl", +"PGnauBinpacking.pl", +"unionMacros.pl", +"unionTables.pl", +"parserPopUp.pl", +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; + +$z1 = 0; +$z2 = 0; +$z3 = 0; +while (($z1-$z2)*($z2-z3)*($z3-$z1) == 0) +{$mu1 = random(50,100,1); +$mu2 = random(50,100,1); +$mu3 = random(50,100,1); + +$sig1 = random(5,20,1); +$sig2 = random(5,20,1); +$sig3 = random(5,20,1); + +$score1 = random(50,100,1); +$score2 = random(50,100,1); +$score3 = random(50,100,1); + +$z1 = ($score1-$mu1)/$sig1; +$z2 = ($score2-$mu2)/$sig2; +$z3 = ($score3-$mu3)/$sig3; +$realz1 = Real($z1); +$realz2 = Real($z2); +$realz3 = Real($z3); +@scores = ($z1,$z2,$z3);} + +$best = max(@scores); +if ($z1 == $best) {$ind = 0;} +if ($z2 == $best) {$ind = 1;} +if ($z3 == $best) {$ind = 2;} + +@names =("Colleen","Terresa","Mary"); +$ans = $names[$ind]; + +$popup = PopUp(["?", @names], $ans); + +BEGIN_TEXT +Colleen, Teresa, and Mary are vying for a position as an administrator. Applicants must take an exam for this position. For the sake of the integrity of the exam, it is altered after each time it is given. Colleen, who is tested with group I, gets a score of \($score1\) on her test; Teresa, who is tested with group II, gets a score of \($score2\); and Mary, who is tested with group III, +gets a score of \($score3\). If the average score for group I is \($mu1\), for group II is \($mu2\), and for group III is \($mu3\), and if the standard deviations for each of the groups are \($sig1\), \($sig2\), and \($sig3\) respectively, which person has the highest relative standing? + +$PAR +\{ $popup->menu() \} has the highest relative standing. + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +As we are interested in the highest relative standing in terms of test scores, we need to find the \(z\)-score for all three candidates and see who has the highest. + +$PAR + +\(z_{Colleen} = \frac{$score1 - $mu1}{$sig1} = $realz1\) + +$PAR + +\(z_{Teresa} = \frac{$score2 - $mu2}{$sig2} = $realz2\) + +$PAR + +\(z_{Mary} = \frac{$score3 - $mu3}{$sig3} = $realz3\) + +$PAR + +As the \(z\)-score of \($best\) belongs $ans, $ans has the highest relative standing for all the test takers. + +END_SOLUTION + + +ANS($popup->cmp()); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_02_NormalDist.pg b/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_02_NormalDist.pg new file mode 100644 index 0000000000..f347bd9410 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_02_NormalDist.pg @@ -0,0 +1,123 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("Which of these variables is least likely to have a Normal distribution? ", + "Income per person for \(150\) different countries. "); + $mc[0]->extra("Lengths of \(50\) newly hatched pythons. ", + "Heights of \(100\) white pine trees in a forest. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("To completely specify the shape of a Normal distribution, you usually give ", + "the mean and the standard deviation. "); + $mc[1]->extra("the five-number summary. ", + "the mean and the median. ", + "the median and the standard deviation. "); + $mc[1]->makeLast("All of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("The length of human pregnancies from conception to birth varies according to a distribution that is approximately Normal with mean \(266\) days and standard deviation \(16\) days. About \(95$PERCENT\) of all pregnancies last between ", + " \(234\) and \(298\) days. "); + $mc[2]->extra(" \(250\) and \(282\) days. ", + " \(218\) and \(314\) days. ", + " \(260\) and \(320\) days. "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("The scores of adults on an IQ test is approximately Normal with mean \(100\) and standard deviation \(15\). Corinne scores \(118\) on such test. Her \(z\)-score is about ", + " \(1.2\)"); + $mc[3]->extra(" \(7.87\) ", + " \(18\)", + " \(0.67\) "); + $mc[3]->makeLast("None of the above. "); + +@solutions = ("Distributions of income are generally skewed, making it the least likely to have a Normal distribution.", + +"To completely specify the shape of a Normal distribution, you usually give the mean and the standard deviation.", + +"We know \(95$PERCENT\) of observations are within \(2\) standard deviation of the mean. This would correspond to \(32\) days above and below the mean, or, between \(234\) and \(298\) days.", + +"Her \(z\)-score would be \(z = \frac{118-100}{15} = 1.2\).",) +; +@ssols = (@solutions[@order]); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) $ssols[0] + +$PAR + +(b) $ssols[1] + + +$PAR + +(c) $ssols[2] + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_09_NormalDist.pg b/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_09_NormalDist.pg new file mode 100644 index 0000000000..9ed98013bd --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_09_NormalDist.pg @@ -0,0 +1,96 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGnumericalmacros.pl", #NOTE: Needed for normal_distr() function + "PGstatisticsmacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@p=(.0125, .0505, .0901, .1151, .1515, .1401, .1841, .0209, .0281, .0409) ; +$choose = random(0,9,1); + +$pval1 = $p[$choose]; +$pval2 = random(0.0019,0.4602,0.0001); +$showpval1 = $pval1 * 100; +$showpval2 = $pval2 * 100; +$belowpval2 = (1-$pval2); + +$zscore1 = Real(-1 * normal_distr(.5-$pval1)); +$zscore2 = Real(normal_distr(.5-$pval2)); + +################################################# +# Main + +BEGIN_TEXT +Find the \(z\)-score from a standard Normal distribution that +satisfies each of the following statements. + +$PAR +(a) The point \(z\) with \($showpval1$PERCENT\) of the observations falling below it. +$BR +\(z=\) \{ ans_rule(10) \} + +$PAR +(b) The point \(z\) with \($showpval2$PERCENT\) of the observations falling above it. +$BR +\(z=\) \{ ans_rule(10) \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(tolerance=>0.007, tolType=> 'absolute'); + +$ans_a = Compute($zscore1); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .007; + } => ["Close!"], + -1*$ans_a => ["It might help to sketch the Normal curve and mark the area representing the proportion less than the z score."]))); + +$ans_b = Compute($zscore2); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .007; + } => ["You are close."], + -1*$ans_b => ["It might help to sketch the Normal curve and mark the area representing the proportion greater than the z score."]))); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) Our goal is to find a \(z\)-score such that \($showpval1$PERCENT\) of observations are $BBOLD below $EBOLD it. This means the area below the \(z\)-score in question is \($pval1\). Using inverse technology commands with an area of \($pval1\), we find \(z\approx$zscore1...\) +$PAR +(b) Our goal is to find a \(z\)-score such that \($showpval2$PERCENT\) of observations are $BBOLD above $EBOLD it. Since our inverse technology can only "look left," we need to look up the \(z\)-score that has an area of \(1-$pval2=$belowpval2\). Using inverse technology commands with an area of \($belowpval2\), we find \(z\approx$zscore2...\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_10_NormalDist.pg b/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_10_NormalDist.pg new file mode 100644 index 0000000000..57321e8cb3 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_10_NormalDist.pg @@ -0,0 +1,106 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('E Cabrera, R Cruz') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGstatisticsmacros.pl", + "contextPercent.pl", + "PGnauStats.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +do { +$mean_all = random(8.9,9.9,0.1); +$sd_all = random(2.0,2.6,0.1); + +$mean_med = random(10.1,10.9,0.1); +$sd_med = random(1.4,1.8,0.1); + +$cutoff_b1 = random(8,10,1); +$cutoff_b2 = random(11,12,1); +$cutoff_a = random(11,13,1); +if ($cutoff_a==$cutoff_b2) {$cutoff_a=1+$cutoff_b2}; + +$pval_a = uprob(($cutoff_a - $mean_all)/$sd_all); +$p_b1 = 1-uprob(abs(($cutoff_b1 - $mean_med)/$sd_med)); +$p_b2 = uprob(($cutoff_b2 - $mean_med)/$sd_med); +$pval_b = $p_b1 - $p_b2; + +$z1 = Real(($cutoff_a - $mean_all)/$sd_all); +$z2 = Real(($cutoff_b1 - $mean_med)/$sd_med); +$z3 = Real(($cutoff_b2 - $mean_med)/$sd_med); + +$diagrama = DrawNormalDist(99, $z1, "", $z1, outside=>1); +$diagramb = DrawNormalDist($z2, $z3, $z2, $z3, outside=>0); +} until ($z1 != int($z1) && $z2 != int($z2) && $z3 != int($z3)); + +################################################# +# Main + +BEGIN_TEXT +Almost all medical schools in the United States require applicants to take the Medical College Admission Test (MCAT). On one exam, the scores of all applicants on the biological sciences part of the MCAT were approximately Normal with mean \($mean_all\) and standard deviation \($sd_all\). For applicants who actually entered medical school, the mean score was \($mean_med\) and the standard deviation was \($sd_med\). + +$PAR +(a) What percent of all applicants had scores higher than \($cutoff_a\)? +$BR $SPACE $SPACE $SPACE \{ans_rule(5)\} + +$PAR +(b) What percent of those who entered medical school had scores between \($cutoff_b1\) and \($cutoff_b2\)? +$BR $SPACE $SPACE $SPACE \{ans_rule(5)\} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +$ans_a = Percent($pval_a+.00005); +ANS($ans_a->cmp); + +$ans_b = Percent($pval_b+.00005); +ANS($ans_b->cmp); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) In regards to "all applicants" there is a mean of \($mean_all\) and standard deviation \($sd_all\). To find the percent of applicants who score higher than \($cutoff_a\), we need a \(z\)-score. We find, \(z=\frac{$cutoff_a-$mean_all}{$sd_all}=$z1\). +$PAR +Using technology, we find \(\text{P}(z>$z1)\approx$pval_a\), which can also be seen in the graph below. +$PAR +\{Plot($diagrama, tex_size=>900)\} +$PAR +(b) In regards to those who "entered medical school," we have a mean of \($mean_med\) and standard deviation \($sd_med\). To find the percent of students who scored between \($cutoff_b1\) and \($cutoff_b2\) we will need two \(z\)-scores. Thus we find \(z_{$cutoff_b1} = \frac{$cutoff_b1-$mean_med}{$sd_med}=$z2\) and \(z_{$cutoff_b2} = \frac{$cutoff_b2-$mean_med}{$sd_med}=$z3\). +$PAR +Using technology, we find \(\text{P}($z2900)\} + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_11_NormalDist.pg b/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_11_NormalDist.pg new file mode 100644 index 0000000000..d4ffaa5759 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_11_NormalDist.pg @@ -0,0 +1,83 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGstatisticsmacros.pl", + "contextPercent.pl", + "PGnauStats.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +$meanF = random(900,1050,25); +$sigmaF = random(40,60,10); + +$temp1 = random(1090,1150,5); +$zscore4 = ($temp1 - $meanF) / $sigmaF; +$pval2 =(.0001*int(10000*(uprob(abs($zscore4))+.00005))); +$percp = Percent($pval2); + +$diagram = DrawNormalDist(99, $zscore4, "", $zscore4, outside=>1); + +################################################# +# Main + +BEGIN_TEXT +The temperature at any random location in a kiln used in the manufacture of bricks +is Normally distributed with a mean of \($meanF\) and a standard deviation of \($sigmaF\) degrees. +$PAR +If bricks are fired at a temperature above \($temp1\), they will crack and must +be disposed of. If the bricks are placed randomly throughout the kiln, the +proportion of bricks that crack during the firing process is closest to +\{ ans_rule(10) \}. +$PAR +(Note: The answer can be entered in percentage or decimal form. For example, \(5.02$PERCENT\) or \(0.0502)\). +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; +Context("Percent"); +$ans = Percent($pval2)->with(tolerance=>0.005, tolType=> 'absolute'); +ANS($ans->cmp); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +It is given that we have a normal distribution with mean \($meanF\) and standard deviation of \($sigmaF\) degrees. Since anything above \($temp1\) will crack, this is similar to saying any temperature above a \(z\)-score of \(z=\frac{$temp1-$meanF}{$sigmaF}=$zscore4\) will crack. Using the normal model we find \(\text{P}(z>$zscore4)\approx $pval2\), or, \(\approx$percp\) +$PAR +This can also be seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_12_NormalDist.pg b/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_12_NormalDist.pg new file mode 100644 index 0000000000..b8fe338b1e --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/03Stats_12_NormalDist.pg @@ -0,0 +1,145 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl",, + "answerHints.pl", + "PGnumericalmacros.pl", #NOTE: Needed for normal_distr() function + "PGstatisticsmacros.pl", + "contextPercent.pl",, + "contextPercent.pl", + "PGnauStats.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +$mu = random(96,115,5); +$sigma = random(15,28,3); + +# Values for the 1st problem +$num1 = $mu - random(10,18,4); +$zscore1 = Real(($num1 - $mu) / $sigma); +$pval1 = 1-uprob(abs($zscore1)); +$pvalperc = Percent($pval1); + +# Values for the 2nd problem +$percent2 = random(20,30,5); +$perc2dec = ($percent2/100); +$zscore2 = Real(-1 * normal_distr(0.5 - $percent2/100)); +$xscore2 = $zscore2 * $sigma + $mu; + +# Values for the 3rd problem +$percent3 = random(5,15,5); +$dec3 = ($percent3/100); +$leftside = (1-$dec3); +$perc3dec = ($percent3/100); +$zscore3 = Real(normal_distr(0.5 - $percent3/100)); +$xscore3 = $zscore3 * $sigma + $mu; + + +$diagram = DrawNormalDist(99, $zscore1, "", $zscore1, outside=>1); +################################################# +# Main + +BEGIN_TEXT +Scores on a certain intelligence test for children between ages \(13\) and \(15\) years are approximately Normally distributed with \( \mu = $mu \) and \( \sigma = $sigma \). + +$PAR +(a) What proportion of children aged \(13\) to \(15\) years old have scores on this test above \($num1\)? $PAR + (NOTE: You may enter your answer in percentage or decimal form. For example, \(45.23$PERCENT\) or \(0.4523)\). +$PAR +\{ ans_rule(10) \} +$HR +$PAR +(b) Enter the score which marks the lowest \($percent2\) percent of the distribution. +$PAR +\{ ans_rule(10) \} +$HR +$PAR +(c) Enter the score which marks the highest \($percent3\) percent of the distribution. +$PAR +\{ ans_rule(10) \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; +Context("Percent"); +$ans_a = Percent("$pval1"); +#ANS($ans_a->cmp); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .02; + } => ["You are close. Use more accuracy in your calculation."], + $zscore1 => ["Enter the proportion not the z score."]))); + +Context("Numeric"); +$ans_b = Compute("$xscore2")->with(tolType=>'absolute', tolerance=>'0.2'); +#ANS($ans_b->cmp); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .5; + } => ["Close!"], + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$zscore2) < .02; + } => ["Enter the test score not the z score."]))); + +$ans_c = Compute("$xscore3")->with(tolType=>'absolute', tolerance=>'0.2'); +#ANS($ans_c->cmp); +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .5; + } => ["You are close. Use more accuracy in your calculation."], + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$zscore3) < .02; + } => ["Enter the test score not the z score."]))); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION +(a) It is given that we have a normal distribution with mean \($mu\) and standard deviation of \($sigma\) degrees. Since anything above \($num1\) will crack, this is similar to saying any score above a \(z\)-score of \(z=\frac{$num1-$mu}{$sigma}=$zscore1\). Using the normal model we find \(\text{P}(z>$zscore1)\approx $pval1\), or, \(\approx$pvalperc\) +$PAR +This can also be seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +(b) Our goal is to find a \(z\)-score such that \($percent2$PERCENT\) of scores are $BBOLD below $EBOLD it. This means the area below the \(z\)-score in question is \($perc3dec\). Using inverse technology commands with an area of \($perc3dec\), we find \(z\approx$zscore2\). Using the \(z\)-score formula, we find \($zscore2=\frac{x-$mu}{$sigma}\). This can be solved to find \(x\approx$xscore2\). +$PAR +(c) Our goal is to find a \(z\)-score such that \($percent3$PERCENT\) of scores are $BBOLD above $EBOLD it. Since our technology can only "look left," this means the area below the \(z\)-score in question is \(1-$dec3=$leftside\). Using inverse technology commands with an area of \($leftside\), we find \(z\approx$zscore3\). Using the \(z\)-score formula, we find \($zscore3=\frac{x-$mu}{$sigma}\). This can be solved to find \(x\approx$xscore3\). +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/dueck6_2_5.pg b/Contrib/PCC/Statistics/zScoresInGeneral/dueck6_2_5.pg new file mode 100644 index 0000000000..9f914dc305 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/dueck6_2_5.pg @@ -0,0 +1,106 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability','Normal Distribution') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$p[0] = .5; +$p[1] = random(.9826,.8212,.9854); +$p[2] = random(.1423,.0078,.0749); +$p[3] = random(.9394,.9987,.9952); + +$a = normal_distr($p[0]-0.5); +$b = Real(normal_distr($p[1]-0.5)); +$c = Real(normal_distr(0.5-$p[2])); +$d = Real(-1*normal_distr($p[3]-0.5)); + +$aa = $p[0]; +$bb = $p[1]; +$cc = $p[2]; +$dd = $p[3]; +$ccleft = (1-$cc); +$ddleft = (1-$dd); + +#$aa = .5+$p[0]; +#$bb = .5+$p[1]; +#$cc = .5-$p[2]; +#$dd = .5-$p[3]; + +$aap = 100*$aa; +$ccp = 100*$cc; + +BEGIN_TEXT +Find the \(z\)-score such that: $PAR +(a) The area under the standard Normal curve to its left is \($aap$PERCENT\) $BR +$SPACE $SPACE $SPACE\(z =\) \{ans_rule(10)\} $PAR + +(b) The area under the standard Normal curve to its left is \($bb\) $BR +$SPACE $SPACE $SPACE\(z =\) \{ans_rule(10)\} $PAR + +(c) The area under the standard Normal curve to its right is \($ccp$PERCENT\) $BR +$SPACE $SPACE $SPACE\(z =\) \{ans_rule(10)\} $PAR + +(d) The area under the standard Normal curve to its right is \($dd\) $BR +$SPACE $SPACE $SPACE\(z =\) \{ans_rule(10)\} $PAR + + + +END_TEXT + +ANS(Compute($a)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute($b)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute($c)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute($d)->cmp(tolType=>relative,tolerance=>.01)); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) Our goal is to find a \(z\)-score such that \($aap$PERCENT\) is to the left of it, or, an area of \($aa\) is $BBOLD below $EBOLD it. Using inverse technology commands with an area of \($aa\), we find \(z=$a\). +$PAR +(b) Our goal is to find a \(z\)-score such that an area of \($bb\) is to the left of it, or, $BBOLD below $EBOLD it. Using inverse technology commands with an area of \($bb\), we find \(z\approx$b\). +$PAR +(c) Our goal is to find a \(z\)-score such that \($ccp$PERCENT\) is to the right of it, or, an area of \($cc\) is $BBOLD above $EBOLD it. Since our technology can only "look left," this means the area below the \(z\)-score in question is \(1-$cc=$ccleft\). Using inverse technology commands with an area of \($ccleft\), we find \(z\approx$c\). +$PAR +(d) Our goal is to find a \(z\)-score such that an area of \($dd\) is to the right of it, or, $BBOLD above $EBOLD it. Since our technology can only "look left," this means the area below the \(z\)-score in question is \(1-$dd=$ddleft\). Using inverse technology commands with an area of \($ddleft\), we find \(z\approx$d\). + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/dueck6_3_1.pg b/Contrib/PCC/Statistics/zScoresInGeneral/dueck6_3_1.pg new file mode 100644 index 0000000000..8168f5d95e --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/dueck6_3_1.pg @@ -0,0 +1,102 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability','Normal Distribution') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$exp = 2.718281828; + +$a = random(0.10,3.00,0.01); +$b = random(-3.00, -0.10, 0.01); +$c = random(-3.00, -0.01, 0.01); +$d = random(0.01, 3.00, 0.01); +$e = random(-3.00, 3.00, 0.01); +$f = random(-3.00, 3.00, 0.01); + +$ans_a = normal_prob(0, $a); +$ans_b = normal_prob($b, 0); +$ans_c = normal_prob($c, $d); +$ans_d = normal_prob('-infty', $e); +$ans_e = normal_prob($f, 'infty'); + +$deca = Real($ans_a); +$decb = Real($ans_b); +$decc = Real($ans_c); +$decd = Real($ans_d); +$dece = Real($ans_e); +BEGIN_TEXT + +Assume that the readings on the thermometers are Normally distributed with a mean of +\( 0^{\circ} \mbox{C}\) and a standard deviation of \( 1^{\circ} \mbox{C} \). A thermometer is randomly selected and tested. +Find the probability of each reading.$PAR + +(a) \( \ \) Between \( 0^{\circ} \mbox{C} \) and \( $a^{\circ} \mbox{C} \): \( \ \) \{ans_rule(10)\}$PAR + +(b) \( \ \) Between \( $b^{\circ} \mbox{C} \) and \( 0^{\circ} \mbox{C} \): \( \ \) \{ans_rule(10)\}$PAR + +(c) \( \ \) Between \( $c^{\circ} \mbox{C} \) and \( $d^{\circ} \mbox{C} \): \( \ \) \{ans_rule(10)\}$PAR + +(d) \( \ \) Less than \( $e^{\circ} \mbox{C} \): \( \ \) \{ans_rule(10)\}$PAR + +(e) \( \ \) Greater than \( $f^{\circ} \mbox{C} \): \( \ \) \{ans_rule(10)\} + + +END_TEXT +Context("Percent"); +ANS(Percent($ans_a)->cmp); +ANS(Percent($ans_b)->cmp); +ANS(Percent($ans_c)->cmp); +ANS(Percent($ans_d)->cmp); +ANS(Percent($ans_e)->cmp); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION +For all solutions below we will rely on the a mean of \(0^{\circ} \mbox{C}\) and a standard deviation of \(1^{\circ} \mbox{C}\) as given in the problem situation above. This means \(0^{\circ} \mbox{C}\) is a \(z\)-score of \(0\). Additionally, since we have standard deviation on \(1^{\circ} \mbox{C}\), this means \(1^{\circ} \mbox{C}\) is a \(z\)-score of \(1\), \(2^{\circ} \mbox{C}\) is a \(z\)-score of \(2\), etc. +$PAR +(a) We have \(z=0\) and \(z=$a\) and we need to find \(\text{P}(0$f)\). Using technology, we find that \(\text{P}(z>$f)\approx$dece\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/dueck6_3_3.pg b/Contrib/PCC/Statistics/zScoresInGeneral/dueck6_3_3.pg new file mode 100644 index 0000000000..82126052fa --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/dueck6_3_3.pg @@ -0,0 +1,209 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability','Normal Distribution') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGstatisticsmacros.pl", +"PGnumericalmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserOneOf.pl", +"PGnauGraphics.pl", +"PGnauStats.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mu = random(60,80,1); +$sigma = random(5,10,.1); + +$a = random(60,($mu-1),1); +$b = random(70,90,1); +while($a==$b) {$b = random(70,90,1);} +$c = random(1,3,1); + + +$xa = Real(($a-$mu)/$sigma); +$xb = Real(($b-$mu)/$sigma); + + +$ans1 = normal_prob($xa, "infty"); +$ans2 = normal_prob(-"infty", $xb); +$ans3 = Real(100*normal_prob(-$c, $c)); + +$diagrama = DrawNormalDist(99, $xa, "", $xa, outside=>1); + +$diagramb = DrawNormalDist($xb, -99, $xb, "", outside=>1); + +BEGIN_TEXT +The extract of a plant native to Taiwan has been tested as a possible treatment for Leukemia. One of the chemical compounds produced from the plant was analyzed for a particular collagen. The collagen amount was found to be Normally distributed with a mean of \($mu\) and standard deviation of +\($sigma\) grams per mililiter. $PAR +(a) \( \) What is the probability that the amount of collagen is greater than \($a\) grams per mililiter? $PAR + \{ans_rule(10)\} $PAR +(b) \( \) What is the probability that the amount of collagen is less than \($b\) grams per mililiter? $PAR + \{ans_rule(10)\} $PAR +(c) \( \) What percentage of compounds formed from the extract of this plant fall within \($c\) standard +deviations of the mean? $PAR + \{ans_rule(10)\} +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp()); +ANS(Percent($ans2)->cmp()); + +Context("Numeric"); + +Context()->flags->set(tolerance=>0.00001); + + + +if (Compute($ans3) == 0.15) +{$ans3 = OneOf($ans3,0.1349898);} +elsif (Compute($ans3) == 0.3) +{$ans3 = OneOf($ans3,0.2699796);} +elsif (Compute($ans3) == 2.35) +{$ans3 = OneOf($ans3,2.1400234);} +elsif (Compute($ans3) == 2.5) +{$ans3 = OneOf($ans3,2.2750132);} +elsif (Compute($ans3) == 2.65) +{$ans3 = OneOf($ans3,2.4100030);} +elsif (Compute($ans3) == 5) +{$ans3 = OneOf($ans3,4.5500264);} +elsif (Compute($ans3) == 9) +{$ans3 = OneOf($ans3,9.2773641);} +elsif (Compute($ans3) == 13.5) +{$ans3 = OneOf($ans3,13.5905122);} +elsif (Compute($ans3) == 15.85) +{$ans3 = OneOf($ans3,15.7305356);} +elsif (Compute($ans3) == 16) +{$ans3 = OneOf($ans3,15.8655254);} +elsif (Compute($ans3) == 16.15) +{$ans3 = OneOf($ans3,16.0005152);} +elsif (Compute($ans3) == 18.5) +{$ans3 = OneOf($ans3,18.1405386);} +elsif (Compute($ans3) == 22.5) +{$ans3 = OneOf($ans3,22.8678763);} +elsif (Compute($ans3) == 24.85) +{$ans3 = OneOf($ans3,25.0078997);} +elsif (Compute($ans3) == 25) +{$ans3 = OneOf($ans3,24.8571105,25.1428895);} +elsif (Compute($ans3) == 25.15) +{$ans3 = OneOf($ans3,25.2778793);} +elsif (Compute($ans3) == 27.5) +{$ans3 = OneOf($ans3,27.4179027);} +elsif (Compute($ans3) == 32) +{$ans3 = OneOf($ans3,31.7310508);} +elsif (Compute($ans3) == 34) +{$ans3 = OneOf($ans3,34.1344746);} +elsif (Compute($ans3) == 41) +{$ans3 = OneOf($ans3,41.0084149);} +elsif (Compute($ans3) == 47.5) +{$ans3 = OneOf($ans3,47.7249868);} +elsif (Compute($ans3) == 49.85) +{$ans3 = OneOf($ans3,49.8650102);} +elsif (Compute($ans3) == 5) +{$ans3 = OneOf($ans3,49.7142210,50.2857790);} +elsif (Compute($ans3) == 50.15) +{$ans3 = OneOf($ans3,50.1349898);} +elsif (Compute($ans3) == 52.5) +{$ans3 = OneOf($ans3,52.2750132);} +elsif (Compute($ans3) == 59) +{$ans3 = OneOf($ans3,58.9915851);} +elsif (Compute($ans3) == 66) +{$ans3 = OneOf($ans3,65.8655254);} +elsif (Compute($ans3) == 68.2689) +{$ans3 = OneOf($ans3,68);} +elsif (Compute($ans3) == 72.5) +{$ans3 = OneOf($ans3,72.5820973);} +elsif (Compute($ans3) == 74.85) +{$ans3 = OneOf($ans3,74.7221207);} +elsif (Compute($ans3) == 75) +{$ans3 = OneOf($ans3,74.8571105,75.1428895);} +elsif (Compute($ans3) == 75.15) +{$ans3 = OneOf($ans3,74.9921003);} +elsif (Compute($ans3) == 77.5) +{$ans3 = OneOf($ans3,77.1321237);} +elsif (Compute($ans3) == 81.5) +{$ans3 = OneOf($ans3,81.8594614);} +elsif (Compute($ans3) == 83.85) +{$ans3 = OneOf($ans3,83.9994848);} +elsif (Compute($ans3) == 84) +{$ans3 = OneOf($ans3,84.1344746);} +elsif (Compute($ans3) == 84.15) +{$ans3 = OneOf($ans3,84.2694644);} +elsif (Compute($ans3) == 86.5) +{$ans3 = OneOf($ans3,86.4094878);} +elsif (Compute($ans3) == 91) +{$ans3 = OneOf($ans3,90.7226359);} +elsif (Compute($ans3) == 95) +{$ans3 = OneOf($ans3,95.4499736);} +elsif (Compute($ans3) == 95.4499736) +{$ans3 = OneOf($ans3,95);} +elsif (Compute($ans3) == 96.75) +{$ans3 = OneOf($ans3 , 97.8599766);} +elsif (Compute($ans3) == 97.35) +{$ans3 = OneOf($ans3,97.5899970);} +elsif (Compute($ans3) == 97.5) +{$ans3 = OneOf($ans3,97.7249868);} +elsif (Compute($ans3) == 99.7) +{$ans3 = OneOf($ans3,99.7300204);} +elsif (Compute($ans3) == 99.7300204) +{$ans3 = OneOf($ans3,99.7);} +elsif (Compute($ans3) == 99.85) +{$ans3 = OneOf($ans3,99.8650102);} + +Context("Percent"); +@reals = $ans3->value; +@percents = (); +for my $i (@reals) {push(@percents, Percent($i/100));}; +$ans3 = OneOf(@percents); + + + +ANS(Compute($ans3)->cmp()); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) As our sample data is \($a\) and we have a mean of \($mu\) and standard deviation of \($sigma\), we can find \(z=\frac{$a-$mu}{$sigma}=$xa\). As we want to know the probability of being more than \($a\), we find \(\text{P}(z>$a)\approx$ans1\). This can also be seen in the graph below. +$PAR +\{Plot($diagrama, tex_size=>900)\} +$PAR +(b) As our sample data is \($b\) and we have a mean of \($mu\) and standard deviation of \($sigma\), we can find \(z=\frac{$b-$mu}{$sigma}=$xb\). As we want to know the probability of being less than \($b\), we find \(\text{P}(z>$b) \approx $ans2\). This can also be seen in the graph below. +$PAR +\{Plot($diagramb, tex_size=>900)\} +$PAR +(c) We know that \(\approx 68$PERCENT\) of all observations fall within \(1\) deviation from the mean, \(\approx 95$PERCENT\) fall \(2\) deviations from the mean and \(\approx 99.7$PERCENT\) fall \(3\) deviations from the mean. +$PAR +For the current questions, this means \($ans3\) fall within \($c\) deviations of the mean. + + +END_SOLUTION + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/empirical_rule3.pg b/Contrib/PCC/Statistics/zScoresInGeneral/empirical_rule3.pg new file mode 100644 index 0000000000..9efa9d1cd9 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/empirical_rule3.pg @@ -0,0 +1,75 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('empirical rule') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 06/20/05; 07/28/10 +# modified by John Hagood +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "MathObjects.pl", + +); + +TEXT(&beginproblem); + +do{$mean = random( 59, 80, 1); + $sd = random( 4, 20, 1 ); +} until( 3 * $sd + $mean < 100 ); + +@per1 = ( 25, 75 ); +$ind1 = random( 0, 1, 1 ); + +if( $ind1 == 0 ){ $fact = -1; +} else { $fact = 1;} + +$ans1 = $mean + (.67 * $fact) * $sd; +$zscore1 = (.67 * $fact); +@per2 = ( 16, 2.5, 0.15 ); +@dev = ( 1, 2, 3 ); +$ind2 = random( 0, 2, 1); +$ans2 = $mean + ( $ind2 + 1 ) * $sd; +$zscore2 = ($ind2+1); + +$area1 = ($per1[$ind1]/100); +$area2 = (100-($per2[$ind2])); +$area2dec = ($area2/100); + +BEGIN_TEXT + +A math professor notices that scores from a recent exam are Normally distributed with a mean of \($mean\) and +a standard deviation of \($sd\). $PAR +(a) What score do \($per1[$ind1]$PERCENT\) of the students exam scores fall below?$BR +$SPACE $SPACE $SPACE \{ ans_rule( 15 ) \} $PAR +(b) Suppose the professor decides to grade on a curve. If the professor wants \($per2[$ind2]$PERCENT\) of the students + to get an A, what is the minimum score for an A? $BR +$SPACE $SPACE $SPACE\{ ans_rule( 15 ) \} + +END_TEXT + +ANS( Compute( $ans1)->cmp(tolType=>absolute,tolerance=>0.5) ); +ANS( Compute( $ans2)->cmp(tolType=>absolute,tolerance=>0.5) ); + + +#################################################### +## Solutions +#################################################### + +BEGIN_SOLUTION + +(a) \($per1[$ind1]$PERCENT\) of students fall below a certain score. To find this score we will need its \(z\)-score representation. This is found with technology using an area of \($area1\) since we want the score that students are below, and our technology can only "look left." Thus we find \(z\approx $zscore1\). We can now solve \(z=\frac{x-\bar{x}}{s_{x}}\) for \(x\). Using \($zscore1=\frac{x-$mean}{$sd}\) we find \(x=$ans1\). +$PAR +(b) If we only want \($per2[$ind2]$PERCENT\) to score an A, that means \(100$PERCENT-$per2[$ind2]$PERCENT=$area2$PERCENT\) do not score an A. To find this cutoff score we will need its \(z\)-score representation. This is found with technology using an area of \($area2dec\), even though we want the highest \($per2[$ind2]$PERCENT\), our technology can only "look left." Thus we find \(z\approx $zscore2\). We can now solve \(z=\frac{x-\bar{x}}{s_{x}}\) for \(x\). Using \($zscore2=\frac{x-$mean}{$sd}\) we find \(x=$ans2\). + + +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/empirical_rule5.pg b/Contrib/PCC/Statistics/zScoresInGeneral/empirical_rule5.pg new file mode 100644 index 0000000000..53d87570a6 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/empirical_rule5.pg @@ -0,0 +1,241 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('empirical rule') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/07/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "parserOneOf.pl", + "contextPercent.pl", +); + +TEXT(&beginproblem); +$country = list_random( 'American', 'Canadian', 'English', 'French', 'German', 'Russian' ); +$mean = random( 65, 72, .1 ); +$sd = random( 2, 6, .1 ); + +@val = ( .67 * $sd, $sd, 2 * $sd, 3 * $sd ); +@slice1 = NchooseK( 4, 3 ); + +$a = $mean - $val[$slice1[0]]; +$b = $mean + $val[$slice1[0]]; +$fact1 = list_random( -1, 1 ); +$c = $mean + ( $val[$slice1[1]] * $fact1 ); +$fact2 = list_random( -1, 1 ); +$d = $mean + ( $val[$slice1[2]] * $fact2 ); + +@quest = ('Between \('.$a.'\) and \('.$b.'\) inches tall?', + ' Under \('.$c.'\) inches tall?', + 'Over \('.$d.'\) inches tall?' ); + +if( $slice1[0] == 0 ){ + $ans1 = 50; +} +elsif( $slice1[0] == 1 ){ + $ans1 = 68; +} +elsif( $slice1[0] == 2 ) { + $ans1 = 95; +} +elsif( $slice1[0] == 3 ) { + $ans1 = 99.7; +} + +if( $slice1[1] == 0 ){ + if( $fact1 == 1 ){ + $ans2 = 75; + } else{ + $ans2 = 25; + } +} elsif( $slice1[1] == 1 ){ + if( $fact1 == 1 ){ + $ans2 = 84; + } else{ + $ans2 = 16; # this was 14 Nandor + } +} elsif( $slice1[1] == 2 ){ + if( $fact1 == 1 ){ + $ans2 = 97.5; + } else{ + $ans2 = 2.5; + } +} elsif( $slice1[1] == 3 ){ + if( $fact1 == 1 ){ + $ans2 = 99.85; + }else{ + $ans2 = .15; + } +} + +if( $slice1[2] == 0 ){ + if( $fact2 == -1 ){ + $ans3 = 75; + } else{ + $ans3 = 25; + } +} elsif( $slice1[2] == 1 ){ + if( $fact2 == -1 ){ + $ans3 = 84; + } else{ + $ans3 = 16; # 14; Nandor for Terry + } +} elsif( $slice1[2] == 2 ) { + if( $fact2 == -1 ){ + $ans3 = 97.5; + } else{ + $ans3 = 2.5; + } +} elsif( $slice1[2] == 3 ) { + if( $fact2 == -1 ){ + $ans3 = 99.85; + }else{ + $ans3 = 0.15; + } +} + +@ans = ( $ans1, $ans2, $ans3 ); +@slice2 = NchooseK( 3, 3 ); + +BEGIN_TEXT + +The heights of $country men are Normally distributed with a mean of \($mean\) inches and a standard deviation of \($sd\) +inches. What percentage of $country men are:$PAR +(a) $quest[$slice2[0]] $BR + \{ans_rule( 15 ) \} $PAR +(b) $quest[$slice2[1]] $BR + \{ans_rule( 15 ) \} $PAR +(c) $quest[$slice2[2]] $BR + \{ans_rule( 15 ) \} + +END_TEXT + + +Context("Numeric"); + +Context()->flags->set(tolerance=>0.00001); + +for my $i (0..2) +{ +$ans[$i] = Real("$ans[$i]"); + +if (Compute($ans[$i]) == 0.15) +{$ans[$i] = OneOf($ans[$i],0.1349898);} +elsif (Compute($ans[$i]) == 0.3) +{$ans[$i] = OneOf($ans[$i],0.2699796);} +elsif (Compute($ans[$i]) == 2.35) +{$ans[$i] = OneOf($ans[$i],2.1400234);} +elsif (Compute($ans[$i]) == 2.5) +{$ans[$i] = OneOf($ans[$i],2.2750132);} +elsif (Compute($ans[$i]) == 2.65) +{$ans[$i] = OneOf($ans[$i],2.4100030);} +elsif (Compute($ans[$i]) == 5) +{$ans[$i] = OneOf($ans[$i],4.5500264);} +elsif (Compute($ans[$i]) == 9) +{$ans[$i] = OneOf($ans[$i],9.2773641);} +elsif (Compute($ans[$i]) == 13.5) +{$ans[$i] = OneOf($ans[$i],13.5905122);} +elsif (Compute($ans[$i]) == 15.85) +{$ans[$i] = OneOf($ans[$i],15.7305356);} +elsif (Compute($ans[$i]) == 16) +{$ans[$i] = OneOf($ans[$i],15.8655254);} +elsif (Compute($ans[$i]) == 16.15) +{$ans[$i] = OneOf($ans[$i],16.0005152);} +elsif (Compute($ans[$i]) == 18.5) +{$ans[$i] = OneOf($ans[$i],18.1405386);} +elsif (Compute($ans[$i]) == 22.5) +{$ans[$i] = OneOf($ans[$i],22.8678763);} +elsif (Compute($ans[$i]) == 24.85) +{$ans[$i] = OneOf($ans[$i],25.0078997);} +elsif (Compute($ans[$i]) == 25) +{$ans[$i] = OneOf($ans[$i],24.8571105,25.1428895);} +elsif (Compute($ans[$i]) == 25.15) +{$ans[$i] = OneOf($ans[$i],25.2778793);} +elsif (Compute($ans[$i]) == 27.5) +{$ans[$i] = OneOf($ans[$i],27.4179027);} +elsif (Compute($ans[$i]) == 32) +{$ans[$i] = OneOf($ans[$i],31.7310508);} +elsif (Compute($ans[$i]) == 34) +{$ans[$i] = OneOf($ans[$i],34.1344746);} +elsif (Compute($ans[$i]) == 41) +{$ans[$i] = OneOf($ans[$i],41.0084149);} +elsif (Compute($ans[$i]) == 47.5) +{$ans[$i] = OneOf($ans[$i],47.7249868);} +elsif (Compute($ans[$i]) == 49.85) +{$ans[$i] = OneOf($ans[$i],49.8650102);} +elsif (Compute($ans[$i]) == 50) +{$ans[$i] = OneOf($ans[$i],49.7142210,50.2857790);} +elsif (Compute($ans[$i]) == 50.15) +{$ans[$i] = OneOf($ans[$i],50.1349898);} +elsif (Compute($ans[$i]) == 52.5) +{$ans[$i] = OneOf($ans[$i],52.2750132);} +elsif (Compute($ans[$i]) == 59) +{$ans[$i] = OneOf($ans[$i],58.9915851);} +elsif (Compute($ans[$i]) == 66) +{$ans[$i] = OneOf($ans[$i],65.8655254);} +elsif (Compute($ans[$i]) == 68) +{$ans[$i] = OneOf($ans[$i],68.2689492);} +elsif (Compute($ans[$i]) == 72.5) +{$ans[$i] = OneOf($ans[$i],72.5820973);} +elsif (Compute($ans[$i]) == 74.85) +{$ans[$i] = OneOf($ans[$i],74.7221207);} +elsif (Compute($ans[$i]) == 75) +{$ans[$i] = OneOf($ans[$i],74.8571105,75.1428895);} +elsif (Compute($ans[$i]) == 75.15) +{$ans[$i] = OneOf($ans[$i],74.9921003);} +elsif (Compute($ans[$i]) == 77.5) +{$ans[$i] = OneOf($ans[$i],77.1321237);} +elsif (Compute($ans[$i]) == 81.5) +{$ans[$i] = OneOf($ans[$i],81.8594614);} +elsif (Compute($ans[$i]) == 83.85) +{$ans[$i] = OneOf($ans[$i],83.9994848);} +elsif (Compute($ans[$i]) == 84) +{$ans[$i] = OneOf($ans[$i],84.1344746);} +elsif (Compute($ans[$i]) == 84.15) +{$ans[$i] = OneOf($ans[$i],84.2694644);} +elsif (Compute($ans[$i]) == 86.5) +{$ans[$i] = OneOf($ans[$i],86.4094878);} +elsif (Compute($ans[$i]) == 91) +{$ans[$i] = OneOf($ans[$i],90.7226359);} +elsif (Compute($ans[$i]) == 95) +{$ans[$i] = OneOf($ans[$i],95.4499736);} +elsif (Compute($ans[$i]) == 96.75) +{$ans[$i] = OneOf($ans[$i] , 97.8599766);} +elsif (Compute($ans[$i]) == 97.35) +{$ans[$i] = OneOf($ans[$i],97.5899970);} +elsif (Compute($ans[$i]) == 97.5) +{$ans[$i] = OneOf($ans[$i],97.7249868);} +elsif (Compute($ans[$i]) == 99.7) +{$ans[$i] = OneOf($ans[$i],99.7300204);} +elsif (Compute($ans[$i]) == 99.85) +{$ans[$i] = OneOf($ans[$i],99.8650102);} +} + +Context()->flags->set(tolerance=>0.01); + +Context("Percent"); +for my $j (0..2) { +@reals = $ans[$slice2[$j]]->value; +@percents = (); +for my $i (@reals) {push(@percents,Percent($i/100));}; +$ans[$slice2[$j]] = OneOf(@percents); +}; + +ANS( +Compute( $ans[$slice2[0]])->cmp() ); +ANS( +Compute( $ans[$slice2[1]])->cmp() ); +ANS( +Compute( $ans[$slice2[2]])->cmp() ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/gust37.pg b/Contrib/PCC/Statistics/zScoresInGeneral/gust37.pg new file mode 100644 index 0000000000..648e6a4b00 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/gust37.pg @@ -0,0 +1,101 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +"parserNumberWithUnits.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$mean = random(59,64,1); +$stddev = random(8,10,1); + +$time1=random(35,60,5); +$time2=random(65,90,5); +$time3=random(65,90,1); + +$z1= ($time1-$mean)/$stddev; +$z2= ($time2-$mean)/$stddev; +$z3= ($time3-$mean)/$stddev; + +$popup = PopUp(["?", "to the left", "to the right", "within one standard deviation"], "to the right"); + +BEGIN_TEXT + +As reported in "Runner's World" magazine, the finishing times of the runners in the New York City \(10\) km run are Normally distributed with a mean of \($mean\) minutes and a standard deviation of \($stddev\) minutes. Let \(x\) denote finishing time for a runner. Type $BBOLD min$EBOLD for minutes. $BR + +$PAR +a) The distribution of the variable \(x\) has mean \{ans_rule(10)\} and standard deviation \{ans_rule(10)\}. $BR + +$PAR +b) The distribution of the standardized variable \(z\) has mean \{ans_rule(10)\} and standard deviation \{ans_rule(10)\}. $BR + +$PAR +c) The percentage of finishers with times between \($time1\) and \($time2\) minutes is equal to the area under the standard Normal curve between the \(z\)-scores\{ans_rule(10)\} and \{ans_rule(10)\}. $BR + +$PAR +d) The percentage of finishers with times exceeding \($time3\) minutes is equal to the area under the standard Normal curve that lies \{ $popup->menu() \} of \{ans_rule(10)\}. + +END_TEXT + +ANS(NumberWithUnits($mean,'min')->cmp(tolType=>relative,tolerance=>.01)); +ANS(NumberWithUnits($stddev, 'min')->cmp(tolType=>relative,tolerance=>.01)); + +ANS(Compute(0)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute(1)->cmp(tolType=>relative,tolerance=>.01)); + +ANS(Compute($z1)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute($z2)->cmp(tolType=>relative,tolerance=>.01)); + +ANS( $popup->cmp() ); +ANS(Compute($z3)->cmp(tolType=>relative,tolerance=>.01)); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) Based on the question, we know that the variable \(x\) has mean \($mean\)min and standard deviation \($stddev\)min. +$PAR +(b) Anytime we standardize a variable we have the mean as \(0\) and standard deviation \(1\). +$PAR +(c) The percentage of finishers with times between \($time1\) and \($time2\) minutes correspond to \(z\)-scores of \(z_{$time1}=\frac{$time1-$mean}{$stddev}=$z1\) and \(z_{$time2}=\frac{$time2-$mean}{$stddev}=$z2\). +$PAR +(d) The percentage of finishers with times exceeding \($time3\) minutes corresponds to a \(z\)-score of \(z_{$time3}=\frac{$time3-$mean}{$stddev}=$z3\). As we want to know the percentage of finishers with times exceeding \($time3\) minutes, this means we want the area to the right of \(z=$z3\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/gust38.pg b/Contrib/PCC/Statistics/zScoresInGeneral/gust38.pg new file mode 100644 index 0000000000..4d4417e76e --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/gust38.pg @@ -0,0 +1,81 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$mc = new_multiple_choice(); + +$mc->qa("Which property of the standard Normal curve allowed you to answer part a)?", +"The standard Normal curve is symmetric about \(0\)"); +$mc->extra("The total area under the curve is \(1\)", "The standard Normal curve extends indefinitely in both directions", "Almost all the area under the standard Normal curve lies between \(-3\) and \(3\)"); +$mc->makeLast("None of the above"); + +$z1=random(-2,-1,.01); +$area1 = normal_prob(-"infty", $z1); +$area1string = sprintf("%.4f", $area1); +$opp= -1*$z1; + +BEGIN_TEXT + +a) The area under the standard Normal curve that lies to the left of \(z=$z1\) is \($area1string\). Without consulting a the table giving areas under the standard Normal curve, determine the area under the standard Normal curve that lies to the right of \(z=$opp\). $BR answer: \{ans_rule(20)\} $BR + +$PAR +b) +\{ $mc->print_q \} +\{ $mc->print_a \} + + +END_TEXT +ANS(Compute($area1string) +->cmp(tolType=>relative,tolerance=>.01)); +ANS(radio_cmp($mc->correct_ans)); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) Since the normal curve is symmetrical about the mean of \(0\), the area found to the left of any \(z\)-score, for example \(z=-1\), will be the same as the area found to the right of the \(z\)-score of opposite sign, in this case \(z=1\). Since the area to the left of \(z=$z1\) is \($area1string\), by symmetry, the area to the right of \(z=$opp\) is \($area1string\) +$PAR +(b) Option \(D\). We answered the above question using symmetry about the mean of \(0\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/gust39.pg b/Contrib/PCC/Statistics/zScoresInGeneral/gust39.pg new file mode 100644 index 0000000000..662114dbc8 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/gust39.pg @@ -0,0 +1,84 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 0; + +$mc = new_multiple_choice(); + +$mc->qa("Which property of the standard Normal curve allowed you to answer part a)?", +"The total area under the curve is \(1\)"); +$mc->extra("The standard Normal curve extends indefinitely in both directions", "The standard Normal curve is symmetric about \(0\)", "Almost all the area under the standard Normal curve lies between \(-3\) and \(3\)"); +$mc->makeLast("None of the above"); + +$z1=random(1,2,.01); +$area1 = normal_prob(-infty, $z1); +$area1string = sprintf("%.4f", $area1); +$ans=Percent(1-$area1); +$leftover = Real(1-$area1); + +BEGIN_TEXT + +a) The area under the standard Normal curve that lies to the left of \(z=$z1\) is \($area1string\). Without consulting a the table giving areas under the standard Normal curve, determine the area under the standard Normal curve that lies to the right of \(z=$z1\). $BR answer: \{ans_rule(20)\} $BR + +$PAR +b) +\{ $mc->print_q \} +\{ $mc->print_a \} + + +END_TEXT +ANS($ans->cmp(tolType=>relative,tolerance=>.01)); +ANS(radio_cmp($mc->correct_ans)); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) The standard Normal curve has a total area of \(1\). Since the area to the left of \(z=$z1\) is \($area1string\), there is an area of \(1-$area1string=$leftover\), or, \(\approx$ans\) on the right side. +$PAR +(b) Option \(D\). We needed to use the fact that the standard Normal curve has a total area of \(1\) to find the area on the right side. + +END_SOLUTION +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/gust40.pg b/Contrib/PCC/Statistics/zScoresInGeneral/gust40.pg new file mode 100644 index 0000000000..e362eda9e3 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/gust40.pg @@ -0,0 +1,63 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +BEGIN_TEXT + +The area under the standard Normal curve that lies to the left of a \(z\)-score is always strictly larger than \{ans_rule(10)\} and strictly smaller than \{ans_rule(10)\}. +END_TEXT + +Context("Percent"); +ANS(Percent(0)->cmp); +ANS(Percent(1)->cmp); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +The total area of the standard Normal curve is always \(1\). As the curve stretches infinitely in both directions, for any positive \(z\)-score you find, there is always a larger one. As such, you will never find a \(z\)-score that corresponds to an area of \(1\), it will always be under \(1\). +$PAR +Similarly, for any negative \(z\)-score you find, there is always a larger one. As such, you will never find a \(z\)-score that corresponds to an area of \(0\), it will always be greater than \(0\). +$PAR +The area under the standard Normal curve that lies to the left of a \(z\)-score is always strictly larger than \(0\) and strictly smaller than \(1\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/gust41.pg b/Contrib/PCC/Statistics/zScoresInGeneral/gust41.pg new file mode 100644 index 0000000000..bd2a8f9648 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/gust41.pg @@ -0,0 +1,101 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(-2.3,-.01,.01); +$b = random(0,2.3,.01); +$c = random(-2.3,-.01,.01); +$d = random(0,2.3,.01); +$e = random(0,2.3,.01); +$f = random(-2.3,-.01,.01); +$g = random(-2.3,-.01,.01); +$h = random(0,2.3,.01); + +$ans1 = Real(normal_prob($a, $b)); +$ans2 = Real(normal_prob($c, $d)); +$ans3 = Real(normal_prob(-"infty", $e)); +$ans4 = Real(normal_prob(-"infty", $f)); +$ans5 = Real(normal_prob($g, "infty")); +$ans6 = Real(normal_prob($h, "infty")); + +BEGIN_TEXT + +(a) Find the area under the standard Normal curve between \($a\) and \($b\). $BR \{ans_rule(10)\} $PAR +(b) Find the area under the standard Normal curve between \($c\) and \($d\). $BR \{ans_rule(10)\} $PAR +(c) Find the area under the standard Normal curve that lies to the left of \($e\). $BR +\{ans_rule(10)\} $PAR +(d) Find the area under the standard Normal curve that lies to the left of \($f\). $BR +\{ans_rule(10)\} $PAR +(e) Find the area under the standard Normal curve that lies to the right of \($g\). $BR +\{ans_rule(10)\} $PAR +(f) Find the area under the standard Normal curve that lies to the right of \($h\). $BR +\{ans_rule(10)\} + + +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Percent($ans3)->cmp); +ANS(Percent($ans4)->cmp); +ANS(Percent($ans5)->cmp); +ANS(Percent($ans6)->cmp); + +#################################################### +# Solutions +#################################################### + +BEGIN_SOLUTION +There are various methods of technology to find the appropriate area. Using your preference, we find the following, +$PAR +(a) \(\text{P}($a$g)\approx$ans5\) +$PAR +(f) \(\text{P}(z>$h)\approx$ans6\) +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/normal_dist2.pg b/Contrib/PCC/Statistics/zScoresInGeneral/normal_dist2.pg new file mode 100644 index 0000000000..feef5eaa05 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/normal_dist2.pg @@ -0,0 +1,222 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Continuous Random Variables and Their Probability Distributions') +## DBsection('The Normal Probability Distribution') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/14/05; Modified 08/18/10 +# modified by J Hagood +# Location: Northern Arizona University + +DOCUMENT(); + +loadMacros("PGstandard.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "MathObjects.pl", + "parserOneOf.pl", + "contextPercent.pl", + "PGstatisticsmacros.pl", + "PGauxiliaryFunctions.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGgraphmacros.pl", + "PGnumericalmacros.pl", + "PGasu.pl", +); + +TEXT(&beginproblem); + +@list = ( 'Length of skateboards in a skateshop', 'The shelf life of a batteries produced by one major company', + 'Fluorescent lighbulbs have lifetimes that ', 'Scores on a standardized exam', + 'Length of snowboards in a boardshop' ); +@list2 = ('the length of skateboards in a skateshop', 'shelf lives of batteries produced by one major company', + 'lifetimes of fluorescent lightbulbs', 'the scores on a standardized exam', + 'the length of snowboards in a boardshop' ); +@mean = ( random( 30, 32, .1 ), random( 3, 5, .1 ), random( 5, 7, .1 ), + random( 500, 550, 1), random( 150, 153, .1 ) ); +@sd = ( random( .1, 1, .1 ), random(.1, 1, .1 ), random(1, 1.6, .1 ), + random( 50, 100, 1 ), random( .1, 1, .1 ) ); +@unit = ( 'in', 'years', 'years', '', 'cm' ); +$ind = random( 0, 4, 1 ); + +@val = ( .67 * $sd[$ind], $sd[$ind], 2 * $sd[$ind] ); +@zscore = ( .67, 1, 2 ); +@slice = NchooseK( 3, 2 ); +$a = $mean[$ind] - $val[$slice[0]]; +$b = $mean[$ind] + $val[$slice[1]]; + +@tmp = split ' ', $list2[$ind]; +$tmp[0] = ucfirst $tmp[0]; +for($i = 1; $i < scalar @tmp; $i++){ + $val = $tmp[$i]; + if (length $val > 2 && $val ne 'the'){ + $val = ucfirst ($val); + $tmp[$i] = $val; + } +} + +$title = join ' ', @tmp; + +$diagram = DrawNormalDist( -$zscore[$slice[0]], $zscore[$slice[1]], $a, $b, outside => $shade, title => $title ); +$diagram1 = DrawNormalDist( $zscore[$slice[1]], -99, $zscore[$slice[1]], "", outside => 1, title => $title ); +$diagram2 = DrawNormalDist( -$zscore[$slice[0]], -99, $zscore[$slice[0]], "", outside => 1, title => $title ); + +$newz1prob = Real(normal_prob(-99, $zscore[$slice[1]])); +$newz0prob = Real(normal_prob(-99, -$zscore[$slice[0]])); +$totalprob = ($newz1prob-$newz0prob); + + +if( $shade == 0 ){ @prop = ( .25, .34, .475 ); + $l = $prop[$slice[0]]; + $r = $prop[$slice[1]]; + $ans = $l + $r; +}else{ @prop = ( .25, .16, .025 ); + $l = $prop[$slice[0]]; + $r = $prop[$slice[1]]; + $ans = $l + $r; +} +BEGIN_TEXT + +$list[$ind] are Normally distributed with a mean of \($mean[$ind]\) $unit[$ind] and a standard deviation of +\($sd[$ind]\) $unit[$ind]. The figure below shows the distribution of $list2[$ind]. +Calculate the shaded area under the curve. $PAR + \{ans_rule( 15 )\} +$PAR +$BCENTER +\{Plot($diagram, tex_size=>900);\} +$ECENTER + +END_TEXT +Context("Numeric"); + +Context()->flags->set(tolerance=>0.00001); + +$ans = Real("$ans"); + +if (Compute($ans) == 0.0015) +{$ans = OneOf($ans,0.001349898);} +elsif (Compute($ans) == 0.003) +{$ans = OneOf($ans,0.002699796);} +elsif (Compute($ans) == 0.0235) +{$ans = OneOf($ans,0.021400234);} +elsif (Compute($ans) == 0.025) +{$ans = OneOf($ans,0.022750132);} +elsif (Compute($ans) == 0.0265) +{$ans = OneOf($ans,0.024100030);} +elsif (Compute($ans) == 0.05) +{$ans = OneOf($ans,0.045500264);} +elsif (Compute($ans) == 0.09) +{$ans = OneOf($ans,0.092773641);} +elsif (Compute($ans) == 0.135) +{$ans = OneOf($ans,0.135905122);} +elsif (Compute($ans) == 0.1585) +{$ans = OneOf($ans,0.157305356);} +elsif (Compute($ans) == 0.16) +{$ans = OneOf($ans,0.158655254);} +elsif (Compute($ans) == 0.1615) +{$ans = OneOf($ans,0.160005152);} +elsif (Compute($ans) == 0.185) +{$ans = OneOf($ans,0.181405386);} +elsif (Compute($ans) == 0.225) +{$ans = OneOf($ans,0.228678763);} +elsif (Compute($ans) == 0.2485) +{$ans = OneOf($ans,0.250078997);} +elsif (Compute($ans) == 0.25) +{$ans = OneOf($ans,0.248571105,0.251428895);} +elsif (Compute($ans) == 0.2515) +{$ans = OneOf($ans,0.252778793);} +elsif (Compute($ans) == 0.275) +{$ans = OneOf($ans,0.274179027);} +elsif (Compute($ans) == 0.32) +{$ans = OneOf($ans,0.317310508);} +elsif (Compute($ans) == 0.34) +{$ans = OneOf($ans,0.341344746);} +elsif (Compute($ans) == 0.41) +{$ans = OneOf($ans,0.410084149);} +elsif (Compute($ans) == 0.475) +{$ans = OneOf($ans,0.477249868);} +elsif (Compute($ans) == 0.4985) +{$ans = OneOf($ans,0.498650102);} +elsif (Compute($ans) == 0.5) +{$ans = OneOf($ans,0.497142210,0.502857790);} +elsif (Compute($ans) == 0.5015) +{$ans = OneOf($ans,0.501349898);} +elsif (Compute($ans) == 0.525) +{$ans = OneOf($ans,0.522750132);} +elsif (Compute($ans) == 0.59) +{$ans = OneOf($ans,0.589915851);} +elsif (Compute($ans) == 0.66) +{$ans = OneOf($ans,0.658655254);} +elsif (Compute($ans) == 0.725) +{$ans = OneOf($ans,0.725820973);} +elsif (Compute($ans) == 0.7485) +{$ans = OneOf($ans,0.747221207);} +elsif (Compute($ans) == 0.75) +{$ans = OneOf($ans,0.748571105,0.751428895);} +elsif (Compute($ans) == 0.7515) +{$ans = OneOf($ans,0.749921003);} +elsif (Compute($ans) == 0.775) +{$ans = OneOf($ans,0.771321237);} +elsif (Compute($ans) == 0.815) +{$ans = OneOf($ans,0.818594614);} +elsif (Compute($ans) == 0.8385) +{$ans = OneOf($ans,0.839994848);} +elsif (Compute($ans) == 0.84) +{$ans = OneOf($ans,0.841344746);} +elsif (Compute($ans) == 0.8415) +{$ans = OneOf($ans,0.842694644);} +elsif (Compute($ans) == 0.865) +{$ans = OneOf($ans,0.864094878);} +elsif (Compute($ans) == 0.91) +{$ans = OneOf($ans,0.907226359);} +elsif (Compute($ans) == 0.95) +{$ans = OneOf($ans,0.954499736);} +elsif (Compute($ans) == 0.9675) +{$ans = OneOf($ans , 0.978599766);} +elsif (Compute($ans) == 0.9735) +{$ans = OneOf($ans,0.975899970);} +elsif (Compute($ans) == 0.975) +{$ans = OneOf($ans,0.977249868);} +elsif (Compute($ans) == 0.997) +{$ans = OneOf($ans,0.997300204);} +elsif (Compute($ans) == 0.9985) +{$ans = OneOf($ans,0.998650102);} + +Context("Percent"); +@possibilities = $ans->value; +@newpos = (); +for my $i (@possibilities) {push(@newpos,Percent($i))}; +$ans = OneOf(@newpos); + +Context()->flags->set(tolerance=>0.01); + +ANS( $ans->cmp ); + +#################################################### +##Solution +#################################################### + +BEGIN_SOLUTION + +The area between two specific \(z\)-scores cannot be calculated directly with many forms of technology. It is easier to find the area to the left of the larger \(z\)-score and then the areal to the left of the smaller \(z\)-score and find the difference between them. +$PAR +In this question we have a mean of \($mean[$ind]\) $unit[$ind] and standard deviation \($sd[$ind]\) $unit[$ind]. For the larger data of \($b\) $unit[$ind], we find a \(z\)-score of \(z=\frac{$b-$mean[$ind]}{$sd[$ind]}=$zscore[$slice[1]]\). For this \(z\)-score, we find the area below it to be \(\approx $newz1prob\), which can be seen in the diagram below. +$PAR +\{Plot($diagram1, tex_size=>900);\} +$PAR +For the smaller data \($a\) $unit[$ind], we find a \(z\)-score of \(z=\frac{$a-$mean[$ind]}{$sd[$ind]}=-$zscore[$slice[0]]\). For this \(z\)-score, we find the area below it to be \(\approx $newz0prob\), which can be seen in the diagram below. +$PAR +\{Plot($diagram2, tex_size=>900);\} +$PAR +Subtracting the smaller area from the larger, we find the area in between to be \($newz1prob-$newz0prob =$totalprob\) + +END_SOLUTION + +ENDDOCUMENT(); + + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/normal_dist3.pg b/Contrib/PCC/Statistics/zScoresInGeneral/normal_dist3.pg new file mode 100644 index 0000000000..31c4203ccc --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/normal_dist3.pg @@ -0,0 +1,231 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Continuous Random Variables and Their Probability Distributions') +## DBsection('The Normal Probability Distribution') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/15/05; Modified 08/18.10 +# modified by J. Hagood +# Location: Northern Arizona University + +DOCUMENT(); + +loadMacros("PGstandard.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "MathObjects.pl", + "parserOneOf.pl", + "contextPercent.pl", + "PGauxiliaryFunctions.pl", + "PGasu.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", +); + +TEXT(&beginproblem); + +@list = ( 'Length of skateboards in a skateshop', 'The shelf life of a batteries produced by one major company', + 'Fluorescent lighbulbs have lifetimes that ', 'Scores on a standardized exam', + 'Length of snowboards in a boardshop' ); +@list2 = ('the length of skateboards in a skateshop', 'shelf lives of batteries produced by one major company', + 'lifetimes of fluorescent lightbulbs', 'the scores on a standardized exam', + 'the length of snowboards in a boardshop' ); +@mean = ( random( 30, 32, .1 ), random( 3, 5, .1 ), random( 5, 7, .1 ), + random( 500, 550, 1), random( 150, 153, .1 ) ); +@sd = ( random( .1, 1, .1 ), random(.1, 1, .1 ), random(1, 1.6, .1 ), + random( 50, 100, 1 ), random( .1, 1, .1 ) ); +$ind = random( 0, 4, 1 ); +@unit = ( 'in', 'years', 'years', '', 'cm' ); +$shade = list_random( 0, 1 ); +$fact = list_random( -1, 1 ); +@val = ( .67 * $sd[$ind], $sd[$ind], 2 * $sd[$ind] ); +@zscore = ( .67, 1, 2 ); +@prop = ( .25, .34, .475 ); +$s1 = list_random( 0, 1 ); +push @slice, $s1, 2; +$a1 = $prop[$slice[1]]; +$a2 = $prop[$slice[0]]; +$z = $val[$slice[1]]; +$y = $val[$slice[0]]; +$z1 = $zscore[$slice[1]]; +$z2 = $zscore[$slice[0]]; + +if( $fact == -1 ){$a = $mean[$ind] - $z; + $b = $mean[$ind] - $y; + $newz1 = -$z1; + $newz2 = -$z2; + if( $shade == 0 ){ + $ans = $a1 - $a2; + }else{$ans = 1 - ( $a1 - $a2 ); + } +}else{ $a = $mean[$ind] + $y; + $b = $mean[$ind] + $z; + $newz1 = $z2; + $newz2 = $z1; + if( $shade == 0 ){ + $ans = $a1 - $a2; + }else{$ans = 1 - ( $a1 - $a2 ); + } +} + +@tmp = split ' ', $list2[$ind]; +$tmp[0] = ucfirst $tmp[0]; +for($i = 1; $i < scalar @tmp; $i++){ + $val = $tmp[$i]; + if (length $val > 2 && $val ne 'the'){ + $val = ucfirst ($val); + $tmp[$i] = $val; + } +} + +$title = join ' ', @tmp; + +$diagram = DrawNormalDist( $newz1, $newz2, $a, $b, outside => $shade, title => $title ); +$diagram1 = DrawNormalDist( $newz1, -99, $newz1, "", outside => 1, title => $title ); +$diagram2 = DrawNormalDist( $newz2, -99, $newz2, "", outside => 1, title => $title ); +$newz1prob = Real(normal_prob(-99, $newz1)); +$newz2prob = Real(normal_prob(-99, $newz2)); +$totalprob = ($newz2prob-$newz1prob); +; +BEGIN_TEXT + +$list[$ind] are normally distributed with a mean of \($mean[$ind]\) $unit[$ind] and a standard deviation of +\($sd[$ind]\) $unit[$ind]. The figure below shows the distribution of $list2[$ind]. +Calculate the shaded area under the curve. $PAR +\{ans_rule( 15 )\} +$PAR +$BCENTER +\{Plot($diagram, tex_size=>900)\} +$ECENTER +END_TEXT + + +Context("Numeric"); + +Context()->flags->set(tolerance=>0.00001); + +$ans = Real("$ans"); + +if (Compute($ans) == 0.0015) +{$ans = OneOf($ans,0.001349898);} +elsif (Compute($ans) == 0.003) +{$ans = OneOf($ans,0.002699796);} +elsif (Compute($ans) == 0.0235) +{$ans = OneOf($ans,0.021400234);} +elsif (Compute($ans) == 0.025) +{$ans = OneOf($ans,0.022750132);} +elsif (Compute($ans) == 0.0265) +{$ans = OneOf($ans,0.024100030);} +elsif (Compute($ans) == 0.05) +{$ans = OneOf($ans,0.045500264);} +elsif (Compute($ans) == 0.09) +{$ans = OneOf($ans,0.092773641);} +elsif (Compute($ans) == 0.135) +{$ans = OneOf($ans,0.135905122);} +elsif (Compute($ans) == 0.1585) +{$ans = OneOf($ans,0.157305356);} +elsif (Compute($ans) == 0.16) +{$ans = OneOf($ans,0.158655254);} +elsif (Compute($ans) == 0.1615) +{$ans = OneOf($ans,0.160005152);} +elsif (Compute($ans) == 0.185) +{$ans = OneOf($ans,0.181405386);} +elsif (Compute($ans) == 0.225) +{$ans = OneOf($ans,0.228678763);} +elsif (Compute($ans) == 0.2485) +{$ans = OneOf($ans,0.250078997);} +elsif (Compute($ans) == 0.25) +{$ans = OneOf($ans,0.248571105,0.251428895);} +elsif (Compute($ans) == 0.2515) +{$ans = OneOf($ans,0.252778793);} +elsif (Compute($ans) == 0.275) +{$ans = OneOf($ans,0.274179027);} +elsif (Compute($ans) == 0.32) +{$ans = OneOf($ans,0.317310508);} +elsif (Compute($ans) == 0.34) +{$ans = OneOf($ans,0.341344746);} +elsif (Compute($ans) == 0.41) +{$ans = OneOf($ans,0.410084149);} +elsif (Compute($ans) == 0.475) +{$ans = OneOf($ans,0.477249868);} +elsif (Compute($ans) == 0.4985) +{$ans = OneOf($ans,0.498650102);} +elsif (Compute($ans) == 0.5) +{$ans = OneOf($ans,0.497142210,0.502857790);} +elsif (Compute($ans) == 0.5015) +{$ans = OneOf($ans,0.501349898);} +elsif (Compute($ans) == 0.525) +{$ans = OneOf($ans,0.522750132);} +elsif (Compute($ans) == 0.59) +{$ans = OneOf($ans,0.589915851);} +elsif (Compute($ans) == 0.66) +{$ans = OneOf($ans,0.658655254);} +elsif (Compute($ans) == 0.725) +{$ans = OneOf($ans,0.725820973);} +elsif (Compute($ans) == 0.7485) +{$ans = OneOf($ans,0.747221207);} +elsif (Compute($ans) == 0.75) +{$ans = OneOf($ans,0.748571105,0.751428895);} +elsif (Compute($ans) == 0.7515) +{$ans = OneOf($ans,0.749921003);} +elsif (Compute($ans) == 0.775) +{$ans = OneOf($ans,0.771321237);} +elsif (Compute($ans) == 0.815) +{$ans = OneOf($ans,0.818594614);} +elsif (Compute($ans) == 0.8385) +{$ans = OneOf($ans,0.839994848);} +elsif (Compute($ans) == 0.84) +{$ans = OneOf($ans,0.841344746);} +elsif (Compute($ans) == 0.8415) +{$ans = OneOf($ans,0.842694644);} +elsif (Compute($ans) == 0.865) +{$ans = OneOf($ans,0.864094878);} +elsif (Compute($ans) == 0.91) +{$ans = OneOf($ans,0.907226359);} +elsif (Compute($ans) == 0.95) +{$ans = OneOf($ans,0.954499736);} +elsif (Compute($ans) == 0.9675) +{$ans = OneOf($ans , 0.978599766);} +elsif (Compute($ans) == 0.9735) +{$ans = OneOf($ans,0.975899970);} +elsif (Compute($ans) == 0.975) +{$ans = OneOf($ans,0.977249868);} +elsif (Compute($ans) == 0.997) +{$ans = OneOf($ans,0.997300204);} +elsif (Compute($ans) == 0.9985) +{$ans = OneOf($ans,0.998650102);} + +Context("Percent"); +@possibilities = $ans->value; +@newpos = (); +for my $i (@possibilities) {push(@newpos,Percent($i))}; +$ans = OneOf(@newpos); + +Context()->flags->set(tolerance=>0.01); + +ANS( $ans->cmp ); + +#################################################### +##Solution +#################################################### + +BEGIN_SOLUTION + +The area between two specific \(z\)-scores cannot be calculated directly with many forms of technology. It is easier to find the area to the left of the larger \(z\)-score and then the areal to the left of the smaller \(z\)-score and find the difference between them. +$PAR +In this question we have a mean of \($mean[$ind]\) $unit[$ind] and standard deviation \($sd[$ind]\) $unit[$ind]. For the larger data of \($b\) $unit[$ind], we find a \(z\)-score of \(z=\frac{$b-$mean[$ind]}{$sd[$ind]}=$newz2\). For this \(z\)-score, we find the area below it to be \(\approx $newz2prob\), which can be seen in the diagram below. +$PAR +\{Plot($diagram2, tex_size=>900);\} +$PAR +For the smaller data \($a\) $unit[$ind], we find a \(z\)-score of \(z=\frac{$a-$mean[$ind]}{$sd[$ind]}=$newz1\). For this \(z\)-score, we find the area below it to be \(\approx $newz1prob\), which can be seen in the diagram below. +$PAR +\{Plot($diagram1, tex_size=>900);\} +$PAR +Subtracting the smaller area from the larger, we find the area in between to be \($newz2prob-$newz1prob = $totalprob\) + +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/normal_quartile1.pg b/Contrib/PCC/Statistics/zScoresInGeneral/normal_quartile1.pg new file mode 100644 index 0000000000..3d532ed22f --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/normal_quartile1.pg @@ -0,0 +1,64 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Quartiles') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/05/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "MathObjects.pl", + +); + +TEXT( &beginproblem ); +@list1 = ( 'lower', 'first' ); +@list2 = ( 'upper', 'third' ); +$ind = random( 0, 1, 1); + +do{ $mean = random(150, 600, 1); + $sd = random( 30, 100, 1); +} until( $mean - 3 * $sd > 0 ); +$ans1 = $mean - .6745 * $sd; +$ans2 = $mean + .6745 * $sd; + + +BEGIN_TEXT + +The scores of students on an exam are Normally distributed with a mean of \($mean\) and a standard +deviation of \($sd\). +$PAR +(a) What is the $list1[$ind] quartile score for this exam? $BR +$SPACE $SPACE $SPACE\{ ans_rule ( 15 ) \} +$PAR +(b) What is the $list2[$ind] quartile score for this exam? $BR +$SPACE $SPACE $SPACE\{ ans_rule ( 15 ) \} + +END_TEXT + +ANS( Compute( $ans1)->cmp(tolType=>relative,tolerance=>.01)); +ANS( Compute( $ans2 )->cmp(tolType=>relative,tolerance=>.01) ); + +#################################################### +##Solution +#################################################### + +BEGIN_SOLUTION +(a) The $list1[$ind] quartile means that \(25$PERCENT\) of scores fall below the score in question. To find the score in question, we will need a \(z\)-score. Using inverse technology with an area of \(0.25\), we find \(z\approx \). This allows us to set up and solve a \(z\)-score equation. +$PAR +\(z=\frac{x-\bar{x}}{s_{x}}\). Using this we find, \(z=\frac{x-$mean}{$sd}\), which can be solved to find \(x\approx$ans1\). +$PAR +(b) The $list2[$ind] quartile means that \(75$PERCENT\) of sores fall below the score in question. To find the score in question, we will need a \(z\)-score. Using inverse technology with an area of \(0.75\), we find \(z\approx \). This allows us to set up and solve a \(z\)-score equation. +$PAR +\(z=\frac{x-\bar{x}}{s_{x}}\). Using this, we find, \(z=\frac{x-$mean}{$sd}\), which can be solved to find \(x\approx$ans2\). + +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/normprob1.pg b/Contrib/PCC/Statistics/zScoresInGeneral/normprob1.pg new file mode 100644 index 0000000000..16efd9a0e4 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/normprob1.pg @@ -0,0 +1,63 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('probability','statistics','normal','normal distribution') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/1/05 +# from pl/setProbability10NormalDist/ur_pb_10_10.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$s = random(800,1100,25); +do {$mu = random(500,1.1*$s,10);} until (abs($mu-$s)>10); +$sig = random(150,300,10); + +$z = Real(($s-$mu)/$sig); +$ans = Real(100*normal_prob('-infty', $s, mean=>$mu, deviation=>$sig)); + +BEGIN_TEXT + +The combined math and verbal scores for students taking a national standardized examination for college admission, is Normally distributed with a mean of \($mu\) and a standard deviation of \($sig\). If a college requires a minimum score of \($s\) +for admission, what percentage of students do not satisfy that requirement? $PAR + +\{ans_rule(10)\} of students do not satisfy that requirement. + +END_TEXT + +Context("Percent"); +ANS(Percent("$ans %")->cmp()); + +######################################################Solution +#################################################### + +BEGIN_SOLUTION + +To find what percentage of students do not satisfy that requirement, we will need to find a \(z\)-score for a test score of \($s\). +$PAR +Thus, we find \(z=\frac{$s-$mu}{$sig}=$z\). Using technology we find that \(\text{P}(z<$z)\approx $ans$PERCENT\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/normprob2.pg b/Contrib/PCC/Statistics/zScoresInGeneral/normprob2.pg new file mode 100644 index 0000000000..4298179742 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/normprob2.pg @@ -0,0 +1,71 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('probability','statistics','normal','normal distribution') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/1/05 +# from pl/setProbability10NormalDist/ur_pb_10_10.pg) +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"PGauxiliaryFunctions.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$p = random(10,40,5); +$mu = random(500,900,10); +$sig = random(150,300,10); +$q = 50-$p; +$leftp = (100-$p); +$leftarea = ($leftp/100); +$ans = Real(normal_distr($q/100, mean=>$mu, deviation=>$sig)); +$z = Real(($ans-$mu)/$sig); +$ansround = ceil($ans); + +BEGIN_TEXT + +The combined math and verbal scores for +students taking a national standardized examination for college admission is +Normally distributed with a mean of \($mu\) and a standard deviation of \($sig\). +If a college requires a student to be in the top \($p$PERCENT\) of students taking this test, +what is the minimum score that such a student can obtain and still qualify for admission at +the college? Remember that scores on this test are whole numbers. +$PAR +\{ans_rule(10)\} + +END_TEXT + +ANS(Compute(ceil($ans))->cmp(tolType=>absolute,tolerance=>0.5)); + +######################################################Solution +#################################################### + +BEGIN_SOLUTION + +To reach the top \($p$PERCENT\) of scores, means you have done better than \($leftp$PERCENT\) of all other people who take the test. To find the \(z\)-score that corresponds to the score that puts you in the top \($p$PERCENT\), we need to use the area corresponding to \($leftp$PERCENT\) since our technology can only "look left." +$PAR +Using inverse technology with an area of \($leftarea\), we find \(z=$z\). +$PAR +This allows us to find the score in question by using the \(z\)-score formula. Thus, we find \($z=\frac{x-$mu}{$sig}\) which can be solved to find \(x\approx $ans\). Since test scores must be a whole number and we want to be in the top \($p$PERCENT\), we will round our score up to \(x=$ansround\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Statistics/zScoresInGeneral/normprob3.pg b/Contrib/PCC/Statistics/zScoresInGeneral/normprob3.pg new file mode 100644 index 0000000000..e1ff5bdb06 --- /dev/null +++ b/Contrib/PCC/Statistics/zScoresInGeneral/normprob3.pg @@ -0,0 +1,85 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/2/05 +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl" +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; + +$p1 = random(5,45,5); +$x1 = random(1,10,1); +$p2 = random(55,95,5); +$x2 = random(11,20,1); +$prop1 = ($p1/100); +$prop2 = ($p2/100); + +$z1 = Real(-normal_distr(.5-$p1/100, mean=>0, deviation=>1)); +$z2 = Real(normal_distr($p2/100-.5, mean=>0, deviation=>1)); +$sig = ($x2-$x1)/($z2-$z1); +$mu = $x1-$sig*$z1; + +BEGIN_TEXT +Consider a Normal distribution curve where \($p2\)-th percentile is at \($x2\) and the \($p1\)-th percentile is at \($x1\). +Use this information to find the mean, \(\mu\) , and the standard deviation, \(\sigma \), of the distribution. This is basically an algebra problem where you have two equations in two unknowns, and you must solve for the two unknowns. +$PAR +a) $SPACE\(\mu =\) \{ans_rule(20)\}$BR$BR +b) $SPACE\(\sigma =\) \{ans_rule(20)\}$BR + + + +END_TEXT + +ANS(Compute($mu)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute($sig)->cmp(tolType=>relative,tolerance=>.01)); + +#################################################### +## Solutions +#################################################### + +BEGIN_SOLUTION + +First we will find the \(z\)-scores that correspond to the \($p2\)-th and \($p1\)-th percentile. Using inverse technology with area \($prop2\) and \($prop1\) we find \(z=$z2\) and \(z=$z1\) respectively. +$PAR +This allows us to build two equations involving \(z\)-scores, +$PAR +\($z2=\frac{$x2-\mu}{\sigma}\) and \($z1=\frac{$x1-\mu}{\sigma}\) +$PAR +Solving each for \(\mu\), we find, +$PAR +\(\mu = $x2-(\sigma\cdot$z2)\) and \(\mu = $x1-(\sigma\cdot$z1)\) respectively. +$PAR +Setting the two equations equal to each other we have, +$PAR +\($x2-(\sigma\cdot$z2)=$x1-(\sigma\cdot$z1)\) +$PAR +This can solved to find \(\sigma = $sig\). +$PAR +The value \(\sigma=$sig\) can then be used in the either equation of \($z2=\frac{$x2-\mu}{\sigma}\) or \($z2=\frac{$x2-\mu}{\sigma}\) to find \(\mu\). Either equation can be solved to find \(\mu=$mu\) + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/Contrib/PCC/Trigonometry/AngleBasics/ArcLength10.pg b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength10.pg new file mode 100644 index 0000000000..4ca7f57cc1 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength10.pg @@ -0,0 +1,80 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$radius = random(2,9,1); + +$angle = random(5,355,5); +$answer = $radius*$angle*pi/180; + +#################################### + +BEGIN_PGML +Find the length of an arc on a circle of radius [`[$radius]`] units corresponding to an angle of [`[$angle]^{\circ}`]. + + Arc length = [____________]{$answer} units + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. + +In order to change from degrees to radians, we multiply the +angle's measure by [` \frac{\pi}{180^{\circ}} `], so we have [` [$angle]^{\circ} \cdot \frac{\pi}{180^{\circ}} `] radians. + +The full solution is: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + &= [$radius] \cdot [$angle]^{\circ} \cdot \frac{\pi}{180^{\circ}} \\ + &\approx [$answer] +\end{aligned} + ``] + +Thus our arc length is [` [$answer] `] units. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/ArcLength20.pg b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength20.pg new file mode 100644 index 0000000000..37f2795b5b --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength20.pg @@ -0,0 +1,82 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$radius = random(2,9,1); +$diameter = 2*$radius; + +$angle = random(0.5,6,0.5); +$answer = $radius*$angle; + +Context()->operators->undefine("+","-","*","/","^","**"); + +#################################### + +BEGIN_PGML +Find the length of an arc on a circle of diameter [`[$diameter]`] units corresponding to an angle of [`[$angle]`] radians. + + Arc length = [____________]{$answer} units + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. + +In this problem, diameter is given. Don't forget to calculate the radius length by [` \text{diameter =} 2\cdot \text{radius}`]. + +The full solution is: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + &= \frac{[$diameter]}{2} \cdot [$angle] \\ + &= [$answer] +\end{aligned} + ``] + +Thus the arc length is [` [$answer] `] units. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/ArcLength30.pg b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength30.pg new file mode 100644 index 0000000000..121c5717d0 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength30.pg @@ -0,0 +1,87 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$radius = random(2,9,1); +$degree = random(5,355,5); +$arc = Compute("$radius*$degree*pi/180"); + +$arc = int($arc); +$radian = $arc/$radius; +$degree = $radian*180/pi; + + +#################################### + +BEGIN_PGML + +If the arc length on a circle of radius [`[$radius]`] units is [`[$arc]`] units. Find the corresponding central angle's measure in both radian and degrees. + + Angle (in radian) = [____________]{$radian} radians + + Angle (in degree) = [____________]{$degree} degrees + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. + +Here is how to calculate the angle: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + \theta &= \frac{s}{r} \\ + &= \frac{[$arc]}{[$radius]} \\ + &\approx [$radian] \text{ radians} \\ + &= [$radian] \cdot \frac{180^{\circ}}{\pi} \\ + &\approx [$degree]^{\circ} +\end{aligned} + ``] + +Thus the angle's measure is [` [$radian] `] radians, or [`[$degree]^{\circ}`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/ArcLength40.pg b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength40.pg new file mode 100644 index 0000000000..197640631b --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength40.pg @@ -0,0 +1,117 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$unit = list_random("in","cm"); + +$short = random(2,9,1); +$shortU = NumberWithUnits("$short $unit"); +$long = $short + random(1,3,1); +$longU = NumberWithUnits("$long $unit"); + +$hour = random(2,11,0.25); +$hourU = NumberWithUnits("$hour hr"); + +$arcLong = $long*$hour*360*pi/180; +$arcLongU = NumberWithUnits("$arcLong $unit"); +$arcShort = $short*$hour*30*pi/180; +$arcShortU = NumberWithUnits("$arcShort $unit"); + +Context()->operators->undefine("+","-","*","/","^","**"); + +#################################### + +BEGIN_PGML + +A clock's minute hand is [`[$longU]`] in length, and its hour hand is [`[$shortU]`] in length. If the clock ran [`[$hourU]`], how far did the tip of the hour hand travel? How far did the tip of the minute hand travel? + +[@KeyboardInstructions( +"\n" +.'* Please include units in your answers.' +)@]** + +The tip of the hour hand travelled [____________]{$arcShortU}. + +The tip of the minute hand travelled [____________]{$arcLongU}. + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +Each time the clock runs a hour, the hour hand travels [`30^{\circ}`], and the minute hand travels [`360^{\circ}`]. + +When the clock ran [`[$hourU]`], the hour hand travels [`[$hour]\cdot30^{\circ}`], and the minute hand travels [`[$hour]\cdot360^{\circ}`]. + +To calculate how far the tip of hour hand and minute hand travelled, we need to use the arc length formula: + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. Note that you need to change the angle to radian if it's given in degrees. + +To calculate how far the tip of the hour hand travelled, we have: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + &= [$shortU] \cdot [$hour]\cdot30^{\circ} \cdot \frac{\pi}{180^{\circ}} \\ + &\approx [$arcShortU] +\end{aligned} + ``] + +The tip of the hour hand travelled [`[$arcShortU]`]. + +To calculate how far the tip of the minute hand travelled, we have: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + &= [$longU] \cdot [$hour]\cdot360^{\circ} \cdot \frac{\pi}{180^{\circ}} \\ + &\approx [$arcLongU] +\end{aligned} + ``] + +The tip of the minute hand travelled [`[$arcLongU]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/ArcLength50.pg b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength50.pg new file mode 100644 index 0000000000..78251098b2 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength50.pg @@ -0,0 +1,95 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$unit = "mi"; + +$degreeA = random(5,15,0.1); +$degreeDif = random(1,10,0.1); +$degreeB = $degreeA + $degreeDif; + +$arc = $degreeDif*3960*pi/180; +$arcU = NumberWithUnits("$arc $unit"); + +Context()->operators->undefine("+","-","*","/","^","**"); + +#################################### + +BEGIN_PGML + +Two cities have the same longitude. The latitude of city A is [`[$degreeA]^{\circ}`] north and the latitude of city B is [`[$degreeB]^{\circ}`] north. Assume the radius of the earth is [`3960`] miles. Find the distance between the two cities. + +[@KeyboardInstructions( +"\n" +.'* Please include units in your answers.' +)@]** + +The distance between those two cities is [____________]{$arcU}. + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +Those difference between those two cities's latitude is [`[$degreeB]^{\circ}-[$degreeA]^{\circ}=[$degreeDif]^{\circ}`]. + +To calculate the length of the arc between those two cities along the longtitude, we need to use the arc length formula: + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. Note that you need to change the angle to radian if it's given in degrees. + +To calculate the arc length, we have: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + &= 3960 \text{ mi} \cdot [$degreeDif]^{\circ}\cdot \frac{\pi}{180^{\circ}} \\ + &\approx [$arcU] +\end{aligned} + ``] + +The distance between those two cities is [`[$arcU]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/ArcLength60.pg b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength60.pg new file mode 100644 index 0000000000..49de28be84 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/ArcLength60.pg @@ -0,0 +1,88 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$radius = random(2,5,0.1); +$degree = random(15,300,5); +$arc = Compute("$radius*$degree*pi/180"); + +$arc = int($arc); +$radian = Compute("$arc/$radius"); +$degree = $radian*180/pi; + +Context()->operators->undefine("+","-","*","/","^","**"); + +#################################### + +BEGIN_PGML + +A person walked [`[$arc]`] miles along the bank of a circular lake. If the radius of the lake is [`[$radius]`] miles, what's the angle, in degrees, of the person's final position relative to his starting position? + + Angle (in degree) = [____________]{$degree} degrees + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +The person walked [`[$arc]`] miles along the circular bank. This is the arc length of the arc of the circle. The lake's radius is also given as [`[$raidus]`] miles. + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. Note that we have to change radian to degree by multiplying [`\frac{180^{\circ}}{\pi}`]. + +Here is how to calculate the angle: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + \theta &= \frac{s}{r} \\ + &= \frac{[$arc]}{[$radius]} \\ + &\approx [$radian] \text{ radians} \\ + &= [$radian] \cdot \frac{180^{\circ}}{\pi} \\ + &\approx [$degree]^{\circ} +\end{aligned} + ``] + +Thus the angle's measure is [`[$degree]^{\circ}`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian10.pg b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian10.pg new file mode 100644 index 0000000000..eee6209b60 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian10.pg @@ -0,0 +1,89 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +do {$a = 15*random(1,29,1);} until ($a != 180); +$frac = Fraction($a,180)->reduce; +($num,$den) = $frac->value; + +Context("LimitedRadical"); +$ans1 = $num==1 ? Formula("pi/$den") : Formula("$num*pi/$den"); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$dec = Real("$a*pi/180"); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +What is the exact radian angle measure for [` [$a]^{\circ} `] as a fraction of [` \pi `]? + +[@KeyboardInstructions( +"\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use fraction in your answer.' +)@]** + + [`` [$a]^{\circ} =``][__________]{$ans1}[`\text{ radians}`] + +What is a decimal approximation for the radian angle measure for [` [$a]^{\circ} `] accurate to at least two decimal places? + + [`` [$a]^{\circ} \approx ``][__________]{$dec}[`\text{ radians}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$a]^{\circ} `] to radians, multiply by [` \frac{\pi}{180^{\circ}} `]: + + [`` [$a]^{\circ} \cdot \left( \frac{\pi}{180^{\circ}} \right) = [$frac]\pi \text{ radians}``] + +A calculator can convert [`[$frac]\pi`] to [`[$dec]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian20.pg b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian20.pg new file mode 100644 index 0000000000..8f20802b40 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian20.pg @@ -0,0 +1,87 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +do {$a = -15*random(1,29,1);} until ($a != -180); +$frac = Fraction($a,180)->reduce; +($num,$den) = $frac->value; + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$ans1 = specialAngle($num*pi/$den, (2,3,4,5,6,8,10,12,15,18)); +$dec = Real("$a*pi/180"); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +What is the exact radian angle measure for [` [$a]^{\circ} `] as a fraction of [` \pi `]? + +[@KeyboardInstructions( +"\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use fraction in your answer.' +)@]** + + [`` [$a]^{\circ} =``][__________]{$ans1}[` \text{ radians}`] + +What is a decimal approximation for the radian angle measure for [` [$a]^{\circ} `] accurate to at least two decimal places? + + [`` [$a]^{\circ} \approx ``][__________]{$dec}[`\text{ radians}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$a]^{\circ} `] to radians, multiply by [` \frac{\pi}{180^{\circ}} `]: + + [`` [$a]^{\circ} \cdot \left( \frac{\pi}{180^{\circ}} \right) = [$ans1] \text{ radians}``] + +A calculator can convert [`[$ans1]`] to [`[$dec]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian30.pg b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian30.pg new file mode 100644 index 0000000000..9ad82850d0 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian30.pg @@ -0,0 +1,65 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +do {$a = 15*random(1,29,1);} until ($a != 180); +$frac = Fraction($a,180)->reduce; + +Context("Numeric"); + +$dec = Real("$a*pi/180"); + +Context()->operators->undefine("+","-","*","/","^","**"); + +############################################## + +BEGIN_PGML + +What is the degree angle measure for [` [$frac]\pi `]? + + [`` [$frac]\pi =``][__________]{$a}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$frac]\pi `] to degrees, multiply by [` \frac{180^{\circ}}{\pi} `]: + + [`` [$frac]\pi \cdot \left( \frac{180^{\circ}}{\pi} \right) = [$a]^{\circ}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian35.pg b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian35.pg new file mode 100644 index 0000000000..e4ea756b80 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian35.pg @@ -0,0 +1,63 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$a = random(1,10,0.1)*random(-1,1,2); +$d = Real("$a*180/pi"); + +Context()->operators->undefine("+","-","*","/","^","**"); + +############################################## + +BEGIN_PGML + +What is the degree angle measure for [` [$a] \text{ radians}`]? Round your answers to at least 2 decimal places. + + [`` [$a] \text{ radians} =``][__________]{$d}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$a] \text{ radians} `] to degrees, multiply by [` \frac{180^{\circ}}{\pi} `]: + + [`` [$a] \cdot \left( \frac{180^{\circ}}{\pi} \right) = [$d]^{\circ}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian40.pg b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian40.pg new file mode 100644 index 0000000000..58c64af3f5 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian40.pg @@ -0,0 +1,65 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +do {$a = -15*random(1,29,1);} until ($a != -180); +$frac = Fraction($a,180)->reduce; + +Context("Numeric"); + +$dec = Real("$a*pi/180"); + +Context()->operators->undefine("+","-","*","/","^","**"); + +############################################## + +BEGIN_PGML + +What is the degree angle measure for [` [$frac]\pi `]? + + [`` [$frac]\pi =``][__________]{$a}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$frac]\pi `] to degrees, multiply by [` \frac{180^{\circ}}{\pi} `]: + + [`` [$frac]\pi \cdot \left( \frac{180^{\circ}}{\pi} \right) = [$a]^{\circ}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian50.pg b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian50.pg new file mode 100644 index 0000000000..940df391f3 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian50.pg @@ -0,0 +1,154 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +@d = ( + 30, 45, 60, 90, 120, 135, 150, 180, + 210, 225, 240, 270, 300, 315, 330, 360 +); +@r = ( + Formula("pi/6"), Formula("pi/4"), Formula("pi/3"), Formula("pi/2"), + Formula("2*pi/3"), Formula("3*pi/4"), Formula("5*pi/6"), Formula("pi"), + Formula("7*pi/6"), Formula("5*pi/4"), Formula("4*pi/3"), + Formula("3*pi/2"), Formula("5*pi/3"), Formula("7*pi/4"), + Formula("11*pi/6"), Formula("2*pi") +); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +You should be able to do the following frequently-used degree-radian conversions fluently. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + [`` [$d[0]]^{\circ} =``][__________]{$r[0]}[`\text{ radians}`] + + [`` [$d[1]]^{\circ} =``][__________]{$r[1]}[`\text{ radians}`] + + [`` [$d[2]]^{\circ} =``][__________]{$r[2]}[`\text{ radians}`] + + [`` [$d[3]]^{\circ} =``][__________]{$r[3]}[`\text{ radians}`] + + [`` [$d[4]]^{\circ} =``][__________]{$r[4]}[`\text{ radians}`] + + [`` [$d[5]]^{\circ} =``][__________]{$r[5]}[`\text{ radians}`] + + [`` [$d[6]]^{\circ} =``][__________]{$r[6]}[`\text{ radians}`] + + [`` [$d[7]]^{\circ} =``][__________]{$r[7]}[`\text{ radians}`] + + [`` [$d[8]]^{\circ} =``][__________]{$r[8]}[`\text{ radians}`] + + [`` [$d[9]]^{\circ} =``][__________]{$r[9]}[`\text{ radians}`] + + [`` [$d[10]]^{\circ} =``][__________]{$r[10]}[`\text{ radians}`] + + [`` [$d[11]]^{\circ} =``][__________]{$r[11]}[`\text{ radians}`] + + [`` [$d[12]]^{\circ} =``][__________]{$r[12]}[`\text{ radians}`] + + [`` [$d[13]]^{\circ} =``][__________]{$r[13]}[`\text{ radians}`] + + [`` [$d[14]]^{\circ} =``][__________]{$r[14]}[`\text{ radians}`] + + [`` [$d[15]]^{\circ} =``][__________]{$r[15]}[`\text{ radians}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` 30^{\circ} `] to radians, multiply by [` \frac{\pi}{180^{\circ}} `]: + + [`` 30^{\circ} \cdot \left( \frac{\pi}{180^{\circ}} \right) = [$r[0]] \text{ radians}``] + +Starting [` 30^{\circ} = [$r[0]] `], list multiples of [` 30^{\circ} `]: + + [`` 30^{\circ} = [$r[0]] ``] + + [`` 60^{\circ} = 2\cdot[$r[0]] = [$r[2]]``] + + [`` 90^{\circ} = 3\cdot[$r[0]] = [$r[3]]``] + + [`` 120^{\circ} = 4\cdot[$r[0]] = [$r[4]]``] + + [`` 150^{\circ} = 5\cdot[$r[0]] = [$r[6]]``] + + [`` 180^{\circ} = 6\cdot[$r[0]] = [$r[7]]``] + + [`` 210^{\circ} = 7\cdot[$r[0]] = [$r[8]]``] + + [`` 240^{\circ} = 8\cdot[$r[0]] = [$r[10]]``] + + [`` 270^{\circ} = 9\cdot[$r[0]] = [$r[11]]``] + + [`` 300^{\circ} = 10\cdot[$r[0]] = [$r[12]]``] + + [`` 330^{\circ} = 11\cdot[$r[0]] = [$r[14]]``] + + [`` 360^{\circ} = 12\cdot[$r[0]] = [$r[15]]``] + +---- + +To convert [` 45^{\circ} `] to radians, multiply by [` \frac{\pi}{180^{\circ}} `]: + + [`` 45^{\circ} \cdot \left( \frac{\pi}{180^{\circ}} \right) = [$r[1]] \text{ radians}``] + +Starting [` 45^{\circ} = [$r[1]] `], list multiples of [` 45^{\circ} `]: + + [`` 90^{\circ} = 2\cdot[$r[1]] = [$r[3]] ``] + + [`` 135^{\circ} = 3\cdot[$r[1]] = [$r[5]] ``] + + [`` 180^{\circ} = 4\cdot[$r[1]] = [$r[7]] ``] + + [`` 225^{\circ} = 5\cdot[$r[1]] = [$r[9]]``] + + [`` 270^{\circ} = 6\cdot[$r[1]] = [$r[11]] ``] + + [`` 315^{\circ} = 7\cdot[$r[1]] = [$r[13]] ``] + + [`` 360^{\circ} = 8\cdot[$r[1]] = [$r[15]] ``] +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian60.pg b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian60.pg new file mode 100644 index 0000000000..1671203776 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/DegreeAndRadian60.pg @@ -0,0 +1,132 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@d = ( + 30, 45, 60, 90, 120, 135, 150, 180, + 210, 225, 240, 270, 300, 315, 330, 360 +); +@r = ( + Formula("pi/6"), Formula("pi/4"), Formula("pi/3"), Formula("pi/2"), + Formula("(2pi)/3"), Formula("(3pi)/4"), Formula("(5pi)/6"), 1, + Formula("(7pi)/6"), Formula("(5pi)/4"), Formula("(4pi)/3"), + Formula("(3pi)/2"), Formula("(5pi)/3"), Formula("(7pi)/4"), + Formula("(11pi)/6"), Formula("2pi") +); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +You should be able to do the following frequently-used radian-degree conversions fluently. + + [`` [$r[0]] =``][__________]{$d[0]}[`^{\circ}`] + + [`` [$r[1]] =``][__________]{$d[1]}[`^{\circ}`] + + [`` [$r[2]] =``][__________]{$d[2]}[`^{\circ}`] + + [`` [$r[3]] =``][__________]{$d[3]}[`^{\circ}`] + + [`` [$r[4]] =``][__________]{$d[4]}[`^{\circ}`] + + [`` [$r[5]] =``][__________]{$d[5]}[`^{\circ}`] + + [`` [$r[6]] =``][__________]{$d[6]}[`^{\circ}`] + + [`` \pi =``][__________]{$d[7]}[`^{\circ}`] + + [`` [$r[8]] =``][__________]{$d[8]}[`^{\circ}`] + + [`` [$r[9]] =``][__________]{$d[9]}[`^{\circ}`] + + [`` [$r[10]] =``][__________]{$d[10]}[`^{\circ}`] + + [`` [$r[11]] =``][__________]{$d[11]}[`^{\circ}`] + + [`` [$r[12]] =``][__________]{$d[12]}[`^{\circ}`] + + [`` [$r[13]] =``][__________]{$d[13]}[`^{\circ}`] + + [`` [$r[14]] =``][__________]{$d[14]}[`^{\circ}`] + + [`` [$r[15]] =``][__________]{$d[15]}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` \frac{\pi}{6} `] to degrees, simply substitute [`\pi`] with [`180^{\circ}`]: + + [`` \frac{\pi}{6} = \frac{180^{\circ}}{6} = 180^{\circ}\div6 = 30^{\circ} ``] + +Similarly: + + [`` \frac{\pi}{4} = \frac{180^{\circ}}{4} = 180^{\circ}\div4 = 45^{\circ} ``] + + [`` \frac{\pi}{3} = \frac{180^{\circ}}{3} = 180^{\circ}\div3\cdot2 = 60^{\circ} ``] + + [`` \frac{\pi}{2} = \frac{180^{\circ}}{2} = 180^{\circ}\div2 = 90^{\circ} ``] + + [`` \frac{2\pi}{3} = \frac{2(180^{\circ})}{3} = 180^{\circ}\div3\cdot2 = 120^{\circ} ``] + + [`` \frac{3\pi}{4} = \frac{3(180^{\circ})}{4} = 180^{\circ}\div4\cdot3 = 135^{\circ} ``] + + [`` \frac{5\pi}{6} = \frac{5(180^{\circ})}{6} = 180^{\circ}\div6\cdot5 = 150^{\circ} ``] + + [`` \pi = 180^{\circ} ``] + + [`` \frac{7\pi}{6} = \frac{7(180^{\circ})}{6} = 180^{\circ}\div6\cdot7 = 210^{\circ} ``] + + [`` \frac{5\pi}{4} = \frac{5(180^{\circ})}{4} = 180^{\circ}\div4\cdot5 = 225^{\circ} ``] + + [`` \frac{4\pi}{3} = \frac{4(180^{\circ})}{3} = 180^{\circ}\div3\cdot4 = 240^{\circ}``] + + [`` \frac{3\pi}{2} = \frac{3(180^{\circ})}{2} = 180^{\circ}\div2\cdot3 = 270^{\circ} ``] + + [`` \frac{5\pi}{3} = \frac{5(180^{\circ})}{3} = 180^{\circ}\div3\cdot5 = 300^{\circ} ``] + + [`` \frac{7\pi}{4} = \frac{7(180^{\circ})}{4} = 180^{\circ}\div7\cdot4 = 315^{\circ} ``] + + [`` \frac{11\pi}{6} = \frac{11(180^{\circ})}{6} = 180^{\circ}\div6\cdot11 = 330^{\circ} ``] + + [`` 2\pi = 2\cdot180^{\circ} = 360^{\circ} ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation10.pg b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation10.pg new file mode 100644 index 0000000000..75403c4402 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation10.pg @@ -0,0 +1,164 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$P_x = 5*cos(pi/3); +$P_y = 5*sin(pi/3); +$small_x = cos(pi/3); +$alt_x = 5*cos(pi/2 - $theta); +$alt_y = 5*sin(pi/2 - $theta); + +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); +$graph[0]->lb(new Label(1,.3,"theta",'blue','left','bottom',large)); +$graph[0]->lb(new Label($P_x+.1,$P_y+.1,"P",'black','left','bottom',large)); +$graph[0]->lb(new Label($alt_x+.1,$alt_y+.1,"A",'red','left','bottom',large)); +$graph[0]->lb(new Label($alt_x+.2,-$alt_y-.2,"B",'red','left','bottom',large)); +$graph[0]->lb(new Label($P_x,-$P_y-.5,"C",'red','left','bottom',large)); +$graph[0]->lb(new Label(-$P_x-.1,-$P_y-.5,"D",'red','left','bottom',large)); +$graph[0]->lb(new Label(-$alt_x-.4,-$alt_y-.2,"E",'red','left','bottom',large)); +$graph[0]->lb(new Label(-$alt_x-.3,$alt_y,"F",'red','left','bottom',large)); +$graph[0]->lb(new Label(-$P_x-.1,$P_y+.1,"G",'red','left','bottom',large)); + + +$f0[0] = "($P_y*x)/$P_x for x in <0,$P_x> using color:blue and #weight:2"; +$f1[0] = "(1-x^2)^(1/2) for x in <$small_x,1> using color:blue and weight:2"; +plot_functions( $graph[0], $f0[0], $f1[0]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$point = closed_circle( $P_x, $P_y, black ); +$A_pt = closed_circle( $alt_x, $alt_y, red ); +$B_pt = closed_circle( $alt_x, -$alt_y, red ); +$C_pt = closed_circle( $P_x, -$P_y, red ); +$D_pt = closed_circle( -$P_x, -$P_y, red ); +$E_pt = closed_circle( -$alt_x, -$alt_y, red ); +$F_pt = closed_circle( -$alt_x, $alt_y, red ); +$G_pt = closed_circle( -$P_x, $P_y, red ); + +$graph[0] -> stamps($point, $A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt); + +$angle[0] = "\displaystyle \frac{ \pi}{2} - \theta"; +$angle[1] = "\displaystyle \theta - \frac{ \pi}{2}"; +$angle[2] = "\displaystyle 2 \pi - \theta"; +$angle[3] = "\displaystyle \pi + \theta"; +$angle[4] = "\displaystyle \frac{3 \pi}{2} - \theta"; +$angle[5] = "\displaystyle \frac{ \pi}{2} + \theta"; +$angle[6] = "\displaystyle \pi - \theta"; + +@letters = ("A","B","C","D","E","F","G"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +@exp = (); +$exp[0] = "\displaystyle \text{because starting at } 90^{\circ}\text{, going backward by }\theta \text{ degrees, we would land at point }$letters[0]"; +$exp[1] = "\displaystyle \text{because starting at } \text{P, going backward by }90^{\circ} \text{ we would land at point }$letters[1]"; +$exp[2] = "\displaystyle \text{because starting at } 360^{\circ}\text{, going backward by }\theta \text{ degrees, we would land at point }$letters[2]"; +$exp[3] = "\displaystyle \text{because starting at } 180^{\circ}\text{, going forward by }\theta \text{ degrees, we would land at point }$letters[3]"; +$exp[4] = "\displaystyle \text{because starting at } 270^{\circ}\text{, going backward by }\theta \text{ degrees, we would land at point }$letters[4]"; +$exp[5] = "\displaystyle \text{because starting at } 90^{\circ}\text{, going forward by }\theta \text{ degrees, we would land at point }$letters[5]"; +$exp[6] = "\displaystyle \text{because starting at } 180^{\circ}\text{, going backward by }\theta \text{ degrees, we would land at point }$letters[6]"; + +$alt = "This is the graph of a unit circle, with Point A on the circle at a position close to 30 degrees, Point B close to -30 degrees, Point C close to -60 degrees, Point D close to -120 degrees, Point E close to -150 degrees, Point F close to 150 degrees, Point G close to 120 degrees, Point P close to 60 degrees. Point P corresponds to angle theta."; + +$fig = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Consider the angle \( \theta \), which is labeled as theta in blue on the graph, with corresponding point \(P\) on the circle. ". +$BR. +$BR. +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","P"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","P"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","P"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","P"]) ). +endtable(), +$fig. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 0; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + + + +(a) [$ans[0]] [`[$exp[$perm[0]]]`] + +(b) [$ans[1]] [`[$exp[$perm[1]]]`] + +(c) [$ans[2]] [`[$exp[$perm[2]]]`] + +(d) [$ans[3]] [`[$exp[$perm[3]]]`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation20.pg b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation20.pg new file mode 100644 index 0000000000..4c9f929251 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation20.pg @@ -0,0 +1,172 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$P_x = 5*cos(pi/3); +$P_y = 5*sin(pi/3); +$small_x = cos(pi/3); +$alt_x = 5*cos(pi/2 - $theta); +$alt_y = 5*sin(pi/2 - $theta); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + + +$A_pt = closed_circle( $alt_x, $alt_y, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( -$P_x ,$P_y, red ); +$D_pt = closed_circle( -$alt_x, $alt_y, red ); +$E_pt = closed_circle( -$alt_x ,-$alt_y, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( $P_x, -$P_y, red ); +$H_pt = closed_circle( $alt_x, -$alt_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +$angle[0] = "\displaystyle \frac{\pi}{6}"; +$angle[1] = "\displaystyle \frac{\pi}{3}"; +$angle[2] = "\displaystyle \frac{2\pi}{3}"; +$angle[3] = "\displaystyle \frac{5\pi}{6}"; +$angle[4] = "\displaystyle \frac{7\pi}{6}"; +$angle[5] = "\displaystyle \frac{4\pi}{3}"; +$angle[6] = "\displaystyle \frac{5\pi}{3}"; +$angle[7] = "\displaystyle \frac{11\pi}{6}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($alt_x+.1,$alt_y+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1,$P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,$P_y+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.3,$alt_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.4,-$alt_y-.2,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x,-$P_y-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($alt_x+.2,-$alt_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($alt_x-.1,$alt_y-.1,"pi/6",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1,$P_y-.1,"pi/3",'red','right','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,$P_y-.1,"2pi/3",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.3,$alt_y,"5pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.4,-$alt_y+.2,"7pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"4pi/3",'red','left','top',large)); +$graph[1]->lb(new Label($P_x,-$P_y+.5,"5pi/3",'red','right','top',large)); +$graph[1]->lb(new Label($alt_x-.2,-$alt_y+.2,"11pi/6",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 30 degrees, Point B close to 60 degrees, Point C close to 120 degrees, Point D close to 150 degrees, Point E close to 210 degrees, Point F close to 240 degrees, Point G close to 300 degrees, Point H close to 330 degrees."; +$alt[1] = "This is the graph of a unit circle, with A and pi/6 marked at 30 degrees, B and pi/3 at 60 degrees, C and 2pi/3 at 120 degrees, D and 5pi/6 at 150 degrees, E and 7pi/6 at 210 degrees, F and 4pi/3 at 240 degrees, G and 5pi/3 at 300 degrees, H and 11pi/6 at 330 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +(a) [`[$pick[0]]`] at [$ans[0]] + +(b) [`[$pick[1]]`] at [$ans[1]] + +(c) [`[$pick[2]]`] at [$ans[2]] + +(d) [`[$pick[3]]`] at [$ans[3]] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation30.pg b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation30.pg new file mode 100644 index 0000000000..9d703567fc --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation30.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$r = 5; +$P_x = $r*cos(pi/4); +$P_y = $r*sin(pi/4); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + + +$A_pt = closed_circle( $r, 0, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( 0 ,$r, red ); +$D_pt = closed_circle( -$P_x, $P_y, red ); +$E_pt = closed_circle( -$r, 0, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( 0, -$r, red ); +$H_pt = closed_circle( $P_x, -$P_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +$angle[0] = "\displaystyle 0"; +$angle[1] = "\displaystyle \frac{\pi}{4}"; +$angle[2] = "\displaystyle \frac{\pi}{2}"; +$angle[3] = "\displaystyle \frac{3\pi}{4}"; +$angle[4] = "\displaystyle \pi"; +$angle[5] = "\displaystyle \frac{5\pi}{4}"; +$angle[6] = "\displaystyle \frac{3\pi}{2}"; +$angle[7] = "\displaystyle \frac{7\pi}{4}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r+.1, 0+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1, $P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0-.3, $r+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.3, $P_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$r-.4, 0-.4,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0+0.1,-$r-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.2,-$P_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($r-.2, 0-.1,"0",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1, $P_y-.1,"pi/4",'red','right','top',large)); +$graph[1]->lb(new Label(0+.3, $r-.2,"pi/2",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.3, $P_y,"3pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(-$r+.4, 0+.4,"pi",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"5pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(0-0.1,-$r+.2,"3pi/2",'red','right','bottom',large)); +$graph[1]->lb(new Label($P_x-.2,-$P_y+.1,"7pi/4",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 0 degree, Point B close to 45 degrees, Point C close to 90 degrees, Point D close to 135 degrees, Point E close to 180 degrees, Point F close to 225 degrees, Point G close to 270 degrees, Point H close to 315 degrees."; +$alt[1] = "This is the graph of a unit circle, with Point A and 0 marked at 0 degrees, B and pi/4 at 45 degrees, C and pi/2 at 90 degrees, D and 3pi/4 at 135 degrees, E and pi at 180 degrees, F and 5pi/4 at 225 degrees, G and 3pi/2 at 270 degrees, H and 7pi/4 at 315 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +(a) [`[$pick[0]]`] at [$ans[0]] + +(b) [`[$pick[1]]`] at [$ans[1]] + +(c) [`[$pick[2]]`] at [$ans[2]] + +(d) [`[$pick[3]]`] at [$ans[3]] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation40.pg b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation40.pg new file mode 100644 index 0000000000..9036179e49 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation40.pg @@ -0,0 +1,172 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$P_x = 5*cos(pi/3); +$P_y = 5*sin(pi/3); +$small_x = cos(pi/3); +$alt_x = 5*cos(pi/2 - $theta); +$alt_y = 5*sin(pi/2 - $theta); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + + +$A_pt = closed_circle( $alt_x, $alt_y, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( -$P_x ,$P_y, red ); +$D_pt = closed_circle( -$alt_x, $alt_y, red ); +$E_pt = closed_circle( -$alt_x ,-$alt_y, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( $P_x, -$P_y, red ); +$H_pt = closed_circle( $alt_x, -$alt_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +$angle[0] = "\displaystyle -\frac{11\pi}{6}"; +$angle[1] = "\displaystyle -\frac{5\pi}{3}"; +$angle[2] = "\displaystyle -\frac{4\pi}{3}"; +$angle[3] = "\displaystyle -\frac{7\pi}{6}"; +$angle[4] = "\displaystyle -\frac{5\pi}{6}"; +$angle[5] = "\displaystyle -\frac{2\pi}{3}"; +$angle[6] = "\displaystyle -\frac{\pi}{3}"; +$angle[7] = "\displaystyle -\frac{\pi}{6}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($alt_x+.1,$alt_y+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1,$P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,$P_y+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.3,$alt_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.4,-$alt_y-.2,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x,-$P_y-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($alt_x+.2,-$alt_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($alt_x-.1,$alt_y-.1,"-11pi/6",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1,$P_y-.1,"-5pi/3",'red','right','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,$P_y-.1,"-4pi/3",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.3,$alt_y,"-7pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.4,-$alt_y+.2,"-5pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"-2pi/3",'red','left','top',large)); +$graph[1]->lb(new Label($P_x,-$P_y+.5,"-pi/3",'red','right','top',large)); +$graph[1]->lb(new Label($alt_x-.2,-$alt_y+.2,"-pi/6",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 30 degrees, Point B close to 60 degrees, Point C close to 120 degrees, Point D close to 150 degrees, Point E close to 210 degrees, Point F close to 240 degrees, Point G close to 300 degrees, Point H close to 330 degrees."; +$alt[1] = "This is the graph of a unit circle, with A and -11pi/6 marked at 30 degrees, B and -5pi/3 at 60 degrees, C and -4pi/3 at 120 degrees, D and -7pi/6 at 150 degrees, E and -5pi/6 at 210 degrees, F and -2pi/3 at 240 degrees, G and -pi/3 at 300 degrees, H and -pi/6 at 330 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +(a) [`[$pick[0]]`] at [$ans[0]] + +(b) [`[$pick[1]]`] at [$ans[1]] + +(c) [`[$pick[2]]`] at [$ans[2]] + +(d) [`[$pick[3]]`] at [$ans[3]] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation50.pg b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation50.pg new file mode 100644 index 0000000000..cae0140a13 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation50.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$r = 5; +$P_x = $r*cos(pi/4); +$P_y = $r*sin(pi/4); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + + +$A_pt = closed_circle( $r, 0, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( 0 ,$r, red ); +$D_pt = closed_circle( -$P_x, $P_y, red ); +$E_pt = closed_circle( -$r, 0, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( 0, -$r, red ); +$H_pt = closed_circle( $P_x, -$P_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +$angle[0] = "\displaystyle -2\pi"; +$angle[1] = "\displaystyle -\frac{7\pi}{4}"; +$angle[2] = "\displaystyle -\frac{3\pi}{2}"; +$angle[3] = "\displaystyle -\frac{5\pi}{4}"; +$angle[4] = "\displaystyle -\pi"; +$angle[5] = "\displaystyle -\frac{3\pi}{4}"; +$angle[6] = "\displaystyle -\frac{\pi}{2}"; +$angle[7] = "\displaystyle -\frac{\pi}{4}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r+.1, 0+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1, $P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0-.3, $r+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.3, $P_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$r-.4, 0-.4,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0+0.1,-$r-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.2,-$P_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($r-.2, 0-.1,"-2pi",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1, $P_y-.1,"-7pi/4",'red','right','top',large)); +$graph[1]->lb(new Label(0+.3, $r-.2,"-3pi/2",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.3, $P_y,"-5pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(-$r+.4, 0+.4,"-pi",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"-3pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(0-0.1,-$r+.2,"-pi/2",'red','right','bottom',large)); +$graph[1]->lb(new Label($P_x-.2,-$P_y+.1,"-pi/4",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 0 degree, Point B close to 45 degrees, Point C close to 90 degrees, Point D close to 135 degrees, Point E close to 180 degrees, Point F close to 225 degrees, Point G close to 270 degrees, Point H close to 315 degrees."; +$alt[1] = "This is the graph of a unit circle, with Point A and -2pi marked at 0 degrees, B and -7pi/4 at 45 degrees, C and -3pi/2 at 90 degrees, D and -5pi/4 at 135 degrees, E and -pi at 180 degrees, F and -3pi/4 at 225 degrees, G and -pi/2 at 270 degrees, H and -pi/4 at 315 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +(a) [`[$pick[0]]`] at [$ans[0]] + +(b) [`[$pick[1]]`] at [$ans[1]] + +(c) [`[$pick[2]]`] at [$ans[2]] + +(d) [`[$pick[3]]`] at [$ans[3]] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation60.pg b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation60.pg new file mode 100644 index 0000000000..4287f6b13b --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation60.pg @@ -0,0 +1,202 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$P_x = 5*cos(pi/3); +$P_y = 5*sin(pi/3); +$small_x = cos(pi/3); +$alt_x = 5*cos(pi/2 - $theta); +$alt_y = 5*sin(pi/2 - $theta); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + + +$A_pt = closed_circle( $alt_x, $alt_y, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( -$P_x ,$P_y, red ); +$D_pt = closed_circle( -$alt_x, $alt_y, red ); +$E_pt = closed_circle( -$alt_x ,-$alt_y, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( $P_x, -$P_y, red ); +$H_pt = closed_circle( $alt_x, -$alt_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +@refAngles = ( + "\frac{\pi}{6}", + "\frac{\pi}{3}", + "\frac{2\pi}{3}", + "\frac{5\pi}{6}", + "\frac{7\pi}{6}", + "\frac{4\pi}{3}", + "\frac{5\pi}{3}", + "\frac{11\pi}{6}", +); + +@round = (); +@numerator = (); + +@in = (-5,-4,-3,-2,-1,1,2,3,4,5); +for my $i (0..7) { + $round[$i] = splice(@in, random(0,$#in,1), 1); +} + +$numerator[0] = 1+6*2*$round[0]; +$numerator[1] = 1+3*2*$round[1]; +$numerator[2] = 2+3*2*$round[2]; +$numerator[3] = 5+6*2*$round[3]; +$numerator[4] = 7+6*2*$round[4]; +$numerator[5] = 4+3*2*$round[5]; +$numerator[6] = 5+3*2*$round[6]; +$numerator[7] = 11+6*2*$round[7]; + +$angle[0] = "\displaystyle \frac{$numerator[0]\pi}{6}"; +$angle[1] = "\displaystyle \frac{$numerator[1]\pi}{3}"; +$angle[2] = "\displaystyle \frac{$numerator[2]\pi}{3}"; +$angle[3] = "\displaystyle \frac{$numerator[3]\pi}{6}"; +$angle[4] = "\displaystyle \frac{$numerator[4]\pi}{6}"; +$angle[5] = "\displaystyle \frac{$numerator[5]\pi}{3}"; +$angle[6] = "\displaystyle \frac{$numerator[6]\pi}{3}"; +$angle[7] = "\displaystyle \frac{$numerator[7]\pi}{6}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for my $i (0..3) { $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($alt_x+.1,$alt_y+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1,$P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,$P_y+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.3,$alt_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.4,-$alt_y-.2,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x,-$P_y-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($alt_x+.2,-$alt_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($alt_x-.1,$alt_y-.1,"pi/6",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1,$P_y-.1,"pi/3",'red','right','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,$P_y-.1,"2pi/3",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.3,$alt_y,"5pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.4,-$alt_y+.2,"7pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"4pi/3",'red','left','top',large)); +$graph[1]->lb(new Label($P_x,-$P_y+.5,"5pi/3",'red','right','top',large)); +$graph[1]->lb(new Label($alt_x-.2,-$alt_y+.2,"11pi/6",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 30 degrees, Point B close to 60 degrees, Point C close to 120 degrees, Point D close to 150 degrees, Point E close to 210 degrees, Point F close to 240 degrees, Point G close to 300 degrees, Point H close to 330 degrees."; +$alt[1] = "This is the graph of a unit circle, with A and pi/6 marked at 30 degrees, B and pi/3 at 60 degrees, C and 2pi/3 at 120 degrees, D and 5pi/6 at 150 degrees, E and 7pi/6 at 210 degrees, F and 4pi/3 at 240 degrees, G and 5pi/3 at 300 degrees, H and 11pi/6 at 330 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +If an angle increases or decreases by a multiple of [`2\pi`], the angle's location on the unit circle does not change. + +(a) [`[$pick[0]]`] at [$ans[0]] because [`[$pick[0]]-[$round[$perm[0]]]\cdot2\pi = [$refAngles[$perm[0]]] `] + +(b) [`[$pick[1]]`] at [$ans[1]] because [`[$pick[1]]-[$round[$perm[1]]]\cdot2\pi = [$refAngles[$perm[1]]] `] + +(c) [`[$pick[2]]`] at [$ans[2]] because [`[$pick[2]]-[$round[$perm[2]]]\cdot2\pi = [$refAngles[$perm[2]]] `] + +(d) [`[$pick[3]]`] at [$ans[3]] because [`[$pick[3]]-[$round[$perm[3]]]\cdot2\pi = [$refAngles[$perm[3]]] `] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation70.pg b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation70.pg new file mode 100644 index 0000000000..f631d75f01 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation70.pg @@ -0,0 +1,199 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$r = 5; +$P_x = $r*cos(pi/4); +$P_y = $r*sin(pi/4); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + +$A_pt = closed_circle( $r, 0, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( 0 ,$r, red ); +$D_pt = closed_circle( -$P_x, $P_y, red ); +$E_pt = closed_circle( -$r, 0, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( 0, -$r, red ); +$H_pt = closed_circle( $P_x, -$P_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +@refAngles = ( + "0", + "\frac{\pi}{4}", + "\frac{\pi}{2}", + "\frac{3\pi}{4}", + "\pi", + "\frac{5\pi}{4}", + "\frac{3\pi}{2}", + "\frac{7\pi}{4}", +); + +@round = (); +@numerator = (); + +@in = (-5,-4,-3,-2,-1,1,2,3,4,5); +for my $i (0..7) { + $round[$i] = splice(@in, random(0,$#in,1), 1); +} + +$numerator[0] = 0+1*2*$round[0]; +$numerator[1] = 1+4*2*$round[1]; +$numerator[2] = 1+2*2*$round[2]; +$numerator[3] = 3+4*2*$round[3]; +$numerator[4] = 1+1*2*$round[4]; +$numerator[5] = 5+4*2*$round[5]; +$numerator[6] = 3+2*2*$round[6]; +$numerator[7] = 7+4*2*$round[7]; + +$angle[0] = "\displaystyle $numerator[0]\pi"; +$angle[1] = "\displaystyle \frac{$numerator[1]\pi}{4}"; +$angle[2] = "\displaystyle \frac{$numerator[2]\pi}{2}"; +$angle[3] = "\displaystyle \frac{$numerator[3]\pi}{4}"; +$angle[4] = "\displaystyle $numerator[4]\pi"; +$angle[5] = "\displaystyle \frac{$numerator[5]\pi}{4}"; +$angle[6] = "\displaystyle \frac{$numerator[6]\pi}{2}"; +$angle[7] = "\displaystyle \frac{$numerator[7]\pi}{4}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r+.1, 0+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1, $P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0-.3, $r+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.3, $P_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$r-.4, 0-.4,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0+0.1,-$r-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.2,-$P_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($r-.2, 0-.1,"0",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1, $P_y-.1,"pi/4",'red','right','top',large)); +$graph[1]->lb(new Label(0+.3, $r-.2,"pi/2",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.3, $P_y,"3pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(-$r+.4, 0+.4,"pi",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"5pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(0-0.1,-$r+.2,"3pi/2",'red','right','bottom',large)); +$graph[1]->lb(new Label($P_x-.2,-$P_y+.1,"7pi/4",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 0 degree, Point B close to 45 degrees, Point C close to 90 degrees, Point D close to 135 degrees, Point E close to 180 degrees, Point F close to 225 degrees, Point G close to 270 degrees, Point H close to 315 degrees."; +$alt[1] = "This is the graph of a unit circle, with Point A and 0 marked at 0 degrees, B and pi/4 at 45 degrees, C and pi/2 at 90 degrees, D and 3pi/4 at 135 degrees, E and pi at 180 degrees, F and 5pi/4 at 225 degrees, G and 3pi/2 at 270 degrees, H and 7pi/4 at 315 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +If an angle increases or decreases by a multiple of [`2\pi`], the angle's location on the unit circle does not change. + +(a) [`[$pick[0]]`] at [$ans[0]] because [`[$pick[0]]-[$round[$perm[0]]]\cdot2\pi = [$refAngles[$perm[0]]] `] + +(b) [`[$pick[1]]`] at [$ans[1]] because [`[$pick[1]]-[$round[$perm[1]]]\cdot2\pi = [$refAngles[$perm[1]]] `] + +(c) [`[$pick[2]]`] at [$ans[2]] because [`[$pick[2]]-[$round[$perm[2]]]\cdot2\pi = [$refAngles[$perm[2]]] `] + +(d) [`[$pick[3]]`] at [$ans[3]] because [`[$pick[3]]-[$round[$perm[3]]]\cdot2\pi = [$refAngles[$perm[3]]] `] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation80.pg b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation80.pg new file mode 100644 index 0000000000..86a7a9064a --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation80.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by by John Travis, Mississippi College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserMultiAnswer.pl", + "PGML.pl", + "PGcourse.pl" +); + +# Print problem number and point value (weight) for the problem +TEXT(beginproblem()); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# +# Setup +# +# +Context("Numeric"); + +$angle = random(95,335,10); + +############################################################## +# +# Text +# +# + +$multians = MultiAnswer($angle, $angle,$angle)->with( + singleResult => 0, + allowBlankAnswers=>1, + # checkTypes => 0, + checker => sub { + my ( $correct, $student, $self ) = @_; + my @s = @{$student}; + my @c = @{$correct}; + @history = (); + @ret = (); + foreach (0..$#c){@ret = (@ret,0);} + foreach $i (0..$#c){ + if ( ref($c[$j]) eq ref($s[$i]) && $s[$i] %360 == $c[$i] && $s[$i] != $angle) { + $ret[$i] = 1; + foreach $h (0 .. $#history){ + if(ref($history[$h]) eq ref($s[$i]) && $s[$i] == $history[$h]){ $ret[$i] = 0}; + } + @history = ($s[$i], @history); + } + } + return [@ret]; + } +); + +Context()->operators->undefine("+","-","*","/","^","**"); + +############################################################## + +BEGIN_PGML +Determine three *different* angles which are coterminal with [`[$angle]^{\circ}`]: + +>> +[________]{$multians} = [________]{$multians} = [________]{$multians} +<< + +END_PGML + + +############################################################## + +$angle1 = $angle+360; +$angle2 = $angle-360; +$angle3 = $angle+720; + +BEGIN_PGML_SOLUTION + +Two angles are coterminal if their difference is a multiple of [`360^{\circ}`]. + +A few examples of angles coterminal with [`[$angle]^{\circ}`] are: + + [`` +\begin{aligned} + [$angle]^{\circ}+360^{\circ} &= [$angle1]^{\circ} \\ + [$angle]^{\circ}-360^{\circ} &= [$angle2]^{\circ} \\ + [$angle]^{\circ}+2\cdot360^{\circ} &= [$angle3]^{\circ} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation90.pg b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation90.pg new file mode 100644 index 0000000000..b1f68c3540 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleBasics/UnitCircleLocation90.pg @@ -0,0 +1,108 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by by John Travis, Mississippi College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +do { + $den0 = list_random(2,3,4,6); + $num0 = random(1,2*$den0-1,1); +} until (gcd($den0,$num0)==1); +$ans0 = Fraction($num0,$den0); +$ans1 = ($ans0-2)->reduce; + +$off = random(2,10,1)*random(-1,1,2); +$frac = ($ans0+2*$off)->reduce; + +$showPartialCorrectAnswers = 1; + +($num0,$den0) = $ans0->value; +($num1,$den1) = $ans1->value; +Context("LimitedRadical"); + +if ($num0==1) { + $ans0 = Formula("pi/$den0"); +} elsif ($num0==-1) { + $ans0 = Formula("-pi/$den0"); +} else { + $ans0 = Formula("$num0*pi/$den0"); +} +if ($num1==1) { + $ans1 = Formula("pi/$den1"); +} elsif ($num1==-1) { + $ans1 = Formula("-pi/$den1"); +} else { + $ans1 = Formula("$num1*pi/$den1"); +} + +############################################## + +BEGIN_PGML + +Find a coterminal angle of [`[$frac]\pi`] in the range of [`[0,2\pi]`]. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + [__________]{$ans0}[`\text{ radians}`] + +Find a coterminal angle of [`[$frac]\pi`] in the range of [`[-2\pi,0]`]. + + [__________]{$ans1}[`\text{ radians}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The difference between coterminal angles must be a multiple of [`2\pi`]. + +We can calculate the coterminal angle of [`[$frac]\pi`] in the range of [`[0,2\pi]`] by: + + [``[$frac]\pi-[$off]\cdot2\pi = [$ans0]``] + +The coterminal angle of [`[$frac]\pi`] in the range of [`[-2\pi,0]`] is: + + [``[$ans0]-2\pi = [$ans1]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas10.pg b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas10.pg new file mode 100644 index 0000000000..d8a74f2048 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas10.pg @@ -0,0 +1,245 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); +do {$in[1] = random(0,3,1);} until ($in[0] != $in[1]); + +@quadrant = (); +$quadrant[0] = random(2,4,1); +do {$quadrant[1] = random(2,4,1);} until ($quadrant[0] != $quadrant[1]); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@Q = (); + +for my $k (0..0) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $Q[$k] = "II"; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..0) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +$sinAns = (2*$trigs[0][0]*$trigs[0][1])->reduce; +$cosAns = (1-2*($trigs[0][0])**2)->reduce; +$tanAns = (2*$trigs[0][2]/(1-($trigs[0][2])**2))->reduce; + + +############################################################## + +BEGIN_PGML + +If it's given that + + [``\tan(\theta)=[$trigs[0][2]]``] and [`\theta\in[$int[0]]`], + +evaluate the following. + +a) [`\sin(2\theta)=`][_____________]{$sinAns} + +a) [`\cos(2\theta)=`][_____________]{$cosAns} + +a) [`\tan(2\theta)=`][_____________]{$tanAns} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = (2*$trigs[0][2])->reduce; +$s2 = (1-($trigs[0][2])**2)->reduce; + +############################################################## + +BEGIN_PGML_SOLUTION + +###Calculating [`\sin(2\theta)`] + +To calculate [`\sin(2\theta)`], we will use the formula + + [`` \sin(2\theta) = 2\sin(\theta)\cos(\theta) ``] + +[`\tan(\theta)`] is given. We need to find the value of [`\sin(\theta)`] and [`\cos(\theta)`]. + +It's given that [`\tan(\theta)=[$trigs[0][2]]`] and [`\theta\in[$int[0]]`]. We can sketch [`\theta`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{\left([$base[0]]\right)^2+\left([$height[0]]\right)^2}=[$hypotenuse[0]]`]. + +We can see [`\sin(\theta)=[$trigs[0][0]]`] and [`\cos(\theta)=[$trigs[0][1]]`]. + +Now we can calculate the value of [`\sin(2\theta)`]: + + [``\begin{aligned} + \sin(2\theta) &= 2\sin(\theta)\cos(\theta) \\ + &= 2\left( [$trigs[0][0]] \right) \left( [$trigs[0][1]] \right) \\ + &= [$sinAns] + \end{aligned}``] + +###Calculating [` \cos(2\theta) `] + +Cosine's double angle formula are 3 forms: + + [``\begin{aligned} + \cos(2\theta) + &= \cos^2(\theta)-\sin^2(\theta) \\ + &= 2\cos^2(\theta) -1 \\ + &= 1- 2\sin^2(\theta) + \end{aligned}``] + +We could use any form since we already know the values of both [`\sin(\theta)`] and [`\cos(\theta)`]. We will choose to use the first form: + + [``\begin{aligned} + \cos(2\theta) &= \cos^2(\theta)-\sin^2(\theta) \\ + &= \left( [$trigs[0][1]] \right)^2 - \left( [$trigs[0][0]] \right)^2 \\ + &= [$cosAns] + \end{aligned}``] + +###Calculating [` \tan(2\theta) `] + +We will use the tangent double-angle formula: + + [``\begin{aligned} + \tan(2\theta) &= \frac{2\tan(\theta)}{1-\tan^2(\theta)} \\ + &= \frac{2\left([$trigs[0][2]]\right)}{1-\left([$trigs[0][2]]\right)^2} \\ + &= \frac{[$s1]}{[$s2]} \\ + &= [$tanAns] + \end{aligned}``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas20.pg b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas20.pg new file mode 100644 index 0000000000..cefdf50241 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas20.pg @@ -0,0 +1,344 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + + + do { + do { + $height0Out = -random(1,3,1); + $height0In = list_random(1,2,3); + $hypotenuse0Out = random(int(abs($height0Out)*$height0In**2)+2,int(abs($height0Out)*$height0In**2)+10,1); + } until (gcd($height0Out,$hypotenuse0Out)==1); + $hypotenuse0In = 1; + ($base0Out,$base0In) = &radSimplify($hypotenuse0Out**2-$height0Out**2*$height0In); + } until (!($base0In==1 && $height0In==1 && $hypotenuse0In==1)) && !(($base0Out>0) && ($height0Out>0)) && ($base0In<=20); + + $base0Out = $base0Out*random(-1,1,2); + if ($base0Out*$height0Out>0) { + $Q0 = ($base0Out>0) ? "I" : "III"; + $int0 = ($base0Out>0) ? "\left(0,\frac{\pi}{2}\right)" : "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + $Q0 = ($base0Out>0) ? "IV" : "II"; + $int0 = ($base0Out>0) ? "\left(\frac{3\pi}{2},2\pi\right)" : "\left(\frac{\pi}{2},\pi\right)"; + } + +Context("LimitedRadical"); + if ($base0In==1) { + $base0 = $base0Out; + $absBase = abs($base0Out); + } elsif (abs($base0Out)==1) { + $base0 = ($base0Out>0) ? Formula("sqrt($base0In)") : Formula("-sqrt($base0In)"); + $absBase = Formula("sqrt($base0In)"); + } else { + $base0 = Formula("$base0Out*sqrt($base0In)"); + $absBase0Out = abs($base0Out); + $absBase0 = Formula("$absBase0Out*sqrt($base0In)"); + } + + if ($height0In==1) { + $height0 = $height0Out; + $absHeight0 = abs($height0Out); + } elsif (abs($height0Out)==1) { + $height0 = ($height0Out>0) ? Formula("sqrt($height0In)") : Formula("-sqrt($height0In)"); + $absHeight0 = Formula("sqrt($height0In)"); + } else { + $height0 = Formula("$height0Out*sqrt($height0In)"); + $absHeight0Out = abs($height0Out); + $absHeight0 = Formula("$absHeight0Out*sqrt($height0In)"); + } + + $hypotenuse0 = $hypotenuse0Out; + + $sine0 = &rationalize($height0Out,$height0In,$hypotenuse0Out,$hypotenuse0In); + $cosine0 = &rationalize($base0Out,$base0In,$hypotenuse0Out,$hypotenuse0In); + $tangent0 = &rationalize($height0Out,$height0In,$base0Out,$base0In); + + @trigs0 = ($sine0,$cosine0,$tangent0); + +Context("Numeric"); + +$r = 5; +$P0x = $r*$base0Out*sqrt($base0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); +$P0y = $r*$height0Out*sqrt($height0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); + +@graph = (); +$graph[0] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $P0x, $P0y, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($P0x,$P0y,red,2); +$graph[0]->lineTo($P0x,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($P0x>0) ? -0.2 : 0.2; +$yShift = ($P0y>0) ? 0.2 : -0.42; +$graph[0]->moveTo($P0x,$yShift); +$graph[0]->lineTo($P0x+$xShift,$yShift,red,2); +$graph[0]->lineTo($P0x+$xShift,0,red,2); + +$LORHeight = ($P0x>0) ? "left" : "right"; +$TOBBase = ($P0y>0) ? "top" : "bottom"; +$LORHyp = ($P0x>0) ? "right" : "left"; +$TOBHyp = ($P0y>0) ? "bottom" : "top"; +$LORShift = ($P0x>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($P0x+$LORShift,$P0y/2,"$height0",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($P0x/2,0,"$base0",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($P0x/2,$P0y/2,"$hypotenuse0",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($P0x,$P0y,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base0,$height0) and ($base0,0). The base is marked as $base0, height marked as $height0 and hypotenuse marked as $hypotenuse0."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + Context("LimitedFraction"); + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + Context("LimitedRadical"); + if (($numIn==0)||($numOut==0)) {return Formula("0");} + if ($d0==1) { + if ($numIn==1) {return Formula("$n0");} + elsif ($n0==1) {return Formula("sqrt($numIn)");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)");} + else {return Formula("$n0*sqrt($numIn)");} + } else { + if ($numIn==1) {return Formula("$n0/$d0");} + elsif ($n0==1) {return Formula("sqrt($numIn)/$d0");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)/$d0");} + else { + $n0N = -$n0; + return ($n0>0) ? Formula("$n0*sqrt($numIn)/$d0") : Formula("-$n0N*sqrt($numIn)/$d0"); + } + } +} + +Context("LimitedRadical"); + +($out1,$in1) = radSimplify($height0In*$base0In); +$n1 = 2*$height0Out*$base0Out*$out1; +$sinAns = createRadical($n1,$in1,$hypotenuse0Out**2); + +$n2 = ($base0Out)**2*$base0In-($height0Out)**2*$height0In; +$d2 = $hypotenuse0Out**2; +Context("LimitedFraction"); +$cosAns = Fraction($n2,$d2)->reduce; + +Context("LimitedRadical"); +$tanAns = createRadical($n1,$in1,$n2); + + +############################################################## + +BEGIN_PGML + +If it's given that + + [``\cos(\theta)=[$trigs0[1]]``] and [`\theta\in[$int0]`], + +evaluate the following. + +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + +a) [`\sin(2\theta)=`][_____________]{$sinAns} + +a) [`\cos(2\theta)=`][_____________]{$cosAns} + +a) [`\tan(2\theta)=`][_____________]{$tanAns} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = rationalize(2*$height0Out,$height0In,$base0Out,$base0In); +Context("Fraction"); +$s2 = (1-Fraction(($height0Out)**2*$height0In,($base0Out)**2*$base0In))->reduce; + +############################################################## + +BEGIN_PGML_SOLUTION + +###Calculating [`\sin(2\theta)`] + +To calculate [`\sin(2\theta)`], we will use the formula + + [`` \sin(2\theta) = 2\sin(\theta)\cos(\theta) ``] + +[`\cos(\theta)`] is given. We need to find the value of [`\sin(\theta)`]. + +It's given that [`\cos(\theta)=[$trigs0[1]]`] and [`\theta\in[$int0]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse0])^2-\left([$base0]\right)^2}=[$absHeight0]`]. + +We can see [`\sin(\theta)=[$trigs0[0]]`] and [`\tan(\theta)=\frac{[$height0]}{[$base0]}=[$trigs0[2]]`]. + +Now we can calculate the value of [`\sin(2\theta)`]: + + [``\begin{aligned} + \sin(2\theta) &= 2\sin(\theta)\cos(\theta) \\ + &= 2\left( [$trigs0[0]] \right) \left( [$trigs0[1]] \right) \\ + &= [$sinAns] + \end{aligned}``] + +###Calculating [` \cos(2\theta) `] + +Cosine's double angle formula are 3 forms: + + [``\begin{aligned} + \cos(2\theta) + &= \cos^2(\theta)-\sin^2(\theta) \\ + &= 2\cos^2(\theta) -1 \\ + &= 1- 2\sin^2(\theta) + \end{aligned}``] + +We could use any form since we already know the values of both [`\sin(\theta)`] and [`\cos(\theta)`]. We will choose to use the first form: + + [``\begin{aligned} + \cos(2\theta) &= \cos^2(\theta)-\sin^2(\theta) \\ + &= \left( [$trigs0[1]] \right)^2 - \left( [$trigs0[0]] \right)^2 \\ + &= [$cosAns] + \end{aligned}``] + +###Calculating [` \tan(2\theta) `] + +We will use the tangent double-angle formula: + + [``\begin{aligned} + \tan(2\theta) &= \frac{2\tan(\theta)}{1-\tan^2(\theta)} \\ + &= \frac{2\left([$trigs0[2]]\right)}{1-\left([$trigs0[2]]\right)^2} \\ + &= \frac{[$s1]}{[$s2]} \\ + &= [$tanAns] + \end{aligned}``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas30.pg b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas30.pg new file mode 100644 index 0000000000..9690f1f7b8 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas30.pg @@ -0,0 +1,216 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); +do {$in[1] = random(0,3,1);} until ($in[0] != $in[1]); + +@quadrant = (); +$quadrant[0] = random(2,4,1); +do {$quadrant[1] = random(2,4,1);} until ($quadrant[0] != $quadrant[1]); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@Q = (); + +for my $k (0..0) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $Q[$k] = "II"; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], +); + +$sinAns = (2*$trigs[0][0]*$trigs[0][1])->reduce; +$cosAns = (1-2*($trigs[0][0])**2)->reduce; +$tanAns = (2*$trigs[0][2]/(1-($trigs[0][2])**2))->reduce; + +############################################################## + +BEGIN_PGML + +If it's given that + + [``\cos(2\theta)=[$cosAns]``] and [`\theta\in[$int[0]]`], + +evaluate the following. + +a) [`\sin(\theta)=`][_____________]{$trigs[0][0]} + +a) [`\cos(\theta)=`][_____________]{$trigs[0][1]} + +a) [`\tan(\theta)=`][_____________]{$trigs[0][2]} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$absSin = abs($trigs[0][0]); +$absCos = abs($trigs[0][1]); +$absCos2 = abs($cosAns); + +($n0,$d0) = $cosAns->value; +($n1,$d1) = $absCos2->value; + +if ($cosAns>0) { + $s1 = "1-\frac{$n0}{$d0}"; + $s2 = "$d0-$n0"; +} else { + $s1 = "1+\frac{$n1}{$d1}"; + $n0N = -$n0; + $s2 = "$d0+$n0N"; +} +$s3 = $d0-$n0; +$s4 = Fraction($d0-$n0,2*$d0)->reduce; +$pnSin = ($trigs[0][0]>0) ? 'positive' : 'negative'; + +$s5 = Fraction($d0+$n0,2*$d0)->reduce; +$pnCos = ($trigs[0][1]>0) ? 'positive' : 'negative'; + + +############################################################## + +BEGIN_PGML_SOLUTION + +###Calculating [`\sin(\theta)`] + +To calculate [`\sin(\theta)`], we will use the formula + + [`` \cos(2\theta) = 1-2\sin^2(\theta) ``] + +We have: + + [``\begin{aligned} + \cos(2\theta) &= 1-2\sin^2(\theta) \\ + \cos(2\theta) &= 1-2\sin^2(\theta) \\ + \cos(2\theta) -1 &= -2\sin^2(\theta) \\ + 1-\cos(2\theta) &= 2\sin^2(\theta) \\ + \frac{1-\cos(2\theta)}{2} &= \sin^2(\theta) \\ + \sin(\theta) &= \pm\sqrt{ \frac{1-\cos(2\theta)}{2} } \\ + \sin(\theta) &= \pm\sqrt{ \frac{1-\left([$cosAns]\right)}{2} } \\ + \sin(\theta) &= \pm\sqrt{ \frac{\left([$s1]\right)\cdot[$d0]}{2\cdot[$d0]} } \\ + \sin(\theta) &= \pm\sqrt{ \frac{[$s2]}{[$d0*2]} } \\ + \sin(\theta) &= \pm\sqrt{ \frac{[$s3]}{[$d0*2]} } \\ + \sin(\theta) &= \pm\sqrt{ [$s4] } \\ + \sin(\theta) &= \pm[$absSin] + \end{aligned}``] + +It's given that [`\theta\in[$int[0]]`], so [`\sin(\theta)`] is [$pnSin], implying [`\sin(\theta)=[$trigs[0][0]]`]. + +###Calculating [` \cos(\theta) `] + +To calculate [`\cos(\theta)`], we will use the formula + + [`` \cos(2\theta) = 2\cos^2(\theta)-1 ``] + +We have: + + [``\begin{aligned} + \cos(2\theta) &= 2\cos^2(\theta)-1 \\ + \cos(2\theta) +1 &= 2\cos^2(\theta) \\ + \frac{\cos(2\theta)+1}{2} &= \cos^2(\theta) \\ + \cos(\theta) &= \pm\sqrt{ \frac{\cos(2\theta)+1}{2} } \\ + \cos(\theta) &= \pm\sqrt{ \frac{[$cosAns]+1}{2} } \\ + \cos(\theta) &= \pm\sqrt{ \frac{\left([$cosAns]+1\right)\cdot[$d0]}{2\cdot[$d0]} } \\ + \cos(\theta) &= \pm\sqrt{ \frac{[$n0]+[$d0]}{[$d0*2]} } \\ + \cos(\theta) &= \pm\sqrt{ \frac{[$n0+$d0]}{[$d0*2]} } \\ + \cos(\theta) &= \pm\sqrt{ [$s5] } \\ + \cos(\theta) &= \pm[$absCos] + \end{aligned}``] + +It's given that [`\theta\in[$int[0]]`], so [`\cos(\theta)`] is [$pnCos], implying [`\cos(\theta)=[$trigs[0][1]]`]. + +###Calculating [` \tan(\theta) `] + +To calculate [`\tan(\theta)`], we will use the formula + + [`` \tan(\theta) = \frac{\sin(\theta)}{\cos(\theta)} ``] + +We have: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} \\ + \tan(\theta) &= \frac{[$trigs[0][0]]}{[$trigs[0][1]]} \\ + \tan(\theta) &= \frac{[$trigs[0][0]]\cdot[$hypotenuse[0]]}{[$trigs[0][1]]\cdot[$hypotenuse[0]]} \\ + \tan(\theta) &= [$trigs[0][2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity10.pg b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity10.pg new file mode 100644 index 0000000000..3fcd995079 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity10.pg @@ -0,0 +1,170 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{1-\cos(\theta)}{2} "; +$right = "\displaystyle \sin^2\left(\frac{\theta}{2}\right)"; + +@steps = ( + "\displaystyle \frac{1-\left(1-2\sin^2\left(\frac{\theta}{2}\right)\right)}{2}", + "\displaystyle \frac{1-1+2\sin^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{2\sin^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{1-\left(\cos^2\left(\frac{\theta}{2}\right)-\sin^2\left(\frac{\theta}{2}\right)\right)}{2}", + "\displaystyle \frac{1-\left(2\cos^2\left(\frac{\theta}{2}\right)-1\right)}{2}", + "\displaystyle \frac{2\cos^2\left(\frac{\theta}{2}\right)}{2}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +To relate [`\cos(\theta)`] with [`\sin\left(\frac{\theta}{2}\right)`], we should use cosine's double angle formula: + + [``\begin{aligned} + \cos(2\theta) &= 1-2\sin^2(\theta) \\ + \cos(\theta) &= 1-2\sin^2\left(\frac{\theta}{2}\right) + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$right] + \end{aligned}``] + +One more step, and we will prove sine's half-angle formula: + + [``\begin{aligned} + [$right] &= [$left] \\ + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity20.pg b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity20.pg new file mode 100644 index 0000000000..2e1ea0dfee --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity20.pg @@ -0,0 +1,169 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{1+\cos(\theta)}{2} "; +$right = "\displaystyle \cos^2\left(\frac{\theta}{2}\right)"; + +@steps = ( + "\displaystyle \frac{1+2\cos^2\left(\frac{\theta}{2}\right)-1}{2}", + "\displaystyle \frac{2\cos^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{1+\cos^2\left(\frac{\theta}{2}\right)-\sin^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{1+1-2\sin^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{2\sin^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{1+2\sin^2\left(\frac{\theta}{2}\right)-1}{2}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +To relate [`\cos(\theta)`] with [`\cos\left(\frac{\theta}{2}\right)`], we should use cosine's double angle formula: + + [``\begin{aligned} + \cos(2\theta) &= 2\sin^2(\theta)-1 \\ + \cos(\theta) &= 2\sin^2\left(\frac{\theta}{2}\right) -1 + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$right] + \end{aligned}``] + +One more step, and we will prove sine's half-angle formula: + + [``\begin{aligned} + [$right] &= [$left] \\ + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity30.pg b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity30.pg new file mode 100644 index 0000000000..1e9f2f6966 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity30.pg @@ -0,0 +1,175 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{1-\cos(\theta)}{1+\cos(\theta)} "; +$right = "\displaystyle \tan^2\left(\frac{\theta}{2}\right)"; + +@steps = ( + "\displaystyle \frac{1-\left(1-2\sin^2\left(\frac{\theta}{2}\right)\right)}{1+\left(2\cos^2\left(\frac{\theta}{2}\right)-1\right)}", + "\displaystyle \frac{1-1+2\sin^2\left(\frac{\theta}{2}\right)}{1+2\cos^2\left(\frac{\theta}{2}\right)-1}", + "\displaystyle \frac{2\sin^2\left(\frac{\theta}{2}\right)}{2\cos^2\left(\frac{\theta}{2}\right)}", + "\displaystyle \frac{\sin^2\left(\frac{\theta}{2}\right)}{\cos^2\left(\frac{\theta}{2}\right)}", + "\displaystyle \frac{1-\left(2\sin^2\left(\frac{\theta}{2}\right)-1\right)}{1+\left(1-2\cos^2\left(\frac{\theta}{2}\right)\right)}", + "\displaystyle \frac{2\cos^2\left(\frac{\theta}{2}\right)}{2\sin^2\left(\frac{\theta}{2}\right)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Recognize that: + + [``\tan\left(\frac{\theta}{2}\right)=\frac{\sin\left(\frac{\theta}{2}\right)}{\cos\left(\frac{\theta}{2}\right)}``] + +To relate [`\cos(\theta)`] with [`\sin\left(\frac{\theta}{2}\right)`] and [`\cos\left(\frac{\theta}{2}\right)`], we should use cosine's double angle formula: + + [``\begin{aligned} + \sin(\theta) &= 1-2\sin^2\left(\frac{\theta}{2}\right) \\ + \cos(\theta) &= 2\cos^2\left(\frac{\theta}{2}-1\right) + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$right] + \end{aligned}``] + +One more step, and we will prove sine's half-angle formula: + + [``\begin{aligned} + [$right] &= [$left] \\ + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas10.pg b/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas10.pg new file mode 100644 index 0000000000..cad7165df8 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas10.pg @@ -0,0 +1,338 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + $a = 2*$a; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,360)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +Context("LimitedRadical"); +%a2 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 30 => [ + ["\frac{1}{2}", 1, 1, 2], + ["\frac{\sqrt{3}}{2}", 1, 3, 2], + ["\frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 150 => [ + ["\frac{1}{2}", 1, 1, 2], + ["-\frac{\sqrt{3}}{2}", -1, 3, 2], + ["-\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 210 => [ + ["-\frac{1}{2}", -1, 1, 2], + ["-\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 330 => [ + ["-\frac{1}{2}", -1, 1, 2], + ["\frac{\sqrt{3}}{2}", 1, 3, 2], + ["-\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 45 => [ + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["1", 1, 1, 1], + ], + 135 => [ + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["-1", -1, 1, 1], + ], + 225 => [ + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["1", 1, 1, 1], + ], + 315 => [ + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["-1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%aShow = ( + 15 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(7-4*sqrt(3))")], + 75 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(7+4*sqrt(3))")], + 105 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("-sqrt(2-sqrt(3))/2"), + Formula("-sqrt(7+4*sqrt(3))")], + 165 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("-sqrt(2+sqrt(3))/2"), + Formula("-sqrt(7-4*sqrt(3))")], + 22.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("(sqrt{2+sqrt(2)})/2"), + Formula("sqrt(3-2*sqrt(2))")], + 67.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("(sqrt{2-sqrt(2)})/2"), + Formula("sqrt(3+2*sqrt(2))")], + 112.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("-(sqrt{2-sqrt(2)})/2"), + Formula("-sqrt(3+2*sqrt(2))")], + 157.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("-(sqrt{2+sqrt(2)})/2"), + Formula("-sqrt(3-2*sqrt(2))")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%a = ( + 15 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(7-4*sqrt(3))")], + 75 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(7+4*sqrt(3))")], + 105 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("-sqrt(2-sqrt(3))/2"), + Formula("-sqrt(7+4*sqrt(3))")], + 165 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("-sqrt(2+sqrt(3))/2"), + Formula("-sqrt(7-4*sqrt(3))")], + 22.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("(sqrt{2+sqrt(2)})/2"), + Formula("sqrt(3-2*sqrt(2))")], + 67.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("(sqrt{2-sqrt(2)})/2"), + Formula("sqrt(3+2*sqrt(2))")], + 112.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("-(sqrt{2-sqrt(2)})/2"), + Formula("-sqrt(3+2*sqrt(2))")], + 157.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("-(sqrt{2+sqrt(2)})/2"), + Formula("-sqrt(3-2*sqrt(2))")], +); + + +$angle = list_random(15, 75, 105, 165, 22.5, 67.5, 112.5, 157.5); +$angle2 = 2*$angle; +$angleR = &angleToRadian($angle); +$angle2R = &angleToRadian($angle2); + +sub quadrant { + my $a = shift; + if ($a<90) {return "I";} + elsif ($a<180) {return "II";} + elsif ($a<270) {return "III";} + else {return "IV";} +} +$Q = quadrant($angle); +$pnSine = ($a{$angle}[0]>0) ? "positive" : "negative"; +$pnCosine = ($a{$angle}[1]>0) ? "positive" : "negative"; +$pnTangent = ($a{$angle}[2]>0) ? "positive" : "negative"; + +############################################## + +BEGIN_PGML + +Without using a calculator, use half-angle formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$angleR]\right) = ``][_________]{$a{$angle}[0]->cmp(correct_ans_latex_string=>($aShow{$angle}[0]->TeX))} + + [`` \cos\left([$angleR]\right) = ``][_________]{$a{$angle}[1]->cmp(correct_ans_latex_string=>($aShow{$angle}[1]->TeX))} + + [`` \tan\left([$angleR]\right) = ``][_________]{$a{$angle}[2]->cmp(correct_ans_latex_string=>($aShow{$angle}[2]->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("LimitedRadical"); +if ($a2{$angle2}[1][1]>0) { + $s1 = "1-$a2{$angle2}[1][0]"; + $s2 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; +} else { + my $z0 = &createRadical(-$a2{$angle2}[1][1],$a2{$angle2}[1][2],$a2{$angle2}[1][3]); + $s1 = "1+$z0"; + $s2 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; +} + +$den = ($a2{$angle2}[1][3])**2-$a2{$angle2}[1][2]; +$z1 = ($a2{$angle2}[1][3])**2+$a2{$angle2}[1][2]; +$z2 = 2*$a2{$angle2}[1][3]; +$z3 = $z1/$den; +$z4 = $z2/$den; +if ($a2{$angle2}[1][1]>0) { + $s3 = "1+$a2{$angle2}[1][0]"; + $s4 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; + $s5 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; + $s6 = "$z1-$z2\sqrt{$a2{$angle2}[1][2]}"; + $s7 = "$z3-$z4\sqrt{$a2{$angle2}[1][2]}"; +} else { + $s3 = "1$a2{$angle2}[1][0]"; + $s4 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; + $s5 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; + $s6 = "$z1+$z2\sqrt{$a2{$angle2}[1][2]}"; + $s7 = "$z3+$z4\sqrt{$a2{$angle2}[1][2]}"; +} + + + +############################################## + +BEGIN_PGML_SOLUTION + +Recognize that: + + [`` [$angleR] \text{ radians}= [$angle]^{\circ} = \frac{[$angle2]^{\circ}}{2} ``], + +and [`[$angle2]^{\circ}`] is a special angle on the Unit Circle. We have: + + [`` [$angle2R] = 2\cdot[$angleR] ``]. + +We will use half-angle formulas: + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \sin\left([$angleR]\right) + &= \pm\sqrt{\frac{1-\cos\left([$angle2R]\right)}{2}} \\ + &= \pm\sqrt{\frac{1-\left([$a2{$angle2}[1][0]]\right)}{2}} \\ + &= \pm\sqrt{\frac{\left([$s1]\right)\cdot[$a2{$angle2}[1][3]]}{2\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\frac{\sqrt{[$s2]}}{2} \\ + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\sin\left([$angleR]\right)`] is [$pnSine], so [`\sin\left([$angleR]\right)=[$aShow{$angle}[0]] `]. + +###Problem 2 + + [``\begin{aligned} + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \cos\left([$angleR]\right) + &= \pm\sqrt{\frac{1+\cos\left([$angle2R]\right)}{2}} \\ + &= \pm\sqrt{\frac{1+\left([$a2{$angle2}[1][0]]\right)}{2}} \\ + &= \pm\sqrt{\frac{\left([$s3]\right)\cdot[$a2{$angle2}[1][3]]}{2\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\frac{\sqrt{[$s4]}}{2} \\ + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\cos\left([$angleR]\right)`] is [$pnCosine], so [`\cos\left([$angleR]\right)=[$aShow{$angle}[1]] `]. + +###Problem 3 + + [``\begin{aligned} + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \tan\left([$angleR]\right) + &= \pm\sqrt{\frac{1-\cos\left([$angle2R]\right)}{1+\cos\left([$angle2R]\right)}} \\ + &= \pm\sqrt{\frac{1-\left([$a2{$angle2}[1][0]]\right)}{1+\left([$a2{$angle2}[1][0]]\right)}} \\ + &= \pm\sqrt{\frac{\left([$s1]\right)\cdot[$a2{$angle2}[1][3]]}{\left([$s3]\right)\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\sqrt{\frac{[$s2]}{[$s4]}} \\ + &= \pm\sqrt{\frac{\left([$s2]\right)\cdot\left([$s5]\right)}{\left([$s4]\right)\cdot\left([$s5]\right)}} \\ + &= \pm\sqrt{\frac{[$s6]}{[$den]}} \\ + &= \pm\sqrt{[$s7]} + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\tan\left([$angleR]\right)`] is [$pnTangent], so [`\tan\left([$angleR]\right)=[$aShow{$angle}[2]] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas20.pg b/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas20.pg new file mode 100644 index 0000000000..c4028a9072 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas20.pg @@ -0,0 +1,391 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + $a = 2*$a; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,360)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +Context("LimitedRadical"); +%a2 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 30 => [ + ["\frac{1}{2}", 1, 1, 2], + ["\frac{\sqrt{3}}{2}", 1, 3, 2], + ["\frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 150 => [ + ["\frac{1}{2}", 1, 1, 2], + ["-\frac{\sqrt{3}}{2}", -1, 3, 2], + ["-\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 210 => [ + ["-\frac{1}{2}", -1, 1, 2], + ["-\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 330 => [ + ["-\frac{1}{2}", -1, 1, 2], + ["\frac{\sqrt{3}}{2}", 1, 3, 2], + ["-\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 45 => [ + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["1", 1, 1, 1], + ], + 135 => [ + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["-1", -1, 1, 1], + ], + 225 => [ + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["1", 1, 1, 1], + ], + 315 => [ + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["-1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%aShow = ( + 15 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(7-4*sqrt(3))")], + 75 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(7+4*sqrt(3))")], + 105 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("-sqrt(2-sqrt(3))/2"), + Formula("-sqrt(7+4*sqrt(3))")], + 165 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("-sqrt(2+sqrt(3))/2"), + Formula("-sqrt(7-4*sqrt(3))")], + 22.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("(sqrt{2+sqrt(2)})/2"), + Formula("sqrt(3-2*sqrt(2))")], + 67.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("(sqrt{2-sqrt(2)})/2"), + Formula("sqrt(3+2*sqrt(2))")], + 112.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("-(sqrt{2-sqrt(2)})/2"), + Formula("-sqrt(3+2*sqrt(2))")], + 157.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("-(sqrt{2+sqrt(2)})/2"), + Formula("-sqrt(3-2*sqrt(2))")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%a = ( + 15 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(7-4*sqrt(3))")], + 75 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(7+4*sqrt(3))")], + 105 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("-sqrt(2-sqrt(3))/2"), + Formula("-sqrt(7+4*sqrt(3))")], + 165 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("-sqrt(2+sqrt(3))/2"), + Formula("-sqrt(7-4*sqrt(3))")], + 22.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("(sqrt{2+sqrt(2)})/2"), + Formula("sqrt(3-2*sqrt(2))")], + 67.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("(sqrt{2-sqrt(2)})/2"), + Formula("sqrt(3+2*sqrt(2))")], + 112.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("-(sqrt{2-sqrt(2)})/2"), + Formula("-sqrt(3+2*sqrt(2))")], + 157.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("-(sqrt{2+sqrt(2)})/2"), + Formula("-sqrt(3-2*sqrt(2))")], +); + + +$angle = list_random(15, 75, 105, 165, 22.5, 67.5, 112.5, 157.5); +$angle2 = 2*$angle; +$angleR = &angleToRadian($angle); +$angle2R = &angleToRadian($angle2); + +sub quadrant { + my $a = shift; + if ($a<90) {return "I";} + elsif ($a<180) {return "II";} + elsif ($a<270) {return "III";} + else {return "IV";} +} +$Q = quadrant($angle); +$pnSine = ($a{$angle}[0]>0) ? "positive" : "negative"; +$pnCosine = ($a{$angle}[1]>0) ? "positive" : "negative"; +$pnTangent = ($a{$angle}[2]>0) ? "positive" : "negative"; + +$angleN = -$angle; +$angleRN = &angleToRadian($angleN); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +$ans0 = -$a{$angle}[0]; +$ans1 = $a{$angle}[1]; +$ans2 = -$a{$angle}[2]; + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub makeNeg { + Context("LimitedRadical"); + Context()->noreduce('(-x)-y'); + Context()->noreduce('(-x)-y','(-x)+y'); + + my $st = shift->{string}; + if (substr($st,0,1) eq '-') { + my $r = substr($st,1); + return Formula("$r"); + } else { + return Formula("-$st"); + } +} + +$ans0Show = makeNeg($aShow{$angle}[0]); +$ans1Show = $aShow{$angle}[1]; +$ans2Show = makeNeg($aShow{$angle}[2]); + + +############################################## + +BEGIN_PGML + +Without using a calculator, use half-angle formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$angleRN]\right) = ``][_________]{$ans0->cmp(correct_ans_latex_string=>($ans0Show->TeX))} + + [`` \cos\left([$angleRN]\right) = ``][_________]{$ans1->cmp(correct_ans_latex_string=>($ans1Show->TeX))} + + [`` \tan\left([$angleRN]\right) = ``][_________]{$ans2->cmp(correct_ans_latex_string=>($ans2Show->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("LimitedRadical"); +if ($a2{$angle2}[1][1]>0) { + $s1 = "1-$a2{$angle2}[1][0]"; + $s2 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; +} else { + my $z0 = &createRadical(-$a2{$angle2}[1][1],$a2{$angle2}[1][2],$a2{$angle2}[1][3]); + $s1 = "1+$z0"; + $s2 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; +} + +$den = ($a2{$angle2}[1][3])**2-$a2{$angle2}[1][2]; +$z1 = ($a2{$angle2}[1][3])**2+$a2{$angle2}[1][2]; +$z2 = 2*$a2{$angle2}[1][3]; +$z3 = $z1/$den; +$z4 = $z2/$den; +if ($a2{$angle2}[1][1]>0) { + $s3 = "1+$a2{$angle2}[1][0]"; + $s4 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; + $s5 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; + $s6 = "$z1-$z2\sqrt{$a2{$angle2}[1][2]}"; + $s7 = "$z3-$z4\sqrt{$a2{$angle2}[1][2]}"; +} else { + $s3 = "1$a2{$angle2}[1][0]"; + $s4 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; + $s5 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; + $s6 = "$z1+$z2\sqrt{$a2{$angle2}[1][2]}"; + $s7 = "$z3+$z4\sqrt{$a2{$angle2}[1][2]}"; +} + + + +############################################## + +BEGIN_PGML_SOLUTION + +When we evaluate the trigonometry value of a negative angle, we can evaluate the value of the corresponding positive angle, and then use the following properties: + + [``\begin{aligned} + \sin(-\theta) &= -\sin(\theta) \\ + \cos(-\theta) &= \cos(\theta) \\ + \tan(-\theta) &= -\tan(\theta) \\ + \end{aligned}``] + +Recognize that: + + [`` [$angleR] \text{ radians}= [$angle]^{\circ} = \frac{[$angle2]^{\circ}}{2} ``], + +and [`[$angle2]^{\circ}`] is a special angle on the Unit Circle. We have: + + [`` [$angle2R] = 2\cdot[$angleR] ``]. + +We will use half-angle formulas: + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \sin\left([$angleR]\right) + &= \pm\sqrt{\frac{1-\cos\left([$angle2R]\right)}{2}} \\ + &= \pm\sqrt{\frac{1-\left([$a2{$angle2}[1][0]]\right)}{2}} \\ + &= \pm\sqrt{\frac{\left([$s1]\right)\cdot[$a2{$angle2}[1][3]]}{2\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\frac{\sqrt{[$s2]}}{2} \\ + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\sin\left([$angleR]\right)`] is [$pnSine], so [`\sin\left([$angleR]\right)=[$aShow{$angle}[0]] `]. + +Finally, since [`\sin(-\theta) = -\sin(\theta)`], we have: + + [``\sin\left([$angleRN]\right)=[$ans0Show] ``] + +###Problem 2 + + [``\begin{aligned} + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \cos\left([$angleR]\right) + &= \pm\sqrt{\frac{1+\cos\left([$angle2R]\right)}{2}} \\ + &= \pm\sqrt{\frac{1+\left([$a2{$angle2}[1][0]]\right)}{2}} \\ + &= \pm\sqrt{\frac{\left([$s3]\right)\cdot[$a2{$angle2}[1][3]]}{2\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\frac{\sqrt{[$s4]}}{2} \\ + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\cos\left([$angleR]\right)`] is [$pnCosine], so [`\cos\left([$angleR]\right)=[$aShow{$angle}[1]] `]. + +Finally, since [`\cos(-\theta) = \cos(\theta)`], we have: + + [``\cos\left([$angleRN]\right)=[$ans1Show] ``] + +###Problem 3 + + [``\begin{aligned} + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \tan\left([$angleR]\right) + &= \pm\sqrt{\frac{1-\cos\left([$angle2R]\right)}{1+\cos\left([$angle2R]\right)}} \\ + &= \pm\sqrt{\frac{1-\left([$a2{$angle2}[1][0]]\right)}{1+\left([$a2{$angle2}[1][0]]\right)}} \\ + &= \pm\sqrt{\frac{\left([$s1]\right)\cdot[$a2{$angle2}[1][3]]}{\left([$s3]\right)\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\sqrt{\frac{[$s2]}{[$s4]}} \\ + &= \pm\sqrt{\frac{\left([$s2]\right)\cdot\left([$s5]\right)}{\left([$s4]\right)\cdot\left([$s5]\right)}} \\ + &= \pm\sqrt{\frac{[$s6]}{[$den]}} \\ + &= \pm\sqrt{[$s7]} + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\tan\left([$angleR]\right)`] is [$pnTangent], so [`\tan\left([$angleR]\right)=[$aShow{$angle}[2]] `]. + +Finally, since [`\tan(-\theta) = -\tan(\theta)`], we have: + + [``\tan\left([$angleRN]\right)=[$ans2Show] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas30.pg b/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas30.pg new file mode 100644 index 0000000000..cf08a05e9d --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas30.pg @@ -0,0 +1,345 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is sqrt($num,$den) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($inT,$inB) = shift->value; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($out1,$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? 1 : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? -1 : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); + +@quadrant = (); +$quadrant[0] = random(2,4,1); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@int2 = (); +@Q = (); +@pn = (); +@pns = (); + +for my $k (0..0) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $int2[$k] = "\left(\frac{\pi}{4},\frac{\pi}{2}\right)"; + $Q[$k] = "II"; + $pn[0] = "positive"; $pn[1] = "positive"; $pn[2] = "positive"; + $pns[0] = ''; $pns[1] = ''; $pns[2] = ''; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + $int2[$k] = "\left(\frac{\pi}{2},\frac{3\pi}{4}\right)"; + $pn[0] = "positive"; $pn[1] = "negative"; $pn[2] = "negative"; + $pns[0] = ''; $pns[1] = '-'; $pns[2] = '-'; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + $int2[$k] = "\left(\frac{3\pi}{4},\pi\right)"; + $pn[0] = "positive"; $pn[1] = "negative"; $pn[2] = "negative"; + $pns[0] = ''; $pns[1] = '-'; $pns[2] = '-'; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..0) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +@s1 = (); +@s2 = (); +@ans = (); + +for my $i (0..1) { + Context("Fraction"); + Context()->flags->set(requirePureFractions=>1); + Context()->flags->set(showMixedNumbers=>0); + $s1[$i] = (1-$trigs[0][1]*(-1)**$i)->reduce; + $s2[$i] = ($s1[$i]/2)->reduce; + $ans[$i] = rationalize($s2[$i]); + if ($pns[$i] eq '-') { + my $a = $ans[$i]->string; + Context("LimitedRadical"); + $ans[$i] = Formula("-$a"); + } +} + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +$s3 = ($s1[0]/$s1[1])->reduce; +$ans[2] = rationalize($s3); +if ($pns[2] eq '-') { + my $a = $ans[2]->string; + Context("LimitedRadical"); + $ans[2] = Formula("-$a"); +} + + +############################################################## + +BEGIN_PGML + +If it's given that + + [`\tan(\theta)=[$trigs[0][2]]`] and [`\theta\in[$int[0]]`], + +evaluate the following. + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + +a) [`\sin\left(\frac{\theta}{2}\right)=`][_____________]{$ans[0]} + +a) [`\cos\left(\frac{\theta}{2}\right)=`][_____________]{$ans[1]} + +a) [`\tan\left(\frac{\theta}{2}\right)=`][_____________]{$ans[2]} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin\left(\frac{\theta}{2}\right)`], we will use the formula + + [`` \sin\left(\frac{\theta}{2}\right) = \pm\sqrt{\frac{1-\cos(\theta)}{2}} ``] + +We need to find the values of [`\cos(\theta)`]. + +###Calculating [`\cos(\theta)`] + +It's given that [`\tan(\theta)=[$trigs[0][2]]`] and [`\theta\in[$int[0]]`]. We can sketch [`\theta`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{([$absBase[0]])^2+\left([$absHeight[0]]\right)^2}=[$hypotenuse[0]]`]. + +We can see [`\cos(\theta)=[$trigs[0][1]]`]. + +###Calculating [` \sin\left(\frac{\theta}{2}\right) `] + +Since [`\theta\in[$int[0]]`], we have [`\frac{\theta}{2}\in[$int2[0]]`], so the value of [` \sin\left(\frac{\theta}{2}\right) `] is [$pn[0]]. + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) + &= [$pns[0]]\sqrt{\frac{1-\cos(\theta)}{2}} \\ + &= [$pns[0]]\sqrt{\frac{1-\left([$trigs[0][1]]\right)}{2}} \\ + &= [$pns[0]]\sqrt{\frac{[$s1[0]]}{2}} \\ + &= [$pns[0]]\sqrt{[$s2[0]]} \\ + &= [$ans[0]] + \end{aligned}``] + +###Calculating [` \cos\left(\frac{\theta}{2}\right) `] + +Since [`\frac{\theta}{2}\in[$int2[0]]`], the value of [` \cos\left(\frac{\theta}{2}\right) `] is [$pn[1]]. + + [``\begin{aligned} + \cos\left(\frac{\theta}{2}\right) + &= [$pns[1]]\sqrt{\frac{1+\cos(\theta)}{2}} \\ + &= [$pns[1]]\sqrt{\frac{1+\left([$trigs[0][1]]\right)}{2}} \\ + &= [$pns[1]]\sqrt{\frac{[$s1[1]]}{2}} \\ + &= [$pns[1]]\sqrt{[$s2[1]]} \\ + &= [$ans[1]] + \end{aligned}``] + +###Calculating [` \tan\left(\frac{\theta}{2}\right) `] + +Although there are other methods to calculate [` \tan\left(\frac{\theta}{2}\right) `], we will use the half-angle formula to practice it. + +Since [`\frac{\theta}{2}\in[$int2[0]]`], the value of [` \tan\left(\frac{\theta}{2}\right) `] is [$pn[2]]. + + [``\begin{aligned} + \tan\left(\frac{\theta}{2}\right) + &= [$pns[2]]\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + &= [$pns[2]]\sqrt{\frac{1-\left([$trigs[0][1]]\right)}{1+\left([$trigs[0][1]]\right)}} \\ + &= [$pns[2]]\sqrt{\frac{[$s1[0]]}{[$s1[1]]}} \\ + &= [$pns[2]]\sqrt{[$s3]} \\ + &= [$ans[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas40.pg b/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas40.pg new file mode 100644 index 0000000000..b9fb59739b --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas40.pg @@ -0,0 +1,345 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is sqrt($num,$den) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($inT,$inB) = shift->value; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($out1,$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); + +@quadrant = (); +$quadrant[0] = random(2,4,1); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@int2 = (); +@Q = (); +@pn = (); +@pns = (); + +for my $k (0..0) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $int2[$k] = "\left(\frac{\pi}{4},\frac{\pi}{2}\right)"; + $Q[$k] = "II"; + $pn[0] = "positive"; $pn[1] = "positive"; $pn[2] = "positive"; + $pns[0] = ''; $pns[1] = ''; $pns[2] = ''; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + $int2[$k] = "\left(\frac{\pi}{2},\frac{3\pi}{4}\right)"; + $pn[0] = "positive"; $pn[1] = "negative"; $pn[2] = "negative"; + $pns[0] = ''; $pns[1] = '-'; $pns[2] = '-'; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + $int2[$k] = "\left(\frac{3\pi}{4},\pi\right)"; + $pn[0] = "positive"; $pn[1] = "negative"; $pn[2] = "negative"; + $pns[0] = ''; $pns[1] = '-'; $pns[2] = '-'; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..0) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +@s1 = (); +@s2 = (); +@ans = (); + +for my $i (0..1) { + Context("Fraction"); + Context()->flags->set(requirePureFractions=>1); + Context()->flags->set(showMixedNumbers=>0); + $s1[$i] = (1-$trigs[0][1]*(-1)**$i)->reduce; + $s2[$i] = ($s1[$i]/2)->reduce; + $ans[$i] = rationalize($s2[$i]); + if ($pns[$i] eq '-') { + my $a = $ans[$i]->string; + Context("LimitedRadical"); + $ans[$i] = Formula("-$a"); + } +} + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +$s3 = ($s1[0]/$s1[1])->reduce; +$ans[2] = rationalize($s3); +if ($pns[2] eq '-') { + my $a = $ans[2]->string; + Context("LimitedRadical"); + $ans[2] = Formula("-$a"); +} + + +############################################################## + +BEGIN_PGML + +If it's given that + + [`\sin(\theta)=[$trigs[0][0]]`] and [`\theta\in[$int[0]]`], + +evaluate the following. + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + +a) [`\sin\left(\frac{\theta}{2}\right)=`][_____________]{$ans[0]} + +a) [`\cos\left(\frac{\theta}{2}\right)=`][_____________]{$ans[1]} + +a) [`\tan\left(\frac{\theta}{2}\right)=`][_____________]{$ans[2]} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin\left(\frac{\theta}{2}\right)`], we will use the formula + + [`` \sin\left(\frac{\theta}{2}\right) = \pm\sqrt{\frac{1-\cos(\theta)}{2}} ``] + +We need to find the values of [`\cos(\theta)`]. + +###Calculating [`\cos(\theta)`] + +It's given that [`\sin(\theta)=[$trigs[0][2]]`] and [`\theta\in[$int[0]]`]. We can sketch [`\theta`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse[0]])^2-\left([$height[0]]\right)^2}=[$absBase[0]]`]. + +We can see [`\cos(\theta)=[$trigs[0][1]]`]. + +###Calculating [` \sin\left(\frac{\theta}{2}\right) `] + +Since [`\theta\in[$int[0]]`], we have [`\frac{\theta}{2}\in[$int2[0]]`], so the value of [` \sin\left(\frac{\theta}{2}\right) `] is [$pn[0]]. + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) + &= [$pns[0]]\sqrt{\frac{1-\cos(\theta)}{2}} \\ + &= [$pns[0]]\sqrt{\frac{1-\left([$trigs[0][1]]\right)}{2}} \\ + &= [$pns[0]]\sqrt{\frac{[$s1[0]]}{2}} \\ + &= [$pns[0]]\sqrt{[$s2[0]]} \\ + &= [$ans[0]] + \end{aligned}``] + +###Calculating [` \cos\left(\frac{\theta}{2}\right) `] + +Since [`\frac{\theta}{2}\in[$int2[0]]`], the value of [` \cos\left(\frac{\theta}{2}\right) `] is [$pn[1]]. + + [``\begin{aligned} + \cos\left(\frac{\theta}{2}\right) + &= [$pns[1]]\sqrt{\frac{1+\cos(\theta)}{2}} \\ + &= [$pns[1]]\sqrt{\frac{1+\left([$trigs[0][1]]\right)}{2}} \\ + &= [$pns[1]]\sqrt{\frac{[$s1[1]]}{2}} \\ + &= [$pns[1]]\sqrt{[$s2[1]]} \\ + &= [$ans[1]] + \end{aligned}``] + +###Calculating [` \tan\left(\frac{\theta}{2}\right) `] + +Although there are other methods to calculate [` \tan\left(\frac{\theta}{2}\right) `], we will use the half-angle formula to practice it. + +Since [`\frac{\theta}{2}\in[$int2[0]]`], the value of [` \tan\left(\frac{\theta}{2}\right) `] is [$pn[2]]. + + [``\begin{aligned} + \tan\left(\frac{\theta}{2}\right) + &= [$pns[2]]\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + &= [$pns[2]]\sqrt{\frac{1-\left([$trigs[0][1]]\right)}{1+\left([$trigs[0][1]]\right)}} \\ + &= [$pns[2]]\sqrt{\frac{[$s1[0]]}{[$s1[1]]}} \\ + &= [$pns[2]]\sqrt{[$s3]} \\ + &= [$ans[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas10.pg b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas10.pg new file mode 100644 index 0000000000..ae54fb2536 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas10.pg @@ -0,0 +1,408 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,180)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +@a30 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + 30, + "\displaystyle \frac{\pi}{6}", + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + [ + 60, + "\displaystyle \frac{\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + [ + 120, + "\displaystyle \frac{2\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + [ + 150, + "\displaystyle \frac{5\pi}{6}", + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + [ + 210, + "\displaystyle \frac{7\pi}{6}", + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + [ + 240, + "\displaystyle \frac{4\pi}{3}", + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + [ + 300, + "\displaystyle \frac{5\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + [ + 330, + "\displaystyle \frac{11\pi}{6}", + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], +); + +@a45 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + 45, + "\displaystyle \frac{\pi}{4}", + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + [ + 135, + "\displaystyle \frac{3\pi}{4}", + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], + [ + 225, + "\displaystyle \frac{5\pi}{4}", + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + [ + 315, + "\displaystyle \frac{7\pi}{4}", + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ansShow = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ans = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +do { + $i30 = random(0,7,1); + $i45 = random(0,3,1); + $aSum = $a30[$i30][0]+$a45[$i45][0]; +} until ($aSum<360); + +$aSumR = &angleToRadian($aSum); + +Context("LimitedRadical"); + +#sin(30)*cos(45) +$product0 = &multiplyRadicals( + $a30[$i30][2][1]*$a45[$i45][3][1], + $a30[$i30][2][2]*$a45[$i45][3][2], + $a30[$i30][2][3]*$a45[$i45][3][3] +); + +#sin(45)*cos(30) +$product1 = &multiplyRadicals( + $a30[$i30][3][1]*$a45[$i45][2][1], + $a30[$i30][3][2]*$a45[$i45][2][2], + $a30[$i30][3][3]*$a45[$i45][2][3] +); + +#cos(30)*cos(45) +$product2 = &multiplyRadicals( + $a30[$i30][3][1]*$a45[$i45][3][1], + $a30[$i30][3][2]*$a45[$i45][3][2], + $a30[$i30][3][3]*$a45[$i45][3][3] +); + +#sin(30)*sin(45) +$product3 = &multiplyRadicals( + $a30[$i30][2][1]*$a45[$i45][2][1], + $a30[$i30][2][2]*$a45[$i45][2][2], + $a30[$i30][2][3]*$a45[$i45][2][3] +); + +#tan(30)*tan(45) +$product4 = &multiplyRadicals( + $a30[$i30][4][1]*$a45[$i45][4][1], + $a30[$i30][4][2]*$a45[$i45][4][2], + $a30[$i30][4][3]*$a45[$i45][4][3] +); + + +$output = ""; +($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a30[$i30][4][1],$a30[$i30][4][2],$a30[$i30][4][3], + $a45[$i45][4][1],$a45[$i45][4][2],$a45[$i45][4][3] +); +$a12 = $a1*$a2; +$b12 = $b1*$b2; +$c12 = $c1*$c2; + +$n1 = &createRadical($a1,$b1,$c1); +$n2 = &createRadical($a2,$b2,$c2); +$top = ($a2>0) ? "$n1+$n2" : "$n1$n2"; +$bottom = "1-$product4"; +$output .= "&=\frac{$top}{$bottom}\\"; + +if ($c12!=1) { + $top = ($a2>0) ? "($n1+$n2)\cdot$c12" : "($n1$n2)\cdot$c12"; + $bottom = "($bottom)\cdot$c12"; + $output .= "&=\frac{$top}{$bottom}\\"; + $n3 = &createRadical($a1*$c2,$b1,1); + $n4 = &createRadical($a2*$c1,$b2,1); + $top = ($a2*$c1>0) ? "$n3+$n4" : "$n3$n4"; + $n5 = &createRadical($a1*$a2,$b1*$b2,1); + $bottom = "$c12-$n5"; + $output .= "&=\frac{$top}{$bottom}\\"; + $output .= "&=\frac{($top)\cdot($c12+$n5)}{($bottom)\cdot($c12+$n5)}\\"; +} else { + $output .= "&=\frac{($top)\cdot(1+$product4)}{($bottom)\cdot(1+$product4)}\\"; +} +$bottom = ($c1*$c2)**2-($a1*$a2)**2*$b1*$b2; +$n1 = $c1*$a1*($c2)**2+$a1*($a2)**2*$c1*$b2; +$n2 = &createRadical($n1,$b1,1); +$n3 = ($a1)**2*$a2*$c2*$b1+$a2*($c1)**2*$c2; +$n4 = &createRadical($n3,$b2,1); +$output .= "&=\frac{$n2+$n4}{$bottom}\\"; + + +############################################## + +BEGIN_PGML + +Without using a calculator, use the following formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$aSumR]\right) = ``][_________]{$ans{$aSum}[0]->cmp(correct_ans_latex_string=>($ansShow{$aSum}[0]->TeX))} + + [`` \cos\left([$aSumR]\right) = ``][_________]{$ans{$aSum}[1]->cmp(correct_ans_latex_string=>($ansShow{$aSum}[1]->TeX))} + + [`` \tan\left([$aSumR]\right) = ``][_________]{$ans{$aSum}[2]->cmp(correct_ans_latex_string=>($ansShow{$aSum}[2]->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Recognize that: + + [`` [$aSumR] \text{ radians}= [$aSum]^{\circ} = [$a30[$i30][0]]^{\circ} + [$a45[$i45][0]]^{\circ} ``], + +so: + + [`` [$aSumR] = [$a30[$i30][1]] + [$a45[$i45][1]] ``]. + +We will use the following formulas: + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left([$aSumR]\right) + &= \sin\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \sin\left([$a30[$i30][1]]\right)\cos\left([$a45[$i45][1]]\right) + \cos\left([$a30[$i30][1]]\right)\sin\left([$a45[$i45][1]]\right) \\ + &= \left([$a30[$i30][2][0]]\right)\left([$a45[$i45][3][0]]\right) + \left([$a30[$i30][3][0]]\right)\left([$a45[$i45][2][0]]\right) \\ + &= [$product0] + [$product1] \\ + &= [$ansShow{$aSum}[0]] + \end{aligned}``] + +###Problem 2 + + [``\begin{aligned} + \cos\left([$aSumR]\right) + &= \cos\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \cos\left([$a30[$i30][1]]\right)\cos\left([$a45[$i45][1]]\right) - \sin\left([$a45[$i45][1]]\right)\sin\left([$a30[$i30][1]]\right) \\ + &= \left([$a30[$i30][3][0]]\right)\left([$a45[$i45][3][0]]\right) - \left([$a45[$i45][2][0]]\right)\left([$a30[$i30][2][0]]\right) \\ + &= [$product2] - [$product3] \\ + &= [$ansShow{$aSum}[1]] + \end{aligned}``] + +###Problem 3 + + [``\begin{aligned} + \tan\left([$aSumR]\right) + &= \tan\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \frac{\tan\left([$a30[$i30][1]]\right)+\tan\left([$a45[$i45][1]]\right)}{1-\tan\left([$a30[$i30][1]]\right)\tan\left([$a45[$i45][1]]\right)} \\ + &= \frac{\left([$a30[$i30][4][0]]\right)+\left([$a45[$i45][4][0]]\right)}{1 - \left([$a30[$i30][4][0]]\right)\left([$a45[$i45][4][0]]\right)} \\ + [$output] + &= [$ansShow{$aSum}[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas11.pg b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas11.pg new file mode 100644 index 0000000000..cf289ba0dd --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas11.pg @@ -0,0 +1,445 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,180)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +@a30 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + 30, + "\displaystyle \frac{\pi}{6}", + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + [ + 60, + "\displaystyle \frac{\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + [ + 120, + "\displaystyle \frac{2\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + [ + 150, + "\displaystyle \frac{5\pi}{6}", + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + [ + 210, + "\displaystyle \frac{7\pi}{6}", + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + [ + 240, + "\displaystyle \frac{4\pi}{3}", + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + [ + 300, + "\displaystyle \frac{5\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + [ + 330, + "\displaystyle \frac{11\pi}{6}", + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], +); + +@a45 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + 45, + "\displaystyle \frac{\pi}{4}", + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + [ + 135, + "\displaystyle \frac{3\pi}{4}", + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], + [ + 225, + "\displaystyle \frac{5\pi}{4}", + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + [ + 315, + "\displaystyle \frac{7\pi}{4}", + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ansShow = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ans = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +do { + $i30 = random(0,7,1); + $i45 = random(0,3,1); + $aSum = $a30[$i30][0]+$a45[$i45][0]; +} until ($aSum<360); + +$aSumR = &angleToRadian($aSum); + +Context("LimitedRadical"); + +#sin(30)*cos(45) +$product0 = &multiplyRadicals( + $a30[$i30][2][1]*$a45[$i45][3][1], + $a30[$i30][2][2]*$a45[$i45][3][2], + $a30[$i30][2][3]*$a45[$i45][3][3] +); + +#sin(45)*cos(30) +$product1 = &multiplyRadicals( + $a30[$i30][3][1]*$a45[$i45][2][1], + $a30[$i30][3][2]*$a45[$i45][2][2], + $a30[$i30][3][3]*$a45[$i45][2][3] +); + +#cos(30)*cos(45) +$product2 = &multiplyRadicals( + $a30[$i30][3][1]*$a45[$i45][3][1], + $a30[$i30][3][2]*$a45[$i45][3][2], + $a30[$i30][3][3]*$a45[$i45][3][3] +); + +#sin(30)*sin(45) +$product3 = &multiplyRadicals( + $a30[$i30][2][1]*$a45[$i45][2][1], + $a30[$i30][2][2]*$a45[$i45][2][2], + $a30[$i30][2][3]*$a45[$i45][2][3] +); + +#tan(30)*tan(45) +$product4 = &multiplyRadicals( + $a30[$i30][4][1]*$a45[$i45][4][1], + $a30[$i30][4][2]*$a45[$i45][4][2], + $a30[$i30][4][3]*$a45[$i45][4][3] +); + + +$output = ""; +($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a30[$i30][4][1],$a30[$i30][4][2],$a30[$i30][4][3], + $a45[$i45][4][1],$a45[$i45][4][2],$a45[$i45][4][3] +); +$a12 = $a1*$a2; +$b12 = $b1*$b2; +$c12 = $c1*$c2; + +$n1 = &createRadical($a1,$b1,$c1); +$n2 = &createRadical($a2,$b2,$c2); +$top = ($a2>0) ? "$n1+$n2" : "$n1$n2"; +$bottom = "1-$product4"; +$output .= "&=\frac{$top}{$bottom}\\"; + +if ($c12!=1) { + $top = ($a2>0) ? "($n1+$n2)\cdot$c12" : "($n1$n2)\cdot$c12"; + $bottom = "($bottom)\cdot$c12"; + $output .= "&=\frac{$top}{$bottom}\\"; + $n3 = &createRadical($a1*$c2,$b1,1); + $n4 = &createRadical($a2*$c1,$b2,1); + $top = ($a2*$c1>0) ? "$n3+$n4" : "$n3$n4"; + $n5 = &createRadical($a1*$a2,$b1*$b2,1); + $bottom = "$c12-$n5"; + $output .= "&=\frac{$top}{$bottom}\\"; + $output .= "&=\frac{($top)\cdot($c12+$n5)}{($bottom)\cdot($c12+$n5)}\\"; +} else { + $output .= "&=\frac{($top)\cdot(1+$product4)}{($bottom)\cdot(1+$product4)}\\"; +} +$bottom = ($c1*$c2)**2-($a1*$a2)**2*$b1*$b2; +$n1 = $c1*$a1*($c2)**2+$a1*($a2)**2*$c1*$b2; +$n2 = &createRadical($n1,$b1,1); +$n3 = ($a1)**2*$a2*$c2*$b1+$a2*($c1)**2*$c2; +$n4 = &createRadical($n3,$b2,1); +$output .= "&=\frac{$n2+$n4}{$bottom}\\"; + +$aSumN = -$aSum; +$aSumRN = &angleToRadian($aSumN); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +$ans0 = Compute("-$ans{$aSum}[0]"); +$ans1 = Compute("$ans{$aSum}[1]"); +$ans2 = Compute("-$ans{$aSum}[2]"); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$ans0Show = $ansShow{360-$aSum}[0]; +$ans1Show = $ansShow{$aSum}[1]; +$ans2Show = $ansShow{360-$aSum}[2]; + +############################################## + +BEGIN_PGML + +Without using a calculator, use the following formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$aSumRN]\right) = ``][_________]{$ans0->cmp(correct_ans_latex_string=>($ans0Show->TeX))} + + [`` \cos\left([$aSumRN]\right) = ``][_________]{$ans1->cmp(correct_ans_latex_string=>($ans1Show->TeX))} + + [`` \tan\left([$aSumRN]\right) = ``][_________]{$ans2->cmp(correct_ans_latex_string=>($ans2Show->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +When we evaluate the trigonometry value of a negative angle, we can evaluate the value of the corresponding positive angle, and then use the following properties: + + [``\begin{aligned} + \sin(-\theta) &= -\sin(\theta) \\ + \cos(-\theta) &= \cos(\theta) \\ + \tan(-\theta) &= -\tan(\theta) \\ + \end{aligned}``] + +Recognize that: + + [`` [$aSumR] \text{ radians}= [$aSum]^{\circ} = [$a30[$i30][0]]^{\circ} + [$a45[$i45][0]]^{\circ} ``], + +so: + + [`` [$aSumR] = [$a30[$i30][1]] + [$a45[$i45][1]] ``]. + +We will use the following formulas: + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left([$aSumR]\right) + &= \sin\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \sin\left([$a30[$i30][1]]\right)\cos\left([$a45[$i45][1]]\right) + \cos\left([$a30[$i30][1]]\right)\sin\left([$a45[$i45][1]]\right) \\ + &= \left([$a30[$i30][2][0]]\right)\left([$a45[$i45][3][0]]\right) + \left([$a30[$i30][3][0]]\right)\left([$a45[$i45][2][0]]\right) \\ + &= [$product0] + [$product1] \\ + &= [$ansShow{$aSum}[0]] + \end{aligned}``] + +Finally, since [`\sin(-\theta) = -\sin(\theta)`], we have: + + [``\sin\left([$aSumRN]\right)=-\left([$ansShow{$aSum}[0]]\right)=[$ans0Show] ``] + +###Problem 2 + + [``\begin{aligned} + \cos\left([$aSumR]\right) + &= \cos\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \cos\left([$a30[$i30][1]]\right)\cos\left([$a45[$i45][1]]\right) - \sin\left([$a45[$i45][1]]\right)\sin\left([$a30[$i30][1]]\right) \\ + &= \left([$a30[$i30][3][0]]\right)\left([$a45[$i45][3][0]]\right) - \left([$a45[$i45][2][0]]\right)\left([$a30[$i30][2][0]]\right) \\ + &= [$product2] - [$product3] \\ + &= [$ansShow{$aSum}[1]] + \end{aligned}``] + +Finally, since [`\cos(-\theta) = \cos(\theta)`], we have: + + [``\cos\left([$aSumRN]\right)=[$ans1Show] ``] + +###Problem 3 + + [``\begin{aligned} + \tan\left([$aSumR]\right) + &= \tan\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \frac{\tan\left([$a30[$i30][1]]\right)+\tan\left([$a45[$i45][1]]\right)}{1-\tan\left([$a30[$i30][1]]\right)\tan\left([$a45[$i45][1]]\right)} \\ + &= \frac{\left([$a30[$i30][4][0]]\right)+\left([$a45[$i45][4][0]]\right)}{1 - \left([$a30[$i30][4][0]]\right)\left([$a45[$i45][4][0]]\right)} \\ + [$output] + &= [$ansShow{$aSum}[2]] + \end{aligned}``] + +Finally, since [`\tan(-\theta) = -\tan(\theta)`], we have: + + [``\tan\left([$aSumRN]\right)=-\left([$ansShow{$aSum}[2]]\right)=[$ans2Show] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas20.pg b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas20.pg new file mode 100644 index 0000000000..a00eae9bb5 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas20.pg @@ -0,0 +1,419 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,180)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +%a30 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 30 => [ + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 60 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + 120 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + 150 => [ + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 210 => [ + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 240 => [ + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + 300 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + 330 => [ + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], +); + +%a45 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 45 => [ + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + 135 => [ + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], + 225 => [ + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + 315 => [ + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ansShow = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ans = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +do { + $i30 = list_random(30,60,120,150,210,240,300,330); + $i45 = list_random(45,135,225,315); + $aDif = $i30-$i45; + $flag = 0; + if (random(0,1,1)==0) { + $aDif = $i45-$i30; + $flag = 1; + } +} until ($aDif>0); + +$aDifR = &angleToRadian($aDif); + +Context("LimitedRadical"); + +#sin(30)*cos(45) +$product0 = &multiplyRadicals( + $a30{$i30}[$flag][1]*$a45{$i45}[($flag+1)%2][1], + $a30{$i30}[$flag][2]*$a45{$i45}[($flag+1)%2][2], + $a30{$i30}[$flag][3]*$a45{$i45}[($flag+1)%2][3] +); + +#sin(45)*cos(30) +$product1 = &multiplyRadicals( + $a30{$i30}[($flag+1)%2][1]*$a45{$i45}[$flag][1], + $a30{$i30}[($flag+1)%2][2]*$a45{$i45}[$flag][2], + $a30{$i30}[($flag+1)%2][3]*$a45{$i45}[$flag][3] +); + +#cos(30)*cos(45) +$product2 = &multiplyRadicals( + $a30{$i30}[1][1]*$a45{$i45}[1][1], + $a30{$i30}[1][2]*$a45{$i45}[1][2], + $a30{$i30}[1][3]*$a45{$i45}[1][3] +); + +#sin(30)*sin(45) +$product3 = &multiplyRadicals( + $a30{$i30}[0][1]*$a45{$i45}[0][1], + $a30{$i30}[0][2]*$a45{$i45}[0][2], + $a30{$i30}[0][3]*$a45{$i45}[0][3] +); + +#tan(30)*tan(45) +$product4 = &multiplyRadicals( + $a30{$i30}[2][1]*$a45{$i45}[2][1], + $a30{$i30}[2][2]*$a45{$i45}[2][2], + $a30{$i30}[2][3]*$a45{$i45}[2][3] +); + +$output = ""; +if ($flag==0) { + ($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a30{$i30}[2][1],$a30{$i30}[2][2],$a30{$i30}[2][3], + $a45{$i45}[2][1],$a45{$i45}[2][2],$a45{$i45}[2][3] + ); +} else { + ($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a45{$i45}[2][1],$a45{$i45}[2][2],$a45{$i45}[2][3], + $a30{$i30}[2][1],$a30{$i30}[2][2],$a30{$i30}[2][3], + ); +} +$a12 = $a1*$a2; +$b12 = $b1*$b2; +$c12 = $c1*$c2; + +$n1 = &createRadical($a1,$b1,$c1); +$n2 = &createRadical($a2,$b2,$c2); +$top = "$n1-$n2"; +$bottom = "1+$product4"; +$output .= "&=\frac{$top}{$bottom}\\"; + +if ($c12!=1) { + $top = "($n1-$n2)\cdot$c12"; + $bottom = "($bottom)\cdot$c12"; + $output .= "&=\frac{$top}{$bottom}\\"; + $n3 = &createRadical($a1*$c2,$b1,1); + $n4 = &createRadical($a2*$c1,$b2,1); + $top = "$n3-$n4"; + $n5 = &createRadical($a1*$a2,$b1*$b2,1); + $bottom = "$c12+$n5"; + $output .= "&=\frac{$top}{$bottom}\\"; + $output .= "&=\frac{($top)\cdot($c12-$n5)}{($bottom)\cdot($c12-$n5)}\\"; +} else { + $output .= "&=\frac{($top)\cdot(1-$product4)}{($bottom)\cdot(1-$product4)}\\"; +} +$bottom = ($c1*$c2)**2-($a1*$a2)**2*$b1*$b2; +$n1 = $c1*$a1*($c2)**2+$a1*($a2)**2*$c1*$b2; +$n2 = &createRadical($n1,$b1,1); +$n3 = -($a1)**2*$a2*$c2*$b1-$a2*($c1)**2*$c2; +$n4 = &createRadical($n3,$b2,1); +$output .= "&=\frac{$n2+$n4}{$bottom}\\"; + + +############################################## + +BEGIN_PGML + +Without using a calculator, use the following formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$aDifR]\right) = ``][_________]{$ans{$aDif}[0]->cmp(correct_ans_latex_string=>($ansShow{$aDif}[0]->TeX))} + + [`` \cos\left([$aDifR]\right) = ``][_________]{$ans{$aDif}[1]->cmp(correct_ans_latex_string=>($ansShow{$aDif}[1]->TeX))} + + [`` \tan\left([$aDifR]\right) = ``][_________]{$ans{$aDif}[2]->cmp(correct_ans_latex_string=>($ansShow{$aDif}[2]->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +if ($flag==0) { + $an0 = $i30; + $an1 = $i45; + $a0r = angleToRadian($i30); + $a1r = angleToRadian($i45); + $s0 = $a30{$i30}[0][0]; + $c1 = $a45{$i45}[1][0]; + $s1 = $a45{$i45}[0][0]; + $c0 = $a30{$i30}[1][0]; + $s2 = $a30{$i30}[2][0]; + $s3 = $a45{$i45}[2][0]; +} else { + $an1 = $i30; + $an0 = $i45; + $a1r = angleToRadian($i30); + $a0r = angleToRadian($i45); + $s1 = $a30{$i30}[0][0]; + $c0 = $a45{$i45}[1][0]; + $s0 = $a45{$i45}[0][0]; + $c1 = $a30{$i30}[1][0]; + $s3 = $a30{$i30}[2][0]; + $s2 = $a45{$i45}[2][0]; +} + +BEGIN_PGML_SOLUTION + +Recognize that: + + [`` [$aDifR] \text{ radians}= [$aDif]^{\circ} = [$an0]^{\circ} - [$an1]^{\circ} ``], + +so: + + [`` [$aDifR] = [$a0r] - [$a1r] ``]. + +We will use the following formulas: + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left([$aDifR]\right) + &= \sin\left([$a0r]-[$a1r]\right) \\ + &= \sin\left([$a0r]\right)\cos\left([$a1r]\right) - \cos\left([$a0r]\right)\sin\left([$a1r]\right) \\ + &= \left([$s0]\right)\left([$c1]\right) - \left([$c0]\right)\left([$s1]\right) \\ + &= [$product0] - [$product1] \\ + &= [$ansShow{$aDif}[0]] + \end{aligned}``] + +###Problem 2 + + [``\begin{aligned} + \cos\left([$aDifR]\right) + &= \cos\left([$a0r]-[$a1r]\right) \\ + &= \cos\left([$a0r]\right)\cos\left([$a1r]\right) + \sin\left([$a0r]\right)\sin\left([$a1r]\right) \\ + &= \left([$c0]\right)\left([$c1]\right) + \left([$s0]\right)\left([$s1]\right) \\ + &= [$product2] + [$product3] \\ + &= [$ansShow{$aDif}[1]] + \end{aligned}``] + +###Problem 3 + + [``\begin{aligned} + \tan\left([$aDifR]\right) + &= \tan\left([$a0r]-[$a1r]\right) \\ + &= \frac{\tan\left([$a0r]\right)-\tan\left([$a1r]\right)}{1+\tan\left([$a0r]\right)\tan\left([$a1r]\right)} \\ + &= \frac{\left([$s2]\right)-\left([$s3]\right)}{1 + \left([$s2]\right)\left([$s3]\right)} \\ + [$output] + &= [$ansShow{$aDif}[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas21.pg b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas21.pg new file mode 100644 index 0000000000..970c1cd36f --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas21.pg @@ -0,0 +1,456 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,180)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +%a30 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 30 => [ + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 60 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + 120 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + 150 => [ + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 210 => [ + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 240 => [ + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + 300 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + 330 => [ + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], +); + +%a45 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 45 => [ + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + 135 => [ + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], + 225 => [ + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + 315 => [ + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ansShow = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ans = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +do { + $i30 = list_random(30,60,120,150,210,240,300,330); + $i45 = list_random(45,135,225,315); + $aDif = $i30-$i45; + $flag = 0; + if (random(0,1,1)==0) { + $aDif = $i45-$i30; + $flag = 1; + } +} until ($aDif>0); + +$aDifR = &angleToRadian($aDif); + +Context("LimitedRadical"); + +#sin(30)*cos(45) +$product0 = &multiplyRadicals( + $a30{$i30}[$flag][1]*$a45{$i45}[($flag+1)%2][1], + $a30{$i30}[$flag][2]*$a45{$i45}[($flag+1)%2][2], + $a30{$i30}[$flag][3]*$a45{$i45}[($flag+1)%2][3] +); + +#sin(45)*cos(30) +$product1 = &multiplyRadicals( + $a30{$i30}[($flag+1)%2][1]*$a45{$i45}[$flag][1], + $a30{$i30}[($flag+1)%2][2]*$a45{$i45}[$flag][2], + $a30{$i30}[($flag+1)%2][3]*$a45{$i45}[$flag][3] +); + +#cos(30)*cos(45) +$product2 = &multiplyRadicals( + $a30{$i30}[1][1]*$a45{$i45}[1][1], + $a30{$i30}[1][2]*$a45{$i45}[1][2], + $a30{$i30}[1][3]*$a45{$i45}[1][3] +); + +#sin(30)*sin(45) +$product3 = &multiplyRadicals( + $a30{$i30}[0][1]*$a45{$i45}[0][1], + $a30{$i30}[0][2]*$a45{$i45}[0][2], + $a30{$i30}[0][3]*$a45{$i45}[0][3] +); + +#tan(30)*tan(45) +$product4 = &multiplyRadicals( + $a30{$i30}[2][1]*$a45{$i45}[2][1], + $a30{$i30}[2][2]*$a45{$i45}[2][2], + $a30{$i30}[2][3]*$a45{$i45}[2][3] +); + +$output = ""; +if ($flag==0) { + ($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a30{$i30}[2][1],$a30{$i30}[2][2],$a30{$i30}[2][3], + $a45{$i45}[2][1],$a45{$i45}[2][2],$a45{$i45}[2][3] + ); +} else { + ($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a45{$i45}[2][1],$a45{$i45}[2][2],$a45{$i45}[2][3], + $a30{$i30}[2][1],$a30{$i30}[2][2],$a30{$i30}[2][3], + ); +} +$a12 = $a1*$a2; +$b12 = $b1*$b2; +$c12 = $c1*$c2; + +$n1 = &createRadical($a1,$b1,$c1); +$n2 = &createRadical($a2,$b2,$c2); +$top = "$n1-$n2"; +$bottom = "1+$product4"; +$output .= "&=\frac{$top}{$bottom}\\"; + +if ($c12!=1) { + $top = "($n1-$n2)\cdot$c12"; + $bottom = "($bottom)\cdot$c12"; + $output .= "&=\frac{$top}{$bottom}\\"; + $n3 = &createRadical($a1*$c2,$b1,1); + $n4 = &createRadical($a2*$c1,$b2,1); + $top = "$n3-$n4"; + $n5 = &createRadical($a1*$a2,$b1*$b2,1); + $bottom = "$c12+$n5"; + $output .= "&=\frac{$top}{$bottom}\\"; + $output .= "&=\frac{($top)\cdot($c12-$n5)}{($bottom)\cdot($c12-$n5)}\\"; +} else { + $output .= "&=\frac{($top)\cdot(1-$product4)}{($bottom)\cdot(1-$product4)}\\"; +} +$bottom = ($c1*$c2)**2-($a1*$a2)**2*$b1*$b2; +$n1 = $c1*$a1*($c2)**2+$a1*($a2)**2*$c1*$b2; +$n2 = &createRadical($n1,$b1,1); +$n3 = -($a1)**2*$a2*$c2*$b1-$a2*($c1)**2*$c2; +$n4 = &createRadical($n3,$b2,1); +$output .= "&=\frac{$n2+$n4}{$bottom}\\"; + +$aDifN = -$aDif; +$aDifRN = &angleToRadian($aDifN); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +$ans0 = Compute("-$ans{$aDif}[0]"); +$ans1 = Compute("$ans{$aDif}[1]"); +$ans2 = Compute("-$ans{$aDif}[2]"); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$ans0Show = $ansShow{360-$aDif}[0]; +$ans1Show = $ansShow{$aDif}[1]; +$ans2Show = $ansShow{360-$aDif}[2]; + +############################################## + +BEGIN_PGML + +Without using a calculator, use the following formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$aDifRN]\right) = ``][_________]{$ans0->cmp(correct_ans_latex_string=>($ans0Show->TeX))} + + [`` \cos\left([$aDifRN]\right) = ``][_________]{$ans1->cmp(correct_ans_latex_string=>($ans1Show->TeX))} + + [`` \tan\left([$aDifRN]\right) = ``][_________]{$ans2->cmp(correct_ans_latex_string=>($ans2Show->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +if ($flag==0) { + $an0 = $i30; + $an1 = $i45; + $a0r = angleToRadian($i30); + $a1r = angleToRadian($i45); + $s0 = $a30{$i30}[0][0]; + $c1 = $a45{$i45}[1][0]; + $s1 = $a45{$i45}[0][0]; + $c0 = $a30{$i30}[1][0]; + $s2 = $a30{$i30}[2][0]; + $s3 = $a45{$i45}[2][0]; +} else { + $an1 = $i30; + $an0 = $i45; + $a1r = angleToRadian($i30); + $a0r = angleToRadian($i45); + $s1 = $a30{$i30}[0][0]; + $c0 = $a45{$i45}[1][0]; + $s0 = $a45{$i45}[0][0]; + $c1 = $a30{$i30}[1][0]; + $s3 = $a30{$i30}[2][0]; + $s2 = $a45{$i45}[2][0]; +} + +BEGIN_PGML_SOLUTION + +When we evaluate the trigonometry value of a negative angle, we can evaluate the value of the corresponding positive angle, and then use the following properties: + + [``\begin{aligned} + \sin(-\theta) &= -\sin(\theta) \\ + \cos(-\theta) &= \cos(\theta) \\ + \tan(-\theta) &= -\tan(\theta) \\ + \end{aligned}``] + +Recognize that: + + [`` [$aDifR] \text{ radians}= [$aDif]^{\circ} = [$an0]^{\circ} - [$an1]^{\circ} ``], + +so: + + [`` [$aDifR] = [$a0r] - [$a1r] ``]. + +We will use the following formulas: + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left([$aDifR]\right) + &= \sin\left([$a0r]-[$a1r]\right) \\ + &= \sin\left([$a0r]\right)\cos\left([$a1r]\right) - \cos\left([$a0r]\right)\sin\left([$a1r]\right) \\ + &= \left([$s0]\right)\left([$c1]\right) - \left([$c0]\right)\left([$s1]\right) \\ + &= [$product0] - [$product1] \\ + &= [$ansShow{$aDif}[0]] + \end{aligned}``] + +Finally, since [`\sin(-\theta) = -\sin(\theta)`], we have: + + [``\sin\left([$aDifRN]\right)=-\left([$ansShow{$aDif}[0]]\right)=[$ans0Show] ``] + +###Problem 2 + + [``\begin{aligned} + \cos\left([$aDifR]\right) + &= \cos\left([$a0r]-[$a1r]\right) \\ + &= \cos\left([$a0r]\right)\cos\left([$a1r]\right) + \sin\left([$a0r]\right)\sin\left([$a1r]\right) \\ + &= \left([$c0]\right)\left([$c1]\right) + \left([$s0]\right)\left([$s1]\right) \\ + &= [$product2] + [$product3] \\ + &= [$ansShow{$aDif}[1]] + \end{aligned}``] + +Finally, since [`\cos(-\theta) = \cos(\theta)`], we have: + + [``\cos\left([$aDifRN]\right)=[$ans1Show] ``] + +###Problem 3 + + [``\begin{aligned} + \tan\left([$aDifR]\right) + &= \tan\left([$a0r]-[$a1r]\right) \\ + &= \frac{\tan\left([$a0r]\right)-\tan\left([$a1r]\right)}{1+\tan\left([$a0r]\right)\tan\left([$a1r]\right)} \\ + &= \frac{\left([$s2]\right)-\left([$s3]\right)}{1 + \left([$s2]\right)\left([$s3]\right)} \\ + [$output] + &= [$ansShow{$aDif}[2]] + \end{aligned}``] + +Finally, since [`\tan(-\theta) = -\tan(\theta)`], we have: + + [``\tan\left([$aDifRN]\right)=-\left([$ansShow{$aDif}[2]]\right)=[$ans2Show] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas30.pg b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas30.pg new file mode 100644 index 0000000000..2da0b90d8b --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas30.pg @@ -0,0 +1,241 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); +do {$in[1] = random(0,3,1);} until ($in[0] != $in[1]); + +@quadrant = (); +$quadrant[0] = random(2,4,1); +do {$quadrant[1] = random(2,4,1);} until ($quadrant[0] != $quadrant[1]); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@Q = (); + +for my $k (0..1) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $Q[$k] = "II"; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], + [Fraction($height[1],$hypotenuse[1]), + Fraction($base[1],$hypotenuse[1]), + Fraction($height[1],$base[1]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..1) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +$sinSum = ($trigs[0][0]*$trigs[1][1]+$trigs[0][1]*$trigs[1][0])->reduce; +$cosSum = ($trigs[0][1]*$trigs[1][1]-$trigs[0][0]*$trigs[1][0])->reduce; + + + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\cos(\alpha)=[$trigs[0][1]]`] and [`\alpha\in[$int[0]]`], +* [`\sin(\beta)=[$trigs[1][0]]`] and [`\beta\in[$int[1]]`], + +evaluate the following. + +a) [`\sin(\alpha+\beta)=`][_____________]{$sinSum} + +a) [`\cos(\alpha+\beta)=`][_____________]{$cosSum} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = ($trigs[0][0]*$trigs[1][1])->reduce; +$s2 = ($trigs[0][1]*$trigs[1][0])->reduce; +$s3 = ($trigs[0][1]*$trigs[1][1])->reduce; +$s4 = ($trigs[0][0]*$trigs[1][0])->reduce; + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin(\alpha+\beta)`], we will use the formula + + [`` \sin(\alpha+\beta) = \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) ``] + +[`\cos(\alpha)`] and [`\sin(\beta)`] are given. We need to find the values of [`\sin(\alpha)`] and [`\cos(\beta)`]. + +###Calculating [`\sin(\alpha)`] + +It's given that [`\cos(\alpha)=[$trigs[0][1]]`] and [`\alpha\in[$int[0]]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse[0]])^2-\left([$base[0]]\right)^2}=[$absHeight[0]]`]. + +We can see [`\sin(\alpha)=[$trigs[0][0]]`]. + +###Calculating [`\cos(\beta)`] + +It's given that [`\sin(\beta)=[$trigs[1][0]]`] and [`\beta\in[$int[1]]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig[1] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse[1]])^2-\left([$height[1]]\right)^2}=[$absBase[1]]`]. + +We can see [`\cos(\beta)=[$trigs[1][1]]`]. + +###Calculating [` \sin(\alpha+\beta) `] + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + &= \left( [$trigs[0][0]] \right) \left( [$trigs[1][1]] \right) + \left( [$trigs[0][1]] \right) \left( [$trigs[1][0]] \right) \\ + &= \left( [$s1] \right) + \left( [$s2] \right) \\ + &= [$sinSum] + \end{aligned}``] + +###Calculating [` \cos(\alpha+\beta) `] + + [``\begin{aligned} + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + &= \left( [$trigs[0][1]] \right) \left( [$trigs[1][1]] \right) - \left( [$trigs[0][0]] \right) \left( [$trigs[1][0]] \right) \\ + &= \left( [$s3] \right) - \left( [$s4] \right) \\ + &= [$cosSum] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas31.pg b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas31.pg new file mode 100644 index 0000000000..1cd7452b3e --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas31.pg @@ -0,0 +1,484 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + + + do { + do { + $height0Out = -random(1,3,1); + $height0In = list_random(1,2,3); + $hypotenuse0Out = random(int(abs($height0Out)*$height0In**2)+2,int(abs($height0Out)*$height0In**2)+10,1); + } until (gcd($height0Out,$hypotenuse0Out)==1); + $hypotenuse0In = 1; + ($base0Out,$base0In) = &radSimplify($hypotenuse0Out**2-$height0Out**2*$height0In); + } until (!($base0In==1 && $height0In==1 && $hypotenuse0In==1)) && !(($base0Out>0) && ($height0Out>0)) && ($base0In<=20); + + $base0Out = $base0Out*random(-1,1,2); + if ($base0Out*$height0Out>0) { + $Q0 = ($base0Out>0) ? "I" : "III"; + $int0 = ($base0Out>0) ? "\left(0,\frac{\pi}{2}\right)" : "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + $Q0 = ($base0Out>0) ? "IV" : "II"; + $int0 = ($base0Out>0) ? "\left(\frac{3\pi}{2},2\pi\right)" : "\left(\frac{\pi}{2},\pi\right)"; + } + +Context("LimitedRadical"); + if ($base0In==1) { + $base0 = $base0Out; + $absBase = abs($base0Out); + } elsif (abs($base0Out)==1) { + $base0 = ($base0Out>0) ? Formula("sqrt($base0In)") : Formula("-sqrt($base0In)"); + $absBase = Formula("sqrt($base0In)"); + } else { + $base0 = Formula("$base0Out*sqrt($base0In)"); + $absBase0Out = abs($base0Out); + $absBase0 = Formula("$absBase0Out*sqrt($base0In)"); + } + + if ($height0In==1) { + $height0 = $height0Out; + $absHeight0 = abs($height0Out); + } elsif (abs($height0Out)==1) { + $height0 = ($height0Out>0) ? Formula("sqrt($height0In)") : Formula("-sqrt($height0In)"); + $absHeight0 = Formula("sqrt($height0In)"); + } else { + $height0 = Formula("$height0Out*sqrt($height0In)"); + $absHeight0Out = abs($height0Out); + $absHeight0 = Formula("$absHeight0Out*sqrt($height0In)"); + } + + $hypotenuse0 = $hypotenuse0Out; + + $sine0 = &rationalize($height0Out,$height0In,$hypotenuse0Out,$hypotenuse0In); + $cosine0 = &rationalize($base0Out,$base0In,$hypotenuse0Out,$hypotenuse0In); + $tangent0 = &rationalize($height0Out,$height0In,$base0Out,$base0In); + + @trigs0 = ($sine0,$cosine0,$tangent0); + +Context("Numeric"); + +$r = 5; +$P0x = $r*$base0Out*sqrt($base0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); +$P0y = $r*$height0Out*sqrt($height0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); + +@graph = (); +$graph[0] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $P0x, $P0y, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($P0x,$P0y,red,2); +$graph[0]->lineTo($P0x,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($P0x>0) ? -0.2 : 0.2; +$yShift = ($P0y>0) ? 0.2 : -0.42; +$graph[0]->moveTo($P0x,$yShift); +$graph[0]->lineTo($P0x+$xShift,$yShift,red,2); +$graph[0]->lineTo($P0x+$xShift,0,red,2); + +$LORHeight = ($P0x>0) ? "left" : "right"; +$TOBBase = ($P0y>0) ? "top" : "bottom"; +$LORHyp = ($P0x>0) ? "right" : "left"; +$TOBHyp = ($P0y>0) ? "bottom" : "top"; +$LORShift = ($P0x>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($P0x+$LORShift,$P0y/2,"$height0",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($P0x/2,0,"$base0",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($P0x/2,$P0y/2,"$hypotenuse0",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($P0x,$P0y,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base0,$height0) and ($base0,0). The base is marked as $base0, height marked as $height0 and hypotenuse marked as $hypotenuse0."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = $triples[$in][$j]; + $int1 = "\left(\frac{\pi}{2},\pi\right)"; + $Q1 = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "III"; + $int1 = "\left(\pi,\frac{3\pi}{2}\right)"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = $triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "IV"; + $int1 = "\left(\frac{3\pi}{2},2\pi\right)"; +} +$hypotenuse1 = $triples[$in][2]; +$absBase1 = abs($base1); +$absHeight1 = abs($height1); + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs1 = ( + Fraction($height1,$hypotenuse1), + Fraction($base1,$hypotenuse1), + Fraction($height1,$base1), +); + +$r = 5; +$P1x = Fraction($r*$base1,$hypotenuse1)->reduce; +$P1y = Fraction($r*$height1,$hypotenuse1)->reduce; + +$graph[1] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +$graph[1]->stamps(closed_circle( Real($P1x), Real($P1y), red )); +$graph[1]->moveTo(0,0); +$graph[1]->lineTo(Real($P1x),Real($P1y),red,2); +$graph[1]->lineTo(Real($P1x),0,red,2); +$graph[1]->lineTo(0,0,red,2); + +$xShift = ($P1x>0) ? -0.4 : 0.4; +$yShift = ($P1y>0) ? 0.4 : -0.4; +$graph[1]->moveTo(Real($P1x),$yShift); +$graph[1]->lineTo(Real($P1x)+$xShift,$yShift,red,2); +$graph[1]->lineTo(Real($P1x)+$xShift,0,red,2); + +$LORHeight = ($P1x>0) ? "left" : "right"; +$TOBBase = ($P1y>0) ? "top" : "bottom"; +$LORHyp = ($P1x>0) ? "right" : "left"; +$TOBHyp = ($P1y>0) ? "bottom" : "top"; +$graph[1]->lb(new Label(Real($P1x),Real($P1y)/2,"$height1",'red',$LORHeight,'middle',large)); +$graph[1]->lb(new Label(Real($P1x)/2,0,"$base1",'red','center',$TOBBase,large)); +$graph[1]->lb(new Label(Real($P1x)/2,Real($P1y)/2,"$hypotenuse1",'red',$LORHyp,$TOBHyp,large)); +$graph[1]->lb(new Label(Real($P1x),Real($P1y),"P($base1,$height1)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[1] = "This is the graph of a circle with point P($base1,$height1) on the circle. A right triangle is formed at vertices (0,0), ($base1,$height1) and ($base1,0). The base is marked as $base1, height marked as $height1 and hypotenuse marked as $hypotenuse1."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + Context("LimitedFraction"); + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + Context("LimitedRadical"); + if (($numIn==0)||($numOut==0)) {return Formula("0");} + if ($d0==1) { + if ($numIn==1) {return Formula("$n0");} + elsif ($n0==1) {return Formula("sqrt($numIn)");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)");} + else {return Formula("$n0*sqrt($numIn)");} + } else { + if ($numIn==1) {return Formula("$n0/$d0");} + elsif ($n0==1) {return Formula("sqrt($numIn)/$d0");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)/$d0");} + else { + $n0N = -$n0; + return ($n0>0) ? Formula("$n0*sqrt($numIn)/$d0") : Formula("-$n0N*sqrt($numIn)/$d0"); + } + } +} + +sub calSum { + my @p = @_; + my @a = ($p[0],$p[1],$p[2]); + my @b = ($p[3],$p[4],$p[5]); + my $s = $p[6]; + my @c = ($p[7],$p[8],$p[9]); + my @d = ($p[10],$p[11],$p[12]); + + my $frac0 = Fraction($a[0]*$b[0],$a[2]*$b[2])->reduce; + my $frac1 = Fraction($c[0]*$d[0],$c[2]*$d[2])->reduce; + my $frac2 = ($s eq "+") ? ($frac0+$frac1)->reduce : ($frac0-$frac1)->reduce; + if ($a[1]==$c[1]) { + my ($n2,$d2) = $frac2->value; + + return ($a[1]==1) + ? ( Compute("$frac2"), Compute("$frac2") ) + : ( Compute("$frac2*sqrt($a[1])"), createRadical($n2,$a[1],$d2) ); + } else { + my ($n0,$d0) = $frac0->value; + my ($n1,$d1) = $frac1->value; + my $com = lcm($d0,$d1); + my $e = $n0*$com/$d0; + my $f = $n1*$com/$d1; + my $output = "("; + if ($e==1) {$output .= ($a[1]==1) ? "1" : "sqrt($a[1])";} + elsif ($e==-1) {$output .= ($a[1]==1) ? "-1" : "-\sqrt($a[1])";} + else {$output .= ($a[1]==1) ? "$e" : "$e*sqrt($a[1])";} + $fN = $f; + if ($s eq "-") { + if ($f>0) { + $output .= "-"; + } else { + $output .= "+"; + $fN = -$f; + } + } elsif ($f<0) { + $output .= "-"; + $fN = -$f; + } else { + $output .= "+"; + } + if (abs($f)==1) {$output .= ($c[1]==1) ? "1" : "sqrt($c[1])";} + else {$output .= ($c[1]==1) ? "$fN" : "$fN*sqrt($c[1])";} + $output .= ")/$com"; + my $r = ($s eq "+") ? Compute("$frac0*sqrt($a[1])+$frac1*sqrt($c[1])") : Compute("$frac0*sqrt($a[1])-$frac1*sqrt($c[1])"); + Context("LimitedRadical"); + $output = Formula("$output"); + return ( $r, $output ); + } +} + + +Context("Fraction"); + +($sineSum, $sineSumShow) = calSum( + $height0Out, $height0In, $hypotenuse0Out, #sin(\alpha) + $base1,1,$hypotenuse1, #cos(\beta) + "+", + $base0Out,$base0In,$hypotenuse0Out, #cos(alpha) + $height1,1,$hypotenuse1 #sin(beta) +); + +Context("Fraction"); + +($cosineSum, $cosineSumShow) = calSum( + $base0Out,$base0In,$hypotenuse0Out, #cos(alpha) + $base1,1,$hypotenuse1, #cos(\beta) + "-", + $height0Out, $height0In, $hypotenuse0Out, #sin(\alpha) + $height1,1,$hypotenuse1 #sin(beta) +); + + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\cos(\alpha)=[$trigs0[1]]`] and [`\alpha\in[$int0]`], +* [`\sin(\beta)=[$trigs1[0]]`] and [`\beta\in[$int1]`], + +evaluate the following. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +a) [`\sin(\alpha+\beta)=`][_____________]{$sineSum->cmp(correct_ans_latex_string=>($sineSumShow->TeX))} + +a) [`\cos(\alpha+\beta)=`][_____________]{$cosineSum->cmp(correct_ans_latex_string=>($cosineSumShow->TeX))} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = createRadical($height0Out*$base1,$height0In,$hypotenuse0*$hypotenuse1); +$s2 = createRadical($base0Out*$height1,$base0In,$hypotenuse0*$hypotenuse1); + +$s3 = createRadical($base0Out*$base1,$base0In,$hypotenuse0*$hypotenuse1); +$s4 = createRadical($height0Out*$height1,$height0In,$hypotenuse0*$hypotenuse1); + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin(\alpha+\beta)`], we will use the formula + + [`` \sin(\alpha+\beta) = \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) ``] + +[`\cos(\alpha)`] and [`\sin(\beta)`] are given. We need to find the values of [`\sin(\alpha)`] and [`\cos(\beta)`]. + +###Calculating [`\sin(\alpha)`] + +It's given that [`\cos(\alpha)=[$trigs0[1]]`] and [`\alpha\in[$int0]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse0])^2-\left([$base0]\right)^2}=[$absHeight0]`]. + +We can see [`\sin(\alpha)=[$trigs0[0]]`]. + +###Calculating [`\cos(\beta)`] + +It's given that [`\sin(\beta)=[$trigs1[0]]`] and [`\beta\in[$int1]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse1])^2-\left([$height1]\right)^2}=[$absBase1]`]. + +We can see [`\cos(\beta)=[$trigs1[1]]`]. + +###Calculating [` \sin(\alpha+\beta) `] + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + &= \left( [$trigs0[0]] \right) \left( [$trigs1[1]] \right) + \left( [$trigs0[1]] \right) \left( [$trigs1[0]] \right) \\ + &= \left( [$s1] \right) + \left( [$s2] \right) \\ + &= [$sineSumShow] + \end{aligned}``] + +###Calculating [` \cos(\alpha+\beta) `] + + [``\begin{aligned} + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + &= \left( [$trigs0[1]] \right) \left( [$trigs1[1]] \right) - \left( [$trigs0[0]] \right) \left( [$trigs1[0]] \right) \\ + &= \left( [$s3] \right) - \left( [$s4] \right) \\ + &= [$cosineSumShow] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas40.pg b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas40.pg new file mode 100644 index 0000000000..d2dcaaf559 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas40.pg @@ -0,0 +1,241 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); +do {$in[1] = random(0,3,1);} until ($in[0] != $in[1]); + +@quadrant = (); +$quadrant[0] = random(2,4,1); +do {$quadrant[1] = random(2,4,1);} until ($quadrant[0] != $quadrant[1]); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@Q = (); + +for my $k (0..1) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $Q[$k] = "II"; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], + [Fraction($height[1],$hypotenuse[1]), + Fraction($base[1],$hypotenuse[1]), + Fraction($height[1],$base[1]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..1) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +$sinSum = ($trigs[0][0]*$trigs[1][1]-$trigs[0][1]*$trigs[1][0])->reduce; +$cosSum = ($trigs[0][1]*$trigs[1][1]+$trigs[0][0]*$trigs[1][0])->reduce; + + + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\sin(\alpha)=[$trigs[0][0]]`] and [`\alpha\in[$int[0]]`], +* [`\cos(\beta)=[$trigs[1][1]]`] and [`\beta\in[$int[1]]`], + +evaluate the following. + +a) [`\sin(\alpha-\beta)=`][_____________]{$sinSum} + +a) [`\cos(\alpha-\beta)=`][_____________]{$cosSum} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = ($trigs[0][0]*$trigs[1][1])->reduce; +$s2 = ($trigs[0][1]*$trigs[1][0])->reduce; +$s3 = ($trigs[0][1]*$trigs[1][1])->reduce; +$s4 = ($trigs[0][0]*$trigs[1][0])->reduce; + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin(\alpha-\beta)`], we will use the formula + + [`` \sin(\alpha-\beta) = \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) ``] + +[`\sin(\alpha)`] and [`\cos(\beta)`] are given. We need to find the values of [`\cos(\alpha)`] and [`\sin(\beta)`]. + +###Calculating [`\cos(\alpha)`] + +It's given that [`\sin(\alpha)=[$trigs[0][0]]`] and [`\alpha\in[$int[0]]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse[0]])^2-\left([$height[0]]\right)^2}=[$absBase[0]]`]. + +We can see [`\cos(\alpha)=[$trigs[0][1]]`]. + +###Calculating [`\sin(\beta)`] + +It's given that [`\cos(\beta)=[$trigs[1][1]]`] and [`\beta\in[$int[1]]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig[1] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse[1]])^2-\left([$base[1]]\right)^2}=[$absHeight[1]]`]. + +We can see [`\sin(\beta)=[$trigs[1][0]]`]. + +###Calculating [` \sin(\alpha-\beta) `] + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + &= \left( [$trigs[0][0]] \right) \left( [$trigs[1][1]] \right) - \left( [$trigs[0][1]] \right) \left( [$trigs[1][0]] \right) \\ + &= \left( [$s1] \right) - \left( [$s2] \right) \\ + &= [$sinSum] + \end{aligned}``] + +###Calculating [` \cos(\alpha-\beta) `] + + [``\begin{aligned} + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + &= \left( [$trigs[0][1]] \right) \left( [$trigs[1][1]] \right) + \left( [$trigs[0][0]] \right) \left( [$trigs[1][0]] \right) \\ + &= \left( [$s3] \right) + \left( [$s4] \right) \\ + &= [$cosSum] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas41.pg b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas41.pg new file mode 100644 index 0000000000..09922ee69d --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas41.pg @@ -0,0 +1,484 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + + + do { + do { + $height0Out = -random(1,3,1); + $height0In = list_random(1,2,3); + $hypotenuse0Out = random(int(abs($height0Out)*$height0In**2)+2,int(abs($height0Out)*$height0In**2)+10,1); + } until (gcd($height0Out,$hypotenuse0Out)==1); + $hypotenuse0In = 1; + ($base0Out,$base0In) = &radSimplify($hypotenuse0Out**2-$height0Out**2*$height0In); + } until (!($base0In==1 && $height0In==1 && $hypotenuse0In==1)) && !(($base0Out>0) && ($height0Out>0)) && ($base0In<=20); + + $base0Out = $base0Out*random(-1,1,2); + if ($base0Out*$height0Out>0) { + $Q0 = ($base0Out>0) ? "I" : "III"; + $int0 = ($base0Out>0) ? "\left(0,\frac{\pi}{2}\right)" : "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + $Q0 = ($base0Out>0) ? "IV" : "II"; + $int0 = ($base0Out>0) ? "\left(\frac{3\pi}{2},2\pi\right)" : "\left(\frac{\pi}{2},\pi\right)"; + } + +Context("LimitedRadical"); + if ($base0In==1) { + $base0 = $base0Out; + $absBase = abs($base0Out); + } elsif (abs($base0Out)==1) { + $base0 = ($base0Out>0) ? Formula("sqrt($base0In)") : Formula("-sqrt($base0In)"); + $absBase = Formula("sqrt($base0In)"); + } else { + $base0 = Formula("$base0Out*sqrt($base0In)"); + $absBase0Out = abs($base0Out); + $absBase0 = Formula("$absBase0Out*sqrt($base0In)"); + } + + if ($height0In==1) { + $height0 = $height0Out; + $absHeight0 = abs($height0Out); + } elsif (abs($height0Out)==1) { + $height0 = ($height0Out>0) ? Formula("sqrt($height0In)") : Formula("-sqrt($height0In)"); + $absHeight0 = Formula("sqrt($height0In)"); + } else { + $height0 = Formula("$height0Out*sqrt($height0In)"); + $absHeight0Out = abs($height0Out); + $absHeight0 = Formula("$absHeight0Out*sqrt($height0In)"); + } + + $hypotenuse0 = $hypotenuse0Out; + + $sine0 = &rationalize($height0Out,$height0In,$hypotenuse0Out,$hypotenuse0In); + $cosine0 = &rationalize($base0Out,$base0In,$hypotenuse0Out,$hypotenuse0In); + $tangent0 = &rationalize($height0Out,$height0In,$base0Out,$base0In); + + @trigs0 = ($sine0,$cosine0,$tangent0); + +Context("Numeric"); + +$r = 5; +$P0x = $r*$base0Out*sqrt($base0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); +$P0y = $r*$height0Out*sqrt($height0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); + +@graph = (); +$graph[0] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $P0x, $P0y, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($P0x,$P0y,red,2); +$graph[0]->lineTo($P0x,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($P0x>0) ? -0.2 : 0.2; +$yShift = ($P0y>0) ? 0.2 : -0.42; +$graph[0]->moveTo($P0x,$yShift); +$graph[0]->lineTo($P0x+$xShift,$yShift,red,2); +$graph[0]->lineTo($P0x+$xShift,0,red,2); + +$LORHeight = ($P0x>0) ? "left" : "right"; +$TOBBase = ($P0y>0) ? "top" : "bottom"; +$LORHyp = ($P0x>0) ? "right" : "left"; +$TOBHyp = ($P0y>0) ? "bottom" : "top"; +$LORShift = ($P0x>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($P0x+$LORShift,$P0y/2,"$height0",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($P0x/2,0,"$base0",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($P0x/2,$P0y/2,"$hypotenuse0",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($P0x,$P0y,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base0,$height0) and ($base0,0). The base is marked as $base0, height marked as $height0 and hypotenuse marked as $hypotenuse0."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = $triples[$in][$j]; + $int1 = "\left(\frac{\pi}{2},\pi\right)"; + $Q1 = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "III"; + $int1 = "\left(\pi,\frac{3\pi}{2}\right)"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = $triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "IV"; + $int1 = "\left(\frac{3\pi}{2},2\pi\right)"; +} +$hypotenuse1 = $triples[$in][2]; +$absBase1 = abs($base1); +$absHeight1 = abs($height1); + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs1 = ( + Fraction($height1,$hypotenuse1), + Fraction($base1,$hypotenuse1), + Fraction($height1,$base1), +); + +$r = 5; +$P1x = Fraction($r*$base1,$hypotenuse1)->reduce; +$P1y = Fraction($r*$height1,$hypotenuse1)->reduce; + +$graph[1] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +$graph[1]->stamps(closed_circle( Real($P1x), Real($P1y), red )); +$graph[1]->moveTo(0,0); +$graph[1]->lineTo(Real($P1x),Real($P1y),red,2); +$graph[1]->lineTo(Real($P1x),0,red,2); +$graph[1]->lineTo(0,0,red,2); + +$xShift = ($P1x>0) ? -0.4 : 0.4; +$yShift = ($P1y>0) ? 0.4 : -0.4; +$graph[1]->moveTo(Real($P1x),$yShift); +$graph[1]->lineTo(Real($P1x)+$xShift,$yShift,red,2); +$graph[1]->lineTo(Real($P1x)+$xShift,0,red,2); + +$LORHeight = ($P1x>0) ? "left" : "right"; +$TOBBase = ($P1y>0) ? "top" : "bottom"; +$LORHyp = ($P1x>0) ? "right" : "left"; +$TOBHyp = ($P1y>0) ? "bottom" : "top"; +$graph[1]->lb(new Label(Real($P1x),Real($P1y)/2,"$height1",'red',$LORHeight,'middle',large)); +$graph[1]->lb(new Label(Real($P1x)/2,0,"$base1",'red','center',$TOBBase,large)); +$graph[1]->lb(new Label(Real($P1x)/2,Real($P1y)/2,"$hypotenuse1",'red',$LORHyp,$TOBHyp,large)); +$graph[1]->lb(new Label(Real($P1x),Real($P1y),"P($base1,$height1)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[1] = "This is the graph of a circle with point P($base1,$height1) on the circle. A right triangle is formed at vertices (0,0), ($base1,$height1) and ($base1,0). The base is marked as $base1, height marked as $height1 and hypotenuse marked as $hypotenuse1."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + Context("LimitedFraction"); + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + Context("LimitedRadical"); + if (($numIn==0)||($numOut==0)) {return Formula("0");} + if ($d0==1) { + if ($numIn==1) {return Formula("$n0");} + elsif ($n0==1) {return Formula("sqrt($numIn)");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)");} + else {return Formula("$n0*sqrt($numIn)");} + } else { + if ($numIn==1) {return Formula("$n0/$d0");} + elsif ($n0==1) {return Formula("sqrt($numIn)/$d0");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)/$d0");} + else { + $n0N = -$n0; + return ($n0>0) ? Formula("$n0*sqrt($numIn)/$d0") : Formula("-$n0N*sqrt($numIn)/$d0"); + } + } +} + +sub calSum { + my @p = @_; + my @a = ($p[0],$p[1],$p[2]); + my @b = ($p[3],$p[4],$p[5]); + my $s = $p[6]; + my @c = ($p[7],$p[8],$p[9]); + my @d = ($p[10],$p[11],$p[12]); + + my $frac0 = Fraction($a[0]*$b[0],$a[2]*$b[2])->reduce; + my $frac1 = Fraction($c[0]*$d[0],$c[2]*$d[2])->reduce; + my $frac2 = ($s eq "+") ? ($frac0+$frac1)->reduce : ($frac0-$frac1)->reduce; + if ($a[1]==$c[1]) { + my ($n2,$d2) = $frac2->value; + + return ($a[1]==1) + ? ( Compute("$frac2"), Compute("$frac2") ) + : ( Compute("$frac2*sqrt($a[1])"), createRadical($n2,$a[1],$d2) ); + } else { + my ($n0,$d0) = $frac0->value; + my ($n1,$d1) = $frac1->value; + my $com = lcm($d0,$d1); + my $e = $n0*$com/$d0; + my $f = $n1*$com/$d1; + my $output = "("; + if ($e==1) {$output .= ($a[1]==1) ? "1" : "sqrt($a[1])";} + elsif ($e==-1) {$output .= ($a[1]==1) ? "-1" : "-\sqrt($a[1])";} + else {$output .= ($a[1]==1) ? "$e" : "$e*sqrt($a[1])";} + $fN = $f; + if ($s eq "-") { + if ($f>0) { + $output .= "-"; + } else { + $output .= "+"; + $fN = -$f; + } + } elsif ($f<0) { + $output .= "-"; + $fN = -$f; + } else { + $output .= "+"; + } + if (abs($f)==1) {$output .= ($c[1]==1) ? "1" : "sqrt($c[1])";} + else {$output .= ($c[1]==1) ? "$fN" : "$fN*sqrt($c[1])";} + $output .= ")/$com"; + my $r = ($s eq "+") ? Compute("$frac0*sqrt($a[1])+$frac1*sqrt($c[1])") : Compute("$frac0*sqrt($a[1])-$frac1*sqrt($c[1])"); + Context("LimitedRadical"); + $output = Formula("$output"); + return ( $r, $output ); + } +} + + +Context("Fraction"); + +($sineSum, $sineSumShow) = calSum( + $height0Out, $height0In, $hypotenuse0Out, #sin(\alpha) + $base1,1,$hypotenuse1, #cos(\beta) + "-", + $base0Out,$base0In,$hypotenuse0Out, #cos(alpha) + $height1,1,$hypotenuse1 #sin(beta) +); + +Context("Fraction"); + +($cosineSum, $cosineSumShow) = calSum( + $base0Out,$base0In,$hypotenuse0Out, #cos(alpha) + $base1,1,$hypotenuse1, #cos(\beta) + "+", + $height0Out, $height0In, $hypotenuse0Out, #sin(\alpha) + $height1,1,$hypotenuse1 #sin(beta) +); + + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\cos(\alpha)=[$trigs0[1]]`] and [`\alpha\in[$int0]`], +* [`\sin(\beta)=[$trigs1[0]]`] and [`\beta\in[$int1]`], + +evaluate the following. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +a) [`\sin(\alpha-\beta)=`][_____________]{$sineSum->cmp(correct_ans_latex_string=>($sineSumShow->TeX))} + +a) [`\cos(\alpha-\beta)=`][_____________]{$cosineSum->cmp(correct_ans_latex_string=>($cosineSumShow->TeX))} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = createRadical($height0Out*$base1,$height0In,$hypotenuse0*$hypotenuse1); +$s2 = createRadical($base0Out*$height1,$base0In,$hypotenuse0*$hypotenuse1); + +$s3 = createRadical($base0Out*$base1,$base0In,$hypotenuse0*$hypotenuse1); +$s4 = createRadical($height0Out*$height1,$height0In,$hypotenuse0*$hypotenuse1); + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin(\alpha-\beta)`], we will use the formula + + [`` \sin(\alpha-\beta) = \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) ``] + +[`\cos(\alpha)`] and [`\sin(\beta)`] are given. We need to find the values of [`\sin(\alpha)`] and [`\cos(\beta)`]. + +###Calculating [`\sin(\alpha)`] + +It's given that [`\cos(\alpha)=[$trigs0[1]]`] and [`\alpha\in[$int0]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse0])^2-\left([$base0]\right)^2}=[$absHeight0]`]. + +We can see [`\sin(\alpha)=[$trigs0[0]]`]. + +###Calculating [`\cos(\beta)`] + +It's given that [`\sin(\beta)=[$trigs1[0]]`] and [`\beta\in[$int1]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse1])^2-\left([$height1]\right)^2}=[$absBase1]`]. + +We can see [`\cos(\beta)=[$trigs1[1]]`]. + +###Calculating [` \sin(\alpha-\beta) `] + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + &= \left( [$trigs0[0]] \right) \left( [$trigs1[1]] \right) - \left( [$trigs0[1]] \right) \left( [$trigs1[0]] \right) \\ + &= \left( [$s1] \right) - \left( [$s2] \right) \\ + &= [$sineSumShow] + \end{aligned}``] + +###Calculating [` \cos(\alpha-\beta) `] + + [``\begin{aligned} + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + &= \left( [$trigs0[1]] \right) \left( [$trigs1[1]] \right) + \left( [$trigs0[0]] \right) \left( [$trigs1[0]] \right) \\ + &= \left( [$s3] \right) + \left( [$s4] \right) \\ + &= [$cosineSumShow] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas50.pg b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas50.pg new file mode 100644 index 0000000000..dedc3faa81 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas50.pg @@ -0,0 +1,241 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); +do {$in[1] = random(0,3,1);} until ($in[0] != $in[1]); + +@quadrant = (); +$quadrant[0] = random(2,4,1); +do {$quadrant[1] = random(2,4,1);} until ($quadrant[0] != $quadrant[1]); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@Q = (); + +for my $k (0..1) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $Q[$k] = "II"; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], + [Fraction($height[1],$hypotenuse[1]), + Fraction($base[1],$hypotenuse[1]), + Fraction($height[1],$base[1]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..1) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +$tanSum = (($trigs[0][2]+$trigs[1][2])/(1-$trigs[0][2]*$trigs[1][2]))->reduce; +$tanDif = (($trigs[0][2]-$trigs[1][2])/(1+$trigs[0][2]*$trigs[1][2]))->reduce; + + + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\cos(\alpha)=[$trigs[0][1]]`] and [`\alpha\in[$int[0]]`], +* [`\sin(\beta)=[$trigs[1][0]]`] and [`\beta\in[$int[1]]`], + +evaluate the following. + +a) [`\tan(\alpha+\beta)=`][_____________]{$tanSum} + +a) [`\tan(\alpha-\beta)=`][_____________]{$tanDif} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = ($trigs[0][2]+$trigs[1][2])->reduce; +$s2 = (1-$trigs[0][2]*$trigs[1][2])->reduce; +$s3 = ($trigs[0][2]-$trigs[1][2])->reduce; +$s4 = (1+$trigs[0][2]*$trigs[1][2])->reduce; + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\tan(\alpha+\beta)`], we will use the formula + + [`` \tan(\alpha+\beta) = \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\alpha)} ``] + +[`\sin(\alpha)`] and [`\cos(\beta)`] are given. We need to find the values of [`\tan(\alpha)`] and [`\tan(\beta)`]. + +###Calculating [`\tan(\alpha)`] + +It's given that [`\cos(\alpha)=[$trigs[0][1]]`] and [`\alpha\in[$int[0]]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse[0]])^2-\left([$base[0]]\right)^2}=[$absHeight[0]]`]. + +We can see [`\tan(\alpha)=[$trigs[0][2]]`]. + +###Calculating [`\tan(\beta)`] + +It's given that [`\sin(\beta)=[$trigs[1][0]]`] and [`\beta\in[$int[1]]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig[1] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse[1]])^2-\left([$height[1]]\right)^2}=[$absBase[1]]`]. + +We can see [`\tan(\beta)=[$trigs[1][2]]`]. + +###Calculating [` \tan(\alpha+\beta) `] + + [``\begin{aligned} + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\alpha)} \\ + &= \frac{([$trigs[0][2]])+([$trigs[1][2]])}{1-\left([$trigs[0][2]]\right)\cdot\left([$trigs[1][2]]\right)} \\ + &= \frac{[$s1]}{[$s2]} \\ + &= [$tanSum] + \end{aligned}``] + +###Calculating [` \tan(\alpha-\beta) `] + + [``\begin{aligned} + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\alpha)} \\ + &= \frac{([$trigs[0][2]])-([$trigs[1][2]])}{1+\left([$trigs[0][2]]\right)\cdot\left([$trigs[1][2]]\right)} \\ + &= \frac{[$s3]}{[$s4]} \\ + &= [$tanDif] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas51.pg b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas51.pg new file mode 100644 index 0000000000..5d77b60d67 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas51.pg @@ -0,0 +1,540 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + + + do { + do { + $height0Out = -random(1,3,1); + $height0In = list_random(1,2,3); + $hypotenuse0Out = random(int(abs($height0Out)*$height0In**2)+2,int(abs($height0Out)*$height0In**2)+10,1); + } until (gcd($height0Out,$hypotenuse0Out)==1); + $hypotenuse0In = 1; + ($base0Out,$base0In) = &radSimplify($hypotenuse0Out**2-$height0Out**2*$height0In); + ($out,$in) = &radSimplify(abs($height0In*$base0In)); + } until + (!($base0In==1 && $height0In==1 && $hypotenuse0In==1)) + && !(($base0Out>0) + && ($height0Out>0)) + && ($in<=5) + && (sqrt($height0In*$base0In) != int(sqrt($height0In*$base0In))); + + $base0Out = $base0Out*random(-1,1,2); + if ($base0Out*$height0Out>0) { + $Q0 = ($base0Out>0) ? "I" : "III"; + $int0 = ($base0Out>0) ? "\left(0,\frac{\pi}{2}\right)" : "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + $Q0 = ($base0Out>0) ? "IV" : "II"; + $int0 = ($base0Out>0) ? "\left(\frac{3\pi}{2},2\pi\right)" : "\left(\frac{\pi}{2},\pi\right)"; + } + +Context("LimitedRadical"); + if ($base0In==1) { + $base0 = $base0Out; + $absBase = abs($base0Out); + } elsif (abs($base0Out)==1) { + $base0 = ($base0Out>0) ? Formula("sqrt($base0In)") : Formula("-sqrt($base0In)"); + $absBase = Formula("sqrt($base0In)"); + } else { + $base0 = Formula("$base0Out*sqrt($base0In)"); + $absBase0Out = abs($base0Out); + $absBase0 = Formula("$absBase0Out*sqrt($base0In)"); + } + + if ($height0In==1) { + $height0 = $height0Out; + $absHeight0 = abs($height0Out); + } elsif (abs($height0Out)==1) { + $height0 = ($height0Out>0) ? Formula("sqrt($height0In)") : Formula("-sqrt($height0In)"); + $absHeight0 = Formula("sqrt($height0In)"); + } else { + $height0 = Formula("$height0Out*sqrt($height0In)"); + $absHeight0Out = abs($height0Out); + $absHeight0 = Formula("$absHeight0Out*sqrt($height0In)"); + } + + $hypotenuse0 = $hypotenuse0Out; + + $sine0 = &rationalize($height0Out,$height0In,$hypotenuse0Out,$hypotenuse0In); + $cosine0 = &rationalize($base0Out,$base0In,$hypotenuse0Out,$hypotenuse0In); + $tangent0 = &rationalize($height0Out,$height0In,$base0Out,$base0In); + + @trigs0 = ($sine0,$cosine0,$tangent0); + +Context("Numeric"); + +$r = 5; +$P0x = $r*$base0Out*sqrt($base0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); +$P0y = $r*$height0Out*sqrt($height0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); + +@graph = (); +$graph[0] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $P0x, $P0y, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($P0x,$P0y,red,2); +$graph[0]->lineTo($P0x,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($P0x>0) ? -0.2 : 0.2; +$yShift = ($P0y>0) ? 0.2 : -0.42; +$graph[0]->moveTo($P0x,$yShift); +$graph[0]->lineTo($P0x+$xShift,$yShift,red,2); +$graph[0]->lineTo($P0x+$xShift,0,red,2); + +$LORHeight = ($P0x>0) ? "left" : "right"; +$TOBBase = ($P0y>0) ? "top" : "bottom"; +$LORHyp = ($P0x>0) ? "right" : "left"; +$TOBHyp = ($P0y>0) ? "bottom" : "top"; +$LORShift = ($P0x>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($P0x+$LORShift,$P0y/2,"$height0",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($P0x/2,0,"$base0",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($P0x/2,$P0y/2,"$hypotenuse0",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($P0x,$P0y,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base0,$height0) and ($base0,0). The base is marked as $base0, height marked as $height0 and hypotenuse marked as $hypotenuse0."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], +); +$in = 0; + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = $triples[$in][$j]; + $int1 = "\left(\frac{\pi}{2},\pi\right)"; + $Q1 = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "III"; + $int1 = "\left(\pi,\frac{3\pi}{2}\right)"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = $triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "IV"; + $int1 = "\left(\frac{3\pi}{2},2\pi\right)"; +} +$hypotenuse1 = $triples[$in][2]; +$absBase1 = abs($base1); +$absHeight1 = abs($height1); + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs1 = ( + Fraction($height1,$hypotenuse1), + Fraction($base1,$hypotenuse1), + Fraction($height1,$base1), +); + +$r = 5; +$P1x = Fraction($r*$base1,$hypotenuse1)->reduce; +$P1y = Fraction($r*$height1,$hypotenuse1)->reduce; + +$graph[1] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +$graph[1]->stamps(closed_circle( Real($P1x), Real($P1y), red )); +$graph[1]->moveTo(0,0); +$graph[1]->lineTo(Real($P1x),Real($P1y),red,2); +$graph[1]->lineTo(Real($P1x),0,red,2); +$graph[1]->lineTo(0,0,red,2); + +$xShift = ($P1x>0) ? -0.4 : 0.4; +$yShift = ($P1y>0) ? 0.4 : -0.4; +$graph[1]->moveTo(Real($P1x),$yShift); +$graph[1]->lineTo(Real($P1x)+$xShift,$yShift,red,2); +$graph[1]->lineTo(Real($P1x)+$xShift,0,red,2); + +$LORHeight = ($P1x>0) ? "left" : "right"; +$TOBBase = ($P1y>0) ? "top" : "bottom"; +$LORHyp = ($P1x>0) ? "right" : "left"; +$TOBHyp = ($P1y>0) ? "bottom" : "top"; +$graph[1]->lb(new Label(Real($P1x),Real($P1y)/2,"$height1",'red',$LORHeight,'middle',large)); +$graph[1]->lb(new Label(Real($P1x)/2,0,"$base1",'red','center',$TOBBase,large)); +$graph[1]->lb(new Label(Real($P1x)/2,Real($P1y)/2,"$hypotenuse1",'red',$LORHyp,$TOBHyp,large)); +$graph[1]->lb(new Label(Real($P1x),Real($P1y),"P($base1,$height1)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[1] = "This is the graph of a circle with point P($base1,$height1) on the circle. A right triangle is formed at vertices (0,0), ($base1,$height1) and ($base1,0). The base is marked as $base1, height marked as $height1 and hypotenuse marked as $hypotenuse1."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is ($num,$in1,$den) in $num*sqrt($in1)/$den +sub tanNums { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + return ($num,$in1,$den); +} + +sub produceLine0 { + my $s = shift; + my $line0Num = $trigs0[2]->TeX; + my ($tan0Out,$tan0In,$tan0Den) = &tanNums($height0Out,$height0In,$base0Out,$base0In); + + my $numS0 = ""; + my $tN = (-$trigs1[2])->reduce; + if ($s eq "+") { + $numS0 = ($trigs1[2]>0) ? "+".$trigs1[2]->TeX : "-".$tN->TeX; + } else { + $numS0 = ($trigs1[2]>0) ? "-".$trigs1[2]->TeX : "+".$tN->TeX; + } + $line0Num .= $numS0; + + $line0Den = ""; + Context("Fraction"); + my ($num1,$den1) = Fraction($tan0Out*$height1,$tan0Den*$base1)->reduce->value; + $line0Den .= "1"; + $s1 = ($s eq "+") ? "-" : "+"; + if ($num1>0) { + if ($num1==1) {$line0Den .= "$s1\frac{\sqrt{$tan0In}}";} + else {$line0Den .= "$s1\frac{$num1\sqrt{$tan0In}}";} + } else { + if ($num1==-1) {$line0Den .= "$s\frac{\sqrt{$tan0In}}";} + else { + $num1N = -$num1; + $line0Den .= "$s\frac{$num1N\sqrt{$tan0In}}"; + } + } + $line0Den .= "{$den1}"; + return ( + $line0Num, + $line0Den, + $tan0In, + Fraction($tan0Out,$tan0Den), + Fraction($height1,$base1), + Fraction($num1,$den1) + ); +} + +sub produceLine1 { + my ($lineNum,$lineDen,$f1,$f2,$f3) = @_; + my ($f1n,$f1d) = $f1->value; + my ($f2n,$f2d) = $f2->value; + my ($f3n,$f3d) = $f3->value; + + my $com = lcm(lcm($f1d,$f2d),$f3d); + $r = "\frac{\left(".$lineNum."\right)\cdot$com}{\left(".$lineDen."\right)\cdot$com}"; + return ($r,$com); +} + +sub produceLine2 { + my ($f1,$f2,$f3,$sq,$com,$s) = @_; + my ($f1n,$f1d) = $f1->value; + my ($f2n,$f2d) = $f2->value; + my ($f3n,$f3d) = $f3->value; + + my $lineNum = ""; + my $a = $com/$f1d*$f1n; + my $b = $com/$f2d*$f2n; + my $sN = ($s eq "+") ? "-" : "+"; + my $bN = -$b; + if (abs($a)!=1) { + $lineNum .= ($b>0) ? "$a\sqrt{$sq}$s$b" : "$a\sqrt{$sq}$sN$bN"; + } else { + $lineNum .= ($a==1) ? "\sqrt{$sq}$s$b" : "-\sqrt{$sq}$sN$bN"; + } + my $lineDen = ""; + my $c = $com/$f3d*$f3n; + my $cN = -$c; + if (abs($c)!=1) { + $lineDen .= ($c>0) ? "$com$sN$c\sqrt{$sq}" : "$com$s$cN\sqrt{$sq}"; + } else { + $lineDen .= ($c==1) ? "$com$sN\sqrt{$sq}" : "$com$s\sqrt{$sq}"; + } + return ($lineNum,$lineDen,$a,$b,$com,$c); +} + +sub produceLine3 { + my ($num,$den,$c,$d,$sq,$s) = @_; + my $sN = ($s eq "+") ? "-" : "+"; + my $conj = ""; + + if (abs($d)==1) { + $conj = ($d>0) ? "\left($c$s\sqrt{$sq}\right)" : "\left($c$sN\sqrt{$sq}\right)"; + } else { + $dN = -$d; + $conj = ($d>0) ? "\left($c$s$d\sqrt{$sq}\right)" : "\left($c$sN$dN\sqrt{$sq}\right)"; + } + return "\frac{\left($num\right)\cdot$conj}{\left($den\right)\cdot$conj}"; +} + +sub produceLine4 { + my ($a,$b,$c,$d,$sq,$s) = @_; + my $g = ($c)**2-($d)**2*$sq; + my $e = $a*$d*$sq+$b*$c; + my $f = $a*$c+$b*$d; + if ($s ne "+") {$e=-$e;} + my $r = "\frac{$e+$f\sqrt{$sq}}{$g}"; + if ($g<0) { + $gN = -$g; $eN = -$e; $fN = -$fN; + $r .= "\\ &= \frac{$e+$f\sqrt{$sq}}{$g}"; + } + my $com = gcd($g,gcd($e,$f)); + my $h = $e/$com; + my $i = $f/$com; + my $j = $g/$com; + my $reducedNum = ""; + if ($com!=1) { + if (abs($i)==1) { + $reducedNum = ($i>0) ? "$h+\sqrt{$sq}" : "$h-\sqrt{$sq}"; + $r .= "\\ &= \frac{$com\left($reducedNum\right)}{$g}"; + } else { + $reducedNum = ($i>0) ? "$h+$i\sqrt{$sq}" : "$h$i\sqrt{$sq}"; + $r .= "\\ &= \frac{$com\left($reducedNum\right)}{$g}"; + } + $r .= "\\ &= \frac{$reducedNum}{$j}"; + } + Context("Numeric"); + my $ans = Compute("($h+$i*sqrt($sq))/$j"); + Context("LimitedRadical"); + my $ansShow = Formula("($h+$i*sqrt($sq))/$j"); + return ($r,$ans,$ansShow); +} + +($line0Num,$line0Den,$sq,$frac1,$frac2,$frac3) = produceLine0("+"); +$line0 = "\frac{".$line0Num."}{".$line0Den."}"; +($line1,$com) = produceLine1($line0Num,$line0Den,$frac1,$frac2,$frac3); +($line2Num,$line2Den,$a,$b,$c,$d) = produceLine2($frac1,$frac2,$frac3,$sq,$com,"+"); +$line2 = "\frac{".$line2Num."}{".$line2Den."}"; +$line3 = produceLine3($line2Num,$line2Den,$c,$d,$sq,"+"); +($line4,$tanSum,$tanSumShow) = produceLine4($a,$b,$c,$d,$sq,"+"); + +($line10Num,$line10Den,$sq,$frac1,$frac2,$frac3) = produceLine0("-"); +$line10 = "\frac{".$line10Num."}{".$line10Den."}"; +($line11,$com) = produceLine1($line10Num,$line10Den,$frac1,$frac2,$frac3); +($line12Num,$line12Den,$a,$b,$c,$d) = produceLine2($frac1,$frac2,$frac3,$sq,$com,"-"); +$line12 = "\frac{".$line12Num."}{".$line12Den."}"; +$line13 = produceLine3($line12Num,$line12Den,$c,$d,$sq,"-"); +($line14,$tanDif,$tanDifShow) = produceLine4($a,$b,$c,$d,$sq,"-"); + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\sin(\alpha)=[$trigs0[0]]`] and [`\alpha\in[$int0]`], +* [`\cos(\beta)=[$trigs1[1]]`] and [`\beta\in[$int1]`], + +evaluate the following. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +a) [`\tan(\alpha+\beta)=`][_____________]{$tanSum->cmp(correct_ans_latex_string=>($tanSumShow->TeX))} + +a) [`\tan(\alpha-\beta)=`][_____________]{$tanDif->cmp(correct_ans_latex_string=>($tanDifShow->TeX))} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\tan(\alpha+\beta)`], we will use the formula + + [`` \tan(\alpha+\beta) = \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\alpha)} ``] + +[`\sin(\alpha)`] and [`\cos(\beta)`] are given. We need to find the values of [`\tan(\alpha)`] and [`\tan(\beta)`]. + +###Calculating [`\tan(\alpha)`] + +It's given that [`\sin(\alpha)=[$trigs0[0]]`] and [`\alpha\in[$int0]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse0])^2-\left([$height0]\right)^2}=[$absBase0]`]. + +We can see [`\tan(\alpha)=\frac{[$height0]}{[$base0]}=[$trigs0[2]]`]. + +###Calculating [`\tan(\beta)`] + +It's given that [`\cos(\beta)=[$trigs1[1]]`] and [`\beta\in[$int1]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse1])^2-\left([$base1]\right)^2}=[$absHeight1]`]. + +We can see [`\tan(\beta)=[$trigs1[2]]`]. + +###Calculating [` \tan(\alpha+\beta) `] + + [``\begin{aligned} + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\alpha)} \\ + &= \frac{\left([$trigs0[2]]\right)+\left([$trigs1[2]]\right)}{1-\left([$trigs0[2]]\right)\left([$trigs1[2]]\right)} \\ + &= [$line0] \\ + &= [$line1] \\ + &= [$line2] \\ + &= [$line3] \\ + &= [$line4] + \end{aligned}``] + +###Calculating [` \tan(\alpha-\beta) `] + + [``\begin{aligned} + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\alpha)} \\ + &= \frac{\left([$trigs0[2]]\right)-\left([$trigs1[2]]\right)}{1+\left([$trigs0[2]]\right)\left([$trigs1[2]]\right)} \\ + &= [$line10] \\ + &= [$line11] \\ + &= [$line12] \\ + &= [$line13] \\ + &= [$line14] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas60.pg b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas60.pg new file mode 100644 index 0000000000..e956866f20 --- /dev/null +++ b/Contrib/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas60.pg @@ -0,0 +1,116 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +@a = (pi/2,pi,3*pi/2,2*pi); +@aD = (Formula("pi/2"),Formula("pi"),Formula("3*pi/2"),Formula("2*pi")); + +$in = random(0,3,1); + +if (random(0,1,1)==0) { + $e00 = Compute("x"); + $e01 = list_random("+","-"); + $e02 = $aD[$in]; +} else { + $e00 = $aD[$in]; + $e01 = list_random("+","-"); + $e02 = Compute("x"); +} + +$e10 = $e02; +$e11 = ($e01 eq "+") ? "-" : "+"; +$e12 = $e00; + +$s00 = Compute("sin($e00)")->reduce; +$s01 = Compute("cos($e02)")->reduce; +$s02 = Compute("cos($e00)")->reduce; +$s03 = Compute("sin($e02)")->reduce; + +if ($e01 eq "+") { + $line00 = Compute("sin($e00)*cos($e02)+cos($e00)*sin($e02)"); + $line01 = Formula("($s00)*($s01)+($s02)*($s03)"); + $ans0 = Compute("$s00*$s01+$s02*$s03")->reduce; + + $line10 = Compute("cos($e00)*cos($e02)+sin($e00)*sin($e02)"); + $line11 = Formula("($s02)*($s01)+($s00)*($s03)"); + $ans1 = Compute("$s02*$s01+$s00*$s03")->reduce; +} else { + $line00 = Compute("sin($e00)*cos($e02)-cos($e00)*sin($e02)"); + $line01 = Formula("($s00)*($s01)-($s02)*($s03)"); + $ans0 = Compute("$s00*$s01-$s02*$s03")->reduce; + + $line10 = Compute("cos($e00)*cos($e02)-sin($e00)*sin($e02)"); + $line11 = Formula("($s02)*($s01)-($s00)*($s03)"); + $ans1 = Compute("$s02*$s01-$s00*$s03")->reduce; +} + + + +############################################## + +BEGIN_PGML + +Without using a calculator, use sum and difference formulas to simplify the following expression. + +a) [`` \sin\left([$e00][$e01][$e02]\right) = ``][_________]{$ans0} + +a) [`` \cos\left([$e10][$e11][$e12]\right) = ``][_________]{$ans1} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +###Part a + + [``\begin{aligned} + \sin\left([$e00][$e01][$e02]\right) + &= [$line00] \\ + &= [$line01] \\ + &= [$ans0] + \end{aligned}``] + +###Part b + + [``\begin{aligned} + \cos\left([$e10][$e11][$e12]\right) + &= [$line10] \\ + &= [$line11] \\ + &= [$ans1] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse10.pg b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse10.pg new file mode 100644 index 0000000000..76b39835f0 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse10.pg @@ -0,0 +1,214 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +do { + $hypotenuse = random(10,25,1); + $alpha = random(20,70,1); + $alphaRadian = $alpha*pi/180; + $base = sin($alphaRadian)*$hypotenuse; + $height = cos($alphaRadian)*$hypotenuse; +} until ( ($height<17) && ($base<17) ); +$base = int($base); +$alpha = Compute(arcsin($base/$hypotenuse)*180/pi); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = list_random(0..3); + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$base,'black','center','middle')); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuse,'black','center','middle')); + +$picture->lb( new Label($labelAx[$corner]+2*cos($theta), $labelAy[$corner]+2*sin($theta),"x",'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = 0.5; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x. The length of the side opposite to the given acute angle is marked as $base; the length of the side opposite to the right angle is marked as $hypotenuse."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Find the value of [`x`] in degrees. Round your answer to at least two decimal places. + + [`x=`][___________]{$alpha}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the side marked as [`[$hypotenuse]`] is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$base]`] is the "opposite leg" of the unknown angle, because it is opposite to the angle. + +Since we need to relate the hypotenuse and the angle's opposite leg, we choose to use the sine function. + +To find the unknown angle's measure, we need to use the inverse sine function. Don't forget to change your calculator's mode to "degree". + +The solution is: + + [`` +\begin{aligned} + \sin{x} &= \frac{[$base]}{[$hypotenuse]} \\ + x &= \sin^{-1}\left(\frac{[$base]}{[$hypotenuse]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse20.pg b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse20.pg new file mode 100644 index 0000000000..6d8f64aa8c --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse20.pg @@ -0,0 +1,213 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +do { + $hypotenuse = random(10,25,1); + $alpha = random(20,70,1); + $alphaRadian = $alpha*pi/180; + $base = sin($alphaRadian)*$hypotenuse; + $height = cos($alphaRadian)*$hypotenuse; +} until ( ($height<17) && ($base<17) ); +$height = int($height); +$alpha = Compute(arccos($height/$hypotenuse)*180/pi); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = list_random(0..3); + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + +$picture->lb( new Label($labelAx[$corner]+2*cos($theta), $labelAy[$corner]+2*sin($theta),"x",'black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$height,'black','center','middle')); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuse,'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = 0.5; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x. The length of the side adjacent to the given acute angle is marked as $height; the length of the side opposite to the right angle is marked as $hypotenuse."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Find the value of [`x`] in degrees. Round your answer to at least two decimal places. + + [`x=`][___________]{$alpha}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the side marked as [`[$hypotenuse]`] is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$height]`] is the "adjacent leg" of angle [`x`], because it is *not* opposite to the angle. + +Since we need to relate the hypotenuse and the angle's adjacent leg, we choose to use the cosine function. + +To find the unknown angle's measure, we need to use the inverse cosine function. Don't forget to change your calculator's mode to "degree". + +The solution is: + + [`` +\begin{aligned} + \cos(x) &= \frac{[$height]}{[$hypotenuse]} \\ + x &= \cos^{-1}\left(\frac{[$height]}{[$hypotenuse]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse30.pg b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse30.pg new file mode 100644 index 0000000000..2e98bbbbab --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse30.pg @@ -0,0 +1,215 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +do { + $height = random(5,17,1); + $alpha = random(20,70,1); + $alphaRadian = $alpha*pi/180; + $base = tan($alphaRadian)*$height; + $hypotenuse = $height/cos($alphaRadian); +} until ($base<17); +$base = int($base); +$alpha = Compute(arctan($base/$height)*180/pi); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = list_random(0..3); + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + +$picture->lb( new Label($labelAx[$corner]+2*cos($theta), $labelAy[$corner]+2*sin($theta),"x",'black','center','middle')); + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$base,'black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$height,'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = 0.5; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x. The length of the side opposite to the given acute angle is marked as $base; the length of the side adjacent to the given acute angle is marked as $height."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Find the value of [`x`] in degrees. Round your answer to at least two decimal places. + + [`x=`][___________]{$alpha}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the unmarked side is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$base]`] is the "opposite leg" of the angle marked as x, because it is opposite to the angle. + +The side marked as [`[$height]`] is the "adjacent leg" of the angle marked as x, because it is *not* opposite to the angle. + +Since we need to relate the angle's opposite and adjacent legs, we choose to use the tangent function. + +To find the unknown angle's measure, we need to use the inverse tangent function. Don't forget to change your calculator's mode to "degree". + +The solution is: + + [`` +\begin{aligned} + \tan{x} &= \frac{[$base]}{[$height]} \\ + x &= \tan^{-1}\left(\frac{[$base]}{[$height]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse40.pg b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse40.pg new file mode 100644 index 0000000000..43a9028af7 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse40.pg @@ -0,0 +1,231 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$xmin = 0; #The viewing window +$xmax = 10; +$ymin = 0; +$ymax = 10; + +do { + $hypotenuse = random(6,15,0.1); + $alpha = random(10,25,1); + $alphaRadian = $alpha*pi/180; + $base = sin($alphaRadian)*$hypotenuse; + $height = cos($alphaRadian)*$hypotenuse; +} until ( ($height<8) ); +$base = int($base); +$alpha = Compute(arcsin($base/$hypotenuse)*180/pi); + +$hypotenuseU = NumberWithUnits("$hypotenuse km"); +$baseU = NumberWithUnits("$base km"); +$heightU = NumberWithUnits("$height km"); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = 3; + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; + + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + + +$picture->lb( new Label($labelAx[$corner]+1.5*cos($theta), $labelAy[$corner]+1.5*sin($theta),"x",'black','center','middle')); + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner], $baseU,'black','center','middle')); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuseU,'black','center','middle')); + +$picture->stamps( closed_circle($x[0],$y[0],'red') ); +$picture->lb( new Label($x[0]-0.5*$labelAdjust,$y[0]-0.5*$labelAdjust,'Town A','red','center','middle')); +$picture->stamps( closed_circle($x[1],$y[1],'red') ); +$picture->lb( new Label($x[1]+0.5*$labelAdjust,$y[1]+0.5*$labelAdjust,'Town B','red','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = 0.25; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x, and the vertex of this angle is labeled as Town A. The vertex of the acute angle at the $bPosition is labeled as Town B. The length of the side opposite to the given acute angle is marked as $baseU; the length of the side opposite to the right angle is marked as $hypotenuseU."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A straight road connects two towns, which are built on a slope. The road's distance is [`[$hypotenuseU]`]. The difference in those two towns' elevation (vertical distance) is [`[$baseU]`]. + +The slope's elevation is [___________]{$alpha} degrees. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the slope's elevation is [`x`] degrees. The following graph can represent this situation: + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +This has become a right triangle trigonometry problem. + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the side marked as [`[$hypotenuseU]`] is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$baseU]`] is the "opposite leg" of the angle marked as x, because it is opposite to the angle. + +Since we need to relate the hypotenuse and the angle's opposite leg, we choose to use the sine function. + +To find the unknown angle's measure, we need to use the inverse sine function. Don't forget to change your calculator's mode to "degree". + +The solution is: + + [`` +\begin{aligned} + \sin{x} &= \frac{[$base]}{[$hypotenuse]} \\ + x &= \sin^{-1}\left(\frac{[$base]}{[$hypotenuse]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +The slope's elevation is [`[$alpha]`] degrees. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse50.pg b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse50.pg new file mode 100644 index 0000000000..4020355b5a --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse50.pg @@ -0,0 +1,256 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $height = random(100,200,1); + $alpha = random(10,60,1); + $alphaRadian = $alpha*pi/180; + $base = tan($alphaRadian)*$height; + $hypotenuse = $height/cos($alphaRadian); +} until ($base<170); +$base = int($base); +$alpha = Compute(arctan($base/$height)*180/pi); +$heightPerson = random(5,6,0.5); + +$heightTotal = $heightPerson+$base; +$heightTotalU = NumberWithUnits("$heightTotal ft"); + +$hypotenuseU = NumberWithUnits("$hypotenuse ft"); +$baseU = NumberWithUnits("$base ft"); +$heightU = NumberWithUnits("$height ft"); +$heightPersonU = NumberWithUnits("$heightPerson ft"); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +$longer = max($base,$height); + +$xmin = 0; #The viewing window +$xmax = 1.5*$longer; +$ymin = 0; +$ymax = 1.5*$longer; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = 3; + + @x = (($xmax-$height)/2,($xmax+$height)/2); + @y = (($ymax-$base)/2,($ymax+$base)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = $longer/10; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$curveAdjust = $longer/10; +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+$curveAdjust*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+$curveAdjust*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; +$picture->lb( new Label($labelAx[$corner]+2*$curveAdjust*cos($theta), $labelAy[$corner]+2*$curveAdjust*sin($theta),"x",'black','center','middle')); + + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + +#head +$picture->stamps( open_circle($x[0]-$labelAdjust/7,$y[0]-$labelAdjust/7,'blue') ); +#body +$picture->moveTo($x[0]-$labelAdjust/7,$y[0]-$labelAdjust/6); +$picture->lineTo($x[0]-$labelAdjust/7,$y[0]-$labelAdjust,'blue'); +#person's height +$picture->lb( new Label($x[0]-$labelAdjust,$y[0]-$labelAdjust/2,$heightPersonU,'black','center','middle')); +#left leg +$picture->moveTo($x[0]-$labelAdjust/7,$y[0]-$labelAdjust); +$picture->lineTo($x[0]-$labelAdjust/3,$y[0]-1.5*$labelAdjust,'blue'); +#right leg +$picture->moveTo($x[0]-$labelAdjust/7,$y[0]-$labelAdjust); +$picture->lineTo($x[0]+$labelAdjust/8,$y[0]-1.5*$labelAdjust,'blue'); +#left arm +$picture->moveTo($x[0]-$labelAdjust/7,$y[0]-0.5*$labelAdjust); +$picture->lineTo($x[0]-$labelAdjust/3,$y[0]-$labelAdjust,'blue'); +#right arm +$picture->moveTo($x[0]-$labelAdjust/7,$y[0]-0.5*$labelAdjust); +$picture->lineTo($x[0]+$labelAdjust/8,$y[0]-$labelAdjust,'blue'); +#ground +$picture->moveTo($x[0]-$labelAdjust,$y[0]-1.5*$labelAdjust); +$picture->lineTo($x[1]+$labelAdjust,$y[0]-1.5*$labelAdjust,'blue'); +#plane +$picture->stamps( closed_circle($x[1],$y[1],'blue') ); +$picture->lb( new Label($x[1]+$labelAdjust/7,$y[1]+$labelAdjust/2,'object','black','center','middle')); + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$baseU,'black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner]-3*$labelAdjust,$y[0]-2*$labelAdjust,'ground','black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner]+$labelAdjust/2,$heightU,'black','center','middle')); + + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = $labelAdjust/3; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "The graph shows a $heightPersonU person on the ground, looking up at a flying object. A horizontal line is drawn from his eyes toward the object, and a vertical line is drawn from the object downward. Another line is connected from his eyes to the object. These three lines form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures x degrees. The length of the side opposite to the given acute angle is marked as $baseU; the side adjacent to the given acute angle is marked $heightU."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A person is standing straight on the ground, looking up at an object in the air. His eyes is [`[$heightPersonU]`] from the ground. Horizontally, the person is [`[$heightU]`] away from the object. The height of the object is [`[$heightTotalU]`]. Find the angle of elevation from his eyes to the object. + +The angle of elevation from his eyes to the object is [______________]{$alpha} degrees. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the vertical distance from the angle of elevation is [`x`] degrees. The following graph can represent this situation: + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Note that the height of the triangle is [`[$heightTotalU]-[$heightPersonU]=[$baseU]`], because we have to subtract the distance between the person's eyes to the ground from the object's height. + +This has become a right triangle trigonometry problem. + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the unmarked side is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$baseU]`] is the "opposite leg" of angle x, because it is opposite to the angle. + +The side marked as [`[$heightU]`] is the "adjacent leg" of angle x, because it is *not* opposite to the angle. + +Since we need to relate the angle's opposite and adjacent legs, we choose to use the tangent function. The solution is: + + [`` +\begin{aligned} + \tan{x} &= \frac{[$base]}{[$height]} \\ + x &= \tan^{-1}\left(\frac{[$base]}{[$height]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +The angle of elevation from his eyes to the object is [`[$alpha]`] degrees. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse60.pg b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse60.pg new file mode 100644 index 0000000000..592b3287e6 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse60.pg @@ -0,0 +1,249 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $base = random(50,200,1); + $alpha = random(20,70,1); + $alphaRadian = $alpha*pi/180; + $height = $base/tan($alphaRadian); + $hypotenuse = $height/cos($alphaRadian); +} until ($height<1000); +$height = int($height); +$alpha = Compute(arctan($base/$height)*180/pi); + +$hypotenuseU = NumberWithUnits("$hypotenuse ft"); +$baseU = NumberWithUnits("$base ft"); +$heightU = NumberWithUnits("$height ft"); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +$longer = max($base,$height); + +$xmin = 0; #The viewing window +$xmax = 1.5*$longer; +$ymin = 0; +$ymax = 1.5*$longer; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = 3; + + @x = (($xmax-$height)/2,($xmax+$height)/2); + @y = (($ymax-$base)/2,($ymax+$base)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = $longer/10; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$curveAdjust = $longer/10; +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+$curveAdjust*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+$curveAdjust*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; +$picture->lb( new Label($labelAx[$corner]+2*$curveAdjust*cos($theta), $labelAy[$corner]+2*$curveAdjust*sin($theta),"x",'black','center','middle')); + +$curveAdjust = $longer/10; +$xfuncAlpha1 = sub { my $t = shift(); + return $x[1]+$curveAdjust*cos($t); }; +$yfuncAlpha1 = sub { my $t = shift(); + return $y[1]+$curveAdjust*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha1, $yfuncAlpha1, $picture ); +$fnAlpha->domain(pi,pi+$alphaRadian); +$theta = pi+$alphaRadian/2; +$picture->lb( new Label($x[1]+2*$curveAdjust*cos($theta), $y[1]+2*$curveAdjust*sin($theta),'x','black','center','middle')); + + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + + +#horizontal line +$picture->moveTo($x[1],$y[1]); +$picture->lineTo($x[0],$y[1],'blue',1,'dashed'); +#spotlight +$picture->stamps( closed_circle($x[1],$y[1],'blue') ); +$picture->lb( new Label($x[1]+$labelAdjust/7,$y[1]+$labelAdjust/2,'spotlight','black','center','middle')); +#boat +$picture->stamps( closed_circle($x[0],$y[0],'blue') ); +$picture->lb( new Label($x[0]-$labelAdjust/7,$y[0]-$labelAdjust/2,'boat','black','center','middle')); + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$baseU,'black','center','middle')); +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner]+$curveAdjust,'lighthouse','black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner]+3*$labelAdjust,$labelHeightY[$corner]+$labelAdjust/2,'sea','black','center','middle')); +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner]+$labelAdjust/2,$heightU,'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = $labelAdjust/3; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "The graph shows a lighthouse with a spotlight on its top, shining light at a boat on the sea. The lighthouse, the line connecting the boat to the lighthouse, and a line connecting the boat to the spotlight form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x. The length of the side opposite to the given acute angle is marked as $baseU (height of the lighthouse); the side adjacent to the given acute angle is marked as $heightU (distance from boat to lighthouse). A dashed horizontal line is drawn from the spotlight toward the boat; this line forms an angle with the hypotenuse of the right triangle, marked as x."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A lighthouse has a spotlight on its top, and the spotlight is shining light on a boat on the sea. The lighthouse is [`[$baseU]`] high, and the horizontal distance from the boat to the lighthouse is [`[$heightU]`]. Find the angle of depression from the spotlight toward the boat. + +Solution: The angle of depression from the spotlight toward the boat is [___________]{$alpha} degrees. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the angle of depression from the spotlight toward the boat is [`x`] degrees. The following graph can represent this situation: + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Note that the horizontal line must be drawn, because the angle of depression is defined as the degree between a direction and the horizontal line. By the property of parallel lines, the acute angle at the boat end of the right triangle has the same measure as the angle of depression. + +This has become a right triangle trigonometry problem. + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the unmarked side is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$baseU]`] is the "opposite leg" of the angle marked as x, because it is opposite to the angle. + +The side marked as [`[$heightU]`] is the "adjacent leg" of the angle marked as x, because it is *not* opposite to the angle. + +Since we need to relate the angle's opposite and adjacent legs, we choose to use the tangent function. + +To find the unknown angle's measure, we need to use the inverse tangent function. Don't forget to change your calculator's mode to "degree". + +The solution is: + + [`` +\begin{aligned} + \tan{x} &= \frac{[$base]}{[$height]} \\ + x &= \tan^{-1}\left(\frac{[$base]}{[$height]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +Solution: The angle of depression from the spotlight toward the boat is [`[$alpha]`] degrees. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse70.pg b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse70.pg new file mode 100644 index 0000000000..4413e7156d --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse70.pg @@ -0,0 +1,228 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $base = random(2,5,0.1); + $alpha = random(10,20,1); + $alphaRadian = $alpha*pi/180; + $height = $base/tan($alphaRadian); + $hypotenuse = $height/cos($alphaRadian); +} until ($hypotenuse<30); +$height = int($height*10)/10; +$hypotenuse = int($hypotenuse*10)/10; +$base = sqrt($hypotenuse**2-$height**2); +$base = int($base*10)/10; +$alpha = Compute(arccos($height/$hypotenuse)*180/pi); + +$hypotenuseU = NumberWithUnits("$hypotenuse ft"); +$baseU = NumberWithUnits("$base ft"); +$heightU = NumberWithUnits("$height ft"); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +$longer = max($base,$height); + +$xmin = 0; #The viewing window +$xmax = 1.5*$longer; +$ymin = 0; +$ymax = 1.5*$longer; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = 3; + + @x = (($xmax-$height)/2,($xmax+$height)/2); + @y = (($ymax-$base)/2,($ymax+$base)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = $longer/20; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$curveAdjust = $longer/10; +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+$curveAdjust*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+$curveAdjust*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; +$picture->lb( new Label($labelAx[$corner]+2*$curveAdjust*cos($theta), $labelAy[$corner]+2*$curveAdjust*sin($theta),"x",'black','center','middle')); + + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + + +#trunk +$picture->stamps( closed_circle($x[1],$y[1],'blue') ); +$picture->lb( new Label($x[1]+$labelAdjust,$y[1]+$labelAdjust,'trunk','black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$heightU,'black','center','middle')); +$picture->lb( new Label($labelHeightX[$corner]+5,$labelHeightY[$corner],'ground','black','center','middle')); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuseU,'black','center','middle')); +$picture->lb( new Label($labelHypotenuseX[$corner]+3*$labelAdjust,$labelHypotenuseY[$corner]+$labelAdjust,'ramp','black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = $labelAdjust/2; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "The graph shows a ramp set up from a trunk to the ground. A vertical line is drawn from upper end of the ramp (touching the trunk) straight down to the ground. A horizontal line is drawn from where the ramp touches the ground toward the trunk. The ramp, the vertical line and the horizontal line form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x. The side adjacent to the given acute angle is labeled as the ground, and $heightU; and the side opposite to the right angle is labeled as the ramp, and also labeled as $hypotenuseU."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A ramp is set up from a truck's trunk to the ground. From the ramp's end touching the ground to the trunk's horizontal distance is [`[$heightU]`]. If the length of the ramp is [`[$hypotenuseU]`], find the angle between the ramp and the ground. + +Solution: The angle between the ramp and the ground is [___________]{$alpha} degrees. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the angle between the ramp and the ground is [`x`] degrees. The following graph can represent this situation: + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +This has become a right triangle trigonometry problem. + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the side marked as "ramp", or [`[$hypotenuseU]`], is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as "ground", or [`[$heightU]`], is the "adjacent leg" of the angle marked as [`x`], because it is not opposite to the angle. + +Since we need to relate the hypotenuse and the angle's adjacent leg, we choose to use the cosine function. The solution is: + + [`` +\begin{aligned} + \cos{x} &= \frac{[$height]}{[$hypotenuse]} \\ + x &= \cos^{-1}\left(\frac{[$height]}{[$hypotenuse]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +Solution: The angle between the ramp and the ground is approximately [`[$alpha]`] degrees. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange10.pg b/Contrib/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange10.pg new file mode 100644 index 0000000000..c65a5ecec9 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange10.pg @@ -0,0 +1,105 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("Numeric"); + +$popupSine0 = PopUp(["?", "defined", "undefined"], "defined"); +$popupSine1 = PopUp(["?", "defined", "undefined"], "undefined"); +$popupCosine0 = PopUp(["?", "defined", "undefined"], "defined"); +$popupCosine1 = PopUp(["?", "defined", "undefined"], "undefined"); +$popupTangent0 = PopUp(["?", "defined", "undefined"], "defined"); +$popupTangent1 = PopUp(["?", "defined", "undefined"], "undefined"); + +@prob = ( + [random(0.1,0.9,0.1), $popupSine0, $popupCosine0, $popupTangent0], + [random(-0.9,-0.1,0.1), $popupSine0, $popupCosine0, $popupTangent0], + [list_random(-1,0,1), $popupSine0, $popupCosine0, $popupTangent0], + [random(1.1,2.9,0.1), $popupSine1, $popupCosine1, $popupTangent0], + [random(-2.9,-1.1,0.1), $popupSine1, $popupCosine1, $popupTangent0], +); + +@perm = NchooseK(6,3); + + +########################################################## + +BEGIN_PGML + +Decide whether each value is defined or undefined. + +a) [`` \sin^{-1}\left( [$prob[$perm[0]][0]] \right) \text{ is}``] [_____________]{$prob[$perm[0]][1]} + +b) [`` \cos^{-1}\left( [$prob[$perm[1]][0]] \right) \text{ is}``] [_____________]{$prob[$perm[1]][2]} + +c) [`` \tan^{-1}\left( [$prob[$perm[2]][0]] \right) \text{ is}``] [_____________]{$prob[$perm[2]][3]} + + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +###Part a + +The range of [`y=\sin(x)`] and the domain of [`y=\sin^{-1}(x)`] are both [` [-1,1] `]. + +So [` \sin^{-1}\left( [$prob[$perm[0]][0]] \right)`] is [$prob[$perm[0]][1]->correct_ans()]. + +###Part b + +The range of [`y=\cos(x)`] and the domain of [`y=\cos^{-1}(x)`] are both [` [-1,1] `]. + +So [` \cos^{-1}\left( [$prob[$perm[1]][0]] \right)`] is [$prob[$perm[1]][2]->correct_ans()]. + +###Part c + +The range of [`y=\tan(x)`] and the domain of [`y=\tan^{-1}(x)`] are both [` (-\infty,\infty) `]. + +So [` \tan^{-1}\left( [$prob[$perm[2]][0]] \right)`] is [$prob[$perm[2]][3]->correct_ans()]. + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange20.pg b/Contrib/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange20.pg new file mode 100644 index 0000000000..6d89b799c3 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange20.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +###################################### + +sub output { + my ($n,$d) = shift->value; + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +TEXT(beginproblem()); + +Context("Fraction"); + +$popupSine0 = PopUp(["?", "possible", "impossible"], "possible"); +$popupSine1 = PopUp(["?", "possible", "impossible"], "impossible"); +$popupCosine0 = PopUp(["?", "possible", "impossible"], "possible"); +$popupCosine1 = PopUp(["?", "possible", "impossible"], "impossible"); +$popupTangent0 = PopUp(["?", "possible", "impossible"], "possible"); +$popupTangent1 = PopUp(["?", "possible", "impossible"], "impossible"); + +do { + $den = random(3,9,1); + $num = random(1,int($den/2),1); +} until gcd($num,$den)==1 && $num/$den<0.5; +$frac0 = Fraction($num,$den); + +do { + $den = random(3,9,1); + $num = random(int($den/2)+1,$den-1,1); +} until gcd($num,$den)==1 && $num/$den>0.5; +$frac1 = Fraction($num,$den); +$frac4 = -$frac1; + +do { + $den = random(3,9,1); + $num = random(1,int($den/2),1); +} until gcd($num,$den)==1 && $num/$den<0.5; +$frac2 = -Fraction($num,$den); + +do { + $den = random(3,9,1); + $num = random($den+1,2*$den-1,1); +} until gcd($num,$den)==1; +$frac3 = Fraction($num,$den); + +@prob = ( + [&output($frac0), $popupSine0, $popupCosine0, $popupTangent0], + [&output($frac1), $popupSine1, $popupCosine0, $popupTangent1], + [&output($frac2), $popupSine0, $popupCosine1, $popupTangent0], + [&output(Fraction(1,2)), $popupSine0, $popupCosine0, $popupTangent1], + [&output(Fraction(-1,2)), $popupSine0, $popupCosine1, $popupTangent1], + [&output($frac3), $popupSine1, $popupCosine1, $popupTangent1], + [&output($frac4), $popupSine1, $popupCosine1, $popupTangent1], +); + +@perm = NchooseK(7,3); + + +########################################################## + +BEGIN_PGML + +Decide whether each equation is possible or impoosible. + +a) [`` \sin^{-1}(\alpha)= [$prob[$perm[0]][0]] \text{ is}``] [_____________]{$prob[$perm[0]][1]} + +b) [`` \cos^{-1}(\beta)= [$prob[$perm[1]][0]] \text{ is}``] [_____________]{$prob[$perm[1]][2]} + +c) [`` \tan^{-1}(\gamma)= [$prob[$perm[2]][0]] \text{ is}``] [_____________]{$prob[$perm[2]][3]} + + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +###Part a + +The range of [`y=\sin^{-1}(x)`] is [` \left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. + +So [` \sin^{-1}(\alpha)= [$prob[$perm[0]][0]] `] is [$prob[$perm[0]][1]->correct_ans()]. + +###Part b + +The range of [`y=\cos^{-1}(x)`] is [` \left[ 0,\pi \right] `]. + +So [` \cos^{-1}(\beta)= [$prob[$perm[1]][0]] `] is [$prob[$perm[1]][2]->correct_ans()]. + +###Part c + +The range of [`y=\tan^{-1}(x)`] is [` \left( -\frac{\pi}{2},\frac{\pi}{2} \right) `]. + +So [` \tan^{-1}(\gamma)= [$prob[$perm[2]][0]] `] is [$prob[$perm[2]][3]->correct_ans()]. + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange30.pg b/Contrib/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange30.pg new file mode 100644 index 0000000000..ab7df63b2f --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange30.pg @@ -0,0 +1,173 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +@intervals = ( + "\displaystyle [-1,1]", + "\displaystyle \left[ -\frac{\pi}{2},\frac{\pi}{2} \right]", + "\displaystyle [0,\pi]", + "\displaystyle (-\infty,\infty)", + "\displaystyle \left( -\frac{\pi}{2},\frac{\pi}{2} \right)", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..4) { + do {$temp = list_random(0..4)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$popupSineDomain = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{0}]); + +$popupSineRange = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{1}]); + +$popupCosineDomain = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{0}]); + +$popupCosineRange = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{2}]); + +$popupTangentDomain = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{3}]); + +$popupTangentRange = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{4}]); + +########################################################## + +BEGIN_PGML + +Choose the correct interval for each problem. + +[@DataTable( + [ + [ + [PF('[`` \text{Domain of }y=\sin^{-1}(x)\text{ is }``] [_____________]{$popupSineDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{A: }[$intervals[$scramble{0}]]``]')], + ], + [ + [PF('[`` \text{Range of }y=\sin^{-1}(x)\text{ is }``] [_____________]{$popupSineRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{B: }[$intervals[$scramble{1}]]``]')], + ], + [ + [PF('[`` \text{Domain of }y=\cos^{-1}(x)\text{ is }``] [_____________]{$popupCosineDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{C: }[$intervals[$scramble{2}]]``]')], + ], + [ + [PF('[`` \text{Range of }y=\cos^{-1}(x)\text{ is }``] [_____________]{$popupCosineRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{D: }[$intervals[$scramble{3}]]``]')], + ], + [ + [PF('[`` \text{Domain of }y=\tan^{-1}(x)\text{ is }``] [_____________]{$popupTangentDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{E: }[$intervals[$scramble{4}]]``]')], + ], + [ + [PF('[`` \text{Range of }y=\tan^{-1}(x)\text{ is }``] [_____________]{$popupTangentRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('')], + ], + ], + align => 'l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +It is very important to know the domain and range of the following functions. + +[@DataTable( + [ + [ + [PF('Functions'), + cellcss => 'border-right: 1px solid;', + rowcss => 'border-bottom: 1px solid;'], + [PF('Domain'), + cellcss => 'border-right: 1px solid; '], + [PF('Range')], + ], + [ + [PF('[``y=\sin^{-1}(x)``]'), + rowcss => 'border-bottom: 1px solid;height:60px;', + cellcss => 'border-right: 1px solid;',], + [PF('[`\left[ -1,1 \right]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[``\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]``]')], + ], + [ + [PF('[``y=\cos^{-1}(x)``]'), + rowcss => 'height:60px;border-bottom: 1px solid;', + cellcss => 'border-right: 1px solid; '], + [PF('[`\left[ -1,1 \right]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[``\left[ 0,\pi \right]``]')], + ], + [ + [PF('[``y=\tan^{-1}(x)``]'), + rowcss => 'height:60px;', + cellcss => 'border-right: 1px solid; '], + [PF('[`\left( -\infty,\infty \right)`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[``\left( -\frac{\pi}{2},\frac{\pi}{2} \right)``]')], + ], + ], + align => 'c c c', +);@]* + + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/SpecialAngleInverse10.pg b/Contrib/PCC/Trigonometry/InverseTrig/SpecialAngleInverse10.pg new file mode 100644 index 0000000000..0b11c85ef9 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/SpecialAngleInverse10.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$a = random(1.1,10,0.1); +$b = random(-10,-1.1,0.1); + +@prob = ( + ["\displaystyle \sin^{-1}\left(-1\right)",Formula("-pi/2")], + ["\displaystyle \sin^{-1}\left(-\frac{\sqrt{3}}{2}\right)",Formula("-pi/3")], + ["\displaystyle \sin^{-1}\left(-\frac{\sqrt{2}}{2}\right)",Formula("-pi/4")], + ["\displaystyle \sin^{-1}\left(-\frac{1}{2}\right)",Formula("-pi/6")], + ["\displaystyle \sin^{-1}\left(0\right)",Formula("0")], + ["\displaystyle \sin^{-1}\left(\frac{1}{2}\right)",Formula("pi/6")], + ["\displaystyle \sin^{-1}\left(\frac{\sqrt{2}}{2}\right)",Formula("pi/4")], + ["\displaystyle \sin^{-1}\left(\frac{\sqrt{3}}{2}\right)",Formula("pi/3")], + ["\displaystyle \sin^{-1}\left(1\right)",Formula("pi/2")], + ["\displaystyle \sin^{-1}\left($a\right)",Compute("DNE")], + ["\displaystyle \sin^{-1}\left($b\right)",Compute("DNE")], +); + +@perm = NchooseK(11,4); + + +########################################################## + +BEGIN_PGML + +Fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* Type *DNE* (does not exist) for undefined values.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + + [`` [$prob[$perm[2]][0]] =``] [_____________]{$prob[$perm[2]][1]} + + [`` [$prob[$perm[3]][0]] =``] [_____________]{$prob[$perm[3]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Use a Unit Circle for help if needed, but it would be great if you can come up with the following values without looking at a Unit Circle. Use your knowledge of 30-60-90 and 45-45-90 special right triangles. + +Note that the range of [`y=\sin^{-1}(x)`] is [`[-\frac{\pi}{2},\frac{\pi}{2}]`]. + + [`` \begin{aligned} + \sin^{-1}\left(-1\right) &= -\frac{\pi}{2} \\ + \sin^{-1}\left(-\frac{\sqrt{3}}{2}\right) &= -\frac{\pi}{3} \\ + \sin^{-1}\left(-\frac{\sqrt{2}}{2}\right) &= -\frac{\pi}{4} \\ + \sin^{-1}\left(-\frac{1}{2}\right) &= -\frac{\pi}{6} \\ + \sin^{-1}\left(0\right) &= 0 \\ + \sin^{-1}\left(\frac{1}{2}\right) &= \frac{\pi}{6} \\ + \sin^{-1}\left(\frac{\sqrt{2}}{2}\right) &= \frac{\pi}{4} \\ + \sin^{-1}\left(\frac{\sqrt{3}}{2}\right) &= \frac{\pi}{3} \\ + \sin^{-1}\left(1\right) &= \frac{\pi}{2} \\ + \end{aligned} ``] + +Note that expressions like [`\sin^{-1}([$a])`] and [`\sin^{-1}([$b])`] are undefined because the domain of [`y=\sin^{-1}(x)`] is [`[-1,1]`]. + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/SpecialAngleInverse20.pg b/Contrib/PCC/Trigonometry/InverseTrig/SpecialAngleInverse20.pg new file mode 100644 index 0000000000..68bd32bc28 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/SpecialAngleInverse20.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$a = random(1.1,10,0.1); +$b = random(-10,-1.1,0.1); + +@prob = ( + ["\displaystyle \cos^{-1}\left(-1\right)",Formula("pi")], + ["\displaystyle \cos^{-1}\left(-\frac{1}{2}\right)",Formula("2pi/3")], + ["\displaystyle \cos^{-1}\left(-\frac{\sqrt{2}}{2}\right)",Formula("3pi/4")], + ["\displaystyle \cos^{-1}\left(-\frac{\sqrt{3}}{2}\right)",Formula("5pi/6")], + ["\displaystyle \cos^{-1}\left(0\right)",Formula("pi/2")], + ["\displaystyle \cos^{-1}\left(\frac{1}{2}\right)",Formula("pi/3")], + ["\displaystyle \cos^{-1}\left(\frac{\sqrt{2}}{2}\right)",Formula("pi/4")], + ["\displaystyle \cos^{-1}\left(\frac{\sqrt{3}}{2}\right)",Formula("pi/6")], + ["\displaystyle \cos^{-1}\left(1\right)",Formula("0")], + ["\displaystyle \cos^{-1}\left($a\right)",Compute("DNE")], + ["\displaystyle \cos^{-1}\left($b\right)",Compute("DNE")], +); + +@perm = NchooseK(11,4); + + +########################################################## + +BEGIN_PGML + +Fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* Type *DNE* (does not exist) for undefined values.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + + [`` [$prob[$perm[2]][0]] =``] [_____________]{$prob[$perm[2]][1]} + + [`` [$prob[$perm[3]][0]] =``] [_____________]{$prob[$perm[3]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Use a Unit Circle for help if needed, but it would be great if you can come up with the following values without looking at a Unit Circle. Use your knowledge of 30-60-90 and 45-45-90 special right triangles. + +Note that the range of [`y=\cos^{-1}(x)`] is [`[0,\pi]`]. + + [`` \begin{aligned} + \cos^{-1}\left(-1\right) &= \pi \\ + \cos^{-1}\left(-\frac{\sqrt{3}}{2}\right) &= \frac{5\pi}{6} \\ + \cos^{-1}\left(-\frac{\sqrt{2}}{2}\right) &= \frac{3\pi}{4} \\ + \cos^{-1}\left(-\frac{1}{2}\right) &= \frac{2\pi}{3} \\ + \cos^{-1}\left(0\right) &= \frac{\pi}{2} \\ + \cos^{-1}\left(\frac{1}{2}\right) &= \frac{\pi}{3} \\ + \cos^{-1}\left(\frac{\sqrt{2}}{2}\right) &= \frac{\pi}{4} \\ + \cos^{-1}\left(\frac{\sqrt{3}}{2}\right) &= \frac{\pi}{6} \\ + \cos^{-1}\left(1\right) &= 0 \\ + \end{aligned} ``] + +Note that expressions like [`\cos^{-1}([$a])`] and [`\cos^{-1}([$b])`] are undefined because the domain of [`y=\cos^{-1}(x)`] is [`[-1,1]`]. + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/SpecialAngleInverse30.pg b/Contrib/PCC/Trigonometry/InverseTrig/SpecialAngleInverse30.pg new file mode 100644 index 0000000000..1d4e7bf251 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/SpecialAngleInverse30.pg @@ -0,0 +1,103 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + + +@prob = ( + ["\displaystyle \tan^{-1}\left(-\sqrt{3}\right)",Formula("-pi/3")], + ["\displaystyle \tan^{-1}\left(-1\right)",Formula("-pi/4")], + ["\displaystyle \tan^{-1}\left(-\frac{\sqrt{3}}{3}\right)",Formula("-pi/6")], + ["\displaystyle \tan^{-1}\left(0\right)",Formula("0")], + ["\displaystyle \tan^{-1}\left(\frac{\sqrt{3}}{3}\right)",Formula("pi/6")], + ["\displaystyle \tan^{-1}\left(1\right)",Formula("pi/4")], + ["\displaystyle \tan^{-1}\left(\sqrt{3}\right)",Formula("pi/3")], +); + +@perm = NchooseK(7,4); + + +########################################################## + +BEGIN_PGML + +[@KeyboardInstructions( +"\n" +.'* Type *DNE* (does not exist) for undefined values.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + + [`` [$prob[$perm[2]][0]] =``] [_____________]{$prob[$perm[2]][1]} + + [`` [$prob[$perm[3]][0]] =``] [_____________]{$prob[$perm[3]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Use a Unit Circle for help if needed, but it would be great if you can come up with the following values without looking at a Unit Circle. Use your knowledge of 30-60-90 and 45-45-90 special right triangles. + +Note that the range of [`y=\tan^{-1}(x)`] is [`\left(-\frac{\pi}{2},\frac{\pi}{2}\right)`]. + + [`` \begin{aligned} + \tan^{-1}\left(-\sqrt{3}\right) &= -\frac{\pi}{3} \\ + \tan^{-1}\left(-1\right) &= -\frac{\pi}{4} \\ + \tan^{-1}\left(-\frac{\sqrt{3}}{3}\right) &= -\frac{\pi}{6} \\ + \tan^{-1}\left(0\right) &= 0 \\ + \tan^{-1}\left(\frac{\sqrt{3}}{3}\right) &= \frac{\pi}{6} \\ + \tan^{-1}\left(1\right) &= \frac{\pi}{4} \\ + \tan^{-1}\left(\sqrt{3}\right) &= \frac{\pi}{3} \\ + \end{aligned} ``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination10.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination10.pg new file mode 100644 index 0000000000..2ebf6a75b2 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination10.pg @@ -0,0 +1,99 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$multiple = 1; +$base = $multiple*$triples[$in][0]; +$height = $multiple*$triples[$in][1]; +$hypotenuse = $multiple*$triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse)*random(-1,1,2), + Fraction($base,$hypotenuse)*random(-1,1,2), + Fraction($height,$base)*random(-1,1,2), +); + +$frac0 = $ans[0]; +$frac1 = $ans[1]; +$frac2 = $ans[2]; + +############################################################## + +BEGIN_PGML + +Evaluate the following without using a calculator. + + [``\sin\left( \sin^{-1}\left( [$frac0] \right) \right) =``][_____________]{$frac0} + + [``\cos\left( \cos^{-1}\left( [$frac1] \right) \right) =``][_____________]{$frac1} + + [``\tan\left( \tan^{-1}\left( [$frac2] \right) \right) =``][_____________]{$frac2} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Assume [`\alpha = \sin^{-1}\left( [$frac0] \right)`], then [`\sin (\alpha) = [$frac0] `]. This implies + + [``\begin{aligned} + \sin\left( \sin^{-1}\left( [$frac0] \right) \right) &= \sin(\alpha) \\ + &= [$frac0] + \end{aligned}``] + +Similarly, assume [` \beta = \cos^{-1}\left( [$frac1] \right) `] and [` \gamma = \tan^{-1}\left( [$frac2] \right) `], we have: + + [``\begin{aligned} + \cos\left( \cos^{-1}\left( [$frac1] \right) \right) &= \cos(\beta) = [$frac1] \\ + \tan\left( \tan^{-1}\left( [$frac2] \right) \right) &= \tan(\gamma) = [$frac2] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination100.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination100.pg new file mode 100644 index 0000000000..1b7ed70bec --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination100.pg @@ -0,0 +1,192 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 4; + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_____]{$ans[4]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +$absBase = abs($base); +$absHeight = abs($height); + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right) `], either in Quadrant I or Quadrant IV. + +Since [`[$ans[2]]<0`], the angle [`\tan^{-1}\left( [$ans[2]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its height [`[$height]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination101.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination101.pg new file mode 100644 index 0000000000..02151b34c5 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination101.pg @@ -0,0 +1,273 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $baseOut = random(1,5,1); + $heightIn = list_random(1,2,3,5); + $heightOut = -random(1,5,1); + } until (gcd(abs($heightOut),abs($baseOut))==1); + $baseIn = 1; + ($hypotenuseOut,$hypotenuseIn) = &radSimplify($baseOut**2*$baseIn+$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && !(($baseOut>0) && ($heightOut>0)) && ($hypotenuseIn<30); + + $heightOut = $heightOut*random(-1,1,2); + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + + $base = $baseOut; + $absBase = abs($baseOut); + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + if ($hypotenuseIn==1) { + $hypotenuse = $hypotenuseOut; + } elsif (abs($hypotenuseOut)==1) { + $hypotenuse = Formula("sqrt($hypotenuseIn)"); + } else { + $hypotenuse = Formula("$hypotenuseOut*sqrt($hypotenuseIn)"); + } + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin \left( \tan^{-1}\left( [$ans[2]] \right) \right)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc \left( \tan^{-1}\left( [$ans[2]] \right) \right)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos \left( \tan^{-1}\left( [$ans[2]] \right) \right)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec \left( \tan^{-1}\left( [$ans[2]] \right) \right)=`][_____]{$ans[4]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right) `], either in Quadrant I or Quadrant IV. + +Since [`[$ans[2]]<0`], the angle [`\tan^{-1}\left( [$ans[2]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its height [`[$height]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination110.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination110.pg new file mode 100644 index 0000000000..273ef3438d --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination110.pg @@ -0,0 +1,228 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "PCCmacros.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +do { + do { + $a = random(1,3,1); + $b = random(-5,5,1); + } until gcd(abs($a),abs($b))==1; + + $in = random(0,3,1); + if ($in==0) { + $base = Compute("$a*x")->reduce; + $c = 2*$a*$b; + $height = Compute("sqrt($c*x+($b)**2)")->reduce; + $hypotenuse = Compute("$a*x+$b")->reduce; + $space = 0; #bottom need space + } elsif ($in==1) { + $base = Compute("$a")->reduce; + $height = Compute("x")->reduce; + $hypotenuse = Compute("sqrt(x**2+($a)**2)")->reduce; + $space = 1; #left need space + } elsif ($in==2) { + $base = Compute("x")->reduce; + $height = Compute("sqrt(($a)**2-x**2)")->reduce; + $hypotenuse = Compute("$a")->reduce; + $space = 0; #bottom need space + } else { + Context()->flags->set(limits=>[$a+1,$a+2]); + $base = Compute("$a")->reduce; + $height = Compute("sqrt((x)**2-($a)**2)")->reduce; + $hypotenuse = Compute("x")->reduce; + $space = 0; #bottom need space + } +} until $base != 0 && $height!=0 && $hypotenuse!=0; + +if (random(0,1,1)==0) { + $temp = $base; + $base = $height; + $height = $temp; + if ($space!=1) {$space = 2;} #right need space +} + +Context("LimitedRadical"); + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + ($hypotenuse==1) ? Formula("$base") : Formula("$base/$hypotenuse"), + ($hypotenuse==1) ? Formula("$height") : Formula("$height/$hypotenuse"), + ($height==1) ? Formula("$base") : Formula("$base/$height"), + ($base==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$base"), + ($height==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$height"), + ($base==1) ? Formula("$height") : Formula("$height/$base"), +); + +for my $i (0..5) { + if ($in==0) { + if ($c>0) { + $left = max(-($b)**2/$c,-$b/$a); + $right = $left+1; + } else { + $right = min(-($b)**2/$c,-$b/$a); + $left = -$right; + } + $ans[$i]->{limits} = [$left,$right]; + } + if ($in==2) {$ans[$i]->{limits} = [0,$a];} + if ($in==3) {$ans[$i]->{limits} = [$a+1,$a+2];} +} + +$Ax = 0; +$Ay = 0; +$Cx = sqrt(3); +$Cy = 0; +$Bx = $Cx; +$By = 1; +$cushion = 2; + +if ($space==1) { + $xmin = -$cushion; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} elsif ($space==2) { + $xmin = -0.5; + $xmax = $Cx+$cushion; + $ymin = -0.2; + $ymax = $By+0.2; +} else { + $xmin = -0.5; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$xShift = $xmax/20; +$yShift = $xShift/$xmax*$ymax; +$picture[0]->moveTo($Cx,$Cy+$yShift); +$picture[0]->lineTo($Cx-$xShift,$Cy+$yShift,blue,3); +$picture[0]->lineTo($Cx-$xShift,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','bottom','large')); +$picture[0]->lb( new Label($Cx+0.1,$Cy,"C",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx+0.1,($By+$Cy)/2,"$base",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay-0.02,"$height",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"$hypotenuse",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is $height. Angle C is a right angle. Side CB goes up, and the length is $base. The length of AB is $hypotenuse."; + + + +############################################################## + +BEGIN_PGML + +Find the following values. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Do not rationalize the denominator.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\cos\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_______________]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_______________]{$ans[4]}')], + ], + [ + [PF('[`\tan\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_______________]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_______________]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + + +BEGIN_PGML_SOLUTION + +Assume [`\angle A = \sin^{-1}\left( [$ans[0]] \right) `], then [`\sin(A) = [$ans[0]]`]. If we sketch a right triangle with [`\angle A`], we can make its opposite side [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$height]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(A) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(A) &= \frac{\text{adjacent}}{\text{hypotenuse}} = [$ans[1]] \\ + \tan(A) &= \frac{\sin(A)}{\cos(A)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \sec(A) &= \frac{1}{\cos(A)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(A) &= \frac{\cos(A)}{\sin(A)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination120.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination120.pg new file mode 100644 index 0000000000..a436e7666d --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination120.pg @@ -0,0 +1,231 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "PCCmacros.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +do { + do { + $a = random(1,3,1); + $b = random(-5,5,1); + $c = 2*$a*$b; + } until gcd(abs($a),abs($b))==1 && +!(abs($c)%4==0 && ($b)**2%4==0) && +!(abs($c)%9==0 && ($b)**2%9==0); + + $in = random(0,3,1); + if ($in==0) { + $base = Compute("$a*x")->reduce; + $height = Compute("sqrt($c*x+($b)**2)")->reduce; + $hypotenuse = Compute("$a*x+$b")->reduce; + $space = 0; #bottom need space + } elsif ($in==1) { + $base = Compute("$a")->reduce; + $height = Compute("x")->reduce; + $hypotenuse = Compute("sqrt(x**2+($a)**2)")->reduce; + $space = 1; #left need space + } elsif ($in==2) { + $base = Compute("x")->reduce; + $height = Compute("sqrt(($a)**2-x**2)")->reduce; + $hypotenuse = Compute("$a")->reduce; + $space = 0; #bottom need space + } else { + Context()->flags->set(limits=>[$a+1,$a+2]); + $base = Compute("$a")->reduce; + $height = Compute("sqrt((x)**2-($a)**2)")->reduce; + $hypotenuse = Compute("x")->reduce; + $space = 0; #bottom need space + } +} until $base != 0 && $height!=0 && $hypotenuse!=0; + +if (random(0,1,1)==0) { + $temp = $base; + $base = $height; + $height = $temp; + if ($space!=1) {$space = 2;} #right need space +} + +Context("LimitedRadical"); + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + ($hypotenuse==1) ? Formula("$base") : Formula("$base/$hypotenuse"), + ($hypotenuse==1) ? Formula("$height") : Formula("$height/$hypotenuse"), + ($height==1) ? Formula("$base") : Formula("$base/$height"), + ($base==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$base"), + ($height==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$height"), + ($base==1) ? Formula("$height") : Formula("$height/$base"), +); + +for my $i (0..5) { + if ($in==0) { + if ($c>0) { + $left = max(-($b)**2/$c,-$b/$a); + $right = $left+1; + } else { + $right = min(-($b)**2/$c,-$b/$a); + $left = -$right; + } + $ans[$i]->{limits} = [$left,$right]; + } + if ($in==2) {$ans[$i]->{limits} = [0,$a];} + if ($in==3) {$ans[$i]->{limits} = [$a+1,$a+2];} +} + +$Ax = 0; +$Ay = 0; +$Cx = sqrt(3); +$Cy = 0; +$Bx = $Cx; +$By = 1; +$cushion = 2; + +if ($space==1) { + $xmin = -$cushion; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} elsif ($space==2) { + $xmin = -0.5; + $xmax = $Cx+$cushion; + $ymin = -0.2; + $ymax = $By+0.2; +} else { + $xmin = -0.5; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$xShift = $xmax/20; +$yShift = $xShift/$xmax*$ymax; +$picture[0]->moveTo($Cx,$Cy+$yShift); +$picture[0]->lineTo($Cx-$xShift,$Cy+$yShift,blue,3); +$picture[0]->lineTo($Cx-$xShift,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','bottom','large')); +$picture[0]->lb( new Label($Cx+0.1,$Cy,"C",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx+0.1,($By+$Cy)/2,"$base",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay-0.02,"$height",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"$hypotenuse",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is $height. Angle C is a right angle. Side CB goes up, and the length is $base. The length of AB is $hypotenuse."; + + + +############################################################## + +BEGIN_PGML + +Find the following values. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Do not rationalize the denominator.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_______________]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_______________]{$ans[3]}')], + ], + [ + [PF('[`\tan\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_______________]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_______________]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + + +BEGIN_PGML_SOLUTION + +Assume [`\angle A = \cos^{-1}\left( [$ans[1]] \right) `], then [`\cos(A) = [$ans[1]]`]. If we sketch a right triangle with [`\angle A`], we can make its adjacent side [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$base]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(A) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(A) &= \frac{\text{adjacent}}{\text{hypotenuse}} = [$ans[1]] \\ + \tan(A) &= \frac{\sin(A)}{\cos(A)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(A) &= \frac{1}{\sin(A)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \cot(A) &= \frac{\cos(A)}{\sin(A)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination130.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination130.pg new file mode 100644 index 0000000000..5e6108a3c6 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination130.pg @@ -0,0 +1,227 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +do { + do { + $a = random(1,3,1); + $b = random(-5,5,1); + } until gcd(abs($a),abs($b))==1; + + $in = random(0,3,1); + if ($in==0) { + $base = Compute("$a*x")->reduce; + $c = 2*$a*$b; + $height = Compute("sqrt($c*x+($b)**2)")->reduce; + $hypotenuse = Compute("$a*x+$b")->reduce; + $space = 0; #bottom need space + } elsif ($in==1) { + $base = Compute("$a")->reduce; + $height = Compute("x")->reduce; + $hypotenuse = Compute("sqrt(x**2+($a)**2)")->reduce; + $space = 1; #left need space + } elsif ($in==2) { + $base = Compute("x")->reduce; + $height = Compute("sqrt(($a)**2-x**2)")->reduce; + $hypotenuse = Compute("$a")->reduce; + $space = 0; #bottom need space + } else { + Context()->flags->set(limits=>[$a+1,$a+2]); + $base = Compute("$a")->reduce; + $height = Compute("sqrt((x)**2-($a)**2)")->reduce; + $hypotenuse = Compute("x")->reduce; + $space = 0; #bottom need space + } +} until $base != 0 && $height!=0 && $hypotenuse!=0; + +if (random(0,1,1)==0) { + $temp = $base; + $base = $height; + $height = $temp; + if ($space!=1) {$space = 2;} #right need space +} + +Context("LimitedRadical"); + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + ($hypotenuse==1) ? Formula("$base") : Formula("$base/$hypotenuse"), + ($hypotenuse==1) ? Formula("$height") : Formula("$height/$hypotenuse"), + ($height==1) ? Formula("$base") : Formula("$base/$height"), + ($base==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$base"), + ($height==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$height"), + ($base==1) ? Formula("$height") : Formula("$height/$base"), +); + +for my $i (0..5) { + if ($in==0) { + if ($c>0) { + $left = max(-($b)**2/$c,-$b/$a); + $right = $left+1; + } else { + $right = min(-($b)**2/$c,-$b/$a); + $left = -$right; + } + $ans[$i]->{limits} = [$left,$right]; + } + if ($in==2) {$ans[$i]->{limits} = [0,$a];} + if ($in==3) {$ans[$i]->{limits} = [$a+1,$a+2];} +} + +$Ax = 0; +$Ay = 0; +$Cx = sqrt(3); +$Cy = 0; +$Bx = $Cx; +$By = 1; +$cushion = 2; + +if ($space==1) { + $xmin = -$cushion; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} elsif ($space==2) { + $xmin = -0.5; + $xmax = $Cx+$cushion; + $ymin = -0.2; + $ymax = $By+0.2; +} else { + $xmin = -0.5; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$xShift = $xmax/20; +$yShift = $xShift/$xmax*$ymax; +$picture[0]->moveTo($Cx,$Cy+$yShift); +$picture[0]->lineTo($Cx-$xShift,$Cy+$yShift,blue,3); +$picture[0]->lineTo($Cx-$xShift,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','bottom','large')); +$picture[0]->lb( new Label($Cx+0.1,$Cy,"C",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx+0.1,($By+$Cy)/2,"$base",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay-0.02,"$height",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"$hypotenuse",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is $height. Angle C is a right angle. Side CB goes up, and the length is $base. The length of AB is $hypotenuse."; + + + +############################################################## + +BEGIN_PGML + +Find the following values. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Do not rationalize the denominator.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_______________]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_______________]{$ans[3]}')], + ], + [ + [PF('[`\cos\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_______________]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_______________]{$ans[4]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + + +BEGIN_PGML_SOLUTION + +Assume [`\angle A = \tan^{-1}\left( [$ans[2]] \right) `], then [`\tan(A) = [$ans[2]]`]. If we sketch a right triangle with [`\angle A`], we can make its opposite side [`[$base]`] and its adjacent [`[$height]`]: + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(A) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \csc(A) &= \frac{1}{\sin(A)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \cos(A) &= \frac{\text{adjacent}}{\text{hypotenuse}} = [$ans[1]] \\ + \sec(A) &= \frac{1}{\cos(A)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination20.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination20.pg new file mode 100644 index 0000000000..b1a7644d6d --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination20.pg @@ -0,0 +1,264 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = random(1,int($den/2),1); +} until gcd($num[0],$den)==1 && $num[0]/$den<0.5; + +$num[1] = $den-$num[0]; +$num[2] = $num[0]+$den; +$num[3] = 2*$den-$num[0]; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} +$valuesShow[3] = &input(Fraction(-$num[0],$den)); +$ans3Show = &output(Fraction(-$num[0],$den)); + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$valuesShow[0]"); +$ans[1] = Compute("$valuesShow[0]"); +$ans[2] = Compute("$valuesShow[3]"); +$ans[3] = Compute("$valuesShow[3]"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'bottom',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $valuesShow[3]",'red',$Alor,'top',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'bottom',large)); +$graph->lb(new Label($Bx,-$By,"C: $valuesShow[2]",'red',$Blor,'top',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $valuesShow[2] and D: $valuesShow[3] are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \sin^{-1} \left( \sin \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle, the [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOE`], or the length of [`AE`]) is simply [`\sin \left( [$values[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[0]] \right) \right) + &= \sin^{-1} \left( \text{length of }AE \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part b + + [`` \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) = \sin^{-1} \left( \text{length of }BF \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`BF`] and [`AE`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) + &= \sin^{-1} \left( \text{length of }BF \right) \\ + &= \sin^{-1} \left( \text{length of }AE \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part c + + [`` \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) = \sin^{-1} \left( \text{length of }CF \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`CF`] and [`DE`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) + &= \sin^{-1} \left( \text{length of }CF \right) \\ + &= \sin^{-1} \left( \text{length of }DE \right) \\ + &= [$ans3Show] + \end{aligned}``] + +###Part d + +First, recognize that [` [$values[3]] `] and [` [$ans3Show] `] are located on the same point on the Unit Circle, Point [`D`] in the figure above. + + [`` \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) = \sin^{-1} \left( \text{length of }DE \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) + &= \sin^{-1} \left( \text{length of }DE \right) \\ + &= [$ans3Show] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination30.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination30.pg new file mode 100644 index 0000000000..697b1de902 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination30.pg @@ -0,0 +1,264 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = -random(1,int($den/2),1); +} until gcd(abs($num[0]),$den)==1 && abs($num[0])/$den<0.5; + +$num[1] = -($den-abs($num[0])); +$num[2] = -(abs($num[0])+$den); +$num[3] = -(2*$den-abs($num[0])); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} +$valuesShow[3] = &input(Fraction(-$num[0],$den)); +$ans3Show = &output(Fraction(-$num[0],$den)); + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$valuesShow[0]"); +$ans[1] = Compute("$valuesShow[0]"); +$ans[2] = Compute("$valuesShow[3]"); +$ans[3] = Compute("$valuesShow[3]"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'top',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $valuesShow[3]",'red',$Alor,'bottom',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'top',large)); +$graph->lb(new Label($Bx,-$By,"C: $valuesShow[2]",'red',$Blor,'bottom',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $valuesShow[2] and D: $valuesShow[3] are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \sin^{-1} \left( \sin \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle, the [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOE`], or the length of [`AE`]) is simply [`\sin \left( [$values[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[0]] \right) \right) + &= \sin^{-1} \left( \text{length of }AE \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part b + + [`` \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) = \sin^{-1} \left( \text{length of }BF \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`BF`] and [`AE`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) + &= \sin^{-1} \left( \text{length of }BF \right) \\ + &= \sin^{-1} \left( \text{length of }AE \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part c + + [`` \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) = \sin^{-1} \left( \text{length of }CF \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`CF`] and [`DE`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) + &= \sin^{-1} \left( \text{length of }CF \right) \\ + &= \sin^{-1} \left( \text{length of }DE \right) \\ + &= [$ans3Show] + \end{aligned}``] + +###Part d + +First, recognize that [` [$values[3]] `] and [` [$ans3Show] `] are located on the same point on the Unit Circle, Point [`D`] in the figure above. + + [`` \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) = \sin^{-1} \left( \text{length of }DE \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) + &= \sin^{-1} \left( \text{length of }DE \right) \\ + &= [$ans3Show] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination35.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination35.pg new file mode 100644 index 0000000000..d1af850e36 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination35.pg @@ -0,0 +1,235 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@num = (); +for my $i (0..3) { + $num[$i] = random(int(10*(3*$i+1)*pi/6+0.5)/10, int(10*(3*$i+2)*pi/6+0.5)/10, 0.1); +} + +@ans = (); +$ans[0] = Compute("$num[0]"); +$ans[1] = Compute("pi-$num[1]"); +$ans[2] = Compute("pi-$num[2]"); +$ans[3] = Compute("$num[3]-2*pi"); + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]); + $Ay[$i] = $r*sin($num[$i]); + $Bx[$i] = $r*cos($ans[$i]); + $By[$i] = $r*sin($ans[$i]); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $num[$i]",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + if ( ($i==1) || ($i==2) ) { + $graph[$i] -> stamps( closed_circle( $Bx[$i], $By[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Bx[$i], 0, red ) ); + $Blor = ($Bx[$i]>0) ? "left" : "center"; + $Buod = ($By[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Bx[$i],$By[$i],"B",'red',$Blor,$Buod,large)); + $Dlor = ($Bx[$i]>0) ? "left" : "right"; + $Duod = ($By[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Bx[$i],0,"D",'red',$Dlor,$Duod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Bx[$i], $By[$i], red, 2); + $graph[$i]->lineTo($Bx[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Bx[$i]>0) ? -0.4 : 0.4; + $yShift = ($By[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Bx[$i], $yShift); + $graph[$i]->lineTo($Bx[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Bx[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] and point B (a refleciton of A by the y-axis) are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at D. BOD is a right triangle, with angle D being the right angle."; + } + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +############################################## + +BEGIN_PGML + +Evalute the following with your knowledge about the Unit Circle. All numbers are in radians. + +a) [`` \sin^{-1} \left( \sin \left( [$num[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \sin^{-1} \left( \sin \left( [$num[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \sin^{-1} \left( \sin \left( [$num[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \sin^{-1} \left( \sin \left( [$num[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +$ans2N = -$ans[2]; + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$num[0]]`] radians corresponds to point [`A`] on the Unit Circle, the [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOC`], or the length of [`AC`]) is simply [`\sin \left( [$num[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$num[0]] \right) \right) + &= \sin^{-1} \left( \text{length of }AC \right) \\ + &= [$num[0]] + \end{aligned}``] + +###Part b + +>>[@ $fig[1] @]*<< + + [`` \sin^{-1} \left( \sin \left( [$num[1]] \right) \right) = \sin^{-1} \left( \text{length of }AC \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`AC`] and [`BD`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$num[1]] \right) \right) + &= \sin^{-1} \left( \text{length of }AC \right) \\ + &= \sin^{-1} \left( \text{length of }BD \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }AF \\ + &= \text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA \\ + &= \pi - [$num[1]] + \end{aligned}``] + +###Part c + +>>[@ $fig[2] @]*<< + + [`` \sin^{-1} \left( \sin \left( [$num[2]] \right) \right) = \sin^{-1} \left( \text{length of }AC \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`AC`] and [`BD`] are equal, measure of arc [`EB`] is the answer to this part. We have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$num[2]] \right) \right) + &= \sin^{-1} \left( \text{length of }AC \right) \\ + &= \sin^{-1} \left( \text{length of }BD \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }FA \\ + &= \text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}\\ + &= [$num[2]] - \pi\\ + \end{aligned}``] + +Since Point B corresponds to a negative angle, the answer to this part is [`-([$num[2]] - \pi)=\pi-[$num[2]]`] radians. + +###Part d + +>>[@ $fig[3] @]*<< + + [`` \sin^{-1} \left( \sin \left( [$num[3]] \right) \right) = \sin^{-1} \left( \text{length of }AC \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], but [`[$num[3]]`] is not in this range, we have to go backward one round starting at Point A: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$num[3]] \right) \right) + &= \sin^{-1} \left( \text{length of }AC \right) \\ + &= [$num[3]]-2\pi + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination40.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination40.pg new file mode 100644 index 0000000000..3c582595c3 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination40.pg @@ -0,0 +1,254 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = random(1,int($den/2),1); +} until gcd($num[0],$den)==1 && $num[0]/$den<0.5; + +$num[1] = $den-$num[0]; +$num[2] = $num[0]+$den; +$num[3] = 2*$den-$num[0]; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$valuesShow[0]"); +$ans[1] = Compute("$valuesShow[1]"); +$ans[2] = Compute("$valuesShow[1]"); +$ans[3] = Compute("$valuesShow[0]"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'bottom',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $valuesShow[3]",'red',$Alor,'top',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'bottom',large)); +$graph->lb(new Label($Bx,-$By,"C: $valuesShow[2]",'red',$Blor,'top',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $valuesShow[2] and D: $valuesShow[3] are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \cos^{-1} \left( \cos \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \cos^{-1} \left( \cos \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle, the [`y`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOE`], or the length of [`OE`]) is simply [`\cos \left( [$values[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[0]] \right) \right) + &= \cos^{-1} \left( \text{length of }OE \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part b + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[1]] \right) \right) + &= \cos^{-1} \left( \text{length of }OF \right) \\ + &= [$values[1]] + \end{aligned}``] + +###Part c + + [`` \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) = \cos^{-1} \left( \text{length of }OF \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) + &= \cos^{-1} \left( \text{length of }OF \right) \\ + &= [$values[1]] + \end{aligned}``] + +###Part d + + [`` \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) = \cos^{-1} \left( \text{length of }OE \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) + &= \cos^{-1} \left( \text{length of }OE \right) \\ + &= [$values[0]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination50.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination50.pg new file mode 100644 index 0000000000..cf0a3474f7 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination50.pg @@ -0,0 +1,277 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = -random(1,int($den/2),1); +} until gcd(abs($num[0]),$den)==1 && abs($num[0])/$den<0.5; + +$num[1] = -($den-abs($num[0])); +$num[2] = -(abs($num[0])+$den); +$num[3] = -(2*$den-abs($num[0])); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} + +$ans0In = &input(Fraction(-$num[0],$den)); +$ans1In = &input(Fraction($den+$num[0],$den)); +$ans0Show = &output(Fraction(-$num[0],$den)); +$ans1Show = &output(Fraction($den+$num[0],$den)); + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$ans0In"); +$ans[1] = Compute("$ans1In"); +$ans[2] = Compute("$ans1In"); +$ans[3] = Compute("$ans0In"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'top',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $ans0In",'red',$Alor,'bottom',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'top',large)); +$graph->lb(new Label($Bx,-$By,"C: $ans1In",'red',$Blor,'bottom',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $ans1In and D: $ans0In are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \cos^{-1} \left( \cos \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \cos^{-1} \left( \cos \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle, the [`y`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOE`], or the length of [`OE`]) is simply [`\cos \left( [$values[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[0]] \right) \right) + &= \cos^{-1} \left( \text{length of }OE \right) \\ + \end{aligned}``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[0]] \right) \right) + &= \cos^{-1} \left( \text{length of }OE \right) \\ + &= [$ans0Show] + \end{aligned}``] + +###Part b + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[1]] \right) \right) + &= \cos^{-1} \left( \text{length of }OF \right) \\ + \end{aligned}``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[1]] \right) \right) + &= \cos^{-1} \left( \text{length of }OF \right) \\ + &= [$ans1Show] + \end{aligned}``] + +###Part c + +Recognize that [`[$values[2]]`] and [`[$ans1Show]`] are located at the same point, Point [`C`], on the Unit Circle. + + [`` \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) = \cos^{-1} \left( \text{length of }OF \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) + &= \cos^{-1} \left( \text{length of }OF \right) \\ + &= [$ans1Show] + \end{aligned}``] + +###Part d + +Recognize that [`[$values[3]]`] and [`[$ans0Show]`] are located at the same point, Point [`D`], on the Unit Circle. + + [`` \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) = \cos^{-1} \left( \text{length of }OE \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) + &= \cos^{-1} \left( \text{length of }OE \right) \\ + &= [$ans0Show] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination55.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination55.pg new file mode 100644 index 0000000000..7061e9c80a --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination55.pg @@ -0,0 +1,223 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@num = (); +for my $i (0..3) { + $num[$i] = random(int(10*(3*$i+1)*pi/6+0.5)/10, int(10*(3*$i+2)*pi/6+0.5)/10, 0.1); +} + +@ans = (); +$ans[0] = Compute("$num[0]"); +$ans[1] = Compute("$num[1]"); +$ans[2] = Compute("2*pi-$num[2]"); +$ans[3] = Compute("2*pi-$num[3]"); + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]); + $Ay[$i] = $r*sin($num[$i]); + $Bx[$i] = $r*cos($ans[$i]); + $By[$i] = $r*sin($ans[$i]); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $num[$i]",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Olor = ($Ax[$i]>0) ? 'right' : 'left'; + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + if ( ($i==2) || ($i==3) ) { + $graph[$i] -> stamps( closed_circle( $Bx[$i], $By[$i], red ) ); + $Blor = ($Bx[$i]>0) ? "left" : "center"; + $Buod = ($By[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Bx[$i],$By[$i],"B",'red',$Blor,$Buod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Bx[$i], $By[$i], red, 2); + $graph[$i]->lineTo($Bx[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Bx[$i]>0) ? -0.4 : 0.4; + $yShift = ($By[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Bx[$i], $yShift); + $graph[$i]->lineTo($Bx[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Bx[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] and point B (a refleciton of A by the x-axis) are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, also crossing the x-axis at C. BOC is a right triangle, with angle C being the right angle."; + } + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +############################################## + +BEGIN_PGML + +Evalute the following with your knowledge about the Unit Circle. All numbers are in radians. + +a) [`` \cos^{-1} \left( \cos \left( [$num[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \cos^{-1} \left( \cos \left( [$num[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \cos^{-1} \left( \cos \left( [$num[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \cos^{-1} \left( \cos \left( [$num[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$num[0]]`] radians corresponds to point [`A`] on the Unit Circle, the [`x`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOC`], or the length of [`AC`]) is simply [`\cos \left( [$num[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$num[0]] \right) \right) + &= \cos^{-1} \left( \text{length of }OC \right) \\ + &= [$num[0]] + \end{aligned}``] + +###Part b + +>>[@ $fig[1] @]*<< + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$num[1]] \right) \right) + &= \cos^{-1} \left( \text{length of }OC \right) \\ + &= [$num[1]] + \end{aligned}``] + +###Part c + +>>[@ $fig[2] @]*<< + + [`` \cos^{-1} \left( \cos \left( [$num[2]] \right) \right) = \cos^{-1} \left( \text{length of }OC \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], measure of minor arc [`EB`] is the answer to this part. We have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$num[2]] \right) \right) + &= \cos^{-1} \left( \text{length of }OC \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }EA \\ + &= \text{measure of major arc }EFE \text{ (one round)} - \text{measure of major arc }EFA \\ + &= 2\pi - [$num[2]] \\ + \end{aligned}``] + +###Part d + +>>[@ $fig[3] @]*<< + + [`` \cos^{-1} \left( \cos \left( [$num[3]] \right) \right) = \cos^{-1} \left( \text{length of }OC \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], measure of minor arc EB is the answer to this part. We have: + + [``\begin{aligned} + \cos^{-1} \left( \sin \left( \cos( [$num[3]] ) \right) \right) + &= \cos^{-1} \left( \text{length of }OC \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }EA \\ + &= \text{measure of major arc }EFE \text{ (one round)} - \text{measure of major arc }EFA \\ + &= 2\pi - [$num[3]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination60.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination60.pg new file mode 100644 index 0000000000..4d815de244 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination60.pg @@ -0,0 +1,269 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = random(1,int($den/2),1); +} until gcd($num[0],$den)==1 && $num[0]/$den<0.5; + +$num[1] = $den-$num[0]; +$num[2] = $num[0]+$den; +$num[3] = 2*$den-$num[0]; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} +$valuesShow[3] = &input(Fraction(-$num[0],$den)); +$ans2Show = &output(Fraction(-$num[0],$den)); + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$valuesShow[0]"); +$ans[1] = Compute("$valuesShow[3]"); +$ans[2] = Compute("$valuesShow[0]"); +$ans[3] = Compute("$valuesShow[3]"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'bottom',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $valuesShow[3]",'red',$Alor,'top',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'bottom',large)); +$graph->lb(new Label($Bx,-$By,"C: $valuesShow[2]",'red',$Blor,'top',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $valuesShow[2] and D: $valuesShow[3] are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \tan^{-1} \left( \tan \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle: + +* The [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOE`], or the length of [`AE`]) is simply [`\sin \left( [$values[0]] \right)`]. +* The [`x`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOE`], or the length of [`OE`]) is simply [`\cos \left( [$values[0]] \right)`]. +* [`\tan \left( [$values[0]] \right) = \frac{\sin \left( [$values[0]] \right)}{\cos \left( [$values[0]] \right)} = \frac{AE}{OE}`] + +###Part a + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[0]] \right) \right) + &= \tan^{-1} \left( \frac{AE}{OE} \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part b + + [`` \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) = \tan^{-1} \left( \frac{BF}{OF} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{BF}{OF}`] and [`\frac{DE}{OE}`] are equal, we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) + &= \tan^{-1} \left( \frac{BF}{OF} \right) \\ + &= \tan^{-1} \left( \frac{DE}{OE} \right) \\ + &= [$ans2Show] + \end{aligned}``] + +###Part c + + [`` \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) = \tan^{-1} \left( \frac{CF}{OF} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{CF}{OF}`] and [`\frac{AE}{OE}`] are equal, we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) + &= \tan^{-1} \left( \frac{CF}{OF} \right) \\ + &= \tan^{-1} \left( \frac{AE}{OE} \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part d + +First, recognize that [` [$values[3]] `] and [` [$ans2Show] `] are located on the same point on the Unit Circle, Point [`D`] in the figure above. + + [`` \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) = \tan^{-1} \left( \frac{DE}{OE} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) + &= \tan^{-1} \left( \frac{DE}{OE} \right) \\ + &= [$ans2Show] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination70.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination70.pg new file mode 100644 index 0000000000..9a55569ebd --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination70.pg @@ -0,0 +1,268 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = -random(1,int($den/2),1); +} until gcd(abs($num[0]),$den)==1 && abs($num[0])/$den<0.5; + +$num[1] = -($den-abs($num[0])); +$num[2] = -(abs($num[0])+$den); +$num[3] = -(2*$den-abs($num[0])); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} +$valuesShow[3] = &input(Fraction(-$num[0],$den)); +$ans3Show = &output(Fraction(-$num[0],$den)); + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$valuesShow[0]"); +$ans[1] = Compute("$valuesShow[3]"); +$ans[2] = Compute("$valuesShow[0]"); +$ans[3] = Compute("$valuesShow[3]"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'top',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $valuesShow[3]",'red',$Alor,'bottom',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'top',large)); +$graph->lb(new Label($Bx,-$By,"C: $valuesShow[2]",'red',$Blor,'bottom',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $valuesShow[2] and D: $valuesShow[3] are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \tan^{-1} \left( \tan \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle: + +* The [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOE`], or the length of [`AE`]) is simply [`\sin \left( [$values[0]] \right)`]. +* The [`x`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOE`], or the length of [`OE`]) is simply [`\cos \left( [$values[0]] \right)`]. +* [`\tan \left( [$values[0]] \right) = \frac{\sin \left( [$values[0]] \right)}{\cos \left( [$values[0]] \right)} = \frac{AE}{OE}`] + +###Part a + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[0]] \right) \right) + &= \tan^{-1} \left( \frac{AE}{OE} \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part b + + [`` \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) = \tan^{-1} \left( \frac{BF}{OF} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{BF}{OF}`] and [`\frac{DE}{OE}`] are equal, we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) + &= \tan^{-1} \left( \frac{BF}{OF} \right) \\ + &= \tan^{-1} \left( \frac{DE}{OE} \right) \\ + &= [$ans3Show] + \end{aligned}``] + +###Part c + + [`` \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) = \tan^{-1} \left( \frac{CF}{OF} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{CF}{OF}`] and [`\frac{AE}{OE}`] are equal, we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) + &= \tan^{-1} \left( \frac{CF}{OF} \right) \\ + &= \tan^{-1} \left( \frac{AE}{OE} \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part d + +First, recognize that [` [$values[3]] `] and [` [$ans3Show] `] are located on the same point on the Unit Circle, Point [`D`] in the figure above. + + [`` \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) = \tan^{-1} \left( \frac{DE}{OE} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) + &= \tan^{-1} \left( \frac{DE}{OE} \right) \\ + &= [$ans3Show] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination75.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination75.pg new file mode 100644 index 0000000000..3315161cf5 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination75.pg @@ -0,0 +1,240 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@num = (); +for my $i (0..3) { + $num[$i] = random(int(10*(3*$i+1)*pi/6+0.5)/10, int(10*(3*$i+2)*pi/6+0.5)/10, 0.1); +} + +@ans = (); +$ans[0] = Compute("$num[0]"); +$ans[1] = Compute("$num[1]-pi"); +$ans[2] = Compute("$num[2]-pi"); +$ans[3] = Compute("$num[3]-2*pi"); + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]); + $Ay[$i] = $r*sin($num[$i]); + $Bx[$i] = $r*cos($ans[$i]); + $By[$i] = $r*sin($ans[$i]); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $num[$i]",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Olor = ($Ax[$i]>0) ? 'left' : 'right'; + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + if ( ($i==1) || ($i==2) ) { + $graph[$i] -> stamps( closed_circle( $Bx[$i], $By[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Bx[$i], 0, red ) ); + $Blor = ($Bx[$i]>0) ? "left" : "center"; + $Buod = ($By[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Bx[$i],$By[$i],"B",'red',$Blor,$Buod,large)); + $Dlor = ($Bx[$i]>0) ? "left" : "right"; + $Duod = ($By[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Bx[$i],0,"D",'red',$Dlor,$Duod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Bx[$i], $By[$i], red, 2); + $graph[$i]->lineTo($Bx[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Bx[$i]>0) ? -0.4 : 0.4; + $yShift = ($By[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Bx[$i], $yShift); + $graph[$i]->lineTo($Bx[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Bx[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] and point B (a refleciton of A by the y-axis) are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at D. BOD is a right triangle, with angle D being the right angle."; + } + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +############################################## + +BEGIN_PGML + +Evalute the following with your knowledge about the Unit Circle. All numbers are in radians. + +a) [`` \tan^{-1} \left( \tan \left( [$num[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \tan^{-1} \left( \tan \left( [$num[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \tan^{-1} \left( \tan \left( [$num[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \tan^{-1} \left( \tan \left( [$num[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +$ans2N = -$ans[2]; + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle: + +* The [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOC`], or the length of [`AC`]) is simply [`\sin \left( [$num[0]] \right)`]. +* The [`x`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOC`], or the length of [`OC`]) is simply [`\cos \left( [$num[0]] \right)`]. +* [`\tan \left( [$num[0]] \right) = \frac{\sin \left( [$num[0]] \right)}{\cos \left( [$num[0]] \right)} = \frac{AC}{OC}`] + +###Part a + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$num[0]] \right) \right) + &= \tan^{-1} \left( \frac{CA}{CO} \right) \\ + &= [$num[0]] + \end{aligned}``] + +###Part b + +>>[@ $fig[1] @]*<< + + [`` \tan^{-1} \left( \tan \left( [$num[1]] \right) \right) = \tan^{-1} \left( \frac{CA}{CO} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{CA}{CO}`] and [`\frac{DB}{DB}`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$num[1]] \right) \right) + &= \sin^{-1} \left( \frac{CA}{CO} \right) \\ + &= \sin^{-1} \left( \frac{DB}{DB} \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }AF \\ + &= \text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA \\ + &= \pi - [$num[1]] + \end{aligned}``] + +Since Point B corresponds to a negative angle, the answer to this part is [`-(\pi - [$num[1]])=[$num[1]]-\pi`] radians. + +###Part c + +>>[@ $fig[2] @]*<< + + [`` \tan^{-1} \left( \tan \left( [$num[2]] \right) \right) = \tan^{-1} \left( \frac{CA}{CO} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{CA}{CO}`] and [`\frac{DB}{DB}`] are equal, we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$num[2]] \right) \right) + &= \tan^{-1} \left( \frac{CA}{CO} \right) \\ + &= \tan^{-1} \left( \frac{DB}{DB} \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }FA \\ + &= \text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}\\ + &= [$num[2]] - \pi\\ + \end{aligned}``] + +###Part d + +>>[@ $fig[3] @]*<< + + [`` \tan^{-1} \left( \tan \left( [$num[3]] \right) \right) = \tan^{-1} \left( \frac{CA}{CO} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], but [`[$num[3]]`] is not in this range, we have to go backward one round starting at Point A: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$num[3]] \right) \right) + &= \tan^{-1} \left( \frac{CA}{CO} \right) \\ + &= [$num[3]]-2\pi + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination80.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination80.pg new file mode 100644 index 0000000000..e865a72ecd --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination80.pg @@ -0,0 +1,193 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 4; + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@DataTable( + [ + [ + [PF('[`\cos\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +$absBase = abs($base); +$absHeight = abs($height); + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `], either in Quadrant I or Quadrant IV. + +Since [`[$ans[0]]<0`], the angle [`\sin^{-1}\left( [$ans[0]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$absBase]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination81.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination81.pg new file mode 100644 index 0000000000..9ad2c74b79 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination81.pg @@ -0,0 +1,276 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $heightOut = -random(1,5,1); + $heightIn = list_random(1,2,3,5); + $hypotenuseOut = random(int(abs($heightOut)*$heightIn**2)+2,int(abs($heightOut)*$heightIn**2)+10,1); + } until (gcd($heightOut,$hypotenuseOut)==1); + $hypotenuseIn = 1; + ($baseOut,$baseIn) = &radSimplify($hypotenuseOut**2-$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && !(($baseOut>0) && ($heightOut>0)) && ($baseIn<=30); + + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + if ($baseIn==1) { + $base = $baseOut; + $absBase = abs($baseOut); + } elsif (abs($baseOut)==1) { + $base = ($baseOut>0) ? Formula("sqrt($baseIn)") : Formula("-sqrt($baseIn)"); + $absBase = Formula("sqrt($baseIn)"); + } else { + $base = Formula("$baseOut*sqrt($baseIn)"); + $absBaseOut = abs($baseOut); + $absBase = Formula("$absBaseOut*sqrt($baseIn)"); + } + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + $hypotenuse = $hypotenuseOut; + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\cos\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `], either in Quadrant I or Quadrant IV. + +Since [`[$ans[0]]<0`], the angle [`\sin^{-1}\left( [$ans[0]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$base]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination90.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination90.pg new file mode 100644 index 0000000000..c3c76e0dd2 --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination90.pg @@ -0,0 +1,193 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 2; + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\tan\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +$absBase = abs($base); +$absHeight = abs($height); + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `], either in Quadrant I or Quadrant II. + +Since [`[$ans[1]]<0`], the angle [`\cos^{-1}\left( [$ans[1]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$absHeight]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination91.pg b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination91.pg new file mode 100644 index 0000000000..ad46ab396c --- /dev/null +++ b/Contrib/PCC/Trigonometry/InverseTrig/TrigInverseCombination91.pg @@ -0,0 +1,278 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "PCCmacros.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $heightOut = random(1,5,1); + $heightIn = list_random(1,2,3,5); + $hypotenuseOut = random(int(abs($heightOut)*$heightIn**2)+2,int(abs($heightOut)*$heightIn**2)+10,1); + } until (gcd($heightOut,$hypotenuseOut)==1); + $hypotenuseIn = 1; + ($baseOut,$baseIn) = &radSimplify($hypotenuseOut**2-$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && ($baseIn<=30); + + $baseOut = -$baseOut; + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + if ($baseIn==1) { + $base = $baseOut; + $absBase = abs($baseOut); + } elsif (abs($baseOut)==1) { + $base = ($baseOut>0) ? Formula("sqrt($baseIn)") : Formula("-sqrt($baseIn)"); + $absBase = Formula("sqrt($baseIn)"); + } else { + $base = Formula("$baseOut*sqrt($baseIn)"); + $absBaseOut = abs($baseOut); + $absBase = Formula("$absBaseOut*sqrt($baseIn)"); + } + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + $hypotenuse = $hypotenuseOut; + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin \left( \cos^{-1}\left( [$ans[1]] \right) \right)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc \left( \cos^{-1}\left( [$ans[1]] \right) \right)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\tan \left( \cos^{-1}\left( [$ans[1]] \right) \right)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot \left( \cos^{-1}\left( [$ans[1]] \right) \right)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\cos^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `], either in Quadrant I or Quadrant II. + +Since [`[$ans[1]]<0`], the angle [`\cos^{-1}\left( [$ans[1]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$absHeight]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosines10.pg b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosines10.pg new file mode 100644 index 0000000000..7831ac00a6 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosines10.pg @@ -0,0 +1,145 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(31, 50, 1); +$c = random(10, 30 ,1); +$a = random(40, 50, 1); +$b2 = $a**2+$c**2-2*$a*$c*cos($B*pi/180); +$b = sqrt($b2); +$cosA = ($b**2+$c**2-$a**2)/(2*$b*$c); +$A = arccos( $cosA )*180/pi; +$C = 180-$A-$B; +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0],"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as b; the right side is marked as c; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +In this triangle, if [`m\angle B=[$B]^{\circ}`], [`c=[$c]`] units and [`a=[$a]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`b = `][____________]{$b} units + + [`m\angle A= `][____________]{$A} degrees + + [`m\angle C= `][____________]{$C} degrees + + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +First, use Law of Cosines to calculate the length of [`b`]: + + [``\begin{aligned}[t] + b^2 &= a^2+c^2-2ac\cos(B) \\ + b &= \sqrt{a^2+c^2-2ac\cos(B)} \\ + b &= \sqrt{[$a]^2+[$c]^2-2([$a])([$c])\cos([$B]^{\circ})} \\ + b &\approx [$b] + \end{aligned}``] + +Next, we could use Law of Cosines or Law of Sines to calculate the measure of [`\angle A`]. To avoid considering two possible solutions when we use [`\sin^{-1}(x)`], it's always better to use Law of Cosines when we have a choice. + +So, we will use Law of Cosines again to calculate the measure of [`\angle A`]: + + [``\begin{aligned}[t] + a^2 &= b^2+c^2-2bc\cos(A) \\ + \cos(A) &= \frac{b^2+c^2-a^2}{2bc} \\ + m\angle A &= \cos^{-1}\left( \frac{b^2+c^2-a^2}{2bc} \right) \\ + m\angle A &= \cos^{-1}\left( \frac{[$b]^2+[$c]^2-[$a]^2}{2([$b])([$c])} \right)\\ + m\angle A &\approx [$A]^{\circ} \\ + \end{aligned}``] + +Finally, calculate [`m\angle C`]: + + [``\begin{aligned}[t] + m\angle C &= 180^{\circ} - m\angle A - m\angle B \\ + &= 180^{\circ} - [$A]^{\circ} - [$B]^{\circ} \\ + & =[$C]^{\circ} + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosines20.pg b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosines20.pg new file mode 100644 index 0000000000..28deaa9551 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosines20.pg @@ -0,0 +1,146 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(31, 50, 1); +$c = random(10, 30 ,1); +$a = random(40, 50, 1); +$b2 = $a**2+$c**2-2*$a*$c*cos($B*pi/180); +$b = int(sqrt($b2)); +$A = arccos( ($b**2+$c**2-$a**2)/(2*$b*$c) )*180/pi; +$B = arccos( ($a**2+$c**2-$b**2)/(2*$a*$c) )*180/pi; +$C = 180-$A-$B; +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0],"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as b; the right side is marked as c; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +In this triangle, if [`a=[$a]`], [`b=[$b]`] and [`c=[$c]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A = `][____________]{$A} degrees + + [`m\angle B= `][____________]{$B} degrees + + [`m\angle C= `][____________]{$C} degrees + + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +First, we will use Law of Cosines again to calculate the measure of [`\angle B`]: + + [``\begin{aligned}[t] + b^2 &= a^2+c^2-2ac\cos(B) \\ + \cos(B) &= \frac{a^2+c^2-b^2}{2ac} \\ + m\angle B &= \cos^{-1}\left( \frac{a^2+c^2-b^2}{2ac} \right) \\ + m\angle B &= \cos^{-1}\left( \frac{[$a]^2+[$c]^2-[$b]^2}{2([$a])([$c])} \right)\\ + m\angle B &\approx [$B]^{\circ} \\ + \end{aligned}``] + +Next, we could use Law of Cosines or Law of Sines to calculate the measure of [`\angle A`]. To avoid considering two possible solutions when we use [`\sin^{-1}(x)`], it's always better to use Law of Cosines when we have a choice. + +So, we will use Law of Cosines again to calculate the measure of [`\angle A`]: + + [``\begin{aligned}[t] + a^2 &= b^2+c^2-2bc\cos(A) \\ + \cos(A) &= \frac{b^2+c^2-a^2}{2bc} \\ + m\angle A &= \cos^{-1}\left( \frac{b^2+c^2-a^2}{2bc} \right) \\ + m\angle A &= \cos^{-1}\left( \frac{[$b]^2+[$c]^2-[$a]^2}{2([$b])([$c])} \right)\\ + m\angle A &\approx [$A]^{\circ} \\ + \end{aligned}``] + +Finally, we can calculate [`m\angle C`]: + + [``\begin{aligned}[t] + m\angle C &= 180^{\circ} - m\angle A - m\angle B \\ + &= 180^{\circ} - [$A]^{\circ} - [$B]^{\circ} \\ + & =[$C]^{\circ} + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosines30.pg b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosines30.pg new file mode 100644 index 0000000000..8d638ab12c --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosines30.pg @@ -0,0 +1,134 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(31, 50, 1); +$c = random(10, 30 ,1); +$a = random(40, 50, 1); +$b2 = $a**2+$c**2-2*$a*$c*cos($B*pi/180); +$b = int(sqrt($b2)); +$A = arccos( ($b**2+$c**2-$a**2)/(2*$b*$c) )*180/pi; +$B = arccos( ($a**2+$c**2-$b**2)/(2*$a*$c) )*180/pi; +$C = 180-$A-$B; +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0],"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as b; the right side is marked as c; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C."; + +$ans = Compute("DNE"); +$c = random(10,30,1); +$b = random(10,30,1); +$a = random($c+$b+1,$c+$b+10,1); + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +In this triangle, if [`a=[$a]`], [`b=[$b]`] and [`c=[$c]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A = `][____________]{$ans} degrees + + [`m\angle B= `][____________]{$ans} degrees + + [`m\angle C= `][____________]{$ans} degrees + + +END_PGML + +############################################## + +$s1 = ($a**2+$c**2-$b**2)/(2*$a*$c); + +BEGIN_PGML_SOLUTION + +We will use Law of Cosines again to calculate the measure of [`\angle B`]: + + [``\begin{aligned}[t] + b^2 &= a^2+c^2-2ac\cos(B) \\ + \cos(B) &= \frac{a^2+c^2-b^2}{2ac} \\ + m\angle B &= \cos^{-1}\left( \frac{a^2+c^2-b^2}{2ac} \right) \\ + m\angle B &= \cos^{-1}\left( \frac{[$a]^2+[$c]^2-[$b]^2}{2([$a])([$c])} \right)\\ + m\angle B &= \cos^{-1}([$s1]) + \end{aligned}``] + +Since [`[$s1]`] is not in the domain of [`y=\cos^{-1}(x)`], there is no solution for [`m\angle B`]. This triangle has no solution. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication10.pg b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication10.pg new file mode 100644 index 0000000000..6a99ff58a1 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication10.pg @@ -0,0 +1,140 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(30, 40, 1); +$c = random(10, 30 ,1); +$a = random(40, 50, 1); +$b2 = $a**2+$c**2-2*$a*$c*cos($B*pi/180); +$b = int(sqrt($b2)); +$A = arccos( ($b**2+$c**2-$a**2)/(2*$b*$c) )*180/pi; +$B = arccos( ($a**2+$c**2-$b**2)/(2*$a*$c) )*180/pi; +$C = 180-$A-$B; +$h = $c*sin($B*pi/180); + +$be = sqrt( $a**2+($b/2)**2-$a*$b*cos($C*pi/180) ); +$bd = 2*$be; + +$long = $a + $c*cos($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $long*240/210; +$ymin = 0; +$ymax = (210*$h/$long+30)*$h/(210*$h/$long); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx, Dx +@x = (($xmax-$long)/2+$c*cos($B*pi/180), ($xmax-$long)/2, ($xmax-$long)/2+$a, ($xmax+$long)/2); +# Ay, By, Cy, Dy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2, ($ymax+$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( $x[0], $y[0],"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1], $y[1],"B",'black','right','top','large')); +$picture->lb( new Label( $x[2], $y[2],"C",'black','left','top','large')); +$picture->lb( new Label( $x[3], $y[3],"D",'black','left','bottom','large')); +$picture->lb( new Label( ($x[0]+$x[2])/2, ($y[0]+$y[2])/2,"E",'black','center','bottom','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[3],$y[3], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); + +$picture->moveTo($x[1],$y[1]); +$picture->lineTo($x[3],$y[3], darkblue,3); + +$text = "This is a parallelogram ABCD, with A on top left, B on bottom left, C on bottom right, and D on top right. A is to the right of B, and D is to the right of C. Diagonals AC and BD intersects at E."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A parallelogram has sides of length [`[$a]`] units and [`[$c]`] units. The shorter diagonal is [`[$b]`] units. Find the measure of the longer diagonal. + +The longer diagonal's length is [____________]{$bd} units. + +END_PGML + +############################################## + +$ce = 0.5*$b; + +BEGIN_PGML_SOLUTION + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +By the given conditions, [`AB=[$c], BC=[$a], AC=[$b]`]. + +In [`\Delta ABC`], we can use Law of Cosines to calculate the measure of [`\angle ACB`]: + + [``\begin{aligned}[t] + AB^2 &= AC^2+BC^2-2\cdot AC \cdot BC \cdot \cos(\angle ACB) \\ + \cos(\angle ACB) &= \frac{AC^2+BC^2-AB^2}{2\cdot AC \cdot BC} \\ + m\angle ACB &= \cos^{-1}\left( \frac{AC^2+BC^2-AB^2}{2\cdot AC \cdot BC} \right) \\ + m\angle ACB &= \cos^{-1}\left( \frac{[$b]^2+[$a]^2-[$c]^2}{2([$b])([$a])} \right)\\ + m\angle ACB &\approx [$C]^{\circ} \\ + \end{aligned}``] + +In a parallelogram, its diagonals bisect each other. This implies [`CE=\frac{1}{2}CA=\frac{1}{2}([$b])=[$ce]`]. + +Next, in [`\Delta CEB`], we will use Law of Cosines again to calculate the length of [`BE`]: + + [``\begin{aligned}[t] + BE^2 &= BC^2+CE^2-2\cdot BC\cdot CE\cdot \cos(\angle ACB) \\ + BE &= \sqrt{ BC^2+CE^2-2\cdot BC\cdot CE\cdot \cos(\angle ACB) } \\ + BE &= \sqrt{ [$a]^2+[$ce]^2-2\cdot [$a]\cdot [$ce]\cdot \cos([$C]^{\circ}) } \\ + BE &\approx [$be] + \end{aligned}``] + +Finally, [`BD = 2BE = 2([$be]) = [$bd]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication20.pg b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication20.pg new file mode 100644 index 0000000000..874a973561 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication20.pg @@ -0,0 +1,129 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@x = (); @y = (); +$n = list_random(3,4,5,6,8,9,10); +$r = 1; +$shift = $r/20; + +for my $i (0..1) { + $picture[$i] = init_graph(-$r*1.2,-$r*1.2,$r*1.2,$r*1.2,pixels=>[300,300]); + $picture[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..$n-1) { + $x[$j] = $r*cos($j*2*pi/$n); + $y[$j] = $r*sin($j*2*pi/$n); + $picture[$i]->stamps( closed_circle($x[$j],$y[$j],blue) ); + } + $picture[$i]->moveTo($x[0],$y[0]); + for my $j (1..$n-1) { + $picture[$i]->lineTo($x[$j],$y[$j], blue,3); + } + $picture[$i]->lineTo($x[0],$y[0], blue,3); +} + +$picture[1]->moveTo($x[0],$y[0]); +$picture[1]->lineTo(0,0, blue,3); +$picture[1]->lineTo($x[1],$y[1], blue,3); +$picture[1]->lineTo($x[0],$y[0], blue,3); + +$picture[1]->lb( new Label(0-$shift,0,"O",'blue','right','middle','large')); +$picture[1]->lb( new Label($x[0]+$shift,$y[0],"A",'blue','left','middle','large')); +if ($n==3) { + $picture[1]->lb( new Label($x[1]-$shift,$y[1]+$shift,"B",'blue','left','middle','large')); +} else { + $picture[1]->lb( new Label($x[1]+$shift,$y[1]+$shift,"B",'blue','left','middle','large')); +} + +$text[0] = "This is a circle with an inscribed regular polygon ($n sides)."; +$text[1] = "This is a circle with an inscribed regular polygon ($n sides). A triangle is formed by two adjacent vertices (A and B) and the center of the circle (O)."; + +$theta = 360/$n; +$radius = random(2,10,1); +$side = sqrt(2*$radius**2-2*$radius**2*cos($theta*pi/180)); +$perimeter = $side*$n; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +If the radius of this circle is [`[$radius]`] units, find the perimeter of the regular polygon ([`[$n]`] sides) inscribed inside the circle. + +Perimeter = [_____________]{$perimeter} units + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +Connect two adjacent vertices and the circle's center, forming a triangle. + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +By the given conditions, [`OA=OB=[$radius], m\angle O=\frac{360^{\circ}}{[$n]}=[$theta]^{\circ}`]. + +In [`\Delta OAB`], we can use Law of Cosines to calculate the length of [`AB`]: + + [``\begin{aligned}[t] + AB^2 &= OA^2+OB^2-2\cdot OA\cdot OB\cdot \cos(\angle O) \\ + AB &= \sqrt{ OA^2+OB^2-2\cdot OA\cdot OB\cdot \cos(\angle O) } \\ + AB &= \sqrt{ [$radius]^2+[$radius]^2-2\cdot [$radius]\cdot [$radius]\cdot \cos([$theta]^{\circ}) } \\ + AB &\approx [$side] + \end{aligned}``] + +Finally, the perimeter of the polygon is [`[$n]([$side]) = [$perimeter]`] units. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication30.pg b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication30.pg new file mode 100644 index 0000000000..b46f012665 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication30.pg @@ -0,0 +1,127 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + +do { + $A = random(50, 130, 1); +} until $A!=90; +do { + $c = random(100, 300, 1); + $b = random(100, 300, 1); +} until abs($b-$c)>20; + +$a = sqrt($b**2+$c**2-2*$b*$c*cos($A*pi/180)); +$B = arccos( ($a**2+$c**2-$b**2)/(2*$a*$c) )*180/pi; +$C = 180-$A-$B; +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +} until ( abs($x[0]-$x[1])>$xmax/10 && abs($x[0]-$x[2])>$xmax/10 ); + +for my $i (0..0) { +$picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"---- lake ----",'black','center','top','large')); +$picture[$i]->lb( new Label(($x[0]+$x[2])/2, ($y[0]+$y[1])/2,"$b m",'black','left','bottom','large')); +$picture[$i]->lb( new Label(($x[0]+$x[1])/2,($y[0]+$y[1])/2,"$c m",'black','right','bottom','large')); + +$picture[$i]->lb( new Label( $x[0], $y[0],"A",'black','center','bottom','large')); +$picture[$i]->lb( new Label( $x[0], $y[0]-4*$yLabelShift,"$A",'black','center','top','large')); +$picture[$i]->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture[$i]->new_color("darkblue", 100,100,255); + +$picture[$i]->moveTo($x[1],$y[1]); +$picture[$i]->lineTo($x[0],$y[0], darkblue,3); +$picture[$i]->lineTo($x[2],$y[2], darkblue,3); + +} + +$text[0] = "This is a triangle with one side parallel to the ground; this side is marked as the lake; the left side is marked as $b m; the right side is marked as $c m; the top angle is marked as A, which is $A degrees; the left side angle is marked as B; the right side angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +A surveyor stands at Point A, and is trying to measure of width of a lake. Point B and Point C are two ends of the lake. The distance from the surveyor to B is [`[$c]`] meters, and from the surveyor to C is [`[$b]`] meters. The measure of [`\angle A`] is [`[$A]^{\circ}`]. Calculate the width of the lake. + +The width of the lake is [____________]{$a} meters. + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use Law of Cosines to calculate the length of [`BC`]: + + [``\begin{aligned}[t] + BC^2 &= AB^2+AC^2-2(AB)(AC)\cos(A) \\ + BC &= \sqrt{AB^2+AC^2-2(AB)(AC)\cos(A)} \\ + BC &= \sqrt{[$c]^2+[$b]^2-2([$c])([$b])\cos([$A]^{\circ})} \\ + BC &\approx [$a] + \end{aligned}``] + +The width of the lake is [`[$a]`] meters. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication40.pg b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication40.pg new file mode 100644 index 0000000000..e6a7d608cc --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication40.pg @@ -0,0 +1,151 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$A2 = random(30,70,1); +$D = random(100,170,1); +$B = $A2 + 180 - $D; +$c = random(30,100,1); +$a = random(30,100,1); +$b = sqrt( $a**2+$c**2-2*$a*$c*cos($B*pi/180) ); +$A = arccos( ($b**2+$c**2-$a**2)/(2*$b*$c) )*180/pi; +$direction = $A+$A2; + +$Ax = 0; +$Ay = 0; +$Bx = $c*cos($A2*pi/180); +$By = $c*sin($A2*pi/180); +$Cx = $Bx - $a*cos( (180-$D)*pi/180 ); +$Cy = $By + $a*sin( (180-$D)*pi/180 ); + +$cushion = 10; + +$xmin = min($Cx, $Ax)-$cushion; #The viewing window +$xmax = $Bx+$cushion; +$ymin = -$cushion; +$ymax = $Cy+$cushion; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240],axes=>[0,0]); + $picture[$i]->lb('reset'); + + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->arrowTo($Bx,$By,blue,2); + $picture[$i]->arrowTo($Cx,$Cy,blue,2); + $picture[$i]->lineTo($Ax,$Ay,blue,1,dashed); + + $picture[$i]->moveTo(0.5*$Bx,$By); + $picture[$i]->lineTo(1.5*$Bx,$By,blue,1,dashed); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','top','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','right','bottom','large')); + $picture[$i]->lb( new Label(0.5*$Bx,$By,"D",'blue','right','middle','large')); + $picture[$i]->lb( new Label($Bx,$Ay,"E",'blue','center','top','large')); + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"$A2",'blue','left','bottom','large')); + $picture[$i]->lb( new Label($Bx,$By,"$D",'blue','left','bottom','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"$c mi",'blue','left','top','large')); + $picture[$i]->lb( new Label(($Bx+$Cx)/2,($By+$Cy)/2,"$a mi",'blue','left','bottom','large')); +} + + +$text[0] = "A coordinate system is centered at A. A ray goes from A to B (to the right of A), where the angle between AB and the x-axis is $A degrees. The length of AB is $c miles. There is a ray from B to C, where BC and the positive horizontal direction forms an angle of $D degrees. The length of BC is $a miles. A and C are also connected."; + + + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +An airplane flies [`[$c]`] miles with a heading of [`[$A2]^{\circ}`], and then flies [`[$a]`] miles with a heading of [`[$D]^{\circ}`]. How far is the plane from its starting point, and at what heading? + +Hint: For a heading degree, the east (positive x-axis direction) is considered 0 degree. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +The plane is [______________]{$b} miles from the starting point. + +The plane's heading in terms of its starting point is [___________]{$direction} degrees. + +END_PGML + +############################################## + +$B2 = 180-$D; + +BEGIN_PGML_SOLUTION + +In the figure, by Alternative Interior Angle Theorem, [`m\angle DBA = m\angle BAE = [$A2]^{\circ}`]. + +From B to C, the heading is [`[$D]^{\circ}`], so [` m\angle DBC = 180^{\circ} - [$D]^{\circ} = [$B2]^{\circ} `]. + +In [`\Delta ABC`], [` m\angle CBA = m\angle DBC + m\angle DBA = [$A2]^{\circ}+[$B2]^{\circ} = [$B]^{\circ} `]. + +In [`\Delta OAB`], we can use Law of Cosines to calculate the length of [`AC`]: + + [``\begin{aligned}[t] + AC^2 &= BA^2+BC^2-2\cdot BA\cdot BC\cdot \cos(\angle CBA) \\ + AC &= \sqrt{ BA^2+BC^2-2\cdot BA\cdot BC\cdot \cos(\angle CBA) } \\ + AC &= \sqrt{ [$c]^2+[$a]^2-2\cdot [$c]\cdot [$a]\cdot \cos([$B]^{\circ}) } \\ + AC &\approx [$b] + \end{aligned}``] + +The plane is [`[$b]`] miles from the starting point. + +Next, in [`\Delta ABC`], we use Law of Cosines again to calculate the measure of [`\angle CAB`]: + + [``\begin{aligned}[t] + BC^2 &= AB^2+AC^2-2\cdot AB \cdot AC \cdot \cos(\angle CAB) \\ + \cos(\angle CAB) &= \frac{AB^2+AC^2-BC^2}{2\cdot AB \cdot AC} \\ + m\angle CAB &= \cos^{-1}\left( \frac{AB^2+AC^2-BC^2}{2\cdot AB \cdot AC} \right) \\ + m\angle CAB &= \cos^{-1}\left( \frac{[$c]^2+[$b]^2-[$a]^2}{2([$c])([$b])} \right)\\ + m\angle CAB &\approx [$A]^{\circ} \\ + \end{aligned}``] + +The plane's heading in terms of its starting point is [` m\angle CAB + m\angle BAE = [$A]^{\circ}+[$A2]^{\circ} = [$direction]^{\circ} `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication50.pg b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication50.pg new file mode 100644 index 0000000000..882e2c5cb9 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication50.pg @@ -0,0 +1,148 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$cushion = 20; +$DAx = 100; + +$c = random(100,300,5); +$D = random(15,35,1); +$A = 90-$D; +$b = random(100,300,5); +$a = sqrt( $b**2+$c**2-2*$b*$c*cos($A*pi/180) ); + +$Dx = 0; +$Dy = 0; +$Ax = $DAx; +$Ay = $DAx*tan($D*pi/180); +$Bx = $Ax; +$By = $Ay+$c; +$Cx = $Ax + $b*cos($D*pi/180); +$Cy = $Ay + $b*sin($D*pi/180); +$Fx = $Cx+$DAx; +$Fy = $Cy+$DAx*tan($D*pi/180); + + +$xmin = -$cushion; #The viewing window +$xmax = $Fx+$cushion; +$ymin = -$cushion; +$ymax = $By+$cushion; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + + $picture[$i]->moveTo($Dx,$Dy); + $picture[$i]->lineTo($Fx,$Fy,blue,2); + $picture[$i]->lineTo($Fx,$Dy,blue,2); + $picture[$i]->lineTo($Dx,$Dy,blue,2); + + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,2); + $picture[$i]->lineTo($Cx,$Cy,blue,2); + + $picture[$i]->lb( new Label(($Cx+$Bx)/2,($By+$Cy)/2,"guy wire",'blue','left','bottom','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"$c ft",'blue','right','top','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,($Ay+$Cy)/2,"$b ft",'blue','center','bottom','large')); + $picture[$i]->lb( new Label($Dx+$xShift,$Dy,"$D",'blue','left','bottom','large')); +} + +$picture[1]->lb( new Label($Ax,$Ay,"A",'blue','left','top','large')); +$picture[1]->lb( new Label($Bx,$By,"B",'blue','right','middle','large')); +$picture[1]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); +$picture[1]->lb( new Label($Dx,$Dy,"D",'blue','right','middle','large')); + +$picture[1]->moveTo($Ax,$Ay); +$picture[1]->lineTo($Ax,$Dy,blue,1,dashed); +$picture[1]->lb( new Label($Ax,$Dy,"E",'blue','center','top','large')); +$xShift = $DAx/10; +$yShift = $xShift/$xmax*$ymax; +$picture[1]->moveTo($Ax,$Dy+$yShift); +$picture[1]->lineTo($Ax-$xShift,$Dy+$yShift,blue,3); +$picture[1]->lineTo($Ax-$xShift,$Dy,blue,3); + +$text[0] = "A line segment, representing the hill, is inclined $D degrees to the horizontal. A vertical segment, representing the tower, is on the hill, marked as $c ft. The tip of the segment is connected to a point on the hill, marked as guy wire. The distance from the bottom of the segment to the guy wire is marked as $b ft."; + +$text[1] = "A line segment, representing the hill, is inclined $D degrees to the horizontal. The line segment starts at D. A vertical segment AB, representing the tower, is on the hill, marked as $c ft. Point A is the lower end of the segment. The tip of the segment, B, is connected to a point on the hill, C. This segment is marked as guy wire. The distance from the bottom of the segment to the guy wire, segment AC, is marked as $b ft. The tower BA is extended by a dotted segment downward until it reaches the horizontal of Point D. This extension ends at Point E."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A [`[$c]`]-foot tower, pointing straight up, is located on a hill that is inclined [`[$D]^{\circ}`] to the horizontal, as shown in the figure. A guywire is to be attached to the top of the tower and anchored at a point [`[$b]`] feet uphill from the base of the tower. Find the length of wire needed. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +The length of the wire is [______________]{$a} feet. + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +Add in variables to the figure, and extend BA to E. + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +In [`\Delta ADE`], we can see [` m\angle DAE = 90^{\circ} - [$D]^{\circ} = [$A]^{\circ} `]. + +By Vertical Angle Theorem, [`m\angle BAC = m\angle DAE = [$A]^{\circ}`]. + +In [`\Delta ABC`], we can use Law of Cosines to calculate the length of [`BC`]: + + [``\begin{aligned}[t] + BC^2 &= AC^2+AB^2-2\cdot AC\cdot AB\cdot \cos(\angle BAC) \\ + BC &= \sqrt{ AC^2+AB^2-2\cdot AC\cdot AB\cdot \cos(\angle BAC) } \\ + BC &= \sqrt{ [$b]^2+[$c]^2-2\cdot [$b]\cdot [$c]\cdot \cos([$A]^{\circ}) } \\ + BC &\approx [$a] + \end{aligned}``] + +The length of the wire is [`[$a]`] feet. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines10.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines10.pg new file mode 100644 index 0000000000..a3530b2d0e --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines10.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(31, 50, 1); +$C = random(10, 30, 1); +$A = 180-$B-$C; +$a = random(10, 30, 1); +$b = $a*sin($B*pi/180)/sin($A*pi/180); +$c = $a*sin($C*pi/180)/sin($A*pi/180); +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as b; the right side is marked as c; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +In this triangle, if [`m\angle B=[$B]^{\circ}`], [`m\angle C=[$C]^{\circ}`] and [`a=[$a]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A= `][____________]{$A} degrees + + [`b = `][____________]{$b} units + + [`c = `][____________]{$c} units + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +First, calculate [`m\angle A`]: + + [``\begin{aligned}[t] + m\angle A &= 180^{\circ} - m\angle B - m\angle C \\ + &= 180^{\circ} - [$B]^{\circ} - [$C]^{\circ} \\ + & =[$A]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`b`]: + + [``\begin{aligned}[t] + \frac{\sin(A)}{a} &= \frac{\sin(B)}{b} \\ + b\sin(A) &= a\sin(B) \\ + b &= \frac{a\sin(B)}{\sin(A)} \\ + b &= \frac{[$a]\sin([$B]^{\circ})}{\sin([$A]^{\circ})} \\ + b &= [$b] + \end{aligned}``] + +And, use Law of Sines to calculate the length of [`c`]: + + [``\begin{aligned}[t] + \frac{\sin(A)}{a} &= \frac{\sin(C)}{c} \\ + c\sin(A) &= a\sin(C) \\ + c &= \frac{a\sin(C)}{\sin(A)} \\ + c &= \frac{[$a]\sin([$C]^{\circ})}{\sin([$A]^{\circ})} \\ + c &= [$c] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines20.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines20.pg new file mode 100644 index 0000000000..572a1e881a --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines20.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$b = random(10, 30, 1); +$B = random(10, 30, 1); +$A = random(100, 140, 1); +$C = 180-$B-$A; +$a = $b*sin($A*pi/180)/sin($B*pi/180); +$c = $b*sin($C*pi/180)/sin($B*pi/180); +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as b; the right side is marked as c; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +In this triangle, if [`m\angle A=[$A]^{\circ}`], [`m\angle B=[$B]^{\circ}`] and [`b=[$b]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle C= `][____________]{$C} degrees + + [`a = `][____________]{$a} units + + [`c = `][____________]{$c} units + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +First, calculate [`m\angle C`]: + + [``\begin{aligned}[t] + m\angle C &= 180^{\circ} - m\angle A - m\angle B \\ + &= 180^{\circ} - [$A]^{\circ} - [$B]^{\circ} \\ + & =[$C]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`a`]: + + [``\begin{aligned}[t] + \frac{\sin(A)}{a} &= \frac{\sin(B)}{b} \\ + a\sin(B) &= b\sin(A) \\ + a &= \frac{b\sin(A)}{\sin(B)} \\ + a &= \frac{[$b]\sin([$A]^{\circ})}{\sin([$B]^{\circ})} \\ + a &= [$a] + \end{aligned}``] + +And, use Law of Sines to calculate the length of [`c`]: + + [``\begin{aligned}[t] + \frac{\sin(B)}{b} &= \frac{\sin(C)}{c} \\ + c\sin(B) &= b\sin(C) \\ + c &= \frac{b\sin(C)}{\sin(B)} \\ + c &= \frac{[$b]\sin([$C]^{\circ})}{\sin([$B]^{\circ})} \\ + c &= [$c] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines30.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines30.pg new file mode 100644 index 0000000000..f219a6407e --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines30.pg @@ -0,0 +1,243 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@A = (); @B = (); @C = (); +@a = (); @b = (); @c = (); @h = (); + +$c[0] = random(10, 30, 1); +$B[0] = random(20, 50, 1); +$h[0] = $c[0]*sin($B[0]*pi/180); + +for my $i (1..3) { + $c[$i] = $c[0]; + $B[$i] = $B[0]; + $h[$i] = $h[0]; +} + +#right triangle +$b[0] = "$c[0]\cdot \sin($B[0])"; +$a[0] = $c[0]*cos($B[0]*pi/180); +$C[0] = 90; +$A[0] = 90-$B[0]; + +#2 triangles +do { + $b[2] = random(int(($h[2]+$c[2])/2)-2, int(($h[2]+$c[2])/2)+2, 1); +} until $b[2]<$c[2] && $b[2]>$h[2]; +$C[2] = arcsin($c[2]*sin($B[2]*pi/180)/$b[2])*180/pi; +$A[2] = 180 - $B[2] - $C[2]; +$a[2] = $b[2]*sin($A[2]*pi/180)/sin($B[2]*pi/180); + +#1 triangle +$b[3] = random($c[3]+5, $c[3]+10, 1); +$C[3] = arcsin($c[3]*sin($B[3]*pi/180)/$b[3])*180/pi; +$A[3] = 180 - $B[3] - $C[3]; +$a[3] = $b[3]*sin($A[3]*pi/180)/sin($B[3]*pi/180); + +#no triangle +$b[1] = random(int($h[1]/2), int($h[1])-1, 1); +$a[1] = $a[3]; +$C[1] = $C[3]; +$A[1] = $A[3]; + +@xmin = ();@xmax = (); @ymin = (); @ymax = (); + +for my $i (0..3) { + $xmin[$i] = 0; #The viewing window + $xmax[$i] = $a[$i]*240/210; + $ymin[$i] = 0; + $ymax[$i] = (210*$h[$i]/$a[$i]+30)*$h[$i]/(210*$h[$i]/$a[$i]); +} + +$xLabelShift = $xmax[0]/240*5; +$yLabelShift = $ymax[0]/210*5; + +# Ax, Bx, Cx +@x = ( +[($xmax[0]-$a[0])/2+$c[3]*cos($B[0]*pi/180), ($xmax[0]-$a[0])/2, ($xmax[0]+$a[0])/2], +[($xmax[1]-$a[1])/2+$c[3]*cos($B[1]*pi/180), ($xmax[1]-$a[1])/2, ($xmax[1]+$a[1])/2], +[($xmax[2]-$a[2])/2+$c[3]*cos($B[2]*pi/180), ($xmax[2]-$a[2])/2, ($xmax[2]+$a[2])/2], +[($xmax[3]-$a[3])/2+$c[3]*cos($B[3]*pi/180), ($xmax[3]-$a[3])/2, ($xmax[3]+$a[3])/2], +); +# Ay, By, Cy +@y = ( +[($ymax[0]+$h[0])/2, ($ymax[0]-$h[0])/2, ($ymax[0]-$h[0])/2], +[($ymax[1]+$h[1])/2, ($ymax[1]-$h[1])/2, ($ymax[1]-$h[1])/2], +[($ymax[2]+$h[2])/2, ($ymax[2]-$h[2])/2, ($ymax[2]-$h[2])/2], +[($ymax[3]+$h[3])/2, ($ymax[3]-$h[3])/2, ($ymax[3]-$h[3])/2], +); + +@picture = (); + +for my $i (0..3) { + $picture[$i] = init_graph($xmin[$i],$ymin[$i],$xmax[$i],$ymax[$i], + pixels=>[240,240*$ymax[$i]/$xmax[$i]]); + + $picture[$i]->new_color("darkblue", 100,100,255); + + $picture[$i]->lb( new Label( $x[$i][0], $y[$i][0],"A",'black','center','bottom','large')); + $picture[$i]->lb( new Label( $x[$i][1]-$xLabelShift, $y[$i][1],"B",'black','right','middle','large')); + $picture[$i]->lb( new Label(($x[$i][0]+$x[$i][1])/2-$xLabelShift,($y[$i][0]+$y[$i][1])/2,"c",'black','right','bottom','large')); + + $picture[$i]->moveTo($x[$i][0],$y[$i][0]); + $picture[$i]->lineTo($x[$i][1],$y[$i][1], darkblue,3); + if ($i==0) { + $picture[$i]->lineTo($x[$i][0],$y[$i][1], darkblue,3); + } else { + $picture[$i]->lineTo($x[$i][2],$y[$i][2], darkblue,3); + } + if ($i!=1) { + $picture[$i]->lineTo($x[$i][0],$y[$i][0], darkblue,3); + } else { + $picture[$i]->moveTo($x[$i][0],$y[$i][0]); + $picture[$i]->lineTo($x[$i][0],$y[$i][0]-$b[$i], darkblue,3); + } + + if ($i==0) { + $picture[$i]->lb( new Label($x[$i][0]+$xLabelShift, ($y[$i][0]+$y[$i][1])/2,"h",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[$i][0]+$xLabelShift, $y[$i][2],"C",'black','left','top','large')); + $picture[$i]->lb( new Label( ($x[$i][1]+$x[$i][2])/2, $y[$i][1],"a",'black','center','top','large')); + } elsif ($i==1) { + $picture[$i]->lb( new Label( ($x[$i][1]+$x[$i][2])/2, $y[$i][1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label( $x[$i][0]+$xLabelShift, $y[$i][0]-0.5*$b[$i],"b",'black','left','middle','large')); + } else { + $picture[$i]->lb( new Label( ($x[$i][1]+$x[$i][2])/2, $y[$i][1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label(($x[$i][0]+$x[$i][2])/2+$xLabelShift, ($y[$i][0]+$y[$i][1])/2,"b",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[$i][2]+$xLabelShift, $y[$i][2],"C",'black','left','middle','large')); + } +} + +$picture[2]->moveTo($x[2][0],$y[2][0]); +$picture[2]->lineTo($x[2][2]-2*$b[2]*cos($C[2]*pi/180),$y[2][2], darkblue,3,'dashed'); +$picture[2]->lb( new Label($x[2][0]-0.5*$b[2]*cos($C[2]*pi/180)+5*$xLabelShift, ($y[2][0]+$y[2][1])/2,"b",'black','left','bottom','large')); + +$xShift = $xmax[$i]/100; +$yShift = $xShift*210/240; +$picture[0]->moveTo($x[0][0],$y[0][2]+5*$yShift); +$picture[0]->lineTo($x[0][0]-3*$xShift,$y[0][2]+5*$yShift, darkblue,3); +$picture[0]->lineTo($x[0][0]-3*$xShift,$y[0][2], darkblue,3); + +@text = (); + +$text[3] = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c; the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C. Angle B and Angle C are acute angles, and Angle A is an obtuse angle."; + +$text[2] = $text[3]." A dotted line starts at A and ends at a point on side a. This dashed line is also marked as b, and its length is equal to length of b."; + +$text[0] = "This is a right triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as h; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C (the right angle). Angle A and Angle B are acute angles, and Angle C is a right angle."; + +$test[1] = "This is an open shape very close to a triangle. One side is parallel to the ground, this side is marked as a. A point on top is marked as A. Point A is connected to the left end of side a, where the point is marked as B. Angle B is acute. Opposite to B is a side b, not long enough to touch side a."; + +@solutions = (1,0,2,1); +@perm = NchooseK(4,4); +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $solutions[$perm[$i]] }; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +In this triangle, [`m\angle B=[$B[0]]^{\circ}`] and [`c=[$c[0]]`] units. Match up each given value of [`b`] with the number of possible triangles. + +If [`b=[$b[$perm[0]]]`], there is/are [_____]{$ans[0]} possible triangle(s). + +If [`b=[$b[$perm[1]]]`], there is/are [_____]{$ans[1]} possible triangle(s). + +If [`b=[$b[$perm[2]]]`], there is/are [_____]{$ans[2]} possible triangle(s). + +If [`b=[$b[$perm[3]]]`], there is/are [_____]{$ans[3]} possible triangle(s). + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +###Determining the number of possible triangles + +To determine how many possible triangles would satisfy the given conditions, we sketch a right triangle and calculate the height [`h`]: + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + + [``\begin{aligned}[t] + \sin(B) &= \frac{h}{c} \\ + h &= c\cdot\sin(B) \\ + h &= [$c[0]]\cdot\sin([$B[0]]^{\circ}) \\ + h &\approx [$h[0]] + \end{aligned}``] + +Depending on the value of [`b`], there are 4 possible situations. + +###Situation 1: [`b=h`] + +If [`b=h`], side [`b`] can barely touch side [`a`]. In this situation, there is one possible right triangle solution, as shown in the graph above. + +If [`b=h=[$b[0]]`], there is [`1`] possible triangle. + +###Situation 2: [`b>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +If [`b=[$b[1]]`], there is [`0`] possible triangle. + +###Situation 3: [`h>[@ image(insertGraph( $picture[2] ), width=>240, extra_html_tags => "alt = '$text[2]' title = '$text[2]' ") @]*<< + +If [`b=[$b[2]]`], there are [`2`] possible triangles. + +###Situation 4: [`b \ge c`] + +If [`b \ge c`], side [`b`] can touch side [`a`] at onely one place. In this situation, there is one possible triangle solution, as shown in the following graph: + +>>[@ image(insertGraph( $picture[3] ), width=>240, extra_html_tags => "alt = '$text[3]' title = '$text[3]' ") @]*<< + +If [`b=[$b[3]]`], there is [`1`] possible triangle. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines40.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines40.pg new file mode 100644 index 0000000000..c55a3a6372 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines40.pg @@ -0,0 +1,138 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $B = random(20,70,1); + $c = random(20,40,1); + $h = $c*sin($B*pi/180); +} until ($h>10); +$b = random(5,int($h)-1,1); +$a = $c*cos($B*pi/180); +$A = 90-$B; +$C = 90; + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/200; +$yLabelShift = $ymax/200; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$a, ($xmax-$a)/2, ($xmax-$a)/2+$a); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+2*$xLabelShift, ($y[0]+$y[1])/2,"h",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$xShift = $xmax/200; +$yShift = $xShift*210/240; +$picture->moveTo($x[0],$y[2]+10*$yShift); +$picture->lineTo($x[0]-10*$xShift,$y[2]+10*$yShift, darkblue,3); +$picture->lineTo($x[0]-10*$xShift,$y[2], darkblue,3); + +$text = "This is a right triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C (the right angle). Angle A and Angle B are acute angles, and Angle C is a right angle."; + +$A = Compute("DNE"); +$C = Compute("DNE"); +$a = Compute("DNE"); + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +In this triangle, if [`m\angle B=[$B]^{\circ}`], [`c=[$c]`] units and [`b=[$b]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A= `][____________]{$A} degrees + + [`m\angle C= `][____________]{$C} degrees + + [`a = `][____________]{$a} units + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To determine how many possible triangles would satisfy the given conditions, we sketch a right triangle and calculate the height [`h`]: + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + + [``\begin{aligned}[t] + \sin(B) &= \frac{h}{c} \\ + h &= c\cdot\sin(B) \\ + h &= [$c]\cdot\sin([$B]^{\circ}) \\ + h &= [$h] + \end{aligned}``] + +Since [`h>b`] [`([$h]>[$b])`], there is no triangle which can satisfy the given conditions. In other words, the length of [`b`] is not long enough to reach side [`a`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines50.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines50.pg new file mode 100644 index 0000000000..866f8f2549 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines50.pg @@ -0,0 +1,152 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(20,70,1); +$c = random(20,40,1); +$h = $c*sin($B*pi/180); +$b = $h; +$a = $c*cos($B*pi/180); +$A = 90-$B; +$C = 90; + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/200; +$yLabelShift = $ymax/200; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$a, ($xmax-$a)/2, ($xmax-$a)/2+$a); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+2*$xLabelShift, ($y[0]+$y[1])/2,"h",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$xShift = $xmax/200; +$yShift = $xShift*210/240; +$picture->moveTo($x[0],$y[2]+10*$yShift); +$picture->lineTo($x[0]-10*$xShift,$y[2]+10*$yShift, darkblue,3); +$picture->lineTo($x[0]-10*$xShift,$y[2], darkblue,3); + +$text = "This is a right triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C (the right angle). Angle A and Angle B are acute angles, and Angle C is a right angle."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +In this triangle, if [`m\angle B=[$B]^{\circ}`], [`c=[$c]`] units and [`b=[$c]\cdot \sin{[$B]^{\circ}}`] units, solve for this triangle. + +Note that the length of [`b`] was not changed to decimals to keep the value more accurate. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A= `][____________]{$A} degrees + + [`m\angle C= `][____________]{$C} degrees + + [`a = `][____________]{$a} units + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To determine how many possible triangles would satisfy the given conditions, we sketch a right triangle and calculate the height [`h`]: + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + + [``\begin{aligned}[t] + \sin(B) &= \frac{h}{c} \\ + h &= c\cdot\sin(B) \\ + h &= [$c]\cdot\sin([$B]^{\circ}) + \end{aligned}``] + +Since [`h=b`], there is one triangle which can satisfy the given conditions. In other words, the length of [`b`] barely touches side [`a`], creating a right triangle. + +Since [`m\angle C = 90^{\circ}`], we can calculate the measure of [`\angle A`] by: + + [``\begin{aligned}[t] + m\angle A &= 180^{\circ} - m\angle C - m\angle B \\ + m\angle A &= 180^{\circ} - 90^{\circ} - [$B]^{\circ} \\ + m\angle A &= [$A]^{\circ} \\ + \end{aligned}``] + +Next, we can calculate the side [`a`] by: + + [``\begin{aligned}[t] + \cos(B) &= \frac{a}{c} \\ + a &= c\cdot\cos(B) \\ + a &= [$c]\cdot\cos([$B]^{\circ}) \\ + a &= [$a] \\ + \end{aligned}``] + +To summarize: [` m\angle A = [$A]^{\circ}, m\angle C = 90^{\circ}, a=[$a] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines60.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines60.pg new file mode 100644 index 0000000000..8820861841 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines60.pg @@ -0,0 +1,149 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(20,70,1); +$c = random(20,40,1); +$h = $c*sin($B*pi/180); +$b = random($c+5,$c+20,1); +$C = arcsin($c*sin($B*pi/180)/$b)*180/pi; +$A = 180-$B-$C; +$a = $b*sin($A*pi/180)/sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/200; +$yLabelShift = $ymax/200; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+2*$xLabelShift, ($y[0]+$y[1])/2,"h",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as b; the top obtuse angle is marked as A; the left side acute angle is marked as B; the right side acute angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +In this triangle, if [`m\angle B=[$B]^{\circ}`], [`c=[$c]`] units and [`b=[$b]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A= `][____________]{$A} degrees + + [`m\angle C= `][____________]{$C} degrees + + [`a = `][____________]{$a} units + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since [`b>c`], there is one possible triangle satisfying the given conditions. + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +First, calculate [`m\angle C`]: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(B)}{b} \\ + b\sin(C) &= c\sin(B) \\ + \sin(C) &= \frac{c\sin(B)}{b} \\ + C &= \sin^{-1}\left( \frac{c\sin(B)}{b} \right) \\ + C &= \sin^{-1}\left( \frac{[$c]\sin([$B]^{\circ})}{[$b]} \right) \\ + C &= [$C]^{\circ} + \end{aligned}``] + +Next, we can calculate [`m\angle A`]: + + [``\begin{aligned}[t] + m\angle A &= 180^{\circ} - m\angle B - m\angle C \\ + &= 180^{\circ} - [$B]^{\circ} - [$C]^{\circ} \\ + & =[$A]^{\circ} + \end{aligned}``] + +Finally, we can calculate the side [`a`] by: + + [``\begin{aligned}[t] + \frac{\sin(A)}{a} &= \frac{\sin(B)}{b} \\ + a\sin(B) &= b\sin(A) \\ + a &= \frac{b\sin(A)}{\sin(B)} \\ + a &= \frac{[$b]\sin([$A]^{\circ})}{\sin([$B]^{\circ})} \\ + a &= [$a] + \end{aligned}``] + +To summarize: [` m\angle A = [$A]^{\circ}, m\angle C = [$C]^{\circ}, a=[$a] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines70.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines70.pg new file mode 100644 index 0000000000..9601b109e2 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines70.pg @@ -0,0 +1,310 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@A = (); @B = (); @C = (); +@a = (); @b = (); @c = (); + +do { + do { + $c[0] = random(10, 30, 1); + $c[1] = $c[0]; + $B[0] = random(20, 40, 1); + $B[1] = $B[0]; + $h[0] = $c[0]*sin($B[0]*pi/180); + $h[1] = $h[0]; + $b[0] = random( ($h[0]+$c[0])/2-5, ($h[0]+$c[0])/2+5, 1); + $b[1] = $b[0]; + } until ($c[0]*sin($B[0]*pi/180)/$b[0] < 1); + + $C[0] = arcsin($c[0]*sin($B[0]*pi/180)/$b[0])*180/pi; + $C[1] = 180-$C[0]; + $A[0] = 180-$B[0]-$C[0]; + $A[1] = 180-$B[1]-$C[1]; + $a[0] = $b[0]*sin($A[0]*pi/180)/sin($B[0]*pi/180); + $a[1] = $b[1]*sin($A[1]*pi/180)/sin($B[1]*pi/180); +} until ($a[1]>5); + +$xmin = 0; #The viewing window +$xmax = $a[0]*240/210; +$ymin = 0; +$ymax = (210*$h[0]/$a[0]+30)*$h[0]/(210*$h[0]/$a[0]); + +$xLabelShift = $xmax/240*3; +$yLabelShift = $ymax/210*3; + +# Ax, Bx, Cx +@x = (($xmax-$a[0])/2+$c[0]*cos($B[0]*pi/180), ($xmax-$a[0])/2, ($xmax+$a[0])/2); +# Ay, By, Cy +@y = (($ymax+$h[0])/2, ($ymax-$h[0])/2, ($ymax-$h[0])/2); + +@picture = (); + +for my $i (0..2) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + + $picture[$i]->new_color("darkblue", 100,100,255); + + $picture[$i]->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); + $picture[$i]->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + + $picture[$i]->moveTo($x[0],$y[0]); + $picture[$i]->lineTo($x[1],$y[1], darkblue,3); + if ($i==0) { + $picture[$i]->lineTo($x[2],$y[2], darkblue,3); + } elsif ($i==1) { + $picture[$i]->lineTo($x[2]-2*$b[0]*cos($C[0]*pi/180),$y[2], darkblue,3); + } else { + $picture[$i]->lineTo($x[1]+$c[0]*cos($B[0]*pi/180),$y[2], darkblue,3); + } + $picture[$i]->lineTo($x[0],$y[0], darkblue,3); + + if ($i==0) { + $picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + } elsif ($i==1) { + $picture[$i]->lb( new Label( ($x[1]+$x[2]-2*$b[0]*cos($C[0]*pi/180))/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label(($x[0]+$x[2]-2*$b[0]*cos($C[0]*pi/180))/2+3*$xLabelShift, ($y[0]+$y[1])/2-5*$yLabelShift,"b",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[2]-2*$b[0]*cos($C[0]*pi/180)+$xLabelShift, $y[2],"C",'black','left','top','large')); + } else { + $picture[$i]->lb( new Label( ($x[1]+$x[2]-$b[0]*cos($C[0]*pi/180))/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label($x[0]+$xLabelShift, ($y[0]+$y[1])/2,"h",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[0]+$xLabelShift, $y[2],"C",'black','left','top','large')); + } +} + +$xShift = $xmax/100; +$yShift = $xShift*210/240; +$picture[2]->moveTo($x[0],$y[2]+5*$yShift); +$picture[2]->lineTo($x[0]-3*$xShift,$y[2]+5*$yShift, darkblue,3); +$picture[2]->lineTo($x[0]-3*$xShift,$y[2], darkblue,3); + +@text = (); + +$text[0] = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c; the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C. Angle B and Angle C are acute angles, and Angle A is an obtuse angle."; + +$text[1] = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c; the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C. Angle A and Angle B are acute angles, and Angle C is an obtuse angle."; + +$text[2] = "This is a right triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as h; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C (the right angle). Angle A and Angle B are acute angles, and Angle C is a right angle."; + + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +In this triangle, if [`m\angle B=[$B[0]]^{\circ}`], [`c=[$c[0]]`] units and [`b=[$b[0]]`] units, solve for this triangle. + +There are two possible triangles. + +[@DataTable( + [ + [[PF('if [`\angle C`] is acute'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 1px solid; ',], + [PF('if [`\angle C`] is obtuse'),], + ], + [[PF('[`m\angle C_1= `][____________]{$C[0]} degrees'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ',], + [PF('[`m\angle C_2= `][____________]{$C[1]} degrees'),], + ], + [[PF('[`m\angle A_1= `][____________]{$A[0]} degrees'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ',], + [PF('[`m\angle A_2= `][____________]{$A[1]} degrees'),], + ], + [[PF('[`a_1=`][____________]{$a[0]} units'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ',], + [PF('[`a_2=`][____________]{$a[1]} units'),], + ], + ], + align => 'c|c', + columnscss => + [' ', + ' ',], +);@]* + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +###Determining the number of possible triangles + +To determine how many possible triangles would satisfy the given conditions, we sketch a right triangle and calculate the height [`h`]: + +>>[@ image(insertGraph( $picture[2] ), width=>240, extra_html_tags => "alt = '$text[2]' title = '$text[2]' ") @]*<< + + [``\begin{aligned}[t] + \sin(B) &= \frac{h}{c} \\ + h &= c\cdot\sin(B) \\ + h &= [$c[0]]\cdot\sin([$B[0]]^{\circ}) \\ + h &= [$h[0]] + \end{aligned}``] + +Since [`h>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +We can calculate [`m\angle A_1`]: + + [``\begin{aligned}[t] + m\angle A_1 &= 180^{\circ} - m\angle B - m\angle C_1 \\ + &= 180^{\circ} - [$B[0]]^{\circ} - [$C[0]]^{\circ} \\ + & =[$A[0]]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`a`]: + + [``\begin{aligned}[t] + \frac{\sin(A_1)}{a_1} &= \frac{\sin(B)}{b} \\ + a_1\sin(B) &= b\sin(A_1) \\ + a_1 &= \frac{b\sin(A_1)}{\sin(B)} \\ + a_1 &= \frac{[$b[0]]\sin([$A[0]]^{\circ})}{\sin([$B[0]]^{\circ})} \\ + a_1 &= [$a[0]] + \end{aligned}``] + +In this triangle, + +[@DataTable( + [ + [[PF('[`a_1=[$a[0]]`]'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 1px solid; ',], + [PF('[`m\angle A_1= [$A[0]]^{\circ}`]'),], + ], + [[PF('[`b=[$b[0]]`]'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ',], + [PF('[`m\angle B= [$B[0]]^{\circ}`]'),], + ], + [[PF('[`c=[$c[0]]`]'),], + [PF('[`m\angle C_1= [$C[0]]^{\circ}`]'),], + ], + ], + align => 'c|c', + columnscss => + [' ', + ' ',], +);@]* + +###Solution 2: + +Assume [`C_2 = [$C[1]]^{\circ}`] (obtuse angle), the triangle looks like this: + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +We can calculate [`m\angle A_2`]: + + [``\begin{aligned}[t] + m\angle A_2 &= 180^{\circ} - m\angle B - m\angle C_2 \\ + &= 180^{\circ} - [$B[1]]^{\circ} - [$C[1]]^{\circ} \\ + & =[$A[1]]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`a`]: + + [``\begin{aligned}[t] + \frac{\sin(A_2)}{a_2} &= \frac{\sin(B)}{b} \\ + a_2\sin(B) &= b\sin(A_2) \\ + a_2 &= \frac{b\sin(A_2)}{\sin(B)} \\ + a_2 &= \frac{[$b[1]]\sin([$A[1]]^{\circ})}{\sin([$B[1]]^{\circ})} \\ + a_2 &= [$a[1]] + \end{aligned}``] + +In this triangle, + +[@DataTable( + [ + [[PF('[`a_2=[$a[1]]`]'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 1px solid; ',], + [PF('[`m\angle A_2= [$A[1]]^{\circ}`]'),], + ], + [[PF('[`b=[$b[1]]`]'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ',], + [PF('[`m\angle B= [$B[1]]^{\circ}`]'),], + ], + [[PF('[`c=[$c[1]]`]'),], + [PF('[`m\angle C_2= [$C[1]]^{\circ}`]'),], + ], + ], + align => 'c|c', + columnscss => + [' ', + ' ',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines80.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines80.pg new file mode 100644 index 0000000000..114a55c83a --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSines80.pg @@ -0,0 +1,198 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@A = (); @B = (); @C = (); +@a = (); @b = (); @c = (); + +do { + do { + $c[0] = random(10, 30, 1); + $c[1] = $c[0]; + $B[0] = random(20, 40, 1); + $B[1] = $B[0]; + $h[0] = $c[0]*sin($B[0]*pi/180); + $h[1] = $h[0]; + $b[0] = random( ($h[0]+$c[0])/2-5, ($h[0]+$c[0])/2+5, 1); + $b[1] = $b[0]; + } until ($c[0]*sin($B[0]*pi/180)/$b[0] < 1); + + $C[0] = arcsin($c[0]*sin($B[0]*pi/180)/$b[0])*180/pi; + $C[1] = 180-$C[0]; + $A[0] = 180-$B[0]-$C[0]; + $A[1] = 180-$B[1]-$C[1]; + $a[0] = $b[0]*sin($A[0]*pi/180)/sin($B[0]*pi/180); + $a[1] = $b[1]*sin($A[1]*pi/180)/sin($B[1]*pi/180); +} until ($a[1]>5); + + +$xmin = 0; #The viewing window +$xmax = $a[0]*240/210; +$ymin = 0; +$ymax = (210*$h[0]/$a[0]+30)*$h[0]/(210*$h[0]/$a[0]); + +$xLabelShift = $xmax/240*3; +$yLabelShift = $ymax/210*3; + +# Ax, Bx, Cx +@x = (($xmax-$a[0])/2+$c[0]*cos($B[0]*pi/180), ($xmax-$a[0])/2, ($xmax+$a[0])/2); +# Ay, By, Cy +@y = (($ymax+$h[0])/2, ($ymax-$h[0])/2, ($ymax-$h[0])/2); + +@picture = (); + +for my $i (0..2) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + + $picture[$i]->new_color("darkblue", 100,100,255); + + $picture[$i]->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); + $picture[$i]->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + + $picture[$i]->moveTo($x[0],$y[0]); + $picture[$i]->lineTo($x[1],$y[1], darkblue,3); + if ($i==0) { + $picture[$i]->lineTo($x[2],$y[2], darkblue,3); + } elsif ($i==1) { + $picture[$i]->lineTo($x[2]-2*$b[0]*cos($C[0]*pi/180),$y[2], darkblue,3); + } else { + $picture[$i]->lineTo($x[1]+$c[0]*cos($B[0]*pi/180),$y[2], darkblue,3); + } + $picture[$i]->lineTo($x[0],$y[0], darkblue,3); + + if ($i==0) { + $picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + } elsif ($i==1) { + $picture[$i]->lb( new Label( ($x[1]+$x[2]-2*$b[0]*cos($C[0]*pi/180))/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label(($x[0]+$x[2]-2*$b[0]*cos($C[0]*pi/180))/2+3*$xLabelShift, ($y[0]+$y[1])/2-5*$yLabelShift,"b",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[2]-2*$b[0]*cos($C[0]*pi/180)+$xLabelShift, $y[2],"C",'black','left','top','large')); + } else { + $picture[$i]->lb( new Label( ($x[1]+$x[2]-$b[0]*cos($C[0]*pi/180))/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label($x[0]+$xLabelShift, ($y[0]+$y[1])/2,"h",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[0]+$xLabelShift, $y[2],"C",'black','left','top','large')); + } +} + +$xShift = $xmax/100; +$yShift = $xShift*210/240; +$picture[2]->moveTo($x[0],$y[2]+5*$yShift); +$picture[2]->lineTo($x[0]-3*$xShift,$y[2]+5*$yShift, darkblue,3); +$picture[2]->lineTo($x[0]-3*$xShift,$y[2], darkblue,3); + +@text = (); + +$text[0] = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c; the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C. Angle B and Angle C are acute angles, and Angle A is an obtuse angle."; + +$text[1] = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c; the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C. Angle A and Angle B are acute angles, and Angle C is an obtuse angle."; + +$text[2] = "This is a right triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as h; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C (the right angle). Angle A and Angle B are acute angles, and Angle C is a right angle."; + + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +In this triangle, if [`m\angle B=[$B[0]]^{\circ}`], [`c=[$c[0]]`] units, [`b=[$b[0]]`] units, and [`\angle C`] is an *obtuse* triangle, solve for this triangle. + +[`m\angle C= `][____________]{$C[1]} degrees + +[`m\angle A= `][____________]{$A[1]} degrees + +[`a=`][____________]{$a[1]} units + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +First, calculate [`m\angle C`] with Law of Sines: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(B)}{b} \\ + b\sin(C) &= c\sin(B) \\ + \sin(C) &= \frac{c\sin(B)}{b} \\ + C &= \sin^{-1}\left( \frac{c\sin(B)}{b} \right) \\ + C &= \sin^{-1}\left( \frac{[$c[0]]\sin([$B[0]]^{\circ})}{[$b[0]]} \right) \\ + C &= [$C[0]]^{\circ} + \end{aligned}``] + +Each time we use the function [`\sin^{-1}(x)`], we must assume there is a second possible solution equal to [`180-\sin^{-1}(x)`]. In this problem, [`C_1 = [$C[0]]`] is the first possible solution, and [`C_2 = 180-[$C[0]]^{\circ} = [$C[1]]^{\circ}`] is the second possible solution. + +Since it's given that [`\angle C`] is an obtuse triangle, we choose [`C = [$C[1]]^{\circ}`]. + +Next, we calculate [`m\angle A`]: + + [``\begin{aligned}[t] + m\angle A &= 180^{\circ} - m\angle B - m\angle C \\ + &= 180^{\circ} - [$B[1]]^{\circ} - [$C[1]]^{\circ} \\ + & =[$A[1]]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`a`]: + + [``\begin{aligned}[t] + \frac{\sin(A)}{a} &= \frac{\sin(B)}{b} \\ + a\sin(B) &= b\sin(A) \\ + a &= \frac{b\sin(A)}{\sin(B)} \\ + a &= \frac{[$b[1]]\sin([$A[1]]^{\circ})}{\sin([$B[1]]^{\circ})} \\ + a &= [$a[1]] + \end{aligned}``] + +In this triangle, + +[`m\angle C= [$C[1]]^{\circ}`] + +[`m\angle A= [$A[1]]^{\circ}`] + +[`a=[$a[1]]`] units + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication10.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication10.pg new file mode 100644 index 0000000000..8c678017c6 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication10.pg @@ -0,0 +1,155 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $B = random(31, 70, 1); + $C = random(31, 70, 1); +} until abs($B-$C)>10; +$A = 180-$B-$C; +$a = random(50, 100, 1); +$b = $a*sin($B*pi/180)/sin($A*pi/180); +$c = $a*sin($C*pi/180)/sin($A*pi/180); +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +for my $i (0..1) { +$picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"$a miles",'black','center','top','large')); +if ($i==1) { + $picture[$i]->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"y",'black','left','bottom','large')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"x",'black','right','bottom','large')); + $picture[$i]->lb( new Label( $x[0], $y[0],"C (boat)",'black','center','bottom','large')); +} else { + $picture[$i]->lb( new Label( $x[0], $y[0],"boat",'black','center','bottom','large')); +} + +$picture[$i]->lb( new Label( $x[1]-$xLabelShift, $y[1],"A",'black','right','middle','large')); +$picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2],"B",'black','left','middle','large')); + +$picture[$i]->new_color("darkblue", 100,100,255); + +$picture[$i]->moveTo($x[0],$y[0]); +$picture[$i]->lineTo($x[1],$y[1], darkblue,3); +$picture[$i]->lineTo($x[2],$y[2], darkblue,3); +$picture[$i]->lineTo($x[0],$y[0], darkblue,3); + +} + +$text[0] = "This is a triangle with one side parallel to the ground; this side is marked as $a miles; the top point is marked as boat. The left endpoint is marked as A, and right endpoint is marked as B."; + +$text[1] = "This is a triangle with one side parallel to the ground; this side is marked as $a miles; the top point is marked as C (boat); The left endpoint is marked as A, and right endpoint is marked as B. The left side is marked as x; the right side is marked as y."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +To determine how far a boat is from shore, two radar stations [`[$a]`] miles apart find the angles out to the boat, as shown in the figure. Determine the distance of the boat from Station A and Station B. + +In this triangle, [`m\angle A=[$B]^{\circ}`] and [`m\angle B=[$C]^{\circ}`]. + +The distance from the boat to Station A is [____________]{$c} miles. + +The distance from the boat to Station B is [____________]{$b} miles. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the boat is at Point C. Assume the distance from the boat to Station A is [`x`] miles, and to Station B is [`y`] miles. + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +First, calculate [`m\angle C`]: + + [``\begin{aligned}[t] + m\angle C &= 180^{\circ} - m\angle A - m\angle B \\ + &= 180^{\circ} - [$B]^{\circ} - [$C]^{\circ} \\ + & =[$A]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`x`]: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(B)}{x} \\ + x\sin(C) &= c\sin(B) \\ + x &= \frac{c\sin(B)}{\sin(C)} \\ + x &= \frac{[$a]\sin([$C]^{\circ})}{\sin([$A]^{\circ})} \\ + x &= [$c] + \end{aligned}``] + +The distance from the boat to Station A is [`[$c]`] miles. + +And, use Law of Sines to calculate the length of [`y`]: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(A)}{y} \\ + y\sin(C) &= c\sin(A) \\ + y &= \frac{c\sin(A)}{\sin(C)} \\ + y &= \frac{[$a]\sin([$B]^{\circ})}{\sin([$A]^{\circ})} \\ + y &= [$b] + \end{aligned}``] + +The distance from the boat to Station B is [`[$b]`] miles. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication20.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication20.pg new file mode 100644 index 0000000000..369dfef426 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication20.pg @@ -0,0 +1,165 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + + +$B = random(31, 70, 1); +$C = random(100, 180-$B-20, 1); +$A = 180-$B-$C; +$a = random(50, 100, 1); +$b = $a*sin($B*pi/180)/sin($A*pi/180); +$c = $a*sin($C*pi/180)/sin($A*pi/180); +$h = $c*sin($B*pi/180); +$C2 = 180-$C; + +$xmin = 0; #The viewing window +$base = ($c*cos($B*pi/180)); +$xmax = ($base)*240/210; +$ymin = 0; +$ymax = (210*$h/$base+30)*$h/(210*$h/$base); + +$xLabelShift = $xmax/20; +$yLabelShift = $ymax/80; + +# Ax, Bx, Cx +@x = (($xmax+$base)/2, ($xmax-$base)/2, ($xmax-$base)/2+$a); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +for my $i (0..1) { +$picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"$a miles",'black','center','top','large')); +if ($i==1) { + $picture[$i]->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"y",'black','left','bottom','large')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"x",'black','right','bottom','large')); + $picture[$i]->lb( new Label( $x[0], $y[0],"C (boat)",'black','right','bottom','large')); +} else { + $picture[$i]->lb( new Label( $x[0], $y[0],"boat",'black','center','bottom','large')); +} + +$picture[$i]->lb( new Label( $x[1], $y[1],"A",'black','right','top','large')); +$picture[$i]->lb( new Label( $x[1]+2*$xLabelShift, $y[1]+$yLabelShift,$B,'black','left','bottom','large')); +$picture[$i]->lb( new Label( $x[2], $y[2],"B",'black','left','top','large')); +$picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2]+$yLabelShift,$C2,'black','left','bottom','large')); + +$picture[$i]->new_color("darkblue", 100,100,255); + +$picture[$i]->moveTo($x[0],$y[0]); +$picture[$i]->lineTo($x[1],$y[1], darkblue,3); +$picture[$i]->lineTo($x[2],$y[2], darkblue,3); +$picture[$i]->lineTo($x[0],$y[0], darkblue,3); + +$picture[$i]->moveTo($x[2],$y[2]); +$picture[$i]->lineTo($x[0],$y[2], darkblue,1,dashed); + +} + +$picture[1]->lb( new Label( $x[2]-$xLabelShift, $y[2]+$yLabelShift,$C,'black','right','bottom','large')); + +$text[0] = "This is a triangle with one side parallel to the ground; this side is marked as $a miles; the top point is marked as boat. The left endpoint is marked as A, and right endpoint is marked as B. The angle of elevation from A to the boat is $B degrees, and the angle of elevation from B to the boat is $C2 degrees. The boat is to the right of Point B, making Angle B inside the triangle an obtuse angle."; + +$text[1] = "This is a triangle with one side parallel to the ground; this side is marked as $a miles; the top point is marked as C (boat). The left endpoint is marked as A, and right endpoint is marked as B. The angle of elevation from A to the boat is $B degrees, and the angle of elevation from B to the boat is $C2 degrees. The boat is to the right of Point B, making Angle B inside the triangle an obtuse angle. The side from the boat to A is marked as x, and the side from the boat to B is marked as y."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +To determine how far a boat is from shore, two radar stations [`[$a]`] miles apart find the angles out to the boat, as shown in the figure. The angle of elevation from Station A to the boat is [`[$B]^{\circ}`], and angle of elevation from Station B to the boat is [`[$C2]^{\circ}`]. + +Determine the distance of the boat from Station A and Station B. + +The distance from the boat to Station A is [____________]{$c} miles. + +The distance from the boat to Station B is [____________]{$b} miles. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the boat is at Point C. Assume the distance from the boat to Station A is [`x`] miles, and to Station B is [`y`] miles. + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Since the angle of elevation from Station B to the boat is [`[$C2]^{\circ}`], the measure of [`\angle CBA `] inside the triangle is [`m\angle CBA = 180^{\circ} - [$C2]^{\circ} = [$C]^{\circ}`]. + +Next, calculate [`m\angle C`]: + + [``\begin{aligned}[t] + m\angle C &= 180^{\circ} - m\angle A - m\angle B \\ + &= 180^{\circ} - [$B]^{\circ} - [$C]^{\circ} \\ + & =[$A]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`x`]: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(B)}{x} \\ + x\sin(C) &= c\sin(B) \\ + x &= \frac{c\sin(B)}{\sin(C)} \\ + x &= \frac{[$a]\sin([$C]^{\circ})}{\sin([$A]^{\circ})} \\ + x &= [$c] + \end{aligned}``] + +The distance from the boat to Station A is [`[$c]`] miles. + +And, use Law of Sines to calculate the length of [`y`]: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(A)}{y} \\ + y\sin(C) &= c\sin(A) \\ + y &= \frac{c\sin(A)}{\sin(C)} \\ + y &= \frac{[$a]\sin([$B]^{\circ})}{\sin([$A]^{\circ})} \\ + y &= [$b] + \end{aligned}``] + +The distance from the boat to Station B is [`[$b]`] miles. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication30.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication30.pg new file mode 100644 index 0000000000..2b78df9264 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication30.pg @@ -0,0 +1,176 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$cushion = 2; +$ADx = 3; + +$D = random(20,30,1); +$Dx = $cushion; +$Dy = $cushion; + +$A = random(20,30,1); +$Ax = $Dx+$ADx; +$Ay = $Dy+$ADx*tan($D*pi/180); + +$AD = $A+$D; + +$c = random(5,15,1); +$a = $c*sin($A*pi/180)/sin( (90+$D)*pi/180 ); +$aU = NumberWithUnits("$a ft"); + +$B = 90-$A-$D; +$Bx = $cushion+$ADx+$c*cos( ($AD)*pi/180 ); +$By = $cushion+$ADx*tan($D*pi/180)+$c*sin( ($AD)*pi/180 ); + +$C = 90+$D; +$Cx = $cushion+$ADx+$c*cos( ($AD)*pi/180 ); +$Cy = $By - $a; + +$xmin = 0; #The viewing window +$xmax = $Bx*240/210; +$ymin = 0; +$ymax = (210*$By/$Bx+30)*$By/(210*$By/$Bx); + +$Fx = $xmax; +$Fy = $cushion+($xmax-$cushion)*tan($D*pi/180); + +$xLabelShift = $xmax/10; +$yLabelShift = $ymax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + + $picture[$i]->new_color("darkblue", 100,100,255); + $picture[$i]->moveTo($Fx,$Fy); + $picture[$i]->lineTo($Dx,$Dy, darkblue,3); + $picture[$i]->lineTo($Bx,$Dy, darkblue,1,dashed); + + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By, darkblue,3); + $picture[$i]->lineTo($Cx,$Cy, darkblue,3); + + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$Ay, darkblue,1,dashed); + + $picture[$i]->lb( new Label(($Ax+$Bx)/2, ($Ay+$By)/2,"$c feet",'black','right','bottom','large')); + $picture[$i]->lb( new Label($Dx+$xLabelShift, $Dy,"$D",'black','left','bottom','large')); + $picture[$i]->lb( new Label($Ax+0.5*$xLabelShift, $Ay,"$AD",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $Bx, ($By+$Cy)/2,"support",'black','middle','center','large')); +} + +$picture[1]->moveTo($Bx,$Ay); +$picture[1]->lineTo($Bx,$Cy, darkblue,1,dashed); + +$xShift = $xmax/100; +$yShift = $xShift*210/240; +$picture[1]->moveTo($Bx,$Ay+5*$yShift); +$picture[1]->lineTo($Bx-3*$xShift,$Ay+5*$yShift, darkblue,3); +$picture[1]->lineTo($Bx-3*$xShift,$Ay, darkblue,3); + +$picture[1]->lb( new Label($Dx, $Dy,"D",'black','right','top','large')); +$picture[1]->lb( new Label($Ax, $Ay,"A",'black','right','bottom','large')); +$picture[1]->lb( new Label($Bx, $By,"B",'black','center','bottom','large')); +$picture[1]->lb( new Label($Cx+0.2*$xLabelShift, $Cy,"C",'black','left','middle','large')); +$picture[1]->lb( new Label($Bx+0.2*$xLabelShift, $Ay,"E",'black','left','middle','large')); + +$text[0] = "A roof goes up from left to right, forming a $D-degree angle with the horizontal direction. On the roof, a solar panel forms a $AD-degree angle with the horizontal direction. The panel has a length of $c feet. A vertical segment, marked as support, connects the tip of the panel to the roof."; + +$text[1] = "A roof goes up from left to right, forming a $D-degree angle with the horizontal direction. On the roof, a solar panel forms a $AD-degree angle with the horizontal direction. The panel has a length of $c feet. A vertical segment, marked as support, connects the tip of the panel to the roof. Left end of the roof is marked as D. Left end of the panel is marked as A. Right end of the panel is marked as B. The intersection of the support and the roof is marked as C. The vertical support, BC, is extended downward, intersecting with the horizontal line at the level of A at Point E. Angle E is marked as 90 degrees."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +The roof of a house is at a [`[$D]^{\circ}`] angle. An [`[$c]`]-foot solar panel is to be mounted on the roof and should be angled [`[$AD]^{\circ}`] relative to the horizontal for optimal results. How long does the vertical support holding up the back of the panel need to be? + +[@KeyboardInstructions( +"\n" +.'* Please include units in your answer. Use *ft* to represent "feet".' +)@]** + +The vertical support holding up the back of the panel need to be [_______________]{$aU}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assign letters to the diagram as below: + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Due to parallel line theorems, [`m\angle CAE = m\angle D = [$D]^{\circ}`]. This implies: + + [``\begin{aligned}[t] + m\angle BAC &= m\angle BAE - m\angle CAE \\ + &= [$AD]^{\circ} - [$D]^{\circ} \\ + & =[$A]^{\circ} + \end{aligned}``] + +By External Angle Theorem (Google it if needed), in [`\Delta CAE`], we have: + + [``\begin{aligned}[t] + m\angle BCA &= m\angle CAE + m\angle E \\ + &= [$D]^{\circ} + 90^{\circ} \\ + & =[$C]^{\circ} + \end{aligned}``] + +Now we can use Law of Sines to calculate the length of segment [`BC`]: + + [``\begin{aligned}[t] + \frac{\sin(\angle BCA)}{AB} &= \frac{\sin(\angle BAC)}{BC} \\ + BC\cdot \sin(\angle BCA) &= AB\cdot \sin(\angle BAC) \\ + BC &= \frac{AB\cdot \sin(\angle BAC))}{\sin(\angle BCA)} \\ + BC &= \frac{[$c]\sin([$A]^{\circ})}{\sin([$C]^{\circ})} \\ + BC &= [$a] + \end{aligned}``] + +The vertical support holding up the back of the panel need to be [`[$aU]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication40.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication40.pg new file mode 100644 index 0000000000..34b26fdcda --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication40.pg @@ -0,0 +1,178 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$c = random(100,200,10); +$cushion = $c/5; + +$Ex = $cushion; +$Ey = $cushion; + +$B = random(20,30,1); +$C = random(30,40,1); +$BC = $B+$C; +$b = $c*sin($B*pi/180)/sin($C*pi/180); +$bU = NumberWithUnits("$b km"); +$h = $b*sin($BC*pi/180); +$hU = NumberWithUnits("$h km"); + +$Ax = $Ex + $h*cos($BC*pi/180); +$Ay = $Ey; +$Bx = $Ax + $c; +$By = $Ey; +$Cx = $Ex; +$Cy = $Ey+$h; + +$xmin = 0; #The viewing window +$xmax = $Bx*240/210; +$ymin = 0; +$ymax = (210*$Cy/$Bx+30)*$Cy/(210*$Cy/$Bx); + +$xLabelShift = $xmax/10; +$yLabelShift = $ymax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + + $picture[$i]->new_color("darkblue", 100,100,255); + $picture[$i]->moveTo($Cx,$Cy); + $picture[$i]->lineTo($Bx,$By, darkblue,3); + $picture[$i]->lineTo($Ax,$Ay, darkblue,3); + $picture[$i]->lineTo($Cx,$Cy, darkblue,3); + $picture[$i]->lineTo($Bx,$Cy, darkblue,3,dashed); + + $picture[$i]->lb( new Label($Bx, $Cy,"D",'black','left','middle','large')); + $picture[$i]->lb( new Label($Ax, $Ay,"A",'black','center','top','large')); + $picture[$i]->lb( new Label($Bx, $By,"B",'black','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2, $Ay,"$c km",'black','center','top','large')); +} + +$picture[0]->lb( new Label($Cx, $Cy,"plane",'black','left','bottom','large')); +$picture[1]->lb( new Label($Cx, $Cy,"C (plane)",'black','left','bottom','large')); +$picture[1]->lb( new Label($Ex, $Ey,"E",'black','right','top','large')); + +$picture[1]->moveTo($Cx,$Cy); +$picture[1]->lineTo($Cx,$Ay, darkblue,1,dashed); +$picture[1]->lineTo($Ax,$Ay, darkblue,1,dashed); + +$xShift = $xmax/100; +$yShift = $xShift*210/240; +$picture[1]->moveTo($Cx,$Ay+5*$yShift); +$picture[1]->lineTo($Cx+3*$xShift,$Ay+5*$yShift, darkblue,3); +$picture[1]->lineTo($Cx+3*$xShift,$Ay, darkblue,3); + +$text[0] = "A horizontal line has Point A (on the left) and B (on the right), with their distance marked as $c km. A plane is in the air to the left of Point A, connected to A and B. From the plane, a dotted horizontal line extends to the right to Point D."; + +$text[1] = "A horizontal line has Point A (on the left) and B (on the right), with their distance marked as $c km. A plane is in the air, marked as C, to the left of Point A, connected to A and B. From the plane, a dotted horizontal line extends to the right to Point D. From the plane, a dotted vertical line is drawn to the ground, intersecting the line AB at Point E, to the left of Point A. A dotted line connects E to A."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +A pilot is flying over two cities. He determines the angles of depression to City A and City B, [`[$c]`] km apart, to be [`[$BC]^{\circ}`] and [`[$B]^{\circ}`]. Find the distance from the plane to City A, and find the plane's height. + +[@KeyboardInstructions( +"\n" +.'* Please include units in your answer. Use *km* to represent "kilometers".' +)@]** + +The plane's distance to City A is [_________]{$bU}. + +The plane's height is [_________]{$hU}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assign variables to the diagram as shown, and sketch the plane's height. + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +The angle of depression to City B is [`[$B]^{\circ}`], implying [`m\angle DCB = [$B]^{\circ}`]. By Alternate Interior Angle Theorem (Google if needed), [`m\angle B = [$B]^{\circ}`]. + +The angle of depression to City A is [`[$BC]^{\circ}`], implying [`m\angle DCA = [$BC]^{\circ}`]. This implies: + + [``\begin{aligned}[t] + m\angle BCA &= m\angle DCA - m\angle DCB \\ + &= [$BC]^{\circ} - [$B]^{\circ} \\ + & =[$C]^{\circ} + \end{aligned}``] + +Now we can use Law of Sines in [`\Delta ABC`] to calculate the length of segment [`AC`]: + + [``\begin{aligned}[t] + \frac{\sin(\angle B)}{AC} &= \frac{\sin(\angle BCA)}{AB} \\ + AC\cdot \sin(\angle BCA) &= AB\cdot \sin(\angle B) \\ + AC &= \frac{AB\cdot \sin(\angle B))}{\sin(\angle BCA)} \\ + AC &= \frac{[$c]\sin([$B]^{\circ})}{\sin([$C]^{\circ})} \\ + AC &= [$b] + \end{aligned}``] + +The plane's distance to City A is [`[$bU]`]. + +By Exterior Angle Theorem (Google if needed), + + [``\begin{aligned}[t] + m\angle EAC &= m\angle BCA + m\angle B \\ + &= [$C]^{\circ} + [$B]^{\circ} \\ + & =[$BC]^{\circ} + \end{aligned}``] + +Next, in [`\Delta ACE`], we will use trigonometry to find the length of [`CE`]: + + [``\begin{aligned}[t] + \sin(\angle EAC) &= \frac{EC}{AC} \\ + EC &= AC\cdot \sin(\angle EAC) \\ + EC &= [$b] \cdot \sin([$BC]^{\circ}) \\ + EC &= [$h] + \end{aligned}``] + +The plane's height is [`[$hU]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication50.pg b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication50.pg new file mode 100644 index 0000000000..978e7e7db6 --- /dev/null +++ b/Contrib/PCC/Trigonometry/LawOfSines/LawOfSinesApplication50.pg @@ -0,0 +1,161 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$c = random(100,200,10); +$cushion = $c/5; + +$B = random(50,70,1); +$B2 = 180-$B; +$A = random(20,40,1); +$C = $B-$A; +$b = $c*sin($B*pi/180)/sin($C*pi/180); +$a = $c*sin($A*pi/180)/sin($C*pi/180); +$h = $b*sin($A*pi/180); +$hU = NumberWithUnits("$h m"); + +$Ax = $cushion; +$Ay = $cushion; +$Bx = $Ax + $c; +$By = $Ay; +$Cx = $Ax+$b*cos($A*pi/180); +$Cy = $Ay+$h; +$Dx = $Cx; +$Dy = $Ay; + +$xmin = 0; #The viewing window +$xmax = $Cx*240/210; +$ymin = 0; +$ymax = (210*$Cy/$Cx+30)*$Cy/(210*$Cy/$Cx); + +$xLabelShift = $xmax/20; +$yLabelShift = $ymax/100; + +for my $i (0..0) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + + $picture[$i]->new_color("darkblue", 100,100,255); + $picture[$i]->moveTo($Bx,$By); + $picture[$i]->lineTo($Ax,$Ay, darkblue,3); + $picture[$i]->lineTo($Cx,$Cy, darkblue,3); + $picture[$i]->lineTo($Bx,$By, darkblue,3); + $picture[$i]->lineTo($Dx,$Dy, darkblue,3); + $picture[$i]->lineTo($Cx,$Cy, darkblue,3); + + $picture[$i]->lb( new Label($Ax, $Ay,"A",'black','right','top','large')); + $picture[$i]->lb( new Label($Bx, $By,"B",'black','center','top','large')); + $picture[$i]->lb( new Label($Cx, $Cy,"C",'black','center','bottom','large')); + $picture[$i]->lb( new Label($Dx, $Dy,"D",'black','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2, $Ay,"$c m",'black','center','top','large')); + +} + +$picture[0]->lb( new Label($Bx+$xLabelShift, $By+$yLabelShift,"$B",'black','left','bottom','large')); +$picture[0]->lb( new Label($Ax+2*$xLabelShift, $Ay+$yLabelShift,"$A",'black','left','bottom','large')); + +$xShift = $xmax/100; +$yShift = $xShift*210/240; +$picture[0]->moveTo($Cx,$Dy+5*$yShift); +$picture[0]->lineTo($Cx-3*$xShift,$Dy+5*$yShift, darkblue,3); +$picture[0]->lineTo($Cx-3*$xShift,$Dy, darkblue,3); + +$text[0] = "Segment CD vertical to the ground represents the building. Point A on the ground has a $A-degree angle of elevation to Point C, top of the building. Point B, closer to the building on the ground, has a $B-degree angle of elevation to Point C. The distance between A and B is marked as $c meters. AB is extended toward the building, intersecting with CD at D. Angle D is marked as a right angle."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In order to estimate the height of a building, two students stand at a certain distance from the building at street level. From this point, they find the angle of elevation from the street to the top of the building to be [`[$A]^{\circ}`]. They then move [`[$c]`] meters closer to the building and find the angle of elevation to be [`[$B]^{\circ}`]. Assuming that the street is level, estimate the height of the building. + +[@KeyboardInstructions( +"\n" +.'* Please include units in your answer. Use *m* to represent "meters".' +)@]** + +The building's height is [_________]{$hU}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assign variables to the diagram as shown: + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +CD represents the building. Point A and Point B are those two observation spots. + +In [`\Delta ABC`], by Exterior Angle Theorem (Google if needed), [`m\angle CBD = m\angle A + m\angle ACB`]. So we have: + + [``\begin{aligned}[t] + m\angle CBD &= m\angle A + m\angle ACB \\ + m\angle ACB &= m\angle CBD - m\angle A \\ + m\angle ACB &= [$B]^{\circ} - [$A]^{\circ} \\ + m\angle ACB & =[$C]^{\circ} + \end{aligned}``] + +Now we can use Law of Sines in [`\Delta ABC`] to calculate the length of segment [`AC`]: + + [``\begin{aligned}[t] + \frac{\sin(\angle A)}{BC} &= \frac{\sin(\angle ACB)}{AB} \\ + BC\cdot \sin(\angle ACB) &= AB\cdot \sin(\angle A) \\ + BC &= \frac{AB\cdot \sin(\angle A))}{\sin(\angle ACB)} \\ + BC &= \frac{[$c]\sin([$A]^{\circ})}{\sin([$C]^{\circ})} \\ + BC &= [$a] + \end{aligned}``] + +Next, we use trigonometry in [`\Delta BCD`] to calculate the length of [`CD`]: + + [``\begin{aligned}[t] + \sin(\angle CBD) &= \frac{CD}{BC} \\ + CD &= BC\cdot \sin(\angle CBD) \\ + CD &= [$a] \cdot \sin([$B]^{\circ}) \\ + CD &= [$h] + \end{aligned}``] + +The building's height is [`[$hU]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarCoordinates10.pg b/Contrib/PCC/Trigonometry/Polar/PolarCoordinates10.pg new file mode 100644 index 0000000000..8864df9d3e --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarCoordinates10.pg @@ -0,0 +1,151 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = @_; + if ($n==0) {return "0";} + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +Context("Fraction"); + +@num = (); +do { + $den = list_random(3,4,6); + $num[0] = random(1,2*$den-1,1); + ($num[0],$den) = Fraction($num[0],$den)->reduce->value; +} until ($den != 1); + +$r = random(1,5,1); + +$num[1] = ($num[0]>$den) ? $num[0]-$den : $num[0]+$den; +$num[2] = $num[0]-2*$den; +$num[3] = $num[1]-2*$den; + +@frac = (); +$frac[0] = output($num[0],$den); +$frac[1] = output($num[1],$den); +$frac[2] = output($num[2],$den); +$frac[3] = output($num[3],$den); +$frac[4] = output($num[0],$den); +$frac[5] = output($num[1],$den); +$frac[6] = output(-$num[2],$den); +$frac[7] = output(-$num[3],$den); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Choose all polar coordinates which represents Point A in the graph. There may be more than one correct answer.", + "\( \left( $r, $frac[0] \right)_p \) $BR", + "\( \left( -$r, $frac[1] \right)_p \) $BR", + "\( \left( $r, $frac[2] \right)_p \) $BR", + "\( \left( -$r, $frac[3] \right)_p \) $BR", +); + +$mc -> extra( + "\( \left( -$r, $frac[4] \right)_p \) $BR", + "\( \left( $r, $frac[5] \right)_p \) $BR", + "\( \left( $r, $frac[6] \right)_p \) $BR", + "\( \left( -$r, $frac[7] \right)_p \) $BR", +); + + +$r0 = 5; +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +for my $i (0..$r0) { + $xfuncAlpha = sub { my $t = shift(); + return $i*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $i*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); + $fnAlpha->domain(0,2*pi); +} + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r0*cos($i*pi/$den), $r0*sin($i*pi/$den), 'blue' ) ); +} + +$graph -> stamps( closed_circle( $r*cos($num[0]*pi/$den), $r*sin($num[0]*pi/$den), 'red' ) ); +$graph->lb(new Label($r*cos($num[0]*pi/$den), $r*sin($num[0]*pi/$den),"A",'red','center','bottom',large)); +$graph->lb(new Label($r0*cos(pi/$den), $r0*sin(pi/$den), "pi/$den",'blue','left','bottom',large)); + +$alt = "This is a polar system with 5 circles with radius being 1, 2, 3, 4 and 5. Point A with radius $r and at the direction of $num[0] pi/$den is marked."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + + +BEGIN_PGML_SOLUTION + +For a polar coordinate [`(r,\theta)_p`], [`r`] could be negative, which implies going in the opposite direction of [`\theta`]. + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarCoordinates20.pg b/Contrib/PCC/Trigonometry/Polar/PolarCoordinates20.pg new file mode 100644 index 0000000000..e07d686074 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarCoordinates20.pg @@ -0,0 +1,160 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + Context("Fraction"); + Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, + ); + + my ($n,$d) = @_; + ($n,$d) = Fraction($n,$d)->reduce->value; + if ($n==0) {return "0";} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n \pi";} + } + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$den = list_random(3,4,6); +$num = random(1,2*$den-1,1); +($num,$den) = Fraction($num,$den)->reduce->value; + +$num = random(-1,1,2)*$num; +$fracShow0 = output($num,$den); +$frac0 = $den==1 ? Formula("$num*pi") : Formula("($num*pi)/$den"); +$r0 = random(2,10,1); + +if ($den==3) { + $cos0 = Fraction(cos(Compute($frac0))); + $x0 = Fraction($r0*cos(Compute($frac0))); + $x1 = Fraction(-$r0*cos(Compute($frac0))); +} else { + $cos0 = specialRadical(cos(Compute($frac0))); + $x0 = specialRadical($r0*cos(Compute($frac0))); + $x1 = specialRadical(-$r0*cos(Compute($frac0))); +} +if ($den==6) { + $sin0 = Fraction(sin(Compute($frac0))); + $y0 = Fraction($r0*sin(Compute($frac0))); + $y1 = Fraction(-$r0*sin(Compute($frac0))); +} else { + $sin0 = specialRadical(sin(Compute($frac0))); + $y0 = specialRadical($r0*sin(Compute($frac0))); + $y1 = specialRadical(-$r0*sin(Compute($frac0))); +} + + +############################################## + +BEGIN_PGML + +Convert polar coordinates to rectangular coordinates. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +)@]** + +###Part a + + [`` \left([$r0],[$fracShow0]\right)_p=(``][__________]{$x0},[__________]{$y0}[`)_r`] + +###Part b + + [`` \left(-[$r0],[$fracShow0]\right)_p=(``][__________]{$x1},[__________]{$y1}[`)_r`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To change polar coordinates [`(r,\theta)_p`] to rectangular coordinates, use the formula: + + [``x=r\cos(\theta)\text{ and }y=r\sin(\theta)``] + +###Part a: + + [``\begin{aligned} + x &= r\cos(\theta) \\ + &= [$r0]\cos\left([$fracShow0]\right) \\ + &= [$r0]\left([$cos0]\right) \\ + &= [$x0] + \end{aligned}``] + +and: + + [``\begin{aligned} + xy &= r\sin(\theta) \\ + &= [$r0]\sin\left([$fracShow0]\right) \\ + &= [$r0]\left([$sin0]\right) \\ + &= [$y0] + \end{aligned}``] + +We have: + + [`` \left([$r0],[$fracShow0]\right)_p=\left([$x0],[$y0]\right)_r``] + +###Part b: + +When radius is negative in [`(r,\theta)_p`], in the direction of [`\theta`], we go to the negative direction. If [`(r,\theta)_p`] corresponds to [`(x,y)_r`], then [`(-r,\theta)_p`] corresponds to [`(-x,-y)_r`]. + +We have: + + [`` \left(-[$r0],[$fracShow0]\right)_p=\left([$x1],[$y1]\right)_r``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarCoordinates30.pg b/Contrib/PCC/Trigonometry/Polar/PolarCoordinates30.pg new file mode 100644 index 0000000000..bd8f6ecdee --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarCoordinates30.pg @@ -0,0 +1,140 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +do { + $den = list_random(3,4,6); + $num = random(1,2*$den-1,1); + ($num,$den) = Fraction($num,$den)->reduce->value; +} until $den!=2 && $den!=1; + +$tanV = ($den==4) ? tan($num*pi/$den) : specialRadical(tan($num*pi/$den)); +$s1 = specialAngle(arctan(Compute($tanV))); +$s2 = specialAngle(Compute($s1)+pi); + +if ($tanV>0) { + $Q = ($num<$den) ? "I" : "III"; + $s3 = ($num<$den) ? $s1 : $s2; +} else { + $Q = ($num<$den) ? "II" : "IV"; + $s3 = ($num<$den) ? $s2 : $s1; +} + +$frac0 = specialAngle($num*pi/$den); +$r0 = random(2,10,1); + +if ($den==3) { + $cos0 = Fraction(cos(Compute($frac0))); + $x0 = Fraction($r0*cos(Compute($frac0))); +} else { + $cos0 = specialRadical(cos(Compute($frac0))); + $x0 = specialRadical($r0*cos(Compute($frac0))); +} +if ($den==6) { + $sin0 = Fraction(sin(Compute($frac0))); + $y0 = Fraction($r0*sin(Compute($frac0))); +} else { + $sin0 = specialRadical(sin(Compute($frac0))); + $y0 = specialRadical($r0*sin(Compute($frac0))); +} + + +############################################## + +BEGIN_PGML + +Convert rectangular coordinates to polar coordinates. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use positive [|r|]* value.' +."\n" +.'* Use angle values in the range of [`[0,2\pi)`].' +)@]** + + [`` \left([$x0],[$y0]\right)_r=(``][__________]{$r0},[__________]{$frac0}[`)_p`] + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +To change rectangular coordinates [`(x,y)_r`] to polar coordinates [`(r,\theta)_p`], use the following formulas: + + [``r=\sqrt{x^2+y^2}\text{ and }\tan(\theta)=\frac{y}{x}``] + +###Calculating [`r`] + + [``\begin{aligned} + r &= \sqrt{x^2+y^2} \\ + &= \sqrt{\left([$x0]\right)^2+\left([$y0]\right)^2} \\ + &= [$r0] + \end{aligned}``] + +###Calculating [`\theta`] + + [``\begin{aligned} + \tan(\theta) &= \frac{y}{x} \\ + &= \frac{[$y0]}{[$x0]} \\ + &= [$tanV] + \end{aligned}``] + +On the Unit Circle, two values makes [`\tan(\theta)=[$tanV]`] true: + + [`` \tan\left([$s1]\right) = [$tanV]\text{ and }\tan\left([$s2]\right) = [$tanV] ``] + +By [`([$x0],[$y0])_r`], the angle is in Quadrant [$Q]. So we should choose + + [`` \theta=[$s3] ``] + +Since the range of [`\theta`] is [`[0,2\pi)`], the correct solution is + + [`` \left([$r0],[$frac0]\right)_p ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarCoordinates40.pg b/Contrib/PCC/Trigonometry/Polar/PolarCoordinates40.pg new file mode 100644 index 0000000000..22736bf0ca --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarCoordinates40.pg @@ -0,0 +1,100 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$r = random(1,5,1); +$n = random(0,3,1); +$d = 2; + +if ($n==0) { + $frac = Formula("0"); + $s1 = "positive x-axis"; +} elsif ($n==1) { + $frac = Formula("pi/$d"); + $s1 = "positive y-axis"; +} elsif ($n==2) { + $frac = Formula("pi"); + $s1 = "negative x-axis"; +} else { + $frac = Formula("($n*pi)/$d"); + $s1 = "negative y-axis"; +} + +$x = $r*cos(Compute($frac)); +$y = $r*sin(Compute($frac)); + + + +############################################## + +BEGIN_PGML + +Convert rectangular coordinates to polar coordinates. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use positive [|r|]* value.' +."\n" +.'* Use angle values in the range of [`[0,2\pi)`].' +)@]** + + [`` \left([$x],[$y]\right)_r=(``][__________]{$r},[__________]{$frac}[`)_p`] + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +The given coordinates [`\left([$x],[$y]\right)_r`] is on the [$s1]. + +The correct solution is + + [`` \left([$r],[$frac]\right)_p ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarEquation10.pg b/Contrib/PCC/Trigonometry/Polar/PolarEquation10.pg new file mode 100644 index 0000000000..375edbed7a --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarEquation10.pg @@ -0,0 +1,90 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(r=>"Real",y=>"Real"); #t=>"Real", +Context()->variables->add(t=>['Real',TeX=>'\theta']); +parser::Assignment->Allow; + +$left = Compute("x**2+y**2"); +$rad = non_zero_random(-5,5,1); +$right = ($rad)**2; +$ans = OneOf(Compute("r=$rad"),Compute("r=-$rad")); + + +############################################## + +BEGIN_PGML + +Convert Cartesian equation [`[$left]=[$right]`] to polar equation. + +[@KeyboardInstructions( +"\n" +.'* Use the variable [|t|]* to represent [`\theta`] in your polar equation.' +."\n" +.'* Type your answer in the form [|r=...|]*.' +."\n" +.'* Don\'t forget [|( )|]* when you use [`\sin()`] and [`\cos()`].' +)@]** + + Polar equation: [______________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + r^2 &= [$right] \\ + r &= \pm\sqrt{[$right]} \\ + r &= [$rad] \text{ or }r=-[$rad] + \end{aligned}``] + +Either [`r=[$rad]`] or [`r=-[$rad]`] represents the same circle with a radius of [`[$rad]`] and centered at the origin. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarEquation20.pg b/Contrib/PCC/Trigonometry/Polar/PolarEquation20.pg new file mode 100644 index 0000000000..dfdd382a01 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarEquation20.pg @@ -0,0 +1,95 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(r=>"Real",y=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +parser::Assignment->Allow; + +$v = random(0,1,1)==0 ? "x" : "y"; +$right = non_zero_random(-10,10,1); + +if ($v eq "x") { + $left = Compute("x"); + $s1 = Compute("r*cos(t)"); + $s2 = Compute("$right/cos(t)"); + $ans = Formula("r = $right/cos(t)")->reduce; +} else { + $left = Compute("y"); + $s1 = Compute("r*sin(t)"); + $s2 = Compute("$right/sin(t)"); + $ans = Formula("r = $right/sin(t)")->reduce; +} + +############################################## + +BEGIN_PGML + +Convert Cartesian equation [`[$left]=[$right]`] to polar equation. + +[@KeyboardInstructions( +"\n" +.'* Use the variable [|t|]* to represent [`\theta`] in your polar equation.' +."\n" +.'* Type your answer in the form [|r=...|]*.' +."\n" +.'* Don\'t forget [|( )|]* when you use [`\sin()`] and [`\cos()`].' +)@]** + + Polar equation: [______________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + [$s1] &= [$right] \\ + r &= [$s2] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarEquation30.pg b/Contrib/PCC/Trigonometry/Polar/PolarEquation30.pg new file mode 100644 index 0000000000..bdf5646657 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarEquation30.pg @@ -0,0 +1,94 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(r=>"Real",y=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +parser::Assignment->Allow; + +$m = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$left = Compute("y"); +$right = Compute("$m*x+$b")->reduce; + +$ans = Formula("r = $b/(sin(t)-$m*cos(t))")->reduce; + +############################################## + +BEGIN_PGML + +Convert Cartesian equation [`[$left]=[$right]`] to polar equation. + +[@KeyboardInstructions( +"\n" +.'* Use the variable [|t|]* to represent [`\theta`] in your polar equation.' +."\n" +.'* Type your answer in the form [|r=...|]*.' +."\n" +.'* Don\'t forget [|( )|]* when you use [`\sin()`] and [`\cos()`].' +)@]** + + Polar equation: [______________________]{$ans} + +END_PGML + +############################################## + +$s1 = Compute("$m*(r*cos(t))+$b")->reduce; +$s2 = Compute("r*sin(t)-r*$m*cos(t)")->reduce; +$s3 = Compute("r*(sin(t)-$m*cos(t))")->reduce; +$ansR = Compute("$b/(sin(t)-$m*cos(t))")->reduce; + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + r\sin(\theta) &= [$s1] \\ + [$s2] &= [$b] \\ + [$s3] &= [$b] \\ + r &= [$ansR] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarEquation40.pg b/Contrib/PCC/Trigonometry/Polar/PolarEquation40.pg new file mode 100644 index 0000000000..55d7614fcf --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarEquation40.pg @@ -0,0 +1,113 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->are(x=>"Real",y=>"Real"); +Context()->noreduce("(-x)-y","(-x)+y"); +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$left = Compute("x**2+$a*x+y**2+$b*y")->reduce; +$right = "0"; + +parser::Assignment->Allow; +Context()->variables->are( + r => "Real", + t => ['Real',TeX=>'\theta'], + theta => ['Real',TeX=>'\theta'], +); +$answer = Formula("r = -$a*cos(t)-$b*sin(t)")->reduce; + +# Get the test points for the function to use the same values for t and theta +$test_points = []; +for my $i (0..9) { + my $r = random(0,10,0.001); + my $t = random(0,2*pi,0.001); + push @$test_points, [$r,$t,$t]; +} +$answer->{test_points} = $test_points; + + +############################################## + +BEGIN_PGML + +Convert the Cartesian equation [`[$left]=[$right]`] to a polar equation. + +[@KeyboardInstructions( +"\n" +.'* Use the variable [|t|]* to represent [`\theta`] in your polar equation.' +."\n" +.'* Type your answer in the form [|r=...|]*.' +."\n" +.'* Don\'t forget [|( )|]* when you use [`\sin()`] and [`\cos()`].' +)@]** + + Polar equation: [______________________]{$answer} + +END_PGML + +############################################## + +$s1 = Compute("r**2+$a*(r*cos(t))+$b*(r*sin(t))")->reduce; +$s2 = Compute("r+$a*cos(t)+$b*sin(t)")->reduce; +$s3 = Compute("-$a*cos(t)-$b*sin(t)")->reduce; + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + [$s1] &= 0 \\ + r([$s2]) &= 0 \\ + r &= 0 \text{ or }[$s2]=0 \\ + r &= 0 \text{ or }r=[$s3] + \end{aligned}``] + +[`r=0`] is not a true solution, so the polar equation form of [`[$left]=[$right]`] is + + [``[$answer]``] + +When you enter the answer, you can use *t* to represent [`\theta`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarEquation50.pg b/Contrib/PCC/Trigonometry/Polar/PolarEquation50.pg new file mode 100644 index 0000000000..5252efc2fb --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarEquation50.pg @@ -0,0 +1,81 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserImplicitEquation.pl", + "PGML.pl", + "parserOneOf.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("ImplicitEquation"); +Context()->variables->add(r=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); + +$rad = non_zero_random(-5,5,1); +$rad2 = ($rad)**2; +$ans = ImplicitEquation("x^2 + y^2 = $rad2", + limits=>[[-abs($rad)-1,abs($rad)+1],[-abs($rad)-1,abs($rad)+1]], + tolerance => .001 +); + +$left = Compute("r"); +$right = Compute("$rad"); + +############################################## + +BEGIN_PGML + +Convert polar equation [`[$left]=[$right]`] to Cartesian equation. + + Cartesian equation: [______________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + r^2 &= [$rad2] \\ + x^2+y^2 &= [$rad2] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarEquation55.pg b/Contrib/PCC/Trigonometry/Polar/PolarEquation55.pg new file mode 100644 index 0000000000..a200fc7a16 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarEquation55.pg @@ -0,0 +1,155 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->variables->add(r=>"Real",y=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +parser::Assignment->Allow; + +$den = list_random(3,4,6); +do {$num = random(1,2*$den-1,1);} until gcd($num,$den)==1; +$num = $num*random(-1,1,2); +if ($num==1) {$angle = Formula("pi/$den");} + elsif ($num==-1) {$angle = -Formula("pi/$den");} +else { + $numN = -$num; + $angle = ($num>0) ? Formula("$num*pi/$den") : -Formula("$numN*pi/$den"); +} + +$mV = tan(Compute($angle)); +$m = $mV; +if ($den != 4) { + $m = specialRadical($mV); +} + +$left = Compute("t"); +$right = $angle; +if ($m==1) {$ans = Formula("y=x");} + elsif ($m==-1) {$ans = Formula("y=-x");} + else {$ans = Formula("y=$m*x");} + + +$r0 = 5; +($xmin,$xmax) = (-8,8); +($ymin,$ymax) = (-8,8); +$graph = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r0*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r0*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +add_functions($graph, "$mV*x for x in <$xmin,$xmax> using color:blue and weight:2"); + +$Px = cos($num*pi/$den); +$Py = sin($num*pi/$den); +$PxShow = ($den==3) ? Fraction($Px) : specialRadical($Px); +$PyShow = ($den==6) ? Fraction($Py) : specialRadical($Py); + +$graph -> stamps( closed_circle( $r0*$Px, $r0*$Py, 'red' ) ); +$ud = $Py>0 ? 'bottom' : 'top'; +$graph->lb(new Label($r0*$Px, $r0*$Py,"$angle",'red','center',$ud,large)); +$lr = $Px>0 ? 'left' : 'right'; +$graph->lb(new Label($r0*$Px, $r0*$Py/2, "$PyShow",'red',$lr,'middle',large)); +$ud = $Py>0 ? 'top' : 'bottom'; +$graph->lb(new Label($r0*$Px/2, 0, "$PxShow",'red','center',$ud,large)); + +$graph->moveTo(0,0); +$graph->lineTo($r0*$Px, $r0*$Py, red, 2); +$graph->lineTo($r0*$Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($r0*$Px, $yShift); +$graph->lineTo($r0*$Px+$xShift, $yShift, red, 2); +$graph->lineTo($r0*$Px+$xShift, 0, red, 2); + +$alt = "This is a unit circle with a line corssing the origin. The line intersects with the circle at a point marked as $angle. From this point, a vertical line is drawn toward the x-axis. The intersection, the point and the origin form a right triangle. Its base is marked as $PxShow, and its height is marked as $PyShow."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +############################################## + +BEGIN_PGML + +Convert polar equation [`[$left]=[$right]`] to Cartesian equation. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt( )|]* to input square root if needed. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +)@]** + + Cartesian equation: [______________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The polar equation [`[$left]=[$right]`] has all points on the line which creates the angle [`[$right]`] with the x-axis. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[`[$angle]`] is a speical angle with known trig values: + + [``\sin\left([$angle]\right) = [$PyShow]\text{ and }\cos\left([$angle]\right) = [$PxShow] ``] + +Those values can be marked as the base and height of the right triangle in the graph. + +The line's slope can be calculated by + + [``\begin{aligned} + \text{slope} &= \frac{\text{change in y}}{\text{change in x}} \\ + &= \frac{[$PyShow]}{[$PxShow]} \\ + &= [$m] + \end{aligned}``] + +The line's Cartesian equation is [`[$ans]`]. +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarEquation60.pg b/Contrib/PCC/Trigonometry/Polar/PolarEquation60.pg new file mode 100644 index 0000000000..078f3f32dc --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarEquation60.pg @@ -0,0 +1,88 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(r=>"Real",y=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +parser::Assignment->Allow; + +$v = random(0,1,1)==0 ? "x" : "y"; +$a = non_zero_random(-10,10,1); +$left = Compute("r"); + +if ($v eq "x") { + $right = Compute("$a*sec(t)"); + $s1 = Compute("$a/cos(t)"); + $s2 = Compute("r*cos(t)"); + $ans = Formula("x = $a")->reduce; +} else { + $right = Compute("$a*csc(t)"); + $s1 = Compute("$a/sin(t)"); + $s2 = Compute("r*sin(t)"); + $ans = Formula("y = $a")->reduce; +} + +############################################## + +BEGIN_PGML + +Convert polar equation [`[$left]=[$right]`] to Cartesian equation. + + Cartesian equation: [______________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + r &= [$s1] \\ + [$s2] &= [$a] \\ + [$v] &= [$a] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarEquation70.pg b/Contrib/PCC/Trigonometry/Polar/PolarEquation70.pg new file mode 100644 index 0000000000..e5076a27a4 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarEquation70.pg @@ -0,0 +1,91 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "parserAssignment.pl", + "parserImplicitPlane.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +$m = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); + +Context("Numeric"); +Context()->variables->add(y=>"Real"); +parser::Assignment->Allow; +$ansShow = Compute("y=$m*x+$b")->reduce; + +Context("ImplicitPlane"); +Context()->variables->add(r=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +Context()->noreduce("(-x)-y","(-x)+y"); +$left = Compute("r"); +$right = Compute("$b/(sin(t)-$m*cos(t))")->reduce; + +$ans = ImplicitPlane("y=$m*x+$b")->reduce; + +############################################## + +BEGIN_PGML + +Convert polar equation [`[$left]=[$right]`] to Cartesian equation. + + Cartesian equation: [______________________]{$ans->cmp(correct_ans_latex_string=> $ansShow->TeX)} + +END_PGML + +############################################## + +$s1 = Compute("y-$m*x")->reduce; +$s2 = Compute("r*sin(t)-$m*r*cos(t)")->reduce; +$s3 = Compute("r*(sin(t)-$m*cos(t))")->reduce; +$s4 = Compute("$m*x+$b")->reduce; + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + [$s3] &= [$b] \\ + [$s2] &= [$b] \\ + [$s1] &= [$b] \\ + y &= [$s4] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Polar/PolarEquation80.pg b/Contrib/PCC/Trigonometry/Polar/PolarEquation80.pg new file mode 100644 index 0000000000..71ece5b650 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Polar/PolarEquation80.pg @@ -0,0 +1,94 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "parserImplicitEquation.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("ImplicitEquation"); +Context()->variables->add(r=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +Context()->noreduce("(-x)-y","(-x)+y"); + +do { + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); + $rad = sqrt(($a)**2/4+($b)**2/4); +} until ($rad>abs($b/2)); +$left = Compute("r"); +$right = Compute("-$a*sin(t)-$b*cos(t)")->reduce; + +$ans = ImplicitEquation("x**2+$b*x+y**2+$a*y=0", + limits=>[[-$b/2-$rad,-$b/2+$rad],[-2*$rad,2*$rad]], + tolerance => .001 +); + +$ansL = Compute("x**2+$b*x+y**2+$a*y")->reduce; + +############################################## + +BEGIN_PGML + +Convert the polar equation [`[$left]=[$right]`] to a Cartesian equation. + + Cartesian equation: [______________________]{$ans->cmp(correct_ans_latex_string=>($ansL->TeX))} + +END_PGML + +############################################## + + +$s1 = Compute("-$a*r*sin(t)-$b*r*cos(t)")->reduce; +$s2 = Compute("-$a*y-$b*x")->reduce; + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + r\cdot\left([$left]\right) &= r\cdot\left([$right]\right) \\ + r^2 &= [$s1] \\ + x^2+y^2 &= [$s2] \\ + [$ansL] &= 0 + \end{aligned}``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/PolarComplex/CisOperations10.pg b/Contrib/PCC/Trigonometry/PolarComplex/CisOperations10.pg new file mode 100644 index 0000000000..d6e67f548b --- /dev/null +++ b/Contrib/PCC/Trigonometry/PolarComplex/CisOperations10.pg @@ -0,0 +1,125 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "parserFunction.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@num = (); +@den = (); +@angle = (); + + for my $i (0..1) { + do { + $den[$i] = list_random(3,4,6); + $num[$i] = random(1,2*$den[$i]-1,1); + } until gcd($num[$i],$den[$i])==1; + $angle[$i] = specialAngle($num[$i]*pi/$den[$i]); + } + $angle[2] = specialAngle(Compute($angle[0])+Compute($angle[1]),(1,2,3,4,6,12)); + +if ($angle[2]>=Compute("2*pi")) { + $angle[3] = specialAngle(Compute($angle[2])-2*pi,(1,2,3,4,6,12)); +} else { + $angle[3] = $angle[2]; +} + +@r = (); @com = (); +Context()->variables->add(i=>"Real"); +for my $j (0..1) { + $r[$j] = random(2,10,1); + $com[$j] = Formula("$r[$j]*(cos($angle[$j])+i*sin($angle[$j]))"); +} +$r[2] = $r[0]*$r[1]; +$com[2] = Formula("$r[2]*(cos($angle[3])+i*sin($angle[3]))"); + +Context("Complex"); +parserFunction("cis(z)" => "cos(z) + i*sin(z)"); +Context()->flags->set(reduceConstantFunctions => 0); + +for my $j (0..1) { + $c[$j] = Formula("$r[$j]*cis($angle[$j])"); +} +$ans = Formula("$r[2]*cis($angle[3])"); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Do the following calculation. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + +If [` z_1=[$c[0]]`] and [`z_2=[$c[1]]`], then + + [``z_1z_2=``][________________________]{$ans} + +END_PGML + +############################################## + +Context("Fraction"); +$s2 = ""; +if ( Compute($angle[3]) != Compute($angle[2]) ) { + $s2 = "&= $r[2] \left( \cos\left(".$angle[3]->TeX."\right)+i\sin\left(".$angle[3]->TeX."\right) \right) \\"; +} + +BEGIN_PGML_SOLUTION + +If [`z_1=r_1\left(\cos(\theta_1)+i\sin(\theta_1)\right)`] and [`z_2=r_2\left(\cos(\theta_2)+i\sin(\theta_2)\right)`], then + + [`` z_1z_2=r_1r_2\left(\cos(\theta_1+\theta_2)+i\sin(\theta_1+\theta_2)\right) ``] + +We have: + + [``\begin{aligned} + z_1z_2 &= \left([$c[0]]\right)\cdot\left([$c[1]]\right) \\ + &= \left([$com[0]]\right)\cdot\left([$com[1]]\right) \\ + &= [$r[0]]\cdot[$r[1]]\left( \cos\left([$angle[0]]+[$angle[1]]\right)+i\sin\left([$angle[0]]+[$angle[1]]\right) \right) \\ + &= [$r[2]]\left( \cos\left([$angle[2]]\right)+i\sin\left([$angle[2]]\right) \right) \\ + [$s2] &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/PolarComplex/CisOperations20.pg b/Contrib/PCC/Trigonometry/PolarComplex/CisOperations20.pg new file mode 100644 index 0000000000..c33395a9c3 --- /dev/null +++ b/Contrib/PCC/Trigonometry/PolarComplex/CisOperations20.pg @@ -0,0 +1,126 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserFunction.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "parserOneOf.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@num = (); +@den = (); +@angle = (); + + for my $i (0..1) { + do { + $den[$i] = list_random(3,4,6); + $num[$i] = random(1,2*$den[$i]-1,1); + } until gcd($num[$i],$den[$i])==1; + $angle[$i] = specialAngle($num[$i]*pi/$den[$i]); + } + $angle[2] = specialAngle(Compute($angle[0])-Compute($angle[1]),(1,2,3,4,6,12)); + +if ($angle[2]variables->add(i=>"Real"); +for my $j (0..1) { + $com[$j] = Formula("$r[$j]*(cos($angle[$j])+i*sin($angle[$j]))"); +} +$com[2] = Formula("$r[2]*(cos($angle[3])+i*sin($angle[3]))"); + +Context("Complex"); +parserFunction("cis(z)" => "cos(z) + i*sin(z)"); +Context()->flags->set(reduceConstantFunctions => 0); + +for my $j (0..1) { + $c[$j] = Formula("$r[$j]*cis($angle[$j])"); +} + +@ans = (); +$ans[0] = Formula("$r[2]*cis($angle[2])"); +$ans[1] = Formula("$r[2]*cis($angle[3])"); +$ans = OneOf($ans[0],$ans[1]); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Do the following calculation. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + +If [` z_1=[$c[0]]`] and [`z_2=[$c[1]]`], then + + [`` \frac{z_1}{z_2}=``][________________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +If [`z_1=r_1\left(\cos(\theta_1)+i\sin(\theta_1)\right)`] and [`z_2=r_2\left(\cos(\theta_2)+i\sin(\theta_2)\right)`], then + + [`` \frac{z_1}{z_2}=\frac{r_1}{r_2}\left(\cos(\theta_1-\theta_2)+i\sin(\theta_1-\theta_2)\right) ``] + +We have: + + [``\begin{aligned} + \frac{z_1}{z_2} &= \frac{[$c[0]]}{[$c[1]]} \\ + &= \frac{[$com[0]]}{[$com[1]]} \\ + &= [$r[2]]\left( \cos\left([$angle[0]]-[$angle[1]]\right)+i\sin\left([$angle[0]]-[$angle[1]]\right) \right) \\ + &= [$r[2]]\left( \cos\left([$angle[2]]\right)+i\sin\left([$angle[2]]\right) \right) \\ + &= [$ans[0]] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/PolarComplex/CisOperations30.pg b/Contrib/PCC/Trigonometry/PolarComplex/CisOperations30.pg new file mode 100644 index 0000000000..bdf0d9945c --- /dev/null +++ b/Contrib/PCC/Trigonometry/PolarComplex/CisOperations30.pg @@ -0,0 +1,120 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserFunction.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@angle = (); + + do { + $den = list_random(3,4,6); + $num = random(1,2*$den-1,1); + } until gcd($num,$den)==1; + $angle[0] = specialAngle($num*pi/$den); + + do { + $n = random(2,5,1); + $r = random(2,5,1); + $rn = $r**$n; + } until $rn<=125; + $angle[1] = specialAngle($n*Compute($angle[0])); + +$angle[2] = $angle[1]; +while ($angle[2]>=Compute("2*pi")) { + $angle[2] = Compute($angle[2]-2*pi); +} +$angle[2] = specialAngle(Compute($angle[2])); + +Context()->variables->add(i=>"Real"); +@com = (); +$com[0] = Formula("$r*(cos($angle[0])+i*sin($angle[0]))"); +$com[1] = Formula("$rn*(cos($angle[2])+i*sin($angle[2]))"); + +Context("Complex"); +parserFunction("cis(z)" => "cos(z) + i*sin(z)"); +Context()->flags->set(reduceConstantFunctions => 0); + +$c = Formula("$r*cis($angle[0])"); +$ans = Formula("$rn*cis($angle[2])"); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Do the following calculation. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + +If [` z=[$c]`], then + + [`` z^{[$n]}=``][________________________]{$ans} + +END_PGML + +############################################## + +Context("Fraction"); +$s2 = ""; +if ( Compute($angle[2]) != Compute($angle[1]) ) { + $s2 = "&= $rn \left( \cos\left(".$angle[2]->TeX."\right)+i\sin\left(".$angle[2]->TeX."\right) \right) \\"; +} + +BEGIN_PGML_SOLUTION + +If [`z=r\left(\cos(\theta)+i\sin(\theta)\right)`], then + + [`` z^n=r^n\left(\cos(n\theta)+i\sin(n\theta)\right) ``] + +We have: + + [``\begin{aligned} + z^{[$n]} &= \left([$c]\right)^{[$n]} \\ + &= \left([$com[0]]\right)^{[$n]} \\ + &= [$r]^{[$n]}\left( \cos\left([$n]\cdot[$angle[0]]\right)+i\sin\left([$n]\cdot[$angle[0]]\right) \right) \\ + &= [$rn]\left( \cos\left([$angle[1]]\right)+i\sin\left([$angle[1]]\right) \right) \\ + [$s2] &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/PolarComplex/CisOperations35.pg b/Contrib/PCC/Trigonometry/PolarComplex/CisOperations35.pg new file mode 100644 index 0000000000..761b586483 --- /dev/null +++ b/Contrib/PCC/Trigonometry/PolarComplex/CisOperations35.pg @@ -0,0 +1,200 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@angle = (); +do { + $den = list_random(3,4,6); + $num = random(1,2*$den-1,1); +} until gcd($num,$den)==1; +$angle[0] = specialAngle($num*pi/$den); + +@r = (); +do { + $n = random(3,5,1); + $r[0] = random(2,5,1); + $r[1] = $r[0]**$n; +} until $r[1]<=125; + +$angle[1] = specialAngle($n*Compute($angle[0])); +$angle[2] = $angle[1]; +while ($angle[2]>=Compute("2*pi")) { + $angle[2] = Compute($angle[2]-2*pi); +} +$angle[2] = specialAngle(Compute($angle[2])); + +@cosV = (); @sinV = (); +@xr = (); @yr = (); @yrAbs = (); +for my $i (0..1) { + $cosV[$i] = specialRadical(cos(Compute($angle[$i]))); + $sinV[$i] = specialRadical(sin(Compute($angle[$i]))); + $xr[$i] = specialRadical(Compute($cosV[$i]*$r[$i])); + $yr[$i] = specialRadical(Compute($sinV[$i]*$r[$i])); + $yrAbs[$i] = specialRadical(abs(Compute($sinV[$i]*$r[$i]))); +} + +if ($cosV[0]>0) { + $Q = ($sinV[0]>0) ? "I" : "IV"; +} else { + $Q = ($sinV[0]>0) ? "II" : "III"; +} + +Context()->variables->add(i=>"Real"); +@p = (); +$p[0] = ($yr[0]>0) ? Formula("$xr[0]+$yr[0]*i") : Formula("$xr[0]-$yrAbs[0]*i"); +if ($yr[1]==0) { + $p[1] = $xr[1]; +} else { + $p[1] = ($yr[1]>0) ? Formula("$xr[1]+$yr[1]*i") : Formula("$xr[1]-$yrAbs[1]*i"); +} + +@com = (); +$com[0] = Formula("$r[0]*(cos($angle[0])+i*sin($angle[0]))"); +$com[1] = Formula("$r[1]*(cos($angle[2])+i*sin($angle[2]))"); + +$s1 = specialAngle(arccos(Compute($cosV[0]))); + + + +package my::Complex; +our @ISA = ('Value::Complex'); + +sub cis { + my $z = shift; + return cos($z) + main::i * sin($z); +} + +package main; + +Context("Complex"); + +Context()->{value}{Complex} = 'my::Complex'; +Context()->constants->set(i => {value => my::Complex->new(0,1)}); +Context()->functions->add(cis => { + class => 'Parser::Function::complex', TeX => '\operatorname{cis}', + complex => 1, isCommand => 1 +}); + +sub cis {Parser::Function->call("cis", my::Complex->new(@_))} + +Context()->flags->set(reduceConstantFunctions => 0); + +@c = (); +$c[0] = Formula("$r[0]*cis($angle[0])"); +$c[1] = Formula("$r[1]*cis($angle[2])"); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Do the calculation. Write your answer in the form of [`a+b\operatorname{i}`]. + + [`` \left([$p[0]]\right)^{[$n]}= ``][________________________]{$p[1]} + +END_PGML + +############################################## + +Context("Fraction"); +$s2 = ""; +if ( Compute($angle[2]) != Compute($angle[1]) ) { + $s2 = "&= $r[1] \left( \cos\left(".$angle[2]->TeX."\right)+i\sin\left(".$angle[2]->TeX."\right) \right) \\"; +} + +BEGIN_PGML_SOLUTION + +If [`z=r\left(\cos(\theta)+i\sin(\theta)\right)`], then + + [`` z^n=r^n\left(\cos(n\theta)+i\sin(n\theta)\right) ``]. + +To use this formula, first, we have to convert [`[$p[0]]`] to polar form. + +###Converting [`[$p[0]]`] to polar form + +For [`z=x+yi`], [`r=\sqrt{x^2+y^2}`]. + +For [`[$p[0]]`], we have: + + [``\begin{aligned} + r &= \sqrt{\left([$xr[0]]\right)^2+\left([$yr[0]]\right)^2} \\ + &= [$r[0]] + \end{aligned}``] + +Now we can re-write [`[$p[0]]`] as [`[$r[0]]\left([$cosV[0]]+\left([$sinV[0]]\right)i\right)`]. + +To change [`[$r[0]]\left([$cosV[0]]+\left([$sinV[0]]\right)i\right)`] to the format of [`r(\cos(\theta)+i\sin(\theta))`], we need to find an angle which makes [`\cos(\theta)=[$cosV[0]]`] true. We have: + + [`` \theta = \cos^{-1}\left([$cosV[0]]\right) = [$s1] ``] + +Since [`[$p[0]]`] is in Quadrant [$Q], we can determine that [`\theta=[$angle[0]]`]. + +We have done the following conversion: + + [`` [$p[0]]=[$com[0]]=[$c[0]] ``] + +###Calculating n^{th} power + + [``\begin{aligned} + z^{[$n]} &= \left([$c[0]]\right)^{[$n]} \\ + &= \left([$com[0]]\right)^{[$n]} \\ + &= [$r[0]]^{[$n]}\left( \cos\left([$n]\cdot[$angle[0]]\right)+i\sin\left([$n]\cdot[$angle[0]]\right) \right) \\ + &= [$r[1]]\left( \cos\left([$angle[1]]\right)+i\sin\left([$angle[1]]\right) \right) \\ + [$s2] &= [$c[1]] + \end{aligned}``] + +###Converting to [`a+bi`] form + + [``\begin{aligned} + [$c[1]] + &= [$r[1]]\left( \cos\left([$angle[2]]\right)+i\sin\left([$angle[2]]\right) \right) \\ + &= [$r[1]]\cdot \cos\left([$angle[2]]\right) + i\cdot[$r[1]]\cdot\sin\left([$angle[2]]\right) \\ + &= [$p[1]] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/PolarComplex/CisOperations40.pg b/Contrib/PCC/Trigonometry/PolarComplex/CisOperations40.pg new file mode 100644 index 0000000000..b089e3e274 --- /dev/null +++ b/Contrib/PCC/Trigonometry/PolarComplex/CisOperations40.pg @@ -0,0 +1,163 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +do { + $denO = list_random(3,4,6); + $numO = random(1,2*$denO-1,1); +} until gcd($numO,$denO)==1; +$angleO = specialAngle($numO*pi/$denO); + +@num = (); +@den = (); +@angle = (); +@com = (); +$n = random(2,4,1); +$rn = random(2,5,1); +$r = $rn**$n; + +Context()->variables->add(i=>"Real"); +for my $k (0..$n-1) { + $angle[$k] = specialAngle(Compute($angleO/$n+2*$k*pi/$n),(1..24)); + $com[$k] = Formula("$rn*(cos($angle[$k])+i*sin($angle[$k]))"); +} + +package my::Complex; +our @ISA = ('Value::Complex'); + +sub cis { + my $z = shift; + return cos($z) + main::i * sin($z); +} + +package main; + +Context("Complex"); + +Context()->{value}{Complex} = 'my::Complex'; +Context()->constants->set(i => {value => my::Complex->new(0,1)}); +Context()->functions->add(cis => { + class => 'Parser::Function::complex', TeX => '\operatorname{cis}', + complex => 1, isCommand => 1 +}); + +sub cis {Parser::Function->call("cis", my::Complex->new(@_))} + +Context()->flags->set(reduceConstantFunctions => 0); + +$comO = Formula("$r*cis($angleO)"); + +@ans = (); +for my $k (0..$n-1) { + $ans[$k] = Formula("$rn*cis($angle[$k])"); +} +$ansL = List(@ans); + +if ($n==2) { + $th = "square roots"; +} elsif ($n==3) { + $th = "cube roots"; +} else { + $th = "4th roots"; +} + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Do the following calculation. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + +Find all [$th] of [` z=[$comO]`]. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use commas to separate your answers.' +)@]** + + roots: [___________________________________]{$ansL} + +END_PGML + +############################################## + +Context("Fraction"); +$s1 = specialAngle(Compute($angleO/$n),(1..24)); +($n0,$d0) = Fraction(2,$n)->reduce->value; +if ($d0==1) { + $s2 = ($n0==1) ? "k\pi" : "$n0 k\pi"; +} else { + $s2 = ($n0==1) ? "\frac{k\pi}{$d0}" : "\frac{$n0 k\pi}{$d0}"; +} +$s3 = "0, "; +for my $i (1..$n-1) { + $s3 .= "$i, "; +} +$s3 = substr($s3,0,length($s3)-2); + +BEGIN_PGML_SOLUTION + +For [`z=r\left(\cos(\theta)+i\sin(\theta)\right)`], its [$th] are + + [`` z^{\frac{1}{n}}=r^{\frac{1}{n}}\left( \cos\left(\frac{\theta}{n}+\frac{2k\pi}{n}\right)+i\sin\left(\frac{\theta}{n}+\frac{2k\pi}{n}\right) \right) ``], + +where [`k=0,1,...,n-1`]. + +We have: + + [``\begin{aligned} + z^{\frac{1}{[$n]}} &=[$r]^{\frac{1}{[$n]}}\left( \cos\left(\frac{[$angleO]}{[$n]}+\frac{2k\pi}{[$n]}\right)+i\sin\left(\frac{[$angleO]}{[$n]}+\frac{2k\pi}{[$n]}\right) \right) \\ + &= [$rn]\left( \cos\left([$s1]+[$s2]\right) + i\sin\left([$s1]+[$s2]\right) \right) \\ + \end{aligned}``] + +Substitute in [`k=[$s3]`], the roots of [`z`] are + + [``[$ansL]``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/PolarComplex/ComplexAbsoluteValue10.pg b/Contrib/PCC/Trigonometry/PolarComplex/ComplexAbsoluteValue10.pg new file mode 100644 index 0000000000..42cfc9a5c5 --- /dev/null +++ b/Contrib/PCC/Trigonometry/PolarComplex/ComplexAbsoluteValue10.pg @@ -0,0 +1,80 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Complex"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->noreduce('(-x)-y','(-x)+y'); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$multiple = 1; +$a = random(-1,1,2)*$multiple*$triples[$in][0]; +$b = random(-1,1,2)*$multiple*$triples[$in][1]; +$c = $multiple*$triples[$in][2]; + +$num = Compute("$a+$b*i")->reduce; + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Calculate the absolute value of [`[$num]`]: + + [`` \left|[$num]\right|= ``][___________]{$c} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \left|[$num]\left| &= \sqrt{([$a])^2+([$b])^2} \\ + &= [$c] +\end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/PolarComplex/PolarToRectangular10.pg b/Contrib/PCC/Trigonometry/PolarComplex/PolarToRectangular10.pg new file mode 100644 index 0000000000..ddb26a877c --- /dev/null +++ b/Contrib/PCC/Trigonometry/PolarComplex/PolarToRectangular10.pg @@ -0,0 +1,89 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$den = 2; +$num = random(-10,10,1); +$angle = specialAngle($num*pi/$den); +$a = cos(Compute($angle)); +$b = sin(Compute($angle)); +$r = random(2,10,1); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->are(i=>"Real"); + +if ($a==0) { + $br = $b*$r; + $ans = Formula("$br*i"); +} elsif ($b==0) { + $ar = $a*$r; + $ans = Formula("$ar"); +} + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Convert from polar form to rectangular form: + + [`` [$r] \left( \cos\left([$angle]\right) +i\sin\left([$angle]\right) \right)= ``][___________________]{$ans} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$r] \left( \cos\left([$angle]\right) +i\sin\left([$angle]\right) \right) + &= [$r] ([$a]+([$b])i) \\ + &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/PolarComplex/PolarToRectangular20.pg b/Contrib/PCC/Trigonometry/PolarComplex/PolarToRectangular20.pg new file mode 100644 index 0000000000..3a5d724c3c --- /dev/null +++ b/Contrib/PCC/Trigonometry/PolarComplex/PolarToRectangular20.pg @@ -0,0 +1,86 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +############################################## + +Context("Complex"); + +do { + $den = list_random(3,4,6); + $num = non_zero_random(-(2*$den-1),(2*$den-1)); +} until gcd($den,$num)==1; +$angle = specialAngle($num*pi/$den); + +$r = random(2,10,1); + +$ans = Formula(specialRadical("$r*cos($angle)+$r*i sin($angle)")); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->are(i=>"Real"); + +$ans = Formula("$ans"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Convert from polar form to rectangular form. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|sqrt( )|]* for "square root". For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +)@]** + + [`` [$r] \left( \cos\left([$angle]\right) +i\sin\left([$angle]\right) \right)= ``][_______________________]{$ans} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$r] \left( \cos\left([$angle]\right) +i\sin\left([$angle]\right) \right) + &= [$r] \left([$a]+i\left([$b]\right)\right) \\ + &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/PolarComplex/RectangularToPolar10.pg b/Contrib/PCC/Trigonometry/PolarComplex/RectangularToPolar10.pg new file mode 100644 index 0000000000..408fc4c6a9 --- /dev/null +++ b/Contrib/PCC/Trigonometry/PolarComplex/RectangularToPolar10.pg @@ -0,0 +1,123 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$den = 2; +$num = random(0,3,1); +$angle = specialAngle($num*pi/$den); +$x = cos(Compute($angle)); +$y = sin(Compute($angle)); +$r = random(2,10,1); + +$xr = $x*$r; +$yr = $y*$r; + +Context()->variables->add(i=>"Real"); +if ($x==0) { + $p = Formula("$yr*i"); +} elsif ($y==0) { + $p = Formula("$xr"); +} + +$com = Formula("$r*(cos($angle)+i*sin($angle))"); + +package my::Complex; +our @ISA = ('Value::Complex'); + +sub cis { + my $z = shift; + return cos($z) + main::i * sin($z); +} + +package main; + +Context("Complex"); + +Context()->{value}{Complex} = 'my::Complex'; +Context()->constants->set(i => {value => my::Complex->new(0,1)}); +Context()->functions->add(cis => { + class => 'Parser::Function::complex', TeX => '\operatorname{cis}', + complex => 1, isCommand => 1 +}); + +sub cis {Parser::Function->call("cis", my::Complex->new(@_))} + +$ans = Formula("$r*cis($angle)"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Convert the complex number to polar complex form. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + + [`` [$p]= ``][________________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +For [`z=x+yi`], [`r=\sqrt{x^2+y^2}`]. + +For [`[$p]`], we have: + + [``\begin{aligned} + r &= \sqrt{\left([$xr]\right)^2+\left([$yr]\right)^2} \\ + &= [$r] + \end{aligned}``] + +Now we can re-write [`[$p]`] as [`[$r]([$x]+([$y])i)`]. + +To change [`[$r]([$x]+([$y])i)`] to the format of [`r(\cos(\theta)+i\sin(\theta))`], we need to find an angle which makes [`\cos(\theta)=[$x]`] and [`\sin(\theta)=[$y]`] true. By the knowledge of Unit Circle, we can see [`\theta=[$angle]`]. + +Solution is: + + [`` [$p]=[$com]=[$ans] ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/PolarComplex/RectangularToPolar20.pg b/Contrib/PCC/Trigonometry/PolarComplex/RectangularToPolar20.pg new file mode 100644 index 0000000000..7ab7ef7f2d --- /dev/null +++ b/Contrib/PCC/Trigonometry/PolarComplex/RectangularToPolar20.pg @@ -0,0 +1,135 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +do { + $den = list_random(3,4,6); + $num = random(1,2*$den-1,1); +} until gcd($num,$den)==1; +$angle = specialAngle($num*pi/$den); +$cosV = specialRadical(cos(Compute($angle))); +$sinV = specialRadical(sin(Compute($angle))); +$r = Formula(random(2,10,1)); + +$xr = specialRadical(Compute($cosV*$r)); +$yr = specialRadical(Compute($sinV*$r)); +$yrAbs = specialRadical(abs(Compute($sinV*$r))); + +if ($cosV>0) { + $Q = ($sinV>0) ? "I" : "IV"; +} else { + $Q = ($sinV>0) ? "II" : "III"; +} + + +Context()->variables->add(i=>"Real"); +$p = ($yr>0) ? Formula("$xr+$yr*i") : Formula("$xr-$yrAbs*i"); +$com = Formula("$r*(cos($angle)+i*sin($angle))"); + +$s1 = specialAngle(arccos(Compute($cosV))); + +package my::Complex; +our @ISA = ('Value::Complex'); + +sub cis { + my $z = shift; + return cos($z) + main::i * sin($z); +} + +package main; + +Context("Complex"); + +Context()->{value}{Complex} = 'my::Complex'; +Context()->constants->set(i => {value => my::Complex->new(0,1)}); +Context()->functions->add(cis => { + class => 'Parser::Function::complex', TeX => '\operatorname{cis}', + complex => 1, isCommand => 1 +}); + +sub cis {Parser::Function->call("cis", my::Complex->new(@_))} + +$ans = Formula("$r*cis($angle)"); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Convert the complex number to polar complex form. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + + [`` [$p]= ``][________________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +For [`z=x+yi`], [`r=\sqrt{x^2+y^2}`]. + +For [`[$p]`], we have: + + [``\begin{aligned} + r &= \sqrt{\left([$xr]\right)^2+\left([$yr]\right)^2} \\ + &= [$r] + \end{aligned}``] + +Now we can re-write [`[$p]`] as [`[$r]\left([$cosV]+\left([$sinV]\right)i\right)`]. + +To change [`[$r]\left([$cosV]+\left([$sinV]\right)i\right)`] to the format of [`r(\cos(\theta)+i\sin(\theta))`], we need to find an angle which makes [`\cos(\theta)=[$cosV]`] true. We have: + + [`` \theta = \cos^{-1}\left([$cosV]\right) = [$s1] ``] + +Since [`[$p]`] is in Quadrant [$Q], we can determine that [`\theta=[$angle]`]. + +Solution is: + + [`` [$p]=[$com]=[$ans] ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength10.pg b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength10.pg new file mode 100644 index 0000000000..02dfa5764e --- /dev/null +++ b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength10.pg @@ -0,0 +1,172 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$a = random(2,10,1); +$b = Formula("$a*sqrt(3)"); +$c = 2*$a; + +$Ax = 0; +$Ay = 0; +$Bx = sqrt(3); +$By = 1; +$Cx = $Bx; +$Cy = 0; + +$cushion = 0.2; + +$Dx = $Ax; +$Dy = $By+$cushion; +$Ex = $Bx; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$xmin = -$cushion; #The viewing window +$xmax = $Ey+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','middle','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+0.1); + $picture[$i]->lineTo($Cx-0.1,$Cy+0.1,blue,3); + $picture[$i]->lineTo($Cx-0.1,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"30",'blue','left','bottom','large')); + + $picture[$i]->lb( new Label($Bx+$xShift/5,($By+$Cy)/2,"$a",'blue','left','middle','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"x",'blue','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"y",'blue','right','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+0.1); +$picture[1]->lineTo($Fx-0.1,$Fy+0.1,blue,3); +$picture[1]->lineTo($Fx-0.1,$Fy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"30",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->lb( new Label($Ex+$xShift/5,($Ey+$Fy)/2,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a sqrt(3)",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"2a",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is $a. The length of AB is y. Angle A is 30 degrees."; + +$text[1] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is $a. The length of AB is y. Angle A is 30 degrees. Angle B is 60 degrees. There is a 30-60-90 right triangle, where the side opposite to 30 degrees is marked as a, the side opposite to 60 degrees is marked as a*sqrt(3), the hypotenuse is marked as 2a."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`30-60-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` x =``] [_____________]{$b} + + [`` y =``] [_____________]{$c} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +In the given 30-60-90 right triangle, its sides have the following relationship: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Note that: + + [``\begin{aligned} + a &= [$a] \\ + a \sqrt{3} &= x \\ + 2a &= y + \end{aligned}``] + +Now we can solve for [`x`] and [`y`] by proportion: + + [``\begin{aligned} + a &= [$a] \\ + x &= a\sqrt{3}=[$b] \\ + y &=2a=2([$a])=[$c] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength20.pg b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength20.pg new file mode 100644 index 0000000000..3f85fd399d --- /dev/null +++ b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength20.pg @@ -0,0 +1,173 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$a = random(2,10,1); +$b = Formula("$a*sqrt(3)"); +$c = 2*$a; + +$Ax = 0; +$Ay = 0; +$Bx = sqrt(3); +$By = 1; +$Cx = $Bx; +$Cy = 0; + +$cushion = 0.2; + +$Dx = $Ax; +$Dy = $By+$cushion; +$Ex = $Bx; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$xmin = -$cushion; #The viewing window +$xmax = $Ey+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','middle','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+0.1); + $picture[$i]->lineTo($Cx-0.1,$Cy+0.1,blue,3); + $picture[$i]->lineTo($Cx-0.1,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"30",'blue','left','bottom','large')); + + $picture[$i]->lb( new Label($Bx+$xShift/5,($By+$Cy)/2,"y",'blue','left','middle','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"x",'blue','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"$c",'blue','right','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+0.1); +$picture[1]->lineTo($Fx-0.1,$Fy+0.1,blue,3); +$picture[1]->lineTo($Fx-0.1,$Fy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"30",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->lb( new Label($Ex+$xShift/5,($Ey+$Fy)/2,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a sqrt(3)",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"2a",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is y. The length of AB is $c. Angle A is 30 degrees."; + +$text[1] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is y. The length of AB is $c. Angle A is 30 degrees. Angle B is 60 degrees. There is a 30-60-90 right triangle, where the side opposite to 30 degrees is marked as a, the side opposite to 60 degrees is marked as a*sqrt(3), the hypotenuse is marked as 2a."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`30-60-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` x =``] [_____________]{$b} + + [`` y =``] [_____________]{$a} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +In the given 30-60-90 right triangle, its sides have the following relationship: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Note that: + + [``\begin{aligned} + 2a &= [$c] \\ + a &= y \\ + a \sqrt{3} &= x + \end{aligned}``] + +Since [`2a=[$c]`], [`a=\frac{[$c]}{2}=[$a]`] + +Now we can solve for [`x`] and [`y`]: + + [``\begin{aligned} + y &= a= [$a] \\ + x &= a\sqrt{3}=[$b] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength30.pg b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength30.pg new file mode 100644 index 0000000000..901e3901a3 --- /dev/null +++ b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength30.pg @@ -0,0 +1,183 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$k = random(2,10,1); +$k2 = 2*$k; +$b = 3*$k; +$a = Formula("$k*sqrt(3)"); +$c = Formula("$k2*sqrt(3)"); + +$Ax = 0; +$Ay = 0; +$Bx = sqrt(3); +$By = 1; +$Cx = $Bx; +$Cy = 0; + +$cushion = 0.2; + +$Dx = $Ax; +$Dy = $By+$cushion; +$Ex = $Bx; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$xmin = -$cushion; #The viewing window +$xmax = $Ey+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','middle','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+0.1); + $picture[$i]->lineTo($Cx-0.1,$Cy+0.1,blue,3); + $picture[$i]->lineTo($Cx-0.1,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"30",'blue','left','bottom','large')); + + $picture[$i]->lb( new Label($Bx+$xShift/5,($By+$Cy)/2,"y",'blue','left','middle','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"$b",'blue','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"x",'blue','right','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+0.1); +$picture[1]->lineTo($Fx-0.1,$Fy+0.1,blue,3); +$picture[1]->lineTo($Fx-0.1,$Fy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"30",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->lb( new Label($Ex+$xShift/5,($Ey+$Fy)/2,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a sqrt(3)",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"2a",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is $b. Angle C is a right angle. Side CB goes up, and the length is x. The length of AB is y. Angle A is 30 degrees."; + +$text[1] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is $b. Angle C is a right angle. Side CB goes up, and the length is x. The length of AB is y. Angle A is 30 degrees. Angle B is 60 degrees. There is a 30-60-90 right triangle, where the side opposite to 30 degrees is marked as a, the side opposite to 60 degrees is marked as a*sqrt(3), the hypotenuse is marked as 2a."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`30-60-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` x =``] [_____________]{$c} + + [`` y =``] [_____________]{$a} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +In the given 30-60-90 right triangle, its sides have the following relationship: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Note that: + + [``\begin{aligned} + a \sqrt{3} &= [$b] \\ + a \sqrt{3} &= y \\ + 2a &= x + \end{aligned}``] + +By [`a \sqrt{3} &= [$b]`], we can solve for [`a`]: + + [``\begin{aligned} + a\sqrt{3} &= [$b] \\ + a &= \frac{[$b]}{\sqrt{3}} \\ + a &= \frac{[$b]\cdot \sqrt{3}}{\sqrt{3}\cdot \sqrt{3}} \\ + a &= \frac{[$b]\cdot \sqrt{3}}{3} \\ + a &= [$a] + \end{aligned}``] + +Next, we can solve for [`x`] and [`y`]: + + [``\begin{aligned} + y &=a=[$a] \\ + x &= 2a = 2\cdot[$a]=[$c] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength40.pg b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength40.pg new file mode 100644 index 0000000000..5052183295 --- /dev/null +++ b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength40.pg @@ -0,0 +1,172 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$a = random(2,10,1); +$b = $a; +$c = Formula("$a*sqrt(2)"); + +$Ax = 0; +$Ay = 0; +$Bx = 1; +$By = 1; +$Cx = 1; +$Cy = 0; + +$cushion = 0.2; + +$Dx = $Ax+$cushion; +$Dy = $By+$cushion; +$Ex = $Bx+$cushion; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$xmin = -$cushion; #The viewing window +$xmax = $Ey+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/20; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','middle','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+0.1); + $picture[$i]->lineTo($Cx-0.1,$Cy+0.1,blue,3); + $picture[$i]->lineTo($Cx-0.1,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"45",'blue','left','bottom','large')); + + $picture[$i]->lb( new Label($Bx+$xShift/5,($By+$Cy)/2,"$a",'blue','left','middle','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"x",'blue','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"y",'blue','right','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift,"45",'blue','right','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+0.1); +$picture[1]->lineTo($Fx-0.1,$Fy+0.1,blue,3); +$picture[1]->lineTo($Fx-0.1,$Fy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"45",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift,"45",'blue','right','top','large')); + +$picture[1]->lb( new Label($Ex+$xShift/5,($Ey+$Fy)/2,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"a sqrt(2)",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is $a. The length of AB is y. Angle A is 45 degrees."; + +$text[1] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is $a. The length of AB is y. Both Angle A and Angle B are 45 degrees. There is a 45-45-90 right triangle, where the legs are marked as a, the hypotenuse is marked as a sqrt(2)."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`45-45-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` x =``] [_____________]{$b} + + [`` y =``] [_____________]{$c} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +In the given 45-45-90 right triangle, its sides have the following relationship: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Note that: + + [``\begin{aligned} + a &= [$a] \\ + a &= x \\ + a \sqrt{2} &= y + \end{aligned}``] + +Now we can solve for [`x`] and [`y`] by proportion: + + [``\begin{aligned} + a &= [$a] \\ + x &= a =[$b] \\ + y &=a \sqrt{2}=[$c] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength50.pg b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength50.pg new file mode 100644 index 0000000000..2d5663fd21 --- /dev/null +++ b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength50.pg @@ -0,0 +1,177 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$k = random(2,10,1); +$c = 2*$k; +$a = Formula("$k*sqrt(2)"); +$b = $a; + +$Ax = 0; +$Ay = 0; +$Bx = 1; +$By = 1; +$Cx = 1; +$Cy = 0; + +$cushion = 0.2; + +$Dx = $Ax+$cushion; +$Dy = $By+$cushion; +$Ex = $Bx+$cushion; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$xmin = -$cushion; #The viewing window +$xmax = $Ey+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/20; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','middle','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+0.1); + $picture[$i]->lineTo($Cx-0.1,$Cy+0.1,blue,3); + $picture[$i]->lineTo($Cx-0.1,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"45",'blue','left','bottom','large')); + + $picture[$i]->lb( new Label($Bx+$xShift/5,($By+$Cy)/2,"x",'blue','left','middle','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"y",'blue','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"$c",'blue','right','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift,"45",'blue','right','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+0.1); +$picture[1]->lineTo($Fx-0.1,$Fy+0.1,blue,3); +$picture[1]->lineTo($Fx-0.1,$Fy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"45",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift,"45",'blue','right','top','large')); + +$picture[1]->lb( new Label($Ex+$xShift/5,($Ey+$Fy)/2,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"a sqrt(2)",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is y. Angle C is a right angle. Side CB goes up, and the length is y. The length of AB is $c. Angle A is 45 degrees."; + +$text[1] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is y. Angle C is a right angle. Side CB goes up, and the length is y. The length of AB is $c. Both Angle A and Angle B are 45 degrees. There is a 45-45-90 right triangle, where the legs are marked as a, the hypotenuse is marked as a sqrt(2)."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`45-45-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` x =``] [_____________]{$b} + + [`` y =``] [_____________]{$a} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +In the given 45-45-90 right triangle, its sides have the following relationship: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Note that: + + [``\begin{aligned} + a &= x \\ + a &= y \\ + a \sqrt{2} &= [$c] + \end{aligned}``] + +By [`a \sqrt{2} &= [$c]`], we can solve for [`a`]: + + [``\begin{aligned} + a\sqrt{2} &= [$c] \\ + a &= \frac{[$c]}{\sqrt{2}} \\ + a &= \frac{[$c]\cdot \sqrt{2}}{\sqrt{2}\cdot \sqrt{2}} \\ + a &= \frac{[$c]\cdot \sqrt{2}}{2} \\ + a &= [$a] + \end{aligned}``] + +Since [`x=a`] and [`y=a`], [`x=y=[$a]`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength60.pg b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength60.pg new file mode 100644 index 0000000000..db3e5099f2 --- /dev/null +++ b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength60.pg @@ -0,0 +1,220 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$k = random(2,10,1); +$k2 = 2*$k; +$b = 3*$k; +$a = Formula("$k*sqrt(3)"); +$c = Formula("$k2*sqrt(3)"); +$cj = $a; +$bj = Formula("$k*sqrt(6)"); + +$Ax = 0; +$Ay = 0; +$Bx = sqrt(3); +$By = 1; +$Cx = $Bx; +$Cy = 0; +$Jx = $Cx + $By; +$Jy = $Cy; + +$cushion = 0.3; + +$Dx = $Ax; +$Dy = $By+2*$cushion; +$Ex = $Bx; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$Hx = $Fx+$cushion; +$Hy = $Fy; +$Gx = $Hx; +$Gy = $Hy+1; +$Ix = $Hx+1; +$Iy = $Hy; + + +$xmin = -$cushion; #The viewing window +$xmax = $Ix+3*$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Cx,$Cy); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Jx,$Jy,blue,3); + $picture[$i]->lineTo($Bx,$By,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','center','top','large')); + $picture[$i]->lb( new Label($Jx,$Jy,"D",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+$xShift/2); + $picture[$i]->lineTo($Cx-$xShift/2,$Cy+$xShift/2,blue,3); + $picture[$i]->lineTo($Cx-$xShift/2,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"30",'blue','left','bottom','large')); + $picture[$i]->lb( new Label($Jx-$xShift/2,$Jy,"45",'blue','right','bottom','large')); + + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"$b",'blue','center','top','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"60",'blue','right','top','large')); +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"45",'blue','left','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+$xShift/2); +$picture[1]->lineTo($Fx-$xShift/2,$Fy+$xShift/2,blue,3); +$picture[1]->lineTo($Fx-$xShift/2,$Fy,blue,3); + +$picture[1]->moveTo($Gx,$Gy); +$picture[1]->lineTo($Hx,$Hy,blue,3); +$picture[1]->lineTo($Ix,$Iy,blue,3); +$picture[1]->lineTo($Gx,$Gy,blue,3); + +$picture[1]->moveTo($Hx,$Hy+$xShift/2); +$picture[1]->lineTo($Hx+$xShift/2,$Hy+$xShift/2,blue,3); +$picture[1]->lineTo($Hx+$xShift/2,$Hy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"30",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift/2,"60",'blue','right','top','large')); +$picture[1]->lb( new Label($Gx,$Gy-$xShift/3*2,"45",'blue','left','top','large')); +$picture[1]->lb( new Label($Ix-$xShift/2,$Iy,"45",'blue','right','bottom','large')); + +$picture[1]->lb( new Label($Ex-$xShift/5,$Fy+($Ey-$Fy)/3,"a",'blue','right','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a sqrt(3)",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"2a",'blue','right','bottom','large')); + +$picture[1]->lb( new Label($Hx+$xShift/5,$Hy+($Gy-$Hy)/3,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Gx+$Ix)/2,($Gy+$Iy)/2,"a sqrt(2)",'blue','left','bottom','large')); +$picture[1]->lb( new Label(($Hx+$Ix)/2,$Hy,"a",'blue','center','top','large')); + +$text[0] = "Two right triangles share a side. In triangle ABC, AC is horizontal (A to the left and C to the right), BC is vertical, and AB is the hypotenuse. Angle A is 30 degrees. Angle BCA is 90 degrees. Triangle BCD is to the right of triangle ABC, sharing the side BC. Angle BCD is 90 degrees. Point D is to the right of C. Angle D is 45 degrees. Side AC is marked as $b units."; + +$text[1] = "Two right triangles share a side. In triangle ABC, AC is horizontal (A to the left and C to the right), BC is vertical, and AB is the hypotenuse. Angle A is 30 degrees. Angle BCA is 90 degrees. Triangle BCD is to the right of triangle ABC, sharing the side BC. Angle BCD is 90 degrees. Point D is to the right of C. Angle D is 45 degrees. Side AC is marked as $b units. Above those two triangles, there is a 30-60-90 right triangle, with sides marked as a, a sqrt(3) and 2a. There is a 45-45-90 right triangle, with sides marked as a, a, a sqrt(2)."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`30-60-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` BD =``] [_____________]{$bj} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Those two given triangles can be broken into a 30-60-90 right triangle and a 45-45-90 right triangle: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +In the 30-60-90 right triangle, note that + + [``\begin{aligned} + a \sqrt{3} &= [$b] \\ + a &= BC + \end{aligned}``] + +With [`a \sqrt{3} = [$b]`], we can solve for [`a`]: + + [``\begin{aligned} + a\sqrt{3} &= [$b] \\ + a &= \frac{[$b]}{\sqrt{3}} \\ + a &= \frac{[$b]\cdot \sqrt{3}}{\sqrt{3}\cdot \sqrt{3}} \\ + a &= \frac{[$b]\cdot \sqrt{3}}{3} \\ + a &= [$a] + \end{aligned}``] + +So, [`BC = a = [$a]`]. + +In the 45-45-90 right triangle, note that: + + [``\begin{aligned} + a &= BC \\ + a \sqrt{2} &= BD + \end{aligned}``] + +Since [`BC=a=[$a]`], we have: + + [``\begin{aligned} + BD &= a \sqrt{2} \\ + &= [$a] \cdot \sqrt{2} \\ + &= [$bj] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength70.pg b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength70.pg new file mode 100644 index 0000000000..7863d40918 --- /dev/null +++ b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength70.pg @@ -0,0 +1,217 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$k = random(2,10,1); +$bj = 2*$k; +$a = Formula("$k*sqrt(2)"); +$b = Formula("$k*sqrt(6)"); + +$Ax = 0; +$Ay = 0; +$Bx = sqrt(3); +$By = 1; +$Cx = $Bx; +$Cy = 0; +$Jx = $Cx + $By; +$Jy = $Cy; + +$cushion = 0.3; + +$Dx = $Ax; +$Dy = $By+2*$cushion; +$Ex = $Bx; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$Hx = $Fx+$cushion; +$Hy = $Fy; +$Gx = $Hx; +$Gy = $Hy+1; +$Ix = $Hx+1; +$Iy = $Hy; + + +$xmin = -$cushion; #The viewing window +$xmax = $Ix+3*$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Cx,$Cy); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Jx,$Jy,blue,3); + $picture[$i]->lineTo($Bx,$By,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','center','top','large')); + $picture[$i]->lb( new Label($Jx,$Jy,"D",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+$xShift/2); + $picture[$i]->lineTo($Cx-$xShift/2,$Cy+$xShift/2,blue,3); + $picture[$i]->lineTo($Cx-$xShift/2,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"30",'blue','left','bottom','large')); + $picture[$i]->lb( new Label($Jx-$xShift/2,$Jy,"45",'blue','right','bottom','large')); + + $picture[$i]->lb( new Label(($Bx+$Jx)/2,($By+$Jy)/2,"$bj",'blue','left','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"60",'blue','right','top','large')); +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"45",'blue','left','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+$xShift/2); +$picture[1]->lineTo($Fx-$xShift/2,$Fy+$xShift/2,blue,3); +$picture[1]->lineTo($Fx-$xShift/2,$Fy,blue,3); + +$picture[1]->moveTo($Gx,$Gy); +$picture[1]->lineTo($Hx,$Hy,blue,3); +$picture[1]->lineTo($Ix,$Iy,blue,3); +$picture[1]->lineTo($Gx,$Gy,blue,3); + +$picture[1]->moveTo($Hx,$Hy+$xShift/2); +$picture[1]->lineTo($Hx+$xShift/2,$Hy+$xShift/2,blue,3); +$picture[1]->lineTo($Hx+$xShift/2,$Hy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"30",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift/2,"60",'blue','right','top','large')); +$picture[1]->lb( new Label($Gx,$Gy-$xShift/3*2,"45",'blue','left','top','large')); +$picture[1]->lb( new Label($Ix-$xShift/2,$Iy,"45",'blue','right','bottom','large')); + +$picture[1]->lb( new Label($Ex-$xShift/5,$Fy+($Ey-$Fy)/3,"a",'blue','right','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a sqrt(3)",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"2a",'blue','right','bottom','large')); + +$picture[1]->lb( new Label($Hx+$xShift/5,$Hy+($Gy-$Hy)/3,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Gx+$Ix)/2,($Gy+$Iy)/2,"a sqrt(2)",'blue','left','bottom','large')); +$picture[1]->lb( new Label(($Hx+$Ix)/2,$Hy,"a",'blue','center','top','large')); + +$text[0] = "Two right triangles share a side. In triangle ABC, AC is horizontal (A to the left and C to the right), BC is vertical, and AB is the hypotenuse. Angle A is 30 degrees. Angle BCA is 90 degrees. Triangle BCD is to the right of triangle ABC, sharing the side BC. Angle BCD is 90 degrees. Point D is to the right of C. Angle D is 45 degrees. Side BD is marked as $bj units."; + +$text[1] = "Two right triangles share a side. In triangle ABC, AC is horizontal (A to the left and C to the right), BC is vertical, and AB is the hypotenuse. Angle A is 30 degrees. Angle BCA is 90 degrees. Triangle BCD is to the right of triangle ABC, sharing the side BC. Angle BCD is 90 degrees. Point D is to the right of C. Angle D is 45 degrees. Side BD is marked as $bj units. Above those two triangles, there is a 30-60-90 right triangle, with sides marked as a, a sqrt(3) and 2a. There is a 45-45-90 right triangle, with sides marked as a, a, a sqrt(2)."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`30-60-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` AC =``] [_____________]{$b} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Those two given triangles can be broken into a 30-60-90 right triangle and a 45-45-90 right triangle: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +In the 45-45-90 right triangle, note that + + [``\begin{aligned} + a \sqrt{2} &= [$bj] \\ + a &= BC + \end{aligned}``] + +With [`a \sqrt{2} = [$bj]`], we can solve for [`a`]: + + [``\begin{aligned} + a\sqrt{2} &= [$bj] \\ + a &= \frac{[$bj]}{\sqrt{2}} \\ + a &= \frac{[$bj]\cdot \sqrt{2}}{\sqrt{2}\cdot \sqrt{2}} \\ + a &= \frac{[$bj]\cdot \sqrt{2}}{2} \\ + a &= [$a] + \end{aligned}``] + +So, [`BC = a = [$a]`]. + +In the 30-60-90 right triangle, note that: + + [``\begin{aligned} + a &= BC \\ + a \sqrt{3} &= AC + \end{aligned}``] + +Since [`BC=a=[$a]`], we have: + + [``\begin{aligned} + AC &= a \sqrt{3} \\ + &= [$a] \cdot \sqrt{3} \\ + &= [$b] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio10.pg b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio10.pg new file mode 100644 index 0000000000..fe9513622d --- /dev/null +++ b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio10.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +$Ax = 0; +$Ay = 0; +$Cx = sqrt(3); +$Cy = 0; +$Bx = $Cx; +$By = 1; + +$cushion = 0.2; + +$xmin = -$cushion; #The viewing window +$xmax = $Cx+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$picture[0]->moveTo($Cx,$Cy+0.1); +$picture[0]->lineTo($Cx-0.1,$Cy+0.1,blue,3); +$picture[0]->lineTo($Cx-0.1,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); +$picture[0]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx,($By+$Cy)/2,"1",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay,"sqrt(3)",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"2",'blue','right','bottom','large')); + +$picture[0]->lb( new Label($Ax+0.2,$Ay,"30",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By-0.1,"60",'blue','right','top','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is sqrt(3). Angle C is a right angle. Side CB goes up, and the length is 1. The length of AB is 2. Angle A is 30 degrees. Angle B is 60 degrees."; + +Context("LimitedRadical"); + +@prob = ( + ["\displaystyle \sin(30^{\circ})",Formula("1/2")], + ["\displaystyle \sin(60^{\circ})",Formula("sqrt(3)/2")], + ["\displaystyle \cos(30^{\circ})",Formula("sqrt(3)/2")], + ["\displaystyle \cos(60^{\circ})",Formula("1/2")], + ["\displaystyle \tan(30^{\circ})",Formula("sqrt(3)/3")], + ["\displaystyle \tan(60^{\circ})",Formula("sqrt(3)")], +); + +@perm = NchooseK(6,4); + + +########################################################## + +BEGIN_PGML + +Using your knowledge of [`30-60-90`] and [`45-45-90`] right triangles, write each trigonometry expression's exact value. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + + [`` [$prob[$perm[2]][0]] =``] [_____________]{$prob[$perm[2]][1]} + + [`` [$prob[$perm[3]][0]] =``] [_____________]{$prob[$perm[3]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +You should memorize the following right triangle with all angle measures and all side lengths. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Now we can tell all related trigonometry values in this right triangle: + + [`` \begin{aligned} + \sin(30^{\circ}) &= \frac{1}{2} &&\cos(30^{\circ}) = \frac{\sqrt{3}}{2} &&\tan(30^{\circ}) = \frac{1}{\sqrt{3}} = \frac{\sqrt{3}}{3} \\ + \sin(60^{\circ}) &= \frac{\sqrt{3}}{2} &&\cos(60^{\circ}) = \frac{1}{2} &&\tan(60^{\circ}) = \sqrt{3} + \end{aligned} ``] +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio20.pg b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio20.pg new file mode 100644 index 0000000000..870e175c0d --- /dev/null +++ b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio20.pg @@ -0,0 +1,148 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +$Ax = 0; +$Ay = 0; +$Cx = sqrt(3); +$Cy = 0; +$Bx = $Cx; +$By = 1; + +$cushion = 0.2; + +$xmin = -$cushion; #The viewing window +$xmax = $Cx+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$picture[0]->moveTo($Cx,$Cy+0.1); +$picture[0]->lineTo($Cx-0.1,$Cy+0.1,blue,3); +$picture[0]->lineTo($Cx-0.1,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); +$picture[0]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx,($By+$Cy)/2,"1",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay,"sqrt(3)",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"2",'blue','right','bottom','large')); + +$picture[0]->lb( new Label($Ax+0.2,$Ay,"30",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By-0.1,"60",'blue','right','top','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is sqrt(3). Angle C is a right angle. Side CB goes up, and the length is 1. The length of AB is 2. Angle A is 30 degrees. Angle B is 60 degrees."; + +Context("LimitedRadical"); + +@prob = ( + ["\displaystyle \sin\left(\frac{\pi}{6}\right)",Formula("1/2")], + ["\displaystyle \sin\left(\frac{\pi}{3}\right)",Formula("sqrt(3)/2")], + ["\displaystyle \cos\left(\frac{\pi}{6}\right)",Formula("sqrt(3)/2")], + ["\displaystyle \cos\left(\frac{\pi}{3}\right)",Formula("1/2")], + ["\displaystyle \tan\left(\frac{\pi}{6}\right)",Formula("sqrt(3)/3")], + ["\displaystyle \tan\left(\frac{\pi}{3}\right)",Formula("sqrt(3)")], +); + +@perm = NchooseK(6,4); + + +########################################################## + +BEGIN_PGML + +Using your knowledge of [`30-60-90`] and [`45-45-90`] right triangles, write each trigonometry expression's exact value. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + + [`` [$prob[$perm[2]][0]] =``] [_____________]{$prob[$perm[2]][1]} + + [`` [$prob[$perm[3]][0]] =``] [_____________]{$prob[$perm[3]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +You should memorize the following right triangle with all angle measures and all side lengths. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Also: + + [`` \begin{aligned} + \frac{\pi}{6} &= 30^{\circ}\\ + \frac{\pi}{3} &= 60^{\circ}\\ + \end{aligned} ``] + +Now we can tell all related trigonometry values in this right triangle: + + [`` \begin{aligned} + \sin\left(\frac{\pi}{6}\right) &= \frac{1}{2} &&\cos\left(\frac{\pi}{6}\right) = \frac{\sqrt{3}}{2} &&\tan\left(\frac{\pi}{6}\right) = \frac{1}{\sqrt{3}} = \frac{\sqrt{3}}{3} \\ + \sin\left(\frac{\pi}{3}\right) &= \frac{\sqrt{3}}{2} &&\cos\left(\frac{\pi}{3}\right) = \frac{1}{2} &&\tan\left(\frac{\pi}{3}\right) = \sqrt{3} + \end{aligned} ``] +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio30.pg b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio30.pg new file mode 100644 index 0000000000..3270349246 --- /dev/null +++ b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio30.pg @@ -0,0 +1,135 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +$Ax = 0; +$Ay = 0; +$Cx = 1; +$Cy = 0; +$Bx = $Cx; +$By = 1; + +$cushion = 0.2; + +$xmin = -$cushion; #The viewing window +$xmax = $Cx+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$picture[0]->moveTo($Cx,$Cy+0.05); +$picture[0]->lineTo($Cx-0.05,$Cy+0.05,blue,3); +$picture[0]->lineTo($Cx-0.05,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); +$picture[0]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx,($By+$Cy)/2,"1",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay,"1",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"sqrt(2)",'blue','right','bottom','large')); + +$picture[0]->lb( new Label($Ax+0.1,$Ay,"45",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By-0.1,"45",'blue','right','top','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is 1. Angle C is a right angle. Side CB goes up, and the length is 1. The length of AB is sqrt(2). Both Angle A and Angle B are 45 degrees."; + +Context("LimitedRadical"); + +@prob = ( + ["\displaystyle \sin(45^{\circ})",Formula("sqrt(2)/2")], + ["\displaystyle \cos(45^{\circ})",Formula("sqrt(2)/2")], + ["\displaystyle \tan(45^{\circ})",Formula("1")], +); + +@perm = NchooseK(3,2); + + +########################################################## + +BEGIN_PGML + +Using your knowledge of [`30-60-90`] and [`45-45-90`] right triangles, write each trigonometry expression's exact value. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +You should memorize the following right triangle with all angle measures and all side lengths. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Now we can tell all related trigonometry values in this right triangle: + + [`` \begin{aligned} + \sin(45^{\circ}) &= \frac{1}{\sqrt{2}}=\frac{\sqrt{2}}{2} \\ + \cos(45^{\circ}) &= \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2} \\ + \tan(45^{\circ}) &= 1 + \end{aligned} ``] +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio40.pg b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio40.pg new file mode 100644 index 0000000000..bd8a3f696e --- /dev/null +++ b/Contrib/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio40.pg @@ -0,0 +1,137 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +$Ax = 0; +$Ay = 0; +$Cx = 1; +$Cy = 0; +$Bx = $Cx; +$By = 1; + +$cushion = 0.2; + +$xmin = -$cushion; #The viewing window +$xmax = $Cx+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$picture[0]->moveTo($Cx,$Cy+0.05); +$picture[0]->lineTo($Cx-0.05,$Cy+0.05,blue,3); +$picture[0]->lineTo($Cx-0.05,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); +$picture[0]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx,($By+$Cy)/2,"1",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay,"1",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"sqrt(2)",'blue','right','bottom','large')); + +$picture[0]->lb( new Label($Ax+0.1,$Ay,"45",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By-0.1,"45",'blue','right','top','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is 1. Angle C is a right angle. Side CB goes up, and the length is 1. The length of AB is sqrt(2). Both Angle A and Angle B are 45 degrees."; + +Context("LimitedRadical"); + +@prob = ( + ["\displaystyle \sin\left(\frac{\pi}{4}\right)",Formula("sqrt(2)/2")], + ["\displaystyle \cos\left(\frac{\pi}{4}\right)",Formula("sqrt(2)/2")], + ["\displaystyle \tan\left(\frac{\pi}{4}\right)",Formula("1")], +); + +@perm = NchooseK(3,2); + + +########################################################## + +BEGIN_PGML + +Using your knowledge of [`30-60-90`] and [`45-45-90`] right triangles, write each trigonometry expression's exact value. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +You should memorize the following right triangle with all angle measures and all side lengths. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Also, [`\frac{\pi}{4} = 45^{\circ}`]. + +Now we can tell all related trigonometry values in this right triangle: + + [`` \begin{aligned} + \sin\left(\frac{\pi}{4}\right) &= \frac{1}{\sqrt{2}}=\frac{\sqrt{2}}{2} \\ + \cos\left(\frac{\pi}{4}\right) &= \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2} \\ + \tan\left(\frac{\pi}{4}\right) &= 1 + \end{aligned} ``] +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication10.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication10.pg new file mode 100644 index 0000000000..fde23626d1 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication10.pg @@ -0,0 +1,290 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +sub addPIFraction { + my ($n,$d) = @_; + ($n,$d) = Fraction($n,$d)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return Formula("pi");} + elsif ($n==-1) {return Formula("-pi");} + else {return Formula("$n*pi");} + } else { + if ($n==1) {return Formula("pi/$d");} + elsif ($n==-1) {return -Formula("pi/$d");} + elsif ($n>0) {return Formula("($n*pi)/$d");} + else { + $Nn = -$n; + return -Formula("($Nn*pi)/$d"); + } + } +} + +@t = (); @h = (); @tShow = (); + +do { + do { + $a = random(15,35,1); + $p = random(5,15,1); + $b = addPIFraction(2,$p); + $base = random(5,15,1); + $d = $base+$a; + + $func = Formula("-$a*cos($b*t)+$d"); + + do { + $t[0] = random(2,$p,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h[1] = random($base+5,$base+2*$a-5,1); + } until abs($h[0]-$h[1])>10 && $t[0]!=$p && $t[0]!=$p/2; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad = arccos(($d-$h[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b); +$t[2] = $p-$t[1]; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],2); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p/2,1.5*$p); +($ymin, $ymax) = (-$a/2,3*$a); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-5; $i<$xmax; $i=$i+5) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"height (m)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[0],$h[0],red)); +$graph[0]->lb(new Label($t[0],$h[0],"($tShow[0],$h[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red','left','bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func]. Points ($tShow[0],$h[0]), ($tShow[1],$h[1]) and ($tShow[2],$h[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad); +$Py[0] = $r*sin($rad); +$Px[1] = $r*cos(-$rad); +$Py[1] = $r*sin(-$rad); + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"-$radShow radians",'red','center',$TOBHyp,large)); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$alt[1] = "This is the graph of a circle with points marked as $radShow radians and -$radShow radians on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +BEGIN_PGML + +A Ferris wheel is [`[$a]`] meters in radius and boarded from a platform that is [`[$base]`] meter above the ground. The six o’clock position on the Ferris wheel is level with the loading platform. The wheel completes 1 full revolution in [`[$p]`] minutes. The function [`h(t)`] gives a person’s height in meters above the ground [`t`] minutes after the wheel begins to turn. + +Answer the following questions about the function [`h(t)`]. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`h(t)=`][________________________]{$func}. + +Part b: Assume a person entered a cabin on the Ferris wheel at [`t=0`]. After [`[$t[0]]`] minutes, the person was [_______________]{$h[0]} meters high in the air. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [________________]{$ans} minutes. + +END_PGML + +############################################################## + +$maxHeight = $base+2*$a; +$s1 = Fraction($h[1]-$d,-$a)->reduce; +$p2 = $p/2; +$bR = ($p%2==0) ? "\frac{$p2}{\pi}" : "\frac{$p}{2\pi}"; +$s2 = arccos(($d-$h[1])/$a); +$radShow = Round($rad,4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the person's height, [`(0,[$base])`] is at the minimum of the function. This matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], so we should choose to use the following function to model the person's height: + + [``h(t)=-a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its minimum value when [`t=0`], just like [`y=-\cos(x)`]. + +The person's minimum height is simply the height of the platform, [`[$base]`] meters. The person's maximum height is the height of the platform plus twice the wheel's radius: [`[$base]+2([$a])=[$maxHeight]`] meters. The function's midline is the average values of the person's maximum and minimum height: + + [``d=\frac{[$base]+[$maxHeight]}{2}=[$d]``] + +Next, the function's amplitude is simply the Ferris Wheel's radius: [`a=[$a]`]. + +For the function [`h(t)=-a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} = [$b]``] + +The function's formula is + + [``h(t) = [$func] ``] + +###Part b + +To find the person's height after [`[$t[0]]`] minutes, substitute [`t=[$t[0]]`] into [`h(t)`], we have: + + [``\begin{aligned} + h(t) &= [$func] \\ + &= -[$a]\cos\left([$b]([$t[0]])\right)+[$d] \\ + &= [$h[0]] + \end{aligned}``] + +After [`[$t[0]]`] minutes, the person was [`[$h[0]]`] meters high in the air. + +###Part c + +To find when the person's height was [`[$h[1]]`] meters, substitute [`h(t)=[$h[1]]`] into the function, and solve for [`t`]. We have: + + [``\begin{aligned} + h(t) &= [$func] \\ + [$h[1]] &= [$func] \\ + [$h[1]]-[$d] &= -[$a]\cos\left([$b]t\right) \\ + -\frac{[$h[1]-$d]}{[$a]} &= \cos\left([$b]t\right) \\ + [$s1] &= \cos\left([$b]t\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b]t \\ + [$radShow] &= [$b]t + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$s1] = \cos\left([$b]t\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + [$s1] &= \cos\left([$b]t\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b]t \\ + [$b]t &= [$radShow] +2k\pi \text{ or } -[$radShow] +2k\pi \\ + t &= [$bR] \left( [$radShow]+2k\pi \right) \text{ or } [$bR] \left( -[$radShow] +2k\pi \right) \\ + t &= [$t[1]] + [$p]k \text{ or } -[$t[1]] + [$p]k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in one period: [`[0,[$p]]`]: + + [``\begin{aligned} + t &= [$t[1]] + [$p](0) = [$t[1]] \\ + t &= -[$t[1]] + [$p](1) = [$t[2]] + \end{aligned}``] + +The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [`[$ans]`] minutes. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication20.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication20.pg new file mode 100644 index 0000000000..b101bfa894 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication20.pg @@ -0,0 +1,311 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +sub addPIFraction { + my ($n,$d) = @_; + ($n,$d) = Fraction($n,$d)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return Formula("pi");} + elsif ($n==-1) {return Formula("-pi");} + else {return Formula("$n*pi");} + } else { + if ($n==1) {return Formula("pi/$d");} + elsif ($n==-1) {return -Formula("pi/$d");} + elsif ($n>0) {return Formula("($n*pi)/$d");} + else { + $Nn = -$n; + return -Formula("($Nn*pi)/$d"); + } + } +} + +@t = (); @h = (); @tShow = (); + +do { + do { + $a = random(15,35,1); + $p = random(6,16,2); + $pH = $p/2; + $b = addPIFraction(2,$p); + $base = random(5,15,1); + $d = $base+$a; + $top = $base+2*$a; + + $func = Formula("-$a*cos($b*t)+$d"); + + do { + $t[0] = random(2,$p,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h[1] = random($base+5,$base+2*$a-5,1); + } until abs($h[0]-$h[1])>10 && $t[0]!=$p && $t[0]!=$p/2; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad = arccos(($d-$h[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b); +$t[2] = $p-$t[1]; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],2); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p/2,1.5*$p); +($ymin, $ymax) = (-$a/2,3*$a); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-5; $i<$xmax; $i=$i+5) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"height (m)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($pH,$top,red)); +$graph[0]->lb(new Label($pH,$top,"($pH,$top)",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($p,$base,red)); +$graph[0]->lb(new Label($p,$base,"($p,$base)",'red','center','top',large)); +$graph[0]->stamps(closed_circle($t[0],$h[0],red)); +$graph[0]->lb(new Label($t[0],$h[0],"($tShow[0],$h[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red','left','bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func]. Points ($tShow[0],$h[0]), ($tShow[1],$h[1]) and ($tShow[2],$h[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad); +$Py[0] = $r*sin($rad); +$Px[1] = $r*cos(-$rad); +$Py[1] = $r*sin(-$rad); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"-$radShow radians",'red','center',$TOBHyp,large)); + +$alt[1] = "This is the graph of a unit circle with points marked as $radShow radians and -$radShow radians on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +BEGIN_PGML + +A person got into a cabin on a Ferris wheel for a ride. [`[$pH]`] minutes into the ride, she was on top of the wheel at the height of [`[$top]`] meters; [`[$p]`] minutes into the ride, she was back to the base at the height of [`[$base]`] meters. A function [`h(t)`] models the person's height during this ride. + +Answer the following questions about the function [`h(t)`]. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`h(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] minutes (since the person entered the cabin), the person was [_______________]{$h[0]} meters high in the air. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [________________]{$ans} minutes. + +END_PGML + +############################################################## + +$maxHeight = $base+2*$a; +$s1 = Fraction($h[1]-$d,-$a)->reduce; +$p2 = $p/2; +$bR = ($p%2==0) ? "\frac{$p2}{\pi}" : "\frac{$p}{2\pi}"; +$radShow = Round($rad,4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the person's height, [`(0,[$base])`] is at the minimum of the function. This matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], so we should choose to use the following function to model the person's height: + + [``h(t)=-a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its minimum value when [`t=0`], just like [`y=-\cos(x)`]. + +By given conditions, [`([$pH],[$top])`] represents the function's maximum value, and [`([$p],[$base])`] represents the function's minimum value. + +The function's [`d`] value (midline) is: + + [``\begin{aligned} + d &= \frac{\text{maximum height}+\text{minimum height}}{2} \\ + &= \frac{[$top]+[$base]}{2} \\ + &= [$d]\text{ meters} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum height}-\text{minimum height}}{2} \\ + &= \frac{[$top]-[$base]}{2} \\ + &= [$a]\text{ meters} + \end{aligned}``] + +To travel from the top point to the bottom point, it takes half a period, so the height's period is: + + [`` 2([$p]-[$pH]) = [$p]\text{ minutes}``] + +For the function [`h(t)=-a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} = [$b]``] + +The function's formula is + + [``h(t) = [$func] ``] + +###Part b + +To find the person's height after [`[$t[0]]`] minutes, substitute [`t=[$t[0]]`] into [`h(t)`], we have: + + [``\begin{aligned} + h(t) &= [$func] \\ + &= -[$a]\cos\left([$b]([$t[0]])\right)+[$d] \\ + &= [$h[0]] + \end{aligned}``] + +After [`[$t[0]]`] minutes, the person was [`[$h[0]]`] meters high in the air. + +###Part c + +To find when the person's height was [`[$h[1]]`] meters, substitute [`h(t)=[$h[1]]`] into the function, and solve for [`t`]. We have: + + [``\begin{aligned} + h(t) &= [$func] \\ + [$h[1]] &= [$func] \\ + [$h[1]]-[$d] &= -[$a]\cos\left([$b]t\right) \\ + -\frac{[$h[1]-$d]}{[$a]} &= \cos\left([$b]t\right) \\ + [$s1] &= \cos\left([$b]t\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b]t \\ + [$radShow] &= [$b]t + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$s1] = \cos\left([$b]t\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + [$s1] &= \cos\left([$b]t\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b]t \\ + [$b]t &= [$radShow] +2k\pi \text{ or } -[$radShow] +2k\pi \\ + t &= [$bR] \left( [$radShow] +2k\pi \right) \text{ or } [$bR] \left( -[$radShow] +2k\pi \right) \\ + t &= [$t[1]] + [$p]k \text{ or } -[$t[1]] + [$p]k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in one period: [`[0,[$p]]`]: + + [``\begin{aligned} + t &= [$t[1]] + [$p](0) = [$t[1]] \\ + t &= -[$t[1]] + [$p](1) = [$t[2]] + \end{aligned}``] + +The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [`[$ans]`] minutes. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication30.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication30.pg new file mode 100644 index 0000000000..564a83e6cf --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication30.pg @@ -0,0 +1,294 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(d => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@t = (); @h = (); @tShow = (); +do { + do { + $high = random(30,40,1); + $low = random(-10,-5,1); + $a = ($high-$low)/2; + $b = Formula("(2*pi)/365"); + $c = random(5,30,1); + $e = ($high+$low)/2; + $func = Formula("-$a*cos($b*(d-$c))+$e"); + $p = 365; + $xHigh = $c+365/2; + + do { + $t[0] = random($c+5,300,1); + $T[0] = $func->eval(d=>$t[0]); + $T[1] = random($low+5,$high-5,1); + } until abs($T[0]-$T[1])>10; + $T[2] = $T[1]; + } until abs(($e-$T[1])/$a)<1; + $rad = arccos(($e-$T[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b)+$c; +$t[2] = -$rad/Compute($b)+$p+$c; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],2); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-10,400); +($ymin, $ymax) = ($low-10,$high+10); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-50; $i<$xmax; $i=$i+50) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"Celcius Degrees",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"days",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for d in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($xHigh,$high,red)); +$graph[0]->lb(new Label($xHigh,$high,"($xHigh,$high)",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($c,$low,red)); +$graph[0]->lb(new Label($c,$low,"($c,$low)",'red','left','top',large)); +$graph[0]->stamps(closed_circle($t[0],$T[0],red)); +$graph[0]->lb(new Label($t[0],$T[0],"($tShow[0],$T[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$T[1],red)); +$graph[0]->lb(new Label($t[1],$T[1],"($tShow[1],$T[1])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$T[2],red)); +$graph[0]->lb(new Label($t[2],$T[2],"($tShow[2],$T[2])",'red','center','bottom',large)); + +$alt[0] = "This is the graph of T(d)=[$func]. Points ($xHigh,$high), ($c,$low), ($tShow[0],$T[0]), ($tShow[1],$T[1]) and ($tShow[2],$T[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad); +$Py[0] = $r*sin($rad); +$Px[1] = $r*cos(-$rad); +$Py[1] = $r*sin(-$rad); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"-$radShow radians",'red','center',$TOBHyp,large)); + +$alt[1] = "This is the graph of a circle with points marked as $radShow radians at ($Px[0],$Py[0]) and -$radShow radians at ($Px[1],$Py[1]) on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +$ld = $t[0]-int($t[0]/10)*10; +if ($ld==1) {$th = "st";} + elsif ($ld==2) {$th = "nd";} + else {$th = "th";} + +BEGIN_PGML + +Assume a year has 365 days, and [`d=1`] represents Jan. 1. A city's daily maximum temperature over the year, [`T(d)`], follows the pattern of a periodic function. The city's lowest daily maximum temperature, [`[$low]^{\circ} C`], happens on Jan. [`[$c]`]; its highest daily maximum temperature, [`[$high]^\circ C`], happens in July. + +Answer the following questions. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`T(d)=`][________________________]{$func}. + +Part b: On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [_______________]{$T[0]} [`^{\circ} C`]. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [________________]{$ans}. + +END_PGML + +############################################################## + +$a1 = $e-$T[1]; +$s1 = "\frac{$a1}{$a}"; +$bR = "\frac{365}{2\pi}"; +$s2 = $rad*365/(2*pi); +$s3 = -$s2+$c; +$radShow = Round($rad,4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`d=[$c]`], the function has it's minimum value at [`([$c],[$low])`]. Then the function increases. This change matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], and then increases. So we should choose to use the following function to model the daily maximum temperature: + + [``T(d)=-a\cos\left(b(d-c)\right)+e``] + +By given conditions, the function's maximum value is [`[$high]`], and its minimum value is [`[$low]`]. + +The function's [`e`] value (midline) is: + + [``\begin{aligned} + e &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+([$low])}{2} \\ + &= [$e]^{\circ} C + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-([$low])}{2} \\ + &= [$a]^{\circ} C + \end{aligned}``] + +The function's period is [`365`] days. By the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +Finally, the function's minimum value is at [`([$c],[$low])`], which matches [`(0,-1)`] on [`y=-\cos(x)`]. The graph of [`y=-\cos(x)`] needs to shift to the right by [`[$c]`] units to match the graph of [`T(d)`], implying [`c=[$c]`] in [`T(d)=-a\cos\left(b(d-c)\right)+e`]. + +The function's formula is + + [``T(d) = [$func] ``] + +###Part b + +To find the daily maximum temperature on the [`[$t[0]]`][$th] day, substitute [`d=[$t[0]]`] into [`T(d)`], we have: + + [``\begin{aligned} + T(d) &= [$func] \\ + &= -[$a]\cos\left([$b]([$t[0]]-[$c])\right)+[$e] \\ + &= [$T[0]]^{\circ} C + \end{aligned}``] + +On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [`[$T[0]] ^{\circ} C`]. + +###Part c + +To find when the daily maximum temperature was [`[$T[1]]^{\circ} C`], substitute [`T(d)=[$T[1]]`] into the function, and solve for [`d`]. We have: + + [``\begin{aligned} + T(d) &= [$func] \\ + [$T[1]] &= [$func] \\ + [$T[1]]-[$e] &= -[$a]\cos\left([$b](t-[$c])\right) \\ + -\frac{[$T[1]-$e]}{[$a]} &= \cos\left([$b](t-[$c])\right) \\ + [$s1] &= \cos\left([$b](t-[$c])\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b](t-[$c]) \\ + [$radShow] &= [$b](t-[$c]) + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$s1] = \cos\left([$b](t-[$c])\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + [$s1] &= \cos\left([$b](d-[$c])\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b](d-[$c]) \\ + [$b](d-[$c]) &= [$radShow] +2k\pi \text{ or } -[$radShow] +2k\pi \\ + d-[$c] &= [$bR] \left( [$radShow] +2k\pi \right) \text{ or } [$bR] \left( -[$radShow] +2k\pi \right) \\ + d-[$c] &= [$s2] + 365k \text{ or } -[$s2] + 365k \\ + d &= [$t[1]] + 365k \text{ or } [$s3] + 365k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in one period: [`[0,[$p]]`]: + + [``\begin{aligned} + d &= [$t[1]] + 365(0) = [$t[1]] \\ + d &= [$s3] + 365(1) = [$t[2]] + \end{aligned}``] + +During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [`[$ans]`]. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication40.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication40.pg new file mode 100644 index 0000000000..ec282b1823 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication40.pg @@ -0,0 +1,294 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(d => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@t = (); @h = (); @tShow = (); +do { + do { + $high = random(30,40,1); + $low = random(-10,-5,1); + $a = ($high-$low)/2; + $b = Formula("(2*pi)/365"); + $c = random(5,30,1); + $e = ($high+$low)/2; + $func = Formula("$a*cos($b*(d-$c))+$e"); + $p = 365; + $xLow = $c+365/2; + + do { + $t[0] = random($c+5,300,1); + $T[0] = $func->eval(d=>$t[0]); + $T[1] = random($low+5,$high-5,1); + } until abs($T[0]-$T[1])>10; + $T[2] = $T[1]; + } until abs(($T[1]-$e)/$a)<1; + $rad = arccos(($T[1]-$e)/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b)+$c; +$t[2] = -$rad/Compute($b)+$p+$c; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],2); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-10,400); +($ymin, $ymax) = ($low-10,$high+10); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-50; $i<$xmax; $i=$i+50) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"Celcius Degrees",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"days",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for d in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($xLow,$low,red)); +$graph[0]->lb(new Label($xLow,$low,"($xLow,$low)",'red','center','top',large)); +$graph[0]->stamps(closed_circle($c,$high,red)); +$graph[0]->lb(new Label($c,$high,"($c,$high)",'red','left','bottom',large)); +$graph[0]->stamps(closed_circle($t[0],$T[0],red)); +$graph[0]->lb(new Label($t[0],$T[0],"($tShow[0],$T[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$T[1],red)); +$graph[0]->lb(new Label($t[1],$T[1],"($tShow[1],$T[1])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$T[2],red)); +$graph[0]->lb(new Label($t[2],$T[2],"($tShow[2],$T[2])",'red','center','bottom',large)); + +$alt[0] = "This is the graph of T(d)=[$func]. Points ($xHigh,$high), ($c,$low), ($tShow[0],$T[0]), ($tShow[1],$T[1]) and ($tShow[2],$T[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad); +$Py[0] = $r*sin($rad); +$Px[1] = $r*cos(-$rad); +$Py[1] = $r*sin(-$rad); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"-$radShow radians",'red','center',$TOBHyp,large)); + +$alt[1] = "This is the graph of a circle with points marked as $radShow radians and -$radShow radians on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +$ld = $t[0]-int($t[0]/10)*10; +if ($ld==1) {$th = "st";} + elsif ($ld==2) {$th = "nd";} + else {$th = "th";} + +BEGIN_PGML + +Assume a year has 365 days, and [`d=1`] represents Jan. 1. A city's daily maximum temperature over the year, [`T(d)`], follows the pattern of a periodic function. The city's highest daily maximum temperature, [`[$high]^{\circ} C`], happens on Jan. [`[$c]`]; its lowest daily maximum temperature, [`[$low]^\circ C`], happens in July. + +Answer the following questions. + +Part a: The function, as a transformation of [`y=\cos(x)`], is [`T(d)=`][________________________]{$func}. + +Part b: On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [_______________]{$T[0]} [`^{\circ} C`]. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [________________]{$ans}. + +END_PGML + +############################################################## + +$a1 = $T[1]-$e; +$s1 = "\frac{$a1}{$a}"; +$bR = "\frac{365}{2\pi}"; +$s2 = $rad*365/(2*pi); +$s3 = -$s2+$c; +$radShow = Round($rad,4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`d=[$c]`], the function has it's maximum value at [`([$c],[$high])`]. Then the function decreases. This change matches the graph of [`y=\cos(x)`], which is at its maximum value when [`x=0`], and then decreases. So we should choose to use the following function to model the daily maximum temperature: + + [``T(d)=a\cos\left(b(d-c)\right)+e``] + +By given conditions, the function's maximum value is [`[$high]`], and its minimum value is [`[$low]`]. + +The function's [`e`] value (midline) is: + + [``\begin{aligned} + e &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+([$low])}{2} \\ + &= [$e]^{\circ} C + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-([$low])}{2} \\ + &= [$a]^{\circ} C + \end{aligned}``] + +The function's period is [`365`] days. By the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +Finally, the function's minimum value is at [`([$c],[$high])`], which matches [`(0,1)`] on [`y=\cos(x)`]. The graph of [`y=-cos(x)`] needs to shift to the right by [`[$c]`] units to match the graph of [`T(d)`], implying [`c=[$c]`] in [`T(d)=a\cos\left(b(d-c)\right)+e`]. + +The function's formula is + + [``T(d) = [$func] ``] + +###Part b + +To find the daily maximum temperature on the [`[$t[0]]`][$th] day, substitute [`d=[$t[0]]`] into [`T(d)`], we have: + + [``\begin{aligned} + T(d) &= [$func] \\ + &= [$a]\cos\left([$b]([$t[0]]-[$c])\right)+[$e] \\ + &= [$T[0]]^{\circ} C + \end{aligned}``] + +On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [`[$T[0]] ^{\circ} C`]. + +###Part c + +To find when the daily maximum temperature was [`[$T[1]]^{\circ} C`], substitute [`T(d)=[$T[1]]`] into the function, and solve for [`d`]. We have: + + [``\begin{aligned} + T(d) &= [$func] \\ + [$T[1]] &= [$func] \\ + [$T[1]]-[$e] &= [$a]\cos\left([$b](t-[$c])\right) \\ + \frac{[$a1]}{[$a]} &= \cos\left([$b](t-[$c])\right) \\ + [$s1] &= \cos\left([$b](t-[$c])\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b](t-[$c]) \\ + [$radShow] &= [$b](t-[$c]) + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$s1] = \cos\left([$b](t-[$c])\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + [$s1] &= \cos\left([$b](d-[$c])\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b](d-[$c]) \\ + [$b](d-[$c]) &= [$radShow] +2k\pi \text{ or } -[$radShow] +2k\pi \\ + d-[$c] &= [$bR] \left( [$radShow] +2k\pi \right) \text{ or } [$bR] \left( -[$radShow] +2k\pi \right) \\ + d-[$c] &= [$s2] + 365k \text{ or } -[$s2] + 365k \\ + d &= [$t[1]] + 365k \text{ or } [$s3] + 365k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in one period: [`[0,[$p]]`]: + + [``\begin{aligned} + d &= [$t[1]] + 365(0) = [$t[1]] \\ + d &= [$s3] + 365(1) = [$t[2]] + \end{aligned}``] + +During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [`[$ans]`]. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication50.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication50.pg new file mode 100644 index 0000000000..8e08729566 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication50.pg @@ -0,0 +1,297 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@rad = (); +@t = (); @h = (); @tShow = (); +do { + do { + $a = random(10,30,0.1); + $p = random(1,5,0.1); + $b = 2*pi/$p; + $bTex = "\frac{2\pi}{$p}"; + $d = random($a+10,$a+20,0.1); + $func = Formula("$a*sin(((2*pi)/$p)*t)+$d"); + $high = $d+$a; + $low = $d-$a; + do { + $t[0] = random(1,3*$p-1,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h0Show = Round($h[0],3); + $h[1] = random($d-$a+1,$d+$a-1,0.1); + } until abs($h[0]-$h[1])>10; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad[1] = arcsin(($h[1]-$d)/$a); + $rad[2] = ($rad[1]>0) ? pi-$rad[1] : -pi-$rad[1]; +} until (abs($rad[1]*180/pi)>20) && (abs($rad[1]*180/pi)<75) && ($t[0]/($p/2) != int($t[0]/($p/2)) ); + +$p2 = $p/2; +$p4 = $p/4; +$p34 = $p*3/4; + +$k = random(2,3,1); +$t[1] = $rad[1]/Compute($b)+$k*$p; +$t[2] = $rad[2]/Compute($b)+$k*$p; +$iL = $k*$p; +$iR = ($k+1)*$p; +if ( ($iL > $t[1]) || ($iL > $t[2]) ) { + $iL = ($k-1)*$p; + $iR = $k*$p; +} + +@radShow = ();@tShow = (); +$rad[0] = 0; +for my $i (0..2) { + $radShow[$i] = Round($rad[$i],3); + $tShow[$i] = Round($t[$i],3); +} + +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p,($k+2)*$p); +($ymin, $ymax) = (-5,$high+5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-2; $i<$xmax; $i=$i+2) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"distance (cm)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[0],$h[0],red)); +$graph[0]->lb(new Label($t[0],$h[0],"($tShow[0],$h[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$lr = ($t[1]<$t[2]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red',$lr,'bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$lr = ($t[2]<$t[1]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red',$lr,'bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func]. Points ($tShow[0],$h[0]), ($tShow[1],$h[1]) and ($tShow[2],$h[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad[1]); +$Py[0] = $r*sin($rad[1]); +$Px[1] = $r*cos($rad[2]); +$Py[1] = $r*sin($rad[2]); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow[1] radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"$radShow[2] radians",'red','center',$TOBHyp,large)); + +$alt[1] = "This is the graph of a unit circle with points marked as $radShow[1] radians and $radShow[2] radians on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +BEGIN_PGML + +A piston moves forward and backward when it runs. At the beginning [`(t=0)`], the piston was at its nutural position, [`[$d]`] inches from its base. The piston moved away from its base. [`[$p4]`] seconds since [`t=0`], the piston was at its farthest distance from its base, [`[$high]`] cm. Then, the piston moved back toward its base. [`[$p34]`] seconds since [`t=0`], the piston was at its closest distance from its base, [`[$low]`] cm. Then, it switched direction and moved toward its nutural position again. + +The function [`p(t)`] models the piston's distance from its base since it started to move at [`t=0`]. Answer the following questions. + +Part a: The function, as a transformation of [`y=\sin(x)`], is [`p(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] seconds, the piston was [_______________]{$h[0]} cm away from its base. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [______________________]{$ans} seconds. + +END_PGML + +############################################################## + +$s1 = Real($h[1]-$d); +$bR = "\frac{$p}{2\pi}"; +$s2 = $rad[1]/Compute($b); +$s3 = $rad[2]/Compute($b); +$radShow[1] = Round($rad[1],4); +$radShow[2] = Round($rad[2],4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the piston is at its neutral position, or the middle of maximum and minimum values. This matches the graph of [`y=\sin(x)`], which is in the middle of maximum and minimum values when [`x=0`], so we should choose to use the following function to model the piston's position: + + [``p(t)=a\sin\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is in the middle of its maximum and minimum values when [`t=0`], just like [`y=\sin(x)`]. + +The function's midline is the average values of the function's maximum and minimum values: + + [``\begin{aligned} + d &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+[$low]}{2} \\ + &= [$d]\text{ cm} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-[$low]}{2} \\ + &= [$a]\text{ cm} + \end{aligned}``] + +The piston was at its maximum value at [`([$p4],[$high])`], and at its minimum value at [`([$p34],[$low])`]. The time in between is half of the period, so: + + [``\text{period}=2([$p34]-[$p4])=[$p]``] + +For the function [`p(t)=a\sin\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +The function's formula is + + [``p(t) = [$func] ``] + +###Part b + +To find the piston's position after [`[$t[0]]`] seconds, substitute [`t=[$t[0]]`] into [`p(t)`], we have: + + [``\begin{aligned} + p(t) &= [$func] \\ + &= [$a]\sin\left([$bTex]([$t[0]])\right)+[$d] \\ + &= [$h[0]]\text{ cm} + \end{aligned}``] + +After [`[$t[0]]`] seconds, the piston was [`[$h[0]]`] cm away from the base. + +###Part c + +To find when the piston was [`[$h[1]]`] cm away from its base, substitute [`p(t)=[$h[1]]`] into the function, and solve for [`t`]. We have: + + [``\begin{aligned} + p(t) &= [$func] \\ + [$h[1]] &= [$func] \\ + [$h[1]]-[$d] &= [$a]\sin\left([$bTex]t\right) \\ + \frac{[$s1]}{[$a]} &= \sin\left([$bTex]t\right) \\ + \sin^{-1}\left(\frac{[$s1]}{[$a]}\right) &= [$bTex]t \\ + [$radShow[1]] &= [$bTex]t + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. On the Unit Circle, we have to check whether another angle also makes [`\frac{[$s1]}{[$a]} = \sin\left([$bTex]t\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + \frac{[$s1]}{[$a]} &= \sin\left([$bTex]t\right) \\ + \sin^{-1}\left(\frac{[$s1]}{[$a]}\right) &= [$bTex]t \\ + [$bTex]t &= [$radShow[1]] +2k\pi \text{ or } [$radShow[2]] +2k\pi \\ + t &= [$bR] \left( [$radShow[1]] +2k\pi \right) \text{ or } [$bR] \left( [$radShow[2]] +2k\pi \right) \\ + t &= [$s2] + [$p]k \text{ or } [$s3] + [$p]k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in [`t\in([$iL],[$iR])`]: + + [``\begin{aligned} + t &= [$s2] + [$p]([$k]) = [$t[1]] \\ + t &= [$s3] + [$p]([$k]) = [$t[2]] + \end{aligned}``] + +During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [`[$ans]`] seconds. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication60.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication60.pg new file mode 100644 index 0000000000..0a3b5bc9ae --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplication60.pg @@ -0,0 +1,294 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@rad = (); +@t = (); @h = (); @tShow = (); +do { + do { + $a = random(10,30,0.1); + $p = random(1,5,0.1); + $b = 2*pi/$p; + $bTex = "\frac{2\pi}{$p}"; + $d = random($a+10,$a+20,0.1); + $func = Formula("$a*cos(((2*pi)/$p)*t)+$d"); + $high = $d+$a; + $low = $d-$a; + do { + $t[0] = random(1,3*$p-1,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h[1] = random($d-$a+1,$d+$a-1,0.1); + } until abs($h[0]-$h[1])>10; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad[1] = arccos(($h[1]-$d)/$a); + $rad[2] = -$rad[1]; +} until (abs($rad[1]*180/pi)>20) && (abs($rad[1]*180/pi)<75); + +$p2 = $p/2; + +$k = random(2,3,1); +$t[1] = $rad[1]/Compute($b)+$k*$p; +$t[2] = $rad[2]/Compute($b)+$k*$p; +$iL = $k*$p+$p2; +$iR = ($k+1)*$p+$p2; +if ( ($iL > $t[1]) || ($iL > $t[2]) ) { + $iL = ($k-1)*$p+$p2; + $iR = $k*$p+$p2; +} + +@radShow = ();@tShow = (); +$rad[0] = 0; +for my $i (0..2) { + $radShow[$i] = Round($rad[$i],2); + $tShow[$i] = Round($t[$i],2); +} + +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p,($k+2)*$p); +($ymin, $ymax) = (-5,$high+5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-2; $i<$xmax; $i=$i+2) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"distance (cm)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[0],$h[0],red)); +$graph[0]->lb(new Label($t[0],$h[0],"($tShow[0],$h[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$lr = ($t[1]<$t[2]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red',$lr,'bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$lr = ($t[2]<$t[1]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red',$lr,'bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func]. Points ($tShow[0],$h[0]), ($tShow[1],$h[1]) and ($tShow[2],$h[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad[1]); +$Py[0] = $r*sin($rad[1]); +$Px[1] = $r*cos($rad[2]); +$Py[1] = $r*sin($rad[2]); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow[1] radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"$radShow[2] radians",'red','center',$TOBHyp,large)); + +$alt[1] = "This is the graph of a unit circle with points marked as $radShow[1] radians and $radShow[2] radians on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +BEGIN_PGML + +A piston moves forward and backward when it runs. At the beginning [`(t=0)`], the piston was at its farthest distance from its base, [`[$high]`] cm. Then, the piston moved back toward its base. [`[$p2]`] seconds later, the piston was at its closest distance from its base, [`[$low]`] cm. Then, it switched direction and moved away from its base. + +The function [`p(t)`] models the piston's distance from its base since it started to move at [`t=0`]. Answer the following questions. + +Part a: The function, as a transformation of [`y=\cos(x)`], is [`p(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] seconds, the piston was [_______________]{$h[0]} cm away from its base. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [______________________]{$ans} seconds. + +END_PGML + +############################################################## + +$s1 = Real($h[1]-$d); +$bR = "\frac{$p}{2\pi}"; +$s2 = $rad[1]/Compute($b); +$s3 = $rad[2]/Compute($b); +$radShow[1] = Round($rad[1],4); +$radShow[2] = Round($rad[2],4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the piston is at its farthest position, or maximum value. This matches the graph of [`y=\cos(x)`], which is at its maximum value when [`x=0`], so we should choose to use the following function to model the piston's position: + + [``p(t)=a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its maximum value when [`t=0`], just like [`y=\cos(x)`]. + +The function's midline is the average values of the function's maximum and minimum values: + + [``\begin{aligned} + d &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+[$low]}{2} \\ + &= [$d]\text{ cm} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-[$low]}{2} \\ + &= [$a]\text{ cm} + \end{aligned}``] + +The piston was at its maximum value at [`(0,[$high])`], and at its minimum value at [`([$p2],[$low])`]. The time in between is half of the period, so: + + [``\text{period}=2([$p2]-0)=[$p]``] + +For the function [`p(t)=a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +The function's formula is + + [``p(t) = [$func] ``] + +###Part b + +To find the piston's position after [`[$t[0]]`] seconds, substitute [`t=[$t[0]]`] into [`p(t)`], we have: + + [``\begin{aligned} + p(t) &= [$func] \\ + &= [$a]\cos\left([$bTex]([$t[0]])\right)+[$d] \\ + &= [$h[0]]\text{ cm} + \end{aligned}``] + +After [`[$t[0]]`] seconds, the piston was [`[$h[0]]`] cm away from the base. + +###Part c + +To find when the piston was [`[$h[1]]`] cm away from its base, substitute [`p(t)=[$h[1]]`] into the function, and solve for [`t`]. We have: + + [``\begin{aligned} + p(t) &= [$func] \\ + [$h[1]] &= [$func] \\ + [$h[1]]-[$d] &= [$a]\cos\left([$bTex]t\right) \\ + \frac{[$s1]}{[$a]} &= \cos\left([$bTex]t\right) \\ + \cos^{-1}\left(\frac{[$s1]}{[$a]}\right) &= [$bTex]t \\ + [$radShow[1]] &= [$bTex]t + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`\frac{[$s1]}{[$a]} = \cos\left([$bTex]t\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + \frac{[$s1]}{[$a]} &= \cos\left([$bTex]t\right) \\ + \cos^{-1}\left(\frac{[$s1]}{[$a]}\right) &= [$bTex]t \\ + [$bTex]t &= [$radShow[1]] +2k\pi \text{ or } [$radShow[2]] +2k\pi \\ + t &= [$bR] \left( [$radShow[1]] +2k\pi \right) \text{ or } [$bR] \left( [$radShow[2]] +2k\pi \right) \\ + t &= [$s2] + [$p]k \text{ or } [$s3] + [$p]k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in [`t\in([$iL],[$iR])`]: + + [``\begin{aligned} + t &= [$s2] + [$p]([$k]) = [$t[1]] \\ + t &= [$s3] + [$p]([$k]) = [$t[2]] + \end{aligned}``] + +During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [`[$ans]`] seconds. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos10.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos10.pg new file mode 100644 index 0000000000..4db7c38d04 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos10.pg @@ -0,0 +1,215 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +sub addPIFraction { + my ($n,$d) = @_; + ($n,$d) = Fraction($n,$d)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return Formula("pi");} + elsif ($n==-1) {return Formula("-pi");} + else {return Formula("$n*pi");} + } else { + if ($n==1) {return Formula("pi/$d");} + elsif ($n==-1) {return -Formula("pi/$d");} + elsif ($n>0) {return Formula("($n*pi)/$d");} + else { + $Nn = -$n; + return -Formula("($Nn*pi)/$d"); + } + } +} + +@t = (); @h = (); @tShow = (); + +do { + do { + $a = random(15,35,1); + $p = random(5,15,1); + $b = addPIFraction(2,$p); + $base = random(5,15,1); + $d = $base+$a; + + $func = Formula("-$a*cos($b*t)+$d"); + + do { + $t[0] = random(2,$p,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h0Show = Round($h[0],3); + $h[1] = random($base+5,$base+2*$a-5,1); + } until abs($h[0]-$h[1])>10 && $t[0]!=$p && $t[0]!=$p/2; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad = arccos(($d-$h[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,3); +$t[1] = $rad/Compute($b); +$t[2] = $p-$t[1]; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],3); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p/2,1.5*$p); +($ymin, $ymax) = (-$a/2,3*$a); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-5; $i<$xmax; $i=$i+5) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"height (m)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$h[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red','left','bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func] and y=[$h[1]]. Their intersections ($tShow[1],$h[1]) and ($tShow[2],$h[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +A Ferris wheel is [`[$a]`] meters in radius and boarded from a platform that is [`[$base]`] meter above the ground. The six o’clock position on the Ferris wheel is level with the loading platform. The wheel completes 1 full revolution in [`[$p]`] minutes. The function [`h(t)`] gives a person’s height in meters above the ground [`t`] minutes after the wheel begins to turn. + +*Use graphing technology* to answer the following questions about the function [`h(t)`]. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`h(t)=`][________________________]{$func}. + +Part b: Assume a person entered a cabin on the Ferris wheel at [`t=0`]. After [`[$t[0]]`] minutes, the person was [_______________]{$h[0]} meters high in the air. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [________________]{$ans} minutes. + +END_PGML + +############################################################## + +$maxHeight = $base+2*$a; + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the person's height, [`(0,[$base])`] is at the minimum of the function. This matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], so we should choose to use the following function to model the person's height: + + [``h(t)=-a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its minimum value when [`t=0`], just like [`y=-\cos(x)`]. + +The person's minimum height is simply the height of the platform, [`[$base]`] meters. The person's maximum height is the height of the platform plus twice the wheel's radius: [`[$base]+2([$a])=[$maxHeight]`] meters. The function's midline is the average values of the person's maximum and minimum height: + + [``d=\frac{[$base]+[$maxHeight]}{2}=[$d]``] + +Next, the function's amplitude is simply the Ferris Wheel's radius: [`a=[$a]`]. + +For the function [`h(t)=-a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} = [$b]``] + +The function's formula is + + [``h(t) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` h(t) = [$func] `]. + +###Part b + +To find the person's height after [`[$t[0]]`] minutes, we need to substitute the function's [`t`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` h([$t[0]]) `]. Desmos shows [`[$h0Show]`]. + +After [`[$t[0]]`] minutes, the person was [`[$h0Show]`] meters high in the air. + +###Part c + +To find when the person's height was [`[$h[1]]`] meters, we need to create a second function [`y=[$h[1]]`], and then let desmos find the intersection between [`h(t)`] and [`y=[$h[1]]`]. + +Step 3: In the second textbox, enter [`y=[$h[1]]`]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`h(t)`] and [`y=[$h[1]]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection of [`h(t)`] and [`y=[$h[1]]`] in the first period. Desmos shows [`([$tShow[1]],[$h[1]])`] and [`([$tShow[2]],[$h[1]])`]. + +The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [`[$tShow[1]], [$tShow[2]]`] minutes. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos20.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos20.pg new file mode 100644 index 0000000000..ef17586e33 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos20.pg @@ -0,0 +1,233 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +sub addPIFraction { + my ($n,$d) = @_; + ($n,$d) = Fraction($n,$d)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return Formula("pi");} + elsif ($n==-1) {return Formula("-pi");} + else {return Formula("$n*pi");} + } else { + if ($n==1) {return Formula("pi/$d");} + elsif ($n==-1) {return -Formula("pi/$d");} + elsif ($n>0) {return Formula("($n*pi)/$d");} + else { + $Nn = -$n; + return -Formula("($Nn*pi)/$d"); + } + } +} + +@t = (); @h = (); @tShow = (); + +do { + do { + $a = random(15,35,1); + $p = random(6,16,2); + $pH = $p/2; + $b = addPIFraction(2,$p); + $base = random(5,15,1); + $d = $base+$a; + $top = $base+2*$a; + + $func = Formula("-$a*cos($b*t)+$d"); + + do { + $t[0] = random(2,$p,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h0Show = Round($h[0],3); + $h[1] = random($base+5,$base+2*$a-5,1); + } until abs($h[0]-$h[1])>10 && $t[0]!=$p && $t[0]!=$p/2; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad = arccos(($d-$h[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b); +$t[2] = $p-$t[1]; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],3); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p/2,1.5*$p); +($ymin, $ymax) = (-$a/2,3*$a); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-5; $i<$xmax; $i=$i+5) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"height (m)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$h[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red','left','bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func] and y=[$h[1]]. Their intersections ($tShow[1],$h[1]) and ($tShow[2],$h[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +A person got into a cabin on a Ferris wheel for a ride. [`[$pH]`] minutes into the ride, she was on top of the wheel at the height of [`[$top]`] meters; [`[$p]`] minutes into the ride, she was back to the base at the height of [`[$base]`] meters. A function [`h(t)`] models the person's height during this ride. + +*Use graphing technology* to answer the following questions about the function [`h(t)`]. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`h(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] minutes (since the person entered the cabin), the person was [_______________]{$h[0]} meters high in the air. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [________________]{$ans} minutes. + +END_PGML + +############################################################## + +$maxHeight = $base+2*$a; + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the person's height, [`(0,[$base])`] is at the minimum of the function. This matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], so we should choose to use the following function to model the person's height: + + [``h(t)=-a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its minimum value when [`t=0`], just like [`y=-\cos(x)`]. + +By given conditions, [`([$pH],[$top])`] represents the function's maximum value, and [`([$p],[$base])`] represents the function's minimum value. + +The function's [`d`] value (midline) is: + + [``\begin{aligned} + d &= \frac{\text{maximum height}+\text{minimum height}}{2} \\ + &= \frac{[$top]+[$base]}{2} \\ + &= [$d]\text{ meters} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum height}-\text{minimum height}}{2} \\ + &= \frac{[$top]-[$base]}{2} \\ + &= [$a]\text{ meters} + \end{aligned}``] + +To travel from the top point to the bottom point, it takes half a period, so the height's period is: + + [`` 2([$p]-[$pH]) = [$p]\text{ minutes}``] + +For the function [`h(t)=-a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} = [$b]``] + +The function's formula is + + [``h(t) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` h(t) = [$func] `]. + +###Part b + +To find the person's height after [`[$t[0]]`] minutes, we need to substitute the function's [`t`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` h([$t[0]]) `]. Desmos shows [`[$h0Show]`]. + +After [`[$t[0]]`] minutes, the person was [`[$h0Show]`] meters high in the air. + +###Part c + +To find when the person's height was [`[$h[1]]`] meters, we need to create a second function [`y=[$h[1]]`], and then let desmos find the intersection between [`h(t)`] and [`y=[$h[1]]`]. + +Step 3: In the second textbox, enter [`y=[$h[1]]`]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`h(t)`] and [`y=[$h[1]]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection of [`h(t)`] and [`y=[$h[1]]`] in the first period. Desmos shows [`([$tShow[1]],[$h[1]])`] and [`([$tShow[2]],[$h[1]])`]. + +The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [`[$tShow[1]], [$tShow[2]]`] minutes. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos30.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos30.pg new file mode 100644 index 0000000000..d5ba2c990f --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos30.pg @@ -0,0 +1,213 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(d => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@t = (); @h = (); @tShow = (); +do { + do { + $high = random(30,40,1); + $low = random(-10,-5,1); + $a = ($high-$low)/2; + $b = Formula("(2*pi)/365"); + $c = random(5,30,1); + $e = ($high+$low)/2; + $func = Formula("-$a*cos($b*(d-$c))+$e"); + $p = 365; + $xHigh = $c+365/2; + + do { + $t[0] = random($c+5,300,1); + $T[0] = $func->eval(d=>$t[0]); + $T0Show = Round($T[0],3); + $T[1] = random($low+5,$high-5,1); + } until abs($T[0]-$T[1])>10; + $T[2] = $T[1]; + } until abs(($e-$T[1])/$a)<1; + $rad = arccos(($e-$T[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b)+$c; +$t[2] = -$rad/Compute($b)+$p+$c; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],3); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-10,400); +($ymin, $ymax) = ($low-10,$high+10); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-50; $i<$xmax; $i=$i+50) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"Celcius Degrees",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"days",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for d in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$T[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$T[1],red)); +$graph[0]->lb(new Label($t[1],$T[1],"($tShow[1],$T[1])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$T[2],red)); +$graph[0]->lb(new Label($t[2],$T[2],"($tShow[2],$T[2])",'red','center','bottom',large)); + +$alt[0] = "This is the graph of T(d)=[$func] and y=[$T[1]]. Their intersections ($tShow[1],$T[1]) and ($tShow[2],$T[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +$ld = $t[0]-int($t[0]/10)*10; +if ($ld==1) {$th = "st";} + elsif ($ld==2) {$th = "nd";} + else {$th = "th";} + +BEGIN_PGML + +Assume a year has 365 days, and [`d=1`] represents Jan. 1. A city's daily maximum temperature over the year, [`T(d)`], follows the pattern of a periodic function. The city's lowest daily maximum temperature, [`[$low]^{\circ} C`], happens on Jan. [`[$c]`]; its highest daily maximum temperature, [`[$high]^\circ C`], happens in July. + +*Use graphing technology* to answer the following questions. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`T(d)=`][________________________]{$func}. + +Part b: On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [_______________]{$T[0]} [`^{\circ} C`]. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [________________]{$ans}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`d=[$c]`], the function has it's minimum value at [`([$c],[$low])`]. Then the function increases. This change matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], and then increases. So we should choose to use the following function to model the daily maximum temperature: + + [``T(d)=-a\cos\left(b(d-c)\right)+e``] + +By given conditions, the function's maximum value is [`[$high]`], and its minimum value is [`[$low]`]. + +The function's [`e`] value (midline) is: + + [``\begin{aligned} + e &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+([$low])}{2} \\ + &= [$e]^{\circ} C + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-([$low])}{2} \\ + &= [$a]^{\circ} C + \end{aligned}``] + +The function's period is [`365`] days. By the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +Finally, the function's minimum value is at [`([$c],[$low])`], which matches [`(0,-1)`] on [`y=-\cos(x)`]. The graph of [`y=-\cos(x)`] needs to shift to the right by [`[$c]`] units to match the graph of [`T(d)`], implying [`c=[$c]`] in [`T(d)=-a\cos\left(b(d-c)\right)+e`]. + +The function's formula is + + [``T(d) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` T(d) = [$func] `]. + +###Part b + +To find the daily maximum temperature on the [`[$t[0]]`][$th] day, we need to substitute the function's [`d`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` T([$t[0]]) `]. Desmos shows [`[$T0Show]`]. + +On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [`[$T0Show] ^{\circ} C`]. + +###Part c + +To find when the daily maximum temperature was [`[$T[1]]^{\circ} C`], we need to create a second function [`y=[$T[1]]`], and then let desmos find the intersection between [`T(d)`] and [`y=[$T[1]]`]. + +Step 3: In the second textbox, enter [`y=[$T[1]]`]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`T(d)`] and [`y=[$T[1]]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection of [`T(d)`] and [`y=[$T[1]]`] in the first period. Desmos shows [`([$tShow[1]],[$T[1]])`] and [`([$tShow[2]],[$T[1]])`]. + +During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [`[$tShow[1]], [$tShow[2]]`]. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos40.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos40.pg new file mode 100644 index 0000000000..1a7e490fe8 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos40.pg @@ -0,0 +1,212 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(d => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@t = (); @h = (); @tShow = (); +do { + do { + $high = random(30,40,1); + $low = random(-10,-5,1); + $a = ($high-$low)/2; + $b = Formula("(2*pi)/365"); + $c = random(5,30,1); + $e = ($high+$low)/2; + $func = Formula("$a*cos($b*(d-$c))+$e"); + $p = 365; + $xLow = $c+365/2; + + do { + $t[0] = random($c+5,300,1); + $T[0] = $func->eval(d=>$t[0]); + $T0Show = Round($T[0],3); + $T[1] = random($low+5,$high-5,1); + } until abs($T[0]-$T[1])>10; + $T[2] = $T[1]; + } until abs(($T[1]-$e)/$a)<1; + $rad = arccos(($T[1]-$e)/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b)+$c; +$t[2] = -$rad/Compute($b)+$p+$c; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],3); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-10,400); +($ymin, $ymax) = ($low-10,$high+10); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-50; $i<$xmax; $i=$i+50) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"Celcius Degrees",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"days",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for d in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$T[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$T[1],red)); +$graph[0]->lb(new Label($t[1],$T[1],"($tShow[1],$T[1])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$T[2],red)); +$graph[0]->lb(new Label($t[2],$T[2],"($tShow[2],$T[2])",'red','center','bottom',large)); + +$alt[0] = "This is the graph of T(d)=[$func] and y=[$T[1]]. Their intersections ($tShow[1],$T[1]) and ($tShow[2],$T[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +$ld = $t[0]-int($t[0]/10)*10; +if ($ld==1) {$th = "st";} + elsif ($ld==2) {$th = "nd";} + else {$th = "th";} + +BEGIN_PGML + +Assume a year has 365 days, and [`d=1`] represents Jan. 1. A city's daily maximum temperature over the year, [`T(d)`], follows the pattern of a periodic function. The city's highest daily maximum temperature, [`[$high]^{\circ} C`], happens on Jan. [`[$c]`]; its lowest daily maximum temperature, [`[$low]^\circ C`], happens in July. + +*Use graphing technology* to answer the following questions. + +Part a: The function, as a transformation of [`y=\cos(x)`], is [`T(d)=`][________________________]{$func}. + +Part b: On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [_______________]{$T[0]} [`^{\circ} C`]. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [________________]{$ans}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`d=[$c]`], the function has it's maximum value at [`([$c],[$high])`]. Then the function decreases. This change matches the graph of [`y=\cos(x)`], which is at its maximum value when [`x=0`], and then decreases. So we should choose to use the following function to model the daily maximum temperature: + + [``T(d)=a\cos\left(b(d-c)\right)+e``] + +By given conditions, the function's maximum value is [`[$high]`], and its minimum value is [`[$low]`]. + +The function's [`e`] value (midline) is: + + [``\begin{aligned} + e &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+([$low])}{2} \\ + &= [$e]^{\circ} C + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-([$low])}{2} \\ + &= [$a]^{\circ} C + \end{aligned}``] + +The function's period is [`365`] days. By the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +Finally, the function's maximum value is at [`([$c],[$high])`], which matches [`(0,1)`] on [`y=\cos(x)`]. The graph of [`y=-cos(x)`] needs to shift to the right by [`[$c]`] units to match the graph of [`T(d)`], implying [`c=[$c]`] in [`T(d)=a\cos\left(b(d-c)\right)+e`]. + +The function's formula is + + [``T(d) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` T(d) = [$func] `]. + +###Part b + +To find the daily maximum temperature on the [`[$t[0]]`][$th] day, we need to substitute the function's [`d`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` T([$t[0]]) `]. Desmos shows [`[$T0Show]`]. + +On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [`[$T0Show] ^{\circ} C`]. + +###Part c + +To find when the daily maximum temperature was [`[$T[1]]^{\circ} C`], we need to create a second function [`y=[$T[1]]`], and then let desmos find the intersection between [`T(d)`] and [`y=[$T[1]]`]. + +Step 3: In the second textbox, enter [`y=[$T[1]]`]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`T(d)`] and [`y=[$T[1]]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection of [`T(d)`] and [`y=[$T[1]]`] in the first period. Desmos shows [`([$tShow[1]],[$T[1]])`] and [`([$tShow[2]],[$T[1]])`]. + +During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [`[$tShow[1]], [$tShow[2]]`]. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos50.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos50.pg new file mode 100644 index 0000000000..d378a2c732 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos50.pg @@ -0,0 +1,220 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@rad = (); +@t = (); @h = (); @tShow = (); +do { + do { + $a = random(10,30,0.1); + $p = random(1,5,0.1); + $b = 2*pi/$p; + $bTex = "\frac{2\pi}{$p}"; + $d = random($a+10,$a+20,0.1); + $func = Formula("$a*sin(((2*pi)/$p)*t)+$d"); + $high = $d+$a; + $low = $d-$a; + do { + $t[0] = random(1,3*$p-1,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h0Show = Round($h[0],3); + $h[1] = random($d-$a+1,$d+$a-1,0.1); + } until abs($h[0]-$h[1])>10; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad[1] = arcsin(($h[1]-$d)/$a); + $rad[2] = ($rad[1]>0) ? pi-$rad[1] : -pi-$rad[1]; +} until (abs($rad[1]*180/pi)>20) && (abs($rad[1]*180/pi)<75); + +$p2 = $p/2; +$p4 = $p/4; +$p34 = $p*3/4; + +$k = random(2,3,1); +$t[1] = $rad[1]/Compute($b)+$k*$p; +$t[2] = $rad[2]/Compute($b)+$k*$p; +$iL = $k*$p; +$iR = ($k+1)*$p; +if ( ($iL > $t[1]) || ($iL > $t[2]) ) { + $iL = ($k-1)*$p; + $iR = $k*$p; +} + +@radShow = ();@tShow = (); +$rad[0] = 0; +for my $i (0..2) { + $radShow[$i] = Round($rad[$i],3); + $tShow[$i] = Round($t[$i],3); +} + +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = ($iL-$p/2,$iR+$p/2); +($ymin, $ymax) = (-5,$high+5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-2; $i<$xmax; $i=$i+2) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"distance (cm)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$h[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$lr = ($t[1]<$t[2]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red',$lr,'bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$lr = ($t[2]<$t[1]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red',$lr,'bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func] and y=[$h[1]]. Their intersections ($tShow[1],$h[1]) and ($tShow[2],$h[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +A piston moves forward and backward when it runs. At the beginning [`(t=0)`], the piston was at its nutural position, [`[$d]`] inches from its base. The piston moved away from its base. [`[$p4]`] seconds since [`t=0`], the piston was at its farthest distance from its base, [`[$high]`] cm. Then, the piston moved back toward its base. [`[$p34]`] seconds since [`t=0`], the piston was at its closest distance from its base, [`[$low]`] cm. Then, it switched direction and moved toward its nutural position again. + +The function [`p(t)`] models the piston's distance from its base since it started to move at [`t=0`]. *Use graphing technology* to answer the following questions. + +Part a: The function, as a transformation of [`y=\sin(x)`], is [`p(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] seconds, the piston was [_______________]{$h[0]} cm away from its base. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [______________________]{$ans} seconds. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the piston is at its neutral position, or the middle of maximum and minimum values. This matches the graph of [`y=\sin(x)`], which is in the middle of maximum and minimum values when [`x=0`], so we should choose to use the following function to model the piston's position: + + [``p(t)=a\sin\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is in the middle of its maximum and minimum values when [`t=0`], just like [`y=\sin(x)`]. + +The function's midline is the average values of the function's maximum and minimum values: + + [``\begin{aligned} + d &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+[$low]}{2} \\ + &= [$d]\text{ cm} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-[$low]}{2} \\ + &= [$a]\text{ cm} + \end{aligned}``] + +The piston was at its maximum value at [`([$p4],[$high])`], and at its minimum value at [`([$p34],[$low])`]. The time in between is half of the period, so: + + [``\text{period}=2([$p34]-[$p4])=[$p]``] + +For the function [`p(t)=a\sin\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +The function's formula is + + [``p(t) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` h(t) = [$func] `]. + +###Part b + +To find the piston's position after [`[$t[0]]`] seconds, we need to substitute the function's [`t`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` p([$t[0]]) `]. Desmos shows [`[$h0Show]`]. + +After [`[$t[0]]`] seconds, the piston was [`[$h0Show]`] cm away from the base. + +###Part c + +To find when the piston was [`[$h[1]]`] cm away from its base, we need to create a second function [`y=[$h[1]]`], and then let desmos find the intersection between [`p(t)`] and [`y=[$h[1]]`]. + +Step 3: In the second textbox, enter [`y=[$h[1]]`]. + +Step 4: Since we only want to find intersections in [`t\in([$iL],[$iR])`], click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis to that interval. Now you can see the intersection of [`p(t)`] and [`y=[$h[1]]`]. + +Step 5: Click on the intersection of [`p(t)`] and [`y=[$h[1]]`]. Desmos shows [`([$tShow[1]],[$h[1]])`] and [`([$tShow[2]],[$h[1]])`]. + +During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [`[$tShow[1]], [$tShow[2]]`] seconds. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos60.pg b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos60.pg new file mode 100644 index 0000000000..090bec6774 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos60.pg @@ -0,0 +1,218 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@rad = (); +@t = (); @h = (); @tShow = (); +do { + do { + $a = random(10,30,0.1); + $p = random(1,5,0.1); + $b = 2*pi/$p; + $bTex = "\frac{2\pi}{$p}"; + $d = random($a+10,$a+20,0.1); + $func = Formula("$a*cos(((2*pi)/$p)*t)+$d"); + $high = $d+$a; + $low = $d-$a; + do { + $t[0] = random(1,3*$p-1,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h0Show = Round($h[0],3); + $h[1] = random($d-$a+1,$d+$a-1,0.1); + } until abs($h[0]-$h[1])>10; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad[1] = arccos(($h[1]-$d)/$a); + $rad[2] = -$rad[1]; +} until (abs($rad[1]*180/pi)>20) && (abs($rad[1]*180/pi)<75); + +$p2 = $p/2; + +$k = random(2,3,1); +$t[1] = $rad[1]/Compute($b)+$k*$p; +$t[2] = $rad[2]/Compute($b)+$k*$p; +$iL = $k*$p+$p2; +$iR = ($k+1)*$p+$p2; +if ( ($iL > $t[1]) || ($iL > $t[2]) ) { + $iL = ($k-1)*$p+$p2; + $iR = $k*$p+$p2; +} + +@radShow = ();@tShow = (); +$rad[0] = 0; +for my $i (0..2) { + $radShow[$i] = Round($rad[$i],23); + $tShow[$i] = Round($t[$i],3); +} + +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = ($iL-$p,$iR+$p); +($ymin, $ymax) = (-5,$high+5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-2; $i<$xmax; $i=$i+2) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"distance (cm)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$h[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$lr = ($t[1]<$t[2]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red',$lr,'bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$lr = ($t[2]<$t[1]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red',$lr,'bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func] and y=[$h[1]]. Their intersections ($tShow[1],$h[1]) and ($tShow[2],$h[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +A piston moves forward and backward when it runs. At the beginning [`(t=0)`], the piston was at its farthest distance from its base, [`[$high]`] cm. Then, the piston moved back toward its base. [`[$p2]`] seconds later, the piston was at its closest distance from its base, [`[$low]`] cm. Then, it switched direction and moved away from its base. + +The function [`p(t)`] models the piston's distance from its base since it started to move at [`t=0`]. *Use graphing technology* to answer the following questions. + +Part a: The function, as a transformation of [`y=\cos(x)`], is [`p(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] seconds, the piston was [_______________]{$h[0]} cm away from its base. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [______________________]{$ans} seconds. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the piston is at its farthest position, or maximum value. This matches the graph of [`y=\cos(x)`], which is at its maximum value when [`x=0`], so we should choose to use the following function to model the piston's position: + + [``p(t)=a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its maximum value when [`t=0`], just like [`y=\cos(x)`]. + +The function's midline is the average values of the function's maximum and minimum values: + + [``\begin{aligned} + d &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+[$low]}{2} \\ + &= [$d]\text{ cm} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-[$low]}{2} \\ + &= [$a]\text{ cm} + \end{aligned}``] + +The piston was at its maximum value at [`(0,[$high])`], and at its minimum value at [`([$p2],[$low])`]. The time in between is half of the period, so: + + [``\text{period}=2([$p2]-0)=[$p]``] + +For the function [`p(t)=a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +The function's formula is + + [``p(t) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` h(t) = [$func] `]. + +###Part b + +To find the piston's position after [`[$t[0]]`] seconds, we need to substitute the function's [`t`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` p([$t[0]]) `]. Desmos shows [`[$h0Show]`]. + +After [`[$t[0]]`] seconds, the piston was [`[$h0Show]`] cm away from the base. + +###Part c + +To find when the piston was [`[$h[1]]`] cm away from its base, we need to create a second function [`y=[$h[1]]`], and then let desmos find the intersection between [`p(t)`] and [`y=[$h[1]]`]. + +Step 3: In the second textbox, enter [`y=[$h[1]]`]. + +Step 4: Since we only want to find intersections in [`t\in([$iL],[$iR])`], click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis to that interval. Now you can see the intersection of [`p(t)`] and [`y=[$h[1]]`]. + +Step 5: Click on the intersection of [`p(t)`] and [`y=[$h[1]]`]. Desmos shows [`([$tShow[1]],[$h[1]])`] and [`([$tShow[2]],[$h[1]])`]. + +During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [`[$tShow[1]], [$tShow[2]]`] seconds. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation10.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation10.pg new file mode 100644 index 0000000000..1da0e37e81 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation10.pg @@ -0,0 +1,301 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("LimitedRadical"); + + +%values = ( +#[sin^-1(x), sin^-1(x) in [0,2pi], +#value opposite to sin^-1(x), value opposite to sin^-1(x) in [0,2pi] + "0" => [ + ["0","0","pi","pi"], + ["pi/2","pi/2","-pi/2","(3pi)/2"], + ["0","0","pi","pi"], + ], + "1/2" => [ + ["pi/6","pi/6","(5pi)/6","(5pi)/6"], + ["pi/3","pi/3","-pi/3","(5pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "-1/2" => [ + ["-pi/6","(11pi)/6","-(5pi)/6","(7pi)/6"], + ["(2pi)/3","(2pi)/3","-(2pi)/3","(4pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(2)/2" => [ + ["pi/4","pi/4","(3pi)/4","(3pi)/4"], + ["pi/4","pi/4","-pi/4","(7pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(2)/2" => [ + ["-pi/4","(7pi)/4","-(3pi)/4","(5pi)/4"], + ["(3pi)/4","(3pi)/4","-(3pi)/4","(5pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(3)/2" => [ + ["pi/3","pi/3","(2pi)/3","(2pi)/3"], + ["pi/6","pi/6","-pi/6","(11pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(3)/2" => [ + ["-pi/3","(5pi)/3","-(2pi)/3","(4pi)/3"], + ["(5pi)/6","(5pi)/6","-(5pi)/6","(7pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "1" => [ + ["pi/2","pi/2","DNE","DNE"], + ["0","0","DNE","DNE"], + ["pi/4","pi/4","(5pi)/4","(5pi)/4"], + ], + "-1" => [ + ["-pi/2","(3pi)/2","DNE","DNE"], + ["pi","pi","DNE","DNE"], + ["-pi/4","(7pi)/4","(3pi)/4","(3pi)/4"], + ], + "sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/6","pi/6","-(5pi)/6","(7pi)/6"], + ], + "-sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/6","(11pi)/6","(5pi)/6","(5pi)/6"], + ], + "sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/3","pi/3","-(2pi)/3","(4pi)/3"], + ], + "-sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/3","(5pi)/3","(2pi)/3","(2pi)/3"], + ], +); + +@hashKeys = lex_sort(keys %values); +do { + $sinValue = $hashKeys[random(0,$#hashKeys,1)]; +} until ($values{$sinValue}[0][0] ne "DNE"); + +$left = "\sin(x)"; +$right = Formula("$sinValue")->TeX; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +Context()->variables->add(k => "Real"); +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +$ans0 = $values{$sinValue}[0][0]; +$ans0alt = $values{$sinValue}[0][1]; +$ans0k = Formula("$ans0+2*k*pi"); +$ans0altk = Formula("$ans0alt+2*k*pi"); + +$ans1 = $values{$sinValue}[0][2]; +if ($ans1 eq "DNE") { + $ans = OneOf( $ans0k,$ans0altk ); + $ansShow = List(Formula("$ans0+2*k*pi")); +} else { + $ans1alt = $values{$sinValue}[0][3]; + $ans1k = Formula("$ans1+2*k*pi"); + $ans1altk = Formula("$ans1alt+2*k*pi"); + $ans = OneOf( + List($ans0k,$ans1k), + List($ans0altk,$ans1k), + List($ans0k,$ans1altk), + List($ans0altk,$ans1altk) + ); + $ansShow = List(Formula("$ans0+2*k*pi"),Formula("$ans1+2*k*pi")); + if ($ans0 eq "0") { + $ans = OneOf( + List(Formula("2*k*pi"),Formula("$ans1+2*k*pi")), + Formula("k*pi") + ); + $ansShow = List(Formula("2*k*pi"),Formula("$ans1+2*k*pi")); + } +} + +$r = 5; +$Pr = Compute($ans0); +$Px = $r*cos($Pr); +$Py = $r*sin($Pr); + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph->stamps(closed_circle($Px,$Py,red)); +$graph->moveTo(0,0); +$graph->lineTo($Px,$Py,red,2); +$graph->lineTo($Px,0,red,2); +$graph->lineTo(0,0,red,2); + +if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); +} + +$td = $Py>=0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px,$Py,"P: $ans0",'red','center',$td,large)); + +$alt = "This is the graph of a circle with point P: $ans0 on the circle."; + +if ($ans1 ne "DNE") { + $Qr = Compute($ans1); + $Qx = $r*cos($Qr); + $Qy = $r*sin($Qr); + + $graph->stamps(closed_circle($Qx,$Qy,red)); + $graph->moveTo(0,0); + $graph->lineTo($Qx,$Qy,red,2); + $graph->lineTo($Qx,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Qx!=0) && ($Qy!=0) ) { + $xShift = ($Qx>0) ? -0.4 : 0.4; + $yShift = ($Qy>0) ? 0.4 : -0.4; + $graph->moveTo($Qx,$yShift); + $graph->lineTo($Qx+$xShift,$yShift,red,2); + $graph->lineTo($Qx+$xShift,0,red,2); + } + + $td = $Qy>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Qx,$Qy,"Q: $ans1",'red','center',$td,large)); + + $alt = "This is the graph of a circle with point P: $ans0 and Q: $ans1 on the circle. From each point, a vertical line is drawn until it reaches the x-axis, showing they have the same distance to the x-axis."; +} + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right]``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use [|k*pi|]* to represent multiples of [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +."\n" +.'* Example: type [|3pi/4+2k*pi|]* to represent [`\frac{3\pi}{4}+2k\pi`].' +)@]** + + [`x=`][________________________________________]{$ans->cmp(correct_ans_latex_string=>$ansShow->TeX)} + + +END_PGML + +############################################################## + +Context("LimitedRadical"); +Context()->variables->add(k => "Real"); + +$s1 = Formula("$ans0"); + +if ($values{$sinValue}[0][2] eq "DNE") { + $output0 = "Only one point "; +} else { + $output0 = "Two points "; +} + +$output1 = ""; +if ($values{$sinValue}[0][0] ne $values{$sinValue}[0][1]) { + $output1 = "\text{Note that }".$ans0k->TeX."\text{ and }".$ans0altk->TeX."\text{ are equivalent. }\\"; +} +if ($values{$sinValue}[0][2] ne $values{$sinValue}[0][3]) { + if ($output1 ne "") { + $output1 .= "\text{Also, }"; + } else { + $output1 .= "\text{Note that }"; + } + $output1 .= $ans1k->TeX."\text{ and }".$ans1altk->TeX."\text{ are equivalent.}"; +} + +if ($ans0 eq "0") { + $output1 = "\text{Note that }x=".$ansShow->TeX."\text{ and }x=".Formula("k*pi")->TeX."\text{ are equivalent.}"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + x &= \sin^{-1}\left([$right]\right) \\ + x &= [$s1] + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$left]=[$right]`] true: + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[$output0] on the Unit Circle can make the equation true. The equation's solution is: + + [``x=[$ansShow]\text{, where }k\text{ is any integer.}``] + +[`[$output1]`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation100.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation100.pg new file mode 100644 index 0000000000..b1c1ba03cd --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation100.pg @@ -0,0 +1,203 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@values = ( + Formula("1"),-Formula("1"), + Formula("sqrt(3)"),-Formula("sqrt(3)"), + Formula("sqrt(3)/3"),-Formula("sqrt(3)/3"), +); + +%ab = ( + Formula("1") => [Formula("1"),-Formula("1")], + -Formula("1") => [Formula("1"),Formula("1")], + Formula("sqrt(3)") => [Formula("1"),-Formula("sqrt(3)")], + -Formula("sqrt(3)") => [Formula("1"),Formula("sqrt(3)")], + Formula("sqrt(3)/3") => [Formula("3"),-Formula("sqrt(3)")], + -Formula("sqrt(3)/3") => [Formula("3"),Formula("sqrt(3)")], +); + +@start = (); +$start[0] = Formula("0"); +$tanV = $values[random(0,$#values,1)]; +$start[1] = specialAngle(arctan(Compute($tanV))); + +$a1 = $ab{$tanV}->[0]; +$b1 = $ab{$tanV}->[1]; + +$left = ($a1 == 1) ? "\tan^2(x)" : $a1->TeX."\tan^2(x)"; +$b1N = $b1>0 ? -$b1 : Formula(substr($b1,1)); +if (abs($b1)==1) { + $right = ($b1 == 1) ? "-\tan(x)" : "\tan(x)"; +} else { + $right = ($b1N == 1) ? "\tan(x)" : $b1N->TeX."\tan(x)"; +} + +@k = (); +$k[0] = 1; +$points = "0, pi, "; +@ansL = (Formula("0"),Formula("pi")); +for my $i (-2..2) { + my $c = Compute($start[1]->string)+$i*pi; + if ( ($c>=0) && ($c<2*pi) ) { + $ansL[scalar(@ansL)] = specialAngle($c); + $k[scalar(@k)] = $i; + $points .= $ansL[scalar(@ansL)-1]->string.", "; + } +} +$points = substr($points,0,length($points)-2); +$ans = List(@ansL); + +$r = 5; +for my $i (0..0) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@ansL)-1) { + $Px = Compute("$r*cos($ansL[$j])")->reduce; + $Py = Compute("$r*sin($ansL[$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$ansL[$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + + +if ( (abs($a1)==1) && (abs($b1)==1) ) { + $s1 = ($b1>0) ? "\tan^2(x)+\tan(x)" : "\tan^2(x)-\tan(x)"; + $s2 = ($b1>0) ? "\tan(x)\left(\tan(x)+1\right)" : "\tan(x)\left(\tan(x)-1\right)"; + $s3 = ($b1>0) ? "\tan(x)+1" : "\tan(x)-1"; +} elsif (abs($a1)==1) { + $s1 = ($b1>0) ? "\tan^2(x)+".$b1->TeX."\tan(x)" : "\tan^2(x)".$b1->TeX."\tan(x)"; + $s2 = ($b1>0) ? "\tan(x)\left(\tan(x)+".$b1->TeX."\right)" : "\tan(x)\left(\tan(x)".$b1->TeX."\right)"; + $s3 = ($b1>0) ? "\tan(x)+".$b1->TeX : "\tan(x)".$b1->TeX; +} elsif (abs($b1)==1) { + $s1 = ($b1>0) ? $a1->TeX."\cdot\tan^2(x)+\tan(x)" : $a1->TeX."\cdot\tan^2(x)-\tan(x)"; + $s2 = ($b1>0) ? "\tan(x)\left(".$a1->TeX."\cdot\tan(x)+1\right)" : "\tan(x)\left(".$a1->TeX."\cdot\tan(x)-1\right)"; + $s3 = ($b1>0) ? $a1->TeX."\cdot\tan(x)+1" : $a1->TeX."\cdot\tan(x)-1"; +} else { + $s1 = ($b1>0) ? $a1->TeX."\cdot\tan^2(x)+".$b1->TeX."\tan(x)" : $a1->TeX."\cdot\tan^2(x)".$b1->TeX."\tan(x)"; + $s2 = ($b1>0) ? "\tan(x)\left(".$a1->TeX."\cdot\tan(x)+".$b1->TeX."\right)" : "\tan(x)\left(".$a1->TeX."\cdot\tan(x)".$b1->TeX."\right)"; + $s3 = ($b1>0) ? $a1->TeX."\cdot\tan(x)+".$b1->TeX : $a1->TeX."\cdot\tan(x)".$b1->TeX; +} + + + + +############################################################## + +BEGIN_PGML_SOLUTION +[`[$t1]`] + [``\begin{aligned} + [$left] &= [$right] \\ + [$s1] &= 0 \\ + [$s2] &= 0 \\ + \tan(x) &= 0\text{ or }[$s3]=0 \\ + \tan(x) &= 0\text{ or }\tan(x)=[$tanV] \\ + x &= \tan^{-1}(0) \text{ or } \tan^{-1}\left([$tanV]\right) \\ + x &= 0 \text{ or } [$start[1]] + \end{aligned}``] + +Recall that the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right) `]. On the Unit Circle, we need to identify all values, in [`[0,2\pi)`], which make [`\tan(x) = 0\text{ or }[$s3]=0`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation110.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation110.pg new file mode 100644 index 0000000000..d4e2f8c72c --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation110.pg @@ -0,0 +1,226 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +%ab = ( + Formula("1/2") => [Formula("2"),-Formula("1")], + -Formula("1/2") => [Formula("2"),Formula("1")], + Formula("1") => [Formula("1"),-Formula("1")], + -Formula("1") => [Formula("1"),Formula("1")], +); + +@sinV = (); +$sinV[0] = list_random(Formula("1"),-Formula("1"),"DNE"); +if ($sinV[0] eq "DNE") { + $sinV[0] = random(2,5,1)*random(-1,1,2); + $ab{Formula($sinV[0])} = [Formula("1"),-Formula("$sinV[0]")]; +} +$sinV[1] = list_random(Formula("1/2"),-Formula("1/2")); + +#$start[0][#] are points in first graph with inverse trig values +#$start[1][#] are points in second graph with solutions +@start = (); +if (abs($sinV[0])==1) + {$start[0][0]=specialAngle(arcsin(Compute($sinV[0])));} +$start[0][scalar(@{$start[0]})] = specialAngle(arcsin(Compute($sinV[1]))); +if ($start[0][scalar(@{$start[0]})-1]>0) { + $start[0][scalar(@{$start[0]})]=specialAngle(pi-Compute($start[0][scalar(@{$start[0]})-1])); + } else { + $start[0][scalar(@{$start[0]})]=specialAngle(-pi-Compute($start[0][scalar(@{$start[0]})-1])); + } + + +$a0 = Compute($ab{$sinV[0]}->[0]); +$b0 = Compute($ab{$sinV[0]}->[1]); +$a1 = Compute($ab{$sinV[1]}->[0]); +$b1 = Compute($ab{$sinV[1]}->[1]); +$b0N = Compute(-$b0); +$b1N = Compute(-$b1); + +$factor0 = ($b0>0) ? "\sin(x)+$b0" : "\sin(x)$b0"; +$factor1 = ($b1>0) ? "2\sin(x)+1" : "2\sin(x)-1"; + +$c = Compute($a0*$b1+$a1*$b0); +$d = Compute($b0*$b1); +if (abs($c)==1) { + $quadEquation = ($c>0) ? "2\sin^2(x)+\sin(x)+$d" : "2\sin^2(x)-\sin(x)+$d"; + $left = ($c>0) ? "\sin(x)+2" : "-\sin(x)+2"; +} else { + $quadEquation = "2\sin^2(x)+$c\sin(x)+$d"; + $left = "$c\sin(x)+2"; +} +$right = "2\cos^2(x)-$d"; + +@points = ""; +if ($sinV[0]==1) { + $points[0] .= "pi/2, $start[0][1] and $start[0][2]"; +} elsif ($sinV[0]==-1) { + $points[0] .= "-pi/2, $start[0][1] and $start[0][2]"; +} else { + $points[0] .= "$start[0][0] and $start[0][1]"; +} + +for my $j (0..scalar(@{$start[0]})-1) { + for my $i (-2..2) { + my $c = Compute($start[0][$j]->string)+2*$i*pi; + if ( ($c>=0) && ($c<2*pi) ) { + $start[1][scalar(@{$start[1]})] = specialAngle($c); + $points[1] .= $start[1][scalar(@{$start[1]})-1]->string.", "; + } + } +} +$points[1] = substr($points[1],0,length($points[1])-2); +$ans = List(@{$start[1]}); + +$r = 5; +for my $i (0..1) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$start[$i]})-1) { + $Px = Compute("$r*cos($start[$i][$j])")->reduce; + $Py = Compute("$r*sin($start[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$start[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +$right1 = "2\left(1-\sin^2(x)\right)-$d"; +$right2 = "2-2\sin^2(x)-$d"; + +$s1 = ""; +if (abs($b0N)>1) { + $s1 = "\sin^{-1}($b0N) \text{ has no solution.}"; + $s2 = "x=\sin^{-1}\left(".$sinV[1]->TeX."\right)"; +} else { + $s2 = "x=\sin^{-1}\left(".$sinV[1]->TeX."\right) \text{ or } x=\sin^{-1}($b0N)"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + +When there are [`\sin(x)`] and [`\cos(x)`] in the same equation, we should try to use the formula [`\sin^2(x)+\cos^2(x)=1`] to remove one of them. + + [``\begin{aligned} + [$left] &= [$right] \\ + [$left] &= [$right1] \\ + [$left] &= [$right2] \\ + [$quadEquation] &= 0 \\ + ([$factor1])([$factor0]) &= 0 \\ + [$factor1] &=0 \text{ or } [$factor0]=0 \\ + \sin(x) &= [$sinV[1]] \text{ or } \sin(x) = [$b0N] \\ + x &= \sin^{-1}\left([$sinV[1]]\right) \text{ or } x=\sin^{-1}([$b0N]) \\ + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. [`[$s1]`] + +On the Unit Circle, we need to identify all values which make [`[$s2]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We need to find corresponding values in the range of [`[0,2\pi)`]: + +>>[@ $fig[1] @]*<< + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation120.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation120.pg new file mode 100644 index 0000000000..86a05756a4 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation120.pg @@ -0,0 +1,235 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + do { + $a = non_zero_random(-5,5,1); + $b = non_zero_random(-5,5,1); + $c = non_zero_random(-5,5,1); + $d = ($b)**2-4*$a*$c; + } until $d > 0 && gcd($a,gcd($b,$c))==1; + $x0 = (-$b-sqrt($d))/(2*$a); + $x1 = (-$b+sqrt($d))/(2*$a); +} until abs($x0)<=1 || abs($x1)<=1; +$x0Show = Round($x0,2); +$x1Show = Round($x1,2); + +$left = ""; +if (abs($a)==1) { + $left .= $a>0 ? "\cos^2(x)" : "-\cos^2(x)"; +} else { + $left .= "$a\cos^2(x)"; +} + +if (abs($b)==1) { + $left .= $b>0 ? "+\cos(x)" : "-\cos(x)"; +} else { + $left .= $b>0 ? "+$b\cos(x)" : "$b\cos(x)"; +} +$left .= "+$c"; +$right = "0"; + +@cosV = (); @cosVShow = (); +if (abs($x0)<=1) { + $cosV[scalar(@cosV)] = $x0; + $cosVShow[scalar(@cosVShow)] = Round($x0,2); +} +if (abs($x1)<=1) { + $cosV[scalar(@cosV)] = $x1; + $cosVShow[scalar(@cosVShow)] = Round($x1,2); +} + +#$start[0][#] are points in first graph with inverse trig values +#$start[1][#] are points in second graph with solutions +@start = (); @points = ""; +for my $i (0..scalar(@cosV)-1) { + $start[0][scalar(@{$start[0]})] = arccos($cosV[$i]); + $points[0] .= Round(arccos($cosV[$i]),2).", "; + $start[0][scalar(@{$start[0]})] = -arccos($cosV[$i]); + $points[0] .= Round(-arccos($cosV[$i]),2).", "; +} +$points[0] = substr($points[0],0,length($points[0])-2); + +for my $j (0..scalar(@{$start[0]})-1) { + for my $i (-2..2) { + my $c = $start[0][$j]+2*$i*pi; + if ( ($c>=0) && ($c<2*pi) ) { + $start[1][scalar(@{$start[1]})] = $c; + $points[1] .= Round($c,2).", "; + } + } +} +$points[1] = substr($points[1],0,length($points)-2); +$ans = List(@{$start[1]}); + +@startShow = (); +for my $i (0..scalar(@start)-1) { + for my $j (0..scalar(@{$start[$i]})-1) { + $startShow[$i][$j] = Round($start[$i][$j],2); + } +} + +$r = 5; +for my $i (0..1) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$start[$i]})-1) { + $Px = Compute("$r*cos($start[$i][$j])")->reduce; + $Py = Compute("$r*sin($start[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$startShow[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|1.12, 3.24|]*.' +."\n" +.'* Use a calculator to calculate inverse trigonometry values.' +."\n" +.'* Type radian answers. There is no need to use [`\pi`] in your answers.' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +$right1 = "2\left(1-\sin^2(x)\right)-$d"; +$right2 = "2-2\sin^2(x)-$d"; + +$s1 = ""; +if (abs($x0)>1) { + $s1 = "\cos^{-1}($x0Show) \text{ has no solution.}"; + $s2 = "\cos(x)=$x1Show"; +} elsif (abs($x1)>1) { + $s1 = "\cos^{-1}($x1Show) \text{ has no solution.}"; + $s2 = "\cos(x)=$x0Show"; +} else { + $s2 = "\cos(x)=$x0Show \text{ and } \cos(x)=$x1Show"; +} + +$s3 = ""; +for my $i (0..scalar(@{$start[0]})-1) { + if ($start[0][$i]<0) { + $s3 .= "$startShow[0][$i]+2\pi&=$startShow[1][$i]\\"; + } +} + +############################################################## + +BEGIN_PGML_SOLUTION + +We will use the quadratic formula [` x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} `] to solve this equation: + + [``\begin{aligned} + [$left] &= [$right] \\ + \cos(x) &= \frac{-([$b])\pm\sqrt{([$b])^2-4([$a])([$c])}}{2([$a])} \\ + \cos(x) &\approx [$x0Show] \text{ or } \cos(x) \approx [$x1Show] \\ + x &\approx \cos^{-1}\left([$x0Show]\right) \text{ or } x\approx\cos^{-1}([$x1Show]) \\ + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. [`[$s1]`] + +On the Unit Circle, we need to identify all values which make [`[$s2]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We need to find corresponding values in the range of [`[0,2\pi)`]: + +>>[@ $fig[1] @]*<< + +We did: + + [``\begin{aligned} + [$s3] + \end{aligned}``] + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation130.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation130.pg new file mode 100644 index 0000000000..389293bc5d --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation130.pg @@ -0,0 +1,195 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +%ab = ( + "1/2" => -Formula("1"), + "-1/2" => Formula("1"), + "sqrt(2)/2" => -Formula("sqrt(2)"), + "-sqrt(2)/2" => Formula("sqrt(2)"), + "sqrt(3)/2" => -Formula("sqrt(3)"), + "-sqrt(3)/2" => Formula("sqrt(3)"), +); + +$cosV = list_random("1/2","sqrt(2)/2","sqrt(3)/2","-1/2","-sqrt(2)/2","-sqrt(3)/2"); + +#$start[0][#] are points in first graph with inverse trig values +#$start[1][#] are points in second graph with solutions +@start = (); +$start[0][0] = Formula("0"); +$start[0][1] = Formula("pi"); +$start[0][2] = specialAngle(arccos(Compute($cosV))); +$start[0][3] = -specialAngle(arccos(Compute($cosV))); + +$start[1][0] = Formula("0"); +$start[1][1] = Formula("pi"); +$start[1][2] = $start[0][2]; +$start[1][3] = specialAngle(2*pi+Compute($start[0][3])); + +$a1 = 2; +$b1 = $ab{$cosV}; +$b1N = ($b1>0) ? -Formula($b1) : Formula(substr($b1,1)); + +$factor0 = "\sin(x)"; +$factor1 = ($b1>0) ? "2\cos(x)+".$b1->TeX : "2\cos(x)".$b1->TeX; + +$left = "\sin(2x)"; +$left1 = "2\sin(x)\cos(x)"; +if (abs($b1) == 1) { + $left1 .= ($b1>0) ? "+" : "-"; +} else { + $left1 .= ($b1>0) ? "+".$b1->TeX : $b1->TeX; +} +$left1 .= "\sin(x)"; + +$right = ""; +if (abs($b1N) == 1) { + $right .= ($b1N>0) ? "\sin(x)" : "-\sin(x)"; +} else { + $right .= $b1N->TeX."\sin(x)"; +} + +@points = (); +$points[0] .= "0, pi, $start[0][2] and $start[0][3]"; +$points[1] .= "0, pi, $start[0][2] and $start[1][3]"; +$ans = List(@{$start[1]}); + +$r = 5; +for my $i (0..1) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$start[$i]})-1) { + $Px = Compute("$r*cos($start[$i][$j])")->reduce; + $Py = Compute("$r*sin($start[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$start[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +$s1 = Formula($cosV); + +############################################################## + +BEGIN_PGML_SOLUTION + +To solve the equation, we need to use the formula [`\sin(2x)=2\sin(x)\cos(x)`]: + + [``\begin{aligned} + [$left] &= [$right] \\ + 2\sin(x)\cos(x) &= [$right] \\ + [$left1] &= 0 \\ + [$factor0]\left([$factor1]\right) &= 0 \\ + [$factor0] &=0 \text{ or } [$factor1]=0 \\ + \sin(x) &= 0 \text{ or } \cos(x) = [$s1] \\ + x &= \sin^{-1}\left(0\right) \text{ or } x=\cos^{-1}([$s1]) \\ + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] and [`\cos^{-1}(x)`] are both [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. On the Unit Circle, we need to identify all values which make [`\sin(x) = 0 \text{ or } \cos(x) = [$s1]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We need to find corresponding values in the range of [`[0,2\pi)`]: + +>>[@ $fig[1] @]*<< + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation140.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation140.pg new file mode 100644 index 0000000000..32581de705 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation140.pg @@ -0,0 +1,235 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +%ab = ( + Formula("1/2") => [Formula("2"),-Formula("1")], + -Formula("1/2") => [Formula("2"),Formula("1")], + Formula("1") => [Formula("1"),-Formula("1")], + -Formula("1") => [Formula("1"),Formula("1")], +); + +@sinV = (); +$sinV[0] = list_random(Formula("1"),-Formula("1"),"DNE"); +if ($sinV[0] eq "DNE") { + $sinV[0] = random(2,5,1)*random(-1,1,2); + $ab{Formula($sinV[0])} = [Formula("1"),-Formula("$sinV[0]")]; +} +$sinV[1] = list_random(Formula("1/2"),-Formula("1/2")); + +#$start[0][#] are points in first graph with inverse trig values +#$start[1][#] are points in second graph with solutions +@start = (); +if (abs($sinV[0])==1) + {$start[0][0]=specialAngle(arcsin(Compute($sinV[0])));} +$start[0][scalar(@{$start[0]})] = specialAngle(arcsin(Compute($sinV[1]))); +if ($start[0][scalar(@{$start[0]})-1]>0) { + $start[0][scalar(@{$start[0]})]=specialAngle(pi-Compute($start[0][scalar(@{$start[0]})-1])); + } else { + $start[0][scalar(@{$start[0]})]=specialAngle(-pi-Compute($start[0][scalar(@{$start[0]})-1])); + } + + +$a0 = Compute($ab{$sinV[0]}->[0]); +$b0 = Compute($ab{$sinV[0]}->[1]); +$a1 = Compute($ab{$sinV[1]}->[0]); +$b1 = Compute($ab{$sinV[1]}->[1]); +$b0N = Compute(-$b0); +$b1N = Compute(-$b1); + +$factor0 = ($b0>0) ? "\sin(x)+$b0" : "\sin(x)$b0"; +$factor1 = ($b1>0) ? "2\sin(x)+1" : "2\sin(x)-1"; + +$c = Compute($a0*$b1+$a1*$b0); +$d = Compute($b0*$b1); +if (abs($c)==1) { + $quadEquation = ($c>0) ? "2\sin^2(x)+\sin(x)+$d" : "2\sin^2(x)-\sin(x)+$d"; + $left = ($c>0) ? "\sin(x)+2" : "-\sin(x)+2"; +} else { + $quadEquation = "2\sin^2(x)+$c\sin(x)+$d"; + $left = "$c\sin(x)+2"; +} +$right = "2\cos^2(x)-$d"; +$e = 1-$d; +$right0 = $e==0 ? "\cos(2x)" : "\cos(2x)+$e"; +$right01 = $e==0 ? "1-2\sin^2(x)" : "1-2\sin^2(x)+$e"; + +@points = ""; +if ($sinV[0]==1) { + $points[0] .= "pi/2, $start[0][1] and $start[0][2]"; +} elsif ($sinV[0]==-1) { + $points[0] .= "-pi/2, $start[0][1] and $start[0][2]"; +} else { + $points[0] .= "$start[0][0] and $start[0][1]"; +} + +for my $j (0..scalar(@{$start[0]})-1) { + for my $i (-2..2) { + my $c = Compute($start[0][$j]->string)+2*$i*pi; + if ( ($c>=0) && ($c<2*pi) ) { + $start[1][scalar(@{$start[1]})] = specialAngle($c); + $points[1] .= $start[1][scalar(@{$start[1]})-1]->string.", "; + } + } +} +$points[1] = substr($points[1],0,length($points[1])-2); +$ans = List(@{$start[1]}); + +$r = 5; +for my $i (0..1) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$start[$i]})-1) { + $Px = Compute("$r*cos($start[$i][$j])")->reduce; + $Py = Compute("$r*sin($start[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$start[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right0] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +$right1 = "2\left(1-\sin^2(x)\right)-$d"; +$right2 = "2-2\sin^2(x)-$d"; + +$s1 = ""; +if (abs($b0N)>1) { + $s1 = "\sin^{-1}($b0N) \text{ has no solution.}"; + $s2 = "x=\sin^{-1}\left(".$sinV[1]->TeX."\right)"; +} else { + $s2 = "x=\sin^{-1}\left(".$sinV[1]->TeX."\right) \text{ or } x=\sin^{-1}($b0N)"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + +There are 3 ways to convert [`\cos(2x)`]: + + [``\begin{aligned} + \cos(2x) &= \cos^2(x)-\sin^2(x) \\ + \cos(2x) &= 2\cos^2(x)-1 \\ + \cos(2x) &= 1-2\sin^2(x) \\ + \end{aligned}``] + +Since the equation has [`\sin(x)`], we should choose [`\cos(2x) = 1-2\sin^2(x)`]. The solution is: + + [``\begin{aligned} + [$left] &= [$right0] \\ + [$left] &= [$right01] \\ + [$quadEquation] &= 0 \\ + ([$factor1])([$factor0]) &= 0 \\ + [$factor1] &=0 \text{ or } [$factor0]=0 \\ + \sin(x) &= [$sinV[1]] \text{ or } \sin(x) = [$b0N] \\ + x &= \sin^{-1}\left([$sinV[1]]\right) \text{ or } x=\sin^{-1}([$b0N]) \\ + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. [`[$s1]`] + +On the Unit Circle, we need to identify all values which make [`[$s2]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We need to find corresponding values in the range of [`[0,2\pi)`]: + +>>[@ $fig[1] @]*<< + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation20.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation20.pg new file mode 100644 index 0000000000..236581099d --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation20.pg @@ -0,0 +1,300 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("LimitedRadical"); + + +%values = ( +#[sin^-1(x), sin^-1(x) in [0,2pi], +#value opposite to sin^-1(x), value opposite to sin^-1(x) in [0,2pi] + "0" => [ + ["0","0","pi","pi"], + ["pi/2","pi/2","-pi/2","(3pi)/2"], + ["0","0","pi","pi"], + ], + "1/2" => [ + ["pi/6","pi/6","(5pi)/6","(5pi)/6"], + ["pi/3","pi/3","-pi/3","(5pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "-1/2" => [ + ["-pi/6","(11pi)/6","-(5pi)/6","(7pi)/6"], + ["(2pi)/3","(2pi)/3","-(2pi)/3","(4pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(2)/2" => [ + ["pi/4","pi/4","(3pi)/4","(3pi)/4"], + ["pi/4","pi/4","-pi/4","(7pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(2)/2" => [ + ["-pi/4","(7pi)/4","-(3pi)/4","(5pi)/4"], + ["(3pi)/4","(3pi)/4","-(3pi)/4","(5pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(3)/2" => [ + ["pi/3","pi/3","(2pi)/3","(2pi)/3"], + ["pi/6","pi/6","-pi/6","(11pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(3)/2" => [ + ["-pi/3","(5pi)/3","-(2pi)/3","(4pi)/3"], + ["(5pi)/6","(5pi)/6","-(5pi)/6","(7pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "1" => [ + ["pi/2","pi/2","DNE","DNE"], + ["0","0","DNE","DNE"], + ["pi/4","pi/4","(5pi)/4","(5pi)/4"], + ], + "-1" => [ + ["-pi/2","(3pi)/2","DNE","DNE"], + ["pi","pi","DNE","DNE"], + ["-pi/4","(7pi)/4","(3pi)/4","(3pi)/4"], + ], + "sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/6","pi/6","-(5pi)/6","(7pi)/6"], + ], + "-sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/6","(11pi)/6","(5pi)/6","(5pi)/6"], + ], + "sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/3","pi/3","-(2pi)/3","(4pi)/3"], + ], + "-sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/3","(5pi)/3","(2pi)/3","(2pi)/3"], + ], +); + +@hashKeys = lex_sort(keys %values); +do { + $cosValue = $hashKeys[random(0,$#hashKeys,1)]; +} until ($values{$cosValue}[1][0] ne "DNE"); + +$left = "\cos(x)"; +$right = Formula("$cosValue")->TeX; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +Context()->variables->add(k => "Real"); +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +$ans0 = $values{$cosValue}[1][0]; +$ans0alt = $values{$cosValue}[1][1]; +$ans0k = Formula("$ans0+2*k*pi"); +$ans0altk = Formula("$ans0alt+2*k*pi"); + +$ans1 = $values{$cosValue}[1][2]; +if ($cosValue eq "-1") { + $ans = $ans0k; + $ansShow = $ans; +} elsif ($cosValue eq "1") { + $ans = Formula("2*k*pi"); + $ansShow = $ans; +} else { + $ans1alt = $values{$cosValue}[1][3]; + $ans1k = Formula("$ans1+2*k*pi"); + $ans1altk = Formula("$ans1alt+2*k*pi"); + $ans = OneOf( + List($ans0k,$ans1k), + List($ans0altk,$ans1k), + List($ans0k,$ans1altk), + List($ans0altk,$ans1altk) + ); + $ansShow = List(Formula("$ans0+2*k*pi"),Formula("$ans1+2*k*pi")); + if ($cosValue eq "0") { + $ans = OneOf($ans,Formula("pi/2+k*pi")); + } +} + +$r = 5; +$Pr = Compute($ans0); +$Px = $r*cos($Pr); +$Py = $r*sin($Pr); + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph->stamps(closed_circle($Px,$Py,red)); +$graph->moveTo(0,0); +$graph->lineTo($Px,$Py,red,2); +$graph->lineTo($Px,0,red,2); +$graph->lineTo(0,0,red,2); + +if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); +} + +$td = $Py>=0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px,$Py,"P: $ans0",'red','center',$td,large)); + +$alt = "This is the graph of a circle with point P: $ans0 on the circle."; + +if ($ans1 ne "DNE") { + $Qr = Compute($ans1); + $Qx = $r*cos($Qr); + $Qy = $r*sin($Qr); + + $graph->stamps(closed_circle($Qx,$Qy,red)); + $graph->moveTo(0,0); + $graph->lineTo($Qx,$Qy,red,2); + $graph->lineTo($Qx,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Qx!=0) && ($Qy!=0) ) { + $xShift = ($Qx>0) ? -0.4 : 0.4; + $yShift = ($Qy>0) ? 0.4 : -0.4; + $graph->moveTo($Qx,$yShift); + $graph->lineTo($Qx+$xShift,$yShift,red,2); + $graph->lineTo($Qx+$xShift,0,red,2); + } + + $td = $Qy>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Qx,$Qy,"Q: $ans1",'red','center',$td,large)); + + $alt = "This is the graph of a circle with point P: $ans0 and Q: $ans1 on the circle. From each point, a vertical line is drawn until it reaches the x-axis, showing they have the same distance to the x-axis."; +} + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right]``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use [|k*pi|]* to represent multiples of [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +."\n" +.'* Example: type [|3pi/4+2k*pi|]* to represent [`\frac{3\pi}{4}+2k\pi`].' +)@]** + + [`x=`][________________________________________]{$ans->cmp(correct_ans_latex_string=>$ansShow->TeX)} + + +END_PGML + +############################################################## + +Context("LimitedRadical"); +Context()->variables->add(k => "Real"); + +$s1 = Formula("$ans0"); + +if ($values{$cosValue}[0][2] eq "DNE") { + $output0 = "Only one point "; +} else { + $output0 = "Two points "; +} + +$output1 = ""; +if ($values{$cosValue}[1][0] ne $values{$cosValue}[1][1]) { + $output1 = "\text{Note that }".$ans0k->TeX."\text{ and }".$ans0altk->TeX."\text{ are equivalent. }\\"; +} +if ($values{$cosValue}[1][2] ne $values{$cosValue}[1][3]) { + if ($output1 ne "") { + $output1 .= "\text{Also, }"; + } else { + $output1 .= "\text{Note that }"; + } + $output1 .= $ans1k->TeX."\text{ and }".$ans1altk->TeX."\text{ are equivalent.}"; +} + +if ($cosValue eq "0") { + $output1 .= "\\ \text{Also, }x=".$ansShow->TeX."\text{ and }x=".Formula("$ans0+k*pi")->TeX."\text{ are equivalent.}"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + x &= \cos^{-1}\left([$right]\right) \\ + x &= [$s1] + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$left]=[$right]`] true: + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[$output0] on the Unit Circle can make the equation true. The equation's solution is: + + [``x=[$ansShow]\text{, where }k\text{ is any integer.}``] + +[`[$output1]`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation30.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation30.pg new file mode 100644 index 0000000000..d3acee5bc8 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation30.pg @@ -0,0 +1,293 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("LimitedRadical"); + + +%values = ( +#[sin^-1(x), sin^-1(x) in [0,2pi], +#value opposite to sin^-1(x), value opposite to sin^-1(x) in [0,2pi] + "0" => [ + ["0","0","pi","pi"], + ["pi/2","pi/2","-pi/2","(3pi)/2"], + ["0","0","pi","pi"], + ], + "1/2" => [ + ["pi/6","pi/6","(5pi)/6","(5pi)/6"], + ["pi/3","pi/3","-pi/3","(5pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "-1/2" => [ + ["-pi/6","(11pi)/6","-(5pi)/6","(7pi)/6"], + ["(2pi)/3","(2pi)/3","-(2pi)/3","(4pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(2)/2" => [ + ["pi/4","pi/4","(3pi)/4","(3pi)/4"], + ["pi/4","pi/4","-pi/4","(7pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(2)/2" => [ + ["-pi/4","(7pi)/4","-(3pi)/4","(5pi)/4"], + ["(3pi)/4","(3pi)/4","-(3pi)/4","(5pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(3)/2" => [ + ["pi/3","pi/3","(2pi)/3","(2pi)/3"], + ["pi/6","pi/6","-pi/6","(11pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(3)/2" => [ + ["-pi/3","(5pi)/3","-(2pi)/3","(4pi)/3"], + ["(5pi)/6","(5pi)/6","-(5pi)/6","(7pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "1" => [ + ["pi/2","pi/2","DNE","DNE"], + ["0","0","DNE","DNE"], + ["pi/4","pi/4","(5pi)/4","(5pi)/4"], + ], + "-1" => [ + ["-pi/2","(3pi)/2","DNE","DNE"], + ["pi","pi","DNE","DNE"], + ["-pi/4","(7pi)/4","(3pi)/4","(3pi)/4"], + ], + "sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/6","pi/6","-(5pi)/6","(7pi)/6"], + ], + "-sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/6","(11pi)/6","(5pi)/6","(5pi)/6"], + ], + "sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/3","pi/3","-(2pi)/3","(4pi)/3"], + ], + "-sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/3","(5pi)/3","(2pi)/3","(2pi)/3"], + ], +); + +@hashKeys = lex_sort(keys %values); +do { + $tanValue = $hashKeys[random(0,$#hashKeys,1)]; +} until ($values{$tanValue}[2][0] ne "DNE"); + +$left = "\tan(x)"; +$right = Formula("$tanValue")->TeX; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +Context()->variables->add(k => "Real"); +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +$ans0 = $values{$tanValue}[2][0]; +$ans0alt = $values{$tanValue}[2][1]; +$ans0k = Formula("$ans0+k*pi"); +$ans0altk = Formula("$ans0alt+k*pi"); + +$ans = OneOf( $ans0k,$ans0altk ); +$ansShow = List(Formula("$ans0+k*pi")); + +if ($ans0 eq "0") { + $ans = Formula("k*pi"); + $ansShow = $ans; +} + +$r = 5; +$Pr = Compute($ans0); +$Px = $r*cos($Pr); +$Py = $r*sin($Pr); + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph->stamps(closed_circle($Px,$Py,red)); +$graph->moveTo(0,0); +$graph->lineTo($Px,$Py,red,2); +$graph->lineTo($Px,0,red,2); +$graph->lineTo(0,0,red,2); + +if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); +} + +$td = $Py>=0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px,$Py,"P: $ans0",'red','center',$td,large)); + +$alt = "This is the graph of a circle with point P: $ans0 on the circle."; + +$ans1 = $values{$tanValue}[2][2]; +$ans1alt = $values{$tanValue}[2][3]; +$ans1k = Formula("$ans1+k*pi"); +$ans1altk = Formula("$ans1alt+k*pi"); +if ($ans1 ne "DNE") { + $Qr = Compute("$ans1"); + $Qx = $r*cos($Qr); + $Qy = $r*sin($Qr); + + $graph->stamps(closed_circle($Qx,$Qy,red)); + $graph->moveTo(0,0); + $graph->lineTo($Qx,$Qy,red,2); + $graph->lineTo($Qx,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Qx!=0) && ($Qy!=0) ) { + $xShift = ($Qx>0) ? -0.4 : 0.4; + $yShift = ($Qy>0) ? 0.4 : -0.4; + $graph->moveTo($Qx,$yShift); + $graph->lineTo($Qx+$xShift,$yShift,red,2); + $graph->lineTo($Qx+$xShift,0,red,2); + } + + $td = $Qy>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Qx,$Qy,"Q: $ans1",'red','center',$td,large)); + + $alt = "This is the graph of a circle with point P: $ans0 and Q: $ans1 on the circle. From each point, a vertical line is drawn until it reaches the x-axis, showing they have the same distance to the x-axis."; +} + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right]``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use [|k*pi|]* to represent multiples of [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +."\n" +.'* Example: type [|3pi/4+2k*pi|]* to represent [`\frac{3\pi}{4}+2k\pi`].' +)@]** + + [`x=`][________________________________________]{$ans->cmp(correct_ans_latex_string=>$ansShow->TeX)} + + +END_PGML + +############################################################## + +Context("LimitedRadical"); +Context()->variables->add(k => "Real"); + +$s1 = Formula("$ans0"); +$s2 = Formula("$ans1"); +$s3 = ($tanValue eq "0") ? "" : Formula("$ans0")->TeX."+"; + +if ($values{$tanValue}[2][2] eq "DNE") { + $output0 = "Only one point on the Unit Circle can make the equation true. The equation's solution is:"; +} else { + $output0 = "Although two points on the Unit Circle can make the equation true, the following solution can cover both points:"; +} + +$output1 = ""; +if ($values{$tanValue}[2][0] ne $values{$tanValue}[2][1]) { + $output1 = "\text{Note that }".$ans0k->TeX."\text{ and }".$ans0altk->TeX."\text{ are equivalent. }\\"; +} +if ($values{$tanValue}[2][2] ne $values{$tanValue}[2][3]) { + if ($output1 ne "") { + $output1 .= "\text{Also, }"; + } else { + $output1 .= "\text{Note that }"; + } + $output1 .= $ans1k->TeX."\text{ and }".$ans1altk->TeX."\text{ are equivalent.}"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + x &= \tan^{-1}\left([$right]\right) \\ + x &= [$s1] + \end{aligned}``] + +Recall that the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right) `]. On the Unit Circle, we have to check whether another angle also makes [`[$left]=[$right]`] true: + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[$output0] + + [``x=[$ansShow]\text{, where }k\text{ is any integer.}``] + +[`[$output1]`] + +Unlike solving equations for [`\sin(x)`] and [`\cos(x)`], there is no need to write something like: + + [``x=[$s3]2k\pi, [$s2]+2k\pi``] + +The set above is the same as [``x=[$ansShow]``], because the period of [`f(x)=\tan(x)`] is [`\pi`], while the period of [`\sin(x)`] and [`\cos(x)`] is [`2\pi`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation40.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation40.pg new file mode 100644 index 0000000000..77241d4c5b --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation40.pg @@ -0,0 +1,290 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +%values = ( +#key is trig value +#first array: [num string, den string, num value, den value +#second array: [TeX sin^-1, string sin^-1, 1st solution, 2nd solution] +#third array: [TeX cos^-1, string cos^-1, 1st solution, 2nd solution] +#fourth array: [TeX tan^-1, string tan^-1, 1st solution, 2nd solution] + "1/2" => [ + ["1","2",Formula("1"),Formula("2")], + ["\frac{\pi}{6}","pi/6","pi/6","(5pi)/6"], + ["\frac{\pi}{3}","pi/3","pi/3","(5pi)/3"], + ["DNE"], + ], + "-1/2" => [ + ["-1","2",Formula("-1"),Formula("2")], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6","(7pi)/6"], + ["\frac{2\pi}{3}","(2pi)/3","(2pi)/3","(4pi)/3"], + ["DNE"], + ], + "sqrt(2)/2" => [ + ["\sqrt{2}","2",Formula("sqrt(2)"),Formula("2")], + ["\frac{\pi}{4}","pi/4","pi/4","(3pi)/4"], + ["\frac{\pi}{4}","pi/4","pi/4","(7pi)/4"], + ["DNE"], + ], + "-sqrt(2)/2" => [ + ["-\sqrt{2}","2",Formula("-sqrt(2)"),Formula("2")], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4","(5pi)/4"], + ["\frac{3\pi}{4}","(3pi)/4","(3pi)/4","(5pi)/4"], + ["DNE"], + ], + "sqrt(3)/2" => [ + ["\sqrt{3}","2",Formula("sqrt(3)"),Formula("2")], + ["\frac{\pi}{3}","pi/3","pi/3","(2pi)/3"], + ["\frac{\pi}{6}","pi/6","pi/6","(11pi)/6"], + ["DNE"], + ], + "-sqrt(3)/2" => [ + ["-\sqrt{3}","2",Formula("-sqrt(3)"),Formula("2")], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3","(4pi)/3"], + ["\frac{5\pi}{6}","(5pi)/6","(5pi)/6","(7pi)/6"], + ["DNE"], + ], + "1" => [ + ["1","1",Formula("1"),Formula("1")], + ["\frac{\pi}{2}","pi/2","pi/2","DNE"], + ["0","0","0","DNE"], + ["\frac{\pi}{4}","pi/4","pi/4","(5pi)/4"], + ], + "-1" => [ + ["-1","1",Formula("-1"),Formula("1")], + ["-\frac{\pi}{2}","-pi/2","(3pi)/2","DNE"], + ["\pi","pi","pi","DNE"], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4","(3pi)/4"], + ], + "sqrt(3)/3" => [ + ["\sqrt{3}","3",Formula("sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{6}","pi/6","pi/6","(7pi)/6"], + ], + "-sqrt(3)/3" => [ + ["-\sqrt{3}","3",Formula("-sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6","(5pi)/6"], + ], + "sqrt(3)" => [ + ["\sqrt{3}","1",Formula("sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{3}","pi/3","pi/3","(4pi)/3"], + ], + "-sqrt(3)" => [ + ["-\sqrt{3}","1",Formula("-sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3","(2pi)/3"], + ], +); + +@hashKeys = lex_sort(keys %values); +do { + $sinValue = $hashKeys[random(0,$#hashKeys,1)]; +} until ($values{$sinValue}[1][0] ne "DNE"); + +($aT,$bT) = ($values{$sinValue}[0][0],$values{$sinValue}[0][1]); +($a,$b) = ($values{$sinValue}[0][2],$values{$sinValue}[0][3]); + +if ($a==1) { + $left = "\csc(x)-$bT"; +} elsif ($a==-1) { + $left = "-\csc(x)-$bT"; +} else { + $left = "$aT\cdot\csc(x)-$bT"; +} +$right = 0; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +@ans = (); +$ans[0] = $values{$sinValue}[1][2]; +$ans[1] = $values{$sinValue}[1][3]; + +$points = ""; +if ($ans[1] eq "DNE") { + $ans = Formula($ans[0]); + $points = "point $ans[0]"; +} else { + $ans = List(Formula($ans[0]),Formula($ans[1])); + $points = "points $ans[0], $ans[1]"; +} + +$r = 5; +$Pr = Formula($ans[0]); +$Px = Compute("$r*cos($Pr)")->reduce; +$Py = Compute("$r*sin($Pr)")->reduce; + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..1) { + if ($ans[$i] eq 'DNE') {next;} + $Pr = Formula($ans[$i]); + $Px = Compute("$r*cos($Pr)")->reduce; + $Py = Compute("$r*sin($Pr)")->reduce; + $graph->stamps(closed_circle($Px,$Py,red)); + $graph->moveTo(0,0); + $graph->lineTo($Px,$Py,red,2); + $graph->lineTo($Px,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Px,$Py,"$ans[$i]",'red','center',$td,large)); +} + +$alt = "This is the graph of a circle with $points on the circle."; + +if ( ($sinValue ne "1") && ($sinValue ne "-1") ) { + $alt .= " From each point, a vertical line is drawn until it reaches the x-axis, showing they have the same distance to the x-axis."; +} + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right]\text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +sub fracDisplay { + my ($m, $n) = @_; + if ($n eq "1") { + return $m; + } + if ($n eq "-1") { + if (substr($m,0,1) eq '-') { + return substr($m,1); + } else { + return "-$m"; + } + } + if ( (substr($m,0,1) ne '-') && (substr($n,0,1) ne '-') ) { + return "\frac{$m}{$n}"; + } + if (substr($m,0,1) eq '-') { + return "-\frac{".substr($m,1)."}{$n}"; + } + if (substr($n,0,1) eq '-') { + return "-\frac{$m}{".substr($n,1)."}"; + } + +} + +$s1 = fracDisplay($bT,$aT); +$s2 = fracDisplay($aT,$bT); + +$output1 = ""; +if (substr($values{$sinValue}[1][0],0,1) eq '-') { + my $a = Formula($ans[0]); + $output1 .= "\text{But }x\in[0,2\pi),\text{ so we have to change }".$values{$sinValue}[1][0]."\text{ into that range by }\\".$values{$sinValue}[1][0]."+2\pi=".$a->TeX; +} + + + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + \csc(x) &= [$s1] \\ + \frac{1}{\sin(x)} &= [$s1] \\ + \sin(x) &= [$s2] \\ + x &= \sin^{-1}\left([$s2]\right) \\ + x &= [$values{$sinValue}[1][0]] + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. [`[$output1]`] + +On the Unit Circle, we have to check whether another angle in [`x\in[0,2\pi)`] also makes [`[$left]=[$right]`] true: + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The solution of the equation [`[$left]=[$right]`], where [`x\in[0,2\pi)`], is: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation50.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation50.pg new file mode 100644 index 0000000000..5fea0d1d7f --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation50.pg @@ -0,0 +1,312 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +%values = ( +#key is trig value +#first array: [num string, den string, num value, den value +#second array: [TeX sin^-1, string sin^-1, 1st solution, 2nd solution] +#third array: [TeX cos^-1, string cos^-1, 1st solution, 2nd solution] +#fourth array: [TeX tan^-1, string tan^-1, 1st solution, 2nd solution] + "1/2" => [ + ["1","2",Formula("1"),Formula("2")], + ["\frac{\pi}{6}","pi/6","pi/6","(5pi)/6"], + ["\frac{\pi}{3}","pi/3","pi/3","(5pi)/3"], + ["DNE"], + ], + "-1/2" => [ + ["-1","2",Formula("-1"),Formula("2")], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6","(7pi)/6"], + ["\frac{2\pi}{3}","(2pi)/3","(2pi)/3","(4pi)/3"], + ["DNE"], + ], + "sqrt(2)/2" => [ + ["\sqrt{2}","2",Formula("sqrt(2)"),Formula("2")], + ["\frac{\pi}{4}","pi/4","pi/4","(3pi)/4"], + ["\frac{\pi}{4}","pi/4","pi/4","(7pi)/4"], + ["DNE"], + ], + "-sqrt(2)/2" => [ + ["-\sqrt{2}","2",Formula("-sqrt(2)"),Formula("2")], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4","(5pi)/4"], + ["\frac{3\pi}{4}","(3pi)/4","(3pi)/4","(5pi)/4"], + ["DNE"], + ], + "sqrt(3)/2" => [ + ["\sqrt{3}","2",Formula("sqrt(3)"),Formula("2")], + ["\frac{\pi}{3}","pi/3","pi/3","(2pi)/3"], + ["\frac{\pi}{6}","pi/6","pi/6","(11pi)/6"], + ["DNE"], + ], + "-sqrt(3)/2" => [ + ["-\sqrt{3}","2",Formula("-sqrt(3)"),Formula("2")], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3","(4pi)/3"], + ["\frac{5\pi}{6}","(5pi)/6","(5pi)/6","(7pi)/6"], + ["DNE"], + ], + "1" => [ + ["1","1",Formula("1"),Formula("1")], + ["\frac{\pi}{2}","pi/2","pi/2","DNE"], + ["0","0","0","DNE"], + ["\frac{\pi}{4}","pi/4","pi/4","(5pi)/4"], + ], + "-1" => [ + ["-1","1",Formula("-1"),Formula("1")], + ["-\frac{\pi}{2}","-pi/2","(3pi)/2","DNE"], + ["\pi","pi","pi","DNE"], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4","(3pi)/4"], + ], + "sqrt(3)/3" => [ + ["\sqrt{3}","3",Formula("sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{6}","pi/6","pi/6","(7pi)/6"], + ], + "-sqrt(3)/3" => [ + ["-\sqrt{3}","3",Formula("-sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6","(5pi)/6"], + ], + "sqrt(3)" => [ + ["\sqrt{3}","1",Formula("sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{3}","pi/3","pi/3","(4pi)/3"], + ], + "-sqrt(3)" => [ + ["-\sqrt{3}","1",Formula("-sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3","(2pi)/3"], + ], +); + +@cosValue = (); + +@hashKeys = lex_sort(keys %values); +do { + $cosValue[0] = $hashKeys[random(0,$#hashKeys,1)]; +} until ( + (substr($cosValue[0],0,1) ne '-') + && ($values{$cosValue[0]}[2][0] ne "DNE") +); +$cosValue[1] = '-'.$cosValue[0]; + +@a = (); +@b = (); +@aT = (); +@bT = (); + +for my $i (0..1) { + ($aT[$i],$bT[$i]) = ($values{$cosValue[$i]}[0][0],$values{$cosValue[$i]}[0][1]); + ($a[$i],$b[$i]) = ($values{$cosValue[$i]}[0][2],$values{$cosValue[$i]}[0][3]); +} + + +$a2 = Compute("($a[0])**2"); +$b2 = Compute("($b[0])**2"); + +if ($a2==1) { + $left = "\sec^2(x)-$b2"; +} elsif ($a2==-1) { + $left = "-\sec^2(x)-$b2"; +} else { + $left = "$a2\cdot\sec^2(x)-$b2"; +} +$right = 0; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +@ans = (); +$ans[0] = $values{$cosValue[0]}[2][2]; +$ans[1] = $values{$cosValue[0]}[2][3]; +$ans[2] = $values{$cosValue[1]}[2][2]; +$ans[3] = $values{$cosValue[1]}[2][3]; + +@ansT = (); +for my $i (0..3) { + if ($ans[$i] eq "DNE") {next;} + $ansT[$i] = Formula($ans[$i]); +} + +$points = ""; +if ($ans[1] eq "DNE") { + $ansF = List($ansT[0],$ansT[2]); + $points = "$ans[0], $ans[2]"; +} else { + $ansF = List($ansT[0],$ansT[1],$ansT[2],$ansT[3]); + $points = "$ans[0], $ans[1], $ans[2] and $ans[3]"; +} + +$r = 5; + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..3) { + if ($ans[$i] eq 'DNE') {next;} + $Pr = Formula($ans[$i]); + $Px = Compute("$r*cos($Pr)")->reduce; + $Py = Compute("$r*sin($Pr)")->reduce; + $graph->stamps(closed_circle($Px,$Py,red)); + $graph->moveTo(0,0); + $graph->lineTo($Px,$Py,red,2); + $graph->lineTo($Px,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Px,$Py,"$ans[$i]",'red','center',$td,large)); +} + +$alt = "This is the graph of a circle with points $points on the circle."; + +if ($cosValue[0] ne "1") { + $alt .= " From each point, a vertical line is drawn until it reaches the x-axis, showing they have the same distance to the x-axis."; +} + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +$test = $values{"1"}[2][3] eq "DNE"; + +############################################################## + +BEGIN_PGML + + + +Solve the equation + + [``[$left]=[$right]\text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ansF} + + +END_PGML + +############################################################## + +sub fracDisplay { + my ($m, $n) = @_; + if ($n eq "1") { + return $m; + } + if ($n eq "-1") { + if (substr($m,0,1) eq '-') { + return substr($m,1); + } else { + return "-$m"; + } + } + if ( (substr($m,0,1) ne '-') && (substr($n,0,1) ne '-') ) { + return "\frac{$m}{$n}"; + } + if (substr($m,0,1) eq '-') { + return "-\frac{".substr($m,1)."}{$n}"; + } + if (substr($n,0,1) eq '-') { + return "-\frac{$m}{".substr($n,1)."}"; + } + +} + +$s1 = fracDisplay($b2,$a2); +$s2 = fracDisplay($a2,$b2); +$s3 = fracDisplay($aT[0],$bT[0]); +$s4 = fracDisplay($aT[1],$bT[1]); + + + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + \sec^2(x) &= [$s1] \\ + \frac{1}{\cos^2(x)} &= [$s1] \\ + \cos^2(x) &= [$s2] \\ + \cos(x) &= [$s3]\text{ or }\cos(x)=[$s4] \\ + x &= \cos^{-1}\left([$s3]\right) \text{ or }x=\cos^{-1}\left([$s4]\right)\\ + x &= [$ansT[0]] \text{ or } [$ansT[2]] + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. + +On the Unit Circle, we have to check whether other angles in [`x\in[0,2\pi)`] also makes [`[$left]=[$right]`] true: + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The solution of the equation [`[$left]=[$right]`], where [`x\in[0,2\pi)`], is: [`x=[$ansF]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation60.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation60.pg new file mode 100644 index 0000000000..99638fc106 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation60.pg @@ -0,0 +1,268 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +%values = ( +#key is trig value +#first array: [num string, den string, num value, den value +#second array: [TeX sin^-1, string sin^-1, 1st solution, 2nd solution] +#third array: [TeX cos^-1, string cos^-1, 1st solution, 2nd solution] +#fourth array: [TeX tan^-1, string tan^-1, solution] + "1/2" => [ + ["1","2",Formula("1"),Formula("2")], + ["\frac{\pi}{6}","pi/6","pi/6","(5pi)/6"], + ["\frac{\pi}{3}","pi/3","pi/3","(5pi)/3"], + ["DNE"], + ], + "-1/2" => [ + ["-1","2",Formula("-1"),Formula("2")], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6","(7pi)/6"], + ["\frac{2\pi}{3}","(2pi)/3","(2pi)/3","(4pi)/3"], + ["DNE"], + ], + "sqrt(2)/2" => [ + ["\sqrt{2}","2",Formula("sqrt(2)"),Formula("2")], + ["\frac{\pi}{4}","pi/4","pi/4","(3pi)/4"], + ["\frac{\pi}{4}","pi/4","pi/4","(7pi)/4"], + ["DNE"], + ], + "-sqrt(2)/2" => [ + ["-\sqrt{2}","2",Formula("-sqrt(2)"),Formula("2")], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4","(5pi)/4"], + ["\frac{3\pi}{4}","(3pi)/4","(3pi)/4","(5pi)/4"], + ["DNE"], + ], + "sqrt(3)/2" => [ + ["\sqrt{3}","2",Formula("sqrt(3)"),Formula("2")], + ["\frac{\pi}{3}","pi/3","pi/3","(2pi)/3"], + ["\frac{\pi}{6}","pi/6","pi/6","(11pi)/6"], + ["DNE"], + ], + "-sqrt(3)/2" => [ + ["-\sqrt{3}","2",Formula("-sqrt(3)"),Formula("2")], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3","(4pi)/3"], + ["\frac{5\pi}{6}","(5pi)/6","(5pi)/6","(7pi)/6"], + ["DNE"], + ], + "1" => [ + ["1","1",Formula("1"),Formula("1")], + ["\frac{\pi}{2}","pi/2","pi/2","DNE"], + ["0","0","0","DNE"], + ["\frac{\pi}{4}","pi/4","pi/4"], + ], + "-1" => [ + ["-1","1",Formula("-1"),Formula("1")], + ["-\frac{\pi}{2}","-pi/2","(3pi)/2","DNE"], + ["\pi","pi","pi","DNE"], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4"], + ], + "sqrt(3)/3" => [ + ["\sqrt{3}","3",Formula("sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{6}","pi/6","pi/6"], + ], + "-sqrt(3)/3" => [ + ["-\sqrt{3}","3",Formula("-sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6"], + ], + "sqrt(3)" => [ + ["\sqrt{3}","1",Formula("sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{3}","pi/3","pi/3"], + ], + "-sqrt(3)" => [ + ["-\sqrt{3}","1",Formula("-sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3"], + ], +); + +@hashKeys = lex_sort(keys %values); +do { + $tanValue = $hashKeys[random(0,$#hashKeys,1)]; +} until ($values{$tanValue}[3][0] ne "DNE"); + +%flip = ( + "1" => "1", + "-1" => "-1", + "sqrt(3)/3" => "\sqrt{3}", + "-sqrt(3)/3" => "-\sqrt{3}", + "sqrt(3)" => "\frac{1}{\sqrt{3}}", + "-sqrt(3)" => "-\frac{1}{\sqrt{3}}", +); + +$a = 2; + +$left = "\cot($a x)"; +$right = $flip{$tanValue}; + +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +#ansax is the solution of the "2x" part of cot(2x)=right +$ansax = Compute("$values{$tanValue}[3][1]"); +#$ansaxd is the first part of the solution after dividing by $a +$ansaxd = specialAngle($ansax/$a,2,3,4,5,6,8,9,10,12,18); + +@k = (); +@ansF = (); +for my $i (-4..4) { + my $f = specialAngle(pi*$i/$a+$ansax/$a,2,3,4,5,6,8,9,10,12,18); + if ( ($f>0) && ($f<2*pi) ) { + $ansF[$#ansF+1]= $f; + $k[scalar(@k)] = $i; + } +} +@ansF = num_sort(@ansF); +@ansF = do { my %seen; grep { !$seen{$_}++ } @ansF }; +$points = ""; +for my $i (0..$#ansF) { + $points .= "$ansF[$i], "; +} +$points = substr($points,0,length($points)-2); +$ans = List(@ansF); + +$r = 5; +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..$#ansF) { + $Px = Compute("$r*cos($ansF[$i])")->reduce; + $Py = Compute("$r*sin($ansF[$i])")->reduce; + $graph->stamps(closed_circle($Px,$Py,red)); + $graph->moveTo(0,0); + $graph->lineTo($Px,$Py,red,2); + $graph->lineTo($Px,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Px,$Py,"$ansF[$i]",'red','center',$td,large)); +} + +$alt = "This is the graph of a circle with points $points on the circle."; + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right]\text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +($n,$d) = ($values{$tanValue}[0][0],$values{$tanValue}[0][1]); +if (substr($n,0,1) eq '-') { + $n = substr($n,1); + $s1 = ($d==1) ? "-$n" : "-\frac{$n}{$d}"; +} else { + $s1 = ($d==1) ? "$n" : "\frac{$n}{$d}"; +} + +$s2 = ""; +for my $i (0..scalar(@k)-1) { + $s2 .= "x &= ".$ansaxd->TeX."+\frac{($k[$i])\pi}{$a} = ".$ansF[$i]->TeX." \\"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + \frac{1}{\tan([$a]x)} &= [$right] \\ + \tan([$a]x) &= [$s1] \\ + [$a]x &= \tan^{-1}\left([$s1]\right) \\ + [$a]x &= [$values{$tanValue}[3][0]]+k\pi \\ + x &= [$ansaxd] +\frac{k\pi}{[$a]} + \end{aligned}``] + +Next, we need to substitute in different [`k`] values to find all solutions in the range [`x\in[0,2\pi)`]: + + [``\begin{aligned} + [$s2] + \end{aligned}``] + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The solution of the equation [`[$left]=[$right]`], where [`x\in[0,2\pi)`], is: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation70.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation70.pg new file mode 100644 index 0000000000..f387e05251 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation70.pg @@ -0,0 +1,218 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 1, + reduceConstantFunctions => 0, +); + +@values = ( + Compute("1"),-Compute("1"),Compute("0"), + Compute("1/2"),-Compute("1/2"), + Compute("sqrt(2)/2"),-Compute("sqrt(2)/2"), + Compute("sqrt(3)/2"),-Compute("sqrt(3)/2"), +); + +$c = random(-1,1,2)*list_random(2,3,4,6); +$cN = -$c; +$a = $c>0 ? "x+\frac{\pi}{$c}" : "x-\frac{\pi}{$cN}"; + +$left = "\sin($a)"; +$right = specialRadical(list_random(@values)); + +@ansL = (); +@points = (); + +$ansL[0][0] = specialAngle(arcsin(Compute("$right"))); +if ($ansL[0][0]>=0) { + $ansL[0][1] = specialAngle(Compute("pi-$ansL[0][0]")); +} else { + $ansL[0][1] = specialAngle(Compute("-pi-$ansL[0][0]")); +} + +@start = (); +$start[0] = specialAngle(Compute("$ansL[0][0]-pi/$c"),(1..12)); +$start[1] = ""; +if ($ansL[0][0] == $ansL[0][1]) { + $points[0] = "$ansL[0][0]"; +} else { + $points[0] = "$ansL[0][0] and $ansL[0][1]"; + $start[1] = specialAngle(Compute("$ansL[0][1]-pi/$c"),(1..12)); +} + +@k = (); +for my $i (-1..1) { + my $a = Compute("$start[0]")+2*$i*pi; + if ( ($a>=0) && ($a<2*pi) ) { + $ansL[1][scalar(@{$ansL[1]})] = specialAngle($a,(1..12)); + $k[0][scalar(@{$k[0]})] = $i; + } + if ($start[1] ne "") { + my $b = Compute($start[1]->string)+2*$i*pi; + if ( ($b>0) && ($b<2*pi) ) { + $ansL[1][scalar(@{$ansL[1]})] = specialAngle($b,(1..12)); + $k[1][scalar(@{$k[1]})] = $i; + } + } +} +$ans = List(@{$ansL[1]}); + +$r = 5; +for my $i (0..1) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$ansL[$i]})-1) { + $Px = Compute("$r*cos($ansL[$i][$j])")->reduce; + $Py = Compute("$r*sin($ansL[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$ansL[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|-pi/4,pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +if ($start[1] ne "") { + $o1 = $ansL[0][0]->TeX."+2k\pi \text{ or } ".$ansL[0][1]->TeX." +2k\pi"; + $o2 = $start[0]->TeX."+2k\pi \text{ or } ".$start[1]->TeX." +2k\pi"; + $o3 = "Solutions are "; +} else { + $o1 = $ansL[0][0]->TeX."+2k\pi"; + $o2 = $start[0]->TeX."+2k\pi"; + $o3 = "The solution is "; +} + +$output = ""; +$p = 0; +for my $i (0..scalar(@k)-1) { + for my $j (0..scalar(@{$k[$i]})-1) { + $o4 .= "x &= ".$start[$i]->TeX."+2($k[$i][$j])\pi = ".$ansL[1][$p++]->TeX." \\"; + } +} + + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + [$a] &= \sin^{-1}\left([$right]\right) \\ + [$a] &= [$ansL[0][0]] + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$left] = [$right]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + [$a] &= \sin^{-1}\left([$right]\right) \\ + [$a] &= [$o1] \\ + x &= [$o2] + \end{aligned}``] + +Next, substitute in different [`k`] values to locate all solutions in [`[0,2\pi)`]: + + [``\begin{aligned} [$o4] \end{aligned}``] + +>>[@ $fig[1] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[$o3] [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation80.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation80.pg new file mode 100644 index 0000000000..5fbed179b3 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation80.pg @@ -0,0 +1,207 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); + $c = non_zero_random(-10,10,1); + $d = non_zero_random(-10,10,1); +} until ($d-$b != 0) && ($a-$c != 0); + +$e = "$a\tan(x)"; +if ($a==-1) {$e = "-\tan(x)";} + elsif ($a==1) {$e = "\tan(x)";} +$f = "$c\tan(x)"; +if ($c==-1) {$f = "-\tan(x)";} + elsif ($c==1) {$f = "\tan(x)";} +$left = "$e+$b"; +$right = "$f+$d"; + +@ansL = (); +@ansLShow = (); +@points = (); + +$start = arctan(($d-$b)/($a-$c)); + +$points = ""; +@k = (); +for my $i (-2..2) { + my $a = $start+$i*pi; + if ( ($a>=0) && ($a<2*pi) ) { + $k[scalar(@k)] = $i; + $ansL[scalar(@ansL)] = $a; + $ansLShow[scalar(@ansLShow)] = Round($a,2); + $points .= Round($a,2).", "; + } +} +$points = substr($points,0,length($points)-2); +$points .= " radians"; +$ans = List(@ansL); + +$r = 5; +for my $i (0..0) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@ansL)-1) { + $Px = Compute("$r*cos($ansL[$j])")->reduce; + $Py = Compute("$r*sin($ansL[$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$ansLShow[$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points representing $points on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|1.12, 3.24|]*.' +."\n" +.'* Use a calculator to calculate inverse trigonometry values.' +."\n" +.'* Type radian answers. There is no need to use [`\pi`] in your answers.' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$o1 = Fraction($d-$b,$a-$c)->reduce; +$o2 = $a-$c; +$o3 = $d-$b; +if ($o3==-1) { + $o4 = "-\tan(x) &= $o3 \\ \tan(x) &= ".$o1->TeX." \\"; +} elsif ($o2==1) { + $o4 = "\tan(x) &= ".$o1->TeX." \\"; +} else { + $o4 = "$o2\tan(x) &= $o3 \\ \tan(x) &= ".$o1->TeX." \\"; +} +$o5 = Round($start,6); +if (scalar(@ansL)==1) { + $o6 = "The solution is "; +} else { + $o6 = "Solutions are "; +} + +$o7 = ""; +for my $i (0..scalar(@k)-1) { + $o7 .= "x &= $o5+($k[$i])\pi = $ansLShow[$i] \\"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + [$e]-[$f] &= [$d]-[$b] \\ + [$o4] + x &= \tan^{-1}\left([$o1]\right) \\ + x &= [$o5]+k\pi + \end{aligned}``] + +In the last step, we used a calculator's inverse tangent function to calculate [`\tan^{-1}\left([$o1]\right) = [$o5]`]. + +Recall that the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right) `]. We will substitute in different [`k`] values and find all solutions, in [`[0,2\pi)`], which make [`[$left] = [$right]`] true: + + [``\begin{aligned} + [$o7] + \end{aligned}``] + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[$o6] [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation90.pg b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation90.pg new file mode 100644 index 0000000000..7476b7b815 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigEquation/TrigEquation90.pg @@ -0,0 +1,187 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$left = "\sin(\pi x)"; +$right = random(-0.9,0.9,0.01); + +@ansL = (); +@ansLShow = (); +@points = (); + +$ansL[0][0] = arcsin($right); +if ($ansL[0][0]>0) {$ansL[0][1] = pi-$ansL[0][0];} + else {$ansL[0][1] = -pi-$ansL[0][0];} +$ansLShow[0][0] = Round($ansL[0][0],2); +$ansLShow[0][1] = Round($ansL[0][1],2); +$points[0] = "$ansLShow[0][0] and $ansLShow[0][1] radians"; + +@start = (); +$start[0] = $ansL[0][0]/pi; +$start[1] = $ansL[0][1]/pi; + +@k = (); +for my $i (0..1) { + for my $j (-3..3) { + my $a = $start[$i]+2*$j; + if ( ($a>=0) && ($a[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$ansL[$i]})-1) { + $Px = Compute("$r*cos($ansL[$i][$j])")->reduce; + $Py = Compute("$r*sin($ansL[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$ansLShow[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points representing $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|1.12, 3.24|]*.' +."\n" +.'* Use a calculator to calculate inverse trigonometry values.' +."\n" +.'* Type radian answers. There is no need to use [`\pi`] in your answers.' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +$output = ""; +$p = 0; +for my $i (0..scalar(@k)-1) { + for my $j (0..scalar(@{$k[$i]})-1) { + $output .= "x &= $start[$i]+2($k[$i][$j]) = $ansLShow[1][$p++] \\"; + } +} +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + \pi x &= \sin^{-1}([$right]) \\ + \pi x &= [$ansL[0][0]] + \end{aligned}``] + +In the last step, we used a calculator's inverse sine function to calculate [`\sin^{-1}\left([$right]\right) = [$ansL[0][0]]`]. + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. We need to find all values on the Unit Circle which makes [`[$left] = [$right]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + \pi x &= \sin^{-1}([$right]) \\ + \pi x &= [$ansL[0][0]] +2k\pi \text{ or } [$ansL[0][1]] +2k\pi \\ + x &= [$start[0]] + 2k \text{ or } [$start[1]] +2k + \end{aligned}``] + +We will substitute in different [`k`] values and find all solutions, in [`[0,\pi)`], which make [`[$left] = [$right]`] true: + + [``\begin{aligned} + [$output] + \end{aligned}``] + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties10.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties10.pg new file mode 100644 index 0000000000..745112cd8d --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties10.pg @@ -0,0 +1,182 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$cfAbs = abs($cf); +do {$d = random(-5,5,1);} until ($a != $d); + +$bcf = $b*$cf; +$bcfIn = &input($bcf); +$func0 = Compute("$a*sin($b*x-$bcfIn)+$d")->reduce; +$cfIn = &input($cf); +$func1 = Compute("$a*sin($b*(x-$cfIn))+$d")->reduce; +$func2 = Compute("$a*sin($b*x)+$d")->reduce; + +if ($pf == 1) { + $pAns = Compute("pi"); +} elsif ($pf == -1) { + $pAns = Compute("-pi"); +} else { + $pAns = Compute("$pf*pi"); +} +$pfShow = &output($pf); + +$lr = ($cf>0) ? "right" : "left"; +$shift = Compute("$cfAbs*pi"); +$shiftShow = &output($cfAbs); + + +############################################################## + +BEGIN_PGML + +Based on the given function + + [`` f(x) = [$func0] ``], + +fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pAns}. + +d) To transform [`g(x)=[$func2]`] to [`f(x)=[$func0]`], we could shift the graph of [`g(x)`] to the [$lr] by [______]{$shift} units. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +We have to factor to change the function to the form of + + [``f(x) = A\sin(B(x-C))+D``] + +In [`f(x)=[$func0]`], factor out [`[$b]`], we have: + + [``f(x)=[$func1]``] + +###Part a + +By [`f(x)=[$func1]`], the function's midline is [`y=[$d]`]. + +###Part b + +By [`f(x)=[$func1]`], the function's amplitude is [`[$a]`]. + +###Part c + +If the function's formula is [`f(x)=A\sin(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{2\pi}{[$b]} = [$pfShow]``] + +###Part d + +Compare + + [`` g(x)=[$func2] ``] + +with + + [`` f(x)=[$func1] ``], + +we could shift the graph of [`g(x)`] to the [$lr] by [`[$shiftShow]`] units. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties20.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties20.pg new file mode 100644 index 0000000000..27a8431910 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties20.pg @@ -0,0 +1,174 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$bShow = &output($b); + +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$cfAbs = abs($cf); +do {$d = random(-5,5,1);} until ($a != $d); + +$bIn = &input($b); +$bcf = $b*$cf; +$bcfIn = &input($bcf); +$func0 = Compute("$a*sin($bIn*x-$bcfIn)+$d")->reduce; +$func1 = Compute("$a*sin($bIn*(x-$cf))+$d")->reduce; +$func2 = Compute("$a*sin($bIn*x)+$d")->reduce; + +$lr = ($cf>0) ? "right" : "left"; +$shift = Compute("$cfAbs"); + + +############################################################## + +BEGIN_PGML + +Based on the given function + + [`` f(x) = [$func0] ``], + +fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pf}. + +d) To transform [`g(x)=[$func2]`] to [`f(x)=[$func0]`], we could shift the graph of [`g(x)`] to the [$lr] by [______]{$shift} units. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +We have to factor to change the function to the form of + + [``f(x) = A\sin(B(x-C))+D``] + +In [`f(x)=[$func0]`], factor out [`[$bShow]`], we have: + + [``f(x)=[$func1]``] + +###Part a + +By [`f(x)=[$func1]`], the function's midline is [`y=[$d]`]. + +###Part b + +By [`f(x)=[$func1]`], the function's amplitude is [`[$a]`]. + +###Part c + +If the function's formula is [`f(x)=A\sin(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{2\pi}{[$bShow]} = [$pf]``] + +###Part d + +Compare + + [`` g(x)=[$func2] ``] + +with + + [`` f(x)=[$func1] ``], + +we could shift the graph of [`g(x)`] to the [$lr] by [`[$shift]`] units. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties30.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties30.pg new file mode 100644 index 0000000000..8ee2ea11b9 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties30.pg @@ -0,0 +1,176 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$pf = (1/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$cfAbs = abs($cf); +do {$d = random(-5,5,1);} until ($a != $d); + +$bcf = $b*$cf; +$bcfIn = &input($bcf); +$func0 = Compute("$a*tan($b*x-$bcfIn)+$d")->reduce; +$cfIn = &input($cf); +$func1 = Compute("$a*tan($b*(x-$cfIn))+$d")->reduce; +$func2 = Compute("$a*tan($b*x)+$d")->reduce; + +if ($pf == 1) { + $pAns = Compute("pi"); +} elsif ($pf == -1) { + $pAns = Compute("-pi"); +} else { + $pAns = Compute("$pf*pi"); +} +$pfShow = &output($pf); + +$lr = ($cf>0) ? "right" : "left"; +$shift = Compute("$cfAbs*pi"); +$shiftShow = &output($cfAbs); + + +############################################################## + +BEGIN_PGML + +Based on the given function + + [`` f(x) = [$func0] ``], + +fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's period is [______]{$pAns}. + +c) To transform [`g(x)=[$func2]`] to [`f(x)=[$func0]`], we could shift the graph of [`g(x)`] to the [$lr] by [______]{$shift} units. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +We have to factor to change the function to the form of + + [``f(x) = A\tan(B(x-C))+D``] + +In [`f(x)=[$func0]`], factor out [`[$b]`], we have: + + [``f(x)=[$func1]``] + +###Part a + +By [`f(x)=[$func1]`], the function's midline is [`y=[$d]`]. + +###Part b + +If the function's formula is [`f(x)=A\tan(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{\pi}{[$b]} = [$pfShow]``] + +###Part c + +Compare + + [`` g(x)=[$func2] ``] + +with + + [`` f(x)=[$func1] ``], + +we could shift the graph of [`g(x)`] to the [$lr] by [`[$shiftShow]`] units. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties40.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties40.pg new file mode 100644 index 0000000000..8f1ddb077a --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionProperties40.pg @@ -0,0 +1,168 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$bShow = &output($b); + +$pf = (1/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$cfAbs = abs($cf); +do {$d = random(-5,5,1);} until ($a != $d); + +$bIn = &input($b); +$bcf = $b*$cf; +$bcfIn = &input($bcf); +$func0 = Compute("$a*tan($bIn*x-$bcfIn)+$d")->reduce; +$func1 = Compute("$a*tan($bIn*(x-$cf))+$d")->reduce; +$func2 = Compute("$a*tan($bIn*x)+$d")->reduce; + +$lr = ($cf>0) ? "right" : "left"; +$shift = Compute("$cfAbs"); + + +############################################################## + +BEGIN_PGML + +Based on the given function + + [`` f(x) = [$func0] ``], + +fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's period is [______]{$pf}. + +c) To transform [`g(x)=[$func2]`] to [`f(x)=[$func0]`], we could shift the graph of [`g(x)`] to the [$lr] by [______]{$shift} units. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +We have to factor to change the function to the form of + + [``f(x) = A\tan(B(x-C))+D``] + +In [`f(x)=[$func0]`], factor out [`[$bShow]`], we have: + + [``f(x)=[$func1]``] + +###Part a + +By [`f(x)=[$func1]`], the function's midline is [`y=[$d]`]. + +###Part b + +If the function's formula is [`f(x)=A\sin(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{\pi}{[$bShow]} = [$pf]``] + +###Part c + +Compare + + [`` g(x)=[$func2] ``] + +with + + [`` f(x)=[$func1] ``], + +we could shift the graph of [`g(x)`] to the [$lr] by [`[$shift]`] units. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation10.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation10.pg new file mode 100644 index 0000000000..15ab367f77 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation10.pg @@ -0,0 +1,173 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(2,4,1); + +$func = Formula("sin(x)")->reduce; +$f[0] = Formula("$a*sin(x)")->reduce; +$f[1] = Formula("sin(x)")->reduce; +$f[2] = Formula("sin(x)+$a")->reduce; +$f[3] = Formula("$a*cos(x)")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,1), (pi,0), (3pi/2,-1), (2pi,0)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,$b), (pi,$a), (3pi/2,$c), (2pi,$a)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a vertical stretch by a factor of [`[$a]`]. + +The point [`(\frac{\pi}{2},1)`] on [`y=[$func]`] is stretched to [`(\frac{\pi}{2},[$a])`] on [`f(x)=[$f[0]]`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation100.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation100.pg new file mode 100644 index 0000000000..f87de127c5 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation100.pg @@ -0,0 +1,214 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "contextFraction.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,3,1); +@s = (); +@sIn = (); +for my $i (0..3) { + $s[$i] = Fraction(($a+$i)%4,2)->reduce; + $sIn[$i] = &input($s[$i]); +} +$s0Show = &output($s[0]); + +$func = Formula("cos(x)")->reduce; +$f[0] = Formula("cos(x+$sIn[0])")->reduce; +$f[1] = Formula("cos(x+$sIn[1])")->reduce; +$f[2] = Formula("cos(x+$sIn[2])")->reduce; +$f[3] = Formula("cos(x+$sIn[3])")->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=cos(x), where (0,1) is shifted to the left to ($sIn[0],1)"; +$alt[1] = "graph with the shape of y=cos(x), where (0,0) is shifted to the left to ($sIn[1],1)"; +$alt[2] = "graph with the shape of y=cos(x), where (0,0) is shifted to the left to ($sIn[2],1)"; +$alt[3] = "graph with the shape of y=cos(x), where (0,0) is shifted to the left to ($sIn[3],1)"; + +$bound = 2; + +$xmin = int(-3*pi); #The viewing window +$xmax = int(pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=\cos\left(x+[$s0Show]\right)`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +The graph of [`f(x)=\cos\left(x+[$s0Show]\right)`] can be obtained by shifting the graph of [`y=[$func]`] to the left by [`[$s0Show]`] units. + +For example, [`(0,1)`] on [`y=[$func]`] is transformed to [`(-[$s0Show],1)`] on [`f(x)=\cos\left(x+[$s0Show]\right)`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation20.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation20.pg new file mode 100644 index 0000000000..5e504fee17 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation20.pg @@ -0,0 +1,173 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(2,4,1); + +$func = Formula("cos(x)")->reduce; +$f[0] = Formula("$a*cos(x)")->reduce; +$f[1] = Formula("cos(x)")->reduce; +$f[2] = Formula("cos(x)+$a")->reduce; +$f[3] = Formula("$a*sin(x)")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,1), (pi/2,0), (pi,-1), (3pi/2,0), (2pi,1)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$b), (pi/2,$a), (pi,$c), (3pi/2,$a), (2pi,$b)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a vertical stretch by a factor of [`[$a]`]. + +The point [`(0,1)`] on [`y=[$func]`] is stretched to [`(0,[$a])`] on [`f(x)=[$f[0]]`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation30.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation30.pg new file mode 100644 index 0000000000..77f894eecc --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation30.pg @@ -0,0 +1,174 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(1,4,1)*random(-1,1,2); + +$func = Formula("sin(x)")->reduce; +$f[0] = Formula("sin(x)+$a")->reduce; +$f[1] = Formula("$a*sin(x)")->reduce; +$f[2] = Formula("$a*cos(x)")->reduce; +$f[3] = Formula("cos(x)+$a")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,$b), (pi,$a), (3pi/2,$c), (2pi,$a)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$b), (pi/2,$a), (pi,$c), (3pi/2,$a), (2pi,$b)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +$ud = ($a>0) ? "up" : "down"; +$aAbs = abs($a); + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a vertical shift [$ud] by [`[$aAbs]`] units. + +The point [`(0,0)`] on [`y=[$func]`] is shifted to [`(0,[$a])`] on [`f(x)=[$f[0]]`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation40.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation40.pg new file mode 100644 index 0000000000..408c877de2 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation40.pg @@ -0,0 +1,174 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(1,4,1)*random(-1,1,2); + +$func = Formula("cos(x)")->reduce; +$f[0] = Formula("cos(x)+$a")->reduce; +$f[1] = Formula("$a*cos(x)")->reduce; +$f[2] = Formula("$a*sin(x)")->reduce; +$f[3] = Formula("sin(x)+$a")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$b), (pi/2,$a), (pi,$c), (3pi/2,$a), (2pi,$b)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,$b), (pi,$a), (3pi/2,$c), (2pi,$a)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +$ud = ($a>0) ? "up" : "down"; +$aAbs = abs($a); + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a vertical shift [$ud] by [`[$aAbs]`] units. + +The point [`(0,1)`] on [`y=[$func]`] is shifted to [`(0,[$b])`] on [`f(x)=[$f[0]]`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation50.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation50.pg new file mode 100644 index 0000000000..ef168da4eb --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation50.pg @@ -0,0 +1,171 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = -random(2,4,1); + +$func = Formula("sin(x)")->reduce; +$f[0] = Formula("$a*sin(x)")->reduce; +$f[1] = Formula("sin(x)")->reduce; +$f[2] = Formula("sin(x)+$a")->reduce; +$f[3] = Formula("$a*cos(x)")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,1), (pi,0), (3pi/2,-1), (2pi,0)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,$b), (pi,$a), (3pi/2,$c), (2pi,$a)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a reflection by the [`x`]-axis, and a vertical stretch by a factor of [`[$a]`]. + +The point [`(\frac{\pi}{2},1)`] on [`f(x)=[$f[0]]`] is reflected to [`(\frac{\pi}{2},-1)`], and then stretched to [`(\frac{\pi}{2},[$a])`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation60.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation60.pg new file mode 100644 index 0000000000..5aea247070 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation60.pg @@ -0,0 +1,171 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = -random(2,4,1); + +$func = Formula("cos(x)")->reduce; +$f[0] = Formula("$a*cos(x)")->reduce; +$f[1] = Formula("cos(x)")->reduce; +$f[2] = Formula("cos(x)+$a")->reduce; +$f[3] = Formula("$a*sin(x)")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,1), (pi/2,0), (pi,-1), (3pi/2,0), (2pi,1)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$b), (pi/2,$a), (pi,$c), (3pi/2,$a), (2pi,$b)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a reflection by the [`x`]-axis, and a vertical stretch by a factor of [`[$a]`]. + +The point [`(0,1)`] on [`f(x)=[$f[0]]`] is reflected to [`(0,-1)`], and then stretched to [`(0,[$a])`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation70.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation70.pg new file mode 100644 index 0000000000..06d9f64650 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation70.pg @@ -0,0 +1,208 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +$a = list_random(Fraction(1,2),Fraction(1,3),Fraction(2,3)); + +$func = Formula("sin(x)")->reduce; +$f[0] = Formula("sin($a*x)")->reduce; +$aR = Real($a); +$f[1] = Formula("sin(x/$aR)")->reduce; +$f[2] = Formula("$a*sin(x)")->reduce; +$f[3] = Formula("cos($a*x)")->reduce; + +$pf = (2/$a)->reduce; +$pf1 = ($pf/4)->reduce; +$pf2 = ($pf/2)->reduce; +$pf3 = ($pf*3/4)->reduce; + +$fpf = (2*$a)->reduce; +$fpf1 = ($fpf/4)->reduce; +$fpf2 = ($fpf/2)->reduce; +$fpf3 = ($fpf*3/4)->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), ($pf1 pi,1), ($pf2 pi,0), ($pf3 pi,-1), ($pf pi,0)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), ($fpf1 pi,1), ($fpf2 pi,0), ($fpf3 pi,-1), ($fpf pi,0)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,1), ($pf1 pi,0), ($pf2 pi,-1), ($pf3 pi,0), ($pf pi,1)"; + +$bound = 2; + +$xmin = int(-pi); #The viewing window +$xmax = int(4*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$pfShow = &output($pf); + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a horizontal stretch by a factor of [`[$pf]`]. + +If the function's formula is [`f(x)=A\sin(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{2\pi}{[$a]} = [$pfShow]``] + +At the same time, the graph of [`y=[$func]`] passes [`(0,0)`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation80.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation80.pg new file mode 100644 index 0000000000..5394a74e05 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation80.pg @@ -0,0 +1,226 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$af= list_random(Fraction(1,2),Fraction(1,3),Fraction(2,3)); +$afIn = &input($af); +$afShow = &output($af); + +$func = Formula("cos(x)")->reduce; +$f[0] = Formula("cos($afIn*x)")->reduce; +$f[1] = Formula("sin($afIn*x)")->reduce; +$f[2] = Formula("cos(2*$afIn*x)")->reduce; +$f[3] = Formula("sin(2*$afIn*x)")->reduce; + +$pf = (2/$af)->reduce; +$pf1 = ($pf/4)->reduce; +$pf2 = ($pf/2)->reduce; +$pf3 = ($pf*3/4)->reduce; + +$fpf = ($pf/2)->reduce; +$fpf1 = ($fpf/4)->reduce; +$fpf2 = ($fpf/2)->reduce; +$fpf3 = ($fpf*3/4)->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,1), ($pf1,0), ($pf2,-1), ($pf3,0), ($pf,1)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), ($pf1,1), ($pf2,0), ($pf3,-1), ($pf,0)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,1), ($fpf1,0), ($fpf2,-1), ($fpf3,0), ($fpf,1)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), ($fpf1,1), ($fpf2,0), ($fpf3,-1), ($fpf,0)"; + +$bound = 2; + +$xmin = int(-pi); #The viewing window +$xmax = int(4*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[400,400]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=\cos\left([$afShow]x\right)`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$pfShow = &output($pf); + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=\cos\left([$afShow]x\right)`] is a horizontal stretch. + +If the function's formula is [`f(x)=A\cos(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{2\pi}{[$afShow]} = [$pf]``] + +At the same time, the graph of [`f(x)=\cos\left([$afShow]x\right)`] crosses [`(0,1)`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation90.pg b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation90.pg new file mode 100644 index 0000000000..be93ad945c --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation90.pg @@ -0,0 +1,214 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "contextFraction.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,3,1); +@s = (); +@sIn = (); +for my $i (0..3) { + $s[$i] = Fraction(($a+$i)%4,2)->reduce; + $sIn[$i] = &input($s[$i]); +} +$s0Show = &output($s[0]); + +$func = Formula("sin(x)")->reduce; +$f[0] = Formula("sin(x-$sIn[0])")->reduce; +$f[1] = Formula("sin(x-$sIn[1])")->reduce; +$f[2] = Formula("sin(x-$sIn[2])")->reduce; +$f[3] = Formula("sin(x-$sIn[3])")->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x), where (0,0) is shifted to the right to ($sIn[0],0)"; +$alt[1] = "graph with the shape of y=sin(x), where (0,0) is shifted to the right to ($sIn[1],0)"; +$alt[2] = "graph with the shape of y=sin(x), where (0,0) is shifted to the right to ($sIn[2],0)"; +$alt[3] = "graph with the shape of y=sin(x), where (0,0) is shifted to the right to ($sIn[3],0)"; + +$bound = 2; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=\sin\left(x-[$s0Show]\right)`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +The graph of [`f(x)=\sin\left(x-[$s0Show]\right)`] can be obtained by shifting the graph of [`y=[$func]`] to the right by [`[$s0Show]`] units. + +For example, [`(0,0)`] on [`y=[$func]`] is transformed to [`([$s0Show],0)`] on [`f(x)=\sin\left(x-[$s0Show]\right)`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph10.pg b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph10.pg new file mode 100644 index 0000000000..5eb784185d --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph10.pg @@ -0,0 +1,257 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$Axf = $cf; +Context()->functions->disable("cos"); +$func1 = Compute("$a*sin($b*(x-$Axf*pi))+$d")->reduce; +$Ay = $func1->eval(x=>$Axf*pi); + +$Bxf = ($cf+$pf4)->reduce; +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->functions->disable("sin"); +$func2 = Compute("$a*cos($b*(x-$Bxf*pi))+$d")->reduce; +$By = $func1->eval(x=>$Bxf*pi); + +$Dxf = ($Bxf+$pf2)->reduce; +$Dy = $func1->eval(x=>$Dxf*pi); +$func3 = Compute("-$a*cos($b*(x-$Dxf*pi))+$d")->reduce; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +@graph = (); +($xmin, $xmax) = (-1,3*pi+1); +($ymin, $ymax) = (-1.5,1.5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->stamps(closed_circle(pi/2,1,red)); +$graph[0]->stamps(closed_circle(pi,0,red)); +$graph[0]->stamps(closed_circle(3*pi/2,-1,red)); +$graph[0]->stamps(closed_circle(2*pi,0,red)); +$graph[0]->stamps(closed_circle(5*pi/2,1,red)); +$graph[0]->stamps(closed_circle(3*pi,0,red)); + +$graph[0]->lb(new Label(0,0,"A",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi/2,1,"B",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi,0,"C",'red','right','top',large)); +$graph[0]->lb(new Label(3*pi/2,-1,"D",'red','right','top',large)); +$graph[0]->lb(new Label(2*pi,0,"E",'red','right','bottom',large)); +$graph[0]->lb(new Label(5*pi/2,1,"F",'red','right','bottom',large)); +$graph[0]->lb(new Label(3*pi,0,"G",'red','right','top',large)); + +add_functions($graph[0], "sin(x) for x in <$xmin,$xmax> using color:blue and weight:2"); + +$alt[0] = "This is the graph of a periodic function in the shape of sin(x) or cos(x). Point A is in the middle of maximum and minimum of y-values. To the right of Point A, Point B has the maximum y-value of the periodic function. Point C is back to the middle (same height of A). Point D has the minimum y-value of the function. Point E is in the middle (same height of A and C). Point F has maximum y-value (same height of B). Point G is the middle (same height of A, C and E)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$AxShow = &output($Axf); +$AxShowAbs = &output(abs($Axf)); +$BxShow = &output($Bxf); +$BxShowAbs = &output(abs($Bxf)); +$DxShow = &output($Dxf); +$DxShowAbs = &output(abs($Dxf)); +if ($pf == 1) { + $pAns = Compute("pi"); +} elsif ($pf == -1) { + $pAns = Compute("-pi"); +} else { + $pAns = Compute("$pf*pi"); +} +$pfShow = &output($pf); + +$lorSine = ($cf>0) ? "right" : "left"; + +$bxShowAbs = &output(abs($Bxf)); +if ($Bxf==0) { + $lorCosine = "\text{The function does not shift horizontally}"; +} elsif ($Bxf>0) { + $lorCosine = "\text{The function shifts to the right by }$bxShowAbs"; +} else { + $lorCosine = "\text{The function shifts to the left by }$bxShowAbs"; +} + +$dxShowAbs = &output(abs($Dxf)); +if ($Dxf==0) { + $lorCosineN = "\text{The function does not shift horizontally}"; +} elsif ($Dxf>0) { + $lorCosineN = "\text{The function shifts to the right by }$dxShowAbs"; +} else { + $lorCosineN = "\text{The function shifts to the left by }$dxShowAbs"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`A`] and [`B`] are + + [`` A([$AxShow],[$Ay]) \text{ and } B([$BxShow],[$By])``] + +Fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pAns}. + +d) The function, as a transformation of [`y=\sin(x)`], is [`f(x)=`][________________________]{$func1}. + +e) The function, as a transformation of [`y=\cos(x)`], is [`g(x)=`][________________________]{$func2}. + +f) The function, as a transformation of [`y=-\cos(x)`], is [`h(x)=`][________________________]{$func3}. + +END_PGML + +############################################################## + +$pf4Show = &output($pf4); + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`A([$AxShow],[$Ay])`] is on the function's midline, so the [`y`]-value of [`A`] determines the function's midline [`y=[$d]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +The vertical difference between points [`A([$AxShow],[$Ay]) \text{ and } B([$BxShow],[$By])`] is the function's amplitude [`[$By]-([$Ay])=[$a]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`a=[$a]`]. + +###Part c + +In the graph, Point [`A([$AxShow],[$Ay]) \text{ and } B([$BxShow],[$By])`] cover [`\frac{1}{4}`] of the function's period: + + [`` [$BxShow]-([$AxShow]) = [$pf4Show] ``] + +The function's period is 4 times as large: [` 4\cdot[$pf4Show] = [$pfShow] `]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$pfShow]} = [$b]``] + +###Part d + +If the function's "parent function" is [`y=\sin(x)`], its period starts at [`(0,0)`]. Point [`A([$AxShow],[$Ay])`] is the image of [`(0,0)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +The function shifts to the [$lorSine] by [`[$AxShowAbs]`] units. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`c=[$AxShow]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +###Part e + +If the function's "parent function" is [`y=\cos(x)`], its period starts at [`(0,1)`]. Point [`B([$BxShow],[$By])`] is the image of [`(0,1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosine]`]. + +If the function's formula is [`g(x)=a\cos(b(x-c))+d`], we have [`c=[$BxShow]`]. + +Putting together all parts, the function's function is [`g(x)=[$func2]`]. + +###Part f + +If the function's "parent function" is [`y=-\cos(x)`], its period starts at [`(0,-1)`]. Point [`D([$DxShow],[$Dy])`] is the image of [`(0,-1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosineN]`]. + +If the function's formula is [`h(x)=-a\cos(b(x-c))+d`], we have [`c=[$DxShow]`]. + +Putting together all parts, the function's function is [`h(x)=[$func3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph20.pg b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph20.pg new file mode 100644 index 0000000000..2b42183400 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph20.pg @@ -0,0 +1,271 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$Axf = $cf; +Context()->functions->disable("cos"); +$func1 = Compute("$a*sin($b*(x-$Axf*pi))+$d")->reduce; +$Ay = $func1->eval(x=>$Axf*pi); + +$Bxf = ($cf+$pf4)->reduce; +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->functions->disable("sin"); +$By = $func1->eval(x=>$Bxf*pi); + +$func2 = Compute("$a*cos($b*(x-$Bxf*pi))+$d")->reduce; + +$Dxf = ($Bxf+$pf2)->reduce; +$Dy = $func1->eval(x=>$Dxf*pi); +$func3 = Compute("-$a*cos($b*(x-$Dxf*pi))+$d")->reduce; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +@graph = (); +($xmin, $xmax) = (-1,3*pi+1); +($ymin, $ymax) = (-1.5,1.5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->stamps(closed_circle(pi/2,1,red)); +$graph[0]->stamps(closed_circle(pi,0,red)); +$graph[0]->stamps(closed_circle(3*pi/2,-1,red)); +$graph[0]->stamps(closed_circle(2*pi,0,red)); +$graph[0]->stamps(closed_circle(5*pi/2,1,red)); +$graph[0]->stamps(closed_circle(3*pi,0,red)); + +$graph[0]->lb(new Label(0,0,"A",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi/2,1,"B",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi,0,"C",'red','right','top',large)); +$graph[0]->lb(new Label(3*pi/2,-1,"D",'red','right','top',large)); +$graph[0]->lb(new Label(2*pi,0,"E",'red','right','bottom',large)); +$graph[0]->lb(new Label(5*pi/2,1,"F",'red','right','bottom',large)); +$graph[0]->lb(new Label(3*pi,0,"G",'red','right','top',large)); + +add_functions($graph[0], "sin(x) for x in <$xmin,$xmax> using color:blue and weight:2"); + +$alt[0] = "This is the graph of a periodic function in the shape of sin(x) or cos(x). Point A is in the middle of maximum and minimum of y-values. To the right of Point A, Point B has the maximum y-value of the periodic function. Point C is back to the middle (same height of A). Point D has the minimum y-value of the function. Point E is in the middle (same height of A and C). Point F has maximum y-value (same height of B). Point G is the middle (same height of A, C and E)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$AxShow = &output($Axf); +$AxShowAbs = &output(abs($Axf)); +$BxShow = &output($Bxf); +$BxShowAbs = &output(abs($Bxf)); +$DxShow = &output($Dxf); +$DxShowAbs = &output(abs($Dxf)); +if ($pf == 1) { + $pAns = Compute("pi"); +} elsif ($pf == -1) { + $pAns = Compute("-pi"); +} else { + $pAns = Compute("$pf*pi"); +} +$pfShow = &output($pf); + +$lorSine = ($cf>0) ? "right" : "left"; + +$bxShowAbs = &output(abs($Bxf)); +if ($Bxf==0) { + $lorCosine = "\text{The function does not shift horizontally}"; +} elsif ($Bxf>0) { + $lorCosine = "\text{The function shifts to the right by }$bxShowAbs"; +} else { + $lorCosine = "\text{The function shifts to the left by }$bxShowAbs"; +} + +$dxShowAbs = &output(abs($Dxf)); +if ($Dxf==0) { + $lorCosineN = "\text{The function does not shift horizontally}"; +} elsif ($Dxf>0) { + $lorCosineN = "\text{The function shifts to the right by }$dxShowAbs"; +} else { + $lorCosineN = "\text{The function shifts to the left by }$dxShowAbs"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`B`] and [`D`] are + + [`` B([$BxShow],[$By]) \text{ and } D([$DxShow],[$Dy])``] + +Fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pAns}. + +d) The function, as a transformation of [`y=\sin(x)`], is [`f(x)=`][________________________]{$func1}. + +e) The function, as a transformation of [`y=\cos(x)`], is [`g(x)=`][________________________]{$func2}. + +f) The function, as a transformation of [`y=-\cos(x)`], is [`h(x)=`][________________________]{$func3}. + +END_PGML + +############################################################## + +$pf2Show = &output($pf2); + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`C`] is on the function's midline, so the [`y`]-value of [`C`] determines the function's midline. The [`y`]-value of [`C`] is simply the average [`y`]-values of points [`B([$BxShow],[$By]) \text{ and } D([$DxShow],[$Dy])`]: + + [`` y-\text{value of }C = \frac{[$By]+([$Dy])}{2} = [$d]``] + +The function's midline is [`y=[$d]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +The vertical difference between points [`B([$BxShow],[$By]) \text{ and } D([$DxShow],[$Dy])`] is twice the function's amplitude, so we have: + + [``\text{amplitude}=\frac{[$By]-([$Dy])}{2}=[$a]``]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`a=[$a]`]. + +###Part c + +In the graph, Point [`B([$BxShow],[$By]) \text{ and } D([$DxShow],[$Dy])`] cover half of the function's period: + + [`` [$DxShow]-([$BxShow]) = [$pf2Show] ``] + +The function's period is twice as large: [` 2\cdot[$pf2Show] = [$pfShow] `]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$pfShow]} = [$b]``] + +###Part d + +If the function's "parent function" is [`y=\sin(x)`], its period starts at [`(0,0)`]. Point [`A`] is the image of [`(0,0)`] after transformations, so the [`x`]-value of Point [`A`] tells us the horizontal shift. + + [``\begin{aligned} + (x-\text{value of }A) + &= (x-\text{value of }B)-\left(\frac{1}{4}\text{ of period}\right) \\ + &= [$BxShow]-\frac{1}{4}\cdot\left([$pfShow]\right) \\ + &= [$AxShow] + \end{aligned}``] + +The function shifts to the [$lorSine] by [`[$AxShowAbs]`] units. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`C=[$AxShow]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +###Part e + +If the function's "parent function" is [`y=\cos(x)`], its period starts at [`(0,1)`]. Point [`B([$BxShow],[$By])`] is the image of [`(0,1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosine]`]. + +If the function's formula is [`g(x)=a\cos(b(x-c))+d`], we have [`c=[$BxShow]`]. + +Putting together all parts, the function's function is [`g(x)=[$func2]`]. + +###Part f + +If the function's "parent function" is [`y=-\cos(x)`], its period starts at [`(0,-1)`]. Point [`D([$DxShow],[$Dy])`] is the image of [`(0,-1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosineN]`]. + +If the function's formula is [`h(x)=-a\cos(b(x-c))+d`], we have [`c=[$DxShow]`]. + +Putting together all parts, the function's function is [`h(x)=[$func3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph30.pg b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph30.pg new file mode 100644 index 0000000000..11958e4caa --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph30.pg @@ -0,0 +1,265 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$bShow = &output($b); + +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$bIn = &input($b); +$Ax = $cf; +Context()->functions->disable("cos"); +$func1 = Compute("$a*sin($bIn*(x-$Ax))+$d")->reduce; +$Ay = $func1->eval(x=>$Ax); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->functions->disable("sin"); + +$Bx = ($cf+$pf4)->reduce; +$func2 = Compute("$a*cos($bIn*(x-$Bx))+$d")->reduce; +$By = $func1->eval(x=>$Bx); + +$Dx = ($Bx+$pf2)->reduce; +$Dy = $func1->eval(x=>$Dx); +$func3 = Compute("-$a*cos($bIn*(x-$Dx))+$d")->reduce; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +@graph = (); +($xmin, $xmax) = (-1,3*pi+1); +($ymin, $ymax) = (-1.5,1.5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->stamps(closed_circle(pi/2,1,red)); +$graph[0]->stamps(closed_circle(pi,0,red)); +$graph[0]->stamps(closed_circle(3*pi/2,-1,red)); +$graph[0]->stamps(closed_circle(2*pi,0,red)); +$graph[0]->stamps(closed_circle(5*pi/2,1,red)); +$graph[0]->stamps(closed_circle(3*pi,0,red)); + +$graph[0]->lb(new Label(0,0,"A",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi/2,1,"B",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi,0,"C",'red','right','top',large)); +$graph[0]->lb(new Label(3*pi/2,-1,"D",'red','right','top',large)); +$graph[0]->lb(new Label(2*pi,0,"E",'red','right','bottom',large)); +$graph[0]->lb(new Label(5*pi/2,1,"F",'red','right','bottom',large)); +$graph[0]->lb(new Label(3*pi,0,"G",'red','right','top',large)); + +add_functions($graph[0], "sin(x) for x in <$xmin,$xmax> using color:blue and weight:2"); + +$alt[0] = "This is the graph of a periodic function in the shape of sin(x) or cos(x). Point A is in the middle of maximum and minimum of y-values. To the right of Point A, Point B has the maximum y-value of the periodic function. Point C is back to the middle (same height of A). Point D has the minimum y-value of the function. Point E is in the middle (same height of A and C). Point F has maximum y-value (same height of B). Point G is the middle (same height of A, C and E)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$lorSine = ($cf>0) ? "right" : "left"; + +$AxAbs = abs($Ax); +$BxAbs = abs($Bx); +$DxAbs = abs($Dx); + +if ($Bx==0) { + $lorCosine = "\text{The function does not shift horizontally}"; +} elsif ($Bx>0) { + $lorCosine = "\text{The function shifts to the right by }$BxAbs\text{ units}"; +} else { + $lorCosine = "\text{The function shifts to the left by }$BxAbs\text{ units}"; +} + +if ($Dx==0) { + $lorCosineN = "\text{The function does not shift horizontally}"; +} elsif ($Dx>0) { + $lorCosineN = "\text{The function shifts to the right by }$DxAbs\text{ units}"; +} else { + $lorCosineN = "\text{The function shifts to the left by }$DxAbs\text{ units}"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`A`] and [`B`] are + + [`` A([$Ax],[$Ay]) \text{ and } B([$Bx],[$By])``] + +Fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pf}. + +d) The function, as a transformation of [`y=\sin(x)`], is [`f(x)=`][________________________]{$func1}. + +e) The function, as a transformation of [`y=\cos(x)`], is [`g(x)=`][________________________]{$func2}. + +f) The function, as a transformation of [`y=-\cos(x)`], is [`h(x)=`][________________________]{$func3}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`A([$Ax],[$Ay])`] is on the function's midline, so the [`y`]-value of [`A`] determines the function's midline [`y=[$d]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +The vertical difference between points [`A([$Ax],[$Ay]) \text{ and } B([$Bx],[$By])`] is the function's amplitude [`[$By]-([$Ay])=[$a]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`a=[$a]`]. + +###Part c + +In the graph, Point [`A([$Ax],[$Ay]) \text{ and } B([$Bx],[$By])`] cover [`\frac{1}{4}`] of the function's period: + + [`` [$Bx]-([$Ax]) = [$pf4] ``] + +The function's period is 4 times as large: [` 4\cdot[$pf4] = [$pf] `]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$pf]} = [$bShow]``] + +###Part d + +If the function's "parent function" is [`y=\sin(x)`], its period starts at [`(0,0)`]. Point [`A([$Ax],[$Ay])`] is the image of [`(0,0)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +The function shifts to the [$lorSine] by [`[$AxAbs]`] units. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`c=[$Ax]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +###Part e + +If the function's "parent function" is [`y=\cos(x)`], its period starts at [`(0,1)`]. Point [`B([$Bx],[$By])`] is the image of [`(0,1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosine]`]. + +If the function's formula is [`g(x)=a\cos(b(x-c))+d`], we have [`c=[$Bx]`]. + +Putting together all parts, the function's function is [`g(x)=[$func2]`]. + +###Part f + +If the function's "parent function" is [`y=-\cos(x)`], its period starts at [`(0,-1)`]. Point [`D([$Dx],[$Dy])`] is the image of [`(0,-1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosineN]`]. + +If the function's formula is [`h(x)=-a\cos(b(x-c))+d`], we have [`c=[$Dx]`]. + +Putting together all parts, the function's function is [`h(x)=[$func3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph40.pg b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph40.pg new file mode 100644 index 0000000000..cd9028b791 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph40.pg @@ -0,0 +1,278 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$bShow = &output($b); + +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$bIn = &input($b); +$Ax = $cf; +Context()->functions->disable("cos"); +$func1 = Compute("$a*sin($bIn*(x-$Ax))+$d")->reduce; +$Ay = $func1->eval(x=>$Ax); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->functions->disable("sin"); + +$Bx = ($cf+$pf4)->reduce; +$func2 = Compute("$a*cos($bIn*(x-$Bx))+$d")->reduce; +$By = $func1->eval(x=>$Bx); + +$Dx = ($Bx+$pf2)->reduce; +$Dy = $func1->eval(x=>$Dx); +$func3 = Compute("-$a*cos($bIn*(x-$Dx))+$d")->reduce; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +@graph = (); +($xmin, $xmax) = (-1,3*pi+1); +($ymin, $ymax) = (-1.5,1.5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->stamps(closed_circle(pi/2,1,red)); +$graph[0]->stamps(closed_circle(pi,0,red)); +$graph[0]->stamps(closed_circle(3*pi/2,-1,red)); +$graph[0]->stamps(closed_circle(2*pi,0,red)); +$graph[0]->stamps(closed_circle(5*pi/2,1,red)); +$graph[0]->stamps(closed_circle(3*pi,0,red)); + +$graph[0]->lb(new Label(0,0,"A",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi/2,1,"B",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi,0,"C",'red','right','top',large)); +$graph[0]->lb(new Label(3*pi/2,-1,"D",'red','right','top',large)); +$graph[0]->lb(new Label(2*pi,0,"E",'red','right','bottom',large)); +$graph[0]->lb(new Label(5*pi/2,1,"F",'red','right','bottom',large)); +$graph[0]->lb(new Label(3*pi,0,"G",'red','right','top',large)); + +add_functions($graph[0], "sin(x) for x in <$xmin,$xmax> using color:blue and weight:2"); + +$alt[0] = "This is the graph of a periodic function in the shape of sin(x) or cos(x). Point A is in the middle of maximum and minimum of y-values. To the right of Point A, Point B has the maximum y-value of the periodic function. Point C is back to the middle (same height of A). Point D has the minimum y-value of the function. Point E is in the middle (same height of A and C). Point F has maximum y-value (same height of B). Point G is the middle (same height of A, C and E)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$lorSine = ($cf>0) ? "right" : "left"; + +$AxAbs = abs($Ax); +$BxAbs = abs($Bx); +$DxAbs = abs($Dx); + +if ($Bx==0) { + $lorCosine = "\text{The function does not shift horizontally}"; +} elsif ($Bx>0) { + $lorCosine = "\text{The function shifts to the right by }$BxAbs\text{ units}"; +} else { + $lorCosine = "\text{The function shifts to the left by }$BxAbs\text{ units}"; +} + +if ($Dx==0) { + $lorCosineN = "\text{The function does not shift horizontally}"; +} elsif ($Dx>0) { + $lorCosineN = "\text{The function shifts to the right by }$DxAbs\text{ units}"; +} else { + $lorCosineN = "\text{The function shifts to the left by }$DxAbs\text{ units}"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`B`] and [`D`] are + + [`` B([$Bx],[$By]) \text{ and } D([$Dx],[$Dy])``] + +Fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pf}. + +d) The function, as a transformation of [`y=\sin(x)`], is [`f(x)=`][________________________]{$func1}. + +e) The function, as a transformation of [`y=\cos(x)`], is [`g(x)=`][________________________]{$func2}. + +f) The function, as a transformation of [`y=-\cos(x)`], is [`h(x)=`][________________________]{$func3}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`C`] is on the function's midline, so the [`y`]-value of [`C`] determines the function's midline. The [`y`]-value of [`C`] is simply the average [`y`]-values of points [`B([$Bx],[$By]) \text{ and } D([$Dx],[$Dy])`]: + + [`` y \text{-value of }C = \frac{[$By]+([$Dy])}{2} = [$d]``] + +The function's midline is [`y=[$d]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +The vertical difference between points [`B([$Bx],[$By]) \text{ and } D([$Dx],[$Dy])`] is twice the function's amplitude, so we have: + + [``\text{amplitude}=\frac{[$By]-([$Dy])}{2}=[$a]``] + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`a=[$a]`]. + +###Part c + +In the graph, Point [`B([$Bx],[$By]) \text{ and } D([$Dx],[$Dy])`] cover half of the function's period: + + [`` [$Dx]-([$Bx]) = [$pf2] ``] + +The function's period is twice as large: [` 2\cdot[$pf2] = [$pf] `]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$pf]} = [$bShow]``] + +###Part d + +If the function's "parent function" is [`y=\sin(x)`], its period starts at [`(0,0)`]. Point [`A`] is the image of [`(0,0)`] after transformations, so the [`x`]-value of Point [`A`] tells us the horizontal shift. + + [``\begin{aligned} + (x-\text{value of }A) + &= (x-\text{value of }B)-\left(\frac{1}{4}\text{ of period}\right) \\ + &= [$Bx]-\frac{1}{4}\cdot\left([$pf]\right) \\ + &= [$Ax] + \end{aligned}``] + +The function shifts to the [$lorSine] by [`[$AxAbs]`] units. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`c=[$Ax]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +###Part e + +If the function's "parent function" is [`y=\cos(x)`], its period starts at [`(0,1)`]. Point [`B([$Bx],[$By])`] is the image of [`(0,1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosine]`]. + +If the function's formula is [`g(x)=a\cos(b(x-c))+d`], we have [`c=[$Bx]`]. + +Putting together all parts, the function's function is [`g(x)=[$func2]`]. + +###Part f + +If the function's "parent function" is [`y=-\cos(x)`], its period starts at [`(0,-1)`]. Point [`D([$Dx],[$Dy])`] is the image of [`(0,-1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosineN]`]. + +If the function's formula is [`h(x)=-a\cos(b(x-c))+d`], we have [`c=[$Dx]`]. + +Putting together all parts, the function's function is [`h(x)=[$func3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph50.pg b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph50.pg new file mode 100644 index 0000000000..d3092a78de --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph50.pg @@ -0,0 +1,222 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$pf = (1/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$cfIn = &input($cf); +$func1 = Compute("$a*tan($b*(x-$cfIn))+$d")->reduce; +$func2 = Compute("$a*tan($b*x)+$d")->reduce; + +$Oxf = $cf; +$Oy = $func1->eval(x=>$Oxf*pi); +$OxShow = &output($Oxf); +$OxShowAbs = &output(abs($Oxf)); + +$asymptoteLf = ($Oxf-$pf2)->reduce; +$asymptoteL = &input($asymptoteLf); +$asymptoteLShow = &output($asymptoteLf); +$asymptoteRf = ($Oxf+$pf2)->reduce; +$asymptoteR = &input($asymptoteRf); +$asymptoteRShow = &output($asymptoteRf); + +$Pxf = ($cf+$asymptoteRf)/2; +$Py = $func1->eval(x=>$Pxf*pi); +$PxShow = &output($Pxf); +$PxShowAbs = &output(abs($Pxf)); + +@graph = (); +($xmin, $xmax) = (-3*pi/4,3*pi/4); +($ymin, $ymax) = (-3,3); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->lb(new Label(0,0,"O",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle(pi/4,1,red)); +$graph[0]->lb(new Label(pi/4,1,"P",'red','right','bottom',large)); + +$graph[0]->moveTo(-pi/2,$ymin); +$graph[0]->lineTo(-pi/2,$ymax,blue,2,dashed); +$graph[0]->moveTo(pi/2,$ymin); +$graph[0]->lineTo(pi/2,$ymax,blue,2,dashed); +$graph[0]->lb(new Label(-pi/2,$ymax-1,"x=$asymptoteL",'blue','left','middle',large)); +$graph[0]->lb(new Label(pi/2,$ymin+1,"x=$asymptoteR",'blue','right','middle',large)); + +$l = -pi/2+0.01; +$r = pi/2-0.01; +add_functions($graph[0], "tan(x) for x in <$l,$r> using color:blue and weight:2"); + +$alt[0] = "This is the graph of one period of the function tan(x). The center is marked as O. Point P is also marked on the function, in the middle of Point O and the asymptote x=$asymptoteR. Two asymptotes are on the left and rigth of the function: x=$asymptoteL and x=$asymptoteR."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +if ($pf == 1) { + $pAns = Compute("pi"); +} elsif ($pf == -1) { + $pAns = Compute("-pi"); +} else { + $pAns = Compute("$pf*pi"); +} +$pfShow = &output($pf); + +$lor = ($cf>0) ? "right" : "left"; + +if ($Oxf==0) { + $lorTangent = "\text{The function does not shift horizontally}"; +} elsif ($Oxf>0) { + $lorTangent = "\text{The function shifts to the right by }$oxShowAbs"; +} else { + $lorTangent = "\text{The function shifts to the left by }$oxShowAbs"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`O`] are [` O([$OxShow],[$Oy])`], the coordinates of Point [`P`] are [` P([$PxShow],[$Py])`], and if the function's two asymptotes are [`x=[$asymptoteLShow]`] and [`x=[$asymptoteRShow]`], fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +Find the function's equation in the form of [`f(x)=a\tan(b(x-c))+d`]. + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's period is [______]{$pAns}. + +c) The value of [`a`] determines the function's vertical stretch/compression: [`a=`][______]{$a}. + +d) The function, as a transformation of [`y=\tan(x)`], is [`f(x)=`][________________________]{$func1}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`O([$OxShow],[$Oy])`] is on the function's midline, so the [`y`]-value of [`O`] determines the function's midline [`y=[$d]`]. + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +In the graph, the difference between the function's two asymptotes determines the function's period: + + [`` [$asymptoteRShow]-([$asymptoteLShow]) = [$pfShow] ``] + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{\pi}{[$pfShow]} = [$b]``] + +###Part c + +In the graph of [`y=\tan{x}`], the vertical distance between [`(0,0)`] and [`\left(\frac{\pi}{4},1\right)`] is [`1`]. In this function's graph, the vertical distance between [` O([$OxShow],[$Oy])`] and [` P([$PxShow],[$Py])`] is [`[$Py]-([$Oy])=[$a]`]. So the value of [`a`] in [`f(x)=a\tan(b(x-c))+d`] is [`a=[$a]`]. + +###Part d + +If the function's "parent function" is [`y=\tan(x)`], its center is at [`(0,0)`]. Point [`O([$OxShow],[$Oy])`] is the image of [`(0,0)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +The function shifts to the [$lor] by [`[$OxShowAbs]`] units. + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], we have [`c=[$OxShow]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph60.pg b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph60.pg new file mode 100644 index 0000000000..44f606933e --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph60.pg @@ -0,0 +1,209 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$bIn = &input($b); +$bShow = &output($b); + +$pf = (1/$b)->reduce; +$pfShow = &output($pf); +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$func1 = Compute("$a*tan($bIn*(x-$cf))+$d")->reduce; +$func2 = Compute("$a*tan($bIn*x)+$d")->reduce; + +$Ox = $cf; +$Oy = $func1->eval(x=>$Ox); +$OxAbs = abs($Ox); + +$asymptoteL = ($Ox-$pf2)->reduce; +$asymptoteR = ($Ox+$pf2)->reduce; + +$Px = $cf+$pf2/2; +$Py = $func1->eval(x=>$Px); +$PxAbs = abs($Px); + +@graph = (); +($xmin, $xmax) = (-3*pi/4,3*pi/4); +($ymin, $ymax) = (-3,3); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->lb(new Label(0,0,"O",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle(pi/4,1,red)); +$graph[0]->lb(new Label(pi/4,1,"P",'red','right','bottom',large)); + +$graph[0]->moveTo(-pi/2,$ymin); +$graph[0]->lineTo(-pi/2,$ymax,blue,2,dashed); +$graph[0]->moveTo(pi/2,$ymin); +$graph[0]->lineTo(pi/2,$ymax,blue,2,dashed); +$graph[0]->lb(new Label(-pi/2,$ymax-1,"x=$asymptoteL",'blue','left','middle',large)); +$graph[0]->lb(new Label(pi/2,$ymin+1,"x=$asymptoteR",'blue','right','middle',large)); + +$l = -pi/2+0.01; +$r = pi/2-0.01; +add_functions($graph[0], "tan(x) for x in <$l,$r> using color:blue and weight:2"); + +$alt[0] = "This is the graph of one period of the function tan(x). The center is marked as O. Point P is also marked on the function, in the middle of Point O and the asymptote x=$asymptoteR. Two asymptotes are on the left and rigth of the function: x=$asymptoteL and x=$asymptoteR."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$lor = ($cf>0) ? "right" : "left"; + +if ($Ox==0) { + $lorTangent = "\text{The function does not shift horizontally}"; +} elsif ($Ox>0) { + $lorTangent = "\text{The function shifts to the right by }$ox"; +} else { + $lorTangent = "\text{The function shifts to the left by }$ox"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`O`] are [` O([$Ox],[$Oy])`], the coordinates of Point [`P`] are [` P([$Px],[$Py])`], and if the function's two asymptotes are [`x=[$asymptoteL]`] and [`x=[$asymptoteR]`], fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +Find the function's equation in the form of [`f(x)=a\tan(b(x-c))+d`]. + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's period is [______]{$pf}. + +c) The value of [`a`] determines the function's vertical stretch/compression: [`a=`][______]{$a}. + +d) The function, as a transformation of [`y=\tan(x)`], is [`f(x)=`][________________________]{$func1}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`O([$Ox],[$Oy])`] is on the function's midline, so the [`y`]-value of [`O`] determines the function's midline [`y=[$d]`]. + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +In the graph, the difference between the function's two asymptotes determines the function's period: + + [`` [$asymptoteR]-([$asymptoteL]) = [$pf] ``] + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{\pi}{[$pf]} = [$bShow]``] + +###Part c + +In the graph of [`y=\tan{x}`], the vertical distance between [`(0,0)`] and [`\left(\frac{\pi}{4},1\right)`] is [`1`]. In this function's graph, the vertical distance between [` O([$Ox],[$Oy])`] and [` P([$Px],[$Py])`] is [`[$Py]-([$Oy])=[$a]`]. So the value of [`a`] in [`f(x)=a\tan(b(x-c))+d`] is [`a=[$a]`]. + +###Part d + +If the function's "parent function" is [`y=\tan(x)`], its center is at [`(0,0)`]. Point [`O([$Ox],[$Oy])`] is the image of [`(0,0)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +The function shifts to the [$lor] by [`[$OxAbs]`] units. + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], we have [`c=[$Ox]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity10.pg b/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity10.pg new file mode 100644 index 0000000000..0387c41005 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity10.pg @@ -0,0 +1,163 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \left(1+\sin(\theta))(1+\sin(-\theta)\right)"; +$right = "\displaystyle \cos^2(\theta)"; + +@steps = ( + "\displaystyle (1+\sin(\theta))(1-\sin(\theta))", + "\displaystyle 1-\sin^2(\theta)", + "\displaystyle \cos^2(\theta)", + "\displaystyle (1+\sin(\theta))(1+\sin(\theta))", + "\displaystyle 1+2\sin(\theta)+\sin^2(\theta)", + "\displaystyle 1-2\sin(\theta)+\sin^2(\theta)", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Simplify [` [$left] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identity: + + [`` \sin^2(\theta)+\cos^2(\theta) = 1 ``] + +Since [`y=\sin(\theta)`] is an odd function, + + [``\sin(-\theta) = -\sin(\theta) ``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The solution is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity20.pg b/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity20.pg new file mode 100644 index 0000000000..bf1ac09e80 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity20.pg @@ -0,0 +1,174 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\cot(\theta)}{\csc(\theta)}"; +$right = "\displaystyle \cos(\theta)"; + +@steps = ( + "\displaystyle \frac{\frac{\cos(\theta)}{\sin(\theta)}}{\frac{1}{\sin(\theta)}}", + "\displaystyle \frac{\frac{\cos(\theta)}{\sin(\theta)}\cdot\sin(\theta)}{\frac{1}{\sin(\theta)}\cdot\sin(\theta)}", + "\displaystyle \frac{\cos(\theta)}{1}", + "\displaystyle \cos(\theta)", + "\displaystyle \frac{\frac{\sin(\theta)}{\cos(\theta)}}{\frac{1}{\cos(\theta)}}", + "\displaystyle \frac{\frac{\sin(\theta)}{\cos(\theta)}\cdot\cos(\theta)}{\frac{1}{\cos(\theta)}\cdot\cos(\theta)}", + "\displaystyle \frac{\sin(\theta)}{1}", + "\displaystyle \sin(\theta)", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Simplify [` [$left] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:80px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following two identities: + + [`` \cot(\theta) = \frac{\cos(\theta)}{\sin(\theta)} \text{ and } \csc(\theta) = \frac{1}{\sin(\theta)} ``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The solution is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity30.pg b/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity30.pg new file mode 100644 index 0000000000..7fe38b8d32 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity30.pg @@ -0,0 +1,181 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle (\sin(-\theta))(\cos(-\theta))(\csc(-\theta))"; +$right = "\displaystyle \cos(\theta)"; + +@steps = ( + "\displaystyle (-\sin(\theta))(\cos(\theta))(-\csc(\theta))", + "\displaystyle \sin(\theta)\cos(\theta)\csc(\theta)", + "\displaystyle \sin(\theta)\cos(\theta)\frac{1}{\sin(\theta)}", + "\displaystyle \cos(\theta)", + "\displaystyle (\sin(\theta))(-\cos(\theta))(\csc(\theta))", + "\displaystyle -\sin(\theta)\cos(\theta)\csc(\theta)", + "\displaystyle -\sin(\theta)\cos(\theta)\frac{1}{\sin(\theta)}", + "\displaystyle \sin(\theta)", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Simplify [` [$left] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identity: + + [`` \csc(\theta) = \frac{1}{\sin(\theta)} ``] + +We must also know whether a trigonometry function is odd or even: + + [``\begin{aligned} + \sin(-\theta) &= -\sin(\theta) \\ + \cos(-\theta) &= \cos(\theta) \\ + \csc(-\theta) &= -\csc(\theta) \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The solution is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity40.pg b/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity40.pg new file mode 100644 index 0000000000..6e4fc146b5 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity40.pg @@ -0,0 +1,181 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle (\tan(-\theta))(\cot(-\theta))"; +$right = "\displaystyle 1"; + +@steps = ( + "\displaystyle (-\tan(\theta))(-\cot(\theta))", + "\displaystyle \tan(\theta)\cot(\theta)", + "\displaystyle \frac{\sin(\theta)}{\cos(\theta)}\cdot \frac{\cos(\theta)}{\sin(\theta)}", + "\displaystyle 1", + "\displaystyle (-\tan(\theta))(\cot(\theta))", + "\displaystyle -\tan(\theta)\cot(\theta)", + "\displaystyle -\frac{\sin(\theta)}{\cos(\theta)}\cdot \frac{\cos(\theta)}{\sin(\theta)}", + "\displaystyle -1", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Simplify [` [$left] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \tan(\theta) = \frac{\sin(\theta)}{\cos(\theta)} \text( and } \cot(\theta) = \frac{\cos(\theta)}{\sin(\theta)}``] + +We must also know whether a trigonometry function is odd or even: + + [``\begin{aligned} + \tan(-\theta) &= -\tan(\theta) \\ + \cot(-\theta) &= \cot(\theta) \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The solution is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof10.pg b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof10.pg new file mode 100644 index 0000000000..64ab48931c --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof10.pg @@ -0,0 +1,183 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \tan^2(\theta) + 1 "; +$right = "\displaystyle \sec^2(\theta)"; + +@steps = ( + "\displaystyle \left(\frac{\sin(\theta)}{\cos(\theta)}\right)^2+1", + "\displaystyle \frac{\sin^2(\theta)}{\cos^2(\theta)}+1", + "\displaystyle \frac{\sin^2(\theta)}{\cos^2(\theta)}+\frac{\cos^2(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{\sin^2(\theta)+\cos^2(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{1}{\cos^2(\theta)}", + "\displaystyle \frac{\sin^2(\theta)}{\cos^2(\theta)}+\frac{\sin^2(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{\sin^2(\theta)+\sin^2(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{\sin^2(\theta)+1}{\cos^2(\theta)}", + "\displaystyle \frac{1}{\sin^2(\theta)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[4]}'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{I: }[$steps[$scramble{8}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following two identities: + + [`` \tan(\theta) = \frac{\sin(\theta)}{\cos(\theta)} \text{ and } \sin^2(\theta)+\cos^2(\theta) = 1 ``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$steps[4]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof20.pg b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof20.pg new file mode 100644 index 0000000000..ed472c7837 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof20.pg @@ -0,0 +1,175 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\sec^2(\theta) - 1}{\sec^2(\theta)} "; +$right = "\displaystyle \sin^2(\theta)"; + +@steps = ( + "\displaystyle \frac{\frac{1}{\cos^2(\theta)} - 1}{\frac{1}{\cos^2(\theta)}} ", + "\displaystyle \frac{ \left(\frac{1}{\cos^2(\theta)} - 1 \right)\cdot \cos^2(\theta) }{\frac{1}{\cos^2(\theta)}\cdot \cos^2(\theta)} ", + "\displaystyle \frac{1 - \cos^2(\theta)}{1} ", + "\displaystyle \frac{\sin^2(\theta)}{1} ", + "\displaystyle \frac{\frac{1}{\sin^2(\theta)} - 1}{\frac{1}{\sin^2(\theta)}} ", + "\displaystyle \frac{ \left(\frac{1}{\sin^2(\theta)} - 1 \right)\cdot \sin^2(\theta) } {\frac{1}{\sin^2(\theta)}\cdot \sin^2(\theta)} ", + "\displaystyle \frac{\cos^2(\theta)-1}{1} ", + "\displaystyle \frac{\cos^2(\theta)}{1} ", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \sec(\theta) = \frac{1}{\cos(\theta)} \text{ and } \sin^2(\theta)+\cos^2(\theta) = 1 ``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof30.pg b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof30.pg new file mode 100644 index 0000000000..ac9a02d9e6 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof30.pg @@ -0,0 +1,164 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\sin^2(-\theta)-\cos^2(-\theta)}{\sin(-\theta)-\cos(-\theta)} "; +$right = "\displaystyle \cos(\theta)-\sin(\theta)"; + +@steps = ( + "\displaystyle \frac{(-\sin(\theta))^2-\cos^2(\theta)}{-\sin(\theta)-\cos(\theta)} ", + "\displaystyle \frac{\sin^2(\theta)-\cos^2(\theta)}{-\left(\sin(\theta)+\cos(\theta)\right)} ", + "\displaystyle -\frac{(\sin(\theta)+\cos(\theta))(\sin(\theta)-\cos(\theta))}{\sin(\theta)+\cos(\theta)} ", + "\displaystyle -( \sin(\theta)-\cos(\theta) ) ", + "\displaystyle \frac{\sin^2(\theta)-\cos^2(\theta)}{\sin(\theta)+\cos(\theta)} ", + "\displaystyle \frac{(\sin(\theta)+\cos(\theta))(\sin(\theta)-\cos(\theta))}{\sin(\theta)+\cos(\theta)} ", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know whether a trigonometry function is odd or even: + + [``\begin{aligned} + \sin(-\theta) &= -\sin(\theta) \\ + \cos(-\theta) &= \cos(\theta) \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof40.pg b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof40.pg new file mode 100644 index 0000000000..8468c3fd5e --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof40.pg @@ -0,0 +1,178 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle (1-\cos^2(\theta))(1+\cot^2(\theta))"; +$right = "\displaystyle 1"; + +@steps = ( + "\displaystyle \sin^2(\theta)\left(1+\frac{\cos^2(\theta)}{\sin^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{\sin^2(\theta)}{\sin^2(\theta)}+\frac{\cos^2(\theta)}{\sin^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{\sin^2(\theta)+\cos^2(\theta)}{\sin^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{1}{\sin^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(1+\frac{\sin^2(\theta)}{\cos^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{1+\sin^2(\theta)}{\cos^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{1+\cos^2(\theta)}{\sin^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{\cos^2(\theta)}{\cos^2(\theta)}+\frac{\cos^2(\theta)}{\sin^2(\theta)}\right)", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [``\begin{aligned} + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} \\ + \sin^2(\theta)+\cos^2(\theta) &= 1 \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof50.pg b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof50.pg new file mode 100644 index 0000000000..43df821b28 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof50.pg @@ -0,0 +1,158 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\cos(\theta)}{1+\sin(\theta)}"; +$right = "\displaystyle \frac{1-\sin(\theta)}{\cos(\theta)}"; + +@steps = ( + "\displaystyle \frac{\cos(\theta)\cdot(1-\sin(\theta))}{(1+\sin(\theta))\cdot(1-\sin(\theta))}", + "\displaystyle \frac{\cos(\theta)\cdot(1-\sin(\theta))}{1-\sin^2(\theta)}", + "\displaystyle \frac{\cos(\theta)\cdot(1-\sin(\theta))}{\cos^2(\theta)}", + "\displaystyle \frac{\cos(\theta)\cdot(1+\sin(\theta))}{(1+\sin(\theta))\cdot(1+\sin(\theta))}", + "\displaystyle \frac{\cos(\theta)\cdot(1+\sin(\theta))}{1+\sin^2(\theta)}", + "\displaystyle \frac{\cos(\theta)\cdot\cos(\theta)}{(1+\sin(\theta))\cdot\cos(\theta)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identity: [` \sin^2(\theta)+\cos^2(\theta) = 1 `] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof60.pg b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof60.pg new file mode 100644 index 0000000000..ffb05262ac --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof60.pg @@ -0,0 +1,180 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{1}{\csc(\theta)-\sin(\theta)}"; +$right = "\displaystyle \tan(\theta)\sec(\theta)"; + +@steps = ( + "\displaystyle \frac{1}{\frac{1}{\sin(\theta)}-\sin(\theta)}", + "\displaystyle \frac{1\cdot\sin(\theta)}{\left(\frac{1}{\sin(\theta)}-\sin(\theta)\right)\cdot\sin(\theta)}", + "\displaystyle \frac{\sin(\theta)}{1-\sin^2(\theta)}", + "\displaystyle \frac{\sin(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{\sin(\theta)}{\cos(\theta)}\cdot\frac{1}{\cos(\theta)}", + "\displaystyle \frac{1}{\frac{1-\sin(\theta)}{\sin(\theta)}}", + "\displaystyle \frac{1\cdot\sin(\theta)}{\frac{1-\sin(\theta)}{\sin(\theta)}\cdot\sin(\theta)}", + "\displaystyle \frac{\sin(\theta)}{\cos(\theta)}\cdot\frac{1}{\sin(\theta)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[4]}'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \begin{aligned} + \sin^2(\theta)+\cos^2(\theta) &= 1 \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$steps[4]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof70.pg b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof70.pg new file mode 100644 index 0000000000..a3f3f15de5 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof70.pg @@ -0,0 +1,180 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\sec(\theta)+\csc(\theta)}{1+\tan(\theta)}"; +$right = "\displaystyle \csc(\theta)"; + +@steps = ( + "\displaystyle \frac{\frac{1}{\cos(\theta)}+\frac{1}{\sin(\theta)}}{1+\frac{\sin(\theta)}{\cos(\theta)}}", + "\displaystyle \frac{\left(\frac{1}{\cos(\theta)}+\frac{1}{\sin(\theta)}\right)\cdot\sin(\theta)\cos(\theta)}{\left(1+\frac{\sin(\theta)}{\cos(\theta)}\right)\cdot\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{\sin(\theta)+\cos(\theta)}{\sin(\theta)\cos(\theta)+\sin^2(\theta)}", + "\displaystyle \frac{\sin(\theta)+\cos(\theta)}{\sin(\theta)(\cos(\theta)+\sin(\theta))}", + "\displaystyle \frac{1}{\sin(\theta)}", + "\displaystyle \frac{\cos(\theta)+\sin(\theta)}{\frac{1+\sin(\theta)}{\cos(\theta)}}", + "\displaystyle \frac{\sin(\theta)+\cos(\theta)}{\sin(\theta)\cos(\theta)+\cos^2(\theta)}", + "\displaystyle \frac{\sin(\theta)+\cos(\theta)}{\cos(\theta)(\cos(\theta)+\sin(\theta))}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[4]}'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \begin{aligned} + \csc(\theta) &= \frac{1}{\sin(\theta)} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$steps[4]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof80.pg b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof80.pg new file mode 100644 index 0000000000..79ad90cfd3 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof80.pg @@ -0,0 +1,183 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \tan(\theta)+\cot(\theta)"; +$right = "\displaystyle \sec(\theta)\csc(\theta)"; + +@steps = ( + "\displaystyle \frac{\sin(\theta)}{\cos(\theta)} + \frac{\cos(\theta)}{\sin(\theta)}", + "\displaystyle \frac{\sin(\theta)\cdot\sin(\theta)}{\cos(\theta)\cdot\sin(\theta)} + \frac{\cos(\theta)\cdot\cos(\theta)}{\sin(\theta)\cdot\cos(\theta)}", + "\displaystyle \frac{\sin^2(\theta)}{\sin(\theta)\cos(\theta)} + \frac{\cos^2(\theta)}{\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{\sin^2(\theta)+\cos^2(\theta)}{\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{1}{\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{1}{\sin(\theta)}\cdot\frac{1}{\cos(\theta)}", + "\displaystyle \frac{\sin(\theta)+\cos(\theta)}{\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{\sin^2(\theta)\cos^2(\theta)}{\sin(\theta)\cos(\theta)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[4]}'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[5]}'),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \begin{aligned} + \csc(\theta) &= \frac{1}{\sin(\theta)} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} \\ + \sin^2(\theta)+\cos^2(\theta) &= 1 + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$steps[4]] \\ + &= [$steps[5]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof90.pg b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof90.pg new file mode 100644 index 0000000000..2fae4dc128 --- /dev/null +++ b/Contrib/PCC/Trigonometry/TrigIdentity/TrigIdentityProof90.pg @@ -0,0 +1,182 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\sin^2(\theta)-\tan(\theta)}{\cos^2(\theta)-\cot(\theta)}"; +$right = "\displaystyle \tan^2(\theta)"; + +@steps = ( + "\displaystyle \frac{\sin^2(\theta)-\frac{\sin(\theta)}{\cos(\theta)}}{\cos^2(\theta)-\frac{\cos(\theta)}{\sin(\theta)}}", + "\displaystyle \frac{\left(\sin^2(\theta)-\frac{\sin(\theta)}{\cos(\theta)}\right)\cdot\sin(\theta)\cos(\theta)}{\left(\cos^2(\theta)-\frac{\cos(\theta)}{\sin(\theta)}\right)\cdot\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{\sin^3(\theta)\cos(\theta)-\sin^2(\theta)}{\sin(\theta)\cos^3(\theta)-\cos^2(\theta)}", + "\displaystyle \frac{\sin^2(\theta)(\sin(\theta)\cos(\theta)-1)}{\cos^2(\theta)(\sin(\theta)\cos(\theta)-1)}", + "\displaystyle \frac{\sin^2(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{\frac{\sin^2(\theta)-\sin(\theta)}{\cos(\theta)}}{\frac{\cos^2(\theta)-\cos(\theta)}{\sin(\theta)}}", + "\displaystyle \frac{\left(\sin^2(\theta)-\frac{\sin(\theta)}{\cos(\theta)}\right)\cdot\cos(\theta)}{\left(\cos^2(\theta)-\frac{\cos(\theta)}{\sin(\theta)}\right)\cdot\sin(\theta)}", + "\displaystyle \frac{\sin(\theta)(\sin(\theta)\cos(\theta)-1)}{\cos(\theta)(\sin(\theta)\cos(\theta)-1)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[4]}'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \begin{aligned} + \csc(\theta) &= \frac{1}{\sin(\theta)} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} \\ + \sin^2(\theta)+\cos^2(\theta) &= 1 + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$steps[4]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues10.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues10.pg new file mode 100644 index 0000000000..29ac13ce97 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues10.pg @@ -0,0 +1,184 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$multiple = random(2,5,1); +$base = $multiple*$triples[$in][0]; +$height = $multiple*$triples[$in][1]; +$hypotenuse = $multiple*$triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If an angle [`\theta`] corresponds to the end point [`P([$base],[$height])`] on a non-unit circle, find the following values: + +[@DataTable( + [ + [ + [PF('[`P([$base],[$height])`]'), + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Graph [`P([$base],[$height])`] on the non-unit circle, we have: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues100.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues100.pg new file mode 100644 index 0000000000..075bcef6f9 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues100.pg @@ -0,0 +1,205 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$base = $triples[$in][0]; +$height = $triples[$in][1]; +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +$qOld = random(0,3,1); +if ($qOld==0) { + $baseP = $base; + $heightP = $height; +} elsif ($qOld==1) { + $baseP = -$base; + $heightP = $height; +} elsif ($qOld==2) { + $baseP = -$base; + $heightP = -$height; +} else { + $baseP = $base; + $heightP = -$height; +} +$old = Fraction($baseP,$hypotenuse); + +$change = random(1,3,1)*random(-1,1,2); +$qNew = ($qOld+$change)%4; + +if (abs($qNew-$qOld)%2==0) { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $base : -$base; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $height : -$height; +} else { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $height : -$height; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $base : -$base; +} +$ans = Fraction($baseQ,$hypotenuse); + +@Q = ('I','II','III','IV'); + +%show = ( + -3 => "-\frac{3\pi}{2}", + -2 => "-\pi", + -1 => "-\frac{\pi}{2}", + 1 => "+\frac{\pi}{2}", + 2 => "+\pi", + 3 => "+\frac{3\pi}{2}", +); + +%showA = ( + -3 => "-3pi/2", + -2 => "-pi", + -1 => "-pi/2", + 1 => "+pi/2", + 2 => "+pi", + 3 => "+3pi/2", +); + +$r = 5; +$Px = Fraction($r*$baseP,$hypotenuse)->reduce; +$Py = Fraction($r*$heightP,$hypotenuse)->reduce; +$Qx = Fraction($r*$baseQ,$hypotenuse)->reduce; +$Qy = Fraction($r*$heightQ,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$graph[0]->stamps(closed_circle( Real($Qx), Real($Qy), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Qx),Real($Qy),red,2); +$graph[0]->lineTo(Real($Qx),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Qx),$yShift); +$graph[0]->lineTo(Real($Qx)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Qx)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "bottom" : "top"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$heightP",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$baseP",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"theta",'red',$LORHeight,$TOBHyp,large)); + +$LORHeight = ($Qx>0) ? "right" : "left"; +$TOBBase = ($Qy>0) ? "bottom" : "top"; +$LORHyp = ($Qx>0) ? "right" : "left"; +$TOBHyp = ($Qy>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Qx),Real($Qy)/2,"$heightQ",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Qx)/2,0,"$baseQ",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Qx)/2,Real($Qy)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Qx),Real($Qy),"theta$showA{$change}",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point ($baseP,$heightP) on the circle. This point is marked as theta. A right triangle is formed at vertices (0,0), ($baseP,$heightP) and ($baseP,0). The base is marked as $baseP, height marked as $heightP and hypotenuse marked as $hypotenuse. Point ($baseQ,$heightQ) is also on the circle. This point is marked as theta$showA{$change} A right triangle is formed at vertices (0,0), ($baseQ,$heightQ) and ($baseQ,0). The base is marked as $baseQ, height marked as $heightQ and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\cos(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], evaluate + + [``\cos\left(\theta[$show{$change}]\right)=``][_________]{$ans} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\cos(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], we can sketch theta on a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The base is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$height]`]. + +Next, we can sketch the location of [`\left(\theta[$show{$change}]\right)`] on the same Unit Circle, and the corresponding right triangle. We can see: + + [``\cos\left(\theta[$show{$change}]\right)=[$ans]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues110.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues110.pg new file mode 100644 index 0000000000..cec68e0a93 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues110.pg @@ -0,0 +1,205 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$base = $triples[$in][0]; +$height = $triples[$in][1]; +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +$qOld = random(0,3,1); +if ($qOld==0) { + $baseP = $base; + $heightP = $height; +} elsif ($qOld==1) { + $baseP = -$base; + $heightP = $height; +} elsif ($qOld==2) { + $baseP = -$base; + $heightP = -$height; +} else { + $baseP = $base; + $heightP = -$height; +} +$old = Fraction($heightP,$baseP); + +$change = random(1,3,1)*random(-1,1,2); +$qNew = ($qOld+$change)%4; + +if (abs($qNew-$qOld)%2==0) { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $base : -$base; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $height : -$height; +} else { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $height : -$height; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $base : -$base; +} +$ans = Fraction($heightQ,$baseQ); + +@Q = ('I','II','III','IV'); + +%show = ( + -3 => "-\frac{3\pi}{2}", + -2 => "-\pi", + -1 => "-\frac{\pi}{2}", + 1 => "+\frac{\pi}{2}", + 2 => "+\pi", + 3 => "+\frac{3\pi}{2}", +); + +%showA = ( + -3 => "-3pi/2", + -2 => "-pi", + -1 => "-pi/2", + 1 => "+pi/2", + 2 => "+pi", + 3 => "+3pi/2", +); + +$r = 5; +$Px = Fraction($r*$baseP,$hypotenuse)->reduce; +$Py = Fraction($r*$heightP,$hypotenuse)->reduce; +$Qx = Fraction($r*$baseQ,$hypotenuse)->reduce; +$Qy = Fraction($r*$heightQ,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$graph[0]->stamps(closed_circle( Real($Qx), Real($Qy), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Qx),Real($Qy),red,2); +$graph[0]->lineTo(Real($Qx),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Qx),$yShift); +$graph[0]->lineTo(Real($Qx)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Qx)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "bottom" : "top"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$heightP",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$baseP",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"theta",'red',$LORHeight,$TOBHyp,large)); + +$LORHeight = ($Qx>0) ? "right" : "left"; +$TOBBase = ($Qy>0) ? "bottom" : "top"; +$LORHyp = ($Qx>0) ? "right" : "left"; +$TOBHyp = ($Qy>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Qx),Real($Qy)/2,"$heightQ",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Qx)/2,0,"$baseQ",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Qx)/2,Real($Qy)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Qx),Real($Qy),"theta$showA{$change}",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point ($baseP,$heightP) on the circle. This point is marked as theta. A right triangle is formed at vertices (0,0), ($baseP,$heightP) and ($baseP,0). The base is marked as $baseP, height marked as $heightP and hypotenuse marked as $hypotenuse. Point ($baseQ,$heightQ) is also on the circle. This point is marked as theta$showA{$change} A right triangle is formed at vertices (0,0), ($baseQ,$heightQ) and ($baseQ,0). The base is marked as $baseQ, height marked as $heightQ and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\tan(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], evaluate + + [``\tan\left(\theta[$show{$change}]\right)=``][_________]{$ans} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\tan(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], we can sketch theta on a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The base is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$height]`]. + +Next, we can sketch the location of [`\left(\theta[$show{$change}]\right)`] on the same Unit Circle, and the corresponding right triangle. We can see: + + [``\tan\left(\theta[$show{$change}]\right)=[$ans]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues20.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues20.pg new file mode 100644 index 0000000000..1c7bd026b3 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues20.pg @@ -0,0 +1,187 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$multiple = random(2,5,1); +do { + if (random(0,1,1)==0) { + $base = $multiple*$triples[$in][0]*random(-1,1,2); + $height = $multiple*$triples[$in][1]*random(-1,1,2); + } else { + $base = $multiple*$triples[$in][1]*random(-1,1,2); + $height = $multiple*$triples[$in][0]*random(-1,1,2); + } +} until !($base>0 && $height>0); +$hypotenuse = $multiple*$triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If an angle [`\theta`] corresponds to the end point [`P([$base],[$height])`] on a non-unit circle, find the following values: + +[@DataTable( + [ + [ + [PF('[`P([$base],[$height])`]'), + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Graph [`P([$base],[$height])`] on the non-unit circle, we have: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues21.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues21.pg new file mode 100644 index 0000000000..ae8f44c00b --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues21.pg @@ -0,0 +1,276 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + $baseOut = random(1,5,1)*random(-1,1,2); + $baseIn = list_random(1,2,3,5); + $heightOut = random(1,5,1)*random(-1,1,2); + $heightIn = list_random(1,2,3,5); + ($hypotenuseOut,$hypotenuseIn) = &radSimplify($baseOut**2*$baseIn+$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && (($baseOut==1) || ($heightOut==1)) && ($hypotenuseIn<30) && !($baseOut>0 && $heightOut>0); + + if ($baseIn==1) { + $base = $baseOut; + } elsif (abs($baseOut)==1) { + $base = ($baseOut>0) ? Formula("sqrt($baseIn)") : Formula("-sqrt($baseIn)"); + } else { + $base = Formula("$baseOut*sqrt($baseIn)"); + } + + if ($heightIn==1) { + $height = $heightOut; + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + } + + if ($hypotenuseIn==1) { + $hypotenuse = $hypotenuseOut; + } elsif ($hypotenuseOut==1) { + $hypotenuse = Formula("sqrt($hypotenuseIn)"); + } else { + $hypotenuse = Formula("$hypotenuseOut*sqrt($hypotenuseIn)"); + } + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +If an angle [`\theta`] corresponds to the end point [`P([$base],[$height])`] on a non-unit circle, find the following values. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`P([$base],[$height])`]'), + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Graph [`P([$base],[$height])`] on the non-unit circle, we have: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues30.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues30.pg new file mode 100644 index 0000000000..8a43816851 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues30.pg @@ -0,0 +1,185 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 1; +{ + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "I"; +} +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=[$ans[0]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$base]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues40.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues40.pg new file mode 100644 index 0000000000..c4ae95e474 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues40.pg @@ -0,0 +1,196 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=[$ans[0]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +$absBase = abs($base); + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$absBase]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues41.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues41.pg new file mode 100644 index 0000000000..28d10e0ead --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues41.pg @@ -0,0 +1,281 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $heightOut = random(1,5,1)*random(-1,1,2); + $heightIn = list_random(1,2,3,5); + $hypotenuseOut = random(int(abs($heightOut)*$heightIn**2)+2,int(abs($heightOut)*$heightIn**2)+10,1); + } until (gcd($heightOut,$hypotenuseOut)==1); + $hypotenuseIn = 1; + ($baseOut,$baseIn) = &radSimplify($hypotenuseOut**2-$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && !(($baseOut>0) && ($heightOut>0)) && ($baseIn<=30); + + $baseOut = $baseOut*random(-1,1,2); + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + if ($baseIn==1) { + $base = $baseOut; + $absBase = abs($baseOut); + } elsif (abs($baseOut)==1) { + $base = ($baseOut>0) ? Formula("sqrt($baseIn)") : Formula("-sqrt($baseIn)"); + $absBase = Formula("sqrt($baseIn)"); + } else { + $base = Formula("$baseOut*sqrt($baseIn)"); + $absBaseOut = abs($baseOut); + $absBase = Formula("$absBaseOut*sqrt($baseIn)"); + } + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + $hypotenuse = $hypotenuseOut; + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`], find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=[$ans[0]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$absBase]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues50.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues50.pg new file mode 100644 index 0000000000..24a52708dc --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues50.pg @@ -0,0 +1,185 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 1; +{ + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "I"; +} +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=[$ans[1]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The height is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$height]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues60.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues60.pg new file mode 100644 index 0000000000..b8ed1acf55 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues60.pg @@ -0,0 +1,196 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=[$ans[1]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +$absHeight = abs($height); + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The height is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$absHeight]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues61.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues61.pg new file mode 100644 index 0000000000..638ed829c5 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues61.pg @@ -0,0 +1,281 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $baseOut = random(1,5,1)*random(-1,1,2); + $baseIn = list_random(1,2,3,5); + $hypotenuseOut = random(int(abs($baseOut)*$baseIn**2)+2,int(abs($baseOut)*$baseIn**2)+10,1); + } until (gcd($baseOut,$hypotenuseOut)==1); + $hypotenuseIn = 1; + ($heightOut,$heightIn) = &radSimplify($hypotenuseOut**2-$baseOut**2*$baseIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && !(($baseOut>0) && ($heightOut>0)) && ($heightIn<30); + + $heightOut = $heightOut*random(-1,1,2); + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + if ($baseIn==1) { + $base = $baseOut; + $absBase = abs($baseOut); + } elsif (abs($baseOut)==1) { + $base = ($baseOut>0) ? Formula("sqrt($baseIn)") : Formula("-sqrt($baseIn)"); + $absBase = Formula("sqrt($baseIn)"); + } else { + $base = Formula("$baseOut*sqrt($baseIn)"); + $absBaseOut = abs($baseOut); + $absBase = Formula("$absBaseOut*sqrt($baseIn)"); + } + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + $hypotenuse = $hypotenuseOut; + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`], find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=[$ans[1]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$absHeight]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues70.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues70.pg new file mode 100644 index 0000000000..96da0f84c4 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues70.pg @@ -0,0 +1,185 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 1; +{ + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "I"; +} +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=[$ans[2]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$height]`] and its hypotenuse [`[$base]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The height is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues80.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues80.pg new file mode 100644 index 0000000000..0d24bab179 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues80.pg @@ -0,0 +1,194 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=[$ans[2]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its base [`[$base]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues81.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues81.pg new file mode 100644 index 0000000000..8f02d1828b --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues81.pg @@ -0,0 +1,279 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $baseOut = random(1,5,1)*random(-1,1,2); + $heightIn = list_random(1,2,3,5); + $heightOut = random(1,5,1)*random(-1,1,2); + } until (gcd(abs($heightOut),abs($baseOut))==1); + $baseIn = 1; + ($hypotenuseOut,$hypotenuseIn) = &radSimplify($baseOut**2*$baseIn+$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && !(($baseOut>0) && ($heightOut>0)) && ($hypotenuseIn<30); + + $heightOut = $heightOut*random(-1,1,2); + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + + $base = $baseOut; + $absBase = abs($baseOut); + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + if ($hypotenuseIn==1) { + $hypotenuse = $hypotenuseOut; + } elsif (abs($hypotenuseOut)==1) { + $hypotenuse = Formula("sqrt($hypotenuseIn)"); + } else { + $hypotenuse = Formula("$hypotenuseOut*sqrt($hypotenuseIn)"); + } + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`], find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=[$ans[2]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its height [`[$height]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues90.pg b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues90.pg new file mode 100644 index 0000000000..c86d4d9428 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/NonUnitCircleValues90.pg @@ -0,0 +1,205 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$base = $triples[$in][0]; +$height = $triples[$in][1]; +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +$qOld = random(0,3,1); +if ($qOld==0) { + $baseP = $base; + $heightP = $height; +} elsif ($qOld==1) { + $baseP = -$base; + $heightP = $height; +} elsif ($qOld==2) { + $baseP = -$base; + $heightP = -$height; +} else { + $baseP = $base; + $heightP = -$height; +} +$old = Fraction($heightP,$hypotenuse); + +$change = random(1,3,1)*random(-1,1,2); +$qNew = ($qOld+$change)%4; + +if (abs($qNew-$qOld)%2==0) { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $base : -$base; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $height : -$height; +} else { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $height : -$height; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $base : -$base; +} +$ans = Fraction($heightQ,$hypotenuse); + +@Q = ('I','II','III','IV'); + +%show = ( + -3 => "-\frac{3\pi}{2}", + -2 => "-\pi", + -1 => "-\frac{\pi}{2}", + 1 => "+\frac{\pi}{2}", + 2 => "+\pi", + 3 => "+\frac{3\pi}{2}", +); + +%showA = ( + -3 => "-3pi/2", + -2 => "-pi", + -1 => "-pi/2", + 1 => "+pi/2", + 2 => "+pi", + 3 => "+3pi/2", +); + +$r = 5; +$Px = Fraction($r*$baseP,$hypotenuse)->reduce; +$Py = Fraction($r*$heightP,$hypotenuse)->reduce; +$Qx = Fraction($r*$baseQ,$hypotenuse)->reduce; +$Qy = Fraction($r*$heightQ,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$graph[0]->stamps(closed_circle( Real($Qx), Real($Qy), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Qx),Real($Qy),red,2); +$graph[0]->lineTo(Real($Qx),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Qx),$yShift); +$graph[0]->lineTo(Real($Qx)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Qx)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "bottom" : "top"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$heightP",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$baseP",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"theta",'red',$LORHeight,$TOBHyp,large)); + +$LORHeight = ($Qx>0) ? "right" : "left"; +$TOBBase = ($Qy>0) ? "bottom" : "top"; +$LORHyp = ($Qx>0) ? "right" : "left"; +$TOBHyp = ($Qy>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Qx),Real($Qy)/2,"$heightQ",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Qx)/2,0,"$baseQ",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Qx)/2,Real($Qy)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Qx),Real($Qy),"theta$showA{$change}",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point ($baseP,$heightP) on the circle. This point is marked as theta. A right triangle is formed at vertices (0,0), ($baseP,$heightP) and ($baseP,0). The base is marked as $baseP, height marked as $heightP and hypotenuse marked as $hypotenuse. Point ($baseQ,$heightQ) is also on the circle. This point is marked as theta$showA{$change} A right triangle is formed at vertices (0,0), ($baseQ,$heightQ) and ($baseQ,0). The base is marked as $baseQ, height marked as $heightQ and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\sin(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], evaluate + + [``\sin\left(\theta[$show{$change}]\right)=``][_________]{$ans} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\sin(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], we can sketch theta on a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$base]`]. + +Next, we can sketch the location of [`\left(\theta[$show{$change}]\right)`] on the same Unit Circle, and the corresponding right triangle. We can see: + + [``\sin\left(\theta[$show{$change}]\right)=[$ans]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/OddEven10.pg b/Contrib/PCC/Trigonometry/UnitCircle/OddEven10.pg new file mode 100644 index 0000000000..bae04373dc --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/OddEven10.pg @@ -0,0 +1,180 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +#sin, cos, tan, csc, sec, cot +@values = (); + +@num = (); +@den = (); + +for my $i (0..5) { + if ( ($i==0) || ($i==1) ) { + do { + $den[$i] = random(2,10,1); + $num[$i] = random(1,$den[$i]-1,1); + } until (gcd($den[$i],$num[$i])==1); + $values[$i] = Fraction($num[$i],$den[$i])->reduce; + } elsif ( ($i==2) || ($i==5) ) { + $den[$i] = random(2,10,1); + $num[$i] = random(2,10,1); + $values[$i] = Fraction($num[$i],$den[$i])->reduce; + } else { + do { + $den[$i] = random(2,10,1); + $num[$i] = random(1,$den[$i]-1,1); + } until (gcd($den[$i],$num[$i])==1); + $values[$i] = Fraction($den[$i],$num[$i])->reduce; + } +} + +@ans = ( ); +for my $i (0..5) { + $values[$i] = random(-1,1,2)*$values[$i]; + if ( ($i==0) || ($i==2) || ($i==3) || ($i==5) ) { + $ans[$i] = -$values[$i]; + } else { + $ans[$i] = $values[$i]; + } +} + + +$showPartialCorrectAnswers = 1; + +$r = 5; + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$A_pt = closed_circle( $r/sqrt(2), $r/sqrt(2), red ); +$B_pt = closed_circle( $r/sqrt(2), -$r/sqrt(2), red ); +$graph -> stamps($A_pt, $B_pt); + +$graph->lb(new Label(0.4,0,"H",'red','left','bottom',large)); +$graph->lb(new Label(0.4,0,"-H",'red','left','top',large)); +$graph->lb(new Label($r/sqrt(2), $r/sqrt(2),"P(a,b)",'red','left','bottom',large)); +$graph->lb(new Label($r/sqrt(2), -$r/sqrt(2),"Q(a,-b)",'red','left','top',large)); + +$graph->moveTo(0,0); +$graph->lineTo($r/sqrt(2), $r/sqrt(2), red, 2); +$graph->lineTo($r/sqrt(2), -$r/sqrt(2), red, 2); +$graph->lineTo(0, 0, red, 2); +$graph->lineTo($r/sqrt(2), 0, red, 2); + +$graph->lb(new Label($r/(2*sqrt(2)), 0,"a",'red','center','top',large)); +$graph->lb(new Label($r/sqrt(2), $r/(2*sqrt(2)),"b",'red','left','middle',large)); +$graph->lb(new Label($r/sqrt(2), -$r/(2*sqrt(2)),"-b",'red','left','middle',large)); +$graph->lb(new Label($r/(2*sqrt(2)), $r/(2*sqrt(2)),"c",'red','right','bottom',large)); +$graph->lb(new Label($r/(2*sqrt(2)), -$r/(2*sqrt(2)),"c",'red','right','top',large)); + +$graph->moveTo($r/sqrt(2), 0.4); +$graph->lineTo($r/sqrt(2)-0.4, 0.4, red, 2); +$graph->lineTo($r/sqrt(2)-0.4, 0, red, 2); +$graph->moveTo($r/sqrt(2), -0.3); +$graph->lineTo($r/sqrt(2)-0.3, -0.3, red, 2); +$graph->lineTo($r/sqrt(2)-0.3, 0, red, 2); + +$alt = "This is the graph of a unit circle. On the circle, Point P is in the first quadrant at (a, b), and Point Q is in the fourth quadrant at (a, -b). Point P and Q are connected, forming two right triangles with the unit circle center. In the triangle in Quadrant I, the central angle is marked as H. The side opposite to H is marked as b, the side adjacent to H is marked as a, and the hypotenuse is marked as c. In the triangle in Quadrant IV, the central angle is marked as -H. The side opposite to -H is marked as -b, the side adjacent to -H is marked as a, and the hypotenuse is marked as c."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +############################################## + +BEGIN_PGML + +If [`\sin(A)=[$values[0]]`], then [`\sin(-A)=`][_____________]{$ans[0]}. + +If [`\cos(B)=[$values[1]]`], then [`\cos(-B)=`][_____________]{$ans[1]}. + +If [`\tan(C)=[$values[2]]`], then [`\tan(-C)=`][_____________]{$ans[2]}. + +If [`\csc(D)=[$values[3]]`], then [`\csc(-D)=`][_____________]{$ans[3]}. + +If [`\sec(E)=[$values[4]]`], then [`\sec(-E)=`][_____________]{$ans[4]}. + +If [`\cot(F)=[$values[5]]`], then [`\cot(-F)=`][_____________]{$ans[5]}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Look at [`\angle H`] and [`\angle -H`] in the Unit Circle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +###Sine function and cosecant function + +Note that [`\sin(H)=\frac{b}{c}`] and [`\sin(-H)=\frac{-b}{c}`]. Since [`\sin(-H)=-\sin(H)`], [`y=\sin(x)`] is an odd function. + +As a result, if [`\sin(A)=[$values[0]]`], then [`\sin(-A)=`][`[$ans[0]]`]. + +Since [`\csc(x)=\frac{1}{\sin(x)}`], [`y=\csc(x)`] is also an odd function. + +If [`\csc(D)=[$values[3]]`], then [`\csc(-D)=`][`[$ans[3]]`]. + +###Cosine function and secant function + +Note that [`\cos(H)=\frac{a}{c}`] and [`\cos(-H)=\frac{a}{c}`]. Since [`\cos(-H)=\cos(H)`], [`y=\cos(x)`] is an even function. + +As a result, if [`\cos(B)=[$values[1]]`], then [`\cos(-B)=`][`[$ans[1]]`]. + +Since [`\sec(x)=\frac{1}{\cos(x)}`], [`y=\sec(x)`] is also an even function. + +If [`\sec(E)=[$values[4]]`], then [`\sec(-E)=`][`[$ans[4]]`]. + +###Tangent function and cotangent function + +Note that [`\tan(H)=\frac{b}{a}`] and [`\tan(-H)=\frac{-b}{a}`]. Since [`\tan(-H)=-\tan(H)`], [`y=\tan(x)`] is an odd function. + +As a result, if [`\tan(C)=[$values[2]]`], then [`\tan(-C)=`][`[$ans[2]]`]. + +Since [`\cot(x)=\frac{1}{\tan(x)}`], [`y=\cot(x)`] is also an odd function. + +If [`\cot(F)=[$values[5]]`], then [`\cot(-F)=`][`[$ans[5]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle10.pg b/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle10.pg new file mode 100644 index 0000000000..f645606879 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle10.pg @@ -0,0 +1,171 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); + +@num = (); +do { + $den = random(3,10,1); + $num[0] = random(1, int($den/2), 1); +} until (gcd($den,$num[0])==1); +$num[1] = $den-$num[0]; +$num[2] = $den+$num[0]; +$num[3] = 2*$den-$num[0]; + +@angles = (); +for my $i (0..3) { + $angles[$i] = specialAngle($num[$i]*pi/$den, (3..10)); +} + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]*pi/$den); + $Ay[$i] = $r*sin($num[$i]*pi/$den); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $textA = $num[$i]==1 ? "A: pi/$den" : "A: $num[$i] pi/$den"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],$textA,'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point $textA is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +$id = random(1,3,1); + +############################################## + +BEGIN_PGML + +Find the angle's reference angle. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Enter [|pi|]* to represent [`\pi`].' +)@]** + +Reference angle of [`[$angles[[$id]]]`] is [____________]{$angles[0]}. + +END_PGML + +############################################## + +if ($id==1) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA"; + $s4 = "\pi - ".$angles[1]->TeX; +} elsif ($id==2) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}"; + $s4 = $angles[2]->TeX." - \pi"; +} else { + $s1 = "AOE"; + $s2 = "\text{measure of arc } AE"; + $s3 = "\text{measure of major arc }EFE \text{ (whole circle)} - \text{measure of major arc }EFA"; + $s4 = "2\pi-".$angles[3]->TeX; +} + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle with Point A corresponding to [`[$angles[[$id]]]`] radians: + +>>[@ $fig[[$id]] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The reference angle of [`[$angle[[$id]]]`] radians is the measure of [`\angle [$s1]`]. + + [``\begin{aligned} + m\angle [$s1] &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$angles[0]] + \end{aligned}``] + +Reference angle of [`[$angles[[$id]]]`] is [`[$angles[0]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle20.pg b/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle20.pg new file mode 100644 index 0000000000..c3f95f9f13 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle20.pg @@ -0,0 +1,183 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@num = (); +do { + $den = random(3,10,1); + $num[0] = random(1, int($den/2), 1); +} until (gcd($den,$num[0])==1); +$num[1] = $den-$num[0]; +$num[2] = $den+$num[0]; +$num[3] = 2*$den-$num[0]; + +@angles = (); +for my $i (0..3) { + $angles[$i] = specialAngle($num[$i]*pi/$den, (3..10)); +} + +$id = random(1,3,1); +$off = random(2,5,1)*random(-1,1,2); +$angleShow = specialAngle($num[$i]*pi/$den+$off*2*pi, (3..10)); + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]*pi/$den); + $Ay[$i] = $r*sin($num[$i]*pi/$den); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $textA = $num[$i]==1 ? "A: pi/$den" : "A: $num[$i] pi/$den"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],$textA,'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point $textA is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + +############################################## + +BEGIN_PGML + +Find the angle's reference angle. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Enter [|pi|]* to represent [`\pi`].' +)@]** + +Reference angle of [`[$angleShow]`] is [____________]{$angles[0]}. + +END_PGML + +############################################## + +if ($id==1) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA"; + $s4 = "\pi - ".$angles[1]->TeX; +} elsif ($id==2) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}"; + $s4 = $angles[2]->TeX." - \pi"; +} else { + $s1 = "AOE"; + $s2 = "\text{measure of arc } AE"; + $s3 = "\text{measure of major arc }EFE \text{ (whole circle)} - \text{measure of major arc }EFA"; + $s4 = "2\pi-".$angles[3]->TeX; +} + +BEGIN_PGML_SOLUTION + +First, let's convert [`[$angleShow]`] to an angle in the range of [`[0,2\pi)`]: + + [``[$angleShow]-[$off]\cdot2\pi = [$angles[[$id]]]``] + +Since [`[$angleShow]`] and [`[$angles[[$id]]]`] are located on the same spot on the Unit Circle, we can simply find the reference angle of [`[$angles[[$id]]]`]. + +Here is a Unit Circle with Point A corresponding to [`[$angles[[$id]]]`] radians: + +>>[@ $fig[[$id]] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The reference angle of [`[$angle[[$id]]]`] radians is the measure of [`\angle [$s1]`]. + + [``\begin{aligned} + m\angle [$s1] &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$angles[0]] + \end{aligned}``] + +Reference angle of [`[$angleShow]`] is [`[$angles[0]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle30.pg b/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle30.pg new file mode 100644 index 0000000000..b674066aa2 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle30.pg @@ -0,0 +1,172 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); + +@num = (); +do { + $den = list_random(3,4,5,6,9,10); + $num[0] = random(1, int($den/2), 1); +} until (gcd($den,$num[0])==1); +$num[1] = $den-$num[0]; +$num[2] = $den+$num[0]; +$num[3] = 2*$den-$num[0]; + +@angles = (); +@anglesD = (); +for my $i (0..3) { + $angles[$i] = specialAngle($num[$i]*pi/$den, (3..10)); + $anglesD[$i] = $num[$i]*180/$den; +} + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]*pi/$den); + $Ay[$i] = $r*sin($num[$i]*pi/$den); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $anglesD[$i] degrees",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $anglesD[$i] degree is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +$id = random(1,3,1); + +############################################## + +BEGIN_PGML + +Find the angle's reference angle. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Enter [|pi|]* to represent [`\pi`].' +)@]** + +Reference angle of [`[$anglesD[[$id]]]^{\circ}`] is [____________]{$anglesD[0]} [`^{\circ}`]. + +END_PGML + +############################################## + +if ($id==1) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA"; + $s4 = "180^{\circ} - $anglesD[1]^{\circ}"; +} elsif ($id==2) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}"; + $s4 = "$anglesD[2]^{\circ} - 180^{\circ}"; +} else { + $s1 = "AOE"; + $s2 = "\text{measure of arc } AE"; + $s3 = "\text{measure of major arc }EFE \text{ (whole circle)} - \text{measure of major arc }EFA"; + $s4 = "360^{\circ}-$anglesD[3]^{\circ}"; +} + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle with Point A corresponding to [`[$anglesD[[$id]]]^{\circ}`]: + +>>[@ $fig[[$id]] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The reference angle of [`[$angleD[[$id]]]^{\circ}`] is the measure of [`\angle [$s1]`]. + + [``\begin{aligned} + m\angle [$s1] &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$anglesD[0]]^{\circ} + \end{aligned}``] + +Reference angle of [`[$anglesD[[$id]]]^{\circ}`] is [`[$anglesD[0]]^{\circ}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle40.pg b/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle40.pg new file mode 100644 index 0000000000..66bad52dc4 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle40.pg @@ -0,0 +1,180 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); + +@num = (); +do { + $den = list_random(3,4,5,6,9,10); + $num[0] = random(1, int($den/2), 1); +} until (gcd($den,$num[0])==1); +$num[1] = $den-$num[0]; +$num[2] = $den+$num[0]; +$num[3] = 2*$den-$num[0]; + +@angles = (); +@anglesD = (); +for my $i (0..3) { + $angles[$i] = specialAngle($num[$i]*pi/$den, (3..10)); + $anglesD[$i] = $num[$i]*180/$den; +} + +$id = random(1,3,1); +$off = random(2,5,1)*random(-1,1,2); +$angleShow = $anglesD[$id]+$off*360; + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]*pi/$den); + $Ay[$i] = $r*sin($num[$i]*pi/$den); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $anglesD[$i] degrees",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $anglesD[$i] degree is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +############################################## + +BEGIN_PGML + +Find the angle's reference angle. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Enter [|pi|]* to represent [`\pi`].' +)@]** + +Reference angle of [`[$angleShow]^{\circ}`] is [____________]{$anglesD[0]} [`^{\circ}`]. + +END_PGML + +############################################## + +if ($id==1) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA"; + $s4 = "180^{\circ} - $anglesD[1]^{\circ}"; +} elsif ($id==2) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}"; + $s4 = "$anglesD[2]^{\circ} - 180^{\circ}"; +} else { + $s1 = "AOE"; + $s2 = "\text{measure of arc } AE"; + $s3 = "\text{measure of major arc }EFE \text{ (whole circle)} - \text{measure of major arc }EFA"; + $s4 = "360^{\circ}-$anglesD[3]^{\circ}"; +} + +BEGIN_PGML_SOLUTION + +First, let's convert [`[$angleShow]`] to an angle in the range of [`[0^{\circ},360^{\circ})`]: + + [``[$angleShow]-[$off]\cdot360^{\circ} = [$anglesD[[$id]]]^{\circ}``] + +Since [`[$angleShow]`] and [`[$anglesD[[$id]]]`] are located on the same spot on the Unit Circle, we can simply find the reference angle of [`[$anglesD[[$id]]]^{\circ}`]. + +Here is a Unit Circle with Point A corresponding to [`[$anglesD[[$id]]]^{\circ}`]: + +>>[@ $fig[[$id]] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The reference angle of [`[$angleD[[$id]]]^{\circ}`] is the measure of [`\angle [$s1]`]. + + [``\begin{aligned} + m\angle [$s1] &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$anglesD[0]]^{\circ} + \end{aligned}``] + +Reference angle of [`[$anglesD[[$id]]]^{\circ}`] is [`[$anglesD[0]]^{\circ}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle50.pg b/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle50.pg new file mode 100644 index 0000000000..eaeeba8779 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/ReferenceAngle50.pg @@ -0,0 +1,198 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@num = (); +for my $i (0..3) { + $num[$i] = random(int(10*(3*$i+1)*pi/6+0.5)/10, int(10*(3*$i+2)*pi/6+0.5)/10, 0.1); +} + +@ans = (); +$ans[0] = Compute("$num[0]"); +$ans[1] = Compute("pi-$num[1]"); +$ans[2] = Compute("$num[2]-pi"); +$ans[3] = Compute("2*pi-$num[3]"); + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]); + $Ay[$i] = $r*sin($num[$i]); + $Bx[$i] = $r*cos($ans[$i]); + $By[$i] = $r*sin($ans[$i]); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $num[$i]",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +############################################## + +BEGIN_PGML + +Find each angle's reference angle in decimals. All numbers are in radians. + +a) Reference angle of [`[$num[0]]`] is [____________]{$ans[0]}. + +b) Reference angle of [`[$num[1]]`] is [____________]{$ans[1]}. + +c) Reference angle of [`[$num[2]]`] is [____________]{$ans[2]}. + +d) Reference angle of [`[$num[3]]`] is [____________]{$ans[3]}. + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +$ans2N = -$ans[2]; + +BEGIN_PGML_SOLUTION + +###Part a + +Here is a Unit Circle with Point A corresponding to [`[$num[0]]`] radians: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The reference angle of [`[$num[0]]`] radians is simply the measure of [`\angle AOE`], which is [`[$num[0]]`] radians. + +Reference angle of [`[$num[0]]`] is [`[$ans[0]]`]. + +###Part b + +>>[@ $fig[1] @]*<< + +The reference angle of [`[$num[1]]`] radians is the measure of [`\angle AOF`]. + + [``\begin{aligned} + m\angle AOF &= \text{measure of minor arc }AF \\ + &= \text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA \\ + &= \pi - [$num[1]] \\ + &= [$ans[1]] + \end{aligned}``] + +Reference angle of [`[$num[1]]`] is [`[$ans[1]]`]. + +###Part c + +>>[@ $fig[2] @]*<< + +The reference angle of [`[$num[2]]`] radians is the measure of [`\angle AOF`]. + + [``\begin{aligned} + m\angle AOF &= \text{measure of minor arc }AF \\ + &= \text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}\\ + &= [$num[2]] - \pi\\ + &= [$ans[2]] + \end{aligned}``] + +Reference angle of [`[$num[2]]`] is [`[$ans[2]]`]. + +###Part d + +>>[@ $fig[3] @]*<< + +The reference angle of [`[$num[2]]`] radians is the measure of [`\angle AOE`]. + + [``\begin{aligned} + m\angle AOE &= \text{measure of minor arc }AE \\ + &= \text{measure of major arc }EFE \text{ (whole circle)} - \text{measure of major arc }EFA \\ + &= 2\pi-[$num[3]] \\ + &= [$ans[3]] + \end{aligned}``] + +Reference angle of [`[$num[3]]`] is [`[$ans[3]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/TrigDomainRange10.pg b/Contrib/PCC/Trigonometry/UnitCircle/TrigDomainRange10.pg new file mode 100644 index 0000000000..02e264b96c --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/TrigDomainRange10.pg @@ -0,0 +1,171 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +@intervals = ( + "\displaystyle (-\infty,\infty)", + "\displaystyle [-1,1]", + "\displaystyle \{x|x\ne k\pi+\frac{\pi}{2}\}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..2) { + do {$temp = list_random(0..2)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$popupSineDomain = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{0}]); + +$popupSineRange = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{1}]); + +$popupCosineDomain = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{0}]); + +$popupCosineRange = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{1}]); + +$popupTangentDomain = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{2}]); + +$popupTangentRange = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{0}]); + +########################################################## + +BEGIN_PGML + +Choose the correct interval for each problem. + +[@DataTable( + [ + [ + [PF('[`` \text{Domain of }y=\sin(x)\text{ is }``] [_____________]{$popupSineDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{A: }[$intervals[$scramble{0}]]``]')], + ], + [ + [PF('[`` \text{Range of }y=\sin(x)\text{ is }``] [_____________]{$popupSineRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{B: }[$intervals[$scramble{1}]]``]')], + ], + [ + [PF('[`` \text{Domain of }y=\cos(x)\text{ is }``] [_____________]{$popupCosineDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{C: }[$intervals[$scramble{2}]]``]')], + ], + [ + [PF('[`` \text{Range of }y=\cos(x)\text{ is }``] [_____________]{$popupCosineRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('')], + ], + [ + [PF('[`` \text{Domain of }y=\tan(x)\text{ is }``] [_____________]{$popupTangentDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('')], + ], + [ + [PF('[`` \text{Range of }y=\tan(x)\text{ is }``] [_____________]{$popupTangentRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('')], + ], + ], + align => 'l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +It is very important to know the domain and range of the following functions. + +[@DataTable( + [ + [ + [PF('Functions'), + cellcss => 'border-right: 1px solid;', + rowcss => 'border-bottom: 1px solid;'], + [PF('Domain'), + cellcss => 'border-right: 1px solid; '], + [PF('Range')], + ], + [ + [PF('[``y=\sin(x)``]'), + rowcss => 'border-bottom: 1px solid;height:60px;', + cellcss => 'border-right: 1px solid;',], + [PF('[`\left( -\infty,\infty \right)`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\left[ -1,1 \right]`]')], + ], + [ + [PF('[``y=\cos(x)``]'), + rowcss => 'height:60px;border-bottom: 1px solid;', + cellcss => 'border-right: 1px solid; '], + [PF('[`\left( -\infty,\infty \right)`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\left[ -1,1 \right]`]')], + ], + [ + [PF('[``y=\tan(x)``]'), + rowcss => 'height:60px;', + cellcss => 'border-right: 1px solid; '], + [PF('[`\{x|x\ne k\pi+\frac{\pi}{2}\}`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\left( -\infty,\infty \right)`]')], + ], + ], + align => 'c c c', +);@]* + + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship10.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship10.pg new file mode 100644 index 0000000000..4b765ed371 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship10.pg @@ -0,0 +1,245 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# +# ENDDESCRIPTION + +## DBsubject('Precalculus') +## DBchapter('Trigonometry') +## DBsection('') +## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = @_; + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +Context("Numeric"); + +#Q1 pos, $Q1 neg, $Q2 pos, $Q2 pos, +#Q3 pos, $Q3 neg, $Q4 pos, $Q4 neg +@num = (); + +do { + $den = random(3,9,1); + $num[0] = random(1,$den-1,1); +} until gcd($num[0],$den)==1; + +$num[2] = $den-$num[0]; +$num[4] = $num[0]+$den; +$num[6] = 2*$den-$num[0]; + +for (my $i=1; $i<=7; $i=$i+2) { + $num[$i] = $num[$i-1]-2*$den; +} + +@numShow = (); +for my $i (0..7) { + if ($num[$i]==1) {$numShow[$i] = "";} + elsif ($num[$i]==-1) {$numShow[$i] = "-";} + else {$numShow[$i] = "$num[$i]";} +} + +@values = ( + [&output($num[0],$den), + &output($num[1],$den), + &output($num[2],$den), + &output($num[3],$den),], + [&output($num[4],$den), + &output($num[5],$den), + &output($num[6],$den), + &output($num[7],$den),] +); + +$in0 = random(0,1,1); +$in1 = random(0,3,1); +$numIn = $in0*4+$in1; +$negNumIn = ($numIn%2 == 0) ? $numIn+1 : $numIn-1; +if ($numIn<=1) { + $numIn1 = 2; + $negNumIn1 = 3; +} elsif ( ($numIn>=2) && ($numIn<=3) ) { + $numIn1 = 0; + $negNumIn1 = 1; +} elsif ( ($numIn>=4) && ($numIn<=5) ) { + $numIn1 = 6; + $negNumIn1 = 7; +} else { + $numIn1 = 4; + $negNumIn1 = 5; +} + +$func = "sin"; + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Use your knowledge of the Unit Circle, find equivalent expressions of \( \$func \left( $values[$in0][$in1] \right) \). There may be more than one correct answer.", + "\( \$func\left( $values[$in0][($in1+1)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+2)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+3)%4] \right) \) $BR", +); + +$mc -> extra( + "\( \$func\left($values[($in0+1)%2][0] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][1] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][2] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][3] \right) \) $BR", +); + + + +$r = 5; +$Px = $r*cos($num[$numIn]*pi/$den); +$Py = $r*sin($num[$numIn]*pi/$den); +$Qx = $r*cos($num[$numIn1]*pi/$den); +$Qy = $r*sin($num[$numIn1]*pi/$den); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( $Qx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $numShow[$numIn] pi/$den",'red',$Plor,$Puod,large)); + +if ($Qx>0) { + $Qlor = ($Qx<$r/2) ? "left" : "center"; +} else { + $Qlor = (-$Qx>$r/2) ? "center" : "right"; +} +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q: $numShow[$numIn1] pi/$den",'red',$Qlor,$Quod,large)); + +$Olor = ($Px*$Qx>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); +$Slor = ($Qx>0) ? "left" : "right"; +$graph->lb(new Label($Qx,0,"S",'red',$Slor,$Ruod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $numShow[$numIn] pi/$den and Q: $numShow[$numIn1] pi/$den are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, crossing the x-axis at S. OSQ is a right triangle, with angle S being the right angle."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +$s0 = &output($num[$numIn],$den); +$s1 = &output($num[$numIn1],$den); +$s2 = &output($num[$negNumIn],$den); +$s3 = &output($num[$negNumIn1],$den); + +BEGIN_PGML_SOLUTION + +Assume [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the unit circle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the Unit Circle, the [`y`]-value of [`P`]'s coordinates (height of the right triangle [`\Delta POR`]) is simply [`\sin \left( [$values[$in0][$in1]] \right)`]. + +By the graph, [`[$values[$in0][$in1]]`] and [`[$s1]`] have the same sine value. + +Since [`[$values[$in0][$in1]]`] and [`[$s2]`] are located on the same point on the unit circle, they have the same trig values. + +Similarly, [`[$s1]`] and [`[$s3]`] are located on the same point on the unit circle, they have the same trig values. + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship20.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship20.pg new file mode 100644 index 0000000000..0b3e307a6e --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship20.pg @@ -0,0 +1,252 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = @_; + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +Context("Numeric"); + +#Q1 pos, $Q1 neg, $Q2 pos, $Q2 pos, +#Q3 pos, $Q3 neg, $Q4 pos, $Q4 neg +@num = (); + +do { + $den = random(3,9,1); + $num[0] = random(1,$den-1,1); +} until gcd($num[0],$den)==1; + +$num[2] = $den-$num[0]; +$num[4] = $num[0]+$den; +$num[6] = 2*$den-$num[0]; + +for (my $i=1; $i<=7; $i=$i+2) { + $num[$i] = $num[$i-1]-2*$den; +} + +@numShow = (); +for my $i (0..7) { + if ($num[$i]==1) {$numShow[$i] = "";} + elsif ($num[$i]==-1) {$numShow[$i] = "-";} + else {$numShow[$i] = "$num[$i]";} +} + +@values = ( + [&output($num[0],$den), + &output($num[1],$den), + &output($num[6],$den), + &output($num[7],$den),], + [&output($num[2],$den), + &output($num[3],$den), + &output($num[4],$den), + &output($num[5],$den),] +); + +$in0 = random(0,1,1); +$in1 = random(0,3,1); + +if ($in0==0) { + if ($in1==0) {$numIn=0;} + elsif ($in1==1) {$numIn=1;} + elsif ($in1==2) {$numIn=6;} + else {$numIn=7;} +} else { + if ($in1==0) {$numIn=2;} + elsif ($in1==1) {$numIn=3;} + elsif ($in1==2) {$numIn=4;} + else {$numIn=5;} +} +$negNumIn = ($numIn%2 == 0) ? $numIn+1 : $numIn-1; + +if ($numIn<=1) { + $numIn1 = 6; + $negNumIn1 = 7; +} elsif ( ($numIn>=2) && ($numIn<=3) ) { + $numIn1 = 4; + $negNumIn1 = 5; +} elsif ( ($numIn>=4) && ($numIn<=5) ) { + $numIn1 = 2; + $negNumIn1 = 3; +} else { + $numIn1 = 0; + $negNumIn1 = 1; +} + +$func = "cos"; + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Use your knowledge of the Unit Circle, find equivalent expressions of \( \$func \left( $values[$in0][$in1] \right) \). There may be more than one correct answer.", + "\( \$func\left( $values[$in0][($in1+1)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+2)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+3)%4] \right) \) $BR", +); + +$mc -> extra( + "\( \$func\left($values[($in0+1)%2][0] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][1] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][2] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][3] \right) \) $BR", +); + + + +$r = 5; +$Px = $r*cos($num[$numIn]*pi/$den); +$Py = $r*sin($num[$numIn]*pi/$den); +$Qx = $r*cos($num[$numIn1]*pi/$den); +$Qy = $r*sin($num[$numIn1]*pi/$den); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $numShow[$numIn] pi/$den",'red',$Plor,$Puod,large)); + +if ($Qx>0) { + $Qlor = ($Qx<$r/2) ? "left" : "center"; +} else { + $Qlor = (-$Qx>$r/2) ? "center" : "right"; +} +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q: $numShow[$numIn1] pi/$den",'red',$Qlor,$Quod,large)); + +$Olor = ($Px>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $numShow[$numIn] pi/$den and Q: $numShow[$numIn1] pi/$den are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, also crossing the x-axis at R. ORQ is a right triangle, with angle R being the right angle."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +$s0 = &output($num[$numIn],$den); +$s1 = &output($num[$numIn1],$den); +$s2 = &output($num[$negNumIn],$den); +$s3 = &output($num[$negNumIn1],$den); + +BEGIN_PGML_SOLUTION + +Assume [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the unit circle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the Unit Circle, the [`x`]-value of [`P`]'s coordinates (base of the right triangle [`\Delta POR`]) is simply [`\cos \left( [$values[$in0][$in1]] \right)`]. + +By the graph, [`[$values[$in0][$in1]]`] and [`[$s1]`] have the same cosine value. + +Since [`[$values[$in0][$in1]]`] and [`[$s2]`] are located on the same point on the unit circle, they have the same trig values. + +Similarly, [`[$s1]`] and [`[$s3]`] are located on the same point on the unit circle, they have the same trig values. + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship30.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship30.pg new file mode 100644 index 0000000000..4836ce5b79 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship30.pg @@ -0,0 +1,261 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = @_; + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +Context("Numeric"); + +#Q1 pos, $Q1 neg, $Q2 pos, $Q2 pos, +#Q3 pos, $Q3 neg, $Q4 pos, $Q4 neg +@num = (); + +do { + $den = random(3,9,1); + $num[0] = random(1,$den-1,1); +} until gcd($num[0],$den)==1; + +$num[2] = $den-$num[0]; +$num[4] = $num[0]+$den; +$num[6] = 2*$den-$num[0]; + +for (my $i=1; $i<=7; $i=$i+2) { + $num[$i] = $num[$i-1]-2*$den; +} + +@numShow = (); +for my $i (0..7) { + if ($num[$i]==1) {$numShow[$i] = "";} + elsif ($num[$i]==-1) {$numShow[$i] = "-";} + else {$numShow[$i] = "$num[$i]";} +} + +@values = ( + [&output($num[0],$den), + &output($num[1],$den), + &output($num[4],$den), + &output($num[5],$den),], + [&output($num[2],$den), + &output($num[3],$den), + &output($num[6],$den), + &output($num[7],$den),] +); + +$in0 = random(0,1,1); +$in1 = random(0,3,1); + +if ($in0==0) { + if ($in1==0) {$numIn=0;} + elsif ($in1==1) {$numIn=1;} + elsif ($in1==2) {$numIn=4;} + else {$numIn=5;} +} else { + if ($in1==0) {$numIn=2;} + elsif ($in1==1) {$numIn=3;} + elsif ($in1==2) {$numIn=6;} + else {$numIn=7;} +} +$negNumIn = ($numIn%2 == 0) ? $numIn+1 : $numIn-1; + +if ($numIn<=1) { + $numIn1 = 4; + $negNumIn1 = 5; +} elsif ( ($numIn>=2) && ($numIn<=3) ) { + $numIn1 = 6; + $negNumIn1 = 7; +} elsif ( ($numIn>=4) && ($numIn<=5) ) { + $numIn1 = 0; + $negNumIn1 = 1; +} else { + $numIn1 = 2; + $negNumIn1 = 3; +} + +$func = "tan"; + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Use your knowledge of the Unit Circle, find equivalent expressions of \( \$func \left( $values[$in0][$in1] \right) \). There may be more than one correct answer.", + "\( \$func\left( $values[$in0][($in1+1)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+2)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+3)%4] \right) \) $BR", +); + +$mc -> extra( + "\( \$func\left($values[($in0+1)%2][0] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][1] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][2] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][3] \right) \) $BR", +); + + + +$r = 5; +$Px = $r*cos($num[$numIn]*pi/$den); +$Py = $r*sin($num[$numIn]*pi/$den); +$Qx = $r*cos($num[$numIn1]*pi/$den); +$Qy = $r*sin($num[$numIn1]*pi/$den); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( $Qx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $numShow[$numIn] pi/$den",'red',$Plor,$Puod,large)); + +if ($Qx>0) { + $Qlor = ($Qx<$r/2) ? "left" : "center"; +} else { + $Qlor = (-$Qx>$r/2) ? "center" : "right"; +} +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q: $numShow[$numIn1] pi/$den",'red',$Qlor,$Quod,large)); + +$Olor = ($Px>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); + +$Slor = ($Qx>0) ? "left" : "right"; +$Suod = ($Qy>0) ? "top" : "bottom"; +$graph->lb(new Label($Qx,0,"S",'red',$Slor,$Suod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $numShow[$numIn] pi/$den and Q: $numShow[$numIn1] pi/$den are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, crossing the x-axis at S. OSQ is a right triangle, with angle S being the right angle."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +$s0 = &output($num[$numIn],$den); +$s1 = &output($num[$numIn1],$den); +$s2 = &output($num[$negNumIn],$den); +$s3 = &output($num[$negNumIn1],$den); + +BEGIN_PGML_SOLUTION + +Assume [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the unit circle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the Unit Circle, + +* The [`y`]-value of [`P`]'s coordinates (height of the right triangle [`\Delta POR`]) is [`\sin \left( [$values[$in0][$in1]] \right)`]. +* The [`x`]-value of [`P`]'s coordinates (base of the right triangle [`\Delta POR`]) is [`\cos \left( [$values[$in0][$in1]] \right)`]. +* [` \tan \left( [$values[$in0][$in1]] \right) = \frac{\sin \left( [$values[$in0][$in1]] \right)}{\cos \left( [$values[$in0][$in1]] \right)}`] + +By the graph, [`[$values[$in0][$in1]]`] and [`[$s1]`] have the same tangent value. + +Since [`[$values[$in0][$in1]]`] and [`[$s2]`] are located on the same point on the unit circle, they have the same trig values. + +Similarly, [`[$s1]`] and [`[$s3]`] are located on the same point on the unit circle, they have the same trig values. + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship40.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship40.pg new file mode 100644 index 0000000000..9f9c49f6af --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship40.pg @@ -0,0 +1,198 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$start = 30+random(0,3,1)*90; +$degree = random($start,$start+30,1); +$rad = int(100*$degree*pi/180+0.5)/100; + +$ans = (pi-$rad>0) ? Compute("pi-$rad") : Compute("3*pi-$rad"); +$ansShow = int(100*Real($ans)+0.5)/100; + +$r = 5; +$Px = $r*cos($rad); +$Py = $r*sin($rad); +$Qx = $r*cos($ans); +$Qy = $r*sin($ans); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph -> stamps( closed_circle( $Px, $Py, red ) ); +$graph -> stamps( closed_circle( $Qx, $Qy, red ) ); +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( $Qx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $rad radians",'red',$Plor,$Puod,large)); + +$Qlor = ($Qx>0) ? "left" : "right"; +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q",'red',$Qlor,$Quod,large)); + +$Olor = ($Px*$Qx>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph -> stamps( closed_circle( $r, 0, red ) ); +$graph->lb(new Label($r,0,"A: 0",'red',"left","top",large)); +$graph -> stamps( closed_circle( -$r, 0, red ) ); +$graph->lb(new Label(-$r,0,"B: pi",'red',"right","top",large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); +$Slor = ($Qx>0) ? "left" : "right"; +$graph->lb(new Label($Qx,0,"S",'red',$Slor,$Ruod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $rad radians and Q, reflection of P by the y-axis, are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, crossing the x-axis at S. OSQ is a right triangle, with angle S being the right angle. Point A is at 0 radian, and Point B is at pi radians."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +Use your knowledge of the Unit Circle, find an angle [`\theta`] in the range of [` [0,2\pi) `] where [` \sin([$rad]) = \sin(\theta) `] and [` \theta \ne [$rad]`]. + +[@KeyboardInstructions( +"\n" +.'* Please type a value in radian, not in degrees.' +)@]** + + [`` \sin([$rad]) = \sin``][___________]{$ans} + +END_PGML + +############################################## + + +############################################## + +$deg = int($rad*180/pi+0.5); + +$i = ($rad>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$rad]`] radians corresponds to point [`P`] on the Unit Circle, the [`y`]-value of [`P`]'s coordinates (height of the right triangle [`\Delta POR`]) is simply [`\sin \left( [$rad] \right)`]. + +By the graph, [`P: [$rad]`] radians and [`Q`] have the same sine value. Next, we need to determine the value represented by [`Q`], which is also represented by the minor arc [`AQ`]. + +Note that the measure of arc [`AQ`] is the same as the measure of minor arc [`BP`]. + + [`` [$output1[$i]]=[$output2[$i]] ``] + +[`[$output3]`] + + [``[$output4]``] + +The solution is: + + [`` \sin([$rad]) = \sin([$ans]) ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship50.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship50.pg new file mode 100644 index 0000000000..d76bd14f51 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship50.pg @@ -0,0 +1,173 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$start = 30+random(0,3,1)*90; +$degree = random($start,$start+30,1); +$rad = int(100*$degree*pi/180+0.5)/100; + +$ans = Compute("2*pi-$rad"); +$ansShow = int(100*Real($ans)+0.5)/100; + +$r = 5; +$Px = $r*cos($rad); +$Py = $r*sin($rad); +$Qx = $r*cos($ans); +$Qy = $r*sin($ans); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph -> stamps( closed_circle( $Px, $Py, red ) ); +$graph -> stamps( closed_circle( $Qx, $Qy, red ) ); +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( $Qx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $rad radians",'red',$Plor,$Puod,large)); + +$Qlor = ($Qx>0) ? "left" : "right"; +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q",'red',$Qlor,$Quod,large)); + +$Olor = ($Px>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph -> stamps( closed_circle( $r, 0, red ) ); +$graph->lb(new Label($r,0,"A: 0",'red',"left","top",large)); +$graph -> stamps( closed_circle( -$r, 0, red ) ); +$graph->lb(new Label(-$r,0,"B: pi",'red',"right","top",large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $rad radians and Q, reflection of P by the x-axis, are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, also crossing the x-axis at R. ORQ is a right triangle, with angle R being the right angle. Point A is at 0 radian, and Point B is at pi radians."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +Use your knowledge of the Unit Circle, find an angle [`\theta`] in the range of [` [0,2\pi) `] where [` \cos([$rad]) = \cos(\theta) `] and [` \theta \ne [$rad]`]. + +[@KeyboardInstructions( +"\n" +.'* Please type a value in radian, not in degrees.' +)@]** + + [`` \cos([$rad]) = \cos``][___________]{$ans} + +END_PGML + +############################################## + +$deg = int($rad*180/pi+0.5); + +BEGIN_PGML_SOLUTION + +To convert [`[$rad]`] radians to degrees, we can do: + + [`` [$rad]\text{ radians} = \frac{[$rad]\cdot180^{\circ}}{\pi} \approx [$deg]^{\circ} ``] + +This is how we can determine the approximate location of [`[$rad]`] radians on the Unit Circle. In the following figure, Point [`P`] corresponds to [`[$rad]`] radians. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$rad]`] radians corresponds to point [`P`] on the Unit Circle, the [`x`]-value of [`P`]'s coordinates (base of the right triangle [`\Delta POR`]) is simply [`\cos \left( [$rad] \right)`]. + +By the graph, [`P: [$rad]`] radians and [`Q`] have the same cosine value. Next, we need to determine the value represented by [`Q`], which is also represented by the minor arc [`AQ`]. + +Note that the measure of minor arc [`AQ`] is the same as the measure of minor arc [`AP`], except they have opposite signs. + + [`` \text{minor arc }AQ = -\text{ minor arc }AP = -[$rad]\text{ radians} ``] + +Since [`Q`]'s value must be in the range [`[0,2\pi)`], we have: + + [`` \text{minor arc }AQ = -[$rad]+2\pi =[$ans] \text{ radians}``] + +The solution is: + + [`` \cos([$rad]) = \cos([$ans]) ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship60.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship60.pg new file mode 100644 index 0000000000..78b6f8c225 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleRelationship60.pg @@ -0,0 +1,185 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$start = 30+random(0,3,1)*90; +$degree = random($start,$start+30,1); +$rad = int(100*$degree*pi/180+0.5)/100; + +$ans = (pi-$rad>0) ? Compute("pi+$rad") : Compute("$rad-pi"); +$ansShow = int(100*Real($ans)+0.5)/100; + +$r = 5; +$Px = $r*cos($rad); +$Py = $r*sin($rad); +$Qx = $r*cos($ans); +$Qy = $r*sin($ans); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph -> stamps( closed_circle( $Px, $Py, red ) ); +$graph -> stamps( closed_circle( $Qx, $Qy, red ) ); +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( $Qx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $rad radians",'red',$Plor,$Puod,large)); + +$Quod = ($Qx>0) ? "left" : "right"; +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q",'red',$Qlor,$Quod,large)); + +$Olor = ($Px>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph -> stamps( closed_circle( $r, 0, red ) ); +$graph->lb(new Label($r,0,"A: 0",'red',"left","top",large)); +$graph -> stamps( closed_circle( -$r, 0, red ) ); +$graph->lb(new Label(-$r,0,"B: pi",'red',"right","top",large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); + +$Slor = ($Qx>0) ? "left" : "right"; +$Suod = ($Qy>0) ? "top" : "bottom"; +$graph->lb(new Label($Qx,0,"S",'red',$Slor,$Suod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $rad radians and Q, reflection of P by the origin, are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, crossing the x-axis at S. OSQ is a right triangle, with angle S being the right angle. Point A is at 0 radian, and Point B is at pi radians."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +Use your knowledge of the Unit Circle, find an angle [`\theta`] in the range of [` [0,2\pi) `] where [` \tan([$rad]) = \tan(\theta) `] and [` \theta \ne [$rad]`]. + +[@KeyboardInstructions( +"\n" +.'* Please type a value in radian, not in degrees.' +)@]** + + [`` \tan([$rad]) = \tan``][___________]{$ans} + +END_PGML + +############################################## + +$deg = int($rad*180/pi+0.5); + +if ($rad>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the Unit Circle, + +* The [`y`]-value of [`P`]'s coordinates (height of the right triangle [`\Delta POR`]) is [`\sin \left( [$rad] \right)`]. +* The [`x`]-value of [`P`]'s coordinates (base of the right triangle [`\Delta POR`]) is [`\cos \left( [$rad] \right)`]. +* [` \tan \left( [$rad] \right) = \frac{\sin \left( [$rad] \right)}{\cos \left( [$rad] \right)}`] + +By the graph, [`P: [$rad]`] radians and [`Q`] have the same tangent value. Next, we need to determine the value represented by [`Q`], which is also represented by the minor arc [`AQ`]. + +Note that the measure of minor arc [`AQ`] is simply [`\pi`] radians [$mol] than the measure of minor arc [`AP`]. + + [`` \text{minor arc }AQ = [$rad] [$aos] \pi \approx [$ans] ``] + +The solution is: + + [`` \tan([$rad]) = \tan([$ans]) ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues10.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues10.pg new file mode 100644 index 0000000000..05c1165da2 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues10.pg @@ -0,0 +1,242 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +#[ angle, x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + [0, 1, 0, 0, 1, 0, Compute("DNE"), 1, Compute("DNE")], + ["\displaystyle \frac{\pi}{2}", 0, 1, 1, 0, Compute("DNE"), 1, Compute("DNE"), 0], + ["\displaystyle \pi", -1, 0, 0, -1, 0, Compute("DNE"), -1, Compute("DNE")], + ["\displaystyle \frac{3\pi}{2}", 0, -1, -1, 0, Compute("DNE"), -1, Compute("DNE"), 0], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$A_pt = closed_circle( $r, 0, red ); +$B_pt = closed_circle( 0 ,$r, red ); +$C_pt = closed_circle( -$r, 0, red ); +$D_pt = closed_circle( 0, -$r, red ); +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt); + +for my $i (0..0) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r-0.1, 0,"A(1,0)",'red','right','bottom',large)); + $graph[$i]->lb(new Label(0-0.1, $r,"B(0,1)",'red','right','bottom',large)); + $graph[$i]->lb(new Label(-$r+0.1, 0,"C(-1,0)",'red','left','top',large)); + $graph[$i]->lb(new Label(0.1,-$r,"D(0,-1)",'red','left','top',large)); +} + + +$alt[0] = "This is the graph of a unit circle, with Point A(1,0), B(0,1), C(-1,0) and Point D(0,-1)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +* [@KeyboardInstructions("If a value is undefined, type *DNE* (does not exist).")@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][1]},[_____]{$problems[$perm[0]][2]})')], + [PF('([_____]{$problems[$perm[1]][1]},[_____]{$problems[$perm[1]][2]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][3]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][3]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][4]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +For those points on the Unit Circle, you should come up with the following values fluently: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@DataTable( + [ + [ + [PF('[`A(1,0)`]')], + [PF('[`B(0,1)`]')], + [PF('[`C(-1,0)`]')], + [PF('[`D(0,-1)`]')], + ], + [ + [PF('degree: [`0`]')], + [PF('degree: [`\frac{\pi}{2}`]')], + [PF('degree: [`\pi`]')], + [PF('degree: [`\frac{3\pi}{2}`]')], + ], + [ + [PF('[`\sin(0)=0`]'),], + [PF('[`\sin\left(\frac{\pi}{2}\right)=1`]')], + [PF('[`\sin\left(\pi\right)=0`]')], + [PF('[`\sin\left(\frac{3\pi}{2}\right)=-1`]')], + ], + [ + [PF('[`\cos(0)=1`]'),], + [PF('[`\cos\left(\frac{\pi}{2}\right)=0`]')], + [PF('[`\cos\left(\pi\right)=-1`]')], + [PF('[`\cos\left(\frac{3\pi}{2}\right)=0`]')], + ], + [ + [PF('[`\tan(0)=0`]'),], + [PF('[`\tan\left(\frac{\pi}{2}\right) `] does not exist')], + [PF('[`\tan\left(\pi\right)=0`]')], + [PF('[`\tan\left(\frac{3\pi}{2}\right)`] does not exist')], + ], + [ + [PF('[`\csc(0)`] does not exist'),], + [PF('[`\csc\left(\frac{\pi}{2}\right)=1`]')], + [PF('[`\csc\left(\pi\right)`] does not exist')], + [PF('[`\csc\left(\frac{3\pi}{2}\right)=-1`]')], + ], + [ + [PF('[`\sec(0)=1`]'),], + [PF('[`\sec\left(\frac{\pi}{2}\right)`] does not exist')], + [PF('[`\sec\left(\pi\right)=-1`]')], + [PF('[`\sec\left(\frac{3\pi}{2}\right)`] does not exist')], + ], + [ + [PF('[`\cot(0)`] does not exist'),], + [PF('[`\cot\left(\frac{\pi}{2}\right)=0`]')], + [PF('[`\cot\left(\pi\right)`] does not exist')], + [PF('[`\cot\left(\frac{3\pi}{2}\right)=0`]')], + ], + ], + align => 'c|c|c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues11.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues11.pg new file mode 100644 index 0000000000..1473d2c4cf --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues11.pg @@ -0,0 +1,241 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +#[ angle, x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle 0^{\circ}", 1, 0, 0, 1, 0, Compute("DNE"), 1, Compute("DNE")], + ["\displaystyle 90^{\circ}", 0, 1, 1, 0, Compute("DNE"), 1, Compute("DNE"), 0], + ["\displaystyle 180^{\circ}", -1, 0, 0, -1, 0, Compute("DNE"), -1, Compute("DNE")], + ["\displaystyle 270^{\circ}", 0, -1, -1, 0, Compute("DNE"), -1, Compute("DNE"), 0], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$A_pt = closed_circle( $r, 0, red ); +$B_pt = closed_circle( 0 ,$r, red ); +$C_pt = closed_circle( -$r, 0, red ); +$D_pt = closed_circle( 0, -$r, red ); +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt); + +for my $i (0..0) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r-0.1, 0,"A(1,0)",'red','right','bottom',large)); + $graph[$i]->lb(new Label(0-0.1, $r,"B(0,1)",'red','right','bottom',large)); + $graph[$i]->lb(new Label(-$r+0.1, 0,"C(-1,0)",'red','left','top',large)); + $graph[$i]->lb(new Label(0.1,-$r,"D(0,-1)",'red','left','top',large)); +} + + +$alt[0] = "This is the graph of a unit circle, with Point A(1,0), B(0,1), C(-1,0) and Point D(0,-1)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +* [@KeyboardInstructions("If a value is undefined, type *DNE* (does not exist).")@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][1]},[_____]{$problems[$perm[0]][2]})')], + [PF('([_____]{$problems[$perm[1]][1]},[_____]{$problems[$perm[1]][2]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][3]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][3]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][4]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +For those points on the Unit Circle, you should come up with the following values fluently: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@DataTable( + [ + [ + [PF('[`A(1,0)`]')], + [PF('[`B(0,1)`]')], + [PF('[`C(-1,0)`]')], + [PF('[`D(0,-1)`]')], + ], + [ + [PF('degree: [`0^{\circ}`]')], + [PF('degree: [`90^{\circ}`]')], + [PF('degree: [`180^{\circ}`]')], + [PF('degree: [`270^{\circ}`]')], + ], + [ + [PF('[`\sin(0^{\circ})=0`]'),], + [PF('[`\sin\left(90^{\circ}\right)=1`]')], + [PF('[`\sin\left(180^{\circ}\right)=0`]')], + [PF('[`\sin\left(270^{\circ}\right)=-1`]')], + ], + [ + [PF('[`\cos(0^{\circ})=1`]'),], + [PF('[`\cos\left(90^{\circ}\right)=0`]')], + [PF('[`\cos\left(180^{\circ}\right)=-1`]')], + [PF('[`\cos\left(270^{\circ}\right)=0`]')], + ], + [ + [PF('[`\tan(0^{\circ})=0`]'),], + [PF('[`\tan\left(90^{\circ}\right) `] does not exist')], + [PF('[`\tan\left(180^{\circ}\right)=0`]')], + [PF('[`\tan\left(270^{\circ}\right)`] does not exist')], + ], + [ + [PF('[`\csc(0^{\circ})`] does not exist'),], + [PF('[`\csc\left(90^{\circ}\right)=1`]')], + [PF('[`\csc\left(180^{\circ}\right)`] does not exist')], + [PF('[`\csc\left(270^{\circ}\right)=-1`]')], + ], + [ + [PF('[`\sec(0^{\circ})=1`]'),], + [PF('[`\sec\left(90^{\circ}\right)`] does not exist')], + [PF('[`\sec\left(180^{\circ}\right)=-1`]')], + [PF('[`\sec\left(270^{\circ}\right)`] does not exist')], + ], + [ + [PF('[`\cot(0^{\circ})`] does not exist'),], + [PF('[`\cot\left(90^{\circ}\right)=0`]')], + [PF('[`\cot\left(180^{\circ}\right)`] does not exist')], + [PF('[`\cot\left(270^{\circ}\right)=0`]')], + ], + ], + align => 'c|c|c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues20.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues20.pg new file mode 100644 index 0000000000..26e0bef7cf --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues20.pg @@ -0,0 +1,265 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..3) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + if ($i==0) {$new[$i] = 2*$rounds[$i];} + elsif ($i==1) {$new[$i] = 4*$rounds[$i]+1;} + elsif ($i==2) {$new[$i] = 2*$rounds[$i]+1;} + else {$new[$i] = 4*$rounds[$i]+3;} +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle $new[0]\pi", "\displaystyle 0", 1, 0, 0, 1, 0, Compute("DNE"), 1, Compute("DNE")], + ["\displaystyle \frac{$new[1]\pi}{2}", "\displaystyle \frac{\pi}{2}", 0, 1, 1, 0, Compute("DNE"), 1, Compute("DNE"), 0], + ["\displaystyle $new[2]\pi", "\displaystyle \pi", -1, 0, 0, -1, 0, Compute("DNE"), -1, Compute("DNE")], + ["\displaystyle \frac{$new[3]\pi}{2}", "\displaystyle \frac{3\pi}{2}", 0, -1, -1, 0, Compute("DNE"), -1, Compute("DNE"), 0], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$alt[0] = "This is the graph of a unit circle,"; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + $graph[0]->stamps(closed_circle( $r, 0, red )); + $graph[0]->lb(new Label($r-0.1, 0,"$new[0] pi",'red','right','bottom',large)); + $alt[0] .= " and with $new[0] pi at (1, 0),"; +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + $graph[0]->stamps(closed_circle( 0, $r, red )); + $graph[0]->lb(new Label(-0.1, $r,"$new[1] pi/2",'red','right','bottom',large)); + $alt[0] .= " and with $new[1] pi/2 at (0, 1),"; +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + $graph[0]->stamps(closed_circle( -$r, 0, red )); + $graph[0]->lb(new Label(-$r+0.1, 0, "$new[2] pi",'red','left','top',large)); + $alt[0] .= " and with $new[2] pi at (-1, 0),"; +} +if ( ($perm[0]==3) || ($perm[1]==3) ){ + $graph[0]->stamps(closed_circle( 0, -$r, red )); + $graph[0]->lb(new Label(0.1,-$r,"$new[3] pi/2",'red','left','top',large)); + $alt[0] .= " and with $new[3] pi/2 at (0, -1),"; +} + + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +* [@KeyboardInstructions("If a value is undefined, type *DNE* (does not exist).")@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+2k\pi`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+2\cdot([$roundsN[$perm[0]]])\cdot\pi = [$problems[$perm[0]][1]]``] + +the angle [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+2\cdot([$roundsN[$perm[1]]])\cdot\pi = [$problems[$perm[1]][1]]``] + +the angle [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues21.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues21.pg new file mode 100644 index 0000000000..b73be54aac --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues21.pg @@ -0,0 +1,265 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..3) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + if ($i==0) {$new[$i] = 2*$rounds[$i]*180;} + elsif ($i==1) {$new[$i] = (4*$rounds[$i]+1)*90;} + elsif ($i==2) {$new[$i] = (2*$rounds[$i]+1)*180;} + else {$new[$i] = (4*$rounds[$i]+3)*90;} +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle $new[0]^{\circ}", "\displaystyle 0^{\circ}", 1, 0, 0, 1, 0, Compute("DNE"), 1, Compute("DNE")], + ["\displaystyle $new[1]^{\circ}", "\displaystyle 90^{\circ}", 0, 1, 1, 0, Compute("DNE"), 1, Compute("DNE"), 0], + ["\displaystyle $new[2]^{\circ}", "\displaystyle 180^{\circ}", -1, 0, 0, -1, 0, Compute("DNE"), -1, Compute("DNE")], + ["\displaystyle $new[3]^{\circ}", "\displaystyle 270^{\circ}", 0, -1, -1, 0, Compute("DNE"), -1, Compute("DNE"), 0], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$alt[0] = "This is the graph of a unit circle,"; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + $graph[0]->stamps(closed_circle( $r, 0, red )); + $graph[0]->lb(new Label($r-0.1, 0,"$new[0] degrees",'red','right','bottom',large)); + $alt[0] .= " and with $new[0]^{\circ} at (1, 0),"; +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + $graph[0]->stamps(closed_circle( 0, $r, red )); + $graph[0]->lb(new Label(-0.1, $r,"$new[1] degrees",'red','right','bottom',large)); + $alt[0] .= " and with $new[1]^{\circ} at (0, 1),"; +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + $graph[0]->stamps(closed_circle( -$r, 0, red )); + $graph[0]->lb(new Label(-$r+0.1, 0, "$new[2] degrees",'red','left','top',large)); + $alt[0] .= " and with $new[2]^{\circ} at (-1, 0),"; +} +if ( ($perm[0]==3) || ($perm[1]==3) ){ + $graph[0]->stamps(closed_circle( 0, -$r, red )); + $graph[0]->lb(new Label(0.1,-$r,"$new[3] degrees",'red','left','top',large)); + $alt[0] .= " and with $new[3]^{\circ} at (0, -1),"; +} + + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +* [@KeyboardInstructions("If a value is undefined, type *DNE* (does not exist).")@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+360^{\circ}`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+([$roundsN[$perm[0]]])\cdot 360^{\circ} = [$problems[$perm[0]][1]]``] + +the angle [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+([$roundsN[$perm[1]]])\cdot 360^{\circ} = [$problems[$perm[1]][1]]``] + +the angle [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues30.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues30.pg new file mode 100644 index 0000000000..e723fcde46 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues30.pg @@ -0,0 +1,261 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +#[ angle, x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle \frac{\pi}{4}", Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), 1, Formula("sqrt(2)"), Formula("sqrt(2)"), 1], + ["\displaystyle \frac{3\pi}{4}", Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), -1, Formula("sqrt(2)"), Formula("-sqrt(2)"), -1], + ["\displaystyle \frac{5\pi}{4}", Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), 1, Formula("-sqrt(2)"), Formula("-sqrt(2)"), 1], + ["\displaystyle \frac{7\pi}{4}", Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), -1, Formula("-sqrt(2)"), Formula("sqrt(2)"), -1], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$A_pt = closed_circle( $r/sqrt(2), $r/sqrt(2), red ); +$B_pt = closed_circle( -$r/sqrt(2), $r/sqrt(2), red ); +$C_pt = closed_circle( -$r/sqrt(2), -$r/sqrt(2), red ); +$D_pt = closed_circle( $r/sqrt(2), -$r/sqrt(2), red ); +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt); + +for my $i (0..0) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/2, "A",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$r*sqrt(2)/2, $r*sqrt(2)/2, "B",'red','right','bottom',large)); + $graph[$i]->lb(new Label(-$r*sqrt(2)/2, -$r*sqrt(2)/2, "C",'red','right','top',large)); + $graph[$i]->lb(new Label($r*sqrt(2)/2, -$r*sqrt(2)/2, "D",'red','left','top',large)); +} + +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($r/sqrt(2),0,red,3); +$graph[0]->lineTo($r/sqrt(2),$r/sqrt(2),red,3); +$graph[0]->lineTo(0,0,red,3); +$graph[0]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','left','middle',large)); +$graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','top',large)); +$graph[0]->lb(new Label($r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','right','bottom',large)); +$graph[0]->lb(new Label(0.5,0, "45",'red','left','bottom',large)); +$graph[0]->lb(new Label($r*sqrt(2)/2-0.1, $r*sqrt(2)/2-0.5, "45",'red','right','top',large)); + +$graph[0]->moveTo($r*sqrt(2)/2,0.4); +$graph[0]->lineTo($r*sqrt(2)/2-0.4,0.4,red,2); +$graph[0]->lineTo($r*sqrt(2)/2-0.4,0,red,2); + +$alt[0] = "This is the graph of a unit circle, with Point A at (sqrt(2)/2,sqrt(2)/2), B at (-sqrt(2)/2,sqrt(2)/2), C at (-sqrt(2)/2,-sqrt(2)/2) and Point D at (sqrt(2)/2,-sqrt(2)/2)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][1]},[_____]{$problems[$perm[0]][2]})')], + [PF('([_____]{$problems[$perm[1]][1]},[_____]{$problems[$perm[1]][2]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][3]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][3]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][4]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +For those points on the Unit Circle, you should come up with values in the table fluently. Note that the triangle is a 45-45-90 special right triangle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@DataTable( + [ + [ + [PF('[`A\left(\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`B\left(-\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`C\left(-\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`D\left(\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right)`]')], + ], + [ + [PF('degree: [`\frac{\pi}{4}`]')], + [PF('degree: [`\frac{3\pi}{4}`]')], + [PF('degree: [`\frac{5\pi}{4}`]')], + [PF('degree: [`\frac{7\pi}{4}`]')], + ], + [ + [PF('[`\sin\left(\frac{\pi}{4}\right)=\frac{\sqrt{2}}{2}`]'),], + [PF('[`\sin\left(\frac{3\pi}{4}\right)=\frac{\sqrt{2}}{2}`]')], + [PF('[`\sin\left(\frac{5\pi}{4}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\sin\left(\frac{7\pi}{4}\right)=-\frac{\sqrt{2}}{2}`]')], + ], + [ + [PF('[`\cos\left(\frac{\pi}{4}\right)=\frac{\sqrt{2}}{2}`]'),], + [PF('[`\cos\left(\frac{3\pi}{4}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\cos\left(\frac{5\pi}{4}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\cos\left(\frac{7\pi}{4}\right)=\frac{\sqrt{2}}{2}`]')], + ], + [ + [PF('[`\tan\left(\frac{\pi}{4}\right)=1`]'),], + [PF('[`\tan\left(\frac{3\pi}{4}\right)=-1`]')], + [PF('[`\tan\left(\frac{5\pi}{4}\right)=1`]')], + [PF('[`\tan\left(\frac{7\pi}{4}\right)=-1`]')], + ], + [ + [PF('[`\csc\left(\frac{\pi}{4}\right)=\sqrt{2}`]'),], + [PF('[`\csc\left(\frac{3\pi}{4}\right)=\sqrt{2}`]')], + [PF('[`\csc\left(\frac{5\pi}{4}\right)=-\sqrt{2}`]')], + [PF('[`\csc\left(\frac{7\pi}{4}\right)=-\sqrt{2}`]')], + ], + [ + [PF('[`\sec\left(\frac{\pi}{4}\right)=\sqrt{2}`]'),], + [PF('[`\sec\left(\frac{3\pi}{4}\right)=-\sqrt{2}`]')], + [PF('[`\sec\left(\frac{5\pi}{4}\right)=-\sqrt{2}`]')], + [PF('[`\sec\left(\frac{7\pi}{4}\right)=\sqrt{2}`]')], + ], + [ + [PF('[`\cot\left(\frac{\pi}{4}\right)=1`]'),], + [PF('[`\cot\left(\frac{3\pi}{4}\right)=-1`]')], + [PF('[`\cot\left(\frac{5\pi}{4}\right)=1`]')], + [PF('[`\cot\left(\frac{7\pi}{4}\right)=-1`]')], + ], + ], + align => 'c|c|c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues31.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues31.pg new file mode 100644 index 0000000000..eeb0c0f3c3 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues31.pg @@ -0,0 +1,261 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +#[ angle, x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle 45^{\circ}", Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), 1, Formula("sqrt(2)"), Formula("sqrt(2)"), 1], + ["\displaystyle 135^{\circ}", Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), -1, Formula("sqrt(2)"), Formula("-sqrt(2)"), -1], + ["\displaystyle 225^{\circ}", Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), 1, Formula("-sqrt(2)"), Formula("-sqrt(2)"), 1], + ["\displaystyle 315^{\circ}", Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), -1, Formula("-sqrt(2)"), Formula("sqrt(2)"), -1], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$A_pt = closed_circle( $r/sqrt(2), $r/sqrt(2), red ); +$B_pt = closed_circle( -$r/sqrt(2), $r/sqrt(2), red ); +$C_pt = closed_circle( -$r/sqrt(2), -$r/sqrt(2), red ); +$D_pt = closed_circle( $r/sqrt(2), -$r/sqrt(2), red ); +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt); + +for my $i (0..0) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/2, "A",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$r*sqrt(2)/2, $r*sqrt(2)/2, "B",'red','right','bottom',large)); + $graph[$i]->lb(new Label(-$r*sqrt(2)/2, -$r*sqrt(2)/2, "C",'red','right','top',large)); + $graph[$i]->lb(new Label($r*sqrt(2)/2, -$r*sqrt(2)/2, "D",'red','left','top',large)); +} + +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($r/sqrt(2),0,red,3); +$graph[0]->lineTo($r/sqrt(2),$r/sqrt(2),red,3); +$graph[0]->lineTo(0,0,red,3); +$graph[0]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','left','middle',large)); +$graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','top',large)); +$graph[0]->lb(new Label($r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','right','bottom',large)); +$graph[0]->lb(new Label(0.5,0, "45",'red','left','bottom',large)); +$graph[0]->lb(new Label($r*sqrt(2)/2-0.1, $r*sqrt(2)/2-0.5, "45",'red','right','top',large)); + +$graph[0]->moveTo($r*sqrt(2)/2,0.4); +$graph[0]->lineTo($r*sqrt(2)/2-0.4,0.4,red,2); +$graph[0]->lineTo($r*sqrt(2)/2-0.4,0,red,2); + +$alt[0] = "This is the graph of a unit circle, with Point A at (sqrt(2)/2,sqrt(2)/2), B at (-sqrt(2)/2,sqrt(2)/2), C at (-sqrt(2)/2,-sqrt(2)/2) and Point D at (sqrt(2)/2,-sqrt(2)/2)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][1]},[_____]{$problems[$perm[0]][2]})')], + [PF('([_____]{$problems[$perm[1]][1]},[_____]{$problems[$perm[1]][2]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][3]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][3]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][4]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +For those points on the Unit Circle, you should come up with values in the table fluently. Note that the triangle is a 45-45-90 special right triangle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@DataTable( + [ + [ + [PF('[`A\left(\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`B\left(-\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`C\left(-\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`D\left(\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right)`]')], + ], + [ + [PF('degree: [`45^{\circ}`]')], + [PF('degree: [`135^{\circ}`]')], + [PF('degree: [`225^{\circ}`]')], + [PF('degree: [`315^{\circ}`]')], + ], + [ + [PF('[`\sin\left(45^{\circ}\right)=\frac{\sqrt{2}}{2}`]'),], + [PF('[`\sin\left(135^{\circ}\right)=\frac{\sqrt{2}}{2}`]')], + [PF('[`\sin\left(225^{\circ}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\sin\left(315^{\circ}\right)=-\frac{\sqrt{2}}{2}`]')], + ], + [ + [PF('[`\cos\left(45^{\circ}\right)=\frac{\sqrt{2}}{2}`]'),], + [PF('[`\cos\left(135^{\circ}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\cos\left(225^{\circ}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\cos\left(315^{\circ}\right)=\frac{\sqrt{2}}{2}`]')], + ], + [ + [PF('[`\tan\left(45^{\circ}\right)=1`]'),], + [PF('[`\tan\left(135^{\circ}\right)=-1`]')], + [PF('[`\tan\left(225^{\circ}\right)=1`]')], + [PF('[`\tan\left(315^{\circ}\right)=-1`]')], + ], + [ + [PF('[`\csc\left(45^{\circ}\right)=\sqrt{2}`]'),], + [PF('[`\csc\left(135^{\circ}\right)=\sqrt{2}`]')], + [PF('[`\csc\left(225^{\circ}\right)=-\sqrt{2}`]')], + [PF('[`\csc\left(315^{\circ}\right)=-\sqrt{2}`]')], + ], + [ + [PF('[`\sec\left(45^{\circ}\right)=\sqrt{2}`]'),], + [PF('[`\sec\left(135^{\circ}\right)=-\sqrt{2}`]')], + [PF('[`\sec\left(225^{\circ}\right)=-\sqrt{2}`]')], + [PF('[`\sec\left(315^{\circ}\right)=\sqrt{2}`]')], + ], + [ + [PF('[`\cot\left(45^{\circ}\right)=1`]'),], + [PF('[`\cot\left(135^{\circ}\right)=-1`]')], + [PF('[`\cot\left(225^{\circ}\right)=1`]')], + [PF('[`\cot\left(315^{\circ}\right)=-1`]')], + ], + ], + align => 'c|c|c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues40.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues40.pg new file mode 100644 index 0000000000..2388a4de22 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues40.pg @@ -0,0 +1,321 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..3) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + $new[$i] = 8*$rounds[$i]+2*$i+1; +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle \frac{$new[0] \pi}{4}", "\displaystyle \frac{\pi}{4}", Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), 1, Formula("sqrt(2)"), Formula("sqrt(2)"), 1], + ["\displaystyle \frac{$new[1] \pi}{4}", "\displaystyle \frac{3\pi}{4}", Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), -1, Formula("sqrt(2)"), Formula("-sqrt(2)"), -1], + ["\displaystyle \frac{$new[2] \pi}{4}", "\displaystyle \frac{5\pi}{4}", Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), 1, Formula("-sqrt(2)"), Formula("-sqrt(2)"), 1], + ["\displaystyle \frac{$new[3] \pi}{4}", "\displaystyle \frac{7\pi}{4}", Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), -1, Formula("-sqrt(2)"), Formula("sqrt(2)"), -1], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r/sqrt(2), $r/sqrt(2),-0.4,0.4); + $graph[0]->stamps(closed_circle( $r/sqrt(2), $r/sqrt(2), red )); + $graph[0]->lb(new Label($r/sqrt(2), $r/sqrt(2),"$new[0] pi/4",'red','left','bottom',large)); + $alt[0] .= " The number $new[0] pi/4 is marked at (sqrt(2)/2, sqrt(2)/2). The circle center (0,0), (sqrt(2)/2, sqrt(2)/2) and (sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"45",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"45",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = (-$r/sqrt(2), $r/sqrt(2),0.4,0.4); + $graph[0]->stamps(closed_circle( -$r/sqrt(2), $r/sqrt(2), red )); + $graph[0]->lb(new Label(-$r/sqrt(2), $r/sqrt(2),"$new[1] pi/4",'red','right','bottom',large)); + $alt[0] .= " The number $new[1] pi/4 is marked at (-sqrt(2)/2, sqrt(2)/2). The circle center (0,0), (-sqrt(2)/2, sqrt(2)/2) and (-sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"45",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"45",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, 0, "-sqrt(2)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r/sqrt(2), -$r/sqrt(2),0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r/sqrt(2), -$r/sqrt(2), red )); + $graph[0]->lb(new Label(-$r/sqrt(2), -$r/sqrt(2),"$new[2] pi/4",'red','right','top',large)); + $alt[0] .= " The number $new[2] pi/4 is marked at (-sqrt(2)/2, -sqrt(2)/2). The circle center (0,0), (-sqrt(2)/2, -sqrt(2)/2) and (-sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"45",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"45",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/2, -$r*sqrt(2)/4, "-sqrt(2)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, 0, "-sqrt(2)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, -$r*sqrt(2)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = ($r/sqrt(2), -$r/sqrt(2),-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r/sqrt(2), -$r/sqrt(2), red )); + $graph[0]->lb(new Label($r/sqrt(2), -$r/sqrt(2),"$new[3] pi/4",'red','left','top',large)); + $alt[0] .= " The number $new[3] pi/4 is marked at (sqrt(2)/2, -sqrt(2)/2). The circle center (0,0), (sqrt(2)/2, -sqrt(2)/2) and (sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"45",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"45",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(2)/2, -$r*sqrt(2)/4, "-sqrt(2)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, -$r*sqrt(2)/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+2k\pi`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+2\cdot([$roundsN[$perm[0]]])\cdot\pi = [$problems[$perm[0]][1]]``] + +the angles [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+2\cdot([$roundsN[$perm[1]]])\cdot\pi = [$problems[$perm[1]][1]]``] + +the angles [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles. Note that the triangles are 45-45-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues41.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues41.pg new file mode 100644 index 0000000000..0fd44a2cc0 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues41.pg @@ -0,0 +1,321 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..3) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + $new[$i] = (8*$rounds[$i]+2*$i+1)*45; +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle $new[0]^{\circ}", "\displaystyle 45^{\circ}", Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), 1, Formula("sqrt(2)"), Formula("sqrt(2)"), 1], + ["\displaystyle $new[1]^{\circ}", "\displaystyle 135^{\circ}", Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), -1, Formula("sqrt(2)"), Formula("-sqrt(2)"), -1], + ["\displaystyle $new[2]^{\circ}", "\displaystyle 225^{\circ}", Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), 1, Formula("-sqrt(2)"), Formula("-sqrt(2)"), 1], + ["\displaystyle $new[3]^{\circ}", "\displaystyle 315^{\circ}", Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), -1, Formula("-sqrt(2)"), Formula("sqrt(2)"), -1], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-7.5,-7.5,7.5,7.5,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r/sqrt(2), $r/sqrt(2),-0.4,0.4); + $graph[0]->stamps(closed_circle( $r/sqrt(2), $r/sqrt(2), red )); + $graph[0]->lb(new Label($r/sqrt(2), $r/sqrt(2),"$new[0] degrees",'red','left','bottom',large)); + $alt[0] .= " $new[0] degrees is marked at (sqrt(2)/2, sqrt(2)/2). The circle center (0,0), (sqrt(2)/2, sqrt(2)/2) and (sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"45",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"45",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = (-$r/sqrt(2), $r/sqrt(2),0.4,0.4); + $graph[0]->stamps(closed_circle( -$r/sqrt(2), $r/sqrt(2), red )); + $graph[0]->lb(new Label(-$r/sqrt(2), $r/sqrt(2),"$new[1] degrees",'red','right','bottom',large)); + $alt[0] .= " $new[1] degrees is marked at (-sqrt(2)/2, sqrt(2)/2). The circle center (0,0), (-sqrt(2)/2, sqrt(2)/2) and (-sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"45",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"45",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, 0, "-sqrt(2)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r/sqrt(2), -$r/sqrt(2),0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r/sqrt(2), -$r/sqrt(2), red )); + $graph[0]->lb(new Label(-$r/sqrt(2), -$r/sqrt(2),"$new[2] degrees",'red','right','top',large)); + $alt[0] .= " $new[2] degrees is marked at (-sqrt(2)/2, -sqrt(2)/2). The circle center (0,0), (-sqrt(2)/2, -sqrt(2)/2) and (-sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"45",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"45",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/2, -$r*sqrt(2)/4, "-sqrt(2)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, 0, "-sqrt(2)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, -$r*sqrt(2)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = ($r/sqrt(2), -$r/sqrt(2),-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r/sqrt(2), -$r/sqrt(2), red )); + $graph[0]->lb(new Label($r/sqrt(2), -$r/sqrt(2),"$new[3] degrees",'red','left','top',large)); + $alt[0] .= " $new[3] degrees is marked at (sqrt(2)/2, -sqrt(2)/2). The circle center (0,0), (sqrt(2)/2, -sqrt(2)/2) and (sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"45",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"45",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(2)/2, -$r*sqrt(2)/4, "-sqrt(2)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, -$r*sqrt(2)/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+360k`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+([$roundsN[$perm[0]]])\cdot360^{\circ} = [$problems[$perm[0]][1]]``] + +the angle [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+([$roundsN[$perm[1]]])\cdot360^{\circ} = [$problems[$perm[1]][1]]``] + +the angle [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles. Note that the triangles are 45-45-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues50.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues50.pg new file mode 100644 index 0000000000..db01e23945 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues50.pg @@ -0,0 +1,383 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle \frac{\pi}{6}", "\displaystyle \frac{\pi}{6}", Formula("sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("2"), Formula("2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle \frac{\pi}{3}", "\displaystyle \frac{\pi}{3}", Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("1/2"), Formula("sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("2"), Formula("sqrt(3)/3")], + ["\displaystyle \frac{2\pi}{3}", "\displaystyle \frac{2\pi}{3}", Formula("-1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("-2"), Formula("-sqrt(3)/3")], + ["\displaystyle \frac{5\pi}{6}", "\displaystyle \frac{5\pi}{6}", Formula("-sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("2"), Formula("-2*sqrt(3)/3"), Formula("-sqrt(3)")], + ["\displaystyle \frac{7\pi}{6}", "\displaystyle \frac{7\pi}{6}", Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("-2"), Formula("-2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle \frac{4\pi}{3}", "\displaystyle \frac{4\pi}{3}", Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("-2"), Formula("sqrt(3)/3")], + ["\displaystyle \frac{5\pi}{3}", "\displaystyle \frac{5\pi}{3}", Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("1/2"), Formula("-sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("2"), Formula("-sqrt(3)/3")], + ["\displaystyle \frac{11\pi}{6}", "\displaystyle \frac{11\pi}{6}", Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("-2"), Formula("2*sqrt(3)/3"), Formula("-sqrt(3)")], +); + +@perm = (); +do { + if (random(0,1,1)==0) { + $perm[0] = list_random(0,3,4,7); + $perm[1] = list_random(1,2,5,6); + } else { + $perm[1] = list_random(0,3,4,7); + $perm[0] = list_random(1,2,5,6); + } +} until ($problems[$perm[0]][2]*$problems[$perm[1]][2] < 0); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, $r/2,-0.4,0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, $r/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r/2,"pi/6",'red','left','bottom',large)); + $alt[0] .= " The number pi/6 is marked at (sqrt(3)/2, 1/2). The circle center (0,0), (sqrt(3)/2, 1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.6,0,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"60",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r*1/4, "1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, $r*1/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = ($r/2, $r*sqrt(3)/2, -0.4,0.4); + $graph[0]->stamps(closed_circle( $r/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r/2, $r*sqrt(3)/2, "pi/3",'red','left','bottom',large)); + $alt[0] .= " The number pi/3 is marked at (1/2, sqrt(3)/2). The circle center (0,0), (1/2, sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.9,"30",'red','right','top',large)); + $graph[0]->lb(new Label($r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*1/4, $r*sqrt(3)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, $r*sqrt(3)/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/2,"2pi/3",'red','right','bottom',large)); + $alt[0] .= " The number 2pi/3 is marked at (-1/2, sqrt(3)/2). The circle center (0,0), (-1/2, sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.9,"30",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*1/4, $r*sqrt(3)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, $r*1/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, $r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/2,"5pi/6",'red','right','bottom',large)); + $alt[0] .= " The number 5pi/6 is marked at (-sqrt(3)/2, 1/2). The circle center (0,0), (-sqrt(3)/2, 1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.6,0,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"60",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/4, "1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, $r*1/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==4) || ($perm[1]==4) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, -$r*1/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/2,"7pi/6",'red','right','top',large)); + $alt[0] .= " The number 7pi/6 is marked at (-sqrt(3)/2, -1/2). The circle center (0,0), (-sqrt(3)/2, -1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.6,0,"30",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/4, "-1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, -$r*1/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==5) || ($perm[1]==5) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, -$r*sqrt(3)/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/2,"4pi/3",'red','right','top',large)); + $alt[0] .= " The number 4pi/3 is marked at (-1/2, -sqrt(3)/2). The circle center (0,0), (-1/2, -sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.9,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*1/4, -$r*sqrt(3)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==6) || ($perm[1]==6) ) { + ($Px,$Py,$xShift,$yShift) = ($r*1/2, -$r*sqrt(3)/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/2, "5pi/3",'red','left','top',large)); + $alt[0] .= " The number 5pi/3 is marked at (1/2, -sqrt(3)/2). The circle center (0,0), (1/2, -sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.9,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*1/4, -$r*sqrt(3)/4, "1",'red','right','top',large)); +} +if ( ($perm[0]==7) || ($perm[1]==7) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, -$r*1/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/2, "11pi/6",'red','left','top',large)); + $alt[0] .= " The number 11pi/6 is marked at (sqrt(3)/2, -1/2). The circle center (0,0), (sqrt(3)/2, -1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.6,0,"30",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/4, "-1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, -$r*1/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Here are the locations of those two angles on the Unit Circle. Note that the triangles are 30-60-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues51.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues51.pg new file mode 100644 index 0000000000..9860012072 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues51.pg @@ -0,0 +1,383 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle 30^{\circ}", "\displaystyle 30^{\circ}", Formula("sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("2"), Formula("2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle 60^{\circ}", "\displaystyle 60^{\circ}", Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("1/2"), Formula("sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("2"), Formula("sqrt(3)/3")], + ["\displaystyle 120^{\circ}", "\displaystyle 120^{\circ}", Formula("-1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("-2"), Formula("-sqrt(3)/3")], + ["\displaystyle 150^{\circ}", "\displaystyle 150^{\circ}", Formula("-sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("2"), Formula("-2*sqrt(3)/3"), Formula("-sqrt(3)")], + ["\displaystyle 210^{\circ}", "\displaystyle 210^{\circ}", Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("-2"), Formula("-2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle 240^{\circ}", "\displaystyle 240^{\circ}", Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("-2"), Formula("sqrt(3)/3")], + ["\displaystyle 300^{\circ}", "\displaystyle 300^{\circ}", Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("1/2"), Formula("-sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("2"), Formula("-sqrt(3)/3")], + ["\displaystyle 330^{\circ}", "\displaystyle 330^{\circ}", Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("-2"), Formula("2*sqrt(3)/3"), Formula("-sqrt(3)")], +); + +@perm = (); +do { + if (random(0,1,1)==0) { + $perm[0] = list_random(0,3,4,7); + $perm[1] = list_random(1,2,5,6); + } else { + $perm[1] = list_random(0,3,4,7); + $perm[0] = list_random(1,2,5,6); + } +} until ($problems[$perm[0]][2]*$problems[$perm[1]][2] < 0); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-7.5,-7.5,7.5,7.5,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, $r/2,-0.4,0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, $r/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r/2,"30 degrees",'red','left','bottom',large)); + $alt[0] .= " 30 degrees is marked at (sqrt(3)/2, 1/2). The circle center (0,0), (sqrt(3)/2, 1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.8,0,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"60",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r*1/4, "1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, $r*1/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = ($r/2, $r*sqrt(3)/2, -0.4,0.4); + $graph[0]->stamps(closed_circle( $r/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r/2, $r*sqrt(3)/2, "60 degrees",'red','left','bottom',large)); + $alt[0] .= " 60 degrees is marked at (1/2, sqrt(3)/2). The circle center (0,0), (1/2, sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.9,"30",'red','right','top',large)); + $graph[0]->lb(new Label($r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*1/4, $r*sqrt(3)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, $r*sqrt(3)/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/2,"120 degrees",'red','right','bottom',large)); + $alt[0] .= " The number 120 degrees is marked at (-1/2, sqrt(3)/2). The circle center (0,0), (-1/2, sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.9,"30",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*1/4, $r*sqrt(3)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, $r*1/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, $r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/2,"150 degrees",'red','right','bottom',large)); + $alt[0] .= " 150 degrees is marked at (-sqrt(3)/2, 1/2). The circle center (0,0), (-sqrt(3)/2, 1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.8,0,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"60",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/4, "1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, $r*1/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==4) || ($perm[1]==4) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, -$r*1/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/2,"210 degrees",'red','right','top',large)); + $alt[0] .= " 210 degrees is marked at (-sqrt(3)/2, -1/2). The circle center (0,0), (-sqrt(3)/2, -1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.8,0,"30",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/4, "-1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, -$r*1/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==5) || ($perm[1]==5) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, -$r*sqrt(3)/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/2,"240 degrees",'red','right','top',large)); + $alt[0] .= " 240 degrees is marked at (-1/2, -sqrt(3)/2). The circle center (0,0), (-1/2, -sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.9,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*1/4, -$r*sqrt(3)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==6) || ($perm[1]==6) ) { + ($Px,$Py,$xShift,$yShift) = ($r*1/2, -$r*sqrt(3)/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/2, "300 degrees",'red','left','top',large)); + $alt[0] .= " 300 degrees is marked at (1/2, -sqrt(3)/2). The circle center (0,0), (1/2, -sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.9,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*1/4, -$r*sqrt(3)/4, "1",'red','right','top',large)); +} +if ( ($perm[0]==7) || ($perm[1]==7) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, -$r*1/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/2, "330 degrees",'red','left','top',large)); + $alt[0] .= " 330 degrees is marked at (sqrt(3)/2, -1/2). The circle center (0,0), (sqrt(3)/2, -1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.8,0,"30",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/4, "-1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, -$r*1/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Here are the locations of those two angles on the Unit Circle. Note that the triangles are 30-60-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues60.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues60.pg new file mode 100644 index 0000000000..30c4a7a183 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues60.pg @@ -0,0 +1,422 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..7) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + if ($i==0) { + $new[$i] = 12*$rounds[$i]+1; + } elsif ($i==1) { + $new[$i] = 6*$rounds[$i]+1; + } elsif ($i==2) { + $new[$i] = 6*$rounds[$i]+2; + } elsif ($i==3) { + $new[$i] = 12*$rounds[$i]+5; + } elsif ($i==4) { + $new[$i] = 12*$rounds[$i]+7; + } elsif ($i==5) { + $new[$i] = 6*$rounds[$i]+4; + } elsif ($i==6) { + $new[$i] = 6*$rounds[$i]+5; + } else { + $new[$i] = 12*$rounds[$i]+11; + } +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle \frac{$new[0] \pi}{6}", "\displaystyle \frac{\pi}{6}", Formula("sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("2"), Formula("2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle \frac{$new[1] \pi}{3}", "\displaystyle \frac{\pi}{3}", Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("1/2"), Formula("sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("2"), Formula("sqrt(3)/3")], + ["\displaystyle \frac{$new[2] \pi}{3}", "\displaystyle \frac{2\pi}{3}", Formula("-1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("-2"), Formula("-sqrt(3)/3")], + ["\displaystyle \frac{$new[3] \pi}{6}", "\displaystyle \frac{5\pi}{6}", Formula("-sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("2"), Formula("-2*sqrt(3)/3"), Formula("-sqrt(3)")], + ["\displaystyle \frac{$new[4] \pi}{6}", "\displaystyle \frac{7\pi}{6}", Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("-2"), Formula("-2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle \frac{$new[5] \pi}{3}", "\displaystyle \frac{4\pi}{3}", Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("-2"), Formula("sqrt(3)/3")], + ["\displaystyle \frac{$new[6] \pi}{3}", "\displaystyle \frac{5\pi}{3}", Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("1/2"), Formula("-sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("2"), Formula("-sqrt(3)/3")], + ["\displaystyle \frac{$new[7] \pi}{6}", "\displaystyle \frac{11\pi}{6}", Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("-2"), Formula("2*sqrt(3)/3"), Formula("-sqrt(3)")], +); + +@perm = (); +do { + if (random(0,1,1)==0) { + $perm[0] = list_random(0,3,4,7); + $perm[1] = list_random(1,2,5,6); + } else { + $perm[1] = list_random(0,3,4,7); + $perm[0] = list_random(1,2,5,6); + } +} until ($problems[$perm[0]][2]*$problems[$perm[1]][2] < 0); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, $r/2,-0.4,0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, $r/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r/2,"$new[0] pi/6",'red','left','bottom',large)); + $alt[0] .= " The number $new[0] pi/6 is marked at (sqrt(3)/2, 1/2). The circle center (0,0), (sqrt(3)/2, 1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.6,0,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"60",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r*1/4, "1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, $r*1/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = ($r/2, $r*sqrt(3)/2, -0.4,0.4); + $graph[0]->stamps(closed_circle( $r/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r/2, $r*sqrt(3)/2, "$new[1] pi/3",'red','left','bottom',large)); + $alt[0] .= " The number $new[1] pi/3 is marked at (1/2, sqrt(3)/2). The circle center (0,0), (1/2, sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.9,"30",'red','right','top',large)); + $graph[0]->lb(new Label($r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*1/4, $r*sqrt(3)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, $r*sqrt(3)/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/2,"$new[2] pi/3",'red','right','bottom',large)); + $alt[0] .= " The number $new[2] pi/3 is marked at (-1/2, sqrt(3)/2). The circle center (0,0), (-1/2, sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.9,"30",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*1/4, $r*sqrt(3)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, $r*1/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, $r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/2,"$new[3] pi/6",'red','right','bottom',large)); + $alt[0] .= " The number $new[3] pi/6 is marked at (-sqrt(3)/2, 1/2). The circle center (0,0), (-sqrt(3)/2, 1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.6,0,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"60",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/4, "1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, $r*1/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==4) || ($perm[1]==4) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, -$r*1/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/2,"$new[4] pi/6",'red','right','top',large)); + $alt[0] .= " The number $new[4] pi/6 is marked at (-sqrt(3)/2, -1/2). The circle center (0,0), (-sqrt(3)/2, -1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.6,0,"30",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/4, "-1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, -$r*1/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==5) || ($perm[1]==5) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, -$r*sqrt(3)/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/2,"$new[5] pi/3",'red','right','top',large)); + $alt[0] .= " The number $new[5] pi/3 is marked at (-1/2, -sqrt(3)/2). The circle center (0,0), (-1/2, -sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.9,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*1/4, -$r*sqrt(3)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==6) || ($perm[1]==6) ) { + ($Px,$Py,$xShift,$yShift) = ($r*1/2, -$r*sqrt(3)/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/2, "$new[6] pi/3",'red','left','top',large)); + $alt[0] .= " The number $new[6] pi/3 is marked at (1/2, -sqrt(3)/2). The circle center (0,0), (1/2, -sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.9,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*1/4, -$r*sqrt(3)/4, "1",'red','right','top',large)); +} +if ( ($perm[0]==7) || ($perm[1]==7) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, -$r*1/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/2, "$new[7] pi/6",'red','left','top',large)); + $alt[0] .= " The number $new[7] pi/6 is marked at (sqrt(3)/2, -1/2). The circle center (0,0), (sqrt(3)/2, -1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.6,0,"30",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/4, "-1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, -$r*1/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+2k\pi`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+2\cdot([$roundsN[$perm[0]]])\cdot\pi = [$problems[$perm[0]][1]]``] + +the angle [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+2\cdot([$roundsN[$perm[1]]])\cdot\pi = [$problems[$perm[1]][1]]``] + +the angle [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles. Note that the triangles are 30-60-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues61.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues61.pg new file mode 100644 index 0000000000..855ae74d2c --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues61.pg @@ -0,0 +1,422 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..7) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + if ($i==0) { + $new[$i] = (12*$rounds[$i]+1)*30; + } elsif ($i==1) { + $new[$i] = (6*$rounds[$i]+1)*60; + } elsif ($i==2) { + $new[$i] = (6*$rounds[$i]+2)*60; + } elsif ($i==3) { + $new[$i] = (12*$rounds[$i]+5)*30; + } elsif ($i==4) { + $new[$i] = (12*$rounds[$i]+7)*30; + } elsif ($i==5) { + $new[$i] = (6*$rounds[$i]+4)*60; + } elsif ($i==6) { + $new[$i] = (6*$rounds[$i]+5)*60; + } else { + $new[$i] = (12*$rounds[$i]+11)*30; + } +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle $new[0]^{\circ}", "\displaystyle 30^{\circ}", Formula("sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("2"), Formula("2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle $new[1]^{\circ}", "\displaystyle 60^{\circ}", Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("1/2"), Formula("sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("2"), Formula("sqrt(3)/3")], + ["\displaystyle $new[2]^{\circ}", "\displaystyle 120^{\circ}", Formula("-1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("-2"), Formula("-sqrt(3)/3")], + ["\displaystyle $new[3]^{\circ}", "\displaystyle 150^{\circ}", Formula("-sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("2"), Formula("-2*sqrt(3)/3"), Formula("-sqrt(3)")], + ["\displaystyle $new[4]^{\circ}", "\displaystyle 210^{\circ}", Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("-2"), Formula("-2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle $new[5]^{\circ}", "\displaystyle 240^{\circ}", Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("-2"), Formula("sqrt(3)/3")], + ["\displaystyle $new[6]^{\circ}", "\displaystyle 300^{\circ}", Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("1/2"), Formula("-sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("2"), Formula("-sqrt(3)/3")], + ["\displaystyle $new[7]^{\circ}", "\displaystyle 330^{\circ}", Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("-2"), Formula("2*sqrt(3)/3"), Formula("-sqrt(3)")], +); + +@perm = (); +do { + if (random(0,1,1)==0) { + $perm[0] = list_random(0,3,4,7); + $perm[1] = list_random(1,2,5,6); + } else { + $perm[1] = list_random(0,3,4,7); + $perm[0] = list_random(1,2,5,6); + } +} until ($problems[$perm[0]][2]*$problems[$perm[1]][2] < 0); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, $r/2,-0.4,0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, $r/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r/2,"$new[0] degrees",'red','left','bottom',large)); + $alt[0] .= " $new[0] degrees is marked at (sqrt(3)/2, 1/2). The circle center (0,0), (sqrt(3)/2, 1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.8,0,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"60",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r*1/4, "1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, $r*1/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = ($r/2, $r*sqrt(3)/2, -0.4,0.4); + $graph[0]->stamps(closed_circle( $r/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r/2, $r*sqrt(3)/2, "$new[1] degrees",'red','left','bottom',large)); + $alt[0] .= " $new[1] degrees is marked at (1/2, sqrt(3)/2). The circle center (0,0), (1/2, sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-1.1,"30",'red','right','top',large)); + $graph[0]->lb(new Label($r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*1/4, $r*sqrt(3)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, $r*sqrt(3)/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/2,"$new[2] degrees",'red','right','bottom',large)); + $alt[0] .= " $new[2] degrees is marked at (-1/2, sqrt(3)/2). The circle center (0,0), (-1/2, sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-1.1,"30",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*1/4, $r*sqrt(3)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, $r*1/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, $r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/2,"$new[3] degrees",'red','right','bottom',large)); + $alt[0] .= " $new[3] degrees is marked at (-sqrt(3)/2, 1/2). The circle center (0,0), (-sqrt(3)/2, 1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.8,0,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"60",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/4, "1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, $r*1/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==4) || ($perm[1]==4) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, -$r*1/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/2,"$new[4] degrees",'red','right','top',large)); + $alt[0] .= " $new[4] degrees is marked at (-sqrt(3)/2, -1/2). The circle center (0,0), (-sqrt(3)/2, -1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.8,0,"30",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/4, "-1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, -$r*1/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==5) || ($perm[1]==5) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, -$r*sqrt(3)/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/2,"$new[5] degrees",'red','right','top',large)); + $alt[0] .= " $new[5] degrees is marked at (-1/2, -sqrt(3)/2). The circle center (0,0), (-1/2, -sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+1.1,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*1/4, -$r*sqrt(3)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==6) || ($perm[1]==6) ) { + ($Px,$Py,$xShift,$yShift) = ($r*1/2, -$r*sqrt(3)/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/2, "$new[6] degrees",'red','left','top',large)); + $alt[0] .= " $new[6] degrees is marked at (1/2, -sqrt(3)/2). The circle center (0,0), (1/2, -sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+1.1,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*1/4, -$r*sqrt(3)/4, "1",'red','right','top',large)); +} +if ( ($perm[0]==7) || ($perm[1]==7) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, -$r*1/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/2, "$new[7] degrees",'red','left','top',large)); + $alt[0] .= " $new[7] degrees is marked at (sqrt(3)/2, -1/2). The circle center (0,0), (sqrt(3)/2, -1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.8,0,"30",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/4, "-1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, -$r*1/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+360k`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+([$roundsN[$perm[0]]])\cdot180^{\circ} = [$problems[$perm[0]][1]]``] + +the angle [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+([$roundsN[$perm[1]]])\cdot180^{\circ} = [$problems[$perm[1]][1]]``] + +the angle [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles. Note that the triangles are 30-60-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues70.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues70.pg new file mode 100644 index 0000000000..fdd75464d3 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues70.pg @@ -0,0 +1,255 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + Context("LimitedRadical"); + if (($numIn==0)||($numOut==0)) {return 0;} + + if ($d0==1) { + if ($numIn==1) {return Formula("$n0");} + elsif ($n0==1) {return Formula("sqrt($numIn)");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)");} + else {return Formula("$n0*sqrt($numIn)");} + } else { + if ($numIn==1) {return Formula("$n0/$d0");} + elsif ($n0==1) {return Formula("sqrt($numIn)/$d0");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)/$d0");} + else {return Formula("$n0*sqrt($numIn)/$d0");} + } +} + + +Context("LimitedRadical"); + +@angles = ( + #[displayed value, reference value, sin, cos, tan, csc, sec, cot] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + "\displaystyle 0", + "\displaystyle 0", + [Formula("0"), 0, 0, 1], + [Formula("1"), 1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("1"), 1, 1, 1], + ["DNE"] + ], + [ + "\displaystyle \frac{\pi}{6}", + "\displaystyle \frac{\pi}{6}", + [Formula("1/2"), 1, 1, 2], + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("sqrt(3)/3"), 1, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("sqrt(3)"), 1, 3, 1], + ], + [ + "\displaystyle \frac{\pi}{3}", + "\displaystyle \frac{\pi}{3}", + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("1/2"), 1, 1, 2], + [Formula("sqrt(3)"), 1, 3, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("sqrt(3)/3"), 1, 3, 3], + ], + [ + "\displaystyle \frac{\pi}{2}", + "\displaystyle \frac{\pi}{2}", + [Formula("1"), 1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("1"), 1, 1, 1], + ["DNE"], + [Formula("0"), 0, 0, 1], + ], + [ + "\displaystyle \frac{2\pi}{3}", + "\displaystyle \frac{2\pi}{3}", + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("-1/2"), -1, 1, 2], + [Formula("-sqrt(3)"), -1, 3, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("-sqrt(3)/3"), -1, 3, 3], + ], + [ + "\displaystyle \frac{5\pi}{6}", + "\displaystyle \frac{5\pi}{6}", + [Formula("1/2"), 1, 1, 2], + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("-sqrt(3)/3"), -1, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("-sqrt(3)"), -1, 3, 1], + ], + [ + "\displaystyle \pi", + "\displaystyle \pi", + [Formula("0"), 0, 0, 1], + [Formula("-1"), -1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("-1"), -1, 1, 1], + ["DNE"] + ], + [ + "\displaystyle \frac{7\pi}{6}", + "\displaystyle \frac{7\pi}{6}", + [Formula("-1/2"), -1, 1, 2], + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("sqrt(3)/3"), 1, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("sqrt(3)"), 1, 3, 1], + ], + [ + "\displaystyle \frac{4\pi}{3}", + "\displaystyle \frac{4\pi}{3}", + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("-1/2"), -1, 1, 2], + [Formula("sqrt(3)"), 1, 3, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("sqrt(3)/3"), 1, 3, 3], + ], + [ + "\displaystyle \frac{3\pi}{2}", + "\displaystyle \frac{3\pi}{2}", + [Formula("-1"), -1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("-1"), -1, 1, 1], + ["DNE"], + [Formula("0"), 0, 0, 1], + ], + [ + "\displaystyle \frac{5\pi}{3}", + "\displaystyle \frac{5\pi}{3}", + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("1/2"), 1, 1, 2], + [Formula("-sqrt(3)"), -1, 3, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("-sqrt(3)/3"), -1, 3, 3], + ], + [ + "\displaystyle \frac{11\pi}{6}", + "\displaystyle \frac{11\pi}{6}", + [Formula("-1/2"), -1, 1, 2], + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("-sqrt(3)/3"), -1, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("-sqrt(3)"), -1, 3, 1], + ], +); + +@funcs = ( + "", + "", + "\displaystyle \sin", + "\displaystyle \cos", + "\displaystyle \tan", + "\displaystyle \csc", + "\displaystyle \sec", + "\displaystyle \cot" +); + +do { + $angleInd0 = random(0,11,1); + $angleInd1 = random(0,11,1); + $funcInd0 = random(2,7,1); + $funcInd1 = random(2,7,1); +} until + ($funcInd0 != $funcInd1) && + ($angleInd0 != $angleInd1) && + ($angles[$angleInd0][$funcInd0][0] != "DNE") && + ($angles[$angleInd1][$funcInd1][0] != "DNE"); + +($numOut1, $numIn1, $den1) = ( + $angles[$angleInd0][$funcInd0][1]*$angles[$angleInd1][$funcInd1][1], + $angles[$angleInd0][$funcInd0][2]*$angles[$angleInd1][$funcInd1][2], + $angles[$angleInd0][$funcInd0][3]*$angles[$angleInd1][$funcInd1][3] +); + +if (sqrt($numIn1)==int(sqrt($numIn1))) { + $numOut1 *= sqrt($numIn1); + $numIn1 = 1; +} + +$value0 = &createRadical($angles[$angleInd0][$funcInd0][1],$angles[$angleInd0][$funcInd0][2],$angles[$angleInd0][$funcInd0][3]); + +$value1 = &createRadical($angles[$angleInd1][$funcInd1][1],$angles[$angleInd1][$funcInd1][2],$angles[$angleInd1][$funcInd1][3]); + +$ans = &createRadical($numOut1, $numIn1, $den1); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +Without using a calculator, calculate the expression with your knowledge about the Unit Circle. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + + [`` [$funcs[$funcInd0]]\left([$angles[$angleInd0][0]]\right) \cdot [$funcs[$funcInd1]]\left([$angles[$angleInd1][0]]\right) = ``][_________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$funcs[$funcInd0]]\left([$angles[$angleInd0][0]]\right) \cdot [$funcs[$funcInd1]]\left([$angles[$angleInd1][0]]\right) + &= \left([$value0]\right)\cdot\left([$value1]\right) \\ + &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues71.pg b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues71.pg new file mode 100644 index 0000000000..eb5c30fd92 --- /dev/null +++ b/Contrib/PCC/Trigonometry/UnitCircle/UnitCircleValues71.pg @@ -0,0 +1,290 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + Context("LimitedRadical"); + if (($numIn==0)||($numOut==0)) {return 0;} + + if ($d0==1) { + if ($numIn==1) {return Formula("$n0");} + elsif ($n0==1) {return Formula("sqrt($numIn)");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)");} + else {return Formula("$n0*sqrt($numIn)");} + } else { + if ($numIn==1) {return Formula("$n0/$d0");} + elsif ($n0==1) {return Formula("sqrt($numIn)/$d0");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)/$d0");} + else {return Formula("$n0*sqrt($numIn)/$d0");} + } +} + + +Context("LimitedRadical"); + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..11) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + if ( ($i==0) || ($i==6) ) { + $new[$i] = 2*$rounds[$i] + $i/6; + } elsif ( ($i==1) || ($i==5) || ($i==7) || ($i==11) ) { + $new[$i] = 12*$rounds[$i]+$i; + } elsif ( ($i==2) || ($i==4) || ($i==8) || ($i==10) ) { + $new[$i] = 6*$rounds[$i]+$i/2; + } else { #( ($i==3) || ($i==9) ) + $new[$i] = 4*$rounds[$i]+$i/3; + } +} + +@angles = ( + #[displayed value, reference value, sin, cos, tan, csc, sec, cot] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + "\displaystyle $new[0]\pi", + "\displaystyle 0", + [Formula("0"), 0, 0, 1], + [Formula("1"), 1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("1"), 1, 1, 1], + ["DNE"] + ], + [ + "\displaystyle \frac{$new[1]\pi}{6}", + "\displaystyle \frac{\pi}{6}", + [Formula("1/2"), 1, 1, 2], + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("sqrt(3)/3"), 1, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("sqrt(3)"), 1, 3, 1], + ], + [ + "\displaystyle \frac{$new[2]\pi}{3}", + "\displaystyle \frac{\pi}{3}", + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("1/2"), 1, 1, 2], + [Formula("sqrt(3)"), 1, 3, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("sqrt(3)/3"), 1, 3, 3], + ], + [ + "\displaystyle \frac{$new[3]\pi}{2}", + "\displaystyle \frac{\pi}{2}", + [Formula("1"), 1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("1"), 1, 1, 1], + ["DNE"], + [Formula("0"), 0, 0, 1], + ], + [ + "\displaystyle \frac{$new[4]\pi}{3}", + "\displaystyle \frac{2\pi}{3}", + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("-1/2"), -1, 1, 2], + [Formula("-sqrt(3)"), -1, 3, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("-sqrt(3)/3"), -1, 3, 3], + ], + [ + "\displaystyle \frac{$new[5]\pi}{6}", + "\displaystyle \frac{5\pi}{6}", + [Formula("1/2"), 1, 1, 2], + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("-sqrt(3)/3"), -1, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("-sqrt(3)"), -1, 3, 1], + ], + [ + "\displaystyle $new[6]\pi", + "\displaystyle \pi", + [Formula("0"), 0, 0, 1], + [Formula("-1"), -1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("-1"), -1, 1, 1], + ["DNE"] + ], + [ + "\displaystyle \frac{$new[7]\pi}{6}", + "\displaystyle \frac{7\pi}{6}", + [Formula("-1/2"), -1, 1, 2], + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("sqrt(3)/3"), 1, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("sqrt(3)"), 1, 3, 1], + ], + [ + "\displaystyle \frac{$new[8]\pi}{3}", + "\displaystyle \frac{4\pi}{3}", + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("-1/2"), -1, 1, 2], + [Formula("sqrt(3)"), 1, 3, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("sqrt(3)/3"), 1, 3, 3], + ], + [ + "\displaystyle \frac{$new[9]\pi}{2}", + "\displaystyle \frac{3\pi}{2}", + [Formula("-1"), -1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("-1"), -1, 1, 1], + ["DNE"], + [Formula("0"), 0, 0, 1], + ], + [ + "\displaystyle \frac{$new[10] \pi}{3}", + "\displaystyle \frac{5\pi}{3}", + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("1/2"), 1, 1, 2], + [Formula("-sqrt(3)"), -1, 3, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("-sqrt(3)/3"), -1, 3, 3], + ], + [ + "\displaystyle \frac{$new[11] \pi}{6}", + "\displaystyle \frac{11\pi}{6}", + [Formula("-1/2"), -1, 1, 2], + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("-sqrt(3)/3"), -1, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("-sqrt(3)"), -1, 3, 1], + ], +); + +@funcs = ( + "", + "", + "\displaystyle \sin", + "\displaystyle \cos", + "\displaystyle \tan", + "\displaystyle \csc", + "\displaystyle \sec", + "\displaystyle \cot" +); + +do { + $angleInd0 = random(0,11,1); + $angleInd1 = random(0,11,1); + $funcInd0 = random(2,7,1); + $funcInd1 = random(2,7,1); +} until + ($funcInd0 != $funcInd1) && + ($angleInd0 != $angleInd1) && + ($angles[$angleInd0][$funcInd0][0] != "DNE") && + ($angles[$angleInd1][$funcInd1][0] != "DNE"); + +($numOut1, $numIn1, $den1) = ( + $angles[$angleInd0][$funcInd0][1]*$angles[$angleInd1][$funcInd1][1], + $angles[$angleInd0][$funcInd0][2]*$angles[$angleInd1][$funcInd1][2], + $angles[$angleInd0][$funcInd0][3]*$angles[$angleInd1][$funcInd1][3] +); + +if (sqrt($numIn1)==int(sqrt($numIn1))) { + $numOut1 *= sqrt($numIn1); + $numIn1 = 1; +} + +$value0 = &createRadical($angles[$angleInd0][$funcInd0][1],$angles[$angleInd0][$funcInd0][2],$angles[$angleInd0][$funcInd0][3]); + +$value1 = &createRadical($angles[$angleInd1][$funcInd1][1],$angles[$angleInd1][$funcInd1][2],$angles[$angleInd1][$funcInd1][3]); + +$ans = &createRadical($numOut1, $numIn1, $den1); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +Without using a calculator, calculate the expression with your knowledge about the Unit Circle. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + + + [`` [$funcs[$funcInd0]]\left([$angles[$angleInd0][0]]\right) \cdot [$funcs[$funcInd1]]\left([$angles[$angleInd1][0]]\right) = ``][_________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+2k\pi`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$funcs[$funcInd0]]\left([$angles[$angleInd0][0]]\right)`], since + + [`` [$angles[$angleInd0][0]]+2\cdot([$roundsN[$angleInd0]])\cdot\pi = [$angles[$angleInd0][1]]``] + +the angles [`[$angles[$angleInd0][0]]`] and [`[$angles[$angleInd0][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$funcs[$funcInd1]]\left([$angles[$angleInd1][0]]\right)`], since + + [`` [$angles[$angleInd1][0]]+2\cdot([$roundsN[$angleInd1]])\cdot\pi = [$angles[$angleInd1][1]]``] + +the angles [`[$angles[$angleInd1][0]]`] and [`[$angles[$angleInd1][1]]`] are coterminal, and have the same trigonometry values. + +So we have: + + [``\begin{aligned} + [$funcs[$funcInd0]]\left([$angles[$angleInd0][0]]\right) \cdot [$funcs[$funcInd1]]\left([$angles[$angleInd1][0]]\right) + &= [$funcs[$funcInd0]]\left([$angles[$angleInd0][1]]\right) \cdot [$funcs[$funcInd1]]\left([$angles[$angleInd1][1]]\right) \\ + &= \left([$value0]\right)\cdot\left([$value1]\right) \\ + &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/DotProduct10.pg b/Contrib/PCC/Trigonometry/Vectors/DotProduct10.pg new file mode 100644 index 0000000000..70cb18cd18 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/DotProduct10.pg @@ -0,0 +1,158 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("Fraction"); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@num = (); +@den = (); +@angle = (); + +do { + for my $i (0..1) { + do { + $den[$i] = list_random(3,4,6); + $num[$i] = random(1,2*$den[$i]-1,1); + } until gcd($num[$i],$den[$i])==1; + $angle[$i] = specialAngle($num[$i]*pi/$den[$i]); + } + $angle[2] = specialAngle(abs(Compute($angle[0])-Compute($angle[1])),(1,2,3,4,6,12)); + $angle[3] = specialAngle(abs(Compute($angle[0])-Compute($angle[1]))); +} until + Compute($angle[2]) == Compute($angle[3]) + && Compute($angle[2]) < pi + && Compute($angle[2]) > 0 + && Compute($angle[2]) != Compute(pi/2); + +@r = (); +do { + $r[0] = random(1,5,1)*6; + $r[1] = random(1,5,1)*6; +} until $r[0] != $r[1]; + +@Px = (); @Py = (); @v = (); +for my $i (0..1) { + $Px[$i] = specialRadical($r[$i]*cos(Compute($angle[$i]))); + $Py[$i] = specialRadical($r[$i]*sin(Compute($angle[$i]))); + Context()->variables->are( + i=>['Real','TeX'=>'\mathbf{i}'], + j=>['Real','TeX'=>'\mathbf{j}'], + ); + if ($Py[$i]>0) { + $v[$i] = Formula("$Px[$i]*i+$Py[$i]*j"); + } else { + my $a = specialRadical(-$r[$i]*sin(Compute($angle[$i]))); + Context()->variables->are( + i=>['Real','TeX'=>'\mathbf{i}'], + j=>['Real','TeX'=>'\mathbf{j}'], + ); + $v[$i] = Formula("$Px[$i]*i-$a*j"); + } +} +$pro0 = specialRadical(Compute($Px[0])*Compute($Px[1])); +$pro1 = specialRadical(Compute($Py[0])*Compute($Py[1])); +$dot = specialRadical(Compute($pro0+$pro1)); + +###################### +# Main text + +BEGIN_PGML + +a) If [`u=[$v[0]]`] and [`v=[$v[1]]`], find their dot product. + + [`u\cdot v=`][______________]{$dot} + +b) Find the measure of the angle, [`\theta`], between those two vectors. + + [`\theta=`][_________________]{$angle[2]} + +END_PGML + + +######################## + +$Px0r = Compute($Px[0]); +$Py0r = Compute($Py[0]); +$Px1r = Compute($Px[1]); +$Py1r = Compute($Py[1]); +$s1 = specialRadical(sqrt(($Px0r)**2+($Py0r)**2)*sqrt(($Px1r)**2+($Py1r)**2)); + +BEGIN_PGML_SOLUTION + +###Part a + +For [`u=`] and [`v=`], their product can be calculated by the formula + + [`` u\cdot v= ac+bd ``] + +We have: + + [``\begin{aligned} + u\cdot v &= ([$Px[0]])([$Px[1]])+([$Py[0]])([$Py[1]]) \\ + &= [$pro0]+([$pro1]) \\ + &= [$dot] + \end{aligned}``] + +###Part b + +To find the angle between [`u`] and [`v`], use the formula + + [`` \theta = \cos^{-1}\left( \frac{u\cdot v}{|u||v|}\right) ``] + +We have: + + [``\begin{aligned} + \theta &= \cos^{-1}\left( \frac{u\cdot v}{|u||v|}\right) \\ + &= \cos^{-1}\left( \frac{[$dot]}{\sqrt{([$Px[0]])^2+([$Py[0]])^2}\cdot \sqrt{([$Px[1]])^2+([$Py[1]])^2}} \right) \\ + &= \cos^{-1}\left( \frac{[$dot]}{[$s1]} \right) \\ + &= [$angle[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/DotProduct20.pg b/Contrib/PCC/Trigonometry/Vectors/DotProduct20.pg new file mode 100644 index 0000000000..5c29afbf2b --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/DotProduct20.pg @@ -0,0 +1,159 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# + + + +Context("Fraction"); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@num = (); +@den = (); +@angle = (); + +do { + for my $i (0..1) { + do { + $den[$i] = list_random(3,4,6); + $num[$i] = random(1,2*$den[$i]-1,1); + } until gcd($num[$i],$den[$i])==1; + $angle[$i] = specialAngle($num[$i]*pi/$den[$i]); + } + $angle[2] = specialAngle(abs(Compute($angle[0])-Compute($angle[1])),(1,2,3,4,6,12)); + $angle[3] = specialAngle(abs(Compute($angle[0])-Compute($angle[1]))); +} until + Compute($angle[2]) == Compute($angle[3]) + &&( Compute($angle[2]) == 0 + || Compute($angle[2]) == Compute(pi/2) + || Compute($angle[2]) == Compute(pi) ); + +@r = (); +do { + $r[0] = random(1,5,1)*6; + $r[1] = random(1,5,1)*6; +} until $r[0] != $r[1]; + +@Px = (); @Py = (); @v = (); +for my $i (0..1) { + $Px[$i] = specialRadical($r[$i]*cos(Compute($angle[$i]))); + $Py[$i] = specialRadical($r[$i]*sin(Compute($angle[$i]))); + Context()->variables->are( + i=>['Real','TeX'=>'\mathbf{i}'], + j=>['Real','TeX'=>'\mathbf{j}'], + ); + if ($Py[$i]>0) { + $v[$i] = Formula("$Px[$i]*i+$Py[$i]*j"); + } else { + my $a = specialRadical(-$r[$i]*sin(Compute($angle[$i]))); + Context()->variables->are( + i=>['Real','TeX'=>'\mathbf{i}'], + j=>['Real','TeX'=>'\mathbf{j}'], + ); + $v[$i] = Formula("$Px[$i]*i-$a*j"); + } +} +$pro0 = specialRadical(Compute($Px[0])*Compute($Px[1])); +$pro1 = specialRadical(Compute($Py[0])*Compute($Py[1])); +$dot = specialRadical(Compute($pro0+$pro1)); + +###################### +# Main text + +BEGIN_PGML + +a) If [`u=[$v[0]]`] and [`v=[$v[1]]`], find their dot product. + + [`u\cdot v=`][______________]{$dot} + +b) Find the measure of the angle, [`\theta`], between those two vectors. + + [`\theta=`][_________________]{$angle[2]} + +END_PGML + + +######################## + +$Px0r = Compute($Px[0]); +$Py0r = Compute($Py[0]); +$Px1r = Compute($Px[1]); +$Py1r = Compute($Py[1]); +$s1 = specialRadical(sqrt(($Px0r)**2+($Py0r)**2)*sqrt(($Px1r)**2+($Py1r)**2)); + +BEGIN_PGML_SOLUTION + +###Part a + +For [`u=`] and [`v=`], their product can be calculated by the formula + + [`` u\cdot v= ac+bd ``] + +We have: + + [``\begin{aligned} + u\cdot v &= ([$Px[0]])([$Px[1]])+([$Py[0]])([$Py[1]]) \\ + &= [$pro0]+([$pro1]) \\ + &= [$dot] + \end{aligned}``] + +###Part b + +To find the angle between [`u`] and [`v`], use the formula + + [`` \theta = \cos^{-1}\left( \frac{u\cdot v}{|u||v|}\right) ``] + +We have: + + [``\begin{aligned} + \theta &= \cos^{-1}\left( \frac{u\cdot v}{|u||v|}\right) \\ + &= \cos^{-1}\left( \frac{[$dot]}{\sqrt{([$Px[0]])^2+([$Py[0]])^2}\cdot \sqrt{([$Px[1]])^2+([$Py[1]])^2}} \right) \\ + &= \cos^{-1}\left( \frac{[$dot]}{[$s1]} \right) \\ + &= [$angle[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/UnitVector10.pg b/Contrib/PCC/Trigonometry/Vectors/UnitVector10.pg new file mode 100644 index 0000000000..93c4042b84 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/UnitVector10.pg @@ -0,0 +1,107 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("Fraction"); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->variables->are( +i=>['Real','TeX'=>'\mathbf{i}'], +j=>['Real','TeX'=>'\mathbf{j}'], +); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$m = random(1,10,1); + +$Vx = $m*$triples[$in][0]*random(-1,1,2); +$Vy = $m*$triples[$in][1]*random(-1,1,2); +if (random(0,1,1)==0) {($Vx,$Vy)=($Vy,$Vx);} +$V = Formula("$Vx*i+$Vy*j")->reduce; +$mag = $m*$triples[$in][2]; + +$Ux = Fraction($Vx,$mag)->reduce; +$Uy = Fraction($Vy,$mag)->reduce; +$U = Formula("$Ux*i+$Uy*j"); + +###################### +# Main text + +BEGIN_PGML + +The unit vector in the direction of vector [`v=[$V]`] is: + +[@KeyboardInstructions( +"\n" +.'* Enter vectors in terms of [`i`] and [`j`].' +."\n" +.'* Use fractions in your answer.' +)@]** + + [_________________]{$U} + +END_PGML + + +######################## + +BEGIN_PGML_SOLUTION + +The unit vector of [`v`], call it [`u`], can be calculated by the formula + + [`` u=\frac{v}{|v|} ``] + +We have: + + [``\begin{aligned} + u &= \frac{v}{|v|} \\ + &= \frac{[$V]}{\sqrt{([$Vx])^2+([$Vy])^2}} \\ + &= \frac{[$V]}{[$mag]} \\ + &= [$U] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorBasics10.pg b/Contrib/PCC/Trigonometry/Vectors/VectorBasics10.pg new file mode 100644 index 0000000000..f73060fbe4 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorBasics10.pg @@ -0,0 +1,144 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +#Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "PGgraphmacros.pl", + "contextLimitedVector.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + +$refreshCachedImages = 1; + +############################# +# Setup + +Context("LimitedVector-coordinate")->variables->are(x=>'Real',y=>'Real'); +Context()->flags->set( ijk=>0 ); + +($Ax,$Ay) = (random(-5,5,1), random(-5,5,1)); +do { + ($Bx,$By) = (random(-5,5,1), random(-5,5,1)); +} until ($Bx != $Ax && $By != $Ay); +$A = Point($Ax,$Ay); +$B = Point($Bx,$By); +$OA = Vector("<$Ax,$Ay>")->reduce; +$OB = Vector("<$Bx,$By>")->reduce; +$AB = Vector("<$Bx - $Ax,$By - $Ay>")->reduce; + +################################ +# Begin construct graph & grid + +$pixels = 300; + +# +# Graph canvas +# +$gr = init_graph(-7,-7,7,7,axes=>[0,0],size=>[$pixels,$pixels]); +$gr -> lb('reset'); + +# manually draw the grid +foreach my $i (-6..6) { + $gr->moveTo($i,-7); + $gr->lineTo($i,7,'gray',1); + $gr->moveTo(-7,$i); + $gr->lineTo(7,$i,'gray',1); +} + + +# +# Graph labels and functions +# +$gr -> lb(new Label ( 6.5,0,'x','black','left','bottom')); +$gr -> lb(new Label ( 0.25,6.5,'y','black','left','bottom')); + +foreach my $i (1..6) { + $gr -> lb(new Label ( $i,-0.5, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.5,-$i,'black','center','middle')); + $gr -> lb(new Label (-0.5, $i, $i,'black','center','middle')); + $gr -> lb(new Label (-0.5,-$i,-$i,'black','center','middle')); +} + +# vector +$gr->moveTo($Ax,$Ay); +$gr->arrowTo($Bx,$By,'blue',3); + +# stamps and labels for vector +$gr -> stamps( closed_circle($Ax,$Ay,'black') ); +$gr -> stamps( closed_circle($Bx,$By,'black') ); +$gr -> lb(new Label ($Ax+0.5,$Ay+0.5,'A','black','center','middle')); +$gr -> lb(new Label ($Bx+0.5,$By+0.5,'B','black','center','middle')); + +$alt = "In a coordinate system, Point A is at ($Ax,$Ay), Point B is at ($Bx,$By). A vector starts at A and ends at B."; + +$fig = image(insertGraph($gr), width=>$pixels, height=>$pixels, tex_size=>700,extra_html_tags => "alt = '$alt' title = '$alt' " ); + +# End construct graph & grid +############################# + + + + + +###################### +# Main text + +BEGIN_PGML + +[@KeyboardInstructions( +"\n".'* Use the format [``] to enter vectors.' +)@]** + +By the graph, [`\overrightarrow{AB} =`][_____________]{$AB} + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +END_PGML + + +######################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + \overrightarrow{AB} &= \overrightarrow{OB} - \overrightarrow{OA} \\ + &= [$OB]-[$OA] \\ + &= [$AB] + \end{aligned}``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorBasics20.pg b/Contrib/PCC/Trigonometry/Vectors/VectorBasics20.pg new file mode 100644 index 0000000000..0098654813 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorBasics20.pg @@ -0,0 +1,108 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## MLT(GiveTwoPointsForVec) +## MLTleader(1) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('11') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "parserMultiAnswer.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("Vector2D"); +Context()->flags->set( ijk=>0 ); + +$A = non_zero_point2D(-9,9,1); +do { $B = non_zero_point2D(-9,9,1); } until ($A != $B); +$AB = Vector($B - $A); + +($a,$b) = $AB->value; + +$multians = MultiAnswer($A, $B)->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $Astu, $Bstu ) = @{$student}; + my ( $Acor, $Bcor ) = @{$correct}; + if ( $Astu == Point(0,0) || $Bstu == Point(0,0) ) { + return 0; + } + if ( Vector($Bstu - $Astu) == $AB ) { + return 1; + } else { + return 0; + } + } +); + + +###################### +# Main text + +BEGIN_PGML + +Find a representation of the vector [` \overrightarrow{AB} = [$AB] `] by giving appropriate values for the points [`A`] and [`B`] such that neither [`A`] nor [`B`] is the origin. + +[@KeyboardInstructions( +"\n".'* Enter points, like [`(0,1)`]' +)@]** + + [`A =`][__________________]{$multians} + + [`B =`][__________________]{$multians} + +END_PGML + + +######################## + +BEGIN_PGML_SOLUTION + +If [`A`] is at [`(0,0)`], then B would be at [`([$a],[$b])`]. + +Since we cannot use [`(0,0)`] for [`A`], we can simply add the same number to either [`x`] or [`y`] values of those two points. For example: + + [``\begin{aligned} + &A(0,0+1)\text{ and }B([$a],[$b]+1) \\ + &A(0+1,0)\text{ and }B([$a]+1,[$b]) \\ + &A(0+1,0+1)\text{ and }B([$a]+1,[$b]+1) \\ + ... + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorBasics30.pg b/Contrib/PCC/Trigonometry/Vectors/VectorBasics30.pg new file mode 100644 index 0000000000..fe40e81c61 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorBasics30.pg @@ -0,0 +1,172 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserOneOf.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$den = list_random(3,4,6); +do {$num = random(1,2*$den-1,1);} until gcd($num,$den)==1; +$num = $num*random(-1,1,2); +$angle = specialAngle($num*pi/$den); +if ($angle>0) {$angle1 = specialAngle($num*pi/$den-2*pi);} + else {$angle1 = specialAngle($num*pi/$den+2*pi);} +$ansAngle = OneOf($angle,$angle1); + +$m = random(1,10,1); +$mag = ($den==4) ? Formula("$m*sqrt(2)") : Formula("2*$m")->reduce; +$Vx = specialRadical(Compute($mag)*cos(Compute($angle))); +$Vy = specialRadical(Compute($mag)*sin(Compute($angle))); + +if ($Vx>0) { + $Q = ($Vy>0) ? "I" : "IV"; +} else { + $Q = ($Vy>0) ? "II" : "III"; +} + +$r = 5; +($xmin,$xmax) = (-8,8); +($ymin,$ymax) = (-8,8); +$graph = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$Px = $r*cos(Compute($angle)); +$Py = $r*sin(Compute($angle)); + +$graph->moveTo(0,0); +$graph->arrowTo($Px,$Py,'red',2); +$graph->lineTo($Px,0,'red',2); +$graph->lineTo(0,0,'red',2); + +$ud = $Py>0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px, $Py,"$angle or $angle1",'red','center',$ud,large)); +$lr = $Px>0 ? 'left' : 'right'; +$graph->lb(new Label($Px, $Py/2, "$Vy",'red',$lr,'middle',large)); +$ud = $Py>0 ? 'top' : 'bottom'; +$graph->lb(new Label($Px/2, 0, "$Vx",'red','center',$ud,large)); +$lr = $Px>0 ? 'right' : 'left'; +$ud = $Py>0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px/2, $Py/2, "$mag",'red',$lr,$ud,large)); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$alt = "This is a circle with a vector starting at the origin, and ending at a point on the circle, marked as $angle or $angle1. From this point, a vertical line is drawn toward the x-axis. The intersection, the point and the origin form a right triangle. Its base is marked as $Vx, and its height is marked as $Vy. The vector's magnitude is marked as $mag."; + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +############################################## + +BEGIN_PGML + +It's given that vector [`v=<[$Vx],[$Vy]>`]. Answer the following questions. + +[@KeyboardInstructions( +"\n" +.'* Use [|pi|]* to input [`\pi`].' +."\n" +.'* Use fractions in your answers if needed.' +)@]** + +a) The vector's magnitude is [`|v|=`][__________]{$mag}. + +b) The vector's direction, in radians, is [_________________]{$ansAngle}. + +END_PGML + +############################################## + +$s1 = specialRadical(tan(Compute($angle))); +$s2 = specialAngle(arctan(Compute($s1))); +$s3 = specialAngle(Compute($s2)+pi); + +BEGIN_PGML_SOLUTION + +###Part a + +The magnitude of vector [`v=`] can be calculated by the formula + + [``|v|=\sqrt{x^2+y^2}``] + +In this problem, the magnitude of can be calculated by: + + [``\begin{aligned} + |v| &= \sqrt{([$Vx])^2+([$Vy])^2} \\ + &= [$mag] + \end{aligned}``] + +###Part b + +The direction of vector [`v=`], [`\theta`], can be calculated by the formula + + [`` \tan(\theta) = \frac{y}{x} ``] + +In this problem, we have: + + [``\begin{aligned} + \tan(\theta) &= \frac{[$Vy]}{[$Vx]} \\ + \tan(\theta) &= [$s1] \\ + \theta &= \tan^{-1}\left([$s1]\right) \\ + \theta &= [$s2] + \end{aligned}``] + +Recall that the range of [`y=\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], so there are two possible angles which make [`\tan(\theta) = [$s1]`] true: + + [`` \theta = [$s2]\text{ or }\theta = [$s2]+\pi=[$s3] ``] + +Since the given vector [`v=<[$Vx],[$Vy]>`] is in Quadrant [$Q], the vector's direction is [`[$ansAngle]`] (actually [`[$angle]+2k\pi`]). + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorBasics40.pg b/Contrib/PCC/Trigonometry/Vectors/VectorBasics40.pg new file mode 100644 index 0000000000..b114e0fab2 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorBasics40.pg @@ -0,0 +1,181 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserOneOf.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$m = random(1,10,1); + +$Vx = $m*$triples[$in][0]*random(-1,1,2); +$Vy = $m*$triples[$in][1]*random(-1,1,2); +$mag = $m*$triples[$in][2]; +if (random(0,1,1)==0) {($Vx,$Vy)=($Vy,$Vx);} + +if ($Vx>0) { + $Q = ($Vy>0) ? "I" : "IV"; +} else { + $Q = ($Vy>0) ? "II" : "III"; +} + +$invTan = arctan($Vy/$Vx); +if ($Vx>0) { + $angle0 = $invTan; + $angle1 = ($angle0>0) ? $angle0-2*pi : $angle0+2*pi; +} else { + $angle0 = $invTan+pi; + $angle1 = $angle0-2*pi; +} +$ansAngle = OneOf($angle0,$angle1); +$angle0Show = Round($angle0,2); +$angle1Show = Round($angle1,2); + +$r = 5; +($xmin,$xmax) = (-8,8); +($ymin,$ymax) = (-8,8); +$graph = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$Px = $r*cos($angle0); +$Py = $r*sin($angle0); + +$graph->moveTo(0,0); +$graph->arrowTo($Px,$Py,'red',2); +$graph->lineTo($Px,0,'red',2); +$graph->lineTo(0,0,'red',2); + +$ud = $Py>0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px, $Py,"$angle0Show or $angle1Show",'red','center',$ud,large)); +$lr = $Px>0 ? 'left' : 'right'; +$graph->lb(new Label($Px, $Py/2, "$Vy",'red',$lr,'middle',large)); +$ud = $Py>0 ? 'top' : 'bottom'; +$graph->lb(new Label($Px/2, 0, "$Vx",'red','center',$ud,large)); +$lr = $Px>0 ? 'right' : 'left'; +$ud = $Py>0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px/2, $Py/2, "$mag",'red',$lr,$ud,large)); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$alt = "This is a circle with a vector starting at the origin, and ending at a point on the circle, marked as $angle0Show or $angle1Show. From this point, a vertical line is drawn toward the x-axis. The intersection, the point and the origin form a right triangle. Its base is marked as $Vx, and its height is marked as $Vy. The vector's magnitude is marked as $mag."; + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +############################################## + +BEGIN_PGML + +It's given that vector [`v=<[$Vx],[$Vy]>`]. Answer the following questions. + +[@KeyboardInstructions( +"\n" +.'* Use decimals in your answers if needed.' +)@]** + +a) The vector's magnitude is [`|v|=`][__________]{$mag}. + +b) The vector's direction, in radians, is [_________________]{$ansAngle}. + +END_PGML + +############################################## + +$s1 = Round($invTan+pi,4); +$invTanShow = Round($invTan,4); +$angle0Show = Round($angle0,4); +$angle1Show = Round($angle1,4); + +BEGIN_PGML_SOLUTION + +###Part a + +The magnitude of vector [`v=`] can be calculated by the formula + + [``|v|=\sqrt{x^2+y^2}``] + +In this problem, the magnitude of can be calculated by: + + [``\begin{aligned} + |v| &= \sqrt{([$Vx])^2+([$Vy])^2} \\ + &= [$mag] + \end{aligned}``] + +###Part b + +The direction of vector [`v=`], [`\theta`], can be calculated by the formula + + [`` \tan(\theta) = \frac{y}{x} ``] + +In this problem, we have: + + [``\begin{aligned} + \tan(\theta) &= \frac{[$Vy]}{[$Vx]} \\ + \theta &= \tan^{-1}\left(\frac{[$Vy]}{[$Vx]}\right) \\ + \theta &= [$invTan] + \end{aligned}``] + +Recall that the range of [`y=\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], so there are two possible angles which make [`\tan(\theta) = \frac{[$Vy]}{[$Vx]}`] true: + + [`` \theta = [$invTanShow]\text{ or }\theta = [$invTanShow]+\pi=[$s1] ``] + +Since the given vector [`v=<[$Vx],[$Vy]>`] is in Quadrant [$Q], the vector's direction is [`[$angle0Show]`] or [`[$angle1Show]`] (actually [`[$angle0Show]+2k\pi`]). + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorBasics50.pg b/Contrib/PCC/Trigonometry/Vectors/VectorBasics50.pg new file mode 100644 index 0000000000..46b57b40d3 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorBasics50.pg @@ -0,0 +1,133 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "PGML.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGchoicemacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("Vector2D"); +Context()->flags->set( ijk=>0 ); + +@Ax=(); @Ay=(); +@Bx=(); @By=(); +@V=(); + +do { + $Ax[0] = non_zero_random(-10,10,1); + $Ay[0] = non_zero_random(-10,10,1); + $Bx[0] = non_zero_random(-10,10,1); + $By[0] = non_zero_random(-10,10,1); + $V[0] = Vector($Bx[0]-$Ax[0],$By[0]-$Ay[0]); +} until $Bx[0]-$Ax[0]!=0 || $By[0]-$Ay[0]!=0; + +do { + for my $i (1..2) { + $xd = non_zero_random(-10,10,1); + do {$yd = non_zero_random(-10,10,1);} until ($xd != $yd); + $Ax[$i] = $Ax[0]+$xd; + $Bx[$i] = $Bx[0]+$xd; + $Ay[$i] = $Ay[0]+$yd; + $By[$i] = $By[0]+$yd; + $V[$i] = Vector($Bx[$i]-$Ax[$i],$By[$i]-$Ay[$i]); + } +} until ($Ax[1] != $Ax[2] || $Ay[1] != $Ay[2]); + +for my $i (3..4) { + $xd = non_zero_random(-10,10,1); + do {$yd = non_zero_random(-10,10,1);} until ($xd != $yd); + $Ax[$i] = $Ax[0]+$xd; + $Bx[$i] = $Bx[0]+$xd; + $Ay[$i] = $Ay[0]+$yd; + $By[$i] = $By[0]+$yd; +} +$Bx[3]++; +$By[4]--; +$V[3] = Vector($Bx[3]-$Ax[3],$By[3]-$Ay[3]); +$V[4] = Vector($Bx[4]-$Ax[4],$By[4]-$Ay[4]); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Check all vectors equal to \( $V[0] \). There may be more than one correct answer.", + "the vector from \( ($Ax[1],$Ay[1]) \) to \( ($Bx[1],$By[1]) \) $BR", + "the vector from \( ($Ax[2],$Ay[2]) \) to \( ($Bx[2],$By[2]) \) $BR", +); + +$mc -> extra( + "the vector from \( ($Ax[3],$Ay[3]) \) to \( ($Bx[3],$By[3]) \) $BR", + "the vector from \( ($Ax[4],$Ay[4]) \) to \( ($Bx[4],$By[4]) \) $BR", +); + +###################### +# Main text + +BEGIN_PGML + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + + +######################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +######################## + +BEGIN_PGML_SOLUTION + +The vector from [` ([$Ax[1]],[$Ay[1]]) `] to [` ([$Bx[1]],[$By[1]]) `] can be calculated by + + [`` <[$Bx[1]]-([$Ax[1]]),[$By[1]]-([$Ay[1]])>=[$V[0]] ``] + +The vector from [` ([$Ax[2]],[$Ay[2]]) `] to [` ([$Bx[2]],[$By[2]]) `] can be calculated by + + [`` <[$Bx[2]]-([$Ax[2]]),[$By[2]]-([$Ay[2]])>=[$V[0]] ``] + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorComponents10.pg b/Contrib/PCC/Trigonometry/Vectors/VectorComponents10.pg new file mode 100644 index 0000000000..3caa90c504 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorComponents10.pg @@ -0,0 +1,122 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +do { + $den = list_random(3,4,6); + $num = random(1,2*$den-1,1); + ($num,$den) = Fraction($num,$den)->reduce->value; +} until $den!=2 && $den!=1; + +$frac0 = specialAngle($num*pi/$den); +$r0 = random(2,10,1); + +if ($den==3) { + $cos0 = Fraction(cos(Compute($frac0))); + $x0 = Fraction($r0*cos(Compute($frac0))); +} else { + $cos0 = specialRadical(cos(Compute($frac0))); + $x0 = specialRadical($r0*cos(Compute($frac0))); +} +if ($den==6) { + $sin0 = Fraction(sin(Compute($frac0))); + $y0 = Fraction($r0*sin(Compute($frac0))); +} else { + $sin0 = specialRadical(sin(Compute($frac0))); + $y0 = specialRadical($r0*sin(Compute($frac0))); +} + +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->variables->are( +i=>['Real','TeX'=>'\mathbf{i}'], +j=>['Real','TeX'=>'\mathbf{j}'], +); +$ans = Formula("$x0*i+$y0*j"); + +############################################## + +BEGIN_PGML + +If vector [`v`] has a length of [`[$r0]`] and is in the direction of [`[$frac0]`], write the vector in terms of [`i`] and [`j`]. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +)@]** + + [`v=`][_________________________]{$ans} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +Given a position vector [`v=`] and direction angle [`\theta`], we have: + + [`` x=|v|\cos(\theta)\text{ and }y=|v|\sin(\theta) ``] + +We have: + + [``\begin{aligned} + x &= |v|\cos(\theta) \\ + &= [$r0]\cos\left([$frac0]\right) \\ + &= [$r0]\left([$cos0]\right) \\ + &= [$x0] + \end{aligned}``] + +and + + [``\begin{aligned} + y &= |v|\sin(\theta) \\ + &= [$r0]\sin\left([$frac0]\right) \\ + &= [$r0]\left([$sin0]\right) \\ + &= [$y0] + \end{aligned}``] + +The solution is [`v=[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorComponents20.pg b/Contrib/PCC/Trigonometry/Vectors/VectorComponents20.pg new file mode 100644 index 0000000000..bc25c181d7 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorComponents20.pg @@ -0,0 +1,245 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Vector2D"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); +Context()->noreduce("(-x)-y","(-x)+y"); + +@x = (); @y = (); @xShow = (); @yShow = (); @bearing = (); @angle = (); +@mag = (); @dir = (); @vec = (); +$mag[0] = random(800,1200,10); +$bearing[0] = random(20,70,5); +$dir[0] = list_random('E','W','SE','SW'); +if ($dir[0] eq 'E') + {$angle[0] = 90-$bearing[0];} + elsif ($dir[0] eq 'W') + {$angle[0] = 90+$bearing[0];} + elsif ($dir[0] eq 'SE') { + $bearing[0] += 90; + $angle[0] = 450-$bearing[0]; + } else { + $bearing[0] += 90; + $angle[0] = 90+$bearing[0]; + } + +$mag[1] = random(10,30,1); +$dir[1] = list_random('N','S','W','E'); +if ($dir[1] eq 'E') { + $angle[1] = 0; + $dirWord = 'east'; +} elsif ($dir[1] eq 'N') { + $angle[1] = 90; + $dirWord = 'north'; +} elsif ($dir[1] eq 'W') { + $angle[1] = 180; + $dirWord = 'west'; +} else { + $angle[1] = 270; + $dirWord = 'south'; +} + +for my $i (0..1) { + $x[$i] = $mag[$i]*cos($angle[$i]*pi/180); + $y[$i] = $mag[$i]*sin($angle[$i]*pi/180); + $xShow[$i] = Round($x[$i],4); + $yShow[$i] = Round($y[$i],4); +} + +$x[2] = $x[0]+$x[1]; +$y[2] = $y[0]+$y[1]; +$xShow[2] = Round($x[2],4); +$yShow[2] = Round($y[2],4); + +@v = (); +for my $i (0..2) { + $v[$i] = Compute("$xShow[$i]*i + $yShow[$i]j"); +} + +$mag[2] = sqrt(($x[2])**2+($y[2])**2); +$angle[2] = arctan($y[2]/$x[2])*180/pi; +$angle2Show = Round($angle[2],4); +if ( ($x[2]>0) && ($y[2]>0) ) { + $dir[2] = 'E'; + $bearing[2] = 90-$angle[2]; + $Q = 'I'; +} elsif ( ($x[2]<0) && ($y[2]>0) ) { + $dir[2] = 'W'; + $bearing[2] = 90+$angle[2]; + $Q = 'II'; +} elsif ( ($x[2]<0) && ($y[2]<0) ) { + $dir[2] = 'SW'; + $bearing[2] = 90+$angle[2]; + $Q = 'III'; +} else { + $dir[2] = 'SE'; + $bearing[2] = 90-$angle[2]; + $Q = 'IV'; +} +$popup = PopUp(["?", "W", "SW", "SE", "E"], $dir[2]); + +@graph = (); @fig = (); @alt = (); +$bound = 6; + +@xGraph = (); @yGraph = (); +for my $i (0..1) { + $xGraph[$i] = ($bound-1)*cos($angle[$i]*pi/180); + $yGraph[$i] = ($bound-1)*sin($angle[$i]*pi/180); +} + +for my $i (0..0) { + $graph[$i] = init_graph(-$bound,-$bound,$bound,$bound); + $graph[$i]->lb('reset'); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,$bound-1,black,2); + $graph[$i]->lb(new Label(0,$bound-1,"N",'black','center','bottom',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,-$bound+1,black,2); + $graph[$i]->lb(new Label(0,-$bound+1,"S",'black','center','top',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($bound-1,0,black,2); + $graph[$i]->lb(new Label($bound-1,0,"E",'black','left','middle',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(-$bound+1,0,black,2); + $graph[$i]->lb(new Label(-$bound+1,0,"W",'black','right','middle',large)); + + $graph[$i]->stamps(closed_circle( 0,0, red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],$yGraph[$i],red,2); + $ud = ($y[$i]>0) ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($xGraph[$i],$yGraph[$i],$mag[$i],'red','center',$ud,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],0,red,2); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,$yGraph[$i],red,2); + + $graph[$i]->moveTo(0,$yGraph[$i]); + $graph[$i]->lineTo($xGraph[$i],$yGraph[$i],red,2,dashed); + $graph[$i]->lineTo($xGraph[$i],0,red,2,dashed); + + $alt[$i] = "There are 4 arrows pointing to 4 directions N, S, E and W. A vector starts at (0,0), pointing in the direction of $dir[0] bearing of $bearing[0] degrees. This vector is separated into two components along the x-axis and y-axis."; + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); +} + + + + + + +############################################## + +BEGIN_PGML + +An airplane is flying at an airspeed of [`[$mag[0]]`] miles per hour headed on a [$dir[0]] bearing of [`[$bearing[0]]^{\circ}`]. A wind blowing due [$dirWord] is blowing at [`[$mag[1]]`] miles per hour. What are the ground speed and actual bearing of the plane? + +[@KeyboardInstructions( +"\n" +.'* Use degrees in your answer.' +)@]** + +The plane has a [____]{$popup} bearing of [_________]{$bearing[2]}. The ground speed is [__________]{$mag[2]} miles per hour. + +END_PGML + +############################################## + +if ($Q eq 'I') { + $s1 = "\text{simply } $angle2Show^{\circ}"; +} elsif ($Q eq 'IV') { + my $an = 360+$angle2Show; + $s1 = "$angle2Show^{\circ}+360^{\circ}=$an^{\circ}"; +} else { + my $an = 180+$angle2Show; + $s1 = "$angle2Show^{\circ}+180^{\circ}=$an^{\circ}"; +} + + +BEGIN_PGML_SOLUTION + +The following is a graph for the plane's initial speed vector (without considering the wind's effect). + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +It has a [$dir[0]] bearing of [`[$bearing[0]]^{\circ}`], implying a direction of [`[$angle[0]]^{\circ}`] degrees if due east is the initial side. + +It's x-component can be calculated by + + [`` [$mag[0]]\cdot \cos([$angle[0]]^{\circ}) = [$xShow[0]] \frac{\text{mi}}{\text{hr}} ``] + +and its y-component can be calculated by + + [`` [$mag[0]]\cdot \sin([$angle[0]]^{\circ}) = [$yShow[0]] \frac{\text{mi}}{\text{hr}} ``] + +So the plane's speed vector can be written as + + [`` v_1=[$v[0]] ``] + +A wind blowing due [$dirWord] is blowing at [`[$mag[1]]`] miles per hour. Its speed vector can be written as + + [`` v_2=[$v[1]] ``] + +Add up those two vectors, we have: + + [``\begin{aligned} + v_3 &= v_1+v_2 \\ + &= [$v[0]]+([$v[1]]) \\ + &= [$v[2]] + \end{aligned}``] + +This is the new speed vector considering the wind's effect. Its magnitude, or ground speed, is: + + [`` |v_3| = \sqrt{([$xShow[2]])^2+([$yShow[2]])^2} = [$mag[2]] \frac{\text{mi}}{\text{hr}}``] + +Its direction can be calculated by: + + [`` \tan^{-1}\left( \frac{[$yShow[2]]}{[$xShow[2]]} \right) = [$angle2Show]^{\circ} + 180k \text{, where } k\in \mathbb{Z}``] + +Since the speed vector is in Quadrant [$Q], the angle of direction, with due east as the initial side, is [`[$s1]`]. + +Translating it into bearing format, the plane has a [$dir[2]] bearing of [`[$bearing[2]]^{\circ}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorComponents30.pg b/Contrib/PCC/Trigonometry/Vectors/VectorComponents30.pg new file mode 100644 index 0000000000..d75081405b --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorComponents30.pg @@ -0,0 +1,238 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Vector2D"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); +Context()->noreduce("(-x)-y","(-x)+y"); + +@x = (); @y = (); @xShow = (); @yShow = (); @bearing = (); @angle = (); +@mag = (); @dir = (); @vec = (); + +$mag[0] = random(800,1200,10); +$mag[1] = random(10,30,1); +$bearing[0] = random(20,70,5); +$bearing[1] = random(10,80,5); + +for my $i (0..1) { + $dir[$i] = list_random('E','W','SE','SW'); + if ($dir[$i] eq 'E') + {$angle[$i] = 90-$bearing[$i];} + elsif ($dir[$i] eq 'W') + {$angle[$i] = 90+$bearing[$i];} + elsif ($dir[$i] eq 'SE') { + $bearing[$i] += 90; + $angle[$i] = 450-$bearing[$i]; + } else { + $bearing[$i] += 90; + $angle[$i] = 90+$bearing[$i]; + } +} +for my $i (0..1) { + $x[$i] = $mag[$i]*cos($angle[$i]*pi/180); + $y[$i] = $mag[$i]*sin($angle[$i]*pi/180); + $xShow[$i] = Round($x[$i],4); + $yShow[$i] = Round($y[$i],4); +} + +$x[2] = $x[0]+$x[1]; +$y[2] = $y[0]+$y[1]; +$xShow[2] = Round($x[2],4); +$yShow[2] = Round($y[2],4); + +@v = (); +for my $i (0..2) { + $v[$i] = Compute("$xShow[$i]*i + $yShow[$i]j"); +} + +$mag[2] = sqrt(($x[2])**2+($y[2])**2); +$angle[2] = arctan($y[2]/$x[2])*180/pi; +$angle2Show = Round($angle[2],4); +if ( ($x[2]>0) && ($y[2]>0) ) { + $dir[2] = 'E'; + $bearing[2] = 90-$angle[2]; + $Q = 'I'; +} elsif ( ($x[2]<0) && ($y[2]>0) ) { + $dir[2] = 'W'; + $bearing[2] = 90+$angle[2]; + $Q = 'II'; +} elsif ( ($x[2]<0) && ($y[2]<0) ) { + $dir[2] = 'SW'; + $bearing[2] = 90+$angle[2]; + $Q = 'III'; +} else { + $dir[2] = 'SE'; + $bearing[2] = 90-$angle[2]; + $Q = 'IV'; +} +$popup = PopUp(["?", "W", "SW", "SE", "E"], $dir[2]); + +@graph = (); @fig = (); @alt = (); +$bound = 6; + +@xGraph = (); @yGraph = (); +for my $i (0..1) { + $xGraph[$i] = ($bound-1)*cos($angle[$i]*pi/180); + $yGraph[$i] = ($bound-1)*sin($angle[$i]*pi/180); +} + +for my $i (0..0) { + $graph[$i] = init_graph(-$bound,-$bound,$bound,$bound); + $graph[$i]->lb('reset'); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,$bound-1,black,2); + $graph[$i]->lb(new Label(0,$bound-1,"N",'black','center','bottom',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,-$bound+1,black,2); + $graph[$i]->lb(new Label(0,-$bound+1,"S",'black','center','top',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($bound-1,0,black,2); + $graph[$i]->lb(new Label($bound-1,0,"E",'black','left','middle',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(-$bound+1,0,black,2); + $graph[$i]->lb(new Label(-$bound+1,0,"W",'black','right','middle',large)); + + $graph[$i]->stamps(closed_circle( 0,0, red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],$yGraph[$i],red,2); + $ud = ($y[$i]>0) ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($xGraph[$i],$yGraph[$i],$mag[$i],'red','center',$ud,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],0,red,2); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,$yGraph[$i],red,2); + + $graph[$i]->moveTo(0,$yGraph[$i]); + $graph[$i]->lineTo($xGraph[$i],$yGraph[$i],red,2,dashed); + $graph[$i]->lineTo($xGraph[$i],0,red,2,dashed); + + $alt[$i] = "There are 4 arrows pointing to 4 directions N, S, E and W. A vector starts at (0,0), pointing in the direction of $dir[0] bearing of $bearing[0] degrees. This vector is separated into two components along the x-axis and y-axis."; + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); +} + + + + + + +############################################## + +BEGIN_PGML + +An airplane is flying at an airspeed of [`[$mag[0]]`] miles per hour headed on a [$dir[0]] bearing of [`[$bearing[0]]^{\circ}`]. A wind is blowing at [`[$mag[1]]`] miles per hour on a [$dir[1]] bearing of [`[$bearing[1]]^{\circ}`]. What are the ground speed and actual bearing of the plane? + +[@KeyboardInstructions( +"\n" +.'* Use degrees in your answer.' +)@]** + +The plane has a [____]{$popup} bearing of [_________]{$bearing[2]}. The ground speed is [__________]{$mag[2]} miles per hour. + +END_PGML + +############################################## + +if ($Q eq 'I') { + $s1 = "\text{simply } $angle2Show^{\circ}"; +} elsif ($Q eq 'IV') { + my $an = 360+$angle2Show; + $s1 = "$angle2Show^{\circ}+360^{\circ}=$an^{\circ}"; +} else { + my $an = 180+$angle2Show; + $s1 = "$angle2Show^{\circ}+180^{\circ}=$an^{\circ}"; +} + + +BEGIN_PGML_SOLUTION + +The following is a graph for the plane's initial speed vector (without considering the wind's effect). + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +It has a [$dir[0]] bearing of [`[$bearing[0]]^{\circ}`], implying a direction of [`[$angle[0]]^{\circ}`] degrees if due east is the initial side. + +It's x-component can be calculated by + + [`` [$mag[0]]\cdot \cos([$angle[0]]^{\circ}) = [$xShow[0]] \frac{\text{mi}}{\text{hr}} ``] + +and its y-component can be calculated by + + [`` [$mag[0]]\cdot \sin([$angle[0]]^{\circ}) = [$yShow[0]] \frac{\text{mi}}{\text{hr}} ``] + +So the plane's speed vector can be written as + + [`` v_1=[$v[0]] ``] + +A wind is blowing at [`[$mag[1]]`] miles per hour on a [$dir[1]] bearing of [`[$bearing[1]]^{\circ}`]. With similar calculations, we have: + + [``\begin{aligned} + [$mag[1]]\cdot \cos([$angle[1]]^{\circ}) &= [$xShow[1]] \frac{\text{mi}}{\text{hr}} \\ + [$mag[1]]\cdot \sin([$angle[1]]^{\circ}) &= [$yShow[1]] \frac{\text{mi}}{\text{hr}} \\ + v_2 &= [$v[1]] + \end{aligned}``] + +Add up those two vectors, we have: + + [``\begin{aligned} + v_3 &= v_1+v_2 \\ + &= [$v[0]]+([$v[1]]) \\ + &= [$v[2]] + \end{aligned}``] + +This is the new speed vector considering the wind's effect. Its magnitude, or ground speed, is: + + [`` |v_3| = \sqrt{([$xShow[2]])^2+([$yShow[2]])^2} = [$mag[2]] \frac{\text{mi}}{\text{hr}}``] + +Its direction can be calculated by: + + [`` \tan^{-1}\left( \frac{[$yShow[2]]}{[$xShow[2]]} \right) = [$angle2Show]^{\circ} + 180k \text{, where } k\in \mathbb{Z}``] + +Since the speed vector is in Quadrant [$Q], the angle of direction, with due east as the initial side, is [`[$s1]`]. + +Translating it into bearing format, the plane has a [$dir[2]] bearing of [`[$bearing[2]]^{\circ}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorComponents40.pg b/Contrib/PCC/Trigonometry/Vectors/VectorComponents40.pg new file mode 100644 index 0000000000..aa2d538142 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorComponents40.pg @@ -0,0 +1,205 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Vector2D"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); +Context()->noreduce("(-x)-y","(-x)+y"); + +@x = (); @y = (); @xShow = (); @yShow = (); +@angle = (); @mag = (); @vec = (); + +do { + for my $i (0..2) { + $mag[$i] = random(10,50,5); + $angle[$i] = random(20,70,5)+90*random(0,3,1); + $x[$i] = $mag[$i]*cos($angle[$i]*pi/180); + $y[$i] = $mag[$i]*sin($angle[$i]*pi/180); + $xShow[$i] = Round($x[$i],4); + $yShow[$i] = Round($y[$i],4); + } +} until +abs($mag[0]-$mag[1])>10 && +abs($mag[1]-$mag[2])>10 && +abs($angle[0]-$angle[1])>90 && +abs($angle[1]-$angle[2])>90; + +$x[3] = $x[0]+$x[1]+$x[2]; +$y[3] = $y[0]+$y[1]+$y[2]; +$xShow[3] = Round($x[3],4); +$yShow[3] = Round($y[3],4); + +@v = (); +for my $i (0..3) { + $v[$i] = Compute("$xShow[$i]*i + $yShow[$i]j"); +} + +$mag[3] = sqrt(($x[3])**2+($y[3])**2); +$angle[3] = arctan($y[3]/$x[3])*180/pi; +$angle3Show = Round($angle[3],4); +if ( ($x[3]>0) && ($y[3]>0) ) { + $Q = 'I'; +} elsif ( ($x[3]<0) && ($y[3]>0) ) { + $Q = 'II'; +} elsif ( ($x[3]<0) && ($y[3]<0) ) { + $Q = 'III'; +} else { + $Q = 'IV'; +} + +if ($Q eq 'I') { + $angleAns = $angle[3]; + $angleAnsShow = Round($angleAns,4); + $s1 = "\text{simply } $angleAnsShow^{\circ}"; +} elsif ($Q eq 'IV') { + $angleAns = $angle[3] + 360; + $angleAnsShow = Round($angleAns,4); + $s1 = "$angle3Show^{\circ}+360^{\circ}=$angleAnsShow^{\circ}"; +} else { + $angleAns = $angle[3] + 180; + $angleAnsShow = Round($angleAns,4); + $s1 = "$angle3Show^{\circ}+180^{\circ}=$angleAnsShow^{\circ}"; +} + + +@graph = (); @fig = (); @alt = (); +$bound = 6; + +@xGraph = (); @yGraph = (); +for my $i (0..0) { + $xGraph[$i] = ($bound-1)*cos($angle[$i]*pi/180); + $yGraph[$i] = ($bound-1)*sin($angle[$i]*pi/180); +} + +for my $i (0..0) { + $graph[$i] = init_graph(-$bound,-$bound,$bound,$bound,axes=>[0,0]); + $graph[$i]->lb('reset'); + + $graph[$i]->stamps(closed_circle( 0,0, red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],$yGraph[$i],red,2); + $ud = ($y[$i]>0) ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($xGraph[$i],$yGraph[$i],$mag[$i],'red','center',$ud,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],0,red,2); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,$yGraph[$i],red,2); + + $graph[$i]->moveTo(0,$yGraph[$i]); + $graph[$i]->lineTo($xGraph[$i],$yGraph[$i],red,2,dashed); + $graph[$i]->lineTo($xGraph[$i],0,red,2,dashed); + + $alt[$i] = "A vector starts at (0,0), pointing at $angle[0] degrees. This vector is separated into two components along the x-axis and y-axis."; + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); +} + + + + + + +############################################## + +BEGIN_PGML + +Suppose a body has a force of [`[$mag[0]] \text{ lb}`] acting on it directed [`[$angle[0]]^{\circ}`] from due east, a second force of [`[$mag[1]] \text{ lb}`] acting on it [`[$angle[1]]^{\circ}`] from due east, and a third force of [`[$mag[2]] \text{ lb}`] acting on it [`[$angle[2]]^{\circ}`] from due east. What single force is the resultant force acting on the body? In which direction? (Enter a positive degree from due east.) + +The resulting force is [__________]{$mag[3]} pounds directed [__________]{$angleAns} degrees from due east. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +A force of [`[$mag[0]] \text{ lb}`] acts on a body directed [`[$angle[0]]^{\circ}`] from due east. The following is a graph for the vector representing this force. + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +It's x-component can be calculated by + + [`` [$mag[0]]\cdot \cos([$angle[0]]^{\circ}) = [$xShow[0]] \text{ lb} ``] + +and its y-component can be calculated by + + [`` [$mag[0]]\cdot \sin([$angle[0]]^{\circ}) = [$yShow[0]] \text{ lb} ``] + +So this vector can be written as: + + [`` v_1=[$v[0]] ``] + +The second force, [`[$mag[1]] \text{ lb}`] directed [`[$angle[1]]^{\circ}`] from due east, can be written as: + + [``\begin{aligned} + [$mag[1]]\cdot \cos([$angle[1]]^{\circ}) &= [$xShow[1]] \text{ lb} \\ + [$mag[1]]\cdot \sin([$angle[1]]^{\circ}) &= [$yShow[1]] \text{ lb} \\ + v_2 &= [$v[1]] + \end{aligned}``] + +The third force, [`[$mag[2]] \text{ lb}`] directed [`[$angle[2]]^{\circ}`] from due east, can be written as: + + [``\begin{aligned} + [$mag[2]]\cdot \cos([$angle[2]]^{\circ}) &= [$xShow[2]] \text{ lb} \\ + [$mag[2]]\cdot \sin([$angle[2]]^{\circ}) &= [$yShow[2]] \text{ lb} \\ + v_3 &= [$v[2]] + \end{aligned}``] + +Add up those three vectors, we have: + + [``\begin{aligned} + v_4 &= v_1+v_2+v_3 \\ + &= [$v[0]]+([$v[1]])+([$v[2]]) \\ + &= [$v[3]] + \end{aligned}``] + +This is the combined force, and we can see it is in Quadrant [$Q] by the values of [`i`] and [`j`]. Its magnitude is: + + [`` |v_4| = \sqrt{([$xShow[3]])^2+([$yShow[3]])^2} = [$mag[3]] \text{ lb}``] + +Its direction can be calculated by: + + [`` \tan^{-1}\left( \frac{[$yShow[3]]}{[$xShow[3]]} \right) = [$angle3Show]^{\circ} + 180^{\circ}\cdot k \text{, where } k\in \mathbb{Z}``] + +Since the combined forcer is in Quadrant [$Q], the angle of direction is [`[$s1]`] from due east. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorOperations10.pg b/Contrib/PCC/Trigonometry/Vectors/VectorOperations10.pg new file mode 100644 index 0000000000..8b01400e7f --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorOperations10.pg @@ -0,0 +1,149 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "contextLimitedVector.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + +$refreshCachedImages = 1; + +############################# +# Setup + +Context("Numeric"); + +@p = ([1,1],[2,3],[3,1]); +@l = ('A','B','C'); +@s = NchooseK(3,3); +%v = ( + "01" => "\overrightarrow{AB}", + "02" => "\overrightarrow{AC}", + "10" => "\overrightarrow{BA}", + "12" => "\overrightarrow{BC}", + "20" => "\overrightarrow{CA}", + "21" => "\overrightarrow{CB}", +); + +@k = ( + $v{$s[0].$s[1]}, + $v{$s[1].$s[2]}, + $v{$s[0].$s[2]}, + $v{$s[1].$s[0]}, + $v{$s[2].$s[1]}, + $v{$s[2].$s[0]}, +); + +@k1 = ( + ALPHABET($s[0]).ALPHABET($s[1]), + ALPHABET($s[1]).ALPHABET($s[2]), + ALPHABET($s[0]).ALPHABET($s[2]), +); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Check all correct statements. There may be more than one correct answer.", + "\( $k[0]+$k[1]=$k[2] \) $BR", + "\( $k[2]-$k[0]=$k[1] \) $BR", +); + +$mc -> extra( + "\( $k[2]+$k[1]=$k[0] \) $BR", + "\( $k[1]-$k[0]=$k[2] \) $BR", + "\( $k[2]+$k[0]=$k[1] \) $BR", + "\( $k[0]-$k[1]=$k[2] \) $BR", +); + +################################ +# Begin construct graph & grid + +$pixels = 300; +$gr = init_graph(0,0,4,4,size=>[$pixels,$pixels]); +$gr -> lb('reset'); + +$gr -> stamps( closed_circle(1,1,'black') ); +$gr -> stamps( closed_circle(2,3,'black') ); +$gr -> stamps( closed_circle(3,1,'black') ); +$gr -> lb(new Label ( 1,1,'A','black','right','top',large)); +$gr -> lb(new Label ( 2,3,'B','black','center','bottom',large)); +$gr -> lb(new Label ( 3,1,'C','black','left','top',large)); +$gr->moveTo($p[$s[0]][0],$p[$s[0]][1]); +$gr->arrowTo($p[$s[1]][0],$p[$s[1]][1],'red',2); +$gr->arrowTo($p[$s[2]][0],$p[$s[2]][1],'red',2); +$gr->moveTo($p[$s[0]][0],$p[$s[0]][1]); +$gr->arrowTo($p[$s[2]][0],$p[$s[2]][1],'red',2); + +$alt = "Vectors $k1[0], $k1[1] and $k1[2] are drawn."; + +$fig = image(insertGraph($gr), width=>$pixels, height=>$pixels, tex_size=>700,extra_html_tags => "alt = '$alt' title = '$alt' " ); + +###################### + + +BEGIN_PGML + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +######################## + +BEGIN_PGML_SOLUTION + +In the graph, [`[$k[0]]+[$k[1]]=[$k[2]]`] because the tail of [`[$k[0]]`] connects to the head of [`[$k[1]]`]. This is called the Head to Tail Rule in vector addition. + +From [`[$k[0]]+[$k[1]]=[$k[2]]`], we can easily derive [`[$k[1]]=[$k[2]]-[$k[0]]`]. + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorOperations20.pg b/Contrib/PCC/Trigonometry/Vectors/VectorOperations20.pg new file mode 100644 index 0000000000..ae93175b3a --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorOperations20.pg @@ -0,0 +1,135 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(December 2015) +## Institution(Hope College) +## Author(Paul Pearson) +## Level(2) +## MO(1) +## KEYWORDS('vectors','vector operations') + + +############################## +# Initialization + +DOCUMENT(); + +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "contextLimitedVector.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "scaffold.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +TEXT(beginproblem()); +$refreshCachedImages = 1; +$showPartialCorrectAnswers = 1; + +############################# +# Setup + +Context("Numeric")->variables->are( +a=>['Real','TeX'=>'\mathbf{a}'], +b=>['Real','TeX'=>'\mathbf{b}'], +c=>['Real','TeX'=>'\mathbf{c}'], +); + +@l = ('a','b','c'); +@s = NchooseK(3,3); + +$ans0 = Compute("($l[$s[2]]-$l[$s[1]])/2"); +$ans1 = Compute("$l[$s[2]]-2*$l[$s[0]]"); +$ans2 = Compute("2*$l[$s[0]]+$l[$s[1]]"); + + +################################ +# Begin construct graph & grid + +$pixels = 300; +($xmin,$xmax) = (-7,7); +($ymin,$ymax) = (-7,7); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, size=>[$pixels,$pixels]); +$gr -> lb('reset'); + +# construct points (F, G, and H) +($fx,$fy) = (random(2,6,1), random(2,6,1)); +do { ($gx,$gy) = (random(-6,-2,1), random(1,6,1)); } until ($gy != $fy); +do { ($hx,$hy) = (0,random(-6,-3,1)); } until ($hx != $fx); + +# construct vectors A = FG, B = FH, C = GH +($ax,$ay) = ($gx - $fx, $gy - $fy); +($bx,$by) = ($hx - $fx, $hy - $fy); +($cx,$cy) = ($hx - $gx, $hy - $gy); + +# $gr: draw vectors A, B, C +$gr->moveTo($gx, $gy); $gr->arrowTo($gx - $ax/2, $gy - $ay/2,'black',2); +$gr->moveTo($gx - $ax/2, $gy - $ay/2); $gr->arrowTo($gx - $ax, $gy - $ay,'orange',2); +$gr->moveTo($fx, $fy); $gr->arrowTo($hx, $hy,'blue',2); +$gr->moveTo($gx, $gy); $gr->arrowTo($hx, $hy,'red',2); + +# $gr: add labels +$gr->lb(new Label ( $gx - $ax/4, $gy - $ay/4 + 0.5,$l[$s[0]],'black','middle','bottom')); +$gr->lb(new Label ( $gx - 3*$ax/4, $gy - 3*$ay/4 + 0.5,$l[$s[0]],'orange','middle','bottom')); +$gr->lb(new Label ( $fx + $bx/2 + 0.5, $fy + $by/2, $l[$s[1]], 'blue','left','top')); +$gr->lb(new Label ( $gx + $cx/2 - 0.5, $gy + $cy/2, $l[$s[2]], 'red','right','middle')); + + + +$alt = "Two vectors $l[$s[0]] are connected head to tail and point to the same direction. Vector $l[$s[1]] starts from the head of the second $l[$s[0]] and point to a different direction. $l[$s[2]] starts from the tail of the first $l[$s[0]] and ends at the head of $l[$s[1]]."; + +$fig = image(insertGraph($gr), width=>$pixels, height=>$pixels, tex_size=>700,extra_html_tags => "alt = '$alt' title = '$alt' " ); + +###################### + + +BEGIN_PGML + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Answer the following questions with vectors [`a, b`] and [`c`] shown in the graph. + ++ [`[$l[$s[0]]]=`][___________]{$ans0} ++ [`[$l[$s[1]]]=`][___________]{$ans1} ++ [`[$l[$s[2]]]=`][___________]{$ans2} + +END_PGML + +############################################## + + + +######################## + +BEGIN_PGML_SOLUTION + +By Head to Tail Rule of vector addition, we have: + + [``[$l[$s[2]]]=2[$l[$s[0]]]+[$l[$s[1]]]``] + +By this equation, we can derive: + + [``[$l[$s[1]]]=[$l[$s[2]]]-2[$l[$s[0]]]``] + +and + + [``[$l[$s[0]]]=\frac{[$l[$s[2]]]-[$l[$s[1]]]}{2}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorOperations30.pg b/Contrib/PCC/Trigonometry/Vectors/VectorOperations30.pg new file mode 100644 index 0000000000..d4b426566e --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorOperations30.pg @@ -0,0 +1,138 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(December 2015) +## Institution(Hope College) +## Author(Paul Pearson) +## Level(2) +## MO(1) +## KEYWORDS('vectors','vector operations') + + +############################## +# Initialization + +DOCUMENT(); + +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "contextLimitedVector.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "scaffold.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +TEXT(beginproblem()); +$refreshCachedImages = 1; +$showPartialCorrectAnswers = 1; + +############################# +# Setup + +Context("Numeric")->variables->are( +a=>['Real','TeX'=>'\mathbf{a}'], +b=>['Real','TeX'=>'\mathbf{b}'], +c=>['Real','TeX'=>'\mathbf{c}'], +d=>['Real','TeX'=>'\mathbf{d}'], +); + +@l = ('a','b','c','d'); +@s = NchooseK(4,4); + +$ans0 = Compute("($l[$s[2]] - $l[$s[1]] - $l[$s[3]])/2"); +$ans1 = Compute("$l[$s[2]]-2*$l[$s[0]]- $l[$s[3]]"); +$ans2 = Compute("2*$l[$s[0]]+$l[$s[1]]+$l[$s[3]]"); +$ans3 = Compute("$l[$s[2]]-2*$l[$s[0]]-$l[$s[1]]"); + +################################ +# Begin construct graph & grid + +$pixels = 300; +($xmin,$xmax) = (-7,7); +($ymin,$ymax) = (-7,7); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, size=>[$pixels,$pixels]); +$gr -> lb('reset'); + +# construct points (F, G, and H) +($fx,$fy) = (random(2,6,1), random(2,6,1)); +do { ($gx,$gy) = (random(-6,-2,1), random(1,6,1)); } until ($gy != $fy); +do { ($hx,$hy) = (0,random(-6,-3,1)); } until ($hx != $fx); + +# construct vectors A = FG, B = FH, C = GH +($ax,$ay) = ($gx - $fx, $gy - $fy); +($bx,$by) = ($hx - $fx, $hy - $fy); +($cx,$cy) = ($hx - $gx, $hy - $gy); + +# $gr: draw vectors A, B, C +$gr->moveTo($gx, $gy); $gr->arrowTo($gx - $ax/2, $gy - $ay/2,'black',2); # a +$gr->moveTo($gx - $ax/2, $gy - $ay/2); $gr->arrowTo($gx - $ax, $gy - $ay,'orange',2); # a +$gr->moveTo($fx, $fy); $gr->arrowTo($hx, $hy,'blue',2); # b +$gr->moveTo($gx, $gy); $gr->arrowTo(0,0,'red',2); # c +$gr->moveTo($hx,$hy); $gr->arrowTo(0,0,'green',2); # d + +# $gr: add labels +$gr->lb(new Label ( $gx - $ax/4, $gy - $ay/4 + 0.5,$l[$s[0]],'black','middle','bottom')); +$gr->lb(new Label ( $gx - 3*$ax/4, $gy - 3*$ay/4 + 0.5,$l[$s[0]],'orange','middle','bottom')); +$gr->lb(new Label ( $fx + $bx/2 + 0.5, $fy + $by/2, $l[$s[1]], 'blue','left','top')); +$gr->lb(new Label ( $gx/2 - 0.5, $gy/2, $l[$s[2]], 'red','right','middle')); +$gr->lb(new Label ( - 0.5, $hy/2, $l[$s[3]], 'green','right','middle')); + + +$alt = "Two vectors $l[$s[0]] are connected head to tail and point to the same direction. Vector $l[$s[1]] starts from the head of the second $l[$s[0]] and point to a different direction. $l[$s[2]] starts from the tail of the first $l[$s[0]] and ends at the head of $l[$s[1]]."; + +$fig = image(insertGraph($gr), width=>$pixels, height=>$pixels, tex_size=>700,extra_html_tags => "alt = '$alt' title = '$alt' " ); + +###################### + + +BEGIN_PGML + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Answer the following questions with vectors [`a, b, c`] and [`d`] shown in the graph. + ++ [`[$l[$s[0]]]=`][___________]{$ans0} ++ [`[$l[$s[1]]]=`][___________]{$ans1} ++ [`[$l[$s[2]]]=`][___________]{$ans2} ++ [`[$l[$s[3]]]=`][___________]{$ans3} + +END_PGML + +############################################## + + + +######################## + +BEGIN_PGML_SOLUTION + +By Head to Tail Rule of vector addition, starting at the tail of the first vector [`c`], ending at the head of vector [`d`], we have: + + [``[$l[$s[2]]]=2[$l[$s[0]]]+[$l[$s[1]]]+[$l[$s[3]]]``] + +By this equation, we can derive: + + [``[$l[$s[0]]]=\frac{[$l[$s[2]]]-[$l[$s[1]]]-[$l[$s[3]]]}{2}``] + + [``[$l[$s[1]]]=[$l[$s[2]]]-2[$l[$s[0]]]-[$l[$s[3]]]``] + + [``[$l[$s[3]]]=[$l[$s[2]]]-2[$l[$s[0]]]-[$l[$s[1]]]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorOperations40.pg b/Contrib/PCC/Trigonometry/Vectors/VectorOperations40.pg new file mode 100644 index 0000000000..52911e018f --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorOperations40.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## MLT(FindPointFrom_Vecandpoint) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('15') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextLimitedPoint.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("LimitedPoint"); + +($Ax,$Ay) = ( non_zero_random(-9,9,1), non_zero_random(-9,9,1) ); +do { + ($Bx,$By) = ( non_zero_random(-9,9,1), non_zero_random(-9,9,1) ); +} until ($Ax != $Bx && $Ay != $By); + +$A = Point($Ax,$Ay); +$B = Point($Bx,$By); +$AB = Vector($Bx - $Ax, $By - $Ay)->reduce; + +$OA = Vector($Ax,$Ay); +$OB = Vector($Bx,$By); + +###################### +# Main text + +BEGIN_PGML + +Suppose [` A = [$A] `] and [` \overrightarrow{AB} = [$AB] `], find the location of Point [`B`]. + +[@KeyboardInstructions( +"\n" +.'* Enter a point, like [`(0,1)`]' +)@]** + + [` B = `][_______________]{$B} + +END_PGML + + +######################## +# Answer evaluation + +BEGIN_PGML_SOLUTION + +Since [` \overrightarrow{OA} + \overrightarrow{AB} = \overrightarrow{OB} `], we have + + [``\begin{aligned} + \overrightarrow{OB} &= \overrightarrow{OA} + \overrightarrow{AB} \\ + &= [$OA] + [$AB] \\ + &= [$OB] + \end{aligned}``] + +Point B is at [`[$B]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorOperations50.pg b/Contrib/PCC/Trigonometry/Vectors/VectorOperations50.pg new file mode 100644 index 0000000000..8e4858a906 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorOperations50.pg @@ -0,0 +1,93 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('15') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextLimitedPoint.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("LimitedPoint"); + +($Ax,$Ay) = ( non_zero_random(-9,9,1), non_zero_random(-9,9,1) ); +do { + ($Bx,$By) = ( non_zero_random(-9,9,1), non_zero_random(-9,9,1) ); +} until ($Ax != $Bx && $Ay != $By); + +$A = Point($Ax,$Ay); +$B = Point($Bx,$By); +$AB = Vector($Bx - $Ax, $By - $Ay)->reduce; + +$OA = Vector($Ax,$Ay); +$OB = Vector($Bx,$By); + +###################### +# Main text + +BEGIN_PGML + +Suppose [` B = [$B] `] and [` \overrightarrow{AB} = [$AB] `], find the location of Point [`A`]. + +[@KeyboardInstructions( +"\n" +.'* Enter a point, like [`(0,1)`]' +)@]** + + [` A = `][_______________]{$A} + +END_PGML + +######################## +# Answer evaluation + +BEGIN_PGML_SOLUTION + +Since [` \overrightarrow{OA} + \overrightarrow{AB} = \overrightarrow{OB} `], we have + + [``\begin{aligned} + \overrightarrow{OA} &= \overrightarrow{OB} - \overrightarrow{AB} \\ + &= [$OB] - [$AB] \\ + &= [$OA] + \end{aligned}``] + +Point A is at [`[$A]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorOperations60.pg b/Contrib/PCC/Trigonometry/Vectors/VectorOperations60.pg new file mode 100644 index 0000000000..d67e27b4d5 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorOperations60.pg @@ -0,0 +1,92 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## MLT(AddPointsForVec) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('17') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextLimitedVector.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("LimitedVector-coordinate")->variables->are(x=>'Real',y=>'Real'); +Context()->flags->set( ijk=>0 ); + +($Ax,$Ay) = (non_zero_random(-9,9,1), non_zero_random(-9,9,1)); +do { + ($Bx,$By) = (non_zero_random(-9,9,1), non_zero_random(-9,9,1)); +} until ($Bx != $Ax && $By != $Ay); +$A = Point($Ax,$Ay); +$B = Point($Bx,$By); +$AB = Vector("<$Bx - $Ax,$By - $Ay>")->reduce; + +$OA = Vector($Ax,$Ay); +$OB = Vector($Bx,$By); + +###################### +# Main text + +BEGIN_PGML + +Suppose [` A = [$A] `] and [` B = [$B] `], find the vector [`\overrightarrow{AB}`]. + +[@KeyboardInstructions( +"\n" +.'* Enter a vector, like [`<0,1>`]' +)@]** + + [` \overrightarrow{AB} = `][_______________]{$AB} + +END_PGML + +######################## +# Answer evaluation + +BEGIN_PGML_SOLUTION + +Since [` \overrightarrow{OA} + \overrightarrow{AB} = \overrightarrow{OB} `], we have + + [``\begin{aligned} + \overrightarrow{AB} &= \overrightarrow{OB} - \overrightarrow{OA} \\ + &= [$OB] - [$OA] \\ + &= [$AB] + \end{aligned}``] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorOperations61.pg b/Contrib/PCC/Trigonometry/Vectors/VectorOperations61.pg new file mode 100644 index 0000000000..0d8931cfe5 --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorOperations61.pg @@ -0,0 +1,93 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## MLT(AddPointsForVec) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('17') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextLimitedVector.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("Vector")->variables->are(x=>'Real',y=>'Real'); + +($Ax,$Ay) = (non_zero_random(-9,9,1), non_zero_random(-9,9,1)); +do { + ($Bx,$By) = (non_zero_random(-9,9,1), non_zero_random(-9,9,1)); +} until ($Bx != $Ax && $By != $Ay); +$A = Point($Ax,$Ay); +$B = Point($Bx,$By); +$Cx = $Bx - $Ax; +$Cy = $By - $Ay; +$AB = Compute("$Cx*i+$Cy*j")->reduce; + +$OA = Compute("$Ax*i+$Ay*j")->reduce; +$OB = Compute("$Bx*i+$By*j")->reduce; + +###################### +# Main text + +BEGIN_PGML + +Suppose [` A = [$A] `] and [` B = [$B] `], find the vector [`\overrightarrow{AB}`]. + +[@KeyboardInstructions( +"\n" +.'* Enter a vector in terms of [`i`] and [`j`].' +)@]** + + [` \overrightarrow{AB} = `][_______________]{$AB} + +END_PGML + +######################## +# Answer evaluation + +BEGIN_PGML_SOLUTION + +Since [` \overrightarrow{OA} + \overrightarrow{AB} = \overrightarrow{OB} `], we have + + [``\begin{aligned} + \overrightarrow{AB} &= \overrightarrow{OB} - \overrightarrow{OA} \\ + &= [$OB] - ([$OA]) \\ + &= [$AB] + \end{aligned}``] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/Contrib/PCC/Trigonometry/Vectors/VectorOperations70.pg b/Contrib/PCC/Trigonometry/Vectors/VectorOperations70.pg new file mode 100644 index 0000000000..74503a1adf --- /dev/null +++ b/Contrib/PCC/Trigonometry/Vectors/VectorOperations70.pg @@ -0,0 +1,151 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(December 2015) +## Institution(Hope College) +## Author(Paul Pearson) +## Level(2) +## MO(1) +## KEYWORDS('vectors','vector operations') + +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "contextLimitedVector.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "scaffold.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +TEXT(beginproblem()); +$refreshCachedImages = 1; +$showPartialCorrectAnswers = 1; + +############################################### + + +Context("LimitedVector-coordinate")->variables->are(x=>'Real',y=>'Real'); +Context()->flags->set( ijk=>0 ); + +# Construct graph canvas + +$pixels = 300; +$gr = init_graph(-7,-7,7,7, axes=>[0,0], size=>[$pixels,$pixels]); +$gr -> lb('reset'); + +# manually draw the grid +foreach my $j (-6..6) { + $gr -> moveTo($j,-7); + $gr -> lineTo($j,7,'gray',1); + $gr -> moveTo(-7,$j); + $gr -> lineTo(7,$j,'gray',1); +} + +# Graph labels and functions +$gr -> lb(new Label ( 6.5,0,'x','black','left','bottom')); +$gr -> lb(new Label ( 0.25,6.5,'y','black','left','bottom')); + +foreach my $j (1..6) { + $gr -> lb(new Label ( $j,-0.5, $j,'black','center','middle')); + $gr -> lb(new Label (-$j,-0.5,-$j,'black','center','middle')); + $gr -> lb(new Label (-0.5, $j, $j,'black','center','middle')); + $gr -> lb(new Label (-0.5,-$j,-$j,'black','center','middle')); +} + +# Vector coordinates +($Ax,$Ay) = (random(1,4,1), random(1,4,1)); +($Bx,$By) = (random(-4,-1,1), random(1,4,1)); +($Cx,$Cy) = (non_zero_random(-3,3,1),random(-4,-1,1)); + +# Plot coordinate vectors with tails at the origin +$gr->moveTo(0,0); $gr->arrowTo($Ax,$Ay,'blue',3); +$gr->moveTo(0,0); $gr->arrowTo($Bx,$By,'blue',3); +$gr->moveTo(0,0); $gr->arrowTo($Cx,$Cy,'blue',3); +$gr->lb(new Label ($Ax,$Ay+0.5,' a ','blue','left','middle')); +$gr->lb(new Label ($Bx,$By+0.5,' b ','blue','right','middle')); +$gr->lb(new Label ($Cx,$Cy-0.5,' c ','blue','left','middle')); + +$a = Vector("<$Ax,$Ay>"); +$b = Vector("<$Bx,$By>"); +$c = Vector("<$Cx,$Cy>"); + +$x1 = random(-5,-2,1); +do { $x2 = random(2,5,1)*random(-1,1,2); } until ($x1 != $x2); +do { $x3 = random(2,5,1)*random(-1,1,2); } until ($x3 != $x1 && $x3 != $x2); + +$alt = "In a coordinate system, 3 vectors start at the origin. Vector a points to ($Ax,$Ay); Vector b points to ($Bx,$By); Vector c points to ($Cx,$Cy)."; + +############################################### + +BEGIN_PGML + +>> [@ image(insertGraph($gr), width=>$pixels, height=>$pixels, tex_size=>900, extra_html_tags => "alt = '$alt' title = '$alt' ") @]* << + +[@KeyboardInstructions( +"\n" +.'* Enter a vector, like [`<0,1>`]' +)@]** + +Answer the following questions. + + + [`\vec{a}=`] [______________]{$a} + + [`\vec{b}=`] [______________]{$b} + + [`\vec{c}=`] [______________]{$c} + + [` \vec{a} + \vec{b} + \vec{c} = `] [___________________]{"<$Ax+$Bx+$Cx, $Ay+$By+$Cy>"} + + [` [$x1] \vec{a} + [$x2]\vec{b} + [$x3] \vec{c} = `] [___________________]{"<$x1*$Ax+$x2*$Bx+$x3*$Cx, $x1*$Ay+$x2*$By+$x3*$Cy>"} + +Find a vector [` \vec{d} `] such that [` \vec{a} + \vec{c} + \vec{d} = \vec{0} `]. + + + [` \vec{d} = `] [___________________]{"<-($Ax+$Cx), -($Ay+$Cy)>"} + +END_PGML + +############################################### + +$Dx = -1*$Ax-1*$Cx; +$Dy = -1*$Ay-1*$Cy; + +BEGIN_PGML_SOLUTION + +By the given graph, we can see + + [``\vec{a} = [$a], \vec{b} = [$b], \vec{c} = [$c] ``] + + [`` \begin{aligned} + \vec{a} + \vec{b} + \vec{c} &= [$a]+[$b]+[$c] \\ + &= <[$Ax]+([$Bx])+([$Cx]), [$Ay]+([$By])+([$Cy])> \\ + &= <[$Ax+$Bx+$Cx], [$Ay+$By+$Cy]> + \end{aligned} ``] + + [`` \begin{aligned} + [$x1] \vec{a} + [$x2]\vec{b} + [$x3] \vec{c} + &= [$x1]<[$Ax],[$Ay]> + [$x2]<[$Bx],[$By]> + [$x3]<[$Cx],[$Cy]> \\ + &= <[$x1*$Ax],[$x1*$Ay]> + <[$x2*$Bx],[$x2*$By]> + <[$x3*$Cx],[$x3*$Cy]> \\ + &= <[$x1*$Ax]+[$x2*$Bx]+[$x3*$Cx], [$x1*$Ay]+[$x2*$By]+[$x3*$Cy]> \\ + &= <[$x1*$Ax+$x2*$Bx+$x3*$Cx], [$x1*$Ay+$x2*$By+$x3*$Cy]> + \end{aligned} ``] + +If [` \vec{a} + \vec{c} + \vec{d} = \vec{0} `], we have: + + [`` \begin{aligned} + \vec{a} + \vec{c} + \vec{d} &= \vec{0} \\ + \vec{d} &= -\vec{a} - \vec{c} \\ + \vec{d} &= -<[$Ax],[$Ay]>-<[$Cx],[$Cy]> \\ + \vec{d} &= <-([$Ax])-([$Cx]),-([$Ay])-([$Cy])> \\ + \vec{d} &= <[$Dx],[$Dy]> + \end{aligned} ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/Contrib/PCC/checkLibDevsFull b/Contrib/PCC/checkLibDevsFull new file mode 100644 index 0000000000..e28f136de9 --- /dev/null +++ b/Contrib/PCC/checkLibDevsFull @@ -0,0 +1,6 @@ +for each in dear horton insalata jones jordan kling leavitt reynolds ross spoddeck vega yao +do ( cd /opt/webwork/courses/$each-LibDev/templates/local/PCC/; + echo "$each " + sudo git status; +) +done diff --git a/Contrib/PCC/pointToolExamples.tgz b/Contrib/PCC/pointToolExamples.tgz new file mode 100644 index 0000000000..2c154c3db9 Binary files /dev/null and b/Contrib/PCC/pointToolExamples.tgz differ diff --git a/Contrib/PCC/processLibDevsFull b/Contrib/PCC/processLibDevsFull new file mode 100644 index 0000000000..169e39532e --- /dev/null +++ b/Contrib/PCC/processLibDevsFull @@ -0,0 +1,28 @@ +echo "checking out develop" +sudo git checkout develop +# +for each in dear horton insalata jones jordan kling leavitt reynolds ross spoddeck vega yao +do ( echo "pulling from $each develop"; + sudo git fetch $each develop; + sudo git pull $each develop ) +done + +# +echo "checking out master" +sudo git checkout master +echo "merging develop into master" +sudo git merge develop +# +for each in dear horton insalata jones jordan kling leavitt reynolds ross spoddeck vega yao +do ( echo "pushing to $each master"; + sudo git push $each master ) +done +# +for each in dear horton insalata jones jordan kling leavitt reynolds ross spoddeck vega yao +do ( cd /opt/webwork/courses/$each-LibDev/templates/local/PCC/; + echo "merging $each master into $each develop"; + sudo git merge master; + echo "setting all files in $each develop to be owned by www-data"; + sudo chown -R www-data . +) +done diff --git a/OpenProblemLibrary/PCC/.gitignore b/OpenProblemLibrary/PCC/.gitignore new file mode 100644 index 0000000000..84be62f0d6 --- /dev/null +++ b/OpenProblemLibrary/PCC/.gitignore @@ -0,0 +1,2 @@ +processLibDevs +checkLibDevs diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation10.pg new file mode 100644 index 0000000000..88d3f241a2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation10.pg @@ -0,0 +1,73 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following absolute value equation +# |x|=2 +# +# Last updated: Yao 7/27/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); + +$a = random(1,10,1); +$aN = -$a; +$ans = Formula("{$a,$aN}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve this equation + + [` |[$var]| = [$a] `] + +* Enter solutions in set notation. + + [__________________________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Because + + [`|[$a]|=[$a]`] and [`|-[$a]|=[$a]`], + +there are two solutions for [`|[$var]|=[$a]`]: + + [`[$var]=[$a]`] or [`[$var]=-[$a]`]. + +The solutions are [`[$ans]`] in set notation. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation100.pg index 34c0a18799..250bfea5ae 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation100.pg @@ -9,15 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(AbsVal5) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -25,39 +22,15 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -#Context("LimitedRadical"); -Context("Numeric"); -Context()->noreduce('(-x)-y','(-x)+y'); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); @@ -74,7 +47,7 @@ $e = $a*$absValue+$d; $ans1 = ($absValue-$c)/$b; $ans2 = (-$absValue-$c)/$b; -$ans = Compute("$var = $ans1, $var = $ans2"); +$ans = Formula("{$ans1,$ans2}"); ############################################## @@ -82,24 +55,14 @@ TEXT(beginproblem()); BEGIN_PGML Solve this equation - [` [$a] | [$b][$var]+[$c] |+[$d] = [$e] `] - -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* - - [__________________________________] + [` [$a] \left| [$b][$var]+[$c] \right|+[$d] = [$e] `] +* Enter solutions in set notation. + [__________________________________]{$ans} END_PGML -############################################## - - -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - - ############################################## $s1 = ($e-$d)/$a; @@ -111,11 +74,11 @@ First, we need to separate the absolute value part: [`` \begin{aligned}[t] - [$a] | [$b][$var]+[$c] |+[$d] &= [$e] \\ - [$a] | [$b][$var]+[$c] |+[$d] \mathbf{{}-[$d]} &= [$e] \mathbf{{}-[$d]}\\ - [$a] | [$b][$var]+[$c] | &= [$e-$d] \\ - \frac{[$a] | [$b][$var]+[$c] |}{[$a]} &= \frac{[$e-$d]}{[$a]} \\ - |[$b][$var]+[$c]| &= [$s1] + [$a] \left| [$b][$var]+[$c] \right|+[$d] &= [$e] \\ + [$a] \left| [$b][$var]+[$c] \right|+[$d] \mathbf{{}-[$d]} &= [$e] \mathbf{{}-[$d]}\\ + [$a] \left| [$b][$var]+[$c] \right| &= [$e-$d] \\ + \frac{[$a] \left| [$b][$var]+[$c] \right|}{[$a]} &= \frac{[$e-$d]}{[$a]} \\ + \left|[$b][$var]+[$c]\right| &= [$s1] \end{aligned} ``] @@ -123,11 +86,11 @@ Next, we will break the absolute value equation into two parts. As an easier exa [`x=1 \text{ or } x=-1`]. -Similarly, to remove the absolute value symbol, we break [`|[$b][$var]+[$c]| = [$s1]`] into two parts: +Similarly, to remove the absolute value symbol, we break [`\left|[$b][$var]+[$c]\right| = [$s1]`] into two parts: [`` \begin{aligned}[t] - &&|[$b][$var]+[$c]| = [$s1] \\ + &&\left|[$b][$var]+[$c]\right| = [$s1] \\ [$b][$var]+[$c] &= [$s1] &\text{ or }&& [$b][$var]+[$c] &= -[$s1] \\ [$b][$var]+[$c] \mathbf{{}-[$c]} &= [$s1] \mathbf{{}-[$c]} &\text{ or }&& [$b][$var]+[$c] \mathbf{{}-[$c]} &= -[$s1] \mathbf{{}-[$c]} \\ [$b][$var] &= [$s1-$c] &\text{ or }&& [$b][$var] &= [$s2] \\ @@ -136,6 +99,8 @@ Similarly, to remove the absolute value symbol, we break [`|[$b][$var]+[$c]| = [ \end{aligned} ``] +The solutions are [`[$ans]`] in set notation. + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation110.pg index 3da69e4891..9b33934ff2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation110.pg @@ -9,15 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(AbsVal1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value','fraction') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -25,38 +22,15 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("Numeric"); -Context()->noreduce('(-x)-y','(-x)+y'); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); @@ -69,7 +43,7 @@ do { $ans2 = (-$d*$c-$b)/$a; } until ( (int($d)==$d) && (int($ans2)==$ans2) && ($d>0) ); -$ans = Compute("$var = $ans1, $var = $ans2"); +$ans = Formula("{$ans1,$ans2}"); ############################################## @@ -79,22 +53,12 @@ Solve this equation [`` \left| \frac{[$a][$var]+[$b]}{[$c]} \right| = [$d] ``] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* - - [__________________________________] - +* Enter solutions in set notation. + [__________________________________]{$ans} END_PGML -############################################## - - -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - - ############################################## BEGIN_PGML_SOLUTION @@ -122,6 +86,8 @@ The full solution is: \end{aligned} ``] +The solutions are [`[$ans]`] in set notation. + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation120.pg index bd938c8bcb..db1b95483f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation120.pg @@ -9,14 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value','fraction') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -24,38 +22,15 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("Numeric"); -Context()->noreduce('(-x)-y','(-x)+y'); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); @@ -67,9 +42,9 @@ do { $d = abs($a*$ans1+$b)/$c; $ans2 = (-$d*$c-$b)/$a; if ($ans1 == $ans2) {$ans2 = ($d*$c-$b)/$a;} -} until ( (int($d)==$d) && (int($ans2)==$ans2) && $d != 0 ); +} until ( (int($d)==$d) && (int($ans2)==$ans2) && ($d!=0) ); -$ans = Compute("$var = $ans1, $var = $ans2"); +$ans = Formula("{$ans1,$ans2}"); ############################################## @@ -79,22 +54,12 @@ Solve this equation [`` \frac{ \left| [$a][$var]+[$b] \right| }{[$c]} = [$d] ``] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* - - [__________________________________] - +* Enter solutions in set notation. + [__________________________________]{$ans} END_PGML -############################################## - - -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - - ############################################## BEGIN_PGML_SOLUTION @@ -126,6 +91,8 @@ We have: \end{aligned} ``] +The solutions are [`[$ans]`] in set notation. + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation130.pg new file mode 100644 index 0000000000..5434940279 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation130.pg @@ -0,0 +1,178 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve absolute value inequality like |2x-1|=3 with a calculator. +# +# Last edited by Carl Yao 04/25/2015 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','absolute value','equation','calculator') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 10; + +do { + $a = random(2,5,1); + $b = non_zero_random(-5,5,1); + $c = random(1,5,1); + $ansLeft = (-$b-$c)/$a; + $ansRight = ($c-$b)/$a; +} until ( ($ansLeft>= -$reach+1) && ($ansRight<=$reach-1) && ($ansLeft==int($ansLeft)) && ($ansRight==int($ansRight)) ); + +$func1 = Compute("abs($a*x+$b)")->reduce; +$func2 = Compute("$c"); + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); + +$ans = Formula("{$ansLeft,$ansRight}"); + +Context("Numeric"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-6,6],[-6,6],centerOrigin=>1); + +$topLeftX = (-$max[1]-$b)/$a; +$topLeftY = $max[1]; +$topRightX = ($max[1]-$b)/$a; +$topRightY = $max[1]; +$vertexX = -$b/$a; +$vertexY = 0; + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + add_functions($gr[$i], "$func1 for x in <$min[0],$max[0]> using color:blue and weight:2"); + add_functions($gr[$i], "$func2 for x in <$min[0],$max[0]> using color:red and weight:2"); + + $gr[$i]->stamps( closed_circle($ansLeft,$c,'black') ); + $gr[$i]->stamps( closed_circle($ansRight,$c,'black') ); + + $gr[$i]->lb( new Label($topLeftX+1,$max[1],"y1=$func1",'blue','left','top')); + $gr[$i]->lb( new Label($ansLeft-1,$c,"y2=$func2",'red','right','top')); +} + +$ALT = "The graph has two functions. The first function looks like the shape of letter V. It starts at ($topLeftX,$topLeftY), goes down to ($vertexX,$vertexY), and then goes back up to ($topRightX,$topRightY). The second function is a horizontal line, y=$c. These two functions intersects at two points: ($ansLeft,$c) and ($ansRight,$c)."; + +############################################## + + + +BEGIN_PGML + +*With a calculator*, solve this equation: + + [`` [$func1] = [$func2] ``] + +* Enter solutions in set notation. + + [__________________________________]{$ans} + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +To solve [` [$func1] = [$func2] `] by graphing, we treat [`[$func1]`] and [`[$func2]`] as two functions. We will graph both functions. + +For TI-89, press Diamond, F1. Here we assign [`[$func1]`] to "y1", and [`[$func2]`] to "y2". To input the absolute value function, press 2nd, 5, right arrow, choose the second option. Or, you can simply enter letters 'a', 'b' and 's' one by one. For example, to input the letter 'a', press alpha, =. + +For Casio ClassPad 330, press Menu, Graph&Tables, assign [`[$func1]`] to "y1", and [`[$func2]`] to "y2". To input the absolute value function, press Keyboard button, tap the button |x|. Or, press Keyboard button, go to the "abc" tab, and then tap 'a', 'b', 's'. + +To look at the graph, press Diamond, F3 on TI-89, or tap the graph icon on Casio. If you cannot see where these two functions intersect on the screen, adjust your Window settings. + +For TI-89, as you are looking at the graph, press F2, choose option 6 (ZoomStd). This resets the window to default, which is [` [-10,10] `] on both [`x`] and [`y`] axis. + +For Casio ClassPad 300, as you look at the graph, tap Zoom, Quick Standard. This resets the window to default, which is [` [-10,10] `] on both [`x`] and [`y`] axis. + +You should see a graph similar to this one: + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Next, we need to locate the intersections of these two functions. + +##TI-89 Instructions + +1. Once we can see the intersections in the graph window, press F5, choose Option 5 (Intersection). + +2. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +3. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +4. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +5. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +6. The calculator will display the intersection. + +7. Repeat Step 4 through Step 6 to find the second intersection. + +##Casio ClassPad 330 Instructions + +1. Once we can see the intersections in the graph window, tap Analysis, G-Solve, Intersect. + +2. The calculator will display one intersection. + +3. Use the left/right arrow buttons to see the other intersection. + +These two intersections are [` ([$ansLeft],[$c]) `] and [` ([$ansRight],[$c]) `]. + +The solutions of [` [$func1] = [$func2] `] are [`[$ans]`] in set notation. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation140.pg new file mode 100644 index 0000000000..ed2022764b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation140.pg @@ -0,0 +1,156 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve absolute value inequality like 1-|2x-1|=3 with a calculator. +# There is no solution +# +# Last edited by Carl Yao 04/25/2015 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','absolute value','equation','calculator') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "parserOneOf.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("FiniteSolutionSets"); + +$ans = OneOf("no solution,{}"); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 10; + + + $a = random(1,3,1); + $b = non_zero_random(-5,5,1); + $c = non_zero_random(-5,5,1); + $d = random(4,6,1); + +$upOrDown = -1; +$func1 = Compute("$a - abs($b*x+$c)")->reduce; +$func2 = Compute("$d"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-6,6],[-6,6],centerOrigin=>1); + +if ( ($func1->eval(x=>$min[0]) > $min[1]) && ($func1->eval(x=>$min[0]) < $max[1]) ) { + $leftX = $min[0]; + $leftY = $func1->eval(x=>$min[0]); +} else { + $leftX = min( (-($a-$min[1])-$c)/$b, (($a-$min[1])-$c)/$b); + $leftY = $min[1]; +} + +$vertexX = -$b/$c; +$vertexY = $a; + +if ( ($func1->eval(x=>$max[0]) > $min[1]) && ($func1->eval(x=>$max[0]) < $max[1]) ) { + $rightX = $max[0]; + $rightY = $func1->eval(x=>$max[0]); +} else { + $rightX = max( (-($a-$min[1])-$c)/$b, (($a-$min[1])-$c)/$b); + $rightY = $min[1]; +} + + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + add_functions($gr[$i], "$func1 for x in <$min[0],$max[0]> using color:blue and weight:2"); + add_functions($gr[$i], "$func2 for x in <$min[0],$max[0]> using color:red and weight:2"); + + $gr[$i]->lb( new Label($leftX+0.5,$leftY+0.5,"y1=$func1",'blue','left','bottom')); + $gr[$i]->lb( new Label($min[0]+0.5,$d+0.5,"y2=$func2",'red','left','bottom')); +} + +$ALT = "The graph has two functions. The first function looks like the shape of an upside down letter V. It starts at ($leftX,$leftY), goes to the vertex ($vertexX,$vertexY), and then goes to ($rightX,$rightY). The second function is a horizontal line, y=$d."; + +############################################## + + + +BEGIN_PGML + +*With a calculator*, solve this equation: + + [`` [$func1] = [$func2] ``] + +* Enter solutions in set notation. + + [__________________________________]{$ans} + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +To solve [` [$func1] = [$func2] `] by graphing, we treat [`[$func1]`] and [`[$func2]`] as two functions. We will graph both functions. + +For TI-89, press Diamond, F1. Here we assign [`[$func1]`] to "y1", and [`[$func2]`] to "y2". To input the absolute value function, press 2nd, 5, right arrow, choose the second option. Or, you can simply enter letters 'a', 'b' and 's' one by one. For example, to input the letter 'a', press alpha, =. + +For Casio ClassPad 330, press Menu, Graph&Tables, assign [`[$func1]`] to "y1", and [`[$func2]`] to "y2". To input the absolute value function, press Keyboard button, tap the button |x|. Or, press Keyboard button, go to the "abc" tab, and then tap 'a', 'b', 's'. + +To look at the graph, press Diamond, F3 on TI-89, or tap the graph icon on Casio. + +For TI-89, as you are looking at the graph, press F2, choose option 6 (ZoomStd). This resets the window to default, which is [` [-10,10] `] on both [`x`] and [`y`] axis. + +For Casio ClassPad 300, as you look at the graph, tap Zoom, Quick Standard. This resets the window to default, which is [` [-10,10] `] on both [`x`] and [`y`] axis. + +You should see a graph similar to this one: + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since these two functions don't intersect with each other, [` [$func1] = [$func2] `] has no solution. The solution is [`\{ \}`] in set notation. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation150.pg new file mode 100644 index 0000000000..eb12755207 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation150.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Template: +# Solve the following absolute value equation +# |3x+4|=|2x-5| +# +# Last updated: Yao 7/19/2016 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); + +do { + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); + do {$c = non_zero_random(-10,10,1);} until (abs($a)!=abs($c)); + do {$d = non_zero_random(-10,10,1);} until (abs($b)!=abs($d)); + $ans1 = ($d-$b)/($a-$c); + $ans2 = (-$b-$d)/($a+$c); +} until ( ($ans1==int($ans1)) && ($ans2==int($ans2)) && ($ans1!=$ans2) ); + +$left = Compute("$a*$var+$b")->reduce; +$right = Compute("$c*$var+$d")->reduce; +$ans = Formula("{$ans1,$ans2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve this equation + + [` \left| [$left] \right| = \left| [$right] \right| `] + +* Enter solutions in set notation. + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$s1 = Compute("-$c*$var-$d")->reduce; +$s2 = -$d-$b; +$s3 = $a-$c; +$s4 = Compute("$s3*$var")->reduce; +$s5 = $a+$c; +$s6 = Compute("$s5*$var")->reduce; + +BEGIN_PGML_SOLUTION + +We will break the absolute value equation into two parts. As an easier example, when we solve the equation [`|x|=1`], we break it into: + + [`x=1 \text{ or } x=-1`]. + +Similarly, to remove the absolute value symbol, we break [` \left| [$left] \right| = \left| [$right] \right| `] into two parts: + + [`` +\begin{aligned}[t] + && \left| [$left] \right| = \left| [$right] \right| \\ + [$left] &= [$right] &\text{ or }&& [$left] &= -([$right]) \\ + [$left] &= [$right] &\text{ or }&& [$left] &= [$s1] \\ + [$a][$var]+[$b] \mathbf{{}-[$c][$var]-[$b]} &= [$right] \mathbf{{}-[$c][$var]-[$b]} &\text{ or }&& [$a][$var]+[$b] \mathbf{{}+[$c][$var]-[$b]} &= [$s1] \mathbf{{}+[$c][$var]-[$b]} \\ + [$s4] &= [$d-$b] &\text{ or }&& [$s6] &= [$s2] \\ + [$var] &= [$ans1] &\text{ or }&& [$var] &= [$ans2] +\end{aligned} + ``] + +The solutions are [`[$ans]`] in set notation. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation20.pg index a3a4f44a18..d0373f1fa1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation20.pg @@ -9,13 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -24,29 +23,18 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserAssignment.pl", "PCCmacros.pl", - "answerHints.pl", - "SolveLinearEquationPCC.pl", - "contextFraction.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -Context("Numeric"); -$var = RandomVariableName(); -Context()->variables->are($var => 'Real'); -Context()->noreduce('(-x)-y','(-x)+y'); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); $ans = 0; -@vArray = ($var); -@aArray = ($ans); -($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); - ############################################## TEXT(beginproblem()); @@ -55,20 +43,12 @@ Solve this equation [` |[$var]| = [$ans] `] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* - - [__________________________________] - +* Enter solutions in set notation. + [__________________________________]{$ans} END_PGML -############################################## - - -answerCheck($ansEqRef, $eqTypesRef); - ############################################## @@ -77,6 +57,8 @@ BEGIN_PGML_SOLUTION Since [`+0`] and [`-0`] are both [`0`], there is only one solution: [`[$var]=0`] + +The solution is [`[$ans]`] in set notation. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation21.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation21.pg new file mode 100644 index 0000000000..87557eb832 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation21.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following absolute value equation +# |x|=0 +# +# Last updated: Yao 7/27/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); + +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$aN = -$a; +$func = Compute("$var+$a")->reduce; +$ans = Formula("{$aN}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve this equation + + [` \left|[$func]\right| = 0 `] + +Enter your solutions in set notation. + + [__________________________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +As an easier example, when we solve the equation [`|x|=1`], we break it into: + + [`x=1 \text{ or } x=-1`]. + +Similarly, to remove the absolute value symbol, we break [`\left|[$func]\right|=0`] into: + + [`[$func]=0 \text{ or } [$func]=-0 `]. + +However, since [`0=-0`], we only have one equation to solve: + + [`` +\begin{aligned}[t] + \left|[$func]\right| &= 0 \\ + [$func] &= 0 \\ + [$var] &= [$a*-1] +\end{aligned} + ``] + +The solution is [`[$ans]`] in set notation. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation30.pg index 52f38fdc02..93c01f16bd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation30.pg @@ -9,14 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -24,43 +22,21 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "parserOneOf.pl", + "PGcourse.pl", ); ############################################## -#Context("LimitedRadical"); -Context("Numeric"); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "no solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); + $a = random(-10,-1,1); -$ans = Compute("no real solutions"); +$ans = OneOf("no solution,{}"); ############################################## @@ -70,19 +46,12 @@ Solve this equation [` |[$var]| = [$a] `] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* +* Enter solutions in set notation. - [__________________________________] + [__________________________________]{$ans} END_PGML -############################################## - - -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - ############################################## @@ -90,6 +59,8 @@ BEGIN_PGML_SOLUTION The absolute value of a number is either positive or [`0`], so there is no solution for [`|[$var]|=[$a]`]. +The solution is [`\{ \}`] in set notation. + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation40.pg new file mode 100644 index 0000000000..d4ef43b24a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation40.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following absolute value equation +# |x-1|=2 +# +# Last updated: Yao 7/27/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,-1,1); +do {$b = non_zero_random(1,10,1);} until (abs($a)!=abs($b)); +$ans1 = $b-$a; +$ans2 = -$b-$a; +$ans = Formula("{$ans1,$ans2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve this equation + + [` |[$var]+[$a]| = [$b] `] + +* Enter solutions in set notation. + + [__________________________________]{$ans} + + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +As an easier example, when we solve the equation [`|x|=1`], we break it into: + + [`x=1 \text{ or } x=-1`]. + +Similarly, to remove the absolute value symbol, we break [`|[$var]+[$a]|=[$b]`] into: + + [`[$var]+[$a]=[$b] \text{ or } [$var]+[$a]=-[$b] `]. + +The full solution is: + + [`` +\begin{aligned}[t] + &&|[$var]+[$a]| = [$b] \\ + [$var]+[$a] &= [$b] &\text{ or }&& [$var]+[$a] &= -[$b] \\ + [$var]+[$a] \mathbf{{}-[$a]} &= [$b] \mathbf{{}-[$a]} &\text{ or }&& [$var]+[$a] \mathbf{{}-[$a]} &= -[$b] \mathbf{{}-[$a]} \\ + [$var] &= [$ans1] &\text{ or }&& [$var] &= [$ans2] +\end{aligned} + ``] + +The solutions are [`[$ans]`] in set notation. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation50.pg index 9859da96d9..2d040efdd0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation50.pg @@ -9,15 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(AbsVal5) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -25,38 +22,15 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -#Context("LimitedRadical"); -Context("Numeric"); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); @@ -66,7 +40,7 @@ do { } until ($b-$a>0); $ans1 = $b-$a; $ans2 = -($b-$a); -$ans = Compute("$var = $ans1, $var = $ans2"); +$ans = Formula("{$ans1,$ans2}"); ############################################## @@ -76,22 +50,12 @@ Solve this equation [` |[$var]|+[$a] = [$b] `] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* - - [__________________________________] - +* Enter solutions in set notation. + [__________________________________]{$ans} END_PGML -############################################## - - -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - - ############################################## BEGIN_PGML_SOLUTION @@ -115,6 +79,8 @@ Next, we break the absolute value equation into two parts: \end{aligned} ``] +The solutions are [`[$ans]`] in set notation. + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation60.pg index 04c75e2307..0e2c0cd4e5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation60.pg @@ -9,14 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -24,38 +22,15 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -#Context("LimitedRadical"); -Context("Numeric"); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); @@ -64,6 +39,7 @@ $b = -$a*random(1,5,1); $ans1 = $b/$a; $ans2 = -$b/$a; $ans = Compute("$var = $ans1, $var = $ans2"); +$ans = Formula("{$ans1,$ans2}"); ############################################## @@ -71,24 +47,16 @@ TEXT(beginproblem()); BEGIN_PGML Solve this equation - [` |[$a][$var]| = [$b] `] + [` \left|[$a][$var]\right| = [$b] `] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* +* Enter solutions in set notation. - [__________________________________] + [__________________________________]{$ans} END_PGML -############################################## - - -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - - ############################################## BEGIN_PGML_SOLUTION @@ -97,7 +65,7 @@ As an easier example, when we solve the equation [`|x|=1`], we break it into: [`x=1 \text{ or } x=-1`]. -Similarly, to remove the absolute value symbol, we break [`|[$a][$var]|=[$b]`] into: +Similarly, to remove the absolute value symbol, we break [`\left|[$a][$var]\right|=[$b]`] into: [`[$a][$var]=[$b] \text{ or } [$a][$var]=-[$b] `]. @@ -105,13 +73,15 @@ The full solution is: [`` \begin{aligned}[t] - &&|[$a][$var]| = [$b] \\ + &&\left|[$a][$var]\right| = [$b] \\ [$a][$var] &= [$b] &\text{ or }&& [$a][$var] &= -[$b] \\ \frac{[$a][$var]}{[$a]} &= \frac{[$b]}{[$a]} &\text{ or }&& \frac{[$a][$var]}{[$a]} &= \frac{-[$b]}{[$a]} \\ [$var] &= [$ans1] &\text{ or }&& [$var] &= [$ans2] \end{aligned} ``] +The solutions are [`[$ans]`] in set notation. + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation65.pg index b0afdba005..2073056d25 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation65.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation65.pg @@ -9,14 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -24,38 +22,15 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -#Context("LimitedRadical"); -Context("Numeric"); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); @@ -63,7 +38,7 @@ $a = non_zero_random(-10,-2,1); $b = $a*random(1,5,1); $ans1 = $b/$a; $ans2 = -$b/$a; -$ans = Compute("$var = $ans1, $var = $ans2"); +$ans = Formula("{$ans1,$ans2}"); ############################################## @@ -73,22 +48,14 @@ Solve this equation [` -|[$a][$var]| = [$b] `] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* +* Enter solutions in set notation. - [__________________________________] + [__________________________________]{$ans} END_PGML -############################################## - - -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - - ############################################## $s1 = -$b; @@ -121,6 +88,8 @@ The full solution is: \end{aligned} ``] +The solutions are [`[$ans]`] in set notation. + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation70.pg index f034c7761c..f91c5a1f63 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation70.pg @@ -9,14 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -24,45 +22,22 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "parserOneOf.pl", + "PGcourse.pl", ); ############################################## -#Context("LimitedRadical"); -Context("Numeric"); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "no solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); $a = non_zero_random(-10,-2,1); $b = $a*random(1,5,1); -$ans = Compute("no real solutions"); +$ans = OneOf("no solution,{}"); ############################################## @@ -70,29 +45,23 @@ TEXT(beginproblem()); BEGIN_PGML Solve this equation - [` |[$a][$var]| = [$b] `] + [` \left|[$a][$var]\right| = [$b] `] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* +* Enter solutions in set notation. - [__________________________________] + [__________________________________]{$ans} END_PGML -############################################## - - -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - - ############################################## BEGIN_PGML_SOLUTION -The absolute value of a number must be either positive or zero. This equation has no real solutions. +The absolute value of a number is either positive or [`0`], so there is no solution for [`\left|[$a][$var]\right| = [$b]`]. + +The solution is [`\{ \}`] in set notation. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation80.pg index a48b69ce5b..07692bbfdd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation80.pg @@ -9,14 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -24,38 +22,15 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -#Context("LimitedRadical"); -Context("Numeric"); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); @@ -63,7 +38,7 @@ $a = -1; $b = $a*random(1,5,1); $ans1 = $b/$a; $ans2 = -$b/$a; -$ans = Compute("$var = $ans1, $var = $ans2"); +$ans = Formula("{$ans1,$ans2}"); ############################################## @@ -73,22 +48,14 @@ Solve this equation [` -|[$var]| = [$b] `] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* +* Enter solutions in set notation. - [__________________________________] + [__________________________________]{$ans} END_PGML -############################################## - - -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - - ############################################## $s1=-1*$b; @@ -114,6 +81,8 @@ Next, we break the absolute value equation into two parts: \end{aligned} ``] +The solutions are [`[$ans]`] in set notation. + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation90.pg index c73f809ae8..c9faed27bb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation90.pg @@ -9,14 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -24,45 +22,22 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "parserOneOf.pl", + "PGcourse.pl", ); ############################################## -#Context("LimitedRadical"); -Context("Numeric"); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "no solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); $a = -1; $b = -$a*random(1,5,1); -$ans = Compute("no real solutions"); +$ans = OneOf("no solution,{}"); ############################################## @@ -70,23 +45,16 @@ TEXT(beginproblem()); BEGIN_PGML Solve this equation - [` -|[$var]| = [$b] `] + [` -\left|[$var]\right| = [$b] `] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* +* Enter solutions in set notation. - [__________________________________] + [__________________________________]{$ans} END_PGML -############################################## - - -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - ############################################## @@ -98,7 +66,7 @@ First, we need to separate the absolute value part: [`` \begin{aligned}[t] - -|[$var]| &=[$b] \\ + -\left|[$var]\right| &=[$b] \\ -1 \cdot |[$var]| &=[$b] \\ \frac{-1 \cdot |[$var]|}{-1} &= \frac{[$b]}{-1} \\ |[$var]| &= [$s1] @@ -107,6 +75,8 @@ First, we need to separate the absolute value part: The absolute value of a number must be either positive or zero. This equation has no real solutions. +The solution is [`\{ \}`] in set notation. + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation95.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation95.pg index 6dbfd9c6d7..069e5bac1a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation95.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation95.pg @@ -9,15 +9,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(AbsVal1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -25,39 +22,15 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", "PGML.pl", - "contextLimitedRadical.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); ############################################## -#Context("LimitedRadical"); -Context("Numeric"); -Context()->noreduce('(-x)-y','(-x)+y'); -Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); - -parser::Assignment->Allow; - -Context()->operators->redefine(',',using=>',',from=>'Numeric'); - Context()->operators->redefine('or',using=>',',from=>'Numeric'); - Context()->operators->set( - ','=>{string=>' or ',TeX=>'\hbox{ or }'}, - 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} - ); - Context()->lists->set(List => {separator => " or "}); - -# add solution strings to context- this means that if -# students enter these (and they are not correct), then -# WW will not give a Context warning -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>variable); Context()->variables->are($var=>'Real'); @@ -69,7 +42,7 @@ do { $ans1 = ($e-$c)/$b; $ans2 = (-$e-$c)/$b; -$ans = Compute("$var = $ans1, $var = $ans2"); +$ans = Formula("{$ans1,$ans2}"); ############################################## @@ -77,22 +50,14 @@ TEXT(beginproblem()); BEGIN_PGML Solve this equation - [` | [$b][$var]+[$c] | = [$e] `] + [` \left| [$b][$var]+[$c] \right| = [$e] `] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If there are no real solutions, enter *no real solutions* +* Enter solutions in set notation. - [__________________________________] + [__________________________________]{$ans} END_PGML -############################################## - - -$showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); - - ############################################## $s2 = -$e-$c; @@ -103,11 +68,11 @@ We will break the absolute value equation into two parts. As an easier example, [`x=1 \text{ or } x=-1`]. -Similarly, to remove the absolute value symbol, we break [`|[$b][$var]+[$c]| = [$e]`] into two parts: +Similarly, to remove the absolute value symbol, we break [`\left|[$b][$var]+[$c]\right| = [$e]`] into two parts: [`` \begin{aligned}[t] - &&|[$b][$var]+[$c]| = [$e] \\ + &&\left|[$b][$var]+[$c]\right| = [$e] \\ [$b][$var]+[$c] &= [$e] &\text{ or }&& [$b][$var]+[$c] &= -[$e] \\ [$b][$var]+[$c] \mathbf{{}-[$c]} &= [$e] \mathbf{{}-[$c]} &\text{ or }&& [$b][$var]+[$c] \mathbf{{}-[$c]} &= -[$e] \mathbf{{}-[$c]} \\ [$b][$var] &= [$e-$c] &\text{ or }&& [$b][$var] &= [$s2] \\ @@ -116,6 +81,8 @@ Similarly, to remove the absolute value symbol, we break [`|[$b][$var]+[$c]| = [ \end{aligned} ``] +The solutions are [`[$ans]`] in set notation. + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation96.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation96.pg new file mode 100644 index 0000000000..46d6c17302 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation96.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following absolute value equation +# |3x+4|+5=11 +# +# Last updated: Yao 7/27/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); + +do { + $b = -random(2,5,1); + $c = non_zero_random(-5,5,1); + $e = random(1,10,1); +} until ( ( ($e-$c)%$b==0 ) && ( (-$e-$c)%$b==0) ); + +$ans1 = ($e-$c)/$b; +$ans2 = (-$e-$c)/$b; +$ans = Formula("{$ans1,$ans2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve this equation + + [` \left| [$c]+[$b][$var] \right| = [$e] `] + +* Enter solutions in set notation. + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$s2 = -$e-$c; + +BEGIN_PGML_SOLUTION + +We will break the absolute value equation into two parts. As an easier example, when we solve the equation [`\left|x\right|=1`], we break it into: + + [`x=1 \text{ or } x=-1`]. + +Similarly, to remove the absolute value symbol, we break [`\left|[$c]+[$b][$var]\right| = [$e]`] into two parts: + + [`` +\begin{aligned}[t] + &&\left|[$c]+[$b][$var]\right| = [$e] \\ + [$c]+[$b][$var] &= [$e] &\text{ or }&& [$c]+[$b][$var] &= -[$e] \\ + [$c]+[$b][$var] \mathbf{{}-[$c]} &= [$e] \mathbf{{}-[$c]} &\text{ or }&& [$c]+[$b][$var] \mathbf{{}-[$c]} &= -[$e] \mathbf{{}-[$c]} \\ + [$b][$var] &= [$e-$c] &\text{ or }&& [$b][$var] &= [$s2] \\ + \frac{[$b][$var]}{[$b]} &= \frac{[$e-$c]}{[$b]} &\text{ or }&& \frac{[$b][$var]}{[$b]} &= \frac{[$s2]}{[$b]} \\ + [$var] &= [$ans1] &\text{ or }&& [$var] &= [$ans2] +\end{aligned} + ``] + +The solutions are [`[$ans]`] in set notation. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation97.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation97.pg new file mode 100644 index 0000000000..3389f15e62 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation97.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following absolute value equation +# |1/4 x + 4|=4 +# +# Last updated: Yao 7/27/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); + +$den = random(2,5,1); +$a = non_zero_random(-10,10,1); +do {$b = random(2,10,1);} until (abs($a)!=abs($b)); + +$ans1 = ($b-$a)*$den; +$ans2 = (-$b-$a)*$den; +$ans = Formula("{$ans1,$ans2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve this equation + + [` \left| \frac{1}{[$den]}[$var]+[$a] \right| = [$b] `] + +* Enter solutions in set notation. + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$b-$a; + +BEGIN_PGML_SOLUTION + +We will break the absolute value equation into two parts. As an easier example, when we solve the equation [`\left|x\right|=1`], we break it into: + + [`x=1 \text{ or } x=-1`]. + +Similarly, to remove the absolute value symbol, we break [`\left| \frac{1}{[$den]}[$var]+[$a] \right| = [$b]`] into two parts: + + [`` +\begin{aligned}[t] + &&\left| \frac{1}{[$den]}[$var]+[$a] \right| = [$b] \\ + \frac{1}{[$den]}[$var]+[$a] &= [$b] &\text{ or }&& \frac{1}{[$den]}[$var]+[$a] &= -[$b] \\ + \frac{1}{[$den]}[$var]+[$a] \mathbf{{}-[$a]} &= [$b] \mathbf{{}-[$a]} &\text{ or }&& \frac{1}{[$den]}[$var]+[$a] \mathbf{{}-[$a]} &= -[$b] \mathbf{{}-[$a]} \\ + \frac{1}{[$den]}[$var] &= [$b-$a] &\text{ or }&& \frac{1}{[$den]}[$var] &= [$s1] \\ + \frac{1}{[$den]}[$var] \mathbf{\cdot([$den])} &= [$b-$a] \mathbf{\cdot([$den])} &\text{ or }&& \frac{1}{[$den]}[$var]\mathbf{\cdot([$den])} &= [$s1]\mathbf{\cdot([$den])} \\ + [$var] &= [$ans1] &\text{ or }&& [$var] &= [$ans2] +\end{aligned} + ``] + +The solutions are [`[$ans]`] in set notation. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation98.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation98.pg new file mode 100644 index 0000000000..6ad4e0acc1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueEquation98.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following absolute value equation +# |1/4 x + 4|=4 +# +# Last updated: Yao 7/27/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +Context()->flags->remove("NumberCheck"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); + +do { +$a = random(-10,10,1)+random(1,9,1)/10; +do {$b = random(-10,10,1)+random(1,9,1)/10;} until (abs($a)!=abs($b)); +$ans1 = random(-10,10,1)+random(1,9,1)/10; +$c = $a+$b*$ans1; +$ans2 = (-$c-$a)/$b; +} until ($c>0) && ($ans2*100 == int($ans2*100)); + +$ans = Formula("{$ans1,$ans2}"); + +$func = Compute("$a+$b*$var")->reduce; + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve this equation + + [` \left| [$func] \right| = [$c] `] + +* Enter solutions in set notation. + + [__________________________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will break the absolute value equation into two parts. As an easier example, when we solve the equation [`\left|x\right|=1`], we break it into: + + [`x=1 \text{ or } x=-1`]. + +Similarly, to remove the absolute value symbol, we break [` \left| [$func] \right| = [$c] `] into two parts: + + [`` +\begin{aligned}[t] + &&\left| [$func] \right| = [$c] \\ + [$func] &= [$c] &\text{ or }&& [$func] &= [$c*-1] \\ + [$b][$var] &= [$c-$a] &\text{ or }&& [$func] &= [$c*-1-$a] \\ + [$var] &= [$ans1] &\text{ or }&& [$var] &= [$ans2] +\end{aligned} + ``] + +The solutions are [`[$ans]`] in set notation. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality10.pg new file mode 100644 index 0000000000..ad2ffc2f9d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality10.pg @@ -0,0 +1,162 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve absolute value inequality like |x|>2 +# +# Last edited by Carl Yao 07/30/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$func = Compute("x"); +$symbol = (random(-1,1,2)>0) ? '>' : '\geq'; +$a = random(-$reach+2,-1,1); +$b = -$a; +$right = Compute("$b"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol eq '>' ? '<' : '<='; +$symbol1Show = $symbol eq '>' ? '>' : '>='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +$leftEnd = ($symbol eq ">") ? ')' : ']'; +$rightEnd = ($symbol eq ">") ? '(' : '['; +$ans = Compute("(-inf, $a $leftEnd U $rightEnd $b, inf)"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*1; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*1; +$aboveSpace = $reach*$aspectRatio*1; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$labelHeight = $reach*$aspectRatio/2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); + +if ($leftEnd eq ')') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($b,0,'blue') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($b,0,'blue') ); +}; + +$gr->moveTo($a,0); +$gr->arrowTo(-0.99*$reach,0,'blue',3); +$gr->moveTo($b,0); +$gr->arrowTo(0.99*$reach,0,'blue',3); + +if ( ($symbol eq '>') or ($symbol eq '\geq') ) { + $gr->lb( new Label($a,$labelHeight,"x $symbol0Show $a",'blue','right','middle')); + $gr->lb( new Label($b,$labelHeight,"x $symbol1Show $b",'blue','left','middle')); +} else { + $gr->lb( new Label(($a+$b)/2,$labelHeight,"$a $symbol0Show x $symbol0Show $b",'blue','center','middle')); +} + +$leftEndType = ($leftEnd eq ')') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq '(') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. Two segments are shaded. The first segment starts at $a, and goes toward negative infinity, while the endpoint $a is $leftEndType. The second segment starts at $b, and goes toward positive infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this inequality, and write your answer in *interval notation*. + + [`` | [$func] | [$symbol] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** + + [__________________________________]{$ans} + + + +END_PGML + + + +############################################## + +$symbolOpp = ($symbol eq '>') ? '<' : '\leq'; +$sampleLeft = $a-1; +$sampleRight = $b+1; + +############################################## + + +BEGIN_PGML_SOLUTION + +We break [` | x | [$symbol] [$b] `] into two pieces: + + [`` x [$symbolOpp] [$a] \text{ or } x [$symbol] [$b] ``] + +Numbers in either set will make the inequality true. For example: + + [`` | [$sampleLeft] | [$symbol] [$right] \text{ and } |[$sampleRight]| [$symbol] [$right] ``] + +In interval notation, the solution is [`[$ans]`]. The following graph shows the solution set. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality100.pg new file mode 100644 index 0000000000..596d1e8ce5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality100.pg @@ -0,0 +1,195 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve absolute value inequality like 4|1-2x|-4<=8 +# +# Last edited by Carl Yao 08/06/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 10; + +$symbol = (random(-1,1,2)>0) ? '<' : '\leq'; + +do { + $b = random(2,4,1); + $c = non_zero_random(1,5,1); + $a = random(1,5,1); + $ansLeft = -$a+$c; + $ansRight = $a+$c; +} until ( ($ansLeft>= -$reach+3) && ($ansRight<=$reach-3) ); + +$d = $b*$c; +$e = $a*$b; + +$f = random(2,5,1); +$g = non_zero_random(-5,5,1); +$h = $f*$e+$g; + +$func = Compute("$f*abs($d-$b*x)+$g")->reduce; +$right = Compute("$h"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol eq '<' ? '<' : '<='; +$symbol1Show = $symbol eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +$leftEnd = ($symbol eq "<") ? '(' : '['; +$rightEnd = ($symbol eq "<") ? ')' : ']'; +$ans = Compute("$leftEnd $ansLeft, $ansRight $rightEnd"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*1; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*1; +$aboveSpace = $reach*$aspectRatio*1; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$labelHeight = $reach*$aspectRatio/2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($ansLeft,-$belowSpace/4,$ansLeft,'blue','center','top')); +$gr->lb( new Label($ansRight,-$belowSpace/4,$ansRight,'blue','center','top')); + +if ($leftEnd eq '(') { + $gr->stamps( open_circle($ansLeft,0,'blue') ); + $gr->stamps( open_circle($ansRight,0,'blue') ); +} else { + $gr->stamps( closed_circle($ansLeft,0,'blue') ); + $gr->stamps( closed_circle($ansRight,0,'blue') ); +}; + +$gr->moveTo($ansLeft,0); +$gr->lineTo($ansRight,0,'blue',3); + +if ( ($symbol eq '>') or ($symbol eq '\geq') ) { + $gr->lb( new Label($ansLeft,$labelHeight,"x $symbol0Show $ansLeft",'blue','right','middle')); + $gr->lb( new Label($ansRight,$labelHeight,"x $symbol1Show $ansRight",'blue','left','middle')); +} else { + $gr->lb( new Label(($ansLeft+$ansRight)/2,$labelHeight,"$ansLeft $symbol0Show x $symbol0Show $ansRight",'blue','center','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line with one segment shaded. The segment starts at $ansLeft, and ends at $ansRight. The endpoint $ansLeft is $leftEndType, and the endpoint $ansRight is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this inequality, and write your answer in *interval notation*. + + [`` [$func] [$symbol] [$h] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** + + [__________________________________]{$ans} + +END_PGML + + + +############################################## + +$symbolOpp = ($symbol eq '<') ? '>' : '\geq'; +$s1 = -1*$e; + +############################################## + + +BEGIN_PGML_SOLUTION + +First, we need to separate the absolute value part: + + [`` +\begin{aligned} + [$func] &[$symbol] [$h] \\ + [$f] |[$d]-[$b]x| +[$g] \mathbf{{}-[$g]} &[$symbol] [$h] \mathbf{{}-[$g]} \\ + [$f] |[$d]-[$b]x| &[$symbol] [$h-$g] \\ + \frac{[$f] |[$d]-[$b]x|}{[$f]} &[$symbol] \frac{[$h-$g]}{[$f]} \\ + |[$d]-[$b]x| &[$symbol] [$e] +\end{aligned} + ``] + +Before continuing, we look at an easier example: The solution of [` | x | [$symbol] 1 `] is: + + [`` -1 [$symbol] x [$symbol] 1 ``]. + +We solve [` |[$d]-[$b]x| [$symbol] [$e] `] in a similar way. The rest of the solution is: + + [`` +\begin{aligned} + &|[$d]-[$b]x| [$symbol] [$e] \\ + [$s1] &[$symbol] [$d]-[$b]x [$symbol] [$e] \\ + [$s1] \mathbf{{}-[$d]} &[$symbol] [$d]-[$b]x \mathbf{{}-[$d]} [$symbol] [$e] \mathbf{{}-[$d]}\\ + [$s1-$d] &[$symbol] -[$b] x [$symbol] [$e-$d] \\ + \frac{[$s1-$d]}{-[$b]} &[$symbolOpp] \frac{-[$b] x}{-[$b]} [$symbolOpp] \frac{[$e-$d]}{-[$b]} \\ + [$ansRight] &[$symbolOpp] x [$symbolOpp] [$ansLeft] +\end{aligned} + ``] + +In interval notation, the solution is [`[$ans]`]. Notice that the direction of inequality signs changed when we divided a negative number in the inequality. + +The following graph shows the solution set. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg index a6fafd8768..ca8ba7d312 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Absolute value inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(algIneq) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); @@ -128,11 +135,7 @@ Solve this inequality, and write your answer in *interval notation*. [`` [$func] [$symbol] [$f] ``] -Please type: - -* *inf* for [`\infty`], -* *no solution* if there are no real solutions -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** [__________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg index 154cd35566..e139b74b62 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Absolute value inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(algIneq) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); @@ -123,11 +130,7 @@ Solve this inequality, and write your answer in *interval notation*. [`` [$func] [$symbol] [$d] ``] -Please type: - -* *inf* for [`\infty`], -* *no solution* if there are no real solutions -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** [__________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality130.pg new file mode 100644 index 0000000000..86da9ce003 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality130.pg @@ -0,0 +1,197 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve absolute value inequality like |2x-1|>=3 with a calculator. +# +# Last edited by Carl Yao 08/06/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation','calculator') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 10; + +$symbol = (random(-1,1,2)>0) ? '>' : '\geq'; + +do { + $a = random(2,5,1); + $b = non_zero_random(-5,5,1); + $c = random(1,5,1); + $ansLeft = (-$b-$c)/$a; + $ansRight = ($c-$b)/$a; +} until ( ($ansLeft>= -$reach+1) && ($ansRight<=$reach-1) && ($ansLeft==int($ansLeft)) && ($ansRight==int($ansRight)) ); + +$func1 = Compute("abs($a*x+$b)")->reduce; +$func2 = Compute("$c"); + +#These are needed to show inequality symbols in dynamic images. +#$symbol0Show = $symbol eq '>' ? '<' : '<='; +#$symbol1Show = $symbol eq '>' ? '>' : '>='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +$leftEnd = ($symbol eq ">") ? ')' : ']'; +$rightEnd = ($symbol eq ">") ? '(' : '['; +$ans = Compute("(-inf, $ansLeft $leftEnd U $rightEnd $ansRight, inf)"); + + +Context("Numeric"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-6,6],[-6,6],centerOrigin=>1); + +$topLeftX = (-$max[1]-$b)/$a; +$topLeftY = $max[1]; +$topRightX = ($max[1]-$b)/$a; +$topRightY = $max[1]; +$vertexX = -$b/$a; +$vertexY = 0; + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + add_functions($gr[$i], "$func1 for x in <$min[0],$max[0]> using color:blue and weight:2"); + add_functions($gr[$i], "$func2 for x in <$min[0],$max[0]> using color:red and weight:2"); + + $gr[$i]->stamps( closed_circle($ansLeft,$c,'black') ); + $gr[$i]->stamps( closed_circle($ansRight,$c,'black') ); + + $gr[$i]->lb( new Label($topLeftX+1,$max[1],"y1=$func1",'blue','left','top')); + $gr[$i]->lb( new Label($ansLeft-1,$c,"y2=$func2",'red','right','top')); +} + +$ALT = "The graph has two functions. The first function looks like the shape of letter V. It starts at ($topLeftX,$topLeftY), goes down to ($vertexX,$vertexY), and then goes back up to ($topRightX,$topRightY). The second function is a horizontal line, y=$c. These two functions intersects at two points: ($ansLeft,$c) and ($ansRight,$c)."; + +############################################## + + + +BEGIN_PGML + +*With a calculator*, solve this inequality and write your answer in *interval notation*. + + [`` [$func1] [$symbol] [$func2] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** + + [__________________________________]{$ans} + +END_PGML + + + +############################################## + +$symbolWord = ($symbol eq '>') ? "greater than" : "greater than or equal to"; +$openOrClosed = ($symbol eq '>') ? "open" : "closed"; + +############################################## + + +BEGIN_PGML_SOLUTION + +To solve [` [$func1] [$symbol] [$func2] `] by graphing, we treat [`[$func1]`] and [`[$func2]`] as two functions. We will graph both functions. + +For TI-89, press Diamond, F1. Here we assign [`[$func1]`] to "y1", and [`[$func2]`] to "y2". To input the absolute value function, press 2nd, 5, right arrow, choose the second option. Or, you can simply enter letters 'a', 'b' and 's' one by one. For example, to input the letter 'a', press alpha, =. + +For Casio ClassPad 330, press Menu, Graph&Tables, assign [`[$func1]`] to "y1", and [`[$func2]`] to "y2". To input the absolute value function, press Keyboard button, tap the button |x|. Or, press Keyboard button, go to the "abc" tab, and then tap 'a', 'b', 's'. + +To look at the graph, press Diamond, F3 on TI-89, or tap the graph icon on Casio. If you cannot see where these two functions intersect on the screen, adjust your Window settings. + +For TI-89, as you are looking at the graph, press F2, choose option 6 (ZoomStd). This resets the window to default, which is [` [-10,10] `] on both [`x`] and [`y`] axis. + +For Casio ClassPad 300, as you look at the graph, tap Zoom, Quick Standard. This resets the window to default, which is [` [-10,10] `] on both [`x`] and [`y`] axis. + +You should see a graph similar to this one: + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +To find the interval(s) where [`[$func1]`] is [$symbolWord] [`[$func2]`], we need to locate the intersections of these two functions. + +##TI-89 Instructions + +1. Once we can see the intersections in the graph window, press F5, choose Option 5 (Intersection). + +2. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +3. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +4. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +5. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +6. The calculator will display the intersection. + +7. Repeat Step 4 through Step 6 to find the second intersection. + +##Casio ClassPad 330 Instructions + +1. Once we can see the intersections in the graph window, tap Analysis, G-Solve, Intersect. + +2. The calculator will display one intersection. + +3. Use the left/right arrow buttons to see the other intersection. + +These two intersections are [` ([$ansLeft],[$c]) `] and [` ([$ansRight],[$c]) `]. + +By the graph, when [`x`] value is smaller than [` [$ansLeft] `] or greater than [` [$ansRight] `], the value of [`[$func1]`] is greater than [`[$func2]`], because the graph of [`[$func1]`] is above that of [`[$func2]`]. + +The solution of [` [$func1] [$symbol] [$func2] `] is [` [$ans]`]. + +Notice that since the inequality symbol is [`[$symbol]`], those two intersection points should be [$openOrClosed] in the intervals. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality140.pg new file mode 100644 index 0000000000..07cec1a0bb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality140.pg @@ -0,0 +1,194 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve absolute value inequality like -|2x-1|>3 with a calculator. +# +# Last edited by Carl Yao 08/06/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation','calculator') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 10; + +$symbol = (random(-1,1,2)>0) ? '>' : '\geq'; +$symbolOpp = ($symbol eq '>') ? '<' : '\leq'; + +do { + $a = random(2,5,1); + $b = non_zero_random(-5,5,1); + $c = random(1,5,1); + $ansLeft = (-$b-$c)/$a; + $ansRight = ($c-$b)/$a; +} until ( ($ansLeft>= -$reach+1) && ($ansRight<=$reach-1) && ($ansLeft==int($ansLeft)) && ($ansRight==int($ansRight)) ); + +$func1 = Compute("-abs($a*x+$b)")->reduce; +$func2 = Compute("-$c"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +$leftEnd = ($symbol eq ">") ? '(' : '['; +$rightEnd = ($symbol eq ">") ? ')' : ']'; +$ans = Compute(" $leftEnd $ansLeft, $ansRight $rightEnd"); + + +Context("Numeric"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-6,6],[-6,6],centerOrigin=>1); + +$bottomLeftX = ($min[1]-$b)/$a; +$bottomLeftY = $min[1]; +$bottomRightX = (-$min[1]-$b)/$a; +$topRightY = $min[1]; +$vertexX = -$b/$a; +$vertexY = 0; + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + add_functions($gr[$i], "$func1 for x in <$min[0],$max[0]> using color:blue and weight:2"); + add_functions($gr[$i], "$func2 for x in <$min[0],$max[0]> using color:red and weight:2"); + + $gr[$i]->stamps( closed_circle($ansLeft,-$c,'black') ); + $gr[$i]->stamps( closed_circle($ansRight,-$c,'black') ); + + $gr[$i]->lb( new Label($bottomLeftX+1,$min[1]+0.5,"y1=$func1",'blue','left','bottom')); + $gr[$i]->lb( new Label($ansLeft-1,-$c,"y2=$func2",'red','right','top')); +} + +$ALT = "The graph has two functions. The first function looks like the shape of letter V, but it is upside down. It starts at ($bottomLeftX,$bottomLeftY), goes up to ($vertexX,$vertexY), and then goes back down to ($bottomRightX,$bottomRightY). The second function is a horizontal line, y=-$c. These two functions intersects at two points: ($ansLeft,-$c) and ($ansRight,-$c)."; + +############################################## + + + +BEGIN_PGML + +*With a calculator*, solve this inequality and write your answer in *interval notation*. + + [`` [$func1] [$symbol] [$func2] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** + + [__________________________________]{$ans} + +END_PGML + + + +############################################## + +$symbolWord = ($symbol eq '>') ? "greater than" : "greater than or equal to"; +$openOrClosed = ($symbol eq '>') ? "open" : "closed"; + +############################################## + + +BEGIN_PGML_SOLUTION + +To solve [` [$func1] [$symbol] [$func2] `] by graphing, we treat [`[$func1]`] and [`[$func2]`] as two functions. We will graph both functions. + +For TI-89, press Diamond, F1. Here we assign [`[$func1]`] to "y1", and [`[$func2]`] to "y2". To input the absolute value function, press 2nd, 5, right arrow, choose the second option. Or, you can simply enter letters 'a', 'b' and 's' one by one. For example, to input the letter 'a', press alpha, =. + +For Casio ClassPad 330, press Menu, Graph&Tables, assign [`[$func1]`] to "y1", and [`[$func2]`] to "y2". To input the absolute value function, press Keyboard button, tap the button |x|. Or, press Keyboard button, go to the "abc" tab, and then tap 'a', 'b', 's'. + +To look at the graph, press Diamond, F3 on TI-89, or tap the graph icon on Casio. If you cannot see where these two functions intersect on the screen, adjust your Window settings. + +For TI-89, as you are looking at the graph, press F2, choose option 6 (ZoomStd). This resets the window to default, which is [` [-10,10] `] on both [`x`] and [`y`] axis. + +For Casio ClassPad 300, as you look at the graph, tap Zoom, Quick Standard. This resets the window to default, which is [` [-10,10] `] on both [`x`] and [`y`] axis. + +You should see a graph similar to this one: + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +To find the interval(s) where [`[$func1]`] is [$symbolWord] [`[$func2]`], we need to locate the intersections of these two functions. + +##TI-89 Instructions + +1. Once we can see the intersections in the graph window, press F5, choose Option 5 (Intersection). + +2. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +3. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +4. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +5. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +6. The calculator will display the intersection. + +7. Repeat Step 4 through Step 6 to find the second intersection. + +##Casio ClassPad 330 Instructions + +1. Once we can see the intersections in the graph window, tap Analysis, G-Solve, Intersect. + +2. The calculator will display one intersection. + +3. Use the left/right arrow buttons to see the other intersection. + +These two intersections are [` ([$ansLeft],-[$c]) `] and [` ([$ansRight],-[$c]) `]. + +By the graph, when [`x`] value is between [` [$ansLeft] `] and [` [$ansRight] `], the value of [`[$func1]`] is greater than [`[$func2]`], because the graph of [`[$func1]`] is above that of [`[$func2]`]. + +The solution of [` [$func1] [$symbol] [$func2] `] is [` [$ans]`]. + +Notice that since the inequality symbol is [`[$symbol]`], those two intersection points should be [$openOrClosed] in the interval. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality150.pg new file mode 100644 index 0000000000..a7ce2cd55f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality150.pg @@ -0,0 +1,196 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve absolute value inequality like |2x-1|>=3 with a calculator. +# +# Last edited by Carl Yao 08/06/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation','calculator') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 10; + +$symbol = (random(-1,1,2)>0) ? '>' : '\geq'; + +do { + $a = random(1,5,1); + $b = random(2,5,1); + $c = random(2,5,1); + $d = random(1,10,1); + $ansLeft = ($a-$c*$d)/$b; + $ansRight = ($a+$c*$d)/$b; +} until ( (($ansLeft < -$reach-1) || ($ansRight > $reach+1)) && (($ansLeft > -$reach-7) || ($ansRight < $reach+7)) && (int($ansLeft)==$ansLeft) && (int($ansRight)==$ansRight) && ($a%$c !=0) ); + +$func1 = Compute("abs(($a-$b*x)/$c)")->reduce; +$func2 = Compute("$d"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +$leftEnd = ($symbol eq ">") ? ')' : ']'; +$rightEnd = ($symbol eq ">") ? '(' : '['; +$ans = Compute("(-inf, $ansLeft $leftEnd U $rightEnd $ansRight, inf)"); + + +Context("Numeric"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-12,12],[-12,12],centerOrigin=>1); + +$topLeftX = max( ($a-$c*$max[1])/$b, $min[0]); +$topLeftY = ($topLeftX==($a-$c*$max[1])/$b) ? $max[1] : $func1->eval(x=>$min[0]); +$topRightX = min( ($a+$c*$max[1])/$b, $max[0]); +$topRightY = ($topRightX==($a+$c*$max[1])/$b) ? $max[1] : $func1->eval(x=>$max[0]); +$vertexX = $a/$b; +$vertexY = 0; + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + add_functions($gr[$i], "$func1 for x in <$min[0],$max[0]> using color:blue and weight:2"); + add_functions($gr[$i], "$func2 for x in <$min[0],$max[0]> using color:red and weight:2"); + + $gr[$i]->stamps( closed_circle($ansLeft,$d,'black') ); + $gr[$i]->stamps( closed_circle($ansRight,$d,'black') ); + + $gr[$i]->lb( new Label($ansLeft,$d+1,"y1=$func1",'blue','left','bottom')); + $gr[$i]->lb( new Label($ansLeft,$d-1,"y2=$func2",'red','right','top')); +} + +$ALT = "The graph has two functions. The first function looks like the shape of letter V. It starts at ($topLeftX,$topLeftY), goes down to ($vertexX,$vertexY), and then goes back up to ($topRightX,$topRightY). The second function is a horizontal line, y=$d. These two functions intersects at two points: ($ansLeft,$d) and ($ansRight,$d)."; + +############################################## + + + +BEGIN_PGML + +*With a calculator*, solve this inequality and write your answer in *interval notation*. + + [`` [$func1] [$symbol] [$func2] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** + + [__________________________________]{$ans} + +END_PGML + + + +############################################## + +$symbolWord = ($symbol eq '>') ? "greater than" : "greater than or equal to"; +$openOrClosed = ($symbol eq '>') ? "open" : "closed"; + +############################################## + + +BEGIN_PGML_SOLUTION + +To solve [` [$func1] [$symbol] [$func2] `] by graphing, we treat [`[$func1]`] and [`[$func2]`] as two functions. We will graph both functions. + +For TI-89, press Diamond, F1. Here we assign [`[$func1]`] to "y1", and [`[$func2]`] to "y2". To input the absolute value function, press 2nd, 5, right arrow, choose the second option. Or, you can simply enter letters 'a', 'b' and 's' one by one. For example, to input the letter 'a', press alpha, =. + +Be careful with using parenthesis. When you enter [`[$func1]`], you should enter: [` abs( ([$a]-[$b]x)/[$c]) `]. If you forget to use the inside parenthesis and enter [` abs( [$a]-[$b]x/[$c]) `], the calculator would interpret your input as [` | [$a]-\frac{[$b]x}{[$c]} | `], which would be a different function. + +For Casio ClassPad 330, press Menu, Graph&Tables, assign [`[$func1]`] to "y1", and [`[$func2]`] to "y2". To input the absolute value function, press Keyboard button, tap the button |x|. Or, press Keyboard button, go to the "abc" tab, and then tap 'a', 'b', 's'. + +To look at the graph, press Diamond, F3 on TI-89, or tap the graph icon on Casio. If you cannot see where these two functions intersect on the screen, adjust your Window settings. + +For TI-89, as you are looking at the graph, press F2, choose option 6 (ZoomStd). This resets the window to default, which is [` [-10,10] `] on both [`x`] and [`y`] axis. Since you cannot see both intersections, press F2 again, and choose option 3 (ZoomOut) until you can see both intersections. + +For Casio ClassPad 300, as you look at the graph, tap Zoom, Quick Standard. This resets the window to default, which is [` [-10,10] `] on both [`x`] and [`y`] axis. Since you cannot see both intersections, tap Zoom, and then tap Zoom Out, until you can see both intersections. + +You should see a graph similar to this one: + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +To find the interval(s) where [`[$func1]`] is [$symbolWord] [`[$func2]`], we need to locate the intersections of these two functions. + +##TI-89 Instructions + +1. Once we can see the intersections in the graph window, press F5, choose Option 5 (Intersection). + +2. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +3. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +4. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +5. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +6. The calculator will display the intersection. + +7. Repeat Step 4 through Step 6 to find the second intersection. + +##Casio ClassPad 330 Instructions + +1. Once we can see the intersections in the graph window, tap Analysis, G-Solve, Intersect. + +2. The calculator will display one intersection. + +3. Use the left/right arrow buttons to see the other intersection. + +These two intersections are [` ([$ansLeft],[$c]) `] and [` ([$ansRight],[$c]) `]. + +By the graph, when [`x`] value is smaller than [` [$ansLeft] `] or greater than [` [$ansRight] `], the value of [`[$func1]`] is greater than [`[$func2]`], because the graph of [`[$func1]`] is above that of [`[$func2]`]. + +The solution of [` [$func1] [$symbol] [$func2] `] is [` [$ans]`]. + +Notice that since the inequality symbol is [`[$symbol]`], those two intersection points should be [$openOrClosed] in the intervals. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality20.pg new file mode 100644 index 0000000000..3677abf8ca --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality20.pg @@ -0,0 +1,159 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve absolute value inequality like |x|<2 +# +# Last edited by Carl Yao 07/30/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$func = Compute("x"); +$symbol = (random(-1,1,2)>0) ? '<' : '\leq'; +$a = random(-$reach+2,-2,1); +$b = -$a; +$right = Compute("$b"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol eq '<' ? '<' : '<='; +$symbol1Show = $symbol0Show; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +$leftEnd = ($symbol eq "<") ? '(' : '['; +$rightEnd = ($symbol eq "<") ? ')' : ']'; +$ans = Compute("$leftEnd $a, $b $rightEnd"); + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*1; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*1; +$aboveSpace = $reach*$aspectRatio*1; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$labelHeight = $reach*$aspectRatio/2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); + +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($b,0,'blue') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($b,0,'blue') ); +}; + +$gr->moveTo($a,0); +$gr->lineTo($b,0,'blue',3); + +if ( ($symbol eq '>') or ($symbol eq '\geq') ) { + $gr->lb( new Label($a,$labelHeight,"x $symbol0Show $a",'blue','right','middle')); + $gr->lb( new Label($b,$labelHeight,"x $symbol1Show $b",'blue','left','middle')); +} else { + $gr->lb( new Label(($a+$b)/2,$labelHeight,"$a $symbol0Show x $symbol0Show $b",'blue','center','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line with one segment shaded. The segment starts at $a and ends at $b. The endpoint $a is $leftEndType. The endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this inequality, and write your answer in *interval notation*. + + [`` | [$func] | [$symbol] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** + + [__________________________________]{$ans} + + + +END_PGML + + + +############################################## + +$symbolOpp = ($symbol eq '>') ? '<' : '\leq'; +$sampleLeft = $a+1; +$sampleRight = $b-1; + +############################################## + + +BEGIN_PGML_SOLUTION + +The solution of [` | x | [$symbol] [$right] `] is one segment on the number line: + + [`` [$a] [$symbol] x [$symbol] [$right] ``] + +For example: + + [`` | [$sampleLeft] | [$symbol] [$right] \text{ and } |[$sampleRight]| [$symbol] [$right] ``] + +In interval notation, the solution is [`[$ans]`]. The following graph shows the solution set. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg index e1237725d7..2666a2bee2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg @@ -7,30 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Absolute value inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. @@ -57,11 +65,7 @@ Solve this inequality, and write your answer in *interval notation*. [`` | [$func] | [$symbol] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *no solution* if there are no real solutions -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** [__________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg index 082ec210d7..1a81249693 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg @@ -7,30 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Absolute value inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. @@ -68,11 +76,7 @@ Solve this inequality, and write your answer in *interval notation*. [`` | [$func] | [$symbol] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *no solution* if there are no real solutions -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** [__________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality50.pg new file mode 100644 index 0000000000..a8177f9de5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality50.pg @@ -0,0 +1,181 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve absolute value inequality like |2x-1|>=3 +# +# Last edited by Carl Yao 08/06/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 10; + +$symbol = (random(-1,1,2)>0) ? '>' : '\geq'; + +do { + $a = random(1,3,1); + $b = random(2,4,1); + $c = non_zero_random(-5,5,1); + $ansLeft = -$a*$b+$c; + $ansRight = $a*$b+$c; +} until ( ($ansLeft>= -$reach+3) && ($ansRight<=$reach-3) ); + +$d = $b*$c; +$e = $b*$ansRight-$d; + +$func = Compute("$b*x-$d")->reduce; +$right = Compute("$e"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol eq '>' ? '<' : '<='; +$symbol1Show = $symbol eq '>' ? '>' : '>='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +$leftEnd = ($symbol eq ">") ? ')' : ']'; +$rightEnd = ($symbol eq ">") ? '(' : '['; +$ans = Compute("(-inf, $ansLeft $leftEnd U $rightEnd $ansRight, inf)"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*1; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*1; +$aboveSpace = $reach*$aspectRatio*1; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$labelHeight = $reach*$aspectRatio/2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($ansLeft,-$belowSpace/4,$ansLeft,'blue','center','top')); +$gr->lb( new Label($ansRight,-$belowSpace/4,$ansRight,'blue','center','top')); + +if ($leftEnd eq ')') { + $gr->stamps( open_circle($ansLeft,0,'blue') ); + $gr->stamps( open_circle($ansRight,0,'blue') ); +} else { + $gr->stamps( closed_circle($ansLeft,0,'blue') ); + $gr->stamps( closed_circle($ansRight,0,'blue') ); +}; + +$gr->moveTo($ansLeft,0); +$gr->arrowTo(-0.99*$reach,0,'blue',3); +$gr->moveTo($ansRight,0); +$gr->arrowTo(0.99*$reach,0,'blue',3); + +if ( ($symbol eq '>') or ($symbol eq '\geq') ) { + $gr->lb( new Label($ansLeft,$labelHeight,"x $symbol0Show $ansLeft",'blue','right','middle')); + $gr->lb( new Label($ansRight,$labelHeight,"x $symbol1Show $ansRight",'blue','left','middle')); +} else { + $gr->lb( new Label(($ansLeft+$ansRight)/2,$labelHeight,"$ansLeft $symbol0Show x $symbol0Show $ansRight",'blue','center','middle')); +} + +$leftEndType = ($leftEnd eq ')') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq '(') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. Two segments are shaded. The first segment starts at $ansLeft, and goes toward negative infinity, while the endpoint $ansLeft is $leftEndType. The second segment starts at $ansRight, and goes toward positive infinity, while the endpoint $ansRight is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this inequality, and write your answer in *interval notation*. + + + + [`` | [$func] | [$symbol] [$e] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** + + [__________________________________]{$ans} + +END_PGML + + + +############################################## + +$symbolOpp = ($symbol eq '>') ? '<' : '\leq'; +$s1 = -1*$e; + +############################################## + + +BEGIN_PGML_SOLUTION + +As an easier example, the solution of [` | x | [$symbol] 1 `] is: + + [`` x [$symbolOpp] -1 \text{ or } x [$symbol] 1 ``]. + +Similarly, we break [` | [$func] | [$symbol] [$e] `] into two pieces. The full solution is: + + [`` +\begin{aligned} + &&| [$func] | [$symbol] [$e] \\ + [$func] &[$symbolOpp] [$s1] &\text{ or } &&[$func] &[$symbol] [$e] \\ + [$func]\mathbf{{}+[$d]} &[$symbolOpp] [$s1]\mathbf{{}+[$d]} &\text{ or } &&[$func] \mathbf{{}+[$d]}&[$symbol] [$e] \mathbf{{}+[$d]}\\ + [$b]x &[$symbolOpp] [$s1+$d] &\text{ or } &&[$b]x &[$symbol] [$e+$d] \\ + \frac{[$b]x}{[$b]} &[$symbolOpp] \frac{[$s1+$d]}{[$b]} &\text{ or } && \frac{[$b]x}{[$b]} &[$symbol] \frac{[$e+$d]}{[$b]} \\ + x &[$symbolOpp] [$ansLeft] &\text{ or } && x &[$symbol] [$ansRight] +\end{aligned} + ``] + +In interval notation, the solution is [`[$ans]`]. The following graph shows the solution set. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg index 7ef46795ef..619c3f9718 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Absolute value inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(algIneq) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); @@ -127,11 +134,7 @@ Solve this inequality, and write your answer in *interval notation*. [`` | [$func] | [$symbol] [$e] ``] -Please type: - -* *inf* for [`\infty`], -* *no solution* if there are no real solutions -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** [__________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality70.pg new file mode 100644 index 0000000000..b8d0628096 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality70.pg @@ -0,0 +1,177 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve absolute value inequality like |2x-1|<=3 +# +# Last edited by Carl Yao 08/06/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 10; + +$symbol = (random(-1,1,2)>0) ? '<' : '\leq'; + +do { + $a = random(1,3,1); + $b = random(2,4,1); + $c = non_zero_random(-5,5,1); + $ansLeft = -$a*$b+$c; + $ansRight = $a*$b+$c; +} until ( ($ansLeft>= -$reach+3) && ($ansRight<=$reach-3) ); + +$d = $b*$c; +$e = $b*$ansRight-$d; + +$func = Compute("$b*x-$d")->reduce; +$right = Compute("$e"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol eq '<' ? '<' : '<='; +$symbol1Show = $symbol eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +$leftEnd = ($symbol eq "<") ? '(' : '['; +$rightEnd = ($symbol eq "<") ? ')' : ']'; +$ans = Compute("$leftEnd $ansLeft, $ansRight $rightEnd"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*1; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*1; +$aboveSpace = $reach*$aspectRatio*1; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$labelHeight = $reach*$aspectRatio/2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($ansLeft,-$belowSpace/4,$ansLeft,'blue','center','top')); +$gr->lb( new Label($ansRight,-$belowSpace/4,$ansRight,'blue','center','top')); + +if ($leftEnd eq '(') { + $gr->stamps( open_circle($ansLeft,0,'blue') ); + $gr->stamps( open_circle($ansRight,0,'blue') ); +} else { + $gr->stamps( closed_circle($ansLeft,0,'blue') ); + $gr->stamps( closed_circle($ansRight,0,'blue') ); +}; + +$gr->moveTo($ansLeft,0); +$gr->lineTo($ansRight,0,'blue',3); + +if ( ($symbol eq '>') or ($symbol eq '\geq') ) { + $gr->lb( new Label($ansLeft,$labelHeight,"x $symbol0Show $ansLeft",'blue','right','middle')); + $gr->lb( new Label($ansRight,$labelHeight,"x $symbol1Show $ansRight",'blue','left','middle')); +} else { + $gr->lb( new Label(($ansLeft+$ansRight)/2,$labelHeight,"$ansLeft $symbol0Show x $symbol0Show $ansRight",'blue','center','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line with one segment shaded. The segment starts at $ansLeft, and ends at $ansRight. The endpoint $ansLeft is $leftEndType, and the endpoint $ansRight is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this inequality, and write your answer in *interval notation*. + + [`` | [$func] | [$symbol] [$e] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** + + [__________________________________]{$ans} + +END_PGML + + + +############################################## + +$symbolOpp = ($symbol eq '>') ? '<' : '\leq'; +$s1 = -1*$e; + +############################################## + + +BEGIN_PGML_SOLUTION + +As an easier example, the solution of [` | x | [$symbol] 1 `] is: + + [`` -1 [$symbol] x [$symbol] 1 ``]. + +We solve [` | [$func] | [$symbol] [$e] `] in a similar way. The full solution is: + + [`` +\begin{aligned} + &| [$func] | [$symbol] [$e] \\ + [$s1] &[$symbol] [$func] [$symbol] [$e] \\ + [$s1] \mathbf{{}+[$d]} &[$symbol] [$func] \mathbf{{}+[$d]} [$symbol] [$e] \mathbf{{}+[$d]}\\ + [$s1+$d] &[$symbol] [$b] x [$symbol] [$e+$d] \\ + \frac{[$s1+$d]}{[$b]} &[$symbol] \frac{[$b] x}{[$b]} [$symbol] \frac{[$e+$d]}{[$b]} \\ + [$ansLeft] &[$symbol] x [$symbol] [$ansRight] +\end{aligned} + ``] + +In interval notation, the solution is [`[$ans]`]. The following graph shows the solution set. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg index 59342aeb98..465a1458f1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Absolute value inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(algIneq) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); @@ -125,11 +132,7 @@ Solve this inequality, and write your answer in *interval notation*. [`` | [$func] | [$symbol] [$e] ``] -Please type: - -* *inf* for [`\infty`], -* *no solution* if there are no real solutions -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** [__________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg index ec0d49e2f9..f7274951c5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Absolute value inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(algIneq) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); @@ -125,11 +132,7 @@ Solve this inequality, and write your answer in *interval notation*. [`` [$func] [$symbolOpp] [$c] ``] -Please type: - -* *inf* for [`\infty`], -* *no solution* if there are no real solutions -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|no solution|]* if there are no real solutions.!)@]** [__________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityApplication10.pg new file mode 100644 index 0000000000..920d713978 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityApplication10.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve absolute value inequality application problem. +# +# Last edited by Carl Yao 07/19/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','absolute value','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$symbol = '\le'; + +$a = random(3,7,0.1); +$b = random(0.001,0.005,0.001); + +$left = Compute("x-$a")->reduce; +$right = Compute("$b"); + +Context("Interval"); +Context()->flags->set(tolerance=>0.00001); +$c = $a-$b; +$d = $a+$b; +$ans = Compute("[$c,$d]"); + +############################################## + + + +BEGIN_PGML + +A factory is producing a certain type of bolts. The length of the bolt must be within [`[$b]`] inch of [`[$a]`] inches (including [`[$b]`] inch). Write and solve an absolute value inequality, find out the acceptable length of a bolt produced. Use interval notation to represent your answer. + +An acceptable length of a bolt is in this interval (in inches): [_______________]{$ans} + +END_PGML + + + +############################################## + + +BEGIN_PGML_SOLUTION + +Assume a bolt's length is [`x`] inches, then the difference between its length and [`[$a]`] is [` \lvert [$left] \rvert `] inches. To make the bolt's length within [`[$b]`] inch of [`[$a]`] inches, we can write this inequality: + + [`` \lvert [$left] \rvert \le [$b] ``] + +Here is how to solve this inequality: + + [`` +\begin{aligned} + & \lvert [$left] \rvert [$symbol] [$b] \\ + [$b*-1] &[$symbol] [$left] [$symbol] [$b] \\ + [$b*-1] \mathbf{{}+[$a]} &[$symbol] [$left] \mathbf{{}+[$a]} [$symbol] [$b] \mathbf{{}+[$a]}\\ + [$a-$b] &[$symbol] x [$symbol] [$a+$b] +\end{aligned} + ``] + +In interval notation, the solution is [` \big[ [$c],[$d] \big] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityByGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityByGraph10.pg new file mode 100644 index 0000000000..7f678990fc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityByGraph10.pg @@ -0,0 +1,186 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve absolute value inequality by graph +# +# Last updated: Yao 10/30/2018 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context('Interval'); + +$boundary = 6; + +do { + $a = list_random(0.25,0.5,1,2,3,4); + $d = random(-$boundary,-1,1); + $b = random(1,3,1)*random(-1,1,2); + $c = $a*$b; + $func = Compute("abs($a*x+$c)+$d")->reduce; + $e = random(1,5,1)*random(-1,1,2); + $x1 = min(-$b+$e,-$b-$e); + $x2 = max(-$b+$e,-$b-$e); + $y1 = $func->eval(x=>$x1); + $y2 = $func->eval(x=>$x2); +} until + abs($x1) < $boundary && + abs($x2) < $boundary && + int($y1) == $y1 && + int($y2) == $y2 && + abs($y1) < $boundary && + abs($y2) < $boundary; + +@signs = ('\gt','\ge','\lt','\le'); +$index1 = random(0,3,1); +if ($index1 <= 1) { + $index2 = random(2,3,1); +} else { + $index2 = random(0,1,1); +} +@sign = (); +$sign[1] = $signs[$index1]; +$sign[2] = $signs[$index2]; + +@x = (); +push @x, -$boundary-1; +push @x, ($boundary+1-$d-$c)/$a; +push @x, (-($boundary+1-$d)-$c)/$a; +push @x, $boundary+1; +@x = num_sort(@x); +@y = (); +foreach my $item(@x) { + push @y, $func->eval(x=>$item); +} + +for (my $i=0; $i<=2; $i++) { + $gr[$i] = init_graph(-$boundary-1,-$boundary-1,$boundary+1,$boundary+1, + axes=>[0,0], + grid=>[2*($boundary+1),2*($boundary+1)], + size=>[240,240] + ); + $gr[$i]->lb('reset'); + for $j (-$boundary..$boundary){ + if ($j==0 or $j%2!=0) {next;} + $gr[$i]->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i]->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + $yLeft = $func->eval(x=>-$boundary-1.1); + $yRight = $func->eval(x=>$boundary+1.1); + $gr[$i]->moveTo(-$b,$d); + $gr[$i]->arrowTo($x[1],$y[1],blue,2); + $gr[$i]->moveTo(-$b,$d); + $gr[$i]->arrowTo($x[2],$y[2],blue,2); +} + +$bN = -$b; +@alt = (); +$alt[0] = "The graph of $func is given, which passes the points ($x1,$y1), ($bN,$d) and ($x2,$y2). "; + +@ans = (); +for (my $i=1; $i<=2; $i++) { + if ($sign[$i] eq '\gt') { + $ans[$i] = Compute("(-inf,$x1)U($x2,inf)"); + $gr[$i]->moveTo($x1,$y1); + $gr[$i]->arrowTo($x[1],$y[1],red,3); + $gr[$i]->moveTo($x2,$y2); + $gr[$i]->arrowTo($x[2],$y[2],red,3); + $gr[$i]->stamps( open_circle($x1,$y1,'red') ); + $gr[$i]->stamps( open_circle($x2,$y2,'red') ); + $alt[$i] = $alt[0]."On the function $func, the piece to the left of ($x1,$y1), not including ($x1,$y1), is shaded red; the piece to the right of ($x2,$y2), not including ($x2,$y2), is shaded red."; + } elsif ($sign[$i] eq '\ge') { + $ans[$i] = Compute("(-inf,$x1]U[$x2,inf)"); + $gr[$i]->moveTo($x1,$y1); + $gr[$i]->arrowTo($x[1],$y[1],red,3); + $gr[$i]->moveTo($x2,$y2); + $gr[$i]->arrowTo($x[2],$y[2],red,3); + $gr[$i]->stamps( closed_circle($x1,$y1,'red') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'red') ); + $alt[$i] = $alt[0]."On the function $func, the piece to the left of ($x1,$y1), including ($x1,$y1), is shaded red; the piece to the right of ($x2,$y2), including ($x2,$y2), is shaded red."; + } elsif ($sign[$i] eq '\lt') { + $ans[$i] = Compute("($x1,$x2)"); + $gr[$i]->moveTo($x1,$y1); + $gr[$i]->lineTo(-$b,$d,red,3); + $gr[$i]->lineTo($x2,$y2,red,3); + $gr[$i]->stamps( open_circle($x1,$y1,'red') ); + $gr[$i]->stamps( open_circle($x2,$y2,'red') ); + $alt[$i] = $alt[0]."On the function $func, the piece between ($x1,$y1) and ($x2,$y2), not including those two points, is shaded red."; + } else { + $ans[$i] = Compute("[$x1,$x2]"); + $gr[$i]->moveTo($x1,$y1); + $gr[$i]->lineTo(-$b,$d,red,3); + $gr[$i]->lineTo($x2,$y2,red,3); + $gr[$i]->stamps( closed_circle($x1,$y1,'red') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'red') ); + $alt[$i] = $alt[0]."On the function $func, the piece between ($x1,$y1) and ($x2,$y2), including those two points, is shaded red."; + } +} + + +############################################## + + +BEGIN_PGML + +A graph of [`f`] is given, where [`f(x)=[$func]`]. Use the graph alone to solve the following inequalities. + +>> [@image(insertGraph($gr[0]), width=>240, tex_size=>250, extra_html_tags=>"alt='$alt[0]' title = '$alt[0]'")@]* << + +[@KeyboardInstructions('Write your solution sets in interval notation.')@]** + +a. [`[$func][$sign[1]][$y1]`] + + [__________]{$ans[1]} + +a. [`[$func][$sign[2]][$y1]`] + + [__________]{$ans[2]} + +END_PGML + +############################################## + + +############################################## + +BEGIN_PGML_SOLUTION + +Points on the function [`f(x)=[$func]`] which satisfy the first inequality [`[$func][$sign[1]][$y1]`] is shaded red: + +>> [@image(insertGraph($gr[1]), width=>240, extra_html_tags=>"alt='$alt[1]' title = '$alt[1]'")@]* << + +The solution, or the set of [`x`]-values of the shaded part(s), is [`[$ans[1]]`]. + +Points on the function [`f(x)=[$func]`] which satisfy the second inequality [`[$func][$sign[2]][$y1]`] is shaded red: + +>> [@image(insertGraph($gr[2]), width=>240, extra_html_tags=>"alt='$alt[2]' title = '$alt[2]'")@]* << + +The solution, or the set of [`x`]-values of the shaded part(s), is [`[$ans[2]]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityByGraph20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityByGraph20.pg new file mode 100644 index 0000000000..b24589bbd5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AbsoluteValue/absoluteValueInequalityByGraph20.pg @@ -0,0 +1,186 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve absolute value inequality by graph +# +# Last updated: Yao 10/30/2018 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','linear','equation','absolute value') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context('Interval'); + +$boundary = 6; + +do { + $a = list_random(0.25,0.5,1,2,3,4); + $d = random(1,$boundary,1); + $b = random(1,3,1)*random(-1,1,2); + $c = $a*$b; + $func = Compute("-abs($a*x+$c)+$d")->reduce; + $e = random(1,5,1)*random(-1,1,2); + $x1 = min(-$b+$e,-$b-$e); + $x2 = max(-$b+$e,-$b-$e); + $y1 = $func->eval(x=>$x1); + $y2 = $func->eval(x=>$x2); +} until + abs($x1) < $boundary && + abs($x2) < $boundary && + int($y1) == $y1 && + int($y2) == $y2 && + abs($y1) < $boundary && + abs($y2) < $boundary; + +@signs = ('\gt','\ge','\lt','\le'); +$index1 = random(0,3,1); +if ($index1 <= 1) { + $index2 = random(2,3,1); +} else { + $index2 = random(0,1,1); +} +@sign = (); +$sign[1] = $signs[$index1]; +$sign[2] = $signs[$index2]; + +@x = (); +push @x, -$boundary-1; +push @x, (-$boundary-1-$d-$c)/$a; +push @x, (-(-$boundary-1-$d)-$c)/$a; +push @x, $boundary+1; +@x = num_sort(@x); +@y = (); +foreach my $item(@x) { + push @y, $func->eval(x=>$item); +} + +for (my $i=0; $i<=2; $i++) { + $gr[$i] = init_graph(-$boundary-1,-$boundary-1,$boundary+1,$boundary+1, + axes=>[0,0], + grid=>[2*($boundary+1),2*($boundary+1)], + size=>[240,240] + ); + $gr[$i]->lb('reset'); + for $j (-$boundary..$boundary){ + if ($j==0 or $j%2!=0) {next;} + $gr[$i]->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i]->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + $yLeft = $func->eval(x=>-$boundary-1.1); + $yRight = $func->eval(x=>$boundary+1.1); + $gr[$i]->moveTo(-$b,$d); + $gr[$i]->arrowTo($x[1],$y[1],blue,2); + $gr[$i]->moveTo(-$b,$d); + $gr[$i]->arrowTo($x[2],$y[2],blue,2); +} + +$bN = -$b; +@alt = (); +$alt[0] = "The graph of $func is given, which passes the points ($x1,$y1), ($bN,$d) and ($x2,$y2). "; + +@ans = (); +for (my $i=1; $i<=2; $i++) { + if ($sign[$i] eq '\lt') { + $ans[$i] = Compute("(-inf,$x1)U($x2,inf)"); + $gr[$i]->moveTo($x1,$y1); + $gr[$i]->arrowTo($x[1],$y[1],red,3); + $gr[$i]->moveTo($x2,$y2); + $gr[$i]->arrowTo($x[2],$y[2],red,3); + $gr[$i]->stamps( open_circle($x1,$y1,'red') ); + $gr[$i]->stamps( open_circle($x2,$y2,'red') ); + $alt[$i] = $alt[0]."On the function $func, the piece to the left of ($x1,$y1), not including ($x1,$y1), is shaded red; the piece to the right of ($x2,$y2), not including ($x2,$y2), is shaded red."; + } elsif ($sign[$i] eq '\le') { + $ans[$i] = Compute("(-inf,$x1]U[$x2,inf)"); + $gr[$i]->moveTo($x1,$y1); + $gr[$i]->arrowTo($x[1],$y[1],red,3); + $gr[$i]->moveTo($x2,$y2); + $gr[$i]->arrowTo($x[2],$y[2],red,3); + $gr[$i]->stamps( closed_circle($x1,$y1,'red') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'red') ); + $alt[$i] = $alt[0]."On the function $func, the piece to the left of ($x1,$y1), including ($x1,$y1), is shaded red; the piece to the right of ($x2,$y2), including ($x2,$y2), is shaded red."; + } elsif ($sign[$i] eq '\gt') { + $ans[$i] = Compute("($x1,$x2)"); + $gr[$i]->moveTo($x1,$y1); + $gr[$i]->lineTo(-$b,$d,red,3); + $gr[$i]->lineTo($x2,$y2,red,3); + $gr[$i]->stamps( open_circle($x1,$y1,'red') ); + $gr[$i]->stamps( open_circle($x2,$y2,'red') ); + $alt[$i] = $alt[0]."On the function $func, the piece between ($x1,$y1) and ($x2,$y2), not including those two points, is shaded red."; + } else { + $ans[$i] = Compute("[$x1,$x2]"); + $gr[$i]->moveTo($x1,$y1); + $gr[$i]->lineTo(-$b,$d,red,3); + $gr[$i]->lineTo($x2,$y2,red,3); + $gr[$i]->stamps( closed_circle($x1,$y1,'red') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'red') ); + $alt[$i] = $alt[0]."On the function $func, the piece between ($x1,$y1) and ($x2,$y2), including those two points, is shaded red."; + } +} + + +############################################## + + +BEGIN_PGML + +A graph of [`f`] is given, where [`f(x)=[$func]`]. Use the graph alone to solve the following inequalities. + +>> [@image(insertGraph($gr[0]), width=>240, tex_size=>250, extra_html_tags=>"alt='$alt[0]' title = '$alt[0]'")@]* << + +[@KeyboardInstructions('Write your solution sets in interval notation.')@]** + +a. [`[$func][$sign[1]][$y1]`] + + [__________]{$ans[1]} + +a. [`[$func][$sign[2]][$y1]`] + + [__________]{$ans[2]} + +END_PGML + +############################################## + + +############################################## + +BEGIN_PGML_SOLUTION + +Points on the function [`f(x)=[$func]`] which satisfy the first inequality [`[$func][$sign[1]][$y1]`] is shaded red: + +>> [@image(insertGraph($gr[1]), width=>240, extra_html_tags=>"alt='$alt[1]' title = '$alt[1]'")@]* << + +The solution, or the set of [`x`]-values of the shaded part(s), is [`[$ans[1]]`]. + +Points on the function [`f(x)=[$func]`] which satisfy the second inequality [`[$func][$sign[2]][$y1]`] is shaded red: + +>> [@image(insertGraph($gr[2]), width=>240, extra_html_tags=>"alt='$alt[2]' title = '$alt[2]'")@]* << + +The solution, or the set of [`x`]-values of the shaded part(s), is [`[$ans[2]]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition10.pg index 40d5de3a98..b09eb5c9c3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition10.pg @@ -8,17 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(associative_property_addition) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('associative') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -31,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -40,8 +42,8 @@ loadMacros( ############################################## -$var1 = RandomVariableName(); -do {$var2 = RandomVariableName();} until ($var2 ne $var1); +do {$var1 = RandomVariableName();} until ($var1 ne uc($var1)); +do {$var2 = RandomVariableName();} until (($var2 ne uc($var2)) and ($var2 ne $var1)); Context("Numeric"); Context()->variables->are($var1=>'Real',$var2=>'Real'); @@ -64,9 +66,7 @@ TEXT(beginproblem()); BEGIN_PGML -Use the associative property of addition to write an equivalent expression. - - [`[$giv]`] +Use the associative property of addition to write an equivalent expression to [`[$giv]`]. [____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition20.pg index 873217f195..6a64530955 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition20.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(associative_property_addition) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('associative') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -30,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); @@ -39,7 +43,7 @@ loadMacros( ############################################## -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context("Numeric"); Context()->variables->are($var=>'Real'); @@ -64,9 +68,7 @@ TEXT(beginproblem()); BEGIN_PGML -Use the associative property of addition to write an equivalent expression. - - [`[$giv]`] +Use the associative property of addition to write an equivalent expression to [`[$giv]`]. [____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition30.pg index ac33711aed..9e26928280 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyAddition30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('associative') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -39,9 +42,9 @@ loadMacros( ############################################## -$var1 = RandomVariableName(); -do {$var2 = RandomVariableName();} until ($var2 ne $var1); -do {$var3 = RandomVariableName();} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var1 = RandomVariableName();} until ($var1 ne uc($var1)); +do {$var2 = RandomVariableName();} until (($var2 ne uc($var2)) and ($var2 ne $var1)); +do {$var3 = RandomVariableName();} until (($var3 ne uc($var3)) and ($var3 ne $var1) and ($var3 ne $var2)); Context("Numeric"); @@ -67,15 +70,11 @@ TEXT(beginproblem()); BEGIN_PGML -The following expression would be ambiguous if we did not have a left-to-right reading convention. - - [`[$giv]`] - -Use grouping symbols to emphasize the order that these additions should be carried out. +The expression [`[$giv]`] would be ambiguous if we did not have a left-to-right reading convention. Use grouping symbols to emphasize the order that these additions should be carried out. [____________] -Now use the associative property of addition to write an equivalent (but different) algebraic expression. +Use the associative property of addition to write an equivalent (but different) algebraic expression. [____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyMultiplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyMultiplication10.pg index 098b7ccc3b..239bcc1c77 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyMultiplication10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/AssociativePropertyMultiplication10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('associative') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,12 +30,12 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" -); + "PGcourse.pl", +); ############################################## -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context("Numeric"); Context()->variables->are($var=>'Real'); @@ -57,9 +60,7 @@ TEXT(beginproblem()); BEGIN_PGML -Use the associative property of multiplication to write an equivalent expression. - - [`[$giv]`] +Use the associative property of multiplication to write an equivalent expression to [`[$giv]`]. [____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms10.pg new file mode 100644 index 0000000000..9bfb72a9f1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms10.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Combine like terms +# +# Last edited: Yao 12/13/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('expression','simplify') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PCCmacros.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>variable); +Context()->variables->are( $var1=>'Real'); + +do { + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); +} until $a+$b != 0 && !(($a>0)&&($b>0)); + + +@problems = ( + [Compute("$a*$var1+$b")->reduce, + Compute("$a*$var1+$b")->reduce], + [Compute("$a*$var1**2+$b*$var1")->reduce, + Compute("$a*$var1**2+$b*$var1")->reduce], + [Compute("$a*$var1+$b*$var1")->reduce, + Compute("($a+$b)*$var1")->reduce], +); + +@shuffle = shuffle($#problems+1); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are( $var1=>'Real'); + +for (my $j=0; $j<=$#problems; $j++) { + $problems[$j][1] = Compute($problems[$j][1]); +} + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify each expression, if possible, by combining like terms. If the expression cannot be simplified further, just enter it as it is. + +a) [``[$problems[$shuffle[0]][0]]=``] [_________________]{$problems[$shuffle[0]][1]} + +b) [``[$problems[$shuffle[1]][0]]=``] [_________________]{$problems[$shuffle[1]][1]} + +c) [``[$problems[$shuffle[2]][0]]=``] [_________________]{$problems[$shuffle[2]][1]} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +a) [`[$problems[$shuffle[0]][0]]=[$problems[$shuffle[0]][1]]`] + +b) [`[$problems[$shuffle[1]][0]]=[$problems[$shuffle[1]][1]]`] + +c) [`[$problems[$shuffle[2]][0]]=[$problems[$shuffle[2]][1]]`] + +Note that [`[$var1][$var2]`] and [`[$var2][$var1]`] are equivalent. + +[`[$problems[0][0]]`] and [`[$problems[1][0]]`] cannot be simplified because they don't have like terms. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms20.pg new file mode 100644 index 0000000000..068782ff0e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms20.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Combine like terms +# +# Last edited: Yao 12/13/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('expression','simplify') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PCCmacros.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +Context()->variables->are( $var1=>'Real',$var2=>'Real'); + +do { + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); +} until $a+$b != 0 && !(($a>0)&&($b>0)); + + +@problems = ( + [Compute("$a*$var1+$b*$var2")->reduce, + Compute("$a*$var1+$b*$var2")->reduce], + [Compute("$a*$var1+$b*$var1*$var2")->reduce, + Compute("$a*$var1+$b*$var1*$var2")->reduce], + [Compute("$a*$var1*$var2+$b*$var1*$var2")->reduce, + Compute("($a+$b)*$var1*$var2")->reduce], + [Compute("$a*$var1*$var2+$b*$var2*$var1")->reduce, + Compute("($a+$b)*$var1*$var2")->reduce], +); + +@shuffle = shuffle($#problems+1); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are( $var1=>'Real',$var2=>'Real'); + +for (my $j=0; $j<=$#problems; $j++) { + $problems[$j][1] = Compute($problems[$j][1]); +} + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify each expression, if possible, by combining like terms. If the expression cannot be simplified further, just enter it as it is. + +a) [``[$problems[$shuffle[0]][0]]=``] [_________________]{$problems[$shuffle[0]][1]} + +b) [``[$problems[$shuffle[1]][0]]=``] [_________________]{$problems[$shuffle[1]][1]} + +c) [``[$problems[$shuffle[2]][0]]=``] [_________________]{$problems[$shuffle[2]][1]} + +d) [``[$problems[$shuffle[3]][0]]=``] [_________________]{$problems[$shuffle[3]][1]} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +a) [`[$problems[$shuffle[0]][0]]=[$problems[$shuffle[0]][1]]`] + +b) [`[$problems[$shuffle[1]][0]]=[$problems[$shuffle[1]][1]]`] + +c) [`[$problems[$shuffle[2]][0]]=[$problems[$shuffle[2]][1]]`] + +d) [`[$problems[$shuffle[3]][0]]=[$problems[$shuffle[3]][1]]`] + +[`[$problems[0][0]]`] and [`[$problems[1][0]]`] cannot be simplified because they don't have like terms. + +Note that [`[$var1][$var2]`] and [`[$var2][$var1]`] are equivalent. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms30.pg new file mode 100644 index 0000000000..9dcbf2ca85 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms30.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Combine like terms +# +# Last edited: Yao 12/13/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('expression','simplify') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PCCmacros.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +Context()->variables->are( $var1=>'Real',$var2=>'Real'); + +do { + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); +} until $a+$b != 0 && !(($a>0)&&($b>0)); + + +@problems = ( + [Compute("$a*$var1*$var2+$b*$var2*$var1")->reduce, + Compute("($a+$b)*$var1*$var2")->reduce], + [Compute("$a*$var2**2*$var1+$b*$var1*$var2**2")->reduce, + Compute("($a+$b)*$var1*$var2**2")->reduce], + [Compute("$a*$var1**2*$var2+$b*$var1*$var2**2")->reduce, + Compute("$a*$var1**2*$var2+$b*$var1*$var2**2")->reduce], + [Compute("$a*$var1**2*$var2**2+$b*$var1**2*$var2**2")->reduce, + Compute("($a+$b)*$var1**2*$var2**2")->reduce], +); + +@shuffle = shuffle($#problems+1); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are( $var1=>'Real',$var2=>'Real'); + +for (my $j=0; $j<=$#problems; $j++) { + $problems[$j][1] = Compute($problems[$j][1]); +} + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify each expression, if possible, by combining like terms. If the expression cannot be simplified further, just enter it as it is. + +a) [``[$problems[$shuffle[0]][0]]=``] [_________________]{$problems[$shuffle[0]][1]} + +b) [``[$problems[$shuffle[1]][0]]=``] [_________________]{$problems[$shuffle[1]][1]} + +c) [``[$problems[$shuffle[2]][0]]=``] [_________________]{$problems[$shuffle[2]][1]} + +d) [``[$problems[$shuffle[3]][0]]=``] [_________________]{$problems[$shuffle[3]][1]} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +a) [`[$problems[$shuffle[0]][0]]=[$problems[$shuffle[0]][1]]`] + +b) [`[$problems[$shuffle[1]][0]]=[$problems[$shuffle[1]][1]]`] + +c) [`[$problems[$shuffle[2]][0]]=[$problems[$shuffle[2]][1]]`] + +d) [`[$problems[$shuffle[3]][0]]=[$problems[$shuffle[3]][1]]`] + +Note that [`[$var1][$var2]`] and [`[$var2][$var1]`] are equivalent. + +[`[$problems[2][0]]`] cannot be simplified because it doesn't have any like terms. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms40.pg new file mode 100644 index 0000000000..4148be398f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms40.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Combine like terms +# +# Last edited: Yao 12/13/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('expression','simplify') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +Context()->variables->are( $var1=>'Real',$var2=>'Real'); + +do { + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); + $c = non_zero_random(-10,10,1); + $d = non_zero_random(-10,10,1); + $e = non_zero_random(-10,10,1); + $f = non_zero_random(-10,10,1); +} until ($a+$c)*($b+$d) <= 0; + +$func = Compute("$a*$var1+$e+$b*$var2+$c*$var1+$f+$d*$var2")->reduce; +$s1 = Compute("$a*$var1+$c*$var1+$b*$var2+$d*$var2+$e+$f")->reduce; +$ans = Compute("($a+$c)*$var1+($b+$d)*$var2+($e+$f)")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are( $var1=>'Real',$var2=>'Real'); +$ans = Compute($ans); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify each expression, if possible, by combining like terms. If the expression cannot be simplified further, just enter it as it is. + + [`[$func]=`] [______________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$func] & = [$s1] \\ + & = [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms50.pg new file mode 100644 index 0000000000..c1c42a6c88 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms50.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Combine like terms +# +# Last edited: Yao 12/13/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('expression','simplify') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>variable); +Context()->variables->are( $var1=>'Real'); + +do { + $a = random(-10,-1,1); + $b = non_zero_random(-10,10,1); + $c = non_zero_random(-10,10,1); + $d = non_zero_random(-10,10,1); + $e = non_zero_random(-10,10,1); + $f = random(1,10,1); +} until ($a+$c)*($b+$d) <= 0; + +$func = Compute("$f+$a*$var1+$b*$var1**2+$c*$var1+$d*$var1**2+$e")->reduce; +$s1 = Compute("$b*$var1**2+$d*$var1**2+$c*$var1+$a*$var1+$f+$e")->reduce; +$ans = Compute("($b+$d)*$var1**2+($c+$a)*$var1+($f+$e)")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are( $var1=>'Real'); +$ans = Compute($ans); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify each expression, if possible, by combining like terms. If the expression cannot be simplified further, just enter it as it is. + + [`[$func]=`] [______________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$func] & = [$s1] \\ + & = [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms60.pg new file mode 100644 index 0000000000..cc98218722 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms60.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Combine like terms +# +# Last edited: Yao 12/13/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('expression','simplify') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +Context()->variables->are( $var1=>'Real',$var2=>'Real'); + +do { + $a = random(-10,-1,1); + $b = non_zero_random(-10,10,1); + $c = non_zero_random(-10,10,1); + $d = random(1,10,1); + $e = non_zero_random(-10,10,1); + $f = non_zero_random(-10,10,1); + $g = non_zero_random(-10,10,1); +} until ($b+$f)*($a+$c) < 0; + +$func = Compute("$d+$a*$var1+$b*$var1*$var2+$c*$var1+$e*$var2+$f*$var2*$var1+$g")->reduce; +$s1 = Compute("$b*$var1*$var2+$f*$var2*$var1+$a*$var1+$c*$var1+$e*$var2+$d+$g")->reduce; +$ans = Compute("($b+$f)*$var2*$var1+($a+$c)*$var1+$e*$var2+($d+$g)")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are( $var1=>'Real',$var2=>'Real'); +$ans = Compute($ans); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify each expression, if possible, by combining like terms. If the expression cannot be simplified further, just enter it as it is. + + [`[$func]=`] [______________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$func] & = [$s1] \\ + & = [$ans] + \end{aligned}``] + +Note that [`[$var1][$var2]`] and [`[$var2][$var1]`] are equivalent. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms70.pg new file mode 100644 index 0000000000..c7b4c29427 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CombiningLikeTerms70.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Combine like terms +# +# Last edited: Yao 12/13/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('expression','simplify') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +Context()->variables->are( $var1=>'Real',$var2=>'Real'); + +do { + $a = random(-10,-1,1); + $b = non_zero_random(-10,10,1); + $c = non_zero_random(-10,10,1); + $d = random(1,10,1); + $e = non_zero_random(-10,10,1); + $f = non_zero_random(-10,10,1); +} until ($c+$d)*($a+$f) <= 0; + +$func = Compute("$a*$var1**2*$var2+$b*$var1*$var2**2+$c*$var1**2*$var2**2+$d*$var2**2*$var1**2+$e*$var2**2*$var1+$f*$var2*$var1**2")->reduce; +$s1 = Compute("$c*$var1**2*$var2**2+$d*$var2**2*$var1**2+$a*$var1**2*$var2+$f*$var2*$var1**2+$b*$var1*$var2**2+$e*$var2**2*$var1")->reduce; +$ans = Compute("($c+$d)*$var2**2*$var1**2+($a+$f)*$var1**2*$var2+($b+$e)*$var1*$var2**2")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are( $var1=>'Real',$var2=>'Real'); +$ans = Compute($ans); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify each expression, if possible, by combining like terms. If the expression cannot be simplified further, just enter it as it is. + + [`[$func]=`] [______________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$func] & = [$s1] \\ + & = [$ans] + \end{aligned}``] + +Note that [`[$var1][$var2]`] and [`[$var2][$var1]`] are equivalent. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition10.pg index 8f199f612e..f420ff93c6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition10.pg @@ -8,17 +8,21 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(commutative_property_addition) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('commutative') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + ############################################## @@ -29,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -38,7 +42,7 @@ loadMacros( ############################################## -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context("Numeric"); Context()->variables->are($var=>'Real'); @@ -56,9 +60,7 @@ TEXT(beginproblem()); BEGIN_PGML -Use the commutative property of addition to write an equivalent expression. - - [`[$giv]`] +Use the commutative property of addition to write an equivalent expression to [`[$giv]`]. [____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition20.pg index 72bfff081b..094ce7834c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition20.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(commutative_property_addition2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('commutative') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -39,7 +42,7 @@ loadMacros( ############################################## -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context("Numeric"); Context()->variables->are($var=>'Real'); @@ -58,9 +61,7 @@ TEXT(beginproblem()); BEGIN_PGML -Use the commutative property of addition to write an equivalent expression. - - [`[$giv]`] +Use the commutative property of addition to write an equivalent expression to [`[$giv]`]. [____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition30.pg index 52c3731021..ad31ead45b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyAddition30.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(commutative_property_addition2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('commutative') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -39,7 +42,7 @@ loadMacros( ############################################## -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context("Numeric"); Context()->variables->are($var=>'Real'); @@ -58,9 +61,7 @@ TEXT(beginproblem()); BEGIN_PGML -Use the commutative property of addition to write an equivalent expression. - - [`[$giv]`] +Use the commutative property of addition to write an equivalent expression to [`[$giv]`]. [____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication10.pg index 512f9f2f31..91011e455d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('commutative') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -39,7 +42,7 @@ loadMacros( ############################################## -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context("Numeric"); Context()->variables->are($var=>'Real'); @@ -58,9 +61,7 @@ TEXT(beginproblem()); BEGIN_PGML -Use the commutative property of multiplication to write an equivalent expression. - - [`[$giv]`] +Use the commutative property of multiplication to write an equivalent expression to [`[$giv]`]. [____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication20.pg index ac4c7e9b19..91c2dd6b92 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication20.pg @@ -8,17 +8,21 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(commutative_property_multiplication2) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('commutative') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + ############################################## @@ -29,12 +33,16 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); + + + + ############################################## -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context("Numeric"); Context()->variables->are($var=>'Real'); @@ -47,14 +55,13 @@ $b = random(2,10,1); $giv = Formula("$a +$b$var"); $ans = Formula("$a+$var*$b"); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the commutative property of multiplication to write an equivalent expression. - - [`[$giv]`] +Use the commutative property of multiplication to write an equivalent expression to [`[$giv]`]. [____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication30.pg index 7daa20cd08..292d10b792 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/CommutativePropertyMultiplication30.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(commutative_property_multiplication2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('commutative') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -39,7 +42,7 @@ loadMacros( ############################################## -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context("Numeric"); Context()->variables->are($var=>'Real'); @@ -58,9 +61,7 @@ TEXT(beginproblem()); BEGIN_PGML -Use the commutative property of multiplication to write an equivalent expression. - - [`[$giv]`] +Use the commutative property of multiplication to write an equivalent expression to [`[$giv]`]. [____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty10.pg index 9ee2e2f471..7480bbdb6f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty10.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(distributive_property) -## MLTleader(1) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -31,7 +34,7 @@ loadMacros( "PGML.pl", "contextLimitedPolynomial.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +42,7 @@ loadMacros( Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context()->variables->are( $var=>'Real'); $a = random(2,10,1); @@ -58,11 +61,9 @@ TEXT(beginproblem()); BEGIN_PGML -Use the distributive property to write an equivalent expression that has no grouping symbols. - - [` [$func]`] +Use the distributive property to write an equivalent expression to [` [$func]`] that has no grouping symbols. - [`=`] [______________]{$ans} + [______________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty20.pg index 2593d6c471..a295288689 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty20.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(distributive_property) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -30,7 +34,7 @@ loadMacros( "PGML.pl", "contextLimitedPolynomial.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -38,10 +42,10 @@ loadMacros( Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context()->variables->are( $var=>'Real'); -$a = random(-20,-2,1); +$a = random(-10,-2,1); $b = non_zero_random(-10,10,1); $func = Compute("$a*($var+$b)")->reduce; $ans = Compute("$a*$var+$a*$b")->reduce; @@ -57,11 +61,9 @@ TEXT(beginproblem()); BEGIN_PGML -Use the distributive property to write an equivalent expression that has no grouping symbols. +Use the distributive property to write an equivalent expression to [` [$func]`] that has no grouping symbols. - [` [$func]`] - - [`=`] [______________]{$ans} + [______________]{$ans} END_PGML @@ -69,11 +71,9 @@ END_PGML BEGIN_PGML_SOLUTION -To use the distributive property, we multiply the number outside the parentheses, [`[$a]`], with each term inside the parentheses: - - [``\begin{aligned} +To use the distributive property, we multiply the number outside the parentheses, [`[$a]`], with each term inside the parentheses: [```\begin{aligned} \quad[$func] & =[$a]\cdot [$var] +[$a]([$b])\\ - & =[$ans]\end{aligned}``] + & =[$ans]\end{aligned}```] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty21.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty21.pg index 4f7be5f8a2..898738b00d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty21.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty21.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_times_mono) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty22.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty22.pg index 7613d52623..42aa172ee8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty22.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty22.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(monomial_times_polynomial) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty30.pg index bd6da9c277..cbdadfeedb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty30.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(distributive_property) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -30,7 +34,7 @@ loadMacros( "PGML.pl", "contextLimitedPolynomial.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -38,7 +42,7 @@ loadMacros( Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context()->variables->are( $var=>'Real'); $a = -1; @@ -57,11 +61,9 @@ TEXT(beginproblem()); BEGIN_PGML -Use the distributive property to write an equivalent expression that has no grouping symbols. - - [` [$func]`] +Use the distributive property to write an equivalent expression to [` [$func]`] that has no grouping symbols. - [`=`] [______________]{$ans} + [______________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty40.pg index f74092920d..42416aae32 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty40.pg @@ -8,16 +8,20 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(distributive_property2) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + ############################################## @@ -30,7 +34,7 @@ loadMacros( "PGML.pl", "contextLimitedPolynomial.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -38,7 +42,7 @@ loadMacros( Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context()->variables->are( $var=>'Real'); $a = random(2,10,1); @@ -59,11 +63,9 @@ TEXT(beginproblem()); BEGIN_PGML -Use the distributive property to simplify the expression completely. - - [` [$func]`] +Use the distributive property to simplify [` [$func]`] completely. - [`=`] [______________]{$ans} + [______________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty41.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty41.pg index 741aeefffa..ead5fe828d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty41.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty41.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty50.pg index 7e0aeb28b3..e27feeb86c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty50.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(distributive_property2) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -30,7 +34,7 @@ loadMacros( "PGML.pl", "contextLimitedPolynomial.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -38,11 +42,11 @@ loadMacros( Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context()->variables->are( $var=>'Real'); $a = random(2,10,1); -$b = random(-15,-2,1); +$b = random(-10,-2,1); $c = non_zero_random(-10,10,1); $d = non_zero_random(-10,10,1); $func = Compute("$a+$b*($c+$d*$var)")->reduce; @@ -59,11 +63,9 @@ TEXT(beginproblem()); BEGIN_PGML -Use the distributive property to simplify the expression completely. +Use the distributive property to simplify [` [$func]`] completely. - [` [$func]`] - - [`=`] [______________]{$ans} + [______________]{$ans} END_PGML @@ -76,13 +78,11 @@ do {$solnString = '& = [$a]+(-[$Absb])([$c]+[$d][$var])\\ & = [$a]+(-[$Absb])([$ BEGIN_PGML_SOLUTION -We first use distributive property to get rid of parentheses, and then combine like terms: - - [``\begin{aligned} +We first use distributive property to get rid of parentheses, and then combine like terms: [```\begin{aligned} [$func] [$solnString]** & = [$a]+[$b*$c] +[$b*$d][$var]\\ & = [$a+$b*$c] +[$b*$d][$var]\\ - & = [$ans]\end{aligned}``] + & = [$ans]\end{aligned}```] Note that either of the last two expressions are acceptable final answers. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty51.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty51.pg index dd930b163f..eb5cd9e191 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty51.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty51.pg @@ -9,14 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty52.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty52.pg index fb69c94b8f..5953a6290c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty52.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty52.pg @@ -9,14 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty60.pg index 8524e733ef..e246ee4ab1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty60.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(distributive_property2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -31,7 +34,8 @@ loadMacros( "PGML.pl", "contextLimitedPolynomial.pl", "PCCmacros.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## @@ -39,7 +43,7 @@ loadMacros( Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context()->variables->are( $var=>'Real'); $a = random(2,10,1); @@ -60,11 +64,9 @@ TEXT(beginproblem()); BEGIN_PGML -Use the distributive property to simplify the expression completely. - - [` [$func]`] +Use the distributive property to simplify [` [$func]`] completely. - [`=`] [______________]{$ans} + [______________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty70.pg index 70f665065e..55feeaaf24 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty70.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(distributive_property2) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -30,7 +34,7 @@ loadMacros( "PGML.pl", "contextLimitedPolynomial.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -38,7 +42,7 @@ loadMacros( Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context()->variables->are( $var=>'Real'); $a = random(2,10,1); @@ -61,11 +65,9 @@ TEXT(beginproblem()); BEGIN_PGML -Use the distributive property to simplify the expression completely. - - [` [$func]`] +Use the distributive property to simplify [` [$func]`] completely. - [`=`] [______________]{$ans} + [______________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty80.pg index 6cc1640d3a..747d22013c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty80.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(distributive_property) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','fraction') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -31,7 +35,8 @@ loadMacros( "contextLimitedPolynomial.pl", "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## @@ -39,7 +44,7 @@ loadMacros( Context("Fraction"); Context()->noreduce('(-x)-y','(-x)+y'); -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context()->variables->are( $var=>'Real'); $m = random(2,10,1); @@ -66,11 +71,9 @@ TEXT(beginproblem()); BEGIN_PGML -Use the distributive property to simplify the expression completely. - - [` [$func]`] +Use the distributive property to simplify [` [$func]`] completely. - [`=`] [______________]{$ans} + [______________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty90.pg index 3b4cbde0c1..753be6c465 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty90.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(distributive_property) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','fraction') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -31,7 +35,7 @@ loadMacros( "contextLimitedPolynomial.pl", "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +43,7 @@ loadMacros( Context("Fraction"); Context()->noreduce('(-x)-y','(-x)+y'); -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); Context()->variables->are( $var=>'Real'); $m = random(2,10,1); @@ -71,11 +75,9 @@ TEXT(beginproblem()); BEGIN_PGML -Use the distributive property to simplify the expression completely. - - [` [$func]`] +Use the distributive property to simplify [` [$func]`] completely. - [`=`] [______________]{$ans} + [______________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill10.pg index 42cb898dbd..22f20a01a8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill10.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -71,18 +75,13 @@ TEXT(beginproblem()); BEGIN_PGML Simplify the following expressions if possible. +a. [`` [$func1]=``][______________]{$ans1} -1) - [`` [$func1]=``][______________]{$ans1} +a. [`` [$func2]=``][______________]{$ans2} -2) - [`` [$func2]=``][______________]{$ans2} +a. [`` [$func3]=``][______________]{$ans3} -3) - [`` [$func3]=``][______________]{$ans3} - -4) - [`` [$func4]=``][______________]{$ans4} +a. [`` [$func4]=``][______________]{$ans4} END_PGML @@ -96,20 +95,19 @@ When we add/subtract expressions, we cannot combine "unlike terms." For example, When we multiply expressions, we can multiply "unlike terms." For example, [`[$func4]=[$ans4]`]. -1) +a. [`` [$func1]=[$ans1] ``] -2) +a. [`` [$func2]=[$ans2] ``] -3) +a. [`` [$func3]=[$ans3] ``] -4) +a. [`` [$func4]=[$ans4] ``] END_PGML_SOLUTION ENDDOCUMENT(); - diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill20.pg index 987fc3ce30..0415e2af9c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill20.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -54,8 +58,8 @@ $aPlusB = $a+$b; $func1 = Compute("$term1+$term2")->reduce; $ans1 = Compute("$aPlusB*$var**$exp1")->reduce; -$func2 = '('.$term1->TeX.')('.$term1->TeX.')'; -$ans2 = Compute("$a*$a*$var**(2*$exp1)")->reduce; +$func2 = '('.$term1->TeX.')('.$term2->TeX.')'; +$ans2 = Compute("$a*$b*$var**(2*$exp1)")->reduce; $func3 = Compute("$term1+$term3")->reduce; $ans3 = $func3->reduce; $func4 = '('.$term1->TeX.')('.$term3->TeX.')'; @@ -76,18 +80,13 @@ TEXT(beginproblem()); BEGIN_PGML Simplify the following expressions if possible. +a. [`` [$func1]=``][______________]{$ans1} -1) - [`` [$func1]=``][______________]{$ans1} - -2) - [`` [$func2]=``][______________]{$ans2} +a. [`` [$func2]=``][______________]{$ans2} -3) - [`` [$func3]=``][______________]{$ans3} +a. [`` [$func3]=``][______________]{$ans3} -4) - [`` [$func4]=``][______________]{$ans4} +a. [`` [$func4]=``][______________]{$ans4} END_PGML @@ -101,16 +100,16 @@ When we add/subtract expressions, we cannot combine "unlike terms." For example, When we multiply expressions, we can multiply "unlike terms." For example, [`[$func4]=[$ans4]`]. -1) +a. [`` [$func1]=[$ans1] ``] -2) +a. [`` [$func2]=[$ans2] ``] -3) +a. [`` [$func3]=[$ans3] ``] -4) +a. [`` [$func4]=[$ans4] ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill30.pg index df8a8f7b56..48df98fca5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill30.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -76,12 +80,9 @@ TEXT(beginproblem()); BEGIN_PGML Simplify the following expressions if possible. +a. [`` [$func1]=``][______________]{$ans1} -1) - [`` [$func1]=``][______________]{$ans1} - -2) - [`` [$func2]=``][______________]{$ans2} +a. [`` [$func2]=``][______________]{$ans2} END_PGML @@ -95,10 +96,10 @@ When we add/subtract expressions, we cannot combine "unlike terms." For example, When we multiply expressions, we can multiply "unlike terms." For example, [`[$s2]=[$s3]`]. -1) +a. [`` [$func1]=[$ans1] ``] -2) +a. [`` [$func2]=[$ans2] ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill40.pg index f384c39e70..12cec4aad0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill40.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill50.pg index faea7b7194..ecb4e797e4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill50.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill60.pg index 25441ed119..adb35862f2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill60.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill70.pg index 75229f234c..cc24767024 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill70.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill80.pg index 5823298283..8268c92447 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill80.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill90.pg index 745c313242..fc9faff2e7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/ExpressionAlgebraSkill90.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/IdentifyProperties10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/IdentifyProperties10.pg index 56f3826c1c..13aeef2ebc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/IdentifyProperties10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/IdentifyProperties10.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('') ## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +34,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -39,7 +43,7 @@ loadMacros( ############################################## -$var = RandomVariableName(); +do {$var = RandomVariableName();} until ($var ne uc($var)); $a = random(2,9,1); $b = random(2,9,1); $c = random(2,9,1); @@ -86,29 +90,29 @@ BEGIN_PGML A student has (correctly) simplified an algebraic expression in the following steps. Between each pair of steps, identify the algebraic property that justifies moving from one step to the next. - [`\phantom{={}}[$step0]`] + [```\phantom{={}}[$step0]```] [@$popup0->menu()@]* - [`=[$step1]`] + [```=[$step1]```] [@$popup1->menu()@]* - [`=[$step2]`] + [```=[$step2]```] [@$popup2->menu()@]* - [`=[$step3]`] + [```=[$step3]```] [@$popup3->menu()@]* - [`=[$step4]`] + [```=[$step4]```] - [`=[$step5]`] + [```=[$step5]```] [@$popup5->menu()@]* - [`=[$step6]`] + [```=[$step6]```] END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/SimplifyInContext10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/SimplifyInContext10.pg index 598b1a84ff..9b76322355 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/SimplifyInContext10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/SimplifyInContext10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('') ## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) -## MO(1) +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +31,8 @@ loadMacros( "contextLimitedPolynomial.pl", "parserAssignment.pl", "answerHints.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## @@ -38,17 +43,23 @@ $b = random(3,6,0.1); $c = random(0.3,0.6,0.01); $d = random(3,6,0.1); +$e = random(0.01,0.04,0.01); +$f = random(0.1,0.2,0.1); + $apc = $a+$c; $bpd = $b+$d; +$apcpe = $apc+$e; +$bpdpf = $bpd+$f; + Context("LimitedPolynomial-Strict"); Context()->variables->are(T=>'Real', x=>'Real'); parser::Assignment->Allow; Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} = "Your answer should be in the form T = $US$US$US"; -$ans = Formula("$apc x + $bpd"); -$ansEq=Formula("T=$apc x + $bpd"); +$ans = Formula("$apcpe x + $bpdpf"); +$ansEq=Formula("T=$apcpe x + $bpdpf"); ############################################## @@ -56,13 +67,7 @@ TEXT(beginproblem()); BEGIN_PGML -The number of students enrolled in math courses at Portland Community College has grown over the years. - -The formulas - - [`\begin{aligned}M&=[$a]x+[$b] & \qquad&& W&=[$c]x+[$d]\end{aligned}`] - -describe the numbers (of thousands) of men and women enrolled in math courses at PCC [`x`] years after 2005. Give a simplified formula for the total number [`T`] of thousands of students at PCC taking math classes [`x`] years after 2005. Be sure to give the entire formula, starting with [`T=`]. +The number of students enrolled in math courses at Portland Community College has grown over the years. The formulas [```\begin{aligned}M&=[$a]x+[$b] & W&=[$c]x+[$d] & N&=[$e]x+[$f]\end{aligned}```] describe the numbers (of thousands) of men, women, and gender-non-binary students enrolled in math courses at PCC [`x`] years after 2005. (Note this is an exercise using randomized numbers, not actual data.) Give a simplified formula for the total number [`T`] of thousands of students at PCC taking math classes [`x`] years after 2005. Be sure to give the entire formula, starting with [|T=|]*. [_________________________] @@ -89,18 +94,26 @@ ANS($ansEq->cmp(cmp_class=>"a formula of the form T = $US$US$US", BEGIN_PGML_SOLUTION -The total number of students [`T`] can be found by adding the male students and female students together. In the steps that follow, precisely one algebraic property at a time is applied. In practice, you might execute several of these steps together at once. +The total number of students [`T`] can be found by adding the men, women, and gender-non-binary students together. In the steps that follow, precisely one algebraic property at a time is applied. In practice, you might execute several of these steps together at once. [`\begin{aligned} -T & = M+W\\ - & = ([$a]x+[$b]) + ([$c]x+[$d])\\ - & = ([$a]x+[$b]) + ([$d]+[$c]x)\\ - & = [$a]x+([$b] + ([$d]+[$c]x))\\ - & = [$a]x+(([$b] + [$d])+[$c]x)\\ - & = [$a]x+([$bpd]+[$c]x)\\ - & = [$a]x+([$c]x+[$bpd])\\ - & = ([$a]x+[$c]x)+[$bpd]\\ - & = ([$a]+[$c])x+[$bpd]\\ +T & = M+W+N\\ + & = ([$a]x+[$b]) + ([$c]x+[$d]) + ([$e]x+[$f])\\ + & = ([$a]x+[$b]) + ([$d]+[$c]x) + ([$e]x+[$f])\\ + & = [$a]x+([$b] + ([$d]+[$c]x)) + ([$e]x+[$f])\\ + & = [$a]x+(([$b] + [$d])+[$c]x) + ([$e]x+[$f])\\ + & = [$a]x+([$bpd]+[$c]x) + ([$e]x+[$f])\\ + & = [$a]x+([$c]x+[$bpd]) + ([$e]x+[$f])\\ + & = ([$a]x+[$c]x)+[$bpd] + ([$e]x+[$f])\\ + & = ([$a]+[$c])x+[$bpd] + ([$e]x+[$f])\\ + & = ([$apc]x+[$bpd]) + ([$e]x+[$f])\\ + & = ([$apc]x+[$bpd]) + ([$f]+[$e]x)\\ + & = [$apc]x+([$bpd] + ([$f]+[$e]x))\\ + & = [$apc]x+(([$bpd] + [$f])+[$e]x)\\ + & = [$apc]x+([$bpdpf]+[$e]x)\\ + & = [$apc]x+([$e]x+[$bpdpf])\\ + & = ([$apc]x+[$e]x)+[$bpdpf]\\ + & = ([$apc]+[$e])x+[$bpdpf]\\ & = [$ans] \end{aligned}`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/inverses10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/inverses10.pg index 980f025412..210ce17acc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/inverses10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/inverses10.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Interpreting integers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -48,7 +52,9 @@ TEXT(beginproblem()); BEGIN_PGML -The additive inverse of [`[$a]`] is [_____]{$ans} +What is the additive inverse of [`[$a]`]? + +[_____]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/inverses20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/inverses20.pg index 69b3188376..0579123a64 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/inverses20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/AlgebraicProperties/inverses20.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.3') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('distributive','expression','linear','negative') +## DBCCSS('6.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -48,7 +52,9 @@ TEXT(beginproblem()); BEGIN_PGML -The multiplicative inverse of [`[$a]`] is [_____]{$ans} +What is the multiplicative inverse of [`[$a]`]? + +[_____]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculateRadical10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculateRadical10.pg new file mode 100644 index 0000000000..9185624467 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculateRadical10.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the value of a radical. +# +# Last edited: Carl Yao 8/31/13, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("LimitedNumeric"); + +$a = list_random(16,25,36,49,64,81,100); +$rad = $a+random(1,3,1)*random(-1,1,2); +$lower = int(sqrt($rad)); +$upper = ceil(sqrt($rad)); +$lower2 = $lower**2; +$upper2 = $upper**2; + +$ans = sqrt($rad); +$ans = Real($ans); + +##################################################### + +BEGIN_PGML + +Evaluate the following. + +Use a calculator to approximate with a decimal. + + [`\sqrt{[$rad]}\approx`][__________]{$ans} + + +END_PGML + +############################################################ + + +BEGIN_PGML_SOLUTION + +A calcultaor shows that [`\sqrt{[$rad]}\approx[$ans]`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics10.pg new file mode 100644 index 0000000000..fd891c13a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics10.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Differentiate between minus sign and negative sign. +# +# Last edited: Yao 5/17/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a=random(1,5,1); +$b=random(1,5,1); +$ans=-$a-$b; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +The purpose of this problem is to differentiate between the negative symbol and the subtraction symbol. + +Use a TI-89 or Casio ClassPad 330 graphing calculator to evaluate this expression: + + [`` -[$a]-[$b] ``] = [__________]{$ans} + +END_PGML + +############################################## + +$wrong = $a*$b; + +BEGIN_PGML_SOLUTION + +For TI-89, press HOME button. For Casio ClassPad 330, tap Menu, and then Main. + +On your graphing calculator, there is a button for the subtraction symbol, and another button for the negative symbol. They are different! + +For this problem, we should first use the negative symbol to input [`-[$a]`], and then use the subtraction symbol for [`-[$b]`]: + + [``^{-}[$a]-[$b]``] + +and we would get the correct answer, [`[$ans]`]. + +If you use the subtraction symbol for [`-[$a]`], most likely, the calculator will assume you will subtract something from the last answer, and either "ans" or "ans(1)" would automatically pop up in the input line, even though you don't need it. + +Now, use the negative symbol for both symbols (on TI-89 only): [` ^{-}[$a]^{-}[$b] `]. The calculator would interpret this expression as [`(-[$a])\cdot(-[$b]) `], and we would get [`[$wrong]`]. + +Casio ClassPad 330 is smart enough to interpret [` ^{-}[$a]^{-}[$b] `] as [` -[$a]-[$b] `]. For the subtraction symbol in [`^{-}[$a]-[$b]`], it doesn't matter whether you use the negative symbol button or the subtraction symbol button. However, it's good to know when to use which correctly. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics20.pg new file mode 100644 index 0000000000..2c56220f36 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics20.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Using parenthesis in cases like 1+(-3)^2 +# +# Last edited: Yao 5/17/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a=random(1,5,1); +$b=random(1,5,1); +$ans=$a+(-$b)**2; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to evaluate this expression: + + [`` [$a]+(-[$b])^2 ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +For this problem, we may not ignore the parentheses. + +We should enter [` [$a]+(^{-}[$b]) \wedge 2 `] + +If we entered [` [$a]+^{-}[$b] \wedge 2 `], we would get an incorrect answer, because + + [`` +\begin{aligned}[t] + (-[$b])^{2}=[$b*$b] \\ + -[$b]^{2}=-[$b*$b] +\end{aligned} + ``] + +Actually, this is not a calculator issue. The difference above is because of order of operations. + +In [` -[$b]^{2}=-[$b*$b] `] , exponent overrides the negative symbol, and thus we have [` -[$b]^{2}=-[$b]\cdot[$b]=-[$b*$b] `]. + +In [` (-[$b])^{2}=[$b*$b] `], parentheses override exponent, so we have: [` (-[$b])^{2}=(-[$b])(-[$b])=[$b*$b] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics30.pg new file mode 100644 index 0000000000..232bf538ec --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics30.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Using parenthesis in cases like 6/(1+2). +# +# Last edited: Yao 5/17/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$den = random(4,9,1); +$ans = random(1,9,1); +$num = $den*$ans; +$a = random(1,$den-1,1); +$b = $den-$a; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to evaluate this expression: + + [`` \frac{[$num]}{[$a]+[$b]} ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When we input a fraction into a graphing calculator, we must know when to add an extra pair of parentheses around the numerator and/or the denominator. + +Here is what we should input: + + [`` [$num]/([$a]+[$b]) ``] + +and we would get the correct answer, [`[$ans]`]. + +If we forgot to input the parentheses, + + [`` [$num]/[$a]+[$b] ``] + +the calculator would follow the order of operations and do division first, as: + + [`` \frac{[$num]}{[$a]}+[$b] ``] + +and the answer would be incorrect. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics40.pg new file mode 100644 index 0000000000..1081a82826 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics40.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Using parenthesis in cases like (3+9)/2. +# +# Last edited: Yao 5/17/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$den = random(2,9,1); +$ans = random(1,9,1); +$num = $den*$ans; +$a = random(1,$num-1,1); +$b = $num-$a; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to evaluate this expression: + + [`` \frac{[$a]+[$b]}{[$den]} ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When we input a fraction into a graphing calculator, we must know when to add an extra pair of parentheses around the numerator and/or the denominator. + +Here is what we should input: + + [`` ([$a]+[$b])/[$den] ``] + +and we would get the correct answer, [`[$ans]`]. + +If we forgot to input the parentheses, + + [`` [$a]+[$b]/[$den] ``] + +the calculator would follow the order of operations and do division first, as: + + [`` [$a]+\frac{[$b]}{[$den]} ``] + +and the answer would be incorrect. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics50.pg new file mode 100644 index 0000000000..605361ecbc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics50.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Using parenthesis in cases like 6/(2*3). +# +# Last edited: Yao 5/17/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a = random(2,5,1); +$b = random(2,5,1); + +$den = $a*$b; +$ans = random(1,9,1); +$num = $den*$ans; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to evaluate this expression: + + [`` \frac{[$num]}{[$a]\cdot[$b]} ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When we input a fraction into a graphing calculator, we must know when to add an extra pair of parentheses around the numerator and/or the denominator. + +Here is what we should input: + + [`` [$num]/([$a] * [$b]) ``] + +and we would get the correct answer, [`\frac{[$num]}{[$den]}=[$ans]`]. + +If we forgot to input the parentheses, + + [`` [$num]/[$a] * [$b] ``] + +the calculator would follow the order of operations and do division first, as: + + [`` \frac{[$num]}{[$a]}\cdot[$b] ``] + +and the answer would be incorrect. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics60.pg new file mode 100644 index 0000000000..86424bb8e7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics60.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Using parenthesis in cases like (1/2)/(3/4) +# +# Last edited: Yao 5/17/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFraction"); +Context()->flags->set(showMixedNumbers=>0); + +$num1=random(1,5,1); +do {$den1=random(2,5,1);} until (gcd($num1,$den1)==1); +$frac1 = Fraction($num1,$den1); +$num2=random(2,5,1); +do {$den2=random(2,5,1);} until (gcd($num2,$den2)==1); +$frac2 = Fraction($num2,$den2); + +$ans = $frac1/$frac2; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to evaluate this expression: + + [`` \frac{[$frac1]}{[$frac2]} ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When we input a fraction into a graphing calculator, we must know when to add an extra pair of parentheses around the numerator and/or the denominator. + +Here is what we should input: + + [`` [$num1]/[$den1]/([$num2]/[$den2]) ``] + +or + + [`` ([$num1]/[$den1])/([$num2]/[$den2]) ``] + +and we would get the correct answer, [` [$ans]`]. + +If we forgot to input the parentheses, + + [`` [$num1]/[$den1]/[$num2] / [$den2] ``] + +the calculator would follow the order of operations and do division three times, as: + + [`` [$num1]\div[$den1]\div [$num2] \div [$den2] ``] + +and the answer would be incorrect. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics70.pg new file mode 100644 index 0000000000..9d2219ef79 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics70.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Evaluate 2^(1+1). +# +# Last edited: Yao 5/17/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a = random(2,4,1); +$b = random(1,3,1); +$c = random(1,3,1); +$ans = $a**($b+$c); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to evaluate this expression: + + [`` [$a]^{[$b]+[$c]} ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We need to add a pair of parentheses around [`[$b]+[$c]`]. + +The correct way to enter this expression is: + + [`` [$a] \wedge ([$b]+[$c]) ``] + +and we would get the correct answer: [`[$a]^{[$b+$c]}=[$ans]`]. + +If we forget the parentheses and type in: + + [`` [$a] \wedge [$b]+[$c] ``] + +the calculator would follow the order of operations, and do + + [`` [$a]^{[$b]}+[$c] ``] + +to give a wrong solution. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics80.pg new file mode 100644 index 0000000000..f335ac3d57 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics80.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Using parenthesis in cases like sqrt(4)+2 +# +# Last edited: Yao 5/17/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a=list_random(1,4,9,16,25); +$b=random(1,5,1); +$ans=sqrt($a)+$b; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to evaluate this expression: + + [`` \sqrt{[$a]}+[$b]``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When we use a function (like the square root function) in a graphing calculator, we must know where to enter the closing parenthesis. + +For this problem, we should enter + + [`` \sqrt{\enspace} ([$a])+[$b] ``] + +If we didn't close the parentheses in the wrong place, like + + [`` \sqrt{\enspace} ([$a]+[$b]) ``] + +The answer would be wrong. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics90.pg new file mode 100644 index 0000000000..329a16ca76 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorBasics90.pg @@ -0,0 +1,73 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# How to get decimal answers in a graphing calculator. +# +# Last edited: Yao 5/17/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do {$num = random(1,10,1); +$den = list_random(2,4,5,8);} until (gcd($num,$den)==1); +$ans = $num/$den; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to evaluate this expression, and express the answer in *decimals*. Don't round your answers. + + [`` [$num] \div [$den] ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By default, a graphing calculator gives accurate answers, like fractions. If we simply input [` [$num]/[$den] `], we would get [` \frac{[$num]}{[$den]} `] as the answer. + +For TI-89, to get a decimal answer, press the Diamond button, and then press ENTER. + +For Casio ClassPad 330, to get a decimal answer, tap to highlight the answer, and then tap the "0.5 to [`\frac{1}{2}`]" button on top. + +We could change a calculator's settings to always give decimal answers. However, in most cases, we do need accurate answers. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorEstimateRadical10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorEstimateRadical10.pg index 60d86d0129..8ec1d6e685 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorEstimateRadical10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorEstimateRadical10.pg @@ -1,8 +1,3 @@ -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Estimation) -## MLT(calculator-estimate-radical) -## Level(2) # WeBWorK problem written by Carl Yao # Portland Community College # @@ -23,7 +18,7 @@ loadMacros( "MathObjects.pl", "contextLimitedPowers.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -75,6 +70,8 @@ TI-89 has a "square root" button. To enter a more complex radical, we need to ch Now, we can enter this expression as [`[$m]`]^[`([$num]/[$den])`], and then press Diamond, Enter to get a rounded value. The correct answer is [`[$ans]`]. +Note that the parenthesis around [`([$num]/[$den])`] cannot be omited. + You could do the same thing on Casio, and then tap the "fraction to decimal" icon to see a rounded answer. Or, you can press the Keyboard button, tap the 2D tab, and use the radical icon to directly input [`\sqrt[[$den]]{[$m]^{[$num]}}`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorEstimateRadical20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorEstimateRadical20.pg new file mode 100644 index 0000000000..cb4338252c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorEstimateRadical20.pg @@ -0,0 +1,81 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the value of (-2)^(1/3) with a calculator +# +# +# Last updated: Yao 02/05/16 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserRoot.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("LimitedNumeric"); +parser::Root->Enable; + +#For "two or more decimal places" +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); + +do { + $m = random(-100,-10,1); + $n = random(3,9,2); + $ans = Real(root($n,$m)); +} until (int($ans)!=$ans); + + + + +############################################## + + +BEGIN_PGML + +Find this expression's value with a calculator. Round your answer to two or more decimal places. + + [``\sqrt[[$n]]{[$m]}``] + + [__________]{$ans} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +TI-89 has a "square root" button. To enter a more complex radical, we need to change the radical to an expression with a rational exponent. For this example, we have: + + [`` \sqrt[[$n]]{[$m]} = ([$m])^{\frac{1}{[$n]}} ``] + +Now, we can enter this expression as ([$m])^(1/[$n]), and then press Diamond, Enter to get a rounded value. The correct answer is [`[$ans]`]. + +You could do the same thing on Casio, and then tap the "fraction to decimal" icon to see a rounded answer. Or, you can press the Keyboard button, tap the 2D tab, and use the radical icon to directly input [`\sqrt[[$n]]{[$m]}`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorEvaluateFunction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorEvaluateFunction10.pg new file mode 100644 index 0000000000..f47aecccb0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorEvaluateFunction10.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Use y1(#) to find y values. +# +# Last edited: Yao 5/18/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','application') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", + "contextCurrency.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$m = random(0.02,0.09,0.01); +$b = non_zero_random(10,30,5); + +$func = Compute("$m*x+$b")->reduce; + +$candies = random(500,900,50); +$cost = $func->eval(x=>$candies); + +Context("Currency"); +$mC = Currency("$m"); +$bC = Currency("$b"); +$costC = Currency("$cost"); + +Context("LimitedNumeric"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A company sells candies over the Internet. The shipping and handling cost is a flat fee of [`[$bC]`]. Each candy costs [`[$mC]`]. Use a graphing calculator to defined a function in y1, and then find the cost of purchasing [`[$candies]`] candies. + +It costs [___________]{$costC} to purchase [`[$candies]`] candies. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since the cost per candy is [`[$mC]`] and the shipping fee is [`[$bC]`], we can model the cost of buying candies with the function + + [`` f(x)=[$func] ``] + +where [`f(x)`] is the cost in dollars, and [`x`] is the number of candies we will purchase. + +Next, we will use a graphing calculator to find the cost of purchasing [`[$candies]`] candies, or [`f([$candies])`]. + +##TI-89 Instructions + +1. Press Diamond, and then F1. Now we can enter functions. + +2. If Y1 is already defined, use the arrow keys to highlight Y1 and then press CLEAR. + +3. Enter the function [` [$m] * x+[$b] `]. Press ENTER. (The multiplication symbol is optional.) + +4. Press Home button. + +5. Type y1([$candies]), press ENTER. + +Now we can see the [`y`] value when [`x=[$candies]`], or, [`f([$candies])=[$cost]`]. + +It costs [`[$costC]`] to purchase [`[$candies]`] candies. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". + +3. If y1 is already defined, press Clear button. + +4. Enter the function [` [$m] * x+[$b] `]. Press EXE. (The multiplication symbol is optional.) + +5. Tap "Menu", and then "Main". + +6. Type y1([$candies]), press EXE. + +Now we can see the [`y`] value when [`x=[$candies]`], or, [`f([$candies])=[$cost]`]. + +It costs [`[$costC]`] to purchase [`[$candies]`] candies. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools10.pg new file mode 100644 index 0000000000..21610a8958 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools10.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Graph a line. +# Use TI-89's "Value" function and Casio's "y-Cal" function to find y values. +# +# Last edited: Yao 5/18/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$m = random(2,4,1)*random(-1,1,2); +$b = non_zero_random(-3,3,1); + +$func = Compute("$m*x+$b")->reduce; + +$ans0 = $func->eval(x=>-1); +$ans1 = $func->eval(x=>0); +$ans2 = $func->eval(x=>1); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to graph the line [` f(x)=[$func] `]. + +Using TI-89's "Value" function (under F5's menu) or Casio's "y-Cal" function (under Analysis, G-Solve) to find the value of the following: + + [`` f(-1) ``] = [__________]{$ans0} + + [`` f(0) ``] = [__________]{$ans1} + + [`` f(1) ``] = [__________]{$ans2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +##TI-89 Instructions + +1. Press Diamond, and then F1. Now we can enter functions. + +2. If Y1 is already defined, use the arrow keys to highlight Y1 and then press CLEAR. + +3. Enter the function [` [$m] * x+[$b] `]. Press ENTER. (The multiplication symbol is optional.) + +4. Press Diamond, and then F3. If we cannot see any line, it means the calculator is not zoomed correctly. Press F2, and then choose option 6. This will go to the default window, which looks at the interval [` [-10,10] `] on both [`x`] and [`y`] axis. + +5. Press F5, and then choose option 1, "Value". + +6. Enter an [`x`]-value, say [`-1`]. Press ENTER. The calculator will display: when [`x=-1`], [`y=[$ans0]`], or, [`f(-1)=[$ans0]`]. + +7. Repeat from Step 5. Enter other [`x`] values to find [`f(0)=[$ans1]`] and [`f(1)=[$ans2]`]. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". + +3. If y1 is already defined, press Clear button. + +4. Enter the function [` [$m] * x+[$b] `]. Press EXE. (The multiplication symbol is optional.) + +5. Tap the graph tile (first one on the top left). If we cannot see any line, it means the calculator is not zoomed correctly. Tap Zoom menu, and choose "quick standard". This will go to the default window, which looks at the interval [` [-10,10] `] on both [`x`] and [`y`] axis. + +6. Tap Analysis, G-Solve, y-Cal. + +7. Enter an [`x`]-value, say [`-1`]. Tap OK. The calculator will display: when [`x=-1`], [`y=[$ans0]`], or, [`f(-1)=[$ans0]`]. + +8. Repeat from Step 6. Enter other [`x`] values to find [`f(0)=[$ans1]`] and [`f(1)=[$ans2]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools20.pg new file mode 100644 index 0000000000..7130789bc9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools20.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Graph a line, adjust Window settings. +# Use TI-89's "Value" function and Casio's "y-Cal" function to find y values. +# +# Last edited: Yao 5/18/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','window') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$m = random(2,4,1)*random(-1,1,2); +$b = non_zero_random(-3,3,1); + +$func = Compute("$m*x+$b")->reduce; + +$x0 = random(11,20,1); +$x1 = random(-20,-11,1); + +$ans0 = $func->eval(x=>$x0); +$ans1 = $func->eval(x=>$x1); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to graph the line [` f(x)=[$func] `]. + +Using TI-89's "Value" function (under F5's menu) or Casio's "y-Cal" function (under Analysis, G-Solve) to find the value of the following: + + [`` f([$x0]) ``] = [__________]{$ans0} + + [`` f([$x1]) ``] = [__________]{$ans1} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +##TI-89 Instructions + +1. Press Diamond, and then F1. Now we can enter functions. + +2. If Y1 is already defined, use the arrow keys to highlight Y1 and then press CLEAR. + +3. Enter the function [` [$m] * x+[$b] `]. Press ENTER. (The multiplication symbol is optional.) + +4. Press Diamond, and then F3. Now we can see part of the line's graph. + +5. Press F5, and then choose option 1, "Value". + +6. Enter [`[$x0]`]. Press ENTER. Most likely, we would receive the "Window Variable Domain" error. This is because the point [` ([$x0],[$ans0]) `] is outside the range of the current window. + +7. Press Diamond, and then F2. Now we can adjust the window range. We can use whatever value we want. For this problem, [` [-20,20] `] for [`x`] and [` [-100,100] `] for [`y`] should be enough. So we set: xmin=[`-20`], xmax=[`20`], ymin=[`-100`], ymax=[`100`]. + +8. Press Diamond, and then F3. + +9. Press F5, and then choose option 1, "Value". + +10. Enter [`[$x0]`]. Press Enter. The calculator will display: when [`x=[$x0]`], [`y=[$ans0]`], or, [`f([$x0])=[$ans0]`]. + +11. Repeat from Step 9. Enter [`[$x1]`] to find [`f([$x1])=[$ans1]`]. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". + +3. If y1 is already defined, press Clear button. + +4. Enter the function [` [$m] * x+[$b] `]. Press EXE. (The multiplication symbol is optional.) + +5. Tap the graph tile (first one on the top left). Now we can see part of the line's graph. + +6. Tap Analysis, G-Solve, y-Cal. Enter [`[$x0]`]. Press ENTER. Most likely, we would receive the "Domain" error. This is because the point [` ([$x0],[$ans0]) `] is outside the range of the current window. + +7. Tap "Cancel". Tap the View Window tile (This tile is the third tile if the graph window is highlighted, and it is the fourth tile if the equation window is highlighted). Now we can adjust the window range. We can use whatever value we want. For this problem, [` [-20,20] `] for [`x`] and [` [-100,100] `] for [`y`] should be enough. So we set: xmin=[`-20`], xmax=[`20`], ymin=[`-100`], ymax=[`100`]. + +8. Tap Analysis, G-Solve, y-Cal. + +9. Enter [`[$x0]`]. Tap OK. The calculator will display: when [`x=[$x0]`], [`y=[$ans0]`], or, [`f([$x0])=[$ans0]`]. + +10. Repeat from Step 8. Enter [`[$x1]`] to find [`f([$x1])=[$ans1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools30.pg new file mode 100644 index 0000000000..dd49adeea4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools30.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Use a graphing calculator to locate a function's x-intercept(s). +# +# Last edited: Yao 5/18/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','zero','intercept') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$space = 20; + +$a = -1*random(2,4,1); +$x0 = non_zero_random(-10,10,1); +$x1 = non_zero_random(40,100,1); +$b = -$a*($x0+$x1); +$c = $a*$x0*$x1; + +$func = Compute("$a*x**2+$b*x+$c")->reduce; +$xVertex = ($x0+$x1)/2; +$yVertex = $func->eval(x=>$xVertex); + +$top = int($yVertex+$space); +$bottom = int(-$space); +$left = $x0-$space; +$right = $x1+$space; + +Context("Point"); +$ans0 = Point("($x0,0)"); +$ans1 = Point("($x1,0)"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to graph the parabola [` f(x)=[$func] `]. + +Using TI-89's "Zero" function (under F5's menu on a graph screen) or Casio's "x-Cal" function (under Analysis, G-Solve on a graph screen) to find this parabola's two [`x`]-intercepts. Write your answers as points. + + The parabola's [`x`]-intercepts are [__________]{$ans0} and [__________]{$ans1}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +##TI-89 Instructions + +1. Press Diamond, and then F1. Clear Y1 if needed. + +2. Enter the function [` [$func] `] for Y1. Press ENTER. + +3. Press Diamond, and then F3. Most likely we won't see any graph, because the graph is out of the window range. + +4. Press Diamond and then F2. Change Window settings until we can see the whole parabola. Only use the following recommended settings if you are stuck: xmin=[`[$left]`], xmax=[`[$right]`], ymin=[`[$bottom]`], ymax=[`[$top]`]. + +5. On the screen, locate the parabola's [`x`]-intercepts on the left-side. Press F5, choose Option 2 (Zero). This option will locate a function's [`x`]-intercept(s). + +6. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the first [`x`]-intercept we are looking at. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +7. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the [`x`]-intercept we are looking at. Press ENTER. + +8. The calculator will display the first [`x`]-intercept's location. Repeat Step 6, 7 and 8 to locate the other [`x`]-intercept. + +##TI-89 Shortcut + +1. Define Y1 as in Step 2 above. + +2. Press HOME. + +3. Press F2, choose Option 1 (solve). Enter the line as "solve(y1(x)=0,x)". Press ENTER. + +There are our two [`x`]-intercepts! Only use this shortcut after you know how to do this by graph, which helps you better understand the concept. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [` [$func] `] for y1. Press EXE. + +3. Tap the graph tile (first from the left). Most likely we won't see any graph, because the graph is out of the window range. + +4. When the graph window is highlighted, tap the View Window tile (third from left). Change Window settings until we can see the whole parabola. Only use the following recommended settings if you are stuck: xmin=[`[$left]`], xmax=[`[$right]`], ymin=[`[$bottom]`], ymax=[`[$top]`]. + +5. Once we can see the parabola's [`x`]-intercepts, tap Analysis, G-Solve, x-Cal. Since we are looking for the [`x`]-intercepts, we want the [`y`]-value to be [`0`]. Enter [`0`] for [`y`]-value, tap OK. The calculator will locate the first [`x`]-intercept. + +6. Use the right arrow key to move to the other [`x`]-intercept on the graph. + +##Casio ClassPad 330 Shortcut + +1. Define y1 as in Step 2 above. + +2. Tap Menu, and then Main. + +3. Tap Action, Advanced, Solve. Enter the line as "solve(y1(x)=0,x)". Press EXE. + +There are our two [`x`]-intercepts! Only use this shortcut after you know how to do this by graph, which helps you better understand the concept. + +##Solutions: + + The parabola's [`x`]-intercepts are [`[$ans0]`] and [`[$ans1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools40.pg new file mode 100644 index 0000000000..0b9c3b57fb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools40.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Use a graphing calculator to locate a function's maximum value. +# +# Last edited: Yao 5/29/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','maximum') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = -1; +$xVertex = non_zero_random(-8,8,1); +$yVertex = non_zero_random(-2,8,1); + +$b=2*$xVertex; +$c=-$xVertex**2+$yVertex; + +$func = Compute("$a*x**2+$b*x+$c")->reduce; + +Context("Point"); +$vertex = Point("($xVertex,$yVertex)"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to graph the parabola [` f(x)=[$func] `]. + +Using TI-89's "Maximum" function (under F5's menu on a graph screen) or Casio's "Max" function (under Analysis, G-Solve on a graph screen) to find this parabola's vertex. Write your answers as a point. + + The parabola's vertex is [__________]{$vertex}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +##TI-89 Instructions + +1. Press Diamond, and then F1. Clear Y1 if needed. + +2. Enter the function [` [$func] `] for Y1. Press ENTER. + +3. Press Diamond, and then F3. If we cannot see the parabola's vertex, press F2, and then option 6 (default window). + +4. On the screen, locate the parabola's vertex. Press F5, choose Option 4 (Maximum). This option will locate a function's maximum value in a certain range. + +5. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the vertex. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +6. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the vertex. Press ENTER. + +7. The calculator will display the maximum value in the range we specified. In this case, it is the parabola's vertex. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [` [$func] `] for y1. Press EXE. + +3. Tap the graph tile (first from the left). If we cannot see the parabola's vertex, tap Zoom, Original (default window). + +4. Once we can see the parabola's vertex, tap Analysis, G-Solve, Max. + +5. The calculator will locate the maximum value. + +##Solution: + + The parabola's vertex is [`[$vertex]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools50.pg new file mode 100644 index 0000000000..6f4a706e77 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorGraphingTools50.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Use a graphing calculator to locate a function's minimum value. +# +# Last edited: Yao 5/29/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','minimum') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = 1; +$xVertex = non_zero_random(-8,8,1); +$yVertex = non_zero_random(-8,2,1); + +$b=-2*$xVertex; +$c=$xVertex**2+$yVertex; + +$func = Compute("$a*x**2+$b*x+$c")->reduce; + +Context("Point"); +$vertex = Point("($xVertex,$yVertex)"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to graph the parabola [` f(x)=[$func] `]. + +Using TI-89's "Minimum" function (under F5's menu on a graph screen) or Casio's "Min" function (under Analysis, G-Solve on a graph screen) to find this parabola's vertex. Write your answers as a point. + + The parabola's vertex is [__________]{$vertex}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +##TI-89 Instructions + +1. Press Diamond, and then F1. Clear Y1 if needed. + +2. Enter the function [` [$func] `] for Y1. Press ENTER. + +3. Press Diamond, and then F3. If we cannot see the parabola's vertex, press F2, and then option 6 (default window). + +4. On the screen, locate the parabola's vertex. Press F5, choose Option 3 (Minimum). This option will locate a function's minimum value in a certain range. + +5. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the vertex. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +6. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the vertex. Press ENTER. + +7. The calculator will display the minimum value in the range we specified. In this case, it is the parabola's vertex. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [` [$func] `] for y1. Press EXE. + +3. Tap the graph tile (first from the left). If we cannot see the parabola's vertex, tap Zoom, Original (default window). + +4. Once we can see the parabola's vertex, tap Analysis, G-Solve, Min. + +5. The calculator will locate the minimum value. + +##Solution: + + The parabola's vertex is [`[$vertex]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorIntersection10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorIntersection10.pg new file mode 100644 index 0000000000..e09cec46ef --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorIntersection10.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Use a graphing calculator to find the intersection of two functions. +# There is one intersection point. +# +# Last edited: Yao 5/29/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$xSolution = non_zero_random(-8,8,1); +$ySolution = non_zero_random(-8,8,1); + +$m0 = non_zero_random(-4,4,1); +$b0 = $ySolution - $m0*$xSolution; +do {$m1 = non_zero_random(-4,4,1);} until ($m1!=$m0); +$b1 = $ySolution - $m1*$xSolution; + +$func0 = Compute("$m0*x+$b0")->reduce; +$func1 = Compute("$m1*x+$b1")->reduce; + +Context("Point"); +$solution = Point("($xSolution,$ySolution)"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to solve this system equation: + + [`` \left\{ + \begin{aligned} + y &= [$func0] \\ + y &= [$func1] \\ + \end{aligned} + \right.``] + +Using TI-89's "Intersection" function (under F5's menu on a graph screen) or Casio's "Intersect" function (under Analysis, G-Solve on a graph screen) to find these two functions' intersection. Write your answers as a point. + + The system equation's solution is [__________]{$solution}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +##TI-89 Instructions + +1. Press Diamond, and then F1. Clear Y1 and Y2 if needed. + +2. Enter the function [` [$func0] `] for Y1 and [`[$func1]`] for Y2. Press ENTER. + +3. Press Diamond, and then F3. If we cannot see these two functions' intersection, press F2, and then option 6 (default window). + +4. On the screen, locate the intersection. Press F5, choose Option 5 (Intersection). + +5. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +6. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +7. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +8. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +9. The calculator will display the intersection, whose [`x`] value is a solution for the equation. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [` [$func0] `] for y1, and [`[$func1]`] for y2. Press EXE. + +3. Tap the graph tile (first from the left). If we cannot see these two functions' intersection, tap Zoom, Original (default window). + +4. Once we can see the intersection, tap Analysis, G-Solve, Intersect. + +5. The calculator will display the intersection, whose [`x`] value is a solution for the equation. + +##Solution: + + The system equation's solution is [`[$solution]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorIntersection20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorIntersection20.pg new file mode 100644 index 0000000000..04bc13ebab --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorIntersection20.pg @@ -0,0 +1,134 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Use a graphing calculator to find the intersection of two functions. +# There are two intersection points. +# +# Last edited: Yao 5/29/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { +$x0 = non_zero_random(-8,8,1); +$y0 = non_zero_random(-8,8,1); + +do {$x1=non_zero_random(-8,8,1);} until ($x1!=$x0); +do {$y1=non_zero_random(-8,8,1);} until ($y1!=$y0); + +$b1 = Fraction($y1-$y0-$x1**2+$x0**2, $x1-$x0); +$c1 = $y0 - $x0**2 - $b1*$x0; +} until ( (int($b1)==$b1) && (int($c1)==$c1) ); + +$func1 = Compute("x**2+$b1*x+$c1")->reduce; + +$m = Fraction($y1-$y0,$x1-$x0)->reduce; +$b = $y0-$m*$x0; +$func0 = Compute("$m*x+$b")->reduce; + +Context("Point"); +$solution0 = Point("($x0,$y0)"); +$solution1 = Point("($x1,$y1)"); +$ans = List($solution0,$solution1); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to solve this system equation: + + [`` \left\{ + \begin{aligned} + y &= [$func0] \\ + y &= [$func1] \\ + \end{aligned} + \right.``] + +Using TI-89's "Intersection" function (under F5's menu on a graph screen) or Casio's "Intersect" function (under Analysis, G-Solve on a graph screen) to find these two functions' intersections. + +Write your answers as points. Separate your two points by a comma. + + The system equation's solutions are [__________]{$ans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +##TI-89 Instructions + +1. Press Diamond, and then F1. Clear Y1 and Y2 if needed. + +2. Enter the function [` [$func0] `] for Y1 and [`[$func1]`] for Y2. Press ENTER. + +3. Press Diamond, and then F3. If we cannot see these two functions' intersections, press F2, and then option 6 (default window). + +4. On the screen, locate one intersection. Press F5, choose Option 5 (Intersection). + +5. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +6. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +7. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +8. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +9. The calculator will display the intersection, whose [`x`] value is a solution for the equation. Repeat Step 4 through Step 8 to find the second intersection. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [` [$func0] `] for y1, and [`[$func1]`] for y2. Press EXE. + +3. Tap the graph tile (first from the left). If we cannot see these two functions' intersections, tap Zoom, Original (default window). + +4. Once we can see the intersections, tap Analysis, G-Solve, Intersect. + +5. The calculator will display the intersection, whose [`x`] value is a solution for the equation. + +6. Use the left/right arrow buttons to see the other intersection. + +##Solution: + + The system equation's solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorQuadraticFunctionApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorQuadraticFunctionApplication10.pg new file mode 100644 index 0000000000..8d39662199 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorQuadraticFunctionApplication10.pg @@ -0,0 +1,264 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use a graphing calculator to solve quadratic function problems. +# +# Last edited: Yao 8/19/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(t => 'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$a = -4.9; +$b = abs($a)*2*random(10,30,1); +$c = random(100,200,10); + +$func = Compute("$a*t**2+$b*t+$c")->reduce; +$funcX = Compute("$a*x**2+$b*x+$c")->reduce; + +#for alternative display and title purposes + + $xVertex = Real(-$b/(2*$a)); + $yVertex = Real($func->eval(t=>$xVertex)); + $vertex=Point($xVertex,$yVertex); + $yIntercept=Point(0,$c); + + @temp = $vertex->value; + $extraPointX = $temp[0]+1; + $extraPointY = Real($func->eval(t=>$extraPointX)); + $extraPoint = Point($extraPointX,$extraPointY); + +$xInt1 = Real((-$b+sqrt($b**2-4*$a*$c))/(2*$a)); +$xInt2 = Real((-$b-sqrt($b**2-4*$a*$c))/(2*$a)); +$xInt1Show = sprintf("%.2f",$xInt1); +$xInt2Show = sprintf("%.2f",$xInt2); + +$tMax = $xVertex; +$hMax = $yVertex; +$tBack = $xInt2; +$t1 = random(1,int($tBack-1),1); +$h1 = $func->eval(t=>$t1); +do {$t2 = random(1,int($tMax-1),1);} until ($t2!=$t1); +$t3 = 2*$tMax-$t2; +$h2 = $func->eval(t=>$t2); + +$tMaxU = NumberWithUnits("$tMax s"); +$hMaxU = NumberWithUnits("$hMax m"); +$tBackU = NumberWithUnits("$tBack s"); +$cU = NumberWithUnits("$c m"); +$bU = NumberWithUnits("$b m/s"); +$t1U = NumberWithUnits("$t1 s"); +$h1U = NumberWithUnits("$h1 m"); +$t2U = NumberWithUnits("$t2 s"); +$t3U = NumberWithUnits("$t3 s"); +$h2U = NumberWithUnits("$h2 m"); + +############################################## + +BEGIN_PGML + +Use TI-89 or Casio ClassPad 330 to answer the following questions. Round to two decimal places when needed. + +From a clifftop over the ocean [`[$cU]`] above sea level, an object was shot straight up into the air with an initial vertical speed of [`[$bU]`]. On its way down it missed the cliff and fell into the ocean. Its height (above sea level) as time passes can be modeled by the quadratic function [`f`], where [`f(t)=[$func]`]. Here [`t`] represents the number of seconds since the object's release, and [`f(t)`] represents the object's height (above sea level) in meters. + + 1) After [____________]{$tMaxU}, this object reached its maximum height of [___________]{$hMaxU}. + + 2) This object flew for [____________]{$tBackU} before it landed in the ocean. + + 3) This object was [____________]{$h1U} above sea level [`[$t1U]`] after its release. + + 4) This object was [`[$h2U]`] above sea level twice: once [____________]{$t2U} after its release, and again later [____________]{$t3U} after its release. + +(Use *m* for meters, and *s* for seconds.) + +END_PGML + +############################################## + +$left = -10; +$right = int($xInt2/10)*11; +$up = int($yVertex/1000)*1000+1000; +$down = -10; + +BEGIN_PGML_SOLUTION + +###Part 1: + +We need to find the function's maximum value (the upside-down parabola's vertex). + +####TI-89 Instructions + +1. Press Diamond, and then F1. Clear all functions if needed. + +2. Enter the function [`[$a]x\wedge2+[$b]x+[$c]`] for Y1. Press ENTER. + +3. Since numbers for this problem are very big, we must adjust the window settings. Press Diamond, and then F2. Set Xmin=[`[$left]`], Xmax=[`[$right]`], Ymin=[`[$down]`], Ymax=[`[$up]`]. Don't change the other values. Note that Xmax and Ymax values are simply guesses. They need to be adjusted higher if we cannot see the maximum or the x-intercept on the right side. + +4. Press Diamond, F3 to look at the graph. If you cannot see the maximum value (the vertex) or the x-intercept on the right side, go back to Step 3 to change the Xmax and Ymax values. + +5. On the screen, locate the parabola's vertex. Press F5, choose Option 4 (Maximum). This option will locate a function's maximum value in a certain range. + +6. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the vertex. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +7. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the vertex. Press ENTER. + +8. The calculator will display the maximum value in the range we specified. In this case, it is the parabola's vertex, which is the solution to Part 1. + +####Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [`[$a]x\wedge 2+[$b]x+[$c]`] for y1. Press EXE. + +3. Since numbers for this problem are very big, we must adjust the window settings. Tap the View Window tile (with 4 arrows in 4 directions). Set xmin=[`[$left]`], xmax=[`[$right]`], ymin=[`[$down]`], ymax=[`[$up]`]. Don't change the other values. Note that xmax and ymax values are simply guesses. They need to be adjusted higher if we cannot see the maximum or the x-intercept on the right side. + +4. Tap the graph tile (first from the left). If we cannot see these two functions' intersection, tap View Window tile (with 4 arrows in 4 directions), and make xmax's value bigger. + +5. If you cannot see the maximum value (the vertex) or the x-intercept on the right side, tap View Window tile to make xmax and ymax values bigger. + +6. Once we can see the parabola's vertex, tap Analysis, G-Solve, Max. + +7. The calculator will locate the maximum value. In this case, it is the parabola's vertex, which is the solution to Part 1. + +###Solution to Part 1: + +After [`[$tMaxU]`], this object reached its maximum height of [`[$hMaxU]`]. + +###Part 2: + +We need to find the x-intercept on the right side. (The left side x-intercept is a negative number, which makes no sense in this situation.) + +####TI-89 Instructions + +1. Press Diamond, and then F3 to see the function's graph. + +2. On the screen, locate the parabola's [`x`]-intercept on the right side. Press F5, choose Option 2 (Zero). This option will locate a function's [`x`]-intercept(s). + +3. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the [`x`]-intercept we are looking at. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +4. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the [`x`]-intercept we are looking at. Press ENTER. + +5. The calculator will display the [`x`]-intercept's coordinates. Its x-value is Part 2's solution. + +####Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". + +3. Tap the graph tile (first from the left). + +4. Once we can see the parabola's [`x`]-intercept on the right side, tap Analysis, G-Solve, x-Cal. Since we are looking for the [`x`]-intercepts, we want the [`y`]-value to be [`0`]. Enter [`0`] for [`y`]-value, tap OK. The calculator will locate the [`x`]-intercept. Its x-value is Part 2's solution. + +###Part 2's solution: + +This object flew for [`[$tBackU]`] before it landed in the ocean. + +###Part 3: + +We need to substitute the function's [`x`] value with [`[$t1]`] to get the corresponding [`y`] value. + +####TI-89 Instructions + +1. Press Home. + +2. Enter [`y1([$t1])`]. Press Enter. You will get the value [`[$h1]`]. + +####Casio ClassPad 330 Instructions + +1. Tap "Menu", and then "Main". + +2. Enter [`y1([$t1])`]. Press Enter. You will get the value [`[$h1]`]. Note that you may not use the [`y`] button on the calculator. You have to press Keyboard, go to "abc" tab, and use the [`y`] button on the screen. + +###Solution to Part 3: + +This object was [`[$h1U]`] above sea level [`[$t1U]`] after its release. + +###Part 4: + +We need to create a second function Y2[`=[$h2]`], and then let the calculator find the intersection between these two functions. + +####TI-89 Instructions + +1. Press Diamond, and then F1. The function Y1 should still be there. + +2. Enter the function [`[$h2]`] for Y2. Press ENTER. + +3. Press Diamond, and then F3. We should see two intersections. + +4. On the screen, locate one intersection. Press F5, choose Option 5 (Intersection). + +5. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +6. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +7. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +8. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +9. The calculator will display the intersection, whose [`x`] value is the first solution for Part 4. + +10. Repeat Steps 4 through 9 to find the other intersection's [`x`] value. + +####Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table", y1's value should still be there. + +3. Enter [`[$h2]`] for y2. Press EXE. + +4. Tap the graph tile (first from the left). We should see two intersections. + +5. Once we can see the intersections, tap Analysis, G-Solve, Intersect. + +6. The calculator will display the intersection, whose [`x`] value is the first solution for Part 2. + +7. Press the right arrow key to locate the other intersection's [`x`] value. + +###Solution to Part 4: + +This object was [`[$h2U]`] above sea level twice: once [`[$t2U]`] after its release, and again later [`[$t3U]`] after its release. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg new file mode 100644 index 0000000000..e410471022 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg @@ -0,0 +1,192 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use a graphing calculator to solve rational equation graphically. +# +# Last edited: Yao 8/19/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->flags->set( + tolerance => 0.5, + tolType => "absolute", +); + +$constant = random(100000,300000,50000); +$rate = random(10,30,5); + +$func = Compute("($rate*x+$constant)/x")->reduce; + +$x1 = random(500,5000,500); +$ans1 = $func->eval(x=>$x1); + +do {$ans2 = random(500,5000,500);} until (abs($x1-$ans2)>1000); +$y2 = $func->eval(x=>$ans2); +$y2Show = sprintf("%.2f",$y2); + +$ans3 = $rate; + +Context("Currency"); +$ans1U = Currency($ans1); +$ans3U = Currency($ans3); +$rateU = Currency($rate); +$constantU = Currency($constant); +$y2U = Currency($y2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A company manufactures and sells handbags. It costs [`[$rateU]`] to produce one handbag. The company's monthly operation cost is approximately [`[$constantU]`]. The average cost, in dollars, of one handbag can be modeled by this function: + + [`` \overline{C}(x) = [$func] ``] + +where [`x`] is the number of handbags manufactured. + +Use a TI-89 or Casio ClassPad 330 graphing calculator to solve the following problems. Round your answers to whole numbers if needed. + +1) If the company manufactured [`[$x1]`] handbags in a certain month, what was the average cost of one handbag in that month? [___________]{$ans1U} + +2) If the average cost of one handbag was [`[$y2U]`] in a certain month, how many handbags did the company manufacture in that month? [___________]{$ans2} + +3) What value is the average cost approaching as the company manufactures more and more handbags each month? [____________]{$ans3U} + +END_PGML + +############################################## + +$upper = ($y2>100) ? 200 : 100; + +BEGIN_PGML_SOLUTION + +###Part 1: + +We need to substitute the function's [`x`] value with [`[$x1]`] to get the corresponding [`y`] value. + +####TI-89 Instructions + +1. Press Diamond, and then F1. Clear all functions if needed. + +2. Enter the function [`([$rate]x+[$constant])/x`] for Y1. Press ENTER. + +3. Press Home. + +4. Enter [`y1([$x1])`]. Press Enter. You will get the value [`[$ans1]`]. + +####Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [` ([$rate]x+[$constant])/x `] for y1. Press EXE. + +3. Tap "Menu", and then "Main". + +4. Enter [`y1([$x1])`]. Press Enter. You will get the value [`[$ans1]`]. Note that you may not use the [`y`] button on the calculator. You have to press Keyboard, go to "abc" tab, and use the [`y`] button on the screen. + +###Solution to Part 1: + +If the company manufactured [`[$x1]`] handbags in a certain month, the average cost of one handbag in that month would be [`[$ans1U]`]. + +###Part 2: + +We need to create a second function Y2[`=[$y2Show]`], and then let the calculator find the intersection between these two functions. + +####TI-89 Instructions + +1. Press Diamond, and then F1. The function Y1 should still be there. + +2. Enter the function [`[$y2Show]`] for Y2. Press ENTER. + +3. Since numbers for this problem are very big, we must adjust the window settings. Press Diamond, and then F2. Set Xmin=0, Xmax=3000, (This is a guess, and needs to be adjusted higher if we cannot see the intersection.) Ymin=0, Ymax=[`[$upper]`]. (This value needs to be bigger than [`[$y2Show]`].) Don't change the other values. + +4. Press Diamond, and then F3. If we cannot see these two functions' intersections, press Diamond, F2, change Xmax's value to something bigger, until you can see the intersection between Y1 and Y2. + +5. On the screen, locate one intersection. Press F5, choose Option 5 (Intersection). + +6. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +7. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +8. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +9. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +10. The calculator will display the intersection, whose [`x`] value is the solution for Part 2. + +####Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table", y1's value should still be there. + +3. Enter [`[$y2Show]`] for y2. Press EXE. + +4. Since numbers for this problem are very big, we must adjust the window settings. Tap the View Window tile (with 4 arrows in 4 directions). Set xmin=0, xmax=3000, (This is a guess, and needs to be adjusted higher if we cannot see the intersection.) ymin=0, ymax=[`[$upper]`]. (This value needs to be bigger than [`[$y2Show]`].) Don't change the other values. Tap OK. + +5. Tap the graph tile (first from the left). If we cannot see these two functions' intersection, tap View Window tile (with 4 arrows in 4 directions), and make xmax's value bigger. + +6. Once we can see the intersection, tap Analysis, G-Solve, Intersect. + +7. The calculator will display the intersection, whose [`x`] value is the solution for Part 2. + +###Solution of Part 2: + +If the average cost of one handbag was [`[$y2U]`] in a certain month, the company manufactured [`[$ans2]`] in that month. + +###Part 3: + +To find what value the function is approaching as [`x`] becomes bigger and bigger, we can substitute the [`x`] value with a very big number. + +####TI-89 Instructions + +1. Press Home. + +2. Enter [`y1(1000000)`]. Press Enter. You will get the function's value when [`x`] is very big. + +####Casio ClassPad 330 Instructions + +1. Tap "Menu", and then "Main". + +2. Enter [`y1(1000000)`]. Press Enter. You will get the function's value when [`x`] is very big. Note that you have to press Keyboard, go to "abc" tab, and use the [`y`] button on the screen. + +###Solution to Part 3: + +As the company manufactures more and more handbags each month, the average cost of one handbag is approaching [`[$ans3U]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality10.pg new file mode 100644 index 0000000000..83147d05eb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality10.pg @@ -0,0 +1,198 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use TI-89 or Casio ClassPad 330 to solve an inequality. +# +# Last edited: Yao 11/17/2015 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','inequality') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + + +do { + $a = non_zero_random(-3,3,1); + $d = random(1,8,1); + $b = random(-8,$d-9,1); + $c = random(4,7,1); + $m = ($d-$b)/$c; + $ma = $m*$a; + $func1 = Compute("abs($m*x-$ma)+$b")->reduce; + $x1 = $a-$c; + $x2 = $a+$c; + $xVertex = $a; + $yVertex = $b; +} until ( (int($m)==$m) && ($x1>=-9) && ($x2<=9) ); + +$func2 = Compute("$d"); + +$border = 6; +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-$border,$border],[-$border,$border],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + add_functions($gr[$i], "$func1 for x in [$min[0],$max[0]] using color:blue and weight:2"); + $gr[$i]->lb( new Label($xVertex,$yVertex-0.8,'y1','blue','center','bottom')); + + add_functions($gr[$i], "$func2 for x in [$min[0],$max[0]] using color:red and weight:2"); + $gr[$i]->lb( new Label($xVertex,$d-0.8,'y2','red','center','bottom')); + +} + +$s1 = ($max[1]-$b)/$m; + + $fLeftX = max($a-$s1,$min[0]); + $fLeftY = $func1->eval(x=>$fLeftX); + $fRightX = min($a+$s1,$max[0]); + $fRightY = $func1->eval(x=>$fRightX); + +$fLeftX = int($fLeftX*10+5)/10; +$fLeftY = int($fLeftY*10+5)/10; +$fRightX = int($fRightX*10+5)/10; +$fRightY = int($fRightY*10+5)/10; + +$ALT0 = "There is a graph of f(x) and a graph of g(x). The graph of f(x) has two line segments. It starts at the point ($fLeftX,$fLeftY), continues straight till ($xVertex,$yVertex), and then changes its direction, and ends at ($fRightX,$fRightY). The graph of g(x) is a horizontal line, y=$d. The graphs of those two functions intersect at two points."; + +$gr[0]->stamps( closed_circle($x1,$d,'black') ); +$gr[0]->stamps( closed_circle($x2,$d,'black') ); + +Context("Interval"); +$ans = Compute("(-infinity,$x1)U($x2,infinity)"); + + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +Use a graphing calculator to solve this inequality: + + [`` [$func1] \gt [$func2] ``] + +* Write your solution in interval notation. +* Use *inf* to represent the symbol [` \infty `]. +* Use upper-case letter U to represent the union symbol [` \cup `]. + + [_________________]{$ans} + +END_PGML +############################################## + +$xShow = -10; +$yShow = $func1->eval(x=>-10); + +############################################## + +BEGIN_PGML_SOLUTION + +Input those two functions as y1 and y2 in your graphing calculator, and use the standard zoom screen. +* To input the absolute value function, you can simply type letters one by one: abs(). +* Or, on TI-89, you can do: 2nd -> MATH (on key 5) -> 1:Number -> 2:abs( +* On Casio ClassPad 330, you can press the Keyboard button, and then find the absolute value symbol under the 2D tab. + +If you cannot see where those two functions intersect, adjust the Zoom setting: +* For TI-89, use Diamond->F3 to go to the graph, and then press F2->6: ZoomStd. +* For Casio ClassPad 300, tap the Graph icon, tap the Zoom icon, and then tap Quick Standard. + +You should see a screen similar to the following, with [`y1=[$func1]`] and [`y2=[$func2]`]: + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< + +[@EnlargeImageStatementPGML()@]** + +We need to find those two intersections. + +##TI-89 Instructions + +1. Press Diamond, and then F1. Clear Y1 and Y2 if needed. + +2. Enter the function [` [$func1] `] for Y1 and [`[$func2]`] for Y2. Press ENTER. (See instructions above about how to input the absolute value function.) + +3. Press Diamond, and then F3. If we cannot see these two functions' intersections, press F2, and then option 6 (default window). + +4. On the screen, locate one intersection. Press F5, choose Option 5 (Intersection). + +5. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +6. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +7. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +8. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +9. The calculator will display the intersection. Repeat Step 4 through Step 8 to find the second intersection. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [` [$func1] `] for y1, and [`[$func2]`] for y2. Press EXE. (See instructions above about how to input the absolute value function.) + +3. Tap the graph tile (first from the left). If we cannot see these two functions' intersections, tap Zoom, Quick Standard (default window). + +4. Once we can see the intersections, tap Analysis, G-Solve, Intersect. + +5. The calculator will display one intersection. + +6. Use the left/right arrow buttons to see the other intersection. + +Those two intersections are [`([$x1],[$d])`] and [`([$x2],[$d])`]. + +To meet the condition of [`[$func1] \gt [$func2]`], or [` y1>y2 `], we must choose [`x`] values in the intervals [`[$ans]`]. + +As an example, when [`x=-10`], y1's value is [`y1(-10)=[$yShow]`], and y2's value is [`y2(-10)=[$d]`]. This satisfies the condition [`y1>y2`], so [`x=-10`] should be included in the solution set. + +As another example, when [`x=[$xVertex]`], y1's value is [`y1([$xVertex])=[$yVertex]`], and y2's value is [`y2(-10)=[$d]`]. This does *not* satisfy the condition [`y1>y2`], so [`x=[$xVertex]`] should *not* be included in the solution set. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality20.pg index 61ffaf25d8..6f1888b8b1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveInequality20.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Absolute value inequalities) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','graphing','inequality') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -22,12 +26,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -35,7 +39,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + do { $a = non_zero_random(-3,3,1); @@ -117,7 +121,7 @@ Use a graphing calculator to solve this inequality: * Use *inf* to represent the symbol [` \infty `]. * Use upper-case letter U to represent the union symbol [` \cup `]. - Solution: [_________________]{$ans} + [_________________]{$ans} END_PGML ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRadicalEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRadicalEquation10.pg new file mode 100644 index 0000000000..4acee6477a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRadicalEquation10.pg @@ -0,0 +1,143 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use a graphing calculator to solve radical equation graphically. +# There is one intersection point. +# +# Last edited: Yao 2/8/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + "no solution"=>{alias=>'no real solutions'}, + "no solutions"=>{alias=>'no real solutions'}, + ); + +do { + $a = non_zero_random(-10,10,1); + $b = random(1,10,1); + $c = random(1,8,1); + $xSolution = ($a-$c**2)/$b; +} until ( (int($xSolution)==$xSolution) && ($xSolution>=-8) && ($xSolution<=8) ); + +$ySolution = $c; + +$func0 = Compute("sqrt($a-$b*$var)")->reduce; +$func1 = Compute("$c")->reduce; + +$solution = Formula("$var=$xSolution"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to solve this equation: + + [`` [$func0] = [$func1] ``] + +Using TI-89's "Intersection" function (under F5's menu on a graph screen) or Casio's "Intersect" function (under Analysis, G-Solve on a graph screen) to find these two functions' intersection. + +* Write your answers in the format of *[$var]=*. + + This equation's solution is [__________]{$solution}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +##TI-89 Instructions + +1. Press Diamond, and then F1. Clear Y1 and Y2 if needed. + +2. Enter the function [` [$func0] `] for Y1 and [`[$func1]`] for Y2. Press ENTER. + +3. Press Diamond, and then F3. If we cannot see these two functions' intersection, press F2, and then option 6 (default window). + +4. On the screen, locate the intersection. Press F5, choose Option 5 (Intersection). + +5. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +6. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +7. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +8. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +9. The calculator will display the intersection, whose [`x`] value is a solution for the equation. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [` [$func0] `] for y1, and [`[$func1]`] for y2. Press EXE. + +3. Tap the graph tile (first from the left). If we cannot see these two functions' intersection, tap Zoom, Original (default window). + +4. Once we can see the intersection, tap Analysis, G-Solve, Intersect. + +5. The calculator will display the intersection, whose [`x`] value is a solution for the equation. + +##Solution: + + The equation's solution is [`[$solution]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRadicalEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRadicalEquation20.pg new file mode 100644 index 0000000000..9e1bff52d8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRadicalEquation20.pg @@ -0,0 +1,162 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use a graphing calculator to solve radical equation graphically. +# There are two intersections. +# +# Last edited: Yao 2/8/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('and',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' and ',TeX=>'\hbox{ and }'}, + 'or'=>{string=>' and ',TeX=>'\hbox{ and }'} + ); + Context()->lists->set(List => {separator => " and "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + "no solution"=>{alias=>'no real solutions'}, + "no solutions"=>{alias=>'no real solutions'}, + ); + +do { + do { + do { + $a = non_zero_random(-5,5,0.1); + $b = non_zero_random(-20,20,0.1); + $c = non_zero_random(-20,20,1); + $e = non_zero_random(-20,20,1); + $A = ($a)**2; + $B = 2*$a*$b-$e; + $C = ($b)**2-$c; + $d = ($B)**2-4*$A*$C; + } until ( ($d>0) ); + $x0 = (-$B+sqrt($d))/(2*$A); + $x1 = (-$B-sqrt($d))/(2*$A); + } until ($c+$e*$x1>0); + $func0 = Compute("$a*$var+$b")->reduce; + $func1 = Compute("sqrt($c+$e*$var)")->reduce; + $y0 = $func0->eval($var=>$x0); + $y1 = $func1->eval($var=>$x1); +} until ( ($x0>-10) && ($x1>-10) && ($x0<10) && ($x1<10) && ($y0<10) && ($y0>-10) && ($y1<10) && ($y1>-10) && ( ($func0->eval($var=>$x0))==($func1->eval($var=>$x0)) ) && ( ($func0->eval($var=>$x1))==($func1->eval($var=>$x1)) ) ); + +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); +$ans = Formula("$var=$x0,$var=$x1"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to solve this equation: + + [`` [$func0] = [$func1] ``] + +Using TI-89's "Intersection" function (under F5's menu on a graph screen) or Casio's "Intersect" function (under Analysis, G-Solve on a graph screen) to find these two functions' intersection(s). + +* Write your answers in the format of *[$var]=*. +* If there are two solutions, use a comma to separate them. +* If needed, round your answer to at least two decimal places. + + The equation's solutions are [__________]{$ans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +##TI-89 Instructions + +1. Press Diamond, and then F1. Clear Y1 and Y2 if needed. + +2. Enter the function [` [$func0] `] for Y1 and [`[$func1]`] for Y2. Press ENTER. + +3. Press Diamond, and then F3. If we cannot see these two functions' intersection, press F2, and then option 6 (default window). + +4. On the screen, locate the intersections. If needed, we can zoom in to see more clearly: Press F2, choose Option 2, move the cursor close to the intersections, and then press Enter. You should see two intersections, implying there are two solutions. + +5. Press F5, choose Option 5 (Intersection). + +6. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +7. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +8. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +9. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +10. The calculator will display the intersection, whose [`x`] value is a solution for the equation. Repeat Step 5 through 9 to find the other intersection. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [` [$func0] `] for y1, and [`[$func1]`] for y2. Press EXE. + +3. Tap the graph tile (first from the left). If we cannot see these two functions' intersection, tap Zoom, Original (default window). + +4. We might need to zoom in to see more clearly. Tap Zoom, Box, and then tap the screen to "draw" a rectangle covering the intersections. You should see two intersections, implying there are two solutions. + +5. Once we can see both intersections, tap Analysis, G-Solve, Intersect. + +6. The calculator will display the intersection, whose [`x`] value is a solution for the equation. Press the right arrow key to move to the next intersection. + +##Solution: + + The system equation's solutions are [`[$var]=[$x0]`] and [`[$var]=[$x1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRationalEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRationalEquation10.pg new file mode 100644 index 0000000000..58c08a823b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRationalEquation10.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use a graphing calculator to solve rational equation graphically. +# +# Last edited: Yao 7/18/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +do {$var = RandomVariableName(type=>'variable');} until ($var ne 'x'); +Context()->variables->are($var=>'Real',x=>'Real'); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + "no solution"=>{alias=>'no real solutions'}, + "no solutions"=>{alias=>'no real solutions'}, + ); + +do { + $a = non_zero_random(-5,5,1); + $b = random(3,20,1)*random(-1,1,2); +} until ($a*$b%(1-$b)==0); +$x = $a*$b/(1-$b); +$commonD = Formula("$var+$a")->reduce; + +$left = Formula("$var/($var+$a)")->reduce; +$right = Formula("$b")->reduce; + +$leftX = Formula("x/(x+$a)")->reduce; +$rightX = Formula("$b")->reduce; + +$ans = Formula("$var=$x"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to solve this equation: + + [`` [$left] = [$right] ``] + +Using TI-89's "Intersection" function (under F5's menu on a graph screen) or Casio's "Intersect" function (under Analysis, G-Solve on a graph screen) to find these two functions' intersection. Write your answers as a point. + + This equation's solution is [__________]{$ans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +##TI-89 Instructions + +1. Press Diamond, and then F1. Clear Y1 and Y2 if needed. + +2. Enter the function [` [$leftX] `] for Y1 and [`[$rightX]`] for Y2. Press ENTER. + +3. Press Diamond, and then F3. If we cannot see these two functions' intersection, press F2, and then option 6 (default window). + +4. On the screen, locate the intersection. Press F5, choose Option 5 (Intersection). + +5. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +6. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +7. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +8. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +9. The calculator will display the intersection, whose [`x`] value is a solution for the equation. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [` [$leftX] `] for y1, and [`[$rightX]`] for y2. Press EXE. + +3. Tap the graph tile (first from the left). If we cannot see these two functions' intersection, tap Zoom, Original (default window). + +4. Once we can see the intersection, tap Analysis, G-Solve, Intersect. + +5. The calculator will display the intersection, whose [`x`] value is a solution for the equation. + +##Solution: + + The equation's solution is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRationalEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRationalEquation20.pg new file mode 100644 index 0000000000..a3e8193528 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorSolveRationalEquation20.pg @@ -0,0 +1,161 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use a graphing calculator to solve rational equation graphically. +# +# Last edited: Yao 7/18/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +do {$var = RandomVariableName(type=>'variable');} until ($var ne 'x'); +Context()->variables->are($var=>'Real',x=>'Real'); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('and',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' and ',TeX=>'\hbox{ and }'}, + 'or'=>{string=>' and ',TeX=>'\hbox{ and }'} + ); + Context()->lists->set(List => {separator => " and "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + "no solution"=>{alias=>'no real solutions'}, + "no solutions"=>{alias=>'no real solutions'}, + ); + +do { + do { + $a = non_zero_random(-10,10,1); + $b = random(1,10,1); + $c = non_zero_random(-10,10,1); + $d = non_zero_random(-2,2,0.1); + $a1 = $b*$d; + $b1 = $c*$d; + $c1 = -$a; + $d1 = ($b1)**2-4*$a1*$c1; + } until ($d1>0); + $x1 = (-$b1+sqrt($d1))/(2*$a1); + $x2 = (-$b1-sqrt($d1))/(2*$a1); + $left = Formula("$a/($b*$var+$c)")->reduce; + $right = Formula("$d*$var")->reduce; + $y1 = $left->eval($var=>$x1); +} until ( ($x1>-9) && ($x1<9) && ($x2>-9) && ($x2<9) && ($y1>-9) && ($y1<9) ); + +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + + $leftX = Formula("$a/($b*x+$c)")->reduce; + $rightX = Formula("$d*x")->reduce; + +$ans = List(Formula("$var=$x1"),Formula("$var=$x2")); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a TI-89 or Casio ClassPad 330 graphing calculator to solve this equation: + + [`` [$left] = [$right] ``] + +Using TI-89's "Intersection" function (under F5's menu on a graph screen) or Casio's "Intersect" function (under Analysis, G-Solve on a graph screen) to find these two functions' intersection. Write your answers as a point. + +* Enter multiple answers separated by commas, such as [`x=1,x=-1`] +* Round your answers to two decimal places. + + This equation's solutions are [__________]{$ans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +##TI-89 Instructions + +1. Press Diamond, and then F1. Clear Y1 and Y2 if needed. + +2. Enter the function [` [$leftX] `] for Y1 and [`[$rightX]`] for Y2. Press ENTER. + +3. Press Diamond, and then F3. If we cannot see these two functions' intersections, press F2, and then option 6 (default window). + +4. On the screen, locate one intersection. Press F5, choose Option 5 (Intersection). + +5. The calculator will ask us which curve is the first function. One of these two functions is highlighted by default. We can use the up/down arrows to change the highlighted function. Since there are only two functions in this case, we can simply press Enter. + +6. The calculator will then ask us which curve is the second function. The other functions is highlighted by default. Press Enter. + +7. The calculator will first ask for a "lower bound". Use the left/right arrow keys to move the cursor to anywhere to the *left* of the intersection. Press ENTER. (Pressing 2nd button and then the left/right arrow keys will speed up the cursor movement.) + +8. Now the calculator will ask for an "upper bound". Move the cursor to anywhere to the *right* of the intersection. Press ENTER. + +9. The calculator will display the intersection, whose [`x`] value is a solution for the equation. + +10. Repeat Step 4 through Step 9 to find the other intersection. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". Enter the function [` [$leftX] `] for y1, and [`[$rightX]`] for y2. Press EXE. + +3. Tap the graph tile (first from the left). If we cannot see these two functions' intersection, tap Zoom, Original (default window). + +4. Once we can see the intersection, tap Analysis, G-Solve, Intersect. + +5. The calculator will display the intersection, whose [`x`] value is a solution for the equation. + +6. Use the right arrow key to jump to the second intersection. + +##Solution: + + The equation's solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorTable10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorTable10.pg new file mode 100644 index 0000000000..cae6853960 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/CalculatorTable10.pg @@ -0,0 +1,151 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using TI-89 or Casio ClassPad 330. +# Use the table function. +# +# Last edited: Yao 5/18/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','application') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", + "contextCurrency.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$m = random(0.02,0.09,0.01); +$b = non_zero_random(10,30,5); + +$func = Compute("$m*x+$b")->reduce; + +$step = 50; + +$x0 = random(50,500,$step); +$y0 = $func->eval(x=>$x0); +$x1 = $x0+$step; +$y1 = $func->eval(x=>$x1); +$x2 = $x1+$step; +$y2 = $func->eval(x=>$x2); +$x3 = $x2+$step; +$y3 = $func->eval(x=>$x3); +$x4 = $x3+$step; +$y4 = $func->eval(x=>$x4); + +Context("Currency"); +$mC = Currency("$m"); +$bC = Currency("$b"); + +Context("LimitedNumeric"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A company sells candies over the Internet. The shipping and handling cost is a flat fee of [`[$bC]`]. Each candy costs [`[$mC]`]. We would like to look at a list of prices if we purchase [`[$x0]`], [`[$x1]`], [`[$x2]`], [`[$x3]`], [`[$x4]`] candies. + +Use a graphing calculator to defined a function in y1, and then use its table function to list the prices of purchasing [`[$x0]`], [`[$x1]`], [`[$x2]`], [`[$x3]`], [`[$x4]`] candies. + + [`[$x0]`] candies cost [_________]{$y0} dollars. + + [`[$x1]`] candies cost [_________]{$y1} dollars. + + [`[$x2]`] candies cost [_________]{$y2} dollars. + + [`[$x3]`] candies cost [_________]{$y3} dollars. + + [`[$x4]`] candies cost [_________]{$y4} dollars. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since the cost per candy is [`[$mC]`] and the shipping fee is [`[$bC]`], we can model the cost of buying candies with the function + + [`` f(x)=[$func] ``] + +where [`f(x)`] is the cost in dollars, and [`x`] is the number of candies we will purchase. + +Next, we will use a graphing calculator to make a table for this function. + +##TI-89 Instructions + +1. Press Diamond, and then F1. Now we can enter functions. + +2. If Y1 is already defined, use the arrow keys to highlight Y1 and then press CLEAR. + +3. Enter the function [` [$m] * x+[$b] `]. Press ENTER. (The multiplication symbol is optional.) + +4. Press Diamond, F4 (to set up the table). + +5. Change tblStart to [`[$x0]`], because this is the first [`x`] value we will look at. + +6. Change [`\Delta`]tbl to [`[$step]`], which would meet the problem's requirement. + +7. Press ENTER. + +8. Press Diamond, F5. Now we can use the values to answer questions. + +##Casio ClassPad 330 Instructions + +1. Tap "Menu". + +2. Tap "Graph and Table". + +3. If y1 is already defined, press Clear button. + +4. Enter the function [` [$m] * x+[$b] `]. Press EXE. (The multiplication symbol is optional.) + +5. Tap the Table Input tile (fifth from the left). + +6. Change Start to [`[$x0]`], End to [`[$x4]`], Step to [`[$step]`]. Tap OK. + +7. Tap the Table tile (second from left). Now we can use the values to answer questions. + +##Solutions + + [`[$x0]`] candies cost [`[$y0]`] dollars. + + [`[$x1]`] candies cost [`[$y1]`] dollars. + + [`[$x2]`] candies cost [`[$y2]`] dollars. + + [`[$x3]`] candies cost [`[$y3]`] dollars. + + [`[$x4]`] candies cost [`[$y4]`] dollars. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosExponentialFunction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosExponentialFunction10.pg new file mode 100644 index 0000000000..bf9c616557 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosExponentialFunction10.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use graphing technology to solve exponential equation graphically. +# +# Last edited: Yao 6/12/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$name = RandomName(); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +do { + $initial = random(1000,20000,1000); + $interestP = random(1.1,3,0.1); + $interest = $interestP/100; + $a = 1+$interest; + + $func = Compute("$initial*$a**t")->reduce; + $upper = $func->eval(t=>10); + + $x1 = random(3,10,1); + $y1 = $initial*$a**$x1; + $y1Show = int($y1*1000+0.5)/1000; + + $y2 = random($initial+1000,$upper,1000); +} until (abs($y2-$y1)>2000); +$funcX = Compute("$initial*$a**x")->reduce; + +$x2 = ln($y2/$initial)/ln($a); +$x2Show = int($x2*1000+0.5)/1000; +$x2R = int($x2*10+0.5)/10; + +Context("Currency"); +$y1C = Currency($y1); +$y2C = Currency($y2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] purchased [`[$initialC]`] of bonds, which pay an annual interest of [`[$interestP]%`]. The value of the bonds, in dollars, can be modeled by the exponential function + + [`` v(t)=[$func] ``] + +where [`t`] is the number of years passed since the purchase. + +Use graphing technology to solve the following problems. + +1) The bonds would be worth [___________]{$y1C} after [`[$x1]`] years. Round your answers to two decimal places (to the cent). + +2) The bonds would be worth [`[$y2C]`] after [___________]{$x2R} years. Round your answers to one decimal place (the tenth digit). + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$funcX] `]. Note that you should replace the variable [`t`] with [`x`]. + +###Question 1 + +We need to substitute the function's [`x`] value with [`[$x1]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` f([$x1]) `]. Desmos shows [`[$y1Show]`]. + +The bonds would be worth [`[$y1C]`] after [`[$x1]`] years. + +###Question 2 + +We need to create a second function [`y=[$y2]`], and then let desmos find the intersection between those two functions. + +Step 3: In the second textbox, enter [`y=[$y2]`]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f(x)`] and [`y=[$y2]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection of [`f(x)`] and [`y=[$y2]`]. Desmos shows [`([$x2Show],[$y2])`]. + +The bonds would be worth [`[$y2C]`] after [`[$x2R]`] years. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosExponentialFunction20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosExponentialFunction20.pg new file mode 100644 index 0000000000..a26fdd9379 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosExponentialFunction20.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use graphing technology to solve exponential equation graphically. +# +# Last edited: Yao 6/12/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +do { + $initial = random(180,205,5); + $room = random(50,80,5); + $c = $initial-$room; + $upper = random(60,80,5); + $k = ln(1/$c)/$upper; + $k = int($k*1000+0.5)/1000; + + $func = Compute("$c*e**($k*t)+$room")->reduce; + $yUpper = $func->eval(t=>$upper); + + $x1 = random(10,$upper-10,5); + $y1 = $func->eval(t=>$x1); + $y1Show = int($y1*1000+0.5)/1000; + $y1R = int($y1*1000+0.5)/1000; + + $y2 = random($room+10,$yUpper-10,5); +} until (abs($y2-$y1)>20); +$funcX = Compute("$c*e**($k*x)+$room")->reduce; + +$x2 = ln(($y2-$room)/$c)/$k; +$x2Show = int($x2*1000+0.5)/1000; +$x2R = int($x2*1000+0.5)/1000; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A cup of coffee's temperature was [`[$initial]`] degrees (Fahrenheit) when it was poured into a cup. The coffee's temperature, in Fahrenheit degrees, can be modeled by the following function: + + [`` f(t)=[$func] ``] + +where [`t`] is the number of minutes passed since the coffee was poured into the cup. + +Use graphing technology to solve the following problems. + +1) After [`[$x1]`] minutes, the coffee's temperature would be [___________]{$y1R} degrees. Round your answer to three decimal places. + +2) After [___________]{$x2R} minutes, the coffee's temperature would be [`[$y2]`] degrees. Round your answer to three decimal places. + +3) In the long run, the coffee's temperature would be [___________]{$room} degrees. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$funcX] `]. Note that you should replace the variable [`t`] with [`x`]. + +###Question 1 + +We need to substitute the function's [`x`] value with [`[$x1]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` f([$x1]) `]. Desmos shows [`[$y1Show]`]. + +After [`[$x1]`] minutes, the coffee's temperature would be [`[$y1R]`] degrees. + +###Question 2 + +We need to create a second function [`y=[$y2]`], and then let desmos find the intersection between those two functions. + +Step 3: In the second textbox, enter [`y=[$y2]`]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f(x)`] and [`y=[$y2]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection of [`f(x)`] and [`y=[$y2]`]. Desmos shows [`([$x2Show],[$y2])`]. + +After [`[$x2R]`] minutes, the coffee's temperature would be [`[$y2]`] degrees. + +###Part 3: + +To find what value the function is approaching as [`x`] becomes bigger and bigger, we can substitute the [`x`] value with a very big number. + +Step 3: In the second textbox, enter [` f(1000000) `]. Desmos shows a value very close to [`[$room]`]. Actually, the bigger the [`x`] value, the closer the function's value is to [`[$room]`]. + +In the long run, the coffee's temperature would be [`[$room]`] degrees (the room temperature). + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosFindingDomain10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosFindingDomain10.pg new file mode 100644 index 0000000000..6bc1242d72 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosFindingDomain10.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(1,10,1); +$a2 = $a**2; +$b = non_zero_random(-10,10,1); +$c = random(-1,1,2); +$d = random(-10,10,1); +$func = Compute("$c*sqrt((x-$d)**2-$a2)+$b")->reduce; +$xd0 = -$a+$d; +$xd1 = $a+$d; + +$domain = Compute("(-inf,$xd0]U[$xd1,inf)"); +$range = $c>0 ? Compute("[$b,inf)") : Compute("(-inf,$b]"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xd0,$xd1],[2*$b,-$b]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +$xfunc = sub { my $t = shift(); + return $a/cos($t)+$d; }; +$yfunc = sub { my $t = shift(); + return $a*tan($t)+$b; }; +if ($c>0) { + $fn1 = new Fun( $xfunc, $yfunc, $gr ); + $fn1->domain(0,pi/2-0.1); + $fn2 = new Fun( $xfunc, $yfunc, $gr ); + $fn2->domain(pi,3*pi/2-0.1); +} else { + $fn1 = new Fun( $xfunc, $yfunc, $gr ); + $fn1->domain(pi/2,pi-0.1); + $fn2 = new Fun( $xfunc, $yfunc, $gr ); + $fn2->domain(3*pi/2,2*pi-0.1); +} + +$tb = $c>0 ? "top" : "bottom"; +$gr->stamps( closed_circle($xd0,$b,'blue') ); +$gr->lb( new Label($xd0,$b,"($xd0,$b)", 'blue','center',$tb,large)); +$gr->stamps( closed_circle($xd1,$b,'blue') ); +$gr->lb( new Label($xd1,$b,"($xd1,$b)", 'blue','center',$tb,large)); + +$ud = $c>0 ? "up" : "down"; +$alt = "This is the graph of f(x)=$func. Its graph starts at ($xd0,$b) and goes $ud and outward, and starts at ($xd1,$b) and goes $ud and outward."; + +############################################## + +BEGIN_PGML + +Use technology to find the domain and range of + + [``f(x)=[$func]``] + +use technology to determine the following. Use *inf* to represent infinity. + + [@KeyboardInstructions(q?Use interval notation.?)@]** + + Domain: [__]{$domain}{width => 30} + + Range: [__]{$range}{width => 30} + +END_PGML + +############################################################ +# Solution +############################################################ + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer those questions. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func] `]. + +Step 3: If needed, zoom out to see the function's critical points. + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +The domain is [`[$domain]`]. The range is [`[$range]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosFindingDomain20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosFindingDomain20.pg new file mode 100644 index 0000000000..d156a758a7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosFindingDomain20.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(1,10,1); +$a2 = $a**2; +$b = random(-10,10,1); +$c = random(-1,1,2); +$d = random(-10,10,1); +$func = Compute("$c*sqrt((x-$d)**2-$a2)-$c*x+$b")->reduce; +$xd0 = -$a+$d; +$xd1 = $a+$d; +$yb0 = -$c*$xd0+$b; +$yb1 = -$c*$xd1+$b; +$hor = -$c*$d+$b; + +$domain = Compute("(-inf,$xd0]U[$xd1,inf)"); +$range = $c>0 ? Compute("[$yb1,$hor)U[$yb0,inf)") : Compute("(-inf,$yb0]U($hor,$yb1]"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xd0, $xd0*2,$xd1,2*$xd1],[$yb0,$yb0*2,$yb1,2*$yb1]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +$xfunc = sub { my $t = shift(); + return $a/cos($t)+$d; }; +$yfunc = sub { my $t = shift(); + return $c*$a*tan($t)-$c*$a/cos($t)+$b; }; +add_functions($gr, "$func for x in <$min[0],$max[0]> using color:blue and weight:2"); +($gr->fn)[0]->steps(400); + +$tb = $c>0 ? "top" : "bottom"; +$gr->stamps( closed_circle($xd0,$yb0,'blue') ); +$gr->lb( new Label($xd0,$yb0,"($xd0,$yb0)", 'blue','center',$tb,large)); +$gr->stamps( closed_circle($xd1,$yb1,'blue') ); +$gr->lb( new Label($xd1,$yb1,"($xd1,$yb1)", 'blue','center',$tb,large)); + +$ud = $c>0 ? "up" : "down"; +$alt = "This is the graph of f(x)=$func. Its graph starts at ($xd0,$yb0) and goes $ud and outward, and starts at ($xd1,$yb1) and goes $ud and outward, approaching y=$b as x approaches infinity."; + +############################################## + +BEGIN_PGML + +[`[$test]`] + +Use technology to find the domain and range of + + [``f(x)=[$func]``] + +use technology to determine the following. Use *inf* to represent infinity. + + [@KeyboardInstructions(q?Use interval notation.?)@]** + + Domain: [__]{$domain}{width => 30} + + Range: [__]{$range}{width => 30} + +END_PGML + +############################################################ +# Solution +############################################################ + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer those questions. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func] `]. + +Step 3: If needed, zoom out to see the function's critical points. + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +Notice that when [`x`] approaches [`\infty`], the function's value approaches [`[$hor]`]. Or, [`y=[$hor]`] is a horizontal asymptote. + +The domain is [`[$domain]`]. The range is [`[$range]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection10.pg new file mode 100644 index 0000000000..3e5be22ffe --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection10.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use graphing technology to find the intersection of two functions. +# There is one intersection point. +# +# Last edited: Yao 11/12/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$xSolution = random(10,20,1)*random(-1,1,2); +$ySolution = random(10,20,1)*random(-1,1,2); + +$m0 = non_zero_random(-4,4,1); +$b0 = $ySolution - $m0*$xSolution; +do {$m1 = non_zero_random(-4,4,1);} until ($m1!=$m0); +$b1 = $ySolution - $m1*$xSolution; + +$func0 = Compute("$m0*x+$b0")->reduce; +$func1 = Compute("$m1*x+$b1")->reduce; + +Context("Point"); +$solution = Point("($xSolution,$ySolution)"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this system equation with graphing technology: + + [`` \left\{ + \begin{aligned} + y &= [$func0] \\ + y &= [$func1] \\ + \end{aligned} + \right.``] + +Write your answer as a point. + + The system equation's solution is [__________]{$solution}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use desmos.com to solve this system. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func0] `]. + +Step 3: In the second textbox, enter [` g(x)=[$func1] `]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection, and desmos shows the solution [`[$solution]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection20.pg index 3a120375fe..903132be28 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection20.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Systems of equations and inequalities) -## DBsection(Nonlinear systems) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection30.pg new file mode 100644 index 0000000000..9d7166435c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection30.pg @@ -0,0 +1,150 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use graphing technology to find the intersection of two functions. +# +# Last edited: Yao 02/12/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "parserPopUp.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context()->noreduce('(-x)-y','(-x)+y'); +@m = (random(2,4,8,16)*random(-1,1,2), random(2,4)*random(-1,1,2)); +@b = (non_zero_random(-500,500,1), non_zero_random(-500,500,1)); +$A = $m[0]*$m[1]; +$B = $m[0]*$b[1]+$m[1]*$b[0]; +$f = Formula("($b[0]+$m[0]x)($b[1]+$m[1]x)")->reduce; +$vertexX = -$B/(2*$A); +$vertexY = $f->eval(x=>$vertexX); + +if (random(0,2,1)==0) { + $c = $vertexY; +} else { + $c = non_zero_random(-20000,20000,1000); +} +$g = Formula("$c"); +$C = $b[0]*$b[1]-$c; +$disc = ($B)**2 - 4*$A*$C; +if ($disc > 0) {$ans = 2;} +elsif ($disc == 0) {$ans = 1;} +else {$ans = 0;} +$popup = PopUp(['?','zero times', 'one time', 'two times', 'three times'],$ans+1); + +$x0 = $vertexX-10; +$x1 = $vertexX+10; +if ($disc>=0) { + $x0 = Round((-$B-sqrt($disc))/(2*($A)),3); + $y0 = $c; + $x1 = Round((-$B+sqrt($disc))/(2*($A)),3); + $y1 = $c; +} + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x0,$x1,0],[$vertexY,0,$c]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +add_functions($gr, "$f for x in <$min[0],$max[0]> using color:red and weight:1"); +add_functions($gr, "$c for x in <$min[0],$max[0]> using color:red and weight:1"); + +$alt = "This is the graph of f(x)=$f, and a horizontal line g(x)=$c."; + +if ($disc>0) { + $x0g = min($x0,$x1); + $x1g = max($x0,$x1); + $gr->stamps( closed_circle($x0g,$y0,'blue') ); + $gr->lb( new Label($x0g,$y0,"($x0g,$y0)", 'blue','left','bottom')); + $gr->stamps( closed_circle($x1g,$y1,'blue') ); + $gr->lb( new Label($x1g,$y1,"($x1g,$y1)", 'blue','right','top')); + $alt = $alt." They intersect at ($x0,$y0) and ($x1,$y1). Those two points are marked and labeled."; +} elsif ($disc==0) { + $gr->stamps( closed_circle($x0,$y0,'blue') ); + $gr->lb( new Label($x0,$y0,"($x0,$y0)", 'blue','center','bottom')); + $alt = $alt." They intersect at ($x0,$y0). This point is marked and labeled."; +} else { + $alt = $alt." They do not intersect."; +} + + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use technology to determine how many times the equations [`y=[$f]`] and [`y=[$g]`] intersect. They intersect [_____]{$popup}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +We will use desmos.com to solve this system. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$f] `]. + +Step 3: In the second textbox, enter [` g(x)=[$c] `]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection(s) of [`f(x)`] and [`g(x)`], if any. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +In case you need help, set the [`x`] range to [`[$min[0]],[$max[0]]`] and [`y`] range to [`[$min[1]],[$max[1]]`]. + +You can see those two functions have [`[$ans]`] intersection(s). + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection40.pg new file mode 100644 index 0000000000..9e81c0c2f8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosIntersection40.pg @@ -0,0 +1,153 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use graphing technology to find the intersection of two functions. +# +# Last edited: Yao 03/20/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "parserPopUp.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context()->noreduce('(-x)-y','(-x)+y'); + +@a = (random(1,9,1), 0); +@b = (0, random(1,9,1)); +@c = (non_zero_random(-9,9,1), non_zero_random(-9,9,1)); +@s = (non_zero_random(-0.9,0.9,0.1), non_zero_random(-0.9,0.9,0.01)); + +$f = Formula("$s[0]($a[0] x^2 + $b[0] x + $c[0])")->reduce; +$g = Formula("$s[1]($a[1] x^2 + $b[1] x + $c[1])")->reduce; + +$A = $s[0]*$a[0]-$s[1]*$a[1]; +$B = $s[0]*$b[0]-$s[1]*$b[1]; +$C = $s[0]*$c[0]-$s[1]*$c[1]; +$disc = ($B)**2 - 4*$A*$C; + +$vertexX = -$b[0]/(2*$a[0]); +$vertexY = $f->eval(x=>$vertexX); + +if ($disc > 0) {$ans = 2;} +elsif ($disc == 0) {$ans = 1;} +else {$ans = 0;} +$popup = PopUp(['?','zero times', 'one time', 'two times', 'three times'],$ans+1); + +$x0 = $vertexX+0.1; +$x1 = $vertexX-0.1; +$y0 = 0; +$y1 = 0; +if ($disc>=0) { + $x0 = Round((-$B-sqrt($disc))/(2*($A)),3); + $y0 = Round($f->eval(x=>$x0),3); + $x1 = Round((-$B+sqrt($disc))/(2*($A)),3); + $y1 = Round($f->eval(x=>$x1),3); +} + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x0,$x1,0,-$c[1]/$b[1]],[$vertexY,$y0,$y1,0,$s[1]*$c[1]]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +add_functions($gr, "$f for x in <$min[0],$max[0]> using color:red and weight:1"); +add_functions($gr, "$g for x in <$min[0],$max[0]> using color:red and weight:1"); + +$alt = "This is the graph of f(x)=$f and g(x)=$g."; + +if ($disc>0) { + $lor0 = $x0<$x1 ? 'left' : 'right'; + $lor1 = $x1<$x0 ? 'left' : 'right'; + $gr->stamps( closed_circle($x0,$y0,'blue') ); + $gr->lb( new Label($x0,$y0,"($x0,$y0)", 'blue',$lor0,'bottom')); + $gr->stamps( closed_circle($x1,$y1,'blue') ); + $gr->lb( new Label($x1,$y1,"($x1,$y1)", 'blue',$lor1,'top')); + $alt = $alt." They intersect at ($x0,$y0) and ($x1,$y1). Those two points are marked and labeled."; +} elsif ($disc==0) { + $gr->stamps( closed_circle($x0,$y0,'blue') ); + $gr->lb( new Label($x0,$y0,"($x0,$y0)", 'blue','center','bottom')); + $alt = $alt." They intersect at ($x0,$y0). This point is marked and labeled."; +} else { + $alt = $alt." They do not intersect."; +} + + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use technology to determine how many times the equations [`y=[$f]`] and [`y=[$g]`] intersect. They intersect [_____]{$popup}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +We will use desmos.com to solve this system. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$f] `]. + +Step 3: In the second textbox, enter [` g(x)=[$g] `]. + +Step 4: Zoom out on the window, if needed, until you can see the intersections of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +In case you need help, set the [`x`] range to [`[$min[0]],[$max[0]]`] and [`y`] range to [`[$min[1]],[$max[1]]`]. + +You can see those two functions have [`[$ans]`] intersections. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLinearFunction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLinearFunction10.pg index d401817756..701839a2df 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLinearFunction10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLinearFunction10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear functions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','application') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -64,7 +68,7 @@ BEGIN_PGML A line's function is given as [`f(x)=[$func]`]. -Answer the following questions. Do not round your answers. +Use graphing technology to answer the following questions. Do not round your answers. 1. The line's [`y`]-intercept is [_____________]{$yIntercept}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLinearFunction20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLinearFunction20.pg new file mode 100644 index 0000000000..0556ca735f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLinearFunction20.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using desmos.com +# Use f(#) to find y values. +# +# Last edited: Yao 11/10/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','application') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextCurrency.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$m = random(0.02,0.09,0.01); +$b = non_zero_random(10,30,5); + +$func = Compute("$m*x+$b")->reduce; + +$candies1 = random(500,900,50); +$cost1 = $func->eval(x=>$candies1); + +do {$candies2 = random(500,900,50);} until (abs($candies2-$candies1)>100); +$cost2 = $func->eval(x=>$candies2); + +Context("Currency"); +$mC = Currency("$m"); +$bC = Currency("$b"); +$cost1C = Currency("$cost1"); +$cost2C = Currency("$cost2"); + +Context("LimitedNumeric"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A company sells candies over the Internet. The shipping and handling cost is a flat fee of [`[$bC]`]. Each candy costs [`[$mC]`]. + +Use graphing technology to define a function to model the cost of candies, and locate the points to answer the following questions: + +1. It costs [___________]{$cost1C} to purchase [`[$candies1]`] candies. + +2. With [`[$cost2C]`], a person can purchase [___________]{$candies2} candies. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since the cost per candy is [`[$mC]`] and the shipping fee is [`[$bC]`], we can model the cost of buying candies with the function + + [`` f(x)=[$func] ``] + +where [`f(x)`] is the cost in dollars, and [`x`] is the number of candies we will purchase. + +Next, we will use desmos.com to answer those questions. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func] `]. + +###Question 1 + +Step 3: In the second textbox, enter [`f([$candies1])`]. + +Desmos shows [`f([$candies1])=[$cost1]`]. This implies it costs [`[$cost1C]`] to purchase [`[$candies1]`] candies. + +###Question 2 + +Step 3: In the second textbox, enter [`y=[$cost2]`]. + +Step 4: Zoom out on the window until you can see the intersection between [`f(x)`] and [`y=[$cost2]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection point, and desmos shows [`([$candies2],[$cost2])`]. This implies a person can purchase [`[$candies2]`] candies with [`[$cost2C]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLinearFunction30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLinearFunction30.pg index 4cab1375b9..543e8f3aab 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLinearFunction30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLinearFunction30.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','application') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -58,7 +62,7 @@ BEGIN_PGML A new mine has [`[$b]`] tons of coals in reserve. Every year, it plans to sell [`[$mN]`] tons. -Define a function to model the amount of coals, and locate the points to answer the following questions: +Use graphing technology to define a function to model the amount of coals, and locate the points to answer the following questions: 1. After [`[$x1]`] years, there will be [__________]{$y1} tons of coals left. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLogarithmFunction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLogarithmFunction10.pg new file mode 100644 index 0000000000..40b20d114d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosLogarithmFunction10.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use graphing technology to solve logarithm equation graphically. +# +# Last edited: Yao 6/12/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$name = RandomName(); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +do { + $initial = random(1,10,0.1); + $b = random(5,10,0.1); + + $func = Compute("$initial+$b*ln(t+1)")->reduce; + $upper = $func->eval(t=>36); + + $x1 = random(5,36,1); + $y1 = $func->eval(t=>$x1); + $y1Show = int($y1*1000+0.5)/1000; + $y1R = int($y1*100+0.5)/100; + + $y2 = random($initial+5,$upper-1,0.1); +} until (abs($y2-$y1)>5); +$funcX = Compute("$initial+$b*ln(x+1)")->reduce; + +$x2 = Real(e)**(($y2-$initial)/$b)-1; +$x2Show = int($x2*1000+0.5)/1000; +$x2R = int($x2*10+0.5)/10; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +The height of a plant, in inches, can be modeled by the logarithm function + + [`` h(t)=[$func] ``] + +where [`t`] is the number of months passed since the planting. + +Use graphing technology to solve the following problems. + +1) The plant's height would be [___________]{$y1R} inches after [`[$x1]`] months. Round your answers to two decimal places. + +2) The plant's height would be [`[$y2]`] inches after [___________]{$x2R} months. Round your answers to one decimal place. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$funcX] `]. Note that you should replace the variable [`t`] with [`x`]. + +###Question 1 + +We need to substitute the function's [`x`] value with [`[$x1]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` f([$x1]) `]. Desmos shows [`[$y1Show]`]. + +The plant's height would be [`[$y1R]`] inches after [`[$x1]`] months. + +###Question 2 + +We need to create a second function [`y=[$y2]`], and then let desmos find the intersection between those two functions. + +Step 3: In the second textbox, enter [`y=[$y2]`]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f(x)`] and [`y=[$y2]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection of [`f(x)`] and [`y=[$y2]`]. Desmos shows [`([$x2Show],[$y2])`]. + +The plant's height would be [`[$y2]`] inches after [`[$x2R]`] months. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction10.pg new file mode 100644 index 0000000000..42496d23ce --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction10.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Using desmos.com to find a quadratic function's y-intercept and +# x-intercept(s). +# +# Last edited: Yao 11/11/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','zero','intercept') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(-1,1,2)*random(2,4,1); +$x0 = non_zero_random(-10,10,1); +$x1 = non_zero_random(20,30,1); +$b = -$a*($x0+$x1); +$c = $a*$x0*$x1; + +$func = Compute("$a*x**2+$b*x+$c")->reduce; +$xVertex = ($x0+$x1)/2; +$yVertex = $func->eval(x=>$xVertex); + +$spaceLR = 15; +$spaceUD = 50; +if ($a>0) { + $bottom = (int(($yVertex-$spaceUD)/100)-1)*100; + $top = int($spaceUD); +} else { + $top = (int(($yVertex+$spaceUD)/100)+1)*100; + $bottom = int(-$spaceUD); +} +$left = int(($x0-$spaceLR)/10)*10; +$right = (int(($x1+$spaceLR)/10))*10; + +Context("Point"); +$yIntercept = Point("(0,$c)"); +$xIntercept1 = Point("($x0,0)"); +$xIntercept2 = Point("($x1,0)"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A quadratic function's formula is [` f(x)=[$func] `]. + +Using graphing technology to answer the following questions. + +1. The parabola's [`y`]-intercept is [_________]{$yIntercept}. + +2. The parabola's [`x`]-intercepts are [__________]{$xIntercept1} and [__________]{$xIntercept2}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer those questions. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func] `]. + +###Question 1 + +Step 3: In the second textbox, enter [`f(0)`]. Desmos shows the function's [`y`]-intercept: [`[$yIntercept]`]. + +###Question 2 + +Step 3: Zoom out on the window until you can see the parabola's two [`x`]-intercepts. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. Only use the following recommended settings if you are stuck: xmin=[`[$left]`], xmax=[`[$right]`], ymin=[`[$bottom]`], ymax=[`[$top]`]. + +Step 4: Click on those two [`x`]-intercepts, and desmos shows [`[$xIntercept1]`] and [`[$xIntercept2]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction100.pg new file mode 100644 index 0000000000..199ca820d7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction100.pg @@ -0,0 +1,261 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use technology to find intersections between a parabola and a line. +# +# Last edit by: Carl Yao 03/20/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "parserPopUp.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + @a = (random(1,9,1), 0); + @b = (random(-5,5,1), random(1,9,1)); + @c = (non_zero_random(-9,9,1), non_zero_random(-9,9,1)); + @s = (non_zero_random(-0.9,0.9,0.1), non_zero_random(-0.5,0.5,0.1)); + + $f = Formula("$s[0]*$a[0] x^2 + $s[0]*$b[0] x + $s[0]*$c[0]")->reduce; + $g = Formula("$s[1]*$a[1] x^2 + $s[1]*$b[1] x + $s[1]*$c[1]")->reduce; + + $A = $s[0]*$a[0]-$s[1]*$a[1]; + $B = $s[0]*$b[0]-$s[1]*$b[1]; + $C = $s[0]*$c[0]-$s[1]*$c[1]; + $disc = ($B)**2 - 4*$A*$C; +} until $disc > 0; + +$x00 = Round((-$B-sqrt($disc))/(2*($A)),3); +$x10 = Round((-$B+sqrt($disc))/(2*($A)),3); +$x0 = min($x00,$x10); +$x1 = max($x00,$x10); +$y0 = Round($f->eval(x=>$x0),3); +$y1 = Round($f->eval(x=>$x1),3); + +$vertexX = -$b[0]/(2*$a[0]); +$vertexY = $f->eval(x=>$vertexX); + +@gr=(); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x0,$x1,0,$vertexX],[$vertexY,$y0,$y1,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..2) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + + add_functions($gr[$i], "$f for x in <$min[0],$max[0]> using color:blue and weight:2"); + add_functions($gr[$i], "$g for x in <$min[0],$max[0]> using color:blue and weight:2"); + $lor0 = $x0<$x1 ? 'left' : 'right'; + $lor1 = $x1<$x0 ? 'left' : 'right'; + $gr[$i]->stamps( closed_circle($x0,$y0,'blue') ); + $gr[$i]->lb( new Label($x0,$y0,"($x0,$y0)", 'blue',$lor0,'bottom')); + $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); + $gr[$i]->lb( new Label($x1,$y1,"($x1,$y1)", 'blue',$lor1,'top')); + $tob = $s[0]>0 ? 'top' : 'bottom'; + $gr[$i]->lb( new Label($vertexX, $vertexY, "f(x)", 'blue', 'center', $tob)); + $tx = $max[0]-$marksep[0]/2; + $ty = $g->eval(x=>$tx); + $gr[$i]->lb( new Label($tx, $ty, "g(x)", 'blue', 'center', 'top')); + $alt[0] = "This is the graphs of f(x)=$f and g(x)=$g. They intersect at ($x0,$y0) and ($x1,$y1). Those two points are marked and labeled."; +} + +@symbols = ('\lt','\le','\gt','\ge'); +$i0 = random(0,1,1); +$i1 = random(2,3,1); +$symbol0 = $symbols[$i0]; +$symbol1 = $symbols[$i1]; + +$hof0 = $i0==0 ? "hollow" : "solid"; +$hof1 = $i1==2 ? "hollow" : "solid"; + +if ($s[0]>0) { + add_functions($gr[1], "$f for x in <$x0,$x1> using color:red and weight:2"); + add_functions($gr[2], "$f for x in <$min[0],$x0> using color:red and weight:2"); + add_functions($gr[2], "$f for x in <$x1,$max[0]> using color:red and weight:2"); + $alt[1] = $alt[0]." The segment on f(x) from x=$x0 to x=$x1 is highlighted. The points ($x0,$y0) and ($x1,$y1) are $hof0."; + $alt[2] = $alt[0]." The segment on f(x) from negative infinity to x=$x0, and from x=$x1 to infinity are highlighted. The points ($x0,$y0) and ($x1,$y1) are $hof1."; +} else { + add_functions($gr[2], "$f for x in <$x0,$x1> using color:red and weight:2"); + add_functions($gr[1], "$f for x in <$min[0],$x0> using color:red and weight:2"); + add_functions($gr[1], "$f for x in <$x1,$max[0]> using color:red and weight:2"); + $alt[1] = $alt[0]." The segment on f(x) from negative infinity to x=$x0, and from x=$x1 to infinity are highlighted. The points ($x0,$y0) and ($x1,$y1) are $hof0."; + $alt[2] = $alt[0]." The segment on f(x) from x=$x0 to x=$x1 is highlighted. The points ($x0,$y0) and ($x1,$y1) are $hof1."; +} + +if ($i0 == 0) { + $gr[1]->stamps(open_circle($x0,$y0,'red')); + $gr[1]->stamps(open_circle($x1,$y1,'red')); +} else { + $gr[1]->stamps(closed_circle($x0,$y0,'red')); + $gr[1]->stamps(closed_circle($x1,$y1,'red')); +} +if ($i1==2) { + $gr[2]->stamps(open_circle($x0,$y0,'red')); + $gr[2]->stamps(open_circle($x1,$y1,'red')); +} else { + $gr[2]->stamps(closed_circle($x0,$y0,'red')); + $gr[2]->stamps(closed_circle($x1,$y1,'red')); +} + +Context("FiniteSolutionSets"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +Context()->flags->remove("NumberCheck"); +$solutions = Formula("{$x0,$x1}"); + +Context("Point"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); + +$intersections = List("($x0,$y0),($x1,$y1)"); + +Context("Interval"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +if ($s[0]>0) { + $ans3 = ($i0==0) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); + $ans4 = ($i1==2) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); +} else { + $ans3 = ($i0==0) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); + $ans4 = ($i1==2) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); +} + + + +############################################## + +BEGIN_PGML + +Let [`f(x)=[$f]`] and [`g(x)=[$g]`]. Use technology to determine the following. + +1. What are the points of intersection for these two functions? + + [__]{$intersections}{width => 30} + +1. Solve [`f(x)=g(x)\text{.}`] Enter your solutions in set notation. + + [__]{$solutions}{width => 30} + +1. Solve [`f(x) [$symbol0] g(x)\text{.}`] Enter *inf* to represent infinity. Use capitalized 'U' to represent the union symbol, if needed. + + [__]{$ans3}{width => 30} + +1. Solve [`f(x) [$symbol1] g(x)\text{.}`] Enter *inf* to represent infinity. Use capitalized 'U' to represent the union symbol, if needed. + + [__]{$ans4}{width => 30} + +END_PGML + +############################################################ +# Solution +############################################################ + +$ion0 = $i0==0 ? "not including" : "including"; +$ion1 = $i1==2 ? "not including" : "including"; + +BEGIN_PGML_SOLUTION + +We will use desmos.com to solve this system. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$f] `]. + +Step 3: In the second textbox, enter [` g(x)=[$g] `]. + +Step 4: Zoom in/out on the window, if needed, until you can cearly see the intersections of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +In case you need help, set the [`x`] range to [`[$min[0]],[$max[0]]`] and [`y`] range to [`[$min[1]],[$max[1]]`]. + +Step 4: Click on those two intersections, and desmos shows [`[$intersections]`]. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +###Question 1 and 2 + +They intersect at [`[$intersections]`]. + +The solutions of [`f(x)=g(x)`] are simply the [`x`]-values of those two intersections: [`[$solutions]`]. + +###Question 3 + +To meet the condition of [` f(x) [$symbol0] g(x) `], we must choose [`x`] values in the intervals [`[$ans3]`]. In the following graph, ponts on the red segment(s) of [`f(x)`] has [`y`]-values smaller than [`g(x)`] ([$ion0] those two intersection points). + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +###Question 4 + +To meet the condition of [` f(x) [$symbol1] g(x) `], we must choose [`x`] values in the intervals [`[$ans4]`]. In the following graph, ponts on the red segment(s) of [`f(x)`] has [`y`]-values greater than [`g(x)`] ([$ion1] those two intersection points). + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction110.pg new file mode 100644 index 0000000000..2085e98a84 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction110.pg @@ -0,0 +1,320 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use technology to find intersections between a parabola and a line. +# Then solve related equation and inequalities. +# +# Last edit by: Carl Yao 03/20/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + do { + $a = non_zero_random(-1,1,0.1); + $h = non_zero_random(-5,5,1); + $k = non_zero_random(-5,5,1); + $f = Compute("$a*x**2-2*$a*$h*x+($a*($h)**2+$k)")->reduce; + $A = $a; + $B = -2*$a*$h; + $C = $a*$h**2+$k; + $D = ($B)**2-4*$A*$C; + } until ($D>0); + $xInt0 = min((-$B+sqrt($D))/(2*$A),(-$B-sqrt($D))/(2*$A)); + $xInt1 = max((-$B+sqrt($D))/(2*$A),(-$B-sqrt($D))/(2*$A)); + $xInt0Show = Round($xInt0,3); + $xInt1Show = Round($xInt1,3); + $yInt = $C; + do {$y = $a>0 ? $k+random(3,5,1) : $k-random(3,5,1);} until $y!=0; + $g = Compute("$y")->reduce; + $A = $a; + $B = -2*$a*$h; + $C = $a*$h**2+$k-$y; + $D = ($B)**2-4*$A*$C; + $x0 = min((-$B+sqrt($D))/(2*$A),(-$B-sqrt($D))/(2*$A)); + $x1 = max((-$B+sqrt($D))/(2*$A),(-$B-sqrt($D))/(2*$A)); + $x0Show = Round($x0,3); + $x1Show = Round($x1,3); +} until $x1-$x0 > 2; + +$vertexX = -$B/(2*$A); +$vertexY = $f->eval(x=>$vertexX); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x0,$x1,0,$vertexX],[$vertexY,$y,0,$yInt]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); + +for ($i=0;$i<=3;$i++) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + add_functions($gr[$i], "$f for x in <$min[0],$max[0]> using color:blue and weight:2"); +} + +$gr[3]->stamps(closed_circle($vertexX,$vertexY,'red')); +$tob = $a>0 ? 'top' : 'bottom'; +$gr[3]->lb( new Label($vertexX, $vertexY, "($vertexX,$vertexY)", 'red', 'center', $tob, 'small')); +$gr[3]->stamps(closed_circle(0,$yInt,'red')); +$lor = $h > 0 ? 'left' : 'right'; +$gr[3]->lb( new Label(0, $yInt, "(0,$yInt)", 'red', $lor, 'middle', 'small')); +$gr[3]->stamps(closed_circle($xInt0,0,'red')); +$gr[3]->stamps(closed_circle($xInt1,0,'red')); +$gr[3]->lb( new Label($xInt0, 0, "($xInt0Show,0)", 'red', 'right', 'bottom', 'small')); +$gr[3]->lb( new Label($xInt1, 0, "($xInt1Show,0)", 'red', 'left', 'bottom','small')); +$alt[3] = "There is the graph of function f(x)=$f. Its vertex is at ($vertexX,$vertexY). Its x-intercepts are at ($xInt0Show,0) and ($xInt1Show,0), and its y-intercept is at (0,$yInt)."; + +for my $i (0..2) { + add_functions($gr[$i], "$g for x in <$min[0],$max[0]> using color:blue and weight:2"); + $gr[$i]->lb( new Label($vertexX, $vertexY, "f(x)", 'blue', 'center', $tob, 'small')); + $gr[$i]->lb( new Label($vertexX, $y, "y=$y", 'blue', 'center', $tob, 'small')); + $gr[$i]->lb( new Label($x0, $y, "($x0Show,$y)", 'red', 'center', 'top', 'small')); + $gr[$i]->lb( new Label($x1, $y, "($x1Show,$y)", 'red', 'center', 'top', 'small')); +} + +$gr[0]->stamps(closed_circle($x0,$y,'red')); +$gr[0]->stamps(closed_circle($x1,$y,'red')); +$alt[0] = "There is the graph of function f(x)=$f, and a horizontal line at y=$y. Those two functions intersect at ($x0Show,$y) and ($x1Show,$y)."; + +@symbols = ('\gt','\ge','\lt','\le'); +$i0 = random(0,1,1); +$i1 = random(2,3,1); +$symbol0 = $symbols[$i0]; +$symbol1 = $symbols[$i1]; + +$hof0 = $i0==0 ? "hollow" : "solid"; +$hof1 = $i1==2 ? "hollow" : "solid"; + +if ($a>0) { + add_functions($gr[2], "$f for x in <$x0,$x1> using color:red and weight:2"); + add_functions($gr[1], "$f for x in <$min[0],$x0> using color:red and weight:2"); + add_functions($gr[1], "$f for x in <$x1,$max[0]> using color:red and weight:2"); + $alt[1] = $alt[0]." The segment on f(x) from negative infinity to x=$x0Show, and from x=$x1Show to infinity are highlighted. The points ($x0Show,$y) and ($x1Show,$y) are $hof0."; + $alt[2] = $alt[0]." The segment on f(x) from $x0 to $x1 is highlighted. The points ($xShow0,$y) and ($x1Show,$y) are $hof1."; +} else { + add_functions($gr[1], "$f for x in <$x0,$x1> using color:red and weight:2"); + add_functions($gr[2], "$f for x in <$min[0],$x0> using color:red and weight:2"); + add_functions($gr[2], "$f for x in <$x1,$max[0]> using color:red and weight:2"); + $alt[1] = $alt[0]." The segment on f(x) from x=$x0Show to x=$x1Show is highlighted. The points ($x0Show,$y) and ($x1Show,$y) are $hof0."; + $alt[2] = $alt[0]." The segment on f(x) from negative infinity to x=$x0Show, and from x=$x1Show to infinity are highlighted. The points ($x0Show,$y) and ($x1Show,$y) are $hof1."; +} + +if ($i0 == 0) { + $gr[1]->stamps(open_circle($x0,$y,'red')); + $gr[1]->stamps(open_circle($x1,$y,'red')); +} else { + $gr[1]->stamps(closed_circle($x0,$y,'red')); + $gr[1]->stamps(closed_circle($x1,$y,'red')); +} +if ($i1==2) { + $gr[2]->stamps(open_circle($x0,$y,'red')); + $gr[2]->stamps(open_circle($x1,$y,'red')); +} else { + $gr[2]->stamps(closed_circle($x0,$y,'red')); + $gr[2]->stamps(closed_circle($x1,$y,'red')); +} + +$x5 = random(20,50,1)*random(-1,1,2); +$y5 = $f->eval(x=>$x5); +$y5Show = Round($y5,3); + +Context("FiniteSolutionSets"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +Context()->flags->remove("NumberCheck"); +$solutions = Formula("{$x0,$x1}"); + +Context("Point"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); + +$vertex = Point("($vertexX,$vertexY)"); +$xIntercepts = List("($xInt0,0),($xInt1,0)"); +$yIntercept = Point("(0,$yInt)"); +$xInterceptsShow = List("($xInt0Show,0),($xInt1Show,0)"); +$intersections = List("($x0Show,0),($x1Show,0)"); + +Context("Interval"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); + +$domain = Interval("(-inf,inf)"); + +if ($a>0) { + $ans3 = ($i0==0) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); + $ans4 = ($i1==2) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); + $range = Interval("[$vertexY,inf)"); + $ans3Show = ($i0==0) ? Interval("(-inf,$x0Show)U($x1Show,inf)") : Interval("(-inf,$x0Show]U[$x1Show,inf)"); + $ans4Show = ($i1==2) ? Interval("($x0Show,$x1Show)") : Interval("[$x0Show,$x1Show]"); +} else { + $ans3 = ($i0==0) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); + $ans4 = ($i1==2) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); + $range = Interval("(-inf,$vertexY]"); + $ans3Show = ($i0==0) ? Interval("($x0Show,$x1Show)") : Interval("[$x0Show,$x1Show]"); + $ans4Show = ($i1==2) ? Interval("(-inf,$x0Show)U($x1Show,inf)") : Interval("(-inf,$x0Show]U[$x1Show,inf)"); +} + + + +############################################## + +BEGIN_PGML + +Let [`f(x)=[$f]`]. Use technology to determine the following. + +1. The vertex is at [__]{$vertex}{width => 30}. + +1. The [`y`]-intercept is at [__]{$yIntercept}{width => 30}. + +1. The [`x`]-intercepts are at [__]{$xIntercepts}{width => 30}. (Use a comma to separate them.) + +1. The function's domain, in interval notation, is [__]{$domain}{width => 30}. + +1. The function's range, in interval notation, is [__]{$range}{width => 30}. + +1. The value of [`f([$x5])`] is [__]{$y5}{width => 30}. + +1. Solve [`f(x)=[$y]\text{.}`] Enter your solutions in set notation. + + [__]{$solutions}{width => 30} + +1. Solve [`f(x) [$symbol0] [$y]\text{.}`] Enter *inf* to represent infinity. Enter capitalized "U" to represent the union symbol, if needed. + + [__]{$ans3}{width => 30} + +1. Solve [`f(x) [$symbol1] [$y]\text{.}`] Enter *inf* to represent infinity. Enter capitalized "U" to represent the union symbol, if needed. + + [__]{$ans4}{width => 30} + +END_PGML + +############################################################ +# Solution +############################################################ + +$ion0 = $i0==0 ? "not including" : "including"; +$ion1 = $i1==2 ? "not including" : "including"; + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer those questions. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: Enter [` f(x)=[$f] `] in the first text box. + +Step 3: If needed, zoom in/out until you can clearly see both functions and their intersections. Alternatively, click on the Graph Settings icon (looking like a wrench) and define the ranges of [`x`]-axis and [`y`]-axis. In case you need help, set the [`x`] range to [`[$min[0]],[$max[0]]`] and [`y`] range to [`[$min[1]],[$max[1]]`]. + +You should see a graph similar to the following one: + +>>[@ image(insertGraph($gr[3]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[3]' title= '$alt[3]'" +) @]*<< + +###Question 1, 2, 3, 4 and 5 + +The vertex is at [`[$vertex]`]. + +The [`y`]-intercept is at [`[$yIntercept]`]. + +The [`x`]-intercepts are at [`[$xInterceptsShow]`]. + +The function's domain is [`[$domain]`]. + +The function's range is [`[$range]`]. + +###Question 6 + +At desmos.com, in a new text box, enter [`f([$x5])`], and desmos shows [`[$y5Show]`]. + +###Question 7 + +To solve the equation [`f(x)=[$y]`], at desmos.com, enter [`y=[$y]`] in a new text box, and then click on the intersections between the function and the horizontal line. Those two points are [`[$intersections]`]. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +The solutions of [`f(x)=[$y]`] are [`[$solutions]`] in set notation. + +###Question 8 + +To meet the condition of [` f(x) [$symbol0] [$y] `], we must choose [`x`] values in the intervals [`[$ans3Show]`]. In the following graph, ponts on the red segment(s) of [`f(x)`] has [`y`]-values greater than [`[$y]`] ([$ion0] those two intersection points). + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +###Question 9 + +To meet the condition of [` f(x) [$symbol1] [$y] `], we must choose [`x`] values in the intervals [`[$ans4Show]`]. In the following graph, ponts on the red segment(s) of [`f(x)`] has [`y`]-values smaller than or equal to [`[$y]`] ([$ion1] those two intersection points). + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction20.pg new file mode 100644 index 0000000000..8e110f0f4f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction20.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Using desmos.com to find a quadratic function's vertex. +# +# Last edited: Yao 11/11/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','zero','intercept') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(-1,1,2)*random(2,4,1); +$x0 = non_zero_random(-10,10,1); +$x1 = non_zero_random(20,30,1); +$b = -$a*($x0+$x1); +$c = $a*$x0*$x1; + +$func = Compute("$a*x**2+$b*x+$c")->reduce; +$xVertex = ($x0+$x1)/2; +$yVertex = $func->eval(x=>$xVertex); + +$spaceLR = 15; +$spaceUD = 50; +if ($a>0) { + $bottom = (int(($yVertex-$spaceUD)/100)-1)*100; + $top = int($spaceUD); +} else { + $top = (int(($yVertex+$spaceUD)/100)+1)*100; + $bottom = int(-$spaceUD); +} +$left = int(($x0-$spaceLR)/10)*10; +$right = (int(($x1+$spaceLR)/10))*10; + +Context("Point"); +$vertex = Point("($xVertex,$yVertex)"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A quadratic function's formula is [` f(x)=[$func] `]. + +Using graphing technology to answer the following question. + +The parabola's vertex is at [_________]{$vertex}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func] `]. + +Step 3: Zoom out on the window until you can see the parabola's vertex. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. Only use the following recommended settings if you are stuck: xmin=[`[$left]`], xmax=[`[$right]`], ymin=[`[$bottom]`], ymax=[`[$top]`]. + +Step 4: Click on the vertex, and desmos shows [`[$vertex]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction30.pg index 2d157247a0..339bbd34ad 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction30.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','graphing','zero','intercept') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction40.pg index 656824f54d..e0d9daf673 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction40.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -32,7 +36,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Point"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction50.pg index ae67183bfc..1203ef2ad8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction50.pg @@ -9,14 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(w => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -140,7 +144,7 @@ In this formula, [`w`] represents the pen's width in feet, and [`A(w)`] represen >>[@ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400,extra_html_tags=>"alt = '$penAlt' title = '$penAlt' ") @]*<< -Answer the following questions: +With graphing technology, answer the following questions: 1. To maximize the area of the pen, the length of the pen (parallel to the river) should be [____________]{$lengthU}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction60.pg index aceb5117a4..24faf43245 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction60.pg @@ -9,14 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +39,7 @@ loadMacros( ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -108,7 +112,7 @@ The artist's income can be calculated by multiplying the number of paintings sol where [`f(x)`] stands for his yearly income in dollars. -Answer the following questions: +With graphing technology, answer the following questions: 1) To obtain maximum income of [__________]{$maxIncomeC}, the artist should set the price per painting at [___________]{$maxPriceC}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction70.pg new file mode 100644 index 0000000000..10c1f4a24c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction70.pg @@ -0,0 +1,183 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use technology to find critical points on a parabola. +# +# Last edit by: Carl Yao 01/14/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = non_zero_random(-2,2,0.1); +$h = random(10,50,1)*random(-1,1,2); +$k = random(100,500,1)*random(-1,1,2); +$func = Compute("$a*(x-$h)**2+$k")->reduce; +$yInt = $func->eval(x=>0); +if (-$k/$a > 0) { + $xInt1 = Round(sqrt(-$k/$a)+$h,3); + $xInt2 = Round(-sqrt(-$k/$a)+$h,3); +} else { + $xInt1 = 1; + $xInt2 = -1; +} + +Context("Point"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +if (-$k/$a > 0) { + $intercepts = List("($xInt1,0), ($xInt2,0), (0,$yInt)"); +} else { + $intercepts = List("(0,$yInt)"); +} +$vertex = Point("($h,$k)"); +Context("Interval"); +$domain = Interval("(-inf,inf)"); +$range = $a>0 ? Interval("[$k,inf)") : Interval("(-inf,$k]"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xInt1,$xInt2,0,$h],[$yInt,0,$k]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +add_functions($gr, "$func for x in <$min[0],$max[0]> using color:red and weight:1"); + +if (-$k/$a > 0) { + $gr->stamps( closed_circle($xInt1,0,'blue') ); + $gr->lb( new Label($xInt1,0,"($xInt1,0)", 'blue','center','bottom')); + $gr->stamps( closed_circle($xInt2,0,'blue') ); + $gr->lb( new Label($xInt2,0,"($xInt2,0)", 'blue','center','bottom')); +} +$gr->stamps( closed_circle(0,$yInt,'blue') ); +$gr->lb( new Label(0,$yInt,"(0,$yInt)", 'blue','left','middle')); +$gr->stamps( closed_circle($h,$k,'blue') ); +$tob = $a>0 ? 'top' : 'bottom'; +$gr->lb( new Label($h,$k,"($h,$k)", 'blue','center',$tob)); + +if (-$k/$a > 0) { + $alt = "This is the graph of f(x)=$func, with its y-intercept (0,$yInt), x-intercepts ($xInt1,0) and ($xInt2,0), and vertex ($h,$k) marked and labeled."; +} else { + $alt = "This is the graph of f(x)=$func, with its y-intercept (0,$yInt) and vertex ($h,$k) marked and labeled."; +} + +############################################## + +BEGIN_PGML +For the function [`j`] defined by + +[```j(x)=[$func]\text{,}```] + +use technology to determine the following. Use *inf* to represent infinity. + +1. Any intercepts. + + [__]{$intercepts}{width => 30} + +2. The vertex. + + [__]{$vertex}{width => 30} + +3. The domain. + + [@KeyboardInstructions(q?Use interval notation.?)@]** + + [__]{$domain}{width => 30} + +4. The range. + + [@KeyboardInstructions(q?Use interval notation.?)@]** + + [__]{$range}{width => 30} + +END_PGML + +############################################################ +# Solution +############################################################ + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer those questions. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func] `]. + +Step 3: It's hard to see the function's critical points (intercepts and vertex) unless zooming out multiple times. Alternatively, click on the Graph Settings icon (looking like a wrench) on the top right and define the ranges of [`x`]-axis and [`y`]-axis. Only use the following recommended settings if you are stuck: xmin=[`[$min[0]]`], xmax=[`[$max[0]]`], ymin=[`[$min[1]]`], ymax=[`[$max[1]]`]. + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +###Question 1 + +In the second textbox, enter [`f(0)`]. Desmos shows the function's [`y`]-intercept: [`[$yInt]`]. You need to enter it as a point: [`(0,[$yInt])`]. + +Click on those two [`x`]-intercepts, and desmos shows [`([$xInt1],0)`] and [`([$xInt2],0)`]. + +###Question 2 + +Click on the parabola's vertex. Desmos shows [`([$h],[$k])`]. + +###Question 3 and 4 + +The domain is [`(-\infty,\infty)\text{.}`] The range is [`[$range]\text{.}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction80.pg new file mode 100644 index 0000000000..528c64debb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction80.pg @@ -0,0 +1,167 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use technology to find critical points on a parabola. +# +# Last edit by: Carl Yao 01/14/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $a = random(100,300,10); + $b = non_zero_random(-9,9,1); +} until abs($b/$a)>0.01; +$func = Compute("($a*x+$b)**2")->reduce; +$yInt = $func->eval(x=>0); +$xInt = -$b/$a; +$xIntShow = Round($xInt,3); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xInt,-$xInt],[$yInt,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +add_functions($gr, "$func for x in <$min[0],$max[0]> using color:red and weight:1"); + +$gr->stamps( closed_circle($xInt,0,'blue') ); +$LR = $xInt>0 ? 'right' : 'left'; +$RL = $xInt<0 ? 'right' : 'left'; +$gr->lb( new Label($xInt,0,"($xIntShow,0)", 'blue',$LR,'bottom')); +$gr->stamps( closed_circle(0,$yInt,'blue') ); +$gr->lb( new Label(0,$yInt,"(0,$yInt)", 'blue',$RL,'middle')); + +$alt = "This is the graph of f(x)=$func, with its y-intercept (0,$yInt) and x-intercept ($xInt, 0) marked and labeled."; + +Context("Point"); +Context()->flags->set( + tolerance => 0.1, + tolType => "absolute", +); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +$intercepts = List("($xInt,0), (0,$yInt)"); +$vertex = Point("($xInt,0)"); +Context("Interval"); +$domain = Interval("(-inf,inf)"); +$range = Interval("[0,inf)"); + + +############################################## + +BEGIN_PGML +For the function [`j`] defined by + +[```j(x)=[$func]\text{,}```] + +use technology to determine the following. Use *inf* to represent infinity. + +1. Any intercepts. + + [__]{$intercepts}{width => 30} + +2. The vertex. + + [__]{$vertex}{width => 30} + +3. The domain. + + [@KeyboardInstructions(q?Use interval notation.?)@]** + + [__]{$domain}{width => 30} + +4. The range. + + [@KeyboardInstructions(q?Use interval notation.?)@]** + + [__]{$range}{width => 30} + +END_PGML + +############################################################ +# Solution +############################################################ + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer those questions. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func] `]. + +Step 3: It's hard to see the function's critical points (intercepts and vertex) unless zooming out multiple times. Alternatively, click on the Graph Settings icon (looking like a wrench) on the top right and define the ranges of [`x`]-axis and [`y`]-axis. Only use the following recommended settings if you are stuck: xmin=[`[$min[0]]`], xmax=[`[$max[0]]`], ymin=[`[$min[1]]`], ymax=[`[$max[1]]`]. + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +###Question 1 + +Step 4: In the second textbox, enter [`f(0)`]. Desmos shows the function's [`y`]-intercept: [`[$yInt]`]. You need to enter it as a point: [`(0,[$yInt])`]. + +Step 5: Click on the [`x`]-intercept, and desmos shows [`([$xIntShow],0)`]. + +###Question 2 + +Step 4: Click on the parabola's vertex, and desmos shows [`([$xIntShow],0)`]. + +###Question 3 and 4 + +The domain is [`[$domain]`]. The range is [`[$range]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction90.pg new file mode 100644 index 0000000000..86a9e598fa --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosQuadraticFunction90.pg @@ -0,0 +1,246 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use technology to find intersections between a parabola and a line. +# Then solve related equation and inequalities. +# +# Last edit by: Carl Yao 03/20/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $a = non_zero_random(-1,1,0.1); + $h = non_zero_random(-5,5,1); + $k = non_zero_random(-5,5,1); + $f = Compute("$a*x**2-2*$a*$h*x+($a*($h)**2+$k)")->reduce; + do {$y = $a>0 ? $k+random(3,5,1) : $k-random(3,5,1);} until $y!=0; + $g = Compute("$y")->reduce; + $A = $a; + $B = -2*$a*$h; + $C = $a*$h**2+$k-$y; + $D = ($B)**2-4*$A*$C; + $x0 = Round(min((-$B+sqrt($D))/(2*$A),(-$B-sqrt($D))/(2*$A)),3); + $x1 = Round(max((-$B+sqrt($D))/(2*$A),(-$B-sqrt($D))/(2*$A)),3); +} until $x1-$x0 > 2; + +$vertexX = -$B/(2*$A); +$vertexY = $f->eval(x=>$vertexX); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x0,$x1,0,$vertexX],[$vertexY,$y,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); + +for ($i=0;$i<=2;$i++) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + add_functions($gr[$i], "$f for x in <$min[0],$max[0]> using color:blue and weight:2"); + add_functions($gr[$i], "$g for x in <$min[0],$max[0]> using color:blue and weight:2"); + $tob = $a>0 ? 'top' : 'bottom'; + $gr[$i]->lb( new Label($vertexX, $vertexY, "f(x)", 'blue', 'center', $tob)); + $gr[$i]->lb( new Label($vertexX, $y, "g(x)", 'blue', 'center', $tob)); + $gr[$i]->lb( new Label($x0, $y, "($x0,$y)", 'red', 'center', 'top')); + $gr[$i]->lb( new Label($x1, $y, "($x1,$y)", 'red', 'center', 'top')); +} + +$gr[0]->stamps(closed_circle($x0,$y,'red')); +$gr[0]->stamps(closed_circle($x1,$y,'red')); +$alt[0] = "There is the graph of function f(x)=$f, and a horizontal line at y=$y. Those two functions intersect at ($x0,$y) and ($x1,$y)."; + +@symbols = ('\gt','\ge','\lt','\le'); +$i0 = random(0,1,1); +$i1 = random(2,3,1); +$symbol0 = $symbols[$i0]; +$symbol1 = $symbols[$i1]; + +$hof0 = $i0==0 ? "hollow" : "solid"; +$hof1 = $i1==2 ? "hollow" : "solid"; + +if ($a>0) { + add_functions($gr[2], "$f for x in <$x0,$x1> using color:red and weight:2"); + add_functions($gr[1], "$f for x in <$min[0],$x0> using color:red and weight:2"); + add_functions($gr[1], "$f for x in <$x1,$max[0]> using color:red and weight:2"); + $alt[1] = $alt[0]." The segment on f(x) from negative infinity to x=$x0, and from x=$x1 to infinity are highlighted. The points ($x0,$y) and ($x1,$y) are $hof0."; + $alt[2] = $alt[0]." The segment on f(x) from $x0 to $x1 is highlighted. The points ($x0,$y) and ($x1,$y) are $hof1."; +} else { + add_functions($gr[1], "$f for x in <$x0,$x1> using color:red and weight:2"); + add_functions($gr[2], "$f for x in <$min[0],$x0> using color:red and weight:2"); + add_functions($gr[2], "$f for x in <$x1,$max[0]> using color:red and weight:2"); + $alt[1] = $alt[0]." The segment on f(x) from x=$x0 to x=$x1 is highlighted. The points ($x0,$y) and ($x1,$y) are $hof0."; + $alt[2] = $alt[0]." The segment on f(x) from negative infinity to x=$x0, and from x=$x1 to infinity are highlighted. The points ($x0,$y) and ($x1,$y) are $hof1."; +} + +if ($i0 == 0) { + $gr[1]->stamps(open_circle($x0,$y,'red')); + $gr[1]->stamps(open_circle($x1,$y,'red')); +} else { + $gr[1]->stamps(closed_circle($x0,$y,'red')); + $gr[1]->stamps(closed_circle($x1,$y,'red')); +} +if ($i1==2) { + $gr[2]->stamps(open_circle($x0,$y,'red')); + $gr[2]->stamps(open_circle($x1,$y,'red')); +} else { + $gr[2]->stamps(closed_circle($x0,$y,'red')); + $gr[2]->stamps(closed_circle($x1,$y,'red')); +} + +Context("FiniteSolutionSets"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +Context()->flags->remove("NumberCheck"); +$solutions = Formula("{$x0,$x1}"); + +Context("Point"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); + +$intersections = List("($x0,$y),($x1,$y)"); + +Context("Interval"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +if ($a>0) { + $ans3 = ($i0==0) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); + $ans4 = ($i1==2) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); +} else { + $ans3 = ($i0==0) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); + $ans4 = ($i1==2) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); +} + + + +############################################## + +BEGIN_PGML + +Let [`f(x)=[$f]`] and [`g(x)=[$g]`]. Use technology to determine the following. + +1. What are the points of intersection for these two functions? + + [__]{$intersections}{width => 30} + +1. Solve [`f(x)=g(x)\text{.}`] Enter your solutions in set notation. + + [__]{$solutions}{width => 30} + +1. Solve [`f(x) [$symbol0] g(x)\text{.}`] Enter *inf* to represent infinity. Enter capitalized "U" to represent the union symbol, if needed. + + [__]{$ans3}{width => 30} + +1. Solve [`f(x) [$symbol1] g(x)\text{.}`] Enter *inf* to represent infinity. Enter capitalized "U" to represent the union symbol, if needed. + + [__]{$ans4}{width => 30} + +END_PGML + +############################################################ +# Solution +############################################################ + +$ion0 = $i0==0 ? "not including" : "including"; +$ion1 = $i1==2 ? "not including" : "including"; + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer those questions. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: Enter [` f(x)=[$f] `] in the first text box and [`g(x)=[$y]`] in the second text box. + +Step 3: If needed, zoom in/out until you can clearly see both functions and their intersections. Alternatively, click on the Graph Settings icon (looking like a wrench) and define the ranges of [`x`]-axis and [`y`]-axis. In case you need help, set the [`x`] range to [`[$min[0]],[$max[0]]`] and [`y`] range to [`[$min[1]],[$max[1]]`]. + +Step 4: Click on those two intersections, and desmos shows [`[$intersections]`]. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +###Question 1 and 2 + +The solutions of [`f(x)=g(x)`] are simply the [`x`]-values of those two intersections: [`[$solutions]`]. + +###Question 3 + +To meet the condition of [` f(x) [$symbol0] g(x) `], we must choose [`x`] values in the intervals [`[$ans3]`]. In the following graph, ponts on the red segment(s) of [`f(x)`] has [`y`]-values greater than [`[$y]`] ([$ion0] those two intersection points). + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +###Question 4 + +To meet the condition of [` f(x) [$symbol1] g(x) `], we must choose [`x`] values in the intervals [`[$ans4]`]. In the following graph, ponts on the red segment(s) of [`f(x)`] has [`y`]-values smaller than or equal to [`[$y]`] ([$ion1] those two intersection points). + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction10.pg index 47612e01f2..7f30e8bd24 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Rational equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction20.pg index 324d4803ad..6186a70bc1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction20.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Rational equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Carl Yao) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -67,11 +71,13 @@ A drug's concentration in a patient's blood, in micrograms per milliliter, can b where [`t`] is the time, in minutes, since the drug is injected. -1) The drug's concentration will be [___________]{$ans1} milligrams per milliliter [`[$t1]`] minutes since the injection. Round your answers to two decimal places if needed. +Use graphing technology to solve the following problems. + +1) The drug's concentration will be [___________]{$ans1} micrograms per milliliter [`[$t1]`] minutes since the injection. Round your answers to two decimal places if needed. -2) When the drug's concentration decreases to [`[$ans2Show]`] milligrams per milliliter, it's time to give the patient another injection. The nurse should wait for [___________]{$t2} minutes before another injection. Round your answers to an integer if needed. +2) When the drug's concentration decreases to [`[$ans2Show]`] micrograms per milliliter, it's time to give the patient another injection. The nurse should wait for [___________]{$t2} minutes before another injection. Round your answers to an integer if needed. -3) If no re-injection is applied, in the long term, the drug's concentration will be [____________]{$ans3} milligrams per milliliter. +3) If no re-injection is applied, in the long term, the drug's concentration will be [____________]{$ans3} micrograms per milliliter. END_PGML @@ -91,7 +97,7 @@ We need to substitute the function's [`x`] value with [`[$t1]`] to get the corre Step 3: In the second textbox, enter [` f([$t1]) `]. Desmos shows [`[$ans1]`]. -The drug's concentration will be approximately [`[$ans1Show]`] milligrams per milliliter [`[$t1]`] minutes since the injection. +The drug's concentration will be approximately [`[$ans1Show]`] micrograms per milliliter [`[$t1]`] minutes since the injection. ###Question 2 @@ -111,7 +117,7 @@ To find what value the function is approaching as [`x`] becomes bigger and bigge Step 3: In the second textbox, enter [` f(1000000) `]. Desmos shows a value very close to [`[$ans3]`]. Actually, the bigger the [`x`] value, the closer the function's value is to [`[$ans3]`]. -If no re-injection is applied, in the long term, the drug's concentration will be [`[$ans3]`] milligrams per milliliter. +If no re-injection is applied, in the long term, the drug's concentration will be [`[$ans3]`] micrograms per milliliter. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction30.pg index 4beff064a4..4760c9d248 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction30.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.5') -## DBsubject(Algebra) -## DBchapter(Rational equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('volume','rectangular','prism') +## DBCCSS('5.MD.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -113,7 +117,7 @@ $left = -$spaceLR; $right = (int(($base+$spaceLR)/10))*10; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML @@ -141,7 +145,7 @@ Now we can write the box's surface area, [`S(x)`], as a function of [`x`]: [`` \begin{aligned} S(x) &= 4xh+x^2 \\ - S(x) &= 4x\left(\frac{[$volume]}{x^2}\right)+x^2 \\ + S(x) &= 4x(\frac{[$volume]}{x^2})+x^2 \\ S(x) &= \frac{[$s1]}{x}+x^2 \\ \end{aligned} ``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction40.pg index 04faf40366..18b7c7fab9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction40.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.5') -## DBsubject(Algebra) -## DBchapter(Rational equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('volume','rectangular','prism') +## DBCCSS('5.MD.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -78,9 +82,7 @@ where [`x`] stands for the airplane's speed in miles per hours, and [`C(x)`] rep Use graphing technology to answer the following question. Round to two decimal places if needed. - To obtain the minimum cost per passenger, which is [_____________]{$costU}, the airplane should fly at this speed: [___________]{$speedU}. - -([@ helpLink("units","Help with units") @]*.) + To obtain a minimum cost per passenger of [_____________]{$costU}, the airplane should fly at [___________]{$speedU}. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction50.pg new file mode 100644 index 0000000000..157a8ab5ba --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction50.pg @@ -0,0 +1,143 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rational function, find its horizontal asymptote in the context +# of an application. +# +# Last update: Carl Yao 04/30/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl" +); + +############################################# + +TEXT(beginproblem()); + +do { + $e = random(0.02,0.06,0.01); + $y4 = random(1000,2000,100); + $ac = $e*$y4; + $a=random(10,100,10); + $c = $ac/$a; + + $d = random(1,10,1); + $y1 = random(20,80,5); + $ab = $d*$y1; + $b = $ab/$a; +} until ( (int($c)==$c) && ($b==int($b)) && ($c!=1) ); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0); +Context()->variables->add(t=>'Real'); + +$num = Formula("$a*($b+$c*t)")->reduce; +$den = Formula("$d+$e*t")->reduce; +$f = Formula("$a*($b+$c*t)/($d+$e*t)")->reduce; +$numE1 = Formula("$ab+$ac*t")->reduce; +$numE2 = Formula("$ac*t+$ab")->reduce; +$denE1 = Formula("$e*t+$d")->reduce; + +$fx = Formula("$a*($b+$c*x)/($d+$e*x)")->reduce; + +do { + $x2 = random(10,30,1); + $y2Raw = $f->eval(t=>$x2); + $y2 = int($y2Raw+0.5); + + $y3 = random(100,$y4-100,100); + $x3Raw = ($y3*$d-$ab)/($ac-$y3*$e); + $x3 = int($x3Raw+0.5); +} until (abs($x2-$x3)>10); + +############################################# + +BEGIN_PGML + +Some moths were introduced into a ranch, and their population can be modeled by the following function: + + [``f(t) = [$f]``] + +where [` t `] is in months since January 2000. + +Answer the following questions with Desmos. Round your answers to *whole numbers* when necessary. + +a) In January 2000, [___________]{$y1} moths were introduced into the ranch. + +a) [`[$x2]`] months since January 2000, approximately [___________]{$y2} moths live on the ranch. + +a) Approximately [___________]{$x3} months since January 2000, there were [`[$y3]`] moths living on the ranch. + +d) In the long run, the moth population on the ranch would stablize at approximately [___________]{$y4}. + +END_PGML + +############################################# + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$fx] `]. Note that we should change [`f(t)`] to [`f(x)`] and change [`t`] to [`x`] when we use desmos.com. + +a) In January 2000, we have [`t=0`]. So we evaluate [`f(0)`]. + + We need to substitute the function's [`x`]-value with [`0`] to get the corresponding [`y`]-value. + + Step 3: In the second textbox, enter [` f(0) `]. Desmos shows [`[$y1]`]. + + In January 2000, [`[$y1]`] moths were introduced into the ranch. + +a) "[`[$x2]`] months since January 2000" implies [`t=[$x2]`]. We need to substitute [`x=[$x2]`] into [`f(x)`]. + + Step 3: In the second textbox, enter [` f([$x2]) `]. Desmos shows [`[$y2Raw]`]. + + [`[$x2]`] months since January 2000, approximately [`[$y2]`] moths live on the ranch. + +a) To find when there were [`[$y3]`] moths living on the ranch, we need to substitute [`[$y3]`] into the function's [`y`]-value and find the corresponding [`x`]-value. + + Step 3: In the second textbox, enter [`y=[$y3]`]. + + Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f(x)`] and [`y=[$y3]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + + Step 5: Click on the intersection of [`f(x)`] and [`y=[$y3]`]. Desmos shows [`([$x3Raw],[$y3])`]. + + Approximately [`[$x3]`] months since January 2000, there were [`[$y3]`] moths living on the ranch. + +a) "In the long run" suggests we examine the long term behavior of [`f`], as [`x`] becomes large. We need to substitute [`x`] with a very large value. + + Step 3: In the second textbox, enter [` f(1000000) `]. Desmos shows a value very close to [`[$y4]`]. Actually, the bigger the [`x`] value, the closer the function's value is to [`[$y4]`]. + + In fact, the function's horizontal asymptote is at [`y=[$y4]`]. In the graph of [`f(x)`], as [`x`] moves farther to the right, [`f(x)`] gets closer to [`[$y4]`]. + + In the long run, the moth population on the ranch would stablize at approximately [`[$y4]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction60.pg new file mode 100644 index 0000000000..86ac58253f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction60.pg @@ -0,0 +1,158 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rational function, find its horizontal asymptote in the context +# of an application. +# +# Last update: Carl Yao 04/30/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextCurrency.pl", +"PGcourse.pl" +); + +############################################# + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0); +Context()->variables->add(t=>'Real'); + +do { + $c = random(0.2,0.9,0.1); + $y4 = random(50,60,5); + $a = $c*$y4; + + $d = random(1,10,1); + $y1 = random(2,8,0.5); + $b = $d*$y1; + + $f = Formula("($a t^2 + $b)/($c t^2 + $d)")->reduce; + do { + $x2 = random(3,10,1); + $y2Raw = $f->eval(t=>$x2); + $y2 = int($y2Raw+0.5); + + $y3 = random($y1+10,$y4-10,5); + $s1 = $y3*$c; + $s2 = $y3*$d; + $s3 = $s1-$a; + $s4 = $b-$s2; + $x3Raw = sqrt($s4/$s3); + $x3 = int($x3Raw+0.5); + } until (abs($x2-$x3)>2); + +} until ($s4/$s3>0); + +$num = Formula("$a t^2 + $b")->reduce; +$den = Formula("$c t^2 + $d")->reduce; + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(tolerance=>1); + +$y1t = $y1*1000; +$y2t = $y2*1000; +$y3t = $y3*1000; +$y4t = $y4*1000; + +$y1C = Currency("$y1t"); +$y2C = Currency("$y2t"); +$y3C = Currency("$y3t"); +$y4C = Currency("$y4t"); + + +############################################# + +BEGIN_PGML + +A once thriving company had its monthly profits, _in thousands of +dollars_, modeled by the equation + + [``f(t) = [$f]``] + +where [` t `] is in months since January 2000. + +Answer the following questions with Desmos. + +a) In January 2000, the company's monthly profit was approximately [___________]{$y1C}. + +a) [`[$x2]`] months since January 2000, the company's monthly profit was approximately [___________]{$y2C}. (Round to *thousands of dollars*.) + +a) Approximately [___________]{$x3} months since January 2000, the company's monthly profit was approximately [`[$y3C]`]. (Round to a *whole number*.) + +d) In the long run, the company's monthly profit would stabilize at approximately [___________]{$y4C}. + +END_PGML + +############################################# + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$fx] `]. Note that we should change [`f(t)`] to [`f(x)`] and change [`t`] to [`x`] when we use desmos.com. + +a) In January 2000, we have [`t=0`]. So we evaluate [`f(0)`]. + + We need to substitute the function's [`x`]-value with [`0`] to get the corresponding [`y`]-value. + + Step 3: In the second textbox, enter [` f(0) `]. Desmos shows [`[$y1]`]. + + In January 2000, the company's monthly profit was approximately [`[$y1C]`]. + +a) "[`[$x2]`] months since January 2000" implies [`t=[$x2]`]. We need to substitute [`x=[$x2]`] into [`f(x)`]. + + Step 3: In the second textbox, enter [` f([$x2]) `]. Desmos shows [`[$y2Raw]`]. + + [`[$x2]`] months since January 2000, the company's monthly profit was approximately [`[$y2C]`]. + +a) To find when the company's monthly profit was [`[$y3C]`], we need to substitute [`[$y3]`] into the function's [`y`]-value and find the corresponding [`x`]-value. + + Step 3: In the second textbox, enter [`y=[$y3]`]. + + Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f(x)`] and [`y=[$y3]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + + Step 5: Click on the intersection of [`f(x)`] and [`y=[$y3]`]. Desmos shows [`([$x3Raw],[$y3])`]. + + Approximately [`[$x3]`] months since January 2000, the company's monthly profit was approximately [`[$y3C]`]. + +a) "In the long run" suggests we examine the long term behavior of [`f`], as [`x`] becomes large. We need to substitute [`x`] with a very large value. + + Step 3: In the second textbox, enter [` f(1000000) `]. Desmos shows a value very close to [`[$y4]`]. Actually, the bigger the [`x`] value, the closer the function's value is to [`[$y4]`]. + + In fact, the function's horizontal asymptote is at [`y=[$y4]`]. In the graph of [`f(x)`], as [`x`] moves farther to the right, [`f(x)`] gets closer to [`[$y4]`]. + + In the long run, the company's monthly profit would stabilize at approximately [`[$y4C]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction70.pg new file mode 100644 index 0000000000..ad9e7a53c3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosRationalFunction70.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rational function application. +# +# Last updated: Yao 5/8/2018 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +); + +############################################# + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Numeric"); + +do { + $a = random(30,60,5); + $a2 = $a**2; + $num = Compute("x**2")->reduce; + $den = Compute("$a2-$a*x")->reduce; + $func = Compute("x**2/($a2-$a*x)")->reduce; + $x1 = random($a-20,$a-5,1); + $y1 = $func->eval(x=>$x1); + $y1r = int((10*$y1+5)/10); + do {$x2 = random($a-20,$a-5,1);} until (abs($x1-$x2)>5); + $y2 = $func->eval(x=>$x2); + $y2r = int((10*$y2+5)/10); +} until ( ($y1>2) && ($y2>2) ); + +$A = 1; +$B = $y2r*$a; +$C = -$y2r*$a2; +$D = ($B)**2-4*$A*$C; +$D2 = sqrt($D); +$r1 = (-$B+$D2)/(2*$A); +$r2 = (-$B-$D2)/(2*$A); +$ans2 = int($r1+0.5); + + +############################################# + +BEGIN_PGML + +In a certain store, cashiers can serve [`[$a]`] customers per hour on average. If [`x`] customers arrive at the store in a given hour, then the average number of customers [`C`] waiting in line can be modeled by the function + + [`` C(x) = [$func] ``] + +where [`x<[$a]`]. + +Answer the following questions with a graphing calculator. Round your answers to integers. + +a) If [`[$x1]`] customers arrived in the store in the past hour, there are approximately [__________]{$y1r} customers waiting in line. + +a) If there are [`[$y2r]`] customers waiting in line, approximately [__________]{$ans2} customers arrived in the past hour. + +END_PGML + +############################################# + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func] `]. Note that we should change [`C(x)`] to [`f(x)`] when we use desmos.com. + +a) If [`[$x1]`] customers arrived in the store in the past hour, we need to substitute [`x=[$x1]`] into [`f(x)`]. + + Step 3: In the second textbox, enter [` f([$x1]) `]. Desmos shows [`[$y1]`]. + + If [`[$x1]`] customers arrived in the store in the past hour, there are approximately [`[$y1r]`] customers waiting in line. + +a) If there are [`[$y2r]`] customers waiting in line, to find how many customers arrived in the past hour, we need to substitute [`[$y2r]`] into the function's [`y`]-value and find the corresponding [`x`]-value. + + Step 3: In the second textbox, enter [`y=[$y2r]`]. + + Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f(x)`] and [`y=[$y2r]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + + Step 5: Click on the intersection of [`f(x)`] and [`y=[$y2r]`]. Desmos shows [`([$r2],[$y2r])`] and [`([$r1],[$y2r])`]. We should ignore the solution with a negative [`x`]-value. + + If there are [`[$y2r]`] customers waiting in line, approximately [`[$ans2]`] customers arrived in the past hour. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolveingInequality10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolveingInequality10.pg new file mode 100644 index 0000000000..83e1511a4b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolveingInequality10.pg @@ -0,0 +1,179 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use graphing technology to solve an inequality. +# +# Last edited: Yao 3/21/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','inequality') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $a = non_zero_random(-3,3,1); + $d = random(1,8,1); + $b = random(-8,$d-9,1); + $c = random(4,7,1); + $m = ($d-$b)/$c; + $ma = $m*$a; + $func1 = Compute("abs($m*x-$ma)+$b")->reduce; + $x1 = $a-$c; + $x2 = $a+$c; + $xVertex = $a; + $yVertex = $b; +} until ( (int($m)==$m) && ($x1>=-9) && ($x2<=9) ); + +$func2 = Compute("$d"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x1,$x2,0],[$yVertex,0,$d]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +$leftb = $min[0]-1; +$rightb = $max[0]+1; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + add_functions($gr[$i], "$func1 for x in [$leftb,$rightb] using color:blue and weight:2"); + $gr[$i]->lb( new Label($xVertex,$yVertex,'f(x)','blue','center','top')); + + add_functions($gr[$i], "$func2 for x in [$leftb,$rightb] using color:blue and weight:2"); + $gr[$i]->lb( new Label($xVertex,$d,'g(x)','blue','center','top')); +} + +$gr[0]->lb( new Label($x1,$d,"($x1,$d)",'red','left','top')); +$gr[0]->lb( new Label($x2,$d,"($x2,$d)",'red','right','top')); + +@symbols = ('\gt','\ge','\lt','\le'); +$in = random(0,3,1); +$symbol = $symbols[$in]; + + + +if ($in<=1) { + add_functions($gr[0], "$func1 for x in [$leftb,$x1] using color:red and weight:2"); + add_functions($gr[0], "$func1 for x in [$x2,$rightb] using color:red and weight:2"); +} else { + add_functions($gr[0], "$func1 for x in [$x1,$x2] using color:red and weight:2"); +} + +if (($in==0) || ($in==2)) { + $gr[0]->stamps( open_circle($x1,$d,'red') ); + $gr[0]->stamps( open_circle($x2,$d,'red') ); + $hos = 'hollow'; +} else { + $gr[0]->stamps( closed_circle($x1,$d,'red') ); + $gr[0]->stamps( closed_circle($x2,$d,'red') ); + $hos = 'solid'; +} +$ALT0 = "There is a graph of f(x)=$func and a graph of g(x)=$d. They intersect at ($x1,$d) and ($x2,$d). Those two points are $hos."; + +if ($in<=1) { + $ALT0 .= "On the graph of f(x)=$func, the segments to the left of x=$x1 and to the segment to the right of x=$x2 are shaded red."; +} else { + $ALT0 .= "On the graph of f(x)=$func, the segment between x=$x1 and x=$x2 is shaded red."; +} + +Context("Interval"); +if ($in==0) {$ans = Compute("(-infinity,$x1)U($x2,infinity)");} +elsif ($in==1) {$ans = Compute("(-infinity,$x1]U[$x2,infinity)");} +elsif ($in==2) {$ans = Compute("($x1,$x2)");} +else {$ans = Compute("[$x1,$x2]");} + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +Use graphing technology to solve this inequality: + + [`` [$func1] [$symbol] [$func2] ``] + +* Write your solution in interval notation. +* Use *inf* to represent the symbol [` \infty `]. +* Use upper-case letter U to represent the union symbol [` \cup `]. + + [_________________]{$ans} + +END_PGML +############################################## + +$xShow = -10; +$yShow = $func1->eval(x=>-10); + +############################################## + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer this question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func1] `]. + +Step 3: In the first textbox, enter [` g(x)=[$func2] `]. + +Step 4: Zoom out on the window until you can see the intersections of those two functions. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. In case you need help, set the [`x`] range to [`[$min[0]],[$max[0]]`] and [`y`] range to [`[$min[1]],[$max[1]]`]. + +You should see a screen similar to the following, with [`f(x)=[$func1]`] and [`g(x)=[$func2]`]: + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< + +[@EnlargeImageStatementPGML()@]** + +We need to find those two intersections. + +Step 5: Click on those two intersections, and desmos shows [`([$x1],[$d])`] and [`([$x2],[$d])`]. + +To meet the condition of [`[$func1] [$symbol] [$func2]`], or [` f(x) [$symbol] g(x) `], we must choose [`x`] values in the intervals [`[$ans]`] (the segment(s) shaded red on [`f(x)`]). + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingCubicEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingCubicEquation10.pg new file mode 100644 index 0000000000..3e22649df0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingCubicEquation10.pg @@ -0,0 +1,149 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use graphing technology to solve cubic equation. +# There are three intersections. +# +# Last edited: Yao 3/21/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + + $x0 = random(-20,-10,1); + $x1 = non_zero_random(-9,9,1); + $x2 = random(10,20,1); + $a = non_zero_random(-0.09,0.09,0.01); + $b = -$a*($x0+$x1+$x2); + $slope = non_zero_random(-2,2,0.1); + $c = $a*($x0*$x1+$x0*$x2+$x1*$x2)+$slope; + $yInt = random(-5,5,0.1); + $d = -$a*$x0*$x1*$x2+$yInt; + $func0 = Compute("$a*$var**3+$b*$var**2+$c*$var+$d")->reduce; + $func1 = Compute("$slope*$var+$yInt")->reduce; + +$y0 = $func1->eval($var=>$x0); +$y1 = $func1->eval($var=>$x1); +$y2 = $func1->eval($var=>$x2); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x0,$x1,$x2,0],[$y0,$y1,$y2,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +$leftb = $min[0]-1; +$rightb = $max[0]+1; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + + add_functions($gr, "$func0 for $var in <$leftb,$rightb> using color:blue and weight:2"); + add_functions($gr, "$func1 for $var in <$leftb,$rightb> using color:blue and weight:2"); + $gr->stamps( closed_circle($x0,$y0,'red') ); + $gr->lb( new Label($x0,$y0,"($x0,$y0)", 'red','center','top','small')); + $gr->stamps( closed_circle($x1,$y1,'red') ); + $gr->lb( new Label($x1,$y1,"($x1,$y1)", 'red','center','top','small')); + $gr->stamps( closed_circle($x2,$y2,'red') ); + $gr->lb( new Label($x2,$y2,"($x2,$y2)", 'red','center','top','small')); + $alt = "This is the graphs of f($var)=$func0 and g($var)=$func1. They intersect at ($x0,$y0), ($x1,$y1) and ($x2,$y2). Those points are marked and labeled."; + + +Context("FiniteSolutionSets"); +Context()->flags->remove("NumberCheck"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$x0,$x1,$x2}"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use graphing technology to solve this equation: + + [`` [$func0] = [$func1] ``] + +* Enter your answer(s) in set notation. + + The equation's solutions are [__________]{$ans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use desmos.com to solve this equation. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f([$var])=[$func0] `]. + +Step 3: In the second textbox, enter [` g([$var])=[$func1] `]. + +Step 4: Zoom out on the window, if needed, until you can see the intersections of [`f([$var])`] and [`g([$var])`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. In case you need help, set the [`x`] range to [`[$min[0]],[$max[0]]`] and [`y`] range to [`[$min[1]],[$max[1]]`]. + +You should see a graph similar to the following one: + +>>[@ image(insertGraph($gr), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt' title= '$alt'" +) @]*<< + +Step 5: Click on the intersections, and desmos shows the solutions [`([$x0],[$y0])`], [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. + +The equation's solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingInequality20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingInequality20.pg new file mode 100644 index 0000000000..5719c1359e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingInequality20.pg @@ -0,0 +1,176 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use graphing technology to solve an inequality. +# +# Last edited: Yao 3/21/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','inequality') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $a = non_zero_random(-3,3,1); + $d = -random(1,8,1); + $b = -random(-8,$d-9,1); + $c = random(4,7,1); + $m = -($d-$b)/$c; + $ma = $m*$a; + $func1 = Compute("-abs($m*x-$ma)+$b")->reduce; + $x1 = $a-$c; + $x2 = $a+$c; + $xVertex = $a; + $yVertex = $b; +} until ( (int($m)==$m) && ($x1>=-9) && ($x2<=9) ); + +$func2 = Compute("$d"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x1,$x2,0],[$yVertex,0,$d]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +$leftb = $min[0]-1; +$rightb = $max[0]+1; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + add_functions($gr[$i], "$func1 for x in [$leftb,$rightb] using color:blue and weight:2"); + $gr[$i]->lb( new Label($xVertex,$yVertex,'f(x)','blue','center','bottom')); + + add_functions($gr[$i], "$func2 for x in [$leftb,$rightb] using color:blue and weight:2"); + $gr[$i]->lb( new Label($xVertex,$d,'g(x)','blue','center','bottom')); +} + +$gr[0]->lb( new Label($x1,$d,"($x1,$d)",'red','left','top')); +$gr[0]->lb( new Label($x2,$d,"($x2,$d)",'red','right','top')); + +@symbols = ('\gt','\ge','\lt','\le'); +$in = random(0,3,1); +$symbol = $symbols[$in]; + +$hos = (($in==0) || ($in==2)) ? 'hollow' : 'solid'; +$ALT0 = "There is a graph of f(x)=$func and a graph of g(x)=$d. They intersect at ($x1,$d) and ($x2,$d). Those two points are $hos."; +if ($in<=1) { + $ALT0 .= "On the graph of f(x)=$func, the segments to the left of x=$x1 and to the segment to the right of x=$x2 are shaded red."; +} else { + $ALT0 .= "On the graph of f(x)=$func, the segment between x=$x1 and x=$x2 is shaded red."; +} +if ($in>=2) { + add_functions($gr[0], "$func1 for x in <$leftb,$x1> using color:red and weight:2"); + add_functions($gr[0], "$func1 for x in <$x2,$rightb> using color:red and weight:2"); + +} else { + add_functions($gr[0], "$func1 for x in <$x1,$x2> using color:red and weight:2"); +} + +if (($in==1) || ($in==3)) { + $gr[0]->stamps( closed_circle($x1,$d,'red') ); + $gr[0]->stamps( closed_circle($x2,$d,'red') ); +} else { + $gr[0]->stamps( open_circle($x1,$d,'red') ); + $gr[0]->stamps( open_circle($x2,$d,'red') ); +} + +Context("Interval"); +if ($in==0) {$ans = Compute("($x1,$x2)");} +elsif ($in==1) {$ans = Compute("[$x1,$x2]");} +elsif ($in==2) {$ans = Compute("(-infinity,$x1)U($x2,infinity)");} +else {$ans = Compute("(-infinity,$x1]U[$x2,infinity)");} + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +Use graphing technology to solve this inequality: + + [`` [$func1] [$symbol] [$func2] ``] + +* Write your solution in interval notation. +* Use *inf* to represent the symbol [` \infty `]. +* Use upper-case letter U to represent the union symbol [` \cup `]. + + [_________________]{$ans} + +END_PGML +############################################## + +$xShow = -10; +$yShow = $func1->eval(x=>-10); + +############################################## + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer this question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$func1] `]. + +Step 3: In the first textbox, enter [` g(x)=[$func2] `]. + +Step 4: Zoom out on the window until you can see the intersections of those two functions. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. In case you need help, set the [`x`] range to [`[$min[0]],[$max[0]]`] and [`y`] range to [`[$min[1]],[$max[1]]`]. + +You should see a screen similar to the following, with [`f(x)=[$func1]`] and [`g(x)=[$func2]`]: + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< + +[@EnlargeImageStatementPGML()@]** + +We need to find those two intersections. + +Step 5: Click on those two intersections, and desmos shows [`([$x1],[$d])`] and [`([$x2],[$d])`]. + +To meet the condition of [`[$func1] [$symbol] [$func2]`], or [` f(x) [$symbol] g(x) `], we must choose [`x`] values in the intervals [`[$ans]`] (the segment(s) shaded red on [`f(x)`]). + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingInequality30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingInequality30.pg new file mode 100644 index 0000000000..fbd87e0c65 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingInequality30.pg @@ -0,0 +1,211 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use technology to solve inequalities. +# +# Last edit by: Carl Yao 03/20/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $a = non_zero_random(-1,1,0.1); + $h = non_zero_random(-5,5,1); + $k = non_zero_random(-5,5,1); + $f = Compute("$a*x**2-2*$a*$h*x+($a*($h)**2+$k)")->reduce; + do {$y = $a>0 ? $k+random(3,5,1) : $k-random(3,5,1);} until $y!=0; + $g = Compute("$y")->reduce; + $A = $a; + $B = -2*$a*$h; + $C = $a*$h**2+$k-$y; + $D = ($B)**2-4*$A*$C; + $x0 = Round(min((-$B+sqrt($D))/(2*$A),(-$B-sqrt($D))/(2*$A)),3); + $x1 = Round(max((-$B+sqrt($D))/(2*$A),(-$B-sqrt($D))/(2*$A)),3); +} until $x1-$x0 > 2; + +$vertexX = -$B/(2*$A); +$vertexY = $f->eval(x=>$vertexX); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x0,$x1,0,$vertexX],[$vertexY,$y,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); + +for ($i=0;$i<=2;$i++) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + add_functions($gr[$i], "$f for x in <$min[0],$max[0]> using color:blue and weight:2"); + add_functions($gr[$i], "$g for x in <$min[0],$max[0]> using color:blue and weight:2"); + $tob = $a>0 ? 'top' : 'bottom'; + $gr[$i]->lb( new Label($vertexX, $vertexY, "f(x)", 'blue', 'center', $tob)); + $gr[$i]->lb( new Label($vertexX, $y, "g(x)", 'blue', 'center', $tob)); + $gr[$i]->lb( new Label($x0, $y, "($x0,$y)", 'red', 'center', 'top')); + $gr[$i]->lb( new Label($x1, $y, "($x1,$y)", 'red', 'center', 'top')); +} + +$gr[0]->stamps(closed_circle($x0,$y,'red')); +$gr[0]->stamps(closed_circle($x1,$y,'red')); +$alt[0] = "There is the graph of function f(x)=$f, and a horizontal line at y=$y. Those two functions intersect at ($x0,$y) and ($x1,$y)."; + +@symbols = ('\gt','\ge','\lt','\le'); +$i0 = random(0,1,1); +$i1 = random(2,3,1); +$symbol0 = $symbols[$i0]; +$symbol1 = $symbols[$i1]; + +$hof0 = $i0==0 ? "hollow" : "solid"; +$hof1 = $i1==2 ? "hollow" : "solid"; + +if ($a>0) { + add_functions($gr[2], "$f for x in <$x0,$x1> using color:red and weight:2"); + add_functions($gr[1], "$f for x in <$min[0],$x0> using color:red and weight:2"); + add_functions($gr[1], "$f for x in <$x1,$max[0]> using color:red and weight:2"); + $alt[1] = $alt[0]." The segment on f(x) from negative infinity to x=$x0, and from x=$x1 to infinity are highlighted. The points ($x0,$y) and ($x1,$y) are $hof0."; + $alt[2] = $alt[0]." The segment on f(x) from $x0 to $x1 is highlighted. The points ($x0,$y) and ($x1,$y) are $hof1."; +} else { + add_functions($gr[1], "$f for x in <$x0,$x1> using color:red and weight:2"); + add_functions($gr[2], "$f for x in <$min[0],$x0> using color:red and weight:2"); + add_functions($gr[2], "$f for x in <$x1,$max[0]> using color:red and weight:2"); + $alt[1] = $alt[0]." The segment on f(x) from x=$x0 to x=$x1 is highlighted. The points ($x0,$y) and ($x1,$y) are $hof0."; + $alt[2] = $alt[0]." The segment on f(x) from negative infinity to x=$x0, and from x=$x1 to infinity are highlighted. The points ($x0,$y) and ($x1,$y) are $hof1."; +} + +if ($i0 == 0) { + $gr[1]->stamps(open_circle($x0,$y,'red')); + $gr[1]->stamps(open_circle($x1,$y,'red')); +} else { + $gr[1]->stamps(closed_circle($x0,$y,'red')); + $gr[1]->stamps(closed_circle($x1,$y,'red')); +} +if ($i1==2) { + $gr[2]->stamps(open_circle($x0,$y,'red')); + $gr[2]->stamps(open_circle($x1,$y,'red')); +} else { + $gr[2]->stamps(closed_circle($x0,$y,'red')); + $gr[2]->stamps(closed_circle($x1,$y,'red')); +} + +Context("Interval"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +if ($a>0) { + $ans3 = ($i0==0) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); + $ans4 = ($i1==2) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); +} else { + $ans3 = ($i0==0) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); + $ans4 = ($i1==2) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); +} + + + +############################################## + +BEGIN_PGML + +Use technology to solve the following inequalities. + +* Enter *inf* to represent infinity. +* Enter capitalized "U" to represent the union symbol, if needed. + +1. Solve [`[$f] [$symbol0] [$g]\text{.}`] + + [__]{$ans3}{width => 30} + +1. Solve [`[$f] [$symbol1] [$g]\text{.}`] + + [__]{$ans4}{width => 30} + +END_PGML + +############################################################ +# Solution +############################################################ + +$ion0 = $i0==0 ? "not including" : "including"; +$ion1 = $i1==2 ? "not including" : "including"; + +BEGIN_PGML_SOLUTION + +We will use desmos.com to answer those questions. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: Enter [` f(x)=[$f] `] in the first text box and [`g(x)=[$y]`] in the second text box. + +Step 3: If needed, zoom in/out until you can clearly see both functions and their intersections. Alternatively, click on the Graph Settings icon (looking like a wrench) and define the ranges of [`x`]-axis and [`y`]-axis. In case you need help, set the [`x`] range to [`[$min[0]],[$max[0]]`] and [`y`] range to [`[$min[1]],[$max[1]]`]. + +Step 4: Click on those two intersections, and desmos shows [`([$x0],[$y])`] and [`([$x1],[$y])`]. + +###Question 1 + +To meet the condition of [` [$f] [$symbol0] [$g] `], we must choose [`x`] values in the intervals [`[$ans3]`]. In the following graph, ponts on the red segment(s) of [`[$f]`] has [`y`]-values greater than [`[$y]`] ([$ion0] those two intersection points). + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +###Question 2 + +To meet the condition of [` [$f] [$symbol1] [$g] `], we must choose [`x`] values in the intervals [`[$ans4]`]. In the following graph, ponts on the red segment(s) of [`[$f]`] has [`y`]-values smaller than or equal to [`[$y]`] ([$ion1] those two intersection points). + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingInequality40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingInequality40.pg new file mode 100644 index 0000000000..3de781c96b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingInequality40.pg @@ -0,0 +1,233 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use technology to find intersections between a parabola and a line. +# +# Last edit by: Carl Yao 03/20/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "parserPopUp.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + do { + @a = (random(1,9,1), 0); + @b = (random(-5,5,1), random(1,9,1)); + @c = (non_zero_random(-9,9,1), non_zero_random(-9,9,1)); + @s = (non_zero_random(-0.9,0.9,0.1), non_zero_random(-0.5,0.5,0.1)); + + $f = Formula("$s[0]*$a[0] x^2 + $s[0]*$b[0] x + $s[0]*$c[0]")->reduce; + $g = Formula("$s[1]*$a[1] x^2 + $s[1]*$b[1] x + $s[1]*$c[1]")->reduce; + + $A = $s[0]*$a[0]-$s[1]*$a[1]; + $B = $s[0]*$b[0]-$s[1]*$b[1]; + $C = $s[0]*$c[0]-$s[1]*$c[1]; + $disc = ($B)**2 - 4*$A*$C; + } until $disc > 0; + + $x00 = Round((-$B-sqrt($disc))/(2*($A)),3); + $x10 = Round((-$B+sqrt($disc))/(2*($A)),3); +} until $x00 != $x10; +$x0 = min($x00,$x10); +$x1 = max($x00,$x10); +$y0 = Round($f->eval(x=>$x0),3); +$y1 = Round($f->eval(x=>$x1),3); + +$vertexX = -$b[0]/(2*$a[0]); +$vertexY = $f->eval(x=>$vertexX); + +@gr=(); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x0,$x1,0,$vertexX],[$vertexY,$y0,$y1,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..2) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + + add_functions($gr[$i], "$f for x in <$min[0],$max[0]> using color:blue and weight:2"); + add_functions($gr[$i], "$g for x in <$min[0],$max[0]> using color:blue and weight:2"); + $lor0 = $x0<$x1 ? 'left' : 'right'; + $lor1 = $x1<$x0 ? 'left' : 'right'; + $gr[$i]->stamps( closed_circle($x0,$y0,'blue') ); + $gr[$i]->lb( new Label($x0,$y0,"($x0,$y0)", 'blue',$lor0,'bottom')); + $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); + $gr[$i]->lb( new Label($x1,$y1,"($x1,$y1)", 'blue',$lor1,'top')); + $tob = $s[0]>0 ? 'top' : 'bottom'; + $gr[$i]->lb( new Label($vertexX, $vertexY, "g(x)", 'blue', 'center', $tob)); + $tx = $max[0]-$marksep[0]; + $ty = $g->eval(x=>$tx); + $tob = $s[1]*$b[1]>0 ? 'bottom' : 'top'; + $gr[$i]->lb( new Label($tx, $ty, "f(x)", 'blue', 'center', $tob)); + $alt[0] = "This is the graphs of f(x)=$g and g(x)=$f. They intersect at ($x0,$y0) and ($x1,$y1). Those two points are marked and labeled."; +} + +@symbols = ('\gt','\ge','\lt','\le'); +$i0 = random(0,1,1); +$i1 = random(2,3,1); +$symbol0 = $symbols[$i0]; +$symbol1 = $symbols[$i1]; + +$hof0 = $i0==0 ? "hollow" : "solid"; +$hof1 = $i1==2 ? "hollow" : "solid"; + +if ($s[0]>0) { + add_functions($gr[1], "$g for x in <$x0,$x1> using color:red and weight:2"); + add_functions($gr[2], "$g for x in <$min[0],$x0> using color:red and weight:2"); + add_functions($gr[2], "$g for x in <$x1,$max[0]> using color:red and weight:2"); + $alt[1] = $alt[0]." The segment on g(x) from x=$x0 to x=$x1 is highlighted. The points ($x0,$y0) and ($x1,$y1) are $hof0."; + $alt[2] = $alt[0]." The segment on g(x) from negative infinity to x=$x0, and from x=$x1 to infinity are highlighted. The points ($x0,$y0) and ($x1,$y1) are $hof1."; +} else { + add_functions($gr[2], "$g for x in <$x0,$x1> using color:red and weight:2"); + add_functions($gr[1], "$g for x in <$min[0],$x0> using color:red and weight:2"); + add_functions($gr[1], "$g for x in <$x1,$max[0]> using color:red and weight:2"); + $alt[1] = $alt[0]." The segment on g(x) from negative infinity to x=$x0, and from x=$x1 to infinity are highlighted. The points ($x0,$y0) and ($x1,$y1) are $hof0."; + $alt[2] = $alt[0]." The segment on g(x) from x=$x0 to x=$x1 is highlighted. The points ($x0,$y0) and ($x1,$y1) are $hof1."; +} + +if ($i0 == 0) { + $gr[1]->stamps(open_circle($x0,$y0,'red')); + $gr[1]->stamps(open_circle($x1,$y1,'red')); +} else { + $gr[1]->stamps(closed_circle($x0,$y0,'red')); + $gr[1]->stamps(closed_circle($x1,$y1,'red')); +} +if ($i1==2) { + $gr[2]->stamps(open_circle($x0,$y0,'red')); + $gr[2]->stamps(open_circle($x1,$y1,'red')); +} else { + $gr[2]->stamps(closed_circle($x0,$y0,'red')); + $gr[2]->stamps(closed_circle($x1,$y1,'red')); +} + +Context("Interval"); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +if ($s[0]>0) { + $ans3 = ($i0==0) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); + $ans4 = ($i1==2) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); +} else { + $ans3 = ($i0==0) ? Interval("(-inf,$x0)U($x1,inf)") : Interval("(-inf,$x0]U[$x1,inf)"); + $ans4 = ($i1==2) ? Interval("($x0,$x1)") : Interval("[$x0,$x1]"); +} + + + +############################################## + +BEGIN_PGML + +Use technology to solve the following inequalities. + +* Enter *inf* to represent infinity. +* Use capitalized 'U' to represent the union symbol, if needed. + +1. Solve [`[$g] [$symbol0] [$f] \text{.}`] + + [__]{$ans3}{width => 30} + +1. Solve [`[$g] [$symbol1] [$f] \text{.}`] + + [__]{$ans4}{width => 30} + +END_PGML + +############################################################ +# Solution +############################################################ + +$ion0 = $i0==0 ? "not including" : "including"; +$ion1 = $i1==2 ? "not including" : "including"; + +BEGIN_PGML_SOLUTION + +We will use desmos.com to solve this system. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f(x)=[$g] `]. + +Step 3: In the second textbox, enter [` g(x)=[$f] `]. + +Step 4: Zoom in/out on the window, if needed, until you can cearly see the intersections of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +In case you need help, set the [`x`] range to [`[$min[0]],[$max[0]]`] and [`y`] range to [`[$min[1]],[$max[1]]`]. + +Step 4: Click on those two intersections, and desmos shows [`([$x0],[$y0])`] and [`([$x1],[$y1])`]. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +###Question 1 + +To meet the condition of [` [$g] [$symbol0] [$f] `], we must choose [`x`] values in the intervals [`[$ans3]`]. In the following graph, ponts on the red segment(s) of [`f(x)=[$g]`] has [`y`]-values greater than [`g(x)=[$f]`] ([$ion0] those two intersection points). + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +###Question 2 + +To meet the condition of [` [$g] [$symbol1] [$f] `], we must choose [`x`] values in the intervals [`[$ans4]`]. In the following graph, ponts on the red segment(s) of [`f(x)=[$g]`] has [`y`]-values smaller than [`g(x)=[$f]`] ([$ion1] those two intersection points). + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingQuadraticEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingQuadraticEquation10.pg new file mode 100644 index 0000000000..122f4b8eef --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingQuadraticEquation10.pg @@ -0,0 +1,153 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use graphing technology to solve quadratic equation. +# There are two intersections. +# +# Last edited: Yao 1/13/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + do { + $a = non_zero_random(-5,5,0.1); + $b = non_zero_random(-20,20,0.1); + $c = non_zero_random(-20,20,1); + $e = random(30,50,0.1)*random(-1,1,2); + $C = $c-$e; + $d = ($b)**2-4*$a*$C; + } until ( ($d>0) ); + $x0 = (-$b+sqrt($d))/(2*$a); + $x1 = (-$b-sqrt($d))/(2*$a); + $func = Compute("$a*$var**2+$b*$var+$c")->reduce; +} until ( abs($x0-$x1)>20); +$vertexX = -$b/(2*$a); +$vertexY = $func->eval($var=>$vertexX); +$y0 = $e; +$y1 = $e; + +$x0Show = Round($x0,3); +$x1Show = Round($x1,3); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x0,$x1,0,$vertexX],[$vertexY,$e,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + + add_functions($gr, "$func for $var in <$min[0],$max[0]> using color:blue and weight:2"); + add_functions($gr, "$e for $var in <$min[0],$max[0]> using color:blue and weight:2"); + $lor0 = $x0<$x1 ? 'left' : 'right'; + $lor1 = $x1<$x0 ? 'left' : 'right'; + $gr->stamps( closed_circle($x0,$y0,'red') ); + $gr->lb( new Label($x0,$y0,"($x0Show,$y0)", 'red',$lor0,'bottom','small')); + $gr->stamps( closed_circle($x1,$y1,'red') ); + $gr->lb( new Label($x1,$y1,"($x1Show,$y1)", 'red',$lor1,'top','small')); + $alt = "This is the graphs of f($var)=$func and g($var)=$e. They intersect at ($x0Show,$y0) and ($x1Show,$y1). Those two points are marked and labeled."; + + +Context("FiniteSolutionSets"); +Context()->flags->remove("NumberCheck"); +Context()->variables->are($var=>'Real'); +Context()->flags->set( + tolerance => 0.01, + tolType => "absolute", +); +$ans = Formula("{$x0,$x1}"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use graphing technology to solve this equation: + + [`` [$func] = [$e] ``] + +* Write your answers in the format of *[$var]=#*. +* If there are two solutions, use a comma to separate them. + + The equation's solutions are [__________]{$ans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use desmos.com to solve this equation. + +>>[@ image(insertGraph($gr), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt' title= '$alt'" +) @]*<< + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` f([$var])=[$func] `]. + +Step 3: In the second textbox, enter [` y=[$e] `]. + +Step 4: Zoom out on the window, if needed, until you can see the intersections of [`f([$var])`] and [`y`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. In case you need help, set the [`x`] range to [`[$min[0]],[$max[0]]`] and [`y`] range to [`[$min[1]],[$max[1]]`]. + +Step 5: Click on the intersections, and desmos shows the solution [`([$x0Show],[$e])`] and [`([$x1Show],[$e])`]. + +The equation's solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation10.pg index 859d9e4f35..4d25e3d0ca 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation10.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Functions with fractional exponents and radical functions) -## DBsection(Equations) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -73,7 +77,7 @@ $ySolution = $c; $func0 = Compute("sqrt($a-$b*$var)")->reduce; $func1 = Compute("$c")->reduce; -$solution = Compute("$var=$xSolution"); +$solution = Formula("$var=$xSolution"); ############################################## TEXT(beginproblem()); @@ -99,11 +103,11 @@ We will use desmos.com to solve this equation. Step 1: Go to desmos.com, click on Start Graphing. -Step 2: In the first textbox, enter [` f(x)=[$func0] `]. +Step 2: In the first textbox, enter [` f([$var])=[$func0] `]. -Step 3: In the second textbox, enter [` g(x)=[$func1] `]. +Step 3: In the second textbox, enter [` g([$var])=[$func1] `]. -Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f([$var])`] and [`g([$var])`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. Step 5: Click on the intersection, and desmos shows the solution [`([$xSolution],[$ySolution])`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation20.pg index 220b5f1080..9e15b81684 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRadicalEquation20.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Functions with fractional exponents and radical functions) -## DBsection(Equations) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -118,11 +122,11 @@ We will use desmos.com to solve this equation. Step 1: Go to desmos.com, click on Start Graphing. -Step 2: In the first textbox, enter [` f(x)=[$func0] `]. +Step 2: In the first textbox, enter [` f([$var])=[$func0] `]. -Step 3: In the second textbox, enter [` g(x)=[$func1] `]. +Step 3: In the second textbox, enter [` g([$var])=[$func1] `]. -Step 4: Zoom out on the window, if needed, until you can see the intersections of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. +Step 4: Zoom out on the window, if needed, until you can see the intersections of [`f([$var])`] and [`g([$var])`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. Step 5: Click on the intersections, and desmos shows the solution [`([$x0Show],[$y0Show])`] and [`([$x1Show],[$y1Show])`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation10.pg index caf937e304..0c7d7e95cd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Rational equations and functions) -## DBsection(Rational equations) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -70,10 +74,7 @@ $commonD = Formula("$var+$a")->reduce; $left = Formula("$var/($var+$a)")->reduce; $right = Formula("$b")->reduce; -$leftX = Formula("x/(x+$a)")->reduce; -$rightX = Formula("$b")->reduce; - -$ans = Compute("$var=$x"); +$ans = Formula("$var=$x"); $y = $left->eval($var=>$x); ############################################## @@ -100,11 +101,11 @@ We will use desmos.com to solve this equation. Step 1: Go to desmos.com, click on Start Graphing. -Step 2: In the first textbox, enter [` f(x)=[$leftX] `]. Note that we need to replace [`[$var]`] with [`x`]. +Step 2: In the first textbox, enter [` f([$var])=[$left] `]. -Step 3: In the second textbox, enter [` g(x)=[$rightX] `]. +Step 3: In the second textbox, enter [` g([$var])=[$right] `]. -Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`f([$var])`] and [`g([$var])`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. Step 5: Click on the intersection, and desmos shows the solution [`([$x],[$y])`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation20.pg index 27f2f0328a..0a9df68c45 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosSolvingRationalEquation20.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Algebra) -## DBchapter(Rational equations and functions) -## DBsection(Rational equations) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -79,19 +83,15 @@ do { } until ( ($x1>-9) && ($x1<9) && ($x2>-9) && ($x2<9) && ($y1>-9) && ($y1<9) ); Context()->flags->set( - tolerance => 0.0, + tolerance => 0.005, tolType => "absolute", ); - $leftX = Formula("$a/($b*x+$c)")->reduce; - $rightX = Formula("$d*x")->reduce; - -$x1rounded = round($x1*100)/100; -$x2rounded = round($x2*100)/100; -$y1rounded = round($y1*100)/100; - -$ans = List(Formula("$var=$x1rounded"),Formula("$var=$x2rounded")); +$ans = List(Formula("$var=$x1"),Formula("$var=$x2")); +$x1Show = Round($x1,3); +$y1Show = Round($y1,3); +$x2Show = Round($x2,3); ############################################## TEXT(beginproblem()); @@ -102,10 +102,10 @@ Use graphing technology to solve this equation: [`` [$left] = [$right] ``] -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] +* Enter multiple answers separated by commas, such as [`[$var]=1,[$var]=-1`] * Round your answers to two decimal places. - This equation's solutions, _rounded to two decimal places_, are [__________]{$ans}. + This equation's solutions are [__________]{$ans}. END_PGML @@ -117,15 +117,15 @@ We will use desmos.com to solve this equation. Step 1: Go to desmos.com, click on Start Graphing. -Step 2: In the first textbox, enter [` f(x)=[$leftX] `]. Note that we need to replace [`[$var]`] with [`x`]. +Step 2: In the first textbox, enter [` f([$var])=[$left] `]. -Step 3: In the second textbox, enter [` g(x)=[$rightX] `]. +Step 3: In the second textbox, enter [` g([$var])=[$right] `]. -Step 4: Zoom out on the window, if needed, until you can see the intersections of [`f(x)`] and [`g(x)`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. +Step 4: Zoom out on the window, if needed, until you can see the intersections of [`f([$var])`] and [`g([$var])`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. -Step 5: Click on the intersections. Desmos shows the intersections, rounded to two decimal places, are [`([$x1rounded],[$y1rounded])`] and [`([$x2rounded],[$y1rounded])`]. +Step 5: Click on the intersections, and desmos shows the solution [`([$x1Show],[$y1Show])`] and [`([$x2Show],[$y1Show])`]. - Thus the equation's solutions, rounded to two decimal places, are [`[$var] \approx [$x1rounded], [$var] \approx [$x2rounded]`]. + The equation's solutions are [`[$var]=[$x1Show], [$var]=[$x2Show]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosTable10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosTable10.pg new file mode 100644 index 0000000000..0a4b5ef8ed --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosTable10.pg @@ -0,0 +1,184 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "parserMultiAnswer.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context()->noreduce('(-x)+y', '(-x)-y'); +$f = RandomVariableName(type=>'function'); +do { + $a = non_zero_random(-4,4,1); + $b = non_zero_random(-19,19,1); + $c = non_zero_random(-5,5,1); +} until (0 < -$b/(2*$a) and -$b/(2*$a) < 5); +$formula = Compute("$a x^2 + $b*x + $c")->reduce; +@defaultAnswers = (); +for my $i (0..6) { + $x[$i] = $i-2; + $y[$i] = $formula->eval(x=>$x[$i]); + push(@defaultAnswers,$x[$i]); + push(@defaultAnswers,$y[$i]); +} +$multians = MultiAnswer(@defaultAnswers)->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my @sxy = @{$student}; + my @xs, @ys; + for my $k (0..6) + {$xs[$k] = $sxy[2*$k]; + $ys[$k] = $sxy[2*$k+1];} + # + # Loop though the student answers + ## + for ($i = 0; $i <= 6; $i++) { + my $ith = Value::List->NameForNumber($i+1); + # + # Check that the student's answers are Reals + # + Value->Error("Your $ith x-value is not a number") if ($xs[$i]->type ne "Number"); + Value->Error("Your $ith y-value is not a number") if ($ys[$i]->type ne "Number"); + # + # Check that the point hasn't been given before + # + for ($j = 0, $used = 0; $j < $i; $j++) { + my $jth = Value::List->NameForNumber($j+1); + if ($xs[$j] == $xs[$i] and $ys[$j] == $ys[$i]) { + Value->Error("Your $ith row in the table is the same as your $jth row") unless $ansHash->{isPreview}; + $used = 1; last; + } + } + # + # If not already used, check that it satisfies the equation + # and increase the score if so. + # + if (!$used) { + Value->Error("Your $ith row is not correct") unless $ansHash->{isPreview} or $ys[$i] == $formula->eval(x=>$xs[$i]); + } + } + return 1; + } +); + +for my $i (0..6) { +Context()->flags->set(reduceConstants=>0,reduceConstantFunctions=>0); +$rs[$i] = $formula->substitute(x=>$x[$i]); +} + +############################################################ +# Body +############################################################ + +BEGIN_PGML +Use technology to make a table of values for the function. + +[`[$f](x)=[$formula]`] + +>> [@DataTable( + [ + [[PGML('[`x`]'), + midrule => '1', + rowcss => 'border-bottom: 2px solid; ',], + [PGML('[`[$f](x)`]'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + ], + align => 'cc', + center => 0, +);@]* << + +END_PGML + +############################################################ +# Solution +############################################################ + +BEGIN_PGML_SOLUTION + +Go to desmos.com, click on "Start Graphing" button. In the first text box, enter [`[$f](x)=[$formula]`]. + +Then, above the text box (which has the function now), click on the gear icon. If you hover the cursor at the gear icon, it should say "Edit List". + +Once you click on the gear icon, click on the table icon. If you hover the cursor at the table icon, it should say "Convert to Table". + +Now the table is created with some simple [`x`]-values. You can click on the table to add more rows. The table may be completed as: + +>> [@DataTable( + [ + [[PGML('[`x`]'), + midrule => '1', + rowcss => 'border-bottom: 2px solid; ',], + [PGML('[`[$f](x)`]'),], + ], + [[PGML('[`[$x[0]]`]'),], + [PGML('[`[$y[0]]`]'),], + ], + [[PGML('[`[$x[1]]`]'),], + [PGML('[`[$y[1]]`]'),], + ], + [[PGML('[`[$x[2]]`]'),], + [PGML('[`[$y[2]]`]'),], + ], + [[PGML('[`[$x[3]]`]'),], + [PGML('[`[$y[3]]`]'),], + ], + [[PGML('[`[$x[4]]`]'),], + [PGML('[`[$y[4]]`]'),], + ], + [[PGML('[`[$x[5]]`]'),], + [PGML('[`[$y[5]]`]'),], + ], + [[PGML('[`[$x[6]]`]'),], + [PGML('[`[$y[6]]`]'),], + ], + ], + align => 'cc', + center => 0, +);@]* << + +END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosTable20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosTable20.pg new file mode 100644 index 0000000000..40c6daa825 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosTable20.pg @@ -0,0 +1,182 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "parserMultiAnswer.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context()->noreduce('(-x)+y', '(-x)-y'); +$f = RandomVariableName(type=>'function'); + $a = non_zero_random(-12,12,1); + $b = non_zero_random(-200,200,10); + $c = non_zero_random(-100,100,1); +$formula = Compute("$a x^3 + $b*x + $c")->reduce; +@defaultAnswers = (); +for my $i (0..6) { + $x[$i] = $i-2; + $y[$i] = $formula->eval(x=>$x[$i]); + push(@defaultAnswers,$x[$i]); + push(@defaultAnswers,$y[$i]); +} +$multians = MultiAnswer(@defaultAnswers)->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my @sxy = @{$student}; + my @xs, @ys; + for my $k (0..6) + {$xs[$k] = $sxy[2*$k]; + $ys[$k] = $sxy[2*$k+1];} + # + # Loop though the student answers + ## + for ($i = 0; $i <= 6; $i++) { + my $ith = Value::List->NameForNumber($i+1); + # + # Check that the student's answers are Reals + # + Value->Error("Your $ith x-value is not a number") if ($xs[$i]->type ne "Number"); + Value->Error("Your $ith y-value is not a number") if ($ys[$i]->type ne "Number"); + # + # Check that the point hasn't been given before + # + for ($j = 0, $used = 0; $j < $i; $j++) { + my $jth = Value::List->NameForNumber($j+1); + if ($xs[$j] == $xs[$i] and $ys[$j] == $ys[$i]) { + Value->Error("Your $ith row in the table is the same as your $jth row") unless $ansHash->{isPreview}; + $used = 1; last; + } + } + # + # If not already used, check that it satisfies the equation + # and increase the score if so. + # + if (!$used) { + Value->Error("Your $ith row is not correct") unless $ansHash->{isPreview} or $ys[$i] == $formula->eval(x=>$xs[$i]); + } + } + return 1; + } +); + +for my $i (0..6) { +Context()->flags->set(reduceConstants=>0,reduceConstantFunctions=>0); +$rs[$i] = $formula->substitute(x=>$x[$i]); +} + +############################################################ +# Body +############################################################ + +BEGIN_PGML +Use technology to make a table of values for the function. + +[`[$f](x)=[$formula]`] + +>> [@DataTable( + [ + [[PGML('[`x`]'), + midrule => '1', + rowcss => 'border-bottom: 2px solid; ',], + [PGML('[`[$f](x)`]'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + [[PGML('[________]{$multians}'),], + [PGML('[________]{$multians}'),], + ], + ], + align => 'cc', + center => 0, +);@]* << + +END_PGML + +############################################################ +# Solution +############################################################ + +BEGIN_PGML_SOLUTION + +Go to desmos.com, click on "Start Graphing" button. In the first text box, enter [`[$f](x)=[$formula]`]. + +Then, above the text box (which has the function now), click on the gear icon. If you hover the cursor at the gear icon, it should say "Edit List". + +Once you click on the gear icon, click on the table icon. If you hover the cursor at the table icon, it should say "Convert to Table". + +Now the table is created with some simple [`x`]-values. You can click on the table to add more rows. The table may be completed as: + +>> [@DataTable( + [ + [[PGML('[`x`]'), + midrule => '1', + rowcss => 'border-bottom: 2px solid; ',], + [PGML('[`[$f](x)`]'),], + ], + [[PGML('[`[$x[0]]`]'),], + [PGML('[`[$y[0]]`]'),], + ], + [[PGML('[`[$x[1]]`]'),], + [PGML('[`[$y[1]]`]'),], + ], + [[PGML('[`[$x[2]]`]'),], + [PGML('[`[$y[2]]`]'),], + ], + [[PGML('[`[$x[3]]`]'),], + [PGML('[`[$y[3]]`]'),], + ], + [[PGML('[`[$x[4]]`]'),], + [PGML('[`[$y[4]]`]'),], + ], + [[PGML('[`[$x[5]]`]'),], + [PGML('[`[$y[5]]`]'),], + ], + [[PGML('[`[$x[6]]`]'),], + [PGML('[`[$y[6]]`]'),], + ], + ], + align => 'cc', + center => 0, +);@]* << + +END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosWindowView10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosWindowView10.pg new file mode 100644 index 0000000000..129c7f4d69 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosWindowView10.pg @@ -0,0 +1,185 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "parserMultiAnswer.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context("Interval"); +Context()->noreduce('(-x)-y','(-x)+y'); +$m = random(1001,9999,1)*random(-1,1,2); +$b = random(1001,9999,1)*random(-1,1,2); +$func = Formula("$m x + $b")->reduce; +$xInt = Round(-$b/$m,3); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xInt,-$xInt],[$b,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +add_functions($gr, "$func for x in <$min[0],$max[0]> using color:red and weight:1"); + +$gr->stamps( closed_circle($xInt,0,'blue') ); +$lor = $xInt>0 ? 'right' : 'left'; +$gr->lb( new Label($xInt,0,"($xInt,0)", 'blue',$lor,'bottom')); +$gr->stamps( closed_circle(0,$b,'blue') ); +$gr->lb( new Label(0,$b,"(0,$b)", 'blue','left','middle')); + +$alt = "This is the graph of f(x)=$func, with critical points (0,$b) and ($xInt,0) marked and labeled."; + + +#important values to appear in plot +@keypoints = (Point(0,$b),Point($xInt,0)); +@x; +@y; +for my $keypoint (@keypoints) { + push(@x, ($keypoint->value)[0]); + push(@y, ($keypoint->value)[1]); +}; +$x = Interval("[$min[0],$max[0]]"); +$y = Interval("[$min[1],$max[1]]"); +$multians = MultiAnswer($x, $y)->with( + singleResult => 1, + checker => sub { + my ($correct, $student, $self) = @_; + my ($xstu, $ystu) = @{$student}; + my ($xcor, $ycor) = @{$correct}; + my ($xmin,$xmax) = $xstu->value; + my ($ymin,$ymax) = $ystu->value; + #check end points are not infinite + if ($xmin->type eq 'Infinity' or $xmax->type eq 'Infinity' or $ymin->type eq 'Infinity' or $ymax->type eq 'Infinity') + {Value::Error("The dimensions of a viewing window cannot be infinite.");} + my @errors; + #Check important points are all present; + for my $keypoint (@keypoints) { + if (!$xstu->contains(($keypoint->value)[0]) or !$ystu->contains(($keypoint->value)[1]) ) { + push(@errors,"Your viewing window does not contain the important point $keypoint."); + } + } + #Check important points are not right on the boundary; + my %xbounds = map { $_ => 1 } ($xmin,$xmax); + my %ybounds = map { $_ => 1 } ($ymin,$ymax); + for my $keypoint (@keypoints) { + if (exists($xbounds{($keypoint->value)[0]}) or exists($ybounds{($keypoint->value)[1]})) { + push(@errors,"The important point $keypoint is on the border of your viewing window."); + } + } + if (@errors) { + Value::Error(join("$BR",@errors)); + } + #At this point, if for each of the four edges, some key point is within 20% of that edge, + #call it good. This may leave other key points appearing very close together. + my $xstudiameter = $xmax - $xmin; + my $ystudiameter = $ymax - $ymin; + my ($rightOK, $topOK, $leftOK, $bottomOK) = (0,0,0,0); + for my $keypoint (@keypoints) { + if (Interval($xmax-0.2*$xstudiameter,$xmax)->contains(($keypoint->value)[0])) { + $rightOK = 1; + } + if (Interval($ymax-0.2*$ystudiameter,$ymax)->contains(($keypoint->value)[1])) { + $topOK = 1; + } + if (Interval($xmin,$xmin+0.2*$xstudiameter)->contains(($keypoint->value)[0])) { + $leftOK = 1; + } + if (Interval($ymin,$ymin+0.2*$ystudiameter)->contains(($keypoint->value)[1])) { + $bottomOK = 1; + } + } + if ($rightOK and $topOK and $leftOK and $bottomOK) + {return 1}; + #Check important points are not visually too close together; + #For a 160x100-pixel TI-89, we ask for at least two pixels of separation + #using the taxicab metric + for my $keypoint1 (@keypoints) { + for my $keypoint2 (@keypoints) { + if ($keypoint1 != $keypoint2 and abs((($keypoint1->value)[0]-($keypoint2->value)[0])/($xmax - $xmin))*160 + abs((($keypoint1->value)[1]-($keypoint2->value)[1])/($ymax - $ymin))*100 < 2) { + Value::Error("Your viewing window makes the important points $keypoint1 and $keypoint2 appear too close together."); + } + } + } + #Check that the plot doesn't have the appearance of vertical lines; + #For a 160-pixel wide TI-89, we ask for at least four pixels of separation + @xentry=(($ymin-$b)/$m, ($ymax-$b)/$m); + for my $xval1 (@xentry) { + for my $xval2 (@xentry) { + if ($xval1 != $xval2 and abs(($xval1 - $xval2)/($xmax - $xmin)) < 3/160) { + Value::Error('Your viewing window makes it appear like a vertical or almost vertical line is part of the plot'); + } + } + } + return 1; + } +); + +############################################################ +# Body +############################################################ + +BEGIN_PGML +Let [`f(x)=[$func]\text{.}`] Choose an appropriate window for graphing [`f`] that shows its key features. + +[@KeyboardInstructions(q?Use interval notation. Many answers are possible.?)@]** + +The [`x`]-interval could be [__]{$multians}{width => 20} and the [`y`]-interval could be [__]{$multians}{width => 20}. + +END_PGML + +############################################################ +# End Problem +############################################################ + + +BEGIN_PGML_SOLUTION + +Go to desmos.com, click on Starting Graphing, enter the function [`f(x)=[$func]`] into the first text box. + +You can see the line's [`x`]-intercept, but not the [`y`]-intercept. Those two intercepts are the function's critical points. After zooming out a few times, you can tell the graph would be very ugly if you want to see the function's [`y`]-intercept simply by zooming out. + +Next, observe the function's equation: [`f(x)=[$func]`]. The [`y`]-intercept is [`(0,[$b])`]. Instead of keep zooming out, click on the wrench icon (Graph Settings) on the top right corner, and enter values for a window. For example, you can use [`[$x]`] for the range of [`x`], and [`[$y]`] for the range of [`y`]. Now you can see the linear function's [`x`]-intercept and [`y`]-intercept. + +Click on those two points, you can see they are [`(0,[$b])`] and [`([$xInt],0)`]. + +You should see a graph similar to this: + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosWindowView20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosWindowView20.pg new file mode 100644 index 0000000000..f5266dcf38 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/DesmosWindowView20.pg @@ -0,0 +1,198 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "parserMultiAnswer.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context("Interval"); +Context()->noreduce('(-x)-y','(-x)+y'); +do { + do { + $a = random(0.001,0.005,0.0001)*random(-1,1,2); + $b = random(10,50,1)*random(-1,1,2); + $c = random(1000,5000,1)*random(-1,1,2); + $d = ($b)**2-4*$a*$c; + } until ($d > 0); + $xInt1 = Round((-$b-sqrt($d))/(2*$a),3); + $xInt2 = Round((-$b+sqrt($d))/(2*$a),3); +} until ($xInt2-$xInt1)>10000; +$func = Formula("$a x^2 + $b x + $c")->reduce; +$vertexX = Round(-$b/(2*$a),3); +$vertexY = Round($func->eval(x=>$vertexX),3); +#important values to appear in plot +@keypoints = (Point(0,$c), Point($vertexX,$vertexY), Point($xInt1,0), Point($xInt2,0) ); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xInt1,$xInt2,100,-100],[$c,$vertexY,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +add_functions($gr, "$func for x in <$min[0],$max[0]> using color:red and weight:1"); + + +$gr->stamps( closed_circle($xInt1,0,'blue') ); +$gr->lb( new Label($xInt1,0,"($xInt1,0)", 'blue','center','bottom')); +$gr->stamps( closed_circle($xInt2,0,'blue') ); +$gr->lb( new Label($xInt2,0,"($xInt2,0)", 'blue','center','bottom')); +$gr->stamps( closed_circle(0,$c,'blue') ); +$gr->stamps( closed_circle($vertexX,$vertexY,'blue') ); +$TB = ($a>0) ? 'top' : 'bottom'; +$gr->lb( new Label($vertexX,$vertexY,"($vertexX,$vertexY)", 'blue','center',$TB)); + +$alt = "This is the graph of f(x)=$func, with critical points ($xInt1,0), ($xInt2,0), (0,$c) and ($vertexX,$vertexY) marked and labeled."; + +@x; +@y; +for my $keypoint (@keypoints) { + push(@x, ($keypoint->value)[0]); + push(@y, ($keypoint->value)[1]); +}; + +$x = Interval("[$min[0],$max[0]]"); +$y = Interval("[$min[1],$max[1]]"); +$multians = MultiAnswer($x, $y)->with( + singleResult => 1, + checker => sub { + my ($correct, $student, $self) = @_; + my ($xstu, $ystu) = @{$student}; + my ($xcor, $ycor) = @{$correct}; + my ($xmin,$xmax) = $xstu->value; + my ($ymin,$ymax) = $ystu->value; + #check end points are not infinite + if ($xmin->type eq 'Infinity' or $xmax->type eq 'Infinity' or $ymin->type eq 'Infinity' or $ymax->type eq 'Infinity') + {Value::Error("The dimensions of a viewing window cannot be infinite.");} + my @errors; + #Check important points are all present; + for my $keypoint (@keypoints) { + if (!$xstu->contains(($keypoint->value)[0]) or !$ystu->contains(($keypoint->value)[1]) ) { + push(@errors,"Your viewing window does not contain the important point $keypoint."); + } + } + #Check important points are not right on the boundary; + my %xbounds = map { $_ => 1 } ($xmin,$xmax); + my %ybounds = map { $_ => 1 } ($ymin,$ymax); + for my $keypoint (@keypoints) { + if (exists($xbounds{($keypoint->value)[0]}) or exists($ybounds{($keypoint->value)[1]})) { + push(@errors,"The important point $keypoint is on the border of your viewing window."); + } + } + if (@errors) { + Value::Error(join("$BR",@errors)); + } + #At this point, if for each of the four edges, some key point is within 20% of that edge, + #call it good. This may leave other key points appearing very close together. + my $xstudiameter = $xmax - $xmin; + my $ystudiameter = $ymax - $ymin; + my ($rightOK, $topOK, $leftOK, $bottomOK) = (0,0,0,0); + for my $keypoint (@keypoints) { + if (Interval($xmax-0.2*$xstudiameter,$xmax)->contains(($keypoint->value)[0])) { + $rightOK = 1; + } + if (Interval($ymax-0.2*$ystudiameter,$ymax)->contains(($keypoint->value)[1])) { + $topOK = 1; + } + if (Interval($xmin,$xmin+0.2*$xstudiameter)->contains(($keypoint->value)[0])) { + $leftOK = 1; + } + if (Interval($ymin,$ymin+0.2*$ystudiameter)->contains(($keypoint->value)[1])) { + $bottomOK = 1; + } + } + if ($rightOK and $topOK and $leftOK and $bottomOK) + {return 1}; + #Check important points are not visually too close together; + #For a 160x100-pixel TI-89, we ask for at least two pixels of separation + #using the taxicab metric + for my $keypoint1 (@keypoints) { + for my $keypoint2 (@keypoints) { + if ($keypoint1 != $keypoint2 and abs((($keypoint1->value)[0]-($keypoint2->value)[0])/($xmax - $xmin))*160 + abs((($keypoint1->value)[1]-($keypoint2->value)[1])/($ymax - $ymin))*100 < 2) { + Value::Error("Your viewing window makes the important points $keypoint1 and $keypoint2 appear too close together."); + } + } + } + #Check that the plot doesn't have the appearance of vertical lines; + #For a 160-pixel wide TI-89, we ask for at least four pixels of separation + + if ($a > 0) { + @xentry = ((-$b-sqrt($b**2 - 4*$a*($c-$ymax)))/(2*$a), (-$b+sqrt($b**2 - 4*$a*($c-$ymax)))/(2*$a)); + } + else { + @xentry = ((-$b-sqrt($b**2 - 4*$a*($c-$ymin)))/(2*$a), (-$b+sqrt($b**2 - 4*$a*($c-$ymin)))/(2*$a)); + } + for my $xval1 (@xentry) { + for my $xval2 (@xentry) { + if ($xval1 != $xval2 and abs(($xval1 - $xval2)/($xmax - $xmin)) < 3/160) { + Value::Error('Your settings make it appear like a vertical or almost vertical line is part of the plot'); + } + } + } + return 1; + } +); + +############################################################ +# Body +############################################################ + +BEGIN_PGML +Let [`f(x)=[$func]\text{.}`] Choose an appropriate window for graphing [`f`] that shows its key features. + +[@KeyboardInstructions(q?Use interval notation. Many answers are possible.?)@]** + +The [`x`]-interval could be [__]{$multians}{width => 20} and the [`y`]-interval could be [__]{$multians}{width => 20}. + +END_PGML + +############################################################ +# End Problem +############################################################ + +BEGIN_PGML_SOLUTION + +Go to desmos.com, click on Starting Graphing, enter the function [`f(x)=[$func]`] into the first text box. + +Continue to zoom out until you can see the parabola's two [`x`]-intercepts, [`y`]-intercept and vertex. Those are the function's critical points. You can further adjust your window to get a closer and better view of those points. + +In case you are stuck, you could click on the wrench icon on the top right (Graph Settings) and set the range for [`x`] to [`[$min[0]],[$max[0]]`] and the range for [`y`] to [`[$min[1]],[$max[1]]`]. You should see a graph similar to this: + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics10.pg new file mode 100644 index 0000000000..9add3b830a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics10.pg @@ -0,0 +1,81 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using a scientific calculator. +# Differentiate between minus sign and negative sign. +# +# Last edited: Yao 11/10/17 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a=random(1,5,1); +$b=random(1,5,1); +$ans=-$a-$b; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +The purpose of this problem is to differentiate between the negative symbol and the subtraction symbol. + +Use a scientific calculator to evaluate this expression: + + [`` -[$a]-[$b] ``] = [__________]{$ans} + +END_PGML + +############################################## + +$wrong = $a*$b; + +BEGIN_PGML_SOLUTION + +On your scientific calculator, there is a button for the subtraction symbol, and another button for the negative symbol. They are different! + +For this problem, we should first use the negative symbol to input [`-[$a]`], and then use the subtraction symbol for [`-[$b]`]: + + [``^{-}[$a]-[$b]``] + +and we would get the correct answer, [`[$ans]`]. + +If you use the subtraction symbol for [`-[$a]`], most likely, the calculator will assume you will subtract something from the last answer, and either "ans" or "ans(1)" would automatically pop up in the input line, even though you don't need it. + +Now, use the negative symbol for both symbols: [` ^{-}[$a]^{-}[$b] `]. The calculator would interpret this expression as [`(-[$a])\cdot(-[$b]) `], and we would get [`[$wrong]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics20.pg new file mode 100644 index 0000000000..7e2594a556 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics20.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using a scientific calculator. +# Using parenthesis in cases like 1+(-3)^2 +# +# Last edited: Yao 11/10/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a=random(1,5,1); +$b=random(1,5,1); +$ans=$a+(-$b)**2; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a scientific calculator to evaluate this expression: + + [`` [$a]+(-[$b])^2 ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +For this problem, we may not ignore the parentheses. + +We should enter [` [$a]+(^{-}[$b]) \wedge 2 `] + +If we entered [` [$a]+^{-}[$b] \wedge 2 `], we would get an incorrect answer, because + + [`` +\begin{aligned}[t] + (-[$b])^{2}=[$b*$b] \\ + -[$b]^{2}=-[$b*$b] +\end{aligned} + ``] + +Actually, this is not a calculator issue. The difference above is because of order of operations. + +In [` -[$b]^{2}=-[$b*$b] `] , exponent overrides the negative symbol, and thus we have [` -[$b]^{2}=-[$b]\cdot[$b]=-[$b*$b] `]. + +In [` (-[$b])^{2}=[$b*$b] `], parentheses override exponent, so we have: [` (-[$b])^{2}=(-[$b])(-[$b])=[$b*$b] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics30.pg new file mode 100644 index 0000000000..edbedc7196 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics30.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using a scientific calculator +# Using parenthesis in cases like 6/(1+2). +# +# Last edited: Yao 11/10/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$den = random(4,9,1); +$ans = random(1,9,1); +$num = $den*$ans; +$a = random(1,$den-1,1); +$b = $den-$a; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a scientific calculator to evaluate this expression: + + [`` \frac{[$num]}{[$a]+[$b]} ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When we input a fraction into a scientific calculator, we must know when to add an extra pair of parentheses around the numerator and/or the denominator. + +Here is what we should input: + + [`` [$num]/([$a]+[$b]) ``] + +and we would get the correct answer, [`[$ans]`]. + +If we forgot to input the parentheses, + + [`` [$num]/[$a]+[$b] ``] + +the calculator would follow the order of operations and do division first, as: + + [`` \frac{[$num]}{[$a]}+[$b] ``] + +and the answer would be incorrect. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics40.pg new file mode 100644 index 0000000000..f3d2162f07 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics40.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using a scientific calculator. +# Using parenthesis in cases like (3+9)/2. +# +# Last edited: Yao 11/10/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$den = random(2,9,1); +$ans = random(1,9,1); +$num = $den*$ans; +$a = random(1,$num-1,1); +$b = $num-$a; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a scientific calculator to evaluate this expression: + + [`` \frac{[$a]+[$b]}{[$den]} ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When we input a fraction into a scientific calculator, we must know when to add an extra pair of parentheses around the numerator and/or the denominator. + +Here is what we should input: + + [`` ([$a]+[$b])/[$den] ``] + +and we would get the correct answer, [`[$ans]`]. + +If we forgot to input the parentheses, + + [`` [$a]+[$b]/[$den] ``] + +the calculator would follow the order of operations and do division first, as: + + [`` [$a]+\frac{[$b]}{[$den]} ``] + +and the answer would be incorrect. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics50.pg new file mode 100644 index 0000000000..59f848594d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics50.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using a scientific calculator. +# Using parenthesis in cases like 6/(2*3). +# +# Last edited: Yao 11/10/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a = random(2,5,1); +$b = random(2,5,1); + +$den = $a*$b; +$ans = random(1,9,1); +$num = $den*$ans; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a scientific calculator to evaluate this expression: + + [`` \frac{[$num]}{[$a]\cdot[$b]} ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When we input a fraction into a scientific calculator, we must know when to add an extra pair of parentheses around the numerator and/or the denominator. + +Here is what we should input: + + [`` [$num]/([$a] * [$b]) ``] + +and we would get the correct answer, [`\frac{[$num]}{[$den]}=[$ans]`]. + +If we forgot to input the parentheses, + + [`` [$num]/[$a] * [$b] ``] + +the calculator would follow the order of operations and do division first, as: + + [`` \frac{[$num]}{[$a]}\cdot[$b] ``] + +and the answer would be incorrect. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics60.pg new file mode 100644 index 0000000000..44956e804a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics60.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using a scientific calculator. +# Using parenthesis in cases like (1/2)/(3/4) +# +# Last edited: Yao 11/10/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFraction"); +Context()->flags->set(showMixedNumbers=>0); + +$num1=random(1,5,1); +do {$den1=random(2,5,1);} until (gcd($num1,$den1)==1); +$frac1 = Fraction($num1,$den1); +$num2=random(2,5,1); +do {$den2=random(2,5,1);} until (gcd($num2,$den2)==1); +$frac2 = Fraction($num2,$den2); + +$ans = $frac1/$frac2; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a scientific calculator to evaluate this expression: + + [`` \frac{[$frac1]}{[$frac2]} ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When we input a fraction into a scientific calculator, we must know when to add an extra pair of parentheses around the numerator and/or the denominator. + +Here is what we should input: + + [`` [$num1]/[$den1]/([$num2]/[$den2]) ``] + +or + + [`` ([$num1]/[$den1])/([$num2]/[$den2]) ``] + +and we would get the correct answer, [` [$ans]`]. + +If we forgot to input the parentheses, + + [`` [$num1]/[$den1]/[$num2] / [$den2] ``] + +the calculator would follow the order of operations and do division three times, as: + + [`` [$num1]\div[$den1]\div [$num2] \div [$den2] ``] + +and the answer would be incorrect. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics70.pg new file mode 100644 index 0000000000..16256afc9b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics70.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using a scientific calculator. +# Evaluate 2^(1+1). +# +# Last edited: Yao 11/10/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a = random(2,4,1); +$b = random(1,3,1); +$c = random(1,3,1); +$ans = $a**($b+$c); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a scientific calculator to evaluate this expression: + + [`` [$a]^{[$b]+[$c]} ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We need to add a pair of parentheses around [`[$b]+[$c]`]. + +The correct way to enter this expression is: + + [`` [$a] \wedge ([$b]+[$c]) ``] + +and we would get the correct answer: [`[$a]^{[$b+$c]}=[$ans]`]. + +If we forget the parentheses and type in: + + [`` [$a] \wedge [$b]+[$c] ``] + +the calculator would follow the order of operations, and do + + [`` [$a]^{[$b]}+[$c] ``] + +to give a wrong solution. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics80.pg new file mode 100644 index 0000000000..1975c6ec9a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics80.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using a scientific calculator. +# Using parenthesis in cases like sqrt(4)+2 +# +# Last edited: Yao 5/17/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a=list_random(1,4,9,16,25); +$b=random(1,5,1); +$ans=sqrt($a)+$b; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a scientific calculator to evaluate this expression: + + [`` \sqrt{[$a]}+[$b]``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When we use a function (like the square root function) in a scientific calculator, we must know where to enter the closing parenthesis. + +For this problem, we should enter + + [`` \sqrt{\enspace} ([$a])+[$b] ``] + +If we didn't close the parentheses in the wrong place, like + + [`` \sqrt{\enspace} ([$a]+[$b]) ``] + +The answer would be wrong. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics90.pg new file mode 100644 index 0000000000..10cd4396ac --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorBasics90.pg @@ -0,0 +1,73 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Teaching basics of using a scientific calculator. +# How to get decimal answers in a scientific calculator. +# +# Last edited: Yao 11/10/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do {$num = random(1,10,1); +$den = list_random(2,4,5,8);} until (gcd($num,$den)==1); +$ans = $num/$den; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Use a scientific calculator to evaluate this expression, and express the answer in *decimals*. Don't round your answers. + + [`` [$num] \div [$den] ``] = [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By default, a scientific calculator gives accurate answers, like fractions. If we simply input [` [$num]/[$den] `], we would get [` \frac{[$num]}{[$den]} `] as the answer. + +For TI-30, to convert a fraction to a decimal (or the other way), use the *2nd* button to reach the *F<>D* function, and the press the equal button. + +For Casio scientific calculators, to convert a fraction to a decimal (or the other way), simply press the *S<=>D* button. + +If you are using a different model, use Google to figure out how to convert a fraction to a decimal. + +We could change a calculator's settings to always give decimal answers. However, in most cases, we do need accurate answers. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorEstimateRadical10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorEstimateRadical10.pg new file mode 100644 index 0000000000..1b956574e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorEstimateRadical10.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the value of 2^(3/2) with a calculator +# +# +# Last updated: Yao 02/05/16 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("LimitedNumeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "relative", +); + +$m = random(10,100,1); +do { + $num = random(2,9,1); + $den = random(2,9,1); +} until (gcd($num,$den)==1); + +$ans = Compute($m**($num/$den)); + + +############################################## + + +BEGIN_PGML + +Find this expression's value with a scientific calculator. Round your answer to two or more decimal places. + + [``\sqrt[[$den]]{[$m]^{[$num]}}``] + + [__________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Most scientific calculators have a "square root" button. To enter a more complex radical, we need to change the radical to an expression with a rational exponent. For this example, we have: + + [`` \sqrt[[$den]]{[$m]^{[$num]}} = [$m]^{\frac{[$num]}{[$den]}} ``] + +Now, we can enter this expression as [`[$m]`]^[`([$num]/[$den])`], and then change the answer to a decimal if needed. The correct answer is [`[$ans]`]. + +Note that the parenthesis around [`([$num]/[$den])`] cannot be omited. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorEstimateRadical20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorEstimateRadical20.pg index 3decab7b44..2eba5f9ee1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorEstimateRadical20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Calculator/ScientificCalculatorEstimateRadical20.pg @@ -1,7 +1,3 @@ -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Estimation) -## MLT(calculator-estimate-radical) # WeBWorK problem written by Carl Yao # Portland Community College # diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations10.pg index 96d56ec0db..8f3002b4a7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations10.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.7.a') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Inequalities) -## Institution(PCC) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(inequality_fractions) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('compare','negative','fraction') +## DBCCSS('6.NS.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') #This command starts the problem. DOCUMENT(); @@ -27,12 +28,12 @@ DOCUMENT(); #This section loads any and all .pl files that contain useful subroutines for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "contextFraction.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -52,22 +53,20 @@ Context("Fraction"); $frac1 = Fraction($a, $b); $frac2 = Fraction($c, $d); -Context()->strings->add('<'=>{},'>'=>{},'='=>{}); - if($frac1 < $frac2) { - $answer = String('<'); - $popup = PopUp(["?", $LTS, $GTS, "="], $LTS); + $answer = '<'; + $popup = PopUp(["?", '<', '>', "="], '<'); } elsif($frac1 > $frac2) { - $answer = String('>'); - $popup = PopUp(["?", $LTS, $GTS, "="], $GTS); + $answer = '>'; + $popup = PopUp(["?", '<', '>', "="], '>'); } else { - $answer = String('='); - $popup = PopUp(["?", $LTS, $GTS, "="], "="); + $answer = '='; + $popup = PopUp(["?", '<', '>', "="], "="); } $pos_a = -$a; @@ -78,6 +77,7 @@ $pos_numer_right = $pos_c * $lcd / $d; $neg_numer_left = $a * $lcd / $b; $neg_numer_right = $c * $lcd / $d; + ########Begin What the Student Sees############ TEXT(beginproblem()); @@ -86,20 +86,12 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement. +Choose [`<`], [`>`], or [`=`] to make a true statement. - [``-\frac{[$pos_a]}{[$b]}``] [@$popup->menu()@]* [``-\frac{[$pos_c]}{[$d]}``] + [``-\frac{[$pos_a]}{[$b]}``] [__]{$popup} [``-\frac{[$pos_c]}{[$d]}``] END_PGML -########Begin more complicated answer processing (if needed)############ - -ANS( $popup->cmp(correct_ans_latex_string => $answer) ); - -########Begin answer hints.############ - -#Not used in this template. For the PCC coding projects, I think that this feature will rarely be used the first go-around. - ########Begin solution.############ #The walk-through solution is presented to students after the due date, and may soon also be used with a "show me how to do this" button that gives a walk-through for a similar but randomly generated problem. @@ -111,11 +103,15 @@ denominator, the problem becomes [``-\frac{[$pos_numer_left]}{[$lcd]}\; \fbox{?}\; {-\frac{[$pos_numer_right]}{[$lcd]}}``] -and we now need to compare numerators. Since [`[$neg_numer_left]`] [`[$answer]`] [`[$neg_numer_right]`], we conclude that +and we now need to compare numerators. Since [`[$neg_numer_left] [$answer] [$neg_numer_right]`], we conclude that -[``-\frac{[$pos_a]}{[$b]}``] [``{\bf [$answer]}``] [``-\frac{[$pos_c]}{[$d]}``]. +[``-\frac{[$pos_a]}{[$b]} [$answer] -\frac{[$pos_c]}{[$d]}``]. END_PGML_SOLUTION + + + + ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations20.pg index 66969c2ac4..e7dc5e9c79 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations20.pg @@ -7,18 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('compare','fraction','add','divide') ## DBCCSS('6.NS.7.a') ## DBCCSS('') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Inequalities) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(inequality_fractions2) -## MLTleader(1) -## Level(2) -## MO(1) -## KEYWORDS('compare','fraction','add','divide') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -27,12 +28,12 @@ DOCUMENT(); #This section loads any and all .pl files that contain useful subroutines for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "contextFraction.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -142,8 +143,7 @@ First, we evaluate the left side. Note that a common denominator of [`[$b]`] and \begin{aligned}[t] \frac{[$a]}{[$b]} + \frac{[$c]}{[$d]} &= \frac{[$s1]}{[$com]} + \frac{[$s2]}{[$com]} \\ - &= \frac{[$s3]}{[$com]} \\ - [$output1] + &= \frac{[$s3]}{[$com]} \\ [$output1] \end{aligned} ``] @@ -153,8 +153,7 @@ Next, we evaluate the right side. \begin{aligned}[t] \frac{[$e]}{[$f]} \div \frac{[$g]}{[$h]} &= \frac{[$e]}{[$f]} \cdot \frac{[$h]}{[$g]} \\ - &= \frac{[$s4]}{[$s5]} \\ - [$output2] + &= \frac{[$s4]}{[$s5]} \\ [$output2] \end{aligned} ``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations30.pg index cf604fc4eb..16f3810c19 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations30.pg @@ -8,17 +8,19 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('compare','negative','fraction') ## DBCCSS('6.NS.7.a') ## DBCCSS('') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Inequalities) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(inequality_fractions2) -## Level(2) -## MO(1) -## KEYWORDS('compare','negative','fraction') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -27,12 +29,12 @@ DOCUMENT(); #This section loads any and all .pl files that contain useful subroutines for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "contextFraction.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers10.pg index f61ae8dbb4..1f2c8aa532 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers10.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(inequality_fractions) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','compare','negative') +## DBCCSS('4.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -31,7 +34,7 @@ loadMacros( "PGML.pl", "contextFraction.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,7 +50,7 @@ $frac = Fraction(-$num,$den); $integer = int($frac); -$popup = PopUp(['?', $LTS, $GTS, '='], $LTS); +$popup = PopUp(['?', "<", ">", '='], "<"); @@ -57,7 +60,7 @@ TEXT(beginproblem()); BEGIN_PGML -Compare these two numbers: +Choose [`<`], [`>`], or [`=`] to make a true statement. [``[$frac]``] [@$popup->menu()@]* [``[$integer]``] @@ -74,7 +77,7 @@ When we compare two negative numbers, it helps us understand if we put both numb In this case, [`[$integer]`] is located to the right of [`[$frac]`] on a number line, so [`[$integer]`] is greater than [`[$frac]`]. -If you have trouble differentiate between [$GTS] and [$LTS], remember this trick: The alligator eats the bigger number. That's why we write [`2[$GTS]1`], or [`1[$LTS]2`]. +If you have trouble differentiate between > and <, remember this trick: The alligator eats the bigger number. That's why we write [`2>1`], or [`1<2`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers20.pg index 28ae4a9649..aebaced428 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers20.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(inequality_fractions) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','compare','negative') +## DBCCSS('4.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -31,7 +34,7 @@ loadMacros( "PGML.pl", "contextFraction.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,7 +60,7 @@ TEXT(beginproblem()); BEGIN_PGML -Compare these two numbers: +Choose [`<`], [`>`], or [`=`] to make a true statement. [``[$frac]``] [@$popup->menu()@]* [``[$integer]``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers30.pg index 21fa90e48c..199a85c218 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers30.pg @@ -8,18 +8,21 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.7') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Absolute value inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','compare','absolute value') +## DBCCSS('6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + -## MLT(comparisionAbsoluteValues) -## MLTleader(1) ############################################## @@ -31,7 +34,7 @@ loadMacros( "PGML.pl", "contextFraction.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -74,9 +77,9 @@ TEXT(beginproblem()); BEGIN_PGML -Compare the following numbers: +Choose [`<`], [`>`], or [`=`] to make a true statement. - [`` \left| [$frac] \right| ``] [@$popup->menu()@]* [`` |[$deci]| ``] + [`` \left\lvert [$frac] \right\rvert ``] [@$popup->menu()@]* [`` \left\lvert [$deci] \right\rvert ``] END_PGML @@ -100,3 +103,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers40.pg index 636323713b..03c8c8106e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers40.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') ## KEYWORDS('compare','negative') +## DBCCSS('4.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,8 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "parserRadioButtons.pl", - "PGcourse.pl" + "parserPopUp.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +49,8 @@ $false = 'False'; if ($num1 >= $num2) {$ans = $true;} else {$ans = $false}; -$radio = RadioButtons( - [$true,$false], +$popup = PopUp( + ['?',$true,$false], $ans, # correct answer last => [$false], # can be a list ); @@ -62,16 +65,10 @@ BEGIN_PGML True or false? - [``[$num1] \ge [$num2]``] + [``[$num1] \ge [$num2]``] [__]{$popup} END_PGML -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} -END_TEXT - -ANS( $radio->cmp() ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberBasics10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberBasics10.pg index 5dc1fddc55..e8d3d66d92 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberBasics10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberBasics10.pg @@ -8,24 +8,23 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Complex analysis) -## DBchapter(Arithmetic) -## DBsection(Powers and roots) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('solve','quadratic','equation','complex','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "answerHints.pl", - "PGML.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberBasics20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberBasics20.pg index 70219764f3..68456d7f36 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberBasics20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberBasics20.pg @@ -8,25 +8,24 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Complex analysis) -## DBchapter(Arithmetic) -## DBsection(Powers and roots) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('solve','quadratic','equation','complex','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "answerHints.pl", - "PGML.pl", - "contextLimitedRadical.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberBasics30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberBasics30.pg new file mode 100644 index 0000000000..f52ecccebf --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberBasics30.pg @@ -0,0 +1,76 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +#Rewrite the expression with i, like 2+\sqrt(-8) +# +# +# Last updated: Carl Yao 10/16/14 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('solve','quadratic','equation','complex','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$out = list_random(2, 3, 5, 7); +do {$in = list_random(2, 3, 5, 7);} until ($in!=$out); +$rad = $out*$out*$in; + +$a = list_random(2, 3, 5, 7)*random(-1,1,2); + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->variables->add(i=>'Real'); + +$ans = Formula("$a+$out*i*sqrt($in)"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Re-write the following expressions with *i*. Use *sqrt( )* to represent the square root symbol. + + [`` [$a]+\sqrt{-[$rad]}= ``][___________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The square root of a negative number is a complex number. Recall that [` \sqrt{-1}=i `]. This problem's full solution is: + + [`` +\begin{aligned} + [$a] + \sqrt{-[$rad]} + &= [$a] + \sqrt{[$rad]} \cdot \sqrt{-1} \\ + &= [$a] + \sqrt{[$out]\cdot[$out]\cdot[$in]} \cdot i \\ + &= [$a] + [$out]i \cdot \sqrt{[$in]} +\end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations10.pg new file mode 100644 index 0000000000..ba85cf71c2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations10.pg @@ -0,0 +1,76 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Adding complex numbers +# +# +# Last updated: Carl Yao 10/16/14 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('complex','add') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedComplex"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a0 = non_zero_random(-12,12,1); +$b0 = non_zero_random(-12,12,1); +$a1 = non_zero_random(-12,12,1); +$b1 = non_zero_random(-12,12,1); + +$ansA = $a0+$a1; +$ansB = $b0+$b1; + +$p = Compute("$a0+$b0 i"); +$q = Compute("$a1+$b1 i"); + +$ans = Compute("$ansA+$ansB*i")->reduce; + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Add up the following complex numbers: + + [`` ([$p])+([$q]) = ``][___________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + &\phantom{{}=} ([$a0]+[$b0]i)+([$a1]+[$b1]i) \\ + &= ([$a0]+[$a1]) + ([$b0]+[$b1])i \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations100.pg index 6c8cdea48f..df69b85f9e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations100.pg @@ -8,33 +8,31 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Complex analysis) -## DBchapter(Arithmetic) -## DBsection(Division) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('complex','multiply','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "answerHints.pl", - "PGML.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## -Context("Numeric"); +Context("LimitedComplex"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); Context()->noreduce('(-x)-y','(-x)+y'); -Context()->variables->add(i=>'Real'); do { $a0 = non_zero_random(-12,12,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations110.pg index 0328f0e08f..da3b1b2d0f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations110.pg @@ -9,34 +9,33 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Complex analysis) -## DBchapter(Arithmetic) -## DBsection(Division) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('complex','multiply','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "answerHints.pl", - "PGML.pl", - "PCCmacros.pl", - "contextFraction.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "PGcourse.pl", ); ############################################## -Context("Numeric"); +Context("LimitedComplex"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0); -Context()->variables->add(i=>'Real'); $a=1; $b=2; @@ -56,7 +55,7 @@ do { $denB = ($a1**2+$b1**2); } until ( (gcd($a0*$a1+$b0*$b1,$a1**2+$b1**2)==1) && (gcd($b0*$a1-$a0*$b1,$a1**2+$b1**2)==1) ); -$ans = Compute("$numA/$denA+$numB/$denB*i"); +$ans = Formula("$numA/$denA+$numB/$denB*i"); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations20.pg new file mode 100644 index 0000000000..aa5186c314 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations20.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Subtracting complex numbers +# +# +# Last updated: Carl Yao 10/16/14 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('complex','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedComplex"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a0 = non_zero_random(-12,12,1); +$b0 = non_zero_random(-12,12,1); +$a1 = non_zero_random(-12,12,1); +$b1 = non_zero_random(-12,12,1); + +$ansA = $a0-$a1; +$ansB = $b0-$b1; + +$p = Compute("$a0+$b0 i"); +$q = Compute("$a1+$b1 i"); + +$ans = Compute("$ansA+$ansB*i")->reduce; + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Subtract the following complex numbers: + + [`` ([$p])-([$q]) = ``][___________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + &\phantom{{}=} ([$a0]+[$b0]i)-([$a1]+[$b1]i) \\ + &= [$a0]+[$b0]i-[$a1]-[$b1]i \\ + &= ([$a0]-[$a1]) + ([$b0]-[$b1])i \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations30.pg new file mode 100644 index 0000000000..034e7b4727 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations30.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Power of i +# +# +# Last updated: Carl Yao 10/16/14 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('complex','simplify') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedComplex"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->noreduce('(-x)-y','(-x)+y'); + +$ans0 = Compute("1"); +$ans1 = Compute("i"); +$ans2 = Compute("-1"); +$ans3 = Compute("-i"); +$ans4 = Compute("1"); + +$a = random(10,50,1); +do {$b = random($a+1,100,1);} until ($b%4!=$a%4); + +$aQuotient = int($a/4); +$aRemainder = $a%4; +if ($aRemainder==0) { + $ans5 = $ans4;} +elsif ($a%4==1) { + $ans5 = $ans1; +} elsif ($a%4==2) { + $ans5 = $ans2; +} else { + $ans5 = $ans3; +} + +$bQuotient = int($b/4); +$bRemainder = $b%4; +if ($bRemainder==0) { + $ans6 = $ans4;} +elsif ($b%4==1) { + $ans6 = $ans1; +} elsif ($b%4==2) { + $ans6 = $ans2; +} else { + $ans6 = $ans3; +} + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Find the values of the following expressions: + + [`` i^{0} = ``][___________]{$ans0} + [`` i^{1} = ``][___________]{$ans1} + [`` i^{2} = ``][___________]{$ans2} + [`` i^{3} = ``][___________]{$ans3} + [`` i^{4} = ``][___________]{$ans4} + [`` i^{[$a]} = ``][___________]{$ans5} + [`` i^{[$b]} = ``][___________]{$ans6} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since [`i=\sqrt{-1}`] by definition, we have [`i^{2}=-1`]. Now we can see a pattern: + + [`` +\begin{aligned} + i^{0} &= 1 \\ + i^{1} &= i \\ + i^{2} &= -1 \\ + i^{3} &= i^{2} \cdot i = -1 \cdot i = -i \\ + i^{4} &= i^{2} \cdot i^{2} = (-1) \cdot (-1) = 1 \\ + i^{5} &= i^{4} \cdot i = 1 \cdot i = i \\ + i^{6} &= i^{4} \cdot i^{2} = 1 \cdot (-1) = -1 \\ + i^{7} &= i^{4} \cdot i^{3} = 1 \cdot (-i) = -i \\ + i^{8} &= i^{4} \cdot i^{4} = 1 \cdot 1 = 1 \\ + i^{9} &= i^{4} \cdot i^{4} \cdot i = 1 \cdot 1 \cdot i = i \\ + \vdots +\end{aligned} + ``] + +We can see a pattern: The value of [`i^{n}`] cycles through [` 1, i, -1 \text{ and } -i `]. + +Since [` [$a] \div 4 = [$aQuotient]`] with remainder [`[$aRemainder] `], we have [`i^{[$a]}=i^{[$aRemainder]}=[$ans5]`]. + +Since [` [$b] \div 4 = [$bQuotient]`] with remainder [`[$bRemainder] `], we have [`i^{[$b]}=i^{[$bRemainder]}=[$ans6]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations40.pg new file mode 100644 index 0000000000..bcd97f6c0f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations40.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Power of i +# +# +# Last updated: Carl Yao 10/16/14 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('complex','simplify') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedComplex"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->noreduce('(-x)-y','(-x)+y'); + +$ans0 = Compute("1"); +$ans1 = Compute("i"); +$ans2 = Compute("-1"); +$ans3 = Compute("-i"); +$ans4 = Compute("1"); + +$a = random(10,50,1); +do {$b = random($a+1,100,1);} until ($b%4!=$a%4); + +$aQuotient = int($a/4); +$aRemainder = $a%4; +if ($aRemainder==0) { + $ans5 = $ans4;} +elsif ($a%4==1) { + $ans5 = $ans1; +} elsif ($a%4==2) { + $ans5 = $ans2; +} else { + $ans5 = $ans3; +} + +$bQuotient = int($b/4); +$bRemainder = $b%4; +if ($bRemainder==0) { + $ans6 = $ans4;} +elsif ($b%4==1) { + $ans6 = $ans1; +} elsif ($b%4==2) { + $ans6 = $ans2; +} else { + $ans6 = $ans3; +} + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Find the values of the following expressions: + + [`` i^{[$a]} = ``][___________]{$ans5} + + [`` i^{[$b]} = ``][___________]{$ans6} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since [`i=\sqrt{-1}`] by definition, we have [`i^{2}=-1`]. Now we can see a pattern: + + [`` +\begin{aligned} + i^{0} &= 1 \\ + i^{1} &= i \\ + i^{2} &= -1 \\ + i^{3} &= i^{2} \cdot i = -1 \cdot i = -i \\ + i^{4} &= i^{2} \cdot i^{2} = (-1) \cdot (-1) = 1 \\ + i^{5} &= i^{4} \cdot i = 1 \cdot i = i \\ + i^{6} &= i^{4} \cdot i^{2} = 1 \cdot (-1) = -1 \\ + i^{7} &= i^{4} \cdot i^{3} = 1 \cdot (-i) = -i \\ + i^{8} &= i^{4} \cdot i^{4} = 1 \cdot 1 = 1 \\ + i^{9} &= i^{4} \cdot i^{4} \cdot i = 1 \cdot 1 \cdot i = i \\ + \vdots +\end{aligned} + ``] + +We can see a pattern: The value of [`i^{n}`] cycles through [` 1, i, -1 \text{ and } -i `]. + +Since [` [$a] \div 4 = [$aQuotient]`] with remainder [`[$aRemainder] `], we have [`i^{[$a]}=i^{[$aRemainder]}=[$ans5]`]. + +Since [` [$b] \div 4 = [$bQuotient]`] with remainder [`[$bRemainder] `], we have [`i^{[$b]}=i^{[$bRemainder]}=[$ans6]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations50.pg index a5f3553506..b8cc1dd0a1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations50.pg @@ -8,33 +8,31 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Complex analysis) -## DBchapter(Arithmetic) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('complex','multiply') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "answerHints.pl", - "PGML.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## -Context("Numeric"); +Context("LimitedComplex"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); Context()->noreduce('(-x)-y','(-x)+y'); -Context()->variables->add(i=>'Real'); $a0 = 0; $b0 = 1; @@ -64,9 +62,11 @@ END_PGML $c1 = Compute("$a1*i")->reduce; +Context("Complex"); +Context()->flags->set(reduceConstants=>0); $d1 = Compute("$b1*i")->reduce; -$d2 = Compute("$b1*i**2")->reduce; +$d2 = Compute("$b1*z**2")->reduce->substitute(z=>Formula("i")); $output = ($b1==1) ? "(-1)" : "($b1)(-1)"; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations60.pg index a06d899cb4..2134f7c1c9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations60.pg @@ -8,33 +8,31 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Complex analysis) -## DBchapter(Arithmetic) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('complex','multiply') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "answerHints.pl", - "PGML.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## -Context("Numeric"); +Context("LimitedComplex"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); Context()->noreduce('(-x)-y','(-x)+y'); -Context()->variables->add(i=>'Real'); $a0 = non_zero_random(-12,12,1); $b0 = non_zero_random(-12,12,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations70.pg index d9a40095f1..e4c32b9c6e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations70.pg @@ -8,33 +8,31 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Complex analysis) -## DBchapter(Arithmetic) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('complex','multiply') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "answerHints.pl", - "PGML.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## -Context("Numeric"); +Context("LimitedComplex"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); Context()->noreduce('(-x)-y','(-x)+y'); -Context()->variables->add(i=>'Real'); $a0 = non_zero_random(-12,12,1); $b0 = non_zero_random(-12,12,1); @@ -54,7 +52,7 @@ $ans = Compute("$ansA+$ansB*i")->reduce; TEXT(beginproblem()); BEGIN_PGML -Simplify the following complex number: +Multiply the following complex numbers: [`` ([$num0])^{2} = ``][___________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations80.pg index e239da554c..543b1166ba 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations80.pg @@ -8,33 +8,31 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Complex analysis) -## DBchapter(Arithmetic) -## DBsection(Complex conjugates) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('complex','multiply','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "answerHints.pl", - "PGML.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## -Context("Numeric"); +Context("LimitedComplex"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); Context()->noreduce('(-x)-y','(-x)+y'); -Context()->variables->add(i=>'Real'); $a0 = non_zero_random(-12,12,1); $b0 = non_zero_random(-12,12,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations90.pg index c17ec1b6aa..48a2a5e923 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexNumberOperations90.pg @@ -8,37 +8,35 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Complex analysis) -## DBchapter(Arithmetic) -## DBsection(Division) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('complex','multiply') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "answerHints.pl", - "PGML.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## -Context("Numeric"); +Context("LimitedComplex"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); Context()->noreduce('(-x)-y','(-x)+y'); -Context()->variables->add(i=>'Real'); $a = random(-1,1,2)*random(2,12,1); -$ans = Compute("-$a*i")->reduce; +$ans = Complex("-$a i")->reduce; ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions10.pg index 7286bcd9c5..ea9720b024 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions10.pg @@ -1,44 +1,40 @@ -# WeBWorK problem written by Carl Yao, 2014 +# WeBWorK problem written by Chris Hughes, 2013 # Portland Community College # # Template: -# Solve the following quadratic equation with complex soutions +# Solve the following quadratic equation # # x^2 = -4 # # -# -# Last updated: Carl Yao 10/4/14 +# Last updated: Yao 12/08/2017 # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Complex roots) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) -## KEYWORDS('solve','quadratic','equation','complex') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", - "PGML.pl", - "contextLimitedRadical.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadicalComplex.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## -#Context("LimitedRadical"); -Context("Complex"); +Context("LimitedRadicalComplex"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); parser::Assignment->Allow; @@ -57,60 +53,50 @@ Context()->operators->redefine(',',using=>',',from=>'Numeric'); Context()->strings->add("no real solutions"=>{}, "no real solution"=>{alias=>'no real solutions'}, "none"=>{alias=>'no real solutions'}, - "no solution"=>{alias=>'no real solutions'}, - "no solutions"=>{alias=>'no real solutions'}, ); -$var = "x"; -Context()->variables->are($var=>'Complex'); -$a = random(2,12,1); -$s1 = Complex(0,$a); -$s2 = Complex(0,-$a); -$ans = List(Formula("$var=$s1"),Formula("$var=$s2")); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = random(2,10,1); +$ans = List(Formula("$var=$a*i"),Formula("$var=-$a*i"))->reduce; ############################################## TEXT(beginproblem()); BEGIN_PGML -Solve the quadratic equation. There are possible complex solutions. +Solve the quadratic equation. Solutions could be complex numbers. -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If you need to use the square root symbol, -as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +[@KeyboardInstructions('Enter multiple answers separated by commas, like [|x=1,x=-1|]*. If you need to use the square root symbol, as in [`\sqrt{17}`], type it as [|sqrt(17)|]*.')@]** [` [$var]^2 = -[$a**2] `] [__________________________________] + END_PGML ############################################## $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)-> - withPostFilter(AnswerHints( - "no real solutions" => ["Please find complex solutions." , replaceMessage => 1] - )) -); +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); ############################################## BEGIN_PGML_SOLUTION - -Since [`x^2`] is already separated on the left side, we square root both sides: - - [`` - \begin{aligned} - [$var]^2 &= -[$a**2] \\ - \sqrt{[$var]^2} &= \pm \sqrt{-[$a**2]} \\ - [$var]= \sqrt{-[$a**2]} &\text{ or } [$var]= -\sqrt{-[$a**2]} \\ - [$var] =[$s1] &\text{ or } [$var]=[$s2] - \end{aligned} - ``] - -Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are complex numbers. +There are a few ways to solve quadratic equations- the easiest way to solve this particular type of problem is to use the _square root method_. + + [` + \begin{aligned} + [$var]^2 &= -[$a**2] \\ + \sqrt{[$var]^2} &= \pm\sqrt{-[$a**2]} \\ + [$var] &= \pm\sqrt{-1}\cdot\sqrt{[$a**2]} \\ + [$var] &= \pm i\cdot[$a] \\ + [$var] &= \pm[$a]i + \end{aligned} + `] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions15.pg index 21962181df..a7a6805c8e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions15.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions15.pg @@ -12,14 +12,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Complex roots) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -68,7 +66,7 @@ $dMinusB = $a*$e; $b = non_zero_random(-10,10,1); $d = $dMinusB+$b; -$ans = List(Formula("$var=$f*i"),Formula("$var=-$f*i")); +$ans = List(Formula("$var=$f*i"),Formula("$var=-$f*i"))->reduce; ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions20.pg index 59628d2b3c..2e4b07eb5c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions20.pg @@ -12,32 +12,30 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Complex roots) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','complex','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", - "PGML.pl", - "contextLimitedRadical.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadicalComplex.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); +Context("LimitedRadicalComplex"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); parser::Assignment->Allow; @@ -60,31 +58,31 @@ Context()->strings->add("no real solutions"=>{}, "no solutions"=>{alias=>'no real solutions'}, ); -$var = 'x'; -Context()->variables->add(i=>'Real'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); do { do {$c = non_zero_random(-5,5,1);} until ($c!=1); $d = non_zero_random(-10,10,1); $e = non_zero_random(-10,10,1); $right = ($e-$d)/$c; -} until ( (($e-$d)%$c==0) && ($right<0) && (sqrt(-$right)!=int(sqrt(-$right))) ); +} until ( (($e-$d)%$c==0) && ($right<0) && (sqrt(-$right)!=int(sqrt(-$right))) && ($right % 4 !=0) && ($right % 9 !=0)); + +$lead = Formula("$c $var^2")->reduce; $rightNeg = -$right; -$ans = List(Formula("$var=sqrt($rightNeg)*i"),Formula("$var=-sqrt($rightNeg)*i")); +$ans = List(Formula("$var=i*sqrt($rightNeg)"),Formula("$var=-i*sqrt($rightNeg)")); ############################################## TEXT(beginproblem()); BEGIN_PGML -Solve the quadratic equation. There are possible complex solutions. +Solve the quadratic equation. Solutions could be complex numbers. -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If you need to use the square root symbol, -as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +[@KeyboardInstructions('Enter multiple answers separated by commas, like [|x=1,x=-1|]*. If you need to use the square root symbol, as in [`\sqrt{17}`], type it as [|sqrt(17)|]*.')@]** - [` [$c][$var]^2 + [$d] = [$e] `] + [` [$lead] + [$d] = [$e] `] [__________________________________] @@ -115,7 +113,9 @@ Since [`x^2`] is already separated on the left side, we square root both sides: \frac{[$c][$var]^2}{[$c]} &= \frac{[$e-$d]}{[$c]} \\ [$var]^2 &= [$right] \\ \sqrt{[$var]^2} &= \pm \sqrt{[$right]} \\ - [$var] =\sqrt{[$rightNeg]}i & \text{ or } [$var] = -\sqrt{[$rightNeg]}i + [$var] &= \pm \sqrt{-1}\cdot\sqrt{[$rightNeg]} \\ + [$var] &= \pm i\cdot\sqrt{[$rightNeg]} \\ + [$var] =i\sqrt{[$rightNeg]} & \text{ or } [$var] = -i\sqrt{[$rightNeg]} \end{aligned} ``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions25.pg index d06dc7c577..114407bd6d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions25.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions25.pg @@ -12,14 +12,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Complex roots) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -32,7 +30,7 @@ loadMacros( "PGML.pl", "contextLimitedRadicalComplex.pl", "PCCmacros.pl", - "PGcourse.pl", + "PGcourse.pl", ); ############################################## @@ -48,7 +46,7 @@ Context()->operators->redefine(',',using=>',',from=>'Numeric'); ','=>{string=>' or ',TeX=>'\hbox{ or }'}, 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} ); - Context()->lists->set(List => {separator => ' or '}); + Context()->lists->set(List => {separator => " or "}); # add solution strings to context- this means that if # students enter these (and they are not correct), then @@ -56,10 +54,12 @@ Context()->operators->redefine(',',using=>',',from=>'Numeric'); Context()->strings->add("no real solutions"=>{}, "no real solution"=>{alias=>'no real solutions'}, "none"=>{alias=>'no real solutions'}, + "no solution"=>{alias=>'no real solutions'}, + "no solutions"=>{alias=>'no real solutions'}, ); $var = RandomVariableName(type=>'variable'); -Context()->variables->are($var=>'Real'); +Context()->variables->are($var=>'Complex'); $f = non_zero_random(2,10,1); $e = -$f**2; @@ -70,7 +70,7 @@ $d = $dMinusB+$b; $g = non_zero_random(-10,10,1); -$ans = List(Formula("$var=-$g+$f*i"),Formula("$var=-$g-$f*i")); +$ans = List(Formula("$var = -$g + $f i"),Formula("$var = -$g - $f i"))->reduce; ############################################## @@ -91,7 +91,11 @@ END_PGML $showPartialCorrectAnswers = 1; -ANS($ans->cmp(list_checker => ~~&radicalListCheck)); +ANS($ans->cmp(list_checker => ~~&radicalListCheck)-> + withPostFilter(AnswerHints( + "no real solutions" => ["Please find complex solutions." , replaceMessage => 1] + )) +); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions26.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions26.pg index 0f3a8e6608..3ec97623ac 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions26.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions26.pg @@ -12,14 +12,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Complex roots) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -59,7 +57,7 @@ Context()->strings->add("no real solutions"=>{}, ); $var = RandomVariableName(type=>'variable'); -Context()->variables->are($var=>'Real'); +Context()->variables->are($var=>'Real',V=>'Real'); $f = list_random(2,3,5); do {$g = list_random(2,3,5,7);} until ($g!=$f); @@ -69,7 +67,7 @@ $dMinusB = -$a*$e; $b = non_zero_random(-10,10,1); $d = $dMinusB+$b; -$ans = List(Formula("$var=$f*i*sqrt($g)"),Formula("$var=-$f*i*sqrt($g)")); +$ans = List(Formula("$var=$f*i*V")->reduce->substitute(V=>Formula("sqrt($g)")),Formula("$var=-$f*i*V")->reduce->substitute(V=>Formula("sqrt($g)"))); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions30.pg index 730d36f8f7..684bac8da8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions30.pg @@ -12,32 +12,30 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Complex roots) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','complex','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", - "PGML.pl", - "contextLimitedRadical.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadicalComplex.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedRadical"); +Context("LimitedRadicalComplex"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); parser::Assignment->Allow; @@ -60,8 +58,8 @@ Context()->strings->add("no real solutions"=>{}, "no solutions"=>{alias=>'no real solutions'}, ); -$var = 'x'; -Context()->variables->add(i=>'Real'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Complex'); do { do { @@ -69,12 +67,14 @@ do { $d = non_zero_random(-10,10,1); $e = non_zero_random(-10,10,1); $radical = -($d**2-4*$c*$e); - } until ($radical>4); + } until ($radical>=4); $a = -$d/(2*$c); $b = sqrt($radical)/(2*$c); } until ( ($a==int($a)) && ($b==int($b)) ); +$a = int($a); +$b = int($b); - $ans = List(Formula("$var=$a+$b*i"),Formula("$var=$a-$b*i")); +$ans = ($b == 1) ? List(Formula("$var = $a + i"), Formula("$var = $a - i"))->reduce : List(Formula("$var=$a+$b*i"),Formula("$var=$a-$b*i"))->reduce; $func = Compute("$var**2+$d*$var+$e")->reduce; @@ -82,11 +82,9 @@ $func = Compute("$var**2+$d*$var+$e")->reduce; TEXT(beginproblem()); BEGIN_PGML -Solve the quadratic equation. There are possible complex solutions. +Solve the quadratic equation. Solutions could be complex numbers. -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If you need to use the square root symbol, -as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +[@KeyboardInstructions('Enter multiple answers separated by commas, like [|x=1,x=-1|]*. If you need to use the square root symbol, as in [`\sqrt{17}`], type it as [|sqrt(17)|]*.')@]** [` [$func] = 0 `] @@ -109,7 +107,7 @@ ANS($ans->cmp(list_checker => ~~&radicalListCheck)-> $g = $c*$e*4-$d**2; $h = sqrt($g); - +$s1 = Compute("$b*i")->reduce; BEGIN_PGML_SOLUTION @@ -119,18 +117,18 @@ By [`[$func]`], we know [`a=1, b=[$d] \text{ and } c=[$e] `]. Now we have: [`` \begin{aligned} - x &= \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a} \\ - x &= \frac{-([$d]) \pm \sqrt{([$d])^{2} - 4([$c])([$e])}}{2([$c])} \\ - x &= \frac{[$d*-1] \pm \sqrt{[$d**2] - [$c*$e*4]}}{[$c*2]} \\ - x &= \frac{[$d*-1] \pm \sqrt{[$d**2-$c*$e*4]}}{[$c*2]} \\ - x &= \frac{[$d*-1] \pm \sqrt{[$g]}i}{[$c*2]} \\ - x &= \frac{[$d*-1] \pm [$h]i}{[$c*2]} \\ - x &= \frac{[$d*-1]}{[$c*2]} \pm \frac{[$h]i}{[$c*2]} \\ - x &= [$a] \pm [$b]i \\ + [$var] &= \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a} \\ + [$var] &= \frac{-([$d]) \pm \sqrt{([$d])^{2} - 4([$c])([$e])}}{2([$c])} \\ + [$var] &= \frac{[$d*-1] \pm \sqrt{[$d**2] - [$c*$e*4]}}{[$c*2]} \\ + [$var] &= \frac{[$d*-1] \pm \sqrt{[$d**2-$c*$e*4]}}{[$c*2]} \\ + [$var] &= \frac{[$d*-1] \pm \sqrt{-1}\cdot\sqrt{[$g]}}{[$c*2]} \\ + [$var] &= \frac{[$d*-1] \pm [$h]i}{[$c*2]} \\ + [$var] &= \frac{[$d*-1]}{[$c*2]} \pm \frac{[$h]i}{[$c*2]} \\ + [$var] &= [$a] \pm [$s1] \\ \end{aligned} ``] -For this problem's solution, we need to type in [`x=[$a]+[$b]i, x=[$a]-[$b]i`] +For this problem's solution, we need to type in [`[$var]=[$a]+[$s1], [$var]=[$a]-[$s1]`] Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are complex numbers. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions40.pg index eab54d51c7..bf65661be7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions40.pg @@ -4,7 +4,7 @@ # Template: # Solve the following quadratic equation with complex solutions # -# 2x^2 + 8 = 4 +# x^2 -4x+7=0 # # # @@ -12,50 +12,30 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Complex roots) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','complex','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", - "PGML.pl", - "contextLimitedRadical.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadicalComplex.pl", + "PCCmacros.pl", + "PGcourse.pl", ); -############################################## - -sub breakRadical { - my $num = $_[0]; - my $i = 2; - my $out = 1; - my $in = $num; - while ($i<=sqrt($in)) { - if ($in%($i**2)==0) { - $out = $out*$i; - $in = $in/($i**2); - } else { - $i++; - } - } - return ($out,$in); -} - ############################################# -Context("LimitedRadical"); +Context("LimitedRadicalComplex"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); parser::Assignment->Allow; @@ -78,38 +58,33 @@ Context()->strings->add("no real solutions"=>{}, "no solutions"=>{alias=>'no real solutions'}, ); -$var = 'x'; -Context()->variables->add(i=>'Real'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real',V=>'Real'); do { - do { - $c=1; - $d = non_zero_random(-10,10,1); - $e = non_zero_random(-10,10,1); - $radical = -($d**2-4*$c*$e); - } until ($radical>4); - ($out,$in) = &breakRadical($radical); - $a = -$d/(2*$c); - $b = $out/(2*$c); -} until ( ($a==int($a)) && ($in!=1) && ($b==int($b)) ); - -if ($b==1) { - $ans = List(Formula("$var=$a+sqrt($in)*i"),Formula("$var=$a-sqrt($in)*i")); -} else { - $ans = List(Formula("$var=$a+$b*sqrt($in)*i"),Formula("$var=$a-$b*sqrt($in)*i")); -} + $out = 2; + do {$in = list_random(2,3,5,7);} until ($in!=$out); + $a = 1; + $b = non_zero_random(-10,10,2); + $c = ($b**2+$out**2*$in)/4; +} until ( $c==int($c) ); -$func = Compute("$c*$var**2+$d*$var+$e")->reduce; +$d = -$b/2; +$e = $out/2; + +$ans1 = Formula("$var=$d+i*V")->reduce('(-x)-y'=>0)->substitute(V=>Formula("sqrt($in)")); +$ans2 = Formula("$var=$d-i*V")->reduce('(-x)-y'=>0)->substitute(V=>Formula("sqrt($in)")); +$ans = List($ans1,$ans2); + +$func = Formula("$var^2+$b*$var+$c")->reduce; ############################################## TEXT(beginproblem()); BEGIN_PGML -Solve the quadratic equation. There are possible complex solutions. +Solve the quadratic equation. Solutions could be complex numbers. -* Enter multiple answers separated by commas, such as [`x=1,x=-1`] -* If you need to use the square root symbol, -as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +[@KeyboardInstructions('Enter multiple answers separated by commas, like [|x=1,x=-1|]*. If you need to use the square root symbol, as in [`\sqrt{17}`], type it as [|sqrt(17)|]*.')@]** [` [$func] =0 `] @@ -130,39 +105,40 @@ ANS($ans->cmp(list_checker => ~~&radicalListCheck)-> ############################################## -$g = $c*$e*4-$d**2; +$g = -($b**2-$a*$c*4); -if ($b==1) { - $output1 = "x &= $a \pm \sqrt{$in}i "; - $output2 = "x=$a+ \ \text{sqrt}($in)i, x=$a- \ \text{sqrt}($in)i"; + +if ($e==1) { + $s1 = Formula("i*sqrt($in)"); + $output2 = "$var=$d+ i*\text{sqrt}($in), $var=$d- i*\text{sqrt}($in)"; } else { - $output1 = "x &= $a \pm $b \sqrt{$in}i "; - $output2 = "x=$a+$b \ \text{sqrt}($in)i, x=$a-$b \ \text{sqrt}($in)i"; + $s1 = Formula("$d*i*sqrt($in)"); + $output2 = "$var=$d+$e i*\text{sqrt}($in), $var=$d-$e i*\text{sqrt}($in)"; } +$s2 = ($out>$in) ? "$in^2\cdot$out" : "$out^2\cdot$in"; BEGIN_PGML_SOLUTION The polynomial [`[$func]`] cannot be factored, so we use the quadratic formula. -By [`[$func]`], we know [`a=1, b=[$d] \text{ and } c=[$e] `]. Now we have: +By [`[$func]`], we know [`a=1, b=[$b] \text{ and } c=[$c] `]. Now we have: [`` \begin{aligned} - x &= \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a} \\ - x &= \frac{-([$d]) \pm \sqrt{([$d])^{2} - 4([$c])([$e])}}{2([$c])} \\ - x &= \frac{[$d*-1] \pm \sqrt{[$d**2] - [$c*$e*4]}}{[$c*2]} \\ - x &= \frac{[$d*-1] \pm \sqrt{[$d**2-$c*$e*4]}}{[$c*2]} \\ - x &= \frac{[$d*-1] \pm \sqrt{[$g]}i}{[$c*2]} \\ - x &= \frac{[$d*-1] \pm [$out]\sqrt{[$in]}i}{[$c*2]} \\ - x &= \frac{[$d*-1]}{[$c*2]} \pm \frac{[$out]\sqrt{[$in]}i}{[$c*2]} \\ - [$output1] + [$var] &= \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a} \\ + [$var] &= \frac{-([$b]) \pm \sqrt{([$b])^{2} - 4([$a])([$c])}}{2([$a])} \\ + [$var] &= \frac{[$b*-1] \pm \sqrt{[$b**2] - [$a*$c*4]}}{[$a*2]} \\ + [$var] &= \frac{[$b*-1] \pm \sqrt{[$b**2-$a*$c*4]}}{[$a*2]} \\ + [$var] &= \frac{[$b*-1] \pm \sqrt{-1}\cdot\sqrt{[$g]}}{[$a*2]} \\ + [$var] &= \frac{[$b*-1] \pm i\sqrt{[$s2]}}{[$a*2]} \\ + [$var] &= \frac{[$b*-1] \pm [$out]i\sqrt{[$in]}}{[$a*2]} \\ + [$var] &= \frac{[$b*-1]}{[$a*2]} \pm \frac{[$out]i\sqrt{[$in]}}{[$a*2]} \\ + [$var] &= [$d] \pm [$s1] \end{aligned} ``] -For this problem's solution, we need to type in [` [$output2] `] - -Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are complex numbers. +So the solution is [` [$output2] `] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions50.pg index fbf731772f..af4b52f01c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/ComplexNumber/complexSolutions50.pg @@ -7,29 +7,33 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Complex roots) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "PCCgraphMacros.pl", + "PGcourse.pl", "PGchoicemacros.pl", "unionTables.pl", - "PGcourse.pl" ); ############################################## @@ -38,7 +42,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #These arrays decide values in y=a(x-b)^2+h. #$a[0], $b[0], $h[0], $a[1], $b[1], $h[1] are for the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation10.pg index 7111e7cde0..8fc3e5a9f2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation10.pg @@ -7,16 +7,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','subtract') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,10 +41,14 @@ $ans2=random(11,30,1); $b=$a+$ans2; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$a + x = $b"); +$ans1 = Compute("$a + $var = $b"); + +$ans1string = "$a + $var = $b"; +$ans1 = Compute($ans1string); @@ -52,7 +58,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. [@numberWord($a,capital=>1)@] more than a number is [@numberWord($b)@]. What is the number? @@ -68,13 +74,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -85,6 +92,7 @@ ANS($ans1->cmp( Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); $ans2 = $b-$a; ANS(Compute($ans2)->cmp); @@ -92,17 +100,17 @@ ANS(Compute($ans2)->cmp); BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` x+[$a]=[$b] ``] + [`` [$var]+[$a]=[$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - x+[$a] &= [$b] \\ - x+[$a] \mathbf{{}-[$a]} &= [$b]\mathbf{{}-[$a]} \\ - x &= [$ans2] + [$var]+[$a] &= [$b] \\ + [$var]+[$a] \mathbf{{}-[$a]} &= [$b]\mathbf{{}-[$a]} \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation100.pg index c7d7f00420..2df912c072 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation100.pg @@ -7,16 +7,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','add','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -45,10 +47,13 @@ while ($b==$a) { } Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$m*x-$a= $b"); + +$ans1string = "$m*$var-$a= $b"; +$ans1 = Compute($ans1string); if ($m==2) {$w = "twice";} else {$w = numberWord($m)." times";} @@ -60,7 +65,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. [@numberWord($a,capital=>1)@] less than [$w] a number is [@numberWord($b)@]. What is the number? @@ -76,13 +81,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -92,25 +98,26 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); ANS(Compute($ans2)->cmp); $s1=$b+$a; BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` [$m]x-[$a]=[$b] ``] + [`` [$m][$var]-[$a]=[$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - [$m]x {}-[$a] &\;=\; [$b] \\ - [$m]x {}-[$a] \mathbf{{} +[$a]} &\;=\; [$b]\mathbf{{} +[$a]} \\ - [$m]x &\;=\; [$s1] \\ - \frac{[$m]x}{[$m]} &\;=\; \frac{[$s1]}{[$m]} \\ - x &\;=\; [$ans2] + [$m][$var] {}-[$a] &\;=\; [$b] \\ + [$m][$var] {}-[$a] \mathbf{{} +[$a]} &\;=\; [$b]\mathbf{{} +[$a]} \\ + [$m][$var] &\;=\; [$s1] \\ + \frac{[$m][$var]}{[$m]} &\;=\; \frac{[$s1]}{[$m]} \\ + [$var] &\;=\; [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation110.pg index 77af06e79f..a4702f2602 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation110.pg @@ -7,16 +7,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','add','multiply','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,10 +42,13 @@ $ans2=random(2,15,1); $c=$a*($ans2-$b); Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$c = $a*(x-$b)"); + +$ans1string = "$c = $a*($var-$b)"; +$ans1 = Compute($ans1string); ############################################## @@ -52,7 +57,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. [@numberWord($c,capital=>1)@] is the product of [@numberWord($a)@] and [@numberWord($b)@] less than a number. What is the number? @@ -68,13 +73,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -84,6 +90,7 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); ANS(Compute($ans2)->cmp); $s1=$b*$a; @@ -91,7 +98,7 @@ $s2=$c+$s1; BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. +Let the unknown number be [`[$var]`]. Following "the product of", there are two expressions being multiplied: "[`[$a]`]" and "[`[$b]`] less than a number." @@ -99,19 +106,19 @@ We need to use parentheses so that subtraction happens first. The equation is: - [`` [$c]=[$a](x-[$b]) ``] + [`` [$c]=[$a]([$var]-[$b]) ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - [$c] &\;=\; [$a](x-[$b]) \\ - [$c] &\;=\; [$a]x-[$a] \cdot [$b] \\ - [$c] &\;=\; [$a]x-[$s1] \\ - [$c]\mathbf{{} +[$s1]} &\;=\; [$a]x-[$s1] \mathbf{{} +[$s1]} \\ - [$s2] &\;=\; [$a]x \\ - \frac{[$s2]}{[$a]} &\;=\; \frac{[$a]x}{[$a]} \\ - [$ans2] &\;=\; x + [$c] &\;=\; [$a]([$var]-[$b]) \\ + [$c] &\;=\; [$a][$var]-[$a] \cdot [$b] \\ + [$c] &\;=\; [$a][$var]-[$s1] \\ + [$c]\mathbf{{} +[$s1]} &\;=\; [$a][$var]-[$s1] \mathbf{{} +[$s1]} \\ + [$s2] &\;=\; [$a][$var] \\ + \frac{[$s2]}{[$a]} &\;=\; \frac{[$a][$var]}{[$a]} \\ + [$ans2] &\;=\; [$var] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation120.pg index b602e273bc..d8a73bab08 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation120.pg @@ -7,16 +7,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('distributive','solve','linear','equation','english-to-math','subtract','multiply') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,10 +42,13 @@ $ans2=random(2,15,1); $c=$a*($ans2+$b); Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$a*(x+$b)= $c"); + +$ans1string = "$a*($var+$b)= $c"; +$ans1 = Compute($ans1string); @@ -53,7 +58,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. The product of [@numberWord($a)@] and [@numberWord($b)@] more than a number is [@numberWord($c)@]. What is the number? @@ -69,13 +74,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -85,6 +91,7 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); ANS(Compute($ans2)->cmp); $s1=$b*$a; @@ -92,7 +99,7 @@ $s2=$c-$s1; BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. +Let the unknown number be [`[$var]`]. Following "the product of", there are two expressions being multiplied: "[`[$a]`]" and "[`[$b]`] more than a number." @@ -100,19 +107,19 @@ We need to use parentheses so that addition happens first. The equation is: - [`` [$a](x+[$b])=[$c] ``] + [`` [$a]([$var]+[$b])=[$c] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - [$a](x+[$b]) &= [$c] \\ - [$a]x+[$a] \cdot [$b] &= [$c] \\ - [$a]x+[$s1] &= [$c] \\ - [$a]x+[$s1]\mathbf{{} -[$s1]} &= [$c]\mathbf{{} -[$s1]} \\ - [$a]x &= [$s2] \\ - \frac{[$a]x}{[$a]} &= \frac{[$s2]}{[$a]} \\ - x &= [$ans2] + [$a]([$var]+[$b]) &= [$c] \\ + [$a][$var]+[$a] \cdot [$b] &= [$c] \\ + [$a][$var]+[$s1] &= [$c] \\ + [$a][$var]+[$s1]\mathbf{{} -[$s1]} &= [$c]\mathbf{{} -[$s1]} \\ + [$a][$var] &= [$s2] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$s2]}{[$a]} \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation130.pg index 528b1f45fe..c2c1f370ea 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation130.pg @@ -7,16 +7,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,10 +41,13 @@ $ans2=random(2,15,1); $a = ($b-1)*$ans2; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$a+x=$b*x"); + +$ans1string = "$a+$var=$b*$var"; +$ans1 = Compute($ans1string); ############################################## @@ -51,7 +56,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. The sum of [@numberWord($a)@] and a number is the same as [@numberWord($b)@] times that number. What is the number? @@ -66,13 +71,14 @@ END_PGML ############################################## ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -82,25 +88,26 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); ANS(Compute($ans2)->cmp); $s1=$b-1; BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` [$a]+x=[$b]x ``] + [`` [$a]+[$var]=[$b][$var] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - [$a] +x &= [$b]x \\ - [$a] {}+x\mathbf{ {}-x} &= [$b]x\mathbf{ {}-x} \\ - [$a] &= [$s1]x \\ - \frac{[$a]}{[$s1]} &= \frac{[$s1]x}{[$s1]} \\ - [$ans2] &= x + [$a] +[$var] &= [$b][$var] \\ + [$a] {}+[$var]\mathbf{ {}-[$var]} &= [$b][$var]\mathbf{ {}-[$var]} \\ + [$a] &= [$s1][$var] \\ + \frac{[$a]}{[$s1]} &= \frac{[$s1][$var]}{[$s1]} \\ + [$ans2] &= [$var] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation140.pg index 55da4c4257..42468a293d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation140.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,10 +42,13 @@ $ans2=random(-10,-2,1); $b = abs(($a-2)*$ans2); Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$a*x=2x-$b"); + +$ans1string = "$a*$var=2$var-$b"; +$ans1 = Compute($ans1string); @@ -53,7 +58,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. [@numberWord($a,capital=>1)@] times a number is the same as [@numberWord($b)@] less than twice the number. What is the number? @@ -69,13 +74,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -85,25 +91,26 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); ANS(Compute($ans2)->cmp); $s1=$a-2; BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` [$a]x=2x-[$b] ``] + [`` [$a][$var]=2[$var]-[$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - [$a]x &= 2x {}-[$b] \\ - [$a]x \mathbf{{} -2x } &= 2x {}-[$b]\mathbf{{} -2x } \\ - [$s1]x &= -[$b] \\ - \frac{[$s1]x}{[$s1]} &= \frac{-[$b]}{[$s1]} \\ - x &= [$ans2] + [$a][$var] &= 2[$var] {}-[$b] \\ + [$a][$var] \mathbf{{} -2[$var] } &= 2[$var] {}-[$b]\mathbf{{} -2[$var] } \\ + [$s1][$var] &= -[$b] \\ + \frac{[$s1][$var]}{[$s1]} &= \frac{-[$b]}{[$s1]} \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation150.pg index 5e4d0f5e3b..511d8b4f94 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation150.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','subtract','multiply','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -41,10 +43,13 @@ $c = random(3,6,1); $b=$c*$ans2-$ans2/$a; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("x/$a=$c*x-$b"); + +$ans1string = "$var/$a=$c*$var-$b"; +$ans1 = Compute($ans1string); ############################################## @@ -53,7 +58,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. The quotient of a number and [@numberWord($a)@] happens to be [@numberWord($b)@] less than [@numberWord($c)@] times the number. What is the number? @@ -69,13 +74,15 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -85,6 +92,7 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); ANS(Compute($ans2)->cmp); $s1=$a*$c; @@ -93,21 +101,21 @@ $s3=1-$s1; BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` \frac{x}{[$a]}=[$c]x-[$b] ``] + [`` \frac{[$var]}{[$a]}=[$c][$var]-[$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - \frac{x}{[$a]} &= [$c]x -[$b] \\ - [$a] \cdot \frac{x}{[$a]} &= [$a] \cdot\left( [$c]x {}-[$a] [$b]\right) \\ - x &= [$s1]x -[$s2] \\ - x \mathbf{{} -[$s1]x}&= [$s1]x -[$s2]\mathbf{{} -[$s1]x} \\ - [$s3]x &= -[$s2] \\ - \frac{[$s3]x}{[$s3]} &= \frac{-[$s2]}{[$s3]} \\ - x &= [$ans2] + \frac{[$var]}{[$a]} &= [$c][$var] -[$b] \\ + [$a] \cdot \frac{[$var]}{[$a]} &= [$a] \cdot\left( [$c][$var] {}-[$a] [$b]\right) \\ + [$var] &= [$s1][$var] -[$s2] \\ + [$var] \mathbf{{} -[$s1][$var]}&= [$s1][$var] -[$s2]\mathbf{{} -[$s1][$var]} \\ + [$s3][$var] &= -[$s2] \\ + \frac{[$s3][$var]}{[$s3]} &= \frac{-[$s2]}{[$s3]} \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation160.pg index 94de2df165..e26679509c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation160.pg @@ -9,16 +9,18 @@ # Last updated: Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','multiply','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +33,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -43,10 +45,13 @@ $ans2=$com*list_random((1,2,3)); $b = $ans2/$a-$ans2/$c; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("x/$a-$b=x/$c"); + +$ans1string = "$var/$a-$b=$var/$c"; +$ans1 = Compute($ans1string); ############################################## @@ -55,7 +60,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. [@numberWord($b,capital=>1)@] less than the quotient of a number and [@numberWord($a)@] is the same as the quotient of the number and [@numberWord($c)@]. What is the number? @@ -71,13 +76,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -87,6 +93,7 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); ANS(Compute($ans2)->cmp); $s1 = $com/$a; @@ -99,23 +106,23 @@ if ($s4 == -1) {$s4b = '-'}; BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` \frac{x}{[$a]} -[$b] = \frac{x}{[$c]} ``] + [`` \frac{[$var]}{[$a]} -[$b] = \frac{[$var]}{[$c]} ``] -Next, we solve for [`x`]. To clear denominators from both fractions, we multiply each term in the equation with a common denominator, which could be [`[$com]`]. +Next, we solve for [`[$var]`]. To clear denominators from both fractions, we multiply each term in the equation with a common denominator, which could be [`[$com]`]. [` \begin{aligned} - \frac{x}{[$a]} -[$b] &= \frac{x}{[$c]} \\ - \frac{x}{[$a]} +(-[$b]) &= \frac{x}{[$c]} \\ - [$com] \cdot \frac{x}{[$a]} +[$com] \cdot (-[$b]) &= [$com] \cdot \frac{x}{[$c]} \\ - [$s1]x - [$s3] &= [$s2]x \\ - [$s1]x - [$s3]\mathbf{{}-[$s1]x} &= [$s2]x\mathbf{{}-[$s1]x} \\ - -[$s3] &= [$s4b]x \\ - \frac{-[$s3]}{[$s4]} &= \frac{[$s4b]x}{[$s4]} \\ - [$ans2] &= x\\ - x &= [$ans2] + \frac{[$var]}{[$a]} -[$b] &= \frac{[$var]}{[$c]} \\ + \frac{[$var]}{[$a]} +(-[$b]) &= \frac{[$var]}{[$c]} \\ + [$com] \cdot \frac{[$var]}{[$a]} +[$com] \cdot (-[$b]) &= [$com] \cdot \frac{[$var]}{[$c]} \\ + [$s1][$var] - [$s3] &= [$s2][$var] \\ + [$s1][$var] - [$s3]\mathbf{{}-[$s1][$var]} &= [$s2][$var]\mathbf{{}-[$s1][$var]} \\ + -[$s3] &= [$s4b][$var] \\ + \frac{-[$s3]}{[$s4]} &= \frac{[$s4b][$var]}{[$s4]} \\ + [$ans2] &= [$var]\\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation170.pg index f706f77346..de5825ca0f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation170.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation170.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -41,10 +43,13 @@ $ans2=random(2,10,1); $b=$a+$m*$ans2; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$a+$m*x= $b"); + +$ans1string = "$a+$m*$var= $b"; +$ans1 = Compute($ans1string); if ($m==2) {$w = "twice";} else {$w = numberWord($m)." times";} @@ -57,7 +62,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. The sum of [@numberWord($a)@] and [$w] a number is [@numberWord($b)@]. What is the number? @@ -73,13 +78,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -89,25 +95,26 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); ANS(Compute($ans2)->cmp); $s1=$b-$a; BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` [$a]+[$m]x=[$b] ``] + [`` [$a]+[$m][$var]=[$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - [$a] {}+[$m]x &= [$b] \\ - [$a] {}+[$m]x \mathbf{{} -[$a]} &= [$b]\mathbf{{} -[$a]} \\ - [$m]x &= [$s1] \\ - \frac{[$m]x}{[$m]} &= \frac{[$s1]}{[$m]} \\ - x &= [$ans2] + [$a] {}+[$m][$var] &= [$b] \\ + [$a] {}+[$m][$var] \mathbf{{} -[$a]} &= [$b]\mathbf{{} -[$a]} \\ + [$m][$var] &= [$s1] \\ + \frac{[$m][$var]}{[$m]} &= \frac{[$s1]}{[$m]} \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation180.pg index ab872e4fbf..b82354eb69 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation180.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation180.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','add','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -41,10 +43,13 @@ $ans2=random(2,10,1); $b=$m*($ans2+$a); Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$m*(x+$a)= $b"); + +$ans1string = "$m*($var+$a)= $b"; +$ans1 = Compute($ans1string); if ($m==2) {$w = "twice";} else {$w = numberWord($m)." times";} @@ -57,7 +62,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. We know [$w] the sum of [@numberWord($a)@] and a number is [@numberWord($b)@]. What is the number? @@ -73,13 +78,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -89,6 +95,7 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); ANS(Compute($ans2)->cmp); $s1=$m*$a; @@ -96,21 +103,21 @@ $s2=$b-$s1; BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` [$m](x+[$a])=[$b] ``] + [`` [$m]([$var]+[$a])=[$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - [$m](x+[$a]) &= [$b] \\ - [$m]x+[$m] \cdot [$a] &= [$b] \\ - [$m]x+[$s1] &= [$b] \\ - [$m]x+[$s1]\mathbf{{} -[$s1]} &= [$b]\mathbf{{} -[$s1]} \\ - [$m]x &= [$s2] \\ - \frac{[$m]x}{[$m]} &= \frac{[$s2]}{[$m]} \\ - x &= [$ans2] + [$m]([$var]+[$a]) &= [$b] \\ + [$m][$var]+[$m] \cdot [$a] &= [$b] \\ + [$m][$var]+[$s1] &= [$b] \\ + [$m][$var]+[$s1]\mathbf{{} -[$s1]} &= [$b]\mathbf{{} -[$s1]} \\ + [$m][$var] &= [$s2] \\ + \frac{[$m][$var]}{[$m]} &= \frac{[$s2]}{[$m]} \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation20.pg index 46d25fa61b..41cfd21d28 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation20.pg @@ -7,16 +7,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','application','add') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,10 +41,13 @@ $ans2=random(30,50,1); $b=$ans2-$a; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("x - $a = $b"); + +$ans1string = "$var-$a=$b"; +$ans1 = Compute($ans1string); @@ -52,7 +57,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. [@numberWord($a,capital=>1)@] less than a number is [@numberWord($b)@]. What is the number? @@ -68,13 +73,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -84,22 +90,23 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); $ans2 = $b+$a; ANS(Compute($ans2)->cmp); BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` x-[$a]=[$b] ``] + [`` [$var]-[$a]=[$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - x-[$a] &= [$b] \\ - x-[$a]\mathbf{{}+[$a]} &= [$b]\mathbf{{}+[$a]} \\ - x &= [$ans2] + [$var]-[$a] &= [$b] \\ + [$var]-[$a]\mathbf{{}+[$a]} &= [$b]\mathbf{{}+[$a]} \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation30.pg index 929734126b..f58e4d45bc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation30.pg @@ -7,16 +7,18 @@ # Last updated: Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,11 +41,14 @@ $ans2=random(5,15,1); $b=$a*$ans2; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$a*x= $b"); +$ans1 = Compute("$a*$var= $b"); +$ans1string = "$a*$var=$b"; +$ans1 = Compute($ans1string); ############################################## @@ -51,7 +56,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. [@numberWord($a,capital=>1)@] times a number is [@numberWord($b)@]. What is the number? @@ -67,13 +72,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -83,22 +89,23 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); $ans2 = $b/$a; ANS(Compute($ans2)->cmp); BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` [$a]x=[$b] ``] + [`` [$a][$var]=[$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - [$a]x &= [$b] \\ - \frac{[$a]x}{[$a]} &= \frac{[$b]}{[$a]} \\ - x &= [$ans2] + [$a][$var] &= [$b] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$b]}{[$a]} \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation40.pg index e3afa0939b..2ccc88a791 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation40.pg @@ -7,16 +7,18 @@ # Last updated: Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','multiply') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,10 +41,14 @@ $b=random(2,9,1); $ans2=$a*$b; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("x/$a= $b"); +$ans1 = Compute("$var/$a= $b"); + +$ans1string = "$var/$a=$b"; +$ans1 = Compute($ans1string); ############################################## @@ -51,7 +57,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. A number divided by [@numberWord($a)@] is [@numberWord($b)@]. What is the number? @@ -67,13 +73,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -83,22 +90,23 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); $ans2 = $b*$a; ANS(Compute($ans2)->cmp); BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` \frac{x}{[$a]} = [$b] ``] + [`` \frac{[$var]}{[$a]} = [$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - \frac{x}{[$a]} &= [$b] \\ - [$a] \cdot \frac{x}{[$a]} &= [$a] \cdot [$b] \\ - x &= [$ans2] + \frac{[$var]}{[$a]} &= [$b] \\ + [$a] \cdot \frac{[$var]}{[$a]} &= [$a] \cdot [$b] \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation50.pg index cbf11112dd..11d9bf8af0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation50.pg @@ -7,16 +7,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','subtract') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,11 +41,13 @@ $ans2=random(11,30,1); $b=$a+$ans2; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$a + x = $b"); +$ans1string = "$a+$var=$b"; +$ans1 = Compute($ans1string); ############################################## @@ -51,7 +55,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. The sum of [@numberWord($a)@] and a number is [@numberWord($b)@]. What is the number? @@ -67,13 +71,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -83,22 +88,23 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); $ans2 = $b-$a; ANS(Compute($ans2)->cmp); BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` x+[$a]=[$b] ``] + [`` [$var]+[$a]=[$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - x+[$a] &= [$b] \\ - x+[$a]\mathbf{{}-[$a]} &= [$b]\mathbf{{}-[$a]} \\ - x &= [$ans2] + [$var]+[$a] &= [$b] \\ + [$var]+[$a]\mathbf{{}-[$a]} &= [$b]\mathbf{{}-[$a]} \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation60.pg index 1d2a8b7ee6..6a3ac9ca2b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation60.pg @@ -7,16 +7,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','add') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,10 +41,13 @@ $ans2=random(30,50,1); $b=$ans2-$a; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("x - $a = $b"); + +$ans1string = "$var - $a = $b"; +$ans1 = Compute($ans1string); ############################################## @@ -51,7 +56,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. The difference between a number and [@numberWord($a)@] is [@numberWord($b)@]. What is the number? @@ -67,13 +72,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -83,22 +89,23 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); $ans2 = $b+$a; ANS(Compute($ans2)->cmp); BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` x-[$a]=[$b] ``] + [`` [$var]-[$a]=[$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - x-[$a] &= [$b] \\ - x-[$a]\mathbf{{}+[$a]} &= [$b]\mathbf{{}+[$a]} \\ - x &= [$ans2] + [$var]-[$a] &= [$b] \\ + [$var]-[$a]\mathbf{{}+[$a]} &= [$b]\mathbf{{}+[$a]} \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation70.pg index 3818610a47..ed3321bb49 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation70.pg @@ -7,16 +7,18 @@ # Last updated: Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,10 +41,13 @@ $ans2=random(5,15,1); $b=$a*$ans2; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$a*x= $b"); + +$ans1string = "$a*$var= $b"; +$ans1 = Compute($ans1string); ############################################## @@ -51,7 +56,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. The product of [@numberWord($a)@] and a number is [@numberWord($b)@]. What is the number? @@ -67,13 +72,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -83,22 +89,23 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); $ans2 = $b/$a; ANS(Compute($ans2)->cmp); BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` [$a]x=[$b] ``] + [`` [$a][$var]=[$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - [$a]x &= [$b] \\ - \frac{[$a]x}{[$a]} &= \frac{[$b]}{[$a]} \\ - x &= [$ans2] + [$a][$var] &= [$b] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$b]}{[$a]} \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation80.pg index 216a579f1b..94cdb0b14a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation80.pg @@ -7,16 +7,18 @@ # Last updated: Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','multiply') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,10 +41,13 @@ $b=random(2,9,1); $ans2=$a*$b; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("x/$a= $b"); + +$ans1string = "$var/$a= $b"; +$ans1 = Compute($ans1string); ############################################## @@ -51,7 +56,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. The quotient of a number and [@numberWord($a)@] is [@numberWord($b)@]. What is the number? @@ -67,13 +72,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -83,21 +89,22 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); ANS(Compute($ans2)->cmp); BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: - [`` \frac{x}{[$a]} = [$b] ``] + [`` \frac{[$var]}{[$a]} = [$b] ``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - \frac{x}{[$a]} &= [$b] \\ - [$a] \cdot \frac{x}{[$a]} &= [$a] \cdot [$b] \\ - x &= [$ans2] + \frac{[$var]}{[$a]} &= [$b] \\ + [$a] \cdot \frac{[$var]}{[$a]} &= [$a] \cdot [$b] \\ + [$var] &= [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation90.pg index ebc77f190a..cbf02f7ac8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/EnglishToMathEquation90.pg @@ -7,16 +7,18 @@ # Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','english-to-math','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "parserImplicitPlane.pl", "PCCmacros.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,10 +42,13 @@ $ans2=random(5,15,1); $b=$a+$m*$ans2; Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real'); Context()->flags->set(reduceConstants=>0); -$ans1 = Compute("$a+$m*x= $b"); + +$ans1string = "$a+$m*$var= $b"; +$ans1 = Compute($ans1string); if ($m==2) {$w = "twice";} else {$w = numberWord($m)." times";} @@ -56,7 +61,7 @@ TEXT(beginproblem()); BEGIN_PGML -Write an equation for the following situation, and then solve for the unknown. Please use [`x`] as the unknown variable. +Write an equation for the following situation, and then solve for the unknown. Please use [`[$var]`] as the unknown variable. [@numberWord($a,capital=>1)@] more than [$w] a number is [@numberWord($b)@]. What is the number? @@ -72,13 +77,14 @@ END_PGML ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -88,25 +94,26 @@ ANS($ans1->cmp( })); Context("LimitedNumeric"); +Context()->variables->are($var=>"Real"); ANS(Compute($ans2)->cmp); $s1=$b-$a; BEGIN_PGML_SOLUTION -Let the unknown number be [`x`]. The equation is: +Let the unknown number be [`[$var]`]. The equation is: [``[@Parser::Formula(Context("Typeset") , $ans1->{correct_ans})->TeX@]``] -Next, we solve for [`x`]: +Next, we solve for [`[$var]`]: [` \begin{aligned} - [$a] {}+[$m]x &\;=\; [$b] \\ - [$a] {}+[$m]x \mathbf{{} -[$a]} &\;=\; [$b]\mathbf{{} -[$a]} \\ - [$m]x &\;=\; [$s1] \\ - \frac{[$m]x}{[$m]} &\;=\; \frac{[$s1]}{[$m]} \\ - x &\;=\; [$ans2] + [$a] {}+[$m][$var] &\;=\; [$b] \\ + [$a] {}+[$m][$var] \mathbf{{} -[$a]} &\;=\; [$b]\mathbf{{} -[$a]} \\ + [$m][$var] &\;=\; [$s1] \\ + \frac{[$m][$var]}{[$m]} &\;=\; \frac{[$s1]}{[$m]} \\ + [$var] &\;=\; [$ans2] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath10.pg index ae18a7d742..1fb7f042e3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath10.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -29,12 +33,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = non_zero_random(1,10,1); @@ -45,7 +51,7 @@ $operation = $operations[$index]; -$ans = Compute("x+(-1)**($index)*$a")->reduce->reduce; +$ans = Compute("$var+(-1)**($index)*$a")->reduce->reduce; ############################################## @@ -53,7 +59,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a)@] [$operation] than a number diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath100.pg index eefce2951a..939040aa66 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath100.pg @@ -9,16 +9,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('equation','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -33,12 +36,14 @@ loadMacros( "PCCmacros.pl", "parserImplicitPlane.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $n = random(2,8,1); @@ -48,19 +53,27 @@ $b = $n*$sol + $a; Context("ImplicitPlane"); +Context()->variables->are($var=>"Real"); +Context()->noreduce('(-x)-y','(-x)+y'); Context()->flags->set(showExtraParens=>0); Context()->flags->set(reduceConstants=>0); -$ans = Compute("$n*x+$a=$b"); + +$ans1string = "$n*$var+$a=$b"; +$ans1 = Compute($ans1string); if ($n == 2) {$nString = 'twice';} else {$nString = numberWord($n).' times';}; +$left = Compute("$n*$var+$a")->reduce; +$right = Compute("$b"); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Translate the following sentence into a math equation. Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** The sum of [$nString] a number and [@numberWord($a)@] is [@numberWord($b)@]. @@ -70,15 +83,16 @@ END_PGML ############################################## -ANS($ans->cmp( +ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -97,11 +111,11 @@ The word 'is' implies equality. So we have The word 'sum' implies addition. The two objects being added are '[$nString] a number' and '[@numberWord($a)@]'. So we have: - The sum of [`[$n]x`] and [`[$a]`] [`=`] [`[$b]`]. + The sum of [`[$n][$var]`] and [`[$a]`] [`=`] [`[$b]`]. Lastly we write the additions symbolically: - [`[@Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX@]`] + [``[$left]=[$right]``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath110.pg index 627e32450a..1e7ebdf597 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath110.pg @@ -9,16 +9,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('equation','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -33,12 +36,14 @@ loadMacros( "PCCmacros.pl", "parserImplicitPlane.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $n = random(2,8,1); @@ -48,13 +53,20 @@ $b = $n*$sol - $a; Context("ImplicitPlane"); +Context()->variables->are($var=>"Real"); +Context()->noreduce('(-x)-y','(-x)+y'); Context()->flags->set(showExtraParens=>0); Context()->flags->set(reduceConstants=>0); -$ans = Compute("$n*x-$a=$b"); + +$ans1string = "$n*$var-$a=$b"; +$ans1 = Compute($ans1string); if ($n == 2) {$nString = 'twice';} else {$nString = numberWord($n).' times';}; $eqWord = list_random('is','gives','yields'); +$left = Compute("$n*$var-$a")->reduce; +$right = "$b"; + ############################################## @@ -62,7 +74,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following sentence into a math equation. Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a,capital=>1)@] less than [$nString] a number [$eqWord] [@numberWord($b)@]. @@ -72,15 +85,16 @@ END_PGML ############################################## -ANS($ans->cmp( +ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -102,7 +116,7 @@ The phrase 'less than' implies subtraction, and that '[@numberWord($a)@]' should So we have: - [`[@Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX@]`] + [``[$left]=[$right]``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath120.pg index 190c655292..e54e6b2a52 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath120.pg @@ -9,16 +9,20 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('equation','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + ############################################## @@ -32,12 +36,14 @@ loadMacros( "PCCmacros.pl", "parserImplicitPlane.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = random(2,8,1); $b = random(2,8,1); @@ -46,13 +52,20 @@ $sol = random(5,50,1); $c = $a*$sol+$b; Context("ImplicitPlane"); +Context()->variables->are($var=>"Real"); +Context()->noreduce('(-x)-y','(-x)+y'); Context()->flags->set(showExtraParens=>0); Context()->flags->set(reduceConstants=>0); -$ans = Compute("$a*x+$b=$c"); + +$ans1string = "$a*$var+$b=$c"; +$ans1 = Compute($ans1string); $eqWord = list_random('is','gives','yields'); $addPhrase = list_random('increased by', 'added to'); +$left = Compute("$a*$var+$b")->reduce; +$right = "$c"; + ############################################## @@ -60,7 +73,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following sentence into a math equation. Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** The product of [@numberWord($a)@] and a number, [$addPhrase] [@numberWord($b)@], [$eqWord] [@numberWord($c)@]. @@ -70,15 +84,16 @@ END_PGML ############################################## -ANS($ans->cmp( +ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -96,11 +111,11 @@ The word '[$eqWord]' implies equality. So we have The comma tells us that we should completely translate the content that comes before it, before we do anything else. The word 'product' implies multiplication. The two items to be multiplied are '[@numberWord($a)@]' and 'a number', so we have: - [`[$a]x`], [$addPhrase] [@numberWord($b)@] [`=`] [@numberWord($c)@]. + [`[$a][$var]`], [$addPhrase] [@numberWord($b)@] [`=`] [@numberWord($c)@]. -The phrase '[$addPhrase]' implies addition, so we add [`[$a]x`] and [`[$b]`] and have: +The phrase '[$addPhrase]' implies addition, so we add [`[$a][$var]`] and [`[$b]`] and have: - [`[@Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX@]`] + [``[$left]=[$right]``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath130.pg index 87aa03a76a..f61cd160d2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath130.pg @@ -9,16 +9,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('equation','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -33,12 +36,14 @@ loadMacros( "PCCmacros.pl", "parserImplicitPlane.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = random(2,8,1); $b = random(2,8,1); @@ -47,13 +52,19 @@ $sol = random(5,50,1); $c = $a*($sol+$b); Context("ImplicitPlane"); +Context()->variables->are($var=>"Real"); +Context()->noreduce('(-x)-y','(-x)+y'); Context()->flags->set(showExtraParens=>0); Context()->flags->set(reduceConstants=>0); -$ans = Compute("$a*(x+$b)=$c"); + +$ans1string = "$a*($var+$b)= $c"; +$ans1 = Compute($ans1string); $eqWord = list_random('is','gives','yields'); $addPhrase = list_random('increased by', 'added to'); +$left = Compute("$a*($var+$b)")->reduce; +$right = "$c"; ############################################## @@ -61,7 +72,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following sentence into a math equation. Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** The product of [@numberWord($a)@] and a number [$addPhrase] [@numberWord($b)@], [$eqWord] [@numberWord($c)@]. @@ -71,15 +83,16 @@ END_PGML ############################################## -ANS($ans->cmp( +ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -96,7 +109,7 @@ The word '[$eqWord]' implies equality. So we have The word 'product' implies multiplication. The two items to be multiplied are '[@numberWord($a)@]' and 'a number [$addPhrase] [@numberWord($b)@]'. Note that since there is no comma after 'a number', the second item to be multiplied is 'a number [$addPhrase] [@numberWord($b)@]', not just 'a number'. So we have: - [`[@Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX@]`] + [``[$left]=[$right]``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath140.pg index f08fd8ca4f..c776c403e9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath140.pg @@ -7,15 +7,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -28,19 +32,21 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(reduceConstants=>0); $a = 1; $b = non_zero_random(2,10,1); -$ans = Formula("$a/$b x"); +$ans = Formula("$a/$b $var"); ############################################## @@ -48,7 +54,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a/$b,denominator=>$b)@] of a number diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath150.pg index b0b02c443a..6830dc8cd8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath150.pg @@ -7,15 +7,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -28,19 +32,21 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(reduceConstants=>0); $a = random(2,30,1); $b = $a+random(1,30,1); -$ans = Formula("$a/$b x"); +$ans = Formula("$a/$b $var"); ############################################## @@ -48,7 +54,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a/$b,denominator=>$b)@] of a number diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath160.pg index ffcfeff55a..970f480d52 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath160.pg @@ -7,15 +7,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -28,12 +32,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(reduceConstants=>0); @@ -47,7 +53,7 @@ $opPhrase = $opWords[$index]; @toMaths = ('+','-'); $toMath = @toMaths[$index]; -$ans = Formula("x $toMath $a/$b x"); +$ans = Formula("$var $toMath $a/$b $var"); ############################################## @@ -55,7 +61,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** a number [$opPhrase] [@numberWord($a/$b,denominator=>$b)@] of itself diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath170.pg index aaf6873cb2..846e163c8c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath170.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath170.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -31,12 +34,14 @@ loadMacros( "PCCmacros.pl", "parserImplicitPlane.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(reduceConstants=>0); @@ -44,7 +49,7 @@ $a = random(1,3,1); do {$b = $a+random(1,8,1);} until (gcd($a,$b) == 1); $c = random(1,3,1); -do {$d = $a+random(1,8,1);} until (gcd($c,$d) == 1); +do {$d = $c+random(1,8,1);} until (gcd($c,$d) == 1); $index = random(0,1); @opWords = ("increased by", "decreased by"); @@ -54,9 +59,16 @@ $opPhrase = $opWords[$index]; $toMath = @toMaths[$index]; Context("ImplicitPlane"); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); Context()->flags->set(reduceConstants=>0); -$ans = Compute("x $toMath $a/$b=$c/$d x"); +$ans = Compute("$var $toMath $a/$b=$c/$d $var"); + +$ans1string = "$var $toMath $a/$b = $c/$d $var"; +$ans1 = Compute($ans1string); + +$left = Compute("$var $toMath $a/$b"); +$right = Compute("$c/$d $var"); ############################################## @@ -65,7 +77,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** A number [$opPhrase] [@numberWord($a/$b,denominator=>$b)@] is [@numberWord($c/$d,denominator=>$d)@] of that number. @@ -75,15 +88,16 @@ END_PGML ############################################## -ANS($ans->cmp( +ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -101,7 +115,7 @@ The word 'is' implies equality, so we have When a fraction precedes the word 'of', it implies that the fraction should be multiplied by what follows. Also the phrase '[$opPhrase]' implies that we should use the [`[$toMath]`] symbol and leave the order of the numbers in place. So the answer is - [`[@Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX@]`]. + [``[$left]=[$right]``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath180.pg index 55fb87c229..e46d0e66d7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath180.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath180.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -31,23 +34,23 @@ loadMacros( "PCCmacros.pl", "parserImplicitPlane.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(reduceConstants=>0); - do { -$a = random(1,3,1); -do {$b = $a+random(1,8,1);} until (gcd($a,$b) == 1); + $a = random(1,3,1); + do {$b = $a+random(1,8,1);} until (gcd($a,$b) == 1); -$c = random(1,3,1); -do {$d = $c+random(1,8,1);} until (gcd($c,$d) == 1); - -} until ($a*$d != $c*$b); + $c = random(1,3,1); + do {$d = $c+random(1,8,1);} until (gcd($c,$d) == 1); +} until ($a/$b != $c/$d); $e = random(1,9,1); @@ -61,9 +64,17 @@ $toMath = @toMaths[$index]; $eqWord = list_random('is', 'gives', 'yields'); Context("ImplicitPlane"); +Context()->variables->are($var=>"Real"); +Context()->noreduce('(-x)-y','(-x)+y'); Context()->flags->set(showExtraParens=>0); Context()->flags->set(reduceConstants=>0); -$ans = Compute("$a/$b x $toMath $e = $c/$d x"); +$ans = Compute("$a/$b $var $toMath $e = $c/$d $var"); + +$ans1string = "$a/$b $var $toMath $e = $c/$d $var"; +$ans1 = Compute($ans1string); + +$left = Compute("$a/$b $var $toMath $e"); +$right = Compute("$c/$d $var"); ############################################## @@ -72,7 +83,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($e,capital=>1)@] [$opPhrase] the product of [@numberWord($a/$b,denominator=>$b)@] and a number [$eqWord] [@numberWord($c/$d,denominator=>$d)@] of that number. @@ -82,15 +94,16 @@ END_PGML ############################################## -ANS($ans->cmp( +ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -108,15 +121,15 @@ The word '[$eqWord]' implies equality, so we have When a fraction precedes the word 'of', it implies that the fraction should be multiplied by what follows. So we have: - [@numberWord($e,capital=>1)@] [$opPhrase] the product of [@numberWord($a/$b,denominator=>$b)@] and a number [`=\frac{[$c]}{[$d]} x`] + [@numberWord($e,capital=>1)@] [$opPhrase] the product of [@numberWord($a/$b,denominator=>$b)@] and a number [`=\frac{[$c]}{[$d]} [$var]`] Also the phrase 'product of' implies that we should use multiplication. So we have: - [`[$e]`] [$opPhrase] [`\frac{[$a]}{[$b]}x=\frac{[$c]}{[$d]} x`] + [`[$e]`] [$opPhrase] [`\frac{[$a]}{[$b]}[$var]=\frac{[$c]}{[$d]} [$var]`] And the phrase '[$opPhrase]' indicates that we should use the [`[$toMath]`] symbol, but the order of the numbers needs to be reversed. So the answer is - [`[@Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX@]`] + [``[$left]=[$right]``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath20.pg index 130b72fa14..253db50007 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath20.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -29,12 +33,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = non_zero_random(1,10,1); @@ -44,7 +50,7 @@ $index = random(0,1,1); $operation = $operations[$index]; -$ans = Compute("x+(-1)**($index)*$a")->reduce->reduce; +$ans = Compute("$var+(-1)**($index)*$a")->reduce->reduce; ############################################## @@ -52,7 +58,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** the [$operation] a number and [@numberWord($a)@] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath25.pg index d65e018216..50b670c7d0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath25.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath25.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -29,12 +33,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = non_zero_random(1,10,1); @@ -44,7 +50,7 @@ $index = random(1,1,1); $operation = $operations[$index]; -$ans = Compute("$a+(-1)**($index)*x")->reduce->reduce; +$ans = Compute("$a+(-1)**($index)*$var")->reduce->reduce; ############################################## @@ -52,7 +58,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** the [$operation] [@numberWord($a)@] and a number diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath30.pg index 42dba68e79..060ef43a85 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath30.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -29,12 +33,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = non_zero_random(1,10,1); @@ -44,7 +50,7 @@ $index = random(0,1,1); $operation = $operations[$index]; -$ans = Compute("x+(-1)**($index)*$a")->reduce->reduce; +$ans = Compute("$var+(-1)**($index)*$a")->reduce->reduce; ############################################## @@ -52,7 +58,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a)@] [$operation] a number diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath40.pg index cc8a5f0c73..c691df202c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath40.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -29,12 +33,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = non_zero_random(1,10,1); @@ -44,7 +50,7 @@ $index = random(0,1,1); $operation = $operations[$index]; -$ans = Compute("$a+(-1)**($index)*x")->reduce->reduce; +$ans = Compute("$a+(-1)**($index)*$var")->reduce->reduce; ############################################## @@ -52,7 +58,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a)@] [$operation] a number diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath45.pg index 083533dc0c..b5319bbb9f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath45.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath45.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -29,12 +33,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = non_zero_random(1,10,1); @@ -44,7 +50,7 @@ $index = random(0,1,1); $operation = $operations[$index]; -$ans = Compute("x+(-1)**($index)*$a")->reduce->reduce; +$ans = Compute("$var+(-1)**($index)*$a")->reduce->reduce; ############################################## @@ -52,7 +58,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** a number [$operation] [@numberWord($a)@] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath50.pg index e5b17eb0b7..6d3dd8c6f7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath50.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -29,12 +33,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = non_zero_random(2,10,1); @@ -45,7 +51,7 @@ $index = random(0,1,1); $operation = $operations[$index]; -$ans = Compute("$a x+(-1)**($index)*$b")->reduce->reduce; +$ans = Compute("$a $var+(-1)**($index)*$b")->reduce->reduce; ############################################## @@ -53,7 +59,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a)@] times a number, [$operation] [@numberWord($b)@] @@ -73,7 +80,7 @@ if ($index == 1) BEGIN_PGML_SOLUTION -'[@numberWord($a)@] times a number' indicates [`[$a] x`]. The phrase '[$operation]' implies [$solnword]. [$subcomment]** So the answer is [` [$ans] `]. +'[@numberWord($a)@] times a number' indicates [`[$a] [$var]`]. The phrase '[$operation]' implies [$solnword]. [$subcomment]** So the answer is [` [$ans] `]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath55.pg index 0fc999fe15..428296f517 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath55.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath55.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -29,12 +33,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = non_zero_random(2,10,1); @@ -45,7 +51,7 @@ $index = random(0,1,1); $operation = $operations[$index]; -$ans = Compute("$a (x+(-1)**($index)*$b)")->reduce->reduce; +$ans = Compute("$a ($var+(-1)**($index)*$b)")->reduce->reduce; ############################################## @@ -53,7 +59,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a)@] times [@numberWord($b)@] [$operation] a number @@ -74,7 +81,7 @@ BEGIN_PGML_SOLUTION The lack of a comma in this phrase implies that the phrase should be read as '[@numberWord($a)@] times ([@numberWord($b)@] [$operation] a number)'. So the answer is [` [$ans] `]. -Note that it's wrong to answer [`[$a]x[$sign][$b]`]. Without the parentheses, we have to do multiplication first, and the corresponding sentence would be: +Note that it's wrong to answer [`[$a][$var][$sign][$b]`]. Without the parentheses, we have to do multiplication first, and the corresponding sentence would be: [`[$b]`] [$operation] [@numberWord($a)@] times a number. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath60.pg index 6b807606f3..7df48edf05 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath60.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -29,12 +33,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = non_zero_random(1,10,1); @@ -45,7 +51,7 @@ $index = random(0,1,1); $operation = $operations[$index]; -$ans = Compute("$b x +(-1)**($index)*$a")->reduce->reduce; +$ans = Compute("$b $var +(-1)**($index)*$a")->reduce->reduce; ############################################## @@ -53,7 +59,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a)@] [$operation] the product of [@numberWord($b)@] and a number @@ -73,7 +80,7 @@ if ($index == 1) BEGIN_PGML_SOLUTION -The word 'product' implies multiplication, so start with [`[$b]x`]. The phrase '[$operation]' implies [$solnword]. [$subcomment]** So the answer is [` [$ans] `]. +The word 'product' implies multiplication, so start with [`[$b][$var]`]. The phrase '[$operation]' implies [$solnword]. [$subcomment]** So the answer is [` [$ans] `]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath65.pg index 9c72da0fc6..271bda5f7b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath65.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath65.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -29,12 +33,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = non_zero_random(1,10,1); @@ -44,9 +50,9 @@ $bWord = numberWord($b); $word = $b==2 ? "twice" : "$bWord times"; -$ans = Compute("$b*x - $a")->reduce->reduce; +$ans = Compute("$b*$var - $a")->reduce->reduce; -$mistake = Compute("$a-$b*x")->reduce; +$mistake = Compute("$a-$b*$var")->reduce; ############################################## @@ -54,7 +60,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a)@] less than [$word] a number @@ -69,15 +76,15 @@ BEGIN_PGML_SOLUTION The phrase "[$word]" implies multiplication. So we have - [@numberWord($a)@] less than [`[$b]x`] + [@numberWord($a)@] less than [`[$b][$var]`] -The phrase "less than" implies subtraction, and that [`[$a]`] is being _subtracted from_ [`[$b]x`]. So the answer is [` [$ans] `]. +The phrase "less than" implies subtraction, and that [`[$a]`] is being _subtracted from_ [`[$b][$var]`]. So the answer is [` [$ans] `]. Note that a common mistake is to write: [`[$mistake]`]. To help you understand why this is incorrect, look at the following example. Assume Tom has [`10`] marbles. If Jerry has [`2`] less (or fewer) than Tom, then Jerry has [`8`] marbles. Notice that we translated "[`2`] less than [`10`]" into [`10-2`]. -Similarly, we should translate "[`[$a]`] less than [`[$b]x`]" into [`[$ans]`]. +Similarly, we should translate "[`[$a]`] less than [`[$b][$var]`]" into [`[$ans]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath70.pg index 209a49af22..6552278ea8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath70.pg @@ -8,15 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('expression','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -29,12 +33,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $a = non_zero_random(1,10,1); @@ -45,7 +51,7 @@ $index = random(0,1,1); $operation = $operations[$index]; -$ans = Compute("$b/x +(-1)**($index)*$a")->reduce->reduce; +$ans = Compute("$b/$var +(-1)**($index)*$a")->reduce->reduce; ############################################## @@ -53,7 +59,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following phrase into a math expression or equation (whichever is appropriate). Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a)@] [$operation] the quotient of [@numberWord($b)@] and a number @@ -73,7 +80,7 @@ if ($index == 1) BEGIN_PGML_SOLUTION -The word 'quotient' implies division, and that word implies division from left to right. So start with [`\frac{[$b]}{x}`]. The phrase '[$operation]' implies [$solnword]. [$subcomment]** So the answer is [` [$ans] `]. +The word 'quotient' implies division, and that word implies division from left to right. So start with [`\frac{[$b]}{[$var]}`]. The phrase '[$operation]' implies [$solnword]. [$subcomment]** So the answer is [` [$ans] `]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath80.pg index 2d7b4e57b0..909585ad5f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath80.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('equation','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -32,12 +35,14 @@ loadMacros( "PCCmacros.pl", "parserImplicitPlane.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); @@ -45,7 +50,7 @@ $a = random(2,10,1); $sol = random(1,8,1); $b = $a*$sol; -$ans = Compute("$a x=$b"); +$ans = Compute("$a $var=$b"); ############################################## @@ -53,7 +58,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following sentence into a math equation. Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** [@numberWord($a,capital=>1)@] times a number is [@numberWord($b)@]. @@ -72,6 +78,8 @@ ANS($ans->cmp( $result = ($correct == $student); my $context = Context(); Context("Typeset"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -86,7 +94,7 @@ BEGIN_PGML_SOLUTION The word 'is' implies equality. So we have - [`[$a]`] times [`x`] [`=`] [`[$b]`] + [`[$a]`] times [`[$var]`] [`=`] [`[$b]`] The word 'times' implies multiplication. So the equation we want is diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath82.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath82.pg index 14b16a592f..101b3ac39b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath82.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath82.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('equation','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -32,12 +35,14 @@ loadMacros( "PCCmacros.pl", "parserImplicitPlane.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("ImplicitPlane"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); $index = random(0,1,1); @@ -49,8 +54,18 @@ $sol = random(1,20,1); $a = $sol+random(1,40,1); $b = $a+(-1)**$index*$sol; -$ans = Compute("$a+x=$b") if ($index == 0); -$ans = Compute("$a-x=$b") if ($index == 1); + +if ($index==0) { + $ans1string = "$a+$var=$b"; + $ans1 = Compute($ans1string); + $left = Compute("$a+$var")->reduce; +} else { + $ans1string = "$a-$var=$b"; + $ans1 = Compute($ans1string); + $left = Compute("$a-$var")->reduce; +} + +$right = "$b"; ############################################## @@ -59,7 +74,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following sentence into a math equation. Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** The [$operation] [@numberWord($a)@] and a number is [@numberWord($b)@]. @@ -69,15 +85,16 @@ END_PGML ############################################## -ANS($ans->cmp( +ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -97,7 +114,7 @@ The word 'is' implies equality. So we have The phrase '[$operation]' implies [$solnword]. So the equation we want is - [`[@Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX@]`] + [``[$left]=[$right]``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath84.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath84.pg index 5e70283989..3ad4bc57a4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath84.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath84.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('equation','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -33,12 +36,14 @@ loadMacros( "parserImplicitPlane.pl", "contextFraction.pl", "contextTypeset.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Fraction"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); $sol = random(1,20,1); $a = $sol; @@ -52,14 +57,18 @@ $b = Fraction($sol,$a); ($bnum, $bden) = $b->value; Context("ImplicitPlane"); +Context()->variables->are($var=>"Real"); Context()->flags->set(showExtraParens=>0); Context()->flags->set(reduceConstants=>0); -$ans = Compute("x/$a=$bnum/$bden"); + +$ans1string = "$var/$a=$bnum/$bden"; +$ans1 = Compute($ans1string); $bperl = $sol/$a; $bdenom = ($b->value)[1]; - +$left = Compute("$var/$a"); +$right = "\frac{$bnum}{$bden}"; ############################################## @@ -68,7 +77,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following sentence into a math equation. Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** The quotient of a number and [@numberWord($a)@] is [@numberWord($bperl,denominator=>$bdenom)@]. @@ -78,15 +88,16 @@ END_PGML ############################################## -ANS($ans->cmp( +ANS($ans1->cmp( cmp_class => "a linear equation", - correct_ans=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->string, - correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX, + correct_ans=>Parser::Formula(Context("Typeset") , $ans1string)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ans1string)->TeX, checker => sub { my ($correct,$student,$ansHash) = @_; $result = ($correct == $student); my $context = Context(); Context("Typeset"); + Context()->variables->are($var=>"Real"); $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); $ansHash->{preview_text_string} = $student->string; $ansHash->{preview_latex_string} = $student->TeX; @@ -104,7 +115,7 @@ The word 'is' implies equality. So we have The word 'quotient' implies division, and that division is done left to right. So the equation we want is - [`[@Parser::Formula(Context("Typeset") , $ans->{correct_ans})->TeX@]`] + [``[$left]=[$right]``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath90.pg index a8395bc084..0bdb4a57ad 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EnglishToMath/englishToMath90.pg @@ -10,16 +10,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.a') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Algebraic expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(English_to_expression) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('equation','english-to-math') +## DBCCSS('6.EE.2.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + @@ -34,12 +37,14 @@ loadMacros( "PCCmacros.pl", "parserImplicitEquation.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Fraction"); +$var=RandomVariableName(); +Context()->variables->are($var=>"Real"); do { $a = random(2,30,1); @@ -48,12 +53,12 @@ $b = Fraction($a,$sol); Context("ImplicitEquation"); +Context()->variables->are($var=>"Real"); Context()->flags->set(reduceConstants=>0,ImplicitPointTolerance => 1E-6); -Context()->variables->are(x=>'Real'); Context()->variables->set( - x=>{limits=>[$sol-1E-6,$sol+1E-6]} + $var=>{limits=>[$sol-1E-6,$sol+1E-6]} ); -$ans = ImplicitEquation("$a/x=$b"); +$ans = ImplicitEquation("$a/$var=$b"); $bperl = $a/$sol; @@ -65,7 +70,8 @@ TEXT(beginproblem()); BEGIN_PGML -Translate the following sentence into a math equation. Use [`x`] to represent the unknown number. +Translate the following phrase or sentence into a math expression or equation (whichever is appropriate). +[@KeyboardInstructions('Use [`[$var]`] to represent the unknown number.')@]** The quotient of [@numberWord($a)@] and a number is [@numberWord($bperl,denominator=>$bdenom)@]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg index 560354478b..d692fd408b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg @@ -7,31 +7,32 @@ # Last updated Carl Yao 9/4/13; # ENDDESCRIPTION -## DBCCSS('A-REI.12') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphs_of_linear_inequalities) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') ## KEYWORDS('linear','inequality','graph','two variables') +## DBCCSS('A-REI.12') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +41,7 @@ TEXT(beginproblem()); $symbol = '\geq'; Context("Numeric"); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg index ff9a9e4c3f..61d9d99179 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg @@ -6,32 +6,33 @@ # Last updated Carl Yao 9/4/13; # ENDDESCRIPTION -## DBCCSS('A-REI.12') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphs_of_linear_inequalities_word_problem) -## MLTleader(1) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') ## KEYWORDS('linear','inequality','graph','two variables','application') +## DBCCSS('A-REI.12') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "contextCurrency.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -41,7 +42,7 @@ $symbol = '\leq'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); @@ -180,7 +181,7 @@ The correct graph is: $PAR \{ $radio->buttons() \} $PAR -\{ EnlargeImageStatement \} +\{ EnlargeImageStatement() \} $PAR $BCENTER diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg index ed4b9db83f..d11a3308ff 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg @@ -6,31 +6,33 @@ # Last updated Carl Yao 9/4/13; # ENDDESCRIPTION -## DBCCSS('A-REI.12') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphs_of_linear_inequalities_word_problem) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') ## KEYWORDS('linear','inequality','graph','two variables','application') +## DBCCSS('A-REI.12') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "contextCurrency.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +42,7 @@ $symbol = '<'; Context("Currency"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); @@ -185,7 +187,7 @@ The correct graph is: $PAR \{ $radio->buttons() \} $PAR -\{ EnlargeImageStatement \} +\{ EnlargeImageStatement() \} $PAR $BCENTER diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg index db1eb63751..bfb1c13377 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg @@ -7,30 +7,32 @@ # Last updated Carl Yao 9/4/13; # ENDDESCRIPTION -## DBCCSS('A-REI.12') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphs_of_linear_inequalities) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') ## KEYWORDS('linear','inequality','graph','two variables') +## DBCCSS('A-REI.12') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +41,7 @@ TEXT(beginproblem()); $symbol = '<'; Context("Numeric"); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg index d92bb55fde..afa96e5465 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg @@ -7,30 +7,32 @@ # Last updated Carl Yao 9/4/13; # ENDDESCRIPTION -## DBCCSS('A-REI.12') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphs_of_linear_inequalities) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') ## KEYWORDS('linear','inequality','graph','two variables') +## DBCCSS('A-REI.12') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +42,7 @@ $symbol = '>'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg index b0f591a99e..bedfab2a8f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg @@ -7,30 +7,32 @@ # Last updated Carl Yao 9/4/13; # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## KEYWORDS('linear','inequality','graph','two variables') ## DBCCSS('A-REI.12') -## KEYWORDS('linear','inequality','graph','two variables' -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphs_of_linear_inequalities) -## Level(2) -## MO(1) +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +42,7 @@ $symbol = '\le'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg index be258a2cde..9e179401c5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg @@ -7,30 +7,32 @@ # Last updated Carl Yao 9/4/13; # ENDDESCRIPTION -## DBCCSS('A-REI.12') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphs_of_linear_inequalities) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') ## KEYWORDS('linear','inequality','graph','two variables') +## DBCCSS('A-REI.12') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +42,7 @@ $symbol = '\ge'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg index 8e03d0f0b5..6c31cdd7f9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg @@ -7,30 +7,32 @@ # Last updated Carl Yao 9/4/13; # ENDDESCRIPTION -## DBCCSS('A-REI.12') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphs_of_linear_inequalities) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') ## KEYWORDS('linear','inequality','graph','two variables') +## DBCCSS('A-REI.12') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +42,7 @@ $symbol = '<'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg index 9c6cee5c6b..0afc0e147e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg @@ -7,30 +7,32 @@ # Last updated Carl Yao 9/4/13; # ENDDESCRIPTION -## DBCCSS('A-REI.12') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphs_of_linear_inequalities) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') ## KEYWORDS('linear','inequality','graph','two variables') +## DBCCSS('A-REI.12') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +42,7 @@ $symbol = '>'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg index 06a523da56..adfd1c1231 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg @@ -7,30 +7,32 @@ # Last updated Carl Yao 9/4/13; # ENDDESCRIPTION -## DBCCSS('A-REI.12') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphs_of_linear_inequalities) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') ## KEYWORDS('linear','inequality','graph','two variables') +## DBCCSS('A-REI.12') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +42,7 @@ $symbol = '\leq'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg index 512946b988..194bdee18a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg @@ -7,30 +7,32 @@ # Last updated Carl Yao 9/4/13; # ENDDESCRIPTION -## DBCCSS('A-REI.12') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphs_of_linear_inequalities) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') ## KEYWORDS('linear','inequality','graph','two variables') +## DBCCSS('A-REI.12') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +42,7 @@ $symbol = '<'; Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot40.pg index 11e221fc71..09d9dc81ea 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot40.pg @@ -7,17 +7,18 @@ # Last updated: Carl Yao, 9/4/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3','6.EE.5') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(inequality_check_solution) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','two variables') +## DBCCSS('7.EE.4','A-REI.3','6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,8 +29,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "unionTables.pl", + "PGchoicemacros.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot50.pg index c6ec0c3ca4..5445b50e1c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot50.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 9/4/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3','6.EE.5') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(inequality_check_solution) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','two variables') +## DBCCSS('7.EE.4','A-REI.3','6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -191,3 +193,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot60.pg index 7c7b58c9cc..5726eec505 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot60.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 9/4/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3','6.EE.5') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(inequality_check_solution) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','two variables') +## DBCCSS('7.EE.4','A-REI.3','6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot70.pg index efd7645d24..7710c9aeaf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot70.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 9/4/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3','6.EE.5') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(inequality_check_solution) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','two variables') +## DBCCSS('7.EE.4','A-REI.3','6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot80.pg index 0da6d310f8..7f9e17e1e5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot80.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 9/4/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3','6.EE.5') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(inequality_check_solution) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','two variables') +## DBCCSS('7.EE.4','A-REI.3','6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot90.pg index f2c3e69af4..e07f2d1f4b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot90.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 9/4/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3','6.EE.5') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(inequality_check_solution) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','two variables') +## DBCCSS('7.EE.4','A-REI.3','6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable10.pg index 59546583ab..7c5f800c1f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable10.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 10/03/16 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(lineeqfromtable) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable20.pg index 023c06afc3..e9255687fb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable20.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 10/03/16 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(lineeqfromtable) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable30.pg index 1fc5329418..04a9e55bce 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable30.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 10/03/16 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear functions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(lineeqfromtable) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable40.pg index 6ce5fc262d..0adcb95ceb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable40.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 10/03/16 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(lineeqfromtable) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable50.pg index c02f3b186a..64da1e5b93 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearEquationByTable50.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 10/03/16 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(lineeqfromtable) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot10.pg index 4ddae0ebbe..5c16edf381 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot10.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 10/03/16 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear functions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(isitlinear) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot20.pg index de32ca37f8..3d6f491e57 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot20.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 10/03/16 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear functions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(isitlinear) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot30.pg index a8ec03bd20..9c97c8545d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/LinearOrNot30.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 10/03/16 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear functions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(isitlinear) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMXPlusB.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMXPlusB.pg new file mode 100644 index 0000000000..0f0f08d0f3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMXPlusB.pg @@ -0,0 +1,78 @@ +# Plot four points with a simple linear relation. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +my $m = list_random(-4..-2,2..4); +my $b = non_zero_random(-7,7,1); +$f = Formula("$m x+$b")->reduce; + +@xs = num_sort(-8,8,int((-8-$b)/$m),int((8-$b)/$m)); +$minx = $xs[1]; +$maxx = $xs[2]; +$n = $maxx - $minx + 1; + +@point = map {Point($_,$f->eval(x=>$_))} ($minx..$maxx); +$points = '{point,'.join('},{point,',@point).'}'; + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $extra = 0; + my $distinct = 0; + my @errors; + my $count = 0; + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) ne 'point' || ($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The $nth plotted point is incorrect."); + $extra++; + next STUDENTS; + } + for my $i (0..($count-2)) { + next STUDENTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinct++; + } + push(@errors, "You've only plotted $distinct correct point".(($distinct > 1)?'s':'').".") if ($distinct > 0 && $distinct < $n); + return (scalar(@{$correct})*min($distinct,$n)/$n/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Graph as many points as fit in the given viewing window for the equation [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMinusXPlusB.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMinusXPlusB.pg new file mode 100644 index 0000000000..94e5566e09 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotMinusXPlusB.pg @@ -0,0 +1,73 @@ +# Plot four points with a simple linear relation. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +my $b = non_zero_random(-7,7,1); +$f = Formula("-x+$b")->reduce; +$minx = max(-8,$b-8); +$maxx = min(8,$b+8); +@point = map {Point($_,$f->eval(x=>$_))} ($minx..$maxx); +$points = '{point,'.join('},{point,',@point).'}'; + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $extra = 0; + my $distinct = 0; + my @errors; + my $count = 0; + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) ne 'point' || ($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The $nth plotted point is incorrect."); + $extra++; + next STUDENTS; + } + for my $i (0..($count-2)) { + next STUDENTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinct++; + } + push(@errors, "You've only plotted $distinct correct point".(($distinct > 1)?'s':'').".") if ($distinct > 0 && $distinct < 4); + return (scalar(@{$correct})*min($distinct,4)/4/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Graph at least four points for the equation [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotXSquaredMinusB.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotXSquaredMinusB.pg new file mode 100644 index 0000000000..181c547606 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PlotXSquaredMinusB.pg @@ -0,0 +1,77 @@ +# Plot four points with a simple linear relation. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +$b = random(-6,-1,1); +$f = Formula("x^2+$b")->reduce; + +@xs = num_sort(-8,8,int(sqrt(8-$b)),int(-sqrt(8-$b))); +$minx = $xs[1]; +$maxx = $xs[2]; +$n = $maxx - $minx + 1; + +@point = map {Point($_,$f->eval(x=>$_))} ($minx..$maxx); +$points = '{point,'.join('},{point,',@point).'}'; + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $extra = 0; + my $distinct = 0; + my @errors; + my $count = 0; + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) ne 'point' || ($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The $nth plotted point is incorrect."); + $extra++; + next STUDENTS; + } + for my $i (0..($count-2)) { + next STUDENTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinct++; + } + push(@errors, "You've only plotted $distinct correct point".(($distinct > 1)?'s':'').".") if ($distinct > 0 && $distinct < $n); + return (scalar(@{$correct})*min($distinct,$n)/$n/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Graph as many points as fit in the given viewing window for the equation [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot10.pg index 29399d27b5..85ce7e876f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot10.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## MLTleader(1) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot100.pg index adc59125d3..187aee4af7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot100.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,21 +60,19 @@ $mc = new_checkbox_multiple_choice(); $mc -> qa ( "Which of the following ordered pairs are solutions to the given equation? There may be more than one correct answer.", -"\( $pt[0]\)$BR", -"\( $pt[2]\)$BR", +general_math_ev3($pt[0]), +general_math_ev3($pt[2]), ); $mc -> extra( -"\( $pt[1]\)$BR", -"\( $pt[3]\)$BR", +general_math_ev3($pt[1]), +general_math_ev3($pt[3]), ); ############################################## TEXT(beginproblem()); BEGIN_PGML -Consider the equation - - [` x+[$a]=0`] +Consider the equation: [```x+[$a]=0```] [@ $mc -> print_q() @]* diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot110.pg index df15035b17..ea3b11a126 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot110.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation','fraction') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot120.pg index 94a7ae59b1..3b4e01f782 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot120.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation','fraction') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot130.pg index 2159df8606..d4ede3df17 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot130.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation','fraction') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot140.pg index b3eb675c13..5f285f2419 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot140.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation','fraction') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,12 +64,12 @@ $mc = new_checkbox_multiple_choice(); $mc -> qa ( "Which of the following ordered pairs are solutions to the given equation? There may be more than one correct answer.", -"\( $pt[0]\)$BR", -"\( $pt[3]\)$BR", +general_math_ev3($pt[0]).$BR, +general_math_ev3($pt[3]).$BR, ); $mc -> extra( -"\( $pt[2]\)$BR", -"\( $pt[1]\)$BR", +general_math_ev3($pt[2]).$BR, +general_math_ev3($pt[1]).$BR, ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot150.pg index 2934870bc0..a40e6de509 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot150.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation','fraction') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,12 +64,12 @@ $mc = new_checkbox_multiple_choice(); $mc -> qa ( "Which of the following ordered pairs are solutions to the given equation? There may be more than one correct answer.", -"\( $pt[1]\)$BR", -"\( $pt[2]\)$BR", +general_math_ev3($pt[1]).$BR, +general_math_ev3($pt[2]).$BR, ); $mc -> extra( -"\( $pt[0]\)$BR", -"\( $pt[3]\)$BR", +general_math_ev3($pt[0]).$BR, +general_math_ev3($pt[3]).$BR, ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot20.pg index f4e6347c4c..19c4b4882d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot20.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot30.pg index 07694c6c2f..b4c27ac55d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot30.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot40.pg index b93576017d..ea13c4e03f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot40.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,12 +64,12 @@ $mc -> qa ( "Which of the following ordered pairs are solutions to the given equation? There may be more than one correct answer.", -"\( $pt[1]\)$BR", -"\( $pt[3]\)$BR", +general_math_ev3($pt[1]).$BR, +general_math_ev3($pt[3]).$BR, ); $mc -> extra( -"\( $pt[0]\)$BR", -"\( $pt[2]\)$BR", +general_math_ev3($pt[0]).$BR, +general_math_ev3($pt[2]).$BR, ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot50.pg index 26e8e5b5c5..79cbe4288c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot50.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,12 +64,12 @@ $mc = new_checkbox_multiple_choice(); $mc -> qa ( "Which of the following ordered pairs are solutions to the given equation? There may be more than one correct answer.", -"\( $pt[0]\)$BR", -"\( $pt[1]\)$BR", -"\( $pt[2]\)$BR", +general_math_ev3($pt[0]).$BR, +general_math_ev3($pt[1]).$BR, +general_math_ev3($pt[2]).$BR, ); $mc -> extra( -"\( $pt[3]\)$BR", +general_math_ev3($pt[3]).$BR, ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot60.pg index b8867e5b71..2fee46454e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot60.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot70.pg index 9d6ca3435a..65ccc24c28 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot70.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot80.pg index a3e78429f6..ea9e2054c2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot80.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot90.pg index 5810bd2fed..428f2f5858 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot90.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(equality_check_solution) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinate','cartesian','line','linear','equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGML.pl", "unionTables.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,21 +60,19 @@ $mc = new_checkbox_multiple_choice(); $mc -> qa ( "Which of the following ordered pairs are solutions to the given equation? There may be more than one correct answer.", -"\( $pt[0]\)$BR", -"\( $pt[3]\)$BR", +general_math_ev3($pt[0]), +general_math_ev3($pt[3]), ); $mc -> extra( -"\( $pt[1]\)$BR", -"\( $pt[2]\)$BR", +general_math_ev3($pt[1]), +general_math_ev3($pt[2]), ); ############################################## TEXT(beginproblem()); BEGIN_PGML -Consider the equation - - [` y=[$a]`] +Consider the equation: [```y=[$a]```] [@ $mc -> print_q() @]* diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine10.pg index 75eb8b1e37..ac077f3645 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine10.pg @@ -6,16 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## MLTleader(1) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -87,11 +89,11 @@ $PAR \{ DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], ["\($x0\)","\($ans01\)", "\($ans02\)"], -["\($x1\)",ans_rule(5), ans_rule(10)], -["\($x2\)",ans_rule(5), ans_rule(10)], -["\($x3\)",ans_rule(5), ans_rule(10)], -["\($x4\)",ans_rule(5), ans_rule(10)], -["\($x5\)",ans_rule(5), ans_rule(10)], +["\($x1\)",ans_rule(3), ans_rule(6)], +["\($x2\)",ans_rule(3), ans_rule(6)], +["\($x3\)",ans_rule(3), ans_rule(6)], +["\($x4\)",ans_rule(3), ans_rule(6)], +["\($x5\)",ans_rule(3), ans_rule(6)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \( y=$m x \)", captioncss =>"padding:4pt; text-decoration:none;"); \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine100.pg index 500bb005fd..f07309d6c2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine100.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -89,11 +92,11 @@ $PAR \{ DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], ["\($x0\)","\($ans01\)", "\($ans02\)"], -["\($x1\)",ans_rule(5), ans_rule(10)], -["\($x2\)",ans_rule(5), ans_rule(10)], -["\($x3\)",ans_rule(5), ans_rule(10)], -["\($x4\)",ans_rule(5), ans_rule(10)], -["\($x5\)",ans_rule(5), ans_rule(10)], +["\($x1\)",ans_rule(3), ans_rule(6)], +["\($x2\)",ans_rule(3), ans_rule(6)], +["\($x3\)",ans_rule(3), ans_rule(6)], +["\($x4\)",ans_rule(3), ans_rule(6)], +["\($x5\)",ans_rule(3), ans_rule(6)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \( y=-\frac{$num}{$den} x \)", captioncss =>"padding:4pt; text-decoration:none;"); \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine110.pg index 1336c33d7f..1afdf0ebd0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine110.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -84,17 +87,19 @@ Context()->texStrings; BEGIN_TEXT $PAR -Fill out this table for the equation \( y=\frac{$num}{$den} x +$b \). The first row is an example. +Make a table for the equation. +$PAR +The first row is an example. $PAR \{ -DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y=\frac{$num}{$den} x +$b\)",header=>"CH"},{data=>"Points",header=>"CH"},], ["\($x0\)","\($ans01\)","\($ans02\)"], -["\($x1\)",ans_rule(5), ans_rule(10)], -["\($x2\)",ans_rule(5), ans_rule(10)], -["\($x3\)",ans_rule(5), ans_rule(10)], -["\($x4\)",ans_rule(5), ans_rule(10)], -["\($x5\)",ans_rule(5), ans_rule(10)], +["\($x1\)",ans_rule(3), ans_rule(6)], +["\($x2\)",ans_rule(3), ans_rule(6)], +["\($x3\)",ans_rule(3), ans_rule(6)], +["\($x4\)",ans_rule(3), ans_rule(6)], +["\($x5\)",ans_rule(3), ans_rule(6)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \(y=\frac{$num}{$den} x +$b\)", captioncss =>"padding:4pt; text-decoration:none;"); \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine120.pg index 6bdf96db3b..008cb51acc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine120.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -84,17 +87,19 @@ Context()->texStrings; BEGIN_TEXT $PAR -Fill out this table for the equation \( y=-\frac{$num}{$den} x +$b \). The first row is an example. +Make a table for the equation. +$PAR +The first row is an example. $PAR \{ -DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y=-\frac{$num}{$den} x +$b\)",header=>"CH"},{data=>"Points",header=>"CH"},], ["\($x0\)","\($ans01\)", "\($ans02\)"], -["\($x1\)",ans_rule(5), ans_rule(10)], -["\($x2\)",ans_rule(5), ans_rule(10)], -["\($x3\)",ans_rule(5), ans_rule(10)], -["\($x4\)",ans_rule(5), ans_rule(10)], -["\($x5\)",ans_rule(5), ans_rule(10)], +["\($x1\)",ans_rule(3), ans_rule(6)], +["\($x2\)",ans_rule(3), ans_rule(6)], +["\($x3\)",ans_rule(3), ans_rule(6)], +["\($x4\)",ans_rule(3), ans_rule(6)], +["\($x5\)",ans_rule(3), ans_rule(6)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \( y=-\frac{$num}{$den} x +$b \)", captioncss =>"padding:4pt; text-decoration:none;"); \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine20.pg index 854ba839b3..2efb611ba3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine20.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -86,11 +89,11 @@ $PAR \{ DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], ["\($x0\)","\($ans01\)", "\($ans02\)"], -["\($x1\)",ans_rule(5), ans_rule(10)], -["\($x2\)",ans_rule(5), ans_rule(10)], -["\($x3\)",ans_rule(5), ans_rule(10)], -["\($x4\)",ans_rule(5), ans_rule(10)], -["\($x5\)",ans_rule(5), ans_rule(10)], +["\($x1\)",ans_rule(3), ans_rule(6)], +["\($x2\)",ans_rule(3), ans_rule(6)], +["\($x3\)",ans_rule(3), ans_rule(6)], +["\($x4\)",ans_rule(3), ans_rule(6)], +["\($x5\)",ans_rule(3), ans_rule(6)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \( y=$m x \)", captioncss =>"padding:4pt; text-decoration:none;"); \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine30.pg index d51729f8d1..f8eaf81251 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine30.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -89,11 +92,11 @@ $PAR \{ DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], ["\($x0\)","\($ans01\)","\($ans02\)"], -["\($x1\)",ans_rule(5), ans_rule(10)], -["\($x2\)",ans_rule(5), ans_rule(10)], -["\($x3\)",ans_rule(5), ans_rule(10)], -["\($x4\)",ans_rule(5), ans_rule(10)], -["\($x5\)",ans_rule(5), ans_rule(10)], +["\($x1\)",ans_rule(3), ans_rule(6)], +["\($x2\)",ans_rule(3), ans_rule(6)], +["\($x3\)",ans_rule(3), ans_rule(6)], +["\($x4\)",ans_rule(3), ans_rule(6)], +["\($x5\)",ans_rule(3), ans_rule(6)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \(y=$func\)", captioncss =>"padding:4pt; text-decoration:none;"); \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine40.pg index b4b6fa711b..9d05a4d96d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine40.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -81,17 +84,19 @@ Context()->texStrings; BEGIN_TEXT $PAR -Fill out this table for the equation \( y=$func \). The first row is an example. +Make a table for the equation. +$PAR +The first row is an example. $PAR \{ -DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y=$func\)",header=>"CH"},{data=>"Points",header=>"CH"},], ["\($x0\)","\($ans01\)", "\($ans02\)"], -["\($x1\)",ans_rule(5), ans_rule(10)], -["\($x2\)",ans_rule(5), ans_rule(10)], -["\($x3\)",ans_rule(5), ans_rule(10)], -["\($x4\)",ans_rule(5), ans_rule(10)], -["\($x5\)",ans_rule(5), ans_rule(10)], +["\($x1\)",ans_rule(3), ans_rule(6)], +["\($x2\)",ans_rule(3), ans_rule(6)], +["\($x3\)",ans_rule(3), ans_rule(6)], +["\($x4\)",ans_rule(3), ans_rule(6)], +["\($x5\)",ans_rule(3), ans_rule(6)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \( y=$func \)", captioncss =>"padding:4pt; text-decoration:none;"); \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine50.pg index 715e1513e0..210d47f989 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine50.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -82,17 +85,19 @@ Context()->texStrings; BEGIN_TEXT $PAR -Fill out this table for the equation \( y=$func \). The first row is an example. +Make a table for the equation. +$PAR +The first row is an example. $PAR \{ -DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y=$func\)",header=>"CH"},{data=>"Points",header=>"CH"},], ["\($x0\)","\($ans01\)","\($ans02\)"], -["\($x1\)",ans_rule(5), ans_rule(10)], -["\($x2\)",ans_rule(5), ans_rule(10)], -["\($x3\)",ans_rule(5), ans_rule(10)], -["\($x4\)",ans_rule(5), ans_rule(10)], -["\($x5\)",ans_rule(5), ans_rule(10)], +["\($x1\)",ans_rule(3), ans_rule(6)], +["\($x2\)",ans_rule(3), ans_rule(6)], +["\($x3\)",ans_rule(3), ans_rule(6)], +["\($x4\)",ans_rule(3), ans_rule(6)], +["\($x5\)",ans_rule(3), ans_rule(6)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \(y=$func\)", captioncss =>"padding:4pt; text-decoration:none;"); \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine60.pg index 9a70e8606f..6db939a334 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine60.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -82,11 +85,13 @@ Context()->texStrings; BEGIN_TEXT $PAR -Fill out this table for the equation \( y=$func \). The first row is an example. +Make a table for the equation. +$PAR +The first row is an example. $PAR \{ -DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y=$func\)",header=>"CH"},{data=>"Points",header=>"CH"},], [{data=>"\($x0\)",rowcss=>"border:1px solid"},"\($ans01\)","\($ans02\)"], [{data=>"\($x1\)",rowcss=>"border:1px solid"},ans_rule(5),ans_rule(10)], [{data=>"\($x2\)",rowcss=>"border:1px solid"},ans_rule(5),ans_rule(10)], diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine70.pg index fbd4425c4e..c0f96f1f2a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine70.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -88,11 +91,11 @@ $PAR \{ DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], ["\($x0\)","\($ans01\)", "\($ans02\)"], -["\($x1\)",ans_rule(5), ans_rule(10)], -["\($x2\)",ans_rule(5), ans_rule(10)], -["\($x3\)",ans_rule(5), ans_rule(10)], -["\($x4\)",ans_rule(5), ans_rule(10)], -["\($x5\)",ans_rule(5), ans_rule(10)], +["\($x1\)",ans_rule(3), ans_rule(6)], +["\($x2\)",ans_rule(3), ans_rule(6)], +["\($x3\)",ans_rule(3), ans_rule(6)], +["\($x4\)",ans_rule(3), ans_rule(6)], +["\($x5\)",ans_rule(3), ans_rule(6)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \(y=$func\)", captioncss =>"padding:4pt; text-decoration:none;"); \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine80.pg index 4703aa759b..6cd4854740 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine80.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -75,11 +78,11 @@ $PAR \{ DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], ["\($b\)","\($y0\)","\($ans02\)"], -[ans_rule(5),"\($y1\)", ans_rule(10)], -[ans_rule(5),"\($y2\)", ans_rule(10)], -[ans_rule(5),"\($y3\)", ans_rule(10)], -[ans_rule(5),"\($y4\)", ans_rule(10)], -[ans_rule(5),"\($y5\)", ans_rule(10)], +[ans_rule(3),"\($y1\)", ans_rule(6)], +[ans_rule(3),"\($y2\)", ans_rule(6)], +[ans_rule(3),"\($y3\)", ans_rule(6)], +[ans_rule(3),"\($y4\)", ans_rule(6)], +[ans_rule(3),"\($y5\)", ans_rule(6)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \(x=$b\)", captioncss =>"padding:4pt; text-decoration:none;"); \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine90.pg index 7f4cece8ab..723e0586a6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine90.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -89,12 +92,12 @@ $PAR \{ DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},{data=>"Points",header=>"CH"},], ["\($x0\)","\($ans01\)", "\($ans02\)"], -["\($x1\)",ans_rule(5), ans_rule(10)], -["\($x2\)",ans_rule(5), ans_rule(10)], -["\($x3\)",ans_rule(5), ans_rule(10)], -["\($x4\)",ans_rule(5), ans_rule(10)], -["\($x5\)",ans_rule(5), ans_rule(10)], -], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \( y=-\frac{$num}{$den} x \)", captioncss =>"padding:4pt; text-decoration:none;"); +["\($x1\)",ans_rule(3), ans_rule(6)], +["\($x2\)",ans_rule(3), ans_rule(6)], +["\($x3\)",ans_rule(3), ans_rule(6)], +["\($x4\)",ans_rule(3), ans_rule(6)], +["\($x5\)",ans_rule(3), ans_rule(6)], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \( y=\frac{$num}{$den} x \)", captioncss =>"padding:4pt; text-decoration:none;"); \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable10.pg index 22ba696f2f..6e0a21b597 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable10.pg @@ -6,16 +6,18 @@ # Last updated: Jordan, 8/7/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGML.pl", "pccTables.pl", "parserMultiAnswer.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -92,16 +94,14 @@ $multians = MultiAnswer(@defaultAnswers)->with( ############################################## -BEGIN_PGML - -Make a table of solutions for the equation [`[$left]=[$right]`]. - -END_PGML Context()->texStrings; BEGIN_TEXT +Make a table for the equation. +$PAR + \{ -DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},], +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y=$right\)",header=>"CH"},], [$multians->ans_rule(8), $multians->ans_rule(8)], [$multians->ans_rule(8), $multians->ans_rule(8)], [$multians->ans_rule(8), $multians->ans_rule(8)], diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable20.pg index 87fd09aadf..e05c9c5dbc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable20.pg @@ -6,16 +6,18 @@ # Last updated: Jordan, 8/7/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGML.pl", "pccTables.pl", "parserMultiAnswer.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -94,16 +96,14 @@ $multians = MultiAnswer(@defaultAnswers)->with( ############################################## -BEGIN_PGML - -Make a table of solutions for the equation [`[$left]=[$right]`]. - -END_PGML Context()->texStrings; BEGIN_TEXT +Make a table for the equation. +$PAR + \{ -DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},], +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y=$right\)",header=>"CH"},], [$multians->ans_rule(8), $multians->ans_rule(8)], [$multians->ans_rule(8), $multians->ans_rule(8)], [$multians->ans_rule(8), $multians->ans_rule(8)], diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable30.pg index ef8614505d..675fadacd0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable30.pg @@ -6,16 +6,18 @@ # Last updated: Jordan, 8/7/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGML.pl", "pccTables.pl", "parserMultiAnswer.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable40.pg index 8fcbc4121f..f374bbdc27 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable40.pg @@ -6,16 +6,18 @@ # Last updated: Jordan, 8/7/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGML.pl", "pccTables.pl", "parserMultiAnswer.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable50.pg index e0febf8d7a..bb6589f716 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable50.pg @@ -6,16 +6,18 @@ # Last updated: Jordan, 8/7/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "pccTables.pl", "parserMultiAnswer.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -98,16 +100,14 @@ $multians = MultiAnswer(@defaultAnswers)->with( ############################################## -BEGIN_PGML - -Make a table of solutions for the equation [`[$left]=[$right]`]. - -END_PGML Context()->texStrings; BEGIN_TEXT +Make a table for the equation. +$PAR + \{ -DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},], +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y=$right\)",header=>"CH"},], [$multians->ans_rule(8), $multians->ans_rule(8)], [$multians->ans_rule(8), $multians->ans_rule(8)], [$multians->ans_rule(8), $multians->ans_rule(8)], diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable60.pg index 442500a1d2..820796cf4d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable60.pg @@ -6,16 +6,18 @@ # Last updated: Jordan, 8/7/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "pccTables.pl", "parserMultiAnswer.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -98,16 +100,14 @@ $multians = MultiAnswer(@defaultAnswers)->with( ############################################## -BEGIN_PGML - -Make a table of solutions for the equation [`[$left]=[$right]`]. - -END_PGML Context()->texStrings; BEGIN_TEXT +Make a table for the equation. +$PAR + \{ -DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},], +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y=$right\)",header=>"CH"},], [$multians->ans_rule(8), $multians->ans_rule(8)], [$multians->ans_rule(8), $multians->ans_rule(8)], [$multians->ans_rule(8), $multians->ans_rule(8)], diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable70.pg index 19e724b468..094ab4e727 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable70.pg @@ -6,16 +6,18 @@ # Last updated: Jordan, 8/7/13 # ENDDESCRIPTION -## DBCCSS('8.F.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(calculate_points_on_line) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('8.F.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGML.pl", "pccTables.pl", "parserMultiAnswer.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula10.pg index bda6c97757..7fc612b23c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula10.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(apothem) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('formula','expression','evaluate') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -25,11 +26,12 @@ DOCUMENT(); #This section loads any and all .pl files that contain useful subroutines for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -58,16 +60,15 @@ TEXT(beginproblem()); BEGIN_PGML -The formula - - [``A=\frac{1}{2}\,r\,n\,s``] - -gives the area of a regular polygon with side length [`s`], number of sides [`n`] and, apothem [`r`]. (The _apothem_ is the distance from the center of the polygon to one of its sides.) +The formula [`A=\frac{1}{2}\,r\,n\,s`] gives the area of a regular polygon with side length [`s`], number of sides [`n`] and, apothem [`r`]. (The _apothem_ is the distance from the center of the polygon to one of its sides.) What is the area of a regular pentagon with [`s= [$s]`] and [`r=[$r]`]? [%This is how to comment in PGML. Every variable that you reference needs to be encased in brackets, hence [$a]. Then, to use math mode we encase in [` `].%] - The area is [___________]{$answer} . (Use *in* for inches and *in^2* for square inches.) +[@KeyboardInstructions(q!(Use [|in|]* for inches and [|in^2|]* for square inches.)!)@]** + +[___________]{$answer} + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula100.pg index 52ffb0fba5..d768bfaaa1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula100.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.G.9') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('volume','cylinder') +## DBCCSS('8.G.9') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +39,7 @@ loadMacros( ############################################## -$refreshCachedImages = 1; + Context("Numeric"); Context()->flags->set(reduceConstants=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula20.pg index c15b2017c8..3b1b932eab 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula20.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('formula','expression','evaluate') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -22,11 +26,12 @@ DOCUMENT(); #This section loads any and all .pl files that contain useful subroutines for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -39,7 +44,7 @@ Context("LimitedNumeric"); #Create some random integers. $a = random(3,99,3); #a random number from 1 to 9 taking steps of size 1 $b = random(1,99,1); -$c = random(2,98,2); +$c = random(8,98,2); $area = (.5)*$a*$b*$c; $answer = NumberWithUnits((.5)*$a*$b*$c, "in^2"); @@ -59,15 +64,13 @@ TEXT(beginproblem()); BEGIN_PGML -The formula - - [``A=\frac{1}{2}\,r\,n\,s``] - -gives the area of a regular polygon with side length [`s`], number of sides [`n`] and, apothem [`r`]. (The _apothem_ is the distance from the center of the polygon to one of its sides.) +The formula [`A=\frac{1}{2}\,r\,n\,s`] gives the area of a regular polygon with side length [`s`], number of sides [`n`] and, apothem [`r`]. (The _apothem_ is the distance from the center of the polygon to one of its sides.) What is the area of a regular [`[$c]`]-gon with [`s= [$s]`] and [`r=[$r]`]? - The area is [__________]{$answer}. (Use *in* for inches and *in^2* for square inches.) +[@KeyboardInstructions(q!(Use [|in|]* for inches and [|in^2|]* for square inches.)!)@]** + +[___________]{$answer} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula30.pg index c4c1273de8..b131430471 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('formula','expression','evaluate') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -24,11 +27,12 @@ DOCUMENT(); #This section loads any and all .pl files that contain useful subroutines for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -43,6 +47,9 @@ $v0 = random(50,100,1); $y0 = random(50,100,1); $g = -9.8; $t = random(1,(-sqrt(($v0)**2-2*$g*$y0)-$v0)/$g,1); +$tword = numberWord($t); +$tWord = ucfirst(numberWord($t)); +$seconds = ($t == 1) ? 'second' : 'seconds'; $v0U =NumberWithUnits($v0,"m/s"); $y0U = NumberWithUnits($y0, "m"); @@ -60,19 +67,13 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -In your answers to this problem, use *m* for meters, and *s* for seconds. - -The formula - - [``y=\frac{1}{2}\,a\,t^2 +v_0\,t + y_0``] - -gives the vertical position of an object, at time [`t`], thrown with an initial velocity [`v_0`], from an initial position [`y_0`] in a place where the acceleration of gravity is [`a`]. +The formula [```y=\frac{1}{2}\,a\,t^2 +v_0\,t + y_0```] gives the vertical position of an object, at time [`t`], thrown with an initial velocity [`v_0`], from an initial position [`y_0`] in a place where the acceleration of gravity is [`a`]. The acceleration of gravity on earth is [`[$gU]`]. It is negative, because we consider the upward direction as positive in this situation, and gravity pulls down. What is the height of a baseball thrown with an initial velocity of [`v_0=[$v0U]`], from an initial position of [`y_0= [$y0U]`], and at time [`t=[$tU]`]? -Note that the acceleration of gravity on earth is [`[$gU]`]. It is negative, because we consider the upward direction as positive in this situation, while the gravity pulls the object down. +[@KeyboardInstructions('In your answers to this problem, use [|m|] for meters, and [|s|] for seconds.')@]** - After [`[$tU]`], the baseball was [__________]{$heightU} high in the air. + [$tWord] [$seconds] after the baseball was thrown, it was [__________]{$heightU} high in the air. END_PGML @@ -94,7 +95,7 @@ These given values can be substituted into the formula as follows: [`` \begin{aligned}[t] - y &= \frac{1}{2}\,a\,t^2 +v_0\,t + s_0 \\ + y &= \frac{1}{2}\,a\,t^2 +v_0\,t + y_0 \\ &= \frac{1}{2}\left([$gU]\right)([$tU])^{2} + \left([$v0U]\right)([$tU]) +[$y0U] \\ &= [@$g*$t**2*0.5@] \text{ m} + [$v0*$t] \text{ m} + [$y0U] \\ &= [$heightU] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula40.pg index 565716eced..d6567dd542 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula40.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Middle school') +## DBchapter('Decimals and Equations') +## DBsection('Using Formulas') ## KEYWORDS('formula','expression','evaluate','volume') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -24,11 +27,12 @@ DOCUMENT(); #This section loads any and all .pl files that contain useful subroutines for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "parserNumberWithUnits.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); @@ -63,7 +67,7 @@ The formula [`V=\frac{1}{3}\cdot s^2\cdot h`] gives the volume of a right square What is the volume of a right square pyramid with [`s= [$s]`] and [`h=[$h]`]? [%This is how to comment in PGML. Every variable that you reference needs to be encased in brackets, hence [$a]. Then, to use math mode we encase in [` `].%] - The volume is [____________]{$answer}. + [____________]{$answer} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula50.pg index 6144cb793b..6729edccef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula50.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','rectangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +36,7 @@ loadMacros( ############################################## -$refreshCachedImages = 1; + Context("Numeric"); @@ -95,7 +99,7 @@ A rectangle's area can be calculated by the formula [`A=LW`], where [`A`] stands A rectangle's perimeter can be calculated by the formula [`P=2(L+W)`], where [`P`] stands for perimeter, [`L`] for length and [`W`] for width. -Use the formulas to calculate the rectangle's area and perimeter if its length is [`[$lengthU]`] and its width is [`[$widthU]`]. [@KeyboardInstructions(q!(Use [|m|]* for meters and [|m^2|]* for square meters.)!)@]** +Use the formulas to calculate the rectangle's area and perimeter. Its length is [`[$lengthU]`] and its width is [`[$widthU]`]. [@KeyboardInstructions(q!(Use [|m|]* for meters and [|m^2|]* for square meters.)!)@]** Area = [____________]{$areaU} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula60.pg index 853d8cb418..f763d76320 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula60.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -96,7 +100,7 @@ $areaU = NumberWithUnits("$area ft^2"); $text = "a triangle with one side parallel to the ground; this side is marked as h; the height is marked as h"; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula70.pg index df07776b2d..bea0a41151 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula70.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','rectangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +36,7 @@ loadMacros( ############################################## -$refreshCachedImages = 1; + Context("Numeric"); @@ -40,36 +44,25 @@ $baseDown = random(13,18,1); $baseUp = random(5,$baseDown-3,1); $height = random(8,12,1); -# Make a 20px buffer. Overall pixel width is 240. -# So trapezoid's pixel width needs to be 200. -# Trapezoid's scaled width is $baseDown. -# So set $xmax = $baseDown*240/200. -# Overall pixel height, H, needs to be calculated. -# (H-40)/$height = 200/$baseDown -# So H = 200*$height/$baseDown + 40 -# Trapezoid's pixel height needs to be 200*$height/$baseDown. -# So $ymax = $height*(200*$height/$baseDown + 40)/(200*$height/$baseDown) - - $xmin = 0; #The viewing window -$xmax = $baseDown*240/200; +$xmax = $baseDown*240/230; $ymin = 0; -$ymax = $height*(1+40/(200*$height/$baseDown)); +$ymax = (230*$height/$baseDown+30)*$height/(230*$height/$baseDown); $topStart = random(($xmax-$baseDown)/2+1,($xmax+$baseDown)/2-$baseUp-1,1); $topStop = $topStart+$baseUp; -@x = (($xmax-$baseDown)/2,$topStart,$topStop,($xmax+$baseDown)/2); +@x = ($xmax*5/240,$topStart,$topStop,$xmax*5/240+$baseDown); @y = (($ymax-$height)/2,($ymax+$height)/2); -$cornersize = min(($x[3]-$x[0]),($y[1]-$y[0]))/10; +$cornersize = $xmax*10/240; $picture = init_graph($xmin,$ymin,$xmax,$ymax, pixels=>[240,240*$ymax/$xmax]); -$picture->lb( new Label(($x[0]+$x[3])/2, $y[0],"b1",'black','center','top')); -$picture->lb( new Label(($x[1]+$x[2])/2, $y[1],"b2",'black','center','bottom')); -$picture->lb( new Label($x[1],($y[0]+$y[1])/2,"h",'black','left','middle')); +$picture->lb( new Label(($x[0]+$x[3])/2, $y[0],"$baseDown m",'black','center','top','large')); +$picture->lb( new Label(($x[1]+$x[2])/2, $y[1],"$baseUp m",'black','center','bottom','large')); +$picture->lb( new Label($x[1],($y[0]+$y[1])/2,"$height m",'black','left','middle','large')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -81,11 +74,11 @@ $picture->lineTo($x[1],$y[1], darkblue,3); $picture->lineTo($x[0],$y[0], darkblue,3); $picture->moveTo($x[1]+$cornersize,$y[0]); -$picture->lineTo($x[1]+$cornersize,$y[0]+$cornersize, darkblue,3); -$picture->lineTo($x[1],$y[0]+$cornersize, darkblue,3); +$picture->lineTo($x[1]+$cornersize,$y[0]+$cornersize, red,1); +$picture->lineTo($x[1],$y[0]+$cornersize, red,1); $picture->moveTo($x[1],$y[1]); -$picture->lineTo($x[1],$y[0], darkblue,1,"dashed"); +$picture->lineTo($x[1],$y[0], red,1,"dashed"); $area = 1/2*($baseDown+$baseUp)*$height; @@ -104,12 +97,11 @@ BEGIN_PGML A trapezoid's area can be calculated by the formula [`A=\frac{1}{2}(b_1+b_2)h`], where [`A`] stands for area, [`b_1`] for the first base's length, [`b_2`] for the second base's length, and [`h`] for height. ->>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$alt' title = '$alt' ") @]*<< - +Find the area of the trapezoid below. [@KeyboardInstructions(q!(Use [|m|]* for meters and [|m^2|]* for square meters.)!)@]** -Use the formulas to calculate the trapezoid's area if its first base's length is [`[$baseDownU]`], its second base's length is [`[$baseUpU]`] and its height is [`[$heightU]`]. [@KeyboardInstructions(q!(Use [|m|]* for meters and [|m^2|]* for square meters.)!)@]** +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$alt' title = '$alt' ") @]*<< - Area = [____________]{$areaU} + [____________]{$areaU} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula80.pg index 8e52e2ee42..4255c7691c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula80.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','rectangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +38,7 @@ loadMacros( ############################################## -$refreshCachedImages = 1; + Context("Numeric"); $xmin = 0; #The viewing window diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula90.pg index ac10faf9d2..c6786dda0a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormula90.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.5') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('volume','rectangular','prism') +## DBCCSS('5.MD.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +36,7 @@ loadMacros( ############################################## -$refreshCachedImages = 1; + Context("Numeric"); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg index 8f0c03f826..70ad243b9c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg @@ -10,15 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(Portland Community College) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('formula','expression','evaluate','graph') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -26,19 +29,19 @@ DOCUMENT(); ########Begin Load Macro Files############ loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "contextCurrency.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ########Begin Problem Setup############ -$refreshCachedImages = 1; + Context("Currency"); #Create some random integers. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/ExpressionAndEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/ExpressionAndEquation10.pg index 2ea99cdf8a..129a041855 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/ExpressionAndEquation10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/ExpressionAndEquation10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Properties) -## Institution(PCC) -## Author(Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('formula','expression','evaluate') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -46,10 +50,10 @@ Context()->texStrings; [$expression1."=".$expression2."\text{ is an equation.}","True"], [$expression1."=".$expression2."\text{ is an expression.}","False"], [$expression2."\text{ is an equation.}","False"], - ["\text{We can evaluate }".$expression1."=".$expression2."\text{ when }x=1","False"], - ["\text{We can evaluate }".$expression1."\text{ when }x=1","True"], - ["\text{We can check whether }x=1\text{ is a solution of }".$expression1."=".$expression2.".","True"], - ["\text{We can check whether }x=1\text{ is a solution of }".$expression1.".","False"] + ["\text{We can evaluate }{".$expression1."}=".$expression2."\text{ when }x=1","False"], + ["\text{We can evaluate }{".$expression1."}\text{ when }x=1","True"], + ["\text{We can check whether }x=1\text{ is a solution of }{".$expression1."}=".$expression2.".","True"], + ["\text{We can check whether }x=1\text{ is a solution of }{".$expression1."}.","False"] ); Context()->normalStrings; @@ -77,7 +81,6 @@ TEXT(beginproblem()); BEGIN_PGML Choose True or False for the following questions about the difference between expressions and equations. - a. [`[$questions[$scramble{0}][0]]`] [__]{$popups[0]} a. [`[$questions[$scramble{1}][0]]`] [__]{$popups[1]} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/FactorAndTerm10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/FactorAndTerm10.pg new file mode 100644 index 0000000000..f2d276335b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/FactorAndTerm10.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Danielle Rice +# Portland Community College +# +# Difference between factor and term. +# +# Last edited: Yao 4/18/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('formula','expression','evaluate') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines for the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PGML.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(2,4,1)*random(-1,1,2); +$b = random(5,7,1)*random(-1,1,2); +$c = random(8,10,1)*random(-1,1,2); +$term1 = Compute("$a*x**2")->reduce; +$term2 = Compute("$b*x")->reduce; +$term3 = Compute("$c")->reduce; +$expression = Compute("$a*x**2+$b*x+$c")->reduce; + +$string1 = $term1->TeX; +$string2 = $term2->TeX; + +$mc1 = new_checkbox_multiple_choice(); +$mc1 -> qa ( + "Identify all factors in the expression.", + "`$a`", + "`x^2`", + "`$b`", + "`x`", + "`$c`" +); +$mc1 -> makeLast( + "`$a`", + "`x^2`", + "`$string1`", + "`$b`", + "`x`", + "`$string2`", + "`$c`" +); + +$mc2 = new_checkbox_multiple_choice(); +$mc2 -> qa ( + "Identify all terms in the same expression.", + "`$string1`", + "`$string2`", +); +$mc2 -> makeLast( + "`$a`", + "`x^2`", + "`$string1`", + "`$b`", + "`x`", + "`$string2`", + "`$c`" +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Identify terms and factors in the expression [`[$expression]`]. + + [@$mc1 -> print_q()@]*** + + [@$mc1 -> print_a()@]*** + + [@$mc2 -> print_q()@]*** + + [@$mc2 -> print_a()@]*** + +END_PGML + +########Begin more complicated answer processing (if needed)############ + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc1->correct_ans() ) ); +ANS( checkbox_cmp( $mc2->correct_ans() ) ); + +########Begin solution.############ + + +BEGIN_PGML_SOLUTION + +The expression [`[$expression]`] has [`3`] terms: [`[$term1]`], [`[$term2]`] and [`[$term3]`]. + +Each term has its factors. + +[`[term1]`] is composed of two factors: [`[$a]`] and [`x^2]`]. +[`[term2]`] is composed of two factors: [`[$b]`] and [`x]`]. +[`[term3]`] is composed of one factor: [`[$c]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/FahrenheitCelsius10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/FahrenheitCelsius10.pg index afb0bed723..474947565f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/FahrenheitCelsius10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/FahrenheitCelsius10.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.3','5.NF.6','6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## MLT(Fahrenheit_Celsius) -## MLTleader(1) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','expression','fraction') +## DBCCSS('5.NF.3','5.NF.6','6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -31,7 +32,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -62,13 +64,9 @@ TEXT(beginproblem()); BEGIN_PGML -To convert a temperature measured in degrees Fahrenheit to degrees Celsius, there is a formula: - - [`` C=[$func] ``] - -where [`C`] represents the temperature in degrees Celsius and [`F`] represents the temperature in degrees Fahrenheit. +To convert a temperature measured in degrees Fahrenheit to degrees Celsius, there is a formula: [``` C=[$func] ```] where [`C`] represents the temperature in degrees Celsius and [`F`] represents the temperature in degrees Fahrenheit. -If a temperature is [`[$plugIn] {^\circ}\text{F}`], what is that temperature measured in Celsius? Use *degC* for [`^{\circ}\text{C}`] and *degF* for [`^{\circ}\text{F}`]. +If a temperature is [`[$plugIn] {^\circ}\text{F}`], what is that temperature measured in Celsius? [@KeyboardInstructions(q!(Use [|degC|]* for [`^{\circ}\text{C}`] and [|degF|]* for [`^{\circ}\text{F}`].)!)@]** [_______]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate10.pg index 6c718f000e..4f1329d834 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -29,7 +32,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -52,9 +55,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the expression for [`x = [$at]`]. +Evaluate [`[$func]`] for [`x = [$at]`]. - [`[$func]=`] [_______]{$ans} + [_______]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate100.pg index 46597ccc5b..a3fbfd4c89 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate100.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -55,11 +59,11 @@ BEGIN_PGML Evaluate the expression [`[$func]`]: -a. When [`[$var1]=[$a]`], - [``[$func]=``] [_______]{$ans1} +a. For [`[$var1]=[$a]`]. + [_______]{$ans1} -a. When [`[$var1]=[$b]`], - [``[$func]=``] [_______]{$ans2} +a. For [`[$var1]=[$b]`]. + [_______]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate110.pg index 519a3af0c4..e7abae056a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate110.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -55,11 +59,11 @@ BEGIN_PGML Evaluate the expression [`[$func]`]: -a. When [`[$var1]=[$a]`], - [``[$func]=``] [_______]{$ans1} +a. For [`[$var1]=[$a]`]. + [_______]{$ans1} -a. When [`[$var1]=[$b]`], - [``[$func]=``] [_______]{$ans2} +a. For [`[$var1]=[$b]`]. + [_______]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate12.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate12.pg index f6b53fe5fa..1ba357917a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate12.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate12.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(linear_plug_in_numbers) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +32,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,9 +56,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the expression for [`x = [$at]`]. +Evaluate [`[$func]`] for [`x = [$at]`]. - [`[$func]=`] [_______]{$ans} + [_______]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate120.pg index 26c42ada48..402432a2d3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate120.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -55,11 +59,11 @@ BEGIN_PGML Evaluate the expression [`[$func]`]: -a. When [`[$var1]=[$a]`], - [``[$func]=``] [_______]{$ans1} +a. For [`[$var1]=[$a]`]. + [_______]{$ans1} -a. When [`[$var1]=[$b]`], - [``[$func]=``] [_______]{$ans2} +a. For [`[$var1]=[$b]`]. + [_______]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate130.pg index b185aeb4ec..7548ab2f1d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate130.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -56,13 +60,14 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the following expressions. a. Evaluate [`[$func1]`] when [`[$var1]=[$b]`]. - [``[$func1]=``] [_______]{$ans1} + + [_______]{$ans1} a. Evaluate [`[$func2]`] when [`[$var1]=[$b]`]. - [``[$func2]=``] [_______]{$ans2} + + [_______]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate140.pg index b977b2d723..a9326a461c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate140.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -60,13 +64,11 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the following expressions. - -a. Evaluate [`[$func1]`] when [`[$var1]=[$a]`] and [`[$var2]=[$b]`]. - [``[$func1]=``] [_______]{$ans1} +a. Evaluate [`[$func1]`] when [`[$var1]=[$a]`] and [`[$var2]=[$b]`]. + [_______]{$ans1} -a. Evaluate [`[$func2]`] when [`[$var1]=[$a]`] and [`[$var2]=[$b]`]. - [``[$func2]=``] [_______]{$ans2} +a. Evaluate [`[$func2]`] when [`[$var1]=[$a]`] and [`[$var2]=[$b]`]. + [_______]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate15.pg index 7cf3e6dcc6..710e5e2f9c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate15.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate15.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(linear_plug_in_numbers) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +32,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,9 +57,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the expression for [`x = [$at]`]. +Evaluate [`[$func]`] for [`x = [$at]`]. - [`[$func]=`] [_______]{$ans} + [_______]{$ans} END_PGML @@ -75,3 +77,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate150.pg index 1f0067786e..9448ce44ae 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate150.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -60,15 +64,12 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the following expressions. - -a. Evaluate [`[$func1]`] when [`[$var1]=[$b]`]. - [``[$func1]=``] [_______]{$ans1} +a. Evaluate [`[$func1]`] when [`[$var1]=[$b]`]. + [_______]{$ans1} -a. Evaluate [`[$func2]`] when [`[$var1]=[$b]`]. - - [``[$func2]=``] [_______]{$ans2} +a. Evaluate [`[$func2]`] when [`[$var1]=[$b]`]. + [_______]{$ans2} END_PGML @@ -76,19 +77,15 @@ END_PGML BEGIN_PGML_SOLUTION -a. We substitute [`[$var1]=[$b]`] into [`[$func1]`]: - - [``\begin{aligned} - [$func1] &= [ [$a]([$b]) ]^2 \\ - &= [ [$a*$b] ]^2 \\ +a. [``\begin{aligned}[t] + [$func1] &= \big( [$a]([$b]) \big)^2 \\ + &= ( [$a*$b] )^2 \\ &= [$ans1] \end{aligned}``] -a. We substitute [`[$var1]=[$b]`] into [`[$func2]`]: - - [``\begin{aligned} - [$func2] &= [ [$a]([$b]) ]^3 \\ - &= [ [$a*$b] ]^3 \\ +a. [``\begin{aligned}[t] + [$func2] &= \big( [$a]([$b]) \big)^3 \\ + &= ( [$a*$b] )^3 \\ &= [$ans2] \end{aligned}``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate160.pg index 583c252012..c568199832 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate160.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -63,13 +67,11 @@ BEGIN_PGML Evaluate the following expressions. -a. Evaluate [`[$func1]`] when [`[$var1]=[$b]`] and [`[$var2]=[$c]`]. - - [``[$func1]=``] [_______]{$ans1} - -a. Evaluate [`[$func2]`] when [`[$var1]=[$b]`] and [`[$var2]=[$c]`]. +a. Evaluate [`[$func1]`] when [`[$var1]=[$b]`] and [`[$var2]=[$c]`]. + [_______]{$ans1} - [``[$func2]=``] [_______]{$ans2} +a. Evaluate [`[$func2]`] when [`[$var1]=[$b]`] and [`[$var2]=[$c]`]. + [_______]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate18.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate18.pg index 2652225efd..b56d9834ae 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate18.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate18.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(linear_plug_in_numbers) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -31,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,9 +59,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the expression for [`[$myvar] = [$at]`]. +Evaluate [`[$func]`] for [`[$myvar] = [$at]`]. - [`[$func]=`] [_______]{$ans} + [_______]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate20.pg index 9109256948..37c1451475 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate20.pg @@ -8,17 +8,21 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(linear_plug_in_numbers) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + ############################################## @@ -29,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,9 +58,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the expression for [`[$myvar] = [$at]`]. +Evaluate [`[$func]`] for [`[$myvar] = [$at]`]. - [` [$func]= `] [_______]{$ans} + [_______]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate50.pg index 256eaadcab..55cf5d1314 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate50.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','linear','integer','multivariable') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -31,7 +34,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,9 +69,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the expression for [`[$myA] = [$Aat]`] and [`[$myB] = [$Bat]`]. +Evaluate [`[$func]`] for [`[$myA] = [$Aat]`] and [`[$myB] = [$Bat]`]. - [`[$func]=`] [_______]{$ans} + [_______]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate60.pg index 8209bc66f2..f167f5cca8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate60.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c','3.NF.3.b') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','rational','fraction','multivariable') +## DBCCSS('6.EE.2.c','3.NF.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -32,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -44,23 +47,34 @@ while ($myB eq $myA) {$myB = RandomVariableName(type=>constant);} Context()->variables->are($myA => "Real",$myB => "Real"); -$Aat = non_zero_random(-20,20,1); -$Bat = $Aat; -while ($Bat == $Aat) -{$Bat = non_zero_random(-20,20,1);} +#$Aat = non_zero_random(-20,20,1); +#$Bat = $Aat; +#while ($Bat == $Aat) +#{$Bat = non_zero_random(-20,20,1);} + +#$Acoef = random(1.5,20.5,1)*random(-1,1,2)+0.5; +#$Bcoef = $Acoef; +#while ($Bcoef == $Acoef) +#{$Bcoef = random(1.5,20.5,1)*random(-1,1,2)+0.5;}; + +do { + $Aat = random(2,9,1); + do {$Bat = random(2,9,1);} until ($Aat!=$Bat); + $com = lcm($Aat,$Bat); + $Acoef = random(2,9,1); + $Bcoef = random(2,9,1); +} until ( (gcd($Acoef,$Aat)==1) && (gcd($Bcoef,$Bat)==1) ); -$Acoef = random(1.5,20.5,1)*random(-1,1,2)+0.5; -$Bcoef = $Acoef; -while ($Bcoef == $Acoef) -{$Bcoef = random(1.5,20.5,1)*random(-1,1,2)+0.5;}; +$Bat = -$Bat; +$Acoef = -$Acoef; Context()->noreduce('(-x)-y','(-x)+y'); -$func = Compute("$Acoef/$myA+$Bcoef/$myB")->reduce; +$func = Compute("$Acoef/$myA-$Bcoef/$myB"); Context("LimitedFraction"); Context()->flags->set(showMixedNumbers=>0); Context()->flags->set(requirePureFractions=>1); -$ans = Fraction($Acoef,$Aat)+Fraction($Bcoef,$Bat); +$ans = Fraction($Acoef,$Aat)-Fraction($Bcoef,$Bat); ############################################## @@ -69,20 +83,30 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the expression for [`[$myA] = [$Aat]`] and [`[$myB] = [$Bat]`]. +Evaluate [``[$func]``] for [`[$myA] = [$Aat]`] and [`[$myB] = [$Bat]`]. - [`[$func]=`] [_______]{$ans->cmp(cmp_class => "a fraction or an integer")} + [_______]{$ans->cmp(cmp_class => "a fraction or an integer")} END_PGML ############################################## +$BatP = -$Bat; +$AcoefP = -$Acoef; +$f1 = abs($com/$Aat); +$f2 = abs($com/$Bat); + +############################################## + BEGIN_PGML_SOLUTION We evaluate [`[$func]`] by replacing [`[$myA]`] with [`[$Aat]`] and [`[$myB]`] with [`[$Bat]`] in the formula. [`\begin{aligned} - [$func] &= \frac{[$Acoef]}{[$Aat]} + \frac{[$Bcoef]}{[$Bat]} \\ - &= [$ans] + [$func] + &= \frac{[$Acoef]}{[$Aat]} - \frac{[$Bcoef]}{[$Bat]} \\ + &= -\frac{[$AcoefP]}{[$Aat]} + \frac{[$Bcoef]}{[$BatP]} \\ + &= -\frac{[$AcoefP*$f1]}{[$Aat*$f1]} + \frac{[$Bcoef*$f2]}{[$BatP*$f2]} \\ + &= [$ans] \end{aligned} `] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate80.pg index ccade5fc48..7c26c4c926 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate80.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c','3.NF.3.b') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','rational','fraction') +## DBCCSS('6.EE.2.c','3.NF.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +33,7 @@ loadMacros( "PGML.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,9 +63,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the expression for [`[$myvar]=[$at]`]. +Evaluate [``[$func]``] for [`[$myvar]=[$at]`]. - [``[$func]=``] [_______]{$ans->cmp(cmp_class => "a fraction or an integer")} + [_______]{$ans->cmp(cmp_class => "a fraction or an integer")} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate90.pg index 3047d801df..788e9b7401 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluate90.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c','3.NF.3.b') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','rational','fraction','multivariable) +## DBCCSS('6.EE.2.c','3.NF.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +33,7 @@ loadMacros( "PGML.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,9 +83,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the expression for [`[$myA]=[$Aat]`] and [`[$myB]=[$Bat]`]. +Evaluate [``[$func]``] for [`[$myA]=[$Aat]`] and [`[$myB]=[$Bat]`]. - [``[$func]=``] [_______]{$ans->cmp(cmp_class => "a fraction or an integer")} + [_______]{$ans->cmp(cmp_class => "a fraction or an integer")} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext10.pg index ddba694856..b0735b868e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext10.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c','3.NF.3.b') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','rational','fraction','multivariable) +## DBCCSS('6.EE.2.c','3.NF.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -29,7 +32,7 @@ loadMacros( "PGML.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -63,11 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -A formula for converting [$b] into [$a] is - - [``[$l] = [$r][$rv]``] +A formula for converting [$b] into [$a] is [```[$l] = [$r][$rv]```] where [`[$rv]`] is a number of [$b], and [`[$l]`] is the corresponding number of [$a]. -where [`[$rv]`] is a number of [$b], and [`[$l]`] is the corresponding number of [$a]. Use the formula to find the number of [$a] that corresponds to [@numberWord($n)@] [$b]. +Use the formula to find the number of [$a] that corresponds to [@numberWord($n)@] [$b]. [______________]{$ans} [$a] corresponds to [@numberWord($n)@] [$b]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext20.pg index b98dc49e2e..c34c226fb5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext20.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c','3.NF.3.b') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','rational','fraction','multivariable) +## DBCCSS('6.EE.2.c','3.NF.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +33,7 @@ loadMacros( "contextFraction.pl", "PCCmacros.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,11 +53,9 @@ TEXT(beginproblem()); BEGIN_PGML -The percentage of births in the U.S. delivered via C-section can be given by the following formula for the years since 1996. - - [``p = 0.8(y-1996)+21``] +The percentage of births in the U.S. delivered via C-section can be given by the following formula for the years since 1996: [```p = 0.8(y-1996)+21```] In this formula [`y`] is a year after 1996 and [`p`] is the percentage of births delivered via C-section for that year. -In this formula [`y`] is a year after 1996 and [`p`] is the percentage of births delivered via C-section for that year. What percentage of births in the U.S. were delivered via C-section in the year [$n]? +What percentage of births in the U.S. were delivered via C-section in the year [$n]? [______________]{$ans} of births in the U.S. were delivered via C-section in the year [$n]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext30.pg index 96d5b03670..3dacb194af 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext30.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c','3.NF.3.b') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','rational','fraction','multivariable) +## DBCCSS('6.EE.2.c','3.NF.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -53,11 +57,9 @@ TEXT(beginproblem()); BEGIN_PGML -Target heart rate for moderate exercise is [`50%`] to [`70%`] of maximum heart rate. If we want to represent a certain percent of an individual's maximum heart rate, we'd use the formula - - [``\text{rate}=[$var1](220-[$var2])``] +Target heart rate for moderate exercise is [`50%`] to [`70%`] of maximum heart rate. If we want to represent a certain percent of an individual's maximum heart rate, we'd use the formula [```\text{rate}=[$var1](220-[$var2])```] where [`[$var1]`] is the percent, and [`[$var2]`] is age in years. -where [`[$var1]`] is the percent, and [`[$var2]`] is age in years. Determine the target heart rate at [`[$p]%`] level for someone who is [`[$a]`] years old. Round your answer to an integer. +Determine the target heart rate at [`[$p]%`] level for someone who is [`[$a]`] years old. Round your answer to an integer. The target heart rate at [`[$p]%`] level for someone who is [`[$a]`] years old is [______________]{$ans} beats per minute. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext40.pg index b11b67ee29..7953fe23ac 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext40.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c','3.NF.3.b') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','rational','fraction','multivariable) +## DBCCSS('6.EE.2.c','3.NF.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -60,18 +64,16 @@ TEXT(beginproblem()); BEGIN_PGML -The height inside a camping tent when you are [`d`] feet from the edge of the tent is given by - - [``h=[$func]``] +The height inside a camping tent when you are [`d`] feet from the edge of the tent is given by [```h=[$func]```] where [`h`] stands for height in feet. -where [`h`] stands for height in feet. Determine the height when you are: +Determine the height when you are: a. [`[$d1U]`] from the edge. - The height inside a camping tent when you [`[$d1U]`] from the edge of the tent is [__________]{$ans1U} + The height inside a camping tent when you are [`[$d1U]`] from the edge of the tent is [__________]{$ans1U}. a. [`[$d2U]`] from the edge. - The height inside a camping tent when you [`[$d2U]`] from the edge of the tent is [__________]{$ans2U} + The height inside a camping tent when you are [`[$d2U]`] from the edge of the tent is [__________]{$ans2U}. END_PGML @@ -83,8 +85,8 @@ $s2 = $rate*($d2-$diameter); BEGIN_PGML_SOLUTION -1) We will substitute [`[$var1]=[$d1]`] into the formula [`[$func]`], and we have: - [``\begin{aligned} +a. We will substitute [`[$var1]=[$d1]`] into the formula [`[$func]`], and we have: + [``\begin{aligned}[t] h &= [$func] \\ &= -[$rate] \lvert [$d1]-[$diameter] \rvert +[$base] \\ &= -[$rate] \lvert [$d1-$diameter] \rvert +[$base] \\ @@ -93,10 +95,10 @@ BEGIN_PGML_SOLUTION &= [$ans1] \end{aligned}``] -The height inside a camping tent when you [`[$d1U]`] from the edge of the tent is [`[$ans1U]`]. + The height inside a camping tent when you are [`[$d1U]`] from the edge of the tent is [`[$ans1U]`]. -2) We will substitute [`[$var1]=[$d2]`] into the formula [`[$func]`], and we have: - [``\begin{aligned} +a. We will substitute [`[$var1]=[$d2]`] into the formula [`[$func]`], and we have: + [``\begin{aligned}[t] h &= [$func] \\ &= -[$rate] \lvert [$d2]-[$diameter] \rvert +[$base] \\ &= -[$rate] \lvert [$d2-$diameter] \rvert +[$base] \\ @@ -105,7 +107,7 @@ The height inside a camping tent when you [`[$d1U]`] from the edge of the tent i &= [$ans2] \end{aligned}``] -The height inside a camping tent when you [`[$d2U]`] from the edge of the tent is [`[$ans2U]`]. + The height inside a camping tent when you are [`[$d2U]`] from the edge of the tent is [`[$ans2U]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext50.pg index f5235f4e4f..acc025fbdb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext50.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c','3.NF.3.b') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','rational','fraction','multivariable) +## DBCCSS('6.EE.2.c','3.NF.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -63,9 +67,7 @@ TEXT(beginproblem()); BEGIN_PGML -The diagonal length ([`D`]) of a rectangle with side lengths [`L`] and [`W`] is given by: - - [`` D=\sqrt{L^2+W^2} ``] +The diagonal length ([`D`]) of a rectangle with side lengths [`L`] and [`W`] is given by: [``` D=\sqrt{L^2+W^2} ```] Determine the diagonal length of rectangles with [`L=[$lU]`] and [`W=[$wU]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition10.pg index 66a3972705..1dcadeb123 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition10.pg @@ -16,14 +16,17 @@ # ENDDESCRIPTION ## DBCC('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','integer exponent','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -59,15 +62,19 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the following expressions that have integer exponents: +Evaluate the following. +a. [` [$a]^{2} `] + [________]{$ans1} -a) [`` [$a]^{2}= ``] [________]{$ans1} +a. [` [$b]^{3} `] + [________]{$ans2} -b) [`` [$b]^{3}= ``] [________]{$ans2} +a. [` ([$c])^{2} `] + [________]{$ans3} -c) [`` ([$c])^{2}= ``] [________]{$ans3} +a. [` ([$d])^{3} `] + [________]{$ans4} -d) [`` ([$d])^{3}= ``] [________]{$ans4} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition20.pg index 67b37765e1..8a14e43554 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition20.pg @@ -16,15 +16,18 @@ # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','integer exponents','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +37,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,15 +57,19 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the following expressions that have integer exponents: +Evaluate the following. +a. [` 1^{[$a]} `] + [________]{1} -a) [`` 1^{[$a]}= ``] [________]{1} +a. [` (-1)^{[$b]} `] + [________]{-1} -b) [`` (-1)^{[$b]}= ``] [________]{-1} +a. [` (-1)^{[$c]} `] + [________]{1} -c) [`` (-1)^{[$c]}= ``] [________]{1} +a. [` 0^{[$d]} `] + [________]{0} -d) [`` 0^{[$d]}= ``] [________]{0} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition30.pg index ca3083c6e6..2552cb8e5a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition30.pg @@ -12,15 +12,18 @@ # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','order of operations','integer exponents','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -49,11 +52,13 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the following expressions that have integer exponents: +Evaluate the following. +a. [` ([$a])^{2} `] + [________]{$ans1} -a) [`` ([$a])^{2}= ``] [________]{$ans1} +a. [` [$b]^{2} `] + [________]{$ans2} -b) [`` [$b]^{2}= ``] [________]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition40.pg index b203b20345..c333886d99 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/ExponentDefinition40.pg @@ -12,15 +12,18 @@ # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','order of operations','integer exponents','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -49,11 +52,13 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the following expressions that have integer exponents: +Evaluate the following. +a. [` ([$a])^{3} `] + [________]{$ans1} -a) [`` ([$a])^{3}= ``] [________]{$ans1} +a. [` -[$b]^{3} `] + [________]{$ans2} -b) [`` -[$b]^{3}= ``] [________]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision0.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision0.pg index fc073de9da..0524ed3843 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision0.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision0.pg @@ -12,15 +12,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','zero') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,7 +50,7 @@ $ans = Compute(($mybase)**0); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` \left([$mybase]\right)^0= diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision10.pg index 03bba0e71b..e6c408ee74 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision10.pg @@ -12,15 +12,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','zero') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,7 +50,7 @@ $ans = Compute($mybase**0); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` [$mybase]^0= diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision100.pg index 074e04bc57..5a5e6bb743 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision100.pg @@ -17,17 +17,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide') -## MLT(Division_exponents_multivar) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -40,7 +41,7 @@ loadMacros( "PCCmacros.pl", "bizarroArithmetic.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -102,7 +103,7 @@ $ans = Formula("$c*$var1^($total1)*$var2^($total2)*$var3^($total3)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [`\displaystyle\frac{[$myvar1]}{[$myvar2]}=`] [___________] @@ -118,8 +119,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision105.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision105.pg index d3520447e1..d6a4670d3c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision105.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision105.pg @@ -17,16 +17,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide') -## MLT(Division_exponents_multivar) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +41,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -91,7 +93,7 @@ $ans = Formula("$c*$var1^($total1)*$var2^($total2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [`\displaystyle\frac{[$myvar1]}{[$myvar2]}=`] [__________________] @@ -107,8 +109,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision110.pg index 5480260a8d..93e50750fb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision110.pg @@ -19,17 +19,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide') -## MLT(Exponents_Division_Mix2015) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -42,7 +43,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -119,8 +120,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision115.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision115.pg index 1ec06698eb..0f9a48b096 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision115.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision115.pg @@ -16,22 +16,25 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide','polynomial','monomial') -## MLT(Exponents_Division_Mix2015) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); +DOCUMENT(); + loadMacros( "PGstandard.pl", "MathObjects.pl", @@ -39,7 +42,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -109,8 +112,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision120.pg index 12cb9aef2a..25cc064085 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision120.pg @@ -16,17 +16,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide','polynomial','monomial') -## MLT(Exponents_Division_Mix2015) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -40,7 +41,7 @@ loadMacros( "contextLimitedPolynomial.pl", "contextFraction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -121,8 +122,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision125.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision125.pg index 1ea0d738f8..def35fc55d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision125.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision125.pg @@ -16,22 +16,25 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide','polynomial','monomial') -## MLT(Exponents_Division_Mix2015) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); +DOCUMENT(); + loadMacros( "PGstandard.pl", "MathObjects.pl", @@ -40,7 +43,7 @@ loadMacros( "contextLimitedPolynomial.pl", "contextFraction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -110,8 +113,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision130.pg index 01f6d61348..ed4ce2e2dc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision130.pg @@ -16,17 +16,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide','polynomial','monomial') -## MLT(Exponents_Division_Mix2015) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -40,7 +41,7 @@ loadMacros( "contextLimitedPolynomial.pl", "contextFraction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -116,8 +117,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision135.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision135.pg index ce3c7ba10c..c96ff2c2ef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision135.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision135.pg @@ -14,17 +14,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide','polynomial','monomial') -## MLT(Exponents_Division_Mix2015) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -97,6 +98,7 @@ $ans2 = Formula(PolyAdd(~~@ans1,~~@poly3array,output=>simplified,var=>$var))->re $ans = Formula("$ans2")->reduce; Context("LimitedPolynomial-Strict"); +Context()->flags->set(tolType=>'absolute'); Context()->operators->set( '/' => {class => 'bizarro::BOP::divide', isCommand => 1}, '/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, @@ -132,8 +134,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision140.pg index 9dd3ff4d04..55cd0a1849 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision140.pg @@ -16,16 +16,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide','polynomial','monomial') -## MLT(Exponents_Division_Mix2015) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +41,7 @@ loadMacros( "contextLimitedPolynomial.pl", "contextFraction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -106,8 +108,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision145.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision145.pg index 6ecd311a9e..0f89464c42 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision145.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision145.pg @@ -14,24 +14,22 @@ # # We make sure to choose m, p, r > 5 and n, q, s > 2 # -# Last edited: Hughes 9/6/13, Hughes 7/1/13, Yao 6/28/13, Hlavacek 9/13/19 -# -# Jan Hlavacek : make sure we don't end up with like terms. -# Also, add "do not factor" to instructions. +# Last edited: Hughes 9/6/13, Hughes 7/1/13, Yao 6/28/13 # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide','polynomial','monomial') -## MLT(Exponents_Division_Mix2015) -## MLTleader(1) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -45,7 +43,7 @@ loadMacros( "contextLimitedPolynomial.pl", "contextFraction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -67,23 +65,19 @@ $b = non_zero_random(-13,13,1) while($b==$a); $c=$b; $c = non_zero_random(-13,13,1) while($c==$b); -# first exponents +# exponents for x $m = random(7,20,1); -$n = random(5,20,1); - -# second exponents (at least one of them must be different -# from the first exponent) -do { - $p = random(6,$m-1,1); - $q = random(4,$n-1,1); -} while (($p == $m) and ($q == $n)); +do{ +$p = random(6,$m-1,1); +$r = random(5,$m-1,1); +} until ($p!=$r); -# third exponents (again, we do not want the same two exponents as in -# one of the previous terms) -do { - $r = random(5,$m-1,1); - $s = random(2,$n-1,1); -} while ((($r == $p) and ($s == $q)) or (($r == $m) and ($s == $n))); +# exponents for y +$n = random(5,20,1); +do{ +$q = random(4,$n-1,1); +$s = random(2,$n-1,1); +} until ($q!=$s); # reduction check $ans = Formula("$a*x^$m*y^$n+$b*x^$p*y^$q+$c*x^$r*y^$s")->reduce->reduce; @@ -117,7 +111,7 @@ TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression (do not factor) +Simplify the following expression [`\displaystyle\frac{[$poly1]}{[$poly2]}= `][________________________________] @@ -135,8 +129,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision15.pg index 1f857d1cef..dbfc7cbca4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision15.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision15.pg @@ -12,15 +12,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','zero') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,7 +50,7 @@ $ans = Compute($mybase**0+(-$mybase)**0); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` [$mybase]^0+\left(-[$mybase]\right)^0= diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision150.pg index 472ca83f26..048ae0eacb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision150.pg @@ -16,17 +16,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide','polynomial','monomial') -## MLT(Exponents_Division_Mix2015) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -40,7 +41,7 @@ loadMacros( "contextLimitedPolynomial.pl", "contextFraction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -114,8 +115,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); @@ -141,15 +141,13 @@ $solnStep[$n-$p] = Fraction($c*$d,$d); $solnStep = Formula("$solnStep[$n-$n] $var**$n+$solnStep[$n-$m] $var**$m +$solnStep[$n-$p] $var**$p"); BEGIN_PGML_SOLUTION -We divide each term by [`[$poly2]`] as follows - - [` +We divide each term by [`[$poly2]`] as follows. [``` \begin{aligned} \displaystyle\frac{[$poly1]}{[$poly2]} & = \frac{[$d*$a][$var]^{[$n+2]}}{[$d][$var]^2}+\frac{[$b*$d][$var]^{[$m+2]}}{[$d][$var]^2}+\frac{[$c*$d][$var]^{[$p+2]}}{[$d][$var]^2}\\ &=[$solnStep]\\ &=[$ans]\\ \end{aligned} -`] +```] END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision155.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision155.pg index 53f6981c4d..a498c7bf0a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision155.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision155.pg @@ -16,21 +16,25 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## MLT(ParamExponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide','polynomial','monomial') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); +DOCUMENT(); + loadMacros( "PGstandard.pl", "MathObjects.pl", @@ -39,7 +43,7 @@ loadMacros( "contextLimitedPolynomial.pl", "contextFraction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -112,8 +116,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->variables->set($var=>{limits=>[0.25,0.4]}); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision20.pg index c7c93c11f8..d7ba930ae8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision20.pg @@ -13,16 +13,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','zero') -## MLT(Algebra_PropExp_PropExp) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +37,7 @@ loadMacros( "PCCmacros.pl", "answerHints.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -51,7 +53,7 @@ $ans = Compute("$a"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` [$a][$var]^0= diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision25.pg index d6fb4a975f..c4905c1312 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision25.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision25.pg @@ -12,15 +12,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','zero') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "PCCmacros.pl", "answerHints.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,7 +53,7 @@ $ans = Compute($a*$b**0); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` [$a]\cdot[$b]^0= diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision30.pg index dc50abe5c5..3afb834295 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision30.pg @@ -12,15 +12,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','zero') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -46,7 +49,7 @@ $ans = Compute($a*(-$b**0)); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` [$a]\cdot\left([$b]^0\right)= diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision35.pg index 3226f938b0..3d46ea5b85 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision35.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision35.pg @@ -12,15 +12,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','zero') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,7 +50,7 @@ $ans = Compute("$a"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` [$a]\cdot\left(-[$b]^{[$c]}\right)^0= diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision40.pg index 920020f038..4f997d970c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision40.pg @@ -13,16 +13,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','zero') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +37,7 @@ loadMacros( "PCCmacros.pl", "answerHints.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,7 +52,7 @@ $ans = Compute("1"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` \left([$a][$var]\right)^0= diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision45.pg index 3799a77854..e306bbe321 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision45.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision45.pg @@ -16,16 +16,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction') -## MLT(Quotient_in_power) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +41,7 @@ loadMacros( "contextLimitedPolynomial.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -70,7 +72,7 @@ $ans = Formula("$var^($total)/$denom"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` \left(\displaystyle\frac{[$var]^{[$m]}}{[$a]}\right)^{[$n]}= @@ -88,8 +90,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision5.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision5.pg index 241ba1e074..1134c48a8a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision5.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision5.pg @@ -12,15 +12,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','zero') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,7 +50,7 @@ $ans = Compute((-1)*$mybase**0); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` -[$mybase]^0= diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision50.pg index e77903fd1d..36a4ef1f05 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision50.pg @@ -13,16 +13,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction') -## MLT(Quotient_in_power) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +37,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -68,7 +70,7 @@ $ans = Formula("$numerator/($denom*$var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` \left(\displaystyle\frac{[$a]}{[$b][$var]^{[$m]}}\right)^{[$n]}= @@ -86,8 +88,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision55.pg index 1066abba5b..4122037615 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision55.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision55.pg @@ -13,16 +13,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction') -## MLT(Quotient_in_power) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +38,7 @@ loadMacros( "contextLimitedPolynomial.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,7 +71,7 @@ $ans = Formula("$numerator*$var^($total)/$denom"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` \left(\displaystyle\frac{[$a][$var]^{[$m]}}{[$b]}\right)^{[$n]}= @@ -87,8 +89,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision60.pg index 14efe4284c..f133bcabc3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision60.pg @@ -18,16 +18,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide') -## MLT(Division_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -38,10 +40,10 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedPolynomial.pl", + "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -83,7 +85,7 @@ $ans = Formula("$c*$myvar^($total)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [`\displaystyle\frac{[$myvar1]}{[$myvar2]}=`] [___________] @@ -100,8 +102,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision65.pg index 0bb22fb0a0..6b5c64d715 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision65.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision65.pg @@ -18,16 +18,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide') -## MLT(Division_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -41,7 +43,7 @@ loadMacros( "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -87,7 +89,7 @@ $ans = Formula("$myvar^($total)/$c")->reduce; TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [`\displaystyle\frac{[$myvar1]}{[$myvar2]}=`] [___________] @@ -103,8 +105,7 @@ ANS($ans -> cmp(checker=>sub{ $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision70.pg index 2bda149b5d..734be417b1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision70.pg @@ -16,16 +16,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide') -## MLT(Division_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +41,7 @@ loadMacros( "contextLimitedPolynomial.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -77,7 +79,7 @@ $ans = Formula("$myvar^($total)"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [`\displaystyle\frac{[$myvar1]}{[$myvar2]}=`] [___________] @@ -94,8 +96,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision75.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision75.pg index 8d8b975735..fd02e1a560 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision75.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision75.pg @@ -15,15 +15,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +39,7 @@ loadMacros( "contextLimitedPolynomial.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -76,8 +79,7 @@ Context()->operators->set( $student = $ans->{student_formula}; $correct = $correct->{original_formula} if defined $correct->{original_formula}; Context()->flags->set(bizarroPow=> 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = ($correct == $student); # check if equal when ^ is replace by bizarro ^ Context()->flags->set(bizarroPow=> 0); Value::Error("Please only simplify according to the rules of exponents; for example, write 2^2 instead of 4") unless $OK; @@ -99,7 +101,7 @@ $ans = Formula("$ans"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [`\displaystyle\frac{[$myvar1]}{[$myvar2]}=`] [____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision80.pg index b9761bff25..3fee373893 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision80.pg @@ -14,16 +14,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction') -## MLT(Quotient_in_power) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -83,13 +85,13 @@ $ans = Formula("$var1^($total1)/($denom*$var2^($total2)*$var3^($total3))"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` \left(\displaystyle\frac{[$var1]^{[$m]}}{[$a][$var2]^{[$n]}[$var3]^{[$p]}}\right)^{[$k]}= `] [__________________________] -Be careful to use grouping parenthesis appropriately- remember that 1/(2x) is different from 1/2x. +[@KeyboardInstructions('Be careful to use grouping parenthesis appropriately. Remember that [|1/(2x)|]* is different from [|1/2x|]*.')@]** END_PGML ANS($ans -> cmp( @@ -102,8 +104,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision85.pg index c09ad0feb5..99b0447a19 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision85.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision85.pg @@ -13,16 +13,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction') -## MLT(Quotient_in_power) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +37,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -84,13 +86,13 @@ $ans = Formula("$numerator*$var1^($total1)/($denom*$var2^($total2))"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [` \left(\displaystyle\frac{[$a][$var1]^{[$m]}}{[$b][$var2]^{[$n]}}\right)^{[$p]}= `] [__________________________] -Be careful to use grouping parenthesis appropriately- remember that 1/(2x) is different from 1/2x. +[@KeyboardInstructions('Be careful to use grouping parenthesis appropriately. Remember that [|1/(2x)|]* is different from [|1/2x|]*.')@]** END_PGML ANS($ans -> cmp( @@ -103,8 +105,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision90.pg index 51ed8fb077..1b51c8e5b5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision90.pg @@ -13,16 +13,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide') -## MLT(Division_exponents_multivar) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +37,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -84,7 +86,7 @@ $var2=Formula("$var2"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [`\displaystyle\frac{[$myvar1]\cdot[$myvar3]}{[$myvar2]\cdot[$myvar4]}=`] [__________________________________] @@ -101,8 +103,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision95.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision95.pg index 0664791ef7..244b6763ed 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision95.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentDivision95.pg @@ -15,15 +15,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','simplify','fraction','divide') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,7 @@ loadMacros( "contextLimitedPolynomial.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -97,7 +100,7 @@ $ans = Formula("$ans"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following +Use the properties of exponents to simplify the expression. [`\displaystyle\frac{[$myvar1]\cdot[$myvar3]}{[$myvar2]\cdot[$myvar4]}=`] [__________________________________] @@ -113,8 +116,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroPow=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Value->Error("Your answer is correct, but please simplify it according to rules of exponents; for example, use 2^2 not 4") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroPow=>0); return 1; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication0.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication0.pg index 051cb2e4a1..6ad26bfc6f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication0.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication0.pg @@ -14,16 +14,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') -## MLT(Algebra_PropExp_PropExp) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,9 +68,10 @@ $ans = Formula("$myvar^($total)"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`[$myvar1]\cdot[$myvar2] = `] +Use the properties of exponents to simplify the expression. + + [`[$myvar1]\cdot[$myvar2]`] + [____________] END_PGML @@ -80,12 +83,10 @@ ANS($ans -> cmp() -> "When multiplying terms with the same base, you do not multiply the exponents."))); BEGIN_PGML_SOLUTION -We _add_ the exponents as follows - - [`\begin{aligned} +We _add_ the exponents as follows: [```\begin{aligned} [$myvar]^{[$m]}\cdot [$myvar]^{[$n]}&=[$myvar]^{[$m]+[$n]}\\ &=[$myvar]^{[$total]} - \end{aligned}`] + \end{aligned}```] END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication09.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication09.pg index a5a0060f58..06e0af7bdb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication09.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication09.pg @@ -13,15 +13,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "PGML.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,10 +65,13 @@ $ans = Formula("$mybase^($total)"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`[$left]\cdot[$right] = `] +Use the properties of exponents to simplify the expression. + + [`[$left]\cdot[$right]`] + [____________] + + END_PGML $wrong=$m*$n; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication10.pg index aff58d2ac4..c8ef535d0c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication10.pg @@ -13,15 +13,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "PGML.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,10 +65,13 @@ $ans = Formula("$mybase^($total)"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`[$left]\cdot[$right] = `] +Use the properties of exponents to simplify the expression. + + [`[$left]\cdot[$right]`] + [____________] + + END_PGML $wrong=$m*$n; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication15.pg index 111299e66f..cdb547ad45 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication15.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication15.pg @@ -13,15 +13,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +38,7 @@ loadMacros( "contextLimitedPolynomial.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -82,10 +85,12 @@ $ans = Compute($ans); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`\left([$myvar]\right)^{[$n]} = `] +Use the properties of exponents to simplify the expression. + + [`\left([$myvar]\right)^{[$n]}`] + [____________] + END_PGML $wrong=$m+$n; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication20.pg index 27a134d0a7..264e7a4149 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication20.pg @@ -14,17 +14,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') -## MLT(Algebra_PropExp_PropExp) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,10 +66,12 @@ $ans = Formula("$myvar^($total)"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`\left([$myvar]^{[$m]}\right)^{[$n]} = `] +Use the properties of exponents to simplify the expression. + + [``\left([$myvar]^{[$m]}\right)^{[$n]}``] + [____________] + END_PGML $wrong=$m+$n; @@ -78,12 +81,10 @@ ANS($ans -> cmp() -> "When raising terms to a power, you do not add the exponents."))); BEGIN_PGML_SOLUTION -We _multiply_ the exponents as follows - - [`\begin{aligned} +We _multiply_ the exponents as follows: [```\begin{aligned} \left([$myvar]^{[$m]}\right)^{[$n]}&=[$myvar]^{[$m]\cdot[$n]}\\ &=[$myvar]^{[$total]} - \end{aligned}`] + \end{aligned}```] END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication23.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication23.pg index a9fb541c10..4f7c8b1241 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication23.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication23.pg @@ -17,16 +17,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') -## MLT(Algebra_PropExp_PropExp) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +41,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -68,21 +70,21 @@ $ans = Formula("$coeffPower*$myvar1^($total)"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`\left([$a][$myvar1]\right)^[$n] = `] +Use the properties of exponents to simplify the expression. + + [``\left([$a][$myvar1]\right)^[$n]``] + [____________]{$ans} + END_PGML ########################################################### BEGIN_PGML_SOLUTION -We _multiply_ the exponents and apply the rule [`(ab)^m=a^m\cdot b^m`] as follows - - [`\begin{aligned} +We _multiply_ the exponents and apply the rule [`(ab)^m=a^m\cdot b^m`] as follows: [```\begin{aligned} \left([$a][$myvar1]\right)^{[$n]}&=([$a])^{[$n]}[$myvar1]^{[$n]}\\ &=[$coeffPower][$myvar1]^{[$total]} - \end{aligned}`] + \end{aligned}```] END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication24.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication24.pg index c77b9fe417..4dabf5588e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication24.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication24.pg @@ -17,16 +17,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') -## MLT(Mult_exponents_multivar) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +41,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,10 +71,12 @@ $ans = Formula("$coeffPower*$myvar1^($total)*$myvar2^($total)"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`\left([$a][$myvar1][$myvar2]\right)^[$n] = `] +Use the properties of exponents to simplify the expression. + + [`\left([$a][$myvar1][$myvar2]\right)^[$n]`] + [____________]{$ans} + END_PGML ########################################################### diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication25.pg index dfda348093..7eefeb2887 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication25.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication25.pg @@ -17,16 +17,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +41,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,10 +71,12 @@ $ans = Formula("$coeffPower*$myvar^($total)"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`\left([$a][$myvar]^{[$m]}\right)^[$n] = `] +Use the properties of exponents to simplify the expression. + + [`\left([$a][$myvar]^{[$m]}\right)^[$n]`] + [____________] + END_PGML $wrong=$m+$n; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication30.pg index e872b33bb0..33478a1605 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication30.pg @@ -16,16 +16,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -38,7 +40,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,10 +71,13 @@ $ans = Formula("$coeff*$myvar^($total)"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`([$myvar1])\cdot([$myvar2]) = `] +Use the properties of exponents to simplify the expression. + + [``([$myvar1])\cdot([$myvar2])``] + [____________] + + END_PGML $wrong=$m*$n; @@ -82,12 +87,10 @@ ANS($ans -> cmp() -> "When multiplying terms with the same base, you do not multiply the exponents."))); BEGIN_PGML_SOLUTION -We _multiply_ the coefficients, and _add_ the exponents as follows - - [`\begin{aligned} +We _multiply_ the coefficients, and _add_ the exponents as follows: [```\begin{aligned} ([$myvar1])\cdot ([$myvar2])&=([$a] \cdot [$b])\cdot [$myvar]^{[$m]+[$n]}\\ &=[$coeff][$myvar]^{[$total]} - \end{aligned}`] + \end{aligned}```] END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication35.pg index 65e2f53591..b14e052518 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication35.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication35.pg @@ -18,16 +18,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify','fraction') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -41,7 +43,7 @@ loadMacros( "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -75,10 +77,12 @@ $ans = Formula("$myvar^($total)/$coeff")->reduce; ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [``\left([$myvar1]\right) \cdot \left([$myvar2]\right) = ``] +Use the properties of exponents to simplify the expression. + + [``\left([$myvar1]\right) \cdot \left([$myvar2]\right)``] + [____________] + END_PGML $wrong=$m*$n; @@ -95,8 +99,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.27,0.37]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication40.pg index 13974ffc6a..137133ecef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication40.pg @@ -16,16 +16,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -38,7 +40,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -74,10 +76,12 @@ $ans = Formula("$coeff*$myvar^($total)"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`([$myvar1])\cdot([$myvar2])\cdot([$myvar3]) = `] +Use the properties of exponents to simplify the expression. + + [`([$myvar1])\cdot([$myvar2])\cdot([$myvar3])`] + [_______________________] + END_PGML $wrong=$m*$n*$k; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication44.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication44.pg index cfed0fad8d..201a5f0e79 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication44.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication44.pg @@ -9,14 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -65,13 +69,10 @@ TEXT(beginproblem()); BEGIN_PGML Use the properties of exponents to simplify the expression. -a. - - [``[$func1]=``][_____________]{$ans1} +a. [``[$func1]=``][_____________]{$ans1} -b. +a. [``[$func2]=``][_____________]{$ans2} - [``[$func2]=``][_____________]{$ans2} END_PGML ############################################## @@ -80,16 +81,12 @@ $s1 = Compute("$var**$m")->reduce; BEGIN_PGML_SOLUTION -a. - - [`\begin{aligned} +a. [`\begin{aligned}[t] [$func1] &= ([$a])^[$n]([$s1])^[$n] \\ &= [$ans1] \end{aligned}`] -b. - - [`\begin{aligned} +b. [`\begin{aligned}[t] [$func2] &= -([$b])^[$n]([$s1])^[$n] \\ &= [$ans2] \end{aligned}`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication45.pg index 7cad60c657..495984c49f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication45.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication45.pg @@ -17,16 +17,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +41,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,10 +71,12 @@ $ans = Formula("$coeffPower*$myvar^($total)"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`\left([$a][$myvar]^{[$m]}\right)^[$n] = `] +Use the properties of exponents to simplify the expression. + + [`\left([$a][$myvar]^{[$m]}\right)^[$n]`] + [_______________________] + END_PGML $wrong=$m+$n; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication5.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication5.pg index 0d50fa8a3f..31cfb15319 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication5.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication5.pg @@ -14,16 +14,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') -## MLT(Algebra_PropExp_PropExp) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,10 +67,13 @@ $ans = Formula("$myvar^($total)"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`[$myvar1]\cdot[$myvar2]\cdot[$myvar3] = `] +Use the properties of exponents to simplify the expression. + + [`[$myvar1]\cdot[$myvar2]\cdot[$myvar3]`] + [____________] + + END_PGML $wrong=$m*$n*$k; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication50.pg index 7246743d5e..92888d491a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication50.pg @@ -17,16 +17,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('multiply','exponent','simplify') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +41,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -71,10 +73,12 @@ $ans = Formula("$coeffPowerb*$myvar^($total)"); TEXT(beginproblem()); BEGIN_PGML -Use the properties of exponents to simplify the following - - [`[$b]\left([$a][$myvar]^{[$m]}\right)^[$n] = `] +Use the properties of exponents to simplify the expression. + + [`[$b]\left([$a][$myvar]^{[$m]}\right)^[$n]`] + [_______________________] + END_PGML $wrong=$m+$n; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication55.pg index 62ee42608f..a698c1c0d3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication55.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/exponentsMultiplication55.pg @@ -1,20 +1,3 @@ -####################################### -### Generated from PreTeXt source -### on 2017-11-29T13:56:31-08:00 -### -### http://mathbook.pugetsound.edu -### -####################################### -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Simplifying expressions) -## Level(3) -## Language(en-US) -## TitleText1('') -## AuthorText1('') -## EditionText1('') -## Section1('.') -## Problem1('6 1 6') DOCUMENT(); @@ -35,7 +18,6 @@ loadMacros( ############################################################ # Header ############################################################ -COMMENT('Authored in PreTeXt'); TEXT(beginproblem()); ############################################################ diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp0.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp0.pg index dee1f19575..8e2c0c62b9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp0.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp0.pg @@ -2,14 +2,14 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # 1 # ( --- ) ^-n # a # -# Evaluate the expression; in other words, write the answer -# without using exponents. +# +# # # a is the base, and is integer on [2,10]. # @@ -18,15 +18,18 @@ # Last updated: Hughes 9/7/13, Carl Yao, 7/01/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +39,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,14 +60,14 @@ $ans = Compute($a**$n); TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. + +[`` \left(\frac{1}{[$a]}\right)^{[$n*(-1)]} ``] - [`` - \displaystyle\left(\frac{1}{[$a]}\right)^{[$n*(-1)]}= - ``] [`\quad`] [____________]{$ans} +[____________]{$ans} -Evaluate the expression; in other words, write the answer -without using exponents. + + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp10.pg index 1eca2af771..322204104a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp10.pg @@ -2,27 +2,30 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # a^-1 - b^-1 # -# Evaluate the expression; in other words, write the answer -# without using exponents. +# +# # # a and b are integers on [2,10]. # # Last updated: Carl Yao, 7/01/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,14 +58,14 @@ $ans = Fraction("$numerator/($denominator)"); TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` [$a]^{-1}-[$b]^{-1}= `][____________]{$ans} -Evaluate the expression; in other words, write the answer -without using exponents. Hint: you will need to _subtract_ fractions for this problem. + + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp100.pg index d4d5fd46a9..22bb3c106e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp100.pg @@ -16,16 +16,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Division_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -38,7 +40,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -78,7 +80,7 @@ $ans = Formula("($totalCoeff*$var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{\left([$a][$var]^{[$m]}\right)^{[$p]}}{[$var]^{[$n*(-1)]}}= @@ -96,8 +98,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp105.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp105.pg index 5bdbe66c61..48f78cd712 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp105.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp105.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Quotient_in_power) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -72,7 +74,7 @@ $ans = Formula("1/($var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\left(\frac{[$var]^{[$m]}}{[$var]^{[$n]}}\right)^{[$p*(-1)]}= @@ -90,8 +92,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>0); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp110.pg index 8caebd5161..47ea3640af 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp110.pg @@ -16,16 +16,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Quotient_in_power) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -38,7 +40,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,7 +82,7 @@ $ans = Formula("1/($totalCoeff*$var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\left(\frac{[$b*$a][$var]^{[$m]}}{[$a][$var]^{[$n]}}\right)^{[$p*(-1)]}= @@ -98,8 +100,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp115.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp115.pg index 3f979c704c..0400a8b204 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp115.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp115.pg @@ -12,16 +12,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -73,11 +75,11 @@ $ans = Formula("$var^($total)/$totalCoeff")->reduce; TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. - [` - \left([$a][$var]^{[$m*(-1)]}\right)^{[$n*(-1)]} - `][____________] +[` \left([$a][$var]^{[$m*(-1)]}\right)^{[$n*(-1)]}`] + +[____________] END_PGML @@ -91,8 +93,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp120.pg index 58b3c60c19..2a50b200f2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp120.pg @@ -12,16 +12,18 @@ # Last updated: Hughes 7/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -73,11 +75,11 @@ $ans = Formula("($var^($total)/$totalCoeff)"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. - [` - \left([$a][$var]^{[$m*(-1)]}\right)^{[$n*(-1)]} - `][____________] +[` \left([$a][$var]^{[$m*(-1)]}\right)^{[$n*(-1)]} `] + +[____________] END_PGML @@ -91,8 +93,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp125.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp125.pg index b4f83721b1..f73d53cef9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp125.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp125.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Division_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +39,7 @@ loadMacros( "contextLimitedPolynomial.pl", "contextFraction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -87,7 +89,7 @@ $ans = Formula("($coeff*$var^$total)/$c"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{[$a][$var]^{[$m]}\cdot[$b][$var]^{[$n]}}{[$c][$var]^{[$p]}}= @@ -105,8 +107,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp130.pg index 8eeeb31c3d..b7e1724807 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp130.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +39,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -71,7 +73,7 @@ $ans = Formula("$var^($total)"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \left([$var]^{[$m]}\right)^{[$n]}\cdot [$var]^{[$p*(-1)]}= @@ -89,8 +91,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp135.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp135.pg index d0268dfa29..238a8f9ccc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp135.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp135.pg @@ -15,16 +15,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +39,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -75,7 +77,7 @@ $ans = Formula("$totalCoeff*$var^($total)"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \left([$a][$var]^{[$m]}\right)^{[$n]}\cdot [$var]^{[$p*(-1)]}= @@ -93,8 +95,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp140.pg index da0e477015..e4edc70d38 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp140.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Division_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -81,7 +83,7 @@ $ans = Formula("1/($var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{\left([$var]^{[$m]}\right)^{[$n]}}{\left([$var]^{[$p]}\right)^{[$k]}}= @@ -99,8 +101,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp145.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp145.pg index 31e6dcef07..bd766c98f1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp145.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp145.pg @@ -12,16 +12,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Algebra_PropExp_PropExp) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -72,7 +74,7 @@ $ans = Formula("1/($var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \left([$var]^{[$m]}\right)^{[$n*(-1)]}= @@ -90,8 +92,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp15.pg index 62f11a39b5..995588e4c3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp15.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp15.pg @@ -2,29 +2,31 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # x^-m # ---- # y^-n # -# Rewrite the expression using only positive exponents. +# # # m and n are integers on [2,20]. # # Last updated: Hughes 9/7/13, Carl Yao, 7/01/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Division_exponents_multivar) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +39,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -70,13 +72,13 @@ $ans = Formula("$var2^$n/$var1^$m"); TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{[$var1]^{[$m*(-1)]}}{[$var2]^{[$n*(-1)]}}= `][____________] -Rewrite the expression using only positive exponents. + END_PGML @@ -90,8 +92,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp150.pg index 4199ff10dd..84dcceec61 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp150.pg @@ -12,17 +12,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Mult_exponents_multivar) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +36,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -78,13 +79,13 @@ $ans = Formula("1/($var1^($total1)*$var2^($total2))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \left([$var1]^{[$m]}[$var2]^{[$n]}\right)^{[$p*(-1)]}= `][____________] -You'll need to be careful with grouping parenthesis in this problem because 1/2[$var1] is not the same as 1/(2[$var1]). +[@KeyboardInstructions("Be careful to use grouping parenthesis appropriately. Remember that [|1/(2$var1)|]* is different from [|1/2$var1|]*.")@]** END_PGML ANS($ans -> cmp( @@ -97,8 +98,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp155.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp155.pg index 32751d027e..e31bef94bf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp155.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp155.pg @@ -12,17 +12,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Mult_exponents_multivar) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextRationalFunction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,13 +65,13 @@ $ans = Formula("$var1^($total1)/($var2^($total2))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \left([$var1]^{[$m*(-1)]}[$var2]^{[$n]}\right)^{[$p*(-1)]}= `][____________]{$ans} -You'll need to be careful with grouping parenthesis in this problem because 1/2[$var1] is not the same as 1/(2[$var1]). +[@KeyboardInstructions("Be careful to use grouping parenthesis appropriately. Remember that [|1/(2$var1)|]* is different from [|1/2$var1|]*.")@]** END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp160.pg index e85d310401..ef17a4b3e3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp160.pg @@ -16,16 +16,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Quotient_in_power) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -38,7 +40,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -81,7 +83,7 @@ $ans = Formula("$numerator/($var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\left(\frac{[$var]^{[$m]}}{[$a]}\right)^{[$n*(-1)]}= @@ -99,8 +101,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp165.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp165.pg index 44155928da..ace94da815 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp165.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp165.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Quotient_in_power) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextRationalFunction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,7 +68,7 @@ $ans = Formula("$var2^($total2)/($var1^($total1))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\left(\frac{[$var1]^{[$m]}}{[$var2]^{[$n]}}\right)^{[$p*(-1)]}= diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp170.pg index c65aac5a13..b230831592 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp170.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp170.pg @@ -16,16 +16,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','simplify','fraction') -## MLT(Division_exponents_multivar) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +39,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextRationalFunction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -85,7 +87,7 @@ TEXT(beginproblem()); # x^{mp+qs} BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{\left([$var1]^{[$m]}[$var2]^{[$n*(-1)]}\right)^{[$p*(-1)]}}{\left([$var1]^{[$q*(-1)]}[$var2]^{[$r]}\right)^{[$s*(-1)]}}= diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp175.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp175.pg index 5df593e18f..a8753aa57e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp175.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp175.pg @@ -16,16 +16,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','simplify','fraction') -## MLT(Mult_exponents_multivar) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,10 +38,10 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextRationalFunction.pl", +"contextRationalFunction.pl", "contextFraction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -112,14 +114,12 @@ TEXT(beginproblem()); # b^r x^{m+qr} z^p BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` [$a][$var1]^{[$m*(-1)]}[$var2]^{[$n]}[$var3]^{[$p*(-1)]}\left([$b][$var1]^{[$q]}\right)^{[$r*(-1)]}= `][______________________] -This problem initially looks quite complicated, but as long as you gather each of the variables -together and remember your properties of exponents, it's not as bad as it first looks- honest! END_PGML ANS($ans -> cmp( @@ -132,8 +132,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp180.pg index 2ce2754d6e..446ec068b7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp180.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp180.pg @@ -14,16 +14,18 @@ # Last updated: Hughes 9/4/13, Carl Yao 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','simplify','fraction') -## MLT(Quotient_in_power) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,9 +36,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextRationalFunction.pl", +"contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -94,14 +96,12 @@ TEXT(beginproblem()); # x^-q y^-r z^-s x^{(m+q)t} y^{(n+r)t} z^{(p+s)t} BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle \left( \frac{[$var1]^{[$m]}[$var2]^{[$n]}[$var3]^{[$p]}}{[$var1]^{[$q*(-1)]}[$var2]^{[$r*(-1)]}[$var3]^{[$s*(-1)]}}\right)^{[$t*(-1)]}= `][___________________________] -This problem initially looks quite complicated, but as long as you gather each of the variables -together and remember your properties of exponents, it's not as bad as it first looks- honest! END_PGML ANS($ans -> cmp( @@ -114,8 +114,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp20.pg index 8a8e8908b5..1e5e7983b3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp20.pg @@ -2,30 +2,31 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # x^-m # ---- # y^n # -# Rewrite the expression using only positive exponents. +# # # m and n are integers on [2,20]. # # Last updated: Carl Yao, 7/01/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Division_exponents_multivar) - +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -38,7 +39,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,15 +70,15 @@ $ans = Formula("1/($var2^$n*$var1^$m)"); TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{[$var1]^{[$m*(-1)]}}{[$var2]^{[$n]}}= `][____________] -Rewrite the expression using only positive exponents. -Be careful to use grouping parenthesis appropriately in this problem- remember that 1/2[$var1] is different from 1/(2[$var1]). + +[@KeyboardInstructions("Be careful to use grouping parenthesis appropriately. Remember that [|1/(2$var1)|]* is different from [|1/2$var1|]*.")@]** END_PGML @@ -92,8 +93,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1,limits=>[2,10]); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp25.pg index afb82d2bff..cebc973eaf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp25.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp25.pg @@ -2,13 +2,13 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # 1 # ------ # a x^-n # -# Rewrite the expression using only positive exponents. +# # # a is integer on [2,20]. # @@ -17,16 +17,18 @@ # Last updated: Hughes 9/5/13, Carl Yao, 7/01/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Algebra_PropExp_PropExp) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +41,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -71,13 +73,13 @@ $ans = Formula("$var^$n/$a"); TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{1}{[$a][$var]^{[$n*(-1)]}}= `][____________] -Rewrite the expression using only positive exponents. + END_PGML @@ -91,8 +93,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp30.pg index fea999c3c2..331e3dcde8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp30.pg @@ -14,16 +14,18 @@ # Last updated: Hughes 9/5/13, Carl Yao, 7/01/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Division_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -68,7 +70,7 @@ $ans = Formula("1/($var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{[$var]^{[$m]}}{[$var]^{[$n]}}= @@ -86,8 +88,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp35.pg index 5a11cbdcec..f22090d103 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp35.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp35.pg @@ -14,16 +14,18 @@ # Last updated: Hughes 9/5/13, Carl Yao, 7/01/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Division_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -72,7 +74,7 @@ $ans = Formula("$b/($var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{[$totalCoeff][$var]^{[$m]}}{[$a][$var]^{[$n]}}= @@ -90,8 +92,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp36.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp36.pg index b6563eef52..29314a3111 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp36.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp36.pg @@ -16,17 +16,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/01/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## MLT(SingleVarRational_CoeffDontCancel) -## MLTleader(1) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +40,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -79,14 +80,13 @@ TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{[$a][$var]^{[$m]}}{[$b][$var]^{[$n]}}= `][____________] -Note that you may have to be careful with grouping parenthesis in this problem; 1/2[$var] -is not the same as 1/(2[$var]). +[@KeyboardInstructions("Be careful to use grouping parenthesis appropriately. Remember that [|1/(2$var)|]* is different from [|1/2$var|]*.")@]** END_PGML @@ -100,8 +100,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp40.pg index 4b4f4a65cc..1141763053 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp40.pg @@ -14,16 +14,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Division_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -68,7 +70,7 @@ $ans = Formula("1/($var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{[$var]^{[$m]}}{\left([$var]^{[$n]}\right)^{[$p]}}= @@ -86,8 +88,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp41.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp41.pg index 303c78c0c5..91d31aa190 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp41.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp41.pg @@ -14,16 +14,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Division_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,7 +71,7 @@ $ans = Formula("1/($var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{[$var]^{[$m*(-1)]}}{\left([$var]^{[$n]}\right)^{[$p]}}= @@ -87,8 +89,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>0); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp45.pg index 00788dd69f..f092c42ddd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp45.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp45.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +37,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,7 +68,7 @@ $ans = Formula("1/($var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` [$var]^{[$n*(-1)]}\cdot [$var]^{[$m]}= @@ -85,8 +87,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>0); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp5.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp5.pg index 492dd3363d..d3151fcba8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp5.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp5.pg @@ -2,14 +2,14 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # a^-m # ---- # b^-n # -# Evaluate the expression; in other words, write the answer -# without using exponents. +# +# # # a and b are integers on [2,8]. # @@ -18,15 +18,18 @@ # Last updated: Carl Yao, 7/01/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,14 +67,14 @@ $ans = Fraction("$numerator/($denominator)"); TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{[$a]^{[$m*(-1)]}}{[$b]^{[$n*(-1)]}}= `][_________________]{$ans} -Evaluate the expression; in other words, write the answer -without using exponents. + + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp50.pg index 72b80dc9fb..91db883ce0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp50.pg @@ -15,16 +15,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Mult_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +39,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -75,7 +77,7 @@ $ans = Formula("$totalCoeff/($var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` ([$a][$var]^{[$n*(-1)]})\cdot ([$b][$var]^{[$m]})= @@ -93,8 +95,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp55.pg index a5eed62ede..661ecea9af 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp55.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp55.pg @@ -2,14 +2,14 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # a # ( --- ) ^-n # b # -# Evaluate the expression; in other words, write the answer -# without using exponents. +# +# # # a and b are integers on [2,8]. # @@ -18,15 +18,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','evaluate','simplify') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,14 +72,14 @@ TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\left(\frac{[$a]}{[$b]}\right)^{[$n*(-1)]}= `][_________________]{$ans} -Evaluate the expression; in other words, write the answer -without using exponents. + + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp60.pg index 59b90dd165..89020c6d9b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp60.pg @@ -2,12 +2,12 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # a^-n # -# Evaluate the expression; in other words, write the answer -# without using exponents. +# +# # # a is the base, and is integer on [-10,-2]. # @@ -16,15 +16,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','evaluate','simplify') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +38,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -59,14 +62,14 @@ $ans = Fraction("$numerator/($denominator)"); TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` \left([$a]\right)^{[$n*(-1)]}= `][____________]{$ans} -Evaluate the expression; in other words, write the answer -without using exponents. + + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp65.pg index 133562b019..fabba7b069 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp65.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp65.pg @@ -2,14 +2,14 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # 1 # ---- # a^-n # -# Evaluate the expression; in other words, write the answer -# without using exponents. +# +# # # a is the base, and is integer on [-10,-2]. # @@ -18,15 +18,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','evaluate','simplify') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,14 +64,14 @@ $ans = Compute(($a)**$n); TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{1}{([$a])^{[$n*(-1)]}}= `][____________]{$ans} -Evaluate the expression; in other words, write the answer -without using exponents. + + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp70.pg index a998c74f77..1aa5c951b6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp70.pg @@ -2,14 +2,14 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # b # ---- # a^-n # -# Evaluate the expression; in other words, write the answer -# without using exponents. +# +# # # a is the base, and is integer on [-5,-2]. # @@ -20,15 +20,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify','evaluate') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +42,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -68,14 +71,14 @@ $ans = Compute($b*($a)**$n); TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{[$b]}{([$a])^{[$n*(-1)]}}= `][____________]{$ans} -Evaluate the expression; in other words, write the answer -without using exponents. + + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp75.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp75.pg index 70f43ce009..2d4d8a2f84 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp75.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp75.pg @@ -2,12 +2,12 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # a^-n # -# Evaluate the expression; in other words, write the answer -# without using exponents. +# +# # # a is the base, and is integer on [2,10]. # @@ -16,15 +16,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify','evaluate') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +38,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -59,14 +62,14 @@ $ans = Fraction("1/($denominator)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` [$a]^{[$n*(-1)]}= `][____________]{$ans} -Evaluate the expression; in other words, write the answer -without using exponents. + + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp80.pg index 297ded1835..581ce041cf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp80.pg @@ -2,27 +2,30 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # a^-1 + b^-1 # -# Evaluate the expression; in other words, write the answer -# without using exponents. +# +# # # a and b are integers on [2,10]. # # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify','evaluate') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,14 +59,13 @@ $ans = Fraction("$numerator/($denominator)"); TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` [$a]^{-1}+[$b]^{-1}= `][____________]{$ans} -Evaluate the expression; in other words, write the answer -without using exponents. Hint: you will need to _add_ fractions for this problem. + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp85.pg index 1557c09d09..75ed030e2e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp85.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp85.pg @@ -2,14 +2,14 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # 1 # ---- # a^-n # -# Evaluate the expression; in other words, write the answer -# without using exponents. +# +# # # a is the base, and is integer on [2,10]. # @@ -18,15 +18,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify','evaluate') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,14 +63,14 @@ $ans = Compute($a**$n); TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{1}{[$a]^{[$n*(-1)]}}= `][____________]{$ans} -Evaluate the expression; in other words, write the answer -without using exponents. + + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp90.pg index 2ac7b3bb09..dc9d1ae5b5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp90.pg @@ -2,12 +2,12 @@ # Portland Community College # # Template: -# Here is an expression with negative exponents. +# Rewrite the expression simplified and using only positive exponents. # # -a^-n # -# Evaluate the expression; in other words, write the answer -# without using exponents. +# +# # # a is the base, and is integer on [2,10]. # @@ -16,15 +16,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Exponentiation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify','evaluate') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +38,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,14 +60,14 @@ $ans = Fraction("-1/($denominator)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Here is an expression with negative exponents. +Rewrite the expression simplified and using only positive exponents. [` [$a*(-1)]^{[$n*(-1)]}= `][____________]{$ans} -Evaluate the expression; in other words, write the answer -without using exponents. + + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp95.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp95.pg index caca08cd59..3b50083a6a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp95.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Exponents/negExp95.pg @@ -16,16 +16,18 @@ # Last updated: Hughes 9/4/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of exponents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','negative','fraction','simplify') -## MLT(Division_exponents_one_var) +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -38,7 +40,7 @@ loadMacros( "PCCmacros.pl", "contextRationalFunction.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -78,7 +80,7 @@ $ans = Formula("$totalCoeff/($var^($total))"); TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression, and write your answer using only _positive_ exponents. +Rewrite the expression simplified and using only positive exponents. [` \displaystyle\frac{\left([$a][$var]^{[$m]}\right)^{[$p]}}{[$var]^{[$n]}}= @@ -96,8 +98,7 @@ ANS($ans -> cmp( $student = Formula("$student"); $correct = Formula("$correct"); return 0 unless ($correct == $student); Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; Context()->flags->set(limits=>[0.25,0.4]); Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring10.pg index 7a2cea3776..2b0297e355 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring10.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Find the greatest common factor of the following two terms +# Find the greatest common factor of the following terms. # # a*bx^2, a*x # @@ -14,16 +14,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(find_gcf) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +32,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "parserOneOf.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -74,7 +70,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the greatest common factor of the following two terms +Find the greatest common factor of the following terms. [`[$poly1]`] and [`[$poly2]`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring100.pg index 96c5d11b4c..456eec797d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring100.pg @@ -15,16 +15,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(common_factors_trinomials_multi_var) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,8 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -71,11 +67,11 @@ $ans = Formula("$d*$var1^3$var2^$m($a*$var1^2+$b*$var1+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [_______________________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring105.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring105.pg index ba5d4ac7ba..61caa14537 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring105.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring105.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # x (x + a) + b (x + a) # @@ -15,15 +15,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(common_factors_more_involved) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','factor by grouping') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,8 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -63,11 +60,11 @@ $ans = Formula("($var+$a)*($var+$b)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring110.pg index f6f0e3cd6d..df67fd487d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring110.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # x (y + a) + b (y + a) # @@ -15,15 +15,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(common_factors_more_involved) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','factor by grouping','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,8 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -64,11 +61,11 @@ $ans = Formula("($var1+$b)*($var2+$a)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring115.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring115.pg index 2884317de3..f0783d73ac 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring115.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring115.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x (x + y) + b (x + y) # @@ -16,15 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(AlgFac3) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','factor by grouping','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,8 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -66,11 +63,11 @@ $ans = Formula("($a$var1+$b)*($var1+$var2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring120.pg index 31afcd952e..594bf5b162 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring120.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^m (b x + c) + b x + c # @@ -16,15 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(common_factors_more_involved) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','factor by grouping') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,8 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -59,18 +56,18 @@ $a = random(2,10,1); $b = random(2,10,1); $c = $b; $c = random(2,10,1)*random(-1,1,2) while(gcd($b,$c)!=1); -$m = random(2,10,1); +do {$m = random(2,10,1)} until ($a != 8 || $m % 3 != 0); $question = Formula("$a$var^$m($b$var+$c)+$b$var+$c")->reduce; $ans = Formula("($a$var^$m+1)*($b$var+$c)")->reduce; ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $solnstep = Formula("$b$var+$c")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring125.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring125.pg index 0a2c43a207..3a0f7d4dc1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring125.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring125.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # x ^2 + a x + b x + a b # @@ -18,14 +18,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring by grouping) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','factor by grouping') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,8 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -65,11 +63,11 @@ $ans = Formula("($var+$b)*($var+$a)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring130.pg index 8dace962d4..7bf077d8c4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring130.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # x ^3 + a x^2 + b x + a b # @@ -18,16 +18,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring by grouping) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(simple_four_term_grouping) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','factor by grouping') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -37,8 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -58,23 +54,20 @@ Context()->noreduce('(-x)-y', '(-x)+y'); # the common term -do { - $a = list_random(2,3,5,6,7,8,10)*random(-1,1,2); - $b = random(2,10,1)*random(-1,1,2); -} until (abs($a)!=abs($b) and $b != -4 and $b != -9); +$a = list_random(2,3,5,6,7,8,10)*random(-1,1,2); +$b = $a; +$b = list_random(2,3,5,6,7,8,10)*random(-1,1,2)while(abs($a)==abs($b)); $question = Formula("$var^3+$a$var^2+$b$var+$a*$b")->reduce; $ans = Formula("($var^2+$b)*($var+$a)")->reduce; ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -(Your answer should be a product of polynomials with integer coefficients.) - -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring135.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring135.pg index 0527071313..95e4a69804 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring135.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring135.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # x y + a x + b y + a b # @@ -18,15 +18,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring by grouping) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(AlgFac5) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','factor by grouping','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -36,8 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -68,11 +65,11 @@ $ans = Formula("($var1+$b)*($var2+$a)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring140.pg index b56af3840a..f4ec834a04 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring140.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + a b x y + c x y + c b y^2 # @@ -20,16 +20,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring by grouping) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(grouping_multi_variable) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','factor by grouping','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,8 +35,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -72,11 +68,11 @@ $ans = Formula("($a$var1+$c$var2)*($var1+$b$var2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring145.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring145.pg index 0d329076c4..3906476022 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring145.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring145.pg @@ -15,15 +15,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(common_factors_trinomials_multi_var) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,8 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -75,11 +72,11 @@ $ans = Formula("$d*$var1^3$var2^$m$var3^($n-2)($a*$var1^2$var3^2+$b*$var1$var3+$ TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [_______________________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring15.pg index 6d087988a3..1cfe803e7a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring15.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring15.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Find the greatest common factor of the following two terms +# Find the greatest common factor of the following terms. # # a*bx^4, a*x^3 # @@ -15,15 +15,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(find_gcf) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +33,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "parserOneOf.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -78,7 +75,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the greatest common factor of the following two terms +Find the greatest common factor of the following terms. [`[$poly1]`] and [`[$poly2]`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring150.pg index 453116190e..39cb2c9c55 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring150.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # x^3 + a + b x^3 y + a b y # @@ -18,15 +18,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring by grouping) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(grouping_multi_variable) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','factor by grouping','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -36,8 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -69,11 +66,11 @@ $ans = Formula("($var1^3+$a)*(1+$b$var2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring155.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring155.pg index 946040d100..89b5cb3892 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring155.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring155.pg @@ -17,14 +17,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,8 +32,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -72,11 +70,11 @@ $ans = Formula("$d*$var^2($var+$e)($a*$var^2+$b*$var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [_______________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring160.pg index d0a2470090..37dd391c56 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring160.pg @@ -24,14 +24,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring by grouping) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','factor by grouping') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -41,8 +39,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -79,13 +77,17 @@ $ans = Formula("$d*$var^2($var+$e)($a*$var^2+$b*$var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [_______________________]{$ans} -* Hint: factor each pair of terms first END_PGML +BEGIN_PGML_HINT +Factor each pair of terms first. +END_PGML_HINT + + $pair1 = Formula("$d*$a*$var^5+$e*$d*$a*$var^4")->reduce; $pair2 = Formula("$d*$b*$var^4+$e*$d*$b*$var^3")->reduce; $pair3 = Formula("+$d*$c$var^3+$e*$d*$c$var^2")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring165.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring165.pg index 8ad3184686..2390c82135 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring165.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring165.pg @@ -13,14 +13,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor','application') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -30,9 +28,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGgraphmacros.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", +"PGgraphmacros.pl", + "PGcourse.pl", ); ############################################## @@ -120,7 +118,7 @@ $picture->fillRegion([ ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + BEGIN_PGML The square below has side [`[$a]x`]. Find the area diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring170.pg index cf3853a8d5..77d4b485a6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring170.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring170.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # x^2 + (a+b) x + ab # @@ -11,20 +11,16 @@ # # a,b are non-zero, integer on the interval [1,10]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## MTL(basic_trinomial_factoring) -## MTLleader(1) -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('polynomial','exponents','factoring','trinomial') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +31,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -45,14 +44,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = random(1,10,1); @@ -60,24 +57,26 @@ $b = $a; $b = random(1,10,1)while(abs($a)==abs($b)); $question = Formula("$var^2+($a+$b)$var+$a*$b")->reduce; $ans = Formula("($var+$a)*($var+$b)")->reduce; + +$output = factoringMethods(1,$a,1,$b,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML +############################################## + BEGIN_PGML_SOLUTION -We look for factors of [`[$a*$b]`] that give [`[$a+$b]`] when added; the -factors that work are [`[$a]`] and [`[$b]`] so - [`[$question]=[$ans]`] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring175.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring175.pg index de48f12c91..58ff514a8c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring175.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring175.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # x^2 + (a+b) x + ab # @@ -12,19 +12,16 @@ # a,b are integer on the interval [1,10]; one # of a or b is negative. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## MTL(basic_trinomial_factoring) -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('polynomial','exponents','factoring','trinomial') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +32,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -45,13 +45,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term @@ -60,24 +59,26 @@ $b = $a; $b = random(1,10,1)*abs($a)/$a*-1 while(abs($a)==abs($b)); $question = Formula("$var^2+($a+$b)$var+$a*$b")->reduce; $ans = Formula("($var+$a)*($var+$b)")->reduce; + +$output = factoringMethods(1,$a,1,$b,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML +############################################## + BEGIN_PGML_SOLUTION -We look for factors of [`[$a*$b]`] that give [`[$a+$b]`] when added; the -factors that work are [`[$a]`] and [`[$b]`] so - [`[$question]=[$ans]`] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring180.pg index 915f38d508..727bdb9d7e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring180.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring180.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # x^2 + (a+b) x + ab # @@ -11,19 +11,16 @@ # # a,b are integer on the interval [-10,-1]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## MTL(basic_trinomial_factoring) -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('polynomial','exponents','factoring','trinomial') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,7 +31,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -44,13 +44,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term @@ -59,24 +58,26 @@ $b = $a; $b = random(1,10,1)*-1 while(abs($a)==abs($b)); $question = Formula("$var^2+($a+$b)$var+$a*$b")->reduce; $ans = Formula("($var+$a)*($var+$b)")->reduce; + +$output = factoringMethods(1,$a,1,$b,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML +############################################## + BEGIN_PGML_SOLUTION -We look for factors of [`[$a*$b]`] that give [`[$a+$b]`] when added; the -factors that work are [`[$a]`] and [`[$b]`] so - [`[$question]=[$ans]`] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring185.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring185.pg index be3fc35463..93d096748e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring185.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring185.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x + bc # @@ -16,19 +16,16 @@ # # b, c are non-zero, integer on the interval [1,10]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_nonzero_leading_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,7 +36,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -49,14 +49,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -79,50 +77,25 @@ $ans = Formula("($a*$var+$b)*($var+$c)")->reduce; $group1 = $a*$c; $group2 = $b; + +$output = factoringMethods($a,$b,1,$c,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is _prime_ -* the middle term's coefficient and the last term are _positive_ which means that the factorization -will have the form - - [`([$a][$var]+\phantom{3})([$var]+\phantom{3})`] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -#### Alternative Approach using the "AC" method: - -To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multipling [`A`] and [`C`] together. Here, - - [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] - -Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$group1]`] and [`[$group2]`] work. Now we use these to separate the middle term into two parts. - - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\end{aligned}`] - -If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. +############################################## - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\\ -&=[$a][$var]([$var]+[$c])+[$b]([$var]+[$c])\\ -&=[$ans] -\end{aligned}`] +BEGIN_PGML_SOLUTION +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring186.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring186.pg new file mode 100644 index 0000000000..3f0080f2be --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring186.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# a x^2y^2 + (b+ac) xy + bc +# +# The answer is +# +# (a xy + b)( xy + c) +# +# We make sure that gcd(a,b)=1 +# +# We choose a integer on {2,3,5} +# +# b, c are non-zero, integer on the interval [1,10]. +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + +# the common term +$a = 1; +$b = 100; +$c = 1; +# this next condition ensures the numbers don't get too big +while(abs($b+$a*$c)+abs($b*$c)>40) +{ + $a = list_random(2,3,5); + $b = $a; + $b = random(1,10,1)while(gcd($a,$b)!=1); + $c = random(1,10,1); +} + +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$leading*$var1^2*$var2^2+$middle*$var1*$var2+$end")->reduce; +$ans = Formula("($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; + +$group1 = $a*$c; +$group2 = $b; + +$output = factoringMethods($a,$b,1,$c,$var1.$var2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring190.pg index 3b82bcf4b2..0ff800953d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring190.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring190.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x + bc # @@ -18,19 +18,16 @@ # # One of b or c is negative. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_nonzero_leading_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -41,9 +38,13 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); + ############################################## Context("LimitedFactor"); @@ -51,14 +52,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -83,50 +82,24 @@ $ans = Formula("($a*$var+$b)*($var+$c)")->reduce; $group1 = $a*$c; $group2 = $b; +$output = factoringMethods($a,$b,1,$c,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is _prime_ -* the last term is _negative which means that the factorization will -have one of the following forms_ - - [`([$a][$var]-\phantom{3})([$var]+\phantom{3})\qquad ([$a][$var]+\phantom{3})([$var]-\phantom{3})`] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -#### Alternative Approach using the "AC" method: - -To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multipling [`A`] and [`C`] together. Here, - - [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] - -Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$group1]`] and [`[$group2]`] work. Now we use these to separate the middle term into two parts. - - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\end{aligned}`] - -If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. +############################################## - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\\ -&=[$a][$var]([$var]+[$c])+[$b]([$var]+[$c])\\ -&=[$ans] -\end{aligned}`] +BEGIN_PGML_SOLUTION +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring191.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring191.pg new file mode 100644 index 0000000000..eafe5743da --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring191.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# a x^2 + (b+ac) x + bc +# +# The answer is +# +# (a x + b)( x + c) +# +# We make sure that gcd(a,b)=1 +# +# We choose a integer on {2,3,5} +# +# b, c are non-zero, integer on the interval [1,10]. +# +# One of b or c is negative. +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + +# the common term +$a = 1; +$b = 100; +$c = 1; +# this next condition ensures the numbers don't get too big +while(abs($b+$a*$c)+abs($b*$c)>40) +{ + $a = list_random(2,3,5); + $b = $a; + $b = random(1,10,1)*random(-1,1,2) while(gcd($a,$b)!=1); + $c = random(1,10,1)*abs($b)/$b*-1; +} + +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$leading*$var1^2*$var2^2+$middle*$var1*$var2+$end")->reduce; +$ans = Formula("($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; + + +$group1 = $a*$c; +$group2 = $b; + +$output = factoringMethods($a,$b,1,$c,$var1.$var2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring195.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring195.pg index 76fb68e6e4..218aebac65 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring195.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring195.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x + bc # @@ -16,19 +16,16 @@ # # b, c are non-zero, integer on the interval [-10,-1]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_nonzero_leading_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,7 +36,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -49,14 +49,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -80,50 +78,27 @@ $ans = Formula("($a*$var+$b)*($var+$c)")->reduce; $group1 = $a*$c; $group2 = $b; +$output = factoringMethods($a,$b,1,$c,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is _prime_ -* the middle term's coefficient is _negative _and last term is _positive_ which means that the factorization -will have the form - - [`([$a][$var]-\phantom{3})([$var]-\phantom{3})`] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -#### Alternative Approach using the "AC" method: - -To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multipling [`A`] and [`C`] together. Here, - - [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] - -Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$group1]`] and [`[$group2]`] work. Now we use these to separate the middle term into two parts. +############################################## - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\end{aligned}`] +BEGIN_PGML_SOLUTION -If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. +[$output]*** - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\\ -&=[$a][$var]([$var]+[$c])+[$b]([$var]+[$c])\\ -&=[$ans] -\end{aligned}`] END_PGML_SOLUTION + ############################################## ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring196.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring196.pg new file mode 100644 index 0000000000..aee1424ea8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring196.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# a x^2y^2 + (b+ac) xy + bc +# +# The answer is +# +# (a xy + b)( xy + c) +# +# We make sure that gcd(a,b)=1 +# +# We choose a integer on {2,3,5} +# +# b, c are non-zero, integer on the interval [-10,-1]. +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + +# the common term +$a = 1; +$b = 100; +$c = 1; +# this next condition ensures the numbers don't get too big +while(abs($b+$a*$c)+abs($b*$c)>40) +{ + $a = list_random(2,3,5); + $b = $a; + $b = random(-10,-1,1)while(gcd($a,$b)!=1); + $c = random(-10,-1,1); +} + +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$leading*$var1^2*$var2^2+$middle*$var1*$var2+$end")->reduce; +$ans = Formula("($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; + +$group1 = $a*$c; +$group2 = $b; + +$output = factoringMethods($a,$b,1,$c,$var1.$var2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring20.pg index e93a8c05f2..7857e02ac6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring20.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Find the greatest common factor of the following two terms +# Find the greatest common factor of the following terms. # # a*bx^m, a*x^n # @@ -18,15 +18,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(find_gcf) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +36,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "parserOneOf.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -88,7 +85,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the greatest common factor of the following two terms +Find the greatest common factor of the following terms. [`[$poly1]`] and [`[$poly2]`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring200.pg index 0b1ace1288..d8be5d33ce 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring200.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring200.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x + bc # @@ -13,15 +13,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_nonzero_leading_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -31,9 +28,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "answerHints.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", +"answerHints.pl", + "PGcourse.pl", ); ############################################## @@ -59,7 +56,7 @@ $a = 1; $b = 3; $c = 1; # this next condition ensures the numbers don't get too big -while(($b**2-4*$a*$c)>=0 or (abs($b)+abs($c))>40) +while(($b**2-4*$a*$c)>=0 or (abs($b)+abs($c))>40 or gcd(gcd($a,$b),$c)!=1) { $a = list_random(2,3,5); $b = random(-10,10,1); @@ -79,26 +76,55 @@ $group2 = $b; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________] -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML + +############################################## + ANS($ans->cmp(typeMatch=>$question)->withPostFilter(AnswerHints( $question => "Are you trying to say that the polynomial is *prime*?" ))); +$ac = $a*$c; + $sqac = int(sqrt(abs($ac))); + $factorPairsOutput = '\['; + $counter = 1; + for my $i (1..$sqac) { + my $j = $ac/$i; + if ($counter==4) {$factorPairsOutput .= '\]\['; $counter=1;} + if ($j == int($j)) { + $factorPairsOutput .= $i.'('.$j.'),'.-$i.'('.-$j.'),'; + $counter++; + } + }; + if ((substr $factorPairsOutput, -1) eq '[') { + $factorPairsOutput = substr($factorPairsOutput,0,length($factorPairsOutput)-5); + } else { + $factorPairsOutput = substr($factorPairsOutput,0,length($factorPairsOutput)-1); + } + $factorPairsOutput .= '\]'; + +############################################## + BEGIN_PGML_SOLUTION To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multipling [`A`] and [`C`] together. Here, [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] -Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that this is not possible! +Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. + +The number [`[$ac]`] can be factored into the product of two numbers in the following ways: + + [$factorPairsOutput]* + +Since no pair's sum is [`[$b]`], we conclude that this polynomial is *prime*. -There is no way to factor this polynomial so we conclude that this polynomial is *prime*. END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring205.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring205.pg index a89d50d4c7..75d3bdb91d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring205.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring205.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x + bc # @@ -22,19 +22,16 @@ # # b, c are non-zero, integer on the interval [1,10]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_nonzero_leading_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -45,7 +42,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -55,14 +55,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -86,54 +84,25 @@ $ans = Formula("($a*$var+$b)*($var+$c)")->reduce; $group1 = $a*$c; $group2 = $b; +$output = factoringMethods($a,$b,1,$c,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the middle term's coefficient and the last term are _positive_ which means that the factorization -could have any of the following forms - - [` - \begin{aligned} - ([$a][$var]+\phantom{3})([$var]+\phantom{3})&\\ - ([$a/2][$var]+\phantom{3})(2[$var]+\phantom{3})& - \end{aligned} - `] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -#### Alternative Approach using the "AC" method: - -To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multipling [`A`] and [`C`] together. Here, - - [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] - -Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$group1]`] and [`[$group2]`] work. Now we use these to separate the middle term into two parts. +############################################## - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\end{aligned}`] +BEGIN_PGML_SOLUTION -If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. +[$output]*** - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\\ -&=[$a][$var]([$var]+[$c])+[$b]([$var]+[$c])\\ -&=[$ans] -\end{aligned}`] END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring210.pg index 6e6f05719b..d0434ffee7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring210.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring210.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x + bc # @@ -27,19 +27,16 @@ # (3x+ )(2x- ) # (4x+ )(2x- ) # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_nonzero_leading_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -50,9 +47,11 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); - ############################################## Context("LimitedFactor"); @@ -60,13 +59,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term @@ -91,56 +89,25 @@ $ans = Formula("($a*$var+$b)*($var+$c)")->reduce; $group1 = $a*$c; $group2 = $b; +$output = factoringMethods($a,$b,1,$c,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the last term is _negative_ which means that the factorization -could have any of the following forms - - [` - \begin{aligned} - ([$a][$var]+\phantom{3})([$var]-\phantom{3})&\\ - ([$a/2][$var]+\phantom{3})(2[$var]-\phantom{3})&\\ - ([$a][$var]-\phantom{3})([$var]+\phantom{3})&\\ - ([$a/2][$var]-\phantom{3})(2[$var]+\phantom{3})& - \end{aligned} - `] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -#### Alternative Approach using the "AC" method: - -To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multipling [`A`] and [`C`] together. Here, - - [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] - -Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$group1]`] and [`[$group2]`] work. Now we use these to separate the middle term into two parts. +############################################## - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\end{aligned}`] +BEGIN_PGML_SOLUTION -If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. +[$output]*** - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\\ -&=[$a][$var]([$var]+[$c])+[$b]([$var]+[$c])\\ -&=[$ans] -\end{aligned}`] END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring215.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring215.pg index 03680aa4c2..a4600bc7c3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring215.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring215.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x + bc # @@ -22,19 +22,16 @@ # # b, c are non-zero, integer on the interval [-10,-1]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_nonzero_leading_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -45,7 +42,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -55,13 +55,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term @@ -86,54 +85,25 @@ $ans = Formula("($a*$var+$b)*($var+$c)")->reduce; $group1 = $a*$c; $group2 = $b; +$output = factoringMethods($a,$b,1,$c,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the middle term's coefficient is _negative _and the last term is _positive_ -which means that the factorization could have any of the following forms - - [` - \begin{aligned} - ([$a][$var]-\phantom{3})([$var]-\phantom{3})&\\ - ([$a/2][$var]-\phantom{3})(2[$var]-\phantom{3})& - \end{aligned} - `] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -#### Alternative Approach using the "AC" method: - -To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multipling [`A`] and [`C`] together. Here, - - [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] - -Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$group1]`] and [`[$group2]`] work. Now we use these to separate the middle term into two parts. +############################################## - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\end{aligned}`] +BEGIN_PGML_SOLUTION -If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. +[$output]*** - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$group1][$var]+[$group2][$var]+[$end]\\ -&=[$a][$var]([$var]+[$c])+[$b]([$var]+[$c])\\ -&=[$ans] -\end{aligned}`] END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring220.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring220.pg index 1d3a30abb6..35410e10e8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring220.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring220.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -15,19 +15,16 @@ # a, c are integer on [2,5] # b, d are non-zero, integer on the interval [1,10]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_nonzero_leading_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -38,7 +35,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -48,14 +48,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -78,60 +76,25 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var^2+$middle*$var+$end")->reduce; $ans = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -if(2*round($a*$c/2)==$a*$c and $a!=2 and $c!=2) -{ - $c1 = $a*$c/2; - $ifevenstep = "($c1$var+\phantom{3})(2$var+\phantom{3})"; -} -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the middle term's coefficient and the last term are _positive_ which means that the factorization -could have the following form - - [` - \begin{aligned} - ([$leading][$var]+\phantom{3})([$var]+\phantom{3})&\\ - ([$a][$var]+\phantom{3})([$c][$var]+\phantom{3})&\\ - [$ifevenstep] - \end{aligned} - `] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$d]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -#### Alternative Approach using the "AC" method: - -To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multiplying [`A`] and [`C`] together. Here, - - [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] - -Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$a*$d]`] and [`[$b*$c]`] work. Now we use these to separate the middle term into two parts. - - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$a*$d][$var]+[$b*$c][$var]+[$end]\end{aligned}`] +############################################## -If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. +BEGIN_PGML_SOLUTION - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$a*$d][$var]+[$b*$c][$var]+[$end]\\ -&=[$a][$var]([$c][$var]+[$d])+[$b]([$c][$var]+[$d])\\ -&=[$ans] -\end{aligned}`] +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring225.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring225.pg index 4b01e21fef..2026ad302d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring225.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring225.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -15,19 +15,16 @@ # a, c are integer on [2,5] # b, d are non-zero, integer on the interval [1,10]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_nonzero_leading_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -38,7 +35,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -48,14 +48,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -78,62 +76,25 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var^2+$middle*$var+$end")->reduce; $ans = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -if(2*round($a*$c/2)==$a*$c and $a!=2 and $c!=2) -{ - $c1 = $a*$c/2; - $ifevenstep = "($c1$var-\phantom{3})(2$var+\phantom{3})&\\ ($c1$var+\phantom{3})(2$var-\phantom{3})"; -} -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the last term is _negative_ which means that the factorization -could have the following form - - [` - \begin{aligned} - ([$leading][$var]-\phantom{3})([$var]+\phantom{3})&\\ - ([$leading][$var]+\phantom{3})([$var]-\phantom{3})&\\ - ([$a][$var]-\phantom{3})([$c][$var]+\phantom{3})&\\ - ([$a][$var]+\phantom{3})([$c][$var]-\phantom{3})&\\ - [$ifevenstep] - \end{aligned} - `] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$d]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -#### Alternative Approach using the "AC" method: - -To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multiplying [`A`] and [`C`] together. Here, - - [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] - -Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$a*$d]`] and [`[$b*$c]`] work. Now we use these to separate the middle term into two parts. - - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$a*$d][$var]+[$b*$c][$var]+[$end]\end{aligned}`] +############################################## -If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. +BEGIN_PGML_SOLUTION - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$a*$d][$var]+[$b*$c][$var]+[$end]\\ -&=[$a][$var]([$c][$var]+[$d])+[$b]([$c][$var]+[$d])\\ -&=[$ans] -\end{aligned}`] +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring230.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring230.pg index 9d82640036..9344ce2faf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring230.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring230.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -15,19 +15,16 @@ # a, c are integer on [2,5] # b, d are non-zero, integer on the interval [-10,-1]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_nonzero_leading_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -38,7 +35,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -48,14 +48,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -78,60 +76,25 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var^2+$middle*$var+$end")->reduce; $ans = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -if(2*round($a*$c/2)==$a*$c and $a!=2 and $c!=2) -{ - $c1 = $a*$c/2; - $ifevenstep = "($c1$var-\phantom{3})(2$var-\phantom{3})"; -} -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the middle term's coefficient is _negative _and the last term is _positive_ -which means that the factorization could have the following form - - [` - \begin{aligned} - ([$leading][$var]-\phantom{3})([$var]-\phantom{3})&\\ - ([$a][$var]-\phantom{3})([$c][$var]-\phantom{3})&\\ - [$ifevenstep] - \end{aligned} - `] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$d]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -#### Alternative Approach using the "AC" method: - -To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multiplying [`A`] and [`C`] together. Here, - - [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] - -Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$a*$d]`] and [`[$b*$c]`] work. Now we use these to separate the middle term into two parts. - - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$a*$d][$var]+[$b*$c][$var]+[$end]\end{aligned}`] +############################################## -If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. +BEGIN_PGML_SOLUTION - [`\begin{aligned}[$question] &= [$leading][$var]^2+[$a*$d][$var]+[$b*$c][$var]+[$end]\\ -&=[$a][$var]([$c][$var]+[$d])+[$b]([$c][$var]+[$d])\\ -&=[$ans] -\end{aligned}`] +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring235.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring235.pg index 4392d01144..50f9cf76c8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring235.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring235.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x y + bc y^2 # @@ -16,20 +16,16 @@ # # b, c are non-zero, integer on the interval [1,10]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_nonzero_lead_coef) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,26 +36,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -79,33 +75,28 @@ $middle = $b+$a*$c; $end = $b*$c; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is _prime_ -* the middle term's coefficient and the last term's coefficient are _positive_ which means that the factorization -will have the form - - [`([$a][$var1]+\mathbf{?}[$var2])([$var1]+\mathbf{?}[$var2])`] +############################################## -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so +BEGIN_PGML_SOLUTION - [`[$question]=[$ans]`] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION + ############################################## ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring240.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring240.pg index 6620c2822a..fcd97b7ce0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring240.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring240.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x y + bc y^2 # @@ -18,19 +18,16 @@ # # One of b or c is negative. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_nonzero_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -41,26 +38,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -80,32 +77,26 @@ $middle = $b+$a*$c; $end = $b*$c; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is _prime_ -* the last term's coefficient is _negative_ which means that the factorization will -have one of the following forms - - [`([$a][$var1]-\mathbf{?}[$var2])([$var1]+\mathbf{?}[$var2]), ([$a][$var1]+\mathbf{?}[$var2])([$var1]-\mathbf{?}[$var2])`] +############################################## -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so +BEGIN_PGML_SOLUTION - [`[$question]=[$ans]`] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring245.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring245.pg index 1d7f34b8ce..d40586fc92 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring245.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring245.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x y + bc y^2 # @@ -16,19 +16,16 @@ # # b, c are non-zero, integer on the interval [-10,-1]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_nonzero_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,26 +36,27 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); + ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'x'; -$var2 = 'y'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -78,33 +76,28 @@ $middle = $b+$a*$c; $end = $b*$c; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is _prime_ -* the middle term's coefficient is _negative _and last term's coefficient is _positive_ which means that the factorization -will have the form - - [`([$a][$var1]-\mathbf{?}[$var2])([$var1]-\mathbf{?}[$var2])`] +############################################## -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so +BEGIN_PGML_SOLUTION - [`[$question]=[$ans]`] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION + ############################################## ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring25.pg index cf9bcc8ecc..8f906863f2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring25.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring25.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Find the greatest common factor of the following two terms +# Find the greatest common factor of the following terms. # # a*bx^m, a*x^n, a*cx^p # @@ -20,15 +20,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(find_gcf) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -41,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "parserOneOf.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -99,7 +96,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the greatest common factor of the following three terms +Find the greatest common factor of the following terms. [`[$poly1]`], [`[$poly2]`], [`[$poly3]`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring250.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring250.pg index 4c3839280e..e4ad04b4de 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring250.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring250.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x y + bc y^2 # @@ -22,20 +22,16 @@ # # b, c are non-zero, integer on the interval [1,10]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_composite_lead_coef) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -46,26 +42,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -85,38 +81,28 @@ $middle = $b+$a*$c; $end = $b*$c; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the middle term's coefficient and the last term are _positive_ which means that the factorization -could have any of the following forms - - [` - \begin{aligned} - ([$a][$var1]+\mathbf{?}[$var2])([$var1]+\mathbf{?}[$var2])&\\ - ([$a/2][$var1]+\mathbf{?}[$var2])(2[$var1]+\mathbf{?}[$var2])& - \end{aligned} - `] +############################################## -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so +BEGIN_PGML_SOLUTION - [`[$question]=[$ans]`] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION + ############################################## ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring255.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring255.pg index cf88759bf5..0f047a01ad 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring255.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring255.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x y + bc y^2 # @@ -27,19 +27,16 @@ # (3x+ )(2x- ) # (4x+ )(2x- ) # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_composite_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -50,26 +47,27 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); + ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -89,39 +87,26 @@ $middle = $b+$a*$c; $end = $b*$c; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML +############################################## + BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the last term is _negative_ which means that the factorization -could have any of the following forms - - [` - \begin{aligned} - ([$a][$var1]+\mathbf{?}[$var2])([$var1]-\mathbf{?}[$var2])&\\ - ([$a/2][$var1]+\mathbf{?}[$var2])(2[$var1]-\mathbf{?}[$var2])&\\ - ([$a][$var1]-\mathbf{?}[$var2])([$var1]+\mathbf{?}[$var2])&\\ - ([$a/2][$var1]-\mathbf{?}[$var2])(2[$var1]+\mathbf{?}[$var2])& - \end{aligned} - `] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). + +[$output]*** + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring260.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring260.pg index 77ba595947..dbc0df47ce 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring260.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring260.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x y + bc y^2 # @@ -22,19 +22,16 @@ # # b, c are non-zero, integer on the interval [-10,-1]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_composite_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -45,26 +42,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'x'; -$var2 = 'y'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -84,37 +81,26 @@ $middle = $b+$a*$c; $end = $b*$c; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the middle term's coefficient is _negative _and the last term is _positive_ -which means that the factorization could have any of the following forms - - [` - \begin{aligned} - ([$a][$var1]-\mathbf{?}[$var2])([$var1]-\mathbf{?}[$var2])&\\ - ([$a/2][$var1]-\mathbf{?}[$var2])(2[$var1]-\mathbf{?}[$var2])& - \end{aligned} - `] +############################################## -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$c]`] so +BEGIN_PGML_SOLUTION - [`[$question]=[$ans]`] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring265.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring265.pg index f2594cbdf8..2e621fa694 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring265.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring265.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x y + bd y^2 # @@ -15,19 +15,16 @@ # a, c are integer on [2,5] # b, d are non-zero, integer on the interval [1,10]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_composite_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -38,26 +35,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -80,44 +77,28 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($c*$var1+$d$var2)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -if(2*round($a*$c/2)==$a*$c and $a!=2 and $c!=2) -{ - $c1 = $a*$c/2; - $ifevenstep = "($c1$var1+\mathbf{?}[$var2])(2$var1+\mathbf{?}[$var2])"; -} +############################################## + BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the middle term's coefficient and the last term are _positive_ which means that the factorization -could have the following form - - [` - \begin{aligned} - ([$leading][$var1]+\mathbf{?}[$var2])([$var1]+\mathbf{?}[$var2])&\\ - ([$a][$var1]+\mathbf{?}[$var2])([$c][$var1]+\mathbf{?}[$var2])&\\ - [$ifevenstep] - \end{aligned} - `] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$d]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). + +[$output]*** + END_PGML_SOLUTION + ############################################## ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring270.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring270.pg index 93e4821127..7693b85392 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring270.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring270.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x y + bd y^2 # @@ -15,19 +15,16 @@ # a, c are integer on [2,5] # b, d are non-zero, integer on the interval [1,10]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_composite_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -38,26 +35,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'x'; -$var2 = 'y'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -80,46 +77,28 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($c*$var1+$d$var2)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -if(2*round($a*$c/2)==$a*$c and $a!=2 and $c!=2) -{ - $c1 = $a*$c/2; - $ifevenstep = "($c1$var1-\mathbf{?}[$var2])(2$var1+\mathbf{?}[$var2])&\\ ($c1$var1+\mathbf{?}[$var2])(2$var1-\mathbf{?}[$var2])"; -} +############################################## + BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the last term is _negative_ which means that the factorization -could have the following form - - [` - \begin{aligned} - ([$leading][$var1]-\mathbf{?}[$var2])([$var1]+\mathbf{?}[$var2])&\\ - ([$leading][$var1]+\mathbf{?}[$var2])([$var1]-\mathbf{?}[$var2])&\\ - ([$a][$var1]-\mathbf{?}[$var2])([$c][$var1]+\mathbf{?}[$var2])&\\ - ([$a][$var1]+\mathbf{?}[$var2])([$c][$var1]-\mathbf{?}[$var2])&\\ - [$ifevenstep] - \end{aligned} - `] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$d]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). + +[$output]*** + END_PGML_SOLUTION + ############################################## ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring275.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring275.pg index 7f3792989a..0726edff35 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring275.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring275.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x y + bd y^2 # @@ -15,19 +15,16 @@ # a, c are integer on [2,5] # b, d are non-zero, integer on the interval [-10,-1]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_composite_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -38,26 +35,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -80,43 +77,26 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($c*$var1+$d$var2)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -if(2*round($a*$c/2)==$a*$c and $a!=2 and $c!=2) -{ - $c1 = $a*$c/2; - $ifevenstep = "($c1$var1-\mathbf{?}[$var2])(2$var1-\mathbf{?}[$var2])"; -} +############################################## + BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [`[$leading]`] which is *not* prime -* the middle term's coefficient is _negative _and the last term is _positive_ -which means that the factorization could have the following form - - [` - \begin{aligned} - ([$leading][$var1]-\mathbf{?}[$var2])([$var1]-\mathbf{?}[$var2])&\\ - ([$a][$var1]-\mathbf{?}[$var2])([$c][$var1]-\mathbf{?}[$var2])&\\ - [$ifevenstep] - \end{aligned} - `] - -We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with -the factors of [`[$leading]`] in the correct way; the -factors that work are [`[$b]`] and [`[$d]`] so - - [`[$question]=[$ans]`] - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). + +[$output]*** + END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring280.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring280.pg index 1ccbaed103..221512338d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring280.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring280.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 + d (b+ac) x + d bc # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_composite_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,8 +36,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -83,11 +80,11 @@ $ans = Formula("$d*($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring281.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring281.pg new file mode 100644 index 0000000000..d3dc344386 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring281.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# d a x^2y^2 + d (b+ac) xy + d bc +# +# The answer is +# +# d(a xy + b)( xy + c) +# +# We make sure that gcd(a,b)=1 +# +# We choose a integer on {2,3,5} +# +# b, c are non-zero, integer on the interval [1,10]. +# d is integer on [2,10], but we make sure the numbers aren't too big. +# +# Last updated: Hughes, 8/16/13 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + + + + + +# the common term +$a = 1; +$b = 100; +$c = 1; +$d = 1; +# this next condition ensures the numbers don't get too big +while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) +{ + $a = list_random(2,3,5); + $b = $a; + $b = random(1,10,1)while(gcd($a,$b)!=1); + $c = random(1,10,1); + $d = random(2,10,1); +} + +$leading = $a; +$middle = ($b+$a*$c); +$end = $b*$c; +$question = Formula("$d*$leading*$var1^2*$var2^2+$d*$middle*$var1*$var2+$d*$end")->reduce; +$ans = Formula("$d*($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +$step1 = Formula("$d($leading*$var1^2*$var2^2+$middle*$var1*$var2+$end)")->reduce; +BEGIN_PGML_SOLUTION +Let's start by noting that [`[$d]`] is a common factor to each term, so +we may write + + [`[$question]=[$step1]`] + +To factor this expression further we make the following observations: +* the leading coefficient is [`[$leading]`] which is _prime_ +* the middle term's coefficient and the last term are _positive_ which means that the factorization +will have the form + + [`([$a][$var1][$var2]+\phantom{3})([$var1][$var2]+\phantom{3})`] + +We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with +the [`[$leading]`] in the correct way; the +factors that work are [`[$b]`] and [`[$c]`] so + + [`[$question]=[$ans]`] + +Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). + +#### Alternative Approach using the "AC" method: + +When factoring, we should always check to see if there is a greatest common factor to factor out first. Here, [`[$d]`] is such a factor, and we have + + [`[$question]=[$step1]`] + +Now we try to further factor the trinomial. To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multiplying [`A`] and [`C`] together. Here, + + [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] + +Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$a*$c]`] and [`[$b]`] work. Now we use these to separate the middle term into two parts. + + [`\begin{aligned}[$question] &= [$step1]\\ +&=[$d]([$leading][$var1]^2[$var2]^2+[$a*$c][$var1][$var2]+[$b][$var1][$var2]+[$end])\end{aligned}`] + +If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. + + [`\begin{aligned}[$question] &= [$step1]\\ +&=[$d]([$leading][$var1]^2[$var2]^2+[$a*$c][$var1][$var2]+[$b][$var1][$var2]+[$end])\\ +&=[$d]([$a][$var1][$var2]([$var1][$var2]+[$c])+[$b]([$var1][$var2]+[$c]))\\ +&=[$ans] +\end{aligned}`] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring285.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring285.pg index 62dc5617f3..99bf749637 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring285.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring285.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 + d (b+ac) x + d bc # @@ -23,15 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_composite_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -41,8 +38,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -85,11 +82,11 @@ $ans = Formula("$d($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring286.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring286.pg new file mode 100644 index 0000000000..2e1e219742 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring286.pg @@ -0,0 +1,142 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# d a x^2y^2 + d (b+ac) xy + d bc +# +# The answer is +# +# d(a xy + b)( x y+ c) +# +# We make sure that gcd(a,b)=1 +# +# We choose a integer on {2,3,5} +# +# b, c are non-zero, integer on the interval [1,10]. +# d is integer on [2,10], but we make sure the numbers aren't too big. +# +# One of b or c is negative. +# +# Last updated: Hughes, 8/16/13 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + + + + + +# the common term +$a = 1; +$b = 100; +$c = 1; +$d = 1; +# this next condition ensures the numbers don't get too big +while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) +{ + $a = list_random(2,3,5); + $b = $a; + $b = random(1,10,1)*random(-1,1,2) while(gcd($a,$b)!=1); + $c = random(1,10,1)*abs($b)/$b*-1; + $d = random(2,10,1); +} + +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$d*$leading*$var1^2*$var2^2+$d*$middle*$var1*$var2+$d*$end")->reduce; +$ans = Formula("$d($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +$step1 = Formula("$d($leading*$var1^2*$var2^2+$middle*$var1*$var2+$end)")->reduce; +BEGIN_PGML_SOLUTION +Let's start by noting that [`[$d]`] is a common factor to each term, so +we may write + + [`[$question]=[$step1]`] + +To factor this expression further we make the following observations: +* the leading coefficient is [`[$leading]`] which is _prime_ +* the last term is _negative which means that the factorization will +have one of the following forms_ + + [`([$a][$var1][$var2]-\phantom{3})([$var1][$var2]+\phantom{3})\qquad ([$a][$var1][$var2]+\phantom{3})([$var1][$var2]-\phantom{3})`] + +We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with +the [`[$leading]`] in the correct way; the +factors that work are [`[$b]`] and [`[$c]`] so + + [`[$question]=[$ans]`] + +Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). + +#### Alternative Approach using the "AC" method: + +When factoring, we should always check to see if there is a greatest common factor to factor out first. Here, [`[$d]`] is such a factor, and we have + + [`[$question]=[$step1]`] + +Now we try to further factor the trinomial. To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multiplying [`A`] and [`C`] together. Here, + + [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] + +Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$a*$c]`] and [`[$b]`] work. Now we use these to separate the middle term into two parts. + + [`\begin{aligned}[$question] &= [$step1]\\ +&=[$d]([$leading][$var1]^2[$var2]^2+[$a*$c][$var1][$var2]+[$b][$var1][$var2]+[$end])\end{aligned}`] + +If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. + + [`\begin{aligned}[$question] &= [$step1]\\ +&=[$d]([$leading][$var1]^2[$var2]^2+[$a*$c][$var1][$var2]+[$b][$var1][$var2]+[$end])\\ +&=[$d]([$a][$var1][$var2]([$var1][$var2]+[$c])+[$b]([$var1][$var2]+[$c]))\\ +&=[$ans] +\end{aligned}`] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring290.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring290.pg index 63a5072f53..c4e5124988 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring290.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring290.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 + d (b+ac) x + d bc # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_composite_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,8 +36,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -83,11 +80,11 @@ $ans = Formula("$d*($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring295.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring295.pg index aa1614f352..e61e7bb61d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring295.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring295.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^(2+n) + d (b+ac) x^(n+1) + d bc x^n # @@ -23,16 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_factor_variable_out) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -42,8 +38,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -87,11 +83,11 @@ $ans = Formula("$d*$var^$n($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d$var^$n($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring30.pg index 0c0aa3a072..bbc0af572c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring30.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Find the greatest common factor of the following two terms +# Find the greatest common factor of the following terms. # # a*b x^m y^q, a*x^n y^r, a*c x^p y^s # @@ -24,15 +24,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(find_gcf) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -45,7 +42,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "parserOneOf.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -96,7 +93,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the greatest common factor of the following three terms +Find the greatest common factor of the following terms. [`[$poly1]`], [`[$poly2]`], [`[$poly3]`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring300.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring300.pg index f8f77e7151..6dadf21699 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring300.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring300.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^(2+n) + d (b+ac) x^(n+1) + d bc x^n # @@ -23,15 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_factor_variable_out) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -41,8 +38,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -86,11 +83,11 @@ $ans = Formula("$d*$var^$n($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d$var^$n($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring305.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring305.pg index 671448ddc4..959ce95246 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring305.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring305.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^(2+n) + d (b+ac) x^(n+1) + d bc x^n # @@ -23,15 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_factor_variable_out) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -41,8 +38,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -86,11 +83,11 @@ $ans = Formula("$d*$var^$n($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d$var^$n($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring306.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring306.pg new file mode 100644 index 0000000000..3c4ba8f913 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring306.pg @@ -0,0 +1,142 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# d a x^(2+n)y^2 + d (b+ac) x^(n+1)y + d bc x^n +# +# The answer is +# +# d x^n (a xy + b)( xy + c) +# +# We make sure that gcd(a,b)=1 +# +# We choose a integer on {2,3,5} +# +# b, c are non-zero, integer on the interval [-10,-1]. +# d is integer on [2,10], but we make sure the numbers aren't too big. +# +# n is the exponent, and is integer on [2,8] +# +# Last updated: Hughes, 8/16/13 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + + + + + +# the common term +$a = 1; +$b = 100; +$c = 1; +$d = 1; +# this next condition ensures the numbers don't get too big +while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) +{ + $a = list_random(2,3,5); + $b = $a; + $b = random(-10,-1,1)while(gcd($a,$b)!=1); + $c = random(-10,-1,1); + $d = random(2,10,1); +} + +$n = random(2,8,1); +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$d*$leading*$var1^(2+$n)*$var2^2+$d*$middle*$var1^($n+1)*$var2+$d*$end$var1^$n")->reduce; +$ans = Formula("$d*$var1^$n($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +$step1 = Formula("$d$var1^$n($leading*$var1^2*$var2^2+$middle*$var1*$var2+$end)")->reduce; +BEGIN_PGML_SOLUTION +Let's start by noting that [`[$d][$var1]^{[$n]}`] is a common factor to each term, so +we may write + + [`[$question]=[$step1]`] + +To factor this expression further we make the following observations: +* the leading coefficient is [`[$leading]`] which is _prime_ +* the middle term's coefficient is _negative _and last term is _positive_ which means that the factorization +will have the form + + [`([$a][$var1][$var2]-\phantom{3})([$var1][$var2]-\phantom{3})`] + +We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with +the [`[$leading]`] in the correct way; the +factors that work are [`[$b]`] and [`[$c]`] so + + [`[$question]=[$ans]`] + +Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). + +#### Alternative Approach using the "AC" method: + +When factoring, we should always check to see if there is a greatest common factor to factor out first. Here, [`[$d][$var1]^[$n]`] is such a factor, and we have + + [`[$question]=[$step1]`] + +Now we try to further factor the trinomial. To factor a trinomial of the form [`Ax^2+Bx+C`], we can begin by multiplying [`A`] and [`C`] together. Here, + + [`\begin{aligned}A\cdot C&=[$leading]\cdot[$end]\\&=[$leading*$end]\end{aligned}`] + +Now we search for two numbers that multiply to [`[$leading*$end]`], and add to the middle term's coefficient, [`[$middle]`]. In this case we find that [`[$a*$c]`] and [`[$b]`] work. Now we use these to separate the middle term into two parts. + + [`\begin{aligned}[$question] &= [$step1]\\ +&=[$d][$var1]^[$n]([$leading][$var1]^2[$var2]^2+[$a*$c][$var1][$var2]+[$b][$var1][$var2]+[$end])\end{aligned}`] + +If we have done these steps correctly, then it is _guaranteed_ that the factoring by grouping method will work for completing the factoring. + + [`\begin{aligned}[$question] &= [$step1]\\ +&=[$d][$var1]^[$n]([$leading][$var1]^2[$var2]^2+[$a*$c][$var1][$var2]+[$b][$var1][$var2]+[$end])\\ +&=[$d][$var1]^[$n]([$a][$var1][$var2]([$var1][$var2]+[$c])+[$b]([$var1][$var2]+[$c]))\\ +&=[$ans] +\end{aligned}`] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring310.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring310.pg index 6a02924ae5..98e3a2f902 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring310.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring310.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 + d (b+ac) x y + d bc y^2 # @@ -21,16 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_two_variables) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,8 +36,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -86,11 +82,11 @@ $ans = Formula("$d*($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d($leading*$var1^2+$middle*$var1$var2+$end$var2^2)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring315.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring315.pg index 797fd4289d..250de32a69 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring315.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring315.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 + d (b+ac) x y + d bc y^2 # @@ -23,15 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_two_variables) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -41,8 +38,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -87,11 +84,11 @@ $ans = Formula("$d($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d($leading*$var1^2+$middle*$var1$var2+$end$var2^2)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring320.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring320.pg index 7ed2f7be56..7c2dc62e8b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring320.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring320.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 + d (b+ac) x y + d bc y^2 # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_two_variables) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,8 +36,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -85,11 +82,11 @@ $ans = Formula("$d*($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d($leading*$var1^2+$middle*$var1$var2+$end$var2^2)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring325.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring325.pg index 2efa0c4a3b..cd1ba36f8c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring325.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring325.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 y + d (b+ac) x y^2 + d bc y^3 # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_two_variables) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,8 +36,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -85,11 +82,11 @@ $ans = Formula("$d*$var2*($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d$var2($leading*$var1^2+$middle*$var1$var2+$end$var2^2)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring330.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring330.pg new file mode 100644 index 0000000000..02a17cc5b2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring330.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# d a x^2(y+$e) + d (b+ac) (y+$e)x + d bc(y+$e) +# +# The answer is +# +# d($var+$e)(a x + b)( x + c) +# +# We make sure that gcd(a,b)=1 +# +# We choose a integer on {2,3,5} +# +# b, c are non-zero, integer on the interval [1,10]. +# d is integer on [2,10], but we make sure the numbers aren't too big. +# +# Last updated: Hughes, 8/17/13 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$var1 = RandomVariableName(type=>'variable'); +$var1 = 'x'; +$var2 = 'y'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + + + + + +# the common term +$a = 1; +$b = 100; +$c = 1; +$d = 1; +# this next condition ensures the numbers don't get too big +while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) +{ + $a = list_random(2,3,5); + $b = $a; + $b = random(1,10,1)while(gcd($a,$b)!=1); + $c = random(1,10,1); + $d = random(2,10,1); +} +$e=non_zero_random(-10,10,1); +$leading = $a; +$middle = ($b+$a*$c); +$end = $b*$c; +$question = Formula("$d*$leading*$var1^2($var2+$e)+$d*$middle*$var1($var2+$e)+$d*$end($var2+$e)")->reduce; +$ans = Formula("$d*($var2+$e)*($a*$var1+$b)*($var1+$c)")->reduce; +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [____________________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +$step1 = Formula("$d($var2+$e)($leading*$var1^2+$middle*$var1+$end)")->reduce; +BEGIN_PGML_SOLUTION +Let's start by noting that [`[$d]([$var2]+[$e])`] is a common factor to each term, so +we may write + + [`[$question]=[$step1]`] + +To factor this expression further we make the following observations: +* the leading coefficient is [`[$leading]`] which is _prime_ +* the middle term's coefficient and the last term are _positive_ which means that the factorization +will have the form + + [`([$a][$var1]+\phantom{3})([$var1]+\phantom{3})`] + +We look for factors of [`[$end]`] that add to [`[$middle]`] when combined with +the [`[$leading]`] in the correct way; the +factors that work are [`[$b]`] and [`[$c]`] so + + [`[$question]=[$ans]`] + +Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring335.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring335.pg index b535a2ef06..113dc9eb25 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring335.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring335.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x + bc # @@ -28,14 +28,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -45,8 +43,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -96,7 +94,7 @@ $step = Formula("($a*($var2+$d)+$b)*(($var2+$d)+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -a) Factor the given polynomial +a) Factor the given polynomial. [`[$question1]=`] [___________________]{$ans1} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring340.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring340.pg index a711d83ca7..163effd6cd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring340.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring340.pg @@ -1,18 +1,83 @@ -# This file is just a pointer to the file +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College # -# "Library/PCC/BasicAlgebra/Factoring/factoring170.pg" +# Template: +# Factor the given polynomial. # -# You may want to change your problem set to use that problem -# directly, especially if you want to make a copy of the problem -# for modification. +# x^2 + (a+b) x + ab +# +# If the expression cannot be factored +# then answer with *prime* +# +# a,b are non-zero, integer on the interval [1,10]. +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## DOCUMENT(); -includePGproblem("Library/PCC/BasicAlgebra/Factoring/factoring170.pg"); -ENDDOCUMENT(); -## These tags keep this problem from being added to the NPL database -## -## DBsubject('ZZZ-Inserted Text') -## DBchapter('ZZZ-Inserted Text') -## DBsection('ZZZ-Inserted Text') +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + +# the common term +$a = random(1,10,1); +$b = $a; +$b = random(1,10,1)while(abs($a)==abs($b)); +$question = Formula("$var^2+($a+$b)$var+$a*$b")->reduce; +$ans = Formula("($var+$a)*($var+$b)")->reduce; + +$output = factoringMethods(1,$a,1,$b,$var); +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring345.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring345.pg index 4c081e1c5d..4cf25150c0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring345.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring345.pg @@ -1,18 +1,84 @@ -# This file is just a pointer to the file +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College # -# "Library/PCC/BasicAlgebra/Factoring/factoring175.pg" +# Template: +# Factor the given polynomial. # -# You may want to change your problem set to use that problem -# directly, especially if you want to make a copy of the problem -# for modification. +# x^2 + (a+b) x + ab +# +# If the expression cannot be factored +# then answer with *prime* +# +# a,b are integer on the interval [1,10]; one +# of a or b is negative. +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## DOCUMENT(); -includePGproblem("Library/PCC/BasicAlgebra/Factoring/factoring175.pg"); -ENDDOCUMENT(); -## These tags keep this problem from being added to the NPL database -## -## DBsubject('ZZZ-Inserted Text') -## DBchapter('ZZZ-Inserted Text') -## DBsection('ZZZ-Inserted Text') +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + +# the common term +$a = random(1,10,1)*random(-1,1,2); +$b = $a; +$b = random(1,10,1)*abs($a)/$a*-1 while(abs($a)==abs($b)); +$question = Formula("$var^2+($a+$b)$var+$a*$b")->reduce; +$ans = Formula("($var+$a)*($var+$b)")->reduce; + +$output = factoringMethods(1,$a,1,$b,$var); +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring350.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring350.pg index 90c1158e34..1a05e06285 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring350.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring350.pg @@ -1,18 +1,83 @@ -# This file is just a pointer to the file +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College # -# "Library/PCC/BasicAlgebra/Factoring/factoring180.pg" +# Template: +# Factor the given polynomial. # -# You may want to change your problem set to use that problem -# directly, especially if you want to make a copy of the problem -# for modification. +# x^2 + (a+b) x + ab +# +# If the expression cannot be factored +# then answer with *prime* +# +# a,b are integer on the interval [-10,-1]. +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## DOCUMENT(); -includePGproblem("Library/PCC/BasicAlgebra/Factoring/factoring180.pg"); -ENDDOCUMENT(); -## These tags keep this problem from being added to the NPL database -## -## DBsubject('ZZZ-Inserted Text') -## DBchapter('ZZZ-Inserted Text') -## DBsection('ZZZ-Inserted Text') +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + +# the common term +$a = random(1,10,1)*-1; +$b = $a; +$b = random(1,10,1)*-1 while(abs($a)==abs($b)); +$question = Formula("$var^2+($a+$b)$var+$a*$b")->reduce; +$ans = Formula("($var+$a)*($var+$b)")->reduce; + +$output = factoringMethods(1,$a,1,$b,$var); +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring355.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring355.pg index ddaee64955..b3cb85e737 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring355.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring355.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x + bc # @@ -15,15 +15,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## MTL(basic_trinomial_factoring) -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +32,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedFactor.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -79,19 +76,45 @@ $ans = Compute("prime"); TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________] -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML ANS($ans->cmp(typeMatch=>$question)->withPostFilter(AnswerHints( $question => "Are you trying to say that the polynomial is *prime*?" ))); + + $sqc = int(sqrt(abs($c))); + $factorPairsOutput = '\['; + $counter = 1; + for my $i (1..$sqc) { + my $j = $c/$i; + if ($counter==4) {$factorPairsOutput .= '\]\['; $counter=1;} + if ($j == int($j)) { + $factorPairsOutput .= $i.'('.$j.'),'.-$i.'('.-$j.'),'; + $counter++; + } + }; + if ((substr $factorPairsOutput, -1) eq '[') { + $factorPairsOutput = substr($factorPairsOutput,0,length($factorPairsOutput)-5); + } else { + $factorPairsOutput = substr($factorPairsOutput,0,length($factorPairsOutput)-1); + } + $factorPairsOutput .= '\]'; + + +###################################### BEGIN_PGML_SOLUTION -There is no way to factor this polynomial so we conclude that this polynomial is *prime*. + +The number [`[$c]`] can be factored into the product of two numbers in the following ways: + + [$factorPairsOutput]* + +Since no pair's sum is [`[$b]`], we conclude that this polynomial is *prime*. END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring36.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring36.pg index 25b13295fb..2393c13c96 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring36.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring36.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x + a # @@ -15,16 +15,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_gcf) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,8 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -61,11 +57,11 @@ $ans = Formula("$a*($var+1)"); TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$a][$var]+[$a]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions('If the expression cannot be factored then answer with [|prime|]*.')@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring360.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring360.pg index 1235e8312a..9817395d7d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring360.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring360.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x y + bc y^2 # @@ -14,20 +14,16 @@ # # b, c are non-zero, integer on the interval [1,10]. # -# Last updated: Hughes, 8/18/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_trinomial_two_variables) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -38,26 +34,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -77,31 +73,26 @@ $middle = $b+$a*$c; $end = $b*$c; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [$leading] -* the middle term's coefficient and the last term's coefficient are _positive_ which means that the factorization -will have the form - - [`([$var1]+\mathbf{?}[$var2])([$var1]+\mathbf{?}[$var2])`] +############################################## -We look for factors of [`[$end]`] that add to [`[$middle]`]; the -factors that work are [`[$b]`] and [`[$c]`] so +BEGIN_PGML_SOLUTION - [`[$question]=[$ans]`] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring361.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring361.pg new file mode 100644 index 0000000000..ddc5fd8340 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring361.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# a x^2 y^2 + (b+ac) x y + bc +# +# The answer is +# +# (a xy + b)( xy + c) +# +# a=1 in this problem +# +# b, c are non-zero, integer on the interval [1,10]. +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + +# the common term +$a = 1; +$b = 100; +$c = 1; +# this next condition ensures the numbers don't get too big +while(abs($b+$a*$c)+abs($b*$c)>40) +{ + $a = 1; + $b = random(1,10,1); + $c = $b; + $c = random(1,10,1) while($c==$b); +} + +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$leading*$var1^2*$var2^2+$middle*$var1$var2+$end")->reduce; +$ans = Formula("($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1.$var2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring365.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring365.pg index 1327b7dff8..872bcb264f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring365.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring365.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x y + bc y^2 # @@ -16,19 +16,16 @@ # # One of b or c is negative. # -# Last updated: Hughes, 8/18/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_trinomial_two_variables) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring','multivariable') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,24 +36,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); @@ -69,7 +68,7 @@ while(abs($b+$a*$c)+abs($b*$c)>40) { $a = 1; $b = random(1,10,1)*random(-1,1,2); - $c = random(1,10,1)*abs($b)/$b*-1; + do {$c = random(1,10,1)*abs($b)/$b*-1;} until (abs($b)!=abs($c)); } $leading = $a; @@ -77,31 +76,26 @@ $middle = $b+$a*$c; $end = $b*$c; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [$leading] -* the last term's coefficient is _negative_ which means that the factorization will -have one of the following forms - - [`([$var1]-\mathbf{?}[$var2])([$var1]+\mathbf{?}[$var2]), ([$var1]+\mathbf{?}[$var2])([$var1]-\mathbf{?}[$var2])`] +############################################## -We look for factors of [`[$end]`] that add to [`[$middle]`]; the -factors that work are [`[$b]`] and [`[$c]`] so +BEGIN_PGML_SOLUTION - [`[$question]=[$ans]`] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring366.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring366.pg new file mode 100644 index 0000000000..7f68746909 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring366.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# a x^2y^2 + (b+ac) x y + bc +# +# The answer is +# +# (a xy + b)( xy + c) +# +# a=1 in this problem +# +# b, c are non-zero, integer on the interval [1,10]. +# +# One of b or c is negative. +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring','multivariable') +## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + + + +# the common term +$a = 1; +$b = 100; +$c = 1; +# this next condition ensures the numbers don't get too big +while(abs($b+$a*$c)+abs($b*$c)>40) +{ + $a = 1; + $b = random(1,10,1)*random(-1,1,2); + do {$c = random(1,10,1)*abs($b)/$b*-1;} until (abs($b)!=abs($c)); +} + +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$leading*$var1^2*$var2^2+$middle*$var1$var2+$end")->reduce; +$ans = Formula("($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1.$var2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring37.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring37.pg index 2f52214984..da4abbe209 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring37.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring37.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x - a # @@ -15,15 +15,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_gcf) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,8 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -60,11 +57,11 @@ $ans = Formula("$a*($var-1)"); TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$a][$var]-[$a]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions('If the expression cannot be factored then answer with [|prime|]*.')@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring370.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring370.pg index 6391ebf8c8..86f603950f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring370.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring370.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + (b+ac) x y + bc y^2 # @@ -14,19 +14,16 @@ # # b, c are non-zero, integer on the interval [-10,-1]. # -# Last updated: Hughes, 8/16/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_trinomial_two_variables) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -37,26 +34,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'x'; -$var2 = 'y'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); - - - - +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the common term $a = 1; @@ -76,32 +73,28 @@ $middle = $b+$a*$c; $end = $b*$c; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -BEGIN_PGML_SOLUTION -To factor this expression we make the following observations: -* the leading coefficient is [$leading] -* the middle term's coefficient is _negative _and last term's coefficient is _positive_ which means that the factorization -will have the form - - [`([$var1]-\mathbf{?}[$var2])([$var1]-\mathbf{?}[$var2])`] +############################################## -We look for factors of [`[$end]`] that add to [`[$middle]`]; the -factors that work are [`[$b]`] and [`[$c]`] so +BEGIN_PGML_SOLUTION - [`[$question]=[$ans]`] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION + ############################################## ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring371.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring371.pg new file mode 100644 index 0000000000..b3bdf927c2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring371.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# a x^2y^2 + (b+ac) x y + bc +# +# The answer is +# +# (a xy + b)( xy + c) +# +# a=1 +# +# b, c are non-zero, integer on the interval [-10,-1]. +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + +# the common term +$a = 1; +$b = 100; +$c = 1; +# this next condition ensures the numbers don't get too big +while(abs($b+$a*$c)+abs($b*$c)>40) +{ + $a = 1; + $b = random(-10,-1,1); + $c = $b; + $c = random(-10,-1,1)while($c==$b); +} + +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$leading*$var1^2*$var2^2+$middle*$var1$var2+$end")->reduce; +$ans = Formula("($a*$var1$var2+$b)*($var1$var2+$c)")->reduce; + +$output = factoringMethods($a,$b,1,$c,$var1.$var2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring375.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring375.pg index d982edf471..4b61e64f63 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring375.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring375.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 + d (b+ac) x + d bc # @@ -19,15 +19,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_composite_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -37,8 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -81,11 +78,11 @@ $ans = Formula("$d*($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring376.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring376.pg new file mode 100644 index 0000000000..6d1bd9e678 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring376.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# d a x^2y^2 + d (b+ac) x + d bc +# +# The answer is +# +# d(a xy + b)( xy + c) +# +# a=1 +# +# b, c are non-zero, integer on the interval [1,10]. +# d is integer on [2,10], but we make sure the numbers aren't too big. +# +# Last updated: Hughes, 8/16/13 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + +# the common term +$a = 1; +$b = 100; +$c = 1; +$d = 1; +# this next condition ensures the numbers don't get too big +while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) +{ + $a = 1; + $b = random(1,10,1); + $c = $b; + $c = random(1,10,1)while($c==$b); + $d = random(2,10,1); +} + +$leading = $a; +$middle = ($b+$a*$c); +$end = $b*$c; +$question = Formula("$d*$leading*$var1^2*$var2^2+$d*$middle*$var1*$var2+$d*$end")->reduce; +$ans = Formula("$d*($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +$step1 = Formula("$d($leading*$var1^2$var2^2+$middle*$var1*$var2+$end)")->reduce; +BEGIN_PGML_SOLUTION +Let's start by noting that [`[$d]`] is a common factor to each term, so +we may write + + [`[$question]=[$step1]`] + +To factor this expression further we make the following observations: +* the leading coefficient is [$leading] +* the middle term's coefficient and the last term are _positive_ which means that the factorization +will have the form + + [`([$var1][$var2]+\phantom{3})([$var1][$var2]+\phantom{3})`] + +We look for factors of [`[$end]`] that add to [`[$middle]`]; the +factors that work are [`[$b]`] and [`[$c]`] so + + [`[$question]=[$ans]`] + +Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring38.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring38.pg index 41976e12f7..23a11bdfdc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring38.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring38.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # -a x - a # @@ -15,15 +15,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_gcf) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,8 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -60,11 +57,12 @@ $ans = Formula("-$a*($var+1)"); TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$a*-1][$var]-[$a]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions('If the expression cannot be factored then answer with [|prime|]*.')@]** +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring380.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring380.pg index 027dc2d7ca..77314e680c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring380.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring380.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 + d (b+ac) x + d bc # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_composite_lead_coef) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,8 +36,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -64,14 +61,12 @@ $a = 1; $b = 100; $c = 1; $d = 1; -# this next condition ensures the numbers don't get too big -while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) -{ +do { $a = 1; $b = random(1,10,1)*random(-1,1,2); $c = random(1,10,1)*abs($b)/$b*-1; $d = random(2,10,1); -} +} until (abs($d*$b+$d*$a*$c)+abs($d*$b*$c) <= 50 && $b+$a*$c != 0); $leading = $a; $middle = $b+$a*$c; @@ -82,11 +77,11 @@ $ans = Formula("$d($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring381.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring381.pg new file mode 100644 index 0000000000..a9cbe923a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring381.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# d a x^2y^2 + d (b+ac) xy + d bc +# +# The answer is +# +# d(a xy + b)( xy + c) +# +# a=1 +# +# b, c are non-zero, integer on the interval [1,10]. +# d is integer on [2,10], but we make sure the numbers aren't too big. +# +# One of b or c is negative. +# +# Last updated: Hughes, 8/16/13 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + + + + + +# the common term +$a = 1; +$b = 100; +$c = 1; +$d = 1; +# this next condition ensures the numbers don't get too big +while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) +{ + $a = 1; + $b = random(1,10,1)*random(-1,1,2); + $c = random(1,10,1)*abs($b)/$b*-1; + $d = random(2,10,1); +} + +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$d*$leading*$var1^2*$var2^2+$d*$middle*$var1*$var2+$d*$end")->reduce; +$ans = Formula("$d($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +$step1 = Formula("$d($leading*$var1^2*$var2^2+$middle*$var1*$var2+$end)")->reduce; +BEGIN_PGML_SOLUTION +Let's start by noting that [`[$d]`] is a common factor to each term, so +we may write + + [`[$question]=[$step1]`] + +To factor this expression further we make the following observations: +* the leading coefficient is [$leading] +* the last term is _negative_ which means that the factorization will +have one of the following forms + + [`([$var1][$var2]-\phantom{3})([$var1][$var2]+\phantom{3})\qquad ([$var1][$var2]+\phantom{3})([$var1][$var2]-\phantom{3})`] + +We look for factors of [`[$end]`] that add to [`[$middle]`]; the +factors that work are [`[$b]`] and [`[$c]`] so + + [`[$question]=[$ans]`] + +Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring385.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring385.pg index a603ffe3e8..1dbe2f8037 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring385.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring385.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 + d (b+ac) x + d bc # @@ -19,15 +19,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_nonzero_lead_coef) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -37,8 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -81,11 +78,11 @@ $ans = Formula("$d*($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring390.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring390.pg index fc378fd20b..994f190c00 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring390.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring390.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^(2+n) + d (b+ac) x^(n+1) + d bc x^n # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_factor_variable_out) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,8 +36,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -84,11 +81,11 @@ $ans = Formula("$d*$var^$n($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d$var^$n($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring395.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring395.pg index 12b0c706e1..252de7c412 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring395.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring395.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^(2+n) + d (b+ac) x^(n+1) + d bc x^n # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_factor_variable_out) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,8 +36,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -83,11 +80,11 @@ $ans = Formula("$d*$var^$n($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d$var^$n($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring400.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring400.pg index 54b7e26de9..c126cd140c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring400.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring400.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^(2+n) + d (b+ac) x^(n+1) + d bc x^n # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_factor_variable_out) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,8 +36,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -84,11 +81,11 @@ $ans = Formula("$d*$var^$n($a*$var+$b)*($var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d$var^$n($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring405.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring405.pg index 757338865c..bdfd97326e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring405.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring405.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 y + d (b+ac) x y + d bc y # @@ -19,16 +19,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(nonzero_lead_coef_two_variables) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -38,8 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -84,11 +80,11 @@ $ans = Formula("$d*$var2*($a*$var1+$b)*($var1+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d$var2($leading*$var1^2+$middle*$var1+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring41.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring41.pg index f2d2e1b565..47eb8c1bad 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring41.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring41.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x + a * b # @@ -16,15 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_gcf) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,8 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -62,11 +59,11 @@ $ans = Formula("$a*($var+$b)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$a][$var]+[$a*$b]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions('If the expression cannot be factored then answer with [|prime|]*.')@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring410.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring410.pg index a0002cae26..040347d6e8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring410.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring410.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 y + d (b+ac) x y + d bc y # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring by grouping) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(nonzero_lead_coef_two_variables) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -39,8 +36,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -84,11 +81,11 @@ $ans = Formula("$d$var2($a*$var1+$b)*($var1+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d$var2($leading*$var1^2+$middle*$var1+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring415.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring415.pg index 08be5ac6bf..9d92b458a5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring415.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring415.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^2 y + d (b+ac) x y + d bc y # @@ -19,15 +19,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(nonzero_lead_coef_two_variables) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -37,8 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -83,11 +80,11 @@ $ans = Formula("$d*$var2*($a*$var1+$b)*($var1+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d*$var2($leading*$var1^2+$middle*$var1+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring416.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring416.pg new file mode 100644 index 0000000000..f759abb239 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring416.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# d a x^2 y^2 + d (b+ac) x y^2 + d bc y +# +# The answer is +# +# d y (a xy + b)( xy + c) +# +# a=1 +# +# b, c are non-zero, integer on the interval [-10,-1]. +# d is integer on [2,10], but we make sure the numbers aren't too big. +# +# Last updated: Hughes, 8/16/13 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$var1 = RandomVariableName(type=>'variable'); +$var1 = 'x'; +$var2 = 'y'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + + + + + +# the common term +$a = 1; +$b = 100; +$c = 1; +$d = 1; +# this next condition ensures the numbers don't get too big +while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) +{ + $a = 1; + $b = random(-10,-1,1); + $c=$b; + $c = random(-10,-1,1)while($c==$b); + $d = random(2,10,1); +} + +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$d*$leading*$var1^2$var2^3+$d*$middle*$var1$var2^2+$d*$end$var2")->reduce; +$ans = Formula("$d*$var2*($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +$step1 = Formula("$d*$var2($leading*$var1^2*$var2^2+$middle*$var1*$var2+$end)")->reduce; +BEGIN_PGML_SOLUTION +Let's start by noting that [`[$d][$var2]`] is a common factor to each term, so +we may write + + [`[$question]=[$step1]`] + +To factor this expression further we make the following observations: +* the leading coefficient is [$leading] +* the middle term's coefficient is _negative _and last term is _positive_ which means that the factorization +will have the form + + [`([$var1][$var2]-\phantom{3})([$var1][$var2]-\phantom{3})`] + +We look for factors of [`[$end]`] that add to [`[$middle]`]; the +factors that work are [`[$b]`] and [`[$c]`] so + + [`[$question]=[$ans]`] + +Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring420.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring420.pg index dfd6d81afd..39125286d4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring420.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring420.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # d a x^3 y + d (b+ac) x^2 y + d bc xy # @@ -19,16 +19,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_two_variables) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -38,8 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -84,11 +80,11 @@ $ans = Formula("$d*$var1*$var2*($a*$var1+$b)*($var1+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step1 = Formula("$d$var1$var2($leading*$var1^2+$middle*$var1+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring425.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring425.pg index cb0e139fad..2f7d6f1418 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring425.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring425.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 y^2 + (b+ac) x^2 y z + bc x^2 z^2 # @@ -20,15 +20,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(trinomial_two_variables) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring','multivariable') ## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -38,8 +35,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -82,11 +79,11 @@ $ans = Formula("$var3^2($a*$var1+$b$var2)*($var1+$c$var2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$var3^2($leading*$var1^2+$middle*$var1$var2+$end$var2^2)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring430.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring430.pg index f49a8ce8da..3dc5b875e2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring430.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring430.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # x^2 + (a+b) x + ab # @@ -15,14 +15,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -32,8 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -62,11 +60,11 @@ $ans = Formula("($var+$a)*($var+$b)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring435.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring435.pg new file mode 100644 index 0000000000..923e5c8bf0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring435.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# (A+B)x^2 + (A+B)(a+b) x + (A+B)ab +# +# The answer is +# +# (A+B)(x+a)(x+b) +# +# If the expression cannot be factored +# then answer with *prime* +# +# a,b are non-zero, integer on the interval [1,10]. +# +# Last updated: Hughes, 8/16/13 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +$varA = 'a'; +$varB = 'b'; +Context()->variables->are($var=>'Real',$varA=>'Real',$varB=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + + + + + +# the common term +$a = random(1,10,1); +$b = $a; +$b = random(1,10,1)while(abs($a)==abs($b)); +$question = Formula("($varA+$varB)$var^2+($varA+$varB)($a+$b)$var+$a*$b*($varA+$varB)")->reduce->reduce; +$ans = Formula("($varA+$varB)($var+$a)*($var+$b)")->reduce; +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +$step= Formula("($varA+$varB)($var^2+($a+$b)$var+$a*$b)")->reduce; +BEGIN_PGML_SOLUTION +Let's start by noting that [`([$varA]+[$varB])`] is common to each term, so +we may write + + [` + [$question] = [$step] + `] + +Next we look for factors of [`[$a*$b]`] that give [`[$a+$b]`] when added; the +factors that work are [`[$a]`] and [`[$b]`] so + + [`[$question]=[$ans]`] + +Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring440.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring440.pg new file mode 100644 index 0000000000..34cf2a7c15 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring440.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# d a x^2 + d (b+ac) x + d bc +# +# The answer is +# +# d(a x + b)( x + c) +# +# a=1 +# +# b, c are non-zero, integer on the interval [1,10]. +# +# d = -1 +# +# One of b or c is negative. +# +# Last updated: Hughes, 8/16/13 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','trinomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + + + + + +# the common term +$a = 1; +$b = 100; +$c = 1; +$d = 1; +# this next condition ensures the numbers don't get too big +while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) +{ + $a = 1; + $b = random(1,10,1)*random(-1,1,2); + $c = random(1,10,1)*abs($b)/$b*-1; + $d = -1; +} + +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$d*$leading*$var^2+$d*$middle*$var+$d*$end")->reduce; +$ans = Formula("$d($a*$var+$b)*($var+$c)")->reduce; +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +$step1 = Formula("$d($leading*$var^2+$middle*$var+$end)")->reduce; +BEGIN_PGML_SOLUTION +Let's start by noting that [`[$d]`] is a common factor to each term, so +we may write + + [`[$question]=[$step1]`] + +To factor this expression further we make the following observations: +* the leading coefficient is [`[$leading]`] +* the last term is _negative_ which means that the factorization will +have one of the following forms + + [`([$var]-\phantom{3})([$var]+\phantom{3})\qquad ([$var]+\phantom{3})([$var]-\phantom{3})`] + +We look for factors of [`[$end]`] that add to [`[$middle]`]; the +factors that work are [`[$b]`] and [`[$c]`] so + + [`[$question]=[$ans]`] + +Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring445.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring445.pg index d97c5e3194..295b1018fb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring445.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring445.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -17,20 +17,16 @@ # # x^2 - b^2 # -# Last updated: Hughes, 8/19/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_one_var) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -41,7 +37,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -51,10 +50,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the coefficients $a = 1; @@ -67,30 +68,28 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var^2+$middle*$var+$end")->reduce; $ans = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -$step = Formula("$a$var")->reduce; +############################################## + BEGIN_PGML_SOLUTION -Note that the given expression is the _difference of squares_ - [` - \begin{aligned} - [$question] & = [$step]^2-[$b]^2\\ - & = [$ans] - \end{aligned} - `] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION + ############################################## ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring450.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring450.pg index 6ab3bb2cb2..1bc3c64312 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring450.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring450.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -17,19 +17,16 @@ # # a^2 x^2 - b^2 # -# Last updated: Hughes, 8/19/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_one_var_nonzero_lead) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,7 +37,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -50,10 +50,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the coefficients $a = random(1,12,1); @@ -67,30 +69,28 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var^2+$middle*$var+$end")->reduce; $ans = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -$step = Formula("$a$var")->reduce; +############################################## + BEGIN_PGML_SOLUTION -Note that the given expression is the _difference of squares_ - [` - \begin{aligned} - [$question] & = ([$step])^2-[$b]^2\\ - & = [$ans] - \end{aligned} - `] +[$output]*** -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). END_PGML_SOLUTION + ############################################## ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring451.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring451.pg new file mode 100644 index 0000000000..cc48d4f7b1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring451.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# ac x^2y^2 + (bc+ad) x + bd +# +# The answer is +# +# (a xy + b)( c xy + d) +# +# a = c +# b = -d +# +# So this problem becomes a difference of squares +# +# a^2 x^2y^2 - b^2 +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + +# the coefficients +$a = 1; +$b = $a; +$b = random(1,12,1) while($a==$b or gcd($a,$b)!=1); +$c = $a; +$d = $b*-1; + +$leading = $a*$c; +$middle = $b*$c+$a*$d; +$end = $b*$d; +$question = Formula("$leading*$var1^2*$var2^2+$middle*$var1*$var2+$end")->reduce; +$ans = Formula("($a*$var1*$var2+$b)*($c*$var1*$var2+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var1.$var2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring452.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring452.pg new file mode 100644 index 0000000000..4bbfb7f08c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring452.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# ac x^2y^2 + (bc+ad) x + bd +# +# The answer is +# +# (a xy + b)( c xy + d) +# +# a = c +# b = -d +# +# So this problem becomes a difference of squares +# +# a^2 x^2y^2 - b^2 +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + +# the coefficients +$a = random(1,12,1); +$b = $a; +$b = random(1,12,1) while($a==$b or gcd($a,$b)!=1); +$c = $a; +$d = $b*-1; + +$leading = $a*$c; +$middle = $b*$c+$a*$d; +$end = $b*$d; +$question = Formula("$leading*$var1^2*$var2^2+$middle*$var1*$var2+$end")->reduce; +$ans = Formula("($a*$var1*$var2+$b)*($c*$var1*$var2+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var1.$var2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring455.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring455.pg index ffecba94dc..e6c0c72abf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring455.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring455.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_one_var) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -78,11 +75,11 @@ $ans = Formula("($b+$a*$var)*($d+$c*$var)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring460.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring460.pg index c57f280a49..759b756112 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring460.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring460.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_one_var_nonzero_lead) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -71,11 +68,11 @@ $ans = Formula("($b+$a*$var)*($d+$c*$var)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring465.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring465.pg index 33d33c5c6c..8721c7d381 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring465.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring465.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^4 + (bc+ad) x^2 + bd # @@ -23,16 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring polynomials: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_two_step) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -43,7 +39,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -74,11 +70,11 @@ $ans = Formula("($a*$var^2+$b)*($c*$var^2+$d)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring470.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring470.pg index 49c0c17f3f..aa3d9a1ed0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring470.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring470.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^4 + (bc+ad) x^2 + bd # @@ -23,15 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_two_step) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -42,7 +39,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,7 +57,7 @@ Context()->noreduce('(-x)-y', '(-x)+y'); # the coefficients $a = random(2,12,1); $b = 4; -$b = random(1,12,1) while($b==4 or $b==9 or gcd($a,$b)!=1); +$b = random(1,12,1) while($b==1 or $b==4 or $b==9 or gcd($a,$b)!=1); $c = $a; $d = $b*-1; @@ -73,11 +70,11 @@ $ans = Formula("($a*$var^2+$b)*($c*$var^2+$d)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring475.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring475.pg index 6e7f63c29c..61680b7c24 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring475.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring475.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2n + (bc+ad) x^n + bd # @@ -24,15 +24,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring polynomials: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_two_step) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -43,7 +40,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -84,11 +81,11 @@ $ans = Formula("($a*$var^$n+$b)*($c*$var^$n+$d)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring480.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring480.pg index f8a766a30e..3af76bd252 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring480.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring480.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^4 + (bc+ad) x^2 y^2 + bd y^4 # @@ -23,15 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_two_step) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -42,7 +39,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,11 +57,13 @@ Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); Context()->noreduce('(-x)-y', '(-x)+y'); # the coefficients +do{ $a = random(2,12,1); $b = 4; $b = random(1,12,1) while($b==4 or $b==9 or gcd($a,$b)!=1); $c = $a; $d = $b*-1; +} until (int(sqrt($c))!=sqrt($c) or int(sqrt(-$d))!=sqrt(-$d)); $leading = $a*$c; $middle = $b*$c+$a*$d; @@ -75,20 +74,21 @@ $ans = Formula("($a*$var1^2+$b$var2^2)*($c*$var1^2+$d$var2^2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -$step = Formula("$a$var1")->reduce; +$step = Formula("$a$var1^2")->reduce; +$stepb = Formula("$b$var2^2")->reduce; BEGIN_PGML_SOLUTION Note that the given expression is the _difference of squares_ [` \begin{aligned} - [$question] & = ([$step]^2)^2-[$b]^2\\ + [$question] & = ([$step])^2-([$stepb])^2\\ & = [$ans] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring485.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring485.pg index 263d64fcab..bdb6204d0c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring485.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring485.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2n + (bc+ad) x^n y^m + bd y^2m # @@ -23,14 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -41,7 +39,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -88,11 +86,11 @@ $ans = Formula("($a*$var1^$n+$b$var2^$m)*($c*$var1^$n+$d$var2^$m)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var1")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring490.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring490.pg index c12fbbc6e9..519445ad0e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring490.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring490.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^4 + (bc+ad) x^2 + bd # @@ -27,15 +27,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_two_step) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -46,7 +43,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -77,11 +74,11 @@ $ans = Formula("(sqrt($a)*$var-sqrt($b))(sqrt($a)*$var+sqrt($b))($a*$var^2+$b)") TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring495.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring495.pg index 3aff08d0d0..e70690c8a4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring495.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring495.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # e (ac x^2 + (bc+ad) x + bd) # @@ -24,16 +24,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_one_var_nonzero_lead) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -44,7 +40,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,11 +76,11 @@ $ans = Formula("$e($a*$var+$b)*($c*$var+$d)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring5.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring5.pg index ecb807bb33..166ab77c71 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring5.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring5.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Find the greatest common factor of the following two terms +# Find the greatest common factor of the following terms. # # a a*(bx) # @@ -14,16 +14,13 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('exponents','factoring','greatest common factor') -## MLT(find_gcf) -## MLTleader(1) +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + ############################################## DOCUMENT(); @@ -35,7 +32,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "parserOneOf.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -73,7 +70,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the greatest common factor of the following two terms +Find the greatest common factor of the following terms. [`[$poly1]`] and [`[$poly2]`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring500.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring500.pg index 5f7407bcec..7584589f37 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring500.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring500.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # e x (ac x^2 + (bc+ad) x + bd) # @@ -24,14 +24,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -42,7 +40,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -78,11 +76,11 @@ $ans = Formula("$e$var($a*$var+$b)*($c*$var+$d)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var")->reduce; @@ -92,7 +90,8 @@ terms; once we have factored this out, what remains is the _difference of square [` \begin{aligned} - [$question] & = [$e][$var]([$step]^2-[$b]^2)\\ + [$question] & = [$e][$var]([$step]^2-[$b*$b])\\ + & = [$e][$var]([$step]^2-[$b]^2)\\ & = [$ans] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring501.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring501.pg new file mode 100644 index 0000000000..518862fb02 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring501.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# 2m^4n^2-32m^2n=2m^2n(mn+4)(mn-4) +# +# Last updated: Yao 11/19/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + +# the coefficients +$a = 1; +$b=15; +$e=random(2,5,1); +while($e*$b**2>150) +{ + $b = random(1,10,1); + $e = random(2,10,1); +} +$c = 1; +$d = $b*-1; + +$e1 = random(1,2,1); +$e2 = random(1,2,1); + +$leading = $e*$a*$c; +$middle = $e*($b*$c+$a*$d); +$end = $e*$b*$d; +$question = Formula("$leading*$var1^($e1+2)*$var2^($e2+2)+$end$var1^$e1$var2^$e2")->reduce; +$ans = Formula("$e*$var1^$e1*$var2^$e2*($a*$var1*$var2+$b)*($c*$var1*$var2+$d)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +$step1 = Formula("$a*$var1^2*$var2^2")->reduce; +$step2 = Formula("$a$var1$var2")->reduce; +$factor = Formula("$e*$var1^$e1*$var2^$e2")->reduce; + +BEGIN_PGML_SOLUTION +The first thing to observe is that [`[$factor]`] is common to both +terms; once we have factored this out, what remains is the _difference of squares_ + + [` + \begin{aligned} + [$question] & = [$factor]([$step1]-[$b*$b])\\ + & = [$factor](([$step2])^2-[$b]^2) \\ + & = [$ans] + \end{aligned} + `] + +Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring505.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring505.pg index 5fc5e8d5dc..15fd530288 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring505.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring505.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -23,14 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -42,7 +40,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedFactor.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -72,11 +70,11 @@ $ans = Compute("prime"); TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________] -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML ANS($ans->cmp(typeMatch=>$question)->withPostFilter(AnswerHints( diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring510.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring510.pg index 84bec705b4..5e235d71dd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring510.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring510.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # e x^3 + e * b^2 x # @@ -19,14 +19,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -37,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -73,11 +71,11 @@ $ans = Formula("$e$var($a*$var^2+$b**2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring515.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring515.pg index adb63390bb..9fab939acb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring515.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring515.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # e (ac x^2 + (bc+ad) x + bd) # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_one_var_nonzero_lead) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,11 +77,11 @@ $ans = Formula("$e*($b+$a*$var)*($d+$c*$var)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring520.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring520.pg index 2448661796..838963ce81 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring520.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring520.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -17,19 +17,16 @@ # # x^2 + 2 b x + ab # -# Last updated: Hughes, 8/19/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,7 +37,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -50,10 +50,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the coefficients $a = 1; @@ -66,45 +68,25 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var^2+$middle*$var+$end")->reduce; $ans = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -$step = Formula("($a*$var+$b)^2")->reduce; -BEGIN_PGML_SOLUTION -We need to find factors of [`[$end]`] that, when added, give [`[$middle]`]; -this problem is an example of _the square of the sum of two terms_ - - [` - [$question] = [$ans] - `] - -You might have written - - [` - [$question] = [$step] - `] - -which is also correct. - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -####Alternative Approach - -Note that the leading term and the final term are perfect squares. Their square roots are [`[$var]`] and [`[$b]`]. After multiplying their square roots, we have [`[$b][$var]`], which is half of the middle term. When all this happens, we have a perfect square trinomial, and the two square roots we found make the binomial that should be squared. That is, - - [` - [$question] = [$step] - `] +############################################## +BEGIN_PGML_SOLUTION +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring525.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring525.pg index 670c313c98..3df81cc694 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring525.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring525.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -17,19 +17,16 @@ # # x^2 + 2 b x + ab # -# Last updated: Hughes, 8/19/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,7 +37,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -50,10 +50,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the coefficients $a = 1; @@ -66,44 +68,25 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var^2+$middle*$var+$end")->reduce; $ans = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -$step = Formula("($a*$var+$b)^2")->reduce; -BEGIN_PGML_SOLUTION -We need to find factors of [`[$end]`] that, when added, give [`[$middle]`]; -this problem is an example of _the square of the difference of two terms_ - - [` - [$question] = [$ans] - `] - -You might have written - - [` - [$question] = [$step] - `] - -which is also correct. - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -####Alternative Approach - -Note that the leading term and the final term are perfect squares. Their square roots are [`[$var]`] and [`[@abs([$b])@]`]. After multiplying their square roots, we have [`[@abs([$b])@][$var]`], which is (negative) half of the middle term. When all this happens, we have a perfect square trinomial, and the two square roots we found make the binomial that should be squared. Since the middle coefficient was negative, the binomial should be a difference, not a sum. That is, +############################################## - [` - [$question] = [$step] - `] +BEGIN_PGML_SOLUTION +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring530.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring530.pg index c5dcb91cce..5b58e8bff0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring530.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring530.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -17,19 +17,16 @@ # # a^2 x^2 + 2 a x + 1 # -# Last updated: Hughes, 8/19/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,7 +37,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -50,10 +50,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the coefficients $a = random(2,12,1); @@ -66,45 +68,25 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var^2+$middle*$var+$end")->reduce; $ans = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -$step = Formula("($a*$var+$b)^2")->reduce; -BEGIN_PGML_SOLUTION -We need to find factors of [`[$end]`] that when combined with the -factors of [`[$leading]`] give [`[$middle]`]; -this problem is an example of _the square of the sum of two terms_ - - [` - [$question] = [$ans] - `] - -You might have written - - [` - [$question] = [$step] - `] - -which is also correct. - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -####Alternative Approach - -Note that the leading term and the final term are perfect squares. Their square roots are [`[$a][$var]`] and [`[@abs([$b])@]`]. After multiplying their square roots, we have [`[@$a*abs([$b])@][$var]`], which is [%(negative)%] half of the middle term. When all this happens, we have a perfect square trinomial, and the two square roots we found make the binomial that should be squared. [%Since the middle coefficient was negative, the binomial should be a difference, not a sum.%] That is, +############################################## - [` - [$question] = [$step] - `] +BEGIN_PGML_SOLUTION +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring535.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring535.pg index 58c005e04e..f142ac7ef5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring535.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring535.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -19,19 +19,16 @@ # # a^2 x^2 - 2 a x + 1 # -# Last updated: Hughes, 8/19/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -42,7 +39,10 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## @@ -52,10 +52,12 @@ Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the coefficients $a = random(2,12,1); @@ -68,47 +70,28 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var^2+$middle*$var+$end")->reduce; $ans = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -$step = Formula("($a*$var+$b)^2")->reduce; -BEGIN_PGML_SOLUTION -We need to find factors of [`[$end]`] that when combined with the -factors of [`[$leading]`] give [`[$middle]`]; -this problem is an example of _the square of the difference of two terms_ - - [` - [$question] = [$ans] - `] - -You might have written - - [` - [$question] = [$step] - `] - -which is also correct. - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -####Alternative Approach - -Note that the leading term and the final term are perfect squares. Their square roots are [`[$a][$var]`] and [`[@abs([$b])@]`]. After multiplying their square roots, we have [`[@$a*abs([$b])@][$var]`], which is (negative) half of the middle term. When all this happens, we have a perfect square trinomial, and the two square roots we found make the binomial that should be squared. Since the middle coefficient was negative, the binomial should be a difference, not a sum. That is, +############################################## - [` - [$question] = [$step] - `] +BEGIN_PGML_SOLUTION +[$output]*** END_PGML_SOLUTION + ############################################## ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring536.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring536.pg new file mode 100644 index 0000000000..e651f3a018 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring536.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# ac x^2y^2 + (bc+ad) xy + bd +# +# The answer is +# +# (a xy + b)( c xy + d) +# +# a = c = 1 +# b = d +# +# where b, d are negative +# +# So this problem becomes +# +# a^2 x^2y^2 - 2 a x + 1 +# +# Last updated: Yao 11/15/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); + +# the coefficients +$a = random(2,12,1); +$b = -1; +$c = $a; +$d = $b; + +$leading = $a*$c; +$middle = $b*$c+$a*$d; +$end = $b*$d; +$question = Formula("$leading*$var1^2*$var2^2+$middle*$var1*$var2+$end")->reduce; +$ans = Formula("($a*$var1*$var2+$b)*($c*$var1*$var2+$d)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var1.$var2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[$output]*** + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring540.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring540.pg index e556b1253c..4e19e26216 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring540.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring540.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) xy + bd y^2 # @@ -17,20 +17,16 @@ # # x^2 + 2 b x y + ab y^2 # -# Last updated: Hughes, 8/19/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial_two_var) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -41,22 +37,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the coefficients $a = 1; @@ -69,43 +69,25 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($c*$var1+$d$var2)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -$step = Formula("($a*$var1+$b$var2)^2")->reduce; -BEGIN_PGML_SOLUTION -We need to find factors of [`[$end]`] that, when added, give [`[$middle]`]; -this problem is an example of _the square of the sum of two terms_ - - [` - [$question] = [$ans] - `] - -You might have written - - [` - [$question] = [$step] - `] - -which is also correct. - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -####Alternative Approach +############################################## -Note that the leading term and the final term are perfect squares. Their square roots are [`[$var1]`] and [`[@abs([$b])@][$var2]`]. After multiplying their square roots, we have [`[@$a*abs([$b])@][$var1][$var2]`], which is [%(negative)%] half of the middle term. When all this happens, we have a perfect square trinomial, and the two square roots we found make the binomial that should be squared. [%Since the middle coefficient was negative, the binomial should be a difference, not a sum.%] That is, +BEGIN_PGML_SOLUTION - [` - [$question] = [$step] - `] +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring545.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring545.pg index 13637f358c..9de51f0467 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring545.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring545.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) xy + bd y^2 # @@ -19,19 +19,16 @@ # # x^2 + 2 b x + ab # -# Last updated: Hughes, 8/19/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial_two_var) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -42,22 +39,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the coefficients $a = 1; @@ -70,44 +71,25 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($c*$var1+$d$var2)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -$step = Formula("($a*$var1+$b$var2)^2")->reduce; -BEGIN_PGML_SOLUTION -We need to find factors of [`[$end]`] that, when added, give [`[$middle]`]; -this problem is an example of _the square of the difference of two terms_ - - [` - [$question] = [$ans] - `] - -You might have written - - [` - [$question] = [$step] - `] - -which is also correct. - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -####Alternative Approach - -Note that the leading term and the final term are perfect squares. Their square roots are [`[$var1]`] and [`[@abs([$b])@][$var2]`]. After multiplying their square roots, we have [`[@$a*abs([$b])@][$var1][$var2]`], which is (negative) half of the middle term. When all this happens, we have a perfect square trinomial, and the two square roots we found make the binomial that should be squared. Since the middle coefficient was negative, the binomial should be a difference, not a sum. That is, +############################################## - [` - [$question] = [$step] - `] +BEGIN_PGML_SOLUTION +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring550.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring550.pg index 30dbb2972d..668bccf45d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring550.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring550.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) xy + bd y^2 # @@ -17,20 +17,16 @@ # # a^2 x^2 + 2 a b x y + ab y^2 # -# Last updated: Hughes, 8/19/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial_two_var_nonzero_lead) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -41,22 +37,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the coefficients $a=100; @@ -75,44 +75,25 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($c*$var1+$d$var2)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -$step = Formula("($a*$var1+$b$var2)^2")->reduce; -BEGIN_PGML_SOLUTION -We need to find factors of [`[$end]`] that when combined with the -factors of [`[$leading]`] give [`[$middle]`]; -this problem is an example of _the square of the sum of two terms_ - - [` - [$question] = [$ans] - `] - -You might have written - - [` - [$question] = [$step] - `] - -which is also correct. - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -####Alternative Approach +############################################## -Note that the leading term and the final term are perfect squares. Their square roots are [`[$a][$var1]`] and [`[@abs([$b])@][$var2]`]. After multiplying their square roots, we have [`[@$a*abs([$b])@][$var1][$var2]`], which is [%(negative)%] half of the middle term. When all this happens, we have a perfect square trinomial, and the two square roots we found make the binomial that should be squared. [%Since the middle coefficient was negative, the binomial should be a difference, not a sum.%] That is, +BEGIN_PGML_SOLUTION - [` - [$question] = [$step] - `] +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring555.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring555.pg index e01930b1b0..58475af758 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring555.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring555.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) xy + bd y^2 # @@ -19,19 +19,16 @@ # # a^2 x^2 + 2 a b x y + ab y^2 # -# Last updated: Hughes, 8/19/13 +# Last updated: Yao 11/15/2016 # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial_two_var_nonzero_lead) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -42,22 +39,26 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "PCCfactor.pl", + "PGcourse.pl", ); ############################################## Context("LimitedFactor"); Context()->noreduce('(-x)-y','(-x)+y'); -#$var1 = RandomVariableName(type=>'variable'); -$var1 = 'a'; -$var2 = 'b'; +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); Context()->variables->are($var1=>'Real',$var2=>'Real'); -Context()->strings->add("cannot be factored"=>{}, - "cannot be factored."=>{alias=>"cannot be factored"}); -Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); -Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->strings->add( + 'prime'=>{}, + 'it is prime'=>{alias=>'prime'}, + 'cannot be factored'=>{alias=>'prime'}, + 'cannot be factored.'=>{alias=>'prime'} +); # the coefficients $a=100; @@ -76,44 +77,25 @@ $middle = $b*$c+$a*$d; $end = $b*$d; $question = Formula("$leading*$var1^2+$middle*$var1$var2+$end$var2^2")->reduce; $ans = Formula("($a*$var1+$b$var2)*($c*$var1+$d$var2)")->reduce; + +$output = factoringMethods($a,$b,$c,$d,$var1,$var2); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -$step = Formula("($a*$var1+$b$var2)^2")->reduce; -BEGIN_PGML_SOLUTION -We need to find factors of [`[$end]`] that when combined with the -factors of [`[$leading]`] give [`[$middle]`]; -this problem is an example of _the square of the difference of two terms_ - - [` - [$question] = [$ans] - `] - -You might have written - - [` - [$question] = [$step] - `] - -which is also correct. - -Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). - -####Alternative Approach +############################################## -Note that the leading term and the final term are perfect squares. Their square roots are [`[$a][$var1]`] and [`[@abs([$b])@][$var2]`]. After multiplying their square roots, we have [`[@$a*abs([$b])@][$var1][$var2]`], which is (negative) half of the middle term. When all this happens, we have a perfect square trinomial, and the two square roots we found make the binomial that should be squared. Since the middle coefficient was negative, the binomial should be a difference, not a sum. That is, +BEGIN_PGML_SOLUTION - [` - [$question] = [$step] - `] +[$output]*** END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring56.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring56.pg index 1bcfcb1866..a9e7d2b8c9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring56.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring56.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a * c x^2 + a * b # @@ -16,16 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_gcf_binomial) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,8 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -56,8 +52,10 @@ Context()->noreduce('(-x)-y', '(-x)+y'); # the common term -$a = random(2,10,1); -$b = random(2,10,1)*random(-1,1,2); +do { + $a = random(2,10,1); + $b = random(2,10,1)*random(-1,1,2); +} until (sqrt(abs($b)) != int(sqrt(abs($b)))); $c = $b; $c = random(2,10,1) while(gcf($c,$b)!=1); $ans = Formula("$a*($c*$var^2+$b)")->reduce; @@ -65,17 +63,17 @@ $ans = Formula("$a*($c*$var^2+$b)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$a*$c][$var]^2+[$a*$b]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions('If the expression cannot be factored then answer with [|prime|]*.')@]** END_PGML BEGIN_PGML_SOLUTION The greatest common factor is [`[$a]`], so we can factor the polynomial as follows: - [`[$a*$c][$var]^2+[$a*$b]=[$ans]`] + [`[$a][$var]^2+[$a*$b]=[$ans]`] END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring560.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring560.pg index 68e789cb11..5f9aec7d5b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring560.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring560.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # e (ac x^2 + (bc+ad) x + bd) # @@ -23,16 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial_two_step) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -43,7 +39,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -79,11 +75,11 @@ $ans = Formula("$e*($a*$var+$b)*($c*$var+$d)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step0 = Formula("$e($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring561.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring561.pg new file mode 100644 index 0000000000..fc943b0a99 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring561.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Factor the given polynomial. +# +# e (ac x^2y^2 + (bc+ad) xy + bd) +# +# The answer is +# +# e(a xy + b)( c xy + d) +# +# a = c +# b = d = 1 +# +# So this problem becomes +# +# e (a^2 x^2y^2 + 2 a xy + 1) = e(axy +1)^2 +# +# e is integer on [2,10] and we check that e*a^2, 2*a*e aren't too big +# +# Last updated: Hughes, 8/19/13 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2=RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + +# the coefficients +$a=11; +$e=1; +while(max($e*$a**2,2*$e*$a)>100) +{ + $a = random(2,12,1); + $b = 1; + $c = $a; + $d = $b; + $e = random(2,10,1); +} + +$leading = $a*$c; +$middle = ($b*$c+$a*$d); +$end = $b*$d; +$question = Formula("$e*$leading*$var1^2*$var2^2+$e*$middle*$var1*$var2+$e*$end")->reduce; +$ans = Formula("$e*($a*$var1*$var2+$b)*($c*$var1*$var2+$d)")->reduce; +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** +END_PGML + +$step0 = Formula("$e($leading*$var1^2$var2^2+$middle*$var1*$var2+$end)")->reduce; +$step = Formula("$e($a*$var1*$var2+$b)^2")->reduce; +BEGIN_PGML_SOLUTION +Firstly, let's note that [`[$e]`] is common to each term. + + [` + [$question] = [$step0] + `] + +We need to find factors of [`[$end]`] that when combined with the +factors of [`[$leading]`] give [`[$middle]`]; +this problem is an example of _the square of the sum of two terms_ + + [` + [$question] = [$ans] + `] + +You might have written + + [` + [$question] = [$step] + `] + +which is also correct. + +Note that this answer can be checked by using the FOIL (*F*irst *O*utside *I*nside *L*ast) technique (exercise). + +####Alternative Approach + +When factoring, we should always first look for any greatest common factors of the terms. Here we find that [`[$e]`] is such a factor, and we have + + [` + [$question] = [$step0] + `] + +To factor the remaining trinomial further, note that its leading term and its final term are perfect squares. Their square roots are [`[$a][$var1][$var2]`] and [`[@abs([$b])@]`]. After multiplying their square roots, we have [`[@$a*abs([$b])@][$var1][$var2]`], which is [%(negative)%] half of the middle term. When all this happens, we have a perfect square trinomial, and the two square roots we found make the binomial that should be squared. [%Since the middle coefficient was negative, the binomial should be a difference, not a sum.%] That is, + + [` + [$question] = [$step] + `] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring565.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring565.pg index b59b606658..28f5254703 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring565.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring565.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # e (ac x^2 + (bc+ad) x + bd) # @@ -25,15 +25,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial_two_step) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -44,7 +41,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,11 +77,11 @@ $ans = Formula("$e*($a*$var+$b)*($c*$var+$d)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step0 = Formula("$e($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring570.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring570.pg index 5ba1703778..2bb6762d83 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring570.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring570.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^n+2 + (bc+ad) x^n+1 + bd x^n # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial_two_step) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -73,11 +70,11 @@ $ans = Formula("$var^$n($a*$var+$b)*($c*$var+$d)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step0 = Formula("$var^$n($leading*$var^(2)+$middle*$var^(1)+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring575.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring575.pg index cfcc0085d7..ddd86e58ca 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring575.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring575.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^n+2 + (bc+ad) x^n+1 + bd x^n # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial_two_step) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -73,11 +70,11 @@ $ans = Formula("$var^$n($a*$var+$b)*($c*$var+$d)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step0 = Formula("$var^$n($leading*$var^(2)+$middle*$var^(1)+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring580.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring580.pg index 69c3df38ce..354d7e2736 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring580.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring580.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # e x^n(ac x^2 + (bc+ad) x + bd) # @@ -23,15 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial_two_step) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -42,7 +39,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,11 +77,11 @@ $ans = Formula("$e*$var^$n($a*$var+$b)*($c*$var+$d)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step0 = Formula("$e$var^$n($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring585.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring585.pg index 16babfd6c7..e5e2c08fd7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring585.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring585.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # e x^n(ac x^2 + (bc+ad) x + bd) # @@ -23,15 +23,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(squared_binomial_two_step) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -42,7 +39,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,11 +77,11 @@ $ans = Formula("$e*$var^$n($a*$var+$b)*($c*$var+$d)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step0 = Formula("$e$var^$n($leading*$var^2+$middle*$var+$end)")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring590.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring590.pg index a9ce7321ad..d0088e38c1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring590.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring590.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^3 + b^3 # @@ -16,16 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_sum_diff_cubes) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -36,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,28 +57,26 @@ $middle = -$a*$b; $end = $b**2; $question = Formula("$a**3*$var^3+$b^3")->reduce; $ans = Formula("($a*$var+$b)($leading*$var^2+$middle*$var+$end)")->reduce; +if(abs($b)>5) +{ + $hintval = $b**3; + $hint = 'Hint: [`[$hintval]=[$b]^3`].' ; +} ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@$hint@]** + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML -if(abs($b)>5) -{ - $hintval = $b**3; - $hint = "\text{Hint}: $hintval=$b^3" ; - Context()->texStrings; -BEGIN_TEXT - \($hint\) -END_TEXT -} $step = Formula("$a$var")->reduce; BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring595.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring595.pg index 57c9256319..cecb6211a3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring595.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring595.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^3 - b^3 # @@ -16,15 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_sum_diff_cubes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,27 +58,25 @@ $end = $b**2; $question = Formula("$a**3*$var^3+$b^3")->reduce; $ans = Formula("($a*$var+$b)($leading*$var^2+$middle*$var+$end)")->reduce; +if(abs($b)>5) +{ + $hintval = $b**3; + $hint = 'Hint: [`[$hintval]=[$b]^3`].' ; +} + ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@$hint@]** -END_PGML +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** -if(abs($b)>5) -{ - $hintval = $b**3; - $hint = "\text{Hint}: $hintval=$b^3" ; - Context()->texStrings; -BEGIN_TEXT - \($hint\) -END_TEXT -} +END_PGML $step = Formula("$a$var")->reduce; BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring600.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring600.pg index f30d74ea34..8fb841c991 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring600.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring600.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^3 + b^3 # @@ -16,15 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_sum_diff_cubes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,38 +57,36 @@ $middle = -$a*$b; $end = $b**2; $question = Formula("$a**3*$var^3+$b^3")->reduce; $ans = Formula("($a*$var+$b)($leading*$var^2+$middle*$var+$end)")->reduce; - -############################################## -TEXT(beginproblem()); - -BEGIN_PGML -Factor the given polynomial - - [`[$question]=`] [___________________]{$ans} - -If the expression cannot be factored then answer with *prime*. - -END_PGML - if(abs($a)>5 or abs($b)>5) { $hintvala = $a**3; $hintvalb = $b**3; - $hint = "\text{Hint: }"; + $hint = "Hint: "; if(abs($a)>5) { - $hint .= "$hintvala = $a^3"; + $hint .= '[`[$hintvala] = [$a]^3`].'; } elsif(abs($b)>5) { - $hint .= "$hintvalb = $b^3"; + $hint .= '[`[$hintvalb] = [$b]^3`].'; } -Context()->texStrings; -BEGIN_TEXT -\($hint\) -END_TEXT } +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@$hint@]** + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** + +END_PGML + + $step = Formula("$a$var")->reduce; BEGIN_PGML_SOLUTION Note that the given expression is a _sum of cubes_. The SOAP acronym may help you remember how to factor sums and differences of cubes. First, you need to know that they factor as a binomial times a trinomial: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring605.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring605.pg index ec5dec3d25..065b65e8e1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring605.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring605.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^3 - b^3 # @@ -16,15 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_sum_diff_cubes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,35 +58,33 @@ $end = $b**2; $question = Formula("$a**3*$var^3-$b^3")->reduce; $ans = Formula("($a*$var-$b)($leading*$var^2+$middle*$var+$end)")->reduce; -############################################## -TEXT(beginproblem()); - -BEGIN_PGML -Factor the given polynomial - - [`[$question]=`] [___________________]{$ans} - -If the expression cannot be factored then answer with *prime*. - -END_PGML if(abs($a)>5 or abs($b)>5) { $hintvala = $a**3; $hintvalb = $b**3; - $hint = "\text{Hint: }"; + $hint = "Hint: "; if(abs($a)>5) { - $hint .= "$hintvala = $a^3"; + $hint .= '[`[$hintvala] = [$a]^3`].'; } elsif(abs($b)>5) { - $hint .= "$hintvalb = $b^3"; + $hint .= '[`[$hintvalb] = [$b]^3`].'; } -Context()->texStrings; -BEGIN_TEXT -\($hint\) -END_TEXT } +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@$hint@]** + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** + +END_PGML $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring610.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring610.pg index 1bbc1d0828..0b75c9cb16 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring610.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring610.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^3 + b^3 # @@ -16,15 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_sum_diff_cubes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,39 +59,37 @@ $end = $b**2; $question = Formula("$a**3*$var^3+$b^3")->reduce; $ans = Formula("($a*$var+$b)($leading*$var^2+$middle*$var+$end)")->reduce; -############################################## -TEXT(beginproblem()); - -BEGIN_PGML -Factor the given polynomial - - [`[$question]=`] [___________________]{$ans} - -If the expression cannot be factored then answer with *prime*. - -END_PGML - if(abs($a)>5 or abs($b)>5) { $hintvala = $a**3; $hintvalb= $b**3; if(abs($a)<=5 and abs($b)>5) { - $hint = "\text{Hint}: $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvalb]=[$b]^3`].'; } elsif(abs($b)<=5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`].'; } elsif(abs($b)>5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3\text{, } $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`], [`[$hintvalb]=[$b]^3`].'; } -Context()->texStrings; -BEGIN_TEXT -\($hint\) -END_TEXT } +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@$hint@]** + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** + +END_PGML + $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring615.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring615.pg index e054aa6960..ca6b7e9464 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring615.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring615.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^3 - b^3 # @@ -16,15 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_sum_diff_cubes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,38 +59,36 @@ $end = $b**2; $question = Formula("$a**3*$var^3+$b^3")->reduce; $ans = Formula("($a*$var+$b)($leading*$var^2+$middle*$var+$end)")->reduce; -############################################## -TEXT(beginproblem()); - -BEGIN_PGML -Factor the given polynomial - - [`[$question]=`] [___________________]{$ans} - -If the expression cannot be factored then answer with *prime*. - -END_PGML if(abs($a)>5 or abs($b)>5) { $hintvala = $a**3; $hintvalb= $b**3; if(abs($a)<=5 and abs($b)>5) { - $hint = "\text{Hint}: $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvalb]=[$b]^3`].'; } elsif(abs($b)<=5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`].'; } elsif(abs($b)>5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3\text{, } $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`], [`[$hintvalb]=[$b]^3`].'; } -Context()->texStrings; -BEGIN_TEXT -\($hint\) -END_TEXT } +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@$hint@]** + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** + +END_PGML $step = Formula("$a$var")->reduce; BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring620.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring620.pg index 4eb8749823..bd10b1aa65 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring620.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring620.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^3 y^3 + b^3 # @@ -16,16 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_sum_diff_cubes_two_var) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -36,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,18 +61,7 @@ $question = Formula("$a**3*$var1^3$var2^3+$b^3")->reduce; $ans = Formula("($a*$var1$var2+$b)($leading*$var1^2$var2^2+$middle*$var1$var2+$end)")->reduce; $hintval = $b**3; -$hint = "\text{Hint}: $hintval=$b^3" if(abs($b)>5); -############################################## -TEXT(beginproblem()); - -BEGIN_PGML -Factor the given polynomial - - [`[$question]=`] [___________________]{$ans} - -If the expression cannot be factored then answer with *prime*. - -END_PGML +$hint = ""; if(abs($a)>5 or abs($b)>5) { @@ -84,21 +69,31 @@ $hintvala = $a**3; $hintvalb= $b**3; if(abs($a)<=5 and abs($b)>5) { - $hint = "\text{Hint}: $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvalb]=[$b]^3`].'; } elsif(abs($b)<=5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`].'; } elsif(abs($b)>5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3\text{, } $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`], [`[$hintvalb]=[$b]^3`].'; } -Context()->texStrings; -BEGIN_TEXT -\($hint\) -END_TEXT } +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@$hint@]** + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** + + +END_PGML $step = Formula("$a$var1$var2")->reduce; BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring625.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring625.pg index 6cfffd1226..2618c1bdf9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring625.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring625.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^3 - b^3 y^3 # @@ -16,15 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_sum_diff_cubes_two_var) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,39 +59,37 @@ $end = $b**2; $question = Formula("$a**3*$var1^3+$b^3$var2^3")->reduce; $ans = Formula("($a*$var1+$b$var2)($leading*$var1^2+$middle*$var1$var2+$end$var2^2)")->reduce; -############################################## -TEXT(beginproblem()); - -BEGIN_PGML -Factor the given polynomial - - [`[$question]=`] [___________________]{$ans} - -If the expression cannot be factored then answer with *prime*. - -END_PGML - if(abs($a)>5 or abs($b)>5) { $hintvala = $a**3; $hintvalb= $b**3; if(abs($a)<=5 and abs($b)>5) { - $hint = "\text{Hint}: $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvalb]=[$b]^3`].'; } elsif(abs($b)<=5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`].'; } elsif(abs($b)>5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3\text{, } $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`], [`[$hintvalb]=[$b]^3`].'; } -Context()->texStrings; -BEGIN_TEXT -\($hint\) -END_TEXT } +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@$hint@]** + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** + +END_PGML + $step = Formula("$a$var1")->reduce; $stepb = Formula("abs($b)$var2")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring630.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring630.pg index dc26315418..7bfbf5e848 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring630.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring630.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^4 + b^3 x # @@ -16,14 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,39 +59,37 @@ $end = $b**2; $question = Formula("$a**3*$var^4+$b^3$var")->reduce; $ans = Formula("$var($a*$var+$b)($leading*$var^2+$middle*$var+$end)")->reduce; -############################################## -TEXT(beginproblem()); - -BEGIN_PGML -Factor the given polynomial - - [`[$question]=`] [_______________________________]{$ans} - -If the expression cannot be factored then answer with *prime*. - -END_PGML - if(abs($a)>5 or abs($b)>5) { $hintvala = $a**3; $hintvalb= $b**3; if(abs($a)<=5 and abs($b)>5) { - $hint = "\text{Hint}: $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvalb]=[$b]^3`].'; } elsif(abs($b)<=5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`].'; } elsif(abs($b)>5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3\text{, } $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`], [`[$hintvalb]=[$b]^3`].'; } -Context()->texStrings; -BEGIN_TEXT -\($hint\) -END_TEXT } +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [_______________________________]{$ans} + +[@$hint@]** + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** + +END_PGML + $step = Formula("$a$var")->reduce; BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring635.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring635.pg index cb49fc03de..37e45e7a74 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring635.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring635.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^3 + b^3 y^3 # @@ -16,15 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_sum_diff_cubes_two_var) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,40 +61,39 @@ $question = Formula("$a**3*$var1^3+$b^3$var2^3")->reduce; $ans = Formula("($a*$var1+$b$var2)($leading*$var1^2+$middle*$var1$var2+$end$var2^2)")->reduce; -############################################## -TEXT(beginproblem()); - -BEGIN_PGML -Factor the given polynomial - - [`[$question]=`] [_____________________________]{$ans} - -If the expression cannot be factored then answer with *prime*. - -END_PGML - if(abs($a)>5 or abs($b)>5) { $hintvala = $a**3; $hintvalb= $b**3; if(abs($a)<=5 and abs($b)>5) { - $hint = "\text{Hint}: $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvalb]=[$b]^3`].'; } elsif(abs($b)<=5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`].'; } elsif(abs($b)>5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3\text{, } $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`], [`[$hintvalb]=[$b]^3`].'; } -Context()->texStrings; -BEGIN_TEXT -\($hint\) -END_TEXT } +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [_____________________________]{$ans} + +[@$hint@]** + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** + +END_PGML + + $step = Formula("$a$var1")->reduce; $stepb = Formula("abs($b)$var2")->reduce; BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring640.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring640.pg index d72238e28c..b8766c0130 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring640.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring640.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # ac x^2 + (bc+ad) x + bd # @@ -21,15 +21,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_two_step) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -40,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -78,11 +75,11 @@ $ans = Formula("$var($b+$a*$var)*($d+$c*$var)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring645.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring645.pg index ff99f46d2d..68fac096ef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring645.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring645.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # (x + a)^2 - b^2 # @@ -17,14 +17,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +33,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,11 +62,11 @@ $ans = Formula("($var+$c1)($var+$c2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("($var+$a)^2")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring650.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring650.pg index 90c300b87c..d318119410 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring650.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring650.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # e (ac x^4 + (bc+ad) x^2 + bd) # @@ -27,15 +27,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(diff_of_squares_two_step) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -46,7 +43,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -88,11 +85,11 @@ $ans = Formula("$e*(sqrt($a)*$var-sqrt($b))(sqrt($a)*$var+sqrt($b))($a*$var^2+$b TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("$a$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring655.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring655.pg index bcce7ff882..83ee48bdc1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring655.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring655.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # x^n ( a x^3 + b^3 ) # @@ -16,14 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','special products') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,38 +58,36 @@ $end = $b**2; $question = Formula("$a**3*$var^(3+$n)+$b^3$var^$n")->reduce; $ans = Formula("$var^$n($a*$var+$b)($leading*$var^2+$middle*$var+$end)")->reduce; -############################################## -TEXT(beginproblem()); - -BEGIN_PGML -Factor the given polynomial - - [`[$question]=`] [___________________]{$ans} - -If the expression cannot be factored then answer with *prime*. - -END_PGML if(abs($a)>5 or abs($b)>5) { $hintvala = $a**3; $hintvalb= $b**3; if(abs($a)<=5 and abs($b)>5) { - $hint = "\text{Hint}: $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvalb]=[$b]^3`].'; } elsif(abs($b)<=5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`].'; } elsif(abs($b)>5 and abs($a)>5) { - $hint = "\text{Hint}: $hintvala=$a^3\text{, } $hintvalb=$b^3"; + $hint = 'Hint: [`[$hintvala]=[$a]^3`], [`[$hintvalb]=[$b]^3`].'; } -Context()->texStrings; -BEGIN_TEXT -\($hint\) -END_TEXT } +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Factor the given polynomial. + + [`[$question]=`] [___________________]{$ans} + +[@$hint@]** + +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** + +END_PGML $step = Formula("$a$var")->reduce; BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring660.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring660.pg index 4cb8456fdc..0153ce9329 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring660.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring660.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # (x + a)^2 - b^2 y^2 # @@ -17,14 +17,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: special forms) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','difference of squares') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +33,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedFactor.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -63,11 +61,11 @@ $ans = Formula("($var1+$a-$b$var2)($var1+$a+$b$var2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [________________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML $step = Formula("($var1+$a)^2")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring71.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring71.pg index d305b83219..48742686b2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring71.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring71.pg @@ -14,16 +14,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_trinomial) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,8 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -70,11 +66,11 @@ $ans = Formula("$d*($a*$var^2+$b*$var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions('If the expression cannot be factored then answer with [|prime|]*.')@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring76.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring76.pg index 84d20206d4..f34abe2251 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring76.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring76.pg @@ -13,15 +13,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_trinomial) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -31,8 +28,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -68,11 +65,11 @@ $ans = Formula("$d*$var^2($a*$var^2+$b*$var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions('If the expression cannot be factored then answer with [|prime|]*.')@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring77.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring77.pg index 8b24ab98b7..2c1a35cf5e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring77.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring77.pg @@ -13,15 +13,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_trinomial) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -31,8 +28,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -68,11 +65,11 @@ $ans = Formula("$d*$var^3($a*$var^2+$b*$var+$c)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions('If the expression cannot be factored then answer with [|prime|]*.')@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring80.pg index 61ea09154c..a6c03e4128 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring80.pg @@ -13,15 +13,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring trinomials) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_trinomial) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -31,8 +28,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -68,11 +65,11 @@ $ans = Formula("$d*$var($c+$b*$var+$a*$var^2)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions('If the expression cannot be factored then answer with [|prime|]*.')@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring85.pg index e4f62aa644..8b7a034382 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring85.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring85.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^2 + b # @@ -18,15 +18,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(factor_gcf_binomial) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -38,7 +35,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedFactor.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -58,23 +55,20 @@ Context()->noreduce('(-x)-y', '(-x)+y'); # the common term -$a = 2; -$b = 6; -while(gcf($a,$b)!=1) -{ +do { $a = random(2,30,1); $b = random(2,30,1)*random(-1,1,2); -} +} until (gcf($a,$b)==1 and $b != -4 and $b != -9 and $b != -16 and $b != -25); $ans = Compute("prime"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$a][$var]^2+[$b]=`] [___________________] -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions('If the expression cannot be factored then answer with [|prime|]*.')@]** END_PGML ANS($ans->cmp(typeMatch=>Formula("$a $var^2+$b"))->withPostFilter(AnswerHints( Formula("$a $var^2+$b") => "Are you trying to say that the polynomial is *prime*?" diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring90.pg index 84cdf15884..a659647678 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring90.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a xy + a y # @@ -15,16 +15,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(common_factors_binomials_two_var) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,8 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -66,11 +62,11 @@ $ans = Formula("$a*$var2($var1+1)"); TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions('If the expression cannot be factored then answer with [|prime|]*.')@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring95.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring95.pg index 715a40f426..5253cc8829 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring95.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoring95.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Factor the given polynomial +# Factor the given polynomial. # # a x^n y^m + a * b y^m # @@ -16,15 +16,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Factoring) -## DBsection(Factoring: common factors) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(common_factors_binomials_multi_var) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','greatest common factor','multivariable') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,8 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "contextLimitedFactor.pl", - "PGcourse.pl" +"contextLimitedFactor.pl", + "PGcourse.pl", ); ############################################## @@ -67,11 +64,11 @@ $ans = Formula("$a*$var2^$m($var1^$n+$b)")->reduce; TEXT(beginproblem()); BEGIN_PGML -Factor the given polynomial +Factor the given polynomial. [`[$question]=`] [___________________]{$ans} -If the expression cannot be factored then answer with *prime*. +[@KeyboardInstructions("If the expression cannot be factored then answer with [|prime|]*.")@]** END_PGML BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoringStrategies.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoringStrategies.pg new file mode 100644 index 0000000000..cbe02e009d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Factoring/factoringStrategies.pg @@ -0,0 +1,163 @@ +DOCUMENT(); +loadMacros("PGstandard.pl","MathObjects.pl","PGML.pl","PGchoicemacros.pl","PGcourse.pl",); +TEXT(beginproblem()); +loadMacros("PCCmacros.pl"); + + + +Context()->noreduce('(-x)+y'=>0,'(-x)-y'=>0); +do{$x=RandomVariableName();$y=RandomVariableName();}until($x ne $y); +Context()->variables->are($x=>'Real',$y=>'Real'); + +$b_gcf = list_random(0,1); +$gcf_v = list_random(0,random(1,3,1)); +$b_ac = list_random(0,1); +$b_mv = list_random(0,1); + +$main = list_random('grouping', 'trinomial-product', 'diff-squares', 'diff-cubes', 'sum-cubes', 'perfect-square', 'prime'); + +# Make expanded (ax + b)(cx + d). +# At first, guarantee the gcd(a,b) and gcd(c,d) are 1, and the two roots are distinct. +# If grouping, will make it x^(gcf_v) (ax^2 + b)(cx + d). +# If diff-squares, use (ax + b)(ax - b) +# If diff-cubes, use (ax - b)(ax^2 + abx + b) +# If sum-cubes, use (ax + b)(ax^2 - abx + b) +# If perfect-square, use (ax + b)(ax + b) +# If prime, use (ax + b) + +# If b_gcf, multiply by x^(gcf_v) + +do{ + $a = ($b_ac) ? random(2,9,1) : 1; + $b = random(1,9,1)*(-1)**(random(-1,1,2)); + $c = ($b_ac) ? random(1,9,1) : 1; + $d = random(1,9,1)*(-1)**(random(-1,1,2)); +} until (gcd($a,$b) == 1 and gcd($c,$d) == 1 and $a*$d != $b*$c); + + +if ($main eq 'diff-squares') {$c=$a;$d=-$b}; +if ($main eq 'perfect-square') {$c=$a;$d=$b}; +if ($main eq 'diff-cubes') {$b=-abs($b)}; +if ($main eq 'sum-cubes') {$b=abs($b)}; +if ($main eq 'prime') {$c=abs($c);$d=abs($d)}; #$c and $d used as exponents + + + +if ($main eq 'grouping') { + if ($b_mv == 0) { + if ($b_gcf == 0) {$p = Formula("$a*$c $x^3+$a*$d $x^2 +$b*$c $x + $b*$d")->reduce->reduce;} + else { + $g = random(2,9,1); + $p = Formula("$g*$a*$c $x^(3+$gcf_v)+$g*$a*$d $x^(2+$gcf_v) +$g*$b*$c $x^(1+$gcf_v) + $g*$b*$d $x^($gcf_v)")->reduce->reduce; + }; + } + else { + if ($b_gcf == 0) {$p = Formula("$a*$c $x $y+$a*$d $x+$b*$c $y + $b*$d")->reduce->reduce;} + else { + $g = random(2,9,1); + $p = Formula("$g*$a*$c $x^(1+$gcf_v) $y+$g*$a*$d $x^(1+$gcf_v)+$g*$b*$c $x^($gcf_v) $y + $g*$b*$d $x^($gcf_v) ")->reduce->reduce; + }; + }; +}; + + + +if ($main eq 'trinomial-product' or $main eq 'diff-squares' or $main eq 'perfect-square') { + if ($b_mv == 0) { + if ($b_gcf == 0) {$p = Formula("$a*$c $x^2+($a*$d+$b*$c) $x + $b*$d")->reduce->reduce;} + else { + $g = random(2,9,1); + $p = Formula("$g*$a*$c $x^(2+$gcf_v)+$g*($a*$d+$b*$c) $x^(1+$gcf_v) + $g*$b*$d $x^($gcf_v)")->reduce->reduce; + }; + } + else { + if ($b_gcf == 0) {$p = Formula("$a*$c $x^2+($a*$d+$b*$c) $x $y + $b*$d $y^2")->reduce->reduce;} + else { + $g = random(2,9,1); + $p = Formula("$g*$a*$c $x^(2+$gcf_v) + $g*($a*$d+$b*$c) $x^(1+$gcf_v) $y + $g*$b*$d $x^($gcf_v) $y^2")->reduce->reduce; + }; + }; +}; + + +if ($main eq 'diff-cubes' or $main eq 'sum-cubes') { + if ($b_mv == 0) { + if ($b_gcf == 0) {$p = Formula("$a^3 $x^3+$b^3")->reduce->reduce;} + else { + $g = random(2,9,1); + $p = Formula("$g*$a^3 $x^(3+$gcf_v)+$g*$b^3 $x^($gcf_v)")->reduce->reduce; + }; + } + else { + if ($b_gcf == 0) {$p = Formula("$a^3 $x^3+$b^3 $y^3")->reduce->reduce;} + else { + $g = random(2,9,1); + $p = Formula("$g*$a^3 $x^(3+$gcf_v)+$g*$b^3$x^($gcf_v) $y^3")->reduce->reduce; + }; + }; +}; + +if ($main eq 'prime') { + if ($b_mv == 0) { + if ($b_gcf == 0) {$p = Formula("$a $x+$b")->reduce->reduce;} + else { + $g = random(2,9,1); + $p = Formula("$g*$a $x^(1+$gcf_v)+$g*$b $x^($gcf_v)")->reduce->reduce; + }; + } + else { + if ($b_gcf == 0) {$p = Formula("$a $x^($c)+$b $y^($d)")->reduce->reduce;} + else { + $g = random(2,9,1); + $p = Formula("$g*$a $x^($c+$gcf_v)+$g*$b $x^($gcf_v) $y^($d)")->reduce->reduce; + }; + }; +}; + +@answers = ( +"Factoring out a GCF$BR", +"Factoring by grouping$BR", +"Finding two numbers that multiply to the constant term and sum to the linear coefficient$BR", +"The AC Method$BR", +"Difference of Squares$BR", +"Difference of Cubes$BR", +"Sum of Cubes$BR", +"Perfect Square Trinomial$BR", +"None of the above$BR" +); + +@correct = (); +push @correct,$answers[0] if ($b_gcf); +push @correct,$answers[1] if ($main eq 'grouping'); +push @correct,$answers[2] if ($main eq 'trinomial-product' and not($b_ac)); +push @correct,$answers[3] if ($main eq 'trinomial-product' and $b_ac); +push @correct,$answers[4] if ($main eq 'diff-squares'); +push @correct,$answers[5] if ($main eq 'diff-cubes'); +push @correct,$answers[6] if ($main eq 'sum-cubes'); +push @correct,$answers[7] if ($main eq 'perfect-square'); +push @correct,$answers[8] if ($main eq 'prime' and not($b_gcf)); + +$mc = new_checkbox_multiple_choice(); +Context()->texStrings; +$mc -> qa ("In factoring \($p\), which factoring techniques/tools will be useful? Check all that apply.", +@correct +); +$mc -> extra( +@answers +); +$mc -> makeLast(@answers); +Context()->normalStrings; + +BEGIN_PGML +Which factoring techniques/tools will be useful for factoring the polynomial below? Check all that apply. +[@ $mc -> print_a() @]* + +[`[$p]`] + +END_PGML + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions02.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions02.pg index 886ddc1e1b..ad0fa8dc20 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions02.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions02.pg @@ -8,16 +8,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('add','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_same_denom) -## Level(2) -## KEYWORDS('add','fraction') ############################################## @@ -29,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -60,9 +65,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -88,3 +93,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions04.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions04.pg index fce2cdd9d5..bde2ca395c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions04.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions04.pg @@ -9,16 +9,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('add','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_same_denom) -## Level(2) -## KEYWORDS('add','fraction') ############################################## @@ -30,7 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -61,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -89,3 +94,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions06.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions06.pg index 605b7b045a..0fd90fee09 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions06.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions06.pg @@ -8,17 +8,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('add','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_same_denom) -## Level(2) -## MO(1) -## KEYWORDS('add','fraction') ############################################## @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,7 +64,7 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] [___________] @@ -111,3 +114,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions08.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions08.pg index 78852e8c55..b27781c726 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions08.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions08.pg @@ -8,16 +8,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('add','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_same_denom) -## Level(2) -## KEYWORDS('add','fraction') ############################################## @@ -29,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -65,9 +70,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$fracAns} @@ -98,3 +103,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions09.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions09.pg index f3feaa4d50..bbc75acee4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions09.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions09.pg @@ -9,16 +9,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('add','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_diff_denom) -## Level(2) -## KEYWORDS('add','fraction') ############################################## @@ -30,7 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -66,9 +71,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$fracAns} @@ -98,3 +103,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions10.pg index 20887f5291..d2c8d7eeec 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions10.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -63,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -102,3 +105,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions12.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions12.pg index 22c248b672..c2fb06782b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions12.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions12.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -65,9 +68,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -107,3 +110,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions20.pg index ddc4499816..ef8927a3b5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -63,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [__________]{$ans} @@ -107,3 +110,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions22.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions22.pg index c79b8bed1e..f9bc7d6ca4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions22.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions22.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -63,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [__________]{$ans} @@ -105,3 +108,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions24.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions24.pg index b0702dd3d2..c9e1f9670c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions24.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions24.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') - +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -65,9 +67,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [__________]{$ans} @@ -112,3 +114,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions26.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions26.pg index e3f0c62533..e72ec161aa 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions26.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions26.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -63,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [__________]{$ans} @@ -110,3 +113,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions30.pg index 083d42b6b0..8b57a96d05 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions30.pg @@ -9,17 +9,21 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('add','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) -## KEYWORDS('add','fraction') ############################################## @@ -30,7 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -61,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -89,3 +94,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions40.pg index 75dfa27242..8d9d4cef3b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions40.pg @@ -9,16 +9,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('add','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtractRationalSameDenominators) -## Level(2) -## KEYWORDS('add','fraction') @@ -31,7 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -62,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -90,3 +94,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions50.pg index 58da6bc941..2cb33b96b4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions50.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -71,9 +74,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -112,3 +115,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions60.pg index aca3b3cd3d..deb8593a94 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions60.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -71,9 +74,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -113,3 +116,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions70.pg index e11d0bb5f9..71c35346b6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions70.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(add_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -70,9 +73,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [__________]{$ans} @@ -114,3 +117,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions80.pg index 3581c6b51a..9072363478 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions80.pg @@ -9,16 +9,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('add','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) -## KEYWORDS('add','fraction') ############################################## DOCUMENT(); @@ -28,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -69,9 +73,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two fractions: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] +Add: [``-\frac{[$num1]}{[$den1]} + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [__________]{$ans} @@ -116,3 +120,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions90.pg index 1b842b0ce5..d9d3cbee3c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddFractions90.pg @@ -7,17 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('add','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(addRationalToInteger) -## MLTleader(1) -## Level(2) -## KEYWORDS('add','fraction') ############################################## DOCUMENT(); @@ -27,7 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -59,9 +62,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add these together: [`` [$integer] + \frac{[$num2]}{[$den2]}``] +Add: [`` [$integer] + \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddingFractionsOfInches10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddingFractionsOfInches10.pg index 0a0a94313a..321260d0e6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddingFractionsOfInches10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/AddingFractionsOfInches10.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Operations with Fractions') +## DBsection('Adding Fractions') ## KEYWORDS('fractions') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -28,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions10.pg index 406645290d..e4833216bb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions10.pg @@ -8,16 +8,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('divide','fraction') ## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Division) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_division) -## Level(2) -## KEYWORDS('divide','fraction') ############################################## @@ -29,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -41,10 +46,10 @@ Context()->flags->set(showMixedNumbers=>0); do { $num1 = random(1,5,1); - do {$den1 = random($num1,10,1);} until (gcd($num1,$den1)==1); + do {$den1 = random($num1+1,10,1);} until (gcd($num1,$den1)==1); do {$num2 = random(2,5,1);} until (gcd($num2,$den1)==1); - do {$den2 = random($num2,10,1);} until (gcd($den2,$num2)==1); + do {$den2 = random($num2+1,10,1);} until (gcd($den2,$num2)==1); } until (gcd($den2,$num1)==1); $frac1 = Fraction($num1,$den1); @@ -61,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Divide one fraction into the other: [`` \frac{[$num1]}{[$den1]} \div \frac{[$den2]}{[$num2]} ``] +Divide: [`` \frac{[$num1]}{[$den1]} \div \frac{[$den2]}{[$num2]} ``] -If needed, use an improper fraction in your answer. Don’t use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [_________]{$ans} @@ -77,7 +82,7 @@ When we do division with fractions, as with [``\frac{[$num1]}{[$den1]} \div \frac{[$den2]}{[$num2]} ``] -we first change division to multiplication by flipping the second fraction. In this case, we have +we first change division to multiplication, and at the same time flip the second fraction. In this case, we have [``\frac{[$num1]}{[$den1]} \cdot \frac{[$num2]}{[$den2]} ``] @@ -97,3 +102,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions20.pg index 65391d767c..332593be76 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions20.pg @@ -7,17 +7,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('divide','fraction') ## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Division) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(dividingTwoRationals) -## MLTleader(1) -## Level(2) -## KEYWORDS('divide','fraction') ############################################## @@ -29,7 +32,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -65,9 +69,9 @@ TEXT(beginproblem()); BEGIN_PGML -Divide one fraction into the other: [`` \frac{[$num1]}{[$den1]} \div \left(-\frac{[$den2]}{[$num2]}\right) ``] +Divide: [`` \frac{[$num1]}{[$den1]} \div \left(-\frac{[$den2]}{[$num2]}\right) ``] -If needed, use an improper fraction in your answer. Don’t use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [_________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions30.pg index b14d42102a..81e4e1f230 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions30.pg @@ -8,16 +8,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('divide','fraction') ## DBCCSS('5.NF.4.a','4.NF.4.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Division) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(DivideIntegerByFraction) -## Level(2) -## KEYWORDS('divide','fraction') ############################################## @@ -29,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -56,9 +61,9 @@ TEXT(beginproblem()); BEGIN_PGML -Divide the integer by the fraction: [``[$integer] \div \frac{[$den]}{[$num]} ``] +Divide: [``[$integer] \div \frac{[$den]}{[$num]} ``] -If needed, use an improper fraction in your answer. Don’t use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -95,3 +100,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions40.pg index 07c9785494..9dc71b9e7a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions40.pg @@ -7,16 +7,20 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.4.a','4.NF.4.b') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Division) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('divide','fraction') +## DBCCSS('5.NF.4.a','4.NF.4.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## MLT(divideRationalByInteger) ############################################## @@ -28,7 +32,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -58,9 +63,9 @@ TEXT(beginproblem()); BEGIN_PGML -Divide the fraction by the integer: [``-\frac{[$num]}{[$den]} \div (-[$integer]) ``] +Divide: [``-\frac{[$num]}{[$den]} \div (-[$integer]) ``] -If needed, use an improper fraction in your answer. Don’t use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -102,3 +107,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions50.pg index f6c85f8055..5ec070f64b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/DivideFractions50.pg @@ -7,18 +7,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('divide','fraction') ## DBCCSS('5.NF.4.a','4.NF.4.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Division) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(DivideIntegerByFraction) -## MLTleader(1) -## Level(2) -## MO(1) -## KEYWORDS('divide','fraction') ############################################## @@ -30,7 +32,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -58,9 +61,9 @@ TEXT(beginproblem()); BEGIN_PGML -Divide the integer by the fraction: [``[$integer] \div \frac{[$den]}{[$num]} ``] +Divide: [``[$integer] \div \frac{[$den]}{[$num]} ``] -If needed, use an improper fraction in your answer. Don’t use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________] @@ -92,11 +95,11 @@ When we do fraction multiplication/division, we need to rewrite any integer as a [``[$integer] = \frac{[$integer]}{1} ``] -Next, we change division to multiplication by flipping the second fraction. In this case, we end up with +Next, we change division to multiplication, and at the same time flip the second fraction. In this case, we have [``\frac{[$integer]}{1} \cdot \frac{[$num]}{[$den]} ``] -Finally we do the fraction multiplication. The full process is: +Next, we do the fraction multiplication. The full process is: [`` \begin{aligned} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MixedNumberDivision10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MixedNumberDivision10.pg index 71bd3d9c55..516accf761 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MixedNumberDivision10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MixedNumberDivision10.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_division) -## Level(3) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('divide','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -74,8 +76,6 @@ Divide the following: [``[$frac1] \div [$frac2] ``] [___________]{$ans} -Be certain to express your answer in simplest form. - END_PGML ############################################## @@ -120,3 +120,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MixedNumberMultiplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MixedNumberMultiplication10.pg index 1349d5adb1..2b4c7ed0c9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MixedNumberMultiplication10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MixedNumberMultiplication10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -68,7 +72,7 @@ $ansDen = $ans[1]; TEXT(beginproblem()); BEGIN_PGML -Multiply the following: [``[$frac1] \cdot [$frac2] ``] +Multiply: [``[$frac1] \cdot [$frac2] ``] [___________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions10.pg index 9194e60276..abb58311b2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions10.pg @@ -9,16 +9,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('multiply','fraction') ## DBCCSS('5.NF.4.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_fraction_multiplication) -## Level(2) -## KEYWORDS('multiply','fraction') ############################################## @@ -30,7 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -61,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply these two fractions: [`` \frac{[$num1]}{[$den1]} \cdot \frac{[$num2]}{[$den2]} ``] +Multiply: [`` \frac{[$num1]}{[$den1]} \cdot \frac{[$num2]}{[$den2]} ``] -If needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [_______]{$ans} @@ -90,3 +95,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions20.pg index a78d62aab0..c4b2cfbcf2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions20.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.4.a') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_fraction_multiplication) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','fraction') +## DBCCSS('5.NF.4.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -61,9 +64,9 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply these two fractions: [`` \frac{[$num1]}{[$den1]} \cdot \frac{[$num2]}{[$den2]} ``] +Multiply: [`` \frac{[$num1]}{[$den1]} \cdot \frac{[$num2]}{[$den2]} ``] -If needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [__________]{$ans} @@ -96,3 +99,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions30.pg index e9c31b19ad..5e68572b68 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions30.pg @@ -8,17 +8,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('multiply','fraction') ## DBCCSS('5.NF.4.a','4.NF.4.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multIntegerWithRational) -## MLTleader(1) -## Level(2) -## KEYWORDS('multiply','fraction') ############################################## @@ -30,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -58,9 +62,9 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply the integer with the fraction: [``[$integer]\cdot \frac{[$num]}{[$den]} ``] +Multiply: [``[$integer]\cdot \frac{[$num]}{[$den]} ``] -If needed, use an improper fraction in your answer. Don’t use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions40.pg index 487cb364d7..e5dcd14465 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions40.pg @@ -8,17 +8,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('multiply','fraction','negative') ## DBCCSS('5.NF.4.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multiplyingTwoRationals) -## MLTleader(1) -## Level(2) -## KEYWORDS('multiply','fraction','negative') ############################################## @@ -30,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -69,9 +73,9 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply these two fractions: [``-\frac{[$num1]}{[$den1]} \cdot \frac{[$num2]}{[$den2]}``] +Multiply: [``-\frac{[$num1]}{[$den1]} \cdot \frac{[$num2]}{[$den2]}``] -If needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [_________]{$ans} @@ -99,3 +103,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions50.pg index 8fbe2e94cb..b469b03585 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions50.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.4.a','4.NF.4.b') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multIntegerWithRational) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','fraction','negative') - +## DBCCSS('5.NF.4.a','4.NF.4.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -33,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -60,9 +61,9 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply the integer with the fraction: [``[$integer]\cdot\left( -{\frac{[$num]}{[$den]}} \right)``] +Multiply: [``[$integer]\cdot\left( -{\frac{[$num]}{[$den]}} \right)``] -If needed, use an improper fraction in your answer. Don’t use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [_________] @@ -109,3 +110,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions60.pg index d1d1d57128..4080e54053 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions60.pg @@ -8,16 +8,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('multiply','fraction','negative') ## DBCCSS('5.NF.4.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(basic_fraction_multiplication) -## Level(2) -## KEYWORDS('multiply','fraction','negative') ############################################## @@ -29,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -77,9 +82,9 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply these two fractions: [``-\frac{[$num1]}{[$den1]} \cdot \left(-\frac{[$num2]}{[$den2]}\right)``] +Multiply: [``-\frac{[$num1]}{[$den1]} \cdot \left(-\frac{[$num2]}{[$den2]}\right)``] -If needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [_________]{$ans} @@ -108,3 +113,4 @@ ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions70.pg index 824b050a2a..48898a5f18 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions70.pg @@ -8,17 +8,21 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('multiply','fraction') ## DBCCSS('5.NF.4.a','4.NF.4.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multIntegerWithRational) -## Level(2) -## KEYWORDS('multiply','fraction') ############################################## @@ -29,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -58,9 +63,9 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply the integer with the fraction: [``-[$integer]\cdot \frac{[$num]}{[$den]} ``] +Multiply: [``-[$integer]\cdot \frac{[$num]}{[$den]} ``] -If needed, use an improper fraction in your answer. Don’t use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -94,3 +99,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions80.pg index 79a27a85b5..77a0417761 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/MultiplyFractions80.pg @@ -10,18 +10,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('multiply','fraction') ## DBCCSS('5.NF.4.a','4.NF.4.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multiplyIntegerWithRational) -## MLTleader(1) -## Level(2) -## MO(1) -## KEYWORDS('multiply','fraction') ############################################## @@ -33,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,13 +63,15 @@ TEXT(beginproblem()); BEGIN_PGML -Do the following multiplications: - - [`` [$integer1] \cdot \frac{[$num]}{[$den]} = ``] [___________] +Do the following multiplications. +a. [` [$integer1] \cdot \frac{[$num]}{[$den]} `] + [___________] - [`` [$integer2] \cdot \frac{[$num]}{[$den]} = ``] [___________] +a. [` [$integer2] \cdot \frac{[$num]}{[$den]} `] + [___________] - [`` [$integer3] \cdot \frac{[$num]}{[$den]} = ``] [___________] +a. [` [$integer3] \cdot \frac{[$num]}{[$den]} `] + [___________] END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions01.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions01.pg index bb19ee7858..822bb17a10 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions01.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions01.pg @@ -9,16 +9,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('subtract','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) -## KEYWORDS('subtract','fraction') ############################################## @@ -30,7 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -61,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] +Subtract: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -87,3 +92,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions02.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions02.pg index ab1a8e89c8..22de77207e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions02.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions02.pg @@ -9,16 +9,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('subtract','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_same_denom) -## Level(2) -## KEYWORDS('subtract','fraction') ############################################## @@ -30,7 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -61,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] +Subtract: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -89,3 +94,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions05.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions05.pg index 816af49c43..07342e2e4a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions05.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions05.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -65,9 +68,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] +Subtract: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$fracAns} @@ -96,3 +99,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions06.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions06.pg index 6e998f3797..f7fe649186 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions06.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions06.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_same_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -65,9 +68,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] +Subtract: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$fracAns} @@ -96,3 +99,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions10.pg index 0a8f3e4df5..35eef35a08 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions10.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -71,9 +74,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] +Subtract: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -112,3 +115,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions100.pg index 18cd5b4caf..5176df682c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions100.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtractRationalFromInteger) -## MLTleader(1) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -61,9 +63,9 @@ TEXT(beginproblem()); BEGIN_PGML -Carry out the subtraction: [`` [$integer] - \frac{[$num2]}{[$den2]}``] +Subtract: [`` [$integer] - \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions110.pg index 1562e89504..a096fd743f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions110.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtractRationalFromInteger) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','fraction') - +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -61,9 +63,9 @@ TEXT(beginproblem()); BEGIN_PGML -Carry out the subtraction: [`` [$integer] - \frac{[$num2]}{[$den2]}``] +Subtract: [`` [$integer] - \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions20.pg index fd464d8128..59d666d0e6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -63,9 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] +Subtract: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [__________]{$ans} @@ -107,3 +110,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions30.pg index a276baadb5..19f78107e0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions30.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -71,9 +74,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] +Subtract: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions40.pg index 0f333c35c1..2d1498d944 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions40.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -69,9 +72,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] +Subtract: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [__________]{$ans} @@ -115,3 +118,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions50.pg index f6ae35bbc1..a9ecae20da 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions50.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -69,9 +72,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] +Subtract: [``\frac{[$num1]}{[$den1]} - \frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [__________]{$ans} @@ -116,3 +119,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions60.pg index cccd0ae376..e2e20f26e0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions60.pg @@ -8,17 +8,21 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('subtract','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) -## KEYWORDS('subtract','fraction') ############################################## @@ -29,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -70,9 +75,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``-\frac{[$num1]}{[$den1]}-\frac{[$num2]}{[$den2]}``] +Subtract: [``-\frac{[$num1]}{[$den1]}-\frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [_______]{$ans} @@ -114,3 +119,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions70.pg index 562114e055..638e0c8b18 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions70.pg @@ -8,17 +8,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('subtract','fraction') ## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_same_denom) -## Level(2) -## KEYWORDS('subtract','fraction') ############################################## @@ -30,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -69,9 +73,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``-\frac{[$num1]}{[$den1]}-\frac{[$num2]}{[$den2]}``] +Subtract: [``-\frac{[$num1]}{[$den1]}-\frac{[$num2]}{[$den2]}``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [_______]{$ans} @@ -115,3 +119,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions80.pg index 1a92c67838..bb9133d1e3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions80.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_same_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -61,9 +64,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``\frac{[$num1]}{[$den1]} - \left(-\frac{[$num2]}{[$den2]}\right)``] +Subtract: [``\frac{[$num1]}{[$den1]} - \left(-\frac{[$num2]}{[$den2]}\right)``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -92,3 +95,5 @@ The answer to this question is [``\frac{[$numAns]}{[$denAns]}``]. END_PGML_SOLUTION ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions90.pg index 08cbb6d857..2ca4f6119c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionArithmetic/SubtractFractions90.pg @@ -10,16 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(subtract_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -71,9 +74,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract one fraction from the other: [``-\frac{[$num1]}{[$den1]} - \left(-\frac{[$num2]}{[$den2]}\right)``] +Subtract: [``-\frac{[$num1]}{[$den1]} - \left(-\frac{[$num2]}{[$den2]}\right)``] -When needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("When needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [__________]{$ans} @@ -122,3 +125,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal10.pg index 02cdd4dfd0..a25069316b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal10.pg @@ -8,17 +8,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') +## KEYWORDS('fraction','decimal') ## DBCCSS('7.NS.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(rationalToDecimal) -## MLTleader(1) -## Level(2) -## KEYWORDS('fraction','decimal') ############################################## @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal20.pg index 584b922d49..d697db94e9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal20.pg @@ -8,18 +8,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') +## KEYWORDS('fraction','decimal','round') ## DBCCSS('7.NS.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Estimation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(rationalToDecimal) -## MLTleader(1) -## Level(2) -## MO(1) -## KEYWORDS('fraction','decimal','round') @@ -33,7 +34,7 @@ loadMacros( "PGML.pl", "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal30.pg index eb1b81a7a1..ad51b01c89 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal30.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') +## KEYWORDS('fraction','decimal') ## DBCCSS('7.NS.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(rationalToDecimal) -## Level(2) -## KEYWORDS('fraction','decimal') @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal40.pg index 145f8cea44..a9b1d91735 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/FractionToDecimal40.pg @@ -8,17 +8,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') +## KEYWORDS('fraction','decimal') ## DBCCSS('7.NS.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(rationalToDecimal) -## Level(2) -## MO(1) -## KEYWORDS('fraction','decimal') @@ -32,7 +34,7 @@ loadMacros( "PGML.pl", "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber10.pg index 7ef4ddad64..2b1b76534f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber10.pg @@ -7,17 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('improper','fraction','mixed number') ## DBCCSS('4.NF.3.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(improper_to_mixed) -## Level(2) -## MO(1) -## KEYWORDS('improper','fraction','mixed number') @@ -30,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber20.pg index 8386101d41..724ed273e1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber20.pg @@ -7,17 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('improper','fraction','mixed number') ## DBCCSS('4.NF.3.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(improper_to_mixed) -## Level(2) -## MO(1) -## KEYWORDS('improper','fraction','mixed number') @@ -30,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction10.pg index fd3aa84ce4..04f3077770 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction10.pg @@ -7,17 +7,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('improper','fraction','mixed number') ## DBCCSS('4.NF.3.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(mixed_to_improper) -## Level(2) -## MO(1) -## KEYWORDS('improper','fraction','mixed number') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -83,3 +86,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction20.pg index f87cbd877d..0074b96539 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction20.pg @@ -7,18 +7,21 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('improper','fraction','mixed number') ## DBCCSS('4.NF.3.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(mixed_to_improper) -## Level(2) -## MO(1) -## KEYWORDS('improper','fraction','mixed number') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -82,3 +85,4 @@ We keep the same denominator as the original mixed number, and so the final answ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction05.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction05.pg index 78f9d6d971..37c3b7c2b1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction05.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction05.pg @@ -7,17 +7,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('fraction','reduce') ## DBCCSS('3.NF.3.b','4.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Reducing fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(reduceRational) -## MLTleader(1) -## Level(2) -## KEYWORDS('fraction','reduce') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction10.pg index a619c52f00..1d59e09f2e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction10.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('fraction','reduce') ## DBCCSS('3.NF.3.b','4.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Reducing fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(reduceRational) -## Level(2) -## KEYWORDS('fraction','reduce') @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction20.pg index 00131b2c4e..701f91f522 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction20.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('fraction','reduce') ## DBCCSS('3.NF.3.b','4.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Reducing fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(reduceRational) -## Level(2) -## KEYWORDS('fraction','reduce') @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction30.pg index 0788000898..e0aef47e36 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction30.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('improper','fraction','reduce') ## DBCCSS('4.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Reducing fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(reduceRational) -## Level(2) -## KEYWORDS('improper','fraction','reduce') @@ -29,7 +32,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", + "PCCmacros.pl", ); ############################################## @@ -145,7 +149,7 @@ TEXT(beginproblem()); BEGIN_PGML -Reduce the fraction [`` \frac{[$num1]}{[$den1]} ``]. Leave the result as an improper fraction, not a mixed number. +Reduce the fraction [`` \frac{[$num1]}{[$den1]} ``]. [@KeyboardInstructions('Leave the result as an improper fraction, not a mixed number.')@]** [_______]{$frac} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction40.pg index 1159957a49..12302276bc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction40.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.NF.3.b','4.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Reducing fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(reduceRational) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('fraction','reduce') +## DBCCSS('3.NF.3.b','4.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -33,7 +34,7 @@ loadMacros( "PGML.pl", "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/DataFromTable10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/DataFromTable10.pg index 2760e470d3..26362db5f6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/DataFromTable10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/DataFromTable10.pg @@ -5,16 +5,18 @@ # Last edited: Carl Yao 2/8/2017 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('function') ##DBCCSS('8.F.4,F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) -## MO(1) -## KEYWORDS('function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -41,27 +43,34 @@ TEXT(beginproblem()); Context("Numeric"); do { - $x1 = random(1,11,1); + $x1 = random(1,7,1); $x2 = random(1,5,1); } until ($x1 != $x2); -$x3 = 12-$x2; +$x3 = 7-$x2; @data = ( ); -for my $i (0..12) { - $data[$i]=int(sin(pi/12*$i)*100); - if ( ($i!=$x2) && ($i!=$x3) && ($i!=0) && ($i!=12) ) {$data[$i] += random(-5,5,1);} +for my $i (0..7) { + $data[$i]=int(sin(pi/7*$i)*100); + if ( ($i!=$x2) && ($i!=$x3) && ($i!=0) && ($i!=7) ) {$data[$i] += random(-5,5,1);} } $y1 = $data[$x1]; $y2 = $data[$x2]; $y3 = $data[$x3]; +$werey1 = ($y1 == 1) ? 'was' : 'were'; +$werex1 = ($x1 == 1) ? 'was' : 'were'; +$customersy1 = ($y1 == 1) ? 'customer' : 'customers'; +$customersx1 = ($x1 == 1) ? 'customer' : 'customers'; +$hoursx1 = ($x1 == 1) ? 'hour' : 'hours'; +$hoursy1 = ($y1 == 1) ? 'hour' : 'hours'; + @answers1 = ( - "There were ".math_ev3($y1)." customers in the store ".math_ev3($x1)." hours after the store opened.", - "There were ".math_ev3($x1)." customers in the store ".math_ev3($y1)." hours after the store opened.", - "In ".math_ev3($x1)." hours since the store opened, there were a total of ".math_ev3($y1)." customers.", - "In ".math_ev3($x1)." hours since the store opened, the store had an average of ".math_ev3($y1)." customers per hour.", + "There $werey1 ".math_ev3($y1)." $customersy1 in the store ".math_ev3($x1)." $hoursx1 after the store opened.", + "There $werex1 ".math_ev3($x1)." $customersx1 in the store ".math_ev3($y1)." $hoursy1 after the store opened.", + "In ".math_ev3($x1)." $hoursx1 since the store opened, there were a total of ".math_ev3($y1)." $customersy1.", + "In ".math_ev3($x1)." $hoursx1 since the store opened, the store had an average of ".math_ev3($y1)." $customersy1 per hour.", ); #Create a hash and its inverse that randomizes the order of the four graphs. @@ -86,11 +95,13 @@ $radio1 = RadioButtons( $ans3 = List($x2,$x3); +($earlier, $later) = (min($x2,$x3), max($x2,$x3)); + @answers2 = ( - "There were ".math_ev3($y2)." customers in the store ".math_ev3($x2)." hours after the store opened, and again ".math_ev3($x3)." hours after the store opened.", + "There were ".math_ev3($y2)." customers in the store ".math_ev3($earlier)." hours after the store opened, and again ".math_ev3($later)." hours after the store opened.", "There were ".math_ev3($y2)." customers in the store ".math_ev3($x3)." hours after the store opened.", "There were ".math_ev3($y2)." customers in the store ".math_ev3($x2)." hours after the store opened.", - "There were ".math_ev3($y2)." customers in the store either ".math_ev3($x2)." hours after the store opened, or ".math_ev3($x3)." hours after the store opened.", + "There were ".math_ev3($y2)." customers in the store either ".math_ev3($earlier)." hours after the store opened, or ".math_ev3($later)." hours after the store opened.", ); #Create a hash and its inverse that randomizes the order of the four graphs. @@ -118,7 +129,7 @@ $radio2 = RadioButtons( BEGIN_PGML -The function [`C`] models the number of customers that are in a store [`t`] hours after the store opened on a certain day. +The function [`C`] models the the number of customers in a store [`t`] hours since the store opened. [@DataTable( [ @@ -131,11 +142,6 @@ The function [`C`] models the number of customers that are in a store [`t`] hour [PF('[`5`]'),], [PF('[`6`]'),], [PF('[`7`]'),], - [PF('[`8`]'),], - [PF('[`9`]'),], - [PF('[`10`]'),], - [PF('[`11`]'),], - [PF('[`12`]'),], ], [[PF('[`C(t)`]')], [PF('[`[$data[0]]`]'),], @@ -146,29 +152,25 @@ The function [`C`] models the number of customers that are in a store [`t`] hour [PF('[`[$data[5]]`]'),], [PF('[`[$data[6]]`]'),], [PF('[`[$data[7]]`]'),], - [PF('[`[$data[8]]`]'),], - [PF('[`[$data[9]]`]'),], - [PF('[`[$data[10]]`]'),], - [PF('[`[$data[11]]`]'),], - [PF('[`[$data[12]]`]'),], ], ], - align => 'c c c c c c c c c c c c c c', + align => 'c c c c c c c c c', columnscss => ['border-right: 3px solid; ', - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',], + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',], );@]* -a) [`C([$x1])=`][_________] +a) Find [`C([$x1])`]. + [_________] -b) Interpret the meaning of [`C([$x1])`]: +b) Interpret the meaning of [`C([$x1])`]. [@$radio1->buttons()@]* c) Solve [`C(t)=[$y2]`] for [`t`]. [@KeyboardInstructions('Use commas to separate your answers if there are more than one solution.')@]** [`t=`][________] -d) Interpret the meaning of Part c's solution(s): +d) Interpret the meaning of Part c's solution(s). [@$radio2->buttons()@]* @@ -193,7 +195,7 @@ b) Answer is Part A implies there were [`[$y1]`] customers in the store [`[$x1]` c) According to data in the table, [`C([$x2])=[$y2]`] and [`C([$x3])=[$y3]`]. So the answer is [`[$ans3]`]. -d) Answer is Part C implies there were [`[$y2]`] customers in the store [`[$x2]`] hours after the store opened, and again [`[$x3]`] hours after the store opened. +d) Answer is Part C implies there were [`[$y2]`] customers in the store [`[$earlier]`] hours after the store opened, and again [`[$later]`] hours after the store opened. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction10.pg index 70e26ec5e4..a12233fce6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction10.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/213; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('F-IF1.2') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## MLT(SimplePolyAtIntValues) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); @@ -56,7 +59,7 @@ $fname = RandomVariableName(type=>function); BEGIN_PGML -Evaluate the function [`[$fname]`] at the given values. +Evaluate the function at the given values. [`[$fname](x)=[$f]`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction100.pg index 882ee82213..6639a41940 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction100.pg @@ -7,17 +7,18 @@ # Last updates: Carl Yao 7/24/13, Neft 7/9/2013 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS('evaluate','function') ## DBCCSS('F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## MLT(SimplePolyAtIntValues) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('evaluate','function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -30,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); TEXT(beginproblem()); @@ -42,7 +43,7 @@ $fname = RandomVariableName(type=>function); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$a = random(1,3,1); # a, b, c for the quadratic +$a = 1; # a, b, c for the quadratic $b = non_zero_random(-5,5,1); $c = random(-6,6,1); @@ -64,9 +65,9 @@ $answer2 = Compute($answer2); BEGIN_PGML -Consider the function [:[$fname]:] defined by [`[$fname](x)=[$f]`]. +Evaluate the function at the given values. -Evaluate the following: + [`[$fname](x)=[$f]`] a. [`[$fname]([$d])=`] [__________]{$answer1} @@ -85,13 +86,15 @@ To evaluate a function at a particular value, substitute that value for [`x`] in a. [`\begin{aligned}[t] -[$fname]([$d]) & = [$a]([$d])^2+[$b]([$d])+[$c]\\ +[$fname]([$d]) & = ([$d])^2+[$b]([$d])+[$c]\\ + & = [$d*$d]+[$b*$d]+[$c]\\ & = [$answer1] \end{aligned}`] b. [`\begin{aligned}[t] -[$fname]([$e]) & = [$a]([$e])^2+[$b]([$e])+[$c]\\ +[$fname]([$e]) & = ([$e])^2+[$b]([$e])+[$c]\\ + & = [$e*$e]+[$b*$e]+[$c]\\ & = [$answer2] \end{aligned}`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction110.pg index 3512458e73..3bcd83a139 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction110.pg @@ -7,16 +7,18 @@ # Last updates: Jordan 8/2/13; Carl Yao 7/24/13, Neft 7/9/2013 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS('evaluate','function') ## DBCCSS('F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('evaluate','function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + , + "PGcourse.pl", ); TEXT(beginproblem()); @@ -41,9 +44,9 @@ $fname = RandomVariableName(type=>function); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$a = random(-3,-1,1); # a, b, c for the quadratic +$a = random(-3,-2,1); # a, b, c for the quadratic $b = non_zero_random(-5,5,1); -$c = random(-6,6,1); +$c = non_zero_random(-6,6,1); $d = random(0,5,1); #values for x $e = random(-5,-1,1); @@ -63,9 +66,9 @@ $answer2 = Compute($answer2); BEGIN_PGML -Consider the function [:[$fname]:] defined by [`[$fname](x)=[$f]`]. +Evaluate the function at the given values. -Evaluate the following: + [`[$fname](x)=[$f]`] a. [`[$fname]([$d])=`] [__________]{$answer1} @@ -79,19 +82,27 @@ $b = '' if ($b == 1); $b = '-' if ($b == -1); -BEGIN_PGML_SOLUTION +$t1 = $a*$d*$d; +$t2 = $a*$e*$e; +############################################### + +BEGIN_PGML_SOLUTION To evaluate a function at a particular value, substitute that value for [`x`] in the function's formula and simplify. a. [`\begin{aligned}[t] [$fname]([$d]) & = [$a]([$d])^2+[$b]([$d])+[$c]\\ + & = [$a]([$d*$d])+[$b*$d]+[$c]\\ + & = [$t1]+[$b*$d]+[$c]\\ & = [$answer1] \end{aligned}`] b. [`\begin{aligned}[t] [$fname]([$e]) & = [$a]([$e])^2+[$b]([$e])+[$c]\\ + & = [$a]([$e*$e])+[$b*$e]+[$c]\\ + & = [$t2]+[$b*$e]+[$c]\\ & = [$answer2] \end{aligned}`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction120.pg index 89f8eadf73..f10960619a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction120.pg @@ -7,17 +7,18 @@ # Last updates: Jordan 8/2/13; Carl Yao 7/24/13, Neft 7/9/2013 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS('evaluate','function') ## DBCCSS('F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## MLT(RadicalEvalAtIntegers) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('evaluate','function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -31,7 +32,7 @@ loadMacros( "contextFraction.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); TEXT(beginproblem()); @@ -45,6 +46,7 @@ Context("Numeric"); $a = random(2,10,1); # random number to square for square root $n = random(1,10,1); # numerator of fraction; $d = random(2,10,1); # denominator of fraction +$c = random(-10,-1,1); $f = Formula("sqrt(x)")->reduce; $asquared = $a*$a; @@ -58,7 +60,12 @@ $fractionsquared = $answer2 * $answer2; Context("LimitedNumeric"); +Context()->strings->add("not a real number"=>{}, + "undefined"=>{alias=>'not a real number'}, + ); + $answer1 = Compute($answer1); +$answer3 = Compute("not a real number"); ############################################## @@ -67,14 +74,16 @@ $answer1 = Compute($answer1); BEGIN_PGML -Consider the function [:[$fname]:] defined by [`[$fname](x)=[$f]`]. +Evaluate the function at the given values. [@KeyboardInstructions('If it is not possible to evaluate the function value as a real number, you may answer with [|not a real number|]* or [|undefined|]*.')@]** -Evaluate the following: + [`[$fname](x)=[$f]`]. a. [`[$fname]([$asquared])=`] [__________]{$answer1} b. [`[$fname]\left([$fractionsquared]\right)=`] [__________]{$answer2} +c. [`[$fname]([$c])=`] [__________]{$answer3} + END_PGML @@ -93,6 +102,12 @@ b. [`\begin{aligned}[t] & = [$answer2] \end{aligned}`] +c. [`\begin{aligned}[t] +[$fname]([$c]) & = \sqrt{[$c]} +\end{aligned}`] + +Since we cannot square root a negative number, the answer for Part c is undefined. + END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction130.pg index 163434456e..4802cce47c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction130.pg @@ -6,18 +6,18 @@ # Last updates: Jordan 8/2/13; Carl Yao 7/24/13, Neft 7/9/2013 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS('evaluate','function') ## DBCCSS('F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## MLT(RadicalEvalAtIntegers) -## MLTleader(1) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('evaluate','function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -31,7 +31,7 @@ loadMacros( "contextFraction.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); TEXT(beginproblem()); @@ -42,7 +42,7 @@ $fname = RandomVariableName(type=>function); Context("Numeric"); -$a = random(2,5,1); # random number to square for square root +$a = random(-5,-1,1); # random number to square for square root $n = random(1,5,1); # numerator of fraction; $d = random(2,5,1); # denominator of fraction @@ -56,6 +56,10 @@ $answer2 = Fraction($n,$d); $fractioncubed = $answer2 * $answer2 * $answer2; Context("LimitedNumeric"); +#Context()->strings->add("undefined"=>{}, + # "none"=>{alias=>'no real solutions'}, + #); + $answer1 = Compute($answer1); @@ -65,9 +69,9 @@ $answer1 = Compute($answer1); BEGIN_PGML -Consider the function [:[$fname]:] defined by [`[$fname](x)=\sqrt[3]{x}`]. +Evaluate the function at the given values. -Evaluate the following: + [`[$fname](x)=\sqrt[3]{x}`] a. [`[$fname]([$acubed])=`] [__________]{$answer1} @@ -86,6 +90,7 @@ a. [`\begin{aligned}[t] & = [$answer1] \end{aligned}`] +Note that it's OK to cube root a negative number, but not OK to square root a negative number. b. [`\begin{aligned}[t] [$fname]\left([$fractioncubed]\right) & = \sqrt[3]{[$fractioncubed]}\\ diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction140.pg index 46b25ff5be..f36bc18ae9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction140.pg @@ -7,18 +7,18 @@ # Last updates: Jordan 8/2/13; Carl Yao 7/24/13, Neft 7/9/2013 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS('evaluate','function') ## DBCCSS('F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## MLT(ConstFcn) -## MLTleader(1) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('evaluate','function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -31,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); TEXT(beginproblem()); @@ -62,9 +62,9 @@ $answer2 = Compute($answer2); BEGIN_PGML -Consider the function [:[$fname]:] defined by [`[$fname](x)=[$f]`]. +Evaluate the function at the given values. -Evaluate the following: +[``[$fname](x)=[$f]``] a. [`[$fname]([$c])=`] [__________]{$answer1} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction20.pg index 18fb00674d..5e3fb729bc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction20.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/3/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('F-IF1.2') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## MLT(SimplePolyAtIntValues) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); @@ -55,7 +58,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the function [`[$fname]`] at the given values. +Evaluate the function at the given values. [`[$fname](x)=[$f]`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction30.pg index 848a39e8ac..c8dddaf28c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction30.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/3/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('F-IF1.2') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## MLT(SimplePolyAtIntValues) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -56,7 +58,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the function [`[$fname]`] at the given values. +Evaluate the function at the given values. [`[$fname](x)=[$f]`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction40.pg index 37875a9169..67113dc4e0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction40.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/3/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('F-IF1.2') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## MLT(SimplePolyAtIntValues) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -57,7 +59,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the function [`[$fname]`] at the given values. +Evaluate the function at the given values. [`[$fname](x)=[$f]`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction50.pg index 4ccfdd89c6..0f720dd9d5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction50.pg @@ -6,15 +6,18 @@ # Last updated: Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('F-IF1.2') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -56,7 +59,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the function [`[$fname]`] at the given values. +Evaluate the function at the given values. [`[$fname]([$var])=[$f]`] @@ -76,15 +79,18 @@ BEGIN_PGML_SOLUTION To evaluate a function like [`[$fname]`] at a certain value, say at [`[$a]`], we substitute [`[$a]`] in for [`[$var]`] in the function's formula: a. [`\begin{aligned}[t][$fname]([$a]) &= ([$a])^2+[$cons]\\ + &= [$a*$a]+[$cons]\\ &= [$ansa]\end{aligned}`] Similarly, we have: b. [`\begin{aligned}[t][$fname]([$b]) &= ([$b])^2+[$cons]\\ + &= [$b*$b]+[$cons]\\ &= [$ansb]\end{aligned}`] c. [`\begin{aligned}[t][$fname]([$c]) &= ([$c])^2+[$cons]\\ + &= [$c*$c]+[$cons]\\ &= [$ansc]\end{aligned}`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction60.pg index 241cfe254e..9c36c60ec1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction60.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/3/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('F-IF1.2') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## MLT(SimplePolyAtIntValues) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -58,7 +60,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the function [`[$fname]`] at the given values. +Evaluate the function at the given values. [`[$fname]([$var])=[$f]`] @@ -78,15 +80,18 @@ BEGIN_PGML_SOLUTION To evaluate a function like [`[$fname]`] at a certain value, say at [`[$a]`], we substitute [`[$a]`] in for [`[$var]`] in the function's formula: a. [`\begin{aligned}[t][$fname]([$a]) &= -([$a])^2+[$cons]\\ + &= -[$a*$a]+[$cons]\\ &= [$ansa]\end{aligned}`] Similarly, we have: b. [`\begin{aligned}[t][$fname]([$b]) &= -([$b])^2+[$cons]\\ + &= -[$b*$b]+[$cons]\\ &= [$ansb]\end{aligned}`] c. [`\begin{aligned}[t][$fname]([$c]) &= -([$c])^2+[$cons]\\ + &= -[$c*$c]+[$cons]\\ &= [$ansc]\end{aligned}`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction70.pg index 2f58d00d1c..21d77bec35 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction70.pg @@ -6,16 +6,18 @@ # Last updated: Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('F-IF1.2') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## MLT(ConstFcn) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -41,7 +43,7 @@ Context()->variables->are($var=>'Real'); $cons = non_zero_random(-10,10,1); $f = Formula("$cons")->reduce; -$a = random(1,5,1); +do {$a = random(1,5,1);} until ($a != $cons); $b = $cons; $c = 0; @@ -57,7 +59,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the function [`[$fname]`] at the given values. +Evaluate the function at the given values. [`[$fname]([$var])=[$f]`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction80.pg index 8f849964f3..d02ce6e2ef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction80.pg @@ -7,16 +7,18 @@ # Last updates: Jordan 8/2/13; Carl Yao 7/24/13, Neft 7/9/2013 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS('evaluate','function') ## DBCCSS('F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('evaluate','function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -30,7 +32,7 @@ loadMacros( "contextFraction.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); TEXT(beginproblem()); @@ -75,10 +77,9 @@ $answer2 = Fraction($ansnum2,$ansden2); BEGIN_PGML -Consider the function [:[$fname]:] defined by [``[$fname](x)=\frac{[$num]}{[$den]}``] . - +Evaluate the function at the given values. -Evaluate the following: + [``[$fname](x)=\frac{[$num]}{[$den]}``] a. [`[$fname]([$in1])=`] [__________]{$answer1}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction85.pg index fb47b355e4..634860f19c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction85.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction85.pg @@ -7,16 +7,18 @@ # Last updates: Carl Yao 6/23/2016 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS('evaluate','function') ## DBCCSS('F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RationalFcns) -## Level(3) -## KEYWORDS('evaluate','function') +##Author('Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -30,7 +32,7 @@ loadMacros( "contextFraction.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); TEXT(beginproblem()); @@ -42,7 +44,6 @@ $fname = RandomVariableName(type=>function); Context("Numeric"); Context()->strings->add("undefined"=>{}, - "none"=>{alias=>'no real solutions'}, ); $y1 = non_zero_random(-10,10,1); @@ -64,10 +65,9 @@ $func = Compute("$a/(x+$b)")->reduce; BEGIN_PGML -Consider the function [`[$fname]`] defined by [``[$fname](x)=[$func]``] . - +Evaluate the function at the given values. -Evaluate the following. If the value is not defined, type "undefined". + [``[$fname](x)=[$func]``] . a. [``[$fname]([$x1])=``] [__________]{$y1}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction90.pg index 2c683a3058..306fb92018 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction90.pg @@ -6,18 +6,18 @@ # Last updates: Carl Yao 7/24/13, Neft 7/9/2013 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +##KEYWORDS('evaluate','function') ##DBCCSS('F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## MLT(SimplePolyAtIntValues) -## MLTleader(1) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('evaluate','function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -30,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + , + "PGcourse.pl", ); TEXT(beginproblem()); @@ -63,9 +64,9 @@ $answer2 = Compute($answer2); BEGIN_PGML -Consider the function [:[$fname]:] defined by [`` [$fname](x)=[$f] ``]. +Evaluate the function at the given values. -Evaluate the following: + [`` [$fname](x)=[$f] ``] a. [`` [$fname]([$c])= ``] [__________]{$answer1} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition65.pg index bb731bb277..774a5d2281 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition65.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition65.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(fg) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','combining functions', 'composition') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,9 +28,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "pccTables.pl", - "contextPolynomialFactors.pl", - "PGcourse.pl" + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", ); ############################################## @@ -39,23 +42,78 @@ $a = random(2,9,1)*random(-1,1,2); $b = non_zero_random(-9,9,1); $c = random(2,9,1); -Context("PolynomialFactors")->flags->set(singlePowers=>1); -Context()->flags->set(reduceConstants=>0); +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); $f = Formula("$a*x+$b")->reduce; $bPlusC = $b+$c; $ans1 = Formula("$a*x+$bPlusC")->reduce; +$evaluator1 = $ans1->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); $ac = $a*$c; $o = $ac+$b; $ans2 = Formula("$a*x+$o")->reduce; +$evaluator2 = $ans2->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); $bc = $b*$c; $ans3 = Formula("$ac*x+$bc")->reduce; +$evaluator3 = $ans3->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); $ans4 = Formula("$ac*x+$b")->reduce; - +$evaluator4 = $ans4->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); @@ -66,20 +124,19 @@ BEGIN_PGML Let [`f`] be a function given by [`f(x)=[$f]`]. Find and simplify the following: -a) [`f(x)+[$c]={}`][_________________________________________]{$ans1} +a. [`f(x)+[$c]={}`][_]{$evaluator1}{10} -a) [`f(x+[$c])={}`][_________________________________________]{$ans2} +a. [`f(x+[$c])={}`][_]{$evaluator2}{10} -a) [`[$c]f(x)={}`][_________________________________________]{$ans3} +a. [`[$c]f(x)={}`][_]{$evaluator3}{10} -a) [`f([$c]x)={}`][_________________________________________]{$ans4} +a. [`f([$c]x)={}`][_]{$evaluator4}{10} END_PGML ############################################## -Context("Numeric"); $s1 = Formula("$a*(x+$c)+$b")->reduce; $s2 = Formula("$a*x+$ac+$b")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition66.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition66.pg index a8c9bed8ed..c5f7f38b80 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition66.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition66.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(fg) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','combining functions', 'composition') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,9 +28,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "pccTables.pl", - "contextPolynomialFactors.pl", - "PGcourse.pl" + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", ); ############################################## @@ -39,24 +42,79 @@ $a = random(2,5,1)*random(-1,1,2); $b = non_zero_random(-5,5,1); $c = random(-5,-2,1); -Context("PolynomialFactors")->flags->set(singlePowers=>1); -Context()->flags->set(reduceConstants=>0); +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); $f = Formula("$a*x**2+$b*x")->reduce; $ans1 = Formula("$f+$c")->reduce; +$evaluator1 = $ans1->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); $o = 2*$a*$c+$b; $p = $a*($c)**2+$b*$c; $ans2 = Formula("$a*x**2+$o*x+$p")->reduce; +$evaluator2 = $ans2->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); $ac = $a*$c; $bc = $b*$c; $ans3 = Formula("$ac*x**2+$bc*x")->reduce; +$evaluator3 = $ans3->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); $q = $a*$c*$c; $ans4 = Formula("$q*x**2+$bc*x")->reduce; - +$evaluator4 = $ans4->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); @@ -67,21 +125,19 @@ BEGIN_PGML Let [`f`] be a function given by [`f(x)=[$f]`]. Find and simplify the following: -a) [`f(x)+[$c]={}`][_________________________________________]{$ans1} +a. [`f(x)+[$c]={}`][_]{$evaluator1}{10} + +a. [`f(x+[$c])={}`][_]{$evaluator2}{10} -a) [`f(x+[$c])={}`][_________________________________________]{$ans2} +a. [`[$c]f(x)={}`][_]{$evaluator3}{10} -a) [`[$c]f(x)={}`][_________________________________________]{$ans3} +a. [`f([$c]x)={}`][_]{$evaluator4}{10} -a) [`f([$c]x)={}`][_________________________________________]{$ans4} - END_PGML ############################################## -Context("Numeric"); -Context()->noreduce('(-x)-y','(-x)+y'); $s1 = Formula("$a*(x+$c)**2+$b*(x+$c)")->reduce; $r = 2*$c; $c2 = $c*$c; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition67.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition67.pg new file mode 100644 index 0000000000..f61cec1ea2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition67.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function, find -f(x) and f(-x). +# +# Last update: Carl Yao 3/24/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','combining functions', 'composition') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,5,1)*random(-1,1,2); +$b = random(2,5,1)*random(-1,1,2); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$f = Formula("$a*x+$b")->reduce; + +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'u-' => {class => 'bizarro::UOP::minus', isCommand => 1}, +); + +$ans1 = Compute("-$a*x-$b")->reduce; +$evaluator1 = $ans1->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroNeg=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroNeg=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); + +$ans2 = Compute("-$a*x+$b")->reduce; +$evaluator2 = $ans2->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroNeg=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroNeg=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); + +############################################## + + +BEGIN_PGML + +Let [`f`] be a function given by [`f(x)=[$f]`]. Find and simplify the following: + +a) [`-f(x)={}`][_________________________________________]{$evaluator1} + +a) [`f(-x)={}`][_________________________________________]{$evaluator2} + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +a) + +[`\begin{aligned}[t] +-f(x) +&=-([$f]) \\ +&=[$ans1] +\end{aligned}`] + +b) + +[`\begin{aligned}[t] +f(-x) +&=[$a](-x)+[$b]\\ +&=[$ans2] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition68.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition68.pg new file mode 100644 index 0000000000..ee0c9e73ea --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionComposition68.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function, find -f(x) and f(-x). +# +# Last update: Carl Yao 3/24/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','combining functions', 'composition') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,5,1)*random(-1,1,2); +$b = random(2,5,1)*random(-1,1,2); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'u-' => {class => 'bizarro::UOP::minus', isCommand => 1}, +); + +$f = Compute("$a*x**2+$b*x")->reduce; + +$ans1 = Compute("-$a*x**2-$b*x")->reduce; +$evaluator1 = $ans1->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroNeg=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroNeg=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); + +$ans2 = Compute("$a*x**2-$b*x")->reduce; +$evaluator2 = $ans2->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroNeg=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroNeg=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form${BR}Maybe it needs to be simplified more") unless $OK; + return $OK; +}); + +############################################## + + +BEGIN_PGML + +Let [`f`] be a function given by [`f(x)=[$f]`]. Find and simplify the following: + +a) [`-f(x)={}`][_________________________________________]{$evaluator1} + +a) [`f(-x)={}`][_________________________________________]{$evaluator2} + + +END_PGML + +############################################## + +$s1 = Compute("$a*(-x)**2+$b")->reduce; +$s2 = "(-x)"; + +############################################## + +BEGIN_PGML_SOLUTION + +a) + +[`\begin{aligned}[t] +-f(x) +&=-([$f]) \\ +&=[$ans1] +\end{aligned}`] + +b) + +[`\begin{aligned}[t] +f(-x) +&=[$s1][$s2]\\ +&=[$ans2] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDefinition10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDefinition10.pg index ea213e301c..cec82f3d4d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDefinition10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDefinition10.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/3/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('F-IF1.1') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Definition, concept) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','definition','domain','range') +## DBCCSS('F-IF1.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -23,9 +26,10 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserRadioButtons.pl", + "parserPopUp.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -36,8 +40,8 @@ loadMacros( Context("Interval"); -$yes = "Yes, this relation describes a function of x."; -$no = "No, this relation does not describe a function of x."; +$yes = "describes"; +$no = "does not describe"; $n = 'no'; @@ -85,7 +89,7 @@ do $points[$i] = $points[$i]."($dom[$i][$j],$ran[$i][$j])"; $points[$i] = $points[$i].',' if ($j < $i+1); }; -# $oneToOne[$i] = 'yes' if ($funciton[$i] eq $yes); +# $oneToOne[$i] = 'yes' if ($function[$i] eq $yes); }; } until ( grep( /^$yes$/, @function ) and grep( /^$no$/, @function ) and grep( /^$n$/, @oneToOne ) );#make sure each happens at least once @@ -98,28 +102,24 @@ $points3 = $points[3]; -$radio0 = RadioButtons( - [$yes,$no], +$popup0 = PopUp( + ['?',$yes,$no], $function[0], # correct answer - last => [$no], # can be a list ); -$radio1 = RadioButtons( - [$yes,$no], +$popup1 = PopUp( + ['?',$yes,$no], $function[1], # correct answer - last => [$no], # can be a list ); -$radio2 = RadioButtons( - [$yes,$no], +$popup2 = PopUp( + ['?',$yes,$no], $function[2], # correct answer - last => [$no], # can be a list ); -$radio3 = RadioButtons( - [$yes,$no], +$popup3 = PopUp( + ['?',$yes,$no], $function[3], # correct answer - last => [$no], # can be a list ); @@ -135,57 +135,23 @@ TEXT(beginproblem()); BEGIN_PGML -a. Does the following relation on [`x`] and [`y`] make for a function of [`x`]? - - [`\Big[$LBRACE][$points0]\Big[$RBRACE]`] - - [@$radio0->buttons()@]* - - What is the domain of the relation? (Since a domain is a _set_ of numbers, you should be using [`[$LBRACE]`] and [`[$RBRACE]`] in your answer.) - [______________] - - What is the range of the relation? (Since a range is a _set_ of numbers, you should be using [`[$LBRACE]`] and [`[$RBRACE]`] in your answer.) - [______________] - ---- - -b. Does the following relation on [`x`] and [`y`] make for a function of [`x`]? - - [`\Big[$LBRACE][$points1]\Big[$RBRACE]`] - - [@$radio1->buttons()@]* - - What is the domain of the relation? (Since a domain is a _set_ of numbers, you should be using [`[$LBRACE]`] and [`[$RBRACE]`] in your answer.) - [______________] - - What is the range of the relation? (Since a range is a _set_ of numbers, you should be using [`[$LBRACE]`] and [`[$RBRACE]`] in your answer.) - [______________] - ---- -c. Does the following relation on [`x`] and [`y`] make for a function of [`x`]? - - [`\Big[$LBRACE][$points2]\Big[$RBRACE]`] - - [@$radio2->buttons()@]* +Do these sets of ordered pairs make functions of [`x`]? What are their domains and ranges? [@KeyboardInstructions('Since domains and ranges are _sets_ of numbers, you should be using [`\{`] and [`\}`] in your answers.')@]** - What is the domain of the relation? (Since a domain is a _set_ of numbers, you should be using [`[$LBRACE]`] and [`[$RBRACE]`] in your answer.) - [______________] +a. [`\Big\{[$points0]\Big\}`] - What is the range of the relation? (Since a range is a _set_ of numbers, you should be using [`[$LBRACE]`] and [`[$RBRACE]`] in your answer.) - [______________] - ---- -d. Does the following relation on [`x`] and [`y`] make for a function of [`x`]? + This set of ordered pairs [_____]{$popup0} a function of [`x`]. This set of ordered pairs has domain [______________]{Set($domain[0]->value)} and range [______________]{Set($range[0]->value)}. - [`\Big[$LBRACE][$points3]\Big[$RBRACE]`] +b. [`\Big\{[$points1]\Big\}`] - [@$radio3->buttons()@]* + This set of ordered pairs [_____]{$popup1} a function of [`x`]. This set of ordered pairs has domain [______________]{Set($domain[1]->value)} and range [______________]{Set($range[1]->value)}. - What is the domain of the relation? (Since a domain is a _set_ of numbers, you should be using [`[$LBRACE]`] and [`[$RBRACE]`] in your answer.) - [______________] +c. [`\Big\{[$points2]\Big\}`] - What is the range of the relation? (Since a range is a _set_ of numbers, you should be using [`[$LBRACE]`] and [`[$RBRACE]`] in your answer.) - [______________] - ---- + This set of ordered pairs [_____]{$popup2} a function of [`x`]. This set of ordered pairs has domain [______________]{Set($domain[2]->value)} and range [______________]{Set($range[2]->value)}. +d. [`\Big\{[$points3]\Big\}`] + This set of ordered pairs [_____]{$popup3} a function of [`x`]. This set of ordered pairs has domain [______________]{Set($domain[3]->value)} and range [______________]{Set($range[3]->value)}. END_PGML @@ -193,34 +159,15 @@ END_PGML ############################################## -ANS($radio0->cmp); -ANS( Set($domain[0]->value)->cmp ); -ANS( Set($range[0]->value)->cmp ); - -ANS($radio1->cmp); -ANS( Set($domain[1]->value)->cmp ); -ANS( Set($range[1]->value)->cmp ); - -ANS($radio2->cmp); -ANS( Set($domain[2]->value)->cmp ); -ANS( Set($range[2]->value)->cmp ); - -ANS($radio3->cmp); -ANS( Set($domain[3]->value)->cmp ); -ANS( Set($range[3]->value)->cmp ); - -############################################## - - for my $i (0..3) { if ($function[$i] eq $yes) { - $solnString[$i] = "Since there are no instances of a value appearing for an input [`x`] more than once alongside _different_ outputs [`y`], this relation is a function of [`x`]."; + $solnString[$i] = "Since there are no instances of a value appearing for an input [`x`] more than once alongside _different_ outputs [`y`], this set of ordered pairs is a function of [`x`]."; if ($oneToOne[$i] eq 'no') {$solnString[$i] = $solnString[$i]." Note that it is fine for a function to have more than one input (like [`$twoinputs1[$i]`] and [`$twoinputs2[$i]`]) lead to the same output, in this case [`$oneoutput[$i]`]."}; } else { - $solnString[$i] = "Since the input [`$badinput[$i]`] corresponds to more than one output ([`$badoutput1[$i]`] and [`$badoutput2[$i]`]), this relation is not a function of [`x`]."; + $solnString[$i] = "Since the input [`$badinput[$i]`] corresponds to more than one output ([`$badoutput1[$i]`] and [`$badoutput2[$i]`]), this set of ordered pairs is not a function of [`x`]."; } } @@ -238,7 +185,7 @@ for my $i (0..3) { BEGIN_PGML_SOLUTION -a. [`\Big[$LBRACE][$points0]\Big[$RBRACE]`] +a. [`\Big\{[$points0]\Big\}`] [$solnString0]** @@ -247,7 +194,7 @@ a. [`\Big[$LBRACE][$points0]\Big[$RBRACE]`] The range is the set of [`y`]-values: [`[$range0]`] ---- -b. [`\Big[$LBRACE][$points1]\Big[$RBRACE]`] +b. [`\Big\{[$points1]\Big\}`] [$solnString1]** @@ -256,7 +203,7 @@ b. [`\Big[$LBRACE][$points1]\Big[$RBRACE]`] The range is the set of [`y`]-values: [`[$range1]`] ---- -c. [`\Big[$LBRACE][$points2]\Big[$RBRACE]`] +c. [`\Big\{[$points2]\Big\}`] [$solnString2]** @@ -265,7 +212,7 @@ c. [`\Big[$LBRACE][$points2]\Big[$RBRACE]`] The range is the set of [`y`]-values: [`[$range2]`] ---- -d. [`\Big[$LBRACE][$points3]\Big[$RBRACE]`] +d. [`\Big\{[$points3]\Big\}`] [$solnString3]** diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDefinition20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDefinition20.pg new file mode 100644 index 0000000000..e0eee1b6d3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDefinition20.pg @@ -0,0 +1,191 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Tell whether a set of ordered pairs qualify as a function. +# +# Last updated: Yao 2/12/2017 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','definition','domain','range') +## DBCCSS('F-IF1.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserPopUp.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + + +############################################## + +Context("Interval"); + + +$yes = "describes"; +$no = "does not describe"; + +$n = 'no'; + +do +{ + for my $i (0..3) + { + $points[$i] = ''; + my %f = ''; + my %finv = ''; + $function[$i] = $yes; + $oneToOne[$i] = 'yes'; + for my $j (0..$i+1) + { + $dom[$i][$j] = random(-10,10,1); + $ran[$i][$j] = random(0,10,1); + if (defined $f{$dom[$i][$j]} and $f{$dom[$i][$j]} != $ran[$i][$j]) + {$function[$i] = $no; + $badinput[$i] = $dom[$i][$j]; + $badoutput1[$i] = $f{$dom[$i][$j]}; + $badoutput2[$i] = $ran[$i][$j]; + }; + if (defined $finv{$ran[$i][$j]} and $finv{$ran[$i][$j]} != $dom[$i][$j]) + {$oneToOne[$i] = 'no'; + $twoinputs1[$i] = $finv{$ran[$i][$j]}; + $twoinputs2[$i] = $dom[$i][$j]; + $oneoutput[$i] = $ran[$i][$j]; + }; + $f{$dom[$i][$j]} = $ran[$i][$j]; + $finv{$ran[$i][$j]} = $dom[$i][$j]; + if ($j == 0) + { + $domain[$i] = Set("{$dom[$i][$j]}") + } else + { + $domain[$i] = $domain[$i]+Set("{$dom[$i][$j]}") + }; + if ($j == 0) + { + $range[$i] = Set("{$ran[$i][$j]}") + } else + { + $range[$i] = $range[$i] + Set("{$ran[$i][$j]}"); + }; + $points[$i] = $points[$i]."($dom[$i][$j],$ran[$i][$j])"; + $points[$i] = $points[$i].',' if ($j < $i+1); + }; +# $oneToOne[$i] = 'yes' if ($function[$i] eq $yes); + }; +} +until ( grep( /^$yes$/, @function ) and grep( /^$no$/, @function ) and grep( /^$n$/, @oneToOne ) );#make sure each happens at least once + + +$points0 = $points[0]; +$points1 = $points[1]; +$points2 = $points[2]; +$points3 = $points[3]; + + + +$popup0 = PopUp( + ['?',$yes,$no], + $function[0], # correct answer + +); + +$popup1 = PopUp( + ['?',$yes,$no], + $function[1], # correct answer + +); + +$popup2 = PopUp( + ['?',$yes,$no], + $function[2], # correct answer + +); + +$popup3 = PopUp( + ['?',$yes,$no], + $function[3], # correct answer + +); + + + + + + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Does the following set of ordered pairs make for a function of [`x`]? [@KeyboardInstructions('Since domains and ranges are _sets_ of numbers, you should be using [`\{`] and [`\}`] in your answers.')@]** + + [`\Big\{[$points3]\Big\}`] + + This set of ordered pairs [_____]{$popup3} a function of [`x`]. This set of ordered pairs has domain [______________]{Set($domain[3]->value)} and range [______________]{Set($range[3]->value)}. + +END_PGML + + +############################################## + + + + + +for my $i (0..3) { + if ($function[$i] eq $yes) { + $solnString[$i] = "Since there are no instances of a value appearing for an input [`x`] more than once alongside _different_ outputs [`y`], this set of ordered pairs is a function of [`x`]."; + if ($oneToOne[$i] eq 'no') {$solnString[$i] = $solnString[$i]." Note that it is fine for a function to have more than one input (like [`$twoinputs1[$i]`] and [`$twoinputs2[$i]`]) lead to the same output, in this case [`$oneoutput[$i]`]."}; +} + else { + $solnString[$i] = "Since the input [`$badinput[$i]`] corresponds to more than one output ([`$badoutput1[$i]`] and [`$badoutput2[$i]`]), this set of ordered pairs is not a function of [`x`]."; +} + +} + + +($solnString0, $solnString1, $solnString2, $solnString3) = @solnString; + +($domain0, $domain1, $domain2, $domain3) = @domain; + +($range0, $range1, $range2, $range3) = @range; + + + + + +BEGIN_PGML_SOLUTION + + [`\Big\{[$points3]\Big\}`] + + [$solnString3]** + + The domain is the set of [`x`]-values: [`[$domain3]`] + + The range is the set of [`y`]-values: [`[$range3]`] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg index 331c1162d4..fee9db776d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg @@ -8,34 +8,41 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PCCmacros.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGchoicemacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Interval"); -$refreshCachedImages=1; + #Decide the number of points in the graph. $numPoints = 3; @@ -51,10 +58,21 @@ for my $i (0..$numPoints-1) { } #Intentionally create a duplicate y value in two points. +#But make sure x-values are separated by at least 3 so labels do not overlap $dup0 = random(0,$numPoints-1); do {$dup1=random(0,$numPoints-1);} until ($dup0!=$dup1); $py[$dup0]=$py[$dup1]; +if (abs($px[$dup0] - $px[$dup1]) < 3) { + ($px[$dup0],$px[$dup1]) = (-8..8)[NchooseK(17,2)]; +} +#Duplicated y-value should have a corresponding x-value that is at least 2 away form the other x-value, to avoid coordinates crowding in image. +while (abs($px[$dup0] - $px[$dup1]) < 2) +{my $newx = $px[$dup1]; + while (($newx == $px[0]) or ($newx == $px[1]) or ($newx == $px[2])) + {$newx = list_random(@xArray);}; +$px[$dup0] = $newx; +}; $domain=Set(); $range=Set(); @@ -74,28 +92,26 @@ for my $i (0..$numPoints-1) { @yticks = @$yticks_ref; $ALTPoints=""; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - - for my $j (0..$numPoints-1) { - $gr[$i]->stamps( closed_circle($px[$j],$py[$j],'blue') ); - $gr[$i]->lb( new Label($px[$j],$py[$j]-$sign*$marksep[1]/8, "($px[$j],$py[$j])", 'blue','left','top')); - $ALTPoints .= "($px[$j],$py[$j]), "; - } + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[soliddot] coordinates {($px[0],$py[0]) ($px[1],$py[1]) ($px[2],$py[2])}; +\end{axis} +END_TIKZ + +for my $j (0,1,2) { + $ALTPoints .= "($px[$j],$py[$j]), " } $ALTPoints =~ s/, $//; @@ -107,19 +123,17 @@ $ALTPoints =~ s/ and /, /; Context("LimitedNumeric"); BEGIN_PGML -A function's graph is shown below. +A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< - +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< -To use set notation, include elements between braces (the [`[@$LBRACE@]`] symbol and the [`[@$RBRACE@]`] symbol). - The domain of this function is [______________]{$domain}. +[@KeyboardInstructions('To write an answer using set notation, write the elements between braces (for example [|{1,2,4}|]*).')@]** - The range of this function is [______________]{$range}. + This function has domain [______________]{$domain} and range [______________]{$range}. END_PGML ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg index de40e60880..2a08b2a386 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg @@ -8,28 +8,33 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','domain','range','graph') -## MLT(algebra_functions_domain_range_graph_linear) +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGtikz.pl", + "ORCCA.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -37,7 +42,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $m = non_zero_random(-3,3,1); $b = random(-4,4,1); @@ -91,28 +96,28 @@ if ($m>0) { @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - - if ($m>0) {$pos1 = 'top'; $pos2 = 'bottom'; $sign = -1;} - else {$pos1 = 'bottom'; $pos2 = 'top'; $sign = 1;} - $gr[$i]->lb( new Label($domainLowX,$domainLowY+$sign*$marksep[1]/8,"($domainLowX,$domainLowY)", 'blue','center',$pos1)); - $gr[$i]->lb( new Label($domainHighX,$domainHighY-$sign*$marksep[1]/8,"($domainHighX,$domainHighY)", 'blue','center',$pos2)); -} +$left = ($leftOpen==1) ? 'hollowdot' : 'soliddot'; +$right = ($rightOpen==1) ? 'hollowdot' : 'soliddot'; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+[-] coordinates {($domainLowX,$domainLowY) ($domainHighX,$domainHighY)}; + \addplot[$left] coordinates {($domainLowX,$domainLowY)} node[below left] {\(($domainLowX,$domainLowY)\)}; + \addplot[$right] coordinates {($domainHighX,$domainHighY)} node[below right] {\(($domainHighX,$domainHighY)\)}; +\end{axis} +END_TIKZ + $ALT = "graph of a linear segment from ($domainLowX,$domainLowY) to ($domainHighX,$domainHighY), with the point ($domainLowX,$domainLowY) $leftOpenClose and the point ($domainHighX,$domainHighY) $rightOpenClose"; @@ -121,61 +126,46 @@ Context("Interval"); if (($leftOpen==1) && ($rightOpen==1)) { $intDomain = Compute("($domainLowX,$domainHighX)"); $intRange = Compute("($rangeLowY,$rangeHighY)"); - add_functions($gr[0], "$m*x+$b for x in ($domainLowX,$domainHighX) using color:blue and weight:2"); } elsif (($leftOpen==0) && ($rightOpen==1)) { $intDomain = Compute("[$domainLowX,$domainHighX)"); $intRange = $m>0 ? Compute("[$rangeLowY,$rangeHighY)") : Compute("($rangeLowY,$rangeHighY]"); - add_functions($gr[0], "$m*x+$b for x in [$domainLowX,$domainHighX) using color:blue and weight:2"); } elsif (($leftOpen==1) && ($rightOpen==0)) { $intDomain = Compute("($domainLowX,$domainHighX]"); $intRange = $m>0 ? Compute("($rangeLowY,$rangeHighY]") : Compute("[$rangeLowY,$rangeHighY)"); - add_functions($gr[0], "$m*x+$b for x in ($domainLowX,$domainHighX] using color:blue and weight:2"); } else { $intDomain = Compute("[$domainLowX,$domainHighX]"); $intRange = Compute("[$rangeLowY,$rangeHighY]"); - add_functions($gr[0], "$m*x+$b for x in [$domainLowX,$domainHighX] using color:blue and weight:2"); } - ############################################## Context("LimitedNumeric"); BEGIN_PGML -A function's graph is shown below. +A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< -Use interval notation to answer the following questions. +[@KeyboardInstructions('Use interval notation.')@]** - The domain of this function is [___________]{$intDomain}. + This function has domain [______________]{$intDomain} and range [______________]{$intRange}. - The range of this function is [___________]{$intRange}. END_PGML ############################################## BEGIN_PGML_SOLUTION -First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. - -The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. - -The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. +First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. Any [`x`]-value in between [`[$domainLowX]`] and [`[$domainHighX]`] is a valid input. So the domain of the function is [`[$intDomain]`]. ----- - -Next, let's find the range of this function. A function's range is the collection of possible outputs. These are the [`y`]-values of all of the points that we see shaded on the segment. - -The end-point at the bottom is [`([$rangeLowX],[$rangeLowY])`]. This point is [$bottomOpenClose], so the value [`[$rangeLowY]`] is [$bottomInclusive] in the range. -The end-point on the top is [`([$rangeHighX],[$rangeHighY])`]. This point is [$topOpenClose], so the value [`[$rangeHighY]`] is [$topInclusive] in the range. +Next, let's find the range of this function. A function's range is the collection of possible outputs. These are the [`y`]-values of all of the points that we see shaded on the segment. The end-point at the bottom is [`([$rangeLowX],[$rangeLowY])`]. This point is [$bottomOpenClose], so the value [`[$rangeLowY]`] is [$bottomInclusive] in the range. The end-point on the top is [`([$rangeHighX],[$rangeHighY])`]. This point is [$topOpenClose], so the value [`[$rangeHighY]`] is [$topInclusive] in the range. -Every [`y`] value between [`[$rangeLowY]`] and [`[$rangeHighY]`] is a possible output, so the range of the function is [`[$intRange]`]. +Every [`y`]-value between [`[$rangeLowY]`] and [`[$rangeHighY]`] is a possible output, so the range of the function is [`[$intRange]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg index 82dc27eca1..9e94021a3e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg @@ -8,28 +8,33 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','domain','range','graph') -## MLT(algebra_functions_domain_range_graph_linear) +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGtikz.pl", + "ORCCA.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -37,7 +42,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $m = 0; $b = non_zero_random(-4,4,1); @@ -82,27 +87,30 @@ if ($rightOpen) { @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - - $pos1 = 'bottom'; $pos2 = 'bottom'; $sign = 1; - $gr[$i]->lb( new Label($domainLowX,$domainLowY+$sign*$marksep[1]/8,"($domainLowX,$domainLowY)", 'blue','center',$pos1)); - $gr[$i]->lb( new Label($domainHighX,$domainHighY+$sign*$marksep[1]/8,"($domainHighX,$domainHighY)", 'blue','center',$pos2)); -} +$left = ($leftOpen==1) ? 'hollowdot' : 'soliddot'; +$right = ($rightOpen==1) ? 'hollowdot' : 'soliddot'; + + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+[-] coordinates {($domainLowX,$domainLowY) ($domainHighX,$domainHighY)}; + \addplot[$left] coordinates {($domainLowX,$domainLowY)} node[below left] {\(($domainLowX,$domainLowY)\)}; + \addplot[$right] coordinates {($domainHighX,$domainHighY)} node[below right] {\(($domainHighX,$domainHighY)\)}; +\end{axis} +END_TIKZ + + $ALT = "graph of a linear segment from ($domainLowX,$domainLowY) to ($domainHighX,$domainHighY), with the point ($domainLowX,$domainLowY) $leftOpenClose and the point ($domainHighX,$domainHighY) $rightOpenClose"; @@ -112,16 +120,12 @@ $intRange = Set($domainLowY); if (($leftOpen==1) && ($rightOpen==1)) { $intDomain = Compute("($domainLowX,$domainHighX)"); - add_functions($gr[0], "$m*x+$b for x in ($domainLowX,$domainHighX) using color:blue and weight:2"); } elsif (($leftOpen==0) && ($rightOpen==1)) { $intDomain = Compute("[$domainLowX,$domainHighX)"); - add_functions($gr[0], "$m*x+$b for x in [$domainLowX,$domainHighX) using color:blue and weight:2"); } elsif (($leftOpen==1) && ($rightOpen==0)) { $intDomain = Compute("($domainLowX,$domainHighX]"); - add_functions($gr[0], "$m*x+$b for x in ($domainLowX,$domainHighX] using color:blue and weight:2"); } else { $intDomain = Compute("[$domainLowX,$domainHighX]"); - add_functions($gr[0], "$m*x+$b for x in [$domainLowX,$domainHighX] using color:blue and weight:2"); } @@ -129,32 +133,26 @@ if (($leftOpen==1) && ($rightOpen==1)) { Context("LimitedNumeric"); BEGIN_PGML -A function's graph is shown below. +A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< -Use interval notation or set notation to answer the following questions. +[@KeyboardInstructions('Use interval notation or set notation.')@]** - The domain of this function is [___________]{$intDomain}. + This function has domain [______________]{$intDomain} and range [______________]{$intRange}. - The range of this function is [___________]{$intRange}. END_PGML ############################################## BEGIN_PGML_SOLUTION -First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. - -The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. - -The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. +First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. Any [`x`]-value in between [`[$domainLowX]`] and [`[$domainHighX]`] is a valid input. So the domain of the function is [`[$intDomain]`]. ----- Next, let's find the range of this function. A function's range is the collection of possible outputs. These are the [`y`]-values of all of the points that we see shaded on the segment. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg index 8b4ea4a82d..4eba97a560 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','domain','range','graph') -## MLTleader(1) -## MLT(algebra_functions_domain_range_graph_continuous) +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,11 +27,13 @@ DOCUMENT(); loadMacros( "PGstandard.pl", - "PGgraphmacros.pl", "MathObjects.pl", "PGML.pl", + "PGtikz.pl", + "ORCCA.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -38,7 +41,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $a = random(-1,1,2); $h = random(-2,2,1); @@ -90,33 +93,31 @@ if ($a>0) { ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$domainLowX,$domainHighX],[$rangeLowY,$rangeHighY,$k]); -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; - - $gr = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } +$left = ($leftOpen==1) ? 'hollowdot' : 'soliddot'; +$right = ($rightOpen==1) ? 'hollowdot' : 'soliddot'; - if ($a>0) {$pos1 = 'top'; $pos2 = 'bottom'; $sign = 1;} - else {$pos1 = 'bottom'; $pos2 = 'top'; $sign = -1;} +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+[-,domain=$domainLowX:$domainHighX] {$a*(x-$h)^2+$k}; + \addplot[soliddot] coordinates {($h,$k)} node[above] {\(($h,$k)\)}; + \addplot[$left] coordinates {($domainLowX,$domainLowY)} node[below left] {\(($domainLowX,$domainLowY)\)}; + \addplot[$right] coordinates {($domainHighX,$domainHighY)} node[below right] {\(($domainHighX,$domainHighY)\)}; +\end{axis} +END_TIKZ - $gr->stamps( closed_circle($h,$k,'blue') ); - $gr->lb( new Label($h,$k-$sign*$marksep[1]/8,"($h,$k)", 'blue','center',$pos1)); - $gr->lb( new Label($domainLowX,$domainLowY+$sign*$marksep[1]/8,"($domainLowX,$domainLowY)", 'blue','center',$pos2)); - $gr->lb( new Label($domainHighX,$domainHighY+$sign*$marksep[1]/8,"($domainHighX,$domainHighY)", 'blue','center',$pos2)); $upDown = ($a < 0) ? 'up' : 'down'; $downUp = ($a < 0) ? 'down' : 'up'; @@ -129,7 +130,6 @@ if (($leftOpen==1) && ($rightOpen==1)) { $intDomain = Compute("($domainLowX,$domainHighX)"); if ($a>0) {$intRange = Compute("[$k,$rangeHighY)");} else {$intRange = Compute("($rangeLowY,$k]");} - add_functions($gr, "$a*(x-$h)**2+$k for x in ($domainLowX,$domainHighX) using color:blue and weight:2"); } elsif (($leftOpen==0) && ($rightOpen==1)) { $intDomain = Compute("[$domainLowX,$domainHighX)"); @@ -142,7 +142,6 @@ if (($leftOpen==1) && ($rightOpen==1)) { if (($a<0)&&($domainLowY<$domainHighY)) { $intRange = Compute("[$rangeLowY,$k]");} - add_functions($gr, "$a*(x-$h)**2+$k for x in [$domainLowX,$domainHighX) using color:blue and weight:2"); } elsif (($leftOpen==1) && ($rightOpen==0)) { $intDomain = Compute("($domainLowX,$domainHighX]"); @@ -155,12 +154,10 @@ if (($leftOpen==1) && ($rightOpen==1)) { if (($a<0)&&($domainLowY<$domainHighY)) { $intRange = Compute("($rangeLowY,$k]");} - add_functions($gr, "$a*(x-$h)**2+$k for x in ($domainLowX,$domainHighX] using color:blue and weight:2"); } else { $intDomain = Compute("[$domainLowX,$domainHighX]"); if ($a>0) {$intRange = Compute("[$k,$rangeHighY]");} else {$intRange = Compute("[$rangeLowY,$k]");} - add_functions($gr, "$a*(x-$h)**2+$k for x in [$domainLowX,$domainHighX] using color:blue and weight:2"); } @@ -168,18 +165,17 @@ if (($leftOpen==1) && ($rightOpen==1)) { Context("LimitedNumeric"); BEGIN_PGML -A function's graph is shown below. +A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< -Use interval notation to answer the following questions. +[@KeyboardInstructions('Use interval notation.')@]** - The domain of this function is [___________]{$intDomain}. + This function has domain [______________]{$intDomain} and range [______________]{$intRange}. - The range of this function is [___________]{$intRange}. END_PGML ############################################## @@ -212,21 +208,12 @@ END_PGML_SOLUTION BEGIN_PGML_SOLUTION -First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. - -The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. - -The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. +First, let's find the domain of this function. A function's domain is the collection of all its valid inputs. These are the [`x`] values for which we could use the graph to find an output. The end-point on the left side is [`([$domainLowX],[$domainLowY])`]. This point is [$leftOpenClose], so the value [`[$domainLowX]`] is [$leftInclusive] in the domain. The end-point on the right side is [`([$domainHighX],[$domainHighY])`]. This point is [$rightOpenClose], so the value [`[$domainHighX]`] is [$rightInclusive] in the domain. Any [`x`]-value in between [`[$domainLowX]`] and [`[$domainHighX]`] is a valid input. So the domain of the function is [`[$intDomain]`]. ----- - -Next, let's find the range of this function. A function's range is the collection of possible outputs. These are the [`y`]-values of all of the points that we see shaded on the segment. - -The end-point at the bottom is [`([$rangeLowX],[$rangeLowY])`]. This point is [$bottomOpenClose], so the value [`[$rangeLowY]`] is [$bottomInclusive] in the range. -The end-point on the top is the parabola's vertex [`([$h],[$k])`]. The value [`[$k]`] is included in the range. +Next, let's find the range of this function. A function's range is the collection of possible outputs. These are the [`y`]-values of all of the points that we see shaded on the segment. The end-point at the bottom is [`([$rangeLowX],[$rangeLowY])`]. This point is [$bottomOpenClose], so the value [`[$rangeLowY]`] is [$bottomInclusive] in the range. The end-point on the top is the parabola's vertex [`([$h],[$k])`]. The value [`[$k]`] is included in the range. So the range of the function is [`[$intRange]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg index f9e4c2db43..e9ddfc75d7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','domain','range','graph','union') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -23,11 +27,13 @@ DOCUMENT(); loadMacros( "PGstandard.pl", - "PGgraphmacros.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", ); ############################################## @@ -35,46 +41,42 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $xAsymptote = random(-3,3,1); $yAsymptote = random(-3,3,1); $k = random(1,3,1)*random(-1,1,2); $func = Compute("$k/(x-$xAsymptote)+$yAsymptote")->reduce; -($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-3,3],[-3,3],centerOrigin=>1); +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-4,4],[-4,4],centerOrigin=>1); @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - - $gr[$i]->moveTo($xAsymptote,$min[0]); - $gr[$i]->lineTo($xAsymptote,$max[0],'red',2,'dashed'); - - $gr[$i]->moveTo($min[1],$yAsymptote); - $gr[$i]->lineTo($max[1],$yAsymptote,'red',2,'dashed'); - -$xplot1=$xAsymptote-0.001; -$xplot2=$xAsymptote+0.001; - add_functions($gr[$i], "$func for x in <$min[0],$xplot1> using color:blue and weight:2"); - add_functions($gr[$i], "$func for x in <$xplot2,$max[0]> using color:blue and weight:2"); -} +$xplot1= ($k < 1) ? $k/($max[1]-$yAsymptote)+$xAsymptote : $k/($min[1]-$yAsymptote)+$xAsymptote; +$xplot2= ($k < 1) ? $k/($min[1]-$yAsymptote)+$xAsymptote : $k/($max[1]-$yAsymptote)+$xAsymptote; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot[firstcurve,domain=$min[0]:$xplot1,samples=50] {$k/(x-$xAsymptote)+$yAsymptote}; + \addplot[firstcurve,domain=$xplot2:$max[0],samples=50] {$k/(x-$xAsymptote)+$yAsymptote}; + \addplot[asymptote] coordinates {($xAsymptote,$min[0]) ($xAsymptote,$max[0])}; + \addplot[asymptote] coordinates {($min[1],$yAsymptote) ($max[1],$yAsymptote)}; +\end{axis} +END_TIKZ + + if ($k>0) { $ALT="This is a graph of a function with a vertical asymptote at x=$xAsymptote and a horizontal asymptote at y=$yAsymptote. As its x value approaches negative infinity, its y value approaches y=$yAsymptote from the bottom. As its x value approaches $xAsymptote from the left, its y value approaches negative infinity. As its x value approaches $xAsymptote from the right, its y value approaches positive infinity. As its x value approaches positive infinity, its y value approaches y=$yAsymptote from the top. " @@ -91,20 +93,17 @@ $intRange = Compute("(-infinity,$yAsymptote) U ($yAsymptote,infinity)"); Context("LimitedNumeric"); BEGIN_PGML -A function's graph is shown below. +A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< - -Note that the function has a horizontal asymptote and a vertical asymptote. +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< -Use interval notation to answer the following questions. Use upper case letter U to represent the "union" symbol in set notation. +[@KeyboardInstructions('Use interval notation.')@]** - The domain of this function is [___________]{$intDomain}. + This function has domain [______________]{$intDomain} and range [______________]{$intRange}. - The range of this function is [___________]{$intRange}. END_PGML ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg index 1e56c1afe2..f8bc50caef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg @@ -8,26 +8,31 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','domain','range','graph','union') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -35,7 +40,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $xAsymptote = random(-3,3,1); $yAsymptote = random(-3,3,1); @@ -56,13 +61,19 @@ for my $i (0..0) { $gr[$i]->lb('reset'); for my $j (@xticks) { if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + $gr[$i]->lb( new Label($j,0, $j,'black','center','top','large')); } for my $j (@yticks) { if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); } + $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); + $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); + + + $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); + $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); $gr[$i]->moveTo($xAsymptote,$min[0]); $gr[$i]->lineTo($xAsymptote,$max[0],'red',2,'dashed'); @@ -70,13 +81,23 @@ for my $i (0..0) { $gr[$i]->moveTo($min[1],$yAsymptote); $gr[$i]->lineTo($max[1],$yAsymptote,'red',2,'dashed'); -$xend1 = $xAsymptote-0.001; -$xend2 = $xAsymptote+0.001; +$xend1= ($k < 1) ? -sqrt($k/($min[1]-$yAsymptote))+$xAsymptote : -sqrt($k/($max[1]-$yAsymptote))+$xAsymptote; +$xend2= ($k < 1) ? sqrt($k/($min[1]-$yAsymptote))+$xAsymptote : sqrt($k/($max[1]-$yAsymptote))+$xAsymptote; - add_functions($gr[$i], "$func for x in <$min[0],$xend1> using color:blue and weight:2"); - add_functions($gr[$i], "$func for x in <$xend2,$max[0]> using color:blue and weight:2"); + add_functions($gr[$i], "$func for x in <$min[0],$xend1> using color:blue and weight:1"); + add_functions($gr[$i], "$func for x in <$xend2,$max[0]> using color:blue and weight:1"); } + $gr[$i]->moveTo($xend1-0.1,$func->eval(x=>"$xend1-0.1")); + $gr[$i]->arrowTo($xend1,$func->eval(x=>"$xend1"),'blue',1); + $gr[$i]->moveTo($xend2+0.1,$func->eval(x=>"$xend2+0.1")); + $gr[$i]->arrowTo($xend2,$func->eval(x=>"$xend2"),'blue',1); + $gr[$i]->moveTo($min[0]+0.1,$func->eval(x=>"$min[0]+0.1")); + $gr[$i]->arrowTo($min[0],$func->eval(x=>"$min[0]"),'blue',1); + $gr[$i]->moveTo($max[0]-0.1,$func->eval(x=>"$max[0]-0.1")); + $gr[$i]->arrowTo($max[0],$func->eval(x=>"$max[0]"),'blue',1); + + Context("Interval"); $intDomain = Compute("(-infinity,$xAsymptote) U ($xAsymptote,infinity)"); @@ -93,20 +114,17 @@ if ($k>0) { Context("LimitedNumeric"); BEGIN_PGML -A function's graph is shown below. +A function is graphed. [@EnlargeImageStatementPGML()@]** >>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< -Note that the function has a horizontal asymptote and a vertical asymptote. - -Use interval notation to answer the following questions. Use upper case letter U to represent the "union" symbol in set notation. +[@KeyboardInstructions('Use interval notation.')@]** - The domain of this function is [___________]{$intDomain}. + This function has domain [______________]{$intDomain} and range [______________]{$intRange}. - The range of this function is [___________]{$intRange}. END_PGML ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg index 80594e8111..4be5859a4d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg @@ -6,15 +6,18 @@ # Last updated: Yao 07/07/2014; # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan) -## MLT(algebra_functions_domain_range_graph_piecewise_linear_continuous) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') @@ -25,11 +28,12 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "PGgraphmacros.pl", "PGML.pl", "PCCmacros.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", ); @@ -62,36 +66,38 @@ $ymin = min(-5,$y[2]-2); $ymax = $y[1]+4; -$gr = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[400,400] -); - -$gr->moveTo($x[0],$y[0]); -$gr->arrowTo($xmin+1,$ymax,'blue','1'); -$gr->moveTo($x[0],$y[0],); -$gr->lineTo($x[1],$y[1],'blue','1'); -$gr->lineTo($x[2],$y[2],'blue','1'); -$gr->arrowTo($xmax-0.5,$ymax,'blue','1'); +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+ coordinates {($xmin+1,$ymax) ($x[0],$y[0]) ($x[1],$y[1]) ($x[2],$y[2]) ($xmax-0.5,$ymax)}; +\end{axis} +END_TIKZ $ALT = "a graph of a curve resembling the letter W, except that arrows indicate the arms of the W extend forever up and to the left, and up and to the right; the corners of the W are at ($x[0],$y[0]), ($x[1],$y[1]), and ($x[2],$y[2])"; ############################################## BEGIN_PGML -Use the graph of [`[$fname]`] below to estimate its domain and range. +A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< - +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< - The domain is [__________]{$domain} (in interval notation). - If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type *(-inf,5)U(5,10]*. +[@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the capital letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** - The range is [__________]{$range} (in interval notation). + This function has domain [______________]{$domain} and range [______________]{$range}. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph80.pg new file mode 100644 index 0000000000..dc54f68158 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph80.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Given graph, find domain and range of a function. +# +# Last updated: Yao 07/07/2014; +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + + +Context("Numeric"); +$h = random(-5,5,1); +$k = random(-4,4,1); +$c = list_random(1,-1,2,-2,0.5,-0.5,-0.25,0.25); +$f = Formula("$c(x-$h)^2+$k"); + +Context("Interval"); +$domain = Interval("(-inf,inf)"); +$range = ($c > 0) ? Interval("[$k,inf)") : Interval("(-inf,$k]"); + +$xmin = -7; +$xmax = 7; +$ymin = -7; +$ymax = 7; + +$yedge = ($c > 0) ? $ymax : $ymin; + +@xvalues = num_sort($xmin,$xmax,sqrt(($yedge-$k)/($c))+$h, -sqrt(($yedge-$k)/($c))+$h); +($start, $stop) = ($xvalues[1],$xvalues[2]); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[240,240] +); + + $gr->lb('reset'); + for my $j ($xmin+1..$xmax-1) { + if ($j % 2 == 1 or $j == 0) {next;} + $gr->lb( new Label($j, 0, $j,'black','center','top','large')); + } + + for my $j ($ymin+1..$ymax-1) { + if ($j % 2 == 1 or $j == 0) {next;} + $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); + } + +add_functions($gr, "$f for x in <$start,$stop> using color:blue and weight:1"); + +$px = ($xmax-$xmin)/240; +$gr->moveTo($start+$px,$f->eval(x=>$start+$px)); +$gr->arrowTo($start,$f->eval(x=>$start),'blue',1); +$gr->moveTo($stop-$px,$f->eval(x=>$stop-$px)); +$gr->arrowTo($stop,$f->eval(x=>$stop),'blue',1); + + +############################################## + +BEGIN_PGML +A function is graphed. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + +[@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the capital letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** + + + This function has domain [______________]{$domain} and range [______________]{$range}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Notice the arrows at the end of the lines. An arrow implies the graph will extend forever toward that direction. As a result, any [`x`] value has a corresponding [`y`] value in the graph, and the domain of the function is simply [`[$domain]`]. + +The lowest [`y`]-value is [`[$lowPointY]`] at the point [`([$lowPointX],[$lowPointY])`]. Due to those two arrows, [`y`] value can be infinitely large. The range of this function is [`[$range]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext10.pg new file mode 100644 index 0000000000..c10d4a585e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext10.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in context, +# and find the function's domain and range. +# +# Last update: Carl Yao 07/07/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( +# "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCgraphMacros.pl", + "PGcourse.pl", + "PCCmacros.pl", + "parserOneOf.pl", + "contextCurrency.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $x0 = 0; + $y0 = random(7000,10000,200); + $slope = random(-300,-600,100); +} until (int($y0/$slope)==$y0/$slope); + +$x1 = random(5,10,1); +$y1 = $slope*($x1-$x0)+$y0; + +$x2 = $x0-$y0/$slope; +$y2 = 0; + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->operators->undefine('+','-'); + +$slopeC = Currency(abs($slope)); +$y0C = Currency($y0); +$y1C = Currency($y1); + +Context("Interval"); +$domain = OneOf(Interval("[$x0,$x2]"), Interval("[$x0,inf)")); +$range = Compute("[$y2,$y0]"); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + +############################################## + +BEGIN_PGML + +[$name] bought a used car for [`[$y0C]`]. The car's value decreases at a constant rate each year. After [`[$x1]`] years, the value decreased to [`[$y1C]`]. + +Use a function to model the car's value as the number of years increases. Find this function's domain and range in this context. + + The function's domain in this context is [___________]{$domain}. + + The function's range in this context is [___________]{$range}. + +END_PGML +############################################## + +BEGIN_PGML_SOLUTION + +##Find the function's equation. + +A linear function looks like [`f(x)=mx+b`], where [`m`] is the line's slope, and [`b`] is the line's [`y`]-intercept. In this context, the value of [`x`] represents the number of years passed since the purchase, and the value of [`f(x)`] represents the car's value in dollars. + +It's given that the car was bought at [`[$y0C]`], implying the first point on the line is [`([$x0],[$y0])`]. + +It's given that the car was worth [`[$y1C]`] after [`[$x1]`] years, implying the second point on the line is [`([$x1],[$y1])`]. + +Now, we can use the slope formula to find the line's slope: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y1]-[$y0]}{[$x1]-[$x0]}\\&=\frac{[$y1-$y0]}{[$x1-$x0]}\\&=[$slope] \end{aligned}``] + +This implies the car's value decreases at [`[$slopeC]`] per year. + +Now the function's equation is [`f(x)=[$slope]x+b`]. + +The point [`([$x0],[$y0])`] implies the line's [`y`]-intercept is [`[$y0]`], so the function's equation is [`f(x)=[$slope]x+[$y0]`]. + +##Determine the function's domain + +Without a context, a linear function's domain and range are typically all real numbers (except vertical and horizontal lines). However, in this context, it makes no sense to deal with negative years or negative dollars. We need to limit the domain and range, so the number would make sense. + +The domain represents the number of years passed. The [`x`] value starts at [`0`], which represents the year when the car was purchased. It ends when the car's value becomes [`\$0`]. We need to solve an equation to find when that will happen. We substitute the value of [`f(x)`] with [`0`], and then solve for [`x`]: + + [`` +\begin{aligned}[t] + f(x) &=[$slope]x+[$y0] \\ + 0 &=[$slope]x+[$y0] \\ + 0 \mathbf{-[$y0]} &=[$slope]x+[$y0] \mathbf{-[$y0]}\\ + -[$y0] &= [$slope]x \\ + \frac{-[$y0]}{[$slope]} &= \frac{[$slope]x}{[$slope]} \\ + [$x2] &= x +\end{aligned} + ``] + +When the value of [`x`] is greater than [`[$x2]`], [`f(x)`]'s value would become negative, which would not make sense in this context. Thus, the domain of the function is [`[$domain]`]. + +##Determine the function's range + +The car's maximum value is at [`[$y0C]`] when it was first purchased, and then decreased to [`\$0`] after [`[$x2]`] years. Thus, the range of the function is [`[$range]`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext20.pg index 5761e313b2..28b7ccb8b1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext20.pg @@ -8,24 +8,32 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','domain','range') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( +# "PGgraphmacros.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "PCCgraphMacros.pl", + "PGcourse.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext30.pg new file mode 100644 index 0000000000..746b9583e5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext30.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in context, +# and find the function's domain and range. +# +# Last update: Carl Yao 07/07/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( +# "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCgraphMacros.pl", + "PGcourse.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + + $x0 = 0; + $y0 = random(2,4,0.1); +$slope = random(0.2,0.9,0.1); + +$x1 = random(5,10,1); +$y1 = $slope*($x1-$x0)+$y0; + +$x2 = random(150,200,10); +$y2 = $slope*($x2-$x0)+$y0; + +Context("Interval"); +$domain = Compute("[$x0,$x2]"); +$range = Compute("[$y0,$y2]"); + +#$sex = list_random('male','female'); +#$pronoun = 'he' if ($sex eq 'male'); +#$pronoun = 'she' if ($sex eq 'female'); +#$name = RandomName(sex=>$sex); + +############################################## + +BEGIN_PGML + +Assume a tree grows at a constant rate. When the tree was planted, it was [`[$y0]`] feet tall. After [`[$x1]`] years, the tree grew to [`[$y1]`] feet tall. + +Use a function to model the tree's height as time passes. +With the context that the tree can live [`[$x2]`] years after planting, +find this function's domain and range. + + The function's domain in this context is [___________]{$domain}. + + The function's range in this context is [___________]{$range}. + +END_PGML +############################################## + +BEGIN_PGML_SOLUTION + +##Find the function's equation. + +A linear function looks like [`f(x)=mx+b`], where [`m`] is the line's slope, and [`b`] is the line's [`y`]-intercept. In this context, the value of [`x`] represents the number of years passed since the tree was planted, and the value of [`f(x)`] represents the tree's height in feet. + +It's given that the tree was [`[$y0]`] feet tall when it was planted, implying the first point on the line is [`([$x0],[$y0])`]. + +It's given that the tree was [`[$y1]`] feet tall after [`[$x1]`] years, implying the second point on the line is [`([$x1],[$y1])`]. + +Now, we can use the slope formula to find the line's slope: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y1]-[$y0]}{[$x1]-[$x0]}\\&=\frac{[$y1-$y0]}{[$x1-$x0]}\\&=[$slope] \end{aligned}``] + +This implies the tree grows [`[$slope]`] feet every year. + +Now the function's equation is [`f(x)=[$slope]x+b`]. + +It's given that the tree was [`[$y0]`] feet tall when it was planted (or when [`x=0`]). This implies the line's [`y`]-intercept is [`[$y0]`]. So the function's equation is [`f(x)=[$slope]x+[$y0]`]. + +##Determine the function's domain + +Without a context, a linear function's domain and range are typically all real numbers (except vertical and horizontal lines). However, in this context, it makes no sense to deal with negative years. We need to limit the domain and range, so the numbers would make sense. + +The domain represents the number of years passed since the tree was planted. The [`x`] value starts at [`0`], when the tree was planted. The [`x`] value ends when the tree dies after [`[$x2]`] years. This implies the function's domain is [`[$domain]`]. + +##Determine the function's range + +When the tree was planted, it was [`[$y0]`] feet tall. This is the minimum value in the function's range. + +The tree will die after [`[$x2]`] years. To find how tall the tree would be at that year, we substitute the value of [`x`] with [`[$x2]`], and we have: + + [`` +\begin{aligned}[t] + f(x) &=[$slope]x+[$y0] \\ + f([$x2]) &=[$slope]\cdot[$x2]+[$y0] \\ + f([$x2]) &=[$slope*$x2]+[$y0] \\ + f([$x2]) &=[$y2] +\end{aligned} + ``] + +The result implies the tree will reach its maximum height of [`[$y2]`] feet when it dies at the age of [`[$x2]`] years. Thus, the function's range is [`[$range]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext40.pg new file mode 100644 index 0000000000..c2d846be76 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext40.pg @@ -0,0 +1,178 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in context, +# and find the function's domain and range. +# +# Last update: Carl Yao 07/07/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( +# "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCgraphMacros.pl", + "PGcourse.pl", + "PCCmacros.pl", +# "contextCurrency.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + + $x0 = random(10,15,1); + $y0 = random(200,300,10); +$slope = random(20,50,5); +$b = -$slope*$x0+$y0; + +$x1 = random($x0+5,$x0+10,1); +$y1 = $slope*($x1-$x0)+$y0; + +$x2 = random($x1+5,$x1+10,1); +$y2 = $slope*($x2-$x0)+$y0; + +$x3 = random(50,60,1); +$y3 = $slope*($x3-$x0)+$y0; + +Context("Interval"); +$domain = Compute("[$x0,$x3]"); +$range = Compute("[$y0,$y3]"); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + +############################################## + +BEGIN_PGML + +[$name] inherited a collection of coins when [$pronoun] was [`[$x0]`] years old. Ever since, [$pronoun] has been adding into the collection the same number of coins each year. When [$pronoun] was [`[$x1]`] years old, there were [`[$y1]`] coins in the collection. When [$pronoun] was [`[$x2]`] years old, there were [`[$y2]`] coins in the collection. At the age of [`[$x3]`], [$name] donated all [$possessive] coins to a museum. + +Use a function to model the number of coins in [$name]'s collection, starting in the year [$pronoun] inherited the collection, and ending in the year the collection was donated. Find this function's domain and range in this context. + + The function's domain in this context is [___________]{$domain}. + + The function's range in this context is [___________]{$range}. + +END_PGML +############################################## + +BEGIN_PGML_SOLUTION + +##Find the function's equation. + +A linear function looks like [`f(x)=mx+b`], where [`m`] is the line's slope, and [`b`] is the line's [`y`]-intercept. In this context, the value of [`x`] represents the number of years passed since [$name] inherited the collection, and the value of [`f(x)`] represents the number of coins in the collection. + +It's given that there were [`[$y1]`] coins when [$name] was [`[$x1]`] years old, implying the first point on the line is [`([$x1],[$y1])`]. + +It's given that there were [`[$y2]`] coins when [$name] was [`[$x2]`] years old, implying the first point on the line is [`([$x2],[$y2])`]. + +Now, we can use the slope formula to find the line's slope: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$y1]}{[$x2]-[$x1]}\\&=\frac{[$y2-$y1]}{[$x2-$x1]}\\&=[$slope] \end{aligned}``] + +This implies [$name] added [`[$slope]`] coins into the collection every year. + +Now the function's equation is [`f(x)=[$slope]x+b`]. + +To find the line's [`y`]-intercept, there are two methods. + +###First method to find [`y`]-intercept + +We substitute one of the given points into [` f(x)=[$slope]x+b `]. We choose to use [`([$x1],[$y1])`]. + + [` +\begin{aligned} + f(x) &= [$slope]x + b \\ + [$y1] &= [$slope] \cdot [$x1] + b \\ + [$y1] &= [$slope*$x1] + b \\ + [$y1]\mathbf{{}-[$slope*$x1]} &= [$slope*$x1] + b\mathbf{{}-[$slope*$x1]} \\ + [$b] &= b\\ + b &= [$b] +\end{aligned} +`] + +The function's equation is [`f(x)=[$slope]x+[$b]`]. + +###Second method to find [`y`]-intercept + +We use the line's point-slope equation [` y-y_{1}=m(x-x_{1}) `]. Again, we choose to use the point [`([$x1],[$y1])`]. + + [` +\begin{aligned} + y-y_{1} &= m(x-x_{1}) \\ + y-[$y1] &= [$slope](x-[$x1]) \\ + y-[$y1] &= [$slope]x+[$slope] \cdot (-[$x1]) \\ + y-[$y1] &= [$slope]x-[$slope*$x1] \\ + y-[$y1]\mathbf{{}+[$y1]} &= [$slope]x-[$slope*$x1] \mathbf{{}+[$y1]} \\ + y &= [$slope]x+[$b] +\end{aligned} +`] + +The function's equation is [`f(x)=[$slope]x+[$b]`]. + +##Determine the function's domain + +Without a context, a linear function's domain and range are typically all real numbers (except vertical and horizontal lines). However, in this context, it makes no sense to deal with negative years. We need to limit the domain and range, so the numbers would make sense. + +The domain represents the number of years passed since [$name] inherited the collection. The [`x`] value starts at [`[$x0]`], when [$name] inherited the collection. The [`x`] value ends when [$name] donated the collection when [$pronoun] was [`[$x3]`] years old. This implies the function's domain is [`[$domain]`]. + +##Determine the function's range + +The collection started when [$name] was [`[$x0]`] years old. To find the number of coins in that year, we need to find the value of [`f([$x0])`]: + + [`` +\begin{aligned}[t] + f(x) &=[$slope]x+[$b] \\ + f([$x0]) &=[$slope]\cdot[$x0]+[$b] \\ + f([$x0]) &=[$slope*$x0]+[$b] \\ + f([$x0]) &=[$y0] +\end{aligned} + ``] + +This implies there were [`[$y0]`] coins when [$name] inherited the collection. This is the minimum value in the domain. + +[$name] donated the collection when [$pronoun] was [`[$x3]`] years old. To find the number of coins at that year, we need to find the value of [`f([$x3])`]: + + [`` +\begin{aligned}[t] + f(x) &=[$slope]x+[$b] \\ + f([$x3]) &=[$slope]\cdot[$x3]+[$b] \\ + f([$x3]) &=[$slope*$x3]+[$b] \\ + f([$x3]) &=[$y3] +\end{aligned} + ``] + +The result implies there were [`[$y3]`] coins when the collection was donated. This is the maximum value in the range. Thus, the function's range is [`[$range]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext50.pg new file mode 100644 index 0000000000..8d792ddeb5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext50.pg @@ -0,0 +1,250 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use quadratic equation to model the height of flying objects. +# Find domain and range of the function. +# +# Last edit by: Carl Yao 07/09/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application','domain','range') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(t => 'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +$initSpeed = random(320,640,32); +$a = -16; +$b = $initSpeed; +$c = 0; + +$func = Compute("$a*t**2+$b*t+$c")->reduce; +$funcX = Compute("$a*x**2+$b*x+$c")->reduce; + +#for alternative display and title purposes + + $xVertex = -$b/(2*$a); + $yVertex = $func->eval(t=>$xVertex); + $vertex=Point($xVertex,$yVertex); + $yIntercept=Point(0,$c); + + @temp = $vertex->value; + $extraPointX = $temp[0]+1; + $extraPointY = $func->eval(t=>$extraPointX); + $extraPoint = Point($extraPointX,$extraPointY); + +$tMax = $xVertex; +$hMax = $yVertex; +$tBack = 2*$xVertex; +$t1 = random(1,int($tBack-1),1); +$h1 = $func->eval(t=>$t1); +do {$t2 = random(1,int($tMax-1),1);} until ($t2!=$t1); +$t3 = 2*$tMax-$t2; +$h2 = $func->eval(t=>$t2); + +$tMaxU = NumberWithUnits("$tMax s"); +$hMaxU = NumberWithUnits("$hMax ft"); +$tBackU = NumberWithUnits("$tBack s"); +$t1U = NumberWithUnits("$t1 s"); +$h1U = NumberWithUnits("$h1 ft"); +$t2U = NumberWithUnits("$t2 s"); +$t3U = NumberWithUnits("$t3 s"); +$h2U = NumberWithUnits("$h2 ft"); + +Context("Interval"); +$domain = Compute("[0,$tBack]"); +$range = Compute("[0,$hMax]"); +Context("Numeric"); +Context()->variables->add(t => 'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +# to show alternative text for graphs +@alt=(); + + $alt="This picture shows the graph of a parabola. Its vertex is at $vertex, and it passes through the points (0,0) and ($tBack,0)"; + + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xVertex,0,2*$xVertex],[$yVertex,0,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0,0) { + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + $gr->lb( new Label($max[0]-$marksep[0]/2, -$marksep[1]/8, t,'black','center','top')); + $gr->lb( new Label($marksep[0]/8, $max[1]-$marksep[1]/2, h,'black','left','middle')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + +add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight:1"); +} + + + + +############################################## + +BEGIN_PGML + +An object was shot up into the air at an initial vertical speed of [`[$initSpeed]`] feet per second. Its height as time passes can be modeled by the quadratic function [`f`], where [`f(t)=[$func]`]. Here [`t`] represents the number of seconds since the object's release, and [`f(t)`] represents the object's height in feet. + +Find the function's domain and range in this context. + + The function's domain in this context is [__________]{$domain}. + + The function's range in this context is [__________]{$range}. + +END_PGML + +############################################## + +$func1 = $func; +$func1 =~ s/t/($xVertex)/g; +$func1 =~ s/~~*//g; + +$func2 = Compute("-$a*t-$b")->reduce; +$func3 = Compute("-$a*t")->reduce; + +$func4 = $func; +$func4 =~ s/t/($t1)/g; +$func4 =~ s/~~*//g; + +$func5 = Compute("$a*t**2+$b*t-$h2")->reduce; +$s1 = -$h2; +$s2 = -$b; +$s3 = $b**2-4*$a*$s1; +$s4 = 2*$a; +$s5 = sqrt($s3); + + +$gr->stamps( closed_circle($xVertex,$yVertex,'blue') ); +$gr->lb( new Label($xVertex,$yVertex,"($xVertex,$yVertex)", 'blue','left','bottom')); + +#$gr->moveTo( $xVertex,$min[1] ); +#$gr->lineTo( $xVertex,$max[1],'red',1,'dashed'); + +$gr->stamps( closed_circle(0,0,'blue') ); +$gr->lb( new Label(0,0,"(0,0)", 'blue','right','bottom')); +$gr->stamps( closed_circle($tBack,0,'blue') ); +$gr->lb( new Label($tBack,0,"($tBack,0)", 'blue','left','bottom')); + +#$gr->stamps( closed_circle($t1,$h1,'blue') ); +#$gr->lb( new Label($t1,$h1,"($t1,$h1)", 'blue','center','bottom')); + +#$gr->moveTo( $min[0], $h2 ); +#$gr->lineTo( $max[0],$h2,'red',1,'dashed'); + +#$gr->stamps( closed_circle($t2,$h2,'blue') ); +#$gr->lb( new Label($t2,$h2,"($t2,$h2)", 'blue','left','top')); + +#$gr->stamps( closed_circle($t3,$h2,'blue') ); +#$gr->lb( new Label($t3,$h2,"($t3,$h2)", 'blue','left','top')); + + +BEGIN_PGML_SOLUTION + +##Find the function's domain + +The function [`f`] given by the rule [`f(t)=[$func]`] is quadratic. Identify that [`a=[$a], b=[$b], c=[$c]`]. + +In this context, the value of [`t`] makes sense when the object was thrown into the air, until the object landed. The parabola's [`x`]-intercepts represent the moments when the object was at a height of [`0`]: on the ground. We will solve the equation [`f(t)=0`] to find its [`x`]-intercepts. We have: + + [` +\begin{aligned} + f(t) &= [$func] \\ + 0 &= [$func] \\ + 0 &= -t([$func2]) \\ + -t &= 0 & \text{or} && [$func2]&=0 \\ + t &= 0 & \text{or} && [$func3]&=[$b] \\ + t &= 0 & \text{or} && t&=[$tBack] +\end{aligned} +`] + +This parabola has two [`x`]-intercepts: [`(0,0)`] and [`([$tBack],0)`]. The point [`(0,0)`] represents the moment when the object was released; the point [`([$tBack],0)`] implies the object fell back to the ground after [`[$tBackU]`]. + +Thus, the function's domain is [`[$domain]`]. + +##Find the function's range + +The function's value represents the object's height. Its minimum value is [`0`], when the object was on the ground. We need to find the object's maximum height. + +Since [`a<0`], this parabola opens down. Its vertex represents the maximum height the object can go and when it got there. + +To find the vertex, we first find the parabola's axis of symmetry by the axis formula: + + [` +\begin{aligned} + t &= -\frac{b}{2a} \\ + t &= -\frac{[$b]}{2([$a])} \\ + t &= [$xVertex] +\end{aligned} +`] + +Next, we substitute [`t= [$xVertex]`] into [`f`]'s formula, and we have: + + [` +\begin{aligned} + f(t) &= [$func] \\ + f([$xVertex]) &= [$func1] \\ + f([$xVertex]) &= [$yVertex] +\end{aligned} +`] + +The parabola's vertex is at [`[$vertex]`]. This implies that [`[$tMaxU]`] after the release, the object reached its maximum height of [`[$hMaxU]`]. + +Thus, the function's range is [`[$range]`]. + +The function's graph helps understanding. + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext60.pg new file mode 100644 index 0000000000..0a7ad97a9c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext60.pg @@ -0,0 +1,259 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use quadratic equation to model the height of flying objects. +# Find domain and range in context. +# +# Last edit by: Carl Yao 07/08/14 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application','domain','range') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "parserNumberWithUnits.pl", + "parserOneOf.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(t => 'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + + +$a = -4.9; +$xInt1 = random(-5,-1,1); +$xInt2 = random(20,30,0.1); +$b = -$a*$xInt1-$a*$xInt2; +$c = $a*$xInt1*$xInt2; + +$func = Compute("$a*t**2+$b*t+$c")->reduce; +$funcX = Compute("$a*x**2+$b*x+$c")->reduce; + +#for alternative display and title purposes + + $xVertex = Real(-$b/(2*$a)); + $yVertex = Real($func->eval(t=>$xVertex)); + $vertex=Point($xVertex,$yVertex); + $yIntercept=Point(0,$c); + + @temp = $vertex->value; + $extraPointX = $temp[0]+1; + $extraPointY = Real($func->eval(t=>$extraPointX)); + $extraPoint = Point($extraPointX,$extraPointY); + +$tMax = $xVertex; +$hMax = $yVertex; +$tBack = $xInt2; +$t1 = random(1,int($tBack-1),1); +$h1 = $func->eval(t=>$t1); +do {$t2 = random(1,int($tMax-1),1);} until ($t2!=$t1); +$t3 = 2*$tMax-$t2; +$h2 = $func->eval(t=>$t2); + +$tMaxU = NumberWithUnits("$tMax s"); +$hMaxU = NumberWithUnits("$hMax m"); +$tBackU = NumberWithUnits("$tBack s"); +$cU = NumberWithUnits("$c m"); +$bU = NumberWithUnits("$b m/s"); +$t1U = NumberWithUnits("$t1 s"); +$h1U = NumberWithUnits("$h1 m"); +$t2U = NumberWithUnits("$t2 s"); +$t3U = NumberWithUnits("$t3 s"); +$h2U = NumberWithUnits("$h2 m"); + +Context("Interval"); +$domain = Compute("[0,$xInt2]"); +$range = Compute("[0,$hMax]"); +$domainOptions = OneOf($domain, Compute("[0,inf)")); +Context("Numeric"); +Context()->variables->add(t => 'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +# to show alternative text for graphs +@alt=(); + + $alt="This picture shows the graph of a parabola. Its vertex is at $vertex, and it passes through the points (0,$c) and ($xInt2,0)"; + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xVertex,$xInt1-5,$xInt2],[$yVertex,0,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0,0) { + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + $gr->lb( new Label($max[0]-$marksep[0]/2, -$marksep[1]/8, t,'black','center','top')); + $gr->lb( new Label($marksep[0]/8, $max[1]-$marksep[1]/2, h,'black','left','middle')); + + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + +add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight:1"); +} + +############################################## + +BEGIN_PGML + +From a clifftop over the ocean [`[$cU]`] above sea level, an object was shot straight up into the air with an initial vertical speed of [`[$bU]`]. On its way down it missed the cliff and fell into the ocean, where it floats on the surface. Its height (above sea level) as time passes can be modeled by the quadratic function [`f`], where [`f(t)=[$func]`]. Here [`t`] represents the number of seconds since the object's release, and [`f(t)`] represents the object's height (above sea level) in meters. + +Find the function's domain and range in this context. + + The function's domain in this context is [__________]{$domainOptions}. + + The function's range in this context is [__________]{$range}. + +END_PGML + +############################################## + +$func1 = $func; +$func1 =~ s/t/($xVertex)/g; +$func1 =~ s/~~*//g; + +$func4 = $func; +$func4 =~ s/t/($t1)/g; +$func4 =~ s/~~*//g; + +$s1 = -$h2; +$s2 = -$b; +$s4 = 2*$a; + +$s03 = $b**2-4*$a*$c; +$s05 = Real(sqrt($s03)); + +$s6 = $c-$h2; +$func5 = Compute("$a*t**2+$b*t+$s6")->reduce; +$s7 = $b**2-4*$a*$s6; +$s8 = Real(sqrt($s7)); + +$gr->stamps( closed_circle($xVertex,$yVertex,'blue') ); +$gr->lb( new Label($xVertex,$yVertex,"($xVertex,$yVertex)", 'blue','left','bottom')); + +$gr->stamps( closed_circle(0,$c,'blue') ); +$gr->lb( new Label(0,$c,"(0,$c)", 'blue','right','bottom')); + +#$gr->moveTo( $xVertex,$min[1] ); +#$gr->lineTo( $xVertex,$max[1],'red',1,'dashed'); + +$gr->stamps( closed_circle($tBack,0,'blue') ); +$gr->lb( new Label($tBack,0,"($tBack,0)", 'blue','left','bottom')); + +#$gr->stamps( closed_circle($t1,$h1,'blue') ); +#$gr->lb( new Label($t1,$h1,"($t1,$h1)", 'blue','right','top')); + +#$gr->moveTo( $min[0], $h2 ); +#$gr->lineTo( $max[0],$h2,'red',1,'dashed'); + +#$gr->stamps( closed_circle($t2,$h2,'blue') ); +#$gr->lb( new Label($t2,$h2,"($t2,$h2)", 'blue','right','top')); + +#$gr->stamps( closed_circle($t3,$h2,'blue') ); +#$gr->lb( new Label($t3,$h2,"($t3,$h2)", 'blue','left','top')); + +BEGIN_PGML_SOLUTION + +##Find the function's domain + +The function [`f`] given by the rule [`f(t)=[$func]`] is quadratic. Identify that [`a=[$a], b=[$b], c=[$c]`]. + +In this context, the value of [`t`] makes sense since the object was thrown into the air, until the object landed. + +The parabola's [`y`]-intercept represents the moment when the object was thrown into the air. At that moment, [`t=0`]. + +The parabola's right-side [`x`]-intercept represents the moment the object landed on the ground. We will solve the equation [`f(t)=0`] to find its [`x`]-intercepts. We have: + + [` +\begin{aligned} + f(t) &= [$func] \\ + 0 &= [$func] \\ + t &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + t &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$c])}}{2([$a])} \\ + t &= \frac{[$s2] \pm \sqrt{[$s03]}}{[$s4]} \\ + t &= \frac{[$s2] \pm [$s05]}{[$s4]} \\ + t &= \frac{[$s2] + [$s05]}{[$s4]} & \text{or} && t &= \frac{[$s2] - [$s05]}{[$s4]} \\ + t &= [$xInt1] & \text{or} && t &= [$xInt2] +\end{aligned} +`] + +This parabola has two [`x`]-intercepts: [`([$xInt1],0)`] and [`([$xInt2],0)`]. The point [`([$xInt1],0)`] represents an imaginary moment before the object was released, as if it had shot up from the ocean to the clifftop before its journey upward. The point [`([$xInt2],0)`] implies the object fell into the ocean after [`[$tBackU]`]. + +Thus, the function's domain is [`[$domain]`]. + +##Find the function's range + +The function's value represents the object's height. Its minimum value is [`0`], when the object landed on the ground. We need to find the object's maximum height. + +Since [`a<0`], this parabola opens down. Its vertex represents the maximum height the object can go and when it got there. + +To find the vertex, we first find the parabola's axis of symmetry by the axis formula: + + [` +\begin{aligned} + t &= -\frac{b}{2a} \\ + t &= -\frac{[$b]}{2([$a])} \\ + t &= [$xVertex] +\end{aligned} +`] + +Next, we substitute [`t= [$xVertex]`] into [`f`]'s formula, and we have: + + [` +\begin{aligned} + f(t) &= [$func] \\ + f([$xVertex]) &= [$func1] \\ + f([$xVertex]) &= [$yVertex] +\end{aligned} +`] + +The parabola's vertex is at [`[$vertex]`]. This implies that [`[$tMaxU]`] after the release, the object reached its maximum height of [`[$hMaxU]`]. + +Thus, the function's range is [`[$range]`]. + +The function's graph helps understanding. + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext70.pg new file mode 100644 index 0000000000..5dbde1b5aa --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext70.pg @@ -0,0 +1,268 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given the length of total fence, build a rectangular area by a river. +# Use a function to model the area, and find the function's domain and range. +# +# Last edit by: Carl Yao 07/10/14 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application','domain','range') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(w => 'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +$fence = random(400,500,10); +$a = -2; +$b = $fence; +$c = 0; + +$func = Compute("$a*w**2+$b*w+$c")->reduce; +$funcX = Compute("$a*x**2+$b*x+$c")->reduce; + +#for alternative display and title purposes + + $xVertex = -$b/(2*$a); + $yVertex = $func->eval(w=>$xVertex); + $vertex=Point($xVertex,$yVertex); + $yIntercept=Point(0,$c); + + @temp = $vertex->value; + $extraPointX = $temp[0]+1; + $extraPointY = $func->eval(w=>$extraPointX); + $extraPoint = Point($extraPointX,$extraPointY); + +$width = $xVertex; +$length = $fence - 2*$xVertex; +$area = $yVertex; + +$widthU = NumberWithUnits("$width ft"); +$lengthU = NumberWithUnits("$length ft"); +$areaU = NumberWithUnits("$yVertex ft^2"); + +Context("Interval"); +Context()->flags->set(ignoreEndpointTypes => 1); +$xInt1 = 0; +$xInt2 = $b/2; +$domain = Compute("[0,$xInt2]"); +$range = Compute("[0,$yVertex]"); + +Context("Numeric"); +Context()->variables->add(w => 'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +# to show alternative text for graphs +@alt=(); + + $alt="This picture shows a parabola's graph. This parabola's vertex is $vertex. Its y-intercept is $yIntercept. It's two x-intercepts are (0,0) and ($xInt2,0)."; + + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xVertex,0,2*$xVertex],[$yVertex,0,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0,0) { + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + +add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight:1"); +} + +############################################## + +BEGIN_PGML + +You will build a rectangular sheep pen next to a river. There is no need to build a fence along the river, so you only need to build three sides. You have a total of [`[$fence]`] feet of fence to use. Use a function to model the area, where the input is the length of the two sides perpendicular to the river. Find the function's domain and range in this context. + + The function's domain is [____________]{$domain}. + + The function's range is [____________]{$range}. + +END_PGML + +############################################## + +#Build a diagram picture. +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +$base = 15; +$height = 10; + +@x = (($xmax-$base)/2,($xmax+$base)/2); +@y = (($ymax-$height)/2,($ymax+$height)/2); + +$cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/10; + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-0.5,"length: ($fence-2w) ft",'black','center','middle')); +$picture->lb( new Label($x[1]+1,($y[0]+$y[1])/2,"width: w ft",'black','right','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2,$y[1]+1,"RIVER",'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[0], darkblue,3); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$picture->moveTo($xmin,$y[1]); +$picture->lineTo($xmax,$y[1], darkblue,3); + +$penAlt = "A diagram of a rectangular pen. Along the top side is a river. The right side is labeled w ft, and the bottom side is labeled ($fence-2w) ft."; + +############################################## + +$func1 = $func; +$func1 =~ s/w/($xVertex)/g; +$func1 =~ s/~~*//g; + +$gr->stamps( closed_circle($xVertex,$yVertex,'blue') ); +$gr->lb( new Label($xVertex,$yVertex,"($xVertex,$yVertex)", 'blue','left','bottom')); +$gr->moveTo( $xVertex,$min[1] ); +$gr->lineTo( $xVertex,$max[1],'red',2,'dashed'); + +$gr->stamps( closed_circle(0,0,'blue') ); +$gr->lb( new Label(0,0,"(0,0)", 'blue','right','bottom')); + +$gr->stamps( closed_circle($xInt2,0,'blue') ); +$gr->lb( new Label($xInt2,0,"($xInt2,0)", 'blue','left','bottom')); + +Context()->texStrings; +BEGIN_SOLUTION +$PAR +Drawing a diagram should help us creat a function for the area of the pen. +$PAR +$BCENTER +\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400,extra_html_tags=>'alt = "$penAlt" title = "$penAlt"') \} +$ECENTER +$PAR +Let the width be \(w\) ft, and the length be \(l\) ft. Since there are only three sides of the fence, we have: +\[ +\begin{aligned}[t] +l+2w &= $fence \\ +l &= $fence-2w +\end{aligned} +\] +$PAR +If the pen's width is \(w\) feet, then its length is \( ($fence-2w) \) feet. Now we can build a function for the area of the pen: +$PAR +\[ f(w)=($fence-2w)w \] +$PAR +\[ f(w)=-2w^{2}+$fence w \] +$PAR +In this formula, \(w\) represents the pen's width in feet, and \(f(w)\) represents the pen's area in square feet. Identify that \(a=$a,b=$b,c=$c\). +$PAR +Each output of this function represents a possible area of the pen. The maximum area happens at the parabola's vertex. +$PAR +To find the vertex, we first find the parabola's axis of symmetry by using the axis formula: +$PAR +\[ +\begin{aligned}[t] + w &= -\frac{b}{2a} \\ + w &= -\frac{$b}{2($a)} \\ + w &= $xVertex +\end{aligned} +\] +$PAR +Next, we substitute \(w= $xVertex \) into the rule for the \(f\), and we have: +$PAR +\[ +\begin{aligned}[t] + f(w) &= $func \\ + f($xVertex) &= $func1 \\ + f($xVertex) &= $yVertex +\end{aligned} +\] +$PAR +The parabola's vertex is at \($vertex\). This implies that the pen's maximum area is \($yVertex\) square feet. This happens when the width is \($xVertex\) feet, and the length is \($fence - 2($xVertex)\), or \($length\), feet. +$PAR +So when the length is \($length\) feet and the width is \($xVertex\) feet, the pen has a maximum possible area of \($yVertex\) square feet. +$PAR +$HR +$PAR +Now we can find the function's domain and range. +$PAR +The minimum value of the width (independent variable) is \(0\). To find the maximum value is the right-side \(x\)-intercept. To locate this point, we substitute \(f(w)\) with \(0\), and we have: +$PAR +\[ +\begin{aligned}[t] + f(w) &= $func \\ + 0 &= $func \\ + 0 &= $a w(w-$xInt2) \\ + $a w &= 0 \text{ or } w-$xInt2=0 \\ + w &= 0 \text{ or } w=$xInt2 +\end{aligned} +\] +$PAR +The right-side \(x\)-intercept is \( ($xInt2,0) \). +$PAR +Thus, the domain of the function is \( [0,$xInt2] \). If we make the width bigger than \($xInt2\), the area would be negative, and it would not make sense in this context. +$PAR +The function's range is \( [0,$yVertex] \). +$PAR +The following graph illustrates our findings. +$PAR +$BCENTER +\{ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt" title = "$alt"' )\} +$ECENTER + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation10.pg index d2bd940d2f..db56217a57 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation10.pg @@ -6,14 +6,18 @@ # Last updated: Yao 2/8/2017 # ENDDESCRIPTION -## DBCCSS('F-IF1.2') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,6 +29,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextFraction.pl", + "contextFiniteSolutionSets.pl", "PGcourse.pl", ); @@ -51,11 +56,9 @@ $y2 = $func->eval(x=>$x2); $s1 = Compute("$m*x")->reduce; -Context("LimitedFraction"); -Context()->flags->set(requirePureFractions=>1); -Context()->flags->set(showMixedNumbers=>0); -$ans1 = Compute($x1); -$ans2 = Compute($x2); +Context("FiniteSolutionSets"); +$ans1 = Formula("{$x1}"); +$ans2 = Formula("{$x2}"); ############################################## @@ -64,12 +67,15 @@ TEXT(beginproblem()); BEGIN_PGML -Solve the following equations for [`x`], where [`[$fname](x)=[$func]`]. +Solve for [`x`], where [`[$fname](x)=[$func]`]. + +[@KeyboardInstructions('If there is no real solution, type no [|real solution|]*.')@]** -[@KeyboardInstructions('If there is more than one solution, use commas to separate your answers. If there is no real solution, type [|no real solution|]*.')@]** +a. [`[$fname](x)=[$y1]`] + [____________]{$ans1} -a. If [`[$fname](x)=[$y1]`], then [`x=`][____________]{$ans1}. -b. If [`[$fname](x)=[$y2]`], then [`x=`][____________]{$ans2}. +b. [`[$fname](x)=[$y2]`] + [____________]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation20.pg index b29a27e64b..d5d9cf16c2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation20.pg @@ -6,14 +6,18 @@ # Last updated: Yao 2/8/2017 # ENDDESCRIPTION -## DBCCSS('F-IF1.2') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -24,6 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", + "contextFiniteSolutionSets.pl", "PGcourse.pl", ); @@ -32,24 +37,17 @@ loadMacros( ############################################## -Context("Numeric"); -Context()->noreduce("(-x)-y","(-x)+y"); -$fname = RandomVariableName(type=>function); -Context()->strings->add("no real solutions"=>{}, - "no real solution"=>{alias=>'no real solutions'}, - "none"=>{alias=>'no real solutions'}, - ); - +$fname = RandomVariableName(type=>'function'); $a = non_zero_random(-10,10,1); $func = Compute("x**2+$a")->reduce; $x1 = random(1,5,1); $y1 = $func->eval(x=>$x1); $y2 = random($a-10,$a-1,1); -$x2 = Compute("no real solution"); -$ans1 = List($x1,-$x1); -$ans2 = Compute($x2); +Context("FiniteSolutionSets"); +$ans1 = Formula("{$x1,-$x1}"); +$ans2 = Compute("no real solution"); ############################################## @@ -60,10 +58,13 @@ BEGIN_PGML Solve for [`x`], where [`[$fname](x)=[$func]`]. -[@KeyboardInstructions('If there is more than one solution, use commas to separate your answers. If there is no real solution, type [|no real solution|]*.')@]** +[@KeyboardInstructions('If there is no real solution, type no [|real solution|]*.')@]** + +a. [`[$fname](x)=[$y1]`] + [____________]{$ans1} -a. If [`[$fname](x)=[$y1]`], then [`x=`][____________]{$ans1}. -b. If [`[$fname](x)=[$y2]`], then [`x=`][____________]{$ans2}. +b. [`[$fname](x)=[$y2]`] + [____________]{$ans2->cmp(typeMatch=>$ans1)} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation30.pg index c7e7604496..bc43a4a2d1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionEquation30.pg @@ -6,14 +6,18 @@ # Last updated: Yao 2/8/2017 # ENDDESCRIPTION -## DBCCSS('F-IF1.2') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -24,6 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", + "contextFiniteSolutionSets.pl", "PGcourse.pl", ); @@ -51,7 +56,13 @@ $c = $product+$y1; $func = Compute("x**2+$sum*x+$c")->reduce; -$ans = List(-$a,-$b); +$s1 = Compute("x**2+$sum*x+$product")->reduce; +$s2 = Compute("(x+$a)(x+$b)")->reduce; + +Context("FiniteSolutionSets"); +$na = -$a; +$nb = -$b; +$ans = Formula("{$na,$nb}"); ############################################## @@ -60,20 +71,18 @@ TEXT(beginproblem()); BEGIN_PGML -Solve the following equation for [`x`], where [`[$fname](x)=[$func]`]. +Solve for [`x`], where [`[$fname](x)=[$func]`]. -[@KeyboardInstructions('If there is more than one solution, use commas to separate your answers. If there is no real solution, type [|no real solution|]*.')@]** +[@KeyboardInstructions('If there is no real solution, type no [|real solution|]*.')@]** -If [`[$fname](x)=[$y1]`], then [`x=`][____________]{$ans}. +[`[$fname](x)=[$y1]`] +[____________]{$ans} END_PGML ############################################## -$s1 = Compute("x**2+$sum*x+$product")->reduce; -$s2 = Compute("(x+$a)(x+$b)")->reduce; - BEGIN_PGML_SOLUTION To solve for [`x`] for a given function value, we substitute [`[$fname](x)`] with [`[$func]`]: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext10.pg index 5e4c8709ea..3c1b771a9e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext10.pg @@ -7,29 +7,34 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( +# "PGgraphmacros.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "PCCgraphMacros.pl", + "PGcourse.pl", "PCCmacros.pl", "contextCurrency.pl", "parserRadioButtons.pl", "PGchoicemacros.pl", - "PGcourse.pl" ); ############################################## @@ -69,30 +74,29 @@ $possessive = 'her' if ($sex eq 'female'); $name = RandomName(sex=>$sex); @answers = ( - numberWord($x1,capital=>1)." days after $name started $possessive piggy bank, there were `$y1C` in it.", - numberWord($y1,capital=>1)." days after $name started $possessive piggy bank, there were `$x1C` in it.", - "The piggy bank started with `$y1C` in it, and $name saves `$x1C` each day.", - "The piggy bank started with `$x1C` in it, and $name saves `$y1C` each day.", + numberWord($x1,capital=>1)." days after $name started $possessive piggy bank, there were ".math_ev3($y1C)." in it.", + numberWord($y1,capital=>1)." days after $name started $possessive piggy bank, there were ".math_ev3($x1C)." in it.", + "The piggy bank started with ".math_ev3($y1C)." in it, and $name saves ".math_ev3($x1C)." each day.", + "The piggy bank started with ".math_ev3($x1C)." in it, and $name saves ".math_ev3($y1C)." each day.", ); #Create a hash and its inverse that randomizes the order of the four graphs. -%scramble = (); -%inverse = (); +@scramble = NchooseK(4,4); +@inverse = (); @answersShuffled = (); for my $i (0..3) { - do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); - $scramble{$i} = $temp; - $inverse{$temp} = $i; - $answersShuffled[$i] = @answers[$scramble{$i}]; - $answersShuffled[$i]=$ALPHABET[$i].'. '.$answersShuffled[$i]; -}; + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} -$correctAns = @answersShuffled[$inverse{0}]; +$correctAns = $answersShuffled[$inverse[0]]; $radio = RadioButtons( - ~~@answersShuffled, - $correctAns, # correct answer - order => ~~@answersShuffled, +[[ numberWord($x1,capital=>1)." days after $name started $possessive piggy bank, there were ".math_ev3($y1C)." in it.", + numberWord($y1,capital=>1)." days after $name started $possessive piggy bank, there were ".math_ev3($x1C)." in it.", + "The piggy bank started with ".math_ev3($y1C)." in it, and $name saves ".math_ev3($x1C)." each day.", + "The piggy bank started with ".math_ev3($x1C)." in it, and $name saves ".math_ev3($y1C)." each day.", +]],0, labels => "ABC", ); @@ -118,7 +122,7 @@ For [`f(x)=[$func]`], the value of [`x`] represents the number of days passed si It's helpful to understand those values by units: [`x`] is in "days," while [`f(x)`] is in "dollars." -For [`f([$x1])=[$y1]`], [`[$x1]`] represents [`[$x1]`] days, while [`[$y1]`] represents [`[$y1]`] dollars. The correct solution is: [$correctAns] +For [`f([$x1])=[$y1]`], [`[$x1]`] represents [`[$x1]`] days, while [`[$y1]`] represents [`[$y1]`] dollars. The correct solution is [$radio->correct_ans]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext20.pg index 8aae565dd6..b58b85a032 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext20.pg @@ -7,29 +7,35 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( +# "PGgraphmacros.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "PCCgraphMacros.pl", + "PGcourse.pl", "PCCmacros.pl", "contextCurrency.pl", "parserRadioButtons.pl", "contextFraction.pl", - "PGcourse.pl" + "PGchoicemacros.pl", ); ############################################## @@ -63,30 +69,31 @@ $x1C = Currency($x1); #$name = RandomName(sex=>$sex); @answers = ( - "Each pass costs `$x1C`, and it works for `$y1` days.", - "Each pass costs `$y1C`, and it works for `$x1` days.", - "If a pass costs `$y1C`, it will work for `$x1` days.", - "If a pass costs `$x1C`, it will work for `$y1` days.", + "Each pass costs ".math_ev3($x1C).", and it works for ".math_ev3($y1)." days.", + "Each pass costs ".math_ev3($y1C).", and it works for ".math_ev3($x1)." days.", + "If a pass costs ".math_ev3($y1C).", it will work for ".math_ev3($x1)." days.", + "If a pass costs ".math_ev3($x1C).", it will work for ".math_ev3($y1)." days.", ); #Create a hash and its inverse that randomizes the order of the four choices. -%scramble = (); -%inverse = (); +@scramble = NchooseK(4,4); +@inverse = (); @answersShuffled = (); for my $i (0..3) { - do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); - $scramble{$i} = $temp; - $inverse{$temp} = $i; - $answersShuffled[$i] = @answers[$scramble{$i}]; - $answersShuffled[$i]=$ALPHABET[$i].'. '.$answersShuffled[$i]; -}; + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} -$correctAns = @answersShuffled[$inverse{3}]; +$correctAns = $answersShuffled[$inverse[0]]; $radio = RadioButtons( - ~~@answersShuffled, - $correctAns, # correct answer - order => ~~@answersShuffled, +[[ + "If a pass costs ".math_ev3($x1C).", it will work for ".math_ev3($y1)." days.", + "Each pass costs ".math_ev3($x1C).", and it works for ".math_ev3($y1)." days.", + "Each pass costs ".math_ev3($y1C).", and it works for ".math_ev3($x1)." days.", + "If a pass costs ".math_ev3($y1C).", it will work for ".math_ev3($x1)." days.", +]], +0, labels => "ABC", ); @@ -112,7 +119,7 @@ For [`g(x)=[$func]`], the value of [`x`] represents the cost of a pass, and the It's helpful to understand those values by units: [`x`] is in "dollars," while [`g(x)`] is in "days." -For [`g([$x1])=[$y1]`], [`[$x1]`] represents [`[$x1]`] dollars, while [`[$y1]`] represents [`[$y1]`] days. The correct solution is: [$correctAns] +For [`g([$x1])=[$y1]`], [`[$x1]`] represents [`[$x1]`] dollars, while [`[$y1]`] represents [`[$y1]`] days. The correct solution is [$radio->correct_ans]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext30.pg index fbf7474c2f..f373a65e24 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext30.pg @@ -7,30 +7,35 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(platesandbowls) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( +# "PGgraphmacros.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "PCCgraphMacros.pl", + "PGcourse.pl", "PCCmacros.pl", "contextCurrency.pl", "parserRadioButtons.pl", "contextFraction.pl", - "PGcourse.pl" + "PGchoicemacros.pl", ); ############################################## @@ -40,6 +45,7 @@ Context("Fraction"); Context()->noreduce('(-x)-y','(-x)+y'); Context()->variables->add(b=>"Real"); +do { $den = random(3,6,1); do {$num=random(1,$den-1,1);} until (gcd($den,$num)==1); $slope = -Fraction($num,$den); @@ -48,8 +54,9 @@ $func = Compute("$slope*b+$intercept")->reduce; $budget = $intercept*$den; $maxBowls = $budget/$num; -$x1 = $den*random(1,int($budget/$num/$den),1); +$x1 = $den*random(1,$maxBowls/$den,1); $y1 = $func->eval(b=>$x1); +} until ($x1 != $y1); Context("Currency"); Context()->currency->addSymbol("dollars","dollar"); @@ -72,30 +79,28 @@ $possessive = 'her' if ($sex eq 'female'); $name = RandomName(sex=>$sex); @answers = ( - "`$x1` bowls and `$y1` plates can be purchased.", - "`$y1` bowls and `$x1` plates can be purchased.", - "`$x1C` will be used to purchase bowls, and `$y1C` will be used to purchase plates.", - "`$y1C` will be used to purchase bowls, and `$x1C` will be used to purchase plates.", + "If ".math_ev3($x1)." bowls are purchased, then ".math_ev3($y1)." plates will be purchased.", + "If ".math_ev3($y1)." bowls are purchased, then ".math_ev3($x1)." plates will be purchased.", + math_ev3($x1C)." will be used to purchase bowls, and ".math_ev3($y1C)." will be used to purchase plates.", + math_ev3($y1C)." will be used to purchase bowls, and ".math_ev3($x1C)." will be used to purchase plates.", ); #Create a hash and its inverse that randomizes the order of the four choices. -%scramble = (); -%inverse = (); +@scramble = NchooseK(4,4); +@inverse = (); @answersShuffled = (); for my $i (0..3) { - do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); - $scramble{$i} = $temp; - $inverse{$temp} = $i; - $answersShuffled[$i] = @answers[$scramble{$i}]; - $answersShuffled[$i]=$ALPHABET[$i].'. '.$answersShuffled[$i]; -}; - -$correctAns = @answersShuffled[$inverse{0}]; - -$radio = RadioButtons( - ~~@answersShuffled, - $correctAns, # correct answer - order => ~~@answersShuffled, + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} +$correctAns = $answersShuffled[$inverse{0}]; + +$radio = RadioButtons([[ + "If ".math_ev3($x1)." bowls are purchased, then ".math_ev3($y1)." plates will be purchased.", + "If ".math_ev3($y1)." bowls are purchased, then ".math_ev3($x1)." plates will be purchased.", + math_ev3($x1C)." will be used to purchase bowls, and ".math_ev3($y1C)." will be used to purchase plates.", + math_ev3($y1C)." will be used to purchase bowls, and ".math_ev3($x1C)." will be used to purchase plates.", +]],0, labels => "ABC", ); @@ -103,7 +108,7 @@ $radio = RadioButtons( BEGIN_PGML -[$name] will spend [`[$budgetC]`] to purchase some bowls and some plates. Each bowl costs [`[$numC]`], and each plate costs [`[$denC]`]. The function [`p(b)=[$func]`] models the number of plates [$name] to be purchase, where [`b`] represents the number of bowls to be purchased. +[$name] will spend [`[$budgetC]`] to purchase some bowls and some plates. Each bowl costs [`[$numC]`], and each plate costs [`[$denC]`]. The function [`p(b)=[$func]`] models the number of plates [$name] will purchase, where [`b`] represents the number of bowls [$name] will purchase. Interpret the meaning of [`p([$x1])=[$y1]`]. @@ -119,7 +124,7 @@ BEGIN_PGML_SOLUTION For [`p(b)=[$func]`], the value of [`b`] represents the number of bowls to be purchased, and the value of [`p(b)`] represents the number of plates to be purchased. -For [`p([$x1])=[$y1]`], [`[$x1]`] implies [`[$x1]`] bowls will be purchased, while [`[$y1]`] implies [`[$y1]`] plates will be purchased. The correct solution is [$correctAns] +For [`p([$x1])=[$y1]`], [`[$x1]`] implies [`[$x1]`] bowls will be purchased, while [`[$y1]`] implies [`[$y1]`] plates will be purchased. The correct solution is [$radio->correct_ans]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext40.pg index 70162a4764..438bdea86a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionInContext40.pg @@ -7,30 +7,35 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(platesandbowls) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( +# "PGgraphmacros.pl", "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "PCCgraphMacros.pl", + "PGcourse.pl", "PCCmacros.pl", "contextCurrency.pl", "parserRadioButtons.pl", "contextFraction.pl", - "PGcourse.pl" + "PGchoicemacros.pl", ); ############################################## @@ -49,7 +54,7 @@ $func = Compute("$slope*x+$intercept")->reduce; $budget = $intercept*$den; $maxBowls = $budget/$den; -$x1 = $den*random(1,int($budget/$num/$den),1); +$x1 = $den*random(1,$maxBowls/$den,1); $y1 = $func->eval(x=>$x1); Context("Currency"); @@ -73,30 +78,29 @@ $possessive = 'her' if ($sex eq 'female'); $name = RandomName(sex=>$sex); @answers = ( - "`$x1` plates and `$y1` bowls can be purchased.", - "`$y1` plates and `$x1` bowls can be purchased.", - "`$x1C` will be used to purchase bowls, and `$y1C` will be used to purchase plates.", - "`$y1C` will be used to purchase bowls, and `$x1C` will be used to purchase plates.", + math_ev3($x1)." plates and ".math_ev3($y1)." bowls can be purchased.", + math_ev3($y1)." plates and ".math_ev3($x1)." bowls can be purchased.", + math_ev3($x1C)." will be used to purchase bowls, and ".math_ev3($y1C)." will be used to purchase plates.", + math_ev3($y1C)." will be used to purchase bowls, and ".math_ev3($x1C)." will be used to purchase plates.", ); #Create a hash and its inverse that randomizes the order of the four choices. -%scramble = (); -%inverse = (); +@scramble = NchooseK(4,4); +@inverse = (); @answersShuffled = (); for my $i (0..3) { - do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); - $scramble{$i} = $temp; - $inverse{$temp} = $i; - $answersShuffled[$i] = @answers[$scramble{$i}]; - $answersShuffled[$i]=$ALPHABET[$i].'. '.$answersShuffled[$i]; -}; + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} -$correctAns = @answersShuffled[$inverse{0}]; +$correctAns = $answersShuffled[$inverse[0]]; $radio = RadioButtons( - ~~@answersShuffled, - $correctAns, # correct answer - order => ~~@answersShuffled, +[[ math_ev3($x1)." plates and ".math_ev3($y1)." bowls can be purchased.", + math_ev3($y1)." plates and ".math_ev3($x1)." bowls can be purchased.", + math_ev3($x1C)." will be used to purchase bowls, and ".math_ev3($y1C)." will be used to purchase plates.", + math_ev3($y1C)." will be used to purchase bowls, and ".math_ev3($x1C)." will be used to purchase plates.", +]],0, labels => "ABC", ); @@ -120,7 +124,7 @@ BEGIN_PGML_SOLUTION For [`q(x)=[$func]`], the value of [`x`] represents the number of plates to be purchased, and the value of [`q(x)`] represents the number of bowls to be purchased. -For [`q([$x1])=[$y1]`], the [`x`]-value of [`[$x1]`] implies that [`[$x1]`] plates will be purchased, while the [`q`]-value of [`[$y1]`] implies that [`[$y1]`] bowls will be purchased. The correct solution is: [$correctAns] +For [`q([$x1])=[$y1]`], [`[$x1]`] implies [`[$x1]`] plates will be purchased, while [`[$y1]`] implies [`[$y1]`] bowls will be purchased. The correct solution is [$radio->correct_ans]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg index dda0759ce7..cd60e88969 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Definition, concept) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -24,19 +27,21 @@ DOCUMENT(); loadMacros( "PGstandard.pl", - "PGgraphmacros.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGchoicemacros.pl", - "PGcourse.pl" + "parserPopUp.pl", + "PGtikz.pl", + "PCCmacros.pl", + "ORCCA.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + #Decide the number of points in the graph. $numPoints = 3; @@ -55,7 +60,8 @@ for my $i (0..1) { #Decide whether each graphs shows a function or non-function. @isFunction=(); -@radio=(); +@popup=(); + for my $i (0..1) { $isFunction[$i]=random(0,1,1); if ($isFunction[$i]) { @@ -70,11 +76,9 @@ for my $i (0..1) { $px[$i][$dup0]=$px[$i][$dup1]; } - $isFunctionText = $isFunction[$i] ? "Yes" : "No"; - $radio[$i] = new_multiple_choice(); + $isFunctionText = $isFunction[$i] ? "does" : "does not"; $graphNum = $i+1; - $radio[$i]->qa("Does the relationship in Graph $graphNum show [`y`] as a function of [`x`]?", "$isFunctionText"); - $radio[$i]->makeLast("Yes","No"); + $popup[$i]=PopUp(['?','does','does not'], "$isFunctionText"); } #Make a copy of those two sets of points for display in solution. @@ -90,29 +94,90 @@ for my $i (2..3) { @xticks = @$xticks_ref; @yticks = @$yticks_ref; + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[soliddot] coordinates {($px[0][0],$py[0][0]) ($px[0][1],$py[0][1]) ($px[0][2],$py[0][2])}; +\end{axis} +END_TIKZ + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[soliddot] coordinates {($px[1][0],$py[1][0]) ($px[1][1],$py[1][1]) ($px[1][2],$py[1][2])}; +\end{axis} +END_TIKZ + +$gr[2] = createTikZImage(); +$gr[2]->addToPreamble(latexImagePreamble()); +$gr[2]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[soliddot] coordinates {($px[2][0],$py[2][0]) ($px[2][1],$py[2][1]) ($px[2][2],$py[2][2])}; + \addplot[verticallinetest] coordinates {($px[2][0],$min[1]) ($px[2][0],$max[1])}; + \addplot[verticallinetest] coordinates {($px[2][1],$min[1]) ($px[2][1],$max[1])}; + \addplot[verticallinetest] coordinates {($px[2][2],$min[1]) ($px[2][2],$max[1])}; +\end{axis} +END_TIKZ + +$gr[3] = createTikZImage(); +$gr[3]->addToPreamble(latexImagePreamble()); +$gr[3]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[soliddot] coordinates {($px[3][0],$py[3][0]) ($px[3][1],$py[3][1]) ($px[3][2],$py[3][2])}; + \addplot[verticallinetest] coordinates {($px[3][0],$min[1]) ($px[3][0],$max[1])}; + \addplot[verticallinetest] coordinates {($px[3][1],$min[1]) ($px[3][1],$max[1])}; + \addplot[verticallinetest] coordinates {($px[3][2],$min[1]) ($px[3][2],$max[1])}; +\end{axis} +END_TIKZ + + + + @ALT=(); @ALTPoints=(); for my $i (0..3) { $ALTPoints[$i]=""; - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } for my $j (0..$numPoints-1) { - $gr[$i]->stamps( closed_circle($px[$i][$j],$py[$i][$j],'blue') ); - $gr[$i]->lb( new Label($px[$i][$j],$py[$i][$j]-$sign*$marksep[1]/8, "($px[$i][$j],$py[$i][$j])", 'blue','center','top')); $ALTPoints[$i] .= "($px[$i][$j],$py[$i][$j]), "; } @@ -131,27 +196,13 @@ $ALT1 = $ALT[1]; Context("LimitedNumeric"); BEGIN_PGML -The following graphs show two relationships. - -[@EnlargeImageStatementPGML()@]** - Decide whether each graph shows a relationship where [`y`] is a function of [`x`]. -[@$radio[0]->print_q()@]** -[@$radio[0]->print_a()@]* - ->>### Graph 1 ### << - ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< - - -[@$radio[1]->print_q()@]** -[@$radio[1]->print_a()@]* - ->>### Graph 2 ### << +[@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]*<< +>>[@image($gr[0], width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@image($gr[1], width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]* << +The first graph [__]{$popup[0]} give a function of [`x`]. The second graph [__]{$popup[1]} give a function of [`x`]. END_PGML @@ -159,15 +210,6 @@ END_PGML $showPartialCorrectAnswers = 0; -ANS( radio_cmp( $radio[0]->correct_ans() ) ); -ANS( radio_cmp( $radio[1]->correct_ans() ) ); - -for my $i (2..3) { - for my $j (0..$numPoints-1) { - $gr[$i]->moveTo($px[$i][$j],$min[1]); - $gr[$i]->lineTo($px[$i][$j],$max[1],'red',2,'dashed'); - } -} ####################################################### @@ -185,18 +227,14 @@ BEGIN_PGML_SOLUTION If a graph shows a relationship where [`y`] is a function of [`x`], it has to pass the vertical line test. -Graph 1 [$graph1Output1] the test, and thus it [$graph1Output2] [`y`] as a function of [`x`]. - ->>### Graph 1 ### << +>> [@image($gr[2], width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@image($gr[3], width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT3' title = '$ALT3'") @]* << ->>[@image(insertGraph($gr[2]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< +The first graph [$graph1Output1] the test, and thus it [$graph1Output2] [`y`] as a function of [`x`]. -Graph 2 [$graph2Output1] the test, and thus it [$graph2Output2] [`y`] as a function of [`x`]. ->>### Graph 2 ### << +The second graph [$graph2Output1] the test, and thus it [$graph2Output2] [`y`] as a function of [`x`]. ->>[@image(insertGraph($gr[3]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT3' title = '$ALT3'") @]*<< END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg index 032647e425..c8a8c60f70 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg @@ -8,42 +8,47 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Definition, concept) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGchoicemacros.pl", - "PGcourse.pl" + "parserPopUp.pl", + "PGtikz.pl", + "PCCmacros.pl", + "ORCCA.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + #Decide whether each graphs shows a function or non-function. @ALT=(); @isFunction=(); @functions=([],[],[],[]); -@radio=(); for my $i (0..1) { $isFunction[$i]=random(0,1,1); if ($i==1) {do {$isFunction[$i]=random(0,1,1);} until ($isFunction[$i]!=$isFunction[$i-1]);} @@ -75,11 +80,9 @@ for my $i (0..1) { $ALT[$i]="Graph $graphNum: This is a graph of a parabola opening to the $leftOrRight."; } - $isFunctionText = $isFunction[$i] ? "Yes" : "No"; - $radio[$i] = new_multiple_choice(); + $isFunctionText = $isFunction[$i] ? "does" : "does not"; $graphNum = $i+1; - $radio[$i]->qa("Does the relationship in Graph $graphNum represent [`y`] as a function of [`x`]?", "$isFunctionText"); - $radio[$i]->makeLast("Yes","No"); + $popup[$i] = PopUp(['?','does','does not'], "$isFunctionText"); } for my $i (2..3) { @@ -93,62 +96,90 @@ for my $i (2..3) { ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$h+1, $h-1,$b+1, $b-1],[$k+1, $k-1,$c, $c+1, $c-1],centerOrigin=>1); -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; - -@gr=(); - -for my $i (0..3) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } +if ($a > 0) {@top = (sqrt(($max[1]-$k)/$a)+$h, -sqrt(($max[1]-$k)/$a)+$h)} + else {@top = (sqrt(($min[1]-$k)/$a)+$h, -sqrt(($min[1]-$k)/$a)+$h)}; +if ($d > 0) {@right = (sqrt(($max[0]+$b)*$d)+$c, -sqrt(($max[0]+$b)*$d)+$c)} + else {@right = (sqrt(($min[0]+$b)*$d)+$c, -sqrt(($min[0]+$b)*$d)+$c)}; + + +@xvaluesfunc = num_sort($min[0],$max[0],@top); +@yvaluesnonfunc = num_sort($min[1],$max[1],@right); + +for my $i (0,1) { + +$plot[$i] = ($isFunction[$i]) ? "\\addplot+[domain=$xvaluesfunc[1]:$xvaluesfunc[2]] {$a*(x-$h)^2+$k};" : "\\addplot+[domain=$yvaluesnonfunc[1]:$yvaluesnonfunc[2]] ({(x-$c)^2/$d-$b},{x});"; +$points[$i] = "\\addplot[soliddot] coordinates " . (($isFunction[$i]) ? "{($h,$k) ($h-1,$k+$a) ($h+1,$k+$a) ($h-2,$k+4*$a) ($h+2,$k+4*$a)}" : "{(-$b+1/$d,$c+1) (-$b+1/$d,$c-1) (-$b+4/$d,$c+2) (-$b+4/$d,$c-2) (-$b+9/$d,$c+3) (-$b+9/$d,$c-3)}") . ";"; +$guidelines[$i] = "\\addplot[verticallinetest] coordinates " . (($isFunction[$i]) ? "{($h-2,$min[1]) ($h-2,$max[1])}" : "{(-$b+1/$d,$min[1]) (-$b+1/$d,$max[1])}") . ";"; +$guidelines[$i] .= "\\addplot[verticallinetest] coordinates " . (($isFunction[$i]) ? "{($h-1,$min[1]) ($h-1,$max[1])}" : "{(-$b+4/$d,$min[1]) (-$b+4/$d,$max[1])}") . ";"; +$guidelines[$i] .= "\\addplot[verticallinetest] coordinates " . (($isFunction[$i]) ? "{($h,$min[1]) ($h,$max[1])}" : "{(-$b+9/$d,$min[1]) (-$b+9/$d,$max[1])}") . ";"; +$guidelines[$i] .= "\\addplot[verticallinetest] coordinates {($h,$min[1]) ($h,$max[1])};" if ($isFunction[$i]); +$guidelines[$i] .= "\\addplot[verticallinetest] coordinates {($h+1,$min[1]) ($h+1,$max[1])};" if ($isFunction[$i]); +$guidelines[$i] .= "\\addplot[verticallinetest] coordinates {($h+2,$min[1]) ($h+2,$max[1])};" if ($isFunction[$i]); + +$gr[$i] = createTikZImage(); +$gr[$i]->addToPreamble(latexImagePreamble()); +$gr[$i]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + $plot[$i] +\end{axis} +END_TIKZ + + +$gr[$i+2] = createTikZImage(); +$gr[$i+2]->addToPreamble(latexImagePreamble()); +$gr[$i+2]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + $plot[$i] + $points[$i] + $guidelines[$i] +\end{axis} +END_TIKZ - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - - for my $j (0..1) { - $fn[$i] = new Fun( $xfunc[$i], $yfunc[$i], $gr[$i] ); - $fn[$i] -> domain(0,6.2832); - } } + + $ALT0 = $ALT[0]; $ALT1 = $ALT[1]; +for my $i (2..3) { + if ($isFunction[$i-2]==1) { + $ALT[$i] .= " No vertical line crosses it more than once."; + } else { + $ALT[$i] .= " A vertical line crosses it at more than one point."; + } +} + ############################################## BEGIN_PGML -The following graphs show two relationships. +The following graphs show two relationships. Decide whether each graph shows a relationship where [`y`] is a function of [`x`]. [@EnlargeImageStatementPGML()@]** -Decide whether each graph represents [`y`] as a function of [`x`]. +>>[@image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]* << -[@$radio[0]->print_q()@]** -[@$radio[0]->print_a()@]* - ->>### Graph 1 ### << - ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'")@]*<< - - -[@$radio[1]->print_q()@]** -[@$radio[1]->print_a()@]* - ->>### Graph 2 ### << - ->>[@image(insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'")@]*<< +The first graph [__]{$popup[0]} give a function of [`x`]. The second graph [__]{$popup[1]} give a function of [`x`]. END_PGML @@ -156,31 +187,8 @@ END_PGML $showPartialCorrectAnswers = 0; -ANS( radio_cmp( $radio[0]->correct_ans() ) ); -ANS( radio_cmp( $radio[1]->correct_ans() ) ); - ####################################################### -for my $i (2..3) { - if ($isFunction[$i-2]==1) { - for my $j (-1..1) { - $gr[$i]->moveTo($h+$j,$min[1]); - $gr[$i]->lineTo($h+$j,$max[1],'red',2,'dashed'); - $gr[$i]->stamps( closed_circle($h+$j,$functions[$i][1]->eval(x=>($h+$j)),'blue') ); - } - $ALT[$i] .= " No vertical line crosses it more than once."; - } else { - $gr[$i]->moveTo(1/$d-$b,$min[1]); - $gr[$i]->lineTo(1/$d-$b,$max[1],'red',2,'dashed'); - $x1 = 1/$d-$b; - $y1 = $c+1; - $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); - $x2 = 1/$d-$b; - $y2 = $functions[$i][1]->eval(x=>$x2); - $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); - $ALT[$i] .= " A vertical line crosses it at more than one point."; - } -} $graph1Output1 = $isFunction[0] ? "passed" : "did not pass"; $graph2Output1 = $isFunction[1] ? "passed" : "did not pass"; @@ -196,18 +204,10 @@ BEGIN_PGML_SOLUTION If a graph represents [`y`] as a function of [`x`], it has to pass the vertical line test. -Graph 1 [$graph1Output1] the test, and thus it [$graph1Output2] [`y`] as a function of [`x`]. - ->>###Graph 1 ### << - ->>[@image(insertGraph($gr[2]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< - - -Graph 2 [$graph2Output1] the test, and thus it [$graph2Output2] [`y`] as a function of [`x`]. - ->>###Graph 2 ### << +>>[@image($gr[2], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@SPACE@]* [@image($gr[3], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT3' title = '$ALT3'") @]*<< ->>[@image(insertGraph($gr[3]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT3' title = '$ALT3'") @]*<< +The first graph [$graph1Output1] the test, and thus it [$graph1Output2] [`y`] as a function of [`x`]. +The second graph [$graph2Output1] the test, and thus it [$graph2Output2] [`y`] as a function of [`x`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg index 466f04bcf3..0496130baf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg @@ -7,39 +7,40 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Definition, concept) -## MLT(GivenGraph_FunctionOrNot) -## MLTleader(1) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') ## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", + "PGcourse.pl", "PGchoicemacros.pl", "pccTables.pl", "unionTables.pl", - "PGcourse.pl" ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + #parameters for graphs $a = random(-6,-3,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotInContext10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotInContext10.pg new file mode 100644 index 0000000000..1c7f4e46f4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotInContext10.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# Judge whether a relationship is a function by context. +# +# Last edited: Carl Yao 3/24.2018 +# ENDDESCRIPTION + +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('function') +##DBCCSS('8.F.4,F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem('') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); + +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( +"Choose the correct statement based on data in the table.", + "The dosage of Tylenol is a function of a child's weight.", +); +$mc -> extra( + "A child's weight is a function of the dosage of Tylenol.", +); + +############################################## + + +BEGIN_PGML + +The following table shows the dosage of Tylenol for a child based on his/her weight. + +[@DataTable( + [ + [[PF('Weight in Pounds'), + cellcss => 'border-bottom: 3px solid; ',], + [PF('Dose in mL'), + cellcss => 'border-bottom: 3px solid; ',], + ], + [[PF('[`6-11`]'),], + [PF('[`1.25`]'),], + ], + [[PF('[`12-17`]'),], + [PF('[`2.5`]'),], + ], + [[PF('[`18-23`]'),], + [PF('[`3.75`]'),], + ], + [[PF('[`24-35`]'),], + [PF('[`5`]'),], + ], + [[PF('[`36-47`]'),], + [PF('[`7.5`]'),], + ], + [[PF('[`48-59`]'),], + [PF('[`10`]'),], + ], + [[PF('[`60-71`]'),], + [PF('[`12.5`]'),], + ], + [[PF('[`72-95`]'),], + [PF('[`15`]'),], + ], + [[PF('[`96+`]'),], + [PF('[`20`]'),], + ], + ], + align => 'c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +[@$mc -> print_q() @]** + [@$mc -> print_a() @]* + +END_PGML + + +############################################## + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +To qualify for a function, a relationship must have one output for each input. + +For a given child's weight, there is only one corresponding Tylenol dosage, so the Tylenol dosage is a function of a child's weight. + +For a given Tylenol dosage, there are more than one weight number, so a child's weight is not a function of the Tylenol dosage. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotInContext20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotInContext20.pg new file mode 100644 index 0000000000..b11b933db2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotInContext20.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# Judge whether a relationship is a function by context. +# +# Last edited: Carl Yao 3/24/2018 +# ENDDESCRIPTION + +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('function') +##DBCCSS('8.F.4,F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem('') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); + +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( +"Choose the correct statement based on data in the table.", + "The number of seats in the House of Representatives is a function of states.", +); +$mc -> extra( + "The name of states is a function of the number of seats in the House of Representatives.", +); + +############################################## + + +BEGIN_PGML + +The following table shows the number of house seats in the US House of Representatives of some states: + +[@DataTable( + [ + [[PF('Number of Seats'), + cellcss => 'border-bottom: 3px solid; ',], + [PF('States'), + cellcss => 'border-bottom: 3px solid; ',], + ], + [[PF('[`1`]'),], + [PF('Alaska'),], + ], + [[PF('[`1`]'),], + [PF('Delaware'),], + ], + [[PF('[`1`]'),], + [PF('Montana'),], + ], + [[PF('[`1`]'),], + [PF('Vermont'),], + ], + [[PF('[`1`]'),], + [PF('Wyoming'),], + ], + [[PF('[`2`]'),], + [PF('Rhode Island'),], + ], + [[PF('[`2`]'),], + [PF('New Hampshire'),], + ], + [[PF('[`2`]'),], + [PF('Maine'),], + ], + [[PF('[`2`]'),], + [PF('Hawaii'),], + ], + [[PF('[`2`]'),], + [PF('Idahol'),], + ], + ], + align => 'c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +[@$mc -> print_q() @]** + [@$mc -> print_a() @]* + +END_PGML + + +############################################## + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +To qualify for a function, a relationship must have one output for each input. + +For a given state, there is only one corresponding number of seats, so the number of seats is a function of states. + +For a given number of seats, there is more than one corresponding state, so the name of states is not a function of the number of seats. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg index f70c0fe7ec..85555ff252 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg @@ -7,30 +7,36 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "parserAssignment.pl", "answerHints.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFiniteSolutionSets.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", ); @@ -40,7 +46,7 @@ TEXT(beginproblem()); Context("Numeric"); $var = "x"; -$refreshCachedImages=1; + Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); parser::Assignment->Allow; @@ -66,6 +72,10 @@ Context()->strings->add("no real solutions"=>{}, $numPoints = 3; #Create ordered pairs with no duplicate values in x, no duplicate values in y. + +#Loop to ensure good relative separation between any two points +do { + @px=(); @py=(); @xArray = (-5..5); @@ -80,6 +90,9 @@ $dup0 = random(0,$numPoints-1); do {$dup1=random(0,$numPoints-1);} until ($dup0!=$dup1); $py[$dup0]=$py[$dup1]; +#End loop +} until ((abs($px[0]-$px[1]) + abs($py[0]-$py[1]) > 3.5) and (abs($px[0]-$px[2]) + abs($py[0]-$py[2]) > 3.5) and (abs($px[2]-$px[1]) + abs($py[2]-$py[1]) > 3.5)); + #Decide the correct answers @ansXDups=(); @@ -105,29 +118,26 @@ $ansXDup1 = $ansXDups[1]; @yticks = @$yticks_ref; $ALTPoints=""; -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - - for my $j (0..$numPoints-1) { - $gr[$i]->stamps( closed_circle($px[$j],$py[$j],'blue') ); - $gr[$i]->lb( new Label($px[$j],$py[$j]-$sign*$marksep[1]/8, "($px[$j],$py[$j])", 'blue','left','top')); - $ALTPoints .= "($px[$j],$py[$j]), "; - } -} + + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[soliddot] coordinates {($px[0],$py[0]) ($px[1],$py[1]) ($px[2],$py[2])}; + \legend{\(y=f(x)\)}; +\end{axis} +END_TIKZ + $ALTPoints =~ s/, $//; $ALTPoints =~ s|(.+), |$1 and |; @@ -136,36 +146,38 @@ $ALTPoints =~ s/ and /, /; +Context("Numeric"); +Context()->flags->set(showMixedNumbers=>0); + +parser::Assignment->Allow; +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set(","=>{string=>"or",TeX=>"or ",perl=>","}); ($ansXDups0, $ansXDups1) = ($ansXDups[0], $ansXDups[1]); -$ansXDupList = List(Formula("x=$ansXDups0"),Formula("x=$ansXDups1")); -#$ansXDupList = List(Formula("x=1"),Formula("x=2")); + +Context("FiniteSolutionSets"); +$ansXDupList = Formula("{$ansXDups0,$ansXDups1}"); ############################################## Context("LimitedNumeric"); BEGIN_PGML -The graph of a function [`f`] is shown below. +Function [`f`] is graphed. [@EnlargeImageStatementPGML()@]** +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< - -Use the given graph of [`f`]. If there is more than one answer to a question, you can use commas and the word "or". When solving an equation for the variable [`x`], your answer should be in the form "x=[$US][$US][$US]". - - a. Evaluate [``f([$ansXNoDup])``]. - [``f([$ansXNoDup])={}``][_________] +a. Find [``f([$ansXNoDup])``]. + [_]{Compute($ansYNoDup)}{10} - a. Solve [``f(x)=[$ansYDup]``]. - [_______________________] +a. Solve [``f(x)=[$ansYDup]``]. + [_]{$ansXDupList}{20} END_PGML $showPartialCorrectAnswers = 1; -ANS(Compute($ansYNoDup)->cmp); -ANS($ansXDupList->cmp(list_checker => ~~&radicalListCheck)); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg index c68292b27c..e4d4327a3a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg @@ -7,31 +7,36 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "parserAssignment.pl", "answerHints.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", - "PGinfo.pl", - "PGcourse.pl" + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", ); @@ -41,7 +46,7 @@ TEXT(beginproblem()); Context("Numeric"); $var = "x"; -$refreshCachedImages=1; + Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); parser::Assignment->Allow; @@ -83,40 +88,71 @@ $func = Compute("$m*x+$b")->reduce; @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..2) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } +@xvalues = num_sort($min[0],$max[0],($min[1]-$b)/$m,($max[1]-$b)/$m); + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; +\end{axis} +END_TIKZ + + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; + \addplot[soliddot] coordinates {($p0x,$p0y)} node[right] {\(($p0x,$p0y)\)}; + \addplot[asymptote] coordinates {($p0x,$min[1]) ($p0x,$max[1])}; +\end{axis} +END_TIKZ + + +$gr[2] = createTikZImage(); +$gr[2]->addToPreamble(latexImagePreamble()); +$gr[2]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; + \addplot[soliddot] coordinates {($p1x,$p1y)} node[below] {\(($p1x,$p1y)\)}; + \addplot[asymptote] coordinates {($min[0],$p1y) ($max[0],$p1y)}; +\end{axis} +END_TIKZ - add_functions($gr[$i], "$m*x+$b for x in [$min[0],$max[0]] using color:blue and weight:2"); -} $ALT0 = "graph of a line passing through the points ($p0x,$p0y) and ($p1x,$p1y)"; - -#the graph used in solution to find f(x)=? -$gr[1]->stamps( closed_circle($p0x,$p0y,'red') ); -$gr[1]->lb( new Label($p0x+$marksep[1]/8,$p0y+$marksep[1]/8,"($p0x,$p0y)",'red','left','bottom')); -$gr[1]->moveTo($p0x,$min[1]); -$gr[1]->lineTo($p0x,$max[1],'red',2,'dashed'); $ALT1 = "This is the graph of a line passing through the points ($p0x,$p0y) and ($p1x,$p1y). A dashed vertical line x=$p0x crosses the line at ($p0x,$p0y)."; - -#the graph used in solution to find f(?)=$p1y -$gr[2]->stamps( closed_circle($p1x,$p1y,'red') ); -$gr[2]->lb( new Label($p1x,$p1y+$marksep[1]/8,"($p1x,$p1y)",'red','center','bottom')); -$gr[2]->moveTo($min[0],$p1y); -$gr[2]->lineTo($max[0],$p1y,'red',2,'dashed'); $ALT2 = "This is the graph of a line passing through the points ($p0x,$p0y) and ($p1x,$p1y). A dashed horizontal line y=$p1y crosses the line at ($p1x,$p1y)."; $xeqp1x = Compute("x=$p1x"); @@ -126,20 +162,17 @@ $xeqp1x = Compute("x=$p1x"); Context("LimitedNumeric"); BEGIN_PGML -The graph of a function [`f`] is shown below. +Function [`f`] is graphed. [@EnlargeImageStatementPGML()@]** +>>[@image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< - -Use the given graph of [`f`]. If there is more than one answer to a question, you can use commas and the word "or". When solving an equation for the variable [`x`], your answer should be in the form "x=[$US][$US][$US]". +a. Find [``f([$p0x])``]. + [__________] - a. Evaluate [``f([$p0x])``]. - [``f([$p0x])={}``][_________] - - a. Solve [``f(x)=[$p1y]``]. - [_______________________] +a. Solve [``f(x)=[$p1y]``]. + [____________________] END_PGML @@ -147,47 +180,12 @@ END_PGML $showPartialCorrectAnswers = 1; ANS(Compute($p0y)->cmp); -ANS($xeqp1x->cmp( - checker => sub { - my ($correct,$student,$ans) = @_; - # count the number of student answers - my $fullStudent = $ans->{student_formula}; - my @fullStudentValue = $fullStudent->value; - my $n = scalar(@fullStudentValue); # number of student answers - if($n>1) - { - $student->context->setError("Does this equation have more than one unique solution?","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # if the student has said no real solutions, ask them about it - if($student eq "no real solutions") - { - $student->context->setError("This equation does have some solutions- try factoring or using the quadratic formula","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - # check that the student has written x= - if ($student->type ne "Assignment" && $ans->{student_formula}->type ne "Assignment") { - $student->context->setError("Your entry should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) - unless $ans->{isPreview}; - return; - } - return $correct == $student; - } -)->withPostFilter(sub { - my $ansHash = shift; - if ($ansHash->{score}) { - my ($cvar,$cfrac) = $ansHash->{correct_value}->value; # get - my ($svar,$sfrac) = $ansHash->{student_value}->value; # get - my $check = $cfrac->cmp->evaluate($sfrac->string); # do a - $ansHash->{score} = $check->{score}; - $ansHash->{ans_message} = $check->{ans_message}; # and any - } - return $ansHash; - }, - ), -); + +Context("FiniteSolutionSets"); +$solset = Formula("{$p1x}"); + +ANS($solset->cmp()); + ############################################## @@ -198,11 +196,11 @@ BEGIN_PGML_SOLUTION To evaluate [`f([$p0x])`], we understand that we have been given an [`x`]-value of [`[$p0x]`]. On the graph, we draw a dotted vertical line at [`x=[$p0x]`], and it intersects the function's graph at [`([$p0x],[$p0y])`]. This implies [`f([$p0x])=[$p0y]`]. See the graph below. ->>[@image(insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]*<< +>>[@image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]*<< To solve [`f(x)=[$p1y]`], we understand that we have been given a [`y`]-value of [`[$p1y]`]. On the graph, we draw a dotted horizontal line at [`y=[$p1y]`], and it intersects the function's graph at [`([$p1x],[$p1y])`]. This implies [`f([$p1x])=[$p1y]`]. See the graph below. ->>[@image(insertGraph($gr[2]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< +>>[@image($gr[2], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg index b893352476..bd34250b66 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg @@ -7,30 +7,36 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "parserAssignment.pl", "answerHints.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGtikz.pl", + "ORCCA.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", ); @@ -40,7 +46,7 @@ TEXT(beginproblem()); Context("Numeric"); $var = "x"; -$refreshCachedImages=1; + Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); parser::Assignment->Allow; @@ -92,70 +98,112 @@ $ansList = List($p1x,$p2x); @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..2) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } +if ($a > 0) + {@xvalues = num_sort($min[0], $max[0], sqrt(($max[0]-$c)/$a)+$b, -sqrt(($max[0]-$c)/$a)+$b)} +else + {@xvalues = num_sort($min[0], $max[0], sqrt(($min[0]-$c)/$a)+$b, -sqrt(($min[0]-$c)/$a)+$b)} + + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; +\end{axis} +END_TIKZ + + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; + \addplot[soliddot] coordinates {($p0x,$p0y)} node[right] {\(($p0x,$p0y)\)}; + \addplot[asymptote] coordinates {($p0x,$min[1]) ($p0x,$max[1])}; +\end{axis} +END_TIKZ + + +$gr[2] = createTikZImage(); +$gr[2]->addToPreamble(latexImagePreamble()); +$gr[2]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$xvalues[1]:$xvalues[2]] {$func}; + \legend{\(y=f(x)\)}; + \addplot[soliddot] coordinates {($p1x,$p1y)} node[below] {\(($p1x,$p1y)\)}; + \addplot[soliddot] coordinates {($p2x,$p2y)} node[below] {\(($p2x,$p2y)\)}; + \addplot[asymptote] coordinates {($min[0],$p1y) ($max[0],$p1y)}; +\end{axis} +END_TIKZ - add_functions($gr[$i], "$a*(x-$b)**2+$c for x in [$min[0],$max[0]] using color:blue and weight:2"); -} $ALT0 = "graph of a parabola passing through the points ($p0x,$p0y), ($p1x,$p1y) and ($p2x,$p2y)"; - -#the graph used in solution to find f(x)=? -$gr[1]->stamps( closed_circle($p0x,$p0y,'red') ); -$gr[1]->lb( new Label($p0x+$marksep[1]/8,$p0y+$marksep[1]/8,"($p0x,$p0y)",'red','left','bottom')); -$gr[1]->moveTo($p0x,$min[1]); -$gr[1]->lineTo($p0x,$max[1],'red',2,'dashed'); $ALT1 = "This is the graph of aparabola passing through the points ($p0x,$p0y), ($p1x,$p1y) and ($p2x,$p2y). A dashed vertical line x=$p0x intersects the parabola at ($p0x,$p0y)."; - -#the graph used in solution to find f(?)=$p1y -$gr[2]->stamps( closed_circle($p1x,$p1y,'red') ); -$gr[2]->lb( new Label($p1x,$p1y+$marksep[1]/8,"($p1x,$p1y)",'red','center','bottom')); -$gr[2]->stamps( closed_circle($p2x,$p2y,'red') ); -$gr[2]->lb( new Label($p2x,$p2y+$marksep[1]/8,"($p2x,$p2y)",'red','center','bottom')); -$gr[2]->moveTo($min[0],$p1y); -$gr[2]->lineTo($max[0],$p1y,'red',2,'dashed'); $ALT2 = "This is the graph of a parabola passing through the points ($p0x,$p0y), ($p1x,$p1y) and ($p2x,$p2y). A dashed horizontal line y=$p1y intersects the parabola at ($p1x,$p1y) and ($p2x,$p2y)."; + +Context("Numeric"); +Context()->flags->set(showMixedNumbers=>0); + +parser::Assignment->Allow; +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set(","=>{string=>"or",TeX=>"or ",perl=>","}); + $xeqansList = List(Formula("x=$p1x"),Formula("x=$p2x")); +Context("FiniteSolutionSets"); +$solset = Formula("{$p1x,$p2x}"); + ############################################## Context("LimitedNumeric"); BEGIN_PGML -The graph of function [`f`] is shown below. +Function [`f`] is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< +>>[@image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< -Use the given graph of [`f`]. If there is more than one answer to a question, you can use commas and the word "or". When solving an equation for the variable [`x`], your answer should be in the form "x=[$US][$US][$US]". - a. Evaluate [``f([$p0x])``]. - [``f([$p0x])={}``][_________] +a. Find [``f([$p0x])``]. + [_]{Compute($p0y)}{10} - a. Solve [``f(x)=[$p1y]``]. - [_______________________] +a. Solve [``f(x)=[$p1y]``]. + [_]{$solset}{20} END_PGML -ANS(Compute($p0y)->cmp); -ANS($xeqansList->cmp(list_checker => ~~&radicalListCheck)); ############################################## @@ -163,11 +211,11 @@ BEGIN_PGML_SOLUTION To evaluate [`f([$p0x])`], we understand that we have been given an [`x`]-value of [`[$p0x]`]. On the graph, we draw a dotted vertical line at [`x=[$p0x]`], and it intersects the function's graph at [`([$p0x],[$p0y])`]. This implies [`f([$p0x])=[$p0y]`]. See the graph below. ->>[@image(insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]*<< +>>[@image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT1' title = '$ALT1'") @]*<< To solve [`f(x)=[$p1y]`], we understand that we have been given a [`y`]-value of [`[$p1y]`]. On the graph, we draw a dotted horizontal line at [`y=[$p1y]`], and it intersects the function's graph at [`([$p1x],[$p1y])`] and [`([$p2x],[$p2y])`]. This implies [`f([$p1x])=[$p1y]`] and [`f([$p2x])=[$p2y]`]. See the graph below. ->>[@image(insertGraph($gr[2]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< +>>[@image($gr[2], width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT2' title = '$ALT2'") @]*<< END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg index 4bd1d20087..308d98e4ca 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg @@ -9,26 +9,30 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph','piecewise') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -36,7 +40,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + do { $xMin = -4; @@ -101,17 +105,20 @@ for my $i (0..1) { $gr[$i]->lb('reset'); for my $j (@xticks) { if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + $gr[$i]->lb( new Label($j, 0, $j,'black','center','top','large')); } for my $j (@yticks) { if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); } + $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); + $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); - add_functions($gr[$i], "$func0 for x in [$x0,$x1] using color:blue and weight:2"); - add_functions($gr[$i], "$func1 for x in [$x1,$x2] using color:blue and weight:2"); - add_functions($gr[$i], "$func2 for x in [$x2,$x3] using color:blue and weight:2"); + + add_functions($gr[$i], "$func0 for x in [$x0,$x1] using color:blue and weight:1"); + add_functions($gr[$i], "$func1 for x in [$x1,$x2] using color:blue and weight:1"); + add_functions($gr[$i], "$func2 for x in [$x2,$x3] using color:blue and weight:1"); } $ALT0 = "This is the graph of a piecewise function with three line segments. The first segment starts from the point ($x0,$y0), and ends at ($x1,$y1). The second segment starts from the point ($x1,$y1), and ends at ($x2,$y2). The third segment starts from the point ($x2,$y2), and ends at ($x3,$y3)."; @@ -120,19 +127,19 @@ $shift = $marksep[1]/15; #the graph used in solution $gr[1]->stamps( closed_circle(0,$b0,'red') ); -$gr[1]->lb( new Label($0-$shift,$b0+$shift,"(0,$b0)",'red','right','bottom')); +$gr[1]->lb( new Label($0-$shift,$b0+$shift,"(0,$b0)",'red','right','bottom','large')); $gr[1]->stamps( closed_circle($xIntercept0,0,'red') ); -$gr[1]->lb( new Label($xIntercept0,0+$shift,"($xIntercept0,0)",'red','right','bottom')); +$gr[1]->lb( new Label($xIntercept0,0+$shift,"($xIntercept0,0)",'red','right','bottom','large')); $gr[1]->stamps( closed_circle($xIntercept1,0,'red') ); -$gr[1]->lb( new Label($xIntercept1,0+$shift,"($xIntercept1,0)",'red','right','bottom')); +$gr[1]->lb( new Label($xIntercept1,0+$shift,"($xIntercept1,0)",'red','right','bottom','large')); $tempText = "($xIntercept0, 0), ($xIntercept1, 0)"; if ($y3>=0) { $gr[1]->stamps( closed_circle($xIntercept2,0,'red') ); - $gr[1]->lb( new Label($xIntercept2,0+$shift,"($xIntercept2,0)",'red','right','bottom')); + $gr[1]->lb( new Label($xIntercept2,0+$shift,"($xIntercept2,0)",'red','right','bottom','large')); $tempText = "($xIntercept0, 0), ($xIntercept1, 0), ($xIntercept2, 0)"; $thirdXInterceptShow = "f($xIntercept2)=0"; } @@ -143,22 +150,14 @@ $ALT1 = "This is the graph of a piecewise function with three line segments. The Context("LimitedNumeric"); BEGIN_PGML -The graph of function [`f(x)`] is shown below. +A function is graphed. [@EnlargeImageStatementPGML()@]** >>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< -Based on the given graph of [`f(x)`], fill in the blanks. If there are more than one answers for a blank, use a comma to separate your answers. - - [`f(0)`]=[_________]{$b0} - - [`f(`][_______]{$xIntercepts}[`)=0`] - -The function's domain, in interval notation, is [_____________]{$domain}. - -The function's range, in interval notation, is [_____________]{$range}. +The function has domain [_____________]{$domain} and range [_____________]{$range}. END_PGML ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph45.pg index 1a0cde706f..90c0a5a693 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph45.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph45.pg @@ -5,16 +5,18 @@ # Last edited: Carl Yao 2/9/2017 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('function') ##DBCCSS('8.F.4,F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) -## MO(1) -## KEYWORDS('function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -30,13 +32,16 @@ loadMacros( "PCCgraphMacros.pl", "parserRadioButtons.pl", "PGchoicemacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PCCmacros.pl", "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); @@ -73,36 +78,50 @@ $y2 = $y3; @xticks = @$xticks_ref; @yticks = @$yticks_ref; -for my $i (0..1) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[240,240] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (Real($j) == 0) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - add_functions($gr[$i], "$func1 for x in <0,$e1> using color:blue and weight:1"); - add_functions($gr[$i], "$e1*$m1 for x in <$e1,$e2> using color:blue and weight:1"); - add_functions($gr[$i], "$func2 for x in <$e2,$e3> using color:blue and weight:1"); - - $gr[$i]->lb( new Label($max[0], $max[1]/50, "t (seconds)",'black','right','bottom')); - $gr[$i]->lb( new Label($max[0]/50, $max[1]-$max[1]/30, "y (feet)",'black','left','middle')); -} - -$gr[1]->stamps( closed_circle($x1,$y1,'red') ); -$gr[1]->lb( new Label($x1+$max[0]/50, $y1, "($x1,$y1)",'red','left','bottom')); -$gr[1]->stamps( closed_circle($x2,$y2,'red') ); -$gr[1]->lb( new Label($x2+$max[0]/50, $y2, "($x2,$y2)",'red','left','bottom')); -$gr[1]->stamps( closed_circle($x3,$y3,'red') ); -$gr[1]->lb( new Label($x3-$max[0]/50, $y3, "($x3,$y3)",'red','right','bottom')); + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + xlabel = {\(t\) (seconds)}, + ylabel = {\(y\) (feet)}, + ] + \addplot+[-] coordinates {(0,0) ($px1,$py1) ($px2,$py2) (10,0)}; +\end{axis} +END_TIKZ + + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + xlabel = {\(t\) (seconds)}, + ylabel = {\(y\) (feet)}, + ] + \addplot+[-] coordinates {(0,0) ($px1,$py1) ($px2,$py2) (10,0)}; + \addplot[soliddot] coordinates {($x1,$y1)} node[above] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[below right] {\(($x2,$y2)\)}; + \addplot[soliddot] coordinates {($x3,$y3)} node[below left] {\(($x3,$y3)\)}; +\end{axis} +END_TIKZ + + $alt[0] = "This is a graph with the x axis labeled as t in seconds, and y axis labeled as y in feet. There are 3 line segments. The first segments starts at (0,0) and ends at ($px1,$py1). The second segment starts at ($px1,$py1) and ends at ($px2,$py2). The third segment starts at ($px2,$py2) and ends at ($e3,0)."; @@ -139,10 +158,10 @@ $radio1 = RadioButtons( $ans3 = List($x2,$x3); @answers2 = ( - "The article was ".main::math_ev3($y2)." feet from the starting line ".main::math_ev3($x2)." seconds since timing started, and again ".main::math_ev3($x3)." seconds since timing started.", - "The article was ".main::math_ev3($y2)." feet from the starting line ".main::math_ev3($x2)." seconds since timing started.", - "The article was ".main::math_ev3($y2)." feet from the starting line ".main::math_ev3($x3)." seconds since timing started.", - "The article was ".main::math_ev3($y2)." feet from the starting line ".main::math_ev3($x2)." seconds since timing started, or ".main::math_ev3($x3)." seconds since timing started.", + "The particle was ".main::math_ev3($y2)." feet from the starting line ".main::math_ev3($x2)." seconds since timing started, and again ".main::math_ev3($x3)." seconds since timing started.", + "The particle was ".main::math_ev3($y2)." feet from the starting line ".main::math_ev3($x2)." seconds since timing started.", + "The particle was ".main::math_ev3($y2)." feet from the starting line ".main::math_ev3($x3)." seconds since timing started.", + "The particle was ".main::math_ev3($y2)." feet from the starting line ".main::math_ev3($x2)." seconds since timing started, or ".main::math_ev3($x3)." seconds since timing started.", ); #Create a hash and its inverse that randomizes the order of the four graphs. @@ -174,20 +193,21 @@ The following figure has the graph [`y=d(t)`], which models a particle's distanc [@EnlargeImageStatementPGML@]** ->>[@ image(insertGraph( $gr[0] ), tex_size=>400, width=>240, +>>[@ image( $gr[0], width=>300, extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" ) @]*<< -a) [`d([$x1])=`][_________] +a. Find [`d([$x1])`]. + [_________] -b) Interpret the meaning of [`d([$x1])`]: +a. Interpret the meaning of [`d([$x1])`]. [@$radio1->buttons()@]* -c) Solve [`d(t)=[$y2]`] for [`t`]. [@KeyboardInstructions('Use commas to separate your answers if there are more than one solution.')@]** [`t=`][________] +a. Solve [`d(t)=[$y2]`] for [`t`]. [@KeyboardInstructions('Use commas to separate your answers if there are more than one solution.')@]** [`t=`][________] -d) Interpret the meaning of part c's solution(s): +a. Interpret the meaning of part c's solution(s). [@$radio2->buttons()@]* @@ -208,7 +228,7 @@ BEGIN_PGML_SOLUTION [@EnlargeImageStatementPGML@]** ->>[@ image(insertGraph( $gr[1] ), tex_size=>400, width=>240, +>>[@ image( $gr[1], tex_size=>400, width=>300, extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" ) @]*<< @@ -218,7 +238,7 @@ b) Answer is Part A implies the particle was [`[$y1]`] feet away from the starti c) According to data in the table, [`d([$x2])=[$y2]`] and [`d([$x3])=[$y3]`]. So the answer is [`[$ans3]`]. -d) Answer is Part C implies the article was [`[$y2]`] feet from the starting line [`[$x2]`] seconds since timing started, and again [`[$x3]`] seconds since timing started. +d) Answer is Part C implies the particle was [`[$y2]`] feet from the starting line [`[$x2]`] seconds since timing started, and again [`[$x3]`] seconds since timing started. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph50.pg index 05e175dcd0..4658d436ef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph50.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(algebra_functions_domain_range_graph_piecewise_linear_discontinuous) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph','piecewise') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,11 +28,13 @@ DOCUMENT(); loadMacros( "PGstandard.pl", - "PGgraphmacros.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", ); ############################################## @@ -37,7 +42,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + $x0 = non_zero_random(-3,3,1); $y0 = non_zero_random(-3,3,1); @@ -127,51 +132,34 @@ $range = Union($range0,$range1); Context("Numeric"); -for my $i (0..0) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - - add_functions($gr[$i], "$func0 for x in [$x2,$x0] using color:blue and weight:2"); - add_functions($gr[$i], "$func1 for x in [$x1,$x3] using color:blue and weight:2"); +$x0style = ($x0Included) ? 'soliddot' : 'hollowdot'; +$x1style = ($x1Included) ? 'soliddot' : 'hollowdot'; +$x2style = ($x2Included) ? 'soliddot' : 'hollowdot'; +$x3style = ($x3Included) ? 'soliddot' : 'hollowdot'; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot[firstcurve,domain=$x2:$x0,-] {$m0*(x-$x0)+$y0}; + \addplot[firstcurve,domain=$x1:$x3,-] {$m1*(x-$x1)+$y1}; + \addplot[firstcolor,$x0style] coordinates {($x0,$y0)}; + \addplot[firstcolor,$x1style] coordinates {($x1,$y1)}; + \addplot[firstcolor,$x2style] coordinates {($x2,$y2)}; + \addplot[firstcolor,$x3style] coordinates {($x3,$y3)}; +\end{axis} +END_TIKZ - if ($x0Included==1) { - $gr[$i]->stamps( closed_circle($x0,$y0,'blue') ); - } else { - $gr[$i]->stamps( open_circle($x0,$y0) ); - } - if ($x1Included==1) { - $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); - } else { - $gr[$i]->stamps( open_circle($x1,$y1) ); - } - - if ($x2Included==1) { - $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); - } else { - $gr[$i]->stamps( open_circle($x2,$y2) ); - } - - if ($x3Included==1) { - $gr[$i]->stamps( closed_circle($x3,$y3,'blue') ); - } else { - $gr[$i]->stamps( open_circle($x3,$y3) ); - } - -} $ALT0 = "This is the graph of a piecewise function with two line segments. The first segment starts from the $x2Text point ($x2,$y2), and ends at the $x0Text point ($x0,$y0). The second segment starts from the $x1Text point ($x1,$y1), and ends at the $x3Text point ($x3,$y3)."; @@ -180,20 +168,16 @@ $ALT0 = "This is the graph of a piecewise function with two line segments. The f Context("LimitedNumeric"); BEGIN_PGML -The graph of function [`f(x)`] is shown below. +A function is graphed. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< - -Based on the given graph of [`f(x)`], fill in the blanks. - - [`f([$x0])`]=[_________]{$ans} +>>[@image($gr, width=>300, extra_html_tags=>"alt = '$ALT0' title = '$ALT0'") @]*<< -The function's domain, in interval notation, is [_____________]{$domain}. +[@KeyboardInstructions("If needed, use the upper case letter [|U|]* to represent the union symbol.")@]** -The function's range, in interval notation, is [_____________]{$range}. Use the upper case letter U to represent the "union" symbol, if needed. +The function has domain [_____________]{$domain} and range [_____________]{$range}. END_PGML ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg index e0463d4655..e19788c515 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg @@ -7,28 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "PCCmacros.pl", + "PGcourse.pl", "PGinfo.pl", - "PGcourse.pl" ); @@ -36,7 +40,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); Context()->noreduce('(-x)-y','(-x)+y'); @@ -121,10 +125,10 @@ The graph of a function [`f`] is shown below. Use interval notation in your answers. Use *inf* to represent infinity. a. Solve [`` f(x) \ge [$py] ``] - Solution: [_________]{$ans1} + [_________]{$ans1} a. Solve [`` f(x) \lt [$py] ``] - Solution: [_________]{$ans2} + [_________]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg index d8fb8e6b2f..41c436a39a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg @@ -7,28 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "PCCmacros.pl", + "PGcourse.pl", "PGinfo.pl", - "PGcourse.pl" ); @@ -36,7 +40,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; @@ -125,10 +129,10 @@ The graph of a function [`f`] is shown below. Use interval notation in your answers. Use *inf* to represent infinity. a. Solve [`` f(x) \gt [$p2y] ``] - Solution: [_________]{$ans1} + [_________]{$ans1} a. Solve [`` f(x) \le [$p2y] ``] - Solution: [_________]{$ans2} + [_________]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg index 9c6047fae6..008f6e5740 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg @@ -7,29 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## MLT(graphabovegraph) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "PCCmacros.pl", + "PGcourse.pl", "PGinfo.pl", - "PGcourse.pl" ); @@ -38,7 +41,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; @@ -105,27 +108,22 @@ for my $i (0..1) { $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); } - if ($leftOrRight eq 'left') { + if ($px<=0) { $y1 = $f->eval(x=>$px-1); $y2 = $g->eval(x=>$px-1); - if ($y1>$y2) { - $gr[$i]->lb( new Label($px-1,$y1+$marksep[1]/8,"f(x)",'red','center','bottom')); - $gr[$i]->lb( new Label($px-1,$y2-$marksep[1]/8,"g(x)",'blue','center','top')); - } else { - $gr[$i]->lb( new Label($px-1,$y1-$marksep[1]/8,"f(x)",'red','center','top')); - $gr[$i]->lb( new Label($px-1,$y2+$marksep[1]/8,"g(x)",'blue','center','bottom')); - } - } else { + if ($m1>0) {$gr[$i]->lb( new Label($px-1,$y1,"f(x)",'red','right','bottom'));} + else {$gr[$i]->lb( new Label($px-1,$y1,"f(x)",'red','left','bottom'));} + if ($m2>0) {$gr[$i]->lb( new Label($px-1,$y2,"g(x)",'blue','left','top'));} + else {$gr[$i]->lb( new Label($px-1,$y2,"g(x)",'blue','right','top'));} + } else { $y1 = $f->eval(x=>$px+1); $y2 = $g->eval(x=>$px+1); - if ($y1>$y2) { - $gr[$i]->lb( new Label($px+1,$y1+$marksep[1]/8,"f(x)",'red','center','bottom')); - $gr[$i]->lb( new Label($px+1,$y2-$marksep[1]/8,"g(x)",'blue','center','top')); - } else { - $gr[$i]->lb( new Label($px+1,$y1-$marksep[1]/8,"f(x)",'red','center','top')); - $gr[$i]->lb( new Label($px+1,$y2+$marksep[1]/8,"g(x)",'blue','center','bottom')); - } - } + if ($m1>0) {$gr[$i]->lb( new Label($px+1,$y1,"f(x)",'red','right','bottom'));} + else {$gr[$i]->lb( new Label($px+1,$y1,"f(x)",'red','left','bottom'));} + if ($m2>0) {$gr[$i]->lb( new Label($px+1,$y2,"g(x)",'blue','left','top'));} + else {$gr[$i]->lb( new Label($px+1,$y2,"g(x)",'blue','right','top'));} + } + } if ($px>0) { @@ -163,7 +161,7 @@ if ($leftOrRight eq 'left') { Context("LimitedNumeric"); BEGIN_PGML -The graphs of functions [`f`] and [`g`] are shown below. +The graphs of functions [`f`] (in red) and [`g`] (in blue) are shown below. [@EnlargeImageStatementPGML()@]** @@ -172,10 +170,10 @@ The graphs of functions [`f`] and [`g`] are shown below. Use interval notation in your answers. Use *inf* to represent infinity. a. Solve [`` f(x) \gt g(x) ``] - Solution: [_________]{$ans1} + [_________]{$ans1} a. Solve [`` f(x) \le g(x) ``] - Solution: [_________]{$ans2} + [_________]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg index d536dbfb9c..039c3f5b78 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg @@ -7,36 +7,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## MLT(graphabovegraph) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "PCCmacros.pl", + "PGcourse.pl", "PGinfo.pl", - "PGcourse.pl" ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; @@ -101,27 +104,21 @@ for my $i (0..1) { $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); } - if ($leftOrRight eq 'left') { + if ($px<=0) { $y1 = $f->eval(x=>$px-1); $y2 = $g->eval(x=>$px-1); - if ($y1>$y2) { - $gr[$i]->lb( new Label($px-1,$y1+$marksep[1]/8,"f(x)",'red','center','bottom')); - $gr[$i]->lb( new Label($px-1,$y2-$marksep[1]/8,"g(x)",'blue','center','top')); - } else { - $gr[$i]->lb( new Label($px-1,$y1-$marksep[1]/8,"f(x)",'red','center','top')); - $gr[$i]->lb( new Label($px-1,$y2+$marksep[1]/8,"g(x)",'blue','center','bottom')); - } - } else { + if ($m1>0) {$gr[$i]->lb( new Label($px-1,$y1,"f(x)",'red','right','bottom'));} + else {$gr[$i]->lb( new Label($px-1,$y1,"f(x)",'red','left','bottom'));} + if ($m2>0) {$gr[$i]->lb( new Label($px-1,$y2,"g(x)",'blue','left','top'));} + else {$gr[$i]->lb( new Label($px-1,$y2,"g(x)",'blue','right','top'));} + } else { $y1 = $f->eval(x=>$px+1); $y2 = $g->eval(x=>$px+1); - if ($y1>$y2) { - $gr[$i]->lb( new Label($px+1,$y1+$marksep[1]/8,"f(x)",'red','center','bottom')); - $gr[$i]->lb( new Label($px+1,$y2-$marksep[1]/8,"g(x)",'blue','center','top')); - } else { - $gr[$i]->lb( new Label($px+1,$y1-$marksep[1]/8,"f(x)",'red','center','top')); - $gr[$i]->lb( new Label($px+1,$y2+$marksep[1]/8,"g(x)",'blue','center','bottom')); - } - } + if ($m1>0) {$gr[$i]->lb( new Label($px+1,$y1,"f(x)",'red','right','bottom'));} + else {$gr[$i]->lb( new Label($px+1,$y1,"f(x)",'red','left','bottom'));} + if ($m2>0) {$gr[$i]->lb( new Label($px+1,$y2,"g(x)",'blue','left','top'));} + else {$gr[$i]->lb( new Label($px+1,$y2,"g(x)",'blue','right','top'));} + } } $LOR = ($px>0) ? 'left' : 'right'; @@ -174,10 +171,10 @@ The graphs of functions [`f`] and [`g`] are shown below. Use interval notation in your answers. Use *inf* to represent infinity. a. Solve [`` f(x) \lt g(x) ``] - Solution: [_________]{$ans1} + [_________]{$ans1} a. Solve [`` f(x) \ge g(x) ``] - Solution: [_________]{$ans2} + [_________]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg index 24557763ec..72b140a98a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg @@ -7,29 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## MLT(graphabovegraph) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "PCCmacros.pl", + "PGcourse.pl", "PGinfo.pl", - "PGcourse.pl" ); @@ -37,7 +40,7 @@ loadMacros( TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; @@ -141,10 +144,10 @@ The graphs of two functions, [`f`] and [`g`] are shown below. Use interval notation in your answers. Use *inf* to represent infinity. a. Solve [`` f(x) \ge g(x) ``] - Solution: [_________]{$ans1} + [_________]{$ans1} a. Solve [`` f(x) \lt g(x) ``] - Solution: [_________]{$ans2} + [_________]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg index addd93b3fe..f05b6b0746 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg @@ -7,27 +7,30 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## MLT(graphabovegraph) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -35,7 +38,7 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); -$refreshCachedImages=1; + do { #define f(x) @@ -71,7 +74,13 @@ do { #find the right-side intersection $rightInterceptX = ($gMidY-$fMidY+$gMidX+$fMidX)/2; $rightInterceptY = ($gMidX-$fMidX+$gMidY+$fMidY)/2; -} until ( (int($rightInterceptX)==$rightInterceptX) && ($rightInterceptX!=$gRightX) ); +} until ( + (int($rightInterceptX)==$rightInterceptX) && + ($rightInterceptX<$gRightX) && + ($leftInterceptX>$gLeftX) && + ($rightInterceptX<$fRightX) && + ($leftInterceptX>$fLeftX) + ); $border = 8; ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-$border,$border],[-$border,$border],centerOrigin=>1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg index ccaceec803..d38cb40a4f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg @@ -7,36 +7,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## MLT(graphabovegraph) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "PCCmacros.pl", + "PGcourse.pl", "PGinfo.pl", - "PGcourse.pl" ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; @@ -91,24 +94,16 @@ $ALT0 = "This graph has a function f(x), which is a straight line colored in blu #the graph used in solution -if ($p2x>$p1x) { add_functions($gr[1], "$f for x in <$p1x,$p2x> using color:blue and weight:2"); $gr[1]->stamps( closed_circle($p1x,$p1y,'blue') ); $gr[1]->stamps( open_circle($p2x,$p2y,'blue') ); $ALT1 = "This graph has a function f(x), which is a straight line colored in blue. Only the part in the domain ($p1x,$p2x) is graphed. There are two horizontal lines, colored in red, at y=$p1y and y=$p2y. The graph of f(x) crosses those two horizontal lines at ($p1x,$p1y) and ($p2x,$p2y). The point ($p1x,$p1y) is closed, and the point ($p2x,$p2y) is open."; -} else { - add_functions($gr[1], "$f for x in <$p2x,$p1x> using color:blue and weight:2"); - $gr[1]->stamps( open_circle($p1x,$p1y,'blue') ); - $gr[1]->stamps( closed_circle($p2x,$p2y,'blue') ); - $ALT1 = "This graph has a function f(x), which is a straight line colored in blue. Only the part in the domain ($p1x,$p2x) is graphed. There are two horizontal lines, colored in red, at y=$p1y and y=$p2y. The graph of f(x) crosses those two horizontal lines at ($p2x,$p2y) and ($p1x,$p1y). The point ($p2x,$p2y) is closed, and the point ($p1x,$p1y) is open."; -} - Context("Interval"); $ans1 = ($p1x<$p2x) ? Compute("[$p1x,$p2x)") : Compute("($p2x,$p1x]"); $ans2 = ($p1x<$p2x) ? Compute("(-infinity,$p1x)U[$p2x,infinity)") : Compute("(-infinity,$p2x]U($p1x,infinity)"); $ans3 = ($p1x<$p2x) ? Compute("(-infinity,$p2x]") : Compute("[$p2x,infinity)"); - + ############################################## Context("LimitedNumeric"); BEGIN_PGML @@ -122,13 +117,13 @@ The graph of function [`f`] is shown below. There are also two horizontal lines. Use interval notation in your answers. Use *inf* to represent infinity. a. Solve [`` [$p1y] \le f(x) \lt [$p2y] ``] - Solution: [_________]{$ans1} + [_________]{$ans1} a. Solve [`` f(x) \lt [$p1y] \text{ or } f(x) \ge [$p2y] ``] - Solution: [_________]{$ans2} + [_________]{$ans2} a. Solve [`` f(x) \le [$p2y] ``] - Solution: [_________]{$ans3} + [_________]{$ans3} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg index f40ccf8452..f6c74bfba6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg @@ -7,36 +7,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.F','F-IF') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## MLT(graphabovegraph) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() ## KEYWORDS('function','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "PCCmacros.pl", + "PGcourse.pl", "PGinfo.pl", - "PGcourse.pl" ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xMin = -4; $xMax = -$xMin; @@ -132,13 +135,13 @@ The graphs of 3 functions, [`f(x)`], [`g(x)`] and [`h(x)`] are shown below. Use interval notation in your answers. Use *inf* to represent infinity. a. Solve [`` f(x) \le h(x) \text{ or } f(x) \gt g(x) ``] - Solution: [_________]{$ans1} + [_________]{$ans1} a. Solve [`` h(x) \lt f(x) \le g(x) ``] - Solution: [_________]{$ans2} + [_________]{$ans2} a. Solve [`` f(x) \gt h(x) ``] - Solution: [_________]{$ans3} + [_________]{$ans3} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions100.pg index d15471b2e1..b4741e4eb7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions100.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('Functions') +##DBsection('Domain and Range') +##KEYWORDS('domain','range','function','ordered pair') ##DBCCSS('F.IF.1') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('domain','range','function','ordered pair') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + , + "PGcourse.pl", ); TEXT(beginproblem()); @@ -61,10 +64,10 @@ $Q = Point("($c,$d)"); BEGIN_PGML -Fill in the blanks. - If [`[$fname]([$a])=[$b]`], then the point [____________]{$P} is on the graph of [`[$fname]`]. - If [`[$Q]`] is on the graph of [`[$fname]`], then [`[$fname]([$c])=`][________]{$d}. +a. If [`[$fname]([$a])=[$b]`], then the point [_]{$P}{6} is on the graph of [`[$fname]`]. + +a. If [`[$Q]`] is on the graph of [`[$fname]`], then [`[$fname]([$c])=`][_]{$d}{6}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions110.pg index 6649eaeb3a..8fc96a1c99 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions110.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('Functions') +##DBsection('Domain and Range') +##KEYWORDS('domain','range','function','ordered pair') ##DBCCSS('F.IF.1') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) -## KEYWORDS('domain','range','function','ordered pair') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -29,7 +31,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + + , + "PGcourse.pl", ); @@ -54,11 +58,9 @@ TEXT(beginproblem()); BEGIN_PGML -Fill in the blank. - If [`[$fname]([$var1])=[$var2]`], then the point [_____________]{$P} is on the graph of [`[$fname]`]. +If [`[$fname]([$var1])=[$var2]`], then the point [_]{$P}{6} is on the graph of [`[$fname]`]. -The answer is not a specific numerical point, but one with variables for coordinates. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions120.pg index 1cd7320d64..b83981aee4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions120.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('Functions') +##DBsection('Domain and Range') +##KEYWORDS('domain','range','function','ordered pair') ##DBCCSS('F.IF.1') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) -## KEYWORDS('domain','range','function','ordered pair') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + , + "PGcourse.pl", ); TEXT(beginproblem()); @@ -50,9 +53,8 @@ $P = Point("($var1,$var2)"); ############################################## BEGIN_PGML -Fill in the blank. - If [`[$P]`] is on the graph of [`[$fname]`], then [`[$fname]([$var1])=`][__________]{"$var2"}. +If [`[$P]`] is on the graph of [`[$fname]`], then [`[$fname]([$var1])=`][_]{"$var2"}{6}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions150.pg index 507fb60222..c57f811b38 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions150.pg @@ -3,16 +3,18 @@ # This template asks for a function that takes feet as its input and converts it to miles. # Last updates: Neft 7/23/2013 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('function') ##DBCCSS('8.F.4,F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) -## KEYWORDS('function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -24,7 +26,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "parserAssignment.pl", + "PCCmacros.pl", + "PGcourse.pl", ); @@ -41,22 +45,24 @@ $feet = random(10000,30000,1000); # this will be the input in feet $answer = $miles->eval(x=>$feet); # result of the conversion +Context("Numeric"); +parser::Assignment->Allow; +parser::Assignment->Function("M"); +$formula = Formula("M(x)=$miles"); + ############################################## BEGIN_PGML -Suppose that [`M`] is the function that computes how many miles are in [`x`] feet. Find the algebraic rule for [`M`]. (If you do not know how many feet are in one mile, you can look it up on Google.) - - - [`M(x)=`][_______________________]{$miles} - - +Suppose that [`M`] is the function that computes how many miles are in [`x`] feet. Find the formula for [`M`]. If you do not know how many feet are in one mile, you can look it up on Google. +[@KeyboardInstructions(qw!Include the function's name and an equals sign in the formula.!)@]** +[_______________________]{$formula} -Evaluate [`M([$feet])`] and interpret the result: - There are about [_______________]{$answer->cmp(tolerance=>0.03)} miles in [____________]{$feet} feet. +Evaluate [`M([$feet])`] and interpret the result. +There are about [_____]{$answer->cmp(tolerance=>0.03)} miles in [______]{$feet} feet. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions160.pg index f651278f68..80207df585 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions160.pg @@ -3,16 +3,18 @@ # This template asks for an algebraic formula to convert pounds to kilograms using function notation. # Last updates: Neft 7/23/2013 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('function') ##DBCCSS('8.F.4,F.IF.2') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) -## KEYWORDS('function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -24,7 +26,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "parserAssignment.pl", + "PCCmacros.pl", + "PGcourse.pl", ); @@ -41,24 +45,25 @@ $pounds = random(100,300,1); #generate a random number of pounds $answer = $kilograms->eval(x=>$pounds); #do the math +Context("Numeric"); +parser::Assignment->Allow; +parser::Assignment->Function("K"); +$formula = Formula("K(x)=$kilograms"); ############################################## BEGIN_PGML -Suppose that [`K`] is the function that computes how many kilograms are in [`x`] pounds. Find the algebraic rule for [`K`]. (If you do not know how many pounds are in one kilogram, you can look it up on Google.) - - - - [`K(x)=`][_______________________]{$kilograms->cmp(tolerance=>1.00001-2.2/2.20462262)} - +Suppose that [`K`] is the function that computes how many kilograms are in [`x`] pounds. Find the formula for [`K`]. If you do not know how many pounds are in one kilogram, you can look it up on Google. +[@KeyboardInstructions(qw!Include the function's name and an equals sign in the formula.!)@]** +[_______________________]{$formula} Evaluate [`K([$pounds])`] and interpret the result. - Something that weighs [________________]{$pounds}pounds would weigh about [____________]{$answer->cmp(tolerance=>0.003)}kilograms. +Something that weighs [______]{$pounds} pounds would weigh about [______]{$answer->cmp(tolerance=>0.003)}kilograms. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions170.pg index a498fa1dc9..e1010ad019 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions170.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions170.pg @@ -3,17 +3,19 @@ # This template presents a polynomial function and asks the student to state the domain. # Last updates: Neft 7/24/2013 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('domain,function') -## MLT(algebra_functions_domain_range_poly) +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') + ############################################## @@ -26,7 +28,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); TEXT(beginproblem()); @@ -54,13 +56,11 @@ $domain = Interval("(-inf,inf)"); BEGIN_PGML -Find the domain of the function [:[$fname]:] where [:[$fname](x)=[$f]:]. - - The domain is [_____________]{$domain} (in interval notation). - -If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type *(-inf,5) U (5,10]*. +Find the domain of [`[$fname]`] where [``[$fname](x)=[$f]``]. +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + [_____________]{$domain} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions180.pg index edb941d505..11e7dcae80 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions180.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions180.pg @@ -4,15 +4,18 @@ # Last updates: Yao 06/24/2016 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## KEYWORDS('domain,function') +##Author('Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); TEXT(beginproblem()); @@ -50,11 +53,11 @@ $domain = Interval("(-inf,inf)"); BEGIN_PGML -Find the domain of the function [`[$fname]`] where [``[$fname](x)=\lvert [$f] \rvert``]. +Find the domain of [`[$fname]`] where [``[$fname](x)=\lvert [$f] \rvert``]. -If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example: *(-inf,5) U (5, inf)*. +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** - The domain is [_____________]{$domain} (in interval notation). + [_____________]{$domain} END_PGML @@ -63,7 +66,7 @@ END_PGML BEGIN_PGML_SOLUTION -Since [:[$fname]:] is an absolute value function composed with a linear function, any real number is a valid input. Therefore the domain of [:[$fname]:] is [`[$domain]`]. +Since [:[$fname]:] is an absolute value function, any real number is a valid input. Therefore the domain of [:[$fname]:] is [`[$domain]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions182.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions182.pg index c9dc52be4d..21248dbc2f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions182.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions182.pg @@ -4,15 +4,18 @@ # Last updates: Yao 06/24/2016 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## KEYWORDS('domain,function') +##Author('Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions200.pg index 7bcf305469..25f8053a59 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions200.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions200.pg @@ -3,17 +3,19 @@ # This template presents a rational function and asks the student to state the domain. # Last updates: Neft 7/24/2013 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('domain,function') -## MLT(algebra_functions_domain_range_linear_over_linear) +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') + ############################################## @@ -25,7 +27,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -54,12 +56,11 @@ $domain = Interval("(-inf,$a)U($a,inf)"); BEGIN_PGML -Find the domain of the function [:[$fname]:] where [:[$fname](x)=[$f]:]. - - The domain is [_____________]{$domain} (in interval notation). +Find the domain of [``[$fname]``] where [``[$fname](x)=[$f]``]. -If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type *(-inf,5) U (5,10]*. +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + [_____________]{$domain} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions210.pg index 7a095d7811..17a7232400 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions210.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions210.pg @@ -3,17 +3,19 @@ # This template presents a rational function and asks the student to state the domain. # Last updates: Neft 7/24/2013 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('domain,function') -## MLT(algebra_functions_domain_range_linear_over_linear) +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') + ############################################## @@ -26,7 +28,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -68,13 +70,11 @@ $domainTeXstring = "\left(-\infty,$stringMinus\frac{$rnum}{$rden}\right)\cup\lef BEGIN_PGML -Find the domain of the function [:[$fname]:] where [:[$fname](x)=[$f]:]. - - The domain is [_____________________]{$domain->cmp(correct_ans_latex_string=>$domainTeXstring)} in interval notation. +Find the domain of [``[$fname]``] where [``[$fname](x)=[$f]``]. -$ -If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type *(-inf,5) U (5,10]*. +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + [_____________]{$domain->cmp(correct_ans_latex_string=>$domainTeXstring)} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions211.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions211.pg index 0ab7ca0202..24e9da8324 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions211.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions211.pg @@ -4,16 +4,18 @@ # Last updates: Yao 6/10/2016 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(HolesRationalFunctions) -## Level(3) -## KEYWORDS('domain,function') +##Author('Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -62,12 +64,11 @@ $domain = Interval("(-inf,-$d)U(-$d,-$c)U(-$c,inf)"); BEGIN_PGML -Find the domain of the function [``[$fname]``] where [``[$fname](x)=[$f]``]. +Find the domain of [``[$fname]``] where [``[$fname](x)=[$f]``]. -If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example: *(-inf,5) U (5, inf)*. +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** - - The domain is [_____________________]{$domain} in interval notation. + [_____________]{$domain} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions212.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions212.pg index db2dd6179d..93a741869e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions212.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions212.pg @@ -4,16 +4,18 @@ # Last updates: Yao 6/10/2016 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(HolesRationalFunctions) -## Level(3) -## KEYWORDS('domain,function') +##Author('Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -62,12 +64,12 @@ if ($c<0) { BEGIN_PGML -Find the domain of the function [``[$fname]``] where [``[$fname](x)=[$f]``]. +Find the domain of [``[$fname]``] where [``[$fname](x)=[$f]``]. -If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example: *(-inf,5) U (5, inf)*. +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + [_____________]{$domain} - The domain is [_____________________]{$domain} in interval notation. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions213.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions213.pg index ea58051a7d..1f24e160f1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions213.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions213.pg @@ -4,16 +4,18 @@ # Last updates: Yao 6/10/2016 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Carl Yao) -## MLT(HolesRationalFunctions) -## Level(3) -## KEYWORDS('domain,function') +##Author('Carl Yao') +##Institution('PCC') @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -61,12 +63,12 @@ $domain = Interval("(-inf,-$d)U(-$d,-$c)U(-$c,inf)"); BEGIN_PGML -Find the domain of the function [``[$fname]``] where [``[$fname](x)=[$f]``]. +Find the domain of [``[$fname]``] where [``[$fname](x)=[$f]``]. -If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example: *(-inf,5) U (5, inf)*. +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + [_____________]{$domain} - The domain is [_____________________]{$domain} in interval notation. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions214.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions214.pg index ec05e72c71..c67ff2a7ef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions214.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions214.pg @@ -4,17 +4,18 @@ # Last updates: Yao 6/10/2016 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(HolesRationalFunctions) -## Level(3) -## MO(1) -## KEYWORDS('domain,function') +##Author('Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -28,7 +29,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -68,12 +69,11 @@ $domain = Interval("(-inf,$p1)U($p1,$p2)U($p2,inf)"); BEGIN_PGML -Find the domain of the function [``[$fname]``] where [``[$fname](x)=[$f]``]. +Find the domain of [``[$fname]``] where [``[$fname](x)=[$f]``]. -If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example: *(-inf,5) U (5, inf)*. +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** - - The domain is [_____________________]{$domain->cmp(correct_ans_latex_string=>$domainTeXstring)} in interval notation. + [_____________]{$domain->cmp(correct_ans_latex_string=>$domainTeXstring)} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions215.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions215.pg index 53aa72c1b3..c1f5bf0fe6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions215.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions215.pg @@ -4,17 +4,18 @@ # Last updates: Yao 6/10/2016 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(HolesRationalFunctions) -## Level(3) -## MO(1) -## KEYWORDS('domain,function') +##Author('Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -28,7 +29,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -76,7 +77,7 @@ if ($d>0) { BEGIN_PGML -Find the domain of the function [``[$fname]``] where [``[$fname](x)=[$f]``]. +Find the domain of [``[$fname]``] where [``[$fname](x)=[$f]``]. If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example: *(-inf,5) U (5, inf)*. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions216.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions216.pg index 8bf3baa365..e2fd19eb74 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions216.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions216.pg @@ -4,16 +4,18 @@ # Last updates: Yao 6/10/2016 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(HolesRationalFunctions) -## Level(3) -## KEYWORDS('domain,function') +##Author('Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -57,12 +59,11 @@ $domain = Interval("(-inf,inf)"); BEGIN_PGML -Find the domain of the function [``[$fname]``] where [``[$fname](x)=[$f]``]. +Find the domain of [``[$fname]``] where [``[$fname](x)=[$f]``]. -If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example: *(-inf,5) U (5, inf)*. +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** - - The domain is [_____________________]{$domain} in interval notation. + [_____________]{$domain} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions217.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions217.pg index 6a086c5951..e66558f1af 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions217.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions217.pg @@ -4,16 +4,18 @@ # Last updates: Yao 6/15/2016 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(algebra_functions_domain_range_high_root) -## Level(3) -## KEYWORDS('domain,function') +##Author('Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -49,15 +51,16 @@ $domain = Interval("(-$b,inf)"); ############################################## +BEGIN_PGML +Find the domain of the function. -BEGIN_PGML -Find the domain of the function [``[$fname]``] where [``[$fname](x)=[$f]``]. +[`[$fname](x)=[$f]`] -If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example: *(-inf,5) U (5, inf)*. +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + [_____________]{$domain} - The domain is [_____________________]{$domain} in interval notation. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions225.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions225.pg index 28abf98edc..cfb0c54798 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions225.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions225.pg @@ -3,18 +3,20 @@ # This template presents a radical function and asks the student to state the domain. # Last updates: Neft 7/31/2013 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('domain,function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') + -## MLT(AlgDom1) ############################################## @@ -25,7 +27,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -50,17 +52,13 @@ $domain = Compute("(-inf,$a]"); BEGIN_PGML -Find the domain of the function [`[$fname]`] where [`[$fname](x)=[$f]`]. - - - - The domain is [____________________]{$domain} (in interval notation). - - If you need to enter [`\infty`], you can type *inf* or *infinty*. If you need to union two (or more) intervals, use the letter *U*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [`(-inf,5)U(5,10]`]. - +Find the domain of the function. +[`[$fname](x)=[$f]`] +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + [_____________]{$domain} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions235.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions235.pg index 6acd7914e6..429f10cfdd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions235.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions235.pg @@ -3,29 +3,32 @@ # This template presents a radical function and asks the student to state the domain. # Last updates: Neft 7/31/2013 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## KEYWORDS('domain,function') -## MLT(AlgDom1) +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') + ############################################## DOCUMENT(); + loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "contextFraction.pl", + "PGcourse.pl", ); @@ -57,17 +60,13 @@ $domainTeXstring = "\left[-\frac{$a}{$b},\infty\right)"; BEGIN_PGML +Find the domain of the function. -Find the domain of the function [`[$fname]`] where [`[$fname](x)=[$f]`]. - - - - The domain is [____________________]{$domain->cmp(correct_ans_latex_string=>$domainTeXstring)} (in interval notation). - - If you need to enter [`\infty`], you can type *inf* or *infinity*. To enter the union of two (or more) intervals, use the letter *U*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [`(-\text{inf},5)\text{U}(5,10]`]. - +[`[$fname](x)=[$f]`] +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + [_____________]{$domain} END_PGML @@ -95,4 +94,64 @@ This tells us that [`x`] must be greater than or equal to [`-\frac{[$a]}{[$b]}`] END_PGML_SOLUTION +ENDDOCUMENT(); + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + + +Context("Fraction"); +$a = random(2,10,1); +$b = random(2,20,1); +while (gcd($a,$b) != 1) {$b = random(2,20,1);} + +$r = Fraction("-$a","$b"); + +Context("Numeric"); +$f = Formula("sqrt($a+$b x)")->reduce; + +Context("Interval"); +$domain = Compute("[$r,inf)"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Find the domain of the function \(f\) where \(f(x)=$f\). + +$PAR + +The domain is \{ans_rule(20)\} (in interval notation). +$BR If you need to enter \(\infty\), you can type $BBOLD INF$EBOLD or $BBOLD INFINITY$EBOLD. If you need to union two (or more) intervals, use the letter $BBOLD U$EBOLD. For example, to enter \((-\infty,5)\cup(5,10]\) you can type $BBOLD (-inf,5)U(5,10]$EBOLD. + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($domain->cmp); + + + + ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions240.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions240.pg index 580ca8b76c..0444c14c8d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions240.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions240.pg @@ -5,16 +5,18 @@ # Last update: Carl Yao 12/302/2016 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(algebra_functions_domain_range_high_root) -## Level(3) -## KEYWORDS('domain,function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -49,7 +51,9 @@ $domain = Compute("(-inf,inf)"); BEGIN_PGML -Find the domain of [`[$fname]`] where [`[$fname](x)=\sqrt[3]{[$radicand]}`]. +Find the domain of the function. + +[`[$fname](x)=\sqrt[3]{[$radicand]}`] [@KeyboardInstructions('Use interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions245.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions245.pg index 96729c887c..eb74a8e86b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions245.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions245.pg @@ -3,16 +3,18 @@ # This template presents a radical function and asks the student to state the domain. # Last updates: Carl Yao 12/30/2016 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(algebra_functions_domain_range_high_root) -## Level(3) -## KEYWORDS('domain,function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -48,7 +50,9 @@ $domain = Compute("(-inf,$f]"); BEGIN_PGML -Find the domain of [`[$fname]`] where [`[$fname](x)=\sqrt[4]{[$radicand]}`]. +Find the domain of the function. + +[`[$fname](x)=\sqrt[4]{[$radicand]}`] [@KeyboardInstructions('Use interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions250.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions250.pg index 0811ce3105..36379eb64c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions250.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions250.pg @@ -4,15 +4,18 @@ # Last updates: Carl Yao 1/16/2017 # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') ##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Function notation) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## KEYWORDS('domain,function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -72,7 +75,7 @@ $mc -> extra( BEGIN_PGML -For the function [`y=[$fname](x)`], when [`x=[$x1]`], its [`y`]-value is [`[$y1]`]. +For the function [`[$fname]`], when [`x=[$x1]`], the output is [`[$y1]`]. [@$mc -> print_q() @]** [@$mc -> print_a() @]* diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions90.pg index aa8dd4060b..133959ef77 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/Functions90.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION +##DBsubject('Algebra') +##DBchapter('Functions') +##DBsection('Domain and Range') +##KEYWORDS('domain','function') ##DBCCSS('F.IF') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') ##Problem('') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) -## MLT(RangeLinear) -## KEYWORDS('domain','function') +##Author('Debbie Neft, Alex Jordan, Carl Yao, Chris Hughes') +##Institution('PCC') @@ -31,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); TEXT(beginproblem()); @@ -55,11 +56,12 @@ $domain = Interval("(-inf,inf)"); BEGIN_PGML -Find the domain of the function [:[$fname]:] where [:[$fname](x)=[$f]:]. +Find the domain of [:[$fname]:] where [:[$fname](x)=[$f]:]. - The domain is [_____________]{$domain} (in interval notation). +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + + [_____________]{$domain} -If you need to enter [`\infty`], you can type *inf* or *infinity*. If you need to union two (or more) intervals, use the letter *U*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type *(-inf,5) U (5,10]*. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotAbsValuePoints.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotAbsValuePoints.pg new file mode 100644 index 0000000000..83ccff0753 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotAbsValuePoints.pg @@ -0,0 +1,96 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +($h,$k) = (1..3)[NchooseK(3,2)]; +$k *= -1; +$f = Formula("|x - $h| + $k")->reduce; + +@pts = (); +for my $x (0..5) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 4); +} +$n = scalar @pts; +$points = join(',',@pts); + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + bBox => [-0.5, 4, 5.5, -4], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points and other (which there shouldn't be any of) + my @studentpoints; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "Your answer includes an object that is not a point.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the function [`f`] where [`f(x)=[$f]`]. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotAlternatingPoints.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotAlternatingPoints.pg new file mode 100644 index 0000000000..1f40768577 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotAlternatingPoints.pg @@ -0,0 +1,97 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y','x*n'); +($a,$b) = (2..4)[NchooseK(3,2)]; +$b *= list_random(-1,1); +$f = Formula("(-1)^x*$a+$b")->reduce; + +@pts = (); +for my $x (-3..3) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 8); +} +$n = scalar @pts; +$points = join(',',@pts); + + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + bBox => [-3.5, 8, 3.5, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points, and other (which there shouldn't be any of) + my @studentpoints; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "Your answer includes an object that is not a point.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the function [`f`] where [`f(x)=[$f]`]. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotNegQuadraticPoints.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotNegQuadraticPoints.pg new file mode 100644 index 0000000000..b4dec93eae --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotNegQuadraticPoints.pg @@ -0,0 +1,134 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +($h,$k) = (1..5)[NchooseK(5,2)]; +$h *= list_random(-1,1); +$f = Formula("-x^2 + 2*$h x + (-($h)^2+$k)")->reduce; + +@pts = (); +push(@pts, "{point,(-8," . $f->eval(x=>-8) . ")}") if (abs($f->eval(x=>-8)) <= 7); +for my $x (-7..7) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 8); +} +push(@pts, "{point,(8," . $f->eval(x=>8) . ")}") if (abs($f->eval(x=>8)) <= 7); +$n = scalar @pts; +$points = join(',',@pts); + +$u = $h+1; +$v = $f->eval(x=>$u); + +$gt = GraphTool($points.",{parabola,solid,vertical,($h,$k),($u,$v)}")->with( + availableTools => ["PointTool","VerticalParabolaTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points, parabolas, and other (which there shouldn't be any of) + my @studentpoints; + my @studentparabolas; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } elsif ($_->extract(1) eq 'parabola' && $_->extract(3) eq 'vertical') { + push(@studentparabolas, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "You haven't plotted a curve yet.") unless (@studentparabolas); + push(@errors, "Your answer includes an object that is neither a point nor a vertical parabola.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $extraprbs = 0; + my $distinctprbs = 0; + my $countprbs = 0; + STUDENTPARABOLAS: + for my $j (@studentparabolas) { + ++$countprbs; + if (($j->extract(4) != Point($h,$k)) || ($j->extract(5)->value)[1] != $f->eval(x=>(($j->extract(5)->value)[0]))) { + push(@errors, "The parabola with vertex at " . $j->extract(4) . " passing through " . $j->extract(5) . " is incorrect."); + $extraprbs++; + next STUDENTPARABOLAS; + } + for my $i (0..($countprbs-2)) { + my ($hj,$kj) = $j->extract(4)->value; + my ($xj,$yj) = $j->extract(5)->value; + my ($hi,$ki) = $studentparabolas[$i]->extract(4)->value; + my ($xi,$yi) = $studentparabolas[$i]->extract(5)->value; + next STUDENTPARABOLAS if ( + # has same vertex as an earlier parabola + ($hj == $hi && $kj == $ki) && + # assuming same vertex, yields same parabola + ($yi - $ki)*($xj - $hj)**2 == ($yj - $kj)*($xi - $hi)**2 + ); + } + $distinctprbs++; + } + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + $score /= 2 unless ($distinctprbs == 1); + $score /= 2 if ($extraprbs); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the function [`f`] where [`f(x)=[$f]`]. +Then graph a curve that passes through these points. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotQuadraticPoints.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotQuadraticPoints.pg new file mode 100644 index 0000000000..d83a9211eb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotQuadraticPoints.pg @@ -0,0 +1,134 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +($h,$k) = (-5..-1)[NchooseK(5,2)]; +$h *= list_random(-1,1); +$f = Formula("x^2 - 2*$h x + (($h)^2+$k)")->reduce; + +@pts = (); +push(@pts, "{point,(-8," . $f->eval(x=>-8) . ")}") if (abs($f->eval(x=>-8)) <= 7); +for my $x (-7..7) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 8); +} +push(@pts, "{point,(8," . $f->eval(x=>8) . ")}") if (abs($f->eval(x=>8)) <= 7); +$n = scalar @pts; +$points = join(',',@pts); + +$u = $h+1; +$v = $f->eval(x=>$u); + +$gt = GraphTool($points.",{parabola,solid,vertical,($h,$k),($u,$v)}")->with( + availableTools => ["PointTool","VerticalParabolaTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points, parabolas, and other (which there shouldn't be any of) + my @studentpoints; + my @studentparabolas; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } elsif ($_->extract(1) eq 'parabola' && $_->extract(3) eq 'vertical') { + push(@studentparabolas, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "You haven't plotted a curve yet.") unless (@studentparabolas); + push(@errors, "Your answer includes an object that is neither a point nor a vertical parabola.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $extraprbs = 0; + my $distinctprbs = 0; + my $countprbs = 0; + STUDENTPARABOLAS: + for my $j (@studentparabolas) { + ++$countprbs; + if (($j->extract(4) != Point($h,$k)) || ($j->extract(5)->value)[1] != $f->eval(x=>(($j->extract(5)->value)[0]))) { + push(@errors, "The parabola with vertex at " . $j->extract(4) . " passing through " . $j->extract(5) . " is incorrect."); + $extraprbs++; + next STUDENTPARABOLAS; + } + for my $i (0..($countprbs-2)) { + my ($hj,$kj) = $j->extract(4)->value; + my ($xj,$yj) = $j->extract(5)->value; + my ($hi,$ki) = $studentparabolas[$i]->extract(4)->value; + my ($xi,$yi) = $studentparabolas[$i]->extract(5)->value; + next STUDENTPARABOLAS if ( + # has same vertex as an earlier parabola + ($hj == $hi && $kj == $ki) && + # assuming same vertex, yields same parabola + ($yi - $ki)*($xj - $hj)**2 == ($yj - $kj)*($xi - $hi)**2 + ); + } + $distinctprbs++; + } + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + $score /= 2 unless ($distinctprbs == 1); + $score /= 2 if ($extraprbs); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the equation [`y=[$f]`]. +Then graph a curve that passes through these points. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotRemainder.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotRemainder.pg new file mode 100644 index 0000000000..bccbe1f0e2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotRemainder.pg @@ -0,0 +1,107 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +$m = random(3,5,1); + +package NewFunc; +our @ISA = qw(Parser::Function::numeric2); + +sub modm { + shift; my $x = shift; my $mod = shift; + return $x % $mod; +} + +package main; + +Context()->functions->add(modm => {class => 'NewFunc'}); +$f = Formula("modm(x,$m)"); + +@pts = (); +for my $x (0..7) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 6); +} +$n = scalar @pts; +$points = join(',',@pts); + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + bBox => [-0.5, 6, 7.5, -0.5], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points, and other (which there shouldn't be any of) + my @studentpoints; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "Your answer includes an object that is not a point.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the funciton [`f`] where [`f(x)`] is the remainder when you divide [`x`] by [`[$m]`]. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotZigZag.pg b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotZigZag.pg new file mode 100644 index 0000000000..e57b3fd19f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/FunctionBasics/PlotZigZag.pg @@ -0,0 +1,95 @@ +# Plot the points along a quadratic function graph and then also plot the parabola. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric")->noreduce('(-x)-y','(-x)+y'); +($h,$k) = (-2..2)[NchooseK(5,2)]; +$f = Formula("|x-$h| - |x-$k|")->reduce; + +@pts = (); +for my $x (-4..4) { + push(@pts, "{point,($x," . $f->eval(x=>$x) . ")}") if (abs($f->eval(x=>$x)) <= 8); +} +$n = scalar @pts; +$points = join(',',@pts); + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + bBox => [-4.5, 8, 4.5, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @errors; + # sort student points, and other (which there shouldn't be any of) + my @studentpoints; + my @studentother; + for (@$student) { + if ($_->extract(1) eq 'point') { + push(@studentpoints, $_); + } else { + push(@studentother, $_); + } + } + push(@errors, "You haven't plotted any points.") unless (@studentpoints); + push(@errors, "Your answer includes an object that is not a point.") if (@studentother); + + my $extrapts = 0; + my $distinctpts = 0; + my $countpts = 0; + STUDENTPOINTS: + for my $j (@studentpoints) { + ++$countpts; + if (($j->extract(2)->value)[1] != $f->eval(x=>(($j->extract(2)->value)[0]))) { + push(@errors, "The point graphed at " . $j->extract(2) . " is incorrect."); + $extrapts++; + next STUDENTPOINTS; + } + for my $i (0..($countpts-2)) { + next STUDENTPOINTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinctpts++; + } + push(@errors, "You've only plotted $distinctpts correct point".(($distinctpts > 1)?'s':'').".") if ($distinctpts > 0 && $distinctpts < $n); + + my $score = max(scalar(@{$correct}),scalar(@{$student})); + $score *= $distinctpts/$n; + $score /= 2 if ($extrapts); + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot points for the function [`f`] where [`f(x)=[$f]`]. + +[@KeyboardInstructions('Plot as many points as can fit in this viewing window and have integer coordinates.')@]** + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea10.pg index 52db215d73..63397cb343 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea10.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.G.4') -## DBsubject(Geometry) -## DBchapter(Circle geometry) -## DBsection(Circumference and area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','circumference','circle') +## DBCCSS('7.G.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +31,8 @@ loadMacros( "parserNumberWithUnits.pl", "parserFormulaWithUnits.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -64,15 +68,15 @@ BEGIN_PGML A circle's radius is [`[$radiusMO]`]. -a) This circle's circumference, in terms of [`\pi`], is [_____________]. (Type *pi* for [`\pi`].) +a) The circumference, in terms of [`\pi`], is [_]{width=>5}. [@KeyboardInstructions(q!(Type [|pi|]* for [`\pi`].)!)@]** -b) This circle's circumference, rounded to the hundredth place, is [_____________]. +b) This circle's circumference, rounded to the hundredths place, is [_]{width=>5}. -c) This circle's area, in terms of [`\pi`], is [_____________]. (Type *pi* for [`\pi`].) +c) This circle's area, in terms of [`\pi`], is [_]{width=>5}. [@KeyboardInstructions(q!(Type [|pi|]* for [`\pi`].)!)@]** -d) This circle's area, rounded to the hundredth place, is [_____________]. +d) This circle's area, rounded to the hundredths place, is [_]{width=>5}. -(Use *m* for meters and *m[$CARET]2* for square meters.) +[@KeyboardInstructions(q!(Use [|m|]* for meters and [|m^2|]* for square meters.)!)@]** END_PGML @@ -113,41 +117,40 @@ A circle's circumference formula is [` C= \pi d `] or [` C= 2 \pi r `] and a cir Throughout these computations, all quantities have units attached, and we only show them in the final step. +When you enter [`\pi`]'s value in a calculator, don't round it to [`3.14`]. Use the [`\pi`] button on your calculator instead. This way, your result is more accurate. +a) For this problem the radius is given, so we use the second formula for circumference: -a) For this problem the radius is given, so we use the second formula for circumference: - - [``\begin{aligned} + [```\begin{aligned} C & = 2 \pi r\\\ & = 2 \cdot \pi \cdot [$radius]\\ & = [$circumferenceWithPiMO] - \end{aligned}``] + \end{aligned}```] Don't forget the length unit [`\textrm{m}`]. -b) [``\begin{aligned}[t] +b) [```\begin{aligned}[t] C& = [$diameter] \pi\\ - & \approx [$diameter] \cdot 3.14\ldots\\ + & \approx [$diameter] \cdot 3.1415926\ldots\\ & \approx [$circumferenceMO] - \end{aligned}``] + \end{aligned}```] Don't forget the length unit [`\textrm{m}`]. - -c) [``\begin{aligned}[t] +c) [```\begin{aligned}[t] A&= \pi r^{2}\\ &= \pi \cdot [$radiusSquared]\\ &= [$areaWithPiMO] - \end{aligned}``] + \end{aligned}```] Don't forget the area unit [`\textrm{m}^2`]. -d) [``\begin{aligned}[t] +d) [```\begin{aligned}[t] A&= [$radiusSquared] \pi\\ - & \approx [$radiusSquared] \cdot 3.14\ldots\\ + & \approx [$radiusSquared] \cdot 3.1415926\ldots\\ & \approx [$areaMO] - \end{aligned}``] + \end{aligned}```] Don't forget the area unit [`\textrm{m}^2`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea20.pg new file mode 100644 index 0000000000..fe7f647bfd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea20.pg @@ -0,0 +1,162 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given diameter, find the circumference and area of a circle. +# +# Last edited by Carl Yao on 7/17/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('area','circumference','circle') +## DBCCSS('7.G.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "parserFormulaWithUnits.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$radius = random(2,10,1); +$diameter = $radius*2; +$radiusSquared = $radius**2; + +$radiusMO = NumberWithUnits("$radius m"); +$diameterMO = NumberWithUnits("$diameter m"); + +$pi = Compute("pi"); +$circumferceRounded = sprintf("%.2f", $diameter*$pi); +$circumferenceMO = NumberWithUnits("$circumferceRounded m"); +$areaRounded = sprintf("%.2f", $pi*$radiusSquared ); +$areaMO = NumberWithUnits("$areaRounded m^2"); + +Context()->constants->remove('pi'); +Context()->variables->are(pi=>'Real'); +Context()->variables->set(pi => {TeX=>'\pi'}); + +$circumferenceWithPiMO = FormulaWithUnits("$diameter pi" , 'm'); +$areaWithPiMO = FormulaWithUnits("$radiusSquared pi", 'm^2'); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A circle's diameter is [`[$diameterMO]`]. + +a) This circle's circumference, in terms of [`\pi`], is [_]{width=>5}. [@KeyboardInstructions(q!(Type [|pi|]* for [`\pi`].)!)@]** + +b) This circle's circumference, rounded to the hundredths place, is [_]{width=>5}. + +c) This circle's area, in terms of [`\pi`], is [_]{width=>5}. [@KeyboardInstructions(q!(Type [|pi|]* for [`\pi`].)!)@]** + +d) This circle's area, rounded to the hundredths place, is [_]{width=>5}. + +[@KeyboardInstructions(q!(Use [|m|]* for meters and [|m^2|]* for square meters.)!)@]** + +END_PGML + + +ANS($circumferenceWithPiMO->cmp( + correct_ans_latex_string=>$circumferenceWithPiMO->TeX + )-> + withPostFilter(AnswerHints( + sub { + my ($correct,$student,$ans) = @_; + return (Formula($student)->isConstant); + } => "Your answer should be in terms of pi", +)) +); + +ANS($circumferenceMO->cmp(tolType=>absolute,tolerance=>0.005)); + +ANS($areaWithPiMO->cmp( + correct_ans_latex_string=>$areaWithPiMO->TeX)-> + withPostFilter(AnswerHints( + sub { + my ($correct,$student,$ans) = @_; + return (Formula($student)->isConstant); + } => "Your answer should be in terms of pi", +)) +); + +ANS($areaMO->cmp(tolType=>absolute,tolerance=>0.005)); + + +############################################## + +BEGIN_PGML_SOLUTION + +We use [`r`] to represent radius, and [`d`] to represent diameter. + +In this problem, it's given that the diameter is [`[$diameterMO]`]. A circle's radius is half as long as its diameter, so the radius is [`[$radiusMO]`]. + +A circle's circumference formula is [` C= \pi d `] or [` C= 2 \pi r `] and a circle's area formula is [` A = \pi r^{2} `]. + +Throughout these computations, all quantities have units attached, and we only show them in the final step. + +When you enter [`\pi`]'s value in a calculator, don't round it to [`3.14`]. Use the [`\pi`] button on your calculator instead. This way, your result is more accurate. + +a) For this problem the diameter is given, so we use the first formula for circumference: + + [```\begin{aligned} + C & = \pi d\\\ + & = \pi \cdot [$diameter]\\ + & = [$circumferenceWithPiMO] + \end{aligned}```] + + Don't forget the length unit [`\textrm{m}`]. + +b) [```\begin{aligned}[t] + C& = [$diameter] \pi\\ + & \approx [$diameter] \cdot 3.1415926\ldots\\ + & \approx [$circumferenceMO] + \end{aligned}```] + + Don't forget the length unit [`\textrm{m}`]. + + + +c) [```\begin{aligned}[t] + A&= \pi r^{2}\\ + &= \pi \cdot [$radiusSquared]\\ + &= [$areaWithPiMO] + \end{aligned}```] + + Don't forget the area unit [`\textrm{m}^2`]. + +d) [```\begin{aligned}[t] + A&= [$radiusSquared] \pi\\ + & \approx [$radiusSquared] \cdot 3.1415926\ldots\\ + & \approx [$areaMO] + \end{aligned}```] + + Don't forget the area unit [`\textrm{m}^2`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea30.pg index 663c9fb5db..db329ea22f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4','7.G.4') -## DBsubject(Geometry) -## DBchapter(Circle geometry) -## DBsection(Circumference and area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('circumference','circle') +## DBCCSS('7.EE.4','7.G.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "parserNumberWithUnits.pl", "parserFormulaWithUnits.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,7 +65,6 @@ a) This circle's diameter is [_____________]{$diameterU}. b) This circle's radius is [_____________]{$radiusU}. -(Use *mm* for millimeters.) END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea40.pg new file mode 100644 index 0000000000..b5becebd0e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea40.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given circumference, find the radius and diameter of a circle. +# Circumference in given as a whole number; answers are decimals. +# +# Last edited by Jordan 8/29/13; Carl Yao on 7/17/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('circumference','circle') +## DBCCSS('7.EE.4','7.G.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "parserFormulaWithUnits.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +# An earlier version of this problem required rounding to hundredths place. +# Bad, because when some students use 3.14 instead of something closer to pi, +# they could be marked incorrect. Using relative tolerance in the usual way +# means it is OK to use 3.14 in place of pi. If students are now not showing +# enough digits and being marked incorrect, that should be handled globally, +# not in the problem code. For exampl, more studnet education about rounding +# explectations, or a tooltip that always reminds students of the roudning +# convention. + +$circum = random(30,50,1); +$diameter = $circum/pi; +$radius = $diameter/2; + +$circumU = NumberWithUnits("$circum cm"); +$radiusU = NumberWithUnits("$radius cm"); +$diameterU = NumberWithUnits("$diameter cm"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A circle's circumference is [`[$circumU]`]. + +a. What is this circle's diameter? + [_]{$diameterU}{15} + +a. What is this circle's radius? + [_]{$radiusU}{15} + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We use [`r`] to represent radius, and [`d`] to represent diameter. + +A circle's circumference formula is [` C= \pi d `] or [` C= 2 \pi r `]. + +When you enter [`\pi`]'s value in a calculator, don't round it to [`3.14`]. Use the [`\pi`] button on your calculator instead. This way, your result is more accurate. + +a. To find the diameter, we substitute the given numbers into the first formula for circumference: + + [``` +\begin{aligned} + C & = \pi d \\ + [$circum] & = \pi d \\ + \frac{[$circum]}{\pi} &= \frac{\pi d}{\pi} \\ + \frac{[$circum]}{3.1415926 \ldots} &= d \\ + [$diameter] & \approx d +\end{aligned} + ```] + + This circle's diameter is approximately [`[$diameterU]`]. Don't forget the length unit [`\textrm{cm}`]. + +a. Once we find the diameter, the radius is simply half of it: [`[$radiusU]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea50.pg index 44a6bea0ad..593013ebba 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea50.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4','7.G.4') -## DBsubject(Geometry) -## DBchapter(Circle geometry) -## DBsection(Circumference and area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','circle') +## DBCCSS('7.EE.4','7.G.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,8 @@ loadMacros( "parserNumberWithUnits.pl", "parserFormulaWithUnits.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -56,13 +60,12 @@ TEXT(beginproblem()); BEGIN_PGML -A circle's area is [`[$areaU]`]. +A circle's area is [`[$areaU]`]. [@KeyboardInstructions('(Use [|in^2|]* for square inches.)')@]** a) This circle's radius is [_____________]{$radiusU}. b) This circle's diameter is [_____________]{$diameterU}. -(Use *in^2* for square inches.) END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea60.pg index e8ac5badad..b40d762412 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CircleCircumferenceArea60.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4','7.G.4') -## DBsubject(Geometry) -## DBchapter(Circle geometry) -## DBsection(Circumference and area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','circle') +## DBCCSS('7.EE.4','7.G.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,13 +32,17 @@ loadMacros( "parserNumberWithUnits.pl", "parserFormulaWithUnits.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## Context("Numeric"); -Context()->flags->set("tolerance"=>0.005); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); $area = random(30,50,1); $radius = sqrt($area/pi); @@ -44,7 +51,7 @@ $diameter = 2*$radius; $radius = sprintf("%0.2f",$radius); $diameter = sprintf("%0.2f",$diameter); -$areaU = NumberWithUnits("$area mm"); +$areaU = NumberWithUnits("$area mm^2"); $radiusU = NumberWithUnits("$radius mm"); $diameterU = NumberWithUnits("$diameter mm"); @@ -56,11 +63,10 @@ BEGIN_PGML A circle's area is [`[$areaU]`]. Find the following values. Round your answer to 2 decimal places. -a) This circle's radius is [_____________]{$radiusU->cmp(tolType=>absolute, tolerance=>0.005)}. +a) This circle's radius is [_____________]{$radiusU}. -b) This circle's diameter is [_____________]{$diameterU->cmp(tolType=>absolute, tolerance=>0.005)}. +b) This circle's diameter is [_____________]{$diameterU}. -(Use *mm* for millimeters.) END_PGML @@ -72,9 +78,11 @@ We use [`r`] to represent radius, and [`d`] to represent diameter. A circle's area formula is [` A= \pi r^{2} `]. -a) To find the radius, we substitute the given numbers into the area formula: +When you enter [`\pi`]'s value in a calculator, don't round it to [`3.14`]. Use the [`\pi`] button on your calculator instead. This way, your result is more accurate. + +a) To find the radius, we substitute the given numbers into the area formula: - [`` + [``` \begin{aligned} A & = \pi r^{2} \\ [$area] & = \pi r^{2} \\ @@ -83,7 +91,7 @@ a) To find the radius, we substitute the given numbers into the area formula: \sqrt{\frac{[$area]}{\pi}} & = r \\ [$radius] & \approx r \end{aligned} - ``] + ```] This circle's radius is [`[$radiusU]`]. Don't forget the length unit [`\textrm{in}`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume10.pg index 3f9ef70222..5d6a86c2a5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.G.9') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Volume) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('volume','cylinder') +## DBCCSS('8.G.9') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,16 +34,20 @@ loadMacros( "answerHints.pl", "PGgraphmacros.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); Context()->flags->set(reduceConstants=>0); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); -do {$height = random(2,10,1); -$radius = random(2,10,1);} until (abs($height-2*$radius)<4); +$height = random(2,9,1); +$radius = random(2,9,1); $width2d = 2*$radius; $height2d = 1.25*$height; @@ -64,16 +71,16 @@ Context()->variables->set(pi => {TeX=>'\pi'}); $ansVolumePIU = FormulaWithUnits("$piConstant pi m^3"); $ansVolumeDEU = NumberWithUnits("$volumeDE m^3"); -$xmin=$width2d*0.1; -$xmax=$width2d*1.3; +$xmin=0; +$xmax=$width2d*240/220; $ymin=0; -$ymax=$xmax*$height2d/$width2d; +$ymax=(20+220*$height2d/$width2d)/240*$xmax; $gr = init_graph($xmin,$ymin,$xmax,$ymax, -size=>[240,240*$height2d/$width2d] +size=>[240,240*$ymax/$xmax] ); -@x=(($xmax-$width2d)/2, ($xmax+$width2d)/2); +@x=(5/240*$xmax, 5/240*$xmax+$width2d); @y=(($ymax-$height2d)/2 + $height/8, ($ymax+$height2d)/2 - $height/8); $gr->moveTo($x[0],$y[0]); @@ -94,11 +101,11 @@ $Bot2 = new Fun( $xfunc, $yfuncBot, $gr ); $Bot2->domain(3.14159/5, 4*3.14159/5); $Bot2->weight(1); $gr->lb( new Label($x[1],($y[0]+$y[1])/2,$heightU, - 'black','left','middle')); + 'black','center','top','large','vertical')); $gr->moveTo(($x[0]+$x[1])/2,$y[1]); $gr->lineTo($x[1],$y[1],'blue',1); $gr->lb( new Label(($x[0]+3*$x[1])/4,$y[1],$radiusU, - 'black','center','bottom')); + 'black','center','bottom','large')); $gr->new_color("darkblue", 100,100,255); $gr->new_color("lightblue", 214,230,244); $gr->fillRegion([$xmax/2,$ymax/2,"darkblue"]); @@ -112,14 +119,14 @@ $alt = "a cylinder of height $heightU and base radius $radiusU"; BEGIN_PGML -A cylinder's base's radius is [`[$radiusU]`], and its height is [`[$heightU]`]. +Find the volume of this cylinder. ->>[@image( insertGraph($gr), width=>240, +>>[@image( insertGraph($gr), width=>240, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< -a) This cylinder's volume, in terms of [`\pi`], is [_____________]. [@KeyboardInstructions(q!(Type [|pi|]* for [`\pi`].)!)@]** +a) This cylinder's volume, in terms of [`\pi`], is [_]{width=>5}. [@KeyboardInstructions(q!(Type [|pi|]* for [`\pi`].)!)@]** -b) This cylinder's volume, rounded to the hundredth place, is [_____________]. +b) This cylinder's volume, rounded to the hundredths place, is [_]{width=>5}. [@KeyboardInstructions(q!(Use [|m^3|]* for cubic meters.)!)@]** @@ -140,7 +147,7 @@ ANS($ansVolumePIU->cmp( )) ); -ANS($ansVolumeDEU->cmp(tolType=>absolute,tolerance=>0.005)); +ANS($ansVolumeDEU->cmp()); ############################################## @@ -156,6 +163,8 @@ Putting together these two formulas, we have a cylinder's volume formula: Throughout these computations, all quantities have units attached, and we only show them in the final step. +When you enter [`\pi`]'s value in a calculator, don't round it to [`3.14`]. Use the [`\pi`] button on your calculator instead. This way, your result is more accurate. + a) Using the volume formula, we have: [``\begin{aligned} @@ -171,7 +180,7 @@ b) To find the decimal version, we replace [`\pi`] with its decimal value, and [``\begin{aligned}[t] V& = [$s1] \pi \\ - & \approx [$s1] \cdot 3.14\ldots \\ + & \approx [$s1] \cdot 3.1415926\ldots \\ & \approx [$ansVolumeDEU] \end{aligned}``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume20.pg new file mode 100644 index 0000000000..b23ff01116 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume20.pg @@ -0,0 +1,146 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given diameter and height, find the volume of a cylinder. Answers are +# both in terms of pi and decimals. +# +# Last edited by Carl Yao on 7/17/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('volume','cylinder') +## DBCCSS('8.G.9') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "parserFormulaWithUnits.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$height = random(2,10,1); +$heightU = NumberWithUnits("$height ft"); + +$radius = random(2,10,1); +$diameter = $radius*2; +$radiusSquared = $radius**2; + +$radiusU = NumberWithUnits("$radius ft"); +$diameterU = NumberWithUnits("$diameter ft"); + +$pi = Compute("pi"); + +$piConstant = $height*$radiusSquared; +$volumeDEShow = sprintf("%.2f", $pi*$radiusSquared*$height ); +$volumeDE = $pi*$radiusSquared*$height; + +Context()->constants->remove('pi'); +Context()->variables->are(pi=>'Real'); +Context()->variables->set(pi => {TeX=>'\pi'}); + +$ansVolumePIU = FormulaWithUnits("$piConstant pi ft^3"); +$ansVolumeDEU = NumberWithUnits("$volumeDE ft^3"); +$ansVolumeDEUShow = NumberWithUnits("$volumeDEShow ft^3"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A cylinder's base's diameter is [`[$diameterU]`], and its height is [`[$heightU]`]. + +a) This cylinder's volume, in terms of [`\pi`], is [_]{width=>5}. [@KeyboardInstructions(q!(Type [|pi|]* for [`\pi`].)!)@]** + +b) This cylinder's volume, rounded to the hundredths place, is [_]{width=>5}. + +[@KeyboardInstructions(q!(Use [|ft^3|]* for cubic feet.)!)@]** + +END_PGML + +############################################## + +$s1 = $height*$radiusSquared; + +ANS($ansVolumePIU->cmp( + correct_ans_latex_string=>$ansVolumePIU->TeX + )-> + withPostFilter(AnswerHints( + sub { + my ($correct,$student,$ans) = @_; + return (Formula($student)->isConstant); + } => "Your answer should be in terms of pi", +)) +); + +ANS($ansVolumeDEU->cmp()); + +############################################## + +BEGIN_PGML_SOLUTION + +We use [`r`] to represent the base's radius, and [`h`] to represent the cylinder's height. + +A cylinder's volume formula is [` V= (\text{base area}) \cdot \text{height} `]. A cylinder's base is a circle, with its area formula [` A = \pi r^{2} `]. + +Putting together these two formulas, we have a cylinder's volume formula: + + [`` V= \pi r^{2} h ``] + +For this problem, diameter is given as [` [$diameterU] `]. The radius is half as long as diameter, so the radius is [` [$radiusU] `]. + +Throughout these computations, all quantities have units attached, and we only show them in the final step. + +When you enter [`\pi`]'s value in a calculator, don't round it to [`3.14`]. Use the [`\pi`] button on your calculator instead. This way, your result is more accurate. + +a) Using the volume formula, we have: + + [``\begin{aligned} + V & = \pi r^{2} h \\ + & = \pi \cdot [$radius]^{2} \cdot [$height] \\ + & = \pi \cdot [$s1] \\ + & = [$s1] \pi \textrm{ ft}^3 + \end{aligned}``] + + Don't forget the volume unit [`\textrm{ft}^3`]. + +b) To find the decimal version, we replace [`\pi`] with its decimal value, and we have: + + [``\begin{aligned}[t] + V& = [$s1] \pi \\ + & \approx [$s1] \cdot 3.1415926\ldots \\ + & \approx [$ansVolumeDEUShow] + \end{aligned}``] + + Don't forget the volume unit [`\textrm{ft}^3`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume30.pg new file mode 100644 index 0000000000..e690a96757 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume30.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given radius and volume, find the height of a cylinder. +# Volume is given in terms of pi; answer is an integer. +# +# Last edited by Carl Yao on 7/17/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('volume','cylinder') +## DBCCSS('7.EE.4','8.G.9') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "parserFormulaWithUnits.pl", + "answerHints.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$height = random(2,10,1); +$heightU = NumberWithUnits("$height m"); + +$radius = random(2,10,1); +$radiusSquared = $radius**2; + +$radiusU = NumberWithUnits("$radius m"); +$piConstant = $height*$radiusSquared; + +Context()->constants->remove('pi'); +Context()->variables->are(pi=>'Real'); +Context()->variables->set(pi => {TeX=>'\pi'}); + +$volumePI = Formula("$piConstant pi"); +$volumePIU = FormulaWithUnits("$piConstant pi", "m^3"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A cylinder's base's radius is [`[$radiusU]`], and its volume is [`[$volumePIU]`]. + + This cylinder's height is [_____________]{$heightU}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We use [`r`] to represent the base's radius, and [`h`] to represent the cylinder's height. + +A cylinder's volume formula is [` V= (\text{base area}) \cdot \text{height} `]. A cylinder's base is a circle, with its area formula [` A = \pi r^{2} `]. + +Putting together these two formulas, we have a cylinder's volume formula: + + [`` V= \pi r^{2} h ``] + +Using the volume formula, we have: + + [``\begin{aligned} + V & = \pi r^{2} h \\ + [$volumePI] & = \pi \cdot [$radius]^{2} \cdot h \\ + [$volumePI] & = \pi \cdot [$radiusSquared] \cdot h \\ + \frac{[$volumePI]}{[$radiusSquared] \pi} & = \frac{\pi \cdot [$radiusSquared] \cdot h}{[$radiusSquared] \pi} \\ + [$height] &= h + \end{aligned}``] + +The cylinder's height is [`[$heightU]`]. Don't forget the length unit [`\textrm{m}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume40.pg index b8218317d6..0d18e2ebaf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/CylinderVolume40.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4','8.G.9') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Volume) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('volume','cylinder') +## DBCCSS('7.EE.4','8.G.9') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,12 +32,16 @@ loadMacros( "parserNumberWithUnits.pl", "parserFormulaWithUnits.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); $volume = random(30,50,1); $volumeU = FormulaWithUnits("$volume", "in^3"); @@ -54,9 +61,9 @@ BEGIN_PGML A cylinder's height is [`[$heightU]`], and its volume is [`[$volumeU]`]. - This cylinder's radius is [_____________]{$radiusU->cmp(tolType=>absolute,tolerance=>0.005)}. + This cylinder's radius is [_____________]{$radiusU}. -Round your answer to the hundredths place. Use *in* for inches. +Round your answer to the hundredths place. Use [|in|]* for inches. END_PGML @@ -85,6 +92,8 @@ Using the volume formula, we have: The cylinder base's radius is [`[$radiusU]`]. Don't forget the length unit [`\textrm{in}`]. +When you enter [`\pi`]'s value in a calculator, don't round it to [`3.14`]. Use the [`\pi`] button on your calculator instead. This way, your result is more accurate. + END_PGML_SOLUTION ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea10.pg index dc31384681..2003b2ef7c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,23 +40,23 @@ Context("Numeric"); $unit = "ft"; -$base = random(15,25,1); do { + $base = random(15,25,1); $heightRectangle = random(8,14,1); do {$heightTriangle = random(8,14,1);} until ($heightTriangle!=$heightRectangle); -} until ($heightRectangle+$heightTriangle<25); +} until ($heightRectangle+$heightTriangle<$base); +$height = $heightRectangle + $heightTriangle; $xcross = $base/2; -$leftSide = round(sqrt($height**2+$xcross**2)); +$leftSide = round(sqrt($heightTriangle**2+$xcross**2)); $rightSide = $leftSide; $xmin = 0; #The viewing window -$max = max($heightRectangle+$heightTriangle,$base); -$xmax = $max*1.2; +$xmax = $base*240/210; $ymin = 0; -$ymax = $xmax; +$ymax = (210*$height/$base+30)*$height/(210*$height/$base); $labelShift = $xmax/40; -$cornersize = 0.8; +$cornersize = $xmax*10/240; $perimeter = $base + $leftSide + $rightSide+2*$heightRectangle; $area = $base*$heightTriangle/2+$base*$heightRectangle; @@ -77,13 +81,13 @@ $areaU = NumberWithUnits("$area $unit^2"); ); $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[240,240]); + pixels=>[240,240*$ymax/$xmax]); -$picture->lb( new Label($x[1], $y[0]-$labelShift,"$baseU",'black','center','middle')); -$picture->lb( new Label($x[1]+$labelShift,($y[1]+$y[2])/2,"$heightTriangleU",'black','center','middle')); -$picture->lb( new Label($x[2]-$labelShift,($y[0]+$y[1])/2,"$heightRectangleU",'black','right','middle')); -$picture->lb( new Label(($x[0]+$x[1])/2-$labelShift, ($y[1]+$y[2])/2,"$leftSideU",'black','right','middle')); -$picture->lb( new Label(($x[1]+$x[2])/2+$labelShift,($y[1]+$y[2])/2,"$rightSideU",'black','left','middle')); +$picture->lb( new Label($x[1], $y[0],"$baseU",'black','center','top','large')); +$picture->lb( new Label($x[1],($y[1]+$y[2])/2,"$heightTriangleU",'black','center','bottom','large','vertical')); +$picture->lb( new Label($x[2],($y[0]+$y[1])/2,"$heightRectangleU",'black','center','bottom','large','vertical')); +$picture->lb( new Label(($x[0]+$x[1])/2, ($y[1]+$y[2])/2,"$leftSideU",'black','right','bottom','large')); +$picture->lb( new Label(($x[1]+$x[2])/2,($y[1]+$y[2])/2,"$rightSideU",'black','left','bottom','large')); $picture->new_color("darkblue", 100,100,255); @@ -95,27 +99,27 @@ $picture->lineTo($x[2],$y[0], darkblue,3); $picture->lineTo($x[0],$y[0], darkblue,3); $picture->moveTo($x[1],$y[2]); -$picture->lineTo($x[1],$y[1], darkblue,1,"dashed"); +$picture->lineTo($x[1],$y[1], red,1,"dashed"); $picture->moveTo($x[0],$y[1]); -$picture->lineTo($x[2],$y[1], darkblue,1,"dashed"); +$picture->lineTo($x[2],$y[1], red,1,"dashed"); $picture->moveTo($x[0],$y[0]+$cornersize); -$picture->lineTo($x[0]+$cornersize,$y[0]+$cornersize, darkblue,3); -$picture->lineTo($x[0]+$cornersize,$y[0], darkblue,3); +$picture->lineTo($x[0]+$cornersize,$y[0]+$cornersize, darkblue,1); +$picture->lineTo($x[0]+$cornersize,$y[0], darkblue,1); $picture->moveTo($x[2],$y[0]+$cornersize); -$picture->lineTo($x[2]-$cornersize,$y[0]+$cornersize, darkblue,3); -$picture->lineTo($x[2]-$cornersize,$y[0], darkblue,3); +$picture->lineTo($x[2]-$cornersize,$y[0]+$cornersize, darkblue,1); +$picture->lineTo($x[2]-$cornersize,$y[0], darkblue,1); $picture->moveTo($x[1],$y[1]+$cornersize); -$picture->lineTo($x[1]-$cornersize,$y[1]+$cornersize, darkblue,3); -$picture->lineTo($x[1]-$cornersize,$y[1], darkblue,3); +$picture->lineTo($x[1]-$cornersize,$y[1]+$cornersize, red,1,'dashed'); +$picture->lineTo($x[1]-$cornersize,$y[1], red,1,'dashed'); $alt = "The graph shows a polygon with a rectangle at the bottom and a triangle on top of it. The base of the triangle overlaps the top base of the rectangle. For the rectangle, its base is $baseU, and its height is $heightRectangleU. For the triangle, its height is $heightTriangleU, both its left side and right side are $leftSideU."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML @@ -124,7 +128,7 @@ Find the perimeter and area of this polygon. >>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$alt' title = '$alt' ") @]*<< - Its perimeter is [_____________]{$perimeterU} and its area is [_____________]{$areaU}. + Its perimeter is [_]{$perimeterU}{5} and its area is [_]{$areaU}{5}. [@KeyboardInstructions(q!(Use [|ft|]* for feet and [|ft^2|]* for square feet.)!)@]** @@ -168,7 +172,7 @@ Next, we find the rectangle's area: Finally, we add up the area of the triangle and rectangle: [``\begin{aligned}[t] - \text{polygon area} &= \text{rectangle area} \cdot \text{triangle area}\\ + \text{polygon area} &= \text{rectangle area} + \text{triangle area}\\ & = [$base*$heightTriangle*0.5] + [$base*$heightRectangle] \\ & =[$area] \end{aligned}``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea20.pg index 775f41a944..1f3a6c19db 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/PolygonPerimeterArea20.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -40,18 +44,20 @@ Context()->flags->set( $unit = "cm"; -$base = random(14,25,1); -$radius = $base/2; -do {$height = random(5,13,1);} until ($radius!=$height); +do { + $base = random(14,25,1); + $radius = $base/2; + $height = random(5,13,1); + $fullheight = $radius+$height; +} until ($fullheight<$base); $xmin = 0; #The viewing window -$max = max($height+$radius,$base); -$xmax = $max*1.2; +$xmax = $base*240/210; $ymin = 0; -$ymax = $xmax; +$ymax = (210*$fullheight/$base+30)*$fullheight/(210*$fullheight/$base); $labelShift = $xmax/40; -$cornersize = 0.8; +$cornersize = $xmax*10/240; $perimeter = $base + 2*$height + pi*$base/2; $area = $base*$height + $radius**2*pi/2; @@ -76,10 +82,10 @@ $areaU = NumberWithUnits("$area $unit^2"); @picture = (); for my $i (0..1) { $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[240,240]); + pixels=>[240,240*$ymax/$xmax]); - $picture[$i]->lb( new Label($x[1],$y[0]-$labelShift,"$baseU",'black','center','middle')); - $picture[$i]->lb( new Label($x[2]-$labelShift,($y[0]+$y[1])/2,"$heightU",'black','right','middle')); + $picture[$i]->lb( new Label($x[1],$y[0],"$baseU",'black','center','top','large')); + $picture[$i]->lb( new Label($x[2],($y[0]+$y[1])/2,"$heightU",'black','center','bottom','large','vertical')); $picture[$i]->new_color("darkblue", 100,100,255); @@ -89,12 +95,12 @@ for my $i (0..1) { $picture[$i]->lineTo($x[2],$y[1], darkblue,3); $picture[$i]->moveTo($x[0],$y[0]+$cornersize); - $picture[$i]->lineTo($x[0]+$cornersize,$y[0]+$cornersize, darkblue,3); - $picture[$i]->lineTo($x[0]+$cornersize,$y[0], darkblue,3); + $picture[$i]->lineTo($x[0]+$cornersize,$y[0]+$cornersize, darkblue,1); + $picture[$i]->lineTo($x[0]+$cornersize,$y[0], darkblue,1); $picture[$i]->moveTo($x[2],$y[0]+$cornersize); - $picture[$i]->lineTo($x[2]-$cornersize,$y[0]+$cornersize, darkblue,3); - $picture[$i]->lineTo($x[2]-$cornersize,$y[0], darkblue,3); + $picture[$i]->lineTo($x[2]-$cornersize,$y[0]+$cornersize, darkblue,); + $picture[$i]->lineTo($x[2]-$cornersize,$y[0], darkblue,1); $picture[$i]->moveTo($x[0],$y[1]); $picture[$i]->lineTo($x[1],$y[1], darkblue,1,"dashed"); @@ -114,7 +120,7 @@ $picture[1]->stamps( closed_circle($x[1],$y[1],'red') ); $picture[1]->stamps( closed_circle($x[2],$y[1],'red') ); $picture[1]->moveTo($x[1],$y[1]); $picture[1]->lineTo($x[2],$y[1], red,1,"dashed"); -$picture[1]->lb( new Label(($x[1]+$x[2])/2,$y[1]+$labelShift,"$base/2 = $radiusU",'red','center','middle')); +$picture[1]->lb( new Label(($x[1]+$x[2])/2,$y[1]+$labelShift,"$base/2 = $radiusU",'red','center','middle','large')); @alt = (); $alt[0] = "The graph shows a shape with a rectangle at the bottom and a semicircle on top of it. The diameter of the semicircle overlaps the top base of the rectangle. For the rectangle, its base is $baseU, and its height is $heightU."; @@ -122,7 +128,7 @@ $alt[0] = "The graph shows a shape with a rectangle at the bottom and a semicirc $alt[1] = $alt[0]." The radius of the semicircle is marked as $base/2=$radiusU."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML @@ -131,9 +137,10 @@ Find the perimeter and area of this shape, which is a semicircle on top of a rec >>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' ") @]*<< - Its perimeter is [_____________]{$perimeterU} and its area is [_____________]{$areaU}. +[@KeyboardInstructions(q!(Use [|cm|]* for centimeters and [|cm^2|]* for square centimeters. Use a decimal approximation in your answer.)!)@]** + + Its perimeter is [_]{$perimeterU}{5} and its area is [_]{$areaU}{5}. -[@KeyboardInstructions(q!(Use [|cm|]* for centimeters and [|cm^2|]* for square centimeters.)!)@]** END_PGML @@ -141,6 +148,8 @@ END_PGML BEGIN_PGML_SOLUTION +When you enter [`\pi`]'s value in a calculator, don't round it to [`3.14`]. Use the [`\pi`] button on your calculator instead. This way, your result is more accurate. + >>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' ") @]*<< The perimeter of this shape has a semicircle, and three sides of a rectangle. @@ -155,7 +164,7 @@ For this shape, the semicircle's diameter is simply the rectangle's base. Note t [``\begin{aligned}[t] \text{semicircle's circumferemce} &= \frac{1}{2}\pi d \\ - &\approx \frac{1}{2}(3.1415926...)([$base]) \\ + &= \frac{1}{2}(3.1415926\ldots)([$base]) \\ &\approx [$base*3.1415926*0.5] \end{aligned}``] @@ -178,7 +187,7 @@ where [`r`] is the circle's radius. Note that a semicircle's area is half of a c [``\begin{aligned}[t] \text{semicircle area} &= \frac{1}{2} \pi r^2\\ - &\approx \frac{1}{2} (3.1415926...) ([$radius])^2 \\ + &= \frac{1}{2} (3.1415926\ldots) ([$radius])^2 \\ &\approx [$radius*$radius*3.1415926*0.5] \end{aligned}``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea10.pg index 951df69bf3..b70e9f5403 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea10.pg @@ -7,53 +7,55 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','rectangle') -## MLTleader(1) -## MLT(area_of_rectangle) +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## Context("Numeric"); -$xmin = 0; #The viewing window -$xmax = 20; -$ymin = 0; -$ymax = 20; - $base = random(13,18,1); $height = random(8,12,1); +$xmin = 0; #The viewing window +$xmax = $base+2; +$ymin = 0; +$ymax = $xmax*$height/$base; + @x = (($xmax-$base)/2,($xmax+$base)/2); @y = (($ymax-$height)/2,($ymax+$height)/2); -$cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/10; +$cornersize = $xmax*10/240; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[240,240*$height/$base]); -$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-0.5,"$base m",'black','center','middle')); -$picture->lb( new Label($x[1]+1,($y[0]+$y[1])/2,"$height m",'black','center','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0],"$base m",'black','center','bottom','large')); +$picture->lb( new Label($x[1],($y[0]+$y[1])/2,"$height m",'black','right','middle','large')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -68,8 +70,8 @@ foreach $i (0,1) { foreach $j (0,1) { $picture->moveTo($x[$i]+(-1)**$i*$cornersize,$y[$j]); -$picture->lineTo($x[$i]+(-1)**$i*$cornersize,$y[$j]+(-1)**$j*$cornersize, darkblue,3); -$picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,3); +$picture->lineTo($x[$i]+(-1)**$i*$cornersize,$y[$j]+(-1)**$j*$cornersize, darkblue,1); +$picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,1); }} @@ -89,20 +91,20 @@ BEGIN_TEXT Find the perimeter and area of the rectangle.$PAR $BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') \} +\{ image(insertGraph( $picture ), width=>240, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') \} $ECENTER $PAR END_TEXT BEGIN_PGML - Its perimeter is [_____________]{$ansP} and its area is [_____________]{$ansA}. + Its perimeter is [_]{$ansP}{5} and its area is [_]{$ansA}{5}. -(Use *m* for meters and *m[$CARET]2* for square meters.) +[@KeyboardInstructions(q!(Use [|m|]* for meters and [|m^2|]* for square meters.)!)@]** END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION We usually use the following formulas for rectangles: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea20.pg index bd0bc36f24..bd53093981 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea20.pg @@ -7,27 +7,31 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Perimeter) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('perimeter','rectangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -52,7 +56,7 @@ A rectangle's perimeter is [`[$perimeterU]`]. Its base is [`[$baseU]`]. Its height is [_____________]{$heightU}. -(Use *cm* for centimeters.) +[@KeyboardInstructions(q!Use [|cm|]* for centimenters.!)@]** END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea30.pg index d239133510..af9990729a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea30.pg @@ -7,27 +7,30 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','rectangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +43,7 @@ $height = random(10,19,1); $heightU = NumberWithUnits("$height mm"); $area = $base*$height; -$areaU = NumberWithUnits("$area mm"); +$areaU = NumberWithUnits("$area mm^2"); ############################################## @@ -52,7 +55,6 @@ A rectangle's area is [`[$areaU]`]. Its height is [`[$heightU]`]. Its base is [_____________]{$baseU}. -(Use *mm* for millimeters.) END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea40.pg index 5ec5b0b8e6..53dd84dfce 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea40.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','rectangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -40,10 +44,9 @@ $baseCut = random(2,$base-2,1); $heightCut = random(2,$height-2,1); $xmin = 0; #The viewing window -$max = $base; -$xmax = $max*1.3; +$xmax = $base*240/210; $ymin = 0; -$ymax = $xmax*$height/$base; +$ymax = (210*$height/$base+30)*$height/(210*$height/$base); $unit = "m"; $baseU = NumberWithUnits("$base $unit"); @@ -82,7 +85,7 @@ $corner = list_random(0,3,1,2); ); $labelAdjust = 0.5; -$cornersize = 0.5; +$cornersize = $xmax*10/240; @pictures = (); @color = ( @@ -94,22 +97,22 @@ $cornersize = 0.5; for my $i (0..2) { $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[240,240*$height/$base]); + pixels=>[240,240*$ymax/$xmax]); if ( ($corner==0) || ($corner==3) ) { - $picture[$i]->lb( new Label(($x[0]+$x[1])/2, $y[1]+$labelAdjust,"$baseU",'black','center','middle')); - $picture[$i]->lb( new Label(($xCut[$corner][1]+$xCut[$corner][2])/2, $yCut[$corner][1]+$labelAdjust,"$baseCutU",'black','center','middle')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2, $y[1],"$baseU",'black','center','bottom','large')); + $picture[$i]->lb( new Label(($xCut[$corner][1]+$xCut[$corner][2])/2, $yCut[$corner][1],"$baseCutU",'black','center','bottom','large')); } else { - $picture[$i]->lb( new Label(($x[0]+$x[1])/2, $y[0]-$labelAdjust,"$baseU",'black','center','middle')); - $picture[$i]->lb( new Label(($xCut[$corner][1]+$xCut[$corner][2])/2, $yCut[$corner][0]-$labelAdjust,"$baseCutU",'black','center','middle')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2, $y[0],"$baseU",'black','center','top','large')); + $picture[$i]->lb( new Label(($xCut[$corner][1]+$xCut[$corner][2])/2, $yCut[$corner][0],"$baseCutU",'black','center','top','large')); } if ( ($corner==0) || ($corner==1) ) { - $picture[$i]->lb( new Label($x[1]+2*$labelAdjust,($y[0]+$y[1])/2,"$heightU",'black','center','middle')); - $picture[$i]->lb( new Label($xCut[$corner][2]-2*$labelAdjust,($yCut[$corner][0]+$yCut[$corner][1])/2,"$heightCutU",'black','center','middle')); + $picture[$i]->lb( new Label($x[1],($y[0]+$y[1])/2,"$heightU",'black','center','top','large','vertical')); + $picture[$i]->lb( new Label($xCut[$corner][2],($yCut[$corner][0]+$yCut[$corner][1])/2,"$heightCutU",'black','center','top','large','vertical')); } else { - $picture[$i]->lb( new Label($x[0]-2*$labelAdjust,($y[0]+$y[1])/2,"$heightU",'black','center','middle')); - $picture[$i]->lb( new Label($xCut[$corner][0]+2*$labelAdjust,($yCut[$corner][0]+$yCut[$corner][1])/2,"$heightCutU",'black','center','middle')); + $picture[$i]->lb( new Label($x[0],($y[0]+$y[1])/2,"$heightU",'black','center','bottom','large','vertical')); + $picture[$i]->lb( new Label($xCut[$corner][0],($yCut[$corner][0]+$yCut[$corner][1])/2,"$heightCutU",'black','center','bottom','large','vertical')); } $picture[$i]->new_color("lightblue", 200,200,255); # RGB @@ -130,23 +133,23 @@ for my $i (0..2) { if ($corner!=0) { $picture[$i]->moveTo($x[0]+$cornersize,$y[0]); - $picture[$i]->lineTo($x[0]+$cornersize,$y[0]+$cornersize, darkblue,3); - $picture[$i]->lineTo($x[0],$y[0]+$cornersize, darkblue,3); + $picture[$i]->lineTo($x[0]+$cornersize,$y[0]+$cornersize, darkblue,1); + $picture[$i]->lineTo($x[0],$y[0]+$cornersize, darkblue,1); } if ($corner!=1) { $picture[$i]->moveTo($x[0]+$cornersize,$y[1]); - $picture[$i]->lineTo($x[0]+$cornersize,$y[1]-$cornersize, darkblue,3); - $picture[$i]->lineTo($x[0],$y[1]-$cornersize, darkblue,3); + $picture[$i]->lineTo($x[0]+$cornersize,$y[1]-$cornersize, darkblue,1); + $picture[$i]->lineTo($x[0],$y[1]-$cornersize, darkblue,1); } if ($corner!=2) { $picture[$i]->moveTo($x[1]-$cornersize,$y[1]); - $picture[$i]->lineTo($x[1]-$cornersize,$y[1]-$cornersize, darkblue,3); - $picture[$i]->lineTo($x[1],$y[1]-$cornersize, darkblue,3); + $picture[$i]->lineTo($x[1]-$cornersize,$y[1]-$cornersize, darkblue,1); + $picture[$i]->lineTo($x[1],$y[1]-$cornersize, darkblue,1); } if ($corner!=3) { $picture[$i]->moveTo($x[1]-$cornersize,$y[0]); - $picture[$i]->lineTo($x[1]-$cornersize,$y[0]+$cornersize, darkblue,3); - $picture[$i]->lineTo($x[1],$y[0]+$cornersize, darkblue,3); + $picture[$i]->lineTo($x[1]-$cornersize,$y[0]+$cornersize, darkblue,1); + $picture[$i]->lineTo($x[1],$y[0]+$cornersize, darkblue,1); } } @@ -156,7 +159,7 @@ for my $i (0..2) { ($yCut[$corner][3]+$y[0])/2, ($yCut[$corner][1]+$y[1])/2 ); -$picture[1]->lb( new Label($xCut[$corner][$corner],$missingHeightLabelY[$corner],"$height-$heightCut = $missingHeightU",'red','center','middle')); +$picture[1]->lb( new Label($xCut[$corner][$corner],$missingHeightLabelY[$corner],"$height-$heightCut = $missingHeightU",'red','center','middle','large')); @missingBaseLabelX = ( ($xCut[$corner][2]+$x[1])/2, @@ -170,7 +173,7 @@ $picture[1]->lb( new Label($xCut[$corner][$corner],$missingHeightLabelY[$corner] $y[1]+$labelAdjust, $y[0]-$labelAdjust ); -$picture[1]->lb( new Label($missingBaseLabelX[$corner],$missingBaseLabelY[$corner],"$base-$baseCut = $missingBaseU",'red','center','middle')); +$picture[1]->lb( new Label($missingBaseLabelX[$corner],$missingBaseLabelY[$corner],"$base-$baseCut = $missingBaseU",'red','center','middle','large')); @missingPosition = ("bottom left", "top left", "top right", "bottom right"); @height1Direction = ("down", "up", "up", "down"); @@ -205,14 +208,14 @@ $picture[2]->lineTo($connectLineX[$corner][2],$connectLineY[$corner][2], red,1,' ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + BEGIN_PGML Find the perimeter and area of this shape. >>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' ") @]*<< - Its perimeter is [_____________]{$perimeterU} and its area is [_____________]{$areaU}. + Its perimeter is [_]{$perimeterU}{5} and its area is [_]{$areaU}{5}. [@KeyboardInstructions(q!(Use [|m|]* for meters and [|m^2|]* for square meters.)!)@]** diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea50.pg index 260fed7bed..2508a64813 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea50.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -43,13 +47,12 @@ $baseCut = random(2,$base-5,1); $baseLeft = ($base-$baseCut)/2; $xmin = 0; #The viewing window -$max = max($height,$base); -$xmax = $max*1.3; +$xmax = $base*240/210; $ymin = 0; -$ymax = $xmax; +$ymax = (210*$height/$base+30)*$height/(210*$height/$base); $labelShift = $xmax/40; -$cornersize = 0.4; +$cornersize = $xmax*10/240; $perimeter = 2*($base + $height+$heightCut); $area = $base*$height-$baseCut*$heightCut; @@ -76,13 +79,13 @@ $areaU = NumberWithUnits("$area $unit^2"); for my $i (0..2) { $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[240,240]); + pixels=>[240,240*$ymax/$xmax]); - $picture[$i]->lb( new Label(($x[1]+$x[2])/2, $y[0]-$labelShift,"$baseU",'black','center','middle')); - $picture[$i]->lb( new Label($x[3]+$labelShift,($y[0]+$y[2])/2,"$heightU",'black','left','middle')); - $picture[$i]->lb( new Label(($x[0]+$x[1])/2,$y[2]+$labelShift,"$baseLeftU",'black','center','middle')); - $picture[$i]->lb( new Label(($x[2]+$x[3])/2,$y[2]+$labelShift,"$baseLeftU",'black','center','middle')); - $picture[$i]->lb( new Label($x[1],($y[1]+$y[2])/2,"$heightCutU",'black','center','middle')); + $picture[$i]->lb( new Label(($x[1]+$x[2])/2, $y[0],"$baseU",'black','center','top','large')); + $picture[$i]->lb( new Label($x[3],($y[0]+$y[2])/2,"$heightU",'black','center','bottom','large','vertical')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2,$y[2],"$baseLeftU",'black','center','bottom','large')); + $picture[$i]->lb( new Label(($x[2]+$x[3])/2,$y[2],"$baseLeftU",'black','center','bottom','large')); + $picture[$i]->lb( new Label($x[1],($y[1]+$y[2])/2,"$heightCutU",'black','center','bottom','large','vertical')); $picture[$i]->new_color("darkblue", 100,100,255); @@ -97,43 +100,43 @@ for my $i (0..2) { $picture[$i]->lineTo($x[0],$y[0], darkblue,3); $picture[$i]->moveTo($x[0],$y[0]+$cornersize); - $picture[$i]->lineTo($x[0]+$cornersize,$y[0]+$cornersize, darkblue,3); - $picture[$i]->lineTo($x[0]+$cornersize,$y[0], darkblue,3); + $picture[$i]->lineTo($x[0]+$cornersize,$y[0]+$cornersize, darkblue,1); + $picture[$i]->lineTo($x[0]+$cornersize,$y[0], darkblue,1); $picture[$i]->moveTo($x[0],$y[2]-$cornersize); - $picture[$i]->lineTo($x[0]+$cornersize,$y[2]-$cornersize, darkblue,3); - $picture[$i]->lineTo($x[0]+$cornersize,$y[2], darkblue,3); + $picture[$i]->lineTo($x[0]+$cornersize,$y[2]-$cornersize, darkblue,1); + $picture[$i]->lineTo($x[0]+$cornersize,$y[2], darkblue,1); $picture[$i]->moveTo($x[3],$y[2]-$cornersize); - $picture[$i]->lineTo($x[3]-$cornersize,$y[2]-$cornersize, darkblue,3); - $picture[$i]->lineTo($x[3]-$cornersize,$y[2], darkblue,3); + $picture[$i]->lineTo($x[3]-$cornersize,$y[2]-$cornersize, darkblue,1); + $picture[$i]->lineTo($x[3]-$cornersize,$y[2], darkblue,1); $picture[$i]->moveTo($x[3],$y[0]+$cornersize); - $picture[$i]->lineTo($x[3]-$cornersize,$y[0]+$cornersize, darkblue,3); - $picture[$i]->lineTo($x[3]-$cornersize,$y[0], darkblue,3); + $picture[$i]->lineTo($x[3]-$cornersize,$y[0]+$cornersize, darkblue,1); + $picture[$i]->lineTo($x[3]-$cornersize,$y[0], darkblue,1); - $picture[$i]->moveTo($x[1]-$cornersize,$y[2]); - $picture[$i]->lineTo($x[1]-$cornersize,$y[2]-$cornersize, darkblue,3); - $picture[$i]->lineTo($x[1],$y[2]-$cornersize, darkblue,3); + #$picture[$i]->moveTo($x[1]-$cornersize,$y[2]); + #$picture[$i]->lineTo($x[1]-$cornersize,$y[2]-$cornersize, darkblue,1); + #$picture[$i]->lineTo($x[1],$y[2]-$cornersize, darkblue,1); $picture[$i]->moveTo($x[2]+$cornersize,$y[2]); - $picture[$i]->lineTo($x[2]+$cornersize,$y[2]-$cornersize, darkblue,3); - $picture[$i]->lineTo($x[2],$y[2]-$cornersize, darkblue,3); + $picture[$i]->lineTo($x[2]+$cornersize,$y[2]-$cornersize, darkblue,1); + $picture[$i]->lineTo($x[2],$y[2]-$cornersize, darkblue,1); $picture[$i]->moveTo($x[1]+$cornersize,$y[1]); - $picture[$i]->lineTo($x[1]+$cornersize,$y[1]+$cornersize, darkblue,3); - $picture[$i]->lineTo($x[1],$y[1]+$cornersize, darkblue,3); + $picture[$i]->lineTo($x[1]+$cornersize,$y[1]+$cornersize, darkblue,1); + $picture[$i]->lineTo($x[1],$y[1]+$cornersize, darkblue,1); $picture[$i]->moveTo($x[2]-$cornersize,$y[1]); - $picture[$i]->lineTo($x[2]-$cornersize,$y[1]+$cornersize, darkblue,3); - $picture[$i]->lineTo($x[2],$y[1]+$cornersize, darkblue,3); + $picture[$i]->lineTo($x[2]-$cornersize,$y[1]+$cornersize, darkblue,1); + $picture[$i]->lineTo($x[2],$y[1]+$cornersize, darkblue,1); } -$picture[1]->lb( new Label(($x[1]+$x[2])/2,$y[1]-$labelShift,"$base-2*$baseLeft=$baseCutU",'red','center','middle')); -$picture[1]->lb( new Label($x[0]-2.5*$labelShift,($y[0]+$y[2])/2,"$heightU",'red','left','middle')); -$picture[1]->lb( new Label($x[2],($y[1]+$y[2])/2,"$heightCutU",'red','center','middle')); +$picture[1]->lb( new Label(($x[1]+$x[2])/2,$y[1]-$labelShift,"$base-2*$baseLeft=$baseCutU",'red','center','middle','large')); +$picture[1]->lb( new Label($x[0]-2.5*$labelShift,($y[0]+$y[2])/2,"$heightU",'red','left','middle','large')); +$picture[1]->lb( new Label($x[2],($y[1]+$y[2])/2,"$heightCutU",'red','center','middle','large')); -$picture[2]->lb( new Label(($x[1]+$x[2])/2,$y[1]-$labelShift,"$base-2*$baseLeft=$baseCutU",'red','center','middle')); +$picture[2]->lb( new Label(($x[1]+$x[2])/2,$y[1]-$labelShift,"$base-2*$baseLeft=$baseCutU",'red','center','middle','large')); $picture[2]->moveTo($x[1],$y[2]); $picture[2]->lineTo($x[2],$y[2], red,1,"dashed"); @@ -145,7 +148,7 @@ $alt[1] = "The graph shows a rectangle with one rectangular piece missing. Start $alt[2] = "The graph shows a rectangle with one rectangular piece missing. Starting at the bottom left corner, a vertical segment travels up for a distance, turns right and travels for $baseLeftU, goes down for $heightCutU, turns right for a distance marked as $base-2*$baseLeft=$baseCutU, goes up for a distance, turns right and travels for $baseLeftU, goes down for $heightU, and finally turns left for $baseU. A dashed line connects the top of the missing rectangle, making it clear this polygon is a bigger rectangle with a smaller rectangle taken out."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML @@ -154,7 +157,7 @@ Find the perimeter and area of this polygon. >>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' ") @]*<< - Its perimeter is [_____________]{$perimeterU} and its area is [_____________]{$areaU}. + Its perimeter is [_]{$perimeterU}{5} and its area is [_]{$areaU}{5}. [@KeyboardInstructions(q!(Use [|m|]* for meters and [|m^2|]* for square meters.)!)@]** diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation10.pg new file mode 100644 index 0000000000..d1da197427 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation10.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rectangle's perimeter and width, find length. +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/29/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('perimeter','rectangle','equation') +## DBCCSS('4.MD.3','A-CED.1','A-REI.3','7.EE.4a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$length = random(13,18,1); +$lengthU = NumberWithUnits("$length m"); +$width = random(8,12,1); +$widthU = NumberWithUnits("$width m"); +$perimeter = 2*($length+$width); +$perimeterU = NumberWithUnits("$perimeter m"); + + +$xmin = 0; #The viewing window +$xmax = $length*240/210; +$ymin = 0; +$ymax = (30+$width*210/$length)*$xmax/240; + +@x = (15/240*$xmax,15/240*$xmax+$length); +@y = (15*$xmax/240,15*$xmax/240+$width); + +$cornersize = 10/240*$xmax; + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + size=>[240,240*$width/$length]); + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0],"x m",'black','center','top','large')); +$picture->lb( new Label($x[1],($y[0]+$y[1])/2,"$width m",'black','center','top','large','vertical')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[1],"x m",'black','center','bottom','large')); +$picture->lb( new Label($x[0],($y[0]+$y[1])/2,"$width m",'black','center','bottom','large','vertical')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[0], darkblue,3); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +foreach $i (0,1) { + foreach $j (0,1) { + +$picture->moveTo($x[$i]+(-1)**$i*$cornersize,$y[$j]); +$picture->lineTo($x[$i]+(-1)**$i*$cornersize,$y[$j]+(-1)**$j*$cornersize, darkblue,3); +$picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,3); +}} + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A rectangle's perimeter is [`[$perimeterU]`]. Its width is [`[$widthU]`]. Use an equation to solve for the rectangle's length. + + Its length is [_____________]{$lengthU}. + + +END_PGML + +############################################## + +$s1 = 2*$width; +$s2 = $perimeter - $s1; + +BEGIN_PGML_SOLUTION + +When we deal with a geometric figure, it's always a good idea to sketch it to help us think. Let the length be [`x`] meters. + +>>[@ image(insertGraph( $picture ), tex_size=>400, width=>240) @]*<< + +The perimeter is given as [`[$perimeterU]`]. Adding up the rectangle's 4 sides gives the perimeter. The equation is: [``` +\begin{aligned}[t] + x+x+[$width]+[$width] &= [$perimeter] \\ + 2x+[$s1] &= [$perimeter] \\ + 2x+[$s1] \mathbf{{}-[$s1]} &= [$perimeter] \mathbf{{}-[$s1]} \\ + 2x &= [$s2] \\ + \frac{2x}{2} &= \frac{[$s2]}{2} \\ + x &= [$length] +\end{aligned} + ```] + +So the rectangle's length is [`[$lengthU]`]. Don't forget the unit [`\textrm{m}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation20.pg new file mode 100644 index 0000000000..a92f58168b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation20.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rectangle's perimeter and the relationship between length and width, +# find length and width. +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/29/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('perimeter','rectangle','equation') +## DBCCSS('4.MD.3','A-CED.1','A-REI.3','7.EE.4a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$width = random(20,30,1); +$widthU = NumberWithUnits("$width cm"); +$factor = random(2,4,1); +$length = $factor*$width; +$lengthU = NumberWithUnits("$length cm"); +$perimeter = 2*($length+$width); +$perimeterU = NumberWithUnits("$perimeter cm"); + +$xmin = 0; #The viewing window +$xmax = $length+10; +$ymin = 0; +$ymax = $xmax; + +@x = (($xmax-$length)/2,($xmax+$length)/2); +@y = (($ymax-$width)/2,($ymax+$width)/2); + +$cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/10; + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-2,"$factor w",'black','center','middle')); +$picture->lb( new Label($x[1]+2,($y[0]+$y[1])/2,"w",'black','center','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[1]+2,"$factor w",'black','center','middle')); +$picture->lb( new Label($x[0]-2,($y[0]+$y[1])/2,"w",'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[0], darkblue,3); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +foreach $i (0,1) { + foreach $j (0,1) { + +$picture->moveTo($x[$i]+(-1)**$i*$cornersize,$y[$j]); +$picture->lineTo($x[$i]+(-1)**$i*$cornersize,$y[$j]+(-1)**$j*$cornersize, darkblue,3); +$picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,3); +}} + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A rectangle's perimeter is [`[$perimeterU]`]. Its length is [`[$factor]`] times as long as its width. Use an equation to find the rectangle's length and width. + + It's width is [_____________]{$widthU}. + Its length is [_____________]{$lengthU}. + + +END_PGML + +############################################## + +$s1 = 2*$factor+2; + +$alt = "A rectangle that is w long in one dimension, and $factor w long in the other dimension."; + +BEGIN_PGML_SOLUTION + +When we deal with a geometric figure, it's always a good idea to sketch it to help us think. + +Let the width be [`w`] centimeters, then the length would be [`[$factor]w`] centimeters. + +Note that it's not wise to let the length be [`l`] centimeters, because the width would be [`\frac{l}{[$factor]}`] centimeters. We would like to avoid fractions if possible. + +>>[@ image(insertGraph( $picture ), tex_size=>400, width=>400, height=>400, extra_html_tags => "alt = '$alt' title = '$alt'") @]*<< + +The perimeter is given as [`[$perimeterU]`]. Adding up the rectangle's 4 sides gives the perimeter. The equation is: + + [`` +\begin{aligned}[t] + w+w+[$factor]w+[$factor]w &= [$perimeter] \\ + [$s1]w &= [$perimeter] \\ + \frac{[$s1]w}{[$s1]} &= \frac{[$perimeter]}{[$s1]} \\ + x &= [$width] +\end{aligned} + ``] + +So the rectangle's width is [`[$widthU]`]. Its length is [`[$factor] \cdot [$widthU]`], which is [`[$lengthU]`]. + +Don't forget the unit [`\textrm{cm}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation30.pg new file mode 100644 index 0000000000..4dc0dec04c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation30.pg @@ -0,0 +1,136 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rectangle's perimeter and the relationship between length and width, +# find length and width. +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/29/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('perimeter','rectangle','equation') +## DBCCSS('4.MD.3','A-CED.1','A-REI.3','7.EE.4a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$width = random(15,25,1); +$widthU = NumberWithUnits("$width in"); +$extra = random(5,10,1); +$extraU = NumberWithUnits("$extra in"); +$length = $width+$extra; +$lengthU = NumberWithUnits("$length in"); +$perimeter = 2*($length+$width); +$perimeterU = NumberWithUnits("$perimeter in"); + +$xmin = 0; #The viewing window +$xmax = $length+10; +$ymin = 0; +$ymax = $xmax; + +@x = (($xmax-$length)/2,($xmax+$length)/2); +@y = (($ymax-$width)/2,($ymax+$width)/2); + +$cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/10; + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-2,"$factor w + $extra",'black','center','middle')); +$picture->lb( new Label($x[1]+2,($y[0]+$y[1])/2,"w",'black','center','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[1]+2,"$factor w + $extra",'black','center','middle')); +$picture->lb( new Label($x[0]-2,($y[0]+$y[1])/2,"w",'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[0], darkblue,3); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +foreach $i (0,1) { + foreach $j (0,1) { + +$picture->moveTo($x[$i]+(-1)**$i*$cornersize,$y[$j]); +$picture->lineTo($x[$i]+(-1)**$i*$cornersize,$y[$j]+(-1)**$j*$cornersize, darkblue,3); +$picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,3); +}} + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A rectangle's perimeter is [`[$perimeterU]`]. Its length is [`[$extraU]`] longer than its width. Use an equation to find the rectangle's length and width. + + Its width is [_____________]{$widthU}. + Its length is [_____________]{$lengthU}. + + +END_PGML + +############################################## + +$s1 = 4; +$s2 = 2*$extra; +$s3 = $perimeter - $s2; + +$alt = "A rectangle that is w long in one dimension, and w + $extra long in the other dimension."; + +BEGIN_PGML_SOLUTION + +When we deal with a geometric figure, it's always a good idea to sketch it to help us think. + +Let the width be [`w`] inches, then the length would be [`w+[$extra]`] inches. + +We could let the length be [`l`] inches, then the width would be [`l-[$extra]`] inches. We would get the same final results; check for yourself once this explanation is finished. + +>>[@ image(insertGraph( $picture ), tex_size=>400, width=>400, height=>400, extra_html_tags => "alt = '$alt' title = '$alt'") @]*<< + +The perimeter is given as [`[$perimeterU]`]. Adding up the rectangle's 4 sides gives the perimeter. The equation is: + + [`` +\begin{aligned}[t] + w+w+w+[$extra]+w+[$extra] &= [$perimeter] \\ + [$s1]w +[$s2] &= [$perimeter] \\ + [$s1]w +[$s2] \mathbf{{}-[$s2]} &= [$perimeter] \mathbf{{}-[$s2]} \\ + [$s1]w &= [$s3] \\ + \frac{[$s1]w}{[$s1]} &= \frac{[$s3]}{[$s1]} \\ + x &= [$width] +\end{aligned} + ``] + +So the rectangle's width is [`[$widthU]`]. Its length is [`[$widthU] + [$extraU]`], which is [`[$lengthU]`]. + +Don't forget the unit [`\textrm{in}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation40.pg index abd83c0656..167d098fe5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation40.pg @@ -8,28 +8,31 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','A-CED.1','A-REI.3','7.EE.4a') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Perimeter) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('perimeter','rectangle','equation') +## DBCCSS('4.MD.3','A-CED.1','A-REI.3','7.EE.4a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -87,7 +90,7 @@ TEXT(beginproblem()); BEGIN_PGML -A rectangle's perimeter is [`[$perimeterU]`]. Its length is [`[$extraU]`] shorter than [@numberWord($factor)@] times of its width. Use an equation to find the rectangle's length and width. +A rectangle's perimeter is [`[$perimeterU]`]. Its length is [`[$extraU]`] shorter than [@numberWord($factor)@] times its width. Use an equation to find the rectangle's length and width. Its width is [_____________]{$widthU}. Its length is [_____________]{$lengthU}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation50.pg new file mode 100644 index 0000000000..4424d5febd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectanglePerimeterEquation50.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rectangle's perimeter and the relationship between length and width, +# find length and width. +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/29/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('perimeter','rectangle','equation') +## DBCCSS('4.MD.3','A-CED.1','A-REI.3','7.EE.4a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$width = random(20,30,1); +$widthU = NumberWithUnits("$width ft"); +$factor = random(2,4,1); +$extra = random(1,5,1); +$extraU = NumberWithUnits("$extra ft"); +$length = $factor*$width+$extra; +$lengthU = NumberWithUnits("$length ft"); +$perimeter = 2*($length+$width); +$perimeterU = NumberWithUnits("$perimeter ft"); + +$xmin = 0; #The viewing window +$xmax = $length+10; +$ymin = 0; +$ymax = $xmax; + +@x = (($xmax-$length)/2,($xmax+$length)/2); +@y = (($ymax-$width)/2,($ymax+$width)/2); + +$cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/10; + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-2,"$factor w + $extra",'black','center','middle')); +$picture->lb( new Label($x[1]+2,($y[0]+$y[1])/2,"w",'black','center','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[1]+2,"$factor w + $extra",'black','center','middle')); +$picture->lb( new Label($x[0]-2,($y[0]+$y[1])/2,"w",'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[0], darkblue,3); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +foreach $i (0,1) { + foreach $j (0,1) { + +$picture->moveTo($x[$i]+(-1)**$i*$cornersize,$y[$j]); +$picture->lineTo($x[$i]+(-1)**$i*$cornersize,$y[$j]+(-1)**$j*$cornersize, darkblue,3); +$picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,3); +}} + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A rectangle's perimeter is [`[$perimeterU]`]. Its length is [`[$extraU]`] longer than [@numberWord($factor)@] times its width. Use an equation to find the rectangle's length and width. + + Its width is [_____________]{$widthU}. + Its length is [_____________]{$lengthU}. + + +END_PGML + +############################################## + +$s1 = 2*$factor+2; +$s2 = 2*$extra; +$s3 = $perimeter - $s2; + +$alt = "A rectangle that is w long in one dimension, and $factor w + $extra long in the other dimension."; + +BEGIN_PGML_SOLUTION + +When we deal with a geometric figure, it's always a good idea to sketch it to help us think. + +Let the width be [`w`] feet, then the length would be [`[$factor]w+[$extra]`] feet. + +Note that it's not wise to let the length be [`l`] feet, because the width would be [`\frac{l-[$extra]}{[$factor]}`] feet. We would like to avoid fractions if possible. + +>>[@ image(insertGraph( $picture ), tex_size=>400, width=>400, height=>400, extra_html_tags => "alt = '$alt' title = '$alt'") @]*<< + +The perimeter is given as [`[$perimeterU]`]. Adding up the rectangle's 4 sides gives the perimeter. The equation is: + + [`` +\begin{aligned}[t] + w+w+[$factor]w+[$extra]+[$factor]w+[$extra] &= [$perimeter] \\ + [$s1]w +[$s2] &= [$perimeter] \\ + [$s1]w +[$s2] \mathbf{{}-[$s2]} &= [$perimeter] \mathbf{{}-[$s2]} \\ + [$s1]w &= [$s3] \\ + \frac{[$s1]w}{[$s1]} &= \frac{[$s3]}{[$s1]} \\ + x &= [$width] +\end{aligned} + ``] + +So the rectangle's width is [`[$widthU]`]. Its length is [`[$factor] \cdot [$widthU] + [$extraU] `], which is [`[$lengthU]`]. + +Don't forget the unit [`\textrm{ft}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume10.pg index 7912a2bae7..c0a878e095 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume10.pg @@ -7,75 +7,93 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.5') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Volume) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('volume','rectangular','prism') +## DBCCSS('5.MD.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## Context("Numeric"); -$xmin = 0; #The viewing window -$xmax = 20; -$ymin = 0; -$ymax = 20; - $base1 = random(10,15,1); $base2 = random(5,9,1); -do {$height = random(8,15,1);} until ($height!=$base1); +do {$height = random(8,15,1);} until ($height!=$base1 and $height!=$base2); + +$base2d = $base1 + $base2*0.4; +$height2d = $height + $base2*0.3; + +$px1 = 210*$base1/($base1+0.4*$base2); +$px2 = (210-$px1)/0.4; +$ypx = ($px1*$height/$base1+0.3*$px2+25); +$hpx = $px1*$height/$base1; + +if (0.2*$px2+15 < 32) { + $px1 = 193*$base1/($base1+0.2*$base2); + $px2 = (193-$px1)/0.2; + $ypx = ($px1*$height/$base1+0.3*$px2+25); + $hpx = $px1*$height/$base1; +}; -@x = (($xmax-$base1)/2,($xmax+$base1)/2); -@y = (($ymax-$height)/2,($ymax+$height)/2); + +$xmin = 0; #The viewing window +$xmax = 240*($base1+0.4*$base2)/($px1+0.4*$px2); +$ymin = 0; +$ymax = $xmax/240*$ypx; + +@x = (15/240*$xmax, (15+0.4*$px2)/240*$xmax, (15+$px1)/240*$xmax, (15+0.4*$px2+$px1)/240*$xmax); +@y = (15/$ypx*$ymax, (15+0.3*$px2)/$ypx*$ymax, (15+$hpx)/$ypx*$ymax, (15+0.3*$px2+$hpx)/$ypx*$ymax); $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[240,240*$ymax/$xmax]); -$picture->lb( new Label($x[0]+1/3*($x[1]-$x[0]), $y[0]-0.5,"$base1 in",'black','center','middle')); -$picture->lb( new Label($x[0]+5/6*($x[1]-$x[0]),$y[0]+$base2/4,' '."$base2 in",'black','left','middle')); -$picture->lb( new Label($x[0],$y[0]+($y[1]-$y[0])/3,"$height in".' ','black','right','middle')); +$picture->lb( new Label(($x[0]+$x[2])/2, $y[0],"$base1 in",'black','center','top','large')); +$picture->lb( new Label(($x[2]+$x[3])/2,($y[0]+$y[1])/2,"$base2 in",'black','left','top','large')); +$picture->lb( new Label($x[0],($y[0]+$y[2])/2,"$height in".' ','black','center','bottom','large','vertical')); $picture->new_color("darkblue", 100,100,255); $picture->moveTo($x[0],$y[0]); -$picture->lineTo( $x[0]+2/3*($x[1]-$x[0]),$y[0], darkblue,3); -$picture->lineTo( $x[1],$y[0]+$base2/2, darkblue,3); -$picture->lineTo( $x[1],$y[1], darkblue,3); -$picture->lineTo( $x[0]+2/3*($x[1]-$x[0]),$y[1]-$base2/2, darkblue,3); -$picture->lineTo( $x[0]+2/3*($x[1]-$x[0]),$y[0], darkblue,3); - -$picture->moveTo($x[0],$y[0]); -$picture->lineTo( $x[0],$y[1]-$base2/2, darkblue,3); -$picture->lineTo( $x[0]+2/3*($x[1]-$x[0]),$y[1]-$base2/2, darkblue,3); +$picture->lineTo( $x[2],$y[0], darkblue, 3); +$picture->lineTo( $x[2],$y[2], darkblue, 3); +$picture->lineTo( $x[0],$y[2], darkblue, 3); +$picture->lineTo( $x[0],$y[0], darkblue, 3); +$picture->lineTo( $x[1],$y[1], darkblue, 1, "dashed"); +$picture->lineTo( $x[3],$y[1], darkblue, 1, "dashed"); +$picture->lineTo( $x[3],$y[3], darkblue, 3); +$picture->lineTo( $x[1],$y[3], darkblue, 3); +$picture->lineTo( $x[0],$y[2], darkblue, 3); $picture->moveTo($x[1],$y[1]); -$picture->lineTo( $x[0]+1/3*($x[1]-$x[0]),$y[1], darkblue,3); -$picture->lineTo( $x[0],$y[1]-$base2/2, darkblue,3); +$picture->lineTo( $x[1],$y[3], darkblue, 1, "dashed"); -$picture->moveTo($x[0],$y[0]); -$picture->lineTo( $x[0]+1/3*($x[1]-$x[0]),$y[0]+$base2/2, darkblue,1,"dashed"); -$picture->lineTo( $x[1],$y[0]+$base2/2, darkblue,1,"dashed"); +$picture->moveTo($x[2],$y[0]); +$picture->lineTo( $x[3],$y[1], darkblue, 3); -$picture->moveTo($x[0]+1/3*($x[1]-$x[0]),$y[0]+$base2/2); -$picture->lineTo( $x[0]+1/3*($x[1]-$x[0]),$y[1], darkblue,1,"dashed"); +$picture->moveTo($x[2],$y[2]); +$picture->lineTo( $x[3],$y[3], darkblue, 3); $volume = $base1*$base2*$height; $baseArea = $base1*$base2; @@ -85,7 +103,7 @@ $ans = NumberWithUnits("$volume in^3"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_TEXT @@ -93,15 +111,16 @@ BEGIN_TEXT Find the volume of this rectangular prism. $PAR $BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "a rectangular prism with width $base1 inches, depth $base2 inches, and height $height inches" title = "a rectangular prism with width $base1 inches, depth $base2 inches, and height $height inches"') \} +\{ image(insertGraph( $picture ), width=>240, extra_html_tags => 'alt = "a rectangular prism with width $base1 inches, depth $base2 inches, and height $height inches" title = "a rectangular prism with width $base1 inches, depth $base2 inches, and height $height inches"') \} $ECENTER $PAR END_TEXT BEGIN_PGML - Its volume is [_____________]{$ans}. +[@KeyboardInstructions(q!(Use [|in^3|]* for cubic inches.)!)@]** + + [_____________]{$ans} -(Use *in[$CARET]3* for cubic inches.) END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume20.pg index 36287ea348..190446a38b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume20.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.5') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Volume) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('volume','cube','prism') +## DBCCSS('5.MD.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,7 +53,7 @@ BEGIN_PGML A cube's side length is [`[$sideU]`]. Its volume is [_____________]{$ans}. -(Use *cm[$CARET]3* for cubic feet.) +[@KeyboardInstructions(q!(Use [|cm^3|]* for cubic centimeters.)!)@]** END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume30.pg index fcb9581942..12a58f5195 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/RectangularPrismVolume30.pg @@ -8,27 +8,30 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.5') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Volume) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('volume','rectangular','prism') +## DBCCSS('5.MD.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,11 +53,10 @@ TEXT(beginproblem()); BEGIN_PGML -A rectangular prism's volume is [`[$volumeU]`]. The prism's base is a rectangle. The rectangle's base is [`[$base1U]`] and the rectangle's height is [`[$base2U]`]. +A rectangular prism's volume is [`[$volumeU]`]. The prism's base is a rectangle. The rectangle's length is [`[$base1U]`] and the rectangle's width is [`[$base2U]`]. This prism's height is [_____________]{$heightU}. -(Use *ft* for feet.) END_PGML @@ -70,23 +72,23 @@ To find the volume of any prism, we use the formula: Since this is a rectangular prism, the base is a rectangle. A rectangle's area formula is simply: - [`` \text{rectangle area} = \text{base} \cdot \text{height} ``] + [`` \text{rectangle area} = \text{length} \cdot \text{width} ``] -Let [`a`] represent the rectangle's base, [`b`] represent the rectangle's height, [`h`] represent the prism's height, and [`V`] represent the prism's volume, we have: +Let [`l`] represent the rectangle's length, [`w`] represent the rectangle's width, [`h`] represent the prism's height, and [`V`] represent the prism's volume, we have: - [`` V=abh ``] + [`` V=lwh ``] Next, we substitute in the given numbers, and we have: [``\begin{aligned} - V &= abh \\ + V &= lwh \\ [$volume] &= [$base1] \cdot [$base2] \cdot h \\ [$volume] &= [$s1]h \\ \frac{[$volume]}{[$s1]} &= \frac{[$s1]h}{[$s1]} \\ [$height] &= h \end{aligned}``] -The prism's height is [$heightU]. Don't forget the length unit [`\textrm{ft}`]. +The prism's height is [$heightU]. Don't forget the unit [`\textrm{ft}`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles10.pg index 003aa64821..9d98301feb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles10.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(Similar figures) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SimilarRightTriangles) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -62,37 +65,28 @@ $baseShort[0] = $ratio*$baseShort[1]; $baseLong[0] = $ratio*$baseLong[1]; $hypotenuse[0] = $ratio*$hypotenuse[1]; -$cushionLeft= $baseLong[0]/10; -$cushionMiddle = $baseLong[0]/3; -$cushionRight = $baseLong[0]/3; -$cushionY = $baseLong[0]/8; - +$pxcv = ($baseLongShow[0]+$baseLongShow[1])/190; $xmin = 0; -$xmax = $baseLongShow[0]+$baseLongShow[1]+$cushionLeft+$cushionMiddle+$cushionRight; +$xmax = $pxcv*50 + ($baseLongShow[0]+$baseLongShow[1]); $ymin = 0; -$ymax = $baseShortShow[0]+2*$cushionY; +$ymax = $baseShortShow[0] + $pxcv*25; -$xLabelShift = $xmax/35; -$yLabelShift = $ymax/15; +@x0 = ($pxcv*10,$pxcv*10+$baseLongShow[0]); +@y0 = ($pxcv*15,$pxcv*15+$baseShortShow[0]); -@x0 = ($cushionLeft,$cushionLeft+$baseLongShow[0]); -@y0 = ($cushionY,$cushionY+$baseShortShow[0]); +@x1 = ($pxcv*10+$baseLongShow[0]+$pxcv*(15+10),$pxcv*10+$baseLongShow[0]+$pxcv*(15+10)+$baseLongShow[1]); +@y1 = ($pxcv*15,$pxcv*15+$baseShortShow[1]); -@x1 = ($cushionLeft+$cushionMiddle+$baseLongShow[0],$cushionLeft+$cushionMiddle+$baseLongShow[0]+$baseLongShow[1]); -@y1 = (($ymax-$baseShortShow[1])/2,($ymax+$baseShortShow[1])/2); - -$pixelsx = 320; -$pixelsy = $pixelsx*$ymax/$xmax; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[$pixelsx,$pixelsy]); + pixels=>[240,240*$ymax/$xmax]); -$picture->lb( new Label(($x0[0]+$x0[1])/2, $y0[0]-$yLabelShift,"x",'black','center','middle')); -$picture->lb( new Label($x0[1]+$xLabelShift, ($y0[0]+$y0[1])/2,"$baseShort[0] $unit",'black','left','middle')); -#$picture->lb( new Label(($x0[0]+$x0[1])/2-$xLabelShift,($y0[0]+$y0[1])/2+$yLabelShift,"$hypotenuse[0] $unit",'black','center','middle')); +$picture->lb( new Label(($x0[0]+$x0[1])/2, $y0[0],"x $unit",'black','center','top','large')); +$picture->lb( new Label($x0[1], ($y0[0]+$y0[1])/2,"$baseShort[0] $unit",'black','center','top','large','vertical')); +#$picture->lb( new Label(($x0[0]+$x0[1])/2,($y0[0]+$y0[1])/2,"$hypotenuse[0] $unit",'black','right','bottom')); -$picture->lb( new Label(($x1[0]+$x1[1])/2, $y1[0]-$yLabelShift,"$baseLong[1] $unit",'black','center','middle')); -$picture->lb( new Label($x1[1]+$xLabelShift, ($y1[0]+$y1[1])/2,"$baseShort[1] $unit",'black','left','middle')); -#$picture->lb( new Label(($x1[0]+$x1[1])/2-$xLabelShift,($y1[0]+$y1[1])/2+$yLabelShift,"$hypotenuse[1] $unit",'black','center','middle')); +$picture->lb( new Label(($x1[0]+$x1[1])/2, $y1[0],"$baseLong[1] $unit",'black','center','top','large')); +$picture->lb( new Label($x1[1], ($y1[0]+$y1[1])/2,"$baseShort[1] $unit",'black','center','top','large','vertical')); +#$picture->lb( new Label(($x1[0]+$x1[1])/2,($y1[0]+$y1[1])/2,"$hypotenuse[1] $unit",'black','right','bottom')); $picture->new_color("darkblue", 100,100,255); @@ -106,20 +100,20 @@ $picture->lineTo($x1[1],$y1[0], darkblue,3); $picture->lineTo($x1[0],$y1[0], darkblue,3); $picture->lineTo($x1[1],$y1[1], darkblue,3); -$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. For the bigger triangle, its base is marked as x, and its right side is marked as $baseShort[0] $unit. For the smaller triangle, its base is marked as $baseLong[1] $unit, and its right side is marked as $baseShort[1] $unit."; +$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. For the bigger triangle, its base is marked as x $unit, and its right side is marked as $baseShort[0] $unit. For the smaller triangle, its base is marked as $baseLong[1] $unit, and its right side is marked as $baseShort[1] $unit."; $ans = $baseLong[0]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -The following two triangles are similar to each other. Find the length of the side labelled x. +The following two triangles are similar to each other. Find the length of the missing side. ->>[@ image(insertGraph( $picture ), tex_size=>400, height=>$pixelsy, width=>$pixelsx, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< +>>[@ image(insertGraph( $picture ), tex_size=>400, width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< [@KeyboardInstructions(q!Use [|ft|]* for feet.!)@]** diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles20.pg index 0062175a99..c73e3b0f61 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles20.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(Similar figures) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SimilarRightTriangles) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -67,32 +70,28 @@ $cushionMiddle = $baseLong[0]/3; $cushionRight = $baseLong[0]/3; $cushionY = $baseLong[0]/8; +$pxcv = ($baseLongShow[0]+$baseLongShow[1])/190; $xmin = 0; -$xmax = $baseLongShow[0]+$baseLongShow[1]+$cushionLeft+$cushionMiddle+$cushionRight; +$xmax = $pxcv*50 + ($baseLongShow[0]+$baseLongShow[1]); $ymin = 0; -$ymax = $baseShortShow[0]+2*$cushionY; +$ymax = $baseShortShow[0] + $pxcv*25; -$xLabelShift = $xmax/35; -$yLabelShift = $ymax/15; +@x0 = ($pxcv*10,$pxcv*10+$baseLongShow[0]); +@y0 = ($pxcv*15,$pxcv*15+$baseShortShow[0]); -@x0 = ($cushionLeft,$cushionLeft+$baseLongShow[0]); -@y0 = ($cushionY,$cushionY+$baseShortShow[0]); +@x1 = ($pxcv*10+$baseLongShow[0]+$pxcv*(15+10),$pxcv*10+$baseLongShow[0]+$pxcv*(15+10)+$baseLongShow[1]); +@y1 = ($pxcv*15,$pxcv*15+$baseShortShow[1]); -@x1 = ($cushionLeft+$cushionMiddle+$baseLongShow[0],$cushionLeft+$cushionMiddle+$baseLongShow[0]+$baseLongShow[1]); -@y1 = (($ymax-$baseShortShow[1])/2,($ymax+$baseShortShow[1])/2); - -$pixelsx = 320; -$pixelsy = $pixelsx*$ymax/$xmax; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[$pixelsx,$pixelsy]); + pixels=>[240,240*$ymax/$xmax]); -$picture->lb( new Label(($x0[0]+$x0[1])/2, $y0[0]-$yLabelShift,"$baseLong[0] $unit",'black','center','middle')); -$picture->lb( new Label($x0[1]+$xLabelShift, ($y0[0]+$y0[1])/2,"$baseShort[0] $unit",'black','left','middle')); -#$picture->lb( new Label(($x0[0]+$x0[1])/2-$xLabelShift,($y0[0]+$y0[1])/2+$yLabelShift,"$hypotenuse[0] $unit",'black','center','middle')); +$picture->lb( new Label(($x0[0]+$x0[1])/2, $y0[0],"$baseLong[0] $unit",'black','center','top','large')); +$picture->lb( new Label($x0[1], ($y0[0]+$y0[1])/2,"$baseShort[0] $unit",'black','center','top','large','vertical')); +#$picture->lb( new Label(($x0[0]+$x0[1])/2,($y0[0]+$y0[1])/2,"$hypotenuse[0] $unit",'black','right','bottom')); -$picture->lb( new Label(($x1[0]+$x1[1])/2, $y1[0]-$yLabelShift,"x",'black','center','middle')); -$picture->lb( new Label($x1[1]+$xLabelShift, ($y1[0]+$y1[1])/2,"$baseShort[1] $unit",'black','left','middle')); -#$picture->lb( new Label(($x1[0]+$x1[1])/2-$xLabelShift,($y1[0]+$y1[1])/2+$yLabelShift,"$hypotenuse[1] $unit",'black','center','middle')); +$picture->lb( new Label(($x1[0]+$x1[1])/2, $y1[0],"x $unit",'black','center','top','large')); +$picture->lb( new Label($x1[1], ($y1[0]+$y1[1])/2,"$baseShort[1] $unit",'black','center','top','large','vertical')); +#$picture->lb( new Label(($x1[0]+$x1[1])/2,($y1[0]+$y1[1])/2,"$hypotenuse[1] $unit",'black','right','bottom')); $picture->new_color("darkblue", 100,100,255); @@ -106,20 +105,20 @@ $picture->lineTo($x1[1],$y1[0], darkblue,3); $picture->lineTo($x1[0],$y1[0], darkblue,3); $picture->lineTo($x1[1],$y1[1], darkblue,3); -$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. For the bigger triangle, its base is marked as $baseLong[0] $unit, and its right side is marked as $baseShort[0] $unit. For the smaller triangle, its base is marked as x, and its right side is marked as $baseShort[1] $unit."; +$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. For the bigger triangle, its base is marked as $baseLong[0] $unit, and its right side is marked as $baseShort[0] $unit. For the smaller triangle, its base is marked as x $unit, and its right side is marked as $baseShort[1] $unit."; $ans = $baseLong[1]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -The following two triangles are similar to each other. Find the length of the side labelled x. +The following two triangles are similar to each other. Find the length of the missing side. ->>[@ image(insertGraph( $picture ), tex_size=>400, height=>$pixelsy, width=>$pixelsx, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< +>>[@ image(insertGraph( $picture ), tex_size=>400, width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< [@KeyboardInstructions(q!Use [|cm|]* for centimeters.!)@]** diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles30.pg index 3c237c3bb7..4fe5a25d48 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles30.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(Similar figures) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SimilarRightTriangles) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -88,7 +91,7 @@ $picture = init_graph($xmin,$ymin,$xmax,$ymax, #$picture->lb( new Label(($x0[0]+$x0[1])/2, $y0[0]-$yLabelShift,"x $unit",'black','center','middle')); $picture->lb( new Label($x0[1]+$xLabelShift, ($y0[0]+$y0[1])/2,"$baseShort[0] $unit",'black','left','middle')); -$picture->lb( new Label(($x0[0]+$x0[1])/2-$xLabelShift,($y0[0]+$y0[1])/2+$yLabelShift,"x",'black','center','middle')); +$picture->lb( new Label(($x0[0]+$x0[1])/2-$xLabelShift,($y0[0]+$y0[1])/2+$yLabelShift,"x $unit",'black','center','middle')); #$picture->lb( new Label(($x1[0]+$x1[1])/2, $y1[0]-$yLabelShift,"$baseLong[1] $unit",'black','center','middle')); $picture->lb( new Label($x1[1]+$xLabelShift, ($y1[0]+$y1[1])/2,"$baseShort[1] $unit",'black','left','middle')); @@ -106,18 +109,18 @@ $picture->lineTo($x1[1],$y1[0], darkblue,3); $picture->lineTo($x1[0],$y1[0], darkblue,3); $picture->lineTo($x1[1],$y1[1], darkblue,3); -$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. For the bigger triangle, its longest side is marked as x, and its right side is marked as $baseShort[0] $unit. For the smaller triangle, its longest side is marked as $hypotenuse[1] $unit, and its right side is marked as $baseShort[1] $unit."; +$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. For the bigger triangle, its longest side is marked as $hypotenuse[0] $unit, and its right side is marked as $baseShort[0] $unit. For the smaller triangle, its longest side is marked as $hypotenuse[1] $unit, and its right side is marked as $baseShort[1] $unit."; $ans = $hypotenuse[0]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -The following two triangles are similar to each other. Find the length of the side labelled x. +The following two triangles are similar to each other. Find the length of the missing side. >>[@ image(insertGraph( $picture ), tex_size=>400, height=>$pixelsy, width=>$pixelsx, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles40.pg index 0e95523eb2..33478aec27 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles40.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(Similar figures) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SimilarRightTriangles) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -92,7 +95,7 @@ $picture->lb( new Label(($x0[0]+$x0[1])/2-$xLabelShift,($y0[0]+$y0[1])/2+$yLabel $picture->lb( new Label(($x1[0]+$x1[1])/2, $y1[0]-$yLabelShift,"$baseLong[1] $unit",'black','center','middle')); #$picture->lb( new Label($x1[1]+$xLabelShift, ($y1[0]+$y1[1])/2,"$baseShort[1] $unit",'black','left','middle')); -$picture->lb( new Label(($x1[0]+$x1[1])/2-$xLabelShift,($y1[0]+$y1[1])/2+$yLabelShift,"x",'black','center','middle')); +$picture->lb( new Label(($x1[0]+$x1[1])/2-$xLabelShift,($y1[0]+$y1[1])/2+$yLabelShift,"x $unit",'black','center','middle')); $picture->new_color("darkblue", 100,100,255); @@ -106,18 +109,18 @@ $picture->lineTo($x1[1],$y1[0], darkblue,3); $picture->lineTo($x1[0],$y1[0], darkblue,3); $picture->lineTo($x1[1],$y1[1], darkblue,3); -$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. For the bigger triangle, its longest side is marked as $hypotenuse[0] $unit, and its base is marked as $baseLong[0] $unit. For the smaller triangle, its hypotenuse is marked as x, and its base is marked as $baseLong[1] $unit."; +$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. For the bigger triangle, its longest side is marked as $hypotenuse[0] $unit, and its base is marked as $baseLong[0] $unit. For the smaller triangle, its hypotenuse is marked as x $unit, and its base is marked as $baseLong[1] $unit."; $ans = $hypotenuse[1]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -The following two triangles are similar to each other. Find the length of the side labelled x. +The following two triangles are similar to each other. Find the length of the missing side. >>[@ image(insertGraph( $picture ), tex_size=>400, height=>$pixelsy, width=>$pixelsx, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles50.pg index 0497b9b8cd..fb033aa51c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles50.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(Similar figures) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SimilarRightTriangles) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -73,18 +76,42 @@ if ($orientation[0]<=3) { do {$orientation[1] = random(4,7,1);} until ($orientation[0] != $orientation[1]); } -$cushionLeft= $baseLongShow[0]/2; -$cushionMiddle = $baseLongShow[0]/2; -$cushionRight = $baseLongShow[0]/2; -$cushionY = $baseLongShow[0]/5; +for my $i (0,1) { + $hor[$i] = ($orientation[$i] == 0 or $orientation[$i] == 3 or $orientation[$i] == 4 or $orientation[$i] == 7) ? $baseShortShow[$i] : $baseLongShow[$i]; + $ver[$i] = ($orientation[$i] == 0 or $orientation[$i] == 3 or $orientation[$i] == 4 or $orientation[$i] == 7) ? $baseLongShow[$i] : $baseShortShow[$i]; + $pxhyp[$i] = (1+length($hypotenuse[$i])+3)*8; +} + +$pxcv = ($hor[0]+$hor[1])/180; + +$cushionLeft= $pxcv*15; +$cushionMiddle = $pxcv*30; +$cushionRight = $pxcv*15; +$cushionY = $pxcv*15; + + +if ($orientation[0] == 4 or $orientation[0] == 7){ + $cushionLeft = max($pxcv*15, $pxcv*$pxhyp[0]-$baseShortShow[0]/2); +} + +if ($orientation[0] == 45 or $orientation[0] == 6){ + $cushionLeft = max($pxcv*15, $pxcv*$pxhyp[0]-$baseLongShow[0]/2); +} + +if ($orientation[1] == 0 or $orientation[1] == 3){ + $cushionRight = max($pxcv*15, $pxcv*$pxhyp[1]-$baseShortShow[1]/2); +} + +if ($orientation[1] == 1 or $orientation[1] == 2){ + $cushionRight = max($pxcv*15, $pxcv*$pxhyp[1]-$baseLongShow[1]/2); +} + $xmin = 0; -$xmax = $baseLongShow[0]+$baseLongShow[1]+$cushionLeft+$cushionMiddle+$cushionRight; +$xmax = $hor[0]+$hor[1]+$cushionLeft+$cushionMiddle+$cushionRight; $ymin = 0; -$ymax = $baseLongShow[0]+2*$cushionY; +$ymax = max($ver[0],$ver[1])+2*$cushionY; -$xLabelShift = $xmax/13; -$yLabelShift = $ymax/15; @cx = (); @cy = (); @@ -97,15 +124,37 @@ $yLabelShift = $ymax/15; @bcxShift = (); @bcyShift = (); -$cy[0][0] = $cushionY; -$cy[0][1] = $ymax/2-$baseShortShow[0]/2; -$cy[0][2] = $ymax/2+$baseShortShow[0]/2; -$cy[0][3] = $cushionY+$baseLongShow[0]; -$cy[0][4] = $cy[0][3]; -$cy[0][5] = $cy[0][2]; -$cy[0][6] = $cy[0][1]; -$cy[0][7] = $cy[0][0]; +for my $i (0,1) { + +$ay[$i][0] = $cushionY; +$ay[$i][1] = $cushionY + $baseShortShow[$i]; +$ay[$i][2] = $cushionY; +$ay[$i][3] = $cushionY + $baseLongShow[$i]; +$ay[$i][4] = $cushionY + $baseLongShow[$i]; +$ay[$i][5] = $cushionY; +$ay[$i][6] = $cushionY + $baseShortShow[$i]; +$ay[$i][7] = $cushionY; + +$by[$i][0] = $cushionY + $baseLongShow[$i]; +$by[$i][1] = $cushionY; +$by[$i][2] = $cushionY + $baseShortShow[$i]; +$by[$i][3] = $cushionY; +$by[$i][4] = $cushionY; +$by[$i][5] = $cushionY + $baseShortShow[$i]; +$by[$i][6] = $cushionY; +$by[$i][7] = $cushionY + $baseLongShow[$i]; + +$cy[$i][0] = $cushionY; +$cy[$i][1] = $cushionY; +$cy[$i][2] = $cushionY + $baseShortShow[$i]; +$cy[$i][3] = $cushionY + $baseLongShow[$i]; +$cy[$i][4] = $cushionY + $baseLongShow[$i]; +$cy[$i][5] = $cushionY + $baseShortShow[$i]; +$cy[$i][6] = $cushionY; +$cy[$i][7] = $cushionY; +} +$cx[0][0] = $cushionLeft; $cx[0][0] = $cushionLeft; $cx[0][1] = $cushionLeft; $cx[0][2] = $cushionLeft; @@ -115,182 +164,165 @@ $cx[0][5] = $cushionLeft+$baseLongShow[0]; $cx[0][6] = $cushionLeft+$baseLongShow[0]; $cx[0][7] = $cushionLeft+$baseShortShow[0]; -$cy[1][0] = $ymax/2-$baseLongShow[1]/2; -$cy[1][1] = $ymax/2-$baseShortShow[1]/2; -$cy[1][2] = $ymax/2+$baseShortShow[1]/2; -$cy[1][3] = $ymax/2+$baseLongShow[1]/2; -$cy[1][4] = $cy[1][3]; -$cy[1][5] = $cy[1][2]; -$cy[1][6] = $cy[1][1]; -$cy[1][7] = $cy[1][0]; - -$cx[1][0] = $cushionLeft+$baseLongShow[0]+$cushionMiddle+($baseLongShow[1]+$cushionRight)/2-$baseShortShow[1]/2; -$cx[1][1] = $cushionLeft+$baseLongShow[0]+$cushionMiddle; -$cx[1][2] = $cx[1][1]; -$cx[1][3] = $cx[1][0]; +$cx[1][0] = $xmax-$cushionRight-$baseShortShow[1]; +$cx[1][1] = $xmax-$cushionRight-$baseLongShow[1]; +$cx[1][2] = $xmax-$cushionRight-$baseLongShow[1]; +$cx[1][3] = $xmax-$cushionRight-$baseShortShow[1]; $cx[1][4] = $xmax-$cushionRight; $cx[1][5] = $xmax-$cushionRight; $cx[1][6] = $xmax-$cushionRight; $cx[1][7] = $xmax-$cushionRight; -$ax[0][0] = $cx[0][0]+$baseShortShow[0]; -$ax[0][1] = $cx[0][1]; -$ax[0][2] = $cx[0][2]; -$ax[0][3] = $cx[0][3]+$baseShortShow[0]; -$ax[0][4] = $cx[0][4]-$baseShortShow[0]; -$ax[0][5] = $cx[0][5]; -$ax[0][6] = $cx[0][6]; -$ax[0][7] = $cx[0][7]-$baseShortShow[0]; - -$ay[0][0] = $cy[0][0]; -$ay[0][1] = $cy[0][1]+$baseShortShow[0]; -$ay[0][2] = $cy[0][2]-$baseShortShow[0]; -$ay[0][3] = $cy[0][3]; -$ay[0][4] = $cy[0][4]; -$ay[0][5] = $cy[0][5]-$baseShortShow[0]; -$ay[0][6] = $cy[0][6]+$baseShortShow[0]; -$ay[0][7] = $cy[0][7]; - -$ax[1][0] = $cx[1][0]+$baseShortShow[1]; -$ax[1][1] = $cx[1][1]; -$ax[1][2] = $cx[1][2]; -$ax[1][3] = $cx[1][3]+$baseShortShow[1]; -$ax[1][4] = $cx[1][4]-$baseShortShow[1]; -$ax[1][5] = $cx[1][5]; -$ax[1][6] = $cx[1][6]; -$ax[1][7] = $cx[1][7]-$baseShortShow[1]; - -$ay[1][0] = $cy[1][0]; -$ay[1][1] = $cy[1][1]+$baseShortShow[1]; -$ay[1][2] = $cy[1][2]-$baseShortShow[1]; -$ay[1][3] = $cy[1][3]; -$ay[1][4] = $cy[1][4]; -$ay[1][5] = $cy[1][5]-$baseShortShow[1]; -$ay[1][6] = $cy[1][6]+$baseShortShow[1]; -$ay[1][7] = $cy[1][7]; - -$bx[0][0] = $cx[0][0]; -$bx[0][1] = $cx[0][1]+$baseLongShow[0]; -$bx[0][2] = $cx[0][2]+$baseLongShow[0]; -$bx[0][3] = $cx[0][3]; -$bx[0][4] = $cx[0][4]; -$bx[0][5] = $cx[0][5]-$baseLongShow[0]; -$bx[0][6] = $cx[0][6]-$baseLongShow[0]; -$bx[0][7] = $cx[0][7]; - -$bx[1][0] = $cx[1][0]; -$bx[1][1] = $cx[1][1]+$baseLongShow[1]; -$bx[1][2] = $cx[1][2]+$baseLongShow[1]; -$bx[1][3] = $cx[1][3]; -$bx[1][4] = $cx[1][4]; -$bx[1][5] = $cx[1][5]-$baseLongShow[1]; -$bx[1][6] = $cx[1][6]-$baseLongShow[1]; -$bx[1][7] = $cx[1][7]; - -$by[0][0] = $cy[0][0]+$baseLongShow[0]; -$by[0][1] = $cy[0][1]; -$by[0][2] = $cy[0][2]; -$by[0][3] = $cy[0][3]-$baseLongShow[0]; -$by[0][4] = $cy[0][4]-$baseLongShow[0]; -$by[0][5] = $cy[0][5]; -$by[0][6] = $cy[0][6]; -$by[0][7] = $cy[0][7]+$baseLongShow[0]; - -$by[1][0] = $cy[1][0]+$baseLongShow[1]; -$by[1][1] = $cy[1][1]; -$by[1][2] = $cy[1][2]; -$by[1][3] = $cy[1][3]-$baseLongShow[1]; -$by[1][4] = $cy[1][4]-$baseLongShow[1]; -$by[1][5] = $cy[1][5]; -$by[1][6] = $cy[1][6]; -$by[1][7] = $cy[1][7]+$baseLongShow[1]; +$ax[0][0] = $cushionLeft+$baseShortShow[0]; +$ax[0][1] = $cushionLeft; +$ax[0][2] = $cushionLeft; +$ax[0][3] = $cushionLeft+$baseShortShow[0]; +$ax[0][4] = $cushionLeft; +$ax[0][5] = $cushionLeft+$baseLongShow[0]; +$ax[0][6] = $cushionLeft+$baseLongShow[0]; +$ax[0][7] = $cushionLeft; + +$ax[1][0] = $xmax-$cushionRight; +$ax[1][1] = $xmax-$cushionRight-$baseLongShow[1]; +$ax[1][2] = $xmax-$cushionRight-$baseLongShow[1]; +$ax[1][3] = $xmax-$cushionRight; +$ax[1][4] = $xmax-$cushionRight-$baseShortShow[1]; +$ax[1][5] = $xmax-$cushionRight; +$ax[1][6] = $xmax-$cushionRight; +$ax[1][7] = $xmax-$cushionRight-$baseShortShow[1]; + +$bx[0][0] = $cushionLeft; +$bx[0][1] = $cushionLeft+$baseLongShow[0]; +$bx[0][2] = $cushionLeft+$baseLongShow[0]; +$bx[0][3] = $cushionLeft; +$bx[0][4] = $cushionLeft+$baseShortShow[0]; +$bx[0][5] = $cushionLeft; +$bx[0][6] = $cushionLeft; +$bx[0][7] = $cushionLeft+$baseShortShow[0]; + +$bx[1][0] = $xmax-$cushionRight-$baseShortShow[1]; +$bx[1][1] = $xmax-$cushionRight; +$bx[1][2] = $xmax-$cushionRight; +$bx[1][3] = $xmax-$cushionRight-$baseShortShow[1]; +$bx[1][4] = $xmax-$cushionRight; +$bx[1][5] = $xmax-$cushionRight-$baseLongShow[1]; +$bx[1][6] = $xmax-$cushionRight-$baseLongShow[1]; +$bx[1][7] = $xmax-$cushionRight; for my $i (0..1) { - $acxShift[$i][0] = 0; - $acxShift[$i][1] = -$xLabelShift; - $acxShift[$i][2] = -$xLabelShift; - $acxShift[$i][3] = 0; - $acxShift[$i][4] = 0; - $acxShift[$i][5] = $xLabelShift; - $acxShift[$i][6] = $xLabelShift; - $acxShift[$i][7] = 0; - - $acyShift[$i][0] = -$yLabelShift; - $acyShift[$i][1] = 0; - $acyShift[$i][2] = 0; - $acyShift[$i][3] = $yLabelShift; - $acyShift[$i][4] = $yLabelShift; - $acyShift[$i][5] = 0; - $acyShift[$i][6] = 0; - $acyShift[$i][7] = -$yLabelShift; - - $bcxShift[$i][0] = -$xLabelShift; - $bcxShift[$i][1] = 0; - $bcxShift[$i][2] = 0; - $bcxShift[$i][3] = -$xLabelShift; - $bcxShift[$i][4] = $xLabelShift; - $bcxShift[$i][5] = 0; - $bcxShift[$i][6] = 0; - $bcxShift[$i][7] = $xLabelShift; - - $bcyShift[$i][0] = 0; - $bcyShift[$i][1] = -$yLabelShift; - $bcyShift[$i][2] = $yLabelShift; - $bcyShift[$i][3] = 0; - $bcyShift[$i][4] = 0; - $bcyShift[$i][5] = $yLabelShift; - $bcyShift[$i][6] = -$yLabelShift; - $bcyShift[$i][7] = 0; - - $abxPosition[$i][0] = ($ax[$i][0]+$bx[$i][0])/2+$xLabelShift; - $abxPosition[$i][1] = ($cx[$i][1]+$bx[$i][1])/2+$xLabelShift; - $abxPosition[$i][2] = ($cx[$i][2]+$bx[$i][2])/2+$xLabelShift; - $abxPosition[$i][3] = ($ax[$i][3]+$bx[$i][3])/2+$xLabelShift; - $abxPosition[$i][4] = ($ax[$i][4]+$bx[$i][4])/2-$xLabelShift; - $abxPosition[$i][5] = ($cx[$i][5]+$bx[$i][5])/2-$xLabelShift; - $abxPosition[$i][6] = ($cx[$i][6]+$bx[$i][6])/2-$xLabelShift; - $abxPosition[$i][7] = ($ax[$i][7]+$bx[$i][7])/2-$xLabelShift; - - $abyShift[$i][0] = $yLabelShift*0.5**$i; - $abyShift[$i][1] = $yLabelShift*0.5**$i; - $abyShift[$i][2] = -$yLabelShift*0.5**$i; - $abyShift[$i][3] = -$yLabelShift*0.5**$i; - $abyShift[$i][4] = -$yLabelShift*0.5**$i; - $abyShift[$i][5] = -$yLabelShift*0.5**$i; - $abyShift[$i][6] = $yLabelShift*0.5**$i; - $abyShift[$i][7] = $yLabelShift*0.5**$i; + $acxShift[$i][0] = 'center'; + $acxShift[$i][1] = 'center'; + $acxShift[$i][2] = 'center'; + $acxShift[$i][3] = 'center'; + $acxShift[$i][4] = 'center'; + $acxShift[$i][5] = 'center'; + $acxShift[$i][6] = 'center'; + $acxShift[$i][7] = 'center'; + + $acyShift[$i][0] = 'top'; + $acyShift[$i][1] = 'bottom'; + $acyShift[$i][2] = 'bottom'; + $acyShift[$i][3] = 'bottom'; + $acyShift[$i][4] = 'bottom'; + $acyShift[$i][5] = 'top'; + $acyShift[$i][6] = 'top'; + $acyShift[$i][7] = 'top'; + + $bcxShift[$i][0] = 'center'; + $bcxShift[$i][1] = 'center'; + $bcxShift[$i][2] = 'center'; + $bcxShift[$i][3] = 'center'; + $bcxShift[$i][4] = 'center'; + $bcxShift[$i][5] = 'center'; + $bcxShift[$i][6] = 'center'; + $bcxShift[$i][7] = 'center'; + + $bcyShift[$i][0] = 'bottom'; + $bcyShift[$i][1] = 'top'; + $bcyShift[$i][2] = 'bottom'; + $bcyShift[$i][3] = 'bottom'; + $bcyShift[$i][4] = 'top'; + $bcyShift[$i][5] = 'bottom'; + $bcyShift[$i][6] = 'top'; + $bcyShift[$i][7] = 'top'; + + $abxPosition[$i][0] = ($ax[$i][0]+$bx[$i][0])/2; + $abxPosition[$i][1] = ($cx[$i][1]+$bx[$i][1])/2; + $abxPosition[$i][2] = ($cx[$i][2]+$bx[$i][2])/2; + $abxPosition[$i][3] = ($ax[$i][3]+$bx[$i][3])/2; + $abxPosition[$i][4] = ($ax[$i][4]+$bx[$i][4])/2; + $abxPosition[$i][5] = ($cx[$i][5]+$bx[$i][5])/2; + $abxPosition[$i][6] = ($cx[$i][6]+$bx[$i][6])/2; + $abxPosition[$i][7] = ($ax[$i][7]+$bx[$i][7])/2; + + $abxShift[$i][0] = 'left'; + $abxShift[$i][1] = 'left'; + $abxShift[$i][2] = 'left'; + $abxShift[$i][3] = 'left'; + $abxShift[$i][4] = 'right'; + $abxShift[$i][5] = 'right'; + $abxShift[$i][6] = 'right'; + $abxShift[$i][7] = 'right'; + + $abyShift[$i][0] = 'bottom'; + $abyShift[$i][1] = 'bottom'; + $abyShift[$i][2] = 'top'; + $abyShift[$i][3] = 'top'; + $abyShift[$i][4] = 'top'; + $abyShift[$i][5] = 'top'; + $abyShift[$i][6] = 'bottom'; + $abyShift[$i][7] = 'bottom'; + + $acO[$i][0] = 'horizontal', + $acO[$i][1] = 'vertical', + $acO[$i][2] = 'vertical', + $acO[$i][3] = 'horizontal', + $acO[$i][4] = 'horizontal', + $acO[$i][5] = 'vertical', + $acO[$i][6] = 'vertical', + $acO[$i][7] = 'horizontal', + + $bcO[$i][0] = 'vertical', + $bcO[$i][1] = 'horizontal', + $bcO[$i][2] = 'horizontal', + $bcO[$i][3] = 'vertical', + $bcO[$i][4] = 'vertical', + $bcO[$i][5] = 'horizontal', + $bcO[$i][6] = 'horizontal', + $bcO[$i][7] = 'vertical', + } -$pixelsx = 320; -$pixelsy = $pixelsx*$ymax/$xmax; + + $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[$pixelsx,$pixelsy]); + pixels=>[240,240*$ymax/$xmax]); $picture->lb( new Label( - ($ax[0][$orientation[0]]+$cx[0][$orientation[0]])/2+$acxShift[0][$orientation[0]], - ($ay[0][$orientation[0]]+$cy[0][$orientation[0]])/2+$acyShift[0][$orientation[0]], - "x $unit",'black','center','middle')); + ($ax[0][$orientation[0]]+$cx[0][$orientation[0]])/2, + ($ay[0][$orientation[0]]+$cy[0][$orientation[0]])/2, + "x $unit",'black',$acxShift[0][$orientation[0]],$acyShift[0][$orientation[0]],'large',$acO[0][$orientation[0]])); $picture->lb( new Label( - ($bx[0][$orientation[0]]+$cx[0][$orientation[0]])/2+$bcxShift[0][$orientation[0]], - ($by[0][$orientation[0]]+$cy[0][$orientation[0]])/2+$bcyShift[0][$orientation[0]], - "$baseLong[0] $unit",'black','center','middle')); + ($bx[0][$orientation[0]]+$cx[0][$orientation[0]])/2, + ($by[0][$orientation[0]]+$cy[0][$orientation[0]])/2, + "$baseLong[0] $unit",'black',$bcxShift[0][$orientation[0]],$bcyShift[0][$orientation[0]],'large',$bcO[0][$orientation[0]])); $picture->lb( new Label( $abxPosition[0][$orientation[0]], - ($ay[0][$orientation[0]]+$by[0][$orientation[0]])/2+$abyShift[0][$orientation[0]], - "$hypotenuse[0] $unit",'black','center','middle')); + ($ay[0][$orientation[0]]+$by[0][$orientation[0]])/2, + "$hypotenuse[0] $unit",'black',$abxShift[0][$orientation[0]],$abyShift[0][$orientation[0]],'large')); $picture->lb( new Label( - ($ax[1][$orientation[1]]+$cx[1][$orientation[1]])/2+$acxShift[1][$orientation[1]], - ($ay[1][$orientation[1]]+$cy[1][$orientation[1]])/2+$acyShift[1][$orientation[1]], - "$baseShort[1] $unit",'black','center','middle')); + ($ax[1][$orientation[1]]+$cx[1][$orientation[1]])/2, + ($ay[1][$orientation[1]]+$cy[1][$orientation[1]])/2, + "$baseShort[1] $unit",'black',$acxShift[1][$orientation[1]],$acyShift[1][$orientation[1]],'large',$acO[1][$orientation[1]])); $picture->lb( new Label( - ($bx[1][$orientation[1]]+$cx[1][$orientation[1]])/2+$bcxShift[1][$orientation[1]], - ($by[1][$orientation[1]]+$cy[1][$orientation[1]])/2+$bcyShift[1][$orientation[1]], - "$baseLong[1] $unit",'black','center','middle')); + ($bx[1][$orientation[1]]+$cx[1][$orientation[1]])/2, + ($by[1][$orientation[1]]+$cy[1][$orientation[1]])/2, + "$baseLong[1] $unit",'black',$bcxShift[1][$orientation[1]],$bcyShift[1][$orientation[1]],'large',$bcO[1][$orientation[1]])); $picture->lb( new Label( $abxPosition[1][$orientation[1]], - ($ay[1][$orientation[1]]+$by[1][$orientation[1]])/2+$abyShift[1][$orientation[1]], - "$hypotenuse[1] $unit",'black','center','middle')); + ($ay[1][$orientation[1]]+$by[1][$orientation[1]])/2, + "$hypotenuse[1] $unit",'black',$abxShift[1][$orientation[1]],$abyShift[1][$orientation[1]],'large')); $picture->new_color("darkblue", 100,100,255); @@ -303,20 +335,20 @@ for my $i (0..1) { } -$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. Both triangles have unequal sides. For the smaller triangle, its shortest side is marked as $baseShort[1] $unit, its second shortest side is marked as $baseLong[1] $unit, and its longest side is marked as $hypotenuse[0] $unit. For the bigger triangle, its shortest side is marked as x $unit, its second shortest side is marked as $baseLong[0] $unit, and its longest side is marked as $hypotenuse[1] $unit."; +$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. Both triangles have unequal sides. For the smaller triangle, its shortest side is marked as $baseShort[1] $unit, its second shortest side is marked as $baseLong[1] $unit, and its longest side is marked as $hypotenuse[1] $unit. For the bigger triangle, its shortest side is marked as x $unit, its second shortest side is marked as $baseLong[0] $unit, and its longest side is marked as $hypotenuse[0] $unit."; $ans = $baseShort[0]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML The following two triangles are similar to each other. Find the length of the missing side. ->>[@ image(insertGraph( $picture ), tex_size=>400, height=>$pixelsy, width=>$pixelsx, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< +>>[@ image(insertGraph( $picture ), tex_size=>400, width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< [@KeyboardInstructions(q!Use [|ft|]* for feet.!)@]** diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles60.pg index db141d7a45..b07c292e1a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles60.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(Similar figures) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SimilarRightTriangles) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +38,7 @@ loadMacros( Context("Numeric"); -$unit = "cm"; +$unit = "ft"; Context("Numeric"); @@ -73,18 +76,40 @@ if ($orientation[0]<=3) { do {$orientation[1] = random(4,7,1);} until ($orientation[0] != $orientation[1]); } -$cushionLeft= $baseLongShow[0]/2; -$cushionMiddle = $baseLongShow[0]/2; -$cushionRight = $baseLongShow[0]/2; -$cushionY = $baseLongShow[0]/5; +for my $i (0,1) { + $hor[$i] = ($orientation[$i] == 0 or $orientation[$i] == 3 or $orientation[$i] == 4 or $orientation[$i] == 7) ? $baseShortShow[$i] : $baseLongShow[$i]; + $ver[$i] = ($orientation[$i] == 0 or $orientation[$i] == 3 or $orientation[$i] == 4 or $orientation[$i] == 7) ? $baseLongShow[$i] : $baseShortShow[$i]; + $pxhyp[$i] = (1+length($hypotenuse[$i])+3)*8; +} + +$pxcv = ($hor[0]+$hor[1])/180; + +$cushionLeft= $pxcv*15; +$cushionMiddle = $pxcv*30; +$cushionRight = $pxcv*15; +$cushionY = $pxcv*15; + + +if ($orientation[0] == 4 or $orientation[0] == 7){ + $cushionLeft = max($pxcv*15, $pxcv*$pxhyp[0]-$baseShortShow[0]/2); +} + +if ($orientation[0] == 45 or $orientation[0] == 6){ + $cushionLeft = max($pxcv*15, $pxcv*$pxhyp[0]-$baseLongShow[0]/2); +} + +if ($orientation[1] == 0 or $orientation[1] == 3){ + $cushionRight = max($pxcv*15, $pxcv*$pxhyp[1]-$baseShortShow[1]/2); +} + +if ($orientation[1] == 1 or $orientation[1] == 2){ + $cushionRight = max($pxcv*15, $pxcv*$pxhyp[1]-$baseLongShow[1]/2); +} $xmin = 0; -$xmax = $baseLongShow[0]+$baseLongShow[1]+$cushionLeft+$cushionMiddle+$cushionRight; +$xmax = $hor[0]+$hor[1]+$cushionLeft+$cushionMiddle+$cushionRight; $ymin = 0; -$ymax = $baseLongShow[0]+2*$cushionY; - -$xLabelShift = $xmax/13; -$yLabelShift = $ymax/15; +$ymax = max($ver[0],$ver[1])+2*$cushionY; @cx = (); @cy = (); @@ -97,15 +122,37 @@ $yLabelShift = $ymax/15; @bcxShift = (); @bcyShift = (); -$cy[0][0] = $cushionY; -$cy[0][1] = $ymax/2-$baseShortShow[0]/2; -$cy[0][2] = $ymax/2+$baseShortShow[0]/2; -$cy[0][3] = $cushionY+$baseLongShow[0]; -$cy[0][4] = $cy[0][3]; -$cy[0][5] = $cy[0][2]; -$cy[0][6] = $cy[0][1]; -$cy[0][7] = $cy[0][0]; +for my $i (0,1) { + +$ay[$i][0] = $cushionY; +$ay[$i][1] = $cushionY + $baseShortShow[$i]; +$ay[$i][2] = $cushionY; +$ay[$i][3] = $cushionY + $baseLongShow[$i]; +$ay[$i][4] = $cushionY + $baseLongShow[$i]; +$ay[$i][5] = $cushionY; +$ay[$i][6] = $cushionY + $baseShortShow[$i]; +$ay[$i][7] = $cushionY; + +$by[$i][0] = $cushionY + $baseLongShow[$i]; +$by[$i][1] = $cushionY; +$by[$i][2] = $cushionY + $baseShortShow[$i]; +$by[$i][3] = $cushionY; +$by[$i][4] = $cushionY; +$by[$i][5] = $cushionY + $baseShortShow[$i]; +$by[$i][6] = $cushionY; +$by[$i][7] = $cushionY + $baseLongShow[$i]; + +$cy[$i][0] = $cushionY; +$cy[$i][1] = $cushionY; +$cy[$i][2] = $cushionY + $baseShortShow[$i]; +$cy[$i][3] = $cushionY + $baseLongShow[$i]; +$cy[$i][4] = $cushionY + $baseLongShow[$i]; +$cy[$i][5] = $cushionY + $baseShortShow[$i]; +$cy[$i][6] = $cushionY; +$cy[$i][7] = $cushionY; +} +$cx[0][0] = $cushionLeft; $cx[0][0] = $cushionLeft; $cx[0][1] = $cushionLeft; $cx[0][2] = $cushionLeft; @@ -115,182 +162,165 @@ $cx[0][5] = $cushionLeft+$baseLongShow[0]; $cx[0][6] = $cushionLeft+$baseLongShow[0]; $cx[0][7] = $cushionLeft+$baseShortShow[0]; -$cy[1][0] = $ymax/2-$baseLongShow[1]/2; -$cy[1][1] = $ymax/2-$baseShortShow[1]/2; -$cy[1][2] = $ymax/2+$baseShortShow[1]/2; -$cy[1][3] = $ymax/2+$baseLongShow[1]/2; -$cy[1][4] = $cy[1][3]; -$cy[1][5] = $cy[1][2]; -$cy[1][6] = $cy[1][1]; -$cy[1][7] = $cy[1][0]; - -$cx[1][0] = $cushionLeft+$baseLongShow[0]+$cushionMiddle+($baseLongShow[1]+$cushionRight)/2-$baseShortShow[1]/2; -$cx[1][1] = $cushionLeft+$baseLongShow[0]+$cushionMiddle; -$cx[1][2] = $cx[1][1]; -$cx[1][3] = $cx[1][0]; +$cx[1][0] = $xmax-$cushionRight-$baseShortShow[1]; +$cx[1][1] = $xmax-$cushionRight-$baseLongShow[1]; +$cx[1][2] = $xmax-$cushionRight-$baseLongShow[1]; +$cx[1][3] = $xmax-$cushionRight-$baseShortShow[1]; $cx[1][4] = $xmax-$cushionRight; $cx[1][5] = $xmax-$cushionRight; $cx[1][6] = $xmax-$cushionRight; $cx[1][7] = $xmax-$cushionRight; -$ax[0][0] = $cx[0][0]+$baseShortShow[0]; -$ax[0][1] = $cx[0][1]; -$ax[0][2] = $cx[0][2]; -$ax[0][3] = $cx[0][3]+$baseShortShow[0]; -$ax[0][4] = $cx[0][4]-$baseShortShow[0]; -$ax[0][5] = $cx[0][5]; -$ax[0][6] = $cx[0][6]; -$ax[0][7] = $cx[0][7]-$baseShortShow[0]; - -$ay[0][0] = $cy[0][0]; -$ay[0][1] = $cy[0][1]+$baseShortShow[0]; -$ay[0][2] = $cy[0][2]-$baseShortShow[0]; -$ay[0][3] = $cy[0][3]; -$ay[0][4] = $cy[0][4]; -$ay[0][5] = $cy[0][5]-$baseShortShow[0]; -$ay[0][6] = $cy[0][6]+$baseShortShow[0]; -$ay[0][7] = $cy[0][7]; - -$ax[1][0] = $cx[1][0]+$baseShortShow[1]; -$ax[1][1] = $cx[1][1]; -$ax[1][2] = $cx[1][2]; -$ax[1][3] = $cx[1][3]+$baseShortShow[1]; -$ax[1][4] = $cx[1][4]-$baseShortShow[1]; -$ax[1][5] = $cx[1][5]; -$ax[1][6] = $cx[1][6]; -$ax[1][7] = $cx[1][7]-$baseShortShow[1]; - -$ay[1][0] = $cy[1][0]; -$ay[1][1] = $cy[1][1]+$baseShortShow[1]; -$ay[1][2] = $cy[1][2]-$baseShortShow[1]; -$ay[1][3] = $cy[1][3]; -$ay[1][4] = $cy[1][4]; -$ay[1][5] = $cy[1][5]-$baseShortShow[1]; -$ay[1][6] = $cy[1][6]+$baseShortShow[1]; -$ay[1][7] = $cy[1][7]; - -$bx[0][0] = $cx[0][0]; -$bx[0][1] = $cx[0][1]+$baseLongShow[0]; -$bx[0][2] = $cx[0][2]+$baseLongShow[0]; -$bx[0][3] = $cx[0][3]; -$bx[0][4] = $cx[0][4]; -$bx[0][5] = $cx[0][5]-$baseLongShow[0]; -$bx[0][6] = $cx[0][6]-$baseLongShow[0]; -$bx[0][7] = $cx[0][7]; - -$bx[1][0] = $cx[1][0]; -$bx[1][1] = $cx[1][1]+$baseLongShow[1]; -$bx[1][2] = $cx[1][2]+$baseLongShow[1]; -$bx[1][3] = $cx[1][3]; -$bx[1][4] = $cx[1][4]; -$bx[1][5] = $cx[1][5]-$baseLongShow[1]; -$bx[1][6] = $cx[1][6]-$baseLongShow[1]; -$bx[1][7] = $cx[1][7]; - -$by[0][0] = $cy[0][0]+$baseLongShow[0]; -$by[0][1] = $cy[0][1]; -$by[0][2] = $cy[0][2]; -$by[0][3] = $cy[0][3]-$baseLongShow[0]; -$by[0][4] = $cy[0][4]-$baseLongShow[0]; -$by[0][5] = $cy[0][5]; -$by[0][6] = $cy[0][6]; -$by[0][7] = $cy[0][7]+$baseLongShow[0]; - -$by[1][0] = $cy[1][0]+$baseLongShow[1]; -$by[1][1] = $cy[1][1]; -$by[1][2] = $cy[1][2]; -$by[1][3] = $cy[1][3]-$baseLongShow[1]; -$by[1][4] = $cy[1][4]-$baseLongShow[1]; -$by[1][5] = $cy[1][5]; -$by[1][6] = $cy[1][6]; -$by[1][7] = $cy[1][7]+$baseLongShow[1]; +$ax[0][0] = $cushionLeft+$baseShortShow[0]; +$ax[0][1] = $cushionLeft; +$ax[0][2] = $cushionLeft; +$ax[0][3] = $cushionLeft+$baseShortShow[0]; +$ax[0][4] = $cushionLeft; +$ax[0][5] = $cushionLeft+$baseLongShow[0]; +$ax[0][6] = $cushionLeft+$baseLongShow[0]; +$ax[0][7] = $cushionLeft; + +$ax[1][0] = $xmax-$cushionRight; +$ax[1][1] = $xmax-$cushionRight-$baseLongShow[1]; +$ax[1][2] = $xmax-$cushionRight-$baseLongShow[1]; +$ax[1][3] = $xmax-$cushionRight; +$ax[1][4] = $xmax-$cushionRight-$baseShortShow[1]; +$ax[1][5] = $xmax-$cushionRight; +$ax[1][6] = $xmax-$cushionRight; +$ax[1][7] = $xmax-$cushionRight-$baseShortShow[1]; + +$bx[0][0] = $cushionLeft; +$bx[0][1] = $cushionLeft+$baseLongShow[0]; +$bx[0][2] = $cushionLeft+$baseLongShow[0]; +$bx[0][3] = $cushionLeft; +$bx[0][4] = $cushionLeft+$baseShortShow[0]; +$bx[0][5] = $cushionLeft; +$bx[0][6] = $cushionLeft; +$bx[0][7] = $cushionLeft+$baseShortShow[0]; + +$bx[1][0] = $xmax-$cushionRight-$baseShortShow[1]; +$bx[1][1] = $xmax-$cushionRight; +$bx[1][2] = $xmax-$cushionRight; +$bx[1][3] = $xmax-$cushionRight-$baseShortShow[1]; +$bx[1][4] = $xmax-$cushionRight; +$bx[1][5] = $xmax-$cushionRight-$baseLongShow[1]; +$bx[1][6] = $xmax-$cushionRight-$baseLongShow[1]; +$bx[1][7] = $xmax-$cushionRight; for my $i (0..1) { - $acxShift[$i][0] = 0; - $acxShift[$i][1] = -$xLabelShift; - $acxShift[$i][2] = -$xLabelShift; - $acxShift[$i][3] = 0; - $acxShift[$i][4] = 0; - $acxShift[$i][5] = $xLabelShift; - $acxShift[$i][6] = $xLabelShift; - $acxShift[$i][7] = 0; - - $acyShift[$i][0] = -$yLabelShift; - $acyShift[$i][1] = 0; - $acyShift[$i][2] = 0; - $acyShift[$i][3] = $yLabelShift; - $acyShift[$i][4] = $yLabelShift; - $acyShift[$i][5] = 0; - $acyShift[$i][6] = 0; - $acyShift[$i][7] = -$yLabelShift; - - $bcxShift[$i][0] = -$xLabelShift; - $bcxShift[$i][1] = 0; - $bcxShift[$i][2] = 0; - $bcxShift[$i][3] = -$xLabelShift; - $bcxShift[$i][4] = $xLabelShift; - $bcxShift[$i][5] = 0; - $bcxShift[$i][6] = 0; - $bcxShift[$i][7] = $xLabelShift; - - $bcyShift[$i][0] = 0; - $bcyShift[$i][1] = -$yLabelShift; - $bcyShift[$i][2] = $yLabelShift; - $bcyShift[$i][3] = 0; - $bcyShift[$i][4] = 0; - $bcyShift[$i][5] = $yLabelShift; - $bcyShift[$i][6] = -$yLabelShift; - $bcyShift[$i][7] = 0; - - $abxPosition[$i][0] = ($ax[$i][0]+$bx[$i][0])/2+$xLabelShift; - $abxPosition[$i][1] = ($cx[$i][1]+$bx[$i][1])/2+$xLabelShift; - $abxPosition[$i][2] = ($cx[$i][2]+$bx[$i][2])/2+$xLabelShift; - $abxPosition[$i][3] = ($ax[$i][3]+$bx[$i][3])/2+$xLabelShift; - $abxPosition[$i][4] = ($ax[$i][4]+$bx[$i][4])/2-$xLabelShift; - $abxPosition[$i][5] = ($cx[$i][5]+$bx[$i][5])/2-$xLabelShift; - $abxPosition[$i][6] = ($cx[$i][6]+$bx[$i][6])/2-$xLabelShift; - $abxPosition[$i][7] = ($ax[$i][7]+$bx[$i][7])/2-$xLabelShift; - - $abyShift[$i][0] = $yLabelShift*0.5**$i; - $abyShift[$i][1] = $yLabelShift*0.5**$i; - $abyShift[$i][2] = -$yLabelShift*0.5**$i; - $abyShift[$i][3] = -$yLabelShift*0.5**$i; - $abyShift[$i][4] = -$yLabelShift*0.5**$i; - $abyShift[$i][5] = -$yLabelShift*0.5**$i; - $abyShift[$i][6] = $yLabelShift*0.5**$i; - $abyShift[$i][7] = $yLabelShift*0.5**$i; + $acxShift[$i][0] = 'center'; + $acxShift[$i][1] = 'center'; + $acxShift[$i][2] = 'center'; + $acxShift[$i][3] = 'center'; + $acxShift[$i][4] = 'center'; + $acxShift[$i][5] = 'center'; + $acxShift[$i][6] = 'center'; + $acxShift[$i][7] = 'center'; + + $acyShift[$i][0] = 'top'; + $acyShift[$i][1] = 'bottom'; + $acyShift[$i][2] = 'bottom'; + $acyShift[$i][3] = 'bottom'; + $acyShift[$i][4] = 'bottom'; + $acyShift[$i][5] = 'top'; + $acyShift[$i][6] = 'top'; + $acyShift[$i][7] = 'top'; + + $bcxShift[$i][0] = 'center'; + $bcxShift[$i][1] = 'center'; + $bcxShift[$i][2] = 'center'; + $bcxShift[$i][3] = 'center'; + $bcxShift[$i][4] = 'center'; + $bcxShift[$i][5] = 'center'; + $bcxShift[$i][6] = 'center'; + $bcxShift[$i][7] = 'center'; + + $bcyShift[$i][0] = 'bottom'; + $bcyShift[$i][1] = 'top'; + $bcyShift[$i][2] = 'bottom'; + $bcyShift[$i][3] = 'bottom'; + $bcyShift[$i][4] = 'top'; + $bcyShift[$i][5] = 'bottom'; + $bcyShift[$i][6] = 'top'; + $bcyShift[$i][7] = 'top'; + + $abxPosition[$i][0] = ($ax[$i][0]+$bx[$i][0])/2; + $abxPosition[$i][1] = ($cx[$i][1]+$bx[$i][1])/2; + $abxPosition[$i][2] = ($cx[$i][2]+$bx[$i][2])/2; + $abxPosition[$i][3] = ($ax[$i][3]+$bx[$i][3])/2; + $abxPosition[$i][4] = ($ax[$i][4]+$bx[$i][4])/2; + $abxPosition[$i][5] = ($cx[$i][5]+$bx[$i][5])/2; + $abxPosition[$i][6] = ($cx[$i][6]+$bx[$i][6])/2; + $abxPosition[$i][7] = ($ax[$i][7]+$bx[$i][7])/2; + + $abxShift[$i][0] = 'left'; + $abxShift[$i][1] = 'left'; + $abxShift[$i][2] = 'left'; + $abxShift[$i][3] = 'left'; + $abxShift[$i][4] = 'right'; + $abxShift[$i][5] = 'right'; + $abxShift[$i][6] = 'right'; + $abxShift[$i][7] = 'right'; + + $abyShift[$i][0] = 'bottom'; + $abyShift[$i][1] = 'bottom'; + $abyShift[$i][2] = 'top'; + $abyShift[$i][3] = 'top'; + $abyShift[$i][4] = 'top'; + $abyShift[$i][5] = 'top'; + $abyShift[$i][6] = 'bottom'; + $abyShift[$i][7] = 'bottom'; + + $acO[$i][0] = 'horizontal', + $acO[$i][1] = 'vertical', + $acO[$i][2] = 'vertical', + $acO[$i][3] = 'horizontal', + $acO[$i][4] = 'horizontal', + $acO[$i][5] = 'vertical', + $acO[$i][6] = 'vertical', + $acO[$i][7] = 'horizontal', + + $bcO[$i][0] = 'vertical', + $bcO[$i][1] = 'horizontal', + $bcO[$i][2] = 'horizontal', + $bcO[$i][3] = 'vertical', + $bcO[$i][4] = 'vertical', + $bcO[$i][5] = 'horizontal', + $bcO[$i][6] = 'horizontal', + $bcO[$i][7] = 'vertical', + } -$pixelsx = 320; -$pixelsy = $pixelsx*$ymax/$xmax; + + $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[$pixelsx,$pixelsy]); + pixels=>[240,240*$ymax/$xmax]); $picture->lb( new Label( - ($ax[0][$orientation[0]]+$cx[0][$orientation[0]])/2+$acxShift[0][$orientation[0]], - ($ay[0][$orientation[0]]+$cy[0][$orientation[0]])/2+$acyShift[0][$orientation[0]], - "$baseShort[0] $unit",'black','center','middle')); + ($ax[0][$orientation[0]]+$cx[0][$orientation[0]])/2, + ($ay[0][$orientation[0]]+$cy[0][$orientation[0]])/2, + "$baseShort[0] $unit",'black',$acxShift[0][$orientation[0]],$acyShift[0][$orientation[0]],'large',$acO[0][$orientation[0]])); $picture->lb( new Label( - ($bx[0][$orientation[0]]+$cx[0][$orientation[0]])/2+$bcxShift[0][$orientation[0]], - ($by[0][$orientation[0]]+$cy[0][$orientation[0]])/2+$bcyShift[0][$orientation[0]], - "$baseLong[0] $unit",'black','center','middle')); + ($bx[0][$orientation[0]]+$cx[0][$orientation[0]])/2, + ($by[0][$orientation[0]]+$cy[0][$orientation[0]])/2, + "$baseLong[0] $unit",'black',$bcxShift[0][$orientation[0]],$bcyShift[0][$orientation[0]],'large',$bcO[0][$orientation[0]])); $picture->lb( new Label( $abxPosition[0][$orientation[0]], - ($ay[0][$orientation[0]]+$by[0][$orientation[0]])/2+$abyShift[0][$orientation[0]], - "$hypotenuse[0] $unit",'black','center','middle')); + ($ay[0][$orientation[0]]+$by[0][$orientation[0]])/2, + "$hypotenuse[0] $unit",'black',$abxShift[0][$orientation[0]],$abyShift[0][$orientation[0]],'large')); $picture->lb( new Label( - ($ax[1][$orientation[1]]+$cx[1][$orientation[1]])/2+$acxShift[1][$orientation[1]], - ($ay[1][$orientation[1]]+$cy[1][$orientation[1]])/2+$acyShift[1][$orientation[1]], - "$baseShort[1] $unit",'black','center','middle')); + ($ax[1][$orientation[1]]+$cx[1][$orientation[1]])/2, + ($ay[1][$orientation[1]]+$cy[1][$orientation[1]])/2, + "x $unit",'black',$acxShift[1][$orientation[1]],$acyShift[1][$orientation[1]],'large',$acO[1][$orientation[1]])); $picture->lb( new Label( - ($bx[1][$orientation[1]]+$cx[1][$orientation[1]])/2+$bcxShift[1][$orientation[1]], - ($by[1][$orientation[1]]+$cy[1][$orientation[1]])/2+$bcyShift[1][$orientation[1]], - "x $unit",'black','center','middle')); + ($bx[1][$orientation[1]]+$cx[1][$orientation[1]])/2, + ($by[1][$orientation[1]]+$cy[1][$orientation[1]])/2, + "$baseLong[1] $unit",'black',$bcxShift[1][$orientation[1]],$bcyShift[1][$orientation[1]],'large',$bcO[1][$orientation[1]])); $picture->lb( new Label( $abxPosition[1][$orientation[1]], - ($ay[1][$orientation[1]]+$by[1][$orientation[1]])/2+$abyShift[1][$orientation[1]], - "$hypotenuse[1] $unit",'black','center','middle')); + ($ay[1][$orientation[1]]+$by[1][$orientation[1]])/2, + "$hypotenuse[1] $unit",'black',$abxShift[1][$orientation[1]],$abyShift[1][$orientation[1]],'large')); $picture->new_color("darkblue", 100,100,255); @@ -303,22 +333,22 @@ for my $i (0..1) { } -$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. Both triangles have unequal sides. For the smaller triangle, its shortest side is marked as $baseShort[1] $unit, its second shortest side is marked as x $unit, and its longest side is marked as $hypotenuse[0] $unit. For the bigger triangle, its shortest side is marked as $baseShort[0] $unit, its second shortest side is marked as $baseLong[0] $unit, and its longest side is marked as $hypotenuse[1] $unit."; +$text = "There are two triangles. The one on the right is smaller, and the one on the left is larger. Both triangles have unequal sides. For the smaller triangle, its shortest side is marked as x $unit, its second shortest side is marked as $baseLong[1] $unit, and its longest side is marked as $hypotenuse[1] $unit. For the bigger triangle, its shortest side is marked as $baseShort[0] $unit, its second shortest side is marked as $baseLong[0] $unit, and its longest side is marked as $hypotenuse[0] $unit."; -$ans = $baseLong[1]; +$ans = $baseShort[1]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML The following two triangles are similar to each other. Find the length of the missing side. ->>[@ image(insertGraph( $picture ), tex_size=>400, height=>$pixelsy, width=>$pixelsx, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< +>>[@ image(insertGraph( $picture ), tex_size=>400, width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< -[@KeyboardInstructions(q!Use [|cm|]* for centimeters.!)@]** +[@KeyboardInstructions(q!Use [|ft|]* for feet.!)@]** The missing side's length is [__________]{$ansU} @@ -326,20 +356,18 @@ END_PGML ############################################## -$s1 = $baseLong[0]*$baseShort[1]; - BEGIN_PGML_SOLUTION If two shapes are similar to each other, the lengths of their corresponding sides are in proportion. We can write an equation and solve for [`x`]: [`` \begin{aligned} - \frac{x}{[$baseLong[0]]} &= \frac{[$baseShort[1]]}{[$baseShort[0]]} \\ - \mathbf{[$baseLong[0]]\cdot[$baseShort[0]]\cdot} \frac{x}{[$baseLong[0]]} &= \mathbf{[$baseLong[0]]\cdot[$baseShort[0]]\cdot} \frac{[$baseShort[1]]}{[$baseShort[0]]} \\ - [$baseShort[0]]x &= [$baseLong[0]]\cdot[$baseShort[1]] \\ - [$baseShort[0]]x &= [$s1] \\ - \frac{[$baseShort[0]]x}{[$baseShort[0]]} &= \frac{[$s1]}{[$baseShort[0]]} \\ - x &= [$baseLong[1]] + \frac{x}{[$baseShort[0]]} &= \frac{[$baseLong[1]]}{[$baseLong[0]]} \\ + \mathbf{[$baseShort[0]]\cdot[$baseLong[0]]\cdot} \frac{x}{[$baseShort[0]]} &= \mathbf{[$baseShort[0]]\cdot[$baseLong[0]]\cdot} \frac{[$baseLong[1]]}{[$baseLong[0]]} \\ + [$baseLong[0]]x &= [$baseShort[0]]\cdot[$baseLong[1]] \\ + [$baseLong[0]]x &= [$baseShort[0]*$baseLong[1]] \\ + \frac{[$baseLong[0]]x}{[$baseLong[0]]} &= \frac{[$baseShort[0]*$baseLong[1]]}{[$baseLong[0]]} \\ + x &= [$baseShort[1]] \end{aligned} ``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles70.pg index 75256d8f70..0d7c37daff 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles70.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(Similar figures) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SimilarRightTriangles) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -309,7 +312,7 @@ $ans = $hypotenuse[1]; $ansU = NumberWithUnits("$ans $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles80.pg index e22a86f32e..29b117148e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles80.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(Similar figures) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SimilarRightTriangles) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -309,7 +312,7 @@ $ans = $hypotenuse[0]; $ansU = NumberWithUnits("$ans ft"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles90.pg index 1abc685b2c..4409e16268 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/SimilarTriangles90.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(Similar figures) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SimilarRightTriangles) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -73,20 +76,41 @@ if ($orientation[0]<=3) { do {$orientation[1] = random(4,7,1);} until ($orientation[0] != $orientation[1]); } -$cushionLeft= $baseLongShow[0]/2; -$cushionMiddle = $baseLongShow[0]/2; -$cushionRight = $baseLongShow[0]/2; -$cushionY = $baseLongShow[0]/5; +for my $i (0,1) { + $hor[$i] = ($orientation[$i] == 0 or $orientation[$i] == 3 or $orientation[$i] == 4 or $orientation[$i] == 7) ? $baseShortShow[$i] : $baseLongShow[$i]; + $ver[$i] = ($orientation[$i] == 0 or $orientation[$i] == 3 or $orientation[$i] == 4 or $orientation[$i] == 7) ? $baseLongShow[$i] : $baseShortShow[$i]; + $pxhyp[$i] = (1+length($hypotenuse[$i])+3)*8; +} + +$pxcv = ($hor[0]+$hor[1])/180; + +$cushionLeft= $pxcv*15; +$cushionMiddle = $pxcv*30; +$cushionRight = $pxcv*17; +$cushionY = $pxcv*17; + + +if ($orientation[0] == 4 or $orientation[0] == 7){ + $cushionLeft = max($pxcv*15, $pxcv*$pxhyp[0]-$baseShortShow[0]/2); +} + +if ($orientation[0] == 45 or $orientation[0] == 6){ + $cushionLeft = max($pxcv*15, $pxcv*$pxhyp[0]-$baseLongShow[0]/2); +} + +if ($orientation[1] == 0 or $orientation[1] == 3){ + $cushionRight = max($pxcv*15, $pxcv*$pxhyp[1]-$baseShortShow[1]/2); +} + +if ($orientation[1] == 1 or $orientation[1] == 2){ + $cushionRight = max($pxcv*15, $pxcv*$pxhyp[1]-$baseLongShow[1]/2); +} $xmin = 0; -$xmax = $baseLongShow[0]+$baseLongShow[1]+$cushionLeft+$cushionMiddle+$cushionRight; +$xmax = $hor[0]+$hor[1]+$cushionLeft+$cushionMiddle+$cushionRight; $ymin = 0; -$ymax = $baseLongShow[0]+2*$cushionY; +$ymax = max($ver[0],$ver[1])+2*$cushionY; -$xLabelShift = $xmax/13; -$yLabelShift = $ymax/15; - -@cx = (); @cy = (); @ax = (); @ay = (); @@ -97,15 +121,37 @@ $yLabelShift = $ymax/15; @bcxShift = (); @bcyShift = (); -$cy[0][0] = $cushionY; -$cy[0][1] = $ymax/2-$baseShortShow[0]/2; -$cy[0][2] = $ymax/2+$baseShortShow[0]/2; -$cy[0][3] = $cushionY+$baseLongShow[0]; -$cy[0][4] = $cy[0][3]; -$cy[0][5] = $cy[0][2]; -$cy[0][6] = $cy[0][1]; -$cy[0][7] = $cy[0][0]; +for my $i (0,1) { + +$ay[$i][0] = $cushionY; +$ay[$i][1] = $cushionY + $baseShortShow[$i]; +$ay[$i][2] = $cushionY; +$ay[$i][3] = $cushionY + $baseLongShow[$i]; +$ay[$i][4] = $cushionY + $baseLongShow[$i]; +$ay[$i][5] = $cushionY; +$ay[$i][6] = $cushionY + $baseShortShow[$i]; +$ay[$i][7] = $cushionY; + +$by[$i][0] = $cushionY + $baseLongShow[$i]; +$by[$i][1] = $cushionY; +$by[$i][2] = $cushionY + $baseShortShow[$i]; +$by[$i][3] = $cushionY; +$by[$i][4] = $cushionY; +$by[$i][5] = $cushionY + $baseShortShow[$i]; +$by[$i][6] = $cushionY; +$by[$i][7] = $cushionY + $baseLongShow[$i]; + +$cy[$i][0] = $cushionY; +$cy[$i][1] = $cushionY; +$cy[$i][2] = $cushionY + $baseShortShow[$i]; +$cy[$i][3] = $cushionY + $baseLongShow[$i]; +$cy[$i][4] = $cushionY + $baseLongShow[$i]; +$cy[$i][5] = $cushionY + $baseShortShow[$i]; +$cy[$i][6] = $cushionY; +$cy[$i][7] = $cushionY; +} +$cx[0][0] = $cushionLeft; $cx[0][0] = $cushionLeft; $cx[0][1] = $cushionLeft; $cx[0][2] = $cushionLeft; @@ -115,182 +161,165 @@ $cx[0][5] = $cushionLeft+$baseLongShow[0]; $cx[0][6] = $cushionLeft+$baseLongShow[0]; $cx[0][7] = $cushionLeft+$baseShortShow[0]; -$cy[1][0] = $ymax/2-$baseLongShow[1]/2; -$cy[1][1] = $ymax/2-$baseShortShow[1]/2; -$cy[1][2] = $ymax/2+$baseShortShow[1]/2; -$cy[1][3] = $ymax/2+$baseLongShow[1]/2; -$cy[1][4] = $cy[1][3]; -$cy[1][5] = $cy[1][2]; -$cy[1][6] = $cy[1][1]; -$cy[1][7] = $cy[1][0]; - -$cx[1][0] = $cushionLeft+$baseLongShow[0]+$cushionMiddle+($baseLongShow[1]+$cushionRight)/2-$baseShortShow[1]/2; -$cx[1][1] = $cushionLeft+$baseLongShow[0]+$cushionMiddle; -$cx[1][2] = $cx[1][1]; -$cx[1][3] = $cx[1][0]; +$cx[1][0] = $xmax-$cushionRight-$baseShortShow[1]; +$cx[1][1] = $xmax-$cushionRight-$baseLongShow[1]; +$cx[1][2] = $xmax-$cushionRight-$baseLongShow[1]; +$cx[1][3] = $xmax-$cushionRight-$baseShortShow[1]; $cx[1][4] = $xmax-$cushionRight; $cx[1][5] = $xmax-$cushionRight; $cx[1][6] = $xmax-$cushionRight; $cx[1][7] = $xmax-$cushionRight; -$ax[0][0] = $cx[0][0]+$baseShortShow[0]; -$ax[0][1] = $cx[0][1]; -$ax[0][2] = $cx[0][2]; -$ax[0][3] = $cx[0][3]+$baseShortShow[0]; -$ax[0][4] = $cx[0][4]-$baseShortShow[0]; -$ax[0][5] = $cx[0][5]; -$ax[0][6] = $cx[0][6]; -$ax[0][7] = $cx[0][7]-$baseShortShow[0]; - -$ay[0][0] = $cy[0][0]; -$ay[0][1] = $cy[0][1]+$baseShortShow[0]; -$ay[0][2] = $cy[0][2]-$baseShortShow[0]; -$ay[0][3] = $cy[0][3]; -$ay[0][4] = $cy[0][4]; -$ay[0][5] = $cy[0][5]-$baseShortShow[0]; -$ay[0][6] = $cy[0][6]+$baseShortShow[0]; -$ay[0][7] = $cy[0][7]; - -$ax[1][0] = $cx[1][0]+$baseShortShow[1]; -$ax[1][1] = $cx[1][1]; -$ax[1][2] = $cx[1][2]; -$ax[1][3] = $cx[1][3]+$baseShortShow[1]; -$ax[1][4] = $cx[1][4]-$baseShortShow[1]; -$ax[1][5] = $cx[1][5]; -$ax[1][6] = $cx[1][6]; -$ax[1][7] = $cx[1][7]-$baseShortShow[1]; - -$ay[1][0] = $cy[1][0]; -$ay[1][1] = $cy[1][1]+$baseShortShow[1]; -$ay[1][2] = $cy[1][2]-$baseShortShow[1]; -$ay[1][3] = $cy[1][3]; -$ay[1][4] = $cy[1][4]; -$ay[1][5] = $cy[1][5]-$baseShortShow[1]; -$ay[1][6] = $cy[1][6]+$baseShortShow[1]; -$ay[1][7] = $cy[1][7]; - -$bx[0][0] = $cx[0][0]; -$bx[0][1] = $cx[0][1]+$baseLongShow[0]; -$bx[0][2] = $cx[0][2]+$baseLongShow[0]; -$bx[0][3] = $cx[0][3]; -$bx[0][4] = $cx[0][4]; -$bx[0][5] = $cx[0][5]-$baseLongShow[0]; -$bx[0][6] = $cx[0][6]-$baseLongShow[0]; -$bx[0][7] = $cx[0][7]; - -$bx[1][0] = $cx[1][0]; -$bx[1][1] = $cx[1][1]+$baseLongShow[1]; -$bx[1][2] = $cx[1][2]+$baseLongShow[1]; -$bx[1][3] = $cx[1][3]; -$bx[1][4] = $cx[1][4]; -$bx[1][5] = $cx[1][5]-$baseLongShow[1]; -$bx[1][6] = $cx[1][6]-$baseLongShow[1]; -$bx[1][7] = $cx[1][7]; - -$by[0][0] = $cy[0][0]+$baseLongShow[0]; -$by[0][1] = $cy[0][1]; -$by[0][2] = $cy[0][2]; -$by[0][3] = $cy[0][3]-$baseLongShow[0]; -$by[0][4] = $cy[0][4]-$baseLongShow[0]; -$by[0][5] = $cy[0][5]; -$by[0][6] = $cy[0][6]; -$by[0][7] = $cy[0][7]+$baseLongShow[0]; - -$by[1][0] = $cy[1][0]+$baseLongShow[1]; -$by[1][1] = $cy[1][1]; -$by[1][2] = $cy[1][2]; -$by[1][3] = $cy[1][3]-$baseLongShow[1]; -$by[1][4] = $cy[1][4]-$baseLongShow[1]; -$by[1][5] = $cy[1][5]; -$by[1][6] = $cy[1][6]; -$by[1][7] = $cy[1][7]+$baseLongShow[1]; +$ax[0][0] = $cushionLeft+$baseShortShow[0]; +$ax[0][1] = $cushionLeft; +$ax[0][2] = $cushionLeft; +$ax[0][3] = $cushionLeft+$baseShortShow[0]; +$ax[0][4] = $cushionLeft; +$ax[0][5] = $cushionLeft+$baseLongShow[0]; +$ax[0][6] = $cushionLeft+$baseLongShow[0]; +$ax[0][7] = $cushionLeft; + +$ax[1][0] = $xmax-$cushionRight; +$ax[1][1] = $xmax-$cushionRight-$baseLongShow[1]; +$ax[1][2] = $xmax-$cushionRight-$baseLongShow[1]; +$ax[1][3] = $xmax-$cushionRight; +$ax[1][4] = $xmax-$cushionRight-$baseShortShow[1]; +$ax[1][5] = $xmax-$cushionRight; +$ax[1][6] = $xmax-$cushionRight; +$ax[1][7] = $xmax-$cushionRight-$baseShortShow[1]; + +$bx[0][0] = $cushionLeft; +$bx[0][1] = $cushionLeft+$baseLongShow[0]; +$bx[0][2] = $cushionLeft+$baseLongShow[0]; +$bx[0][3] = $cushionLeft; +$bx[0][4] = $cushionLeft+$baseShortShow[0]; +$bx[0][5] = $cushionLeft; +$bx[0][6] = $cushionLeft; +$bx[0][7] = $cushionLeft+$baseShortShow[0]; + +$bx[1][0] = $xmax-$cushionRight-$baseShortShow[1]; +$bx[1][1] = $xmax-$cushionRight; +$bx[1][2] = $xmax-$cushionRight; +$bx[1][3] = $xmax-$cushionRight-$baseShortShow[1]; +$bx[1][4] = $xmax-$cushionRight; +$bx[1][5] = $xmax-$cushionRight-$baseLongShow[1]; +$bx[1][6] = $xmax-$cushionRight-$baseLongShow[1]; +$bx[1][7] = $xmax-$cushionRight; for my $i (0..1) { - $acxShift[$i][0] = 0; - $acxShift[$i][1] = -$xLabelShift; - $acxShift[$i][2] = -$xLabelShift; - $acxShift[$i][3] = 0; - $acxShift[$i][4] = 0; - $acxShift[$i][5] = $xLabelShift; - $acxShift[$i][6] = $xLabelShift; - $acxShift[$i][7] = 0; - - $acyShift[$i][0] = -$yLabelShift; - $acyShift[$i][1] = 0; - $acyShift[$i][2] = 0; - $acyShift[$i][3] = $yLabelShift; - $acyShift[$i][4] = $yLabelShift; - $acyShift[$i][5] = 0; - $acyShift[$i][6] = 0; - $acyShift[$i][7] = -$yLabelShift; - - $bcxShift[$i][0] = -$xLabelShift; - $bcxShift[$i][1] = 0; - $bcxShift[$i][2] = 0; - $bcxShift[$i][3] = -$xLabelShift; - $bcxShift[$i][4] = $xLabelShift; - $bcxShift[$i][5] = 0; - $bcxShift[$i][6] = 0; - $bcxShift[$i][7] = $xLabelShift; - - $bcyShift[$i][0] = 0; - $bcyShift[$i][1] = -$yLabelShift; - $bcyShift[$i][2] = $yLabelShift; - $bcyShift[$i][3] = 0; - $bcyShift[$i][4] = 0; - $bcyShift[$i][5] = $yLabelShift; - $bcyShift[$i][6] = -$yLabelShift; - $bcyShift[$i][7] = 0; - - $abxPosition[$i][0] = ($ax[$i][0]+$bx[$i][0])/2+$xLabelShift; - $abxPosition[$i][1] = ($cx[$i][1]+$bx[$i][1])/2+$xLabelShift; - $abxPosition[$i][2] = ($cx[$i][2]+$bx[$i][2])/2+$xLabelShift; - $abxPosition[$i][3] = ($ax[$i][3]+$bx[$i][3])/2+$xLabelShift; - $abxPosition[$i][4] = ($ax[$i][4]+$bx[$i][4])/2-$xLabelShift; - $abxPosition[$i][5] = ($cx[$i][5]+$bx[$i][5])/2-$xLabelShift; - $abxPosition[$i][6] = ($cx[$i][6]+$bx[$i][6])/2-$xLabelShift; - $abxPosition[$i][7] = ($ax[$i][7]+$bx[$i][7])/2-$xLabelShift; - - $abyShift[$i][0] = $yLabelShift*0.5**$i; - $abyShift[$i][1] = $yLabelShift*0.5**$i; - $abyShift[$i][2] = -$yLabelShift*0.5**$i; - $abyShift[$i][3] = -$yLabelShift*0.5**$i; - $abyShift[$i][4] = -$yLabelShift*0.5**$i; - $abyShift[$i][5] = -$yLabelShift*0.5**$i; - $abyShift[$i][6] = $yLabelShift*0.5**$i; - $abyShift[$i][7] = $yLabelShift*0.5**$i; -} + $acxShift[$i][0] = 'center'; + $acxShift[$i][1] = 'center'; + $acxShift[$i][2] = 'center'; + $acxShift[$i][3] = 'center'; + $acxShift[$i][4] = 'center'; + $acxShift[$i][5] = 'center'; + $acxShift[$i][6] = 'center'; + $acxShift[$i][7] = 'center'; + + $acyShift[$i][0] = 'top'; + $acyShift[$i][1] = 'bottom'; + $acyShift[$i][2] = 'bottom'; + $acyShift[$i][3] = 'bottom'; + $acyShift[$i][4] = 'bottom'; + $acyShift[$i][5] = 'top'; + $acyShift[$i][6] = 'top'; + $acyShift[$i][7] = 'top'; + + $bcxShift[$i][0] = 'center'; + $bcxShift[$i][1] = 'center'; + $bcxShift[$i][2] = 'center'; + $bcxShift[$i][3] = 'center'; + $bcxShift[$i][4] = 'center'; + $bcxShift[$i][5] = 'center'; + $bcxShift[$i][6] = 'center'; + $bcxShift[$i][7] = 'center'; + + $bcyShift[$i][0] = 'bottom'; + $bcyShift[$i][1] = 'top'; + $bcyShift[$i][2] = 'bottom'; + $bcyShift[$i][3] = 'bottom'; + $bcyShift[$i][4] = 'top'; + $bcyShift[$i][5] = 'bottom'; + $bcyShift[$i][6] = 'top'; + $bcyShift[$i][7] = 'top'; + + $abxPosition[$i][0] = ($ax[$i][0]+$bx[$i][0])/2; + $abxPosition[$i][1] = ($cx[$i][1]+$bx[$i][1])/2; + $abxPosition[$i][2] = ($cx[$i][2]+$bx[$i][2])/2; + $abxPosition[$i][3] = ($ax[$i][3]+$bx[$i][3])/2; + $abxPosition[$i][4] = ($ax[$i][4]+$bx[$i][4])/2; + $abxPosition[$i][5] = ($cx[$i][5]+$bx[$i][5])/2; + $abxPosition[$i][6] = ($cx[$i][6]+$bx[$i][6])/2; + $abxPosition[$i][7] = ($ax[$i][7]+$bx[$i][7])/2; + + $abxShift[$i][0] = 'left'; + $abxShift[$i][1] = 'left'; + $abxShift[$i][2] = 'left'; + $abxShift[$i][3] = 'left'; + $abxShift[$i][4] = 'right'; + $abxShift[$i][5] = 'right'; + $abxShift[$i][6] = 'right'; + $abxShift[$i][7] = 'right'; + + $abyShift[$i][0] = 'bottom'; + $abyShift[$i][1] = 'bottom'; + $abyShift[$i][2] = 'top'; + $abyShift[$i][3] = 'top'; + $abyShift[$i][4] = 'top'; + $abyShift[$i][5] = 'top'; + $abyShift[$i][6] = 'bottom'; + $abyShift[$i][7] = 'bottom'; + + $acO[$i][0] = 'horizontal', + $acO[$i][1] = 'vertical', + $acO[$i][2] = 'vertical', + $acO[$i][3] = 'horizontal', + $acO[$i][4] = 'horizontal', + $acO[$i][5] = 'vertical', + $acO[$i][6] = 'vertical', + $acO[$i][7] = 'horizontal', + + $bcO[$i][0] = 'vertical', + $bcO[$i][1] = 'horizontal', + $bcO[$i][2] = 'horizontal', + $bcO[$i][3] = 'vertical', + $bcO[$i][4] = 'vertical', + $bcO[$i][5] = 'horizontal', + $bcO[$i][6] = 'horizontal', + $bcO[$i][7] = 'vertical', + +}; + -$pixelsx = 320; -$pixelsy = $pixelsx*$ymax/$xmax; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[$pixelsx,$pixelsy]); - -$picture->lb( new Label( - ($ax[0][$orientation[0]]+$cx[0][$orientation[0]])/2+$acxShift[0][$orientation[0]], - ($ay[0][$orientation[0]]+$cy[0][$orientation[0]])/2+$acyShift[0][$orientation[0]], - "$baseShort[0] $unit",'black','center','middle')); -$picture->lb( new Label( - ($bx[0][$orientation[0]]+$cx[0][$orientation[0]])/2+$bcxShift[0][$orientation[0]], - ($by[0][$orientation[0]]+$cy[0][$orientation[0]])/2+$bcyShift[0][$orientation[0]], - "$baseLong[0] $unit",'black','center','middle')); -$picture->lb( new Label( - $abxPosition[0][$orientation[0]], - ($ay[0][$orientation[0]]+$by[0][$orientation[0]])/2+$abyShift[0][$orientation[0]], - "x $unit",'black','center','middle')); - -$picture->lb( new Label( - ($ax[1][$orientation[1]]+$cx[1][$orientation[1]])/2+$acxShift[1][$orientation[1]], - ($ay[1][$orientation[1]]+$cy[1][$orientation[1]])/2+$acyShift[1][$orientation[1]], - "y $unit",'black','center','middle')); -$picture->lb( new Label( - ($bx[1][$orientation[1]]+$cx[1][$orientation[1]])/2+$bcxShift[1][$orientation[1]], - ($by[1][$orientation[1]]+$cy[1][$orientation[1]])/2+$bcyShift[1][$orientation[1]], - "$baseLong[1] $unit",'black','center','middle')); -$picture->lb( new Label( - $abxPosition[1][$orientation[1]], - ($ay[1][$orientation[1]]+$by[1][$orientation[1]])/2+$abyShift[1][$orientation[1]], - "$hypotenuse[1] $unit",'black','center','middle')); + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( + ($ax[0][$orientation[0]]+$cx[0][$orientation[0]])/2, + ($ay[0][$orientation[0]]+$cy[0][$orientation[0]])/2, + "$baseShort[0] $unit",'black',$acxShift[0][$orientation[0]],$acyShift[0][$orientation[0]],'large',$acO[0][$orientation[0]])); +$picture->lb( new Label( + ($bx[0][$orientation[0]]+$cx[0][$orientation[0]])/2, + ($by[0][$orientation[0]]+$cy[0][$orientation[0]])/2, + "$baseLong[0] $unit",'black',$bcxShift[0][$orientation[0]],$bcyShift[0][$orientation[0]],'large',$bcO[0][$orientation[0]])); +$picture->lb( new Label( + $abxPosition[0][$orientation[0]], + ($ay[0][$orientation[0]]+$by[0][$orientation[0]])/2, + "x $unit",'black',$abxShift[0][$orientation[0]],$abyShift[0][$orientation[0]],'large')); + +$picture->lb( new Label( + ($ax[1][$orientation[1]]+$cx[1][$orientation[1]])/2, + ($ay[1][$orientation[1]]+$cy[1][$orientation[1]])/2, + "y $unit",'black',$acxShift[1][$orientation[1]],$acyShift[1][$orientation[1]],'large',$acO[1][$orientation[1]])); +$picture->lb( new Label( + ($bx[1][$orientation[1]]+$cx[1][$orientation[1]])/2, + ($by[1][$orientation[1]]+$cy[1][$orientation[1]])/2, + "$baseLong[1] $unit",'black',$bcxShift[1][$orientation[1]],$bcyShift[1][$orientation[1]],'large',$bcO[1][$orientation[1]])); +$picture->lb( new Label( + $abxPosition[1][$orientation[1]], + ($ay[1][$orientation[1]]+$by[1][$orientation[1]])/2, + "$hypotenuse[1] $unit",'black',$abxShift[1][$orientation[1]],$abyShift[1][$orientation[1]],'large')); + $picture->new_color("darkblue", 100,100,255); @@ -312,20 +341,18 @@ $ans1 = $baseShort[1]; $ans1U = NumberWithUnits("$ans1 $unit"); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -The following two triangles are similar to each other. Find the length of the missing sides. +The following two triangles are similar to each other. Find the length of the missing side. ->>[@ image(insertGraph( $picture ), tex_size=>400, height=>$pixelsy, width=>$pixelsx, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< +>>[@ image(insertGraph( $picture ), tex_size=>400, width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< [@KeyboardInstructions(q!Use [|ft|]* for feet.!)@]** -The first missing side's length is [`x=`][__________]{$ans0U}. - -The second missing side's length is [`y=`][__________]{$ans1U}. +The length of the side labeled [`x`] is [__________]{$ans0U} and the length of the side labeled [`y`] is [__________]{$ans1U}. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/Trapezoid10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/Trapezoid10.pg new file mode 100644 index 0000000000..cbd4613c14 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/Trapezoid10.pg @@ -0,0 +1,111 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context("Numeric"); + + +$unit = "cm"; + +$base1 = random(10,18,1); +$base2 = random(5,$base1-1,1); +$height = random(5,15,1); +$x1 = random(1,$base1-$base2,1); + +$xmin = 0; #The viewing window +$xmax = $base1*1.3; +$ymin = 0; +$ymax = $xmax*$height/$base1; + +$base1U = NumberWithUnits("$base1 $unit"); +$base2U = NumberWithUnits("$base2 $unit"); +$heightU = NumberWithUnits("$height $unit"); + +@x = (($xmax-$base1)/2,($xmax-$base1)/2+$x1,($xmax-$base1)/2+$base2,($xmax+$base1)/2); +@y = (($ymax-$height)/2,($ymax+$height)/2); + +$cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/5; + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[282,282*$height/$base1]); + +$picture->lb( new Label(($x[0]+$x[3])/2, $y[0]-0.5,"$base1U",'black','center','middle')); +$picture->lb( new Label(($x[1]+$x[2])/2, $y[1]+0.5,"$base2U",'black','center','middle')); +$picture->lb( new Label($x[1]+0.5,($y[0]+$y[1])/2,"$heightU",'black','left','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[3],$y[0], darkblue,3); +$picture->lineTo($x[2],$y[1], darkblue,3); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$picture->moveTo($x[1],$y[1]); +$picture->lineTo($x[1],$y[0], black,1,dashed); + +$picture->moveTo($x[1],$y[0]+$cornersize); +$picture->lineTo($x[1]+$cornersize,$y[0]+$cornersize, black,3); +$picture->lineTo($x[1]+$cornersize,$y[0], black,3); + +$alt = "a trapezoid with a bottom base of $base1U, a top base of $base2U, and a height of $heightU"; + +$area = ($base1+$base2)*$height/2; +$ansA = NumberWithUnits("$area $unit^2"); + +############################################################ +# Body +############################################################ + +BEGIN_PGML +Find the area of the traepzoid. + +>> [@image(insertGraph($picture), width=>600, extra_html_tags => "alt = '$alt' title = '$alt' ")@]* << + +Its area is [________]{$ansA}. + +(Use [`\text{cm}`] for centimeters and [`\text{cm}^2`] for square centimeters.) + +END_PGML + +############################################################ +# Solution +############################################################ + +BEGIN_PGML_SOLUTION +A trapezoid's area can be calculated by this formula: + +>> [``\newcommand{\amp}{&}\begin{aligned} +\text{trapezoid area}\amp= \frac{1}{2}(\text{base1}+\text{base2})\cdot\text{height}\\ + \amp= \frac{1}{2}([$base1U]+[$base2U])([$heightU])\\ +\amp = [$ansA] +\end{aligned}``] << + +END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea10.pg new file mode 100644 index 0000000000..a2e530229a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea10.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find the perimeter and area of a triangle. +# +# Last edited by Jordan 8/29/13; Carl Yao on 7/17/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$base = random(15,25,1); +$height = random(8,14,1); +$xcross = $base/random(2.5,4,0.1); +$leftSide = round(sqrt($height**2+$xcross**2)); +$rightSide = round(sqrt($height**2+($base-$xcross)**2)); + +$xmin = 0; #The viewing window +$xmax = $base*240/200; +$ymin = 0; +$ymax = (200*$height/$base+30)*$height/(200*$height/$base); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +@x = (($xmax-$base)/2,($xmax+$base)/2); +@y = (($ymax-$height)/2,($ymax+$height)/2); + +$cornersize = $xmax*10/240; + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$height/$base]); + +$xTop = $x[0]+$xcross; + +$picture->lb( new Label($xTop, $y[0],"$base ft",'black','center','top','large')); +$picture->lb( new Label($xTop,($y[0]+$y[1])/2,"$height ft",'black','center','middle','large')); +$picture->lb( new Label(($x[0]+$xTop)/2-$xLabelShift, ($y[0]+$y[1])/2,"$leftSide ft",'black','right','middle','large')); +$picture->lb( new Label(($xTop+$x[1])/2+2*$xLabelShift,($y[0]+$y[1])/2,"$rightSide ft",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($xTop,$y[0]); +$picture->lineTo($x[1],$y[0], darkblue,3); +$picture->lineTo($xTop,$y[1], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); +$picture->lineTo($xTop,$y[0], darkblue,3); + +$picture->moveTo($xTop,$y[1]); +$picture->lineTo($xTop,$y[0], darkblue,1,"dashed"); + +$picture->moveTo($xTop,$y[0]+$cornersize); +$picture->lineTo($xTop+$cornersize,$y[0]+$cornersize, darkblue,1); +$picture->lineTo($xTop+$cornersize,$y[0], darkblue,1); + +$perimeter = $base + $leftSide + $rightSide; +$area = $base*$height/2; +$ansP = NumberWithUnits("$perimeter ft"); +$ansA = NumberWithUnits("$area ft^2"); + + + +############################################## + +TEXT(beginproblem()); + +$text = "a triangle with one side parallel to the ground; this side is $base ft long; the left side is $leftSide ft long; the right side is $rightSide ft long; the height is $height ft"; + +BEGIN_TEXT + +Find the perimeter and area of the triangle.$PAR + +$BCENTER +\{ image(insertGraph( $picture ), width=>240, extra_html_tags => 'alt = "$text" title = "$text" ') \} +$ECENTER +$PAR +END_TEXT +BEGIN_PGML + + Its perimeter is [_]{$ansP}{5} and its area is [_]{$ansA}{5}. + +[@KeyboardInstructions(q!(Use [|ft|]* for feet and [|ft^2|]* for square feet.)!)@]** + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the perimeter of a triangle, we simply add up the length of its 3 sides: + +[``\begin{aligned}[t] + \text{triangle perimeter} &= [$base] + [$leftSide] + [$rightSide]\\ + & =[$ansP] + \end{aligned}``] + +Don't forget the length unit [`\textrm{ft}`]. +---- +A triangle's area formula is: + + [`` \text{triangle area} = \frac{1}{2} \cdot \text{base} \cdot \text{height} ``] + +Using this formula, we have: + +[``\begin{aligned}[t] + \text{triangle area} &= \frac{1}{2} \cdot \text{base} \cdot \text{height}\\ + & =\frac{1}{2} \cdot [$base] \cdot [$height] \\ + & =[$ansA] + \end{aligned}``] + +Don't forget the area unit [`\textrm{ft}^{2}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea20.pg index bcb4be5860..291333717a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea20.pg @@ -7,27 +7,31 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -39,14 +43,14 @@ Context("Numeric"); $a = random(0,4,1); $factor = random(1,3,0.5); -$base = $factor*$ar_triples[$a][0]; -$height = $factor*$ar_triples[$a][1]; +$base = $factor*$ar_triples[$a][1]; +$height = $factor*$ar_triples[$a][0]; $hypotenuse = $factor*$ar_triples[$a][2]; $xmin = 0; #The viewing window -$xmax = 5*(int($height/5)+2); +$xmax = $base*240/210; $ymin = 0; -$ymax = $xmax; +$ymax = (210*$height/$base+30)*$height/(210*$height/$base); $xLabelShift = $xmax/40; $yLabelShift = $ymax/40; @@ -54,14 +58,14 @@ $yLabelShift = $ymax/40; @x = (($xmax-$base)/2-$xLabelShift,($xmax+$base)/2-2*$xLabelShift); @y = (($ymax-$height)/2,($ymax+$height)/2); -$cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/10; +$cornersize = $xmax*10/240; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[240,240*$ymax/$xmax]); -$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-$yLabelShift,"$base cm",'black','center','middle')); -$picture->lb( new Label($x[1]+$xLabelShift,($y[0]+$y[1])/2,"$height cm",'black','left','middle')); -$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift, ($y[0]+$y[1])/2,"$hypotenuse cm",'black','right','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0],"$base cm",'black','center','top','large')); +$picture->lb( new Label($x[1],($y[0]+$y[1])/2,"$height cm",'black','center','bottom','large','vertical')); +$picture->lb( new Label(($x[0]+$x[1])/2, ($y[0]+$y[1])/2,"$hypotenuse cm",'black','right','bottom','large')); $picture->new_color("darkblue", 100,100,255); @@ -71,8 +75,8 @@ $picture->lineTo($x[1],$y[1], darkblue,3); $picture->lineTo($x[0],$y[0], darkblue,3); $picture->moveTo($x[1],$y[0]+$cornersize); -$picture->lineTo($x[1]-$cornersize,$y[0]+$cornersize, darkblue,3); -$picture->lineTo($x[1]-$cornersize,$y[0], darkblue,3); +$picture->lineTo($x[1]-$cornersize,$y[0]+$cornersize, darkblue,1); +$picture->lineTo($x[1]-$cornersize,$y[0], darkblue,1); $perimeter = $base + $height + $hypotenuse; $area = $base*$height/2; @@ -80,7 +84,7 @@ $ansP = NumberWithUnits("$perimeter cm"); $ansA = NumberWithUnits("$area cm^2"); ############################################## -$refreshCachedImages=1; + TEXT(beginproblem()); $text = "a right triangle with legs of lengths $base cm and $height cm, and hypotenuse of length $hypotenuse cm"; @@ -90,16 +94,16 @@ BEGIN_TEXT Find the perimeter and area of the right triangle.$PAR $BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "$text" title = "$text"') \} +\{ image(insertGraph( $picture ), width=>240, extra_html_tags => 'alt = "$text" title = "$text"') \} $ECENTER $PAR END_TEXT BEGIN_PGML - Its perimeter is [_____________]{$ansP} and its area is [_____________]{$ansA}. + Its perimeter is [_]{$ansP}{5} and its area is [_]{$ansA}{5}. -(Use *cm* for centimeters and *cm[$CARET]2* for square centimeters.) +[@KeyboardInstructions(q!(Use [|cm|]* for centimeters and [|cm^2|]* for square centimeters.)!)@]** END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea30.pg index 93f1fc6447..081ff08c30 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea30.pg @@ -7,61 +7,64 @@ # # ENDDESCRIPTION -## DBCCSS('6.G.1') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Area) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## Context("Numeric"); -$xmin = 0; #The viewing window -$xmax = 40; -$ymin = 0; -$ymax = 40; - -$xLabelShift = $xmax/40; -$yLabelShift = $ymax/40; - -$height = random(20,30,1); -$rightSide = $height + random(2,4,1); -$bigbase = round(sqrt($rightSide**2 - $height**2))+random(10,15,1); +do { + $height = random(10,30,1); + $rightSide = $height + random(2,4,1); + $bigbase = round(sqrt($rightSide**2 - $height**2))+random(10,15,1); +} until ($bigbase > $height); $base = $bigbase - round(sqrt($rightSide**2 - $height**2)); $leftSide = round(sqrt($bigbase**2 + $height**2)); -@x = (($xmax-2*$base)/2,($xmax+2*$base)/2); +$xmin = 0; #The viewing window +$xmax = $bigbase*240/210; +$ymin = 0; +$ymax = (210*$height/$bigbase+30)*$height/(210*$height/$bigbase); + +@x = ($xmax/2-$bigbase/2,$xmax/2-$bigbase/2+$base); @y = (($ymax-$height)/2,($ymax+$height)/2); -$cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/10; +$cornersize = $xmax*10/240; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[240,240*$ymax/$xmax]); $xTop = $x[0]+$bigbase; -$picture->lb( new Label($x[0]+$base/2, $y[0]-$yLabelShift,"$base m",'black','center','middle')); -$picture->lb( new Label($xTop+$xLabelShift,($y[0]+$y[1])/2,"$height m",'black','left','middle')); -$picture->lb( new Label($x[0]+1.5*$base, ($y[0]+$y[1])/2,"$rightSide m",'black','center','middle')); -$picture->lb( new Label($x[0]+0.5*$base,($y[0]+$y[1])/2,"$leftSide m",'black','left','middle')); +$picture->lb( new Label($x[0]+$base/2, $y[0],"$base m",'black','center','top','large')); +$picture->lb( new Label($xTop,($y[0]+$y[1])/2,"$height m",'black','center','bottom','large','vertical')); +$picture->lb( new Label(($x[1]+$xTop)/2,($y[0]+$y[1])/2,"$rightSide m",'black','right','middle','large')); +$picture->lb( new Label(($x[0]+$xTop)/2,($y[0]+$y[1])/2,"$leftSide m",'black','right','bottom','large')); $picture->new_color("darkblue", 100,100,255); @@ -73,8 +76,8 @@ $picture->lineTo($x[0],$y[0], darkblue,3); $picture->lineTo($x[0]+$base,$y[0], darkblue,3); $picture->moveTo($x[0]+$bigbase,$y[0]+$cornersize); -$picture->lineTo($x[0]+$bigbase-$cornersize,$y[0]+$cornersize, darkblue,3); -$picture->lineTo($x[0]+$bigbase-$cornersize,$y[0], darkblue,3); +$picture->lineTo($x[0]+$bigbase-$cornersize,$y[0]+$cornersize, darkblue,1); +$picture->lineTo($x[0]+$bigbase-$cornersize,$y[0], darkblue,1); $perimeter = $base + $leftSide + $rightSide; $area = $base*$height/2; @@ -86,7 +89,7 @@ $ansA = NumberWithUnits($area,"m^2"); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + $text = "an obtuse triangle with legs of lengths $base m, $rightSide m, and $leftSide m; its height perpendicular to the side of length $base m is $height m"; @@ -95,15 +98,15 @@ BEGIN_TEXT Find the perimeter and area of the triangle.$PAR $BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "$text" title = "$text"') \} +\{ image(insertGraph( $picture ), width=>240, extra_html_tags => 'alt = "$text" title = "$text"') \} $ECENTER $PAR END_TEXT BEGIN_PGML - Its perimeter is [_____________]{$ansP} and its area is [_____________]{$ansA}. + Its perimeter is [_]{$ansP}{5} and its area is [_]{$ansA}{5}. -(Use *m* for meters and *m[$CARET]2* for square meters.) +[@KeyboardInstructions(q!(Use [|m|]* for meters and [|m^2|]* for square meters.)!)@]** END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea40.pg new file mode 100644 index 0000000000..01ddb51665 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Geometry/TrianglePerimeterArea40.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given area and base of a triangle, find its height. +# +# Last edited by Carl Yao on 7/17/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('area','triangle') +## DBCCSS('7.EE.4','6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$base = random(21,31,2); +$baseU = NumberWithUnits("$base m"); +$height = random(11,19,2); +$heightU = NumberWithUnits("$height m"); +$area = $base*$height/2; +$areaU = NumberWithUnits("$area m^2"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A triangle's area is [`[$areaU]`]. Its base is [`[$baseU]`]. + + Its height is [_____________]{$heightU}. + + +END_PGML + +############################################## + +$s1 = 2*$area; + +BEGIN_PGML_SOLUTION + +Let [`A`] represent a triangle's area, [`b`] represent its base, and [`h`] represent its height. + +A triangle's area formula is: + + [`` A = \frac{1}{2} bh ``] + +Substituting in the given numbers into this formula, we have: + + [``\begin{aligned} + A &= \frac{1}{2} bh \\ + [$area] &= \frac{1}{2} \cdot [$base] \cdot h \\ + [$area] &= [$base/2] \cdot h \\ + \frac{[$area]}{[$base/2]} &= \frac{[$base/2] \cdot h}{[$base/2]} \\ + [$height] &= h + \end{aligned}``] + +The triangle's height is [`[$heightU]`]. Don't forget the length unit [`\textrm{m}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines10.pg new file mode 100644 index 0000000000..5134c5d8fb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines10.pg @@ -0,0 +1,145 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Choose the best method to graph y=3x+5 +# +# Last edited: Yao 10/20/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$m=random(1,3,1)*random(-1,1,2); +$b=non_zero_random(-4,4,1); +$right = Compute("$m*x+$b")->reduce; + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-4,4],[-7,7],centerYaxis=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + add_functions($gr[$i], "$m*x +$b for x in <$min[0],$max[0]> using color:blue and weight:1"); +} + +$x1 = 0; +$y1 = $b; +$run = 1; +$rise = $m; + +$alt[0] = "This is the graph of a line. It has three slope triangles. "; + +@words = ("first","second","third"); +for ($j=-1;$j<=1;$j++) { + $gr[0]->stamps( closed_circle($x1+$run*$j,$y1+$rise*$j,'red') ); + $gr[0]->stamps( closed_circle($x1+$run*($j+1),$y1+$rise*($j+1),'red') ); + + $x1temp = $x1+$run*$j; + $y1temp = $y1+$rise*$j; + $gr[0]->moveTo($x1temp,$y1temp); + $x2temp = $x1+$run*($j+1); + $y2temp = $y1+$rise*$j; + $gr[0]->lineTo($x2temp,$y2temp,'red',2); + $x3temp = $x1+$run*($j+1); + $y3temp = $y1+$rise*($j+1); + $gr[0]->lineTo($x3temp,$y3temp,'red',2); + $gr[0]->lb( new Label($x1+$run*$j+$run/2,$y1+$rise*$j,"$run",'red','center','bottom')); + $gr[0]->lb( new Label($x1+$run*($j+1)+$marksep[0]/10,$y1+$rise*($j+1/2),"$rise",'red','left','middle')); + + $alt[0] .= "The $words[$j+1] slope triangle starts at ($x1temp,$y1temp), goes through ($x2temp,$y2temp), and ends at ($x3temp,$y3temp). The point ($x1temp,$y1temp) is on the line. "; +} +$alt[0] .= "The point ($x3temp,$y3temp) is also on the line. The base of each slope triangle is labeled with $run, and the height is labeled with $rise."; + +$radio = RadioButtons( + ["Yes","No, I will try again"], + "Yes", # correct answer + order => ["Yes","No, I will try again"], +); + + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Choose a good method to graph the line [`y=[$right]`]. Once done, click Solution to check your answer. + +Did your graph match the solution? + +[@$radio->buttons()@]* + +END_PGML + +############################################## + +ANS( $radio->cmp() ); + +$upOrDown = ($m>0) ? "up" : "down"; +$mAbs = abs($m); + +BEGIN_PGML_SOLUTION + +For linear equations given in slope-intercept form, the "slope triangle" method is usually the best way to graph the line. Here are steps to graph [`y=[$right]`]: + +Step 1: Locate the line's [`y`]-intercept, which is [`(0`],[`[$b])`] for this line. + +Step 2: Look at the line's slope, which is [`[$m]`], or [`\frac{[$m]}{1}`] for this line. Starting from the [`y`]-intercept we just plotted, go right by [`1`] unit, and then go [$upOrDown] by [`[$mAbs]`] unit(s). This is how to locate the next point on the line. + +Step 3: Repeat drawing slope triangles both ways, plotting more and more points. Connect all points to graph the line. + +[@EnlargeImageStatementPGML@]** + +>>[@ image(insertGraph( $gr[0] ), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines20.pg new file mode 100644 index 0000000000..a0ee2c1f4e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines20.pg @@ -0,0 +1,149 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Choose the best method to graph y=3/2x+5 +# +# Last edited: Yao 10/20/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); + + +do { + $num=random(1,3,1)*random(-1,1,2); + $den = random(2,4,1); +} until (gcd($num,$den)==1); +$m = Fraction($num,$den); +$b=non_zero_random(-4,4,1); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-2*$den,2*$den],[-2*abs($num)-4,2*abs($num)+4],centerYaxis=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + add_functions($gr[$i], "$num/$den*x +$b for x in <$min[0],$max[0]> using color:blue and weight:1"); +} + +$x1 = 0; +$y1 = $b; +$run = $den; +$rise = $num; + +$alt[0] = "This is the graph of a line. It has three slope triangles. "; + +@words = ("first","second","third"); +for ($j=-1;$j<=1;$j++) { + $gr[0]->stamps( closed_circle($x1+$run*$j,$y1+$rise*$j,'red') ); + $gr[0]->stamps( closed_circle($x1+$run*($j+1),$y1+$rise*($j+1),'red') ); + + $x1temp = $x1+$run*$j; + $y1temp = $y1+$rise*$j; + $gr[0]->moveTo($x1temp,$y1temp); + $x2temp = $x1+$run*($j+1); + $y2temp = $y1+$rise*$j; + $gr[0]->lineTo($x2temp,$y2temp,'red',2); + $x3temp = $x1+$run*($j+1); + $y3temp = $y1+$rise*($j+1); + $gr[0]->lineTo($x3temp,$y3temp,'red',2); + $gr[0]->lb( new Label($x1+$run*$j+$run/2,$y1+$rise*$j,"$run",'red','center','bottom')); + $gr[0]->lb( new Label($x1+$run*($j+1)+$marksep[0]/10,$y1+$rise*($j+1/2),"$rise",'red','left','middle')); + + $alt[0] .= "The $words[$j+1] slope triangle starts at ($x1temp,$y1temp), goes through ($x2temp,$y2temp), and ends at ($x3temp,$y3temp). The point ($x1temp,$y1temp) is on the line. "; +} +$alt[0] .= "The point ($x3temp,$y3temp) is also on the line. The base of each slope triangle is labeled with $run, and the height is labeled with $rise."; + +$radio = RadioButtons( + ["Yes","No, I will try again"], + "Yes", # correct answer + order => ["Yes","No, I will try again"], +); + + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Choose a good method to graph the line [`y=[$m]x+[$b]`]. Once done, click Solution to check your answer. + +Did your graph match the solution? + +[@$radio->buttons()@]* + +END_PGML + +############################################## + +ANS( $radio->cmp() ); + +$upOrDown = ($m>0) ? "up" : "down"; +$numAbs = abs($num); + +BEGIN_PGML_SOLUTION + +For linear equations given in slope-intercept form, the "slope triangle" method is usually the best way to graph the line. Here are steps to graph [`y=[$m]x+[$b]`]: + +Step 1: Locate the line's [`y`]-intercept, which is [`(0`],[`[$b])`] for this line. + +Step 2: Look at the line's slope, which is [`[$m]`] for this line. Starting from the [`y`]-intercept we just plotted, go right by [`[$den]`] unit(s), and then go [$upOrDown] by [`[$numAbs]`] unit(s). This is how to locate the next point on the line. + +Step 3: Repeat drawing slope triangles both ways, plotting more and more points. Connect all points to graph the line. + +[@EnlargeImageStatementPGML@]** + +>>[@ image(insertGraph( $gr[0] ), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines30.pg new file mode 100644 index 0000000000..12a8d9eb98 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines30.pg @@ -0,0 +1,205 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Choose the best method to graph 2x+3y=6 +# +# Last edited: Yao 10/20/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(y=>"Real"); + + +do { + $num=random(1,3,1)*random(-1,1,2); + $den = random(2,4,1); +} until (gcd($num,$den)==1); +$m = Fraction($num,$den); +$b=$num*random(1,2,1)*random(-1,1,2); + +if ($num>0) { + $A = $num; + $B = -$den; + $C = -$b*$den; +} else { + $A = -$num; + $B = $den; + $C = $b*$den; +} + +$left = Compute("$A*x+$B*y")->reduce; +$right = Compute("$C"); + +$xInt = $C/$A; +$yInt = $b; + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-2*$den,2*$den],[-2*abs($num)-abs($b),2*abs($num)+abs($b)],centerYaxis=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..1) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + add_functions($gr[$i], "$num/$den*x +$b for x in <$min[0],$max[0]> using color:blue and weight:1"); +} + +$x1 = 0; +$y1 = $b; +$run = $den; +$rise = $num; + +$alt[0] = "This is the graph of a line. It has three slope triangles. "; + +@words = ("first","second","third"); +for ($j=-1;$j<=1;$j++) { + $gr[0]->stamps( closed_circle($x1+$run*$j,$y1+$rise*$j,'red') ); + $gr[0]->stamps( closed_circle($x1+$run*($j+1),$y1+$rise*($j+1),'red') ); + + $x1temp = $x1+$run*$j; + $y1temp = $y1+$rise*$j; + $gr[0]->moveTo($x1temp,$y1temp); + $x2temp = $x1+$run*($j+1); + $y2temp = $y1+$rise*$j; + $gr[0]->lineTo($x2temp,$y2temp,'red',2); + $x3temp = $x1+$run*($j+1); + $y3temp = $y1+$rise*($j+1); + $gr[0]->lineTo($x3temp,$y3temp,'red',2); + $gr[0]->lb( new Label($x1+$run*$j+$run/2,$y1+$rise*$j,"$run",'red','center','bottom')); + $gr[0]->lb( new Label($x1+$run*($j+1)+$marksep[0]/10,$y1+$rise*($j+1/2),"$rise",'red','left','middle')); + + $alt[0] .= "The $words[$j+1] slope triangle starts at ($x1temp,$y1temp), goes through ($x2temp,$y2temp), and ends at ($x3temp,$y3temp). The point ($x1temp,$y1temp) is on the line. "; +} +$alt[0] .= "The point ($x3temp,$y3temp) is also on the line. The base of each slope triangle is labeled with $run, and the height is labeled with $rise."; + +$gr[1]->stamps( closed_circle($xInt,0,'red') ); +$gr[1]->stamps( closed_circle(0,$yInt,'red') ); +$alt[1] = "This is the graph of a line. The line has two intercepts plotted at ($xInt,0) and (0,$yInt)."; + +$radio = RadioButtons( + ["Yes","No, I will try again"], + "Yes", # correct answer + order => ["Yes","No, I will try again"], +); + + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Choose a good method to graph the line [`[$left]=[$right]`]. Once done, click Solution to check your answer. + +Did your graph match the solution? + +[@$radio->buttons()@]* + +END_PGML + +############################################## + +ANS( $radio->cmp() ); + +$upOrDown = ($m>0) ? "up" : "down"; +$numAbs = abs($num); + +$s1 = Compute("$A*x")->reduce; +$s2 = ($A==1) ? "" : "x &= $xInt"; + +BEGIN_PGML_SOLUTION + +For linear equations given in standard form, there are two methods to graph it. + +*Intercepts Method:* If we simply need a quick sketch of the line, with no need to know details like the line's slope, we can use the intercepts method. + +Step 1: We find the line's [`x`]-intercept by substituting [`y`] with [`0`] in [`[$left]=[$right]`], and then solving for [`x`]: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$s1]+[$B](0) &= [$right] \\ + [$s1] &= [$right] \\ [$s2] +\end{aligned} + ``] + +The line's [`x`]-intercept is [`([$xInt],0)`]. Similarly, we can find the line's [`y`]-intercept to be [`(0,[$yInt])`]. With those two intercepts, we can sketch the line's graph. + +[@EnlargeImageStatementPGML@]** + +>>[@ image(insertGraph( $gr[1] ), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +*Slope-Intercept Method:* If we want to know more information about the line, we should change the line from standard form to slope-intercept form, and then use slope triangles to graph it: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] \mathbf{{}-[$s1]} &= [$right] \mathbf{{}-[$s1]} \\ + [$B]y &= -[$s1]+[$C] \\ + \frac{[$B]y}{[$B]} &= \frac{-[$s1]}{[$B]} + \frac{[$C]}{[$B]} \\ + y &= [$m]x+[$b] +\end{aligned} + ``] + +Step 1: Locate the line's [`y`]-intercept, which is [`(0`],[`[$b])`] for this line. + +Step 2: Look at the line's slope, which is [`[$m]`] for this line. Starting from the [`y`]-intercept we just plotted, go right by [`[$den]`] unit(s), and then go [$upOrDown] by [`[$numAbs]`] unit(s). This is how to locate the next point on the line. + +Step 3: Repeat drawing slope triangles both ways, plotting more and more points. Connect all points to graph the line. + +[@EnlargeImageStatementPGML@]** + +>>[@ image(insertGraph( $gr[0] ), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines40.pg new file mode 100644 index 0000000000..4275a4fe6b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines40.pg @@ -0,0 +1,195 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Choose the best method to graph 2x+3y=0 +# +# Last edited: Yao 10/20/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(y=>"Real"); + + +do { + $num=random(1,3,1)*random(-1,1,2); + $den = random(2,4,1); +} until (gcd($num,$den)==1); +$m = Fraction($num,$den); +$b=0; + +if ($num>0) { + $A = $num; + $B = -$den; + $C = -$b*$den; +} else { + $A = -$num; + $B = $den; + $C = $b*$den; +} + +$left = Compute("$A*x+$B*y")->reduce; +$right = Compute("$C"); + +$xInt = $C/$A; +$yInt = $b; + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-2*$den,2*$den],[-2*abs($num)-abs($b),2*abs($num)+abs($b)],centerYaxis=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + add_functions($gr[$i], "$num/$den*x +$b for x in <$min[0],$max[0]> using color:blue and weight:1"); +} + +$x1 = 0; +$y1 = $b; +$run = $den; +$rise = $num; + +$alt[0] = "This is the graph of a line. It has three slope triangles. "; + +@words = ("first","second","third"); +for ($j=-1;$j<=1;$j++) { + $gr[0]->stamps( closed_circle($x1+$run*$j,$y1+$rise*$j,'red') ); + $gr[0]->stamps( closed_circle($x1+$run*($j+1),$y1+$rise*($j+1),'red') ); + + $x1temp = $x1+$run*$j; + $y1temp = $y1+$rise*$j; + $gr[0]->moveTo($x1temp,$y1temp); + $x2temp = $x1+$run*($j+1); + $y2temp = $y1+$rise*$j; + $gr[0]->lineTo($x2temp,$y2temp,'red',2); + $x3temp = $x1+$run*($j+1); + $y3temp = $y1+$rise*($j+1); + $gr[0]->lineTo($x3temp,$y3temp,'red',2); + $gr[0]->lb( new Label($x1+$run*$j+$run/2,$y1+$rise*$j,"$run",'red','center','bottom')); + $gr[0]->lb( new Label($x1+$run*($j+1)+$marksep[0]/10,$y1+$rise*($j+1/2),"$rise",'red','left','middle')); + + $alt[0] .= "The $words[$j+1] slope triangle starts at ($x1temp,$y1temp), goes through ($x2temp,$y2temp), and ends at ($x3temp,$y3temp). The point ($x1temp,$y1temp) is on the line. "; +} +$alt[0] .= "The point ($x3temp,$y3temp) is also on the line. The base of each slope triangle is labeled with $run, and the height is labeled with $rise."; + +$radio = RadioButtons( + ["Yes","No, I will try again"], + "Yes", # correct answer + order => ["Yes","No, I will try again"], +); + + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Choose a good method to graph the line [`[$left]=[$right]`]. Once done, click Solution to check your answer. + +Did your graph match the solution? + +[@$radio->buttons()@]* + +END_PGML + +############################################## + +ANS( $radio->cmp() ); + +$upOrDown = ($m>0) ? "up" : "down"; +$numAbs = abs($num); + +$s1 = Compute("$A*x")->reduce; +$s2 = ($A==1) ? "" : "x &= $xInt"; + +BEGIN_PGML_SOLUTION + +For linear equations given in standard form, there are two methods to graph it. However, when [`C=0`] in [`Ax+By=C`], like in this problem, the Intercepts Method doesn't work. Let's try. + +*Intercepts Method:* + +Step 1: We find the line's [`x`]-intercept by substituting [`y`] with [`0`] in [`[$left]=[$right]`], and then solving for [`x`]: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$s1]+[$B](0) &= [$right] \\ + [$s1] &= [$right] \\ [$s2] +\end{aligned} + ``] + +The line's [`x`]-intercept is [`([$xInt],0)`]. Similarly, we can find the line's [`y`]-intercept to be [`(0,[$yInt])`]. With only one point, we cannot graph this line. We have to use the Slope-Intercept Method. + +*Slope-Intercept Method:* We will change the line from standard form to slope-intercept form, and then use slope triangles to graph it: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] \mathbf{{}-[$s1]} &= [$right] \mathbf{{}-[$s1]} \\ + [$B]y &= -[$s1] \\ + \frac{[$B]y}{[$B]} &= \frac{-[$s1]}{[$B]}\\ + y &= [$m]x +\end{aligned} + ``] + +Step 1: Locate the line's [`y`]-intercept, which is [`(0`],[`[$b])`] for this line. + +Step 2: Look at the line's slope, which is [`[$m]`] for this line. Starting from the [`y`]-intercept we just plotted, go right by [`[$den]`] unit(s), and then go [$upOrDown] by [`[$numAbs]`] unit(s). This is how to locate the next point on the line. + +Step 3: Repeat drawing slope triangles both ways, plotting more and more points. Connect all points to graph the line. + +[@EnlargeImageStatementPGML@]** + +>>[@ image(insertGraph( $gr[0] ), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines50.pg new file mode 100644 index 0000000000..9f02bec50c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/ChooseMethodToGraphLines50.pg @@ -0,0 +1,185 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Choose the best method to graph y=3 or x=2 +# Last edited: Yao 10/20/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a = non_zero_random(-3,3,1); +$direction = (random(-1,1,2)>0) ? "horizontal" : "vertical"; +$var = ($direction eq "horizontal") ? 'y' : 'x'; + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-3,3],[-3,3],centerYaxis=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + if ($direction eq "horizontal") { + add_functions($gr[$i], "$a for x in <$min[0],$max[0]> using color:blue and weight:1"); + $alt[$i] = "This is graph of a horizontal line at y=$a. Points (0,$a) and (1,$a) on the line are plotted."; + $gr[$i]->stamps( closed_circle(0,$a,'red') ); + $gr[$i]->stamps( closed_circle(1,$a,'red') ); + } else { + $gr[$i]->moveTo($a,$min[1]); + $gr[$i]->lineTo($a,$max[1],'blue'); + $alt[$i] = "This is graph of a vertical line at x=$a. Points ($a,0) and ($a,1) on the line are plotted."; + $gr[$i]->stamps( closed_circle($a,0,'red') ); + $gr[$i]->stamps( closed_circle($a,1,'red') ); + } +} + +$radio = RadioButtons( + ["Yes","No, I will try again"], + "Yes", # correct answer + order => ["Yes","No, I will try again"], +); + + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Choose a good method to graph the line [`[$var]=[$a]`]. Once done, click Solution to check your answer. + +Did your graph match the solution? + +[@$radio->buttons()@]* + +END_PGML + +############################################## + +ANS( $radio->cmp() ); + +if ($direction eq "horizontal") { + +BEGIN_PGML_SOLUTION + +For horizontal and vertical lines like [`[$var]=[$a]`], the table method is the best way to graph them. + +[@DataTable( + [ + [[PF('[`x`]-values'), + rowcss => 'border-bottom: 3px solid;',], + [PF('[`y`]-values'),], + [PF('Points'),], + ], + [[PF('[`0`]'),], + [PF('[`[$a]`]'),], + [PF('[`(0,[$a])`]'),], + ], + [[PF('[`1`]'),], + [PF('[`[$a]`]'),], + [PF('[`(1,[$a])`]'),], + ], + ], + align => 'ccc', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +[@EnlargeImageStatementPGML@]** + +>>[@ image(insertGraph( $gr[0] ), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +END_PGML_SOLUTION + +} else { + +BEGIN_PGML_SOLUTION + +For horizontal and vertical lines like [`[$var]=[$a]`], the table method is the best way to graph them. + +[@DataTable( + [ + [[PF('[`x`]-values'), + rowcss => 'border-bottom: 3px solid;',], + [PF('[`y`]-values'),], + [PF('Points'),], + ], + [[PF('[`[$a]`]'),], + [PF('[`0`]'),], + [PF('[`([$a],0)`]'),], + ], + [[PF('[`[$a]`]'),], + [PF('[`1`]'),], + [PF('[`([$a],1)`]'),], + ], + ], + align => 'ccc', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +[@EnlargeImageStatementPGML@]** + +>>[@ image(insertGraph( $gr[0] ), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +END_PGML_SOLUTION + +} + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg index 7550a1813b..1d987630b0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg @@ -5,36 +5,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Finding the slope) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(slope_from_graph) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", - "PGgraphmacros.pl", "MathObjects.pl", "PGML.pl", + "PCCmacros.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = random(1,5,1); $b = random(-4,4,1); @@ -56,72 +59,68 @@ Context("Numeric"); ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([3*$x2,0,$x1],[$m*3*$x2+$b,0,$y1]); -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; - -for my $i (0,1) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (Real($j) == 0) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - -add_functions($gr[$i], "$m*x+$b for x in <$min[0],$max[0]> using color:blue and weight:1"); -} +($start,$stop) = (num_sort($min[0],$max[0],($min[1]-$b)/$m,($max[1]-$b)/$m))[1,2]; + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; +\end{axis} +END_TIKZ + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[above] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[above] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ + ############################################## Context("LimitedNumeric"); BEGIN_PGML -A line's graph is shown below. [@EnlargeImageStatementPGML()@]** +Below is a line's graph. [@EnlargeImageStatementPGML()@]** END_PGML BEGIN_TEXT $PAR $BCENTER -\{image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)"') \} +\{image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)"') \} $ECENTER $PAR END_TEXT BEGIN_PGML - The slope of this line is [___________]{Compute("$m")}. (If the slope does not exist, enter *DNE* or *NONE*.) + The slope of this line is [___________]{Compute("$m")}. [@KeyboardInstructions('(If the slope does not exist, enter [|DNE|]* or [|NONE|]*.)')@]** END_PGML ############################################## -if ($m > 0) -{$p1vert = 'bottom'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'left';} -else {$p1vert = 'top'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'right';}; - -$gr[1]->stamps( closed_circle($x1,$y1,'red') ); -$gr[1]->lb( new Label($x1,$y1,"$pt1",'red',$p1hor,$p1vert)); -$gr[1]->stamps( closed_circle($x2,$y2,'red') ); -$gr[1]->lb( new Label($x2,$y2,"$pt2",'red',$p2hor,$p2vert)); - -$gr[1]->moveTo($x1,$y1); -$gr[1]->lineTo($x2,$y1,'red',2); -$gr[1]->lineTo($x2,$y2,'red',2); -$gr[1]->lb( new Label(($x1+$x2)/2,$y1,"$run",'red','center','top')); -$gr[1]->lb( new Label($x2,($y1+$y2)/2,"$rise",'red','left','middle')); - BEGIN_SOLUTION @@ -130,7 +129,7 @@ To find the slope of a line from its graph, we first need to identify two points Next, we sketch a slope triangle and find the $BITALIC rise$EITALIC and $BITALIC run$EITALIC. In the sketch below, the rise is \($rise\) and the run is \($run\). $BCENTER -\{ image( insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) +\{ image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) \} $ECENTER $PAR diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg index 2e6c1f8edc..7bb80cc596 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg @@ -7,35 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Finding the slope) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(slope_from_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PCCmacros.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = -random(1,5,1); $b = random(-4,4,1); @@ -60,6 +63,22 @@ Context("Numeric"); @xticks = @$xticks_ref; @yticks = @$yticks_ref; +my @ticksep; +for my $i (0,1) { + $ticksep[$i] = ($max[$i] - $min[$i])/$ticknum[$i]; +}; + +#Make sure the grid lines cover the two points +$scale[0] = 1; +while ((Real($scale[0]*$x1 / $ticksep[0]) != Real(int($scale[0]*$x1 / $ticksep[0]))) or (Real($scale[0]*$x2 / $ticksep[0]) != Real(int($scale[0]*$x2 / $ticksep[0])))) {$scale[0] = $scale[0] + 1}; +$scale[1] = 1; +while ((Real($scale[1]*$y1 / $ticksep[1]) != Real(int($scale[1]*$y1 / $ticksep[1]))) or (Real($scale[1]*$y2 / $ticksep[1]) != Real(int($scale[1]*$y2 / $ticksep[1])))) {$scale[1] = $scale[1] + 1}; + +for my $i (0,1) { + $ticknum[$i] = $ticknum[$i]*$scale[$i]; +}; + + for my $i (0,1) { $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], axes=>[0,0], @@ -69,22 +88,27 @@ for my $i (0,1) { $gr[$i]->lb('reset'); for my $j (@xticks) { if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top','large')); } for my $j (@yticks) { if (Real($j) == 0) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle','large')); } -add_functions($gr[$i], "$m*x+$b for x in <$min[0],$max[0]> using color:blue and weight:1"); +($start,$stop) = (num_sort($min[0],$max[0],($min[1]-$b)/$m,($max[1]-$b)/$m))[1,2]; +$gr[$i]->moveTo($x1,$y1); +$gr[$i]->arrowTo($start,$m*$start+$b,'blue',1); +$gr[$i]->moveTo($x1,$y1); +$gr[$i]->arrowTo($stop,$m*$stop+$b,'blue',1); + } ############################################## Context("LimitedNumeric"); BEGIN_PGML -A line's graph is shown below. [@EnlargeImageStatementPGML()@]** +Below is a line's graph. [@EnlargeImageStatementPGML()@]** END_PGML @@ -97,7 +121,7 @@ $PAR END_TEXT BEGIN_PGML - The slope of this line is [___________]{Compute("$m")}. (If the slope does not exist, enter *DNE* or *NONE*.) + The slope of this line is [___________]{Compute("$m")}. [@KeyboardInstructions('(If the slope does not exist, enter [|DNE|]* or [|NONE|]*.)')@]** END_PGML ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg index f75fe74bbd..c31b4c513d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg @@ -3,20 +3,22 @@ # # Given a graph, find a line's slope. Slope is a positive fraction. # -# Last edited: Jordan 8/18/13 +# Last edited: Jordan 4/23/21 # # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Finding the slope) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(slope_from_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope','fraction') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -24,28 +26,30 @@ DOCUMENT(); loadMacros( "PGstandard.pl", - "PGgraphmacros.pl", "MathObjects.pl", "PGML.pl", "contextFraction.pl", + "PCCmacros.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; -$num=random(1,9,1); -do {$den=random(2,9,1);} until (gcd($den,$num)==1); +$num=random(3,9,1); +do {$den=random(3,9,1);} until (gcd($den,$num)==1); $m = Fraction($num,$den); +$mperl = $num/$den; Context("Numeric"); -$b = random(-4,4,1); +$b = non_zero_random(-4,4,1); $x1 = 0; $y1 = $b; @@ -63,92 +67,84 @@ $pt2=Compute("($x2,$y2)"); ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([1.5*$x2,0,$x1],[$m*1.5*$x2+$b,0,$y1]); -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; +($start,$stop) = (num_sort($min[0],$max[0],($min[1]-$b)/$mperl,($max[1]-$b)/$mperl))[1,2]; + +$firstx = $min[0]+1; +$firsty = $min[1]+1; + +$tikz = <<"END_TIKZ"; +\begin{axis} + [ + width = 0.47\linewidth, + xmin = $min[0], + ymin = $min[1], + xmax = $max[0], + ymax = $max[1], + xtick = {}, + ytick = {}, + minor xtick = {$min[0],$firstx,...,$max[0]}, + minor ytick = {$min[1],$firsty,...,$max[1]}, + grid=both, + ] + \addplot+[domain = $start:$stop] {$mperl*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1) ($x2,$y2)}; +END_TIKZ +# note final \end{axis} not yet written for my $i (0,1) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (Real($j) == 0) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - -add_functions($gr[$i], "$m*x+$b for x in <$min[0],$max[0]> using color:blue and weight:1"); + $gr[$i] = createTikZImage(); + $gr[$i]->addToPreamble(latexImagePreamble()); } +$gr[0]->tex($tikz. '\end{axis}'); + +if ($m > 0) +{$p1vert = 'above'; + $p2vert = 'above'; + $p1hor = 'left'; + $p2hor = 'left';} +else {$p1vert = 'below'; + $p2vert = 'below'; + $p1hor = 'left'; + $p2hor = 'left';}; + +$tikz .= <<"END_TIKZ"; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1)} node[pos=0.5,below] {\($run\)}; + \addplot[guideline] coordinates {($x2,$y1) ($x2,$y2)} node[pos=0.5,right] {\($rise\)}; + \addplot[soliddot] coordinates {($x1,$y1)} node[$p1vert $p1hor] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[$p2vert $p2hor] {\(($x2,$y2)\)}; +END_TIKZ + +$gr[1]->tex($tikz.'\end{axis}'); + ############################################## Context("LimitedFraction"); BEGIN_PGML -A line's graph is shown below. [@EnlargeImageStatementPGML()@]** +Find the slope of the line. +>>[@image(insertGraph($gr[0]), width=>280, tex_size=>1000, alt => "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)")@]*<< -END_PGML -BEGIN_TEXT -$PAR -$BCENTER -\{image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line has an upward slant and also passes through the point ($x2,$y2)"') \} -$ECENTER -$PAR -END_TEXT -BEGIN_PGML +[@KeyboardInstructions('(If the slope does not exist, enter [|DNE|]* or [|NONE|]*.)')@]** - The slope of this line is [___________]{$m}. (If the slope does not exist, enter *DNE* or *NONE*.) +[_]{$m}{10} END_PGML ############################################## -if ($m > 0) -{$p1vert = 'bottom'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'left';} -else {$p1vert = 'top'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'right';}; - -$gr[1]->stamps( closed_circle($x1,$y1,'red') ); -$gr[1]->lb( new Label($x1,$y1,"$pt1",'red',$p1hor,$p1vert)); -$gr[1]->stamps( closed_circle($x2,$y2,'red') ); -$gr[1]->lb( new Label($x2,$y2,"$pt2",'red',$p2hor,$p2vert)); - -$gr[1]->moveTo($x1,$y1); -$gr[1]->lineTo($x2,$y1,'red',2); -$gr[1]->lineTo($x2,$y2,'red',2); -$gr[1]->lb( new Label(($x1+$x2)/2,$y1,"$run",'red','center','top')); -$gr[1]->lb( new Label($x2,($y1+$y2)/2,"$rise",'red','left','middle')); - -Context()->texStrings; -BEGIN_SOLUTION +BEGIN_PGML_SOLUTION -To find the slope of a line from its graph, we first need to identify two points that the line passes through. It is wise to choose points with integer coordinates. For this problem, we choose \(($x1,$y1)\) and \(($x2,$y2)\). +To find the slope of a line from its graph, we first need to identify two points that the line passes through. It is wise to choose points with integer coordinates. For this problem, we choose [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. -Next, we sketch a slope triangle and find the $BITALIC rise$EITALIC and $BITALIC run$EITALIC. In the sketch below, the rise is \($rise\) and the run is \($run\). +Next, we sketch a slope triangle and find the _rise_ and _run_. In the sketch below, the rise is [`[$rise]`] and the run is [`[$run]`]. -$BCENTER -\{ image( insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) - \} -$ECENTER -$PAR +>>[@image(insertGraph($gr[1]), width=>280, tex_size=>1000, alt => "graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)")@]*<< -\[\begin{aligned}\text{slope}&=\frac{\text{rise}}{\text{run}}\\ -&=\frac{$rise}{$run}\\ -\end{aligned}\] +[```\text{slope}=\frac{\text{rise}}{\text{run}}=\frac{[$rise]}{[$run]}```] -This line's slope is \($m\). +This line's slope is [`[$m]`]. -END_SOLUTION +END_PGML_SOLUTION Context()->normalStrings; ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg index 4b81dd3257..ee63e9489a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg @@ -7,42 +7,47 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Finding the slope) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(slope_from_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope','fraction') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", - "PGgraphmacros.pl", "MathObjects.pl", "PGML.pl", "contextFraction.pl", + "PCCmacros.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num=random(1,9,1); do {$den=random(2,9,1);} until (gcd($den,$num)==1); $m = -Fraction($num,$den); +$mperl = -$num/$den; Context("Numeric"); $b = random(-4,4,1); @@ -62,72 +67,73 @@ $pt1=Compute("($x1,$y1)"); $pt2=Compute("($x2,$y2)"); ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([1.5*$x2,0,$x1],[$m*1.5*$x2+$b,0,$y1]); +$min[1] = int($min[1]); +$max[1] = int($max[1]); + +($start,$stop) = (num_sort($min[0],$max[0],($min[1]-$b)/$mperl,($max[1]-$b)/$mperl))[1,2]; + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)}; + \addplot[soliddot] coordinates {($x2,$y2)}; +\end{axis} +END_TIKZ + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick = {$min[1],...,$max[1]}, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[above] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[above] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; - -for my $i (0,1) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (Real($j) == 0) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - -add_functions($gr[$i], "$m*x+$b for x in <$min[0],$max[0]> using color:blue and weight:1"); -} ############################################## Context("LimitedFraction"); BEGIN_PGML -A line's graph is shown below. [@EnlargeImageStatementPGML()@]** +Below is a line's graph. [@EnlargeImageStatementPGML()@]** END_PGML BEGIN_TEXT $PAR $BCENTER -\{image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line has an downward slant and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line has an downward slant and also passes through the point ($x2,$y2)"') \} +\{image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line has an downward slant and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line has an downward slant and also passes through the point ($x2,$y2)"') \} $ECENTER $PAR END_TEXT BEGIN_PGML - The slope of this line is [___________]{$m}. (If the slope does not exist, enter *DNE* or *NONE*.) + The slope of this line is [___________]{$m}. [@KeyboardInstructions('(If the slope does not exist, enter [|DNE|]* or [|NONE|]*.)')@]** END_PGML ############################################## -if ($m > 0) -{$p1vert = 'bottom'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'left';} -else {$p1vert = 'top'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'right';}; - -$gr[1]->stamps( closed_circle($x1,$y1,'red') ); -$gr[1]->lb( new Label($x1,$y1,"$pt1",'red',$p1hor,$p1vert)); -$gr[1]->stamps( closed_circle($x2,$y2,'red') ); -$gr[1]->lb( new Label($x2,$y2,"$pt2",'red',$p2hor,$p2vert)); - -$gr[1]->moveTo($x1,$y1); -$gr[1]->lineTo($x2,$y1,'red',2); -$gr[1]->lineTo($x2,$y2,'red',2); -$gr[1]->lb( new Label(($x1+$x2)/2,$y1,"$run",'red','center','top')); -$gr[1]->lb( new Label($x2,($y1+$y2)/2,"$rise",'red','left','middle')); Context()->texStrings; BEGIN_SOLUTION @@ -137,7 +143,7 @@ To find the slope of a line from its graph, we first need to identify two points Next, we sketch a slope triangle and find the $BITALIC rise$EITALIC and $BITALIC run$EITALIC. In the sketch below, the rise is \($rise\) and the run is \($run\). $BCENTER -\{ image( insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) +\{ image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) \} $ECENTER $PAR diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg index e30700854c..e80caff2e5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg @@ -7,35 +7,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Finding the slope) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(slope_from_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope','zero') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", - "PGgraphmacros.pl", "MathObjects.pl", "PGML.pl", + "PCCmacros.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = 0; $b = non_zero_random(-4,4,1); @@ -57,73 +61,72 @@ Context("Numeric"); ($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([3*$x2,0,$x1],[$m*3*$x2+$b,0,$y1]); -@xticks = @$xticks_ref; -@yticks = @$yticks_ref; - -for my $i (0,1) { - $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], - axes=>[0,0], - grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] - ); - $gr[$i]->lb('reset'); - for my $j (@xticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); - } - - for my $j (@yticks) { - if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); - } - -add_functions($gr[$i], "$m*x+$b for x in <$min[0],$max[0]> using color:blue and weight:2"); -} +TEXT(@$yticks_ref); +$xticks = join(',',@$xticks_ref); +$yticks = join(',',@$yticks_ref); + +$gr[0] = createTikZImage(); +$gr[0]->addToPreamble(latexImagePreamble()); +$gr[0]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$xticks}, + minor ytick = {$yticks}, + grid = minor, + ] + \addplot+[domain=$min[0]:$max[0]] {$m*x+$b}; +\end{axis} +END_TIKZ + +$gr[1] = createTikZImage(); +$gr[1]->addToPreamble(latexImagePreamble()); +$gr[1]->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$xticks}, + minor ytick = {$yticks}, + grid = minor, + ] + \addplot+[domain=$min[0]:$max[0]] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[above left] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[above right] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ ############################################## Context("LimitedNumeric"); BEGIN_PGML -A line's graph is shown below. [@EnlargeImageStatementPGML()@]** +Below is a line's graph. [@EnlargeImageStatementPGML()@]** END_PGML BEGIN_TEXT $PAR $BCENTER -\{image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line is horizontal and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line is horizontal and also passes through the point ($x2,$y2)"') \} +\{image($gr[0], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line crossing the y-axis at $b; the line is horizontal and also passes through the point ($x2,$y2)" title = "graph of a line crossing the y-axis at $b; the line is horizontal and also passes through the point ($x2,$y2)"') \} $ECENTER $PAR END_TEXT BEGIN_PGML - The slope of this line is [___________]{Compute("$m")}. (If the slope does not exist, enter *DNE* or *NONE*.) + The slope of this line is [___________]{Compute("$m")}. [@KeyboardInstructions('(If the slope does not exist, enter [|DNE|]* or [|NONE|]*.)')@]** END_PGML ############################################## -if ($m > 0) -{$p1vert = 'bottom'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'left';} -else {$p1vert = 'top'; - $p2vert = 'top'; - $p1hor = 'right'; - $p2hor = 'right';}; - -$gr[1]->stamps( closed_circle($x1,$y1,'red') ); -$gr[1]->lb( new Label($x1,$y1,"$pt1",'red',$p1hor,$p1vert)); -$gr[1]->stamps( closed_circle($x2,$y2,'red') ); -$gr[1]->lb( new Label($x2,$y2,"$pt2",'red',$p2hor,$p2vert)); - -$gr[1]->moveTo($x1,$y1); -$gr[1]->lineTo($x2,$y1,'red',2); -$gr[1]->lineTo($x2,$y2,'red',2); -$gr[1]->lb( new Label(($x1+$x2)/2,$y1,"$run",'red','center','top')); -$gr[1]->lb( new Label($x2,($y1+$y2)/2,"$rise",'red','left','middle')); - Context()->texStrings; BEGIN_SOLUTION @@ -135,7 +138,7 @@ To be more consistent with how you might approach problems like this that do not Next, we sketch a slope triangle and find the $BITALIC rise$EITALIC and $BITALIC run$EITALIC. In the sketch below, the rise is \($rise\) and the run is \($run\). $BCENTER -\{ image( insertGraph($gr[1]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) +\{ image($gr[1], width=>300, tex_size=>TeXscalar(), extra_html_tags=>'alt="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)" title="graph of the line detailing a slope triangle from ($x1,$y1) to ($x2,$y1) to ($x2,$y2)"' ) \} $ECENTER $PAR diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg index 2fbb294ca0..2b6f63afda 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg @@ -7,36 +7,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Finding the slope) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(slope_from_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope','zero') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PCCmacros.pl", "PCCgraphMacros.pl", "parserOneOf.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = OneOf("DNE","NONE"); $a = non_zero_random(-4,4,1); @@ -61,6 +64,21 @@ Context("Numeric"); @xticks = @$xticks_ref; @yticks = @$yticks_ref; +my @ticksep; +for my $i (0,1) { + $ticksep[$i] = ($max[$i] - $min[$i])/$ticknum[$i]; +}; + +#Make sure the grid lines cover the two points +$scale[0] = 1; +while ((Real($scale[0]*$x1 / $ticksep[0]) != Real(int($scale[0]*$x1 / $ticksep[0]))) or (Real($scale[0]*$x2 / $ticksep[0]) != Real(int($scale[0]*$x2 / $ticksep[0])))) {$scale[0] = $scale[0] + 1}; +$scale[1] = 1; +while ((Real($scale[1]*$y1 / $ticksep[1]) != Real(int($scale[1]*$y1 / $ticksep[1]))) or (Real($scale[1]*$y2 / $ticksep[1]) != Real(int($scale[1]*$y2 / $ticksep[1])))) {$scale[1] = $scale[1] + 1}; + +for my $i (0,1) { + $ticknum[$i] = $ticknum[$i]*$scale[$i]; +}; + for my $i (0,1) { $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], axes=>[0,0], @@ -70,16 +88,18 @@ for my $i (0,1) { $gr[$i]->lb('reset'); for my $j (@xticks) { if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top','large')); } for my $j (@yticks) { if (Real($j) == 0) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle','large')); } -$gr[$i]->moveTo($x1,$min[1]); -$gr[$i]->lineTo($x1,$max[1],'blue',2); +$gr[$i]->moveTo($x1,$y1); +$gr[$i]->arrowTo($x1,$max[1],'blue',1); +$gr[$i]->moveTo($x1,$y1); +$gr[$i]->arrowTo($x1,$min[1],'blue',1); } @@ -87,7 +107,7 @@ $gr[$i]->lineTo($x1,$max[1],'blue',2); Context("LimitedNumeric"); BEGIN_PGML -A line's graph is shown below. [@EnlargeImageStatementPGML()@]** +Below is a line's graph. [@EnlargeImageStatementPGML()@]** END_PGML @@ -100,7 +120,7 @@ $PAR END_TEXT BEGIN_PGML - The slope of this line is [___________]{$m}. (If the slope does not exist, enter *DNE* or *NONE*.) + The slope of this line is [___________]{$m}. [@KeyboardInstructions('(If the slope does not exist, enter [|DNE|]* or [|NONE|]*.)')@]** END_PGML ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts10.pg index 98d4d5ed63..ffd9df9d27 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts10.pg @@ -6,17 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -58,11 +59,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``y=[$func]``] + [```y=[$func]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts100.pg index 5cd370e325..5821261ec3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts100.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,11 +57,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``[$a]x - y = [$c]``] + [```[$a]x - y = [$c]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts110.pg index dcd9b4b3f5..6e4934f166 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts110.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "pccTables.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,11 +82,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``[$a] x + [$b] y = [$c]``] + [```[$a] x + [$b] y = [$c]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts120.pg index 074518aa59..a70cdf39ef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts120.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "pccTables.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -88,11 +90,10 @@ $ans22 = Compute("($xInt,0)"); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``[$a] x + [$b] y = [$c]``] + [```[$a] x + [$b] y = [$c]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts130.pg index 7fca01639c..3a6449912e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts130.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,11 +57,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``x = [$a]``] + [```x = [$a]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts140.pg index 25b1cd132d..32da4f100e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts140.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,11 +57,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``y = [$a]``] + [```y = [$a]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts150.pg index 3f30ff0434..af6641f618 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts150.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,11 +59,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``x+[$b]y=[$c]``] + [```x+[$b]y=[$c]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts20.pg index 2260159b3f..6d8c7910f5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts20.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,11 +58,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``y=[$func]``] + [```y=[$func]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts30.pg index 2b8ef47869..cd5a7c3c22 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts30.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -52,11 +54,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``y=[$m] x``] + [```y=[$m] x```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts40.pg index f644eca91d..c5af8d8bd6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts40.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGML.pl", "pccTables.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -63,11 +65,10 @@ Context()->texStrings; BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``y=[$func]``] + [```y=[$func]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts50.pg index d8551d6d7a..fc4b806147 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts50.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGML.pl", "pccTables.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts60.pg index d82784c3e5..d3b3dae0ef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts60.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,11 +58,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``[$a] x + [$b] y = [$c]``] + [```[$a] x + [$b] y = [$c]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML @@ -68,7 +69,7 @@ Context()->texStrings; BEGIN_TEXT $PAR \{ -DataTable([[{data=>"",header=>"CH"},{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Location",header=>"CH"},], +DataTable([[{data=>"",header=>"CH"},{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Location (as an ordered pair)",header=>"CH"},], [{data=>"\(y\)-intercept",header=>"RH"},ans_rule(5), ans_rule(5), ans_rule(10)], [{data=>"\(x\)-intercept",header=>"RH"},ans_rule(5), ans_rule(5), ans_rule(10)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "\(x\)-intercept and \(y\)-intercept of the line \( $a x + $b y = $c \)", captioncss =>"padding:4pt; text-decoration:none;"); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts70.pg index 74f9f046c7..e298721996 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts70.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,11 +57,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``[$a] x + [$b] y = [$c]``] + [```[$a] x + [$b] y = [$c]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML @@ -67,7 +68,7 @@ Context()->texStrings; BEGIN_TEXT $PAR \{ -DataTable([[{data=>"",header=>"CH"},{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Location",header=>"CH"},], +DataTable([[{data=>"",header=>"CH"},{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Location (as an ordered pair)",header=>"CH"},], [{data=>"\(y\)-intercept",header=>"RH"},ans_rule(5), ans_rule(5), ans_rule(10)], [{data=>"\(x\)-intercept",header=>"RH"},ans_rule(5), ans_rule(5), ans_rule(10)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "\(x\)-intercept and \(y\)-intercept of the line \( $a x+$b y=$c \)", captioncss =>"padding:4pt; text-decoration:none;"); @@ -95,7 +96,7 @@ BEGIN_SOLUTION A line's \(y\)-intercept is on the \(y\)-axis, implying that its \(x\)-value must be \(0\). To find a line's \(y\)-intercept, we substitute in \(x=0\). In this problem we have: $PAR -$SPACE $SPACE $SPACE\( +\[ \begin{aligned} $a x+$b y &= $c\\ $a (0)+$b y &= $c\\ @@ -103,14 +104,14 @@ $SPACE $SPACE $SPACE\( \frac{$b y}{$b} &= \frac{$c}{$b}\\ y & = $yInt \end{aligned} -\) +\] $PAR This line's \(y\)-intercept is \( (0,$yInt) \). $PAR $PAR Next, a line's \(x\)-intercept is on the \(x\)-axis, implying that its \(y\)-value must be \(0\). To find a line's \(x\)-intercept, we substitute in \(y=0\). In this problem we have: $PAR -$SPACE $SPACE $SPACE\( +\[ \begin{aligned} $a x+$b y &= $c\\ $a x+$b (0) &= $c\\ @@ -118,7 +119,7 @@ $SPACE $SPACE $SPACE\( \frac{$a x}{$a} &= \frac{$c}{$a}\\ x & = $xInt \end{aligned} -\) +\] $PAR The line's \(x\)-intercept is \( ($xInt,0) \). $PAR diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts80.pg index a54e5a20a3..c00d9e80c8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts80.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,11 +57,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``[$a] x + [$b] y = [$c]``] + [```[$a] x + [$b] y = [$c]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML @@ -67,7 +68,7 @@ Context()->texStrings; BEGIN_TEXT $PAR \{ -DataTable([[{data=>"",header=>"CH"},{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Location",header=>"CH"},], +DataTable([[{data=>"",header=>"CH"},{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Location (as an ordered pair)",header=>"CH"},], [{data=>"\(y\)-intercept",header=>"RH"},ans_rule(5), ans_rule(5), ans_rule(10)], [{data=>"\(x\)-intercept",header=>"RH"},ans_rule(5), ans_rule(5), ans_rule(10)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "\(x\)-intercept and \(y\)-intercept of the line \( $a x+$b y=$c \)", captioncss =>"padding:4pt; text-decoration:none;"); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts90.pg index 8666f413f2..e445d062b3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts90.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('F-IF.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_from_equation) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') ## KEYWORDS('coordinates','linear equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,11 +57,10 @@ $xInt = Compute($xInt); BEGIN_PGML -Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation +Find the [`y`]-intercept and [`x`]-intercept of the line given by the equation. If a particular intercept does not exist, enter [|none|]* into all the answer blanks for that row. - [``x + [$b] y = [$c]``] + [```x + [$b] y = [$c]```] -If a particular intercept does not exist, enter *none* into all the answer blanks for that row. END_PGML @@ -67,7 +68,7 @@ Context()->texStrings; BEGIN_TEXT $PAR \{ -DataTable([[{data=>"",header=>"CH"},{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Location",header=>"CH"},], +DataTable([[{data=>"",header=>"CH"},{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Location (as an ordered pair)",header=>"CH"},], [{data=>"\(y\)-intercept",header=>"RH"},ans_rule(5), ans_rule(5), ans_rule(10)], [{data=>"\(x\)-intercept",header=>"RH"},ans_rule(5), ans_rule(5), ans_rule(10)], ], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "\(x\)-intercept and \(y\)-intercept of the line \( x + $b y = $c \)", captioncss =>"padding:4pt; text-decoration:none;"); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg index 21fc60f94b..2fac87ad4f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg @@ -10,37 +10,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_graph) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = random(2,6,1); do {$b = random(2,6,1);} until ($a!=$b); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg index 9bb75c98e2..2b10250488 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg @@ -10,36 +10,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = random(2,6,1); do {$b = random(2,6,1);} until ($a!=$b); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg index 6dc74513c6..5cf768fd65 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg @@ -10,36 +10,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = random(2,6,1); do {$b = random(2,6,1);} until ($a!=$b); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg index 75f92fb4aa..8872a6e797 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg @@ -10,36 +10,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = random(2,6,1); do {$b = random(2,6,1);} until ($a!=$b); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg index 3d8aaf606a..12317ec53c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg @@ -8,36 +8,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = 1; $b = non_zero_random(-6,6,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg index 3086abdc4d..d4ae170c06 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg @@ -8,36 +8,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $a = non_zero_random(2,6,1); $b = 1; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg index 4f6fbd9cd5..cc9d5c9c09 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg @@ -7,37 +7,38 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m=random(2,5,1); @ar_m = ($m,1/$m,2*$m,$m-1,$m); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg index cb5f8fb5ca..fc070f8c0b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg @@ -7,36 +7,38 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m= -random(2,5,1); @ar_m = ($m,$m+1,-$m,-1/$m,$m); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg index 61baa364a5..0d3a8ead0e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg @@ -8,36 +8,38 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m=random(2,5,1); $b=non_zero_random(-4,4,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg index 60735190a8..e871e8605f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg @@ -8,36 +8,38 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m= -random(2,5,1); $b=non_zero_random(-4,4,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg index 9ff117e909..11d0fda32d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg @@ -8,36 +8,38 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m=1; do {$b=non_zero_random(-4,4,1)} until ($b != 1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg index 0c20171410..080c7fb2dd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg @@ -8,36 +8,38 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m= -1; do {$b=non_zero_random(-4,4,1)} until ($b != -1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg index a7c0926b8f..1ceee82779 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg @@ -8,37 +8,39 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", + "PGcourse.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", "PCCgraphMacros.pl", "pccTables.pl", - "PGcourse.pl" ); ############################################## Context("Fraction"); -$refreshCachedImages=1; + $num = random(1,5,1); do {$den=random(2,5,1);} until (gcd($num,$den)==1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg index 661431302a..d27dd56cee 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg @@ -8,36 +8,38 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## -$refreshCachedImages=1; + Context("Fraction"); $num = -random(1,5,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints10.pg new file mode 100644 index 0000000000..e149df8554 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints10.pg @@ -0,0 +1,206 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a line's equation, graph the line by finding two points on it. +# The line's equation looks like y=2x. +# +# Last edited: Jordan 8/18/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('coordinate','line','linear','equation','graph') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "pccTables.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + + +$m=random(2,5,1); +@ar_m = ($m,$m+1,-$m,-$m-1,$m); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([0,3],[0,12],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@ypoints = map {$_ * $marksep[0]} @ar_m; + +for my $i (0..4) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + add_functions($gr[$i], "$ar_m[$i]*x for x in <$min[0],$max[0]> using color:blue and weight:1"); + + $ALTtags[$i]="Graph $ALPHABET[$inverse{$i}]: graph of a line passing through the origin; it also passes through ($marksep[0], $ypoints[$i])"; +} + +pop(@ALTtags); +push(@ALTtags,"graph of a line passing through the origin; it also passes through ($marksep[0], $ypoints[4])"); + + + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + + + +############################################## + +BEGIN_PGML + +Choose the graph of the equation [` y= [$m] x `] in the coordinate system. This table can help you to find two points on the line. +END_PGML + +BEGIN_TEXT +$PAR +$BCENTER +\{ +DataTable([[{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Ordered pairs",header=>"CH"},], +["$SPACE","$SPACE","$SPACE"], +["$SPACE","$SPACE","$SPACE"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption =>" Values of \(x\) and \(y\) satisfying the equation \( y=$m x \) ", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$ECENTER +$PAR +END_TEXT + +BEGIN_PGML + The correct graph is graph + [@$radio->buttons()@]* + +[@EnlargeImageStatementPGML@]** +END_PGML + +BEGIN_TEXT +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +$x1 = 0; +$y1 = $m*$x1; +$x2 = $marksep[0]; +$y2 = $m*$x2; + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$pt1=Compute("($x1,$y1)"); +$pt2=Compute("($x2,$y2)"); + + +if ($m > 0) +{$p1vert = 'bottom'; + $p2vert = 'bottom'; + $p1hor = 'right'; + $p2hor = 'right';} +else {$p1vert = 'top'; + $p2vert = 'bottom'; + $p1hor = 'right'; + $p2hor = 'left';}; + +$gr[4]->stamps( closed_circle($x1,$y1,'red') ); +$gr[4]->lb( new Label($x1,$y1,"$pt1",'red',$p1hor,$p1vert)); +$gr[4]->stamps( closed_circle($x2,$y2,'red') ); +$gr[4]->lb( new Label($x2,$y2,"$pt2",'red',$p2hor,$p2vert)); + +Context()->texStrings; +BEGIN_SOLUTION + +We need two points to graph a line. In this problem, the equation is given in slope-intercept form, so it's easy to substitute values in for \(x\). Here we will try \( x=0 \) and \( x=$marksep[0] \), since the graphs we must choose from has grid lines at these places. +$PAR +$BCENTER +\{ +DataTable([[{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Location",header=>"CH"},], + ["\($x1\)","\($y1\)","\($pt1\)"], +["\($x2\)","\($y2\)","\($pt2\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center; width:60pt;", caption => "Values of \(x\) and \(y\) satisfying the equation \( y=$m x \)", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$ECENTER +$PAR + +Locating these two points in the coordinate system, we can see the correct answer is \{ $radio->correct_ans() \}. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[4]" title = "$ALTtags[4]"' ) \} +$ECENTER + + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg index 7e9a9b7abd..aeb0934edf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg @@ -8,36 +8,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multichoice_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = 0; $b=non_zero_random(-5,5,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg index ccb0b05854..3df129f5e2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg @@ -8,36 +8,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multichoice_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = 0; $b=non_zero_random(-5,5,1); @@ -88,9 +90,9 @@ for my $i (0..4) { if($i==0 or $i==4) { $gr[$i]->moveTo($b,$min[1]); - $gr[$i]->lineTo($b,$max[1],'blue',1); + $gr[$i]->lineTo($b,$max[1],'blue',2); push(@ypoints, $max[1]); - push(@ALTtags,"Graph $ALPHABET[$inverse{$i}]: graph of a line that goes through ($b,$min[0]) and ($b,$min[1])"); + push(@ALTtags,"Graph $ALPHABET[$inverse{$i}]: graph of a line that goes through ($b,$min[1]) and ($b,$max[1])"); } else { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints20.pg new file mode 100644 index 0000000000..6db7516433 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints20.pg @@ -0,0 +1,204 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a line's equation, graph the line by finding two points on it. +# The line's equation looks like y= -2x. +# +# Last edited: Jordan 8/18/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('coordinate','line','linear','equation','graph') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "pccTables.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + + +$m= -random(2,5,1); +@ar_m = ($m,$m+1,-$m,-$m-1,$m); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([0,3],[0,12],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@ypoints = map {$_ * $marksep[0]} @ar_m; + +for my $i (0..4) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + add_functions($gr[$i], "$ar_m[$i]*x for x in <$min[0],$max[0]> using color:blue and weight:1"); + + $ALTtags[$i]="Graph $ALPHABET[$inverse{$i}]: graph of a line passing through the origin; it also passes through ($marksep[0], $ypoints[$i])"; +} + +pop(@ALTtags); +push(@ALTtags,"graph of a line passing through the origin; it also passes through ($marksep[0], $ypoints[4])"); + + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + + + +############################################## + +BEGIN_PGML + +Choose the graph of the equation [` y= [$m] x `] in the coordinate system. This table can help you to find two points on the line. +END_PGML + +BEGIN_TEXT +$PAR +$BCENTER +\{ +DataTable([[{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Ordered pairs",header=>"CH"},], +["$SPACE","$SPACE","$SPACE"], +["$SPACE","$SPACE","$SPACE"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption =>" Values of \(x\) and \(y\) satisfying the equation \( y=$m x \) ", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$ECENTER +$PAR +END_TEXT + +BEGIN_PGML + The correct graph is graph + [@$radio->buttons()@]* + +[@EnlargeImageStatementPGML@]** +END_PGML + +BEGIN_TEXT +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +$x1 = 0; +$y1 = $m*$x1; +$x2 = $marksep[0]; +$y2 = $m*$x2; + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$pt1=Compute("($x1,$y1)"); +$pt2=Compute("($x2,$y2)"); + + +if ($m > 0) +{$p1vert = 'bottom'; + $p2vert = 'bottom'; + $p1hor = 'right'; + $p2hor = 'right';} +else {$p1vert = 'top'; + $p2vert = 'bottom'; + $p1hor = 'right'; + $p2hor = 'left';}; + +$gr[4]->stamps( closed_circle($x1,$y1,'red') ); +$gr[4]->lb( new Label($x1,$y1,"$pt1",'red',$p1hor,$p1vert)); +$gr[4]->stamps( closed_circle($x2,$y2,'red') ); +$gr[4]->lb( new Label($x2,$y2,"$pt2",'red',$p2hor,$p2vert)); + +Context()->texStrings; +BEGIN_SOLUTION + +We need two points to graph a line. In this problem, the equation is given in slope-intercept form, so it's easy to substitute values in for \(x\). Here we will try \( x=0 \) and \( x=$marksep[0] \), since the graphs we must choose from has grid lines at these places. +$PAR +$BCENTER +\{ +DataTable([[{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Location",header=>"CH"},], + ["\($x1\)","\($y1\)","\($pt1\)"], +["\($x2\)","\($y2\)","\($pt2\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center; width:60pt;", caption => "Values of \(x\) and \(y\) satisfying the equation \( y=$m x \)", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$ECENTER +$PAR + +Locating these two points in the coordinate system, we can see the correct answer is \{ $radio->correct_ans() \}. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[4]" title = "$ALTtags[4]"' ) \} +$ECENTER + + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg index 6626be6adf..de4ba45fae 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg @@ -9,37 +9,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multichoice_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num = random(2,9,1); do {$den = random(2,9,1);} until (gcd($num,$den)==1); @@ -68,7 +70,7 @@ for my $i (0..4) { $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], axes=>[0,0], grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] + size=>[240,240] ); $gr[$i]->lb('reset'); for my $j (@xticks) { @@ -90,9 +92,11 @@ for my $i (0..4) { $radio = RadioButtons( - ["A","B","C","D"], - $ALPHABET[$inverse{0}], # correct answer - order => ["A","B","C","D"], + [image( insertGraph($gr[$scramble{0}]), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ).$PAR, +image( insertGraph($gr[$scramble{1}]), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ).$PAR, +image( insertGraph($gr[$scramble{2}]), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ).$PAR, +image( insertGraph($gr[$scramble{3}]), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ).$PAR], + $inverse{0}, # correct answer ); #@ypoints = map {$_ * $den} @ar_m; @@ -104,49 +108,21 @@ BEGIN_PGML Choose the graph of the equation [` y= [$m] x `] in the coordinate system. You may like to complete the following table to help you to find two points on the line; choose _any_ two values of [`x`] and find the corresponding values of [`y`]. -END_PGML -Context()->texStrings; -BEGIN_TEXT -$PAR -$BCENTER -\{ -DataTable([[{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Ordered pairs",header=>"CH"},], +>>[@DataTable([[{data=>"\(x\)-value",header=>"CH"},{data=>"\(y\)-value",header=>"CH"},{data=>"Ordered pairs",header=>"CH"},], ["$SPACE","$SPACE","$SPACE"], ["$SPACE","$SPACE","$SPACE"], -], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption =>" Values of \(x\) and \(y\) satisfying the equation \( y=$m x \) ", captioncss =>"padding:4pt; text-decoration:none;"); -\} - -$ECENTER -$PAR -END_TEXT - -BEGIN_PGML - The correct graph is graph - [@$radio->buttons()@]* +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption =>" Values of \(x\) and \(y\) satisfying the equation \( y=$m x \) ", captioncss =>"padding:4pt; text-decoration:none;");@]*<< [@EnlargeImageStatementPGML@]** -END_PGML -BEGIN_TEXT -$BCENTER -\{ -LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), -image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), -], -[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), -image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) -]], allcellcss => "padding:20pt;") -\} -$ECENTER -$PAR + The correct graph is graph + [__]{$radio} -END_TEXT -Context()->normalStrings; +END_PGML ############################################## -ANS( $radio->cmp() ); $x1 = 0; $y1 = $m*$x1; @@ -195,7 +171,7 @@ $PAR Locating these two points in the coordinate system, we can see the correct answer is \{ $radio->correct_ans() \}. $PAR $BCENTER -\{ image( insertGraph($gr[4]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line passing through the origin; it also passes through ($den, $ypoint)" title = "graph of a line passing through the origin; it also passes through ($den, $ypoint)"' ) \} +\{ image( insertGraph($gr[4]), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>'alt = "graph of a line passing through the origin; it also passes through ($den, $ypoint)" title = "graph of a line passing through the origin; it also passes through ($den, $ypoint)"' ) \} $ECENTER END_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints35.pg index 8a953ea6e1..c12e18ce62 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints35.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints35.pg @@ -9,37 +9,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multichoice_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num = 3; $den = 1; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg index a8d70364cd..12f82bd3f1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg @@ -9,37 +9,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multichoice_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num = 1; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg index 6bbfc75d30..a828b22db8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg @@ -9,36 +9,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multichoice_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m=random(2,5,1); $b=non_zero_random(-5,5,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg index f2666f8c32..b8a37069a0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg @@ -9,36 +9,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multichoice_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m=-random(2,5,1); $b=non_zero_random(-5,5,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints70.pg index 05703f48f5..7f6b415adb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints70.pg @@ -7,37 +7,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multichoice_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "contextFraction.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num = 2; $den = 1; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg index 582bc13cb3..d031f76359 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg @@ -7,37 +7,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multichoice_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "contextFraction.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Fraction"); -$refreshCachedImages=1; + $num = 2; $den = 1; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg index 9f1d2cfaa7..31a588afd2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg @@ -8,36 +8,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multichoice_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = 0; $b=non_zero_random(-5,5,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg index b955904d6b..5e59a9757d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg @@ -8,36 +8,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multichoice_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $m = 0; $b=non_zero_random(-5,5,1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg index 36e8ec213f..a7663289d7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg @@ -8,38 +8,38 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinate','ordered pair',) ## DBCCSS('6.NS.6') -## DBsubject(Algebra) -## DBchapter(Cartesian coordinate system) -## DBsection(Plotting points) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(id_points_from_graph_1) -## MLTleader(1) -## Level(1) -## MO(1) -## KEYWORDS('coordinate','ordered pair') - +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $x = non_zero_random(-8,8,1); do {$y = non_zero_random(-8,8,1);} until (abs($x)!=abs($y)); @@ -157,3 +157,136 @@ END_PGML_SOLUTION ENDDOCUMENT(); + + + + +# OLD +# OLD +# OLD +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Identify an ordered pair on a coordinate system. The point could be in +# any quadrant, but not on any axis. +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinate','ordered pair',) +## DBCCSS('6.NS.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", +); + +############################################## + +Context("Numeric"); + + +$x = non_zero_random(-8,8,1); +do {$y = non_zero_random(-8,8,1);} until (abs($x)!=abs($y)); + +@ar_x = ($x,$x,-$x,-$x); +@ar_y = ($y,-$y,$y,-$y); + +$xmin = -10; +$xmax = 10; +$ymin = -10; +$ymax = 10; + +@gr=(); + +for ($i=0;$i<=3;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[$xmax-$xmin,$ymax-$ymin], + size=>[800,800] + ); + + $gr[$i]->stamps(closed_circle($ar_x[$i],$ar_y[$i],'blue')); +} + +#randomize choices +$j=5; +$p=random(1,3,1); +do {$q=random(1,3,1);} until ($p!=$q); +$gr[$j]=$gr[$p]; +$gr[$p]=$gr[$q]; +$gr[$q]=$gr[$j]; + +@ar_choice = ("A","B","C","D"); +$correct = random(0,3,1); +$gr[$j]=$gr[$correct]; +$gr[$correct]=$gr[0]; +$gr[0]=$gr[$j]; + +$radio = RadioButtons( + ["A","B","C","D"], + "$ar_choice[$correct]", # correct answer + order => ["A","B","C","D"], +); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing \( ($x,$y) \) in the coordinate system. +$PAR +Click on a graph to enlarge it. +$PAR + +A. \{ image( insertGraph($gr[0]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +B. \{ image( insertGraph($gr[1]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +C. \{ image( insertGraph($gr[2]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +D. \{ image( insertGraph($gr[3]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} + +$BR +$BR +\{ $radio->buttons() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +BEGIN_PGML_SOLUTION + +The correct answer is [$radio->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg index 14788895e7..6d1e740eff 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg @@ -7,37 +7,38 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinate','ordered pair',) ## DBCCSS('6.NS.6') -## DBsubject(Algebra) -## DBchapter(Cartesian coordinate system) -## DBsection(Plotting points) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(id_points_from_graph_1) -## Level(1) -## MO(1) -## KEYWORDS('coordinate','ordered pair') - +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $x = non_zero_random(-8,8,1); $y = 0; @@ -154,3 +155,136 @@ END_PGML_SOLUTION ENDDOCUMENT(); + + + + +# OLD +# OLD +# OLD +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Identify an ordered pair on a coordinate system. The point is on the x-axis. +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinate','ordered pair',) +## DBCCSS('6.NS.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", +); + +############################################## + +Context("Numeric"); + + +$x = non_zero_random(-8,8,1); +#do {$y = non_zero_random(-8,8,1);} until (abs($x)!=abs($y)); +$y = 0; + +@ar_x = ($x,-$x,$y,$y); +@ar_y = ($y,$y,$x,-$x); + +$xmin = -10; +$xmax = 10; +$ymin = -10; +$ymax = 10; + +@gr=(); + +for ($i=0;$i<=3;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[$xmax-$xmin,$ymax-$ymin], + size=>[800,800] + ); + + $gr[$i]->stamps(closed_circle($ar_x[$i],$ar_y[$i],'blue')); +} + +#randomize choices +$j=5; +$p=random(1,3,1); +do {$q=random(1,3,1);} until ($p!=$q); +$gr[$j]=$gr[$p]; +$gr[$p]=$gr[$q]; +$gr[$q]=$gr[$j]; + +@ar_choice = ("A","B","C","D"); +$correct = random(0,3,1); +$gr[$j]=$gr[$correct]; +$gr[$correct]=$gr[0]; +$gr[0]=$gr[$j]; + +$radio = RadioButtons( + ["A","B","C","D"], + "$ar_choice[$correct]", # correct answer + order => ["A","B","C","D"], +); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing \( ($x,$y) \) in the coordinate system. +$PAR +Click on a graph to enlarge it. +$PAR + +A. \{ image( insertGraph($gr[0]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +B. \{ image( insertGraph($gr[1]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +C. \{ image( insertGraph($gr[2]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +D. \{ image( insertGraph($gr[3]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} + +$BR +$BR +\{ $radio->buttons() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +BEGIN_PGML_SOLUTION + +The correct answer is [$radio->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg index 049ee9d9fb..af4d0a70bc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg @@ -7,36 +7,38 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinate','ordered pair',) ## DBCCSS('6.NS.6') -## DBsubject(Algebra) -## DBchapter(Cartesian coordinate system) -## DBsection(Plotting points) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(id_points_from_graph_1) -## Level(2) -## MO(1) -## KEYWORDS('coordinate','ordered pair') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $x = 0; $y = non_zero_random(-8,8,1); @@ -154,3 +156,135 @@ END_PGML_SOLUTION ENDDOCUMENT(); + + + +# OLD +# OLD +# OLD +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Identify an ordered pair on a coordinate system. The point is on the y-axis. +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinate','ordered pair',) +## DBCCSS('6.NS.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", +); + +############################################## + +Context("Numeric"); + + +$x = 0; +#do {$y = non_zero_random(-8,8,1);} until (abs($x)!=abs($y)); +$y = non_zero_random(-8,8,1); + +@ar_x = ($x,$x,$y,-$y); +@ar_y = ($y,-$y,$x,$x); + +$xmin = -10; +$xmax = 10; +$ymin = -10; +$ymax = 10; + +@gr=(); + +for ($i=0;$i<=3;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[$xmax-$xmin,$ymax-$ymin], + size=>[800,800] + ); + + $gr[$i]->stamps(closed_circle($ar_x[$i],$ar_y[$i],'blue')); +} + +#randomize choices +$j=5; +$p=random(1,3,1); +do {$q=random(1,3,1);} until ($p!=$q); +$gr[$j]=$gr[$p]; +$gr[$p]=$gr[$q]; +$gr[$q]=$gr[$j]; + +@ar_choice = ("A","B","C","D"); +$correct = random(0,3,1); +$gr[$j]=$gr[$correct]; +$gr[$correct]=$gr[0]; +$gr[0]=$gr[$j]; + +$radio = RadioButtons( + ["A","B","C","D"], + "$ar_choice[$correct]", # correct answer + order => ["A","B","C","D"], +); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing \( ($x,$y) \) in the coordinate system. +$PAR +Click on a graph to enlarge it. +$PAR + +A. \{ image( insertGraph($gr[0]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +B. \{ image( insertGraph($gr[1]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +C. \{ image( insertGraph($gr[2]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +D. \{ image( insertGraph($gr[3]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} + +$BR +$BR +\{ $radio->buttons() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +BEGIN_PGML_SOLUTION + +The correct answer is [$radio->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg index 6167653322..e92ab2d542 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg @@ -8,36 +8,38 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinate','ordered pair',) ## DBCCSS('6.NS.6') -## DBsubject(Algebra) -## DBchapter(Cartesian coordinate system) -## DBsection(Plotting points) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(id_points_from_graph_1) -## Level(1) -## MO(1) -## KEYWORDS('coordinate','ordered pair') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $x = non_zero_random(-8.5,8.5,1); do {$y = non_zero_random(-8.5,8.5,1);} until (abs($x)!=abs($y)); @@ -155,3 +157,136 @@ END_PGML_SOLUTION ENDDOCUMENT(); + + + + + + +# OLD +# OLD +# OLD +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Identify an ordered pair on a coordinate system. The point is not on any axis. +# Coordinate values are decimals. +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinate','ordered pair',) +## DBCCSS('6.NS.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", +); + +############################################## + +Context("Numeric"); + + +$x = non_zero_random(-8.5,8.5,1); +do {$y = non_zero_random(-8.5,8.5,1);} until (abs($x)!=abs($y)); + +@ar_x = ($x,$x,$y,-$y); +@ar_y = ($y,-$y,$x,$x); + +$xmin = -10; +$xmax = 10; +$ymin = -10; +$ymax = 10; + +@gr=(); + +for ($i=0;$i<=3;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[$xmax-$xmin,$ymax-$ymin], + size=>[800,800] + ); + + $gr[$i]->stamps(closed_circle($ar_x[$i],$ar_y[$i],'blue')); +} + +#randomize choices +$j=5; +$p=random(1,3,1); +do {$q=random(1,3,1);} until ($p!=$q); +$gr[$j]=$gr[$p]; +$gr[$p]=$gr[$q]; +$gr[$q]=$gr[$j]; + +@ar_choice = ("A","B","C","D"); +$correct = random(0,3,1); +$gr[$j]=$gr[$correct]; +$gr[$correct]=$gr[0]; +$gr[0]=$gr[$j]; + +$radio = RadioButtons( + ["A","B","C","D"], + "$ar_choice[$correct]", # correct answer + order => ["A","B","C","D"], +); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing \( ($x,$y) \) in the coordinate system. +$PAR + +A. \{ image( insertGraph($gr[0]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +B. \{ image( insertGraph($gr[1]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +C. \{ image( insertGraph($gr[2]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} +$PAR +D. \{ image( insertGraph($gr[3]), width=>400, height=>400, tex_size=>800, + extra_html_tags=>'title="Graph of a coordinate system with an ordered pair." alt="Graph of a coordinate system with an ordered pair."' ) \} + +$BR +$BR +\{ $radio->buttons() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +BEGIN_PGML_SOLUTION + +The correct answer is [$radio->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs50.pg new file mode 100644 index 0000000000..ab67bdb390 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs50.pg @@ -0,0 +1,155 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Identify an ordered pair on a coordinate system. +# +# Last edited: Yao 09/28/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinate','ordered pair',) +## DBCCSS('6.NS.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + + +$px1 = random(3,8,1)*random(-1,1,2); +$py1 = random(3,8,1); + +$px2 = random(3,8,1)*random(-1,1,2); +$py2 = random(-8,-3,1); + +$px3 = 0; +$py3 = non_zero_random(-8,8,1); + +$px4 = non_zero_random(-8,8,1); +$py4 = 0; + +$xmin = -10; +$xmax = 10; +$ymin = -10; +$ymax = 10; + + +#These two variables decide how many labels are on each axis. +$xmark = 2; +$ymark = 2; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[($xmax-$xmin)/$xmark,($ymax-$ymin)/$ymark], + size=>[xPixels(),yPixels()] +); + +$gr->lb('reset'); +for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { + if (Real($j) == 0) {$gr->lb( new Label(0.1, -0.1, ' '.$j,'black','left','top'));} + else {$gr->lb( new Label($j, -0.1, $j,'black','center','top'));} +} +for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(0, $j,' '.$j,'black','left','middle')); +} + +$gr->stamps(closed_circle($px1,$py1,'blue')); +$gr->stamps(closed_circle($px2,$py2,'blue')); +$gr->stamps(closed_circle($px3,$py3,'blue')); +$gr->stamps(closed_circle($px4,$py4,'blue')); + +$shift = 0.3; +$gr->lb( new Label($px1, $py1+$shift, "A",'blue','center','bottom')); +$gr->lb( new Label($px2, $py2-$shift, "B",'blue','center','top')); +$gr->lb( new Label($px3-$shift, $py3, "C",'blue','right','middle')); +$gr->lb( new Label($px4, $py4+$shift, "D",'blue','center','bottom')); + +$px1A = abs($px1); +$py1A = abs($py1); +$px1D = ($px1>0) ? "right" : "left"; +$py1D = ($py1>0) ? "up" : "down"; + +$px2A = abs($px2); +$py2A = abs($py2); +$px2D = ($px2>0) ? "right" : "left"; +$py2D = ($py2>0) ? "up" : "down"; + +$py3A = abs($py3); +$py3D = ($py3>0) ? "up" : "down"; + +$px4A = abs($px4); +$px4D = ($px4>0) ? "right" : "left"; + +$alt = "This is a coordinate system with some points. To reach Point A, starting from the origin, we move $px1A units to the $px1D, and then $py1A units $py1D; to reach Point B, starting from the origin, we move $px2A units to the $px2D, and then $py2A units $py2D; to reach Point C, starting from the origin, we move $py3A units $py3D; to reach Point D, starting from the origin, we move $px4A units $px4D."; + +Context("Point"); +$ans1=Compute("($px1,$py1)"); +$ans2=Compute("($px2,$py2)"); +$ans3=Compute("($px3,$py3)"); +$ans4=Compute("($px4,$py4)"); + + +############################################## + +BEGIN_PGML + +Locate each point in the graph: + +[@EnlargeImageStatementPGML@]** + + [@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" ) @]* + +Write each point's position as an ordered pair, like [`(1,2)`]. + +A: [_______]{$ans1} + +B: [_______]{$ans2} + +C: [_______]{$ans3} + +D: [_______]{$ans4} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +Solutions: + +A[`[$ans1]`] + +B[`[$ans2]`] + +C[`[$ans3]`] + +D[`[$ans4]`] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotDouble.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotDouble.pg new file mode 100644 index 0000000000..e9be9f3156 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotDouble.pg @@ -0,0 +1,68 @@ +# Plot a point where one coordinate is doubled from a given plotted point. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric"); + +@xy = (1..7)[NchooseK(7,2)]; +$point = Point(@xy); +$reflection = list_random( + ['first',Point(2*$xy[0],$xy[1])], + ['second',Point($xy[0],2*$xy[1])] +); + +$gt = GraphTool("{point,$reflection->[1]}")->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-1, 15, 15, -1], + staticObjects => [ "{point,$point}"], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $score = 0; + my @errors; + my $count = 0; + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) eq $correct->[0]->extract(1) && $j->extract(2) eq $correct->[0]->extract(2)) { + $score += 1; + next; + } + push(@errors, "The $nth plotted point is incorrect."); + } + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +A point is plotted. Graph the point that comes from doubling the [@$reflection->[0]@] coordinate. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMX.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMX.pg new file mode 100644 index 0000000000..071ea3d870 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMX.pg @@ -0,0 +1,96 @@ +# Plot y = mx for positive integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +$m = random(2,7,1); +($h,$k) = (0,0); +($u,$v) = ($h+1,$k+$m); + +Context("Numeric"); +$f = Formula("$m x")->reduce; +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMXPlusB.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMXPlusB.pg new file mode 100644 index 0000000000..ff0b113fe3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerMXPlusB.pg @@ -0,0 +1,102 @@ +# Plot y = mx+b for positive integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([2..7],[1]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerPointSlope.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerPointSlope.pg new file mode 100644 index 0000000000..59c9658157 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotIntegerPointSlope.pg @@ -0,0 +1,104 @@ +# Plot y = m(x-h)+k for positive integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +do { + ($rise,$run) = random_coprime([2..7],[1]); + Context("Fraction"); + $m = Fraction($rise,$run); + ($h,$k) = (-7..-1,1..7)[NchooseK(14,2)]; + ($u,$v) = ($h+$run,$k+$rise); + ($p,$q) = ($h-$run,$k-$rise); + Context()->flags->set(reduceConstants=>0); + $f = Formula("$m (x - $h) + $k")->reduce; + $b = $f->eval(x=>0); +} until (abs($b) > 8 && ((abs($u) < 8 && abs($v) < 8) || (abs($p) < 8 && abs($q) < 8))); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`] by identifying the slope and one point on the line. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMX.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMX.pg new file mode 100644 index 0000000000..dfc4ece4ad --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMX.pg @@ -0,0 +1,101 @@ +# Plot y = mx for positive fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([1..7],[2..7]); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,0); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +$f = Formula("$m x"); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMXPlusB.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMXPlusB.pg new file mode 100644 index 0000000000..785f5a0bf5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotMXPlusB.pg @@ -0,0 +1,102 @@ +# Plot y = mx+b for positive fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([1..7],[2..7]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMX.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMX.pg new file mode 100644 index 0000000000..d51eb91ee3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMX.pg @@ -0,0 +1,96 @@ +# Plot y = mx for negative integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +$m = -random(2,7,1); +($h,$k) = (0,0); +($u,$v) = ($h+1,$k+$m); + +Context("Numeric"); +$f = Formula("$m x")->reduce; +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMXPlusB.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMXPlusB.pg new file mode 100644 index 0000000000..2f62231f58 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerMXPlusB.pg @@ -0,0 +1,103 @@ +# Plot y = mx+b for negative integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([-7..-2],[1]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +Context()->noreduce('(-x)+y','(-x)-y'); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerPointSlope.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerPointSlope.pg new file mode 100644 index 0000000000..6259850cbb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegIntegerPointSlope.pg @@ -0,0 +1,105 @@ +# Plot y = m(x-h)+k for negative integer m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +do { + ($rise,$run) = random_coprime([-7..-2],[1]); + Context("Fraction"); + $m = Fraction($rise,$run); + ($h,$k) = (-7..-1,1..7)[NchooseK(14,2)]; + ($u,$v) = ($h+$run,$k+$rise); + ($p,$q) = ($h-$run,$k-$rise); + Context()->flags->set(reduceConstants=>0); + Context()->noreduce('(-x)-y','(-x)+y'); + $f = Formula("$m (x - $h) + $k")->reduce; + $b = $f->eval(x=>0); +} until (abs($b) > 8 && ((abs($u) < 8 && abs($v) < 8) || (abs($p) < 8 && abs($q) < 8))); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`] by identifying the slope and one point on the line. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMX.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMX.pg new file mode 100644 index 0000000000..18ebf85961 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMX.pg @@ -0,0 +1,101 @@ +# Plot y = mx for negative fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([-7..-1],[2..7]); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,0); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +$f = Formula("$m x"); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMXPlusB.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMXPlusB.pg new file mode 100644 index 0000000000..efd529f6a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegMXPlusB.pg @@ -0,0 +1,103 @@ +# Plot y = mx+b for negative fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([-7..-1],[2..7]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +Context()->noreduce('(-x)+y','(-x)-y'); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegPointSlope.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegPointSlope.pg new file mode 100644 index 0000000000..1625773d8f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegPointSlope.pg @@ -0,0 +1,104 @@ +# Plot y = m(x-h)+k for negative fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +do { + ($rise,$run) = random_coprime([-7..-1],[2..7]); + Context("Fraction"); + $m = Fraction($rise,$run); + ($h,$k) = (-7..-1,1..7)[NchooseK(14,2)]; + ($u,$v) = ($h+$run,$k+$rise); + ($p,$q) = ($h-$run,$k-$rise); + Context()->flags->set(reduceConstants=>0); + $f = Formula("$m (x - $h) + $k")->reduce; + $b = $f->eval(x=>0); +} until (int($b) != $b && ((abs($u) < 8 && abs($v) < 8) || (abs($p) < 8 && abs($q) < 8))); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`] by identifying the slope and one point on the line. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegSlopeThroughPoint.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegSlopeThroughPoint.pg new file mode 100644 index 0000000000..d67d0d091a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegSlopeThroughPoint.pg @@ -0,0 +1,101 @@ +# Plot a line of a given negative fraction slope that passes through a given +# point in [-3,3]x[-3,3]. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise, $run) = random_coprime([-5..-1],[2..5]); +($h,$k) = (-3..-1,1..3)[NchooseK(6,2)]; +($u,$v) = ($h+$run,$k+$rise); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + +Context("Fraction"); +$m = Fraction($rise,$run); + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + push(@errors, "The $nth plotted line does not pass through $A."); + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot a line through the point [`[$A]`] that has slope [`[$m]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegXPlusB.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegXPlusB.pg new file mode 100644 index 0000000000..9f7bc809d3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotNegXPlusB.pg @@ -0,0 +1,103 @@ +# Plot y = -x+b +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([-1],[1]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +Context()->noreduce('(-x)+y','(-x)-y'); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotPointSlope.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotPointSlope.pg new file mode 100644 index 0000000000..943a525e1e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotPointSlope.pg @@ -0,0 +1,104 @@ +# Plot y = m(x-h)+k for positive fraction m +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +do { + ($rise,$run) = random_coprime([1..7],[2..7]); + Context("Fraction"); + $m = Fraction($rise,$run); + ($h,$k) = (-7..-1,1..7)[NchooseK(14,2)]; + ($u,$v) = ($h+$run,$k+$rise); + ($p,$q) = ($h-$run,$k-$rise); + Context()->flags->set(reduceConstants=>0); + $f = Formula("$m (x - $h) + $k")->reduce; + $b = $f->eval(x=>0); +} until (int($b) != $b && ((abs($u) < 8 && abs($v) < 8) || (abs($p) < 8 && abs($q) < 8))); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`] by identifying the slope and one point on the line. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotReflection.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotReflection.pg new file mode 100644 index 0000000000..9c0a22ebc6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotReflection.pg @@ -0,0 +1,68 @@ +# Plot a point where one coordinate is negated from a given plotted point. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric"); + +@xy = (1..7)[NchooseK(7,2)]; +$point = Point(@xy); +$reflection = list_random( + ['first',Point(-$xy[0],$xy[1])], + ['second',Point($xy[0],-$xy[1])] +); + +$gt = GraphTool("{point,$reflection->[1]}")->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + staticObjects => [ "{point,$point}"], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $score = 0; + my @errors; + my $count = 0; + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) eq $correct->[0]->extract(1) && $j->extract(2) eq $correct->[0]->extract(2)) { + $score += 1; + next; + } + push(@errors, "The $nth plotted point is incorrect."); + } + return ($score, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +A point is plotted. Graph the point that comes from negating the [@$reflection->[0]@] coordinate. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotRelation.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotRelation.pg new file mode 100644 index 0000000000..77c24359d4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotRelation.pg @@ -0,0 +1,75 @@ +# Plot four points with a simple linear relation. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric"); + +my $b = non_zero_random(-7,7,1); +$absb = abs($b); +$cmp = ($b > 0) ? 'more' : 'less'; +$minx = max(-8,-8-$b); +$maxx = min(8,8-$b); +@point = map {Point($_,$_+$b)} ($minx..$maxx); +$points = '{point,'.join('},{point,',@point).'}'; + +$gt = GraphTool($points)->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my $extra = 0; + my $distinct = 0; + my @errors; + my $count = 0; + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + if ($j->extract(1) ne 'point' || ($j->extract(2)->value)[1] != ($j->extract(2)->value)[0] + $b) { + push(@errors, "The $nth plotted point is incorrect."); + $extra++; + next STUDENTS; + } + for my $i (0..($count-2)) { + next STUDENTS if ($j->extract(1) eq $student->[$i]->extract(1) && $j->extract(2) eq $student->[$i]->extract(2)); + } + $distinct++; + } + push(@errors, "You've only plotted $distinct correct point".(($distinct > 1)?'s':'').".") if ($distinct > 0 && $distinct < 4); + return (scalar(@{$correct})*min($distinct,4)/4/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Graph at least four distinct points where the [`y`]-coordinate is [`[$absb]`] [$cmp] than the [`x`]-coordinate. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlope.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlope.pg new file mode 100644 index 0000000000..bff33a7468 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlope.pg @@ -0,0 +1,103 @@ +# Plot three lines that each have the given slope. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise, $run) = random_coprime([1..5],[2..5]); + +Context("Numeric"); +@A = (); +for my $x (-8..(8-$run)) { + for my $y (-8..(-9+$rise)) { + push(@A, Point($x,$y)); + } +} +for my $x (-8..(-9+$run)) { + for my $y ((-8+$rise)..(8-$rise)) { + push(@A, Point($x,$y)); + } +} +%B = map{$_ => $_+Point($run,$rise)}(@A); +@gtlines = map{'{line,solid,' . $_ . ',' . $B{$_} .'}'} (@A); + + +Context("Fraction"); +$m = Fraction($rise,$run); + +$gt = GraphTool(join(',',@gtlines))->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $extra = 0; + my $distinct = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + push(@errors, "You've only plotted $distinct correct line".(($distinct > 1)?'s':'').".") if ($distinct > 0 && $distinct < 3); + return (scalar(@{$correct})*min($distinct,3)/3/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot at least three lines that each have slope [`[$m]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlopeThroughPoint.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlopeThroughPoint.pg new file mode 100644 index 0000000000..c3de374901 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSlopeThroughPoint.pg @@ -0,0 +1,101 @@ +# Plot a line of a given positive fraction slope that passes through a given +# point in [-3,3]x[-3,3]. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise, $run) = random_coprime([1..5],[2..5]); +($h,$k) = (-5..-1,1..3)[NchooseK(8,2)]; +($u,$v) = ($h+$run,$k+$rise); + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + +Context("Fraction"); +$m = Fraction($rise,$run); + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + push(@errors, "The $nth plotted line does not pass through $A."); + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot a line through the point [`[$A]`] that has slope [`[$m]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSmallPoints.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSmallPoints.pg new file mode 100644 index 0000000000..62757a183f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotSmallPoints.pg @@ -0,0 +1,74 @@ +# Plot four points on the [-7,7]x[-7,7] plane. +# One in each quadrant, except one moved onto an axis. +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserGraphTool.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +Context("Numeric"); + +@xy = (0..7)[NchooseK(8,8)]; +$point[0] = Point($xy[0],$xy[1]); +$point[1] = Point(-$xy[2],$xy[3]); +$point[2] = Point($xy[4],-$xy[5]); +$point[3] = Point(-$xy[6],-$xy[7]); +@point = (@point)[NchooseK(4,4)]; + +$gt = GraphTool("{point,$point[0]},{point,$point[1]},{point,$point[2]},{point,$point[3]}")->with( + availableTools => ["PointTool"], + showCoordinateHints => 0, + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + my @score = (0,0,0,0); + my @errors; + my $count = 0; + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + for my $i (0..3) { + if ($j->extract(1) eq $correct->[$i]->extract(1) && $j->extract(2) eq $correct->[$i]->extract(2)) { + $score[$i] += 1; + next STUDENTS; + } + } + push(@errors, "The $nth plotted point is incorrect."); + } + my $numerator = ($score[0] ? 1 : 0) + ($score[1] ? 1 : 0) + ($score[2] ? 1 : 0) + ($score[3] ? 1 : 0); + push(@errors, "You have only plotted $numerator of the given points.") if ($numerator > 0 && $numerator < 4); + my $denominator = 4 + $count - ($score[0] + $score[1] + $score[2] + $score[3]); + return ($numerator/$denominator*$count, @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Graph the points [`[$point[0]]`], [`[$point[1]]`], [`[$point[2]]`], and [`[$point[3]]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotXPlusB.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotXPlusB.pg new file mode 100644 index 0000000000..d3c0777d53 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/PlotXPlusB.pg @@ -0,0 +1,102 @@ +# Plot y = x+b +# Author: Alex Jordan + +################################################################################### +# Setup and Macros +################################################################################### +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserGraphTool.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +################################################################################### +# Variables and Formulas +################################################################################### +TEXT(beginproblem()); + +($rise,$run) = random_coprime([1],[1]); +$b = non_zero_random(-7,7); + +Context("Fraction"); +$m = Fraction($rise,$run); +($h,$k) = (0,$b); +($u,$v) = ($h+$run,$k+$rise); +Context()->flags->set(reduceConstants=>0); +$f = Formula("$m x+$b")->reduce; + +Context("Numeric"); +$A = Point($h,$k); +$B = Point($u,$v); + + +$gt = GraphTool("{line,solid,$A,$B}")->with( + availableTools => ["LineTool"], + bBox => [-8, 8, 8, -8], + cmpOptions => { + list_checker => sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my @errors; + my $count = 0; + my $distinct = 0; + my $extra = 0; + + STUDENTS: + for my $j (@$student) { + my $nth = Value::List->NameForNumber(++$count); + + my ($p1x, $p1y) = $j->extract(3)->value; + my ($p2x, $p2y) = $j->extract(4)->value; + if ($p1x == $p2x) { + push(@errors, "The $nth plotted line is a vertical line, and therefore does not have slope $m."); + $extra++; + next STUDENTS; + } + + my $context = Context(); + Context("Fraction"); + my $slope = Fraction($p2y - $p1y, $p2x - $p1x); + Context($context); + if ($slope != $m) { + push(@errors, "The $nth plotted line has slope $slope, not slope $m."); + $extra++; + next STUDENTS; + } + + if ($k != $slope*($h - $p1x) + $p1y) { + $extra++; + next STUDENTS; + } + + for my $i (0..($count-2)) { + my ($x,$y) = $student->[$i]->extract(3)->value; + next STUDENTS if ($y == $m*($x - $p1x) + $p1y); + } + $distinct++; + } + return (max(scalar(@{$correct}),scalar(@{$student}))*min($distinct,1)/1/(($extra)?2:1), @errors); + } + } +); + +################################################################################### +# Main Text +################################################################################### + +BEGIN_PGML +Plot [`y=[$f]`]. + +[_]{$gt} +END_PGML + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant10.pg index 099e990183..bfc9ba70be 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant10.pg @@ -6,15 +6,18 @@ # Last updated: Jordamn 8/7/13; Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinates','cartesian plane',) ## DBCCSS('6.NS.6.b') -## DBsubject(Algebra) -## DBchapter(Cartesian coordinate system) -## DBsection(Plotting points) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) -## KEYWORDS('coordinates','cartesian plane') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant20.pg new file mode 100644 index 0000000000..690ab5ba5b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant20.pg @@ -0,0 +1,164 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Understand those 4 quadrants. +# +# Last updated: Yao 1/16/2017 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinates','cartesian plane',) +## DBCCSS('6.NS.6.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGtikz.pl", + "ORCCA.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +@conditions = ( + ['x>0 \text{ and } y>0','Quadrant I'], + ['x<0 \text{ and } y>0','Quadrant II'], + ['x<0 \text{ and } y<0','Quadrant III'], + ['x>0 \text{ and } y<0','Quadrant IV'], + ['x=0','the y-axis'], + ['y=0','the x-axis'] +); + +%scramble = (); +%inverse = (); +for my $i (0..5) { + do {$temp = list_random(0..5)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$popup0 = PopUp(['?', 'Quadrant I', 'Quadrant II', 'Quadrant III', 'Quadrant IV', 'the x-axis', 'the y-axis'], "$conditions[$scramble{0}][1]"); +$popup1 = PopUp(['?', 'Quadrant I', 'Quadrant II', 'Quadrant III', 'Quadrant IV', 'the x-axis', 'the y-axis'], "$conditions[$scramble{1}][1]"); +$popup2 = PopUp(['?', 'Quadrant I', 'Quadrant II', 'Quadrant III', 'Quadrant IV', 'the x-axis', 'the y-axis'], "$conditions[$scramble{2}][1]"); +$popup3 = PopUp(['?', 'Quadrant I', 'Quadrant II', 'Quadrant III', 'Quadrant IV', 'the x-axis', 'the y-axis'], "$conditions[$scramble{3}][1]"); +$popup4 = PopUp(['?', 'Quadrant I', 'Quadrant II', 'Quadrant III', 'Quadrant IV', 'the x-axis', 'the y-axis'], "$conditions[$scramble{4}][1]"); +$popup5 = PopUp(['?', 'Quadrant I', 'Quadrant II', 'Quadrant III', 'Quadrant IV', 'the x-axis', 'the y-axis'], "$conditions[$scramble{5}][1]"); + +$xmin = -8; +$xmax = 8; +$ymin = -8; +$ymax = 8; + +#These two variables decide how many labels are on each axis. +$xmark = 2; +$ymark = 2; + +$shift = 0.2; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + ] + \addplot[soliddot] coordinates {(5,0)} node[above] {\((5,0)\)}; + \addplot[soliddot] coordinates {(3,3)} node[above] {\((3,3)\)}; + \addplot[soliddot] coordinates {(0,5)} node[right] {\((0,5)\)}; + \addplot[soliddot] coordinates {(-3,3)} node[above] {\((-3,3)\)}; + \addplot[soliddot] coordinates {(-5,0)} node[above] {\((-5,0)\)}; + \addplot[soliddot] coordinates {(-3,-3)} node[above] {\((-3,-3)\)}; + \addplot[soliddot] coordinates {(0,-5)} node[right] {\((0,-5)\)}; + \addplot[soliddot] coordinates {(3,-3)} node[above] {\((3,-3)\)}; + \node[above left] at (axis cs: 6,6) {Quadrant I}; + \node[above right] at (axis cs: -6,6) {Quadrant II}; + \node[below right] at (axis cs: -6,-6) {Quadrant III}; + \node[below left] at (axis cs: 6,-6) {Quadrant IV}; +\end{axis} +END_TIKZ + +$alt = "This is a coordinate system with the x-axis and y-axis. The following points are marked and labeled: ($sample1, $sample1) in Quadrant I, (-$sample1, $sample1) in Quadrant II, (-$sample1, -$sample1) in Quadrant III, ($sample1, -$sample1) in Quadrant IV, ($sample2, 0) and (-$sample2, 0) on the x-axis, and (0, $sample2) and (0, -$sample2) on the y-axis."; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Answer the following questions on the coordinate system: + + For the point [`(x,y)`], if [`[$conditions[$scramble{0}][0]]`], then the point is in/on [@$popup0->menu()@]*. + + For the point [`(x,y)`], if [`[$conditions[$scramble{1}][0]]`], then the point is in/on [@$popup1->menu()@]*. + + For the point [`(x,y)`], if [`[$conditions[$scramble{2}][0]]`], then the point is in/on [@$popup2->menu()@]*. + + For the point [`(x,y)`], if [`[$conditions[$scramble{3}][0]]`], then the point is in/on [@$popup3->menu()@]*. + + For the point [`(x,y)`], if [`[$conditions[$scramble{4}][0]]`], then the point is in/on [@$popup4->menu()@]*. + + For the point [`(x,y)`], if [`[$conditions[$scramble{5}][0]]`], then the point is in/on [@$popup5->menu()@]*. + + +END_PGML + +ANS( $popup0->cmp() ); +ANS( $popup1->cmp() ); +ANS( $popup2->cmp() ); +ANS( $popup3->cmp() ); +ANS( $popup4->cmp() ); +ANS( $popup5->cmp() ); + +############################################## + + +BEGIN_PGML_SOLUTION + +The following graph has some points and their coordinates. They should help you answer the questions. + +[@EnlargeImageStatementPGML@]** + + [@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>" alt = '$alt' title = '$alt'" ) @]* + +The correct answers are: + + For the point [`(x,y)`], if [`[$conditions[$scramble{0}][0]]`], then the point is in/on [@$popup0->correct_ans()@]*. + + For the point [`(x,y)`], if [`[$conditions[$scramble{1}][0]]`], then the point is in/on [@$popup1->correct_ans()@]*. + + For the point [`(x,y)`], if [`[$conditions[$scramble{2}][0]]`], then the point is in/on [@$popup2->correct_ans()@]*. + + For the point [`(x,y)`], if [`[$conditions[$scramble{3}][0]]`], then the point is in/on [@$popup3->correct_ans()@]*. + + For the point [`(x,y)`], if [`[$conditions[$scramble{4}][0]]`], then the point is in/on [@$popup4->correct_ans()@]*. + + For the point [`(x,y)`], if [`[$conditions[$scramble{5}][0]]`], then the point is in/on [@$popup5->correct_ans()@]*. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant30.pg new file mode 100644 index 0000000000..47cb2a4188 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/Quadrant30.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Understand those 4 quadrants. +# +# Last updated: Yao 1/16/2017 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinates','cartesian plane',) +## DBCCSS('6.NS.6.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +@conditions = ( +# ['I','II','IV','III',1,1], + ['II','I','III','IV',-1,1], + ['III','IV','II','I',-1,-1], + ['IV','III','I','II',1,-1], +); + +%scramble = (); +%inverse = (); +for my $i (0..2) { + do {$temp = list_random(0..2)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$popup0 = PopUp(['?', 'I', 'II', 'III', 'IV'], "$conditions[$scramble{0}][1]"); +$popup1 = PopUp(['?', 'I', 'II', 'III', 'IV'], "$conditions[$scramble{0}][2]"); +$popup2 = PopUp(['?', 'I', 'II', 'III', 'IV'], "$conditions[$scramble{0}][3]"); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + + Assume the point [`(x,y)`] is in Quadrant [$conditions[$scramble{0}][0]], locate the following points: + + The point [`(-x,y)`] is in Quadrant [@$popup0->menu()@]*. + + The point [`(x,-y)`] is in Quadrant [@$popup1->menu()@]*. + + The point [`(-x,-y)`] is in Quadrant [@$popup2->menu()@]*. + +END_PGML + +ANS( $popup0->cmp() ); +ANS( $popup1->cmp() ); +ANS( $popup2->cmp() ); + +############################################## + + +BEGIN_PGML_SOLUTION + +It's easier to do this problem if we substitute [`(x,y)`] with some random numbers. + +If the point [`(x,y)`] if in Quadrant [$conditions[$scramble{0}][0]], say it's [`([$conditions[$scramble{0}][4]],[$conditions[$scramble{0}][5]])`], then: + + the point [`(-x,y)`], or [`([$conditions[$scramble{0}][4]*-1],[$conditions[$scramble{0}][5]])`], is in Quadrant [@$popup0->correct_ans()@]*. + + the point [`(x,-y)`], or [`([$conditions[$scramble{0}][4]],[$conditions[$scramble{0}][5]*-1])`], is in Quadrant [@$popup1->correct_ans()@]*. + + the point [`(-x,-y)`], or [`([$conditions[$scramble{0}][4]*-1],[$conditions[$scramble{0}][5]*-1])`], is in Quadrant [@$popup2->correct_ans()@]*. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg index e45179512b..7d00bf5474 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg @@ -7,36 +7,38 @@ # Last edited Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m= -1; do {$b=non_zero_random(-4,4,1)} until ($b != -1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg index 56c5d2c927..c9160504b2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg @@ -8,37 +8,39 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "contextFraction.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Fraction"); -$refreshCachedImages=1; + $a= random(2,6,1); do {$d= -random(2,6,1);} until (gcd($a,$d)==1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg index 1a363cda91..bada7227d6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg @@ -8,37 +8,39 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "contextFraction.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Fraction"); -$refreshCachedImages=1; + $a= -random(2,6,1); do {$d= -random(2,6,1);} until (gcd($a,$d)==1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg index b9b1d465dc..5fd8a4fecb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg @@ -8,37 +8,39 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "contextFraction.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Fraction"); -$refreshCachedImages=1; + $a=random(2,6,1); do {$d=random(2,6,1)*random(-1,1,2);} until (gcd($a,$d)==1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg index 866ad2cfb1..c770bf2df5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg @@ -7,36 +7,38 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); -$refreshCachedImages=1; + $m=1; do {$b=non_zero_random(-4,4,1)} until ($b != 1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg index d009b803f0..db256c8846 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg @@ -7,37 +7,39 @@ # Last edited Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Fraction"); -$refreshCachedImages=1; + $m=random(2,5,1)*random(-1,1,2); do {$b=non_zero_random(-4,4,1)} until ($b != $m); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg index 7a56e585ce..072bb4e11c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg @@ -7,48 +7,48 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Fraction"); -$refreshCachedImages=1; + $m=random(2,5,1)*random(-1,1,2); $b=non_zero_random(-4,4,1); -$coef = -$m; - -@ar_mb = ([$m,$b],[$m+1,$b],[$m-1,$b],[$m,$b+1]); +$coef = $m; -$xint = Fraction(-$b,$m); -$yint = $b; +$xint = Fraction($b,$m); +$yint = -$b; -@ar_mb = ([$m,$b],[$m*2,$b],[$b,$m],[$m,$b-1],[$m,$b],[$m,$b]); +@ar_mb = ([$m,-$b],[$m*2,-$b],[-$b,$m],[$m,-$b-1],[$m,-$b],[$m,-$b]); #Create a hash and its inverse that randomizes the order of the four graphs. %scramble = (); @@ -125,7 +125,7 @@ TEXT(beginproblem()); BEGIN_PGML -Choose the graph that shows the solutions to [`[$coef]x+y= [$b]`]. First sketch the line on your own graphing paper. *Warning:* if you skip the steps that you should be doing on paper, then you are not practicing what the exercise intends for your to practice. +Choose the graph that shows the solutions to [`[$m]x-y= [$b]`]. First sketch the line on your own graphing paper. *Warning:* if you skip the steps that you should be doing on paper, then you are not practicing what the exercise intends for your to practice. The correct graph is graph [@$radio->buttons()@]* @@ -154,10 +154,12 @@ Context()->normalStrings; ############################################## +$mNeg = -$m; + ANS( $radio->cmp() ); $x1 = 0; -$y1 = $b; +$y1 = -$b; $run = 1; $rise = $m; @@ -189,10 +191,13 @@ $BBOLD Use the slope-intercept form.$EBOLD Any linear equation (that does not describe a vertical line) can be algebraically rearranged into slope-intercept form. \[\begin{aligned} - $coef x+y &= $b\\ - $coef x+y\mathbf{{}+$m x} &= $b\mathbf{{}+$m x}\\ - y&= $m x+$b\end{aligned}\] - + $m x-y &= $b\\ + $m x-y\mathbf{{}-$m x} &= $b\mathbf{{}-$m x}\\ + -y&= $mNeg x+$b \\ + (-1)\cdot (-y) &= (-1)\cdot ($mNeg x) + (-1)\cdot ($b) \\ + y &= $m x -$b +\end{aligned}\] +$PAR Now we can easily read its \(y\)-intercept. This line's \(y\)-intercept is \( ($x1,$y1) \). $PAR @@ -219,8 +224,8 @@ $BBOLD Find the \(x\)- and \(y\)-intercepts.$EBOLD To find the \(x\)-intercept, we substitute in \(0\) for \(y\) and find: \[\begin{aligned} - $coef x+y &= $b\\ - $coef x+0&= $b\\ + $coef x-y &= $b\\ + $coef x-0&= $b\\ $coef x&= $b\\ \frac{$coef x}{$coef}&= \frac{$b}{$coef}\\ x & = $xint @@ -232,9 +237,11 @@ So the \(x\)-intercept is at \(($xint,0)\). $PAR To find the \(y\)-intercept, we substitute in \(0\) for \(x\) and find: \[\begin{aligned} - $coef x+y &= $b\\ - $coef(0)+y&= $b\\ - y&= $yint\end{aligned}\] + $coef x-y &= $b\\ + $coef(0)-y&= $b\\ + -y&=$b\\ + y&= $yint +\end{aligned}\] $PAR So the \(y\)-intercept is at \((0,$yint)\). diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg index 25b99465fe..be65e9dfd5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg @@ -8,37 +8,39 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", + "PGcourse.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "PCCgraphMacros.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## Context("Fraction"); -$refreshCachedImages=1; + $d=random(2,5,1); $c=non_zero_random(-3,3,1)*$d; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg index 3caa34c2b8..4e47491424 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg @@ -8,37 +8,39 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", + "PGcourse.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "contextFraction.pl", "PCCgraphMacros.pl", - "PGcourse.pl" ); ############################################## Context("Fraction"); -$refreshCachedImages=1; + $d= -random(2,5,1); $c=non_zero_random(-3,3,1)*$d; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg index 71a25f81fa..22a1c2cf5d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg @@ -8,37 +8,39 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "contextFraction.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Fraction"); -$refreshCachedImages=1; + #ax+dy=c diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg index deb704cb80..9db6ae138b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg @@ -8,37 +8,39 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "contextFraction.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Fraction"); -$refreshCachedImages=1; + $a=random(2,6,1); do {$d=random(2,6,1);} until (gcd($a,$d)==1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg index 1a324106eb..f2113847c4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg @@ -8,37 +8,39 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(solutions_graph) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','standard form','slope-intercept','fraction') +## DBCCSS('8.EE.6','8.F.3','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", + "PGcourse.pl", "PGML.pl", "parserRadioButtons.pl", "pccTables.pl", "contextFraction.pl", "PCCgraphMacros.pl", - "PGcourse.pl" ); ############################################## Context("Fraction"); -$refreshCachedImages=1; + $a= -random(2,6,1); do {$d=random(2,6,1);} until (gcd($a,$d)==1); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg index 91921df74e..4528a91f93 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg @@ -8,32 +8,33 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(table_match) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','table','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserMultiAnswer.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -42,7 +43,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=ax^2. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg index ccbaf054d7..056500d3f1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg @@ -8,31 +8,33 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(table_match) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','table','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserMultiAnswer.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -41,7 +43,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=ax^2. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20ORCCACheckpoint.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20ORCCACheckpoint.pg new file mode 100644 index 0000000000..58637cbafd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20ORCCACheckpoint.pg @@ -0,0 +1,281 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a quadratic function's equation, build a table and graph it. +# y=ax^2, where |a|<1, and a could be positive or negative. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/20/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','table','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "parserMultiAnswer.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + + +#This array stores value of a in y=ax^2. +#$a[0] is the correct graph. The others are used in wrong graphs. +#$a[4] is used in the correct graph. +@a=(); +$a[0] = list_random(-7..-3)*0.1; +$a[1] = $a[0]+0.1; +$a[2] = $a[0]+0.2; +$a[3] = $a[0]-0.2; +$a[4] = $a[0]; + +$left = Compute("y"); +$right = Compute("$a[0]*x**2")->reduce; + +@defaultAnswers = (); +for my $i (0..4) { + $x[$i] = $i-2; + $y[$i] = $right->eval(x=>$x[$i]); + push(@defaultAnswers,$x[$i]); + push(@defaultAnswers,$y[$i]); +} + +$multians = MultiAnswer(@defaultAnswers)->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my @sxy = @{$student}; + my @xs, @ys; + for my $k (0..4) + {$xs[$k] = $sxy[2*$k]; + $ys[$k] = $sxy[2*$k+1];} + # + # Loop though the student answers + ## + for ($i = 0; $i <= 4; $i++) { + my $ith = Value::List->NameForNumber($i+1); + # + # Check that the student's answers are Reals + # + Value->Error("Your $ith x-value is not a number") if ($xs[$i]->type ne "Number"); + Value->Error("Your $ith y-value is not a number") if ($ys[$i]->type ne "Number"); + # + # Check that the point hasn't been given before + # + for ($j = 0, $used = 0; $j < $i; $j++) { + my $jth = Value::List->NameForNumber($j+1); + if ($xs[$j] == $xs[$i] and $ys[$j] == $ys[$i]) { + Value->Error("Your $ith row in the table is the same as your $jth row") unless $ansHash->{isPreview}; + $used = 1; last; + } + } + # + # If not already used, check that it satisfies the equation + # and increase the score if so. + # + if (!$used) { + Value->Error("Your $ith row is not correct") unless $ansHash->{isPreview} or $left->eval(x=>$xs[$i],y=>$ys[$i]) == $right->eval(x=>$xs[$i],y=>$ys[$i]); + } + } + return 1; +}); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + + +#These two variables decide how many labels are on each axis. +$xmark = 1; +$ymark = 1; + +$xmin = -7; +$xmax = -$xmin; +if ($a[0]>0) { + $ymin = -7; + $ymax = 2; +} else { + $ymin = -7; + $ymax = 2; +} + +@gr=(); + +#$gr[0] through $gr[3] are options; $gr[4] is used in solution. +for ($i=0;$i<=4;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[($xmax-$xmin)/$xmark,($ymax-$ymin)/$ymark], + size=>[240,207] + ); + $gr[$i]->lb('reset'); + for $j (-6,6) { + $gr[$i]->lb( new Label($j, -0.1, $j,'black','center','top','large')); + } + for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label(0, $j,' '.$j,'black','left','middle','large')); + } + + $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top','large')) unless ($i==4); + add_functions($gr[$i], "$a[$i]*x**2 for x in <$xmin,$xmax> using color:red and weight:1"); + + $xpoint1 = $xmin; + $xpoint2 = 0; + $xpoint3 = $xmax; + + $ypoint1 = $a[$i]*($xpoint1**2); + $ypoint2 = $a[$i]*($xpoint2**2); + $ypoint3 = $a[$i]*($xpoint3**2); + if($i==4) + { + push(@alt,"Graph $ALPHABET[$inverse{0}]: graph of a parabola passing through the points ($xpoint1,$ypoint1), ($xpoint2,$ypoint2) and ($xpoint3,$ypoint3)"); + } + else + { + push(@alt,"Graph $ALPHABET[$inverse{$i}]: graph of a parabola passing through the points ($xpoint1,$ypoint1), ($xpoint2,$ypoint2) and ($xpoint3,$ypoint3)"); + } + +} + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +############################################## + +BEGIN_PGML + +Make a table of solutions for the equation [`[$left]=[$right]`]. Then graph the equation. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +\{ +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},], + [$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Values of \(x\) and \(y\) satisfying the equation \($left=$right\)", captioncss =>"padding:4pt; text-decoration:none;"); +\} + + +$PAR + +END_TEXT + +Context()->normalStrings; + + +############################################## + +ANS( $multians->cmp() ); +ANS( $radio->cmp() ); + +############################################## + +#Plot some points in the correct solution graph. +for my $i (0..4) { + $gr[4]->stamps( closed_circle($defaultAnswers[2*$i], $defaultAnswers[2*$i+1],'black') ); + if ($defaultAnswers[2*$i]>=0) { + #$gr[4]->lb( new Label($defaultAnswers[2*$i],$defaultAnswers[2*$i+1], " ($defaultAnswers[2*$i],$defaultAnswers[2*$i+1]) ",'black','left','top','large')); + } else { + #$gr[4]->lb( new Label($defaultAnswers[2*$i],$defaultAnswers[2*$i+1], " ($defaultAnswers[2*$i],$defaultAnswers[2*$i+1]) ",'black','right','top','large')); + } +} + +sub format_list { + return "" if !@_; + my $last = pop(@_); + return '\('.$last.'\)' if !@_; + return '\('.join('\), \(', @_) .'\) and \('. $last.'\)'; +} + +$xvals = format_list(@x); + +for my $i (0..4) { +$ls[$i] = $left->substitute(x=>$x[$i]); +$rs[$i] = $right->substitute(x=>$x[$i]); +} + +Context()->texStrings; +BEGIN_SOLUTION + +This solution will use the \(x\) values $xvals. The choice to use these \(x\)-values is arbitrary. Since they are small numbers, they might make calculations easier. It's important to include negative numbers. + +One at a time, we substitute these \(x\)-values into the equation \($left=$right\), and solve for \(y\) + +\[\begin{aligned} +$ls[0] = $rs[0] &\implies y=$y[0]\\ +$ls[1] = $rs[1] &\implies y=$y[1]\\ +$ls[2] = $rs[2] &\implies y=$y[2]\\ +$ls[3] = $rs[3] &\implies y=$y[3]\\ +$ls[4] = $rs[4] &\implies y=$y[4]\\ +\end{aligned} +\] + +So the table may be completed as: + +\{ +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\(y\)",header=>"CH"},], + ["\($x[0]\)", "\($y[0]\)"], +["\($x[1]\)", "\($y[1]\)"], +["\($x[2]\)", "\($y[2]\)"], +["\($x[3]\)", "\($y[3]\)"], +["\($x[4]\)", "\($y[4]\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;width:60pt;", caption => "Values of \(x\) and \(y\) satisfying the equation \($left=$right\)", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$PAR +Using the values in the table, we can plot the following graph. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{4}]" title = "$alt[$scramble{4}]"' ) \} +$ECENTER +$PAR +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg index b5d19302bd..9d8f655c64 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg @@ -8,31 +8,33 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(table_match) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','table','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserMultiAnswer.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -42,7 +44,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=(x+a)^2. #$gr[0] shows y=(x+a)^2 diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg index 06f76e7f38..bb2c9a79a5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg @@ -8,31 +8,33 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(table_match) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','table','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserMultiAnswer.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -41,7 +43,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg index c0f39c7940..6fc8f5e710 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg @@ -8,31 +8,33 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(table_match) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','table','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserMultiAnswer.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -41,7 +43,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=ax^2. #$a[0], $b[0], $c[0] are used in the correct graph. @@ -197,12 +199,12 @@ for ($i=0;$i<=4;$i++) { $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); add_functions($gr[$i], "$a[$i]*x**2+$b[$i]*x+$c[$i] for x in <$xmin,$xmax> using color:red and weight:1"); - $xpoint1 = $xmin; + $xpoint1 = $xmin+1; $xpoint2 = 0; - $xpoint3 = $xmax; - $ypoint1 = $xpoint1**2 + $a[$i]*$xpoint1; - $ypoint2 = $xpoint2**2 + $a[$i]*$xpoint2; - $ypoint3 = $xpoint3**2 + $a[$i]*$xpoint3; + $xpoint3 = $xmax-1; + $ypoint1 = $a[$i]*($xpoint1)**2 + $b[$i]*$xpoint1 + $c[$i]; + $ypoint2 = $a[$i]*($xpoint2)**2 + $b[$i]*$xpoint2 + $c[$i]; + $ypoint3 = $a[$i]*($xpoint3)**2 + $b[$i]*$xpoint3 + $c[$i]; if($i==4) { push(@alt,"Graph $ALPHABET[$inverse{0}]: graph of a parabola passing through the points ($xpoint1,$ypoint1), ($xpoint2,$ypoint2) and ($xpoint3,$ypoint3). Its vertex is $vertex[$i]."); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg index a418bd8648..c0d03ee111 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(axis_vertex) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','vertex','axis') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,7 +62,9 @@ $vertex = Compute("(-$h,$k)"); BEGIN_PGML -Find the axis of symmetry and vertex of the quadratic function [`[$left]=[$right]`]. +Find the axis of symmetry and vertex of the quadratic function. + + [`[$left]=[$right]`] Axis of symmetry: [_____________]{$axis->cmp(cmp_class=>"an equation of a line")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg index 88628c9376..c4680c8b93 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(axis_vertex) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','vertex','axis','fraction') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "parserImplicitPlane.pl", "contextFraction.pl", "parserAssignment.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -71,7 +74,9 @@ $den = 2*$a; BEGIN_PGML -Find the axis of symmetry and vertex of the quadratic function [`[$left]=[$right]`]. Use fractions in your answers. +Find the axis of symmetry and vertex of the quadratic function. + + [`[$left]=[$right]`] [@KeyboardInstructions('(Use fractions in your answers.)')@]** Axis of symmetry: [_____________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg index 0860a125f1..9b32f337b8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(axis_vertex) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','vertex','axis','decimal') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "parserImplicitPlane.pl", "contextFraction.pl", "parserAssignment.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -65,7 +68,9 @@ $axis = Compute("x=$px"); BEGIN_PGML -Find the axis of symmetry and vertex of the quadratic function [`[$left]=[$right]`]. Use decimals in your answers. +Find the axis of symmetry and vertex of the quadratic function. + + [`[$left]=[$right]`] [@KeyboardInstructions('(Use decimals in your answers.)')@]** Axis of symmetry: [_____________]{$axis} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg index dca53aa692..4e6e554c73 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(axis_vertex) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','vertex','axis') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,7 +63,9 @@ $vertex = Compute("(-$h,$k)"); BEGIN_PGML -Find the axis of symmetry and vertex of the quadratic function [`[$left]=[$right]`]. +Find the axis of symmetry and vertex of the quadratic function. + + [`[$left]=[$right]`] Axis of symmetry: [_____________]{$axis->cmp(cmp_class=>"an equation of a line")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg index 1fa65b0ce9..9533f1ad73 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(axis_vertex) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','vertex','axis') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,7 +63,9 @@ $vertex = Compute("(-$h,$k)"); BEGIN_PGML -Find the axis of symmetry and vertex of the quadratic function [`[$left]=[$right]`]. +Find the axis of symmetry and vertex of the quadratic function. + + [`[$left]=[$right]`] Axis of symmetry: [_____________]{$axis->cmp(cmp_class=>"an equation of a line")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg index 59b4d55dfc..70f67610a5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(axis_vertex) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','vertex','axis') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,7 +62,9 @@ $vertex = Compute("(-$h,$k)"); BEGIN_PGML -Find the axis of symmetry and vertex of the quadratic function [`[$left]=[$right]`]. +Find the axis of symmetry and vertex of the quadratic function. + + [`[$left]=[$right]`] Axis of symmetry: [_____________]{$axis->cmp(cmp_class=>"an equation of a line")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg index ea13e0b174..1521c592bf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(axis_vertex) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','vertex','axis') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -63,7 +65,9 @@ $vertex = Compute("($px,$py)"); BEGIN_PGML -Find the axis of symmetry and vertex of the quadratic function [`[$left]=[$right]`]. +Find the axis of symmetry and vertex of the quadratic function. + + [`[$left]=[$right]`] Axis of symmetry: [_____________]{$axis->cmp(cmp_class=>"an equation of a line")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg index 2351feb444..f8afabc233 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(axis_vertex) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','vertex','axis') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,7 +66,9 @@ $vertex = Compute("($px,$py)"); BEGIN_PGML -Find the axis of symmetry and vertex of the quadratic function [`[$left]=[$right]`]. +Find the axis of symmetry and vertex of the quadratic function. + + [`[$left]=[$right]`] Axis of symmetry: [_____________]{$axis->cmp(cmp_class=>"an equation of a line")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg index 7a471e11c9..42c2ac1661 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(axis_vertex) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','vertex','axis') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,7 +66,9 @@ $vertex = Compute("($px,$py)"); BEGIN_PGML -Find the axis of symmetry and vertex of the quadratic function [`[$left]=[$right]`]. +Find the axis of symmetry and vertex of the quadratic function. + + [`[$left]=[$right]`] Axis of symmetry: [_____________]{$axis->cmp(cmp_class=>"an equation of a line")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg index dd38fa55fc..cdf2d425ae 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(axis_vertex) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','vertex','axis') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,7 +64,9 @@ $vertex = Compute("($px,$py)"); BEGIN_PGML -Find the axis of symmetry and vertex of the quadratic function [`[$left]=[$right]`]. +Find the axis of symmetry and vertex of the quadratic function. + + [`[$left]=[$right]`] Axis of symmetry: [_____________]{$axis->cmp(cmp_class=>"an equation of a line")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg index 56fb711df4..2999550dd4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(axis_vertex) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','vertex','axis') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,7 +66,9 @@ $vertex = Compute("($px,$py)"); BEGIN_PGML -Find the axis of symmetry and vertex of the quadratic function [`[$left]=[$right]`]. +Find the axis of symmetry and vertex of the quadratic function. + + [`[$left]=[$right]`] Axis of symmetry: [_____________]{$axis->cmp(cmp_class=>"an equation of a line")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts10.pg index 08dd7e3058..2b9e779b58 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts10.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -61,11 +63,11 @@ $ansX = List(Point($x1,0),Point($x2,0)); BEGIN_PGML -Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic function [`[$left]=[$right]`]. +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. -If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist." +[`[$left]=[$right]`] -If the parabola has two [`x`]-intercepts, use comma to separate them. +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them.")@]** [`y`]-intercept: [________________]{$ansY} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts100.pg index aaaf7fbdbe..4fb20d98e7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts100.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_mc) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +32,8 @@ loadMacros( "PGML.pl", "contextLimitedRadical.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts110.pg index f0780ddfef..8c6964eae3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts110.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_mc) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +33,8 @@ loadMacros( "contextLimitedRadical.pl", "parserRadioButtons.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts115.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts115.pg index e60a9acc2f..02f012d65c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts115.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts115.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_mc) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,8 @@ loadMacros( "contextLimitedRadical.pl", "parserRadioButtons.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg index 271250a421..0a44800519 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -62,13 +65,12 @@ $ansX = List(Point($x1,0),Point($x2,0)); BEGIN_PGML -Find the [`y`]-intercept and any [`x`]-intercept(s) of the parabola with equation [`[$left]=[$right]`]. - -If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist." +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] -If the parabola has two [`x`]-intercepts, use a comma to separate them. +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them. Use decimals when needed.")@]** -Use decimals when needed. [`y`]-intercept: [________________]{$ansY} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts130.pg new file mode 100644 index 0000000000..95c01d1d7a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts130.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find x-intercept(s) and y-intercept of y=ax^2+bx+c. a is positive. +# Polynomial can be factored. There is only one x-intercept. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +$n = list_random(2,4,5); +do {$p = random(1,10,1);} until (gcd($p,$n)==1); +$p = $p*random(-1,1,2); + +$x1 = -$p/$n; +$x2 = $x1; + +$a = $n*$n; +$b = 2*$n*$p; +$c = $p*$p; + +$left = Compute("y"); +$right = Compute("$a*x**2+$b*x+$c")->reduce; + +$ansY = Point(0,$c); + +$ansX = Point($x1,0); + +############################################## + +BEGIN_PGML + +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] + +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them. Use decimals when needed.")@]** + + [`y`]-intercept: [________________]{$ansY} + + [`x`]-intercept(s): [_________________]{$ansX} + +END_PGML + +############################################## + +$s1 = -$p; + +BEGIN_PGML_SOLUTION + +To find a parabola's [`y`]-intercept, we substitute [`x=0`] into [`[$left]=[$right]`], and we have [`y=[$c]`]. + +The parabola's [`y`]-intercept is [`(0,[$c])`]. + +To find a parabola's [`x`]-intercept, we substitute [`y=0`] into [`[$left]=[$right]`], and then solve for [`x`]. + +For this problem, the polynomial can be factored: + + [`` +\begin{aligned}[t] + y &= [$right] \\ + 0 &= [$right] \\ + 0 &= ([$n]x+[$p])([$n]x+[$p]) \\ + [$n]x+[$p] &= 0 \\ + [$n]x &= [$s1] \\ + x &= [$x1] +\end{aligned} + ``] + +The parabola has one [`x`]-intercept: [`([$x1],0)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts140.pg new file mode 100644 index 0000000000..c56bf11d77 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts140.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find x-intercept(s) and y-intercept of y=ax^2+c. a is positive. +# Polynomial can be factored. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +$n = list_random(2,4,5); +do {$p = random(1,10,1);} until (gcd($p,$n)==1); +$p = $p*random(-1,1,2); + +$x1 = -$p/$n; +$x2 = -$x1; + +$a = $n*$n; +$b = 0; +$c = -$p*$p; + +$left = Compute("y"); +$right = Compute("$a*x**2+$b*x+$c")->reduce; + +$ansY = Point(0,$c); + +$ansX = List(Point($x1,0),Point($x2,0)); + + +############################################## + +BEGIN_PGML + +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] + +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them. Use decimals when needed.")@]** + + + [`y`]-intercept: [________________]{$ansY} + + [`x`]-intercept(s): [_________________]{$ansX} + +END_PGML + +############################################## + +$s1 = -$p; +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +To find a parabola's [`y`]-intercept, we substitute [`x=0`] into [`[$left]=[$right]`], and we have [`y=[$c]`]. + +The parabola's [`y`]-intercept is [`(0,[$c])`]. + +To find a parabola's [`x`]-intercept, we substitute [`y=0`] into [`[$left]=[$right]`], and then solve for [`x`]. + +For this problem, the polynomial can be factored: + + [`` +\begin{aligned}[t] + y &= [$right] \\ + 0 &= [$right] \\ + 0 &= ([$n]x+[$p])([$n]x-[$p]) \\ + [$n]x+[$p] = 0 \quad &\text{or} \quad [$n]x-[$p] = 0 \\ + [$n]x = [$s1] \quad &\text{or} \quad [$n]x = [$p] \\ + x = [$x1] \quad &\text{or} \quad x = [$x2] +\end{aligned} + ``] + +The parabola's [`x`]-intercepts are [`([$x1],0)`] and [`([$x2],0)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts150.pg new file mode 100644 index 0000000000..5213343e89 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts150.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find x-intercept(s) and y-intercept of y=ax^2+bx+c. +# Polynomial can be factored. a is negative. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +$a = list_random(2,4,5); +do {$p = random(1,10,1);} until (gcd($p,$a)==1); +$p = $p*random(-1,1,2); + +$x1 = -$p/$a; +$x2 = non_zero_random(-3,3,1); + +$b = ($p-$a*$x2); +$c = -$p*$x2; + +$left = Compute("y"); +$right = Compute("-$b*x-$c-$a*x**2")->reduce; +$right1 = Compute("-$a*x**2-$b*x-$c")->reduce; + +$ansY = Point(0,-$c); + +$ansX = List(Point($x1,0),Point($x2,0)); + + +############################################## + +BEGIN_PGML + +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] + +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them. Use decimals when needed.")@]** + + [`y`]-intercept: [________________]{$ansY} + + [`x`]-intercept(s): [_________________]{$ansX} + +END_PGML + +############################################## + +$s1 = -$p; +$right2 = Compute("$a*x**2+$b*x+$c")->reduce; +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We need to change the parabola to standard form first: + + [`` [$left] = [$right1] ``] + +To find a parabola's [`y`]-intercept, we substitute [`x=0`] into [`[$left]=[$right1]`], and we have [`y=[$c*-1]`]. + +The parabola's [`y`]-intercept is [`(0,[$c*-1])`]. + +To find a parabola's [`x`]-intercept, we substitute [`y=0`] into [`[$left]=[$right1]`], and then solve for [`x`]. + +For this problem, once we factor out the leading negative one, notice that the polynomial can be factored: + + [`` +\begin{aligned}[t] + y &= [$right1] \\ + 0 &= [$right1] \\ + 0 &= -([$right2]) \\ + 0 &= -([$a]x+[$p])(x-[$x2]) \\ + [$a]x+[$p] = 0 \quad &\text{or} \quad x-[$x2] = 0 \\ + [$a]x = [$s1] \quad &\text{or} \quad x = [$x2] \\ + x = [$x1] \quad &\text{or} \quad x = [$x2] +\end{aligned} + ``] + +The parabola's [`x`]-intercepts are [`([$x1],0)`] and [`([$x2],0)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg index bb70e81642..90bd4fed3e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -60,13 +63,11 @@ $ansX = List(Point($x1,0),Point($x2,0)); BEGIN_PGML -Find the [`y`]-intercept and any [`x`]-intercept(s) of the parabola with equation [`[$left]=[$right]`]. - -If the parabola doesn't have any [`x`]-intercepts, type *DNE*, meaning "does not exist." - -If the parabola has two [`x`]-intercepts, use a comma to separate them. +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] -Use decimals when needed. +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them. Use decimals when needed.")@]** [`y`]-intercept: [________________]{$ansY} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts170.pg index d071d553bc..0268bb168a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts170.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts170.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_mc) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts180.pg index 6ecc53bce2..c9d73c91f9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts180.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts180.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_mc) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts190.pg index ef7de2da47..05ddf042e0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts190.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts190.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_mc) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,8 @@ loadMacros( "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg index 50443b8177..43aa643829 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -59,11 +62,11 @@ $ansX = List(Point($x1,0),Point($x2,0)); BEGIN_PGML -Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic function [`[$left]=[$right]`]. - -If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist." +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] -If the parabola has two [`x`]-intercepts, use comma to separate them. +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them.")@]** [`y`]-intercept: [________________]{$ansY} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg index bd850f949d..0d1ee87243 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Forms: vertex, factored, general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_vertex_form) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -63,7 +66,7 @@ BEGIN_PGML Find the [`y`]-intercept and any [`x`]-intercept(s) of the parabola with equation [`[$left]=[$right]`]. -If the parabola doesn't have any [`x`]-intercepts, type *DNE*, meaning "does not exist." +If the parabola doesn't have any [`x`]-intercepts, type [|DNE|]*, meaning "does not exist." If the parabola has two [`x`]-intercepts, use a comma to separate them. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts210.pg index ece86015ce..f15102f3f8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts210.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts210.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Forms: vertex, factored, general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts_vertex_form) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -66,7 +69,7 @@ BEGIN_PGML Find the [`y`]-intercept and any [`x`]-intercept(s) of the parabola with equation [`[$left]=[$right]`]. -If the parabola doesn't have any [`x`]-intercepts, type *DNE*, meaning "does not exist." +If the parabola doesn't have any [`x`]-intercepts, type [|DNE|]*, meaning "does not exist." If the parabola has two [`x`]-intercepts, use a comma to separate them. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts220.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts220.pg new file mode 100644 index 0000000000..cdb1a96c6e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts220.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find x-intercept(s) and y-intercept of y=a(x+h)^2+k. +# There are no x-intercepts. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/23/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +$a = non_zero_random(-5,5,1); +$k = $a*list_random(1..5); +$h = non_zero_random(-5,5,1); + +$left = Compute("y"); +$right = Compute("$a*(x+$h)**2+$k")->reduce; + +$intY = $right->eval(x=>0); + +$ansY = Point(0,$intY); + +$ansX = Compute("DNE"); + + +############################################## + +BEGIN_PGML + +Find the [`y`]-intercept and any [`x`]-intercept(s) of the parabola with equation [`[$left]=[$right]`]. + +If the parabola doesn't have any [`x`]-intercepts, type [|DNE|]*, meaning "does not exist." + +If the parabola has two [`x`]-intercepts, use a comma to separate them. + + [`y`]-intercept: [________________]{$ansY} + + [`x`]-intercept(s): [_________________]{$ansX} + +END_PGML + +############################################## + +$s1 = $h**2; +$s2 = $a*$s1; +$s3 = -$k; +$s4 = $s3/$a; + +BEGIN_PGML_SOLUTION + +To find a parabola's [`y`]-intercept, we substitute [`x=0`] into [`[$left]=[$right]`], and we have: + + [`` +\begin{aligned}[t] + y &= [$right] \\ + y &= [$a](0+[$h])^{2}+[$k] \\ + &= [$a]([$h])^{2}+[$k] \\ + &= [$a] \cdot [$s1]+[$k] \\ + &= [$s2]+[$k] \\ + &= [$intY] +\end{aligned} + ``] + +The parabola's [`y`]-intercept is [`(0,[$intY])`]. + +To find a parabola's [`x`]-intercept, we substitute [`y=0`] into [`[$left]=[$right]`], and then solve for [`x`]: + + [`` +\begin{aligned}[t] + y &= [$right] \\ + 0 &= [$right] \\ +\end{aligned} + ``] + +We will try to use the square root property to solve this equation: + + [`` +\begin{aligned}[t] + 0 \mathbf{{}-[$k]} &= [$right] \mathbf{{}-[$k]} \\ + [$s3] &= [$a](x+[$h])^{2} \\ + \frac{[$s3]}{[$a]} &= \frac{[$a](x+[$h])^{2}}{[$a]} \\ + [$s4] &= (x+[$h])^{2} \\ +\end{aligned} + ``] + +Notice that [`[$s4]`] is negative, but [`(x+[$h])^{2}`] cannot be negative. + +This implies there is no real solution for this equation, and thus the parabola does not have any [`x`]-intercept. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts230.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts230.pg new file mode 100644 index 0000000000..3ab450260d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts230.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find x-intercept(s) and y-intercept of y=a(x+h)^2. +# There is one x-intercept. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/23/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +$a = non_zero_random(-5,5,1); +$k = 0; +$h = non_zero_random(-5,5,1); + +$x1 = -$h; + +$left = Compute("y"); +$right = Compute("$a*(x+$h)**2+$k")->reduce; + +$intY = $right->eval(x=>0); + +$ansY = Point(0,$intY); + +$ansX = Point($x1,0); + + +############################################## + +BEGIN_PGML + +Find the [`y`]-intercept and any [`x`]-intercept(s) of the parabola with equation [`[$left]=[$right]`]. + +If the parabola doesn't have any [`x`]-intercepts, type [|DNE|]*, meaning "does not exist." + +If the parabola has two [`x`]-intercepts, use a comma to separate them. + + [`y`]-intercept: [________________]{$ansY} + + [`x`]-intercept(s): [_________________]{$ansX} + +END_PGML + +############################################## + +$s1 = $h**2; +$s2 = $a*$s1; +$s3 = -$k; +$s4 = $s3/$a; + +BEGIN_PGML_SOLUTION + +To find a parabola's [`y`]-intercept, we substitute [`x=0`] into [`[$left]=[$right]`], and we have: + + [`` +\begin{aligned}[t] + y &= [$right] \\ + y &= [$a](0+[$h])^{2} \\ + &= [$a]([$h])^{2} \\ + &= [$a] \cdot [$s1] \\ + &= [$intY] +\end{aligned} + ``] + +The parabola's [`y`]-intercept is [`(0,[$intY])`]. + +To find a parabola's [`x`]-intercept, we substitute [`y=0`] into [`[$left]=[$right]`], and then solve for [`x`]: + + [`` +\begin{aligned}[t] + y &= [$right] \\ + 0 &= [$right] \\ +\end{aligned} + ``] + +It's easier to use the square root property to solve this equation: + + [`` +\begin{aligned}[t] + \frac{[$s3]}{[$a]} &= \frac{[$a](x+[$h])^{2}}{[$a]} \\ + 0 &= (x+[$h])^{2} \\ + x+[$h] &= 0 \\ + x &= [$x1] +\end{aligned} + ``] + +This parabola has one [`x`]-intercept: [`([$x1],0)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg index f11cbbb257..453bc52428 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -59,11 +63,11 @@ $ansX = List(Point($x1,0),Point($x2,0)); BEGIN_PGML -Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic function [`[$left]=[$right]`]. - -If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist." +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] -If the parabola has two [`x`]-intercepts, use comma to separate them. +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them.")@]** [`y`]-intercept: [________________]{$ansY} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts40.pg index 18a942aea7..1dd1c0534b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts40.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -60,11 +63,11 @@ $ansX = List(Point($x1,0),Point($x2,0)); BEGIN_PGML -Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic function [`[$left]=[$right]`]. - -If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist." +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] -If the parabola has two [`x`]-intercepts, use comma to separate them. +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them.")@]** [`y`]-intercept: [________________]{$ansY} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg index e3720baf69..0d7ae39aa5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -60,11 +63,11 @@ $ansX = List(Point($x1,0),Point($x2,0)); BEGIN_PGML -Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic function [`[$left]=[$right]`]. - -If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist." +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] -If the parabola has two [`x`]-intercepts, use comma to separate them. +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them.")@]** [`y`]-intercept: [________________]{$ansY} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts60.pg index 649545eb54..b51f463eae 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts60.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -60,11 +63,11 @@ $ansX = List(Point($x1,0),Point($x2,0)); BEGIN_PGML -Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic function [`[$left]=[$right]`]. - -If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist." +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] -If the parabola has two [`x`]-intercepts, use comma to separate them. +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them.")@]** [`y`]-intercept: [________________]{$ansY} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg index 14fa521135..23d9ceb220 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -59,11 +62,11 @@ $ansX = List(Point($x1,0)); BEGIN_PGML -Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic function [`[$left]=[$right]`]. - -If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist." +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] -If the parabola has two [`x`]-intercepts, use comma to separate them. +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them.")@]** [`y`]-intercept: [________________]{$ansY} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts80.pg index 34eff2da9a..218cfdbc42 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts80.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -43,7 +46,7 @@ Context()->strings->add("does not exist"=>{alias=>'DNE'}); $a = 1; $c = non_zero_random(2,10,1); -$b = non_zero_random(1,int(sqrt(4*$a*$c)),1); +$b = non_zero_random(1,int(sqrt(4*$a*$c)-1),1); $left = Compute("y"); $right = Compute("$a*x**2+$b*x+$c")->reduce; @@ -57,11 +60,11 @@ $ansX = String("DNE"); BEGIN_PGML -Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic function [`[$left]=[$right]`]. - -If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist." +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] -If the parabola has two [`x`]-intercepts, use comma to separate them. +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them.")@]** [`y`]-intercept: [________________]{$ansY} @@ -104,7 +107,7 @@ Identify that [`a=[$a],b=[$b],c=[$c]`]. We have: The square root of a negative number us *not real*, so this quadratic equation has no real solution. -The parabola doesn't have any [`x`]-intercept. Type *DNE* (does not exist) as the solution. +The parabola doesn't have any [`x`]-intercept. Type [|DNE|]* (does not exist) as the solution. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg index 44ded4ffdf..eb31ca74b6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.8.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(intercepts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept') +## DBCCSS('F.IF.7.a','F.IF.8.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -59,8 +62,6 @@ $ansY = Point(0,$c); $x1 = (-$b+sqrt($b**2-4*$a*$c))/(2*$a); $x2 = (-$b-sqrt($b**2-4*$a*$c))/(2*$a); -$x1 = sprintf "%.2f", $x1; -$x2 = sprintf "%.2f", $x2; $ansX = List(Point($x1,0),Point($x2,0)); @@ -69,12 +70,11 @@ $ansX = List(Point($x1,0),Point($x2,0)); BEGIN_PGML -Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic function [`[$left]=[$right]`]. - -If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist." +Find the [`y`]-intercept and any [`x`]-intercept(s) of the quadratic curve. + +[`[$left]=[$right]`] -If the parabola has two [`x`]-intercepts, use comma to separate them. -Round your answer to *two* decimal places. +[@KeyboardInstructions("If the parabola does not have any [`x`]-intercept, type [|DNE|]*, meaning does not exist. If the parabola has two [`x`]-intercepts, use a comma to separate them.")@]** [`y`]-intercept: [________________]{$ansY} @@ -114,8 +114,7 @@ Identify that [`a=[$a],b=[$b],c=[$c]`]. We have: x &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ x &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$c])}}{2([$a])} \\ x &= \frac{[$s1] \pm \sqrt{[$dis]}}{[$s2]} \\ - x &\approx \frac{[$s1] + [$s3]}{[$s2]} & \text{or} && x &\approx \frac{[$s1] - [$s3]}{[$s2]} \\ - x & \approx [$x1] & \text{or} && x &\approx [$x2] + x & \approx [$x1] \text{ or } x \approx [$x2] \end{aligned} ``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg index 780f0329da..e138933754 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg @@ -7,31 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(quadratic_shift) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg index d6bc906cbd..e88c921bc2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg @@ -7,30 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(quadratic_shift) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a and b in y= -(x+a)^2+b. #$a[0], b[0] are the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg index 56c8ef7aa2..7e7865bf13 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg @@ -8,36 +8,38 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(quadratic_shift) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Fraction"); @a=(); @@ -52,7 +54,7 @@ $a[3] = $a[0]; Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of b in y=ax^2+b. #b[0] is in the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg new file mode 100644 index 0000000000..cb6bdf3e83 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg @@ -0,0 +1,208 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Identify graph of y=ax^2+b, where a and b are non-zero real numbers. +# |a|>1. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + + +#This array stores value of b in y=ax^2+b. +#a[0],b[0] is in the correct graph. The others are used in wrong graphs. +@a=(); +$a[0] = list_random(-4..-2,2..4); +$a[1] = $a[0]; +$a[2] = $a[0]; +$a[3] = $a[0]; +@b=(); +$b[0] = list_random(-5..-2,2..5); +$b[1] = $b[0]; +$b[2] = -$b[0]; +$b[3] = -$b[0]; + +$left = Compute("y"); +$right = Compute("$a[0]*x**2+$b[0]")->reduce; + +#for alternative display and title purposes +@rightFunc = (); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +@vertex=(); + +@extraPoint = (); +@extraPointX = (); +@extraPointY = (); +for my $i (0..3) { + $rightFunc[$i] = Compute("(-1)^($i)*$a[$i]*x**2+$b[$i]")->reduce; + $vertex[$i]=Compute("(0,$b[$i])"); + + @temp = $vertex[$i]->value; + $extraPointX[$i] = $temp[0]+1; + $extraPointY[$i] = $rightFunc[$i]->eval(x=>$extraPointX[$i]); + $extraPoint[$i] = Compute("($extraPointX[$i],$extraPointY[$i])"); +} + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$xmin = -10; +$xmax = -$xmin; +$ymin = -10; +$ymax = 10; + +#These two variables decide how many labels are on each axis. +$xmark = 2; +$ymark = 2; + +@gr=(); + +#$gr[0] through $gr[3] are options. +for ($i=0;$i<=3;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[($xmax-$xmin)/$xmark,($ymax-$ymin)/$ymark], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + if ($i!=4) { + for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { + $gr[$i]->lb( new Label($j, -0.1, $j,'black','center','top')); + } + } + + for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(0, $j,' '.$j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + add_functions($gr[$i], "x**2 for x in <$xmin,$xmax> using color:black and weight:1"); + + add_functions($gr[$i], "$rightFunc[$i] for x in <$xmin,$xmax> using color:red and weight:3"); + + push(@alt,"Graph $ALPHABET[$inverse{$i}]: This picture shows graphs of two parabolas. One parabola is y=x^2. The other parabola's vertex is $vertex[$i], and passes through the point $extraPoint[$i]."); + +} + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +############################################## + +BEGIN_PGML + +Choose the correct graph for the equation [`[$left]=[$right]`]. In each graph, the graph of [`y=x^{2}`] is in black, while the graph of [`[$left]=[$right]`] is in (thicker) red. + +[@EnlargeImageStatementPGML()@]** + + The correct graph is graph + [@$radio->buttons()@]* + +END_PGML + +Context()->texStrings; +BEGIN_TEXT +$PAR +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{0}]" title = "$alt[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{1}]" title = "$alt[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{2}]" title = "$alt[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{3}]" title = "$alt[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +############################################## + +$aValue = $a[0]; +$ThinOrWide = abs($a[0])>1 ? "thinner" : "wider"; +$aPosOrNeg = $a[0]>0 ? "positive" : "negative"; +$FaceUpDown = $a[0]>0 ? "up" : "down"; +$bValue = $b[0]; +$bAbs = abs($b[0]); +$UpOrDown = $b[0]>0 ? "up" : "down"; + +BEGIN_PGML_SOLUTION + +In [`[$left]=[$right]`], since the coefficient of the square term is [$aPosOrNeg], the parabola faces [$FaceUpDown]. + +Since the coefficient of the square term has an absolute value greater than 1, the parabola is thinner than that of [`y=x^{2}`]. + +The part [`[$bValue]`] implies the parabola will shift [$UpOrDown] by [`[$bAbs]`] units. + +[@ $radio->correct_ans() @]** is the correct answer. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg new file mode 100644 index 0000000000..18642e1179 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg @@ -0,0 +1,211 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Identify graph of y= a(x+h)^2+k, where a,h,k are non-zero real numbers. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + + +#These arrays store value of a,h,k in y= a(x+h)^2+k. +# [0] are used in the correct graph. The others are used in wrong graphs. +@a=(); @h=(); @k=(); +$a[0] = list_random(-5..-2,2..5)*10**(random(-1,0,1)); +$h[0] = list_random(-5..-2,2..5); +$k[0] = list_random(-5..-2,2..5); +$a[1] = -$a[0]; $h[1] = $h[0]; $k[1]=$k[0]; +$a[2] = $a[0]; $h[2] = -$h[0]; $k[2]=$k[0]; +$a[3] = -$a[0]; $h[3] = $h[0]; $k[3]=-$k[0]; + +$left = Compute("y"); +$right = Compute("$a[0]*(x+$h[0])**2+$k[0]")->reduce; + +#for alternative display and title purposes +@rightFunc = (); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +@vertex=(); + +@extraPoint = (); +@extraPointX = (); +@extraPointY = (); +for my $i (0..3) { + $rightFunc[$i] = Compute("$a[$i]*(x+$h[$i])**2+$k[$i]")->reduce; + $vertex[$i]=Compute("(-$h[$i],$k[$i])"); + + @temp = $vertex[$i]->value; + $extraPointX[$i] = $temp[0]+1; + $extraPointY[$i] = $rightFunc[$i]->eval(x=>$extraPointX[$i]); + $extraPoint[$i] = Compute("($extraPointX[$i],$extraPointY[$i])"); +} + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + + + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$xmin = -10; +$xmax = -$xmin; +$ymin = -10; +$ymax = 10; + +#These two variables decide how many labels are on each axis. +$xmark = 2; +$ymark = 2; + +@gr=(); + +#$gr[0] through $gr[3] are options. +for ($i=0;$i<=3;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[($xmax-$xmin)/$xmark,($ymax-$ymin)/$ymark], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + if ($i!=4) { + for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { + $gr[$i]->lb( new Label($j, -0.1, $j,'black','center','top')); + } + } + + for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(0, $j,' '.$j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + add_functions($gr[$i], "x**2 for x in <$xmin,$xmax> using color:black and weight:1"); + + add_functions($gr[$i], "$rightFunc[$i] for x in <$xmin,$xmax> using color:red and weight:3"); + + push(@alt,"Graph $ALPHABET[$inverse{$i}]: This picture shows graphs of two parabolas. One parabola is y=x^2. The other parabola's vertex is $vertex[$i], and passes through the point $extraPoint[$i]."); +} + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +############################################## + +BEGIN_PGML + +Choose the correct graph for the equation [`[$left]=[$right]`]. In each graph, the graph of [`y=x^{2}`] is in black, while the graph of [`[$left]=[$right]`] is in (thicker) red. + +[@EnlargeImageStatementPGML()@]** + + The correct graph is graph + [@$radio->buttons()@]* + +END_PGML + +Context()->texStrings; +BEGIN_TEXT +$PAR +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{0}]" title = "$alt[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{1}]" title = "$alt[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{2}]" title = "$alt[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{3}]" title = "$alt[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +############################################## + +$aPosNeg = $a[0]>0 ? "positive" : "negative"; +$FaceUpDown = $a[0]>0 ? "up" : "down"; + +$aCompareWith1 = abs($a[0])>1 ? "greater than" : "smaller than"; +$ThinOrWide = abs($a[0])>1 ? "thinner" : "wider"; + +$hValue = $h[0]; +$hAbs = abs($h[0]); +$LeftOrRight = $h[0]>0 ? "left" : "right"; + +$kValue = $k[0]>0 ? "+$k[0]" : "$k[0]"; +$kAbs = abs($k[0]); +$UpOrDown = $k[0]>0 ? "up" : "down"; + +BEGIN_PGML_SOLUTION + +In [`[$left]=[$right]`], since the coefficient of the square term is [$aPosNeg], the parabola faces [$FaceUpDown]. + +Since the coefficient of the square term is [$aCompareWith1] [`1`], the parabola is [$ThinOrWide] than the parabola of [`y=x^{2}`]. + +The part [`(x+[$hValue])^2`] implies the parabola will shift to the [$LeftOrRight] by [`[$hAbs]`] units. + +The part [`[$kValue]`] implies the parabola will shift [$UpOrDown] by [`[$kAbs]`] units. + +[@ $radio->correct_ans() @]** is the correct answer. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg index f2617bca6f..ed2ef98780 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg @@ -7,30 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(quadratic_shift) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg index aae9723cc9..4e97f26375 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg @@ -7,30 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(quadratic_shift) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg new file mode 100644 index 0000000000..0b16411d5e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg @@ -0,0 +1,200 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Identify graph of y=(x+a)^2, where a is a negative integer. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/20/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','graph','shift') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + + +#This array stores value of a in y=x^2+a. +#$a[0] is the correct graph. The others are used in wrong graphs. +#$a[4] is used in the correct graph. +@a=(); +$a[0] = list_random(-5..-1); +$a[1] = -$a[0]; +$a[2] = $a[0]; +$a[3] = -$a[0]; +$a[4] = $a[0]; + +$left = Compute("y"); +$right = Compute("(x+$a[0])**2")->reduce; + +#for alternative display and title purposes +@rightFunc = (); +$rightFunc[0] = Compute("(x+$a[0])**2")->reduce; +$rightFunc[1] = Compute("(x+$a[1])**2")->reduce; +$rightFunc[2] = Compute("x**2+$a[2]")->reduce; +$rightFunc[3] = Compute("x**2+$a[3]")->reduce; +$rightFunc[4] = $rightFunc[0]; + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +@vertex=(); +$vertex[0]=Compute("(-$a[0],0)"); +$vertex[1]=Compute("(-$a[1],0)"); +$vertex[2]=Compute("(0,$a[2])"); +$vertex[3]=Compute("(0,$a[3])"); +$vertex[4]=$vertex[0]; + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + +$xmin = -10; +$xmax = -$xmin; +$ymin = -10; +$ymax = 10; + +#These two variables decide how many labels are on each axis. +$xmark = 2; +$ymark = 2; + +@gr=(); + +#$gr[0] through $gr[3] are options; $gr[4] is used in solution. +for ($i=0;$i<=4;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[($xmax-$xmin)/$xmark,($ymax-$ymin)/$ymark], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + if ($i!=4) { + for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { + $gr[$i]->lb( new Label($j, -0.1, $j,'black','center','top')); + } + } + + for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(0, $j,' '.$j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + add_functions($gr[$i], "x**2 for x in <$xmin,$xmax> using color:black and weight:1"); + + if (($i==2) || ($i==3)) { + add_functions($gr[$i], "x**2+$a[$i] for x in <$xmin,$xmax> using color:red and weight:3"); + } + else{ + add_functions($gr[$i], "(x+$a[$i])**2 for x in <$xmin,$xmax> using color:red and weight:3"); + } + push(@alt,"Graph $ALPHABET[$inverse{$i}]: This picture shows graphs of two parabolas. One parabola is y=x^2. The other parabola's vertex is $vertex[$i]."); +} + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +############################################## + +BEGIN_PGML + +Choose the correct graph for the equation [`[$left]=[$right]`]. In each graph, the graph of [`y=x^{2}`] is in black, while the graph of [`[$left]=[$right]`] is in (thicker) red. + +[@EnlargeImageStatementPGML()@]** + + The correct graph is graph + [@$radio->buttons()@]* + +END_PGML + +Context()->texStrings; +BEGIN_TEXT +$PAR +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{0}]" title = "$alt[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{1}]" title = "$alt[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{2}]" title = "$alt[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{3}]" title = "$alt[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +############################################## + +$LeftOrRight = $a[0]>0 ? "left" : "right"; +$aValue = $a[0]; +$aValueOpp = -$aValue; +$aAbs = abs($a[0]); + +BEGIN_PGML_SOLUTION + +To make [`y=0`] for [`y=x^{2}`], we have to make [`x=0`]. The parabola's [`x`]-intercept is [`(0,0)`]. + +To make [`y=0`] for [`[$left]=[$right]`], we have to make [`x=[$aValueOpp]`]. The parabola's [`x`]-intercept is [`([$aValueOpp],0)`]. + +This implies the graph of [`[$left]=[$right]`] is [`[$aAbs]`] units [$LeftOrRight] compared to the graph of [`y=x^{2}`]. [@ $radio->correct_ans() @]** is the correct answer. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg index 3b2e70aae0..d39d1860b0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg @@ -7,30 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(quadratic_shift) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg index f72bc8b14e..7ffbf1f31f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg @@ -7,30 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(quadratic_shift) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg index f47e368bbf..1ecc64f58d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg @@ -7,30 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(quadratic_shift) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg index 21877f0aaa..4e1b818bfa 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg @@ -7,30 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(quadratic_shift) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a in y=x^2+a. #$a[0] is the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg index cb474bc53f..1e3d7e7b21 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg @@ -7,30 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(quadratic_shift) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','shift','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", "parserRadioButtons.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +41,7 @@ Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #This array stores value of a and b in y=(x+a)^2+b. #$a[0], b[0] are the correct graph. The others are used in wrong graphs. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola10.pg index b816d4fcbb..e08a53021b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola10.pg @@ -11,24 +11,26 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", @@ -36,13 +38,13 @@ loadMacros( "PCCgraphMacros.pl", "parserImplicitPlane.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -194,7 +196,7 @@ Use decimals when needed. The parabola's [`y`]-intercept is at [__________________] - The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist.") + The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type [|DNE|]*, meaning "does not exist.") With the above information, choose the correct graph for [`[$left]=[$right]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola100.pg new file mode 100644 index 0000000000..b0fcad24b0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola100.pg @@ -0,0 +1,352 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# First find axis and vertex of y= ax^2+bx+c, +# where a,c are non-zero real numbers. |a|>1. +# Then, find intercepts of the parabola. +# Finally, identify the graph of this parabola. +# This polynomial can be factored. There is one x-intercept. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/23/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','intercept','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "parserImplicitPlane.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +#Context()->flags->set( +# tolerance => 0.005, +# tolType => "absolute", +#); + +#Store values for 5 graphs. +#a[0], b[0], c[0] are used in the correct graph. +#a[4], b[4], c[4] are used in the solution. +@a=();@b=();@c=(); + +$q = list_random(2,4,5); +do {$p = random(1,4,1);} until (gcd($p,$q)==1); +$p = $p*random(-1,1,2); + +$x1 = -$p/$q; +$x2 = $x1; + +$a[0] = $q**2*random(-1,1,2); +$b[0] = 2*$p*$q*$a[0]/abs($a[0]); +$c[0] = $p**2*$a[0]/abs($a[0]); + +do { +$temp = random(-4,-3,1); +$b[1] = $p-$q*($x2+$temp); +} until ($b[1]!=$b[0]); +$a[1] = $a[0]; +$c[1] = $c[0]; + +$temp = random(3,4,1); +$a[2] = -$a[0]; +$b[2] = -$b[0]; +$c[2] = -$c[0]; + +$a[3]= $a[0]; +$b[3] = -$b[0]; +$c[3] = $c[0]; + +$a[4]= $a[0]; +$b[4]= $b[0]; +$c[4]= $c[0]; + +$UpOrDown = $a[0]>0 ? "up" : "down"; + +$popup = PopUp(['?', 'up', + 'down', + ], $UpOrDown); + +$left = Compute("y"); +$right = Compute("$a[0]*x**2+$b[0]*x+$c[0]")->reduce; + +#for alternative display and title purposes +@rightFunc = (); +@vertex=(); +@yIntercept=(); +@extraPoint = (); +@extraPointX = (); +@extraPointY = (); +for my $i (0..4) { + $rightFunc[$i] = Compute("$a[$i]*x**2+$b[$i]*x+$c[$i]")->reduce; + my $xVertex = -$b[$i]/(2*$a[$i]); + my $yVertex = $rightFunc[$i]->eval(x=>$xVertex); + $vertex[$i]=Point($xVertex,$yVertex); + $yIntercept[$i]=Point(0,$c[$i]); + + @temp = $vertex[$i]->value; + $extraPointX[$i] = $temp[0]+1; + $extraPointY[$i] = $rightFunc[$i]->eval(x=>$extraPointX[$i]); + $extraPoint[$i] = Compute("($extraPointX[$i],$extraPointY[$i])"); +} + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; +$scramble{4} = 4; +$inverse{4} = 4; + +$xmin = -10; +$xmax = -$xmin; +$ymin = -20; +$ymax = 20; + +#These two variables decide how many labels are on each axis. +$xmark = 2; +$ymark = 4; + +@gr=(); + +#$gr[0] through $gr[3] are options. +for ($i=0;$i<=4;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[($xmax-$xmin)/$xmark,($ymax-$ymin)/$ymark], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { + $gr[$i]->lb( new Label($j, -0.1, $j,'black','center','top')); + } + + for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(0, $j,' '.$j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + add_functions($gr[$i], "$rightFunc[$i] for x in <$xmin,$xmax> using color:red and weight:1"); + push(@alt,"Graph $ALPHABET[$inverse{$i}]: This picture shows a parabola's graph. This parabola's vertex is $vertex[$i], and passes the point $extraPoint[$i]. Its y-intercept is $yIntercept[$i].") if($i!=4); + push(@alt,"Graph $ALPHABET[$inverse{0}]: This picture shows the graph of a parabola. Its vertex is $vertex[$i], and it passes through the point $extraPoint[$i]. Its y-intercept is $yIntercept[$i].") if($i==4); + + +} + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +$xVertex = Compute("-$b[0]/(2*$a[0])")->reduce; +$yVertex = $right->eval(x=>$xVertex); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$vertexCorrect = Point($xVertex,$yVertex); +$yInt = Point(0,$right->eval(x=>0)); +$xInt = Point($x1,0); + +Context("ImplicitPlane"); +Context()->flags->set(showExtraParens=>0); +Context()->variables->are(x=>"Real"); +$axis = ImplicitPlane("x=$xVertex"); + +############################################## + +BEGIN_PGML + +Answer the following questions for the parabola [`[$left]=[$right]`]. Then, choose the correct graph. + +Use decimals when needed. + + This parabola opens up or down? [@$popup->menu()@]* + + The parabola's axis of symmetry is [__________________] (Give an exact answer.) + + The parabola's vertex is at [__________________] (Give an exact answer.) + + The parabola's [`y`]-intercept is at [__________________] + + The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type [|DNE|]*, meaning "does not exist.") + +With the above information, choose the correct graph for [`[$left]=[$right]`]. + +[@EnlargeImageStatementPGML()@]** + + The correct graph is graph + [@$radio->buttons()@]* + +END_PGML +$showPartialCorrectAnswers = 1; +Context()->texStrings; +BEGIN_TEXT +$PAR +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{0}]" title = "$alt[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{1}]" title = "$alt[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{2}]" title = "$alt[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{3}]" title = "$alt[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT +Context()->normalStrings; + +############################################## + +ANS( $popup->cmp() ); +ANS( $axis->cmp() ); +ANS( $vertexCorrect->cmp() ); +ANS( $yInt->cmp() ); +ANS( $xInt->cmp() ); +ANS( $radio->cmp() ); + +############################################## + +$aVal = $a[0]; +$bVal = $b[0]; +$cVal = $c[0]; + +$aPosNeg = $aVal>0 ? "a>0" : "a<0"; +$FaceUpDown = $aVal>0 ? "up" : "down"; + +$right1 = $right; +$right1 =~ s/x/($xVertex)/g; +$right1 =~ s/~~*//g; + +$output1 = ""; +$temp1 = Compute("$q*x+$p")->reduce; +$temp1 =~ s/~~*//g; +$temp2 = Compute("x-$x1")->reduce; +$output2 = "0 &= ($temp1)($temp1) \\"; + +$output3 = $temp1; + +if ($a[0]<0) { + $right2 = Compute("-$a[0]*x**2-$b[0]*x-$c[0]")->reduce; + $right2 =~ s/~~*//g; + $output1 = "0 &= -($right2) \\"; + + $output2 = "0 &= -($temp1)($temp1) \\"; +} + +$gr[4]->stamps( closed_circle($xVertex,$yVertex,'blue') ); +$gr[4]->stamps( closed_circle(0,$cVal,'blue') ); +$gr[4]->stamps( closed_circle($x1,0,'blue') ); +$gr[4]->stamps( closed_circle($x2,0,'blue') ); +$gr[4]->moveTo( $xVertex,$ymin ); +$gr[4]->lineTo( $xVertex,$ymax,'red',2,'dashed'); + +$answerAlt = $alt[$scramble{4}]; +$answerGraph = $gr[$scramble{4}]; + + +BEGIN_PGML_SOLUTION + +The parabola's equation is in standard form [` [$left] = [$right] `]. Identify that [`a= [$aVal] ,b= [$bVal] ,c= [$cVal]`]. + +###up or down: + +Since [` [$aPosNeg] `], the parabola opens [$FaceUpDown]. + +###axis: + +We will find the parabola's axis by the axis formula: + + [` +\begin{aligned} + x &= -\frac{b}{2a} \\ + &= -\frac{ [$bVal] }{2( [$aVal] )} \\ + &= [$xVertex] +\end{aligned} +`] + +###vertex: + +To find the parabola's vertex, we substitute [`x= [$xVertex]`] into the parabola's equation, and we have: + + [` +\begin{aligned} + y &= [$right] \\ + &= [$right1] \\ + &= [$yVertex] +\end{aligned} +`] + +The parabola's vertex is [`\left( [$xVertex] , [$yVertex] \right)`]. + +###[`y`]-intercept: + +To find the parabola's [`y`]-intercept, we substitute [`x=0`] into [`[$left] = [$right]`], and we have [`y= [$cVal]`]. The parabola's [`y`]-intercept is [`[$yInt]`]. + +###[`x`]-intercept(s): + +To find a parabola's [`x`]-intercept, we substitute [`y=0`] into [` [$left] = [$right] `], and then solve for [`x`]. For this problem, notice that the polynomial can be factored: + + [` +\begin{aligned}[t] + y &= [$right] \\ + 0 &= [$right] \\ + [$output1] + [$output2] + [$output3] &= 0 \\ + x &= [$x1] +\end{aligned} + `] +There is only one [`x`]-intercept: [`\left([$x1],0\right)`] + +###graph: + +Finally, with all the above information, we can sketch the parabola's graph. [@ $radio->correct_ans() @] is the correct answer. + +>>[@ image( insertGraph($answerGraph), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$answerAlt' title = '$answerAlt'" )@]*<< + +END_PGML_SOLUTION +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola110.pg index 6aa29e49ee..bc3320657b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola110.pg @@ -12,24 +12,26 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(everything) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", @@ -37,13 +39,13 @@ loadMacros( "PCCgraphMacros.pl", "parserImplicitPlane.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -69,8 +71,8 @@ do { $x1 = (-$b[0]+sqrt($discriminant))/(2*$a[0]); $x2 = (-$b[0]-sqrt($discriminant))/(2*$a[0]); -$x1Show = sprintf "%.2f", $x1; -$x2Show = sprintf "%.2f", $x2; +$x1Show = sprintf "%.4f", $x1; +$x2Show = sprintf "%.4f", $x2; $a[1]= $a[0]; $b[1]= -$b[0]; @@ -201,7 +203,7 @@ Use decimals when needed. The parabola's [`y`]-intercept is at [__________________] - The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist.") + The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type [|DNE|]*, meaning "does not exist.") With the above information, choose the correct graph for [`[$left]=[$right]`]. @@ -234,10 +236,6 @@ Context()->normalStrings; ############################################## Context("Numeric"); -Context()->flags->set( - tolerance => 0.005, - tolType => "absolute", -); ANS( $popup->cmp() ); ANS( $axis->cmp() ); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola20.pg index e52f347486..427225a133 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola20.pg @@ -11,24 +11,26 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(everything) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", @@ -36,13 +38,13 @@ loadMacros( "PCCgraphMacros.pl", "parserImplicitPlane.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -194,7 +196,7 @@ Use decimals when needed. The parabola's [`y`]-intercept is at [__________________] - The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist.") + The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type [|DNE|]*, meaning "does not exist.") With the above information, choose the correct graph for [`[$left]=[$right]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola30.pg index 6562b24a37..09de1c1cbb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola30.pg @@ -11,24 +11,26 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(everything) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", @@ -36,13 +38,13 @@ loadMacros( "PCCgraphMacros.pl", "parserImplicitPlane.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -195,7 +197,7 @@ Use decimals when needed. The parabola's [`y`]-intercept is at [__________________] - The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist.") + The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type [|DNE|]*, meaning "does not exist.") With the above information, choose the correct graph for [`[$left]=[$right]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola40.pg index 34fbe461da..b0f4bec02f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola40.pg @@ -11,24 +11,26 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(everything) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", @@ -36,13 +38,13 @@ loadMacros( "PCCgraphMacros.pl", "parserImplicitPlane.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -193,7 +195,7 @@ Use decimals when needed. The parabola's [`y`]-intercept is at [__________________] - The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist.") + The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type [|DNE|]*, meaning "does not exist.") With the above information, choose the correct graph for [`[$left]=[$right]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola50.pg index e45ac0b86e..6a45166a03 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola50.pg @@ -11,24 +11,26 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(everything) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", @@ -36,13 +38,13 @@ loadMacros( "PCCgraphMacros.pl", "parserImplicitPlane.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -206,7 +208,7 @@ Use decimals when needed. The parabola's [`y`]-intercept is at [__________________] - The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist.") + The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type [|DNE|]*, meaning "does not exist.") With the above information, choose the correct graph for [`[$left]=[$right]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola60.pg index 312681d835..c4ce55540e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola60.pg @@ -11,24 +11,26 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(everything) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','intercept','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "pccTables.pl", @@ -36,13 +38,13 @@ loadMacros( "PCCgraphMacros.pl", "parserImplicitPlane.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -202,7 +204,7 @@ Use decimals when needed. The parabola's [`y`]-intercept is at [__________________] - The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type *DNE*, meaning "does not exist.") + The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type [|DNE|]*, meaning "does not exist.") With the above information, choose the correct graph for [`[$left]=[$right]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola70.pg new file mode 100644 index 0000000000..97a06de0a6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola70.pg @@ -0,0 +1,355 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# First find axis and vertex of y= ax^2+bx, +# where a,b,c are non-zero real numbers. |a|>1. +# Then, find intercepts of the parabola. +# Finally, identify the graph of this parabola. +# This polynomial can be factored. There are two x-intercepts. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/23/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','intercept','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "parserImplicitPlane.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + + +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +#Store values for 5 graphs. +#a[0], b[0], c[0] are used in the correct graph. +#a[4], b[4], c[4] are used in the solution. +@a=();@b=();@c=(); + +$a[0] = list_random(-5,-4,-2,2,4,5); +do {$p = random(5,10,1);} until (gcd($p,$a[0])==1); +$p = $p*random(-1,1,2); + +$x1 = -$p/$a[0]; +$x2 = 0; + +$b[0] = $p; +$c[0] = 0; + +$temp = random(-2,-1,1); +$a[1] = $a[0]; +$b[1] = $p-$a[0]*($x2+$temp); +$c[1] = 0; + +$temp = random(1,2,1); +$a[2] = $a[0]; +$b[2] = $p-$a[0]*($x2+$temp); +$c[2] = 0; + +$a[3]= $a[0]; +$b[3] = $b[0]+1; +$c[3] = -4; + +$a[4]= $a[0]; +$b[4]= $b[0]; +$c[4]= $c[0]; + +$UpOrDown = $a[0]>0 ? "up" : "down"; + +$popup = PopUp(['?', 'up', + 'down', + ], $UpOrDown); + +$left = Compute("y"); +$right = Compute("$a[0]*x**2+$b[0]*x+$c[0]")->reduce; + +#for alternative display and title purposes +@rightFunc = (); +@vertex=(); +@yIntercept=(); +@extraPoint = (); +@extraPointX = (); +@extraPointY = (); +for my $i (0..4) { + $rightFunc[$i] = Compute("$a[$i]*x**2+$b[$i]*x+$c[$i]")->reduce; + my $xVertex = -$b[$i]/(2*$a[$i]); + my $yVertex = $rightFunc[$i]->eval(x=>$xVertex); + $vertex[$i]=Point($xVertex,$yVertex); + $yIntercept[$i]=Point(0,$c[$i]); + + @temp = $vertex[$i]->value; + $extraPointX[$i] = $temp[0]+1; + $extraPointY[$i] = $rightFunc[$i]->eval(x=>$extraPointX[$i]); + $extraPoint[$i] = Compute("($extraPointX[$i],$extraPointY[$i])"); +} + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; +$scramble{4} = 4; +$inverse{4} = 4; + +$xmin = -20; +$xmax = -$xmin; +$ymin = -20; +$ymax = 20; + +#These two variables decide how many labels are on each axis. +$xmark = 4; +$ymark = 4; + +@gr=(); + +#$gr[0] through $gr[3] are options. +for ($i=0;$i<=4;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[($xmax-$xmin)/$xmark,($ymax-$ymin)/$ymark], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { + $gr[$i]->lb( new Label($j, -0.1, $j,'black','center','top')); + } + + for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(0, $j,' '.$j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + add_functions($gr[$i], "$rightFunc[$i] for x in <$xmin,$xmax> using color:red and weight:1"); + + push(@alt,"Graph $ALPHABET[$inverse{$i}]: This picture shows a parabola's graph. This parabola's vertex is $vertex[$i], and passes the point $extraPoint[$i]. Its y-intercept is $yIntercept[$i].") if($i!=4); + push(@alt,"Graph $ALPHABET[$inverse{0}]: This picture shows the graph of a parabola graph. Its vertex is $vertex[$i], and passes the point $extraPoint[$i]. Its y-intercept is $yIntercept[$i].") if($i==4); +} + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$xVertex = -$b[0]/(2*$a[0]); +$yVertex = $right->eval(x=>$xVertex); +$vertexCorrect = Point($xVertex,$yVertex); +$yInt = Point(0,$right->eval(x=>0)); +$xInt = List(Point($x1,0),Point($x2,0)); + +Context("ImplicitPlane"); +Context()->flags->set(showExtraParens=>0); +Context()->variables->are(x=>"Real"); +$axis = ImplicitPlane("x=$xVertex"); + +############################################## + +BEGIN_PGML + +Answer the following questions for the parabola [`[$left]=[$right]`]. Then, choose the correct graph. + +Use decimals when needed. + + This parabola opens up or down? [@$popup->menu()@]* + + The parabola's axis of symmetry is [__________________] + + The parabola's vertex is at [__________________] + + The parabola's [`y`]-intercept is at [__________________] + + The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type [|DNE|]*, meaning "does not exist.") + +With the above information, choose the correct graph for [`[$left]=[$right]`]. + +[@EnlargeImageStatementPGML()@]** + + The correct graph is graph + [@$radio->buttons()@]* + +END_PGML +$showPartialCorrectAnswers = 1; +Context()->texStrings; +BEGIN_TEXT +$PAR +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{0}]" title = "$alt[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{1}]" title = "$alt[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{2}]" title = "$alt[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{3}]" title = "$alt[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + + +\} +$ECENTER +$PAR + +END_TEXT +Context()->normalStrings; + +############################################## + +ANS( $popup->cmp() ); +ANS( $axis->cmp() ); +ANS( $vertexCorrect->cmp() ); +ANS( $yInt->cmp() ); +ANS( $xInt->cmp() ); +ANS( $radio->cmp() ); + +############################################## + +$aVal = $a[0]; +$bVal = $b[0]; +$cVal = $c[0]; + +$aPosNeg = $aVal>0 ? "a>0" : "a<0"; +$FaceUpDown = $aVal>0 ? "up" : "down"; + +$right1 = $right; +$right1 =~ s/x/($xVertex)/g; +$right1 =~ s/~~*//g; + +$output1 = ""; +$temp1 = Compute("$a[0]*x+$p")->reduce; +$temp1 =~ s/~~*//g; +$temp2 = "x"; +$output2 = "0 &= $temp2($temp1) \\"; + +$output3 = $temp1; + +if ($a[0]<0) { + $right2 = Compute("-$a[0]*x**2-$b[0]*x-$c[0]")->reduce; + $right2 =~ s/~~*//g; + $output1 = "0 &= -($right2) \\"; + + $temp1 = Compute("-$a[0]*x-$p")->reduce; + $temp1 =~ s/~~*//g; + $output2 = "0 &= -$temp2($temp1) \\"; + + $output3 = $temp1; +} + +$gr[4]->stamps( closed_circle($xVertex,$yVertex,'blue') ); +$gr[4]->stamps( closed_circle(0,$cVal,'blue') ); +$gr[4]->stamps( closed_circle($x1,0,'blue') ); +$gr[4]->stamps( closed_circle($x2,0,'blue') ); +$gr[4]->moveTo( $xVertex,$ymin ); +$gr[4]->lineTo( $xVertex,$ymax,'red',2,'dashed'); + +$answerAlt = $alt[$scramble{4}]; +$answerGraph = $gr[$scramble{4}]; + + +BEGIN_PGML_SOLUTION + +The parabola's equation is in standard form [` [$left] = [$right] `]. Identify that [`a= [$aVal] ,b= [$bVal] ,c= [$cVal]`]. + +###up or down: + +Since [` [$aPosNeg] `], the parabola opens [$FaceUpDown]. + +###axis: + +We will find the parabola's axis by the axis formula: + + [` +\begin{aligned} + x &= -\frac{b}{2a} \\ + &= -\frac{ [$bVal] }{2( [$aVal] )} \\ + &= [$xVertex] +\end{aligned} +`] + +###vertex: + +To find the parabola's vertex, we substitute [`x= [$xVertex]`] into the parabola's equation, and we have: + + [` +\begin{aligned} + y &= [$right] \\ + &= [$right1] \\ + &= [$yVertex] +\end{aligned} +`] + +The parabola's vertex is [`\left( [$xVertex] , [$yVertex] \right)`]. + +###[`y`]-intercept: + +To find the parabola's [`y`]-intercept, we substitute [`x=0`] into [`[$left] = [$right]`], and we have [`y= [$cVal]`]. The parabola's [`y`]-intercept is [`[$yInt]`]. + +###[`x`]-intercept(s): + +To find a parabola's [`x`]-intercepts, we substitute in \(y=0\). For this problem, notice that the polynomial can be factored: + + [` +\begin{aligned}[t] + y &= [$right] \\ + 0 &= [$right] \\ + [$output1] + [$output2] + x&=0 &\text{or} && [$output3] &= 0 \\ + x&=0 &\text{or} && x &= [$x1] +\end{aligned} + `] + +The parabola has two [`x`]-intercepts, at [`([$x1],0)`] and [`([$x2],0)`]. + +###graph: + +Finally, with all the above information, we can sketch the parabola's graph. [@ $radio->correct_ans() @] is the correct answer. + +>>[@ image( insertGraph($answerGraph), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$answerAlt' title = '$answerAlt'" )@]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola80.pg new file mode 100644 index 0000000000..efde14626d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola80.pg @@ -0,0 +1,310 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# First find axis and vertex of y= ax^2+bx+c, |a|>1 +# where b,c are non-zero real numbers. +# Then, find intercepts of the parabola. +# Finally, identify the graph of this parabola. +# There is no x-intercept. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/23/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','intercept','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "parserImplicitPlane.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +#Store values for 5 graphs. +#a[0], b[0], c[0] are used in the correct graph. +#a[4], b[4], c[4] are used in the solution. +@a=();@b=();@c=(); + +do {$a[0]=non_zero_random(-4,4,2); +$b[0]=non_zero_random(-5,5,1); +$c[0]=non_zero_random(-8,8,1);} until (($b[0])**2-4*$a[0]*$c[0]<0); + +$a[1]= $a[0]; +$b[1]= -$b[0]; +$c[1]= $c[0]; + +$a[2]= $a[0]; +$b[2]= $b[0]; +$c[2]= -$c[0]; + +$a[3]= $a[0]; +$b[3]= -$b[0]; +$c[3]= -$c[0]; + +$a[4]= $a[0]; +$b[4]= $b[0]; +$c[4]= $c[0]; + +$UpOrDown = $a[0]>0 ? "up" : "down"; +$popup = PopUp(['?', 'up', + 'down', + ], $UpOrDown); + +$left = Compute("y"); +$right = Compute("$a[0]*x**2+$b[0]*x+$c[0]")->reduce; + +#for alternative display and title purposes +@rightFunc = (); +@vertex=(); +@yIntercept=(); +@extraPoint = (); +@extraPointX = (); +@extraPointY = (); +for my $i (0..4) { + $rightFunc[$i] = Compute("$a[$i]*x**2+$b[$i]*x+$c[$i]")->reduce; + my $xVertex = -$b[$i]/(2*$a[$i]); + my $yVertex = $rightFunc[$i]->eval(x=>$xVertex); + $vertex[$i]=Point($xVertex,$yVertex); + $yIntercept[$i]=Point(0,$c[$i]); + + @temp = $vertex[$i]->value; + $extraPointX[$i] = $temp[0]+1; + $extraPointY[$i] = $rightFunc[$i]->eval(x=>$extraPointX[$i]); + $extraPoint[$i] = Compute("($extraPointX[$i],$extraPointY[$i])"); +} + + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; +$scramble{4} = 4; +$inverse{4} = 4; + +$xmin = -20; +$xmax = -$xmin; +$ymin = -20; +$ymax = 20; + +#These two variables decide how many labels are on each axis. +$xmark = 4; +$ymark = 4; + +@gr=(); + +#$gr[0] through $gr[3] are options. +for ($i=0;$i<=4;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[($xmax-$xmin)/$xmark,($ymax-$ymin)/$ymark], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { + $gr[$i]->lb( new Label($j, -0.1, $j,'black','center','top')); + } + + for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(0, $j,' '.$j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + add_functions($gr[$i], "$rightFunc[$i] for x in <$xmin,$xmax> using color:red and weight:1"); + + push(@alt,"Graph $ALPHABET[$inverse{$i}]: This picture shows a parabola's graph. This parabola's vertex is $vertex[$i], and passes the point $extraPoint[$i]. Its y-intercept is $yIntercept[$i].") if($i!=4); + push(@alt,"Graph $ALPHABET[$inverse{0}]: This picture shows the graph of a parabola. Its vertex is $vertex[$i], and it passes through the point $extraPoint[$i]. Its y-intercept is $yIntercept[$i].") if($i==4); + +} + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$xVertex = -$b[0]/(2*$a[0]); +$yVertex = $right->eval(x=>$xVertex); +$vertexCorrect = Point($xVertex,$yVertex); +$yInt = Point(0,$right->eval(x=>0)); +$xInt = Compute("DNE"); + +Context("ImplicitPlane"); +Context()->flags->set(showExtraParens=>0); +Context()->variables->are(x=>"Real"); +$axis = ImplicitPlane("x=$xVertex"); + +############################################## + +BEGIN_PGML + +Answer the following questions for the parabola [`[$left]=[$right]`]. Then, choose the correct graph. + +Use decimals when needed. + + This parabola opens up or down? [@$popup->menu()@]* + + The parabola's axis of symmetry is [__________________] + + The parabola's vertex is at [__________________] + + The parabola's [`y`]-intercept is at [__________________] + + The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type [|DNE|]*, meaning "does not exist.") + +With the above information, choose the correct graph for [`[$left]=[$right]`]. + +[@EnlargeImageStatementPGML()@]** + + The correct graph is graph + [@$radio->buttons()@]* + +END_PGML +$showPartialCorrectAnswers = 1; +Context()->texStrings; +BEGIN_TEXT +$PAR +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{0}]" title = "$alt[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{1}]" title = "$alt[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{2}]" title = "$alt[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{3}]" title = "$alt[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT +Context()->normalStrings; + +############################################## + +ANS( $popup->cmp() ); +ANS( $axis->cmp() ); +ANS( $vertexCorrect->cmp() ); +ANS( $yInt->cmp() ); +ANS( $xInt->cmp() ); +ANS( $radio->cmp() ); + +############################################## + +$aVal = $a[0]; +$bVal = $b[0]; +$cVal = $c[0]; + +$aPosNeg = $aVal>0 ? "a>0" : "a<0"; +$FaceUpDown = $aVal>0 ? "up" : "down"; +$AboveOrBelow = $aVal>0 ? "above" : "below"; + +$right1 = $right; +$right1 =~ s/x/($xVertex)/g; +$right1 =~ s/~~*//g; +$right2 = Compute("-$a[0]*x**2-$b[0]*x-$c[0]")->reduce; + +$gr[4]->stamps( closed_circle($xVertex,$yVertex,'blue') ); +$gr[4]->stamps( closed_circle(0,$cVal,'blue') ); +#$gr[4]->stamps( closed_circle($x1,0,'blue') ); +#$gr[4]->stamps( closed_circle($x2,0,'blue') ); +$gr[4]->moveTo( $xVertex,$ymin ); +$gr[4]->lineTo( $xVertex,$ymax,'red',2,'dashed'); + +$answerAlt = $alt[$scramble{4}]; +$answerGraph = $gr[$scramble{4}]; + + +BEGIN_PGML_SOLUTION + +The parabola's equation is in standard form [` [$left] = [$right] `]. Identify that [`a= [$aVal] ,b= [$bVal] ,c= [$cVal]`]. + +###up or down: + +Since [` [$aPosNeg] `], the parabola opens [$FaceUpDown]. + +###axis: + +We will find the parabola's axis by the axis formula: + + [` +\begin{aligned} + x &= -\frac{b}{2a} \\ + &= -\frac{ [$bVal] }{2( [$aVal] )} \\ + &= [$xVertex] +\end{aligned} +`] + +###vertex: + +To find the parabola's vertex, we substitute [`x= [$xVertex]`] into the parabola's equation, and we have: + + [` +\begin{aligned} + y &= [$right] \\ + &= [$right1] \\ + &= [$yVertex] +\end{aligned} +`] + +The parabola's vertex is [`\left( [$xVertex] , [$yVertex] \right)`]. + +###[`y`]-intercept: + +To find the parabola's [`y`]-intercept, we substitute [`x=0`] into [`[$left] = [$right]`], and we have [`y= [$cVal]`]. The parabola's [`y`]-intercept is [`[$yInt]`]. + +###[`x`]-intercept(s): + +Earlier, we found that this parabola's vertex is [`\left( [$xVertex] , [$yVertex] \right)`], and the parabola opens [$FaceUpDown]. This implies all of the points on the parabola are [$AboveOrBelow] the [`x`]-axis, thus the parabola doesn't have any [`x`]-intercepts. + +###graph: + +Finally, with all the above information, we can sketch the parabola's graph. [@ $radio->correct_ans() @] is the correct answer. + +>>[@ image( insertGraph($answerGraph), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$answerAlt' title = '$answerAlt'" )@]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola90.pg new file mode 100644 index 0000000000..92abd899d9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/GraphingQuadratics/SketchParabola90.pg @@ -0,0 +1,342 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# First find axis and vertex of y= ax^2-c^2, +# where a,c are non-zero real numbers. |a|>1. +# Then, find intercepts of the parabola. +# Finally, identify the graph of this parabola. +# This polynomial can be factored. There are two x-intercepts. +# +# Last edit by: Hughes 9/3/13, Carl Yao 08/23/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','intercept','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "parserImplicitPlane.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + + +#Context()->flags->set( +# tolerance => 0.005, +# tolType => "absolute", +#); + +#Store values for 5 graphs. +#a[0], b[0], c[0] are used in the correct graph. +#a[4], b[4], c[4] are used in the solution. +@a=();@b=();@c=(); + +$q = list_random(-5,-4,-2,2,4,5); +do {$p = random(1,4,1);} until (gcd($p,$q)==1); +$p = $p*random(-1,1,2); + +$x1 = -$p/$q; +$x2 = -$x1; + +$a[0] = $q**2*random(-1,1,2); +$b[0] = 0; +$c[0] = -$p**2*$a[0]/abs($a[0]); + +$temp = random(-4,-3,1); +$a[1] = $a[0]; +$b[1] = $p-$q*($x2+$temp); +$c[1] = $c[0]; + +$temp = random(3,4,1); +$a[2] = $a[0]; +$b[2] = $p-$q*($x2+$temp); +$c[2] = $c[0]; + +$a[3]= $a[0]; +$b[3] = $b[0]; +$c[3] = $c[0]+4; + +$a[4]= $a[0]; +$b[4]= $b[0]; +$c[4]= $c[0]; + +$UpOrDown = $a[0]>0 ? "up" : "down"; + +$popup = PopUp(['?', 'up', + 'down', + ], $UpOrDown); + +$left = Compute("y"); +$right = Compute("$a[0]*x**2+$b[0]*x+$c[0]")->reduce; + +#for alternative display and title purposes +@rightFunc = (); +@vertex=(); +@yIntercept=(); +@extraPoint = (); +@extraPointX = (); +@extraPointY = (); +for my $i (0..4) { + $rightFunc[$i] = Compute("$a[$i]*x**2+$b[$i]*x+$c[$i]")->reduce; + my $xVertex = -$b[$i]/(2*$a[$i]); + my $yVertex = $rightFunc[$i]->eval(x=>$xVertex); + $vertex[$i]=Point($xVertex,$yVertex); + $yIntercept[$i]=Point(0,$c[$i]); + + @temp = $vertex[$i]->value; + $extraPointX[$i] = $temp[0]+1; + $extraPointY[$i] = $rightFunc[$i]->eval(x=>$extraPointX[$i]); + $extraPoint[$i] = Compute("($extraPointX[$i],$extraPointY[$i])"); +} + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; +$scramble{4} = 4; +$inverse{4} = 4; + +$xmin = -10; +$xmax = -$xmin; +$ymin = -20; +$ymax = 20; + +#These two variables decide how many labels are on each axis. +$xmark = 2; +$ymark = 4; + +@gr=(); + +#$gr[0] through $gr[3] are options. +for ($i=0;$i<=4;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[($xmax-$xmin)/$xmark,($ymax-$ymin)/$ymark], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { + $gr[$i]->lb( new Label($j, -0.1, $j,'black','center','top')); + } + + for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(0, $j,' '.$j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + add_functions($gr[$i], "$rightFunc[$i] for x in <$xmin,$xmax> using color:red and weight:1"); + push(@alt,"Graph $ALPHABET[$inverse{$i}]: This picture shows a parabola's graph. This parabola's vertex is $vertex[$i], and passes the point $extraPoint[$i]. Its y-intercept is $yIntercept[$i].") if($i!=4); + push(@alt,"Graph $ALPHABET[$inverse{0}]: This picture shows the graph of a parabola. Its vertex is at $vertex[$i], and it passes through the point $extraPoint[$i]. Its y-intercept is $yIntercept[$i].") if($i==4); + + +} + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +$xVertex = Compute("-$b[0]/(2*$a[0])")->reduce; +$yVertex = $right->eval(x=>$xVertex); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$vertexCorrect = Point($xVertex,$yVertex); +$yInt = Point(0,$right->eval(x=>0)); +$xInt = List(Point($x1,0),Point($x2,0)); + +Context("ImplicitPlane"); +Context()->flags->set(showExtraParens=>0); +Context()->variables->are(x=>"Real"); +$axis = ImplicitPlane("x=$xVertex"); + +############################################## + +BEGIN_PGML + +Answer the following questions for the parabola [`[$left]=[$right]`]. Then, choose the correct graph. + +Use decimals when needed. + + This parabola opens up or down? [@$popup->menu()@]* + + The parabola's axis of symmetry is [__________________] (Give an exact answer.) + + The parabola's vertex is at [__________________] (Give an exact answer.) + + The parabola's [`y`]-intercept is at [__________________] + + The parabola's [`x`]-intercept(s) is/are [__________________] (Use a comma to separate [`x`]-intercepts if needed. If the parabola doesn't have any [`x`]-intercept, type [|DNE|]*, meaning "does not exist.") + +With the above information, choose the correct graph for [`[$left]=[$right]`]. + +[@EnlargeImageStatementPGML()@]** + + The correct graph is graph + [@$radio->buttons()@]* + +END_PGML +$showPartialCorrectAnswers = 1; +Context()->texStrings; +BEGIN_TEXT +$PAR +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{0}]" title = "$alt[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{1}]" title = "$alt[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{2}]" title = "$alt[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{3}]" title = "$alt[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT +Context()->normalStrings; + +############################################## + +ANS( $popup->cmp() ); +ANS( $axis->cmp() ); +ANS( $vertexCorrect->cmp() ); +ANS( $yInt->cmp() ); +ANS( $xInt->cmp() ); +ANS( $radio->cmp() ); + +############################################## + +$aVal = $a[0]; +$bVal = $b[0]; +$cVal = $c[0]; + +$aPosNeg = $aVal>0 ? "a>0" : "a<0"; +$FaceUpDown = $aVal>0 ? "up" : "down"; + +$right1 = $right; +$right1 =~ s/x/($xVertex)/g; +$right1 =~ s/~~*//g; + +$s1 = -$cVal; +$s2 = -$cVal/$aVal; + +$gr[4]->stamps( closed_circle($xVertex,$yVertex,'blue') ); +$gr[4]->stamps( closed_circle(0,$cVal,'blue') ); +$gr[4]->stamps( closed_circle($x1,0,'blue') ); +$gr[4]->stamps( closed_circle($x2,0,'blue') ); +$gr[4]->moveTo( $xVertex,$ymin ); +$gr[4]->lineTo( $xVertex,$ymax,'red',2,'dashed'); + +$answerAlt = $alt[$scramble{4}]; +$answerGraph = $gr[$scramble{4}]; + + +BEGIN_PGML_SOLUTION + +The parabola's equation is in standard form [` [$left] = [$right] `]. Identify that [`a= [$aVal] ,b= [$bVal] ,c= [$cVal]`]. + +###up or down: + +Since [` [$aPosNeg] `], the parabola opens [$FaceUpDown]. + +###axis: + +We will find the parabola's axis by the axis formula: + + [` +\begin{aligned} + x &= -\frac{b}{2a} \\ + &= -\frac{ [$bVal] }{2( [$aVal] )} \\ + &= [$xVertex] +\end{aligned} +`] + +###vertex: + +To find the parabola's vertex, we substitute [`x= [$xVertex]`] into the parabola's equation, and we have: + + [` +\begin{aligned} + y &= [$right] \\ + &= [$right1] \\ + &= [$yVertex] +\end{aligned} +`] + +The parabola's vertex is [`\left( [$xVertex] , [$yVertex] \right)`]. + +###[`y`]-intercept: + +To find the parabola's [`y`]-intercept, we substitute [`x=0`] into [`[$left] = [$right]`], and we have [`y= [$cVal]`]. The parabola's [`y`]-intercept is [`[$yInt]`]. + +###[`x`]-intercept(s): + +To find a parabola's [`x`]-intercept, we substitute [`y=0`] into [` [$left] = [$right] `], and then solve for [`x`]. For this problem, it's easier to solve the equation by the square root property: + + [` +\begin{aligned} + y &= [$right] \\ + 0 &= [$right] \\ + 0 \mathbf{{}-[$cVal]} &= [$right] \mathbf{{}-[$cVal]} \\ + [$s1] &= [$aVal] x^{2} \\ + \frac{[$s1]}{[$aVal]} &= \frac{[$aVal] x^{2}}{[$aVal]} \\ + {[$s2]} &= x^{2} \\ + \pm \sqrt{[$s2]} &= x \\ + x&=[$x1] &\text{or} && x & = [$x2] +\end{aligned} + `] + +There are two [`x`]-intercepts: one at [`\left([$x1],0\right)`] and one at [`\left([$x2],0\right)`]. + +###graph: + +Finally, with all the above information, we can sketch the parabola's graph. [@ $radio->correct_ans() @] is the correct answer. + +>>[@ image( insertGraph($answerGraph), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$answerAlt' title = '$answerAlt'" )@]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem10.pg new file mode 100644 index 0000000000..ae07e3cb69 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem10.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Give the sum of two consecutive integers, find each integer. +# +# Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unorderedAnswer.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a = random(100,200,1); +$b = $a+1; +$t = $a+$b; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Two consecutive integers add up to be [`[$t]`]. Find these two integers. + + The two integers are [______] and [______]. + +END_PGML + +UNORDERED_ANS( +Real($a)->cmp(), +Real($b)->cmp(), +); + + +############################################## + +$s1=$t-1; + +BEGIN_PGML_SOLUTION + +Consecutive integers are pairs of numbers like 2 and 3, 5 and 6, 100 and 101, etc. The bigger integer is always 1 more than the smaller one. + +Let the smaller integer be [`x`]. Then, the bigger integer is [`x+1`]. + +Since the sum of the integers is [`[$t]`], we can write an equation: + + [`` x+x+1=[$t] ``] + +Next, we solve for [`x`]: + + [` +\begin{aligned} + x+x+1 &\;=\; [$t] \\ + 2x+1 &\;=\; [$t] \\ + 2x+1\mathbf{{}-1} &\;=\; [$t]\mathbf{{}-1} \\ + 2x &\;=\; [$s1] \\ + \frac{2x}{2} &\;=\; \frac{[$s1]}{2} \\ + x &\;=\; [$a] +\end{aligned} +`] + +The smaller integer is [`[$a]`], and the bigger integer is [`[$b]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem20.pg new file mode 100644 index 0000000000..225a83a5c1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem20.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Give the sum of two consecutive odd integers, find each integer. +# +# Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unorderedAnswer.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(101,199,2); +$b = $a+2; +$t = $a+$b; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Two consecutive odd integers add up to be [`[$t]`]. Find these two integers. + + The two integers are [______] and [______]. + +END_PGML + +UNORDERED_ANS( +Real($a)->cmp(), +Real($b)->cmp(), +); + + + +############################################## + +$s1=$t-2; + +BEGIN_PGML_SOLUTION + +Consecutive odd integers are pairs of numbers like 1 and 3, 5 and 7, 101 and 103, etc. The bigger integer is always 2 more than the smaller one. + +Let the smaller integer be [`x`]. Then, the bigger integer is [`x+2`]. + +Since the sum of them is [`[$t]`], we can write an equation: + + [`` x+x+2=[$t] ``] + +Next, we solve for [`x`]: + + [` +\begin{aligned} + x+x+2 &\;=\; [$t] \\ + 2x+2 &\;=\; [$t] \\ + 2x+2\mathbf{{}-2} &\;=\; [$t]\mathbf{{}-2} \\ + 2x &\;=\; [$s1] \\ + \frac{2x}{2} &\;=\; \frac{[$s1]}{2} \\ + x &\;=\; [$a] +\end{aligned} +`] + +The smaller integer is [`[$a]`], and the bigger integer is [`[$b]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem30.pg new file mode 100644 index 0000000000..e968133c24 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem30.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Give the sum of three consecutive integers, find each integer. +# +# Last updated: Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unorderedAnswer.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(201,299,1); +$b = $a+1; +$c = $b+1; +$t = $a+$b+$c; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Three consecutive integers add up to be [`[$t]`]. Find these three integers. + + The three integers are [______], [______], and [______]. + +END_PGML + +UNORDERED_ANS( +Real($a)->cmp(), +Real($b)->cmp(), +Real($c)->cmp() +); + + +############################################## + +$s1=$t-3; + +BEGIN_PGML_SOLUTION + +Consecutive integers are pairs like 1 and 2, 6 and 7, 101 and 102, etc. The next integer is always 1 more than the smaller one. + +Let the smallest integer be [`x`]. Then, the next integer is [`x+1`], and the largest integer is [`x+2`]. + +Since the sum of them is [`[$t]`], we can write an equation: + + [`` x+x+1+x+2=[$t] ``] + +Next, we solve for [`x`]: + + [` +\begin{aligned} + x+x+1+x+2 &\;=\; [$t] \\ + 3x+3 &\;=\; [$t] \\ + 3x+3\mathbf{{}-3} &\;=\; [$t]\mathbf{{}-3} \\ + 3x &\;=\; [$s1] \\ + \frac{3x}{3} &\;=\; \frac{[$s1]}{3} \\ + x &\;=\; [$a] +\end{aligned} +`] + +The first integer is [`[$a]`], the next one is [`[$b]`], and the biggest one is [`[$c]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem10.pg index 92d2b52f4a..9d1d3b730b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem10.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(DistEqualRateTimesTime) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','distance') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "pccTables.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem20.pg index 5fa6426fb3..ab43ec7afd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem20.pg @@ -6,17 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(DistEqualRateTimesTime) -## MLTleader(1) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','distance') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "pccTables.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem30.pg index 1fcc2c15c4..e0d9f58a90 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblem30.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(DistEqualRateTimesTime) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','distance') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "pccTables.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable10.pg new file mode 100644 index 0000000000..452a37ac78 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable10.pg @@ -0,0 +1,151 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear equation to solve distance word problems. +# A table is available to help organize data. +# +# Last updated: Jordan 8/29/13; Yao, 7/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('equation','solve','word problem','distance') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "answerHints.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(t=>'Real'); + +$r1 = random(5,8,0.1); +do {$r2 = random(5,8,0.1)} until ($r1 != $r2); +$t = random(2,5,1)+random(1,9,1)/10; +$d1 = $r1*$t; +$d2 = $r2*$t; +$d = $d1+$d2; + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); + +$name1 = RandomName(sex=>$sex); +do {$name2 = RandomName(sex=>$sex)} until ($name1 ne $name2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +[$name1] runs with a speed of [`[$r1]`] miles per hour. [$name2] runs at [`[$r2]`] miles per hour. They began at the same spot, and started running in opposite directions. After some time, they are [`[$d]`] miles apart. How long have they been running? + +You can use a table to organize the quantities (speed, time, and distance) for the two runners. Let's represent the unknown amount of time by [`t`], in hours. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"Rate",header=>"CH"},{data=>" \(\times\)",header=>"CH"},{data=>"Time",header=>"CH"},{data=>"\(=\)",header=>"CH"},{data=>"Distance",header=>"CH"},], +[{data=>"$name1",header=>"RH"},"\($r1\)","$SPACE","\(t\)","$SPACE",ans_rule(10)], +[{data=>"$name2",header=>"RH"},"\($r2\)","$SPACE","\(t\)","$SPACE",ans_rule(10)], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$PAR +END_TEXT +Context()->normalStrings; + +ANS( Compute("$r1*t") -> cmp); +ANS( Compute("$r2*t") -> cmp); + + +BEGIN_PGML + + According to the table, the total separation between the two runners at time [`t`] is [_______________] miles. + +Now set up and solve an equation for [`t`]. + + After [______] hours, [$name1] and [$name2] are [`[$d]`] miles apart. + +END_PGML + + +############################################## +$showPartialCorrectAnswers=1; + +ANS(Compute("$r1*t+$r2*t") -> cmp() ->withPostFilter(AnswerHints( + Compute($d) => "Give the total separation _according to the table_, not according to the problem introduction" +))); + +Context("LimitedNumeric"); +Context()->variables->are(t=>'Real'); +ANS( Real("$t") -> cmp); + +$s1 = $r1+$r2; + +BEGIN_SOLUTION +$PAR + +The relevant formula is: + +\[\text{rate}\cdot\text{time} = \text{distance}\] + +If we let \(t\) represent the number of hours that $name1 and $name2 have been running, then after \(t\) hours: $PAR + +\(\small\bullet\) $name1 has run \($r1 t\) miles. $BR +\(\small\bullet\) $name2 has run \($r2 t\) miles. $BR + +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"Rate",header=>"CH"},{data=>" \(\times\)",header=>"CH"},{data=>"Time",header=>"CH"},{data=>"\(=\)",header=>"CH"},{data=>"Distance",header=>"CH"},], +[{data=>"$name1",header=>"RH"},"\($r1\)","$SPACE","\(t\)","$SPACE","\($r1 t\)"], +[{data=>"$name2",header=>"RH"},"\($r2\)","$SPACE","\(t\)","$SPACE","\($r2 t\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$PAR + +And the total separation between them is \($r1 t+$r2 t\) miles. + +It is given in the introduction that they ran a total of \($d\) miles. Now we can write an equation and solve it: +$PAR + +\[ +\begin{aligned} + $r1 t + $r2 t &= $d \\ + $s1 t &= $d \\ + \frac{$s1 t}{$s1 } &= \frac{$d}{$s1} \\ + t &= $t +\end{aligned} +\] +$PAR + +So $name1 and $name2 have been running for \($t\) hours. + +END_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable20.pg new file mode 100644 index 0000000000..cfc8c56c46 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable20.pg @@ -0,0 +1,158 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear equation to solve distance word problems. +# A table is available to help organize data. +# +# Last updated: Jordan 8/29/13; Yao, 7/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('equation','solve','word problem','distance') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "answerHints.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$r1 = random(5,8,0.1); +do {$r2 = random(5,8,0.1)} until ($r1 != $r2); +($r1, $r2) = (Real(max($r1,$r2)),Real(min($r1,$r2))); + +$rDif = $r1-$r2; +$t = random(2,4,1)+random(1,9,1)/10; +$d1 = $r1*$t; +$d2 = $r2*$t; +$d = $d1+$d2; + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); + +$name1 = RandomName(sex=>$sex); +do {$name2 = RandomName(sex=>$sex)} until ($name1 ne $name2); + +############################################## +TEXT(beginproblem()); +BEGIN_PGML + +[$name1] runs at a speed of [`[$rDif]`] miles per hour faster than [$name2]. They started at the same spot, and ran in opposite directions. After [`[$t]`] hours, they were [`[$d]`] miles apart. How fast was each runner running? + +You can use a table to organize the quantities (speed, time, and distance) for each of the two runners. If we let [`x`] represent [$name1]'s speed (in miles per hour), then [$name2] runs with a speed of [`x-[$rDif]`] miles per hour. + +END_PGML +Context()->texStrings; +BEGIN_TEXT +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"Rate",header=>"CH"},{data=>" \(\times\)",header=>"CH"},{data=>"Time",header=>"CH"},{data=>"\(=\)",header=>"CH"},{data=>"Distance",header=>"CH"},], +[{data=>"$name1",header=>"RH"},"\(x\)","$SPACE","\($t\)","$SPACE",ans_rule(15)], +[{data=>"$name2",header=>"RH"},"\(x-$rDif\)","$SPACE","\($t\)","$SPACE",ans_rule(15)], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$PAR +END_TEXT +Context()->normalStrings; + +ANS( Compute("$t*x") -> cmp); +ANS( Compute("$t*(x-$rDif)") -> cmp); + + +BEGIN_PGML + + According to the table, the total separation between the two runners after [`[$t]`] hours is [_______________] miles. + +Now set up and solve an equation to find the runners' speeds. + + [$name1] ran with a speed of [_________]. + [$name2] ran with a speed of [_________]. + + + +END_PGML + +############################################## +$showPartialCorrectAnswers=1; +ANS(Compute("$t*x+$t*(x-$rDif)") -> cmp() ->withPostFilter(AnswerHints( + Compute($d) => "Give the total separation _according to the table_, not according to the problem introduction" +))); + +Context("LimitedNumeric"); +ANS( Compute("$r1") -> cmp); +ANS( Compute("$r2") -> cmp); + +$s1 = $t*$rDif; +$s2 = 2*$t; +$s3 = $d+$s1; + +BEGIN_SOLUTION +$PAR +The relevant formula is: + +\[\text{rate}\cdot\text{time} = \text{distance}\] + +If we let \(x\) represent the $name1's speed (in miles per hour), then $name2 ran with a speed of \(x-$rDif \) miles per hour. $PAR + +\(\small\bullet\) $name1 has run \($t x\) miles. $BR +\(\small\bullet\) $name2 has run \($t (x-$rDif )\) miles. $BR + +$PAR +Now the table looks like: +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"Rate",header=>"CH"},{data=>" \(\times\)",header=>"CH"},{data=>"Time",header=>"CH"},{data=>"\(=\)",header=>"CH"},{data=>"Distance",header=>"CH"},], +[{data=>"$name1",header=>"RH"},"\(x\)","$SPACE","\($t\)","$SPACE","\($t x\)"], +[{data=>"$name2",header=>"RH"},"\(x-$rDif\)","$SPACE","\($t\)","$SPACE","\($t(x-$rDif)\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + + +$PAR + +And the total separation between them is \($t x+$t (x-$rDif )\) miles. + +It is given in the introduction that they ran a total of \($d\) miles. Now we can write an equation and solve it: + +$PAR +\[ +\begin{aligned} + $t x + $t (x-$rDif ) &= $d \\ + $t x + $t x-$t \cdot $rDif &= $d \\ + $s2 x -$s1 &= $d \\ + $s2 x -$s1 +$s1 &= $d +$s1 \\ + $s2 x &= $s3 \\ + \frac{$s2 x}{$s2 } &= \frac{$s3 }{$s2 } \\ + x &= $r1 \\ +\end{aligned} +\] +$PAR +So $name1 ran with a speed of \($r1\) miles per hour, and $name2 ran with a speed of \($r1 -$rDif\), or \($r2\), miles per hour. + +END_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable30.pg new file mode 100644 index 0000000000..cef7d2f6a1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable30.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear equation to solve distance word problems. +# A table is available to help organize data. +# +# Last updated: Jordan 8/29/1; Yao, 7/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('equation','solve','word problem','distance') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "answerHints.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$r1 = random(45,55,1); +$rDif = random(2,10,1); +$r2 = $r1+$rDif; +$t1 = random(2.5,5.5,1); +$t2 = random(2,6,1); +$d1 = $r1*$t1; +$d2 = $r2*$t2; +$d = $d1+$d2; + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); + +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); + +$name1 = RandomName(sex=>$sex); + +############################################## +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_PGML + +[$name1] drove a total of [`[$d]`] miles on a two-part road trip. In the first part of the trip, [$pronoun] drove for [`[$t1]`] hours. In the second part of the trip, [$pronoun] drove an average of [`[$rDif]`] miles per hour faster, and drove for [`[$t2]`] hours. What was [$name1]'s average speed over each leg of the trip? + +You can use a table to organize the quantities (speed, time, and distance) for each leg of [$name1]'s trip. If we let [`x`] represent [$name1]'s average speed for the first leg (in miles per hour), then [$possessive] average speed over the second leg is [`x+[$rDif]`] miles per hour. + +END_PGML +Context()->texStrings; +BEGIN_TEXT +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"Rate",header=>"CH"},{data=>" \(\times\)",header=>"CH"},{data=>"Time",header=>"CH"},{data=>"\(=\)",header=>"CH"},{data=>"Distance",header=>"CH"},], +[{data=>"first leg of trip",header=>"RH"},"\(x\)","$SPACE","\($t1\)","$SPACE",ans_rule(15)], +[{data=>"second leg of trip",header=>"RH"},"\(x+$rDif\)","$SPACE","\($t2\)","$SPACE",ans_rule(15)], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$PAR +END_TEXT +Context()->normalStrings; + +ANS( Compute("$t1*x") -> cmp); +ANS( Compute("$t2*(x+$rDif)") -> cmp); + + +BEGIN_PGML + + According to the table, the total distance that [$name1] traveled is [_______________] miles. + +Now set up and solve an equation to find [$name1]'s average speeds. + + [$name1] had an average speed of [_________] miles per hour over the first leg of the trip. + [$name1] had an average speed of [_________] miles per hour over the second leg of the trip. + + + +END_PGML + + +############################################## +$showPartialCorrectAnswers=1; +ANS(Compute("$t1*x+$t2*(x+$rDif)") -> cmp() ->withPostFilter(AnswerHints( + Compute($d) => "Give the total distance _according to the table_, not according to the problem introduction" +))); + +Context("LimitedNumeric"); +ANS( Compute("$r1") -> cmp); +ANS( Compute("$r2") -> cmp); + +$s1 = $t2*$rDif; +$s2 = $t1+$t2; +$s3 = $d-$s1; + +BEGIN_SOLUTION +$PAR +The relevant formula is: + +\[\text{rate}\cdot\text{time} = \text{distance}\] + +If we let \(x\) represent the $name1's average speed over the first leg (in miles per hour), then $possessive average speed over the second leg is \(x+$rDif \) miles per hour. $PAR + +\(\small\bullet\) Over the first leg, $name1 has traveled \($t1 x\) miles. $BR +\(\small\bullet\) Over the second leg, $name1 has traveled \($t2 (x+$rDif )\) miles. $BR + +$PAR +Now the table looks like: +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"Rate",header=>"CH"},{data=>" \(\times\)",header=>"CH"},{data=>"Time",header=>"CH"},{data=>"\(=\)",header=>"CH"},{data=>"Distance",header=>"CH"},], +[{data=>"first leg of trip",header=>"RH"},"\(x\)","$SPACE","\($t1\)","$SPACE","\($t1 x\)"], +[{data=>"second leg of trip",header=>"RH"},"\(x+$rDif\)","$SPACE","\($t2\)","$SPACE","\($t2(x+$rDif)\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$PAR + +And the total distance traveled \($t1 x+$t2 (x+$rDif )\) miles. + +It is given in the introduction that [$name1] drove a total of \($d\) miles. Now we can write an equation and solve it: + +$PAR +\[ +\begin{aligned} + $t1 x + $t2 (x+$rDif ) &= $d \\ + $t1 x + $t2 x+$t2 \cdot $rDif &= $d \\ + $s2 x +$s1 &= $d \\ + $s2 x +$s1 -$s1 &= $d -$s1 \\ + $s2 x &= $s3 \\ + \frac{$s2 x}{$s2 } &= \frac{$s3 }{$s2 } \\ + x &= $r1 +\end{aligned} +\] +$PAR +So $name1 had an average speed of \($r1 \) miles per hour in the first part of $possessive trip. And $pronoun drove with an average speed of \($r1 +$rDif\), or \($r2 \), miles per hour over the second leg of the trip. +$PAR +END_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication10.pg index 9c21ca4417..f117e1ef27 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication10.pg @@ -7,17 +7,18 @@ # Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(TwoDataPoints_findLine_use) -## MLTleader(1) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "PGML.pl", "parserAssignment.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,8 +70,7 @@ BEGIN_PGML By your cell phone contract, you pay a monthly fee plus some money for each minute you use the phone during the month. In one month, you spent [`[$x1]`] minutes on the phone, and paid [`[$cy1]`]. In another month, you spent [`[$x2]`] minutes on the phone, and paid [`[$cy2]`]. -Let [`x`] be the number of minutes you talk over the phone in a month, and let [`y`] be your cell phone bill for that month. Use a linear equation to model your monthly bill based on the number of minutes you talk over the phone. - +Let [`x`] be the number of minutes you talk over the phone in a month, and let [`y`] be your cell phone bill, in dollars, for that month. Use a linear equation to model your monthly bill based on the number of minutes you talk over the phone. a) This linear model's slope-intercept equation is [______________]{$ansSI}. b) If you spent [`[$x3]`] minutes over the phone in a month, you would pay [___________]{$cy3}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication20.pg index 114c6b52a8..e620183e61 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication20.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(TwoDataPoints_findLine_use) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "parserAssignment.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,13 +49,22 @@ $x2=random(5,7,1); $y2=$m*$x2+$b; $x3=random(9,11,1); $y3=$m*$x3+$b; -$x4=int(($y4-$b)/$m)+1; + +$x4 = ($y4-$b)/$m; +if ($x4==int($x4)) { + $out1 = "$x4 &= x"; + $yx4 = 2000 + $x4; +} else { + $x4 = sprintf("%.2f", $x4); + $out1 = "$x4 & \approx x"; + $yx4 = 2000 + int($x4); +} + $y4=0; $yx1 = 2000+$x1; $yx2 = 2000+$x2; $yx3 = 2000+$x3; -$yx4 = 2000+$x4; parser::Assignment->Allow; $ansSI=Formula("y=$m*x+$b")->reduce; @@ -77,13 +88,12 @@ BEGIN_PGML A company set aside a certain amount of money in the year 2000. The company spent exactly the same amount from that fund each year on perks for its employees. In [` [$yx1]`], there was still [`[$cy1]`] left in the fund. In [`[$yx2]`], there was [`[$cy2]`] left. -Let [`x`] be the number of years since 2000, and let [`y`] be the amount of money left in the fund that year. Use a linear equation to model the amount of money left in the fund after so many years. - +Let [`x`] be the number of years since 2000, and let [`y`] be the amount of money, in dollars, left in the fund that year. Use a linear equation to model the amount of money left in the fund after so many years. a) The linear model's slope-intercept equation is [______________]{$ansSI}. b) In the year [`[$yx3]`], there was [___________]{$cy3} left in the fund. -c) In the year [___________]{2000+$x4}, the fund will be empty. +c) In the year [___________]{$yx4}, the fund will be empty. END_PGML @@ -174,11 +184,11 @@ c) The fund will be empty when it has [`[$cz]`] left in it. That is, [`y`] wi [$y4]\mathbf{{}-[$b]} &= [$m]x +[$b]\mathbf{{}-[$b]} \\ [$s6] &= [$m]x \\ \frac{[$s6]}{[$m]} &= \frac{[$m]x}{[$m]} \\ - [$x4] &= x + [$out1] \end{aligned} ``] - So [`[$x4]`] years after 2000, in the year [$yx4], the fund will be depleted. + Approximately [`[$x4]`] years after 2000, in the year [$yx4], the fund will be depleted. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication30.pg index e4d7daea77..d8711e03dc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication30.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(TwoDataPoints_findLine_use) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserAssignment.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,8 +62,7 @@ BEGIN_PGML A biologist has been observing a tree's height. [`[$x1]`] months into the observation, the tree was [`[$y1]`] feet tall. [`[$x2]`] months into the observation, the tree was [`[$y2]`] feet tall. -Let [`x`] be the number of months passed since the observations started, and let [`y`] be the tree's height at that time. Use a linear equation to model the tree's height as the number of months pass. - +Let [`x`] be the number of months passed since the observations started, and let [`y`] be the tree's height at that time, in feet. Use a linear equation to model the tree's height as the number of months pass. a) This line's slope-intercept equation is [______________]{$ansSI}. b) [`[$x3]`] months after the observations started, the tree would be [___________]{$y3} feet in height. @@ -98,7 +99,7 @@ a) A line's equation in slope-intercept form looks like [` y=mx+b `], where [ [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m] \end{aligned}``] - This line's slope is [`[$m]`]. This implies that the tree is growing by [`[$m]`] feet per month. + This line's slope is [`[$m]`]. This implies that the tree is growing by [`[$m]`] feet each month. So now we have that [` y=[$m]x+b `]. The next step is to find the value of [`b`]. There are at least two ways. @@ -145,9 +146,9 @@ b) After [`[$x3]`] months, we can find the height of the tree if we substitut \end{aligned} ``] - So after [`[$x3]`] months, the tree is [`[$cy3]`] feet tall. + So after [`[$x3]`] months, the tree is [`[$y3]`] feet tall. ---- -c) To find when the tree was [`[$cy4]`] feet tall, we can substitute [`[$y4]`] in for [`y`] in the equation [` y=[$m]x+[$b] `], and we have: +c) To find when the tree was [`[$y4]`] feet tall, we can substitute [`[$y4]`] in for [`y`] in the equation [` y=[$m]x+[$b] `], and we have: [`` \begin{aligned} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication40.pg index afd8841cdd..a2fd258690 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication40.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/31/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(TwoDataPoints_findLine_use) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "parserAssignment.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -68,7 +70,6 @@ Scientists are conducting an experiment with a gas in a sealed container. The ma [@numberWord($x2,capital=>1)@] minutes since the experiment started, the gas had a mass of [`[$y2]`] grams. Let [`x`] be the number of minutes that have passed since the experiment started, and let [`y`] be the mass of the gas in grams at that moment. Use a linear equation to model the weight of the gas over time. - a) This line's slope-intercept equation is [______________]{$ansSI}. b) [`[$x3]`] minutes after the experiment started, there would be [___________]{$y3} grams of gas left. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication50.pg index 66810be045..b097eb95ce 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication50.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/31/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(TwoDataPoints_findLine_use) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "parserAssignment.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -71,8 +73,7 @@ BEGIN_PGML By your cell phone contract, you pay a monthly fee plus [`[$cm]`] for each minute you spend on the phone. In one month, you spent [`[$x1]`] minutes over the phone, and had a bill totaling [`[$cy1]`]. -Let [`x`] be the number of minutes you spend on the phone in a month, and let [`y`] be your total cell phone bill for that month. Use a linear equation to model your monthly bill based on the number of minutes you spend on the phone. - +Let [`x`] be the number of minutes you spend on the phone in a month, and let [`y`] be your total cell phone bill for that month, in dollars. Use a linear equation to model your monthly bill based on the number of minutes you spend on the phone. a) This line's slope-intercept equation is [______________]{$ansSI}. b) If you spend [`[$x3]`] minutes on the phone in a month, you would be billed [___________]{$cy3}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication60.pg index fa32189273..3e021206a7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication60.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/31/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(TwoDataPoints_findLine_use) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "parserAssignment.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -48,13 +50,21 @@ $x2=random(5,7,1); $y2=$m*$x2+$b; $x3=random(9,11,1); $y3=$m*$x3+$b; -$x4=int(($y4-$b)/$m)+1; $y4=0; +$x4 = ($y4-$b)/$m; +if ($x4==int($x4)) { + $out1 = "$x4 &= x"; + $yx4 = 2000 + $x4; +} else { + $x4 = sprintf("%.2f", $x4); + $out1 = "$x4 & \approx x"; + $yx4 = 2000 + int($x4); +} + $yx1 = 2000+$x1; $yx2 = 2000+$x2; $yx3 = 2000+$x3; -$yx4 = 2000+$x4; parser::Assignment->Allow; $ansSI=Formula("y=$m*x+$b")->reduce; @@ -75,15 +85,14 @@ TEXT(beginproblem()); BEGIN_PGML -A company set aside a certain amount of money in the year 2000. The company spent exactly exactly [`[$cm]`] from that fund each year on perks for its employees. In [` [$yx1]`], there was still [`[$cy1]`] left in the fund. - -Let [`x`] be the number of years since 2000, and let [`y`] be the amount of money left in the fund that year. Use a linear equation to model the amount of money left in the fund after so many years. +A company set aside a certain amount of money in the year 2000. The company spent exactly [`[$cm]`] from that fund each year on perks for its employees. In [` [$yx1]`], there was still [`[$cy1]`] left in the fund. +Let [`x`] be the number of years since 2000, and let [`y`] be the amount of money, in dollars, left in the fund that year. Use a linear equation to model the amount of money left in the fund after so many years. a) The linear model's slope-intercept equation is [______________]{$ansSI}. b) In the year [`[$yx3]`], there was [___________]{$cy3} left in the fund. -c) In the year [___________]{2000+$x4}, the fund will be empty. +c) In the year [___________]{$yx4}, the fund will be empty. END_PGML @@ -162,11 +171,11 @@ c) The fund will be empty when it has [`[$cz]`] left in it. That is, [`y`] wi [$y4]\mathbf{{}-[$b]} &= [$m]x +[$b]\mathbf{{}-[$b]} \\ [$s6] &= [$m]x \\ \frac{[$s6]}{[$m]} &= \frac{[$m]x}{[$m]} \\ - [$x4] &= x + [$out1] \end{aligned} ``] - So [`[$x4]`] years after 2000, in the year [$yx4], the fund will be depleted. + Approximately [`[$x4]`] years after 2000, in the year [$yx4], the fund will be depleted. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication70.pg new file mode 100644 index 0000000000..10c3307306 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication70.pg @@ -0,0 +1,157 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given the slope and a point, find a line's equation in slope-intercept form. +# Application problem. Slope is positive. +# +# Last updated: Jordan 8/31/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m=random(10,30,1)/100; +$b=random(110,190,1)/10; + +$x1=random(10,15,1); +$y1=$m*$x1+$b; +$x2=random(16,20,1); +$y2=$m*$x2+$b; +$x3=random(25,30,1); +$y3=$m*$x3+$b; +$x4=random(50,60,1); +$y4=$m*$x4+$b; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A biologist has been observing a tree's height. This type of tree typically grows by [`[$m]`] feet each month. [@ucfirst(numberWord($x1))@] months into the observation, the tree was [`[$y1]`] feet tall. + +Let [`x`] be the number of months passed since the observations started, and let [`y`] be the tree's height at that time, in feet. Use a linear equation to model the tree's height as the number of months pass. +a) This line's slope-intercept equation is [______________]{$ansSI}. + +b) [`[$x3]`] months after the observations started, the tree would be [___________]{$y3} feet in height. + +c) [___________]{$x4} months after the observation started, the tree would be [`[$y4]`] feet tall. + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +a) A line's equation in slope-intercept form looks like [` y=mx+b `], where [`m`] is the slope, and [`y`] is the [`y`]-coordinate of the [`y`]-intercept. Since the tree grows at a rate of [`[$m]`] feet per month, [`[$m]`] is the slope of the linear model. + + So now we have that [` y=[$m]x+b `]. The next step is to find the value of [`b`]. There are at least two ways. + + ####One way#### + is to substitute a known point into [` y=[$m]x+b `]. We use the point [`([$x1],[$y1])`]. + + [` +\begin{aligned} + y &= [$m]x + b \\ + [$y1] &= [$m] \cdot [$x1] + b \\ + [$y1] &= [$s3] + b \\ + [$y1]\mathbf{{}-[$s3]} &= [$s3] + b\mathbf{{}-[$s3]} \\ + [$b] &= b\\ + b &= [$b] +\end{aligned} +`] + + This line's slope-intercept equation is [` y=[$m]x+[$b] `]. + + ####Another way#### + is to use the line's point-slope equation [` y-y_{1}=m(x-x_{1}) `]. Again, we use the point [`([$x1],[$y1])`]. + + [` +\begin{aligned} + y-y_{1} &= m(x-x_{1}) \\ + y-[$y1] &= [$m](x-[$x1]) \\ + y-[$y1] &= [$m]x+[$m] \cdot (-[$x1]) \\ + y-[$y1] &= [$m]x+[$s4] \\ + y-[$y1]\mathbf{{}+[$y1]} &= [$m]x+[$s4]\mathbf{{}+[$y1]} \\ + y &= [$m]x+[$b] +\end{aligned} +`] + + This is the second way to find [`b`], and thus the line's slope-intercept equation is [` y=[$m]x+[$b] `]. + ---- +b) After [`[$x3]`] months, we can find the height of the tree if we substitute [`[$x3]`] in for [`x`] in the equation [` y=[$m]x+[$b] `]. We have: + + [`` +\begin{aligned} + y &= [$m]x+[$b] \\ + y &= [$m] \cdot [$x3] +[$b] \\ + y &= [$s5]+[$b] \\ + y &= [$y3] +\end{aligned} +``] + + So after [`[$x3]`] months, the tree is [`[$cy3]`] feet tall. + ---- +c) To find when the tree was [`[$cy4]`] feet tall, we can substitute [`[$y4]`] in for [`y`] in the equation [` y=[$m]x+[$b] `], and we have: + + [`` +\begin{aligned} + y &= [$m]x+[$b] \\ + [$y4] &= [$m]x +[$b] \\ + [$y4]\mathbf{{}-[$b]} &= [$m]x +[$b]\mathbf{{}-[$b]}\\ + [$s6] &= [$m]x \\ + \frac{[$s6]}{[$m]} &= \frac{[$m]x}{[$m]} \\ + [$x4] &= x +\end{aligned} +``] + + So the tree was [`[$y4]`] feet tall after [`[$x4]`] months. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication80.pg index cee6c7ad3f..813e4a051a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindLineEquationApplication80.pg @@ -7,15 +7,18 @@ # Last updated: Jordan 8/31/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +30,7 @@ loadMacros( "PGML.pl", "parserAssignment.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,10 +63,9 @@ TEXT(beginproblem()); BEGIN_PGML -Scientists are conducting an experiment with a gas in a sealed container. The mass of the gas is measured, and the scientists realize that the gas is leaking over time in a linear way. Its mass is leaking by [`[$absM]`] grams per minute. [@numberWord($x1,capital=>1)@] minutes since the experiment started, the remaining gas had a mass of [`[$y1]`] grams. +Scientists are conducting an experiment with a gas in a sealed container. The mass of the gas is measured, and the scientists realize that the gas is leaking over time in a linear way. Each minute, they lose [`[$absM]`] grams. [@numberWord($x1,capital=>1)@] minutes since the experiment started, the remaining gas had a mass of [`[$y1]`] grams. Let [`x`] be the number of minutes that have passed since the experiment started, and let [`y`] be the mass of the gas in grams at that moment. Use a linear equation to model the weight of the gas over time. - a) This line's slope-intercept equation is [______________]{$ansSI}. b) [`[$x3]`] minutes after the experiment started, there would be [___________]{$y3} grams of gas left. @@ -88,7 +90,7 @@ $outputx1 = $x1<0 ? "($x1)" : $x1; BEGIN_PGML_SOLUTION -a) A line's equation in slope-intercept form looks like [` y=mx+b `], where [`m`] is the slope, and [`y`] is the [`y`]-coordinate of the [`y`]-intercept. Since the gas is leaking by [`[$absM]`] grams per minute, we know that the slope of the linear model is [`[$m]`]. +a) A line's equation in slope-intercept form looks like [` y=mx+b `], where [`m`] is the slope, and [`y`] is the [`y`]-coordinate of the [`y`]-intercept. Since the gas is leaking at a rate of [`[$absM]`] grams per minute, we know that the slope of the linear model is [`[$m]`]. So now we have that [` y=[$m]x+b `]. The next step is to find the value of [`b`]. There are at least two ways. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication10.pg new file mode 100644 index 0000000000..9d79906ae6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication10.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# Application problem. Slope is positive. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "contextCurrency.pl", + "parserOneOf.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context("Numeric")->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m=random(1.5,6.5,1)/100; +$b=random(11,19,1); + +$x1=random(210,300,10); +$y1=$m*$x1+$b; +$x2=random(310,400,10); +$y2=$m*$x2+$b; +$x3=random(110,200,10); +$y3=$m*$x3+$b; +$x4=random(410,500,10); +$y4=$m*$x4+$b; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +Context("Currency"); +$cy1 = Currency($y1); +$cy2 = Currency($y2); +$cy3 = Currency($y3); +$cy4 = Currency($y4); +$cm = Currency($m); + +Context("Numeric"); +parser::Assignment->Allow; +Context()->variables->add(y=>'Real'); +Context()->flags->set(tolType=>'absolute'); +Context()->variables->set(x=>{limits=>[$x1,$x2]}); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$ansPS = OneOf(Formula("y=$m*(x-$x1)+$y1"),Formula("y=$m*(x-$x2)+$y2")); +$ansPS_evaluator = $ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +}); +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +By your cell phone contract, you pay a monthly fee plus some money for each minute you use the phone during the month. In one month, you spent [`[$x1]`] minutes on the phone, and paid [`[$cy1]`]. In another month, you spent [`[$x2]`] minutes on the phone, and paid [`[$cy2]`]. + +Let [`x`] be the number of minutes you talk over the phone in a month, and let [`y`] be your cell phone bill, in dollars, for that month. Use a linear equation to model your monthly bill based on the number of minutes you talk over the phone. +a) A point-slope equation to model this is [______________]{$ansPS_evaluator}. + +b) If you spent [`[$x3]`] minutes over the phone in a month, you would pay [___________]{$cy3}. + +c) If in a month, you paid [`[$cy4]`] of cell phone bill, you must have spent [___________]{$x4} minutes on the phone in that month. + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +a) A line's equation in point-slope form looks like [` y=m(x-x_0)+y_0 `], where [`m`] is the slope, and [`(x_0,y_0)`] is some point we know to be on the line. We first need to find the line's slope. To find the slope, we need two points on the line. We have been given that [`([$x1],[$y1])`] and [`([$x2],[$y2])`] are points on the linear model, so we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + + First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + + Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m] \end{aligned}``] + + This line's slope is [`[$m]`]. This implies you have to pay [`[$cm]`] per minute that you use the phone. + + So now we have that [` y=[$m](x-x_0)+y_0 `]. We can either use [`(x_0,y_0)=([$x1],[$y1])`] or [`(x_0,y_0)=([$x2],[$y2])`] to get [`[$ansPS]`]. + +b) In one month, you spent [`[$x3]`] minutes on the phone. To find out the bill, we substitute [`[$x3]`] in for [`x`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m]([$x3]-[$x1]) +[$y1] \\ + y &= [$y3] +\end{aligned} +``] + + If you spent [`[$x3]`] minutes over the phone in a month, your bill for that month would be [`[$cy3]`]. + +c) In one month, you had a cell phone bill of [`[$cy4]`]. To find how many minutes you spent on the phone that month, we substitute [`[$y4]`] in for [`y`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m](x-[$x1]) +[$y1] \\ + [$y4] &= [$m](x-[$x1]) +[$y1] \\ + [@$y4-$y1@] &= [$m](x-[$x1])\\ + \frac{[@$y4-$y1@]}{[$m]} &= x - [$x1]\\ + [@($y4-$y1)/$m@] &= x - [$x1]\\ + [@($y4-$y1)/$m+$x1@] &= x\\ + [$x4] &= x +\end{aligned} +``] + + If your bill was [`[$cy4]`] in one month, you must have spent [`[$x4]`] minutes on the phone. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication20.pg new file mode 100644 index 0000000000..1429588572 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication20.pg @@ -0,0 +1,192 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# Application problem. Slope is negative. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "contextCurrency.pl", + "parserOneOf.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context("Numeric")->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m= -random(20000,50000,1000); +$b= random(600000,1000000,1000); + +$x1=random(2,4,1); +$y1=$m*$x1+$b; +$x2=random(5,7,1); +$y2=$m*$x2+$b; +$x3=random(9,11,1); +$y3=$m*$x3+$b; + +$x4 = ($y4-$b)/$m; +if ($x4==int($x4)) { + $out1 = "$x4 &= x"; + $yx4 = 2000 + $x4; +} else { + $x4 = sprintf("%.2f", $x4); + $out1 = "$x4 & \approx x"; + $yx4 = 2000 + int($x4); +} + +$y4=0; + +$yx1 = 2000+$x1; +$yx2 = 2000+$x2; +$yx3 = 2000+$x3; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +$cy1 = Currency($y1); +$cy2 = Currency($y2); +$cy3 = Currency($y3); +$cy4 = Currency($y4); +$cb = Currency($b); +$cm = Currency(-$m); +$cz = Currency(0); + +Context("Numeric"); +parser::Assignment->Allow; +Context()->variables->add(y=>'Real'); +Context()->flags->set(tolType=>'absolute'); +Context()->variables->set(x=>{limits=>[$x1,$x2]}); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$ansPS = OneOf(Formula("y=$m*(x-$x1)+$y1"),Formula("y=$m*(x-$x2)+$y2")); +$ansPS_evaluator = $ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +}); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A company set aside a certain amount of money in the year 2000. The company spent exactly the same amount from that fund each year on perks for its employees. In [` [$yx1]`], there was still [`[$cy1]`] left in the fund. In [`[$yx2]`], there was [`[$cy2]`] left. + +Let [`x`] be the number of years since 2000, and let [`y`] be the amount of money, in dollars, left in the fund that year. Use a linear equation to model the amount of money left in the fund after so many years. +a) A point-slope equation to model this is [______________]{$ansPS_evaluator}. + +b) In the year [`[$yx3]`], there was [___________]{$cy3} left in the fund. + +c) In the year [___________]{$yx4}, the fund will be empty. + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; +$s7=sprintf("%.2f", $s6/$m); + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +a) A line's equation in point-slope form looks like [` y=m(x-x_0)+y_0 `], where [`m`] is the slope, and [`(x_0,y_0)`] is some point we know to be on the line. We first need to find the line's slope. To find the slope, we need two points on the line. We have been given that [`([$x1],[$y1])`] and [`([$x2],[$y2])`] are points on the linear model, so we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + + First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + + Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m] \end{aligned}``] + + This line's slope is [`[$m]`]. This implies that the company is spending [`[$cm]`] per year on perks for its employees. + + So now we have that [` y=[$m](x-x_0)+y_0 `]. We can either use [`(x_0,y_0)=([$x1],[$y1])`] or [`(x_0,y_0)=([$x2],[$y2])`] to get [`[$ansPS]`]. + +b) In the year [`[$yx3]`], [`x`] was [`[$x3]`]. To find the amount remaining in the fund, we substitute [`[$x3]`] in for [`x`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m]([$x3]-[$x1]) +[$y1] \\ + y &= [$y3] +\end{aligned} +``] + + So in the year [`[$yx3]`], the fund had [`[$cy3]`] remaining in it. + + +c) The fund will be empty when it has [`[$cz]`] left in it. That is, [`y`] will equal [`0`]. To find how many years until this happens, we substitute [`[$y4]`] in for [`y`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m](x-[$x1]) +[$y1] \\ + [$y4] &= [$m](x-[$x1]) +[$y1] \\ + [@$y4-$y1@] &= [$m](x-[$x1])\\ + \frac{[@$y4-$y1@]}{[$m]} &= x - [$x1]\\ + [@($y4-$y1)/$m@] &= x - [$x1]\\ + [@($y4-$y1)/$m+$x1@] &= x\\ + [$x4] &= x +\end{aligned} +``] + + Approximately [`[$x4]`] years after 2000, in the year [$yx4], the fund will be depleted. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication30.pg new file mode 100644 index 0000000000..5114994a22 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication30.pg @@ -0,0 +1,165 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# Application problem. Slope is positive. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "parserOneOf.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context("Numeric")->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m=random(10,30,1)/100; +$b=random(110,190,1)/10; + +$x1=random(10,15,1); +$y1=$m*$x1+$b; +$x2=random(16,20,1); +$y2=$m*$x2+$b; +$x3=random(25,30,1); +$y3=$m*$x3+$b; +$x4=random(50,60,1); +$y4=$m*$x4+$b; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +Context("Numeric"); +parser::Assignment->Allow; +Context()->variables->add(y=>'Real'); +Context()->flags->set(tolType=>'absolute'); +Context()->variables->set(x=>{limits=>[$x1,$x2]}); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$ansPS = OneOf(Formula("y=$m*(x-$x1)+$y1"),Formula("y=$m*(x-$x2)+$y2")); +$ansPS_evaluator = $ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +}); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A biologist has been observing a tree's height. [`[$x1]`] months into the observation, the tree was [`[$y1]`] feet tall. [`[$x2]`] months into the observation, the tree was [`[$y2]`] feet tall. + +Let [`x`] be the number of months passed since the observations started, and let [`y`] be the tree's height at that time, in feet. Use a linear equation to model the tree's height as the number of months pass. +a) A point-slope equation to model this is [______________]{$ansPS_evaluator}. + +b) [`[$x3]`] months after the observations started, the tree would be [___________]{$y3} feet in height. + +c) [___________]{$x4} months after the observation started, the tree would be [`[$y4]`] feet tall. + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +a) A line's equation in point-slope form looks like [` y=m(x-x_0)+y_0 `], where [`m`] is the slope, and [`(x_0,y_0)`] is some point we know to be on the line. We first need to find the line's slope. To find the slope, we need two points on the line. We have been given that [`([$x1],[$y1])`] and [`([$x2],[$y2])`] are points on the linear model, so we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + + First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + + Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m] \end{aligned}``] + + This line's slope is [`[$m]`]. This implies that the tree is growing by [`[$m]`] feet each month. + + So now we have that [` y=[$m](x-x_0)+y_0 `]. We can either use [`(x_0,y_0)=([$x1],[$y1])`] or [`(x_0,y_0)=([$x2],[$y2])`] to get [`[$ansPS]`]. + +b) After [`[$x3]`] months, we can find the height of the tree if we substitute [`[$x3]`] in for [`x`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m]([$x3]-[$x1]) +[$y1] \\ + y &= [$y3] +\end{aligned} +``] + + So after [`[$x3]`] months, the tree is [`[$y3]`] feet tall. + +c) To find when the tree was [`[$y4]`] feet tall, we substitute [`[$y4]`] in for [`y`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m](x-[$x1]) +[$y1] \\ + [$y4] &= [$m](x-[$x1]) +[$y1] \\ + [@$y4-$y1@] &= [$m](x-[$x1])\\ + \frac{[@$y4-$y1@]}{[$m]} &= x - [$x1]\\ + [@($y4-$y1)/$m@] &= x - [$x1]\\ + [@($y4-$y1)/$m+$x1@] &= x\\ + [$x4] &= x +\end{aligned} +``] + + So the tree was [`[$y4]`] feet tall after [`[$x4]`] months. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication40.pg new file mode 100644 index 0000000000..8181ac2d4a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication40.pg @@ -0,0 +1,174 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# Application problem. Slope is negative. +# +# Last updated: Jordan 8/31/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "parserOneOf.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context("Numeric")->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$x4=random(40,50,1); +$y4=0; + +$m= -random(11,99,1)/10; +$negm = -$m; +$b= -$m*$x4; + +$x1=random(5,10,1); +$y1=$m*$x1+$b; +$x2=random(11,19,1); +$y2=$m*$x2+$b; +$x3=random(30,40,1); +$y3=$m*$x3+$b; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +Context("Numeric"); +parser::Assignment->Allow; +Context()->variables->add(y=>'Real'); +Context()->flags->set(tolType=>'absolute'); +Context()->variables->set(x=>{limits=>[$x1,$x2]}); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$ansPS = OneOf(Formula("y=$m*(x-$x1)+$y1"),Formula("y=$m*(x-$x2)+$y2")); +$ansPS_evaluator = $ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +}); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Scientists are conducting an experiment with a gas in a sealed container. The mass of the gas is measured, and the scientists realize that the gas is leaking over time in a linear way. + +[@numberWord($x1,capital=>1)@] minutes since the experiment started, the gas had a mass of [`[$y1]`] grams. + +[@numberWord($x2,capital=>1)@] minutes since the experiment started, the gas had a mass of [`[$y2]`] grams. + +Let [`x`] be the number of minutes that have passed since the experiment started, and let [`y`] be the mass of the gas in grams at that moment. Use a linear equation to model the weight of the gas over time. +a) A point-slope equation to model this is [______________]{$ansPS_evaluator}. + +b) [`[$x3]`] minutes after the experiment started, there would be [___________]{$y3} grams of gas left. + +c) If a linear model continues to be accurate, [___________]{$x4} minutes since the experiment started, all gas in the container will be gone. + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +a) A line's equation in point-slope form looks like [` y=m(x-x_0)+y_0 `], where [`m`] is the slope, and [`(x_0,y_0)`] is some point we know to be on the line. We first need to find the line's slope. To find the slope, we need two points on the line. We have been given that [`([$x1],[$y1])`] and [`([$x2],[$y2])`] are points on the linear model, so we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + + First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + + Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m] \end{aligned}``] + + This line's slope is [`[$m]`]. This implies that the gas is leaking with a rate of [`[$negm]`] grams per minute. + + So now we have that [` y=[$m](x-x_0)+y_0 `]. We can either use [`(x_0,y_0)=([$x1],[$y1])`] or [`(x_0,y_0)=([$x2],[$y2])`] to get [`[$ansPS]`]. + +b) After [`[$x3]`] minutes, we can find the mass of the remaining gas if we substitute [`[$x3]`] in for [`x`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m]([$x3]-[$x1]) +[$y1] \\ + y &= [$y3] +\end{aligned} +``] + + So after [`[$x3]`] minutes, there are [`[$y3]`] grams of gas remaining. + +c) To find when the gas will be all gone, we need to find when there are [`[$y4]`] grams of gas left. We can substitute [`[$y4]`] in for [`y`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m](x-[$x1]) +[$y1] \\ + [$y4] &= [$m](x-[$x1]) +[$y1] \\ + [@$y4-$y1@] &= [$m](x-[$x1])\\ + \frac{[@$y4-$y1@]}{[$m]} &= x - [$x1]\\ + [@($y4-$y1)/$m@] &= x - [$x1]\\ + [@($y4-$y1)/$m+$x1@] &= x\\ + [$x4] &= x +\end{aligned} +``] + + So after [`[$x4]`] minutes, the gas will be all gone. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication50.pg new file mode 100644 index 0000000000..99f7e14423 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication50.pg @@ -0,0 +1,163 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given the slope and a point, find a line's equation in slope-intercept form. +# Application problem. Slope is positive. +# +# Last updated: Jordan 8/31/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "contextCurrency.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m=random(3,7,1)/100; +$mx = Formula("$m x")->reduce; +$b=random(11,19,1); + +$x1=random(210,300,10); +$y1=$m*$x1+$b; +$x2=random(310,400,10); +$y2=$m*$x2+$b; +$x3=random(110,200,10); +$y3=$m*$x3+$b; +$x4=random(410,500,10); +$y4=$m*$x4+$b; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +Context("Currency"); +$cy1 = Currency($y1); +$cy2 = Currency($y2); +$cy3 = Currency($y3); +$cy4 = Currency($y4); +$cm = Currency($m); +$cb = Currency($b); + +Context("Numeric"); +parser::Assignment->Allow; +Context()->variables->add(y=>'Real'); +Context()->flags->set(tolType=>'absolute'); +Context()->variables->set(x=>{limits=>[$x1,$x2]}); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$ansPS = Formula("y=$m*(x-$x1)+$y1"); +$ansPS_evaluator = $ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +}); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + + +By your cell phone contract, you pay a monthly fee plus [`[$cm]`] for each minute you spend on the phone. In one month, you spent [`[$x1]`] minutes over the phone, and had a bill totaling [`[$cy1]`]. + +Let [`x`] be the number of minutes you spend on the phone in a month, and let [`y`] be your total cell phone bill for that month, in dollars. Use a linear equation to model your monthly bill based on the number of minutes you spend on the phone. +a) A point-slope equation to model this is [______________]{$ansPS_evaluator}. + +b) If you spend [`[$x3]`] minutes on the phone in a month, you would be billed [___________]{$cy3}. + +c) If your bill was [`[$cy4]`] one month, you must have spent [___________]{$x4} minutes on the phone in that month. + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +a) A line's equation in point-slope form looks like [` y=m(x-x_0)+y_0 `], where [`m`] is the slope, and [`(x_0,y_0)`] is some point we know to be on the line. We first need to find the line's slope. The slope of the linear model has been given to us: [`[$cm]`] per minute. + + So now we have that [` y=[$m](x-x_0)+y_0 `]. We can use [`(x_0,y_0)=([$x1],[$y1])`] to get [`[$ansPS]`]. + +b) In one month, you spent [`[$x3]`] minutes on the phone. To find out the bill, we substitute [`[$x3]`] in for [`x`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m]([$x3]-[$x1]) +[$y1] \\ + y &= [$y3] +\end{aligned} +``] + + If you spent [`[$x3]`] minutes over the phone in a month, your bill for that month would be [`[$cy3]`]. + +c) In one month, you had a cell phone bill of [`[$cy4]`]. To find how many minutes you spent on the phone that month, we substitute [`[$y4]`] in for [`y`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m](x-[$x1]) +[$y1] \\ + [$y4] &= [$m](x-[$x1]) +[$y1] \\ + [@$y4-$y1@] &= [$m](x-[$x1])\\ + \frac{[@$y4-$y1@]}{[$m]} &= x - [$x1]\\ + [@($y4-$y1)/$m@] &= x - [$x1]\\ + [@($y4-$y1)/$m+$x1@] &= x\\ + [$x4] &= x +\end{aligned} +``] + + If your bill was [`[$cy4]`] in one month, you must have spent [`[$x4]`] minutes on the phone. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication60.pg new file mode 100644 index 0000000000..2879c2ab8f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication60.pg @@ -0,0 +1,178 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given the slope and a point, find a line's equation in slope-intercept form. +# Application problem. Slope is negative. +# +# Last updated: Jordan 8/31/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "contextCurrency.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m= -random(20000,50000,1000); +$mx = Formula("$m x")->reduce; +$b= random(600000,1000000,1000); + +$x1=random(2,4,1); +$y1=$m*$x1+$b; +$x2=random(5,7,1); +$y2=$m*$x2+$b; +$x3=random(9,11,1); +$y3=$m*$x3+$b; +$y4=0; + +$x4 = ($y4-$b)/$m; +if ($x4==int($x4)) { + $out1 = "$x4 &= x"; + $yx4 = 2000 + $x4; +} else { + $x4 = sprintf("%.2f", $x4); + $out1 = "$x4 & \approx x"; + $yx4 = 2000 + int($x4); +} + +$yx1 = 2000+$x1; +$yx2 = 2000+$x2; +$yx3 = 2000+$x3; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +$cy1 = Currency($y1); +$cy2 = Currency($y2); +$cy3 = Currency($y3); +$cy4 = Currency($y4); +$cb = Currency($b); +$cm = Currency(-$m); +$cz = Currency("0"); + +Context("Numeric"); +parser::Assignment->Allow; +Context()->variables->add(y=>'Real'); +Context()->flags->set(tolType=>'absolute'); +Context()->variables->set(x=>{limits=>[$x1,$x2]}); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$ansPS = Formula("y=$m*(x-$x1)+$y1"); +$ansPS_evaluator = $ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +}); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A company set aside a certain amount of money in the year 2000. The company spent exactly [`[$cm]`] from that fund each year on perks for its employees. In [` [$yx1]`], there was still [`[$cy1]`] left in the fund. + +Let [`x`] be the number of years since 2000, and let [`y`] be the amount of money, in dollars, left in the fund that year. Use a linear equation to model the amount of money left in the fund after so many years. +a) A point-slope equation to model this is [______________]{$ansPS_evaluator}. + +b) In the year [`[$yx3]`], there was [___________]{$cy3} left in the fund. + +c) In the year [___________]{$yx4}, the fund will be empty. + +END_PGML + + + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; +$s7=sprintf("%.2f", $s6/$m); + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +a) A line's equation in point-slope form looks like [` y=m(x-x_0)+y_0 `], where [`m`] is the slope, and [`(x_0,y_0)`] is some point we know to be on the line. We first need to find the line's slope. We have been told that the account decreases by [`[$cm]`] each year, so the slope of the linear model is [`[$m]`] (dollars per year). + + So now we have that [` y=[$m](x-x_0)+y_0 `]. We can use [`(x_0,y_0)=([$x1],[$y1])`] to get [`[$ansPS]`]. + +b) In the year [`[$yx3]`], [`x`] was [`[$x3]`]. To find the amount remaining in the fund, we substitute [`[$x3]`] in for [`x`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m]([$x3]-[$x1]) +[$y1] \\ + y &= [$y3] +\end{aligned} +``] + + So in the year [`[$yx3]`], the fund had [`[$cy3]`] remaining in it. + +c) The fund will be empty when it has [`[$cz]`] left in it. That is, [`y`] will equal [`0`]. To find how many years until this happens, we substitute [`[$y4]`] in for [`y`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m](x-[$x1]) +[$y1] \\ + [$y4] &= [$m](x-[$x1]) +[$y1] \\ + [@$y4-$y1@] &= [$m](x-[$x1])\\ + \frac{[@$y4-$y1@]}{[$m]} &= x - [$x1]\\ + [@($y4-$y1)/$m@] &= x - [$x1]\\ + [@($y4-$y1)/$m+$x1@] &= x\\ + [$x4] &= x +\end{aligned} +``] + + Approximately [`[$x4]`] years after 2000, in the year [$yx4], the fund will be depleted. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication70.pg new file mode 100644 index 0000000000..cdb94204f3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication70.pg @@ -0,0 +1,152 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given the slope and a point, find a line's equation in slope-intercept form. +# Application problem. Slope is positive. +# +# Last updated: Jordan 8/31/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m=random(10,30,1)/100; +$b=random(110,190,1)/10; + +$x1=random(10,15,1); +$y1=$m*$x1+$b; +$x2=random(16,20,1); +$y2=$m*$x2+$b; +$x3=random(25,30,1); +$y3=$m*$x3+$b; +$x4=random(50,60,1); +$y4=$m*$x4+$b; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +Context("Numeric"); +parser::Assignment->Allow; +Context()->variables->add(y=>'Real'); +Context()->flags->set(tolType=>'absolute'); +Context()->variables->set(x=>{limits=>[$x1,$x2]}); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$ansPS = Formula("y=$m*(x-$x1)+$y1"); +$ansPS_evaluator = $ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +}); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A biologist has been observing a tree's height. This type of tree typically grows by [`[$m]`] feet each month. [@ucfirst(numberWord($x1))@] months into the observation, the tree was [`[$y1]`] feet tall. + +Let [`x`] be the number of months passed since the observations started, and let [`y`] be the tree's height at that time, in feet. Use a linear equation to model the tree's height as the number of months pass. +a) A point-slope equation to model this is [______________]{$ansPS_evaluator}. + +b) [`[$x3]`] months after the observations started, the tree would be [___________]{$y3} feet in height. + +c) [___________]{$x4} months after the observation started, the tree would be [`[$y4]`] feet tall. + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +a) A line's equation in point-slope form looks like [` y=m(x-x_0)+y_0 `], where [`m`] is the slope, and [`(x_0,y_0)`] is some point we know to be on the line. We first need to find the line's slope. Since the tree grows at a rate of [`[$m]`] feet per month, [`[$m]`] is the slope of the linear model. + + So now we have that [` y=[$m](x-x_0)+y_0 `]. We can use [`(x_0,y_0)=([$x1],[$y1])`] to get [`[$ansPS]`]. + +b) After [`[$x3]`] months, we can find the height of the tree if we substitute [`[$x3]`] in for [`x`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m]([$x3]-[$x1]) +[$y1] \\ + y &= [$y3] +\end{aligned} +``] + + So after [`[$x3]`] months, the tree is [`[$cy3]`] feet tall. + +c) To find when the tree was [`[$cy4]`] feet tall, we substitute [`[$y4]`] in for [`y`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m](x-[$x1]) +[$y1] \\ + [$y4] &= [$m](x-[$x1]) +[$y1] \\ + [@$y4-$y1@] &= [$m](x-[$x1])\\ + \frac{[@$y4-$y1@]}{[$m]} &= x - [$x1]\\ + [@($y4-$y1)/$m@] &= x - [$x1]\\ + [@($y4-$y1)/$m+$x1@] &= x\\ + [$x4] &= x +\end{aligned} +``] + + So the tree was [`[$y4]`] feet tall after [`[$x4]`] months. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication80.pg new file mode 100644 index 0000000000..8158d4ff8f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FindPSEquationApplication80.pg @@ -0,0 +1,157 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given the slope and a point, find a line's equation in slope-intercept form. +# Application problem. Slope is negative. +# +# Last updated: Jordan 8/31/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$x4=random(40,50,1); +$y4=0; + +$m= -random(11,99,1)/10; +$absM = abs($m); +$b= -$m*$x4; + +$x1=random(5,10,1); +$y1=$m*$x1+$b; +$x2=random(11,19,1); +$y2=$m*$x2+$b; +$x3=random(30,40,1); +$y3=$m*$x3+$b; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +Context("Numeric"); +parser::Assignment->Allow; +Context()->variables->add(y=>'Real'); +Context()->flags->set(tolType=>'absolute'); +Context()->variables->set(x=>{limits=>[$x1,$x2]}); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$ansPS = Formula("y=$m*(x-$x1)+$y1"); +$ansPS_evaluator = $ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +}); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Scientists are conducting an experiment with a gas in a sealed container. The mass of the gas is measured, and the scientists realize that the gas is leaking over time in a linear way. Each minute, they lose [`[$absM]`] grams. [@numberWord($x1,capital=>1)@] minutes since the experiment started, the remaining gas had a mass of [`[$y1]`] grams. + +Let [`x`] be the number of minutes that have passed since the experiment started, and let [`y`] be the mass of the gas in grams at that moment. Use a linear equation to model the weight of the gas over time. +a) A point-slope equation to model this is [______________]{$ansPS_evaluator}. + +b) [`[$x3]`] minutes after the experiment started, there would be [___________]{$y3} grams of gas left. + +c) If a linear model continues to be accurate, [___________]{$x4} minutes since the experiment started, all gas in the container will be gone. + +END_PGML + + + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +a) A line's equation in point-slope form looks like [` y=m(x-x_0)+y_0 `], where [`m`] is the slope, and [`(x_0,y_0)`] is some point we know to be on the line. We first need to find the line's slope. Since the gas is leaking at a rate of [`[$absM]`] grams per minute, we know that the slope of the linear model is [`[$m]`]. + + So now we have that [` y=[$m](x-x_0)+y_0 `]. We can use [`(x_0,y_0)=([$x1],[$y1])`] to get [`[$ansPS]`]. + +b) After [`[$x3]`] minutes, we can find the mass of the remaining gas if we substitute [`[$x3]`] in for [`x`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m]([$x3]-[$x1]) +[$y1] \\ + y &= [$y3] +\end{aligned} +``] + + So after [`[$x3]`] minutes, there are [`[$y3]`] grams of gas remaining. + +c) To find when the gas will be all gone, we need to find when there are [`[$y4]`] grams of gas left. We can substitute [`[$y4]`] in for [`y`] in the equation [` y=[$m](x-[$x1])+[$y1] `], and we have: + + [`` +\begin{aligned} + y &= [$m](x-[$x1]) +[$y1] \\ + [$y4] &= [$m](x-[$x1]) +[$y1] \\ + [@$y4-$y1@] &= [$m](x-[$x1])\\ + \frac{[@$y4-$y1@]}{[$m]} &= x - [$x1]\\ + [@($y4-$y1)/$m@] &= x - [$x1]\\ + [@($y4-$y1)/$m+$x1@] &= x\\ + [$x4] &= x +\end{aligned} +``] + + So after [`[$x4]`] minutes, the gas will be all gone. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication10.pg new file mode 100644 index 0000000000..cbb9dbbc03 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication10.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Application problems with equations like 2/3 x + 2 = 12. +# +# Last updated: Yao 10/27/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("LimitedNumeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $num = random(2,5,1); + $den = random($num+1,10,1); +} until (gcd($num,$den)==1); + +$b = random(2,10,1); +$x1 = random(2,5,1)*$den; +$y1 = $x1/$den*$num+$b; + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] is jogging in a straight line. [@ucfirst($pronoun)@] got a head start of [`[$b]`] meters from the starting line, and [$pronoun] ran [`[$num]`] meters every [`[$den]`] seconds. After how many seconds will [$name] be [`[$y1]`] meters away from the starting line? + +[$name] will be [`[$y1]`] meters away from the starting line [______]{$x1} seconds since [$pronoun] started running. + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +[$name] runs [`[$num]`] meters every [`[$den]`] seconds, implying [$possessive] speed is [`\frac{[$num]}{[$den]}`] meters per second. + +In [`x`] seconds, [$pronoun] can run [`\frac{[$num]}{[$den]}x`] meters. + +Since [$pronoun] got a [`[$b]`] meters head start, [$possessive] distance from the starting line can be modeled by + + [`` \frac{[$num]}{[$den]}x+[$b] ``] + +To find when [$pronoun] will be [`[$y1]`] meters away from the starting line, we can write and solve this equation: + + [`` +\begin{aligned} + \frac{[$num]}{[$den]}x+[$b] &= [$y1] \\ + [$den]\cdot \frac{[$num]}{[$den]}x+[$den]\cdot[$b] &= [$den]\cdot[$y1] \\ + [$num]x+[$den*$b] &= [$den*$y1] \\ + [$num]x+[$den*$b] \mathbf{{}-[$den*$b]} &= [$den*$y1] \mathbf{{}-[$den*$b]} \\ + [$num]x &= [$den*$y1-$den*$b] \\ + \frac{[$num]x}{[$num]} &= \frac{[$den*$y1-$den*$b]}{[$num]} \\ + x &= [$x1] +\end{aligned} + ``] + +[$name] will be [`[$y1]`] meters away from the starting line [`[$x1]`] seconds since [$pronoun] started running. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication20.pg new file mode 100644 index 0000000000..5b9b68bed5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication20.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Application problems with equations like 100 - 2/3 x = 12. +# +# Last updated: Yao 10/27/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("LimitedNumeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $num = random(2,5,1); + $den = random($num+1,10,1); +} until (gcd($num,$den)==1); + +$b = random(30,50,1); +$x1 = random(2,5,1)*$den; +$y1 = -$x1/$den*$num+$b; + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] is jogging in a straight line. [@ucfirst($pronoun)@] started at a place [`[$b]`] meters from the starting line, and ran toward the starting line at the speed of [`[$num]`] meters every [`[$den]`] seconds. After how many seconds will [$name] be [`[$y1]`] meters away from the starting line? + +[$name] will be [`[$y1]`] meters away from the starting line [______]{$x1} seconds since [$pronoun] started running. + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +[$name] runs [`[$num]`] meters every [`[$den]`] seconds, implying [$possessive] speed is [`\frac{[$num]}{[$den]}`] meters per second. + +In [`x`] seconds, [$pronoun] can run [`\frac{[$num]}{[$den]}x`] meters. + +Since [$pronoun] was [`[$b]`] meters away from the starting line, and ran toward it, [$possessive] distance from the starting line was decreasing, and can be modeled by: + + [`` [$b]-\frac{[$num]}{[$den]}x ``] + +To find when [$pronoun] will be [`[$y1]`] meters away from the starting line, we can write and solve this equation: + + [`` +\begin{aligned} + [$b] - \frac{[$num]}{[$den]}x &= [$y1] \\ + [$den]\cdot[$b] - [$den]\cdot \frac{[$num]}{[$den]}x &= [$den]\cdot[$y1] \\ + [$den*$b] - [$num]x &= [$den*$y1] \\ + [$den*$b] - [$num]x \mathbf{{}-[$den*$b]} &= [$den*$y1] \mathbf{{}-[$den*$b]} \\ + -[$num]x &= [$den*$y1-$den*$b] \\ + \frac{-[$num]x}{-[$num]} &= \frac{[$den*$y1-$den*$b]}{-[$num]} \\ + x &= [$x1] +\end{aligned} + ``] + +[$name] will be [`[$y1]`] meters away from the starting line [`[$x1]`] seconds since [$pronoun] started running. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication30.pg new file mode 100644 index 0000000000..ee23b21d1b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication30.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Application problems with equations like 2/3 x + 4 = 12. +# +# Last updated: Yao 10/27/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("LimitedNumeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $num = random(2,5,1); + $den = random($num+1,10,1); +} until (gcd($num,$den)==1); + +$b = random(5,10,1); +$x1 = random(2,5,1)*$den; +$y1 = $x1/$den*$num+$b; + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + +Context("Currency"); +$bC = Currency("$b"); +$numC = Currency("$num"); +$y1C = Currency("$y1"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] had only [`[$bC]`] in [$possessive] piggy bank, and [$pronoun] decided to start saving more. [@ucfirst($pronoun)@] saves [`[$numC]`] every [`[$den]`] days. After how many days will [$pronoun] have [`[$y1C]`] in the piggy bank? + +[$name] will save [`[$y1C]`] in [$possessive] piggy bank after [__________]{$x1} days. + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +[$name] saves [`[$numC]`] every [`[$den]`] days, implying the rate of her saving is [`\frac{[$num]}{[$den]}`] dollar per day. + +In [`x`] day, [$pronoun] can save [`\frac{[$num]}{[$den]}x`] dollars. + +Since [$pronoun] had [`[$bC]`] in her piggy bank at the beginning, the amount of money she has can be modeled by: + + [`` \frac{[$num]}{[$den]}x+[$b] ``] + +To find when she will have [`[$y1C]`] saved, we can write and solve this equation: + + [`` +\begin{aligned} + \frac{[$num]}{[$den]}x+[$b] &= [$y1] \\ + [$den]\cdot \frac{[$num]}{[$den]}x+[$den]\cdot[$b] &= [$den]\cdot[$y1] \\ + [$num]x+[$den*$b] &= [$den*$y1] \\ + [$num]x+[$den*$b] \mathbf{{}-[$den*$b]} &= [$den*$y1] \mathbf{{}-[$den*$b]} \\ + [$num]x &= [$den*$y1-$den*$b] \\ + \frac{[$num]x}{[$num]} &= \frac{[$den*$y1-$den*$b]}{[$num]} \\ + x &= [$x1] +\end{aligned} + ``] + +[$name] will save [`[$y1C]`] in [$possessive] piggy bank after [`[$x1]`] days. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication40.pg new file mode 100644 index 0000000000..d7e43d1e85 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/FractionLinearApplication40.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Application problems with equations like 20-2/3 x = 12. +# +# Last updated: Yao 10/27/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("LimitedNumeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $num = random(2,5,1); + $den = random($num+1,10,1); +} until (gcd($num,$den)==1); + +$b = random(40,50,1); +$x1 = random(2,5,1)*$den; +$y1 = -$x1/$den*$num+$b; + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + +Context("Currency"); +$bC = Currency("$b"); +$numC = Currency("$num"); +$y1C = Currency("$y1"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] has saved [`[$bC]`] in [$possessive] piggy bank, and [$pronoun] decided to start spending them. [@ucfirst($pronoun)@] spends [`[$numC]`] every [`[$den]`] days. After how many days will [$pronoun] have [`[$y1C]`] left in the piggy bank? + +[$name] will have [`[$y1C]`] left in [$possessive] piggy bank after [__________]{$x1} days. + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +[$name] spends [`[$numC]`] every [`[$den]`] days, implying the rate of her spending is [`\frac{[$num]}{[$den]}`] dollar per day. + +In [`x`] day, [$pronoun] will spend [`\frac{[$num]}{[$den]}x`] dollars. + +Since [$pronoun] had [`[$bC]`] in her piggy bank at the beginning, the amount of money has been decreasing, and can be modeled by: + + [`` [$b]-\frac{[$num]}{[$den]}x ``] + +To find when she will have [`[$y1C]`] left, we can write and solve this equation: + + [`` +\begin{aligned} + [$b] - \frac{[$num]}{[$den]}x &= [$y1] \\ + [$den]\cdot[$b] - [$den]\cdot \frac{[$num]}{[$den]}x &= [$den]\cdot[$y1] \\ + [$den*$b] - [$num]x &= [$den*$y1] \\ + [$den*$b] - [$num]x \mathbf{{}-[$den*$b]} &= [$den*$y1] \mathbf{{}-[$den*$b]} \\ + -[$num]x &= [$den*$y1-$den*$b] \\ + \frac{-[$num]x}{-[$num]} &= \frac{[$den*$y1-$den*$b]}{-[$num]} \\ + x &= [$x1] +\end{aligned} + ``] + +[$name] will have [`[$y1C]`] left in [$possessive] piggy bank after [`[$x1]`] days. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication10.pg new file mode 100644 index 0000000000..470b411be4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication10.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Interpret the meaning of a line's x-intercept and y-intercept in context. +# +# Last update: Carl Yao 10/17/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", + "contextCurrency.pl", + "parserRadioButtons.pl", + "PGchoicemacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $a = random(2,10,1); + do {$b = random(2,10,1);} until ($a!=$b); + $xIntercept = random(20,60,5); + $c = $a*$xIntercept; + $yIntercept = $c/$b; +} until ($yIntercept == int($yIntercept)); + +Context("Currency"); +$cC = Currency("$c/100"); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + +@answers = ( + "The x-intercept is ($xIntercept,0). It implies $name can purchase $xIntercept tea bags with no sugar bags.", + "The x-intercept is (0,$xIntercept). It implies $name can purchase $xIntercept sugar bags with no tea bags.", + "The x-intercept is ($yIntercept,0). It implies $name can purchase $yIntercept tea bags with no sugar bags.", + "The x-intercept is (0, $yIntercept). It implies $name can purchase $yIntercept sugar bags with no tea bags.", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +@scramble = NchooseK(4,4); +@inverse = (); +@answersShuffled = (); +for my $i (0..3) { + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} + +$correctAns = $answersShuffled[$inverse[0]]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, + labels => "ABC", +); + +############################################## + +BEGIN_PGML + +[$name] is buying some tea bags and some sugar bags. Each tea bag costs [`[$a]`] cents, and each sugar bag costs [`[$b]`] cents. [@ucfirst($pronoun)@]* can spend a total of [`[$cC]`]. + +Assume [$name] will purchase [`x`] tea bags and [`y`] sugar bags. Use a linear equation to model the number of tea bags and sugar bags [$pronoun] can purchase. + +Find this line's [`x`]-intercept, and interpret its meaning in this context. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [$name] will purchase [`x`] tea bags and [`y`] sugar bags. + +Since each tea bag costs [`[$a]`] cents, [`x`] tea bags would cost [`[$a] x`] cents. + +Similarly, [`y`] sugar bags would cost [`[$b] y`] cents. + +Since [$name] can spend a total of [`[$cC]`], or [`[$c]`] cents, we can write the equation: + + [`` [$a]x+[$b]y=[$c] ``] + +A line's [`x`]-intercept looks like [`(x,0)`]. To find its [`x`] intercept, we substitute [`y`] in the equation with [`0`], and we have: + + [`` +\begin{aligned} + [$a]x+[$b]y &= [$c] \\ + [$a]x+[$b](0) &= [$c] \\ + [$a]x &= [$c] \\ + \frac{[$a]x}{[$a]} &= \frac{[$c]}{[$a]} \\ + x &= [$xIntercept] +\end{aligned} + ``] + +The line's [`x`]-intercept is [`([$xIntercept],0)`]. + +The correct solution is [$radio->correct_ans]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication20.pg new file mode 100644 index 0000000000..6b2eee8682 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication20.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Interpret the meaning of a line's x-intercept and y-intercept in context. +# +# Last update: Carl Yao 10/17/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", + "contextCurrency.pl", + "parserRadioButtons.pl", + "PGchoicemacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $a = random(2,10,1); + do {$b = random(2,10,1);} until ($a!=$b); + $xIntercept = random(20,60,5); + $c = $a*$xIntercept; + $yIntercept = $c/$b; +} until ($yIntercept == int($yIntercept)); + +Context("Currency"); +$cC = Currency("$c/100"); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + +@answers = ( + "The y-intercept is (0, $yIntercept). It implies $name can purchase $yIntercept sugar bags with no tea bags.", + "The y-intercept is ($xIntercept,0). It implies $name can purchase $xIntercept tea bags with no sugar bags.", + "The y-intercept is (0,$xIntercept). It implies $name can purchase $xIntercept sugar bags with no tea bags.", + "The y-intercept is ($yIntercept,0). It implies $name can purchase $yIntercept tea bags with no sugar bags.", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +@scramble = NchooseK(4,4); +@inverse = (); +@answersShuffled = (); +for my $i (0..3) { + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} + +$correctAns = $answersShuffled[$inverse[0]]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, + labels => "ABC", +); + +############################################## + +BEGIN_PGML + +[$name] is buying some tea bags and some sugar bags. Each tea bag costs [`[$a]`] cents, and each sugar bag costs [`[$b]`] cents. [@ucfirst($pronoun)@]* can spend a total of [`[$cC]`]. + +Assume [$name] will purchase [`x`] tea bags and [`y`] sugar bags. Use a linear equation to model the number of tea bags and sugar bags [$pronoun] can purchase. + +Find this line's [`y`]-intercept, and interpret its meaning in this context. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [$name] will purchase [`x`] tea bags and [`y`] sugar bags. + +Since each tea bag costs [`[$a]`] cents, [`x`] tea bags would cost [`[$a] x`] cents. + +Similarly, [`y`] sugar bags would cost [`[$b] y`] cents. + +Since [$name] can spend a total of [`[$cC]`], or [`[$c]`] cents, we can write the equation: + + [`` [$a]x+[$b]y=[$c] ``] + +A line's [`y`]-intercept looks like [`(0,y)`]. To find its [`y`] intercept, we substitute [`x`] in the equation with [`0`], and we have: + + [`` +\begin{aligned} + [$a]x+[$b]y &= [$c] \\ + [$a](0)+[$b]y &= [$c] \\ + [$b]y &= [$c] \\ + \frac{[$b]x}{[$b]} &= \frac{[$c]}{[$b]} \\ + x &= [$yIntercept] +\end{aligned} + ``] + +The line's [`y`]-intercept is [`(0,[$yIntercept])`]. + +The correct solution is: [$correctAns] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication30.pg new file mode 100644 index 0000000000..34ead1f09c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication30.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Interpret the meaning of a line's x-intercept and y-intercept in context. +# +# Last update: Carl Yao 10/17/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", +# "contextCurrency.pl", + "parserRadioButtons.pl", + "PGchoicemacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $slope = random(-5,-1.5,0.5); + $xIntercept = random(20,50,5); + $yIntercept = -$slope*$xIntercept; +} until ($yIntercept==int($yIntercept)); +$slopeAbs = abs($slope); + +@answers = ( + "The x-intercept is ($xIntercept,0). It implies the engine will run out of gas $xIntercept hours after its tank was refilled.", + "The x-intercept is (0,$xIntercept). It implies the engine started with $xIntercept gallons of gas in its tank.", + "The x-intercept is ($yIntercept,0). It implies the engine will run out of gas $yIntercept hours after its tank was refilled.", + "The x-intercept is (0,$yIntercept). It implies the engine started with $yIntercept gallons of gas in its tank.", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +@scramble = NchooseK(4,4); +@inverse = (); +@answersShuffled = (); +for my $i (0..3) { + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} + +$correctAns = $answersShuffled[$inverse[0]]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, + labels => "ABC", +); + +############################################## + +BEGIN_PGML + +An engine's tank can hold [`[$yIntercept]`] gallons of gasoline. It was refilled with a full tank, and has been running without breaks, consuming [`[$slopeAbs]`] gallons of gas per hour. + +Assume the engine has been running for [`x`] hours since its tank was refilled, and assume there are [`y`] gallons of gas left in the tank. Use a linear equation to model the amount of gas in the tank as time passes. + +Find this line's [`x`]-intercept, and interpret its meaning in this context. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the engine has been running for [`x`] hours since its tank was refilled, and assume there are [`y`] gallons of gas left in the tank. A linear equation to model the amount of gas in the tank is: + + [`` y = [$slope]x+[$yIntercept] ``] + +A line's [`x`]-intercept looks like [`(x,0)`]. To find its [`x`] intercept, we substitute [`y`] in the equation with [`0`], and we have: + + [`` +\begin{aligned} + y &= [$slope]x+[$yIntercept] \\ + 0 &= [$slope]x+[$yIntercept] \\ + -[$yIntercept] &= [$slope]x \\ + \frac{-[$yIntercept]}{[$slope]} &= \frac{[$slope]x}{[$slope]} \\ + [$xIntercept] &= x +\end{aligned} + ``] + +The line's [`x`]-intercept is [`([$xIntercept],0)`]. + +The correct solution is: [$correctAns] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication40.pg new file mode 100644 index 0000000000..1db8ee7575 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication40.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Interpret the meaning of a line's x-intercept and y-intercept in context. +# +# Last update: Carl Yao 10/17/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", +# "contextCurrency.pl", + "parserRadioButtons.pl", + "PGchoicemacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $slope = random(-5,-1.5,0.5); + $xIntercept = random(20,50,5); + $yIntercept = -$slope*$xIntercept; +} until ($yIntercept==int($yIntercept)); +$slopeAbs = abs($slope); + +@answers = ( + "The y-intercept is (0,$yIntercept). It implies the engine started with $yIntercept gallons of gas in its tank.", + "The y-intercept is ($xIntercept,0). It implies the engine will run out of gas $xIntercept hours after its tank was refilled.", + "The y-intercept is (0,$xIntercept). It implies the engine started with $xIntercept gallons of gas in its tank.", + "The y-intercept is ($yIntercept,0). It implies the engine will run out of gas $yIntercept hours after its tank was refilled.", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +@scramble = NchooseK(4,4); +@inverse = (); +@answersShuffled = (); +for my $i (0..3) { + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} + +$correctAns = $answersShuffled[$inverse[0]]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, + labels => "ABC", +); + +############################################## + +BEGIN_PGML + +An engine's tank can hold [`[$yIntercept]`] gallons of gasoline. It was refilled with a full tank, and has been running without breaks, consuming [`[$slopeAbs]`] gallons of gas per hour. + +Assume the engine has been running for [`x`] hours since its tank was refilled, and assume there are [`y`] gallons of gas left in the tank. Use a linear equation to model the amount of gas in the tank as time passes. + +Find this line's [`y`]-intercept, and interpret its meaning in this context. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the engine has been running for [`x`] hours since its tank was refilled, and assume there are [`y`] gallons of gas left in the tank. A linear equation to model the amount of gas in the tank is: + + [`` y = [$slope]x+[$yIntercept] ``] + +Since the equation is in slope-intercept mode, we can see its [`y`]-intercept is [`(0,[$yIntercept])`]. + +The correct solution is: [$correctAns] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication50.pg new file mode 100644 index 0000000000..19375b587f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication50.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Interpret the meaning of a line's x-intercept and y-intercept in context. +# +# Last update: Carl Yao 10/17/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", + "contextCurrency.pl", + "parserRadioButtons.pl", + "PGchoicemacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $slope = random(-2000,-3000,200); + $xIntercept = random(15,25,1); + $yIntercept = -$slope*$xIntercept; +} until ($yIntercept/100==int($yIntercept/100)); +$slopeAbs = abs($slope); + +Context("Currency"); +$slopeAbsC = Currency("$slopeAbs"); +$xInterceptC = Currency("$xIntercept"); +$yInterceptC = Currency("$yIntercept"); + +@answers = ( + "The x-intercept is ($xIntercept,0). It implies the car would have no more value $xIntercept years since its purchase.", + "The x-intercept is (0,$xIntercept). It implies the car would have no more value $xIntercept years since its purchase.", + "The x-intercept is ($yIntercept,0). It implies the car's initial value was $yIntercept.", + "The x-intercept is (0,$yIntercept). It implies the car's initial value was $yIntercept.", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +@scramble = NchooseK(4,4); +@inverse = (); +@answersShuffled = (); +for my $i (0..3) { + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} + +$correctAns = $answersShuffled[$inverse[0]]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, + labels => "ABC", +); + +############################################## + +BEGIN_PGML + +A new car of a certain model costs [`[$yInterceptC]`]. According to Blue Book, its value decreases by [`[$slopeAbsC]`] every year. + +Assume [`x`] years since its purchase, the car's value is [`y`] dollars. Use a linear equation to model the car's value. + +Find this line's [`x`]-intercept, and interpret its meaning in this context. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [`x`] years since its purchase, the car's value is [`y`] dollars. A linear equation to model the car's value is: + + [`` y = [$slope]x+[$yIntercept] ``] + +A line's [`x`]-intercept looks like [`(x,0)`]. To find its [`x`] intercept, we substitute [`y`] in the equation with [`0`], and we have: + + [`` +\begin{aligned} + y &= [$slope]x+[$yIntercept] \\ + 0 &= [$slope]x+[$yIntercept] \\ + -[$yIntercept] &= [$slope]x \\ + \frac{-[$yIntercept]}{[$slope]} &= \frac{[$slope]x}{[$slope]} \\ + [$xIntercept] &= x +\end{aligned} + ``] + +The line's [`x`]-intercept is [`([$xIntercept],0)`]. + +The correct solution is: [$correctAns] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication60.pg new file mode 100644 index 0000000000..c52d66d4d6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication60.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Interpret the meaning of a line's x-intercept and y-intercept in context. +# +# Last update: Carl Yao 10/17/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", + "contextCurrency.pl", + "parserRadioButtons.pl", + "PGchoicemacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $slope = random(-2000,-3000,200); + $xIntercept = random(15,25,1); + $yIntercept = -$slope*$xIntercept; +} until ($yIntercept/100==int($yIntercept/100)); +$slopeAbs = abs($slope); + +Context("Currency"); +$slopeAbsC = Currency("$slopeAbs"); +$xInterceptC = Currency("$xIntercept"); +$yInterceptC = Currency("$yIntercept"); + +@answers = ( + "The y-intercept is (0,$yIntercept). It implies the car's initial value was $yIntercept.", + "The y-intercept is ($xIntercept,0). It implies the car would have no more value $xIntercept years since its purchase.", + "The y-intercept is (0,$xIntercept). It implies the car would have no more value $xIntercept years since its purchase.", + "The y-intercept is ($yIntercept,0). It implies the car's initial value was $yIntercept.", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +@scramble = NchooseK(4,4); +@inverse = (); +@answersShuffled = (); +for my $i (0..3) { + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} + +$correctAns = $answersShuffled[$inverse[0]]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, + labels => "ABC", +); + +############################################## + +BEGIN_PGML + +A new car of a certain model costs [`[$yInterceptC]`]. According to Blue Book, its value decreases by [`[$slopeAbsC]`] every year. + +Assume [`x`] years since its purchase, the car's value is [`y`] dollars. Use a linear equation to model the car's value. + +Find this line's [`y`]-intercept, and interpret its meaning in this context. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [`x`] years since its purchase, the car's value is [`y`] dollars. A linear equation to model the car's value is: + + [`` y = [$slope]x+[$yIntercept] ``] + +Since this line is in its slope-intercept mode, we can see its [`y`]-intercept is [`(0,[$yIntercept])`]. + +The correct solution is: [$correctAns] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication70.pg new file mode 100644 index 0000000000..d362e5fe8d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication70.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Interpret the meaning of a line's x-intercept and y-intercept in context. +# +# Last update: Carl Yao 10/17/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", + "contextCurrency.pl", + "parserRadioButtons.pl", + "PGchoicemacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$slope = random(1.5,5,0.5); +$xIntercept = random(-10,-3,1); +$yIntercept = -$slope*$xIntercept; +$xInterceptAbs = abs($xIntercept); + +Context("Currency"); +$slopeC = Currency("$slope"); +$yInterceptC = Currency("$yIntercept"); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + +@answers = ( + "The x-intercept is ($xIntercept,0). It implies: $xInterceptAbs days before Oct. 1, $name had no money in his piggy bank (that was when he started saving).", + "The x-intercept is (0,$xIntercept). It implies $xInterceptAbs days before Oct. 1, $name had no money in his piggy bank (that was when he started saving).", + "The x-intercept is ($yIntercept,0). It implies $name has saved $yInterceptC on Oct. 1.", + "The x-intercept is (0, $yIntercept). It implies $name has saved $yInterceptC on Oct. 1.", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +@scramble = NchooseK(4,4); +@inverse = (); +@answersShuffled = (); +for my $i (0..3) { + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} + +$correctAns = $answersShuffled[$inverse[0]]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, + labels => "ABC", +); + +############################################## + +BEGIN_PGML + +Starting a few days ago. [$name] has been adding [`[$slopeC]`] to [$possessive] piggy bank every day. On Oct. 1, [$pronoun] had [`[$yInterceptC]`] in his piggy bank. + +Assume [`x`] days after Oct. 1, [$name] has [`y`] dollars in his piggy bank. Use a linear equation to model the amount of money in the piggy bank. + +Find this line's [`x`]-intercept, and interpret its meaning in this context. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [`x`] days after Oct. 1, [$name] has [`y`] dollars in his piggy bank. We can use this linear equation to model the amount of money in the piggy bank: + + [`` y = [$slope]x+[$yIntercept] ``] + +A line's [`x`]-intercept looks like [`(x,0)`]. To find its [`x`] intercept, we substitute [`y`] in the equation with [`0`], and we have: + + [`` +\begin{aligned} + y &= [$slope]x+[$yIntercept] \\ + 0 &= [$slope]x+[$yIntercept] \\ + -[$yIntercept] &= [$slope]x \\ + \frac{-[$yIntercept]}{[$slope]} &= \frac{[$slope]x}{[$slope]} \\ + [$xIntercept] &= x +\end{aligned} + ``] + +The line's [`x`]-intercept is [`([$xIntercept],0)`]. + +The correct solution is: [$correctAns] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication80.pg new file mode 100644 index 0000000000..dcb6dd765e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication80.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Interpret the meaning of a line's x-intercept and y-intercept in context. +# +# Last update: Carl Yao 10/17/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", + "contextCurrency.pl", + "parserRadioButtons.pl", + "PGchoicemacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$slope = random(1.5,5,0.5); +$xIntercept = random(-10,-3,1); +$yIntercept = -$slope*$xIntercept; +$xInterceptAbs = abs($xIntercept); + +Context("Currency"); +$slopeC = Currency("$slope"); +$yInterceptC = Currency("$yIntercept"); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + +@answers = ( + "The y-intercept is (0, $yIntercept). It implies $name has saved $yInterceptC on Oct. 1.", + "The y-intercept is ($xIntercept,0). It implies: $xInterceptAbs days before Oct. 1, $name had no money in his piggy bank (that was when he started saving).", + "The y-intercept is (0,$xIntercept). It implies $xInterceptAbs days before Oct. 1, $name had no money in his piggy bank (that was when he started saving).", + "The y-intercept is ($yIntercept,0). It implies $name has saved $yInterceptC on Oct. 1.", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +@scramble = NchooseK(4,4); +@inverse = (); +@answersShuffled = (); +for my $i (0..3) { + $inverse[$scramble[$i]] = $i; + $answersShuffled[$i] = $answers[$scramble[$i]]; +} + +$correctAns = $answersShuffled[$inverse[0]]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, + labels => "ABC", +); + +############################################## + +BEGIN_PGML + +Starting a few days ago. [$name] has been adding [`[$slopeC]`] to [$possessive] piggy bank every day. On Oct. 1, [$pronoun] had [`[$yInterceptC]`] in his piggy bank. + +Assume [`x`] days after Oct. 1, [$name] has [`y`] dollars in his piggy bank. Use a linear equation to model the amount of money in the piggy bank. + +Find this line's [`y`]-intercept, and interpret its meaning in this context. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [`x`] days after Oct. 1, [$name] has [`y`] dollars in his piggy bank. We can use this linear equation to model the amount of money in the piggy bank: + + [`` y = [$slope]x+[$yIntercept] ``] + +Since the line is in slope-intercept mode, we can see its [`y`]-intercept is [`(0,[$yIntercept])`]. + +The correct solution is: [$correctAns] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem10.pg index 722e40a2a2..9b2502b135 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem10.pg @@ -6,17 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(simpleinterest2eqs) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','interest') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "contextCurrency.pl", "PCCmacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,9 +70,7 @@ BEGIN_PGML [$name] invested a total of [`[$cInit]`] in two accounts. One account pays [`[$p1]%`] interest annually; the other pays [`[$p2]%`] interest annually. At the end of the year, [$name] earned a total of [`[$cTotalInt]`] in interest. How much money did [$name] invest in each account? - [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account. - - [$name] invested [__________]{$cFund2} in the [`[$p2]%`] account. + [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account and [__________]{$cFund2} in the [`[$p2]%`] account. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem20.pg index 154e39679b..616adc386c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem20.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(simpleinterest2eqs) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','interest') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "contextCurrency.pl", "PCCmacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,9 +68,7 @@ BEGIN_PGML [$name] invested a total of [`[$cInit]`] in two accounts. One account pays [`[$p1]%`] interest annually; the other pays [`[$p2]%`] interest annually. At the end of the year, [$name] earned a total interest of [`[$cTotalInt]`]. How much money did [$name] invest in each account? - [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account. - - [$name] invested [__________]{$cFund2} in the [`[$p2]%`] account. + [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account and [__________]{$cFund2} in the [`[$p2]%`] account. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem30.pg index b4c2cd850f..693e8e60cf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem30.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(simpleinterest2eqs) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','interest') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "contextCurrency.pl", "PCCmacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,9 +71,7 @@ TEXT(beginproblem()); BEGIN_PGML [$name] invested a total of [`[$cInit]`] in two accounts. One account pays [`[$p1]%`] interest annually; the other pays [`[$p2]%`] interest annually. At the end of the year, [$name] earned the same amount of interest from both accounts. How much money did [$name] invest in each account? - [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account. - - [$name] invested [__________]{$cFund2} in the [`[$p2]%`] account. + [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account and [__________]{$cFund2} in the [`[$p2]%`] account. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem40.pg index ecc572a848..1638f57532 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem40.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(simpleinterest2eqs) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','interest') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "contextCurrency.pl", "PCCmacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -68,9 +70,7 @@ BEGIN_PGML [$name] invested a total of [`[$cInit]`] in two accounts. One account pays [`[$p1]%`] interest annually; the other pays [`[$p2]%`] interest annually. At the end of the year, [$name] earned the same amount of interest from both accounts. How much money did [$name] invest in each account? - [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account. - - [$name] invested [__________]{$cFund2} in the [`[$p2]%`] account. + [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account [__________]{$cFund2} in the [`[$p2]%`] account. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem50.pg index 7ad2c32c18..55dee1eb6e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem50.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(simpleinterest2eqs) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','interest') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "contextCurrency.pl", "PCCmacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -70,9 +72,7 @@ BEGIN_PGML [$name] invested a total of [`[$cInit]`] in two accounts. After a year, one account had _earned_ [`[$p1]%`], while the other account had _lost_ [`[$p2]%`]. In total, [$name] had a net gain of [`[$cTotalInt]`]. How much money did [$name] invest in each account? - [$name] invested [__________]{$cFund1} in the account that grew by [`[$p1]%`]. - - [$name] invested [__________]{$cFund2} in the account that fell by [`[$p2]%`]. + [$name] invested [__________]{$cFund1} in the account that grew by [`[$p1]%`] and [__________]{$cFund2} in the account that fell by [`[$p2]%`]. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem60.pg index 45735bbc8a..e811497eb5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem60.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(simpleinterest2eqs) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','interest') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "contextCurrency.pl", "PCCmacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable10.pg index c94da5a811..b80810b03c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable10.pg @@ -7,15 +7,18 @@ # Last updated: Jordan 8/29/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','interest') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +30,7 @@ loadMacros( "contextCurrency.pl", "pccTables.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable20.pg index 84be6db59c..19dbe7b1db 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable20.pg @@ -7,15 +7,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','interest') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +30,7 @@ loadMacros( "contextCurrency.pl", "pccTables.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable30.pg index 77ece39a6a..b46c445f4f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable30.pg @@ -7,15 +7,18 @@ # Last updated: Jordan 8/28/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','interest') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable40.pg index 937d700b18..fd87745888 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable40.pg @@ -7,15 +7,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','interest') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable50.pg index 31bb9db2a2..70baef8bf0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable50.pg @@ -7,15 +7,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','interest') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem10.pg index 5f2c8bda21..12fed6308f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem10.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 7/26/13; Kling, 7/24/13; Hughes, 7/15/2013 Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(UseMandB_solveforvalue) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem20.pg new file mode 100644 index 0000000000..713a70760b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem20.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Read a word problem. Write an equation and solve for unknown. +# Given y, M and B, write y=Mx+B and solve for x. +# +# Last updated: Jordan 7/26/13; Kling, 7/24/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','application','subtract','divide') +## DBCCSS('7.EE'); +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); + +$a = random(10,30,1); +$b = 0.1+random(1,9,1)/100; +$ans = random(300,500,10); +$t = $a+$b*$ans; + +$ca = Currency($a); +$cb = Currency($b); +$ct = Currency($t); + +Context("LimitedNumeric"); +$ans = NumberWithUnits($ans, 'min'); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Your cell phone company charges a [`[$ca]`] monthly fee, plus [`[$cb]`] per minute of talk time. One month your cell phone bill +was [`[$ct]`]. How many minutes did you spend talking on the phone that month? + + You spent [__________]{$ans} talking on the phone that month. + +END_PGML + +############################################## + +$s1=$t-$a; +$s2=$t-$a; + +BEGIN_PGML_SOLUTION + +Let [`x`] be the number of minutes you talked on the phone that month. + +You must pay [`[$cb]`] per minute of talk time. If you talked [`x`] minutes, you would pay [`[$b]x`] dollars. + +Now we can write an equation: + + [`` [$a]+[$b]x = [$t] ``] + +Next, we solve for [`x`]: + + [` +\begin{aligned} + [$a] +[$b]x &= [$t] \\ + [$a] +[$b]x\mathbf{{}-[$a]} &= [$t]\mathbf{{}-[$a]} \\ + [$b]x &= [$s1] \\ + \frac{[$b]x}{[$b]} &= \frac{[$s1]}{[$b]} \\ + x &= [$s1/$b] +\end{aligned} +`] + +You spent [`[$ans]`] talking on the phone in that month. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem30.pg index 850cc2b9ed..13b4cc8098 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem30.pg @@ -7,17 +7,18 @@ # Last updated: Jordan 7/26/13; Kling, 7/24/13; Hughes, 7/15/2013 Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(UseMandB_solveforvalue) -## MLTleader(1) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','application','add','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem40.pg index 04ff3b4fa2..91606b4da1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem40.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 7/26/13; Kling, 7/24/13; Hughes, 7/15/2013 Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(UseMandB_solveforvalue) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem50.pg new file mode 100644 index 0000000000..75d62f4dd6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem50.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Word problems. Given M, B and y, students write an equation in the form +# of y=Mx+B and solve for x. +# +# Last updated: Yao 7/30/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$m = random(1,9,1)+random(1,9,1)/10+random(1,9,1)/100; +$b = $m*random(70,90,1); +$years = random(30,50,1); +$left = $b-$m*$years; + +Context("LimitedNumeric"); +$years = Compute($years); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A certain country has [`[$b]`] million acres of forest. Every year, the country loses [`[$m]`] million acres of forest mainly due to deforestation for farming purposes. If this situation continues at this pace, how many years later will the country have only [`[$left]`] million acres of forest left? (Use an equation to solve this problem.) + + After [__________]{$years} years, this country would have [`[$left]`] million acres of forest left. + +END_PGML + +############################################## + +$s1=$left-$b; +$s2=$t-$a; + +BEGIN_PGML_SOLUTION + +Assume after [`y`] years, this country will have [`[$left]`] million acres of forest left. + +The country loses [`[$m]`] million acres of forest every year. In [`y`] years, the country will lose a total of [`[$m]y`] million acres of forest. + +Currently, the country has [`[$b]`] million acres of forest. In [`y`] years, with a loss of [`[$m]y`] million acres, there would be [`[$b]-[$m]y`] million acres of forest left. + +The question asks when there would be [`[$left]`] million acres of forest left. Now we can write an equation: + + [`` [$b]-[$m]y = [$left] ``] + +Next, we solve for [`y`]: + + [` +\begin{aligned} + [$b]-[$m]y &= [$left] \\ + [$b]-[$m]y \mathbf{{}-[$b]} &= [$left] \mathbf{{}-[$b]} \\ + -[$m]y &= [$s1] \\ + \frac{-[$m]y}{-[$m]} &= \frac{[$s1]}{-[$m]} \\ + y &= [$years] +\end{aligned} +`] + +After [`[$years]`] years, this country would have [`[$left]`] million acres of forest left. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem60.pg index f0464860cc..7e447ee9b4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem60.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/28/13; Yao 7/30/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(UseMandB_solveforvalue) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,6 +62,7 @@ BEGIN_PGML [$name] has [`[$cb]`] in [$possessive] piggy bank. [@ ucfirst($pronoun) @]* plans to purchase some Pokemon cards, which costs [`[$cm]`] each. [@ ucfirst($pronoun) @]* plans to save [`[$cleft]`] to purchase another toy. At most how many Pokemon cards can he purchase? +Write an equation to solve this problem. [$name] can purchase at most [__________]{$cards} Pokemon cards. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedCoffeeProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedCoffeeProblem10.pg new file mode 100644 index 0000000000..787281a0a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedCoffeeProblem10.pg @@ -0,0 +1,146 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Write an one-variable linear equation to solve mixture word problems. +# +# Last updated: Yao 10/25/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + "pccTables.pl", + "PGML.pl", + "contextCurrency.pl", + "niceTables.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## + +Context("LimitedNumeric"); + +do { + $price1 = random(10,15,0.1); + do {$price2 = random(5,$price1-0.1,0.1);} until (abs($price1-$price2)>1); + $weight1 = random(20,100,5); + do {$weight2 = random(20,100,5);} until (abs($weight1-$weight2)>10); + $total1 = $price1*$weight1; + $total2 = $price2*$weight2; + + $weight3 = $weight1+$weight2; + $total3 = $total1+$total2; + $price3 = $total3/$weight3; +} until (int($price3*100)==$price3*100); + +Context("Currency"); +$price1C = Currency($price1); +$price2C = Currency($price2); +$price3C = Currency($price3); +$total1C = Currency($total1); +$total2C = Currency($total2); +$total3C = Currency($total3); + +############################################## +TEXT(beginproblem()); +BEGIN_PGML + +A coffee shop has [`[$weight1]`] pounds of dark coffee, which sells for [`[$price1C]`] per pound. It also has some light coffee, which sells for [`[$price2C]`] per pound. The coffee shop plans to mix some light coffee into the dark coffee, and sell the mixture for [`[$price3C]`] per pound. How many pounds of light coffee should be mixed in? + +To make coffee worth [`[$price3C]`], the coffee shop needs to mix [__________]{$weight2} pounds of light coffee with the dark coffee. + +END_PGML + + +############################################## +$showPartialCorrectAnswers=1; + +BEGIN_PGML_SOLUTION + +Assume the coffee shop will mix [`x`] pounds of light coffee into the dark coffee. We will use a table to organize data. + +[@DataTable( + [ + [[PF('[``]'), + rowcss => 'border-bottom: 3px solid; ',], + [PF('Price per Pound (in Dollars)'), + ], + [PF('Amount of Coffee (in Pounds)'), + ], + [PF('Worth of Coffee (in Dollars)'), + ], + ], + [[PF('Dark Coffee'), + ], + [PF('[`[$price1]`]'), + ], + [PF('[`[$weight1]`]'), + ], + [PF('[`[$total1]`]'), + ], + ], + [[PF('Light Coffee'), + ], + [PF('[`[$price2]`]'), + ], + [PF('[`x`]'), + ], + [PF('[`[$price2]x`]'), + ], + ], + [[PF('Mixture'), + ], + [PF('[`[$price3]`]'), + ], + [PF('[`x+[$weight1]`]'), + ], + [PF('[`[$price3](x+[$weight1])`]'), + ], + ], + ], + align => 'l c c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +According to the table, the dark coffee's total value is [`[$total1C]`], and the light coffee's total value is [`[$price2]x`] dollars. After they are mixed, the total value will be [`[$price3](x+[$weight1])`] dollars. Now we can write and solve this equation: + + [`` +\begin{aligned} + [$total1]+[$price2]x &= [$price3](x+[$weight1]) \\ + [$total1]+[$price2]x &= [$price3]x+[$price3*$weight1] \\ + [$total1]+[$price2]x \mathbf{{}-[$price2]x} &= [$price3]x+[$price3*$weight1] \mathbf{{}-[$price2]x} \\ + [$total1] &= [$price3-$price2]x+[$price3*$weight1] \\ + [$total1] \mathbf{{}-[$price3*$weight1]} &= [$price3-$price2]x+[$price3*$weight1] \mathbf{{}-[$price3*$weight1]} \\ + [$total1- $price3*$weight1] &= [$price3-$price2]x \\ + \frac{[$total1- $price3*$weight1]}{[$price3-$price2]} &= \frac{[$price3-$price2]x}{[$price3-$price2]} \\ + [$weight2] &= x +\end{aligned} + ``] + +To make coffee worth [`[$price3C]`], the coffee shop needs to mix [`[$weight2]`] pounds of light coffee with the dark coffee. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedCoffeeProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedCoffeeProblem20.pg new file mode 100644 index 0000000000..fb8ebca1b7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedCoffeeProblem20.pg @@ -0,0 +1,145 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Write an one-variable linear equation to solve mixture word problems. +# +# Last updated: Yao 10/25/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + "pccTables.pl", + "PGML.pl", + "contextCurrency.pl", + "niceTables.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## + +Context("LimitedNumeric"); + +do { + $price1 = random(1,3,0.1); + do {$price2 = random($price1+0.1,5,0.1);} until ($price2-$price1>0.5); + $weight1 = random(5,10,0.1); + do {$weight2 = random(5,10,0.1);} until (abs($weight1-$weight2)>0.5); + $total1 = $price1*$weight1; + $total2 = $price2*$weight2; + + $weight3 = $weight1+$weight2; + $total3 = $total1+$total2; + $price3 = $total3/$weight3; +} until ( (int($price3*100)==$price3*100) && ($weight3==int($weight3)) ); + +Context("Currency"); +$price1C = Currency($price1); +$price2C = Currency($price2); +$price3C = Currency($price3); +$total1C = Currency($total1); +$total2C = Currency($total2); +$total3C = Currency($total3); + +############################################## +TEXT(beginproblem()); +BEGIN_PGML + +A store has some beans selling for [`[$price1C]`] per pound, and some vegetables selling for [`[$price2C]`] per pound. The store plans to use them to produce [`[$weight3]`] pounds of mixture and sell for [`[$price3C]`] per pound. How many pounds of beans and how many pounds of vegetables should be used? + +To produce [`[$weight3]`] pounds of mixture, the store should use [______]{$weight1} pounds of beans and [______]{$weight2} pounds of vegetables. + +END_PGML + + +############################################## +$showPartialCorrectAnswers=1; + +BEGIN_PGML_SOLUTION + +Assume the store will mix [`x`] pounds of beans into the mixture, so it will mix in [`[$weight3]-x`] pounds of vegetables. We will use a table to organize data. + +[@DataTable( + [ + [[PF('[``]'), + rowcss => 'border-bottom: 3px solid; ',], + [PF('Price per Pound (in Dollars)'), + ], + [PF('Amount (in Pounds)'), + ], + [PF('Value (in Dollars)'), + ], + ], + [[PF('Beans'), + ], + [PF('[`[$price1]`]'), + ], + [PF('[`x`]'), + ], + [PF('[`[$price1]x`]'), + ], + ], + [[PF('Vegetables'), + ], + [PF('[`[$price2]`]'), + ], + [PF('[`[$weight3]-x`]'), + ], + [PF('[`[$price2]([$weight3]-x)`]'), + ], + ], + [[PF('Mixture'), + ], + [PF('[`[$price3]`]'), + ], + [PF('[`[$weight3]`]'), + ], + [PF('[`[$price3]\cdot[$weight1]=[$total3]`]'), + ], + ], + ], + align => 'l c c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +According to the table, the bean's total value is [`[$price1]x`] dollars, and the vegetable's total value is [`[$price2]([$weight3]-x)`] dollars. After they are mixed, the total value will be [`[$total3])`] dollars. Now we can write and solve this equation: + + [`` +\begin{aligned} + [$price1]x+[$price2]([$weight3]-x) &= [$total3] \\ + [$price1]x+[$price2*$weight3]-[$price2]x &= [$total3] \\ + [$price1-$price2]x + [$price2*$weight3] &= [$total3] \\ + [$price1-$price2]x + [$price2*$weight3] \mathbf{{}-[$price2*$weight3]} &= [$total3] \mathbf{{}-[$price2*$weight3]} \\ + [$price1-$price2]x &= [$total3-$price2*$weight3] \\ + \frac{[$price1-$price2]x}{[$price1-$price2]} &= \frac{[$total3-$price2*$weight3]}{[$price1-$price2]} \\ + x &= [$weight1] +\end{aligned} + ``] + +To produce [`[$weight3]`] pounds of mixture, the store should use [`[$weight1]`] pounds of beans and [`[$weight3]-x=[$weight3]-[$weight1]=[$weight2]`] pounds of vegetables. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem10.pg index fd14c91e7c..d2f09d91ed 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem10.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(population_number_answer) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "contextCurrency.pl", "pccTables.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem20.pg index b38df87b53..403c89f1ec 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem20.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(population_number_answer) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "contextCurrency.pl", "pccTables.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem10.pg index bc7b1ee8aa..f302fcee10 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem10.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(arithmetic_percents_calculation_mixing_chemicals) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "contextCurrency.pl", "pccTables.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem20.pg index a2d9780282..64141f7aa4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem20.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(arithmetic_percents_calculation_mixing_chemicals) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "contextCurrency.pl", "pccTables.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem30.pg index 4b87923c37..17b514094a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem30.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/29/13; Yao, 7/28/13 # ENDDESCRIPTION -## DBCCSS('7.EE.3','8.EE.7','A-CED.1') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(arithmetic_percents_calculation_mixing_chemicals) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "contextCurrency.pl", "pccTables.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable10.pg new file mode 100644 index 0000000000..3713ce0124 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable10.pg @@ -0,0 +1,143 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear equation to solve mixture word problems. +# A table is available to help organize data. +# +# Last updated: Jordan 8/29/13; Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + "pccTables.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$p1=random(1,9,2)*10+random(1,9,1); +$dp1=$p1/100; + +$p2=random(2,8,2)*10+random(1,9,1); +$dp2=$p2/100; +$m2=random(1,9,1)*100; +$ans2=Compute($dp2*$m2); + +$p3=random(1,9,2)*10; +$dp3=$p3/100; +$m3=random(20,50,1); +$ans3=Compute($dp3*$m3); + +$p4=random(1,9,1); +$dp4=$p4/100; +$m4=random(200,500,10); +$ans4=Compute($dp4*$m4); + +$p5=random(1,9,1)+random(1,9,1)/10; +$dp5=$p5/100; +$m5=random(200,500,10); +$ans5=Compute($dp5*$m5); + +$p6=random(1,9,1); +$dp6=$p6/100; +$ans6=Compute("$dp6*x"); + +$p7=random(1,9,1)+random(1,9,1)/10; +$dp7=$p7/100; +$m7=random(100,500,100); +$ans7=Compute("$dp7*($m7-x)"); + +############################################## +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_TEXT + +$PAR +The following table demonstrates the relation between the concentration (by mass) of alcohol in a solution, the mass of the solution, and the mass of the pure alcohol in that solution. Fill in the missing entries with expressions or numbers. +$PAR + +\{ +DataTable([ +[{data=>"",cellcss=>"border:none;"}, +{data=>"Percent of",header=>"CH",texpre=>"\multicolumn{1}{p{0.16\linewidth}}{",texpost=>"}",cellcss=>"border:none;"}, +{data=>"",header=>"CH",cellcss=>"border:none;"}, +{data=>"Weight of",header=>"CH",texpre=>"\multicolumn{1}{p{0.17\linewidth}}{",texpost=>"}",cellcss=>"border:none;"}, +{data=>"",header=>"CH",cellcss=>"border:none;"}, +{data=>"Weight of Pure",header=>"CH",texpre=>"\multicolumn{1}{p{0.21\linewidth}}{",texpost=>"}",cellcss=>"border:none;"},], +[{data=>"",cellcss=>"border:none;"}, +{data=>"Alcohol",header=>"CH",texpre=>"\multicolumn{1}{p{0.16\linewidth}}{",texpost=>"}",cellcss=>"border:none;"}, +{data=>" \(\times\)",header=>"CH",cellcss=>"border:none;"}, +{data=>"Solution (in grams)",header=>"CH",texpre=>"\multicolumn{1}{p{0.17\linewidth}}{",texpost=>"}",cellcss=>"border:none;"}, +{data=>"\(=\)",header=>"CH",cellcss=>"border:none;"}, +{data=>"Alcohol (in grams)",header=>"CH",texpre=>"\multicolumn{1}{p{0.21\linewidth}}{",texpost=>"}",cellcss=>"border:none;"},], +[{data=>"Solution 1",header=>"RH"},"\($p1%\)","$SPACE","\(100\)","$SPACE","\($p1\)"], +[{data=>"Solution 2",header=>"RH"},"\($p2%\)","$SPACE","\($m2\)","$SPACE",ans_rule(10)], +[{data=>"Solution 3",header=>"RH"},"\($p3%\)","$SPACE","\($m3\)","$SPACE",ans_rule(10)], +[{data=>"Solution 4",header=>"RH"},"\($p4%\)","$SPACE","\($m4\)","$SPACE",ans_rule(10)], +[{data=>"Solution 5",header=>"RH"},"\($p5%\)","$SPACE","\($m5\)","$SPACE",ans_rule(10)], +[{data=>"Solution 6",header=>"RH"},"\($p6%\)","$SPACE","\(x\)","$SPACE",ans_rule(10)], +[{data=>"Solution 7",header=>"RH"},"\($p7%\)","$SPACE","\($m7-x\)","$SPACE",ans_rule(10)], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + + +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers=1; +Context("LimitedNumeric"); +ANS( Compute($ans2) -> cmp); +ANS( Compute($ans3) -> cmp); +ANS( Compute($ans4) -> cmp); +ANS( Compute($ans5) -> cmp); +Context("Numeric"); +ANS( Compute($ans6) -> cmp); +ANS( Compute($ans7) -> cmp); + +Context()->texStrings; +BEGIN_SOLUTION +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"Percent of Alcohol",header=>"CH"},{data=>" \(\times\)",header=>"CH"},{data=>"Weight of Solution (in grams)",header=>"CH"},{data=>"\(=\)",header=>"CH"},{data=>"Weight of Pure Alcohol (in grams)",header=>"CH"},], +[{data=>"Solution 1",header=>"RH"},"\($p1%\)","$SPACE","\(100\)","$SPACE","\($dp1 \cdot 100 = $p1\)"], +[{data=>"Solution 2",header=>"RH"},"\($p2%\)","$SPACE","\($m2\)","$SPACE","\($dp2 \cdot $m2 = $ans2\)"], +[{data=>"Solution 3",header=>"RH"},"\($p3%\)","$SPACE","\($m3\)","$SPACE","\($dp3 \cdot $m3 = $ans3\)"], +[{data=>"Solution 4",header=>"RH"},"\($p4%\)","$SPACE","\($m4\)","$SPACE","\($dp4 \cdot $m4 = $ans4\)"], +[{data=>"Solution 5",header=>"RH"},"\($p5%\)","$SPACE","\($m5\)","$SPACE","\($dp5 \cdot $m5 = $ans5\)"], +[{data=>"Solution 6",header=>"RH"},"\($p6%\)","$SPACE","\(x\)","$SPACE","\($dp6 \cdot x = $ans6\)"], +[{data=>"Solution 7",header=>"RH"},"\($p7%\)","$SPACE","\($m7-x\)","$SPACE","\($ans7\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable20.pg new file mode 100644 index 0000000000..a77832f901 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable20.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear equation to solve mixture word problems. +# A table is available to help organize data. +# +# Last updated: Jordan 8/29/13; Yao, 7/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + "pccTables.pl", + "PGML.pl", + "contextPercent.pl", + "answerHints.pl", + "PGcourse.pl", +); + +############################################## + +Context("Percent"); + +$s1 = random(10,90,20); +$p1 = random(2,5,1); +$dp1 = $p1/100; +$pure1 = $s1*$dp1; + +$s2 = 200-$s1; +$p2 = random(6,10,1); +$dp2 = $p2/100; +$pure2 = $s2*$dp2; + +$s3 = $s1+$s2; +$pure3 = $pure1+$pure2; +$dp3 = $pure3/$s3; +$p3 = Compute($dp3*100); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +If [`[$s1]`] grams of [`[$p1]%`] (by mass) alcohol solution is mixed with [`[$s2]`] grams of [`[$p2]%`] alcohol solution, what is the concentration of alcohol in the mixture? + +You can use a table to organize the given information. Let the mixture's concentration of alcohol be [`x`]. + +END_PGML +Context()->texStrings; +BEGIN_TEXT +$PAR + +\{ +DataTable([["", +{data=>"Percent of Alcohol",header=>"CH",texpre=>"\multicolumn{1}{p{0.16\linewidth}}{",texpost=>"}"}, +{data=>" \(\times\)",header=>"CH"}, +{data=>"Weight of Solution (in grams)",header=>"CH",texpre=>"\multicolumn{1}{p{0.17\linewidth}}{",texpost=>"}"}, +{data=>"\(=\)",header=>"CH"}, +{data=>"Weight of Pure Alcohol (in grams)",header=>"CH",texpre=>"\multicolumn{1}{p{0.21\linewidth}}{",texpost=>"}"},], +[{data=>"Solution 1",header=>"RH"},"\($p1%\)","$SPACE","\($s1\)","$SPACE","\($dp1 \cdot $s1=$pure1\)"], +[{data=>"Solution 2",header=>"RH"},"\($p2%\)","$SPACE","\($s2\)","$SPACE","\($dp2 \cdot $s2=$pure2\)"], + [{data=>"Mixture",header=>"RH"},"\(x\)","$SPACE","\($s1+$s2\)","$SPACE","\(x ($s1+$s2)\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$PAR +END_TEXT +Context()->normalStrings; + +BEGIN_PGML +Use entries in the table to write and solve an equation to find the concentration of alcohol in the mixture. + + The mixture's percentage of alcohol is [_________]. + + +END_PGML + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers=1; +ANS( Compute("$p3%")-> cmp()->withPostFilter(AnswerHints( + Compute("$p3") => "Did you mean $p3$PERCENT?", +))); + + +BEGIN_PGML_SOLUTION +Since we are mixing the first two solutions together, the amount of pure alcohol in the mixture should equal the sum of the amounts of pure alcohol from the first two solutions. The table allows us to set up and solve an equation based off of this: + + [`` +\begin{aligned} + x \cdot ([$s1]+[$s2]) &= [$pure1]+[$pure2] \\ + x \cdot ([$s1]+[$s2]) &= [$pure3] \\ + [$s3]x &= [$pure3] \\ + \frac{[$s3]x}{[$s3]} &= \frac{[$pure3]}{[$s3]} \\ + x &= [$dp3] \\ + x &= [$p3]% \\ +\end{aligned} +``] + +The mixture has a concentration of [`[$p3]%`] alcohol. The answer can be entered as [`[$p3]%`] or as [`[$dp3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable30.pg new file mode 100644 index 0000000000..0607cd4070 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable30.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear equation to solve mixture word problems. +# A table is available to help organize data. +# +# Last updated: Jordan 8/29/13; Yao, 7/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + "pccTables.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + +$s1 = random(20,80,20); +$p1 = 5*list_random((1,2,3,4)); +$dp1 = $p1/100; +$pure1 = $s1*$dp1; + +$s2 = random(120,200,20); +$p2 = 5*list_random((1,2,3,4)); +while ($p2==$p1) {$p2 = 5*list_random((1,2,3,4));} +$dp2 = $p2/100; +$pure2 = $s2*$dp2; + +$s3 = $s1+$s2; +$pure3 = $pure1+$pure2; +$dp3 = $pure3/$s3; +$p3 = $dp3*100; + +} while (int($dp3*10000)!=($dp3*10000)); + +############################################## +TEXT(beginproblem()); +BEGIN_PGML + +You have poured [`[$s1]`] grams of [`[$p1]%`] alcohol solution into a large mixing container. You have plenty of [`[$p2]%`] alcohol solution on hand. You need to mix up some [`[$p3]%`] alcohol solution. How much [`[$p2]%`] solution do you have to pour into the mixing container? + +You can use a table to organize the data. Let's let [`x`] represent the number of grams of [`[$p2]%`] solution that you will use. +END_PGML + +Context()->texStrings; +BEGIN_TEXT +$PAR + +\{ +DataTable([["", +{data=>"Percent of Alcohol",header=>"CH",texpre=>"\multicolumn{1}{p{0.16\linewidth}}{",texpost=>"}"}, +{data=>" \(\times\)",header=>"CH"}, +{data=>"Weight of Solution (in grams)",header=>"CH",texpre=>"\multicolumn{1}{p{0.17\linewidth}}{",texpost=>"}"}, +{data=>"\(=\)",header=>"CH"}, +{data=>"Weight of Pure Alcohol (in grams)",header=>"CH",texpre=>"\multicolumn{1}{p{0.21\linewidth}}{",texpost=>"}"},], +[{data=>"Solution 1",header=>"RH"},"\($p1%\)","$SPACE","\($s1\)","$SPACE","\($dp1 \cdot $s1=$pure1\)"], +[{data=>"Solution 1",header=>"RH"},"\($p2%\)","$SPACE","\(x\)","$SPACE","\($dp2 x\)"], +[{data=>"Mixture",header=>"RH"},"\($p3%\)","$SPACE","\($s1+x\)","$SPACE","\($dp3($s1+x)\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + + +$PAR +END_TEXT +Context()->normalStrings; + +BEGIN_PGML +Use the entries of the table to find the amount of [`[$p2]%`] solution do you have to pour into the mixing container. + + You need to add [__________]{$s2} grams of [`[$p2]%`] solution. + +END_PGML + + +############################################## +$showPartialCorrectAnswers=1; + +$step1 = $dp3*$s1; +$step2 = $dp3-$dp2; +$step3 = $pure1-$step1; + +BEGIN_PGML_SOLUTION + +Since we are mixing the first two solutions together, the amount of pure alcohol in the mixture should equal the sum of the amounts of pure alcohol from the first two solutions. The table allows us to set up and solve an equation based off of this: + + [`` +\begin{aligned}[t] + [$dp3] \cdot ([$s1]+x) &= [$pure1]+[$dp2]x \\ + [$dp3] \cdot [$s1] + [$p3]x &= [$pure1]+[$dp2]x \\ + [$step1] + [$dp3]x &= [$pure1]+[$dp2]x \\ + [$step1] + [$dp3]x \mathbf{{}-[$step1]} &= [$pure1]+[$dp2]x \mathbf{{}-[$step1]} \\ + [$dp3]x &= [$dp2]x +[$step3] \\ + [$dp3]x \mathbf{{}-[$dp2]x} &= [$dp2]x +[$step3] \mathbf{{}-[$dp2]x} \\ + [$step2]x &= [$step3] \\ + \frac{[$step2]x}{[$step2]} &= \frac{[$step3]}{[$step2]} \\ + x &= [$s2] +\end{aligned} + ``] + +So you need to pour [`[$s2]`] grams of [`[$p2]%`] solution into the mixer. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable40.pg new file mode 100644 index 0000000000..89dd37fa3a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable40.pg @@ -0,0 +1,154 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear equation to solve mixture word problems. +# A table is available to help organize data. +# +# Last updated: Jordan 8/29/13; Yao, 7/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + "pccTables.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +do { + +$s1 = random(200,800,100); +$p1 = 5*list_random((1,2,3,4,5,6)); +$dp1 = $p1/100; +$pure1 = $s1*$dp1; + +$s2 = random(1200,2000,100); +$p2 = 5*list_random((1,2,3,4,5,6)); +while ($p2==$p1) {$p2 = 5*list_random((1,2,3,4,5,6));} +$dp2 = $p2/100; +$pure2 = $s2*$dp2; + +$s3 = $s1+$s2; +$pure3 = $pure1+$pure2; +$dp3 = $pure3/$s3; +$p3 = $dp3*100; + +} while (int($dp3*10000)!=($dp3*10000)); + +############################################## +TEXT(beginproblem()); + + +BEGIN_PGML + +You have poured [`[$s1]`] grams of [`[$p1]%`] alcohol solution into a large mixing container. You have plenty of [`[$p2]%`] alcohol solution on hand. You need to mix up some [`[$p3]%`] alcohol solution. How much [`[$p2]%`] solution do you have to pour into the mixing container? + +You can use a table to organize the data. Let's let [`x`] represent the number of grams of [`[$p2]%`] solution that you will use. +END_PGML + +Context()->texStrings; +BEGIN_TEXT +$PAR + +\{ +DataTable([["", +{data=>"Percent of Alcohol",header=>"CH",texpre=>"\multicolumn{1}{p{0.16\linewidth}}{",texpost=>"}"}, +{data=>" \(\times\)",header=>"CH"}, +{data=>"Weight of Solution (in grams)",header=>"CH",texpre=>"\multicolumn{1}{p{0.17\linewidth}}{",texpost=>"}"}, +{data=>"\(=\)",header=>"CH"}, +{data=>"Weight of Pure Alcohol (in grams)",header=>"CH",texpre=>"\multicolumn{1}{p{0.21\linewidth}}{",texpost=>"}"},], +[{data=>"Solution 1",header=>"RH"},"\($p1%\)","$SPACE","\($s1\)","$SPACE","\($dp1 \cdot $s1=$pure1\)"], +[{data=>"Solution 1",header=>"RH"},"\($p2%\)","$SPACE","\(x\)","$SPACE","\($dp2 x\)"], +[{data=>"Mixture",header=>"RH"},"\($p3%\)","$SPACE",ans_rule(15),"$SPACE",ans_rule(15)], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + + +$PAR +END_TEXT +Context()->normalStrings; + + +BEGIN_PGML +Use the entries of the table to find the amount of [`[$p2]%`] solution do you have to pour into the mixing container. + + You need to add [__________] grams of [`[$p2]%`] solution. + +END_PGML + +############################################## +$showPartialCorrectAnswers=1; +ANS( Compute("$s1+x") -> cmp); +ANS( Compute("$dp3*($s1+x)") -> cmp); +ANS( Compute($s2) -> cmp); + +$step1 = $dp3*$s1; +$step2 = $dp3-$dp2; +$step3 = $pure1-$step1; + +BEGIN_SOLUTION +$PAR +If we let \(x\) represent the number of grams of \($p2%\) solution that we will use, then since the first two solutions are mixed, the mixture will have a mass of \($s1+x\) grams. +$PAR + +By the percentage formula, the mixture has \($dp3 ($s1 +x)\) grams of alcohol. +$PAR +Now the table looks like: + +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"Percent of Alcohol",header=>"CH"},{data=>" \(\times\)",header=>"CH"},{data=>"Weight of Solution (in grams)",header=>"CH"},{data=>"\(=\)",header=>"CH"},{data=>"Weight of Pure Alcohol (in grams)",header=>"CH"},], +["Solution 1","\($p1%\)","$SPACE","\($s1\)","$SPACE","\($dp1 \cdot $s1=$pure1\)"], +["Solution 2","\($p2%\)","$SPACE","\(x\)","$SPACE","\($dp2 x\)"], +["Mixture","\($p3%\)","$SPACE","\($s1+x\)","$SPACE","\($dp3 ($s1+x)\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$PAR +The last column in the table can be used with the following relationship: + + \[\text{alcohol in mixture} = \text{alcohol in Solution 1} + \text{alcohol in Solution 2}\] +$PAR +Now we can write an equation and then solve it: +$PAR + +\[ +\begin{aligned} + $dp3 \cdot ($s1 +x) &= $pure1 +$dp2 x \\ + $dp3 \cdot $s1 + $p3 x &= $pure1 +$dp2 x \\ + $step1 + $dp3 x &= $pure1 +$dp2 x \\ + $step1 + $dp3 x \mathbf{{}-$step1} &= $pure1 +$dp2 x \mathbf{{}-$step1} \\ + $dp3 x &= $dp2 x + $step3 \\ + $dp3 x \mathbf{{}-$dp2 x} &= $dp2 x + $step3 \mathbf{{}-$dp2 x} \\ + $step2 x &= $step3 \\ + \frac{$step2 x}{$step2 } &= \frac{$step3 }{$step2 } \\ + x &= $s2 +\end{aligned} +\] +$PAR +So you need to pour \($s2\) grams of \($p2%\) solution into the mixing container. +$PAR +END_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable50.pg new file mode 100644 index 0000000000..685ad9f952 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable50.pg @@ -0,0 +1,154 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear equation to solve mixture word problems. +# A table is available to help organize data. +# +# Last updated: Jordan 8/29/13; Yao, 7/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('equation','solve','word problem','mixture') +## DBCCSS('7.EE.3','8.EE.7','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + "pccTables.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +do { + +$s1 = random(220,400,20); +$p1 = 5*list_random((3,4,5,6)); +$dp1 = $p1/100; +$pure1 = $s1*$dp1; + +$s2 = random(120,200,20); +$p2 = 5*list_random((3,4,5,6)); +while ($p2==$p1) {$p2 = 5*list_random((3,4,5,6));} +$dp2 = $p2/100; +$pure2 = $s2*$dp2; + +$s3 = $s1+$s2; +$pure3 = $pure1+$pure2; +$dp3 = $pure3/$s3; +$p3 = $dp3*100; + +} while (int($dp3*10000)!=($dp3*10000)); + + +############################################## +TEXT(beginproblem()); + + +BEGIN_PGML + +You have poured some [`[$p1]%`] (by mass) alcohol solution and some [`[$p2]%`] alcohol solution into a large mixing container. Now you have [`[$s3]`] grams of [`[$p3]%`] alcohol solution. How much of each type of solution did you pour into the mixing container? + +You can use a table to organize the data. Let's let [`x`] represent the number of grams of [`[$p1]%`] solution that you used. +END_PGML + +Context()->texStrings; +BEGIN_TEXT +$PAR +\{ +DataTable([["", +{data=>"Percent of Alcohol",header=>"CH",texpre=>"\multicolumn{1}{p{0.16\linewidth}}{",texpost=>"}"}, +{data=>" \(\times\)",header=>"CH"}, +{data=>"Weight of Solution (in grams)",header=>"CH",texpre=>"\multicolumn{1}{p{0.17\linewidth}}{",texpost=>"}"}, +{data=>"\(=\)",header=>"CH"}, +{data=>"Weight of Pure Alcohol (in grams)",header=>"CH",texpre=>"\multicolumn{1}{p{0.21\linewidth}}{",texpost=>"}"},], +[{data=>"Solution 1",header=>"RH"},"\($p1%\)","$SPACE","\(x\)","$SPACE","\($dp1 x\)"], +[{data=>"Solution 2",header=>"RH"},"\($p2%\)","$SPACE",ans_rule(10),"$SPACE",ans_rule(10)], +[{data=>"Mixture",header=>"RH"},"\($p3%\)","$SPACE","\($s3\)","$SPACE","\($dp3 \cdot $s3\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$PAR +END_TEXT +Context()->normalStrings; + + +BEGIN_PGML +Use the entries of the table to find the amount of each type of solution that was used. + + You mixed [__________] grams of [`[$p1]%`] solution with [__________] grams of [`[$p2]%`] solution. +END_PGML + + +############################################## +$showPartialCorrectAnswers=1; +ANS( Compute("$s3-x") -> cmp); +ANS( Compute("$dp2*($s3-x)") -> cmp); +ANS( Compute($s1) -> cmp); +ANS( Compute($s2) -> cmp); + +$step1 = $dp2*$s3; +$step2 = $dp1-$dp2; +$step3 = $dp3*$s3; +$step4 = $step3 - $step1; + +BEGIN_SOLUTION +$PAR +If you poured \(x\) grams of \($p1%\) solution into the mixing container, then since the final solution has \($s3\) grams of liquid, you must have poured in \($s3-x\) grams of the \($p2%\) solution. +$PAR +Solution 2 has \($p2 %\) alcohol. By the percentage formula, Solution 2 has \($dp2 ($s3 -x)\) grams of alcohol. +$PAR +$PAR +Now the table looks like: +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"Percent of Alcohol",header=>"CH"},{data=>" \(\times\)",header=>"CH"},{data=>"Weight of Solution (in grams)",header=>"CH"},{data=>"\(=\)",header=>"CH"},{data=>"Weight of Pure Alcohol (in grams)",header=>"CH"},], +[{data=>"Solution 1",header=>"RH"},"\($p1%\)","$SPACE","\(x\)","$SPACE","\($dp1 x\)"], +[{data=>"Solution 2",header=>"RH"},"\($p2%\)","$SPACE","\($s3-x\)","$SPACE","\($dp2 ($s3-x)\)"], +[{data=>"Mixture",header=>"RH"},"\($p3%\)","$SPACE","\($s3\)","$SPACE","\($dp3 \cdot $s3\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "Organize data with a table", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$PAR +The last column in the table can be used with the following relationship: + + \[\text{alcohol in mixture} = \text{alcohol in Solution 1} + \text{alcohol in Solution 2}\] +$PAR +Now we can write an equation and then solve it: +$PAR +\[ +\begin{aligned} + $dp3 \cdot $s3 &= $dp1 x+$dp2 ($s3 -x) \\ + $step3 &= $dp1 x+$dp2 \cdot $s3 - $dp2 \cdot x \\ + $step3 &= $dp1 x+$step1 - $dp2 \cdot x \\ + $step3 &= $step2 x+$step1 \\ + $step3 \mathbf{{}-$step1} &= $step2 x+$step1 \mathbf{{}-$step1} \\ + $step4 &= $step2 x \\ + \frac{$step4 }{$step2 } &= \frac{$step2 x}{$step2 } \\ + $s1 &= x\\ + x &= $s1 +\end{aligned} +\] +$PAR +So you mixed \($s1 \) grams of \($p1%\) solution with \($s3 -$s1\), or \( $s2 \) grams of \($p2%\) solution. +$PAR +END_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation10.pg new file mode 100644 index 0000000000..347f456a36 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation10.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/19/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "contextTypeset.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->flags->set(tolerance=>0.00001); +Context()->variables->are(s=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$lastYear = random(30000,60000,1000); +$pNum = random(1,3,0.1); +$p = $pNum/100; +$thisYear = $lastYear*(1+$p); + +$ansString = "s+$p*s=$thisYear"; +$ans = Compute("$ansString"); + +Context("Currency"); +$thisYearC = Currency($thisYear); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$Possessive = 'His' if ($sex eq 'male'); +$Possessive = 'Her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name]'s annual salary as a radiography technician is [`[$thisYearC]`]. [$Possessive] salary increased by [`[$pNum]%`] from last year. What was [$possessive] salary last year? + +Assume [$possessive] salary last year was [`s`] dollars. Write an equation to model this scenario. There is no need to solve it. + + [_________________________] + +END_PGML + + +############################################## + +ANS($ans->cmp( + cmp_class => "a linear equation", + correct_ans=>Parser::Formula(Context("Typeset") , $ansString)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ansString)->TeX, + checker => sub { + my ($correct,$student,$ansHash) = @_; + $result = ($correct == $student); + my $context = Context(); + Context("Typeset"); + $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); + $ansHash->{preview_text_string} = $student->string; + $ansHash->{preview_latex_string} = $student->TeX; + $ansHash->{student_ans} = $student->string; + Context($context); + return $result +})); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [$possessive] salary last year was [`s`] dollars. Since [$possesive] salary increased by [`[$pNum]%`] from last year, the increase was [`[$p]s`] dollars. This year's salary is the sum of last year's salary and the increase, so we can write the equation: + + [``s+[$p]s=[$thisYear]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation100.pg new file mode 100644 index 0000000000..aee768fb33 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation100.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "parserNumberWithUnits.pl", + "contextTypeset.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->variables->are(h=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$base1 = random(1,2,0.1); +$base2 = Round($base1*1.6,1); +$b1U = NumberWithUnits("$base1 ft"); +$b2U = NumberWithUnits("$base2 ft"); +$volume = Round($base1*$base2*random(0.25,0.75,0.05)); +$vU = NumberWithUnits("$volume ft^3"); +$height = $volume/($base1*$base2); + +$ansString = "$volume=$base1*$base2*h"; +$ans = Compute("$ansString"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The base of a cat litter box is [`[$b1U]`] by [`[$b2U]`]. What will be the height of the cat litter if [`[$vU]`] of cat litter is poured? (The volume of a rectangular box is [`wdh`], where [`w`] is the width, [`d`] is the depth, and [`h`] is the height.) + +Let [`h`] be the number of ft high that the cat litter will occupy if [`[$vU]`] of cat litter is poured. Write an equation to model this scenario. There is no need to solve it. + + [_________________________] + +END_PGML + + +############################################## + +ANS($ans->cmp( + cmp_class => "a linear equation", + correct_ans=>Parser::Formula(Context("Typeset") , $ansString)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ansString)->TeX, + checker => sub { + my ($correct,$student,$ansHash) = @_; + $result = ($correct == $student); + my $context = Context(); + Context("Typeset"); + $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); + $ansHash->{preview_text_string} = $student->string; + $ansHash->{preview_latex_string} = $student->TeX; + $ansHash->{student_ans} = $student->string; + Context($context); + return $result +})); + +############################################## + +BEGIN_PGML_SOLUTION + +The volume of a rectangular prism can be calculated by the formula: + + [``\text{Volume}=\text{base1}\cdot\text{base2}\cdot\text{height}``] + +So we can write an equation based on the volume formula: + + [``[$volume]=[$base1]\cdot[$base2]h``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation110.pg new file mode 100644 index 0000000000..1269c77e16 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation110.pg @@ -0,0 +1,78 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitEquation.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitEquation"); +Context()->variables->are(g=>"Real",z=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$tank = random(50,100,1); +$max = random(1500,3000,100); +$gallon = ($max-$tank)/8.3454; + +$ansString = "8.3454*g+$tank=$max"; +$ans = ImplicitEquation("$ansString",limits=>[[$gallon-1,$gallon+1],[-2,2]]); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A truck that hauls water is capable of carrying a maximum of [`[$max]`] lb. Water weighs [`8.3454 \frac{\text{lb}}{\text{gal}}`], and the plastic tank on the truck that holds water weighs [`[$tank]`] lb. What's the maximum number of gallons of water the truck can carry? + +Assume the truck can carry a maximum of [`g`] gallons of water. Write an equation to model this scenario. There is no need to solve it. + + [_________________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the truck can carry a maximum of [`g`] gallons of water. Since water weighs [`8.3454 \frac{\text{lb}}{\text{gal}}`], the weight of water will be [`8.3454g`] gallons. The combined weight of water and tank is [`8.3454g+[$tank]`]. The maximum weight the truck can carry is [`[$max]`], so we can write the equation: + + [``8.3454g+[$tank]=[$max]``] + +We could also model this scenario with an inequality: + + [``8.3454g+[$tank]\le[$max]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation120.pg new file mode 100644 index 0000000000..9ed957efe8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation120.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitEquation.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitEquation"); +Context()->variables->are(s=>"Real",z=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$max = random(4,8,0.1); +$rate = random(0.8,1.5,1); +$seconds = random(1.5,$max/$rate-0.5,0.1); +$left = $max-$rate*$seconds; + +$ansString = "$max-$rate*s=$left"; +$ans = ImplicitEquation($ansString,limits=>[[$seconds-1,$seconds+1],[-2,2]]); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$Possessive = 'His' if ($sex eq 'male'); +$Possessive = 'Her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name]'s maximum lung capacity is [`[$max]`] liters. If [$possessive] lungs are full and [$pronoun] exhales at a rate of [`[$rate]`] liters per second, when will [$pronoun] have [`[$left]`] liters of air left in [$possessive] lungs? + +Assume [`s`] seconds later, there would be [`[$left]`] liters of air left in [$name]'s lungs. Write an equation to model this scenario. There is no need to solve it. + + [_________________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [`s`] seconds later, there would be [`[$left]`] liters of air left in [$name]'s lungs. + +Since [$name] exhales at a rate of [`[$rate]`] liters per second, [$pronoun] can exhale [`[$rate]s`] liters of air in [`s`] seconds. + +When [$possessive] lungs are full, there are [`[$max]`] liters of air in them. The amount of air left after [`s`] seconds would be [`[$max]-[$rate]s`] liters. + +Since we are interested in knowing when there are [`[$left]`] liters of air left, we can write the equation: + + [``[$max]-[$rate]s=[$left]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation130.pg new file mode 100644 index 0000000000..9a37daf2ee --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation130.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitEquation.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitEquation"); +Context()->variables->are(m=>"Real",z=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$start = random(10,100,10); +$rate = random(5,10,1); +$minute = random(10,30,1); +$max = $rate*$minute+$start; + +$ansString = "$start+$rate*m=$max"; +$ans = ImplicitEquation("$ansString",limits=>[[$minute-1,$minute+1],[-2,2]]); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A wading pool is being filled with water from a garden hose at a rate of [`[$rate]`] gallons per minute. If the pool already contains [`[$start]`] gallons of water and can hold [`[$max]`] gallons, after how long will the pool overflow? + +Assume [`m`] minutes later, the pool would overflow. Write an equation to model this scenario. There is no need to solve it. + + [_________________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [`m`] minutes later, the pool would overflow. + +Since the garden hose fills the pool at [`[$rate]`] gallons per minute, it can fill [`[$rate]m`] gallons in [`m`] minutes. + +Since there is [`[$start]`] gallons of water in the pool in the beginning, the amount of water in the pool after [`m`] minutes would be a total of [`[$start]+[$rate]m`]. + +To find when the amount of water will reach the pool's maximum volume, we can write the equation: + + [``[$start]+[$rate]m=[$max]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation140.pg new file mode 100644 index 0000000000..b0f11f66ed --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation140.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitEquation.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitEquation"); +Context()->variables->are(h=>"Real",z=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$diameter = random(5,15,1); +$radius = $diameter/2; +$radius2 = $radius**2; +$height = random(1,3,0.1); +$volume = int(pi*$radius2*$height); + + +$ansString = "$volume=$radius2*pi*h"; +$ans = ImplicitEquation("$ansString",limits=>[[$height-1,$height+1],[-2,2]]); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +An engineer is designing a cylindrical springform pan. The pan needs to be able to hold a volume of [`[$volume]`] cubic inches and have a diameter of [`[$diameter]`] inches. What's the minimum height it can have? (Hint: The formula for the volume of a cylinder is [`V=\pi r^2h`]). + +Assume the pan's minimum height is [`h`] inches. Write an equation to model this scenario. There is no need to solve it. + +[@KeyboardInstructions(q?Use *pi* to represent [`\pi`].?)@]** + + [_________________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the pan's minimum height is [`h`] inches. + +A cylinder's volume formula has [`r`], representing radius. We first need to change diameter to radius: + + [`` r = \frac{d}{2} = \frac{[$diameter]}{2} = [$radius] ``] + +Now we can substitute given numbers into a cylinder's volume formula, we have: + + [`` +\begin{aligned} + V &= \pi r^2h \\ + [$volume] &= \pi([$radius])^2h \\ + [$volume] &= [$radius2]\pi h +\end{aligned} + ``] + +Since the volume could be greater than [`h`], we can also model this scenario with an inequality: + + [`` [$volume] \le [$radius2]\pi h ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation20.pg new file mode 100644 index 0000000000..742c9024bf --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation20.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "contextCurrency.pl", + "contextTypeset.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->variables->are(p=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$original = random(50,300,10); +$pNum = random(5,8,0.1); +$p = $pNum/100; +$withTax = $original*(1+$p); + +$ansString = "p+$p*p=$withTax"; +$ans = Compute("$ansString"); + +Context("Currency"); +$withTaxC = Currency($withTax); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A bicycle for sale costs [`[$withTaxC]`], which includes [`[$pNum]%`] sales tax. What was the cost before sales tax? + +Assume the bicycle's price before sales tax is [`p`] dollars. Write an equation to model this scenario. There is no need to solve it. + + [_________________________] + +END_PGML + + +############################################## + +ANS($ans->cmp( + cmp_class => "a linear equation", + correct_ans=>Parser::Formula(Context("Typeset") , $ansString)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ansString)->TeX, + checker => sub { + my ($correct,$student,$ansHash) = @_; + $result = ($correct == $student); + my $context = Context(); + Context("Typeset"); + $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); + $ansHash->{preview_text_string} = $student->string; + $ansHash->{preview_latex_string} = $student->TeX; + $ansHash->{student_ans} = $student->string; + Context($context); + return $result +})); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the bicycle's original price before tax is [`p`] dollars. With a tax rate of [`[$pNum]%`], the tax is [`[$p]p`] dollars. The bicycle's new price is its original price plus tax, so we can write the equation: + + [``p+[$p]p=[$withTax]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation30.pg new file mode 100644 index 0000000000..9434cbf3c0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation30.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "contextCurrency.pl", + "contextTypeset.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->variables->are(p=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$original = random(50,300,10); +$pNum = random(5,30,5); +$p = $pNum/100; +$afterDiscount = $original*(1-$p); + +$ansString = "p-$p*p=$afterDiscount"; +$ans = Compute("$ansString"); + +Context("Currency"); +$afterDiscountC = Currency($afterDiscount); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The price of a washing machine after [`[$pNum]%`] discount is [`[$afterDiscountC]`]. What was the original price of the washing machine (before the discount was applied)? + +Assume the washing machine's price before the discount is [`p`] dollars. Write an equation to model this scenario. There is no need to solve it. + + [_________________________] + +END_PGML + + +############################################## + +ANS($ans->cmp( + cmp_class => "a linear equation", + correct_ans=>Parser::Formula(Context("Typeset") , $ansString)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ansString)->TeX, + checker => sub { + my ($correct,$student,$ansHash) = @_; + $result = ($correct == $student); + my $context = Context(); + Context("Typeset"); + $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); + $ansHash->{preview_text_string} = $student->string; + $ansHash->{preview_latex_string} = $student->TeX; + $ansHash->{student_ans} = $student->string; + Context($context); + return $result +})); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the washing machine's original price before the discount is [`p`] dollars. With the discount rate of [`[$pNum]%`], the discount part is [`[$p]p`] dollars. The washing machine's new price is its original price minus the discount, so we can write the equation: + + [``p-[$p]p=[$afterDiscount]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation40.pg new file mode 100644 index 0000000000..71d8ed6ab8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation40.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "contextCurrency.pl", + "contextTypeset.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->variables->are(b=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$original = random(10,100,10); +$pNum = random(10,20,1); +$p = $pNum/100; +$new = $original*(1+$p); + +$ansString = "b+$p*b=$new"; +$ans = Compute("$ansString"); + +Context("Currency"); +$newC = Currency($new); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The price of a restaurant bill, including an [`[$pNum]%`] gratuity charge, was [`[$newC]`]. What was the price of the bill before gratuity was added? + +Assume the bill without gratuity is [`b`] dollars. Write an equation to model this scenario. There is no need to solve it. + + [_________________________] + +END_PGML + + +############################################## + +ANS($ans->cmp( + cmp_class => "a linear equation", + correct_ans=>Parser::Formula(Context("Typeset") , $ansString)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ansString)->TeX, + checker => sub { + my ($correct,$student,$ansHash) = @_; + $result = ($correct == $student); + my $context = Context(); + Context("Typeset"); + $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); + $ansHash->{preview_text_string} = $student->string; + $ansHash->{preview_latex_string} = $student->TeX; + $ansHash->{student_ans} = $student->string; + Context($context); + return $result +})); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the bill without gratuity is [`b`] dollars. A [`[$pNum]%`] gratuity is [`[$p]b`] dollars. Since the original bill plus gratuity is [`[$newC]`], we can write the equation: + + [``b+[$p]b=[$new]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation50.pg new file mode 100644 index 0000000000..a24cdeda90 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation50.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "contextCurrency.pl", + "contextTypeset.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->variables->are(p=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$original = random(800,1500,100); +$pNum = random(0.2,1,0.1); +$p = $pNum/100; +$new = $original*(1+$p); + +$ansString = "p+$p*p=$new"; +$ans = Compute("$ansString"); + +Context("Currency"); +$newC = Currency($new); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +In May 2016, the median rent price for a one-bedroom apartment in a city was reported to be [`[$newC]`] per month. This was reported to be an increase of [`[$pNum]%`] over the previous month. Based on this reporting, what was the median price of a one-bedroom apartment in April 2016? + +Assume the median price of a one-bedroom apartment in April 2016 was [`p`] dollars. Write an equation to model this scenario. There is no need to solve it. + + [_________________________] + +END_PGML + + +############################################## + +ANS($ans->cmp( + cmp_class => "a linear equation", + correct_ans=>Parser::Formula(Context("Typeset") , $ansString)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ansString)->TeX, + checker => sub { + my ($correct,$student,$ansHash) = @_; + $result = ($correct == $student); + my $context = Context(); + Context("Typeset"); + $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); + $ansHash->{preview_text_string} = $student->string; + $ansHash->{preview_latex_string} = $student->TeX; + $ansHash->{student_ans} = $student->string; + Context($context); + return $result +})); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the median price of a one-bedroom apartment in April 2016 was [`p`] dollars. A [`[$pNum]%`] increase is [`[$p]p`] dollars. Since April's price plus the increase is May's price, we can write the equation: + + [``p+[$p]p=[$new]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation60.pg new file mode 100644 index 0000000000..2e668d93dd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation60.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "contextTypeset.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->variables->are(h=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$speed = random(30,60,1); +$time = random(1,4,0.1); +$distance = $speed*$time; + +$ansString = "$speed*h=$distance"; +$ans = Compute("$ansString"); + +$sex = list_random('male','female'); +$pronoun = ($sex eq 'male') ? 'he' : 'she'; +$possessive = ($sex eq 'male') ? 'his' : 'her'; +$name = RandomName(sex=>$sex); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] is driving an average of [`[$speed]`] miles per hour, and [$pronoun] is [`[$distance]`] miles away from home. After how many hours will [$pronoun] reach [$possessive] home? + +Assume [$name] will reach home after [`h`] hours. Write an equation to model this scenario. There is no need to solve it. + + [_________________________] + +END_PGML + + +############################################## + +ANS($ans->cmp( + cmp_class => "a linear equation", + correct_ans=>Parser::Formula(Context("Typeset") , $ansString)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ansString)->TeX, + checker => sub { + my ($correct,$student,$ansHash) = @_; + $result = ($correct == $student); + my $context = Context(); + Context("Typeset"); + $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); + $ansHash->{preview_text_string} = $student->string; + $ansHash->{preview_latex_string} = $student->TeX; + $ansHash->{student_ans} = $student->string; + Context($context); + return $result +})); + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [$name] will reach home after [`h`] hours. According to the distance formula: + + [``\text{distance} = \text{speed }\cdot\text{ time} ``] + +we can write the equation: + + [``[$speed]h=[$distance]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation70.pg new file mode 100644 index 0000000000..63c316fc20 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation70.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "contextTypeset.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->variables->are(m=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$base = random(20,40,0.05); +$rate = random(0.5,0.9,0.01); +$mile = random(50,200,1); +$total = $base+$rate*$mile; + +$ansString = "$rate*m+$base=$total"; +$ans = Compute("$ansString"); + +Context("Currency"); +$baseC = Currency($base); +$rateC = Currency($rate); +$totalC = Currency($total); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Uhaul charges an initial fee of [`[$baseC]`] and then [`[$rateC]`] per mile to rent a [`15`]-foot truck for a day. If the total bill is [`[$totalC]`], how many miles were driven? + +Assume [`m`] miles were driven. Write an equation to model this scenario. There is no need to solve it. + + [_________________________] + +END_PGML + + +############################################## + +ANS($ans->cmp( + cmp_class => "a linear equation", + correct_ans=>Parser::Formula(Context("Typeset") , $ansString)->string, + correct_ans_latex_string=>Parser::Formula(Context("Typeset") , $ansString)->TeX, + checker => sub { + my ($correct,$student,$ansHash) = @_; + $result = ($correct == $student); + my $context = Context(); + Context("Typeset"); + $student = Parser::Formula(Context("Typeset"), $ansHash->{original_student_ans}); + $ansHash->{preview_text_string} = $student->string; + $ansHash->{preview_latex_string} = $student->TeX; + $ansHash->{student_ans} = $student->string; + Context($context); + return $result +})); + +############################################## + +BEGIN_PGML_SOLUTION + +A rental bill at this company consists of the base fee, [`[$baseC]`], and the cost of driving a certain number of miles. Assume [`m`] miles were driven. Since the company charges [`[$rateC]`] per mile, the cost of driving [`m`] miles is [`[$rate]m`] dollars. Now we can write the equation: + + [``[$rate]m+[$base]=[$total]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation80.pg new file mode 100644 index 0000000000..bf79e2b4f2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation80.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitEquation.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitEquation"); +Context()->variables->are(l=>"Real",z=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$rate = 40; +$ibuprofen1 = random(30,60,5); +$liquid1 = $ibuprofen1/$rate; +do {$ibuprofen2 = random(30,60,5);} until ($ibuprofen2!=$ibuprofen1); + +$ansString = "$liquid1/$ibuprofen1=l/$ibuprofen2"; +$ans = ImplicitEquation("$ansString"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Ibuprofen for infants comes in a liquid form and contains [`[$ibuprofen1]`] milligrams of ibuprofen for each [`[$liquid1]`] milliliters of liquid. If a child is to receive a dose of [`[$ibuprofen2]`] milligrams of ibuprofen, how many milliliters of liquid should they be given? + +Assume [`l`] milliliters of liquid should be given. Write an equation to model this scenario. There is no need to solve it. + + [_________________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +The ratio of ibuprofen to liquid should be consistent. We can set up a proportion in this form: + + [``\frac{\text{liquid}}{\text{ibuprofen}}=\frac{\text{liquid}}{\text{ibuprofen}}``] + +Assume [`l`] milliliters of liquid should be given. We can write the equation: + + [``\frac{[$liquid1]}{[$ibuprofen1]}=\frac{l}{[$ibuprofen2]}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation90.pg new file mode 100644 index 0000000000..c719cccb99 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation90.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Yao 4/20/17 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitEquation.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("Currency"); + +$rate = random(0.9,2,0.01); +$area1 = random(1200,2500,100); +$tax1 = $area1*$rate; +do {$area2 = random(1200,2500,100);} until (abs($area1-$area2)>300); +$tax2 = $area2*$rate; + +$tax1C = Currency($tax1); + +Context("ImplicitEquation"); +Context()->variables->are(t=>"Real",z=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$ansString = "$tax1/$area1=t/$area2"; +$ans = ImplicitEquation("$tax1/$area1=t/$area2",limits=>[[$tax2-1,$tax2+1],[-2,2]]); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The property taxes on a [`[$area1]`]-square-foot house are [`[$tax1C]`] per year. Assuming these taxes are proportional, what are the property taxes on a [`[$area2]`]-square-foot house? + +Assume property taxes on a [`[$area2]`]-square-foot house is [`t`] dollars. Write an equation to model this scenario. There is no need to solve it. + + [_________________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Since property tax and a house's area is proportional, we can set up a proportion in this form: + + [``\frac{\text{tax}}{\text{area}}=\frac{\text{tax}}{\text{area}}``] + +Assume property taxes on a [`[$area2]`]-square-foot house is [`t`] dollars. We can write the equation: + + [``\frac{[$tax1]}{[$area1]}=\frac{t}{[$area2]}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality110.pg new file mode 100644 index 0000000000..ffe075b78a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality110.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Modeling with a linear inequality without solving it. +# +# Last updated: Jordan 7/13/18 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','inequality','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitEquation.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitEquation"); +Context()->operators->add( + '>' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' > ', # output string for it + perl => '>', # perl string + }, + '<' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' < ', # output string for it + perl => '<', # perl string + }, + '>=' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' >= ', # output string for it + TeX => ' \geq ', + perl => '>=', # perl string + }, + '<=' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' <= ', # output string for it + TeX => ' \leq ', + perl => '<=', # perl string + }, +); + +Context()->variables->are(g=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$tank = random(50,100,1); +$max = random(1500,3000,100); +$gallon = ($max-$tank)/8.3454; + +$ansString = "8.3454*g+$tank<=$max"; +Context()->variables->set(g=>{limits=>[$gallon-10,$gallon+10]}); +$ans = ImplicitEquation("$ansString"); +$evaluator = $ans->cmp( + checker => sub { + my ($correct,$student,$ansHash) = @_; + # check that the corresponding equality is correct + my $OK = not ImplicitEquation::compare($correct,$student); + return 0 unless $OK; + # what sign is used + my $sign = $student->{tree}->{bop}; + Value::Error('Write an inequality, not an equation.') if ($sign eq '='); + Value::Error('Your inequality is not using the correct sign.') if ($sign eq '<' or $sign eq '>'); + # distinguish between good/bad uses of >=/<= + my $left = Formula($student->{tree}->{lop})->eval(g=>0); + my $right = Formula($student->{tree}->{rop})->eval(g=>0); + $OK = ($sign eq '>=') ? ($left >= $right) : ($left <= $right); + Value::Error('Your inequality is not using the correct sign.') unless ($OK); + return $OK; + } + ); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A truck that hauls water is capable of carrying a maximum of [`[$max]`] lb. Water weighs [`8.3454 \frac{\text{lb}}{\text{gal}}`], and the plastic tank on the truck that holds water weighs [`[$tank]`] lb. Assume the truck can carry a maximum of [`g`] gallons of water. Write an _inequality_ to model this scenario. There is no need to solve it. + +[@KeyboardInstructions('If you need to enter the inequality signs [`\leq`] or [`\geq`], type [|<=|]* or [|>=|]*.')@]** + + [_________________________]{$evaluator} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the truck can carry a maximum of [`g`] gallons of water. Since water weighs [`8.3454 \frac{\text{lb}}{\text{gal}}`], the weight of water will be [`8.3454g`] gallons. The combined weight of water and tank is [`8.3454g+[$tank]`]. The maximum weight the truck can carry is [`[$max]`], so we can write the inequality: + + [``8.3454g+[$tank]\leq[$max]``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality120.pg new file mode 100644 index 0000000000..612a78bc36 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality120.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Modeling with a linear inequality without solving it. +# +# Last updated: Jordan 7/13/18 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','inequality','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitEquation.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitEquation"); +Context()->operators->add( + '>' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' > ', # output string for it + perl => '>', # perl string + }, + '<' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' < ', # output string for it + perl => '<', # perl string + }, + '>=' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' >= ', # output string for it + TeX => ' \geq ', + perl => '>=', # perl string + }, + '<=' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' <= ', # output string for it + TeX => ' \leq ', + perl => '<=', # perl string + }, +); +Context()->variables->are(t=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$max = random(4,8,0.1); +$rate = random(0.8,1.5,1); +$seconds = random(1.5,$max/$rate-0.5,0.1); +$left = Real($max-$rate*$seconds); + +$ansString = "$max-$rate*t<=$left"; +Context()->variables->set(t=>{limits=>[$seconds-10,$seconds+10]}); +$ans = ImplicitEquation("$ansString"); +$evaluator = $ans->cmp( + checker => sub { + my ($correct,$student,$ansHash) = @_; + # check that the corresponding equality is correct + my $OK = not ImplicitEquation::compare($correct,$student); + return 0 unless $OK; + # what sign is used + my $sign = $student->{tree}->{bop}; + Value::Error('Write an inequality, not an equation.') if ($sign eq '='); + Value::Error('Your inequality is not using the correct sign.') if ($sign eq '<' or $sign eq '>'); + # distinguish between good/bad uses of >=/<= + my $left = Formula($student->{tree}->{lop})->eval(t=>0); + my $right = Formula($student->{tree}->{rop})->eval(t=>0); + $OK = ($sign eq '>=') ? ($left >= $right) : ($left <= $right); + Value::Error('Your inequality is not using the correct sign.') unless ($OK); + return $OK; + } + ); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$object = 'him' if ($sex eq 'male'); +$object = 'her' if ($sex eq 'female'); +$possessive = 'his' if ($sex eq 'male'); +$possessive = 'her' if ($sex eq 'female'); +$Possessive = 'His' if ($sex eq 'male'); +$Possessive = 'Her' if ($sex eq 'female'); +$name = RandomName(sex=>$sex); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name]'s maximum lung capacity is [`[$max]`] liters. If [$possessive] lungs are full and [$pronoun] exhales at a rate of [`[$rate]`] liters per second, write an _inequality_ that models when [$pronoun] will still have at least [`[$left]`] liters of air left in [$possessive] lungs. There is no need to solve it. + +[@KeyboardInstructions('Use [|t|]* for the variable. If you need to enter the inequality signs [`\leq`] or [`\geq`], type [|<=|]* or [|>=|]*.')@]** + + [_________________________]{$evaluator} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [`t`] seconds pass. Since [$name] exhales at a rate of [`[$rate]`] liters per second, [$pronoun] can exhale [`[$rate]t`] liters of air in [`t`] seconds. When [$possessive] lungs are full, there are [`[$max]`] liters of air in them. The amount of air left after [`t`] seconds would be [`[$max]-[$rate]t`] liters. + +Since we are interested in having at least [`[$left]`] liters of air left, we can write the inequality: + + [``[$max]-[$rate]t\geq[$left]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality130.pg new file mode 100644 index 0000000000..63acbe0257 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality130.pg @@ -0,0 +1,133 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Jordan 7/13/18 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','inequality','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitEquation.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitEquation"); +Context()->operators->add( + '>' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' > ', # output string for it + perl => '>', # perl string + }, + '<' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' < ', # output string for it + perl => '<', # perl string + }, + '>=' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' >= ', # output string for it + TeX => ' \geq ', + perl => '>=', # perl string + }, + '<=' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' <= ', # output string for it + TeX => ' \leq ', + perl => '<=', # perl string + }, +); +Context()->variables->are(m=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$start = random(10,100,10); +$rate = random(5,10,1); +$minute = random(10,30,1); +$max = $rate*$minute+$start; + +$ansString = "$start+$rate*m<=$max"; +Context()->variables->set(m=>{limits=>[$minute-10,$minute+10]}); +$ans = ImplicitEquation("$ansString"); +$evaluator = $ans->cmp( + checker => sub { + my ($correct,$student,$ansHash) = @_; + # check that the corresponding equality is correct + my $OK = not ImplicitEquation::compare($correct,$student); + return 0 unless $OK; + # what sign is used + my $sign = $student->{tree}->{bop}; + Value::Error('Write an inequality, not an equation.') if ($sign eq '='); + Value::Error('Your inequality is not using the correct sign.') if ($sign eq '<' or $sign eq '>'); + # distinguish between good/bad uses of >=/<= + my $left = Formula($student->{tree}->{lop})->eval(m=>0); + my $right = Formula($student->{tree}->{rop})->eval(m=>0); + $OK = ($sign eq '>=') ? ($left >= $right) : ($left <= $right); + Value::Error('Your inequality is not using the correct sign.') unless ($OK); + return $OK; + } + ); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A wading pool is being filled with water from a garden hose at a rate of [`[$rate]`] gallons per minute. If the pool already contains [`[$start]`] gallons of water and can hold up to [`[$max]`] gallons, set up an _inequality_ modeling how much time can pass without the pool overflowing. There is no need to solve it. + +[@KeyboardInstructions('Use [|m|]* for the variable. If you need to enter the inequality signs [`\leq`] or [`\geq`], type [|<=|]* or [|>=|]*.')@]** + + [_________________________]{$evaluator} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Assume [`m`] minutes have passed. Since the garden hose fills the pool at [`[$rate]`] gallons per minute, it can fill [`[$rate]m`] gallons in [`m`] minutes. Since there is [`[$start]`] gallons of water in the pool in the beginning, the amount of water in the pool after [`m`] minutes would be a total of [`[$start]+[$rate]m`]. + +Since we don't want the pool to overflow, we can write the inequality: + + [``[$start]+[$rate]m<=[$max]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality140.pg new file mode 100644 index 0000000000..e042e7dc1d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality140.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Modeling with a linear equation without solving it. +# +# Last updated: Jordan 7/13/18 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','inequality','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitEquation.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitEquation"); +Context()->operators->add( + '>' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' > ', # output string for it + perl => '>', # perl string + }, + '<' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' < ', # output string for it + perl => '<', # perl string + }, + '>=' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' >= ', # output string for it + TeX => ' \geq ', + perl => '>=', # perl string + }, + '<=' => { + class => 'Parser::BOP::equality', + precedence => $prec+.25, # just above comma + associativity => 'left', # computed left to right + type => 'bin', # binary operator + string => ' <= ', # output string for it + TeX => ' \leq ', + perl => '<=', # perl string + }, +); +Context()->variables->are(h=>"Real"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showExtraParens=>0); + +$diameter = random(5,15,1); +$radius = $diameter/2; +$radius2 = $radius**2; +$height = random(1,3,0.1); +$volume = int(pi*$radius2*$height); + + +$ansString = "$volume<=$radius2*pi*h"; +Context()->variables->set(h=>{limits=>[$height-10,$height+10]}); +$ans = ImplicitEquation("$ansString"); +$evaluator = $ans->cmp( + checker => sub { + my ($correct,$student,$ansHash) = @_; + # check that the corresponding equality is correct + my $OK = not ImplicitEquation::compare($correct,$student); + return 0 unless $OK; + # what sign is used + my $sign = $student->{tree}->{bop}; + Value::Error('Write an inequality, not an equation.') if ($sign eq '='); + Value::Error('Your inequality is not using the correct sign.') if ($sign eq '<' or $sign eq '>'); + # distinguish between good/bad uses of >=/<= + my $left = Formula($student->{tree}->{lop})->eval(h=>10); + my $right = Formula($student->{tree}->{rop})->eval(h=>10); + $OK = ($sign eq '>=') ? ($left >= $right) : ($left <= $right); + Value::Error('Your inequality is not using the correct sign.') unless ($OK); + return $OK; + } + ); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +An engineer is designing a cylindrical springform pan (the kind of pan a cheesecake is baked in). The pan needs to be able to hold a volume at least [`[$volume]`] cubic inches and have a diameter of [`[$diameter]`] inches. Write an _inequality_ modeling possible height of the pan. There is no need to solve it. + +[@KeyboardInstructions('Use [|m|]* for the variable. If you need to enter the inequality signs [`\leq`] or [`\geq`], type [|<=|]* or [|>=|]*. Use *pi* to represent [`\pi`].?)@]** + + [_________________________]{$evaluator} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the pan's height is [`h`] inches. A cylinder's volume formula has [`r`], representing radius. We first need to calulate the radius from the given diameter: + + [`` r = \frac{d}{2} = \frac{[$diameter]}{2} = [$radius] ``] + +Now we can substitute given numbers into a cylinder's volume formula, we have: + + [`` +\begin{aligned} + V &= \pi r^2h \\ + [$volume] &= \pi([$radius])^2h \\ + [$volume] &= [$radius2]\pi h +\end{aligned} + ``] + +Since the volume could be greater than [`[$volume]`], we have the inequality: + + [`` [$volume] \le [$radius2]\pi h ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease10.pg new file mode 100644 index 0000000000..f63caa680d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease10.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find percent of increase word problem. +# +# Last updated: Yao 12/21/13, Jordan 7/23/13; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','increase','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "contextPercent.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$original = random(10,80,1); +$increase = random(5,20,1); +$new = $original+$increase; +$ansP = $increase/$original*100; +$ansShow = sprintf("%.2f",$ansP); + +Context("LimitedPercent-strict"); +Context()->flags->set( + noExtraDecimals => 0, + trimTrailingZeros => 1, + decimalPlaces => 4, + tolerance => .005, +); +$ans = Compute("$ansP %"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The population of cats in a shelter increased from [`[$original]`] to [`[$new]`]. What is the percentage increase? + + The percentage increase is [________]{$ans}. + +END_PGML + +############################################## + +$s1 = $new/$original; +$s2 = sprintf("%.2f", $s1*100); + +$connector = '='; +if (round($ans->value*10000)!=($ans->value*10000)) { + $connector = '\approx'; +}; + +BEGIN_PGML_SOLUTION + +####Method 1 + +To calculate the percentage increase/decrease, first we find the _amount_ of increase/decrease +by doing a simple subtraction calculation, +and then we find the _percentage_ increase/decrease. + +In this problem, the amount of increase is [`[$new]-[$original]`], which is [`[$increase]`]. + +Next, since we started with [`[$original]`] cats, we need to ask: [`[$increase]`] is what percent of [`[$original]`]? + +Let the increase [`[$increase]`] be [`x`] (as a percent) of [`[$original]`]. That means: + + [`` +\begin{aligned} + [$increase] &= x \cdot [$original] \\ + \frac{[$increase]}{[$original]} &= \frac{x \cdot [$original]}{[$original]} \\ + [$ansP/100] & [$connector] x\\ + x &[$connector] [$ansShow]%\\ +\end{aligned} + ``] + +There has been a [`[$ansShow]%`] increase in cats at the shelter. + +####Method 2 + +We first divide the "new number" by the "original number": + + [`` \frac{[$new]}{[$original]} [$connector] [$s1] [$connector] [$s2]% ``] + +So the new number is approximately [`[$s2]%`] of the original number, implying the percentage increase is approximately [` [$s2]% - 100% = [$ansShow]% `]. + +There has been a [`[$ansShow]%`] increase in cats at the shelter. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease20.pg new file mode 100644 index 0000000000..845b87bc48 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease20.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find percent of decrease word problem. +# +# Last updated: Yao 12/21/13, Jordan 7/23/13; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','decrease','application','subtract','divide') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl",, + "contextPercent.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +$new=random(10,80,1); +$decrease = random(10,20,1); +$original= $new + $decrease; +$ansP = $decrease/$original*100; +$ansShow = sprintf("%.2f",$ansP); + +Context("LimitedPercent-strict"); +Context()->flags->set( + noExtraDecimals => 0, + trimTrailingZeros => 1, + decimalPlaces => 4, + tolerance => .005, +); +$ans = Compute("$ansP %"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The population of cats in a shelter decreased from [`[$original]`] to [`[$new]`]. What is the percentage decrease? + + The percentage decrease is [________]{$ans}. + +END_PGML + +############################################## + +$s1 = $new/$original; +$s2 = sprintf("%.2f", $s1*100); + +$connector = '='; +if (round($ans->value*10000)!=($ans->value*10000)) { + $connector = '\approx'; +}; + +BEGIN_PGML_SOLUTION + +####Method 1 + +To calculate the percentage increase/decrease, first we find the _amount_ of increase/decrease +by doing a simple subtraction calculation, +and then we find the _percentage_ increase/decrease. + +In this problem, the amount of decrease is [`[$original]-[$new]=[$decrease]`]. + +Next, since we started with [`[$original]`] cats, we need to ask: [`[$decrease]`] is what percent of [`[$original]`]? + +Let the decrease [`[$decrease]`] be [`x`] (as a percent) of [`[$original]`]. That means: + + [`` +\begin{aligned} + [$decrease] &= x \cdot [$original] \\ + \frac{[$decrease]}{[$new]} &= \frac{x \cdot [$original]}{[$original]} \\ + [$ansP/100] & [$connector] x\\ + x &[$connector] [$ansShow] % \\ +\end{aligned} + ``] + +There has been a [`[$ansShow]%`] decrease in cats at the shelter. + +####Method 2 + +We first divide the "new number" by the "original number": + + [`` \frac{[$new]}{[$original]} [$connector] [$s1] [$connector] [$s2]% ``] + +So the new number is approximately [`[$s2]%`] of the original number, implying the percentage decrease is approximately [` 100% - [$s2]% = [$ansShow]% `]. + +There has been a [`[$ansShow]%`] decrease in cats at the shelter. +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease30.pg new file mode 100644 index 0000000000..08977602a8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease30.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Percent of increase/decrease word problem. +# First increase, then decrease the same amount. +# +# Last updated: Jordan 7/23/13; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','decrease','increase','application','subtract','multiply') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->operators->undefine('+','-'); + +$r = random(1,5,1); +$s = random(30000,50000,1000); +$ans1 = $s+$r*$s/100; +$ans2 = $ans1-$ans1*$r/100; + +$cs = Currency($s); +$cans1 = Currency($ans1); +$cans2 = Currency($ans2); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Your salary used to be [`[$cs]`] per year. + + You earned a [`[$r]%`] raise. After the raise, your salary was [___________]{$cans1} per year. + + Then, you had to take a [`[$r]%`] pay cut. After the cut, your salary was [___________]{$cans2} per year. + +END_PGML + +############################################## + +$s1 = $r/100; + +BEGIN_PGML_SOLUTION + +Your original salary was [`[$cs]`] per year. A [`[$r]%`] raise implies a raise of + + [`` [$s1] \cdot [$cs] = [$s1*$cs] ``] + +After the raise, your salary became [` [$cs]+[$s1*$cs] = [$cans1] `] per year. + +Next, a [`[$r]%`] pay cut implies a cut of + + [`` [$s1] \cdot [$cans1] = [$s1*$cans1] ``] + +After the cut, your salary became [` [$cans1]-[$s1*$cans1] = [$cans2] `] per year. + +After a raise and a cut of the same rate, your salary decreased! This is because the percentage raise was based on a smaller salary, +while the percentage cut was based on a bigger salary (after the raise). + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease40.pg new file mode 100644 index 0000000000..585587045e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease40.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Percent of increase/decrease word problem. +# First decrease, then increase the same amount. +# +# Last updated: Jordan 7/23/13; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','decrease','increase','application','multiply','subtract') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->operators->undefine('+','-'); + +$r = random(1,5,1); +$s = random(30000,50000,1000); +$ans1 = $s-$r*$s/100; +$ans2 = $ans1+$ans1*$r/100; + +$cs = Currency($s); +$cans1 = Currency($ans1); +$cans2 = Currency($ans2); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Your salary used to be [`[$cs]`] per year. + +You had to take a [`[$r]%`] pay cut. After the cut, your salary was [___________]{$cans1} per year. + +Then, you earned a [`[$r]%`] raise. After the raise, your salary was [___________]{$cans2} per year. + +END_PGML + +############################################## + +$s1 = $r/100; + + +BEGIN_PGML_SOLUTION + +Your original salary was [`[$cs]`] per year. A [`[$r]%`] pay cut implies a cut of + + [`` [$s1] \cdot [$cs] = [$s1*$cs] ``] + +After the cut, your salary became [` [$cs]-[$s1*$cs] = [$cans1] `] dollars per year. + +Next, a [`[$r]%`] raise implies a raise of + + [`` [$s1] \cdot [$cans1] = [$s1*$cans1] ``] + +After the raise, your salary became [` [$cans1]+[$s1*$cans1] = [$cans2] `] per year. + +After a cut and a raise of the same rate, your salary decreased! This is because the rate of cut was based on a bigger salary, while the rate of raise was based on a smaller salary (after the cut). + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease50.pg new file mode 100644 index 0000000000..f52a111c4d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease50.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Percent of increase word problem. +# The increase is more than 100%. +# +# Last updated: Yao 12/21/13, Jordan 7/13/23; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','increase','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextPercent.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$original = random(11,19,1); +$increase = 2*$original+random(5,10,1); +$new = $original+$increase; +$ansP = $increase/$original*100; +$ansShow = sprintf("%.2f",$ansP); + +Context("LimitedPercent-strict"); +Context()->flags->set( + noExtraDecimals => 0, + trimTrailingZeros => 1, + decimalPlaces => 4, + tolerance => .005, +); +$ans = Compute("$ansP %"); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$modify = 'his' if ($sex eq 'male'); +$modify = 'her' if ($sex eq 'female'); + +$name = RandomName(sex=>$sex); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] used to make [`[$original]`] dollars per hour. After [$pronoun] earned [$modify] Bachelor's degree, +[$modify] pay rate increased to [`[$new]`] dollars per hour. What is the percentage increase in [$name]'s salary? + + The percentage increase is [________]{$ans}. + + +END_PGML + +############################################## + +$s1 = $new/$original; +$s2 = sprintf("%.2f", $s1*100); + +$connector = '='; +if (round($ans->value)!=($ans->value)) { + $connector = '\approx'; +}; + +BEGIN_PGML_SOLUTION + +####Method 1 + +To calculate the percentage increase/decrease, first we find the amount of increase/decrease by doing a simple subtraction calculation, +and then we find the percentage increase/decrease. + +In this problem, the amount of increase is [`[$new]-[$original]=[$increase]`]. + +Since [$name]'s pay rate was initially [`[$original]`], we need to ask: [`[$increase]`] is what percent of [`[$original]`]? + +Let the increase [`[$increase]`] be [`x`] (as a percent) of [`[$original]`]. That means: + + [`` +\begin{aligned} + [$increase] &= x \cdot [$original] \\ + \frac{[$increase]}{[$original]} &= \frac{x \cdot [$original]}{[$original]} \\ + [$ansP/100] & [$connector] x\\ + x &[$connector] [$ansShow]%\\ +\end{aligned} + ``] + +[$name] had a [`[$ansShow]%`] increase in [$modify] pay rate. + +####Method 2 + +We first divide the "new number" by the "original number": + + [`` \frac{[$new]}{[$original]} [$connector] [$s1] [$connector] [$s2]% ``] + +So the new number is approximately [`[$s2]%`] of the original number, implying the percentage increase is approximately [` [$s2]% - 100% = [$ansShow]% `]. + +[$name] had a [`[$ansShow]%`] increase in [$modify] pay rate. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease60.pg index 990867c458..edef656003 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease60.pg @@ -7,16 +7,18 @@ # Last updated: Yao 12/21/13, Jordan 7/23/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(percents_IncrDecr_direct2) -## Level(3) -## MO(1) ## KEYWORDS('percent','increase','application','subtract','divide') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -94,7 +96,7 @@ Let the decrease [`[$decrease]`] be [`x`] (as a percent) of [`[$original]`]. Tha \end{aligned} ``] -*Solution:* There has been a [`[$ansShow]%`] decrease in customers over this three-year period. +There has been a [`[$ansShow]%`] decrease in customers over this three-year period. ####Method 2 @@ -104,7 +106,7 @@ We first divide the "new number" by the "original number": So the new number is approximately [`[$s2]%`] of the original number, implying the percentage decrease is approximately [` 100% - [$s2]% = [$ansShow]% `]. -*Solution:* There has been a [`[$ansShow]%`] decrease in customers over this three-year period. +There has been a [`[$ansShow]%`] decrease in customers over this three-year period. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease70.pg new file mode 100644 index 0000000000..c9348373ee --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease70.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Percent of increase word problem. +# Given the amount after an increase of some percent, +# find original amount. +# +# Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','increase','application','divide') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$ans = random(100,990,100); +$p = random(10,90,10); +$a = $ans*(1+$p/100); + +Context("LimitedNumeric"); +$ans = Compute($ans); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +After a [`[$p]%`] increase, a town has [`[$a]`] people. What was the population before the increase? + + Before the increase, the town's population was [_______]{$ans}. + +END_PGML + +############################################## + +$s1 = $p/100; +$s2 = 1+$s1; + +BEGIN_PGML_SOLUTION + +Let the town's original population be [`x`]. + +A [`[$p]%`] increase implies the town's population increased by [`[$s1]x`] people. This implies, after the increase, the town's population became [`x+[$s1]x`], which is [`[$s2]x`]. + +Now we can set up an equation: + + [` +\begin{aligned} + [$s2]x &= [$a] \\ + \frac{[$s2]x}{[$s2]} &= \frac{[$a]}{[$s2]} \\ + x &= [$ans] +\end{aligned} + `] + +The town's population was [`[$ans]`] before the increase. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease80.pg index d21b6b845b..0b88a87a89 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease80.pg @@ -8,15 +8,18 @@ # Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) ## KEYWORDS('percent','increase','application','divide','add') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PCCmacros.pl", + "PCCmacros.pl",, "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease90.pg new file mode 100644 index 0000000000..e28670d8c5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease90.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Percent of decrease word problem. +# Given the amount after a decrease of some percent, +# find original amount. +# +# Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','decrease','application','subtract','divide') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->operators->undefine('+','-'); + +$ans = random(50,200,10); +$p = random(10,90,10); +$a = $ans*(1-$p/100); + +$ca = Currency($a); +$cans = Currency($ans); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A sweater is on sale for [`[$p]%`] off. The sale price is [`[$ca]`]. What is the original price? + + The original price is [_____________]{$cans}. + +END_PGML + +############################################## + +$s1 = $p/100; +$s2 = 1-$s1; + +BEGIN_PGML_SOLUTION + +Let the sweater's original price be [`x`]. + +A [`[$p]%`] off sale implies that the sweater's price has decreased by [`[$s1]x`] dollars. This means that after the price decrease, the sweater's price became [`x-[$s1]x=[$s2]x`] dollars. + +Now we can set up an equation: + + [` +\begin{aligned} + [$s2]x &= [$a] \\ + \frac{[$s2]x}{[$s2]} &= \frac{[$a]}{[$s2]} \\ + x &= [$ans] +\end{aligned} + `] + +The sweater's original price is [`[$cans]`] before the discount is applied. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem10.pg index 678a04e874..f573508f66 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem10.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 7/26/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) ## KEYWORDS('percent','interest','application','multiply') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem20.pg index 39fbe2e034..9ca8bf8d5a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem20.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 7/26/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Financial mathematics) -## DBchapter(Interest) -## DBsection(Simple interest) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) ## KEYWORDS('percent','interest','application','multiply') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem30.pg index 89359650e1..41e5a36c1a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem30.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 7/26/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(population_number_answer) -## Level(3) -## MO(1) ## KEYWORDS('percent','application','multiply') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem40.pg new file mode 100644 index 0000000000..a877d7fbac --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem40.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Percent word problem: Find 23% of 67. +# +# Last updated: Jordan 7/26/13; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','application','multiply') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$s = random(11,99,1); +$p = random(2,4,2)*10+random(1,9,2); +$ans = $p/100*$s; + +Context("LimitedNumeric"); + +$s1=$p/100; +$s2=$s1*$s; + +$s = NumberWithUnits("$s g"); +$ans = NumberWithUnits("$ans g"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A kind of liquor contains [`[$p]%`] alcohol. If the liquor in the bottle weighs [`[$s]`] (not including the bottle's weight), +how many grams of pure alcohol is in this bottle? + + There are [_________]{$ans} of pure alcohol in this bottle. + +END_PGML + +############################################## + + + +BEGIN_PGML_SOLUTION + +This translation from English to math may help you remember the percentage formula. + + [` 2 \text{ is } 50% \text{ of } 4 \iff 2 = 0.5 \cdot 4 `] + +For this problem, we have been asked: + + What is [`[$p]`] [`%`] of [`[$s]`]? + +We find [`x`] using + + [`` + \begin{aligned} + x & = [$s1] \cdot [$s] \\ + & = [$ans] + \end{aligned}``]. + +There are [`[$ans]`] of pure alcohol in this bottle. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem50.pg new file mode 100644 index 0000000000..b9a577b17e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem50.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Percent word problem: Find 2.3% of 67. +# +# Last updated: Jordan 7/26/13; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','application','multiply') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$s = random(101,999,1); +$p = random(1,3,1)+random(2,8,1)/10; +$ans = $p*$s/100; + +$s1=$p/100; +$s2=$s1*$s; + +Context("LimitedNumeric"); + + +$s = NumberWithUnits("$s g"); +$ans = NumberWithUnits("$ans g"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A saline is a salt solution. A kind of saline contains [`[$p]%`] salt. A lab technician measured out [`[$s]`] of saline. How much pure salt does this saline contain? + + The saline contains [_________]{$ans} of pure salt. + + +END_PGML + +############################################## + + + +BEGIN_PGML_SOLUTION + +This translation from English to math may help you remember the percentage formula. + + [` 2 \text{ is } 50% \text{ of } 4 \iff 2 = 0.5 \cdot 4 `] + +For this problem, we have been asked: + + What is [`[$p]`] [`%`] of [`[$s]`]? + +We find [`x`] using + + [`` + \begin{aligned} + x & = [$s1] \cdot [$s]\\ + & = [$ans] \\ + \end{aligned} ``] + +There are [`[$ans]`] of pure alcohol in this bottle. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem60.pg new file mode 100644 index 0000000000..759bc27a35 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem60.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Percent word problem: After a 2.3% loss, an account has +# $23456 in it. What was the amount before the loss? +# +# Last updated: Jordan 7/26/13; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','application','multiply','divide','subtract') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->operators->undefine('+','-'); + +$ans = random(50000,90000,1000); +$p = random(5,9,1)+random(1,9,1)/10; +$a = $ans*(1-$p/100); + +$ca = Currency($a); +$cans = Currency($ans); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$modify = 'his' if ($sex eq 'male'); +$modify = 'her' if ($sex eq 'female'); + +$name = RandomName(sex=>$sex); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Last year, [$name]'s retirement account lost [`[$p]%`] in value. +Right now [$pronoun] has [`[$ca]`] dollars in [$modify] account. +How much money did [$name] have before the loss? + + Last year the balance was [____________]{$cans}. + +END_PGML + +############################################## + +$s1 = $p/100; +$s2 = 1-$s1; + +BEGIN_PGML_SOLUTION + +Suppose [$name] had [`x`] dollars in [$modify] account before the loss. + +A [`[$p]%`] loss implies the account's value decreased by [`[$s1]x`] dollars. This implies that after the loss the account had [`x-[$s1]x=[$s2]x`] dollars. + +Now we can set up an equation: + + [` +\begin{aligned} + [$s2]x &= [$a] \\ + \frac{[$s2]x}{[$s2]} &= \frac{[$a]}{[$s2]} \\ + x &= [$ans] +\end{aligned} + `] + +[$name] had [`[$cans]`] in [$modify] retirement account before the loss. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem70.pg new file mode 100644 index 0000000000..e219fbe4cb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem70.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Percent word problem: With a 15% tip, the total charge is $115. +# Find the original charge. +# +# Last updated: Jordan 7/26/13; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','application','add','multiply','divide') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->operators->undefine('+','-'); + +$ans = random(50,100,10); +$a = random(10,20,1); +$b = (1+$a/100)*$ans; + +$cb = Currency($b); +$cans = Currency($ans); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$modify = 'his' if ($sex eq 'male'); +$modify = 'her' if ($sex eq 'female'); + +$name = RandomName(sex=>$sex); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] left a [`[$a]%`] tip for [$modify] dinner out. The total charge including the tip was [`[$cb]`]. How much was the dinner bill without including the tip? + + Without including the tip, the dinner bill was [___________]{$cans}. + +END_PGML + +############################################## + +$s1 = $a/100; +$s2 = 1+$s1; + +BEGIN_PGML_SOLUTION + +Let the dinner bill (without including the tip) be [`x`] dollars. + +A [`[$a]%`] tip implies the tip was [`[$s1]x`] dollars. So the total charge including the tip was [`x+[$s1]x`] dollars, which is [`[$s2]x`] dollars. + +Now we can set up an equation: + + [` +\begin{aligned} + [$s2]x &= [$b] \\ + \frac{[$s2]x}{[$s2]} &= \frac{[$b]}{[$s2]} \\ + x &= [$ans] +\end{aligned} + `] + +Without including the tip, the dinner bill was [`[$cans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem80.pg new file mode 100644 index 0000000000..a416d2a80d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem80.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Percent word problem: A person earns 5% bonus. To earn $1000 bonus, +# how much does he/she have to sell? +# +# Last updated: Jordan 7/26/13; Hughes 7/3/13, Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent','application','multiply','divide') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->operators->undefine('+','-'); + +$ans = random(50000,70000,1000); +$a = random(5,10,1)+random(1,9,1)/10; +$b = $a/100*$ans; + +$cb = Currency($b); +$cans = Currency($ans); + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); +$modify = 'his' if ($sex eq 'male'); +$modify = 'her' if ($sex eq 'female'); + +$name = RandomName(sex=>$sex); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] sells cars, and earns [`[$a] %`] commission for each car [$pronoun] sells. Last month, [$name] earned [`[$cb]`] in commisions. How much did [$pronoun] sell? + + [$name] had [___________]{$cans} in sales last month. + +END_PGML + +############################################## + +$s1 = $a/100; + +BEGIN_PGML_SOLUTION + +Suppose that [$name]'s total sales were [`x`] dollars last month. + +A [`[$a]%`] commission implies the commission was [`[$s1]x`] dollars. + +Now we can set up an equation: + + [` +\begin{aligned} + [$s1]x &= [$b] \\ + \frac{[$s1]x}{[$s1]} &= \frac{[$b]}{[$s1]} \\ + x &= [$ans] +\end{aligned} + `] + +[$name] had [`[$cans]`] in sales last month. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem90.pg index 61617f1c77..7323a115d0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/PercentWordProblem90.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 7/26/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(population_number_answer) -## Level(3) -## MO(1) ## KEYWORDS('percent','application','multiply','divide') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ## COMMENT('Can the message be customized: ',' is not defined in this context') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem10.pg new file mode 100644 index 0000000000..892987865b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem10.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write proportion equations to solve word problems. +# +# Last updated: Jordan 8/4/13; Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + + +Context("LimitedNumeric"); + +$a = random(30,40,2); +$ap = NumberWithUnits($a, "lb"); + +$factor=list_random(4 .. 9); +$c = $a*$factor; +$cp = NumberWithUnits($c, "lb"); + +$b = random(5,9,1); +while (gcd($b,$a)!=1) {$b = random(5,9,1);} + +$ans = $b*$c/$a; + + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A restaurant uses [`[$ap]`] of vegetable oil every [`[$b]`] days. How many days will [`[$cp]`] of oil last? + + [`[$cp]`] of oil will last [_____]{$ans} days. + +END_PGML + +############################################## + +$s1 = $b*$c; + +BEGIN_PGML_SOLUTION + +This restaurant uses [`[$ap]`] of oil _per_ [`[$b]`] days. So we should consider ratios of the form [`\frac{A \textrm{ lbs}}{B \textrm{ days}}`]. + +One such ratio describes the restaurant's usage over [`[$b]`] days: [`\frac{[$ap]}{[$b]\textrm{ days}}`]. + +Another such ratio describes the restaurant's usage over some unknown number of days, when it will use a total of [`[$cp]`]: [`\frac{[$cp]}{x\textrm{ days}}`]. + +Now we may set up and solve a proportion: + + [`` +\begin{aligned} + \frac{[$a]}{[$b]} &= \frac{[$c]}{x} \\ + 7x\cdot\frac{[$a]}{[$b]} &= 7x\cdot\frac{[$c]}{x} \\ + x\cdot[$a]&= [$b] \cdot [$c] \\ + [$a]x &= [$s1] \\ + \frac{[$a]x}{[$a]} &= \frac{[$s1]}{[$a]} \\ + x &= [$ans] +\end{aligned} +``] + +So [`[$cp]`] of oil will last [`[$ans]`] days. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem100.pg index 1edc164d85..17e2bd1c26 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem100.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/4/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(UseSlopeToFindValue4) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem110.pg index 8b6e556fbe..954191f187 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem110.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/4/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(UseSlopeToFindValue4) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem120.pg new file mode 100644 index 0000000000..87cda76145 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem120.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write proportion equations to solve word problems. +# +# Last updated: Jordan 8/4/13; Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a = random(101,199,1); + +$d = random(201,299,1); + +$c = random(11,29,1); +while (($d % $c) ==0) {$c = random(11,29,1);} + +$ans = $a*$d/$c; +$wholenumberans = sprintf("%.0f", $ans); + + +$ans=Compute($wholenumberans); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A biologist wants to estimate the number of fish living in a lake. She caught [`[$a]`] fish, tagged each one, and then released them back into the lake. After a few days, she caught [`[$d]`] fish, and found that [`[$c]`] of them were tagged. Use a proportion to estimate the number of fish living in this lake. + + There are approximately [__________]{$ans} fish living in the lake. + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +We have been asked to use a proportion, so we should consider ratios. We have ratios of the form: [`\frac{\text{tagged fish}}{\text{total tagged and untagged fish}}`]. + +In the whole lake, we know that there are [`[$a]`] tagged fish, but we do not yet know how many total fish there are. So the ratio describing the entire lake is: [`\frac{[$a]\text{ tagged fish}}{x\text{ total tagged and untagged fish}}`]. + +The second time she went fishing, the ratio was: [`\frac{[$c]\text{ tagged fish}}{[$d]\text{ total tagged and untagged fish}}`] + +These ratios should roughly be equal to each other unless there was something unlucky about the way she caught her second batch of fish. So we set up and solve a proportion. + + [`` +\begin{aligned} + \frac{[$a]}{x} &\approx \frac{[$c]}{[$d]} \\ + [$d]x\cdot\frac{[$a]}{x} &\approx [$d]x\cdot\frac{[$c]}{[$d]} \\ + [$d] \cdot [$a] &\approx x \cdot [$c] \\ + [$d*$a] &\approx [$c]x \\ + \frac{[$d*$a]}{[$c]} &\approx \frac{[$c]x}{[$c]} \\ + [$ans] &\approx x\\ + x &\approx [$ans] +\end{aligned} +``] + +So there are approximately [`[$wholenumberans]`] fish living in the lake. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem20.pg new file mode 100644 index 0000000000..130cdf8d1b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem20.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write proportion equations to solve word problems. +# +# Last updated: Jordan 8/4/13; Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$b = random(12,19,1); + +$factor=list_random((4 .. 9)); +$d = $b*$factor; +$a = random(80,99,1); +$ap = NumberWithUnits($a, "lb"); + +$ans = $a*$d/$b; + + +$anslb=NumberWithUnits($ans, "lb"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A restaurant uses [`[$ap]`] of vegetable oil every [`[$b]`] days. To plan for [`[$d]`] days, how much vegetable oil does the restaurant need to purchase (at a minimum)? + + The restaurant needs to purchase at least [__________]{$anslb} of vegetable oil. + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +This restaurant uses [`[$ap]`] of oil _per_ [`[$b]`] days. So we should consider ratios of the form [`\frac{A \textrm{ lbs}}{B \textrm{ days}}`]. + +One such ratio describes the restaurant's usage over [`[$b]`] days: [`\frac{[$ap]}{[$b]\textrm{ days}}`]. + +Another such ratio describes the restaurant's usage over [`[$d]`] days, when it will use some unknown amount of vegetable oil: [`\frac{x\textrm{ lb}}{[$d]\textrm{ days}}`]. + +Now we may set up and solve a proportion: + + [`` +\begin{aligned} + \frac{[$a]}{[$b]} &= \frac{x}{[$d]} \\ + [$b]\cdot[$d]\cdot\frac{[$a]}{[$b]} &= [$b]\cdot[$d]\cdot\frac{x}{[$d]} \\ + [$d] \cdot [$a] & = [$b] \cdot x \\ + [$a*$d] &= [$b]x \\ + \frac{[$a*$d]}{[$b]} &= \frac{[$b]x}{[$b]} \\ + [$ans] & = x\\ + x &= [$ans] +\end{aligned} +``] + +So the restaurant needs to purchase at least [`[$anslb]`] of vegetable oil. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem30.pg index 88c5ba1174..4e9ba5a009 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem30.pg @@ -6,17 +6,18 @@ # Last updated: Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Ratio/proportions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(use1valuechange_findothervalue) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem40.pg index 48db559de7..dbb3a330ad 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem40.pg @@ -6,16 +6,18 @@ # Last updated: Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Ratio/proportions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(use1valuechange_findothervalue) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem50.pg index 3f3630856c..6241287116 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem50.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/4/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Ratio/proportions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(use1valuechange_findothervalue) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem60.pg index 39df8d4596..e2023515b7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem60.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/4/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Ratio/proportions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(use1valuechange_findothervalue) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem70.pg index f0dc811f11..3186582eb0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem70.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/4/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(UseSlopeToFindValue4) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGML.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem80.pg index 20da6fbbd3..40e9870eaf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem80.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/4/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(UseSlopeToFindValue4) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem90.pg index 2a974635c6..b3fe0559c0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/ProportionWordProblem90.pg @@ -6,17 +6,18 @@ # Last updated: Jordan 8/4/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(UseSlopeToFindValue4) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/Ratio10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/Ratio10.pg index 6ee0b8dce4..d0647eb33b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/Ratio10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/Ratio10.pg @@ -6,15 +6,18 @@ # Last updated: Jordan 8/4/13; Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.RP.1','6.RP.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Ratio/proportions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','ratio') +## DBCCSS('6.RP.1','6.RP.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +28,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## @@ -78,7 +82,7 @@ BEGIN_PGML_SOLUTION [`[$c]`] to [`[$factor]`] translates to the fraction [`\frac{[$c]}{[$factor]}`], which reduces to [`\frac{[$ans3]}{1}`]. Note we are intentionally not reducing this to an integer because we want to represent the number as a fraction. -[`[$factor]`] to [`[$c]`] translates to the fraction [`\frac{[$factor]}{[$c]}`], which reduces to [`[$ans1]`]. +[`[$factor]`] to [`[$c]`] translates to the fraction [`\frac{[$factor]}{[$c]}`], which reduces to [`[$ans4]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/Ratio20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/Ratio20.pg new file mode 100644 index 0000000000..3799d035e8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/Ratio20.pg @@ -0,0 +1,213 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Given quantities, find ratios. +# +# Last updated: Jordan 8/6/13; Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate','ratio') +## DBCCSS('6.RP.1','6.RP.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", +, + "PGcourse.pl", +); + + +############################################## + + +Context("LimitedFraction"); + + +Context()->flags->set(showMixedNumbers=>0); +#Context()->flags->set(reduceFractions=>0); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->flags->set(formatStudentAnswer=>"parsed"); + +$c = random(5,20,5); + +$f1 = list_random((2,3,5,7)); +$f2 = list_random((2,3,5,7)); +while ($f2==$f1) {$f2 = list_random((2,3,5,7));} + +$a = $c*$f1; +$b = $c*$f2; + +$ans1 = Compute("$a/$b")->reduce; +$fra2 = Compute("$b/$c")->reduce; +$fra3 = Compute("$c/$a")->reduce; + + +package my::Fraction::BOP::ratio; +our @ISA = ('Parser::BOP::divide'); + +# +# Create a Fraction or Real from the given data +# +sub _eval { + my $self = shift; my $context = $self->{equation}{context}; + return $_[0]/$_[1] if Value::isValue($_[0]) || Value::isValue($_[1]); + my $n = $context->Package("Fraction")->make($context,@_); + $n->{isHorizontal} = 1 if $self->{def}{noFrac}; + return $n; +} + +# +# When strictFraction is in effect, only allow division +# with integers and negative integers +# +sub _check { + my $self = shift; + $self->SUPER::_check; + return unless $self->context->flag("strictFractions"); + $self->Error("The numerator of a fraction must be an integer") + unless $self->{lop}->class =~ /INTEGER|MINUS/; + $self->Error("The denominator of a fraction must be a (non-negative) integer") + unless $self->{rop}->class eq 'INTEGER'; + $self->Error("The numerator must be less than the denominator in a proper fraction") + if $self->context->flag("requireProperFractions") && CORE::abs($self->{lop}->eval) >= CORE::abs($self->{rop}->eval); +} + +# +# Reduce the fraction, if it is one, otherwise do the usual reduce +# +sub reduce { + my $self = shift; + return $self->SUPER::reduce unless $self->class eq 'FRACTION'; + my $reduce = $self->{equation}{context}{reduction}; + return $self->{lop} if $self->{rop}{isOne} && $reduce->{'x/1'}; + $self->Error("Division by zero"), return $self if $self->{rop}{isZero}; + return $self->{lop} if $self->{lop}{isZero} && $reduce->{'0/x'}; + if ($reduce->{'a/b'}) { + my ($a,$b) = context::Fraction::reduce($self->{lop}->eval,$self->{rop}->eval); + if ($self->{lop}->class eq 'INTEGER') {$self->{lop}{value} = $a} else {$self->{lop}{op}{value} = -$a} + $self->{rop}{value} = $b; + } + return $self; +} + +sub TeX { + my $self = shift; my $bop = $self->{def}; + my ($a,$b) = ($self->{lop}->TeX, $self->{rop}->TeX); + return "$a : $b" +} + +# +# Indicate if the value is a fraction or not +# +sub class { + my $self = shift; + return "FRACTION" if $self->{lop}->class =~ /INTEGER|MINUS/ && + $self->{rop}->class eq 'INTEGER'; + return $self->SUPER::class; +} + +package main; + + + + +Context("LimitedFraction"); +Context()->flags->set(formatStudentAnswer=>'parsed',showMixedNumbers=>0); + +$prec = Context()->operators->get('/')->{precedence}; + +Context()->operators->add( + ':' => { + class => 'my::Fraction::BOP::ratio', + precedence => $prec, + associativity => 'left', + type => 'bin', + string => ' : ', + TeX => '\mathbin{\colon}', + } + ); +Context()->operators->undefine('/', ' /', '/ ', '//'); + + +$ans2 = Fraction($b,$c); +$ans3 = Fraction($c,$a); + +($num2, $den2) = $ans2->value; +($num3, $den3) = $ans3->value; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A child has [`[$a]`] red pin balls, [`[$b]`] blue pin balls, and [`[$c]`] green pin balls. + +Write the ratio of red to blue pin balls as a reduced fraction. + + [_____________]{$ans1} + +Write the reduced ratio of blue to green pin balls in ratio notation (with a colon). + + [_____________] + +Write the reduced ratio of green to red pin balls in ratio notation (with a colon). + + [_____________] + +END_PGML + +ANS($ans2->cmp( + requireFraction=>1, + cmp_class=>'ratio in ratio notation', + correct_ans_latex_string=>"$num2 : $den2" + )->withPostFilter( + sub { + my $ans = shift; + $ans->{ans_message} = "Your ratio is not reduced" + if $ans->{ans_message} eq "Your fraction is not reduced"; + return $ans; +})); + +ANS($ans3->cmp( + requireFraction=>1, + cmp_class=>'ratio in ratio notation', + correct_ans_latex_string=>"$num3 : $den3" + )->withPostFilter( + sub { + my $ans = shift; + $ans->{ans_message} = "Your ratio is not reduced" + if $ans->{ans_message} eq "Your fraction is not reduced"; + return $ans; +})); + +############################################## + +BEGIN_PGML_SOLUTION + +The ratio of red to blue pin balls in fraction notation is [` \frac{[$a]}{[$b]} `] whcih reduces to [`[$ans1] `]. + +The ratio of blue to green pin balls is [` \frac{[$b]}{[$c]}`] which reduces to [`\frac{[$fra2]}{1} `]. In ratio notation, it is [`[$num2] \colon [$den2]`]. + +The ratio of green to red pin balls is [` \frac{[$c]}{[$a]}`] which reduces to [`[$fra3] `]. In ratio notation, it is [`[$num3] \colon [$den3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem10.pg new file mode 100644 index 0000000000..caba83baac --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem10.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Read a word problem. Write an equation and solve for unknown. +# Given the sum and the relationship between two parts, +# find each part's value. +# +# Last updated: Jordan 8/28/13; Kling, 7/21/13; Wherry, 7/03/13, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','add','combine','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "unorderedAnswer.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$total = random(100,200,2); +$dif = random(10,30,2); +$ansShort = ($total-$dif)/2; +$dif1 = NumberWithUnits($dif,'m'); +$ansShort1 = NumberWithUnits($ansShort,'m'); +$ansLong = $total-$ansShort; +$ansLong1 = NumberWithUnits($ansLong,'m'); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A [`[$total]`]-meter rope is cut into two segments. The longer segment is [`[$dif]`] meters longer than the shorter segment. Write and solve a linear equation to find the length of each segment. Include units. + + The segments are [_______] and [_______] long. + +END_PGML + +UNORDERED_ANS( +$ansShort1->cmp(), +$ansLong1->cmp() +); + +############################################## + +$s1 = $total-$dif; + +BEGIN_PGML_SOLUTION + +Let the shorter segment be [`x`] meters long. Then, the longer segment is [`x+[$dif]`] meters long. + +Since their total length is [$total] meters, we can write an equation: + + [`` x+x+[$dif]=[$total] ``] + +Next, we solve for [`x`]: + + [` +\begin{aligned} + x+x+[$dif] &\;=\; [$total] \\ + 2x+[$dif] &\;=\; [$total] \\ + 2x+[$dif] \mathbf{{} -[$dif]} &\;=\; [$total]\mathbf{{} -[$dif]} \\ + 2x &\;=\; [$s1] \\ + \frac{2x}{2} &\;=\; \frac{[$s1]}{2} \\ + x &\;=\; [$ansShort] +\end{aligned} +`] + +So the shorter segment is [`[$ansShort1]`]. + +The longer segment is [`[$ansShort1]+[$dif1]`], which is [`[$ansLong1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem20.pg new file mode 100644 index 0000000000..8b847af9f7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem20.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Read a word problem. Write an equation and solve for unknown. +# Given the sum and the relationship between two parts, +# find each part's value. +# +# Last updated: Jordan 8/28/13; 7/26/13; Kling, 7/24/13; Hughes, 7/15/2013 Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); + +$doc = random(150000,200000,1000); +$sec = random(25000,40000,1000); +$a = $doc-$sec; +$b = $doc+$sec; + +$ca = Currency($a); +$cb = Currency($b); + +$doc = Currency($doc); +$sec = Currency($sec); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +In a doctor's office, the receptionist's annual salary is [`[$ca]`] less than that of the doctor. +Together, the doctor and the receptionist make [`[$cb]`] per year. Find each person's annual income. + +The receptionist's annual income is [__________]{$sec}. The doctor's annual income is [__________]{$doc}. + +END_PGML + +############################################## + +$s1 = $b-$a; + +BEGIN_PGML_SOLUTION + +Let the receptionist's annual income be [`x`] dollars. Then the doctor's annual income is [`x+[$a]`] dollars. + +Since their total annual income is [`[$b]`] dollars, we can write the following equation: + + [`` x+(x+[$a])=[$b] ``] + +Next, we solve for [`x`]: + + [` +\begin{aligned} + x+x+[$a] &{}= [$b] \\ + 2x+[$a] &= [$b] \\ + 2x+[$a]\mathbf{{}-[$a]} &= [$b]\mathbf{{}-[$a]} \\ + 2x &= [$s1] \\ + \frac{2x}{2} &= \frac{[$s1]}{2} \\ + x &= [$sec] +\end{aligned} +`] + +We found that the receptionist earns [`[$sec]`] per year. + +So the doctor's annual salary is [`[$sec]+[$ca]`], which is [`[$doc]`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem30.pg new file mode 100644 index 0000000000..d8c2237ae0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem30.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Read a word problem. Write an equation and solve for unknown. +# Given the sum and the relationship between two parts, +# find each part's value. +# +# Last updated: Jordan 7/26/13; Kling, 7/24/13; Hughes, 7/15/2013 Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','add','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$r = random(110,200,1); +$j = random(40,90,1); +$a = $r-$j; +$b = $r+$j; + +$sex = list_random('male','female'); +$name1 = RandomName(sex=>$sex); +$sex = list_random('male','female'); +$name2 = RandomName(sex=>$sex); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name1] and [$name2] went picking strawberries. [$name1] picked [`[$a]`] fewer strawberries than [$name2] did. Together, they picked [`[$b]`] strawberries. How many strawberries did [$name2] pick? + + [$name2] picked [___________]{$r} strawberries. + +END_PGML + +############################################## + +$s1 = $b+$a; +BEGIN_PGML_SOLUTION + +Suppose that [$name2] picked [`x`] strawberries. Then [$name1] picked [`x-[$a]`] strawberries. + +Since they picked a total of [`[$b]`] strawberries, we can write an equation: + + [`` x+(x-[$a])=[$b] ``] + +Next, we solve for [`x`]: + + [` +\begin{aligned} + x+x-[$a] &= [$b] \\ +2x-[$a] &= [$b] \\ + 2x-[$a]\mathbf{{}+[$a]} &= [$b]\mathbf{{}+[$a]} \\ + 2x &= [$s1] \\ + \frac{2x}{2} &= \frac{[$s1]}{2} \\ + x &= [$r] +\end{aligned} +`] + +[$name2] picked [`[$r]`] strawberries. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem40.pg new file mode 100644 index 0000000000..8a572bf045 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem40.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Read a word problem. Write an equation and solve for unknown. +# Given the sum and the relationship between two parts, +# find each part's value. +# +# Last updated: Hughes, 7/15/2013 Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','add','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$t = random(101,199,1); +$a = random(11,30,1); +$w = list_random(3,4,5); +$n = $w*$t-$a; +$tot = $t+$n; + +if ($w==2) {$word="twice";} +else {$word=numberWord($w).' times';} + +$sex = list_random('male','female'); +$name1 = RandomName(sex=>$sex); +$sex = list_random('male','female'); +do { + $name2 = RandomName(sex=>$sex); +} until ($name1 ne $name2); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name1] and [$name2] collect stamps. [$name2] collected [`[$a]`] fewer than [$word] the number of [$name1]'s stamps. Altogether, they collected [`[$tot]`] stamps. How many stamps did [$name1] and [$name2] collect? + +[$name1] collected [_______]{$t} stamps. [$name2] collected [_______]{$n} stamps. + +END_PGML + +############################################## + +$s1=$w+1; +$s2=$tot+$a; + +BEGIN_PGML_SOLUTION + +Suppose that [$name1] collected [`x`] stamps, then [$name2] collected [`[$w]x-[$a]`] stamps. + +Since they collected a total of [`[$tot]`] stamps, we can write an equation: + + [`` x+([$w]x-[$a])=[$tot] ``] + +Next, we solve for [`x`]: + + [` +\begin{aligned} + x+[$w]x-[$a] &= [$tot] \\ + [$s1]x-[$a] &= [$tot] \\ + [$s1]x-[$a]\mathbf{{} +[$a]} &= [$tot]\mathbf{{} +[$a]} \\ + [$s1]x &= [$s2] \\ + \frac{[$s1]x}{[$s1]} &= \frac{[$s2]}{[$s1]} \\ + x &= [$t] +\end{aligned} +`] + +[$name1] collected [`[$t]`] stamps. + +Since [`[$w] \cdot [$t] - [$a] = [$n]`], [$name2] collected [`[$n]`] stamps. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem50.pg new file mode 100644 index 0000000000..80615f16e7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem50.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Read a word problem. Write an equation and solve for unknown. +# Given the sum and the relationship between two parts, +# find each part's value. +# +# Last updated: Jordan 7/26/13; Kling, 7/24/13; Hughes, 7/15/2013 Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->operators->undefine('+','-'); + +$a = random(20,40,1); +$r = random(50,150,1); +$w = list_random(3,4,5); +$h = $w*$r+$a; +$t = $h+$r; + +if ($w==2) {$word="twice";} +else {$word=numberWord($w).' times';} + +$ca = Currency($a); +$ct = Currency($t); +$cr = Currency($r); +$ch = Currency($h); + +$sex = 'female'; +$name1 = RandomName(sex=>$sex); +do { + $name2 = RandomName(sex=>$sex); +} until ($name1 ne $name2); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name1] and [$name2] sold girl scout cookies. [$name1]'s sales were [`[$ca]`] more than [$word] of [$name2]'s. Altogether, their sales were [`[$ct]`]. How much did each girl sell? + +[$name1]'s sales were [_______]{$ch}. [$name2]'s sales were [_______]{$cr}. + +END_PGML + +############################################## + +$s1=$w+1; +$s2=$t-$a; + +BEGIN_PGML_SOLUTION + +Suppose that [$name2]'s income was [`x`] dollars, then [$name1]'s income was [`[$w]x+[$a]`] dollars. + +Since their total income was [`[$t]`], we can write an equation: + + [`` x+([$w]x+[$a])=[$t] ``] + +Next, we solve for [`x`]: + + [` +\begin{aligned} + x+[$w]x+[$a] &= [$t] \\ +[$s1]x+[$a] &= [$t] \\ + [$s1]x+[$a]\mathbf{{}-[$a]} &= [$t]\mathbf{{}-[$a]} \\ + [$s1]x &= [$s2] \\ + \frac{[$s1]x}{[$s1]} &= \frac{[$s2]}{[$s1]} \\ + x &= [$r] +\end{aligned} +`] + +[$name2]'s sales were [`[$cr]`]. + +Since [`[$w] \cdot [$r] + [$a] = [$h]`], [$name1]'s sales were [`[$ch]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem60.pg new file mode 100644 index 0000000000..cd13bb0fbc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem60.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Read a word problem. Write an equation and solve for unknown. +# Given the sum and the relationship between two parts, +# find each part's value. +# +# Last updated: Jordan 8/28/13; Yao, 7/30/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','add','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$loss = random(20,30,1); +$dif = random(10,20,1); +$factor = list_random(3,4,5); +$win = $factor*$loss+$dif; +$total = $win+$loss; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A hockey team played a total of [`[$total]`] games last season. The number of games they won was [`[$dif]`] more than [@numberWord($factor)@] times of the number of games they lost. + +Write and solve an equation to answer the following questions. + +The team lost [_______]{$loss} games. The team won [_______]{$win} games. + +END_PGML + +############################################## + +$s1=$factor+1; +$s2=$total-$dif; + +BEGIN_PGML_SOLUTION + +Suppose that the team lost [`x`] games. Then they won [`[$factor]x+[$dif]`] games. + +Since the team played a total of [`[$total]`] games, we can write an equation: + + [`` x+([$factor]x+[$dif])=[$total] ``] + +Next, we solve for [`x`]: + + [`` +\begin{aligned} + x+([$factor]x+[$dif])&=[$total] \\ + x+[$factor]x+[$dif]&=[$total] \\ + [$s1]x+[$dif] &= [$total] \\ + [$s1]x+[$dif]\mathbf{{} -[$dif]} &= [$total]\mathbf{{} -[$dif]} \\ + [$s1]x &= [$s2] \\ + \frac{[$s1]x}{[$s1]} &= \frac{[$s2]}{[$s1]} \\ + x &= [$loss] +\end{aligned} + ``] + +So the team lost [`[$loss]`] games. + +Since [`[$factor] \cdot [$loss] + [$dif] = [$win]`], the team won [`[$win]`] games. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem10.pg new file mode 100644 index 0000000000..a4e04482a6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem10.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Word problem for equations like 2x+1=3x-10 +# +# Last updated: Yao, 10/22/16 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + $a = random(6,10,0.5); + $rateA = random(2,4,0.5); + $ans = random(10,20,1); + do {$rateB = random(0.5,$rateA-0.5,0.5);} until ( ($rateA-$rateB!=1) && ($rateB!=1) ); + $b = $rateA*$ans+$a-$rateB*$ans; +} until ($b<20); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Use a linear equation to solve the word problem. + +Two trees are [`[$a]`] feet and [`[$b]`] feet tall. The shorter tree grows [`[$rateA]`] feet per year; the taller tree grows [`[$rateB]`] feet per year. How many years later would the shorter tree catch up with the taller tree? + +It would take the shorter tree [_______]{$ans} years to catch up with the taller tree. + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +The shorter tree grows [`[$rateA]`] feet per year. In [`x`] years, it would grow [`[$rateA]x`] feet. Its height is [`[$rateA]x+[$a]`] feet after [`x`] years. + +Similarly, the taller tree would grow [`[$rateB]x`] feet in [`x`] years, and its height is [`[$rateB]x+[$b]`] feet after [`x`] years. + +To find when those two trees have the same height, we write and solve an equation: + + [`` +\begin{aligned} + [$rateA]x+[$a] &= [$rateB]x+[$b] \\ + [$rateA]x+[$a] \mathbf{{}-[$a]} &= [$rateB]x+[$b] \mathbf{{}-[$a]} \\ + [$rateA]x &= [$rateB]x + [$b-$a] \\ + [$rateA]x \mathbf{{}-[$rateB]x} &= [$rateB]x + [$b-$a] \mathbf{{}-[$rateB]x} \\ + [$rateA-$rateB]x &= [$b-$a] \\ + \frac{[$rateA-$rateB]x}{[$rateA-$rateB]} &= \frac{[$b-$a]}{[$rateA-$rateB]} \\ + x &= [$ans] +\end{aligned} + ``] + +It would take the shorter tree [`[$ans]`] years to catch up with the taller tree. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem20.pg new file mode 100644 index 0000000000..fc515dccfd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem20.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Word problem for equations like 2x+1=3x-10 +# +# Last updated: Yao, 10/22/16 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + $a = random(2000,10000,100); + $rateA = random(500,900,50); + $ans = random(10,20,1); + $rateB = random(200,$rateA-50,50); + $b = $rateA*$ans+$a-$rateB*$ans; +} until ($b>$a); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Use a linear equation to solve the word problem. + +Massage Heaven and Massage You are competitors. Massage Heaven has [`[$a]`] registered customers, and it gets approximately [`[$rateA]`] newly registered customers every month. Massage You has [`[$b]`] registered customers, and it gets approximately [`[$rateB]`] newly registered customers every month. How many months would it take Massage Heaven to catch up with Massage You in the number of registered customers? + +These two companies would have approximately the same number of registered customers [________]{$ans} months later. + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Massage Heaven gets [`[$rateA]`] newly registered customers every month. In [`x`] months, it will get [`[$rateA]x`] new customers. It will have [`[$rateA]x+[$a]`] registered customers [`x`] months later. + +Similarly, Massage You will get [`[$rateB]x`] newly registered customers in [`x`] months, and it will have [`[$rateB]x+[$b]`] customers [`x`] months later. + +To find when those two companies have the same number of customers, we write and solve an equation: + + [`` +\begin{aligned} + [$rateA]x+[$a] &= [$rateB]x+[$b] \\ + [$rateA]x+[$a] \mathbf{{}-[$a]} &= [$rateB]x+[$b] \mathbf{{}-[$a]} \\ + [$rateA]x &= [$rateB]x + [$b-$a] \\ + [$rateA]x \mathbf{{}-[$rateB]x} &= [$rateB]x + [$b-$a] \mathbf{{}-[$rateB]x} \\ + [$rateA-$rateB]x &= [$b-$a] \\ + \frac{[$rateA-$rateB]x}{[$rateA-$rateB]} &= \frac{[$b-$a]}{[$rateA-$rateB]} \\ + x &= [$ans] +\end{aligned} + ``] + +These two companies would have approximately the same number of registered customers [`[$ans]`] months later. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem30.pg new file mode 100644 index 0000000000..2e75a87369 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem30.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Word problem for equations like 2x+1=3x-10 +# +# Last updated: Yao, 10/22/16 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + $a = random(50,80,5); + $rateA = random(0.3,0.75,0.05); + $ans = random(60,150,1); + $rateB = random($rateA+0.05,0.95,0.05); + $b = $rateA*$ans+$a-$rateB*$ans; +} until ( ($b>20) && ($b<$a) ); + +Context("Currency"); +$aC = Currency("$a"); +$bC = Currency("$b"); +$rateAC = Currency("$rateA"); +$rateBC = Currency("$rateB"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Use a linear equation to solve the word problem. + +Two truck rental companies have different rates. V-Haul has a base charge of [`[$aC]`], plus [`[$rateAC]`] per mile. W-Haul has a base charge of [`[$bC]`], plus [`[$rateBC]`] per mile. For how many miles would these two companies charge the same amount? + +If a driver drives [________]{$ans} miles, those two companies would charge the same amount of money. + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +V-Haul has a base charge of [`[$aC]`], plus [`[$rateAC]`] per mile. V-Haul's total charge would be [`[$rateA]x+[$a]`] dollars if a driver drives [`x`] miles. + +W-Haul has a base charge of [`[$bC]`], plus [`[$rateBC]`] per mile. W-Haul's total charge would be [`[$rateB]x+[$b]`] dollars if a driver drives [`x`] miles. + +To find when those two companies charge the same amount of money, we write and solve the equation: + + [`` +\begin{aligned} + [$rateA]x+[$a] &= [$rateB]x+[$b] \\ + [$rateA]x+[$a] \mathbf{{}-[$a]} &= [$rateB]x+[$b] \mathbf{{}-[$a]} \\ + [$rateA]x &= [$rateB]x + [$b-$a] \\ + [$rateA]x \mathbf{{}-[$rateB]x} &= [$rateB]x + [$b-$a] \mathbf{{}-[$rateB]x} \\ + [$rateA-$rateB]x &= [$b-$a] \\ + \frac{[$rateA-$rateB]x}{[$rateA-$rateB]} &= \frac{[$b-$a]}{[$rateA-$rateB]} \\ + x &= [$ans] +\end{aligned} + ``] + +If a driver drives [`[$ans]`] miles, those two companies would charge the same amount of money. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem40.pg new file mode 100644 index 0000000000..2151dfd189 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem40.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Word problem for equations like 2x+1=3x-10 +# +# Last updated: Yao, 10/22/16 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + $a = random(5000,10000,100); + $rateA = -random(200,500,50); + $ans = random(10,30,1); + $rateB = random(200,500,50); + $b = $rateA*$ans+$a-$rateB*$ans; +} until ($b>1000); + +$rateAabs = abs($rateA); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Use a linear equation to solve the word problem. + +Massage Heaven and Massage You are competitors. Massage Heaven has [`[$a]`] registered customers, but it is losing approximately [`[$rateAabs]`] registered customers every month. Massage You has [`[$b]`] registered customers, and it gets approximately [`[$rateB]`] newly registered customers every month. How many months would it take Massage Heaven to catch up with Massage You in the number of registered customers? + +These two companies would have approximately the same number of registered customers [________]{$ans} months later. + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Massage Heaven loses [`[$rateAabs]`] registered customers every month. In [`x`] months, it will lose [`[$rateAabs]x`] customers. It will have [`[$a]+[$rateA]x`] registered customers left [`x`] months later. + +Massage You will get [`[$rateB]x`] newly registered customers in [`x`] months, and it will have [`[$rateB]x+[$b]`] customers [`x`] months later. + +To find when those two companies have the same number of registered customers, we write and solve an equation: + + [`` +\begin{aligned} + [$a]+[$rateA]x &= [$rateB]x+[$b] \\ + [$a]+[$rateA]x \mathbf{{}-[$a]} &= [$rateB]x+[$b] \mathbf{{}-[$a]} \\ + [$rateA]x &= [$rateB]x + [$b-$a] \\ + [$rateA]x \mathbf{{}-[$rateB]x} &= [$rateB]x + [$b-$a] \mathbf{{}-[$rateB]x} \\ + [$rateA-$rateB]x &= [$b-$a] \\ + \frac{[$rateA-$rateB]x}{[$rateA-$rateB]} &= \frac{[$b-$a]}{[$rateA-$rateB]} \\ + x &= [$ans] +\end{aligned} + ``] + +These two companies would have approximately the same number of registered customers [`[$ans]`] months later. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem50.pg new file mode 100644 index 0000000000..0226e6daef --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem50.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Word problem for equations like 2x+1=3x-10 +# +# Last updated: Yao, 10/22/16 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','application','subtract','divide') +## DBCCSS('6.EE.2.a','7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$sex = list_random('male','female'); +$pronoun1 = 'he' if ($sex eq 'male'); +$pronoun1 = 'she' if ($sex eq 'female'); +$object1 = 'him' if ($sex eq 'male'); +$object1= 'her' if ($sex eq 'female'); +$possessive1 = 'his' if ($sex eq 'male'); +$possessive1 = 'her' if ($sex eq 'female'); +$name1 = RandomName(sex=>$sex); + +$sex = list_random('male','female'); +$pronoun2 = 'he' if ($sex eq 'male'); +$pronoun2 = 'she' if ($sex eq 'female'); +$object2 = 'him' if ($sex eq 'male'); +$object2= 'her' if ($sex eq 'female'); +$possessive2 = 'his' if ($sex eq 'male'); +$possessive2 = 'her' if ($sex eq 'female'); +$name2 = RandomName(sex=>$sex); + +do { + $a = random(40,100,5); + $rateA = -random(1.5,5,0.5); + $ans = random(10,30,1); + do {$rateB = random(1.5,5,0.5);} until ($rateA!=-$rateB); + $b = $rateA*$ans+$a-$rateB*$ans; +} until (($b>0) && ($b<$a) ); + +$rateAabs = abs($rateA); + +Context("Currency"); +$aC = Currency("$a"); +$bC = Currency("$b"); +$rateAabsC = Currency("$rateAabs"); +$rateBC = Currency("$rateB"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Use a linear equation to solve the word problem. + +[$name1] has [`[$aC]`] in [$possessive1] piggy bank, and [$pronoun1] spends [`[$rateAabsC]`] every day. +[$name2] has [`[$bC]`] in [$possessive2] piggy bank, and [$pronoun2] saves [`[$rateBC]`] every day. + +If they continue to spend and save money this way, how many days later would they have the same amount of money in their piggy banks? + +[________]{$ans} days later, [$name1] and [$name2] will have the same amount of money in their piggy banks. + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +[$name1] spends [`[$rateAabsC]`] every day, so [$pronoun1] will spend [`[$rateAabs]x`] dollars in [`x`] days. Since [$pronoun1] already has [`[$aC]`], [`x`] days later, the amount of money left in [$possessive1] piggy bank is [`[$a]+[$rateA]x`] dollars. + +Similarly, [$name2] has [`[$rateB]x+[$b]`] dollars in [$possessive2] piggy bank [`x`] days later. + +To find when they will have the same amount of money, we can write and solve this equation: + + [`` +\begin{aligned} + [$a]+[$rateA]x &= [$rateB]x+[$b] \\ + [$a]+[$rateA]x \mathbf{{}-[$a]} &= [$rateB]x+[$b] \mathbf{{}-[$a]} \\ + [$rateA]x &= [$rateB]x + [$b-$a] \\ + [$rateA]x \mathbf{{}-[$rateB]x} &= [$rateB]x + [$b-$a] \mathbf{{}-[$rateB]x} \\ + [$rateA-$rateB]x &= [$b-$a] \\ + \frac{[$rateA-$rateB]x}{[$rateA-$rateB]} &= \frac{[$b-$a]}{[$rateA-$rateB]} \\ + x &= [$ans] +\end{aligned} + ``] + +[`[$ans]`] days later, [$name1] and [$name2] will have the same amount of money in their piggy banks. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints10.pg new file mode 100644 index 0000000000..78b411074f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints10.pg @@ -0,0 +1,158 @@ +# Given values for f(a0) and f(a1), find a formula for linear f(x) +# This version: slope and y-intercept both integer + +## DBsubject() +## DBchapter() +## DBsection() +## Level() +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author(Alex Jordan) +## Institution(Portland Community College) +## Language(en-US) + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGchoicemacros.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ + +$xmin= -10; +$xmax= 10; +$ymin= -10; +$ymax= 10; + +Context("Fraction"); +Context()->flags->set(reduceConstants=>0); +do { + @a = ($xmin..$xmax)[(NchooseK($xmax-$xmin+1,2))]; + @b = ($ymin..$ymax)[(NchooseK($ymax-$ymin+1,2))]; + $m = Fraction($b[1]-$b[0], $a[1]-$a[0]); + $yint = Fraction($b[0] - ($b[1]-$b[0])/($a[1]-$a[0]) * $a[0]); +} until (($yint->value)[1] == 1 and ($m->value)[1] == 1); + +Parser::Number::NoDecimals(); +Context()->noreduce('(-x)-y','(-x)+y'); +$fname = RandomVariableName(type=>'function'); +parser::Assignment->Allow; +parser::Assignment->Function("$fname"); +Context()->operators->set( + '*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + ' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '/' => {class => 'bizarro::BOP::divide', isCommand => 1}, + ' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); +$f = Formula("$fname(x) = $m x + $yint")->reduce; + +$evaluator = $f -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroDiv=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form. + Maybe it needs to be simplified, factored, expanded, have its denominator rationalized, etc.") unless $OK; + return $OK; +}); + + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +A linear function [`[$fname]`] is such that [`[$fname]([$a[0]])=[$b[0]]`] and [`[$fname]([$a[1]])=[$b[1]]`]. Find a formula for this function in the form [`[$fname](x)=mx+b`]. + +[_]{$evaluator}{20} + +END_PGML + +############################################################ +# Solution +############################################################ + +$s1 = Compute("$m*x")->reduce; +if ($m==1) {$s2 = "($a[0])";} + elsif ($m==-1) {$s2 = "-($a[0])";} + else {$s2 = "$m($a[0])";} +$s3 = $m*$a[0]; +$s3N = -$s3; +$s4 = $s3>0 ? "-$s3" : "+$s3N"; +$s5 = Compute("$m*x+$yint")->reduce; +$s6 = $b[0]>=0 ? "$b[0]" : "($b[0])"; +$s7 = $a[0]>=0 ? "$a[0]" : "($a[0])"; + +BEGIN_PGML_SOLUTION + +The slope-intercept form of a linear function has the form [` f(x)=mx+b `] where [`m`] is the slope and [`b`] is the [`y`]-coordinate of the [`y`]-intercept. To find a linear function's slope-intercept equation, we first try to find the line's slope. + +Since [`[$fname]([$a[0]])=[$b[0]]`] and [`[$fname]([$a[1]])=[$b[1]]`], the function [`[$fname](x)`] passes the points [`([$a[0]],[$b[0]])`] and [`([$a[1]],[$b[1]])`]. We will use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$a[0]],[$b[0]]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$a[1]],[$b[1]]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned} + \text{slope} + &=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$b[1]]-[$s6]}{[$a[1]]-[$s7]}\\ + &=\frac{[$b[1]-$b[0]]}{[$a[1]-$a[0]]}\\ + &=[$m] + \end{aligned} ``] + +Now we have [` [$fname](x)=[$s1]+b `]. The next step is to find the value of [`b`]. We will substitute one of the given points into [` [$fname](x)=[$s1]+b `]. We choose to use [`([$a[0]],[$b[0]])`]. + + [`` +\begin{aligned} + [$fname](x) &= [$s1] + b \\ + [$b[0]] &= [$s2] + b \\ + [$b[0]] &= [$s3] + b \\ + [$b[0]][$s4] &= b \\ + [$yint] &= b +\end{aligned} + ``] + +This linear function's slope-intercept equation is [` [$fname](x)=[$s5] `]. + +END_PGML_SOLUTION + + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints20.pg new file mode 100644 index 0000000000..bb31a81197 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints20.pg @@ -0,0 +1,156 @@ +# Given values for f(a0) and f(a1), find a formula for linear f(x) +# This version: slope non-integer, and y-intercept integer + +## DBsubject() +## DBchapter() +## DBsection() +## Level() +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author(Alex Jordan) +## Institution(Portland Community College) +## Language(en-US) + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGchoicemacros.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ + +$xmin= -10; +$xmax= 10; +$ymin= -10; +$ymax= 10; + +Context("Fraction"); +Context()->flags->set(reduceConstants=>0); +do { + @a = ($xmin..$xmax)[(NchooseK($xmax-$xmin+1,2))]; + @b = ($ymin..$ymax)[(NchooseK($ymax-$ymin+1,2))]; + $m = Fraction($b[1]-$b[0], $a[1]-$a[0]); + $yint = Fraction($b[0] - ($b[1]-$b[0])/($a[1]-$a[0]) * $a[0]); +} until (($yint->value)[1] == 1 and ($m->value)[1] != 1); + +Parser::Number::NoDecimals(); +Context()->noreduce('(-x)-y','(-x)+y'); +$fname = RandomVariableName(type=>'function'); +parser::Assignment->Allow; +parser::Assignment->Function("$fname"); +Context()->operators->set( + '*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + ' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '/' => {class => 'bizarro::BOP::divide', isCommand => 1}, + ' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); +$f = Formula("$fname(x) = $m x + $yint"); + +$evaluator = $f -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroDiv=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form. + Maybe it needs to be simplified, factored, expanded, have its denominator rationalized, etc.") unless $OK; + return $OK; +}); + + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +A linear function [`[$fname]`] is such that [`[$fname]([$a[0]])=[$b[0]]`] and [`[$fname]([$a[1]])=[$b[1]]`]. Find a formula for this function in the form [`[$fname](x)=mx+b`]. + +[_]{$evaluator}{20} + +END_PGML + +############################################################ +# Solution +############################################################ + +$s3 = $m*$a[0]; +$s3N = -$s3; +$s4 = $s3>0 ? "-$s3" : "+$s3N"; +$s6 = $b[0]>=0 ? "$b[0]" : "($b[0])"; +$s7 = $a[0]>=0 ? "$a[0]" : "($a[0])"; +$yintN = -$yint; +$s8 = $yint>0 ? "+$yint" : "-$yintN"; +if ($yint==0) {$s8 = "";} + +BEGIN_PGML_SOLUTION + +The slope-intercept form of a linear function has the form [` f(x)=mx+b `] where [`m`] is the slope and [`b`] is the [`y`]-coordinate of the [`y`]-intercept. To find a linear function's slope-intercept equation, we first try to find the line's slope. + +Since [`[$fname]([$a[0]])=[$b[0]]`] and [`[$fname]([$a[1]])=[$b[1]]`], the function [`[$fname](x)`] passes the points [`([$a[0]],[$b[0]])`] and [`([$a[1]],[$b[1]])`]. We will use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$a[0]],[$b[0]]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$a[1]],[$b[1]]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned} + \text{slope} + &=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$b[1]]-[$s6]}{[$a[1]]-[$s7]}\\ + &=\frac{[$b[1]-$b[0]]}{[$a[1]-$a[0]]}\\ + &=[$m] + \end{aligned} ``] + +Now we have [` [$fname](x)=[$m]x+b `]. The next step is to find the value of [`b`]. We will substitute one of the given points into [` [$fname](x)=[$m]x+b `]. We choose to use [`([$a[0]],[$b[0]])`]. + + [`` +\begin{aligned} + [$fname](x) &= [$m]x + b \\ + [$b[0]] &= [$m]([$a[0]]) + b \\ + [$b[0]] &= [$s3] + b \\ + [$b[0]][$s4] &= b \\ + [$yint] &= b +\end{aligned} + ``] + +This linear function's slope-intercept equation is [` [$fname](x)=[$m]x[$s8] `]. + +END_PGML_SOLUTION + + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints30.pg new file mode 100644 index 0000000000..f6ea0b8e0d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints30.pg @@ -0,0 +1,151 @@ +# Given values for f(a0) and f(a1), find a formula for linear f(x) +# This version: slope and y-intercept both non-integer + +## DBsubject() +## DBchapter() +## DBsection() +## Level() +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author(Alex Jordan) +## Institution(Portland Community College) +## Language(en-US) + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGchoicemacros.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ + +$xmin= -10; +$xmax= 10; +$ymin= -10; +$ymax= 10; + +Context("Fraction"); +Context()->flags->set(reduceConstants=>0); +do { + @a = ($xmin..$xmax)[(NchooseK($xmax-$xmin+1,2))]; + @b = ($ymin..$ymax)[(NchooseK($ymax-$ymin+1,2))]; + $m = Fraction($b[1]-$b[0], $a[1]-$a[0]); + $yint = Fraction($b[0] - ($b[1]-$b[0])/($a[1]-$a[0]) * $a[0]); +} until (($yint->value)[1] != 1 and ($m->value)[1] != 1); + +Parser::Number::NoDecimals(); +Context()->noreduce('(-x)-y','(-x)+y'); +$fname = RandomVariableName(type=>'function'); +parser::Assignment->Allow; +parser::Assignment->Function("$fname"); +Context()->operators->set( + '*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + ' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '/' => {class => 'bizarro::BOP::divide', isCommand => 1}, + ' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); +$f = Formula("$fname(x) = $m x + $yint"); + +$evaluator = $f -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroDiv=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form. + Maybe it needs to be simplified, factored, expanded, have its denominator rationalized, etc.") unless $OK; + return $OK; +}); + + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +A linear function [`[$fname]`] is such that [`[$fname]([$a[0]])=[$b[0]]`] and [`[$fname]([$a[1]])=[$b[1]]`]. Find a formula for this function in the form [`[$fname](x)=mx+b`]. + +[_]{$evaluator}{20} + +END_PGML + +############################################################ +# Solution +############################################################ + +$s3 = $m*$a[0]; +$s6 = $b[0]>=0 ? "$b[0]" : "($b[0])"; +$s7 = $a[0]>=0 ? "$a[0]" : "($a[0])"; + +BEGIN_PGML_SOLUTION + +The slope-intercept form of a linear function has the form [` f(x)=mx+b `] where [`m`] is the slope and [`b`] is the [`y`]-coordinate of the [`y`]-intercept. To find a linear function's slope-intercept equation, we first try to find the line's slope. + +Since [`[$fname]([$a[0]])=[$b[0]]`] and [`[$fname]([$a[1]])=[$b[1]]`], the function [`[$fname](x)`] passes the points [`([$a[0]],[$b[0]])`] and [`([$a[1]],[$b[1]])`]. We will use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$a[0]],[$b[0]]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$a[1]],[$b[1]]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned} + \text{slope} + &=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$b[1]]-[$s6]}{[$a[1]]-[$s7]}\\ + &=\frac{[$b[1]-$b[0]]}{[$a[1]-$a[0]]}\\ + &=[$m] + \end{aligned} ``] + +Now we have [` [$fname](x)=[$m]x+b `]. The next step is to find the value of [`b`]. We will substitute one of the given points into [` [$fname](x)=[$m]x+b `]. We choose to use [`([$a[0]],[$b[0]])`]. + + [`` +\begin{aligned} + [$fname](x) &= [$m]x + b \\ + [$b[0]] &= [$m]([$a[0]]) + b \\ + [$b[0]] &= [$s3] + b \\ + [$b[0]]-([$s3]) &= b \\ + [$yint] &= b +\end{aligned} + ``] + +This linear function's slope-intercept equation is [` [$f]`]. + +END_PGML_SOLUTION + + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints40.pg new file mode 100644 index 0000000000..853921dce3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints40.pg @@ -0,0 +1,153 @@ +# Given values for f(a0) and f(a1), find a formula for linear f(x) +# This version: slope and y-intercept both non-integer +# Also the data values are all two-digit integers +# and the y-intercept is such that its numerator is not more than 200 in absolute value + +## DBsubject() +## DBchapter() +## DBsection() +## Level() +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author(Alex Jordan) +## Institution(Portland Community College) +## Language(en-US) + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGchoicemacros.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ + +$xmin= 11; +$xmax= 99; +$ymin= 11; +$ymax= 99; + +Context("Fraction"); +Context()->flags->set(reduceConstants=>0); +do { + @a = ($xmin..$xmax)[(NchooseK($xmax-$xmin+1,2))]; + @b = ($ymin..$ymax)[(NchooseK($ymax-$ymin+1,2))]; + $m = Fraction($b[1]-$b[0], $a[1]-$a[0]); + $yint = Fraction($b[0] - ($b[1]-$b[0])/($a[1]-$a[0]) * $a[0]); +} until (($yint->value)[1] != 1 and ($m->value)[1] != 1 and abs(($yint->value)[0]) < 200); + +Parser::Number::NoDecimals(); +Context()->noreduce('(-x)-y','(-x)+y'); +$fname = RandomVariableName(type=>'function'); +parser::Assignment->Allow; +parser::Assignment->Function("$fname"); +Context()->operators->set( + '*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + ' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '/' => {class => 'bizarro::BOP::divide', isCommand => 1}, + ' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); +$f = Formula("$fname(x) = $m x + $yint"); + +$evaluator = $f -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroDiv=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form. + Maybe it needs to be simplified, factored, expanded, have its denominator rationalized, etc.") unless $OK; + return $OK; +}); + + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +A linear function [`[$fname]`] is such that [`[$fname]([$a[0]])=[$b[0]]`] and [`[$fname]([$a[1]])=[$b[1]]`]. Find a formula for this function in the form [`[$fname](x)=mx+b`]. + +[_]{$evaluator}{20} + +END_PGML + +############################################################ +# Solution +############################################################ + +$s3 = $m*$a[0]; +$s6 = $b[0]>=0 ? "$b[0]" : "($b[0])"; +$s7 = $a[0]>=0 ? "$a[0]" : "($a[0])"; + +BEGIN_PGML_SOLUTION + +The slope-intercept form of a linear function has the form [` f(x)=mx+b `] where [`m`] is the slope and [`b`] is the [`y`]-coordinate of the [`y`]-intercept. To find a linear function's slope-intercept equation, we first try to find the line's slope. + +Since [`[$fname]([$a[0]])=[$b[0]]`] and [`[$fname]([$a[1]])=[$b[1]]`], the function [`[$fname](x)`] passes the points [`([$a[0]],[$b[0]])`] and [`([$a[1]],[$b[1]])`]. We will use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$a[0]],[$b[0]]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$a[1]],[$b[1]]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned} + \text{slope} + &=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$b[1]]-[$s6]}{[$a[1]]-[$s7]}\\ + &=\frac{[$b[1]-$b[0]]}{[$a[1]-$a[0]]}\\ + &=[$m] + \end{aligned} ``] + +Now we have [` [$fname](x)=[$m]x+b `]. The next step is to find the value of [`b`]. We will substitute one of the given points into [` [$fname](x)=[$m]x+b `]. We choose to use [`([$a[0]],[$b[0]])`]. + + [`` +\begin{aligned} + [$fname](x) &= [$m]x + b \\ + [$b[0]] &= [$m]([$a[0]]) + b \\ + [$b[0]] &= [$s3] + b \\ + [$b[0]]-([$s3]) &= b \\ + [$yint] &= b +\end{aligned} + ``] + +This linear function's slope-intercept equation is [` [$f]`]. + +END_PGML_SOLUTION + + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints50.pg new file mode 100644 index 0000000000..0c6251dbab --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints50.pg @@ -0,0 +1,164 @@ +# Given values for f(a0) and f(a1), find a formula for linear f(x) +# This version: slope and y-intercept both non-integer +# Also the data y-values are decimals, and decimals are allowed in the answer + +## DBsubject() +## DBchapter() +## DBsection() +## Level() +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author(Alex Jordan) +## Institution(Portland Community College) +## Language(en-US) + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGchoicemacros.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ + +$xmin= 1; +$xmax= 99; +$ymin= 11; #will be divided by 100 +$ymax= 999; #will be dividd by 100 + +#Context("Fraction"); +#do { + @a = ($xmin..$xmax)[(NchooseK($xmax-$xmin+1,2))]; + @b = map{$_/100}(($ymin..$ymax)[(NchooseK($ymax-$ymin+1,2))]); + $m = Real(($b[1]-$b[0])/($a[1]-$a[0])); + #$m = Fraction($b[1]-$b[0], $a[1]-$a[0]); + $yint = $b[0] - ($b[1]-$b[0])/($a[1]-$a[0]) * $a[0]; + #$yint = Fraction($b[0] - ($b[1]-$b[0])/($a[1]-$a[0]) * $a[0]); +#} until (($yint->value)[1] != 1 and ($m->value)[1] != 1); + +#Commenting out below allows decimals +Context("Numeric"); +#Parser::Number::NoDecimals(); +Context()->noreduce('(-x)-y','(-x)+y'); +$fname = RandomVariableName(type=>'function'); +parser::Assignment->Allow; +parser::Assignment->Function("$fname"); +#Context()->operators->set( +# '*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +# ' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +# '* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +# '/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +# ' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +# '/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +# '//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +#); +$f = Formula("$fname(x) = $m x + $yint")->reduce; + +$evaluator = $f; +#$evaluator = $f -> cmp( +# checker=>sub{ +# my ( $correct, $student, $ansHash ) = @_; +# return 0 if $ansHash->{isPreview} || $correct != $student; +# Context()->flags->set(bizarroMul=>1,bizarroDiv=>1); +# delete $correct->{test_values}; +# delete $student->{test_values}; +# my $OK = ($correct == $student); +# Context()->flags->set(bizarroMul=>0,bizarroDiv=>0); +# Value::Error("Your answer is equivalent to the correct answer, but not in the expected form. +# Maybe it needs to be simplified, factored, expanded, have its denominator rationalized, etc.") unless $OK; +# return $OK; +#}); + + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +A linear function [`[$fname]`] is such that [`[$fname]([$a[0]])=[$b[0]]`] and [`[$fname]([$a[1]])=[$b[1]]`]. Find a formula for this function in the form [`[$fname](x)=mx+b`]. + +[_]{$evaluator}{20} + +END_PGML + +############################################################ +# Solution +############################################################ + +$s1 = Compute("$m*x")->reduce; +if ($m==1) {$s2 = "($a[0])";} + elsif ($m==-1) {$s2 = "-($a[0])";} + else {$s2 = "$m($a[0])";} +$s3 = $m*$a[0]; +$s3N = -$s3; +$s4 = $s3>0 ? "-$s3" : "+$s3N"; +$s5 = Compute("$m*x+$yint")->reduce; +$s6 = $b[0]>=0 ? "$b[0]" : "($b[0])"; +$s7 = $a[0]>=0 ? "$a[0]" : "($a[0])"; + +BEGIN_PGML_SOLUTION + +The slope-intercept form of a linear function has the form [` f(x)=mx+b `] where [`m`] is the slope and [`b`] is the [`y`]-coordinate of the [`y`]-intercept. To find a linear function's slope-intercept equation, we first try to find the line's slope. + +Since [`[$fname]([$a[0]])=[$b[0]]`] and [`[$fname]([$a[1]])=[$b[1]]`], the function [`[$fname](x)`] passes the points [`([$a[0]],[$b[0]])`] and [`([$a[1]],[$b[1]])`]. We will use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$a[0]],[$b[0]]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$a[1]],[$b[1]]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned} + \text{slope} + &=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$b[1]]-[$s6]}{[$a[1]]-[$s7]}\\ + &=\frac{[$b[1]-$b[0]]}{[$a[1]-$a[0]]}\\ + &=[$m] + \end{aligned} ``] + +Now we have [` [$fname](x)=[$m]x+b `]. The next step is to find the value of [`b`]. We will substitute one of the given points into [` [$fname](x)=[$m]x+b `]. We choose to use [`([$a[0]],[$b[0]])`]. + + [`` +\begin{aligned} + [$fname](x) &= [$m]x + b \\ + [$b[0]] &= [$s2] + b \\ + [$b[0]] &= [$s3] + b \\ + [$b[0]][$s4] &= b \\ + [$yint] &= b +\end{aligned} + ``] + +This linear function's slope-intercept equation is [` [$fname](x)=[$s5] `]. + +END_PGML_SOLUTION + + + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints60.pg new file mode 100644 index 0000000000..550e148645 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints60.pg @@ -0,0 +1,180 @@ +# Given two populations of a country at different times, +# find a formula for linear P(t) + +## DBsubject() +## DBchapter() +## DBsection() +## Level() +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author(Alex Jordan) +## Institution(Portland Community College) +## Language(en-US) + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGchoicemacros.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ + +%pops = ( + 'the United States' => { + 2010=>309, + 2011=>312, + 2012=>314, + 2013=>316, + 2014=>319, + 2015=>321, + 2016=>323, + 2017=>326, + 2018=>327, + }, + 'Mexico' => { + 2010=>117, + 2011=>119, + 2012=>121, + 2013=>123, + 2014=>124, + 2015=>126, + 2016=>128, + 2017=>129, + 2018=>131, + }, + 'Indonesia' => { + 2010=>243, + 2011=>246, + 2012=>249, + 2013=>252, + 2014=>255, + 2015=>258, + 2016=>261, + 2017=>264, + 2018=>267, + }, + 'Niger' => { + 2010=>16.4, + 2011=>17.1, + 2012=>17.7, + 2013=>18.4, + 2014=>19.2, + 2015=>19.9, + 2016=>20.7, + 2017=>21.5, + 2018=>22.3, + }, +); + +$country = list_random(lex_sort(keys %pops)); +%countrypops = %{$pops{$country}}; +@years = num_sort(keys %countrypops); +@a = num_sort((@years)[NchooseK(scalar @years,2)]); +@b = map{$countrypops{$_}}(@a); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->noreduce('(-x)-y','(-x)+y'); +$fname = 'P'; +Context()->variables->add(t=>'Real'); +parser::Assignment->Allow; +parser::Assignment->Function("$fname"); +$m = Real(($b[1] - $b[0])/($a[1] - $a[0])); +$yint = $b[0] - $m*$a[0]; +$f = Formula("$fname(x) = $m x + $yint")->reduce; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +The population of [$country] in the year [$a[0]] was [$b[0]] million, +and then later in year [$a[1]] was [$b[1]] million. Assume that the population +of [$country], [`P`], in millions, is a linear function of time [`t`], the year. Find a formula for [`P(t)`] in the form [`[$fname](t)=m t+b`]. + +[_]{$f}{20} + +END_PGML + +############################################################ +# Solution +############################################################ + +$s1 = Compute("$m*t")->reduce; +if ($m==1) {$s2 = "($a[0])";} + elsif ($m==-1) {$s2 = "-($a[0])";} + else {$s2 = "$m($a[0])";} +$s3 = $m*$a[0]; +$s3N = -$s3; +$s4 = $s3>0 ? "-$s3" : "+$s3N"; +$s5 = Compute("$m*t+$yint")->reduce; +$s6 = $b[0]>=0 ? "$b[0]" : "($b[0])"; +$s7 = $a[0]>=0 ? "$a[0]" : "($a[0])"; +$s8 = Real($b[1])-Real($b[0]); + +BEGIN_PGML_SOLUTION + +To find the equation of [`[$fname](t)=m t+b`], we first try to find the line's slope. + +By the given conditions, the line passes the points [`([$a[0]],[$b[0]])`] and [`([$a[1]],[$b[1]])`]. We will use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$a[0]],[$b[0]]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$a[1]],[$b[1]]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned} + \text{slope} + &=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$b[1]]-[$s6]}{[$a[1]]-[$s7]}\\ + &=\frac{[$s8]}{[$a[1]-$a[0]]}\\ + &=[$m] + \end{aligned} ``] + +Now we have [` [$fname](t)=[$s1]+b `]. The next step is to find the value of [`b`]. We will substitute one of the given points into [` [$fname](t)=[$s1]+b `]. We choose to use [`([$a[0]],[$b[0]])`]. + + [`` +\begin{aligned} + [$fname](t) &= [$s1] + b \\ + [$b[0]] &= [$s2] + b \\ + [$b[0]] &= [$s3] + b \\ + [$b[0]][$s4] &= b \\ + [$yint] &= b +\end{aligned} + ``] + +The formula is [` [$fname](t)=[$s5] `]. + +END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd10.pg new file mode 100644 index 0000000000..4e98f8db20 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd10.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 4 < 2x <= 10 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,5,1); +$a=$b*random(1,4,1); +$c=$b*random($a+1,$a+5,1); +$left = Compute("$a"); +$comp0 = "\lt"; +$middle = Compute("$b*x"); +$comp1 = "\leq"; +$right = Compute("$c"); + +$leftEnd = $a/$b; +$rightEnd = $c/$b; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \lt [$b]x \leq [$c] \\ + \frac{[$a]}{[$b]} & \lt \frac{[$b]x}{[$b]} \leq \frac{[$c]}{[$b]} \\ + [$leftEnd] & \lt x \leq [$rightEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg index f4b07e8fc9..03beb63b42 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## MLT(compoundinequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); @@ -147,17 +154,13 @@ $ALT = "Graph of an interval on a number line. The segment from $a to $b is shad BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. - -Please type: +Solve this compound inequality, and write your answer in _interval notation_. -* *inf* for [`\infty`], -* *DNE* for "no solution" -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** [`` [$left0] [$symbol0Original] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg index 80cddc0ff2..773a0c4035 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## MLT(compoundinequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); @@ -191,17 +198,13 @@ if ($direction eq 'left') { BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. - -Please type: +Solve this compound inequality, and write your answer in _interval notation_. -* *inf* for [`\infty`], -* *DNE* for "no solution" -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** [`` [$left0] [$symbol0Original] [$right0] \text{ and } [$left1] [$symbol1Original] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd20.pg new file mode 100644 index 0000000000..d6c03f43de --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd20.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 >= 2x > 4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,5,1); +$c=$b*random(1,4,1); +$a=$b*random($c+1,$c+5,1); +$left = Compute("$a"); +$comp0 = "\geq"; +$middle = Compute("$b*x"); +$comp1 = "\gt"; +$right = Compute("$c"); + +$leftEnd = $c/$b; +$rightEnd = $a/$b; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \geq [$b]x \gt [$c] \\ + \frac{[$a]}{[$b]} & \geq \frac{[$b]x}{[$b]} \gt \frac{[$c]}{[$b]} \\ + [$rightEnd] & \geq x \gt [$leftEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd30.pg new file mode 100644 index 0000000000..17f2be20fa --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd30.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 > -x > -4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +do {$c=random(-5,-1,1);} until (abs($c)!=abs($a)); +$b=-1; +$left = Compute("$a"); +$comp0 = "\gt"; +$middle = Compute("-x"); +$comp1 = "\gt"; +$right = Compute("$c"); + +$leftEnd = -$a; +$rightEnd = -$c; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x < $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \gt -x \gt [$c] \\ + (-1)\cdot [$a] & \lt (-1)\cdot (-x) \lt (-1)\cdot ([$c]) \\ + [$leftEnd] & \lt x \lt [$rightEnd] \\ +\end{aligned} + ``] + +Note that the direction of an inequality symbol changes when we multiply a negative number on both sides. + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd40.pg index 9faebbc5be..19202d421b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd40.pg @@ -8,16 +8,18 @@ # Last updated: Yao, 04/18/2014 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(CompIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -75,11 +78,7 @@ Solve this inequality: [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** In set-builder notation, the solution set is [______________]{$setans}. An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd50.pg index 1159dedf6a..2fcf26ba91 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd50.pg @@ -8,16 +8,18 @@ # Last updated: Yao, 04/18/2014 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(CompIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -77,11 +80,7 @@ Solve this inequality: [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** In set-builder notation, the solution set is [______________]{$setans}. An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg index 83f9346229..5e39e66af4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg @@ -8,16 +8,18 @@ # Last updated: Yao, 04/18/2014 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(CompIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,8 +31,9 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -69,21 +72,15 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve the compound inequality algebraically. - [`` [$left] [$comp0] \frac{[$b]}{[$c]}x [$comp1] [$right] ``] +[@KeyboardInstructions('For the [`\infty`] symbol, type [|INF|]*. For the union symbol [`\cup`], type [|U|]*. For [`\leq`], type [|<=|]*. For [`\geq`], type [|>=|]*. For the such that symbol in set-builder notation, [|||]* is usually above the [|Enter|]* key')@]** -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] + [`` [$left] [$comp0] \frac{[$b]}{[$c]}x [$comp1] [$right] ``] In set-builder notation, the solution set is [______________]{$setans}. - An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,2)`]. END_PGML @@ -96,7 +93,7 @@ BEGIN_PGML_SOLUTION [$a] & \lt \frac{[$b]}{[$c]}x \lt [$d] \\ \mathbf{[$c]\cdot{}} [$a] & \lt \mathbf{[$c]\cdot{}}\frac{[$b]}{[$c]}x \lt \mathbf{[$c]\cdot{}}[$d] \\ [$a*$c] & \lt [$b]x \lt [$d*$c] \\ - \frac{[$a*$c]}{[$c]} & \lt \frac{[$b]x}{[$b]} \lt \frac{[$d*$c]}{[$b]} \\ + \frac{[$a*$c]}{[$b]} & \lt \frac{[$b]x}{[$b]} \lt \frac{[$d*$c]}{[$b]} \\ [$leftEnd] & \lt x \lt [$rightEnd] \\ \end{aligned} ``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg index 280a9977b0..a70c1fe45b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg @@ -8,17 +8,18 @@ # Last updated: Yao, 04/18/2014 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(CompIneq_twonotations) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,8 +31,9 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -75,21 +77,15 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve the compound inequality algebraically. [`` [$left] [$comp0] [$b]-\frac{[$c]}{[$d]}x [$comp1] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions('For the [`\infty`] symbol, type [|INF|]*. For the union symbol [`\cup`], type [|U|]*. For [`\leq`], type [|<=|]*. For [`\geq`], type [|>=|]*. For the such that symbol in set-builder notation, [|||]* is usually above the [|Enter|]* key')@]** In set-builder notation, the solution set is [______________]{$setans}. - An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,2)`]. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd80.pg index 97e724e4b9..d325e9ad25 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd80.pg @@ -8,16 +8,18 @@ # Last updated: Yao, 04/18/2014 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(CompIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,8 +31,9 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -76,11 +79,7 @@ Solve this inequality: [`` [$left] [$comp0] \frac{[$b]+[$c]x}{[$d]} [$comp1] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** In set-builder notation, the solution set is [______________]{$setans}. An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd85.pg index 326ea63abe..31a7de27a4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd85.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd85.pg @@ -7,14 +7,18 @@ # Last updated: Yao, 06/28/2016 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -24,7 +28,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,7 +54,7 @@ A city's homeless population since the year 2000 can be modeled by this function [`` f(x)=[$func] ``] -where [`x`] represents the year, and [`f(x)`] represents the number of homeless people in that year. Estimate the years when this city's homeless population will be between [`[$small]`] and [`[$big]`] people. Use an inequality to solve this problem. +where [`x`] represents the number of year passed since 2000, and [`f(x)`] represents the number of homeless people. Estimate the years when this city's homeless population will be between [`[$small]`] and [`[$big]`] people. Use an inequality to solve this problem. *Solution*: This city's homeless population will be between [`[$small]`] and [`[$big]`] people between the year [__________]{$ans1} (smaller value) and the year [__________]{$ans2} (bigger value). diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd86.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd86.pg index 38771919de..c51b8fe1a7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd86.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd86.pg @@ -7,14 +7,18 @@ # Last updated: Yao, 06/28/2016 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -24,7 +28,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg index fda0d3bd6e..f778906335 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## MLT(compoundinequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. @@ -142,17 +149,13 @@ $ALT = "Graph of an interval on a number line. The segment from $a to $b is shad BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. - -Please type: +Solve this compound inequality, and write your answer in _interval notation_. -* *inf* for [`\infty`], -* *DNE* for "no solution" -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg index 9f1b2f1470..538e5c2f0e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## MLT(compoundinequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. @@ -134,17 +141,13 @@ $ALT = "Graph of an interval on a number line. The segment from $a to $b is shad BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. - -Please type: +Solve this compound inequality, and write your answer in _interval notation_. -* *inf* for [`\infty`], -* *DNE* for "no solution" -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg index ee83046dec..3239e5511c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## MLT(compoundinequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. @@ -173,17 +180,13 @@ if ($direction eq 'left') { BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. - -Please type: +Solve this compound inequality, and write your answer in _interval notation_. -* *inf* for [`\infty`], -* *DNE* for "no solution" -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg index 6af7fbb1b2..c27fe967dd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## MLT(compoundinequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. @@ -133,17 +140,13 @@ $ALT = "Graph of a number line. Nothing on the number line is shaded. Above the BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. - -Please type: +Solve this compound inequality, and write your answer in _interval notation_. -* *inf* for [`\infty`], -* *DNE* for "no solution" -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg index 9aaf917b92..6635a03798 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## MLT(compoundinequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. @@ -136,17 +143,13 @@ $ALT = "Graph of a number line. The whole number line is shaded. Above the numbe BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. - -Please type: +Solve this compound inequality, and write your answer in _interval notation_. -* *inf* for [`\infty`], -* *DNE* for "no solution" -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg index 1891c0541b..1d608af1e9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## MLT(compoundinequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. @@ -136,17 +143,13 @@ $ALT = "Graph of a number line. Two segments are shaded. The first segment start BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. - -Please type: +Solve this compound inequality, and write your answer in _interval notation_. -* *inf* for [`\infty`], -* *DNE* for "no solution" -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg index 5bd07fd8a0..ef84012d08 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg @@ -7,31 +7,38 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## MLT(compoundinequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); #$reach is the maximum value shown on the graph. @@ -173,17 +180,13 @@ if ($direction eq 'left') { BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. - -Please type: +Solve this compound inequality, and write your answer in _interval notation_. -* *inf* for [`\infty`], -* *DNE* for "no solution" -* *U* for the union symbol [`\cup`] +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg index 76995e6363..5ba55514aa 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg @@ -7,30 +7,37 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); @@ -149,17 +156,17 @@ $ALT = "Graph of a number line. Two segments are shaded. The first segment start BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. +Solve this compound inequality, and write your answer in _interval notation_. Please type: * *inf* for [`\infty`], -* *DNE* for "no solution" +* [|DNE|]* for "no solution" * *U* for the union symbol [`\cup`] [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1Original] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg index ca231058bd..1318ad7ad3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg @@ -7,31 +7,37 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## MLT(compoundinequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); @@ -154,17 +160,17 @@ $ALT = "Graph of a number line. Two segments are shaded. The first segment start BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. +Solve this compound inequality, and write your answer in _interval notation_. Please type: * *inf* for [`\infty`], -* *DNE* for "no solution" +* [|DNE|]* for "no solution" * *U* for the union symbol [`\cup`] [`` [$left0] [$symbol0Original] [$right0] \text{ or } [$left1] [$symbol1Original] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg index d480fffae4..b9c219fa19 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg @@ -7,31 +7,37 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## MLT(compoundinequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); @@ -192,17 +198,17 @@ if ($direction eq 'left') { BEGIN_PGML -Solve this compound inequality, and write your answer in *interval notation*. +Solve this compound inequality, and write your answer in _interval notation_. Please type: * *inf* for [`\infty`], -* *DNE* for "no solution" +* [|DNE|]* for "no solution" * *U* for the union symbol [`\cup`] [`` [$left0] [$symbol0Original] [$right0] \text{ or } [$left1] [$symbol1Original] [$right1] ``] -Solution: [___________]{$ans} +[___________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation50.pg new file mode 100644 index 0000000000..158abf304a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation50.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,2,1); +$b = random($a+1,4,1); +$leftType = random(0,1,1)==0 ? ')' : ']'; +$rightType = random(0,1,1)==0 ? '(' : '['; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$a $leftType U $rightType $b,inf)"); + +Context("Numeric"); + +$aspectRatio = 1/5; +$horPixel = 240; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 6; +$pixel = 2*$reach/240; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); + +#make the graphs +$gr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, + size=>[$horPixel,$verPixel]); +$gr->moveTo(0,0); +$gr->arrowTo($reach-2*$pixel,0,'black',1); +$gr->moveTo(0,0); +$gr->arrowTo(-$reach+2*$pixel,0,'black',1); + +@ticks = (); +for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); +$gr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); +$gr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); + +$shadingoffset = $verticalSpace/1.2; +$gr->lb( new Label($a,$shadingoffset,$leftType,'blue','center','middle','giant')); +$gr->moveTo($a,$shadingoffset); +$gr->arrowTo(-$reach+2*$pixel,$shadingoffset,'blue',1); + +$gr->lb( new Label($b,$shadingoffset,$rightType,'blue','center','middle','giant')); +$gr->moveTo($b,$shadingoffset); +$gr->arrowTo($reach-2*$pixel,$shadingoffset,'blue',1); + + +$alt = "This is graph of an interval on a number line. There is a $leftType at $a and everything to the left of $a is shaded; there is a $rightType at $b and everything to the right of $b is shaded."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it in interval notation. + +>> [@image( insertGraph($gr), width=>$screenXSize, tex_size=>$hardCopyPercent, + extra_html_tags=>"title='$alt' alt= '$alt' align='top'" ) @]* << + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], [|>=|]* for [`\geq`], capitalized U for the union symbol.!)@]** + + In interval notation: [_____________________]{$intans} + + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation60.pg new file mode 100644 index 0000000000..4a1eba1143 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToIntervalNotation60.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,2,1); +$b = random($a+1,4,1); +$leftType = random(0,1,1)==0 ? '(' : '['; +$rightType = random(0,1,1)==0 ? ')' : ']'; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("$leftType $a,$b $rightType"); + +Context("Numeric"); + +$aspectRatio = 1/5; +$horPixel = 240; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 6; +$pixel = 2*$reach/240; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); + +#make the graphs +$gr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, + size=>[$horPixel,$verPixel]); +$gr->moveTo(0,0); +$gr->arrowTo($reach-2*$pixel,0,'black',1); +$gr->moveTo(0,0); +$gr->arrowTo(-$reach+2*$pixel,0,'black',1); + +@ticks = (); +for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); +$gr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); +$gr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); + +$shadingoffset = $verticalSpace/1.2; +$gr->lb( new Label($a,$shadingoffset,$leftType,'blue','center','middle','giant')); +$gr->moveTo($a,$shadingoffset); +$gr->lineTo($b,$shadingoffset,'blue',1); +$gr->lb( new Label($b,$shadingoffset,$rightType,'blue','center','middle','giant')); + +$alt = "This is graph of an interval on a number line. There is a $leftType at $a and a $rightType at $b. The segment in between is shaded."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it in interval notation. + +>> [@image( insertGraph($gr), width=>$screenXSize, tex_size=>$hardCopyPercent, + extra_html_tags=>"title='$alt' alt= '$alt' align='top'" ) @]* << + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], [|>=|]* for [`\geq`], capitalized U for the union symbol.!)@]** + + In interval notation: [_____________________]{$intans} + + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg index a8f55cd6f2..8c6f2d9514 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg @@ -8,30 +8,34 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphto_build_and_interval) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserPopUp.pl", "contextInequalitySetBuilder.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", ); ############################################## @@ -44,103 +48,51 @@ $symbol = '>'; InequalitySetBuilder::UseVerticalSuchThat(); Context("InequalitySetBuilder-Only"); -$setans = Compute("{ x | x $symbol $a}"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var $symbol $a}"); Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); $intans = Compute("($a,inf)"); Context("Numeric"); -%answer = (leftType => 'open', - rightType => 'inf', #use 'inf' regardles of +/- inf - ); - - -$aspectRatio = 1/8; -$horPixel = 400; -$verPixel = $horPixel*$aspectRatio; -$screenXSize = $horPixel; -$screenYSize = $screenXSize*$aspectRatio; -$reach = 5; -$verticalSpace = $reach*$aspectRatio; -$hardCopyPercent = 1000; #meaning 100% - - -#initializing... -@gr=(); - -#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. -@indices=(); - - -#make the graphs -for $leftType ('open','closed', 'inf') -{ - for $rightType ('open','closed', 'inf') - { - my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, - axes=>[$reach+1,0], - size=>[$horPixel,$verPixel] - ); - @ticks = (); - for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; - - $tempgr->h_ticks(0,"black",@ticks); - $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); - - if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) - { - $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); - if ($leftType eq 'open' or $rightType eq 'open') - { - $tempgr->stamps( open_circle($a,0,'blue') ) - } - else - { - $tempgr->stamps( closed_circle($a,0,'blue') ) - }; - $tempgr->moveTo($a,0); - if ($leftType eq 'inf') {$tempgr->arrowTo(-0.99*$reach,0,'blue',3)} - else {$tempgr->arrowTo(0.99*$reach,0,'blue',3)}; - push(@gr,$tempgr); - if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) - {push(@indices, $#gr);} - else {unshift(@indices, $#gr);} - } - -}}; - -$alt = "Graph of an interval on a number line. There is a hollow circle at $a and everything right of that is shaded."; +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[openinfiniteinterval] coordinates {($a,0) (6,0)}; +\end{axis} +END_TIKZ + + +$alt = "Graph of an interval on a number line. There is a left parenthesis at $a and everything right of that is shaded. To the right of the axis, there is a letter $var."; ############################################## -$refreshCachedImages = 1; -Context()->texStrings; -BEGIN_TEXT -Here is a graph of an interval.$PAR - -$BCENTER -\{ image( insertGraph($gr[ $indices[0] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, - extra_html_tags=>'title="$alt" alt= "$alt" align="top"' ) \} -$ECENTER -$PAR -END_TEXT -Context()->normalStrings; BEGIN_PGML -Please type: +For the interval expressed in the number line, write it using set-builder notation and interval notation. + +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** - Write this inequality in set-builder notation: [_____________________] - -An example of set-builder notation is [`\{x\mid x>9\}`]. The *|* symbol is above the keyboard's Enter key. +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** +[_]{$setans}{30} - Write this inequality in interval notation: [_____________________] +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** +[_]{$intans}{30} END_PGML @@ -149,13 +101,10 @@ END_PGML ############################################## -ANS( $setans->cmp() ); - -ANS( $intans->cmp() ); BEGIN_PGML_SOLUTION -Since the given graph shades all the values greater than [`[$a]`] (but not equal to [`[$a]`]) the graph represents the inequality [`x [$symbol] [$a]`]. +Since the given graph shades all the values greater than [`[$a]`] (but not equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. The corresponding set notation is [`[$setans]`]. @@ -164,3 +113,4 @@ The corresponding interval notation is [`[$intans]`]. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg index 42072c18cd..eef96ac55e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg @@ -8,29 +8,34 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphto_build_and_interval) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserPopUp.pl", "contextInequalitySetBuilder.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", ); ############################################## @@ -43,105 +48,51 @@ $symbol = '\ge'; InequalitySetBuilder::UseVerticalSuchThat(); Context("InequalitySetBuilder-Only"); -$setans = Compute("{ x | x >= $a}"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var >= $a}"); Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); $intans = Compute("[$a,inf)"); Context("Numeric"); -%answer = (leftType => 'closed', - rightType => 'inf', #use 'inf' regardles of +/- inf - ); - - -$aspectRatio = 1/8; -$horPixel = 400; -$verPixel = $horPixel*$aspectRatio; -$screenXSize = $horPixel; -$screenYSize = $screenXSize*$aspectRatio; -$reach = 5; -$verticalSpace = $reach*$aspectRatio; -$hardCopyPercent = 1000; #meaning 100% - - -#initializing... -@gr=(); - -#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. -@indices=(); - - -#make the graphs -for $leftType ('open','closed', 'inf') -{ - for $rightType ('open','closed', 'inf') - { - my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, - axes=>[$reach+1,0], - size=>[$horPixel,$verPixel] - ); - @ticks = (); - for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; - - $tempgr->h_ticks(0,"black",@ticks); - $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); - - if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) - { - $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); - if ($leftType eq 'open' or $rightType eq 'open') - { - $tempgr->stamps( open_circle($a,0,'blue') ) - } - else - { - $tempgr->stamps( closed_circle($a,0,'blue') ) - }; - $tempgr->moveTo($a,0); - if ($leftType eq 'inf') {$tempgr->arrowTo(-0.99*$reach,0,'blue',3)} - else {$tempgr->arrowTo(0.99*$reach,0,'blue',3)}; - push(@gr,$tempgr); - if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) - {push(@indices, $#gr);} - else {unshift(@indices, $#gr);} - } - -}}; - -$alt = "Graph of an interval on a number line. There is a filled circle at $a and everything right of that is shaded."; +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[closedinfiniteinterval] coordinates {($a,0) (6,0)}; +\end{axis} +END_TIKZ + + +$alt = "Graph of an interval on a number line. There is a left bracket at $a and everything right of that is shaded. To the right of the axis, there is a letter $var."; ############################################## -$refreshCachedImages = 1; - -Context()->texStrings; -BEGIN_TEXT -Here is a graph of an interval.$PAR -$BCENTER -\{ image( insertGraph($gr[ $indices[0] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, - extra_html_tags=>'title="$alt" alt="$alt" align="top"' ) \} -$ECENTER -$PAR -END_TEXT -Context()->normalStrings; BEGIN_PGML -Please type: +For the interval expressed in the number line, write it using set-builder notation and interval notation. -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << - Write this inequality in set-builder notation: [_____________________] +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** - An example of set-builder notation is [`\{x\mid x>9\}`]. The *|* symbol is above the keyboard's Enter key. - - - Write this inequality in interval notation: [_____________________] +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** +[_]{$setans}{30} +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** +[_]{$intans}{30} END_PGML @@ -149,13 +100,9 @@ END_PGML ############################################## -ANS( $setans->cmp() ); - -ANS( $intans->cmp() ); - BEGIN_PGML_SOLUTION -Since the given graph shades all the values greater than [`[$a]`] (and equal to [`[$a]`]) the graph represents the inequality [`x [$symbol] [$a]`]. +Since the given graph shades all the values greater than [`[$a]`] (and equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. The corresponding set notation is [`[$setans]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg index f0fd0b157a..11039f4549 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg @@ -8,29 +8,34 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphto_build_and_interval) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserPopUp.pl", "contextInequalitySetBuilder.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", ); ############################################## @@ -43,104 +48,50 @@ $symbol = '<'; InequalitySetBuilder::UseVerticalSuchThat(); Context("InequalitySetBuilder-Only"); -$setans = Compute("{ x | x $symbol $a}"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var $symbol $a}"); Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); $intans = Compute("(-inf,$a)"); Context("Numeric"); -%answer = (leftType => 'inf', - rightType => 'open', #use 'inf' regardles of +/- inf - ); - - -$aspectRatio = 1/8; -$horPixel = 400; -$verPixel = $horPixel*$aspectRatio; -$screenXSize = $horPixel; -$screenYSize = $screenXSize*$aspectRatio; -$reach = 5; -$verticalSpace = $reach*$aspectRatio; -$hardCopyPercent = 1000; #meaning 100% - - -#initializing... -@gr=(); - -#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. -@indices=(); - - -#make the graphs -for $leftType ('open','closed', 'inf') -{ - for $rightType ('open','closed', 'inf') - { - my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, - axes=>[$reach+1,0], - size=>[$horPixel,$verPixel] - ); - @ticks = (); - for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; - - $tempgr->h_ticks(0,"black",@ticks); - $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); - - if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) - { - $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); - if ($leftType eq 'open' or $rightType eq 'open') - { - $tempgr->stamps( open_circle($a,0,'blue') ) - } - else - { - $tempgr->stamps( closed_circle($a,0,'blue') ) - }; - $tempgr->moveTo($a,0); - if ($leftType eq 'inf') {$tempgr->arrowTo(-0.99*$reach,0,'blue',3)} - else {$tempgr->arrowTo(0.99*$reach,0,'blue',3)}; - push(@gr,$tempgr); - if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) - {push(@indices, $#gr);} - else {unshift(@indices, $#gr);} - } - -}}; - -$alt = "Graph of an interval on a number line. There is a hollow circle at $a and everything left of that is shaded."; +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[infiniteopeninterval] coordinates {(-6,0) ($a,0)}; +\end{axis} +END_TIKZ + +$alt = "Graph of an interval on a number line. There is a right parenthesis at $a and everything left of that is shaded. To the right of the axis, there is a letter $var."; ############################################## -$refreshCachedImages = 1; - -Context()->texStrings; -BEGIN_TEXT -Here is a graph of an interval.$PAR -$BCENTER -\{ image( insertGraph($gr[ $indices[0] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, - extra_html_tags=>'title="$alt" alt="$alt" align="top"' ) \} -$ECENTER -$PAR -END_TEXT -Context()->normalStrings; BEGIN_PGML -Please type: +For the interval expressed in the number line, write it using set-builder notation and interval notation. -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << - Write this inequality in set-builder notation: [_____________________] +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** - An example of set-builder notation is [`\{x\mid x>9\}`]. The *|* symbol is above the keyboard's Enter key. +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** +[_]{$setans}{30} - Write this inequality in interval notation: [_____________________] - +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** +[_]{$intans}{30} END_PGML @@ -149,13 +100,9 @@ END_PGML ############################################## -ANS( $setans->cmp() ); - -ANS( $intans->cmp() ); - BEGIN_PGML_SOLUTION -Since the given graph shades all the values less than [`[$a]`] (but not equal to [`[$a]`]) the graph represents the inequality [`x [$symbol] [$a]`]. +Since the given graph shades all the values less than [`[$a]`] (but not equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. The corresponding set notation is [`[$setans]`]. @@ -164,3 +111,4 @@ The corresponding interval notation is [`[$intans]`]. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg index 6a91910d30..50758c6a8b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg @@ -8,29 +8,34 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(graphto_build_and_interval) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserPopUp.pl", "contextInequalitySetBuilder.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", ); ############################################## @@ -39,122 +44,65 @@ Context("Numeric"); $a = random(-4,4,0.5); -$symbol = '<'; +$symbol = '\leq'; InequalitySetBuilder::UseVerticalSuchThat(); Context("InequalitySetBuilder-Only"); -$setans = Compute("{ x | x<= $a}"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var <= $a}"); Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); $intans = Compute("(-inf,$a]"); Context("Numeric"); -%answer = (leftType => 'inf', - rightType => 'closed', #use 'inf' regardles of +/- inf - ); - - -$aspectRatio = 1/8; -$horPixel = 400; -$verPixel = $horPixel*$aspectRatio; -$screenXSize = $horPixel; -$screenYSize = $screenXSize*$aspectRatio; -$reach = 5; -$verticalSpace = $reach*$aspectRatio; -$hardCopyPercent = 1000; #meaning 100% - - -#initializing... -@gr=(); - -#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. -@indices=(); - - -#make the graphs -for $leftType ('open','closed', 'inf') -{ - for $rightType ('open','closed', 'inf') - { - my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, - axes=>[$reach+1,0], - size=>[$horPixel,$verPixel] - ); - @ticks = (); - for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; - - $tempgr->h_ticks(0,"black",@ticks); - $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); - - if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) - { - $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); - if ($leftType eq 'open' or $rightType eq 'open') - { - $tempgr->stamps( open_circle($a,0,'blue') ) - } - else - { - $tempgr->stamps( closed_circle($a,0,'blue') ) - }; - $tempgr->moveTo($a,0); - if ($leftType eq 'inf') {$tempgr->arrowTo(-0.99*$reach,0,'blue',3)} - else {$tempgr->arrowTo(0.99*$reach,0,'blue',3)}; - push(@gr,$tempgr); - if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) - {push(@indices, $#gr);} - else {unshift(@indices, $#gr);} - } - -}}; - -$alt = "Graph of an interval on a number line. There is a filled circle at $a and everything left of that is shaded."; +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[infiniteclosedinterval] coordinates {(-6,0) ($a,0)}; +\end{axis} +END_TIKZ + +$alt = "Graph of an interval on a number line. There is a right bracket at $a and everything left of that is shaded. To the right of the axis, there is a letter $var."; ############################################## -$refreshCachedImages = 1; - -Context()->texStrings; -BEGIN_TEXT -Here is a graph of an interval.$PAR -$BCENTER -\{ image( insertGraph($gr[ $indices[0] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, - extra_html_tags=>'title="$alt" alt="$alt" align="top"' ) \} -$ECENTER -$PAR -END_TEXT -Context()->normalStrings; BEGIN_PGML -Please type: +For the interval expressed in the number line, write it using set-builder notation and interval notation. -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << - Write this inequality in set-builder notation: [_____________________] +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** - An example of set-builder notation is [`\{x\mid x>9\}`]. The *|* symbol is above the keyboard's Enter key. +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** +[_]{$setans}{30} - Write this inequality in interval notation: [_____________________] - +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** +[_]{$intans}{30} END_PGML -############################################## - -ANS( $setans->cmp() ); -ANS( $intans->cmp() ); +############################################## BEGIN_PGML_SOLUTION -Since the given graph shades all the values less than [`[$a]`] (and equal to [`[$a]`]) the graph represents the inequality [`x [$symbol] [$a]`]. +Since the given graph shades all the values less than [`[$a]`] (and equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. The corresponding set notation is [`[$setans]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg new file mode 100644 index 0000000000..db10e77b45 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Tell whether a number x is a solution of an inequality ax+b>c. +# a, b, c are positive or negative integers. +# +# Last updated: Jordan 8/28/13; Carl Yao, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear') +## DBCCSS('7.EE.4','A-REI.3','6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unionTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +$symbol = '>'; + +$a=random(2,5,1)*random(-1,1,2); +$cMinusB = random(1,5,1)*$a; +$c=random(-10,10,1); +$b=$c-$cMinusB; + +$critical = ($c-$b)/$a; + +$popupYes = PopUp( + ['?',"is","is not"], + 1, +); + +$popupNo = PopUp( + ['?',"is","is not"], + 2, +); + + + +do {$x1=random($critical-10,$critical-1,1);} until ($x1!=0); +if ($a*$x1+$b>$c) { +$popup1 = $popupYes; +} +else { +$popup1 = $popupNo; +} + +$x2=$critical; +$popup2 = $popupNo; + +$x3=0; +if ($a*$x3+$b>$c) { +$popup3 = $popupYes; +} +else { +$popup3 = $popupNo; +} + + +do {$x4=random($critical+1,$critical+10,1);} until ($x4!=0); +if ($a*$x4+$b>$c) { +$popup4 = $popupYes; +} +else { +$popup4 = $popupNo; +} + + +if ($popup1 == $popupYes) {$trueFalse1 = 'true'; $isIsNot1 = 'is';} + else {$trueFalse1 = 'not true'; $isIsNot1 = 'is not';}; +if ($popup2 == $popupYes) {$trueFalse2 = 'true'; $isIsNot2 = 'is';} + else {$trueFalse2 = 'not true'; $isIsNot2 = 'is not';}; +if ($popup3 == $popupYes) {$trueFalse3 = 'true'; $isIsNot3 = 'is';} + else {$trueFalse3 = 'not true'; $isIsNot3 = 'is not';} +if ($popup4 == $popupYes) {$trueFalse4 = 'true'; $isIsNot4 = 'is';} + else {$trueFalse4 = 'not true'; $isIsNot4 = 'is not';}; + +#randomize the answers +$ref_ans = [ + [ $x1, $popup1, $trueFalse1, $isIsNot1], + [ $x2, $popup2, $trueFalse2, $isIsNot2], + [ $x3, $popup3, $trueFalse3, $isIsNot3], + [ $x4, $popup4, $trueFalse4, $isIsNot4], +]; + +for ($i=0;$i<=2;$i++) { + $j=random(0,3,1); + do {$k=random(0,3,1);} until ($j!=$k); + $temp=$ref_ans->[$j]; + $ref_ans->[$j]=$ref_ans->[$k]; + $ref_ans->[$k]=$temp; +} + +($x0,$x1,$x2,$x3) = ($ref_ans->[0][0],$ref_ans->[1][0],$ref_ans->[2][0],$ref_ans->[3][0]); +($popup0,$popup1,$popup2,$popup3) = ($ref_ans->[0][1],$ref_ans->[1][1],$ref_ans->[2][1],$ref_ans->[3][1]); +($trueFalse0,$trueFalse1,$trueFalse2,$trueFalse3) = ($ref_ans->[0][2],$ref_ans->[1][2],$ref_ans->[2][2],$ref_ans->[3][2]); +($isIsNot0,$isIsNot1,$isIsNot2,$isIsNot3) = ($ref_ans->[0][3],$ref_ans->[1][3],$ref_ans->[2][3],$ref_ans->[3][3]); + + + +############################################## + +TEXT(beginproblem()); + + +BEGIN_PGML + +Decide whether each value is a solution to the given inequality. + +[`` [$a] x +[$b] [$symbol] [$c] ``] +a. [`x=[$x0]`] [__]{$popup0} a solution. + +b. [`x=[$x1]`] [__]{$popup1} a solution. + +c. [`x=[$x2]`] [__]{$popup2} a solution. + +d. [`x=[$x3]`] [__]{$popup3} a solution. + + + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +We substitute each [`x`] value into the inequality [` [$a] x + [$b] [$symbol] [$c]`] and see whether the inequality is true. + +a. [` \begin{aligned}[t] + [$a] ([$x0]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x0+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse0], [$x0] [$isIsNot0] a solution to the inequality. +---- +b. [` \begin{aligned}[t] + [$a] ([$x1]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x1+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse1], [$x1] [$isIsNot1] a solution to the inequality. +---- +c. [` \begin{aligned}[t] + [$a] ([$x2]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x2+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse2], [$x2] [$isIsNot2] a solution to the inequality. +---- +d. [` \begin{aligned}[t] + [$a] ([$x3]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x3+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse3], [$x3] [$isIsNot3] a solution to the inequality. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot20.pg new file mode 100644 index 0000000000..fae79dcba9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot20.pg @@ -0,0 +1,178 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Tell whether a number x is a solution of an inequality ax+b>=c. +# a, b, c are positive or negative integers. +# +# Last updated: Jordan 8/29/13; Carl Yao, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear') +## DBCCSS('7.EE.4','A-REI.3',,'6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unionTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +$symbol = '\ge'; + +$a=random(2,5,1)*random(-1,1,2); +$cMinusB = random(1,5,1)*$a; +$c=random(-10,10,1); +$b=$c-$cMinusB; + +$critical = ($c-$b)/$a; + +$popupYes = PopUp( + ['?',"is","is not"], + 1, +); + +$popupNo = PopUp( + ['?',"is","is not"], + 2, +); + + + +do {$x1=random($critical-10,$critical-1,1);} until ($x1!=0); +if ($a*$x1+$b>=$c) { +$popup1 = $popupYes; +} +else { +$popup1 = $popupNo; +} + +$x2=$critical; +if ($a*$x2+$b>=$c) { +$popup2 = $popupYes; +} +else { +$popup2 = $popupNo; +} + + +$x3=0; +if ($a*$x3+$b>=$c) { +$popup3 = $popupYes; +} +else { +$popup3 = $popupNo; +} + + +do {$x4=random($critical+1,$critical+10,1);} until ($x4!=0); +if ($a*$x4+$b>=$c) { +$popup4 = $popupYes; +} +else { +$popup4 = $popupNo; +} + + +if ($popup1 == $popupYes) {$trueFalse1 = 'true'; $isIsNot1 = 'is';} + else {$trueFalse1 = 'not true'; $isIsNot1 = 'is not';}; +if ($popup2 == $popupYes) {$trueFalse2 = 'true'; $isIsNot2 = 'is';} + else {$trueFalse2 = 'not true'; $isIsNot2 = 'is not';}; +if ($popup3 == $popupYes) {$trueFalse3 = 'true'; $isIsNot3 = 'is';} + else {$trueFalse3 = 'not true'; $isIsNot3 = 'is not';} +if ($popup4 == $popupYes) {$trueFalse4 = 'true'; $isIsNot4 = 'is';} + else {$trueFalse4 = 'not true'; $isIsNot4 = 'is not';}; + +#randomize the answers +$ref_ans = [ + [ $x1, $popup1, $trueFalse1, $isIsNot1], + [ $x2, $popup2, $trueFalse2, $isIsNot2], + [ $x3, $popup3, $trueFalse3, $isIsNot3], + [ $x4, $popup4, $trueFalse4, $isIsNot4], +]; + +for ($i=0;$i<=2;$i++) { + $j=random(0,3,1); + do {$k=random(0,3,1);} until ($j!=$k); + $temp=$ref_ans->[$j]; + $ref_ans->[$j]=$ref_ans->[$k]; + $ref_ans->[$k]=$temp; +} + +($x0,$x1,$x2,$x3) = ($ref_ans->[0][0],$ref_ans->[1][0],$ref_ans->[2][0],$ref_ans->[3][0]); +($popup0,$popup1,$popup2,$popup3) = ($ref_ans->[0][1],$ref_ans->[1][1],$ref_ans->[2][1],$ref_ans->[3][1]); +($trueFalse0,$trueFalse1,$trueFalse2,$trueFalse3) = ($ref_ans->[0][2],$ref_ans->[1][2],$ref_ans->[2][2],$ref_ans->[3][2]); +($isIsNot0,$isIsNot1,$isIsNot2,$isIsNot3) = ($ref_ans->[0][3],$ref_ans->[1][3],$ref_ans->[2][3],$ref_ans->[3][3]); + + +############################################## + +TEXT(beginproblem()); + + +BEGIN_PGML + +Decide whether each value is a solution to the given inequality. + +[`` [$a] x +[$b] [$symbol] [$c] ``] +a. [`x=[$x0]`] [__]{$popup0} a solution. + +b. [`x=[$x1]`] [__]{$popup1} a solution. + +c. [`x=[$x2]`] [__]{$popup2} a solution. + +d. [`x=[$x3]`] [__]{$popup3} a solution. + + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We substitute each [`x`] value into the inequality [` [$a] x + [$b] [$symbol] [$c]`] and see whether the inequality is true. + +a. [` \begin{aligned}[t] + [$a] ([$x0]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x0+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse0], [$x0] [$isIsNot0] a solution to the inequality. +---- +b. [` \begin{aligned}[t] + [$a] ([$x1]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x1+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse1], [$x1] [$isIsNot1] a solution to the inequality. +---- +c. [` \begin{aligned}[t] + [$a] ([$x2]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x2+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse2], [$x2] [$isIsNot2] a solution to the inequality. +---- +d. [` \begin{aligned}[t] + [$a] ([$x3]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x3+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse3], [$x3] [$isIsNot3] a solution to the inequality. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg new file mode 100644 index 0000000000..78d6413919 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg @@ -0,0 +1,180 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Tell whether a number x is a solution of an inequality c<=b+ax. +# a, b, c are positive or negative integers. +# +# Last updated: Jordan 8/29/13; Carl Yao, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear') +## DBCCSS('7.EE.4','A-REI.3',,'6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unionTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +$symbol = '\le'; + +$a=random(2,5,1)*random(-1,1,2); +$cMinusB = random(1,5,1)*$a; +$c=random(-10,10,1); +$b=$c-$cMinusB; + +$critical = ($c-$b)/$a; + + +$popupYes = PopUp( + ['?',"is","is not"], + 1, +); + +$popupNo = PopUp( + ['?',"is","is not"], + 2, +); + + +do {$x1=random($critical-10,$critical-1,1);} until ($x1!=0); +if ($a*$x1+$b<=$c) { +$popup1 = $popupYes; +} +else { +$popup1 = $popupNo; +} + +$x2=$critical; +if ($a*$x2+$b<=$c) { +$popup2 = $popupYes; +} +else { +$popup2 = $popupNo; +} + + +$x3=0; +if ($a*$x3+$b<=$c) { +$popup3 = $popupYes; +} +else { +$popup3 = $popupNo; +} + + +do {$x4=random($critical+1,$critical+10,1);} until ($x4!=0); +if ($a*$x4+$b<=$c) { +$popup4 = $popupYes; +} +else { +$popup4 = $popupNo; +} + + +if ($popup1 == $popupYes) {$trueFalse1 = 'true'; $isIsNot1 = 'is';} + else {$trueFalse1 = 'not true'; $isIsNot1 = 'is not';}; +if ($popup2 == $popupYes) {$trueFalse2 = 'true'; $isIsNot2 = 'is';} + else {$trueFalse2 = 'not true'; $isIsNot2 = 'is not';}; +if ($popup3 == $popupYes) {$trueFalse3 = 'true'; $isIsNot3 = 'is';} + else {$trueFalse3 = 'not true'; $isIsNot3 = 'is not';} +if ($popup4 == $popupYes) {$trueFalse4 = 'true'; $isIsNot4 = 'is';} + else {$trueFalse4 = 'not true'; $isIsNot4 = 'is not';}; + +#randomize the answers +$ref_ans = [ + [ $x1, $popup1, $trueFalse1, $isIsNot1], + [ $x2, $popup2, $trueFalse2, $isIsNot2], + [ $x3, $popup3, $trueFalse3, $isIsNot3], + [ $x4, $popup4, $trueFalse4, $isIsNot4], +]; + +for ($i=0;$i<=2;$i++) { + $j=random(0,3,1); + do {$k=random(0,3,1);} until ($j!=$k); + $temp=$ref_ans->[$j]; + $ref_ans->[$j]=$ref_ans->[$k]; + $ref_ans->[$k]=$temp; +} + +($x0,$x1,$x2,$x3) = ($ref_ans->[0][0],$ref_ans->[1][0],$ref_ans->[2][0],$ref_ans->[3][0]); +($popup0,$popup1,$popup2,$popup3) = ($ref_ans->[0][1],$ref_ans->[1][1],$ref_ans->[2][1],$ref_ans->[3][1]); +($trueFalse0,$trueFalse1,$trueFalse2,$trueFalse3) = ($ref_ans->[0][2],$ref_ans->[1][2],$ref_ans->[2][2],$ref_ans->[3][2]); +($isIsNot0,$isIsNot1,$isIsNot2,$isIsNot3) = ($ref_ans->[0][3],$ref_ans->[1][3],$ref_ans->[2][3],$ref_ans->[3][3]); + + +############################################## + +TEXT(beginproblem()); + + +BEGIN_PGML + +Decide whether each value is a solution to the given inequality. + +[`` [$a] x +[$b] [$symbol] [$c] ``] +a. [`x=[$x0]`] [__]{$popup0} a solution. + +b. [`x=[$x1]`] [__]{$popup1} a solution. + +c. [`x=[$x2]`] [__]{$popup2} a solution. + +d. [`x=[$x3]`] [__]{$popup3} a solution. + + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +We substitute each [`x`] value into the inequality [` [$a] x + [$b] [$symbol] [$c]`] and see whether the inequality is true. + +a. [` \begin{aligned}[t] + [$a] ([$x0]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x0+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse0], [$x0] [$isIsNot0] a solution to the inequality. +---- +b. [` \begin{aligned}[t] + [$a] ([$x1]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x1+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse1], [$x1] [$isIsNot1] a solution to the inequality. +---- +c. [` \begin{aligned}[t] + [$a] ([$x2]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x2+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse2], [$x2] [$isIsNot2] a solution to the inequality. +---- +d. [` \begin{aligned}[t] + [$a] ([$x3]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x3+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse3], [$x3] [$isIsNot3] a solution to the inequality. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg index a256301fea..c632237ceb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 7/27/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LinearIneq_applic) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','interval notation','subtract','divide') +## DBCCSS('7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "parserMultiAnswer.pl", "parserNumberWithUnits.pl", "contextCurrency.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -76,7 +79,12 @@ $multians = MultiAnswer($left, $comparitor, $right)->with( } ); - +$newUnits = [ + {name=>'miles',conversion=>{factor=>5280*12*2.54/100,m=>1}}, + {name=>'mile',conversion=>{factor=>5280*12*2.54/100,m=>1}}, + {name=>'mi',conversion=>{factor=>5280*12*2.54/100,m=>1}}, +]; +$miles = NumberWithUnits("$m miles",{newUnit=>$newUnits}); ############################################## @@ -84,31 +92,17 @@ TEXT(beginproblem()); BEGIN_PGML -You are riding in a taxi and can only pay with cash. You have to pay a flat fee of [`[$ac]`], and then pay [`[$bc]`] per mile. You have a total of [`[$cc]`] in your pocket. - -Let [`x`] be the number of miles the taxi will drive you. You want to know how many miles you can afford. Write an inequality to represent this situation in terms of how many miles you can afford: - - -Your inequality has three parts, a left side, a right side, and a comparison operator in the middle: [`<`], [`>`], [`\leq`], [`\geq`], [`=`], or [`\neq`]. Enter these as *<*, *>*, *<=*, *>=*, *=*, and *!=*. - -END_PGML -BEGIN_TEXT -$PAR -$BCENTER -\{$multians->ans_rule(10)\} \{$multians->ans_rule(2)\} \{$multians->ans_rule(10)\} -$ECENTER -$PAR -END_TEXT -ANS( $multians->cmp() ); -BEGIN_PGML - -Solve this inequality. At most how many miles can you afford? +You are riding in a taxi and can only pay with cash. You have to pay a flat fee of [`[$ac]`], and then pay [`[$bc]`] per mile. You have a total of [`[$cc]`] in your pocket. Let [`x`] be the number of miles the taxi will drive you. You want to know how many miles you can afford. - You can afford at most [___]{$m} miles. +a. Write an inequality to represent this situation in terms of how many miles you can afford. + [@KeyboardInstructions(q?Your inequality has three parts, a left side, a right side, and a comparison operator in the middle: [`<`], [`>`], [`\leq`], [`\geq`], [`=`], or [`\neq`]. Enter these as [|<|], [|>|]*, [|<=|]*, [|>=|]*, [|=|]*, and [|!=|]*.?)@]** + [__]{$multians}{width=>10} [__]{$multians}{width=>2} [__]{$multians}{width=>10} -Use interval notation to express the number of miles you can afford. +a. Solve this inequality. At most how many miles can you afford? + [___]{$miles} - [________]{$interval} +a. Use interval notation to express the number of miles you can afford. + [________]{$interval} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg index 0418b1a08e..a93193f02f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg @@ -6,17 +6,18 @@ # Last updated: Jordan 8/29/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-CED.1','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LinearIneq_applic) -## MLTleader(1) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','set notation','interval notation','multiply','subtract') +## DBCCSS('7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,13 +28,14 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserMultiAnswer.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## -#package MultiAnswer; -#our $separator = ' '; -#package main; +package MultiAnswer; +our $separator = ' '; +package main; Context("Numeric"); @@ -64,17 +66,10 @@ $multians = MultiAnswer($left, $comparitor, $right)->with( my ( $correct, $student, $self ) = @_; my ( $stuLeft, $stuComp, $stuRight ) = @{$student}; my ( $corLeft, $corComp, $corRight ) = @{$correct}; - my $stuExpr = Formula("$stuLeft - $stuRight"); - my $coeff = $stuExpr->D('x'); - if (!($coeff -> isConstant) or $coeff == Formula(0)){ return 0; } - $stuExpr = $stuExpr/$coeff; - if ($stuExpr == 3*($corLeft - $corRight)){ - if ( ($coeff > 0 && $stuComp == $corComp) or - ($coeff<0 && $stuComp == $opposite) ){ - return 1; - } - } - else { return 0;} + if ( ($corLeft == $stuLeft && $corComp == $stuComp && $corRight == $stuRight) || + ($corLeft == $stuRight && $opposite == $stuComp && $corRight == $stuLeft) ) { + return 1; + } } ); @@ -85,21 +80,20 @@ TEXT(beginproblem()); BEGIN_PGML [%Not using percentages to avoid confusion%] -Your grade in a class is determined by the average of three test scores. You scored [`[$a]`] and [`[$b]`] points on the first two tests. To get an average score of at least [`[$m]`] points on the three tests, how many points would you need on the third test? - -Let [`x`] be your score on the third test. Write an inequality to express the requirement that your average score must be at least [`[$m]`]. +Your grade in a class is determined by the average of three test scores. You scored [`[$a]`] and [`[$b]`] on the first two tests. To earn at least [`[$m]`] for this course, how much do you have to score on the third test? Let [`x`] be the score you will earn on the third test. -Your inequality has three parts, a left side, a right side, and a comparison operator in the middle: [`<`], [`>`], [`\leq`], [`\geq`], [`=`], or [`\neq`]. To type the comparison operator, enter one of these symbols: *<*, *>*, *<=*, *>=*, *=*, or *!=*. +a. Write an inequality to represent this situation. + [@KeyboardInstructions(q?Your inequality has three parts, a left side, a right side, and a comparison operator in the middle: [`<`], [`>`], [`\leq`], [`\geq`], [`=`], or [`\neq`]. Enter these as [|<|]*, [|>|]*, [|<=|]*, [|>=|]*, [|=|]*, and [|!=|]*.?)@]** + [__]{$multians}{width=>10} [__]{$multians}{width=>2} [__]{$multians}{width=>10} ->> [__________]{$multians} [__]{$multians} [__________]{$multians} << +a. Solve this inequality. What is the minimum that you have to earn on the third test in order to earn a [`[$m]`] for the course? + [___________]{$ans2} -Solve this inequality. What is the minimum score that you must earn on the third test to earn a [`[$m]`] average for the three tests? +a. You cannot score over [`100`] on the third test. Use interval notation to represent the range of scores you can earn on the third test in order to earn at least [`[$m]`] for this course. + [______________]{$interval} - [___________]{$ans2} -You cannot score over [`100`] on the third test. Use interval notation to represent the range of scores you could earn on the third test to average at least [`[$m]`] in this course. - [______________]{$interval} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation10.pg new file mode 100644 index 0000000000..1bde95f4fd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation10.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#]. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\leq'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("(-inf,$right]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation100.pg index cb2fbefff0..e3abfcca71 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation100.pg @@ -7,16 +7,18 @@ # Last updated: Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(alg_real_num_2015_setbuilder_to_interval) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -58,13 +61,13 @@ TEXT(beginproblem()); BEGIN_PGML -Change the following inequality from set-builder notation to interval notation: +A set is written using set-builder notation. Write it using interval notation. - [`` \left[$LBRACE] x \mid {[$left]} [$comp] [$right] \right[$RBRACE] ``] + [`` \left\{ x \mid {[$left]} [$comp] [$right] \right\} ``] -Please use *inf* to represent [`\infty`]. +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** - The interval notation is [_____________]{$ans->cmp(correct_ans=>$ans_string, correct_ans_latex_string=>$ans_latex_string)} + [_____________]{$ans->cmp(correct_ans=>$ans_string, correct_ans_latex_string=>$ans_latex_string)} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation110.pg index e9f9bbb416..61c0e905c4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation110.pg @@ -7,16 +7,18 @@ # Last updated: Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(alg_real_num_2015_setbuilder_to_interval) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,13 +49,13 @@ TEXT(beginproblem()); BEGIN_PGML -Change the following inequality from set-builder notation to interval notation: +A set is written using set-builder notation. Write it using interval notation. - [`` [$LBRACE] x \mid [$left] [$comp] [$right] [$RBRACE] ``] + [`` \{ x \mid [$left] [$comp] [$right] \} ``] -Please use *inf* to represent [`\infty`]. +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** - The interval notation is [_____________]{$ans}. + [_____________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation120.pg new file mode 100644 index 0000000000..2d83ad3f12 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation120.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (0,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = 0; +$comp = '\lt'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("($left,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid [$left] [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [`[$left]`] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation20.pg new file mode 100644 index 0000000000..9923a4b0cd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation20.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like [#,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\geq'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("[$right,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation30.pg new file mode 100644 index 0000000000..e0c31af91e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation30.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\lt'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("(-inf,$right)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid{[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation40.pg new file mode 100644 index 0000000000..9562bff81e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation40.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (#,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\gt'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("($right,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation50.pg index 7427f6bfdc..7ca6c1e27f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation50.pg @@ -7,16 +7,18 @@ # Last updated: Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(alg_real_num_2015_setbuilder_to_interval) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,13 +49,13 @@ TEXT(beginproblem()); BEGIN_PGML -Change the following inequality from set-builder notation to interval notation: +A set is written using set-builder notation. Write it using interval notation. - [`` [$LBRACE] x \mid {[$left]} [$comp] [$right] [$RBRACE] ``] + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] -Please use *inf* to represent [`\infty`]. +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** - The interval notation is [_____________]{$ans}. + [_____________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation60.pg index 505b1493d5..fafdf08896 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation60.pg @@ -7,16 +7,18 @@ # Last updated: Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(alg_real_num_2015_setbuilder_to_interval) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,13 +49,13 @@ TEXT(beginproblem()); BEGIN_PGML -Change the following inequality from set-builder notation to interval notation: +A set is written using set-builder notation. Write it using interval notation. - [`` [$LBRACE] x \mid {[$left]} [$comp] [$right] [$RBRACE] ``] + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] -Please use *inf* to represent [`\infty`]. +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** - The interval notation is [_____________]{$ans}. + [_____________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation70.pg new file mode 100644 index 0000000000..d1fdde4326 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation70.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like [#,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = non_zero_random(-10,10,1); +$comp = '\leq'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("[$left,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x\mid{[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [$left] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation80.pg index 2007de8fcc..25b7e0f947 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation80.pg @@ -7,16 +7,18 @@ # Last updated: Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(alg_real_num_2015_setbuilder_to_interval) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,13 +49,13 @@ TEXT(beginproblem()); BEGIN_PGML -Change the following inequality from set-builder notation to interval notation: +A set is written using set-builder notation. Write it using interval notation. - [`` [$LBRACE] x \mid {[$left]} [$comp] [$right] [$RBRACE] ``] + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] -Please use *inf* to represent [`\infty`]. +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** - The interval notation is [_____________]{$ans}. + [_____________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation90.pg new file mode 100644 index 0000000000..f15d50a801 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/IntervalNotation90.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (#,inf). The number is a fraction. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->flags->set(allowMixedNumbers=>0); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} + +$left = Fraction($num,$den); +$comp = '\lt'; +$right = Compute("x"); + +Context("Interval"); +($num, $den) = $left->value; +$ans_latex_string = "\left(\frac{$num}{$den},\infty\right)"; +$ans_string = "($left, inf)"; +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("($left,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \left\{ x \mid {[$left]} [$comp] [$right] \right\} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans->cmp(correct_ans=>$ans_string, correct_ans_latex_string=>$ans_latex_string)} + +END_PGML + + + + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [`[$left]`] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans_latex_string]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg index 8ef22694d2..9cf187b10d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg @@ -7,28 +7,30 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Graph_to_interval) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -135,7 +137,7 @@ $pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); Context()->texStrings; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph20.pg new file mode 100644 index 0000000000..381ea62bf4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph20.pg @@ -0,0 +1,190 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change set notation to graph: x<3 +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(-4,4,1); + +$symbol = $LTS; #Don't use < or > directly. + +%answer = (leftType => 'inf', + rightType => 'open', #use 'inf' regardles of +/- inf + ); + + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 5; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); +@alts=(); + +#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. +@indices=(); + + +#make the graphs +for $leftType ('open','closed', 'inf') +{ + for $rightType ('open','closed', 'inf') + { + my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] + ); + @ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + + $tempgr->h_ticks(0,"black",@ticks); + $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); + + if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) + { + $altText = ""; + $altText = "This is the graph of a number line. "; + $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); + if ($leftType eq 'open' or $rightType eq 'open') + { + $altText = $altText."It has a hollow circle at $a, "; + $tempgr->stamps( open_circle($a,0,'blue') ) + } + else + { + $altText = $altText."It has a filled circle at $a, "; + $tempgr->stamps( closed_circle($a,0,'blue') ) + }; + $tempgr->moveTo($a,0); + if ($leftType eq 'inf') { + $altText = $altText."and the number line is shaded everywhere left from $a."; + $tempgr->arrowTo(-0.99*$reach,0,'blue',3); + } else { + $altText = $altText."and the number line is shaded everywhere right from $a."; + $tempgr->arrowTo(0.99*$reach,0,'blue',3); + } + push(@gr,$tempgr);push(@alts,$altText); + if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) + {push(@indices, $#gr);} + else {unshift(@indices, $#gr);} + } + +}}; + +#A permutation function +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + my %map = (); + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #$zero is the preimage of 0. + + +@ar_choice = ("A","B","C","D"); + +$pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); + + +############################################## + +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing the solutions to \(x $symbol $a\). +$PAR + +A. \{ image( insertGraph($gr[ $indices[$shuffle->{0}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{0}] ]" alt="$alts[ $indices[$shuffle->{0}] ]" align="top" ' ) \} +$PAR + +B. \{ image( insertGraph($gr[ $indices[$shuffle->{1}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{1}] ]" alt="$alts[ $indices[$shuffle->{1}] ]" align="top" ' ) \} +$PAR +C. \{ image( insertGraph($gr[ $indices[$shuffle->{2}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{2}] ]" alt="$alts[ $indices[$shuffle->{2}] ]" align="top" ' ) \} +$PAR +D. \{ image( insertGraph($gr[ $indices[$shuffle->{3}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{3}] ]" alt="$alts[ $indices[$shuffle->{3}] ]" align="top" ' ) \} + + +$PAR + +$SPACE $SPACE $SPACE \{ $pop->menu() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $pop->cmp() ); + +BEGIN_PGML_SOLUTION + +The inequality is [`x [$symbol] [$a]`]. + +Since [`x`] needs to be smaller than [`[$a]`], we should shade all numbers to the _left_ of [`[$a]`], moving toward [` -\infty `]. + +Since the inequality symbol is [`[$symbol]`], we should use an open ending at [`[$a]`]. + +The correct answer is [@ $pop->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph30.pg new file mode 100644 index 0000000000..b90149dd07 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph30.pg @@ -0,0 +1,190 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change set notation to graph: x>=3 +# +# Last edited by Jordan 8/29/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(-4,4,1); + +$symbol = '\ge'; + +%answer = (leftType => 'closed', + rightType => 'inf', #use 'inf' regardles of +/- inf + ); + + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 5; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); +@alts=(); + +#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. +@indices=(); + + +#make the graphs +for $leftType ('open','closed', 'inf') +{ + for $rightType ('open','closed', 'inf') + { + my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] + ); + @ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + + $tempgr->h_ticks(0,"black",@ticks); + $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); + + if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) + { + $altText = ""; + $altText = "This is the graph of a number line. "; + $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); + if ($leftType eq 'open' or $rightType eq 'open') + { + $altText = $altText."It has a hollow circle at $a, "; + $tempgr->stamps( open_circle($a,0,'blue') ) + } + else + { + $altText = $altText."It has a filled circle at $a, "; + $tempgr->stamps( closed_circle($a,0,'blue') ) + }; + $tempgr->moveTo($a,0); + if ($leftType eq 'inf') { + $altText = $altText."and the number line is shaded everywhere left from $a."; + $tempgr->arrowTo(-0.99*$reach,0,'blue',3); + } else { + $altText = $altText."and the number line is shaded everywhere right from $a."; + $tempgr->arrowTo(0.99*$reach,0,'blue',3); + } + push(@gr,$tempgr);push(@alts,$altText); + if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) + {push(@indices, $#gr);} + else {unshift(@indices, $#gr);} + } + +}}; + +#A permutation function +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + my %map = (); + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #$zero is the preimage of 0. + + +@ar_choice = ("A","B","C","D"); + +$pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); + + +############################################## + +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing the solutions to \(x $symbol $a\). +$PAR + +A. \{ image( insertGraph($gr[ $indices[$shuffle->{0}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{0}] ]" alt="$alts[ $indices[$shuffle->{0}] ]" align="top" ' ) \} +$PAR + +B. \{ image( insertGraph($gr[ $indices[$shuffle->{1}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{1}] ]" alt="$alts[ $indices[$shuffle->{1}] ]" align="top" ' ) \} +$PAR +C. \{ image( insertGraph($gr[ $indices[$shuffle->{2}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{2}] ]" alt="$alts[ $indices[$shuffle->{2}] ]" align="top" ' ) \} +$PAR +D. \{ image( insertGraph($gr[ $indices[$shuffle->{3}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{3}] ]" alt="$alts[ $indices[$shuffle->{3}] ]" align="top" ' ) \} + + +$PAR + +$SPACE $SPACE $SPACE \{ $pop->menu() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $pop->cmp() ); + +BEGIN_PGML_SOLUTION + +The inequality is [`x [$symbol] [$a]`]. + +Since [`x`] needs to be greater than [`[$a]`], we should shade all numbers to the _right_ of [`[$a]`], moving toward [` +\infty `]. + +Since the inequality symbol is [`[$symbol]`], we should use a closed ending at [`[$a]`]. + +The correct answer is [@ $pop->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg index 2c345adf0e..f195f5ee0a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg @@ -7,28 +7,30 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Graph_to_interval) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -135,7 +137,7 @@ $pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); Context()->texStrings; @@ -158,10 +160,9 @@ $PAR D. \{ image( insertGraph($gr[ $indices[$shuffle->{3}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>'title="$alts[ $indices[$shuffle->{3}] ]" alt="$alts[ $indices[$shuffle->{3}] ]" align="top" ' ) \} - $PAR -$SPACE $SPACE $SPACE\{ $pop->menu() \} +$SPACE $SPACE $SPACE \{ $pop->menu() \} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality10.pg index f303e20580..4be7945a5a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality10.pg @@ -8,17 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SingleIneq_twonotations) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +33,8 @@ loadMacros( "contextArbitraryString.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -50,7 +52,7 @@ InequalitySetBuilder::UseVerticalSuchThat(); Context("InequalitySetBuilder-Only"); $setans = Compute("{ x | x > $c}"); $alt = Compute("{ x | $c < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); @@ -62,21 +64,14 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. - In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality100.pg new file mode 100644 index 0000000000..dab5d865d5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality100.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -x <= a +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','multiply','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,10,1); +$left = Compute("-x"); +$comp = "\leq"; +$right = Compute("$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= -$b}"); +$alt = Compute("{ x | -$b <= x}"); +$ans = $setans; + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[-$b,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -x & \leq [$b] \\ + -1(-x) & \geq -1([$b]) \\ + x & \geq -[$b] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality110.pg index 4500fcff1a..9ce7cf92cc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality110.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SingleIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,8 @@ loadMacros( "contextFraction.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,7 +57,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x > $b}"); $alt = Compute("{ x | $b < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); @@ -67,21 +70,14 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. - In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality120.pg new file mode 100644 index 0000000000..2438e2f972 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality120.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -(a/b)x <= c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} +$frac = Fraction($num,$den); + +$a=$num*list_random((1,2,3,4)); +$left = Compute("-$frac*x"); +$comp = "\leq"; +$right = Compute("$a"); +$b=$a/$num*$den; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= -$b}"); +$alt = Compute("{ x | -$b <= x}"); +$ans = $setans; + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[-$b,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +$s1=$den*$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -\frac{[$num]}{[$den]}x & \leq [$a] \\ + [$den] \cdot -\frac{[$num]}{[$den]}x & \leq [$den] \cdot [$a] \\ + -[$num]x & \leq [$s1] \\ + (-1) \cdot -[$num]x & \geq (-1) \cdot [$s1] \\ + [$num]x & \geq -[$s1] \\ + \frac{[$num]x}{[$num]} & \geq \frac{-[$s1]}{[$num]} \\ + x & \geq -[$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality130.pg index ace2b30766..a282217f52 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality130.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SingleIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,8 @@ loadMacros( "contextFraction.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,7 +57,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x > -$b}"); $alt = Compute("{ x | -$b < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); @@ -67,21 +70,14 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. - In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality140.pg new file mode 100644 index 0000000000..7d62fb0735 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality140.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -a < -(a/b) x +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} +$frac = Fraction($num,$den); + +$a=$num*list_random((1,2,3,4)); +$left = Compute("-$a"); +$comp = "<"; +$right = Compute("-$frac*x"); +$b=$a/$num*$den; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x < $b}"); +$alt = Compute("{ x | $b > x}"); +$ans = $setans; + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$b)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +$s1=$den*$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a] & < -\frac{[$num]}{[$den]}x \\ + [$den] \cdot (-[$a]) & < [$den] \cdot (-\frac{[$num]}{[$den]}x) \\ + -[$s1] & < -[$num]x \\ + (-1) \cdot (-[$s1]) & > (-1) \cdot (-[$num]x) \\ + [$s1] & > [$num]x \\ + \frac{[$s1]}{[$num]} & > \frac{[$num]x}{[$num]} \\ + [$b] & > x \\ + x & < [$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality150.pg new file mode 100644 index 0000000000..977abbd903 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality150.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax > -b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("$a*x"); +$comp = ">"; +$right = Compute("-$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > -$c}"); +$alt = Compute("{ x | -$c < x}"); +$ans = $setans; + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-$c,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a]x & > -[$b] \\ + \frac{[$a]x}{[$a]} & > \frac{-[$b]}{[$a]} \\ + x & > -[$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality160.pg new file mode 100644 index 0000000000..e81dfd249f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality160.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -a < -bx +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("-$b"); +$comp = "<"; +$right = Compute("-$a*x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x < $c}"); +$alt = Compute("{ x | $c > x}"); +$ans = $setans; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$b] & < -[$a]x \\ + \frac{-[$b]}{-[$a]} & > \frac{-[$a]x}{-[$a]} \\ + [$c] & > x \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg index 3c0d746f41..c018d9caf7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SingleIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,9 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -50,7 +54,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x > $v}"); $alt = Compute("{ x | $v < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); @@ -63,21 +67,17 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. + [@KeyboardInstructions('The [| | |]* symbol is above the [|Enter|]* key.')@]** In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality180.pg index 584aa1ae08..844f9893ed 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality180.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality180.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SingleIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','add','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -51,7 +54,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x <= $v}"); $alt = Compute("{ x | $v >= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); @@ -63,21 +66,17 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality190.pg new file mode 100644 index 0000000000..bdd4c98da8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality190.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a <= b-cx +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,10,1); +$b=random(1,10,1); +$v=random(2,10,1); +$c=$b+$a*$v; + +$left = Compute("$c"); +$comp = "\leq"; +$right = Compute("$b-$a*x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= -$v}"); +$alt = Compute("{ x | -$v >= x}"); +$ans = $setans; + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,-$v]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$c] & \leq [$b]-[$a]x \\ + [$c] \mathbf{{} -[$b]} & \leq [$b]-[$a]x\mathbf{{} -[$b]} \\ + [$c-$b] & \leq -[$a]x \\ + \frac{[$c-$b] }{-[$a]} & \geq \frac{-[$a]x}{-[$a]} \\ + -[$v] & \geq x \\ + x & \leq -[$v] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality20.pg index 080b60b0b8..20a26f08ab 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality20.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SingleIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +33,8 @@ loadMacros( "contextArbitraryString.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -50,7 +53,7 @@ Context("InequalitySetBuilder-Only"); $setans = Compute("{ x | x <= $c}"); $alt = Compute("{ x | $c >= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); @@ -62,21 +65,14 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. - In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality200.pg new file mode 100644 index 0000000000..f2a9df6bd8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality200.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -ax-b < -c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','add','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,10,1); +$b=random(1,10,1); +$v=random(2,10,1); +$c=$b+$a*$v; + +$left = Compute("-$a*x-$b"); +$comp = "<"; +$right = Compute("-$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > $v}"); +$alt = Compute("{ x | $v < x}"); +$ans = $setans; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($v,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a]x-[$b] &< -[$c] \\ + -[$a]x-[$b]\mathbf{{}+[$b]} &< -[$c]\mathbf{{}+[$b]} \\ + -[$a]x &< [$b-$c] \\ + \frac{-[$a]x}{-[$a]} &> \frac{[$b-$c]}{-[$a]} \\ + x & > [$v] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality210.pg new file mode 100644 index 0000000000..27314f618c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality210.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a > -bx+c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +#0 is the critical point +Context("Numeric"); + +$a=random(3,10,1); +$b=random(2,5,1); + +$left = Compute("$b"); +$comp = "\geq"; +$right = Compute("-$a*x+$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= 0}"); +$alt = Compute("{ x | 0 <= x}"); +$ans = $setans; + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[0,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$b] & \geq -[$a]x +[$b] \\ + [$b]\mathbf{{} -[$b]} & \geq -[$a]x +[$b]\mathbf{{} -[$b]} \\ + 0 & \geq -[$a]x \\ + \frac{0}{-[$a]} & \leq \frac{-[$a]x}{-[$a]} \\ + 0 & \leq x \\ + x & \geq 0 +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality220.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality220.pg new file mode 100644 index 0000000000..90e83ff65f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality220.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -a > b-x +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','negative','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(1,5,1); +$v=random(6,10,1); +$c=$b-$v; + +$left = Compute("$c"); +$comp = ">"; +$right = Compute("$b-x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > $v}"); +$alt = Compute("{ x | $v < x}"); +$ans = $setans; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($v,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$c] & > [$b]-x \\ + [$c] \mathbf{{}-[$b]} & > [$b]-x\mathbf{{}-[$b]} \\ + [$c-$b] & > -x \\ + -1 \cdot ([$c-$b]) & < -1 \cdot (-x) \\ + [$v] & < x \\ + x & > [$v] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality230.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality230.pg new file mode 100644 index 0000000000..09eaa89998 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality230.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a(x+b) >= c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,10,1); +$v = random(2,10,1); +$b=random(1,10,1); +$c= $a*($v+$b); + +$left = Compute("$a*(x+$b)"); +$comp = "\geq"; +$right = Compute("$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= $v}"); +$alt = Compute("{ x | $v <= x}"); +$ans = $setans; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$v,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $a*$b; +$step2 = $c-$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a](x{}+ [$b]) & \geq [$c] \\ + [$a]x {}+[$step1] & \geq [$c] \\ + [$a]x {}+[$step1]\mathbf{{} -[$step1]} & \geq [$c]\mathbf{{} -[$step1]} \\ + [$a]x & \geq [$step2] \\ + \frac{[$a]x}{[$a]} & \geq \frac{[$step2]}{[$a]} \\ + x & \geq [$v] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality240.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality240.pg index d82e1e72be..a334c36c1a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality240.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality240.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LinIneq2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,7 +57,7 @@ Context()->variables->are(t=>"Real"); $setans = Compute("{ t | t < $crit}"); $alt = Compute("{ t | $crit>= t}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); @@ -68,21 +71,17 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{t\mid t>1\}`]. The *|* symbol is above the keyboard's Enter key. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality250.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality250.pg new file mode 100644 index 0000000000..0453c62912 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality250.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -ax +b <= -z -c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','add','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(z=>"Real"); + +#make sure $d is negative +do { + $a=random(2,10,1); + $b=random(2,10,1); + $crit=random(1,10,1); + $ans=random(1,10,1); + $d=$b-($a-1)*$crit; +} until ($d<0); + +$d=abs($d); + +$left = Compute("-$a*z+$b"); +$comp = "\leq"; +$right = Compute("-z-$d"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(z=>"Real"); + +$setans = Compute("{ z | z >= $crit}"); +$alt = Compute("{ z | $crit <= z}"); +$ans = $setans; + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$crit,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a]z {}+[$b] & \leq -z {}-[$d] \\ + -[$a]z {}+[$b] \mathbf{{}+[$a]z {}+[$d]}& \leq -z {}-[$d]\mathbf{{}+[$a]z {}+[$d]} \\ + [$b+$d] & \leq [$a-1]z \\ + \frac{[$b+$d]}{[$a-1]} & \leq \frac{[$a-1]z}{[$a-1]} \\ + [$crit] & \leq z\\ +z & \geq [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality260.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality260.pg new file mode 100644 index 0000000000..ad5fedf8e1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality260.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like x-a-bx > -c-dx+e +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','combine','add','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(a=>"Real"); + +do{ +$a=random(2,10,1); +$b=random(2,10,1); +$c=random(2,10,1); +$d=random(2,10,1);} until (1 - $b + $d >1); +$crit=random(-10,10,1); + +#make sure $e is positive +$e=$crit-$a-$b*$crit+$c+$d*$crit; +while ($e<=0) { + $crit=random(-10,10,1); + $e=$crit-$a-$b*$crit+$c+$d*$crit; +} + +$left = Compute("a-$a-$b*a"); +$comp = ">"; +$right = Compute("-$c-$d*a+$e"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(a=>"Real"); + +$setans = Compute("{ a | a > $crit}"); +$alt = Compute("{ a | $crit < a}"); +$ans = $setans; + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($crit,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = 1-$b; +$step2 = 1-$b+$d; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + a -[$a] -[$b]a & > -[$c] -[$d]a +[$e] \\ + [$step1]a -[$a] & > [$e-$c] -[$d]a \\ + [$step1]a -[$a]\mathbf{{}+[$a] +[$d]a} & > [$e-$c] -[$d]a\mathbf{{}+[$a] +[$d]a} \\ + [$step2]a & > [$e-$c+$a] \\ + \frac{[$step2]a}{[$step2]} &> \frac{[$e-$c+$a]}{[$step2]} \\ + a &> [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality270.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality270.pg new file mode 100644 index 0000000000..7d77dec3fa --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality270.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -ax+b-cx >= dx+e +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','combine','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +#make the critical point 0 +Context("Numeric"); +Context()->variables->are(p=>"Real"); + +$a=random(2,10,1); +$b=random(2,10,1); +$c=random(2,10,1); +$d=$b; +$e=random(2,10,1); +#make sure x terms are not cancelled +while (($a+$c)==(-$e)) {$e=random(2,10,1);} + +$left = Compute("-$c*p+$d-$e*p"); +$comp = "\geq"; +$right = Compute("$a*p+$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(p=>"Real"); + +$setans = Compute("{ p | p <= 0}"); +$alt = Compute("{ p | 0 >= p}"); +$ans = $setans; + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,0]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = abs(-$c-$e); +$step2 = $a+$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$c]p +[$d] -[$e]p & \geq [$a]p+[$b] \\ + (-[$c]-[$e])p +[$d] & \geq [$a]p+[$b] \\ + -[$step1]p +[$d] & \geq [$a]p+[$b] \\ + -[$step1]p +[$d]\mathbf{{}+[$step1]p-[$b]} & \geq [$a]p+[$b]\mathbf{{}+[$step1]p-[$b]} \\ + [$d-$b] & \geq [$step2]p \\ + \frac{[$d-$b]}{[$step2]} & \geq \frac{[$step2]p}{[$step2]} \\ + 0 & \geq p \\ + p & \leq 0 +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality280.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality280.pg new file mode 100644 index 0000000000..578ae84fe1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality280.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a < -b(x-c) +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(p=>"Real"); + +$a=random(2,10,1); +$b=random(1,10,1); +$crit = non_zero_random(-10,10,1); +$c= -$a*($crit -$b); + +$left = Compute("$c"); +$comp = "<"; +$right = Compute("-$a*(p-$b)"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->add(p=>"Real"); + +$setans = Compute("{ p | p < $crit}"); +$alt = Compute("{ p | $crit > p}"); +$ans = $setans; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit )"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $a*$b; +$step2 = $c-$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$c] & < -[$a](p -[$b]) \\ + [$c] & < -[$a](p +(-[$b])) \\ + [$c] & < -[$a]p +(-[$a]) \cdot (-[$b]) \\ + [$c] & < -[$a]p +[$step1] \\ + [$c]\mathbf{{}-[$step1]}& < -[$a]p +[$step1]\mathbf{{}-[$step1]} \\ + [$step2] & < -[$a]p \\ + \frac{[$step2]}{-[$a]} & > \frac{-[$a]p}{-[$a]} \\ + [$crit] & > p \\ + p &< [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality290.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality290.pg new file mode 100644 index 0000000000..4b2fd1aa3a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality290.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -(x-a) >= b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','negative','distributive','subtract','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +do { + $crit = random(-10,-2,1); + $b=random(1,10,1); + $c= -($crit -$b); +} until ($c>0); + +$left = Compute("-(x-$b)"); +$comp = "\geq"; +$right = Compute("$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= $crit }"); +$alt = Compute("{ x | $crit >= x}"); +$ans = $setans; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $a*$b; +$step2 = $c+$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -(x- [$b]) & \geq [$c] \\ + (-1) \cdot (x+(-[$b])) & \geq [$c] \\ + -x +(-1) \cdot (-[$b]) & \geq [$c] \\ + -x +[$b] & \geq [$c] \\ + -x +[$b]\mathbf{{} -[$b]}& \geq [$c]\mathbf{{} -[$b]} \\ + -x & \geq [$c-$b] \\ + (-1) \cdot (-x) & \leq (-1) \cdot ([$c-$b]) \\ + x & \leq [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality30.pg new file mode 100644 index 0000000000..7222e34172 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality30.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a <= x + b +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(6,10,1); +$left = Compute("$a"); +$comp = "\leq"; +$right = Compute("x+$b"); + +$c = $a-$b; +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x >= $c}"); +$alt = Compute("{ x | $c <= x}"); +$ans = $setans; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$c,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a] & \leq x +[$b] \\ + [$a]\mathbf{{}-[$b]} & \leq x +[$b]\mathbf{{}-[$b]} \\ + [$c] & \leq x \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality300.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality300.pg new file mode 100644 index 0000000000..55e5e3df83 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality300.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a <= b-c(x-d) +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(z=>"Real"); + +$a=random(1,10,1); +$b=random(2,10,1); +$crit = non_zero_random(-10,10,1); +$c=random(1,10,1); +$d= $a-$b*($crit -$c); + +$left = Compute("$d"); +$comp = "\leq"; +$right = Compute("$a-$b*(z-$c)"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(z=>"Real"); + +$setans = Compute("{ z | z <= $crit}"); +$alt = Compute("{ z | $crit >= z}"); +$ans = $setans; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit ]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $b*$c; +$step2 = $a+$step1; +$step3 = $d-$step2; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$d] & \leq [$a]-[$b](z-[$c]) \\ + [$d] & \leq [$a]+(-[$b]) \cdot (z+(-[$c])) \\ + [$d] & \leq [$a]+(-[$b]) \cdot z+(-[$b]) \cdot (-[$c]) \\ + [$d] & \leq [$a]-[$b]z +[$step1] \\ + [$d] & \leq -[$b]z +([$a]+[$step1]) \\ + [$d] & \leq -[$b]z +[$step2] \\ + [$d]\mathbf{{}-[$step2]} & \leq -[$b]z +[$step2]\mathbf{{}-[$step2]} \\ + [$step3] & \leq -[$b]z \\ + \frac{[$step3]}{-[$b]} & \geq \frac{-[$b]z}{-[$b]} \\ + [$crit ] & \geq z \\ + z & \leq [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality310.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality310.pg index 827ec68f78..ee368200f9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality310.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality310.pg @@ -8,16 +8,18 @@ # Last updated: Jordan 7/30/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LinIneq2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -53,7 +56,7 @@ Context()->variables->are(y=>"Real"); $setans = Compute("{ y | y > $crit}"); $alt = Compute("{ y | $crit < y}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); @@ -65,21 +68,17 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality320.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality320.pg index f69c8f6174..8f5cadb719 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality320.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality320.pg @@ -8,16 +8,18 @@ # Last updated: Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LinIneq2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -55,7 +58,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x < $crit}"); $alt = Compute("{ x | $crit > x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); @@ -68,21 +71,17 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality40.pg index 50a35ff567..6533f5148d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality40.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SingleIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,8 @@ loadMacros( "contextFraction.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,7 +52,7 @@ Context("InequalitySetBuilder-Only"); $setans = Compute("{ x | x < $c}"); $alt = Compute("{ x | $c > x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); @@ -61,21 +64,17 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality41.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality41.pg index 9e28df36f6..04282acd13 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality41.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality41.pg @@ -8,14 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Inequalities and intervals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -48,7 +52,7 @@ Context("InequalitySetBuilder-Only"); $setans = Compute("{ x | x < $c}"); $alt = Compute("{ x | $c > x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality50.pg new file mode 100644 index 0000000000..f3db36aed6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality50.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax <= b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("$a*x"); +$comp = "\leq"; +$right = Compute("$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x <= $c}"); +$alt = Compute("{ x | $c >= x}"); +$ans = $setans; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a]x & \leq [$b] \\ + \frac{[$a]x}{[$a]} & \leq \frac{[$b]}{[$a]} \\ + x & \leq [$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality60.pg index ca2b8d7014..736da4b9d7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality60.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SingleIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,8 @@ loadMacros( "contextFraction.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -60,7 +63,7 @@ Context()->flags->set( $setans = Compute("{ x | x > $c}"); $alt = Compute("{ x | $c < x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; $ansLatexString="\left\{ x \mid x > ".$c->TeX."\right\}"; Context("Interval"); @@ -77,22 +80,14 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] - - In set-builder notation, the solution set is [______________]{$ans->cmp(correct_ans_latex_string=>$ansLatexString)}. - - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + In set-builder notation, the solution set is [______________]{$ans->cmp(correct_ans_latex_string=>$ansLatexString)}. In interval notation, the solution set is [______________]{$intans->cmp(correct_ans_latex_string=>$intansLatexString)}. - An example of interval notation is [`(1,\infty)`]. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality70.pg index 607c386fef..4fb074045f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality70.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SingleIneq_twonotations) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,7 +52,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x <= -$c}"); $alt = Compute("{ x | -$c >= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); @@ -61,21 +64,14 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. - In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality80.pg new file mode 100644 index 0000000000..cf6aaff4cd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality80.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a>=-bx +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("$b"); +$comp = "\geq"; +$right = Compute("-$a*x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= -$c}"); +$alt = Compute("{ x | -$c <= x}"); +$ans = $setans; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[-$c,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$b] & \geq -[$a]x \\ + \frac{[$b]}{-[$a]} & \leq \frac{-[$a]x}{-[$a]} \\ + -[$c] & \leq x \\ + x & \geq -[$c] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality90.pg new file mode 100644 index 0000000000..c96be29090 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality90.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a < -x +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','multiply','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,10,1); +$left = Compute("$b"); +$comp = "<"; +$right = Compute("-x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x < -$b}"); +$alt = Compute("{ x | -$b > x}"); +$ans = $setans; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,-$b)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$b] & < -x \\ + -1 \cdot ([$b]) & < -1 \cdot (-x) \\ + -[$b] & > x \\ + x & < -[$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg index c54b35d633..8543f428e0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LineIneqFrac_twonotations) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,8 @@ loadMacros( "contextFraction.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,7 +57,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x <= $crit}"); $alt = Compute("{ x | $crit >= x}"); -$ans = OneOf($setans, $alt); +$ans = $setans; Context("Interval"); @@ -67,21 +70,17 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** In set-builder notation, the solution set is [______________]{$ans}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. + END_PGML @@ -101,7 +100,7 @@ BEGIN_PGML_SOLUTION x +[$step1]\mathbf{{}-x} & \geq [$step2]x\mathbf{{}-x} \\ [$step1] &\geq [$s3]x \\ \frac{[$step1]}{[$s3]} &\geq \frac{[$s3]x}{[$s3]} \\ - [$ans] &\geq x + [$crit] &\geq x \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction20.pg new file mode 100644 index 0000000000..0d1762125d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction20.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a/b -cx < d. Fraction is in answer. +# +# Last updated: Jordan 10/25/13, 7/30/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','negative','divide','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->variables->are(y=>"Real"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); + +$den = random(2,6,2); +$num=random(3,5,2); +while (gcd($den,$num)!=1) {$num=random(3,5,2);} +$frac = Fraction($num,$den); + +$a=random(2,6,1); +$b=random(2,6,1); +$crit = Fraction($num-$b*$den,$a*$den); + +$critNum = -($crit->value)[0]; +$critDen = ($crit->value)[1]; + +$left = Compute("$frac-$a*y"); +$comp = "<"; +$right = Compute("$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); +Context()->variables->are(y=>"Real"); +$setans = Compute("{ y | y > -($critNum/$critDen)}"); +$alt = Compute("{ y | -($critNum/$critDen) < y}"); +$ans = $setans; +$ansLatexString = "\left\{ y \mid y > ".$crit->TeX."\right\}"; + +Context("Interval"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); +$intans = Compute("($crit,inf)"); +$intansLatexString = "\left(".$crit->TeX.",\infty\right)"; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans->cmp(correct_ans_latex_string=>$ansLatexString)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans->cmp(correct_ans_latex_string=>$intansLatexString)}. + + +END_PGML + +############################################## + +$step1 = $den*$a; +$step2 = $den*$b; +$step3 = $step2-$num; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{[$num]}{[$den]} -[$a]y &< [$b] \\ +[$den] \cdot \left(\frac{[$num]}{[$den]} - [$a]y\right) &< [$den] \cdot [$b] \\ + [$den] \cdot \frac{[$num]}{[$den]} - [$den] \cdot [$a]y &< [$den] \cdot [$b] \\ + [$num] -[$step1]y &< [$step2] \\ + [$num]-[$step1]y\mathbf{{} -[$num]} &< [$step2]\mathbf{{} -[$num]} \\ + -[$step1]y &<[$step3] \\ + \frac{-[$step1]y}{-[$step1]} &< \frac{[$step3]}{-[$step1]} \\ + y &< -\frac{[$critNum]}{[$critDen]} +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`\left(-\frac{[$critNum]}{[$critDen]},\infty\right)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg index a37e352444..7a824b171d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg @@ -8,16 +8,18 @@ # Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LineIneqFrac_twonotations) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','negative','multiply','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,8 @@ loadMacros( "contextFraction.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -69,7 +72,7 @@ Context()->variables->are(t=>"Real"); $setans = Compute("{ t | t< $ans}"); $alt = Compute("{ t | $ans > t}"); -$options = OneOf($setans, $alt); +$options = $setans; Context("Interval"); @@ -82,21 +85,17 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. - An example of set-builder notation is [`\{t\mid t>1\}`]. The *|* symbol is above the keyboard's Enter key. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. + END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction40.pg new file mode 100644 index 0000000000..1f0271396a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction40.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a/b >= x/c +# +# Last updated: Jordan 10/25/13, Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den1 = random(2,10,2); +$num1 = random(3,9,2); +while (gcd($den1,$num1)!=1) {$num1 = random(3,9,2);} + +$den2 = $den1*random(2,6,1); +$ans = $den2*$num1/$den1; + +Context()->flags->set(reduceConstants=>0); +$left = Formula("$num1/$den1"); +$comp = "\geq"; +$right = Formula("x/$den2"); + + + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x<= $ans}"); +$alt = Compute("{ x | $ans >= x}"); +$options = $setans; + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$ans]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{[$num1]}{[$den1]} & \geq \frac{x}{[$den2]} \\ + [$den2] \cdot \frac{[$num1]}{[$den1]} & \geq [$den2] \cdot \frac{x}{[$den2]} \\ + [$ans] & \geq x\\ + x & \leq [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg new file mode 100644 index 0000000000..e4fe5a9c74 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -x/a < -b/c +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','negative','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den1 = random(2,10,2); +$num1 = random(3,9,2); +while (gcd($den1,$num1)!=1) {$num1 = random(3,9,2);} + +$den2 = $den1*random(2,6,1); +$ans = $den2*$num1/$den1; + +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(z=>'Real'); +$left = Formula("-(z/$den2)"); +$comp = "<"; +$right = Formula("-($num1/$den1)"); + + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(z=>'Real'); + +$setans = Compute("{ z | z> $ans}"); +$alt = Compute("{ z | $ans < z}"); +$options = $setans; + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($ans,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -\frac{z}{[$den2]} &< -\frac{[$num1]}{[$den1]} \\ + (-1) \cdot \left(-\frac{z}{[$den2]}\right) &> (-1) \cdot \left(-\frac{[$num1]}{[$den1]}\right) \\ + \frac{z}{[$den2]} &> \frac{[$num1]}{[$den1]} \\ + [$den2] \cdot \frac{z}{[$den2]} &> [$den2] \cdot \frac{[$num1]}{[$den1]} \\ + z &> [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg index d0a866e630..bcae192e46 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg @@ -8,16 +8,18 @@ # Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LineIneqFrac_twonotations) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','add','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,7 +57,7 @@ Context()->flags->set(formatStudentAnswer=>'parsed'); $setans = Compute("{ x | x>= -$ans}"); $alt = Compute("{ x | -$ans <= x}"); -$options = OneOf($setans, $alt); +$options = $setans; Context("Interval"); @@ -67,21 +70,17 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. - An example of set-builder notation is [`\{x\mid x>1\}`]. The *|* symbol is above the keyboard's Enter key. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. + END_PGML @@ -97,8 +96,8 @@ $s4x = Formula("$s4 x")->reduce; $solnString = ''; if ($s4 != 1) -{$solnString = "\frac{-$s1}{$s4} & \leq \frac{$s4x]}{$s4} \\ - -[$ans] & \leq x\\";}; +{$solnString = "\frac{-$s1}{$s4} & \leq \frac{$s4 x}{$s4} \\ + -$ans & \leq x\\";}; BEGIN_PGML_SOLUTION @@ -110,8 +109,7 @@ BEGIN_PGML_SOLUTION [$s3x] - [$s1] & \leq [$s2]x \\ [$s3x] - [$s1]\mathbf{{}-[$s3x]} & \leq [$s2]x\mathbf{{}-[$s3x]} \\ -[$s1] & \leq [$s4x] \\ -[$solnString]* - x & \geq -[$ans] +[$solnString]* x & \geq -[$ans] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg index ac933c3561..32b249b9e2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg @@ -8,15 +8,18 @@ # Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','add','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +31,8 @@ loadMacros( "PGML.pl", "contextInequalitySetBuilder.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -56,7 +60,7 @@ Context()->variables->are(y=>'Real'); $setans = Compute("{ y | y<= $ans}"); $alt = Compute("{ y | $ans >= y}"); -$options = OneOf($setans, $alt); +$options = $setans; Context("Interval"); Context()->flags->set("formatStudentAnswer"=>'parsed'); @@ -68,21 +72,17 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality: +Solve this inequality. [`` [$left] [$comp] [$right] ``] -Please type: - -* *inf* for [`\infty`], -* *[$GTS]=* for [`\geq`], -* and *[$LTS]=* for [`\leq`] +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. - An example of set-builder notation is [`\{y\mid y>1\}`]. The *|* symbol is above the keyboard's Enter key. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** In interval notation, the solution set is [______________]{$intans}. - An example of interval notation is [`(1,\infty)`]. + END_PGML @@ -102,8 +102,9 @@ $solnString = ''; if ($s5 != 1) { $solnString = " -$s6 & \geq $s5y \\ \frac{-$s6}{$s5} & \geq \frac{$s5y}{$s5} \\"}; -$s1cdot = "$s1\cdot"; -if ($s1 == 1) {$s1 =''; $s1cdot = '';}; +$s7 = Compute("$s1*(y-$num1)")->reduce; +$s8 = Compute("$s2*(y+$num2)")->reduce; +$s9 = Compute("$s1*y")->reduce; BEGIN_PGML_SOLUTION @@ -111,11 +112,9 @@ BEGIN_PGML_SOLUTION \begin{aligned} \frac{y-[$num1]}{[$den1]} & \geq \frac{y+[$num2]}{[$den2]} \\ [$com] \cdot \frac{y-[$num1]}{[$den1]} & \geq [$com] \cdot \frac{y+[$num2]}{[$den2]} \\ - [$s1](y-[$num1]) & \geq [$s2](y+[$num2]) \\ - [$s1]y-[$s1cdot] [$num1] & \geq [$s2]y+[$s2] \cdot [$num2] \\ - [$s1]y - [$s3] & \geq [$s2]y+[$s4] \\ - [$s1]y - [$s3]\mathbf{{} -[$s1]y-[$s4]} & \geq [$s2]y+[$s4]\mathbf{{} -[$s1]y-[$s4]} \\ -[$solnstring]* + [$s7] & \geq [$s8] \\ + [$s9] - [$s3] & \geq [$s2]y+[$s4] \\ + [$s9] - [$s3]\mathbf{{} -[$s9]-[$s4]} & \geq [$s2]y+[$s4]\mathbf{{} -[$s9]-[$s4]} \\ [$solnstring]* [$ans] & \geq y\\ y & \leq [$ans] \end{aligned} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction80.pg new file mode 100644 index 0000000000..55d2d9aece --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction80.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a/b < (x+c)/d - (x-e)/f +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','combine','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den1 = random(2,6,2); +$den2 = $den1*2; +$num1 = random(1,10,1); +$num2 = random(1,10,1); + +$ans = non_zero_random(-10,10,1); +Context("Fraction"); +$frac = Fraction($ans+2*$num1+$num2,2*$den1)->reduce; +@fract = $frac->value; +$num3 = $fract[0]; +$den3 = $fract[1]; +while ($den3==1) { + $ans = random(-10,10,1); + Context("Fraction"); + $frac = Fraction($ans+2*$num1+$num2,2*$den1)->reduce; + @fract = $frac->value; + $num3 = $fract[0]; + $den3 = $fract[1]; +} + +$com = lcm(lcm($den1,$den2),$den3); + +Context()->flags->set(reduceConstants=>0); +$left = Formula("$num3/$den3"); +$comp = "<"; +$right = Formula("(x+$num1)/$den1-(x-$num2)/$den2"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x> $ans}"); +$alt = Compute("{ x | $ans < x}"); +$options = $setans; + + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($ans,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$s1 = $com/$den1; +$s2 = $com/$den2; +$s3 = $com*$num3/$den3; +$s4 = $s1*$num1; +$s5 = $s2*$num2; +$s7 = $s4+$s5; + +$s9 = Compute("$s2*x")->reduce; + +$s8 = Compute("-$s2*(x-$num2)")->reduce; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{[$num3]}{[$den3]} &< \frac{x+[$num1]}{[$den1]} - \frac{x-[$num2]}{[$den2]} \\ + [$com] \cdot \frac{[$num3]}{[$den3]} &< [$com] \cdot \frac{x+[$num1]}{[$den1]} - [$com] \cdot \frac{x-[$num2]}{[$den2]} \\ + [$s3] &<[$s1](x+[$num1]) [$s8] \\ + [$s3] &< [$s1]x+[$s4] - [$s9] + [$s5] \\ + [$s3] &< x + [$s7] \\ + [$s3]\mathbf{{} -[$s7]} &< x + [$s7]\mathbf{{} -[$s7]} \\ + [$ans] &< x \\ + x & > [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg new file mode 100644 index 0000000000..9e62c2b048 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in interval notation. +# There is no solution. +# +# Last updated: Jordan 7/28/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserOneOf.pl", #needed if the answer is "all real numbers" or "(-inf, inf)", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(1,9,1); + +$ans = Compute('no solution'); +#$ans = OneOf("(-inf,inf), all real numbers"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` [$a]x > [$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + [$a]x &> [$a]x +[$b] \\ + [$a]x \mathbf{{} -[$a]x} &> [$a]x +[$b]\mathbf{{} -[$a]x} \\ + 0 &> [$b] +\end{aligned} +`] + +Since [`0>[$b]`] is false no matter what the value of [`x`] is, this inequality has *no solution*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality20.pg index e477c44193..01a208dfe6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality20.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LinIneq_AllorNone) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','set notation','interval notation','add','no solution') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,11 +57,7 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality. - -* Use interval notation in your response. -* If there is no solution, you may enter *no solution*. -* If the solution set is all real numbers, you may enter *(-inf, inf)* or *all real numbers*. +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** [`` -[$a]x \leq -[$a]x+[$b] ``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg index aa3bb0b7c3..08f6f8dd62 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg @@ -8,17 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LinIneq_AllorNone) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','set notation','interval notation','combine','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -59,11 +61,7 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality. - -* Use interval notation in your response. -* If there is no solution, you may enter *no solution*. -* If the solution set is all real numbers, you may enter *(-inf, inf)* or *all real numbers*. +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** [`` -[$c]+[$a]x+[$d] \geq [$a]x+[$b] ``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality40.pg new file mode 100644 index 0000000000..94f3afed86 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality40.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# There is no solution. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(1,10,1); +$c=random(1,10,1); +$d=$b+$c; + +$ans = Compute("no solution"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` -[$c]+[$a]x+[$d] < [$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -[$c]+[$a]x+[$d] &< [$a]x+[$b] \\ + [$a]x+[$b] &< [$a]x+[$b] \\ + [$a]x+[$b]\mathbf{{} -[$a]x-[$b]} &< [$a]x+[$b]\mathbf{{} -[$a]x-[$b]} \\ + 0 & < 0 +\end{aligned} +`] + +Since [`0 < 0`] is not true, this inequality has *no solution*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality50.pg new file mode 100644 index 0000000000..a22b6c01c2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality50.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# There is no solution. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','combine','no solution') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(5,10,1); +$b=random(5,10,1); +$c=random(1,$a,1); +$e=random(-$a+$c+1,20,1); +$f=$b-1; + +$ans = Compute("no solution"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` -[$a]-[$b]z+[$c] > -z+[$e]-[$f]z ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +$s1 = abs(-$a+$c); +$s2 = $e+$s1; + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -[$a]-[$b]z+[$c] &> -z+[$e]-[$f]z \\ + (-[$a]+[$c])-[$b]z &> (-1-[$f])z+[$e] \\ + (-[$a]+[$c])-[$b]z &> (-1-[$f])z+[$e] \\ + -[$s1] -[$b]z &> -[$b]z+[$e] \\ + -[$s1]-[$b]z\mathbf{{}+[$b]z+[$s1]} &> -[$b]z+[$e]\mathbf{{}+[$b]z+[$s1]} \\ + 0 &> [$s2] +\end{aligned} +`] + +Since [`0 > [$s2] `] is not true, this inequality has *no solution*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg index a9af950be9..f63cfbe55d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LinIneq_AllorNone) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -63,11 +66,7 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality. - -* Use interval notation in your response. -* If there is no solution, you may enter *no solution*. -* If the solution set is all real numbers, you may enter *(-inf, inf)* or *all real numbers*. +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** [`` [$a]([$b]-[$c]m)-([$d]m-[$e]) > [$f]-2([$h]+[$i]m) ``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg index aa7ffb050e..75a4d7a962 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LinIneq_AllorNone) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','set notation','interval notation','no solution') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -55,11 +58,7 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality. - -* Use interval notation in your response. -* If there is no solution, you may enter *no solution*. -* If the solution set is all real numbers, you may enter *(-inf, inf)* or *all real numbers*. +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** [`` [$a](k-[$b]) \leq [$a](k-[$c]) ``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg index d6bcff3a10..9b66817bf4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg @@ -8,16 +8,18 @@ # Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.EE.4','A-REI.3') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear inequalities) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(LinIneq_AllorNone) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') ## KEYWORDS('inequality','linear','set notation','interval notation','all real numbers') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,11 +57,7 @@ TEXT(beginproblem()); BEGIN_PGML -Solve this inequality. - -* Use interval notation in your response. -* If there is no solution, you may enter *no solution*. -* If the solution set is all real numbers, you may enter *(-inf, inf)* or *all real numbers*. +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** [`` [$a]x \leq [$a]x+[$b] ``] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph10.pg new file mode 100644 index 0000000000..1ff8a1a60e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph10.pg @@ -0,0 +1,204 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context('Numeric'); + +do { + $numerator = random(1,5,1); + $denominator = random(1,5,1); + $h = non_zero_random(-6,6,1); + do {$k = non_zero_random(-6,6,1);} until ($h != $k); + $m = $numerator/$denominator*$h*$k/abs($h*$k); + $k2 = ($k > 0) ? $k - $numerator : $k + $numerator; + $h2 = ($k2-$k)/$m+$h; +} until ($k2 != $h2); + +@k = num_sort($k,$k2); +@h = num_sort($h,$h2); +$f = Formula("$m*(x - $h)+$k")->reduce; + +@gr = ( ); +@xvalues = num_sort(-7,7,(7-$k)/$m+$h,(-7-$k)/$m+$h); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i]->lb('reset'); + for $j (-6..6){ + if ($j==0 or $j%2!=0) {next;} + $gr[$i]->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i]->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + $gr[$i]->moveTo($h,$k); + $gr[$i]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'blue',1); + $gr[$i]->moveTo($h,$k); + $gr[$i]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'blue',1); +} + +$alt[0] = "This is the graph of a straight line which passes the points ($h,$k) and ($h2,$k2)."; + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +$i0 = random(0,3,1); +if (random(0,1,1)==0) { + $i1 = 0; + $i2 = 1; +} else { + $i1 = 1; + $i2 = 0; +} +$symbol0 = $symbols[$i0]; +$symbol1 = $symbols[$i1]; +$symbol2 = $symbols[$i2]; + +@leftBrackets = ('(','['); +@rightBrackets = (')',']'); + +@ans = ( ); + +$gr[1]->moveTo($h,$k); +if ($m > 0) { + if ($i0 == 0) { + $ans[0] = Interval("(-inf,$h)"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is open."; + } elsif ($i0 == 1) { + $ans[0] = Interval("(-inf,$h]"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is closed."; + } elsif ($i0 == 2) { + $ans[0] = Interval("($h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is open."; + } else { + $ans[0] = Interval("[$h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is closed."; + } +} else { + if ($i0 == 0) { + $ans[0] = Interval("($h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is open."; + } elsif ($i0 == 1) { + $ans[0] = Interval("[$h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is closed."; + } elsif ($i0 == 2) { + $ans[0] = Interval("(-inf,$h)"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is open."; + } else { + $ans[0] = Interval("(-inf,$h]"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is closed."; + } +} + +$y0 = $f->eval(x=>$h[0]); +$y1 = $f->eval(x=>$h[1]); +$ans[1] = Interval("$leftBrackets[$i2] $h[0],$h[1] $rightBrackets[$i1]"); +$gr[2]->moveTo($h[0],$y0); +$gr[2]->lineTo($h[1],$y1,'red',1); +$alt[2] = $alt[0]." The segment from ($h[0],$y0) to ($h[1],$y1) is highlighted in red."; +if ($i1==1) { + $gr[2]->stamps( open_circle($h[0],$y0,'red') ); + $alt[2] .= " The point ($h[0],$y1) is open,"; +} else { + $gr[2]->stamps( closed_circle($h[0],$y0,'red') ); + $alt[2] .= " The point ($h[0],$y0) is closed,"; +} +if ($i2==1) { + $gr[2]->stamps( open_circle($h[1],$y1,'red') ); + $alt[2] .= " and the point ($h[1],$y1) is open."; +} else { + $gr[2]->stamps( closed_circle($h[1],$y1,'red') ); + $alt[2] .= " and the point ($h[1],$y1) is closed."; +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbols[$i0]] [$k]`] + + [__________]{$ans[0]} + +1. [`[$k[0]] [$symbols[$i1]] f(x) [$symbols[$i2]] [$k[1]]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + + + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbols[$i0]] [$k]`], the function's [`y`]-value must be [$words[$i0]] [`[$k]`]. The corresponding segment is highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`[$k[0]] [$symbols[$i1]] f(x) [$symbols[$i2]] [$k[1]]`], the function's [`y`]-value must be between [`[$k[0]]`] and [`[$k[1]]`]. The corresponding segment is highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph20.pg new file mode 100644 index 0000000000..e82945ef36 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph20.pg @@ -0,0 +1,230 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ + + +Context('Numeric'); +$h = random(-4,4,1); +$k = random(-4,4,1); +$x = ($h < 0) ? random(-6,$h-1,1) : random($h+1,6,1); +$y = ($k < 0) ? random($k+1,6,1) : random(-6,$k-1,1); +$c = ($y-$k)/($x - $h)**2; +$f = Formula("$c*(x-$h)^2+$k"); + +@gr = (); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i]->lb('reset'); + for $j (-6..6){ + if (Real($j)==0) {next;} + $gr[$i]->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i]->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + $yexit = ($c < 0) ? -7 : 7; + @xvalues = num_sort(-7,7,sqrt(($yexit-$k)/$c)+$h,-sqrt(($yexit-$k)/$c)+$h); + add_functions($gr[$i], "$f for x in <$xvalues[1],$xvalues[2]> using color:blue and weight:1"); + $px = 14/240; + + $gr[$i]->moveTo($xvalues[1]+$px,$c*($xvalues[1]+$px-$h)**2+$k); + $gr[$i]->arrowTo($xvalues[1],$c*($xvalues[1]-$h)**2+$k,'blue',1); + $gr[$i]->moveTo($xvalues[2]-$px,$c*($xvalues[2]-$px-$h)**2+$k); + $gr[$i]->arrowTo($xvalues[2],$c*($xvalues[2]-$h)**2+$k,'blue',1); +} + +@x = num_sort($x,2*$h-$x); + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +@in = (); +if (random(0,1,1)==0) { + $in[0] = random(0,1,1); + $in[1] = random(2,3,1); +} else { + $in[0] = random(2,3,1); + $in[1] = random(0,1,1); +} +$symbol0 = $symbols[$in[0]]; +$symbol1 = $symbols[$in[1]]; + +@alt = ( ); +$uod = $c > 0 ? 'upward' : 'downward'; +$alt[0] = "This is the graph of a parabola with its vertex at ($h,$k). The parabola faces $uod. It passes the points ($x[0],$y) and ($x[1],$y)."; + +@s0 = ( + " Those two points are open.", + " Those two points are closed." +); + +@s1 = ( + " On the parabola, the segment between x=$x[0] to x=$x[1] are highlighted.", + " On the parabola, the segment from negative infinity to x=$x[0], and the segment from x=$x[1] to infinity are highlighted.", +); + +@s2 = ( + Interval("($x[0],$x[1])"), + Interval("[$x[0],$x[1]]"), + Union("(-inf,$x[0])U($x[1],inf)"), + Union("(-inf,$x[0]]U[$x[1],inf)"), +); + +sub graphOpenDots { + my $p = shift; + $gr[$p]->stamps( open_circle($x[0],$y,'red') ); + $gr[$p]->stamps( open_circle($x[1],$y,'red') ); +} + +sub graphClosedDots { + my $p = shift; + $gr[$p]->stamps( closed_circle($x[0],$y,'red') ); + $gr[$p]->stamps( closed_circle($x[1],$y,'red') ); +} + +sub highlightBetween { + my $p = shift; + add_functions($gr[$p], "$f for x in <$x[0],$x[1]> using color:red and weight:1"); +} + +sub highlightEnds { + my $p = shift; + add_functions($gr[$p], "$f for x in <$xvalues[1],$x[0]> using color:red and weight:1"); + add_functions($gr[$p], "$f for x in <$x[1],$xvalues[2]> using color:red and weight:1"); + $px = 14/240; + $gr[$p]->moveTo($xvalues[1]+$px,$c*($xvalues[1]+$px-$h)**2+$k); + $gr[$p]->arrowTo($xvalues[1],$c*($xvalues[1]-$h)**2+$k,'red',1); + $gr[$p]->moveTo($xvalues[2]-$px,$c*($xvalues[2]-$px-$h)**2+$k); + $gr[$p]->arrowTo($xvalues[2],$c*($xvalues[2]-$h)**2+$k,'red',1); +} + +$alt[1] .= $alt[0]; +$alt[2] .= $alt[0]; +@ans = (); +for my $i (0..1) { + if ($in[$i]==0) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } else { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } + &graphOpenDots($i+1); + } elsif ($in[$i]==1) { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } else { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } + &graphClosedDots($i+1); + } elsif ($in[$i]==2) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } else { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } + &graphOpenDots($i+1); + } else { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } else { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } + &graphClosedDots($i+1); + } +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbol0] [$y]`] + + [__________]{$ans[0]} + +1. [`f(x) [$symbol1] [$y]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbol0] [$y]`], the function's [`y`]-value must be [$words[$in[0]]] [`[$y]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`f(x) [$symbol1] [$y]`], the function's [`y`]-value must be [$words[$in[1]]] [`[$y]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph30.pg new file mode 100644 index 0000000000..6dfa2465bc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolvingInequalityByGraph30.pg @@ -0,0 +1,241 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context('Numeric'); + +$s = Real(random(-3,3,1)); +$r = $s - random(1,3,1); +$t = $s + random(2,3,1); + +$f = Formula("(x-$r)(x-$s)(x-$t)"); +@hts = map{abs($f->eval(x=>$_))}($r..$t); +$amplitude = random(1,3,1); +$c = $amplitude/max(@hts)*random(-1,1,2); +$k = random(1,6-$amplitude,1)*random(-1,1,2); +$f = $c*$f+$k; + +@gr = (); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i] ->lb('reset'); + for $j (-6..6){ + if (Real($j)==0) {next;} + $gr[$i] ->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i] ->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + + $start = $r; + while (abs($f->eval(x=>$start-0.1))<7 and $start > -7) {$start = $start - 0.1}; + $stop = $t; + while (abs($f->eval(x=>$stop+0.1))<7 and $stop < 7) {$stop = $stop + 0.1}; + + add_functions($gr[$i] , "$f for x in <$start,$stop> using color:blue and weight:1"); + $px = 14/240; + $gr[$i] ->moveTo($start+$px,$f->eval(x=>$start+$px)); + $gr[$i] ->arrowTo($start,$f->eval(x=>$start),'blue',1); + $gr[$i] ->moveTo($stop-$px,$f->eval(x=>$stop-$px)); + $gr[$i] ->arrowTo($stop,$f->eval(x=>$stop),'blue',1); +} + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +@in = (); +if (random(0,1,1)==0) { + $in[0] = random(0,1,1); + $in[1] = random(2,3,1); +} else { + $in[0] = random(2,3,1); + $in[1] = random(0,1,1); +} +$symbol0 = $symbols[$in[0]]; +$symbol1 = $symbols[$in[1]]; + +@alt = ( ); +$startL = $c > 0 ? 'negative infinity' : 'positive infinity'; +$endR = $c > 0 ? 'positive infinity' : 'negative infinity'; +$uod0 = $c > 0 ? 'up' : 'down'; +$uod1 = $c > 0 ? 'down' : 'up'; +$alt[0] = "This is the graph of a cubic function which starts at $startL as x-value approaches negative infinity, going $uod0 through the point ($r,$k), curving $uod1 to pass ($s,$k), curving $uod0 to pass ($t,$k), and finally approaching $endR as x-value approaches positive infinity."; + +@s0 = ( + " Those three points are open.", + " Those three points are closed." +); + +@s1 = ( + " On the function, the segment between infinity and x=$r, and the segment from to x=$s to x=$t are highlighted.", + " On the function, the segment from x=$r and x=$s, and the segment from x=$t to infinity are highlighted.", +); + +@s2 = ( + Union("(-inf,$r)U($s,$t)"), + Union("(-inf,$r]U[$s,$t]"), + Union("($r,$s)U($t,inf)"), + Union("[$r,$s]U[$t,inf)"), +); + +sub graphOpenDots { + my $p = shift; + $gr[$p]->stamps( open_circle($r,$k,'red') ); + $gr[$p]->stamps( open_circle($s,$k,'red') ); + $gr[$p]->stamps( open_circle($t,$k,'red') ); +} + +sub graphClosedDots { + my $p = shift; + $gr[$p]->stamps( closed_circle($r,$k,'red') ); + $gr[$p]->stamps( closed_circle($s,$k,'red') ); + $gr[$p]->stamps( closed_circle($t,$k,'red') ); +} + +sub highlightLeft { + my $p = shift; + add_functions($gr[$p] , "$f for x in <$start,$r> using color:red and weight:1"); + add_functions($gr[$p] , "$f for x in <$s,$t> using color:red and weight:1"); + $px = 14/240; + $gr[$p] ->moveTo($start+$px,$f->eval(x=>$start+$px)); + $gr[$p] ->arrowTo($start,$f->eval(x=>$start),'red',1); +} + +sub highlightRight { + my $p = shift; + add_functions($gr[$p] , "$f for x in <$r,$s> using color:red and weight:1"); + add_functions($gr[$p] , "$f for x in <$t,$stop> using color:red and weight:1"); + $px = 14/240; + $gr[$p] ->moveTo($stop-$px,$f->eval(x=>$stop-$px)); + $gr[$p] ->arrowTo($stop,$f->eval(x=>$stop),'red',1); +} + +$alt[1] .= $alt[0]; +$alt[2] .= $alt[0]; +@ans = (); +for my $i (0..1) { + if ($in[$i]==0) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } else { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } + &graphOpenDots($i+1); + } elsif ($in[$i]==1) { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } else { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } + &graphClosedDots($i+1); + } elsif ($in[$i]==2) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } else { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } + &graphOpenDots($i+1); + } else { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } else { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } + &graphClosedDots($i+1); + } +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbol0] [$k]`] + + [__________]{$ans[0]} + +1. [`f(x) [$symbol1] [$k]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbol0] [$k]`], the function's [`y`]-value must be [$words[$in[0]]] [`[$k]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`f(x) [$symbol1] [$k]`], the function's [`y`]-value must be [$words[$in[1]]] [`[$k]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd10.pg new file mode 100644 index 0000000000..4e98f8db20 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd10.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 4 < 2x <= 10 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,5,1); +$a=$b*random(1,4,1); +$c=$b*random($a+1,$a+5,1); +$left = Compute("$a"); +$comp0 = "\lt"; +$middle = Compute("$b*x"); +$comp1 = "\leq"; +$right = Compute("$c"); + +$leftEnd = $a/$b; +$rightEnd = $c/$b; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \lt [$b]x \leq [$c] \\ + \frac{[$a]}{[$b]} & \lt \frac{[$b]x}{[$b]} \leq \frac{[$c]}{[$b]} \\ + [$leftEnd] & \lt x \leq [$rightEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd100.pg new file mode 100644 index 0000000000..03beb63b42 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd100.pg @@ -0,0 +1,202 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: -2x-1<=7 and 3x+3<30. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +#$reach is the maximum value shown on the graph. +$reach = 7; + +$a = random(-$reach+2,-$reach+10,1); +$c0 = random(-5,-2,1); +$c1 = non_zero_random(-5,5,1); +$c2 = $c0*$a+$c1; + +# $symbol0 is the inequality symbol in the solution. +# $symbol0Original is the symbol in the inequality. +$left0 = Compute("$c0*x+$c1")->reduce; +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$right0 = Compute("$c2"); +$symbol0Original = ($symbol0 eq '>') ? '<' : '\leq'; + +$b = random($a+1,$reach-2,1); +$d0 = random(2,5,1); +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +$left1 = Compute("$d0*x+$d1")->reduce; +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$right1 = Compute("$d2"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("$leftEnd $a,$b $rightEnd"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->lineTo($b,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of an interval on a number line. The segment from $a to $b is shaded. The endpoint $a is $leftEndType, and the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0Original] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + [$c0]x+[$c1] &[$symbol0Original] [$c2] & [$d0]x+[$d1] &[$symbol1] [$d2] \\ + [$c0]x+[$c1] \mathbf{{}-[$c1]} &[$symbol0Original] [$c2] \mathbf{{}-[$c1]} & [$d0]x+[$d1]\mathbf{{}-[$d1]} &[$symbol1] [$d2] \mathbf{{}-[$d1]}\\ + [$c0]x &[$symbol0Original] [$c2-$c1] & [$d0]x &[$symbol1] [$d2-$d1] \\ + \frac{[$c0]x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & \frac{[$d0]x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + x &[$symbol0] [$a] & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that, in the first inequality, the direction of inequality symbol changed from [`[$symbol0Original]`] to [`[$symbol0]`] once we divided a negative number on both sides. + +Notice that the keyword *"and"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ and } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the left endpoint is [$leftEndType]; the right endpoint is [$rightEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd110.pg new file mode 100644 index 0000000000..773a0c4035 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd110.pg @@ -0,0 +1,246 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: -2x<=4 and -3x-4<1. +# +# Last edited by Carl Yao 07/27/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 7; + +# $direction decides whether the problem is x>1 and x>2 +# or x<1 and x<2 +$direction = (random(-1,1,2)==1) ? 'left' : 'right'; + +# $symbol0 is the inequality symbol in the solution. +# $symbol0Original is the symbol in the inequality. + +$a = random(-$reach+2,-$reach+7,1); +$c0 = random(-5,-2,1); +$c1 = non_zero_random(-5,5,1); +$c2 = $c0*$a+$c1; + +$b = random($a+1,$reach-2,1); +do {$d0 = random(-5,-2,1);} until ($d0!=$c0); +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +if ($direction eq 'left') { + $symbol0 = random(-1,1,2)>0 ? "<" : "\leq"; + $symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; + $aEndType = ($symbol0 eq '<') ? "open" : "closed"; + $bEndType = ($symbol1 eq '<') ? "open" : "closed"; + $symbol0Original = ($symbol0 eq '<') ? '>' : '\geq'; + $symbol1Original = ($symbol1 eq '<') ? '>' : '\geq'; +} else { + $symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; + $symbol1 = random(-1,1,2)>0 ? ">" : "\geq"; + $aEndType = ($symbol0 eq '>') ? "open" : "closed"; + $bEndType = ($symbol1 eq '>') ? "open" : "closed"; + $symbol0Original = ($symbol0 eq '>') ? '<' : '\leq'; + $symbol1Original = ($symbol1 eq '>') ? '<' : '\leq'; +} + + +$left0 = Compute("$c0*x+$c1")->reduce; +$right0 = Compute("$c2"); + +$left1 = Compute("$d0*x+$d1")->reduce; +$right1 = Compute("$d2"); + + +#These are needed to show inequality symbols in dynamic images. +if ($direction eq 'left') { + $symbol0Show = $symbol0 eq '<' ? '<' : '<='; + $symbol1Show = $symbol1 eq '<' ? '<' : '<='; +} else { + $symbol0Show = $symbol0 eq '>' ? '>' : '>='; + $symbol1Show = $symbol1 eq '>' ? '>' : '>='; +} + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +if ($direction eq 'left') { + $endpoint = ($symbol0 eq '<') ? ')' : ']'; + $numberLineEndType = ($symbol0 eq '<') ? 'open' : 'closed'; + $ans = Compute("(-inf, $a $endpoint"); +} else { + $endpoint = ($symbol1 eq '>') ? '(' : '['; + $numberLineEndType = ($symbol1 eq '>') ? 'open' : 'closed'; + $ans = Compute("$endpoint $b, inf)"); +} + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); + + +if ($direction eq 'left') { + if ($symbol0 eq '<') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + $gr->stamps( open_circle($a,0,'blue') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + $gr->stamps( closed_circle($a,0,'blue') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); + + if ($symbol1 eq '<') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); + + $gr->moveTo($a,0); + $gr->arrowTo(-0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $a to negative infinity is shaded. The endpoint $a is $aEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward negative infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $bEndType."; + +} else { + + if ($symbol1 eq '>') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + $gr->stamps( open_circle($b,0,'blue') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + $gr->stamps( closed_circle($b,0,'blue') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); + + if ($symbol0 eq '>') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); + + $gr->moveTo($b,0); + $gr->arrowTo(0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $b to positive infinity is shaded. The endpoint $b is $bEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward positive infinity, while the endpoint $b is $bEndType."; +} + + + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0Original] [$right0] \text{ and } [$left1] [$symbol1Original] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + [$c0]x+[$c1] &[$symbol0Original] [$c2] & [$d0]x+[$d1] &[$symbol1Original] [$d2] \\ + [$c0]x+[$c1] \mathbf{{}-[$c1]} &[$symbol0Original] [$c2] \mathbf{{}-[$c1]} & [$d0]x+[$d1]\mathbf{{}-[$d1]} &[$symbol1Original] [$d2] \mathbf{{}-[$d1]}\\ + [$c0]x &[$symbol0Original] [$c2-$c1] & [$d0] x &[$symbol1Original] [$d2-$d1] \\ + \frac{[$c0]x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & \frac{[$d0] x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + x &[$symbol0] [$a] & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that, in both inequalities, the direction of inequality symbol changed once we divided a negative number on both sides. + +Notice that the keyword *"and"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ and } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the right endpoint is [$numberLineEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd20.pg new file mode 100644 index 0000000000..d6c03f43de --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd20.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 >= 2x > 4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,5,1); +$c=$b*random(1,4,1); +$a=$b*random($c+1,$c+5,1); +$left = Compute("$a"); +$comp0 = "\geq"; +$middle = Compute("$b*x"); +$comp1 = "\gt"; +$right = Compute("$c"); + +$leftEnd = $c/$b; +$rightEnd = $a/$b; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \geq [$b]x \gt [$c] \\ + \frac{[$a]}{[$b]} & \geq \frac{[$b]x}{[$b]} \gt \frac{[$c]}{[$b]} \\ + [$rightEnd] & \geq x \gt [$leftEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd30.pg new file mode 100644 index 0000000000..17f2be20fa --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd30.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 > -x > -4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +do {$c=random(-5,-1,1);} until (abs($c)!=abs($a)); +$b=-1; +$left = Compute("$a"); +$comp0 = "\gt"; +$middle = Compute("-x"); +$comp1 = "\gt"; +$right = Compute("$c"); + +$leftEnd = -$a; +$rightEnd = -$c; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x < $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \gt -x \gt [$c] \\ + (-1)\cdot [$a] & \lt (-1)\cdot (-x) \lt (-1)\cdot ([$c]) \\ + [$leftEnd] & \lt x \lt [$rightEnd] \\ +\end{aligned} + ``] + +Note that the direction of an inequality symbol changes when we multiply a negative number on both sides. + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd40.pg new file mode 100644 index 0000000000..19202d421b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd40.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 5 <= 1-2x <= 11 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +do { + $c=random(2,5,1); + + $dMinusB = -$c*random(2,5,1); + $b = non_zero_random(-5,5,1); + $d = $b+$dMinusB; + + $aMinusB = -$c*random(2,10,1); + $a = $b+$aMinusB; +} until ($a<$d); + +$left = Compute("$a"); +$comp0 = "\leq"; +$middle = Compute("$b-$c*x"); +$comp1 = "\leq"; +$right = Compute("$d"); + +$leftEnd = ($d-$b)/(-$c); +$rightEnd = ($a-$b)/(-$c); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd <= x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \leq [$b]-[$c]x \leq [$d] \\ + [$a]\mathbf{{}-[$b]} & \leq [$b]-[$c]x \mathbf{{}-[$b]} \leq [$d] \mathbf{{}-[$b]}\\ + [$aMinusB] & \leq -[$c]x \leq [$dMinusB]\\ + \frac{[$aMinusB]}{-[$c]} & \geq \frac{-[$c]x}{-[$c]} \geq \frac{[$dMinusB]}{-[$c]} \\ + [$rightEnd] & \geq x \geq [$leftEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd50.pg new file mode 100644 index 0000000000..2fcf26ba91 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd50.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like -3 > 1-(2-2x) >= -11 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +do { + $d=random(2,5,1); + $bMinusC=random(2,5,1); + $c = random(1,5,1); + $b = $c+$bMinusC; + + $right1 = $d*random(-5,-1,1); + $e = $right1+$b-$c; + + $left1 = $d*random(-5,-1,1); + $a = $left1+$b-$c; +} until (($e<0) && ($a>$e)); + +$left = Compute("$a"); +$comp0 = "\gt"; +$middle = Compute("$b-($c-$d*x)"); +$comp1 = "\geq"; +$right = Compute("$e"); + +$leftEnd = ($e-$bMinusC)/($d); +$rightEnd = ($a-$bMinusC)/($d); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd <= x < $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$leftEnd,$rightEnd)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] [$middle] [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \gt [$b]-([$c]-[$d]x) \geq [$e] \\ + [$a] & \gt [$b]-[$c]+[$d]x \geq [$e] \\ + [$a] & \gt [$b-$c]+[$d]x \geq [$e] \\ + [$a]\mathbf{{}-[$b-$c]}& \gt [$b-$c]+[$d]x \mathbf{{}-[$b-$c]} \geq [$e] \mathbf{{}-[$b-$c]}\\ + [$left1] & \gt [$d]x \geq [$right1] \\ + \frac{[$left1]}{[$d]} & \gt \frac{[$d]x}{[$d]} \geq \frac{[$right1]}{[$d]} \\ + [$rightEnd] & \gt x \geq [$leftEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd60.pg new file mode 100644 index 0000000000..5e39e66af4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd60.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 >= (2/3)x > 4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + $b=random(2,5,1); + $c=random(2,8,1); +} until (gcd($b,$c)==1); + +$a=$b*random(1,5,1); +$d=$b*random($a+1,$a+5,1); + +$left = Compute("$a"); +$comp0 = "\lt"; + +$comp1 = "\lt"; +$right = Compute("$d"); + +$leftEnd = $a*$c/$b; +$rightEnd = $d*$c/$b; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x < $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the compound inequality algebraically. + +[@KeyboardInstructions('For the [`\infty`] symbol, type [|INF|]*. For the union symbol [`\cup`], type [|U|]*. For [`\leq`], type [|<=|]*. For [`\geq`], type [|>=|]*. For the such that symbol in set-builder notation, [|||]* is usually above the [|Enter|]* key')@]** + + [`` [$left] [$comp0] \frac{[$b]}{[$c]}x [$comp1] [$right] ``] + + In set-builder notation, the solution set is [______________]{$setans}. + + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \lt \frac{[$b]}{[$c]}x \lt [$d] \\ + \mathbf{[$c]\cdot{}} [$a] & \lt \mathbf{[$c]\cdot{}}\frac{[$b]}{[$c]}x \lt \mathbf{[$c]\cdot{}}[$d] \\ + [$a*$c] & \lt [$b]x \lt [$d*$c] \\ + \frac{[$a*$c]}{[$b]} & \lt \frac{[$b]x}{[$b]} \lt \frac{[$d*$c]}{[$b]} \\ + [$leftEnd] & \lt x \lt [$rightEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd70.pg new file mode 100644 index 0000000000..a70c1fe45b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd70.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 > 1-(2/3)x >= 4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + $c=random(2,5,1); + $d=random(2,8,1); +} until (gcd($c,$d)==1); +$b=non_zero_random(-5,5,1); + +do { + $aMinusB=(-$c)*random(2,5,1)*random(-1,1,2); + $eMinusB=(-$c)*random(2,5,1)*random(-1,1,2); +} until ($eMinusB<$aMinusB); +$a = $b+$aMinusB; +$e = $b+$eMinusB; + +$left = Compute("$a"); +$comp0 = "\gt"; + +$comp1 = "\geq"; +$right = Compute("$e"); + +$leftEnd = ($a-$b)*$d/(-$c); +$rightEnd = ($e-$b)*$d/(-$c); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the compound inequality algebraically. + + [`` [$left] [$comp0] [$b]-\frac{[$c]}{[$d]}x [$comp1] [$right] ``] + +[@KeyboardInstructions('For the [`\infty`] symbol, type [|INF|]*. For the union symbol [`\cup`], type [|U|]*. For [`\leq`], type [|<=|]*. For [`\geq`], type [|>=|]*. For the such that symbol in set-builder notation, [|||]* is usually above the [|Enter|]* key')@]** + + In set-builder notation, the solution set is [______________]{$setans}. + + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \gt [$b]-\frac{[$c]}{[$d]}x \geq [$e] \\ + \mathbf{[$d]\cdot{}}[$a] & \gt \mathbf{[$d]\cdot{}}([$b])-\mathbf{[$d]\cdot{}}\frac{[$c]}{[$d]}x \geq \mathbf{[$d]\cdot{}}[$e] \\ + [$a*$d] & \gt [$b*$d]-[$c]x \geq [$e*$d] \\ + [$a*$d] \mathbf{{}-[$b*$d]} & \gt [$b*$d]-[$c]x\mathbf{{}-[$b*$d]} \geq [$e*$d] \mathbf{{}-[$b*$d]}\\ + [$a*$d-$b*$d] & \gt -[$c]x \geq [$e*$d-$b*$d] \\ + \frac{[$a*$d-$b*$d]}{-[$c]} & \lt \frac{-[$c]x}{-[$c]} \leq \frac{[$e*$d-$b*$d]}{-[$c]} \\ + [$leftEnd] & \lt x \leq [$rightEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd80.pg new file mode 100644 index 0000000000..d325e9ad25 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd80.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Solve compound linear inequality ("and" type), and write solution in both set notation +# and interval notation. +# The equation looks like 10 >= (1+2x)/3 > 4 +# +# Last updated: Yao, 04/18/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { +$c=random(2,5,1); +$right1 = $c*random(-3,3,1); +$left1 = $right1+$c*random(2,5,1); + +$b=random(1,5,1); +$d=random(2,5,1); +$a=($left1+$b)/$d; +$e=($right1+$b)/$d; +} until ( ($a==int($a)) && ($e==int($e)) ); + +$left = Compute("$a"); +$comp0 = "\geq"; + +$comp1 = "\gt"; +$right = Compute("$e"); + +$rightEnd = ($a*$d-$b)/$c; +$leftEnd = ($e*$d-$b)/$c; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | $leftEnd < x <= $rightEnd}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($leftEnd,$rightEnd]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality: + + [`` [$left] [$comp0] \frac{[$b]+[$c]x}{[$d]} [$comp1] [$right] ``] + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + + In set-builder notation, the solution set is [______________]{$setans}. + An example of set-builder notation is [`\{x\mid 10>x>9\}`]. The *|* symbol is above the keyboard's Enter key. + + In interval notation, the solution set is [______________]{$intans}. + An example of interval notation is [`(1,2)`]. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] & \geq \frac{[$b]+[$c]x}{[$d]} \gt [$e] \\ + \mathbf{[$d]\cdot{}}[$a] & \geq \mathbf{[$d]\cdot{}}\frac{[$b]+[$c]x}{[$d]} \gt \mathbf{[$d]\cdot{}}[$e] \\ + [$a*$d] & \geq [$b]+[$c]x \gt [$e*$d] \\ + [$a*$d] \mathbf{{}-[$b]}& \geq [$b]+[$c]x \mathbf{{}-[$b]} \gt [$e*$d]\mathbf{{}-[$b]} \\ + [$left1] & \geq [$c]x \gt [$e*$d-$b] \\ + \frac{[$left1]}{[$c]} & \geq \frac{[$c]x}{[$c]} \gt \frac{[$e*$d-$b]}{[$c]} \\ + [$rightEnd] & \geq x \gt [$leftEnd] \\ +\end{aligned} + ``] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd85.pg new file mode 100644 index 0000000000..31a7de27a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd85.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Solve compound linear inequality ("and" type) application problem. +# The equation looks like 10 >= (1+2x)/3 > 4 +# +# Last updated: Yao, 06/28/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(30,50,5); +$b = random(450,600,10); +$ans1 = random(2030,2050,5); +$ans2 = random(2055,2085,5); + +$func = Compute("$a*(x-2000)+$b"); +$small = $func->eval(x=>$ans1); +$big = $func->eval(x=>$ans2); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A city's homeless population since the year 2000 can be modeled by this function: + + [`` f(x)=[$func] ``] + +where [`x`] represents the number of year passed since 2000, and [`f(x)`] represents the number of homeless people. Estimate the years when this city's homeless population will be between [`[$small]`] and [`[$big]`] people. Use an inequality to solve this problem. + +*Solution*: This city's homeless population will be between [`[$small]`] and [`[$big]`] people between the year [__________]{$ans1} (smaller value) and the year [__________]{$ans2} (bigger value). + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +It's given that the function [`[f(x)]`] represents this city's homeless population. To make this value between [`[$small]`] and [`[$big]`] people, we write the compound inequality [`[$small] \le [$func] \le [$big]`], and then solve it: + + [`` +\begin{aligned} + [$small] &\le [$func] \le [$big] \\ + [$small] \mathbf{-[$b]} &\le [$func] \mathbf{-[$b]} \le [$big] \mathbf{-[$b]} \\ + [$small-$b] & \le [$a](x-2000) \le [$big-$b] \\ + \frac{[$small-$b]}{[$a]} & \le \frac{[$a](x-2000)}{[$a]} \le \frac{[$big-$b]}{[$a]} \\ + [$ans1-2000] & \le x-2000 \le [$ans2-2000] \\ + [$ans1-2000] \mathbf{+2000} & \le x-2000 \mathbf{+2000} \le [$ans2-2000] \mathbf{+2000} \\ + [$ans1] &\le x \le [$ans2] +\end{aligned} + ``] + +*Solution*: This city's homeless population will be between [`[$small]`] and [`[$big]`] people between the year [`[$ans1]`] and the year [`[$ans2]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd86.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd86.pg new file mode 100644 index 0000000000..c51b8fe1a7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd86.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Solve compound linear inequality ("and" type) application problem. +# The equation looks like 10 >= (1+2x)/3 > 4 +# +# Last updated: Yao, 06/28/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','compound','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(2,6,1); +$b = random(2,6,1); +$ans1 = random(2,5,1); +$ans2 = random(6,10,1); + +$small = (2*$a+2)*$ans1-2*$b; +$big = (2*$a+2)*$ans2-2*$b; + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A rectangle's length is [`[$b]`] yards less than [`[$a]`] times of its width. If the rectangle's perimeter must be between [`[$small]`] and [`[$big]`] yards, what is the range of its width? Use an inequality to solve this problem. + +*Solution*: The rectangle's width must be between [__________]{$ans1} yards (smaller value) and [__________]{$ans2} yards (bigger value). + +END_PGML + +############################################## + +$t1 = 2*$a+2; +$t2 = $b*2; + +BEGIN_PGML_SOLUTION + +Assume the rectangle's width is [`w`] yards, then its length is [`[$a]w-[$b]`] yards, and its perimeter is: + + [`` 2([$a]w-[$b])+2w = [$t1]w-[$t2] ``] yards. + +Since the rectangle's perimeter is limited to [`[$small]`] and [`[$big]`] yards, we can write an inequality and then solve it: + + [`` +\begin{aligned} + [$small] &\le [$t1]w-[$t2] \le [$big] \\ + [$small] \mathbf{+[$t2]} &\le [$t1]w-[$t2] \mathbf{+[$t2]} \le [$big] \mathbf{+[$t2]} \\ + [$small+$t2] & \le [$t1]w \le [$big+$t2] \\ + \frac{[$small+2*$b]}{[$t1]} & \le \frac{[$t1]w}{[$t1]} \le \frac{[$big+2*$b]}{[$t1]} \\ + [$ans1] &\le w \le [$ans2] +\end{aligned} + ``] + +*Solution*: The rectangle's width must be between [`[$ans1]`] yards (smaller value) and [`[$ans2]`] yards (bigger value). + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd90.pg new file mode 100644 index 0000000000..f778906335 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityAnd90.pg @@ -0,0 +1,195 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: 2x-1>=7 and 3x+3<30. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$a = random(-$reach+2,-$reach+10,1); +$c0 = random(2,5,1); +$c1 = non_zero_random(-5,5,1); +$c2 = $c0*$a+$c1; + +$left0 = Compute("$c0*x+$c1")->reduce; +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$right0 = Compute("$c2"); + +$b = random($a+1,$reach-2,1); +$d0 = random(2,5,1); +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +$left1 = Compute("$d0*x+$d1")->reduce; +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$right1 = Compute("$d2"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("$leftEnd $a,$b $rightEnd"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->lineTo($b,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of an interval on a number line. The segment from $a to $b is shaded. The endpoint $a is $leftEndType, and the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + [$c0]x+[$c1] &[$symbol0] [$c2] & [$d0]x+[$d1] &[$symbol1] [$d2] \\ + [$c0]x+[$c1] \mathbf{{}-[$c1]} &[$symbol0] [$c2] \mathbf{{}-[$c1]} & [$d0]x+[$d1]\mathbf{{}-[$d1]} &[$symbol1] [$d2] \mathbf{{}-[$d1]}\\ + [$c0]x &[$symbol0] [$c2-$c1] & [$d0]x &[$symbol1] [$d2-$d1] \\ + \frac{[$c0]x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & \frac{[$d0]x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + x &[$symbol0] [$a] & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that the keyword *"and"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ and } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the left endpoint is [$leftEndType]; the right endpoint is [$rightEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics10.pg new file mode 100644 index 0000000000..538e5c2f0e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics10.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>=4 and x<9. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$left0 = Compute("x"); +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$a = random(-$reach+3,2,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$b = random($a+1,$reach-3,1); +$right1 = Compute("$b"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("$leftEnd $a,$b $rightEnd"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->lineTo($b,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of an interval on a number line. The segment from $a to $b is shaded. The endpoint $a is $leftEndType, and the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the left endpoint is [$leftEndType]; the right endpoint is [$rightEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics20.pg new file mode 100644 index 0000000000..3239e5511c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics20.pg @@ -0,0 +1,212 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>=4 and x>1. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +# $direction decides whether the problem is x>1 and x>2 +# or x<1 and x<2 +$direction = (random(-1,1,2)==1) ? 'left' : 'right'; + +$left0 = Compute("x"); +if ($direction eq 'left') { + $symbol0 = random(-1,1,2)>0 ? "<" : "\leq"; + $symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; + $aEndType = ($symbol0 eq '<') ? "open" : "closed"; + $bEndType = ($symbol1 eq '<') ? "open" : "closed"; +} else { + $symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; + $symbol1 = random(-1,1,2)>0 ? ">" : "\geq"; + $aEndType = ($symbol0 eq '>') ? "open" : "closed"; + $bEndType = ($symbol1 eq '>') ? "open" : "closed"; +} +$a = random(-$reach+3,2,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$b = random($a+1,$reach-3,1); +$right1 = Compute("$b"); + + + +#These are needed to show inequality symbols in dynamic images. +if ($direction eq 'left') { + $symbol0Show = $symbol0 eq '<' ? '<' : '<='; + $symbol1Show = $symbol1 eq '<' ? '<' : '<='; +} else { + $symbol0Show = $symbol0 eq '>' ? '>' : '>='; + $symbol1Show = $symbol1 eq '>' ? '>' : '>='; +} + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +if ($direction eq 'left') { + $endpoint = ($symbol0 eq '<') ? ')' : ']'; + $numberLineEndType = ($symbol0 eq '<') ? 'open' : 'closed'; + $ans = Compute("(-inf, $a $endpoint"); +} else { + $endpoint = ($symbol1 eq '>') ? '(' : '['; + $numberLineEndType = ($symbol1 eq '>') ? 'open' : 'closed'; + $ans = Compute("$endpoint $b, inf)"); +} + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); + + +if ($direction eq 'left') { + if ($symbol0 eq '<') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + $gr->stamps( open_circle($a,0,'blue') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + $gr->stamps( closed_circle($a,0,'blue') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); + + if ($symbol1 eq '<') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); + + $gr->moveTo($a,0); + $gr->arrowTo(-0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $a to negative infinity is shaded. The endpoint $a is $aEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward negative infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $bEndType."; + +} else { + + if ($symbol1 eq '>') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + $gr->stamps( open_circle($b,0,'blue') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + $gr->stamps( closed_circle($b,0,'blue') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); + + if ($symbol0 eq '>') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); + + $gr->moveTo($b,0); + $gr->arrowTo(0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $b to positive infinity is shaded. The endpoint $b is $bEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward positive infinity, while the endpoint $b is $bEndType."; +} + + + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the right endpoint is [$numberLineEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics30.pg new file mode 100644 index 0000000000..c27fe967dd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics30.pg @@ -0,0 +1,172 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>3 and x<1. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$left0 = Compute("x"); +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$a = random($reach-5,$reach-1,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$b = random(-$reach+1,$a-1,1); +$right1 = Compute("$b"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("DNE"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { +# $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { +# $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { +# $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { +# $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +#$gr->moveTo($a,0); +#$gr->lineTo($b,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. Nothing on the number line is shaded. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ and } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "and", numbers in the solution set must meet the conditions of both inequalities. In other words, we are look for the intersection of both sets. + +Notice that no number can meet the conditions of both inequalities, so the solution is an empty set, or DNE (Does Not Exist). + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics40.pg new file mode 100644 index 0000000000..6635a03798 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics40.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>=4 or x<9. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$left0 = Compute("x"); +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$a = random(-$reach+3,2,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$b = random($a+1,$reach-3,1); +$right1 = Compute("$b"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("(-inf,inf)"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { +# $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { +# $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { +# $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { +# $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo(0,0); +$gr->arrowTo(0.99*$reach,0,'blue',3); +$gr->moveTo(0,0); +$gr->arrowTo(-0.99*$reach,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. The whole number line is shaded. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in either solution set will be in the final solution. In other words, we are look for the union of both sets. In this case, the final solution covers the whole number line, so the solution is [`(-\infty,\infty)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics50.pg new file mode 100644 index 0000000000..1d608af1e9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics50.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>=4 or x<1. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +$left0 = Compute("x"); +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$a = random($reach-10,$reach-1,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$b = random(-$reach+1,$a-1,1); +$right1 = Compute("$b"); + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("(-inf,$b $rightEnd U $leftEnd $a, inf)"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->arrowTo(0.99*$reach,0,'blue',3); +$gr->moveTo($b,0); +$gr->arrowTo(-0.99*$reach,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. Two segments are shaded. The first segment starts at $a, and goes toward positive infinity, while the endpoint $a is $leftEndType. The second segment starts at $b, and goes toward negative infinity, while the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in either solution set will be in the final solution. In other words, we are look for the union of both given sets. The solution is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics60.pg new file mode 100644 index 0000000000..ef84012d08 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityBasics60.pg @@ -0,0 +1,212 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: x>=4 or x>1. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +#$reach is the maximum value shown on the graph. +$reach = 7; + +# $direction decides whether the problem is x>1 or x>2 +# or x<1 or x<2 +$direction = (random(-1,1,2)==1) ? 'left' : 'right'; + +$left0 = Compute("x"); +if ($direction eq 'left') { + $symbol0 = random(-1,1,2)>0 ? "<" : "\leq"; + $symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; + $aEndType = ($symbol0 eq '<') ? "open" : "closed"; + $bEndType = ($symbol1 eq '<') ? "open" : "closed"; +} else { + $symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; + $symbol1 = random(-1,1,2)>0 ? ">" : "\geq"; + $aEndType = ($symbol0 eq '>') ? "open" : "closed"; + $bEndType = ($symbol1 eq '>') ? "open" : "closed"; +} +$a = random(-$reach+3,2,1); +$right0 = Compute("$a"); + +$left1 = Compute("x"); +$b = random($a+1,$reach-3,1); +$right1 = Compute("$b"); + + + +#These are needed to show inequality symbols in dynamic images. +if ($direction eq 'left') { + $symbol0Show = $symbol0 eq '<' ? '<' : '<='; + $symbol1Show = $symbol1 eq '<' ? '<' : '<='; +} else { + $symbol0Show = $symbol0 eq '>' ? '>' : '>='; + $symbol1Show = $symbol1 eq '>' ? '>' : '>='; +} + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +if ($direction eq 'left') { + $endpoint = ($symbol1 eq '<') ? ')' : ']'; + $numberLineEndType = ($symbol1 eq '<') ? 'open' : 'closed'; + $ans = Compute("(-inf, $b $endpoint"); +} else { + $endpoint = ($symbol0 eq '>') ? '(' : '['; + $numberLineEndType = ($symbol0 eq '>') ? 'open' : 'closed'; + $ans = Compute("$endpoint $a, inf)"); +} + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); + + +if ($direction eq 'left') { + if ($symbol1 eq '<') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + $gr->stamps( open_circle($b,0,'blue') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + $gr->stamps( closed_circle($b,0,'blue') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); + + if ($symbol0 eq '<') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); + + $gr->moveTo($b,0); + $gr->arrowTo(-0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $b to negative infinity is shaded. The endpoint $b is $bEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward negative infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $bEndType."; + +} else { + + if ($symbol0 eq '>') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + $gr->stamps( open_circle($a,0,'blue') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + $gr->stamps( closed_circle($a,0,'blue') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); + + if ($symbol1 eq '>') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); + + $gr->moveTo($a,0); + $gr->arrowTo(0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $a to positive infinity is shaded. The endpoint $a is $aEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward positive infinity, while the endpoint $b is $bEndType."; +} + + + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|U|]* for the union symbol [`\cup`], and [|DNE|]* if there are no solutions.!)@]** + + [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in the solution set need to meet the conditions of either inequality. In other words, we are look for the union of both given sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the right endpoint is [$numberLineEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr10.pg new file mode 100644 index 0000000000..5ba55514aa --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr10.pg @@ -0,0 +1,206 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: 2x+2>=8 or -x+3>-2. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +#$reach is the maximum value shown on the graph. +$reach = 7; + +$a = random($reach-10,$reach-1,1); +$c0 = random(2,5,1); +$c1 = non_zero_random(-5,5,1); +$c2 = $c0*$a+$c1; + +$left0 = Compute("$c0*x+$c1")->reduce; +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$right0 = Compute("$c2"); + +# $symbol1 is the inequality symbol in the solution. +# $symbol1Original is the symbol in the inequality. + +$b = random(-$reach+1,$a-1,1); +$d0 = -1; +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +$left1 = Compute("$d0*x+$d1")->reduce; +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$right1 = Compute("$d2"); +$symbol1Original = ($symbol1 eq '<') ? '>' : '\geq'; + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("(-inf,$b $rightEnd U $leftEnd $a, inf)"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->arrowTo(0.99*$reach,0,'blue',3); +$gr->moveTo($b,0); +$gr->arrowTo(-0.99*$reach,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. Two segments are shaded. The first segment starts at $a, and goes toward positive infinity, while the endpoint $a is $leftEndType. The second segment starts at $b, and goes toward negative infinity, while the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +Please type: + +* *inf* for [`\infty`], +* [|DNE|]* for "no solution" +* *U* for the union symbol [`\cup`] + + [`` [$left0] [$symbol0] [$right0] \text{ or } [$left1] [$symbol1Original] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + [$c0]x+[$c1] &[$symbol0] [$c2] & -x+[$d1] &[$symbol1Original] [$d2] \\ + [$c0]x+[$c1] \mathbf{{}-[$c1]} &[$symbol0] [$c2] \mathbf{{}-[$c1]} & -x+[$d1]\mathbf{{}-[$d1]} &[$symbol1Original] [$d2] \mathbf{{}-[$d1]}\\ + [$c0]x &[$symbol0] [$c2-$c1] & [$d0]\cdot x &[$symbol1Original] [$d2-$d1] \\ + \frac{[$c0]x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & \frac{[$d0] \cdot x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + x &[$symbol0] [$a] & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that, in the second inequality, the direction of inequality symbol changed from [`[$symbol1Original]`] to [`[$symbol1]`] once we divided a negative number on both sides. + +Notice that the keyword *"or"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ or } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in either solution set will be in the final solution. In other words, we are look for the union of both sets. The solution is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr20.pg new file mode 100644 index 0000000000..1318ad7ad3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr20.pg @@ -0,0 +1,210 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: -2x+2<=-4 or -x+3>-2. +# +# Last edited by Carl Yao 07/10/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +#$reach is the maximum value shown on the graph. +$reach = 7; + +# $symbol0 is the inequality symbol in the solution. +# $symbol0Original is the symbol in the inequality. + +$a = random($reach-10,$reach-1,1); +$c0 = random(-5,-2,1); +$c1 = non_zero_random(-5,5,1); +$c2 = $c0*$a+$c1; + +$left0 = Compute("$c0*x+$c1")->reduce; +$symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; +$right0 = Compute("$c2"); +$symbol0Original = ($symbol0 eq '>') ? '<' : '\leq'; + +# $symbol1 is the inequality symbol in the solution. +# $symbol1Original is the symbol in the inequality. + +$b = random(-$reach+1,$a-1,1); +$d0 = -1; +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +$left1 = Compute("$d0*x+$d1")->reduce; +$symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; +$right1 = Compute("$d2"); +$symbol1Original = ($symbol1 eq '<') ? '>' : '\geq'; + +#These are needed to show inequality symbols in dynamic images. +$symbol0Show = $symbol0 eq '>' ? '>' : '>='; +$symbol1Show = $symbol1 eq '<' ? '<' : '<='; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + + +$leftEnd = ($symbol0 eq ">") ? '(' : '['; +$rightEnd = ($symbol1 eq "<") ? ')' : ']'; +$ans = Compute("(-inf,$b $rightEnd U $leftEnd $a, inf)"); + + +Context("Numeric"); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); + +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +if ($leftEnd eq '(') { + $gr->stamps( open_circle($a,0,'blue') ); + $gr->stamps( open_circle($a,$line0Height,'red') ); +} else { + $gr->stamps( closed_circle($a,0,'blue') ); + $gr->stamps( closed_circle($a,$line0Height,'red') ); +}; + +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); +if ($rightEnd eq ')') { + $gr->stamps( open_circle($b,0,'blue') ); + $gr->stamps( open_circle($b,$line1Height,'black') ); +} else { + $gr->stamps( closed_circle($b,0,'blue') ); + $gr->stamps( closed_circle($b,$line1Height,'black') ); +}; + +$gr->moveTo($a,0); +$gr->arrowTo(0.99*$reach,0,'blue',3); +$gr->moveTo($b,0); +$gr->arrowTo(-0.99*$reach,0,'blue',3); + +$gr->moveTo($a,$line0Height); +if ( ($symbol0 eq '>') or ($symbol0 eq '\geq') ) { + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); +} else { + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); +} + +$gr->moveTo($b,$line1Height); +if ( ($symbol1 eq '<') or ($symbol1 eq '\leq') ) { + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); +} else { + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); +} + +$leftEndType = ($leftEnd eq '(') ? 'open' : 'closed'; +$rightEndType = ($rightEnd eq ')') ? 'open' : 'closed'; + +$ALT = "Graph of a number line. Two segments are shaded. The first segment starts at $a, and goes toward positive infinity, while the endpoint $a is $leftEndType. The second segment starts at $b, and goes toward negative infinity, while the endpoint $b is $rightEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $leftEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $rightEndType."; + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +Please type: + +* *inf* for [`\infty`], +* [|DNE|]* for "no solution" +* *U* for the union symbol [`\cup`] + + [`` [$left0] [$symbol0Original] [$right0] \text{ or } [$left1] [$symbol1Original] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + [$c0]x+[$c1] &[$symbol0Original] [$c2] & -x+[$d1] &[$symbol1Original] [$d2] \\ + [$c0]x+[$c1] \mathbf{{}-[$c1]} &[$symbol0Original] [$c2] \mathbf{{}-[$c1]} & -x+[$d1]\mathbf{{}-[$d1]} &[$symbol1Original] [$d2] \mathbf{{}-[$d1]}\\ + [$c0]x &[$symbol0Original] [$c2-$c1] & [$d0]\cdot x &[$symbol1Original] [$d2-$d1] \\ + \frac{[$c0]x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & \frac{[$d0] \cdot x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + x &[$symbol0] [$a] & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that, in both inequalities, the direction of inequality symbol changed once we divided a negative number on both sides. + +Notice that the keyword *"or"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ or } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in either solution set will be in the final solution. In other words, we are look for the union of both sets. The solution is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr30.pg new file mode 100644 index 0000000000..b9c219fa19 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/CompoundInequalityOr30.pg @@ -0,0 +1,250 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve basic compound inequalities. Problem is like: -x+3<=4 or -2x<10. +# +# Last edited by Carl Yao 07/27/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", +# "PCCgraphMacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserPopUp.pl", +# "contextInequalitySetBuilder.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$reach is the maximum value shown on the graph. +$reach = 7; + +# $direction decides whether the problem is x>1 or x>2 +# or x<1 or x<2 +$direction = (random(-1,1,2)==1) ? 'left' : 'right'; + +# $symbol0 is the inequality symbol in the solution. +# $symbol0Original is the symbol in the inequality. + +$a = random(-$reach+2,-$reach+7,1); +$c0 = -1; +$c1 = 0; +$c2 = $c0*$a+$c1; + +$b = random($a+1,$reach-2,1); +do {$d0 = random(-5,-2,1);} until ($d0!=$c0); +$d1 = non_zero_random(-5,5,1); +$d2 = $d0*$b+$d1; + +$left0 = Compute("x"); +if ($direction eq 'left') { + $symbol0 = random(-1,1,2)>0 ? "<" : "\leq"; + $symbol1 = random(-1,1,2)>0 ? "<" : "\leq"; + $aEndType = ($symbol0 eq '<') ? "open" : "closed"; + $bEndType = ($symbol1 eq '<') ? "open" : "closed"; + $symbol0Original = ($symbol0 eq '<') ? '>' : '\geq'; + $symbol1Original = ($symbol1 eq '<') ? '>' : '\geq'; +} else { + $symbol0 = random(-1,1,2)>0 ? ">" : "\geq"; + $symbol1 = random(-1,1,2)>0 ? ">" : "\geq"; + $aEndType = ($symbol0 eq '>') ? "open" : "closed"; + $bEndType = ($symbol1 eq '>') ? "open" : "closed"; + $symbol0Original = ($symbol0 eq '>') ? '<' : '\leq'; + $symbol1Original = ($symbol1 eq '>') ? '<' : '\leq'; +} + +$left0 = Compute("$c0*x+$c1")->reduce; +$right0 = Compute("$c2"); + +$left1 = Compute("$d0*x+$d1")->reduce; +$right1 = Compute("$d2"); + + + +#These are needed to show inequality symbols in dynamic images. +if ($direction eq 'left') { + $symbol0Show = $symbol0 eq '<' ? '<' : '<='; + $symbol1Show = $symbol1 eq '<' ? '<' : '<='; +} else { + $symbol0Show = $symbol0 eq '>' ? '>' : '>='; + $symbol1Show = $symbol1 eq '>' ? '>' : '>='; +} + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); + +if ($direction eq 'left') { + $endpoint = ($symbol1 eq '<') ? ')' : ']'; + $numberLineEndType = ($symbol1 eq '<') ? 'open' : 'closed'; + $ans = Compute("(-inf, $b $endpoint"); +} else { + $endpoint = ($symbol0 eq '>') ? '(' : '['; + $numberLineEndType = ($symbol0 eq '>') ? 'open' : 'closed'; + $ans = Compute("$endpoint $a, inf)"); +} + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio*3; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio*3; +$aboveSpace = $reach*$aspectRatio*3; +$belowSpace = $reach*$aspectRatio; +$hardCopyPercent = 400; #meaning 40% + +$line0Height = $reach*$aspectRatio; +$line1Height = $reach*$aspectRatio*2; + +$gr = init_graph(-$reach,-$belowSpace,$reach,$aboveSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] +); +@ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$belowSpace/4,0,'black','center','top')); +$gr->lb( new Label($a,-$belowSpace/4,$a,'blue','center','top')); +$gr->lb( new Label($b,-$belowSpace/4,$b,'blue','center','top')); + + +if ($direction eq 'left') { + if ($symbol1 eq '<') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + $gr->stamps( open_circle($b,0,'blue') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + $gr->stamps( closed_circle($b,0,'blue') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(-0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b+$reach/20,$line1Height,"x $symbol1Show $b",'black','left','middle')); + + if ($symbol0 eq '<') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(-0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a+$reach/20,$line0Height,"x $symbol0Show $a",'red','left','middle')); + + $gr->moveTo($b,0); + $gr->arrowTo(-0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $b to negative infinity is shaded. The endpoint $b is $bEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward negative infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward negative infinity, while the endpoint $b is $bEndType."; + +} else { + + if ($symbol0 eq '>') { + $gr->stamps( open_circle($a,$line0Height,'red') ); + $gr->stamps( open_circle($a,0,'blue') ); + } else { + $gr->stamps( closed_circle($a,$line0Height,'red') ); + $gr->stamps( closed_circle($a,0,'blue') ); + } + $gr->moveTo($a,$line0Height); + $gr->arrowTo(0.99*$reach,$line0Height,'red',3); + $gr->lb( new Label($a-$reach/20,$line0Height,"x $symbol0Show $a",'red','right','middle')); + + if ($symbol1 eq '>') { + $gr->stamps( open_circle($b,$line1Height,'black') ); + } else { + $gr->stamps( closed_circle($b,$line1Height,'black') ); + } + $gr->moveTo($b,$line1Height); + $gr->arrowTo(0.99*$reach,$line1Height,'black',3); + $gr->lb( new Label($b-$reach/20,$line1Height,"x $symbol1Show $b",'black','right','middle')); + + $gr->moveTo($a,0); + $gr->arrowTo(0.99*$reach,0,'blue',3); + + $ALT = "Graph of an interval on a number line. The segment from $a to positive infinity is shaded. The endpoint $a is $aEndType. Above the number line, there are two arrowed lines. The first arrow starts from $a and goes toward positive infinity, while the endpoint $a is $aEndType. The second arrow starts from $b and goes toward positive infinity, while the endpoint $b is $bEndType."; +} + + + +############################################## + + + +BEGIN_PGML + +Solve this compound inequality, and write your answer in _interval notation_. + +Please type: + +* *inf* for [`\infty`], +* [|DNE|]* for "no solution" +* *U* for the union symbol [`\cup`] + + [`` [$left0] [$symbol0Original] [$right0] \text{ or } [$left1] [$symbol1Original] [$right1] ``] + +[___________]{$ans} + +END_PGML + + + +############################################## + + + +BEGIN_PGML_SOLUTION + +We first need to solve both inequalities. + + [`` +\begin{aligned}[t] + -x &[$symbol0Original] [$c2] & [$d0]x+[$d1] &[$symbol1Original] [$d2] \\ + [$c0] \cdot x &[$symbol0Original] [$c2] & [$d0]x+[$d1]\mathbf{{}-[$d1]} &[$symbol1Original] [$d2] \mathbf{{}-[$d1]}\\ + \frac{[$c0] \cdot x}{[$c0]} &[$symbol0] \frac{[$c2-$c1]}{[$c0]} & [$d0] x &[$symbol1Original] [$d2-$d1] \\ + x &[$symbol0] [$a] & \frac{[$d0] x}{[$d0]} &[$symbol1] \frac{[$d2-$d1]}{[$d0]} \\ + & & x &[$symbol1] [$b] +\end{aligned} + ``] + +Notice that, in both inequalities, the direction of inequality symbol changed once we divided a negative number on both sides. + +Notice that the keyword *"or"* connects those two inequalities, so the solution is [` x [$symbol0] [$a] \textbf{ or } x [$symbol1] [$b] `]. Next, we need to find the combined solution. + +When there are two inequalities, it's helpful to graph them on a number line. + +>>[@ image( insertGraph($gr), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, extra_html_tags=>"alt = '$ALT' title = '$ALT' ") @]*<< + +Since the operation connecting both inequalities is "or", numbers in the solution set need to meet the conditions of either inequality. In other words, we are look for the union of both given sets. The blue segment on the number line represents the solutions. + +We need to pay special attention to the endpoints. Notice that, in the solution set, the right endpoint is [$numberLineEndType]. So the solution set in interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation50.pg new file mode 100644 index 0000000000..158abf304a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation50.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,2,1); +$b = random($a+1,4,1); +$leftType = random(0,1,1)==0 ? ')' : ']'; +$rightType = random(0,1,1)==0 ? '(' : '['; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$a $leftType U $rightType $b,inf)"); + +Context("Numeric"); + +$aspectRatio = 1/5; +$horPixel = 240; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 6; +$pixel = 2*$reach/240; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); + +#make the graphs +$gr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, + size=>[$horPixel,$verPixel]); +$gr->moveTo(0,0); +$gr->arrowTo($reach-2*$pixel,0,'black',1); +$gr->moveTo(0,0); +$gr->arrowTo(-$reach+2*$pixel,0,'black',1); + +@ticks = (); +for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); +$gr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); +$gr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); + +$shadingoffset = $verticalSpace/1.2; +$gr->lb( new Label($a,$shadingoffset,$leftType,'blue','center','middle','giant')); +$gr->moveTo($a,$shadingoffset); +$gr->arrowTo(-$reach+2*$pixel,$shadingoffset,'blue',1); + +$gr->lb( new Label($b,$shadingoffset,$rightType,'blue','center','middle','giant')); +$gr->moveTo($b,$shadingoffset); +$gr->arrowTo($reach-2*$pixel,$shadingoffset,'blue',1); + + +$alt = "This is graph of an interval on a number line. There is a $leftType at $a and everything to the left of $a is shaded; there is a $rightType at $b and everything to the right of $b is shaded."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it in interval notation. + +>> [@image( insertGraph($gr), width=>$screenXSize, tex_size=>$hardCopyPercent, + extra_html_tags=>"title='$alt' alt= '$alt' align='top'" ) @]* << + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], [|>=|]* for [`\geq`], capitalized U for the union symbol.!)@]** + + In interval notation: [_____________________]{$intans} + + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation60.pg new file mode 100644 index 0000000000..4a1eba1143 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToIntervalNotation60.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,2,1); +$b = random($a+1,4,1); +$leftType = random(0,1,1)==0 ? '(' : '['; +$rightType = random(0,1,1)==0 ? ')' : ']'; + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("$leftType $a,$b $rightType"); + +Context("Numeric"); + +$aspectRatio = 1/5; +$horPixel = 240; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 6; +$pixel = 2*$reach/240; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); + +#make the graphs +$gr = init_graph(-$reach,-$verticalSpace,$reach,2*$verticalSpace, + size=>[$horPixel,$verPixel]); +$gr->moveTo(0,0); +$gr->arrowTo($reach-2*$pixel,0,'black',1); +$gr->moveTo(0,0); +$gr->arrowTo(-$reach+2*$pixel,0,'black',1); + +@ticks = (); +for my $j ((-$reach+1)..($reach-1)) {push(@ticks,$j);}; +$gr->h_ticks(0,"black",@ticks); +$gr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top','large')); +$gr->lb( new Label(4,-$verticalSpace/5,4,'black','center','top','large')); +$gr->lb( new Label(-4,-$verticalSpace/5,-4,'black','center','top','large')); + +$shadingoffset = $verticalSpace/1.2; +$gr->lb( new Label($a,$shadingoffset,$leftType,'blue','center','middle','giant')); +$gr->moveTo($a,$shadingoffset); +$gr->lineTo($b,$shadingoffset,'blue',1); +$gr->lb( new Label($b,$shadingoffset,$rightType,'blue','center','middle','giant')); + +$alt = "This is graph of an interval on a number line. There is a $leftType at $a and a $rightType at $b. The segment in between is shaded."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it in interval notation. + +>> [@image( insertGraph($gr), width=>$screenXSize, tex_size=>$hardCopyPercent, + extra_html_tags=>"title='$alt' alt= '$alt' align='top'" ) @]* << + +[@KeyboardInstructions(q!Please type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], [|>=|]* for [`\geq`], capitalized U for the union symbol.!)@]** + + In interval notation: [_____________________]{$intans} + + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation10.pg new file mode 100644 index 0000000000..8c6f2d9514 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation10.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Give a graph of an inequality, write the set notation and interval notation. +# Answer is like (3, inf). +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,4,0.5); + +$symbol = '>'; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var $symbol $a}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($a,inf)"); +Context("Numeric"); + +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[openinfiniteinterval] coordinates {($a,0) (6,0)}; +\end{axis} +END_TIKZ + + +$alt = "Graph of an interval on a number line. There is a left parenthesis at $a and everything right of that is shaded. To the right of the axis, there is a letter $var."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it using set-builder notation and interval notation. + +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << + +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** + +[_]{$setans}{30} + +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** + +[_]{$intans}{30} + + +END_PGML + + + +############################################## + + +BEGIN_PGML_SOLUTION + +Since the given graph shades all the values greater than [`[$a]`] (but not equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. + +The corresponding set notation is [`[$setans]`]. + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation20.pg new file mode 100644 index 0000000000..eef96ac55e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation20.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Give a graph of an inequality, write the set notation and interval notation. +# Answer is like [3, inf). +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,4,0.5); + +$symbol = '\ge'; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var >= $a}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$a,inf)"); +Context("Numeric"); + +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[closedinfiniteinterval] coordinates {($a,0) (6,0)}; +\end{axis} +END_TIKZ + + +$alt = "Graph of an interval on a number line. There is a left bracket at $a and everything right of that is shaded. To the right of the axis, there is a letter $var."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it using set-builder notation and interval notation. + +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << + +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** + +[_]{$setans}{30} + +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** + +[_]{$intans}{30} + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +Since the given graph shades all the values greater than [`[$a]`] (and equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. + +The corresponding set notation is [`[$setans]`]. + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation30.pg new file mode 100644 index 0000000000..11039f4549 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation30.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Give a graph of an inequality, write the set notation and interval notation. +# Answer is like (-inf,3). +# +# Last edited by Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,4,0.5); + +$symbol = '<'; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var $symbol $a}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$a)"); +Context("Numeric"); + +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[infiniteopeninterval] coordinates {(-6,0) ($a,0)}; +\end{axis} +END_TIKZ + +$alt = "Graph of an interval on a number line. There is a right parenthesis at $a and everything left of that is shaded. To the right of the axis, there is a letter $var."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it using set-builder notation and interval notation. + +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << + +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** + +[_]{$setans}{30} + +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** + +[_]{$intans}{30} + + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +Since the given graph shades all the values less than [`[$a]`] (but not equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. + +The corresponding set notation is [`[$setans]`]. + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation40.pg new file mode 100644 index 0000000000..50758c6a8b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/GraphToSetAndIntervalNotation40.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Give a graph of an inequality, write the set notation and interval notation. +# Answer is like (-inf,3]. +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation','interval notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "contextInequalitySetBuilder.pl", + "PCCmacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(-4,4,0.5); + +$symbol = '\leq'; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +$var = list_random('a'..'d','f'..'k','m','n','p'..'r','t'..'z'); +do {Context()->variables->add($var => 'Real');} unless ($var eq 'x'); +$setans = Compute("{ $var | $var <= $a}"); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$a]"); +Context("Numeric"); + +$numberline = createTikZImage(); +$numberline->addToPreamble(latexImagePreamble()); +$numberline->BEGIN_TIKZ +\begin{axis} + [ + numberline, + xmin=-6, + xmax=6, + xtick={-5,0,...,5}, + minor xtick={-5,-4,...,5}, + xlabel = {\($var\)}, + ] + \addplot[infiniteclosedinterval] coordinates {(-6,0) ($a,0)}; +\end{axis} +END_TIKZ + +$alt = "Graph of an interval on a number line. There is a right bracket at $a and everything left of that is shaded. To the right of the axis, there is a letter $var."; + +############################################## + + +BEGIN_PGML +For the interval expressed in the number line, write it using set-builder notation and interval notation. + +>> [@image(insertGraph($numberline), width => 360, tex_size => 1000, alt => "$alt") @]* << + +[@KeyboardInstructions(q!Type [|INF|]* for [`\infty`], [|<=|]* for [`\leq`], and [|>=|]* for [`\geq`].!)@]** + +[@KeyboardInstructions(q!Enter the set in set-builder notation here.!)@]** + +[_]{$setans}{30} + +[@KeyboardInstructions(q!Enter the set in interval notation here.!)@]** + +[_]{$intans}{30} + +END_PGML + + + + +############################################## + +BEGIN_PGML_SOLUTION + +Since the given graph shades all the values less than [`[$a]`] (and equal to [`[$a]`]) the graph represents the inequality [`[$var] [$symbol] [$a]`]. + +The corresponding set notation is [`[$setans]`]. + +The corresponding interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot10.pg new file mode 100644 index 0000000000..db10e77b45 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot10.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Tell whether a number x is a solution of an inequality ax+b>c. +# a, b, c are positive or negative integers. +# +# Last updated: Jordan 8/28/13; Carl Yao, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear') +## DBCCSS('7.EE.4','A-REI.3','6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unionTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +$symbol = '>'; + +$a=random(2,5,1)*random(-1,1,2); +$cMinusB = random(1,5,1)*$a; +$c=random(-10,10,1); +$b=$c-$cMinusB; + +$critical = ($c-$b)/$a; + +$popupYes = PopUp( + ['?',"is","is not"], + 1, +); + +$popupNo = PopUp( + ['?',"is","is not"], + 2, +); + + + +do {$x1=random($critical-10,$critical-1,1);} until ($x1!=0); +if ($a*$x1+$b>$c) { +$popup1 = $popupYes; +} +else { +$popup1 = $popupNo; +} + +$x2=$critical; +$popup2 = $popupNo; + +$x3=0; +if ($a*$x3+$b>$c) { +$popup3 = $popupYes; +} +else { +$popup3 = $popupNo; +} + + +do {$x4=random($critical+1,$critical+10,1);} until ($x4!=0); +if ($a*$x4+$b>$c) { +$popup4 = $popupYes; +} +else { +$popup4 = $popupNo; +} + + +if ($popup1 == $popupYes) {$trueFalse1 = 'true'; $isIsNot1 = 'is';} + else {$trueFalse1 = 'not true'; $isIsNot1 = 'is not';}; +if ($popup2 == $popupYes) {$trueFalse2 = 'true'; $isIsNot2 = 'is';} + else {$trueFalse2 = 'not true'; $isIsNot2 = 'is not';}; +if ($popup3 == $popupYes) {$trueFalse3 = 'true'; $isIsNot3 = 'is';} + else {$trueFalse3 = 'not true'; $isIsNot3 = 'is not';} +if ($popup4 == $popupYes) {$trueFalse4 = 'true'; $isIsNot4 = 'is';} + else {$trueFalse4 = 'not true'; $isIsNot4 = 'is not';}; + +#randomize the answers +$ref_ans = [ + [ $x1, $popup1, $trueFalse1, $isIsNot1], + [ $x2, $popup2, $trueFalse2, $isIsNot2], + [ $x3, $popup3, $trueFalse3, $isIsNot3], + [ $x4, $popup4, $trueFalse4, $isIsNot4], +]; + +for ($i=0;$i<=2;$i++) { + $j=random(0,3,1); + do {$k=random(0,3,1);} until ($j!=$k); + $temp=$ref_ans->[$j]; + $ref_ans->[$j]=$ref_ans->[$k]; + $ref_ans->[$k]=$temp; +} + +($x0,$x1,$x2,$x3) = ($ref_ans->[0][0],$ref_ans->[1][0],$ref_ans->[2][0],$ref_ans->[3][0]); +($popup0,$popup1,$popup2,$popup3) = ($ref_ans->[0][1],$ref_ans->[1][1],$ref_ans->[2][1],$ref_ans->[3][1]); +($trueFalse0,$trueFalse1,$trueFalse2,$trueFalse3) = ($ref_ans->[0][2],$ref_ans->[1][2],$ref_ans->[2][2],$ref_ans->[3][2]); +($isIsNot0,$isIsNot1,$isIsNot2,$isIsNot3) = ($ref_ans->[0][3],$ref_ans->[1][3],$ref_ans->[2][3],$ref_ans->[3][3]); + + + +############################################## + +TEXT(beginproblem()); + + +BEGIN_PGML + +Decide whether each value is a solution to the given inequality. + +[`` [$a] x +[$b] [$symbol] [$c] ``] +a. [`x=[$x0]`] [__]{$popup0} a solution. + +b. [`x=[$x1]`] [__]{$popup1} a solution. + +c. [`x=[$x2]`] [__]{$popup2} a solution. + +d. [`x=[$x3]`] [__]{$popup3} a solution. + + + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +We substitute each [`x`] value into the inequality [` [$a] x + [$b] [$symbol] [$c]`] and see whether the inequality is true. + +a. [` \begin{aligned}[t] + [$a] ([$x0]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x0+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse0], [$x0] [$isIsNot0] a solution to the inequality. +---- +b. [` \begin{aligned}[t] + [$a] ([$x1]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x1+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse1], [$x1] [$isIsNot1] a solution to the inequality. +---- +c. [` \begin{aligned}[t] + [$a] ([$x2]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x2+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse2], [$x2] [$isIsNot2] a solution to the inequality. +---- +d. [` \begin{aligned}[t] + [$a] ([$x3]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x3+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse3], [$x3] [$isIsNot3] a solution to the inequality. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot20.pg new file mode 100644 index 0000000000..fae79dcba9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot20.pg @@ -0,0 +1,178 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Tell whether a number x is a solution of an inequality ax+b>=c. +# a, b, c are positive or negative integers. +# +# Last updated: Jordan 8/29/13; Carl Yao, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear') +## DBCCSS('7.EE.4','A-REI.3',,'6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unionTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +$symbol = '\ge'; + +$a=random(2,5,1)*random(-1,1,2); +$cMinusB = random(1,5,1)*$a; +$c=random(-10,10,1); +$b=$c-$cMinusB; + +$critical = ($c-$b)/$a; + +$popupYes = PopUp( + ['?',"is","is not"], + 1, +); + +$popupNo = PopUp( + ['?',"is","is not"], + 2, +); + + + +do {$x1=random($critical-10,$critical-1,1);} until ($x1!=0); +if ($a*$x1+$b>=$c) { +$popup1 = $popupYes; +} +else { +$popup1 = $popupNo; +} + +$x2=$critical; +if ($a*$x2+$b>=$c) { +$popup2 = $popupYes; +} +else { +$popup2 = $popupNo; +} + + +$x3=0; +if ($a*$x3+$b>=$c) { +$popup3 = $popupYes; +} +else { +$popup3 = $popupNo; +} + + +do {$x4=random($critical+1,$critical+10,1);} until ($x4!=0); +if ($a*$x4+$b>=$c) { +$popup4 = $popupYes; +} +else { +$popup4 = $popupNo; +} + + +if ($popup1 == $popupYes) {$trueFalse1 = 'true'; $isIsNot1 = 'is';} + else {$trueFalse1 = 'not true'; $isIsNot1 = 'is not';}; +if ($popup2 == $popupYes) {$trueFalse2 = 'true'; $isIsNot2 = 'is';} + else {$trueFalse2 = 'not true'; $isIsNot2 = 'is not';}; +if ($popup3 == $popupYes) {$trueFalse3 = 'true'; $isIsNot3 = 'is';} + else {$trueFalse3 = 'not true'; $isIsNot3 = 'is not';} +if ($popup4 == $popupYes) {$trueFalse4 = 'true'; $isIsNot4 = 'is';} + else {$trueFalse4 = 'not true'; $isIsNot4 = 'is not';}; + +#randomize the answers +$ref_ans = [ + [ $x1, $popup1, $trueFalse1, $isIsNot1], + [ $x2, $popup2, $trueFalse2, $isIsNot2], + [ $x3, $popup3, $trueFalse3, $isIsNot3], + [ $x4, $popup4, $trueFalse4, $isIsNot4], +]; + +for ($i=0;$i<=2;$i++) { + $j=random(0,3,1); + do {$k=random(0,3,1);} until ($j!=$k); + $temp=$ref_ans->[$j]; + $ref_ans->[$j]=$ref_ans->[$k]; + $ref_ans->[$k]=$temp; +} + +($x0,$x1,$x2,$x3) = ($ref_ans->[0][0],$ref_ans->[1][0],$ref_ans->[2][0],$ref_ans->[3][0]); +($popup0,$popup1,$popup2,$popup3) = ($ref_ans->[0][1],$ref_ans->[1][1],$ref_ans->[2][1],$ref_ans->[3][1]); +($trueFalse0,$trueFalse1,$trueFalse2,$trueFalse3) = ($ref_ans->[0][2],$ref_ans->[1][2],$ref_ans->[2][2],$ref_ans->[3][2]); +($isIsNot0,$isIsNot1,$isIsNot2,$isIsNot3) = ($ref_ans->[0][3],$ref_ans->[1][3],$ref_ans->[2][3],$ref_ans->[3][3]); + + +############################################## + +TEXT(beginproblem()); + + +BEGIN_PGML + +Decide whether each value is a solution to the given inequality. + +[`` [$a] x +[$b] [$symbol] [$c] ``] +a. [`x=[$x0]`] [__]{$popup0} a solution. + +b. [`x=[$x1]`] [__]{$popup1} a solution. + +c. [`x=[$x2]`] [__]{$popup2} a solution. + +d. [`x=[$x3]`] [__]{$popup3} a solution. + + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We substitute each [`x`] value into the inequality [` [$a] x + [$b] [$symbol] [$c]`] and see whether the inequality is true. + +a. [` \begin{aligned}[t] + [$a] ([$x0]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x0+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse0], [$x0] [$isIsNot0] a solution to the inequality. +---- +b. [` \begin{aligned}[t] + [$a] ([$x1]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x1+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse1], [$x1] [$isIsNot1] a solution to the inequality. +---- +c. [` \begin{aligned}[t] + [$a] ([$x2]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x2+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse2], [$x2] [$isIsNot2] a solution to the inequality. +---- +d. [` \begin{aligned}[t] + [$a] ([$x3]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x3+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse3], [$x3] [$isIsNot3] a solution to the inequality. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot30.pg new file mode 100644 index 0000000000..78d6413919 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalitySolutionOrNot30.pg @@ -0,0 +1,180 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Tell whether a number x is a solution of an inequality c<=b+ax. +# a, b, c are positive or negative integers. +# +# Last updated: Jordan 8/29/13; Carl Yao, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear') +## DBCCSS('7.EE.4','A-REI.3',,'6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unionTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +$symbol = '\le'; + +$a=random(2,5,1)*random(-1,1,2); +$cMinusB = random(1,5,1)*$a; +$c=random(-10,10,1); +$b=$c-$cMinusB; + +$critical = ($c-$b)/$a; + + +$popupYes = PopUp( + ['?',"is","is not"], + 1, +); + +$popupNo = PopUp( + ['?',"is","is not"], + 2, +); + + +do {$x1=random($critical-10,$critical-1,1);} until ($x1!=0); +if ($a*$x1+$b<=$c) { +$popup1 = $popupYes; +} +else { +$popup1 = $popupNo; +} + +$x2=$critical; +if ($a*$x2+$b<=$c) { +$popup2 = $popupYes; +} +else { +$popup2 = $popupNo; +} + + +$x3=0; +if ($a*$x3+$b<=$c) { +$popup3 = $popupYes; +} +else { +$popup3 = $popupNo; +} + + +do {$x4=random($critical+1,$critical+10,1);} until ($x4!=0); +if ($a*$x4+$b<=$c) { +$popup4 = $popupYes; +} +else { +$popup4 = $popupNo; +} + + +if ($popup1 == $popupYes) {$trueFalse1 = 'true'; $isIsNot1 = 'is';} + else {$trueFalse1 = 'not true'; $isIsNot1 = 'is not';}; +if ($popup2 == $popupYes) {$trueFalse2 = 'true'; $isIsNot2 = 'is';} + else {$trueFalse2 = 'not true'; $isIsNot2 = 'is not';}; +if ($popup3 == $popupYes) {$trueFalse3 = 'true'; $isIsNot3 = 'is';} + else {$trueFalse3 = 'not true'; $isIsNot3 = 'is not';} +if ($popup4 == $popupYes) {$trueFalse4 = 'true'; $isIsNot4 = 'is';} + else {$trueFalse4 = 'not true'; $isIsNot4 = 'is not';}; + +#randomize the answers +$ref_ans = [ + [ $x1, $popup1, $trueFalse1, $isIsNot1], + [ $x2, $popup2, $trueFalse2, $isIsNot2], + [ $x3, $popup3, $trueFalse3, $isIsNot3], + [ $x4, $popup4, $trueFalse4, $isIsNot4], +]; + +for ($i=0;$i<=2;$i++) { + $j=random(0,3,1); + do {$k=random(0,3,1);} until ($j!=$k); + $temp=$ref_ans->[$j]; + $ref_ans->[$j]=$ref_ans->[$k]; + $ref_ans->[$k]=$temp; +} + +($x0,$x1,$x2,$x3) = ($ref_ans->[0][0],$ref_ans->[1][0],$ref_ans->[2][0],$ref_ans->[3][0]); +($popup0,$popup1,$popup2,$popup3) = ($ref_ans->[0][1],$ref_ans->[1][1],$ref_ans->[2][1],$ref_ans->[3][1]); +($trueFalse0,$trueFalse1,$trueFalse2,$trueFalse3) = ($ref_ans->[0][2],$ref_ans->[1][2],$ref_ans->[2][2],$ref_ans->[3][2]); +($isIsNot0,$isIsNot1,$isIsNot2,$isIsNot3) = ($ref_ans->[0][3],$ref_ans->[1][3],$ref_ans->[2][3],$ref_ans->[3][3]); + + +############################################## + +TEXT(beginproblem()); + + +BEGIN_PGML + +Decide whether each value is a solution to the given inequality. + +[`` [$a] x +[$b] [$symbol] [$c] ``] +a. [`x=[$x0]`] [__]{$popup0} a solution. + +b. [`x=[$x1]`] [__]{$popup1} a solution. + +c. [`x=[$x2]`] [__]{$popup2} a solution. + +d. [`x=[$x3]`] [__]{$popup3} a solution. + + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +We substitute each [`x`] value into the inequality [` [$a] x + [$b] [$symbol] [$c]`] and see whether the inequality is true. + +a. [` \begin{aligned}[t] + [$a] ([$x0]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x0+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse0], [$x0] [$isIsNot0] a solution to the inequality. +---- +b. [` \begin{aligned}[t] + [$a] ([$x1]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x1+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse1], [$x1] [$isIsNot1] a solution to the inequality. +---- +c. [` \begin{aligned}[t] + [$a] ([$x2]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x2+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse2], [$x2] [$isIsNot2] a solution to the inequality. +---- +d. [` \begin{aligned}[t] + [$a] ([$x3]) + [$b] &\stackrel{?}{[$symbol]} [$c]\\ + [$a*$x3+$b] &\stackrel{?}{[$symbol]} [$c]\end{aligned}`] + Since this inequality is [$trueFalse3], [$x3] [$isIsNot3] a solution to the inequality. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem10.pg new file mode 100644 index 0000000000..c632237ceb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem10.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear inequality to solve word problems. +# +# Last updated: Jordan 7/27/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','interval notation','subtract','divide') +## DBCCSS('7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserMultiAnswer.pl", + "parserNumberWithUnits.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +package MultiAnswer; +our $separator = ' '; +package main; + +$a=random(20,40,5); +$b=random(2.5,3.5,0.1); +$m=random(30,70,10); +$m=Compute($m); +$mmi = NumberWithUnits($m, 'mi'); +$c=$a+$b*$m; + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); +$ac = Currency("$a"); +$bc = Currency("$b"); +$cc = Currency("$c"); + + +Context("Interval"); +$interval = Interval("[0,$m]"); + +$left = Formula("$a+$b x"); +$right = Formula("$c"); +Context()->strings->add("<"=>{}, ">"=>{}, "="=>{}, "<="=>{}, ">="=>{}, "!="=>{}); + +$comparitor = String("<="); +$opposite = String(">="); + + +$multians = MultiAnswer($left, $comparitor, $right)->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $stuLeft, $stuComp, $stuRight ) = @{$student}; + my ( $corLeft, $corComp, $corRight ) = @{$correct}; + if ( ($corLeft == $stuLeft && $corComp == $stuComp && $corRight == $stuRight) || + ($corLeft == $stuRight && $opposite == $stuComp && $corRight == $stuLeft) ) { + return 1; + } + } +); + +$newUnits = [ + {name=>'miles',conversion=>{factor=>5280*12*2.54/100,m=>1}}, + {name=>'mile',conversion=>{factor=>5280*12*2.54/100,m=>1}}, + {name=>'mi',conversion=>{factor=>5280*12*2.54/100,m=>1}}, +]; +$miles = NumberWithUnits("$m miles",{newUnit=>$newUnits}); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +You are riding in a taxi and can only pay with cash. You have to pay a flat fee of [`[$ac]`], and then pay [`[$bc]`] per mile. You have a total of [`[$cc]`] in your pocket. Let [`x`] be the number of miles the taxi will drive you. You want to know how many miles you can afford. + +a. Write an inequality to represent this situation in terms of how many miles you can afford. + [@KeyboardInstructions(q?Your inequality has three parts, a left side, a right side, and a comparison operator in the middle: [`<`], [`>`], [`\leq`], [`\geq`], [`=`], or [`\neq`]. Enter these as [|<|], [|>|]*, [|<=|]*, [|>=|]*, [|=|]*, and [|!=|]*.?)@]** + [__]{$multians}{width=>10} [__]{$multians}{width=>2} [__]{$multians}{width=>10} + +a. Solve this inequality. At most how many miles can you afford? + [___]{$miles} + +a. Use interval notation to express the number of miles you can afford. + [________]{$interval} + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; + + + +$s1=$c-$a; + +BEGIN_PGML_SOLUTION + +Let [`x`] be the number of miles the taxi will drive. + + [` +\begin{aligned} + [$b]x+[$a] & \leq [$c] \\ + [$b]x+[$a]\mathbf{{}-[$a]} & \leq [$c]\mathbf{{}-[$a]} \\ + [$b]x & \leq [$s1] \\ + \frac{[$b]x}{[$b]} & \leq \frac{[$s1]}{[$b]} \\ + x & \leq [$m] +\end{aligned} +`] + +You can afford at most [`[$m]`] miles. + +The interval that represents the number of miles that you can afford is [`[$interval]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem20.pg new file mode 100644 index 0000000000..a93193f02f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/InequalityWordProblem20.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Write an one-variable linear inequality to solve word problems. +# +# Last updated: Jordan 8/29/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','multiply','subtract') +## DBCCSS('7.EE.4','A-CED.1','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserMultiAnswer.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +package MultiAnswer; +our $separator = ' '; +package main; + +Context("Numeric"); + +$a=random(70,75,1); +$b=random(85,90,1); +$m=random(76,84,1); +$ans2=Compute($m*3-$a-$b); +while ($ans2==($a+$b)/2) { + $m=random(76,84,1); + $ans2=Compute($m*3-$a-$b); +} + +Context("Interval"); +$interval = Interval("[$ans2,100]"); + +$left = Formula("($a+$b+x)/3"); +$right = Formula("$m"); + +Context()->strings->add("<"=>{}, ">"=>{}, "="=>{}, "<="=>{}, ">="=>{}, "!="=>{}); + +$comparitor = String(">="); +$opposite = String("<="); + + +$multians = MultiAnswer($left, $comparitor, $right)->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $stuLeft, $stuComp, $stuRight ) = @{$student}; + my ( $corLeft, $corComp, $corRight ) = @{$correct}; + if ( ($corLeft == $stuLeft && $corComp == $stuComp && $corRight == $stuRight) || + ($corLeft == $stuRight && $opposite == $stuComp && $corRight == $stuLeft) ) { + return 1; + } + } +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[%Not using percentages to avoid confusion%] +Your grade in a class is determined by the average of three test scores. You scored [`[$a]`] and [`[$b]`] on the first two tests. To earn at least [`[$m]`] for this course, how much do you have to score on the third test? Let [`x`] be the score you will earn on the third test. + +a. Write an inequality to represent this situation. + [@KeyboardInstructions(q?Your inequality has three parts, a left side, a right side, and a comparison operator in the middle: [`<`], [`>`], [`\leq`], [`\geq`], [`=`], or [`\neq`]. Enter these as [|<|]*, [|>|]*, [|<=|]*, [|>=|]*, [|=|]*, and [|!=|]*.?)@]** + [__]{$multians}{width=>10} [__]{$multians}{width=>2} [__]{$multians}{width=>10} + +a. Solve this inequality. What is the minimum that you have to earn on the third test in order to earn a [`[$m]`] for the course? + [___________]{$ans2} + +a. You cannot score over [`100`] on the third test. Use interval notation to represent the range of scores you can earn on the third test in order to earn at least [`[$m]`] for this course. + [______________]{$interval} + + + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; + + +$s1=3*$m; +$s2=$a+$b; + +BEGIN_PGML_SOLUTION + +Let [`x`] be the score you will earn on the third test. + + [` +\begin{aligned} + \frac{[$a]+[$b]+x}{3} & \geq [$m] \\ + 3 \cdot \frac{[$a]+[$b]+x}{3} & \geq 3 \cdot [$m] \\ + [$a]+[$b]+x & \geq [$s1] \\ + [$s2] +x & \geq [$s1] \\ + [$s2] +x \mathbf{{}-[$s2]}& \geq [$s1]\mathbf{{}-[$s2]} \\ + x & \geq [$ans2] +\end{aligned} +`] + +You have to score at least [`[$ans2]`] on the third test in order to earn [`[$m]`] in this course. + +To earn at least [`[$m]`] in this course, the interval for your score on the third test is [`[$interval]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation10.pg new file mode 100644 index 0000000000..1bde95f4fd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation10.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#]. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\leq'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("(-inf,$right]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation100.pg new file mode 100644 index 0000000000..e3abfcca71 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation100.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#]. The number is a fraction. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFraction"); +Context()->flags->set(allowMixedNumbers=>0); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} + +$left = Compute("x"); +$comp = '\leq'; +$right = Fraction(-$num,$den); + +Context("Interval"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +($num, $den) = abs($right)->value; +$ans_latex_string = "\left(-\infty,{-\frac{$num}{$den}}\right]"; +$ans_string = "(-inf, $right]"; +$ans = Compute("(-inf, $right]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \left\{ x \mid {[$left]} [$comp] [$right] \right\} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans->cmp(correct_ans=>$ans_string, correct_ans_latex_string=>$ans_latex_string)} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [`[$right]`]. Shading these on a number line may help you to see that the interval notation is [`[$ans_latex_string]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation110.pg new file mode 100644 index 0000000000..61c0e905c4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation110.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,0]. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\leq'; +$right = 0; + +Context("Interval"); +$ans = Compute("(-inf,$right]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid [$left] [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [`[$right]`]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation120.pg new file mode 100644 index 0000000000..2d83ad3f12 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation120.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (0,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = 0; +$comp = '\lt'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("($left,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid [$left] [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [`[$left]`] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation20.pg new file mode 100644 index 0000000000..9923a4b0cd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation20.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like [#,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\geq'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("[$right,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation30.pg new file mode 100644 index 0000000000..e0c31af91e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation30.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\lt'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("(-inf,$right)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid{[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation40.pg new file mode 100644 index 0000000000..9562bff81e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation40.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (#,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = Compute("x"); +$comp = '\gt'; +$right = non_zero_random(-10,10,1); + +Context("Interval"); +$ans = Compute("($right,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers that are [$solnString] [$right]. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation50.pg new file mode 100644 index 0000000000..7ca6c1e27f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation50.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = non_zero_random(-10,10,1); +$comp = '\gt'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("(-inf,$left)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [$left] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation60.pg new file mode 100644 index 0000000000..fafdf08896 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation60.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (-inf,#]. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = non_zero_random(-10,10,1); +$comp = '\geq'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("(-inf,$left]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [$left] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation70.pg new file mode 100644 index 0000000000..d1fdde4326 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation70.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like [#,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = non_zero_random(-10,10,1); +$comp = '\leq'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("[$left,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x\mid{[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [$left] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation80.pg new file mode 100644 index 0000000000..25b7e0f947 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation80.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (#,inf). +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$left = non_zero_random(-10,10,1); +$comp = '\lt'; +$right = Compute("x"); + +Context("Interval"); +$ans = Compute("($left,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \{ x \mid {[$left]} [$comp] [$right] \} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans} + +END_PGML + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [$left] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation90.pg new file mode 100644 index 0000000000..f15d50a801 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/IntervalNotation90.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Convert an inequality from set notation to interval notation. +# Answer looks like (#,inf). The number is a fraction. +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->flags->set(allowMixedNumbers=>0); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} + +$left = Fraction($num,$den); +$comp = '\lt'; +$right = Compute("x"); + +Context("Interval"); +($num, $den) = $left->value; +$ans_latex_string = "\left(\frac{$num}{$den},\infty\right)"; +$ans_string = "($left, inf)"; +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("($left,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A set is written using set-builder notation. Write it using interval notation. + + [`` \left\{ x \mid {[$left]} [$comp] [$right] \right\} ``] + +[@KeyboardInstructions(q!Please use [|INF|]* to represent [`\infty`].!)@]** + + [_____________]{$ans->cmp(correct_ans=>$ans_string, correct_ans_latex_string=>$ans_latex_string)} + +END_PGML + + + + +############################################## + + +$solnString = ''; +if ($comp eq '\leq') + {$solnString = 'less than or equal to'} +elsif ($comp eq '\geq') + {$solnString = 'greater than or equal to'} +elsif ($comp eq '\lt') + {$solnString = 'strictly less than'} +elsif ($comp eq '\gt') + {$solnString = 'strictly greater than'}; + + +BEGIN_PGML_SOLUTION + +We are working will all numbers such that [`[$left]`] is [$solnString] those numbers. Shading these on a number line may help you to see that the interval notation is [`[$ans_latex_string]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph10.pg new file mode 100644 index 0000000000..9cf187b10d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph10.pg @@ -0,0 +1,189 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change set notation to graph: x>3 +# +# Last edited by Jordan 8/29/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(-4,4,1); + +$symbol = $GTS; #Don't use < or > directly. + +%answer = (leftType => 'open', + rightType => 'inf', #use 'inf' regardles of +/- inf + ); + + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 5; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); +@alts=(); + +#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. +@indices=(); + + +#make the graphs +for $leftType ('open','closed', 'inf') +{ + for $rightType ('open','closed', 'inf') + { + my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] + ); + @ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + + $tempgr->h_ticks(0,"black",@ticks); + $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); + + if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) + { + $altText = ""; + $altText = "This is the graph of a number line. "; + $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); + if ($leftType eq 'open' or $rightType eq 'open') + { + $altText = $altText."It has a hollow circle at $a, "; + $tempgr->stamps( open_circle($a,0,'blue') ) + } + else + { + $altText = $altText."It has a filled circle at $a, "; + $tempgr->stamps( closed_circle($a,0,'blue') ) + }; + $tempgr->moveTo($a,0); + if ($leftType eq 'inf') { + $altText = $altText."and the number line is shaded everywhere left from $a."; + $tempgr->arrowTo(-0.99*$reach,0,'blue',3); + } else { + $altText = $altText."and the number line is shaded everywhere right from $a."; + $tempgr->arrowTo(0.99*$reach,0,'blue',3); + } + push(@gr,$tempgr);push(@alts,$altText); + if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) + {push(@indices, $#gr);} + else {unshift(@indices, $#gr);} + } + +}}; + +#A permutation function +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + my %map = (); + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #$zero is the preimage of 0. + + +@ar_choice = ("A","B","C","D"); + +$pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); + + +############################################## + +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing the solutions to \(x $symbol $a\). +$PAR + +A. \{ image( insertGraph($gr[ $indices[$shuffle->{0}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{0}] ]" alt="$alts[ $indices[$shuffle->{0}] ]" align="top" ' ) \} +$PAR + +B. \{ image( insertGraph($gr[ $indices[$shuffle->{1}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{1}] ]" alt="$alts[ $indices[$shuffle->{1}] ]" align="top" ' ) \} +$PAR +C. \{ image( insertGraph($gr[ $indices[$shuffle->{2}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{2}] ]" alt="$alts[ $indices[$shuffle->{2}] ]" align="top" ' ) \} +$PAR +D. \{ image( insertGraph($gr[ $indices[$shuffle->{3}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{3}] ]" alt="$alts[ $indices[$shuffle->{3}] ]" align="top" ' ) \} + +$PAR + +$SPACE $SPACE $SPACE \{ $pop->menu() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $pop->cmp() ); + +BEGIN_PGML_SOLUTION + +The inequality is [`x [$symbol] [$a]`]. + +Since [`x`] needs to be greater than [`[$a]`], we should shade all numbers to the _right_ of [`[$a]`], moving toward [` +\infty `]. + +Since the inequality symbol is [`[$symbol]`], we should use an open ending at [`[$a]`]. + +The correct answer is [@ $pop->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph20.pg new file mode 100644 index 0000000000..381ea62bf4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph20.pg @@ -0,0 +1,190 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change set notation to graph: x<3 +# +# Last edited by Jordan 8/28/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(-4,4,1); + +$symbol = $LTS; #Don't use < or > directly. + +%answer = (leftType => 'inf', + rightType => 'open', #use 'inf' regardles of +/- inf + ); + + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 5; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); +@alts=(); + +#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. +@indices=(); + + +#make the graphs +for $leftType ('open','closed', 'inf') +{ + for $rightType ('open','closed', 'inf') + { + my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] + ); + @ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + + $tempgr->h_ticks(0,"black",@ticks); + $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); + + if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) + { + $altText = ""; + $altText = "This is the graph of a number line. "; + $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); + if ($leftType eq 'open' or $rightType eq 'open') + { + $altText = $altText."It has a hollow circle at $a, "; + $tempgr->stamps( open_circle($a,0,'blue') ) + } + else + { + $altText = $altText."It has a filled circle at $a, "; + $tempgr->stamps( closed_circle($a,0,'blue') ) + }; + $tempgr->moveTo($a,0); + if ($leftType eq 'inf') { + $altText = $altText."and the number line is shaded everywhere left from $a."; + $tempgr->arrowTo(-0.99*$reach,0,'blue',3); + } else { + $altText = $altText."and the number line is shaded everywhere right from $a."; + $tempgr->arrowTo(0.99*$reach,0,'blue',3); + } + push(@gr,$tempgr);push(@alts,$altText); + if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) + {push(@indices, $#gr);} + else {unshift(@indices, $#gr);} + } + +}}; + +#A permutation function +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + my %map = (); + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #$zero is the preimage of 0. + + +@ar_choice = ("A","B","C","D"); + +$pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); + + +############################################## + +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing the solutions to \(x $symbol $a\). +$PAR + +A. \{ image( insertGraph($gr[ $indices[$shuffle->{0}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{0}] ]" alt="$alts[ $indices[$shuffle->{0}] ]" align="top" ' ) \} +$PAR + +B. \{ image( insertGraph($gr[ $indices[$shuffle->{1}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{1}] ]" alt="$alts[ $indices[$shuffle->{1}] ]" align="top" ' ) \} +$PAR +C. \{ image( insertGraph($gr[ $indices[$shuffle->{2}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{2}] ]" alt="$alts[ $indices[$shuffle->{2}] ]" align="top" ' ) \} +$PAR +D. \{ image( insertGraph($gr[ $indices[$shuffle->{3}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{3}] ]" alt="$alts[ $indices[$shuffle->{3}] ]" align="top" ' ) \} + + +$PAR + +$SPACE $SPACE $SPACE \{ $pop->menu() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $pop->cmp() ); + +BEGIN_PGML_SOLUTION + +The inequality is [`x [$symbol] [$a]`]. + +Since [`x`] needs to be smaller than [`[$a]`], we should shade all numbers to the _left_ of [`[$a]`], moving toward [` -\infty `]. + +Since the inequality symbol is [`[$symbol]`], we should use an open ending at [`[$a]`]. + +The correct answer is [@ $pop->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph30.pg new file mode 100644 index 0000000000..b90149dd07 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph30.pg @@ -0,0 +1,190 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change set notation to graph: x>=3 +# +# Last edited by Jordan 8/29/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(-4,4,1); + +$symbol = '\ge'; + +%answer = (leftType => 'closed', + rightType => 'inf', #use 'inf' regardles of +/- inf + ); + + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 5; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); +@alts=(); + +#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. +@indices=(); + + +#make the graphs +for $leftType ('open','closed', 'inf') +{ + for $rightType ('open','closed', 'inf') + { + my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] + ); + @ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + + $tempgr->h_ticks(0,"black",@ticks); + $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); + + if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) + { + $altText = ""; + $altText = "This is the graph of a number line. "; + $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); + if ($leftType eq 'open' or $rightType eq 'open') + { + $altText = $altText."It has a hollow circle at $a, "; + $tempgr->stamps( open_circle($a,0,'blue') ) + } + else + { + $altText = $altText."It has a filled circle at $a, "; + $tempgr->stamps( closed_circle($a,0,'blue') ) + }; + $tempgr->moveTo($a,0); + if ($leftType eq 'inf') { + $altText = $altText."and the number line is shaded everywhere left from $a."; + $tempgr->arrowTo(-0.99*$reach,0,'blue',3); + } else { + $altText = $altText."and the number line is shaded everywhere right from $a."; + $tempgr->arrowTo(0.99*$reach,0,'blue',3); + } + push(@gr,$tempgr);push(@alts,$altText); + if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) + {push(@indices, $#gr);} + else {unshift(@indices, $#gr);} + } + +}}; + +#A permutation function +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + my %map = (); + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #$zero is the preimage of 0. + + +@ar_choice = ("A","B","C","D"); + +$pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); + + +############################################## + +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing the solutions to \(x $symbol $a\). +$PAR + +A. \{ image( insertGraph($gr[ $indices[$shuffle->{0}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{0}] ]" alt="$alts[ $indices[$shuffle->{0}] ]" align="top" ' ) \} +$PAR + +B. \{ image( insertGraph($gr[ $indices[$shuffle->{1}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{1}] ]" alt="$alts[ $indices[$shuffle->{1}] ]" align="top" ' ) \} +$PAR +C. \{ image( insertGraph($gr[ $indices[$shuffle->{2}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{2}] ]" alt="$alts[ $indices[$shuffle->{2}] ]" align="top" ' ) \} +$PAR +D. \{ image( insertGraph($gr[ $indices[$shuffle->{3}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{3}] ]" alt="$alts[ $indices[$shuffle->{3}] ]" align="top" ' ) \} + + +$PAR + +$SPACE $SPACE $SPACE \{ $pop->menu() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $pop->cmp() ); + +BEGIN_PGML_SOLUTION + +The inequality is [`x [$symbol] [$a]`]. + +Since [`x`] needs to be greater than [`[$a]`], we should shade all numbers to the _right_ of [`[$a]`], moving toward [` +\infty `]. + +Since the inequality symbol is [`[$symbol]`], we should use a closed ending at [`[$a]`]. + +The correct answer is [@ $pop->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph40.pg new file mode 100644 index 0000000000..f195f5ee0a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SetNotationToGraph40.pg @@ -0,0 +1,189 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change set notation to graph: x<=3 +# +# Last edited by Jordan 8/29/13; Carl Yao on 7/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('linear','inequality', 'number line','set notation') +## DBCCSS('7.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a = random(-4,4,1); + +$symbol = '\le'; + +%answer = (leftType => 'inf', + rightType => 'closed', #use 'inf' regardles of +/- inf + ); + + +$aspectRatio = 1/8; +$horPixel = 400; +$verPixel = $horPixel*$aspectRatio; +$screenXSize = $horPixel; +$screenYSize = $screenXSize*$aspectRatio; +$reach = 5; +$verticalSpace = $reach*$aspectRatio; +$hardCopyPercent = 1000; #meaning 100% + + +#initializing... +@gr=(); +@alts=(); + +#indices will be 0..$#gr in some order, with the index of the correct graph in the 0th position. +@indices=(); + + +#make the graphs +for $leftType ('open','closed', 'inf') +{ + for $rightType ('open','closed', 'inf') + { + my $tempgr = init_graph(-$reach,-$verticalSpace,$reach,$verticalSpace, + axes=>[$reach+1,0], + size=>[$horPixel,$verPixel] + ); + @ticks = (); + for my $j ((-$reach)..($reach)) {push(@ticks,$j);}; + + $tempgr->h_ticks(0,"black",@ticks); + $tempgr->lb( new Label(0,-$verticalSpace/5,0,'black','center','top')); + + if (($leftType eq 'inf' or $rightType eq 'inf') and !(($leftType eq 'inf' and $rightType eq 'inf'))) + { + $altText = ""; + $altText = "This is the graph of a number line. "; + $tempgr->lb( new Label($a,-$verticalSpace/5,$a,'blue','center','top')); + if ($leftType eq 'open' or $rightType eq 'open') + { + $altText = $altText."It has a hollow circle at $a, "; + $tempgr->stamps( open_circle($a,0,'blue') ) + } + else + { + $altText = $altText."It has a filled circle at $a, "; + $tempgr->stamps( closed_circle($a,0,'blue') ) + }; + $tempgr->moveTo($a,0); + if ($leftType eq 'inf') { + $altText = $altText."and the number line is shaded everywhere left from $a."; + $tempgr->arrowTo(-0.99*$reach,0,'blue',3); + } else { + $altText = $altText."and the number line is shaded everywhere right from $a."; + $tempgr->arrowTo(0.99*$reach,0,'blue',3); + } + push(@gr,$tempgr);push(@alts,$altText); + if ($answer{leftType} ne $leftType or $answer{rightType} ne $rightType) + {push(@indices, $#gr);} + else {unshift(@indices, $#gr);} + } + +}}; + +#A permutation function +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + my %map = (); + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #$zero is the preimage of 0. + + +@ar_choice = ("A","B","C","D"); + +$pop = PopUp( [qw(? A B C D)], $ar_choice[$zero] ); + + +############################################## + +TEXT(beginproblem()); +Context()->texStrings; + +BEGIN_TEXT + +$PAR +Choose the graph showing the solutions to \(x $symbol $a\). +$PAR + +A. \{ image( insertGraph($gr[ $indices[$shuffle->{0}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{0}] ]" alt="$alts[ $indices[$shuffle->{0}] ]" align="top" ' ) \} +$PAR + +B. \{ image( insertGraph($gr[ $indices[$shuffle->{1}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{1}] ]" alt="$alts[ $indices[$shuffle->{1}] ]" align="top" ' ) \} +$PAR +C. \{ image( insertGraph($gr[ $indices[$shuffle->{2}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{2}] ]" alt="$alts[ $indices[$shuffle->{2}] ]" align="top" ' ) \} +$PAR +D. \{ image( insertGraph($gr[ $indices[$shuffle->{3}] ]), width=>$screenXSize, height=>$screenYSize, tex_size=>$hardCopyPercent, + extra_html_tags=>'title="$alts[ $indices[$shuffle->{3}] ]" alt="$alts[ $indices[$shuffle->{3}] ]" align="top" ' ) \} + +$PAR + +$SPACE $SPACE $SPACE \{ $pop->menu() \} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $pop->cmp() ); + +BEGIN_PGML_SOLUTION + +The inequality is [`x [$symbol] [$a]`]. + +Since [`x`] needs to be smaller than [`[$a]`], we should shade all numbers to the _left_ of [`[$a]`], moving toward [` -\infty `]. + +Since the inequality symbol is [`[$symbol]`], we should use a closed ending at [`[$a]`]. + +The correct answer is [@ $pop->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality10.pg new file mode 100644 index 0000000000..93ade51ed4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality10.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like x+a>b. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextArbitraryString.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(6,10,1); +$left = Compute("x+$a"); +$comp = '>'; +$right = Compute("$b"); + +$c = $b-$a; +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +$setans = Compute("{ x | x > $c}"); +$alt = Compute("{ x | $c < x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($c,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + x+[$a] &> [$b]\\ + x+[$a]\mathbf{{}-[$a]} &> [$b]\mathbf{{}-[$a]} \\ + x &> [$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality100.pg new file mode 100644 index 0000000000..f1ed0b0146 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality100.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -x <= a +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','multiply','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,10,1); +$left = Compute("-x"); +$comp = "\leq"; +$right = Compute("$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= -$b}"); +$alt = Compute("{ x | -$b <= x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[-$b,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -x & \leq [$b] \\ + -1(-x) & \geq -1([$b]) \\ + x & \geq -[$b] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality110.pg new file mode 100644 index 0000000000..cec29914bc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality110.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like (a/b)x > c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} +$frac = Fraction($num,$den); + +$a=$num*list_random((1,2,3,4)); +$left = Compute("$frac*x"); +$comp = ">"; +$right = Compute("$a"); +$b=$a/$num*$den; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > $b}"); +$alt = Compute("{ x | $b < x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($b,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +$s1=$den*$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{[$num]}{[$den]}x &> [$a] \\ + [$den] \cdot \frac{[$num]}{[$den]}x &> [$den] \cdot [$a] \\ + [$num]x &> [$s1] \\ + \frac{[$num]x}{[$num]} &> \frac{[$s1]}{[$num]} \\ + x &> [$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality120.pg new file mode 100644 index 0000000000..87432e1aee --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality120.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -(a/b)x <= c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} +$frac = Fraction($num,$den); + +$a=$num*list_random((1,2,3,4)); +$left = Compute("-$frac*x"); +$comp = "\leq"; +$right = Compute("$a"); +$b=$a/$num*$den; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= -$b}"); +$alt = Compute("{ x | -$b <= x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[-$b,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +$s1=$den*$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -\frac{[$num]}{[$den]}x & \leq [$a] \\ + [$den] \cdot -\frac{[$num]}{[$den]}x & \leq [$den] \cdot [$a] \\ + -[$num]x & \leq [$s1] \\ + (-1) \cdot -[$num]x & \geq (-1) \cdot [$s1] \\ + [$num]x & \geq -[$s1] \\ + \frac{[$num]x}{[$num]} & \geq \frac{-[$s1]}{[$num]} \\ + x & \geq -[$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality130.pg new file mode 100644 index 0000000000..e20270e7b2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality130.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -a < (b/c) x +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} +$frac = Fraction($num,$den); + +$a=$num*list_random((1,2,3,4)); +$left = Compute("-$a"); +$comp = "<"; +$right = Compute("$frac*x"); +$b=$a/$num*$den; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > -$b}"); +$alt = Compute("{ x | -$b < x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-$b,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +$s1=$den*$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a] & < \frac{[$num]}{[$den]}x \\ + [$den] \cdot (-[$a]) & < [$den] \cdot \frac{[$num]}{[$den]}x \\ + -[$s1] & < [$num]x \\ + \frac{-[$s1]}{[$num]} & < \frac{[$num]x}{[$num]} \\ + -[$b] & < x \\ + x & > -[$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality140.pg new file mode 100644 index 0000000000..d183dcc4b9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality140.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -a < -(a/b) x +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($num,$den)!=1) {$den=random(2,10,1);} +$frac = Fraction($num,$den); + +$a=$num*list_random((1,2,3,4)); +$left = Compute("-$a"); +$comp = "<"; +$right = Compute("-$frac*x"); +$b=$a/$num*$den; + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x < $b}"); +$alt = Compute("{ x | $b > x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$b)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +$s1=$den*$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a] & < -\frac{[$num]}{[$den]}x \\ + [$den] \cdot (-[$a]) & < [$den] \cdot (-\frac{[$num]}{[$den]}x) \\ + -[$s1] & < -[$num]x \\ + (-1) \cdot (-[$s1]) & > (-1) \cdot (-[$num]x) \\ + [$s1] & > [$num]x \\ + \frac{[$s1]}{[$num]} & > \frac{[$num]x}{[$num]} \\ + [$b] & > x \\ + x & < [$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality150.pg new file mode 100644 index 0000000000..01acdc13e5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality150.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax > -b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("$a*x"); +$comp = ">"; +$right = Compute("-$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > -$c}"); +$alt = Compute("{ x | -$c < x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-$c,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a]x & > -[$b] \\ + \frac{[$a]x}{[$a]} & > \frac{-[$b]}{[$a]} \\ + x & > -[$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality160.pg new file mode 100644 index 0000000000..1e797f0cf0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality160.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -a < -bx +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("-$b"); +$comp = "<"; +$right = Compute("-$a*x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x < $c}"); +$alt = Compute("{ x | $c > x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$b] & < -[$a]x \\ + \frac{-[$b]}{-[$a]} & > \frac{-[$a]x}{-[$a]} \\ + [$c] & > x \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality170.pg new file mode 100644 index 0000000000..6f9e685c7b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality170.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax+b > c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,10,1); +$b=random(2,10,1); +$v=random(2,10,1); +$c=$a*$v+$b; +$left = Compute("$a*x+$b"); +$comp = ">"; +$right = Compute("$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > $v}"); +$alt = Compute("{ x | $v < x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($v,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions('The [| | |]* symbol is above the [|Enter|]* key.')@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a]x + [$b] & > [$c] \\ + -[$b] & \phantom{>} -[$b] \\ + [$a]x & > [$c-$b] \\ + \frac{[$a]x}{[$a]} & > \frac{[$c-$b]}{[$a]} \\ + x & > [$v] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality180.pg new file mode 100644 index 0000000000..d669318196 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality180.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a>= bx-c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','add','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(3,10,1); +$b=random(2,5,1); +$v=random(2,10,1); +$c=$a*$v-$b; + +$left = Compute("$c"); +$comp = "\geq"; +$right = Compute("$a*x-$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= $v}"); +$alt = Compute("{ x | $v >= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$v]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$c] & \geq [$a]x -[$b] \\ + [$c] \mathbf{{} +[$b]} & \geq [$a]x -[$b]\mathbf{{} +[$b]} \\ + [$c+$b] & \geq [$a]x \\ + \frac{[$c+$b] }{[$a]} & \geq \frac{[$a]x}{[$a]} \\ + [$v] & \geq x \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality190.pg new file mode 100644 index 0000000000..a173ac6655 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality190.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a <= b-cx +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,10,1); +$b=random(1,10,1); +$v=random(2,10,1); +$c=$b+$a*$v; + +$left = Compute("$c"); +$comp = "\leq"; +$right = Compute("$b-$a*x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= -$v}"); +$alt = Compute("{ x | -$v >= x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,-$v]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$c] & \leq [$b]-[$a]x \\ + [$c] \mathbf{{} -[$b]} & \leq [$b]-[$a]x\mathbf{{} -[$b]} \\ + [$c-$b] & \leq -[$a]x \\ + \frac{[$c-$b] }{-[$a]} & \geq \frac{-[$a]x}{-[$a]} \\ + -[$v] & \geq x \\ + x & \leq -[$v] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality20.pg new file mode 100644 index 0000000000..dc7a810b5c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality20.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like x-a <= b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextArbitraryString.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(6,10,1); +$left = Compute("x-$a"); +$comp = "\leq"; +$right = Compute("$b"); + +$c = $b+$a; +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x <= $c}"); +$alt = Compute("{ x | $c >= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + x-[$a] & \leq [$b] \\ + x-[$a]\mathbf{{}+[$a]} & \leq [$b]\mathbf{{}+[$a]} \\ + x & \leq [$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality200.pg new file mode 100644 index 0000000000..2e82238b78 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality200.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -ax-b < -c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','add','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,10,1); +$b=random(1,10,1); +$v=random(2,10,1); +$c=$b+$a*$v; + +$left = Compute("-$a*x-$b"); +$comp = "<"; +$right = Compute("-$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > $v}"); +$alt = Compute("{ x | $v < x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($v,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a]x-[$b] &< -[$c] \\ + -[$a]x-[$b]\mathbf{{}+[$b]} &< -[$c]\mathbf{{}+[$b]} \\ + -[$a]x &< [$b-$c] \\ + \frac{-[$a]x}{-[$a]} &> \frac{[$b-$c]}{-[$a]} \\ + x & > [$v] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality210.pg new file mode 100644 index 0000000000..4b0139c455 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality210.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a > -bx+c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +#0 is the critical point +Context("Numeric"); + +$a=random(3,10,1); +$b=random(2,5,1); + +$left = Compute("$b"); +$comp = "\geq"; +$right = Compute("-$a*x+$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= 0}"); +$alt = Compute("{ x | 0 <= x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[0,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$b] & \geq -[$a]x +[$b] \\ + [$b]\mathbf{{} -[$b]} & \geq -[$a]x +[$b]\mathbf{{} -[$b]} \\ + 0 & \geq -[$a]x \\ + \frac{0}{-[$a]} & \leq \frac{-[$a]x}{-[$a]} \\ + 0 & \leq x \\ + x & \geq 0 +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality220.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality220.pg new file mode 100644 index 0000000000..71310f97ad --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality220.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -a > b-x +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','negative','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(1,5,1); +$v=random(6,10,1); +$c=$b-$v; + +$left = Compute("$c"); +$comp = ">"; +$right = Compute("$b-x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x > $v}"); +$alt = Compute("{ x | $v < x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($v,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$c] & > [$b]-x \\ + [$c] \mathbf{{}-[$b]} & > [$b]-x\mathbf{{}-[$b]} \\ + [$c-$b] & > -x \\ + -1 \cdot ([$c-$b]) & < -1 \cdot (-x) \\ + [$v] & < x \\ + x & > [$v] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality230.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality230.pg new file mode 100644 index 0000000000..6ecb3bf863 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality230.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a(x+b) >= c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,10,1); +$v = random(2,10,1); +$b=random(1,10,1); +$c= $a*($v+$b); + +$left = Compute("$a*(x+$b)"); +$comp = "\geq"; +$right = Compute("$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= $v}"); +$alt = Compute("{ x | $v <= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$v,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $a*$b; +$step2 = $c-$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a](x{}+ [$b]) & \geq [$c] \\ + [$a]x {}+[$step1] & \geq [$c] \\ + [$a]x {}+[$step1]\mathbf{{} -[$step1]} & \geq [$c]\mathbf{{} -[$step1]} \\ + [$a]x & \geq [$step2] \\ + \frac{[$a]x}{[$a]} & \geq \frac{[$step2]}{[$a]} \\ + x & \geq [$v] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality240.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality240.pg new file mode 100644 index 0000000000..db9a6dbde0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality240.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax+b < cx+d +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(t=>"Real"); + +$a=random(6,10,1); +$b=random(2,10,1); +$c=random(1,5,1); +$crit=random(2,10,1); +$d=$a*$crit+$b-$c*$crit; + +$left = Compute("$a*t+$b"); +$comp = "<"; +$right = Compute("$c*t+$d"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(t=>"Real"); + +$setans = Compute("{ t | t < $crit}"); +$alt = Compute("{ t | $crit>= t}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->variables->are(t=>"Real"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a]t {}+[$b] & < [$c]t {}+[$d] \\ + [$a]t {}+[$b]\mathbf{{}-[$c]t {}-[$b]} & < [$c]t {}+[$d]\mathbf{{}-[$c]t {}-[$b]} \\ + [$a-$c]t & < [$d-$b] \\ + \frac{[$a-$c]t}{[$a-$c]} & < \frac{[$d-$b]}{[$a-$c]} \\ + t & < [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality250.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality250.pg new file mode 100644 index 0000000000..5383da1246 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality250.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -ax +b <= -z -c +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','add','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(z=>"Real"); + +#make sure $d is negative +do { + $a=random(2,10,1); + $b=random(2,10,1); + $crit=random(1,10,1); + $ans=random(1,10,1); + $d=$b-($a-1)*$crit; +} until ($d<0); + +$d=abs($d); + +$left = Compute("-$a*z+$b"); +$comp = "\leq"; +$right = Compute("-z-$d"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(z=>"Real"); + +$setans = Compute("{ z | z >= $crit}"); +$alt = Compute("{ z | $crit <= z}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$crit,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a]z {}+[$b] & \leq -z {}-[$d] \\ + -[$a]z {}+[$b] \mathbf{{}+[$a]z {}+[$d]}& \leq -z {}-[$d]\mathbf{{}+[$a]z {}+[$d]} \\ + [$b+$d] & \leq [$a-1]z \\ + \frac{[$b+$d]}{[$a-1]} & \leq \frac{[$a-1]z}{[$a-1]} \\ + [$crit] & \leq z\\ +z & \geq [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality260.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality260.pg new file mode 100644 index 0000000000..d6fd5a91bf --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality260.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like x-a-bx > -c-dx+e +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','combine','add','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(a=>"Real"); + +do{ +$a=random(2,10,1); +$b=random(2,10,1); +$c=random(2,10,1); +$d=random(2,10,1);} until (1 - $b + $d >1); +$crit=random(-10,10,1); + +#make sure $e is positive +$e=$crit-$a-$b*$crit+$c+$d*$crit; +while ($e<=0) { + $crit=random(-10,10,1); + $e=$crit-$a-$b*$crit+$c+$d*$crit; +} + +$left = Compute("a-$a-$b*a"); +$comp = ">"; +$right = Compute("-$c-$d*a+$e"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(a=>"Real"); + +$setans = Compute("{ a | a > $crit}"); +$alt = Compute("{ a | $crit < a}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($crit,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = 1-$b; +$step2 = 1-$b+$d; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + a -[$a] -[$b]a & > -[$c] -[$d]a +[$e] \\ + [$step1]a -[$a] & > [$e-$c] -[$d]a \\ + [$step1]a -[$a]\mathbf{{}+[$a] +[$d]a} & > [$e-$c] -[$d]a\mathbf{{}+[$a] +[$d]a} \\ + [$step2]a & > [$e-$c+$a] \\ + \frac{[$step2]a}{[$step2]} &> \frac{[$e-$c+$a]}{[$step2]} \\ + a &> [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality270.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality270.pg new file mode 100644 index 0000000000..7b66d7582a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality270.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -ax+b-cx >= dx+e +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','combine','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +#make the critical point 0 +Context("Numeric"); +Context()->variables->are(p=>"Real"); + +$a=random(2,10,1); +$b=random(2,10,1); +$c=random(2,10,1); +$d=$b; +$e=random(2,10,1); +#make sure x terms are not cancelled +while (($a+$c)==(-$e)) {$e=random(2,10,1);} + +$left = Compute("-$c*p+$d-$e*p"); +$comp = "\geq"; +$right = Compute("$a*p+$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(p=>"Real"); + +$setans = Compute("{ p | p <= 0}"); +$alt = Compute("{ p | 0 >= p}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,0]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = abs(-$c-$e); +$step2 = $a+$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$c]p +[$d] -[$e]p & \geq [$a]p+[$b] \\ + (-[$c]-[$e])p +[$d] & \geq [$a]p+[$b] \\ + -[$step1]p +[$d] & \geq [$a]p+[$b] \\ + -[$step1]p +[$d]\mathbf{{}+[$step1]p-[$b]} & \geq [$a]p+[$b]\mathbf{{}+[$step1]p-[$b]} \\ + [$d-$b] & \geq [$step2]p \\ + \frac{[$d-$b]}{[$step2]} & \geq \frac{[$step2]p}{[$step2]} \\ + 0 & \geq p \\ + p & \leq 0 +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality280.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality280.pg new file mode 100644 index 0000000000..6d0519eb53 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality280.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a < -b(x-c) +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(p=>"Real"); + +$a=random(2,10,1); +$b=random(1,10,1); +$crit = non_zero_random(-10,10,1); +$c= -$a*($crit -$b); + +$left = Compute("$c"); +$comp = "<"; +$right = Compute("-$a*(p-$b)"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->add(p=>"Real"); + +$setans = Compute("{ p | p < $crit}"); +$alt = Compute("{ p | $crit > p}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit )"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $a*$b; +$step2 = $c-$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$c] & < -[$a](p -[$b]) \\ + [$c] & < -[$a](p +(-[$b])) \\ + [$c] & < -[$a]p +(-[$a]) \cdot (-[$b]) \\ + [$c] & < -[$a]p +[$step1] \\ + [$c]\mathbf{{}-[$step1]}& < -[$a]p +[$step1]\mathbf{{}-[$step1]} \\ + [$step2] & < -[$a]p \\ + \frac{[$step2]}{-[$a]} & > \frac{-[$a]p}{-[$a]} \\ + [$crit] & > p \\ + p &< [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality290.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality290.pg new file mode 100644 index 0000000000..23dbd7ad19 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality290.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -(x-a) >= b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','negative','distributive','subtract','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +do { + $crit = random(-10,-2,1); + $b=random(1,10,1); + $c= -($crit -$b); +} until ($c>0); + +$left = Compute("-(x-$b)"); +$comp = "\geq"; +$right = Compute("$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= $crit }"); +$alt = Compute("{ x | $crit >= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $a*$b; +$step2 = $c+$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -(x- [$b]) & \geq [$c] \\ + (-1) \cdot (x+(-[$b])) & \geq [$c] \\ + -x +(-1) \cdot (-[$b]) & \geq [$c] \\ + -x +[$b] & \geq [$c] \\ + -x +[$b]\mathbf{{} -[$b]}& \geq [$c]\mathbf{{} -[$b]} \\ + -x & \geq [$c-$b] \\ + (-1) \cdot (-x) & \leq (-1) \cdot ([$c-$b]) \\ + x & \leq [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality30.pg new file mode 100644 index 0000000000..7e00a14106 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality30.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a <= x + b +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(6,10,1); +$left = Compute("$a"); +$comp = "\leq"; +$right = Compute("x+$b"); + +$c = $a-$b; +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x >= $c}"); +$alt = Compute("{ x | $c <= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[$c,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a] & \leq x +[$b] \\ + [$a]\mathbf{{}-[$b]} & \leq x +[$b]\mathbf{{}-[$b]} \\ + [$c] & \leq x \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality300.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality300.pg new file mode 100644 index 0000000000..fdd6a1f2b6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality300.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a <= b-c(x-d) +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(z=>"Real"); + +$a=random(1,10,1); +$b=random(2,10,1); +$crit = non_zero_random(-10,10,1); +$c=random(1,10,1); +$d= $a-$b*($crit -$c); + +$left = Compute("$d"); +$comp = "\leq"; +$right = Compute("$a-$b*(z-$c)"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(z=>"Real"); + +$setans = Compute("{ z | z <= $crit}"); +$alt = Compute("{ z | $crit >= z}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit ]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $b*$c; +$step2 = $a+$step1; +$step3 = $d-$step2; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$d] & \leq [$a]-[$b](z-[$c]) \\ + [$d] & \leq [$a]+(-[$b]) \cdot (z+(-[$c])) \\ + [$d] & \leq [$a]+(-[$b]) \cdot z+(-[$b]) \cdot (-[$c]) \\ + [$d] & \leq [$a]-[$b]z +[$step1] \\ + [$d] & \leq -[$b]z +([$a]+[$step1]) \\ + [$d] & \leq -[$b]z +[$step2] \\ + [$d]\mathbf{{}-[$step2]} & \leq -[$b]z +[$step2]\mathbf{{}-[$step2]} \\ + [$step3] & \leq -[$b]z \\ + \frac{[$step3]}{-[$b]} & \geq \frac{-[$b]z}{-[$b]} \\ + [$crit ] & \geq z \\ + z & \leq [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality310.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality310.pg new file mode 100644 index 0000000000..867db53b94 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality310.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a-(x+b) < c +# +# Last updated: Jordan 7/30/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(y=>"Real"); + +$a=random(1,5,1); +$b=random(6,10,1); +$crit = random(-10,10,1); +$c= $a-($crit+$b); + +$left = Compute("$a-(y+$b)"); +$comp = "<"; +$right = Compute("$c"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(y=>"Real"); + +$setans = Compute("{ y | y > $crit}"); +$alt = Compute("{ y | $crit < y}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($crit,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $c+$b-$a; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a] -(y + [$b]) & < [$c] \\ + [$a] +(-1) \cdot (y + [$b]) & < [$c] \\ + [$a] +(-1) \cdot y + (-1) \cdot [$b] & < [$c] \\ + [$a] -y - [$b] & < [$c] \\ + -y +([$a]-[$b]) & < [$c] \\ + -y -[$b-$a] & < [$c] \\ + -y -[$b-$a]\mathbf{{}+[$b-$a]} & < [$c]\mathbf{{}+[$b-$a]} \\ + -y & < [$step1] \\ +-1 \cdot (-y) & > -1 \cdot ([$step1]) \\ + y & > [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality320.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality320.pg new file mode 100644 index 0000000000..944a7bd52d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality320.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a+b(x-c) < -d-(e-fx) +# +# Last updated: Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','distributive','subtract','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(7,10,1); +$c=random(3,10,1); +$crit = random(-10,10,1); + +$e=random(1,10,1); +$f=random(2,5,1); +$d= $a+$b*($crit-$c)+$e-$f*$crit; + +$left = Compute("$a+$b*(x-$c)"); +$comp = "<"; +$right = Compute("$d-($e-$f*x)"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x < $crit}"); +$alt = Compute("{ x | $crit > x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $b*$c; +$step2 = abs($a-$step1); +$step3 = $d-$e; +$step4 = $b-$f; +$step5 = $step3+$step2; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} +[$a]+[$b](x-[$c]) &<[$d]-([$e]-[$f]x) \\ +[$a]+[$b](x+(-[$c])) &<[$d]+(-1) \cdot ([$e]+(-[$f]x)) \\ +[$a]+[$b] \cdot x+[$b] \cdot (-[$c]) &<[$d]+(-1) \cdot [$e]+(-1) \cdot (-[$f]x) \\ +[$a]+[$b]x-[$step1] &<[$d]-[$e]+[$f]x \\ +[$a]-[$step1]+[$b]x &<[$d]-[$e]+[$f]x \\ +-[$step2]+[$b]x &<[$step3]+[$f]x \\ +-[$step2]+[$b]x\mathbf{{}+[$step2]-[$f]x} &<[$step3]+[$f]x\mathbf{{}+[$step2]-[$f]x} \\ +[$step4]x &<[$step5] \\ +\frac{[$step4]x}{[$step4]} &<\frac{[$step5]}{[$step4]} \\ + x &< [$crit] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality40.pg new file mode 100644 index 0000000000..8975612e39 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality40.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a > x + b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(6,10,1); +$left = Compute("$a"); +$comp = ">"; +$right = Compute("x+$b"); + +$c = $a-$b; +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x < $c}"); +$alt = Compute("{ x | $c > x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a] & > x +[$b] \\ + [$a]\mathbf{{}-[$b]} & > x +[$b]\mathbf{{}-[$b]} \\ + [$c] & > x \\ + x & < [$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality41.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality41.pg new file mode 100644 index 0000000000..d608614a03 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality41.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a > x + b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1,5,1); +$b=random(6,10,1); +$left = Compute("$a"); +$comp = ">"; +$right = Compute("x-$b"); + +$c = $a+$b; +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x < $c}"); +$alt = Compute("{ x | $c > x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a] & > x -[$b] \\ + [$a]\mathbf{{}+[$b]} & > x -[$b]\mathbf{{}+[$b]} \\ + [$c] & > x \\ + x & < [$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality50.pg new file mode 100644 index 0000000000..2e8eea2a38 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality50.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax <= b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("$a*x"); +$comp = "\leq"; +$right = Compute("$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); + +$setans = Compute("{ x | x <= $c}"); +$alt = Compute("{ x | $c >= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$c]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$a]x & \leq [$b] \\ + \frac{[$a]x}{[$a]} & \leq \frac{[$b]}{[$a]} \\ + x & \leq [$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality60.pg new file mode 100644 index 0000000000..9715e6dc54 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality60.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like ax>b. Fraction/decimal is in answer. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); + +$num=random(1,10,1); +$den=random(2,10,1); +while (gcd($den,$num)!=1) {$den=random(1,10,1);} +$c=Fraction($num,$den); + +$left = Compute("$den*x"); +$comp = ">"; +$right = Compute("$num"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + showExtraParens => 0, + reduceConstants => 0 +); + +$setans = Compute("{ x | x > $c}"); +$alt = Compute("{ x | $c < x}"); +$ans = OneOf($setans, $alt); +$ansLatexString="\left\{ x \mid x > ".$c->TeX."\right\}"; + +Context("Interval"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); +$intans = Interval("($c,inf)"); +$intansLatexString = "\left(".$c->TeX.",\infty\right)"; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans->cmp(correct_ans_latex_string=>$ansLatexString)}. + In interval notation, the solution set is [______________]{$intans->cmp(correct_ans_latex_string=>$intansLatexString)}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$den]x & > [$num] \\ + \frac{[$den]x}{[$den]} &> \frac{[$num]}{[$den]} \\ + x & > \frac{[$num]}{[$den]} \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`\left([$c],\infty\right)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality70.pg new file mode 100644 index 0000000000..f924e2ad42 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality70.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -ax>=b +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("-$a*x"); +$comp = "\geq"; +$right = Compute("$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= -$c}"); +$alt = Compute("{ x | -$c >= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,-$c]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -[$a]x & \geq [$b] \\ + \frac{-[$a]x}{-[$a]} & \leq \frac{[$b]}{-[$a]} \\ + x & \leq -[$c] \\ +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality80.pg new file mode 100644 index 0000000000..7ee2f0384c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality80.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a>=-bx +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','divide','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(2,5,1); +$c=list_random((2,3,4)); +$b=$a*$c; +$left = Compute("$b"); +$comp = "\geq"; +$right = Compute("-$a*x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x >= -$c}"); +$alt = Compute("{ x | -$c <= x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[-$c,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$b] & \geq -[$a]x \\ + \frac{[$b]}{-[$a]} & \leq \frac{-[$a]x}{-[$a]} \\ + -[$c] & \leq x \\ + x & \geq -[$c] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality90.pg new file mode 100644 index 0000000000..fede26956d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequality90.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a < -x +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','multiply','negative') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b=random(2,10,1); +$left = Compute("$b"); +$comp = "<"; +$right = Compute("-x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x < -$b}"); +$alt = Compute("{ x | -$b > x}"); +$ans = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,-$b)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$b] & < -x \\ + -1 \cdot ([$b]) & < -1 \cdot (-x) \\ + -[$b] & > x \\ + x & < -[$b] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction10.pg new file mode 100644 index 0000000000..413b8b36dc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction10.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like x/a + b >= cx +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$a=random(2,10,1); +$crit = $a*list_random((2,3,4,5,6)); +$c=random(2,5,1); +$b= $c*$crit-$crit/$a; + +$frac = Fraction(x,$a); + +$left = Compute("$frac+$b"); +$comp = "\geq"; +$right = Compute("$c*x"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x <= $crit}"); +$alt = Compute("{ x | $crit >= x}"); +$ans = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$crit]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $a*$b; +$step2 = $a*$c; +$s3=$step2-1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{x}{[$a]} +[$b] &\geq [$c]x \\ + [$a] \cdot \frac{x}{[$a]} +[$a] \cdot [$b] &\geq [$a] \cdot [$c]x \\ + x +[$step1] &\geq [$step2]x \\ + x +[$step1]\mathbf{{}-x} & \geq [$step2]x\mathbf{{}-x} \\ + [$step1] &\geq [$s3]x \\ + \frac{[$step1]}{[$s3]} &\geq \frac{[$s3]x}{[$s3]} \\ + [$crit] &\geq x +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction20.pg new file mode 100644 index 0000000000..d65ea1b9c1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction20.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a/b -cx < d. Fraction is in answer. +# +# Last updated: Jordan 10/25/13, 7/30/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','negative','divide','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->variables->are(y=>"Real"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); + +$den = random(2,6,2); +$num=random(3,5,2); +while (gcd($den,$num)!=1) {$num=random(3,5,2);} +$frac = Fraction($num,$den); + +$a=random(2,6,1); +$b=random(2,6,1); +$crit = Fraction($num-$b*$den,$a*$den); + +$critNum = -($crit->value)[0]; +$critDen = ($crit->value)[1]; + +$left = Compute("$frac-$a*y"); +$comp = "<"; +$right = Compute("$b"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); +Context()->variables->are(y=>"Real"); +$setans = Compute("{ y | y > -($critNum/$critDen)}"); +$alt = Compute("{ y | -($critNum/$critDen) < y}"); +$ans = OneOf($setans, $alt); +$ansLatexString = "\left\{ y \mid y > ".$crit->TeX."\right\}"; + +Context("Interval"); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); +$intans = Compute("($crit,inf)"); +$intansLatexString = "\left(".$crit->TeX.",\infty\right)"; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$ans->cmp(correct_ans_latex_string=>$ansLatexString)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans->cmp(correct_ans_latex_string=>$intansLatexString)}. + + +END_PGML + +############################################## + +$step1 = $den*$a; +$step2 = $den*$b; +$step3 = $step2-$num; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{[$num]}{[$den]} -[$a]y &< [$b] \\ +[$den] \cdot \left(\frac{[$num]}{[$den]} - [$a]y\right) &< [$den] \cdot [$b] \\ + [$den] \cdot \frac{[$num]}{[$den]} - [$den] \cdot [$a]y &< [$den] \cdot [$b] \\ + [$num] -[$step1]y &< [$step2] \\ + [$num]-[$step1]y\mathbf{{} -[$num]} &< [$step2]\mathbf{{} -[$num]} \\ + -[$step1]y &<[$step3] \\ + \frac{-[$step1]y}{-[$step1]} &< \frac{[$step3]}{-[$step1]} \\ + y &< -\frac{[$critNum]}{[$critDen]} +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`\left(-\frac{[$critNum]}{[$critDen]},\infty\right)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction30.pg new file mode 100644 index 0000000000..50dfe1569b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction30.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like (-a/b)x > (c/d)x - e +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','negative','multiply','divide') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->variables->are(t=>"Real"); + + +$den1 = random(3,7,2); +$num1 = random(2,6,2); +while (gcd($den1,$num1)!=1) {$num1=random(2,6,2);} + +$den2 = random(2,6,2); +$num2 = random(1,5,2); +while (gcd($den2,$num2)!=1) {$num2=random(1,5,2);} + +$com=lcm($den1,$den2); +$ans = $com*list_random((1,2,3)); +$a= $num1*$ans/$den1+$num2*$ans/$den2; +while ($a==0) { + $ans = $com*list_random((1,2,3)); + $a= $num1*$ans/$den1+$num2*$ans/$den2; +} + +$frac1=Fraction($num1,$den1); +$frac2=Fraction($num2,$den2); + +$left = Compute("-$frac2*t"); +$comp = ">"; +$right = Compute("$frac1*t - $a"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(t=>"Real"); + +$setans = Compute("{ t | t< $ans}"); +$alt = Compute("{ t | $ans > t}"); +$options = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$ans)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$step1 = $num1*$com/$den1; +$step2 = $num2*$com/$den2; +$step3 = $com*$a; +$step4 = $step2+$step1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + -\frac{[$num2]}{[$den2]}t &> \frac{[$num1]}{[$den1]}t - [$a] \\ +[$com] \cdot \left(-\frac{[$num2]}{[$den2]}t\right) &> [$com] \cdot \left(\frac{[$num1]}{[$den1]}t - [$a]\right) \\ + [$com] \cdot \left(-\frac{[$num2]}{[$den2]}t\right) &> [$com] \cdot \frac{[$num1]}{[$den1]}t - [$com] \cdot [$a] \\ + -[$step2]t &> [$step1]t - [$step3] \\ + -[$step2]t\mathbf{{} -[$step1]t} &> [$step1]t - [$step3]\mathbf{{} -[$step1]t} \\ + -[$step4]t &> -[$step3] \\ + \frac{-[$step4]t}{-[$step4]} &> \frac{-[$step3]}{-[$step4]} \\ + t &< [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction40.pg new file mode 100644 index 0000000000..ebeeff63de --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction40.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a/b >= x/c +# +# Last updated: Jordan 10/25/13, Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den1 = random(2,10,2); +$num1 = random(3,9,2); +while (gcd($den1,$num1)!=1) {$num1 = random(3,9,2);} + +$den2 = $den1*random(2,6,1); +$ans = $den2*$num1/$den1; + +Context()->flags->set(reduceConstants=>0); +$left = Formula("$num1/$den1"); +$comp = "\geq"; +$right = Formula("x/$den2"); + + + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x<= $ans}"); +$alt = Compute("{ x | $ans >= x}"); +$options = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$ans]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{[$num1]}{[$den1]} & \geq \frac{x}{[$den2]} \\ + [$den2] \cdot \frac{[$num1]}{[$den1]} & \geq [$den2] \cdot \frac{x}{[$den2]} \\ + [$ans] & \geq x\\ + x & \leq [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction50.pg new file mode 100644 index 0000000000..fa4caa3ea6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction50.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like -x/a < -b/c +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','negative','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den1 = random(2,10,2); +$num1 = random(3,9,2); +while (gcd($den1,$num1)!=1) {$num1 = random(3,9,2);} + +$den2 = $den1*random(2,6,1); +$ans = $den2*$num1/$den1; + +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(z=>'Real'); +$left = Formula("-(z/$den2)"); +$comp = "<"; +$right = Formula("-($num1/$den1)"); + + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(z=>'Real'); + +$setans = Compute("{ z | z> $ans}"); +$alt = Compute("{ z | $ans < z}"); +$options = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($ans,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`]. The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + In interval notation, the solution set is [______________]{$intans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -\frac{z}{[$den2]} &< -\frac{[$num1]}{[$den1]} \\ + (-1) \cdot \left(-\frac{z}{[$den2]}\right) &> (-1) \cdot \left(-\frac{[$num1]}{[$den1]}\right) \\ + \frac{z}{[$den2]} &> \frac{[$num1]}{[$den1]} \\ + [$den2] \cdot \frac{z}{[$den2]} &> [$den2] \cdot \frac{[$num1]}{[$den1]} \\ + z &> [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction60.pg new file mode 100644 index 0000000000..24248eb3da --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction60.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like x/a -b <= x/c +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','add','multiply') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den1 = random(3,7,2); +$den2 = random($den1+2,10,1); +$com = lcm($den1,$den2); + +$ans = $com*list_random((1,2,3)); +$a= $ans/$den1-$ans/$den2; + +Context()->flags->set(reduceConstants=>0); +$left = Formula("x/$den2-$a"); +$comp = "\leq"; +$right = Formula("x/$den1"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x>= -$ans}"); +$alt = Compute("{ x | -$ans <= x}"); +$options = OneOf($setans, $alt); + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("[-$ans,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$s1 = $com*$a; +$s2 = $com/$den1; +$s3 = $com/$den2; +$s4 = $s2-$s3; + +$s3x = Formula("$s3 x")->reduce; +$s4x = Formula("$s4 x")->reduce; + +$solnString = ''; +if ($s4 != 1) +{$solnString = "\frac{-$s1}{$s4} & \leq \frac{$s4 x}{$s4} \\ + -$ans & \leq x\\";}; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{x}{[$den2]} - [$a] & \leq \frac{x}{[$den1]} \\ + [$com] \cdot \left(\frac{x}{[$den2]} - [$a]\right) & \leq [$com] \cdot \frac{x}{[$den1]} \\ +[$com] \cdot \frac{x}{[$den2]} - [$com] \cdot [$a] & \leq [$com] \cdot \frac{x}{[$den1]} \\ + [$s3x] - [$s1] & \leq [$s2]x \\ + [$s3x] - [$s1]\mathbf{{}-[$s3x]} & \leq [$s2]x\mathbf{{}-[$s3x]} \\ + -[$s1] & \leq [$s4x] \\ +[$solnString]* x & \geq -[$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction70.pg new file mode 100644 index 0000000000..2fc2202e66 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction70.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like (x-a)/b >= (x+c)/d +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','add','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den2 = random(2,6,2); +$den1 = $den2+2; +$num1 = random(1,10,1); +$num2 = random(1,10,1); + +$ans = (-$num1*$den2-$den2*$num2-2*$num2)/2; +$com = lcm($den1,$den2); + +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(y=>'Real'); +$left = Formula("(y-$num1)/$den1"); +$comp = "\geq"; +$right = Formula("(y+$num2)/$den2"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->variables->are(y=>'Real'); + +$setans = Compute("{ y | y<= $ans}"); +$alt = Compute("{ y | $ans >= y}"); +$options = OneOf($setans, $alt); + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("(-inf,$ans]"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$s1 = $com/$den1; +$s2 = $com/$den2; +$s3 = $s1*$num1; +$s4 = $s2*$num2; +$s5 = $s2-$s1; +$s6 = $s3+$s4; + +Context()->variables->are(y=>'Real'); +$s5y = Formula("$s5 y")->reduce; + +$solnString = ''; +if ($s5 != 1) +{ $solnString = " -$s6 & \geq $s5y \\ \frac{-$s6}{$s5} & \geq \frac{$s5y}{$s5} \\"}; + +$s7 = Compute("$s1*(y-$num1)")->reduce; +$s8 = Compute("$s2*(y+$num2)")->reduce; +$s9 = Compute("$s1*y")->reduce; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{y-[$num1]}{[$den1]} & \geq \frac{y+[$num2]}{[$den2]} \\ + [$com] \cdot \frac{y-[$num1]}{[$den1]} & \geq [$com] \cdot \frac{y+[$num2]}{[$den2]} \\ + [$s7] & \geq [$s8] \\ + [$s9] - [$s3] & \geq [$s2]y+[$s4] \\ + [$s9] - [$s3]\mathbf{{} -[$s9]-[$s4]} & \geq [$s2]y+[$s4]\mathbf{{} -[$s9]-[$s4]} \\ [$solnstring]* + [$ans] & \geq y\\ + y & \leq [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction80.pg new file mode 100644 index 0000000000..4ed5ccc6f9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveInequalityWithFraction80.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The equation looks like a/b < (x+c)/d - (x-e)/f +# +# Last updated: Jordan 10/25/13, 7/31/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('solve','inequality','linear','set notation','interval notation','fraction','multiply','combine','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextInequalitySetBuilder.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$den1 = random(2,6,2); +$den2 = $den1*2; +$num1 = random(1,10,1); +$num2 = random(1,10,1); + +$ans = non_zero_random(-10,10,1); +Context("Fraction"); +$frac = Fraction($ans+2*$num1+$num2,2*$den1)->reduce; +@fract = $frac->value; +$num3 = $fract[0]; +$den3 = $fract[1]; +while ($den3==1) { + $ans = random(-10,10,1); + Context("Fraction"); + $frac = Fraction($ans+2*$num1+$num2,2*$den1)->reduce; + @fract = $frac->value; + $num3 = $fract[0]; + $den3 = $fract[1]; +} + +$com = lcm(lcm($den1,$den2),$den3); + +Context()->flags->set(reduceConstants=>0); +$left = Formula("$num3/$den3"); +$comp = "<"; +$right = Formula("(x+$num1)/$den1-(x-$num2)/$den2"); + +InequalitySetBuilder::UseVerticalSuchThat(); +Context("InequalitySetBuilder-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$setans = Compute("{ x | x> $ans}"); +$alt = Compute("{ x | $ans < x}"); +$options = OneOf($setans, $alt); + + + +Context("Interval"); +Context()->flags->set("formatStudentAnswer"=>'parsed'); +$intans = Compute("($ans,inf)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. + + [`` [$left] [$comp] [$right] ``] + +[@KeyboardInstructions(q!Please type: [|inf|]* for [`\infty`], [|>=|]* for [`\geq`], and [|<=|]* for [`\leq`].!)@]** + + In set-builder notation, the solution set is [______________]{$options->cmp(correct_ans_latex_string=>$setans->TeX)}. + [@KeyboardInstructions(q!The [| | |]* symbol is above the [|Enter|]* key.!)@]** + + In interval notation, the solution set is [______________]{$intans}. + + +END_PGML + +############################################## + +$s1 = $com/$den1; +$s2 = $com/$den2; +$s3 = $com*$num3/$den3; +$s4 = $s1*$num1; +$s5 = $s2*$num2; +$s7 = $s4+$s5; + +$s9 = Compute("$s2*x")->reduce; + +$s8 = Compute("-$s2*(x-$num2)")->reduce; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + \frac{[$num3]}{[$den3]} &< \frac{x+[$num1]}{[$den1]} - \frac{x-[$num2]}{[$den2]} \\ + [$com] \cdot \frac{[$num3]}{[$den3]} &< [$com] \cdot \frac{x+[$num1]}{[$den1]} - [$com] \cdot \frac{x-[$num2]}{[$den2]} \\ + [$s3] &<[$s1](x+[$num1]) [$s8] \\ + [$s3] &< [$s1]x+[$s4] - [$s9] + [$s5] \\ + [$s3] &< x + [$s7] \\ + [$s3]\mathbf{{} -[$s7]} &< x + [$s7]\mathbf{{} -[$s7]} \\ + [$ans] &< x \\ + x & > [$ans] +\end{aligned} +`] + +The solution in set-builder notation is [`[$setans]`]. + +The solution in interval notation is [`[$intans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality10.pg new file mode 100644 index 0000000000..9e62c2b048 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality10.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in interval notation. +# There is no solution. +# +# Last updated: Jordan 7/28/13; Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserOneOf.pl", #needed if the answer is "all real numbers" or "(-inf, inf)", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(1,9,1); + +$ans = Compute('no solution'); +#$ans = OneOf("(-inf,inf), all real numbers"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` [$a]x > [$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + [$a]x &> [$a]x +[$b] \\ + [$a]x \mathbf{{} -[$a]x} &> [$a]x +[$b]\mathbf{{} -[$a]x} \\ + 0 &> [$b] +\end{aligned} +`] + +Since [`0>[$b]`] is false no matter what the value of [`x`] is, this inequality has *no solution*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality20.pg new file mode 100644 index 0000000000..01a208dfe6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality20.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# There is no solution. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','add','no solution') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +# solve inequality with no solutions +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(-10,-1,1); + +$ans = Compute("no solution"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` -[$a]x \leq -[$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -[$a]x & \leq -[$a]x {}+[$b] \\ + -[$a]x\mathbf{{}+[$a]x} & \leq -[$a]x {}+[$b]\mathbf{{}+[$a]x} \\ + 0 & \leq [$b] +\end{aligned} +`] + +Since [`0 \leq [$b]`] is false, this inequality has *no solution*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality30.pg new file mode 100644 index 0000000000..08f6f8dd62 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality30.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The solution set is "all real numbers". +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','combine','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +# solve inequality with no solutions + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(1,10,1); +$c=random(1,10,1); +$d=$b+$c; + +$ans = OneOf("(-inf,inf), all real numbers"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` -[$c]+[$a]x+[$d] \geq [$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -[$c]+[$a]x+[$d] &\geq [$a]x+[$b] \\ + [$a]x+[$b] &\geq [$a]x+[$b] \\ + [$a]x+[$b] \mathbf{{}-[$a]x-[$b]}&\geq [$a]x+[$b]\mathbf{{}-[$a]x-[$b]} \\ + 0 & \geq 0 +\end{aligned} +`] + +Since [`0 \geq 0`] is true, the solution set for this inequality is *all real numbers*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality40.pg new file mode 100644 index 0000000000..94f3afed86 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality40.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# There is no solution. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','subtract') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(1,10,1); +$c=random(1,10,1); +$d=$b+$c; + +$ans = Compute("no solution"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` -[$c]+[$a]x+[$d] < [$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -[$c]+[$a]x+[$d] &< [$a]x+[$b] \\ + [$a]x+[$b] &< [$a]x+[$b] \\ + [$a]x+[$b]\mathbf{{} -[$a]x-[$b]} &< [$a]x+[$b]\mathbf{{} -[$a]x-[$b]} \\ + 0 & < 0 +\end{aligned} +`] + +Since [`0 < 0`] is not true, this inequality has *no solution*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality50.pg new file mode 100644 index 0000000000..a22b6c01c2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality50.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# There is no solution. +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','combine','no solution') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(5,10,1); +$b=random(5,10,1); +$c=random(1,$a,1); +$e=random(-$a+$c+1,20,1); +$f=$b-1; + +$ans = Compute("no solution"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` -[$a]-[$b]z+[$c] > -z+[$e]-[$f]z ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +$s1 = abs(-$a+$c); +$s2 = $e+$s1; + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + -[$a]-[$b]z+[$c] &> -z+[$e]-[$f]z \\ + (-[$a]+[$c])-[$b]z &> (-1-[$f])z+[$e] \\ + (-[$a]+[$c])-[$b]z &> (-1-[$f])z+[$e] \\ + -[$s1] -[$b]z &> -[$b]z+[$e] \\ + -[$s1]-[$b]z\mathbf{{}+[$b]z+[$s1]} &> -[$b]z+[$e]\mathbf{{}+[$b]z+[$s1]} \\ + 0 &> [$s2] +\end{aligned} +`] + +Since [`0 > [$s2] `] is not true, this inequality has *no solution*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality60.pg new file mode 100644 index 0000000000..f63cfbe55d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality60.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The solution set is "all real numbers". +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','fraction') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,5,1); +$b=random(1,9,1); +$c=random(2,10,2); +$d=random(2,10,2); +$e=random(1,10,1); + +$h=random(1,10,1); +$i=($a*$c+$d)/2; +$f=random(1,20,1); +#make sure the solution is "all real numbers" +while ($f>=$a*$b+$e+2*$h) {$f=random(1,20,1);} + +$ans = OneOf("(-inf,inf), all real numbers"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` [$a]([$b]-[$c]m)-([$d]m-[$e]) > [$f]-2([$h]+[$i]m) ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +$s1=$a*$b; +$s2=$a*$c; +$s3=2*$h; +$s4=2*$i; +$s5=$s1+$e; +$s6=$s2+$d; +$s7=$f-$s3; +$s8=$s5-$s7; + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + [$a]([$b]-[$c]m)-([$d]m-[$e]) &> [$f]-2([$h]+[$i]m) \\ + [$a]([$b]+(-[$c]m))+ (-1) \cdot ([$d]m+(-[$e])) &> [$f]+(-2) \cdot ([$h]+[$i]m) \\ + [$a] \cdot [$b]+ [$a] \cdot (-[$c]m)+ (-1) \cdot [$d]m+ (-1) \cdot(-[$e]) &\> [$f]+(-2) \cdot [$h]+(-2) \cdot [$i]m \\ + [$s1] - [$s2]m -[$d]m+ [$e] &> [$f]-[$s3]-[$s4]m \\ + [$s1]+ [$e] +(- [$s2] -[$d])m &> ([$f]-[$s3])-[$s4]m \\ + [$s5] -[$s6]m &> [$s7]-[$s4]m \\ + [$s5] -[$s6]m\mathbf{{} -[$s7]+[$s6]m} &> [$s7]-[$s4]m\mathbf{{} -[$s7]+[$s6]m} \\ + [$s8] &> 0 +\end{aligned} +`] + +Since [`[$s8] > 0 `] is true, the solution set for this inequality is *all real numbers*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality70.pg new file mode 100644 index 0000000000..75a4d7a962 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality70.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The solution set is "all real numbers". +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','no solution') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(5,10,1); +$c=random(1,4,1); + +$ans = OneOf("(-inf,inf), all real numbers"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` [$a](k-[$b]) \leq [$a](k-[$c]) ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +$s1=$a*$b; +$s2=$a*$c; +$s3=$s1-$s2; + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + [$a](k-[$b]) & \leq [$a](k-[$c]) \\ + [$a]k-[$a] \cdot [$b] & \leq [$a]k-[$a] \cdot [$c] \\ + [$a]k-[$s1] & \leq [$a]k-[$s2] \\ + [$a]k-[$s1]\mathbf{{} -[$a]k+[$s1]} & \leq [$a]k-[$s2]\mathbf{{} -[$a]k+[$s1]} \\ + 0 & \leq [$s3] +\end{aligned} +`] + +Since [`0 \leq [$s3]`] is true, the solution set for this inequality is *all real numbers*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality80.pg new file mode 100644 index 0000000000..9b66817bf4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolveSpecialInequality80.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve linear inequality, and write solution in both set notation +# and interval notation. +# The solution set is "all real numbers". +# +# Last updated: Kling, 7/24/13; Hughes 7/15/2013, Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Inequalities') +## KEYWORDS('inequality','linear','set notation','interval notation','all real numbers') +## DBCCSS('7.EE.4','A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Interval"); +Context()->strings->add( + "no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "all real numbers"=>{}, + "infinite number of solutions"=>{'all real numbers'}, + "infinite"=>{alias=>'all real numbers'}, + "infinite solutions"=>{alias=>'all real numbers'}); + +$a=random(2,10,2); +$b=random(1,9,1); + +$ans = OneOf("(-inf,inf), all real numbers"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this inequality. [@KeyboardInstructions(q!Answer using interval notation. If there is no solution, you may enter [|no solution|]*. If the solution set is all real numbers, you may enter [|(-inf,inf)|]* or [|all real numbers|]*.!)@]** + + [`` [$a]x \leq [$a]x+[$b] ``] + + [_____________]{$ans->cmp(typeMatch=>Interval("(0,1)"))} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + [$a]x & \leq [$a]x +[$b] \\ + [$a]x \mathbf{{} -[$a]x} & \leq [$a]x +[$b]\mathbf{{} -[$a]x} \\ + 0 & \leq [$b] +\end{aligned} +`] + +Since [`0 \leq [$b]`] is true, the solution set for this inequality is *all real numbers*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph10.pg new file mode 100644 index 0000000000..1ff8a1a60e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph10.pg @@ -0,0 +1,204 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context('Numeric'); + +do { + $numerator = random(1,5,1); + $denominator = random(1,5,1); + $h = non_zero_random(-6,6,1); + do {$k = non_zero_random(-6,6,1);} until ($h != $k); + $m = $numerator/$denominator*$h*$k/abs($h*$k); + $k2 = ($k > 0) ? $k - $numerator : $k + $numerator; + $h2 = ($k2-$k)/$m+$h; +} until ($k2 != $h2); + +@k = num_sort($k,$k2); +@h = num_sort($h,$h2); +$f = Formula("$m*(x - $h)+$k")->reduce; + +@gr = ( ); +@xvalues = num_sort(-7,7,(7-$k)/$m+$h,(-7-$k)/$m+$h); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i]->lb('reset'); + for $j (-6..6){ + if ($j==0 or $j%2!=0) {next;} + $gr[$i]->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i]->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + $gr[$i]->moveTo($h,$k); + $gr[$i]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'blue',1); + $gr[$i]->moveTo($h,$k); + $gr[$i]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'blue',1); +} + +$alt[0] = "This is the graph of a straight line which passes the points ($h,$k) and ($h2,$k2)."; + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +$i0 = random(0,3,1); +if (random(0,1,1)==0) { + $i1 = 0; + $i2 = 1; +} else { + $i1 = 1; + $i2 = 0; +} +$symbol0 = $symbols[$i0]; +$symbol1 = $symbols[$i1]; +$symbol2 = $symbols[$i2]; + +@leftBrackets = ('(','['); +@rightBrackets = (')',']'); + +@ans = ( ); + +$gr[1]->moveTo($h,$k); +if ($m > 0) { + if ($i0 == 0) { + $ans[0] = Interval("(-inf,$h)"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is open."; + } elsif ($i0 == 1) { + $ans[0] = Interval("(-inf,$h]"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is closed."; + } elsif ($i0 == 2) { + $ans[0] = Interval("($h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is open."; + } else { + $ans[0] = Interval("[$h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is closed."; + } +} else { + if ($i0 == 0) { + $ans[0] = Interval("($h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is open."; + } elsif ($i0 == 1) { + $ans[0] = Interval("[$h,inf)"); + $gr[1]->arrowTo($xvalues[2],$m*($xvalues[2]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from x=$h to infinity is highlighted in red. The point ($h,$k) is closed."; + } elsif ($i0 == 2) { + $ans[0] = Interval("(-inf,$h)"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( open_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is open."; + } else { + $ans[0] = Interval("(-inf,$h]"); + $gr[1]->arrowTo($xvalues[1],$m*($xvalues[1]-$h)+$k,'red',1); + $gr[1]->stamps( closed_circle($h,$k,'red') ); + $alt[1] = $alt[0]." The segment from negative infinity to x=$h is highlighted in red. The point ($h,$k) is closed."; + } +} + +$y0 = $f->eval(x=>$h[0]); +$y1 = $f->eval(x=>$h[1]); +$ans[1] = Interval("$leftBrackets[$i2] $h[0],$h[1] $rightBrackets[$i1]"); +$gr[2]->moveTo($h[0],$y0); +$gr[2]->lineTo($h[1],$y1,'red',1); +$alt[2] = $alt[0]." The segment from ($h[0],$y0) to ($h[1],$y1) is highlighted in red."; +if ($i1==1) { + $gr[2]->stamps( open_circle($h[0],$y0,'red') ); + $alt[2] .= " The point ($h[0],$y1) is open,"; +} else { + $gr[2]->stamps( closed_circle($h[0],$y0,'red') ); + $alt[2] .= " The point ($h[0],$y0) is closed,"; +} +if ($i2==1) { + $gr[2]->stamps( open_circle($h[1],$y1,'red') ); + $alt[2] .= " and the point ($h[1],$y1) is open."; +} else { + $gr[2]->stamps( closed_circle($h[1],$y1,'red') ); + $alt[2] .= " and the point ($h[1],$y1) is closed."; +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbols[$i0]] [$k]`] + + [__________]{$ans[0]} + +1. [`[$k[0]] [$symbols[$i1]] f(x) [$symbols[$i2]] [$k[1]]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + + + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbols[$i0]] [$k]`], the function's [`y`]-value must be [$words[$i0]] [`[$k]`]. The corresponding segment is highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`[$k[0]] [$symbols[$i1]] f(x) [$symbols[$i2]] [$k[1]]`], the function's [`y`]-value must be between [`[$k[0]]`] and [`[$k[1]]`]. The corresponding segment is highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph20.pg new file mode 100644 index 0000000000..e82945ef36 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph20.pg @@ -0,0 +1,230 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ + + +Context('Numeric'); +$h = random(-4,4,1); +$k = random(-4,4,1); +$x = ($h < 0) ? random(-6,$h-1,1) : random($h+1,6,1); +$y = ($k < 0) ? random($k+1,6,1) : random(-6,$k-1,1); +$c = ($y-$k)/($x - $h)**2; +$f = Formula("$c*(x-$h)^2+$k"); + +@gr = (); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i]->lb('reset'); + for $j (-6..6){ + if (Real($j)==0) {next;} + $gr[$i]->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i]->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + $yexit = ($c < 0) ? -7 : 7; + @xvalues = num_sort(-7,7,sqrt(($yexit-$k)/$c)+$h,-sqrt(($yexit-$k)/$c)+$h); + add_functions($gr[$i], "$f for x in <$xvalues[1],$xvalues[2]> using color:blue and weight:1"); + $px = 14/240; + + $gr[$i]->moveTo($xvalues[1]+$px,$c*($xvalues[1]+$px-$h)**2+$k); + $gr[$i]->arrowTo($xvalues[1],$c*($xvalues[1]-$h)**2+$k,'blue',1); + $gr[$i]->moveTo($xvalues[2]-$px,$c*($xvalues[2]-$px-$h)**2+$k); + $gr[$i]->arrowTo($xvalues[2],$c*($xvalues[2]-$h)**2+$k,'blue',1); +} + +@x = num_sort($x,2*$h-$x); + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +@in = (); +if (random(0,1,1)==0) { + $in[0] = random(0,1,1); + $in[1] = random(2,3,1); +} else { + $in[0] = random(2,3,1); + $in[1] = random(0,1,1); +} +$symbol0 = $symbols[$in[0]]; +$symbol1 = $symbols[$in[1]]; + +@alt = ( ); +$uod = $c > 0 ? 'upward' : 'downward'; +$alt[0] = "This is the graph of a parabola with its vertex at ($h,$k). The parabola faces $uod. It passes the points ($x[0],$y) and ($x[1],$y)."; + +@s0 = ( + " Those two points are open.", + " Those two points are closed." +); + +@s1 = ( + " On the parabola, the segment between x=$x[0] to x=$x[1] are highlighted.", + " On the parabola, the segment from negative infinity to x=$x[0], and the segment from x=$x[1] to infinity are highlighted.", +); + +@s2 = ( + Interval("($x[0],$x[1])"), + Interval("[$x[0],$x[1]]"), + Union("(-inf,$x[0])U($x[1],inf)"), + Union("(-inf,$x[0]]U[$x[1],inf)"), +); + +sub graphOpenDots { + my $p = shift; + $gr[$p]->stamps( open_circle($x[0],$y,'red') ); + $gr[$p]->stamps( open_circle($x[1],$y,'red') ); +} + +sub graphClosedDots { + my $p = shift; + $gr[$p]->stamps( closed_circle($x[0],$y,'red') ); + $gr[$p]->stamps( closed_circle($x[1],$y,'red') ); +} + +sub highlightBetween { + my $p = shift; + add_functions($gr[$p], "$f for x in <$x[0],$x[1]> using color:red and weight:1"); +} + +sub highlightEnds { + my $p = shift; + add_functions($gr[$p], "$f for x in <$xvalues[1],$x[0]> using color:red and weight:1"); + add_functions($gr[$p], "$f for x in <$x[1],$xvalues[2]> using color:red and weight:1"); + $px = 14/240; + $gr[$p]->moveTo($xvalues[1]+$px,$c*($xvalues[1]+$px-$h)**2+$k); + $gr[$p]->arrowTo($xvalues[1],$c*($xvalues[1]-$h)**2+$k,'red',1); + $gr[$p]->moveTo($xvalues[2]-$px,$c*($xvalues[2]-$px-$h)**2+$k); + $gr[$p]->arrowTo($xvalues[2],$c*($xvalues[2]-$h)**2+$k,'red',1); +} + +$alt[1] .= $alt[0]; +$alt[2] .= $alt[0]; +@ans = (); +for my $i (0..1) { + if ($in[$i]==0) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } else { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } + &graphOpenDots($i+1); + } elsif ($in[$i]==1) { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } else { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } + &graphClosedDots($i+1); + } elsif ($in[$i]==2) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } else { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } + &graphOpenDots($i+1); + } else { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightEnds($i+1); + } else { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightBetween($i+1); + } + &graphClosedDots($i+1); + } +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbol0] [$y]`] + + [__________]{$ans[0]} + +1. [`f(x) [$symbol1] [$y]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbol0] [$y]`], the function's [`y`]-value must be [$words[$in[0]]] [`[$y]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`f(x) [$symbol1] [$y]`], the function's [`y`]-value must be [$words[$in[1]]] [`[$y]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph30.pg new file mode 100644 index 0000000000..6dfa2465bc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/backup/SolvingInequalityByGraph30.pg @@ -0,0 +1,241 @@ + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "AnswerFormatHelp.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + +############################################################ +# PG Setup +############################################################ +Context('Numeric'); + +$s = Real(random(-3,3,1)); +$r = $s - random(1,3,1); +$t = $s + random(2,3,1); + +$f = Formula("(x-$r)(x-$s)(x-$t)"); +@hts = map{abs($f->eval(x=>$_))}($r..$t); +$amplitude = random(1,3,1); +$c = $amplitude/max(@hts)*random(-1,1,2); +$k = random(1,6-$amplitude,1)*random(-1,1,2); +$f = $c*$f+$k; + +@gr = (); +for my $i (0..2) { + $gr[$i] = init_graph(-7,-7,7,7, + axes=>[0,0], + grid=>[14,14], + size=>[240,240] + ); + $gr[$i] ->lb('reset'); + for $j (-6..6){ + if (Real($j)==0) {next;} + $gr[$i] ->lb(new Label($j,0,$j,'black','center','top','large')); + $gr[$i] ->lb(new Label(0,$j,$j,'black','right','middle','large')); + }; + + $start = $r; + while (abs($f->eval(x=>$start-0.1))<7 and $start > -7) {$start = $start - 0.1}; + $stop = $t; + while (abs($f->eval(x=>$stop+0.1))<7 and $stop < 7) {$stop = $stop + 0.1}; + + add_functions($gr[$i] , "$f for x in <$start,$stop> using color:blue and weight:1"); + $px = 14/240; + $gr[$i] ->moveTo($start+$px,$f->eval(x=>$start+$px)); + $gr[$i] ->arrowTo($start,$f->eval(x=>$start),'blue',1); + $gr[$i] ->moveTo($stop-$px,$f->eval(x=>$stop-$px)); + $gr[$i] ->arrowTo($stop,$f->eval(x=>$stop),'blue',1); +} + +@symbols = ('\lt','\le','\gt','\ge'); +@words = ('less than','less than or equal to','greater than','greater than or equal to'); +@in = (); +if (random(0,1,1)==0) { + $in[0] = random(0,1,1); + $in[1] = random(2,3,1); +} else { + $in[0] = random(2,3,1); + $in[1] = random(0,1,1); +} +$symbol0 = $symbols[$in[0]]; +$symbol1 = $symbols[$in[1]]; + +@alt = ( ); +$startL = $c > 0 ? 'negative infinity' : 'positive infinity'; +$endR = $c > 0 ? 'positive infinity' : 'negative infinity'; +$uod0 = $c > 0 ? 'up' : 'down'; +$uod1 = $c > 0 ? 'down' : 'up'; +$alt[0] = "This is the graph of a cubic function which starts at $startL as x-value approaches negative infinity, going $uod0 through the point ($r,$k), curving $uod1 to pass ($s,$k), curving $uod0 to pass ($t,$k), and finally approaching $endR as x-value approaches positive infinity."; + +@s0 = ( + " Those three points are open.", + " Those three points are closed." +); + +@s1 = ( + " On the function, the segment between infinity and x=$r, and the segment from to x=$s to x=$t are highlighted.", + " On the function, the segment from x=$r and x=$s, and the segment from x=$t to infinity are highlighted.", +); + +@s2 = ( + Union("(-inf,$r)U($s,$t)"), + Union("(-inf,$r]U[$s,$t]"), + Union("($r,$s)U($t,inf)"), + Union("[$r,$s]U[$t,inf)"), +); + +sub graphOpenDots { + my $p = shift; + $gr[$p]->stamps( open_circle($r,$k,'red') ); + $gr[$p]->stamps( open_circle($s,$k,'red') ); + $gr[$p]->stamps( open_circle($t,$k,'red') ); +} + +sub graphClosedDots { + my $p = shift; + $gr[$p]->stamps( closed_circle($r,$k,'red') ); + $gr[$p]->stamps( closed_circle($s,$k,'red') ); + $gr[$p]->stamps( closed_circle($t,$k,'red') ); +} + +sub highlightLeft { + my $p = shift; + add_functions($gr[$p] , "$f for x in <$start,$r> using color:red and weight:1"); + add_functions($gr[$p] , "$f for x in <$s,$t> using color:red and weight:1"); + $px = 14/240; + $gr[$p] ->moveTo($start+$px,$f->eval(x=>$start+$px)); + $gr[$p] ->arrowTo($start,$f->eval(x=>$start),'red',1); +} + +sub highlightRight { + my $p = shift; + add_functions($gr[$p] , "$f for x in <$r,$s> using color:red and weight:1"); + add_functions($gr[$p] , "$f for x in <$t,$stop> using color:red and weight:1"); + $px = 14/240; + $gr[$p] ->moveTo($stop-$px,$f->eval(x=>$stop-$px)); + $gr[$p] ->arrowTo($stop,$f->eval(x=>$stop),'red',1); +} + +$alt[1] .= $alt[0]; +$alt[2] .= $alt[0]; +@ans = (); +for my $i (0..1) { + if ($in[$i]==0) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } else { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } + &graphOpenDots($i+1); + } elsif ($in[$i]==1) { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } else { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } + &graphClosedDots($i+1); + } elsif ($in[$i]==2) { + $alt[$i+1] .= $s0[0]; + if ($c > 0) { + $ans[$i] = $s2[2]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } else { + $ans[$i] = $s2[0]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } + &graphOpenDots($i+1); + } else { + $alt[$i+1] .= $s0[1]; + if ($c > 0) { + $ans[$i] = $s2[3]; + $alt[$i+1] .= $s1[1]; + &highlightRight($i+1); + } else { + $ans[$i] = $s2[1]; + $alt[$i+1] .= $s1[0]; + &highlightLeft($i+1); + } + &graphClosedDots($i+1); + } +} + + +############################################################ +# Body +############################################################ + +BEGIN_PGML +A graph of [`f`] is given. Use the graph alone to solve the compound inequalities. + +>>[@ image(insertGraph($gr[0]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[0]' title= '$alt[0]'" +) @]*<< + +[@KeyboardInstructions(q?Write your solution sets in interval notation.?)@]** + +1. [`f(x) [$symbol0] [$k]`] + + [__________]{$ans[0]} + +1. [`f(x) [$symbol1] [$k]`] + + [__________]{$ans[1]} + +END_PGML + +############################################################ +# End Problem +############################################################ + +BEGIN_PGML_SOLUTION + +###Question 1 + +To meet the condition [`f(x) [$symbol0] [$k]`], the function's [`y`]-value must be [$words[$in[0]]] [`[$k]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[1]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[1]' title= '$alt[1]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[0]]`]. + +###Question 2 + +To meet the condition [`f(x) [$symbol1] [$k]`], the function's [`y`]-value must be [$words[$in[1]]] [`[$k]`]. The corresponding segment(s) is/are highlighted in the following graph. + +>>[@ image(insertGraph($gr[2]), tex_size=>400, height=>400, width=>400, +extra_html_tags=>"alt= '$alt[2]' title= '$alt[2]'" +) @]*<< + +The corresponding [`x`]-values on the segment(s) is [`[$ans[1]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue10.pg index 1f253169c5..483656c093 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue10.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Absolute value) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') ## KEYWORDS('absolute value') +## DBCCSS('6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -29,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -44,7 +48,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the absolute value of this number. +Evaluate the following. [`` |{[$num]}|= ``] [______]{$absnum} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue12.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue12.pg new file mode 100644 index 0000000000..e615395ac8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue12.pg @@ -0,0 +1,68 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# +# Compute absolute value. +# +# Last edited: Jordan 7/2/2018 +# +# ENDDESCRIPTION + +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') +## KEYWORDS('absolute value') +## DBCCSS('6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); +$num = list_random(-1,1)*random(0.01,100,0.01); +$absnum = abs($num); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Evaluate the following. + + [`` \left\lvert[$num]\right\rvert= ``] [______]{$absnum} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The absolute value of [`[$num]`] is the distance between [`[$num]`] and [`0`] on the number line. In this case, since [`[$num]`] is [`[$absnum]`] units away from 0, the answer is [`[$absnum]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue14.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue14.pg new file mode 100644 index 0000000000..cfa014c02b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue14.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# +# Compute absolute value. +# +# Last edited: Jordan 7/3/18 +# +# ENDDESCRIPTION + +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') +## KEYWORDS('absolute value') +## DBCCSS('6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +do {$number = Fraction(non_zero_random(-100,100),non_zero_random(-100,100))} until (($number->value)[1] != 1); +Context("LimitedFraction"); +Context()->flags->set(showMixedNumbers=>0); +$absnum = abs(Fraction(($number->value)[0],($number->value)[1])); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Evaluate the following. + + [`` \left\lvert[$number]\right\rvert= ``] [______]{$absnum} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The absolute value of [`[$number]`] is the distance between [`[$number]`] and [`0`] on the number line. In this case, since [`[$number]`] is [`[$absnum]`] units away from 0, the answer is [`[$absnum]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue20.pg index 717d2fd5c8..eabd3e8d56 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue20.pg @@ -15,15 +15,18 @@ # Last updated: Hughes 7/22/13, Hughes 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.NS.6','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Absolute value) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','add','subtract','absolute value') +## DBCCSS('6.NS.6','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -79,17 +82,17 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the following expressions which involve the absolute value: +Evaluate the following. -1. [`` \left| [$a] \right| = ``] [________]{$ans1} +a. [`` \left\lvert [$a] \right\rvert = ``] [________]{$ans1} -2. [`` \left| [$b] \right| = ``] [________]{$ans2} +b. [`` \left\lvert [$b] \right\rvert = ``] [________]{$ans2} -3. [`` \left| [$c] \right| = ``] [________]{$ans3} +c. [`` \left\lvert [$c] \right\rvert = ``] [________]{$ans3} -4. [`` \left| [$func1] \right| = ``] [________]{$ans4} +d. [`` \left\lvert [$func1] \right\rvert = ``] [________]{$ans4} -5. [`` \left| [$func2] \right| = ``] [________]{$ans5} +e. [`` \left\lvert [$func2] \right\rvert = ``] [________]{$ans5} END_PGML @@ -97,20 +100,30 @@ END_PGML BEGIN_PGML_SOLUTION -1. [`` \left| [$a] \right| = [$ans1] ``] +a. Solution: + + [`` \left| [$a] \right| = [$ans1] ``] + +b. Solution: -2. [``\left| [$b] \right| = [$ans2] ``] + [``\left| [$b] \right| = [$ans2] ``] -3. [``\left| [$c] \right| = [$ans3] ``] +c. Solution: -4. [`` + [``\left| [$c] \right| = [$ans3] ``] + +d. Solution: + + [`` \begin{aligned}[t] \left| [$func1] \right| & = \left| [$pro4Step] \right| \\ & = [$ans4] \end{aligned} ``] -5. [`` +e. Solution: + + [`` \begin{aligned}[t] \lvert [$func2] \rvert & = \lvert [$pro5Step] \rvert \\ & = [$ans5] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue30.pg index da5a910757..4f5e91324c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/AbsoluteValue30.pg @@ -13,15 +13,18 @@ # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.NS.6','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Absolute value) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','add','subtract','absolute value') +## DBCCSS('6.NS.6','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,14 +34,14 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("LimitedNumeric"); -$a=random(-4,-1,1); +$a=random(-4,-2,1); $b=random(1,5,1); $c=random(6,10,1); @@ -62,13 +65,13 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the following expressions which involve the absolute value: +Evaluate the following. -1. [`` - \lvert [$b]-[$c] \rvert = ``] [________]{$ans1} +a. [`` - \lvert [$b]-[$c] \rvert = ``] [________]{$ans1} -2. [`` \lvert -[$b]-[$c] \rvert = ``] [________]{$ans2} +b. [`` \lvert -[$b]-[$c] \rvert = ``] [________]{$ans2} -3. [`` [$a] \lvert [$c]-[$b] \rvert = ``] [________]{$ans3} +c. [`` [$a] \lvert [$c]-[$b] \rvert = ``] [________]{$ans3} END_PGML @@ -76,19 +79,25 @@ END_PGML BEGIN_PGML_SOLUTION -1. [` +a. Solution: + + [` \begin{aligned}[t] - \lvert [$b]-[$c] \rvert & = - \lvert [$pro1Step1] \rvert \\ & = [$ans1] \end{aligned}`] -2. [` +b. Solution: + + [` \begin{aligned}[t] \lvert -[$b]-[$c] \rvert & = \lvert [$pro2Step1] \rvert \\ &= [$ans2] \end{aligned}`] -3. [` +c. Solution: + + [` \begin{aligned}[t] [$a] \lvert [$c]-[$b] \rvert & = [$a] \cdot \lvert [$pro3Step1] \rvert \\ & = [$a] \cdot [$pro3Step2] \\ diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger10.pg index c4c9047911..317ddf7286 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger10.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Prime factorization) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(enterfact) -## Level(2) -## MO(1) +## DBsubject('Number theory') +## DBchapter('Divisibility') +## DBsection('Prime factorization') ## KEYWORDS('prime factors') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -27,12 +29,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -85,8 +87,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0); Value::Error("Your answer is not fully factored and simplified") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger20.pg index e2f183ad73..898c71d2c4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Prime factorization) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(enterfact) -## Level(2) -## MO(1) +## DBsubject('Number theory') +## DBchapter('Divisibility') +## DBsection('Prime factorization') ## KEYWORDS('prime factors') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -27,12 +29,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -85,8 +87,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0); Value::Error("Your answer is not fully factored and simplified") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger30.pg index 84de150132..8e71fe2f00 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger30.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Prime factorization) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(enterfact) -## Level(2) -## MO(1) +## DBsubject('Number theory') +## DBchapter('Divisibility') +## DBsection('Prime factorization') ## KEYWORDS('prime factors') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -27,12 +29,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -85,8 +87,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0); Value::Error("Your answer is not fully factored and simplified") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger40.pg index 76fa883131..805ee4556f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger40.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Prime factorization) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(enterfact) -## Level(2) -## MO(1) +## DBsubject('Number theory') +## DBchapter('Divisibility') +## DBsection('Prime factorization') ## KEYWORDS('prime factors') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -27,12 +29,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -87,8 +89,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct) or (Formula("$p*$p*$q") == $student) or ($student == Formula("$p*$p*$q"))); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("Your answer is not fully factored and simplified") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger50.pg index d3686e3fa9..01035c0f00 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger50.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Prime factorization) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(enterfact) -## Level(2) -## MO(1) +## DBsubject('Number theory') +## DBchapter('Divisibility') +## DBsection('Prime factorization') ## KEYWORDS('prime factors') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -27,12 +29,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -88,8 +90,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct) or (Formula("$p*$p*$q*$q*$r") == $student) or ($student == Formula("$p*$p*$q*$q*$r"))); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("Your answer is not fully factored and simplified") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger60.pg index 70f29cdd3d..a7055ae078 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/FactorInteger60.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Prime factorization) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(enterfact) -## Level(2) -## MO(1) +## DBsubject('Number theory') +## DBchapter('Divisibility') +## DBsection('Prime factorization') ## KEYWORDS('prime factors') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -27,12 +29,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -91,8 +93,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct) or (Formula("$nlongString") == $student) or ($student == Formula("$nlongString"))); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("Your answer is not fully factored and simplified") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine10.pg index 809cc36314..5988dfcda1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine10.pg @@ -1,6 +1,6 @@ # WeBWorK problem written by Carl Yao # Portland Community College -# +# Updated by Alex Jordan 6/18/2017 # # Locate a negative integer on a number line. # @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Interpreting integers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('number line') +## DBCCSS('6.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -26,35 +29,29 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages = 1; + Context("Numeric"); $a=random(-10,-2,1); -$radio = RadioButtons( - ["A","B","C","D"], - "B", # correct answer - order => ["A","B","C","D"], -); - @gr=(); $xmin = min(floor($a*1.6), -10); $xmax = -$xmin; for ($i=0;$i<=3;$i++) { $gr[$i] = init_graph($xmin,-1,$xmax,1, - axes=>[$a-10,0], + axes=>[$a-20,0], #grid=>[5,5], size=>[400,50] ); @@ -64,8 +61,6 @@ for ($i=0;$i<=3;$i++) { $gr[$i]->h_ticks(0,"black",@ticks); $gr[$i]->lb( new Label(0,-0.5,0,'black','center','middle')); - - } $j=0; @@ -82,49 +77,39 @@ $abs = abs($decoys[$i]); $directions[$i] = ($decoys[$i] > 0) ? "$abs ticks to the right of 0" : "$abs ticks to the left of 0"; } -############################################## - -Context()->texStrings; -BEGIN_TEXT - -$PAR -Choose the graph showing \($a\) on the number line. If no scale is given assume tick marks are one unit apart. -$PAR +$radio = RadioButtons([[ +image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ), +image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ), +image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ), +image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ), +]], + 1, # correct answer +); -A. \{ image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ) \} -$PAR -B. \{ image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ) \} -$PAR -C. \{ image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ) \} -$PAR -D. \{ image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot at $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ) \} -$BR -$BR -\{ $radio->buttons() \} +############################################## +BEGIN_PGML +Choose the graph showing [`[$a]`] on the number line. If no scale is given assume tick marks are one unit apart. -END_TEXT +[__]{$radio} -Context()->normalStrings; +END_PGML ############################################## -ANS( $radio->cmp() ); +BEGIN_PGML_SOLUTION -Context()->texStrings; -BEGIN_SOLUTION +The correct answer is [@$radio->correct_ans()@]. -The correct answer is \{ $radio->correct_ans() \}. +END_PGML_SOLUTION -END_SOLUTION -Context()->normalStrings; ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine20.pg index 2b7d8395f9..54b008fbd2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine20.pg @@ -1,19 +1,23 @@ # WeBWorK problem written by Carl Yao # Portland Community College +# Updated by Alex Jordan 6/18/2017 # # Locate a negative decimal on a number line. # # ENDDESCRIPTION -## DBCCSS('6.NS') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('number line') +## DBCCSS('6.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -23,26 +27,20 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## -$refreshCachedImages = 1; + Context("Numeric"); $a=random(-9.5,-2.5,1); -$radio = RadioButtons( - ["A","B","C","D"], - "C", # correct answer - order => ["A","B","C","D"], -); - @gr=(); @@ -50,7 +48,7 @@ $xmin = min(floor($a*1.6), -10); $xmax = -$xmin; for ($i=0;$i<=3;$i++) { $gr[$i] = init_graph($xmin,-1,$xmax,1, - axes=>[$a-10,0], + axes=>[$a-20,0], #grid=>[5,5], size=>[400,50] ); @@ -78,49 +76,37 @@ $abs = abs($decoys[$i]); $directions[$i] = ($decoys[$i] > 0) ? "$abs ticks to the right of 0" : "$abs ticks to the left of 0"; } +$radio = RadioButtons([[ +image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ), +image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ), +image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ), +image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ), +]], + 2, # correct answer +); + ############################################## TEXT(beginproblem()); -Context()->texStrings; - -BEGIN_TEXT - -$PAR -Choose the graph showing \($a\) on the number line. If no scale is given assume tick marks are one unit apart. -$PAR -A. \{ image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ) \} -$PAR -B. \{ image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ) \} -$PAR -C. \{ image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ) \} -$PAR -D. \{ image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot at $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ) \} +BEGIN_PGML -$BR -$BR -\{ $radio->buttons() \} +Choose the graph showing [`[$a]`] on the number line. If no scale is given assume tick marks are one unit apart. +[__]{$radio} - -END_TEXT - -Context()->normalStrings; +END_PGML ############################################## -ANS( $radio->cmp() ); - -Context()->texStrings; -BEGIN_SOLUTION +BEGIN_PGML_SOLUTION -The correct answer is \{ $radio->correct_ans() \}. +The correct answer is [@$radio->correct_ans()@]. -END_SOLUTION -Context()->normalStrings; +END_PGML_SOLUTION ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine30.pg index 8616c7d9ea..2a52bd5f17 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine30.pg @@ -1,19 +1,23 @@ # WeBWorK problem written by Carl Yao # Portland Community College +# Updated by Alex Jordan 6/18/2017 # # Locate a negative fraction on a number line. # # ENDDESCRIPTION -## DBCCSS('6.NS') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('number line') +## DBCCSS('6.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -23,27 +27,21 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## -$refreshCachedImages = 1; + Context("Fraction"); $a=Fraction(random(-33,-13,4),4); -$radio = RadioButtons( - ["A","B","C","D"], - "D", # correct answer - order => ["A","B","C","D"], -); - @gr=(); @@ -51,7 +49,7 @@ $xmin = min(int(Real($a)*1.6), -10); $xmax = -$xmin; for ($i=0;$i<=3;$i++) { $gr[$i] = init_graph($xmin,-1,$xmax,1, - axes=>[$a-10,0], + axes=>[$a-20,0], #grid=>[5,5], size=>[400,50] ); @@ -79,42 +77,33 @@ $abs = abs($decoys[$i]); $directions[$i] = ($decoys[$i] > 0) ? "$abs ticks to the right of 0" : "$abs ticks to the left of 0"; } -############################################## -TEXT(beginproblem()); -Context()->texStrings; - -BEGIN_TEXT - -$PAR -Choose the graph showing \($a\) on the number line. If no scale is given assume tick marks are one unit apart. -$PAR +$radio = RadioButtons([[ +image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ), +image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ), +image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ), +image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ), +]], + 3, # correct answer +); -A. \{ image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ) \} -$PAR -B. \{ image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ) \} -$PAR -C. \{ image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ) \} -$PAR -D. \{ image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot at $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ) \} -$BR -$BR -\{ $radio->buttons() \} +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Choose the graph showing [`[$a]`] on the number line. If no scale is given assume tick marks are one unit apart. -END_TEXT +[__]{$radio} -Context()->normalStrings; +END_PGML ############################################## -ANS( $radio->cmp() ); - @ar = $a->value; $num = -$ar[0]; $den = $ar[1]; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine40.pg index 77afa75f2a..3b29d06866 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine40.pg @@ -1,19 +1,23 @@ # WeBWorK problem written by Carl Yao # Portland Community College +# Updated by Alex Jordan 6/18/2017 # # Locate a positive fraction on a number line. # # ENDDESCRIPTION -## DBCCSS('6.NS') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('number line') +## DBCCSS('6.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -23,26 +27,21 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## -$refreshCachedImages=1; + Context("Fraction"); $a=Fraction(random(15,31,4),4); -$radio = RadioButtons( - ["A","B","C","D"], - "B", # correct answer - order => ["A","B","C","D"], -); @gr=(); @@ -50,7 +49,7 @@ $xmin = -max(int(Real($a)*1.6), 10); $xmax = -$xmin; for ($i=0;$i<=3;$i++) { $gr[$i] = init_graph($xmin,-1,$xmax,1, - axes=>["$a"+10,0], + axes=>["$a"+20,0], #grid=>[5,5], size=>[400,50] ); @@ -78,42 +77,34 @@ for $i (0..3) $abs = abs($decoys[$i]); $directions[$i] = ($decoys[$i] > 0) ? "$abs ticks to the right of 0" : "$abs ticks to the left of 0"; } -############################################## -TEXT(beginproblem()); -Context()->texStrings; - -BEGIN_TEXT -$PAR -Choose the graph showing \($a\) on the number line. If no scale is given assume tick marks are one unit apart. -$PAR +$radio = RadioButtons([[ +image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ), +image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ), +image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ), +image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ), +]], + 1, # correct answer +); -A. \{ image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ) \} -$PAR -B. \{ image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ) \} -$PAR -C. \{ image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ) \} -$PAR -D. \{ image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot at $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ) \} -$BR -$BR -\{ $radio->buttons() \} +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Choose the graph showing [`[$a]`] on the number line. If no scale is given assume tick marks are one unit apart. -END_TEXT +[__]{$radio} -Context()->normalStrings; +END_PGML ############################################## -ANS( $radio->cmp() ); - @ar = $a->value; $num = $ar[0]; $den = $ar[1]; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine50.pg index 27eefcfb27..1f655075e9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine50.pg @@ -1,19 +1,23 @@ # WeBWorK problem written by Carl Yao # Portland Community College +# Updated by Alex Jordan 6/18/2017 # # Locate a positive decimal on a number line. # # ENDDESCRIPTION -## DBCCSS('6.NS') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('number line') +## DBCCSS('6.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -23,33 +27,27 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## -$refreshCachedImages=1; + Context("Numeric"); $a=random(3.4,7.4,1); -$radio = RadioButtons( - ["A","B","C","D"], - "C", # correct answer - order => ["A","B","C","D"], -); - @gr=(); $xmin = -max(int(Real($a)*1.6), 10); $xmax = -$xmin; for ($i=0;$i<=3;$i++) { $gr[$i] = init_graph($xmin,-1,$xmax,1, - axes=>["$a"+10,0], + axes=>["$a"+20,0], #grid=>[5,5], size=>[400,50] ); @@ -77,49 +75,39 @@ $abs = abs($decoys[$i]); $directions[$i] = ($decoys[$i] > 0) ? "$abs ticks to the right of 0" : "$abs ticks to the left of 0"; } -############################################## -TEXT(beginproblem()); -Context()->texStrings; - -BEGIN_TEXT - -$PAR -Choose the graph showing \($a\) on the number line. If no scale is given assume tick marks are one unit apart. -$PAR +$radio = RadioButtons([[ +image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ), +image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ), +image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ), +image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ), +]], + 2, # correct answer +); -A. \{ image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ) \} -$PAR -B. \{ image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ) \} -$PAR -C. \{ image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ) \} -$PAR -D. \{ image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot at $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ) \} -$BR -$BR -\{ $radio->buttons() \} +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Choose the graph showing [`[$a]`] on the number line. If no scale is given assume tick marks are one unit apart. -END_TEXT +[__]{$radio} -Context()->normalStrings; +END_PGML ############################################## -ANS( $radio->cmp() ); +BEGIN_PGML_SOLUTION -Context()->texStrings; -BEGIN_SOLUTION +The correct answer is [@$radio->correct_ans()@]. -The correct answer is \{ $radio->correct_ans() \}. +END_PGML_SOLUTION -END_SOLUTION -Context()->normalStrings; ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine60.pg index 694c1a92bf..b2fae6d806 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/NumberLine60.pg @@ -1,19 +1,23 @@ # WeBWorK problem written by Carl Yao # Portland Community College +# Updated by Alex Jordan 6/18/2017 # # Locate square root of a number on a number line. # # ENDDESCRIPTION -## DBCCSS('6.NS') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Interpreting irrational numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('number line') +## DBCCSS('6.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -23,34 +27,28 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## -$refreshCachedImages=1; + Context("Numeric"); $n = list_random(2,3,5,6,7,8,10,11,12,13,14,15); $a=sqrt($n); -$radio = RadioButtons( - ["A","B","C","D"], - "A", # correct answer - order => ["A","B","C","D"], -); - @gr=(); $xmin = -max(int(Real($a**2))+1, 10); $xmax = -$xmin; for ($i=0;$i<=3;$i++) { $gr[$i] = init_graph($xmin,-1,$xmax,1, - axes=>[$a+10,0], + axes=>[$a+20,0], #grid=>[5,5], size=>[400,50] ); @@ -78,53 +76,39 @@ $abs = Real(abs($decoys[$i])); $directions[$i] = ($decoys[$i] > 0) ? "$abs ticks to the right of 0" : "$abs ticks to the left of 0"; } +$radio = RadioButtons([[ +image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ), +image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ), +image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ), +image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'title="Graph of a number line with a dot $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ), +]], + 0, # correct answer +); + ############################################## TEXT(beginproblem()); -Context()->texStrings; - -BEGIN_TEXT - -$PAR -Choose the graph showing \(\sqrt{$n}\) on the number line. If no scale is given assume tick marks are one unit apart. -$PAR - -A. \{ image( insertGraph($gr[0]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[0]." alt="Graph of a number line with a dot $directions[0]."' ) \} -$PAR -B. \{ image( insertGraph($gr[1]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[1]." alt="Graph of a number line with a dot $directions[1]."' ) \} -$PAR -C. \{ image( insertGraph($gr[2]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot $directions[2]." alt="Graph of a number line with a dot $directions[2]."' ) \} -$PAR -D. \{ image( insertGraph($gr[3]), width=>400, height=>50, tex_size=>800, - extra_html_tags=>'title="Graph of a number line with a dot at $directions[3]." alt="Graph of a number line with a dot $directions[3]."' ) \} +BEGIN_PGML -$BR -$BR -\{ $radio->buttons() \} +Choose the graph showing [`\sqrt{[$n]}`] on the number line. If no scale is given assume tick marks are one unit apart. +[__]{$radio} - -END_TEXT - -Context()->normalStrings; +END_PGML ############################################## -ANS( $radio->cmp() ); - - -Context()->texStrings; -BEGIN_SOLUTION -Using a calculator, we can see \( \sqrt{$n}\approx $a \). $BR +BEGIN_PGML_SOLUTION -The correct answer is \{ $radio->correct_ans() \}. +Using a calculator, we can see [`\sqrt{[$n]}\approx [$a] `]. +The correct answer is [@$radio->correct_ans()@]. -END_SOLUTION -Context()->normalStrings; +END_PGML_SOLUTION ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion10.pg index 288072db84..234ea82950 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion10.pg @@ -7,17 +7,18 @@ # Last updated: Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Conversion between decimals and percents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PercentToDecimal) -## MLTleader(1) -## Level(2) -## MO(1) ## KEYWORDS('percent','decimal','convert') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +28,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,11 +48,11 @@ TEXT(beginproblem()); BEGIN_PGML -Change the following percentages into decimals: +Write the following percentages as decimals. - [`` [$a]% = ``] [_______]{$ans1} +a. [`` [$a]% = ``] [_______]{$ans1} - [`` [$b]% = ``] [_______]{$ans2} +a. [`` [$b]% = ``] [_______]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg index 48470dba4e..a64c099daf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg @@ -7,17 +7,18 @@ # Last updated: Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Conversion between decimals and percents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(DecimalToPercent) -## MLTleader(1) -## Level(2) -## MO(1) ## KEYWORDS('percent','decimal','convert') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -52,11 +53,11 @@ TEXT(beginproblem()); BEGIN_PGML -Convert the following decimals into percentages: +Write the following decimals as percentages. - [`` [$a] = ``] [_____]{$ans1} +a. [`` [$a] = ``] [_____]{$ans1} - [`` [$b] = ``] [_____]{$ans2} +a. [`` [$b] = ``] [_____]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion30.pg index 37a0a9fc8a..0b6e68e570 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion30.pg @@ -7,16 +7,18 @@ # Last updated: Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Conversion between decimals and percents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PercentToDecimal) -## Level(2) -## MO(1) ## KEYWORDS('percent','decimal','convert') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,15 +52,15 @@ TEXT(beginproblem()); BEGIN_PGML -Change the following percentages into decimals: +Write the following percentages as decimals. - [`` [$a]% = ``] [_______]{$ans1} +a. [`` [$a]% = ``] [_______]{$ans1} - [`` [$b]% = ``] [_______]{$ans2} +a. [`` [$b]% = ``] [_______]{$ans2} - [`` [$c]% = ``] [_______]{$ans3} +a. [`` [$c]% = ``] [_______]{$ans3} - [`` [$d]% = ``] [_______]{$ans4} +a. [`` [$d]% = ``] [_______]{$ans4} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion40.pg index bf59bd56f7..c43e7c983f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion40.pg @@ -7,16 +7,18 @@ # Last updated: Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Conversion between decimals and percents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PercentToDecimal) -## Level(2) -## MO(1) ## KEYWORDS('percent','decimal','convert') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion50.pg index ba18144e20..0f50e6af67 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion50.pg @@ -7,15 +7,18 @@ # Last updated: Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Conversion between decimals and percents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) ## KEYWORDS('percent','decimal','convert') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,15 +58,15 @@ TEXT(beginproblem()); BEGIN_PGML -Convert the following decimals into percentages: +Write the following decimals as percentages. - [`` [$a] = ``] [_____]{$ans1} +a. [`` [$a] = ``] [_____]{$ans1} - [`` [$b] = ``] [_____]{$ans2} +a. [`` [$b] = ``] [_____]{$ans2} - [`` [$c] = ``] [_____]{$ans3} +a. [`` [$c] = ``] [_____]{$ans3} - [`` [$d] = ``] [_____]{$ans4} +a. [`` [$d] = ``] [_____]{$ans4} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion60.pg index b0fb59abd0..5a186a840e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion60.pg @@ -7,16 +7,18 @@ # Last updated: Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Conversion between decimals and percents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(DecimalToPercent) -## Level(2) -## MO(1) ## KEYWORDS('percent','decimal','convert') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion70.pg index a206549019..847888f862 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion70.pg @@ -7,16 +7,18 @@ # Last updated: Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Conversion between decimals and percents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(DecimalToPercent) -## Level(2) -## MO(1) ## KEYWORDS('percent','decimal','convert') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,13 +62,13 @@ TEXT(beginproblem()); BEGIN_PGML -Convert the following decimals into percentages: +Write the following decimals as percentages. - [`` [$d] = ``] [_____]{$ans1} +a. [`` [$d] = ``] [_____]{$ans1} - [`` [$e] = ``] [_____]{$ans2} +a. [`` [$e] = ``] [_____]{$ans2} - [`` [$f] = ``] [_____]{$ans3} +a. [`` [$f] = ``] [_____]{$ans3} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg index 243939d236..09ec5ef1c1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg @@ -7,16 +7,18 @@ # Last updated: Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Conversion between decimals and percents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PercentToDecimal) -## Level(2) -## MO(1) ## KEYWORDS('percent','decimal','convert') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -51,13 +53,13 @@ TEXT(beginproblem()); BEGIN_PGML -Change the following percentages into decimals: +Write the following percentages as decimals. - [`` [$d]% = ``] [_______]{$ans1} +a. [`` [$d]% = ``] [_______]{$ans1} - [`` [$e]% = ``] [_______]{$ans2} +a. [`` [$e]% = ``] [_______]{$ans2} - [`` [$f]% = ``] [_______]{$ans3} +a. [`` [$f]% = ``] [_______]{$ans3} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber10.pg index 942d5a8f1e..f13bdeb825 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber10.pg @@ -8,16 +8,18 @@ # Last updated: Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PercentOfANumber) -## Level(2) -## MO(1) ## KEYWORDS('percent','multiply') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber100.pg index 11a182cffe..ec4eae8fb9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber100.pg @@ -9,16 +9,18 @@ # Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Conversion between decimals and percents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Translate) -## Level(4) -## MO(1) ## KEYWORDS('percent','English to math') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber110.pg index 369282a196..0bb7dc387d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber110.pg @@ -9,16 +9,18 @@ # Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) ## KEYWORDS('percent','multiply','divide') -## MLT(arithmetic_percents_computations_mixed_bag) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber120.pg index ad1d06bb6c..d253cec5d3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber120.pg @@ -9,16 +9,18 @@ # Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) -## MO(1) ## KEYWORDS('percent','multiply','divide') -## MLT(arithmetic_percents_computations_mixed_bag) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber20.pg index af13dc6e93..31b712726f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber20.pg @@ -8,16 +8,18 @@ # Last updated: Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PercentOfANumber) -## Level(2) -## MO(1) ## KEYWORDS('percent','multiply') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber30.pg index 77219838ba..e80e381861 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber30.pg @@ -8,17 +8,18 @@ # Last updated: Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(WhatPercent) -## MLTleader(1) -## Level(3) -## MO(1) ## KEYWORDS('percent','multiply') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber40.pg index 32a3ce2a1d..5cf13b2cf8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber40.pg @@ -8,16 +8,18 @@ # Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(WhatPercent) -## Level(3) -## MO(1) ## KEYWORDS('percent','multiply') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber50.pg index c2d09c07fb..30bee68c47 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber50.pg @@ -8,17 +8,18 @@ # Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(OriginalAmount) -## MLTleader(1) -## Level(3) -## MO(1) ## KEYWORDS('percent','multiply') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber60.pg index 5f9d502ff5..8505ba38e9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber60.pg @@ -8,16 +8,18 @@ # Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(OriginalAmount) -## Level(3) -## MO(1) ## KEYWORDS('percent') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber70.pg index 3d228b16e2..3ce98519ba 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber70.pg @@ -9,17 +9,18 @@ # Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) ## KEYWORDS('percent') -## MLTleader(1) -## MLT(arithmetic_percents_computations_mixed_bag) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber80.pg index 385d244bab..244088de2d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber80.pg @@ -9,16 +9,18 @@ # Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Conversion between decimals and percents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Translate) -## Level(4) -## MO(1) ## KEYWORDS('percent','English to math') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber90.pg index 13ad443d25..cc13d5c6ec 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/PercentOfNumber90.pg @@ -9,17 +9,18 @@ # Last updated: Jordan 7/25/13; Hughes 7/3/13, Carl Yao, 6/27/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Conversion between decimals and percents) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Translate) -## MLTleader(1) -## Level(4) -## MO(1) ## KEYWORDS('percent','English to math') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation10.pg index 26eac58bad..528c88b1fb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation10.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextRationalFunction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -42,7 +45,7 @@ Context("LimitedNumeric"); # We choose a is DECIMAL on [1,10], and b is an INTEGER on [2,5]. -$a = random(1,9,1) + random(0.1,0.9,0.1); +$a = random(1.1,9.9,0.1); $b = random(2,5,1); # answer diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation100.pg index 12725b4768..67e9da9a6b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation100.pg @@ -17,15 +17,18 @@ # Last updated: Jordan 8/4/13; Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation','negative') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,7 @@ loadMacros( "PGML.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -129,6 +132,8 @@ Context()->operators->add( TeX => '\mathbin{\times}', } ); +Context()->operators->redefine('X',using=>'x',from=>Context()); + @@ -157,8 +162,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("This is the same as the given number, but it is not in scientific notation") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation105.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation105.pg index ac2ccc1e11..8ba974a913 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation105.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation105.pg @@ -17,15 +17,18 @@ # Last updated: Jordan 8/4/13; Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation','negative') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,7 @@ loadMacros( "PGML.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -131,6 +134,8 @@ Context()->operators->add( TeX => '\mathbin{\times}', } ); +Context()->operators->redefine('X',using=>'x',from=>Context()); + @@ -159,8 +164,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("This is the same as the given number, but it is not in scientific notation") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation110.pg new file mode 100644 index 0000000000..62b4ab1973 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation110.pg @@ -0,0 +1,192 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# +# Divide the following numbers, writing your answer in scientific notation +# +# (a x 10^b) +# ---------- +# (c x 10^d) +# +# We choose a and c are INTEGER on [1,10], +# b is INTEGER on [-5,-2] and d is INTEGER on [2,5]. +# +# We ensure that a is an integer multiple of c +# +# Last updated: Jordan 8/4/13; Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('exponent','scientific','notation','negative') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + + + +# (a x 10^b) +# ---------- +# (c x 10^d) +# +# We choose a and c are INTEGER on [1,10], +# b and d are INTEGER on [2,5]. +# +# We ensure that a is an integer multiple of c + +Context("Numeric"); + +$c = random(2,9,1); +$a = random(2,9,1)*$c; +$arga = floor(log($a)/log(10)); +$a = $a/10**$arga; + +# exponents +$b = random(-5,-2,1); +$d = $b; +$d = random(2,5,1) while($d==$b); + +# quotient +$q = Real($a*(10**$b)/($c*(10**$d))); + +$arg = floor(log($q)/log(10)); +$mantissa = $q/(10**$arg); + + + +package my::BOP::multiply; +our @ISA = ('Parser::BOP::multiply'); + +sub TeX { + my $self = shift; + return '{'.$self->{lop}->TeX.'\mathbin{\times}'.$self->{rop}->TeX.'}'; + } + +sub _eval { + my $self = shift; + my $context = $self->context; + my ($a,$b) = @_; + if ($context->flag("bizarroMul")) { + if ($b <= 0) {$self->Error("Scientific notation has a positive number here")} + else {return $a+CORE::log($b)} + } else { + return $a * $b; + } +} + +sub call {(shift)->_eval(@_)} + +package main; + +Context("LimitedNumeric"); +Context()->variables->are(); +Context()->operators->redefine('*'); +Context()->operators->redefine(' *'); +Context()->operators->redefine('* '); +Context()->operators->redefine('**'); +Context()->operators->redefine('^'); +Context()->parens->redefine('('); +Context()->parens->redefine('['); +Context()->flags->set(reduceConstants=>0, formatStudentAnswer=>'parsed'); +Context()->noreduce("x*n"); + +Context()->operators->set( + '*' => {class => 'my::BOP::multiply', isCommand => 1}, # override * + '* ' => {class => 'my::BOP::multiply', isCommand => 1}, # override * + ' *' => {class => 'my::BOP::multiply', isCommand => 1}, # override * + '**' => {class => 'bizarro::BOP::power', isCommand => 1, perl=>undef}, # override ** + '^' => {class => 'bizarro::BOP::power', isCommand => 1, perl=>undef}, # override ^ +); + + +$prec = Context()->operators->get('*')->{precedence}; +Context()->operators->add( + 'x' => { + class => 'my::BOP::multiply', + isCommand => 1, + precedence => $prec, + associativity => 'left', + type => 'bin', + string => ' x ', + TeX => '\mathbin{\times}', + } + ); +Context()->operators->redefine('X',using=>'x',from=>Context()); + + + + + +# answer + +$ans = Formula("$mantissa*10^$arg"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Divide the following numbers, writing your answer in scientific notation. + + [`\displaystyle\frac{[$a]\times 10^{[$b]}}{[$c]\times 10^{[$d]}}=`][__________________] + +END_PGML + +$showPartialCorrectAnswers = 1; + +ANS($ans->cmp(checker => +sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects + Context()->flags->set(bizarroMul => 1,bizarroPow => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroMul => 0, bizarroPow => 0); + Value::Error("This is the same as the given number, but it is not in scientific notation") unless $OK; + return $OK; + } +)); +############################################## + +$solnString = ''; +$solnString = '\\ & = [$a/$c*10]\times10^{-1}\times 10^{[$b-$d]}\\ &=[$a/$c*10]\times 10^{[$b-$d-1]}' if ($a/$c != $mantissa); + +BEGIN_PGML_SOLUTION + +We divide the 'numeric' parts and the 'exponent' parts as follows + + [` + \begin{aligned} + \frac{[$a]\times 10^{[$b]}}{[$c]\times 10^{[$d]}}&= \frac{[$a]}{[$c]} \times 10^{[$b]-[$d]}\\ + & = [$a/$c]\times 10^{[$b-$d]}[$solnString]** + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation115.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation115.pg index 9275443f59..e374ba3cc3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation115.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation115.pg @@ -17,15 +17,18 @@ # Last updated: Jordan 8/4/13; Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation','negative') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,7 @@ loadMacros( "PGML.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -131,6 +134,8 @@ Context()->operators->add( TeX => '\mathbin{\times}', } ); +Context()->operators->redefine('X',using=>'x',from=>Context()); + @@ -159,8 +164,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("This is the same as the given number, but it is not in scientific notation") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation120.pg index b14360d6bd..1a5dbbb196 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation120.pg @@ -14,15 +14,18 @@ # Last updated: Jordan 8/4/13; Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation','negative') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +37,7 @@ loadMacros( "PGML.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -118,6 +121,8 @@ Context()->operators->add( TeX => '\mathbin{\times}', } ); +Context()->operators->redefine('X',using=>'x',from=>Context()); + @@ -146,8 +151,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("This is the same as the given number, but it is not in scientific notation") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation20.pg index a445f72787..930bcee9a8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation20.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextRationalFunction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation30.pg index 5d3cbe7f22..8e608cc170 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation30.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation','zero') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation40.pg index 4688866273..1f84d44fbc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation40.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation','negative') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation50.pg index 1504da7563..02d233b11d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation50.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation','negative') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation60.pg index 619d33ad12..6173a78e82 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation60.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation','negative') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGML.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -94,6 +97,8 @@ Context()->operators->add( TeX => '\mathbin{\times}', } ); +Context()->operators->redefine('X',using=>'x',from=>Context()); + @@ -127,8 +132,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("This is the same as the given number, but it is not in scientific notation") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation70.pg index 7f2d1decc6..29b990b394 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation70.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation','negative') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGML.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -94,6 +97,8 @@ Context()->operators->add( TeX => '\mathbin{\times}', } ); +Context()->operators->redefine('X',using=>'x',from=>Context()); + @@ -128,8 +133,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("This is the same as the given number, but it is not in scientific notation") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation80.pg index 124a47015c..58aedae651 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation80.pg @@ -13,15 +13,18 @@ # Last updated: Jordan 8/4/13; Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,17 +36,16 @@ loadMacros( "PGML.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## - -$a = random(2,9,1); +do { + $a = random(2,9,1); + $c = random(2,9,1); +} until ($a*$c!=10); $b = random(2,5,1); - -$c = $a; -$c = random(2,9,1) while($c==$a); $d = random(2,5,1); #product @@ -111,6 +113,8 @@ Context()->operators->add( TeX => '\mathbin{\times}', } ); +Context()->operators->redefine('X',using=>'x',from=>Context()); + @@ -138,8 +142,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("This is the same as the given number, but it is not in scientific notation") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation90.pg index 8d8d30e6a5..3eb4fadc72 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation90.pg @@ -17,15 +17,18 @@ # Last updated: Jordan 8/4/13; Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation','negative') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,7 @@ loadMacros( "PGML.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -127,8 +130,7 @@ Context()->operators->add( TeX => '\mathbin{\times}', } ); - - +Context()->operators->redefine('X',using=>'x',from=>Context()); # answer @@ -155,8 +157,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("This is the same as the given number, but it is not in scientific notation") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation95.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation95.pg index 35348843a6..6cb5aaaf8e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation95.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/ScientificNotation95.pg @@ -17,15 +17,18 @@ # Last updated: Jordan 8/4/13; Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('8.EE.1','8.EE.3','8.EE.4') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Scientific notation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('exponent','scientific','notation','negative') +## DBCCSS('8.EE.1','8.EE.3','8.EE.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,7 @@ loadMacros( "PGML.pl", "answerHints.pl", "bizarroArithmetic.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -128,6 +131,8 @@ Context()->operators->add( TeX => '\mathbin{\times}', } ); +Context()->operators->redefine('X',using=>'x',from=>Context()); + @@ -156,8 +161,7 @@ sub { $correct = $correct->{original_formula} if defined $correct->{original_formula}; $student = Formula("$student"); $correct = Formula("$correct"); #ensure both are Formula objects Context()->flags->set(bizarroMul => 1,bizarroPow => 1); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = (($correct == $student) or ($student == $correct)); Context()->flags->set(bizarroMul => 0, bizarroPow => 0); Value::Error("This is the same as the given number, but it is not in scientific notation") unless $OK; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/SignedNumberInterpretations10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/SignedNumberInterpretations10.pg index e2db1232d3..17035bd95d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/SignedNumberInterpretations10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/SignedNumberInterpretations10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Interpretation) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) -## MO(1) +## DBsubject('Numbers') +## DBchapter('Real numbers') +## DBsection('Misc.') ## KEYWORDS('operations with signed numbers') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -32,7 +35,8 @@ loadMacros( "parserNumberWithUnits.pl", "PGML.pl", "parserOneOf.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers10.pg index 40bb222f46..60b4f8af97 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Interpreting integers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Numbers') +## DBchapter('Real Numbers') +## DBsection('Misc.') ## KEYWORDS('real numbers') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -31,7 +34,8 @@ loadMacros( "PGchoicemacros.pl", "contextFraction.pl", "PGML.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers20.pg index 6ddaecc5bd..d220ad7b77 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers20.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Interpreting integers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Numbers') +## DBchapter('Real Numbers') +## DBsection('Misc.') ## KEYWORDS('real numbers') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -31,7 +34,8 @@ loadMacros( "PGchoicemacros.pl", "contextFraction.pl", "PGML.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers30.pg index 718a5ccb62..22f156a501 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Numbers') +## DBchapter('Real Numbers') +## DBsection('Misc.') ## KEYWORDS('real numbers') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -31,7 +34,8 @@ loadMacros( "PGchoicemacros.pl", "contextFraction.pl", "PGML.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers40.pg index d4bf8824ff..0a676f2025 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers40.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Interpreting irrational numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Numbers') +## DBchapter('Real Numbers') +## DBsection('Misc.') ## KEYWORDS('real numbers') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -31,7 +34,8 @@ loadMacros( "PGchoicemacros.pl", "contextFraction.pl", "PGML.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers50.pg index a6f38ef8cd..6d94bde430 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers50.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Numbers') +## DBchapter('Real Numbers') +## DBsection('Misc.') ## KEYWORDS('real numbers') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -31,7 +34,8 @@ loadMacros( "PGchoicemacros.pl", "contextFraction.pl", "PGML.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers60.pg new file mode 100644 index 0000000000..0573fffe51 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/NumberBasics/TypesOfNumbers60.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# +# Give examples of types of numbers +# +# +# +# ENDDESCRIPTION + +## DBsubject('Numbers') +## DBchapter('Real Numbers') +## DBsection('Misc.') +## KEYWORDS('real numbers') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "answerHints.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); + + +############################################## + +BEGIN_PGML +[@KeyboardInstructions('For each part, if no such number exists, enter [|DNE|]* or [|NONE|]*.')@]** + +a. Give an example of a whole number that is not an integer. + + [_________] + +a. Give an example of an integer that is not a whole number. + + [_________] + +a. Give an example of a rational number that is not an integer. + + [_________] + + +a. Give an example of a irrational number. + + [_________] + + +a. Give an example of a irrational number that is also an integer. + + [_________] + + +END_PGML + + + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS(OneOf(DNE,NONE)->cmp); +ANS(Compute(-1)->cmp(correct_ans => "any of -1, -2, -3, ...", + correct_ans_latex_string => "\text{any of }-1, -2, -3,\ldots", + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return ((int($student) == $student) and ($student < 0)); +} +)->withPostFilter(AnswerHints( + sub{ + my ( $correct, $student, $ansHash ) = @_; + return (int($student) == $student) and ($student > 0); + } => "This is an integer, but it is also a whole number", +)) +); + + +ANS(Real("0.5")->cmp(correct_ans => "many possibilities: 1/2, 2.3,...", + correct_ans_latex_string => "\text{many possibilities: }\frac{1}{2}, 2.3, \ldots", + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + $student = abs($student); + $student = $student->value; + Value->Error("Your answer is an integer") if $student == int($student); + my $OK = 0; + #in theory this should detect all rational numbers with denominators < the 30th Fibonacci number (and many with larger denominators too). Machine rounding error may come into play though. + for my $i (0..30) + {if (abs($student - int($student)) < 10**(-6)) {$OK = 1; last;} + $student = 1/($student - int($student)); + } + return $OK; +} +) +); + + +ANS(Compute("sqrt(2)")->cmp(correct_ans => "many possibilities: sqrt(2), pi,...", + correct_ans_latex_string => "\text{many possibilities: }\sqrt{2}, \pi, \ldots", + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + $student = abs($student); + $student = $student->value; + my $OK = 0; + #in theory this should detect all rational numbers with denominators < the 30th Fibonacci number (and many with larger denominators too). Machine rounding error may come into play though. + for my $i (0..30) + {if (abs($student - int($student)) < 10**(-6)) {$OK = 1; last;} + $student = 1/($student - int($student)); + } + return !$OK; +} +) +); + +ANS(OneOf(DNE,NONE)->cmp()->withPostFilter(AnswerHints( + sub{ + my ( $correct, $student, $ansHash ) = @_; + return (int($student) == $student) and ($student > 0); + } => "This is an integer", +))); + +############################################## + +BEGIN_PGML_SOLUTION + +a. Since all whole numbers belong to integers, we cannot write any whole number which is not an integer. Type [|DNE|]* (does not exist) for this question. + +a. Any negative integer, like [`-1`], is not a whole number, but is an integer. + +a. Any terminating decimal, like [`1.2`], is a rational number, but is not an integer. + +a. [`\pi`] is the easiest number to remember as an irrational number. Another constant worth knowing is [`e\approx2.718`]. Finally, the square root of most integers are irrational, like [`\sqrt{2}`] and [`\sqrt{3}`]. + +a. All irrational numbers are non-repeating and non-terminating decimals. No irrational numbers are integers. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/OOOFractions10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/OOOFractions10.pg index 678a3dca3e..371d88024d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/OOOFractions10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/OOOFractions10.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction','order of operations') ## DBCCSS('7.EE.1') ## DBCCSS('') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiple operations) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) -## KEYWORDS('fraction','order of operations') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -26,11 +29,12 @@ DOCUMENT(); #This section loads any and all .pl files that contain useful subroutines for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "contextFraction.pl", - "PGcourse.pl" + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object +, + "PGcourse.pl", ); @@ -76,11 +80,9 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Simplify the following fraction. - - [`[$frac1] + [$frac2] \div [$frac3] - [$frac4]`] +Evaluate the following. - [`{}={}`][______________]{$answer} + [``[$frac1] + [$frac2] \div [$frac3] - [$frac4]=``][_____]{$answer} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations10.pg index 4ad57d054f..ff0ca877b4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations10.pg @@ -12,15 +12,18 @@ # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','add','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +34,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations100.pg index d612306405..44029eecc3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations100.pg @@ -13,15 +13,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','add','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations110.pg index 06f26151ea..01cf15e18f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations110.pg @@ -13,15 +13,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations120.pg index 04c39735a5..88dab94ac3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations120.pg @@ -3,22 +3,25 @@ # # Template # -# Evaluate this expression: +# Evaluate the following. # # [`` ([$a]\cdot[$b])^{2} - [$a]\cdot[$b]^{2} = ``] [________] # # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','subtract','multiply','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +34,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,7 +53,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` ([$a]\cdot[$b])^{2} - [$a]\cdot[$b]^{2} = ``] [________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations130.pg index 55601ee733..695d2aefdd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations130.pg @@ -10,15 +10,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE-1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','add','subtract','divide','evaluate') +## DBCCSS('6.EE-1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,7 +59,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]\cdot[$b]^{2}-[$c]\div[$d]^{2}\cdot[$e]+[$f] = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations140.pg index 7a3e9c0a04..e3b5bcc3dc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations140.pg @@ -10,15 +10,18 @@ # Last updated: Jordan 7/25/13; Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,7 +53,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$c]([$a]-[$b])^{2} - [$c]([$a]-[$b]^{2}) = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations150.pg index ca74d19564..5aa0964037 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations150.pg @@ -11,15 +11,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','add','subtract','multiply','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +34,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -52,7 +55,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a][[$b]-[$c]([$d]+[$e])] = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations160.pg index 62907e8b7c..e24540bbd4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations160.pg @@ -11,15 +11,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +34,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -52,7 +55,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` -[$a]^{2}-[$b][ [$c]-( [$d]-[$e]^{3} ) ] = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations170.pg index 93e8b51296..311855914d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations170.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations170.pg @@ -11,15 +11,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','add','subtract','divide','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,7 +57,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` \frac{[$a]^{2}-[$b]^{2}}{[$c]+[$d]} = ``] [________]{$ans->cmp(cmp_class=>'number')} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations180.pg index 74dab4e760..24174ecd01 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations180.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations180.pg @@ -11,15 +11,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','subtract','divide','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,7 +59,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` \frac{[$a]-(-[$b])^{3}}{[$c]-[$d]} = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations190.pg index 94d84fd459..16e07335b3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations190.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations190.pg @@ -10,15 +10,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','add','subtract','negative','multiply','divide','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,7 +60,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` \frac{([$a])\cdot([$b])-([$c])\cdot[$d]}{([$e])^{2}+([$f])} = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations20.pg index fbd7862cdd..0c7ee15823 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations20.pg @@ -18,15 +18,18 @@ # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer',,'operation','multiply','divide','evaluate') ## DBCCSS('6.EE-1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) -## KEYWORDS('integer','operation','multiply','divide','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -36,7 +39,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations200.pg index 721a7d11f9..932795bee2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations200.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations200.pg @@ -5,22 +5,25 @@ # # Evaluate these expressions: # -# a) [`` [$a]-[$b]|[$c]-[$d]| = ``] [________]{$ans} +# a) [`` [$a]-[$b]\left\lvert [$c]-[$d]\right\rvert = ``] [________]{$ans} # -# b) [`` [$a]-[$b]|[$d]-[$c]| = ``] [________]{$ans} +# b) [`` [$a]-[$b]\left\lvert [$d]-[$c]\right\rvert = ``] [________]{$ans} # # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Absolute value) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','subtract','evaluate','absolute value') +## DBCCSS('6.EE.1','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,11 +56,11 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate these expressions: +Evaluate the following. -a) [`` [$a]-[$b]|[$c]-[$d]| = ``] [________]{$ans} +a) [`` [$a]-[$b]\left\lvert [$c]-[$d]\right\rvert = ``] [________]{$ans} -b) [`` [$a]-[$b]|[$d]-[$c]| = ``] [________]{$ans} +b) [`` [$a]-[$b]\left\lvert [$d]-[$c]\right\rvert = ``] [________]{$ans} END_PGML @@ -70,7 +73,7 @@ BEGIN_PGML_SOLUTION a) [` \begin{aligned}[t] - [$a]-[$b]|[$c]-[$d]| & = [$a]-[$b]|[$pro1Step1]| \\ + [$a]-[$b]\left\lvert [$c]-[$d]\right\rvert & = [$a]-[$b]\left\lvert [$pro1Step1]\right\rvert \\ & = [$a]-[$b]\cdot[$pro1Step1] \\ & = [$a]-[$pro1Step2] \\ & = [$ans] @@ -79,7 +82,7 @@ a) [` b) [` \begin{aligned}[t] - [$a]-[$b]|[$d]-[$c]| & = [$a]-[$b]|-[$pro1Step1]| \\ + [$a]-[$b]\left\lvert [$d]-[$c]\right\rvert & = [$a]-[$b]\left\lvert -[$pro1Step1]\right\rvert \\ & = [$a]-[$b]\cdot[$pro1Step1] \\ & = [$a]-[$pro1Step2] \\ & = [$ans] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations202.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations202.pg index 776cd43766..cabced286d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations202.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations202.pg @@ -10,14 +10,18 @@ # Last updated: Yao 11/02.2016 # ENDDESCRIPTION -## DBCCSS('6.EE-1','6.NS-7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Absolute value) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','subtract','evaluate','absolute value') +## DBCCSS('6.EE-1','6.NS-7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -47,7 +51,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]-[$b]\left\lvert [$c]-[$d] \right\rvert + [$e] = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations210.pg index 9394d9c0be..884bf8a4c8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations210.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations210.pg @@ -5,20 +5,23 @@ # # Evaluate these expressions: # -# [`` [$a]^{2}-|[$b]\cdot([$c])| = ``] [________]{$ans} +# [`` [$a]^{2}-\left\lvert [$b]\cdot([$c])\right\rvert = ``] [________]{$ans} # # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE-1','6.NS-7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Absolute value) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','subtract','evaluate','absolute value') +## DBCCSS('6.EE-1','6.NS-7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,9 +50,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. - [`` [$a]^{2}-|[$b]\cdot([$c])| = ``] [________]{$ans} + [`` [$a]^{2}-\left\lvert [$b]\cdot([$c])\right\rvert = ``] [________]{$ans} END_PGML @@ -62,7 +65,7 @@ $step3 = -$a**2; BEGIN_PGML_SOLUTION [` -\begin{aligned} [$a]^{2}-|[$b]\cdot([$c])| & = [$a]^{2}-|[$step1]| \\ +\begin{aligned} [$a]^{2}-\left\lvert [$b]\cdot([$c])\right\rvert & = [$a]^{2}-\left\lvert [$step1]\right\rvert \\ & = [$a]^{2}-[$step2] \\ & = [$step3]-[$step2] \\ & = [$ans] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations220.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations220.pg index 4069a0d457..e2b33a638f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations220.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations220.pg @@ -5,20 +5,23 @@ # # Evaluate these expressions: # -# [`` [$a]-[$b]|[$c]+([$d]-[$e])^{3}| = ``] [________]{$ans} +# [`` [$a]-[$b]\left\lvert [$c]+([$d]-[$e])^{3}\right\rvert = ``] [________]{$ans} # # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Absolute value) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','add','subtract','evaluate','absolute value') +## DBCCSS('6.EE.1','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -49,9 +52,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. - [`` [$a]-[$b]|[$c]+([$d]-[$e])^{3}| = ``] [________]{$ans} + [`` [$a]-[$b]\left\lvert [$c]+([$d]-[$e])^{3}\right\rvert = ``] [________]{$ans} END_PGML ############################################## @@ -66,9 +69,9 @@ BEGIN_PGML_SOLUTION [` \begin{aligned} - [$a]-[$b]|[$c]+([$d]-[$e])^{3}| & = [$a]-[$b]|[$c]+([$step1])^{3}| \\ -& = [$a]-[$b]|[$c]+([$step2])| \\ -& = [$a]-[$b]|[$step3]| \\ + [$a]-[$b]\left\lvert [$c]+([$d]-[$e])^{3}\right\rvert & = [$a]-[$b]\left\lvert [$c]+([$step1])^{3}\right\rvert \\ +& = [$a]-[$b]\left\lvert [$c]+([$step2])\right\rvert \\ +& = [$a]-[$b]\left\lvert [$step3]\right\rvert \\ & = [$a]-[$b]\cdot[$step4] \\ & = [$a]-[$step5] \\ & = [$ans] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations230.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations230.pg index cf9baeb27c..8aa4f08dac 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations230.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations230.pg @@ -5,7 +5,7 @@ # # Evaluate these expressions: # -# a) [`` |[$a]-[$b]|^{2}-|[$a]-[$b]^{2}| = ``] [________]{$ans1} +# a) [`` \left\lvert [$a]-[$b]\right\rvert ^{2}-\left\lvert [$a]-[$b]^{2}\right\rvert = ``] [________]{$ans1} # # b) [`` ([$a]-[$b])^{2}-([$a]-[$b]^{2}) = ``] [________]{$ans2} # @@ -14,15 +14,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Absolute value) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','subtract','evaluate','absolute value') +## DBCCSS('6.EE.1','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,7 +56,7 @@ BEGIN_PGML Evaluate these expressions: -a) [`` |[$a]-[$b]|^{2}-|[$a]-[$b]^{2}| = ``] [________]{$ans1} +a) [`` \left\lvert [$a]-[$b]\right\rvert ^{2}-\left\lvert [$a]-[$b]^{2}\right\rvert = ``] [________]{$ans1} b) [`` ([$a]-[$b])^{2}-([$a]-[$b]^{2}) = ``] [________]{$ans2} @@ -71,9 +74,9 @@ $step16 = $step14**2; BEGIN_PGML_SOLUTION a) [`\begin{aligned}[t] - |[$a]-[$b]|^{2}-|[$a]-[$b]^{2}| & = |[$step11]|^{2}-|[$a]-[$b]^{2}| \\ -& = |[$step11]|^{2}-|[$a]-[$step12]| \\ -& = |[$step11]|^{2}-|[$step13]| \\ + \left\lvert [$a]-[$b]\right\rvert ^{2}-\left\lvert [$a]-[$b]^{2}\right\rvert & = \left\lvert [$step11]\right\rvert ^{2}-\left\lvert [$a]-[$b]^{2}\right\rvert \\ +& = \left\lvert [$step11]\right\rvert ^{2}-\left\lvert [$a]-[$step12]\right\rvert \\ +& = \left\lvert [$step11]\right\rvert ^{2}-\left\lvert [$step13]\right\rvert \\ & = [$step14]^{2}-[$step15] \\ & = [$step16]-[$step15] \\ & = [$ans1] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations240.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations240.pg index 8b14661f44..45281407f9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations240.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations240.pg @@ -5,20 +5,23 @@ # # Evaluate these expressions: # -# [`` \frac{|[$a]+(-[$b])^{3}|}{[$c]} = ``] [________]{$ans} +# [`` \frac{\left\lvert [$a]+(-[$b])^{3}\right\rvert }{[$c]} = ``] [________]{$ans} # # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Absolute value) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','subtract','divide','evaluate','absolute value') +## DBCCSS('6.EE.1','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -48,9 +51,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. - [`` \frac{|[$a]+(-[$b])^{3}|}{[$c]} = ``] [________]{$ans} + [`` \frac{\left\lvert [$a]+(-[$b])^{3}\right\rvert }{[$c]} = ``] [________]{$ans} END_PGML @@ -64,8 +67,8 @@ BEGIN_PGML_SOLUTION [` \begin{aligned} -\frac{|[$a]+(-[$b])^{3}|}{[$c]} & = \frac{|[$a]+(-[$step1])|}{[$c]} \\ -& = \frac{|[$step2]|}{[$c]} \\ +\frac{\left\lvert [$a]+(-[$b])^{3}\right\rvert }{[$c]} & = \frac{\left\lvert [$a]+(-[$step1])\right\rvert }{[$c]} \\ +& = \frac{\left\lvert [$step2]\right\rvert }{[$c]} \\ & = \frac {[$step3]} {[$c]} \\ & = [$ans] \end{aligned}`] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations245.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations245.pg index 9b496b2aa5..aeb00149a4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations245.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations245.pg @@ -10,14 +10,18 @@ # Last updated: Yao, 11/02/2016 # ENDDESCRIPTION -## DBCCSS('6.EE.1','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Absolute value) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','subtract','divide','evaluate','absolute value') +## DBCCSS('6.EE.1','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -62,7 +66,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` \frac{[$a]\left\lvert [$b]-[$c] \right\rvert}{[$d]-([$e])^2} = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations250.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations250.pg index 1c992184d6..abed9bbd60 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations250.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations250.pg @@ -10,15 +10,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.NS.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('fraction','order of operations','add','evaluate','multiply') +## DBCCSS('7.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -63,7 +66,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$frac1]+[$a]\cdot[$frac2]= ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations260.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations260.pg index 34e358d413..4759ebc7b9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations260.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations260.pg @@ -10,15 +10,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.NS.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('fraction','order of operations','subtract','evaluate') +## DBCCSS('7.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,7 +68,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` \left([$frac1]-[$frac2]\right)-[$a]\left([$frac2]-[$frac1]\right)= ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations270.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations270.pg index 9f2e7749ab..bb7211426c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations270.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations270.pg @@ -5,20 +5,23 @@ # # Evaluate these expressions: # -# [`` |[$frac1]-[$frac2]|-[$a]|[$frac2]-[$frac1]|= ``] [________]{$ans} +# [`` \left\lvert [$frac1]-[$frac2]\right\rvert -[$a]\left\lvert [$frac2]-[$frac1]\right\rvert = ``] [________]{$ans} # # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.NS.1','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Absolute value) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('fraction','order of operations','evaluate','subtract','absolute value') +## DBCCSS('7.NS.1','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,9 +69,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. - [`` \left|[$frac1]-[$frac2]\right|-[$a]\left|[$frac2]-[$frac1]\right|= ``] [________]{$ans} + [`` \left| [$frac1]-[$frac2]\right| -[$a]\left| [$frac2]-[$frac1]\right| = ``] [________]{$ans} END_PGML @@ -82,8 +85,8 @@ You might need to go back to previous units to review how to add and subtract fr [` \begin{aligned} -\left|[$frac1]-[$frac2]\right|-[$a]\left|[$frac2]-[$frac1]\right| & = \left|[$step1]\right| -[$a]\left|[$frac2]-[$frac1]\right| \\ -& = |[$step1]| -[$a]\left|[$step2]\right| \\ +\left| [$frac1]-[$frac2]\right| -[$a]\left| [$frac2]-[$frac1]\right| & = \left| [$step1]\right| -[$a]\left| [$frac2]-[$frac1]\right| \\ +& = \left| [$step1]\right| -[$a]\left| [$step2]\right| \\ & = [$step3] -[$a]\cdot[$step3] \\ & = [$step3] -\left([$step4]\right) \\ & = [$ans] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations280.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations280.pg index 5bce99f235..33ed9ac15f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations280.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations280.pg @@ -10,15 +10,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.NS.1','6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('fraction','order of operations','evaluate','integer exponent','add','multiply') +## DBCCSS('7.NS.1','6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -63,7 +66,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$frac2]+[$a]\left([$frac1]\right)^{2}= ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations290.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations290.pg index 2451f3f37c..45ba3306fa 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations290.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations290.pg @@ -12,15 +12,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('7.NS.1','6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('fraction','order of operations','evaluate','integer exponent','subtract') +## DBCCSS('7.NS.1','6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +34,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations30.pg index 149a7e0cdc..f8c242c650 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations30.pg @@ -3,22 +3,25 @@ # # Template # -# Evaluate this expression: +# Evaluate the following. # # [`` [$a]+[$b]\cdot[$c]= ``] [________]{$ans} # # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','multiply','add','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -49,7 +52,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]+[$b]\cdot[$c]= ``] [________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations40.pg index f3980a3381..0ddf9b96cb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations40.pg @@ -4,22 +4,25 @@ # Template # # -# Evaluate this expression: +# Evaluate the following. # # [`` [$a]-[$b]\cdot[$c]= ``] [________]{$ans} # # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.EE-1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','multiply','subtract','evaluate') +## DBCCSS('6.EE-1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -49,7 +52,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]-[$b]\cdot[$c]= ``] [________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations50.pg index 999e10c52a..76462883c0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations50.pg @@ -3,22 +3,25 @@ # # Template # -# Evaluate this expression: +# Evaluate the following. # # [`` [$a]+[$b]\cdot[$c]= ``] [________]{$ans} # # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','multiply','subtract','negative','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -49,7 +52,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]-[$b](-[$c])= ``] [________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations60.pg index 53084ac2a7..c62d041643 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations60.pg @@ -13,15 +13,18 @@ # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','subtract','add','multiply','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +34,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations70.pg index ce44f8b84e..b0e577b8ca 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations70.pg @@ -12,15 +12,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','multiply','add','evaluate','integer exponent') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations80.pg index 5452c86f6c..5fd23a1c87 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations80.pg @@ -13,15 +13,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','add','evaluate','integer exponents') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations90.pg index 587dcfc09e..c32d964090 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperations90.pg @@ -13,15 +13,18 @@ # Last updated: Hughes, 6/26/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','integer exponent','add','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +34,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot10.pg index a29ebf6aa1..4572bcd6f9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot10.pg @@ -8,14 +8,18 @@ # Last updated: Yao, 10/31/2016 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','add','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -50,7 +54,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]\sqrt{[$b]+[$c]}= ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot15.pg index 5414f1c208..ec867105c4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot15.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot15.pg @@ -8,14 +8,18 @@ # Last updated: Yao, 10/31/2016 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','add','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -50,7 +54,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]\sqrt{[$b]+[$c]\cdot[$d]}= ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot20.pg index c79cb17b36..9c171e3dac 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot20.pg @@ -8,14 +8,18 @@ # Last updated: Yao, 10/31/2016 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','add','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -51,7 +55,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$e]-[$a]\sqrt{[$b]+[$c]}= ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot25.pg index 391af19f58..334d0655ab 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot25.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot25.pg @@ -8,14 +8,18 @@ # Last updated: Yao, 10/31/2016 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','add','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -52,7 +56,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` \sqrt{[$s1]} -[$a]\sqrt{[$b]+[$c]}= ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot30.pg index 0fac6df67b..1809b49178 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot30.pg @@ -8,14 +8,18 @@ # Last updated: Yao, 10/31/2016 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','add','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot40.pg index a3f8de23dd..845929ceba 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot40.pg @@ -8,14 +8,18 @@ # Last updated: Yao, 10/31/2016 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','add','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -49,7 +53,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` \sqrt{[$a]+[$b]^2}= ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot50.pg index 024740b3c8..4c22ceef4b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot50.pg @@ -8,14 +8,18 @@ # Last updated: Yao, 10/31/2016 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','add','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -52,7 +56,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` \sqrt{[$a]^2+[$b]^2}= ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot60.pg index fca7e3e2f8..7b27aff2dd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot60.pg @@ -8,14 +8,18 @@ # Last updated: Yao, 10/31/2016 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','add','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -49,7 +53,7 @@ TEXT(beginproblem()); BEGIN_PGML -Simplify this expression: +Evaluate the following. [`` \frac{\sqrt{[$a2]}+[$b]}{\sqrt{[$a2]}-[$b]}= ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot70.pg index 4cee76f70c..8c9fed7db5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/OrderOfOperations/orderOfOperationsSquareRoot70.pg @@ -8,14 +8,18 @@ # Last updated: Yao, 10/31/2016 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','add','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -59,9 +63,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. - [`` \frac{ \sqrt{[$d]+[$b]\cdot[$c]} + \left\lvert [$e]+[$f] \right\rvert }{[$h]-([$g])^3} ``][________]{$ans} + [`` \frac{ \sqrt{[$d]+[$b]\cdot[$c]} + \left\lvert [$e]+[$f] \right\rvert }{[$h]-([$g])^3}=``][________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation10.pg index d7fdfe2eed..9783530e74 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation10.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SlopeAndAPoint) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "parserAssignment.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -81,7 +82,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form using the given point. +A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form. An equation for this line in slope-intercept form is: [_______________]. @@ -103,6 +104,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -110,6 +112,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have it correct, then check each side to see if the sides if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation20.pg index 02532ea7bb..7dcc031707 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SlopeAndAPoint) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "parserAssignment.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,7 +82,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form using the given point. +A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form. An equation for this line in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. @@ -100,6 +102,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -107,6 +110,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation30.pg index e545cd7aa2..0c161f1064 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation30.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SlopeAndAPoint) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "parserAssignment.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,7 +82,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form using the given point. +A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form. An equation for this line in slope-intercept form is: [_______________]{$ansSI}. @@ -100,6 +102,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstring my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -107,6 +110,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstring $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { @@ -160,3 +164,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation40.pg index aec10836ee..f470032011 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation40.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SlopeAndAPoint) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','equation') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "parserAssignment.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -79,7 +81,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form using the given point. +A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form. An equation for this line in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. @@ -99,6 +101,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstring my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -106,6 +109,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstring $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation50.pg index a83df9610a..678fa90e3b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation50.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SlopeAndAPoint) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +33,8 @@ loadMacros( "parserImplicitPlane.pl", "parserAssignment.pl", "contextFraction.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## @@ -92,7 +95,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form using the given point. +A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form. An equation for this line in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. @@ -112,6 +115,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstring my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -119,6 +123,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstring $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation60.pg index aa65c58d87..6886b9e025 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquation60.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(SlopeAndAPoint) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +33,7 @@ loadMacros( "parserImplicitPlane.pl", "parserAssignment.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -90,7 +92,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line's slope is [``[$m]``]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form using the given point. +A line's slope is [``[$m]``]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both slope-intercept form and point-slope form. An equation for this line in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. @@ -110,6 +112,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstring my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -117,6 +120,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstring $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA10.pg new file mode 100644 index 0000000000..755d0509db --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA10.pg @@ -0,0 +1,152 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a line's slope and a point on the line, find the line's equation in +# both slope-intercept and point-slope form. All numbers are positive. +# +# Last edited: Jordan 8/30/13; Yao 7/8/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(x=>'Real', y=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(showExtraParens=>0); +Context()->noreduce('(-x)-y','(-x)+y','(-x)*y','x*(-y)','-n'); + +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$m=random(2,5,1); +$b=random(1,5,1); + +$x1=random(1,5,1); +$y1=$m*$x1+$b; + +$ansPS = ($y1!=0) ? Formula("y=$m(x-$x1)+$y1") : Formula("y=$m(x-$x1)"); + +$ansSI=Formula("y=$m*x+$b"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both point-slope and slope-intercept form. + + An equation for this line in point-slope form is: [_______________]. + + An equation for this line in slope-intercept form is: [_______________]. + +END_PGML + +############################################## + +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFormulas=>0); + +ANS($ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + +ANS($ansSI -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected slope-intercept form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + + +$s1 = $m*$x1; + +BEGIN_PGML_SOLUTION + +It's easier to find the point-slope form first, since we have been given a _point_ on the line and the _slope_ of the line. The generic formula for the point-slope form is: + + [`y=m(x-x_{0})+y_0`] + +where [`m`] is the slope and [` (x_{0},y_{0}) `] is a point on the line. We have been given that [`m=[$m]`] and that the line passes through the point [` ([$x1],[$y1]) `]. We substitute these numbers into the formula, and we have: + + [` +\begin{aligned} + y &= m(x-x_{0})+y_0 \\ + y &= [$m](x-[$x1])+[$y1] +\end{aligned} +`] + +So the line has an equation in point-slope form: [`y = [$m](x-[$x1])+[$y1] `]. + +---- + +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and solve for [`y`]. + + [` +\begin{aligned} + y &= [$m](x-[$x1])+[$y1]\\ + y &= [$m]x-[$m]([$x1])+[$y1]\\ + y &= [$m]x-[$s1]+[$y1]\\ + y &= [$m]x-[$s1-$y1]\\ +\end{aligned} +`] + +So the line's equation in slope-intercept form is [`y=[$m]x+[$b]`]. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA20.pg new file mode 100644 index 0000000000..e7dbf9c25c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA20.pg @@ -0,0 +1,151 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a line's slope and a point on the line, find the line's equation in +# both slope-intercept and point-slope form. Slope is negative. Y-intercept is # positive or negative. +# +# Last edited: Jordan 8/30/13; Yao 7/8/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(x=>'Real', y=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(showExtraParens=>0); +Context()->noreduce('(-x)-y','(-x)+y','(-x)*y','x*(-y)','-n'); + +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$m=random(-5,-2,1); +$b=non_zero_random(-5,5,1); + +$x1=non_zero_random(-5,5,1); +$y1=$m*$x1+$b; + +$ansPS = ($y1!=0) ? Formula("y=$m(x-$x1)+$y1") : Formula("y=$m(x-$x1)"); + +$ansSI=Formula("y=$m*x+$b"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both point-slope and slope-intercept form. + + An equation for this line in point-slope form is: [_______________]. + + An equation for this line in slope-intercept form is: [_______________]. + +END_PGML + +############################################## + +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFormulas=>0); + +ANS($ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + +ANS($ansSI -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected slope-intercept form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + +$s1 = $m*$x1; + +BEGIN_PGML_SOLUTION + +It's easier to find the point-slope form first, since we have been given a _point_ on the line and the _slope_ of the line. The generic formula for the point-slope form is: + + [`y=m(x-x_{0})+y_0`] + +where [`m`] is the slope and [` (x_{0},y_{0}) `] is a point on the line. We have been given that [`m=[$m]`] and that the line passes through the point [` ([$x1],[$y1]) `]. We substitute these numbers into the formula, and we have: + + [` +\begin{aligned} + y &= m(x-x_{0})+y_0 \\ + y &= [$m](x-[$x1])+[$y1] +\end{aligned} +`] + +So the line has an equation in point-slope form: [`y = [$m](x-[$x1])+[$y1] `]. + +---- + +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and solve for [`y`]. + + [` +\begin{aligned} + y &= [$m](x-[$x1])+[$y1]\\ + y &= [$m]x-[$m]([$x1])+[$y1]\\ + y &= [$m]x-[$s1]+[$y1]\\ + y &= [$m]x-[$s1-$y1]\\ +\end{aligned} +`] + +So the line's equation in slope-intercept form is [`y=[$m]x+[$b]`]. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA30.pg new file mode 100644 index 0000000000..e72c95b2f2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA30.pg @@ -0,0 +1,154 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a line's slope and a point on the line, find the line's equation in +# both slope-intercept and point-slope form. Slope is 1. Y-intercept is # positive or negative. +# +# Last edited: Jordan 8/30/13; Yao 7/8/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(x=>'Real', y=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(showExtraParens=>0); +Context()->noreduce('(-x)-y','(-x)+y','(-x)*y','x*(-y)','-n'); + +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$m=1; +$b=non_zero_random(-5,5,1); + +$x1=non_zero_random(-5,5,1); +$y1=$m*$x1+$b; + +$ansPS = ($y1!=0) ? Formula("y=$m(x-$x1)+$y1") : Formula("y=$m(x-$x1)"); + +$ansSI=Formula("y=$m*x+$b"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both point-slope and slope-intercept form. + + An equation for this line in point-slope form is: [_______________]. + + An equation for this line in slope-intercept form is: [_______________]. + +END_PGML + +############################################## + +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFormulas=>0); + +ANS($ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + +ANS($ansSI -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected slope-intercept form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + + +$s1 = $m*$x1; + +BEGIN_PGML_SOLUTION + +It's easier to find the point-slope form first, since we have been given a _point_ on the line and the _slope_ of the line. The generic formula for the point-slope form is: + + [`y=m(x-x_{0})+y_0`] + +where [`m`] is the slope and [` (x_{0},y_{0}) `] is a point on the line. We have been given that [`m=[$m]`] and that the line passes through the point [` ([$x1],[$y1]) `]. We substitute these numbers into the formula, and we have: + + [` +\begin{aligned} + y &= m(x-x_{0})+y_0 \\ + y &= [$m](x-[$x1])+[$y1] +\end{aligned} +`] + +So the line has an equation in point-slope form: [`y = [$m](x-[$x1])+[$y1] `]. + +---- + +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and solve for [`y`]. + + [` +\begin{aligned} + y &= [$m](x-[$x1])+[$y1]\\ + y &= [$m]x-[$m]([$x1])+[$y1]\\ + y &= [$m]x-[$s1]+[$y1]\\ + y &= [$m]x-[$s1-$y1]\\ +\end{aligned} +`] + +So the line's equation in slope-intercept form is [`y=[$m]x+[$b]`]. + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA40.pg new file mode 100644 index 0000000000..c00b1f3a04 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA40.pg @@ -0,0 +1,149 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a line's slope and a point on the line, find the line's equation in +# both slope-intercept and point-slope form. Slope is -1. Y-intercept is # positive or negative. +# +# Last edited: Jordan 8/30/13; Yao 7/8/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','equation') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(x=>'Real', y=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(showExtraParens=>0); +Context()->noreduce('(-x)-y','(-x)+y','(-x)*y','x*(-y)','-n'); + +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$m=-1; +$b=non_zero_random(-5,5,1); + +$x1=non_zero_random(-5,5,1); +$y1=$m*$x1+$b; + +$ansPS = ($y1!=0) ? Formula("y=$m(x-$x1)+$y1") : Formula("y=$m(x-$x1)"); + +$ansSI=Formula("y=$m*x+$b"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both point-slope and slope-intercept form. + + An equation for this line in point-slope form is: [_______________]. + + An equation for this line in slope-intercept form is: [_______________]. + +END_PGML + +############################################## + +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFormulas=>0); + +ANS($ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + +ANS($ansSI -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected slope-intercept form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + +$s1 = $m*$x1; + +BEGIN_PGML_SOLUTION + +It's easier to find the point-slope form first, since we have been given a _point_ on the line and the _slope_ of the line. The generic formula for the point-slope form is: + + [`y=m(x-x_{0})+y_0`] + +where [`m`] is the slope and [` (x_{0},y_{0}) `] is a point on the line. We have been given that [`m=[$m]`] and that the line passes through the point [` ([$x1],[$y1]) `]. We substitute these numbers into the formula, and we have: + + [` +\begin{aligned} + y &= m(x-x_{0})+y_0 \\ + y &= [$m](x-[$x1])+[$y1] +\end{aligned} +`] + +So the line has an equation in point-slope form: [`y = [$m](x-[$x1])+[$y1] `]. + +---- + +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and solve for [`y`]. + + [` +\begin{aligned} + y &= [$m](x-[$x1])+[$y1]\\ + y &= [$m]x-[$m]([$x1])+[$y1]\\ + y &= [$m]x-[$s1]+[$y1]\\ + y &= [$m]x-[$s1-$y1]\\ +\end{aligned} +`] + +So the line's equation in slope-intercept form is [`y=[$m]x+[$b]`]. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA50.pg new file mode 100644 index 0000000000..b409d116b9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA50.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a line's slope and a point on the line, find the line's equation in +# both slope-intercept and point-slope form. Slope is a positive fraction. +# Y-intercept is # positive or negative. +# +# Last edited: Jordan 8/30/13; Yao 7/8/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->variables->are(x=>'Real', y=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(showExtraParens=>0); +Context()->noreduce('(-x)-y','(-x)+y','(-x)*y','x*(-y)','-n'); + +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$num = random(1,9,1); +$den = random(2,9,1); +while (gcd($num,$den)!=1) {$den = random(2,9,1);} + +$m=Fraction($num,$den); +$b=non_zero_random(-5,5,1); + +$x1=$den*non_zero_random(-3,3,1); +$y1=$m*$x1+$b; + +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFormulas=>0); + +$ansPS = ($y1!=0) ? Formula("y=$m(x-$x1)+$y1") : Formula("y=$m(x-$x1)"); + +$ansSI=Formula("y=$m*x+$b"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both point-slope and slope-intercept form. + + An equation for this line in point-slope form is: [_______________]. + + An equation for this line in slope-intercept form is: [_______________]. + +END_PGML + +############################################## + +ANS($ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + +ANS($ansSI -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected slope-intercept form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + + + +$s1 = $m*$x1; +$negX1 = -$x1; +$absS1 = abs($s1); +$s1Output = $s1>0 ? "+$s1" : "-$absS1"; + +$left1 = Compute("y-$y1")->reduce; +$right1 = Compute("x-$x1")->reduce; + +$absY1 = abs($y1); +$y1Output = $y1>0 ? "+$y1" : "-$absY1"; + +BEGIN_PGML_SOLUTION + +It's easier to find the point-slope form first, since we have been given a _point_ on the line and the _slope_ of the line. The generic formula for the point-slope form is: + + [`y=m(x-x_{0})+y_0`] + +where [`m`] is the slope and [` (x_{0},y_{0}) `] is a point on the line. We have been given that [`m=[$m]`] and that the line passes through the point [` ([$x1],[$y1]) `]. We substitute these numbers into the formula, and we have: + + [` +\begin{aligned} + y &= m(x-x_{0})+y_0 \\ + y &= [$m](x-[$x1])+[$y1] +\end{aligned} +`] + +So the line has an equation in point-slope form: [`y = [$m](x-[$x1])+[$y1] `]. + +---- + +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and solve for [`y`]. + + [` +\begin{aligned} + y &= [$m](x-[$x1])+[$y1]\\ + y &= [$m]x-[$m]([$x1])+[$y1]\\ + y &= [$m]x-[$s1]+[$y1]\\ + y &= [$m]x-[$s1-$y1]\\ +\end{aligned} +`] + +So the line's equation in slope-intercept form is [`y=[$m]x+[$b]`]. + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA60.pg new file mode 100644 index 0000000000..084527dd53 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA60.pg @@ -0,0 +1,168 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a line's slope and a point on the line, find the line's equation in +# both slope-intercept and point-slope form. Slope is a negative fraction. +# Y-intercept is # positive or negative. +# +# Last edited: Jordan 8/30/13; Yao 7/8/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y','(-x)*y','x*(-y)','-n'); + +$num = random(1,9,1); +$den = random(2,9,1); +while (gcd($num,$den)!=1) {$den = random(2,9,1);} + +$m= -Fraction($num,$den); +$b=non_zero_random(-5,5,1); + +$x1=$den*non_zero_random(-3,3,1); +$y1=$m*$x1+$b; + +Context()->variables->are(x=>'Real', y=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(showExtraParens=>0); +Context()->noreduce('(-x)-y','(-x)+y','(-x)*y','x*(-y)','-n'); + +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFormulas=>0); + +$ansPS = ($y1!=0) ? Formula("y=$m(x-$x1)+$y1") : Formula("y=$m(x-$x1)"); + +$ansSI=Formula("y=$m*x+$b"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line's slope is [`[$m]`]. The line passes through the point [`([$x1],[$y1])`]. Find an equation for this line in both point-slope and slope-intercept form. + + An equation for this line in point-slope form is: [_______________]. + + An equation for this line in slope-intercept form is: [_______________]. + +END_PGML + +############################################## + +ANS($ansPS -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + +ANS($ansSI -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected slope-intercept form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + + + +$s2 = $m; +$s1 = $s2*$x1; +$left1 = Compute("y-$y1")->reduce; +$right1 = Compute("x-$x1")->reduce; + +$absY1 = abs($y1); +$y1Output = $y1>0 ? "+$y1" : "-$absY1"; + +BEGIN_PGML_SOLUTION + +It's easier to find the point-slope form first, since we have been given a _point_ on the line and the _slope_ of the line. The generic formula for the point-slope form is: + + [`y=m(x-x_{0})+y_0`] + +where [`m`] is the slope and [` (x_{0},y_{0}) `] is a point on the line. We have been given that [`m=[$m]`] and that the line passes through the point [` ([$x1],[$y1]) `]. We substitute these numbers into the formula, and we have: + + [` +\begin{aligned} + y &= m(x-x_{0})+y_0 \\ + y &= [$m](x-[$x1])+[$y1] +\end{aligned} +`] + +So the line has an equation in point-slope form: [`y = [$m](x-[$x1])+[$y1] `]. + +---- + +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and solve for [`y`]. + + [` +\begin{aligned} + y &= [$m](x-[$x1])+[$y1]\\ + y &= [$m]x-[$m]([$x1])+[$y1]\\ + y &= [$m]x-[$s1]+[$y1]\\ + y &= [$m]x-[$s1-$y1]\\ +\end{aligned} +`] + +So the line's equation in slope-intercept form is [`y=[$m]x+[$b]`]. + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular150.pg index 6b8ec9e2e7..af6ca991d8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular150.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PointAndParallelLine) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','parallel') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +32,7 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "parserAssignment.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -90,7 +91,7 @@ Line [`k`] has the equation [`y=[$lineM]`]. Line [`\ell`] is parallel to line [`k`], but passes through the point [`([$x1],[$y1])`]. -Find an equation for line [`\ell`] in both slope-intercept form and point-slope form using the given point. +Find an equation for line [`\ell`] in both slope-intercept form and point-slope form. An equation for [`\ell`] in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. @@ -110,6 +111,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -117,6 +119,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular160.pg index 14b85f290d..3668ebd9a2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular160.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PointAndParallelLine) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction','parallel') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,8 +32,8 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "parserAssignment.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -100,7 +102,7 @@ Line [`k`] has the equation [`y=[$lineM]`]. Line [`\ell`] is parallel to line [`k`], but passes through the point [`([$x1],[$y1])`]. -Find an equation for line [`\ell`] in both slope-intercept form and point-slope form using the given point. +Find an equation for line [`\ell`] in both slope-intercept form and point-slope form. An equation for [`\ell`] in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. @@ -120,6 +122,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -127,6 +130,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular170.pg index 9c7c9528b2..b8a553e46d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular170.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular170.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','perpendicular') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "parserAssignment.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -109,7 +112,7 @@ Line [`k`] has the equation [`y=[$lineM]`]. Line [`\ell`] is perpendicular to line [`k`], and passes through the point [`([$x1],[$y1])`]. -Find an equation for line [`\ell`] in both slope-intercept form and point-slope form using the given point. +Find an equation for line [`\ell`] in both slope-intercept form and point-slope form. An equation for [`\ell`] in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. @@ -129,6 +132,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -136,6 +140,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { @@ -208,9 +213,7 @@ The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] i [` \begin{aligned} - [$lineNPSLeft] &= [$lineNPSRight]\\ - [$output1] - [$output2] + [$lineNPSLeft] &= [$lineNPSRight]\\ [$output1] [$output2] y &= [$lineNSI]\\ \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular180.pg index 6e959ce0de..82ce7c7d7b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular180.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular180.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PointAndParallelLine) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction','parallel') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,8 +32,8 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "parserAssignment.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -100,7 +102,7 @@ Line [`k`] has the equation [`[$lineMLeft]=[$lineMRight]`]. Line [`\ell`] is parallel to line [`k`], but line [`\ell`] passes through the point [`([$x1],[$y1])`]. -Find an equation for line [`\ell`] in both slope-intercept form and point-slope form using the given point. +Find an equation for line [`\ell`] in both slope-intercept form and point-slope forms. An equation for [`\ell`] in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. @@ -120,6 +122,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -127,6 +130,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular190.pg index f85378491a..216896ff87 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular190.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular190.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PointAndPerpLine) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction','perpendicular') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,8 +32,8 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "parserAssignment.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -100,7 +101,7 @@ Line [`k`] has the equation [`y=[$lineM]`]. Line [`\ell`] is perpendicular to line [`k`] and passes through the point [`([$x1],[$y1])`]. -Find an equation for [`\ell`] in both slope-intercept form and point-slope form using the given point. +Find an equation for [`\ell`] in both slope-intercept form and point-slope forms. An equation for [`\ell`] in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. @@ -120,6 +121,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -127,6 +129,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular200.pg index 4474c2c6d3..c9c0b6f384 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular200.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular200.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PointAndPerpLine) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction','perpendicular') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,8 +32,8 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "parserAssignment.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -68,9 +70,9 @@ Context()->flags->set(showExtraParens=>0); Context()->texStrings; $absX1 = abs($x1); $absY1 = abs($y1); -if (($x1>0) && ($y1>0)) { +if (($x1>0) && ($y1>=0)) { $ansPSstringTeX = "y-$y1=$mn(x-$x1)"; -} elsif (($x1<0) && ($y1>0)) { +} elsif (($x1<0) && ($y1>=0)) { $ansPSstringTeX = "y-$y1=$mn(x+$absX1)"; } elsif (($x1>0) && ($y1<0)) { $ansPSstringTeX = "y+$absY1=$mn(x-$x1)"; @@ -102,7 +104,7 @@ Line [`k`]'s equation is [`y=[$lineM]`]. Line [`\ell`] is perpendicular to line [`k`] and passes through the point [`([$x1],[$y1])`]. -Find an equation for line [`\ell`] in both slope-intercept form and point-slope form using the given point. +Find an equation for line [`\ell`] in both slope-intercept form and point-slope forms. An equation for [`\ell`] in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. @@ -122,6 +124,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -129,6 +132,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { @@ -202,7 +206,7 @@ The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] i \end{aligned} ``] -So the line's equation in slope-intercept form is [`[$ansSIstringTeX]`]. +So the line's equation in slope-intercept form is [`y=[$ansSIstringTeX]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular210.pg index 4bfed72234..87fe56a35e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular210.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicular210.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PointAndPerpLine) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction','perpendicular') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,8 +32,8 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "parserAssignment.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -40,19 +42,21 @@ Context("Fraction"); Context()->variables->are(x=>'Real', y=>'Real'); Context()->noreduce('(-x)-y','(-x)+y'); -$numM=1; -$denM=random(2,9,1); -$signM = random(-1,1,2); -$mm = Fraction($numM,$denM)*$signM; -$bm = non_zero_random(-5,5,1); +do { + $numM=1; + $denM=random(2,9,1); + $signM = random(-1,1,2); + $mm = Fraction($numM,$denM)*$signM; + $bm = non_zero_random(-5,5,1); -$numN = $denM; -$denN = $numM; -$mn = -1*$signM*Fraction($numN,$denN); -do {$bn=non_zero_random(-5,5,1);} until ($bn!=$bm); + $numN = $denM; + $denN = $numM; + $mn = -1*$signM*Fraction($numN,$denN); + do {$bn=non_zero_random(-5,5,1);} until ($bn!=$bm); -$x1=$denN*non_zero_random(-5,5,1); -$y1=$mn*$x1+$bn; + $x1=$denN*non_zero_random(-5,5,1); + $y1=$mn*$x1+$bn; +} until ($y1!=0); if ($signM>0) { $lineMLeft = Compute("x-$denM*y")->reduce; @@ -111,7 +115,7 @@ Line [`k`] has the equation [`[$lineMLeft]=[$lineMRight]`]. Line [`\ell`] is perpendicular to line [`k`] and passes through the point [`([$x1],[$y1])`]. -Find line [`\ell`]'s equation in both slope-intercept form and point-slope form using the given point. +Find line [`\ell`]'s equation in both slope-intercept form and point-slope form. An equation for [`\ell`] in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. @@ -131,6 +135,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -138,6 +143,7 @@ ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA150.pg new file mode 100644 index 0000000000..2c745a1130 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA150.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Line k's equation is given in y=Mx+B form. +# Line ell is parallel to k, and a point on line ell is given. +# Find line ell's equation. +# +# Last edited: Yao 9/12/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','parallel') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); + +do {$m=non_zero_random(-5,5,1);} until (abs($m)!=1); +$bk = non_zero_random(-5,5,1); +do {$bl = non_zero_random(-10,10,1);} until ($bl != $bk); + +$k = Formula("$m x + $bk")->reduce; +$l = Formula("$m x + $bl")->reduce; + +$x1 = non_zero_random(-5,5,1); +$y1 = $l->eval(x=>$x1); + +$lPS = Formula("$m(x - $x1)+$y1")->reduce; + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +parser::Assignment->Allow; +$ansPS = Formula("y=$lPS")->reduce; +$ansSI = Formula("y=$l")->reduce; + +$PSeval = $ansPS->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); + +$SIeval = $ansSI->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Line [`k`] has the equation [`y=[$k]`]. + +Line [`\ell`] is parallel to line [`k`], but passes through the point [`([$x1],[$y1])`]. + +Find an equation for line [`\ell`] in both point-slope form and slope-intercept form. + + An equation for [`\ell`] in point-slope form is: [_______________]{$PSeval}. + + An equation for [`\ell`] in slope-intercept form is: [_______________]{$SIeval}. + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +When two lines are parallel, they have the same slope. Since line [`k`]'s slope is [`[$m]`], line [`\ell`]'s slope is also [`[$m]`]. + +Now we know line [`\ell`]'s slope, and a point on it: [` ([$x1],[$y1]) `]. We substitute these numbers into the generic formula for a point-slope equation for a line: + + [``y=m(x-x_{1})+y_{1}``] + +and we have: + + [``[$ansPS]``] + +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and expand and simplify the right side. + + [`` +\begin{aligned} + y &= [$lPS]\\ + y &= [$m]x - [$m]([$x1]) +[$y1]\\ + y &= [$l] +\end{aligned} +``] + + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA160.pg index 140c81fed3..6c4fea5611 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA160.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction','parallel') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,66 +30,75 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserImplicitPlane.pl", + "contextFraction.pl", "parserAssignment.pl", + "bizarroArithmetic.pl", "PGcourse.pl", - "contextFraction.pl", ); ############################################## Context("Fraction"); -Context()->variables->are(x=>'Real', y=>'Real'); -Context()->noreduce('(-x)-y','(-x)+y','(-x)*y','x*(-y)','-n'); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); $num = random(1,9,1); $den = random(2,9,1); while (gcd($num,$den)!=1) {$den = random(2,9,1);} $m= -Fraction($num,$den); -$b=non_zero_random(-5,5,1); +$bl=non_zero_random(-5,5,1); +do {$bk = non_zero_random(-10,10,1);} until ($bk != $bl); -$x1=$den*non_zero_random(-3,3,1); -$y1=$m*$x1+$b; +$k = Formula("$m x + $bk")->reduce; +$l = Formula("$m x + $bl")->reduce; -do {$b1=non_zero_random(-10,10,1);} until ($b1!=$b); -$lineM = Compute("$m*x+$b1")->reduce; -$lineNSI = Compute("$m*x+$b")->reduce; -$lineNPSLeft = Compute("y-$y1")->reduce; -$lineNPSRight = Compute("$m*(x-$x1)")->reduce; +$x1 = non_zero_random(-3,3,1); +$y1 = $l->eval(x=>$x1); +$lPS = Formula("$m(x - $x1)+$y1")->reduce; -Context("ImplicitPlane"); -Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real', y=>'Real'); +Context("Fraction"); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); -Context()->texStrings; -$absX1 = abs($x1); -$absY1 = abs($y1); -if (($x1>0) && ($y1>0)) { - $ansPSstringTeX = "y-$y1=$m(x-$x1)"; -} elsif (($x1<0) && ($y1>0)) { - $ansPSstringTeX = "y-$y1=$m(x+$absX1)"; -} elsif (($x1>0) && ($y1<0)) { - $ansPSstringTeX = "y+$absY1=$m(x-$x1)"; -} else { - $ansPSstringTeX = "y+$absY1=$m(x+$absX1)"; -} -$ansSIstringTeX = "y=$m x+$b"; -Context()->normalStrings; -$ansPSstring = "$lineNPSLeft=$lineNPSRight"; - -$ansPS = ImplicitPlane($ansPSstring); -#$ansPS = ImplicitPlane("y-$y1=$m(x-$x1)"); - -Context("Numeric"); -Context()->noreduce('(-x)-y','(-x)+y','(-x)*y','x*(-y)','-n'); -Context()->variables->are(x=>'Real', y=>'Real'); -Context()->flags->set(reduceConstants=>0); parser::Assignment->Allow; -$ansSI=Compute("y=x+$b")->reduce; -$ansSI=$ansSI->substitute(x=>Formula("$m x")); +$ansPS = Formula("y=$lPS")->reduce; +$ansSI = Formula("y=$l")->reduce; + +$PSeval = $ansPS->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); + +$SIeval = $ansSI->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); ############################################## @@ -95,89 +107,42 @@ TEXT(beginproblem()); BEGIN_PGML -Line [`k`] has the equation [`y=[$lineM]`]. +Line [`k`] has the equation [`y=[$k]`]. -Line [`\ell`] is parallel to line [`k`], but passes through the point [`([$x1],[$y1])`]. +Line [`\ell`] is parallel to line [`k`], but passes through the point [`([$x1],[$y1])`]. -Find an equation for line [`\ell`] in both slope-intercept form and point-slope form. +Find an equation for line [`\ell`] in both point-slope form and slope-intercept form. - An equation for [`\ell`] in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. + An equation for [`\ell`] in point-slope form is: [_______________]{$PSeval}. - An equation for [`\ell`] in point-slope form is: [_______________]. + An equation for [`\ell`] in slope-intercept form is: [_______________]{$SIeval}. END_PGML ############################################## -Context()->flags->set(reduceConstants=>0); -Context()->flags->set(reduceConstantFormulas=>0); - -ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX - ) -> withPostFilter(sub { - my $ansHash = shift; - my $student = $ansHash->{original_student_ans}; - my @sides = split('=',"$student"); - - #if it's an implicit plane object, reset how student's answer is displayed: - if (defined $ansHash->{student_formula}) { - if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { - $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; - my $leftTex = Formula("$sides[0]")->TeX; - my $rightTex = Formula("$sides[1]")->TeX; - $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; - $ansHash->{student_ans} = $ansHash->{original_student_ans}; - } - }; - - #if they have the line correct, then check each side to see if the sides are correct - if ($ansHash->{score}) { - if (Formula("y-$y1") != Formula("$sides[0]") and Formula("y-$y1") != Formula("$sides[1]")) { - $ansHash->{score} = 0; - $ansHash->{ans_message} = "This is an equation for the line, but it is not the point-slope equation that uses the given point"; - } - } - return $ansHash; - })); - - -$absmx1 = -$m*$x1; -$absy1 = abs($y1); -$step = ($y1>0) ? "\mathbf{{}+$y1}" : "\mathbf{{}-$absy1}"; - BEGIN_PGML_SOLUTION When two lines are parallel, they have the same slope. Since line [`k`]'s slope is [`[$m]`], line [`\ell`]'s slope is also [`[$m]`]. Now we know line [`\ell`]'s slope, and a point on it: [` ([$x1],[$y1]) `]. We substitute these numbers into the generic formula for a point-slope equation for a line: - [``y-y_{1}=m(x-x_{1})``] + [``y=m(x-x_{1})+y_{1}``] and we have: - [`` -\begin{aligned} - y-y_{1} &= m(x-x_{1}) \\ - y-([$y1]) &= [$m][x-([$x1])] \\ - [$lineNPSLeft] &= [$lineNPSRight] -\end{aligned} -``] - -So the line has an equation in point-slope form: [`[$ansPSstringTeX]`]. - ----- + [``[$ansPS]``] -The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and solve for [`y`]. +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and expand and simplify the right side. [`` \begin{aligned} - [$lineNPSLeft] &= [$lineNPSRight]\\ - [$lineNPSLeft] &= [$m]x+[$absmx1]\\ - [$lineNPSLeft] [$step] &= [$m]x+[$absmx1] [$step]\\ - y &= [$m]x+[$b]\\ + y &= [$lPS]\\ + y &= [$m]x - [$m]([$x1]) +[$y1]\\ + y &= [$l] \end{aligned} ``] -So the line's equation in slope-intercept form is [`[$ansSIstringTeX]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA170.pg new file mode 100644 index 0000000000..c3b58f6c79 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA170.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Line k's equation is given in y=Mx+B form. M is either 1 or -1. +# Line ell is perpendicular to k, and a point on line ell is given. +# Find line ell's equation. +# +# Last edited: Yao 9/12/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','perpendicular') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); + +$mk = random(-1,1,2); +$bk = non_zero_random(-10,10,1); + +$ml = -$mk; +do {$bl = non_zero_random(-5,5,1);} until ($bl != $bk); + +$k = Formula("$mk x + $bk")->reduce; +$l = Formula("$ml x + $bl")->reduce; + +do { + $x1 = non_zero_random(-5,5,1); + $y1 = $l->eval(x=>$x1); +} until ($y1!=0); + +$lPS = Formula("$ml(x - $x1)+$y1")->reduce; + +parser::Assignment->Allow; +$ansPS = Formula("y=$lPS")->reduce; +$ansSI = Formula("y=$l")->reduce; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Line [`k`] has the equation [`y=[$k]`]. + +Line [`\ell`] is perpendicular to line [`k`], and passes through the point [`([$x1],[$y1])`]. + +Find an equation for line [`\ell`]. + + [_______________]{$ansSI} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When two lines are perpendicular, the product of their slopes is [`-1`]. Since line [`k`]'s slope is [`[$mk]`], line [`\ell`]'s slope must be [`[$ml]`]. + +Now we know line [`\ell`]'s slope, and a point on it: [` ([$x1],[$y1]) `]. We substitute these numbers into the generic formula for a point-slope equation for a line: + + [``y=m(x-x_{1})+y_{1}``] + +and we have: + + [``[$ansPS]``] + +This simplifies to: + + [``[$ansSI]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA180.pg new file mode 100644 index 0000000000..e7c3aa2244 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA180.pg @@ -0,0 +1,165 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Line k's equation is given in Ax+By=C form. +# Line ell is parallel to k, and a point on line ell is given. +# Find line ell's equation. +# +# Last edited: Yao 9/12/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction','parallel') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); + +$num = random(1,9,1); +$den = random(2,9,1); +while (gcd($num,$den)!=1) {$den = random(2,9,1);} + +$m = Fraction($num,$den); +$bk = non_zero_random(-5,5,1); +do {$bl = non_zero_random(-5,5,1);} until ($bk != $bl); + +$kleft = Formula("$num*x-$den*y")->reduce; +$kright = Formula("-$bk*$den"); +$k = Formula("$m x + $bk")->reduce; +$l = Formula("$m x + $bl")->reduce; + +$x1 = $den*non_zero_random(-3,3,1); +$y1 = $l->eval(x=>$x1); + +$lPS = Formula("$m(x - $x1)+$y1")->reduce; + +Context("Fraction"); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +parser::Assignment->Allow; +$ansPS = Formula("y=$lPS")->reduce; +$ansSI = Formula("y=$l")->reduce; + +$PSeval = $ansPS->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); + +$SIeval = $ansSI->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Line [`k`] has the equation [`[$kleft]=[$kright]`]. + +Line [`\ell`] is parallel to line [`k`], but line [`\ell`] passes through the point [`([$x1],[$y1])`]. + +Find an equation for line [`\ell`] in both point-slope form and slope-intercept form. + + An equation for [`\ell`] in point-slope form is: [_______________]{$PSeval}. + + An equation for [`\ell`] in slope-intercept form is: [_______________]{$SIeval}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION +First, we find line [`k`]'s slope: + + [`` +\begin{aligned} + [$kleft] &= [$kright] \\ + &\vdots\\ + y &= [$k] +\end{aligned} + ``] + +We can see line [`k`]'s slope is [`[$m]`]. + +When two lines are parallel, they have the same slope. Since line [`k`]'s slope is [`[$m]`], line [`\ell`]'s slope is also [`[$m]`]. + +Now we know line [`\ell`]'s slope, and a point on it: [` ([$x1],[$y1]) `]. We substitute these numbers into the generic formula for a point-slope equation for a line: + + [``y=m(x-x_{1})+y_{1}``] + +and we have: + + [``[$ansPS]``] + +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and expand and simplify the right side. + + [`` +\begin{aligned} + y &= [$lPS]\\ + y &= [$m]x - [$m]([$x1]) +[$y1]\\ + y &= [$l] +\end{aligned} +``] + + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA190.pg new file mode 100644 index 0000000000..38f0a21e90 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA190.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Line k's equation is given in y=Mx+B form. M is an integer. +# Line ell is perpendicular to k, and a point on line ell is given. +# Find line ell's equation. +# +# Last edited: Yao 9/12/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction','perpendicular') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); + +$mk = random(2,6,1)*random(-1,1,2); +$bk = non_zero_random(-5,5,1); +do {$bl = non_zero_random(-5,5,1);} until ($bl != $bk); +$ml = Fraction(-1,$mk); + +$k = Formula("$mk x + $bk")->reduce; +$l = Formula("$ml x + $bl")->reduce; + +$x1 = non_zero_random(-3,3,1); +$y1 = $l->eval(x=>$x1); + +$lPS = Formula("$ml (x - $x1)+$y1")->reduce; + +Context("Fraction"); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +parser::Assignment->Allow; +$ansPS = Formula("y=$lPS")->reduce; +$ansSI = Formula("y=$l")->reduce; + +$PSeval = $ansPS->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); + +$SIeval = $ansSI->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Line [`k`] has the equation [`y=[$k]`]. + +Line [`\ell`] is perpendicular to line [`k`] and passes through the point [`([$x1],[$y1])`]. + +Find an equation for line [`\ell`] in both point-slope form and slope-intercept form. + + An equation for [`\ell`] in point-slope form is: [_______________]{$PSeval}. + + An equation for [`\ell`] in slope-intercept form is: [_______________]{$SIeval}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +When two lines are perpendicular, the product of their slopes is [`-1`]. It's given that line [`k`]'s slope is [`[$mk]`]. So the slope of [`\ell`] must be [`[$ml]`]. + +Now we know line [`\ell`]'s slope, and a point on it: [` ([$x1],[$y1]) `]. We substitute these numbers into the generic formula for a point-slope equation for a line: + + [``y=m(x-x_{1})+y_{1}``] + +and we have: + + [``[$ansPS]``] + +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and expand and simplify the right side. + + [`` +\begin{aligned} + y &= [$lPS]\\ + y &= [$ml]x - [$ml]([$x1]) +[$y1]\\ + y &= [$l] +\end{aligned} +``] + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA200.pg new file mode 100644 index 0000000000..642e7499f4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA200.pg @@ -0,0 +1,156 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Line k's equation is given in y=Mx+B form. M is a fraction. +# Line ell is perpendicular to k, and a point on line ell is given. +# Find line ell's equation. +# +# Last edited: Yao 9/12/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction','perpendicular') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); + + +$numM=random(2,9,1); +do {$denM=random(2,9,1);} until (gcd($numM,$denM)==1); +$signM = random(-1,1,2); +$mk = Fraction($numM,$denM)*$signM; +$bk = non_zero_random(-5,5,1); + +$numN = $denM; +$denN = $numM; +$ml = -1*$signM*Fraction($numN,$denN); +do {$bl = non_zero_random(-5,5,1);} until ($bl != $bk); +$mk = -1/$ml; + +$k = Formula("$mk x + $bk")->reduce; +$l = Formula("$ml x + $bl")->reduce; + +$x1 = non_zero_random(-3,3,1); +$y1 = $l->eval(x=>$x1); + +$lPS = Formula("$ml(x - $x1)+$y1")->reduce; + +Context("Fraction"); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +parser::Assignment->Allow; +$ansPS = Formula("y=$lPS")->reduce; +$ansSI = Formula("y=$l")->reduce; + +$PSeval = $ansPS->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); + +$SIeval = $ansSI->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Line [`k`]'s equation is [`y=[$k]`]. + +Line [`\ell`] is perpendicular to line [`k`] and passes through the point [`([$x1],[$y1])`]. + +Find an equation for line [`\ell`] in both point-slope form and slope-intercept form. + + An equation for [`\ell`] in point-slope form is: [_______________]{$PSeval}. + + An equation for [`\ell`] in slope-intercept form is: [_______________]{$SIeval}. + +END_PGML + +############################################## + + + +BEGIN_PGML_SOLUTION + +When two lines are perpendicular, the product of their slopes is [`-1`]. It's given that line [`k`]'s slope is [`[$mk]`]. So the slope of [`\ell`] must be [`[$ml]`]. + +Now we know line [`\ell`]'s slope, and a point on it: [` ([$x1],[$y1]) `]. We substitute these numbers into the generic formula for a point-slope equation for a line: + + [``y=m(x-x_{1})+y_{1}``] + +and we have: + + [``[$ansPS]``] + +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and expand and simplify the right side. + + [`` +\begin{aligned} + y &= [$lPS]\\ + y &= [$ml]x - [$ml]([$x1]) +[$y1]\\ + y &= [$l] +\end{aligned} +``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA210.pg index 1f12da2cad..6d9a0f0bb6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA210.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA210.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction','perpendicular') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,80 +30,86 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserImplicitPlane.pl", + "contextFraction.pl", "parserAssignment.pl", + "bizarroArithmetic.pl", "PGcourse.pl", - "contextFraction.pl", ); ############################################## Context("Fraction"); -Context()->variables->are(x=>'Real', y=>'Real'); -Context()->noreduce('(-x)-y','(-x)+y'); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); do { - $numM=1; - $denM=random(2,9,1); - $signM = random(-1,1,2); - $mm = Fraction($numM,$denM)*$signM; - $bm = non_zero_random(-5,5,1); - - $numN = $denM; - $denN = $numM; - $mn = -1*$signM*Fraction($numN,$denN); - do {$bn=non_zero_random(-5,5,1);} until ($bn!=$bm); - - $x1=$denN*non_zero_random(-5,5,1); - $y1=$mn*$x1+$bn; -} until ($y1!=0); - -if ($signM>0) { - $lineMLeft = Compute("x-$denM*y")->reduce; - $lineMRight = -$bm*$denM; -} else { - $lineMLeft = Compute("x+$denM*y")->reduce; - $lineMRight = $bm*$denM; -} + $numk = random(-1,1,2); + $denk = random(2,9,1); + $mk = Fraction($numk,$denk); + $bk = non_zero_random(-5,5,1); -$lineMSI = Compute("$mm*x+$bm")->reduce; + $ml = -1/$mk; + do {$bl = non_zero_random(-5,5,1);} until ($bl != $bk); -$lineNSI = Compute("$mn*x+$bn")->reduce; -$lineNPSLeft = Compute("y-$y1")->reduce; -$lineNPSRight = Compute("$mn*(x-$x1)")->reduce; + $k = Formula("$mk x + $bk")->reduce; + $l = Formula("$ml x + $bl")->reduce; + $x1 = $numk*non_zero_random(-5,5,1); + $y1 = $l->eval(x=>$x1); +} until ($y1!=0); -Context("ImplicitPlane"); -Context()->flags->set(showExtraParens=>0); -Context()->variables->are(x=>'Real', y=>'Real'); -Context()->flags->set(showExtraParens=>0); -Context()->texStrings; -$absX1 = abs($x1); -$absY1 = abs($y1); -if (($x1>0) && ($y1>0)) { - $ansPSstringTeX = "y-$y1=$mn(x-$x1)"; -} elsif (($x1<0) && ($y1>0)) { - $ansPSstringTeX = "y-$y1=$mn(x+$absX1)"; -} elsif (($x1>0) && ($y1<0)) { - $ansPSstringTeX = "y+$absY1=$mn(x-$x1)"; +if ($numk>0) { + $kleft = Compute("x-$denk*y")->reduce; + $kright = -$bk*$denk; } else { - $ansPSstringTeX = "y+$absY1=$mn(x+$absX1)"; + $kleft = Compute("x+$denk*y")->reduce; + $kright = $bk*$denk; } -$ansSIstringTeX = "y=$mn x+$bn"; -Context()->normalStrings; -$ansPSstring = "$lineNPSLeft=$lineNPSRight"; -$ansPS = ImplicitPlane($ansPSstring); +$lPS = Formula("$ml(x - $x1)+$y1")->reduce; -Context("Numeric"); -Context()->noreduce('(-x)-y','(-x)+y'); -Context()->variables->are(x=>'Real', y=>'Real'); -Context()->flags->set(reduceConstants=>0); -parser::Assignment->Allow; -$ansSI=Compute("y=x+$bn")->reduce; -$ansSI=$ansSI->substitute(x=>Formula("$mn x")); +Context("Fraction"); +Context()->noreduce('(-x)+y','(-x)-y'); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); +parser::Assignment->Allow; +$ansPS = Formula("y=$lPS")->reduce; +$ansSI = Formula("y=$l")->reduce; + +$PSeval = $ansPS->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); + +$SIeval = $ansSI->cmp(checker => sub { + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $correct = Formula("$correct"); + $student = Formula("$student"); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form.") unless $OK; + return $OK; +}); ############################################## @@ -108,129 +117,59 @@ TEXT(beginproblem()); BEGIN_PGML -Line [`k`] has the equation [`[$lineMLeft]=[$lineMRight]`]. +Line [`k`] has the equation [`[$kleft]=[$kright]`]. Line [`\ell`] is perpendicular to line [`k`] and passes through the point [`([$x1],[$y1])`]. -Find line [`\ell`]'s equation in both slope-intercept form and point-slope form. +Find an equation for line [`\ell`] in both point-slope form and slope-intercept form. - An equation for [`\ell`] in slope-intercept form is: [_______________]{$ansSI->cmp(correct_ans_latex_string => $ansSIstringTeX)}. + An equation for [`\ell`] in point-slope form is: [_______________]{$PSeval}. + + An equation for [`\ell`] in slope-intercept form is: [_______________]{$SIeval}. - An equation for [`\ell`] in point-slope form is: [_______________]. END_PGML ############################################## -Context()->flags->set(reduceConstants=>0); -Context()->flags->set(reduceConstantFormulas=>0); - -ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX - ) -> withPostFilter(sub { - my $ansHash = shift; - my $student = $ansHash->{original_student_ans}; - my @sides = split('=',"$student"); - - #if it's an implicit plane object, reset how student's answer is displayed: - if (defined $ansHash->{student_formula}) { - if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { - $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; - my $leftTex = Formula("$sides[0]")->TeX; - my $rightTex = Formula("$sides[1]")->TeX; - $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; - $ansHash->{student_ans} = $ansHash->{original_student_ans}; - } - }; - - #if they have the line correct, then check each side to see if the sides are correct - if ($ansHash->{score}) { - if (Formula("y-$y1") != Formula("$sides[0]") and Formula("y-$y1") != Formula("$sides[1]")) { - $ansHash->{score} = 0; - $ansHash->{ans_message} = "This is an equation for the line, but it is not the point-slope equation that uses the given point"; - } - } - return $ansHash; - })); - -################################################################ - -$s2=$signM*$numM; -$neg1 = $signM>0 ? "" : "-"; - -$s1 = -$mn*$x1; -$absS1 = abs($s1); -$s1Output = $s1>0 ? "+$s1" : "-$absS1"; - -$absY1 = abs($y1); -$y1Output = $y1>0 ? "+$absY1" : "-$absY1"; - BEGIN_PGML_SOLUTION -First, we need to find line [`k`]'s slope: - - [`` -\begin{aligned} - [$lineMLeft] &= [$lineMRight] \\ - [$lineMLeft] \mathbf{-x} &= [$lineMRight] \mathbf{-x} \\ - [$denM*$signM*-1]y &= -x+[$lineMRight] \\ - \frac{[$denM*$signM*-1]y}{[$denM*$signM*-1]} &= \frac{-x}{[$denM*$signM*-1]} + \frac{[$lineMRight]}{[$denM*$signM*-1]} \\ - y &= [$lineMSI] -\end{aligned} - ``] - -When two lines are perpendicular, the product of their slopes is [`-1`]. We just found that line [`k`]'s slope is [`[$mm]`]. Assume line [`\ell`]'s slope is [`s`], and we have: +First, we find line [`k`]'s slope: [`` \begin{aligned} - [$mm]\cdot s &= -1 \\ - [$denM*$signM] \cdot \left([$mm]\right)\cdot s &= [$denM*$signM] \cdot (-1) \\ - s &= [$mn] + [$kleft] &= [$kright] \\ + &\vdots\\ + y &= [$k] \end{aligned} ``] -We found that line [`\ell`]'s slope is [`[$mn]`]. +We can see line [`k`]'s slope is [`[$mk]`]. -An easier method to find line [`\ell`]'s slope is to find the negative reciprocal of line [`k`]'s slope: -1. Identify line [`k`]'s slope: [` [$mm] `] -2. Flip line [`k`]'s slope: [` [$neg1]\frac{[$denM]}{[$numM]} =[$neg1][$denM]`] -3. Change the sign of the number: [` [$mn] `] +When two lines are perpendicular, the product of their slopes is [`-1`]. We just found that line [`k`]'s slope is [`[$mk]`]. So the slope ov [`\ell`] must be [`[$ml]`]. -Now we know line [`\ell`]'s slope, [`[$mn]`], and a point on it, [` ([$x1],[$y1]) `]. We substitute these numbers into the generic formula of a line's point-slope form equation: +Now we know line [`\ell`]'s slope, and a point on it: [` ([$x1],[$y1]) `]. We substitute these numbers into the generic formula for a point-slope equation for a line: - [`y-y_{1}=m(x-x_{1})`] + [``y=m(x-x_{1})+y_{1}``] and we have: - [` -\begin{aligned} - y-y_{1} &= m(x-x_{1}) \\ - y-([$y1]) &= [$mn][x-([$x1])] \\ - [$lineNPSLeft] &= [$lineNPSRight] -\end{aligned} -`] - -So the line has an equation in point-slope form: [`[$ansPSstringTeX] `]. - ----- + [``[$ansPS]``] -The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and solve for [`y`]. +The slope-intercept form of a line equation looks like [`y=mx+b`], where [`m`] is the slope and [`b`] is the [`y`]-intercept. We can take the point-slope form and expand and simplify the right side. [`` \begin{aligned} - [$lineNPSLeft] &= [$lineNPSRight]\\ - [$lineNPSLeft] &= [$mn]x+\left([$mn]\right)([$x1*-1]) \\ - [$lineNPSLeft] &= [$mn]x[$s1Output]\\ - [$lineNPSLeft] \mathbf{{}[$y1Output]} &= [$mn]x[$s1Output]\mathbf{{}[$y1Output]}\\ - y &= [$lineNSI] \\ + y &= [$lPS]\\ + y &= [$ml]x - [$ml]([$x1]) +[$y1]\\ + y &= [$l] \end{aligned} - ``] - -So the line's equation in slope-intercept form is [`[$ansSIstringTeX]`]. +``] +END_PGML_SOLUTION -END_PGML_SOLUTION ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics10.pg index 8c12e0d720..332857b65c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics10.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: point-slope form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(InterpretPointSlope) -## MLTleader(1) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics20.pg index 1e4f36bf79..b5f0e1bdbc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: point-slope form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(InterpretPointSlope) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics30.pg index 2d40f52489..9f38e4a640 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasics30.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: point-slope form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(InterpretPointSlope) -## Level(4) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','fraction') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +32,7 @@ loadMacros( "PGML.pl", "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA10.pg index 9e2f298f26..b41c96f03b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: point-slope form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA20.pg index 24138a4f68..ef32e5dd0e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA20.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: point-slope form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA30.pg index 0a2a269669..27305d4ba1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA30.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: point-slope form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','fraction') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA40.pg new file mode 100644 index 0000000000..cf1da52dff --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeBasicsORCCA40.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given an equation in point-slope form, identify the line's slope +# and a point on the line. The slope is a fraction. +# The point has negative x value. +# +# Last edited: Jordan 8/30/13; Yao 7/8/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','fraction') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "answerHints.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->variables->add(y=>'Real'); + +$num=random(1,9,1); +$den=random(2,9,1); +while (gcd($num,$den)!=1) {$den=random(2,9,1);} + +$m=Fraction($num,$den)*random(-1,1,2); +$b=non_zero_random(-5,5,1); + +$x1=$den*random(1,3,1); +$y1=$m*$x1+$b; + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(reduceConstants=>0); +Context()->noreduce('(-x)-y','(-x)+y'); + +$left = Formula("y")->reduce; +$right = Formula("(x-$x1)")->reduce; +$prec = Context()->operators->get('/')->{precedence} - 0.1; +Context()->operators->set( + 'u-' => {class => "context::Fraction::UOP::minus",precedence => $prec} +); +Context()->flags->set(showExtraParens=>0); +$right = Formula("$m*$right+$y1"); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$pt = Point("($x1,$y1)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line's equation is given in point-slope form: + + [`` [$left]=[$right] ``] + + This line's slope is [_____]{$m}. + + A point on this line that is apparent from the given equation is [__________]. + +END_PGML + +ANS($pt->cmp()->withPostFilter(AnswerHints( + sub{ + my ($correct, $student, $ans) = @_; + if ($student->class eq "Point") { + ($sx,$sy) = $student->value; + return 1 if ($left->eval(x=>$sx,y=>$sy) == $right->eval(x=>$sx,y=>$sy)); + return 0; + } + } => ["This point is on the line, but it is not the one that is immediately apparent just from looking at the equation", replaceMessage=>1] +))); + +############################################## + +BEGIN_PGML_SOLUTION + +Compare the given equation with a generic point-slope equation: + + [`` +\begin{aligned} + y &= m(x-x_{1})+y_1 \\ + [$left] &= [$right]) +\end{aligned} +``] + +We can see the slope is [``[$m]``], and an apparent point on the line [`(x_{1},y_{1})`] is [`[$pt]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept10.pg index 17a2166f6d..8404646e2a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept10.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PointSlopeToSlopeIntercept) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserAssignment.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept20.pg index 1dee8fb8bf..e19f8a0c18 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PointSlopeToSlopeIntercept) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserAssignment.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept30.pg index 2398045ef1..755e65c204 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept30.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PointSlopeToSlopeIntercept) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGML.pl", "parserAssignment.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept40.pg index da96a409a4..4c5d116848 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept40.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(PointSlopeToSlopeIntercept) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGML.pl", "parserAssignment.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA10.pg new file mode 100644 index 0000000000..6c7c7a2a89 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA10.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change a line's equation from point-slope form to slope-intercept form. +# Slope is positive. +# +# Last edited: Jordan 8/30/13; Yao 7/8/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') +## KEYWORDS('slope','linear','equation','point-slope','slope-intercept') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(x=>'Real', y=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(showExtraParens=>0); +Context()->noreduce('(-x)-y','(-x)+y','(-x)*y','x*(-y)','-n'); + +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + + +$m=random(2,5,1); +$b=non_zero_random(-5,5,1); + +$x1=non_zero_random(-5,5,1); +$y1=$m*$x1+$b; + +$left = Formula("y")->reduce; +$right = Formula("$m*(x-$x1)+$y1")->reduce; + +$ansSI=Formula("y=$m*x+$b")->reduce; + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change this equation from point-slope form to slope-intercept form. + + [` [$left]=[$right] `] + + In slope-intercept form: [____________________] + +END_PGML + +############################################## + +ANS($ansSI -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected slope-intercept form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + + +$s1 = -$m*$x1; +$s2 = $s1+$y1; + +BEGIN_PGML_SOLUTION + + [` +\begin{aligned} + [$left] &= [$right] \\ + [$left] &= [$m]x+[$s1]+[$y1] \\ + y &= [$m]x+[$b] +\end{aligned} +`] + +The line's equation in slope-intercept form is [`y=[$m]x+[$b]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA20.pg index f2a122e1ff..dacdb3d189 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA20.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -67,7 +71,7 @@ Change this equation from point-slope form to slope-intercept form. [` [$left]=[$right] `] - In slope-intercept form, this line's equation would be [_______________]. + In slope-intercept form: [____________________] END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA30.pg index 052202d1d9..69c0a6d5d3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA30.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -78,7 +82,7 @@ Change this equation from point-slope form to slope-intercept form. [`` [$left]=[$right] ``] - In slope-intercept form, this line's equation would be [_______________]. + In slope-intercept form: [____________________] END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA40.pg index 669b8b42fe..c6be149182 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA40.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Linear Equations') ## KEYWORDS('slope','linear','equation','point-slope','slope-intercept','fraction') +## DBCCSS('8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -87,7 +91,7 @@ Change this equation from point-slope form to slope-intercept form. [`` [$left1]=[$right1] ``] - In slope-intercept form, this line's equation would be [_______________]. + In slope-intercept form: [____________________] END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg index f73c2e2abd..a6081d4f23 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: point-slope form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ptslope2) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','point-slope') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -91,6 +93,7 @@ ANS($ansPS1->cmp(correct_ans_latex_string => $ansPSstringTeX1 my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -98,6 +101,7 @@ ANS($ansPS1->cmp(correct_ans_latex_string => $ansPSstringTeX1 $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg index 336c94fb9c..28935d15ae 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: point-slope form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ptslope2) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','point-slope') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserImplicitPlane.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -91,6 +93,7 @@ ANS($ansPS1->cmp(correct_ans_latex_string => $ansPSstringTeX1 my @sides = split('=',"$student"); #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; my $leftTex = Formula("$sides[0]")->TeX; @@ -98,6 +101,7 @@ ANS($ansPS1->cmp(correct_ans_latex_string => $ansPSstringTeX1 $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; $ansHash->{student_ans} = $ansHash->{original_student_ans}; } + }; #if they have the line correct, then check each side to see if the sides are correct if ($ansHash->{score}) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg index 7cd1445cdb..cb64d9cc58 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ptslope2) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','point-slope','fraction') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "parserImplicitPlane.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -37,7 +39,6 @@ Context("Fraction"); Context()->variables->add(y=>'Real'); Context()->noreduce('(-x)-y','(-x)+y'); Context()->flags->set(showExtraParens=>0); -$mainContext = Context(); $num=random(1,9,1); $den=random(2,9,1); @@ -81,7 +82,7 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`] in the [`x,y`]-plane. Find this line's equation in point-slope form. +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's equation in point-slope form. Using the point [`([$x1],[$y1])`], this line's point-slope form equation is [___________________]. @@ -95,57 +96,59 @@ END_PGML Context()->flags->set(reduceConstants=>0); Context()->flags->set(reduceConstantFormulas=>0); -ANS($ansPS1->cmp( - correct_ans_latex_string => $ansPSstringTeX1, - checker => sub{ - my ($correct,$student,$ansHash) = @_; - # reject if incorrect line - if ($correct != $student){ return 0; } - # check if student's answer is in correct form - my $studentString = $ansHash->{original_student_ans}; - my ($stuLeft, $stuRight) = split('=', $studentString); - my $context = Context(); - Context($mainContext); - $stuLeft = Formula($stuLeft); - $stuRight = Formula($stuRight); - $ansHash->{student_ans} = $studentString; - $ansHash->{preview_latex_string} = $stuLeft->TeX . "=" . $stuRight->TeX; - Context($context); - if ( ($left1 == $stuLeft and $right1 == $stuRight) or - ($left1 == $stuRight and $right1 == $stuLeft) - ) { return 1; } - else { - Value->Error("This is an equation for the line, but it is not the point-slope equation that uses the given point"); - return 0; - } - } -)); - -ANS($ansPS2->cmp( - correct_ans_latex_string => $ansPSstringTeX1, - checker => sub{ - my ($correct,$student,$ansHash) = @_; - # reject if incorrect line - if ($correct != $student){ return 0; } - # check if student's answer is in correct form - my $studentString = $ansHash->{original_student_ans}; - my ($stuLeft, $stuRight) = split('=', $studentString); - my $context = Context(); - Context($mainContext); - $stuLeft = Formula($stuLeft); - $stuRight = Formula($stuRight); - $ansHash->{student_ans} = $studentString; - $ansHash->{preview_latex_string} = $stuLeft->TeX . "=" . $stuRight->TeX; - Context($context); - if ( ($left2 == $stuLeft and $right2 == $stuRight) or - ($left2 == $stuRight and $right2 == $stuLeft) - ) { return 1; } - else { - Value->Error("This is an equation for the line, but it is not the point-slope equation that uses the given point"); - return 0; - } - } -)); +ANS($ansPS1->cmp(correct_ans_latex_string => $ansPSstringTeX1 + ) -> withPostFilter(sub { + my $ansHash = shift; + my $student = $ansHash->{original_student_ans}; + my @sides = split('=',"$student"); + + #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { + if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { + $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; + my $leftTex = Formula("$sides[0]")->TeX; + my $rightTex = Formula("$sides[1]")->TeX; + $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; + $ansHash->{student_ans} = $ansHash->{original_student_ans}; + } + }; + + #if they have the line correct, then check each side to see if the sides are correct + if ($ansHash->{score}) { + if (Formula("y-$y1") != Formula("$sides[0]") and Formula("y-$y1") != Formula("$sides[1]")) { + $ansHash->{score} = 0; + $ansHash->{ans_message} = "This is an equation for the line, but it is not the point-slope equation that uses the given point"; + } + } + return $ansHash; + })); + + + +ANS($ansPS2->cmp(correct_ans_latex_string => $ansPSstringTeX2 + ) -> withPostFilter(sub { + my $ansHash = shift; + my $student = $ansHash->{original_student_ans}; + my @sides = split('=',"$student"); + + #if it's an implicit plane object, reset how student's answer is displayed: + if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { + $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; + my $leftTex = Formula("$sides[0]")->TeX; + my $rightTex = Formula("$sides[1]")->TeX; + $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; + $ansHash->{student_ans} = $ansHash->{original_student_ans}; + } + + #if they have the line correct, then check each side to see if the sides are correct + if ($ansHash->{score}) { + if (Formula("y-$y2") != Formula("$sides[0]") and Formula("y-$y2") != Formula("$sides[1]")) { + $ansHash->{score} = 0; + $ansHash->{ans_message} = "This is an equation for the line, but it is not the point-slope equation that uses the given point"; + } + } + return $ansHash; + })); $s1=$y2-$y1; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquationORCCA10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquationORCCA10.pg new file mode 100644 index 0000000000..25a67b6893 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquationORCCA10.pg @@ -0,0 +1,168 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in point-slope form. +# All numbers are positive. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','point-slope') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$m=random(2,5,1); +$b=random(1,10,1); + +$x1=random(1,5,1); +$y1=$m*$x1+$b; +$x2=random(1,5,1); +while ($x2==$x1) {$x2=random(1,5,1);} +$y2=$m*$x2+$b; + +parser::Assignment->Allow; +$ansPS1 = ($y1!=0) ? Formula("y=$m(x-$x1)+$y1") : Formula("y=$m(x-$x1)"); +$ansPS2 = ($y2!=0) ? Formula("y=$m(x-$x2)+$y2") : Formula("y=$m(x-$x2)"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's equation in point-slope form. + + Using the point [`([$x1],[$y1])`], this line's point-slope form equation is [___________________]. + + Using the point [`([$x2],[$y2])`], this line's point-slope form equation is [___________________]. + +END_PGML + +############################################## + + +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFormulas=>0); + +ANS($ansPS1 -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + + +ANS($ansPS2 -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +A line's equation in point-slope form looks like [` y=m(x-x_{0})+y_0 `] where [`m`] is the slope of the line and [`(x_{0},y_{0})`] is a point that the line passes through. We first need to find the line's slope. + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +We mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these values into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m]\end{aligned} ``] + +Now we have [` y=[$m](x-x_{0})+y_0 `]. The next step is to use a point that we know the line passes through. + +If we choose to use the point [`([$x1],[$y1])`], we have: + + [` +\begin{aligned} + y &= m(x-x_{0})+y_0 \\ + y &= [$m](x-[$x1])+[$y1] +\end{aligned} +`] + +If we choose to use the point [`([$x2],[$y2])`], we have: + + [` +\begin{aligned} + y &= m(x-x_{0})+y_0 \\ + y &= [$m](x-[$x2])+[$y2] +\end{aligned} +`] + +Note that these two equations are equivalent. You will see why once you change both equations to slope-intercept form. This is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquationORCCA20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquationORCCA20.pg new file mode 100644 index 0000000000..0c341592a9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquationORCCA20.pg @@ -0,0 +1,168 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in point-slope form. +# Slope is negative. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','point-slope') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + +$m=-random(2,5,1); +$b=random(1,10,1); + +$x1=random(-5,5,1); +$y1=$m*$x1+$b; +$x2=random(-5,5,1); +while ($x2==$x1) {$x2=random(-5,5,1);} +$y2=$m*$x2+$b; + +parser::Assignment->Allow; +$ansPS1 = ($y1!=0) ? Formula("y=$m(x-$x1)+$y1") : Formula("y=$m(x-$x1)"); +$ansPS2 = ($y2!=0) ? Formula("y=$m(x-$x2)+$y2") : Formula("y=$m(x-$x2)"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's equation in point-slope form. + + Using the point [`([$x1],[$y1])`], this line's point-slope form equation is [___________________]. + + Using the point [`([$x2],[$y2])`], this line's point-slope form equation is [___________________]. + +END_PGML + +############################################## + + +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFormulas=>0); + +ANS($ansPS1 -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + + +ANS($ansPS2 -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +A line's equation in point-slope form looks like [` y=m(x-x_{0})+y_{0} `] where [`m`] is the slope of the line and [`(x_{0},y_{0})`] is a point that the line passes through. We first need to find the line's slope. + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +We mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these values into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m]\end{aligned} ``] + +Now we have [` y=[$m](x-x_{0})+y_{0} `]. The next step is to use a point that we know the line passes through. + +If we choose to use the point [`([$x1],[$y1])`], we have: + + [` +\begin{aligned} + y&= m(x-x_{0})+y_0 \\ + y &= [$m](x-[$x1])+[$y1] +\end{aligned} +`] + +If we choose to use the point [`([$x2],[$y2])`], we have: + + [` +\begin{aligned} + y&= m(x-x_{0})+y_0 \\ + y &= [$m](x-[$x2])+[$y2] +\end{aligned} +`] + +Note that these two equations are equivalent. You will see why once you change both equations to slope-intercept form. This is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquationORCCA30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquationORCCA30.pg new file mode 100644 index 0000000000..5ac512549a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquationORCCA30.pg @@ -0,0 +1,193 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in point-slope form. +# Slope is a positive fraction. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','point-slope','fraction') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "bizarroArithmetic.pl", + "contextFraction.pl", + "PGcourse.pl", + "PGinfo.pl", +); + +############################################## + +Context("Fraction"); +Context()->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y','x-0'); +Context()->flags->set(showExtraParens=>0); + +$num=random(1,9,1); +$den=random(2,9,1); +while (gcd($num,$den)!=1) {$den=random(2,9,1);} + +$m=Fraction($num,$den); +$b=non_zero_random(-10,10,1); + +$x1=$den*random(-3,3,1); +$y1=$m*$x1+$b; +$x2=$den*random(-3,3,1); +while ($x2==$x1) {$x2=$den*random(-3,3,1);} +$y2=$m*$x2+$b; + +$left1 = Formula("y")->reduce; +$right1 = Formula("$m*(x-$x1)+$y1")->reduce; +$left2 = Formula("y")->reduce; +$right2 = Formula("$m*(x-$x2)+$y2")->reduce; + +if ($x1 == 0) {$right1 = $right1->substitute(x=>Formula("x - 0"));}; +if ($x2 == 0) {$right2 = $right2->substitute(x=>Formula("x - 0"));}; + +Context("Numeric"); +parser::Assignment->Allow; +Context()->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y','x-0'); +Context()->flags->set(showExtraParens=>0); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFormulas=>0); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +); + + +$shift1 = Formula("x-$x1")->reduce; +$shift2 = Formula("x-$x2")->reduce; + +$ansPS1 = ($y1!=0) ? Formula("y=$m($shift1)+$y1") : Formula("y=$m($shift1)"); +$ansPS2 = ($y2!=0) ? Formula("y=$m($shift2)+$y2") : Formula("y=$m($shift2)"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's equation in point-slope form. + + Using the point [`([$x1],[$y1])`], this line's point-slope form equation is [___________________]. + + Using the point [`([$x2],[$y2])`], this line's point-slope form equation is [___________________]. + +END_PGML + +############################################## + + +ANS($ansPS1 -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; +#if ($correct != $student) { +#Value::Error('This problem is being debugged at this very moment.'.$PAR.pp($correct).$PAR.pp($student).$PAR.pp($correct->cmp->evaluate($student->string))); +#}; + return 0 if $ansHash->{isPreview} || ($correct != $student and $student != $correct); + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +} +)); + + +ANS($ansPS2 -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is a line equation for the right line, but it is not in the expected point-slope form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0); + return 1; +})); + + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +A line's equation in point-slope form looks like [` y=m(x-x_{0})+y_0 `] where [`m`] is the slope of the line and [`(x_{0},y_{0})`] is a point that the line passes through. We first need to find the line's slope. + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +We mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these values into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m]\end{aligned} ``] + +Now we have [` y=[$m](x-x_{0})+y_0 `]. The next step is to use a point that we know the line passes through. + +If we choose to use the point [`([$x1],[$y1])`], we have: + + [` +\begin{aligned} + y &= m(x-x_{0})+y_0 \\ + [$left1] &= [$m](x-[$x1])+[$y1] +\end{aligned} +`] + +If we choose to use the point [`([$x2],[$y2])`], we have: + + [` +\begin{aligned} + y &= m(x-x_{0})+y_0 \\ + [$left2] &= [$m](x-[$x2])+[$y2] +\end{aligned} +`] + +Note that these two equations are equivalent. You will see why once you change both equations to slope-intercept form. This is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract0.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract0.pg index 8e0f3f15dc..8c980372a5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract0.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract0.pg @@ -12,16 +12,18 @@ # Last updated: Jordan 8/17/13; Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Polynomial equations and functions) -## DBsection(Polynomial functions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Recognize_form) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','exponent','binomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PGML.pl", "parserPopUp.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -70,21 +72,12 @@ TEXT(beginproblem()); BEGIN_PGML -Is the following expression a monomial, binomial, or trinomial? - - [`[$poly1]`] +Is the following expression a monomial, binomial, or trinomial? - [@$popup->menu()@]* - -What is the degree of the expression? - - [________________] +[``[$poly1]``] is a [__]{$popup} of degree [_____]{$n}. END_PGML -ANS( $popup->cmp() ); -ANS( Compute($n)->cmp()); - ############################################## BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract10.pg index c34c661302..9fc0ef330a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract10.pg @@ -12,16 +12,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Polynomial equations and functions) -## DBsection(Polynomial functions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Recognize_form) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','exponent','trinomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PGML.pl", "parserPopUp.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -74,20 +76,12 @@ TEXT(beginproblem()); BEGIN_PGML -Is the following expression a monomial, binomial, or trinomial? - - [`[$poly1]`] - - [@$popup->menu()@]* - -What is the degree of the expression? +Is the following expression a monomial, binomial, or trinomial? - [________________] +[``[$poly1]``] is a [__]{$popup} of degree [_____]{$n} END_PGML -ANS( $popup->cmp() ); -ANS( Compute($n)->cmp()); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract100.pg index 4c2d5b5992..75258a218e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract100.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Subtract the two binomials, making sure to simplify your answer +# Subtract the two binomials. # as much as possible. # # (a x^2 + b x + c) - (d x^2 + e x + f) @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_minus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','trinomial','simplify','combine','like terms','subtract') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,8 +36,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGpolynomialmacros.pl", - "PGcourse.pl" +# "PGpolynomialmacros.pl", + "PGcourse.pl", ); ############################################## @@ -71,11 +73,11 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@sumarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # and make the answer into a string -$ans = $ans->substitute(x=>$var); +$ans = $ans->substitute(x=>$var)->reduce; # for the solution $soln1=Formula(PolyString(~~@poly1array))->reduce; @@ -86,7 +88,7 @@ $soln2 = $soln2->substitute(x=>$var); Context("LimitedPolynomial-Strict"); #Context()->variables->add($var=>'Real'); -$ans = Formula($ans); +$ans = Formula($ans)->reduce; ############################################## @@ -94,10 +96,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract the two trinomials, making sure to simplify your answer -as much as possible. +Subtract the polynomials. - [`\left([$poly1]\right)-\left([$poly2]\right)`] +[``\left([$poly1]\right)-\left([$poly2]\right)``] [________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract105.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract105.pg index 10d898994f..00cc28cdf4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract105.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract105.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_minus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','trinomial','simplify','combine','like terms','subtract') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,8 +36,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGpolynomialmacros.pl", - "PGcourse.pl" +# "PGpolynomialmacros.pl", + "PGcourse.pl", ); ############################################## @@ -72,11 +74,11 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@sumarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # and make the answer into a string -$ans = $ans->substitute(x=>$var); +$ans = $ans->substitute(x=>$var)->reduce; # for the solution $soln1=Formula(PolyString(~~@poly1array))->reduce; @@ -87,7 +89,7 @@ $soln2 = $soln2->substitute(x=>$var); Context("LimitedPolynomial-Strict"); Context()->variables->are($var=>'Real'); -$ans = Formula($ans); +$ans = Formula($ans)->reduce; ############################################## @@ -95,10 +97,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract the two trinomials, making sure to simplify your answer -as much as possible. +Subtract the polynomials. - [`\left([$poly1]\right)-\left([$poly2]\right)`] +[``\left([$poly1]\right)-\left([$poly2]\right)``] [________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract11.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract11.pg index 7163939094..cef5632276 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract11.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract11.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Polynomial equations and functions) -## DBsection(Polynomial functions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','exponent','trinomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -67,17 +70,10 @@ BEGIN_PGML Is the following expression a monomial, binomial, or trinomial? - [`[$poly1]`] - - [@$popup->menu()@]* - -What is the degree of the expression? - - [________________]{$m} +[``[$poly1]``] is a [__]{$popup} of degree [_____]{$m} END_PGML -ANS( $popup->cmp() ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract110.pg index 2682ea7a75..bb91578896 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract110.pg @@ -13,15 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','binomial','simplify','combine','like terms','subtract') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -103,15 +106,13 @@ TEXT(beginproblem()); BEGIN_PGML -Use a vertical format to _subtract_ the polynomials. - - [` +Use a vertical format to _subtract_ the polynomials. [``` \begin{alignedat}{3} &[$poly1]&\\ -(&[$poly2]&)\\ \hline \end{alignedat} - `] + ```] [________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract115.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract115.pg index 145296f27f..c71d03d39b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract115.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract115.pg @@ -14,15 +14,18 @@ # Last updated: Hughes 8/23/13, Carl Yao 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','simplify','combine','like terms','subtract') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -124,15 +127,13 @@ TEXT(beginproblem()); BEGIN_PGML -Use a vertical format to _subtract_ the polynomials. - - [` +Use a vertical format to _subtract_ the polynomials. [``` \begin{alignedat}{5} &[$poly1]&\\ -(&[$poly2]&)\\ \hline \end{alignedat} - `] + ```] [_________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract120.pg index b920fea473..6a0a0fdf42 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract120.pg @@ -14,15 +14,18 @@ # Last updated: Hughes 8/23/13, Carl Yao 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','simplify','combine','like terms','subtract') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -124,15 +127,13 @@ TEXT(beginproblem()); BEGIN_PGML -Use a vertical format to _subtract_ the polynomials. - - [` +Use a vertical format to _subtract_ the polynomials. [``` \begin{alignedat}{5} &[$poly1]&\\ -(&[$poly2]&)\\ \hline \end{alignedat} - `] + ```] [_________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract125.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract125.pg index 6006679db6..718f28f91f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract125.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract125.pg @@ -14,15 +14,18 @@ # Last updated: Hughes 8/23/13, Carl Yao 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','simplify','combine','like terms','subtract') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -108,15 +111,13 @@ TEXT(beginproblem()); BEGIN_PGML -Use a vertical format to _subtract_ the polynomials. - - [` +Use a vertical format to _subtract_ the polynomials. [``` \begin{alignedat}{7} &[$poly1]&\\ -(&&&&&[$poly2])\\ \hline \end{alignedat} - `] + ```] [_________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract130.pg index e5adfb8c1e..9e3cf3d2b2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract130.pg @@ -15,15 +15,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','trinomial','simplify','combine','like terms','subtraction') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +38,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -125,11 +128,11 @@ TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression +Add or subtract the given polynomials as indicated. - [` +[`` \left[[$poly1] - \left([$poly2]\right)\right] - \left([$poly3]\right) - `] + ``] [________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract135.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract135.pg index cc9552cfa0..3cb6e15641 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract135.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract135.pg @@ -17,15 +17,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','subtract','simplify','combine','like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -156,11 +159,11 @@ TEXT(beginproblem()); BEGIN_PGML -Simplify the following expression +Add or subtract the given polynomials as indicated. - [` +[`` \left[[$poly1] - \left([$poly2]\right)\right] - \left[[$poly3]+\left([$poly4]\right)\right] - `] + ``] [________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract140.pg index 09e6259eb5..5cd77f628d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract140.pg @@ -13,17 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## MLT(PolyAddSubtractDescriptive) -## MLTleader(1) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','trinomial','simplify','combine','like terms','subtract') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract15.pg index 2fbf4a7056..71bc72626d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract15.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract15.pg @@ -12,16 +12,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Polynomial equations and functions) -## DBsection(Polynomial functions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Recognize_form) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','exponent','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PGML.pl", "parserPopUp.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -67,21 +69,12 @@ TEXT(beginproblem()); BEGIN_PGML -Is the following expression a monomial, binomial, or trinomial? - - [`[$poly1]`] +Is the following expression a monomial, binomial, or trinomial? - [@$popup->menu()@]* - -What is the degree of the expression? - - [________________] +[``[$poly1]``] is a [__]{$popup} of degree [_____]{$n} END_PGML -ANS( $popup->cmp() ); -ANS( Compute($n)->cmp()); - ############################################## BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract20.pg index 8a60558231..cf81cef648 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract20.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Add the two binomials, making sure to simplify your answer +# Add the two binomials. # as much as possible. # # (a x + b) + (c x + d) @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_plus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','binomial','combine', 'like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,8 +36,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGpolynomialmacros.pl", - "PGcourse.pl" +# "PGpolynomialmacros.pl", + "PGcourse.pl", ); ############################################## @@ -67,8 +69,8 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@sumarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # and make the answer into a string $ans = $ans->substitute(x=>$var); @@ -82,7 +84,7 @@ $soln2 = $soln2->substitute(x=>$var); Context("LimitedPolynomial-Strict"); #Context()->variables->add($var=>'Real'); -$ans = Formula($ans); +$ans = Formula($ans)->reduce; ############################################## @@ -90,10 +92,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add the two binomials, making sure to simplify your answer -as much as possible. +Add the polynomials. - [`\left([$poly1]\right)+\left([$poly2]\right)`] +[``\left([$poly1]\right)+\left([$poly2]\right)``] [________________]{$ans} @@ -126,13 +127,16 @@ sub output { $cOut = output($c,$var,1,0); $dOut = output($d,$var,0,0); +Context("Numeric"); +$s1 = Compute("$a*x+$cOut")->reduce; + BEGIN_PGML_SOLUTION We combine like terms as follows [` \begin{aligned} - \left([$poly1]\right)+\left([$poly2]\right)& = \left([$a]x+[$cOut] \right)+\left([$b]+[$dOut] \right)\\ + \left([$poly1]\right)+\left([$poly2]\right)& = \left( [$s1] \right)+\left( [$b]+[$dOut] \right)\\ & = [$ans] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract25.pg index 3f271a2842..b5df37d9cc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract25.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract25.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Add the two binomials, making sure to simplify your answer +# Add the two binomials. # as much as possible. # # (a x^2 + b x) + (c x^2 + d x) @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_plus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','binomial','combine', 'like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -65,8 +67,7 @@ $ans->context(Context("LimitedPolynomial-Strict")); BEGIN_PGML -Add the two binomials, making sure to simplify your answer -as much as possible. +Add the polynomials. [` ([$p1]) + ([$p2]) `] @@ -82,6 +83,10 @@ $absc = abs($c); $absd = abs($d); $sum1 = $c>0 ? "$a+$c" : "$a-$absc"; $sum2 = $d>0 ? "$b+$d" : "$b-$absd"; +Context("Numeric"); +$s1 = Compute("$a*x**2+$cOut")->reduce; +$s2 = Compute("$b*x+$dOut")->reduce; + BEGIN_PGML_SOLUTION We combine like terms as follows diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract30.pg index d61a13917d..3cadf213bb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract30.pg @@ -13,15 +13,18 @@ # Last updated: Hughes 8/23/13, Carl Yao 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','addition','simplify','binomial','combine', 'like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -106,15 +109,13 @@ TEXT(beginproblem()); BEGIN_PGML -Use a vertical format to add the polynomials. - - [` +Use a vertical format to add the polynomials. [``` \begin{alignedat}{2} [$poly1]\\ [$poly2]\\ \hline \end{alignedat} - `] + ```] [________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract35.pg index 945d4d499a..2b23d3efe1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract35.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract35.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Add the two binomials, making sure to simplify your answer +# Add the two binomials. # as much as possible. # # (a x^2 + b x + c) + (d x^2 + e x + f) @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_plus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','trinomial','combine','like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,8 +36,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGpolynomialmacros.pl", - "PGcourse.pl" +# "PGpolynomialmacros.pl", + "PGcourse.pl", ); ############################################## @@ -71,8 +73,8 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@sumarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # and make the answer into a string $ans = $ans->substitute(x=>$var); @@ -86,7 +88,7 @@ $soln2 = $soln2->substitute(x=>$var); Context("LimitedPolynomial-Strict"); #Context()->variables->add($var=>'Real'); -$ans = Formula($ans); +$ans = Formula($ans)->reduce; ############################################## @@ -94,10 +96,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add the two trinomials, making sure to simplify your answer -as much as possible. +Add the polynomials. - [`\left([$poly1]\right)+\left([$poly2]\right)`] +[``\left([$poly1]\right)+\left([$poly2]\right)``] [________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract40.pg index 3d670a0cd4..0111e9164a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract40.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Add the two trinomials, making sure to simplify your answer +# Add the two trinomials. # as much as possible. # # (a x^3 + b x^2 + c) + (d x^3 + e x^2 + f) @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_plus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','addition','simplify','trinomial','combine','like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,8 +36,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGpolynomialmacros.pl", - "PGcourse.pl" +# "PGpolynomialmacros.pl", + "PGcourse.pl", ); ############################################## @@ -72,8 +74,8 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@sumarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # and make the answer into a string $ans = $ans->substitute(x=>$var); @@ -87,7 +89,7 @@ $soln2 = $soln2->substitute(x=>$var); Context("LimitedPolynomial-Strict"); Context()->variables->are($var=>'Real'); -$ans = Formula($ans); +$ans = Formula($ans)->reduce; ############################################## @@ -95,10 +97,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add the two trinomials, making sure to simplify your answer -as much as possible. +Add the polynomials. - [`\left([$poly1]\right)+\left([$poly2]\right)`] +[``\left([$poly1]\right)+\left([$poly2]\right)``] [________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract45.pg index 21040fcbac..818794c261 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract45.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract45.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Add the two trinomials, making sure to simplify your answer +# Add the two trinomials. # as much as possible. # # (a x^6 + b x^4 + c x^2) + (d x^6 + e x^4 + f x^2) @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_plus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','trinomial','combine','like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,8 +36,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGpolynomialmacros.pl", - "PGcourse.pl" +# "PGpolynomialmacros.pl", + "PGcourse.pl", ); ############################################## @@ -72,8 +74,8 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@sumarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # and make the answer into a string $ans = $ans->substitute(x=>$var); @@ -87,7 +89,7 @@ $soln2 = $soln2->substitute(x=>$var); Context("LimitedPolynomial-Strict"); Context()->variables->are($var=>'Real'); -$ans = Formula($ans); +$ans = Formula($ans)->reduce; ############################################## @@ -95,10 +97,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add the two trinomials, making sure to simplify your answer -as much as possible. +Add the polynomials. - [`\left([$poly1]\right)+\left([$poly2]\right)`] +[``\left([$poly1]\right)+\left([$poly2]\right)``] [________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract5.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract5.pg index 5bf4e95c84..70281c46dc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract5.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract5.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Polynomial equations and functions) -## DBsection(Polynomial functions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Recognize_form) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','exponent','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +37,7 @@ loadMacros( "PGML.pl", "parserPopUp.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -68,21 +70,12 @@ TEXT(beginproblem()); BEGIN_PGML -Is the following expression a monomial, binomial, or trinomial? - - [`[$poly1]`] +Is the following expression a monomial, binomial, or trinomial? - [@$popup->menu()@]* - -What is the degree of the expression? - - [________________] +[``[$poly1]``] is a [__]{$popup} of degree [_____]{$n} END_PGML -ANS( $popup->cmp() ); -ANS( Compute($n)->cmp()); - ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract50.pg index fad731f23f..6742081841 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract50.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Add the two polynomials, making sure to simplify your answer +# Add the two polynomials. # as much as possible. # # (a x^5 + b x^4 + c x^2 + d) + (e x^5 + f x^3 + g) @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_plus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','addition','simplification','integer coefficients','combine like terms','decimal') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,8 +36,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGpolynomialmacros.pl", - "PGcourse.pl" +# "PGpolynomialmacros.pl", + "PGcourse.pl", ); ############################################## @@ -74,11 +76,11 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@sumarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # and make the answer into a string -$ans = $ans->substitute(x=>$var); +$ans = $ans->substitute(x=>$var)->reduce; # for the solution $soln1=Formula(PolyString(~~@poly1array))->reduce; @@ -90,7 +92,7 @@ $soln2 = $soln2->substitute(x=>$var); Context("LimitedPolynomial-Strict"); Context()->variables->are($var=>'Real'); Context()->operators->undefine('/'); # to stop answers such as 1.8/2 instead of 0.6 -$ans = Formula($ans); +$ans = Formula($ans)->reduce; ############################################## @@ -100,10 +102,9 @@ TEXT(beginproblem()); BEGIN_PGML -Add the two polynomials, making sure to simplify your answer -as much as possible. +Add the polynomials. - [`\left([$poly1]\right)+\left([$poly2]\right)`] +[``\left([$poly1]\right)+\left([$poly2]\right)``] [________________________________________]{$ans} @@ -146,9 +147,9 @@ We combine like terms as follows [` \begin{aligned} - \left([$poly1]\right)+\left([$poly2]\right)& = ([$aOut]+[$eOut])+[$bOut]+[$fOut]\\ - & \phantom{=}+[$cOut]+([$d]+[$gOut])\\ - & = [$ans] + &\phantom{{}=}\left([$poly1]\right)+\left([$poly2]\right) \\ + & = ([$aOut]+[$eOut])+[$bOut]+[$fOut]+[$cOut]+([$d]+[$gOut])\\ + & = [$ans] \end{aligned} `] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract55.pg index 32d49ac075..56d98b411b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract55.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract55.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Add the two trinomials, making sure to simplify your answer +# Add the two trinomials. # as much as possible. # # (a x^3 + b x^2 + c x + d/e) + (f x^3 + g x^2 + h x + i/j) @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_plus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','combine','like terms','fraction') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,8 +37,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "contextFraction.pl", - "PGcourse.pl" + "contextFraction.pl", , + "PGcourse.pl", ); ############################################## @@ -84,8 +86,8 @@ $poly1 = Formula(PolyString(~~@poly1array))->reduce; $poly2 = Formula(PolyString(~~@poly2array))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; Context("LimitedPolynomial-Strict"); @@ -96,9 +98,10 @@ $ans = Formula("@sum"); TEXT(beginproblem()); BEGIN_PGML -Add the two polynomials - [`\left([$poly1]\right)+\left([$poly2]\right)`] +Add the polynomials. + +[``\left([$poly1]\right)+\left([$poly2]\right)``] [_________________________]{$ans} @@ -139,7 +142,8 @@ BEGIN_PGML_SOLUTION We combine like terms as follows [` \begin{aligned} - \left([$poly1]\right)+\left([$poly2]\right)& = \left( [$aOut]+[$fOut]\right)+\left( [$bOut]+[$gOut] \right)+\left([$cOut]+[$hOut] \right)+\left( \textstyle\frac{[$d]}{[$e]}+ \textstyle\frac{[$i]}{[$j]} \right)\\ + &\phantom{{}=}\left([$poly1]\right)+\left([$poly2]\right) \\ + & = \left( [$aOut]+[$fOut]\right)+\left( [$bOut]+[$gOut] \right)+\left([$cOut]+[$hOut] \right)+\left( \textstyle\frac{[$d]}{[$e]}+ \textstyle\frac{[$i]}{[$j]} \right)\\ &=[$ans] \end{aligned} `] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract60.pg index 16f2ce8ecf..26677296e3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract60.pg @@ -14,15 +14,18 @@ # Last updated: Hughes 8/23/13, Carl Yao 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','combine','like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -124,15 +127,13 @@ TEXT(beginproblem()); BEGIN_PGML -Use a vertical format to add the polynomials. - - [` +Use a vertical format to add the polynomials. [``` \begin{alignedat}{4} [$poly1]\\ [$poly2]\\ \hline \end{alignedat} - `] + ```] [_________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract65.pg index f4f3f708f2..08d3a0a159 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract65.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract65.pg @@ -14,15 +14,18 @@ # Last updated: Hughes 8/23/13, Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','combine','like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -108,15 +111,13 @@ TEXT(beginproblem()); BEGIN_PGML -Use a vertical format to add the polynomials. - - [` +Use a vertical format to add the polynomials. [``` \begin{alignedat}{6} [$poly1]&\\ &&&&[$poly2]\\ \hline \end{alignedat} - `] + ```] [_________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract70.pg index 5d28da24ff..a285304c0f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract70.pg @@ -14,15 +14,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','trinomial','combine','like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -116,15 +119,13 @@ TEXT(beginproblem()); BEGIN_PGML -Use a vertical format to add the trinomials. - - [` +Use a vertical format to add the trinomials. [``` \begin{alignedat}{3} [$poly1]\\ [$poly2]\\ \hline \end{alignedat} - `] + ```] [___________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract75.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract75.pg index abc9f70376..4da931e0e1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract75.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract75.pg @@ -15,15 +15,18 @@ # Last updated: Hughes, 8/23/13, Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','trinomial','combine','like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +38,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -133,16 +136,14 @@ TEXT(beginproblem()); BEGIN_PGML -Use a vertical format to add the trinomials. - - [` +Use a vertical format to add the trinomials. [``` \begin{alignedat}{3} [$poly1]\\ [$poly2]\\ [$poly3]\\ \hline \end{alignedat} - `] + ```] [________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg index a11f59639e..40bf570a3e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Subtract the two binomials, making sure to simplify your answer +# Subtract the two binomials. # as much as possible. # # (a x + b) - (c x + d) @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_minus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','binomial','simplify','combine','like terms','subtract') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,8 +36,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGpolynomialmacros.pl", - "PGcourse.pl" +# "PGpolynomialmacros.pl", + "PGcourse.pl", ); ############################################## @@ -67,11 +69,11 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@sumarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # and make the answer into a string -$ans = $ans->substitute(x=>$var); +$ans = $ans->substitute(x=>$var)->reduce; # for the solution $soln1=Formula(PolyString(~~@poly1array))->reduce; @@ -82,7 +84,7 @@ $soln2 = $soln2->substitute(x=>$var); Context("LimitedPolynomial-Strict"); #Context()->variables->add($var=>'Real'); -$ans = Formula($ans); +$ans = Formula($ans)->reduce; ############################################## @@ -90,10 +92,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract the two binomials, making sure to simplify your answer -as much as possible. +Subtract the polynomials. - [`\left([$poly1]\right)-\left([$poly2]\right)`] +[``\left([$poly1]\right)-\left([$poly2]\right)``] [________________]{$ans} @@ -127,6 +128,9 @@ $aOut = output($a,$var,1,1); $cOut = output($c,$var,1,0); $dOut = output($d,$var,0,0); +Context("Numeric"); +$s1 = Compute("$aOut-($cOut)"); + BEGIN_PGML_SOLUTION We combine like terms as follows diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract85.pg index 87773d5ca5..40a009b372 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract85.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract85.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Subtract the two binomials, making sure to simplify your answer +# Subtract the two binomials. # as much as possible. # # (a x^2 + b x) - (c x^2 + d x) @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_minus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','binomial','simplify','combine','like terms','subtract') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,11 +68,11 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@sumarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # and make the answer into a string -$ans = $ans->substitute(x=>$var); +$ans = $ans->substitute(x=>$var)->reduce; # for the solution $soln1=Formula(PolyString(~~@poly1array))->reduce; @@ -81,7 +83,7 @@ $soln2 = $soln2->substitute(x=>$var); Context("LimitedPolynomial-Strict"); #Context()->variables->add($var=>'Real'); -$ans = Formula($ans); +$ans = Formula($ans)->reduce; ############################################## @@ -89,10 +91,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract the two binomials, making sure to simplify your answer -as much as possible. +Subtract the polynomials. - [`\left([$poly1]\right)-\left([$poly2]\right)`] +[``\left([$poly1]\right)-\left([$poly2]\right)``] [________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract90.pg index b91bac03b8..d478057ee1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract90.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Subtract the two binomials, making sure to simplify your answer +# Subtract the two binomials. # as much as possible. # # (a x^m + b x^n) - (c x^k + d ) @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_minus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','binomial','simplify','combine','like terms','subtract') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,8 +36,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGpolynomialmacros.pl", - "PGcourse.pl" +# "PGpolynomialmacros.pl", + "PGcourse.pl", ); ############################################## @@ -76,11 +78,11 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@sumarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # and make the answer into a string -$ans = $ans->substitute(x=>$var); +$ans = $ans->substitute(x=>$var)->reduce; # for the solution $soln1=Formula(PolyString(~~@poly1array))->reduce; @@ -90,7 +92,7 @@ $soln2 = $soln2->substitute(x=>$var); Context("LimitedPolynomial-Strict"); -$ans = Formula($ans); +$ans = Formula($ans)->reduce; ############################################## @@ -98,10 +100,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract the two binomials, making sure to simplify your answer -as much as possible. +Subtract the polynomials. - [`\left([$poly1]\right)-\left([$poly2]\right)`] +[``\left([$poly1]\right)-\left([$poly2]\right)``] [________________]{$ans} @@ -112,9 +113,9 @@ BEGIN_PGML_SOLUTION We combine like terms as follows - [` + [``` \left([$poly1]\right)-\left([$poly2]\right) = [$ans] - `] + ```] END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract95.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract95.pg index 99ed586b71..e545500356 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract95.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtract95.pg @@ -2,7 +2,7 @@ # Portland Community College # # Template: -# Subtract the two binomials, making sure to simplify your answer +# Subtract the two binomials. # as much as possible. # # (a x^3 + b x^2 + c x + d) - (e x^2 + f x + g) @@ -12,16 +12,18 @@ # Last updated: Carl Yao, 6/28/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_minus_poly) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','simplify','combine','like terms','subtract') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,8 +35,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGpolynomialmacros.pl", - "PGcourse.pl" +# "PGpolynomialmacros.pl", + "PGcourse.pl", ); ############################################## @@ -71,8 +73,8 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@sumarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # and make the answer into a string $ans = $ans->substitute(x=>$var); @@ -80,13 +82,13 @@ $ans = $ans->substitute(x=>$var); # for the solution $soln1=Formula(PolyString(~~@poly1array))->reduce; $soln2=Formula(PolyString(~~@poly2array))->reduce; -$soln1 = $soln1->substitute(x=>$var); -$soln2 = $soln2->substitute(x=>$var); +$soln1 = $soln1->substitute(x=>$var)->reduce; +$soln2 = $soln2->substitute(x=>$var)->reduce; Context("LimitedPolynomial-Strict"); #Context()->variables->add($var=>'Real'); -$ans = Formula($ans); +$ans = Formula($ans)->reduce; ############################################## @@ -94,10 +96,9 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract the two polynomials, making sure to simplify your answer -as much as possible. +Subtract the polynomials. - [`\left([$poly1]\right)-\left([$poly2]\right)`] +[``\left([$poly1]\right)-\left([$poly2]\right)``] [________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication10.pg index 4b26f9b4bb..f1eda5540a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication10.pg @@ -8,14 +8,18 @@ # Last updated: Carl Yao, 11/9/16 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Polynomial equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','binomial','combine', 'like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -56,7 +60,7 @@ TEXT(beginproblem()); BEGIN_PGML -An auto company's sales volume can be modeled by [`[$poly1]`], and its cost can be modeled by [`[$poly2]`], where [`x`] represents the number of cars produced, and [`y`] stands for money in thousand dollars. We can calculate the company's net profit by subtracting cost from sales. Find the polynomial which models the company's sales in thousands of dollars. +An auto company's sales volume (in dollars) can be modeled by [`[$poly1]`], and its costs (in dollars) can be modeled by [`[$poly2]`], where [`x`] represents the number of cars produced. We can calculate the company's net profit by subtracting costs from sales. Find the polynomial which models the company's profit in thousands of dollars. The company's profit can be modeled by [________________]{$ans} dollars. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication20.pg new file mode 100644 index 0000000000..2e475d258d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication20.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Add polynomials applications +# +# +# Last updated: Carl Yao, 11/9/16 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('polynomial','add','simplify','binomial','combine', 'like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", +# "PGpolynomialmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$a2=random(20,50,0.5); +do {$a1=random(20,50,0.5);} until ($a1!=$a2); +$b2=non_zero_random(-10,10,0.5); +$b1=-$b2; +$c2=random(-50,50,0.5); +do {$c1=random(-50,50,0.5);} until ($c1!=$c2); +$poly1 = Compute("$a1*x**2+$b1*x+$c1")->reduce; +$poly2 = Compute("$a2*x**2+$b2*x+$c2")->reduce; + +$a3 = $a1+$a2; +$b3 = $b1+$b2; +$c3 = $c1+$c2; + +Context("LimitedPolynomial-Strict"); +$ans = Formula("$a3*x**2+$b3*x+$c3")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A farmhand is building two pig pens of the same width, but different lengths. If [`x`] is the common width, in meters, then the cost of building one pen is [`[$poly1]`] dollars, and the cost of building the other pen is [`[$poly2]`] dollars. What's the total cost of building those two pens? + +A polynomial representing the total cost of building those two pens is [________________]{$ans} dollars. + +END_PGML + +############################################### + +$s1 = ($b2>0) ? "$b2 x" : "($b2 x)"; +$s2 = ($c2>0) ? "$c2 x" : "($c2 x)"; + +BEGIN_PGML_SOLUTION + +We will add up the cost polynomial for building those two pens: + + [`` + \begin{aligned} + &\phantom{{}=}\left([$poly1]\right)+\left([$poly2]\right) \\ + & = \left([$a1]x^2+[$a2]x^2\right)+\left([$b1]x+[$s1] \right)+\left([$c1]+[$s2] \right)\\ + & = [$ans] + \end{aligned} + ``] + +A polynomial representing the total cost of building those two pens is [`[$ans]`] dollars. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication30.pg index a2b221358a..fe22c4b3be 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication30.pg @@ -8,14 +8,18 @@ # Last updated: Carl Yao, 11/9/16 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Polynomial equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','binomial','combine', 'like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication40.pg index 11d03a9b67..859ba3da65 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/PolyAddSubtractApplication40.pg @@ -8,14 +8,18 @@ # Last updated: Carl Yao, 11/9/16 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Polynomial equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('polynomial','add','simplify','binomial','combine', 'like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression10.pg index 686ba1d6b0..9c18692a0a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('combine','like terms','expression','linear') +## DBCCSS('7.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -31,7 +34,8 @@ loadMacros( "PGML.pl", "contextLimitedPolynomial.pl", "PCCmacros.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg index 40c424a788..551c69177a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('combine','like terms','expression','linear') +## DBCCSS('7.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -31,7 +34,7 @@ loadMacros( "PGML.pl", "contextLimitedPolynomial.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression30.pg new file mode 100644 index 0000000000..ae5b801082 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression30.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Combine like terms in a linear expression. Numbers are small. May not be combinable. +# +# Last edited: Jordan 6/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('combine','like terms','expression','linear') +## DBCCSS('7.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedPolynomial-Strict"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); + +$Coef1 = random(3,7,1); +$Coef2 = non_zero_random(-10,10,1); +$power = random(2,3,1); + +$func = Compute("$Coef1*$var**$power+$Coef2*$var")->reduce; + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. If it is already simplified, then write it as it is. + + [`[$func]`] + + [`=`] [______________]{$func} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since [`[$var]^{[$power]}`] and [`[$var]`] are not like terms, we cannot combine the terms in this expression. We cannot simplify this expression. The answer is [`[$func]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg index d0acf53941..068c81fec5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.EE.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('combine','like terms','expression','linear') +## DBCCSS('7.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -31,7 +34,7 @@ loadMacros( "PGML.pl", "contextLimitedPolynomial.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar0.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar0.pg index 68d0abaf79..b8314aa89c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar0.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar0.pg @@ -13,16 +13,18 @@ # Last updated: Jordan 8/2/13; Carl Yao, 7/21/13, Hughes, 7/7/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Simple_plug_in_numbers) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','multivariable','polynomial') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -31,7 +33,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar10.pg index a57f4f9a71..f65bb3bf5d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar10.pg @@ -15,15 +15,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Polynomial equations and functions) -## DBsection(Polynomial functions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','polynomial','degree') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -32,7 +35,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -67,13 +70,13 @@ $ans = Compute($m+$n); TEXT(beginproblem()); BEGIN_PGML -Find the degree of the following polynomial +Find the degree of the following polynomial. [`` [$poly] ``] - The degree of this polynomial is [________________________]{$ans}. + [__]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar15.pg index 4e302aae18..ae9d755a67 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar15.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar15.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/7/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_xy) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','add','polynomial','combine like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -78,7 +80,7 @@ $ans = Formula($ans); TEXT(beginproblem()); BEGIN_PGML -Add or subtract the given polynomials as indicated +Add or subtract the given polynomials as indicated. [`` \left([$poly1]\right)+\left([$poly2]\right) diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar20.pg index f26fe29174..8655fcee8f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar20.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/7/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_xy) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','add','polynomial','combine like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -81,7 +83,7 @@ $ans = Formula($ans); TEXT(beginproblem()); BEGIN_PGML -Add or subtract the given polynomials as indicated +Add or subtract the given polynomials as indicated. [`` \left([$poly1]\right)+\left([$poly2]\right) diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar25.pg index b5c476a837..5764081343 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar25.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar25.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_xy) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','add','polynomial','combine like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -83,7 +85,7 @@ $ans = Formula($ans); TEXT(beginproblem()); BEGIN_PGML -Add or subtract the given polynomials as indicated +Add or subtract the given polynomials as indicated. [` \left([$poly1]\right)+\left([$poly2]\right) diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar30.pg index 187f6b0743..b5c02930c2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar30.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_xy) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','subtract','polynomial','combine like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -81,7 +83,7 @@ $ans = Formula($ans); TEXT(beginproblem()); BEGIN_PGML -Add or subtract the given polynomials as indicated +Add or subtract the given polynomials as indicated. [` \left([$poly1]\right)-\left([$poly2]\right) diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar35.pg index bf8e077183..d41b8ad98b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar35.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar35.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_xy) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','subtract','polynomial','combine like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -83,7 +85,7 @@ $ans = Formula($ans); TEXT(beginproblem()); BEGIN_PGML -Add or subtract the given polynomials as indicated +Add or subtract the given polynomials as indicated. [` \left([$poly1]\right)-\left([$poly2]\right) diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar40.pg index 9742c3ff6c..1c0e4cae9e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar40.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Poly_xy) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','subtract','polynomial','combine like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -82,7 +84,7 @@ $ans = Formula($ans); TEXT(beginproblem()); BEGIN_PGML -Add or subtract the given polynomials as indicated +Add or subtract the given polynomials as indicated. [` \left([$poly1]\right)-\left([$poly2]\right) diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar45.pg index 9fa556aca0..a2d2c873b0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar45.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar45.pg @@ -15,15 +15,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','add','polynomial','combine like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,7 +36,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar5.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar5.pg index 515d3fdfa6..8fddb9170c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar5.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar5.pg @@ -15,16 +15,19 @@ # Last updated: Jordan 8/2/13; Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Evaluating expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Simple_plug_in_numbers) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','multivariable','polynomial') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + ############################################## DOCUMENT(); @@ -32,7 +35,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar50.pg index 5964612e15..607bc3d4e8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar50.pg @@ -15,15 +15,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','subtract','polynomial','combine like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -33,7 +36,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar55.pg index 5edd672a6b..55210aa4fb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar55.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialBasics/polyMultVar55.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: add, subtract) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','subtract','polynomial','combine like terms') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -31,7 +34,7 @@ loadMacros( "PGML.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialDivisionApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialDivisionApplication10.pg new file mode 100644 index 0000000000..0b2643de77 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialDivisionApplication10.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial division application problem. +# Calculate a rectangular prism's base area. +# Answer is (4x^3-6x^2+8x)/(2x) +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $d = random(2,5,1); + $a = $d*random(2,10,1); + $b = $d*random(2,10,1)*random(-1,1,2); + $c = $d*random(2,10,1)*random(-1,1,2); +} until ( ($a!=$b) && ($a!=$c) && ($b!=$c) ); + +$exp3 = random(1,2,1); +$exp2 = random($exp3+1,4,1); +$exp1 = random($exp2+1,6,1); + +$v = Compute("$a*x**$exp1+$b*x**$exp2+$c*x**$exp3")->reduce; +$h = Compute("$d*x")->reduce; + +$step1 = Compute("$a*x**$exp1/($d*x)+$b*x**$exp2/($d*x)+$c*x**$exp3/($d*x)")->reduce; + +$ad = $a/$d; +$bd = $b/$d; +$cd = $c/$d; +$ans = Compute("$ad*x**($exp1-1)+$bd*x**($exp2-1)+$cd*x**($exp3-1)")->reduce; + +Context("LimitedPolynomial-Strict"); +$ans = Formula($ans); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A rectangular prism's volume can be calculated by the formula [`V=Bh`], where [`V`] stands for volume, [`B`] stands for base area, and [`h`] stands for height. A certain rectangular prism's volume can be modeled by [`[$v]`] cubic units. If its height is [`[$h]`] units, find the prism's base area. + + [``B=``][_______________________]{$ans} square units + +END_PGML + +########################################################## + +BEGIN_PGML_SOLUTION + +Since [`V=Bh`], we can use [`B=\frac{V}{h}`] to calculate the base area. After substitution, we have: + + [`` +\begin{aligned} + B &= \frac{[$v]}{[$h]} \\ + &= [$step1] \\ + &= [$ans] +\end{aligned} + ``] + +The prism's base area is [`[$ans]`] square units. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialDivisionApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialDivisionApplication20.pg new file mode 100644 index 0000000000..3612661d36 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialDivisionApplication20.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial division application problem. +# Calculate a rectangular prism's base area. +# Answer is (4pi x^3-6 pi x^2+8pi x)/(4 pi) +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $d = random(2,5,1); + $a = $d*random(2,10,1); + $b = $d*random(2,10,1)*random(-1,1,2); + $c = $d*random(2,10,1)*random(-1,1,2); +} until ( ($a!=$b) && ($a!=$c) && ($b!=$c) ); + +$exp3 = random(2,3,1); +$exp2 = random($exp3+1,5,1); +$exp1 = random($exp2+1,7,1); + +$v = Compute("$a*pi*x**$exp1+$b*pi*x**$exp2+$c*pi*x**$exp3")->reduce; +$B = Compute("$d*pi*x**2")->reduce; + +$step1 = Compute("$a*pi*x**$exp1/($d*pi*x**2)+$b*pi*x**$exp2/($d*pi*x**2)+$c*pi*x**$exp3/($d*pi*x**2)")->reduce; + +$ad = $a/$d; +$bd = $b/$d; +$cd = $c/$d; +$ans = Compute("$ad*x**($exp1-2)+$bd*x**($exp2-2)+$cd*x**($exp3-2)")->reduce; + +Context("LimitedPolynomial-Strict"); +$ans = Formula($ans); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A cylinder's volume can be calculated by the formula [`V=Bh`], where [`V`] stands for volume, [`B`] stands for base area, and [`h`] stands for height. A certain cylinder's volume can be modeled by [`[$v]`] cubic units. If its base area is [`[$B]`] square units, find the cylinder's height. + + [``h=``][_______________________]{$ans} units + +END_PGML + +########################################################## + +BEGIN_PGML_SOLUTION + +Since [`V=Bh`], we can use [`h=\frac{V}{B}`] to calculate the height. After substitution, we have: + + [`` +\begin{aligned} + h &= \frac{[$v]}{[$B]} \\ + &= [$step1] \\ + &= [$ans] +\end{aligned} + ``] + +The cylinder's height is [`[$ans]`] units. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication0.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication0.pg new file mode 100644 index 0000000000..2e457988f4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication0.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find the product of the monomial and binomial +# +# a x * ( x - b ) +# +# +# a and b can be any (non-zero) integer on the interval [-10,10]. +# a can be 1, but b can not be 1 +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'x'; + +# setup the monomial: $a * x +$a = non_zero_random(-10,10,1); +@poly1array = ($a); +foreach my $i (1..1) {$poly1array[$i] = 0}; + +# setup the binomial: x - $b +$b = random(2.5,9.5,1)*random(-1,1,2)+0.5; +@poly2array = (1,$b); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; + +# for the solution +@productarray = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyString(~~@productarray))->reduce; + +# make $poly1 and $poly2 into strings +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; + +# and make the answer into a string +$ans = $ans->substitute(x=>$var); + +Context("LimitedPolynomial-Strict"); +#Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`[$poly1]\left([$poly2]\right)= `][________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We multiply the monomial by each term in the binomial, using +the properties of exponents to help us + + [` + \begin{aligned} + [$poly1]([$poly2])&=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication10.pg new file mode 100644 index 0000000000..c5fc81e5cd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication10.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find the product of the monomial and binomial +# +# a x^2 * ( x - b ) +# +# +# a and b can be any (non-zero) integer on the interval [-10,10]. +# a can be 1, but b can not be 1 +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'x'; + +# setup the monomial: $a * x^2 +$a = non_zero_random(-10,10,1); +@poly1array = ($a); +foreach my $i (1..2) {$poly1array[$i] = 0}; + +# setup the binomial: x - $b +$b = random(2.5,9.5,1)*random(-1,1,2)+0.5; +@poly2array = (1,$b); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; + +# for the solution +@productarray = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyString(~~@productarray))->reduce; + + +# make $poly1 and $poly2 into strings +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; + +# and make the answer into a string +$ans = $ans->substitute(x=>$var); + +Context("LimitedPolynomial-Strict"); +#Context()->variables->add($var=>'Real'); +$ans = Formula($ans)->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`[$poly1]\left([$poly2]\right)= `][________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We multiply the monomial by each term in the binomial, using +the properties of exponents to help us + + [` + \begin{aligned} + [$poly1]([$poly2])&=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication100.pg index 66cb022638..0025097586 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication100.pg @@ -12,16 +12,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Binom_times_binom) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','FOIL','polynomial','binomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication105.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication105.pg index b43c97ac53..8f4dca9eab 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication105.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication105.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Binom_times_binom) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','FOIL','polynomial','binomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication110.pg new file mode 100644 index 0000000000..9ab4fb1113 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication110.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (x+a)(x+b) +# +# +# a is an integer on the interval [1,10], and +# b is an integer on the interval [-10,1] +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','FOIL','polynomial','binomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'x'; + +# setup the first binomial: (x+$a) +$a = random(1,10,1); +@poly1array = (1,$a); + +# setup the binomial: (x+$b) +$b = random(-10,-1,1); +@poly2array = (1,$b); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; + +# for the solution +@productarray = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyString(~~@productarray))->reduce; + +# make $poly1 and $poly2 into strings +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; + +# for the solution +$soln = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + +# and make the answer into a string +$ans = $ans->substitute(x=>$var); + +Context("LimitedPolynomial-Strict"); +$ans = Formula($ans)->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Find the product of the two *bi*nomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication115.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication115.pg new file mode 100644 index 0000000000..2f98cd5d9c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication115.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (ax^2+b)(cx^2+d) +# +# +# a and c are integers on [2,6] +# b and d are integers on the interval [-10,-1], and $b!=$c +# +# Last updated: Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: ($a x + $b) +$a = random(2,6,1); +$b=$a; +$b = random(-10,-1,1) while(abs($b)==abs($a)); +@poly1array = ($a,0,$b); + +# setup the binomial: ($cx+$d) +$c=$a; +$c = random(1,6,1) while($c==$a); +$d=$c; +$d = random(-10,-1,1) while(abs($d)==abs($c)); +@poly2array = ($c,0,$d); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique: *F*irst *O*utside *I*nside *L*ast. [``` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + ```] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication120.pg index 1335627f39..97db4578ac 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication120.pg @@ -12,16 +12,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multpoly_combinedsteps) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','FOIL','polynomial','binomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -84,7 +86,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the product of the two polynomials. +Multiply the polynomials. [`\left([$poly1]\right)\left([$poly2]\right)= `][________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication125.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication125.pg new file mode 100644 index 0000000000..0094fabd2e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication125.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find the product of the monomial and binomial +# +# ( a x + b ) * ( x^2 + c x + d ) +# +# +# a, b, c, d can be non-zero, non-1 on the interval [-5,5]. +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','FOIL','polynomial','binomial','trinomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'x'; + +# setup the binomial: ($a * x + $b) +$a = (random(1.5,4.5,1)+0.5)*random(-1,1,2); +$b = (random(1.5,4.5,1)+0.5)*random(-1,1,2); +@poly1array = ($a,$b); + +# setup the trinomial: x^2 + $c x + $d +$c = (random(1.5,4.5,1)+0.5)*random(-1,1,2); +$d = (random(1.5,4.5,1)+0.5)*random(-1,1,2); +@poly2array = (1,$c,$d); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; + +# for the solution +@productarray = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyString(~~@productarray))->reduce; + +# make $poly1 and $poly2 into strings +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; + +# for the solution +$soln = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + +# and make the answer into a string +$ans = $ans->substitute(x=>$var); + +Context("LimitedPolynomial-Strict"); +$ans = Formula($ans)->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We multiply each term in the *bi*nomial by each term in the *tri*nomial, and then combine like terms + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication130.pg index a074227465..7aa074caa6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication130.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multpoly_combinedsteps) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','binomial','FOIL','polynomial','simplify') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication135.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication135.pg index 1c7f4627a1..34097e01db 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication135.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication135.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multpoly_combinedsteps) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','simplify','distribute','simplify','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication140.pg index 6b5cee5b55..d7ed8922f2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication140.pg @@ -13,17 +13,18 @@ # Last updated: Kling, 7/24/13; Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multpoly_combinedsteps) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','FOIL','polynomial','simplify','binomial','trinomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication145.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication145.pg index b819b70b6a..f6b3079691 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication145.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication145.pg @@ -12,16 +12,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multpoly_combinedsteps) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','FOIL','polynomial','simplify','trinomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -41,12 +43,11 @@ loadMacros( Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); $var = 'x'; - # setup the trinomial: x^2 + $a x + $b $a = (random(1.5,4.5,1)+0.5)*random(-1,1,2); $b=$a; $b = (random(1.5,4.5,1)+0.5)*random(-1,1,2) while($b==$a); -$a=2;$b=3; +#$a=2;$b=3; @poly1array = (1,$a,$b); # setup the trinomial: x^2 + $c x + $d @@ -54,7 +55,7 @@ $c=$b; $c = (random(1.5,4.5,1)+0.5)*random(-1,1,2) while($c==$b); $d=$c; $d = (random(1.5,4.5,1)+0.5)*random(-1,1,2) while($d==$c); -$c=4;$d=5; +#$c=4;$d=5; @poly2array = (1,$c,$d); # reduction check @@ -66,8 +67,8 @@ $poly2 = Formula(PolyString(~~@poly2array))->reduce; $ans = Formula(PolyString(~~@productarray))->reduce; # make $poly1 and $poly2 into strings -$poly1 = $poly1->substitute(x=>$var); -$poly2 = $poly2->substitute(x=>$var); +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; # for the solution string $soln = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; @@ -84,7 +85,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the product of the *tri*nomial and the *tri*nomial. +Multiply the polynomials. [`\left([$poly1]\right)\left([$poly2]\right)= `][___________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication15.pg new file mode 100644 index 0000000000..aecfc9d976 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication15.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find the product of the monomial and binomial +# +# a x^2 * ( b x^2 + c x ) +# +# +# a, b, c can be any (non-zero) integer on the interval [-10,10]. +# None of them can be 1 +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real',x=>'Real'); + +# setup the monomial: $a * x^2 +$a = (random(1.5,9.5,1)+0.5)*random(-1,1,2); +@poly1array = ($a); +foreach my $i (1..2) {$poly1array[$i] = 0}; + +# setup the binomial: $b*x^2 +$c*x +$b = (random(1.5,9.5,1)+0.5)*random(-1,1,2); +$c=$b; +$c = (random(1.5,9.5,1)+0.5)*random(-1,1,2) while ($c==$b); +@poly2array = ($b,$c,0); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; + +# for the solution +@productarray = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyString(~~@productarray))->reduce; + +# make $poly1 and $poly2 into strings +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; + +# and make the answer into a string +$ans = $ans->substitute(x=>$var); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans)->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`[$poly1]\left([$poly2]\right)= `][________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We multiply the monomial by each term in the binomial, using +the properties of exponents to help us + + [` + \begin{aligned} + [$poly1]([$poly2])&=[$ans] + \end{aligned} + `] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication150.pg index 04f6f6138d..af6bcfc6c8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication150.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication155.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication155.pg index bc46a2aba4..394ca957f1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication155.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication155.pg @@ -23,15 +23,18 @@ # Last updated: Jordan 8/1/13; Carl Yao, 7/26/13, Jordan, 6/26/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('FOIL','polynomial','area','binomial','multiply') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -44,7 +47,8 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "PGgraphmacros.pl", - "PGcourse.pl" +, + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication160.pg new file mode 100644 index 0000000000..ff49131561 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication160.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (x+a)(x-a) +# +# +# a is an integer on the interval [1,13]. +# +# Last updated: Hughes 9/6/13, Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: (x+$a) +$a = non_zero_random(-13,13,1); +@poly1array = (1,$a); + +# setup the binomial: (x-$a) +@poly2array = (1,-$a); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +$a1 = abs($a); + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + `] + +Alternatively, we might observe that this is the product of _the sum and difference of two terms_, in which case we may use the formula + + [``(a-b)(a+b)=a^2-b^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$var]^2-[$a1]^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication161.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication161.pg new file mode 100644 index 0000000000..f3602851c8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication161.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (x+a)(x-a) +# +# +# a is an integer on the interval [1,13]. +# +# Last updated: Hughes 9/6/13, Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: (x+$a) +$a = non_zero_random(-13,13,1); +$c = random(2,5,1); +@poly1array = (1,$a); + +# setup the binomial: (x-$a) +@poly2array = (1,-$a); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +@diffsqs = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyMult(~~@diffsqs,[$c],output=>simplified,var=>$var))->reduce->reduce; + + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`[$c]\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +$a1 = abs($a); + +BEGIN_PGML_SOLUTION + +Observe that the latter two factors are the product of _the sum and difference of two terms_, in which case we may use the formula + + [``(a-b)(a+b)=a^2-b^2``] + +and write + + [` + \begin{aligned} + [$c]\left([$poly1]\right)([$poly2])&=[$c]\left([$var]^2-[$a1]^2\right)\\ + &=[$c]\left([$var]^2-[@$a1**2@]\right)\\ + &=[$ans] + \end{aligned} + `] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication165.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication165.pg new file mode 100644 index 0000000000..b8fd0cc57e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication165.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (ax+b)(ax-b) +# +# +# a is an integer on the interval [2,6], and b is integer on [1,10] +# +# Last updated: Hughes 9/6/13, Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: ($ax+$b) +$a = random(2,6,1); +$b = non_zero_random(-10,10,1); +@poly1array = ($a,$b); + +# setup the binomial: ($ax-$b) +@poly2array = ($a,-$b); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +$b1 = abs($b); + +BEGIN_PGML_SOLUTION + +We use the FOIL technique: *F*irst *O*utside *I*nside *L*ast [```\begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + ```] + +Alternatively, we might observe that this is the product of _the sum and difference of two terms_, in which case we may use the formula [```(a-b)(a+b)=a^2-b^2```] and write [``` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=([$a][$var])^2-[$b1]^2\\ + &=[$ans] + \end{aligned} + ```] which is the same result we obtained using the FOIL method. +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication166.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication166.pg new file mode 100644 index 0000000000..c4dc955d77 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication166.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (ax+b)(ax-b) +# +# +# a is an integer on the interval [2,6], and b is integer on [1,10] +# +# Last updated: Hughes 9/6/13, Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: ($ax+$b) +$a = random(2,6,1); +$b = non_zero_random(-10,10,1); +$c = random(2,6,1); +@poly1array = ($a,$b); + +# setup the binomial: ($ax-$b) +@poly2array = ($a,-$b); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +@diffsqs = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyMult(~~@diffsqs,[$c],output=>simplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`[$c]\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +$b1 = abs($b); + +BEGIN_PGML_SOLUTION + +Observe that the latter two actors are the product of _the sum and difference of two terms_, in which case we may use the formula + + [``(a-b)(a+b)=a^2-b^2``] + +and write + + [` + \begin{aligned} + [$c]\left([$poly1]\right)([$poly2])&=[$c]\left(([$a][$var])^2-[$b1]^2\right)\\ + &=[$c]\left([@$a**2@][$var]^2-[@$b1**2@]\right)\\ + &=[$ans] + \end{aligned} + `] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication170.pg index 1a0db2320a..837e1a1535 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication170.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication170.pg @@ -12,16 +12,18 @@ # Last updated: Hughes 9/6/13, Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Sum_times_diff) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -75,7 +77,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the product of the two *bi*nomials. +Multiply the polynomials. [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication175.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication175.pg index f568fd3368..1ec81e4652 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication175.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication175.pg @@ -12,28 +12,32 @@ # Last updated: Hughes 9/6/13, Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Sum_times_diff) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); +DOCUMENT(); + loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -78,7 +82,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the product of the two *bi*nomials. +Multiply the polynomials. [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} @@ -88,29 +92,19 @@ $a1 = abs($a); BEGIN_PGML_SOLUTION -We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast - - [` +We use the FOIL technique: *F*irst *O*utside *I*nside *L*ast [``` \begin{aligned} \left([$poly1]\right)\left([$poly2]\right)&=[$soln1]\\ &=[$ans] \end{aligned} - `] + ```] -Alternatively, we might observe that this is the product of _the sum and difference of two terms_, in which case we may use the formula - - [``(a-b)(a+b)=a^2-b^2``] - -and write - - [` +Alternatively, we might observe that this is the product of _the sum and difference of two terms_, in which case we may use the formula [```(a-b)(a+b)=a^2-b^2```] and write [``` \begin{aligned} \left([$poly1]\right)\left([$poly2]\right)&=\left([$var]^{[$n]}\right)^2-[$a1]^2\\ &=[$ans] \end{aligned} - `] - -which is the same result we obtained using the FOIL method. + ```] which is the same result we obtained using the FOIL method. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication180.pg index 0e3042b6cc..623e78aad3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication180.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication180.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Sum_times_diff) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,7 +82,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the product of the two *bi*nomials. +Multiply the polynomials. [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication185.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication185.pg new file mode 100644 index 0000000000..6a83a4d79e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication185.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (a+x^n)(a-x^n) +# +# +# a is an integer on the interval [1,13], and n is any integer on [3,10] +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: (x^n+$a) +$a = (random(1.5,6,0.5)+0.5)*2*random(-1,1,2); #non_zero_random(-13,13,1); +$n = random(3,10,1); + +foreach my $i (0..$n) {$poly1array[$i] = 0}; +$poly1array[0] = 1; +$poly1array[-1] = $a; + +# setup the binomial: (x-$a) +foreach my $i (0..$n) {$poly2array[$i] = 0}; +$poly2array[0] = 1; +$poly2array[-1] = -$a; + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>ascending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>ascending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,order=>ascending,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,order=>ascending,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + +$a1 = abs($a); + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&=[$soln1]\\ + &=[$ans] + \end{aligned} + `] + +Alternatively, we might observe that this is the product of _the sum and difference of two terms_, in which case we may use the formula + + [``(a-b)(a+b)=a^2-b^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&=1^2-\left([$a1][$var]^{[$n]}\right)^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication190.pg index 05e9302a8c..0766856caa 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication190.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication190.pg @@ -12,16 +12,18 @@ # Last updated: Hughes 9/6/13, Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Binom_squared) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -71,7 +73,7 @@ TEXT(beginproblem()); BEGIN_PGML -Expand the product of the two *bi*nomials, using the FOIL technique +Expand the square of a *bi*nomial. [`\left([$poly1]\right)^2= `][________________________________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication191.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication191.pg new file mode 100644 index 0000000000..1ccb752b91 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication191.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (x+a)^2 +# +# +# a is an integer on the interval [1,10]. +# +# Last updated: Hughes 9/6/13, Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "answerHints.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: (x+$a) +$a = random(1,10,1); +$c = random(2,7,1); +@poly1array = (1,$a); +@poly2array = @poly1array; + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +@sq = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyMult(~~@sq,[$c],output=>simplified,var=>$var))->reduce->reduce; + + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`[$c]\left([$poly1]\right)^2= `][________________________________] + +END_PGML + +$wrong=$a**2*$c; +ANS($ans -> cmp() -> + withPostFilter(AnswerHints( + [Formula("$c*$var^2+$wrong")] => + "Remember to use the FOIL technique- you need the Inside and the Outside terms."))); + +BEGIN_PGML_SOLUTION + +Observe that there is a square of _the sum of two terms_, in which case we may use the formula + + [``(a+b)^2=a^2+2ab+b^2``] + +and write + + [` + \begin{aligned} + [$c]\left([$poly1]\right)([$poly2])&=[$c]\left([$var]^2+2\cdot[$a]\cdot [$var]+[$a]^2\right)\\ + &=[$c]\left([$var]^2+[@2*$a@]\cdot [$var]+[@$a**2@]\right)\\ + &=[$ans] + \end{aligned} + `] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication195.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication195.pg index 647a2823c5..4ed3d56b39 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication195.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication195.pg @@ -12,16 +12,18 @@ # Last updated: Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Binom_squared) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -72,7 +74,7 @@ TEXT(beginproblem()); BEGIN_PGML -Expand the product of the two *bi*nomials, using the FOIL technique +Expand the square of a *bi*nomial. [`\left([$poly1]\right)^2= `][________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication196.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication196.pg new file mode 100644 index 0000000000..7e6c7eeea0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication196.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (ax+b)^2 +# +# +# a and b are integers on the interval [1,10], $b!=$a +# +# Last updated: Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: ($ax+$b) +$a = random(2,10,1); +$b=$a; +$b = random(1,10,1) while($b==$a); +$c = random(2,7,1); +@poly1array = ($a,$b); +@poly2array = @poly1array; + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +@sq = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyMult(~~@sq,[$c],output=>simplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`[$c]\left([$poly1]\right)^2= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +Observe that there is the square of _the sum of two terms_, in which case we may use the formula + + [``(a+b)^2=a^2+2ab+b^2``] + +and write + + [` + \begin{aligned} + [$c]\left([$poly1]\right)([$poly2])&=[$c]\left(([$a][$var])^2+2\cdot[$a][$var]\cdot [$b]+[$b]^2\right)\\ + &=[$c]\left([@$a**2@][$var]^2+[@2*$a*$b@][$var]+[@$b**2@]\right)\\ + &=[$ans] + \end{aligned} + `] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication20.pg new file mode 100644 index 0000000000..3b686eaa0d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication20.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find the product of the monomial and trinomial +# +# a x^2 * ( b x^2 + c x + d) +# +# We allow x to be any random variable from PCCmacros.pl: x, y, z, ... +# +# a, b, c, d can be any (non-zero) integer on the interval [-10,10]. +# None of them can be 1 +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real',x=>'Real'); + +# setup the monomial: $a * x^2 +$a = (random(1.5,9.5,1)+0.5)*random(-1,1,2); +@poly1array = ($a); +foreach my $i (1..2) {$poly1array[$i] = 0}; + +# setup the binomial: $b*x^2 +$c*x +$b = (random(1.5,9.5,1)+0.5)*random(-1,1,2); +$c = $b; +$c = (random(1.5,9.5,1)+0.5)*random(-1,1,2) while ($c==$b); +$d = $c; +$d = (random(1.5,9.5,1)+0.5)*random(-1,1,2) while ($d==$c); +@poly2array = ($b,$c,$d); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; + +# for the solution +@productarray = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyString(~~@productarray))->reduce; + +# make $poly1 and $poly2 into strings +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; + +# and make the answer into a string +$ans = $ans->substitute(x=>$var); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans)->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`[$poly1]\left([$poly2]\right)= `][________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We multiply the monomial by each term in the trinomial, using +the properties of exponents to help us + + [` + \begin{aligned} + [$poly1]([$poly2])&=[$ans] + \end{aligned} + `] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication200.pg new file mode 100644 index 0000000000..aaf1014eca --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication200.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (x+a)^2 +# +# +# a is an integer on the interval [-10,-1]. +# +# Last updated: Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "answerHints.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: (x+$a) +$a = random(-10,-1,1); +@poly1array = (1,$a); +@poly2array = @poly1array; + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Expand the square of a *bi*nomial. + + [`\left([$poly1]\right)^2= `][________________________________] + +END_PGML + +$wrong=$a**2; +$coeff=1; +ANS($ans -> cmp() -> + withPostFilter(AnswerHints( + [Formula("$var^2+$wrong"),Formula("$coeff*$var^2+$wrong")] => + "Remember to use the FOIL technique- you need the Inside and the Outside terms."))); + +$a1 = abs($a); + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)^2&=\left([$poly1]\right)([$poly2])\\ + &=[$soln1]\\ + &=[$ans] + \end{aligned} + `] + +Alternatively, we might observe that this is the square of _the difference of two terms_, in which case we may use the formula + + [``(a-b)^2=a^2-2ab+b^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$var]^2-2\cdot[$a1]\cdot [$var]+[$a1]^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication205.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication205.pg index a71167b4e1..a1b2696ef2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication205.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication205.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Binom_squared) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -72,7 +74,7 @@ TEXT(beginproblem()); BEGIN_PGML -Expand the product of the two *bi*nomials, using the FOIL technique +Expand the square of a *bi*nomial. [`\left([$poly1]\right)^2= `][________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication210.pg index 2db5777619..01da6ec910 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication210.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication210.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Binom_squared) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +37,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -73,7 +75,7 @@ TEXT(beginproblem()); BEGIN_PGML -Expand the product of the two *bi*nomials, using the FOIL technique +Expand the square of a *bi*nomial. [`\left([$poly1]\right)^2= `][________________________________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication215.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication215.pg index b19a247bdd..a79dda32e0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication215.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication215.pg @@ -12,21 +12,25 @@ # Last updated: Hughes 9/6/13, Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Binom_squared) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); +DOCUMENT(); + loadMacros( "PGstandard.pl", "MathObjects.pl", @@ -34,7 +38,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -76,7 +80,7 @@ TEXT(beginproblem()); BEGIN_PGML -Expand the product of the two *bi*nomials, using the FOIL technique +Expand the square of a *bi*nomial. [`\left([$poly1]\right)^2= `][________________________________] @@ -93,30 +97,20 @@ ANS($ans -> cmp() -> $a1 = abs($a); BEGIN_PGML_SOLUTION -We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast - - [` +We use the FOIL technique: *F*irst *O*utside *I*nside *L*ast [``` \begin{aligned} \left([$poly1]\right)^2&=\left([$poly1]\right)\left([$poly2]\right)\\ &=[$soln1]\\ &=[$ans] \end{aligned} - `] + ```] -Alternatively, we might observe that this is the square of _the difference of two terms_, in which case we may use the formula - - [``(a-b)^2=a^2-2ab+b^2``] - -and write - - [` +Alternatively, we might observe that this is the square of _the difference of two terms_, in which case we may use the formula [```(a-b)^2=a^2-2ab+b^2```] and write [``` \begin{aligned} \left([$poly1]\right)\left([$poly2]\right)&=\left([$var]^{[$n]}\right)^2-2\cdot [$var]^{[$n]}\cdot [$a1]+[$a1]^2\\ &=[$ans] \end{aligned} - `] - -which is the same result we obtained using the FOIL method. + ```] which is the same result we obtained using the FOIL method. END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication220.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication220.pg index 9bdea6315d..86a068b50c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication220.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication220.pg @@ -11,16 +11,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multpoly_combinedsteps) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +34,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication225.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication225.pg index 95961d3793..736a9ffaca 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication225.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication225.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(multpoly_combinedsteps) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication230.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication230.pg index 27fc335e92..d560ca3baf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication230.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication230.pg @@ -11,17 +11,18 @@ # Last updated: Hughes 9/6/13, Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(expand_binom_cube) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','cubic') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +35,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication235.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication235.pg index 72600e3917..0fb3542b49 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication235.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication235.pg @@ -11,16 +11,18 @@ # Last updated: Hughes 9/3/13, Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(expand_binom_cube) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','cubic') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication240.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication240.pg index 64b92ba2fe..e64e0e761a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication240.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication240.pg @@ -11,16 +11,18 @@ # Last updated: Hughes 9/6/13, Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(expand_binom_cube) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','cubic') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication245.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication245.pg index 234946279a..fd9c7d5735 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication245.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication245.pg @@ -11,16 +11,18 @@ # Last updated: Hughes 9/6/13, Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(expand_binom_cube) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL','cubic') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PCCmacros.pl", "contextLimitedPolynomial.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -95,14 +97,9 @@ ANS($ans -> cmp() -> BEGIN_PGML_SOLUTION -The main thing to notice on this problem is that we can write [`\left([$poly1]\right)^3`] as - - [`\left([$poly1]\right)^3 = \left([$poly1]\right)\left([$poly1]\right)^2`] +The main thing to notice on this problem is that we can write [`\left([$poly1]\right)^3`] as [```\left([$poly1]\right)^3 = \left([$poly1]\right)\left([$poly1]\right)^2```] -This means that we can use the FOIL technique on the second binomial multiplication, and then -multiply the first factor [`[$poly1]`] by the result - - [` +This means that we can use the FOIL technique on the second binomial multiplication, and then multiply the first factor [`[$poly1]`] by the result. [``` \begin{aligned} \left([$poly1]\right)^3 & = \left([$poly1]\right)\left[\left([$poly2]\right)\left([$poly3]\right)\right]\\ &=\left([$poly1]\right)\left[[$soln1]\right]\\ @@ -110,15 +107,10 @@ multiply the first factor [`[$poly1]`] by the result & = [$soln3]\\ &=[$ans] \end{aligned} - `] - -### Additional information - -You might like to know that the formula for the cube of the _difference_ of two terms is + ```] - [`(a-b)^3 = a^3 - 3a^2b+3ab^2-b^3`] -If you have the time, you can verify that this formula works in this problem as an exercise. +You might like to know that the formula for the cube of the _difference_ of two terms is [```(a-b)^3 = a^3 - 3a^2b+3ab^2-b^3```] If you have the time, you can verify that this formula works in this problem as an exercise. END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25.pg new file mode 100644 index 0000000000..64951d9d97 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (x+a)(x+b) +# +# +# a and b are integers on the interval [1,10], and $b!=$a +# +# Last updated: Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: (x+$a) +$a = random(1,10,1); +@poly1array = (1,$a); + +# setup the binomial: (x+$b) +$b=$a; +$b = random(1,10,1) while($b==$a); +@poly2array = (1,$b); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25testing.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25testing.pg new file mode 100644 index 0000000000..f962985214 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25testing.pg @@ -0,0 +1,629 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (x+a)(x+b) +# +# +# a and b are integers on the interval [1,10], and $b!=$a +# +# Last updated: Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGgraphmacros.pl", +# "PCCMultiplyPolynomials.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# setup the first binomial: (x+$a) +$a = random(1,10,1); +@poly1array = ( [1,$a,-4],[$var1,2,1,0],[$var2,2,1,0] ); + +# setup the binomial: (x+$b) +$b=$a; +$b = random(1,10,1) while($b==$a); +@poly2array = ( [1,$b],[$var1,1,0],[$var2,1,0] ); + +($ans, $problem, $output) = multiplyPolynomials(~~@poly1array,~~@poly2array); + +###################################################### +TEXT(beginproblem()); + +BEGIN_PGML + +Find the product of the two *bi*nomials. + + [``[$problem]= ``][________________________________]{$ans} + +END_PGML + +###################################################### +# This file's multiplyPolynomials subroutine takes two parameters: +# references of two 2-dimensional arrays. +# Those two arrays represent two polynomials to be multiplied. +# Each polynomial can be a binomial or trinomial. +# Each polynomial can have up to two variables. +# This file can multipy (x+2)(x+3), (x+2y)(x+3y), (xy+2)(xy+3), (x^2+x+1)(x+1) + +# Each 2-dimensional array's first array stores the coefficients of all terms. +# Each 2-dimensional array's second array stores each variable +# and its exponents in each term in the polynomial. +# For example, the array ( [1,2,3] ['x',2,1,0] ) represents +# the polynomial (x^2+2x+3). +# The array ( [1,2,3] ['x',2,1,0] ['y',2,1,0] ) represents +# the polynomial (x^2y^2+2xy+3). +# +# The multiplyPolynomials returns three values. +# The first returned value is the problem's answer as a math object. +# The second returned value is the problem to be displayed in the question. +# The third returned value is the output string to be used in the solution. +# +# The output covers the following methods to multiply two polynomials: +# Difference of Squares Formula +# Perfect Square Formula +# Using the distributive property +# FOIL +# the Generic Rectangle Method +# + + + +# This subroutine fills empty terms in the parameter array like ['x',2,1,0] +# with 1 if the variable is missing, and +# with 0 if any exponent is missing. +# +sub fill { + my $ref = shift; + if (!(defined($ref->[0]))) { + $ref->[0]=1; + } + for my $i (1..3) { + if (!(defined($ref->[$i]))) { + $ref->[$i]=0; + } + } + return; +} + + +sub multiplyPolynomials { + + my ($poly1Ref,$poly2Ref) = @_; + my @tempPoly1 = @{$poly1Ref}; + my @tempPoly2 = @{$poly2Ref}; + + my $outputString =""; + + ### @poly1Coef stores the first polynomial's coefficients. ### + ### @poly1Var1 stores the first variable's exponents in each term. ### + ### @poly1Var2 stores the second variable's exponents in each term. ### + my @poly1Coef = ($tempPoly1[0][0],$tempPoly1[0][1], + defined($tempPoly1[0][2]) ? $tempPoly1[0][2] : 0 + ); + my @poly1Var1 = ($tempPoly1[1][0],$tempPoly1[1][1],$tempPoly1[1][2], $tempPoly1[1][3]); + fill(~~@poly1Var1); + my @poly1Var2 = ($tempPoly1[2][0],$tempPoly1[2][1],$tempPoly1[2][2], $tempPoly1[2][3]); + fill(~~@poly1Var2); + + ### @poly2Coef stores the second polynomial's coefficients. ### + ### @poly2Var1 stores the first variable's exponents in each term. ### + ### @poly2Var2 stores the second variable's exponents in each term. ### + my @poly2Coef = ($tempPoly2[0][0],$tempPoly2[0][1], + defined($tempPoly2[0][2]) ? $tempPoly2[0][2] : 0 + ); + my @poly2Var1 = ($tempPoly2[1][0],$tempPoly2[1][1],$tempPoly2[1][2], $tempPoly2[1][3]); + fill(~~@poly2Var1); + my @poly2Var2 = ($tempPoly2[2][0],$tempPoly2[2][1],$tempPoly2[2][2], $tempPoly2[2][3]); + fill(~~@poly2Var2); + + ### @poly1Terms stores the first polynomial's each term. ### + my @poly1Terms; + for my $i (0..2) { + $poly1Terms[$i] = Compute("$poly1Coef[$i]*$poly1Var1[0]**$poly1Var1[$i+1]*$poly1Var2[0]**$poly1Var2[$i+1]")->reduce; + } + my $poly1 = Compute("$poly1Terms[0]+$poly1Terms[1]+$poly1Terms[2]")->reduce; + + ### @poly2Terms stores the second polynomial's each term. ### + my @poly2Terms; + for my $i (0..2) { + $poly2Terms[$i] = Compute("$poly2Coef[$i]*$poly2Var1[0]**$poly2Var1[$i+1]*$poly2Var2[0]**$poly2Var2[$i+1]")->reduce; + } + my $poly2 = Compute("$poly2Terms[0]+$poly2Terms[1]+$poly2Terms[2]")->reduce; + + my $problem = ($poly1->string eq $poly2->string) ? Compute("$poly1**2")->reduce : Compute("$poly1*$poly2")->reduce; + + ### Calculate the answer with sage. ### + my $v1 = ($poly1Var1[0] ne '1') ? $poly1Var1[0] : 'x'; + my $v2 = ($poly1Var2[0] ne '1') ? $poly1Var2[0] : 'x'; + my $v3 = ($poly2Var1[0] ne '1') ? $poly2Var1[0] : 'x'; + my $v4 = ($poly2Var2[0] ne '1') ? $poly2Var2[0] : 'x'; +$SageCode1=<true, + }); + + my $ans= Compute($result->{webwork}->{ans})->reduce; + +### $squareExtra is used to display (a+b)^2 ### +### if the polynomials form a perfect square. ### + my $squareExtra = ($poly1->string eq $poly2->string) ? Compute("$poly1*$poly2")->reduce : ""; + + ### Displays solution for the Perfect Square formula. ### + if ( ($squareExtra ne "") && ($poly1Coef[2]==0) ) { + $outputString .= $BBOLD. + 'Perfect Square Formula: '. + $EBOLD. + 'When we multiply two binomials which happen '. + 'to form a perfect square, like '. + '\('. + $problem->TeX. + '\)'. + ', we can use the Perfect Square Formula: '. + '\['. + '(a\pm b)^2=a^2\pm2ab+b^2'. + '\]'. + $PAR. + 'For '. + '\('. + $problem->TeX. + '\)'. + ', '. + '\('. + $poly1Terms[0]->TeX. + '\)'. + ' corresponds to '. + '\(a\)'. + ' in the formula, and '. + '\('; + my $plusOrMinus, $b; + if ($poly1Coef[1]>0) { + $plusOrMinus = '+'; + $b = $poly1Terms[1]; + } else { + $plusOrMinus = '-'; + $b = Compute("-$poly1Terms[1]"); + } + $outputString .= $b->TeX. + '\)'. + ' corresponds to '. + '\(b\)'. + ' in the formula. Using the formula, we have:'. + '\[\begin{aligned}[t]'. + $problem->TeX. + '&='. + '('. + $poly1Terms[0]->TeX. + ')^2'. + $plusOrMinus. + '2('. + $poly1Terms[0]->TeX. + ')('. + $b->TeX. + ')'. + '+('. + $b->TeX. + ')^2'. + '\newline &='. + $ans->TeX. + '\end{aligned}\]'. + $PAR; + } + + ### Displays solution for the Difference of Squares formula. ### + my $negPoly2Term2 = Compute("-$poly2Terms[1]"); + if ( ($poly1Terms[0]->string eq $poly2Terms[0]->string) && + ($poly1Terms[1]->string eq $negPoly2Term2->string) && + ($poly1Coef[2]==0) && ($poly2Coef[2]==0) ) { + $outputString .= $BBOLD. + 'Difference of Squares Formula: '. + $EBOLD. + 'Note that '. + '\('. + $problem->TeX. + '\)'. + ' happens to match the Perfect Square Formula: '. + '\['. + '(a+b)(a-b)=a^2-b^2'. + '\]'. + $PAR. + 'For '. + '\('. + $problem->TeX. + '\)'. + ', '. + '\('. + $poly1Terms[0]->TeX. + '\)'. + ' corresponds to '. + '\(a\)'. + ' in the formula, and '. + '\('; + my $b; + if ($poly1Coef[1]>0) { + $b = $poly1Terms[1]; + } else { + $b = Compute("-$poly1Terms[1]"); + } + $outputString .= $b->TeX. + '\)'. + ' corresponds to '. + '\(b\)'. + ' in the formula. Using the formula, we have:'. + '\[\begin{aligned}[t]'. + $problem->TeX. + '&='. + '('. + $poly1Terms[0]->TeX. + ')^2-('. + $b->TeX. + ')^2'. + '\newline &='. + $ans->TeX. + '\end{aligned}\]'. + $PAR; + } + + ### Displays solution for the distributive property. ### + $outputString .= $BBOLD. + 'Distributive Property: '. + $EBOLD. + 'The most straightforward way to multiply polynomials is to simply use the distributive property:'. + '\[\begin{aligned}[t]'. + $problem->TeX. + '&='; + + if ($poly1->string eq $poly2->string) { + $outputString .= $squareExtra->TeX. + '\newline &='; + } + + my $distributive1stStep = ""; + for my $i (0..2) { + $distributive1stStep .= $poly2Terms[$i].'*('.$poly1.')+'; + } + $distributive1stStep .= '0'; + $distributive1stStep = Compute($distributive1stStep)->reduce; + $outputString .= $distributive1stStep->TeX. + '\newline &='; + + ### Use sage to calculate each term ### + ### when we multiply (a+b+c)(d+e+f) ### + my $distributive2ndStep = ""; + my @products, $counter=0; + + for my $i (0..2) { + for my $j (0..2) { +$SageCode1=<true, + }); + $products[$counter++] = Compute($result->{webwork}->{product})->reduce; + $distributive2ndStep .= $products[$counter-1]->string.'+'; + } + } + $distributive2ndStep .= "0"; + $distributive2ndStep = Compute($distributive2ndStep)->reduce; + my $finalLine = ""; + if ($distributive2ndStep->string ne $ans->string) { + $finalLine = '\newline &='.$ans->TeX; + } + + $outputString .= $distributive2ndStep->TeX. + $finalLine. + '\end{aligned}\]'. + $PAR; + + if ( ($poly1Coef[2] eq '0') && ($poly2Coef[2] eq '0') ) { + my $first = $products[0]; + my $outside = $products[3]; + my $inside = $products[1]; + my $last = $products[4]; + my $FOIL2ndStep = Compute("$first+$outside+$inside+$last")->reduce; + + ### Displays solution for FOIL. ### + $outputString .= $BBOLD. + 'FOIL: '. + $EBOLD. + 'When we multiply two binomials, we can use'. + ' the FOIL method.'. + $PAR. + 'For '. + '\('; + if ($poly1->string eq $poly2->string) { + $outputString .= $problem->TeX.'='.$squareExtra->TeX; + } else { + $outputString .= $problem->TeX; + } + $outputString .= '\)'. + ', we have:'. + $PAR. + $BBOLD. + $SPACE.$SPACE.$SPACE.$SPACE. + 'F'. + $EBOLD. + 'irst: '. + '\('.'('. + $poly1Terms[0]->TeX. + ')('. + $poly2Terms[0]->TeX. + ')='. + $first->TeX. + '\)'. + $PAR. + $BBOLD. + $SPACE.$SPACE.$SPACE.$SPACE. + 'O'. + $EBOLD. + 'utside: '. + '\('.'('. + $poly1Terms[0]->TeX. + ')('. + $poly2Terms[1]->TeX. + ')='. + $outside->TeX. + '\)'. + $PAR. + $BBOLD. + $SPACE.$SPACE.$SPACE.$SPACE. + 'I'. + $EBOLD. + 'nside: '. + '\('.'('. + $poly1Terms[1]->TeX. + ')('. + $poly2Terms[0]->TeX. + ')='. + $inside->TeX. + '\)'. + $PAR. + $BBOLD. + $SPACE.$SPACE.$SPACE.$SPACE. + 'L'. + $EBOLD. + 'ast: '. + '\('.'('. + $poly1Terms[1]->TeX. + ')('. + $poly2Terms[1]->TeX. + ')='. + $last->TeX. + '\)'. + $PAR. + 'By FOIL, we have:'. + '\[\begin{aligned}[t]'. + $problem->TeX. + '&='. + $FOIL2ndStep->TeX; + + $finalLine = ""; + if ($FOIL2ndStep->string ne $ans->string) { + $finalLine = '\newline &='.$ans->TeX; + } + + $outputString .= $finalLine. + '\end{aligned}\]'. + $PAR; + } + + #### Make two pictures ### + + my @labels; + $labels[0] = ''; + for my $i (0..2) { + $labels[$i+1] = $poly1Terms[$i]->string; + $labels[4*$i+4] = $poly2Terms[$i]->string; + $labels[$i+5] = $products[$i]->string; + $labels[$i+9] = $products[$i+3]->string; + $labels[$i+13] = $products[$i+6]->string; + } + for my $i (0..15) { + $labels[$i] =~ s/~~*//g; + } + + my $xmin = 0; #The viewing window + my $xmax = 10; + my $ymin = 0; + my $ymax = 10; + @picture = ( ); + my $xStart = 2; + my $xEnd = 8; + my $yStart = 2; + my $yEnd = 8; + my @x, @y; + if ($poly1Coef[2] eq '0') { + @x = (2,5,8,8); + for my $i (0..3) { + $labels[4*$i+3] = ""; + } + } else { + @x = (2,4,6,8); + } + if ($poly2Coef[2] eq '0') { + @y = (8,5,2,2); + for my $i (12..15) { + $labels[$i] = ""; + } + } else { + @y = (8,6,4,2); + } + + my $cushion = $ymax/50; + + for (my $i=0;$i<=1;$i++) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, pixels=>[400,400]); + + $picture[$i]->moveTo($xStart,$yStart); + $picture[$i]->lineTo($xEnd,$yStart, blue,3); + $picture[$i]->lineTo($xEnd,$yEnd, blue,3); + $picture[$i]->lineTo($xStart,$yEnd, blue,3); + $picture[$i]->lineTo($xStart,$yStart, blue,3); + + for my $j (1..2) { + $picture[$i]->moveTo($x[$j],$y[0]); + $picture[$i]->lineTo($x[$j],$yStart, blue,2); + + $picture[$i]->moveTo($xStart,$y[$j]); + $picture[$i]->lineTo($xEnd,$y[$j], blue,2); + } + + for my $j (0..2) { + $picture[$i]->lb( new Label(($x[$j]+$x[$j+1])/2, $y[0]+$cushion,"$labels[$j+1]",'black','center','middle')); + } + + for my $j (0..2) { + $picture[$i]->lb( new Label($x[0]-$cushion, ($y[$j]+$y[$j+1])/2,"$labels[4*$j+4]",'black','right','middle')); + } + } + + for my $i (0..2) { + $picture[1]->lb( new Label(($x[$i]+$x[$i+1])/2, ($y[0]+$y[1])/2,"$labels[$i+5]",'black','center','middle')); + $picture[1]->lb( new Label(($x[$i]+$x[$i+1])/2, ($y[1]+$y[2])/2,"$labels[$i+9]",'black','center','middle')); + $picture[1]->lb( new Label(($x[$i]+$x[$i+1])/2, ($y[2]+$y[3])/2,"$labels[$i+13]",'black','center','middle')); + } + + my $numOfBoxes; + if ( ($poly1Coef[2]==0) && ($poly2Coef[2]==0) ) { + $numOfBoxes = 4; + } elsif ( ($poly1Coef[2]==0) || ($poly2Coef[2]==0) ) { + $numOfBoxes = 6; + } else { + $numOfBoxes=9; + } + + my $baseList = ($poly1Coef[2]==0) ? "$labels[1] and $labels[2]" : "$labels[1], $labels[2] and $labels[3]"; + my $heightList = ($poly2Coef[2]==0) ? "$labels[4] and $labels[8]" : "$labels[4], $labels[8] and $labels[12]"; + + $alt0 = "The graph has $numOfBoxes generic rectangles. Labels for the bases of the top-row rectangles are: $baseList. Labels for the heights of the left-colum rectangles are: $heightList."; + + my $areaList1 = ($poly1Coef[2]==0) ? "$labels[5] and $labels[6]" : "$labels[5], $labels[6] and $labels[7]"; + + my $areaList2 = ($poly1Coef[2]==0) ? "$labels[9] and $labels[10]" : "$labels[9], $labels[10] and $labels[11]"; + + my $areaList3; + if ($poly2Coef[2]==0) { + $areaList3 = ""; + } else { + $areaList3 = ($poly1Coef[2]==0) ? " The areas of rectangles in the next row are $labels[13] and $labels[14]" : " The areas of rectangles in the next row are $labels[13], $labels[14] and $labels[15]"; + } + + $alt1 = "The graph has $numOfBoxes generic rectangles. Labels for the bases of the top-row rectangles are: $baseList. Labels for the heights of the left-colum rectangles are: $heightList. The areas of the top-row rectangles are $areaList1. The areas of rectangles in the next row are $areaList2.$areaList3"; + + #### End two pictures ### + + ### Displays solution for the Generic Rectangle Method. ### + $outputString .= $BBOLD. + 'Generic Rectangle Method: '. + $EBOLD. + 'When we multiply two polynomials, we can always use'. + ' the Generic Rectangle Method.'; + + if ($poly1->string eq $poly2->string) { + $outputString .= " Note that ". + '\('. + $problem->TeX.'='.$squareExtra->TeX. + '\)'; + } + + $outputString .= $PAR. + 'We mark the bases of the top-row rectangles '. + "with the first polynomial's terms, ". + 'and mark the heights of the left-colum rectangles '. + "with the second polynomials's terms, we have:". + $PAR; + + $outputString .= $BCENTER. + image(insertGraph( $picture[0] ), tex_size=>400, height=>400, width=>400, extra_html_tags=>"alt= '$alt0' title= '$alt0'"). + $ECENTER. + $PAR; + + $outputString .= "Next, we calculate each rectangle's area:". + $PAR; + + $outputString .= $BCENTER. + image(insertGraph( $picture[1] ), tex_size=>400, height=>400, width=>400, extra_html_tags=>"alt= '$alt1' title= '$alt1'"). + $ECENTER. + $PAR; + + $finalLine = ""; + if ($distributive2ndStep->string ne $ans->string) { + $finalLine = '\newline &='.$ans->TeX; + } + + $outputString .= "Finally, we add up all rectangle's area, and the result ". + "is those two polynomial's product:". + '\[\begin{aligned}[t]'. + $problem->TeX. + '&='. + $distributive2ndStep->TeX. + $finalLine. + '\end{aligned}\]'. + $PAR; + + Context("LimitedPolynomial-Strict"); + Context()->variables->are($v1=>'Real',$v2=>'Real',$v3=>'Real',$v4=>'Real'); + $ans = Formula($ans); + + return ($ans, $problem, $outputString); +} + + + +############################################## +BEGIN_PGML_SOLUTION + +[$output]* + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication30.pg new file mode 100644 index 0000000000..c574790cc2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication30.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (ax+b)(x+c) +# +# +# a is an integer on [2,10] +# b and c are integers on the interval [1,10], and $b!=$c +# +# Last updated: Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: ($a x + $b) +$a = random(2,10,1); +$b=$a; +$b = random(1,10,1) while($b==$a); +@poly1array = ($a,$b); + +# setup the binomial: (x+$c) +$c=$b; +$c = random(1,10,1) while($c==$b); +@poly2array = (1,$c); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication35.pg new file mode 100644 index 0000000000..ddb286bbd6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication35.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (x+a)(x+b) +# +# +# a is an integer on the interval [1,10], and +# b is an integer on the interval [-10,1] +# +# Last updated: Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: (x+$a) +$a = random(1,10,1); +@poly1array = (1,$a); + +# setup the binomial: (x+$b) +$b = random(-10,-1,1); +@poly2array = (1,$b); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication40.pg new file mode 100644 index 0000000000..98145ff383 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication40.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (x+a)(x+b) +# +# +# a and b are integers on the interval [-10,-1], and $b!=$a +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: (x+$a) +$a = random(-10,-1,1); +@poly1array = (1,$a); + +# setup the binomial: (x+$b) +$b=$a; +$b = random(-10,-1,1) while($b==$a); +@poly2array = (1,$b); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication45.pg index 2a86313505..9a1d341235 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication45.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication45.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Binom_times_binom) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication5.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication5.pg new file mode 100644 index 0000000000..0491648b2b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication5.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find the product of the monomial and binomial +# +# a x * ( b* x + c ) +# +# +# a, b, and c can be any (non-zero) integer on the interval [-10,10], +# and none of them can be +-1. We ensure that $b!=$c. +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'x'; + +# setup the monomial: $a * x +$a = (random(1.5,9.5,1)+0.5)*random(-1,1,2); +@poly1array = ($a); +foreach my $i (1..1) {$poly1array[$i] = 0}; + +# setup the binomial: $c * x - $b +$b = (random(1.5,9.5,1)+0.5)*random(-1,1,2); +$c=$b; +$c = (random(1.5,9.5,1)+0.5)*random(-1,1,2) while($c==$b); +@poly2array = ($b,$c); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; + +# for the solution +@productarray = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyString(~~@productarray))->reduce; + +# make $poly1 and $poly2 into strings +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; + +# and make the answer into a string +$ans = $ans->substitute(x=>$var); + +Context("LimitedPolynomial-Strict"); +#Context()->variables->add($var=>'Real'); +$ans = Formula($ans)->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`[$poly1]\left([$poly2]\right)= `][________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We multiply the monomial by each term in the binomial, using +the properties of exponents to help us. [``` + \begin{aligned} + [$poly1]([$poly2])&=[$ans] + \end{aligned} + ```] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication50.pg new file mode 100644 index 0000000000..746bd83d8a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication50.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (a+x)(b+x) +# +# +# a and b are integers on the interval [1,10], and $b!=$a +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + +# setup the first binomial: (x+$a) +$a = random(1,10,1); +@poly1array = (1,$a); + +# setup the binomial: (x+$b) +$b=$a; +$b = random(1,10,1) while($b==$a); +@poly2array = (1,$b); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>ascending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>ascending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var,order=>ascending))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var,order=>ascending))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Find the product of the two *bi*nomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication55.pg index 6c3b0853f8..e47e26ac60 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication55.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication55.pg @@ -14,16 +14,18 @@ # Last updated: Carl Yao, 7/03/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Binom_times_binom) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -35,7 +37,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication60.pg new file mode 100644 index 0000000000..6f86fb6d9e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication60.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (ax+b)(cx+d) +# +# +# a and c are integers on [2,6] +# b and d are integers on the interval [1,10], and $b!=$c +# +# Last updated: Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: ($a x + $b) +$a = random(2,6,1); +$b=$a; +$b = random(1,10,1) while($b==$a); +@poly1array = ($a,$b); + +# setup the binomial: ($cx+$d) +$c=$a; +$c = random(1,6,1) while($c==$a); +$d=$c; +$d = random(1,10,1) while($d==$c); +@poly2array = ($c,$d); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication65.pg new file mode 100644 index 0000000000..8f0b9e50ca --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication65.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (ax+b)(cx+d) +# +# +# a and c are integers on [2,6] +# b and d are integers on the interval [-10,-1], and $b!=$c +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: ($a x + $b) +$a = random(2,6,1); +$b=$a; +$b = random(-10,-1,1) while(abs($b)==abs($a)); +@poly1array = ($a,$b); + +# setup the binomial: ($cx+$d) +$c=$a; +$c = random(1,6,1) while($c==$a); +$d=$c; +$d = random(-10,-1,1) while(abs($d)==abs($c)); +@poly2array = ($c,$d); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication70.pg new file mode 100644 index 0000000000..5cc19e51b0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication70.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (ax+b)(x+c) +# +# +# a is an integer on [2,10] +# b and c are integers on the interval [-10,-1], and $b!=$c +# +# Last updated: Carl Yao, 7/03/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: ($a x + $b) +$a = random(2,10,1); +$b=$a; +$b = random(-10,-1,1) while(abs($b)==abs($a)); +@poly1array = ($a,$b); + +# setup the binomial: (x+$c) +$c=$b; +$c = random(-10,-1,1) while($c==$b); +@poly2array = (1,$c); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication75.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication75.pg new file mode 100644 index 0000000000..39701506b8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication75.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (ax+b)(x+c) +# +# +# a is an integer on [2,10] +# b is an integer on [-10,-1] and c is an integer on [1,10] +# +# Last updated: Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: ($a x + $b) +$a = random(2,10,1); +$b=$a; +$b = random(-10,-1,1) while(abs($b)==abs($a)); +@poly1array = ($a,$b); + +# setup the binomial: (x+$c) +$c=$b; +$c = random(1,10,1) while(abs($c)==abs($b)); +@poly2array = (1,$c); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique: *F*irst *O*utside *I*nside *L*ast. [``` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + ```] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication80.pg new file mode 100644 index 0000000000..c018f64936 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication80.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (ax+b)(cx^2+d) +# +# +# a and c are integers on [2,6] +# b and d are integers on the interval [-10,-1], and $b!=$c +# +# Last updated: Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# setup the first binomial: ($a x + $b) +$a = random(2,6,1); +$b=$a; +$b = random(-10,-1,1) while(abs($b)==abs($a)); +@poly1array = ($a,$b); + +# setup the binomial: ($cx+$d) +$c=$a; +$c = random(1,6,1) while($c==$a); +$d=$c; +$d = random(-10,-1,1) while(abs($d)==abs($c)); +@poly2array = ($c,0,$d); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array,order=>descending,var=>$var))->reduce->reduce; +$poly2 = Formula(PolyString(~~@poly2array,order=>descending,var=>$var))->reduce->reduce; + + +# for the solution + +$ans = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>simplified,var=>$var))->reduce->reduce; + +$soln1 = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln1]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication85.pg index 49b4cff07a..81bf71dbbc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication85.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication85.pg @@ -13,16 +13,18 @@ # Last updated: Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Binom_times_binom) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -34,7 +36,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -77,7 +79,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find the product of the two *bi*nomials. +Multiply the polynomials. [`\left([$poly1]\right)\left([$poly2]\right)= `][________________________________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication90.pg index 3349f71748..3055a76802 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication90.pg @@ -12,16 +12,18 @@ # Last updated: Carl Yao, 7/04/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Binom_times_binom) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') ## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -33,7 +35,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication95.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication95.pg new file mode 100644 index 0000000000..e53a890346 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication95.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Chris Hughes +# Portland Community College +# +# Template: +# Find product of the two binomials +# +# (x+a)(x+b) +# +# +# a and b can be any integer on the interval [-10,-1]. +# +# Last updated: Carl Yao, 7/04/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','binomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'x'; + +# setup the first binomial: (x+$a) +$a = random(-10,-1,1); +@poly1array = (1,$a); + +# setup the binomial: (x+$b) +$b=$a; +$b = random(-10,-1,1) while($b==$a); +@poly2array = (1,$b); + +# reduction check +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; + +# for the solution +@productarray = PolyMult(~~@poly1array,~~@poly2array); +$ans = Formula(PolyString(~~@productarray))->reduce; + +# make $poly1 and $poly2 into strings +$poly1 = $poly1->substitute(x=>$var)->reduce; +$poly2 = $poly2->substitute(x=>$var)->reduce; + +# for the solution +$soln = Formula(PolyMult(~~@poly1array,~~@poly2array,output=>unsimplified,var=>$var))->reduce->reduce; + +# and make the answer into a string +$ans = $ans->substitute(x=>$var); + +Context("LimitedPolynomial-Strict"); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Find the product of the two *bi*nomials. + + [`\left([$poly1]\right)\left([$poly2]\right)= `][________________]{$ans} + +END_PGML + + +BEGIN_PGML_SOLUTION + +We use the FOIL technique- *F*irst *O*utside *I*nside *L*ast + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=[$soln]\\ + &=[$ans] + \end{aligned} + `] +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication10.pg new file mode 100644 index 0000000000..b29073dc87 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication10.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial multiplication application problem. +# Calculate a rectangle's area. +# Answer is b(2b-4)=2b^2-4b +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'w'; +Context()->variables->are($var=>'Real'); + +$a = random(1,10,1); +$b = random(2,5,1); + +$numText = ($b==2) ? "\text{twice}" : "$b \text{ times}"; + +$ans = Compute("$b*w**2-$a*w")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A rectangle's length is [`[$a]`] feet shorter than [`[$numText]`] its width. If we use [`w`] to represent the rectangle's width, use a polynomial to represent the rectangle's area in expanded form. + + [`` \text{area}=``][__________________]{$ans} square feet + +END_PGML + +########################################################## + +BEGIN_PGML_SOLUTION + +The rectangle's width is [`w`] feet. Since the rectangle's length is [`[$a]`] feet shorter than [`[$numText]`] its width, its length is [`[$b]w-[$a]`] feet. A rectangle's area formula is: + + [`` \text{area}=(\text{length})\cdot(\text{width}) ``] + +After substitution, we have: + + [`` +\begin{aligned} + \text{area} &= (\text{length})\cdot(\text{width}) \\ + &= ([$b]w-[$a])w \\ + &=[$ans] +\end{aligned} + ``] + +The rectangle's area is [`[$ans]`] square feet. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication100.pg new file mode 100644 index 0000000000..edf06d8b28 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication100.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial multiplication application problem. +# Calculate a rectangular prism's volume. +# V = l w h +# = (h+2)(h-4)h +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'h'; +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +do {$b = non_zero_random(-10,10,1);} until ($a!=$b); + +$aPlusB = $a+$b; +$ab = $a*$b; + +$ans = Compute("h**3+$aPlusB*h**2+$ab*h")->reduce; + +$step1 = Compute("(h+$a)(h+$b)h")->reduce; +$step2 = Compute("(h(h+$a)+$b(h+$a))h")->reduce; +$step3 = Compute("(h**2+$a*h+$b*h+$ab)h")->reduce; +$step4 = Compute("(h**2+$aPlusB*h+$ab)h")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + +if ($a>0) { + $longOrShort1 = "longer"; + $aN = $a; +} else { + $longOrShort1 = "shorter"; + $aN = -$a; +} + +if ($b>0) { + $longOrShort2 = "longer"; + $bN = $b; +} else { + $longOrShort2 = "shorter"; + $bN = -$b; +} + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A rectangular prism's volume can be calculated by the formula: + + [`` V = lwh ``] + +where [`V`] stands for volume, [`l`] stands for the base's length, [`w`] stands for the base's width, and [`h`] stands for the prism's height. + +For a rectangular prism, its base's length is [`[$aN]`] units [$longOrShort1] than its height, and its base's width is [`[$bN]`] units [$longOrShort2] than its height. Express the prism's volume in terms of its height, [`h`], with an expanded polynomial. + + [`` V =``][________________]{$ans} + +END_PGML + + +########################################################## + +BEGIN_PGML_SOLUTION + +A rectangular prism's volume formula is: + + [`` V = lwh ``] + +Since the prism base's length is [`[$aN]`] units [$longOrShort1] than its height, the length is [`h+[$a]`] units. + +Similarly, the prism base's width is [`[$bN]`] units [$longOrShort2] than its height, the width is [`h+[$b]`] units. + +After substitution, we have: + + [`` +\begin{aligned} + V &= lwh \\ + &= [$step1] \\ + &= [$step2] \\ + &= [$step3] \\ + &= [$step4] \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication20.pg new file mode 100644 index 0000000000..685b343423 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication20.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial multiplication application problem. +# Calculate the area of a triangle. +# Answer is 1/2 b (2b-4)=b^2-2b +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'b'; +Context()->variables->are($var=>'Real'); + +$a = random(2,10,2); +$b = random(2,6,2); + +$numText = ($b==2) ? "\text{twice}" : "$b \text{ times}"; + +$c = $a/2; +$d = $b/2; + +$ans = Compute("$d*b**2+$c*b")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->add($var=>'Real'); +$ans = Formula($ans)->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A triangle's height is [`[$a]`] feet longer than [`[$numText]`] its base. If we use [`b`] to represent the triangle's base, use a polynomial to represent the triangle's area in expanded form. A triangle's area can be calculated by [` A=\frac{1}{2}bh `], where [`b`] stands for base, and [`h`] stands for height. + + [`` \text{area}=``][__________________]{$ans} square feet + +END_PGML + +########################################################## + +BEGIN_PGML_SOLUTION + +The triangle's base is [`b`] feet. Since the triangle's height is [`[$a]`] feet longer than [`[$numText]`] its base, its height is [`[$b]b+[$a]`] feet. We substitute those two values into a triangle's area formula, and we have: + + [`` +\begin{aligned} + A &= \frac{1}{2}bh \\ + &= \frac{1}{2}b([$b]b+[$a]) \\ + &= \frac{1}{2}[$b]b^2+\frac{1}{2}[$a]b \\ + &=[$ans] +\end{aligned} + ``] + +The triangle's area is [`[$ans]`] square feet. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication30.pg new file mode 100644 index 0000000000..557cda3290 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication30.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial multiplication application problem. +# Calculate the area of a trapezoid. +# Answer is 1/2 h (h+3+h+5)=h^2+4h +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'h'; +Context()->variables->are($var=>'Real'); + +do { + $a = random(1,10,1); + do {$b = random(1,10,1);} until ($a!=$b); +} until (($a+$b)%2==0); + +$c = ($a+$b)/2; + +$ans = Compute("h**2+$c*h")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->add($var=>'Real'); +$ans = Formula($ans)->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A trapezoid's top base is [`[$a]`] feet longer than its height, and its bottom base is [`[$b]`] feet longer than its height. If we use [`h`] to represent the trapezoid's height, use a polynomial to represent the trapezoid's area in expanded form. A trapezoid's area can be calculated by [` A=\frac{1}{2}(a+b)h `], where [`a`] stands for the top base, [`b`] stands for the bottom base, and [`h`] stands for height. + + [`` \text{area}=``][__________________]{$ans} square feet + +END_PGML + +########################################################## + +BEGIN_PGML_SOLUTION + +The trapezoid's height is [`h`] feet. Since the trapezoid's top base is [`[$a]`] feet longer than its height, its top base is [`h+[$a]`] feet; similarly, its bottom base is [`h+[$a]`] feet. We substitute those values into a trapezoid's area formula, and we have: + + [`` +\begin{aligned} + A &= \frac{1}{2}(a+b)h \\ + &= \frac{1}{2}(h+[$a]+h+[$b])h \\ + &= \frac{1}{2}h(2h+[$a+$b]) \\ + &= \frac{1}{2}2h^2+\frac{1}{2}[$a+$b]h \\ + &= [$ans] +\end{aligned} + ``] + +The trapezoid's area is [`[$ans]`] square feet. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication40.pg new file mode 100644 index 0000000000..dbe06afe15 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication40.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial multiplication application problem. +# Calculate a rectangle's area. +# Answer is (x+3)(x+5)=x^2+8x+15 +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'x'; +#Context()->variables->are($var=>'Real'); + +$a = random(2,10,1)*random(-1,1,2); +do {$b = random(2,10,1)*random(-1,1,2);} until ($a!=$b); +$ab = $a*$b; +$aPlusB = $a+$b; + +$poly1 = Compute("x+$a")->reduce; +$poly2 = Compute("x+$b")->reduce; +$ans = Compute("x**2+$aPlusB*x+$ab")->reduce; + +$step2 = Compute("x*($poly1)+$b*($poly1)")->reduce; +$step3 = Compute("x^2+$a*x+$b*x+$b*$a")->reduce; + +Context("LimitedPolynomial-Strict"); +#Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A rectangle's base can be modeled by [`[$poly1]`] meters, and its height can be modeled by [`[$poly2]`] meters. Use a polynomial to represent the rectangle's area in expanded form. + + [`` \text{area}=``][__________________]{$ans} square meters + +END_PGML + +########################################################## + +BEGIN_PGML_SOLUTION + +A rectangle's area formula is: + + [`` \text{area}=(\text{length})\cdot(\text{width}) ``] + +After substitution, we have: + + [`` +\begin{aligned} + \text{area} &= (\text{length})\cdot(\text{width}) \\ + &= ([$poly1])([$poly2]) \\ + &= [$step2] \\ + &= [$step3] \\ + &= [$ans] +\end{aligned} + ``] + +The rectangle's area is [`[$ans]`] square meters. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication50.pg new file mode 100644 index 0000000000..268c3b158a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication50.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial multiplication application problem. +# +# Answer is (10+2x)(100-5x)=-10x^2+50x+1000 +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'x'; +#Context()->variables->are($var=>'Real'); + +$a = random(10,20,1); +$b = random(100,150,10); +$c = random(2,5,1); +$d = random(5,10,1); + +$ad = $a*$d; +$ab = $a*$b; +$bc = $b*$c; +$cd = $c*$d; + +$e = $bc-$ad; + +$poly1 = Compute("$a+$c*x")->reduce; +$poly2 = Compute("$b-$d*x")->reduce; +$ans = Compute("-$cd*x**2+$e*x+$ab")->reduce; + +$step1 = Compute("($poly1)*($poly2)")->reduce; +$step2 = Compute("$b($a+$c*x)-$d*x($a+$c*x)")->reduce; +$step3 = Compute("$ab+$bc*x-$ad*x-$cd*x**2")->reduce; + +Context("Currency"); +$aC = Currency($a); +$cC = Currency($c); + +Context("LimitedPolynomial-Strict"); +#Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +An artist sells his paintings at [`[$aC]`] per piece. Currently, he can sell [`[$b]`] paintings per year. Thus, his annual income from paintings is [`[$a]\cdot[$b]=[$a*$b]`] dollars. He plans to raise the price. However, for each [`[$cC]`] of price increase per painting, his customers would buy [`[$d]`] fewer paintings annually. + +Assume the artist would raise the price of his painting [`x`] times, each time by [`[$cC]`]. Use an expanded polynomial to represent his new income per year. + + [`` \text{new annual income}=``][_________________]{$ans} dollars + +END_PGML + +########################################################## + +BEGIN_PGML_SOLUTION + +Currently, each painting costs [`[$aC]`]. After raising the price [`x`] times, each time by [`[$cC]`], each painting's new price would be [`[$poly1]`] dollars. + +Currently, the artist sells [`[$b]`] paintings per year. After raising the price [`x`] times, each time selling [`[$d]`] fewer paintings, he would sell [`[$poly2]`] paintings per year. + +His annual income can be calculated by multiplying each painting's price with the number of paintings he would sell: + + [`` +\begin{aligned} + \text{annual income} &= ([$poly1])([$poly2]) \\ + &= [$step1] \\ + &= [$step2] \\ + &= [$step3] \\ + &= [$ans] +\end{aligned} + ``] + +After raising the price [`x`] times, each time by [`[$cC]`], the artist's annual income from paintings would be [`[$ans]`] dollars. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication60.pg new file mode 100644 index 0000000000..8fd63c9209 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication60.pg @@ -0,0 +1,137 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial multiplication application problem. +# Calculate a circle's area. +# Answer is pi(x+3)^2=pi x^2+6pi x+9 +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(3,10,1)*random(-1,1,2); +$a2 = 2*$a; +$aSquare = $a**2; + +$ans1 = Compute("pi*x**2+$a2*pi*x+$aSquare*pi")->reduce->TeX; +$ans2 = Compute("pi*x**2+$a*pi*x+$aSquare*pi")->reduce->TeX; +$ans3 = Compute("pi*x**2+$a2*pi*x+$a*pi")->reduce->TeX; +$ans4 = Compute("pi*x**2+$aSquare*pi")->reduce->TeX; + +$step1 = Compute("pi*(x+$a)**2")->reduce; +$step2 = Compute("pi*(x+$a)(x+$a)")->reduce; +$step3 = Compute("pi*(x*(x+$a)+$a*(x+$a))")->reduce; +$step4 = Compute("pi*(x**2+$a*x+$a*x+$a*$a)")->reduce; +$step5 = Compute("pi*(x**2+$a2*x+$aSquare)")->reduce; + +@answers = ( + main::math_ev3($ans1), + main::math_ev3($ans2), + main::math_ev3($ans3), + main::math_ev3($ans4), +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +@answersShuffled = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; + $answersShuffled[$i] = @answers[$scramble{$i}]; + $answersShuffled[$i]=$ALPHABET[$i].'. '.$answersShuffled[$i]; +}; + +$correctAns = @answersShuffled[$inverse{0}]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, +); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A circle's radius can be modeled by [`x+[$a]`] units. Use an expanded polynomial to represent the circle's area. A circle's area formula is [`A=\pi r^2`], where [`r`] stands for radius. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +########################################################## + +$formula = ($a>0) ? "(a+b)^2 &= a^2+2ab+b^2" : "(a-b)^2 &= a^2-2ab+b^2"; + + +BEGIN_PGML_SOLUTION + +A circle's area formula is: + + [`` A=\pi r^2 ``] + +It's given the radius is [`x+[$a]`]. After substitution, we have: + + [`` +\begin{aligned} + A &= \pi r^2 \\ + &= [$step1] \\ + &= [$step2] \\ + &= [$step3] \\ + &= [$step4] \\ + &= [$step5] \\ + &= [$ans1] +\end{aligned} + ``] + +The correct solution is: [$correctAns] + +In the solution, we used the distributive property to expand [`(x+[$a])^2`]. We could have used the Perfect Square Formula: + + [`` +\begin{aligned} + [$formula] \\ + (x+[$a])^2 &= (x)^2+2(x)([$a])+([$a])^2 \\ + &= x^2+[$a2]x+[$aSquare] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication70.pg new file mode 100644 index 0000000000..6c394ca146 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication70.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial multiplication application problem. +# Calculate a circle's area. +# Answer is pi(2x+3)^2=4pi x^2+12pi x+9 +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(-10,-1,1); +$a2 = 2*$a; +$aSquare = $a**2; + +$b = random(2,5,1); +$b2 = 2*$b; +$bSquare = $b**2; + +$ab2 = 2*$a*$b; +$ab = $a*$b; + +$ans1 = Compute("$bSquare*pi*x**2+$ab2*pi*x+$aSquare*pi")->reduce->TeX; +$ans2 = Compute("$bSquare*pi*x**2+$ab2*pi*x-$aSquare*pi")->reduce->TeX; +$ans3 = Compute("$bSquare*pi*x**2+$ab*pi*x+$aSquare*pi")->reduce->TeX; +$ans4 = Compute("$bSquare*pi*x**2+$aSquare*pi")->reduce->TeX; + +$step1 = Compute("pi*($b*x+$a)**2")->reduce; +$step2 = Compute("pi*($b*x+$a)($b*x+$a)")->reduce; +$step3 = Compute("pi*($b*x*($b*x+$a)+$a*($b*x+$a))")->reduce; +$step4 = Compute("pi*($bSquare*x**2+$ab*x+$ab*x+$a*$a)")->reduce; +$step5 = Compute("pi*($bSquare*x**2+$ab2*x+$aSquare)")->reduce; + +@answers = ( + main::math_ev3($ans1), + main::math_ev3($ans2), + main::math_ev3($ans3), + main::math_ev3($ans4), +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +@answersShuffled = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; + $answersShuffled[$i] = @answers[$scramble{$i}]; + $answersShuffled[$i]=$ALPHABET[$i].'. '.$answersShuffled[$i]; +}; + +$correctAns = @answersShuffled[$inverse{0}]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, +); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A circle's radius can be modeled by [`[$b]x+[$a]`] units. Use an expanded polynomial to represent the circle's area. A circle's area formula is [`A=\pi r^2`], where [`r`] stands for radius. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +########################################################## + +BEGIN_PGML_SOLUTION + +A circle's area formula is: + + [`` A=\pi r^2 ``] + +It's given the radius is [`[$b]x+[$a]`]. After substitution, we have: + + [`` +\begin{aligned} + A &= \pi r^2 \\ + &= [$step1] \\ + &= [$step2] \\ + &= [$step3] \\ + &= [$step4] \\ + &= [$step5] \\ + &= [$ans1] +\end{aligned} + ``] + +The correct solution is: [$correctAns] + +In the solution, we used the distributive property to expand [`([$b]x+[$a])^2`]. We could have used the Perfect Square Formula: + + [`` +\begin{aligned} + (a-b)^2 &= a^2-2ab+b^2 \\ + ([$b]x+[$a])^2 &= ([$b]x)^2+2([$b]x)([$a])+([$a])^2 \\ + &= [$bSquare]x^2+[$ab2]x+[$aSquare] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication80.pg new file mode 100644 index 0000000000..24a89faa50 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication80.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial multiplication application problem. +# Calculate a cylinder's surface area. +# A = 2 pi r^2 + 2 pi r h +# = 2 pi (h-4)^2 + 2 pi (h-4) h +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'h'; +Context()->variables->are($var=>'Real'); + +$a = random(-10,-1,1); +$a2 = 2*$a; +$aSquare = $a**2; +$aN = -$a; + +$ans1 = Compute("4*pi*h**2+6*$a*pi*h+2*$aSquare*pi")->reduce->TeX; +$ans2 = Compute("2*pi*h**2+6*$a*pi*h+2*$aSquare*pi")->reduce->TeX; +$ans3 = Compute("4*pi*h**2+8*$a*pi*h+2*$aSquare*pi")->reduce->TeX; +$ans4 = Compute("4*pi*h**2+4*$a*pi*h+2*$aSquare*pi")->reduce->TeX; + +$step1 = Compute("2*pi*(h+$a)**2+2*pi*(h+$a)*h")->reduce; +$step2 = Compute("2*pi*(h**2+$a2*h+$aSquare)+2*pi*h*(h+$a)")->reduce; +$step3 = Compute("2*pi*h**2+2*$a2*pi*h+2*$aSquare*pi+2*pi*h**2+2*$a*pi*h")->reduce; + +@answers = ( + main::math_ev3($ans1), + main::math_ev3($ans2), + main::math_ev3($ans3), + main::math_ev3($ans4), +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +@answersShuffled = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; + $answersShuffled[$i] = @answers[$scramble{$i}]; + $answersShuffled[$i]=$ALPHABET[$i].'. '.$answersShuffled[$i]; +}; + +$correctAns = @answersShuffled[$inverse{0}]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, +); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A cylinder's surface area can be calculated by the formula: + + [`` A = 2\pi r^2 + 2\pi rh ``] + +where [`A`] stands for surface area, [`r`] stands for the base's radius, and [`h`] stands for the cylinder's height. + +If a cylinder's radius is [`[$aN]`] units shorter than its height, express the cylinder's surface area in terms of its height, [`h`], with an expanded polynomial. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +########################################################## + +BEGIN_PGML_SOLUTION + +A cylinder's surface area formula is: + + [`` A = 2\pi r^2 + 2\pi rh ``] + +Since the radius is [`[$aN]`] shorter than the height, the radius is [`h+[$a]`] units. After substitution, we have: + + [`` +\begin{aligned} + A &= 2\pi r^2 + 2\pi rh \\ + A &= [$step1] \\ + &= [$step2] \\ + &= [$step3] \\ + &= [$ans1] +\end{aligned} + ``] + +The correct solution is: [$correctAns] + +In the solution, we used the Perfect Square Formula to expand [`(h+[$a])^2`]: + + [`` +\begin{aligned} + (a-b)^2 &= a^2-2ab+b^2 \\ + (h+[$a])^2 &= (h)^2+2(h)([$a])+([$a])^2 \\ + &= h^2+[$a2]h+[$aSquare] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication90.pg new file mode 100644 index 0000000000..a22d564be5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/PolynomialMultiplicationApplication90.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Polynomial multiplication application problem. +# Calculate a cylinder's volume. +# V = pi r^2 h +# = pi (h+3)^2 h +# +# Last updated: Carl Yao, 11/29/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions') +## KEYWORDS('exponent','multiply','polynomial','distribute','monomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = 'h'; +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,-1,1); +$a2 = 2*$a; +$aSquare = $a**2; +$aN = -$a; + +$ans1 = Compute("pi*h**3+$a2*pi*h**2+$aSquare*pi*h")->reduce->TeX; +$ans2 = Compute("pi*h**2+$a2*pi*h+$aSquare*pi")->reduce->TeX; +$ans3 = Compute("pi*h**3+$a*pi*h**2+$aSquare*pi*h")->reduce->TeX; +$ans4 = Compute("pi*h**3+$a2*h**2+$aSquare*h")->reduce->TeX; + +$step1 = Compute("pi*(h+$a)**2*h")->reduce; +$step2 = Compute("pi*h*(h+$a)**2")->reduce; +$step3 = Compute("pi*h*(h**2+$a2*h+$aSquare)")->reduce; + +@answers = ( + main::math_ev3($ans1), + main::math_ev3($ans2), + main::math_ev3($ans3), + main::math_ev3($ans4), +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +@answersShuffled = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; + $answersShuffled[$i] = @answers[$scramble{$i}]; + $answersShuffled[$i]=$ALPHABET[$i].'. '.$answersShuffled[$i]; +}; + +$correctAns = @answersShuffled[$inverse{0}]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + order => ~~@answersShuffled, +); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A cylinder's volume can be calculated by the formula: + + [`` V = \pi r^2h ``] + +where [`V`] stands for volume, [`r`] stands for the base's radius, and [`h`] stands for the cylinder's height. + +If a cylinder's radius is [`[$aN]`] units shorter than its height, express the cylinder's volume in terms of its height, [`h`], with an expanded polynomial. + + [@$radio->buttons()@]* + +END_PGML + +ANS( $radio->cmp() ); + +########################################################## + +BEGIN_PGML_SOLUTION + +A cylinder's volume formula is: + + [`` A = \pi r^2h ``] + +Since the radius is [`[$aN]`] shorter than the height, the radius is [`h+[$a]`] units. After substitution, we have: + + [`` +\begin{aligned} + A &= \pi r^2h \\ + &= [$step1] \\ + &= [$step2] \\ + &= [$step3] \\ + &= [$ans1] +\end{aligned} + ``] + +The correct solution is: [$correctAns] + +In the solution, we used the Perfect Square Formula to expand [`(h+[$a])^2`]: + + [`` +\begin{aligned} + (a-b)^2 &= a^2-2ab+b^2 \\ + (h+[$a])^2 &= (h)^2+2(h)([$a])+([$a])^2 \\ + &= h^2+[$a2]h+[$aSquare] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar100.pg new file mode 100644 index 0000000000..9c65453e5c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar100.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a x + b y)( c x + d y) +# +# a = c integer on [2,10] +# b = d, are integer on [-10,10] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$a = random(2,10,1); +$c = $a; +$b = random(2,10,1)*random(-1,1,2); +$d = $b; + +# could replace these with other letters if desired +$var1 = 'a'; +$var2 = 'b'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1")->reduce; +$term2 = Formula("$b*$var2")->reduce; +$term3 = Formula("$c*$var1")->reduce; +$term4 = Formula("$d*$var2")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$c*$var1^2+($b*$c+$a*$d)*$var1*$var2+($b*$d)$var2^2")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce('x*n'=>0)->reduce('x*n'=>0); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Expand the square of a *bi*nomial. + + [`` + ([$poly1])^2 = +``][____________________________]{$ans} + +END_PGML + +$a1 = abs($a); +$b1 = abs($b); + +$connector = "+"; +$connector = "-" if($b<0); + +$sumDiff = "sum"; +$sumDiff = "difference" if($b<0); + + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)^2 & = \left([$poly1]\right)\left([$poly2]\right)\\ + &= [$soln]\\ + & = [$ans] + \end{aligned} +``] + +Alternatively, we might observe that this is the square of _the [$sumDiff] of two terms_, in which case we may use the formula + + [``(x[$connector]y)^2=x^2[$connector]2xy+y^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=\left([$a1][$var1]\right)^2[$connector]2\cdot [$a1][$var1]\cdot[$b1][$var2]+([$b1][$var2])^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar105.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar105.pg new file mode 100644 index 0000000000..7d3aebfd34 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar105.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a xy + b )( c xy + d ) +# +# a = c integer on [2,10] +# b = d, are integer on [-10,10] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$a = random(2,10,1); +$c = $a; +$b=$a; +$b = random(2,10,1)*random(-1,1,2)while($b==$a); +$d=$b; + +# could replace these with other letters if desired +$var1 = 'a'; +$var2 = 'b'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1*$var2")->reduce; +$term2 = Formula("$b")->reduce; +$term3 = Formula("$c*$var1*$var2")->reduce; +$term4 = Formula("$d")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$c*$var1^2*$var2^2+($b*$c+$a*$d)*$var1*$var2+($b*$d)")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce('x*n'=>0)->reduce('x*n'=>0); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Expand the square of a *bi*nomial. + + [`` + ([$poly1])^2 = +``][____________________________]{$ans} + +END_PGML + +$a1 = abs($a); +$b1 = abs($b); + +$connector = "+"; +$connector = "-" if($b<0); + +$sumDiff = "sum"; +$sumDiff = "difference" if($b<0); + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)^2 & =\left([$poly1]\right)\left([$poly2]\right)\\ + &= [$soln]\\ + & = [$ans] + \end{aligned} +``] + + +Alternatively, we might observe that this is the square of _the [$sumDiff] of two terms_, in which case we may use the formula + + [``(x[$connector]y)^2=x^2[$connector]2xy+y^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=\left([$a1][$var1][$var2]\right)^2 [$connector] 2\cdot [$a1][$var1][$var2]\cdot[$b1]+[$b1]^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar110.pg new file mode 100644 index 0000000000..4f6c9d7509 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar110.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a x^2 + b y^2)( c x^2 + d y^2) +# +# a, c, are 1 in this problem +# b = d, are integer on [-10,10] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$a = 1; +$c = 1; +$b = random(2,10,1)*random(-1,1,2); +$d=$b; + +# could replace these with other letters if desired +$var1 = 'x'; +$var2 = 'y'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1^2")->reduce; +$term2 = Formula("$b*$var2^2")->reduce; +$term3 = Formula("$c*$var1^2")->reduce; +$term4 = Formula("$d*$var2^2")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$c*$var1^4+($b*$c+$a*$d)*$var1^2*$var2^2+($b*$d)$var2^4")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce('x*n'=>0)->reduce('x*n'=>0); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Expand the square of a *bi*nomial. + + [`` + ([$poly1])^2 = +``][____________________________]{$ans} + +END_PGML + +$a1 = abs($a); +$b1 = abs($b); + +$connector = "+"; +$connector = "-" if($b<0); + +$sumDiff = "sum"; +$sumDiff = "difference" if($b<0); + + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)^2 & = \left([$poly1]\right)\left([$poly2]\right)\\ + &= [$soln]\\ + & = [$ans] + \end{aligned} +``] + +Alternatively, we might observe that this is the square of _the [$sumDiff] of two terms_, in which case we may use the formula + + [``(a[$connector]b)^2=a^2[$connector]2ab+b^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=\left([$var1]^2\right)^2 [$connector] 2\cdot [$var1]^2\cdot[$b1][$var2]^2+([$b1][$var2]^2)^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. + + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar115.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar115.pg new file mode 100644 index 0000000000..fd2eb990d7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar115.pg @@ -0,0 +1,126 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a x + b y)( c x + d y) +# +# a = c, are integer on [-10,10] +# d = -b, are integer on [-10,10] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL','difference of squares') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$a = random(2,10,1); +$c = $a; +$b = random(2,10,1)*random(-1,1,2); +$d=-$b; + +# could replace these with other letters if desired +$var1 = 'x'; +$var2 = 'y'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1")->reduce; +$term2 = Formula("$b*$var2")->reduce; +$term3 = Formula("$c*$var1")->reduce; +$term4 = Formula("$d*$var2")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$c*$var1^2+($b*$c+$a*$d)*$var1*$var2+($b*$d)$var2^2")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce('x*n'=>0)->reduce('x*n'=>0); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`` + ([$poly1])([$poly2]) = +``][____________________________]{$ans} + +END_PGML + +$a1 = abs($a); +$b1 = abs($b); + + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&= [$soln]\\ + & = [$ans] + \end{aligned} +``] + +Alternatively, we might observe that this is the product of _the sum and difference of two terms_, in which case we may use the formula + + [``(a-b)(a+b)=a^2-b^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=\left([$a1][$var1]\right)^2 -([$b1][$var2])^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. + + + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar120.pg new file mode 100644 index 0000000000..ffed53297b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar120.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a xy + b )( c xy + d ) +# +# a = c both are 1 +# b = -d, are integer on [-10,10] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL','difference of squares') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$a = 1; +$c = $a; +$b=$a; +$b = random(2,10,1)*random(-1,1,2)while($b==$a); +$d=-$b; + +# could replace these with other letters if desired +$var1 = 'a'; +$var2 = 'b'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1*$var2")->reduce; +$term2 = Formula("$b")->reduce; +$term3 = Formula("$c*$var1*$var2")->reduce; +$term4 = Formula("$d")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$c*$var1^2*$var2^2+($b*$c+$a*$d)*$var1*$var2+($b*$d)")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce('x*n'=>0)->reduce('x*n'=>0); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`` + ([$poly1])([$poly2]) = +``][____________________________]{$ans} + +END_PGML + +$a1 = abs($a); +$b1 = abs($b); + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right) &= [$soln]\\ + & = [$ans] + \end{aligned} +``] + +Alternatively, we might observe that this is the product of _the sum and difference of two terms_, in which case we may use the formula + + [``(x-y)(x+y)=x^2-y^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=\left([$var1][$var2]\right)^2 -([$b1][$var2])^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. + + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar125.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar125.pg new file mode 100644 index 0000000000..d972da22dc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar125.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a x^2 + b y^2)( c x^2 + d y^2) +# +# a, c, are 1 in this problem +# b = -d, are integer on [-10,10] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL','difference of squares') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$a = 1; +$c = 1; +$b = random(2,10,1)*random(-1,1,2); +$d=-$b; + +# could replace these with other letters if desired +$var1 = 'x'; +$var2 = 'y'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1^2")->reduce; +$term2 = Formula("$b*$var2^2")->reduce; +$term3 = Formula("$c*$var1^2")->reduce; +$term4 = Formula("$d*$var2^2")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$c*$var1^4+($b*$c+$a*$d)*$var1^2*$var2^2+($b*$d)$var2^4")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce('x*n'=>0)->reduce('x*n'=>0); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`` + ([$poly1])([$poly2]) = +``][____________________________]{$ans} + +END_PGML + +$a1 = abs($a); +$b1 = abs($b); + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right) &= [$soln]\\ + & = [$ans] + \end{aligned} +``] + +Alternatively, we might observe that this is the product of _the sum and difference of two terms_, in which case we may use the formula + + [``(a-b)(a+b)=a^2-b^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=\left([$var1]^2\right)^2 -\left([$b1][$var2]^2\right)^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. + + + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar130.pg new file mode 100644 index 0000000000..bad2163cb1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar130.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a x^m + b y^n)( c x^m + d y^n) +# +# a = c, are integer on [-10,10] +# d = -b, are integer on [-10,10] +# +# m, n integer on [2,8] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL','difference of squares') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x^m + b y^n)( c x^m + d y^n) +$a = random(2,10,1); +$c = $a; +$b = random(2,10,1)*random(-1,1,2); +$d=-$b; + +# exponents +$m = random(2,8,1); +$n = random(2,8,1); + +# could replace these with other letters if desired +$var1 = 'x'; +$var2 = 'y'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1^$m")->reduce; +$term2 = Formula("$b*$var2^$n")->reduce; +$term3 = Formula("$c*$var1^$m")->reduce; +$term4 = Formula("$d*$var2^$n")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$c*$var1^(2*$m)+($b*$c+$a*$d)*$var1^$m*$var2^$n+($b*$d)$var2^(2*$n)")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce('x*n'=>0)->reduce('x*n'=>0); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`` + ([$poly1])([$poly2]) = +``][____________________________]{$ans} + +END_PGML + +$a1 = abs($a); +$b1 = abs($b); + + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&= [$soln]\\ + & = [$ans] + \end{aligned} +``] + +Alternatively, we might observe that this is the product of _the sum and difference of two terms_, in which case we may use the formula + + [``(a-b)(a+b)=a^2-b^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=\left([$a1][$var1]^{[$m]}\right)^2 -\left([$b1][$var2]^{[$n]}\right)^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. + + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar135.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar135.pg new file mode 100644 index 0000000000..5ecd8da038 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar135.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a x^m y^p + b y^n)( c x^m y^p + d y^n) +# +# a = c, are integer on [-10,10] +# d = -b, are integer on [-10,10] +# +# m, n, p integer on [2,8] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL','difference of squares') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x^m + b y^n)( c x^m + d y^n) +$a = random(2,10,1); +$c = $a; +$b = random(2,10,1)*random(-1,1,2); +$d=-$b; + +# exponents +$m = random(2,8,1); +$n = random(2,8,1); +$p = random(2,8,1); + +# could replace these with other letters if desired +$var1 = 'x'; +$var2 = 'y'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1^$m*$var2^$p")->reduce; +$term2 = Formula("$b*$var2^$n")->reduce; +$term3 = Formula("$c*$var1^$m*$var2^$p")->reduce; +$term4 = Formula("$d*$var2^$n")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$c*$var1^(2*$m)*$var2^(2*$p)+($b*$c+$a*$d)*$var1^$m*$var2^($n+$p)+($b*$d)$var2^(2*$n)")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce('x*n'=>0)->reduce('x*n'=>0); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`` + ([$poly1])([$poly2]) = +``][____________________________]{$ans} + +END_PGML + +$a1 = abs($a); +$b1 = abs($b); + + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&= [$soln]\\ + & = [$ans] + \end{aligned} +``] + +Alternatively, we might observe that this is the product of _the sum and difference of two terms_, in which case we may use the formula + + [``(a-b)(a+b)=a^2-b^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)([$poly2])&=\left([$a1][$var1]^{[$m]}[$var2]^{[$p]}\right)^2 -\left([$b1][$var2]^{[$n]}\right)^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar140.pg index 46dc7aa9c1..f2532e9b90 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar140.pg @@ -18,16 +18,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MultPoly_2plusVars) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','multiply','polynomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -37,7 +39,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar145.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar145.pg index e58b851551..1215b436dd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar145.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar145.pg @@ -16,17 +16,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/9/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MultPoly_2plusVars) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','multiply','polynomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -36,7 +37,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,25 +81,22 @@ $ans = Formula($ans); TEXT(beginproblem()); BEGIN_PGML -Find the product - [`` - ([$poly1])([$poly2]) = -``][____________________________]{$ans} +Multiply the polynomials. + + [``([$poly1])([$poly2]) = ``][____________________________]{$ans} END_PGML BEGIN_PGML_SOLUTION We multiply the polynomials by using the terms from [`[$poly1]`] -successively - -[`` +successively. [``` \begin{aligned} \left([$poly1]\right)\left([$poly2]\right)&= [$soln]\\ & = [$ans] \end{aligned} -``] +```] END_PGML_SOLUTION ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar150.pg index c6547d7f4d..a52bb23dfc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar150.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar150.pg @@ -15,16 +15,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/9/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MultPoly_2plusVars) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','multiply','polynomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,7 +36,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar155.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar155.pg new file mode 100644 index 0000000000..eb736ab367 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar155.pg @@ -0,0 +1,137 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a x^m y^n + b )( c x^m y^n + d ) +# +# a = c = 1 for this problem +# b = d, are integer on [-10,10] +# +# m, n integer [2,8] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL','square') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$a = 1; +$c = $a; +$b = random(2,10,1)*random(-1,1,2); +$d=$b; + +#exponents +$m = random(2,8,1); +$n = random(2,8,1); + +# could replace these with other letters if desired +$var1 = 'a'; +$var2 = 'b'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1^$m*$var2^$n")->reduce; +$term2 = Formula("$b")->reduce; +$term3 = Formula("$c*$var1^$m*$var2^$n")->reduce; +$term4 = Formula("$d")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$c*$var1^(2*$m)*$var2^(2*$n)+($b*$c+$a*$d)*$var1^$m*$var2^$n+($b*$d)")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce('x*n'=>0)->reduce('x*n'=>0); + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Find the product + + [`` + ([$poly1])^2 = +``][____________________________]{$ans} + +END_PGML + +$a1 = abs($a); +$b1 = abs($b); + +$connector = "+"; +$connector = "-" if($b<0); + +$sumDiff = "sum"; +$sumDiff = "difference" if($b<0); + + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)^2 & =\left([$poly1]\right)\left([$poly2]\right)\\ + &= [$soln]\\ + & = [$ans] + \end{aligned} +``] + +Alternatively, we might observe that this is the square of _the [$sumDiff] of two terms_, in which case we may use the formula + + [``(x[$connector]y)^2=x^2[$connector]2xy+y^2``] + +and write + + [` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&=\left([$var1]^{[$m]}[$var2]^{[$n]}\right)^2 [$connector] 2\cdot [$var1]^{[$m]}[$var2]^{[$n]}\cdot[$b1]+[$b1]^2\\ + &=[$ans] + \end{aligned} + `] + +which is the same result we obtained using the FOIL method. + + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar160.pg index fa7bfb40b4..99622a43b7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar160.pg @@ -15,16 +15,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/9/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MultPoly_2plusVars) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','multiply','polynomial','FOIL','difference of squares') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,7 +36,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,7 +66,8 @@ $ans = Formula($ans); TEXT(beginproblem()); BEGIN_PGML -Find the product + +Multiply the polynomials. [`` ([$poly1])([$poly2]) = diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar165.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar165.pg new file mode 100644 index 0000000000..9e7f018cff --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar165.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (c - x^m y^n )^2( c + x^m y^n )^2 +# +# c integer on [-10,10] +# +# m, n integer [2,8] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL','square','difference of squares') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$c = random(2,5,1); + +#exponents +$m = random(2,8,1); +$n = random(2,8,1); + +# could replace these with other letters if desired +$var1 = 'a'; +$var2 = 'b'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$c")->reduce; +$term2 = Formula("$var1^$m*$var2^$n")->reduce; +$term3 = Formula("$c")->reduce; +$term4 = Formula("$var1^$m*$var2^$n")->reduce; +$poly1 = Formula("$term1-$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; + +# solution string +$soln1 = Formula("($term1)*($term3)+($term1)*($term4)-($term2)*($term3)-($term2)*($term4)")->reduce('x*n'=>0)->reduce('x*n'=>0); +$soln2 = Formula("$c^2-$var1^(2*$m)*$var2^(2*$n)")->reduce; +$soln3 = Formula("$c^4-$c^2*$var1^(2*$m)*$var2^(2*$n)-$c^2*$var1^(2*$m)*$var2^(2*$n)+$var1^(2*$m)*$var2^(2*$n)*$var1^(2*$m)*$var2^(2*$n)")->reduce; + +# answer +$ans = Formula("$c^4-2*$c^2*$var1^(2*$m)*$var2^(2*$n)+$var1^(4*$m)*$var2^(4*$n)")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Find the product + + [`` + ([$poly1])^2([$poly2])^2 = +``][____________________________]{$ans} + +END_PGML + +BEGIN_PGML_SOLUTION + +This problem can be approached in a few different ways; let's use the +property of exponents that says [`\left(a\cdot b\right)^n=a^n\cdot b^n`]. +Then we use the FOIL technique (*F*irst *O*utside +*I*nside *L*ast) _twice_. + +[`` + \begin{aligned} + \left([$poly1]\right)^2\left([$poly2]\right)^2&= + \left(\left([$poly1]\right)\left([$poly2]\right)\right)^2 \\ + &= \left([$soln1]\right)^2\\ + &= \left([$soln2]\right)^2\\ + &= \left([$soln2]\right)\left([$soln2]\right)\\ + & = [$soln3]\\ + & = [$ans] + \end{aligned} +``] + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar170.pg new file mode 100644 index 0000000000..5732cdbab0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar170.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (x y -c )^2( x y +c )^2 +# +# c integer on [-10,10] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL','square','difference of squares') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$c = random(2,5,1)*random(-1,1,2); + +#exponents +$m = 1; +$n = 1; + +# could replace these with other letters if desired +$var1 = 'a'; +$var2 = 'b'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$var1^$m*$var2^$n")->reduce; +$term2 = Formula("$c")->reduce; +$term3 = Formula("$var1^$m*$var2^$n")->reduce; +$term4 = Formula("$c*-1")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; + +# solution string +$soln1 = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce('x*n'=>0)->reduce('x*n'=>0); +$soln2 = Formula("$var1^(2*$m)*$var2^(2*$n)-($c*$c)")->reduce('x*n'=>0)->reduce('x*n'=>0); +$soln3 = Formula("$var1^(2*$m)*$var2^(2*$n)*$var1^(2*$m)*$var2^(2*$n)-$var1^(2*$m)*$var2^(2*$n)*($c*$c)-($c*$c)*$var1^(2*$m)*$var2^(2*$n)+($c)^4")->reduce('x*n'=>0)->reduce('x*n'=>0); + +# answer +$ans = Formula("$var1^(4*$m)*$var2^(4*$n)-2*($c)^2*$var1^(2*$m)*$var2^(2*$n)+($c)^4")->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Find the product + + [`` + ([$poly1])^2([$poly2])^2 = +``][____________________________]{$ans} + +END_PGML + +BEGIN_PGML_SOLUTION + +This problem can be approached in a few different ways; let's use the +property of exponents that says [`\left(a\cdot b\right)^n=a^n\cdot b^n`]. +Then we use the FOIL technique (*F*irst *O*utside +*I*nside *L*ast) _twice_. + +[`` + \begin{aligned} + \left([$poly1]\right)^2\left([$poly2]\right)^2&= + \left(\left([$poly1]\right)\left([$poly2]\right)\right)^2 \\ + &= \left([$soln1]\right)^2\\ + &= \left([$soln2]\right)^2\\ + &= \left([$soln2]\right)\left([$soln2]\right)\\ + & = [$soln3]\\ + & = [$ans] + \end{aligned} +``] + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar58.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar58.pg new file mode 100644 index 0000000000..63e959d8e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar58.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a) (b x^p) +# +# +# Last updated: Carl Yao, 11/23/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,5,1); + +# the polynomial +$poly1 = Formula("$a")->reduce; +$poly2 = Formula("$var1*$var2")->reduce; +$ans1 = Formula("$a*$var1*$var2")->reduce; + +if (random(1,2,1)==1) { + $poly3 = Formula("$var1+$var2"); + $ans2 = Formula("$a*$var1+$a*$var2"); +} else { + $poly3 = Formula("$var1-$var2"); + $ans2 = Formula("$a*$var1-$a*$var2"); +} + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans1 = Formula($ans1); +$ans2 = Formula($ans2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Simplify the expression so that the result does not have parentheses. + +a. [`` [$poly1]([$poly2]) = ``][___________]{$ans1} + +a. [`` [$poly1]([$poly3]) = ``][___________]{$ans2} + +END_PGML + +BEGIN_PGML_SOLUTION + +a. [`` + [$poly1] \left([$poly2]\right)= [$ans1] + ``] + +a. [`` + [$poly1] \left([$poly3]\right)= [$ans2] + ``] + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar59.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar59.pg new file mode 100644 index 0000000000..a6d8f52ce0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar59.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a) (b x^p) +# +# +# Last updated: Carl Yao, 11/23/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,5,1); +$exp = random(2,4,1); + +# the polynomial +$poly1 = Formula("$a*$var1")->reduce; +$poly2 = Formula("$var1^$exp*$var2")->reduce; +$ans = Formula("$a*$var1^($exp+1)*$var2")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Calculate the product by removing parenthesis: + + [`` [$poly1]([$poly2]) = ``][___________]{$ans} + +END_PGML + +BEGIN_PGML_SOLUTION + + [`` + [$poly1] \left([$poly2]\right)= [$ans] + ``] + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar60.pg new file mode 100644 index 0000000000..1eb3881e63 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar60.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a x^m y^n) (b x^p y^q) +# +# a, b, are integer on [-10,10] +# m, n, p, q integer on [3,20]. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using $a, $b +$a = (random(1.5,9.5,1)+0.5)*random(-1,1,2); +$b = (random(1.5,9.5,1)+0.5)*random(-1,1,2); + +# exponents of first polynomial +$m = random(3,20,1); +$n=$m; +$n = random(3,20,1)while($n==$m); + +# exponents of second polynomial +$p = random(3,20,1); +$q = $p; +$q = random(3,20,1)while($q==$p); + +# could replace these with other letters if desired +$var1 = 'x'; +$var2 = 'y'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the polynomial +$poly1 = Formula("$a*$var1^$m*$var2^$n")->reduce; +$poly2 = Formula("$b*$var1^$p*$var2^$q")->reduce; +$ans = Formula("$a*$b*$var1^($m+$p)*$var2^($n+$q)")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML +Find the product + + [`` + ([$poly1])([$poly2]) = +``][____________________________]{$ans} + +END_PGML + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using +the rule [`a^m\cdot a^n = a^{m+n}`] to guide us + +[`` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&= [$a*$b][$var1]^{[$m]+[$p]}[$var2]^{[$n]+[$q]}\\ + & = [$ans] + \end{aligned} +``] + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar65.pg index 47c678692d..213f6da9bc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar65.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar65.pg @@ -13,15 +13,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','multiply','polynomial','distributive') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -31,7 +34,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -75,7 +78,8 @@ $ans = Formula($ans); TEXT(beginproblem()); BEGIN_PGML -Find the product + +Multiply the polynomials. [`` ([$poly1])([$poly2]) = diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar70.pg new file mode 100644 index 0000000000..181f1b12e7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar70.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# a x^m y^n (b x^p y^q + c x^r y^s ) +# +# a, b, c are integer on [-10,10] +# m, n, p, q, r, s integer on [3,20]. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','distributive') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using $a, $b +$a = (random(1.5,9.5,1)+0.5)*random(-1,1,2); +$b=$a; +$b = (random(1.5,9.5,1)+0.5)*random(-1,1,2) while(abs($a)==abs($b)); +$c = $b; +$c = (random(1.5,9.5,1)+0.5)*random(-1,1,2) while(abs($c)==abs($b)); + +# exponents of first polynomial +$m = random(3,20,1); +$n=$m; +$n = random(3,20,1)while($n==$m); + +# exponents of second polynomial +$p = random(3,20,1); +$q = $p; +$q = random(3,20,1)while($q==$p); +$r = random(3,20,1); +$s = $r; +$s = random(3,20,1)while($s==$r); + +# could replace these with other letters if desired +$var1 = 'a'; +$var2 = 'b'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the polynomial +$poly1 = Formula("$a*$var1^$m*$var2^$n")->reduce; +$poly2 = Formula("$b*$var1^$p*$var2^$q+$c*$var1^$r*$var2^$s")->reduce; +$ans = Formula("$a*$b*$var1^($m+$p)*$var2^($n+$q)+$a*$c*$var1^($m+$r)*$var2^($n+$s)")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`` + ([$poly1])([$poly2]) = +``][____________________________]{$ans} + +END_PGML + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the rule [`a^m\cdot a^n = a^{m+n}`] +to guide us + +[`` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&= [$a*$b][$var1]^{[$m]+[$p]}[$var2]^{[$n]+[$q]}+[$a*$c][$var1]^{[$m]+[$r]}[$var2]^{[$n]+[$s]}\\ + & = [$ans] + \end{aligned} +``] + +Note that we are using the _distributive_ property of multiplication in this problem: [`x(y+z)=xy+xz`]. +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar75.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar75.pg new file mode 100644 index 0000000000..910ba5b734 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar75.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# a x^m (b x^n + c x^p y^q + d y^r ) +# +# a, b, c are integer on [-10,10] +# m, n, p, q, r, integer on [3,10]. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','distributive') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using $a, $b +$a = (random(1.5,9.5,1)+0.5)*random(-1,1,2); +$b=$a; +$b = (random(1.5,9.5,1)+0.5)*random(-1,1,2) while(abs($a)==abs($b)); +$c = $b; +$c = (random(1.5,9.5,1)+0.5)*random(-1,1,2) while(abs($c)==abs($b)); +$d = $c; +$d = (random(1.5,9.5,1)+0.5)*random(-1,1,2) while(abs($d)==abs($c)); + +# exponents of first polynomial +$m = random(3,10,1); +$n=$m; +$n = random(3,10,1)while($n==$m); +$p = random(3,10,1); +$q = $p; +$q = random(3,10,1)while($q==$p); +$r = random(3,10,1); + +# could replace these with other letters if desired +$var1 = 'a'; +$var2 = 'b'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the polynomial +$poly1 = Formula("$a*$var1^$m")->reduce; +$poly2 = Formula("$b*$var1^$n+$c*$var1^$p*$var2^$q+$d*$var2^$r")->reduce; +$ans = Formula("$a*$b*$var1^($m+$n)+$a*$c*$var1^($m+$p)*$var2^($q)+$a*$d*$var1^($m)*$var2^($r)")->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`` + ([$poly1])([$poly2]) = +``][____________________________]{$ans} + +END_PGML + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the rule [`a^m\cdot a^n = a^{m+n}`] +to guide us. [``` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&= [$a*$b][$var1]^{[$m]+[$n]}+[$a*$c][$var1]^{[$m]+[$p]}[$var2]^{[$q]}+[$a*$d][$var1]^{[$m]}[$var2]^{[$r]}\\ + & = [$ans] + \end{aligned} +```] + +Note that we are using the _distributive_ property of multiplication in this problem: [`x(y+z)=xy+xz`]. +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar80.pg new file mode 100644 index 0000000000..f27d76d7f4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar80.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a x + b y)( c x + d y) +# +# a, c, are 1 in this problem +# b, d, are integer on [-10,10] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$a = 1; +$c = 1; +$b = random(2,10,1)*random(-1,1,2); +$d=$b; +$d = random(2,10,1)*random(-1,1,2); + +# could replace these with other letters if desired +$var1 = 'a'; +$var2 = 'b'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1")->reduce; +$term2 = Formula("$b*$var2")->reduce; +$term3 = Formula("$c*$var1")->reduce; +$term4 = Formula("$d*$var2")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$var1^2+($b*$c+$a*$d)*$var1*$var2+($b*$d)$var2^2")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`` + ([$poly1])([$poly2]) = +``][____________________________]{$ans} + +END_PGML + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&= [$soln]\\ + & = [$ans] + \end{aligned} +``] + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar85.pg new file mode 100644 index 0000000000..d27ae23625 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar85.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a x + b y)( c x + d y) +# +# a, is 1 in this problem +# c is integer on [2,10] +# b, d, are integer on [-10,10] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$a = 1; +$c = random(2,10,1); +$b = random(2,10,1)*random(-1,1,2); +$d=$b; +$d = random(2,10,1)*random(-1,1,2); + +# could replace these with other letters if desired +$var1 = 'a'; +$var2 = 'b'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1")->reduce; +$term2 = Formula("$b*$var2")->reduce; +$term3 = Formula("$c*$var1")->reduce; +$term4 = Formula("$d*$var2")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$c*$var1^2+($b*$c+$a*$d)*$var1*$var2+($b*$d)$var2^2")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`` + ([$poly1])([$poly2]) = +``][____________________________]{$ans} + +END_PGML + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&= [$soln]\\ + & = [$ans] + \end{aligned} +``] + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar90.pg new file mode 100644 index 0000000000..679407f8a1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar90.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# +# Find the product +# +# (a x + b y)( c x + d y) +# +# a, c integer on [2,10] +# b, d, are integer on [-10,10] +# +# This template should allow great flexibility across other +# branches of this problem. +# +# Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('multivariable','multiply','polynomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +# construct polynomials using (a x + b y)( c x + d y) +$a = random(2,10,1); +$c = random(2,10,1); +$b = random(2,10,1)*random(-1,1,2); +$d=$b; +$d = random(2,10,1)*random(-1,1,2); + +# could replace these with other letters if desired +$var1 = 'a'; +$var2 = 'b'; +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +# the terms in the polynomial +$term1 = Formula("$a*$var1")->reduce; +$term2 = Formula("$b*$var2")->reduce; +$term3 = Formula("$c*$var1")->reduce; +$term4 = Formula("$d*$var2")->reduce; +$poly1 = Formula("$term1+$term2")->reduce; +$poly2 = Formula("$term3+$term4")->reduce; +$ans = Formula("$a*$c*$var1^2+($b*$c+$a*$d)*$var1*$var2+($b*$d)$var2^2")->reduce; + +# solution string +$soln = Formula("($term1)*($term3)+($term1)*($term4)+($term2)*($term3)+($term2)*($term4)")->reduce->reduce; + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$ans = Formula($ans); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the polynomials. + + [`` + ([$poly1])([$poly2]) = +``][____________________________]{$ans} + +END_PGML + +BEGIN_PGML_SOLUTION + +We multiply the polynomials using the FOIL method: *F*irst *O*utside +*I*nside *L*ast + +[`` + \begin{aligned} + \left([$poly1]\right)\left([$poly2]\right)&=[$soln]\\ + & = [$ans] + \end{aligned} +``] + +END_PGML_SOLUTION +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar95.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar95.pg index 183d6b8575..f46da4c6b9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar95.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PolynomialMultiplication/polyMultVar95.pg @@ -16,16 +16,18 @@ # Last updated: Carl Yao, 7/21/13, Hughes, 7/8/13 # ENDDESCRIPTION -## DBCCSS('A-APR.1') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Polynomials: multiply) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MultPoly_2plusVars) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('multivariable','multiply','polynomial','FOIL') +## DBCCSS('A-APR.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -35,7 +37,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextLimitedPolynomial.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -76,7 +78,8 @@ $ans = Formula($ans); TEXT(beginproblem()); BEGIN_PGML -Find the product + +Multiply the polynomials. [`` ([$poly1])([$poly2]) = diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem10.pg index ef857bfdfd..a83fd97c0c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem10.pg @@ -9,28 +9,30 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(The Pythagorean theorem & its converse) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(straight-pythag-simple) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('Pythagorean','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,7 +49,7 @@ $index = random(0,3,1); if ($index==0) { $base = 12; - $height = 15; + $height = 16; } elsif ($index==1) { $base = 5; $height = 12; @@ -69,7 +71,10 @@ $ans = $hypotenuseLength; #(0,1,2,3) implies (bottom left,top left,top right,bottom right). $corner = list_random(0..3); +#if corner is 0 or 2, this makes it taller than it is wide. So swap everything. + if (($corner==0)||($corner==2)) { + ($base, $height, $baseLength, $heightLength) = ($height, $base, $heightLength, $baseLength); @x = (($xmax-$base)/2,($xmax+$base)/2); @y = (($ymax-$height)/2,($ymax+$height)/2); } else { @@ -77,38 +82,59 @@ if (($corner==0)||($corner==2)) { @x = (($ymax-$height)/2,($ymax+$height)/2); } -$picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); +$hLeg = $x[1]-$x[0]; +$vLeg = $y[1]-$y[0]; -$labelAdjust = 0.5; +#now start over with graph sizing parameters +#adding 30 px to left/right sides (2x30 makes the 60) +#adding 20 px to top/bottom sides (2x20 makes the 40) +$xmin = 0; #The viewing window +$xmax = 240*$hLeg/(240 - 60); +$ymin = 0; +$ymax = $vLeg + 40*$hLeg /(240 - 60); + +@x = (($xmax-$hLeg)/2,($xmax+$hLeg)/2); +@y = (($ymax-$vLeg)/2,($ymax+$vLeg)/2); + + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + size=>[240,240*$ymax/$xmax]); @labelAx = ($x[0],$x[1],$x[1],$x[0]); -@labelAy = ($y[1]+$labelAdjust,$y[1]+$labelAdjust,$y[0]-$labelAdjust,$y[0]-$labelAdjust); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@labelATMB = ('bottom','bottom','top','top'); @labelBx = ($x[1],$x[0],$x[0],$x[1]); -@labelBy = ($y[0]-$labelAdjust,$y[0]-$labelAdjust,$y[1]+$labelAdjust,$y[1]+$labelAdjust); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@labelBTMB = ('top','top','bottom','bottom'); @labelCx = ($x[0],$x[0],$x[1],$x[1]); -@labelCy = ($y[0]-$labelAdjust,$y[1]+$labelAdjust,$y[1]+$labelAdjust,$y[0]-$labelAdjust); - +@labelCy = ($y[0],$y[1],$y[1],$y[0]); +@labelCTMB = ('top','bottom','bottom','top'); -$picture->lb( new Label($labelAx[$corner], $labelAy[$corner],"A",'black','center','middle')); -$picture->lb( new Label($labelBx[$corner], $labelBy[$corner],"B",'black','center','middle')); -$picture->lb( new Label($labelCx[$corner], $labelCy[$corner],"C",'black','center','middle')); +$picture->lb( new Label($labelAx[$corner], $labelAy[$corner],"A",'black','center',$labelATMB[$corner],'large')); +$picture->lb( new Label($labelBx[$corner], $labelBy[$corner],"B",'black','center',$labelBTMB[$corner],'large')); +$picture->lb( new Label($labelCx[$corner], $labelCy[$corner],"C",'black','center',$labelCTMB[$corner],'large')); -@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); -@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); -@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); -@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); -@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); -@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); +@labelBaseLCR = ('center','right','center','left'); +@labelBaseTMB = ('top','middle','bottom','middle'); +@labelHeightLCR = ('right','center','left','center'); +@labelHeightTMB = ('middle','bottom','middle','top'); +@labelHypotenuseLCR = ('left','left','right','right'); +@labelHypotenuseTMB = ('bottom','top','top','bottom'); +@labelBaseX=(($x[0]+$x[1])/2,$x[0],($x[0]+$x[1])/2,$x[1]); +@labelBaseY=($y[0],($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2); +@labelHeightX=($x[0],($x[0]+$x[1])/2,$x[1],($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2,$y[0]); +@labelHypotenuseX=(($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2); +@labelHypotenuseY=(($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2); -$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$baseLength,'black','center','middle')); +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],' '.$baseLength.' ','black',$labelBaseLCR[$corner],$labelBaseTMB[$corner],'large')); -$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$heightLength,'black','center','middle')); +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],' '.$heightLength.' ','black',$labelHeightLCR[$corner],$labelHeightTMB[$corner],'large')); -$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],'x','black','center','middle')); +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],'x','black',$labelHypotenuseLCR[$corner],$labelHypotenuseTMB[$corner],'large')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -127,14 +153,15 @@ $picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); $picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); -$cornersize = 0.5; +$cornersizeX = min($hLeg/10,$vLeg/10,1); +$cornersizeY = min($hLeg/10,$vLeg/10,1); -@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); -@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); -@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); -@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); -@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); -@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); +@rightSymbol1x=($x[0], $x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]); +@rightSymbol1y=($y[0]+$cornersizeY,$y[1], $y[1], $y[0]+$cornersizeY); +@rightSymbol2x=($x[0]+$cornersizeX,$x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]-$cornersizeX); +@rightSymbol2y=($y[0]+$cornersizeY,$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]+$cornersizeY); +@rightSymbol3x=($x[0]+$cornersizeX,$x[0], $x[1], $x[1]-$cornersizeX); +@rightSymbol3y=($y[0], $y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]); $picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); $picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); @@ -169,7 +196,7 @@ BEGIN_PGML [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($picture), width=>400, height=>400, tex_size=>400, extra_html_tags=>"alt = '$text' title = '$text'") @]*<< +>>[@image(insertGraph($picture), width=>240, tex_size=>400, extra_html_tags=>"alt = '$text' title = '$text'") @]*<< Find the value of [`x`]. @@ -178,7 +205,7 @@ Find the value of [`x`]. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By the Pythagorean Theorem, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem20.pg index 3884ce5635..6bbebf1b82 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem20.pg @@ -9,31 +9,35 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(The Pythagorean theorem & its converse) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(straight-pythag-simple) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('Pythagorean','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## +TEXT(beginproblem()); Context("Numeric"); $xmin = 0; #The viewing window @@ -46,7 +50,7 @@ $index = random(0,3,1); if ($index==0) { $base = 12; - $height = 15; + $height = 16; } elsif ($index==1) { $base = 5; $height = 12; @@ -68,7 +72,10 @@ $ans = $heightLength; #(0,1,2,3) implies (bottom left,top left,top right,bottom right). $corner = list_random(0..3); +#if corner is 0 or 2, this makes it taller than it is wide. So swap everything. + if (($corner==0)||($corner==2)) { + ($base, $height, $baseLength, $heightLength,$ans) = ($height, $base, $heightLength, $baseLength, $baseLength); @x = (($xmax-$base)/2,($xmax+$base)/2); @y = (($ymax-$height)/2,($ymax+$height)/2); } else { @@ -76,38 +83,60 @@ if (($corner==0)||($corner==2)) { @x = (($ymax-$height)/2,($ymax+$height)/2); } -$picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); ++$hLeg = $x[1]-$x[0]; ++$vLeg = $y[1]-$y[0]; ++ +#now start over with graph sizing parameters +#adding 30 px to left/right sides (2x30 makes the 60) +#adding 20 px to top/bottom sides (2x20 makes the 40) +$xmin = 0; #The viewing window +$xmax = 240*$hLeg/(240 - 60); +$ymin = 0; +$ymax = $vLeg + 40*$hLeg /(240 - 60); + +@x = (($xmax-$hLeg)/2,($xmax+$hLeg)/2); +@y = (($ymax-$vLeg)/2,($ymax+$vLeg)/2); + -$labelAdjust = 0.5; +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + size=>[240,240*$ymax/$xmax]); @labelAx = ($x[0],$x[1],$x[1],$x[0]); -@labelAy = ($y[1]+$labelAdjust,$y[1]+$labelAdjust,$y[0]-$labelAdjust,$y[0]-$labelAdjust); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@labelATMB = ('bottom','bottom','top','top'); @labelBx = ($x[1],$x[0],$x[0],$x[1]); -@labelBy = ($y[0]-$labelAdjust,$y[0]-$labelAdjust,$y[1]+$labelAdjust,$y[1]+$labelAdjust); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@labelBTMB = ('top','top','bottom','bottom'); @labelCx = ($x[0],$x[0],$x[1],$x[1]); -@labelCy = ($y[0]-$labelAdjust,$y[1]+$labelAdjust,$y[1]+$labelAdjust,$y[0]-$labelAdjust); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); +@labelCTMB = ('top','bottom','bottom','top'); +$picture->lb( new Label($labelAx[$corner], $labelAy[$corner],"A",'black','center',$labelATMB[$corner],'large')); +$picture->lb( new Label($labelBx[$corner], $labelBy[$corner],"B",'black','center',$labelBTMB[$corner],'large')); +$picture->lb( new Label($labelCx[$corner], $labelCy[$corner],"C",'black','center',$labelCTMB[$corner],'large')); -$picture->lb( new Label($labelAx[$corner], $labelAy[$corner],"A",'black','center','middle')); -$picture->lb( new Label($labelBx[$corner], $labelBy[$corner],"B",'black','center','middle')); -$picture->lb( new Label($labelCx[$corner], $labelCy[$corner],"C",'black','center','middle')); +@labelBaseLCR = ('center','right','center','left'); +@labelBaseTMB = ('top','middle','bottom','middle'); +@labelHeightLCR = ('right','center','left','center'); +@labelHeightTMB = ('middle','bottom','middle','top'); +@labelHypotenuseLCR = ('left','left','right','right'); +@labelHypotenuseTMB = ('bottom','top','top','bottom'); -@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); -@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); -@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); -@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); -@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); -@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); +@labelBaseX=(($x[0]+$x[1])/2,$x[0],($x[0]+$x[1])/2,$x[1]); +@labelBaseY=($y[0],($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2); +@labelHeightX=($x[0],($x[0]+$x[1])/2,$x[1],($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2,$y[0]); +@labelHypotenuseX=(($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2); +@labelHypotenuseY=(($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2); +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],' '.$baseLength.' ','black',$labelBaseLCR[$corner],$labelBaseTMB[$corner],'large')); -$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$baseLength,'black','center','middle')); +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],' x ','black',$labelHeightLCR[$corner],$labelHeightTMB[$corner],'large')); -$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],'x','black','center','middle')); +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuseLength,'black',$labelHypotenuseLCR[$corner],$labelHypotenuseTMB[$corner],'large')); -$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuseLength,'black','center','middle')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -126,14 +155,15 @@ $picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); $picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); -$cornersize = 0.5; +$cornersizeX = min($hLeg/10,$vLeg/10,1); +$cornersizeY = min($hLeg/10,$vLeg/10,1); -@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); -@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); -@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); -@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); -@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); -@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); +@rightSymbol1x=($x[0], $x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]); +@rightSymbol1y=($y[0]+$cornersizeY,$y[1], $y[1], $y[0]+$cornersizeY); +@rightSymbol2x=($x[0]+$cornersizeX,$x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]-$cornersizeX); +@rightSymbol2y=($y[0]+$cornersizeY,$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]+$cornersizeY); +@rightSymbol3x=($x[0]+$cornersizeX,$x[0], $x[1], $x[1]-$cornersizeX); +@rightSymbol3y=($y[0], $y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]); $picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); $picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); @@ -162,12 +192,10 @@ $text = "This is a right triangle. Right angle C is at the $cPosition corner of ############################################## -TEXT(beginproblem()); - BEGIN_PGML [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< +>>[@image(insertGraph($picture), width=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< Find the value of [`x`]. @@ -176,7 +204,7 @@ Find the value of [`x`]. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By the Pythagorean Theorem, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem30.pg index 6b9b9d03a2..f99abf6636 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem30.pg @@ -9,27 +9,30 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(The Pythagorean theorem & its converse) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(straight-pythag-simple) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('Pythagorean','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -41,9 +44,10 @@ $xmax = 20; $ymin = 0; $ymax = 20; +do{ do { - $hypotenuse = random(10,20,1); - $height = random(5,$hypotenuse-5,1); + $hypotenuse = random(10,30,1); + $height = random(5,$hypotenuse-3,1); $base = sqrt($hypotenuse**2-$height**2); } until ( ($height>$base) && ($base!=int($base)) ); @@ -61,38 +65,60 @@ if (($corner==0)||($corner==2)) { @x = (($ymax-$height)/2,($ymax+$height)/2); } -$picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); +$hLeg = $x[1]-$x[0]; +$vLeg = $y[1]-$y[0]; +} until ($hLeg > $vLeg); -$labelAdjust = 0.5; +#now start over with graph sizing parameters +#adding 30 px to left/right sides (2x30 makes the 60) +#adding 20 px to top/bottom sides (2x20 makes the 40) +$xmin = 0; #The viewing window +$xmax = 240*$hLeg/(240 - 60); +$ymin = 0; +$ymax = $vLeg + 40*$hLeg /(240 - 60); + +@x = (($xmax-$hLeg)/2,($xmax+$hLeg)/2); +@y = (($ymax-$vLeg)/2,($ymax+$vLeg)/2); + + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + size=>[240,240*$ymax/$xmax]); @labelAx = ($x[0],$x[1],$x[1],$x[0]); -@labelAy = ($y[1]+$labelAdjust,$y[1]+$labelAdjust,$y[0]-$labelAdjust,$y[0]-$labelAdjust); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@labelATMB = ('bottom','bottom','top','top'); @labelBx = ($x[1],$x[0],$x[0],$x[1]); -@labelBy = ($y[0]-$labelAdjust,$y[0]-$labelAdjust,$y[1]+$labelAdjust,$y[1]+$labelAdjust); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@labelBTMB = ('top','top','bottom','bottom'); @labelCx = ($x[0],$x[0],$x[1],$x[1]); -@labelCy = ($y[0]-$labelAdjust,$y[1]+$labelAdjust,$y[1]+$labelAdjust,$y[0]-$labelAdjust); - +@labelCy = ($y[0],$y[1],$y[1],$y[0]); +@labelCTMB = ('top','bottom','bottom','top'); -$picture->lb( new Label($labelAx[$corner], $labelAy[$corner],"A",'black','center','middle')); -$picture->lb( new Label($labelBx[$corner], $labelBy[$corner],"B",'black','center','middle')); -$picture->lb( new Label($labelCx[$corner], $labelCy[$corner],"C",'black','center','middle')); +$picture->lb( new Label($labelAx[$corner], $labelAy[$corner],"A",'black','center',$labelATMB[$corner],'large')); +$picture->lb( new Label($labelBx[$corner], $labelBy[$corner],"B",'black','center',$labelBTMB[$corner],'large')); +$picture->lb( new Label($labelCx[$corner], $labelCy[$corner],"C",'black','center',$labelCTMB[$corner],'large')); -@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); -@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); -@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); -@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); -@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); -@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); +@labelBaseLCR = ('center','right','center','left'); +@labelBaseTMB = ('top','middle','bottom','middle'); +@labelHeightLCR = ('right','center','left','center'); +@labelHeightTMB = ('middle','bottom','middle','top'); +@labelHypotenuseLCR = ('left','left','right','right'); +@labelHypotenuseTMB = ('bottom','top','top','bottom'); +@labelBaseX=(($x[0]+$x[1])/2,$x[0],($x[0]+$x[1])/2,$x[1]); +@labelBaseY=($y[0],($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2); +@labelHeightX=($x[0],($x[0]+$x[1])/2,$x[1],($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2,$y[0]); +@labelHypotenuseX=(($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2); +@labelHypotenuseY=(($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2); -$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],'x','black','center','middle')); +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],' x ','black',$labelBaseLCR[$corner],$labelBaseTMB[$corner],'large')); -$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$height,'black','center','middle')); +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],' '.$height.' ','black',$labelHeightLCR[$corner],$labelHeightTMB[$corner],'large')); -$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuse,'black','center','middle')); +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuse,'black',$labelHypotenuseLCR[$corner],$labelHypotenuseTMB[$corner],'large')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -111,14 +137,15 @@ $picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); $picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); -$cornersize = 0.5; +$cornersizeX = min($hLeg/10,$vLeg/10,1); +$cornersizeY = min($hLeg/10,$vLeg/10,1); -@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); -@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); -@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); -@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); -@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); -@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); +@rightSymbol1x=($x[0],$x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]); +@rightSymbol1y=($y[0]+$cornersizeY,$y[1],$y[1],$y[0]+$cornersizeY); +@rightSymbol2x=($x[0]+$cornersizeX,$x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]-$cornersizeX); +@rightSymbol2y=($y[0]+$cornersizeY,$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]+$cornersizeY); +@rightSymbol3x=($x[0]+$cornersizeX,$x[0],$x[1],$x[1]-$cornersizeX); +@rightSymbol3y=($y[0],$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]); $picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); $picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); @@ -153,17 +180,17 @@ BEGIN_PGML [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< +>>[@image(insertGraph($picture), width=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< -Find the value of [`x`]. Please round your answer to two decimal places. +Find the value of [`x`], accurate to at least two decimal places. - [` x={}`][_____________]{$ans} + [` x\approx{}`][_____________]{$ans} END_PGML ############################################## -$refreshCachedImages = 1; + $ansShow = sprintf "%.2f", $ans; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem40.pg index fd3b8c30a5..6adfe96f51 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem40.pg @@ -9,28 +9,32 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(The Pythagorean theorem & its converse) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(straight-pythag-simple) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('Pythagorean','right triangle','radical') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "contextLimitedRadical.pl", + "PCCmacros.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -164,10 +168,10 @@ sub line2 { Context("Numeric"); do { - $base = random(2,18,1); - $height = random(2,18,1); + $base = random(4,18,1); + $height = random(4,18,1); $hypotenuseSquared = $base**2+$height**2; -} until (canBeSimplified($hypotenuseSquared)); +} until ( (canBeSimplified($hypotenuseSquared)) && ($height-$base>3) && ($height-$base<8) ); ($in, $out) = simplify($hypotenuseSquared); @@ -193,38 +197,59 @@ if (($corner==0)||($corner==2)) { @x = (($ymax-$height)/2,($ymax+$height)/2); } -$picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); +$hLeg = $x[1]-$x[0]; +$vLeg = $y[1]-$y[0]; -$labelAdjust = 0.5; +#now start over with graph sizing parameters +#adding 30 px to left/right sides (2x30 makes the 60) +#adding 20 px to top/bottom sides (2x20 makes the 40) +$xmin = 0; #The viewing window +$xmax = 240*$hLeg/(240 - 60); +$ymin = 0; +$ymax = $vLeg + 40*$hLeg /(240 - 60); + +@x = (($xmax-$hLeg)/2,($xmax+$hLeg)/2); +@y = (($ymax-$vLeg)/2,($ymax+$vLeg)/2); + + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + size=>[240,240*$ymax/$xmax]); @labelAx = ($x[0],$x[1],$x[1],$x[0]); -@labelAy = ($y[1]+$labelAdjust,$y[1]+$labelAdjust,$y[0]-$labelAdjust,$y[0]-$labelAdjust); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@labelATMB = ('bottom','bottom','top','top'); @labelBx = ($x[1],$x[0],$x[0],$x[1]); -@labelBy = ($y[0]-$labelAdjust,$y[0]-$labelAdjust,$y[1]+$labelAdjust,$y[1]+$labelAdjust); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@labelBTMB = ('top','top','bottom','bottom'); @labelCx = ($x[0],$x[0],$x[1],$x[1]); -@labelCy = ($y[0]-$labelAdjust,$y[1]+$labelAdjust,$y[1]+$labelAdjust,$y[0]-$labelAdjust); - +@labelCy = ($y[0],$y[1],$y[1],$y[0]); +@labelCTMB = ('top','bottom','bottom','top'); -$picture->lb( new Label($labelAx[$corner], $labelAy[$corner],"A",'black','center','middle')); -$picture->lb( new Label($labelBx[$corner], $labelBy[$corner],"B",'black','center','middle')); -$picture->lb( new Label($labelCx[$corner], $labelCy[$corner],"C",'black','center','middle')); +$picture->lb( new Label($labelAx[$corner], $labelAy[$corner],"A",'black','center',$labelATMB[$corner],'large')); +$picture->lb( new Label($labelBx[$corner], $labelBy[$corner],"B",'black','center',$labelBTMB[$corner],'large')); +$picture->lb( new Label($labelCx[$corner], $labelCy[$corner],"C",'black','center',$labelCTMB[$corner],'large')); -@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); -@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); -@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); -@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); -@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); -@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); +@labelBaseLCR = ('center','right','center','left'); +@labelBaseTMB = ('top','middle','bottom','middle'); +@labelHeightLCR = ('right','center','left','center'); +@labelHeightTMB = ('middle','bottom','middle','top'); +@labelHypotenuseLCR = ('left','left','right','right'); +@labelHypotenuseTMB = ('bottom','top','top','bottom'); +@labelBaseX=(($x[0]+$x[1])/2,$x[0],($x[0]+$x[1])/2,$x[1]); +@labelBaseY=($y[0],($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2); +@labelHeightX=($x[0],($x[0]+$x[1])/2,$x[1],($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2,$y[0]); +@labelHypotenuseX=(($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2); +@labelHypotenuseY=(($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2); -$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$base,'black','center','middle')); +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],' '.$base.' ','black',$labelBaseLCR[$corner],$labelBaseTMB[$corner],'large')); -$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$height,'black','center','middle')); +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],' '.$height.' ','black',$labelHeightLCR[$corner],$labelHeightTMB[$corner],'large')); -$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],'x','black','center','middle')); +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],'x','black',$labelHypotenuseLCR[$corner],$labelHypotenuseTMB[$corner],'large')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -243,14 +268,15 @@ $picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); $picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); -$cornersize = 0.5; +$cornersizeX = min($hLeg/10,$vLeg/10,1); +$cornersizeY = min($hLeg/10,$vLeg/10,1); -@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); -@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); -@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); -@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); -@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); -@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); +@rightSymbol1x=($x[0],$x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]); +@rightSymbol1y=($y[0]+$cornersizeY,$y[1],$y[1],$y[0]+$cornersizeY); +@rightSymbol2x=($x[0]+$cornersizeX,$x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]-$cornersizeX); +@rightSymbol2y=($y[0]+$cornersizeY,$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]+$cornersizeY); +@rightSymbol3x=($x[0]+$cornersizeX,$x[0],$x[1],$x[1]-$cornersizeX); +@rightSymbol3y=($y[0],$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]); $picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); $picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); @@ -278,18 +304,17 @@ if ($corner==0) { $text = "This is a right triangle. Right angle C is at the $cPosition corner of the picture. Acute angle A is at the $aPosition, and acute angle B is at the $bPosition. The length of the side facing Angle A is $base; the length of the side facing Angle B is $height; the length of the side facing Angle C is x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< +>>[@image(insertGraph($picture), width=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< -Find the value of [`x`]. Your answer should be a radical in simplified form. For example, [`\sqrt{8}`] should be simplified into [`2\sqrt{2}`]. +Find the exact value of [`x`]. [@KeyboardInstructions('Your answer should be a radical in simplified form. For example, [`\sqrt{8}`] should be simplified into [`2\sqrt{2}`]. Use [|sqrt()|]* to represent the square root symbol. For example, if the answer is [`2\sqrt{2}`], you should type in [|2sqrt(2)|]* or [|2*sqrt(2)|]*.')@]** -Use *sqrt()* to represent the square root symbol. For example, if the answer is [`2\sqrt{2}`], you should type in *2sqrt(2)* or *2\*sqrt(2)*. [` x={}`][_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem50.pg index 04860ec9ac..5c4fc9bb34 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem50.pg @@ -9,28 +9,32 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Geometric and algebraic foundations for trigonometry) -## DBsection(The Pythagorean theorem & its converse) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(straight-pythag-simple) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('Pythagorean','right triangle','radical') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "contextLimitedRadical.pl", + "PCCmacros.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -164,11 +168,13 @@ sub line2 { Context("Numeric"); do { - $height = random(2,16,1); +do { + $height = random(4,16,1); $hypotenuse = random($height+1,18,1); $baseSquared = $hypotenuse**2-$height**2; } until (canBeSimplified($baseSquared)); $base = sqrt($baseSquared); +} until ( ($height-$base>3) && ($height-$base<8) ); ($in, $out) = simplify($baseSquared); @@ -194,38 +200,59 @@ if (($corner==0)||($corner==2)) { @x = (($ymax-$height)/2,($ymax+$height)/2); } -$picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); +$hLeg = $x[1]-$x[0]; +$vLeg = $y[1]-$y[0]; -$labelAdjust = 0.5; +#now start over with graph sizing parameters +#adding 30 px to left/right sides (2x30 makes the 60) +#adding 20 px to top/bottom sides (2x20 makes the 40) +$xmin = 0; #The viewing window +$xmax = 240*$hLeg/(240 - 60); +$ymin = 0; +$ymax = $vLeg + 40*$hLeg /(240 - 60); + +@x = (($xmax-$hLeg)/2,($xmax+$hLeg)/2); +@y = (($ymax-$vLeg)/2,($ymax+$vLeg)/2); + + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + size=>[240,240*$ymax/$xmax]); @labelAx = ($x[0],$x[1],$x[1],$x[0]); -@labelAy = ($y[1]+$labelAdjust,$y[1]+$labelAdjust,$y[0]-$labelAdjust,$y[0]-$labelAdjust); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@labelATMB = ('bottom','bottom','top','top'); @labelBx = ($x[1],$x[0],$x[0],$x[1]); -@labelBy = ($y[0]-$labelAdjust,$y[0]-$labelAdjust,$y[1]+$labelAdjust,$y[1]+$labelAdjust); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@labelBTMB = ('top','top','bottom','bottom'); @labelCx = ($x[0],$x[0],$x[1],$x[1]); -@labelCy = ($y[0]-$labelAdjust,$y[1]+$labelAdjust,$y[1]+$labelAdjust,$y[0]-$labelAdjust); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); +@labelCTMB = ('top','bottom','bottom','top'); +$picture->lb( new Label($labelAx[$corner], $labelAy[$corner],"A",'black','center',$labelATMB[$corner],'large')); +$picture->lb( new Label($labelBx[$corner], $labelBy[$corner],"B",'black','center',$labelBTMB[$corner],'large')); +$picture->lb( new Label($labelCx[$corner], $labelCy[$corner],"C",'black','center',$labelCTMB[$corner],'large')); -$picture->lb( new Label($labelAx[$corner], $labelAy[$corner],"A",'black','center','middle')); -$picture->lb( new Label($labelBx[$corner], $labelBy[$corner],"B",'black','center','middle')); -$picture->lb( new Label($labelCx[$corner], $labelCy[$corner],"C",'black','center','middle')); +@labelBaseLCR = ('center','right','center','left'); +@labelBaseTMB = ('top','middle','bottom','middle'); +@labelHeightLCR = ('right','center','left','center'); +@labelHeightTMB = ('middle','bottom','middle','top'); +@labelHypotenuseLCR = ('left','left','right','right'); +@labelHypotenuseTMB = ('bottom','top','top','bottom'); -@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); -@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); -@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); -@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); -@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); -@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); +@labelBaseX=(($x[0]+$x[1])/2,$x[0],($x[0]+$x[1])/2,$x[1]); +@labelBaseY=($y[0],($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2); +@labelHeightX=($x[0],($x[0]+$x[1])/2,$x[1],($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2,$y[0]); +@labelHypotenuseX=(($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2); +@labelHypotenuseY=(($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2); +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],' x ','black',$labelBaseLCR[$corner],$labelBaseTMB[$corner],'large')); -$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],'x','black','center','middle')); +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],' '.$height.' ','black',$labelHeightLCR[$corner],$labelHeightTMB[$corner],'large')); -$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$height,'black','center','middle')); - -$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuse,'black','center','middle')); +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuse,'black',$labelHypotenuseLCR[$corner],$labelHypotenuseTMB[$corner],'large')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -244,14 +271,15 @@ $picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); $picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); -$cornersize = 0.5; +$cornersizeX = min($hLeg/10,$vLeg/10,1); +$cornersizeY = min($hLeg/10,$vLeg/10,1); -@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); -@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); -@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); -@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); -@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); -@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); +@rightSymbol1x=($x[0],$x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]); +@rightSymbol1y=($y[0]+$cornersizeY,$y[1],$y[1],$y[0]+$cornersizeY); +@rightSymbol2x=($x[0]+$cornersizeX,$x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]-$cornersizeX); +@rightSymbol2y=($y[0]+$cornersizeY,$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]+$cornersizeY); +@rightSymbol3x=($x[0]+$cornersizeX,$x[0],$x[1],$x[1]-$cornersizeX); +@rightSymbol3y=($y[0],$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]); $picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); $picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); @@ -279,19 +307,17 @@ if ($corner==0) { $text = "This is a right triangle. Right angle C is at the $cPosition corner of the picture. Acute angle A is at the $aPosition, and acute angle B is at the $bPosition. The length of the side facing Angle A is x (unknown); the length of the side facing Angle B is $height; the length of the side facing Angle C is $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< - +>>[@image(insertGraph($picture), width=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< -Find the value of [`x`]. Your answer should be a radical in simplified form. For example, [`\sqrt{8}`] should be simplified into [`2\sqrt{2}`]. -Use *sqrt()* to represent the square root symbol. For example, if the answer is [`2\sqrt{2}`], you should type in *2sqrt(2)* or *2\*sqrt(2)*. +Find the exact value of [`x`]. [@KeyboardInstructions('Your answer should be a radical in simplified form. For example, [`\sqrt{8}`] should be simplified into [`2\sqrt{2}`]. Use [|sqrt()|]* to represent the square root symbol. For example, if the answer is [`2\sqrt{2}`], you should type in [|2sqrt(2)|]* or [|2*sqrt(2)|]*.')@]** [` x={}`][_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem60.pg new file mode 100644 index 0000000000..7c340d21f5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem60.pg @@ -0,0 +1,226 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use Pythagorean Theorem to find missing length in a right triangle. +# The hypotenuse is given. The ratio of its two legs is given. +# +# Last edited by Carl Yao on 12/9/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('Pythagorean','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); + +$name = RandomName(sex=>$sex); + +Context("Numeric"); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +@triples = ([3,4,5],[5,12,13],[8,15,17]); +$index = random(0,2,1); + +if ($index==0) { + $base = 12; + $height = 15; +} elsif ($index==1) { + $base = 5; + $height = 12; +} elsif ($index==2) { + $base = 8; + $height = 15; +} + +$ratioBase = $triples[$index][1]; +$ratioHeight = $triples[$index][0]; + +do {$factor = random(0.1,4,0.1);} until ($factor!=1); +$baseLength = $triples[$index][1]*$factor; +$heightLength = $triples[$index][0]*$factor; +$hypotenuseLength = $triples[$index][2]*$factor; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = list_random(1,3); + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + size=>[240,240/$height*$base]); + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@labelATMB = ('bottom','bottom','top','top'); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@labelBTMB = ('top','top','bottom','bottom'); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); +@labelCTMB = ('top','bottom','bottom','top'); + +@labelBaseLCR = ('center','right','center','left'); +@labelBaseTMB = ('top','middle','bottom','middle'); +@labelHeightLCR = ('right','center','left','center'); +@labelHeightTMB = ('middle','bottom','middle','top'); +@labelHypotenuseLCR = ('left','left','right','right'); +@labelHypotenuseTMB = ('bottom','top','top','bottom'); + +@labelBaseX=(($x[0]+$x[1])/2,$x[0],($x[0]+$x[1])/2,$x[1]); +@labelBaseY=($y[0],($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2); +@labelHeightX=($x[0],($x[0]+$x[1])/2,$x[1],($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2,$y[0]); +@labelHypotenuseX=(($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2); +@labelHypotenuseY=(($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2); + + + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],"$ratioHeight".'x','black',$baseLength,'black',$labelBaseLCR[$corner],$labelBaseTMB[$corner],'large')); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],"$ratioBase".'x','black',$labelHeightLCR[$corner],$labelHeightTMB[$corner],'large')); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuseLength,'black',$labelHypotenuseLCR[$corner],$labelHypotenuseTMB[$corner],'large')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); +@dx=(1,1,0,0); +@dy=(1,0,0,1); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$dx[$corner]],$y[$dy[$corner]], darkblue,3); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); + + +$cornersizeX = 0.7; +$cornersizeY = $cornersizeX*$heightLength/$baseLength; + +@rightSymbol1x=($x[0],$x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]); +@rightSymbol1y=($y[0]+$cornersizeY,$y[1],$y[1],$y[0]+$cornersizeY); +@rightSymbol2x=($x[0]+$cornersizeX,$x[0]+$cornersizeX,$x[1]-$cornersizXe,$x[1]-$cornersizeX); +@rightSymbol2y=($y[0]+$cornersizeY,$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]+$cornersizeY); +@rightSymbol3x=($x[0]+$cornersizeX,$x[0],$x[1],$x[1]-$cornersizeX); +@rightSymbol3y=($y[0],$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a rectangle with the diagonal drawn. The diagonal is marked as $hypotenuseLength. The base is marked as $ratioBase x, and the height is marked as $ratioHeight x."; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] is designing a rectangular garden. The garden's diagonal must be [`[$hypotenuseLength]`] feet, and the ratio between the garden's base and height must be [`[$ratioBase]:[$ratioHeight]`]. Find the length of the garden's base and height. + +The garden's base is [_____________]{$baseLength} feet and its height is [___________]{$heightLength}. + +END_PGML + +############################################## + +$s1 = $hypotenuseLength**2/($ratioBase**2+$ratioHeight**2); +$x = sqrt($s1); + + +BEGIN_PGML_SOLUTION + +We will draw a diagram for the garden. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>240, tex_size=>400, extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Since the ratio between its base and height is [`[$ratioBase]:[$ratioHeight]`], assume the base is [`[$ratioBase]x`] feet, and its height is [`[$ratioHeight]x`] feet. By the Pythagorean Theorem, we have: + + [`` +\begin{aligned} + ([$ratioBase]x)^{2}+([$ratioHeight]x)^{2} &= [$hypotenuseLength]^{2} \\ + [$ratioBase**2]x^2+[$ratioHeight**2]x^2 &= [$hypotenuseLength**2] \\ + [$ratioBase**2+$ratioHeight**2]x^2 &= [$hypotenuseLength**2] \\ + \frac{[$ratioBase**2+$ratioHeight**2]x^2}{[$ratioBase**2+$ratioHeight**2]} &= \frac{[$hypotenuseLength**2]}{[$ratioBase**2+$ratioHeight**2]} \\ + x^2 &= [$s1] \\ + \sqrt{x^2} &= \sqrt{[$s1]} \\ + x &= [$x] +\end{aligned} + ``] + +The garden's base is [`[$ratioBase]x=[$ratioBase]\cdot[$x]=[$baseLength]`] feet, and its height is [`[$ratioHeight]x=[$ratioHeight]\cdot[$x]=[$heightLength]`] feet. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem70.pg new file mode 100644 index 0000000000..beaa1a0fc3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/PythagoreanTheorem/pythagoreanTheorem70.pg @@ -0,0 +1,227 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use Pythagorean Theorem to find missing length in a right triangle. +# The base is given. The ratio of hypotenuse to height is given. +# +# Last edited by Carl Yao on 12/9/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('Pythagorean','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +$sex = list_random('male','female'); +$pronoun = 'he' if ($sex eq 'male'); +$pronoun = 'she' if ($sex eq 'female'); + +$name = RandomName(sex=>$sex); + +Context("Numeric"); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +@triples = ([3,4,5],[5,12,13],[8,15,17]); +$index = random(0,2,1); + +if ($index==0) { + $base = 12; + $height = 15; +} elsif ($index==1) { + $base = 5; + $height = 12; +} else { + $base = 8; + $height = 15; +} + +$ratioBase = $triples[$index][1]; +$ratioHeight = $triples[$index][0]; +$ratioHypotenuse = $triples[$index][2]; + +do {$factor = random(0.1,4,0.1);} until ($factor!=1); +$baseLength = $triples[$index][1]*$factor; +$heightLength = $triples[$index][0]*$factor; +$hypotenuseLength = $triples[$index][2]*$factor; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = list_random(1,3); + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + size=>[240,240/$height*$base]); + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@labelATMB = ('bottom','bottom','top','top'); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@labelBTMB = ('top','top','bottom','bottom'); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); +@labelCTMB = ('top','bottom','bottom','top'); + +@labelBaseLCR = ('center','right','center','left'); +@labelBaseTMB = ('top','middle','bottom','middle'); +@labelHeightLCR = ('right','center','left','center'); +@labelHeightTMB = ('middle','bottom','middle','top'); +@labelHypotenuseLCR = ('left','left','right','right'); +@labelHypotenuseTMB = ('bottom','top','top','bottom'); + +@labelBaseX=(($x[0]+$x[1])/2,$x[0],($x[0]+$x[1])/2,$x[1]); +@labelBaseY=($y[0],($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2); +@labelHeightX=($x[0],($x[0]+$x[1])/2,$x[1],($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1],($y[0]+$y[1])/2,$y[0]); +@labelHypotenuseX=(($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2,($x[0]+$x[1])/2); +@labelHypotenuseY=(($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2,($y[0]+$y[1])/2); + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],"$ratioHeight".'x','black',$labelBaseLCR[$corner],$labelBaseTMB[$corner])); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],"$baseLength",'black',$labelHeightLCR[$corner],$labelHeightTMB[$corner])); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],"$ratioHypotenuse".'x','black',$labelHypotenuseLCR[$corner],$labelHypotenuseTMB[$corner])); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); +@dx=(1,1,0,0); +@dy=(1,0,0,1); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$dx[$corner]],$y[$dy[$corner]], darkblue,3); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); + + +$cornersizeX = 0.7; +$cornersizeY = $cornersizeX*$heightLength/$baseLength; + +@rightSymbol1x=($x[0],$x[0]+$cornersizeX,$x[1]-$cornersizeX,$x[1]); +@rightSymbol1y=($y[0]+$cornersizeY,$y[1],$y[1],$y[0]+$cornersizeY); +@rightSymbol2x=($x[0]+$cornersizeX,$x[0]+$cornersizeX,$x[1]-$cornersizXe,$x[1]-$cornersizeX); +@rightSymbol2y=($y[0]+$cornersizeY,$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]+$cornersizeY); +@rightSymbol3x=($x[0]+$cornersizeX,$x[0],$x[1],$x[1]-$cornersizeX); +@rightSymbol3y=($y[0],$y[1]-$cornersizeY,$y[1]-$cornersizeY,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a rectangle with the diagonal drawn. The base is marked as $baseLength. The height is marked as $ratioHeight x, and the hypotenuse is marked as $ratioHypotenuse x."; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] is designing a rectangular garden. The garden's base must be [`[$baseLength]`] feet, and the ratio between the garden's hypotenuse and height must be [`[$ratioHypotenuse]:[$ratioHeight]`]. Find the length of the garden's hypotenuse and height. + +The garden's hypotenuse is [_____________]{$hypotenuseLength} feet and its height is [___________]{$heightLength}. + +END_PGML + +############################################## + +$s1 = $ratioHypotenuse**2-$ratioHeight**2; +$s2 = $baseLength**2/$s1; +$x = sqrt($s2); + + +BEGIN_PGML_SOLUTION + +We will draw a diagram for the garden. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>240, tex_size=>400, extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Since the ratio between its hypotenuse and height is [`[$ratioHypotenuse]:[$ratioHeight]`], assume the base is [`[$ratioHypotenuse]x`] feet, and its height is [`[$ratioHeight]x`] feet. By the Pythagorean Theorem, we have: + + [`` +\begin{aligned} + [$baseLength]^{2}+([$ratioHeight]x)^{2} &= ([$ratioHypotenuse]x)^{2} \\ + [$baseLength**2]+[$ratioHeight**2]x^2 &= [$ratioHypotenuse**2]x^2 \\ + [$baseLength**2]+[$ratioHeight**2]x^2 \mathbf{{}-[$ratioHeight**2]x^2} &= [$ratioHypotenuse**2]x^2 \mathbf{{}-[$ratioHeight**2]x^2} \\ + [$baseLength**2] &= [$s1]x^2 \\ + \frac{[$baseLength**2]}{[$s1]} &= \frac{[$s1]x^2}{[$s1]} \\ + [$s2] &= x^2 \\ + \sqrt{[$s2]} &= \sqrt{x^2} \\ + [$x] &= x +\end{aligned} + ``] + +The garden's height is [`[$ratioHeight]x=[$ratioHeight]\cdot[$x]=[$heightLength]`] feet, and its hypotenuse is [`[$ratioHypotenuse]x=[$ratioHypotenuse]\cdot[$x]=[$hypotenuseLength]`] feet. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg index 10d019deee..5408f46efa 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg @@ -9,38 +9,46 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); $initSpeed = random(320,640,32); $a = -16; @@ -107,7 +115,7 @@ for my $i (0,0) { for my $j (@yticks) { if (Real($j) == 0) {next;} - $gr->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); } add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight:1"); @@ -117,17 +125,18 @@ add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight BEGIN_PGML -An object was shot up into the air at an initial vertical speed of [`[$initSpeed]`] feet per second. Its height as time passes can be modeled by the quadratic function [`f`], where [`f(t)=[$func]`]. Here [`t`] represents the number of seconds since the object's release, and [`f(t)`] represents the object's height in feet. +An object was shot up into the air with an initial vertical speed of [`[$initSpeed]`] feet per second. Its height as time passes can be modeled by the quadratic equation [`y=[$func]`]. Here [`t`] represents the number of seconds since the object's release, and [`y`] represents the object's height in feet. + +[@KeyboardInstructions('(Use [|ft|]* for feet, and [|s|]* for seconds.)')@]** - 1) After [____________]{$tMaxU}, this object reached its maximum height of [___________]{$hMaxU}. +a. After [____________]{$tMaxU}, this object reached its maximum height of [___________]{$hMaxU}. - 2) This object flew for [____________]{$tBackU} before it landed on the ground. +a. This object flew for [____________]{$tBackU} before it landed on the ground. - 3) This object was [____________]{$h1U} in the air [`[$t1U]`] after its release. +a. This object was [____________]{$h1U} in the air [`[$t1U]`] after its release. - 4) This object was [`[$h2U]`] high at two times: once [____________]{$t2U} after its release, and again later [____________]{$t3U} after its release. +a. This object was [`[$h2U]`] high at two times: once [____________]{$t2U} after its release, and again later [____________]{$t3U} after its release. -(Use *ft* for feet, and *s* for seconds.) END_PGML @@ -153,25 +162,25 @@ $s5 = sqrt($s3); $gr->stamps( closed_circle($xVertex,$yVertex,'blue') ); -$gr->lb( new Label($xVertex,$yVertex,"($xVertex,$yVertex)", 'blue','left','bottom')); +$gr->lb( new Label($xVertex,$yVertex+$marksep[1]/8,"($xVertex,$yVertex)", 'blue','left','bottom')); $gr->moveTo( $xVertex,$min[1] ); $gr->lineTo( $xVertex,$max[1],'red',1,'dashed'); $gr->stamps( closed_circle($tBack,0,'blue') ); -$gr->lb( new Label($tBack,0,"($tBack,0)", 'blue','left','bottom')); +$gr->lb( new Label($tBack,$marksep[1]/8,"($tBack,0)", 'blue','left','bottom')); $gr->stamps( closed_circle($t1,$h1,'blue') ); -$gr->lb( new Label($t1,$h1,"($t1,$h1)", 'blue','center','bottom')); +$gr->lb( new Label($t1,$h1+$marksep[1]/8,"($t1,$h1)", 'blue','right','bottom')); $gr->moveTo( $min[0], $h2 ); $gr->lineTo( $max[0],$h2,'red',1,'dashed'); $gr->stamps( closed_circle($t2,$h2,'blue') ); -$gr->lb( new Label($t2,$h2,"($t2,$h2)", 'blue','left','top')); +$gr->lb( new Label($t2,$h2-$marksep[1]/8,"($t2,$h2)", 'blue','center','top')); $gr->stamps( closed_circle($t3,$h2,'blue') ); -$gr->lb( new Label($t3,$h2,"($t3,$h2)", 'blue','left','top')); +$gr->lb( new Label($t3,$h2-$marksep[1]/8,"($t3,$h2)", 'blue','left','top')); BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp15.pg new file mode 100644 index 0000000000..a27964db13 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp15.pg @@ -0,0 +1,226 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find maximum/minimum value application problem. +# Use quadratic equation to model the height of flying objects. +# Find max, min, intercepts and interpret their meaning. +# +# Last edit by: Jordan 9/10/13; Carl Yao 08/25/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(t => 'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$initSpeed = random(320,640,32); +$a = -16; +$b = $initSpeed; +$c = 0; + +$func = Compute("$a*t**2+$b*t+$c")->reduce; +$funcX = Compute("$a*x**2+$b*x+$c")->reduce; + +#for alternative display and title purposes + + $xVertex = -$b/(2*$a); + $yVertex = $func->eval(t=>$xVertex); + $vertex=Point($xVertex,$yVertex); + $yIntercept=Point(0,$c); + + @temp = $vertex->value; + $extraPointX = $temp[0]+1; + $extraPointY = $func->eval(t=>$extraPointX); + $extraPoint = Point($extraPointX,$extraPointY); + +$tMax = $xVertex; +$hMax = $yVertex; +$tBack = 2*$xVertex; +$t1 = random(1,int($tBack-1),1); +$h1 = $func->eval(t=>$t1); +do {$t2 = random(1,int($tMax-1),1);} until ($t2!=$t1); +$t3 = 2*$tMax-$t2; +$h2 = $func->eval(t=>$t2); + +$tMaxU = NumberWithUnits("$tMax s"); +$hMaxU = NumberWithUnits("$hMax ft"); +$tBackU = NumberWithUnits("$tBack s"); +$t1U = NumberWithUnits("$t1 s"); +$h1U = NumberWithUnits("$h1 ft"); +$t2U = NumberWithUnits("$t2 s"); +$t3U = NumberWithUnits("$t3 s"); +$h2U = NumberWithUnits("$h2 ft"); + +# to show alternative text for graphs +@alt=(); + + $alt="This picture shows the graph of a parabola. Its vertex is at $vertex, and it passes through the points (0,0), ($tBack,0), ($t1,$h1), ($t2,$h2), and ($t3,$h2)."; + + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xVertex,0,2*$xVertex],[$yVertex,0,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0,0) { + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + $gr->lb( new Label($max[0]-$marksep[0]/2, -$marksep[1]/8, t,'black','center','top')); + $gr->lb( new Label($marksep[0]/8, $max[1]-$marksep[1]/2, h,'black','left','middle')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight:1"); +} + +############################################## + +BEGIN_PGML + +An object was shot up into the air at an initial vertical speed of [`[$initSpeed]`] feet per second. Its height as time passes can be modeled by the quadratic function [`f`], where [`f(t)=[$func]`]. Here [`t`] represents the number of seconds since the object's release, and [`f(t)`] represents the object's height in feet. + + 1) This object flew for [____________]{$tBackU} before it landed on the ground. + + 2) This object was [`[$h2U]`] high at two times: once [____________]{$t2U} after its release, and again later [____________]{$t3U} after its release. + +(Use *ft* for feet, and *s* for seconds.) + +END_PGML + +############################################## + +$func1 = $func; +$func1 =~ s/t/($xVertex)/g; +$func1 =~ s/~~*//g; + +$func2 = Compute("-$a*t-$b")->reduce; +$func3 = Compute("-$a*t")->reduce; + +$func4 = $func; +$func4 =~ s/t/($t1)/g; +$func4 =~ s/~~*//g; + +$func5 = Compute("$a*t**2+$b*t-$h2")->reduce; +$s1 = -$h2; +$s2 = -$b; +$s3 = $b**2-4*$a*$s1; +$s4 = 2*$a; +$s5 = sqrt($s3); + + +$gr->stamps( closed_circle($tBack,0,'blue') ); +$gr->lb( new Label($tBack,$marksep[1]/8,"($tBack,0)", 'blue','left','bottom')); + +$gr->moveTo( $min[0], $h2 ); +$gr->lineTo( $max[0],$h2,'red',1,'dashed'); + +$gr->stamps( closed_circle($t2,$h2,'blue') ); +$gr->lb( new Label($t2,$h2-$marksep[1]/8,"($t2,$h2)", 'blue','center','top')); + +$gr->stamps( closed_circle($t3,$h2,'blue') ); +$gr->lb( new Label($t3,$h2-$marksep[1]/8,"($t3,$h2)", 'blue','left','top')); + + +BEGIN_PGML_SOLUTION + +The function [`f`] given by the rule [`f(t)=[$func]`] is quadratic. Identify that [`a=[$a], b=[$b], c=[$c]`]. + +1) The parabola's [`x`]-intercepts represent the moments when the object was at a height of [`0`]: on the ground. We will solve the equation [`f(t)=0`] to find its [`x`]-intercepts. We have: + + [` +\begin{aligned} + f(t) &= [$func] \\ + 0 &= [$func] \\ + 0 &= -t([$func2]) \\ + -t &= 0 & \text{or} && [$func2]&=0 \\ + t &= 0 & \text{or} && [$func3]&=[$b] \\ + t &= 0 & \text{or} && t&=[$tBack] +\end{aligned} +`] + +This parabola has two [`x`]-intercepts: [`(0,0)`] and [`([$tBack],0)`]. The point [`(0,0)`] represents the moment when the object was released; the point [`([$tBack],0)`] implies the object fell back to the ground after [`[$tBackU]`]. + +2) To find when the object was [`[$h2U]`] high, we solve the equation [` f(t)=[$h2]`]. + + [` +\begin{aligned} + f(t) &= [$func] \\ + [$h2] &= [$func] \\ + 0 &= [$func5] +\end{aligned} +`] + +For such big numbers, it's easier to use the Quadratic Formula to solve this equation. Identify that [`a=[$a],b=[$b],c=[$s1]`]. We have: + + [` +\begin{aligned} + t &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + t &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$s1])}}{2([$a])} \\ + t &= \frac{[$s2] \pm \sqrt{[$s3]}}{[$s4]} \\ + t &= \frac{[$s2] \pm [$s5]}{[$s4]} \\ + t &= \frac{[$s2] + [$s5]}{[$s4]} & \text{or} && t=\frac{[$s2] - [$s5]}{[$s4]} \\ + t &= [$t2] & \text{or} && t=[$t3] +\end{aligned} +`] + +This result shows that the object was [`[$h2U]`] high twice during its flight: once [`[$t2U]`] after it was released (on its way up), and another time [`[$t3]`] seconds after it was released (on its way down). + +---- + +It's important to understand the role of each part of this question in the graph of [`f`]. + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg index 9e9cf583ee..3b40c034b1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg @@ -9,41 +9,45 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(t => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); Context()->flags->set( tolerance => 0.005, - tolType => "relative", + tolType => "absolute", ); $a = -4.9; @@ -117,7 +121,7 @@ for my $i (0,0) { for my $j (@yticks) { if (Real($j) == 0) {next;} - $gr->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); } add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight:1"); @@ -127,17 +131,17 @@ add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight BEGIN_PGML -From a clifftop over the ocean [`[$cU]`] above sea level, an object was shot straight up into the air with an initial vertical speed of [`[$bU]`]. On its way down it missed the cliff and fell into the ocean. Its height (above sea level) as time passes can be modeled by the quadratic function [`f`], where [`f(t)=[$func]`]. Here [`t`] represents the number of seconds since the object's release, and [`f(t)`] represents the object's height (above sea level) in meters. +From an oceanside clifftop [`[$cU]`] above sea level, an object was shot into the air with an initial vertical speed of [`[$bU]`]. It fell into the ocean. Its height (above sea level) as time passes can be modeled by the quadratic equation [`y=[$func]`]. Here [`t`] represents the number of seconds since the object's release, and [`y`] represents the object's height (above sea level) in meters. - 1) After [____________]{$tMaxU}, this object reached its maximum height of [___________]{$hMaxU}. +[@KeyboardInstructions('(Use [|m|]* for meters, and [|s|]* for seconds.)')@]** - 2) This object flew for [____________]{$tBackU} before it landed in the ocean. +a. After [____________]{$tMaxU}, this object reached its maximum height of [___________]{$hMaxU}. - 3) This object was [____________]{$h1U} above sea level [`[$t1U]`] after its release. +a. This object flew for [____________]{$tBackU} before it landed in the ocean. - 4) This object was [`[$h2U]`] above sea level twice: once [____________]{$t2U} after its release, and again later [____________]{$t3U} after its release. +a. This object was [____________]{$h1U} above sea level [`[$t1U]`] after its release. -(Use *m* for meters, and *s* for seconds.) +a. This object was [`[$h2U]`] above sea level twice: once [____________]{$t2U} after its release, and again later [____________]{$t3U} after its release. END_PGML @@ -164,25 +168,25 @@ $s7 = $b**2-4*$a*$s6; $s8 = Real(sqrt($s7)); $gr->stamps( closed_circle($xVertex,$yVertex,'blue') ); -$gr->lb( new Label($xVertex,$yVertex,"($xVertex,$yVertex)", 'blue','left','bottom')); +$gr->lb( new Label($xVertex,$yVertex+$marksep[1]/12,"($xVertex,$yVertex)", 'blue','left','bottom')); $gr->moveTo( $xVertex,$min[1] ); $gr->lineTo( $xVertex,$max[1],'red',1,'dashed'); $gr->stamps( closed_circle($tBack,0,'blue') ); -$gr->lb( new Label($tBack,0,"($tBack,0)", 'blue','right','bottom')); +$gr->lb( new Label($tBack,$marksep[1]/12,"($tBack,0)", 'blue','center','bottom')); $gr->stamps( closed_circle($t1,$h1,'blue') ); -$gr->lb( new Label($t1,$h1,"($t1,$h1)", 'blue','right','top')); +$gr->lb( new Label($t1,$h1+$marksep[1]/12,"($t1,$h1)", 'blue','center','bottom')); $gr->moveTo( $min[0], $h2 ); $gr->lineTo( $max[0],$h2,'red',1,'dashed'); $gr->stamps( closed_circle($t2,$h2,'blue') ); -$gr->lb( new Label($t2,$h2,"($t2,$h2)", 'blue','right','top')); +$gr->lb( new Label($t2,$h2-$marksep[1]/12,"($t2,$h2)", 'blue','center','top')); $gr->stamps( closed_circle($t3,$h2,'blue') ); -$gr->lb( new Label($t3,$h2,"($t3,$h2)", 'blue','left','top')); +$gr->lb( new Label($t3,$h2-$marksep[1]/12,"($t3,$h2)", 'blue','left','top')); BEGIN_PGML_SOLUTION @@ -251,7 +255,7 @@ This result shows that [`[$t1U]`] after the object was released, it was [`[$h1U] \end{aligned} `] -We will use the Quadratic Formula to solve this equation. Identify that [`a=[$a],b=[$b],c=[$s1]`]. We have: +We will use the Quadratic Formula to solve this equation. Identify that [`a=[$a],b=[$b],c=[$s6]`]. We have: [` \begin{aligned} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp25.pg new file mode 100644 index 0000000000..a4e3135764 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp25.pg @@ -0,0 +1,233 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find maximum/minimum value application problem. +# Use quadratic equation to model the height of flying objects. +# Find max, min, intercepts and interpret their meanings. +# +# Last edit by: Jordan 9/10/13; Carl Yao 08/25/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(t => 'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$a = -4.9; +$b = abs($a)*2*random(10,30,1); +$c = random(100,200,10); + +$func = Compute("$a*t**2+$b*t+$c")->reduce; +$funcX = Compute("$a*x**2+$b*x+$c")->reduce; + +#for alternative display and title purposes + + $xVertex = Real(-$b/(2*$a)); + $yVertex = Real($func->eval(t=>$xVertex)); + $vertex=Point($xVertex,$yVertex); + $yIntercept=Point(0,$c); + + @temp = $vertex->value; + $extraPointX = $temp[0]+1; + $extraPointY = Real($func->eval(t=>$extraPointX)); + $extraPoint = Point($extraPointX,$extraPointY); + +$xInt1 = Real((-$b+sqrt($b**2-4*$a*$c))/(2*$a)); +$xInt2 = Real((-$b-sqrt($b**2-4*$a*$c))/(2*$a)); +$xInt1Show = sprintf("%.2f",$xInt1); +$xInt2Show = sprintf("%.2f",$xInt2); + +$tMax = $xVertex; +$hMax = $yVertex; +$tBack = $xInt2; +$t1 = random(1,int($tBack-1),1); +$h1 = $func->eval(t=>$t1); +do {$t2 = random(1,int($tMax-1),1);} until ($t2!=$t1); +$t3 = 2*$tMax-$t2; +$h2 = $func->eval(t=>$t2); + +$tMaxU = NumberWithUnits("$tMax s"); +$hMaxU = NumberWithUnits("$hMax m"); +$tBackU = NumberWithUnits("$tBack s"); +$cU = NumberWithUnits("$c m"); +$bU = NumberWithUnits("$b m/s"); +$t1U = NumberWithUnits("$t1 s"); +$h1U = NumberWithUnits("$h1 m"); +$t2U = NumberWithUnits("$t2 s"); +$t3U = NumberWithUnits("$t3 s"); +$h2U = NumberWithUnits("$h2 m"); + +# to show alternative text for graphs +@alt=(); + + $alt="This picture shows the graph of a parabola. Its vertex is at $vertex, and it passes through the points ($xInt1,0), ($xInt2,0), ($t1,$h1), ($t2,$h2), and ($t3,$h2)."; + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xVertex,$xInt1-5,$xInt2],[$yVertex,0,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0,0) { + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + $gr->lb( new Label($max[0]-$marksep[0]/2, -$marksep[1]/8, t,'black','center','top')); + $gr->lb( new Label($marksep[0]/8, $max[1]-$marksep[1]/2, h,'black','left','middle')); + + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight:1"); +} + +############################################## + +BEGIN_PGML + +From a clifftop over the ocean [`[$cU]`] above sea level, an object was shot into the air with an initial vertical speed of [`[$bU]`]. On its way down it fell into the ocean. Its height (above sea level) as time passes can be modeled by the quadratic function [`f`], where [`f(t)=[$func]`]. Here [`t`] represents the number of seconds since the object's release, and [`f(t)`] represents the object's height (above sea level) in meters. + + 1) This object flew for [____________]{$tBackU} before it landed in the ocean. + + 2) This object was [`[$h2U]`] above sea level twice: once [____________]{$t2U} after its release, and again later [____________]{$t3U} after its release. + +(Use *m* for meters, and *s* for seconds.) + +END_PGML + +############################################## + +$func1 = $func; +$func1 =~ s/t/($xVertex)/g; +$func1 =~ s/~~*//g; + +$func4 = $func; +$func4 =~ s/t/($t1)/g; +$func4 =~ s/~~*//g; + +$s1 = -$h2; +$s2 = -$b; +$s4 = 2*$a; + +$s03 = $b**2-4*$a*$c; +$s05 = Real(sqrt($s03)); + +$s6 = $c-$h2; +$func5 = Compute("$a*t**2+$b*t+$s6")->reduce; +$s7 = $b**2-4*$a*$s6; +$s8 = Real(sqrt($s7)); + +$gr->stamps( closed_circle($tBack,0,'blue') ); +$gr->lb( new Label($tBack,$marksep[1]/12,"($tBack,0)", 'blue','center','bottom')); + +$gr->moveTo( $min[0], $h2 ); +$gr->lineTo( $max[0],$h2,'red',1,'dashed'); + +$gr->stamps( closed_circle($t2,$h2,'blue') ); +$gr->lb( new Label($t2,$h2-$marksep[1]/12,"($t2,$h2)", 'blue','center','top')); + +$gr->stamps( closed_circle($t3,$h2,'blue') ); +$gr->lb( new Label($t3,$h2-$marksep[1]/12,"($t3,$h2)", 'blue','left','top')); + +BEGIN_PGML_SOLUTION + +The function [`f`] given by the rule [`f(t)=[$func]`] is quadratic. Identify that [`a=[$a], b=[$b], c=[$c]`]. + +1) The parabola's [`x`]-intercepts represent the moments when the object was at a height of [`0`]: at sea level. We will solve the equation [`f(t)=0`] to find its [`x`]-intercepts. We have: + + [` +\begin{aligned} + f(t) &= [$func] \\ + 0 &= [$func] \\ + t &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + t &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$c])}}{2([$a])} \\ + t &= \frac{[$s2] \pm \sqrt{[$s03]}}{[$s4]} \\ + t &\approx \frac{[$s2] \pm [$s05]}{[$s4]} \\ + t &\approx \frac{[$s2] + [$s05]}{[$s4]} & \text{or} && t &\approx \frac{[$s2] - [$s05]}{[$s4]} \\ + t &\approx [$xInt1Show] & \text{or} && t &\approx [$xInt2Show] +\end{aligned} +`] + +This parabola has two [`x`]-intercepts: [`([$xInt1Show],0)`] and [`([$xInt2Show],0)`]. The point [`([$xInt1Show],0)`] represents an imaginary moment before the object was released, as if it had shot up from the ocean to the clifftop before its journey upward. The point [`([$xInt2Show],0)`] implies the object fell into the ocean after [`[$tBackU]`]. + +2) To find when the object was [`[$h2U]`] high, we solve the equation [` f(t)=[$h2]`]. + + [` +\begin{aligned} + f(t) &= [$func] \\ + [$h2] &= [$func] \\ + 0 &= [$func5] +\end{aligned} +`] + +We will use the Quadratic Formula to solve this equation. Identify that [`a=[$a],b=[$b],c=[$s1]`]. We have: + + [` +\begin{aligned} + t &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + t &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$s6])}}{2([$a])} \\ + t &= \frac{[$s2] \pm \sqrt{[$s7]}}{[$s4]} \\ + t & \approx \frac{[$s2] \pm [$s8]}{[$s4]} \\ + t &\approx \frac{[$s2] + [$s8]}{[$s4]} & \text{or} && t &\approx \frac{[$s2] - [$s8]}{[$s4]} \\ + t &\approx [$t2] & \text{or} && t &\approx [$t3] +\end{aligned} +`] + +This result shows that the object was [`[$h2U]`] high twice during its flight: once [`[$t2U]`] after it was released (on its way up), and another time [`[$t3U]`] after it was released (on its way down). + +---- + +It's important to understand the role of each part of this question in the graph of [`f`]. + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp30.pg new file mode 100644 index 0000000000..69b2606411 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp30.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Determine whether quadratic function has x-intercepts. +# +# Last edit by: Yao 1/13/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->are('t'=>'Real'); +#Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +do { + $vertexX = random(3,10,1); + $vertexY = random(-5,5,1); + do {$a = random(0.1,1.9,0.1);} until ($a!=0.5); + $b = Real(-2*$a*$vertexX); + $c = Real($a*$vertexX**2+$vertexY); +} until ($c>0); + +$func = Compute("$a*t**2+$b*t+$c")->reduce; + +$discriminant = Real("($b)**2-4*$a*$c"); +$correct = ($discriminant>=0) ? "will" : "will not"; + +$nb = -$b; +$a2 = $a*2; + +if ($discriminant==0) { + $e = int(100*(0.005))/100; + $x1 = int(100*(0.005+($nb+$e)/$a2))/100; + $x2 = int(100*(0.005+($nb-$e)/$a2))/100; +} +elsif ($discriminant>0) { + $e = int(100*(0.005+sqrt($discriminant)))/100; + $x1 = int(100*(0.005+($nb+$e)/$a2))/100; + $x2 = int(100*(0.005+($nb-$e)/$a2))/100; +} + +if ($discriminant<0) { + $message = "Since the equation has no real solution, the plane will not hit the ground during the stunt."; +} elsif ($discriminant==0) { + $output = + '&=\frac{'."$nb".'\pm0}{'."$a2".'}\\'. + '&=\frac{'."$nb".'}{'."$a2".'}\\'. + '&='."$vertexX"; + $message = "The plane would hit the ground `$vertexX` seconds into the stunt."; +} else { + $output = + '&\approx \frac{'."$nb".'\pm '."$e".'}{'."$a2".'} \\'. + '&\approx \frac{'."$nb".'+'."$e".'}{'."$a2".'}\text{ or }\frac{'."$nb".'-'."$e".'}{'."$a2".'} \\'. + '&\approx '."$x1".'\text{ or }'."$x2"; + $message = "The plane would hit the ground approximately `$x2` seconds into the stunt."; +} + +$popup = PopUp( + ['?', "will","will not"], $correct, +); + +############################################## + +BEGIN_PGML + +A remote control aircraft will perform a stunt by flying toward the ground and then up. Its height, in feet, can be modeled by the equation [`h=[$func]`], where [`t`] is in seconds. The plane [__]{$popup} hit the ground during this stunt. + +END_PGML + +############################################## + + +############################################## + + + +BEGIN_PGML_SOLUTION + +To determine whether the plane will hit the ground, we substitute [`h(t)=0`] into [`h(t)=[$func]`], and solve the equation by the Quadratic Formula: + + [`` + \begin{aligned} + t & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{-([$b])\pm\sqrt{([$b])^2-4([$a])([$c])}}{2([$a])}\\ + & = \frac{[$nb]\pm\sqrt{[$b**2]-[$a*$c*4]}}{[$a2]}\\ + & = \frac{[$nb]\pm\sqrt{[$b**2-$a*$c*4]}}{[$a2]}\\ + [$output] + \end{aligned} + ``] + +[$message] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp40.pg new file mode 100644 index 0000000000..7cc68b162a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/FlyingObjectApp40.pg @@ -0,0 +1,129 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Determine whether quadratic function has x-intercepts. +# +# Last edit by: Yao 1/13/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->are('t'=>'Real'); +#Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +do { + $vertexX = random(3,10,1); + $vertexY = random(-5,5,1); + do {$a = -random(0.1,1.9,0.1);} until ($a!=-0.5); + $b = Real(-2*$a*$vertexX); + $c = Real($a*($vertexX)**2+$vertexY); +} until ($c<0); + +$func = Compute("$a*t**2+$b*t+$c")->reduce; + +$discriminant = Real("($b)**2-4*$a*$c"); +$correct = ($discriminant>=0) ? "will" : "will not"; + +$nb = -$b; +$a2 = $a*2; + +if ($discriminant==0) { + $e = int(100*(0.005))/100; + $x1 = int(100*(0.005+($nb+$e)/$a2))/100; + $x2 = int(100*(0.005+($nb-$e)/$a2))/100; +} +elsif ($discriminant>0) { + $e = int(100*(0.005+sqrt($discriminant)))/100; + $x1 = int(100*(0.005+($nb+$e)/$a2))/100; + $x2 = int(100*(0.005+($nb-$e)/$a2))/100; +} + +if ($discriminant<0) { + $message = "Since the equation has no real solution, the submarine will not surface along this route."; +} elsif ($discriminant==0) { + $output = + '&=\frac{'."$nb".'\pm0}{'."$a2".'}\\'. + '&=\frac{'."$nb".'}{'."$a2".'}\\'. + '&='."$vertexX"; + $message = "The submarine will surface `$vertexX` seconds later."; +} else { + $output = + '&\approx \frac{'."$nb".'\pm '."$e".'}{'."$a2".'} \\'. + '&\approx \frac{'."$nb".'+'."$e".'}{'."$a2".'}\text{ or }\frac{'."$nb".'-'."$e".'}{'."$a2".'} \\'. + '&\approx '."$x1".'\text{ or }'."$x2"; + $message = "The submarine will surface approximately `$x1` seconds later."; +} + +$popup = PopUp( + ['?',"will","will not"], $correct +); + +############################################## + +BEGIN_PGML + +A submarine is traveling in the sea. Its depth, in meters, can be modeled by [`d=[$func]`], where [`t`] stands for time in seconds. The submarine [__]{$popup} hit the sea surface along this route. + + +END_PGML + +############################################## + + +############################################## + + + +BEGIN_PGML_SOLUTION + +To determine whether the submarine will surface, we substitute [`d(t)=0`] into [`d(t)=[$func]`], and solve the equation by the Quadratic Formula: + + [`` + \begin{aligned} + t & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{-([$b])\pm\sqrt{([$b])^2-4([$a])([$c])}}{2([$a])}\\ + & = \frac{[$nb]\pm\sqrt{[$b**2]-[$a*$c*4]}}{[$a2]}\\ + & = \frac{[$nb]\pm\sqrt{[$b**2-$a*$c*4]}}{[$a2]}\\ + [$output] + \end{aligned} + ``] + +[$message] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg index 415583c59a..51821d1efb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg @@ -8,34 +8,38 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "unorderedAnswer.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); #Context()->variables->add(y=>'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -101,11 +105,12 @@ add_functions($gr, "$func for x in <$min[0],$max[0]> using color:red and weight: BEGIN_PGML -One number is [`[$dif]`] less than a second number. Find a pair of such number that their product is as small as possible. - - These two numbers are [___________]{$ans}. (Use a comma to separate your numbers.) +Consider two numbers where one number is [`[$dif]`] less than a second number. +Find a pair of such numbers that has the least product possible. +One approach is to let [`x`] represent the smaller number, and write an expression for the product of the two numbers. +Then find its vertex and interpret it. [@KeyboardInstructions('(Use a comma to separate your numbers.)')@]** - The smallest possible product is [___________]{$yVertex}. + These two numbers are [___________]{$ans} and the least possible product is [___________]{$yVertex}. END_PGML @@ -123,45 +128,42 @@ $gr->lineTo( $xVertex,$max[1],'red',2,'dashed'); BEGIN_PGML_SOLUTION -If we call the first number [`x`], then the second number is [`x+[$dif]`]. Let the function [`f`] give the product of the two numbers. So we have: +If we call the first number [`x`], then the second number is [`x+[$dif]`]. +The product of the two numbers is: - [` f(x)=x(x+[$dif]) `] + [` x(x+[$dif]) `] -This is a quadratic function. We will rewrite it in standard form first: +This is a quadratic expression. We will rewrite it in standard form first: - [` f(x)=[$func] `] + [` [$func] `] -In this formula for [`f`], [`x`] represents the first number, and [`f(x)`] represents these two numbers' product. Identify that [`a=[$a], b=[$b], c=[$c]`]. - -Each output of this function represents the product of two numbers that differ by [`[$dif]`]. The smallest possible product happens at the parabola's vertex. +Identify that [`a=[$a], b=[$b], c=[$c]`]. The smallest possible product happens at the parabola's vertex. To find the parabola's vertex, we first find the parabola's axis of symmetry by the axis formula: [` \begin{aligned} - x &= -\frac{b}{2a} \\ - x &= -\frac{[$b]}{2([$a])} \\ - x &= [$xVertex] + h &= -\frac{b}{2a} \\ + h &= -\frac{[$b]}{2([$a])} \\ + h &= [$xVertex] \end{aligned} `] -Next, we substitute [`x= [$xVertex]`] into the rule for the function, and we have: +Next, we substitute [`x= [$xVertex]`] into the expression and we have: [` \begin{aligned} - f(x) &= [$func] \\ - f([$xVertex]) &= [$func1] \\ - f([$xVertex]) &= [$yVertex] + [$func] &= [$func1] \\ + &= [$yVertex] \end{aligned} `] -The parabola's vertex is at [`[$vertex]`]. This implies that the minimum product of such pairs is [`[$yVertex]`]. This happens when one number is [`[$xVertex]`], and the other number is [`[$xVertex]+[$dif]`], or rather [`[$secondNum]`]. +The parabola's vertex is at [`[$vertex]`]. This implies that the minimum product of such pairs is [`[$yVertex]`]. +This happens when one number is [`[$xVertex]`], and the other number is [`[$xVertex]+[$dif]`], or rather [`[$secondNum]`]. So these two numbers are [`[$xVertex]`] and [`[$secondNum]`]. The minimum product is [`[$yVertex]`]. ----- - -The following graph of [`f`] illustrates our findings. +The following graph of [`y=[$func]`] illustrates our findings. >>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt" title = "$alt"' )@]*<< END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg index 17fb78af8e..950c08454c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg @@ -8,34 +8,38 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "unorderedAnswer.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); Context()->noreduce("(-x)-y","(-x)+y"); @@ -104,11 +108,9 @@ $multiple = $times==2 ? "twice" : "$times times"; BEGIN_PGML -One number is [$dif] less than [$multiple] a second number. Find a pair of such numbers so that their product is as small as possible. - - These two numbers are [___________]{$ans}. (Use a comma to separate your numbers.) +Consider two numbers where one number is [`[$dif]`] less than [$multiple] a second number. Find a pair of such numbers that has the least product possible. One approach is to let [`x`] represent the smaller number, and write a formula for a function of [`x`] that outputs the product of the two numbers. Then find its vertex and interpret it. [@KeyboardInstructions('(Use a comma to separate your numbers.)')@]** - The smallest possible product is [___________]{$yVertex}. + These two numbers are [___________]{$ans} and the least possible product is [___________]{$yVertex}. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg index c7d70fd9d2..9dbe3e436f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg @@ -8,35 +8,38 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(fence) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(w => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -105,15 +108,14 @@ add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight BEGIN_PGML -You will build a rectangular sheep pen next to a river. There is no need to build a fence along the river, so you only need to build three sides. You have a total of [`[$fence]`] feet of fence to use. Find the dimensions of the pen such that you can enclose the maximum area. - - The length of the pen (parallel to the river) should be [____________]{$lengthU}. +You will build a rectangular sheep enclosure next to a river. +There is no need to build a fence along the river, so you only need to build on three sides. +You have a total of [`[$fence]`] feet of fence to use. Find the dimensions of the pen such that you can enclose the maximum possible area. +One approach is to let [`x`] represent the length of fencing that runs perpendicular to the river, and write an expression for the area of the enclosure. +Then find its vertex and interpret it. [@KeyboardInstructions('(Use [|ft|]* for feet, and [|ft^2|]* for square feet.)')@]** - The width of the pen (away from the river) should be [____________]{$widthU}. + The length of the pen (parallel to the river) should be [____________]{$lengthU}, the width (perpendicular to the river) should be [____________]{$widthU}, and the maximum possible area is [____________]{$areaU}. - The maximum area of the pen is [____________]{$areaU}. - -(Use *ft* for feet, and *ft^2* for square feet.) END_PGML @@ -136,21 +138,25 @@ $cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/10; $picture = init_graph($xmin,$ymin,$xmax,$ymax, pixels=>[400,400]); -$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-0.5,"length: ($fence-2w) ft",'black','center','middle')); -$picture->lb( new Label($x[1]+1,($y[0]+$y[1])/2,"width: w ft",'black','right','middle')); -$picture->lb( new Label(($x[0]+$x[1])/2,$y[1]+1,"RIVER",'black','center','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0],"length: ($fence-2w) ft",'black','center','top','large')); +$picture->lb( new Label($x[0],($y[0]+$y[1])/2,"width: w ft",'black','center','bottom','large','vertical')); +$picture->lb( new Label(($x[0]+$x[1])/2,$y[1]+1,"RIVER",'black','center','middle',giant)); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); +$picture->new_color("lightgreen",156,215,151); $picture->moveTo($x[0],$y[0]); -$picture->lineTo($x[1],$y[0], darkblue,3); -$picture->lineTo($x[1],$y[1], darkblue,3); -$picture->lineTo($x[0],$y[1], darkblue,3); -$picture->lineTo($x[0],$y[0], darkblue,3); +$picture->lineTo($x[1],$y[0], black,3); +$picture->lineTo($x[1],$y[1], black,3); +$picture->lineTo($x[0],$y[1], black,3); +$picture->lineTo($x[0],$y[0], black,3); $picture->moveTo($xmin,$y[1]); $picture->lineTo($xmax,$y[1], darkblue,3); +$picture->fillRegion([$x[0],$y[1]+1,"lightblue"]); +$picture->fillRegion([$x[0]-1,$y[1]-1,"lightgreen"]); +$picture->fillRegion([$x[0]+1,$y[1]-1,"lightgreen"]); $penAlt = "A diagram of a rectangular pen. Along the top side is a river. The right side is labeled w ft, and the bottom side is labeled ($fence-2w) ft."; @@ -161,70 +167,63 @@ $func1 =~ s/w/($xVertex)/g; $func1 =~ s/~~*//g; $gr->stamps( closed_circle($xVertex,$yVertex,'blue') ); -$gr->lb( new Label($xVertex,$yVertex,"($xVertex,$yVertex)", 'blue','left','bottom')); +$gr->lb( new Label($xVertex,$yVertex,"($xVertex,$yVertex)", 'blue','left','bottom','large')); $gr->moveTo( $xVertex,$min[1] ); $gr->lineTo( $xVertex,$max[1],'red',2,'dashed'); -Context()->texStrings; -BEGIN_SOLUTION -$PAR -Drawing a diagram should help us creat a function for the area of the pen. -$PAR -$BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400,extra_html_tags=>'alt = "$penAlt" title = "$penAlt"') \} -$ECENTER -$PAR -Let the width be \(w\) ft, and the length be \(l\) ft. Since there are only three sides of the fence, we have: -\[ +BEGIN_PGML_SOLUTION +Drawing a diagram should help us write an expression for the area of the pen. + +>> [@ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400,extra_html_tags=>'alt = "$penAlt" title = "$penAlt"') @]* << + +Let the width be [`w`] ft, and the length be [`\ell`] ft. Since there are only three sides of the fence, we have: + +[`` \begin{aligned}[t] -l+2w &= $fence \\ -l &= $fence-2w +\ell+2w &= [$fence] \\ +\ell &= [$fence]-2w \end{aligned} -\] -$PAR -If the pen's width is \(w\) feet, then its length is \( ($fence-2w) \) feet. Now we can build a function for the area of the pen: -$PAR -\[ f(w)=($fence-2w)w \] -$PAR -\[ f(w)=-2w^{2}+$fence w \] -$PAR -In this formula, \(w\) represents the pen's width in feet, and \(f(w)\) represents the pen's area in square feet. Identify that \(a=$a,b=$b,c=$c\). -$PAR -Each output of this function represents a possible area of the pen. The maximum area happens at the parabola's vertex. -$PAR +``] + +If the pen's width is [`w`] feet, then its length is [`[$fence]-2w`] feet. +Now we can write an expression for the area of the pen: + +[``\begin{align} +\text{area}&= ([$fence]-2w)w\\ +&= -2w^{2}+[$fence] w +\end{align}``] + +Identify that [`a=[$a]`], [`b=[$b]`], and [`c=[$c]`]. The maximum area happens at the parabola's vertex. + To find the vertex, we first find the parabola's axis of symmetry by using the axis formula: -$PAR -\[ + +[`` \begin{aligned}[t] - w &= -\frac{b}{2a} \\ - w &= -\frac{$b}{2($a)} \\ - w &= $xVertex + h &= -\frac{b}{2a} \\ + h &= -\frac{[$b]}{2([$a])} \\ + h &= [$xVertex] \end{aligned} -\] -$PAR -Next, we substitute \(w= $xVertex \) into the rule for the \(f\), and we have: -$PAR -\[ +``] + +Next, we substitute [`w= [$xVertex]`] into the expression, and we have: + +[`` \begin{aligned}[t] - f(w) &= $func \\ - f($xVertex) &= $func1 \\ - f($xVertex) &= $yVertex + [$func] &= [$func1] \\ + &= [$yVertex] \end{aligned} -\] -$PAR -The parabola's vertex is at \($vertex\). This implies that the pen's maximum area is \($yVertex\) square feet. This happens when the width is \($xVertex\) feet, and the length is \($fence - 2($xVertex)\), or \($length\), feet. -$PAR -So when the length is \($length\) feet and the width is \($xVertex\) feet, the pen has a maximum possible area of \($yVertex\) square feet. -$PAR -$HR -$PAR +``] + +The parabola's vertex is at [`[$vertex]`]. +This implies that the pen's maximum area is [`[$yVertex]`] square feet. +This happens when the width is [`[$xVertex]`] feet, and the length is [`[$fence] - 2([$xVertex])`], or [`[$length]`], feet. + +So when the length is [`[$length]`] feet and the width is [`[$xVertex]`] feet, the pen has a maximum possible area of [`[$yVertex]`] square feet. + The following graph illustrates our findings. -$PAR -$BCENTER -\{ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt" title = "$alt"' )\} -$ECENTER -END_SOLUTION -Context()->normalStrings; + +>> [@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt" title = "$alt"' )@]* << +END_PGML_SOLUTION ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg index 82c4ed12c4..f998ec3808 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg @@ -9,30 +9,33 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(fence) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "parserNumberWithUnits.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -40,7 +43,7 @@ loadMacros( $numPens = 2; TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(w => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -108,15 +111,13 @@ add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight BEGIN_PGML -You will build two rectangular pens next to each other, sharing a side. You have a total of [`[$fence]`] feet of fence to use. Find the dimension of each pen such that you can enclose the maximum area. - - The length of each pen (along the wall that they share) should be [____________]{$widthU}. +You will build two identical rectangular enclosures next to a each other, sharing a side. +You have a total of [`[$fence]`] feet of fence to use. Find the dimensions of each pen such that you can enclose the maximum possible area. +One approach is to let [`x`] represent the length of fencing that the two pens share, and write a formula for the total area of the enclosures. +Then find its vertex and interpret it. [@KeyboardInstructions('(Use [|ft|]* for feet, and [|ft^2|]* for square feet.)')@]** - The width of each pen should be [____________]{$lengthU}. + The length of each pen (along the wall that they share) should be [____________]{$widthU}, the width should be [____________]{$lengthU}, and the maximum possible area of each pen is [____________]{$areaU}. - The maximum area of each pen is [____________]{$areaU}. - -(Use *ft* for feet, and *ft^2* for square feet.) END_PGML @@ -141,26 +142,31 @@ $xMid = ($x[0]+$x[1])/2; $xFirstMid = ($x[0]+$xMid)/2; $xSecondMid = ($xMid+$x[1])/2; -$picture->lb( new Label($xFirstMid, $y[0]-0.5,"w ft",'black','center','middle')); -$picture->lb( new Label($xSecondMid, $y[0]-0.5,"w ft",'black','center','middle')); -$picture->lb( new Label($xFirstMid, $y[1]+0.5,"w ft",'black','center','middle')); -$picture->lb( new Label($xSecondMid, $y[1]+0.5,"w ft",'black','center','middle')); +$picture->lb( new Label($xFirstMid, $y[0],"w ft",'black','center','bottom','large')); +$picture->lb( new Label($xSecondMid, $y[0],"w ft",'black','center','bottom','large')); +$picture->lb( new Label($xFirstMid, $y[1],"w ft",'black','center','bottom','large')); +$picture->lb( new Label($xSecondMid, $y[1],"w ft",'black','center','bottom','large')); -$picture->lb( new Label($x[1]+0.5,($y[0]+$y[1])/2,"L ft",'black','left','middle')); -$picture->lb( new Label($xMid+0.5,($y[0]+$y[1])/2,"L ft",'black','left','middle')); -$picture->lb( new Label($x[0]+0.5,($y[0]+$y[1])/2,"L ft",'black','left','middle')); +$picture->lb( new Label($x[1],($y[0]+$y[1])/2,"L ft",'black','center','bottom','large','vertical')); +$picture->lb( new Label($xMid,($y[0]+$y[1])/2,"L ft",'black','center','bottom','large','vertical')); +$picture->lb( new Label($x[0],($y[0]+$y[1])/2,"L ft",'black','center','bottom','large','vertical')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); +$picture->new_color("lightgreen",156,215,151); $picture->moveTo($x[0],$y[0]); -$picture->lineTo($x[1],$y[0], darkblue,3); -$picture->lineTo($x[1],$y[1], darkblue,3); -$picture->lineTo($x[0],$y[1], darkblue,3); -$picture->lineTo($x[0],$y[0], darkblue,3); +$picture->lineTo($x[1],$y[0], black,3); +$picture->lineTo($x[1],$y[1], black,3); +$picture->lineTo($x[0],$y[1], black,3); +$picture->lineTo($x[0],$y[0], black,3); $picture->moveTo(($x[0]+$x[1])/2,$y[0]); -$picture->lineTo(($x[0]+$x[1])/2,$y[1], darkblue,3); +$picture->lineTo(($x[0]+$x[1])/2,$y[1], black,3); + +$picture->fillRegion([$x[0]-1,$y[1]-1,"lightgreen"]); +$picture->fillRegion([$x[1]-1,$y[1]-1,"lightgreen"]); +$picture->fillRegion([$x[0]+1,$y[1]-1,"lightgreen"]); $penAlt = "A diagram of a two adjacent rectangular pens. They share a vertical wall that is L ft long. Each pen's width is w ft."; @@ -173,77 +179,64 @@ $func1 =~ s/w/($xVertex)/g; $func1 =~ s/~~*//g; $gr->stamps( closed_circle($xVertex,$yVertex,'blue') ); -$gr->lb( new Label($xVertex,$yVertex,"($xVertex,$yVertex)", 'blue','left','bottom')); +$gr->lb( new Label($xVertex,$yVertex,"($xVertex,$yVertex)", 'blue','left','bottom','large')); $gr->moveTo( $xVertex,$min[1] ); $gr->lineTo( $xVertex,$max[1],'red',2,'dashed'); -Context()->texStrings; -BEGIN_SOLUTION -$PAR -Drawing a diagram should help us create up a function for the area of the pen. -$PAR -$BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags=>'alt = "$penAlt" title = "$penAlt"' ) \} -$ECENTER -$PAR -Let the width be \(w\) ft, and the length be \(L\) ft. Since there is a total of $fence feet of fence, we have: -$PAR $BCENTER -\( +BEGIN_PGML_SOLUTION +Drawing a diagram should help us write an expression for the area of the pen. + +>> [@ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags=>'alt = "$penAlt" title = "$penAlt"' ) @]* << + +Let the width be [`w`] ft, and the length be [`\ell`] ft. Since there is a total of [$fence] feet of fence, we have: + +[`` \begin{aligned}[t] -4w+3L &= $fence \\ -4w &= $fence-3L \\ -\frac{4w}{4} &= \frac{$fence}{4}-\frac{3L}{4} \\ -w &= $s1-0.75L +4w+3\ell &= [$fence] \\ +4w &= [$fence]-3\ell \\ +\frac{4w}{4} &= \frac{[$fence]}{4}-\frac{3\ell}{4} \\ +w &= [$s1]-0.75\ell \end{aligned} -\) -$ECENTER $PAR -If each pen's length is \(L\) feet, then its width is \( ($s1-0.75L) \) feet. Now we can construct a function for the area of each pen: -$PAR $BCENTER -\( f(L)=($s1-0.75L)L \) -$PAR -\( f(L)=-0.75L^{2}+$s1 L \) -$ECENTER $PAR -In this formula, \(L\) represents each pen's length in feet, and \(f(L)\) represents each pen's area in square feet. Identify that \(a=$a,b=$b,c=$c\). -$PAR -Each output of this function represents a possible area of each pen. The maximum area happens at the parabola's vertex. -$PAR +``] + +If each pen's length is [`\ell`] feet, then its width is [`[$s1]-0.75\ell`] feet. Now we can write an expression for the area of each pen: + +[`` +\begin{align} +\text{area}&=([$s1]-0.75\ell)\ell\\ +&=-0.75\ell^{2}+[$s1] \ell +\end{align} +``] + +Identify that [`a=[$a]`], [`b=[$b]`], [`c=[$c]`]. The maximum area happens at the parabola's vertex. + To find the vertex, we first find the parabola's axis of symmetry by using the axis formula: -$PAR -$BCENTER -\( + +[`` \begin{aligned}[t] - L &= -\frac{b}{2a} \\ - L &= -\frac{$b}{2($a)} \\ - L &= $xVertex + h &= -\frac{b}{2a} \\ + h &= -\frac{[$b]}{2([$a])} \\ + h &= [$xVertex] \end{aligned} -\) -$ECENTER -$PAR -Next, we substitute \(L= $xVertex \) into the rule for the function, and we have: -$PAR -$BCENTER -\( +``] + +Next, we substitute [`\ell= [$xVertex]`] into the expression, and we have: + +[`` \begin{aligned}[t] - f(L) &= $func \\ - f($xVertex) &= $func1 \\ - f($xVertex) &= $yVertex + [$func1] &= [$yVertex] \end{aligned} -\) -$ECENTER -$PAR -The parabola's vertex is at \($vertex\). This implies that each pen's maximum area is \($yVertex\) square feet. This happens when the length is \($widthU\) feet, and the width is \($s1 - 0.75 \cdot $xVertex\), or \($length\), feet. -$PAR -So when the length is \($widthU\) and the width is \($lengthU\), each pen has a maximum area of \($areaU\). -$PAR -$HR -$PAR +``] + +The parabola's vertex is at [`[$vertex]`]. This implies that each pen's maximum area is [`[$yVertex]`] square feet. +This happens when the length is [`[$widthU]`] feet, and the width is [`[$s1] - 0.75 \cdot [$xVertex]`], or [`[$length]`], feet. + +So when the length is [`[$widthU]`] and the width is [`[$lengthU]`], each pen has a maximum area of [`[$areaU]`]. + The following graph illustrates our findings. -$PAR -$BCENTER -\{ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt" title = "$alt"' )\} -$ECENTER -END_SOLUTION -Context()->normalStrings; + +>> [@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt" title = "$alt"' ) @]* << +END_PGML_SOLUTION ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg index c6109f61c9..7c8e0540c8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg @@ -9,31 +9,33 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(fence) -## MLTleader(1) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "parserNumberWithUnits.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -41,7 +43,7 @@ loadMacros( $numPens = 4; TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(w => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -109,15 +111,10 @@ add_functions($gr, "$funcX for x in <$min[0],$max[0]> using color:red and weight BEGIN_PGML -You plan to build four identical rectangular sheep pens in a row. Each adjacent pair of pens share a fence between them. You have a total of [`[$fence]`] feet of fence to use. Find the dimension of each pen such that you can enclose the maximum area. - - The length of each pen (along the walls that they share) should be [____________]{$widthU}. - - The width of each pen should be [____________]{$lengthU}. +You plan to build four identical rectangular animal enclosures in a row. Each adjacent pair of pens share a fence between them. You have a total of [`[$fence]`] feet of fence to use. Find the dimensions of each pen such that you can enclose the maximum possible area. One approach is to let [`x`] represent the length of fencing that adjacent pens share, and write a formula for a function of [`x`] that outputs the total area. Then find its vertex and interpret it. [@KeyboardInstructions('(Use [|ft|]* for feet, and [|ft^2|]* for square feet.)')@]** - The maximum area of each pen is [____________]{$areaU}. + The length of each pen (along the walls that they share) should be [____________]{$widthU}, the width (perpendicular to the river) should be [____________]{$lengthU}, and the maximum possible area of each pen is [____________]{$areaU}. -(Use *ft* for feet, and *ft^2* for square feet.) END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication60.pg new file mode 100644 index 0000000000..0b83862550 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/MaxMinApplication60.pg @@ -0,0 +1,243 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find maximum/minimum value application problem. +# Use quadratic equation to model the income, which changes +# quadratically in terms of the number of times of price increase. +# +# Last edit by: Carl Yao 11/06/17 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(t => 'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $initialAmount = random(200,300,10); + $initialPrice = random(50,150,10); + $raise = random(5,20,5); + do {$numLoss = random(5,20,5);} until ($initialAmount-$numLoss*10>0); + $a = -$numLoss*$raise; + $b = $raise*$initialAmount-$numLoss*$initialPrice; + $maxX = -$b/(2*$a); + $x1 = random(3,int($maxX-1),1); + $x2 = 2*$maxX-$x1; +} until ( ($maxX>5) && (int($maxX*10)==$maxX*10) && (int($x2*10)==$x2*10) && (($maxX-$x1)>2) ); + +$newIncome = ($initialPrice+$raise*$x1)*($initialAmount-$numLoss*$x1); +$cFunc = $initialPrice*$initialAmount; +$c = $initialPrice*$initialAmount-$newIncome; +$discriminant = ($b)**2-4*$a*$c; +$func = Compute("$a*x**2+$b*x+$cFunc")->reduce; +$maxPrice = $initialPrice+$raise*$maxX; +$maxIncome = $func->eval(x=>$maxX); +$ans1 = $initialPrice+$raise*$x1; +$ans2 = $initialPrice+$raise*$x2; +$xIntercept1 = (-$b+sqrt(($b)**2-4*$a*$cFunc))/(2*$a); +$xIntercept2 = (-$b-sqrt(($b)**2-4*$a*$cFunc))/(2*$a); + +Context("Currency"); +$initialPriceC = Currency($initialPrice); +$raiseC = Currency($raise); +$newIncomeC = Currency($newIncome); +$maxPriceC = Currency($maxPrice); +$ans1C = Currency($ans1); +$ans2C = Currency($ans2); +$maxIncomeC = Currency($maxIncome); + +$vertex=Point($maxX,$maxIncome); +$pointLeft = Point($x1,$newIncome); +$pointRight = Point($x2,$newIncome); + +$alt="This picture shows the graph of a parabola. Its vertex is at $vertex. A horizontal line is graphed at y=$newIncome. It intersects the parabola at $pointLeft and $pointRight. The vertex, $vertex, is also plotted."; + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xIntercept1,$xIntercept2],[0,$maxIncome]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + + $gr = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + $gr->lb( new Label($max[0]-$marksep[0]/2, -$marksep[1]/8, t,'black','center','top')); + $gr->lb( new Label($marksep[0]/8, $max[1]-$marksep[1]/2, h,'black','left','middle')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + +add_functions($gr, "$func for x in <$min[0],$max[0]> using color:red and weight:1"); + +add_functions($gr, "$newIncome for x in <$min[0],$max[0]> using color:blue and weight:1"); + +$gr->stamps( closed_circle($x1,$newIncome,'red') ); +$gr->lb( new Label($x1,$newIncome+$marksep[1]/8,"($x1,$newIncome)", 'red','right','bottom','large')); + +$gr->stamps( closed_circle($x2,$newIncome,'red') ); +$gr->lb( new Label($x2,$newIncome+$marksep[1]/8,"($x2,$newIncome)", 'red','left','bottom','large')); + +$gr->stamps( closed_circle($maxX,$maxIncome,'red') ); +$gr->lb( new Label($maxX,$maxIncome+$marksep[1]/8,"($maxX,$maxIncome)", 'red','center','bottom','large')); + + +############################################## + +BEGIN_PGML + +Currently, an artist can sell [`[$initialAmount]`] paintings every year at the price of [`[$initialPriceC]`] per painting. +Each time he raises the price per painting by [`[$raiseC]`], he sells [`[$numLoss]`] fewer paintings every year. + +a. To obtain maximum income of [__________]{$maxIncomeC}, the artist should set the price per painting at [___________]{$maxPriceC}. + +a. To earn [`[$newIncomeC]`] per year, the artist could sell his paintings at two different prices. The lower price is [___________]{$ans1C} per painting, and the higher price is [___________]{$ans2C} per painting. + +END_PGML + +############################################## + +$s1 = $initialPrice*$numLoss; +$s2 = $raise*$initialAmount; +$s3 = sqrt($discriminant); + +BEGIN_PGML_SOLUTION + +Assume the artist will raise the price per painting [`x`] times. + +The current price per painting is [`[$initialPriceC]`]. +After raising the price [`x`] times, each time by [`[$raiseC]`], the new price per painting will become [`[$initialPrice]+[$raise]x`] dollars. + +Currently he sells [`[$initialAmount]`] paintings per year. It's given that he will sell [`[$numLoss]`] fewer paintings each time he raises the price. +After raising the price per painting [`x`] times, he will sell [`[$initialAmount]-[$numLoss]x`] paintings every year. + +The artist's income can be calculated by multiplying the number of paintings sold with price per painting. +If he raises the price per painting [`x`] times, his new yearly income can be modeled by the expression: + + [`` ([$initialPrice]+[$raise]x)([$initialAmount]-[$numLoss]x) ``] + +which gives his yearly income in dollars. + +We can write this quadratic expression in standard form: + + [`` +\begin{aligned}[t] + ([$initialPrice]+[$raise]x)([$initialAmount]-[$numLoss]x) + &= [$cFunc]-[$s1]x+[$s2]x+[$a]x^2 \\ + &= [$a]x^2+[$b]x+[$cFunc] +\end{aligned} + ``] + +Written in standard form, we can see: + + [`` a=[$a], b=[$b], c=[$cFunc] ``] + +###Part a: + +The graph of [`y = [$a]x^2+[$b]x+[$cFunc] `] is an upside-down parabola. +The maximum income he can make is represented by the parabola's vertex. +To locate its vertex, we first find its axis by the axis formula: + + [`` +\begin{aligned}[t] + h &= -\frac{b}{2a} \\ + &= -\frac{[$b]}{2([$a])} \\ + &= [$maxX] +\end{aligned} + ``] + +Next, we substitute [` x=[$maxX] `] into the expression to find its vertex's [`y`]-value: + + [`` +\begin{aligned}[t] + [$a]x^2+[$b]x+[$cFunc] &= [$a]([$maxX])^2+[$b]([$maxX])+[$cFunc] \\ + &= [$maxIncome] +\end{aligned} + ``] + +The vertex is at [`[$vertex]`]. This implies the artist can earn a maximum yearly income of [`[$maxIncomeC]`]. +This happens if he increases the price per painting [`[$maxX]`] times, making the new price [`[$initialPrice]+[$maxX]\cdot[$raise]=[$maxPrice] `] dollars. + +###Part b: + +If the artist wants to make [`[$newIncomeC]`] per year, we will set the expression representing income equal to [`[$newIncome]`], and we have: + + [`` +\begin{aligned}[t] + [$newIncome] &= [$a]x^2+[$b]x+[$cFunc] \\ + 0 &= [$a]x^2+[$b]x+[$c] \\ +\end{aligned} + ``] + +Next, we can solve this quadratic equation with the Quadratic Formula. Identify that [`a=[$a],b=[$b],c=[$c]`]. + + [`` +\begin{aligned}[t] + x &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + x &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$c])}}{2([$a])} \\ + x &= \frac{[$b*-1] \pm \sqrt{[$discriminant]}}{[$a*2]} \\ + x &= \frac{[$b*-1] \pm [$s3]}{[$a*2]} \\ + x&=\frac{[$b*-1] + [$s1]}{[$a*2]} \text{ or } x=\frac{[$b*-1] - [$s1]}{[$a*2]} \\ + x&=[$x1] \text{ or } x=[$x2] +\end{aligned} + ``] + +If the artist raises the price [`[$x1]`] times, the new price would be [`[$initialPrice]+[$raise]\cdot[$x1]=[$ans1]`] dollars per painting. + +If the artist raises the price [`[$x2]`] times, the new price would be [`[$initialPrice]+[$raise]\cdot[$x2]=[$ans2]`] dollars per painting. + +To earn [`[$newIncomeC]`] per year, the artist could sell his paintings at two different prices. The lower price is [`[$ans1C]`] per painting, +and the higher price is [`[$ans2C]`] dollars per painting. + +The following graph shows the points representing the solutions above: + +>>[@ image( insertGraph($gr), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$alt' title = '$alt'" )@]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg index d5ea8e5d42..a6c903d02e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','equation','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "unorderedAnswer.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -50,7 +54,7 @@ BEGIN_PGML Two numbers' sum is [`[$sum]`], and their product is [`[$product]`]. Find these two numbers. - These two numbers are [___________]{$ans}. (Use a comma to separate your numbers.) + These two numbers are [___________]{$ans}. [@KeyboardInstructions('(Use a comma to separate your numbers.)')@]** END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg index 121c9c25de..503bd53466 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','equation','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "unorderedAnswer.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,6 +42,9 @@ TEXT(beginproblem()); $num1 = non_zero_random(-10,10,1)+random(1,9,1)/10; do {$num2 = non_zero_random(-10,10,1)+random(1,9,1)/10;} until (abs($num1)!=abs($num2)); +$num1 = Real($num1); +$num2 = Real($num2); + $sum = $num1 + $num2; $product = $num1*$num2; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg index c171b614e3..6866a2dd45 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','equation','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg index abf9342345..1c278f8900 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','equation','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -96,7 +99,18 @@ It's given that the rectangle's area is [`[$areaU]`], so we can write and solve \end{aligned} ``] -The polynomial could be factored, but it might take a while. We will solve the equation by the Quadratic Formula instead. +The polynomial can be factored, so we will first solve this equation by factoring: + + [`` +\begin{aligned}[t] + ([$times]x+[$base])(x-[$height]) &=0 \\ + [$times]x+[$base]=0 &\text{ or } x-[$height]=0 \\ + [$times]x=-[$base] &\text{ or } x=[$height] \\ + x=\text{a negative number} &\text{ or } x=[$height] +\end{aligned} + ``] + +We could also solve the equation by the Quadratic Formula. Identify that [`a=[$a],b=[$b],c=[$c]`]. @@ -106,14 +120,14 @@ Identify that [`a=[$a],b=[$b],c=[$c]`]. x &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$c])}}{2([$a])} \\ x &= \frac{[$s1] \pm \sqrt{[$s2]}}{[$s3]} \\ x &= \frac{[$s1] \pm [$s4]}{[$s3]} \\ - x &= \frac{[$s1] + [$s4]}{[$s3]} &\text{or}&& x&= \frac{[$s1] - [$s4]}{[$s3]} \\ - x&=[$height] &\text{or} && x&= \text{a negative number} + x &= \frac{[$s1] + [$s4]}{[$s3]} \text{ or } x= \frac{[$s1] - [$s4]}{[$s3]} \\ + x&=[$height] \text{ or } x= \text{a negative number} \end{aligned} ``] Notice that there is no need to calculate the negative result, as a rectangle's height cannot be negative. The height is [`[$heightU]`]. -Recall that the rectangle's base is [`[$times]x-[$more]`] inches, where [`x`] is the height. Thus the base is [`[$times] \cdot [$heightU] - [$moreU]`], or just [`[$baseU]`]. +Recall that the rectangle's base is [`[$times]x-[$more]`] inches, where [`x`] is the height. Thus the base is [`[$times] \cdot [$heightU] - [$moreU]`], which is [`[$baseU]`]. So the rectangle's height is [`[$heightU]`], and its base is [`[$baseU]`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg index 0773e0d070..8f059f52c3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg @@ -8,36 +8,38 @@ # # ENDDESCRIPTION -## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Applications and models) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(fence) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') ## KEYWORDS('quadratic','equation','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "parserNumberWithUnits.pl", "parserMultiAnswer.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## TEXT(beginproblem()); -$refreshCachedImages=1; + Context("Numeric"); Context()->variables->add(w => 'Real'); Context()->flags->set(showExtraParens=>0, reduceConstants=>0); @@ -210,14 +212,14 @@ Identify that [`a=[$a],b=[$b],c=[$c]`]. w &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$c])}}{2([$a])} \\ w &= \frac{[$s1] \pm \sqrt{[$s2]}}{[$s3]} \\ w &= \frac{[$s1] \pm [$s4]}{[$s3]} \\ - w &= \frac{[$s1] + [$s4]}{[$s3]} &\text{or} &&w&= \frac{[$s1] - [$s4]}{[$s3]} \\ - w&=[$s7] &\text{or} && w&= [$s5] + w &= \frac{[$s1] + [$s4]}{[$s3]} \text{ or } w= \frac{[$s1] - [$s4]}{[$s3]} \\ + w&=[$s7] \text{ or } w= [$s5] \end{aligned} ``] Recall that the length is [`([$fence]-2w)`] feet, where [`w`] is the width. -If the width is [`[$s7]`] feet, the length would be [`[$fence]-2 \cdot [$width] = [$s8]`] feet. This is one solution. +If the width is [`[$s7]`] feet, the length would be [`[$fence]-2 \cdot [$s7] = [$s8]`] feet. This is one solution. If the width is [`[$s5]`] feet, the length would be [`[$fence]-2 \cdot [$s5] = [$s6]`] feet. This is another solution. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication60.pg new file mode 100644 index 0000000000..5e8bf1fcc8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication60.pg @@ -0,0 +1,165 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# A rectangle's base and height are given. Both are enlarged by x on both sides. +# The new area is given, find x. +# +# Last edit by: Yao 11/21/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','equation','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce("(-x)-y","(-x)+y"); + +do { + $width = random(3,10,1); + $length = random(3,10,1); +} until ( ($length-$width>=2) && (($length+$width)%2==0) && (($area2-$area1)%4==0) ); + +$area1 = $width*$length; +$x = random(1,3,1); +$area2 = ($length+2*$x)*($width+2*$x); + +$widthU = NumberWithUnits("$width ft"); +$lengthU = NumberWithUnits("$length ft"); +$area2U = NumberWithUnits("$area2 ft^2"); +$xU = NumberWithUnits("$x ft"); + + + +#Build a diagram picture. +$xmin = 0; #The viewing window +$xmax = $length+2*$x+1; +$ymin = 0; +$ymax = ($width+$x*2)*1.1; + +@x = (($xmax-$length)/2,($xmax+$length)/2); +@y = (($ymax-$width)/2,($ymax+$width)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0],"$length ft",'black','center','bottom','large')); +$picture->lb( new Label($x[1],($y[0]+$y[1])/2,"$width ft",'black','center','bottom','vertical','large')); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[0], black,3); +$picture->lineTo($x[1],$y[1], black,3); +$picture->lineTo($x[0],$y[1], black,3); +$picture->lineTo($x[0],$y[0], black,3); + +$picture->moveTo($x[0]-$x,$y[0]-$x); +$picture->lineTo($x[1]+$x,$y[0]-$x, blue,3); +$picture->lineTo($x[1]+$x,$y[1]+$x, blue,3); +$picture->lineTo($x[0]-$x,$y[1]+$x, blue,3); +$picture->lineTo($x[0]-$x,$y[0]-$x, blue,3); +$picture->moveTo(($x[0]+$x[1])/2,$y[0]); +$picture->lineTo(($x[0]+$x[1])/2,$y[0]-$x,'black',1,'dashed'); +$picture->moveTo(($x[0]+$x[1])/2,$y[1]); +$picture->lineTo(($x[0]+$x[1])/2,$y[1]+$x,'black',1,'dashed'); +$picture->moveTo($x[0],($y[0]+$y[1])/2); +$picture->lineTo($x[0]-$x,($y[0]+$y[1])/2,'black',1,'dashed'); +$picture->moveTo($x[1],($y[0]+$y[1])/2); +$picture->lineTo($x[1]+$x,($y[0]+$y[1])/2,'black',1,'dashed'); + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-$x/2,"x",'black','right','middle','large')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[1]+$x/2,"x",'black','right','middle','large')); +$picture->lb( new Label($x[1]+$x/2, ($y[0]+$y[1])/2,"x",'black','center','top','large')); +$picture->lb( new Label($x[0]-$x/2, ($y[0]+$y[1])/2,"x",'black','center','top','large')); + +$alt = "The diagram shows a black rectangle with the length marked as $length feet, and the width marked as $height feet. Outside the black rectangle is a blue rectangle. This distance between each outside and inside side is marked as x."; + +############################################## + +BEGIN_PGML + +There is a rectangular lot in the garden, with [`[$lengthU]`] in length and [`[$widthU]`] in width. You plan to expand the lot by an equal length around its four sides, and make the area of the expanded rectangle [`[$area2U]`]. How long should you expand the original lot in four directions? + +>>[@ image(insertGraph( $picture ), tex_size=>800, width=>240, extra_html_tags=>"alt = '$alt' title = '$alt'" ) @]*<< + +You should expand the original lot by [_________]{$xU} in four directions. [@KeyboardInstructions('Please type [|ft|]* to represent feet.')@]** + +END_PGML + +############################################## + +$a = 4; +$b = 2*$width+2*$length; +$c = $area1-$area2; +$discriminant = $b**2-4*$a*$c; + +$s1 = 2*$length+2*$width; +$s2 = ($area1-$area2)/4; +$s3 = sqrt($discriminant); +$s4 = -$b; + +BEGIN_PGML_SOLUTION + +Assume you will extend the lot's four sides by [`x`] feet. According to the diagram, the expanded rectangle's length will become [`[$length]+2x`] feet, and its width will become [`[$width]+2x`] feet. The new rectangle's area will be [`([$length]+2x)([$width]+2x)`] square feet. It's given its new area is [`[$area2U]`], so we can write and solve an equation: + + [`` +\begin{aligned}[t] + ([$length]+2x)([$width]+2x) &= [$area2] \\ + 4x^2+[$s1]x+[$area1] &= [$area2] \\ + 4x^2+[$s1]x+[$area1-$area2] &= 0 \\ + 4(x^2+[$s1/4]x+[$s2]) &= 0 \\ + 4(x+[$s2*-1/$x])(x-[$x]) &= 0 \\ + x+[$s2*-1/$x] &= 0 \text{ or } x-[$x] = 0 \\ + x &= [$s2/$x] \text{ or } x= [$x] \\ +\end{aligned} + ``] + +We could solve this equation by the Quadratic Formula. Identify that [`a=[$a],b=[$b],c=[$c]`]. + + [`` +\begin{aligned}[t] + x &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + x &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$c])}}{2([$a])} \\ + x &= \frac{[$s4] \pm \sqrt{[$discriminant]}}{[$a*2]} \\ + x &= \frac{[$s4] \pm [$s3]}{[$a*2]} \\ + x &= \frac{[$s4] + [$s3]}{[$a*2]} \text{ or } x= \frac{[$s4] - [$s3]}{[$a*2]} \\ + x&=[$x] \text{ or } x= [$s2/$x] +\end{aligned} + ``] + +We don't take the negative solution as it doesn't make sense in this context. + +You should expand the original lot by [`[$xU]`] in four directions. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication70.pg new file mode 100644 index 0000000000..2516ab1905 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication70.pg @@ -0,0 +1,174 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Pythagorean Theorem application problem. Quadratic Formula is needed. +# +# Last edit by: Yao 12/10/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','equation','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $car1Speed = random(40,70,5); + do {$car2Speed = random(40,70,5);} until ($car2Speed!=$car1Speed); + $headStart = random(1,4,0.5); + $distance = random(int($car1Speed*$headStart+100),int($car1Speed*$headStart+300),1); + + $a = $car1Speed**2+$car2Speed**2; + $b = 2*$headStart*$car1Speed**2; + $c = $car1Speed**2*$headStart**2-$distance**2; + $discriminant = $b**2-4*$a*$c; + + $ans = (-$b+sqrt($discriminant))/(2*$a); + $car1Distance = $car1Speed*($headStart+$ans); + $car2Distance = $car2Speed*$ans; + $rightEnd = 3+$car2Distance/$car1Distance*14; +} until ( ($discriminant>0) && ($rightEnd<19) ); + +$xmin = 2; #The viewing window +$xmax = 20; +$ymin = 1.5; +$ymax = 19.5; + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$picture->moveTo(4,3); +$picture->lineTo(4,17,blue,3); +$picture->lineTo($rightEnd,3,blue,3); +$picture->lineTo(4,3,blue,3); + +$picture->moveTo(4,3.5); +$picture->lineTo(4.5,3.5,blue,1); +$picture->lineTo(4.5,3,blue,1); + +$picture->moveTo(15,15); +$picture->arrowTo(15,18,black,2); +$picture->moveTo(15,15); +$picture->arrowTo(15,12,black,2); +$picture->moveTo(15,15); +$picture->arrowTo(18,15,black,2); +$picture->moveTo(15,15); +$picture->arrowTo(12,15,black,2); + +$picture->lb( new Label(15,18.5,"North",'black','center','middle')); +$picture->lb( new Label(15,11.5,"South",'black','center','middle')); +$picture->lb( new Label(19,15,"East",'black','center','middle')); +$picture->lb( new Label(11,15,"West",'black','center','middle')); + +$picture->lb( new Label(3.7,3,"Town",'blue','right','middle','large')); +$picture->lb( new Label(4,17,"1st Car",'blue','center','bottom','large')); +$picture->lb( new Label(4,10,"distance traveled",'blue','center','bottom','large','vertical')); +$picture->lb( new Label(4,10,"by the 1st car",'blue','center','top','large','vertical')); +$picture->lb( new Label(($rightEnd+4)/2,3,"distance",'blue','center','bottom','large')); +$picture->lb( new Label(($rightEnd+4)/2,3,"travaled by",'blue','center','top','large')); +$picture->lb( new Label(($rightEnd+4)/2,2.4,"the 2nd car",'blue','center','top','large')); +$picture->lb( new Label($rightEnd+0.5,3,"2nd Car",'blue','left','middle','large')); +$picture->lb( new Label(($rightEnd+4)/2,10.5,"distance between",'blue','left','middle','large')); +$picture->lb( new Label(($rightEnd+4)/2+0.5,10,"two cars",'blue','left','middle','large')); +$picture->stamps( closed_circle(4,3,'blue') ); +$picture->stamps( closed_circle(4,17,'blue') ); +$picture->stamps( closed_circle($rightEnd,3,'blue') ); + +$alt = "This graph has 4-way direction arrows pointing at north, south, west and east. There is a blue right triangle. The vertex with the right angle is labeled as Town. One leg goes up and ends at a point labeled as the 1st Car; the leg is labeled as the travel distance of the first car. One leg goes to the right and ends at a point labeled as the 2nd car; the leg is labeled as the travel distance of the second car. The hypotenuse of the triangle is labeled as the distance between two cars."; + +############################################## + +BEGIN_PGML + +One car started at Town A, and traveled due north at [`[$car1Speed]`] miles per hour. [`[$headStart]`] hours later, another car started at the same spot and traveled due east at [`[$car2Speed]`] miles per hour. Assume both cars don't stop, after how many hours since the second car starts would the distance between them be [`[$distance]`] miles? Round your answer to two decimal places if needed. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>400, height=>400, tex_size=>400, extra_html_tags=>"alt = '$alt' title = '$alt'") @]*<< + +Approximately [___________]{$ans} hours since the second car starts, the distance between those two cars would be [`[$distance]`] miles. + +END_PGML + +############################################## + +$s1 = sqrt($discriminant); +$ansShow = int($ans*100+0.5)/100; + +BEGIN_PGML_SOLUTION + +Assume [`t`] hours since the second car started, those two cars' distance would be [`[$distance]`] miles. During this time, the second car traveled [`[$car2Speed]t`] miles. Since the first car traveled [`[$headStart]`] more hours, the first car traveled [`[$car1Speed](t+[$headStart])`] miles. + +By the graph, we can use Pythagorean Theorem to set up the equation: + + [`` [[$car1Speed](t+[$headStart])]^2+([$car2Speed]t)^2=[$distance]^2 ``] + +This is a quadratic equation. We will change it to the standard form: + + [`` +\begin{aligned}[t] + [[$car1Speed](t+[$headStart])]^2+([$car2Speed]t)^2 &= [$distance]^2 \\ + [$car1Speed]^2(t+[$headStart])^2+[$car2Speed]^2t^2 &= [$distance]^2 \\ + [$car1Speed**2](t^2+[$headStart*2]t+[$headStart**2])+[$car2Speed**2]t^2 &= [$distance**2] \\ + [$car1Speed**2]t^2+[$headStart*2*$car1Speed**2]t+[$headStart**2*$car1Speed**2]+[$car2Speed**2]t^2 &= [$distance**2] \\ + [$car1Speed**2+$car2Speed**2]t^2+[$headStart*2*$car1Speed**2]t+[$headStart**2*$car1Speed**2] &= [$distance**2] \\ + [$car1Speed**2+$car2Speed**2]t^2+[$headStart*2*$car1Speed**2]t+[$headStart**2*$car1Speed**2] \mathbf{{}-[$distance**2]} &= [$distance**2] \mathbf{{}-[$distance**2]} \\ + [$car1Speed**2+$car2Speed**2]t^2+[$headStart*2*$car1Speed**2]t+[$headStart**2*$car1Speed**2-$distance**2] &= 0 +\end{aligned} + ``] + +We will solve the equation by the Quadratic Formula. Identify that [`a=[$a],b=[$b],c=[$c]`]. + + [`` +\begin{aligned}[t] + x &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + x &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$c])}}{2([$a])} \\ + x &= \frac{[$b*-1] \pm \sqrt{[$discriminant]}}{[$a*2]} \\ + x &\approx \frac{[$b*-1] \pm [$s1]}{[$a*2]} \\ + x&\approx\frac{[$b*-1] + [$s1]}{[$a*2]} \text{ or } x\approx \frac{[$b*-1] - [$s1]}{[$a*2]} \\ + x&\approx[$ans] \text{ or } x= \text{a negative number} +\end{aligned} + ``] + +Approximately [`[$ansShow]`] hours since the second car starts, the distance between those two cars would be [`[$distance]`] miles. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication80.pg new file mode 100644 index 0000000000..8a083156bc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication80.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Falling object problem. Quadratic formula is needed. +# +# Last edit by: Carl Yao 12/11/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','equation','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + do { + $initialHeight = random(200,400,10); + $initialSpeed = random(50,100,10); + $height = random($initialHeight+10,$initialHeight+50,10); + $a = -4.9; + $b = $initialSpeed; + $c = $initialHeight-$height; + $discriminant = $b**2-4*$a*$c; + } until ($discriminant>0); + $ans1 = (-$b+sqrt($discriminant))/(2*$a); + $ans2 = (-$b-sqrt($discriminant))/(2*$a); +} until ($ans1>0); + + + + +############################################## + +BEGIN_PGML + +An object is launched upward at the height of [`[$initialHeight]`] meters. Its height can be modeled by [```h=-4.9t^2+[$initialSpeed]t+[$initialHeight]```], where [`h`] stands for the object's height in meters, and [`t`] stands for time passed in seconds since its launch. The object's height will be [`[$height]`] meters twice before it hits the ground. Find how many seconds since the launch would the object's height be [`[$height]`] meters. Round your answers to two decimal places if needed. + +The object's height would be [`[$height]`] meters the first time at [____________]{$ans1} seconds, and then the second time at [____________]{$ans2} seconds. + +END_PGML + +############################################## + +$s1 = sqrt($discriminant); +$ans1Show = int($ans1*100+0.5)/100; +$ans2Show = int($ans2*100+0.5)/100; + +BEGIN_PGML_SOLUTION + +When the object's height is [`[$height]`] meters, the equation becomes + + [`` [$height]=-4.9t^2+[$initialSpeed]t+[$initialHeight] ``] + +We will change the equation to standard form: + + [`` 0=-4.9t^2+[$initialSpeed]t+[$initialHeight-$height] ``] + +Next, we can solve this quadratic equation with the Quadratic Formula. Identify that [`a=[$a],b=[$b],c=[$c]`]. + + [`` +\begin{aligned}[t] + x &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + x &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$c])}}{2([$a])} \\ + x &= \frac{[$b*-1] \pm \sqrt{[$discriminant]}}{[$a*2]} \\ + x &\approx \frac{[$b*-1] \pm [$s1]}{[$a*2]} \\ + x&\approx\frac{[$b*-1] + [$s1]}{[$a*2]} \text{ or } x\approx \frac{[$b*-1] - [$s1]}{[$a*2]} \\ + x&\approx[$ans1Show] \text{ or } x\approx[$ans2Show] +\end{aligned} + ``] + +The object's height would be [`[$height]`] meters the first time at [`[$ans1Show]`] seconds, and then the second time at [`[$ans2Show]`] seconds. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication90.pg new file mode 100644 index 0000000000..daa44b7d8a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication90.pg @@ -0,0 +1,129 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use a quadratic function to model profit. Quadratic formula is needed. +# +# Last edit by: Carl Yao 12/11/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','equation','application') +## DBCCSS('F.IF.7.a','F.IF.4','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Currency"); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + + +do { + $initialAmount = random(200,300,10); + $initialPrice = random(50,150,10); + $raise = random(5,20,5); + do {$numLoss = random(5,20,5);} until ($initialAmount-$numLoss*10>0); + $a = -$numLoss*$raise; + $b = $raise*$initialAmount-$numLoss*$initialPrice; + $maxX = -$b/(2*$a); + $x1 = random(1,int($maxX-1),1); + $x2 = 2*$maxX-$x1; +} until ( ($maxX>5) && (int($x2)==$x2) ); + +$newIncome = ($initialPrice+$raise*$x1)*($initialAmount-$numLoss*$x1); +$c = $initialPrice*$initialAmount-$newIncome; +$discriminant = $b**2-4*$a*$c; + +$ans1 = $initialPrice+$raise*$x1; +$ans2 = $initialPrice+$raise*$x2; + +$initialPriceC = Currency($initialPrice); +$raiseC = Currency($raise); +$newIncomeC = Currency($newIncome); +$ans1C = Currency($ans1); +$ans2C = Currency($ans2); + +############################################## + +BEGIN_PGML + +Currently, an artist can sell [`[$initialAmount]`] paintings every year at the price of [`[$initialPriceC]`] per painting. Each time he raises the price per painting by [`[$raiseC]`], he sells [`[$numLoss]`] fewer paintings every year. + +Assume he will raise the price per painting [`x`] times, then he will sell [`[$initialAmount]-[$numLoss]x`] paintings every year at the price of [`[$initialPrice]+[$raise]x`] dollars. His yearly income can be modeled by the equation: [``` i=([$initialPrice]+[$raise]x)([$initialAmount]-[$numLoss]x) ```] where [`i`] stands for his yearly income in dollars. If the artist wants to earn [`[$newIncomeC]`] per year from selling paintings, what new price should he set? + +To earn [`[$newIncomeC]`] per year, the artist could sell his paintings at two different prices. The lower price is [___________]{$ans1C} per painting, and the higher price is [___________]{$ans2C} per painting. + +END_PGML + +############################################## + +$s1 = sqrt($discriminant); + +BEGIN_PGML_SOLUTION + +If the artist wants to make [`[$newIncomeC]`] per year, the equation becomes: + + [`` [$newIncome]=([$initialPrice]+[$raise]x)([$initialAmount]-[$numLoss]x) ``] + +We will change the equation to standard form: + + [`` +\begin{aligned}[t] + [$newIncome] &= ([$initialPrice]+[$raise]x)([$initialAmount]-[$numLoss]x) \\ + [$newIncome] &= [$initialPrice*$initialAmount]-[$initialPrice*$numLoss]x+[$raise*$initialAmount]x-[$raise*$numLoss]x^2 \\ + [$newIncome] &= -[$raise*$numLoss]x^2+[$raise*$initialAmount-$initialPrice*$numLoss]x+[$initialPrice*$initialAmount] \\ + 0 &= -[$raise*$numLoss]x^2+[$raise*$initialAmount-$initialPrice*$numLoss]x+[$initialPrice*$initialAmount-$newIncome] \\ +\end{aligned} + ``] + +Next, we can solve this quadratic equation with the Quadratic Formula. Identify that [`a=[$a],b=[$b],c=[$c]`]. + + [`` +\begin{aligned}[t] + x &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + x &= \frac{-([$b]) \pm \sqrt{([$b])^{2}-4([$a])([$c])}}{2([$a])} \\ + x &= \frac{[$b*-1] \pm \sqrt{[$discriminant]}}{[$a*2]} \\ + x &= \frac{[$b*-1] \pm [$s1]}{[$a*2]} \\ + x&=\frac{[$b*-1] + [$s1]}{[$a*2]} \text{ or } x=\frac{[$b*-1] - [$s1]}{[$a*2]} \\ + x&=[$x1] \text{ or } x=[$x2] +\end{aligned} + ``] + +If the artist raises the price [`[$x1]`] times, the new price would be [`[$initialPrice]+[$raise]\cdot[$x1]=[$ans1]`] dollars per painting. + +If the artist raises the price [`[$x2]`] times, the new price would be [`[$initialPrice]+[$raise]\cdot[$x2]=[$ans2]`] dollars per painting. + +To earn [`[$newIncomeC]`] per year, the artist could sell his paintings at two different prices. The lower price is [`[$ans1C]`] per painting, and the higher price is [`[$ans2C]`] dollars per painting. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad100.pg new file mode 100644 index 0000000000..6cffda2a48 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad100.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# x^2 + (a+b)x + ab = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a, b are non_zero integer on [-10,10], and a+b != 0 +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#Context()->variables->are($var=>'Real'); +$a = non_zero_random(-12,12,1); +$b = $a; +$b = non_zero_random(-12,12,1) while($b==$a or $b==-$a); +$soln1 = $a*-1; +$soln2 = $b*-1; + +$aPlusB = $a+$b; +$ab = $a*$b; +$question = Formula("$var**2+$aPlusB*$var+$ab")->reduce; + +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question]= 0 `] + + [__________________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to *factor* and then use the _zero product principle_. + + [` + \begin{aligned} + [$question]= 0 &\Rightarrow ([$var]+[$a])([$var]+[$b]) = 0 \\ + & \Rightarrow [$var]+[$a]=0 \text{ or } [$var]+[$b]=0\\ + & \Rightarrow [$var]=[$a*-1]\text{ or } [$var]=[$b*-1]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad105.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad105.pg new file mode 100644 index 0000000000..504da41319 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad105.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# x^2 + (a+b)x + ab + $c = $c +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a, b are non_zero integer on [-10,10], and a+b != 0 +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#Context()->variables->are($var=>'Real'); +$a = non_zero_random(-12,12,1); +$b = $a; +$b = non_zero_random(-12,12,1) while($b==$a or $b==-$a); +$c = -$a*$b; +$c = non_zero_random(-20,20,1) while($c==-$a*$b); +$soln1 = $a*-1; +$soln2 = $b*-1; +$ans = List(Formula("$var=$soln1"),Formula("$var=$soln2")); + +$aPlusB = $a+$b; +$abPlusC = $a*$b+$c; +$ab = $a*$b; +$question = Formula("$var**2+$aPlusB*$var+$abPlusC")->reduce; +$question1 = Formula("$var**2+$aPlusB*$var+$ab")->reduce; + +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question]= [$c] `] + + [__________________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; + + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- one way to solve this particular +type of problem is to *factor* and then use the _zero product principle_. The first step +is to make sure that one of the sides of the equation is equal to [`0`] + + [` + \begin{aligned} + [$question]= [$c]&\Rightarrow [$question1]= 0 \\ + &\Rightarrow ([$var]+[$a])([$var]+[$b]) = 0 \\ + & \Rightarrow [$var]+[$a]=0 \text{ or } [$var]+[$b]=0\\ + & \Rightarrow [$var]=[$a*-1]\text{ or } [$var]=[$b*-1]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad110.pg new file mode 100644 index 0000000000..f13149d997 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad110.pg @@ -0,0 +1,165 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Use the Pythagorean Theorem to find the missing side for the +# triangle given in the figure below. +# +# | +# c / | +# / | a +# --- +# b +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# We use Pythagorean triples so that everything works out +# integer. +# +# a = m^2-n^2, b = 2mn, c = m^2+n^2 +# +# We choose m and n so that m!=n which means that m-n>0. +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','application') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "parserNumberWithUnits.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +#parser::Assignment->Allow; +$m = 1; $n = 1; +while($m <= $n) +{ + $m = random(2,10,1); + $n = random(2,10,1); +} +$a = $m**2-$n**2; +$b = 2*$m*$n; +$c = $m**2+$n**2; + +$side1 = NumberWithUnits($a, "m"); +$side2 = NumberWithUnits($b, "m"); + +$ans = NumberWithUnits("$c", "m"); + +$triangle = init_graph(-0.7,-0.8,0.7,0.8,size=>[400,200]); +$triangle -> lb('reset'); + +# the labels +$triangle -> lb(new Label ( 0,-0.6,$side2->string,'black','center','middle')); +$triangle -> lb(new Label ( -0.6,0,$side1->string,'black','center','middle')); + +$triangle->new_color("darkblue",100,100,255); + +# draw the sides of the triangle +$triangle->moveTo(-0.5,-0.5); +$triangle->lineTo(0.5,-0.5,"darkblue",3); +$triangle->lineTo(-0.5,0.5,"darkblue",3); +$triangle->lineTo(-0.5,-0.5,"darkblue",3); + +# draw the right angle +$triangle->moveTo(-0.45,-0.5); +$triangle->lineTo(-0.45,-0.5+0.1,"darkblue",1); +$triangle->lineTo(-0.5,-0.5+0.1,"darkblue",1); + +############################################## + + +TEXT(beginproblem()); +BEGIN_TEXT +Use the Pythagorean Theorem to find the missing side for the +right-angled triangle given in the figure below. It has base \($side2\) and +height \($side1\). +$PAR + +\{EnlargeImageStatement()\} +$PAR + +$BCENTER \{image(insertGraph($triangle), width=>400, height=>200, tex_size=>400, +extra_html_tags=>'alt="A right triangle with base $a m and height $b m." title="A right triangle with base $a m and height $b m."')\} +$ECENTER +$PAR + +END_TEXT + +BEGIN_PGML +* If you need to use the square root symbol, +as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +* Units need to be entered using their standard abbreviations, without a period. +For example, type *m* for meters, *m^2* for square meters, etc. + + [____________________] +END_PGML + +ANS( $ans-> cmp( checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + + $student = $ans->{original_student_ans}; + $correct = ($ans->{correct_ans}) ? $ans->{correct_ans} : $ans->{correct_value}; + + Context()->flags->set(setSqrt=>exp(1)/ln(2)); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + }, formatStudentAnswer=>"reduced" + ) +); + + +############################################## + +BEGIN_PGML_SOLUTION +The Pythagorean Theorem says that for a triangle that has sides [`a`], [`b`], and hypotenuse [`c`] then + + [`` + c^2 = a^2+b^2 + ``] + +From the picture and given information, we know that [`a=[$a]`] and [`b=[$b]`], so + + [` + \begin{aligned} + c^2 = [$a]^2+[$b]^2 & \Rightarrow c = \sqrt{[$a**2]+[$b**2]}\\ + & \Rightarrow c = [$c] + \end{aligned} + `] + +We conclude that the hypotenuse is [`[$ans]`]. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad115.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad115.pg new file mode 100644 index 0000000000..428b736504 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad115.pg @@ -0,0 +1,129 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (x+c)^2 = a^2 b +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,4], b is integer on [3,10], +# c is non-zero integer on [-10,10] +# +# Last updated: Hughes 8/6/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','add','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + $a = list_random(2,3,5,7); + $b = list_random(2,3,5,7); +} until ($a!=$b); + +$c = non_zero_random(-10,10,1); +$d = -$c; +$ans = List(Formula("$var=$d+$a sqrt($b)"),Formula("$var=$d-$a sqrt($b)")); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$d+$a sqrt($b),$d-$a sqrt($b)}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` ([$var]+[$c])^2 = [$a**2 * $b] `] + + [_______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; + +############################################## + +$s1 = ($a>$b) ? "$b\cdot$a^2" : "$a^2\cdot$b"; + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular type of problem is to use the _square root method_. + + [`` + \begin{aligned} + ([$var]+[$c])^2 &= [$a**2 * $b] \\ + \sqrt{([$var]+[$c])^2} &= \pm\sqrt{[$a**2 * $b]} \\ + [$var]+[$c] &= \pm\sqrt{[$s1]} \\ + [$var]+[$c] &= \pm[$a]\sqrt{[$b]} \\ + [$var] &= [$c*-1]\pm[$a]\sqrt{[$b]} \\ + [$var]&=[$c*-1]+[$a]\sqrt{[$b]}\text{ or } [$var]=[$c*-1]-[$a]\sqrt{[$b]}\\ + \end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad116.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad116.pg new file mode 100644 index 0000000000..028c4d2f5c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad116.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (x+c)^2 = a^2 b +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,4], b is integer on [3,10], +# c is non-zero integer on [-10,10] +# +# Last updated: Yao 12/8/2016 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','add','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + $a = list_random(2,3,5,7); + $b = list_random(2,3,5,7); +} until ($a!=$b); + +$c = non_zero_random(-10,10,1); +$d = -$c; +$e = $a**2 * $b; +$f = non_zero_random(-10,10,1); +$ans = Formula("{$d+$a sqrt($b),$d-$a sqrt($b)}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$f] = [$e+$f] - ([$var]+[$c])^2 `] + + [_______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + +$s1 = ($a>$b) ? "$b\cdot$a^2" : "$a^2\cdot$b"; + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular type of problem is to use the _square root method_. + + [`` + \begin{aligned} + [$f] &= [$e+$f] - ([$var]+[$c])^2 \\ + [$f] \mathbf{{}-[$e+$f]} &= [$e+$f] - ([$var]+[$c])^2 \mathbf{{}-[$e+$f]} \\ + [$e*-1] &= - ([$var]+[$c])^2 \\ + (-1)\cdot ([$e*-1]) &= (-1)\cdot[- ([$var]+[$c])^2] \\ + [$e] &= ([$var]+[$c])^2 \\ + \pm\sqrt{[$e]} &= \sqrt{([$var]+[$c])^2} \\ + \pm\sqrt{[$s1]} &= [$var]+[$c] \\ + \pm[$a]\sqrt{[$b]} &= [$var]+[$c] \\ + [$c*-1]\pm[$a]\sqrt{[$b]} &= [$var] \\ + [$var]&=[$c*-1]+[$a]\sqrt{[$b]}\text{ or } [$var]=[$c*-1]-[$a]\sqrt{[$b]}\\ + \end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad120.pg new file mode 100644 index 0000000000..3439f5a5e5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad120.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (x+a)^2 = * b^2 +# +# except we give the question to the student +# in the form +# +# x^2 + 2ax + a^2 = b^2 +# +# so that they have to factor it first. +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is non-zero integer on [-10,10], +# b is integer on [2,12] +# +# Last updated: Hughes, 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','add','subtract','factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#Context()->variables->are($var=>'Real'); +$a = non_zero_random(-10,10,1); +$b = random(2,12,1); +$soln1 = $b-$a; +$soln2 = -$b-$a; +$ans = List(Formula("$var=$soln1"),Formula("$var=$soln2")); + +$questionFormula = Formula("$var^2+2*$a*$var+($a)**2")->reduce->reduce; +$c = $a**2-$b**2; +$questionFormula1 = Formula("$var^2+2*$a*$var+$c")->reduce; +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula] = [$b**2] `] + + [__________________________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +BEGIN_PGML_SOLUTION +This equation can be solved in a few different ways. + +#### Factoring combined with the square root method + +Let's factor the left hand side and then use the square root property: + + [` + \begin{aligned} + [$questionFormula] = [$b**2]&\Rightarrow \left([$var]+[$a]\right)^2 = [$b**2]\\ + & \Rightarrow [$var]+[$a] = [$b]\text{ or } [$var]=[$b*-1]\\ + & \Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2] + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +#### Set one side to zero and then factor + +If we subtract [`[$b**2]`] from both sides then we obtain + + [` [$questionFormula1 ]=0`] + +which can be factored to give [`[$var]=[$soln1]\text{ or } [$var]=[$soln2]`] as before. + +Note that you could arrive at the same solutions by using the Quadratic Formula (don't worry if you haven't +covered this yet). + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad125.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad125.pg new file mode 100644 index 0000000000..2085bd2a3c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad125.pg @@ -0,0 +1,158 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (x + b)^2 = a +# +# but we give the question to the student +# in the form +# +# x^2 + 2bx + b^2 = a +# +# so that they have to factor it first, or else +# use the quadratic formula. +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is prime, +# +# b is non-zero integer on [-10,10] and b!=a +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','prime','add','subtract','factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); +Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +@primes = (2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67); +$index1 = random(0,$#primes,1); + +# choose $a and $b +$a = $primes[$index1]; +$b = $a; +$b = non_zero_random(-10,10,1) while($b==$a); + +$c = -$b; +# the answer +$ans = List(Formula("$var=$c+sqrt($a)"), Formula("$var=$c-sqrt($a)")); + +$c1 = 2*$b; +$questionFormula = Formula("$var^2+$c1*$var+($b)**2")->reduce; +$c = $b**2-$a; +$questionFormula1 = Formula("$var^2+$c1*$var+$c")->reduce; +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]= [$a]`] + + [_______________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + + +############################################## + +BEGIN_PGML_SOLUTION +This equation can be solved in a few different ways. + +#### Factoring combined with the square root method + +Let's factor the left hand side and then use the square root property: + + [` + \begin{aligned} + [$questionFormula]= [$a] & \Rightarrow ([$var]+[$b])^2 = [$a] \\ + & \Rightarrow [$var]+[$b]=-\sqrt{[$a]}\text{ or }[$var]+[$b]=\sqrt{[$a]}\\ + & \Rightarrow [$var]= [$b*-1]-\sqrt{[$a]}\text{ or }[$var]=[$b*-1]+\sqrt{[$a]} + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +#### Use the Quadratic Formula + +If we subtract [`[$a]`] from both sides then we obtain + + [` [$questionFormula1 ]=0`] + +We can now use theQuadratic Formula (don't worry if you haven't +covered this yet) + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$c1*-1]\pm\sqrt{[$c1**2]-[$c*4]}}{2}\\ + & = \frac{[$c1*-1]\pm\sqrt{[$c1**2-$c*4]}}{2}\\ + \end{aligned} + `] + +so [`[$var]= [$b*-1]-\sqrt{[$a]}\text{ or }[$var]=[$b*-1]+\sqrt{[$a]}`] as before. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad130.pg new file mode 100644 index 0000000000..79ee6eb8ff --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad130.pg @@ -0,0 +1,155 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (x+c)^2 = a^2 b +# +# but we give it to the student in the form +# +# x^2 + 2cx + c^2 = a^2 b +# +# so that they have to factor it first, or else +# use the quadratic formula. +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,4], b is integer on [3,10], +# c is non-zero integer on [-10,10] +# +# Last updated: Hughes 8/6/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','factor','add','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#$var = RandomVariableName(type=>'variable'); +#Context()->variables->are($var=>'Real'); +$a = random(2,4,1); +$b=9; +$b = random(3,11,2) while($b==9); +$c = non_zero_random(-10,10,1); +$d = -$c; +$ans = List(Formula("$var=$d+$a sqrt($b)"),Formula("$var=$d-$a sqrt($b)")); + +$B = 2*$c; +$C = $c**2; +$questionFormula = Formula("$var^2+$B*$var+$C")->reduce; +$C1 = $c**2-$b*($a**2); +$questionFormula1 = Formula("$var^2+$B*$var+$C1")->reduce; +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]= [$a**2 * $b] `] + + [_______________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve this equation. + +#### Factoring combined with the square root method + +Let's factor the left hand side and then use the square root property: + + [` + \begin{aligned} + [$questionFormula]= [$a**2 * $b]& \Rightarrow ([$var]+[$c])^2 = [$a**2 * $b] \\ + & \Rightarrow [$var]+[$c]=-\sqrt{[$a**2*$b]}\text{ or } [$var]+[$c]=\sqrt{[$a**2*$b]}\\ + & \Rightarrow [$var]= [$c*-1]-\sqrt{[$a**2]}\sqrt{[$b]}\text{ or } [$var]=[$c*-1]+\sqrt{[$a**2]}\sqrt{[$b]}\\ + & \Rightarrow [$var]=[$c*-1]+[$a*-1]\sqrt{[$b]}\text{ or } [$var]=[$c*-1]+[$a]\sqrt{[$b]} + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +#### The Quadratic Formula + +If we subtract [`[$b*$a**2]`] from both sides of the equation then we obtain + + [` [$questionFormula1 ]=0`] + +We can now use theQuadratic Formula (don't worry if you haven't +covered this yet) + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$B*-1]\pm\sqrt{[$B**2]-[$C1*4]}}{2}\\ + & = \frac{[$B*-1]\pm\sqrt{[$B**2-$C1*4]}}{2}\\ + \end{aligned} + `] + +so [`[$var]=[$c*-1]+[$a*-1]\sqrt{[$b]}\text{ or } [$var]=[$c*-1]+[$a]\sqrt{[$b]}`] as before. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad135.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad135.pg index 26b3f8f83f..6154ae7485 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad135.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad135.pg @@ -18,27 +18,25 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Cartesian coordinate system) -## DBsection(Midpoint and distance formulas) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Distance_only) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", - "PGML.pl", - "contextLimitedRadical.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -73,8 +71,7 @@ TEXT(beginproblem()); BEGIN_PGML Find the distance between the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. -If you need to use the square root symbol, -as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +[@KeyboardInstructions('If you need to use the square root symbol, as in [`x=\sqrt{17}`], type it like [|sqrt(17)|]*')@]** [____________________] END_PGML @@ -84,11 +81,10 @@ ANS( $ans-> cmp( checker => sub { return 0 if $ans->{isPreview} || $correct != $student; $student = $ans->{original_student_ans}; - $correct = $ans->{correct_ans}; + $correct = ($ans->{correct_ans}) ? $ans->{correct_ans} : $ans->{correct_value}; Context()->flags->set(setSqrt=>exp(1)/ln(2)); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = ($correct == $student); Context()->flags->set(setSqrt => 0); @@ -104,11 +100,12 @@ ANS( $ans-> cmp( checker => sub { $xdist = ($x2-$x1)**2; $ydist = ($y2-$y1)**2; BEGIN_PGML_SOLUTION -The distance between two points, [`d`], can be found by using the Pythagorean Theorem; +The distance between two points, [`d`], can be found by using the Distance Formula: [` \begin{aligned} - d& = \sqrt{([$x2]-[$x1])^2 + ([$y2]-[$y1])^2} \\ + d& = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2} \\ + & = \sqrt{([$x2]-[$x1])^2 + ([$y2]-[$y1])^2} \\ & = \sqrt{([$x2-$x1])^2 + ([$y2-$y1])^2} \\ & = \sqrt{[$xdist] + [$ydist]} \\ & = \sqrt{[$xdist + $ydist]} \\ diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad140.pg index f16d46b82f..5996ea0b01 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad140.pg @@ -14,27 +14,25 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Cartesian coordinate system) -## DBsection(Midpoint and distance formulas) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Distance_only) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", - "PGML.pl", - "contextLimitedRadical.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -45,48 +43,23 @@ Context()->flags->set( reduceConstantFunctions=>0, formatStudentAnswer=>parsed); -#@suitablePrimes = (5,13,17,29,37); -@suitablePrimes = (5,13); -$index = random(0,$#suitablePrimes,1); -$prime = $suitablePrimes[$index]; - -if($prime==5) -{ - # 5 = 1 + 4 - # = 1^2 + 2^2 - $m=1; - $n=2; -} -elsif($prime==13) -{ - # 13 = 9+4 - # = 3^2+2^2 - $m=2; - $n=3; -} -elsif($prime==17) -{ - # 17 = 1+16 - # = 1^2 + 4^2 - $m=1; - $n=4; -} -elsif($prime==29) -{ - $m=2; - $n=5; -} -elsif($prime==37) -{ - $m=1; - $n=6; -} - -$d = random(2,5,1); - -$a = $d*$m; -$b = $d*$n; -$c = $d*$prime; +@triples = ( + [2,4,"2\cdot2\cdot5",2,5], + [3,6,"3\cdot3\cdot5",3,5], + [5,10,"5\cdot5\cdot5",5,5], + [4,6,"2\cdot2\cdot13",2,13], + [6,9,"3\cdot3\cdot13",3,13], + [2,6,"2\cdot2\cdot2\cdot5",2,10], + [3,9,"2\cdot3\cdot3\cdot5",3,10], + [5,15,"2\cdot5\cdot5\cdot5",5,10], +); + +$index = random(0,7,1); +$a = $triples[$index][0]; +$b = $triples[$index][1]; +$primeList = $triples[$index][2]; +$outNum = $triples[$index][3]; +$inNum = $triples[$index][4]; # choose (x1,y1) first $x1 = random(-20,20,1); @@ -96,7 +69,7 @@ $y1 = random(-20,20,1); $x2 = $x1+$a; $y2 = $y1+$b; -$ans = Formula("$d sqrt($prime)"); +$ans = Formula("$outNum*sqrt($inNum)"); ############################################## @@ -104,8 +77,7 @@ TEXT(beginproblem()); BEGIN_PGML Find the distance between the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. -If you need to use the square root symbol, -as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +[@KeyboardInstructions('If you need to use the square root symbol, as in [`x=\sqrt{17}`], type it like [|sqrt(17)|]*')@]** [____________________] END_PGML @@ -115,11 +87,10 @@ ANS( $ans-> cmp( checker => sub { return 0 if $ans->{isPreview} || $correct != $student; $student = $ans->{original_student_ans}; - $correct = $ans->{correct_ans}; + $correct = ($ans->{correct_ans}) ? $ans->{correct_ans} : $ans->{correct_value}; Context()->flags->set(setSqrt=>exp(1)/ln(2)); - delete $correct->{test_values}; - delete $student->{test_values}; + delete $correct->{test_values}, $student->{test_values}; my $OK = ($correct == $student); Context()->flags->set(setSqrt => 0); @@ -135,19 +106,19 @@ ANS( $ans-> cmp( checker => sub { $xdist = ($x2-$x1)**2; $ydist = ($y2-$y1)**2; BEGIN_PGML_SOLUTION -The distance between two points, [`d`], can be found by using the Pythagorean Theorem; +The distance between two points, [`d`], can be found by using the Distance Formula: - [` + [`` \begin{aligned} - d& = \sqrt{([$x2]-[$x1])^2 + ([$y2]-[$y1])^2} \\ + d& = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2} \\ + & = \sqrt{([$x2]-[$x1])^2 + ([$y2]-[$y1])^2} \\ & = \sqrt{([$x2-$x1])^2 + ([$y2-$y1])^2} \\ & = \sqrt{[$xdist] + [$ydist]} \\ & = \sqrt{[$xdist + $ydist]} \\ - & = \sqrt{[$d**2]\cdot [$prime]}\\ - & = \sqrt{[$d**2]}\cdot \sqrt{[$prime]}\\ + & = \sqrt{[$primeList]} \\ & = [$ans] \end{aligned} - `] + ``] The distance between the two points is [`[$ans]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad145.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad145.pg new file mode 100644 index 0000000000..712e924867 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad145.pg @@ -0,0 +1,161 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the equation. +# +# a x^2 + bx + c = 0 +# +# a=1 in this problem. +# +# The solution is picked so that +# +# -B \pm \sqrt{C} +# x = ---------------- +# A +# +# B, C are used in helping us to get a, b, c in the quadratic equation +# +# We ensure that C is prime, B is odd, (B^2-C)%4=0 and b^2-4ac isn't too big. +# +# This works because the solutions above satisfy +# +# A^2 x^2 + 2 AB x + (B^2 -C) = 0 +# +# We choose A = 2 so that this equation becomes +# +# 4x^2 + 4Bx + (B^2-C) = 0 +# +# Provided that (B^2-C)%4=0 then we can divide the equation by 4 and +# get the desired solutions. +# +# Last updated: Hughes 8/8/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','quadratic formula','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +# a, b, c are used in a x^2 + bx + c = 0 +$a = 1; +$b = 2; +$c = 1; + +# The solution is picked so that +# +# -B \pm \sqrt{C} +# x = ---------------- +# A +# +# B, C are used in helping us to get a, b, c in the quadratic equation +# +# We want C to be prime +@primes = (2,3,5,7,11,13,17); +$index = random(0,$#primes,1); +$B = 4; +$C = $primes[$index]; + +while(($B**2-$C)%4 !=0 or ($b**2-4*$a*$c)==0 or (($b**2-4*$a*$c)>100)) +{ + $B = non_zero_random(-9,9,2); + $index = random(0,scalar(@primes),1); + $C = $primes[$index]; + $b = $B; + $c = ($B**2-$C)/4; +} +$questionFormula = Formula("$a*$var^2+$b*$var+$c")->reduce; +$b1 = $b*-1; +$discriminant = $b**2-4*$a*$c; +$a1 = 2*$a; +$ans = List(Formula("$var=($b1-sqrt($discriminant))/$a1"),Formula("$var=($b1+sqrt($discriminant))/$a1")); +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]= 0 `] + + [_____________________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, like [|x=1, x=-1|]*. Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve this equation- this equation does +not easily factor, so we will use the Quadratic Formula: + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2]-[$c*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2-$c*4]}}{[$a*2]}\\ + \end{aligned} + `] + +so [`[$var]=\frac{[$b*-1]-\sqrt{[$b**2-4*$a*$c]}}{[$a*2]}\text{ or }\frac{[$b*-1]+\sqrt{[$b**2-4*$a*$c]}}{[$a*2]}`]. + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad150.pg new file mode 100644 index 0000000000..b63b1f227a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad150.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the equation. +# +# a x^2 + bx + c = 0 +# +# We present it to the student in the form +# +# a x^2 = -bx -c +# +# so that they have to rearrange first. a=1 for this problem. +# +# The solution is picked so that +# +# -B \pm \sqrt{C} +# x = ---------------- +# A +# +# B, C are used in helping us to get a, b, c in the quadratic equation +# +# We ensure that C is prime, B is odd, (B^2-C)%4=0 and b^2-4ac isn't too big. +# +# This works because the solutions above satisfy +# +# A^2 x^2 + 2 AB x + (B^2 -C) = 0 +# +# We choose A = 2 so that this equation becomes +# +# 4x^2 + 4Bx + (B^2-C) = 0 +# +# Provided that (B^2-C)%4=0 then we can divide the equation by 4 and +# get the desired solutions. +# +# Last updated: Hughes 8/8/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'solve') +## KEYWORDS('solve','quadratic','equation','square root','quadratic formula','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +$var = "x"; +# a, b, c are used in a x^2 + bx + c = 0 +$a = 1; +$b = 2; +$c = 1; + +# The solution is picked so that +# +# -B \pm \sqrt{C} +# x = ---------------- +# A +# +# B, C are used in helping us to get a, b, c in the quadratic equation +# +# We want C to be prime +@primes = (2,3,5,7,11,13,17); +$index = random(0,$#primes,1); +$B = 4; +$C = $primes[$index]; + +while(($B%2)==0 or ($B**2-$C)%4 !=0 or ($b**2-4*$a*$c)==0 or (($b**2-4*$a*$c)>100)) +{ + $B = non_zero_random(-10,10,1); + $index = random(0,scalar(@primes),1); + $C = $primes[$index]; + $b = $B; + $c = ($B**2-$C)/4; +} +$questionFormula0 = Formula("$a*$var^2+$b*$var+$c")->reduce; +$questionFormula1 = Formula("$a*$var^2")->reduce; +$questionFormula2 = Formula("-$b*$var-$c")->reduce; +$b1 = $b*-1; +$discriminant = $b**2-4*$a*$c; +$a1 = 2*$a; +Context("FiniteSolutionSets"); +$ans = Formula("{($b1-sqrt($discriminant))/$a1,($b1+sqrt($discriminant))/$a1}"); +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula1]= [$questionFormula2] `] + + [_____________________________]{$ans} + +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML_SOLUTION +The first step we need to take is to set one side of the equation equal to zero; we subtract +[`[$questionFormula2]`] from both sides and obtain + + [` + [$questionFormula0 ] =0 + `] + +There are a few ways to solve this equation- this equation does +not easily factor, so we will use the Quadratic Formula: + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2]-[$c*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2-$c*4]}}{[$a*2]}\\ + \end{aligned} + `] + +so [`[$var]=\frac{[$b*-1]-\sqrt{[$b**2-4*$a*$c]}}{[$a*2]}\text{ or }\frac{[$b*-1]+\sqrt{[$b**2-4*$a*$c]}}{[$a*2]}`]. + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad155.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad155.pg new file mode 100644 index 0000000000..b1601bca88 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad155.pg @@ -0,0 +1,165 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the equation. +# +# a x^2 + bx + c = 0 +# +# a=1 in this problem. +# +# The solution is picked so that +# +# -B \pm D \sqrt{C} +# x = ---------------- +# A +# +# B, C are used in helping us to get a, b, c in the quadratic equation +# +# We ensure that C is prime, B is odd, (B^2-C)%4=0 and b^2-4ac isn't too big. +# +# D is randomly chosen from (3,5,7). +# +# This works because the solutions above satisfy +# +# A^2 x^2 + 2 AB x + (B^2 -D^2 C) = 0 +# +# We choose A = 2 so that this equation becomes +# +# 4x^2 + 4Bx + (B^2-D^2 C) = 0 +# +# Provided that (B^2-C)%4=0 then we can divide the equation by 4 and +# get the desired solutions. +# +# Last updated: Hughes 8/8/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','quadratic formula','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +$var = "x"; +# a, b, c are used in a x^2 + bx + c = 0 +$a = 1; +$b = 2; +$c = 1; + +# The solution is picked so that +# +# -B \pm D \sqrt{C} +# x = ---------------- +# A +# +# B, C are used in helping us to get a, b, c in the quadratic equation +# +# We want C to be prime, and D is randomly chosen from (3,5,7). +@primes = (2,3,5,7,11,13,17); +$index = random(0,$#primes,1); +$B = 4; +$C = $primes[$index]; +$D = 3; + +while(($B**2-$D**2*$C)%4 !=0 or ($b**2-4*$a*$c)==0 or (($b**2-4*$a*$c)>100)) +{ + $B = non_zero_random(-10,10,1); + #$B = non_zero_random(-9,9,2); + if(2*round($B/2)==$B) + { + # $B is even, so choose $D to be even + $D = random(2,6,2); + } + else + { + # $B is odd, so choose $D to be odd + $D = random(3,7,2); + } + + $index = random(0,scalar(@primes),1); + $C = $primes[$index]; + $b = $B; + $c = ($B**2-$D**2*$C)/4; +} +$questionFormula = Formula("$a*$var^2+$b*$var+$c")->reduce; +$b1 = $b*-1; +$a1 = 2*$a; + +Context("FiniteSolutionSets"); +if($B==2*round($B/2)) +{ + # B is even + $b1 /= 2; + $d1 = $D/2; + # this check shouldn't really be necessary, but reduce seems to go too far + if($d1==1) + { + $ans = Formula("{$b1-sqrt($C),$b1+sqrt($C)}"); + } + else + { + $ans = Formula("{$b1-$d1*sqrt($C),$b1+$d1*sqrt($C)}"); + } +} +else +{ + # B is odd + $ans = Formula("{($b1-$D*sqrt($C))/$a1,($b1+$D*sqrt($C))/$a1}"); +} +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]= 0 `] + + [_____________________________]{$ans} + +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## +BEGIN_PGML_SOLUTION +There are a few ways to solve this equation- this equation does +not easily factor, so we will use the Quadratic Formula: + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2]-[$c*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2-$c*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm[$D]\sqrt{[$C]}}{[$a*2]}\\ + \end{aligned} + `] + +So [`[$ans]`]. + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad160.pg new file mode 100644 index 0000000000..c488994698 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad160.pg @@ -0,0 +1,200 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the equation. +# +# a x^2 + bx + c = 0 +# +# a=1 in this problem. +# +# The solution is picked so that +# +# -B \pm D \sqrt{C} +# x = ---------------- +# A +# +# B, C are used in helping us to get a, b, c in the quadratic equation +# +# We ensure that C is prime, B is odd, (B^2-C)%4=0 and b^2-4ac isn't too big. +# +# D is randomly chosen from (3,5,7). +# +# This works because the solutions above satisfy +# +# A^2 x^2 + 2 AB x + (B^2 -D^2 C) = 0 +# +# We choose A = 2 so that this equation becomes +# +# 4x^2 + 4Bx + (B^2-D^2 C) = 0 +# +# Provided that (B^2-C)%4=0 then we can divide the equation by 4 and +# get the desired solutions. +# +# Last updated: Hughes 8/8/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','quadratic formula','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +# a, b, c are used in a x^2 + bx + c = 0 +$a = 1; +$b = 2; +$c = 1; + +# The solution is picked so that +# +# -B \pm D \sqrt{C} +# x = ---------------- +# A +# +# B, C are used in helping us to get a, b, c in the quadratic equation +# +# We want C to be prime, and D is randomly chosen from (3,5,7). +@primes = (2,3,5,7,11,13,17); +$index = random(0,$#primes,1); +$B = 4; +$C = $primes[$index]; +$D = 3; + +while(($B**2-$D**2*$C)%4 !=0 or ($b**2-4*$a*$c)==0 or (($b**2-4*$a*$c)>100)) +{ + #$B = non_zero_random(-10,10,1); + $B = non_zero_random(-9,9,2); + if(2*round($B/2)==$B) + { + # $B is even, so choose $D to be even + $D = random(2,6,2); + } + else + { + # $B is odd, so choose $D to be odd + $D = random(3,7,2); + } + + $index = random(0,scalar(@primes),1); + $C = $primes[$index]; + $b = $B; + $c = ($B**2-$D**2*$C)/4; +} +$questionFormula = Formula("$a*$var^2+$b*$var+$c")->reduce; +$b1 = $b*-1; +$a1 = 2*$a; + +Context("FiniteSolutionSets"); + +if($B==2*round($B/2)) +{ + # B is even + $b1 /= 2; + $d1 = $D/2; + # this check shouldn't really be necessary, but reduce seems to go too far + if($d1==1) + { + $ans = Formula("{$b1-sqrt($C),$b1+sqrt($C)}"); + } + else + { + $ans = Formula("{$b1-$d1*sqrt($C),$b1+$d1*sqrt($C)}"); + } +} +else +{ + # B is odd + $ans = List(Formula("$var=($b1-$D*sqrt($C))/$a1"),Formula("$var=($b1+$D*sqrt($C))/$a1")); + $ans = Formula("{($b1-$D*sqrt($C))/$a1,($b1+$D*sqrt($C))/$a1}"); +} +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]= 0 `] + + [_____________________________]{$ans} + +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** + + + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; + +############################################## +BEGIN_PGML_SOLUTION +This equation does +not easily factor, so we will use the Quadratic Formula: + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2]-[$c*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2-$c*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm[$D]\sqrt{[$C]}}{[$a*2]}\\ + \end{aligned} + `] + +So [`[$ans]`]. + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad165.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad165.pg new file mode 100644 index 0000000000..e5338cce61 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad165.pg @@ -0,0 +1,142 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (ax+b)(cx+d)=0 +# +# Last updated: Hughes 8/8/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','fraction') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$var = "x"; +$a=2; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1 or (abs($a*$c)+abs($b*$c+$a*$d)+abs($b*$d))>100) +{ + $a = random(2,10,1); + $b = non_zero_random(-10,10,1); + $c = random(2,10,1); + $d = non_zero_random(-10,10,1); +} + +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$frac1 = Fraction(-$b,$a); +$frac2 = Fraction(-$d,$c); +$ans = Compute("$var = $frac1, $var = $frac2"); + +Context("FiniteSolutionSets"); +$ans = Formula("{$frac1,$frac2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]=0`] + + [__________________________]{$ans} + +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** + + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +We can solve this equation either by _factoring_ or by using the _quadratic formula_. +We will demonstrate both. + +#### Factoring + + [` + \begin{aligned} + [$questionFormula]=0 &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + +#### The Quadratic Formula + +We can also solve the equation using the quadratic formula + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$B*-1]\pm\sqrt{[$B**2]-[$A*$C*4]}}{[$A*2]}\\ + & = \frac{[$B*-1]\pm\sqrt{[$B**2-$A*$C*4]}}{[$A*2]} + \end{aligned} + `] + +so [`[$ans]`] as before. + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad170.pg new file mode 100644 index 0000000000..d80b0d8501 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad170.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the equation. +# +# a x^2 + bx + c = 0 +# +# a!=1 in this problem. +# +# We choose a, b, c so that b^2-4ac is prime +# and gcd(b,2a)=1, this ensures that the solution +# has the form +# +# -b \pm \sqrt{PRIME} +# x = ------------------- +# 2a +# +# Last updated: Hughes 8/9/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','quadratic formula','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +$discriminant = 4; # initialize this so that the while loop works + +# The solution is picked so that +# b^2-4ac is prime and gcd(b,2a)=1 +@primesarray = (2,3,5,7,11,13,17); +my %primes = map { $_ => 1 } @primesarray; + +while( !exists($primes{$discriminant}) or gcd($b,2*$a)!=1 ) +{ + # a, b, c are used in a x^2 + bx + c = 0 + $a=random(2,5,1); + $b=non_zero_random(-10,10,1); + $c=non_zero_random(-10,10,1); + $discriminant = $b**2-4*$a*$c; +} +$questionFormula = Formula("$a*$var^2+$b*$var+$c")->reduce; +$b1 = $b*-1; +$a1 = 2*$a; +$ans = List(Formula("$var=($b1-sqrt($discriminant))/$a1"),Formula("$var=($b1+sqrt($discriminant))/$a1")); + +Context("FiniteSolutionSets"); +$ans = Formula("{($b1-sqrt($discriminant))/$a1,($b1+sqrt($discriminant))/$a1}"); +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]= 0 `] + + [_____________________________]{$ans} + +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve this equation- this equation does +not easily factor, so we will use the Quadratic Formula: + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2]-[$c*$a*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2-$c*$a*4]}}{[$a*2]}\\ + \end{aligned} + `] + +so [`[$var]=\frac{[$b*-1]-\sqrt{[$b**2-4*$a*$c]}}{[$a*2]}\text{ or }\frac{[$b*-1]+\sqrt{[$b**2-4*$a*$c]}}{[$a*2]}`]. + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad175.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad175.pg new file mode 100644 index 0000000000..abc4027a4e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad175.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the equation. +# +# a x^2 + bx + c = 0 +# +# a!=1 in this problem. +# +# The solution is picked so that +# +# -B \pm D \sqrt{C} +# x = ---------------- +# A +# +# B, C are used in helping us to get a, b, c in the quadratic equation +# +# We ensure that C is prime, B is odd, (B^2-D^2 C)%A=0 and b^2-4ac isn't too big. +# +# D is randomly chosen from (3,5,7). +# +# This works because the solutions above satisfy +# +# A^2 x^2 + 2 AB x + (B^2 -D^2 C) = 0 +# +# Provided that (B^2-D^2 C)%A=0 then we can divide the equation by A and +# the equation becomes +# +# A x^2 + 2B x + (B^2 - D^2 C) = 0 +# ------------- +# A +# +# Last updated: Hughes 8/9/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','quadratic formula','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +# a, b, c are used in a x^2 + bx + c = 0 +$a = 1; +$b = 2; +$c = 1; + +# The solution is picked so that +# +# -B \pm D \sqrt{C} +# x = ---------------- +# A +# +# B, C are used in helping us to get a, b, c in the quadratic equation +# +# We want C to be prime, and gcd(A,D)=1 +@primes = (2,3,5,7); # can add more to this array, but can make numbers potentially big +$index = random(0,$#primes,1); +$A = 2; +$B = 0; +$C = 0; +$D = 0; + +while(($B**2-$D**2*$C)%$A !=0 or gcd($A,$D)!=1 or gcd($A,$B)!=1 or ($b**2-4*$a*$c)==0 or ($b**2-4*$a*$c)>180 ) +{ + $A = random(3,7,1); + $B = non_zero_random(-5,5,1); + $index = random(0,scalar(@primes),1); + $C = $primes[$index]; + $D = random(2,3,1); # increasing D makes numbers potentially big + + $a = $A; + $b = 2*$B; + $c = ($B**2-$D**2*$C)/$A; +} +$questionFormula = Formula("$a*$var^2+$b*$var+$c")->reduce; +$b1 = $B*-1; + +$ans = List(Formula("$var=($b1-$D*sqrt($C))/$A"),Formula("$var=($b1+$D*sqrt($C))/$A")); + +Context("FiniteSolutionSets"); +$ans = Formula("{($b1-$D*sqrt($C))/$A,($b1+$D*sqrt($C))/$A}"); + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]= 0 `] + + [_____________________________]{$ans} + +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** + + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; + +############################################## +BEGIN_PGML_SOLUTION +This equation does +not easily factor, so we will use the Quadratic Formula: + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2]-[$c*$a*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2-$c*$a*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm[$D*2]\sqrt{[$C]}}{[$a*2]}\\ + \end{aligned} + `] + +So [`[$ans]`]. + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad176.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad176.pg new file mode 100644 index 0000000000..04f22b9268 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad176.pg @@ -0,0 +1,136 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# a x^2 + bx + c = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# We choose a, b, c such that b^2-4ac<0 which means +# that there are no real solutions to these equations. +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','prime','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "answerHints.pl", + "PGcourse.pl", +); + +############################################## + + +$var = "x"; +$a = -1; +$b = 2; +$c = 1; + +while( ($b**2-4*$a*$c)>=0 or abs($b**2-4*$a*$c)>180 ) +{ + $a = random(2,5,1); + $b = non_zero_random(-10,10,1); + $c = non_zero_random(-10,10,1); +} +$questionFormula = Formula("$a*$var^2+$b*$var+$c")->reduce; + +$disc = $b**2 - 4*$a*$c; +$squarepart = 1; +$nonsquarepart = $disc; +do { + if ($nonsquarepart % 4 == 0) {$squarepart *= 4; $nonsquarepart /= 4} + if ($nonsquarepart % 9 == 0) {$squarepart *= 9; $nonsquarepart /= 9} + if ($nonsquarepart % 25 == 0) {$squarepart *= 25; $nonsquarepart /= 25} + if ($nonsquarepart % 49 == 0) {$squarepart *= 49; $nonsquarepart /= 49} + if ($nonsquarepart % 121 == 0) {$squarepart *= 121; $nonsquarepart /= 121} + if ($nonsquarepart % 169 == 0) {$squarepart *= 169; $nonsquarepart /= 169} +} until ( + ($nonsquarepart % 4 != 0) and + ($nonsquarepart % 9 != 0) and + ($nonsquarepart % 25 != 0) and + ($nonsquarepart % 49 != 0) and + ($nonsquarepart % 121 != 0) and + ($nonsquarepart % 169 != 0) +); +Context("Fraction"); +$rational = Fraction(-$b,2*$a); +$coefficient = Fraction(sqrt($squarepart),2*$a); +Context("FiniteSolutionSets"); +Context()->variables->add(i => 'Real'); + +$nonsquarepart = -$nonsquarepart; + +$solution = ($nonsquarepart != -1) ? + Formula("{$rational + $coefficient i sqrt($nonsquarepart),$rational - $coefficient i sqrt($nonsquarepart)}") : + Formula("{$rational + $coefficient i,$rational - $coefficient i}"); + + + +$ans = String("no real solutions"); + +$evaluator = $ans->cmp(typeMatch=>'')->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$ans) = @_; + if ($student->class eq 'Formula') { + return $student->usesOneOf('i'); + } + } => "If you are saying there are no real solutions, the instructions are to enter 'no real solutions'.", +)); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]= 0`] + + [_______________________]{$evaluator} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION +This equation does +not easily factor, so we will use the Quadratic Formula: + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2]-[$c*$a*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2-$c*$a*4]}}{[$a*2]}\\ + \end{aligned} + `] + +The square root of a negative number is _not_ real, so we conclude that there are *no real solutions* to this +equation. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad180.pg new file mode 100644 index 0000000000..76a208dcd1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad180.pg @@ -0,0 +1,181 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (ax+b)^2 =0 +# +# Last updated: Hughes 8/9/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','fraction') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$var = "x"; +$a=2; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1 or (abs($a*$c)+abs($b*$c+$a*$d)+abs($b*$d))>100) +{ + $a = random(2,10,1); + $b = non_zero_random(-10,10,1); + $c = $a; + $d = $b; +} + +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$frac1 = Fraction(-$b,$a); +$frac2 = Fraction(-$d,$c); +# $ans = Compute("$var = $frac1, $var = $frac2"); +#$ans = OneOf(Compute("$var = $frac1"),Compute("$var = $frac1, $var = $frac2")); +$ans = Compute("$var = $frac1"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]=0`] + + [__________________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, like [|x=1, x=-1|]*. Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** +END_PGML + +############################################## + +ANS($ans->cmp( + checker => sub { + my ($correct,$student,$ans) = @_; + # count the number of student answers + my $fullStudent = $ans->{student_formula}; + my @fullStudentValue = $fullStudent->value; + my $n = scalar(@fullStudentValue); # number of student answers + if($n>1) + { + $student->context->setError("Does this equation have more than one unique solution?","",undef,undef,$Value::CMP_WARNING) + unless $ans->{isPreview}; + return; + } + # if the student has said no real solutions, ask them about it + if($student eq "no real solutions") + { + $student->context->setError("This equation does have some solutions- try factoring or using the quadratic formula","",undef,undef,$Value::CMP_WARNING) + unless $ans->{isPreview}; + return; + } + # check that the student has written x= + if ($student->type ne "Assignment" && $ans->{student_formula}->type ne "Assignment") { + $student->context->setError("Your entry should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) + unless $ans->{isPreview}; + return; + } + return $correct == $student; + } +)->withPostFilter(sub { + my $ansHash = shift; + if ($ansHash->{score}) { + my ($cvar,$cfrac) = $ansHash->{correct_value}->value; # get + my ($svar,$sfrac) = $ansHash->{student_value}->value; # get + my $check = $cfrac->cmp->evaluate($sfrac->string); # do a + $ansHash->{score} = $check->{score}; + $ansHash->{ans_message} = $check->{ans_message}; # and any + } + return $ansHash; + }, + ), +); + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +We can solve this equation either by _factoring_ or by using the _quadratic formula_. +We will demonstrate both. + +#### Factoring + + [` + \begin{aligned} + [$questionFormula]=0 &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + +#### The Quadratic Formula + +We can also solve the equation using the quadratic formula + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$B*-1]\pm\sqrt{[$B**2]-[$A*$C*4]}}{[$A*2]}\\ + & = \frac{[$B*-1]\pm\sqrt{[$B**2-$A*$C*4]}}{[$A*2]} + \end{aligned} + `] + +so [`[$ans]`] as before. + +In this problem there is just *one*, _repeated_ solution. + +The solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad185.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad185.pg new file mode 100644 index 0000000000..7a794a7cf3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad185.pg @@ -0,0 +1,152 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the equation. +# +# a x^2 = - bx - c +# +# a!=1 in this problem. +# +# The student first needs to rearrange the equation so that +# +# a x^2 + bx + c = 0 +# +# We choose a, b, c so that b^2-4ac is prime +# and gcd(b,2a)=1, this ensures that the solution +# has the form +# +# -b \pm \sqrt{PRIME} +# x = ------------------- +# 2a +# +# Last updated: Hughes 8/9/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','quadratic formula','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +$discriminant = 4; # initialize this so that the while loop works + +# The solution is picked so that +# b^2-4ac is prime and gcd(b,2a)=1 +@primesarray = (2,3,5,7,11,13,17); +my %primes = map { $_ => 1 } @primesarray; + +while( !exists($primes{$discriminant}) or gcd($b,2*$a)!=1 ) +{ + # a, b, c are used in a x^2 + bx + c = 0 + $a=random(2,5,1); + $b=non_zero_random(-10,10,1); + $c=non_zero_random(-10,10,1); + $discriminant = $b**2-4*$a*$c; +} +$b1 = $b*-1; +$c1 = $c*-1; +$questionFormula = Formula("$a*$var^2+$b*$var+$c")->reduce; +$questionFormula1 = Formula("$a*$var^2")->reduce; +$questionFormula2 = Formula("$b1*$var+$c1")->reduce; +$a1 = 2*$a; +$ans = List(Formula("$var=($b1-sqrt($discriminant))/$a1"),Formula("$var=($b1+sqrt($discriminant))/$a1")); + +Context("FiniteSolutionSets"); +$ans = Formula("{($b1-sqrt($discriminant))/$a1,($b1+sqrt($discriminant))/$a1}"); +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula1]= [$questionFormula2] `] + + [_____________________________]{$ans} + +[@KeyboardInstructions("Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** + + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML_SOLUTION +The first step in solving this equation is to set one side equal to zero: + + [` + [$questionFormula] =0 + `] + +The equation does not easily factor, so we will use the Quadratic Formula: + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2]-[$c*$a*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2-$c*$a*4]}}{[$a*2]}\\ + \end{aligned} + `] + +so [`[$var]=\frac{[$b*-1]-\sqrt{[$b**2-4*$a*$c]}}{[$a*2]}\text{ or }\frac{[$b*-1]+\sqrt{[$b**2-4*$a*$c]}}{[$a*2]}`]. + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad190.pg new file mode 100644 index 0000000000..bb77ad2d42 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad190.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the equation. +# +# a x^2 + bx = - c +# +# a!=1 in this problem. +# +# The student first needs to rearrange the equation so that +# +# a x^2 + bx + c = 0 +# +# We choose a, b, c so that b^2-4ac is prime +# and gcd(b,2a)=1, this ensures that the solution +# has the form +# +# -b \pm \sqrt{PRIME} +# x = ------------------- +# 2a +# +# Last updated: Hughes 8/9/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','quadratic formula','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +$discriminant = 4; # initialize this so that the while loop works + +# The solution is picked so that +# b^2-4ac is prime and gcd(b,2a)=1 +@primesarray = (2,3,5,7,11,13,17); +my %primes = map { $_ => 1 } @primesarray; + +while( !exists($primes{$discriminant}) or gcd($b,2*$a)!=1 ) +{ + # a, b, c are used in a x^2 + bx + c = 0 + $a=random(2,5,1); + $b=non_zero_random(-10,10,1); + $c=non_zero_random(-10,10,1); + $discriminant = $b**2-4*$a*$c; +} +$b1 = $b*-1; +$c1 = $c*-1; +$questionFormula = Formula("$a*$var^2+$b*$var+$c")->reduce; +$questionFormula1 = Formula("$a*$var^2+$b*$var")->reduce; +$questionFormula2 = Formula("$c1")->reduce; +$a1 = 2*$a; +$ans = List(Formula("$var=($b1-sqrt($discriminant))/$a1"),Formula("$var=($b1+sqrt($discriminant))/$a1")); +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula1]= [$questionFormula2] `] + + [_____________________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, like [|x=1, x=-1|]*. Enter solutions like [`\\frac{1+\\sqrt{3}}{2}`] using [|(1+sqrt(3))/2|]* and note the grouping parentheses. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); +############################################## + +BEGIN_PGML_SOLUTION +The first step in solving this equation is to set one side equal to zero: + + [` + [$questionFormula] =0 + `] + +The equation does not easily factor, so we will use the Quadratic Formula: + + [` + \begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2]-[$c*$a*4]}}{[$a*2]}\\ + & = \frac{[$b*-1]\pm\sqrt{[$b**2-$c*$a*4]}}{[$a*2]}\\ + \end{aligned} + `] + +so [`[$var]=\frac{[$b*-1]-\sqrt{[$b**2-4*$a*$c]}}{[$a*2]}\text{ or }\frac{[$b*-1]+\sqrt{[$b**2-4*$a*$c]}}{[$a*2]}`]. + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad195.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad195.pg new file mode 100644 index 0000000000..412190dd4f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad195.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# c x^2 = c a^2 b +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,4], b is integer on [3,10] +# c is integer on [-5,5] with c!=1, -1 +# +# We make sure that c*a^2*b<300 +# +# Last updated: Hughes 8/10/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#$var = RandomVariableName(type=>'variable'); +#Context()->variables->are($var=>'Real'); +$a = 10; +$b = 1; +$c = 4; +while(abs($c*$a**2*$b)>300) +{ + $a = random(2,4,1); + $b=9; + $b = random(3,11,2) while($b==9); + $c = (random(1.5,4.5,1)+0.5)*random(-1,1,2); +} +$ans = List(Formula("$var=$a sqrt($b)"),Formula("$var=-$a sqrt($b)")); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$c][$var]^2 = [$c*$a**2 * $b] `] + + [_______________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +BEGIN_PGML_SOLUTION +We could solve this equation using either the *square root method* or else +using the _Quadratic Formula_. Let's demonstrate the square root method, +and you can verify for yourself as an exercise that the quadratic formula gives the same solutions: + + [` + \begin{aligned} + [$c][$var]^2 = [$c*$a**2 * $b] &\Rightarrow [$var]^2 = [$a**2 * $b] \\ + & \Rightarrow [$var]=-\sqrt{[$a**2*$b]}\text{ or } [$var]=\sqrt{[$a**2*$b]}\\ + & \Rightarrow [$var]= -\sqrt{[$a**2]}\sqrt{[$b]}\text{ or } [$var]=\sqrt{[$a**2]}\sqrt{[$b]}\\ + & \Rightarrow [$var]=[$a*-1]\sqrt{[$b]}\text{ or } [$var]=[$a]\sqrt{[$b]}\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad200.pg new file mode 100644 index 0000000000..05b7bb8a1c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad200.pg @@ -0,0 +1,129 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# $c *( x^2 + (a+b)x + ab ) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a, b are non_zero integer on [-10,10], and a+b != 0 +# c is integer on [2,10], but we make sure that +# c*(a+b) and c*(ab) aren't too big +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#Context()->variables->are($var=>'Real'); +$c=10; +$a=10; +$b=10; +while(abs($c*$a*$b)>200 or abs($c*($a+$b))>100) +{ + $a = non_zero_random(-12,12,1); + $b = $a; + $b = non_zero_random(-12,12,1) while($b==$a or $b==-$a); + $c = random(2,6,1); +} +$soln1 = $a*-1; +$soln2 = $b*-1; +$ans = List(Formula("$var=$soln1"),Formula("$var=$soln2")); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$c][$var]^2+[$a*$c+$b*$c][$var]+[$a*$b*$c]= 0 `] + + [__________________________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to *factor* and then use the _zero product principle_. + + [` + \begin{aligned} + [$c][$var]^2+[$a*$c+$b*$c][$var]+[$a*$b*$c]= 0&\Rightarrow [$c]([$var]^2+[$a+$b][$var]+[$a*$b])= 0 \\ + &\Rightarrow [$var]^2+[$a+$b][$var]+[$a*$b]= 0 \\ + &\Rightarrow ([$var]+[$a])([$var]+[$b]) = 0 \\ + & \Rightarrow [$var]+[$a]=0 \text{ or } [$var]+[$b]=0\\ + & \Rightarrow [$var]=[$a*-1]\text{ or } [$var]=[$b*-1]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad205.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad205.pg new file mode 100644 index 0000000000..114507192e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad205.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# a x^2 - a * b^2 = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,10], b is integer on [2,5] +# +# Last updated: Hughes, 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); + +$var = "x"; +#Context()->variables->are($var=>'Real'); +$a = random(2,10,1); +$b = random(2,5,1); +$ans = Formula("{$b,-$b}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$a][$var]^2 - [$a*$b**2] = 0 `] + + [__________________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + [$a][$var]^2 - [$a*$b**2] = 0 &\Rightarrow [$a][$var]^2 = [$a*$b**2] \\ + & \Rightarrow [$var]^2=[$b**2]\\ + & \Rightarrow [$var]=-\sqrt{[$b**2]}\text{ or } [$var]=\sqrt{[$b**2]}\\ + & \Rightarrow [$var]=[$b*-1]\text{ or } [$var]=[$b]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad210.pg new file mode 100644 index 0000000000..822d18553d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad210.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# x^2 + a x = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a non_zero integer on [-90,90] +# +# Last updated: Hughes 8/11/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#Context()->variables->are($var=>'Real'); +$a = non_zero_random(-90,90,1); +$soln1 = 0; +$soln2 = $a*-1; +$ans = List(Formula("$var=$soln1"),Formula("$var=$soln2")); + +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$var]^2+[$a][$var]= 0 `] + + [__________________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to *factor* and then use the _zero product principle_. + + [` + \begin{aligned} + [$var]^2+[$a][$var]= 0 &\Rightarrow [$var]([$var]+[$a]) = 0 \\ + & \Rightarrow [$var]=0 \text{ or }[$var]+[$a]=0 \\ + & \Rightarrow [$var]=0\text{ or } [$var]=[$a*-1]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad215.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad215.pg new file mode 100644 index 0000000000..b54cfe25a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad215.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# b* (x^2 + a x) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a non_zero integer on [-90,90] +# +# Last updated: Hughes 8/11/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','factor') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#Context()->variables->are($var=>'Real'); + +$a =1; +$b = 1000; +while(abs($a*$b)>100) +{ + $a = non_zero_random(-90,90,1); + $b = (random(1.5,9.5,1)+0.5)*random(-1,1,2); +} +$soln1 = 0; +$soln2 = $a*-1; +$ans = List(Formula("$var=$soln1"),Formula("$var=$soln2")); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$b][$var]^2+[$a*$b][$var]= 0 `] + + [__________________________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to *factor* and then use the _zero product principle_. + + [` + \begin{aligned} + [$b][$var]^2+[$a*$b][$var]= 0 &\Rightarrow [$b][$var]([$var]+[$a])= 0 \\ + & \Rightarrow [$b][$var]=0 \text{ or }[$var]+[$a]=0 \\ + & \Rightarrow [$var]=0\text{ or } [$var]=[$a*-1]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad220.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad220.pg new file mode 100644 index 0000000000..51bd305bbf --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad220.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, b=0, so we're solving +# +# x (x+d) = 0 +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); +Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +$a = 1; +$b = 0; +$c = 1; +$d = $b; +$d = non_zero_random(-10,10,1) while($d==$b); + +$soln1 = -$b; +$soln2 = -$d; +$question = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; +$ans = Compute("$var = $soln1, $var = $soln2"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = 0 `] + + [____________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +END_PGML + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(limits => [1,2],list_checker => ~~&radicalListCheck)); + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + [$question]= 0 \Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad225.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad225.pg new file mode 100644 index 0000000000..e6b142187f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad225.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are of opposite sign +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + + +$var = "x"; +$a = 1; +$b = non_zero_random(-10,10,1); +$c = 1; +$d = non_zero_random(1,10,1)*abs($b)/$b*-1; + +$soln1 = -$b; +$soln2 = -$d; +$question = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; +$ans = Compute("$var = $soln1, $var = $soln2"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = 0 `] + + [____________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +END_PGML + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + + + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + [$question]= 0 \Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad230.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad230.pg new file mode 100644 index 0000000000..21972ff8ba --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad230.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = 1, c !=1, gcd(c,d)=1 +# +# b and d are of opposite sign +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle','fraction') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", + "PCCmacros.pl", +); + +############################################## + +Context("Numeric"); +$var = "x"; +$a = 1; +$b = non_zero_random(-10,10,1); +$c = random(2,20); +$d = $c; +$d = non_zero_random(1,10,1)*abs($b)/$b*-1 while(gcd($c,$d)!=1); + +$question = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$soln1 = Fraction(-$b,1); +$soln2 = Fraction(-$d,$c); +Context("FiniteSolutionSets"); +$ans = Compute("{$soln1, $soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = 0 `] + + [_]{$ans}{20} + +END_PGML + + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + [$question]= 0 \Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad235.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad235.pg new file mode 100644 index 0000000000..86be99a2ce --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad235.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# e (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = 1, c !=1, gcd(c,d)=1 +# +# b and d are of opposite sign +# +# e is integer on [50,100] +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle','fraction') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = "x"; +$a = 1; +$b = non_zero_random(-10,10,1); +$c = random(2,20); +$d = $c; +$d = non_zero_random(1,10,1)*abs($b)/$b*-1 while(gcd($c,$d)!=1); +$e = random(50,100,1)*random(-1,1,2); + +$question = Formula("$e($a*$var+$b)*($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$soln1 = Fraction(-$b,1); +$soln2 = Fraction(-$d,$c); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = 0 `] + + [_]{$ans}{20} + +END_PGML + + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + [$question]= 0 \Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad240.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad240.pg new file mode 100644 index 0000000000..f8af62cbfc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad240.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +$var = "x"; +$a = 1; +$b = random(1,10,1); +$c = 1; +$d = $b; +$d = random(1,10,1)while($d==$b); + +$soln1 = -$b; +$soln2 = -$d; +$question = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = 0 `] + + [_]{$ans}{20} + +END_PGML + + +$step = Formula("($a$var+$b)($c$var+$d)")->reduce; +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$question] = 0 &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad245.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad245.pg new file mode 100644 index 0000000000..2ebf39c8cf --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad245.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are opposite sign +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + + +$var = "x"; +$a = 1; +$b = non_zero_random(-10,10,1); +$c = 1; +$d = $b; +$d = random(1,10,1)*abs($b)/$b*-1 while(abs($d)==abs($b)); + +$soln1 = -$b; +$soln2 = -$d; +$question = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = 0 `] + + [_]{$ans}{20} + +END_PGML + +$step = Formula("($a$var+$b)($c$var+$d)")->reduce; +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$question] = 0 &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad250.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad250.pg new file mode 100644 index 0000000000..108871c55e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad250.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are both negative. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +$var = "x"; +$a = 1; +$b = random(-10,-1,1); +$c = 1; +$d = $b; +$d = random(-10,-1,1)while($d==$b); + +$soln1 = -$b; +$soln2 = -$d; +$question = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = 0 `] + + [_]{$ans}{20} + +END_PGML + + +$step = Formula("($a$var+$b)($c$var+$d)")->reduce; +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$question] = 0 &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad255.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad255.pg new file mode 100644 index 0000000000..f898e483c5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad255.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x = bd +# +# i.e +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +$var = "x"; +$a = 1; +$b = random(1,10,1); +$c = 1; +$d = $b; +$d = random(1,10,1)while($d==$b); + +$soln1 = -$b; +$soln2 = -$d; +$question = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var")->reduce->reduce; +$rhs = Formula("-$b*$d")->reduce->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = [$rhs] `] + + [_]{$ans}{20} + +END_PGML + +Context("Numeric"); + +$step0 = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; +$step = Formula("($a$var+$b)($c$var+$d)")->reduce; +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$question] = [$rhs] &\Rightarrow [$step0]=0\\ + &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad260.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad260.pg new file mode 100644 index 0000000000..4808cabf8b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad260.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x = bd +# +# i.e +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are opposite sign +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + + +$var = "x"; +$a = 1; +$b = non_zero_random(-10,10,1); +$c = 1; +$d = $b; +$d = random(1,10,1)*abs($b)/$b*-1 while(abs($d)==abs($b)); + +$soln1 = -$b; +$soln2 = -$d; +$question = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var")->reduce->reduce; +$rhs = Formula("-$b*$d")->reduce->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = [$rhs] `] + + [____________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +END_PGML + +Context("Numeric"); +$showPartialCorrectAnswers = 1; + +$step0 = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; +$step = Formula("($a$var+$b)($c$var+$d)")->reduce; +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$question] = [$rhs] &\Rightarrow [$step0]=0\\ + &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad265.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad265.pg new file mode 100644 index 0000000000..8574a060d8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad265.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x = bd +# +# i.e +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are both negative. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +$var = "x"; +$a = 1; +$b = random(-10,-1,1); +$c = 1; +$d = $b; +$d = random(-10,-1,1)while($d==$b); + +$soln1 = -$b; +$soln2 = -$d; +$question = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var")->reduce->reduce; +$rhs = Formula("-$b*$d")->reduce->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = [$rhs] `] + + [_]{$ans}{20} + +END_PGML + +Context("Numeric"); +$step0 = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; +$step = Formula("($a$var+$b)($c$var+$d)")->reduce; +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$question] = [$rhs] &\Rightarrow [$step0]=0\\ + &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad270.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad270.pg new file mode 100644 index 0000000000..d3abea6a39 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad270.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + bd = - (ad + bc) x +# +# i.e +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +$var = "x"; +$a = 1; +$b = 0; +$c = 1; +$d = $b; +$d = non_zero_random(-10,10,1)while($d==$b); + +$soln1 = -$b; +$soln2 = -$d; +$complete = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; +$lhs = Formula("$a*$c*$var^2")->reduce->reduce; +$rhs = Formula("-($a*$d+$b*$c)*$var")->reduce->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs] = [$rhs] `] + + [_]{$ans}{20} + +END_PGML + + +$step = Formula("($a$var+$b)($c$var+$d)")->reduce; +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$lhs] = [$rhs] &\Rightarrow [$complete]=0\\ + &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad275.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad275.pg new file mode 100644 index 0000000000..fd1190f869 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad275.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + bd = - (ad + bc) x +# +# i.e +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a != 1, c = 1 +# +# b and d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + + +$var = "x"; +$a = random(2,10,1); +$b = 0; +$c = 1; +$d = $b; +$d = non_zero_random(-10,10,1)while($d==$b); + +$soln1 = -$b; +$soln2 = -$d; +$complete = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; +$step = Formula("($a$var+$b)($c$var+$d)")->reduce; +$lhs = Formula("$a*$c*$var^2")->reduce->reduce; +$rhs = Formula("-($a*$d+$b*$c)*$var")->reduce->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs] = [$rhs] `] + + [_]{$ans}{20} + +END_PGML + + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$lhs] = [$rhs] &\Rightarrow [$complete]=0\\ + &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad280.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad280.pg new file mode 100644 index 0000000000..3b60bd52a2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad280.pg @@ -0,0 +1,133 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + bd = - (ad + bc) x +# +# i.e +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = 1, c != 1 +# +# b and d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$var = "x"; +$a = 1; +$b = 0; +$c = random(2,10,1); +$d = $c; +$d = non_zero_random(-10,10,1)while(gcd($c,$d)!=1); +$complete = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; +$lhs = Formula("$a*$c*$var^2")->reduce->reduce; +$rhs = Formula("-($a*$d+$b*$c)*$var")->reduce->reduce; +$step = Formula("($a$var+$b)($c$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); +Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + + + +$soln1 = Fraction(-$b,1); +$soln2 = Fraction(-$d,$c); +$ans = Compute("$var = $soln1, $var = $soln2"); + +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs] = [$rhs] `] + + [____________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$lhs] = [$rhs] &\Rightarrow [$complete]=0\\ + &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad285.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad285.pg new file mode 100644 index 0000000000..15e48cf7c0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad285.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b = d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$var = "x"; +$a=10; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1) +{ + $a = 1; + $b = random(1,12,1); + $c = $a; + $d = $b; +} + +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '*' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '+' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '-' in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$b1 = $b*-1; +Context("FiniteSolutionSets"); +$ans = ($a == 1) ? Formula("{$b1}") : Formula("{$b1/$a}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]=0`] + + [_]{$ans}{20} + +END_PGML + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$questionFormula]=0 &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + + + +In this problem there is just *one*, _repeated_ solution. + +The solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad290.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad290.pg new file mode 100644 index 0000000000..3e98d0d673 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad290.pg @@ -0,0 +1,143 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b = d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +# globally set the reductions one time +# # so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$var = "x"; +$a=10; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1) +{ + $a = 1; + $b = random(1,12,1)*-1; + $c = $a; + $d = $b; +} + +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '*' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '+' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '-' in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$b1 = $b*-1; +Context("FiniteSolutionSets"); +$ans = ($a == 1) ? Formula("{$b1}") : Formula("{$b1/$a}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]=0`] + + [_]{$ans}{20} + +END_PGML + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$questionFormula]=0 &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + + + +In this problem there is just *one*, _repeated_ solution. + +The solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad295.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad295.pg new file mode 100644 index 0000000000..7cc86a985a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad295.pg @@ -0,0 +1,148 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 = - (ad + bc) x - bd +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b = d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +# globally set the reductions one time +# # so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$var = "x"; +$a=10; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1) +{ + $a = 1; + $b = random(1,12,1)*-1; + $c = $a; + $d = $b; +} + +$lhs = Formula("$a*$c*$var^2")->reduce->reduce; +$rhs = Formula("-($b*$c+$a*$d)*$var-($b*$d)")->reduce->reduce; +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '*' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '+' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '-' in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$b1 = $b*-1; +Context("FiniteSolutionSets"); +$ans = ($a == 1) ? Formula("{$b1}") : Formula("{$b1/$a}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs]=[$rhs]`] + + [_]{$ans}{20} + +END_PGML + +############################################## + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$lhs]=[$rhs] &\Rightarrow [$questionFormula]=0 \\ + &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + + + +In this problem there is just *one*, _repeated_ solution. + +The solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad30.pg new file mode 100644 index 0000000000..9b60ab8a8d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad30.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# x^2 = a^2 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,10]. +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#Context()->variables->are($var=>'Real'); +$a = random(2,12,1); +$ans = List(Formula("$var=$a"),Formula("$var=-$a")); + +Context("FiniteSolutionSets"); +$ans = Formula("{$a,-$a}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$var]^2 = [$a**2] `] + + [__________________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; + + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + [$var]^2 = [$a**2] & \Rightarrow [$var]=-\sqrt{[$a**2]}\text{ or } [$var]=\sqrt{[$a**2]}\\ + & \Rightarrow [$var]=[$a*-1]\text{ or } [$var]=[$a]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad300.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad300.pg new file mode 100644 index 0000000000..f41e09e03e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad300.pg @@ -0,0 +1,153 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 = - (ad + bc) x - bd +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c with a!=1, gcd(a,b)=1 +# +# b = d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +# globally set the reductions one time +# # so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$var = "x"; +$a=10; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1 or (abs($a*$d+$b*$d)>100)) +{ + $a = random(2,12,1); + $b = $a; + $b = random(1,12,1); + $c = $a; + $d = $b; +} + +$lhs = Formula("$a*$c*$var^2")->reduce->reduce; +$rhs = Formula("-($b*$c+$a*$d)*$var-($b*$d)")->reduce->reduce; +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '*' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '+' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '-' in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$b1 = $b*-1; +$ans = Compute("$var = $b1/$a"); + +Context("FiniteSolutionSets"); +$ans = Formula("{$b1/$a}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs]=[$rhs]`] + + [__________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$lhs]=[$rhs] &\Rightarrow [$questionFormula]=0 \\ + &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + + + +In this problem there is just *one*, _repeated_ solution. + +The solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad305.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad305.pg new file mode 100644 index 0000000000..e16f485005 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad305.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 = - (ad + bc) x - bd +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,5], c = 1 +# +# b = d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle','fraction') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +# globally set the reductions one time +# # so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$var = "x"; +$a=10; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1 or (abs($a*$d+$b*$d)>100)) +{ + $a = random(2,5,1); + $b = random(1,12,1); + $c = 1; + $d = random(2,10,1); +} + +$lhs = Formula("$a*$c*$var^2")->reduce->reduce; +$rhs = Formula("-($b*$c+$a*$d)*$var-($b*$d)")->reduce->reduce; +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '*' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '+' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '-' in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$soln1 = Fraction(-$b,$a); +$soln2 = Fraction(-$d,$c); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs]=[$rhs]`] + + [_]{$ans}{20} + +END_PGML + +############################################## + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$lhs]=[$rhs] &\Rightarrow [$questionFormula]=0 \\ + &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + +This quadratic equation has two distinct, real solutions. + +The solutions can be checked by substituting them into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad310.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad310.pg new file mode 100644 index 0000000000..16daa41021 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad310.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b =- d +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + + +$var = "x"; +$a = 1; +$b = non_zero_random(-10,10,1); +$c = 1; +$d = -$b; + +$soln1 = -$b; +$soln2 = -$d; +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula] = 0 `] + + [_]{$ans}{20} + +END_PGML + + + + +BEGIN_PGML_SOLUTION +There are a few ways you can approach this problem- you might like to use +the _square root method_ or else you might prefer to _factor_ the equation +and then use the _zero product principle_. + + [` + \begin{aligned} + [$questionFormula]=0 &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad315.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad315.pg new file mode 100644 index 0000000000..78217d5e86 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad315.pg @@ -0,0 +1,150 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c and a!=1 +# +# b = -d +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$var = "x"; +$a=10; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1) +{ + $a = random(2,10,1); + $b = random(1,12,1); + $c = $a; + $d = -$b; +} + +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '*' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '+' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '-' in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$soln1 = Fraction(-$b,$a); +$soln2 = Fraction(-$d,$c); +$ans = Compute("$var = $soln1, $var = $soln2"); + +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]=0`] + + [__________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## +$showPartialCorrectAnswers = 1; + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +There are a few ways you can approach this problem- you might like to use +the _square root method_ or else you might prefer to _factor_ the equation +and then use the _zero product principle_. + + [` + \begin{aligned} + [$questionFormula]=0 &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + + + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad320.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad320.pg new file mode 100644 index 0000000000..dd3b81e58b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad320.pg @@ -0,0 +1,148 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c and a!=1 +# +# b = -d +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$var = "x"; +$a=10; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1) +{ + $a = random(2,10,1); + $b = random(1,12,1); + $c = $a; + $d = -$b; +} + +$lhs = Formula("$a*$c*$var^2")->reduce->reduce; +$rhs = Formula("-($b*$c+$a*$d)*$var-($b*$d)")->reduce->reduce; +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '*' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '+' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '-' in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$soln1 = Fraction(-$b,$a); +$soln2 = Fraction(-$d,$c); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs]=[$rhs]`] + + [_]{$ans}{20} + +END_PGML + +############################################## + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +There are a few ways you can approach this problem- you might like to use +the _square root method_ or else you might prefer to _factor_ the equation +and then use the _zero product principle_. + + [` + \begin{aligned} + [$lhs]=[$rhs] & \Rightarrow [$questionFormula]=0 \\ + &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + + + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad325.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad325.pg new file mode 100644 index 0000000000..57850f1a23 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad325.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x(x + (ad + bc)/ac ) = bd +# +# i.e +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are opposite sign +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + + +$var = "x"; +$a = 1; +$b = non_zero_random(-12,12,1); +$c = 1; +$d = $b; +$d = random(1,12,1)*abs($b)/$b*-1 while(abs($d)==abs($b)); + +$soln1 = -$b; +$soln2 = -$d; +$question = Formula("$a*$c*$var($var+($a*$d+$b*$c))")->reduce->reduce; +$rhs = Formula("-$b*$d")->reduce->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = [$rhs] `] + + [_]{$ans}{20} + +END_PGML + +Context("Numeric"); +$step0 = Formula("$a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d")->reduce->reduce; +$step = Formula("($a$var+$b)($c$var+$d)")->reduce; +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$question] = [$rhs] &\Rightarrow [$step0]=0\\ + &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad330.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad330.pg new file mode 100644 index 0000000000..6997186f6e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad330.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# x( ac x + (ad + bc) ) = - bd +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,5], c = 1 +# +# b = d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle','fraction') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", + "PCCmacros.pl", +); + +############################################## + +Context("Numeric"); +# globally set the reductions one time +# # so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$var = "x"; +$a=10; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1 or (abs($a*$d+$b*$c)>80)) +{ + $a = random(2,5,1); + $b = non_zero_random(-12,12,1); + $c = 1; + $d = non_zero_random(-12,12,1) while(abs($d)==abs($b)); +} + +$lhs = Formula("$var($a*$c*$var+($b*$c+$a*$d))")->reduce->reduce; +$rhs = Formula("-($b*$d)")->reduce->reduce; +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '*' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '+' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '-' in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$soln1 = Fraction(-$b,$a); +$soln2 = Fraction(-$d,$c); +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs]=[$rhs]`] + + [_]{$ans}{20} + +END_PGML + +############################################## + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$lhs]=[$rhs] &\Rightarrow [$questionFormula]=0 \\ + &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + +This quadratic equation has two distinct, real solutions. + +The solutions can be checked by substituting them into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad335.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad335.pg new file mode 100644 index 0000000000..fb55894457 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad335.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (Ax + B)(Cx + D) = E +# +# we choose A, B, C, D, E so that this equation is equivalent to +# +# A=C=1 in this problem +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are of opposite sign +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + + +$var = "x"; +$a = 1; +$b = non_zero_random(-5,5,1); +$c = 1; +$d = $b; +$d = non_zero_random(-5,5,1)while(abs($b)==abs($d)); + +# set up A, B, C, D +$A = 1; +$C = 1; +$B = 1; $D = 1; $E =1; +while( ($B*$C+$A*$D)!=($b*$c+$a*$d) or ($B*$D-$E)!=$b*$d ) +{ + $b = non_zero_random(-5,5,1); + $d = $b; + $d = non_zero_random(-5,5,1)while(abs($b)==abs($d)); + + $B = non_zero_random(-10,10,1); + $D = non_zero_random(-10,10,1); + $E = non_zero_random(-10,10,1); +} + +$soln1 = -$b; +$soln2 = -$d; +$lhs = Formula("($A*$var+$B)*($C*$var+$D)")->reduce; +$rhs = Formula("$E")->reduce; +$step1 = Formula("$A*$C*$var**2+($B*$C+$A*$D)*$var+$B*$D")->reduce->reduce; +$step2 = Formula("$a*$c*$var**2+($b*$c+$a*$d)*$var+$b*$d")->reduce->reduce; +$question = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs] = [$rhs] `] + + [_]{$ans}{20} + +END_PGML + + + +BEGIN_PGML_SOLUTION +Our priority must be to manipulate this equation until one side is equal to +[`0`]; once that is achieved, we will use the _zero product principle_ + + [` + \begin{aligned} + [$lhs]=[$rhs] & \Rightarrow [$step1]= [$E] \\ + & \Rightarrow [$step2]= 0 \\ + & \Rightarrow [$question]= 0 \\ + & \Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad340.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad340.pg new file mode 100644 index 0000000000..a8f433ef03 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad340.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (Ax + B)(Cx + D) = E +# +# C!=1 in this problem +# we choose A, B, C, D, E so that this equation is equivalent to +# +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are of opposite sign +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + + + +$var = "x"; +$a = 1; +$b = non_zero_random(-5,5,1); +$c = 1; +$d = $b; +$d = non_zero_random(-5,5,1)while(abs($b)==abs($d)); + +# set up A, B, C, D +$A = 1; +$C = 1; +$B = 1; $D = 1; $E =1; +while( ($B*$C+$A*$D)!=($b*$c+$a*$d) or ($B*$D-$E)!=$b*$d ) +{ + $b = non_zero_random(-5,5,1); + $d = $b; + $d = non_zero_random(-5,5,1)while(abs($b)==abs($d)); + + $B = non_zero_random(-10,10,1); + $C = random(2,4,1); + $D = $C; + $D = non_zero_random(-10,10,1)while(abs($D)==abs($C) or gcd($C,$D)!=1); + $E = non_zero_random(-10,10,1); +} + +$soln1 = -$b; +$soln2 = -$d; +$lhs = Formula("($A*$var+$B)*($C*$var+$D)")->reduce; +$rhs = Formula("$E+($A*$C-1)*$var^2")->reduce; +$step1 = Formula("$A*$C*$var^2+($B*$C+$A*$D)*$var+$B*$D")->reduce->reduce; +$step2 = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+$b*$d")->reduce->reduce; +$question = Formula("($a*$var+$b)*($c*$var+$d)")->reduce; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs] = [$rhs] `] + + [_]{$ans}{20} + +END_PGML + + + +BEGIN_PGML_SOLUTION +Our priority must be to manipulate this equation until one side is equal to +[`0`]; once that is achieved, we will use the _zero product principle_ + + [` + \begin{aligned} + [$lhs]=[$rhs] & \Rightarrow [$step1]= [$rhs]\\ + & \Rightarrow [$step2]= 0 \\ + & \Rightarrow [$question]= 0 \\ + & \Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +You might have solved the equation using the Quadratic Formula- the final +result is the same. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad345.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad345.pg new file mode 100644 index 0000000000..5929e0cec2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad345.pg @@ -0,0 +1,154 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# a x (ax + 4b) = b (2a x -b) +# +# This comes down to +# +# (ax + b)(cx + d) = 0 +# +# with b=d +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +# globally set the reductions one time +# # so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$var = "x"; +$a=10; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1) +{ + $a = 1; + $b = non_zero_random(-11,11,2); + $c = $a; + $d = $b; +} + +$lhs = Formula("$a*$var($a*$var+4*$b)")->reduce->reduce; +$rhs = Formula("$b*(2*$a*$var-$b)")->reduce->reduce; +$lhs1 = Formula("$a^2*$var^2+4*$b*$a*$var")->reduce->reduce; +$rhs1 = Formula("2*$b*$a*$var-$b**2")->reduce->reduce; +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '*' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '+' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '-' in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$b1 = $b*-1; +$ans = Compute("$var = $b1/$a"); + + +Context("Fraction"); +$ans = Fraction($b1,$a); + +Context("FiniteSolutionSets"); +$ans = Formula("{$ans}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs]=[$rhs]`] + + [__________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$lhs]=[$rhs] & \Rightarrow [$lhs1]=[$rhs1] \\ + & \Rightarrow [$questionFormula]=0 \\ + &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + + + +In this problem there is just *one*, _repeated_ solution. + +The solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad35.pg new file mode 100644 index 0000000000..3720a1cc40 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad35.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# x^2 = 1/a^2 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,10]. +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','fraction') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFraction")->flags->set(reduceFractions => 0); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + + +$var = "x"; +$a = Fraction(1,random(2,12,1)); +$ans = Compute("$var = -$a, $var = $a"); + +Context("FiniteSolutionSets"); +$ans = Formula("{-$a,$a}"); +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$var]^2 = [$a**2] `] + + [______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + [$var]^2 = [$a**2] & \Rightarrow [$var]=-\sqrt{[$a**2]}\text{ or } [$var]=\sqrt{[$a**2]}\\ + & \Rightarrow [$var]=[$a*-1]\text{ or } [$var]=[$a]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad350.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad350.pg new file mode 100644 index 0000000000..00b5d173bc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad350.pg @@ -0,0 +1,150 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b = d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$var = "x"; +$a=10; +$b=$a; +$c=$a; +$d=$a; + +while(gcd($a,$b)!=1 or gcd($c,$d)!=1) +{ + $a = random(2,10,1); + $b = random(1,12,1); + $c = $a; + $d = $b; +} + +$questionFormula = Formula("$a*$c*$var^2+($b*$c+$a*$d)*$var+($b*$d)")->reduce->reduce; +$questionFormula1 = Formula("($a*$var+$b)($c*$var+$d)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '*' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '+' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '-' in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$b1 = $b*-1; +$ans = Compute("$var = $b1/$a"); + +Context("Fraction"); +$ans = Fraction($b1,$a); + +Context("FiniteSolutionSets"); +$ans = Formula("{$ans}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$questionFormula]=0`] + + [__________________________]{$ans} + + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + +############################################## + +$A = $a*$c; +$B = $b*$c+$a*$d; +$C = $b*$d; + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$questionFormula]=0 &\Rightarrow [$questionFormula1]=0 \\ + & \Rightarrow [$ans] + \end{aligned} + `] + + + +In this problem there is just *one*, _repeated_ solution. + +The solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad355.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad355.pg new file mode 100644 index 0000000000..bff7d40261 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad355.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (x+e)(ac x^2 + (ad + bc) x + bd) = 0 +# +# This equation factors nicely +# +# (x+e)(ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','polynomial','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +$a = 1; +$b = random(1,10,1); +$c = 1; +$d = $b; +$d = random(1,10,1)while(abs($d)==abs($b)); +$e = $d; +$e = random(-10,10,1)while($e==$d or $e==$b); + +$soln1 = -$b; +$soln2 = -$d; +$soln3 = -$e; +$question = Formula("($var+$e)($a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d)")->reduce->reduce; +$ans = Compute("$var = $soln1, $var = $soln2, $var=$soln3"); + +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2,$soln3}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = 0 `] + + [____________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +$showPartialCorrectAnswers = 1; + +$step = Formula("($var+$e)($a$var+$b)($c$var+$d)")->reduce; +BEGIN_PGML_SOLUTION +Note that this is _not_ a quadratic equation, as its degree is [`3`]. However, +the factoring technique still applies + + [` + \begin{aligned} + [$question] = 0 &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2] \text{ or }[$var]=[$soln3]\\ + \end{aligned} + `] + + +Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad360.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad360.pg new file mode 100644 index 0000000000..63a3fac678 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad360.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (x+e)(ac x^2 + (ad + bc) x + bd) = 0 +# +# This equation factors nicely +# +# (x+e)(ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b = -d, and e=0 +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','polynomial','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +$a = 1; +$b = random(1,10,1); +$c = 1; +$d = -$b; +$e = 0; + +$soln1 = -$b; +$soln2 = -$d; +$soln3 = -$e; +$question = Formula("($var+$e)($a*$c*$var^2+($a*$d+$b*$c)*$var+$b*$d)")->reduce->reduce; +$ans = Compute("$var = $soln1, $var = $soln2, $var=$soln3"); + +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2,$soln3}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = 0 `] + + [____________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +$showPartialCorrectAnswers = 1; + +$step = Formula("($var+$e)($a$var+$b)($c$var+$d)")->reduce; +BEGIN_PGML_SOLUTION +Note that this is _not_ a quadratic equation, as its degree is [`3`]. However, +the factoring technique still applies + + [` + \begin{aligned} + [$question] = 0 &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2] \text{ or }[$var]=[$soln3]\\ + \end{aligned} + `] + + +Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad365.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad365.pg new file mode 100644 index 0000000000..b76604357c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad365.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac x^2 + (ad + bc) x + bd = 0 +# +# This equation factors nicely +# +# (ax + b)(cx + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','polynomial','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +$a = 1; +$b = non_zero_random(-10,10,1); +$c = 1; +$d = $b; +$d = non_zero_random(-10,10,1)while(abs($d)==abs($b)); + +$soln1 = -$b; +$soln2 = -$d; +$question = Formula("$a*$c*$var^3+($a*$d+$b*$c)*$var^2+$b*$d$var")->reduce->reduce; +$ans = Compute("$var=0,$var = $soln1, $var = $soln2"); + +Context("FiniteSolutionSets"); +$ans = Formula("{0,$soln1,$soln2}"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = 0 `] + + [____________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +$showPartialCorrectAnswers = 1; + +$step = Formula("$var($a$var+$b)($c$var+$d)")->reduce; +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$question] = 0 &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=0\text{ or }[$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad370.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad370.pg new file mode 100644 index 0000000000..6f85c8e22b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad370.pg @@ -0,0 +1,134 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# ac (x+e)^2 + (ad + bc) (x+e) + bd = 0 +# +# This equation factors nicely +# +# (a(x+e) + b)(c(x+e) + d) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a = c = 1, +# +# b and d are both positive. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','factor','zero product principle') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +do {$a = 1; +$b = random(-10,10,1); +$c = 1; +$d = $b; +$d = random(-10,10,1)while(abs($d)==abs($b)); +$e = $b; +$e = non_zero_random(-10,10,1)while(abs($e)==abs($b) or abs($e)==abs($d)); +} until (abs($a*$d+$b*$c) != 1); + +$soln1 = -$b-$e; +$soln2 = -$d-$e; +$question = Formula("$a*$c*($var+$e)^2+($a*$d+$b*$c)*($var+$e)+$b*$d")->reduce->reduce; +$ans = Compute("$var = $soln1, $var = $soln2"); + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$question] = 0 `] + + [____________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +END_PGML + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +Context("Numeric"); +Context()->variables->are($var=>'Real',y=>'Real'); +$step = Formula("($a($var+$e)+$b)($c($var+$e)+$d)")->reduce; +$alt = Formula("$a*$c*y^2+($a*$d+$b*$c)*y+$b*$d")->reduce->reduce; +$alt1 = Formula("($a*y+$b)($c*y+$d)")->reduce; +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + [$question] = 0 &\Rightarrow [$step]=0\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Alternatively, you may have preferred to write [`y=[$var]+[$e]`] as follows + + [` + \begin{aligned} + [$alt] = 0 &\Rightarrow [$alt1]=0\\ + &\Rightarrow y=[$soln1+$e]\text{ or } y=[$soln2+$e]\\ + &\Rightarrow [$var]+[$e]=[$soln1+$e]\text{ or } [$var]+[$e]=[$soln2+$e]\\ + &\Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad375.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad375.pg new file mode 100644 index 0000000000..c9e1fe16c4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad375.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# How many real solutions does the following +# equation have? +# +# a x^2 + b x + c = 0 +# +# We make sure that b^2-4ac>0 in this problem. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION +# +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$var = 'x'; +$a = 1; +$b = 1; +$c = 1; + +while($b**2-4*$a*$c<=0) +{ + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); + $c = non_zero_random(-10,10,1); + } + +$lhs = Formula("$a$var^2+$b$var+$c")->reduce->reduce; +$rhs = Formula("0")->reduce->reduce; +$popup = PopUp(['?', 'no real solutions', + 'one real solution', + 'two real solutions', + 'three real solutions', + 'four real solutions', + 'five real solutions' + ], 'two real solutions'); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML +How many real solutions does the following +equation have? + + [` + [$lhs] =[$rhs] + `] + + [@$popup->menu()@]* + + +END_PGML + +#ANS( $popup->cmp(correct_ans_latex_string=>'\lt') ); +ANS( $popup->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION +We don't actually need to _solve_ this equation in order to determine how many +real solutions it has. + +Remember the quadratic formula + + [` + [$var] = \frac{-b\pm\sqrt{b^2-4ac}}{2a} + `] + +The quantity [`b^2-4ac`] is known as the *discriminant*; the sign of the discriminant +completely determines the number of real solutions: +* if [`b^2-4ac<0`] then the equation has *no* real solutions +* if [`b^2-4ac=0`] then the equation has *one* real solution +* if [`b^2-4ac>0`] then the equation has *two* real solutions + +Let's calculate the discriminant: + + [` + \begin{aligned} + b^2-4ac & = [$b**2]-[$a*4*$c]\\ + & = [$b**2-$a*4*$c]>0\\ + \end{aligned} + `] + +Since the discriminant is _positive_, we conclude that this equation has *two real solutions*. +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad380.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad380.pg new file mode 100644 index 0000000000..29cdfed384 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad380.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# How many real solutions does the following +# equation have? +# +# a x^2 + b x + c = 0 +# +# We make sure that b^2-4ac=0 in this problem. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION +# +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$var = 'x'; +$a = 1; +$b = 4; +$c = 1; + +while($b**2-4*$a*$c!=0) +{ + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); + $c = non_zero_random(-10,10,1); + } + +$lhs = Formula("$a$var^2+$b$var+$c")->reduce->reduce; +$rhs = Formula("0")->reduce->reduce; +$popup = PopUp(['?', 'no real solutions', + 'one real solution', + 'two real solutions', + 'three real solutions', + 'four real solutions', + 'five real solutions' + ], 'one real solution'); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML +How many real solutions does the following +equation have? + + [` + [$lhs] =[$rhs] + `] + + [@$popup->menu()@]* + + +END_PGML + +#ANS( $popup->cmp(correct_ans_latex_string=>'\lt') ); +ANS( $popup->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION +We don't actually need to _solve_ this equation in order to determine how many +real solutions it has. + +Remember the quadratic formula + + [` + [$var] = \frac{-b\pm\sqrt{b^2-4ac}}{2a} + `] + +The quantity [`b^2-4ac`] is known as the *discriminant*; the sign of the discriminant +completely determines the number of real solutions: +* if [`b^2-4ac<0`] then the equation has *no* real solutions +* if [`b^2-4ac=0`] then the equation has *one* real solution +* if [`b^2-4ac>0`] then the equation has *two* real solutions + +Let's calculate the discriminant: + + [` + \begin{aligned} + b^2-4ac & = [$b**2]-[$a*4*$c]\\ + & = [$b**2-$a*4*$c]\\ + \end{aligned} + `] + +Since the discriminant is _zero_, we conclude that this equation has *one real solution*. +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad385.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad385.pg new file mode 100644 index 0000000000..9a9eae843c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad385.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# How many real solutions does the following +# equation have? +# +# a x^2 + b x + c = 0 +# +# We make sure that b^2-4ac<0 in this problem. +# +# Last updated: Hughes 8/20/13 +# +# ENDDESCRIPTION +# +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$var = 'x'; +$a = 1; +$b = 2; +$c = 1; + +while($b**2-4*$a*$c>=0) +{ + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); + $c = non_zero_random(-10,10,1); + } + +$lhs = Formula("$a$var^2+$b$var+$c")->reduce->reduce; +$rhs = Formula("0")->reduce->reduce; +$popup = PopUp(['?', 'no real solutions', + 'one real solution', + 'two real solutions', + 'three real solutions', + 'four real solutions', + 'five real solutions' + ], 'no real solutions'); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML +How many real solutions does the following +equation have? + + [` + [$lhs] =[$rhs] + `] + + [@$popup->menu()@]* + + +END_PGML + +#ANS( $popup->cmp(correct_ans_latex_string=>'\lt') ); +ANS( $popup->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION +We don't actually need to _solve_ this equation in order to determine how many +real solutions it has. + +Remember the quadratic formula + + [` + [$var] = \frac{-b\pm\sqrt{b^2-4ac}}{2a} + `] + +The quantity [`b^2-4ac`] is known as the *discriminant*; the sign of the discriminant +completely determines the number of real solutions: +* if [`b^2-4ac<0`] then the equation has *no* real solutions +* if [`b^2-4ac=0`] then the equation has *one* real solution +* if [`b^2-4ac>0`] then the equation has *two* real solutions + +Let's calculate the discriminant: + + [` + \begin{aligned} + b^2-4ac & = [$b**2]-[$a*4*$c]\\ + & = [$b**2-$a*4*$c]<0\\ + \end{aligned} + `] + +Since the discriminant is _negative_, we conclude that this equation has *no real solutions* (the +square root of a negative number is not real). +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad40.pg new file mode 100644 index 0000000000..8882c0db68 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad40.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# x^2 = a^2 b +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,4], b is integer on [3,10] +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#$var = RandomVariableName(type=>'variable'); +#Context()->variables->are($var=>'Real'); +$a = random(2,4,1); +$b=9; +$b = random(3,11,2) while($b==9); +$ans = List(Formula("$var=$a sqrt($b)"),Formula("$var=-$a sqrt($b)")); + +Context("FiniteSolutionSets"); +$ans = Formula("{$a sqrt($b),-$a sqrt($b)}"); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$var]^2 = [$a**2 * $b] `] + + [_______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + [$var]^2 = [$a**2 * $b] & \Rightarrow [$var]=-\sqrt{[$a**2*$b]}\text{ or } [$var]=\sqrt{[$a**2*$b]}\\ + & \Rightarrow [$var]= -\sqrt{[$a**2]}\sqrt{[$b]}\text{ or } [$var]=\sqrt{[$a**2]}\sqrt{[$b]}\\ + & \Rightarrow [$var]=[$a*-1]\sqrt{[$b]}\text{ or } [$var]=[$a]\sqrt{[$b]}\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad45.pg new file mode 100644 index 0000000000..05e55fa4ed --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad45.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# x^2 = a^2 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer selected from (2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67), b is integer on [3,10] +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','prime') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed,showExtraParens=>0); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#$var = RandomVariableName(type=>'variable'); +#Context()->variables->are($var=>'Real'); +@primes = (2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67); +$index = random(0,$#primes,1); +$a = $primes[$index]; +$ans = List(Formula("$var=sqrt($a)"),Formula("$var=-sqrt($a)")); + +Context("FiniteSolutionSets"); +$ans = Formula("{sqrt($a),-sqrt($a)}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$var]^2 = [$a] `] + + [_______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + [$var]^2 = [$a] & \Rightarrow [$var]=-\sqrt{[$a]}\text{ or } [$var]=\sqrt{[$a]}\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real, and +since [`[$a]`] is prime we can not simplify our solutions further. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad50.pg new file mode 100644 index 0000000000..9b56c76e37 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad50.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# a x^2 = a * b^2 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,10], b is integer on [2,5] +# +# Last updated: Hughes, 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); + +$var = "x"; +#Context()->variables->are($var=>'Real'); +$a = random(2,10,1); +$b = random(2,5,1); +$ans = Formula("{-$b,$b}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$a][$var]^2 = [$a*$b**2] `] + + [__________________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + [$a][$var]^2 = [$a*$b**2] & \Rightarrow [$var]^2=[$b**2]\\ + & \Rightarrow [$var]=-\sqrt{[$b**2]}\text{ or } [$var]=\sqrt{[$b**2]}\\ + & \Rightarrow [$var]=[$b*-1]\text{ or } [$var]=[$b]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad55.pg new file mode 100644 index 0000000000..02f7e82dde --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad55.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# x^2 = a^2/b^2 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is an odd or even integer on [2,10] +# b is an odd or even integer on [2,10], +# +# we make sure that both a and b are not even or odd +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','fraction') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + + +$var = "x"; +$aIsOdd = random(0,1,1); +if($aIsOdd){ + $a = random(3,11,2); + $b = $a; + $b = random(2,12,2) while(gcd($a,$b)!=1); +} +else + { + $a = random(2,12,2); + $b = $a; + $b = random(3,11,2) while(gcd($a,$b)!=1); + } +$a = Fraction($a,$b); +$ans = Compute("$var = -$a, $var = $a"); + +Context("FiniteSolutionSets"); +$ans = Formula("{-$a,$a}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$var]^2 = [$a**2] `] + + [______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + [$var]^2 = [$a**2] & \Rightarrow [$var]=-\sqrt{[$a**2]}\text{ or } [$var]=\sqrt{[$a**2]}\\ + & \Rightarrow [$var]=[$a*-1]\text{ or } [$var]=[$a]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad60.pg new file mode 100644 index 0000000000..3aa17d7e2a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad60.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# b^2 x^2 = a^2 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is an odd or even integer on [2,10] +# b is an odd or even integer on [2,10], +# +# we make sure that both a and b are not even or odd +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFraction")->flags->set(reduceFractions => 0,showExtraParens=>0,showMixedNumbers=>0 ); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + + +$var = "x"; +$aIsOdd = random(0,1,1); +if($aIsOdd){ + $a = random(3,11,2); + $b = $a; + $b = random(2,12,2) while(gcd($a,$b)!=1); +} +else + { + $a = random(2,12,2); + $b = $a; + $b = random(3,11,2) while(gcd($a,$b)!=1); + } +$c = Fraction($a,$b); +$ans = Compute("$var = -$c, $var = $c"); + +Context("FiniteSolutionSets"); +$ans = Formula("{-$c,$c}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$b**2][$var]^2 = [$a**2] `] + + [______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + [$b**2][$var]^2 = [$a**2] & \Rightarrow [$var]^2 = [$c**2]\\ + & \Rightarrow [$var]=-\sqrt{[$c**2]}\text{ or } [$var]=\sqrt{[$c**2]}\\ + & \Rightarrow [$var]=[$c*-1]\text{ or } [$var]=[$c]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad65.pg new file mode 100644 index 0000000000..d5e530d8a8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad65.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# a x^2 + $c = a * b^2 + $c +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is integer on [2,10], b is integer on [2,5] +# c is non-zero integer on [-10,10] +# +# Last updated: Hughes, 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','add','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +#Context()->variables->are($var=>'Real'); +$a = random(2,10,1); +$b = random(2,5,1); +$c = non_zero_random(-10,10,1); +$ans = List(Formula("$var=$b"),Formula("$var=-$b")); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$a][$var]^2 +[$c]= [$a*$b**2+$c] `] + + [__________________________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*. If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + [$a][$var]^2+[$c] = [$a*$b**2+$c] & \Rightarrow [$a][$var]^2 = [$a*$b**2]\\ + & \Rightarrow [$var]^2=[$b**2]\\ + & \Rightarrow [$var]=-\sqrt{[$b**2]}\text{ or } [$var]=\sqrt{[$b**2]}\\ + & \Rightarrow [$var]=[$b*-1]\text{ or } [$var]=[$b]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad70.pg new file mode 100644 index 0000000000..ac6d28dd92 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad70.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# b x^2 - a = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a and b are both prime numbers +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','prime','add') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "parserOneOf.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); +Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; + +# choose $a and $b +$a = list_random(2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67); +$b = $a; +$b = list_random(2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67) while($b==$a); + +# for the answer +$c = $a*$b; +$ans = List(Formula("$var=sqrt($c)/$b"), Formula("$var=-sqrt($c)/$b")); + +Context("FiniteSolutionSets"); +$ans = Formula("{sqrt($c)/$b,-sqrt($c)/$b}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$b][$var]^2 - [$a]= 0`] + + [_______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; + + + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + [$b][$var]^2-[$a] = 0& \Rightarrow [$b][$var]^2=[$a] \\ + & \Rightarrow [$var]^2=\frac{[$a]}{[$b]} \\ + & \Rightarrow [$var]= -\sqrt{\frac{[$a]}{[$b]}}\text{ or } [$var]=\sqrt{\frac{[$a]}{[$b]}}\\ + & \Rightarrow [$var]= -\frac{\sqrt{[$a]}}{\sqrt{[$b]}}\cdot\frac{\sqrt{[$b]}}{\sqrt{[$b]}}\text{ or } [$var]=\frac{\sqrt{[$a]}}{\sqrt{[$b]}}\cdot\frac{\sqrt{[$b]}}{\sqrt{[$b]}}\\ + & \Rightarrow [$var]= -\frac{\sqrt{[$c]}}{[$b]}\text{ or } [$var]=\frac{\sqrt{[$c]}}{[$b]}\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. We rationalized the denominator in each solution by multiplying by a factor of [`1`] using [`\frac{\sqrt{[$b]}}{\sqrt{[$b]}}`]. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad71.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad71.pg new file mode 100644 index 0000000000..4cec544c01 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad71.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# b x^2 + a = 0 +# +# The denominator needs to be rationalized. +# +# Last updated: Yao 12/08/2016 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "contextLimitedRadical.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + + + +do { + $b = list_random(2,3,5,7); + $aMinusC = list_random(2,3,5,7); +} until ($b!=$aMinusC); +$d = $b*$aMinusC; +$c = non_zero_random(-10,10,1); +$a = $c+$aMinusC; + + +$ans = Compute("$var = -sqrt($d)/$b, $var = sqrt($d)/$b"); + +Context("FiniteSolutionSets"); +$ans = Formula("{-sqrt($d)/$b,sqrt($d)/$b}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$a]-[$b][$var]^2 = [$c] `] + + [______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular type of problem is to use the _square root method_. + + [`` + \begin{aligned} + [$a]-[$b][$var]^2 &= [$c] \\ + [$a]-[$b][$var]^2 \mathbf{-[$a]} &= [$c] \mathbf{-[$a]} \\ + -[$b][$var]^2 &= [$c-$a] \\ + \frac{-[$b][$var]^2}{-[$b]} &= \frac{[$c-$a]}{-[$b]} \\ + [$var]^2 &= \frac{[$a-$c]}{[$b]} \\ + \sqrt{[$var]^2} &= \pm\sqrt{\frac{[$a-$c]}{[$b]}} \\ + [$var] &= \pm\frac{\sqrt{[$a-$c]}}{\sqrt{[$b]}} \\ + [$var] &= \pm\frac{\sqrt{[$a-$c]}\cdot\sqrt{[$b]}}{\sqrt{[$b]}\cdot\sqrt{[$b]}} \\ + [$var] &= \pm\frac{\sqrt{[$d]}}{[$b]} + \end{aligned} + ``] + + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad75.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad75.pg new file mode 100644 index 0000000000..9cdb26bad4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad75.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# b x^2 + a = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a and b are both prime numbers +# +# There are no real solutions to these equations. +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','prime','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +#Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); +Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$mymsg = "Are you sure your solution satisfies the equation?"; +Context()->{error}{msg}{"Unexpected character '='"} + = "$mymsg"; + +$var = "x"; +@primes = (2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67); +$index1 = random(0,$#primes,1); +$index2 = $index1; +$index2 = random(0,$#primes,1) while($index2==$index1); + +# choose $a and $b +$a = $primes[$index1]; +$b = $primes[$index2]; + +# for the answer + +Context("FiniteSolutionSets"); +$ans = Compute("no real solutions"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$b][$var]^2 + [$a]= 0`] + + [_______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + + +############################################## + +BEGIN_PGML_SOLUTION +Let's try to rearrange the equation so that [`[$var]`] is isolated + + [` + \begin{aligned} + [$b][$var]^2+[$a] = 0& \Rightarrow [$b][$var]^2=-[$a] \\ + & \Rightarrow [$var]^2=-\frac{[$a]}{[$b]} \\ + \end{aligned} + `] + +The square root of a negative number is _not_ real, so we conclude that there are *no real solutions* to this +equation. Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are _not_ real. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad80.pg new file mode 100644 index 0000000000..59d1c34555 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad80.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (x+a)^2 = * b^2 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is non-zero integer on [-10,10], +# b is integer on [2,12] +# +# Last updated: Hughes, 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','add','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); + +$var = "x"; +#Context()->variables->are($var=>'Real'); +$a = non_zero_random(-10,10,1); +$b = random(2,12,1); +$soln1 = $b-$a; +$soln2 = -$b-$a; +$ans = Formula("{$soln1,$soln2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` \left([$var]+[$a]\right)^2 = [$b**2] `] + + [__________________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; + + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + \left([$var]+[$a]\right)^2 = [$b**2]& \Rightarrow [$var]+[$a] = [$b]\text{ or } [$var]=[$b*-1]\\ + & \Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2] + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad81.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad81.pg new file mode 100644 index 0000000000..5292790ebc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad81.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# 10-2(x+a)^2 = -40 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is non-zero integer on [-10,10], +# b is integer on [2,12] +# +# Last updated: Yao 12/08/2016 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','add','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$c = random(2,6,1); +$factor = list_random(1,4,9); +$dMinusB = $c*$factor; +$b = non_zero_random(-10,10,1); +$d = $dMinusB+$b; +$a = non_zero_random(-10,10,1); + +$soln1 = sqrt($factor)-$a; +$soln2 = -sqrt($factor)-$a; +$ans = Formula("{$soln1,$soln2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$d] - [$c] ( [$var]+[$a] )^2 = [$b] `] + + [__________________________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; + + +############################################## + +$s1 = sqrt($factor); + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular type of problem is to use the _square root method_. + + [`` + \begin{aligned} + [$d] - [$c] ( [$var]+[$a] )^2 &= [$b] \\ + [$d] - [$c] ( [$var]+[$a] )^2 \mathbf{{}-[$d]} &= [$b] \mathbf{{}-[$d]} \\ + - [$c] ( [$var]+[$a] )^2 &= [$b-$d] \\ + \frac{- [$c] ( [$var]+[$a] )^2}{-[$c]} &= \frac{[$b-$d]}{-[$c]} \\ + ( [$var]+[$a] )^2 &= [$factor] \\ + \sqrt{( [$var]+[$a] )^2} &= \pm\sqrt{[$factor]} \\ + [$var]+[$a] &= \pm [$s1] \\ + [$var]+[$a] \mathbf{{}-[$a]} &= \pm [$s1] \mathbf{{}-[$a]} \\ + [$var] &= [$s1]-[$a] \text{ or } [$var]=-[$s1]-[$a] \\ + [$var] &= [$soln1] \text{ or } [$var]=[$soln2] + \end{aligned} + ``] + +Checking solutions is left as exercise. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad85.pg new file mode 100644 index 0000000000..d4132d5308 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad85.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (ax + b)^2 = c^2 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# The solutions are +# +# c-b -c-b +# --- , --- +# a a +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','fraction','subtract','divide') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFraction")->flags->set(reduceFractions => 0,showMixedNumbers=>0,showExtraParens=>0); + +$var = "x"; + +# b needs to be even +$b = random(2,10,2); + +# c can be either odd or even, but can't be equal to $b +$c = $b; +$c = random(3,12,1) while($c==$b); + +# choose a based on c being odd or even +if(2*round($c/2)==$c) +{ + # c is even so choose a to be odd + $a = 2*abs($c-$b); + $a = random(3,11,2) while(gcd(abs($c-$b),$a)>1 or gcd(abs(-$c-$b),$a)>1 ); +} +else +{ + # c is odd, so choose a to be even + $a = 2*abs($c-$b); + $a = random(2,12,2) while(gcd(abs($c-$b),$a)>1 or gcd(abs(-$c-$b),$a)>1 ); +} +$soln1 = Fraction(-$c-$b,$a); +$soln2 = Fraction($c-$b,$a); + +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1, $soln2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` \left([$a][$var]+[$b]\right)^2 = [$c**2] `] + + [______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + \left([$a][$var]+[$b]\right)^2 = [$c**2] & \Rightarrow [$a][$var]+[$b]=[$c*-1]\text{ or }[$a][$var]+[$b]=[$c]\\ + & \Rightarrow [$a][$var]=[$c*-1-$b]\text{ or }[$a][$var]=[$c-$b]\\ + & \Rightarrow [$var]=[$soln1]\text{ or } [$var]=[$soln2]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad90.pg new file mode 100644 index 0000000000..6460878f08 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad90.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (x + b)^2 = a +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a is prime, +# +# b is non-zero integer on [-10,10] and b!=a +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','prime','add','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); +Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = "x"; +@primes = (2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67); +$index1 = random(0,$#primes,1); + +# choose $a and $b +$a = $primes[$index1]; +$b = $a; +$b = non_zero_random(-10,10,1) while($b==$a); + +$c = -$b; +# the answer +$ans = List(Formula("$var=$c+sqrt($a)"), Formula("$var=$c-sqrt($a)")); + +Context("FiniteSolutionSets"); +$ans = Formula("{$c+sqrt($a),$c-sqrt($a)}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` ([$var]+[$b])^2 = [$a]`] + + [_______________________]{$ans} + +[@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _square root method_. + + [` + \begin{aligned} + ([$var]+[$b])^2 = [$a] & \Rightarrow [$var]+[$b]=-\sqrt{[$a]}\text{ or }[$var]+[$b]=\sqrt{[$a]}\\ + & \Rightarrow [$var]= [$b*-1]-\sqrt{[$a]}\text{ or }[$var]=[$b*-1]+\sqrt{[$a]} + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad95.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad95.pg new file mode 100644 index 0000000000..882df5450e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticEquations/solveQuad95.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Solve the following quadratic equation +# +# (x+a)(x+b) = 0 +# +# If you need to use the square root symbol, +# as in x=sqrt{17}, type it like: *sqrt(17)* +# +# a, b are non_zero integer on [-10,10]. +# +# Last updated: Hughes 8/4/13 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','add','subtract') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +$var = "x"; +#Context()->variables->are($var=>'Real'); +$a = non_zero_random(-12,12,1); +$b = $a; +$b = non_zero_random(-12,12,1) while($b==$a); +$soln1 = $a*-1; +$soln2 = $b*-1; +Context("FiniteSolutionSets"); +$ans = Formula("{$soln1,$soln2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` ([$var]+[$a])([$var]+[$b]) = 0 `] + + [_]{$ans}{20} + + +END_PGML + +############################################## + + + +############################################## + +BEGIN_PGML_SOLUTION +There are a few ways to solve quadratic equations- the easiest way to solve this particular +type of problem is to use the _zero product principle_. + + [` + \begin{aligned} + ([$var]+[$a])([$var]+[$b]) = 0 & \Rightarrow [$var]+[$a]=0 \text{ or } [$var]+[$b]=0\\ + & \Rightarrow [$var]=[$a*-1]\text{ or } [$var]=[$b*-1]\\ + \end{aligned} + `] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare10.pg new file mode 100644 index 0000000000..821178e298 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare10.pg @@ -0,0 +1,151 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following quadratic equation by completing the square +# +# x^2 + (a+b)x + ab = 0 +# +# (a+b) is even. +# +# Last updated: Carl Yao, 10/18/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + $a = non_zero_random(-12,12,1); + $b = $a; + $b = non_zero_random(-12,12,1) while($b==$a or $b==-$a); +} until ( ($a+$b)%2==0 ); +$soln1 = $a*-1; +$soln2 = $b*-1; +$ans = List(Formula("$var=$soln1"),Formula("$var=$soln2")); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the quadratic equation *by completing the square*. + +* Enter multiple answers separated by commas, such as [`x=1,x=-1`] +* If you need to use the square root symbol, +as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +* If there are no real solutions, enter *no real solutions* + + [` [$var]^2+[$a+$b][$var]+[$a*$b]= 0 `] + + [__________________________________] + + + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +$apb = $a+$b; +$func1 = Compute("$var**2+$apb*$var")->reduce; +$c = ($a+$b)/2; +$radical = $a*$b*-1+$c**2; +$d = sqrt($radical); + +BEGIN_PGML_SOLUTION + +There are easier ways to solve this quadratic equation, but we will solve it by the skill of "completing the square." + +First, we move the constant term to the other side of the equal sign: + + [`` +\begin{aligned} + [$var]^2+[$a+$b][$var]+[$a*$b] &= 0 \\ + [$var]^2+[$a+$b][$var] &= [$a*$b*-1] +\end{aligned} + ``] + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+...= ([$var]+[$c])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+[$c**2]= ([$var]+[$c])^{2} `]. + +To complete the square for [`[$func1]`], we need to do [`[$func1]+[$c**2]`]. + +The full solution is: + + [`` +\begin{aligned} + [$var]^2+[$a+$b][$var]+[$a*$b] &= 0 \\ + [$var]^2+[$a+$b][$var] &= [$a*$b*-1] \\ + [$var]^2+[$a+$b][$var] \mathbf{+[$c**2]} &= [$a*$b*-1] \mathbf{+[$c**2]} \\ + ([$var]+[$c])^{2} &= [$a*$b*-1+$c**2] \\ + \sqrt{([$var]+[$c])^{2}} &= \pm \sqrt{[$a*$b*-1+$c**2]} \\ + [$var]+[$c] &= \pm [$d] \\ + [$var]+[$c] = [$d] & \text{ or } [$var]+[$c] = [$d] \\ + [$var] = [$soln1] & \text{ or } [$var] = [$soln2] +\end{aligned} + ``] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare15.pg new file mode 100644 index 0000000000..8b3a53eaf9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare15.pg @@ -0,0 +1,158 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following quadratic equation by completing the square +# +# 2x^2 + (a+b)x + ab = 0 +# +# (a+b) is even. +# +# Last updated: Carl Yao, 1/11/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + $a = non_zero_random(-8,8,1); + $b = $a; + $b = non_zero_random(-8,8,1) while($b==$a or $b==-$a); +} until ( ($a+$b)%2==0 ); +$soln1 = $a*-1; +$soln2 = $b*-1; +$ans = List(Formula("$var=$soln1"),Formula("$var=$soln2")); + +$A = random(2,5,1); +$B = $A*($a+$b); +$C = $A*$a*$b; +$func = Compute("$A*$var**2+$B*$var+$C")->reduce; + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the quadratic equation *by completing the square*. + +* Enter multiple answers separated by commas, such as [`x=1,x=-1`] +* If you need to use the square root symbol, +as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +* If there are no real solutions, enter *no real solutions* + + [` [$func] = 0 `] + + [__________________________________] + + + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +$apb = $a+$b; +$func1 = Compute("$var**2+$apb*$var")->reduce; +$c = ($a+$b)/2; +$radical = $a*$b*-1+$c**2; +$d = sqrt($radical); + +BEGIN_PGML_SOLUTION + +There are easier ways to solve this quadratic equation, but we will solve it by the skill of "completing the square." + +We need to remove the leading coefficient first, and then move the constant term to the other side of the equal sign: + + [`` +\begin{aligned} + [$func] &= 0 \\ + \mathbf{\frac{1}{[$A]}\cdot} ([$func]) &= \mathbf{\frac{1}{[$A]}\cdot} 0 \\ + [$var]^2+[$a+$b][$var]+[$a*$b] &= 0 \\ + [$var]^2+[$a+$b][$var] &= [$a*$b*-1] +\end{aligned} + ``] + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+...= ([$var]+[$c])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+[$c**2]= ([$var]+[$c])^{2} `]. + +To complete the square for [`[$func1]`], we need to do [`[$func1]+[$c**2]`]. + +The full solution is: + + [`` +\begin{aligned} + [$var]^2+[$a+$b][$var]+[$a*$b] &= 0 \\ + [$var]^2+[$a+$b][$var] &= [$a*$b*-1] \\ + [$var]^2+[$a+$b][$var] \mathbf{+[$c**2]} &= [$a*$b*-1] \mathbf{+[$c**2]} \\ + ([$var]+[$c])^{2} &= [$a*$b*-1+$c**2] \\ + \sqrt{([$var]+[$c])^{2}} &= \pm \sqrt{[$a*$b*-1+$c**2]} \\ + [$var]+[$c] &= \pm [$d] \\ + [$var]+[$c] = [$d] & \text{ or } [$var]+[$c] = [$d] \\ + [$var] = [$soln1] & \text{ or } [$var] = [$soln2] +\end{aligned} + ``] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare20.pg new file mode 100644 index 0000000000..27476abc65 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare20.pg @@ -0,0 +1,166 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following quadratic equation by completing the square +# +# x^2 + (a+b)x + ab = 0 +# +# (a+b) is odd. +# +# Last updated: Carl Yao, 10/18/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + $a = non_zero_random(-5,5,1); + $b = $a; + $b = non_zero_random(-5,5,1) while($b==$a or $b==-$a); +} until ( ($a+$b)%2==1 ); + + +$c = $a+$b; +$d = $a*$b; +$func = Compute("$var**2+$c*$var+$d")->reduce; + +$cNeg = -$c; +$output1 = $c>0 ? "\frac{$c}{2}" : "-\frac{$cNeg}{2}"; +$output2 = $c>0 ? "+\frac{$c}{2}" : "-\frac{$cNeg}{2}"; +$output3 = $c>0 ? "-\frac{$c}{2}" : "+\frac{$cNeg}{2}"; + +$e = $c**2; + +$f = $a*$b*(-4)+$e; +$g = sqrt($f); + +$soln1 = ($g-$c)/2; +$soln2 = (-$g-$c)/2; +$ans = List(Formula("$var=$soln1"),Formula("$var=$soln2")); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the quadratic equation *by completing the square*. + +* Enter multiple answers separated by commas, such as [`x=1,x=-1`] +* If you need to use the square root symbol, +as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +* If there are no real solutions, enter *no real solutions* + + [` [$func] = 0 `] + + [__________________________________] + + + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +$apb = $a+$b; +$func1 = Compute("$var**2+$apb*$var")->reduce; + +BEGIN_PGML_SOLUTION + +There are easier ways to solve this quadratic equation, but we will solve it by the skill of "completing the square." + +First, we move the constant term to the other side of the equal sign: + + [`` +\begin{aligned} + [$func] &= 0 \\ + [$func1] &= [$a*$b*-1] \\ +\end{aligned} + ``] + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+...= ([$var][$output2])^2 `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+\frac{[$e]}{4}= ([$var][$output2])^{2} `]. + +To complete the square for [`[$func1]`], we need to do [`[$func1]+\frac{[$e]}{4}`]. + +The full solution is: + + [`` +\begin{aligned} + [$func] &= 0 \\ + [$func1] &= [$a*$b*-1] \\ + [$func1] \mathbf{+\frac{[$e]}{4}} &= [$a*$b*-1] \mathbf{+\frac{[$e]}{4}} \\ + ([$var][$output2])^{2} &= \frac{[$f]}{4} \\ + \sqrt{([$var][$output2])^{2}} &= \pm \sqrt{\frac{[$f]}{4}} \\ + [$var][$output2] &= \pm \frac{[$g]}{2} \\ + [$var][$output2] \mathbf{[$output3]} &= \pm \frac{[$g]}{2} \mathbf{[$output3]} \\ + [$var] &= \frac{\pm [$g] - [$c]}{2} \\ + [$var] = \frac{[$g] - [$c]}{2} & \text{ or } [$var] = \frac{-[$g] - [$c]}{2} \\ + [$var] = [$soln1] & \text{ or } [$var] = [$soln2] +\end{aligned} + ``] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare30.pg new file mode 100644 index 0000000000..44b779b907 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare30.pg @@ -0,0 +1,205 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following quadratic equation by completing the square +# +# 2x^2+x-3=0 +# +# Last updated: Carl Yao, 11/13/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','fraction','complete the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction")->flags->set(reduceFractions => 0,showMixedNumbers=>0,showExtraParens=>0); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + do { + $a = random(2,5,1); + $b = random(1,5,1); + } until ( gcd($a,$b)==1 ); + $b = $b*random(-1,1,2); + $c = random(1,5,1)*random(-1,1,2); + + $soln1 = Fraction(-$b,$a)->reduce; + $soln2 = Fraction(-$c,1)->reduce; + $ans = Compute("$var = $soln1, $var = $soln2"); + + $d = $a*$c+$b; + $e = $b*$c; +} until ( (abs($d)<5) ); +$func = Compute("$a*$var**2+$d*$var+$e")->reduce; +$func1 = Compute("$a*$var**2+$d*$var")->reduce; + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the quadratic equation by the skill of *completing the square*: + +* Enter multiple answers separated by commas, such as [`x=1,x=-1`] +* If you need to use the square root symbol, +as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +* If there are no real solutions, enter *no real solutions* + + [` [$func] = 0 `] + + [______________________] + + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp( + entry_type => "a solution", + checker => sub { + my ($correct,$student,$ans,$nth,$value) = @_; + if ($correct->type eq "Assignment") { + my ($svar,$sfrac) = $student->value; # get the variable and fraction + if(Value::classMatch($sfrac,'Fraction')) + { + return 0 unless $sfrac->isReduced; + } + } + return $correct == $student; + }, + extra => sub { + my ($student,$ansHash,$nth,$value) = @_; + if($student eq "no real solutions") + { + $student->context->setError("This equation does have some solutions- try using the square root method","",undef,undef,$Value::CMP_WARNING) + unless $ans->{isPreview}; + return; + } + if ($student->type ne "Assignment" && $ansHash->{student_formula}->type ne "Assignment") { + $student->context->setError("Your $nth solution should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) + unless $ans->{isPreview}; + return; + } + my ($svar,$sfrac) = $student->value; # get the variable and fraction + if (Value::classMatch($sfrac,'Fraction') && !$sfrac->isReduced) { + $student->context->setError("Your $nth $value is not reduced","",undef,undef,$Value::CMP_WARNING) + unless $ans->{isPreview}; + return; + } + return Value::Real->typeMatch($student); + } +)->withPostFilter(AnswerHints( + ["$var=$soln1","$var=$soln2"] => "Are you sure you have all the solutions?", + [$soln1,$soln2] => ["Your solution is a correct one, but you should write $var = $US$US$US
    Are you sure you have all the solutions?",replaceMessage=>1], + ["$soln1,$soln2","$soln1,$soln2"] => ["Your solutions are correct, but you should write $var = $US$US$US",replaceMessage=>1], +))); + +############################################## + +$fracB = Fraction($d,$a)->reduce; +$fracC = Fraction($e,$a)->reduce; + +$func2 = Compute("$var**2+$fracB*$var+$fracC")->reduce; +$func3 = Compute("$var**2+$fracB*$var")->reduce; +$frac4 = (-$fracC)->reduce; + +$frac5 = ($fracB/2)->reduce; +$func4 = Compute("($var+$frac5)**2")->reduce; +$frac6 = ($frac5*$frac5)->reduce; +$func5 = Compute("$var**2+$fracB*$var+($frac5)**2")->reduce; + +$func6 = Compute("$var+$frac5")->reduce; + +$frac1 = -$e + Fraction($d**2,$a*4); +$frac2 = ($frac4+$frac6)->reduce; +$frac3 = sqrt($frac2)->reduce; + +$frac7 = ($frac3-$frac5)->reduce; +$frac8 = (-$frac3-$frac5)->reduce; + +BEGIN_PGML_SOLUTION + +There are easier ways to solve this quadratic equation, but we will solve it by the skill of "completing the square." + +For this problem, we need to get rid of the leading coefficient [`[$a]`] by: + + [`` +\begin{aligned} + [$func] &= 0 \\ + \frac{1}{[$a]}([$func]) &= \frac{1}{[$a]} \cdot 0 \\ + [$func2] &= 0 \\ + [$func3] &= [$frac4] +\end{aligned} + ``] + +Next, we complete the square for the part [` [$func3] `]. + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func3]+...= [$func4] `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func5] = [$func4] `]. + +The full solution is: + + [`` +\begin{aligned} + [$func] &= 0 \\ + \frac{1}{[$a]}([$func]) &= \frac{1}{[$a]} \cdot 0 \\ + [$func2] &= 0 \\ + [$func3] &= [$frac4] \\ + [$func3] \mathbf{+[$frac6]} &= [$frac4] \mathbf{+[$frac6]} \\ + [$func4] &= [$frac2] \\ + [$func6] &= \pm \sqrt{[$frac2]} \\ + [$func6] &= [$frac3] \: \text{ or } \: [$func6] = -[$frac3] \\ + [$var] &= [$frac7] \: \text{ or } \: [$var] = [$frac8] +\end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare40.pg new file mode 100644 index 0000000000..a98e1f1849 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare40.pg @@ -0,0 +1,153 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following quadratic equation by completing the square +# +# x^2-2x+1=3 +# +# Last updated: Carl Yao, 11/13/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','complete the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + , + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); +Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +@primes = (2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67); +$index1 = random(0,$#primes,1); + +# choose $a and $b +$a = $primes[$index1]; +$b = $a; +$b = non_zero_random(-10,10,1) while($b==$a); + +$c = -$b; +# the answer +$ans = List(Formula("$var=$c+sqrt($a)"),Formula("$var=$c-sqrt($a)")); + +$d = -2*$c; +$e = $c**2-$a; +$func = Compute("$var**2+$d*$var+$e")->reduce; + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the quadratic equation by the skill of *completing the square*: + +* Enter multiple answers separated by commas, such as [`x=1,x=-1`] +* If you need to use the square root symbol, +as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +* If there are no real solutions, enter *no real solutions* + + [` [$func] = 0 `] + + [______________________] + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +$func1 = Compute("$var**2+$d*$var")->reduce; + +BEGIN_PGML_SOLUTION + +There are easier ways to solve this quadratic equation, but we will solve it by the skill of "completing the square." + +First, we move the constant term to the other side of the equal sign: + + [`` +\begin{aligned} + [$func] &= 0 \\ + [$func1] &= [$e*-1] \\ +\end{aligned} + ``] + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+...= ([$var]-[$c])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$var]^{2}+[$c*-2][$var]+[$c**2]= ([$var]-[$c])^{2} `]. + +To complete the square for [`[$func1]`], we need to do [`[$func1]+[$c**2]`]. + +The full solution is: + + [`` +\begin{aligned} + [$func] &= 0 \\ + [$func1] &= [$e*-1] \\ + [$func1] \mathbf{+[$c**2]} &= [$e*-1] \mathbf{+[$c**2]} \\ + ([$var]-[$c])^{2} &= [$a] \\ + \sqrt{([$var]-[$c])^{2}} &= \pm \sqrt{[$a]} \\ + [$var]-[$c] &= \pm \sqrt{[$a] }\\ + [$var]-[$c] = \sqrt{[$a]} & \text{ or } [$var]-[$c] = -\sqrt{[$a]} \\ + [$var] = [$c]+\sqrt{[$a]} & \text{ or } [$var] = [$c]-\sqrt{[$a]} +\end{aligned} + ``] + +Note that _all_ quadratic equations have *two* (possibly repeated) solutions; in this problem both solutions are real. Each solution can be checked by substituting it into the original equation- this is left as an exercise. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare45.pg new file mode 100644 index 0000000000..67bc1d0d6c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare45.pg @@ -0,0 +1,143 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following quadratic equation by completing the square +# +# there are no real solutions +# +# Last updated: Carl Yao, 1/10/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','complete the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); +Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +do { + $b = non_zero_random(-10,10,2); + $c= non_zero_random(-10,10,1); +} until ($b**2-4*$c<0); +# the answer +$ans = Compute("no real solution"); + +$func = Compute("$var**2+$b*$var+$c")->reduce; + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the quadratic equation by the skill of *completing the square*: + +* Enter multiple answers separated by commas, such as [`x=1,x=-1`] +* If you need to use the square root symbol, +as in [`x=\sqrt{17}`], type it using: *sqrt(17)* +* If there are no real solutions, enter *no real solutions* + + [` [$func] = 0 `] + + [______________________] + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +$func1 = Compute("$var**2+$b*$var")->reduce; +$d = ($b/2)**2; +$e = -$c+$d; + +BEGIN_PGML_SOLUTION + +There are easier ways to solve this quadratic equation, but we will solve it by the skill of "completing the square." + +First, we move the constant term to the other side of the equal sign: + + [`` +\begin{aligned} + [$func] &= 0 \\ + [$func1] &= [$c*-1] \\ +\end{aligned} + ``] + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+...= ([$var]+[$b*0.5])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+[$d]= ([$var]+[$b*0.5])^{2} `]. + +To complete the square for [`[$func1]`], we need to do [`[$func1]+[$d]`]. + +The full solution is: + + [`` +\begin{aligned} + [$func] &= 0 \\ + [$func1] &= [$c*-1] \\ + [$func1] \mathbf{+[$d]} &= [$c*-1] \mathbf{+[$d]} \\ + ([$var]+[$b])^{2} &= [$e] \\ +\end{aligned} + ``] + +Since the square of a number cannot be negative, this equation has no real solution. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare46.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare46.pg new file mode 100644 index 0000000000..19fc70336b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare46.pg @@ -0,0 +1,145 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Solve the following quadratic equation by completing the square +# +# there are no real solutions +# +# Last updated: Carl Yao, 1/10/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root','complete the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadicalComplex.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadicalComplex"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->flags->set( + reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); +Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +do { + $comB = random(1,10,1); + $rad = -$comB**2; + $b = non_zero_random(-10,10,2); + $d = $b/2; + $e = $d**2; + $c = $e+$comB**2; +} until ($b**2-4*$c<0); + +$ans = List(Formula("$var=-$d+$comB*i")->reduce,Formula("$var=-$d-$comB*i")->reduce); + +$func = Compute("$var**2+$b*$var+$c")->reduce; + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the quadratic equation by the skill of *completing the square*. There could be complex solutions. + +* Enter multiple answers separated by commas, such as [`x=1,x=-1`] + + [` [$func] = 0 `] + + [______________________] + +END_PGML + +############################################## + + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + +$func1 = Compute("$var**2+$b*$var")->reduce; + +BEGIN_PGML_SOLUTION + +There are easier ways to solve this quadratic equation, but we will solve it by the skill of "completing the square." + +First, we move the constant term to the other side of the equal sign: + + [`` +\begin{aligned} + [$func] &= 0 \\ + [$func1] &= [$c*-1] \\ +\end{aligned} + ``] + + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+...= ([$var]+[$b*0.5])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+[$e]= ([$var]+[$b*0.5])^{2} `]. + +To complete the square for [`[$func1]`], we need to do [`[$func1]+[$e]`]. + +The full solution is: + + [`` +\begin{aligned} + [$func] &= 0 \\ + [$func1] &= [$c*-1] \\ + [$func1] \mathbf{+[$e]} &= [$c*-1] \mathbf{+[$e]} \\ + ([$var]+[$d])^{2} &= [$rad] \\ + \sqrt{([$var]+[$d])^{2}} &= \pm\sqrt{[$rad]} \\ + [$var] + [$d] &= \pm\sqrt{[$rad*-1]}\cdot\sqrt{-1} \\ + [$var] + [$d] &= \pm[$comB]i \\ + [$var] &= [$d*-1]\pm[$comB]i \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare50.pg new file mode 100644 index 0000000000..fef17103a6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare50.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form. +# No fractions are involved. +# +# f(x) = x^2 + ax + b +# +# a is even. +# +# Last updated: Carl Yao, 11/13/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +$vertexX = non_zero_random(-10,10,1); +$vertexY = non_zero_random(-10,10,1); + +$ans = Compute("(x-$vertexX)**2+$vertexY")->reduce; + +$b = -2*$vertexX; +$c = $vertexX**2+$vertexY; +$func = Compute("x**2+$b*x+$c")->reduce; + +Context("Point"); +$vertex = Point($vertexX,$vertexY); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Convert the the formula [` f(x) = [$func] `] standard form to vertex form by completing the square. Then find this parabola's vertex. + + [`f(x)=`][____________________]{$ans} + + The parabola's vertex is [_____________]{$vertex}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +One way to change a quadratic function from standard form to vertex form is to use the skill of "completing the square." + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2+[$b]x+...= (x+[$b/2])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2+[$b]x+[$b**2/4]=(x+[$b/2])^{2}`]. + +The full solution is: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= x^{2}+[$b]x+[$b**2/4] -[$b**2/4] +[$c] \\ + &= (x+[$b/2])^{2} -[$b**2/4] +[$c] \\ + &= (x+[$b/2])^{2} +[$c-$b**2/4] \\ +\end{aligned} + ``] + +Once we change the function's equation to vertex form, we can see the parabola's vertex is [`[$vertex]`]. + + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare51.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare51.pg new file mode 100644 index 0000000000..6e79e62e89 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare51.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form. +# No fractions are involved. +# +# f(x) = -x^2 + ax + b +# +# a is even. +# +# Last updated: Carl Yao, 11/13/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +$vertexX = non_zero_random(-10,10,1); +$vertexY = non_zero_random(-10,10,1); + +$ans = Compute("-(x-$vertexX)**2+$vertexY")->reduce; + +$b = 2*$vertexX; +$c = -$vertexX**2+$vertexY; +$func = Compute("-x**2+$b*x+$c")->reduce; + +Context("Point"); +$vertex = Point($vertexX,$vertexY); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +With the skill of "completing the square," convert this quadratic function from standard form to vertex form, and then find this parabola's vertex. + + [` f(x) = [$func] `] + + [`f(x)=`][____________________]{$ans} + + The parabola's vertex is [_____________]{$vertex}. + + +END_PGML + +############################################## + +$func1 = Compute("x**2-$b*x")->reduce; + +BEGIN_PGML_SOLUTION + +We have to factor out the leading negative sign first: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= -([$func1])+[$c] \\ +\end{aligned} + ``] + +One way to change a quadratic function from standard form to vertex form is to use the skill of "completing the square." + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2-[$b]x+...= (x-[$b/2])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2-[$b]x+[$b**2/4]=(x-[$b/2])^{2}`]. + +The full solution is: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= -([$func1])+[$c] \\ + &= -(x^{2}-[$b]x+[$b**2/4] -[$b**2/4]) +[$c] \\ + &= -[(x-[$b/2])^{2} -[$b**2/4]] +[$c] \\ + &= -(x-[$b/2])^{2} +[$b**2/4] +[$c] \\ + &= -(x-[$b/2])^{2} +[$c+$b**2/4] \\ +\end{aligned} + ``] + +Once we change the function's equation to vertex form, we can see the parabola's vertex is [`[$vertex]`]. + + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare55.pg new file mode 100644 index 0000000000..ac5a8e18d0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare55.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form. +# No fractions are involved. +# +# f(x) = 2x^2 + ax + b +# +# a is even. +# +# Last updated: Carl Yao, 1/11/2016 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +$vertexX = non_zero_random(-10,10,1); +$vertexY = non_zero_random(-10,10,1); + +$a = random(2,5,1); +$ans = Compute("$a*(x-$vertexX)**2+$vertexY")->reduce; + +$b = -2*$a*$vertexX; +$c = $a*$vertexX**2+$vertexY; +$func = Compute("$a*x**2+$b*x+$c")->reduce; + +Context("Point"); +$vertex = Point($vertexX,$vertexY); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +With the skill of "completing the square," convert this quadratic function from standard form to vertex form, and then find this parabola's vertex. + + [` f(x) = [$func] `] + + [`f(x)=`][____________________]{$ans} + + The parabola's vertex is [_____________]{$vertex}. + + +END_PGML + +############################################## + +$newB = $b/$a; +$func1 = Compute("x**2+$newB*x")->reduce; + +BEGIN_PGML_SOLUTION + +We have to factor out the leading coefficient [`[$a]`] first: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= [$a]([$func1])+[$c] \\ +\end{aligned} + ``] + +One way to change a quadratic function from standard form to vertex form is to use the skill of "completing the square." + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2+[$newB]x+...= (x+[$newB/2])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2+[$newB]x+[$newB**2/4]=(x+[$newB/2])^{2}`]. + +The full solution is: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= [$a]([$func1])+[$c] \\ + &= [$a](x^{2}+[$newB]x+[$newB**2/4] -[$newB**2/4]) +[$c] \\ + &= [$a][(x+[$newB/2])^{2} -[$newB**2/4]] +[$c] \\ + &= [$a](x+[$newB/2])^{2} -[$a*$newB**2/4] +[$c] \\ + &= [$a](x+[$newB/2])^{2} +[$c-$a*$newB**2/4] \\ +\end{aligned} + ``] + +Once we change the function's equation to vertex form, we can see the parabola's vertex is [`[$vertex]`]. + + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare56.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare56.pg new file mode 100644 index 0000000000..858e503bab --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare56.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form. +# No fractions are involved. +# +# f(x) = -2x^2 + ax + b +# +# a is even. +# +# Last updated: Carl Yao, 1/11/2016 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +$vertexX = non_zero_random(-10,10,1); +$vertexY = non_zero_random(-10,10,1); + +$a = -random(2,5,1); +$ans = Compute("$a*(x-$vertexX)**2+$vertexY")->reduce; + +$b = -2*$a*$vertexX; +$c = $a*$vertexX**2+$vertexY; +$func = Compute("$a*x**2+$b*x+$c")->reduce; + +Context("Point"); +$vertex = Point($vertexX,$vertexY); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +With the skill of "completing the square," convert this quadratic function from standard form to vertex form, and then find this parabola's vertex. + + [` f(x) = [$func] `] + + [`f(x)=`][____________________]{$ans} + + The parabola's vertex is [_____________]{$vertex}. + + +END_PGML + +############################################## + +$newB = $b/$a; +$func1 = Compute("x**2+$newB*x")->reduce; + +BEGIN_PGML_SOLUTION + +We have to factor out the leading coefficient [`[$a]`] first: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= [$a]([$func1])+[$c] \\ +\end{aligned} + ``] + +One way to change a quadratic function from standard form to vertex form is to use the skill of "completing the square." + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2+[$newB]x+...= (x+[$newB/2])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2+[$newB]x+[$newB**2/4]=(x+[$newB/2])^{2}`]. + +The full solution is: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= [$a]([$func1])+[$c] \\ + &= [$a](x^{2}+[$newB]x+[$newB**2/4] -[$newB**2/4]) +[$c] \\ + &= [$a][(x+[$newB/2])^{2} -[$newB**2/4]] +[$c] \\ + &= [$a](x+[$newB/2])^{2} -[$a*$newB**2/4] +[$c] \\ + &= [$a](x+[$newB/2])^{2} +[$c-$a*$newB**2/4] \\ +\end{aligned} + ``] + +Once we change the function's equation to vertex form, we can see the parabola's vertex is [`[$vertex]`]. + + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare60.pg new file mode 100644 index 0000000000..907cfd75b5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare60.pg @@ -0,0 +1,146 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form. +# Fractions are involved. +# +# f(x) = x^2 + ax + b +# +# a is even. +# +# Last updated: Carl Yao, 11/13/2014 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); + +$b = random(-5,5,2); +$c = non_zero_random(-10,10,1); + +$vertexX = Fraction($b,2); +$vertexY = Fraction(4*$c-$b**2,4); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0,); +$ans = Compute("(x+$vertexX)**2+$vertexY"); + +$func = Compute("x**2+$b*x+$c")->reduce; + + +############################################## + +BEGIN_PGML + +With the skill of "completing the square," convert this quadratic function from standard form to vertex form, and then find this parabola's vertex. + +Use fractions in your answer. Don't use decimals. + + [` f(x) = [$func] `] + + [`f(x)=`][____________________]{$ans} + + The parabola's vertex is [_____________]. + + +END_PGML + +############################################## + +Context("Fraction-NoDecimals"); +Context()->{precedence}{Fraction} = 2.5; +Context()->flags->set(reduceFractions=>0, + allowMixedNumbers=>1, + requirePureFractions=>1, + showExtraParens=>0, + reduceConstants=>0, + ); + +Context()->parens->set('('=>{type=>'Point'}); +$vertex = List("(-$vertexX,$vertexY)"); +ANS($vertex->cmp( + checker => sub { + my ($correct, $student, $ans, $nth, $value) = @_; + $student->context->setError("Your $nth $value contains an unreduced fraction","",undef,undef,$Value::CMP_WARNING) + if $student->{notReduced}; + return 0 unless $correct == $student; + my $reduced = 1; + foreach $x ($student->value) { + if (Value::classMatch($x,'Fraction') && !$x->isReduced) { + $reduced = 0; + break; + } + } + $student->{notReduced} = 1 unless $reduced || $ans->{isPreview}; + return $reduced; + } + ) +); + +############################################## + +$func1 = Compute("x**2+$b*x")->reduce; + +$absB = abs($b); +$output1 = $b>0 ? "\frac{$b}{2}" : "-\frac{$absB}{2}"; +$output2 = $b>0 ? "+\frac{$b}{2}" : "-\frac{$absB}{2}"; + +$absC = abs(4*$c-$b**2); +$output3 = 4*$c-$b**2>0 ? "+\frac{$absC}{4}" : "-\frac{$absC}{4}"; + +############################################## + +BEGIN_PGML_SOLUTION + +One way to change a quadratic function from standard form to vertex form is to use the skill of "completing the square." + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+...= (x [$output2])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$func1]+\frac{[$b**2]}{4}=(x[$output2])^{2} `]. + +The full solution is: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= [$func1]+\frac{[$b**2]}{4} -\frac{[$b**2]}{4} +[$c] \\ + &= (x[$output2])^{2} -\frac{[$b**2]}{4} +[$c] \\ + &= (x[$output2])^{2} [$output3] \\ +\end{aligned} + ``] + +Once we change the function's equation to vertex form, we can see the parabola's vertex is [`[$vertex]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare70.pg new file mode 100644 index 0000000000..7d355b969a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/CompleteSquare70.pg @@ -0,0 +1,167 @@ +# WeBWorK problem written by Carl Yao, 2015 +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form. +# Fractions are involved. +# +# f(x) = ax^2 + bx + c +# +# a is even. +# +# Last updated: Carl Yao, 09/30/2015 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); + +Context()->variables->are(x=>"Real",y=>"Real"); +$var = 'x'; + +do { + $a = random(2,5,1); + $b = random(1,5,1); +} until ( gcd($a,$b)==1 ); +$b = $b*random(-1,1,2); +$c = random(1,5,1)*random(-1,1,2); + +$vertexX = Fraction($b,2*$a); +$vertexY = Fraction(4*$a*$c-$b**2,4*$a); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0,); +$ans = Compute("$a*(x+$vertexX)**2+$vertexY"); + +$func = Compute("$a*x**2+$b*x+$c")->reduce; +$func1 = Compute("$a*x**2+$b*x")->reduce; + +############################################## + +BEGIN_PGML + +With the skill of "completing the square," convert this quadratic function from standard form to vertex form, and then find this parabola's vertex. + +Use fractions in your answer. Don't use decimals. + + [` f(x) = [$func] `] + + [`f(x)=`][____________________]{$ans} + + The parabola's vertex is [_____________]. + + +END_PGML + +############################################## + +Context("Fraction-NoDecimals"); +Context()->{precedence}{Fraction} = 2.5; +Context()->flags->set(reduceFractions=>0, + allowMixedNumbers=>1, + requirePureFractions=>1, + showExtraParens=>0, + reduceConstants=>0, + ); + +Context()->parens->set('('=>{type=>'Point'}); +$vertex = List("(-$vertexX,$vertexY)"); +ANS($vertex->cmp( + checker => sub { + my ($correct, $student, $ans, $nth, $value) = @_; + $student->context->setError("Your $nth $value contains an unreduced fraction","",undef,undef,$Value::CMP_WARNING) + if $student->{notReduced}; + return 0 unless $correct == $student; + my $reduced = 1; + foreach $x ($student->value) { + if (Value::classMatch($x,'Fraction') && !$x->isReduced) { + $reduced = 0; + break; + } + } + $student->{notReduced} = 1 unless $reduced || $ans->{isPreview}; + return $reduced; + } + ) +); + +############################################## + +$output1 = Compute("$a*(x**2+$b/$a*x)")->reduce; +$output2 = Compute("x**2+$b/$a*x")->reduce; +$output3 = Fraction($b,2*$a)->reduce; +$output4 = Compute("(x+$output3)**2")->reduce; +$output5 = Compute("(x+$output3)(x+$output3)")->reduce; +$frac1 = Fraction($b**2,4*$a**2)->reduce; +$output6 = Compute("x**2+$b/$a x+$frac1")->reduce; +$output7 = Compute("$a*(x**2+$b/$a*x)+$c")->reduce; +$output8 = Compute("$a*(x**2+$b/$a*x+$frac1-$frac1)+$c")->reduce; +$output9 = Compute("$a*((x+$output3)**2-$frac1)+$c")->reduce; +$frac2 = $a*$frac1->reduce; +$output10 = Compute("$a*(x+$output3)**2-$frac2+$c")->reduce; +$frac3 = $c-$frac2->reduce; +$output11 = Compute("$a*(x+$output3)**2+$frac3")->reduce; + +############################################## + +BEGIN_PGML_SOLUTION + +First, we need to change this quadratic function from standard form, [`f(x)=a x^2+bx+c`], to vertex form, [`f(x)=a(x+d)^2+e`]. + +For this problem, we need to factor out the coefficient in front of [` x^{2} `] first: + + [`` [$func1] = [$output1] ``] + +and then complete the square for the part [` [$output2] `]. + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$output2]+...= [$output4] `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`[$output2]+[$frac1]= [$output4] `]. + +The full solution is: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= [$output7] \\ + &= [$output8] \\ + &= [$output9] \\ + &= [$output10] \\ + &= [$output11] +\end{aligned} + ``] + +Once we change the function's equation to vertex form, we can see the parabola's vertex is [`[$vertex]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange10.pg index b1f2fbd849..0082960a29 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange10.pg @@ -14,13 +14,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Completing the square) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange20.pg new file mode 100644 index 0000000000..8310c08311 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange20.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Carl Yao, 2014 +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form, +# and the find the function's domain and range. +# No fractions are involved. +# +# f(x) = -x^2 + ax + b +# +# a is even. +# +# Last updated: Carl Yao, 1/11/2016 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +$vertexX = non_zero_random(-10,10,1); +$vertexY = non_zero_random(-10,10,1); + +$ans = Compute("(x-$vertexX)**2+$vertexY")->reduce; + +$b = 2*$vertexX; +$c = -$vertexX**2+$vertexY; +$func = Compute("-x**2+$b*x+$c")->reduce; + +Context("Point"); +$vertex = Point($vertexX,$vertexY); + +Context("Interval"); +$domain = Compute("(-infinity,infinity)"); +$range = Compute("(-infinity,$vertexY]"); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Complete the square to convert the quadratic function from standard form to vertex form, and use the result to find the function's domain and range. + +[@KeyboardInstructions('Use interval notation. Type [|inf|]* to represent [`\infty`]')@]** + + [` f(x) = [$func] `] + + The domain of [`f`] is [______________]{$domain} + + The range of [`f`] is [______________]{$range} + +END_PGML + +############################################## + +$func1 = Compute("x**2-$b*x")->reduce; + +BEGIN_PGML_SOLUTION + +We have to factor out the leading negative sign first: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= -([$func1])+[$c] \\ +\end{aligned} + ``] + +One way to change a quadratic function from standard form to vertex form is to use the skill of "completing the square." + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2-[$b]x+...= (x-[$b/2])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2-[$b]x+[$b**2/4]=(x-[$b/2])^{2}`]. + +The full solution is: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= -([$func1])+[$c] \\ + &= -(x^{2}-[$b]x+[$b**2/4] -[$b**2/4]) +[$c] \\ + &= -[(x-[$b/2])^{2} -[$b**2/4]] +[$c] \\ + &= -(x-[$b/2])^{2} +[$b**2/4] +[$c] \\ + &= -(x-[$b/2])^{2} +[$c+$b**2/4] \\ +\end{aligned} + ``] + +Once we change the function's equation to vertex form, we can see the parabola's vertex is [`[$vertex]`]. This parabola faces down because its leading coefficient is negative. + +With this information, we can determine its domain and range: + + domain: [`[$domain]`] + + range: [`[$range]`] + + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange30.pg index dda600b370..2c59da3c01 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange30.pg @@ -14,13 +14,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Forms: vertex, factored, general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange40.pg index 362354062a..971587be57 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange40.pg @@ -14,13 +14,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Forms: vertex, factored, general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms10.pg new file mode 100644 index 0000000000..5b175e5ab0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms10.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Template: +# Convert a quadratic function among standard, factored and vertex forms. +# +# Last updated: Hughes, 6/22/13 +# ENDDESCRIPTION + +## DBCC('') +## DBsubject('Algebra') +## DBchapter('Quadratic equations and functions') +## DBsection('Forms: vertex, factored, general') +## KEYWORDS('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextLimitedFactor.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +# +# Vertex form +# +Context("Numeric"); +$n = random(2,8,2); +$a = non_zero_random(-5,5,1); +$b = ($a+$n); +$h = ($b-$a)/2; +$k = $h**2+$a*$b; +$vertexform = Compute("(x-$h)^2-$k")->reduce; + +# +# Expanded form +# +Context("LimitedPolynomial-Strict"); +$p[0] = $h**2 - $k; +$p[1] = 2*$h; +$expandedform = Formula("x^2 - $p[1] x + $p[0]")->reduce; + +# +# Factored form +# +Context("LimitedFactor"); +$factoredform = Formula("(x+$a)(x-$b)")->reduce; + +############################################## + +BEGIN_PGML + +The quadratic expression [`[$vertexform]`] is written in vertex form. + +a. Write the expression in standard form. + + [_________________]{$expandedform} + +b. Write the expression in factored form. + + [_________________]{$factoredform} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +a. If we expand the given polynomial: + + [`\begin{aligned} [$vertexform] & = (x-[$h])(x-[$h])-[$k]\\ +&= x^2-[$h]x-[$h]x+[$h]^2-[$k]\\ +&= [$expandedform]\end{aligned}`] + +b. One way to find the factored form is to examine the expanded form, and factor it in the usual way. Here we look for two numbers that multiply to [@$p[0]@] and add to [@-1*$p[1]@]. Two such numbers are [@$a@] and [@-1*$b@]. Since the leading coefficient is [`1`], these two numbers are the constant terms of two factors. And the factored form is + + [`[$factoredform]`] + + Another way to find the factored form is to find the roots of the polynomial. If we set the vertex form equal to [`0`], we find + + [`\begin{aligned} [$vertexform] &= 0\\ +(x-[$h])^2&=[$k]\\ +x-[$h]&= [@sqrt($k)@]&&\text{or }&x-[$h]&=-[@sqrt($k)@]\\ +x&=[$b]&&\text{or }&x&=-[$a]\end{aligned}`] + + With these two roots, the factored form of the equation must be + + [`k(x-(-[$a]))(x-[$b])`] + + Since the leading coefficient is [`1`], [`k`] must be [`1`], and the factored form is [`[$factoredform]`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms20.pg new file mode 100644 index 0000000000..61b0359846 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms20.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Convert a quadratic function among standard, factored and vertex forms. +# +# Last updated: Yao, 8/18/16 +# ENDDESCRIPTION + +## DBCC('') +## DBsubject('Algebra') +## DBchapter('Quadratic equations and functions') +## DBsection('Forms: vertex, factored, general') +## KEYWORDS('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextLimitedFactor.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +# +# Vertex form +# +Context("Numeric"); +$n = list_random(4,6); +$a = random(2,4,1); +$b = ($a+$n); +$h = ($b-$a)/2; +$k = $h**2+$a*$b; +$vertexform = Compute("(x-$h)^2-$k"); + +# +# Expanded form +# +Context("LimitedPolynomial-Strict"); +$p0 = $h**2 - $k; +$p1 = -2*$h; +$expandedform = Formula("x^2 + $p1 x + $p0")->reduce; + +# +# Factored form +# +Context("LimitedFactor"); +$factoredform = Formula("(x+$a)(x-$b)"); + +############################################## + +BEGIN_PGML + +The quadratic expression [`[$expandedform]`] is written in standard form. + +a. Write the expression in vertex form [`a(x-h)^2+k`]. + + [_________________]{$vertexform} + +b. Write the expression in factored form [`k(ax+b)(cx+d) `]. + + [_________________]{$factoredform} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +*Part a*: To change this function from standard form to vertex form, we will use the skill of "completing the square." + +To use the skill of "completing the square," we need to use the perfect square formula: + + [`` x^2+2ax+a^2 = (x+a)^2 ``] + +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2+[$p1]x+...= (x+[$p1/2])^{2} `]. + +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2+[$p1]x+[$p1**2/4]= (x+[$p1/2])^{2} `]. + +The full solution is: + + [`` +\begin{aligned} + f(x) &= [$expandedform] \\ + &= x^{2}+[$p1]x+[$p1**2/4] -[$p1**2/4] +[$p0] \\ + &= (x+[$p1/2])^{2} -[$p1**2/4] +[$p0] \\ + &= (x+[$p1/2])^{2} +[$p0-$p1**2/4] \\ +\end{aligned} + ``] + +*Part b*: We can simply factor [`[$expandedform]`] into [`[$factoredform]`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms30.pg index bac61dbd7d..fda57eda46 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms30.pg @@ -7,12 +7,12 @@ # ENDDESCRIPTION ## DBCC('') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Forms: vertex, factored, general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Quadratic equations and functions') +## DBsection('Forms: vertex, factored, general') +## KEYWORDS('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -24,7 +24,7 @@ loadMacros( "contextLimitedPolynomial.pl", "contextLimitedFactor.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -82,27 +82,13 @@ BEGIN_PGML_SOLUTION *Part b*: Next, to change this function from standard form to vertex form, we will use the skill of "completing the square." -we need to observe a pattern first: +To use the skill of "completing the square," we need to use the perfect square formula: - [`` -\begin{aligned} - (x+1)^{2} &= x^{2}+2x+1 \\ - (x+2)^{2} &= x^{2}+4x+4 \\ - (x+3)^{2} &= x^{2}+6x+9 \\ - (x+4)^{2} &= x^{2}+8x+16 \\ - ... -\end{aligned} - ``] - -The pattern is: - - [`` (x+a)^{2} = x^2+2ax+a^2 ``] - -Note that the coefficient in front of the [`x`] term is always twice of [`a`] inside the parenthesis. + [`` x^2+2ax+a^2 = (x+a)^2 ``] -For this problem, we have [` x^2+[$p1]x +... `]. This implies the value of [`a`] in the above formula is [`\frac{[$p1]}{2}=[$p1/2]`]. Now we have [`x^2+[$p1]x+...= (x+[$p1/2])^{2} + ... `]. +Step 1: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2+[$p1]x+...= (x+[$p1/2])^{2} `]. -Note that [`x^2+[$p1]x`] and [`(x+[$p1/2])^{2}`] are not equivalent, because [`(x+[$p1/2])^{2}=(x+[$p1/2])(x+[$p1/2])=x^{2}+[$p1]x+[$p1**2/4]`]. Now we have [`x^2+[$p1]x=(x+[$p1/2])^{2}-[$p1**2/4]`]. +Step 2: By the formula [`x^2+2ax+a^2 = (x+a)^2`], we have [`x^2+[$p1]x+[$p1**2/4]= (x+[$p1/2])^{2} `]. The full solution is: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm10.pg new file mode 100644 index 0000000000..8e1cd64215 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm10.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Template: +# Given the vertex and the value of a, write the quadratic function's formula. +# +# Last updated: Yao 08/18/2016 +# ENDDESCRIPTION + +## DBCC('') +## DBsubject('Algebra') +## DBchapter('Quadratic equations and functions') +## DBsection('Forms: vertex, factored, general') +## KEYWORDS('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "bizarroArithmetic.pl", + "parserAssignment.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +parser::Assignment->Allow; +parser::Assignment->Function("f"); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); + + +$a = non_zero_random(-9,9,1); +$h = non_zero_random(-9,9,1); +do {$k = non_zero_random(-9,9,1);} until (abs($h)!=abs($k)); +$ans = Compute("f(x)=$a*(x-$h)^2+$k"); +if ($a == 1) {$ans = Compute("f(x)=(x-$h)^2+$k");}; +if ($a == -1) {$ans = Compute("f(x)=-(x-$h)^2+$k");}; + +$evaluator = $ans -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1,bizarroMul=>1,bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0,bizarroMul=>0,bizarroDiv=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in simplified vertex form") unless $OK; + return $OK; +}); + + +############################################## + +BEGIN_PGML + +Write the vertex form for the quadratic function [`f`], whose vertex is [`([$h],[$k]) `] and has leading coefficient [`a=[$a]`]. + +[_________________]{$evaluator} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +A quadratic function's vertex form looks like [` f(x) = a(x-h)^2+k `], where [`(h, k)`] is the parabola's vertex. + +The solution is [` f(x) = [$a](x-[$h])^2+[$k] `]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg index 39041a1bc1..efd53339cb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg @@ -9,12 +9,12 @@ # ENDDESCRIPTION ## DBCC('') -## DBsubject(Algebra) -## DBchapter(Quadratic equations and functions) -## DBsection(Forms: vertex, factored, general) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Quadratic equations and functions') +## DBsection('Forms: vertex, factored, general') +## KEYWORDS('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +26,8 @@ loadMacros( "PGML.pl", "PGgraphmacros.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "bizarroArithmetic.pl", + "PGcourse.pl", ); ############################################## @@ -35,6 +36,17 @@ TEXT(beginproblem()); Context("Numeric"); Context()->noreduce("(-x)-y","(-x)+y"); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); $bound = 4; @@ -57,38 +69,71 @@ for my $i (0..0) { $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], axes=>[0,0], grid=>[$ticknum[0],$ticknum[1]], - size=>[xPixels(),yPixels()] + size=>[240,240] ); $gr[$i]->lb('reset'); for my $j (@xticks) { if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + $gr[$i]->lb( new Label($j, 0, $j,'black','center','top','large')); } for my $j (@yticks) { if (abs($j)<10**(-10)) {next;} - $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + $gr[$i]->lb( new Label(0, $j, $j,'black','right','middle','large')); } + $gr[$i]->lb(new Label($max[0],0,'x','black','right','bottom','large')); + $gr[$i]->lb(new Label(0,$max[1],'y','black','left','top','large')); + $t1 = -$bound-2; $t2 = $bound+2; - add_functions($gr[0], "$ans for x in <$t1,$t2> using color:blue and weight:2"); + add_functions($gr[0], "$ans for x in <$t1,$t2> using color:blue and weight:1"); + + my $px = ($max[0]-$min[0])/240; + + $yexit = ($a > 0) ? $max[1] : $min[1]; + @xvalues = num_sort(($min[0],$max[0],sqrt(($yexit-$k)/$a)+$h,-sqrt(($yexit-$k)/$a)+$h)); + $start = $xvalues[1]; + $stop = $xvalues[2]; + $gr[$i]->moveTo($start+$px,$a*($start+$px-$h)**2+$k); + $gr[$i]->arrowTo($start,$a*($start-$h)**2+$k,'blue',1); + $gr[$i]->moveTo($stop-$px,$a*($stop-$px-$h)**2+$k); + $gr[$i]->arrowTo($stop,$a*($stop-$h)**2+$k,'blue',1); } $ALT = "This is the graph of a parabola. Its vertex is at ($h, $k), and the parabola also passes the point ($px, $py)."; + + +$evaluator = $ans -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroAdd=>1,bizarroSub=>1,bizarroMul=>1,bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroAdd=>0,bizarroSub=>0,bizarroMul=>0,bizarroDiv=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in simplified vertex form") unless $OK; + return $OK; +}); + + ############################################## BEGIN_PGML -A parabola's vertex form looks like [` f(x) = a(x-h)^2+k `]. The following is the graph of a parabola. +A graph of a function [`f`] is given. Use the graph to write a formula for [`f`] in vertex form. You will need to identify the vertex and also one more point on the graph to find the leading coefficient [`a`]. [@EnlargeImageStatementPGML()@]** ->>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< +>>[@image(insertGraph($gr[0]), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< -Based on the graph, write this parabola's formula in vertex form. - [`` f(x) =``] [_________________]{$ans} + [`` f(x) =``] [_________________]{$evaluator} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm20.pg new file mode 100644 index 0000000000..1b0c15fb0f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm20.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form. +# No fractions are involved. +# +# f(x) = x^2 + ax + b +# +# a is even. +# +# Last updated: Carl Yao, 08/18/16 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +$h = non_zero_random(-10,10,1); +$k = non_zero_random(-10,10,1); + +$ans = Compute("(x-$h)**2+$k")->reduce; + +$a = 1; +$b = -2*$h; +$c = $h**2+$k; +$func = Compute("x**2+$b*x+$c")->reduce; + +Context("Point"); +$vertex = Point($h,$k); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Use the axis formula and vertex formula to find the parabola's vertex, and then convert the function to vertex form. + + [` f(x) = [$func] `] + + The parabola's vertex is [_____________]{$vertex}. + + The function's equation in vertex-form is [`f(x)=`][____________________]{$ans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +A quadratic function's vertex form looks like [` f(x) = a(x-h)^2+k `]. + +Since there is no coefficient for the [`x^2`] term, the value of [`a`] is simply [`1`]. Now we have [` f(x) = (x-h)^2+k `]. + +We can use the formula [`x=-\frac{b}{2a}`] to find a parabola's axis. In this problem, we have: + + [`` x=-\frac{b}{2a} = -\frac{[$b]}{2([$a])} = [$h] ``] + +This implies [` h=[$h] `]. Now we have: [` f(x) = (x-[$h])^2+k `]. + +Next, we substitute [`x=[$h]`] into [`f(x)=[$func]`] to find the vertex's [`y`]-value: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + f([$h]) &= ([$h])^2+[$b]([$h])+[$c] \\ + f([$h]) &= [$k] +\end{aligned} + ``] + +With the vertex as [`([$h],[$k])`] and [`a=1`], we can write the function's vertex form: + + [``f(x)=[$ans]``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm21.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm21.pg new file mode 100644 index 0000000000..9fbe2f28f1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm21.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form. +# No fractions are involved. +# +# f(x) = -x^2 + ax + b +# +# a is even. +# +# Last updated: Carl Yao, 1/11/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +$h = non_zero_random(-10,10,1); +$k = non_zero_random(-10,10,1); + +$ans = Compute("-(x-$h)**2+$k")->reduce; + +$a = -1; +$b = 2*$h; +$c = -$h**2+$k; +$func = Compute("-x**2+$b*x+$c")->reduce; + +Context("Point"); +$vertex = Point($h,$k); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Use the axis formula and vertex formula to find the parabola's vertex, and then convert the function to vertex form. + + [` f(x) = [$func] `] + + The parabola's vertex is [_____________]{$vertex}. + + The function's equation in vertex-form is [`f(x)=`][____________________]{$ans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +A quadratic function's vertex form looks like [` f(x) = a(x-h)^2+k `]. + +The coefficient for the [`x^2`] term is [`-1`], so [`a=-1`]. Now we have [` f(x) = -(x-h)^2+k `]. + +We can use the formula [`x=-\frac{b}{2a}`] to find a parabola's axis. In this problem, we have: + + [`` x=-\frac{b}{2a} = -\frac{[$b]}{2([$a])} = [$h] ``] + +This implies [` h=[$h] `]. Now we have: [` f(x) = -(x-[$h])^2+k `]. + +Next, we substitute [`x=[$h]`] into [`f(x)=[$func]`] to find the vertex's [`y`]-value: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + f([$h]) &= -([$h])^2+[$b]([$h])+[$c] \\ + f([$h]) &= [$k] +\end{aligned} + ``] + +With the vertex as [`([$h],[$k])`] and [`a=1`], we can write the function's vertex form: + + [``f(x)=[$ans]``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm22.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm22.pg new file mode 100644 index 0000000000..438a391cb1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm22.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form. +# No fractions are involved. +# +# f(x) = -ax^2 + bx + c +# +# a is even. +# +# Last updated: Carl Yao, 1/11/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, + reduceConstantFunctions=>0, + formatStudentAnswer=>parsed, + showExtraParens=>0, + ); + +$a = random(2,5,1)*random(-1,1,2); +$h = non_zero_random(-5,5,1); +$k = non_zero_random(-5,5,1); + +$ans = Compute("$a*(x-$h)**2+$k")->reduce; + +$b = -2*$a*$h; +$c = $a*$h**2+$k; +$func = Compute("$a*x**2+$b*x+$c")->reduce; + +Context("Point"); +$vertex = Point($h,$k); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Use the axis formula and vertex formula to find the parabola's vertex, and then convert the function to vertex form. + + [` f(x) = [$func] `] + + The parabola's vertex is [_____________]{$vertex}. + + The function's equation in vertex-form is [`f(x)=`][____________________]{$ans}. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +A quadratic function's vertex form looks like [` f(x) = a(x-h)^2+k `]. + +The coefficient for the [`x^2`] term is [`[$a]`], so [`a=[$a]`]. Now we have [` f(x) = [$a](x-h)^2+k `]. + +We can use the formula [`x=-\frac{b}{2a}`] to find a parabola's axis. In this problem, we have: + + [`` x=-\frac{b}{2a} = -\frac{[$b]}{2([$a])} = [$h] ``] + +This implies [` h=[$h] `]. Now we have: [` f(x) = [$a](x-[$h])^2+k `]. + +Next, we substitute [`x=[$h]`] into [`f(x)=[$func]`] to find the vertex's [`y`]-value: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + f([$h]) &= [$a]([$h])^2+[$b]([$h])+[$c] \\ + f([$h]) &= [$k] +\end{aligned} + ``] + +With the vertex as [`([$h],[$k])`] and [`a=[$a]`], we can write the function's vertex form: + + [``f(x)=[$ans]``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm30.pg new file mode 100644 index 0000000000..99ce014230 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm30.pg @@ -0,0 +1,155 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form. +# Fractions are involved. +# +# f(x) = x^2 + ax + b +# +# a is odd. +# +# Last updated: Carl Yao, 08/18/2016 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); + +$a = 1; +$b = random(-5,5,2); +$c = non_zero_random(-10,10,1); + +$h = Fraction(-$b,2)->reduce; +($hNum, $hDen) = $h->value; +$k = Fraction(4*$c-$b**2,4)->reduce; +($kNum, $kDen) = $k->value; + +Context("Numeric"); +$ans = Compute("(x-$h)**2+$k"); + +$func = Compute("x**2+$b*x+$c")->reduce; + +$nhNum = -$hNum; +$nkNum = -$kNum; +$s1 = ($h>0) ? "(x-\frac{$hNum}{$hDen})^2" : "(x+\frac{$nhNum}{$hDen})^2"; +$s2 = ($k>0) ? "+\frac{$kNum}{$kDen}" : "-\frac{$nkNum}{$kDen}"; +$ansShow = $s1.$s2; + + +############################################## + +BEGIN_PGML + +Use the axis formula and vertex formula to find the parabola's vertex, and then convert the function to vertex form. + + [` f(x) = [$func] `] + + The parabola's vertex is [_____________]. + + The function's equation in vertex-form is [`f(x)=`][____________________]. + + +END_PGML + +############################################## + +Context("Fraction-NoDecimals"); +Context()->{precedence}{Fraction} = 2.5; +Context()->flags->set(reduceFractions=>0, + allowMixedNumbers=>1, + requirePureFractions=>1, + showExtraParens=>0, + reduceConstants=>0, + ); + +Context()->parens->set('('=>{type=>'Point'}); +$vertex = List("($h,$k)"); +ANS($vertex->cmp( + checker => sub { + my ($correct, $student, $ans, $nth, $value) = @_; + $student->context->setError("Your $nth $value contains an unreduced fraction","",undef,undef,$Value::CMP_WARNING) + if $student->{notReduced}; + return 0 unless $correct == $student; + my $reduced = 1; + foreach $x ($student->value) { + if (Value::classMatch($x,'Fraction') && !$x->isReduced) { + $reduced = 0; + break; + } + } + $student->{notReduced} = 1 unless $reduced || $ans->{isPreview}; + return $reduced; + } + ) +); + +ANS($ans->cmp); + +############################################## + +$h2 = $h*2; +$s4 = Compute("x**2-$h2*x")->reduce; +if ($b==1) { + $s5 = "+"; +} elsif ($b==-1) { + $s5 = "-"; +} else { + $nB = -$b; + $s5 = ($b>0) ? "+$b" : "-$nB"; +} + +BEGIN_PGML_SOLUTION + +A quadratic function's vertex form looks like [` f(x) = a(x-h)^2+k `]. + +Since there is no coefficient for the [`x^2`] term, the value of [`a`] is simply [`1`]. Now we have [` f(x) = (x-h)^2+k `]. + +We can use the formula [`x=-\frac{b}{2a}`] to find a parabola's axis. In this problem, we have: + + [`` x=-\frac{b}{2a} = -\frac{[$b]}{2([$a])} = [$h] ``] + +This implies [` h=[$h] `]. Now we have: [` f(x) = [$s1]+k `]. + +Next, we substitute [`x=[$h]`] into [`f(x)=[$func]`] to find the vertex's [`y`]-value: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + f([$h]) &= ([$h])^2[$s5]([$h])+[$c] \\ + f([$h]) &= [$k] +\end{aligned} + ``] + +With the vertex as [`([$h],[$k])`] and [`a=1`], we can write the function's vertex form: + + [``f(x)=[$ansShow]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm40.pg new file mode 100644 index 0000000000..193c7ea2ca --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm40.pg @@ -0,0 +1,155 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Template: +# Change a quadratic function from standard form to vertex form. +# Fractions are involved. +# +# f(x) = a x^2 + bx + c +# +# +# Last updated: Carl Yao, 08/18/2016 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','completing the square') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); + +do { + $a = random(2,5,1); + $b = random(1,5,1); +} until ( gcd($a,$b)==1 ); +$b = $b*random(-1,1,2); +$c = random(1,5,1)*random(-1,1,2); + +$h = -Fraction($b,2*$a)->reduce; +($hNum, $hDen) = $h->value; +$k = Fraction(4*$a*$c-$b**2,4*$a)->reduce; +($kNum, $kDen) = $k->value; + +Context("Numeric"); +$ans = Compute("$a*(x-$h)**2+$k"); + +$func = Compute("$a*x**2+$b*x+$c")->reduce; + +$nhNum = -$hNum; +$nkNum = -$kNum; +$s1 = ($h>0) ? "$a(x-\frac{$hNum}{$hDen})^2" : "$a(x+\frac{$nhNum}{$hDen})^2"; +$s2 = ($k>0) ? "+\frac{$kNum}{$kDen}" : "-\frac{$nkNum}{$kDen}"; +$ansShow = $s1.$s2; + + +############################################## + +BEGIN_PGML + +Use the axis formula and vertex formula to find the parabola's vertex, and then convert the function to vertex form. + + [` f(x) = [$func] `] + + The parabola's vertex is [_____________]. + + [`f(x)=`][____________________] + +END_PGML + +############################################## + +Context("Fraction-NoDecimals"); +Context()->{precedence}{Fraction} = 2.5; +Context()->flags->set(reduceFractions=>0, + allowMixedNumbers=>1, + requirePureFractions=>1, + showExtraParens=>0, + reduceConstants=>0, + ); + +Context()->parens->set('('=>{type=>'Point'}); +$vertex = List("($h,$k)"); +ANS($vertex->cmp( + checker => sub { + my ($correct, $student, $ans, $nth, $value) = @_; + $student->context->setError("Your $nth $value contains an unreduced fraction","",undef,undef,$Value::CMP_WARNING) + if $student->{notReduced}; + return 0 unless $correct == $student; + my $reduced = 1; + foreach $x ($student->value) { + if (Value::classMatch($x,'Fraction') && !$x->isReduced) { + $reduced = 0; + break; + } + } + $student->{notReduced} = 1 unless $reduced || $ans->{isPreview}; + return $reduced; + } + ) +); + +ANS($ans->cmp); + +############################################## + +Context("Fraction"); +$h2 = $h*2; +$s4 = Compute("x**2-$h2*x")->reduce; + +if ($b==1) {$s5 = "$a x^2+x";} +elsif ($b==-1) {$s5 = "$a x^2-x";} +else {$s5 = Compute("$a x^2+ $b x")->reduce;} + +$s6 = ($b==1) ? "" : "$b"; + +BEGIN_PGML_SOLUTION + +A quadratic function's vertex form looks like [` f(x) = a(x-h)^2+k `]. + +The value of [`a`] is [`[$a]`], so we have [` f(x) = [$a] (x-h)^2+k `]. + +We can use the formula [`x=-\frac{b}{2a}`] to find a parabola's axis. In this problem, we have: + + [`` x=-\frac{b}{2a} = -\frac{[$b]}{2([$a])} = [$h] ``] + +This implies [` h=[$h] `]. Now we have: [` f(x) = [$s1]+k `]. + +Next, we substitute [`x=[$h]`] into [`f(x)=[$func]`] to find the vertex's [`y`]-value: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + f([$h]) &= [$a]([$h])^2+[$s6]([$h])+[$c] \\ + f([$h]) &= [$k] +\end{aligned} + ``] + +With the vertex as [`([$h],[$k])`] and [`a=3`], we can write the function's vertex form: + + [``f(x)=[$ansShow]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation10.pg index c67fdb3f03..052b69a5a4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation10.pg @@ -7,13 +7,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions with fractional exponents and radical functions) -## DBsection(Equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation100.pg new file mode 100644 index 0000000000..70da719b02 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation100.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve sqrt(x+p)=r-sqrt(x) +# +# Last updated: Yao 1/7/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + +do { + do { + $r = non_zero_random(-10,10,1); + do {$p = non_zero_random(-10,10,1);} until (abs($r)!=abs($p)); + $s = ($r**2-$p)/(2*$r); + } until ( $s>0 && ($r**2+$p)/(2*$r) < 0); +} until (sqrt($s)==int(sqrt($s))); +$solution = $s**2; + +$left = Compute("sqrt($var+$p)")->reduce; +$right = Compute("$r-sqrt($var)")->reduce; +$ans = Compute("no real solution"); +$evaluator = $ans->cmp(typeMatch=>Formula("{1,2}")); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$evaluator} + +END_PGML + +############################################## + + + +BEGIN_PGML_SOLUTION + +Sometimes we need to square both sides of an equation twice. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + ([$left])^2 &= ([$right])^2 \\ + [$var]+[$p] &= ([$r])^2-2\cdot[$r]\sqrt{[$var]}+(\sqrt{[$var]})^2 \\ + [$var]+[$p] &= [$r*$r] -[$r*2]\sqrt{[$var]}+[$var]\\ + [$var]+[$p] \mathbf{{}-[$var]} &= [$r*$r] -[$r*2]\sqrt{[$var]}+[$var] \mathbf{{}-[$var]} \\ + [$p] &= [$r*$r]-[$r*2]\sqrt{[$var]} \\ + [$p-$r*$r] &= -[$r*2]\sqrt{[$var]} \\ + \frac{[$p-$r*$r]}{-[$r*2]} &= \frac{-[$r*2]\sqrt{[$var]}}{-[$r*2]} \\ + [$s] &= \sqrt{[$var]} \\ + ([$s])^2 &= (\sqrt{[$var]})^2 \\ + [$solution] &= [$var] +\end{aligned} + ``] + +Whenever we square both sides of an equation, we could create extraneous solutions. We must check our solution. + +We will substitute [`[$var]=[$solution]`] into [`[$left]=[$right]`], and we have: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \sqrt{[$solution]+[$p]} &\stackrel{?}{=} [$r]-\sqrt{[$solution]} \\ + \sqrt{[$solution+$p]} &\stackrel{?}{=} [$r]-[$s] \\ + [$s-$r] &\stackrel{?}{=} [$r-$s] \\ +\end{aligned} + ``] + +We can see [`[$var]=[$solution]`] is an extraneous solution. This equation has no real solution. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation110.pg index 4d45c82df3..3d0b63fa61 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation110.pg @@ -7,14 +7,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions with fractional exponents and radical functions) -## DBsection(Equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation120.pg index f0a7cfa987..14b9bae462 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation120.pg @@ -7,14 +7,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions with fractional exponents and radical functions) -## DBsection(Equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation130.pg index aa5a5ac657..7ffa31bee9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation130.pg @@ -7,14 +7,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions with fractional exponents and radical functions) -## DBsection(Equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation140.pg index fa6ddb3a4b..234d2ea748 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation140.pg @@ -7,14 +7,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions with fractional exponents and radical functions) -## DBsection(Equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation20.pg new file mode 100644 index 0000000000..f209b18ff3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation20.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve \sqrt{ax}=b +# +# Last updated: Yao 1/7/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + + + + $a = random(2,5,1); + $f = random(2,5,1); + $b = $a*$f; + $b2 = $b**2; +$solution = $b2/$a; + + +$left = Compute("sqrt($a*$var)")->reduce; +$right = Compute("$b")->reduce; +$ans = Formula("{$solution}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +To remove the square root, we square both sides of the equation: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + ([$left])^2 &= ([$right])^2 \\ + [$a][$var] &= [$b2] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$b2]}{[$a]} \\ + [$var] &= [$solution] +\end{aligned} + ``] + +Whenever we square both sides of an equation, we could create extraneous solutions. We must check our solution. This part is left as exercise. + + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation30.pg new file mode 100644 index 0000000000..e5c422c814 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation30.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve a\sqrt{x}=b +# +# Last updated: Yao 1/7/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + + + $a = random(2,5,1); + $f = random(2,5,1); + $b = $a*$f; +$solution = $f**2; + + +$left = Compute("$a*sqrt($var)")->reduce; +$right = Compute("$b")->reduce; +$ans = Formula("{$solution}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +To solve an equation with radicals, we first separate the radical on one side of the equation, and then square both sides: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \frac{[$left]}{[$a]} &= \frac{[$right]}{[$a]} \\ + \sqrt{[$var]} &= [$f] \\ + (\sqrt{[$var]})^2 &= ([$f])^2 \\ + [$var] &= [$solution] +\end{aligned} + ``] + +Whenever we square both sides of an equation, we could create extraneous solutions. We must check our solution. This part is left as exercise. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation40.pg new file mode 100644 index 0000000000..e4d0b0e88b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation40.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve -a\sqrt{x}=b +# +# Last updated: Yao 1/7/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + + + $a = random(2,5,1); + $f = random(2,5,1); + $b = $a*$f; +$solution = $f**2; + + +$left = Compute("-$a*sqrt($var)")->reduce; +$right = Compute("$b")->reduce; +$ans = Compute("no real solution"); +$evaluator = $ans->cmp(typeMatch=>Formula("{1,2}")); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$evaluator} + +END_PGML + +############################################## + + + +BEGIN_PGML_SOLUTION + +It will help to divide by [`-[$a]`] on both sides. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \frac{[$left]}{-[$a]} &= \frac{[$right]}{-[$a]} \\ + \sqrt{[$var]} &= -[$f] \\ +\end{aligned} + ``] + +Since a square root cannot generate negative numbers, this equation has no real solution. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation50.pg new file mode 100644 index 0000000000..35a9be40ce --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation50.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve a\sqrt{b-x}+c=d +# +# Last updated: Yao 1/7/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + + + + +$rad = (random(1,10,1))**2; +$b = non_zero_random(-10,10,1); +$solution = $b-$rad; +$a = non_zero_random(-5,5,1); +$c = non_zero_random(-10,10,1); +$d = $a*sqrt($rad)+$c; + + +$left = Compute("$a*sqrt($b-$var)+$c")->reduce; +$right = Compute("$d")->reduce; +$ans = Formula("{$solution}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + + +$s1 = sqrt($rad); + +BEGIN_PGML_SOLUTION + +To solve an equation with radicals, we first separate the radical on one side of the equation, and then square both sides: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] \mathbf{{}-[$c]} &= [$right] \mathbf{{}-[$c]} \\ + [$a]\sqrt{[$b]-[$var]} &= [$right-$c] \\ + \frac{[$a]\sqrt{[$b]-[$var]}}{[$a]} &= \frac{[$right-$c]}{[$a]} \\ + \sqrt{[$b]-[$var]} &= [$s1] \\ + (\sqrt{[$b]-[$var]})^2 &= ([$s1])^2 \\ + [$b]-[$var] &= [$rad] \\ + [$b]-[$var] \mathbf{{}-[$b]} &= [$rad] \mathbf{{}-[$b]} \\ + -[$var] &= [$rad-$b] \\ + [$var] &= [$solution] +\end{aligned} + ``] + +Whenever we square both sides of an equation, we could create extraneous solutions. We must check our solution. This part is left as exercise. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation60.pg index 1c6eec8440..b3f6be1fec 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation60.pg @@ -7,13 +7,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions with fractional exponents and radical functions) -## DBsection(Equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -44,7 +43,7 @@ do { $b = -$solution1-$solution2; $c = $solution1*$solution2; $rad = -$b*$var-$c; -} until ( (-$b*$solution1-$c>0) ); +} until ( (-$b*$solution1-$c>0) and ($b!=0) ); $left = Compute("sqrt(-$b*$var-$c)")->reduce; $right = Compute("$var")->reduce; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation70.pg new file mode 100644 index 0000000000..3f9f74ec4c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation70.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve \sqrt{x}+a=x +# +# Last updated: Yao 1/7/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + +do { + $solution1 = (random(1,9,1))**2; + $p = sqrt($solution1)-$solution1; + $b = 2*$p-1; + $c = $p**2; + $solution2 = (-$b-sqrt(1-4*$p))/2; +} until ( ($p<10) && ($solution2+$p<0) ); + +$left = Compute("sqrt($var)-$p")->reduce; +$right = Compute("$var")->reduce; +$ans = Formula("{$solution1}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + + + +$s1 = sqrt($solution1); +$s2 = sqrt($solution2); + +BEGIN_PGML_SOLUTION + +To remove the square root, we separate the square root on one side of the equation, and then square both sides: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] \mathbf{{}+[$p]} &= [$right] \mathbf{{}+[$p]} \\ + \sqrt{[$var]} &= [$var]+[$p] \\ + (\sqrt{[$var]})^2 &= ([$var]+[$p])^2 \\ + [$var] &= [$var]^2+[$p*2][$var]+[$p*$p] \\ + 0 &= [$var]^2+[$p*2-1][$var]+[$p*$p] \\ + 0 &= ([$var]-[$solution1])([$var]-[$solution2]) \\ + [$var]-[$solution1] = 0 &\text{ or } [$var]-[$solution2] = 0 \\ + [$var]=[$solution1] &\text{ or } [$var]=[$solution2] \\ +\end{aligned} + ``] + +Whenever we square both sides of an equation, we could create extraneous solutions. We must check our solution. + +We will substitute [`[$var]=[$solution1]`] into [`[$left]=[$right]`], and we have: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \sqrt{[$solution1]} -[$p] &\stackrel{?}{=} [$solution1] \\ + [$s1] -[$p] &\stackrel{?}{=} [$solution1] \\ + [$solution1] &\stackrel{?}{=} [$solution1] \\ +\end{aligned} + ``] + +We checked that [`[$var]=[$solution1]`] is a solution. + +Next, we will substitute [`[$var]=[$solution2]`] into [`[$left]=[$right]`], and we have: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \sqrt{[$solution2]} -[$p] &\stackrel{?}{=} [$solution2] \\ + [$s2] -[$p] &\stackrel{?}{=} [$solution2] \\ + [$s2-$p] &\stackrel{?}{=} [$solution2] \\ +\end{aligned} + ``] + +We can see [`[$var]=[$solution2]`] is an extraneous solution. + +The solution set is [`[$ans]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation80.pg new file mode 100644 index 0000000000..39582e5d72 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation80.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve \sqrt{x+b}+a=x +# +# Last updated: Yao 1/7/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + +do { + do { + $rad = (random(1,9,1))**2; + $q = non_zero_random(-10,10,1); + $solution1 = $rad-$q; + $p = sqrt($rad)-$solution1; + $b = 2*$p-1; + $c = $p**2-$q; + $disc = $b**2-4*$c; + } until ($disc>0); + $solution2 = (-$b-sqrt($b**2-4*$c))/2; +} until ( (abs($p)<10) && ($solution1>0) && ($solution2+$p<0) && ($p!=0) ); + +$left = Compute("$var")->reduce; +$right = Compute("sqrt($var+$q)-$p")->reduce; +$ans = Formula("{$solution1}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + + +$s1 = sqrt($rad); +$s2 = sqrt($solution2+$q); + +BEGIN_PGML_SOLUTION + +To remove the square root, we separate the square root on one side of the equation, and then square both sides: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] \mathbf{{}+[$p]} &= [$right] \mathbf{{}+[$p]} \\ + [$var]+[$p] &= \sqrt{[$var]+[$q]} \\ + ([$var]+[$p])^2 &= (\sqrt{[$var]+[$q]})^2 \\ + [$var]^2+[$p*2][$var]+[$p*$p] &= [$var]+[$q] \\ + [$var]^2+[$p*2-1][$var]+[$p*$p-$q] &= 0 \\ + ([$var]-[$solution1])([$var]-[$solution2]) &= 0 \\ + [$var]-[$solution1] = 0 &\text{ or } [$var]-[$solution2] = 0 \\ + [$var]=[$solution1] &\text{ or } [$var]=[$solution2] \\ +\end{aligned} + ``] + +Whenever we square both sides of an equation, we could create extraneous solutions. We must check our solution. + +We will substitute [`[$var]=[$solution1]`] into [`[$left]=[$right]`], and we have: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$solution1] &\stackrel{?}{=} \sqrt{[$solution1]+[$q]} -[$p] \\ + [$solution1] &\stackrel{?}{=} \sqrt{[$solution1+$q]} -[$p] \\ + [$solution1] &\stackrel{?}{=} [$s1] -[$p] \\ + [$solution1] &\stackrel{?}{=} [$solution1] \\ +\end{aligned} + ``] + +We checked that [`[$var]=[$solution1]`] is a solution. + +Next, we will substitute [`[$var]=[$solution2]`] into [`[$left]=[$right]`], and we have: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$solution2] &\stackrel{?}{=} \sqrt{[$solution2]+[$q]} -[$p] \\ + [$solution2] &\stackrel{?}{=} \sqrt{[$solution2+$q]} -[$p] \\ + [$solution2] &\stackrel{?}{=} [$s2]-[$p] \\ + [$solution2] &\stackrel{?}{=} [$s2-$p] \\ +\end{aligned} + ``] + +We can conclude [`[$var]=[$solution2]`] is an extraneous solution. + +The solution set is [`[$ans]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation90.pg index f31c7ff6f5..61b09cb5a5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation90.pg @@ -7,13 +7,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions with fractional exponents and radical functions) -## DBsection(Equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -21,45 +20,33 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "parserImplicitPlane.pl", + "parserAssignment.pl", + "answerHints.pl", "PGML.pl", + "contextFiniteSolutionSets.pl", "PCCmacros.pl", "PGcourse.pl", ); ############################################## -Context("ImplicitPlane"); +Context("FiniteSolutionSets"); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); - -#do { -# do { -# $r = non_zero_random(-10,10,1); -# do {$p = non_zero_random(-10,10,1);} until (abs($r)!=abs($p)); -# $s = ($r**2-$p)/(2*$r); -# } until ( $s>0 ); -#} until (sqrt($s)==int(sqrt($s))); - -# ensure that solution $s**2 works -$r = random(1,3,1); -$s = random($r+1,4,1); -$p = $r**2 - 2*$r*$s; - -$solution = $s**2; - -$left = Compute("sqrt($var+$p)")->reduce; -$right = Compute("sqrt($var)-$r")->reduce; -$ans = ImplicitPlane("$var = $solution")->cmp->withPostFilter( - sub { - my $ans = shift; - if ( ($ans->{ans_message} eq "Your formula isn't a linear one") or - ($ans->{ans_message} =~ "Your answer isn't an implicit plane") ){ - $ans->{ans_message} = "Answer should look like $var = something"; - } - return $ans; - } -); + + +do { + do { + $r = non_zero_random(-20,20,1); + do {$p = non_zero_random(-20,20,1);} until (abs($r)!=abs($p)); + $s = ($r**2-$p)/(2*$r); + $solution = $s**2; + $left = Compute("sqrt($var+$p)")->reduce; + $right = Compute("sqrt($var)-$r")->reduce; + } until ( $s>0 ); +} until (sqrt($s)==int(sqrt($s)) and $left->eval($var=>$solution) == $right->eval($var=>$solution)); + +$ans = Formula("{$solution}"); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation91.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation91.pg new file mode 100644 index 0000000000..16297221f1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation91.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve sqrt(x+p)=r-sqrt(x) +# +# Last updated: Yao 1/7/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + do { + $r = non_zero_random(-20,20,1); + do {$p = non_zero_random(-20,20,1);} until (abs($r)!=abs($p)); + $s = ($p-$r**2)/(2*$r); + } until ($s>0); +} until (sqrt($s)==int(sqrt($s))) && (sqrt($s**2+$p)>0) && (sqrt($s**2+$p) == -($s+$r)); +$solution = $s**2; + +$left = Compute("sqrt($var+$p)")->reduce; +$right = Compute("sqrt($var)+$r")->reduce; +$ans = Compute("no real solutions"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the radical equation. + + [`` [$left] = [$right] ``] + + [__________________________________] + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + + +############################################## + +$s1 = $solution+$p; +$s2 = sqrt($solution+$p); + +BEGIN_PGML_SOLUTION + +Sometimes we need to square both sides of an equation twice. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + ([$left])^2 &= ([$right])^2 \\ + [$var]+[$p] &= (\sqrt{[$var]})^2+2(\sqrt{[$var]})([$r])+([$r])^2 \\ + [$var]+[$p] &= [$var]+[$r*2]\sqrt{[$var]}+[$r*$r] \\ + [$var]+[$p] \mathbf{{}-[$var]} &= [$var]+[$r*2]\sqrt{[$var]}+[$r*$r] \mathbf{{}-[$var]} \\ + [$p] &= [$r*2]\sqrt{[$var]}+[$r*$r] \\ + [$p-$r*$r] &= [$r*2]\sqrt{[$var]} \\ + \frac{[$p-$r*$r]}{[$r*2]} &= \frac{[$r*2]\sqrt{[$var]}}{[$r*2]} \\ + [$s] &= \sqrt{[$var]} \\ + ([$s])^2 &= (\sqrt{[$var]})^2 \\ + [$solution] &= [$var] +\end{aligned} + ``] + +Whenever we square both sides of an equation, we could create extraneous solutions. We must check our solution. + +We will substitute [`[$var]=[$solution]`] into [`[$left]=[$right]`], and we have: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \sqrt{[$solution]+[$p]} &\stackrel{?}{=} \sqrt{[$solution]}+[$r] \\ + \sqrt{[$s1]} &\stackrel{?}{=} [$s]+[$r] \\ + [$s2] &\stackrel{?}{=} [$s+$r] \\ +\end{aligned} + ``] + +We checked that [`[$var]=[$solution]`] is not a solution, so the equation has *no real solutions*. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation92.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation92.pg new file mode 100644 index 0000000000..56f9c7f544 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalEquations/SolvingRadicalEquation92.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve sqrt(x+p)=r-sqrt(x) +# +# Last updated: Yao 1/7/2017 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','quadratic','equation','square root') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + do { + $r = non_zero_random(-20,20,1); + do {$p = non_zero_random(-20,20,1);} until (abs($r)!=abs($p)); + $s = ($p-$r**2)/(2*$r); + } until ( $s>0 && $p>$r**2 ); +} until (sqrt($s)==int(sqrt($s))); +$solution = $s**2; + +$left = Compute("sqrt($var+$p)")->reduce; +$right = Compute("sqrt($var)+$r")->reduce; +$ans = Formula("{$solution}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the radical equation. + + [`` [$left] = [$right] ``] + + [__________________________________] + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + + +############################################## + +BEGIN_PGML_SOLUTION + +Sometimes we need to square both sides of an equation twice. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + ([$left])^2 &= ([$right])^2 \\ + [$var]+[$p] &= (\sqrt{[$var]})^2+2(\sqrt{[$var]})([$r])+([$r])^2 \\ + [$var]+[$p] &= [$var]+[$r*2]\sqrt{[$var]}+[$r*$r] \\ + [$var]+[$p] \mathbf{{}-[$var]} &= [$var]+[$r*2]\sqrt{[$var]}+[$r*$r] \mathbf{{}-[$var]} \\ + [$p] &= [$r*2]\sqrt{[$var]}+[$r*$r] \\ + [$p-$r*$r] &= [$r*2]\sqrt{[$var]} \\ + \frac{[$p-$r*$r]}{[$r*2]} &= \frac{[$r*2]\sqrt{[$var]}}{[$r*2]} \\ + [$s] &= \sqrt{[$var]} \\ + ([$s])^2 &= (\sqrt{[$var]})^2 \\ + [$solution] &= [$var] +\end{aligned} + ``] + +Whenever we square both sides of an equation, we could create extraneous solutions. We must check our solution. + +We will substitute [`[$var]=[$solution]`] into [`[$left]=[$right]`], and we have: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \sqrt{[$solution]+[$p]} &\stackrel{?}{=} \sqrt{[$solution]}+[$r] \\ + \sqrt{[$solution+$p]} &\stackrel{?}{=} [$s]+[$r] \\ + [$s+$r] &\stackrel{?}{=} [$s+$r] \\ +\end{aligned} + ``] + +We checked that [`[$var]=[$solution]`] is a solution. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/DividingRadicals10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/DividingRadicals10.pg new file mode 100644 index 0000000000..c261d32353 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/DividingRadicals10.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Dividing radicals. +# +# Last edited: Carl Yao 1/5/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Fraction"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +do { + $num1 = 1; + $den1 = random(2,5,1); + $num2 = random(2,5,1); + do {$den2 = random($num2+1,10,1);} until ( ($den2!=$den1) && (gcd($den2,$num2)==1) ); + $commonD = lcm($den1,$den2); + $f1 = $commonD/$den1; + $f2 = $commonD/$den2; + $frac = Fraction($num1*$den2-$num2*$den1,$den1*$den2)->reduce; + ($ansNum,$ansDen) = $frac->value; +} until ($ansDen != $commonD); + +$problem = ($den1==2) ? "\frac{\sqrt{$var}}{\sqrt[$den2]{$var^{$num2}}}" : "\frac{\sqrt[$den1]{$var}}{\sqrt[$den2]{$var^{$num2}}}"; + +Context("Numeric"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +Context()->operators->undefine('*'); +Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); + +$ans = Formula("$var^($frac)"); + + +##################################################### + +BEGIN_PGML + +Simplify the expression. Write your answers with a rational exponent, like [`x`]^[`(1/2)`]. + +For this problem you may assume that all variables are positive. + + [``[$problem]``]=[___________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use the following properties: + + [`` \sqrt[m]{x}=x^{\frac{1}{m}} ``] + + [`` \frac{x^m}{x^n}=x^{m-n} ``] + +The solution is: + + [`` +\begin{aligned} + [$problem] + &= \frac{[$var]^{\frac{[$num1]}{[$den1]}}}{[$var]^{\frac{[$num2]}{[$den2]}}} \\ + &= [$var]^{\frac{[$num1]}{[$den1]}-\frac{[$num2]}{[$den2]}} \\ + &= [$var]^{\frac{[$num1*$f1]}{[$den1*$f1]}-\frac{[$num2*$f2]}{[$den2*$f2]}} \\ + &= [$var]^{\frac{[$num1*$f1-$num2*$f2]}{[$den1*$f1]}} \\ + &= [$var]^{[$frac]} +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/DividingRadicals20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/DividingRadicals20.pg new file mode 100644 index 0000000000..b236826925 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/DividingRadicals20.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Dividing radicals. +# +# Last edited: Carl Yao 1/5/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextRationalFunction.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); + +Context("RationalFunction-Strict"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real', $var2=>'Real'); +Context()->flags->set(reduceConstants=>0); + +Context()->operators->set( + '/' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, + ' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '//' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + ' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}); + +$den = random(2,5,1); +$f1 = random(1,4,1); +$num1 = $den*$f1; +$f2 = random(1,4,1); +$num2 = $den*$f2; + +if ($den==2) { + $a = list_random(2,3,5,7); +} elsif ($den==3) { + $a = list_random(2,3,5); +} elsif ($den==4) { + $a = list_random(2,3); +} else { + $a = 2; +} +$b = $a**$den; + +$problem = ($den==2) ? "\sqrt{\frac{$b $var1^{$num1}}{$var2^{$num2}}}" : "\sqrt[$den]{\frac{$b $var1^{$num1}}{$var2^{$num2}}}"; + +$s1 = ($f1==1) ? "$var1" : "$var1^{$f1}"; +$s2 = ($f2==1) ? "$var2" : "$var2^{$f2}"; +$ans = Formula("$a*$s1/$s2"); + + +##################################################### + +BEGIN_PGML + +Simplify the expression. Write your answers with a rational exponent, like [`x`]^[`(1/2)`]. + +For this problem you may assume that all variables are positive. + + [``[$problem]``]=[___________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use the following properties: + + [`` \sqrt[m]{x}=x^{\frac{1}{m}} ``] + + [`` (\frac{x}{y})^n=\frac{x^n}{y^n} ``] + + [`` (xy)^n=x^n y^n ``] + + [`` (x^m)^n=x^{mn} ``] + +The solution is: + + [`` +\begin{aligned} + [$problem] + &= (\frac{[$b] [$var1]^{[$num1]}}{[$var2]^{[$num2]}})^{\frac{1}{[$den]}} \\ + &= \frac{([$a]^{[$den]} [$var1]^{[$num1]})^{\frac{1}{[$den]}}}{([$var2]^{[$num2]})^{\frac{1}{[$den]}}} \\ + &= \frac{([$a]^{[$den]})^{\frac{1}{[$den]}} ([$var1]^{[$num1]})^{\frac{1}{[$den]}}}{([$var2]^{[$num2]})^{\frac{1}{[$den]}}} \\ + &= \frac{[$a]^{[$den]\cdot\frac{1}{[$den]}} [$var1]^{[$num1]\cdot\frac{1}{[$den]}}}{[$var2]^{[$num2]\cdot\frac{1}{[$den]}}} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/DividingRadicals30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/DividingRadicals30.pg new file mode 100644 index 0000000000..50df684237 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/DividingRadicals30.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Dividing radicals. +# +# Last edited: Carl Yao 1/5/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextRationalFunction.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); + +Context("RationalFunction-Strict"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real', $var2=>'Real'); +Context()->flags->set(reduceConstants=>0); + +Context()->operators->set( + '/' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, + ' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '//' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + ' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}); + +$den = random(2,5,1); +$f1 = random(1,4,1); +$num1 = $den*$f1; +$f2 = random(1,4,1); +$num2 = $den*$f2; + +if ($den==2) { + $a = list_random(2,3,5,7); +} elsif ($den==3) { + $a = list_random(2,3,5); +} elsif ($den==4) { + $a = list_random(2,3); +} else { + $a = 2; +} +$b = $a**$den; + +$problem = ($den==2) ? "\sqrt{\frac{$var1^{$num1}}{$b $var2^{$num2}}}" : "\sqrt[$den]{\frac{$var1^{$num1}}{$b $var2^{$num2}}}"; + +$s1 = ($f1==1) ? "$var1" : "$var1^{$f1}"; +$s2 = ($f2==1) ? "$var2" : "$var2^{$f2}"; +$ans = Formula("$s1/($a*$s2)"); + + +##################################################### + +BEGIN_PGML + +Simplify the expression. Write your answers with a rational exponent, like [`x`]^[`(1/2)`]. + +For this problem you may assume that all variables are positive. + + [``[$problem]``]=[___________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use the following properties: + + [`` \sqrt[m]{x}=x^{\frac{1}{m}} ``] + + [`` (\frac{x}{y})^n=\frac{x^n}{y^n} ``] + + [`` (xy)^n=x^n y^n ``] + + [`` (x^m)^n=x^{mn} ``] + +The solution is: + + [`` +\begin{aligned} + [$problem] + &= (\frac{[$var1]^{[$num1]}}{[$b] [$var2]^{[$num2]}})^{\frac{1}{[$den]}} \\ + &= \frac{([$var1]^{[$num1]})^{\frac{1}{[$den]}}}{([$a]^{[$den]} [$var2]^{[$num2]})^{\frac{1}{[$den]}}} \\ + &= \frac{([$var1]^{[$num1]})^{\frac{1}{[$den]}}}{([$a]^{[$den]})^{\frac{1}{[$den]}} ([$var2]^{[$num2]})^{\frac{1}{[$den]}}} \\ + &= \frac{[$var1]^{[$num1]\cdot\frac{1}{[$den]}}}{[$a]^{[$den]\cdot\frac{1}{[$den]}} [$var2]^{[$num2]\cdot\frac{1}{[$den]}}} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical10.pg new file mode 100644 index 0000000000..2425536392 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical10.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the value of a radical. +# +# Last edited: Carl Yao 8/31/13, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$a = list_random(16,25,36,49,64,81,100); +$rad = $a+random(1,3,1)*random(-1,1,2); +$lower = int(sqrt($rad)); +$upper = ceil(sqrt($rad)); +$lower2 = $lower**2; +$upper2 = $upper**2; + +$ans = sprintf("%.2f",sqrt($rad)); +if (abs($ans-$lower)>abs($ans-$upper)) { + $dif = $upper-$ans; + $choice1 = sprintf("%.2f",$upper+$dif); + $choice2 = sprintf("%.2f",$ans+1); + $choice3 = sprintf("%.2f",$lower+$dif); + $close = $upper; + $close2 = $upper2; +} else { + $dif = $ans-$lower; + $choice1 = sprintf("%.2f",$upper-$dif); + $choice2 = sprintf("%.2f",$ans-1); + $choice3 = sprintf("%.2f",$lower-$dif); + $close = $lower; + $close2 = $lower2; +} + +$popup = PopUp( + ['?',["$ans","$choice1","$choice2","$choice3"]], + 1, # correct answer +); + +##################################################### + +BEGIN_PGML + +Without using a calculator, estimate the value of [`\sqrt{[$rad]}`]: + +[__]{$popup} + +END_PGML + +############################################################ + + +BEGIN_PGML_SOLUTION + +It's important to write down the first few square numbers on scratch paper: + + [`` +\begin{aligned}[t] + 1^{2}&=1 \\ + 2^{2}&=4 \\ + 3^{2}&=9 \\ + 4^{2}&=16 \\ + 5^{2}&=25 \\ + 6^{2}&=36 \\ + 7^{2}&=49 \\ + 8^{2}&=64 \\ + 9^{2}&=81 \\ + 10^{2}&=100 \\ + ... +\end{aligned} + ``] + +Locate the value [`[$rad]`] in the list of square numbers. + +Since the number [`[$rad]`] is between [`[$lower2]`] and [`[$upper2]`], the value of [` \sqrt{[$rad]} `] must be between [`[$lower]`] and [`[$upper]`]. + +Next, since the number [`[$rad]`] is closer to [`[$close2]`], the value of [` \sqrt{[$rad]} `] must be closer to [`[$close]`]. + +This is how we can determine the correct answer is [`[$ans]`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical20.pg new file mode 100644 index 0000000000..f91fc67435 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical20.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the value of a radical. +# +# Last edited: Carl Yao 7/21/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','cube root','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$a = list_random(8,27,64); +$rad = $a+random(1,6,1)*random(-1,1,2); +$lower = int($rad**(1/3)); +$upper = ceil($rad**(1/3)); +$lower3 = $lower**3; +$upper3 = $upper**3; + +$ans = sprintf("%.2f",$rad**(1/3)); +if (abs($ans-$lower)>abs($ans-$upper)) { + $dif = $upper-$ans; + $choice1 = sprintf("%.2f",$upper+$dif); + $choice2 = sprintf("%.2f",$ans+1); + $choice3 = sprintf("%.2f",$lower+$dif); + $close = $upper; + $close3 = $upper3; +} else { + $dif = $ans-$lower; + $choice1 = sprintf("%.2f",$upper-$dif); + $choice2 = sprintf("%.2f",$ans-1); + $choice3 = sprintf("%.2f",$lower-$dif); + $close = $lower; + $close3 = $lower3; +} + +$popup = PopUp( + ['?',["$ans","$choice1","$choice2","$choice3"]], + 1, # correct answer +); + +##################################################### + +BEGIN_PGML + +Without using a calculator, estimate the value of [`\sqrt[3]{[$rad]}`]: + +[__]{$popup} + +END_PGML + +############################################################ + +BEGIN_PGML_SOLUTION + +It's important to write down the first few square numbers on scratch paper: + + [`` +\begin{aligned}[t] + 1^{3}&=1 \\ + 2^{3}&=8 \\ + 3^{3}&=27 \\ + 4^{3}&=64 \\ + 5^{3}&=125 \\ + ... +\end{aligned} + ``] + +Locate the value [`[$rad]`] in the list of cube numbers. + +Since the number [`[$rad]`] is between [`[$lower3]`] and [`[$upper3]`], the value of [` \sqrt{[$rad]} `] must be between [`[$lower]`] and [`[$upper]`]. + +Next, since the number [`[$rad]`] is closer to [`[$close3]`], the value of [` \sqrt{[$rad]} `] must be closer to [`[$close]`]. + +This is how we can determine the correct answer is [`[$ans]`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent10.pg new file mode 100644 index 0000000000..6776e0f0ac --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent10.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Evaluate an expression with a fractional exponent. +# +# Last edited: Carl Yao 7/21/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','cube root','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$a = (random(2,10,1))**2; +$b = 1; +$c = 2; + +$ans1 = $a**($b/$c); +$ans1 = Compute("$ans1"); +$ans2 = Compute("DNE"); +$ans3 = Compute("-$ans1"); + + +##################################################### + +BEGIN_PGML + +Without using a calculator, evaluate the expression. + +[@KeyboardInstructions('If a value is not defined as a real number, type [|DNE|]* for "does not exist".')@]** + +a. [`` [$a]^{\frac{[$b]}{[$c]}}= ``][_______]{$ans1} + +a. [`` (-[$a])^{\frac{[$b]}{[$c]}}= ``][_______]{$ans2} + +a. [`` -[$a]^{\frac{[$b]}{[$c]}}= ``][_______]{$ans3} + +END_PGML + +############################################################ + + +BEGIN_PGML_SOLUTION + +Since [` x^{1/2}=\sqrt{x} `], we have: + +1) [`` [$a]^{\frac{[$b]}{[$c]}} = \sqrt{[$a]} = [$ans1] ``] + +2) [`` (-[$a])^{\frac{[$b]}{[$c]}} = \sqrt{-[$a]} = \text{undefined} ``] + +3) [`` -[$a]^{\frac{[$b]}{[$c]}} = -\sqrt{[$a]} = [$ans3] ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent20.pg new file mode 100644 index 0000000000..bb1597dce4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent20.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Evaluate an expression with a fractional exponent. +# +# Last edited: Carl Yao 7/21/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','cube root','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$a = (random(2,5,1))**3; +$b = 1; +$c = 3; + +$ans1 = ($a)**($b/$c); +$ans1 = Compute("$ans1"); +$ans2 = Compute("-$ans1"); +$ans3 = Compute("-$ans1"); + + +##################################################### + +BEGIN_PGML + +Without using a calculator, evaluate the expression. + +[@KeyboardInstructions('If a value is not defined as a real number, type [|DNE|]* for "does not exist".')@]** + +a. [`` [$a]^{\frac{[$b]}{[$c]}}= ``][_______]{$ans1} + +a. [`` (-[$a])^{\frac{[$b]}{[$c]}}= ``][_______]{$ans2} + +a. [`` -[$a]^{\frac{[$b]}{[$c]}}= ``][_______]{$ans3} + +END_PGML + +############################################################ + + +BEGIN_PGML_SOLUTION + +Since [` x^{1/3}=\sqrt[3]{x} `], we have: + +1) [`` [$a]^{\frac{[$b]}{[$c]}} = \sqrt[3]{[$a]} = [$ans1] ``] + +2) [`` (-[$a])^{\frac{[$b]}{[$c]}} = \sqrt[3]{-[$a]} = [$ans2] ``] + +2) [`` -[$a]^{\frac{[$b]}{[$c]}} = -\sqrt[3]{[$a]} = [$ans3] ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent25.pg new file mode 100644 index 0000000000..4c15e513ae --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent25.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Evaluate an expression with a fractional exponent. +# +# Last edited: Carl Yao 7/21/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','cube root','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$a =list_random(2,3,5); +if ($a==2) { + do { + $b=random(1,7,1); + $c=random(2,7,1); + $bc=$b*$c; + $d=random(1,6,1); + $bd=$b*$d; + } until ( (gcd($d,$c)==1) && ($bd<=7) && ($bc<=7) ); +} elsif ($a==3) { + do { + $b=random(1,4,1); + $c=random(2,4,1); + $bc=$b*$c; + $d=random(1,4,1); + $bd=$b*$d; + } until ( (gcd($d,$c)==1) && ($bd<=4) && ($bc<=4) ); +} elsif ($a==5) { + do { + $b=random(1,3,1); + $c=random(2,3,1); + $bc=$b*$c; + $d=random(1,3,1); + $bd=$b*$d; + } until ( (gcd($d,$c)==1) && ($bd<=3) && ($bc<=3) ); +} +$num = $a**($bc); + +Context("Fraction"); +$e = $a**$bd; +$ans = Fraction(1,$e); + +##################################################### + +BEGIN_PGML + +Without using a calculator, evaluate the expression. + + [`` [$num]^{-\frac{[$d]}{[$c]}} = ``][__________]{$ans} + +END_PGML + +############################################################ + + +BEGIN_PGML_SOLUTION + +Recognize that [`[$num]=[$a]^{[$bc]}`], and we have: + + [`` +\begin{aligned} + &\phantom{{}=}[$num]^{-\frac{[$d]}{[$c]}} \\ + &=([$a]^{[$bc]})^{-\frac{[$d]}{[$c]}} \\ + &=[$a]^{-[$bd]} \\ + &=\frac{1}{[$a]^{[$bd]}} \\ + &=\frac{1}{[$e]} +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent26.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent26.pg new file mode 100644 index 0000000000..e81f068138 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent26.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Evaluate an expression with a fractional exponent. +# +# Last edited: Carl Yao 7/26/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','cube root','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Fraction"); + +$a =list_random(2,3,5); +if ($a==2) { + do { + $b=random(1,7,1); + $c=random(2,7,1); + $bc=$b*$c; + $d=random(1,6,1); + $bd=$b*$d; + } until ( (gcd($d,$c)==1) && ($bd<=7) && ($bc<=7) ); +} elsif ($a==3) { + do { + $b=random(1,4,1); + $c=random(2,4,1); + $bc=$b*$c; + $d=random(1,4,1); + $bd=$b*$d; + } until ( (gcd($d,$c)==1) && ($bd<=4) && ($bc<=4) ); +} elsif ($a==5) { + do { + $b=random(1,3,1); + $c=random(2,3,1); + $bc=$b*$c; + $d=random(1,3,1); + $bd=$b*$d; + } until ( (gcd($d,$c)==1) && ($bd<=3) && ($bc<=3) ); +} +$num = $a**($bc); + +$ans = $a**$bd; +$ans = Compute("$ans"); + +##################################################### + +BEGIN_PGML + +Without using a calculator, evaluate the expression. + + [`` \left(\frac{1}{[$num]}\right)^{-\frac{[$d]}{[$c]}} = ``][_______]{$ans} + +END_PGML + +############################################################ + + +BEGIN_PGML_SOLUTION + +We need to review that [` \frac{1}{x^n} = x^{-n} `]. + +Recognize that [`[$num]=[$a]^{[$bc]}`], and we have: + + [`` +\begin{aligned} + &\phantom{{}=}(\frac{1}{[$num]})^{-\frac{[$d]}{[$c]}} \\ + &=(\frac{1}{[$a]^{[$bc]}})^{-\frac{[$d]}{[$c]}} \\ + &=([$a]^{-[$bc]})^{-\frac{[$d]}{[$c]}} \\ + &=[$a]^{[$bd]} \\ + &=[$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent30.pg new file mode 100644 index 0000000000..3a19383cc1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent30.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Evaluate an expression with a fractional exponent. +# +# Last edited: Carl Yao 7/21/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("LimitedNumeric"); + +$radD = random(2,5,1); +if ($radD==5) {$num=2**5;} +elsif ($radD==4) {$num=(random(2,3,1))**4;} +elsif ($radD==3) {$num=(random(2,5,1))**3;} +else {$num=(random(2,10,1))**2;} + +if ($radD>2) {do{$radN = random(2,$radD-1,1);}until(gcd($radN,$radD)==1);} +else {$radN = 3;} + +$root = $num**(1/$radD); +$ans = $num**($radN/$radD); + + +##################################################### + +BEGIN_PGML + +Without using a calculator, evaluate the expression. + + [`` \sqrt[[$radD]]{[$num]^{[$radN]}}= ``][__________]{$ans} + +END_PGML + +############################################################ + + +BEGIN_PGML_SOLUTION + +Radicals can be converted into fractional exponents this way: + + [`` \sqrt[n]{x^{m}} = (x^{m})^{\frac{1}{n}} = x^{\frac{m}{n}} ``] + +For this problem, we have: + + [`` \sqrt[[$radD]]{[$num]^{[$radN]}} = ([$num]^{[$radN]})^{\frac{1}{[$radD]}} = [$num]^{\frac{[$radN]}{[$radD]}} ``] + +Next, notice that [`[$num]`] is a special number in that [`[$num]=[$root]^{[$radD]}`]. We will do a substitution, and we have: + + [`` [$num]^{\frac{[$radN]}{[$radD]}}=([$root]^{[$radD]})^{\frac{[$radN]}{[$radD]}} = [$root]^{[$radN]} ``] + +You can enter either [`[$root]`]^[`[$radN]`] or [`[$ans]`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent40.pg new file mode 100644 index 0000000000..63e7875b2a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent40.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Evaluate an expression with a fractional exponent. +# +# Last edited: Carl Yao 7/21/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +do { + $factor1 = random(3,5,1); + do {$factor2 = random(2,5,1);} until (gcd($factor2,$factor1)==1); +} until ($factor1*$factor2<=10); + +$num = 2**($factor1*$factor2); + +$ans = 2**($factor2); + + +##################################################### + +BEGIN_PGML + +Without using a calculator, evaluate the expression. + + [`` \sqrt[[$factor1]]{[$num]}= ``][__________]{$ans} + +END_PGML + +############################################################ + + +BEGIN_PGML_SOLUTION + +Radicals can be converted into fractional exponents this way: + + [`` \sqrt[n]{x^{m}} = (x^{m})^{\frac{1}{n}} = x^{\frac{m}{n}} ``] + +For this problem, we have: + + [`` \sqrt[[$factor1]]{[$num]}= ([$num])^{\frac{1}{[$factor1]}} ``] + +Next, notice that [`[$num]`] is a special number in that [`[$num]=2^{[$factor1*$factor2]}`]. We will do a substitution, and we have: + + [`` ([$num])^{\frac{1}{[$factor1]}} = (2^{[$factor1*$factor2]})^{\frac{1}{[$factor1]}} = 2^{[$factor2]} ``] + +You can enter either [`2`]^[`[$factor2]`] or [`[$ans]`]. + +It's useful to recognize power of 2's: + + [`` +\begin{aligned}[t] + 2^{2}&=4 \\ + 2^{3}&=8 \\ + 2^{4}&=16 \\ + 2^{5}&=32 \\ + 2^{6}&=64 \\ + 2^{7}&=128 \\ + 2^{8}&=256 \\ + 2^{9}&=512 \\ + 2^{10}&=1024 \\ + ... +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots10.pg new file mode 100644 index 0000000000..9856fccbc2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots10.pg @@ -0,0 +1,78 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Evaluate 8^(1/3) and (-8)^(1/3) +# +# Last edited: Carl Yao 04/22/2014 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('cube root','radical','simplify') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +########Begin Problem Setup############ + +Context("LimitedNumeric"); +Context()->strings->add("not a real number"=>{}); +Context()->strings->add("not real"=>{alias=>"not a real number"}); + +$a = list_random(1,2,3,4); +$b = $a**3; + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Without using a calculator, evaluate the expression. + +[@KeyboardInstructions('If a value is not defined as a real number, type [|DNE|]* for "does not exist".')@]** + +a. [``\sqrt[3]{[$b]} =``] [_______]{Compute("$a")} + +a. [``\sqrt[3]{-[$b]} =``] [_______]{Compute("-$a")} + +a. [``-\sqrt[3]{[$b]} =``] [_______]{Compute("-$a")} + +END_PGML + +################################################# + +BEGIN_PGML_SOLUTION + + a) [`\sqrt[3]{[$b]} = [$a]`] because [`[$a]^{3}=[$b]`]. + + b) [`\sqrt[3]{-[$b]} = -[$a]`] because [`(-[$a])^{3}=-[$b]`]. + + c) To calculate [`-\sqrt[3]{[$b]} `], we first handle the radical part, [`\sqrt[3]{[$b]} `]. By the result of the first part, we have [`\sqrt[3]{[$b]} = [$a]`]. Next, we apply the negative symbol, and we have [`` -\sqrt[3]{[$b]} = -[$a] ``]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots20.pg new file mode 100644 index 0000000000..1763f4dd1f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots20.pg @@ -0,0 +1,78 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Evaluate 16^(1/4), -16^(1/4), (-16)^(1/4) +# +# Last edited: Carl Yao 04/22/2014 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('radical','simplify') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +########Begin Problem Setup############ + +Context("LimitedNumeric"); +Context()->strings->add("not a real number"=>{alias=>"DNE"}); +Context()->strings->add("not real"=>{alias=>"not a real number"}); + +$a = list_random(1,2,3); +$b = $a**4; + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Without using a calculator, evaluate the expression. + +[@KeyboardInstructions('If a value is not defined as a real number, type [|DNE|]* for "does not exist".')@]** + +a. [``\sqrt[4]{[$b]} =``] [_______]{Compute("$a")} + +a. [``\sqrt[4]{-[$b]} =``] [_______]{Compute("DNE")} + +a. [``-\sqrt[4]{[$b]} =``] [_______]{Compute("-$a")} + +END_PGML + +################################################# + +BEGIN_PGML_SOLUTION + + a) [`\sqrt[4]{[$b]} = [$a]`] because [`[$a]^{4}=[$b]`]. + + b) [`\sqrt[4]{-[$b]}`] is not a real number because no number raised to the fourth power produces a negative number. For example, [`(-[$a])^{4}=(-[$a])(-[$a])(-[$a])(-[$a])=[$b]`]. + + c) To calculate [`-\sqrt[4]{[$b]} `], we first handle the radical part, [`\sqrt[4]{[$b]} `]. By the result of the first part, we have [`\sqrt[4]{[$b]} = [$a]`]. Next, we apply the negative symbol, and we have [`` -\sqrt[4]{[$b]} = -[$a] ``]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots30.pg new file mode 100644 index 0000000000..8cdfef4045 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots30.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the value of a radical. +# +# Last edited: Carl Yao 7/21/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $a = random(2,20,1); + $b = random(2,4,1); + $c = random($b+1,$b+3,1); + $ans = $a**($b/$c); +} until ( (gcd($b,$c)==1) && (int($ans)!=$ans) ); + +$ansShow = sprintf("%.2f",$ans); + +##################################################### + +BEGIN_PGML + +Use a calculator to evaluate the expression as a decimal to four significant digits. + +[@KeyboardInstructions('If a value is not defined as a real number, type [|DNE|]* for "does not exist".')@]** + + [``\sqrt[[$c]]{[$a]^{[$b]}}=``][________]{$ans} + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Radicals can be converted into fractional exponents this way: + + [`` \sqrt[n]{x^{m}} = (x^{m})^{\frac{1}{n}} = x^{\frac{m}{n}} ``] + +For this problem, we have: + + [`` \sqrt[[$c]]{[$a]^{[$b]}} = ([$a]^{[$b]})^{\frac{1}{[$c]}} = [$a]^{\frac{[$b]}{[$c]}} ``] + +Next, enter [`[$a]`]^[`([$b]/[$c])`] into a graphing calculator, and we get the answer [`[$ans]`]. Round it to two decimal places, we have: + + [`` \sqrt[[$c]]{[$a]^{[$b]}} \approx [$ansShow] ``] + +Remember that, in TI-89, we need to press Diamond Enter to get decimal answers; and in Casio ClassPad 330, we have to tap the Fraction to Decimal icon. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots35.pg new file mode 100644 index 0000000000..9b8915e3a8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots35.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the value of a radical. +# +# Last edited: Carl Yao 7/21/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $a = -random(2,20,1); + $b = random(3,9,2); + $ans = -(-$a)**(1/$b); +} until (int($ans)!=$ans); + +$ansShow = sprintf("%.2f",$ans); + +##################################################### + +BEGIN_PGML + +With a calculator, evaluate this radical. Round your answer to two decimal places. + + [``\sqrt[[$b]]{[$a]}=``][________]{$ans} + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Radicals can be converted into fractional exponents this way: + + [`` \sqrt[n]{x^{m}} = (x^{m})^{\frac{1}{n}} = x^{\frac{m}{n}} ``] + +For this problem, we have: + + [`` \sqrt[[$b]]{[$a]} = ([$a])^{\frac{1}{[$b]}} = ([$a])^{\frac{1}{[$b]}} ``] + +Next, enter [`([$a])`]^[`(1/[$b])`] into a graphing calculator, and we get the answer [`[$ans]`]. Round it to two decimal places, we have: + + [`` \sqrt[[$b]]{[$a]} \approx [$ansShow] ``] + +Remember that, in TI-89, we need to press Diamond Enter to get decimal answers; and in Casio ClassPad 330, we have to tap the Fraction to Decimal icon. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots40.pg new file mode 100644 index 0000000000..a273aa3af3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots40.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify cube root of (a/b); the answer is a fraction. +# +# Last edited: Carl Yao, 7/22/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('cube root','radical','simplify') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +########Begin Problem Setup############ + +Context("Fraction"); + +do { + $a = random(1,5,1); + $b = random(1,5,1); +} while (gcd($b,$a)!=1 or $a>$b); +$answer = -Fraction($a,$b); +$a3 = $a**3; +$b3 = $b**3; +$num = $answer**3; + +Context("LimitedRadical"); + +$answer = -Formula("$a/$b"); + +Context()->strings->add("not a real number"=>{}); +#For good measure, add shortcuts a student might try: +Context()->strings->add("not real"=>{alias=>"not a real number"}); + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +# Best practices always include this command here + +BEGIN_PGML + +Without using a calculator, evaluate the expression. + + [`` \sqrt[3]{[$num]}= ``] [_______]{$answer}. + +END_PGML + +####################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + \sqrt[3]{[$num]} &= -\frac{\sqrt[3]{[$a3]}}{\sqrt[3]{[$b3]}} \\ + &= [$answer] +\end{aligned} + ``] + +Note that we can take out the negative sign, because only a negative number's cube can produce a negative number like [`[$num]`]. + +It's useful to recognize the following perfect cube numbers: + + [`` +\begin{aligned}[t] + 1^{3} &= 1 \\ + 2^{3} &= 8 \\ + 3^{3} &= 27 \\ + 4^{3} &= 64 \\ + 5^{3} &= 125 +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot20.pg new file mode 100644 index 0000000000..d3ac2fefe8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot20.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Kandace Kling +# Portland Community College +# +# Simplify sqrt(a/b); the answer is a fraction. +# +# Last edited: Hughes 9/9/13, Jordan 8/1/13; Carl Yao, 7/22/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('square root','radical','simplify') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Kandace Kling, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("Fraction"); + +#Almost always declare the context right away + +$a = random(1,11,1); +do {$b = random(1,12,1);} while (gcd($b,$a)!=1 or $a>$b); +$answer = Fraction($a,$b); +$a2 = $a**2; +$b2 = $b**2; +$sq = $answer**2; + +Context("LimitedRadical"); + +$answer = Formula("$a/$b"); + +Context()->strings->add("not a real number"=>{}); +#For good measure, add shortcuts a student might try: +Context()->strings->add("not real"=>{alias=>"not a real number"}); + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +# Best practices always include this command here + +BEGIN_PGML + +Evaluate the following. + +[@KeyboardInstructions('If this expression is not a real number, enter [|not a real number|]*.')@]** + + [``\sqrt{[$sq]}={}``][______________]{$answer}. + +END_PGML + +####################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + \sqrt{\frac{[$a2]}{[$b2]}} &= \frac{\sqrt{[$a2]}}{\sqrt{[$b2]}} \\ + &= \frac{[$a]}{[$b]} +\end{aligned} +``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg new file mode 100644 index 0000000000..13ddd96ce1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg @@ -0,0 +1,76 @@ +# WeBWorK problem written by Kandace Kling +# Portland Community College +# +# Simplify -sqrt(a), where a is a square number. +# +# Last edited: Hughes 9/9/13, Carl Yao, 7/22/13, Kling 7/10/13 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('square root','radical','simplify') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Kandace Kling, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", +, + "PCCmacros.pl", + "PGcourse.pl", +); + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("LimitedRadical"); +#Almost always declare the context right away + +$a = random(2,12,1); + +Context()->strings->add("not a real number"=>{}); +#For good measure, add shortcuts a student might try: +Context()->strings->add("not real"=>{alias=>"not a real number"}); + + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +# Best practices always include this command here + +BEGIN_PGML + +Evaluate the following. + +[@KeyboardInstructions('If this expression is not a real number, enter [|not a real number|]*.')@]** + + [`-\sqrt{[$a**2]}={}`][______________]{Formula("-$a")}. + +END_PGML + +################################################# + +BEGIN_PGML_SOLUTION + + [`` -\sqrt{[$a**2]}=-[$a] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg new file mode 100644 index 0000000000..84b1d74310 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Kandace Kling +# Portland Community College +# +# Simplify sqrt(-a). Answer is "not a real number". +# +# Last edited: Carl Yao, 07/22/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('square root','radical','simplify') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Kandace Kling, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed +, + "PCCmacros.pl", + "PGcourse.pl", +); + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("LimitedNumeric"); +#Almost always declare the context right away + +$a = random(2,12,1); +$answer = "not a real number"; + +Context()->strings->add("not a real number"=>{}); +#For good measure, add shortcuts a student might try: +Context()->strings->add("not real"=>{alias=>"not a real number"}); + + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +# Best practices always include this command here + +BEGIN_PGML + +Evaluate the following. + +[@KeyboardInstructions('If this expression is not a real number, enter [|not a real number|]*.')@]** + + [:sqrt(-[$a**2])=:][______________]{$answer}. + +END_PGML + +##################################### + +BEGIN_PGML_SOLUTION + +The square root of a negative number is [|not a real number|]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot40.pg new file mode 100644 index 0000000000..0b4617bb12 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot40.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Kandace Kling +# Portland Community College +# +# Simplify sqrt(-a/b). Solution is "not a real number." +# +# Last edited: Hughes 9/9/13, Carl Yao 7/22/2013, Kling 7/10/13 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('square root','radical','simplify') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Kandace Kling, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("LimitedFraction"); + + +#Almost always declare the context right away + +$a = random(1,11,1); +do {$b = random(1,12,1);} while (gcd($a,$b)!=1 or $a>$b); +$answer = Fraction($a,$b); +$sq = $answer**2; + +Context("LimitedComplex"); + +Context()->strings->add("not a real number"=>{}); +#For good measure, add shortcuts a student might try: +Context()->strings->add("not real"=>{alias=>"not a real number"}); +Context()->functions->disable("sqrt"); + +$answer = OneOf("not a real number","$answer i"); + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +# Best practices always include this command here + +BEGIN_PGML + + +Evaluate the following. + +[@KeyboardInstructions('If this expression is not a real number, enter [|not a real number|]*.')@]** + + + [``\sqrt{-[$sq]}={}``][________________]{$answer}. + +END_PGML + +######################################################### + +BEGIN_PGML_SOLUTION + +The square root of a negative number is [|not a real number|]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot50.pg new file mode 100644 index 0000000000..cb73452ffc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot50.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Kandace Kling +# Portland Community College +# +# Simplify -sqrt(a/b), where a and b are square numbers. +# +# Last edited: Hughes 9/9/13, Carl Yao 7/22/2013, Kling 7/10/13 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('square root','radical','simplify') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Kandace Kling, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("Fraction"); + +#Almost always declare the context right away + +$a = random(1,11,1); +do {$b = random(2,12,1);} while (gcd($a,$b)!=1 or $a>$b); +$answer = -Fraction($a,$b); +$sq = $answer**2; + +Context("LimitedRadical"); +$answer = Formula("$answer"); + +Context()->strings->add("not a real number"=>{}); +#For good measure, add shortcuts a student might try: +Context()->strings->add("not real"=>{alias=>"not a real number"}); + + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +# Best practices always include this command here + +BEGIN_PGML + + +Evaluate the following. + +[@KeyboardInstructions('If this expression is not a real number, enter [|not a real number|]*.')@]** + + + [``-\sqrt{[$sq]}={}``][________________]{$answer}. + +END_PGML + + +######################################################### + +$a2= $a*$a; +$b2= $b*$b; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + -\sqrt{\frac{[$a2]}{[$b2]}} &= - \frac{\sqrt{[$a2]}}{\sqrt{[$b2]}} \\ + &= - \frac{[$a]}{[$b]} +\end{aligned} + ``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot60.pg new file mode 100644 index 0000000000..c3f16c54a1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot60.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Kandace Kling +# Portland Community College +# +# Simplify sqrt(a)-sqrt(b), where a and b are square numbers. +# +# Last edited: Hughes 9/9/13, Jordan 8/27/13; Carl Yao 7/22/2013, Kling 7/10/13 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('square root','radical','simplify') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Kandace Kling, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed, + "contextLimitedRadical.pl" +, + "PCCmacros.pl", + "PGcourse.pl", +); + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("LimitedRadical"); +#Almost always declare the context right away + +# Pythagorean triples +@pairs=([3,5],[4,5],[6,10],[8,10],[5,13],[12,13]); +$i = random(0,5,1); +$a = $pairs[$i][0]; +$b = $pairs[$i][1]; +$a2 = $a*$a; +$b2 = $b*$b; +$ans1 = $b-$a; +$ans2 = sqrt($b2-$a2); + +$ans1 = Formula("$ans1"); +$ans2 = Formula("$ans2"); + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +# Best practices always include this command here + +BEGIN_PGML + +Evaluate the following. + +[@KeyboardInstructions('If the expression is not a real number, enter [|not a real number|]*.')@]** + + a) [::sqrt([$b2])-sqrt([$a2])=::] [______________]{$ans1} + + b) [::sqrt([$b2]-[$a2])=::] [______________]{$ans2} + +END_PGML + + +######################################################### + +$s1=$b2-$a2; + +BEGIN_PGML_SOLUTION + + a) [`` +\begin{aligned}[t] + \sqrt{[$b2]}-\sqrt{[$a2]} &= [$b] - [$a] \\ + &= [$ans1] +\end{aligned} + ``] +---- + b) [`` +\begin{aligned}[t] + \sqrt{[$b2]-[$a2]} &= \sqrt{[$s1]} \\ + &= [$ans2] +\end{aligned} + ``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FOILradical1.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FOILradical1.pg new file mode 100644 index 0000000000..aab54f6ba3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FOILradical1.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Jeremy Shaw +# Portland Community College +# +# Simplify (a-sqrt(b))(a+sqrt(b)) +# +# Last edited: Carl Yao 7/26/2013 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','FOIL','difference of squares','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + + +$radicand = list_random(5,6,7,11,13); +$num = random(3,10,1); + +Context("LimitedRadical"); +$sqrt = Formula("sqrt([$radicand])"); + +Context("LimitedNumeric"); +$answer = Real($num**2 - $radicand); + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +# Best practices always include this command here. It is responsible for +# the gray box around the problem, problem enumeration, and the path to the +# source .pg file. + +#Current best practice is to use the PGML environment to write the body. +BEGIN_PGML + +Expand and simplify the expression. + +[``\left([$num] - [$sqrt]\right)\left([$num] + [$sqrt]\right) =``] [______________________]{$answer} + +END_PGML + +########Begin more complicated answer processing (if needed)############ + +#Not needed in this template. + +########Begin answer hints.############ + +#Not used in this template. For the PCC coding projects, I think that this +#feature will rarely be used the first go-around. + +########Begin solution.############ + +#The walk-through solution is presented to students after the due date, and +#may soon also be used with a "show me how to do this" button that gives a +#walk-through for a similar but randomly generated problem. + +BEGIN_PGML_SOLUTION + +Use the FOIL method to multiply these binomial expressions together, or notice +that we have the difference of squares formula: + + [`` (A+B)(A-B)=A^{2}-B^{2} ``] + +We have: + + [`` +\begin{aligned}[t] + ([$num] - [$sqrt])([$num] + [$sqrt]) + &= [$num]^2 - \left([$sqrt]\right)^2 \\ + &= [$num**2] - [$radicand] \\ + &= [$answer] +\end{aligned} + ``] + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg index acb0fe4d44..885d56990a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg @@ -8,16 +8,18 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Radical_FOIL2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','FOIL','difference of squares','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -27,11 +29,12 @@ DOCUMENT(); # for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -63,11 +66,9 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Multiply by using the FOIL method. Simplify and combine like radicals -if necessary. Use sqrt for the square root symbol (Example: [``\sqrt{2} =``] -sqrt(2).) +Expand and simplify the expression. -[``([$sqrt1] + [$sqrt2])([$sqrt1] - [$sqrt2]) =``] [__________________]{$answer} +[``\left([$sqrt1] + [$sqrt2]\right)\left([$sqrt1] - [$sqrt2]\right) =``] [__________________]{$answer} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg index 2b88e5516c..8b83a22e53 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg @@ -8,16 +8,18 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Radical_FOIL2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','FOIL','difference of squares','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -27,11 +29,12 @@ DOCUMENT(); # for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -64,11 +67,9 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Multiply by using the FOIL method. Simplify and combine like radicals -if necessary. Use sqrt for the square root symbol (Example: [``\sqrt{2} =``] -sqrt(2).) +Expand and simplify the expression. -[``([$sqrt1] + [$sqrt2])([$sqrt1] - [$sqrt2]) =``] [__________________]{$answer} +[``\left([$sqrt1] + [$sqrt2]\right)\left([$sqrt1] - [$sqrt2]\right) =``] [__________________]{$answer} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical10.pg new file mode 100644 index 0000000000..23f1d29e76 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical10.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Convert fractional exponent to radical. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextForm.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Form"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->variables->set($var=>{limits=>[1,10]}); +$showPartialCorrectAnswers = 1; + +do { + $a = random(2,5,1); + $b = random($a+1,8,1); +} until (gcd($a,$b)==1); + + +$answer = Formula("root($b,$var^$a)"); + +##################################################### + +BEGIN_PGML + +Convert [` [$var]^{\frac{[$a]}{[$b]}} `] to a radical expression. + +[@KeyboardInstructions("To enter [`\\sqrt[n]{x}`], type [|root(n,x)|]*.");@]** + +[__]{$answer}{10} + +END_PGML + +############################################################ + +BEGIN_PGML_SOLUTION + +Fraction exponents can be converted into radicals this way: + + [`` x^{\frac{m}{n}} = (x^{m})^{\frac{1}{n}} = \sqrt[n]{x^{m}} ``] + +For this problem, we have: + + [`` [$var]^{\frac{[$a]}{[$b]}} = ([$var]^[$a])^{\frac{1}{[$b]}} = \sqrt[[$b]]{[$var]^[$a]} ``] + + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical11.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical11.pg new file mode 100644 index 0000000000..0931e55641 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical11.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Convert fractional exponent to radical. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +$showPartialCorrectAnswers = 1; + +do { + $a = random(2,5,1); + $b = random($a+1,8,1); +} until (gcd($a,$b)==1); + + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..1) { + do {$temp = list_random(0..1)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + +$choices[$scramble{0}] = "\sqrt[$b]{$var^{$a}}"; + +$choices[$scramble{1}] = "\sqrt[$a]{$var^{$b}}"; + +$radio = RadioButtons( + ["A","B"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Convert [` [$var]^{\frac{[$a]}{[$b]}} `] to a radical. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Fraction exponents can be converted into radicals this way: + + [`` x^{\frac{m}{n}} = (x^{m})^{\frac{1}{n}} = \sqrt[n]{x^{m}} ``] + +For this problem, we have: + + [`` [$var]^{\frac{[$a]}{[$b]}} = ([$var]^[$a])^{\frac{1}{[$b]}} = \sqrt[[$b]]{[$var]^[$a]} ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical20.pg new file mode 100644 index 0000000000..7697742ebb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical20.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with variables. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextForm.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Form"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +$showPartialCorrectAnswers = 1; + +do { + $a = random(2,5,1); + $b = random($a+1,8,1); +} until (gcd($a,$b)==1); + + +$answer = Formula("1/root($b,$var^$a)"); + +##################################################### + +BEGIN_PGML + +Convert [` [$var]^{-\frac{[$a]}{[$b]}} `] to a radical expression. + +[@KeyboardInstructions("To enter [`\\sqrt[n]{x}`], type [|root(n,x)|]*.");@]** + +[__]{$answer}{10} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +First, recall how to handle negative exponents: + + [`` x^{-n} = \frac{1}{x^n} ``] + +Fraction exponents can be converted into radicals this way: + + [`` x^{\frac{m}{n}} = (x^{m})^{\frac{1}{n}} = \sqrt[n]{x^{m}} ``] + +For this problem, we have: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$var]^{-\frac{[$a]}{[$b]}} \\ + &= \frac{1}{[$var]^{\frac{[$a]}{[$b]}}}\\ + &= \frac{1}{([$var]^[$a])^{\frac{1}{[$b]}}} \\ + &= \frac{1}{\sqrt[[$b]]{[$var]^[$a]}} +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical30.pg new file mode 100644 index 0000000000..b2aa81411c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical30.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Convert fractional exponent to radical. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextForm.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Form"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +$showPartialCorrectAnswers = 1; + +do { + $a = random(2,5,1); + $b = random($a+1,8,1); +} until (gcd($a,$b)==1); +$num = list_random(2,3,5,7); + +$answer = Formula("root($b,$num*$var^$a)"); + +##################################################### + +BEGIN_PGML + +Convert [`[$num]^{\frac{1}{[$b]}} [$var]^{\frac{[$a]}{[$b]}} `] to a radical expression. + +[@KeyboardInstructions("To enter [`\\sqrt[n]{x}`], type [|root(n,x)|]*.");@]** + +[__]{$answer}{10} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Fraction exponents can be converted into radicals this way: + + [`` x^{\frac{m}{n}} = (x^{m})^{\frac{1}{n}} = \sqrt[n]{x^{m}} ``] + +For this problem, we have: + + [`` [$num]^{\frac{[$c]}{[$b]}} [$var]^{\frac{[$a]}{[$b]}} = ([$num]^{[$c]} [$var]^[$a])^{\frac{1}{[$b]}} = \sqrt[[$b]]{[$num]^{[$c]} [$var]^[$a]} ``] + + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical31.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical31.pg new file mode 100644 index 0000000000..cb23f529b3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical31.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Convert fractional exponent to radical. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +$showPartialCorrectAnswers = 1; + +do { + $a = random(2,5,1); + do {$c = random(2,5,1);} until ($a!=$c); + $b = random($a+1,8,1); +} until ( (gcd($a,$b)==1) && (gcd($c,$b)==1) ); +$num = list_random(2,3,5,7); + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + +$choices[$scramble{0}] = "\sqrt[$b]{$num^{$c} $var^{$a}}"; + +if ($a==2) { + $choices[$scramble{3}] = "$num^{$b} \cdot \sqrt{$var^{$b}}"; + if ($c==2) { + $choices[$scramble{1}] = "\sqrt{$num^{$b}} \cdot \sqrt{$var^{$b}}"; + } else { + $choices[$scramble{1}] = "\sqrt[$c]{$num^{$b}} \cdot \sqrt{$var^{$b}}"; + } +} else { + $choices[$scramble{3}] = "$num^{$b} \cdot \sqrt[$a]{$var^{$b}}"; + if ($c==2) { + $choices[$scramble{1}] = "\sqrt{$num^{$b}} \cdot \sqrt[$a]{$var^{$b}}"; + } else { + $choices[$scramble{1}] = "\sqrt[$c]{$num^{$b}} \cdot \sqrt[$a]{$var^{$b}}"; + } +} + +$choices[$scramble{2}] = "$num^{$c} \cdot \sqrt[$b]{$var^{$a}}"; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Convert [`[$num]^{\frac{[$c]}{[$b]}} [$var]^{\frac{[$a]}{[$b]}} `] to a radical. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Fraction exponents can be converted into radicals this way: + + [`` x^{\frac{m}{n}} = (x^{m})^{\frac{1}{n}} = \sqrt[n]{x^{m}} ``] + +For this problem, we have: + + [`` [$num]^{\frac{[$c]}{[$b]}} [$var]^{\frac{[$a]}{[$b]}} = ([$num]^{[$c]} [$var]^[$a])^{\frac{1}{[$b]}} = \sqrt[[$b]]{[$num]^{[$c]} [$var]^[$a]} ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg index 8ce26b6bff..d57a452e10 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg @@ -10,16 +10,18 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(mult_with_radicals2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -30,7 +32,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -56,7 +59,7 @@ $h = Formula("$c*sqrt($f)"); TEXT(beginproblem()); BEGIN_PGML -Simplify the expression. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`[$a]\sqrt{[$e]} \cdot [$b]\sqrt{[$d]}=`] [_____________]{$h} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg index 2834401f06..ca2bbdb588 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg @@ -9,16 +9,18 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(mult_with_radicals2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -56,7 +59,7 @@ $h = Formula("$cd*sqrt($e)"); TEXT(beginproblem()); BEGIN_PGML -Simplify the expression. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`[$a]\sqrt{[$e]} \cdot [$b]\sqrt{[$g]} =`] [_________________]{$h} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg index b96b3888fe..07d04082db 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(mult_with_radicals2) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -29,7 +30,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -186,7 +188,7 @@ $output32 = "$coefProduct \cdot".$line32Center.'\\'; TEXT(beginproblem()); BEGIN_PGML -Simplify the expression. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [``[$coef1]\sqrt{[$rad1]} \cdot [$coef2]\sqrt{[$rad2]}=``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg index 9fca040536..cf8827ef39 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(mult_with_radicals2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','multiply') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -27,7 +29,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -53,7 +56,7 @@ $ans = Formula("$ans"); BEGIN_PGML -Do the multiplication and simplify the result. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` [$sqrt1] \cdot [$sqrt2] = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals44.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals44.pg new file mode 100644 index 0000000000..bb9e3519ac --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals44.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Multiply two radicals. +# +# Last edited: Carl Yao 7/29/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','multiply') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); + +Context("LimitedRadical"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +do { + $b = random(4,10,2); + $c = random(1,$b-1,2); +} until ($b/2 != $c); +$d = $b-$c; +$b2 = $b/2; + +$sqrt1 = Formula("sqrt($var**$c)")->reduce; +$sqrt2 = Formula("sqrt($var**$d)")->reduce; +$ans = Formula("$var**$b2"); + +########################################## + +BEGIN_PGML + +Do the multiplication and simplify the result. + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* Assume all variables are positive. + + [`` [$sqrt1] \cdot [$sqrt2] = ``] [_____________]{$ans} + +END_PGML + +############################################################ + +$s1 = Compute("$var**$c")->reduce; +$s2 = Compute("$var**$d")->reduce; + +BEGIN_PGML_SOLUTION + +We will use the multiplication property of radicals: + + [`` \sqrt{a} \cdot \sqrt{b} = \sqrt{ab} ``] + +We have: + + [`` +\begin{aligned}[t] + [$sqrt1] \cdot [$sqrt2] + &= \sqrt{[$s1] \cdot [$s2]} \\ + &= \sqrt{[$var]^{[$b]}} \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals45.pg new file mode 100644 index 0000000000..1c2d274c2b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals45.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Multiply two radicals. +# +# Last edited: Carl Yao 7/29/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','multiply') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$a = list_random(4,6,8,9,10); +$a2 = $a**2; + +do {$rad1 = random(2,int(sqrt($a2)),1);} until (($a2%$rad1==0) && ($rad1!=$a)); +$rad2 = $a2/$rad1; + +$coef2 = random(2,10,1); +$ans = $coef2*$a; + +Context("LimitedRadical"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +do { + $b = random(4,10,2); + $c = random(1,$b-1,1); +} until ($b/2!=$c); +$d = $b-$c; +$b2 = $b/2; + +$sqrt1 = Formula("sqrt($rad1*$var**$c)")->reduce; +$sqrt2 = Formula("$coef2*sqrt($rad2*$var**$d)")->reduce; +$ans = Formula("$ans $var**$b2"); + +########################################## + +BEGIN_PGML + +Do the multiplication and simplify the result. + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* Assume all variables are positive. + + [`` [$sqrt1] \cdot [$sqrt2] = ``] [_____________]{$ans} + +END_PGML + +############################################################ + +$s1 = Formula("[$var]^[$c]")->reduce; +$s2 = Formula("[$var]^[$d]")->reduce; + +BEGIN_PGML_SOLUTION + +We will use the multiplication property of radicals: + + [`` \sqrt{a} \cdot \sqrt{b} = \sqrt{ab} ``] + +We have: + + [`` +\begin{aligned}[t] + [$sqrt1] \cdot [$sqrt2] + &= [$coef2] \sqrt{[$rad1] [$s1]} \cdot \sqrt{[$rad2] [$s2]} \\ + &= [$coef2] \sqrt{[$rad1] \cdot [$rad2] \cdot [$var]^{[$b]}} \\ + &= [$coef2] [$var]^{[$b2]} \sqrt{[$a2]} \\ + &= [$coef2] \cdot [$a] \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals50.pg new file mode 100644 index 0000000000..079d67d9f8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals50.pg @@ -0,0 +1,227 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Multiply two radicals with variables. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 2; + +@num = (2,3,$var1,$var2); +@power = (); +@integer = (); +@numOut=(); +@numIn=(); + +do { + + do { + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<=3;$j++) { + $power[$i][$j] = random(0,4,1); + } + } + for (my $i=0;$i<=3;$i++) { + $power[2][$i] = $power[0][$i]+$power[1][$i]; + } + $integer[0] = 2**$power[0][0]*3**$power[0][1]; + $integer[1] = 2**$power[1][0]*3**$power[1][1]; + $integer[2] = $integer[0]*$integer[1]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=1;$i++) { + if ($power[2][$i]>1) {$ok1=1;} + if ($power[2][$i]%2==1) {$ok2=1;} + } + $ok3 = ( ($power[2][2]>0) && ($power[2][3]>0) ) ? 1 : 0; + } until ( ($integer[2]<=500) && ($integer[2]>=20) && ($ok1==1) && ($ok2==1) && ($ok3==1) && ($integer[0]>1) && ($integer[1]>1) ); + + @allString = (); + @numString = (); + @varString = (); + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<=3;$j++) { + if ($power[$i][$j]>1) { + $allString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot "; + if ($j<2) {$numString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot ";} + else {$varString[$i] .= "$num[$j]^{$power[$i][$j]} ";} + } elsif ($power[$i][$j]==1) { + $allString[$i] .= "$num[$j] \cdot "; + if ($j<2) {$numString[$i] .= "$num[$j] \cdot ";} + else {$varString[$i] .= "$num[$j] ";} + } + } + $allString[$i] = substr($allString[$i],0,length($allString[$i])-7); + $numString[$i] = substr($numString[$i],0,length($numString[$i])-7); + } + + for (my $j=0;$j<=3;$j++) { + if ($power[2][$j]>1) { + $allString[2] .= "$num[$j]^{$power[2][$j]} \cdot "; + } elsif ($power[2][$j]==1) { + $allString[2] .= "$num[$j] \cdot "; + } + } + $allString[2] = substr($allString[2],0,length($allString[2])-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=3; $i++) { + $numOut[$i] = int($power[2][$i]/$root); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + if ($i<2) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + if ($i<2) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$num[$i]^{$numOut[$i]} ";} + } + $numIn[$i] = $power[2][$i]%$root; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + if ($i<2) {$inNum *= $num[$i];} + else {$inVar .= "$num[$i] ";} + } + } + +} until ( ($inNum != $outNum) && ($inVar ne outVar) && (sqrt($integer[0])!=int(sqrt($integer[0]))) && (sqrt($integer[1])!=int(sqrt($integer[1]))) ); + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt{$integer[0] $varString[0]} \cdot \sqrt{$integer[1] $varString[1]}"; +$ansString0 = "$outNum $outVar"." \cdot \sqrt{$inNum $inVar}"; +$ansString1 = "$inNum"."$outVar"." \cdot \sqrt{$outNum $inVar}"; +$ansString2 = "$outNum"."$inVar"." \cdot \sqrt{$inNum $outVar}"; +$ansString3 = "$inNum"."$inVar"." \cdot \sqrt{$outNum $outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s1 = $allString[0]; +$s2 = $allString[1]; +$s3 = $allString[2]; +if ( ($outString eq "$outNum"."$outVar"." \cdot ") && ($inString eq "$inNum"."$inVar") ) { + $s4 = ""; +} else { + $s4 = "&= $ansString0"; +} + +BEGIN_PGML_SOLUTION + + +When we multiply the same type of radicals (like square root), we can combine two radicals into one: + + [`` \sqrt{x} \cdot \sqrt{y} = \sqrt{xy} ``] + +The solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt{[$s1]} \cdot \sqrt{[$s2]} \\ + &= \sqrt{[$s3]} \\ + &= [$outString] \sqrt{[$inString]} \\ + [$s4] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals55.pg new file mode 100644 index 0000000000..b3b502fd9e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals55.pg @@ -0,0 +1,154 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Multiply two radicals with variables. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +do { + $a = non_zero_random(-9,9,1); + $b = non_zero_random(-9,9,1); + $c = non_zero_random(-9,9,1); +} until ( ($a!=$b) && ($a!=$c) ); + +$aPlusB = $a+$b; +$ab = $a*$b; +$r1 = Compute("$var**2+$aPlusB*$var+$ab")->reduce; +$s1 = Compute("sqrt($r1)")->reduce; +$bPlusC = $b+$c; +$bc = $b*$c; +$r2 = Compute("$var**2+$bPlusC*$var+$bc")->reduce; +$s2 = Compute("sqrt($r2)")->reduce; +$s3 = Compute("($var+$a)*($var+$c)")->reduce; +$s4 = Compute("($var+$a)*($var+$b)")->reduce; + + +$s5 = Compute("$s1*$s2")->reduce; + +$problem = $s1->TeX.' \cdot'.$s2->TeX; +$ansString0 = "\lvert $var+$b \rvert \cdot \sqrt{".$s3->TeX."}"; +$ansString1 = "($var+$b) \cdot \sqrt{".$s3->TeX."}"; +$ansString2 = "\lvert $var+$c \rvert \cdot \sqrt{".$s4->TeX."}"; +$ansString3 = "($var+$c) \cdot \sqrt{".$s4->TeX."}"; + + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s4 = Compute("sqrt(($var+$a)*($var+$b))")->reduce; +$s5 = Compute("sqrt(($var+$b)*($var+$c))")->reduce; +$s6 = Compute("sqrt(($var+$a)*($var+$b)**2*($var+$c))")->reduce; + +BEGIN_PGML_SOLUTION + +When we multiply the same type of radicals (like square root), we can combine two radicals into one: + + [`` \sqrt{x} \cdot \sqrt{y} = \sqrt{xy} ``] + +The solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= [$s4] \cdot [$s5] \\ + &= [$s6] \\ + &= [$ansString0] +\end{aligned} + ``] + +Notice that the absolute value symbols are necessary, because [` \sqrt{x^2}=|x| `]. + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals60.pg new file mode 100644 index 0000000000..ba267e9fdb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals60.pg @@ -0,0 +1,236 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Multiply two cubic radicals with numbers. +# +# Last edited: Carl Yao 7/29/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 3; +$numOfNums = 4; + +@num = (2,3,5,7); +@power = (); +@integer = (); +@numOut=(); +@numIn=(); + +do { + + do { + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<=3;$j++) { + $power[$i][$j] = random(0,4,1); + } + } + for (my $i=0;$i<=3;$i++) { + $power[2][$i] = $power[0][$i]+$power[1][$i]; + } + $integer[0] = 2**$power[0][0]*3**$power[0][1]*5**$power[0][2]*7**$power[0][3]; + $integer[1] = 2**$power[1][0]*3**$power[1][1]*5**$power[1][2]*7**$power[1][3]; + $integer[2] = $integer[0]*$integer[1]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<$numOfNums;$i++) { + if ($power[2][$i]>=$root) {$ok1=1;} + if ($power[2][$i]%$root!=0) {$ok2=1;} + } + } until ( ($integer[2]<=500) && ($integer[2]>=20) && ($ok1==1) && ($ok2==1) && ($integer[0]>1) && ($integer[1]>1) ); + + @allString = (); + @numString = (); + @varString = (); + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<=3;$j++) { + if ($power[$i][$j]>1) { + $allString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot ";} + else {$varString[$i] .= "$num[$j]^{$power[$i][$j]} ";} + } elsif ($power[$i][$j]==1) { + $allString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j] \cdot ";} + else {$varString[$i] .= "$num[$j] ";} + } + } + $allString[$i] = substr($allString[$i],0,length($allString[$i])-7); + $numString[$i] = substr($numString[$i],0,length($numString[$i])-7); + } + + for (my $j=0;$j<=3;$j++) { + if ($power[2][$j]>1) { + $allString[2] .= "$num[$j]^{$power[2][$j]} \cdot "; + } elsif ($power[2][$j]==1) { + $allString[2] .= "$num[$j] \cdot "; + } + } + $allString[2] = substr($allString[2],0,length($allString[2])-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=3; $i++) { + $numOut[$i] = int($power[2][$i]/$root); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$num[$i]^{$numOut[$i]} ";} + } + $numIn[$i] = $power[2][$i]%$root; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$inNum *= $num[$i];} + else {$inVar .= "$num[$i] ";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + if ($i<$numOfNums) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$num[$i]^{$numIn[$i]} ";} + } + } + +} until ( ($inNum != $outNum) && ($integer[0]**(1/3)!=int($integer[0]**(1/3))) && ($integer[1]**(1/3)!=int($integer[1]**(1/3))) ); + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt[3]{$integer[0] $varString[0]} \cdot \sqrt[3]{$integer[1] $varString[1]}"; +$ansString0 = "$outNum $outVar"." \cdot \sqrt[3]{$inNum $inVar}"; +$ansString1 = "$inNum"."$outVar"." \cdot \sqrt[3]{$outNum $inVar}"; + +for (my $i=$numOfNums-1;$i>=0;$i--) { + if ($power[2][$i]!=0) {$tNum = $num[$i];} +} +$inNum2 = $inNum*$tNum; +$outNum2 = $outNum*$tNum; +$ansString2 = "$outNum"." \cdot \sqrt[3]{$inNum2}"; +$ansString3 = "$outNum2"." \cdot \sqrt[3]{$inNum}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s1 = $allString[0]; +$s2 = $allString[1]; +$s3 = $allString[2]; +if ( ($outString eq "$outNum"."$outVar"." \cdot ") && ($inString eq "$inNum"."$inVar") ) { + $s4 = ""; +} else { + $s4 = "&= $ansString0"; +} + +BEGIN_PGML_SOLUTION + +When we multiply the same type of radicals (like cube root), we can combine two radicals into one: + + [`` \sqrt[3]{x} \cdot \sqrt[3]{y} = \sqrt[3]{xy} ``] + +The solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[3]{[$s1]} \cdot \sqrt[3]{[$s2]} \\ + &= \sqrt[3]{[$s3]} \\ + &= [$outString] \sqrt[3]{[$inString]} \\ + [$s4] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals65.pg new file mode 100644 index 0000000000..15ec4afe38 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals65.pg @@ -0,0 +1,236 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Multiply two quart radicals with numbers. +# +# Last edited: Carl Yao 7/29/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 4; +$numOfNums = 4; + +@num = (2,3,5,7); +@power = (); +@integer = (); +@numOut=(); +@numIn=(); + +do { + + do { + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<=3;$j++) { + $power[$i][$j] = random(0,4,1); + } + } + for (my $i=0;$i<=3;$i++) { + $power[2][$i] = $power[0][$i]+$power[1][$i]; + } + $integer[0] = 2**$power[0][0]*3**$power[0][1]*5**$power[0][2]*7**$power[0][3]; + $integer[1] = 2**$power[1][0]*3**$power[1][1]*5**$power[1][2]*7**$power[1][3]; + $integer[2] = $integer[0]*$integer[1]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<$numOfNums;$i++) { + if ($power[2][$i]>=$root) {$ok1=1;} + if ($power[2][$i]%$root!=0) {$ok2=1;} + } + } until ( ($integer[2]<=500) && ($integer[2]>=20) && ($ok1==1) && ($ok2==1) && ($integer[0]>1) && ($integer[1]>1) ); + + @allString = (); + @numString = (); + @varString = (); + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<=3;$j++) { + if ($power[$i][$j]>1) { + $allString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot ";} + else {$varString[$i] .= "$num[$j]^{$power[$i][$j]} ";} + } elsif ($power[$i][$j]==1) { + $allString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j] \cdot ";} + else {$varString[$i] .= "$num[$j] ";} + } + } + $allString[$i] = substr($allString[$i],0,length($allString[$i])-7); + $numString[$i] = substr($numString[$i],0,length($numString[$i])-7); + } + + for (my $j=0;$j<=3;$j++) { + if ($power[2][$j]>1) { + $allString[2] .= "$num[$j]^{$power[2][$j]} \cdot "; + } elsif ($power[2][$j]==1) { + $allString[2] .= "$num[$j] \cdot "; + } + } + $allString[2] = substr($allString[2],0,length($allString[2])-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=3; $i++) { + $numOut[$i] = int($power[2][$i]/$root); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$num[$i]^{$numOut[$i]} ";} + } + $numIn[$i] = $power[2][$i]%$root; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$inNum *= $num[$i];} + else {$inVar .= "$num[$i] ";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + if ($i<$numOfNums) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$num[$i]^{$numIn[$i]} ";} + } + } + +} until ( ($inNum != $outNum) && ($integer[0]**(1/$root)!=int($integer[0]**(1/$root))) && ($integer[1]**(1/$root)!=int($integer[1]**(1/$root))) ); + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt[$root]{$integer[0] $varString[0]} \cdot \sqrt[$root]{$integer[1] $varString[1]}"; +$ansString0 = "$outNum $outVar"." \cdot \sqrt[$root]{$inNum $inVar}"; +$ansString1 = "$inNum"."$outVar"." \cdot \sqrt[$root]{$outNum $inVar}"; + +for (my $i=$numOfNums-1;$i>=0;$i--) { + if ($power[2][$i]!=0) {$tNum = $num[$i];} +} +$inNum2 = $inNum*$tNum; +$outNum2 = $outNum*$tNum; +$ansString2 = "$outNum"." \cdot \sqrt[$root]{$inNum2}"; +$ansString3 = "$outNum2"." \cdot \sqrt[$root]{$inNum}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s1 = $allString[0]; +$s2 = $allString[1]; +$s3 = $allString[2]; +if ( ($outString eq "$outNum"."$outVar"." \cdot ") && ($inString eq "$inNum"."$inVar") ) { + $s4 = ""; +} else { + $s4 = "&= $ansString0"; +} + +BEGIN_PGML_SOLUTION + +When we multiply the same type of radicals (like cube root), we can combine two radicals into one: + + [`` \sqrt[4]{x} \cdot \sqrt[4]{y} = \sqrt[4]{xy} ``] + +The solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[4]{[$s1]} \cdot \sqrt[4]{[$s2]} \\ + &= \sqrt[4]{[$s3]} \\ + &= [$outString] \sqrt[3]{[$inString]} \\ + [$s4] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals70.pg new file mode 100644 index 0000000000..74d8635c41 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals70.pg @@ -0,0 +1,231 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Multiply two cubic radicals with variables. +# +# Last edited: Carl Yao 7/29/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 3; +$numOfNums = 3; +$numOfTerms = 5; + +@num = (2,3,5,$var1,$var2); +@power = (); +@integer = (); +@numOut=(); +@numIn=(); + +do { + + do { + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<$numOfTerms;$j++) { + $power[$i][$j] = random(0,4,1); + } + } + for (my $i=0;$i<$numOfTerms;$i++) { + $power[2][$i] = $power[0][$i]+$power[1][$i]; + } + $integer[0] = 2**$power[0][0]*3**$power[0][1]*5**$power[0][2]; + $integer[1] = 2**$power[1][0]*3**$power[1][1]*5**$power[1][2]; + $integer[2] = $integer[0]*$integer[1]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<$numOfNums;$i++) { + if ($power[2][$i]>=$root) {$ok1=1;} + if ($power[2][$i]%$root!=0) {$ok2=1;} + } + } until ( ($integer[2]<=500) && ($integer[2]>=20) && ($ok1==1) && ($ok2==1) && ($integer[0]>1) && ($integer[1]>1) ); + + @allString = (); + @numString = (); + @varString = (); + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<$numOfTerms;$j++) { + if ($power[$i][$j]>1) { + $allString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot ";} + else {$varString[$i] .= "$num[$j]^{$power[$i][$j]} ";} + } elsif ($power[$i][$j]==1) { + $allString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j] \cdot ";} + else {$varString[$i] .= "$num[$j] ";} + } + } + $allString[$i] = substr($allString[$i],0,length($allString[$i])-7); + $numString[$i] = substr($numString[$i],0,length($numString[$i])-7); + } + + for (my $j=0;$j<$numOfTerms;$j++) { + if ($power[2][$j]>1) { + $allString[2] .= "$num[$j]^{$power[2][$j]} \cdot "; + } elsif ($power[2][$j]==1) { + $allString[2] .= "$num[$j] \cdot "; + } + } + $allString[2] = substr($allString[2],0,length($allString[2])-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<$numOfTerms; $i++) { + $numOut[$i] = int($power[2][$i]/$root); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$num[$i]^{$numOut[$i]} ";} + } + $numIn[$i] = $power[2][$i]%$root; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$inNum *= $num[$i];} + else {$inVar .= "$num[$i] ";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + if ($i<$numOfNums) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$num[$i]^{$numIn[$i]} ";} + } + } + +} until ( ($inNum != $outNum) && ($integer[0]**(1/3)!=int($integer[0]**(1/3))) && ($integer[1]**(1/3)!=int($integer[1]**(1/3))) ); + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt[3]{$integer[0] $varString[0]} \cdot \sqrt[3]{$integer[1] $varString[1]}"; +$ansString0 = "$outNum $outVar"." \cdot \sqrt[3]{$inNum $inVar}"; +$ansString1 = "$inNum"."$outVar"." \cdot \sqrt[3]{$outNum $inVar}"; +$ansString2 = "$outNum $inVar"." \cdot \sqrt[3]{$inNum $outVar}"; +$ansString3 = "$inNum"."$inVar"." \cdot \sqrt[3]{$outNum $outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s1 = $allString[0]; +$s2 = $allString[1]; +$s3 = $allString[2]; +if ( ($outString eq "$outNum"."$outVar"." \cdot ") && ($inString eq "$inNum"."$inVar") ) { + $s4 = ""; +} else { + $s4 = "&= $ansString0"; +} + +BEGIN_PGML_SOLUTION + +When we multiply the same type of radicals (like cube root), we can combine two radicals into one: + + [`` \sqrt[3]{x} \cdot \sqrt[3]{y} = \sqrt[3]{xy} ``] + +The solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[3]{[$s1]} \cdot \sqrt[3]{[$s2]} \\ + &= \sqrt[3]{[$s3]} \\ + &= [$outString] \sqrt[3]{[$inString]} \\ + [$s4] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals80.pg new file mode 100644 index 0000000000..b7b01e3770 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals80.pg @@ -0,0 +1,231 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Multiply two quart radicals with variables. +# +# Last edited: Carl Yao 7/29/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 4; +$numOfNums = 3; +$numOfTerms = 5; + +@num = (2,3,5,$var1,$var2); +@power = (); +@integer = (); +@numOut=(); +@numIn=(); + +do { + + do { + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<$numOfTerms;$j++) { + $power[$i][$j] = random(0,4,1); + } + } + for (my $i=0;$i<$numOfTerms;$i++) { + $power[2][$i] = $power[0][$i]+$power[1][$i]; + } + $integer[0] = 2**$power[0][0]*3**$power[0][1]*5**$power[0][2]; + $integer[1] = 2**$power[1][0]*3**$power[1][1]*5**$power[1][2]; + $integer[2] = $integer[0]*$integer[1]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<$numOfNums;$i++) { + if ($power[2][$i]>=$root) {$ok1=1;} + if ($power[2][$i]%$root!=0) {$ok2=1;} + } + } until ( ($integer[2]<=500) && ($integer[2]>=20) && ($ok1==1) && ($ok2==1) && ($integer[0]>1) && ($integer[1]>1) ); + + @allString = (); + @numString = (); + @varString = (); + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<$numOfTerms;$j++) { + if ($power[$i][$j]>1) { + $allString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot ";} + else {$varString[$i] .= "$num[$j]^{$power[$i][$j]} ";} + } elsif ($power[$i][$j]==1) { + $allString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j] \cdot ";} + else {$varString[$i] .= "$num[$j] ";} + } + } + $allString[$i] = substr($allString[$i],0,length($allString[$i])-7); + $numString[$i] = substr($numString[$i],0,length($numString[$i])-7); + } + + for (my $j=0;$j<$numOfTerms;$j++) { + if ($power[2][$j]>1) { + $allString[2] .= "$num[$j]^{$power[2][$j]} \cdot "; + } elsif ($power[2][$j]==1) { + $allString[2] .= "$num[$j] \cdot "; + } + } + $allString[2] = substr($allString[2],0,length($allString[2])-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<$numOfTerms; $i++) { + $numOut[$i] = int($power[2][$i]/$root); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$num[$i]^{$numOut[$i]} ";} + } + $numIn[$i] = $power[2][$i]%$root; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$inNum *= $num[$i];} + else {$inVar .= "$num[$i] ";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + if ($i<$numOfNums) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$num[$i]^{$numIn[$i]} ";} + } + } + +} until ( ($inNum != $outNum) && ($integer[0]**(1/$root)!=int($integer[0]**(1/$root))) && ($integer[1]**(1/$root)!=int($integer[1]**(1/$root))) ); + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt[$root]{$integer[0] $varString[0]} \cdot \sqrt[$root]{$integer[1] $varString[1]}"; +$ansString0 = "$outNum $outVar"." \cdot \sqrt[$root]{$inNum $inVar}"; +$ansString1 = "$inNum"."$outVar"." \cdot \sqrt[$root]{$outNum $inVar}"; +$ansString2 = "$outNum $inVar"." \cdot \sqrt[$root]{$inNum $outVar}"; +$ansString3 = "$inNum"."$inVar"." \cdot \sqrt[$root]{$outNum $outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s1 = $allString[0]; +$s2 = $allString[1]; +$s3 = $allString[2]; +if ( ($outString eq "$outNum"."$outVar"." \cdot ") && ($inString eq "$inNum"."$inVar") ) { + $s4 = ""; +} else { + $s4 = "&= $ansString0"; +} + +BEGIN_PGML_SOLUTION + +When we multiply the same type of radicals (like square root), we can combine two radicals into one: + + [`` \sqrt[4]{x} \cdot \sqrt[4]{y} = \sqrt[4]{xy} ``] + +The solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[4]{[$s1]} \cdot \sqrt[4]{[$s2]} \\ + &= \sqrt[4]{[$s3]} \\ + &= [$outString] \sqrt[4]{[$inString]} \\ + [$s4] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg index 1f9441e790..0d53290617 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Rad_frac_simp5) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -29,7 +30,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -53,9 +55,9 @@ $ans = Formula("$ans"); BEGIN_PGML -Simplify the expression [`` \frac{[$sqrt1]}{[$sqrt2]} ``]. +Simplify the radical expression or state that it is [|not a real number|]*. -Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` \frac{[$sqrt1]}{[$sqrt2]} =``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty11.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty11.pg new file mode 100644 index 0000000000..387266a0ad --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty11.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radical using the division property. +# +# Last edited: Carl Yao 7/30/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +do { + $ansNum = random(1,5,1); + $ansDen = random(2,5,1); +} until (gcd($ansNum,$ansDen)==1); +$factor = random(2,5,1); +$num = $ansNum**3*$factor; +$den = $ansDen**3*$factor; + +$problem = "\frac{\sqrt[3]{$num}}{\sqrt[3]{-$den}}"; +$ansString0 = "-\frac{$ansNum}{$ansDen}"; +$ansString1 = "\frac{$ansNum}{$ansDen}"; +$ansString2 = "-\frac{\sqrt[3]{$ansNum}}{$ansDen}"; +$ansString3 = "\text{no real solution}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +We will use the division property of radicals: + + [`` \frac{\sqrt{a}}{\sqrt{b}} =\sqrt{\frac{a}{b}}``] + +We will also use this property to handle the negative symbol: + + [`` \sqrt[3]{-x} = -\sqrt[3]{x} ``] + +The full process is: + + [`` +\begin{aligned} + &\phantom{{}=}[$problem] \\ + &= \sqrt[3]{-\frac{[$num]}{[$den]}} \\ + &= -\sqrt[3]{\frac{[$num]}{[$den]}} \\ + &= -\sqrt[3]{\frac{[$ansNum**3]}{[$ansDen**3]}} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty12.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty12.pg new file mode 100644 index 0000000000..f55fd964a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty12.pg @@ -0,0 +1,146 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radical using the division property. +# +# Last edited: Carl Yao 7/30/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + + +$c = random(1,5,1); +do {$d = random(1,5,1);} until ($c!=$d); +$a = random(1,5,1); +do {$b = random(1,5,1);} until ($a!=$b); +$d3 = $d*3; +$c3 = $c*3; +$bd = $b+$d3; +$ac = $a+$c3; + +$s1 = ($d==1) ? "$var2" : "$var2^{$d}"; +$s2 = ($c==1) ? "$var1" : "$var1^{$c}"; +$s3 = ($b==1) ? "$var2" : "$var2^{$b}"; +$s4 = ($a==1) ? "$var1" : "$var1^{$a}"; + +$problem = "\frac{\sqrt[3]{$s4 $var2^{$bd}}}{\sqrt[3]{$var1^{$ac} $s3}}"; +$ansString0 = Compute("$var2**$d/$var1**$c")->reduce; +$ansString1 = Compute("$var1**$c/$var2**$d")->reduce; +$ansString2 = "\frac{\sqrt[3]{$s1}}{\sqrt[3]{$s2}}"; +$ansString3 = Compute("$var1**$c*$var2**$d")->reduce; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s3 = Compute("$var1**$a*$var2**$bd/($var1**$ac*$var2**$b)")->reduce; +$s4 = Compute("$var2**$d3/$var1**$c3")->reduce; + +BEGIN_PGML_SOLUTION + +We will use the division property of radicals: + + [`` \frac{\sqrt{a}}{\sqrt{b}} =\sqrt{\frac{a}{b}}``] + +The full process is: + + [`` +\begin{aligned} + &\phantom{{}=}[$problem] \\ + &= \sqrt[3]{[$s3]} \\ + &= \sqrt[3]{[$s4]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg new file mode 100644 index 0000000000..61d1b5899d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radical using the division property. +# Problem is like sqrt(2)*sqrt(50). Answer is a fraction. +# +# Last edited: Carl Yao 8/31/13, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$ans = list_random(2,3,4,5,6); +$ans2 = $ans**2; +$factor = list_random(2,3,4,5,6); + +$rad2 = $ans**2*$factor; +$rad1 = $factor; + +Context("LimitedRadical"); +$sqrt1 = Formula("sqrt($rad1)"); +$sqrt2 = Formula("sqrt($rad2)"); +$ans = Formula("1/$ans"); + +########################################## + +BEGIN_PGML + +Simplify the radical expression or state that it is [|not a real number|]*. + +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` \frac{[$sqrt1]}{[$sqrt2]} =``] [_____________]{$ans} + +END_PGML + +############################################################ + +BEGIN_PGML_SOLUTION + +We will use the division property of radicals: + + [`` \frac{\sqrt{a}}{\sqrt{b}} =\sqrt{\frac{a}{b}}``] + +The full process is: + + [`` +\begin{aligned}[t] + \frac{[$sqrt1]}{[$sqrt2]} + &= \sqrt{\frac{[$rad1]}{[$rad2]}} \\ + &= \sqrt{\frac{1}{[$ans2]}} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg index 9464039c90..92c98a7e08 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Rad_frac_simp5) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','fraction','multiply') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -55,9 +58,9 @@ $ans = Formula("sqrt($radAns)/$den1"); BEGIN_PGML -Simplify the expression [`` \sqrt{\frac{[$num1]}{[$den1]}} \cdot \sqrt{\frac{[$num2]}{[$den2]}} ``]. +Simplify the expression. -Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` \sqrt{\frac{[$num1]}{[$den1]}} \cdot \sqrt{\frac{[$num2]}{[$den2]}} =``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg index 99241c292e..cd01271480 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Rad_frac_simp5) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','fraction','multiply') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ###################################### @@ -30,7 +32,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -168,9 +171,9 @@ if ($line3Center ne "") {$output13 = '&='.$line3Center;} BEGIN_PGML -Simplify the expression [`` [$sqrt1] \cdot [$sqrt2] ``]. +Simplify the expression. -Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` [$sqrt1] \cdot [$sqrt2] =``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty41.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty41.pg new file mode 100644 index 0000000000..f835591674 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty41.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radical using the multiplication and division properties. +# Variables are involved. +# +# Last edited: Carl Yao 8/2/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','fraction','multiply') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +do { + $num = random(2,10,1); + $num2 = $num**2; + do {$f1=random(1,sqrt($num2),1)} until ($num2%$f1==0); + $f2 = $num2/$f1; + $c = random(2,9,1); + $b = $c*$f1; + $a = random(2,9,1); + $d = $a*$f2; +} until ( (gcd($b,$a)==1) && (gcd($d,$c)==1) ); + +$e = random(1,9,2); +do {$f = random(1,9,2);} until ($e!=$f); +$av = ($e+$f)/2; + +Context("LimitedRadical"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +$sqrt1 = Formula("sqrt($b*$var**$e/$a)")->reduce; +$sqrt2 = Formula("sqrt($d*$var**$f/$c)")->reduce; +$ans = Compute("$num*$var**$av"); + +########################################## + +BEGIN_PGML + +Simplify the expression [`` [$sqrt1] \cdot [$sqrt2] ``]. Assume all variables are positive. + +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` [$sqrt1] \cdot [$sqrt2] =``] [_____________]{$ans} + +END_PGML + +############################################################ + +$s1 = Formula("$b*$var**$e/$a")->reduce; +$s2 = Formula("$d*$var**$f/$c")->reduce; +$s3 = Formula("$f1*$var**$e")->reduce; +$s4 = Formula("$f2*$var**$f")->reduce; + +BEGIN_PGML_SOLUTION + +First, we use the multiplication property of radicals: + + [`` \sqrt{a} \cdot \sqrt{b} = \sqrt{ab} ``] + +We have: + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$sqrt1] \cdot [$sqrt2] \\ + &= \sqrt{ [$s1] \cdot [$s2] } \\ + &= \sqrt{ [$s3] \cdot [$s4] } \\ + &= \sqrt{ [$num2][$var]^{[$e+$f]} } \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty43.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty43.pg new file mode 100644 index 0000000000..354068bd8b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty43.pg @@ -0,0 +1,158 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radical using the multiplication and division properties. +# Variables are involved. +# +# Last edited: Carl Yao 8/2/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','fraction','multiply') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +do { + $num = random(2,5,1); + $num3 = $num**3; + do {$f1=random(1,sqrt($num3),1)} until ($num3%$f1==0); + $f2 = $num3/$f1; + $c = random(2,9,1); + $b = $c*$f1; + $a = random(2,9,1); + $d = $a*$f2; +} until ( (gcd($b,$a)==1) && (gcd($d,$c)==1) ); + +$ansE = random(1,5,2); +$e = list_random(2,4,5,7,8); +$f = $ansE*3+$e; + +$sqrt1 = "\sqrt[3]{\frac{-$b $var^{$e}}{$a}}"; +$sqrt2 = "\sqrt[3]{\frac{$d}{$c $var^{$f}}}"; +$ans = Compute("-$num/$var**$ansE")->reduce; + +$ansString0 = $ans; +$ansString1 = Compute("-$num*$var**$ansE")->reduce; +$ansString2 = Compute("$num/$var**$ansE")->reduce; +$ansString3 = "\text{no real solution}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +########################################## + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML + +Simplify the expression [`` [$sqrt1] \cdot [$sqrt2] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +$p = $ansE*3; + +$s1 = Formula("$b*$var**$e/$a")->reduce; +$s2 = Formula("$d/($c*$var**$f)")->reduce; + +BEGIN_PGML_SOLUTION + +First, we use the multiplication property of radicals: + + [`` \sqrt[3]{a} \cdot \sqrt[3]{b} = \sqrt[3]{ab} ``] + +We will also use this property to handle the negative symbol: + + [`` \sqrt[3]{-x} = -\sqrt[3]{x} ``] + +We have: + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$sqrt1] \cdot [$sqrt2] \\ + &= \sqrt[3]{ -[$s1] \cdot [$s2] } \\ + &= -\sqrt[3]{ [$s1] \cdot [$s2] } \\ + &= -\sqrt[3]{ \frac{[$f1]}{1} \cdot \frac{[$f2]}{[$var]^{[$p]}} } \\ + &= -\sqrt[3]{ \frac{[$f1*$f2]}{[$var]^{[$p]}} } \\ + &= [$ans] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty50.pg new file mode 100644 index 0000000000..09f67189f3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty50.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radical with a fraction inside. No rationalizing denominator is needed. +# +# Last edited: Carl Yao 7/29/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +#$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +#do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +#Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 3; + +do { + $a = random(2,10,1); + $num = $a**2; + $b = list_random(2,3,4,5); + $den = $b**3; +} until (gcd($num,$den)==1); + +$problem = "\sqrt[$root]{ \frac{$num}{$den} }"; +$ansString0 = "\frac{\sqrt[3]{$num}}{$b}"; +$ansString1 = "\frac{$a}{$b}"; +$ansString2 = "\frac{\sqrt[3]{$num}}{$den}"; +$ansString3 = "\frac{$num}{$b}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +We can distribute a radical symbol to the numerator and denominator of a fraction: + + [`` \sqrt[3]{\frac{x}{y}} = \frac{\sqrt[3]{x}}{\sqrt[3]{y}} ``] + +The solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{\sqrt[3]{[$num]}}{\sqrt[3]{[$den]}} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +Note that [` \sqrt[3]{[$num]} \ne [$a] `], but [` \sqrt{[$num]} = [$a] `]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty60.pg new file mode 100644 index 0000000000..fa36caf793 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty60.pg @@ -0,0 +1,155 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radical with a fraction inside. No rationalizing denominator is needed. +# +# Last edited: Carl Yao 7/29/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 3; + + +$a = random(2,5,1); +$a3 = $a**3; +do {$b = random(4,11,1);} until ($b%$root!=0); +$b2 = $b%$root; +$c = random(1,5,1); +$c3 = $c*$root; + +$d = int($b/$root); +$s1 = ($c==1) ? "$var2" : "$var2^{$c}"; +$s3 = ($d==1) ? "$var1" : "$var1^{$d}"; +$s4 = ($b2==1) ? "$var1" : "$var1^{$b2}"; + +$problem = "\sqrt[$root]{ \frac{-$a3 $var1^{$b}}{$var2^{$c3}} }"; +$ansString0 = "-\frac{$a $s3 \cdot \sqrt[3]{$s4}}{$s1}"; +$ansString1 = "\text{no real solution}"; +$ansString2 = "\frac{$a $s3 \cdot \sqrt[3]{$s4}}{$s1}"; +$ansString3 = "-\frac{$a \sqrt[3]{$var1^{$b}}}{$s1}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$d3 = $d*3; +$s2 = ($b2==1) ? "$var1" : "$var1^{$b2}"; + +BEGIN_PGML_SOLUTION + +We can distribute a radical symbol to the numerator and denominator of a fraction: + + [`` \sqrt[3]{\frac{x}{y}} = \frac{\sqrt[3]{x}}{\sqrt[3]{y}} ``] + +We can use this formula to simplify radicals: + + [`` \sqrt[3]{x^3} = x ``] + +Also, recall that: + + [`` \sqrt[3]{-x} = -\sqrt[3]{x} ``] + +The solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{\sqrt[3]{-[$a3] [$var1]^{[$b]}} }{ \sqrt[3]{[$var2]^{[$c3]}} } \\ + &= -\frac{\sqrt[3]{[$a3] [$var1]^{[$b]}} }{ \sqrt[3]{[$var2]^{[$c3]}} } \\ + &= -\frac{\sqrt[3]{[$a]^{3} [$var1]^{[$d3]} [$s2]} }{ \sqrt[3]{[$var2]^{[$c3]}} } \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication10.pg new file mode 100644 index 0000000000..c0fe0b1b6b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication10.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Radical function application. +# +# Last updated: Yao 8/17/2016 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$a = random(10,50,1); +$ans1 = sqrt(2*$a/32); +$ans1Show = sprintf("%.2f",$ans1); +do {$b = random(1,5,0.1);} until (abs($b-$ans1)>1); +$ans2 = $b**2*16; +$ans2Show = sprintf("%.2f",$ans2); + +############################################## + +BEGIN_PGML + +If an object is dropped with no initial velocity, the time since the drop, in seconds, can be calculated by the function [``` T(h) = \sqrt{\frac{2h}{g}} ```] where [`h`] is the distance the object traveled in feet. The variable [`g`] is the gravitational acceleration on earth, and we can round it to [`32 \frac{ft}{s^2}`] for this problem. [@KeyboardInstructions('Round your answers to two decimal places if needed.')@]** + +a. After [__________]{$ans1} seconds since the release, the object would have traveled [`[$a]`] feet. + +b. After [`[$b]`] seconds since the release, the object would have traveled [__________]{$ans2} feet. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +a. After how many seconds since the release, would the object have traveled [`[$a]`] feet? + +To answer this question, we substitute [`h`] with [`[$a]`], (and [`g`] with 32 as stated above) and we have: + + [`` +\begin{aligned}[t] + T(h) &= \sqrt{\frac{2h}{g}} \\ + T([$a]) &= \sqrt{\frac{2([$a])}{32}} \\ + T([$a]) &\approx [$ans1] +\end{aligned} + ``] + +After approximately [`[$ans1Show]`] seconds since the release, the object would have traveled [`[$a]`] feet. + +b. After [`[$b]`] seconds since the release, how many feet would the object have traveled? + +To answer this question, we substitute [`T(h)`] with [`[$b]`], and then solve for [`h`]: + + [`` +\begin{aligned}[t] + T(h) &= \sqrt{\frac{2h}{g}} \\ + [$b] &= \sqrt{\frac{2h}{32}} \\ + [$b] &= \sqrt{\frac{h}{16}} \\ + ([$b])^2 &= \left( \sqrt{\frac{h}{16}} \right)^2 \\ + [$b*$b] &= \frac{h}{16} \\ + [$b*$b] \cdot 16 &= h \\ + h &= [$ans2] +\end{aligned} + ``] + +After [`[$b]`] seconds since the release, the object would have traveled [`[$ans2Show]`] feet. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication20.pg new file mode 100644 index 0000000000..781daa4353 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication20.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Radical function application. +# +# Last updated: Yao 8/17/2016 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$a = random(100,500,50); +$ans1 = (3*$a/(4*pi))**(1/3); +$ans1Show = sprintf("%.2f",$ans1); +do {$b = random(1,5,0.1);} until (abs($b-$ans1)>1); +$ans2 = 4*pi*$b**3/3; +$ans2Show = sprintf("%.2f",$ans2); + +############################################## + +BEGIN_PGML + +A factory manufactures toy plastic balls. For a ball with a certain volume, V in cubic centimeters, the ball's radius can be calculated by the formula [``` r(V) = \sqrt[3]{\frac{3V}{4 \pi}} ```] + +[@KeyboardInstructions("Don't round [`\\pi`] to [`3.14`] at the beginning. Use your calculator's [`\\pi`] button instead. At the end of your calculation, you may round your answers to two decimal places.")@]** + +a. If a ball's volume is [`[$a]`] cubic centimeters, its radius must be [__________]{$ans1} centimeters. + +b. If a ball's radius is [`[$b]`] centimeters, its volume would be [__________]{$ans2} cubic centimeters. + +END_PGML + +############################################## + +$b3 = $b**3; + +BEGIN_PGML_SOLUTION + +a. If a ball's volume is [`[$a]`] cubic centimeters, how many centimeters must its radius be? + +To answer this question, we substitute [`V`] with [`[$a]`], and we have: + + [`` +\begin{aligned}[t] + r(V) &= \sqrt[3]{\frac{3V}{4 \pi}} \\ + r([$a]) &= \sqrt[3]{\frac{3([$a])}{4 \pi}} \\ + r([$a]) &\approx [$ans1] +\end{aligned} + ``] + +If a ball's volume is [`[$a]`] cubic centimeters, its radius must be approximately [`[$ans1Show]`] centimeters. + +b. If a ball's radius is [`[$b]`] centimeters, what's its volume? + +To answer this question, we substitute [`r(V)`] with [`[$b]`], and then solve for [`V`]: + + [`` +\begin{aligned}[t] + r(V) &= \sqrt[3]{\frac{3V}{4 \pi}} \\ + [$b] &= \sqrt[3]{\frac{3V}{4 \pi}} \\ + ([$b])^3 &= (\sqrt[3]{\frac{3V}{4 \pi}})^3 \\ + [$b3] &= \frac{3V}{4 \pi} \\ + [$b3] \cdot (4 \pi) &= \frac{3V}{4 \pi} \cdot (4 \pi) \\ + [$b3*4] \pi &= 3V \\ + \frac{[$b3*4] \pi}{3} &= \frac{3V}{3} \\ + V & \approx [$ans2] \text{ (Don't forget } \bfont{\pi} \text{!)} +\end{aligned} + ``] + +If a ball's radius is [`[$b]`] centimeters, its volume would be approximately [`[$ans2Show]`] cubic centimeters. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent10.pg new file mode 100644 index 0000000000..82ae6b5e64 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent10.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change radical like root(3,x) to x^(1/3). +# +# +# Last updated: Yao 07/25/2016 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + +$a = random(2,9,1); +$text = ($a==2) ? "" : "[$a]"; + +Context()->functions->undefine('sqrt'); + +Context()->flags->set(limits=>[0.5,5]); + +$ans = Formula("$var^(1/$a)"); + + +############################################## + + +BEGIN_PGML + +Use rational exponents to write the expression. + +[@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.@]** + + [`` \sqrt[$text]{[$var]} = ``][____________]{$ans} + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +Radicals can be converted into fractional exponents this way: + + [`` \sqrt[n]{x^{m}} = (x^{m})^{\frac{1}{n}} = x^{\frac{m}{n}} ``] + +For this problem, we have: + + [`` \sqrt[$text]{[$var]}= [$var]^{\frac{1}{[$a]}} ``] + +So the answer in calculator/WeBWorK notation is [`[$var]`]^[`(1/[$a])`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent20.pg new file mode 100644 index 0000000000..b75ecca6dc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent20.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change radical like 1/root(3,x) to x^(-1/3). +# +# +# Last updated: Yao 07/25/2016 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + +$a = random(2,9,1); +$text = ($a==2) ? "" : "[$a]"; +do {$b = random(2,5,1);} until (gcd($a,$b)==1); + +Context()->functions->undefine('sqrt'); + +Context()->flags->set(limits=>[0.5,5]); + +$ans = Formula("$var^(-$b/$a)"); + + +############################################## + + +BEGIN_PGML + +Use rational exponents to write the expression. + +[@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.@]** + + [`` \frac{1}{\sqrt[$text]{[$var]^{[$b]}}} = ``][____________]{$ans} + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +Radicals can be converted into fractional exponents this way: + + [`` \sqrt[n]{x^{m}} = (x^{m})^{\frac{1}{n}} = x^{\frac{m}{n}} ``] + +Review that a fraction can be written as a negative exponent: + + [`` \frac{1}{x^{n}} = x^{-n} ``] + +Use rules above, we have: + + [`` +\begin{aligned}[t] + & \phantom{{}=} \frac{1}{\sqrt[$text]{[$var]^{[$b]}}} \\ + &= \frac{1}{([$var]^[$b])^{\frac{1}{[$a]}}} \\ + &= \frac{1}{[$var]^{\frac{[$b]}{[$a]}}} \\ + &= [$var]^{-\frac{[$b]}{[$a]}} +\end{aligned} + ``] + +So the answer in calculator/WeBWorK notation is [`[$var]`]^[`(-[$b]/[$a])`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent30.pg new file mode 100644 index 0000000000..16a1c01666 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent30.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change radical like sqrt(a^2+b^2) to (a^2+b^2)^(1/2). +# +# +# Last updated: Yao 07/25/2016 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + +$a = random(2,10,1); +$b = random(2,10,1); +$c = random(2,10,1); +$a2 = $a**2; +$b2 = $b**2; +$c2 = $c**2; + +Context()->functions->undefine('sqrt'); + +$ans1 = Formula("($var**2+$a2)**(1/2)"); +$ans2 = Formula("($b2-$var**2)**(1/2)"); + +$ans3 = Formula("|$var+$a|"); +$ans3->{limits} = [-$a-2,-$a+2]; +$ans3Eval = $ans3->cmp()->withPostFilter(AnswerHints( + Formula("$var+$a") => "Almost correct, with absolute value symbols missing.", +)); + +$ans4 = Formula("$c*|$var|"); +$ans4Eval = $ans4->cmp()->withPostFilter(AnswerHints( + Formula("$c*$var") => "Almost correct, with absolute value symbols missing.", +)); + +############################################## + + +BEGIN_PGML + +Simplify the following expression if possible, and then use rational exponents to write the answers. + +* To enter [`x^y`], type *x^y*. +* To enter [`|x|`], type *|x|* or *abs(x)*. + +1) [`` \sqrt{[$var]^2+[$a2]} = ``][_____________]{$ans1} + +2) [`` \sqrt{[$b2]-[$var]^2} = ``][_____________]{$ans2} + +3) [`` \sqrt{([$var]+[$a])^2} = ``][_____________]{$ans3Eval} + +4) [`` \sqrt{[$c2] [$var]^2} = ``][_____________]{$ans4Eval} + + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +Note that: + +* [`` \sqrt{x^2+y^2} \ne \sqrt{x^2}+\sqrt{y^2} ``], like [`` \sqrt{9+16} \ne \sqrt{9}+\sqrt{16} ``] +* [`` \sqrt{x^2 y^2} = \sqrt{x^2}\cdot\sqrt{y^2} ``], like [`` \sqrt{4\cdot9} = \sqrt{4}\cdot\sqrt{9} ``] + +Here are the solutions: + +1) [`` \sqrt{[$var]^2+[$a2]} = [$ans1] ``] + +2) [`` \sqrt{[$b2]-[$var]^2} = [$ans2] ``] + +3) [`` \sqrt{([$var]+[$a])^2} = [$ans3] ``] + +4) [`` \sqrt{[$c2] [$var]^2} = [$ans4] ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent31.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent31.pg new file mode 100644 index 0000000000..2f2eb21117 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent31.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change radical like sqrt(a^2+b^2) to (a^2+b^2)^(1/2). +# +# +# Last updated: Yao 07/25/2016 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + +$a = random(1,10,1); +$b = random(1,10,1); +$c = random(2,10,1); +$a2 = $a**2; +$b2 = $b**2; +$c2 = $c**2; + +Context()->flags->set(limits=>[0.5,5]); + +Context()->functions->undefine('sqrt'); + +$ans1 = Formula("($var**2+$a2)**(1/2)"); +$ans2 = Formula("($b2-$var**2)**(1/2)"); +$ans2->{limits} = [-$b+0.1,$b-0.1]; +$ans3 = Formula("$var+$a"); +$ans4 = Formula("$c*$var"); + +############################################## + + +BEGIN_PGML + +Simplify the following expression if possible, and then use rational exponents to write the answers. Assume all variables are positive. + +[@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.@]** + +a. [`` \sqrt{[$var]^2+[$a2]} = ``][_____________]{$ans1} + +a. [`` \sqrt{[$b2]-[$var]^2} = ``][_____________]{$ans2} + +a. [`` \sqrt{([$var]+[$a])^2} = ``][_____________]{$ans3} + +a. [`` \sqrt{[$c2] [$var]^2} = ``][_____________]{$ans4} + + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +Note that: + +* [`` \sqrt{x+y} \ne \sqrt{x}+\sqrt{y} ``], like [`` \sqrt{9+16} \ne \sqrt{9}+\sqrt{16} ``] +* [`` \sqrt{xy} = \sqrt{x}\cdot\sqrt{y} ``], like [`` \sqrt{4\cdot9} = \sqrt{4}\cdot\sqrt{9} ``] + +Here are the solutions: + +1) [`` \sqrt{[$var]^2+[$a2]} = [$ans1] ``] + +2) [`` \sqrt{[$b2]-[$var]^2} = [$ans2] ``] + +3) [`` \sqrt{([$var]+[$a])^2} = [$ans3] ``] + +4) [`` \sqrt{[$c2] [$var]^2} = [$ans4] ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent32.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent32.pg new file mode 100644 index 0000000000..df36cf69c5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent32.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change radical like sqrt(a^3+b^3) to (a^3+b^3)^(1/3). +# +# +# Last updated: Yao 07/25/2016 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + +$a = random(1,5,1); +$b = random(1,5,1); +$c = random(2,5,1); +$a3 = $a**3; +$b3 = $b**3; +$c3 = $c**3; + +Context()->functions->undefine('sqrt'); + +$ans1 = Formula("($a3+$var**3)**(1/3)"); +$ans1->{limits} = [-$a3+0.5,$a3-0.5]; +$ans2 = Formula("($var**3-$b3)**(1/3)"); +$ans2->{limits} = [-$b3+0.5,$b3-0.5]; +$ans3 = Formula("$var+$b"); +$ans4 = Formula("$c*$var"); + +############################################## + + +BEGIN_PGML + +Simplify the following expression if possible, and then use rational exponents to write the answers. Assume all variables are positive. + +* To enter [`x^y`], type *x^y*. + +1) [`` \sqrt[3]{[$a3]+[$var]^3} = ``][_____________]{$ans1} + +2) [`` \sqrt[3]{[$var]^3-[$b3]} = ``][_____________]{$ans2} + +3) [`` \sqrt[3]{([$var]+[$b])^3} = ``][_____________]{$ans3} + +4) [`` \sqrt[3]{[$c3] [$var]^3} = ``][_____________]{$ans4} + + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +Note that: + +* [`` \sqrt[3]{x+y} \ne \sqrt[3]{x}+\sqrt[3]{y} ``] +* [`` \sqrt[3]{xy} = \sqrt[3]{x}\cdot\sqrt[3]{y} ``] + +Here are the solutions: + +1) [`` \sqrt[3]{[$a3]+[$var]^3} = [$ans1] ``] + +2) [`` \sqrt[3]{[$var]^3-[$b3]} = [$ans2] ``] + +3) + + [`` + \begin{aligned} + \sqrt[3]{([$var]+[$b])^3} &= \left(([$var]+[$b])^3\right)^{\frac{1}{3}} \\ + &= [$ans3] + \end{aligned} + ``] + +4) + + [`` + \begin{aligned} + \sqrt[3]{[$c3] [$var]^3} &= \sqrt[3]{[$c3]} \cdot \sqrt[3]{[$var]^3} \\ + &= ([$c3])^{\frac{1}{3}}\cdot([$var]^3)^{\frac{1}{3}} \\ + &= [$ans4] + \end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator10.pg new file mode 100644 index 0000000000..041a300ddc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator10.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Danielle Rice +# Portland Community College +# +# Simplify a/sqrt(b), where b is a square number. +# +# Last edited: Jordan 9/8/13; Carl Yao 7/26/2013 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','denominator','rationalize','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", + "contextLimitedRadical.pl" +, + "PCCmacros.pl", + "PGcourse.pl", +); + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("LimitedRadical"); +#Almost always declare the context right away. Here we are declaring the most basic context, Numeric. + +#Create some random integers. +$a = random(1,10,2); #a random number from 1 to 9 taking steps of size 1 +do {$b = random(2,10,1);} until (gcd($a,$b)==1); +$c = Real($b**2); + +($a,$b) = ($a/gcd($a,$b), $b/gcd($a,$b)); +$answer = Formula("$a/$b"); +#Create a Math Object Real that will be the problem's answer. This is much more intricate than a simple Perl scalar that would result from . + + +TEXT(beginproblem()); +# Best practices always include this command here. It is responsible for the gray box around the problem, problem enumeration, and the path to the source .pg file. + +#Current best practice is to use the PGML environment to write the body. +BEGIN_PGML + + +Evaluate the following. + +[@KeyboardInstructions('If this expression is not a real number, enter [|not a real number|]*.')@]** + + [``\frac{[$a]}{\sqrt{[$c]}}``] = [_________]{$answer} . + +END_PGML + +########Begin more complicated answer processing (if needed)############ + +#Not needed in this template. + +########Begin answer hints.############ + +#Not used in this template. For the PCC coding projects, I think that this feature will rarely be used the first go-around. + +########Begin solution.############ + +#The walk-through solution is presented to students after the due date, and may soon also be used with a "show me how to do this" button that gives a walk-through for a similar but randomly generated problem. + +BEGIN_PGML_SOLUTION +Because the denominator in this problem is a perfect square, we can easily evaluate the square root: + + [`` \frac{[$a]}{\sqrt{[$c]}} = \frac{[$a]}{[$b]} ``] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator100.pg index 40b77a2547..347b1bed12 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator100.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RatDenom_various) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -28,7 +30,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -53,7 +56,7 @@ Context()->{error}{msg}{"You must simplify your answer further"} BEGIN_PGML -Simplify this radical. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` \sqrt{\frac{[$num]}{[$den]}} = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator110.pg new file mode 100644 index 0000000000..7752a4573e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator110.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator. Problem is given as a fraction. +# No radical can be simplified, like sqrt(12). +# +# Last edited: Carl Yao 8/31/13, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$num = list_random(2,3,5,6,7,10,11,13,14,15); +do {$den = list_random(2,3,5,6,7,10,11,13,14,15);} until (gcd($num,$den)==1); + +$radAns = $num*$den; + +Context("LimitedRadical"); +$ans = Formula("sqrt($radAns)/$den"); + +Context()->{error}{msg}{"You must simplify your answer further"} + = "Either your answer is not fully simplified or it has an irrational denominator"; + +##################################################### + +BEGIN_PGML + +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` \sqrt{\frac{[$num]}{[$den]}} = ``] [_____________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We first use this property: + + [`` \sqrt{\frac{a}{b}} = \frac{\sqrt{a}}{\sqrt{b}} ``] + +Then we will rationalize the denominator. The full process is: + + [`` +\begin{aligned} + \sqrt{\frac{[$num]}{[$den]}} + &= \frac{\sqrt{[$num]}}{\sqrt{[$den]}} \\ + &= \frac{\sqrt{[$num]}}{\sqrt{[$den]}}\cdot\frac{\sqrt{[$den]}}{\sqrt{[$den]}} \\ + &= \frac{\sqrt{[$num]} \cdot \sqrt{[$den]}}{\sqrt{[$den]} \cdot \sqrt{[$den]}} \\ + &= \frac{\sqrt{[$radAns]}}{[$den]} +\end{aligned} + ``] + +Note that we used this property in the last step: + + [`` \sqrt{a} \cdot \sqrt{b} = \sqrt{ab} ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator120.pg new file mode 100644 index 0000000000..184cc569de --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator120.pg @@ -0,0 +1,230 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator. Problem is given as a fraction. +# Numerator can be simplified, like sqrt(12). +# +# Last edited: Jordan 9/8/13; Carl Yao 8/31/13, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$out = list_random(2,3,4,5,6); +$in = list_random(2,3,5,6,7); +$num = $out**2*$in; +do {$den = list_random(2,3,5,6,7,13,10,11);} until (gcd($den,$num)==1); + +$numAns = $out; +$radAns = $in*$den; +$denAns = $den; + +Context("LimitedRadical"); +$ans = Formula("$numAns*sqrt($radAns)/$denAns"); + +Context()->{error}{msg}{"You must simplify your answer further"} + = "Either your answer is not fully simplified or it has an irrational denominator"; + + +##################################################### + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number. Output is the prime factorization of the number +# saved in an array, returned as a reference to the array. +sub primeFactor { + my $n = shift; + @factors = (); + my $prime=2; + while (1) { + while ($n%$prime==0) { + $factors[scalar @factors] = $prime; + $n=$n/$prime; + } + if ($n==1) {return ~~@factors;} + $prime = &nextPrime($prime); + } +} + +# Input 1 is a reference to an array with a number's prime factorization. +# Output is all prime factors connected by ' \cdot '. +sub line1 { + my $ra_factors = shift; + $line1Output = ""; + foreach $item ( @$ra_factors ) {$line1Output .= "$item".' \cdot ';} + $line1Output =~ s/ \cdot $//; + return $line1Output; +} + +# Input is the output of &line1() and the degree of the radical. +# $returnLine2 is the next step of simplifying the radical. +# For example, if input is "2 \cdot 2 \cdot 2 \cdot 3 \cdot 5", +# $degree=3, (meaning cube root), +# $returnLine2 is 2 sqrt[3]{3 \cdot 5}. +# $returnLine3 is the final step of simplifying the radical. +# In the above example, $returnLine3 is 2 sqrt[3]{15}. +sub line2 { + my $line = shift; + my $degree = shift; + my $line2Output = ""; + my @facs = split(/ \cdot /, $line); + my $size = 0+@facs; + my $i=0; + $outsideString = ""; + $insideString = ""; + $outsideNumber = 1; + $insideNumber = 1; + while ($i<$size) { + my $item = $facs[$i]; + my $out = 1; + for (my $j=$i; $j<$i+$degree; $j++) { + if ($facs[$j]!=$item) {$out = 0;} + } + if ($out==0) { + $insideNumber *= $facs[$i]; + $insideString .= "$facs[$i]".' \cdot '; + $i++; + } + else { + $outsideNumber *= $facs[$i]; + $outsideString .= "$facs[$i]".' \cdot '; + $i=$i+$degree; + } + } + $outsideString =~ s/ \cdot $//; + $insideString =~ s/ \cdot $//; + + $returnLine2 = ""; + if ($insideString eq "") {$returnLine2 = $outsideString;} + elsif ($degree==2) {$returnLine2 = + $outsideString.' \sqrt{'."$insideString".'}';} + else {$returnLine2 = + $outsideString.' \sqrt['."$degree".']{'."$insideString".'}';} + + $returnLine3 = ""; + if ($returnLine2 !~ /\cdot/) {$returnLine3 = "";} + elsif ($degree==2) {$returnLine3 = + $outsideNumber.' \sqrt{'."$insideNumber".'}';} + else {$returnLine3 = + $outsideNumber.' \sqrt['."$degree".']{'."$insideNumber".'}';} + + return ($returnLine2,$returnLine3); +} + +##################################################### + + +BEGIN_PGML + +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` \sqrt{\frac{[$num]}{[$den]}} = ``] [_____________]{$ans} + +END_PGML + +############################################################ + + +#Output of simplifying $radicand1 +$line1Center = &line1(&primeFactor($num)); +$output11 = '&= \sqrt{'.$line1Center.'} '; +($line2Center, $line3Center) = &line2($line1Center,2); +$output12 = '&='.$line2Center; +$output13 = "&"; +if ($line3Center ne "") {$output13 = '&='.$line3Center;} + + +BEGIN_PGML_SOLUTION + +We first use this property: + + [`` \sqrt{\frac{a}{b}} = \frac{\sqrt{a}}{\sqrt{b}} ``] + +Thus we have: + + [`` +\begin{aligned} + \sqrt{\frac{[$num]}{[$den]}} + &= \frac{\sqrt{[$num]}}{\sqrt{[$den]}} \\ +\end{aligned} + ``] + +We can simplify the radical in the numerator: + + [`` +\begin{aligned} + \sqrt{[$num]} + [$output11] \\ + [$output12] \\ + [$output13] +\end{aligned} + ``] + +Then we will rationalize the denominator. The full process is: + + [`` +\begin{aligned}[t] + \sqrt{\frac{[$num]}{[$den]}} + &= \frac{\sqrt{[$num]}}{\sqrt{[$den]}} \\ + &= \frac{ [$out] \sqrt{[$in]}}{\sqrt{[$den]}} \\ + &= \frac{ [$out] \sqrt{[$in]}}{\sqrt{[$den]}}\cdot\frac{\sqrt{[$den]}}{\sqrt{[$den]}} \\ + &= \frac{ [$out] \sqrt{[$in]}\cdot \sqrt{[$den]}}{\sqrt{[$den]}\cdot \sqrt{[$den]}} \\ + &= \frac{[$numAns]\sqrt{[$radAns]}}{[$denAns]} +\end{aligned} + ``] + +Note that we used this property in the last step: + + [`` \sqrt{a} \cdot \sqrt{b} = \sqrt{ab} ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg index f77caba023..f50b40cde3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RatDenom_various) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -28,7 +30,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -39,7 +42,7 @@ Context("Numeric"); $out = list_random(2,3,4,5,6); $in = list_random(2,3,5,6,7); $den = $out**2*$in; -do {$num = list_random(2,3,5,6,7,8,10,11);} until (gcd($den,$num)==1); +do {$num = list_random(2,3,5,6,7,10,11);} until (gcd($den,$num)==1); $radAns = $in*$num; $denAns = $out*$in; @@ -156,7 +159,7 @@ sub line2 { BEGIN_PGML -Simplify this radical. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` \sqrt{\frac{[$num]}{[$den]}} = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator140.pg new file mode 100644 index 0000000000..4ac733c938 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator140.pg @@ -0,0 +1,137 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator in sqrt(b/ax) +# +# Last edited: Carl Yao 8/10/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +do{ + $a = list_random(2,3,5,6,7,10); + $b = list_random(1,2,3,5,6,7,10); +} until (gcd($a,$b)==1); + +$problem = Compute("sqrt($b/($a*$var))")->reduce; + +$ab = $a*$b; + +$ansString0 = Compute("sqrt($ab*$var)/($a*$var)")->reduce; +$ansString1 = Compute("sqrt($ab*$var)/($var)")->reduce; +$ansString2 = Compute("sqrt($ab*$var)/($a)")->reduce; +$ansString3 = Compute("sqrt($b*$var)/($a*$var)")->reduce; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Rationalize the denominator of this expression. Assume all variables are positive. + + [``[$problem] =``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$problem] \\ + &= \frac{\sqrt{[$b]}}{\sqrt{[$a][$var]}} \\ + &= \frac{\sqrt{[$b]} \cdot \sqrt{[$a][$var]}}{\sqrt{[$a][$var]} \cdot \sqrt{[$a][$var]}} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator150.pg new file mode 100644 index 0000000000..ac6bde7dc5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator150.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator in sqrt[3](b/ax^2) +# +# Last edited: Carl Yao 8/10/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +do{ + $a = list_random(2,3,5,6,7,10); + $b = list_random(1,2,3,5,6,7,10); +} until (gcd($a,$b)==1); + +$problem = "\sqrt[3]{\frac{$b}{$a $var^2}}"; + +$a2 = $a*$a; +$a2b = $a*$a*$b; +$ab = $a*$b; + +$ansString0 = "\frac{\sqrt[3]{$a2b $var}}{$a $var}"; +$ansString1 = "\frac{\sqrt[3]{$ab $var}}{$a $var}"; +$ansString2 = "\frac{\sqrt[3]{$a2b $var}}{$a2 $var}"; +$ansString3 = "\frac{\sqrt[3]{$a2b $var^{2}}}{$a $var}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Rationalize the denominator of this expression. Assume all variables are positive. + + [``[$problem] =``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$problem] \\ + &= \frac{\sqrt[3]{[$b]}}{\sqrt[3]{[$a][$var]^2}} \\ + &= \frac{\sqrt[3]{[$b]} \cdot \sqrt{[$a]^2 [$var]}}{\sqrt[3]{[$a][$var]^2} \cdot \sqrt{[$a]^2 [$var]}} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator160.pg new file mode 100644 index 0000000000..435d8bd42f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator160.pg @@ -0,0 +1,145 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator in 1/(sqrt(2)+4) +# +# Last edited: Carl Yao 8/15/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +#$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#Context()->variables->are($var=>'Real'); + +do { + $c = list_random(2,4,6); + $c2 = $c**2; + $b = $c2-1; + $bpc = $b+$c; + $a = random(2,9,1); +} until ( (sqrt($b) != int(sqrt($b))) && (gcd($a,$bpc)==1) ); + +$problem = "\frac{$a}{\sqrt{$b} + $c}"; + + + +$ansString0 = "$a($c-\sqrt{$b})"; +$ansString1 = "$a(\sqrt{$b}-$c)"; +$ansString2 = "\frac{$a \sqrt{$b}}{$bpc}"; +$ansString3 = "\frac{$a(\sqrt{$b}-$c)}{$bpc}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Rationalize the denominator of this expression: + + [``[$problem] =``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + + +BEGIN_PGML_SOLUTION + +We will use the formula [` (x+y)(x-y) = x^2-y^2 `] to rationalize the denominator. + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$problem] \\ + &= \frac{[$a] \cdot (\sqrt{[$b]} - [$c])}{(\sqrt{[$b]} + [$c]) \cdot (\sqrt{[$b]} - [$c])} \\ + &= \frac{[$a] (\sqrt{[$b]} - [$c])}{(\sqrt{[$b]})^2-[$c]^2} \\ + &= \frac{[$a] (\sqrt{[$b]} - [$c])}{[$b]-[$c2]} \\ + &= \frac{[$a] (\sqrt{[$b]} - [$c])}{-1} \\ + &= -[$a] (\sqrt{[$b]} - [$c]) \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator165.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator165.pg new file mode 100644 index 0000000000..161f5213eb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator165.pg @@ -0,0 +1,177 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator in 1/(2sqrt(2)+4) +# +# Last edited: Carl Yao 8/15/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +#$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#Context()->variables->are($var=>'Real'); + +do { + $b = list_random(2,3,5,7); + do {$a = random(2,6,1);$c = random(2,6,1);} until (gcd($a,$c)==1); + $a2 = $a**2; + $c2 = $c**2; + $den = $a2*$b-$c2; + $d = random(2,abs($den),1); + $factor = $den/$d; + $e = $a*$b-$c; +} until ( ($den<0) && ($factor==int($factor)) && ($e!=0) ); +$factorN = -$factor; + +$s1 = (random(0,1,1)==0) ? '+' : '-'; +$s2 = ($s1 eq '+') ? '-' : '+'; + +$problem = "\frac{$d}{$a \sqrt{$b} $s1 $c}"; + +$ansString0 = ($factorN==1) ? "-($a \sqrt{$b} $s2 $c)" : "-\frac{$a \sqrt{$b} $s2 $c}{$factorN}"; +$ansString1 = ($factorN==1) ? "$a \sqrt{$b} $s2 $c" : "\frac{$a \sqrt{$b} $s2 $c}{$factorN}"; + +$absE = abs($e); + +$factor2 = gcd($d,abs($e)); +$num1 = $d/$factor2; +$den1 = $absE/$factor2; + +if ($factor2!=int($factor2)) { + if ($e!=1) { + $ansString2 = "\frac{$d($a \sqrt{$b} $s2 $c)}{$e}"; + $ansString3 = "-\frac{$d($a \sqrt{$b} $s2 $c)}{$e}"; + } else { + $ansString2 = "$d($a \sqrt{$b} $s2 $c)"; + $ansString3 = "-$d($a \sqrt{$b} $s2 $c)"; + } +} else { + if ( ($num1!=1) && ($den1!=1) ) { + $ansString2 = "\frac{$num1($a \sqrt{$b} - $c)}{$den1}"; + $ansString3 = "-\frac{$num1($a \sqrt{$b} - $c)}{$den1}"; + } elsif ( ($num1==1) && ($den1!=1) ) { + $ansString2 = "\frac{$a \sqrt{$b} - $c}{$den1}"; + $ansString3 = "-\frac{$a \sqrt{$b} - $c}{$den1}"; + } elsif ( ($num1!=1) && ($den1==1) ) { + $ansString2 = "$num1($a \sqrt{$b} - $c)"; + $ansString3 = "-$num1($a \sqrt{$b} - $c)"; + } else { + $ansString2 = "$a \sqrt{$b} - $c"; + $ansString3 = "-($a \sqrt{$b} - $c)"; + } +} + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Rationalize the denominator of this expression: + + [``[$problem] =``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + + +BEGIN_PGML_SOLUTION + +We will use the formula [` (x+y)(x-y) = x^2-y^2 `] to rationalize the denominator. + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$problem] \\ + &= \frac{[$d] \cdot ([$a] \sqrt{[$b]} [$s2] [$c])}{([$a] \sqrt{[$b]} [$s1] [$c]) \cdot ([$a] \sqrt{[$b]} [$s2] [$c])} \\ + &= \frac{[$d] ([$a] \sqrt{[$b]} [$s2] [$c])}{([$a] \sqrt{[$b]})^2 - ([$c])^2} \\ + &= \frac{[$d] ([$a] \sqrt{[$b]} [$s2] [$c])}{[$a2*$b] - [$c2]} \\ + &= \frac{[$d] ([$a] \sqrt{[$b]} [$s2] [$c])}{[$den]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator170.pg new file mode 100644 index 0000000000..faeb143122 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator170.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator in 4/(sqrt(2)+sqrt(3)) +# +# Last edited: Carl Yao 8/15/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +#$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#Context()->variables->are($var=>'Real'); + +do { + $b=list_random(2,3,5,6,7,10,11,13,14,15,17,19); + $a=list_random(2,3,5,6,7,10,11,13,14,15,17,19); + $amb = $a-$b; +} until ( ($a>$b) && ($amb!=1) ); +$factor = random(2,5,1); +$c = $amb*$factor; + +$symbol1 = (random(0,1,1)==0) ? '+' : '-'; +$symbol2 = ($symbol1 eq '+') ? '-' : '+'; +$problem = "\frac{$c}{\sqrt{$a} $symbol1 \sqrt{$b}}"; + +$ansString0 = "$factor(\sqrt{$a} $symbol2 \sqrt{$b})"; +$ansString1 = "$factor(\sqrt{$a} $symbol1 \sqrt{$b})"; +$ansString2 = "$c(\sqrt{$a} $symbol2 \sqrt{$b})"; +$ansString3 = "$c(\sqrt{$a} $symbol1 \sqrt{$b})"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Rationalize the denominator of this expression: + + [``[$problem] =``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + + +BEGIN_PGML_SOLUTION + +We will use the formula [` (x+y)(x-y) = x^2-y^2 `] to rationalize the denominator. + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$problem] \\ + &= \frac{[$c] \cdot (\sqrt{[$a]} [$symbol2] [$b])}{(\sqrt{[$a]} [$symbol1] [$b]) \cdot (\sqrt{[$a]} [$symbol2] [$b])} \\ + &= \frac{[$c] (\sqrt{[$a]} [$symbol2] [$b])}{(\sqrt{[$a]})^2-(\sqrt{[$b]})^2} \\ + &= \frac{[$c] (\sqrt{[$a]} [$symbol2] [$b])}{[$a]-[$b]} \\ + &= \frac{[$c] (\sqrt{[$a]} [$symbol2] [$b])}{[$amb]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator180.pg new file mode 100644 index 0000000000..6a20affa00 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator180.pg @@ -0,0 +1,158 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator in (sqrt(2)-sqrt(3))/(sqrt(2)+sqrt(3)) +# +# Last edited: Carl Yao 8/15/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +#$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#Context()->variables->are($var=>'Real'); + +do { + $b=list_random(2,3,5,7,11,13); + $a=list_random(2,3,5,7,11,13); + $amb = $a-$b; + $apb = $a+$b; + $factor = gcd($amb,$apb); +} until ( ($a>$b) && ($amb!=1) && ($factor!=1) ); + +$ab = $a*$b; +$num = $apb/2; +$den = $amb/2; + +$s1 = (random(0,1,1)==0) ? '+' : '-'; +$s2 = ($s1 eq '+') ? '-' : '+'; +$problem = "\frac{\sqrt{$a} $s1 \sqrt{$b}}{\sqrt{$a} $s2 \sqrt{$b}}"; + +$e = $apb/2; + +if ($den==1) { + $ansString0 = "$num $s1 \sqrt{$ab}"; + $ansString1 = "\frac{$apb $s1 2 \sqrt{$ab}}{$amb}"; + $ansString2 = "$num $s1 2 \sqrt{$ab}"; + $ansString3 = "\frac{$e $s1 \sqrt{$ab}}{$e}"; +} else { + $ansString0 = "\frac{$num $s1 \sqrt{$ab}}{$den}"; + $ansString1 = "\frac{$num $s1 2 \sqrt{$ab}}{$den}"; + $ansString2 = "\frac{$apb $s1 2 \sqrt{$ab}}{$amb}"; + $ansString3 = "\frac{$e $s1 \sqrt{$ab}}{$e}"; +} + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Rationalize the denominator of this expression: + + [``[$problem] =``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + + +BEGIN_PGML_SOLUTION + +We will use the formula [` (x+y)(x-y) = x^2-y^2 `] to rationalize the denominator. + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$problem] \\ + &= \frac{ (\sqrt{[$a]} [$s1] \sqrt{[$b]}) \cdot (\sqrt{[$a]} [$s1] \sqrt{[$b]}) }{ (\sqrt{[$a]} [$s2] \sqrt{[$b]}) \cdot (\sqrt{[$a]} [$s1] \sqrt{[$b]}) } \\ + &= \frac{ (\sqrt{[$a]})^2 [$s1] \sqrt{[$a]} \cdot \sqrt{[$b]} [$s1] \sqrt{[$a]} \cdot \sqrt{[$b]} + (\sqrt{[$b]})^2 }{ (\sqrt{[$a]})^2 - (\sqrt{[$b]})^2 } \\ + &= \frac{ [$a] [$s1] \sqrt{[$ab]} [$s1] \sqrt{[$ab]} + [$b] }{ [$a]-[$b] } \\ + &= \frac{ [$apb] [$s1] 2 \sqrt{[$ab]} }{ [$amb] } \\ + &= \frac{ 2([$num] [$s1] \sqrt{[$ab]}) }{ [$amb] } \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator190.pg new file mode 100644 index 0000000000..7882bcdfd9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator190.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator in (sqrt(x)-4)/(sqrt(x)+4) +# +# Last edited: Carl Yao 8/15/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-9,9,1); +do {$b = non_zero_random(-9,9,1);} until (abs($a)!=abs($b)); + +$bma = $b-$a; +$bpa = $b+$a; +$ab = $a*$b; +$a2 = $a**2; + +$s1 = (random(0,1,1)==0) ? '+' : '-'; +$s2 = ($s1 eq '+') ? '-' : '+'; +$problem = Compute("(sqrt($var)+$b)/(sqrt($var)+$a)")->reduce; + + $ansString0 = Compute("($var+$bma*sqrt($var)-$ab)/($var-$a2)")->reduce; + $ansString1 = Compute("($var+$bpa*sqrt($var)+$ab)/($var-$a2)")->reduce; + $ansString2 = Compute("($var**2+$bma*$var-$ab)/($var**2-$a2)")->reduce; + $ansString3 = Compute("($var+$bma*sqrt($var)-$ab)/($var**2-$a2)")->reduce; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Rationalize the denominator of this expression. Assume all variables are positive. + + [``[$problem] =``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +$s1 = Compute("sqrt($var)+$b")->reduce; +$s2 = Compute("sqrt($var)-$a")->reduce; +$s3 = Compute("sqrt($var)+$a")->reduce; +$s4 = Compute("(sqrt($var))**2+$b*sqrt($var)-$a*sqrt($var)-$ab")->reduce; +$absA = abs($a); + +BEGIN_PGML_SOLUTION + +We will use the formula [` (x+y)(x-y) = x^2-y^2 `] to rationalize the denominator. + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$problem] \\ + &= \frac{([$s1]) \cdot ([$s2])}{([$s3]) \cdot ([$s2])} \\ + &= \frac{[$s4]}{(\sqrt{[$var]})^2-([$absA])^2} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator20.pg new file mode 100644 index 0000000000..84c881b6a9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator20.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Danielle Rice +# Portland Community College +# +# Simplify a*x/sqrt(b), where b is a square number. +# +# Last edited: Jordan 9/8/13; Carl Yao 7/26/2013 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','denominator','rationalize','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Danielle Rice, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("LimitedRadical"); +$var1 = RandomVariableName(type=>'variable'); +Context()->variables->are($var1=>'Real'); + +#Create some random integers. +$a = random(2,9,1); +do {$b = random(2,10,1);} until (gcd($a,$b)==1); +$c = Real($b*$b); + + +$answer = Formula("$a*$var1/$b"); +#Create a Math Object Real that will be the problem's answer. This is much more intricate than a simple Perl scalar that would result from . + + +TEXT(beginproblem()); +# Best practices always include this command here. It is responsible for the gray box around the problem, problem enumeration, and the path to the source .pg file. + +#Current best practice is to use the PGML environment to write the body. +BEGIN_PGML + + +Rationalize the denominator and simplify the expression. + + [``\frac{[$a] [$var1]}{\sqrt{[$c]}}``] = [_________]{$answer} . + +END_PGML + +########Begin more complicated answer processing (if needed)############ + +#Not needed in this template. + +########Begin answer hints.############ + +#Not used in this template. For the PCC coding projects, I think that this feature will rarely be used the first go-around. + +########Begin solution.############ + +#The walk-through solution is presented to students after the due date, and may soon also be used with a "show me how to do this" button that gives a walk-through for a similar but randomly generated problem. + +BEGIN_PGML_SOLUTION + +Because the denominator in this problem is a perfect square, we can easily evaluate the square root: + + [`` \frac{[$a][$var1]}{\sqrt{[$c]}} = \frac{[$a][$var1]}{[$b]} ``] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator200.pg new file mode 100644 index 0000000000..43e7daef5d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator200.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator in (x+sqrt(y))/(x-sqrt(y)) +# +# Last edited: Carl Yao 8/15/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$s1 = (random(0,1,1)==0) ? '+' : '-'; +$s2 = ($s1 eq '+') ? '-' : '+'; +$top = Compute("$var1 $s1 sqrt($var2)")->reduce; +$bottom = Compute("$var1 $s2 sqrt($var2)")->reduce; +$problem = Compute("($top)/($bottom)")->reduce; + +$m = Compute("$var1 $s1 sqrt($var2)")->reduce; + + $ansString0 = Compute("($var1**2 $s1 2*$var1*sqrt($var2)+$var2)/($var1**2-$var2)")->reduce; + $ansString1 = Compute("($var1 $s1 2*$var1*sqrt($var2)+$var2)/($var1-$var2)")->reduce; + $ansString2 = Compute("($var1**2 $s1 2*sqrt($var1*$var2)+$var2)/($var1**2-$var2)")->reduce; + $ansString3 = Compute("($var1 $s1 2*sqrt($var1*$var2)+$var2)/($var1-$var2)")->reduce; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Rationalize the denominator of this expression. Assume all variables are positive. + + [``[$problem] =``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +$s3 = Compute("$var1**2 $s1 $var1*sqrt($var2) $s1 $var1*sqrt($var2) + (sqrt($var2))**2")->reduce; +$s4 = Compute("$var1**2 - (sqrt($var2))**2")->reduce; + +BEGIN_PGML_SOLUTION + +We will use the formula [` (x+y)(x-y) = x^2-y^2 `] to rationalize the denominator. + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$problem] \\ + &= \frac{([$top]) \cdot ([$m])}{([$bottom]) \cdot ([$m])} \\ + &= \frac{[$s3]}{[$s4]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator210.pg new file mode 100644 index 0000000000..3039bb9122 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator210.pg @@ -0,0 +1,142 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator in 1/(sqrt(x+a)-sqrt(x)) +# +# Last edited: Carl Yao 8/17/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$s1 = (random(0,1,1)==0) ? '+' : '-'; +$s2 = ($s1 eq '+') ? '-' : '+'; +$a = random(1,9,1); +$den = Compute("sqrt($var1+$a) $s1 sqrt($var1)")->reduce; +$problem = Compute("1/$den")->reduce; + +$m = Compute("sqrt($var1+$a) $s2 sqrt($var1)")->reduce; + +$ansString0 = Compute("(sqrt($var1+$a) $s2 sqrt($var1))/$a")->reduce; +$ansString1 = Compute("(sqrt($var1+$a) $s1 sqrt($var1))/$a")->reduce; +$ansString2 = Compute("(sqrt($var1+$a) $s2 sqrt($var1))/(2*$var1+$a)")->reduce; +$ansString3 = Compute("(sqrt($var1+$a) $s1 sqrt($var1))/(2*$var1+$a)")->reduce; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Rationalize the denominator of this expression. Assume all variables are positive. + + [``[$problem] =``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +$s3 = Compute("(sqrt($var1)+$a)**2 - (sqrt($var1))**2")->reduce; +$s4 = Compute("$var1+$a-$var1")->reduce; + +BEGIN_PGML_SOLUTION + +We will use the formula [` (x+y)(x-y) = x^2-y^2 `] to rationalize the denominator. + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$problem] \\ + &= \frac{1 \cdot ([$m])}{([$den]) \cdot ([$m])} \\ + &= \frac{[$m]}{[$s3]} \\ + &= \frac{[$m]}{[$s4]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg new file mode 100644 index 0000000000..eecebe77ed --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator. Numerator is 1. Radical cannot be simplified. +# Answer is a fraction. No fraction reduction is needed. +# +# Last edited: Jordan 9/8/13; Carl Yao 8/31/13, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$rad = list_random(2,3,5,6,7,10); +$num = 1; + +Context("LimitedRadical"); +$ans = Formula("sqrt($rad)/$rad"); + +Context()->{error}{msg}{"You must simplify your answer further"} + = "Either your answer is not fully simplified or it has an irrational denominator"; + +##################################################### + +BEGIN_PGML + +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` \frac{1}{\sqrt{[$rad]}} = ``] [_____________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +We need to legally remove the radical [`\sqrt{[$rad]}`] from the denominator. + +We will use this property: + + [`` \sqrt{x} \cdot \sqrt{x} = x ``] + +In this case, we have: + + [`` \sqrt{[$rad]} \cdot \sqrt{[$rad]} = [$rad] ``] + +We will multiply both the numerator and denominator by [` \sqrt{[$rad]} `], and we have: + + [`` +\begin{aligned}[t] + \frac{1}{\sqrt{[$rad]}} &= \frac{1}{\sqrt{[$rad]}}\cdot \frac{\sqrt{[$rad]}}{\sqrt{[$rad]}}\\ + &= \frac{1 \cdot \sqrt{[$rad]}}{\sqrt{[$rad]} \cdot \sqrt{[$rad]}} \\ + &= \frac{\sqrt{[$rad]}}{[$rad]} +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator35.pg new file mode 100644 index 0000000000..74978e984d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator35.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator. 2/\sqrt(x) +# +# Last edited: Carl Yao 8/5/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); + +Context("LimitedRadical"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var=>'Real'); + +$num = random(1,5,1); +$ans = ($num != 1) ? Formula("$num sqrt($var)/$var") : Formula("sqrt($var)/$var"); + +Context()->{error}{msg}{"You must simplify your answer further"} + = "Either your answer is not fully simplified or it has an irrational denominator"; + +##################################################### + +BEGIN_PGML + +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` \frac{[$num]}{\sqrt{[$var]}} = ``] [_____________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +We need to legally remove the radical [`\sqrt{[$var]}`] from the denominator. + +We will use this property: + + [`` \sqrt{[$var]} \cdot \sqrt{[$var]} = [$var] ``] + +We will multiply both the numerator and denominator by [` \sqrt{[$var]} `], and we have: + + [`` +\begin{aligned}[t] + \frac{[$num]}{\sqrt{[$var]}} &= \frac{[$num]}{\sqrt{[$var]}}\cdot \frac{\sqrt{[$var]}}{\sqrt{[$var]}}\\ + &= \frac{[$num] \cdot \sqrt{[$var]}}{\sqrt{[$var]} \cdot \sqrt{[$var]}} \\ + &= \frac{[$num] \cdot \sqrt{[$var]}}{[$var]} +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator36.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator36.pg new file mode 100644 index 0000000000..e8785aeb1e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator36.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator. 6/\sqrt(3y) +# +# Last edited: Carl Yao 8/5/16, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); + +Context("LimitedRadical"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var=>'Real'); + +$den = list_random(2,3,5,6,7); +$factor = random(1,5,1); +$num = $factor*$den; +$ans = ($factor == 1) ? Formula("sqrt($den*$var)/$var") : Formula("$factor sqrt($den*$var)/$var"); + +Context()->{error}{msg}{"You must simplify your answer further"} + = "Either your answer is not fully simplified or it has an irrational denominator"; + +##################################################### + +BEGIN_PGML + +Rationalize the denominator. + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* Assume all variables are positive. + + [`` \frac{[$num]}{\sqrt{[$den] [$var]}} = ``] [_____________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +We need to legally remove the radical [`\sqrt{[$var]}`] from the denominator. + +We will use this property: + + [`` \sqrt{x} \cdot \sqrt{x} = x ``] + +We will multiply both the numerator and denominator by [` \sqrt{[$den] [$var]} `], and we have: + + [`` +\begin{aligned}[t] + \frac{[$num]}{\sqrt{[$den] [$var]}} &= \frac{[$num]}{\sqrt{[$den] [$var]}}\cdot \frac{\sqrt{[$den] [$var]}}{\sqrt{[$den] [$var]}}\\ + &= \frac{[$num] \cdot \sqrt{[$den] [$var]}}{\sqrt{[$den] [$var]} \cdot \sqrt{[$den] [$var]}} \\ + &= \frac{[$num] \cdot \sqrt{[$den] [$var]}}{[$den] [$var]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator37.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator37.pg new file mode 100644 index 0000000000..af7e010630 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator37.pg @@ -0,0 +1,203 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator with variables involved. +# +# Last edited: Carl Yao 8/6/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent','rationalize') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$showPartialCorrectAnswers = 1; + +$root = 2; +$numOfNums = 4; + +@num = (2,3,5,7,$var1,$var2); +@power = (); + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,3,1); + $power[2]=random(0,3,1); + $power[3]=random(0,2,1); + $power[4]=random(1,9,2); + do {$power[5]=random(1,9,2);} until ($power[4] != $power[5]); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>1) {$ok1=1;} + if ($power[$i]%2 !=0) {$ok2=1;} + } + } until ( ($integer<=500) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=5;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outVar = ""; + $inVar = ""; + $ansDenVar = ""; + for (my $i=0; $i<=$#num; $i++) { + $numOut = int($power[$i]/$root); + if ($numOut==1) { + $outString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";$ansDenVar .= "$num[$i]^{2}";} + } elsif ($numOut!=0) { + $outString .= "$num[$i]^{$numOut} \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i]**$numOut;} + else { + $outVar .= "$num[$i]^{$numOut} "; + $temp = $numOut+1; + $ansDenVar .= "$num[$i]^{$temp}"; + } + } else {if ($i>=$numOfNums) {$ansDenVar .= "$num[$i]";}} + $numIn = $power[$i]%$root; + if ($numIn==1) { + $inString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$inNum *= $num[$i];} + else {$inVar .= "$num[$i] ";} + } elsif ($numIn!=0) { + $inString .= "$num[$i]^{$numIn} \cdot "; + if ($i<$numOfNums) {$inNum *= $num[$i]**$numIn;} + else {$inVar .= "$num[$i]^{$numIn} ";} + } + } + +$inString = substr($inString,0,length($inString)-7); + +$ansDenNum = $outNum*$inNum; + +$s1 = ($power[4]==1) ? "$var1" : "$var1^{$power[4]}"; +$s2 = ($power[5]==1) ? "$var2" : "$var2^{$power[5]}"; + +$problem = "\frac{1}{\sqrt{$integer $s1 $s2}}"; +$ansString0 = "\frac{\sqrt{$inNum $inVar}}{$ansDenNum $ansDenVar}"; +$ansString1 = "$outNum $outVar"." \cdot \sqrt{$inNum $inVar}"; +$ansString2 = "\frac{\sqrt{$inNum $inVar}}{$outNum $outVar}"; +$ansString3 = "\frac{\sqrt{$inNum $inVar}}{$outNum $ansDenVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Make sure to rationalize the denominator. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{1}{\sqrt{[$allString]}} \\ + &= \frac{1}{[$outString] \sqrt{[$inString]}} \\ + &= \frac{1}{[$outNum] [$outVar] \cdot \sqrt{[$inNum] [$inVar]}} \\ + &= \frac{1 \cdot \sqrt{[$inNum] [$inVar]}}{[$outNum] [$outVar] \cdot \sqrt{[$inNum] [$inVar]} \cdot \sqrt{[$inNum] [$inVar]}} \\ + &= \frac{\sqrt{[$inNum] [$inVar]}}{[$outNum] [$outVar] ([$inNum] [$inVar])} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator40.pg index 43706a5fae..42105be422 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator40.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RatDenom_various) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -29,7 +30,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -50,7 +52,7 @@ Context()->{error}{msg}{"You must simplify your answer further"} BEGIN_PGML -Rationalize the denominator. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` \frac{[$num]}{\sqrt{[$rad]}} = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg index d6b779d1be..d82e1f09bc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RatDenom_various) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -53,7 +56,7 @@ Context()->{error}{msg}{"You must simplify your answer further"} BEGIN_PGML -Rationalize the denominator. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` \frac{[$num]}{[$out]\sqrt{[$rad]}} = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg index f005019e37..9dbaab1bde 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RatDenom_various) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -28,7 +30,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -58,7 +61,7 @@ Context()->{error}{msg}{"You must simplify your answer further"} BEGIN_PGML -Rationalize the denominator. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` \frac{[$num]}{\sqrt{[$rad]}} = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator60.pg index 3bb1636269..c8fe5880d1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator60.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RatDenom_various) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -28,7 +30,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -55,7 +58,7 @@ Context()->{error}{msg}{"You must simplify your answer further"} BEGIN_PGML -Rationalize the denominator. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` \frac{[$num]}{\sqrt{[$rad]}} = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg index eb7850c8a6..49147d6a3d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RatDenom_various) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -28,7 +30,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -154,7 +157,7 @@ sub line2 { BEGIN_PGML -Rationalize the denominator. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` \frac{[$num]}{[$sqrt1]} = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg index 8ca6a219fe..83ff597e8c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RatDenom_various) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -28,7 +30,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -183,7 +186,7 @@ sub line2 { BEGIN_PGML -Rationalize the denominator. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` \frac{[$num]}{[$sqrt1]} = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator81.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator81.pg new file mode 100644 index 0000000000..9c73731950 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator81.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator with cube root. +# +# Last edited: Carl Yao 8/17/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent','rationalize') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +#$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +#do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +#Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = list_random(2,3,5,7); +$factor = random(1,5,1); +$b = $a*$factor; +$a2 = $a**2; + +$problem = "\frac{$b}{\sqrt[3]{$a}}"; +$ansString0 = ($factor==1) ? "\sqrt[3]{$a2}" : "$factor \cdot \sqrt[3]{$a2}"; +$ansString1 = ($factor==1) ? "\sqrt[3]{$a}" : "$factor \cdot \sqrt[3]{$a}"; +$ansString2 = ($factor==1) ? "\sqrt{$a}" : "$factor \cdot \sqrt{$a}"; + +$f = $a*$factor; +$ansString3 = "$f"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Make sure to rationalize the denominator. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +We will use the property [` \sqrt[3]{x^3}=x `] to rationalize the denominator: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{[$b] \cdot \sqrt[3]{[$a]^2}}{\sqrt[3]{[$a]} \cdot \sqrt[3]{[$a]^2}} \\ + &= \frac{[$b] \cdot \sqrt[3]{[$a]^2}}{\sqrt[3]{[$a]^3}} \\ + &= \frac{[$b] \cdot \sqrt[3]{[$a]^2}}{[$a]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator82.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator82.pg new file mode 100644 index 0000000000..afca3de2fc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator82.pg @@ -0,0 +1,155 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator with cube root. There is a variable. +# +# Last edited: Carl Yao 8/17/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent','rationalize') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +$a = random(2,5,1); +$oneOrTwo = random(1,2,1); + +if ($oneOrTwo==1) { + $problem = "\frac{$a}{\sqrt[3]{$var}}"; + $ansString0 = "\frac{$a \cdot \sqrt[3]{$var^2}}{$var}"; + $ansString1 = "\frac{$a \cdot \sqrt[3]{$var}}{$var}"; + $ansString2 = "\frac{$a \cdot \sqrt{$var}}{$var}"; + $ansString3 = "$a \cdot \sqrt[3]{$var^2}"; +} else { + $problem = "\frac{$a}{\sqrt[3]{$var^2}}"; + $ansString0 = "\frac{$a \cdot \sqrt[3]{$var}}{$var}"; + $ansString1 = "\frac{$a \cdot \sqrt[3]{$var^2}}{$var}"; + $ansString2 = "\frac{$a}{$var}"; + $ansString3 = "$a \cdot \sqrt[3]{$var}"; +} + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Make sure to rationalize the denominator. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +if ($oneOrTwo==1) { + +BEGIN_PGML_SOLUTION + +We will use the property [` \sqrt[3]{x^3}=x `] to rationalize the denominator: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{[$a] \cdot \sqrt[3]{[$var]^2}}{\sqrt[3]{[$var]} \cdot \sqrt[3]{[$var]^2}} \\ + &= \frac{[$a] \cdot \sqrt[3]{[$var]^2}}{\sqrt[3]{[$var]^3}} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +} else { + +BEGIN_PGML_SOLUTION + +We will use the property [` \sqrt[3]{x^3}=x `] to rationalize the denominator: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{[$a] \cdot \sqrt[3]{[$var]}}{\sqrt[3]{[$var]^2} \cdot \sqrt[3]{[$var]}} \\ + &= \frac{[$a] \cdot \sqrt[3]{[$var]}}{\sqrt[3]{[$var]^3}} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +} + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator83.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator83.pg new file mode 100644 index 0000000000..9aa11fd45f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator83.pg @@ -0,0 +1,227 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator with cube root. No variables. +# +# Last edited: Carl Yao 8/6/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent','rationalize') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +#$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +#do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +#Context()->variables->are($var1=>'Real',$var2=>'Real'); +$showPartialCorrectAnswers = 1; + +$root = 3; +$numOfNums = 4; + +@num = (2,3,5,7); +@power = (); + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,4,1); + $power[2]=random(0,4,1); + $power[3]=random(0,2,1); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>3) {$ok1=1;} + if ($power[$i]%3 !=0) {$ok2=1;} + } + } until ( ($integer<=1000) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=$#num;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $outString2 = ""; + $inString = ""; + $outNum = 1; + $outNum2 = 1; + $inNum = 1; + $inNum2 = 1; + $outVar = ""; + $outVar2 = ""; + $inVar = ""; + $ansDenVar = ""; + $toMultiplyString = ""; + $toMultiplyNum = 1; + $toMultiplyVar = ""; + for (my $i=0; $i<=$#num; $i++) { + $numOut = int($power[$i]/$root); + if ($numOut==1) { + $outString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";$ansDenVar .= "$num[$i]^{2} ";} + } elsif ($numOut!=0) { + $outString .= "$num[$i]^{$numOut} \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i]**$numOut;} + else { + $outVar .= "$num[$i]^{$numOut} \cdot "; + $temp = $numOut+1; + $ansDenVar .= "$num[$i]^{$temp} "; + } + } else {if ($i>=$numOfNums) {$ansDenVar .= "$num[$i] ";}} + $numIn = $power[$i]%$root; + $temp = $root-$numIn; + if ($numIn!=0) {$inNum2 *= $num[$i];} + if ($numIn==1) { + $inString .= "$num[$i] \cdot "; + $toMultiplyString .= "$num[$i]^{$temp} \cdot "; + $outNum2 *= $num[$i]; + $outString2 .= "$num[$i] \cdot "; + if ($i<$numOfNums) { + $inNum *= $num[$i]; + $toMultiplyNum *= $num[$i]**$temp; + } else { + $inVar .= "$num[$i] "; + $outVar2 .= "$num[$i] "; + $toMultiplyVar .= "$num[$i] "; + } + } elsif ($numIn!=0) { + $inString .= "$num[$i]^{$numIn} \cdot "; + $toMultiplyString .= "$num[$i] \cdot "; + $outNum2 *= $num[$i]; + $outString2 .= "$num[$i] \cdot "; + if ($i<$numOfNums) { + $inNum *= $num[$i]**$numIn; + $toMultiplyNum *= $num[$i]**$temp; + } else { + $inVar .= "$num[$i]^{$numIn} \cdot "; + $outVar2 .= "$num[$i] "; + $toMultiplyVar .= "$num[$i]^{$temp} "; + } + } + } + +$inString = substr($inString,0,length($inString)-7); +$inVar = substr($inVar,0,length($inVar)-7); +$toMultiplyString = substr($toMultiplyString,0,length($toMultiplyString)-7); +$outString2 = substr($outString2,0,length($outString2)-7); + +$ansDenNum = $outNum*$inNum2; + +$problem = "\frac{1}{\sqrt[3]{$integer}}"; +$ansString0 = "\frac{\sqrt[3]{$toMultiplyNum $toMultiplyVar}}{$ansDenNum $ansDenVar}"; +$ansString1 = "\frac{\sqrt[3]{$inNum $inVar}}{$outNum $outVar}"; +$ansString2 = "\frac{\sqrt[3]{$inNum $inVar}}{$ansDenNum $ansDenVar}"; +$ansString3 = "\frac{\sqrt[3]{$toMultiplyNum $toMultiplyVar}}{$outNum $outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Make sure to rationalize the denominator. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{1}{\sqrt[3]{[$allString]}} \\ + &= \frac{1}{[$outString] \sqrt[3]{[$inString]}} \\ + &= \frac{1 \cdot \sqrt[3]{[$toMultiplyString]}}{[$outNum] [$outVar] \cdot \sqrt[3]{[$inString]} \cdot \sqrt[3]{[$toMultiplyString]}} \\ + &= \frac{\sqrt[3]{[$toMultiplyString]}}{[$outNum] [$outVar] ([$outString2])} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator84.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator84.pg new file mode 100644 index 0000000000..4ddd033a4e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator84.pg @@ -0,0 +1,231 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator with cube root. There are variables. +# +# Last edited: Carl Yao 8/6/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent','rationalize') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$showPartialCorrectAnswers = 1; + +$root = 3; +$numOfNums = 0; + +@num = (2,3,5,7,$var1,$var2); +@power = (); + + do { + $power[0]=0; + $power[1]=0; + $power[2]=0; + $power[3]=0; + $power[4]=list_random(1,2,4,5,7,8,10); + do {$power[5]=list_random(1,2,4,5,7,8,10);} until ($power[4]!=$power[5]); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=$#num;$i++) { + if ($power[$i]>3) {$ok1=1;} + if ($power[$i]%3 !=0) {$ok2=1;} + } + } until ( ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=4;$i<=$#num;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $outString2 = ""; + $inString = ""; + $outNum = 1; + $outNum2 = 1; + $inNum = 1; + $outVar = ""; + $outVar2 = ""; + $inVar = ""; + $ansDenVar = ""; + $toMultiplyString = ""; + $toMultiplyNum = 1; + $toMultiplyVar = ""; + for (my $i=4; $i<=$#num; $i++) { + $numOut = int($power[$i]/$root); + if ($numOut==1) { + $outString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";$ansDenVar .= "$num[$i]^{2} ";} + } elsif ($numOut!=0) { + $outString .= "$num[$i]^{$numOut} \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i]**$numOut;} + else { + $outVar .= "$num[$i]^{$numOut} "; + $temp = $numOut+1; + $ansDenVar .= "$num[$i]^{$temp} "; + } + } else {if ($i>=$numOfNums) {$ansDenVar .= "$num[$i] ";}} + $numIn = $power[$i]%$root; + $temp = $root-$numIn; + if ($numIn==1) { + $inString .= "$num[$i] \cdot "; + $toMultiplyString .= "$num[$i]^{$temp} \cdot "; + $outNum2 *= $num[$i]; + $outString2 .= "$num[$i] \cdot "; + if ($i<$numOfNums) { + $inNum *= $num[$i]; + $toMultiplyNum *= $num[$i]**$temp; + } else { + $inVar .= "$num[$i] "; + $outVar2 .= "$num[$i] "; + $toMultiplyVar .= "$num[$i]^{$temp} "; + } + } elsif ($numIn!=0) { + $inString .= "$num[$i]^{$numIn} \cdot "; + $toMultiplyString .= "$num[$i] \cdot "; + $outNum2 *= $num[$i]; + $outString2 .= "$num[$i] \cdot "; + if ($i<$numOfNums) { + $inNum *= $num[$i]**$numIn; + $toMultiplyNum *= $num[$i]**$temp; + } else { + $inVar .= "$num[$i]^{$numIn} "; + $outVar2 .= "$num[$i] "; + if ($temp==1) { + $toMultiplyVar .= "$num[$i] "; + } else { + $toMultiplyVar .= "$num[$i]^{$temp} "; + } + } + } + } + +$inString = substr($inString,0,length($inString)-7); +$toMultiplyString = substr($toMultiplyString,0,length($toMultiplyString)-7); +$outString2 = substr($outString2,0,length($outString2)-7); + +$ansDenNum = $outNum*$inNum; +$s4 = ($power[4]==1) ? "$var1" : "$var1^{$power[4]}"; +$s5 = ($power[5]==1) ? "$var2" : "$var2^{$power[5]}"; + +$problem = "\frac{1}{\sqrt[3]{$s4 $s5}}"; +$ansString0 = "\frac{\sqrt[3]{$toMultiplyVar}}{$ansDenVar}"; +$ansString1 = "\frac{\sqrt[3]{$inVar}}{$outVar}"; +$ansString2 = "\frac{\sqrt[3]{$inVar}}{$ansDenVar}"; +$ansString3 = "\frac{\sqrt[3]{$toMultiplyVar}}{$outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Make sure to rationalize the denominator. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{1}{[$outString] \sqrt[3]{[$inString]}} \\ + &= \frac{1 \cdot \sqrt[3]{[$toMultiplyString]}}{[$outVar] \cdot \sqrt[3]{[$inString]} \cdot \sqrt[3]{[$toMultiplyString]}} \\ + &= \frac{\sqrt[3]{[$toMultiplyString]}}{[$outVar] ([$outString2])} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator85.pg new file mode 100644 index 0000000000..e6812a95c6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator85.pg @@ -0,0 +1,234 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator with cube root. There are variables. +# +# Last edited: Carl Yao 8/6/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent','rationalize') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$showPartialCorrectAnswers = 1; + +$root = 3; +$numOfNums = 4; + +@num = (2,3,5,7,$var1,$var2); +@power = (); + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,4,1); + $power[2]=random(0,4,1); + $power[3]=random(0,2,1); + $power[4]=list_random(1,2,4,5,7,8,10); + do {$power[5]=list_random(1,2,4,5,7,8,10);} until ($power[4]!=$power[5]); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>3) {$ok1=1;} + if ($power[$i]%3 !=0) {$ok2=1;} + } + } until ( ($integer<=1000) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=$#num;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $outString2 = ""; + $inString = ""; + $outNum = 1; + $outNum2 = 1; + $inNum = 1; + $inNum2 = 1; + $outVar = ""; + $outVar2 = ""; + $inVar = ""; + $ansDenVar = ""; + $toMultiplyString = ""; + $toMultiplyNum = 1; + $toMultiplyVar = ""; + for (my $i=0; $i<=$#num; $i++) { + $numOut = int($power[$i]/$root); + if ($numOut==1) { + $outString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";$ansDenVar .= "$num[$i]^{2} ";} + } elsif ($numOut!=0) { + $outString .= "$num[$i]^{$numOut} \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i]**$numOut;} + else { + $outVar .= "$num[$i]^{$numOut} "; + $temp = $numOut+1; + $ansDenVar .= "$num[$i]^{$temp} "; + } + } else {if ($i>=$numOfNums) {$ansDenVar .= "$num[$i] ";}} + $numIn = $power[$i]%$root; + $temp = $root-$numIn; + if ( ($numIn!=0) && ($i<$numOfNums) ) {$inNum2 *= $num[$i];} + if ($numIn==1) { + $inString .= "$num[$i] \cdot "; + $toMultiplyString .= "$num[$i]^{$temp} \cdot "; + $outNum2 *= $num[$i]; + $outString2 .= "$num[$i] \cdot "; + if ($i<$numOfNums) { + $inNum *= $num[$i]; + $toMultiplyNum *= $num[$i]**$temp; + } else { + $inVar .= "$num[$i] "; + $outVar2 .= "$num[$i] "; + $toMultiplyVar .= "$num[$i]^{$temp} "; + } + } elsif ($numIn!=0) { + $inString .= "$num[$i]^{$numIn} \cdot "; + $toMultiplyString .= "$num[$i] \cdot "; + $outNum2 *= $num[$i]; + $outString2 .= "$num[$i] \cdot "; + if ($i<$numOfNums) { + $inNum *= $num[$i]**$numIn; + $toMultiplyNum *= $num[$i]**$temp; + } else { + $inVar .= "$num[$i]^{$numIn} "; + $outVar2 .= "$num[$i] "; + if ($temp==1) { + $toMultiplyVar .= "$num[$i] "; + } else { + $toMultiplyVar .= "$num[$i]^{$temp} "; + } + } + } + } + +$inString = substr($inString,0,length($inString)-7); +$toMultiplyString = substr($toMultiplyString,0,length($toMultiplyString)-7); +$outString2 = substr($outString2,0,length($outString2)-7); + +$ansDenNum = $outNum*$inNum2; +$s4 = ($power[4]==1) ? "$var1" : "$var1^{$power[4]}"; +$s5 = ($power[5]==1) ? "$var2" : "$var2^{$power[5]}"; + +$problem = "\frac{1}{\sqrt[3]{$integer $s4 $s5}}"; +$ansString0 = "\frac{\sqrt[3]{$toMultiplyNum $toMultiplyVar}}{$ansDenNum $ansDenVar}"; +$ansString1 = "\frac{\sqrt[3]{$inNum $inVar}}{$outNum $outVar}"; +$ansString2 = "\frac{\sqrt[3]{$inNum $inVar}}{$ansDenNum $ansDenVar}"; +$ansString3 = "\frac{\sqrt[3]{$toMultiplyNum $toMultiplyVar}}{$outNum $outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Make sure to rationalize the denominator. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{1}{\sqrt[3]{[$allString]}} \\ + &= \frac{1}{[$outString] \sqrt[3]{[$inString]}} \\ + &= \frac{1 \cdot \sqrt[3]{[$toMultiplyString]}}{[$outNum] [$outVar] \cdot \sqrt[3]{[$inString]} \cdot \sqrt[3]{[$toMultiplyString]}} \\ + &= \frac{\sqrt[3]{[$toMultiplyString]}}{[$outNum] [$outVar] ([$outString2])} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator86.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator86.pg new file mode 100644 index 0000000000..a245a3c7f6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator86.pg @@ -0,0 +1,231 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator with 4th root. No variables. +# +# Last edited: Carl Yao 8/6/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent','rationalize') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +#$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +#do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +#Context()->variables->are($var1=>'Real',$var2=>'Real'); +$showPartialCorrectAnswers = 1; + +$root = 4; +$numOfNums = 4; + +@num = (2,3,5,7); +@power = (); + +do { + + do { + $power[0]=random(0,5,1); + $power[1]=random(0,5,1); + $power[2]=random(0,5,1); + $power[3]=random(0,2,1); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>$root) {$ok1=1;} + if ($power[$i]%$root !=0) {$ok2=1;} + } + } until ( ($integer<=1000) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=$#num;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $outString2 = ""; + $inString = ""; + $outNum = 1; + $outNum2 = 1; + $inNum = 1; + $inNum2 = 1; + $outVar = ""; + $outVar2 = ""; + $inVar = ""; + $ansDenVar = ""; + $toMultiplyString = ""; + $toMultiplyNum = 1; + $toMultiplyVar = ""; + for (my $i=0; $i<=$#num; $i++) { + $numOut = int($power[$i]/$root); + if ($numOut==1) { + $outString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";$ansDenVar .= "$num[$i]^{2} ";} + } elsif ($numOut!=0) { + $outString .= "$num[$i]^{$numOut} \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i]**$numOut;} + else { + $outVar .= "$num[$i]^{$numOut} \cdot "; + $temp = $numOut+1; + $ansDenVar .= "$num[$i]^{$temp} "; + } + } else {if ($i>=$numOfNums) {$ansDenVar .= "$num[$i] ";}} + $numIn = $power[$i]%$root; + $temp = $root-$numIn; + if ( ($numIn!=0) && ($i<$numOfNums) ) {$inNum2 *= $num[$i];} + if ($numIn==1) { + $inString .= "$num[$i] \cdot "; + $toMultiplyString .= "$num[$i]^{$temp} \cdot "; + $outNum2 *= $num[$i]; + $outString2 .= "$num[$i] \cdot "; + if ($i<$numOfNums) { + $inNum *= $num[$i]; + $toMultiplyNum *= $num[$i]**$temp; + } else { + $inVar .= "$num[$i] "; + $outVar2 .= "$num[$i] "; + $toMultiplyVar .= "$num[$i] "; + } + } elsif ($numIn!=0) { + $inString .= "$num[$i]^{$numIn} \cdot "; + $toMultiplyString .= "$num[$i] \cdot "; + $outNum2 *= $num[$i]; + $outString2 .= "$num[$i] \cdot "; + if ($i<$numOfNums) { + $inNum *= $num[$i]**$numIn; + $toMultiplyNum *= $num[$i]**$temp; + } else { + $inVar .= "$num[$i]^{$numIn} \cdot "; + $outVar2 .= "$num[$i] "; + $toMultiplyVar .= "$num[$i]^{$temp} "; + } + } + } + +} until ($toMultiplyNum<1000); + +$inString = substr($inString,0,length($inString)-7); +$inVar = substr($inVar,0,length($inVar)-7); +$toMultiplyString = substr($toMultiplyString,0,length($toMultiplyString)-7); +$outString2 = substr($outString2,0,length($outString2)-7); + +$ansDenNum = $outNum*$inNum2; + +$problem = "\frac{1}{\sqrt[4]{$integer}}"; +$ansString0 = "\frac{\sqrt[4]{$toMultiplyNum $toMultiplyVar}}{$ansDenNum $ansDenVar}"; +$ansString1 = "\frac{\sqrt[4]{$inNum $inVar}}{$outNum $outVar}"; +$ansString2 = "\frac{\sqrt[4]{$inNum $inVar}}{$ansDenNum $ansDenVar}"; +$ansString3 = "\frac{\sqrt[4]{$toMultiplyNum $toMultiplyVar}}{$outNum $outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Make sure to rationalize the denominator. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{1}{\sqrt[4]{[$allString]}} \\ + &= \frac{1}{[$outString] \sqrt[4]{[$inString]}} \\ + &= \frac{1 \cdot \sqrt[4]{[$toMultiplyString]}}{[$outNum] [$outVar] \cdot \sqrt[4]{[$inString]} \cdot \sqrt[4]{[$toMultiplyString]}} \\ + &= \frac{\sqrt[4]{[$toMultiplyString]}}{[$outNum] [$outVar] ([$outString2])} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator87.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator87.pg new file mode 100644 index 0000000000..ff91c0a76b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator87.pg @@ -0,0 +1,235 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator with 4th root. There are variables. +# +# Last edited: Carl Yao 8/6/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent','rationalize') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$showPartialCorrectAnswers = 1; + +do { + + $root = 4; + $numOfNums = 0; + + @num = (2,3,5,7,$var1,$var2); + @power = (); + + do { + $power[0]=0; + $power[1]=0; + $power[2]=0; + $power[3]=0; + $power[4]=list_random(1,2,3,5,6,7,9,10,11); + do {$power[5]=list_random(1,2,3,5,6,7,9,10,11);} until ($power[4]!=$power[5]); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=$#num;$i++) { + if ($power[$i]>4) {$ok1=1;} + if ($power[$i]%4 !=0) {$ok2=1;} + } + } until ( ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=4;$i<=$#num;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $outString2 = ""; + $inString = ""; + $outNum = 1; + $outNum2 = 1; + $inNum = 1; + $outVar = ""; + $outVar2 = ""; + $inVar = ""; + $ansDenVar = ""; + $toMultiplyString = ""; + $toMultiplyNum = 1; + $toMultiplyVar = ""; + for (my $i=4; $i<=$#num; $i++) { + $numOut = int($power[$i]/$root); + if ($numOut==1) { + $outString .= "$num[$i] \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";$ansDenVar .= "$num[$i]^{2} ";} + } elsif ($numOut!=0) { + $outString .= "$num[$i]^{$numOut} \cdot "; + if ($i<$numOfNums) {$outNum *= $num[$i]**$numOut;} + else { + $outVar .= "$num[$i]^{$numOut} "; + $temp = $numOut+1; + $ansDenVar .= "$num[$i]^{$temp} "; + } + } else {if ($i>=$numOfNums) {$ansDenVar .= "$num[$i] ";}} + $numIn = $power[$i]%$root; + $temp = $root-$numIn; + if ($numIn==1) { + $inString .= "$num[$i] \cdot "; + $toMultiplyString .= "$num[$i]^{$temp} \cdot "; + $outNum2 *= $num[$i]; + $outString2 .= "$num[$i] \cdot "; + if ($i<$numOfNums) { + $inNum *= $num[$i]; + $toMultiplyNum *= $num[$i]**$temp; + } else { + $inVar .= "$num[$i] "; + $outVar2 .= "$num[$i] "; + $toMultiplyVar .= "$num[$i]^{$temp} "; + } + } elsif ($numIn!=0) { + $inString .= "$num[$i]^{$numIn} \cdot "; + $outNum2 *= $num[$i]; + $outString2 .= "$num[$i] \cdot "; + if ($i<$numOfNums) { + $inNum *= $num[$i]**$numIn; + $toMultiplyNum *= $num[$i]**$temp; + } else { + $inVar .= "$num[$i]^{$numIn} "; + $outVar2 .= "$num[$i] "; + if ($temp==1) { + $toMultiplyVar .= "$num[$i] "; + $toMultiplyString .= "$num[$i] \cdot "; + } else { + $toMultiplyVar .= "$num[$i]^{$temp} "; + $toMultiplyString .= "$num[$i]^{$temp} \cdot "; + } + } + } + } +} until ($toMultiplyVar ne $inVar); + +$inString = substr($inString,0,length($inString)-7); +$toMultiplyString = substr($toMultiplyString,0,length($toMultiplyString)-7); +$outString2 = substr($outString2,0,length($outString2)-7); + +$ansDenNum = $outNum*$inNum; +$s4 = ($power[4]==1) ? "$var1" : "$var1^{$power[4]}"; +$s5 = ($power[5]==1) ? "$var2" : "$var2^{$power[5]}"; + +$problem = "\frac{1}{\sqrt[4]{$s4 $s5}}"; +$ansString0 = "\frac{\sqrt[4]{$toMultiplyVar}}{$ansDenVar}"; +$ansString1 = "\frac{\sqrt[4]{$inVar}}{$outVar}"; +$ansString2 = "\frac{\sqrt[4]{$inVar}}{$ansDenVar}"; +$ansString3 = "\frac{\sqrt[4]{$toMultiplyVar}}{$outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Make sure to rationalize the denominator. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{1}{[$outString] \sqrt[4]{[$inString]}} \\ + &= \frac{1 \cdot \sqrt[4]{[$toMultiplyString]}}{[$outVar] \cdot \sqrt[4]{[$inString]} \cdot \sqrt[4]{[$toMultiplyString]}} \\ + &= \frac{\sqrt[4]{[$toMultiplyString]}}{[$outVar] ([$outString2])} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg new file mode 100644 index 0000000000..590b60ffa9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rationalize denominator. Problem is given as a fraction. +# Denominator is a square number. +# +# Last edited: Jordan 9/8/13; Carl Yao 8/31/13, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root','rationalize','denominator') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$denAns = random(2,10,1); +$den = $denAns**2; +do {$num = list_random(2,3,5,6,7,10,11,13,14,15);} until (gcd($num,$denAns)==1); + +Context("LimitedRadical"); +$ans = Formula("sqrt($num)/$denAns"); + +Context()->{error}{msg}{"You must simplify your answer further"} + = "Either your answer is not fully simplified or it has an irrational denominator"; + + +##################################################### + +BEGIN_PGML + +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` \sqrt{\frac{[$num]}{[$den]}} = ``] [_____________]{$ans} + +END_PGML + +############################################################ + + +BEGIN_PGML_SOLUTION + +We need to use this property for this problem: + + [`` \sqrt{\frac{a}{b}} = \frac{\sqrt{a}}{\sqrt{b}} ``] + +Thus we have: + + [`` +\begin{aligned} + \sqrt{\frac{[$num]}{[$den]}} + &= \frac{\sqrt{[$num]}}{\sqrt{[$den]}} \\ + &= \frac{\sqrt{[$num]}}{[$denAns]} +\end{aligned} + ``] + +Since no radicals are left in the denominator, there is no need to further simplify this expression. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg index a0d849c196..70b7f97ce9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(rewrite_a_radical) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -27,7 +29,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -149,9 +152,9 @@ sub line2 { BEGIN_PGML -Simplify the radical [` [$sqrt1] `]. If it cannot be simplified, simply type its value as the answer. +Simplify the radical expression or state that it is [|not a real number|]*. [@KeyboardInstructions('If it cannot be simplified, simply type its value as the answer.')@]** -Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` [$sqrt1] = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg index fb8971f813..8ee88e0fbe 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(rewrite_a_radical) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -28,7 +29,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -149,9 +151,9 @@ sub line2 { BEGIN_PGML -Simplify the radical [` [$sqrt1] `]. If it cannot be simplified, simply type its value as the answer. +Simplify the radical expression or state that it is [|not a real number|]*. [@KeyboardInstructions('If it cannot be simplified, simply type its value as the answer.')@]** -Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` [$sqrt1] = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04new.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04new.pg new file mode 100644 index 0000000000..0bc73dc64e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04new.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify a square radical with only numbers inside. +# +# Last edited: Carl Yao 12/7/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$showPartialCorrectAnswers = 1; + +$var = "x"; + +@num = (2,3,5,7); +@power = (); +@numOut=(); +@numIn=(); + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,3,1); + $power[2]=random(0,3,1); + $power[3]=random(0,2,1); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>=2) {$ok1=1;} + if ($power[$i]%2 !=0) {$ok2=1;} + } + } until ( ($integer<=100) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<4) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<4) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outNumC = 0; + $inNumC = 0; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=3; $i++) { + $numOut[$i] = int($power[$i]/2); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + $outNumC++; + if ($i<4) {$outNum *= $num[$i];} + else {$outVar .= "$var";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + $outNumC += $numOut[$i]; + if ($i<4) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$var^{$numOut[$i]}";} + } + $numIn[$i] = $power[$i]%2; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + $inNumC++; + if ($i<4) {$inNum *= $num[$i];} + else {$inVar .= "$var";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + $inNumC += $numIn[$i]; + if ($i<4) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$var^{$numIn[$i]}";} + } + } + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt{$integer}"; + +Context("LimitedRadical"); +$ans = Formula("$outNum*sqrt($inNum)"); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. + +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` [$problem] =``] [_______________]{$ans} + +END_PGML + +############################################## + +$s1 = ""; +if ( ($outNumC>1) || ($inNumC>1) ) { + $s1 = "&=".$ans->TeX; +} + +BEGIN_PGML_SOLUTION + +First, we use a prime factor tree to do: + + [`` [$integer] = [$numString] ``] + +Next, we use [` \sqrt{x^2}=x `] to simplify the expression. The full solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt{[$allString]} \\ + &= [$outString] \sqrt{[$inString]} \\ + [$s1] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg index d764492235..3291ec9d19 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(rewrite_a_radical) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); @@ -27,7 +29,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ###################################### @@ -148,9 +151,9 @@ sub line2 { BEGIN_PGML -Simplify the radical [` [$sqrt1] `]. If it cannot be simplified, simply type its value as the answer. +Simplify the radical expression or state that it is [|not a real number|]*. [@KeyboardInstructions('If it cannot be simplified, simply type its value as the answer.')@]** -Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [`` [$sqrt1] = ``] [_____________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06new.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06new.pg new file mode 100644 index 0000000000..930e8df57d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06new.pg @@ -0,0 +1,159 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify a square radical with only numbers inside. +# +# Last edited: Carl Yao 12/7/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$showPartialCorrectAnswers = 1; + +$var = "x"; + +@num = (2,3,5,7); +@power = (); +@numOut=(); +@numIn=(); + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,3,1); + $power[2]=random(0,3,1); + $power[3]=random(0,2,1); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>=2) {$ok1=1;} + if ($power[$i]%2 !=0) {$ok2=1;} + } + } until ( ($integer<=500) && ($integer>=100) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<4) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<4) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outNumC = 0; + $inNumC = 0; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=3; $i++) { + $numOut[$i] = int($power[$i]/2); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + $outNumC++; + if ($i<4) {$outNum *= $num[$i];} + else {$outVar .= "$var";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + $outNumC += $numOut[$i]; + if ($i<4) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$var^{$numOut[$i]}";} + } + $numIn[$i] = $power[$i]%2; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + $inNumC++; + if ($i<4) {$inNum *= $num[$i];} + else {$inVar .= "$var";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + $inNumC += $numIn[$i]; + if ($i<4) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$var^{$numIn[$i]}";} + } + } + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt{$integer}"; +Context("LimitedRadical"); +$ans = Formula("$outNum*sqrt($inNum)"); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. + +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` [$problem] =``] [_____________]{$ans} + +END_PGML + +############################################## + +$s1 = ""; +if ( ($outNumC>1) || ($inNumC>1) ) { + $s1 = "&=".$ans->TeX; +} + +BEGIN_PGML_SOLUTION + +First, we use a prime factor tree to do: + + [`` [$integer] = [$numString] ``] + +Next, we use [` \sqrt{x^2}=x `] to simplify the expression. The full solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt{[$allString]} \\ + &= [$outString] \sqrt{[$inString]} \\ + [$s1] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals07.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals07.pg new file mode 100644 index 0000000000..7b6448898a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals07.pg @@ -0,0 +1,157 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplifya cubic radical with only numbers inside. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$showPartialCorrectAnswers = 1; + +$var = "x"; + +@num = (2,3,5,7); +@power = (); +@numOut=(); +@numIn=(); + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,3,1); + $power[2]=random(0,3,1); + $power[3]=random(0,2,1); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>2) {$ok1=1;} + if ($power[$i]%3 !=0) {$ok2=1;} + } + } until ( ($integer<=500) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<4) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<4) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outNumC = 0; + $inNumC = 0; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=3; $i++) { + $numOut[$i] = int($power[$i]/3); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + $outNumC++; + if ($i<4) {$outNum *= $num[$i];} + else {$outVar .= "$var";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + $outNumC += $numOut[$i]; + if ($i<4) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$var^{$numOut[$i]}";} + } + $numIn[$i] = $power[$i]%3; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + $inNumC++; + if ($i<4) {$inNum *= $num[$i];} + else {$inVar .= "$var";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + $inNumC += $numIn[$i]; + if ($i<4) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$var^{$numIn[$i]}";} + } + } + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt[3]{$integer}"; +$ans1 = Compute("$outNum"); +$ans2 = Compute("$inNum"); +$ansString = "$outNum \cdot \sqrt[3]{$inNum}"; + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. + + [`` [$problem] =``] [_]{$ans1}[``\cdot \sqrt[3]{(}``] [_]{$ans2} [``)``] + +END_PGML + +############################################## + +$s1 = ""; +if ( ($outNumC>1) || ($inNumC>1) ) { + $s1 = "&=$ansString"; +} + +BEGIN_PGML_SOLUTION + +First, we use a prime factor tree to do: + + [`` [$integer] = [$numString] ``] + +Next, we use [` \sqrt[3]{x^3}=x `] to simplify the expression. The full solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[3]{[$allString]} \\ + &= [$outString] \sqrt[3]{[$inString]} \\ + [$s1] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals09.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals09.pg new file mode 100644 index 0000000000..c7db953516 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals09.pg @@ -0,0 +1,157 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify 4th-root radical with only numbers inside. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$showPartialCorrectAnswers = 1; + +$var = "x"; + +@num = (2,3,5,7); +@power = (); +@numOut=(); +@numIn=(); + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,4,1); + $power[2]=random(0,4,1); + $power[3]=random(0,2,1); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>3) {$ok1=1;} + if ($power[$i]%4 !=0) {$ok2=1;} + } + } until ( ($integer<=500) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<4) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<4) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outNumC = 0; + $inNumC = 0; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=3; $i++) { + $numOut[$i] = int($power[$i]/4); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + $outNumC++; + if ($i<4) {$outNum *= $num[$i];} + else {$outVar .= "$var";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + $outNumC += $numOut[$i]; + if ($i<4) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$var^{$numOut[$i]}";} + } + $numIn[$i] = $power[$i]%4; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + $inNumC++; + if ($i<4) {$inNum *= $num[$i];} + else {$inVar .= "$var";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + $inNumC += $numIn[$i]; + if ($i<4) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$var^{$numIn[$i]}";} + } + } + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt[4]{$integer}"; +$ans1 = Compute("$outNum"); +$ans2 = Compute("$inNum"); +$ansString = "$outNum \cdot \sqrt[4]{$inNum}"; + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. + + [`` [$problem] =``] [_]{$ans1}[``\cdot \sqrt[4]{(}``] [_]{$ans2} [``)``] + +END_PGML + +############################################## + +$s1 = ""; +if ( ($outNumC>1) || ($inNumC>1) ) { + $s1 = "&=$ansString"; +} + +BEGIN_PGML_SOLUTION + +First, we use a prime factor tree to do: + + [`` [$integer] = [$numString] ``] + +Next, we use [` \sqrt[4]{x^4}=x `] to simplify the expression. The full solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[4]{[$allString]} \\ + &= [$outString] \sqrt[4]{[$inString]} \\ + [$s1] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg index 45f14d708f..264565a204 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg @@ -8,15 +8,18 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Properties of exponents, rational exponents and radicals) -## DBsection(Properties of rational exponents and radicals) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -26,11 +29,12 @@ DOCUMENT(); # for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -60,7 +64,7 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Simplify the expression. Use *sqrt()* for the square root symbol. For example: [`\sqrt{2} =`] *sqrt(2)*. +Simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [``[$sqrt1] + [$sqrt2] =``] [_____________]{$answer} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals100.pg new file mode 100644 index 0000000000..c887c26f2a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals100.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Jeremy Shaw +# Portland Community College +# +# Simplify sqrt(a)*(sqrt(b)+sqrt(c)) +# +# Last edited: Kling 8/17/13; Jordan 8/2/13; Carl Yao, 7/21/13 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("Numeric"); + +$radicand1 = list_random(2,7); +$radicand2 = list_random(3,11,19); +$radicand3 = list_random(5,13,17); + +Context("LimitedRadical"); + +$sqrt1 = Formula("sqrt($radicand1)"); +$sqrt2 = Formula("sqrt($radicand2)"); +$sqrt3 = Formula("sqrt($radicand3)"); + +$ans_radicand1 = $radicand1 * $radicand2; +$ans_radicand2 = $radicand1 * $radicand3; +$answer = Formula("sqrt([$ans_radicand1]) + sqrt([$ans_radicand2])"); + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +# Best practices always include this command here. It is responsible for +# the gray box around the problem, problem enumeration, and the path to the +# source .pg file. + +#Current best practice is to use the PGML environment to write the body. +BEGIN_PGML + +Expand and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [``[$sqrt1] \left([$sqrt2] + [$sqrt3]\right) =``] [__________]{$answer} + +END_PGML + +########Begin more complicated answer processing (if needed)############ + +#Not needed in this template. + +########Begin answer hints.############ + +#Not used in this template. For the PCC coding projects, I think that this +#feature will rarely be used the first go-around. + +########Begin solution.############ + +#The walk-through solution is presented to students after the due date, and +#may soon also be used with a "show me how to do this" button that gives a +#walk-through for a similar but randomly generated problem. + +BEGIN_PGML_SOLUTION + +Use the distributive property and simplify. + + [`` +\begin{aligned}[t] + [$sqrt1] \left([$sqrt2] + [$sqrt3]\right) + &= [$sqrt1] \cdot [$sqrt2] + [$sqrt1] \cdot [$sqrt3] \\ + &= [$answer] +\end{aligned} + ``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg index 30d3bdf8ec..eb7a9073a9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg @@ -8,15 +8,17 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Radical_FOIL2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -26,11 +28,12 @@ DOCUMENT(); # for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -66,9 +69,9 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Expand and simplify the expression. Use *sqrt()* for the square root symbol (Example: [`\sqrt{2} =`] *sqrt(2)*.) +Expand and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** - [``([$num1] + [$sqrt])([$num2] + [$sqrt]) =``] [__________]{$answer} + [``\left([$num1] + [$sqrt]\right)\left([$num2] + [$sqrt]\right) =``] [__________]{$answer} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals13.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals13.pg new file mode 100644 index 0000000000..ae7dd05341 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals13.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals like 2+4sqrt(x) and 2*4sqrt(x) +# +# Last edited: Carl Yao 8/10/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +$a = Real(random(2,10,1)); +$b = Real(random(2,10,1)); +$aPlusB = $a+$b; +$ab = $a*$b; + +$ans1 = Compute("$a+$b*sqrt($var)"); +$ans2 = Compute("$ab*sqrt($var)"); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expressions. + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* Assume all variables are positive. + +a. [``[$a] + [$b] \sqrt{[$var]} =``][__________]{$ans1} + +b. [``[$a] \cdot [$b] \sqrt{[$var]} =``][_________]{$ans2} + +END_PGML + + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + +a. Since [`[$a]`] and [`[$b] \sqrt{[$var]} `] are not like terms, we cannot combine them. The answer is simply [` [$a] + [$b] \sqrt{[$var]} `]. + +b. [` [$a] \cdot [$b] \sqrt{[$var]} = [$ab] \sqrt{[$var]} `] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg index 204d5b318c..b0b4589e29 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg @@ -8,16 +8,17 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Radical_FOIL2) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','FOIL') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -27,11 +28,12 @@ DOCUMENT(); # for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -68,9 +70,9 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Expand and simplify the expression. Use *sqrt()* for the square root symbol (Example: [`\sqrt{2} =`] *sqrt(2)*.) +Expand and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** - [``([$num1] - [$sqrt])([$num2] - [$coeff1] [$sqrt]) =``] [__________]{$answer} + [``\left([$num1] - [$sqrt]\right)\left([$num2] - [$coeff1] [$sqrt]\right) =``] [__________]{$answer} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals137.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals137.pg new file mode 100644 index 0000000000..02a44b1970 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals137.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Jeremy Shaw +# Portland Community College +# +# Use FOIL to simplify (a-b*sqrt(c))^2 +# +# Last edited: Yao 1/3/2017 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','FOIL') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("LimitedRadical"); + +$a = random(1,9,1); +$b = list_random(2,3,5,6,7); +$problem = "\left($a+\sqrt{$b}\right)^2"; +$a2 = $a**2; +$co = 2*$a; +$num = $a2+$b; + +$ans = Formula("$num+$co*sqrt($b)"); + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +BEGIN_PGML + +Expand and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` [$problem] =``] [__________]{$ans} + +END_PGML + +########Begin solution.############ + + +$s1 = $num1**2; +$s2 = 2*$num1*$num2; +$s3 = $num2**2*$radicand; +$s4 = $num2**2; + +BEGIN_PGML_SOLUTION + +To square the radical expression, use the FOIL method: + + [`` +\begin{aligned}[t] + [$problem] + &= ([$a]+\sqrt{[$b]})([$a]+\sqrt{[$b]}) \\ + &= [$a]\cdot[$a] + [$a]\sqrt{[$b]} + [$a]\sqrt{[$b]} + \sqrt{[$b]}\cdot\sqrt{[$b]} \\ + &= [$a2] + [$a*2]\sqrt{[$b]} + [$b] \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals138.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals138.pg new file mode 100644 index 0000000000..9666e18dc8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals138.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Jeremy Shaw +# Portland Community College +# +# Use FOIL to simplify (a-b*sqrt(c))^2 +# +# Last edited: Yao 1/3/2017 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','FOIL') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("LimitedRadical"); + +$a = random(1,9,1); +$b = list_random(2,3,5,6,7); +$problem = "\left(\sqrt{$b}-$a\right)^2"; +$a2 = $a**2; +$co = 2*$a; +$num = $a2+$b; + +$ans = Formula("$num-$co*sqrt($b)"); + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +BEGIN_PGML + +Expand and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` [$problem] =``] [__________]{$ans} + +END_PGML + +########Begin solution.############ + + +$s1 = $num1**2; +$s2 = 2*$num1*$num2; +$s3 = $num2**2*$radicand; +$s4 = $num2**2; + +BEGIN_PGML_SOLUTION + +To square the radical expression, use the FOIL method: + + [`` +\begin{aligned}[t] + [$problem] + &= (\sqrt{[$b]}-[$a])(\sqrt{[$b]}-[$a]) \\ + &= \sqrt{[$b]}\cdot\sqrt{[$b]} - [$a]\sqrt{[$b]} - [$a]\sqrt{[$b]} + (-[$a])(-[$a]) \\ + &= [$b] - [$a*2]\sqrt{[$b]} + [$a2] \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals139.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals139.pg new file mode 100644 index 0000000000..2d34a859e6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals139.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Jeremy Shaw +# Portland Community College +# +# Use FOIL to simplify (a-b*sqrt(c))^2 +# +# Last edited: Yao 1/3/2017 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','FOIL') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("LimitedRadical"); + +$out = list_random(2,3,5,7); +do {$in = list_random(2,3,5,7);} until ($out!=$in); + +$a = $out*$in; +$b = $out; +$pm = (random(1,2,1)==1) ? "+" : "-"; +$problem = "\left(\sqrt{$a} $pm \sqrt{$b}\right)^2"; +$ab = $a*$b; +$num = $a+$b; +$out2 = 2*$out; + +$ans = Formula("$num $pm $out2*sqrt($in)"); + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +BEGIN_PGML + +Expand and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` [$problem] =``] [__________]{$ans} + +END_PGML + +########Begin solution.############ + +$s1 = ($pm eq "+") ? "\sqrt{$b}\cdot\sqrt{$b}" : "(-\sqrt{$b})(-\sqrt{$b})"; +$primeList = ($in>$out) ? "$out^2\cdot$in" : "$in\cdot$out^2"; + +BEGIN_PGML_SOLUTION + +To square the radical expression, use the FOIL method: + + [`` +\begin{aligned}[t] + [$problem] + &= (\sqrt{[$a]}[$pm]\sqrt{[$b]})(\sqrt{[$a]}[$pm]\sqrt{[$b]}) \\ + &= \sqrt{[$a]}\cdot\sqrt{[$a]} [$pm] \sqrt{[$a]}\cdot\sqrt{[$b]} [$pm] \sqrt{[$a]}\cdot\sqrt{[$b]} + [$s1] \\ + &= [$a] [$pm] \sqrt{[$a]\cdot[$b]} [$pm] \sqrt{[$a]\cdot[$b]} +[$b]\\ + &= [$a+$b] [$pm] 2\sqrt{[$a]\cdot[$b]} \\ + &= [$a+$b] [$pm] 2\sqrt{[$primeList]} \\ + &= [$a+$b] [$pm] 2\cdot [$out] \cdot\sqrt{[$in]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals14.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals14.pg new file mode 100644 index 0000000000..50922749bb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals14.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals like sqrt(x)+4sqrt(x) and sqrt(x)*4sqrt(x) +# +# Last edited: Carl Yao 8/10/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +$a = Real(random(2,10,1)); +$b = $a+1; + +$ans1 = Compute("$b*sqrt($var)"); +$ans2 = Compute("$a*$var"); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expressions. + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* Assume all variables are positive. + +a. [``\sqrt{[$var]} + [$a] \sqrt{[$var]} =``][__________]{$ans1} + +b. [``\sqrt{[$var]} \cdot [$a] \sqrt{[$var]} =``][_________]{$ans2} + +END_PGML + + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + +a. [` \sqrt{[$var]} + [$a] \sqrt{[$var]} = [$b] \sqrt{[$var]} `] + +b. [` \sqrt{[$var]} \cdot [$a] \sqrt{[$var]} = [$a] \sqrt{[$var]^2} = [$a][$var] `] + +Note that in Part b, the absolute value symbols are not needed. The problem's body has [`\sqrt{[$var]}`], which implies [`[$var]`] is already positive. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg index 787e120eda..1e2efaf580 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg @@ -8,15 +8,17 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Radical_FOIL2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','FOIL') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -26,11 +28,12 @@ DOCUMENT(); # for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -66,7 +69,7 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Expand and simplify the expression. Use *sqrt()* for the square root symbol (Example: [`\sqrt{2} =`] *sqrt(2)*.) +Expand and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [``\left([$num1] - [$num2] [$sqrt]\right)^2 =``] [__________]{$answer} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals15.pg new file mode 100644 index 0000000000..886c72a9bd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals15.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals like a*sqrt(x)+b*sqrt[3](x). +# +# Last edited: Carl Yao 8/2/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +$a = Real(random(2,20,1)); +$b = Real(random(2,20,1)); +$radicand = list_random(2,3,5,6,7,11,13,15,17,19); +$ab = Real($a + $b); + +$sqrt1 = "$a \cdot \sqrt{$radicand}"; +$sqrt2 = "$b \cdot \sqrt[3]{$radicand}"; + +$ansString0 = $sqrt1." + ".$sqrt2; +$ansString1 = "$ab \cdot \sqrt{$radicand}"; +$ansString2 = "$ab \cdot \sqrt[3]{$radicand}"; +$ansString3 = "$ab \cdot \sqrt[4]{$radicand}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. + + [``[$sqrt1] + [$sqrt2] =``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + +Since [`\sqrt{[$radicand]}`] and [`\sqrt[3]{[$radicand]}`] are not like terms, we cannot combine those two terms. + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals150.pg new file mode 100644 index 0000000000..bf8ae0cafe --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals150.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# sqrt(x^2) and root(3,x^3) +# +# +# Last updated: Yao 07/23/2013 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +$showPartialCorrectAnswers = 1; + +$odd = random(3,9,2); +$even = random(2,8,2); + +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyNonNegativeIntegers(); + +$ans1 = Formula("$var"); +$ans2 = Formula("|$var|"); + +$eva1 = $ans1->cmp()->withPostFilter(AnswerHints( + Formula("|$var|") => "Are absolute value symbols needed here?", +)); + +$eva2 = $ans2->cmp()->withPostFilter(AnswerHints( + Formula("$var") => "Almost correct, with absolute value symbols missing.", +)); + +$evenT = $even==2 ? "" : "$even"; + + +############################################## + + +BEGIN_PGML + +Simplify the following expressions. Do not assume the variables take only positive values. +* To enter [`x^y`], type *x^y*. +* To enter [`|x|`], type *|x|* or *abs(x)*. +* If a value is not defined as a real number or function, type [|DNE|]* for "does not exist". + +1) [`` \sqrt[[$odd]]{[$var]^[$odd]} = ``][________]{$eva1} + +2) [`` \sqrt[[$evenT]]{[$var]^[$even]} = ``][________]{$eva2} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +Compare the following: + +* [`` \sqrt{(-2)^2}=\sqrt{4}=2 ``], thus [`` \sqrt{x^2} = x ``] is *not* always true. +* [`` \sqrt[3]{(-2)^3}=\sqrt[3]{-8}=-2 ``], thus [`` \sqrt[3]{x^3} = x ``] is always true. + +In general, + +* [`` \sqrt[n]{x^{n}} = x ``] is always true if [`n`] is an odd number. +* [`` \sqrt[n]{x^{n}} = x ``] is *not* always true if [`n`] is an even number. + +This is why we say: + +* [`` \sqrt[n]{x^{n}} = |x| ``] is always true if [`n`] is an even number. + +For those two problems, the solutions are: + +* [`` \sqrt[[$odd]]{[$var]^[$odd]} = [$var] ``] +* [`` \sqrt[[$evenT]]{[$var]^[$even]} = |[$var]| ``] + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals160.pg new file mode 100644 index 0000000000..fa605f8ed7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals160.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# Simplify the expression. +# +# sqrt(x^2+2x+1) +# +# +# Last updated: Yao 07/23/2013 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +$showPartialCorrectAnswers = 1; + +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyNonNegativeIntegers(); + +do { + $a = random(1,3,1); + $b = non_zero_random(-3,3,1); +} until (abs($a)!=abs($b)); + +$a2 = $a**2; +$b2 = ($b)**2; +$c = 2*$a*$b; +$pol = Compute("$a2*$var**2+$c*$var+$b2")->reduce; + +$ans = Formula("|$a*$var+$b|")->reduce; + +$eva = $ans->cmp()->withPostFilter(AnswerHints( + Formula("$a*$var+$b") => "Almost correct, with absolute value symbols missing.", +)); + +############################################## + + +BEGIN_PGML + +Simplify the following expressions. Do not assume the variables take only positive values. +* To enter [`x^y`], type *x^y*. +* To enter [`|x|`], type *|x|* or *abs(x)*. +* If a value is not defined as a real number or function, type [|DNE|]* for "does not exist". + + [`` \sqrt{[$pol]} = ``][________]{$eva} + +END_PGML + + +############################################## + +$s1 = Compute("$a*$var+$b")->reduce; + +BEGIN_PGML_SOLUTION + + [`` \sqrt{[$pol]} = \sqrt{([$s1])^2} = |[$s1]| ``] + +Note that absolute value symbols are needed in case [`[$s1]<0`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals170.pg new file mode 100644 index 0000000000..dd223a9ad6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals170.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# Simplify the expression. +# +# root(3,8(x+1)^3) +# +# +# Last updated: Yao 07/23/2013 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +$showPartialCorrectAnswers = 1; + +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyNonNegativeIntegers(); + +$a = random(2,5,1); +$b = non_zero_random(-5,5,1); +$a3 = $a**3; +$pol = Compute("$a3*($var+$b)**3")->reduce; + +$ans = Formula("$a*($var+$b)")->reduce; + +$eva = $ans->cmp()->withPostFilter(AnswerHints( + Formula("|$a*($var+$b)|") => "Are absolute value symbols necessary?", +)); + +############################################## + + +BEGIN_PGML + +Simplify the following expressions. Do not assume the variables take only positive values. +* To enter [`x^y`], type *x^y*. +* To enter [`|x|`], type *|x|* or *abs(x)*. +* If a value is not defined as a real number or function, type [|DNE|]* for "does not exist". + + [`` \sqrt[3]{[$pol]} = ``][________]{$eva} + +END_PGML + + +############################################## + +$s1 = Compute("$var+$b")->reduce; + +BEGIN_PGML_SOLUTION + + [`` \sqrt[3]{[$pol]} = \sqrt[3]{[$a]^3([$s1])} = [$ans] ``] + +Note that absolute value symbols are not needed because it's the third root. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals180.pg new file mode 100644 index 0000000000..c024f2e1fa --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals180.pg @@ -0,0 +1,148 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with variables. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +$showPartialCorrectAnswers = 1; + +$a = list_random(2,3,5); +if ($a==2) {$b=random(2,6,1);} +if ($a==3) {$b=random(2,4,1);} +if ($a==5) {$b=random(2,3,1);} +$num = $a**$b; + +$c = ($b%2==0) ? random(3,9,2) : random(4,8,2); + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + +$bHalf = int($b/2); +$cHalf = int($c/2); +$aOut = $a**$bHalf; +if ( ($b%2==0) && ($c%2==1) ) { + $choices[$scramble{0}] = ($cHalf==1) ? "$aOut $var \cdot \sqrt{$var}" : "$aOut $var^{$cHalf} \cdot \sqrt{$var}"; + $choices[$scramble{1}] = ($cHalf==1) ? "$a $var \cdot \sqrt{$var}" : "$num $var^{$cHalf} \cdot \sqrt{$var}"; + $choices[$scramble{2}] = ($cHalf==1) ? "$aOut \cdot \sqrt{$var^{$c}}" : "$aOut \cdot \sqrt{$var^{$c}}"; + $choices[$scramble{3}] = ($cHalf==1) ? "$aOut $var" : "$aOut $var^{$cHalf}"; +} else { + $choices[$scramble{0}] = ($cHalf==1) ? "$aOut $var \cdot \sqrt{$a}" : "$aOut $var^{$cHalf} \cdot \sqrt{$a}"; + $choices[$scramble{1}] = ($cHalf==1) ? "$aOut $var \cdot \sqrt{$var}" : "$aOut $var^{$cHalf} \cdot \sqrt{$var}"; + $choices[$scramble{2}] = "$aOut $var^{$c} \cdot \sqrt{$a}"; + $choices[$scramble{3}] = ($cHalf==1) ? "$aOut $var" : "$aOut $var^{$cHalf}"; +} + $ans = $choices[$scramble{0}]; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [` \sqrt{[$num][$var]^{[$c]}} `]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + + + +BEGIN_PGML_SOLUTION + +We use this rule to simplify radicals: + + [`` \sqrt[n]{x^{n}} = x ``] + +For square root, we have: + + [`` \sqrt{x^2} = x ``] + +In other words, for each pair of a variable inside the square root, we can pull it out. + +For this problem, we have: + + [`` +\begin{aligned}[t] + &\phantom{{}=}\sqrt{[$num][$var]^{[$c]}} \\ + &= \sqrt{[$a]^{[$b]}[$var]^{[$c]}} \\ + &= [$ans] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals185.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals185.pg new file mode 100644 index 0000000000..c621054528 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals185.pg @@ -0,0 +1,193 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with variables. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +$showPartialCorrectAnswers = 1; + +@num = (2,3,5,7,$var); +@power = (); +@numOut=(); +@numIn=(); + +do { + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,3,1); + $power[2]=random(0,3,1); + $power[3]=random(0,2,1); + do {$power[4]=random(2,9,1);} until ($power[4]!=3); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>1) {$ok1=1;} + if ($power[$i]%2==1) {$ok2=1;} + } + } until ( ($integer<=500) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=4;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i!=4) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i!=4) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=4; $i++) { + $numOut[$i] = int($power[$i]/2); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + if ($i!=4) {$outNum *= $num[$i];} + else {$outVar .= "$var";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + if ($i!=4) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$var^{$numOut[$i]}";} + } + $numIn[$i] = $power[$i]%2; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + if ($i!=4) {$inNum *= $num[$i];} + else {$inVar .= "$var";} + } + } + +} until ($inNum != $outNum); + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt{$integer $var^{$power[4]}}"; +$ansString0 = "$outNum $outVar"." \cdot \sqrt{$inNum $inVar}"; +$ansString1 = "$inNum"."$outVar"." \cdot \sqrt{$outNum $inVar}"; +$ansString2 = "$outNum"."$inVar"." \cdot \sqrt{$inNum $outVar}"; +$ansString3 = "$inNum"."$inVar"." \cdot \sqrt{$outNum $outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +First, we use a prime factor tree to do: + + [`` [$integer] = [$numString] ``] + +Next, we use [` \sqrt{x^2}=x `] to simplify the expression. The full solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt{[$allString]} \\ + &= [$outString] \sqrt{[$inString]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals190.pg new file mode 100644 index 0000000000..edaa184560 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals190.pg @@ -0,0 +1,199 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with variables. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$showPartialCorrectAnswers = 1; + +@num = (2,3,5,7,$var1,$var2); +@power = (); +@numOut=(); +@numIn=(); + +do { + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,3,1); + $power[2]=random(0,3,1); + $power[3]=random(0,2,1); + $power[4]=random(2,10,1); + $power[5]=random(2,10,1); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>1) {$ok1=1;} + if ($power[$i]%2 !=0) {$ok2=1;} + } + } until ( ($integer<=500) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=5;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<4) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<4) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=5; $i++) { + $numOut[$i] = int($power[$i]/2); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + if ($i<4) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + if ($i<4) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$num[$i]^{$numOut[$i]} ";} + } + $numIn[$i] = $power[$i]%2; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + if ($i<4) {$inNum *= $num[$i];} + else {$inVar .= "$num[$i] ";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + if ($i<4) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$num[$i]^{$numIn[$i]} ";} + } + } + +} until ( ($inNum != $outNum) && ($inVar ne $outVar) ); + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt{$integer $var1^{$power[4]} $var2^{$power[5]}}"; +$ansString0 = "$outNum $outVar"." \cdot \sqrt{$inNum $inVar}"; +$ansString1 = "$inNum"."$outVar"." \cdot \sqrt{$outNum $inVar}"; +$ansString2 = "$outNum"."$inVar"." \cdot \sqrt{$inNum $outVar}"; +$ansString3 = "$inNum"."$inVar"." \cdot \sqrt{$outNum $outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +First, we use a prime factor tree to do: + + [`` [$integer] = [$numString] ``] + +Next, we use [` \sqrt{x^2}=x `] to simplify the expression. The full solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt{[$allString]} \\ + &= [$outString] \sqrt{[$inString]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg new file mode 100644 index 0000000000..5eb1682d00 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Jeremy Shaw +# Portland Community College +# +# Simplify radicals like a*sqrt(x)-b*sqrt(x). +# +# Last edited: Jordan 8/1/13; Carl Yao 7/21/13 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("Numeric"); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +$a = random(10,20,1); +$b=$a+1; #$b = random(10,20,1); +$c = list_random(2,3,5,6,7,10,11,13,14,15); +$d = $a - $b; + +Context("LimitedRadical"); + +$sqrt1 = Formula("$a * sqrt($c)"); +$sqrt2 = Formula("$b * sqrt($c)"); + +if (abs($d) != 1) + {$answer = Formula("$d * sqrt($c)");} + elsif ($d == 1) + {$answer = Formula("sqrt($c)");} + else {$answer = Formula("-sqrt($c)");} + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +# Best practices always include this command here. It is responsible for +# the gray box around the problem, problem enumeration, and the path to the +# source .pg file. + +#Current best practice is to use the PGML environment to write the body. +BEGIN_PGML + +Simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [``[$sqrt1] - [$sqrt2] =``] [_____________]{$answer} + + +END_PGML + +########Begin more complicated answer processing (if needed)############ + +#Not needed in this template. + +########Begin answer hints.############ + +#Not used in this template. For the PCC coding projects, I think that this +#feature will rarely be used the first go-around. + +########Begin solution.############ + +#The walk-through solution is presented to students after the due date, and +#may soon also be used with a "show me how to do this" button that gives a +#walk-through for a similar but randomly generated problem. + +BEGIN_PGML_SOLUTION + +Since these are like radicals, we can combine them as like terms. + + [`` +\begin{aligned}[t] + [$sqrt1] - [$sqrt2] &= ([$a] - [$b]) \sqrt{[$c]} \\ + &= [$answer] \\ +\end{aligned} +``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals200.pg new file mode 100644 index 0000000000..36d29bc368 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals200.pg @@ -0,0 +1,201 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with variables. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +$showPartialCorrectAnswers = 1; + +@num = (2,3,5,7,$var); +@power = (); +@numOut=(); +@numIn=(); + +do { + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,3,1); + $power[2]=random(0,3,1); + $power[3]=random(0,2,1); + $power[4]=list_random(2,3,5,6,7,9,10); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>2) {$ok1=1;} + if ($power[$i]%3 !=0) {$ok2=1;} + } + } until ( ($integer<=500) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=4;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i!=4) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i!=4) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=4; $i++) { + $numOut[$i] = int($power[$i]/3); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + if ($i!=4) {$outNum *= $num[$i];} + else {$outVar .= "$var";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + if ($i!=4) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$var^{$numOut[$i]}";} + } + $numIn[$i] = $power[$i]%3; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + if ($i!=4) {$inNum *= $num[$i];} + else {$inVar .= "$var";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + if ($i!=4) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$var^{$numIn[$i]}";} + } + } + +} until ($inNum != $outNum); + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt[3]{-$integer $var^$power[4]}"; +$problem1 = "\sqrt[3]{$integer $var^$power[4]}"; +$ansString0 = "-$outNum $outVar"." \cdot \sqrt[3]{$inNum $inVar}"; +$ansString1 = "\text{not a real number}"; +$ansString2 = "-$outNum"."$inVar"." \cdot \sqrt[3]{$inNum $outVar}"; +$ansString3 = "-$inNum"."$inVar"." \cdot \sqrt[3]{$outNum $outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Note that [`` \sqrt[3]{-x}=-\sqrt[3]{x} ``], so we can pull out the negative symbol. + +Next, we use a prime factor tree to do: + + [`` [$integer] = [$numString] ``] + +Finally, we use [` \sqrt[3]{x^3}=x `] to simplify the expression. The full solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= -[$problem1] \\ + &= -\sqrt[3]{[$allString]} \\ + &= -[$outString] \sqrt[3]{[$inString]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals210.pg new file mode 100644 index 0000000000..475e25f455 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals210.pg @@ -0,0 +1,199 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with variables. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$showPartialCorrectAnswers = 1; + +@num = (2,3,5,7,$var1,$var2); +@power = (); +@numOut=(); +@numIn=(); + +do { + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,3,1); + $power[2]=random(0,3,1); + $power[3]=random(0,2,1); + $power[4]=random(2,10,1); + $power[5]=random(2,10,1); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>2) {$ok1=1;} + if ($power[$i]%3 !=0) {$ok2=1;} + } + } until ( ($integer<=500) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=5;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<4) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<4) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=5; $i++) { + $numOut[$i] = int($power[$i]/3); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + if ($i<4) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + if ($i<4) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$num[$i]^{$numOut[$i]} ";} + } + $numIn[$i] = $power[$i]%3; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + if ($i<4) {$inNum *= $num[$i];} + else {$inVar .= "$num[$i] ";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + if ($i<4) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$num[$i]^{$numIn[$i]} ";} + } + } + +} until ( ($inNum != $outNum) && ($inVar ne $outVar) ); + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt[3]{$integer $var1^{$power[4]} $var2^{$power[5]}}"; +$ansString0 = "$outNum $outVar"." \cdot \sqrt[3]{$inNum $inVar}"; +$ansString1 = "$inNum"."$outVar"." \cdot \sqrt[3]{$outNum $inVar}"; +$ansString2 = "$outNum"."$inVar"." \cdot \sqrt[3]{$inNum $outVar}"; +$ansString3 = "$inNum"."$inVar"." \cdot \sqrt[3]{$outNum $outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +First, we use a prime factor tree to do: + + [`` [$integer] = [$numString] ``] + +Next, we use [` \sqrt[3]{x^3}=x `] to simplify the expression. The full solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[3]{[$allString]} \\ + &= [$outString] \sqrt[3]{[$inString]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals220.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals220.pg new file mode 100644 index 0000000000..1b568a4793 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals220.pg @@ -0,0 +1,201 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with variables. +# +# Last edited: Carl Yao 7/26/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$showPartialCorrectAnswers = 1; + +$root = 4; + +@num = (2,3,5,7,$var1,$var2); +@power = (); +@numOut=(); +@numIn=(); + +do { + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,3,1); + $power[2]=random(0,3,1); + $power[3]=random(0,2,1); + $power[4]=list_random(2,3,4,6,7,8,9,11,12); + $power[5]=list_random(2,3,4,6,7,8,9,11,12); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>2) {$ok1=1;} + if ($power[$i]%$root !=0) {$ok2=1;} + } + } until ( ($integer<=1000) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=5;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<$root) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<$root) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=$#num; $i++) { + $numOut[$i] = int($power[$i]/$root); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + if ($i<$root) {$outNum *= $num[$i];} + else {$outVar .= "$num[$i] ";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + if ($i<$root) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$num[$i]^{$numOut[$i]} ";} + } + $numIn[$i] = $power[$i]%$root; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + if ($i<$root) {$inNum *= $num[$i];} + else {$inVar .= "$num[$i] ";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + if ($i<$root) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$num[$i]^{$numIn[$i]} ";} + } + } + +} until ( ($inNum != $outNum) && ($inVar ne $outVar) && ($outNum!=1) ); + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt[4]{$integer $var1^{$power[4]} $var2^{$power[5]}}"; +$ansString0 = "$outNum $outVar"." \cdot \sqrt[4]{$inNum $inVar}"; +$ansString1 = "$inNum"."$outVar"." \cdot \sqrt[4]{$outNum $inVar}"; +$ansString2 = "$outNum"."$inVar"." \cdot \sqrt[4]{$inNum $outVar}"; +$ansString3 = "$inNum"."$inVar"." \cdot \sqrt[4]{$outNum $outVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +First, we use a prime factor tree to do: + + [`` [$integer] = [$numString] ``] + +Next, we use [` \sqrt[4]{x^3}=x `] to simplify the expression. The full solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[4]{[$allString]} \\ + &= [$outString] \sqrt[4]{[$inString]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg new file mode 100644 index 0000000000..aceabe7022 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Jeremy Shaw +# Portland Community College +# +# Add/subtract radicals like a*sqrt(n)-b*sqrt(n)+c*sqrt(n) +# +# Last edited: Jordan 8/2/13; Carl Yao 7/21/13 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("Numeric"); +$a = random(10,20,1); +$b = random(10,20,1); +do {$c = random(10,20,1);} until (abs($c)!=abs($b)); +$d = int($a - $b + $c); +$radicand = list_random(2,3,5,6,7,11,13,15,17,19,21,23,29,31); + +Context("LimitedRadical"); + +$sqrt1 = Formula("$a * sqrt($radicand)"); +$sqrt2 = Formula("$b * sqrt($radicand)"); +$sqrt3 = Formula("$c * sqrt($radicand)"); + +if (abs($d) != 1) + {$answer = Formula("$d * sqrt($radicand)");} + elsif ($d == 1) + {$answer = Formula("sqrt($radicand)");} + else {$answer = Formula("-sqrt($radicand)");} + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +# Best practices always include this command here. It is responsible for +# the gray box around the problem, problem enumeration, and the path to the +# source .pg file. + +#Current best practice is to use the PGML environment to write the body. +BEGIN_PGML + +Simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [``[$sqrt1] - [$sqrt2] + [$sqrt3] =``] [________________________]{$answer} + + +END_PGML + + +########Begin more complicated answer processing (if needed)############ + +#Not needed in this template. + +########Begin answer hints.############ + +#Not used in this template. For the PCC coding projects, I think that this +#feature will rarely be used the first go-around. + +########Begin solution.############ + +#The walk-through solution is presented to students after the due date, and +#may soon also be used with a "show me how to do this" button that gives a +#walk-through for a similar but randomly generated problem. + +BEGIN_PGML_SOLUTION + +Since these are like radicals, we can combine them as like terms. + +[`` +\begin{aligned}[t] + [$sqrt1] - [$sqrt2] + [$sqrt3] &= ([$a] - [$b] + [$c]) \sqrt{[$radicand]} \\ + &= [$answer] +\end{aligned} +``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg new file mode 100644 index 0000000000..1f81fc4b59 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Jeremy Shaw +# Portland Community College +# +# Simplify radicals like a*sqrt(nx)-b*sqrt(nx)+c*sqrt(nx). +# +# Last edited: Jordan 8/2/13; Carl Yao, 7/21/2013 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextLimitedRadical.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ +#This is where you initialize variables and run computations + +Context("Numeric"); +$a = random(10,70,1); +$b = random(10,70,1); +do {$c = random(10,70,1); +$d = $a - $b + $c;} until (abs($d) != 1); +$radicand = list_random(2,3,5,6,7,11,13,15,17,19,21,23,29,31); + +$x = RandomVariableName(type=>'variable'); + +Context("LimitedRadical"); +Context()->variables->are($x=>'Real'); + + +$sqrt1 = Formula("$a sqrt($radicand $x)"); +$sqrt2 = Formula("$b sqrt($radicand $x)"); +$sqrt3 = Formula("$c sqrt($radicand $x)"); +$answer = Formula("$d sqrt($radicand $x)"); + +########Begin What the Student Sees############ + +TEXT(beginproblem()); +BEGIN_PGML + +Simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [``[$sqrt1] - [$sqrt2] + [$sqrt3] =``] [______________________] + + +END_PGML + + + +########Begin more complicated answer processing (if needed)############ + +ANS($answer -> cmp() ->withPostFilter(AnswerHints( + Formula("$d sqrt($radicand) $x") => "Should you be using more grouping symbols?", +)) +); + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + +Since these are like radicals, we can combine them as like terms. + +[`` +\begin{aligned}[t] + [$sqrt1] - [$sqrt2] + [$sqrt3] &= ([$a] - [$b] + [$c]) \sqrt{[$radicand] [$x]} \\ + &= [$answer] +\end{aligned} +``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg index afbb81eeec..c7c6633502 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg @@ -9,17 +9,18 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Radical_Simp_CombineTerms) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -29,11 +30,12 @@ DOCUMENT(); # for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -166,7 +168,7 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Simplify the expression. Use *sqrt()* for the square root symbol (Example: [`\sqrt{2} =`] *sqrt(2)*.) +Simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** [``[$sqrt1] + [$sqrt2] =``] [____________________]{$answer} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals51.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals51.pg new file mode 100644 index 0000000000..77766ac0d8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals51.pg @@ -0,0 +1,236 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Add two radicals with variables. +# +# Last edited: Carl Yao 8/3/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 2; + +$inRad = list_random(2,3,5,6,7,10); + +@num = (2,3,5,7,$var1,$var2); +$numOfNums = 4; +$numOfVars = 2; +@power = (); +@integer = (); + + do { + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<$numOfNums;$j++) { + $power[$i][$j] = list_random(0,2,4,6); + } + } + + $temp = random(0,3,1); + if ($temp==0) { + $power[0][4] = random(3,9,2); + $power[0][5] = random(3,9,2); + } elsif ($temp==1) { + $power[0][4] = random(3,9,2); + $power[0][5] = random(2,10,2); + } elsif($temp==2) { + $power[0][4] = random(2,10,2); + $power[0][5] = random(3,9,2); + } elsif($temp==3) { + $power[0][4] = random(2,10,2); + $power[0][5] = random(2,10,2); + } + + $power[1][4] = $power[0][4]; + $power[1][5] = $power[0][5]; + + for (my $i=0; $i<2; $i++) { + if ($inRad==2) {$power[$i][0]++;} + if ($inRad==3) {$power[$i][1]++;} + if ($inRad==5) {$power[$i][2]++;} + if ($inRad==6) {$power[$i][0]++;$power[$i][1]++;} + if ($inRad==7) {$power[$i][3]++;} + if ($inRad==10) {$power[$i][0]++;$power[$i][2]++;} + } + + $integer[0] = 2**$power[0][0]*3**$power[0][1]*5**$power[0][2]*7**$power[0][3]; + $integer[1] = 2**$power[1][0]*3**$power[1][1]*5**$power[1][2]*7**$power[1][3]; + + } until ( ($integer[0]<=500) && ($integer[0]>=20) && ($integer[1]<=500) && ($integer[1]>=20) && ($integer[0] != $integer[1]) ); + + @allString = (); + @numString = (); + @varString = (); + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<=$#num;$j++) { + if ($power[$i][$j]>1) { + $allString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot ";} + else {$varString[$i] .= "$num[$j]^{$power[$i][$j]} ";} + } elsif ($power[$i][$j]==1) { + $allString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j] \cdot ";} + else {$varString[$i] .= "$num[$j] ";} + } + } + $allString[$i] = substr($allString[$i],0,length($allString[$i])-7); + $numString[$i] = substr($numString[$i],0,length($numString[$i])-7); + } + + $numOut=0; + $numIn=0; + @outString = (); + @inString = (); + @outNum = (1,1); + @inNum = (1,1); + @outVar = (); + @inVar = (); + for (my $i=0; $i<=1; $i++) { + for (my $j=0; $j<=$#num; $j++) { + $numOut = int($power[$i][$j]/$root); + if ($numOut==1) { + $outString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$outNum[$i] *= $num[$j];} + else {$outVar[$i] .= "$num[$j] ";} + } elsif ($numOut != 0) { + $outString[$i] .= "$num[$j]^{$numOut} \cdot "; + if ($j<$numOfNums) {$outNum[$i] *= $num[$j]**$numOut;} + else {$outVar[$i] .= "$num[$j]^{$numOut} ";} + } + $numIn = $power[$i][$j]%$root; + if ($numIn==1) { + $inString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$inNum[$i] *= $num[$j];} + else {$inVar[$i] .= "$num[$j] ";} + } + } + } + +for (my $i=0; $i<2; $i++) { + $inString[$i] = substr($inString[$i],0,length($inString[$i])-7); +} + +$ansOutNum = $outNum[0]+$outNum[1]; +$ansOutVar = $outVar[0]; +$ansInNum = $inNum[0]; +$ansInVar = $inVar[0]; + +$temp = $integer[0]+$integer[1]; + +$problem = "\sqrt{$integer[0] $varString[0]} + \sqrt{$integer[1] $varString[1]}"; +$ansString0 = "$ansOutNum $ansOutVar \cdot \sqrt{$ansInNum $ansInVar}"; +$ansString1 = "$outNum[0] $outVar[0] \cdot \sqrt{$inNum[0] $inVar[0]} +$outNum[1] $outVar[1] \cdot \sqrt{$inNum[1] $inVar[1]}"; +$ansString2 = "$outVar[0] \cdot \sqrt{$temp}"; +$ansString3 = "$problem"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s1 = $allString[0]; +$s2 = $allString[1]; +$s4 = "$ansString0"; +$s3 = "$outString[0] \sqrt{$inString[0]} + $outString[1] \sqrt{$inString[1]}"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt{[$s1]} + \sqrt{[$s2]} \\ + &= [$s3] \\ + &= [$ansString1] \\ + &= [$s4] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals52.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals52.pg new file mode 100644 index 0000000000..605d79914f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals52.pg @@ -0,0 +1,227 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Add two radicals with variables. +# +# Last edited: Carl Yao 8/3/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 2; + +$inRad = list_random(2,3,5,6,7,10); + +@num = (2,3,5,7,$var1); +$numOfNums = 4; +$numOfVars = 1; +@power = (); +@integer = (); + + do { + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<$numOfNums;$j++) { + $power[$i][$j] = list_random(0,2,4,6); + } + } + + $temp = random(0,1,1); + if ($temp==0) { + $power[0][4] = random(2,10,2); + $power[1][4] = 0; + } elsif ($temp==1) { + $power[1][4] = random(2,10,2); + $power[0][4] = 0; + } + + for (my $i=0; $i<2; $i++) { + if ($inRad==2) {$power[$i][0]++;} + if ($inRad==3) {$power[$i][1]++;} + if ($inRad==5) {$power[$i][2]++;} + if ($inRad==6) {$power[$i][0]++;$power[$i][1]++;} + if ($inRad==7) {$power[$i][3]++;} + if ($inRad==10) {$power[$i][0]++;$power[$i][2]++;} + } + + $integer[0] = 2**$power[0][0]*3**$power[0][1]*5**$power[0][2]*7**$power[0][3]; + $integer[1] = 2**$power[1][0]*3**$power[1][1]*5**$power[1][2]*7**$power[1][3]; + + } until ( ($integer[0]<=500) && ($integer[0]>=20) && ($integer[1]<=500) && ($integer[1]>=20) && ($integer[0] != $integer[1]) ); + + @allString = (); + @numString = (); + @varString = (); + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<=$#num;$j++) { + if ($power[$i][$j]>1) { + $allString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot ";} + else {$varString[$i] .= "$num[$j]^{$power[$i][$j]} ";} + } elsif ($power[$i][$j]==1) { + $allString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j] \cdot ";} + else {$varString[$i] .= "$num[$j] ";} + } + } + $allString[$i] = substr($allString[$i],0,length($allString[$i])-7); + $numString[$i] = substr($numString[$i],0,length($numString[$i])-7); + } + + $numOut=0; + $numIn=0; + @outString = (); + @inString = (); + @outNum = (1,1); + @inNum = (1,1); + @outVar = (); + @inVar = (); + for (my $i=0; $i<=1; $i++) { + for (my $j=0; $j<=$#num; $j++) { + $numOut = int($power[$i][$j]/$root); + if ($numOut==1) { + $outString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$outNum[$i] *= $num[$j];} + else {$outVar[$i] .= "$num[$j] ";} + } elsif ($numOut != 0) { + $outString[$i] .= "$num[$j]^{$numOut} \cdot "; + if ($j<$numOfNums) {$outNum[$i] *= $num[$j]**$numOut;} + else {$outVar[$i] .= "$num[$j]^{$numOut} ";} + } + $numIn = $power[$i][$j]%$root; + if ($numIn==1) { + $inString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$inNum[$i] *= $num[$j];} + else {$inVar[$i] .= "$num[$j] ";} + } + } + } + +for (my $i=0; $i<2; $i++) { + $inString[$i] = substr($inString[$i],0,length($inString[$i])-7); +} + +if ($outVar[0] eq "") {$temp3 = $outVar[1];} +else {$temp3 = $outVar[0];} + +$temp = $outNum[0]+$outNum[1]; +$temp1 = $integer[0]+$integer[1]; +$temp2 = $inNum[0]*2; + +$problem = "\sqrt{$integer[0] $varString[0]} + \sqrt{$integer[1] $varString[1]}"; +$ansString0 = "($outNum[0] $outVar[0] + $outNum[1] $outVar[1]) \cdot \sqrt{$inNum[0] $inVar[0]}"; +$ansString1 = "$temp $temp3 \cdot \sqrt{$inNum[0] $inVar[0]}"; +$ansString2 = "$temp3 \cdot \sqrt{$temp1}"; +$ansString3 = "($outNum[0] $outVar[0] + $outNum[1] $outVar[1]) \cdot \sqrt{$temp2 $inVar[0]}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s1 = $allString[0]; +$s2 = $allString[1]; +$s3 = "$outString[0] \sqrt{$inString[0]} + $outString[1] \sqrt{$inString[1]}"; +$s4 = "$outNum[0] $outVar[0] \cdot \sqrt{$inNum[0] $inVar[0]} +$outNum[1] $outVar[1] \cdot \sqrt{$inNum[1] $inVar[1]}"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt{[$s1]} + \sqrt{[$s2]} \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$ansString0] \\ +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals55.pg new file mode 100644 index 0000000000..cc4eba45cb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals55.pg @@ -0,0 +1,172 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals like sqrt[3](16)-sqrt[3](54). +# +# Last edited: Carl Yao 8/2/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +#$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#Context()->variables->are($var=>'Real'); + +$a = random(2,9,1); +$b = list_random(2,3,5); +do {$c=list_random(2,3,5);} until ($b!=$c); + +$d = $b**3*$a; +$e = $c**3*$a; + +$sqrt1 = "\sqrt[3]{$d}"; +$sqrt2 = "\sqrt[3]{-$e}"; +$sqrt3 = "\sqrt[3]{$e}"; +$problem = $sqrt1."+".$sqrt2; +$problem1 = $sqrt1."-".$sqrt3; + +$bMinusC = $b-$c; +$bPlusC = $b+$c; + +if ($bPlusC==1) { + $s1 = "\sqrt[3]{$a}"; +} elsif ($bPlusC==-1) { + $s1 = "-\sqrt[3]{$a}"; +} else { + $s1 = "$bPlusC \cdot \sqrt[3]{$a}"; +} + +if ($bMinusC==1) { + $s2 = "\sqrt[3]{$a}"; +} elsif ($bMinusC==-1) { + $s2 = "-\sqrt[3]{$a}"; +} else { + $s2 = "$bMinusC \cdot \sqrt[3]{$a}"; +} + +$ansString0 = $s2; +$ansString1 = $s1; +$ansString2 = $problem; +$ansString3 = "$b \cdot \sqrt[3]{$a} - $c \cdot \sqrt[3]{$a}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. + + [``[$problem] =``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +if ($b>$a) { + $s3 = "$a \cdot $b^{3}"; +} else { + $s3 = "$b^{3} \cdot $a"; +} +if ($c>$a) { + $s4 = "$a \cdot $c^{3}"; +} else { + $s4 = "$c^{3} \cdot $a"; +} + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$problem] \\ + &= [$problem1] \\ + &= \sqrt[3]{[$s3]} - \sqrt[3]{[$s4]} \\ + &= [$b] \sqrt[3]{[$a]} - [$c] \sqrt[3]{[$a]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals56.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals56.pg new file mode 100644 index 0000000000..b4654ed501 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals56.pg @@ -0,0 +1,254 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Add two radicals with variables. +# +# Last edited: Carl Yao 8/3/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 3; + +$inRad = list_random(2,3,4,5,6,7,9,10); + +@num = (2,3,5,7,$var1,$var2); +$numOfNums = 4; +$numOfVars = 2; +@power = (); +@integer = (); + + do { + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<$numOfNums;$j++) { + $power[$i][$j] = list_random(0,3,6); + } + } + + $temp = random(0,3,1); + if ($temp==0) { + $power[0][4] = list_random(4,5,7,8); + $power[0][5] = list_random(4,5,7,8); + } elsif ($temp==1) { + $power[0][4] = list_random(4,5,7,8); + $power[0][5] = list_random(3,9,12); + } elsif($temp==2) { + $power[0][4] = list_random(3,9,12); + $power[0][5] = list_random(4,5,7,8); + } elsif($temp==3) { + $power[0][4] = list_random(3,9,12); + $power[0][5] = list_random(3,9,12); + } + + $power[1][4] = $power[0][4]; + $power[1][5] = $power[0][5]; + + for (my $i=0; $i<2; $i++) { + if ($inRad==2) {$power[$i][0]++;} + if ($inRad==3) {$power[$i][1]++;} + if ($inRad==4) {$power[$i][0] += 2;} + if ($inRad==5) {$power[$i][2]++;} + if ($inRad==6) {$power[$i][0]++;$power[$i][1]++;} + if ($inRad==7) {$power[$i][3]++;} + if ($inRad==9) {$power[$i][1] += 2;} + if ($inRad==10) {$power[$i][0]++;$power[$i][2]++;} + } + + $integer[0] = 2**$power[0][0]*3**$power[0][1]*5**$power[0][2]*7**$power[0][3]; + $integer[1] = 2**$power[1][0]*3**$power[1][1]*5**$power[1][2]*7**$power[1][3]; + + } until ( ($integer[0]<=500) && ($integer[0]>=20) && ($integer[1]<=500) && ($integer[1]>=20) && ($integer[0] != $integer[1]) ); + + @allString = (); + @numString = (); + @varString = (); + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<=$#num;$j++) { + if ($power[$i][$j]>1) { + $allString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot ";} + else {$varString[$i] .= "$num[$j]^{$power[$i][$j]} ";} + } elsif ($power[$i][$j]==1) { + $allString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j] \cdot ";} + else {$varString[$i] .= "$num[$j] ";} + } + } + $allString[$i] = substr($allString[$i],0,length($allString[$i])-7); + $numString[$i] = substr($numString[$i],0,length($numString[$i])-7); + } + + $numOut=0; + $numIn=0; + @outString = (); + @inString = (); + @outNum = (1,1); + @inNum = (1,1); + @outVar = (); + @inVar = (); + + @outVar2 = (); # used to create incorrect answers + + for (my $i=0; $i<=1; $i++) { + for (my $j=0; $j<=$#num; $j++) { + $numOut = int($power[$i][$j]/$root); + if ($numOut==1) { + $outString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$outNum[$i] *= $num[$j];} + else { + $outVar[$i] .= "$num[$j] "; + $t1 = 2*$numOut; + $outVar2[$i] .= "$num[$j]^{$t1}"; + } + } elsif ($numOut != 0) { + $outString[$i] .= "$num[$j]^{$numOut} \cdot "; + if ($j<$numOfNums) {$outNum[$i] *= $num[$j]**$numOut;} + else { + $outVar[$i] .= "$num[$j]^{$numOut} "; + $t1 = 2*$numOut; + $outVar2[$i] .= "$num[$j]^{$t1}"; + } + } + $numIn = $power[$i][$j]%$root; + if ($numIn==1) { + $inString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$inNum[$i] *= $num[$j];} + else {$inVar[$i] .= "$num[$j] ";} + } elsif ($numIn != 0) { + $inString[$i] .= "$num[$j]^{$numIn} \cdot "; + if ($j<$numOfNums) {$inNum[$i] *= $num[$j]**$numIn;} + else {$inVar[$i] .= "$num[$j]^{$numIn} ";} + } + } + } + +for (my $i=0; $i<2; $i++) { + $inString[$i] = substr($inString[$i],0,length($inString[$i])-7); +} + +$ansOutNum = $outNum[0]+$outNum[1]; +$ansOutVar = $outVar[0]; +$ansInNum = $inNum[0]; +$ansInVar = $inVar[0]; + +$temp = $integer[0]+$integer[1]; +$temp1 = $outNum[0]*$outNum[1]; + +$problem = "\sqrt[3]{$integer[0] $varString[0]} + \sqrt[3]{$integer[1] $varString[1]}"; +$ansString0 = "$ansOutNum $ansOutVar \cdot \sqrt[3]{$ansInNum $ansInVar}"; +$ansString1 = "$outNum[0] $outVar[0] \cdot \sqrt[3]{$inNum[0] $inVar[0]} +$outNum[1] $outVar[1] \cdot \sqrt[3]{$inNum[1] $inVar[1]}"; +$ansString2 = "$ansOutNum $outVar2[0] \cdot \sqrt[3]{$ansInNum $ansInVar}"; +$ansString3 = "$temp1 $ansOutVar \cdot \sqrt[3]{$ansInNum $ansInVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s1 = $allString[0]; +$s2 = $allString[1]; +$s4 = "$ansString0"; +$s3 = "$outString[0] \sqrt[3]{$inString[0]} + $outString[1] \sqrt[3]{$inString[1]}"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[3]{[$s1]} + \sqrt[3]{[$s2]} \\ + &= [$s3] \\ + &= [$ansString1] \\ + &= [$s4] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals57.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals57.pg new file mode 100644 index 0000000000..99dd9b7a88 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals57.pg @@ -0,0 +1,245 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Add two 4th-root radicals. +# +# Last edited: Carl Yao 8/3/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 4; + +$inRad = list_random(2,3,4,5,6,7,8,9,10); + +@num = (2,3,5,7); +$numOfNums = 4; +@power = (); +@integer = (); + + do { + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<$numOfNums;$j++) { + $power[$i][$j] = list_random(0,4,8); + } + } + + $temp = random(0,3,1); + if ($temp==0) { + $power[0][4] = random(3,9,2); + $power[0][5] = random(3,9,2); + } elsif ($temp==1) { + $power[0][4] = random(3,9,2); + $power[0][5] = random(2,10,2); + } elsif($temp==2) { + $power[0][4] = random(2,10,2); + $power[0][5] = random(3,9,2); + } elsif($temp==3) { + $power[0][4] = random(2,10,2); + $power[0][5] = random(2,10,2); + } + + $power[1][4] = $power[0][4]; + $power[1][5] = $power[0][5]; + + for (my $i=0; $i<2; $i++) { + if ($inRad==2) {$power[$i][0]++;} + if ($inRad==3) {$power[$i][1]++;} + if ($inRad==4) {$power[$i][0] += 2;} + if ($inRad==5) {$power[$i][2]++;} + if ($inRad==6) {$power[$i][0]++;$power[$i][1]++;} + if ($inRad==7) {$power[$i][3]++;} + if ($inRad==8) {$power[$i][0] += 3;} + if ($inRad==9) {$power[$i][1] += 2;} + if ($inRad==10) {$power[$i][0]++;$power[$i][2]++;} + } + + $integer[0] = 2**$power[0][0]*3**$power[0][1]*5**$power[0][2]*7**$power[0][3]; + $integer[1] = 2**$power[1][0]*3**$power[1][1]*5**$power[1][2]*7**$power[1][3]; + + } until ( ($integer[0]<=1000) && ($integer[0]>=20) && ($integer[1]<=1000) && ($integer[1]>=20) && ($integer[0] != $integer[1]) ); + + @allString = (); + @numString = (); + @varString = (); + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<=$#num;$j++) { + if ($power[$i][$j]>1) { + $allString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot ";} + else {$varString[$i] .= "$num[$j]^{$power[$i][$j]} ";} + } elsif ($power[$i][$j]==1) { + $allString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j] \cdot ";} + else {$varString[$i] .= "$num[$j] ";} + } + } + $allString[$i] = substr($allString[$i],0,length($allString[$i])-7); + $numString[$i] = substr($numString[$i],0,length($numString[$i])-7); + } + + $numOut=0; + $numIn=0; + @outString = (); + @inString = (); + @outNum = (1,1); + @inNum = (1,1); + @outVar = (); + @inVar = (); + for (my $i=0; $i<=1; $i++) { + for (my $j=0; $j<=$#num; $j++) { + $numOut = int($power[$i][$j]/$root); + if ($numOut==1) { + $outString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$outNum[$i] *= $num[$j];} + else {$outVar[$i] .= "$num[$j] ";} + } elsif ($numOut != 0) { + $outString[$i] .= "$num[$j]^{$numOut} \cdot "; + if ($j<$numOfNums) {$outNum[$i] *= $num[$j]**$numOut;} + else {$outVar[$i] .= "$num[$j]^{$numOut} ";} + } + $numIn = $power[$i][$j]%$root; + if ($numIn==1) { + $inString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$inNum[$i] *= $num[$j];} + else {$inVar[$i] .= "$num[$j] ";} + } elsif ($numIn != 0) { + $inString[$i] .= "$num[$j]^{$numIn} \cdot "; + if ($j<$numOfNums) {$inNum[$i] *= $num[$j]**$numIn;} + else {$inVar[$i] .= "$num[$j]^{$numIn} ";} + } + } + } + +for (my $i=0; $i<2; $i++) { + $inString[$i] = substr($inString[$i],0,length($inString[$i])-7); +} + +$ansOutNum = $outNum[0]+$outNum[1]; +$ansOutVar = $outVar[0]; +$ansInNum = $inNum[0]; +$ansInVar = $inVar[0]; + +$temp = $integer[0]+$integer[1]; +$temp1 = $outNum[0]*$outNum[1]; + +$problem = "\sqrt[4]{$integer[0] $varString[0]} + \sqrt[4]{$integer[1] $varString[1]}"; +$ansString0 = "$ansOutNum $ansOutVar \cdot \sqrt[4]{$ansInNum $ansInVar}"; +$ansString1 = "$outNum[0] $outVar[0] \cdot \sqrt[4]{$inNum[0] $inVar[0]} +$outNum[1] $outVar[1] \cdot \sqrt[4]{$inNum[1] $inVar[1]}"; +$ansString2 = "\sqrt[4]{$temp}"; +$ansString3 = "$temp1 \cdot \sqrt[4]{$ansInNum $ansInVar}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s1 = $allString[0]; +$s2 = $allString[1]; +$s4 = "$ansString0"; +$s3 = "$outString[0] \sqrt[4]{$inString[0]} +$outString[1] \sqrt[4]{$inString[1]}"; + +$ansString1 = "$outNum[0] $outVar[0] \cdot \sqrt[4]{$inNum[0] $inVar[0]} +$outNum[1] $outVar[1] \cdot \sqrt[4]{$inNum[1] $inVar[1]}"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[4]{[$s1]} + \sqrt[4]{[$s2]} \\ + &= [$s3] \\ + &= [$ansString1] \\ + &= [$s4] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals58.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals58.pg new file mode 100644 index 0000000000..1814969cad --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals58.pg @@ -0,0 +1,229 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Add two radicals with variables. +# +# Last edited: Carl Yao 8/3/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$root = 4; + +$inRad = list_random(2,3,4,5,6,7,8,9,10); + +@num = (2,3,5,7,$var1,$var2); +$numOfNums = 4; +$numOfVars = 2; +@power = (); +@integer = (); + + do { + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<$numOfNums;$j++) { + $power[$i][$j] = list_random(0,4,8); + } + } + + $power[0][4] = list_random(4,8,12); + $power[0][5] = 0; + $power[1][5] = list_random(4,8,12); + $power[1][4] = 0; + + for (my $i=0; $i<2; $i++) { + if ($inRad==2) {$power[$i][0]++;} + if ($inRad==3) {$power[$i][1]++;} + if ($inRad==4) {$power[$i][0] += 2;} + if ($inRad==5) {$power[$i][2]++;} + if ($inRad==6) {$power[$i][0]++;$power[$i][1]++;} + if ($inRad==7) {$power[$i][3]++;} + if ($inRad==8) {$power[$i][0] += 3;} + if ($inRad==9) {$power[$i][1] += 2;} + if ($inRad==10) {$power[$i][0]++;$power[$i][2]++;} + } + + $integer[0] = 2**$power[0][0]*3**$power[0][1]*5**$power[0][2]*7**$power[0][3]; + $integer[1] = 2**$power[1][0]*3**$power[1][1]*5**$power[1][2]*7**$power[1][3]; + + } until ( ($integer[0]<=1000) && ($integer[0]>=20) && ($integer[1]<=1000) && ($integer[1]>=20) && ($integer[0] != $integer[1]) ); + + @allString = (); + @numString = (); + @varString = (); + for (my $i=0;$i<=1;$i++) { + for (my $j=0;$j<=$#num;$j++) { + if ($power[$i][$j]>1) { + $allString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j]^{$power[$i][$j]} \cdot ";} + else {$varString[$i] .= "$num[$j]^{$power[$i][$j]} ";} + } elsif ($power[$i][$j]==1) { + $allString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$numString[$i] .= "$num[$j] \cdot ";} + else {$varString[$i] .= "$num[$j] ";} + } + } + $allString[$i] = substr($allString[$i],0,length($allString[$i])-7); + $numString[$i] = substr($numString[$i],0,length($numString[$i])-7); + } + + $numOut=0; + $numIn=0; + @outString = (); + @inString = (); + @outNum = (1,1); + @inNum = (1,1); + @outVar = (); + @inVar = (); + for (my $i=0; $i<=1; $i++) { + for (my $j=0; $j<=$#num; $j++) { + $numOut = int($power[$i][$j]/$root); + if ($numOut==1) { + $outString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$outNum[$i] *= $num[$j];} + else {$outVar[$i] .= "$num[$j] ";} + } elsif ($numOut != 0) { + $outString[$i] .= "$num[$j]^{$numOut} \cdot "; + if ($j<$numOfNums) {$outNum[$i] *= $num[$j]**$numOut;} + else {$outVar[$i] .= "$num[$j]^{$numOut} ";} + } + $numIn = $power[$i][$j]%$root; + if ($numIn==1) { + $inString[$i] .= "$num[$j] \cdot "; + if ($j<$numOfNums) {$inNum[$i] *= $num[$j];} + else {$inVar[$i] .= "$num[$j] ";} + } elsif ($numIn != 0) { + $inString[$i] .= "$num[$j]^{$numIn} \cdot "; + if ($j<$numOfNums) {$inNum[$i] *= $num[$j]**$numIn;} + else {$inVar[$i] .= "$num[$j]^{$numIn} ";} + } + } + } + +for (my $i=0; $i<2; $i++) { + $inString[$i] = substr($inString[$i],0,length($inString[$i])-7); +} + +$temp3 = $outVar[0].$outVar[1]; + +$temp = $outNum[0]+$outNum[1]; +$temp1 = $integer[0]+$integer[1]; +$temp2 = $inNum[0]*2; + +$problem = "\sqrt[4]{$integer[0] $varString[0]} + \sqrt[4]{$integer[1] $varString[1]}"; +$ansString0 = "($outNum[0] $outVar[0] + $outNum[1] $outVar[1]) \cdot \sqrt[4]{$inNum[0] $inVar[0]}"; +$ansString1 = "$temp $temp3 \cdot \sqrt[4]{$inNum[0] $inVar[0]}"; +$ansString2 = "$temp3 \cdot \sqrt[4]{$temp1}"; +$ansString3 = "($outNum[0] $outVar[0] + $outNum[1] $outVar[1]) \cdot \sqrt[4]{$temp2 $inVar[0]}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + +##################################################### + +BEGIN_PGML + +Simplify [`` [$problem] ``]. Assume all variables are positive. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +############################################################ + +ANS( $radio->cmp() ); + +############################################## + +$s1 = $allString[0]; +$s2 = $allString[1]; +$s3 = "$outString[0] \sqrt[4]{$inString[0]} + $outString[1] \sqrt[4]{$inString[1]}"; +$s4 = "$outNum[0] $outVar[0] \cdot \sqrt[4]{$inNum[0] $inVar[0]} +$outNum[1] $outVar[1] \cdot \sqrt[4]{$inNum[1] $inVar[1]}"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[4]{[$s1]} + \sqrt[4]{[$s2]} \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$ansString0] \\ +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg index fd6b02c6ca..0803aa9e75 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg @@ -11,16 +11,18 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Radical_Simp_CombineTerms) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -30,11 +32,12 @@ DOCUMENT(); # for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -185,7 +188,7 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Simplify the expression. Use *sqrt* for the square root symbol (Example: [`\sqrt{2} =`] *sqrt(2)*.) +Simplify the expression. [@KeyboardInstructions('Use [|sqrt|]* for the square root symbol. (Example: [`\sqrt{2} =`] [|sqrt(2)|]*.)')@]** [``[$sqrt1] + [$sqrt2] + [$sqrt3] + [$sqrt4] =``] [____________________]{$answer} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg index 67c400d694..fc8ce346e5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg @@ -9,16 +9,18 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBCCSS('8.EE') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Radical_Simp_CombineTerms) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -28,11 +30,12 @@ DOCUMENT(); # for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -168,7 +171,7 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Simplify the expression. Use *sqrt* for the square root symbol (Example: [`\sqrt{2} =`] *sqrt(2)*.) +Simplify the expression. [@KeyboardInstructions('Use [|sqrt|]* for the square root symbol. (Example: [`\sqrt{2} =`] [|sqrt(2)|]*.)')@]** [``[$sqrt1] - [$sqrt2] =``] [____________________]{$answer} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg index f831830266..c21a1228ec 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg @@ -9,16 +9,18 @@ # ENDDESCRIPTION ## Problem Tagging Information -## DBCCSS('8.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Irrational numbers) -## DBsection(Simplify radical numbers) -## Institution(Portland Community College) -## Author(Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Radical_Simp_CombineTerms) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') ## KEYWORDS('simplify','radical','square root') +## DBCCSS('8.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Jeremy Shaw, Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') #This command starts the problem. DOCUMENT(); @@ -28,11 +30,12 @@ DOCUMENT(); # for the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed "contextLimitedRadical.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); @@ -187,7 +190,7 @@ TEXT(beginproblem()); #Current best practice is to use the PGML environment to write the body. BEGIN_PGML -Simplify the expression. Use *sqrt* for the square root symbol (Example: [`\sqrt{2} =`] *sqrt(2)*.) +Simplify the expression. [@KeyboardInstructions('Use [|sqrt|]* for the square root symbol. (Example: [`\sqrt{2} =`] [|sqrt(2)|]*.)')@]** [``[$sqrt1] - [$sqrt2] - [$sqrt3] - [$sqrt4] =``] [___________________]{$answer} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals91.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals91.pg new file mode 100644 index 0000000000..b15cc9812e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals91.pg @@ -0,0 +1,194 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 8/11/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +#$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#Context()->variables->are($var=>'Real'); + +do { + $a = random(2,6,1); + $b = random(1,6,1); +} until (gcd($a,$b)==1); + +do { + do {$c = random(2,6,1);} until ($c != $a); + $d = random(1,6,1); +} until (gcd($c,$d)==1); + +$e = list_random(2,3,5,6,7,10); + +$num1 = ($b==1) ? "\sqrt{$e}" : "$b \sqrt{$e}"; +$num2 = ($d==1) ? "\sqrt{$e}" : "$d \sqrt{$e}"; + +$problem = "\frac{$num1}{$a}+\frac{$num2}{$c}"; + +$commonD = lcm($a,$c); +$f1 = $commonD/$a; +$f2 = $commonD/$c; +$ansNum = $b*$f1+$d*$f2; + +$e2 = $e*2; +$aPlusC = $a+$c; +$bPlusD = $b+$d; +$f3 = gcd($aPlusC,$bPlusD); +$aPlusC = $aPlusC/$f3; +$bPlusD = $bPlusD/$f3; + +$g = $ansNum*$e; +$f4 = gcd($g,$commonD); +$ans3Num = $g/$f4; +$ans3Den = $commonD/$f4; + +$ansString0 = "\frac{$ansNum \sqrt{$e}}{$commonD}"; +$ansString1 = "\frac{$ansNum \sqrt{$e2}}{$commonD}"; + +if ( ($aPlusC==1) && ($bPlusD==1) ) {$ansString2 = "\sqrt{$e}";} +elsif ($aPlusC==1) {$ansString2 = "$bPlusD \sqrt{$e}";} +elsif ($bPlusD==1) {"\frac{\sqrt{$e}}{$aPlusC}";} +else {$ansString2 = "\frac{$bPlusD \sqrt{$e}}{$aPlusC}";} + +$ansString3 = "\frac{$ans3Num}{$ans3Den}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +if ($f1==1) { + $s1 = "\frac{$num1}{$a}"; +} else { + $s1 = "\frac{$f1 \cdot $num1}{$f1 \cdot $a}"; +} + +if ($f2==1) { + $s2 = "\frac{$num2}{$c}"; +} else { + $s2 = "\frac{$f2 \cdot $num2}{$f2 \cdot $c}"; +} + +if ( ($f1==1) && ($f2==1) ) { + $s3 = ""; +} else { + $s3 = "&= $s1 + $s2 \\"; +} + +$s4 = $f1*$b+$f2*$d; +$s5 = $f1*$a; + +if ($s5==$commonD) { + $s6 = ""; +} else { + $s6 = "&= \frac{$s4}{$s5} \\"; +} + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + [$s3] + &= \frac{[$f1*$b] \sqrt{[$e]}}{[$f1*$a]} + \frac{[$f2*$d] \sqrt{[$e]}}{[$f2*$c]} \\ + [$s6] + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals92.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals92.pg new file mode 100644 index 0000000000..2ef9243dd1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals92.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 8/11/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +#$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#Context()->variables->are($var=>'Real'); + +do { + $a = list_random(2,3,5,7); + $b = list_random(2,3,5,6,7,10); +} until (gcd($a,$b)==1); + +$ab = $a*$b; + +$problem = "\sqrt{\frac{$b}{$a}} + \sqrt{$ab}"; + +$c = $a+1; + +$ansString0 = "\frac{$c \sqrt{$ab}}{$a}"; +$ansString1 = ($a==2) ? "\frac{\sqrt{$b} + \sqrt{$ab}}{$a}" : "\frac{2 \sqrt{$ab}}{$a}"; +$ansString2 = "\frac{\sqrt{$b} + $a \sqrt{$ab}}{$a}"; +$ansString3 = "\sqrt{$ab}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. Don't forget to rationalize the denominator. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{\sqrt{[$b]}}{\sqrt{[$a]}} + \sqrt{[$ab]} \\ + &= \frac{\sqrt{[$b]} \cdot \sqrt{[$a]}}{\sqrt{[$a]} \cdot \sqrt{[$a]}} + \sqrt{[$ab]} \\ + &= \frac{\sqrt{[$ab]}}{[$a]} + \sqrt{[$ab]} \\ + &= \frac{\sqrt{[$ab]}}{[$a]} + \frac{[$a] \sqrt{[$ab]}}{[$a]} \\ + &= \frac{\sqrt{[$ab]}+[$a] \sqrt{[$ab]}}{[$a]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals92new.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals92new.pg new file mode 100644 index 0000000000..185508991d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals92new.pg @@ -0,0 +1,180 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 1/2/2017 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); + +do { + $a = list_random(2,3,5,7); + do {$b = list_random(2,3,5,7);} until ($a!=$b); + do {$d = list_random(2,3,5,7);} until ( ($d!=$a) && ($d!=$b) ); + do {$c = random(2,10,1);} until (gcd($c,$a)==1); + do {$e = random(2,10,1);} until ( (gcd($e,$d)==1) && ($c!=$e) ); + $commonD = lcm($c,$e); + $m1 = $commonD/$c; + $m2 = $commonD/$e; + $numerator = $a*$m1-$d*$m2; +} until ( (gcd($numerator,$commonD)!=1) && ($numerator>0) ); + +$a2 = $a**2; +$a2b = $a2*$b; +$d2 = $d**2; +$d2b = $d2*$b; + +$problem = "\frac{\sqrt{$a2b}}{$c}-\frac{\sqrt{$d2b}}{$e}"; + +$m3 = gcd($numerator,$commonD); +$ansNum = $numerator/$m3; +$ansDen = $commonD/$m3; + +$ansString0 = ($ansNum==1) ? "\frac{\sqrt{$b}}{$ansDen}" : "\frac{$ansNum \sqrt{$b}}{$ansDen}"; + +$c1 = gcd($numerator,$ansDen); +if ($c1==1) { + $ansString1 = ($numerator==1) ? "\frac{\sqrt{$b}}{$ansDen}" : "\frac{$numerator \sqrt{$b}}{$ansDen}"; + } else { + $num1 = $numerator/$c1; + $den1 = $ansDen/$c1; + if ($den1==1) {$ansString1 = "$num1 \sqrt{$b}";} + else {$ansString1 = ($num1==1) ? "\frac{\sqrt{$b}}{$den1}" : "\frac{$num1 \sqrt{$b}}{$den1}";} + } + +$c2 = gcd($ansNum,$commonD); +if ($c2==1) { + $ansString2 = ($ansNum==1) ? "\frac{\sqrt{$b}}{$commonD}" : "\frac{$ansNum \sqrt{$b}}{$commonD}"; + } else { + $num2 = $ansNum/$c2; + $den2 = $commonD/$c2; + if ($den2==1) {$ansString2 = "$num2 \sqrt{$b}";} + else {$ansString2 = ($num2==1) ? "\frac{\sqrt{$b}}{$den2}" : "\frac{$num2 \sqrt{$b}}{$den2}";} + } + +$commonD3 = lcm($c,$e); +$f3 = $commonD3/$c; +$f4 = $commonD3/$e; +if ($f3==1) {$ansString3 = "\frac{\sqrt{$a2b}-$f4\sqrt{$d2b}}{$commonD3}";} +elsif ($f4==1) {$ansString3 = "\frac{$f3\sqrt{$a2b}-\sqrt{$d2b}}{$commonD3}";} +else {$ansString3 = "\frac{$f3\sqrt{$a2b}-$f4\sqrt{$d2b}}{$commonD3}";} + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +$primeList1 = ($a<$b) ? "$a^2\cdot$b" : "$b\cdot$a^2"; +$primeList2 = ($d<$b) ? "$d^2\cdot$b" : "$b\cdot$d^2"; +$s1 = ($m1==1) ? "\frac{$a\sqrt{$b}}{$c}" : "\frac{\mathbf{$m1\cdot}$a\sqrt{$b}}{\mathbf{$m1\cdot}$c}"; +$s2 = ($m2==1) ? "\frac{$d\sqrt{$b}}{$e}" : "\frac{\mathbf{$m2\cdot}$d\sqrt{$b}}{\mathbf{$m2\cdot}$e}"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{\sqrt{[$primeList1]}}{[$c]}-\frac{\sqrt{[$primeList2]}}{[$e]} \\ + &= \frac{[$a]\sqrt{[$b]}}{[$c]}-\frac{[$d]\sqrt{[$b]}}{[$e]} \\ + &= [$s1]-[$s2] \\ + &= \frac{[$a*$m1]\sqrt{[$b]}}{[$commonD]}-\frac{[$d*$m2]\sqrt{[$b]}}{[$commonD]} \\ + &= \frac{[$a*$m1-$d*$m2]\sqrt{[$b]}}{[$commonD]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals93.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals93.pg new file mode 100644 index 0000000000..475c64162b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals93.pg @@ -0,0 +1,133 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 8/11/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$problem = "\sqrt{$var1^3 $var2} - \sqrt{\frac{$var2}{$var1}}"; + +$ansString0 = "\frac{($var1^2-1) \sqrt{$var1 $var2}}{$var1}"; +$ansString1 = "\frac{($var1-1) \sqrt{$var1 $var2}}{$var1}"; +$ansString2 = "\frac{$var1 \sqrt{$var1^3 $var2} - \sqrt{$var1 $var2}}{$var1}"; +$ansString3 = "\sqrt{$var1 $var2}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. Don't forget to rationalize the denominator. Assume all variables are positive. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= [$var1] \sqrt{[$var1][$var2]} - \frac{\sqrt{[$var2]}}{\sqrt{[$var1]}} \\ + &= [$var1] \sqrt{[$var1][$var2]} - \frac{\sqrt{[$var2]} \cdot \sqrt{[$var1]} }{\sqrt{[$var1]} \cdot \sqrt{[$var1]}} \\ + &= [$var1] \sqrt{[$var1][$var2]} - \frac{\sqrt{[$var1] [$var2]}}{[$var1]} \\ + &= \frac{[$var1]^2 \sqrt{[$var1][$var2]}}{[$var1]} - \frac{\sqrt{[$var1] [$var2]}}{[$var1]} \\ + &= \frac{[$var1]^2 \sqrt{[$var1][$var2]} - \sqrt{[$var1][$var2]}}{[$var1]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals93new.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals93new.pg new file mode 100644 index 0000000000..990365e72c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals93new.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 1/2/2017 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); + +do { + $a = list_random(2,3,5); + $b = random(2,6,1); + $c = list_random(2,3,5,7); +} until ( (gcd($a,$b)==1) && ($c != $a) ); +$b2 = $b**2; +$c2 = $c**2; +$rad2 = $c2*$a; + +$problem = "\sqrt{\frac{$a}{$b2}}+\sqrt{$rad2}"; + +$bc = $b*$c; +$ansNum = $bc+1; + +$c1 = $c+1; + +$ansString0 = "\frac{$ansNum \sqrt{$a}}{$b}"; +$ansString1 = "$c \sqrt{$a}"; +$ansString2 = ($c1==$b) ? "\sqrt{$a}" : "\frac{$c1 \sqrt{$a}}{$b}"; +$ansString3 = ($c==$b) ? "\sqrt{$a}" : "\frac{$c \sqrt{$a}}{$b}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +$primeList = ($a<$c) ? "$a\cdot$c^2" : "$c^2\cdot$a"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{\sqrt{[$a]}}{\sqrt{[$b2]}} + \sqrt{[$primeList]} \\ + &= \frac{\sqrt{[$a]}}{[$b]} + [$c]\sqrt{[$a]} \\ + &= \frac{\sqrt{[$a]}}{[$b]} + \frac{[$c]\sqrt{[$a]}}{1} \\ + &= \frac{\sqrt{[$a]}}{[$b]} + \frac{\mathbf{[$b]\cdot}[$c]\sqrt{[$a]}}{\mathbf{[$b]\cdot}1} \\ + &= \frac{\sqrt{[$a]}}{[$b]} + \frac{[$bc]\sqrt{[$a]}}{[$b]} \\ + &= \frac{\sqrt{[$a]}+[$bc]\sqrt{[$a]}}{[$b]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals94.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals94.pg new file mode 100644 index 0000000000..1604d0f25b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals94.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 8/12/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +do { + $b = list_random(2,3,5,7); + $c = list_random(2,3,5,7); +} until ( (gcd($b,$c)==1) && ($c>$b) ); + +$bc = $b*$c; +$cMinusB = $c-$b; + +$problem = "\sqrt{\frac{$c}{$b $var^2}} - \sqrt{\frac{$b}{$c}}"; + +$ansString0 = "\frac{($c-$b $var)\sqrt{$bc}}{$bc $var}"; +$ansString1 = "\frac{($c $var - $b)\sqrt{$bc}}{$bc $var}"; +$ansString2 = "\frac{\sqrt{$bc}}{$bc $var}"; +$ansString3 = "\frac{$cMinusB \sqrt{$bc}}{$bc $var}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. Don't forget to rationalize the denominator. Assume all variables are positive. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{\sqrt{[$c]}}{\sqrt{[$b][$var]^2}} - \frac{\sqrt{[$b]}}{\sqrt{[$c]}} \\ + &= \frac{\sqrt{[$c]}}{[$var] \sqrt{[$b]}} - \frac{\sqrt{[$b]}}{\sqrt{[$c]}} \\ + &= \frac{\sqrt{[$c]} \cdot \sqrt{[$b]} }{[$var] \sqrt{[$b]} \cdot \sqrt{[$b]} } - \frac{\sqrt{[$b]} \cdot \sqrt{[$c]}}{\sqrt{[$c]} \cdot \sqrt{[$c]} } \\ + &= \frac{\sqrt{[$bc]}}{[$b][$var]} - \frac{\sqrt{[$bc]}}{[$c]} \\ + &= \frac{\sqrt{[$bc]} \cdot [$c] }{[$b][$var] \cdot [$c] } - \frac{\sqrt{[$bc]} \cdot [$b][$var] }{[$c] \cdot [$b][$var] } \\ + &= \frac{[$c]\sqrt{[$bc]}-[$b][$var]\sqrt{[$bc]}}{[$bc][$var]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals94new.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals94new.pg new file mode 100644 index 0000000000..b28d02ae90 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals94new.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 1/2/2017 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); + +do { + $a = list_random(2,3,5); + $b = random(2,5,1); + $c = list_random(2,3,5); +} until ( (gcd($a,$b)==1) && ($c != $a) ); +$b3 = $b**3; +$c3 = $c**3; +$rad1 = $c3*$a; + +$problem = "\sqrt[3]{$rad1}-\sqrt[3]{\frac{$a}{$b3}}"; + +$bc = $b*$c; +$ansNum = $bc-1; + +$c1 = $c+1; + +$ansString0 = "\frac{$ansNum \cdot \sqrt[3]{$a}}{$b}"; +$ansString1 = "$c \cdot \sqrt[3]{$a}"; +$ansString2 = ($c1==$b) ? "\sqrt[3]{$a}" : "\frac{$c1\cdot \sqrt[3]{$a}}{$b}"; +$ansString3 = ($c==$b) ? "\sqrt[3]{$a}" : "\frac{$c\cdot \sqrt[3]{$a}}{$b}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +$primeList = ($a<$c) ? "$a\cdot$c^3" : "$c^3\cdot$a"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[3]{[$primeList]} - \frac{\sqrt[3]{[$a]}}{\sqrt[3]{[$b3]}}\\ + &= [$c]\cdot\sqrt[3]{[$a]} - \frac{\sqrt[3]{[$a]}}{[$b]} \\ + &= \frac{[$c]\cdot\sqrt[3]{[$a]}}{1} - \frac{\sqrt[3]{[$a]}}{[$b]} \\ + &= \frac{\mathbf{[$b]\cdot}[$c]\cdot\sqrt[3]{[$a]}}{\mathbf{[$b]\cdot}1} - \frac{\sqrt[3]{[$a]}}{[$b]}\\ + &= \frac{[$bc]\cdot\sqrt[3]{[$a]}}{[$b]} - \frac{\sqrt[3]{[$a]}}{[$b]} \\ + &= \frac{[$bc]\cdot\sqrt[3]{[$a]}-\sqrt[3]{[$a]}}{[$b]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals95.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals95.pg new file mode 100644 index 0000000000..0cbc9caf22 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals95.pg @@ -0,0 +1,146 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 8/12/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +#$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#Context()->variables->are($var=>'Real'); + +do { + $a = list_random(2,3,5,7); + $b = list_random(2,3,5,7); +} until ( $b>$a ); + +$a2 = $a*$a; +$a2b = $a*$a*$b; +$bMinusA = $b-$a; +$b2 = $b*$b; +$ab = $a*$b; +$bPlusA = $a+$b; + +$problem = "\sqrt[3]{\frac{$b}{$a}} + \sqrt[3]{\frac{-$a2}{$b2}}"; + +$ansString0 = "\frac{$bMinusA \cdot \sqrt[3]{$a2b}}{$ab}"; +$ansString1 = "\frac{$bPlusA \cdot \sqrt[3]{$a2b}}{$ab}"; +$ansString2 = "\frac{$bMinusA}{$ab}"; +$ansString3 = "\frac{$bMinusA \cdot \sqrt[3]{$ab}}{$ab}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. Don't forget to rationalize the denominator. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[3]{\frac{[$b]}{[$a]}} - \sqrt[3]{\frac{[$a2]}{[$b2]}} \\ + &= \frac{\sqrt[3]{[$b]}}{\sqrt[3]{[$a]}} - \frac{\sqrt[3]{[$a2]}}{\sqrt[3]{[$b2]}} \\ + &= \frac{\sqrt[3]{[$b]}}{\sqrt[3]{[$a]}} - \frac{\sqrt[3]{[$a2]}}{\sqrt[3]{[$b]^2}} \\ + &= \frac{\sqrt[3]{[$b]} \cdot \sqrt[3]{[$a]^2} }{\sqrt[3]{[$a]} \cdot \sqrt[3]{[$a]^2} } - \frac{\sqrt[3]{[$a2]} \cdot \sqrt[3]{[$b]} }{\sqrt[3]{[$b]^2} \cdot \sqrt[3]{[$b]} } \\ + &= \frac{\sqrt[3]{[$a2b]}}{[$a]} - \frac{\sqrt[3]{[$a2b]}}{[$b]} \\ + &= \frac{\sqrt[3]{[$a2b]} \cdot [$b] }{[$a] \cdot [$b] } - \frac{\sqrt[3]{[$a2b]} \cdot [$a] }{[$b] \cdot [$a] } \\ + &= \frac{[$b] \sqrt[3]{[$a2b]} - [$a] \sqrt[3]{[$a2b]}}{[$ab]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals95new.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals95new.pg new file mode 100644 index 0000000000..2ef9243dd1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals95new.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 8/11/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +#$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#Context()->variables->are($var=>'Real'); + +do { + $a = list_random(2,3,5,7); + $b = list_random(2,3,5,6,7,10); +} until (gcd($a,$b)==1); + +$ab = $a*$b; + +$problem = "\sqrt{\frac{$b}{$a}} + \sqrt{$ab}"; + +$c = $a+1; + +$ansString0 = "\frac{$c \sqrt{$ab}}{$a}"; +$ansString1 = ($a==2) ? "\frac{\sqrt{$b} + \sqrt{$ab}}{$a}" : "\frac{2 \sqrt{$ab}}{$a}"; +$ansString2 = "\frac{\sqrt{$b} + $a \sqrt{$ab}}{$a}"; +$ansString3 = "\sqrt{$ab}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. Don't forget to rationalize the denominator. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{\sqrt{[$b]}}{\sqrt{[$a]}} + \sqrt{[$ab]} \\ + &= \frac{\sqrt{[$b]} \cdot \sqrt{[$a]}}{\sqrt{[$a]} \cdot \sqrt{[$a]}} + \sqrt{[$ab]} \\ + &= \frac{\sqrt{[$ab]}}{[$a]} + \sqrt{[$ab]} \\ + &= \frac{\sqrt{[$ab]}}{[$a]} + \frac{[$a] \sqrt{[$ab]}}{[$a]} \\ + &= \frac{\sqrt{[$ab]}+[$a] \sqrt{[$ab]}}{[$a]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals96.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals96.pg new file mode 100644 index 0000000000..0cbc9caf22 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals96.pg @@ -0,0 +1,146 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 8/12/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +#$var = list_random('x','y','z','t','r','m','n','a','b','c'); +#Context()->variables->are($var=>'Real'); + +do { + $a = list_random(2,3,5,7); + $b = list_random(2,3,5,7); +} until ( $b>$a ); + +$a2 = $a*$a; +$a2b = $a*$a*$b; +$bMinusA = $b-$a; +$b2 = $b*$b; +$ab = $a*$b; +$bPlusA = $a+$b; + +$problem = "\sqrt[3]{\frac{$b}{$a}} + \sqrt[3]{\frac{-$a2}{$b2}}"; + +$ansString0 = "\frac{$bMinusA \cdot \sqrt[3]{$a2b}}{$ab}"; +$ansString1 = "\frac{$bPlusA \cdot \sqrt[3]{$a2b}}{$ab}"; +$ansString2 = "\frac{$bMinusA}{$ab}"; +$ansString3 = "\frac{$bMinusA \cdot \sqrt[3]{$ab}}{$ab}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. Don't forget to rationalize the denominator. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \sqrt[3]{\frac{[$b]}{[$a]}} - \sqrt[3]{\frac{[$a2]}{[$b2]}} \\ + &= \frac{\sqrt[3]{[$b]}}{\sqrt[3]{[$a]}} - \frac{\sqrt[3]{[$a2]}}{\sqrt[3]{[$b2]}} \\ + &= \frac{\sqrt[3]{[$b]}}{\sqrt[3]{[$a]}} - \frac{\sqrt[3]{[$a2]}}{\sqrt[3]{[$b]^2}} \\ + &= \frac{\sqrt[3]{[$b]} \cdot \sqrt[3]{[$a]^2} }{\sqrt[3]{[$a]} \cdot \sqrt[3]{[$a]^2} } - \frac{\sqrt[3]{[$a2]} \cdot \sqrt[3]{[$b]} }{\sqrt[3]{[$b]^2} \cdot \sqrt[3]{[$b]} } \\ + &= \frac{\sqrt[3]{[$a2b]}}{[$a]} - \frac{\sqrt[3]{[$a2b]}}{[$b]} \\ + &= \frac{\sqrt[3]{[$a2b]} \cdot [$b] }{[$a] \cdot [$b] } - \frac{\sqrt[3]{[$a2b]} \cdot [$a] }{[$b] \cdot [$a] } \\ + &= \frac{[$b] \sqrt[3]{[$a2b]} - [$a] \sqrt[3]{[$a2b]}}{[$ab]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals97.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals97.pg new file mode 100644 index 0000000000..1604d0f25b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals97.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 8/12/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +do { + $b = list_random(2,3,5,7); + $c = list_random(2,3,5,7); +} until ( (gcd($b,$c)==1) && ($c>$b) ); + +$bc = $b*$c; +$cMinusB = $c-$b; + +$problem = "\sqrt{\frac{$c}{$b $var^2}} - \sqrt{\frac{$b}{$c}}"; + +$ansString0 = "\frac{($c-$b $var)\sqrt{$bc}}{$bc $var}"; +$ansString1 = "\frac{($c $var - $b)\sqrt{$bc}}{$bc $var}"; +$ansString2 = "\frac{\sqrt{$bc}}{$bc $var}"; +$ansString3 = "\frac{$cMinusB \sqrt{$bc}}{$bc $var}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. Don't forget to rationalize the denominator. Assume all variables are positive. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= \frac{\sqrt{[$c]}}{\sqrt{[$b][$var]^2}} - \frac{\sqrt{[$b]}}{\sqrt{[$c]}} \\ + &= \frac{\sqrt{[$c]}}{[$var] \sqrt{[$b]}} - \frac{\sqrt{[$b]}}{\sqrt{[$c]}} \\ + &= \frac{\sqrt{[$c]} \cdot \sqrt{[$b]} }{[$var] \sqrt{[$b]} \cdot \sqrt{[$b]} } - \frac{\sqrt{[$b]} \cdot \sqrt{[$c]}}{\sqrt{[$c]} \cdot \sqrt{[$c]} } \\ + &= \frac{\sqrt{[$bc]}}{[$b][$var]} - \frac{\sqrt{[$bc]}}{[$c]} \\ + &= \frac{\sqrt{[$bc]} \cdot [$c] }{[$b][$var] \cdot [$c] } - \frac{\sqrt{[$bc]} \cdot [$b][$var] }{[$c] \cdot [$b][$var] } \\ + &= \frac{[$c]\sqrt{[$bc]}-[$b][$var]\sqrt{[$bc]}}{[$bc][$var]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals98.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals98.pg new file mode 100644 index 0000000000..475c64162b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals98.pg @@ -0,0 +1,133 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radicals with fractions. +# +# Last edited: Carl Yao 8/11/16 +# +# ENDDESCRIPTION + +## Problem Tagging Information +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('Portland Community College') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines +# for the problem. + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "parserRadioButtons.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +$var1 = list_random('x','y','z','t','r','m','n','a','b','c'); +do {$var2 = list_random('x','y','z','t','r','m','n','a','b','c');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$problem = "\sqrt{$var1^3 $var2} - \sqrt{\frac{$var2}{$var1}}"; + +$ansString0 = "\frac{($var1^2-1) \sqrt{$var1 $var2}}{$var1}"; +$ansString1 = "\frac{($var1-1) \sqrt{$var1 $var2}}{$var1}"; +$ansString2 = "\frac{$var1 \sqrt{$var1^3 $var2} - \sqrt{$var1 $var2}}{$var1}"; +$ansString3 = "\sqrt{$var1 $var2}"; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +#Create 4 choices +@choices=(); + + $choices[$scramble{0}] = $ansString0; + $choices[$scramble{1}] = $ansString1; + $choices[$scramble{2}] = $ansString2; + $choices[$scramble{3}] = $ansString3; + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$scramble{0}], # correct answer + order => ["A","B","C","D"], separator=>$BR.$SPACE.$SPACE.$SPACE +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the expression. Don't forget to rationalize the denominator. Assume all variables are positive. + + [``[$problem] ``] + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +$PAR +$SPACE$SPACE$SPACE A: $SPACE$SPACE$SPACE \( $choices[0] \) +$PAR +$SPACE$SPACE$SPACE B: $SPACE$SPACE$SPACE \( $choices[1] \) +$PAR +$SPACE$SPACE$SPACE C: $SPACE$SPACE$SPACE \( $choices[2] \) +$PAR +$SPACE$SPACE$SPACE D: $SPACE$SPACE$SPACE \( $choices[3] \) +$PAR +$SPACE$SPACE$SPACE\{ $radio->buttons() \} + +END_TEXT +Context()->normalStrings; + +########################################## + +ANS( $radio->cmp() ); + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$problem] \\ + &= [$var1] \sqrt{[$var1][$var2]} - \frac{\sqrt{[$var2]}}{\sqrt{[$var1]}} \\ + &= [$var1] \sqrt{[$var1][$var2]} - \frac{\sqrt{[$var2]} \cdot \sqrt{[$var1]} }{\sqrt{[$var1]} \cdot \sqrt{[$var1]}} \\ + &= [$var1] \sqrt{[$var1][$var2]} - \frac{\sqrt{[$var1] [$var2]}}{[$var1]} \\ + &= \frac{[$var1]^2 \sqrt{[$var1][$var2]}}{[$var1]} - \frac{\sqrt{[$var1] [$var2]}}{[$var1]} \\ + &= \frac{[$var1]^2 \sqrt{[$var1][$var2]} - \sqrt{[$var1][$var2]}}{[$var1]} \\ + &= [$ansString0] +\end{aligned} + ``] + +The correct answer is [`[@ $radio->correct_ans() @]*`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicalsComplex02.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicalsComplex02.pg new file mode 100644 index 0000000000..fa31a0c13f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicalsComplex02.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify radical. This radical cannot be simplified. +# +# Last edited: Carl Yao 8/31/13, +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','square root') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedRadicalComplex.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); + +$p1 = list_random(2,3,5,7); +do {$p2=list_random(2,3,5,7);} until ($p2!=$p1); +do {$p3=list_random(2,3,5,7);} until (($p3!=$p1) && ($p3!=$p2)); + +$biggest, $middle, $smallest; +if (($p1>$p2) && ($p1>$p3)) { + $biggest=$p1; + $middle = ($p2>$p3) ? $p2 : $p3; + $smallest = ($p2>$p3) ? $p3 : $p2; +} elsif ( ($p2>$p1) && ($p2>$p3) ) { + $biggest = $p2; + $middle = ($p1>$p3) ? $p1 : $p3; + $smallest = ($p1>$p3) ? $p3 : $p1; +} else { + $biggest = $p3; + $middle = ($p1>$p2) ? $p1 : $p2; + $smallest = ($p1>$p2) ? $p2 : $p1; +} + +$rad = $p1*$p2*$p3; +$radN = -$rad; +$sqrt1 = "\sqrt{$radN}"; + +Context("LimitedRadicalComplex"); +$ans = Formula("i*sqrt($rad)"); + +##################################################### + +BEGIN_PGML + +Simplify the radical and write it as a complex number using [`i`]. + +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` [$sqrt1] = ``] [_____________]{$ans} + +END_PGML + +############################################################ + + +BEGIN_PGML_SOLUTION + +For [`[$sqrt1]`], since the number inside the square root symbol is negative, we can re-write it into a complex number: + + [`` +\begin{aligned} + [$sqrt1] &= \sqrt{-1\cdot[$rad]} \\ + &= \sqrt{-1}\cdot\sqrt{[$rad]} \\ + &= i\sqrt{[$rad]} +\end{aligned} + ``] + +Next, we will simplify [`\sqrt{[$rad]}`]. First, we prime factor [`[$rad]`]: + + [`` \sqrt{[$rad]} = \sqrt{[$smallest]\cdot[$middle]\cdot[$biggest]} ``] + +There are no pairs inside the square root, so [`\sqrt{[$rad]}`] cannot be simplified. The answer is simply [`[$ans]`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicalsComplex04.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicalsComplex04.pg new file mode 100644 index 0000000000..b9c9d9be6f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicalsComplex04.pg @@ -0,0 +1,162 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify a square radical with only numbers inside. Answer is in complex form. +# +# Last edited: Carl Yao 12/7/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedRadicalComplex.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$showPartialCorrectAnswers = 1; + +$var = "x"; + +@num = (2,3,5,7); +@power = (); +@numOut=(); +@numIn=(); + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,3,1); + $power[2]=random(0,3,1); + $power[3]=random(0,2,1); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>=2) {$ok1=1;} + if ($power[$i]%2 !=0) {$ok2=1;} + } + } until ( ($integer<=100) && ($integer>=20) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<4) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<4) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outNumC = 0; + $inNumC = 0; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=3; $i++) { + $numOut[$i] = int($power[$i]/2); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + $outNumC++; + if ($i<4) {$outNum *= $num[$i];} + else {$outVar .= "$var";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + $outNumC += $numOut[$i]; + if ($i<4) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$var^{$numOut[$i]}";} + } + $numIn[$i] = $power[$i]%2; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + $inNumC++; + if ($i<4) {$inNum *= $num[$i];} + else {$inVar .= "$var";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + $inNumC += $numIn[$i]; + if ($i<4) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$var^{$numIn[$i]}";} + } + } + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt{-$integer}"; + +Context("LimitedRadicalComplex"); +Context()->flags->set(reduceConstantFunctions=>0); +$ansR = Real("$outNum*sqrt($inNum)"); +$ans = Formula("$outNum*i*sqrt($inNum)"); + +##################################################### + +BEGIN_PGML + +Simplify the radical and write it as a complex number using [`i`]. + +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` [$problem] =``] [_______________]{$ans} + +END_PGML + +############################################## + +$s1 = ""; +if ( ($outNumC>1) || ($inNumC>1) ) { + $s1 = "&=".$ans->TeX; +} + +BEGIN_PGML_SOLUTION + +For [`[$problem]`], since the number inside the square root symbol is negative, the answer must be a complex expression. + +The solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}\sqrt{-[$integer]} \\ + &= \sqrt{-1}\cdot\sqrt{[$integer]} \\ + &= i\sqrt{[$integer]} \\ + &= i\sqrt{[$allString]} \\ + &= [$outString]i \sqrt{[$inString]} \\ + [$s1] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicalsComplex06.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicalsComplex06.pg new file mode 100644 index 0000000000..c36af128b2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicalsComplex06.pg @@ -0,0 +1,161 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify a square radical with only numbers inside. Answer is in complex form. +# +# Last edited: Carl Yao 12/7/16 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('simplify','radical','exponent') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextLimitedRadicalComplex.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +$showPartialCorrectAnswers = 1; + +$var = "x"; + +@num = (2,3,5,7); +@power = (); +@numOut=(); +@numIn=(); + + do { + $power[0]=random(0,4,1); + $power[1]=random(0,3,1); + $power[2]=random(0,3,1); + $power[3]=random(0,2,1); + $integer = 2**$power[0]*3**$power[1]*5**$power[2]*7**$power[3]; + $ok1 = 0; + $ok2 = 0; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>=2) {$ok1=1;} + if ($power[$i]%2 !=0) {$ok2=1;} + } + } until ( ($integer<=500) && ($integer>=100) && ($ok1==1) && ($ok2==1) ); + + $allString = ""; + $numString = ""; + for (my $i=0;$i<=3;$i++) { + if ($power[$i]>1) { + $allString .= "$num[$i]^{$power[$i]} \cdot "; + if ($i<4) {$numString .= "$num[$i]^{$power[$i]} \cdot ";} + } elsif ($power[$i]==1) { + $allString .= "$num[$i] \cdot "; + if ($i<4) {$numString .= "$num[$i] \cdot ";} + } + } + $allString = substr($allString,0,length($allString)-7); + $numString = substr($numString,0,length($numString)-7); + + $outString = ""; + $inString = ""; + $outNum = 1; + $inNum = 1; + $outNumC = 0; + $inNumC = 0; + $outVar = ""; + $inVar = ""; + for (my $i=0; $i<=3; $i++) { + $numOut[$i] = int($power[$i]/2); + if ($numOut[$i]==1) { + $outString .= "$num[$i] \cdot "; + $outNumC++; + if ($i<4) {$outNum *= $num[$i];} + else {$outVar .= "$var";} + } elsif ($numOut[$i]!=0) { + $outString .= "$num[$i]^{$numOut[$i]} \cdot "; + $outNumC += $numOut[$i]; + if ($i<4) {$outNum *= $num[$i]**$numOut[$i];} + else {$outVar .= "$var^{$numOut[$i]}";} + } + $numIn[$i] = $power[$i]%2; + if ($numIn[$i]==1) { + $inString .= "$num[$i] \cdot "; + $inNumC++; + if ($i<4) {$inNum *= $num[$i];} + else {$inVar .= "$var";} + } elsif ($numIn[$i]!=0) { + $inString .= "$num[$i]^{$numIn[$i]} \cdot "; + $inNumC += $numIn[$i]; + if ($i<4) {$inNum *= $num[$i]**$numIn[$i];} + else {$inVar .= "$var^{$numIn[$i]}";} + } + } + +$inString = substr($inString,0,length($inString)-7); + +$problem = "\sqrt{-$integer}"; + +Context("LimitedRadicalComplex"); +$ansR = Real("$outNum*sqrt($inNum)"); +$ans = Formula("$outNum*i*sqrt($inNum)"); + +##################################################### + +BEGIN_PGML + +Simplify the radical and write it as a complex number using [`i`]. + +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + [`` [$problem] =``] [_______________]{$ans} + +END_PGML + +############################################## + +$s1 = ""; +if ( ($outNumC>1) || ($inNumC>1) ) { + $s1 = "&=".$ans->TeX; +} + +BEGIN_PGML_SOLUTION + +For [`[$problem]`], since the number inside the square root symbol is negative, the answer must be a complex expression. + +The solution is: + + [`` +\begin{aligned}[t] + &\phantom{{}=}\sqrt{-[$integer]} \\ + &= \sqrt{-1}\cdot\sqrt{[$integer]} \\ + &= i\sqrt{[$integer]} \\ + &= i\sqrt{[$allString]} \\ + &= [$outString]i \sqrt{[$inString]} \\ + [$s1] +\end{aligned} + ``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/radicalFunctionGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/radicalFunctionGraph10.pg new file mode 100644 index 0000000000..6b1abae441 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RadicalsAndRationalExponents/radicalFunctionGraph10.pg @@ -0,0 +1,149 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION +# +# Identify the graphs of basic functions. +# +# Last edited: Carl Yao 01/05/2016 + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PGunion.pl", + "imageChoice.pl", + "PCCmacros.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$xmin = -5; +$ymin = -5; +$xmax = -$xmin; +$ymax = -$ymin; + + + +# make graphs for each +@gr = (); +foreach my $i (0..7) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0],'grid'=>[$xmax-$xmin,$ymax-$ymin]); +} + +$f[0] = Formula(non_zero_random(-4,4,1)); +add_functions($gr[0], "$f[0] for x in <$xmin,$xmax> using color:blue and weight:2"); +$f[1] = Formula("x"); +add_functions($gr[1], "$f[1] for x in <$xmin,$xmax> using color:blue and weight:2"); +$f[2] = Formula("x^2"); +add_functions($gr[2], "$f[2] for x in <$xmin,$xmax> using color:blue and weight:2"); +$f[3] = Formula("x^(1/3)"); +add_functions($gr[3], "$f[3] for x in <0,$xmax> using color:blue and weight:2"); +add_functions($gr[3], "-(-x)^(1/3) for x in <$xmin,0> using color:blue and weight:2"); +$f[4] = Formula("abs(x)"); +add_functions($gr[4], "$f[4] for x in <$xmin,$xmax> using color:blue and weight:2"); +$f[5] = Formula("1/x"); +add_functions($gr[5], "$f[5] for x in <$xmin,-0.1> using color:blue and weight:2"); +add_functions($gr[5], "$f[5] for x in <0.1,$xmax> using color:blue and weight:2"); +$f[6] = Formula("sqrt(x)"); +add_functions($gr[6], "$f[6] for x in <0,$xmax> using color:blue and weight:2"); +$f[7] = Formula("1/x^2"); +add_functions($gr[7], "$f[7] for x in <$xmin,$xmax> using color:blue and weight:2"); + + +@QA = (); +Context()->texStrings; +foreach my $i (0..7) { + if ($i!=3) {push( @QA, "\(f(x)=$f[$i]\)", $gr[$i] );} + else {push( @QA, "\(f(x)=x^{\frac{1}{3}}\)", $gr[$i] );} +} +Context()->normalStrings; + + +$ml = new_image_match_list( + link => 1, # do not link to separate image + size => [200,200], # image size in pixels + tex_size => 450, # tex size in precent times 10 + columns => 2, # number of columns + separation => 20, # separation between image columns +); + +$ml->rf_print_q(~~&pop_up_list_print_q); # use pop-up-lists +$ml->ra_pop_up_list([ No_answer=>"?", A=>"A", B=>"B", C=>"C", D=>"D", E=>"E", F=>"F", G=>"G", H=>"H"] ); + +$ml->qa(@QA); # set the questions and answers +$ml->choose(8); # select 4 of them +#$ml->choose_extra(0); # and show the other 1 + +############################################## + +BEGIN_TEXT +\{ +ColumnTable( +"Match the graphs with the corresponding formulas.". +$ml->print_q() # no period! +, # comma! +$BCENTER. +$ml->print_a(). +$BR. +"(Click on a graph to enlarge it)". +$ECENTER # no period! +, # comma! +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS(str_cmp($ml->ra_correct_ans)); + +foreach my $i (0..7) { + $a[$i] = $ml->ra_correct_ans->[$i]; +} + +BEGIN_SOLUTION +The formulas match as follows: +1 matches graph $a[0], +2 matches graph $a[1], +3 matches graph $a[2], +4 matches graph $a[3], +5 matches graph $a[4], +6 matches graph $a[5], +7 matches graph $a[6], and +8 matches graph $a[7]. +END_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication10.pg new file mode 100644 index 0000000000..c4629dabe7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication10.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# A work related application problem involving solving a rational equation. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','application','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$sex1 = list_random('male','female'); +$pronoun1 = ($sex1 eq 'male') ? 'he' : 'she'; +$ob1 = ($sex1 eq 'male') ? 'him' : 'her'; +$Pronoun1 = ucfirst($pronoun1); +$name1 = RandomName(sex=>$sex1); + +$sex2 = list_random('male','female'); +$pronoun2 = ($sex2 eq 'male') ? 'he' : 'she'; +$ob2 = ($sex2 eq 'male') ? 'him' : 'her'; +$Pronoun2 = ucfirst($pronoun2); +$name2 = RandomName(sex=>$sex2); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +do { + $a = random(5,20,1); + do {$b = random(5,20,1);} until ($a!=$b); + $ans = Compute(($a*$b)/($a+$b)); +} until ($ans*10==int($ans*10)); + +$commonD = Formula("$a*$b*x"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name1] and [$name2] are working together to paint a room. If [$name1] paints the room alone, it would take [$ob1] [`[$a]`] hours to complete the job. If [$name2] paints the room alone, it would take [$ob2] [`[$b]`] hours to complete the job. Answer the following question: + +If they work together, it would take them [________]{$ans} hours to complete the job. Use a decimal in your answer if needed. + +END_PGML + +############################################## + + +############################################## + + +BEGIN_PGML_SOLUTION + +Let's understand how to use fractions to model work problems. Assume it takes a person [`5`] hours to complete a job. If we treat the whole job as one whole, each hour, this person would complete [`\frac{1}{5}`] of the job. + +Similarly, if it takes a person [`x`] hours to complete a job, each hour, this person would complete [`\frac{1}{x}`] of the job. + +Now we are ready to model this situation with math. + +It's given that, if [$name1] paints the room alone, it would take [$ob1] [`[$a]`] hours to complete the job. Each hour, [$name1] does [`\frac{1}{[$a]}`] of the whole job. + +Similarly, if [$name2] paints the room alone, it would take [$ob2] [`[$b]`] hours to complete the job. Each hour, [$name2] does [`\frac{1}{[$b]}`] of the whole job. + +Assume that, if they work together, it would take them [`x`] hours to complete the job. Thus, each hour, they can complete [`\frac{1}{x}`] of the whole job. + +Now we can write an equation and solve it: + + [`` +\begin{aligned} + &\frac{1}{[$a]}+\frac{1}{[$b]} = \frac{1}{x} \\ + &\frac{1}{[$a]} \cdot [$commonD] +\frac{1}{[$b]} \cdot [$commonD] = \frac{1}{x} \cdot [$commonD] \\ + &[$b]x + [$a]x = [$a] \cdot [$b] \\ + &[$a+$b]x = [$a*$b] \\ + & \frac{[$a+$b]x}{[$a+$b]} = \frac{[$a*$b]}{[$a+$b]} \\ + & x=[$ans] +\end{aligned} + ``] + +In the second step, to get rid of all fractions, we multiplied each term with the common denominator [`[$commonD]`]. + +By the solution we got, if they work together, it would take them [`[$ans]`] hours to complete the job. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication15.pg new file mode 100644 index 0000000000..f7a9b4a9fa --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication15.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# An application problem involving solving a rational equation. +# The problem is about three pipes filling a tank. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','application','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +do { + $a = random(3,15,1); + do {$b = random(3,15,1);} until ($a!=$b); + do {$c = random(3,15,1);} until ( ($c!=$b) && ($c!=$a) ); + $ans = 1/(1/$a+1/$b+1/$c); + $ans100 = $ans*100; +} until ($ans100==int($ans100)); + +$e = lcm($a,$b); +$f = lcm($e,$c); +$commonD = Formula("$f*x"); +$ans = Compute($ans); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +There are three pipes at a tank. To fill the tank, it would take Pipe A [`[$a]`] hours, Pipe B [`[$b]`] hours, and Pipe C [`[$c]`] hours. Answer the following question: + +If all three pipes are turned on, it would take [________]{$ans} hours to fill the tank. + +END_PGML + +############################################## + +$o = $f/$a+$f/$b+$f/$c; + +############################################## + + +BEGIN_PGML_SOLUTION + +Let's understand how to use fractions to model work problems. Assume it takes a pipe [`5`] hours to fill a tank. If we treat the whole job as one whole, each hour, the pipe would fill [`\frac{1}{5}`] of the tank. + +Similarly, if it takes a pipe [`x`] hours to fill a tank, each hour, the pipe would fill [`\frac{1}{x}`] of the tank. + +Now we are ready to model this situation with math. + +It's given that it takes Pipe A [`[$a]`] hours to fill the tank. Each hour, Pipe A fills [`\frac{1}{[$a]}`] of the tank. + +Similarly, each hour, Pipe B fills [`\frac{1}{[$b]}`] of the tank; and Pipe C fills [`\frac{1}{[$c]}`] of the tank. + +Assume that, if all pipes are turned on, it would take [`x`] hours to fill the tank. Thus, each hour, they can fill [`\frac{1}{x}`] of the tank. + +Now we can write an equation and solve it: + + [`` +\begin{aligned} + &\frac{1}{[$a]}+\frac{1}{[$b]} + \frac{1}{[$c]}= \frac{1}{x} \\ + &\frac{1}{[$a]} \cdot [$commonD] +\frac{1}{[$b]} \cdot [$commonD] + \frac{1}{[$c]} \cdot [$commonD]= \frac{1}{x} \cdot [$commonD] \\ + &[$f/$a]x + [$f/$b]x +[$f/$c]x = [$f] \\ + &[$o]x = [$f] \\ + & \frac{[$o]x}{[$o]} = \frac{[$f]}{[$o]} \\ + & x=[$ans] +\end{aligned} + ``] + +In the second step, to get rid of all fractions, we multiplied each term with the common denominator [`[$commonD]`]. + +By the solution we got, if all pipe are turned on, it would take [`[$ans]`] hours to fill the tank. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication20.pg new file mode 100644 index 0000000000..b77d94e6e2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication20.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# A work related application problem involving solving a rational equation. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','application','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$sex1 = list_random('male','female'); +$pronoun1 = ($sex1 eq 'male') ? 'he' : 'she'; +$ob1 = ($sex1 eq 'male') ? 'him' : 'her'; +$Pronoun1 = ucfirst($pronoun1); +$name1 = RandomName(sex=>$sex1); + +$sex2 = list_random('male','female'); +$pronoun2 = ($sex2 eq 'male') ? 'he' : 'she'; +$ob2 = ($sex2 eq 'male') ? 'him' : 'her'; +$Pronoun2 = ucfirst($pronoun2); +$name2 = RandomName(sex=>$sex2); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +do { + $a = random(15,55,10)/10; + $b = random(5,20,1); + $ans1 = Compute(($a+1)*$b/$a); +} until ($ans1==int($ans1)); + +$commonD = Formula("$a*$b*x"); +$ans2 = Compute($ans1*$a); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name1] and [$name2] are working together to paint a room. [$name1] works [`[$a]`] times as fast as [$name2] does. If they work together, it took them [`[$b]`] hours to complete the job. Answer the following questions: + +If [$name1] paints the room alone, it would take [$ob1] [______]{$ans1} hours to complete the job. + +If [$name2] paints the room alone, it would take [$ob2] [______]{$ans2} hours to complete the job. + +END_PGML + +############################################## + + +############################################## + + +BEGIN_PGML_SOLUTION + +Let's understand how to use fractions to model work problems. Assume it takes a person [`5`] hours to complete a job. If we treat the whole job as one whole, each hour, this person would complete [`\frac{1}{5}`] of the job. + +Similarly, if it takes a person [`x`] hours to complete a job, each hour, this person would complete [`\frac{1}{x}`] of the job. + +Now we are ready to model this situation with math. + +Assume that, if [$name1] paints the room alone, it would take [$ob1] [`x`] hours to complete the job. Each hour, [$name1] does [`\frac{1}{x}`] of the whole job. + +Since [$name1] works [`[$a]`] times as fast as [$name2] does, if [$name2] paints the room alone, it would take [$ob1] [`[$a]x`] hours to complete the job. Each hour, [$name2] does [`\frac{1}{[$a]x}`] of the whole job. + +It's given that, if they work together, it took them [`[$b]`] hours to complete the job. Each hour, they can complete [`\frac{1}{[$b]}`] of the whole job. + +Now we can write an equation and solve it: + + [`` +\begin{aligned} + &\frac{1}{x}+\frac{1}{[$a]x} = \frac{1}{[$b]} \\ + &\frac{1}{x} \cdot [$commonD] +\frac{1}{[$a]x} \cdot [$commonD] = \frac{1}{[$b]} \cdot [$commonD] \\ + &[$a] \cdot [$b] + [$b] = [$a]x \\ + &[$a*$b]+[$b] = [$a]x \\ + &[$a*$b+$b] = [$a]x \\ + & \frac{[$a*$b+$b]}{[$a]} = \frac{[$a]x}{[$a]} \\ + & [$ans1] = x +\end{aligned} + ``] + +In the second step, to get rid of all fractions, we multiplied each term with the common denominator [`[$commonD]`]. + +By the solution we got, it would take [$name1] [`[$ans1]`] hours to complete the job. + +Since [$name1] works [`[$a]`] times as fast as [$name2] does, it would take [$name2] [`[$a]\cdot[$ans1]=[$ans2]`] hours to complete the job. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication25.pg new file mode 100644 index 0000000000..d33b620b0e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication25.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# An application problem involving solving a rational equation. +# This problem is about two pipes filling a tank. +# +# Last edited: Yao 09/20/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','application','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +do { + $a = random(3.5,7.5,1); + $b = random(2,20,1); + $ans1 = Compute(($a+1)*$b/$a); +} until ($ans1==int($ans1)); + +$commonD = Formula("$a*$b*x"); +$ans2 = Compute($ans1*$a); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Two pipes are being used to fill a tank. Pipe A can fill the tank [`[$a]`] times as fast as Pipe B does. When both pipes are turned on, it takes [`[$b]`] hours to fill the tank. Answer the following questions: + +If only Pipe A is turned on, it would take [______]{$ans1} hours to fill the tank. + +If only Pipe B is turned on, it would take [______]{$ans2} hours to fill the tank. + +END_PGML + +############################################## + + +############################################## + + +BEGIN_PGML_SOLUTION + +Let's understand how to use fractions to model work problems. Assume it takes a pipe [`5`] hours to fill a tank. If we treat the whole job as one whole, each hour, the pipe would fill [`\frac{1}{5}`] of the tank. + +Similarly, if it takes a pipe [`x`] hours to fill a tank, each hour, the pipe would fill [`\frac{1}{x}`] of the tank. + +Now we are ready to model this situation with math. + +Assume that it would take Pipe A [`x`] hours to fill the tank. Each hour, Pipe A fills [`\frac{1}{x}`] of the tank. + +Since Pipe A can fill the tank [`[$a]`] times as fast as Pipe B does, it would take Pipe B [`[$a]x`] hours to fill the tank (Pipe B is slower!). Each hour, Pipe B fills [`\frac{1}{[$a]x}`] of the tank. + +It's given that, when both pipes are turned on, it would take them [`[$b]`] hours to fill the tank. Each hour, they can fill [`\frac{1}{[$b]}`] of the tank. + +Now we can write an equation and solve it: + + [`` +\begin{aligned} + &\frac{1}{x}+\frac{1}{[$a]x} = \frac{1}{[$b]} \\ + &\frac{1}{x} \cdot [$commonD] +\frac{1}{[$a]x} \cdot [$commonD] = \frac{1}{[$b]} \cdot [$commonD] \\ + &[$a] \cdot [$b] + [$b] = [$a]x \\ + &[$a*$b]+[$b] = [$a]x \\ + &[$a*$b+$b] = [$a]x \\ + & \frac{[$a*$b+$b]}{[$a]} = \frac{[$a]x}{[$a]} \\ + & [$ans1] = x +\end{aligned} + ``] + +In the second step, to get rid of all fractions, we multiplied each term with the common denominator [`[$commonD]`]. + +By the solution we got, it would take Pipe A [`[$ans1]`] hours to fill the tank. + +Since Pipe A can fill the tank [`[$a]`] times as fast as Pipe B does, it would take Pipe B [`[$a]\cdot[$ans1]=[$ans2]`] hours to fill the tank. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication30.pg new file mode 100644 index 0000000000..a5f5f739e8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication30.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# A work related application problem involving solving a rational equation. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','application','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$sex1 = list_random('male','female'); +$pronoun1 = ($sex1 eq 'male') ? 'he' : 'she'; +$ob1 = ($sex1 eq 'male') ? 'him' : 'her'; +$Pronoun1 = ucfirst($pronoun1); +$name1 = RandomName(sex=>$sex1); + +$sex2 = list_random('male','female'); +$pronoun2 = ($sex2 eq 'male') ? 'he' : 'she'; +$ob2 = ($sex2 eq 'male') ? 'him' : 'her'; +$Pronoun2 = ucfirst($pronoun2); +$name2 = RandomName(sex=>$sex2); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +do { + do { + $a = random(1,10,1); + $b = random(1,10,1); + $a1 = 1; + $b1 = $a-2*$b; + $c1 = -$a*$b; + $d1 = ($b1)**2-4*$a1*$c1; + } until ($d1>0); + $x1 = (-$b1+sqrt($d1))/(2*$a1); + $x2 = (-$b1-sqrt($d1))/(2*$a1); +} until ( ($x1==int($x1)) && ($x2==int($x2)) ); + +$commonD = Formula("$b*x*(x+$a)")->reduce; + +$ans1 = Compute($x1); +$ans2 = Compute($x1+$a); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[$name1] and [$name2] worked together to paint a room, and it took them [`[$b]`] hours to complete the job. If they work alone, it would take [$name2] [`[$a]`] more hours than [$name1] to complete the job. Answer the following questions: + +If [$name1] paints the room alone, it would take [$ob1] [______]{$ans1} hours to complete the job. + +If [$name2] paints the room alone, it would take [$ob2] [______]{$ans2} hours to complete the job. + +END_PGML + +############################################## + + +############################################## + + +BEGIN_PGML_SOLUTION + +Let's understand how to use fractions to model work problems. Assume it takes a person [`5`] hours to complete a job. If we treat the whole job as one whole, each hour, this person would complete [`\frac{1}{5}`] of the job. + +Similarly, if it takes a person [`x`] hours to complete a job, each hour, this person would complete [`\frac{1}{x}`] of the job. + +Now we are ready to model this situation with math. + +Assume that, if [$name1] paints the room alone, it would take [$ob1] [`x`] hours to complete the job. Each hour, [$name1] does [`\frac{1}{x}`] of the whole job. + +It's given that, if they work alone, it would take [$name2] [`[$a]`] more hours to complete the job. So it would take [$name2] [`x+[$a]`] hours to complete the job. Each hour, [$name2] does [`\frac{1}{x+[$a]}`] of the whole job. + +It's given that, if they work together, it took them [`[$b]`] hours to complete the job. Each hour, they can complete [`\frac{1}{[$b]}`] of the whole job. + +Now we can write an equation and solve it: + + [`` +\begin{aligned} + &\frac{1}{x}+\frac{1}{x+[$a]} = \frac{1}{[$b]} \\ + &\frac{1}{x} \cdot [$commonD] +\frac{1}{x+[$a]} \cdot [$commonD] = \frac{1}{[$b]} \cdot [$commonD] \\ + &[$b](x+[$a]) + [$b]x = x(x+[$a]) \\ + &[$b]x+[$a*$b] +[$b]x = x^{2}+[$a]x \\ + &[$b+$b]x+[$a*$b] = x^{2}+[$a]x \\ + & 0= x^{2}+[$a]x -[$b+$b]x -[$a*$b] \\ + & 0= x^{2}+[$a-2*$b]x -[$a*$b] \\ + & 0= (x-[$x1])(x-[$x2]) \\ + &x-[$x1]=0 \:\: or\:\: x-[$x2]=0 \\ + &x=[$x1] \:\: or\:\: x=[$x2] +\end{aligned} + ``] + +In the second step, to get rid of all fractions, we multiplied each term with the common denominator [`[$commonD]`]. + +In this situation, [`x=[$x2]`] is not a valid solution, since hours cannot be negative. [`x=[$x1]`] is the only solution. It would take [$name1] [`[$ans1]`] hours to complete the job. + +Since, if they work alone, it would take [$name2] [`[$a]`] more hours to complete the job, it would take [$name2] [`[$ans1]+[$a]=[$ans2]`] hours to complete the job. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication35.pg new file mode 100644 index 0000000000..9d52e3bd84 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication35.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# A pipe-tank related application problem involving solving a rational equation. +# +# Last edited: Yao 09/20/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','application','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +do { + do { + $a = random(1,10,1); + $b = random(1,10,1); + $a1 = 1; + $b1 = -$a-2*$b; + $c1 = $a*$b; + $d1 = ($b1)**2-4*$a1*$c1; + } until ($d1>0); + $x1 = (-$b1+sqrt($d1))/(2*$a1); + $x2 = (-$b1-sqrt($d1))/(2*$a1); +} until ( ($x1==int($x1)) && ($x2==int($x2)) && ($x2>0) ); + +$commonD = Formula("$b*x*(x-$a)")->reduce; + +$ans1 = Compute($x1); +$ans2 = Compute($x1-$a); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +If both Pipe A and Pipe B are turned on, it would take [`[$b]`] hours to fill a tank. If each pipe is turned on alone, it takes Pipe B [`[$a]`] fewer hours than Pipe A to fill the tank. Answer the following questions: + +If only Pipe A is turned on, it would take [______]{$ans1} hours to fill the tank. + +If only Pipe B is turned on, it would take [______]{$ans2} hours to fill the tank. + +END_PGML + +############################################## + +$nab = -$a*$b; +$o = -$a-2*$b; + +############################################## + + +BEGIN_PGML_SOLUTION + +Let's understand how to use fractions to model work problems. Assume it takes a pipe [`5`] hours to fill a tank. If we treat the whole job as one whole, each hour, the pipe would fill [`\frac{1}{5}`] of the tank. + +Similarly, if it takes a pipe [`x`] hours to fill a tank, each hour, the pipe would fill [`\frac{1}{x}`] of the tank. + +Now we are ready to model this situation with math. + +Assume that it would take Pipe A [`x`] hours to fill the tank. Each hour, Pipe A fills [`\frac{1}{x}`] of the tank. + +Since it takes Pipe B [`[$a]`] fewer hours than Pipe A to fill the tank, it would take Pipe B [`x-[$a]`] hours to fill the tank (Pipe B is faster!). Each hour, Pipe B fills [`\frac{1}{x-[$a]}`] of the tank. + +It's given that, if both pipes are turned on, it would take [`[$b]`] hours to fill the tank. Each hour, they can fill [`\frac{1}{[$b]}`] of the tank. + +Now we can write an equation and solve it: + + [`` +\begin{aligned} + &\frac{1}{x}+\frac{1}{x-[$a]} = \frac{1}{[$b]} \\ + &\frac{1}{x} \cdot [$commonD] +\frac{1}{x-[$a]} \cdot [$commonD] = \frac{1}{[$b]} \cdot [$commonD] \\ + &[$b](x-[$a]) + [$b]x = x(x-[$a]) \\ + &[$b]x+[$nab] +[$b]x = x^{2}-[$a]x \\ + &[$b+$b]x+[$nab] = x^{2}-[$a]x \\ + & 0= x^{2}-[$a]x -[$b+$b]x -[$nab] \\ + & 0= x^{2}+[$o]x -[$nab] \\ + & 0= (x-[$x1])(x-[$x2]) \\ + &x-[$x1]=0 \:\: or\:\: x-[$x2]=0 \\ + &x=[$x1] \:\: or\:\: x=[$x2] +\end{aligned} + ``] + +In the second step, to get rid of all fractions, we multiplied each term with the common denominator [`[$commonD]`]. + +Since it takes Pipe B [`[$a]`] fewer hours than Pipe A to fill the tank, it would take Pipe B [`[$ans1]-[$a]=[$ans2]`] hours or [`[$x2]-[$a]=[$x2-$a]`] hours to fill the tank + +In this situation, [`[$x2-$a]`] is not a valid solution for Pipe B, since hours cannot be negative. [`x=[$x1]`] is the only solution. Therefore, it takes Pipe A [`[$ans1]`] hours and Pipe B [`[$ans2]`] hours to fill the tank. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication40.pg new file mode 100644 index 0000000000..73eec72d22 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication40.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# A speed/distance related application problem involving solving a rational equation. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','application','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +do { + do { + $a = random(200,1000,10); + $b = random(5,30,5); + $c = random(5,30,1); + $a1 = $c; + $b1 = $b*$c-$a-$a; + $c1 = -$a*$b; + $d1 = ($b1)**2-4*$a1*$c1; + } until ($d1>0); + $x1 = (-$b1+sqrt($d1))/(2*$a1); + $x2 = (-$b1-sqrt($d1))/(2*$a1); +} until ( ($x1==int($x1)) && ($x2==int($x2)) ); + +$commonD = Formula("x*(x+$b)")->reduce; + +$ans1 = Compute($x1); +$ans2 = Compute($x1+$b); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Town A and Town B are [`[$a]`] miles apart. A boat traveled from Town A to Town B, and then back to Town A. Since the river flows from Town B to Town A, the boat's speed was [`[$b]`] miles per hour faster when it traveled from Town B to Town A. The whole trip took [`[$c]`] hours. Answer the following questions: + +The boat traveled from Town A to Town B at the speed of [______]{$ans1} miles per hour. + +The boat traveled from Town B back to Town A at the speed of [______]{$ans2} miles per hour. + +END_PGML + +############################################## + +$s1 = -$b1; +$s2 = sqrt($d1); + +############################################## + + +BEGIN_PGML_SOLUTION + +Assume that the boat traveled from Town A to Town B at [`x`] miles per hour. + +Then, it traveled from Town B back to Town A at [`x+[$b]`] miles per hour. + +Using the formula [`time=\frac{distance}{speed}`], we know the boat traveled from Town A to Town B in [`\frac{[$a]}{x}`] hours; and it traveled back from Town B to Town A in [`\frac{[$a]}{x+[$b]}`] hours. + +It's given that the whole trip took [`[$c]`] hours, so we can write an equation and solve it: + + [`` +\begin{aligned} + &\frac{[$a]}{x}+\frac{[$a]}{x+[$b]} = [$c] \\ + &\frac{[$a]}{x} \cdot [$commonD] +\frac{[$a]}{x+[$b]} \cdot [$commonD] = [$c] \cdot [$commonD] \\ + &[$a](x+[$b]) + [$a]x = [$c]x(x+[$b]) \\ + &[$a]x+[$a*$b] +[$a]x = [$c]x^{2}+[$b*$c]x \\ + &[$a+$a]x+[$a*$b] = [$c]x^{2}+[$b*$c]x \\ + & 0= [$c]x^{2}+[$b*$c]x -[$a+$a]x -[$a*$b] \\ + & 0= [$c]x^{2}+[$b*$c-$a-$a]x -[$a*$b] +\end{aligned} + ``] + +When numbers are big, we use the quadratic formula to solve the quadratic equation: + + [`` +\begin{aligned} + x &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + x &= \frac{-([$b1]) \pm \sqrt{([$b1])^{2}-4 \cdot ([$a1]) \cdot ([$c1])}}{2 \cdot [$a1]} \\ + x &= \frac{[$s1] \pm \sqrt{[$d1]}}{[$a1+$a1]} \\ + x &= \frac{[$s1] \pm [$s2]}{[$a1+$a1]} \\ + x &= \frac{[$s1] + [$s2]}{[$a1+$a1]} \:\: or \:\: x= \frac{[$s1] - [$s2]}{[$a1+$a1]} \\ + x &= [$x1] \:\: or \:\: x= [$x2] +\end{aligned} + ``] + +In this situation, [`x=[$x2]`] is not a valid solution, since speed cannot be negative, [`x=[$x1]`] is the only solution. The boat traveled from Town A to Town B at the speed of [`[$ans1]`] miles per hour. + +The boat traveled from Town B back to Town A at the speed of [`[$ans1]+[$b]=[$ans2]`] miles per hour. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication44.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication44.pg new file mode 100644 index 0000000000..e313caedf8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication44.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# A speed/distance related application problem involving solving a rational equation. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','application','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +do { + $a = random(200,500,10); + $b = random(100,$a-10,10); + $c = random(5,30,1); + $ans = ($a*$c+$b*$c)/($a-$b); +} until ( ($ans*10 == int($ans*10)) && ($ans<40) ); + +$commonD = Formula("(x+$c)*(x-$c)")->reduce; + +@answers = $ans; + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A river flows at [`[$c]`] miles per hour. A boat traveled with the current from Town A to Town B, which are [`[$a]`] miles apart. Then, the boat turned around, and traveled against the current to reach Town C, which is [`[$b]`] miles away from Town B. The second leg of the trip (Town B to Town C) took the same time as the first leg (Town A to Town B). During this whole trip, the boat was driving at a constant still-water speed. Answer the following question: + +During this trip, the boat's speed on still water was [______]{$ans} miles per hour. + +END_PGML + +############################################## + + +############################################## + + +BEGIN_PGML_SOLUTION + +Assume that the boat's still-water speed was [`x`] miles per hour. + +Since the current's speed was [`[$c]`] miles per hour, the boat traveled from Town A to Town B (with the current) at [`x+[$c]`] miles per hour, and from Town B to Town C (against the current) at [`x-[$c]`] miles per hour. + +Using the formula [`\text{time}=\frac{\text{distance}}{\text{speed}}`], we know the boat traveled from Town A to Town B in [`\frac{[$a]}{x+[$c]}`] hours; and it traveled from Town B to Town C in [`\frac{[$b]}{x-[$c]}`] hours. + +It's given that those two legs took the same amount of time, so we can write an equation and solve it: + + [`` +\begin{aligned} + &\frac{[$a]}{x+[$c]}=\frac{[$b]}{x-[$c]}\\ + &\frac{[$a]}{x+[$c]} \cdot [$commonD] = \frac{[$b]}{x-[$c]} \cdot [$commonD] \\ + &[$a](x-[$c]) = [$b](x+[$c]) \\ + &[$a]x-[$a*$c] = [$b]x+[$b*$c] \\ + &[$a]x-[$b]x = [$b*$c]+[$a*$c] \\ + &[$a-$b]x = [$b*$c+$a*$c] \\ + & \frac{[$a-$b]x}{[$a-$b]} = \frac{[$b*$c+$a*$c]}{[$a-$b]} \\ + & x = [$ans] +\end{aligned} + ``] + +The boat's still-water speed was [`[$ans]`] miles per hour. +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication45.pg new file mode 100644 index 0000000000..248ed3314b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication45.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# A speed/distance related application problem involving solving a rational equation. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','application','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserMultiAnswer.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", + ); + +do { + do { + $a = random(50,200,10); + $b = random(50,200,10); + $c = random(5,10,1); + $d = random(2,20,1); + $a1 = $d; + $b1 = $a-$b+$c*$d; + $c1 = -$b*$c; + $d1 = ($b1)**2-4*$a1*$c1; + } until ($d1>0); + $x1 = (-$b1+sqrt($d1))/(2*$a1); + $x2 = (-$b1-sqrt($d1))/(2*$a1); +} until ( ($x1>10) && ($x1<30) && ($x2<1) && ($b1!=0) ); + +$commonD = Formula("x*(x+$c)")->reduce; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A river flows at [`[$c]`] miles per hour. A boat traveled with the current from Town A to Town B, which are [`[$a]`] miles apart. The boat stayed overnight at Town B. The next day, the water's current stopped, and boat traveled on still water to reach Town C, which is [`[$b]`] miles away from Town B. The second leg of the trip (Town B to Town C) took [`[$d]`] hours longer than the first leg (Town A to Town B). During this whole trip, the boat was driving at a constant still-water speed. Find this speed. + +Note that you should not consider the unreasonable answer. + +During this trip, the boat's speed on still water was [______]{$x1} miles per hour. + +END_PGML + +############################################## + +$s1 = -$b1; +$a12 = $a1*2; +$s2 = sqrt($d1); +$s2Show = int($s2*100+0.5)/100; +$x1Show = int($x1*100+0.5)/100; +$x2Show = int($x2*100+0.5)/100; +$bc = $b*$c; +$cd = $c*$d; + +BEGIN_PGML_SOLUTION + +Assume that the boat's still-water speed was [`x`] miles per hour. + +Since the current's speed was [`[$c]`] miles per hour when the boat traveled from Town A to Town B (with the current), the boat's actual speed was [`x+[$c]`] miles per hour. When the boat traveled from Town B to Town C (on still water), its actual speed was simply [`x`] miles per hour. + +Using the formula [`time=\frac{distance}{speed}`], we know the boat traveled from Town A to Town B in [`\frac{[$a]}{x+[$c]}`] hours; and it traveled from Town B to Town C in [`\frac{[$b]}{x}`] hours. + +It's given that the second leg of the trip took [`[$d]`] hours longer, so we can write an equation and solve it: + + [`` +\begin{aligned} + &\frac{[$a]}{x+[$c]}=\frac{[$b]}{x} - [$d] \\ + &\frac{[$a]}{x+[$c]} \cdot [$commonD] = \frac{[$b]}{x} \cdot [$commonD] - [$d] \cdot [$commonD] \\ + &[$a]x = [$b](x+[$c]) - [$d]x(x+[$c]) \\ + &[$a]x = [$b]x +[$bc] - [$d]x^2 -[$cd]x \\ + &[$d]x^2 +[$a]x -[$b]x +[$cd]x -[$bc] =0 \\ + &[$d]x^2 +[$b1]x +[$c1] =0 +\end{aligned} + ``] + +When numbers are big, we use the quadratic formula to solve the quadratic equation: + + [`` +\begin{aligned} + x &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + x &= \frac{-([$b1]) \pm \sqrt{([$b1])^{2}-4 \cdot ([$a1]) \cdot ([$c1])}}{2 \cdot [$a1]} \\ + x &= \frac{[$s1] \pm \sqrt{[$d1]}}{[$a12]} \\ + x &\approx \frac{[$s1] \pm [$s2Show]}{[$a12]} \\ + x &\approx \frac{[$s1] + [$s2Show]}{[$a12]} \:\: or \:\: x\approx \frac{[$s1] - [$s2Show]}{[$a12]} \\ + x &\approx [$x1Show] \:\: or \:\: x\approx [$x2Show] +\end{aligned} + ``] + +The negative solution, [`[$x2Show]`] does not make sense as a boat speed in context, so we don't consider this solution. The boat's still-water speed was [`[$x1Show]`] miles per hour. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication50.pg new file mode 100644 index 0000000000..9d5c7ce4ba --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication50.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# A speed/distance related application problem involving solving a rational equation. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','application','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +do { + do { + $a = random(3,20,1); + $b = random(200,1000,50); + $c = random(5,30,1); + $a1 = $c; + $b1 = -2*$b; + $c1 = -($a)**2*$c; + $d1 = ($b1)**2-4*$a1*$c1; + } until ($d1>0); + $x1 = (-$b1+sqrt($d1))/(2*$a1); + $x2 = (-$b1-sqrt($d1))/(2*$a1); +} until ( $x1==int($x1) ); + +$commonD = Formula("(x+$a)*(x-$a)")->reduce; + +$ans = Compute($x1); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Town A and Town B are [`[$b]`] miles apart. With a constant still-water speed, a boat traveled from Town A to Town B, and then back to Town A. During this whole trip, the river flew from Town A to Town B at [`[$a]`] miles per hour. The whole trip took [`[$c]`] hours. Answer the following question: + +During this trip, the boat's speed on still water was [______]{$ans} miles per hour. + +END_PGML + +############################################## + +$s1 = -$b1; +$s2 = sqrt($d1); + +############################################## + + +BEGIN_PGML_SOLUTION + +Assume that the boat's still-water speed was [`x`] miles per hour. + +Since the river flows from Town A to Town B at [`[$a]`] miles per hour, the boat traveled from Town A toTown B (along the current) at [`x+[$a]`] miles per hour, and then traveled back from Town B to Town A (against the current) at [`x-[$a]`] miles per hour. + +Using the formula [`time=\frac{distance}{speed}`], we know the boat traveled from Town A to Town B in [`\frac{[$b]}{x+[$a]}`] hours; and it traveled back from Town B to Town A in [`\frac{[$b]}{x-[$a]}`] hours. + +It's given that the whole trip took [`[$c]`] hours, so we can write an equation and solve it: + + [`` +\begin{aligned} + &\frac{[$b]}{x+[$a]}+\frac{[$b]}{x-[$a]} = [$c] \\ + &\frac{[$b]}{x+[$a]} \cdot [$commonD] +\frac{[$b]}{x-[$a]} \cdot [$commonD] = [$c] \cdot [$commonD] \\ + &[$b](x-[$a]) + [$b](x+[$a]) = [$c](x^{2}-[$a*$a]) \\ + &[$b]x-[$a*$b] +[$b]x+[$a*$b] = [$c]x^{2}-[$a*$a*$c] \\ + &[$b+$b]x = [$c]x^{2}-[$a*$a*$c] \\ + & 0= [$c]x^{2}-[$b+$b]x -[$a*$a*$c] +\end{aligned} + ``] + +When numbers are big, we use the quadratic formula to solve the quadratic equation: + + [`` +\begin{aligned} + x &= \frac{-b \pm \sqrt{b^{2}-4ac}}{2a} \\ + x &= \frac{-([$b1]) \pm \sqrt{([$b1])^{2}-4 \cdot ([$a1]) \cdot ([$c1])}}{2 \cdot [$a1]} \\ + x &= \frac{[$s1] \pm \sqrt{[$d1]}}{[$a1+$a1]} \\ + x &= \frac{[$s1] \pm [$s2]}{[$a1+$a1]} \\ + x &= \frac{[$s1] + [$s2]}{[$a1+$a1]} \:\: or \:\: x= \frac{[$s1] - [$s2]}{[$a1+$a1]} \\ + x &= [$x1] \:\: or \:\: x= [$x2] +\end{aligned} + ``] + +In this situation, [`x=[$x2]`] is not a valid solution, since speed cannot be negative. [`x=[$x1]`] is the only solution. + +During this trip, the boat's speed on still water was [`[$ans]`] miles per hour. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication60.pg new file mode 100644 index 0000000000..f6719e07a8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication60.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# A speed/distance related application problem involving solving a rational equation. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','application','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +do { + do { + $a = random(20,50,1); + $b = random(200,1000,50); + $c = random(5,30,1); + $rad = $a**2-2*$a*$b/$c; + } until ($rad>0); + $x1 = sqrt($rad); +} until ($x1==int($x1)) ; + $x2 = -$x1; + +$commonD = Formula("($a-x)*($a+x)")->reduce; + +$ans = Compute($x1); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Town A and Town B are [`[$b]`] miles apart. With a constant still-water speed of [`[$a]`] miles per hour, a boat traveled from Town A to Town B, and then back to Town A. During this whole trip, the river flew from Town B to Town A at a constant speed. The whole trip took [`[$c]`] hours. Answer the following question: + +During this trip, the river's speed was [______]{$ans} miles per hour. + +END_PGML + +############################################## + +$s1 = 2*$a*$b; + +############################################## + + +BEGIN_PGML_SOLUTION + +Assume the river's speed was [`x`] miles per hour. It's give that the boat's still-water speed was [`[$a]`] miles per hour. + +Since the river flows from Town B to Town A, the boat traveled from Town A to Town B (against the current) at [`[$a]-x`] miles per hour, and then traveled back from Town B to Town A (along the current) at [`[$a]+x`] miles per hour. + +Using the formula [`time=\frac{distance}{speed}`], we know the boat traveled from Town A to Town B in [`\frac{[$b]}{[$a]-x}`] hours; and it traveled back from Town B to Town A in [`\frac{[$b]}{[$a]+x}`] hours. + +It's given that the whole trip took [`[$c]`] hours, so we can write an equation and solve it: + + [`` +\begin{aligned} + &\frac{[$b]}{[$a]-x}+\frac{[$b]}{[$a]+x} = [$c] \\ + &\frac{[$b]}{[$a]-x} \cdot [$commonD] +\frac{[$b]}{[$a]+x} \cdot [$commonD] = [$c] \cdot [$commonD] \\ + &[$b]([$a]+x) + [$b]([$a]-x) = [$c]([$a*$a]-x^{2}) \\ + &[$b*$a]+[$b]x +[$b*$a]-[$b]x = [$c*$a*$a]-[$c]x^{2} \\ + &[$s1] = [$c*$a*$a]-[$c]x^{2} \\ + &[$c]x^{2} = [$c*$a*$a]-[$s1] \\ + &[$c]x^{2} = [$c*$a*$a-2*$b*$a] \\ + &x^{2} = \frac{[$c*$a*$a-2*$b*$a]}{[$c]} \\ + &x^{2} = [$rad] \\ + & x=\pm \sqrt{[$rad]} \\ + & x=\pm [$x1] +\end{aligned} + ``] + +In this situation, [`x=[$x2]`] is not a valid solution, since speed cannot be negative. [`x=[$x1]`] is the only solution. + +During this trip, the river's speed was [`[$ans]`] miles per hour. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations1.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations1.pg new file mode 100644 index 0000000000..ab55eaaf04 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations1.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Template: +# Solve the following rational equation +# +# a/x = b +# +# +# Last updated: Yao 07/01/16 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$b = non_zero_random(-10,10,1); +$x = non_zero_random(-10,10,1); +$a = $b*$x; +$commonD = Formula("$var"); + +$left = Formula("$a/$var"); +$right = Formula("$b")->reduce; + +$ans = Formula("{$x}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +To get rid of all fractions in this equation, we multiple all terms with the common denominator. In this equation, the common denominator is [`[$commonD]`]. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] \cdot [$var] &= [$right] \cdot [$var] \\ + [$a] &= [$b][$var] \\ + \frac{[$a]}{[$b]} &= \frac{[$b] [$var]}{[$b]} \\ + [$x] &= [$var] \\ + [$var] &= [$x] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. By the original equation, the domain condition is [`[$var] \ne 0`]. This doesn't conflict with the solution above, so the solution is [`[$var] = [$x]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations10.pg new file mode 100644 index 0000000000..be6f3caf86 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations10.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao, 2015 +# Portland Community College +# +# Template: +# Solve the equation. +# +# a/x = b + c/x +# +# +# Last updated: Yao 08/30/15 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + $c = random(2,6,1)*random(-1,1,2); + $x = non_zero_random(-6,6,1); + $a = random(1,9,1); + $b = $c*$x-$a; +} until ($b!=0); +$commonD = Formula("$var"); + +$left = Formula("$a/$var"); +$right = Formula("$c-$b/$var")->reduce; + +$ans = Formula("{$x}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + + + +$nb = -$b; +$s1 = ($b>0) ? "- \frac{$b}{$var}" : "+\frac{$nb}{$var}"; + +############################################## + +BEGIN_PGML_SOLUTION + +To get rid of all fractions in this equation, we multiple all terms with the common denominator. In this equation, the common denominator is [`[$commonD]`]. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \frac{[$a]}{[$var]} \cdot [$var] &= [$c] \cdot [$var] [$s1] \cdot [$var] \\ + [$a] &= [$c] [$var] -[$b] \\ + [$a] \mathbf{+[$b]} &= [$c] [$var] -[$b] \mathbf{+[$b]} \\ + [$a+$b] &= [$c] [$var] \\ + \frac{[$a+$b]}{[$c]} &= \frac{[$c] [$var]}{[$c]} \\ + [$x] &= [$var] \\ + [$var] &= [$x] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. By the original equation, the domain condition is [`[$var] \ne 0`]. This doesn't conflict with the solution above, so the solution is [`[$var] = [$x]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations2.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations2.pg new file mode 100644 index 0000000000..545a1e3589 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations2.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Template: +# Solve the following rational equation +# +# x/(x+a) = b +# +# +# Last updated: Yao 07/01/16 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + +do { + $a = non_zero_random(-5,5,1); + $b = random(3,20,1)*random(-1,1,2); +} until ($a*$b%(1-$b)==0); +$x = $a*$b/(1-$b); +$commonD = Formula("$var+$a")->reduce; + +$left = Formula("$var/($var+$a)")->reduce; +$right = Formula("$b")->reduce; + +$ans = Formula("{$x}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + + +$s1 = 1-$b; + +BEGIN_PGML_SOLUTION + +To get rid of all fractions in this equation, we multiple all terms with the common denominator. In this equation, the common denominator is [`[$commonD]`]. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] \cdot ([$commonD]) &= [$right] \cdot ([$commonD]) \\ + [$var] &= [$b][$var]+[$a*$b] \\ + [$var] \mathbf{-[$b][$var]} &= [$b][$var]+[$a*$b] \mathbf{-[$b][$var]} \\ + [$s1][$var] &= [$a*$b] \\ + \frac{[$s1][$var]}{[$s1]} &= \frac{[$a*$b]}{[$s1]} \\ + [$var] &= [$x] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. By the original equation, the domain condition is [`[$var]+[$a] \ne 0`], or [`[$var] \ne [$a*-1]`]. This doesn't conflict with the solution above, so the solution is [`[$var] = [$x]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations20.pg new file mode 100644 index 0000000000..8ecfc25238 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations20.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like a/bx + c/dx = e, answer is fraction. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','fraction','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## +Context("Fraction"); + +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); + +do { + $a = random(1,6,1); + $b = random(2,6,1); + $c = non_zero_random(-6,6,1); + $d = random(2,6,1); +} until ( (gcd($a,$b)==1) && (gcd($c,$d)==1) && (abs($b)!=abs($d)) ); + $e = non_zero_random(-6,6,1); + +$bd = $b*$d; +$commonD = Formula("$bd*$var")->reduce; + +########################################### +$s1 = Formula("$a/($b*$var)*$commonD+$c/($d*$var)*$commonD")->reduce; +$s2 = Formula("$e*$commonD"); + +$s3 = $d*$a; +$s4 = $b*$c; +$s5 = $b*$d*$e; +$s6 = "$s3+$s4"; +$s7 = Formula("$s5*$var")->reduce; + +$s8 = $s3+$s4; +################################################ + +$left = Formula("$a/($b*$var)+$c/($d*$var)")->reduce; +$right = Formula("$e")->reduce; + +$ad = $a*$d; +$bc = $b*$c; +$bde = $b*$d*$e; +$ans = Fraction($ad+$bc,$bde)->reduce; + + +Context("FiniteSolutionSets"); +Context()->variables->are($var => 'Real'); +$ans = Formula("{$ans}"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the equation. + + [`` [$left]=[$right] ``] + + [_______________________________]{$ans} + +END_PGML + +############################################## + + + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by a common denominator. For this problem, a common denominator is [`[$commonD]`]. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$s1] &= [$s2] \\ + [$s6] &= [$s7] \\ + [$s8] &= [$s7] \\ + \frac{[$s8]}{[$s5]} &= \frac{[$s7]}{[$s5]} \\ + [$ans] &= [$var] \\ + [$var] & = [$ans] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. By the original equation, the domain condition is [`[$var] \ne 0`]. This doesn't conflict with the solution above, so the solution is [`[$var] = [$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations25.pg new file mode 100644 index 0000000000..8403b3dd9f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations25.pg @@ -0,0 +1,133 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like x/( a(x+b) ) +c/(x+b) = d +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','fraction','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + +do { + $a = random(2,6,1); + $b = non_zero_random(-6,6,1); + $c = non_zero_random(-6,6,1); + $d = non_zero_random(-6,6,1); + $abd = $a*$b*$d; + $ac = $a*$c; + $ad = $a*$d; + $x= ($abd-$ac)/(1-$ad); +} until (($x==int($x)) && ($x!=0) && ($x!=-$b) ); + + +$commonD = Formula("$a*($var+$b)")->reduce; + +$ab = $a*$b; +$left = Formula("$var/($a*$var+$ab)+$c/($var+$b)")->reduce; +$right = Formula("$d")->reduce; + +$ans = Formula("{$x}"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the equation. + + [`` [$left]=[$right] ``] + + [_______________________________]{$ans} + +END_PGML + +############################################## +$ac = $a*$c; +$ad = $a*$d; +$p = 1-$ad; + +$s1 = Formula("$var/( $a*($var+$b) ) +$c/($var+$b)")->reduce; +$s2 = Formula("$var/( $a*($var+$b) )*$commonD +$c/($var+$b)*$commonD ")->reduce; +$s3 = Formula("$d*$commonD")->reduce; +$s4 = Formula("$var + $ac ")->reduce; +$s5 = Formula("$ad*$var+$abd")->reduce; +$s6 = Formula("$var-$ad*$var")->reduce; +$s7 = Formula("$abd-$ac"); +$s8 = Formula("$p*$var")->reduce; +$s9 = Formula("$abd-$ac")->reduce; + +$nb = -$b; +$nab = -$ab; + +############################################## + + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by a common denominator. For this problem, a common denominator is [`[$commonD]`]. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$s1] &= [$right] \\ + [$s2] &= [$s3] \\ + [$s4] &= [$s5] \\ + [$s6] &= [$s7] \\ + [$s8] &= [$s9] \\ + \frac{[$s8]}{[$p]} &= \frac{[$s9]}{[$p]} \\ + [$var] &= [$x] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. In the original equation, both denominators cannot be [`0`]. We set them to [`0`], so we can find out what values to exclude from the solution set. + + [`` +\begin{aligned} + &[$a][$var]+[$ab] = 0 &\;& [$var]+[$b]=0 \\ + &[$a][$var] = [$nab] &\;& [$var]=[$nb] \\ + &\frac{[$a][$var]}{[$a]} = \frac{[$nab]}{[$a]} \\ + &[$var] = [$nb] \\ +\end{aligned} + ``] + +We must exclude [`[$nb]`] from the solution set. This value is not in the solution set we got, so the final solution is [`[$var]=[$x]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations27.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations27.pg new file mode 100644 index 0000000000..266f47b739 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations27.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like a/(x+b) = c/(x-b) + d/(x+b)(x-b) +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','fraction','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + +do { + $a = non_zero_random(-6,6,1); + $b = non_zero_random(1,6,1); + do {$c = non_zero_random(-6,6,1);} until ($a!=$c); + $d = non_zero_random(-6,6,1); + $bc = $b*$c; + $ab = $a*$b; + $x= ($bc+$d+$ab)/($a-$c); +} until (($x==int($x)) && ($x!=0) && (abs($x)!=$b) ); + + +$commonD = Formula("($var+$b)*($var-$b)")->reduce; + +$b2 = $b**2; +$left = Formula("$a/($var+$b)")->reduce; +$right = Formula("$c/($var-$b)+$d/($var**2-$b2)")->reduce; + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$x}"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the equation. + + [`` [$left]=[$right] ``] + + [_______________________________]{$ans} + +END_PGML + +############################################## + +$s1 = Formula("$c/($var-$b)+$d/( ($var+$b)($var-$b) )")->reduce; +$s2 = Formula("$a/($var+$b)*$commonD")->reduce; +$s3 = Formula("$c/($var-$b)*$commonD+$d/( ($var+$b)($var-$b) )*$commonD")->reduce; +$s4 = Formula("$a*($var-$b)")->reduce; +$s5 = Formula("$c*($var+$b)+$d")->reduce; +$s6 = Formula("$a*$var-$ab")->reduce; +$s7 = Formula("$c*$var+$bc+$d")->reduce; + +$aMinusC = $a-$c; +$p = $bc+$d+$ab; +$s8 = Formula("$aMinusC*$var")->reduce; +$s9 = Formula("$p"); + +if ($aMinusC == 1) { + $s10 = ""; +} elsif ($aMinusC == -1) { + $s10 = "(-1) \cdot (-$var) &= (-1) \cdot ($p) \\"; +} else { + $s10 = "\frac{$aMinusC $var}{$aMinusC} &= \frac{$p}{$aMinusC} \\"; +} +$nb = -$b; + +############################################## + + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by a common denominator. For this problem, a common denominator is [`[$commonD]`]. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] &= [$s1] \\ + [$s2] &= [$s3] \\ + [$s4] &= [$s5] \\ + [$s6] &= [$s7] \\ + [$s6] \mathbf{ -[$c][$var] +[$ab]} &= [$s7] \mathbf{ -[$c][$var] +[$ab]} \\ + [$s8] &= [$s9] \\ + [$s10] + [$var] &= [$x] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. In the original equation, both denominators cannot be [`0`]. We set them to [`0`], so we can find out what values to exclude from the solution set. + + [`` +\begin{aligned} + &[$var]^{2}-[$b2] = 0 &\;& [$var]+[$b]=0 &\;& [$var]-[$b]=0 \\ + &([$var]+[$b])([$var]-[$b]) = 0 &\;& [$var]=[$nb] &\;& [$var]=[$b] \\ + &[$var]+[$b]=0 \:\: or \:\: [$var]-[$b]=0 \\ + &[$var]=[$nb] \:\: or \:\: [$var]=[$b] \\ +\end{aligned} + ``] + +We must exclude [`[$nb]`] and [`[$b]`] from the solution set. These values are not in the solution set we got, so the final solution is [`[$var]=[$x]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations28.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations28.pg new file mode 100644 index 0000000000..96a396c13c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations28.pg @@ -0,0 +1,137 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like a/(x+b)+c/(x+d)=e/( (x+c)(x+d) ) +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + +do { + $a = non_zero_random(1,9,1); + $b = non_zero_random(-9,9,1); + do {$c = non_zero_random(-9,9,1);} until (($a+$c) !=0); + do {$d = non_zero_random(-9,9,1);} until (abs($b)!=abs($d)); + $e = non_zero_random(-9,9,1); + $ad = $a*$d; + $bc = $b*$c; + $x= ($e-$ad-$bc)/($a+$c); +} until (($x==int($x)) && ($x!=0) && (-$x!=$b) && (-$x!=$d) ); + + +$commonD = Formula("($var+$b)*($var+$d)")->reduce; + +$left = Formula("$a/($var+$b)+$c/($var+$d)")->reduce; +$bPlusD = $b+$d; +$bd = $b*$d; +$right = Formula("$e/( $var**2+$bPlusD*$var+$bd )")->reduce; + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$x}"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the equation. + + [`` [$left]=[$right] ``] + + [_______________________________]{$ans} + +END_PGML + +############################################## + +$s1 = Formula("$e/( ($var+$b)($var+$d) )")->reduce; +$s2 = Formula("$a/($var+$b)*$commonD + $c/($var+$d)*$commonD")->reduce; +$s3 = Formula("$e/( ($var+$b)($var+$d) )*$commonD")->reduce; +$s4 = Formula("$a*($var+$d) + $c*($var+$b)")->reduce; +$s5 = Formula("$e")->reduce; +$s6 = Formula("$a*$var+$ad + $c*$var+$bc")->reduce; +$aPlusC = $a+$c; +$o = $ad+$bc; +$s7 = Formula("$aPlusC*$var+$o")->reduce; +$s8 = Formula("$aPlusC*$var")->reduce; +$s9 = $e-$o;; + +if ($aPlusC==1) { + $s10 = ""; + $s11 = ""; +} elsif ($aPlusC==-1) { + $s10 = "(-1) \cdot (-$var) &= (-1) \cdot ($s9) \\"; + $s11 = "$var &= $x"; +} else { + $s10 = "\frac{$aPlusC $var}{$aPlusC} &= \frac{$s9}{$aPlusC} \\"; + $s11 = "$var &= $x"; +} + +$nb = -$b; +$nd = -$d; + +############################################## + + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by a common denominator. For this problem, a common denominator is [`[$commonD]`]. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] &= [$s1] \\ + [$s2] &= [$s3] \\ + [$s4] &= [$s5] \\ + [$s6] &= [$s5] \\ + [$s7] &= [$s5] \\ + [$s8] &= [$s9] \\ + [$s10] + [$s11] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. In the original equation, both denominators cannot be [`0`]. We set them to [`0`], so we can find out what values to exclude from the solution set. + +For this example, it's easy to see we must exclude [`[$nb]`] and [`[$nd]`] from the solution set. These values are not in the solution set we got, so the final solution is [`[$var]=[$x]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations3.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations3.pg new file mode 100644 index 0000000000..219da801e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations3.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Template: +# Solve the equation. +# +# (x+a)/(x+b) = 2/3 +# +# +# Last updated: Yao 07/01/16 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + +do { + $x = non_zero_random(-10,10,1); + do {$a = non_zero_random(-10,10,1);} until ($a!=-$x); + $b = random(2,5,1); + do {$c = non_zero_random(-10,10,1);} until (gcd(abs($c),$b)==1); + $factor = gcd(abs($x+$a),abs($b*$x+$c)); + $sign = (($x+$a)/($b*$x+$c)>0) ? 'positive' : 'negative'; + $d = ($sign eq 'positive') ? abs($x+$a)/$factor : -abs($x+$a)/$factor; + $e = abs($b*$x+$c)/$factor; +} until ( ($factor != 1) && ($e!=1) && (($e-$b*$d)!=1) ); + +$commonD = Formula("$e*($b*$var+$c)")->reduce; + +$left = Formula("($var+$a)/($b*$var+$c)")->reduce; +$nD = -$d; +$right = ($d>0) ? "\frac{$d}{$e}" : "-\frac{$nD}{$e}"; + +$ans = Formula("{$x}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + + + +$s1=$e*$a; +$s2 = $d*$b; +$s3 = $d*$c; +$s4 = $e-$s2; +$s5 = $s3-$s1; + +$nC = abs($c); +$s6 = (-$c/$b>0) ? "\frac{$nC}{$b}" : "-\frac{$nC}{$b}"; + +BEGIN_PGML_SOLUTION + +To get rid of all fractions in this equation, we multiple all terms with the common denominator. In this equation, the common denominator is [`[$commonD]`]. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] \cdot [$commonD] &= [$right] \cdot [$commonD] \\ + [$e]([$var]+[$a]) &= [$d]([$b][$var]+[$c]) \\ + [$e][$var]+[$s1] &= [$s2][$var]+[$s3] \\ + [$e][$var]+[$s1] \mathbf{-[$s2][$var]-[$s1]} &= [$s2][$var]+[$s3] \mathbf{-[$s2][$var]-[$s1]} \\ + [$s4][$var] &= [$s5] \\ + \frac{[$s4][$var]}{[$s4]} &= \frac{[$s5]}{[$s4]} \\ + [$var] &= [$x] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. By the original equation, the domain condition is [`[$commonD] \ne 0`], or [`[$var] \ne [$s6]`]. This doesn't conflict with the solution above, so the solution is [`[$var] = [$x]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations30.pg new file mode 100644 index 0000000000..80adc29f18 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations30.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao, 2015 +# Portland Community College +# +# Template: +# Solve the equation. +# +# (x+a)/(x^2+1)=0 +# +# +# Last updated: Yao 08/30/15 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-9,9,1); +$b = random(1,9,1); +#$commonD = Formula("$var"); + +$left = Formula("($var+$a)/($var**2+$b)")->reduce; +$right = 0; + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$na = -$a; +$ans = Formula("{$na}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$na = -$a; + +############################################## + +BEGIN_PGML_SOLUTION + +If a fraction's value is [`0`], like [`\frac{x}{y}=0`], then we can tell the numerator's value must be [`0`], or [`x=0`] in this example. + +The solution is: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$var]+[$a] &=0 \\ + [$var] &= [$na] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. In the denominator [`[$var]^2+[$b]`], since [`[$var]^2 \ge 0`], we have [`[$var]^2+[$b] \gt 0`]. In other words, the denominator's value cannot be [`0`], so there is no domain constraints for this equation. The solution is [`[$var] = [$na]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations4.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations4.pg new file mode 100644 index 0000000000..4ab9b0a458 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations4.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao, 2016 +# Portland Community College +# +# Template: +# Solve the equation. +# +# (ax+b)/(x+d) = ax/(x+e) +# +# +# Last updated: Yao 07/04/16 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + do { + $a = non_zero_random(-10,10,1); + do {$b = non_zero_random(-10,10,1);} until (gcd($a,$b)==1); + $c = non_zero_random(-10,10,1); + do {$e = non_zero_random(-10,10,1);} until ($c!=$e); + } until ($a*$c-$a*$e-$b != 0); + $x = $b*$e/($a*$c-$a*$e-$b); +} until ( $x==int($x) && ($x!=-$c) && ($x!=-$e) ); + +$commonD = Formula("($var+$c)*($var+$e)")->reduce; + +$left = Formula("($a*$var+$b)/($var+$c)")->reduce; +$right = Formula("($a*$var)/($var+$e)")->reduce; + +$ans = Formula("{$x}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + +Context("Numeric"); +Context()->variables->are($var=>'Real'); + + +$s1 = Compute("($a*$var+$b)*($var+$e)")->reduce; +$s2 = Compute("$a*$var*($var+$c)")->reduce; +$s3 = Compute("$a*$var**2+$a*$e*$var+$b*$var+$b*$e")->reduce; +$s4 = Compute("$a*$var**2+$a*$c*$var")->reduce; +$s5 = -($a*$c-$a*$e-$b); +$s6 = -$b*$e; + +BEGIN_PGML_SOLUTION + +To get rid of all fractions in this equation, we multiple all terms with the common denominator. In this equation, the common denominator is [`[$commonD]`]. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] \cdot [$commonD] &= [$right] \cdot [$commonD] \\ + [$s1] &= [$s2] \\ + [$s3] &= [$s4] \\ + [$s5][$var] &= [$s6] \\ + [$var] &= [$x] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. By the original equation, the domain condition is [`[$commonD] \ne 0`], which is equivalent to [`[$var] \ne [$c*-1]`] and [`[$var] \ne [$e*-1]`]. This doesn't conflict with the solution above, so the solution is [`[$var] = [$x]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations40.pg new file mode 100644 index 0000000000..47344ca0c4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations40.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Carl Yao, 2015 +# Portland Community College +# +# Template: +# Solve the equation. +# +# a/x=0 +# +# +# Last updated: Yao 08/30/15 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-9,9,1); + +$left = Formula("$a/$var")->reduce; +$right = 0; + +$ans = Formula("no solution"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + + + +############################################## + +BEGIN_PGML_SOLUTION + +If a fraction's value is [`0`], like [`\frac{x}{y}=0`], then we can tell the numerator's value must be [`0`], or [`x=0`] in this example. + +For this equation, [` [$left] = [$right] `], since the numerator's value is never [`0`], there is no solution. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations50.pg new file mode 100644 index 0000000000..b28dd3adb1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations50.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao, 2015 +# Portland Community College +# +# Template: +# Solve the equation. +# +# (x+1)/(x^2-1)=0 +# +# +# Last updated: Yao 08/30/15 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-9,9,1); +do {$b = non_zero_random(-9,9,1);} until ($a!=$b); + +$aPlusB = $a+$b; +$ab = $a*$b; + +$den = Formula("$var**2+$aPlusB*$var+$ab")->reduce; +$denFactored = Formula("($var+$a)*($var+$b)")->reduce; +$left = Formula("($var+$a)/$den")->reduce; +$right = 0; + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Compute("no solution"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$na = -$a; +$nb = -$b; + +############################################## + +BEGIN_PGML_SOLUTION + +If a fraction's value is [`0`], like [`\frac{x}{y}=0`], then we can tell the numerator's value must be [`0`], or [`x=0`] in this example. + +We apply the same rule for this question: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$var]+[$a] &=0 \\ + [$var] &= [$na] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. Since the denominator cannot be [`0`], we set the denominator to [`0`] and solve for [`[$var]`]. Those are the values we must exclude from the solutions. + + [`` +\begin{aligned} + &[$den] =0 \\ + &[$denFactored] = 0 \\ + &[$var] + [$a]=0 \:\: or \:\: [$var] + [$b]=0 \\ + &[$var] = [$na] \:\: or \:\: [$var] = [$nb] +\end{aligned} + ``] + +The values [`[$na]`] and [`[$nb]`] must be excluded from the solution. + +The solution we got was [`[$var] = [$na]`]. Since we have to exclude it from the solution set, there is no solution for this equation. + + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations55.pg new file mode 100644 index 0000000000..ded6d9761f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations55.pg @@ -0,0 +1,204 @@ +# WeBWorK problem written by Carl Yao, 2015 +# Portland Community College +# +# Template: +# Solve the equation. +# +# a/x+b/(x+c)=d +# +# There are two solutions. +# +# Last updated: Yao 09/08/15 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0); +Context()->noreduce('(-x)-y','(-x)+y'); + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +do { + do { + $a = non_zero_random(-9,9,1); + $b = non_zero_random(-9,9,1); + $c = non_zero_random(-9,9,1); + do {$d = non_zero_random(-9,9,1);} until ( (gcd(abs($d),abs($a))==1) || (gcd(abs($d),abs($b))==1) ); + $a1 = $d; + $b1 = $c*$d-$a-$b; + $c1 = -$a*$c; + $d1 = ($b1)**2-4*$a1*$c1; + } until ( ($d1>0) && (gcd(gcd(abs($a1),abs($b1)),abs($c1))==1) ); + $x2 = ( sqrt($d1)==int(sqrt($d1))) ? Fraction(-$b1+sqrt($d1),(2*$a1))->reduce : -100; + $x1 = ( sqrt($d1)==int(sqrt($d1))) ? Fraction(-$b1-sqrt($d1),(2*$a1))->reduce : -100; +} until ( (sqrt($d1)==int(sqrt($d1))) && ($x1!=$x2)); + +($numX1,$denX1) = $x1->value; +($numX2,$denX2) = $x2->value; + +$commonD = Formula("$var*($var+$c)")->reduce; +$left = Formula("$a/$var+$b/($var+$c)")->reduce; +$right = $d; + +$mycontext=Context(); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$x2,$x1}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + +Context($mycontext); +if ($d<0) { +$s1 = Formula("$a/$var*$commonD+$b/($var+$c)*$commonD")->reduce; +$s2 = Formula("$d*$commonD")->reduce; +$s3 = Formula("$a*($var+$c)+$b*$var")->reduce; +$cd = $c*$d; +$s4 = Formula("$d*$var**2+$cd*$var")->reduce; +$ac = $a*$c; +$s5 = Formula("$a*$var+$ac+$b*$var")->reduce; +$aPlusB = $a+$b; +$s6 = Formula("$aPlusB*$var+$ac")->reduce; +$s7 = Formula("$aPlusB*$var+$ac-$d*$var**2-$cd*$var")->reduce; +$o = $aPlusB-$cd; +$s8 = Formula("-$d*$var**2+$o*$var+$ac")->reduce; +$s9 = Formula("$denX1*$var-$numX1")->reduce; +$s10 = Formula("$denX2*$var-$numX2")->reduce; + +$nc = -$c; + +############################################## + +BEGIN_PGML_SOLUTION + +To get rid of fractions, we multiply each term in this equation by the common denominator, which is [`[$commonD]`] in this example. + + [`` +\begin{aligned} + &[$left] = [$right] \\ + &[$s1] =[$s2] \\ + &[$s3] = [$s4] \\ + &[$s5] = [$s4] \\ + &[$s6] = [$s4] \\ + &[$s7] = 0 \\ + &[$s8] = 0 \\ + &([$s9])([$s10])=0 \\ + &[$s9]=0 \:\: or\:\: [$s10]=0 \\ + &[$var]=[$x1] \:\: or\:\: [$var]=[$x2] +\end{aligned} + ``] + +*Checking* + +We must check solutions when we solve rational equations. In the original equation, both denominators cannot be [`0`]. We set them to [`0`], so we can find out what values to exclude from the solution set. + + [`` +\begin{aligned} + &[$var] = 0 &\;& [$var]+[$c]=0 \\ + &[$var]=0 &\;& [$var]=[$nc] +\end{aligned} + ``] + +We must exclude [`0`] and [`[$nc]`] from the solution set. There is no conflict with those two solutions we got, so the final solution is [`[$var]=[$x1]`] and [`[$var]=[$x2]`]. + +END_PGML_SOLUTION +} else { +$s1 = Formula("$a/$var*$commonD+$b/($var+$c)*$commonD")->reduce; +$s2 = Formula("$d*$commonD")->reduce; +$s3 = Formula("$a*($var+$c)+$b*$var")->reduce; +$cd = $c*$d; +$s4 = Formula("$d*$var**2+$cd*$var")->reduce; +$ac = $a*$c; +$s5 = Formula("$a*$var+$ac+$b*$var")->reduce; +$aPlusB = $a+$b; +$s6 = Formula("$aPlusB*$var+$ac")->reduce; +$s7 = Formula("$aPlusB*$var+$ac-$d*$var**2-$cd*$var")->reduce; +$o = $aPlusB-$cd; +$s8 = Formula("-$d*$var**2+$o*$var+$ac")->reduce; +$s85 = Formula("$d*$var**2-$o*$var-$ac")->reduce; +$s9 = Formula("$denX1*$var-$numX1")->reduce; +$s10 = Formula("$denX2*$var-$numX2")->reduce; + +$nc = -$c; + +############################################## + +BEGIN_PGML_SOLUTION + +To get rid of fractions, we multiply each term in this equation by the common denominator, which is [`[$commonD]`] in this example. + + [`` +\begin{aligned} + &[$left] = [$right] \\ + &[$s1] =[$s2] \\ + &[$s3] = [$s4] \\ + &[$s5] = [$s4] \\ + &[$s6] = [$s4] \\ + &[$s7] = 0 \\ + &[$s8] = 0 \\ + &-([$s85])=0 \\ + &-([$s9])([$s10])=0 \\ + &[$s9]=0 \:\: or\:\: [$s10]=0 \\ + &[$var]=[$x1] \:\: or\:\: [$var]=[$x2] +\end{aligned} + ``] + +*Checking* + +We must check solutions when we solve rational equations. In the original equation, both denominators cannot be [`0`]. We set them to [`0`], so we can find out what values to exclude from the solution set. + + [`` +\begin{aligned} + &[$var] = 0 &\;& [$var]+[$c]=0 \\ + &[$var]=0 &\;& [$var]=[$nc] +\end{aligned} + ``] + +We must exclude [`0`] and [`[$nc]`] from the solution set. There is no conflict with those two solutions we got, so the final solution is [`[$var]=[$x1]`] and [`[$var]=[$x2]`]. + +END_PGML_SOLUTION +} + + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations60.pg new file mode 100644 index 0000000000..2f35f3442a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations60.pg @@ -0,0 +1,196 @@ +# WeBWorK problem written by Carl Yao, 2015 +# Portland Community College +# +# Template: +# Solve the equation. +# +# 1/(x+a) + a/(x^2+ax) = -1/b +# +# There is an extraneous solution. +# +# Last updated: Yao 08/30/15 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation','extraneous') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-9,9,1); +$na = -$a; +$absA = abs($a); +do {$b = non_zero_random(2,9,1)*random(-1,1,2);} until ($a!=$b); +$nb = -$b; +$absB = abs($b); +$commonD = Formula("$absB*$var*($var+$a)")->reduce; + +$ab = $a*$b; +$left = Formula("1/($var+$a)+$a/($var**2+$a*$var)")->reduce; +if ($b==1) { + $right = -1; +} elsif ($b==-1) { + $right = 1; +} else { + $right = ($b>0) ? "-\frac{1}{$b}" : "\frac{1}{$absB}"; +} + +$mycontext=Context(); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{-$b}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## +Context($mycontext); +$s1 = Formula("1/($var+$a)+$a/( $var*($var+$a) )")->reduce; +$s2 = Formula("1/($var+$a)*$commonD+$a/( $var*($var+$a) )*$commonD")->reduce; + +if ($b==1) { + $commonDString = ($a>0) ? "$var ($var+$a)" : "$var ($var-$na)"; +} elsif ($b==-1) { + $commonDString = ($a>0) ? "-$var ($var+$a)" : "-$var ($var-$na)"; +} else { + $commonDString = ($a>0) ? "$absB $var ($var+$a)" : "$absB $var ($var-$na)"; +} + +if ($b>0) { + $s3 = ($b==1) ? "-1 \cdot $commonDString" : "-\frac{1}{$b} \cdot $commonDString"; +} else { + $s3 = ($b==-1) ? "1 \cdot $commonDString" : "\frac{1}{$absB} \cdot $commonDString"; +} + +$aPlusB = $a+$b; +if ($b>0) { + $s4 = Formula("$b*$var+$ab")->reduce; + $s5 = Formula("-$var**2-$a*$var")->reduce; + $s6 = Formula("$b*$var+$ab+$var**2+$a*$var")->reduce; + $s7 = Formula("$var**2+$aPlusB*$var+$ab")->reduce; + $s8 = Formula("($var+$a)($var+$b)")->reduce; +} else { + $s4 = Formula("$absB*$var-$ab")->reduce; + $s5 = Formula("$var**2+$a*$var")->reduce; + $s6 = Formula("$absB*$var-$ab-$var**2-$a*$var")->reduce; + $s65 = Formula("-$var**2-$aPlusB*$var-$ab")->reduce; + $s66 = Formula("(-1)*$s65"); + $s7 = Formula("$var**2+$aPlusB*$var+$ab")->reduce; + $s8 = Formula("($var+$a)($var+$b)")->reduce; +} + +############################################## +if ($b>0) { + +BEGIN_PGML_SOLUTION + +To get rid of fractions, we multiply each term in this equation by the common denominator, which is [`[$commonD]`] in this example. + + [`` +\begin{aligned} + &[$left] = [$right] \\ + &[$s1] =[$right] \\ + &[$s2] = [$s3] \\ + &[$s4] = [$s5] \\ + &[$s6] = 0 \\ + &[$s7] = 0 \\ + &[$s8] = 0 \\ + &[$var]+[$a]=0 \:\: or\:\: [$var]+[$b]=0 \\ + &[$var]=[$na] \:\: or\:\: [$var]=[$nb] +\end{aligned} + ``] + +*Checking* + +We must check solutions when we solve rational equations. In the original equation, both denominators cannot be [`0`]. We set them to [`0`], so we can find out what values to exclude from the solution set. + + [`` +\begin{aligned} + &[$var]^2+[$a][$var] = 0 &\;& [$var]+[$a]=0 \\ + &[$var]([$var]+[$a]) =0 &\;& [$var]=[$na] \\ + &[$var]=0 \:\:or\:\: [$var]+[$a]=0 \\ + &[$var]=0 \:\:or\:\: [$var]=[$na] +\end{aligned} + ``] + +We must exclude [`0`] and [`[$na]`] from the solution set. We can see [`[$var]=[$na]`] is an extraneous solution, so the final solution is [`[$var]=[$nb]`]. + +END_PGML_SOLUTION + +} else { + +BEGIN_PGML_SOLUTION + +To get rid of fractions, we multiply each term in this equation by the common denominator, which is [`[$commonD]`] in this example. + + [`` +\begin{aligned} + &[$left] = [$right] \\ + &[$s1] =[$right] \\ + &[$s2] = [$s3] \\ + &[$s4] = [$s5] \\ + &[$s6] = 0 \\ + &[$s65] = 0 \\ + &[$s66] = (-1) \cdot 0 \\ + &[$s7] = 0 \\ + &[$s8] = 0 \\ + &[$var]+[$a]=0 \:\: or\:\: [$var]+[$b]=0 \\ + &[$var]=[$na] \:\: or\:\: [$var]=[$nb] +\end{aligned} + ``] + +*Checking* + +We must check solutions when we solve rational equations. In the original equation, both denominators cannot be [`0`]. We set them to [`0`], so we can find out what values to exclude from the solution set. + + [`` +\begin{aligned} + &[$var]^2+[$a][$var] = 0 &\;& [$var]+[$a]=0 \\ + &[$var]([$var]+[$a]) =0 &\;& [$var]=[$na] \\ + &[$var]=0 \:\:or\:\: [$var]+[$a]=0 \\ + &[$var]=0 \:\:or\:\: [$var]=[$na] +\end{aligned} + ``] + +We must exclude [`0`] and [`[$na]`] from the solution set. We can see [`[$var]=[$na]`] is an extraneous solution, so the final solution is [`[$var]=[$nb]`]. + +END_PGML_SOLUTION + +} + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations61.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations61.pg new file mode 100644 index 0000000000..4e9928644d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations61.pg @@ -0,0 +1,169 @@ +# WeBWorK problem written by Carl Yao, 2015 +# Portland Community College +# +# Template: +# Solve the equation. +# +# 1/(x+a) + a/(x^2+ax) = -1/b +# +# +# Last updated: Yao 08/30/15 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0); +Context()->noreduce('(-x)-y','(-x)+y'); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + "no solution"=>{alias=>'no real solutions'}, + "no solutions"=>{alias=>'no real solutions'}, + ); + +do { + do { + $a = non_zero_random(-9,9,1); + $b = non_zero_random(-9,9,1); + $c = non_zero_random(2,9,1); + $a1 = 1; + $b1 = $a-$c; + $c1 = -$b*$c; + $d1 = ($b1)**2-4*$a1*$c1; + } until ($d1>0); + $x1 = ( sqrt($d1)==int(sqrt($d1))) ? Fraction(-$b1+sqrt($d1),(2*$a1))->reduce : -100; + $x2 = ( sqrt($d1)==int(sqrt($d1))) ? Fraction(-$b1-sqrt($d1),(2*$a1))->reduce : -100; +} until ( (sqrt($d1)==int(sqrt($d1))) && ($x1!=$x2) && ($x1!=0) && ($x2!=0) && ($x1!=-$a) && ($x2!=-$a) ); + +($numX1,$denX1) = $x1->value; +($numX2,$denX2) = $x2->value; + +$nc = -$c; +$left = Formula("1/($var+$a)+$b/($var**2+$a*$var)")->reduce; +$right = Fraction(1,$c)->reduce; +$absC = abs($c); +$commonD = Formula("$absC*$var*($var+$a)")->reduce; + +$mycontext=Context(); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$x1, $x2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## +Context($mycontext); +$s1 = Formula("1/($var+$a)+$b/( $var($var+$a) )")->reduce; +$s2 = Formula("1/($var+$a)*$commonD+$b/( $var($var+$a) )*$commonD")->reduce; +$s3 = Formula("1/$c*$commonD")->reduce; +$s4 = Formula("$c*$var+$b*$c")->reduce; +$s5 = Formula("$var*($var+$a)")->reduce; +$bc = $b*$c; +$s6 = Formula("$c*$var+$bc")->reduce; +$s7 = Formula("$var**2+$a*$var")->reduce; +$s8 = Formula("$c*$var+$bc-$var**2-$a*$var")->reduce; +$o = $c-$a; +$s9 = Formula("-$var**2+$o*$var+$bc")->reduce; +$s10 = Formula("-($var**2-$o*$var-$bc)")->reduce; +$s11 = Formula("$denX1*$var-$numX1")->reduce; +$s12 = Formula("$denX2*$var-$numX2")->reduce; + +$na = -$a; + +############################################## + +BEGIN_PGML_SOLUTION + +To get rid of fractions, we multiply each term in this equation by the common denominator, which is [`[$commonD]`] in this example. + + [`` +\begin{aligned} + &[$left] = [$right] \\ + &[$s1] =[$right] \\ + &[$s2] = [$s3] \\ + &[$s4] = [$s5] \\ + &[$s6] = [$s7] \\ + &[$s8] = 0 \\ + &[$s9] = 0 \\ + &[$s10] = 0 \\ + &-([$s11])([$s12]) =0 \\ + &[$s11]=0 \:\: or\:\: [$s12]=0 \\ + &[$var]=[$x1] \:\: or\:\: [$var]=[$x2] +\end{aligned} + ``] + +*Checking* + +We must check solutions when we solve rational equations. In the original equation, both denominators cannot be [`0`]. We set them to [`0`], so we can find out what values to exclude from the solution set. + + [`` +\begin{aligned} + &[$var]^2+[$a][$var] = 0 &\;& [$var]+[$a]=0 \\ + &[$var]([$var]+[$a]) =0 &\;& [$var]=[$na] \\ + &[$var]=0 \:\:or\:\: [$var]+[$a]=0 \\ + &[$var]=0 \:\:or\:\: [$var]=[$na] +\end{aligned} + ``] + +We must exclude [`0`] and [`[$na]`] from the solution set. There is no conflict with those two solutions we got earlier, so the final solution are [`[$var]=[$x1]`] and [`[$var]=[$x2]`]. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations65.pg new file mode 100644 index 0000000000..cd3ae6acea --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations65.pg @@ -0,0 +1,153 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like a/(x+b)+cx/(x+d)=e/( (x+c)(x+d) ) +# +# There is an extraneous solution. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','rational','extraneous') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", +# "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + +do { + $a = non_zero_random(-9,9,1); + $b = non_zero_random(-9,9,1); + $c = non_zero_random(2,9,1); + do {$d = non_zero_random(-9,9,1);} until ($b!=$d); + $e = non_zero_random(-9,9,1); + $a1 = $c; + $b1 = $a+$b*$c; + $c1 = $a*$d-$e; + $d1 = ($b1)**2-4*$a1*$c1; + $x1 = ($d1>0) ? (-$b1+sqrt($d1))/(2*$a1) : -100; + $x2 = ($d1>0) ? (-$b1-sqrt($d1))/(2*$a1) : -100; +} until ( (-$b==$x1) && (-$d!=$x2) && (int($x2)==$x2) && ($x1!=$x2) ); + +$commonD = Formula("($var+$b)($var+$d)")->reduce; +$left = Formula("$a/($var+$b)+$c*$var/($var+$d)")->reduce; +$bPlusD = $b+$d; +$bd = $b*$d; +$right = Formula("$e/($var**2+$bPlusD*$var+$bd)")->reduce; + +$mycontext=Context(); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$x2}"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the equation. + + [`` [$left]=[$right] ``] + + [_______________________________]{$ans} + +END_PGML + +############################################## +Context($mycontext); +$s1 = Formula("$e/( ($var+$b)($var+$d) )")->reduce; +$s2 = Formula("$a/($var+$b)*$commonD+$c*$var/($var+$d)*$commonD")->reduce; +$s3 = Formula("$e/( ($var+$b)($var+$d) )*$commonD")->reduce; +$ad = $a*$d; +$bc = $b*$c; +$s4 = Formula("$a*($var+$d)+$c*$var*($var+$b)")->reduce; +$s5 = $e; +$s6 = Formula("$a*$var+$ad+$c*$var**2+$bc*$var")->reduce; +$o = $a+$bc; +$s7 = Formula("$c*$var**2+$o*$var+$ad")->reduce; +$p = $ad-$e; +$s8 = Formula("$c*$var**2+$o*$var+$p")->reduce; +$q = $o/$c; +$r = $p/$c; +$s9 = Formula("$c*($var**2+$q*$var+$r)")->reduce; +$nb = -$b; + +if ($x2==0) { + $s10 = Formula("$c*$var*($var+$b)")->reduce; + $s11 = "$var=0 \:\: or \:\: $var+$b=0"; + $s12 = "$var=0 \:\: or \:\: $var=$nb"; +} else { + $s10 = Formula("$c*($var-$x2)*($var+$b)")->reduce; + $s11 = "$var-$x2=0 \:\: or \:\: $var+$b=0"; + $s12 = "$var=$x2 \:\: or \:\: $var=$nb"; +} + +$nb = -$b; +$nd = -$d; + + +############################################## + + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by a common denominator. For this problem, a common denominator is [`[$commonD]`]. + + [`` +\begin{aligned} + &[$left] = [$right] \\ + &[$left] = [$s1] \\ + &[$s2] = [$s3] \\ + &[$s4] = [$s5] \\ + &[$s6] = [$s5] \\ + &[$s7] = [$s5] \\ + &[$s8] = 0 \\ + &[$s9] = 0 \\ + &[$s10] =0 \\ + &[$s11] \\ + &[$s12] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. In the original equation, both denominators cannot be [`0`]. We set them to [`0`], so we can find out what values to exclude from the solution set. + +For this example, it's easy to see we must exclude [`[$nb]`] and [`[$nd]`] from the solution set. As a result, [`[$var]=[$nb]`] is an extraneous solution, so the final solution is [`[$var]=[$x2]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations66.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations66.pg new file mode 100644 index 0000000000..58cfcbf618 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations66.pg @@ -0,0 +1,175 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like a/(x+b)+cx/(x+d)=e/( (x+c)(x+d) ) +# +# There are two solutions. +# +# Last edited: Yao 08/30/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','equation','rational') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0); +Context()->noreduce('(-x)-y','(-x)+y'); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + "no solution"=>{alias=>'no real solutions'}, + "no solutions"=>{alias=>'no real solutions'}, + ); + + +do { + do { + $a = non_zero_random(-9,9,1); + $b = non_zero_random(-9,9,1); + $c = non_zero_random(2,9,1); + do {$d = non_zero_random(-9,9,1);} until ($b!=$d); + $e = non_zero_random(-9,9,1); + $a1 = $c; + $b1 = $a+$b*$c; + $c1 = $a*$d-$e; + $d1 = ($b1)**2-4*$a1*$c1; + $temp1 = gcf(abs($a1),abs($b1)); + $comD = gcf($temp1,abs($c1)); + } until ( ($c1!=0) && ($d1>0) && ($comD!=1) ); + $x2 = ( sqrt($d1)==int(sqrt($d1))) ? Fraction(-$b1+sqrt($d1),(2*$a1))->reduce : -100; + $x1 = ( sqrt($d1)==int(sqrt($d1))) ? Fraction(-$b1-sqrt($d1),(2*$a1))->reduce : -100; +} until ( ($x1!=-$b) && ($x2!=-$b) && ($x1!=-$d) && ($x2!=-$d) && ($x1!=$x2) ); + +($numX1,$denX1) = $x1->value; +($numX2,$denX2) = $x2->value; + +$commonD = Formula("($var+$b)($var+$d)")->reduce; +$left = Formula("$a/($var+$b)+$c*$var/($var+$d)")->reduce; +$bPlusD = $b+$d; +$bd = $b*$d; +$right = Formula("$e/($var**2+$bPlusD*$var+$bd)")->reduce; +$mycontext = Context(); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); + +$ans = Formula("{$x2, $x1}"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the equation. + + [`` [$left]=[$right] ``] + + [_______________________________]{$ans} + +END_PGML + +############################################## + +Context($mycontext); +$s1 = Formula("$e/( ($var+$b)($var+$d) )")->reduce; +$s2 = Formula("$a/($var+$b)*$commonD+$c*$var/($var+$d)*$commonD")->reduce; +$s3 = Formula("$e/( ($var+$b)($var+$d) )*$commonD")->reduce; +$ad = $a*$d; +$bc = $b*$c; +$s4 = Formula("$a*($var+$d)+$c*$var*($var+$b)")->reduce; +$s5 = $e; +$s6 = Formula("$a*$var+$ad+$c*$var**2+$bc*$var")->reduce; +$o = $a+$bc; +$s7 = Formula("$c*$var**2+$o*$var+$ad")->reduce; +$p = $ad-$e; +$s8 = Formula("$c*$var**2+$o*$var+$p")->reduce; +$r = $c/$comD; +$s = $o/$comD; +$t = $p/$comD; +$s9 = Formula("$comD*($r*$var**2+$s*$var+$t)")->reduce; +$s10 = Formula("$denX1*$var-$numX1")->reduce; +$s11 = Formula("$denX2*$var-$numX2")->reduce; + +$nb = -$b; +$nd = -$d; + + +############################################# + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by a common denominator. For this problem, a common denominator is [`[$commonD]`]. + + [`` +\begin{aligned} + &[$left] = [$right] \\ + &[$left] = [$s1] \\ + &[$s2] = [$s3] \\ + &[$s4] = [$s5] \\ + &[$s6] = [$s5] \\ + &[$s7] = [$s5] \\ + &[$s8] = 0 \\ + &[$s9] = 0 \\ + &[$com]([$s10])([$s11]) = 0 \\ + &[$s10]=0 \:\: or\:\: [$s11]=0 \\ + &[$var]=[$x1] \:\: or\:\: [$var]=[$x2] +\end{aligned} + ``] + +We must check solutions when we solve rational equations. In the original equation, both denominators cannot be [`0`]. We set them to [`0`], so we can find out what values to exclude from the solution set. + +For this example, it's easy to see we must exclude [`[$nb]`] and [`[$nd]`] from the solution set. There is no conflict with those two solutions we got, so the final solution is [`[$var]=[$x1]`] and [`[$var]=[$x2]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations70.pg new file mode 100644 index 0000000000..a1033e33df --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalEquations/solveRationalEquations70.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Carl Yao, 2015 +# Portland Community College +# +# Template: +# Solve the equation. +# +# (x+a)/(x+b) + c/(x+d) = e +# +# +# Last updated: Yao 08/30/15 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','rational','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("FiniteSolutionSets"); + +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + + +do { + $a = non_zero_random(-9,9,1); + do {$b = non_zero_random(-9,9,1);} until ($b!=$a); + $c = non_zero_random(-9,9,1); + do {$d = non_zero_random(-9,9,1);} until ($b!=$d); + do {$e = non_zero_random(-9,9,1);} until ($e!=1); + $a1 = 1-$e; + $b1 = $a+$c+$d-$b*$e-$e*$d; + $c1 = ($a*$d+$b*$c-$b*$d*$e); + $d1 = ($b1)**2-4*$a1*$c1; + $x1 = ($d1>0) ? (-$b1+sqrt($d1))/(2*$a1) : -100; + $x2 = ($d1>0) ? (-$b1-sqrt($d1))/(2*$a1) : -100; +} until ( (int($x1)==$x1) && (int($x2)==$x2) && ($x1!=$x2) ); + +$commonD = Formula("($var+$b)($var+$d)")->reduce; +$left = Formula("($var+$a)/($var+$b)+$c/($var+$d)")->reduce; +$right = $e; + + +$ans = Formula("{$x1,$x2}"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + +Context("Numeric"); +Context()->variables->are($var=>'Real'); + +$s1 = Formula("($var+$a)/($var+$b)*$commonD+$c/($var+$d)*$commonD")->reduce; +$s2 = Formula("$e*$commonD")->reduce; +$s3 = Formula("($var+$a)($var+$d)+$c*($var+$b)")->reduce; +$bPlusD = $b+$d; +$bd = $b*$d; +$s4 = Formula("$e*($var**2+$bPlusD*$var+$bd)")->reduce; +$aPlusD = $a+$d; +$ad = $a*$d; +$bc = $b*$c; +$s5 = Formula("$var**2+$aPlusD*$var+$ad+$c*$var+$bc")->reduce; +$o = $bPlusD*$e; +$bde = $b*$d*$e; +$s6 = Formula("$e*$var**2+$o*$var+$bde")->reduce; +$p = $aPlusD+$c; +$q = $ad+$bc; +$s7 = Formula("$var**2+$p*$var+$q")->reduce; +$s8 = Formula("$var**2+$p*$var+$q-$e*$var**2-$o*$var-$bde")->reduce; +$r = 1-$e; +$s = $p-$o; +$t = $q-$bde; +$s9 = Formula("$r*$var**2+$s*$var+$t")->reduce; +$u = $s/$r; +$v = $t/$r; +$s10 = Formula("$r*($var**2+$u*$var+$v)")->reduce; + +if ($x1 == 0) { + $s11 = Formula("$r*$var*($var-$x2)")->reduce; + $s12 = Formula("$var"); + $s13 = Formula("$var-$x2")->reduce; + $s14 = 0; + $s15 = $x2; +} elsif ($x2==0) { + $s11 = Formula("$r*$var*($var-$x1)")->reduce; + $s12 = Formula("$var"); + $s13 = Formula("$var-$x1")->reduce; + $s14 = 0; + $s15 = $x1; +} else { + $s11 = Formula("$r*($var-$x1)*($var-$x2)")->reduce; + $s12 = Formula("$var-$x1")->reduce; + $s13 = Formula("$var-$x2")->reduce; + $s14 = $x1; + $s15 = $x2; +} + +$nb = -$b; +$nd = -$d; + +############################################## + +BEGIN_PGML_SOLUTION + +To get rid of fractions, we multiply each term in this equation by the common denominator, which is [`[$commonD]`] in this example. + + [`` +\begin{aligned} + &[$left] = [$right] \\ + &[$s1] =[$s2] \\ + &[$s3] = [$s4] \\ + &[$s5] = [$s6] \\ + &[$s7] = [$s6] \\ + &[$s8] = 0 \\ + &[$s9] = 0 \\ + &[$s10] = 0 \\ + &[$s11] = 0 \\ + &[$s12]=0 \:\: or\:\: [$s13]=0 \\ + &[$var]=[$s14] \:\: or\:\: [$var]=[$s15] +\end{aligned} + ``] + +*Checking* + +We must check solutions when we solve rational equations. In the original equation, both denominators cannot be [`0`]. We set them to [`0`], so we can find out what values to exclude from the solution set. + + [`` +\begin{aligned} + &[$var]+[$b] = 0 &\;& [$var]+[$d]=0 \\ + &[$var]=[$nb] &\;& [$var]=[$nd] +\end{aligned} + ``] + +We must exclude [`[$nb]`] and [`[$nd]`] from the solution set, so the final solution is [`[$var]=[$x1]`] and [`[$var]=[$x2]`]. + +END_PGML_SOLUTION + + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions10.pg new file mode 100644 index 0000000000..3f31dbf9da --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions10.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 4x/(x+2) + 4/(x+2) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,6,1); +$b = non_zero_random(1,6,1); + +$num1 = Formula("$a*$var1")->reduce; +$den1 = Formula("$var1+$b")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$a*$b")->reduce; +$den2 = Formula("$var1+$b")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; +$ans = Formula("$a, $var1 != -$b")->reduce; + +$lostDomain = List(-$b); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$s1 = Formula("$a*$var1+$a*$b")->reduce; +$s2 = Formula("$a*($var1+$b)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= \frac{[$s1]}{[$den1]} \\ + &= \frac{[$s2]}{[$den1]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var1]+[$b]`] was canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100.pg new file mode 100644 index 0000000000..7de34de998 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 11m/(m^2+3m-28)+m/(m+7) +# +# Last updated: Carl Yao 08/25/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $b = non_zero_random(-6,6,1); + do {$c = non_zero_random(-6,6,1);} until ($b!=-$c); + $d = non_zero_random(-6,6,1); + $e=2*$b+$c; + $f=$b*($b+$c); + $g = $b+$c; +} until ($f<=50); + +$num1 = Formula("$c*$d*$var1")->reduce; +$den1 = Formula("$var1**2+$e*$var1+$f")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("($var1+$g)*($var1+$b)")->reduce; + +$num2 = Formula("$d*$var1")->reduce; +$den2 = Formula("$var1+$g")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + +$ans = Formula("$d*$var1/($var1+$b), $var1 != -$g")->reduce; +$ans->{trueDomain} = Compute("$var1 != -$g and $var1 != -$b"); +$lostDomain = List(-$g); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$h = $c*$d; +$s1 = Formula("$h*$var1/( ($var1+$g)*($var1+$b) ) + $frac2")->reduce; +$s2 = Formula("$h*$var1/( ($var1+$g)*($var1+$b) ) + $frac2")->reduce; +$s3 = Formula("$h*$var1/( ($var1+$g)*($var1+$b) ) + $d*$var1*($var1+$b)/( ($var1+$g)*($var1+$b) )")->reduce; +$s4 = Formula("( $h*$var1+$d*$var1*($var1+$b) )/( ($var1+$g)*($var1+$b) )")->reduce; + +$i = $d*$b; +$s5 = Formula("( $h*$var1+$d*$var1**2+$i*$var1 )/( ($var1+$g)*($var1+$b) )")->reduce; + +$j = $i+$h; +$s6 = Formula("( $d*$var1**2+$j*$var1 )/( ($var1+$g)*($var1+$b) )")->reduce; + +$s7 = Compute("$d*$var1($var1+$g)")->reduce; +$s8 = Compute("($var1+$g)*($var1+$b)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$s2] \cdot \frac{([$var1]+[$b])}{([$var1]+[$b])} \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$s5] \\ + &= [$s6] \\ + &= \frac{[$s7]}{[$s8]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var1]+[$g]`] was canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100nodomain.pg new file mode 100644 index 0000000000..bd0415b786 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100nodomain.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 11m/(m^2+3m-28)+m/(m+7) +# +# Last updated: Carl Yao 08/25/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $b = non_zero_random(-6,6,1); + do {$c = non_zero_random(-6,6,1);} until ($b!=-$c); + $d = non_zero_random(-6,6,1); + $e=2*$b+$c; + $f=$b*($b+$c); + $g = $b+$c; +} until ($f<=50); + +$num1 = Formula("$c*$d*$var1")->reduce; +$den1 = Formula("$var1**2+$e*$var1+$f")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("($var1+$g)*($var1+$b)")->reduce; + +$num2 = Formula("$d*$var1")->reduce; +$den2 = Formula("$var1+$g")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + + $ans = Formula("$d*$var1/($var1+$b)")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$h = $c*$d; +$s1 = Formula("$h*$var1/( ($var1+$g)*($var1+$b) ) + $frac2")->reduce; +$s2 = Formula("$h*$var1/( ($var1+$g)*($var1+$b) ) + $frac2")->reduce; +$s3 = Formula("$h*$var1/( ($var1+$g)*($var1+$b) ) + $d*$var1*($var1+$b)/( ($var1+$g)*($var1+$b) )")->reduce; +$s4 = Formula("( $h*$var1+$d*$var1*($var1+$b) )/( ($var1+$g)*($var1+$b) )")->reduce; + +$i = $d*$b; +$s5 = Formula("( $h*$var1+$d*$var1**2+$i*$var1 )/( ($var1+$g)*($var1+$b) )")->reduce; + +$j = $i+$h; +$s6 = Formula("( $d*$var1**2+$j*$var1 )/( ($var1+$g)*($var1+$b) )")->reduce; + +$s7 = Compute("$d*$var1($var1+$g)")->reduce; +$s8 = Compute("($var1+$g)*($var1+$b)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$s2] \cdot \frac{([$var1]+[$b])}{([$var1]+[$b])} \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$s5] \\ + &= [$s6] \\ + &= \frac{[$s7]}{[$s8]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions101.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions101.pg new file mode 100644 index 0000000000..02855f440b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions101.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 11m/(m^2+3mn-28n)+m/(m+7n) +# +# Last updated: Carl Yao 08/25/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $b = non_zero_random(-6,6,1); + do {$c = non_zero_random(-6,6,1);} until ($b!=-$c); + $d = non_zero_random(-6,6,1); + $e=2*$b+$c; + $f=$b*($b+$c); + $g = $b+$c; +} until ($f<=50); + +$num1 = Formula("$c*$d*$var1*$var2")->reduce; +$den1 = Formula("$var1**2+$e*$var1*$var2+$f*$var2**2")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("($var1+$g*$var2)*($var1+$b*$var2)")->reduce; + +$num2 = Formula("$d*$var1")->reduce; +$den2 = Formula("$var1+$g*$var2")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + + $ans = Formula("$d*$var1/($var1+$b*$var2)")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. [@KeyboardInstructions('Do not try to write the restricted domain.')@]** + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$h = $c*$d; +$s1 = Formula("$h*$var1*$var2/( ($var1+$g*$var2)*($var1+$b*$var2) ) + $frac2")->reduce; +$s2 = Formula("$h*$var1*$var2/( ($var1+$g*$var2)*($var1+$b*$var2) ) + $frac2")->reduce; +$s3 = Formula("$h*$var1*$var2/( ($var1+$g*$var2)*($var1+$b*$var2) ) + $d*$var1*($var1+$b*$var2)/( ($var1+$g*$var2)*($var1+$b*$var2) )")->reduce; +$s4 = Formula("( $h*$var1*$var2+$d*$var1*($var1+$b*$var2) )/( ($var1+$g*$var2)*($var1+$b*$var2) )")->reduce; + +$i = $d*$b; +$s5 = Formula("( $h*$var1*$var2+$d*$var1**2+$i*$var1*$var2 )/( ($var1+$g*$var2)*($var1+$b*$var2) )")->reduce; + +$j = $i+$h; +$s6 = Formula("( $d*$var1**2+$j*$var1*$var2 )/( ($var1+$g*$var2)*($var1+$b*$var2) )")->reduce; + +$s7 = Compute("$d*$var1($var1+$g*$var2)")->reduce; +$s8 = Compute("($var1+$g*$var2)*($var1+$b*$var2)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$s2] \cdot \frac{([$var1]+[$b][$var2])}{([$var1]+[$b][$var2])} \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$s5] \\ + &= [$s6] \\ + &= \frac{[$s7]}{[$s8]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions10nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions10nodomain.pg new file mode 100644 index 0000000000..4f61515742 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions10nodomain.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 4x/(x+2) + 4/(x+2) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,6,1); +$b = non_zero_random(1,6,1); + +$num1 = Formula("$a*$var1")->reduce; +$den1 = Formula("$var1+$b")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$a*$b")->reduce; +$den2 = Formula("$var1+$b")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; +$ans = Formula("$a")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question] =``] [___________________]{$ans} + + +END_PGML + +################################################### + +$s1 = Formula("$a*$var1+$a*$b")->reduce; +$s2 = Formula("$a*($var1+$b)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= \frac{[$s1]}{[$den1]} \\ + &= \frac{[$s2]}{[$den1]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions110.pg new file mode 100644 index 0000000000..d929d39233 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions110.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 3/(a+2)+8/(a-5) +# +# Last updated: Carl Yao 08/25/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $b = non_zero_random(-6,6,1); + do {$d = non_zero_random(-6,6,1);} until ($b!=$d); + $a = non_zero_random(1,6,1); + $c = non_zero_random(-6,6,1); + $e = $a+$c; + $f = $a*$d+$b*$c; +} until (gcd($e,$f)==1); + +$num1 = Formula("$a")->reduce; +$den1 = Formula("$var1+$b")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c")->reduce; +$den2 = Formula("$var1+$d")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + +$ans = Formula("($e*$var1+$f)/( ($var1+$b)*($var1+$d) ), (-inf,inf)")->reduce; +$ans->{trueDomain} = Compute("$var1 != -$b and $var1 != -$d"); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$nc = -$c; +$s1 = ($c>0) ? "+\frac{$c}{$var1+$d} \cdot \frac{($var1+$b)}{($var1+$b)}" : "-\frac{$nc}{$var1+$d} \cdot \frac{($var1+$b)}{($var1+$b)}"; + +$s2 = Formula("($a*($var1+$d)+$c*($var1+$b))/(($var1+$b)($var1+$d))")->reduce; + +$g = $a*$d; +$h = $c*$b; +$s3 = Formula("($a*$var1+$g+$c*$var1+$h)/(($var1+$b)($var1+$d))")->reduce; + +################################################### + +$final = Formula("($e*$var1+$f)/( ($var1+$b)*($var1+$d))")->reduce; +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$frac1] \cdot \frac{([$var1]+[$d])}{([$var1]+[$d])} [$s1] \\ + &= [$s2] \\ + &= [$s3] \\ + &= [$final] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions120.pg new file mode 100644 index 0000000000..6d7285b37a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions120.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2/(x^2-4)+3/(x+2)+4/(x-2) +# +# Last updated: Carl Yao 08/25/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = non_zero_random(1,9,1); + $b = non_zero_random(-6,6,1); + $c = non_zero_random(-6,6,1); + do {$d = non_zero_random(-6,6,1);} until ($c!=-$d); + $f = $c+$d; + $g = $b-$a*$c+$a*$d; +} until (abs($g/$f)==$a); + +$e=$a**2; + +$num1 = Formula("$b")->reduce; +$den1 = Formula("$var1**2-$e")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("($var1+$a)*($var1-$a)")->reduce; + +$num2 = Formula("$c")->reduce; +$den2 = Formula("$var1+$a")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$num3 = Formula("$d")->reduce; +$den3 = Formula("$var1-$a")->reduce; +$num3Factored = $num2; +$den3Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac1Factored = Formula("$num1Factored/$den1Factored")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$frac3= Formula("$num3/$den3")->reduce; +$question = Formula("$frac1+$frac2+$frac3")->reduce; + +if ($g/$f==$a) { + $ans = Formula("$f/($var1-$a), $var1 != -$a")->reduce; + $ans->{trueDomain} = Compute("$var1 != -$a and $var1 != $a"); + $crossed = Formula("$var1+$a")->reduce; + $lostDomain = List(-$a); +} else { + $ans = Formula("$f/($var1+$a), $var1 != $a")->reduce; + $ans->{trueDomain} = Compute("$var1 != -$a and $var1 != $a"); + $crossed = Formula("$var1-$a")->reduce; + $lostDomain = List($a); +} + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$s1 = Formula("$frac1Factored+$frac2+$frac3")->reduce; + +$nc = -$c; +$s2 = ($c>0) ? "+\frac{$c}{$var1+$a} \cdot \frac{($var1-$a)}{($var1-$a)}" : "-\frac{$nc}{$var1+$a} \cdot \frac{($var1-$a)}{($var1-$a)}"; +$nd = -$d; +$s3 = ($d>0) ? "+\frac{$d}{$var1-$a} \cdot \frac{($var1+$a)}{($var1+$a)}" : "-\frac{$nd}{$var1-$a} \cdot \frac{($var1+$a)}{($var1+$a)}"; + +$s4 = Formula("$frac1Factored+$c*($var1-$a)/$den1Factored+$d*($var1+$a)/$den1Factored")->reduce; + +$s5 = Formula("($num1+$c*($var1-$a)+$d*($var1+$a))/$den1Factored")->reduce; + +$h = $c*$a; +$i = $d*$a; +$s6 = Formula("($num1+$c*$var1-$h+$d*$var1+$i)/$den1Factored")->reduce; + +$s7 = Formula("($f*$var1+$g)/$den1Factored")->reduce; + +$j = $g/$f; +$s8 = Formula("$f*($var1+$j)/$den1Factored")->reduce; + + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$frac1Factored] [$s2] [$s3] \\ + &= [$s4] \\ + &= [$s5] \\ + &= [$s6] \\ + &= [$s7] \\ + &= [$s8] \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$crossed]`] was canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions120nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions120nodomain.pg new file mode 100644 index 0000000000..fcee39fea1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions120nodomain.pg @@ -0,0 +1,136 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2/(x^2-4)+3/(x+2)+4/(x-2) +# +# Last updated: Carl Yao 08/25/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = non_zero_random(1,9,1); + $b = non_zero_random(-6,6,1); + $c = non_zero_random(-6,6,1); + do {$d = non_zero_random(-6,6,1);} until ($c!=-$d); + $f = $c+$d; + $g = $b-$a*$c+$a*$d; +} until (abs($g/$f)==$a); + +$e=$a**2; + +$num1 = Formula("$b")->reduce; +$den1 = Formula("$var1**2-$e")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("($var1+$a)*($var1-$a)")->reduce; + +$num2 = Formula("$c")->reduce; +$den2 = Formula("$var1+$a")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$num3 = Formula("$d")->reduce; +$den3 = Formula("$var1-$a")->reduce; +$num3Factored = $num2; +$den3Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac1Factored = Formula("$num1Factored/$den1Factored")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$frac3= Formula("$num3/$den3")->reduce; +$question = Formula("$frac1+$frac2+$frac3")->reduce; + +if ($g/$f==$a) { + $ans = Formula("$f/($var1-$a)")->reduce; + $crossed = Formula("$var1+$a")->reduce; + $lostDomain = List(-$a); +} else { + $ans = Formula("$f/($var1+$a)")->reduce; + $crossed = Formula("$var1-$a")->reduce; + $lostDomain = List($a); +} + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = Formula("$frac1Factored+$frac2+$frac3")->reduce; + +$nc = -$c; +$s2 = ($c>0) ? "+\frac{$c}{$var1+$a} \cdot \frac{($var1-$a)}{($var1-$a)}" : "-\frac{$nc}{$var1+$a} \cdot \frac{($var1-$a)}{($var1-$a)}"; +$nd = -$d; +$s3 = ($d>0) ? "+\frac{$d}{$var1-$a} \cdot \frac{($var1+$a)}{($var1+$a)}" : "-\frac{$nd}{$var1-$a} \cdot \frac{($var1+$a)}{($var1+$a)}"; + +$s4 = Formula("$frac1Factored+$c*($var1-$a)/$den1Factored+$d*($var1+$a)/$den1Factored")->reduce; + +$s5 = Formula("($num1+$c*($var1-$a)+$d*($var1+$a))/$den1Factored")->reduce; + +$h = $c*$a; +$i = $d*$a; +$s6 = Formula("($num1+$c*$var1-$h+$d*$var1+$i)/$den1Factored")->reduce; + +$s7 = Formula("($f*$var1+$g)/$den1Factored")->reduce; + +$j = $g/$f; +$s8 = Formula("$f*($var1+$j)/$den1Factored")->reduce; + + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$frac1Factored] [$s2] [$s3] \\ + &= [$s4] \\ + &= [$s5] \\ + &= [$s6] \\ + &= [$s7] \\ + &= [$s8] \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions130.pg new file mode 100644 index 0000000000..884a709580 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions130.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^2+3)/(x^2+2x) - (x+4)/x +# +# Last updated: Carl Yao 08/25/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + + + $b = non_zero_random(-6,6,1); + do {$c = non_zero_random(-6,6,1);} until ($b!=-$c); + $a = $b*$c; + +$d = $b+$c; + +$num1 = Formula("$var1**2+$a")->reduce; +$den1 = Formula("$var1**2+$b*$var1")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("$var1*($var1+$b)")->reduce; + +$num2 = Formula("$var1+$c")->reduce; +$den2 = Formula("$var1")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1-$frac2")->reduce; + +$ans = Formula("-$d/($var1+$b), $var1 != 0")->reduce; +$ans->{trueDomain} = Compute("$var1 != -$b and $var1 != 0"); +$crossed = Formula("$var1"); +$lostDomain = List(0); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$s1 = Formula("$num1/$den1Factored-$frac2")->reduce; +$s2 = Formula("$num1/$den1Factored-($var1+$c)($var1+$b)/$den1Factored")->reduce; +$s3 = Formula("($num1-($var1+$c)($var1+$b))/$den1Factored")->reduce; +$s4 = Formula("($num1-($var1**2+$d*$var1+$a))/$den1Factored")->reduce; +$s5 = Formula("($num1-$var1**2-$d*$var1-$a)/$den1Factored")->reduce; +$s6 = Formula("-$d*$var1/$den1Factored")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$s1] \cdot \frac{([$var1]+[$b])}{([$var1]+[$b])} \\ + &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$s5] \\ + &= [$s6] \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$crossed]`] was canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions130nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions130nodomain.pg new file mode 100644 index 0000000000..46e41332ae --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions130nodomain.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^2+3)/(x^2+2x) - (x+4)/x +# +# Last updated: Carl Yao 08/25/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + + + $b = non_zero_random(-6,6,1); + do {$c = non_zero_random(-6,6,1);} until ($b!=-$c); + $a = $b*$c; + +$d = $b+$c; + +$num1 = Formula("$var1**2+$a")->reduce; +$den1 = Formula("$var1**2+$b*$var1")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("$var1*($var1+$b)")->reduce; + +$num2 = Formula("$var1+$c")->reduce; +$den2 = Formula("$var1")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1-$frac2")->reduce; + +$ans = Formula("-$d/($var1+$b)")->reduce; +$crossed = Formula("$var1"); +$lostDomain = List(0); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = Formula("$num1/$den1Factored-$frac2")->reduce; +$s2 = Formula("$num1/$den1Factored-($var1+$c)($var1+$b)/$den1Factored")->reduce; +$s3 = Formula("($num1-($var1+$c)($var1+$b))/$den1Factored")->reduce; +$s4 = Formula("($num1-($var1**2+$d*$var1+$a))/$den1Factored")->reduce; +$s5 = Formula("($num1-$var1**2-$d*$var1-$a)/$den1Factored")->reduce; +$s6 = Formula("-$d*$var1/$den1Factored")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$s1] \cdot \frac{([$var1]+[$b])}{([$var1]+[$b])} \\ + &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$s5] \\ + &= [$s6] \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions140.pg new file mode 100644 index 0000000000..e8693594d4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions140.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 3/(x+4)+5 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = non_zero_random(-6,6,1); + $b = non_zero_random(-6,6,1); + $c = non_zero_random(2,6,1)*random(-1,1,2); +} until (gcd(abs($a),abs($c))==1); + +$num1 = Formula("$a")->reduce; +$den1 = Formula("$var1+$b")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c")->reduce; +$den2 = Formula("1")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$num2")->reduce; + +$e = $a+$b*$c; +$ans = Formula("($c*$var1+$e)/($var1+$b), (-inf,inf)")->reduce; +$ans->{trueDomain} = Compute("$var1 != -$b"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$nc = -$c; +$s1 = ($c>0) ? "+\frac{$c}{1}" : "-\frac{$nc}{1}"; + +$s2 = Formula("$frac1+$c*($var1+$b)/($var1+$b)")->reduce; +$s3 = Formula("($a+$c*($var1+$b))/($var1+$b)")->reduce; + +$d = $c*$b; +$s4 = Formula("($a+$c*$var1+$d)/($var1+$b)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$frac1] [$s1] \\ + &= [$frac1] [$s1] \cdot \frac{([$var1]+[$b])}{([$var1]+[$b])} \\ + &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions150.pg new file mode 100644 index 0000000000..9eb34da298 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions150.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2x/(x-3) + x/(x+3) +4 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "parserOneOf.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + + $a = non_zero_random(2,6,1); + $b = non_zero_random(1,6,1); + $c = -$a-1; + +$num1 = Formula("$a*$var1")->reduce; +$den1 = Formula("$var1+$b")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$var1")->reduce; +$den2 = Formula("$var1-$b")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2+$c")->reduce; + +$o = $b-$a*$b; +$p = -($b)**2*$c; +$ans1 = Formula("($o*$var1+$p)/( ($var1+$b)($var1-$b) ), (-inf,inf)")->reduce; +$ans1->{trueDomain} = Compute("$var1 != -$b and $var1 != $b"); + +$q = -gcd(abs($o),abs($p)); +$r = $o/$q; +$s = $p/$q; +$ans2 = Formula("$q($r*$var1+$s)/( ($var1+$b)($var1-$b) ), (-inf,inf)")->reduce; +$ans2->{trueDomain} = Compute("$var1 != -$b and $var1 != $b"); + +$ans = $ans2; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$nc = -$c; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$frac1] \cdot \frac{([$var1]-[$b])}{([$var1]-[$b])} + [$frac2] \cdot \frac{([$var1]+[$b])}{([$var1]+[$b])} - \frac{[$nc]}{1} \cdot \frac{([$var1]+[$b])([$var1]-[$b])}{([$var1]+[$b])([$var1]-[$b])} \\ + &= \frac{[$a][$var1]([$var1]-[$b])}{([$var1]+[$b])([$var1]-[$b])} + \frac{[$var1]([$var1]+[$b])}{([$var1]+[$b])([$var1]-[$b])} - \frac{[$nc]([$var1]+[$b])([$var1]-[$b])}{([$var1]+[$b])([$var1]-[$b])} \\ + &= \frac{[$a][$var1]([$var1]-[$b])+[$var1]([$var1]+[$b])-[$nc]([$var1]+[$b])([$var1]-[$b])}{([$var1]+[$b])([$var1]-[$b])} \\ + &= \frac{[$a][$var1]^{2}-[$a*$b][$var1]+[$var1]^{2}+[$b][$var1]-[$nc]([$var1]^{2}-[$b**2])}{([$var1]+[$b])([$var1]-[$b])} \\ + &= \frac{[$a][$var1]^{2}-[$a*$b][$var1]+[$var1]^{2}+[$b][$var1]-[$nc][$var1]^{2}+[$nc*$b**2]}{([$var1]+[$b])([$var1]-[$b])} \\ + &= [$ans1] +\end{aligned} + ``] + +Notice that [` [$ans2] `] is also correct. We should actually factor whenever possible, in case we can reduce the rational expression. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions20.pg new file mode 100644 index 0000000000..47ca112d8a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions20.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x^2/(x-7)-49/(x-7) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,10,1); +do {$b = random(2,10,1);} until (gcd($a,$b)==1); +$b = $b*random(-1,1,2); + +$num1 = Formula("$a**2*$var1**2")->reduce; +$den1 = Formula("$a*$var1+$b*$var2")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("($b)**2*$var2**2")->reduce; +$den2 = Formula("$a*$var1+$b*$var2")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1-$frac2")->reduce; +$ans = Formula("$a*$var1-$b*$var2")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. [@KeyboardInstructions('Do not try to write the restricted domain.')@]** + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = Formula("$a**2*$var1**2-($b)**2*$var2**2")->reduce; +$s2 = Formula("($a*$var1+$b*$var2)*($a*$var1-$b*$var2)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= \frac{[$s1]}{[$den1]} \\ + &= \frac{[$s2]}{[$den1]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions30.pg new file mode 100644 index 0000000000..8c9d21d4d3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions30.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 1/(x-7)(x+3) - (x-6)/(x-7)(x+3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(5,10,1); +$b = non_zero_random(1,6,1); +do {$c = non_zero_random(-6,6,1);} until ($c!=$b-$a); +$d = $b-$a; + +$num1 = Formula("$b")->reduce; +$den1 = Formula("$var1**2+($c-$a)*$var1-$a*$c")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("($var1-$a)*($var1+$c)")->reduce; + +$num2 = Formula("$var1+$d")->reduce; +$den2 = $den1; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1-$frac2")->reduce; +$ans = Formula("-1/($var1+$c), $var1 != $a")->reduce; +$ans->{trueDomain} = Compute("$var1 != -$c and $var1 != $a"); + +$lostDomain = List($a); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$s1 = Formula("$b-($var1+$d)")->reduce; +$s2 = Formula("$b-$var1-$d")->reduce; +$s3 = Formula("-$var1+$a")->reduce; +$s4 = Formula("-($var1-$a)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= \frac{[$s1]}{[$den1]} \\ + &= \frac{[$s2]}{[$den1Factored]} \\ + &= \frac{[$s3]}{[$den1Factored]} \\ + &= \frac{[$s4]}{[$den1Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var1]-[$a]`] was canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions30nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions30nodomain.pg new file mode 100644 index 0000000000..2967cb56ae --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions30nodomain.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 1/(x-7)(x+3) - (x-6)/(x-7)(x+3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(5,10,1); +$b = non_zero_random(1,6,1); +do {$c = non_zero_random(-6,6,1);} until ($c!=$b-$a); +$d = $b-$a; + +$num1 = Formula("$b")->reduce; +$den1 = Formula("$var1**2+($c-$a)*$var1-$a*$c")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("($var1-$a)*($var1+$c)")->reduce; + +$num2 = Formula("$var1+$d")->reduce; +$den2 = $den1; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1-$frac2")->reduce; +$ans = Formula("-1/($var1+$c)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = Formula("$b-($var1+$d)")->reduce; +$s2 = Formula("$b-$var1-$d")->reduce; +$s3 = Formula("-$var1+$a")->reduce; +$s4 = Formula("-($var1-$a)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= \frac{[$s1]}{[$den1]} \\ + &= \frac{[$s2]}{[$den1Factored]} \\ + &= \frac{[$s3]}{[$den1Factored]} \\ + &= \frac{[$s4]}{[$den1Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions40.pg new file mode 100644 index 0000000000..36c38fe990 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions40.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 3x/7 + x/14 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(2,6,1); + do {$b = random(2,6,1);} until (gcd($a,$b)==1); + $c = random(2,6,1); + $d = $a*$c+1; + $factor = gcd($d,$c*$b); +} until ($factor!=1); + +$num1 = Formula("$a*$var1")->reduce; +$den1 = Formula("$b")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$var1")->reduce; +$den2 = Formula("$c*$b")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + +$ansNum=$d/$factor; +$ansDen=$c*$b/$factor; + +$ans = Formula("$ansNum*$var1/$ansDen, (-inf,inf)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + + + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= \frac{[$a][$var1]\cdot[$c]}{[$den1]\cdot[$c]} +[$frac2] \\ + &= \frac{[$a*$c][$var1]}{[$b*$c]} +[$frac2] \\ + &= \frac{[$a*$c][$var1]+[$num2]}{[$b*$c]} \\ + &= \frac{[$a*$c+1][$var1]}{[$b*$c]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions50.pg new file mode 100644 index 0000000000..2f8218ff9c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions50.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 3x/14y +/- 3x/7y +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $c = random(1,6,1); + do {$d = random(2,6,1);} until (gcd($c,$d)==1); + $c = $c*random(-1,1,2); + do { + $a = random(1,6,1); + $factor = random(2,5,1); + $b = $factor*$d; } until ( gcd($a,$b)==1); + $e = $c*$factor+$a; +} until (gcd($e,$b)!=1); + +$num1 = Formula("$a*$var1")->reduce; +$den1 = Formula("$b*$var2")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c*$var1")->reduce; +$den2 = Formula("$d*$var2")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + +$ansNum=$e/gcd($e,$b); +$ansDen=$b/gcd($e,$b); + +$ans = Formula("$ansNum*$var1/($ansDen*$var2)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. [@KeyboardInstructions('Do not try to write the restricted domain.')@]** + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$absC = abs($c); +if ($c>0) { + $s1 = ($c==1) ? "+\frac{$var1 \cdot $factor}{$d $var2 \cdot $factor}" : "+\frac{$c $var1 \cdot $factor}{$d $var2 \cdot $factor}"; +} else { + $s1 = ($c==-1) ? "-\frac{$var1 \cdot $factor}{$d $var2 \cdot $factor}" : "-\frac{$absC $var1 \cdot $factor}{$d $var2 \cdot $factor}"; +} + +$f = $c*$factor; +$absF = abs($f); +$g = $d*$factor; +$s3 = ($c>0) ? "+\frac{$absF $var1}{$g $var2}" : "-\frac{$absF $var1}{$g $var2}"; + + +$s4 = Formula("$a*$var1+$f*$var1")->reduce; +$h = $a+$f; +$s5 = Formula("$h*$var1")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$frac1] [$s1] \\ + &= [$frac1] [$s3] \\ + &= \frac{[$s4]}{[$d*$factor][$var2]} \\ + &= \frac{[$s5]}{[$d*$factor][$var2]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions60.pg new file mode 100644 index 0000000000..83c03330ff --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions60.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 3x/2r^2 +/- 2/3rx +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "parserOneOf.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(1,6,1); + do {$b=random(2,6,1);} until (gcd($a,$b)==1); + $c = random(1,6,1); + do {$d=random(2,6,1);} until (gcd($c,$d)==1); +} until ( (gcd($b,$d)==1) && (gcd($a,$c)!=1) ); +$a = $a*random(-1,1,2); +$c = $c*random(-1,1,2); + +$e1 = random(2,5,1); + +$num1 = Formula("$a*$var1")->reduce; +$den1 = Formula("$b*$var2**$e1")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c")->reduce; +$den2 = Formula("$d*$var1*$var2")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + +$f = $a*$d; +$g = $b*$c; +$h = $b*$d; + +$factor = gcd($f,$g); +$i = $f/$factor; +$j = $g/$factor; +$ni = -$i; +$nj = -$j; +$ans1 = Formula("($f*$var1**2+$g*$var2**($e1-1))/($h*$var1*$var2**$e1)")->reduce; +$ans2 = Formula("$factor*($i*$var1**2+$j*$var2**($e1-1))/($h*$var1*$var2**$e1)")->reduce; +$ans3 = Formula("-$factor*($ni*$var1**2+$nj*$var2**($e1-1))/($h*$var1*$var2**$e1)")->reduce; +$ans = OneOf($ans1,$ans2,$ans3); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. [@KeyboardInstructions('Do not try to write the restricted domain.')@]** + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$e2 = $e1-1; +$eShow1 = ($e2==1) ? "$var2" : "$var2^{$e2}"; +$nc = -$c; + +$s1 = ($c>0) ? "+ \frac{$c \cdot $b $eShow1}{$d $var1 $var2 \cdot $b $eShow1}" : "- \frac{$nc \cdot $b $eShow1}{$d $var1 $var2 \cdot $b $eShow1}"; + +$k = $b*$c; +$nk = -$k; +$l = $b*$d; +$s2 = ($c>0) ? "+ \frac{$k $eShow1}{$l $var1 $var2^{$e1}}" : "- \frac{$nk $eShow1}{$l $var1 $var2^{$e1}}"; + +$ans4 = ($a>0) ? $ans2 : $ans3; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= \frac{[$num1]\cdot[$d][$var1]}{[$den1]\cdot[$d][$var1]} [$s1] \\ + &= \frac{[$a*$d][$var1]^{2}}{[$b*$d][$var1][$var2]^{[$e1]}} [$s2] \\ + &= [$ans1] +\end{aligned} + ``] + +Notice that [` [$ans4] `] is also correct. We should actually factor whenever possible, in case we can reduce the rational expression. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions70.pg new file mode 100644 index 0000000000..4aa98b9436 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions70.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 1/(x-3) + 2/(x^2-9) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(1,9,1)*random(-1,1,2); + $b = 1; + $c = non_zero_random(-9,9,1); + $d = -$a*$b+$c; +} until (abs($d)==abs($a)); + +$e = $a**2; + +$num1 = Formula("$b")->reduce; +$den1 = Formula("$var1+$a")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c")->reduce; +$den2 = Formula("$var1**2-$e")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("($var1+$a)*($var1-$a)")->reduce; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + +if ($d==$a) { + $crossed = Formula("$var1+$a")->reduce; + $lostDomain = List(-$a); + $ans = Formula("1/($var1-$a), $var1 != -$a")->reduce; + $ans->{trueDomain} = Compute("$var1 != $a and $var1 != -$a"); +} else { + $crossed = Formula("$var1-$a")->reduce; + $lostDomain = List($a); + $ans = Formula("1/($var1+$a), $var1 != $a")->reduce; + $ans->{trueDomain} = Compute("$var1 != -$a and $var1 != $a"); +} + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$nc = -$c; +$s1 = ($c>0) ? "+\frac{$c}{($var1+$a)($var1-$a)}" : "-\frac{$nc}{($var1+$a)($var1-$a)}"; +$s2 = Formula("$var1-$a")->reduce; +$s3 = Formula("$b*($var1-$a)+$c")->reduce; +$i = $b*$a; +$s4 = Formula("$b*$var1-$i+$c")->reduce; +$j = -$i+$c; +$s5 = Formula("$b*$var1+$j")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$frac1][$s1] \\ + &= \frac{[$b]\cdot([$s2])}{([$den1])\cdot([$s2])} [$s1] \\ + &= \frac{[$s3]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= \frac{[$s5]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$crossed]`] was canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions70nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions70nodomain.pg new file mode 100644 index 0000000000..ddd6681506 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions70nodomain.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 1/(x-3) + 2/(x^2-9) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(1,9,1)*random(-1,1,2); + $b = 1; + $c = non_zero_random(-9,9,1); + $d = -$a*$b+$c; +} until (abs($d)==abs($a)); + +$e = $a**2; + +$num1 = Formula("$b")->reduce; +$den1 = Formula("$var1+$a")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c")->reduce; +$den2 = Formula("$var1**2-$e")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("($var1+$a)*($var1-$a)")->reduce; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + +if ($d==$a) { + $crossed = Formula("$var1+$a")->reduce; + $ans = Formula("1/($var1-$a)")->reduce; +} else { + $crossed = Formula("$var1-$a")->reduce; + $ans = Formula("1/($var1+$a)")->reduce; +} + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$nc = -$c; +$s1 = ($c>0) ? "+\frac{$c}{($var1+$a)($var1-$a)}" : "-\frac{$nc}{($var1+$a)($var1-$a)}"; +$s2 = Formula("$var1-$a")->reduce; +$s3 = Formula("$b*($var1-$a)+$c")->reduce; +$i = $b*$a; +$s4 = Formula("$b*$var1-$i+$c")->reduce; +$j = -$i+$c; +$s5 = Formula("$b*$var1+$j")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$frac1][$s1] \\ + &= \frac{[$b]\cdot([$s2])}{([$den1])\cdot([$s2])} [$s1] \\ + &= \frac{[$s3]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= \frac{[$s5]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions80.pg new file mode 100644 index 0000000000..332bce6b9a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions80.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2/(x-3) - 4x/(x^2-9) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + + $a = random(1,6,1)*random(-1,1,2); + $b = random(2,5,1); + $c = -2*$b; + +$d = ($a)**2; + +$num1 = Formula("$b")->reduce; +$den1 = Formula("$var1+$a")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c*$var1")->reduce; +$den2 = Formula("$var1**2-$d")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("($var1+$a)*($var1-$a)")->reduce; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + + + $crossed = Formula("$var1+$a")->reduce; + $lostDomain = List(-$a); + $ans = Formula("-$b/($var1-$a), $var1 != -$a")->reduce; + $ans->{trueDomain} = Compute("$var1 != $a and $var1 != -$a"); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$nc = -$c; +$s1 = ($c>0) ? "+\frac{$c}{($var1+$a)($var1-$a)}" : "-\frac{$nc $var1}{($var1+$a)($var1-$a)}"; +$s2 = Formula("$var1-$a")->reduce; +$s3 = Formula("$b*($var1-$a)+$c*$var1")->reduce; +$i = $b*$a; +$s4 = Formula("$b*$var1-$i+$c*$var1")->reduce; +$s5 = Formula("-$b*$var1-$i")->reduce; +$s6 = Formula("-$b*($var1+$a)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$frac1][$s1] \\ + &= \frac{[$b]\cdot([$s2])}{([$den1])\cdot([$s2])} [$s1] \\ + &= \frac{[$s3]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= \frac{[$s4]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= \frac{[$s5]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= \frac{[$s6]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$crossed]`] was canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions80nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions80nodomain.pg new file mode 100644 index 0000000000..5ae3131727 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions80nodomain.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2/(x-3) - 4x/(x^2-9) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + + $a = random(1,6,1)*random(-1,1,2); + $b = random(2,5,1); + $c = -2*$b; + +$d = ($a)**2; + +$num1 = Formula("$b")->reduce; +$den1 = Formula("$var1+$a")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c*$var1")->reduce; +$den2 = Formula("$var1**2-$d")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("($var1+$a)*($var1-$a)")->reduce; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + + + $crossed = Formula("$var1+$a")->reduce; + $ans = Formula("-$b/($var1-$a)")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$nc = -$c; +$s1 = ($c>0) ? "+\frac{$c}{($var1+$a)($var1-$a)}" : "-\frac{$nc $var1}{($var1+$a)($var1-$a)}"; +$s2 = Formula("$var1-$a")->reduce; +$s3 = Formula("$b*($var1-$a)+$c*$var1")->reduce; +$i = $b*$a; +$s4 = Formula("$b*$var1-$i+$c*$var1")->reduce; +$s5 = Formula("-$b*$var1-$i")->reduce; +$s6 = Formula("-$b*($var1+$a)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$frac1][$s1] \\ + &= \frac{[$b]\cdot([$s2])}{([$den1])\cdot([$s2])} [$s1] \\ + &= \frac{[$s3]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= \frac{[$s4]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= \frac{[$s5]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= \frac{[$s6]}{([$var1]+[$a])([$var1]-[$a])} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions81.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions81.pg new file mode 100644 index 0000000000..a73b2a07a2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions81.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2/(xy-3) - 4xy/(x^2y^2-9) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + + $a = random(1,6,1)*random(-1,1,2); + $b = random(2,5,1); + $c = -2*$b; + +$d = ($a)**2; + +$num1 = Formula("$b")->reduce; +$den1 = Formula("$var1*$var2+$a")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c*$var1*$var2")->reduce; +$den2 = Formula("$var1**2*$var2**2-$d")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("($var1*$var2+$a)*($var1*$var2-$a)")->reduce; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1+$frac2")->reduce; + + + $crossed = Formula("$var1+$a")->reduce; + $ans = Formula("-$b/($var1*$var2-$a)")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. [@KeyboardInstructions('Do not try to write the restricted domain.')@]** + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$nc = -$c; +$s1 = ($c>0) ? "+\frac{$c $var1 $var2}{($var1 $var2+$a)($var1 $var2-$a)}" : "-\frac{$nc $var1 $var2}{($var1 $var2+$a)($var1 $var2-$a)}"; +$s2 = Formula("$var1 $var2-$a")->reduce; +$s3 = Formula("$b*($var1 $var2-$a)+$c*$var1*$var2")->reduce; +$i = $b*$a; +$s4 = Formula("$b*$var1*$var2-$i+$c*$var1*$var2")->reduce; +$s5 = Formula("-$b*$var1*$var2-$i")->reduce; +$s6 = Formula("-$b*($var1*$var2+$a)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$frac1][$s1] \\ + &= \frac{[$b]\cdot([$s2])}{([$den1])\cdot([$s2])} [$s1] \\ + &= \frac{[$s3]}{([$var1][$var2]+[$a])([$var1][$var2]-[$a])} \\ + &= \frac{[$s4]}{([$var1][$var2]+[$a])([$var1][$var2]-[$a])} \\ + &= \frac{[$s5]}{([$var1][$var2]+[$a])([$var1][$var2]-[$a])} \\ + &= \frac{[$s6]}{([$var1][$var2]+[$a])([$var1][$var2]-[$a])} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions90.pg new file mode 100644 index 0000000000..60d79e58a1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions90.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x/(x+a) + (a+b)x+ab/x(x+a) +# +# Last updated: Carl Yao 08/25/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(1,9,1)*random(-1,1,2); + do {$b = random(1,9,1)*random(-1,1,2);} until ($a!=$b); + $c = -$a-$b; +} until ($c>0); +$d = -$a*$b; + +$num1 = Formula("$var1")->reduce; +$den1 = Formula("$var1+$a")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c*$var1+$d")->reduce; +$den2 = Formula("$var1**2+$a*$var1")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("$var1*($var1+$a)")->reduce; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1-$frac2")->reduce; + + + $crossed = Formula("$var1+$a")->reduce; + $lostDomain = List(-$a); + $ans = Formula("($var1+$b)/$var1, $var1 != -$a")->reduce; + $ans->{trueDomain} = Compute("$var1 != -$a and $var1 != 0"); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Add or subtract the rational expressions to a single rational expression and then simplify. If applicable, state the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question] =``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$s1 = Formula("$var1**2-$c*$var1-$d")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$frac1]-\frac{[$num2]}{[$var1]([$var1]+[$a])} \\ + &= \frac{[$var1] \cdot [$var1]}{([$den1]) \cdot [$var1]}-\frac{[$num2]}{[$var1]([$var1]+[$a])} \\ + &= \frac{[$var1]^{2}}{[$var1]([$var1]+[$a])}-\frac{[$num2]}{[$var1]([$var1]+[$a])} \\ + &= \frac{[$var1]^{2}-([$num2])}{[$var1]([$var1]+[$a])} \\ + &= \frac{[$s1]}{[$var1]([$var1]+[$a])} \\ + &= \frac{([$var1]+[$a])([$var1]+[$b])}{[$var1]([$var1]+[$a])} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$crossed]`] was canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions90nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions90nodomain.pg new file mode 100644 index 0000000000..c856223628 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions90nodomain.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x/(x+a) + (a+b)x+ab/x(x+a) +# +# Last updated: Carl Yao 08/25/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','add','subtract','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(1,9,1)*random(-1,1,2); + do {$b = random(1,9,1)*random(-1,1,2);} until ($a!=$b); + $c = -$a-$b; +} until ($c>0); +$d = -$a*$b; + +$num1 = Formula("$var1")->reduce; +$den1 = Formula("$var1+$a")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c*$var1+$d")->reduce; +$den2 = Formula("$var1**2+$a*$var1")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("$var1*($var1+$a)")->reduce; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question = Formula("$frac1-$frac2")->reduce; + + + $crossed = Formula("$var1+$a")->reduce; + $ans = Formula("($var1+$b)/$var1")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = Formula("$var1**2-$c*$var1-$d")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$frac1]-\frac{[$num2]}{[$var1]([$var1]+[$a])} \\ + &= \frac{[$var1] \cdot [$var1]}{([$den1]) \cdot [$var1]}-\frac{[$num2]}{[$var1]([$var1]+[$a])} \\ + &= \frac{[$var1]^{2}}{[$var1]([$var1]+[$a])}-\frac{[$num2]}{[$var1]([$var1]+[$a])} \\ + &= \frac{[$var1]^{2}-([$num2])}{[$var1]([$var1]+[$a])} \\ + &= \frac{[$s1]}{[$var1]([$var1]+[$a])} \\ + &= \frac{([$var1]+[$a])([$var1]+[$b])}{[$var1]([$var1]+[$a])} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions10.pg new file mode 100644 index 0000000000..d6b28a5f96 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions10.pg @@ -0,0 +1,129 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2/3) / (3/5) and (a/b) / (c/d) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','complex fraction','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +do {$var3 = RandomVariableName(type=>'variable');} until ( ($var3 ne $var2) && ($var3 ne $var1) ); +do {$var4 = RandomVariableName(type=>'variable');} until ( ($var4 ne $var1) && ($var4 ne $var2) && ($var4 ne $var3) ); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real',$var4=>'Real'); + +do { + $b = random(2,9,1); + do {$d = random(2,9,1);} until (gcd($b,$d)==1); + do {$c = random(2,5,1);} until (gcd($c,$d)==1); + $factor = random(1,5,1); + $a = $c*$factor; +} until (gcd($a,$b)==1); + +$commonDenominator1 = $b*$d; + +$num1 = Formula("$a")->reduce; +$den1 = Formula("$b")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c")->reduce; +$den2 = Formula("$d")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$question1 = "\frac{ \frac{$a}{$b} }{ \frac{$c}{$d} }"; + +$frac3= Formula("$var1/$var2")->reduce; +$frac4= Formula("$var3/$var4")->reduce; +$commonDenominator2 = Formula("$var2*$var4")->reduce; +$question2 = "\frac{ \frac{$var1}{$var2} }{ \frac{$var3}{$var4} }"; +$ans2 = Formula("$var1*$var4/($var2*$var3)")->reduce; + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +$ans1 = Fraction($factor*$d,$b)->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Calculate the following. Use an improper fraction in your answer. + +a. [``[$question1] =``] [___________________]{$ans1} + +a. [``[$question2] =``] [___________________]{$ans2} + +END_PGML + +################################################### + + + +################################################### + +BEGIN_PGML_SOLUTION + +**Problem 1** + +To simplify a complex fraction, we find the common denominator of all fractions. In this case, it is [`[$commonDenominator1]`]. We multiply the complex fraction's numerator and denominator by this common denominator, and we have: + + [`` +\begin{aligned} + [$question] + &= \frac{ \frac{[$a]}{[$b]} \cdot [$commonDenominator1] }{ \frac{[$c]}{[$d]} \cdot [$commonDenominator1] } \\ + &= \frac{ [$a*$commonDenominator1/$b] }{ [$c*$commonDenominator1/$d] } \\ + &= [$ans1] +\end{aligned} + ``] + +Here is a simple way to do fraction multiplication: + + [`` \frac{[$a]}{[$b]} \cdot [$commonDenominator1] = [$commonDenominator1] \div [$b] \cdot [$a] = [$a*$commonDenominator1/$b] ``] + +**Problem 2** + +To simplify a complex fraction, we find the common denominator of all fractions. In this case, it is [`[$commonDenominator2]`]. We multiply the complex fraction's numerator and denominator by this common denominator, and we have: + + [`` +\begin{aligned} + [$question] + &= \frac{ \frac{[$var1]}{[$var2]} \cdot [$commonDenominator2] }{ \frac{[$var3]}{[$var4]} \cdot [$commonDenominator2] } \\ + &= [$ans2] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions11.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions11.pg new file mode 100644 index 0000000000..d3d158bbff --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions11.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2 / (3/5) and (2/3) /5 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','complex fraction','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$var1 = RandomVariableName(type=>'variable'); +#do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +#Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(1,6,1); + $b = random(2,9,1); + $c=random(2,9,1); +} until ( (gcd($a,$b)==1) && (gcd($b,$c)==1) ); + +$question1 = "\frac{ $a }{ \frac{$b}{$c} }"; +$question2 = "\frac{ \frac{$a}{$b} }{$c}"; + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$factor1 = gcd($a*$c,$b); +$ans1 = Fraction($a*$c,$b)->reduce; + +$factor2 = gcd($a,$b*$c); +$ans2 = Fraction($a,$b*$c)->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Calculate the following. Use an improper fraction in your answer. + +a) [``[$question1] =``] [___________________]{$ans1} + +b) [``[$question2] =``] [___________________]{$ans2} + +END_PGML + +################################################### + + +################################################### + +BEGIN_PGML_SOLUTION + +a) We multiply [`[$c]`] in both the numerator and denominator: + + [`` +\begin{aligned} + [$question1] + &= \frac{ [$a] \cdot [$c] }{ \frac{[$b]}{[$c]} \cdot [$c] } \\ + &= [$ans1] +\end{aligned} + ``] + +b) We multiply [`[$b]`] in both the numerator and denominator: + + [`` +\begin{aligned} + [$question2] + &= \frac{ \frac{[$a]}{[$b]} \cdot [$b] }{ [$c] \cdot [$b] } \\ + &= [$ans2] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions12.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions12.pg new file mode 100644 index 0000000000..19644a6087 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions12.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (a/b) / c and a/(b/c) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','complex fraction','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +do {$var3 = RandomVariableName(type=>'variable');} until ( ($var3 ne $var2) && ($var3 ne $var1) ); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real'); + +$question1 = "\frac{ \frac{$var1}{$var2} }{ $var3 }"; +$ans1 = Formula("$var1/($var2*$var3)")->reduce; + +$question2 = "\frac{ $var1 }{ \frac{$var2}{$var3} }"; +$ans2 = Formula("$var1*$var3/$var2")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + +a. [``[$question1] =``] [___________________]{$ans1} + +a. [``[$question2] =``] [___________________]{$ans2} + +END_PGML + +################################################### + +################################################### + +BEGIN_PGML_SOLUTION + +**Problem 1** + +We multiply the complex fraction's numerator and denominator by [`[$var2]`], and we have: + + [`` +\begin{aligned} + [$question1] + &= \frac{ \frac{[$var1]}{[$var2]} \cdot [$var2] }{ [$var3] \cdot [$var2] } \\ + &= [$ans1] +\end{aligned} + ``] + +**Problem 2** + +We multiply the complex fraction's numerator and denominator by [`[$var3]`], and we have: + + [`` +\begin{aligned} + [$question2] + &= \frac{ [$var1] \cdot [$var3] } { \frac{[$var2]}{[$var3]} \cdot [$var3] }\\ + &= [$ans2] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions20.pg new file mode 100644 index 0000000000..85b1918d1e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions20.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (1/2+1/4) / (1/3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','complex fraction','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$var1 = RandomVariableName(type=>'variable'); +#do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +#Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$b = random(2,6,1); +do {$d=random(2,6,1);} until ($b!=$d); +do {$f=random(2,6,1);} until ( ($f!=$b) && ($f!=$d) ); +do {$a=random(1,6,1);} until (gcd($a,$b)==1); +do {$c=random(1,6,1);} until (gcd($c,$d)==1); +$c = $c*random(-1,1,2); +do {$e=random(1,6,1);} until (gcd($e,$f)==1); + +$commonDenominator = lcm( lcm($b,$d),$f); + +$num1 = Formula("$a")->reduce; +$den1 = Formula("$b")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c")->reduce; +$den2 = Formula("$d")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$num3 = Formula("$e")->reduce; +$den3 = Formula("$f")->reduce; +$num3Factored = $num3; +$den3Factored = $den3; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$frac3= Formula("$num3/$den3")->reduce; +$nc = -$c; +$question = ($c>0) ? "\frac{ \frac{$a}{$b} + \frac{$c}{$d} }{ \frac{$e}{$f} }" : "\frac{ \frac{$a}{$b} - \frac{$nc}{$d} }{ \frac{$e}{$f} }"; + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +$ans = Fraction($f*$a*$d+$b*$c*$f,$b*$e*$d)->reduce; +($ansNum,$ansDen) = $ans->value; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Calculate the following. Use an improper fraction in your answer. + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = ($c>0) ? "(\frac{$a}{$b}+\frac{$c}{$d})\cdot $commonDenominator" : "(\frac{$a}{$b}-\frac{$nc}{$d})\cdot $commonDenominator"; + +$s2 = ($c>0) ? "\frac{$a}{$b} \cdot $commonDenominator + \frac{$c}{$d} \cdot $commonDenominator" : "\frac{$a}{$b} \cdot $commonDenominator - \frac{$nc}{$d} \cdot $commonDenominator"; + +$s3 = $a*$commonDenominator/$b; +$s4 = $c*$commonDenominator/$d; +$s5 = $s3+$s4; +$s6 = $e*$commonDenominator/$f; + +if ( ($ansNum==$s5) && ($ansDen!=1) ) { + $s7 = ""; +} else { + $s7 = "&= \frac{$s5}{$s6} \\"; +} + +################################################### + +BEGIN_PGML_SOLUTION + +To simplify a complex fraction, we find the common denominator of all fractions. In this case, it is [`[$commonDenominator]`]. We multiply the complex fraction's numerator and denominator by this common denominator, and we have: + + [`` +\begin{aligned} + [$question] + &= \frac{[$s1]}{ \frac{[$e]}{[$f]} \cdot [$commonDenominator] } \\ + &= \frac{[$s2]}{ \frac{[$e]}{[$f]} \cdot [$commonDenominator] } \\ + &= \frac{[$s3]+[$s4]}{[$s6] } \\ + [$s7] + &= [$ans] +\end{aligned} + ``] + +Here is a simple way to do fraction multiplication: + + [`` \frac{[$a]}{[$b]} \cdot [$commonDenominator] = [$commonDenominator] \div [$b] \cdot [$a] = [$a*$commonDenominator/$b] ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions30.pg new file mode 100644 index 0000000000..6dcbbc72ef --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions30.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2/ (1/2+1/4) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','complex fraction','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +#$var1 = RandomVariableName(type=>'variable'); +#do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +#Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(1,6,1); + $b = random(1,6,1); + do {$c=random(2,6,1);} until (gcd($b,$c)==1); + $d = non_zero_random(-6,6,1); + do {$e=random(2,6,1);} until (gcd($d,$e)==1); +} until ($b*$e+$c*$d!=0); + +$commonDenominator = lcm($c,$e); + +$num1 = Formula("$b")->reduce; +$den1 = Formula("$c")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$d")->reduce; +$den2 = Formula("$e")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$nd = -$d; +$question = ($d>0) ? "\frac{$a}{ \frac{$b}{$c} + \frac{$d}{$e} }" : "\frac{$a}{ \frac{$b}{$c} - \frac{$nd}{$e} }"; + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +$ans = Fraction($a*$c*$e,$b*$e+$c*$d)->reduce; +($ansNum,$ansDen) = $ans->value; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Calculate the following. Use an improper fraction in your answer. + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = ($d>0) ? "(\frac{$b}{$c}+\frac{$d}{$e}) \cdot $commonDenominator" : "(\frac{$b}{$c}-\frac{$nd}{$e}) \cdot $commonDenominator"; + +$s2 = ($d>0) ? "\frac{$b}{$c} \cdot $commonDenominator + \frac{$d}{$e} \cdot $commonDenominator" : "\frac{$b}{$c} \cdot $commonDenominator - \frac{$nd}{$e} \cdot $commonDenominator"; + +$s3 = $commonDenominator/$c*$b; +$s4 = $commonDenominator/$e*$d; +$s5 = $a*$commonDenominator; +$s7 = $s3+$s4; + +if ( ($ansNum==$s5)&&($ansDen!=1) ) { + $s6 = ""; +} else { + $s6 = "&= \frac{$s5}{$s7} \\"; +} + +################################################### + +BEGIN_PGML_SOLUTION + +To simplify a complex fraction, we find the common denominator of all fractions. In this case, it is [`[$commonDenominator]`]. We multiply the complex fraction's numerator and denominator by this common denominator, and we have: + + [`` +\begin{aligned} + [$question] + &= \frac{[$a] \cdot [$commonDenominator]}{ [$s1] } \\ + &= \frac{[$s5]}{ [$s2] } \\ + &= \frac{[$s5]}{ [$s3] + [$s4] } \\ + [$s6] + &= [$ans] +\end{aligned} + ``] + +Here is a simple way to do fraction multiplication: + + [`` \frac{[$b]}{[$c]} \cdot [$commonDenominator] = [$commonDenominator] \div [$c] \cdot [$b] = [$s3] ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions40.pg new file mode 100644 index 0000000000..7abee6d8d5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions40.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2/x+3/y) / (4/x+5/y) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','complex fraction','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(2,5,1); + $b = non_zero_random(-6,6,1); + $c = random(1,6,1); + $d = non_zero_random(-6,6,1); +} until ( (gcd($c,abs($d))==1) && (abs($a*$d*$c)<=40) && ($c*$b != $d)); + +$commonDenominator = Formula("$var1*$var2"); + +$frac1= Formula("$a/$var1")->reduce; + +$ab = $a*$b; +$frac2= Formula("$ab/$var2")->reduce; + +$ac = $a*$c; +$frac3= Formula("$ac/$var1")->reduce; + +$ad = $a*$d; +$frac4= Formula("$ad/$var2")->reduce; + +$num = Formula("$frac1+$frac2")->reduce; +$den = Formula("$frac3+$frac4")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("($var2+$b*$var1)/($c*$var2+$d*$var1)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = Formula("($frac1+$frac2)*$commonDenominator/( ($frac3+$frac4)*$commonDenominator )")->reduce; + +$nab = -$ab; +$nad = -$ad; +$s2 = ($b>0) ? "\frac{$a}{$var1} \cdot $var1 $var2 +\frac{$ab}{$var2} \cdot $var1 $var2 " : "\frac{$a}{$var1} \cdot $var1 $var2 -\frac{$nab}{$var2} \cdot $var1 $var2 "; +$s3 = ($d>0) ? "\frac{$ac}{$var1} \cdot $var1 $var2 +\frac{$ad}{$var2} \cdot $var1 $var2 " : "\frac{$ac}{$var1} \cdot $var1 $var2 - \frac{$nad}{$var2} \cdot $var1 $var2 "; + +$s4 = ($b>0) ? "$a $var2 + $ab $var1" : "$a $var2 - $nab $var1"; +$s5 = ($d>0) ? "$ac $var2 + $ad $var1" : "$ac $var2 - $nad $var1"; + +$s6 = Formula("$a($var2+$b*$var1)/( $a($c*$var2+$d*$var1) )")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + +To simplify a complex fraction, we find the common denominator of all fractions. In this case, it is [`[$commonDenominator]`]. We multiply the complex fraction's numerator and denominator by this common denominator, and we have: + + [`` +\begin{aligned} + [$question] + &= [$question] \cdot \frac{[$commonDenominator]}{[$commonDenominator]} \\ + &= [$s1] \\ + &= \frac{[$s2]}{[$s3]} \\ + &= \frac{[$s4]}{[$s5]} \\ + &= [$s6] \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions50.pg new file mode 100644 index 0000000000..df3d24fe8b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions50.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2/x) / (3+ 4y/c) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','complex fraction','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "parserOneOf.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(2,5,1); + $b = non_zero_random(1,6,1); + $c = non_zero_random(-6,6,1); +} until (gcd($a,abs($c))==1); +$nc = -$c; +$absC = abs($c); +$commonDenominator = Formula("$absC*$var1"); + +$frac1= Formula("$a/$var1")->reduce; + +$ab = $a*$b; + +$frac2= Formula("$a*$var2/$c")->reduce; + +$num = Formula("$frac1")->reduce; +$den = Formula("$ab+$frac2")->reduce; + +$bc = $b*$c; +$question = Formula("$num/$den")->reduce; + +if ($c>0) { + $ans2 = Formula("$c/($var1*$var2+$bc*$var1)")->reduce; + $ans1 = Formula("$c/($var1*($var2+$bc))")->reduce; + $ans = OneOf($ans1,$ans2); +} else { + $ans2 = Formula("-$c/(-$bc*$var1-$var1*$var2)")->reduce; + $ans1 = Formula("-$c/($var1*(-$bc-$var2))")->reduce; + $ans = OneOf($ans1,$ans2); +} + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$question] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$abc = $ab*$c; +$absAbc = abs($abc); + +$absBc = abs($bc); + +if ($c>0) { + $s1 = "\frac{ \frac{$a}{$var1} \cdot $c $var1}{($ab+\frac{$a $var2}{$c}) \cdot $c $var1}"; + $s3 = "$ab \cdot $c $var1 + \frac{$a $var2}{$c} \cdot $c $var1"; + $s5 = "$absAbc $var1 + $a $var1 $var2"; + $s6 = "$a $var1 ($absBc + $var2)"; +} else { + $s1 = "\frac{ \frac{$a}{$var1} \cdot $nc $var1}{($ab-\frac{$a $var2}{$nc}) \cdot $nc $var1}"; + $s3 = "$ab \cdot $nc $var1 - \frac{$a $var2}{$nc} \cdot $nc $var1"; + $s5 = "$absAbc $var1 - $a $var1 $var2"; + $s6 = "$a $var1 ($absBc - $var2)"; +} + +$s2 = "$a \cdot $absC"; +$s4 = $a*$absC; + +################################################### + +BEGIN_PGML_SOLUTION + +To simplify a complex fraction, we find the common denominator of all fractions. In this case, it is [`[$commonDenominator]`]. We multiply the complex fraction's numerator and denominator by this common denominator, and we have: + + [`` +\begin{aligned} + [$question] + &= [$question] \cdot \frac{[$commonDenominator]}{[$commonDenominator]} \\ + &= [$s1] \\ + &= \frac{[$s2]}{[$s3]} \\ + &= \frac{[$s4]}{[$s5]} \\ + &= \frac{[$s4]}{[$s6]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions60.pg new file mode 100644 index 0000000000..15d449bebd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions60.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2/ (3/x+4/(x+5)) +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','complex fraction','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { +$a = random(2,5,1); +$b = non_zero_random(-6,6,1); +$c = random(1,6,1); +do {$d = non_zero_random(-6,6,1);} until (abs($c)!=abs($d)); +$bc = $b*$c; +$ab = $a*$b; +$cPlusd = $c+$d; +$factor = gcd($bc,$cPlusd); +$p = $cPlusd/$factor; +$q = $bc/$factor; +} until (gcd($a,$factor)==1); + +$commonDenominator = Formula("$var1*($var1+$b)")->reduce; + +$frac1= Formula("$c/$var1")->reduce; +$frac2= Formula("$d/($var1+$b)")->reduce; + +$num = Formula("$a")->reduce; +$den = Formula("$frac1+$frac2")->reduce; + +$question = Formula("$num/$den")->reduce; + +if ($factor==1) { + $ansDen = Formula("$cPlusd*$var1+$bc")->reduce; + $last = Formula("-$bc/$cPlusd"); +} else { + $ansDen = Formula("$factor($p*$var1+$q)")->reduce; + $last = Formula("-$q/$p"); +} + + +$ans = Formula("$a*$var1*($var1+$b)/$ansDen, $var1 != 0 and $var1 != -$b")->reduce; +$ans->{trueDomain} = Compute("$var1 != 0 and $var1 != -$b and $var1 != $last"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + +[``[$question]=``] [__]{$ans}{width=>40} + +END_PGML + +################################################### + +$s1 = Formula("$a*$var1*($var1+$b)/( ($c/$var1+$d/($var1+$b))*$var1*($var1+$b))")->reduce; + +$s2 = Formula("$a*$var1*($var1+$b)/( $c/$var1*$var1*($var1+$b)+$d/($var1+$b)*$var1*($var1+$b))")->reduce; + +$s3 = Formula("$a*$var1*($var1+$b)/( $c*($var1+$b)+$d*$var1)")->reduce; + +$s4 = Formula("$a*$var1*($var1+$b)/( $c*$var1+$bc+$d*$var1)")->reduce; + +$nb = -$b; +$nbc = -$bc; +if ($factor==1) { + $s5 = ""; +} else { + $s5 = ($b>0) ? "&= \frac{$a $var1 ($var1+$b)}{$cPlusd $var1 + $bc} \\" : "&= \frac{$a $var1 ($var1-$nb)}{$cPlusd $var1 - $nbc} \\"; +} + +################################################### + +BEGIN_PGML_SOLUTION + +To simplify a complex fraction, we find the common denominator of all fractions. In this case, it is [`[$commonDenominator]`]. We multiply the complex fraction's numerator and denominator by this common denominator, and we have: + + [`` +\begin{aligned} + [$question] + &= [$question] \cdot \frac{[$commonDenominator]}{[$commonDenominator]} \\ + &= [$s1] \\ + &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + [$s5] + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions70.pg new file mode 100644 index 0000000000..40e382267e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions70.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like [3x/(x+2)(x-2) + 4] / [ 5/(x+2) + 3/(x-2) ] +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','complex fraction','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { +$a = random(2,6,1); +do {$c = non_zero_random(-6,6,1);} until (gcd($a,abs($c))==1); +$b = random(1,6,1); +$d = random(2,6,1); +do {$e = non_zero_random(-6,6,1);} until (gcd($d,abs($e))==1); +$b2c = $b**2*$c; +$numdisc = ($a)**2 - 4*$c*(-$b2c); +$absnumdisc = abs($numdisc); +} until ($numdisc < 0 or sqrt($absnumdisc) != int(sqrt($absnumdisc))); + +$commonDenominator = Formula("($var1+$b)*($var1-$b)")->reduce; + +$frac1= Formula("$a*$var1/($var1**2-$b**2)")->reduce; +$frac1Factored = Formula("$a*$var1/( ($var1+$b)($var1-$b) )")->reduce; +$frac2= Formula("$d/($var1+$b)")->reduce; +$frac3= Formula("$e/($var1-$b)")->reduce; + +$num = Formula("$frac1+$c")->reduce; +$den = Formula("$frac2+$frac3")->reduce; + +$question = Formula("$num/$den")->reduce; + +$dPluse = $d+$e; +$be = $b*$e; +$bd = $b*$d; +$o = $be-$bd; +$G = gcd($dPluse,$o); +$dPluseG = $dPluse/$G; +$oG = $o/$G; +$ans = Formula("($c*$var1**2+$a*$var1-$b2c)/($G($dPluseG*$var1+$oG)), $var1 != -$b and $var1 != $b")->reduce; +$ans->{trueDomain} = Compute("$var1 != -$b and $var1 != $b and $var1 != -$o/$dPluse"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + +[``[$question]=``] [__]{$ans}{width=>40} + +END_PGML + + +################################################### + +$s1 = Formula("($frac1Factored+$c)/$den")->reduce; + +$s2num = Formula("$a*$var1/( ($var1+$b)($var1-$b) )*( ($var1+$b)($var1-$b) )+$c($var1+$b)($var1-$b)")->reduce; +$s2den = Formula("$d/($var1+$b)*( ($var1+$b)($var1-$b) )+$e/($var1-$b)*( ($var1+$b)($var1-$b) )")->reduce; +$s2 = Formula($s2num/$s2den)->reduce; + +$s3 = Formula("( $a*$var1+$c($var1+$b)($var1-$b) )/( $d*($var1-$b)+$e($var1+$b) )")->reduce; + +$b2 = $b**2; +$s4 = Formula("( $a*$var1+$c($var1**2-$b2) )/( $d*($var1-$b)+$e($var1+$b) )")->reduce; + +$s5 = Formula("( $a*$var1+$c*$var1**2-$c*$b2 )/( $d*$var1-$d*$b+$e*$var1+$e*$b )")->reduce; + + +################################################### + +BEGIN_PGML_SOLUTION + +To simplify a complex fraction, we find the common denominator of all fractions. In this case, it is [`[$commonDenominator]`]. We multiply the complex fraction's numerator and denominator by this common denominator, and we have: + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$s1] \cdot \frac{[$commonDenominator]}{[$commonDenominator]} \\ + &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$s5] \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions10.pg new file mode 100644 index 0000000000..112011d954 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions10.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x/(x+4) / 2x^2 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,5,1); +$factor = random(1,5,1); +$b = $a*$factor*random(-1,1,2); + +$e1 = random(2,5,1); + +$num1 = Formula("$var1")->reduce; +$den1 = Formula("$var1+$b")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$a*$var1**$e1")->reduce; +$den2 = Formula("1")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +$ans = Formula("1/($a*$var1**($e1-1)*($var1+$b)), (-inf,inf)")->reduce; +$ans->{trueDomain} = Compute("$var1 != 0 and $var1 != -$b"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + + [``[$frac1] \div [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \div [$frac2] + &= [$frac1] \cdot [$frac3] \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions20.pg new file mode 100644 index 0000000000..57520d08e3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions20.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 10x / (5/x^2) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,5,1); +$factor = random(2,5,1); +$b = $a*$factor; + +$e1 = random(2,5,1); + +$num1 = Formula("$b*$var1")->reduce; +$den1 = Formula("1")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$a")->reduce; +$den2 = Formula("$var1**$e1")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +$ans = Formula("$factor*$var1**($e1+1), $var1 != 0")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$frac1] \div [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \div [$frac2] + &= [$frac1] \cdot [$frac3] \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions25.pg new file mode 100644 index 0000000000..032c224cc2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions25.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 4(x-3) / 8(x-3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = non_zero_random(2,6,1); +$factor = non_zero_random(2,6,1); +$b = $a*$factor; +$c = non_zero_random(-6,6,1); + +$num1 = Formula("$a*$var1+$a*$c")->reduce; +$den1 = Formula("1")->reduce; +$num1Factored = Formula("$a*($var1+$c)")->reduce; +$den1Factored = $den1; + +$num2 = Formula("$b*$var1+$b*$c")->reduce; +$den2 = Formula("1")->reduce; +$num2Factored = Formula("$b*($var1+$c)")->reduce; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +$lostDomain = List(-$c); + +$ans = Formula("1/$factor, $var1 != -$c"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``([$frac1]) \div ([$frac2]) =``] [___________________]{$ans} + + +END_PGML + +################################################### + + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + ([$frac1]) \div ([$frac2]) + &= \frac{[$frac1]}{1} \div \frac{[$frac2]}{1} \\ + &= \frac{[$frac1]}{1} \cdot [$frac3] \\ + &= \frac{[$num1Factored]}{1} \cdot \frac{1}{[$num2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var1]+[$c]`] was canceled, the domain condition lost during the simplification are [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions25nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions25nodomain.pg new file mode 100644 index 0000000000..a6bdea444a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions25nodomain.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 4(x-3) / 8(x-3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = non_zero_random(2,6,1); +$factor = non_zero_random(2,6,1); +$b = $a*$factor; +$c = non_zero_random(-6,6,1); + +$num1 = Formula("$a*$var1+$a*$c")->reduce; +$den1 = Formula("1")->reduce; +$num1Factored = Formula("$a*($var1+$c)")->reduce; +$den1Factored = $den1; + +$num2 = Formula("$b*$var1+$b*$c")->reduce; +$den2 = Formula("1")->reduce; +$num2Factored = Formula("$b*($var1+$c)")->reduce; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +Context("LimitedFraction"); +$ans = Fraction(1,$factor); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``([$frac1]) \div ([$frac2]) =``] [___________________]{$ans} + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + ([$frac1]) \div ([$frac2]) + &= \frac{[$frac1]}{1} \div \frac{[$frac2]}{1} \\ + &= \frac{[$frac1]}{1} \cdot [$frac3] \\ + &= \frac{[$num1Factored]}{1} \cdot \frac{1}{[$num2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions30.pg new file mode 100644 index 0000000000..7a47d5a13e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions30.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like xy^3/4 / xy^2/8 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,6,1); +$factor = random(2,6,1); +$b = $a*$factor; + +$e1 = random(1,5,1); +$e2 = random(1,5,1); +$c = random(1,5,1); +$e3 = $e2+$c; + +$num1 = Formula("$var1**$e1*$var2**$e3")->reduce; +$den1 = Formula("$a")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$var1**$e1*$var2**$e2")->reduce; +$den2 = Formula("$b")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +$ans = Formula("$factor*$var2**$c")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$frac1] \div [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \div [$frac2] + &= [$frac1] \cdot [$frac3] \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions40.pg new file mode 100644 index 0000000000..df1e416709 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions40.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2x+5)(2x-5)/(2x+5)(x-2) / 2(2x-5) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = list_random(2,3,5); +do {$b=random(2,10,1);} until (gcd($a,$b)==1); +$c = non_zero_random(-6,6,1); + +$num1 = Formula("$a**2*$var1**2-$b**2")->reduce; +$den1 = Formula("$a*$var1**2+($a*$c+$b)*$var1+$b*$c")->reduce; +$num1Factored = Formula("($a*$var1+$b)*($a*$var1-$b)")->reduce; +$den1Factored = Formula("($a*$var1+$b)*($var1+$c)")->reduce; + +$num2 = Formula("$b-$a*$var1")->reduce; +$den2 = Formula("1")->reduce; +$num2Factored = Formula("-($a*$var1-$b)")->reduce; +$den2Factored = Formula("1")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2")->reduce; + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +$ans = Formula("-1/($var1+$c), $var1 != $b/$a and $var1 != -$b/$a")->reduce; +$ans->{trueDomain} = Compute("$var1 != $b/$a and $var1 != -$b/$a and $var1 != -$c"); + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0); +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' and ',TeX=>'\hbox{ and }'}, + 'or'=>{string=>' and ',TeX=>'\hbox{ and }'} +); +Context()->lists->set(List => {separator => "\; and \;"}); +$lostFrac1 = Fraction($b,$a)->reduce; +$lostFrac2 = -Fraction($b,$a)->reduce; +$lostDomain = Compute("$lostFrac1,$lostFrac2"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$frac1] \div ([$frac2]) =``] [___________________]{$ans} + + +END_PGML + +################################################### + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \div [$frac2] + &= [$frac1] \div \frac{[$num2]}{1} \\ + &= [$frac1] \cdot [$frac3] \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num3Factored]}{[$den3Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factors [`[$a][$var1]+[$b]`] and [`[$a][$var1]-[$b]`] were canceled, the domain condition lost during the simplification are [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions40nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions40nodomain.pg new file mode 100644 index 0000000000..9a8d5b1fa7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions40nodomain.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2x+5)(2x-5)/(2x+5)(x-2) / 2(2x-5) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = list_random(2,3,5); +do {$b=random(2,10,1);} until (gcd($a,$b)==1); +$c = non_zero_random(-6,6,1); + +$num1 = Formula("$a**2*$var1**2-$b**2")->reduce; +$den1 = Formula("$a*$var1**2+($a*$c+$b)*$var1+$b*$c")->reduce; +$num1Factored = Formula("($a*$var1+$b)*($a*$var1-$b)")->reduce; +$den1Factored = Formula("($a*$var1+$b)*($var1+$c)")->reduce; + +$num2 = Formula("$b-$a*$var1")->reduce; +$den2 = Formula("1")->reduce; +$num2Factored = Formula("-($a*$var1-$b)")->reduce; +$den2Factored = Formula("1")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2")->reduce; + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +$ans = Formula("-1/($var1+$c)")->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0); +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' and ',TeX=>'\hbox{ and }'}, + 'or'=>{string=>' and ',TeX=>'\hbox{ and }'} +); +Context()->lists->set(List => {separator => "\; and \;"}); +$lostFrac1 = Fraction($b,$a)->reduce; +$lostFrac2 = -Fraction($b,$a)->reduce; +$lostDomain = Compute("$lostFrac1,$lostFrac2"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$frac1] \div ([$frac2]) =``] [___________________]{$ans} + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \div [$frac2] + &= [$frac1] \div \frac{[$num2]}{1} \\ + &= [$frac1] \cdot [$frac3] \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num3Factored]}{[$den3Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions45.pg new file mode 100644 index 0000000000..84ac9d5255 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions45.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x^2(x+2)^2 / x^3(x+2) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = non_zero_random(-6,6,1); + +$e1 = list_random(1,2,3); +$e2 = list_random(4,5,6); + +$num1 = Formula("$var1**($e1+2)+2*$a*$var1**($e1+1)*$var2+($a)**2$var1**($e1)$var2**2")->reduce; +$den1 = Formula("1")->reduce; +$num1Factored = Formula("$var1**$e1*($var1+$a*$var2)**2")->reduce; +$den1Factored = $den1; + +$num2 = Formula("$var1**($e2+1)+$a*$var1**$e2*$var2")->reduce; +$den2 = Formula("1")->reduce; +$num2Factored = Formula("$var1**$e2*($var1+$a*$var2)")->reduce; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +$ans = Formula("($var1+$a*$var2)/$var1**($e2-$e1)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``([$frac1]) \div ([$frac2]) =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1=Formula("$var1**$e1*($var1**2+2*$a*$var1*$var2+($a)**2*$var2**2)")->reduce; + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + ([$frac1]) \div ([$frac2]) + &= \frac{[$frac1]}{1} \div \frac{[$frac2]}{1} \\ + &= \frac{[$frac1]}{1} \cdot [$frac3] \\ + &= \frac{[$s1]}{1} \cdot \frac{1}{[$num2Factored]} \\ + &= \frac{[$num1Factored]}{1} \cdot \frac{1}{[$num2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions50.pg new file mode 100644 index 0000000000..82c3b8f7e4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions50.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x^2/(x^2-5x) / 1/(x^2+x-30) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = non_zero_random(-6,6,1); + do {$b = non_zero_random(-6,6,1);} until ($a!=$b); +} until (abs($a+$b)==1); + +$e1 = random(2,5,1); + +$num1 = Formula("$var1**$e1")->reduce; +$den1 = Formula("$var1**2+$a*$var1")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("$var1*($var1+$a)")->reduce; + +$num2 = Formula("1")->reduce; +$den2 = Formula("$var1**2+($a+$b)*$var1+$a*$b")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("($var1+$a)*($var1+$b)")->reduce; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +$ans = Formula("$var1**($e1-1)*($var1+$b), $var1 != 0 and $var1 != -$a and $var1 != -$b")->reduce; +$lostDomain = List(0,-$a); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$frac1] \div [$frac2] =``] [___________________]{$ans} + + +END_PGML + +################################################### + +$s1 = -$a; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \div [$frac2] + &= [$frac1] \cdot [$frac3] \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num3Factored]}{[$den3Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factors [`[$var1]`] and [`[$var1]+[$a]`] were canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions50nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions50nodomain.pg new file mode 100644 index 0000000000..4c9e8401c2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions50nodomain.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x^2/(x^2-5x) / 1/(x^2+x-30) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + + $a = non_zero_random(-6,6,1); + do {$b = non_zero_random(-6,6,1);} until (abs($a)!=abs($b)); + +$e1 = random(2,5,1); + +$num1 = Formula("$var1**$e1")->reduce; +$den1 = Formula("$var1**2+$a*$var1")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("$var1*($var1+$a)")->reduce; + +$num2 = Formula("1")->reduce; +$den2 = Formula("$var1**2+($a+$b)*$var1+$a*$b")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("($var1+$a)*($var1+$b)")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +$ans = Formula("$var1**($e1-1)*($var1+$b)")->reduce; +$lostDomain = List(0,-$a); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$frac1] \div [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = -$a; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \div [$frac2] + &= [$frac1] \cdot [$frac3] \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num3Factored]}{[$den3Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions55.pg new file mode 100644 index 0000000000..8b2044d2c0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions55.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x^2/(x^2-5x) / 1/(x^2+x-30) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + + + $a = non_zero_random(-6,6,1); + do {$b = non_zero_random(-6,6,1);} until (abs($a)!=abs($b)); + + +$e1 = random(2,5,1); + +$num1 = Formula("$var1**$e1")->reduce; +$den1 = Formula("$var1**2+$a*$var1*$var2")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("$var1*($var1+$a*$var2)")->reduce; + +$num2 = Formula("1")->reduce; +$den2 = Formula("$var1**2+($a+$b)*$var1*$var2+$a*$b*$var2**2")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("($var1+$a*$var2)*($var1+$b*$var2)")->reduce; + +$frac2= Formula("$num1/$den1"); +$frac1= Formula("$num2/$den2"); + +$frac3= Formula("$den1/$num1"); +$num3Factored = $den1Factored; +$den3Factored = $num1Factored; + +$ans = Formula("1/($var1**($e1-1)*($var1+$b*$var2))")->reduce; +$lostDomain = List(0,-$a); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$frac1] \div [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = -$a; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \div [$frac2] + &= [$frac1] \cdot [$frac3] \\ + &= \frac{[$num2Factored]}{[$den2Factored]} \cdot \frac{[$num3Factored]}{[$den3Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions56.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions56.pg new file mode 100644 index 0000000000..652d988da1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions56.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x^2/(x^2-5x) / 1/(x^2+x-30) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + + + $a = non_zero_random(-6,6,1); + do {$b = non_zero_random(-6,6,1);} until (abs($a)!=abs($b)); + +$e1 = random(2,5,1); + +$num1 = Formula("$var1**$e1")->reduce; +$den1 = Formula("$var1**2*$var2+$a*$var1")->reduce; +$num1Factored = $num1; +$den1Factored = Formula("$var1*($var1*$var2+$a)")->reduce; + +$num2 = Formula("1")->reduce; +$den2 = Formula("$var1**2*$var2**2+($a+$b)*$var1*$var2+$a*$b")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("($var1*$var2+$a)*($var1*$var2+$b)")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +$ans = Formula("$var1**($e1-1)*($var1*$var2+$b)")->reduce; +$lostDomain = List(0,-$a); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$frac1] \div [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = -$a; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \div [$frac2] + &= [$frac1] \cdot [$frac3] \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num3Factored]}{[$den3Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions60.pg new file mode 100644 index 0000000000..e4a678cd6b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions60.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 20x^2y^5/(x+5y) / 4x^3y/(x^2-25y^2) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','divide','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$b = random(2,6,1); +$factor = random(2,6,1); +$a = $b*$factor; +$c = non_zero_random(-10,10,1); + +$e1 = random(1,5,1); +$e3 = random($e1+1,9,1); +$e2 = random(2,6,1); + +$num1 = Formula("$a*$var1**$e1*$var2**$e2")->reduce; +$den1 = Formula("$var1+$c*$var2")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$b*$var1**$e3*$var2")->reduce; +$den2 = Formula("$var1**2-($c)**2*$var2**2")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("($var1+$c*$var2)*($var1-$c*$var2)")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); + +$frac3= Formula("$den2/$num2"); +$num3Factored = $den2Factored; +$den3Factored = $num2Factored; + +$ans = Formula("$factor*$var2**($e2-1)*($var1-$c*$var2)/$var1**($e3-$e1)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + + [``[$frac1] \div [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \div [$frac2] + &= [$frac1] \cdot [$frac3] \\ + &= [$frac1] \cdot \frac{[$num3Factored]}{[$den3Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions10.pg new file mode 100644 index 0000000000..a9c3c83084 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions10.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression x/(x+1) and 2(x+1)/(x+1) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "answerHints.pl", + "PGcourse.pl", + "PCCmacros.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); + +$a = random(2,10,1); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Select all correct equations:", +"$SPACE $SPACE $SPACE \( $a \cdot \frac{x}{y} = \frac{$a x}{y} \) $BR", +"$SPACE $SPACE $SPACE \( -\frac{x}{y} = \frac{-x}{y} \) $BR", +"$SPACE $SPACE $SPACE \( -\frac{x}{y} = \frac{x}{-y} \) $BR", +); + +$mc -> extra( +"$SPACE $SPACE $SPACE \( $a \cdot \frac{x}{y} = \frac{x}{$a y} \) $BR", +"$SPACE $SPACE $SPACE \( $a \cdot \frac{x}{y} = \frac{$a x}{$a y} \) $BR", +"$SPACE $SPACE $SPACE \( -\frac{x}{y} = \frac{-x}{-y} \) $BR", +); + + +############################################## + +Context()->texStrings; +BEGIN_TEXT + +$BR +\{ $mc -> print_q() \} +$BR +\{ $mc -> print_a() \} + +$PAR +\{KeyboardInstructions('To receive full credit, you must get each checkbox correct.')\} +END_TEXT +Context()->normalStrings; + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 1; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +################################################### + +BEGIN_SOLUTION + +The correct answer is \{ $mc->correct_ans() \}. $BR$BR + +Here is the correct way to do fraction multiplication: $BR$BR + +$BCENTER \( $a \cdot \frac{x}{y} = \frac{$a}{1} \cdot \frac{x}{y} = \frac{$a x}{y}\) $ECENTER $BR$BR + +When a negative symbol is in front of a fraction, we can do: + +$BCENTER \( -\frac{x}{y} = \frac{-x}{y} \) (correct) $ECENTER $BR +$BCENTER \( -\frac{x}{y} = \frac{x}{-y} \) (correct) $ECENTER $BR + +We cannot do: + +$BCENTER \( -\frac{x}{y} = \frac{-x}{-y} \) (incorrect) $ECENTER $BR$BR + +This is because \( -\frac{6}{3} = \frac{-6}{3} = \frac{6}{-3} = -2 \), but \( -\frac{6}{3} \ne \frac{-6}{-3} \). $BR$BR + +To summarize, when there is a negative symbol in front of a fraction, we could move it to the numerator or denominator, but may not change both the numerator and denominator to negative. + +END_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions100.pg new file mode 100644 index 0000000000..a525d7260f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions100.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^2+y^2)(x+y)(x-y) / (2x-3y)(x+y) +# * (2x-3y)(x-y) / (x-y)^2 +# Problem is given in expanded form. +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,9,1); +do {$b = random(2,9,1);} until (gcd($a,$b)==1); +$b = $b*random(-1,1,2); + +$num1 = Formula("$var1**4-$var2**4")->reduce; +$den1 = Formula("$a*$var1**2+($a-$b)*$var1*$var2-$b*$var2**2")->reduce; +$num1Factored = Formula("($var1**2+$var2**2)*($var1+$var2)*($var1-$var2)")->reduce; +$den1Factored = Formula("($a*$var1-$b*$var2)*($var1+$var2)")->reduce; + +$num2 = Formula("$a*$var1**2-($a+$b)*$var1*$var2+$b*$var2**2")->reduce; +$den2 = Formula("$var1**2-2*$var1*$var2+$var2**2")->reduce; +$num2Factored = Formula("($a*$var1-$b*$var2)*($var1-$var2)")->reduce; +$den2Factored = Formula("($var1-$var2)**2")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); +$ans = Formula("$var1**2+$var2**2" )->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. Please write your answer in *factored* form if possible. + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= \frac{([$var1]^2+[$var2]^2)([$var1]^2-[$var2]^2)}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions20.pg new file mode 100644 index 0000000000..e2de2154a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions20.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 6(x+y)/(x-y) * (x-y)/3(2x+y) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,6,1); +$b = $a*random(2,4,1); +$c = random(2,4,1); + +$num1 = Formula("$b*($var1+$var2)")->reduce; +$den1 = Formula("($var1-$var2)")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("($var1-$var2)")->reduce; +$den2 = Formula("$a*($c*$var1+$var2)")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); +$ans = Formula("($b/$a)($var1+$var2)/($c*$var1+$var2)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + +We cancel the factor [` ([$var1]-[$var2]) `] and reduce the fraction: + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] &= [$ans] +\end{aligned} + ``] + +Note that we may not further reduce [` [$ans]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions30.pg new file mode 100644 index 0000000000..44b271b60f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions30.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x^3/(x+2) * x^2 and x^3/(x+2) * 1/x^2 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$b = random(2,4,1); +$a = random($b+1,6,1); + +$num1 = Formula("$var1**$a")->reduce; +$den1 = Formula("$var1+$a")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$var1**$b")->reduce; +$den2 = Formula("1")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2")->reduce; +$ans1 = Formula("-$var1**($a+$b)/$den1, (-inf,inf)")->reduce; +$ans1->{trueDomain} = Compute("$var1 != -$a"); + +$frac1= Formula("$num1/$den1"); +$frac3= Formula("1/$num2")->reduce; +$ans2 = Formula("-$var1**($a-$b)/$den1, $var1 != 0")->reduce; +$ans2->{trueDomain} = Compute("$var1 != -$a and $var1 != 0"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expressions, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [`` -[$frac1] \cdot [$frac2] =``] [___________________]{$ans1} + + [`` -[$frac1] \cdot [$frac3] =``] [___________________]{$ans2} + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + -[$frac1] \cdot [$frac2] &= -[$frac1] \cdot \frac{[$num2]}{[$den2]} \\ + &= [$ans1] +\end{aligned} + ``] + + [`` +\begin{aligned} + -[$frac1] \cdot [$frac3] &= -\frac{[$var1]^{[$a-$b]}}{[$den1]} \cdot \frac{1}{1} \\ + &= [$ans2] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions40.pg new file mode 100644 index 0000000000..8002bf4066 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions40.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Simplify the rational expression like 5xy^2/4x^2 * 8x^3y/15y^5 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $numFinal = random(1,5,1); + $denFinal = random(2,6,1); + $a = random(2,6,1); + $b = random(2,6,1); + $d = $denFinal*$a; + $c = $numFinal*$b; +} until ( (gcd($c,$d)==1) && (gcd($a,$b)==1) && (gcd($numFinal,$denFinal)==1) ); + +do { + $e1 = random(1,5,1); + $e2 = random(1,5,1); + $e3 = random(1,5,1); + $e4 = random(1,5,1); + $e5 = random(1,5,1); + $e6 = random(1,5,1); + $eFinalNum = $e1+$e4-$e3; + $eFinalDen = $e6-$e2-$e5; +} until ( ($eFinalNum>0) && ($eFinalDen>0) ); + +$num1 = Formula("$a*$var1**$e1*$var2**$e2")->reduce; +$den1 = Formula("$b*$var1**$e3")->reduce; +$num1Factored = $num1; +$den1Factored = $den1; + +$num2 = Formula("$c*$var1**$e4*$var2**$e5")->reduce; +$den2 = Formula("$d*$var2**$e6")->reduce; +$num2Factored = $num2; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); +$ans = Formula("$numFinal*$var1**$eFinalNum/($denFinal*$var2**$eFinalDen)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = ($e3==1) ? "" : "^$e3"; +$s2 = ($e6==1) ? "" : "^$e6"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] &= \frac{[$num1] \cdot [$num2]}{[$den1] \cdot [$den2]} \\ + &= \frac{[$a] \cdot [$c] \cdot [$var1]^{[$e1+$e4]} \cdot [$var2]^{[$e2+$e5]}}{[$b] \cdot [$d] \cdot [$var1][$s1] \cdot [$var2][$s2]} \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions50.pg new file mode 100644 index 0000000000..bda6a7f1a5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions50.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^2+7x+12)/(x-5) * (2x-10)/(x+3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(1,6,1); + $b = random(1,6,1); + $c = random(1,6,1); +} until ( ($a!=$b) && ($a!=$c) && ($b!=$c) ); +$a = $a*random(-1,1,2); +$b = $b*random(-1,1,2); +$c = $c*random(-1,1,2); +$d = random(2,6,1); + +$num1 = Formula("$var1**2+($a+$b)*$var1+$a*$b")->reduce; +$den1 = Formula("$var1+$c")->reduce; +$num1Factored = Formula("($var1+$a)*($var1+$b)")->reduce; +$den1Factored = $den1; + +$num2 = Formula("$d*$var1+$d*$c")->reduce; +$den2 = Formula("$var1+$a")->reduce; +$num2Factored = Formula("$d*($var1+$c)")->reduce; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$ans = Formula("$d*($var1+$b), $var1 != -$a and $var1 != -$c")->reduce; + +$lostDomain = List(-$a,-$c); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factors [`[$var1]+[$a]`] and [`[$var1]+[$c]`] were canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions50nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions50nodomain.pg new file mode 100644 index 0000000000..0b33748b0f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions50nodomain.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^2+7x+12)/(x-5) * (2x-10)/(x+3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(1,6,1); + $b = random(1,6,1); + $c = random(1,6,1); +} until ( ($a!=$b) && ($a!=$c) && ($b!=$c) ); +$a = $a*random(-1,1,2); +$b = $b*random(-1,1,2); +$c = $c*random(-1,1,2); +$d = random(2,6,1); + +$num1 = Formula("$var1**2+($a+$b)*$var1+$a*$b")->reduce; +$den1 = Formula("$var1+$c")->reduce; +$num1Factored = Formula("($var1+$a)*($var1+$b)")->reduce; +$den1Factored = $den1; + +$num2 = Formula("$d*$var1+$d*$c")->reduce; +$den2 = Formula("$var1+$a")->reduce; +$num2Factored = Formula("$d*($var1+$c)")->reduce; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); +$ans = Formula("$d*($var1+$b)")->reduce; + +$lostDomain = List(-$a,-$c); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions53.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions53.pg new file mode 100644 index 0000000000..0d0cd9039e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions53.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x(x-4) / (x+2)(x-2) \cdot x(x-2) / (x-4)(x+5) +# +# Last updated: Carl Yao 12/18/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(2,5,1); + $a2 = $a**2; + $b = non_zero_random(-10,10,1); +} until ( (abs($b*$a2)<=50) && ($b!=$a2) ); +$d = -$a2*$b; + +$num1 = Formula("$var1**2-$a2*$var1")->reduce; +$den1 = Formula("$var1**2-$a2")->reduce; +$num1Factored = Formula("$var1*($var1-$a2)")->reduce; +$den1Factored = Formula("($var1+$a)*($var1-$a)")->reduce; + +$num2 = Formula("$var1**2-$a*$var1")->reduce; +$den2 = Formula("$var1**2+(-$a2+$b)*$var1+$d")->reduce; +$num2Factored = Formula("$var1*($var1-$a)")->reduce; +$den2Factored = Formula("($var1-$a2)*($var1+$b)")->reduce; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$ans = Formula("$var1**2/(($var1+$a)*($var1+$b)), $var1 != $a and $var1 != $a2")->reduce; +$ans->{trueDomain} = Compute("$var1 != $a and $var1 != $a2 and $var1 != -$a and $var1 != -$b"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions55.pg new file mode 100644 index 0000000000..f1fabc746e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions55.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^2+7xy+12y^2)/(x-5) * (2x-10)/(x+3y) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do { + $a = random(1,6,1); + $b = random(1,6,1); + $c = random(1,6,1); +} until ( ($a!=$b) && ($a!=$c) && ($b!=$c) ); +$a = $a*random(-1,1,2); +$b = $b*random(-1,1,2); +$c = $c*random(-1,1,2); +$d = random(2,6,1); + +$num1 = Formula("$var1**2+($a+$b)*$var1*$var2+$a*$b*$var2**2")->reduce; +$den1 = Formula("$var1+$c*$var2")->reduce; +$num1Factored = Formula("($var1+$a*$var2)*($var1+$b*$var2)")->reduce; +$den1Factored = $den1; + +$num2 = Formula("$d*$var1+$d*$c*$var2")->reduce; +$den2 = Formula("$var1+$a*$var2")->reduce; +$num2Factored = Formula("$d*($var1+$c*$var2)")->reduce; +$den2Factored = $den2; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$ans = Formula("$d*($var1+$b*$var2)")->reduce; + +$lostDomain = List(-$a,-$c); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions60.pg new file mode 100644 index 0000000000..4364277087 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions60.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (25-x^2)/14x^3y^8 * 7x^2y/(8x+40) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(1,10,1); +$d = random(2,6,1); + +$c = random(2,9,1); +$factor = random(2,9,1); +$b = $c*$factor; + +$e2 = random(1,5,1); +$e1 = random($e2+1,9,1); +$e4 = random(1,5,1); +$e3 = random($e4+1,9,1); + +$num1 = Formula("$a**2-$var1**2")->reduce; +$den1 = Formula("$b*$var1**$e1*$var2**$e3")->reduce; +$num1Factored = Formula("-($var1+$a)*($var1-$a)")->reduce; +$den1Factored = $den1; + +$num2 = Formula("$c*$var1**$e2*$var2**$e4")->reduce; +$den2 = Formula("$d*$var1+$d*$a")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("$d*($var1+$a)")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); +$ans = Formula(" -($var1-$a)/( $factor*$d*$var1**($e1-$e2)*$var2**($e3-$e4) )" )->reduce; + +$lostDomain = List(-$a); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. Don't forget to write the domain conditions lost during the simplification, if any. Please write your answer in *factored* form if possible. + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + +The domain condition(s) lost during the simplification is (are) [`[$var] \ne`][_____]{$lostDomain}. If you need to enter more than one number, use comma to separate them. + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= \frac{-([$var1]^2-[$a**2])}{[$den1]} \cdot [$frac2] \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var1]+[$a]`] was canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions60nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions60nodomain.pg new file mode 100644 index 0000000000..dfb820dcb3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions60nodomain.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (25-x^2)/14x^3y^8 * 7x^2y/(8x+40) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(1,10,1); +$d = random(2,6,1); + +$c = random(2,9,1); +$factor = random(2,9,1); +$b = $c*$factor; + +$e2 = random(1,5,1); +$e1 = random($e2+1,9,1); +$e4 = random(1,5,1); +$e3 = random($e4+1,9,1); + +$num1 = Formula("$a**2-$var1**2")->reduce; +$den1 = Formula("$b*$var1**$e1*$var2**$e3")->reduce; +$num1Factored = Formula("-($var1+$a)*($var1-$a)")->reduce; +$den1Factored = $den1; + +$num2 = Formula("$c*$var1**$e2*$var2**$e4")->reduce; +$den2 = Formula("$d*$var1+$d*$a")->reduce; +$num2Factored = $num2; +$den2Factored = Formula("$d*($var1+$a)")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); +$ans = Formula(" -($var1-$a)/( $factor*$d*$var1**($e1-$e2)*$var2**($e3-$e4) )" )->reduce; + +$lostDomain = List(-$a); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= \frac{-([$var1]^2-[$a**2])}{[$den1]} \cdot [$frac2] \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions70.pg new file mode 100644 index 0000000000..4b0f72c0e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions70.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 8(x-5) / [-3(x-8)(x+5)] * (x-8)^2 / [2x(x-5)] +# but given in unfactored form. +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", +"contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +do{ +$f = random(2,5,1); +$factor1 = random(2,5,1); +$a = $f*$factor1; +do {$c = random(2,9,1);} until (gcd($c,$a)==1); + +$b = random(1,5,1); +do {$d = random(1,5,1);} until ($b!=$d); +do {$e = random(1,5,1);} until ( ($e!=$d)); + +$b = $b*random(-1,1,2); +$d = $d*random(-1,1,2); +$implicit = Set($b,$d); +$explicit = Set(0,-$e); +} until (!$explicit->intersects($implicit)); + +$num1 = Formula("$a*$var1-$a*$b")->reduce->reduce; +$den1 = Formula("$c*$d*$e-$c*($e-$d)*$var1-$c*$var1**2")->reduce; +$num1Factored = Formula("$a*($var1-$b)")->reduce; +$den1Factored = Formula("-$c*($var1-$d)*($var1+$e)")->reduce; + +$num2 = Formula("$var1**2-2*$d*$var1+($d)**2")->reduce; +$den2 = Formula("$f*$var1**2-$f*$b*$var1")->reduce; +$num2Factored = Formula("($var1-$d)**2")->reduce; +$den2Factored = Formula("$f*$var1*($var1-$b)")->reduce; + +$frac1= Formula("$num1/$den1")->reduce; +$frac2= Formula("$num2/$den2")->reduce; +$ans = Formula("-$factor1($var1-$d)/($c*$var1*($var1+$e)), $var1 != $b and $var1 != $d")->reduce; +$ans->{trueDomain} = Compute("$var1 != $b and $var1 != $d and $var1 != 0 and $var1 != -$e"); + +$lostDomain = List($b,$d); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + + +END_PGML + +################################################### + +$s0 = $e-$d; +$s1 = Formula("-$c($var1**2+$s0*$var1-$d*$e)")->reduce; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= \frac{[$num1]}{-[$c][$var1]^2-[$c*($e-$d)][$var1]+[$c*$d*$e]} \cdot [$frac2] \\ + &= \frac{[$num1Factored]}{[$s1]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factors [`[$var1]-[$b]`] and [`[$var1]-[$d]`] were canceled, the domain condition lost during the simplification is [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions70nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions70nodomain.pg new file mode 100644 index 0000000000..8d1988fe08 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions70nodomain.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 8(x-5) / [-3(x-8)(x+5)] * (x-8)^2 / [2x(x-5)] +# but given in unfactored form. +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$f = random(2,5,1); +$factor1 = random(2,5,1); +$a = $f*$factor1; +do {$c = random(2,9,1);} until (gcd($c,$a)==1); + +$b = random(1,5,1); +do {$d = random(1,5,1);} until ($b!=$d); +do {$e = random(1,5,1);} until ( ($e!=$d)); + +$b = $b*random(-1,1,2); +$d = $d*random(-1,1,2); + +$num1 = Formula("$a*$var1-$a*$b")->reduce; +$den1 = Formula("$c*$d*$e-$c*($e-$d)*$var1-$c*$var1**2")->reduce; +$num1Factored = Formula("$a*($var1-$b)")->reduce; +$den1Factored = Formula("-$c*($var1-$d)*($var1+$e)")->reduce; + +$num2 = Formula("$var1**2-2*$d*$var1+($d)**2")->reduce; +$den2 = Formula("$f*$var1**2-$f*$b*$var1")->reduce; +$num2Factored = Formula("($var1-$d)**2")->reduce; +$den2Factored = Formula("$f*$var1*($var1-$b)")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); +$ans = Formula("-$factor1($var1-$d)/($c*$var1*($var1+$e))")->reduce; + +$lostDomain = List($b,$d); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$s0 = $e-$d; +$s1 = Formula("-$c($var1**2-$s0*$var1+$d*$e)")->reduce; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= \frac{[$num1]}{-[$c][$var1]^2-[$c*($e-$d)][$var1]+[$c*$d*$e]} \cdot [$frac2] \\ + &= \frac{[$num1Factored]}{[$s1]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions80.pg new file mode 100644 index 0000000000..c742059dbe --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions80.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2x^2+3x-5)/(8x^2-12x) * +# (6-4x^2)/(4x^2-25) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,9,1); +do {$b = random(2,9,1);} until (gcd($a,$b)==1); +do {$c = random(2,9,1);} until ($a!=$c); +do {$d = random(2,5,1);} until (gcd($c,$d)==1); +$e = random(2,5,1); +$factor = random(2,9,1); +$f = $e*$factor; + +$b = $b*random(-1,1,2); + +$e1 = random(1,5,1); +$e2 = random(1,5,1); + +$num1 = Formula("$a*$var1**2+($b-$a)*$var1-$b")->reduce; +$den1 = Formula("$f*$c*$var1**($e1+1)-$f*$d*$var1**$e1")->reduce; +$num1Factored = Formula("($a*$var1+$b)*($var1-1)")->reduce; +$den1Factored = Formula("$f*$var1**$e1*($c*$var1-$d)")->reduce; + +$num2 = Formula("$e*$d*$var1**$e1-$e*$c*$var1**($e1+1)")->reduce; +$den2 = Formula("$a**2*$var1**2-$b*$b")->reduce; +$num2Factored = Formula("-$e*$var1**$e1*($c*$var1-$d)")->reduce; +$den2Factored = Formula("($a*$var1+$b)*($a*$var1-$b)")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); +$ans = Formula(" -($var1-1)/( $factor*($a*$var1-$b) ), $var1 != -$b/$a and $var1 != $d/$c and $var1 != 0" )->reduce; +$ans->{trueDomain} = Compute("$var1 != -$b/$a and $var1 != $d/$c and $var1 != 0 and $var1 != $b/$a "); + + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0); +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' and ',TeX=>'\hbox{ and }'}, + 'or'=>{string=>' and ',TeX=>'\hbox{ and }'} +); +Context()->lists->set(List => {separator => "\; and \;"}); +$lostFrac1 = -Fraction($b,$a)->reduce; +$lostFrac2 = Fraction($d,$c)->reduce; +$lostFrac3 = 0; +$lostDomain = Compute("$lostFrac1,$lostFrac2,$lostFrac3"); + +Context("RestrictedDomains"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var1^2 for $var1!=1 and $var1!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + + +END_PGML + +################################################### + +$e3 = $e1==1 ? "" : "^{$e1}"; + +$s1 = "\frac{($a $var1+$b)($var1-1)}{$f $var1 $e3 ($c $var1-$d)} \cdot \frac{$e $var1 $e3 ($d - $c $var1)}{($a $var1+$b)($a $var1 - $b)}"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= [$s1] \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factors [`[$a][$var1]+[$b]`] and [`[$c][$var1]-[$d]`] were canceled, the domain condition lost during the simplification are [`[$var1] \ne [$lostDomain]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions80nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions80nodomain.pg new file mode 100644 index 0000000000..5d7bc72b6d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions80nodomain.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2x^2+3x-5)/(8x^2-12x) * +# (6-4x^2)/(4x^2-25) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,5,1); +do {$b = random(2,5,1);} until (gcd($a,$b)==1); +do {$c = random(2,5,1);} until ($a!=$c); +do {$d = random(2,5,1);} until (gcd($c,$d)==1); +$e = random(2,5,1); +$factor = random(2,5,1); +$f = $e*$factor; + +$b = $b*random(-1,1,2); + +$e1 = random(1,5,1); +$e2 = random(1,5,1); + +$num1 = Formula("$a*$var1**2+($b-$a)*$var1-$b")->reduce; +$den1 = Formula("$f*$c*$var1**($e1+1)-$f*$d*$var1**$e1")->reduce; +$num1Factored = Formula("($a*$var1+$b)*($var1-1)")->reduce; +$den1Factored = Formula("$f*$var1**$e1*($c*$var1-$d)")->reduce; + +$num2 = Formula("$e*$d*$var1**$e1-$e*$c*$var1**($e1+1)")->reduce; +$den2 = Formula("$a**2*$var1**2-$b*$b")->reduce; +$num2Factored = Formula("-$e*$var1**$e1*($c*$var1-$d)")->reduce; +$den2Factored = Formula("($a*$var1+$b)*($a*$var1-$b)")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); +$ans = Formula(" -($var1-1)/( $factor*($a*$var1-$b) )" )->reduce; + +Context("LimitedFraction")->flags->set( + reduceFractions => 0, + showMixedNumbers=>0, + showExtraParens=>0); +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' and ',TeX=>'\hbox{ and }'}, + 'or'=>{string=>' and ',TeX=>'\hbox{ and }'} +); +Context()->lists->set(List => {separator => "\; and \;"}); +$lostFrac1 = -Fraction($b,$a)->reduce; +$lostFrac2 = Fraction($d,$c)->reduce; +$lostFrac3 = 0; +$lostDomain = Compute("$lostFrac1,$lostFrac2,$lostFrac3"); + +Context("LimitedFactor"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$e3 = $e1==1 ? "" : "^{$e1}"; + +$s1 = "\frac{($a $var1+$b)($var1-1)}{$f $var1 $e3 ($c $var1-$d)} \cdot \frac{$e $var1 $e3 ($d - $c $var1)}{($a $var1+$b)($a $var1 - $b)}"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= [$s1] \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions85.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions85.pg new file mode 100644 index 0000000000..6eab792802 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions85.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2x^2+3x-5)/(8x^2-12x) * +# (6-4x^2)/(4x^2-25) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,5,1); +do {$b = random(2,5,1);} until (gcd($a,$b)==1); +do {$c = random(2,5,1);} until ($a!=$c); +do {$d = random(2,5,1);} until (gcd($c,$d)==1); +$e = random(2,5,1); +$factor = random(2,5,1); +$f = $e*$factor; + +$b = $b*random(-1,1,2); + +$e1 = random(1,5,1); +$e2 = random(1,5,1); + +$num1 = Formula("$a*$var1**2*$var2**2+($b-$a)*$var1*$var2-$b")->reduce; +$den1 = Formula("$f*$c*$var1**($e1+1)*$var2-$f*$d*$var1**$e1")->reduce; +$num1Factored = Formula("($a*$var1*$var2+$b)*($var1*$var2-1)")->reduce; +$den1Factored = Formula("$f*$var1**$e1*($c*$var1*$var2-$d)")->reduce; + +$num2 = Formula("$e*$d*$var1**$e1-$e*$c*$var1**($e1+1)*$var2")->reduce; +$den2 = Formula("$a**2*$var1**2*$var2**2-$b*$b")->reduce; +$num2Factored = Formula("-$e*$var1**$e1*($c*$var1*$var2-$d)")->reduce; +$den2Factored = Formula("($a*$var1*$var2+$b)*($a*$var1*$var2-$b)")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); +$ans = Formula(" -($var1*$var2-1)/( $factor*($a*$var1*$var2-$b) )" )->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$e3 = $e1==1 ? "" : "^{$e1}"; + +$s1 = "\frac{($a $var1 $var2+$b)($var1 $var2-1)}{$f $var1 $e3 ($c $var1 $var2-$d)} \cdot \frac{$e $var1 $e3 ($d - $c $var1 $var2)}{($a $var1 $var2+$b)($a $var1 $var2 - $b)}"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= [$s1] \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions90.pg new file mode 100644 index 0000000000..1098b8368c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions90.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2x^2+3xy-5y^2)/(8x^2y-12xy) * +# (6xy-4x^2y)/(4x^2-25y^2) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','multiply','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,9,1); +do {$b = random(2,9,1);} until (gcd($a,$b)==1); +do {$c = random(2,9,1);} until ($a!=$c); +do {$d = random(2,5,1);} until (gcd($c,$d)==1); +$e = random(2,5,1); +$factor = random(2,9,1); +$f = $e*$factor; + +$b = $b*random(-1,1,2); + +$e1 = random(1,5,1); +$e2 = random(1,5,1); + +$num1 = Formula("$a*$var1**2+($b-$a)*$var1*$var2-$b*$var2**2")->reduce; +$den1 = Formula("$f*$c*$var1**($e1+1)*$var2**$e2-$f*$d*$var1**$e1*$var2**($e2+1)")->reduce; +$num1Factored = Formula("($a*$var1+$b$var2)*($var1-$var2)")->reduce; +$den1Factored = Formula("$f*$var1**$e1*$var2**$e2*($c*$var1-$d*$var2)")->reduce; + +$num2 = Formula("$e*$d*$var1**$e1*$var2**($e2+1)-$e*$c*$var1**($e1+1)*$var2**$e2")->reduce; +$den2 = Formula("$a**2*$var1**2-($b)**2*$var2**2")->reduce; +$num2Factored = Formula("-$e*$var1**$e1*$var2**$e2*($c*$var1-$d*$var2)")->reduce; +$den2Factored = Formula("($a*$var1+$b*$var2)*($a*$var1-$b*$var2)")->reduce; + +$frac1= Formula("$num1/$den1"); +$frac2= Formula("$num2/$den2"); +$ans = Formula(" -($var1-$var2)/( $factor*($a*$var1-$b*$var2) )" )->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. Please write your answer in *factored* form if possible. + + [``[$frac1] \cdot [$frac2] =``] [___________________]{$ans} + +END_PGML + +################################################### + +$e3 = $e1==1 ? "" : "^{$e1}"; +$e4 = $e2==1 ? "" : "^{$e2}"; + +$s1 = "\frac{($a $var1+$b $var2)($var1-$var2)}{$f $var1 $e3 $var2 $e4($c $var1-$d $var2)} \cdot \frac{$e $var1 $e3 $var2 $e4($d $var2 - $c $var1)}{($a $var1+$b $var2)($a $var1 - $b $var2)}"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$frac1] \cdot [$frac2] + &= [$s1] \\ + &= \frac{[$num1Factored]}{[$den1Factored]} \cdot \frac{[$num2Factored]}{[$den2Factored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions10.pg new file mode 100644 index 0000000000..ae51684659 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions10.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression x/(x+1) and 2(x+1)/(x+1) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "answerHints.pl", + "PGcourse.pl", + "PCCmacros.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); + +$a = random(1,10,1); +do {$b=random(2,10,1);} until (gcd($a,$b)==1); +# $a should not be 1. Doing thisawkward redefinition to avoid messing up +# seeds in active use +$a = 2 if ($a == 1); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Select all correct simplifications, ignoring possible domain restrictions.", +"\( \frac{x+ $a}{x+$a}=1 \) $BR$BR", +"\( \frac{$b(x-$a)}{x -$a}=$b \) $BR$BR", +"\( \frac{$a x}{x}=$a \) $BR$BR", +"\( \frac{x}{$b x}=\frac{1}{$b} \) $BR$BR", +); + +$mc -> extra( +"\( \frac{x+$a}{x}=$a \) $BR$BR", +"\( \frac{x+$a}{$a}=x \) $BR$BR", +"\( \frac{$a}{x+$a}=\frac{1}{x} \) $BR$BR", +"\( \frac{$a}{x+$a}=\frac{1}{x+1} \) $BR$BR", +"\( \frac{$b x+$a}{$b}=x+$a \) $BR$BR", +"\( \frac{x+$a}{x+$b}=\frac{$a}{$b} \) $BR$BR", +"\( \frac{$b x+$a}{x + $a}=$b \) $BR$BR", +); + + +############################################## + +Context()->texStrings; +BEGIN_TEXT + +$BR +\{ $mc -> print_q() \} +$BR +\{ $mc -> print_a() \} + +$PAR +\{KeyboardInstructions('To receive full credit, you must get each checkbox correct.')\} +END_TEXT +Context()->normalStrings; + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 1; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +################################################### + +BEGIN_SOLUTION + +The correct answer is \{ $mc->correct_ans() \}. $BR$BR + +We may not cross out common terms when the operation is addition or subtraction. For example, the following is $BBOLD incorrect $EBOLD: $BR$BR + +$BCENTER \( \frac{1+2}{2+2} = \frac{1}{2} \) (incorrect) $ECENTER $BR$BR + +Otherwise, we are saying \( \frac{3}{4} = \frac{1}{2} \).$BR$BR + +We may cross out common terms when the operation is multiplication. For example, the following is correct: $BR$BR + +$BCENTER \( \frac{2x}{2} = \frac{x}{1} = x \) $ECENTER $BR$BR + +We may cross out common factors like \(x+$a\) when the "major" operation is multiplication. For example, the following is correct: $BR$BR + +$BCENTER \( \frac{$b(x+$a)}{x+$a} = \frac{$b}{1} = $b \)$ECENTER $BR$BR + +END_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions100.pg new file mode 100644 index 0000000000..6cfdcdae18 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions100.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^2-2x) / (-x^2+4) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(1,6,1)*random(-1,1,2); + +$num = Formula("$var**2-$a*$var")->reduce; +$den = Formula("($a*$a)-$var**2")->reduce; +$numFactored = Formula("$var*($var-$a)")->reduce; +$denFactored = Formula("-($var+$a)($var-$a)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-$var/($var+$a), $var != $a")->reduce; +$ans->{trueDomain} = Compute("$var != -$a and $var != $a"); + +$lostDomain = List($a); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + + +END_PGML + +############################################## + +$s2 = Formula("-$var**2+$a*$a")->reduce; +$s3 = Formula("-($var**2-$a*$a)")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors. + +If a polynomial is not in order, we order it by the variable's degrees. + +If the leading coefficient is negative, we factor out [`-1`]. + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$s2]} \\ + &= \frac{[$numFactored]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]-[$a]`] was crossed out, the domain condition lost during the simplification is [` [$var] \ne [$a] `]. + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions100nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions100nodomain.pg new file mode 100644 index 0000000000..155e36133f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions100nodomain.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^2-2x) / (-x^2+4) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(1,6,1)*random(-1,1,2); + +$num = Formula("$var**2-$a*$var")->reduce; +$den = Formula("($a*$a)-$var**2")->reduce; +$numFactored = Formula("$var*($var-$a)")->reduce; +$denFactored = Formula("-($var+$a)($var-$a)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-$var/($var+$a)")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s2 = Formula("-$var**2+$a*$a")->reduce; +$s3 = Formula("-($var**2-$a*$a)")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms. + +If a polynomial is not in order, we order it by the variable's degrees. + +If the leading coefficient is negative, we factor out [`-1`]. + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$s2]} \\ + &= \frac{[$numFactored]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions110.pg new file mode 100644 index 0000000000..5cdcb5c54f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions110.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (-x^2+2x) / (-x^2+5x-6) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(1,6,1)*random(-1,1,2); +do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b); + +$num = Formula("-$var**2-$a*$var")->reduce; +$den = Formula("-($a*$b)-($a+$b)*$var-$var**2")->reduce; +$numFactored = Formula("-$var*($var+$a)")->reduce; +$denFactored = Formula("-($var+$a)*($var+$b)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("$var/($var+$b), $var != -$a")->reduce; +$ans->{trueDomain} = Compute("$var != -$a and $var != -$b"); + +$lostDomain = List(-$a); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$a; +$s2 = Formula("-[$var]^2-[$a+$b][$var]-[$a*$b]")->reduce; +$s3 = Formula("-([$var]^2+[$a+$b][$var]+[$a*$b])")->reduce; +$s4 = Formula("-($var**2+$a*$var)")->reduce; +$s5 = Formula("-$var*($var+$a)")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors. + +If a polynomial is not in order, we order it by the variable's degrees. + +If the leading coefficient is negative, we factor out [`-1`]. + + [`` +\begin{aligned} + [$question] &= \frac{[$s4]}{[$s2]} \\ + &= \frac{[$s5]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]+[$a]`] was crossed out, the domain condition lost during the simplification is [` [$var] \ne [$s1] `]. + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions110nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions110nodomain.pg new file mode 100644 index 0000000000..776c6ad770 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions110nodomain.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (-x^2+2x) / (-x^2+5x-6) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(1,6,1)*random(-1,1,2); +do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b); + +$num = Formula("-$var**2-$a*$var")->reduce; +$den = Formula("-($a*$b)-($a+$b)*$var-$var**2")->reduce; +$numFactored = Formula("-$var*($var+$a)")->reduce; +$denFactored = Formula("-($var+$a)*($var+$b)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("$var/($var+$b)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$a; +$s2 = Formula("-[$var]^2-[$a+$b][$var]-[$a*$b]")->reduce; +$s3 = Formula("-([$var]^2+[$a+$b][$var]+[$a*$b])")->reduce; +$s4 = Formula("-($var**2+$a*$var)")->reduce; +$s5 = Formula("-$var*($var+$a)")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms. + +If a polynomial is not in order, we order it by the variable's degrees. + +If the leading coefficient is negative, we factor out [`-1`]. + + [`` +\begin{aligned} + [$question] &= \frac{[$s4]}{[$s2]} \\ + &= \frac{[$s5]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions120.pg new file mode 100644 index 0000000000..cb574cad99 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions120.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2x^2-x-1 / 2x+1-3x^2 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = list_random(2,3,5); +do {$b = random(2,6,1)*random(-1,1,2);} until (gcd($a,abs($b))==1); +$c = 1; +do {$d = random(2,6,1);} until ($a!=$d); +do {$e = random(2,6,1)*random(-1,1,2);} until (gcd($d,abs($e))==1); + +$num = Formula("$a*$var**2+($a*$c+$b)*$var+($b*$c)")->reduce; +$den = Formula("-($d*$c+$e)*$var-($e*$c)-$d*$var**2")->reduce; +$numFactored = Formula("($a*$var+$b)*($var+$c)")->reduce; +$denFactored = Formula("-($d*$var+$e)($var+$c)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-($a*$var+$b)/($d*$var+$e), $var != -$c")->reduce; +$ans->{trueDomain} = Compute("$var != -$c and $var != -$e/$d"); + +$lostDomain = List(-$c); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + + +END_PGML + +############################################## + +$s1 = -$c; +$s2 = Formula("-$d*$var**2-($d*$c+$e)*$var-($e*$c)")->reduce; +$s3 = Formula("-($d*$var**2+($d*$c+$e)*$var+($e*$c))")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$s2]} \\ + &= \frac{[$numFactored]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]+[$c]`] was crossed out, the domain condition lost during the simplification is [` [$var] \ne [$s1] `]. + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions120nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions120nodomain.pg new file mode 100644 index 0000000000..bf80c0e230 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions120nodomain.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2x^2-x-1 / 2x+1-3x^2 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = list_random(2,3,5); +do {$b = random(2,6,1)*random(-1,1,2);} until (gcd($a,abs($b))==1); +$c = 1; +do {$d = random(2,6,1);} until ($a!=$d); +do {$e = random(2,6,1)*random(-1,1,2);} until (gcd($d,abs($e))==1); + +$num = Formula("$a*$var**2+($a*$c+$b)*$var+($b*$c)")->reduce; +$den = Formula("-($d*$c+$e)*$var-($e*$c)-$d*$var**2")->reduce; +$numFactored = Formula("($a*$var+$b)*($var+$c)")->reduce; +$denFactored = Formula("-($d*$var+$e)($var+$c)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-($a*$var+$b)/($d*$var+$e)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$c; +$s2 = Formula("-$d*$var**2-($d*$c+$e)*$var-($e*$c)")->reduce; +$s3 = Formula("-($d*$var**2+($d*$c+$e)*$var+($e*$c))")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$s2]} \\ + &= \frac{[$numFactored]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions130.pg new file mode 100644 index 0000000000..a0d3d87b29 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions130.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^2+2x-8) / (4x-4-x^2) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(1,6,1)*random(-1,1,2); +do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b); + +$num = Formula("$var**2+($a+$b)*$var+($a*$b)")->reduce; +$den = Formula("-(2*$b)*$var-$var**2-($b*$b)")->reduce; +$numFactored = Formula("($var+$a)*($var+$b)")->reduce; +$denFactored = Formula("-($var+$b)**2")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-($var+$a)/($var+$b) for (-inf,inf)")->reduce; +$ans->{trueDomain} = Compute("$var != -$b"); + +$lostDomain = List(-$b); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$b; +$s2 = Formula("-$var**2-2*$b*$var-$b*$b")->reduce; +$s3 = Formula("-($var**2+2*$b*$var+$b*$b)")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors. + +If a polynomial is not in order, we order it by the variable's degrees. + +If the leading coefficient is negative, we factor out [`-1`]. + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$s2]} \\ + &= \frac{[$numFactored]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]+[$b]`] was crossed out, the domain condition lost during the simplification is [` [$var] \ne [$s1] `]. + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions130nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions130nodomain.pg new file mode 100644 index 0000000000..24bb42cff5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions130nodomain.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^2+2x-8) / (4x-4-x^2) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(1,6,1)*random(-1,1,2); +do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b); + +$num = Formula("$var**2+($a+$b)*$var+($a*$b)")->reduce; +$den = Formula("-(2*$b)*$var-$var**2-($b*$b)")->reduce; +$numFactored = Formula("($var+$a)*($var+$b)")->reduce; +$denFactored = Formula("-($var+$b)**2")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-($var+$a)/($var+$b)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$b; +$s2 = Formula("-$var**2-2*$b*$var-$b*$b")->reduce; +$s3 = Formula("-($var**2+2*$b*$var+$b*$b)")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms. + +If a polynomial is not in order, we order it by the variable's degrees. + +If the leading coefficient is negative, we factor out [`-1`]. + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$s2]} \\ + &= \frac{[$numFactored]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140.pg new file mode 100644 index 0000000000..d92d3c36c7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (-x^2+x+20) / (x^2-10x+25) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(1,6,1)*random(-1,1,2); +do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b and $a!=-$b); + +$num = Formula("-$var**2-($a+$b)*$var-($a*$b)")->reduce; +$den = Formula("$var**2-($b*$b)")->reduce; +$numFactored = Formula("-($var+$a)*($var+$b)")->reduce; +$denFactored = Formula("($var+$b)($var-$b)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-($var+$a)/($var-$b), $var != -$b")->reduce; +$ans->{trueDomain} = Compute("$var != $b and $var != -$b"); + +$lostDomain = List(-$b); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$b; +$s2 = Formula("-($var**2+($a+$b)*$var+($a*$b))")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors. + +If a polynomial is not in order, we order it by the variable's degrees. + +If the leading coefficient is negative, we factor out [`-1`]. + + [`` +\begin{aligned} + [$question] &= \frac{[$s2]}{[$den]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]+[$b]`] was crossed out, the domain condition lost during the simplification is [` [$var] \ne [$s1] `]. + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140nodomain.pg new file mode 100644 index 0000000000..bb635dd649 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140nodomain.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (-x^2+x+20) / (x^2-10x+25) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(1,6,1)*random(-1,1,2); +do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b and $a!=-$b); + +$num = Formula("-$var**2-($a+$b)*$var-($a*$b)")->reduce; +$den = Formula("$var**2-($b*$b)")->reduce; +$numFactored = Formula("-($var+$a)*($var+$b)")->reduce; +$denFactored = Formula("($var+$b)($var-$b)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-($var+$a)/($var-$b)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$b; +$s2 = Formula("-($var**2+($a+$b)*$var+($a*$b))")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms. + +If a polynomial is not in order, we order it by the variable's degrees. + +If the leading coefficient is negative, we factor out [`-1`]. + + [`` +\begin{aligned} + [$question] &= \frac{[$s2]}{[$den]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions141.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions141.pg new file mode 100644 index 0000000000..f7403a05bc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions141.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (-x^2+xy+20y^2) / (x^2-10xy+25y^2) +# +# Last updated: Carl Yao 12/16/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(1,6,1)*random(-1,1,2); +do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b and $a!=-$b); + +$num = Formula("-$var1**2-($a+$b)*$var1*$var2-($a*$b)*$var2**2")->reduce; +$den = Formula("$var1**2-($b*$b)*$var2**2")->reduce; +$numFactored = Formula("-($var1+$a*$var2)*($var1+$b*$var2)")->reduce; +$denFactored = Formula("($var1+$b*$var2)($var1-$b*$var2)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-($var1+$a*$var2)/($var1-$b*$var2)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$b; +$s2 = Formula("-($var1**2+($a+$b)*$var1*$var2+($a*$b)*$var2**2)")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms. + +If a polynomial is not in order, we order it by the variable's degrees. + +If the leading coefficient is negative, we factor out [`-1`]. + + [`` +\begin{aligned} + [$question] &= \frac{[$s2]}{[$den]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions150.pg new file mode 100644 index 0000000000..c430edd7d5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions150.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2x^2-x-1 / 2x+1-3x^2 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = list_random(2,3,5); +do {$b = random(2,6,1)*random(-1,1,2);} until (gcd($a,abs($b))==1); +$c = 1; +do {$d = random(2,6,1);} until ($a!=$d); +do {$e = random(2,6,1);} until (gcd($d,abs($e))==1); + +$num = Formula("$a*$var**2+($a*$c+$b)*$var+($b*$c)")->reduce; +$den = Formula("-($d*$c+$e)*$var-($e*$c)-$d*$var**2")->reduce; +$numFactored = Formula("($a*$var+$b)*($var+$c)")->reduce; +$denFactored = Formula("-($d*$var+$e)($var+$c)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-($a*$var+$b)/($d*$var+$e), $var != -$c")->reduce; +$ans->{trueDomain} = Compute("$var != -$c and $var != -$e/$d"); + +$lostDomain = List(-$c); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$c; +$s2 = Formula("-$d*$var**2-($d*$c+$e)*$var-($e*$c)")->reduce; +$s3 = Formula("-($d*$var**2+($d*$c+$e)*$var+($e*$c))")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$s2]} \\ + &= \frac{[$numFactored]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]+[$c]`] was crossed out, the domain condition lost during the simplification is [` [$var] \ne [$s1] `]. + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions150nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions150nodomain.pg new file mode 100644 index 0000000000..353f654c59 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions150nodomain.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2x^2-x-1 / 2x+1-3x^2 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = list_random(2,3,5); +do {$b = random(2,6,1)*random(-1,1,2);} until (gcd($a,abs($b))==1); +$c = 1; +do {$d = random(2,6,1);} until ($a!=$d); +do {$e = random(2,6,1);} until (gcd($d,abs($e))==1); + +$num = Formula("$a*$var**2+($a*$c+$b)*$var+($b*$c)")->reduce; +$den = Formula("-($d*$c+$e)*$var-($e*$c)-$d*$var**2")->reduce; +$numFactored = Formula("($a*$var+$b)*($var+$c)")->reduce; +$denFactored = Formula("-($d*$var+$e)($var+$c)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-($a*$var+$b)/($d*$var+$e)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$c; +$s2 = Formula("-$d*$var**2-($d*$c+$e)*$var-($e*$c)")->reduce; +$s3 = Formula("-($d*$var**2+($d*$c+$e)*$var+($e*$c))")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$s2]} \\ + &= \frac{[$numFactored]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions151.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions151.pg new file mode 100644 index 0000000000..5906f126b9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions151.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 2x^2y^2-xy-1 / 2xy+1-3x^2y^2 +# +# Last updated: Carl Yao 12/16/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = list_random(2,3,5); +do {$b = random(2,6,1)*random(-1,1,2);} until (gcd($a,abs($b))==1); +$c = 1; +do {$d = random(2,6,1);} until ($a!=$d); +do {$e = random(2,6,1);} until (gcd($d,abs($e))==1); + +$num = Formula("$a*$var1**2*$var2**2+($a*$c+$b)*$var1*$var2+($b*$c)")->reduce; +$den = Formula("-($d*$c+$e)*$var1*$var2-($e*$c)-$d*$var1**2*$var2**2")->reduce; +$numFactored = Formula("($a*$var1*$var2+$b)*($var1*$var2+$c)")->reduce; +$denFactored = Formula("-($d*$var1*$var2+$e)($var1*$var2+$c)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-($a*$var1*$var2+$b)/($d*$var1*$var2+$e)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$c; +$s2 = Formula("-$d*$var1**2*$var2**2-($d*$c+$e)*$var1*$var2-($e*$c)")->reduce; +$s3 = Formula("-($d*$var1**2*$var2**2+($d*$c+$e)*$var1*$var2+($e*$c))")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$s2]} \\ + &= \frac{[$numFactored]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions160.pg new file mode 100644 index 0000000000..cb8131c964 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions160.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like -3x^2-x^3 / x^2+5x+6 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,4,1); +$b = non_zero_random(-6,6,1); +do {$c=non_zero_random(-6,6,1);} until ($b!=$c); + +$num = Formula("-$b*$var**$a-$var**($a+1)")->reduce; +$den = Formula("$var**2+($b+$c)*$var+$b*$c")->reduce; +$numFactored = Formula("-$var**$a*($var+$b)")->reduce; +$denFactored = Formula("($var+$b)($var+$c)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-$var**$a/($var+$c), $var != -$b")->reduce; +$ans->{trueDomain} = Compute("$var != -$c and $var != -$b"); + +$lostDomain = List(-$b); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$b; +$s2 = Formula("-$var**($a+1)-$b*$var**$a")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors: + + [`` +\begin{aligned} + [$question] &= \frac{[$s2]}{[$denFactored]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]+[$b]`] was crossed out, the domain condition lost during the simplification is [` [$var] \ne [$s1] `]. + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions160nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions160nodomain.pg new file mode 100644 index 0000000000..102575a197 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions160nodomain.pg @@ -0,0 +1,81 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like -3x^2-x^3 / x^2+5x+6 +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,4,1); +$b = non_zero_random(-6,6,1); +do {$c=non_zero_random(-6,6,1);} until ($b!=$c); + +$num = Formula("-$b*$var**$a-$var**($a+1)")->reduce; +$den = Formula("$var**2+($b+$c)*$var+$b*$c")->reduce; +$numFactored = Formula("-$var**$a*($var+$b)")->reduce; +$denFactored = Formula("($var+$b)($var+$c)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-$var**$a/($var+$c)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$b; +$s2 = Formula("-$var**($a+1)-$b*$var**$a")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms: + + [`` +\begin{aligned} + [$question] &= \frac{[$s2]}{[$denFactored]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions170.pg new file mode 100644 index 0000000000..dda4b35004 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions170.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x^2(x+3)(x+4) / x^2(x+2)(x+3) +# in expanded form. +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = list_random(2,3,4); +$b = non_zero_random(-6,6,1); +do {$c=non_zero_random(-6,6,1);} until ($b!=$c); +do {$d=non_zero_random(-6,6,1);} until ( ($d!=$b) && ($d!=$c) ); + +$num = Formula("$var**($a+2)+($b+$c)*$var**($a+1)+$b*$c*$var**$a")->reduce; +$den= Formula("$var**($a+2)+($b+$d)*$var**($a+1)+$b*$d*$var**$a")->reduce; +$numFactored = Formula("$var**$a*($var+$b)*($var+$c)")->reduce; +$denFactored = Formula("$var**$a*($var+$b)*($var+$d)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("($var+$c)/($var+$d), $var != -$b and $var != 0")->reduce; +$ans->{trueDomain} = Compute("$var != -$d and $var != -$b and $var != 0"); + +$lostDomain = List(-$b,0); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$b; +$s2 = Formula("$var**$a*($var**2+($b+$c)*$var+$b*$c)")->reduce; +$s3 = Formula("$var**$a*($var**2+($b+$d)*$var+$b*$d)")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors: + + [`` +\begin{aligned} + [$question] &= \frac{[$s2]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factors [`[$var]^{[$a]}`] and [`[$var]+[$b]`] were crossed out, the domain conditions lost during the simplification are [`[$var] \ne 0`] and [` [$var] \ne [$s1] `]. + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions170nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions170nodomain.pg new file mode 100644 index 0000000000..2f4f8a4c2b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions170nodomain.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x^2(x+3)(x+4) / x^2(x+2)(x+3) +# in expanded form. +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = list_random(2,3,4); +$b = non_zero_random(-6,6,1); +do {$c=non_zero_random(-6,6,1);} until ($b!=$c); +do {$d=non_zero_random(-6,6,1);} until ( ($d!=$b) && ($d!=$c) ); + +$num = Formula("$var**($a+2)+($b+$c)*$var**($a+1)+$b*$c*$var**$a")->reduce; +$den= Formula("$var**($a+2)+($b+$d)*$var**($a+1)+$b*$d*$var**$a")->reduce; +$numFactored = Formula("$var**$a*($var+$b)*($var+$c)")->reduce; +$denFactored = Formula("$var**$a*($var+$b)*($var+$d)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("($var+$c)/($var+$d)")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$b; +$s2 = Formula("$var**$a*($var**2+($b+$c)*$var+$b*$c)")->reduce; +$s3 = Formula("$var**$a*($var**2+($b+$d)*$var+$b*$d)")->reduce; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms: + + [`` +\begin{aligned} + [$question] &= \frac{[$s2]}{[$s3]} \\ + &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions180.pg new file mode 100644 index 0000000000..55424af7ca --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions180.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^3-27) / (x^2-9) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = random(2,5,1)*random(-1,1,2); +$b = abs($a); + +$num = Formula("$var**3+$a**3")->reduce; +$den = Formula("$var**2-$b**2")->reduce; +$numFactored = Formula("($var+$a)*($var**2-$a*$var+($a)**2)")->reduce; +$denFactored = Formula("($var+$b)*($var-$b)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("($var**2-$a*$var+($a)**2)/($var-$a), $var != -$a")->reduce; +$ans->{trueDomain} = Compute("$var != -$a and $var != $a"); + +$lostDomain = List(-$a); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$a; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors. + +It's good to know the sum and difference of cubes formulas: + + [`` x^{3}+y^{3} = (x+y)(x^2-xy+y^2) ``] + + [`` x^{3}-y^{3} = (x-y)(x^2+xy+y^2) ``] + +When you see "cube" and perfect cube numbers, like [`1, 8, 27, 64, 125, ...`], you should know the above two formulas could help you. + +Here is the solution for this problem: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]+[$a]`] was crossed out, the domain condition lost during the simplification is [` [$var] \ne [$s1] `]. + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions180nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions180nodomain.pg new file mode 100644 index 0000000000..60e9b7d2b3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions180nodomain.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x^3-27) / (x^2-9) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = random(2,5,1)*random(-1,1,2); +$b = abs($a); + +$num = Formula("$var**3+$a**3")->reduce; +$den = Formula("$var**2-$b**2")->reduce; +$numFactored = Formula("($var+$a)*($var**2-$a*$var+($a)**2)")->reduce; +$denFactored = Formula("($var+$b)*($var-$b)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("($var**2-$a*$var+($a)**2)/($var-$a)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +$s1 = -$a; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms. + +It's good to know the sum and difference of cubes formulas: + + [`` x^{3}+y^{3} = (x+y)(x^2-xy+y^2) ``] + + [`` x^{3}-y^{3} = (x-y)(x^2+xy+y^2) ``] + +When you see "cube" and perfect cube numbers, like [`1, 8, 27, 64, 125, ...`], you should know the above two formulas could help you. + +Here is the solution for this problem: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions20.pg new file mode 100644 index 0000000000..5baa767f28 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions20.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x+3)/(3+x) and (x-3)/(3-x) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,10,1); + +$num1 = Formula("$var+$a")->reduce; +$den1 = Formula("$var+$a")->reduce; +$question1 = Formula("$num1/$den1")->reduce; +$ans1 = Formula("1, $var != -$a"); + +$num2 = Formula("$var+$a")->reduce; +$den2 = Formula("$a+$var")->reduce; +$question2 = Formula("$num2/$den2")->reduce; +$ans2 = Formula("1, $var != -$a"); + +$num3 = Formula("$var-$a")->reduce; +$den3 = Formula("$var-$a")->reduce; +$question3 = Formula("$num3/$den3")->reduce; +$ans3 = Formula("1, $var != $a"); + +$num4 = Formula("$var-$a")->reduce; +$den4 = Formula("$a-$var")->reduce; +$question4 = Formula("$num4/$den4")->reduce; +$ans4 = Formula("-1, $var != $a"); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expressions, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + +a. [``[$question1]=``] [__]{$ans1}{width=>40} + +a. [``[$question2]=``] [__]{$ans2}{width=>40} + +a. [``[$question3]=``] [__]{$ans3}{width=>40} + +a. [``[$question4]=``] [__]{$ans4}{width=>40} + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + +a. [`` + \begin{aligned} + [$question1] &= [$ans1] + \end{aligned} + ``] + + Since the factor [`[$var]+[$a]`] was crossed out, [`-[$a]`] is not in the domain. So the answer is [`[$ans1]`]. + +a. [`` + \begin{aligned}[t] + [$question2] &= \frac{[$num2]}{[$num2]} \\ + &= [$ans2] + \end{aligned} + ``] + + Since the factor [`[$var]+[$a]`] was crossed out, [`-[$a]`] is not in the domain. So the answer is [`[$ans2]`]. + +a. [`` + \begin{aligned} + [$question3] &= [$ans3] + \end{aligned} + ``] + + Since the factor [`[$var]-[$a]`] was crossed out, [`[$a]`] is not in the domain. So the answer is [`[$ans3]`]. + +a. [`` + \begin{aligned}[t] + [$question4] &= \frac{[$num4]}{-([$var]-[$a])} \\ + &= \frac{1}{-1} \\ + &= [$ans4] + \end{aligned} + ``] + + Since the factor [`[$var]-[$a]`] was crossed out, [`[$a]`] is not in the domain. So the answer is [`[$ans4]`]. + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions30.pg new file mode 100644 index 0000000000..485efb5cdf --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions30.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x+3)/(x-2)(x+3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,10,1)*random(-1,1,2); +do {$b = random(2,10,1)*random(-1,1,2);} until ($a!=$b); + +$num = Formula("$var+$a")->reduce; +$den = Formula("($var+$b)($var+$a)")->reduce; +$numFactored = $num; +$denFactored = $den; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("1/($var+$b), $var != -$a")->reduce; +$ans->{trueDomain} = Compute("$var != -$a and $var != -$b"); + +$lostDomain = List(-$a); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + + +END_PGML + +################################################### + +$s1 = -$a; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors. In this question, both the numerator and denominator have been factored, so we can simply cross out common factors. + + [`` +\begin{aligned} + [$question] + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]+[$a]`] was crossed out, the domain condition lost during the simplification is: + + [`` +\begin{aligned} + [$var]+[$a] & \ne 0 \\ + [$var]+[$a] \mathbf{-[$a]} & \ne 0 \mathbf{-[$a]} \\ + [$var] & \ne [$s1] +\end{aligned} + ``] + + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions30nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions30nodomain.pg new file mode 100644 index 0000000000..00cf76ccf9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions30nodomain.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x+3)/(x-2)(x+3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,10,1)*random(-1,1,2); +do {$b = random(2,10,1)*random(-1,1,2);} until ($a!=$b); + +$num = Formula("$var+$a")->reduce; +$den = Formula("($var+$b)($var+$a)")->reduce; +$numFactored = $num; +$denFactored = $den; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("1/($var+$b)")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = -$a; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms. In this question, both the numerator and denominator have been factored, so we can simply cross out common terms. + + [`` +\begin{aligned} + [$question] + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions40.pg new file mode 100644 index 0000000000..e8a3251f72 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions40.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 5(x+3)/(x-2)(x+3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,10,1)*random(-1,1,2); +do {$b = random(2,10,1)*random(-1,1,2);} until ($a!=$b); +$c = random(2,10,1)*random(-1,1,2); + +$num = Formula("$c*($var+$a)")->reduce; +$den = Formula("($var+$b)($var+$a)")->reduce; +$numFactored = $num; +$denFactored = $den; + +$question = Formula("$num/$den"); +$ans = Formula("$c/($var+$b), $var != -$a")->reduce; +$ans->{trueDomain} = Compute("$var != -$a and $var != -$b"); + +$lostDomain = List(-$a); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + + +END_PGML + +################################################### + +$s1 = -$a; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors. In this question, both the numerator and denominator have been factored, so we can simply cross out common factors. + + [`` +\begin{aligned} + [$question] + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]+[$a]`] was canceled, the domain condition lost during the simplification is: + + [`` +\begin{aligned} + [$var]+[$a] & \ne 0 \\ + [$var]+[$a] \mathbf{-[$a]} & \ne 0 \mathbf{-[$a]} \\ + [$var] & \ne [$s1] +\end{aligned} + ``] + + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions40nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions40nodomain.pg new file mode 100644 index 0000000000..9a668b8db0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions40nodomain.pg @@ -0,0 +1,81 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like 5(x+3)/(x-2)(x+3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,10,1)*random(-1,1,2); +do {$b = random(2,10,1)*random(-1,1,2);} until ($a!=$b); +$c = random(2,10,1)*random(-1,1,2); + +$num = Formula("$c*($var+$a)")->reduce; +$den = Formula("($var+$b)($var+$a)")->reduce; +$numFactored = $num; +$denFactored = $den; + +$question = Formula("$num/$den"); +$ans = Formula("$c/($var+$b)")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = -$a; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms. In this question, both the numerator and denominator have been factored, so we can simply cross out common terms. + + [`` +\begin{aligned} + [$question] + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions50.pg new file mode 100644 index 0000000000..82dd5d03ea --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions50.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x+3)(x-2)/(2-x) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,10,1)*random(-1,1,2); +do {$b = random(1,10,1);} until ($a!=$b); + +$num = Formula("($var+$a)($var-$b)")->reduce; +$den = Formula("$b-$var")->reduce; +$numFactored = $num; +$denFactored = $den; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-$var-$a, $var != $b")->reduce; + +$lostDomain = List($b); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + +By the formula [` x-y = -(y-x) `], we have [` [$b]-[$var] = -([$var]-[$b]) `]. Now we can simplify the expression: + + [`` +\begin{aligned} + [$question] &= \frac{[$num]}{-([$var]-[$b])} \\ + &= \frac{[$var]+[$a]}{-1} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]-[$b]`] was crossed out, the domain condition lost during the simplification is [`[$var] \ne [$lostDomain]`]. + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions50nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions50nodomain.pg new file mode 100644 index 0000000000..84d2406991 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions50nodomain.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (x+3)(x-2)/(2-x) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,10,1)*random(-1,1,2); +do {$b = random(1,10,1);} until ($a!=$b); + +$num = Formula("($var+$a)($var-$b)")->reduce; +$den = Formula("$b-$var")->reduce; +$numFactored = $num; +$denFactored = $den; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-$var-$a")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +################################################### + +BEGIN_PGML_SOLUTION + +By the formula [` x-y = -(y-x) `], we have [` [$b]-[$var] = -([$var]-[$b]) `]. Now we can simplify the expression: + + [`` +\begin{aligned} + [$question] &= \frac{[$num]}{-([$var]-[$b])} \\ + &= \frac{[$var]+[$a]}{-1} \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions60.pg new file mode 100644 index 0000000000..8cbe06bb88 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions60.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2x+6)/(x+3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,10,1)*random(-1,1,2); +$b = random(2,10,1)*random(-1,1,2); + +$num = Formula("$a*$var+$a*$b")->reduce; +$den = Formula("$var+$b")->reduce; +$numFactored = Formula("$a*($var+$b)")->reduce; +$denFactored = $den; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("$a, $var != -$b")->reduce; + +$lostDomain = List(-$b); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + + +END_PGML + +################################################### + +$s1 = -$b; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factor. In this question, both the numerator and denominator have been factored, so we can simply cross out common factors. + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]+[$b]`] was crossed out, the domain condition lost during the simplification is: + + [`` +\begin{aligned} + [$var]+[$b] & \ne 0 \\ + [$var]+[$b] \mathbf{-[$b]} & \ne 0 \mathbf{-[$b]} \\ + [$var] & \ne [$s1] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions60nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions60nodomain.pg new file mode 100644 index 0000000000..83e6791186 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions60nodomain.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2x+6)/(x+3) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,10,1)*random(-1,1,2); +$b = random(2,10,1)*random(-1,1,2); + +$num = Formula("$a*$var+$a*$b")->reduce; +$den = Formula("$var+$b")->reduce; +$numFactored = Formula("$a*($var+$b)")->reduce; +$denFactored = $den; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("$a")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +################################################### + +$s1 = -$b; + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms. In this question, both the numerator and denominator have been factored, so we can simply cross out common terms. + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions70.pg new file mode 100644 index 0000000000..37a81c620a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions70.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x/(x^2-x) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,10,1)*random(-1,1,2); +$b = random(2,10,1)*random(-1,1,2); + +$num = Formula("$b*$var")->reduce; +$den = Formula("$var**2+$a*$var")->reduce; +$numFactored = $num; +$denFactored = Formula("$var*($var+$a)")->reduce; + +$question = Formula("$num/$den"); +$ans = Formula("$b/($var+$a), $var != 0")->reduce; +$ans->{trueDomain} = Compute("$var != -$a and $var != 0"); + +$lostDomain = List(0); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]`] was crossed out, the domain condition lost during the simplification is [` [$var] \ne 0 `]. + + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions70nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions70nodomain.pg new file mode 100644 index 0000000000..c15cbd66be --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions70nodomain.pg @@ -0,0 +1,76 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like x/(x^2-x) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(2,10,1)*random(-1,1,2); +$b = random(2,10,1)*random(-1,1,2); + +$num = Formula("$b*$var")->reduce; +$den = Formula("$var**2+$a*$var")->reduce; +$numFactored = $num; +$denFactored = Formula("$var*($var+$a)")->reduce; + +$question = Formula("$num/$den"); +$ans = Formula("$b/($var+$a)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions80.pg new file mode 100644 index 0000000000..002e13053f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions80.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2x-x^2) / (x^2-5x+6) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", +); + +############################################## + +Context("RestrictedDomains"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(1,6,1); +do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b); + +$num = Formula("$a*$var-$var**2")->reduce; +$den = Formula("$var**2+(-$a+$b)*$var+(-$a*$b)")->reduce; +$numFactored = Formula("$var*($a-$var)")->reduce; +$denFactored = Formula("($var-$a)*($var+$b)")->reduce; +$numFactoredOrdered = Formula("-$var*($var-$a)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-$var/($var+$b), $var != $a")->reduce; +$ans->{trueDomain} = Compute("$var != $a and $var != -$b"); + +$lostDomain = List($a); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify the following expression, and if applicable, write the restricted domain on the simplified expression. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + [``[$question]=``] [___________________]{$ans} + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common factors: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$denFactored]} \\ + &= \frac{[$numFactoredOrdered]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factor [`[$var]-[$a]`] was crossed out, the domain condition lost during the simplification is [` [$var] \ne [$a] `]. + +Note that we used the formula [` [$a]-[$var] = -([$var]-[$a]) `]. + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions80nodomain.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions80nodomain.pg new file mode 100644 index 0000000000..7aa1a6155b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions80nodomain.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2x-x^2) / (x^2-5x+6) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$a = random(1,6,1); +do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b); + +$num = Formula("$a*$var-$var**2")->reduce; +$den = Formula("$var**2+(-$a+$b)*$var+(-$a*$b)")->reduce; +$numFactored = Formula("$var*($a-$var)")->reduce; +$denFactored = Formula("($var-$a)*($var+$b)")->reduce; +$numFactoredOrdered = Formula("-$var*($var-$a)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-$var/($var+$b)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$denFactored]} \\ + &= \frac{[$numFactoredOrdered]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions81.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions81.pg new file mode 100644 index 0000000000..42f498a714 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions81.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2xy-x^2y^2) / (x^2y^2-5xy+6) +# +# Last updated: Carl Yao 12/16/2016 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(1,6,1); +do {$b = random(1,6,1)*random(-1,1,2);} until ($a!=$b); + +$num = Formula("$a*$var1*$var2-$var1**2*$var2**2")->reduce; +$den = Formula("$var1**2*$var2**2+(-$a+$b)*$var1*$var2+(-$a*$b)")->reduce; +$numFactored = Formula("$var1*$var2*($a-$var1*$var2)")->reduce; +$denFactored = Formula("($var1*$var2-$a)*($var1*$var2+$b)")->reduce; +$numFactoredOrdered = Formula("-$var1*$var2*($var1*$var2-$a)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("-$var1*$var2/($var1*$var2+$b)")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$denFactored]} \\ + &= \frac{[$numFactoredOrdered]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions90.pg new file mode 100644 index 0000000000..3f647cc720 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions90.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template: +# Simplify the rational expression like (2x-4y) / (x^2-5xy+6y^2) +# +# Last updated: Carl Yao 08/14/2015 +# ENDDESCRIPTION + +## DBCC('A-APR.1','A-SSE.2') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') +## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$a = random(2,6,1); +$b = random(2,6,1)*random(-1,1,2); +do {$c = random(1,6,1)*random(-1,1,2);} until ($b!=$c); + +$num = Formula("$a*$var1+$a*$b*$var2")->reduce; +$den = Formula("$var1**2+($c+$b)*$var1*$var2+($c*$b)*$var2**2")->reduce; +$numFactored = Formula("$a*($var1+$b*$var2)")->reduce; +$denFactored = Formula("($var1+$b*$var2)($var1+$c*$var2)")->reduce; + +$question = Formula("$num/$den")->reduce; +$ans = Formula("$a/($var1+$c*$var2)")->reduce; + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + + [``[$question]=``] [___________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To simplify the expression, we first factor both the numerator and denominator, and then cross out common terms: + + [`` +\begin{aligned} + [$question] &= \frac{[$numFactored]}{[$denFactored]} \\ + &= [$ans] +\end{aligned} + ``] + + +END_PGML_SOLUTION +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication10.pg index f897da7fdf..64ceb15fb1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication10.pg @@ -7,23 +7,21 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); # This should be the first executable line in the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "PCCmacros.pl", - "PGcourse.pl" +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", ); ############################################## @@ -33,6 +31,7 @@ $showPartialCorrectAnswers = 1; Context("Numeric"); +do { do { $c = random(2,10,1); $a = $c*random(50,500,10); @@ -40,35 +39,42 @@ Context("Numeric"); do { do {$d = random(2,10,1);} until (gcd($c,$d)==1); $b = $d*random(50,500,10); - } until ( ($b % $d == 0) && ($a/$c!=$b/$d) ); - $func = Compute("($a*x+$b)/($c*x+$d)")->reduce; - $x2 = random(5,30,1); - $ans2 = ($a*$x2+$b)/($c*$x2+$d); - do {$ans3 = random(5,30,1);} until ($ans3!=$x2); - $y3 = int((10*($a*$ans3+$b)/($c*$ans3+$d)+5)/10); - -$ans1 = $b/$d; -$ans2 = int((10*$ans2+5)/10); -$ans3 = int($ans3); -$ans4 = $a/$c; - + $func = Compute("($a*x+$b)/($c*x+$d)")->reduce; + $x2 = random(5,30,1); + $ans2 = ($a*$x2+$b)/($c*$x2+$d); + $ans3 = random(5,30,1); + $y3Raw = ($a*$ans3+$b)/($c*$ans3+$d); + $y3 = int($y3Raw); + } until (($b % $d == 0) && ($a/$c!=$b/$d) && ($c*$y3-$a != 0)); + $ans3 = int(-($y3*$d-$b)/($c*$y3-$a)+0.5); + $ans1 = $b/$d; + $ans2 = int((10*$ans2+5)/10); + $ans4 = $a/$c; +} until ( ($ans3!=$x2) && ($y3!=$y3Raw) && ($ans2 != $y3)); + +$diff = abs($ans4 - $func->eval(x=>1000)->value); +$eval4 = Real($ans4)->cmp(tolType=>'absolute',tolerance=>$diff); ############################################## BEGIN_PGML The population of deer in a forest can be modeled by - [`` P(x) = [$func] ``] + [``` P(x) = [$func] ```] -where [`x`] is the number of years in the future. Answer the following questions. +where [`x`] is the number of years since the year 1900. -1) How many deer live in this forest this year? [__________]{$ans1} +a. How many deer lived in this forest in the year 1900? +[__________]{$ans1} -2) How many deer will live in this forest [`[$x2]`] years later? Round your answer to an integer. [__________]{$ans2} +a. How many deer live in this forest [`[$x2]`] years after 1900? [@KeyboardInstructions('Round your answer to an integer.')@]* +[__________]{$ans2} -3) After how many years, the deer population will be [`[$y3]`]? Round your answer to an integer. [__________]{$ans3} +a. How many years since 1900 was it (or will it be) when the deer population was (or will be) [`[$y3]`]? [@KeyboardInstructions('Round your answer to an integer.')@]* +[__________]{$ans3} -4) Use a calculator to answer this question: Many years in the future, about how many deer will live in this forest? [__________]{$ans4} +a. Use a calculator or graphing calculator to answer this question: As time goes on, the population levels off at about how many deer? +[__________]{$eval4} END_PGML @@ -83,25 +89,19 @@ $s6 = $c*10000+$d; BEGIN_PGML_SOLUTION -1) How many deer live in this forest this year? - -To answer this question, we substitute [`x`] with [`0`], and we have: +a. How many deer live in this forest this year? To answer this question, we substitute [`x`] with [`0`], and we have: [`` P(0) = \frac{[$a](0)+[$b]}{[$c](0)+[$d]} = \frac{[$b]}{[$d]} = [$ans1] ``] -About [`[$ans1]`] deer live in this forest this year. - -2) How many deer will live in this forest [`[$x2]`] years later? + About [`[$ans1]`] deer live in this forest this year. -To answer this question, we substitute [`x`] with [`[$x2]`], and we have: +a. How many deer will live in this forest [`[$x2]`] years later? To answer this question, we substitute [`x`] with [`[$x2]`], and we have: - [`` P(0) = \frac{[$a]([$x2])+[$b]}{[$c]([$x2])+[$d]} = \frac{[$s1]}{[$s2]} \approx [$ans2] ``] + [`` P([$x2]) = \frac{[$a]([$x2])+[$b]}{[$c]([$x2])+[$d]} = \frac{[$s1]}{[$s2]} \approx [$ans2] ``] -About [`[$ans2]`] deer will live in this forest [`[$x2]`] years later. + About [`[$ans2]`] deer will live in this forest [`[$x2]`] years later. -3) After how many years, the deer population will be [`[$y3]`]? - -To answer this question, we substitute [`P(x)`] with [`[$y3]`], and then solve for [`x`]: +a. After how many years, the deer population will be [`[$y3]`]? To answer this question, we substitute [`P(x)`] with [`[$y3]`], and then solve for [`x`]: [`` \begin{aligned}[t] @@ -111,19 +111,18 @@ To answer this question, we substitute [`P(x)`] with [`[$y3]`], and then solve f [$y3*$c]x+[$y3*$d] &= [$a]x+[$b] \\ [$y3*$c]x+[$y3*$d] \mathbf{{}-[$a]x-[$y3*$d]} &= [$a]x+[$b] \mathbf{{}-[$a]x-[$y3*$d]} \\ [$s3]x &= [$s4] \\ - x &= [$s4/$s3] + x &= [$s4/$s3] \\ + x &\approx [$ans3] \end{aligned} ``] -After about [`[$ans3]`] years, the deer population will be [`[$y3]`]. - -4) Use a graphing calculator to answer this question: Many years in the future, about how many deer will live in this forest? + After about [`[$ans3]`] years, the deer population will be [`[$y3]`]. -To answer this question, we substitute x with a very big number, like [`10,000`], and we have: +a. Use a graphing calculator to answer this question: _Very many_ years in the future, about how many deer will live in this forest? To answer this question, we substitute [`x`] with a very big number, like [`10{,}000`], and we have: [`` P(10000) = \frac{[$a](10000)+[$b]}{[$c](10000)+[$d]} = \frac{[$s5]}{[$s6]} \approx [$ans4] ``] -Many years in the future, about [`[$ans4]`] deer will live in this forest. + Many years in the future, about [`[$ans4]`] deer will live in this forest. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg index 2607c233c4..ab61a75279 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg @@ -7,23 +7,21 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Interpretation and applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); # This should be the first executable line in the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "PCCmacros.pl", - "PGcourse.pl" +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", ); ############################################## @@ -45,60 +43,56 @@ do { $y2r = int((10*$y2+5)/10); } until ( ($y1>2) && ($y2>2) ); +$A = 1; +$B = $y2r*$a; +$C = -$y2r*$a2; +$D = ($B)**2-4*$A*$C; +$D2 = sqrt($D); +$r1 = (-$B+$D2)/(2*$A); +$r2 = (-$B-$D2)/(2*$A); +$ans2 = int($r1+0.5); + ############################################## BEGIN_PGML In a certain store, cashiers can serve [`[$a]`] customers per hour on average. If [`x`] customers arrive at the store in a given hour, then the average number of customers [`C`] waiting in line can be modeled by the function - [`` C(x) = [$func] ``] + [``` C(x) = [$func] ```] where [`x<[$a]`]. Answer the following questions with a graphing calculator. Round your answers to integers. -1) If [`[$x1]`] customers arrived in the store in the past hour, there are approximately [__________]{$y1r} customers waiting in line. +a. If [`[$x1]`] customers arrived in the store in the past hour, there are approximately [__________]{$y1r} customers waiting in line. -2) If there are [`[$y2r]`] customers waiting in line, approximately [__________]{$x2} customers arrived in the past hour. +a. If there are [`[$y2r]`] customers waiting in line, approximately [__________]{$ans2} customers arrived in the past hour. END_PGML ############################################## -$s1 = $a*$x1+$b; -$s2 = $c*$x1+$d; -$s3 = $y3*$c-$a; -$s4 = $b-$y3*$d; -$s5 = $a*10000+$b; -$s6 = $c*10000+$d; - BEGIN_PGML_SOLUTION -1) If [`[$x1]`] customers arrived in the store in the past hour, approximately how many customers are waiting in line. - -To answer this question, we substitute [`x`] with [`[$x1]`], and we have: +a. If [`[$x1]`] customers arrived in the store in the past hour, approximately how many customers are waiting in line. To answer this question, we substitute [`x`] with [`[$x1]`], and we have: [`` C([$x1]) = \frac{[$x1]^{2}}{[$a2]-[$a]([$x1])} \approx [$y1] \approx [$y1r] ``] -If [`[$x1]`] customers arrived in the store in the past hour, there are approximately [`[$y1r]`] customers waiting in line. + If [`[$x1]`] customers arrived in the store in the past hour, there are approximately [`[$y1r]`] customers waiting in line. -2) If there are [`[$y2r]`] customers waiting in line, approximately how many customers arrived in the past hour? - -To answer this question, we substitute [`C`] with [`[$y2r]`], and we have: +a. If there are [`[$y2r]`] customers waiting in line, approximately how many customers arrived in the past hour? To answer this question, we substitute [`C`] with [`[$y2r]`], and we have: [`` [$y2r]= [$func] ``] -We will use a graphing calculator's *solve()* function to solve this equation. - -For TI-89, press Home, F2, choose *solve(*, press Enter. Then, type in the equation: + We will use a graphing calculator's [|solve()|]* function to solve this equation. For a TI-89, press [|Home|]*, [|F2|]*, choose [|solve(|]*, press [|Enter|]*. Then, type in the equation: - solve([`[$y2r]`]=[`x`]^2/([$a2]-[$a]x),x) + [|solve([`[$y2r]`]=[`x`]^2/([$a2]-[$a]x),x)\}* -For Casio ClassPad 300, tap Main, Action in the menu, Advanced, solve, and then type in the same equation above. + For Casio ClassPad 300, tap [|Main|]*, [|Action|]* in the menu, [|Advanced|]*, [|solve|]*, and then type in the same equation above. -Ignore the unreasonable solution, and round the reasonable solution to [`[$x2]`]. + Ignore the unreasonable solution, and round the reasonable solution to [`[$ans2]`]. -If there are [`[$y2r]`] customers waiting in line, approximately [`[$x2]`] customers arrived in the past hour. + If there are [`[$y2r]`] customers waiting in line, approximately [`[$ans2]`] customers arrived in the past hour. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote10.pg index b8c25a8e80..b830b3ed79 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote10.pg @@ -7,27 +7,23 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Rational equations and functions) -## DBsection(Asymptotes) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(VerticalAsymptotes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); # This should be the first executable line in the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "PCCmacros.pl", - "parserAssignment.pl", +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"parserAssignment.pl", "answerHints.pl", - "PGcourse.pl" ); ############################################## @@ -51,7 +47,7 @@ do {$c = non_zero_random(-10,10,1);} until (gcd($c,$b)==1); do {$f = RandomVariableName();} until ($f ne 'x'); $func = Compute("$c/($a*x+$b)")->reduce; -$ansEq1=Compute("x=$x1"); +$ansEq1=Formula("x=$x1"); ############################################## @@ -92,4 +88,4 @@ An asymptote of the function [` [$f](x)=[$func] `] is at [` [$ansEq1] `]. END_PGML_SOLUTION -ENDDOCUMENT(); +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote20.pg index 905ea076bd..00bac067c7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote20.pg @@ -7,27 +7,25 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Rational equations and functions) -## DBsection(Asymptotes) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); # This should be the first executable line in the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", - "PGML.pl", - "contextLimitedRadical.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -48,8 +46,10 @@ Context()->operators->redefine(',',using=>',',from=>'Numeric'); ); Context()->lists->set(List => {separator => " and "}); -$x1 = non_zero_random(-10,10,1); -$x2 = non_zero_random(-10,10,1); +do { + $x1 = non_zero_random(-10,10,1); + $x2 = non_zero_random(-10,10,1); +} until ($x1!=$x2); $a = -$x1-$x2; $b = $x2*$x1; @@ -57,12 +57,8 @@ $c = non_zero_random(-10,10,1); do {$f = RandomVariableName();} until ($f ne 'x'); $func = Compute("$c/(x**2+$a*x+$b)")->reduce; -if ($x1=$x2){ - $ans = List(Compute("x=$x1")); -} -else { - $ans = List(Compute("x=$x1"),Compute("x=$x2")); -} + +$ans = List(Formula("x=$x1"),Formula("x=$x2")); $var = 'x'; ############################################## @@ -86,7 +82,7 @@ $s1 = Compute("x**2+$a*x+$b")->reduce; BEGIN_PGML_SOLUTION -A rational function will have asymptotes at [`x`] values which make the denominator zero and the numerator nonzero. We set the denominator to zero, and then solve the equation: +A rational function's asymptotes occur at [`x`] values which make the denominator zero. We set the denominator to zero, and then solve the equation: [`` \begin{aligned}[t] @@ -102,4 +98,4 @@ Asymptotes of the function [` [$f](x)=[$func] `] is at [` x=[$x1] `] and [`x=[$x END_PGML_SOLUTION -ENDDOCUMENT(); +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote30.pg index 1134ecb353..ec9fcedd5f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote30.pg @@ -7,28 +7,25 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Rational equations and functions) -## DBsection(Asymptotes) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(VerticalAsymptotes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); # This should be the first executable line in the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", - "PGML.pl", - "contextLimitedRadical.pl", - "PCCmacros.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -59,7 +56,7 @@ $c = non_zero_random(-10,10,1); do {$f = RandomVariableName();} until ($f ne 'x'); $func = Compute("$c/(x**2+$a*x+$b)")->reduce; -$ans = List(Compute("x=$x1"),Compute("x=$x2")); +$ans = List(Formula("x=$x1"),Formula("x=$x2")); $var = 'x'; ############################################## @@ -99,4 +96,4 @@ Asymptotes of the function [` [$f](x)=[$func] `] is at [` x=[$x1] `] and [`x=[$x END_PGML_SOLUTION -ENDDOCUMENT(); +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote40.pg index 41fcdddd51..55888799d3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionAsymptote40.pg @@ -7,28 +7,26 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Rational equations and functions) -## DBsection(Asymptotes) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); # This should be the first executable line in the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "parserAssignment.pl", - "answerHints.pl", - "PGML.pl", - "contextLimitedRadical.pl", - "PCCmacros.pl", - "contextFraction.pl", - "PGcourse.pl" + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "answerHints.pl", + "PGML.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "contextFraction.pl", + "PGcourse.pl", ); ############################################## @@ -45,7 +43,7 @@ $d = non_zero_random(1,10,1); $x1 = -Fraction($b,$a); -#Context("LimitedRadical"); +Context("LimitedRadical"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); Context()->noreduce('(-x)-y'); Context()->noreduce('(-x)-y','(-x)+y'); @@ -67,7 +65,7 @@ $e = -($a*$c+$b); $g = -$b*$c; $func = Compute("$d/(-$a*x**2+$e*x+$g)")->reduce; -$ans = List(Compute("x=$x1"),Compute("x=$x2")); +$ans = List(Formula("x=$x1"),Formula("x=$x2")); $var = 'x'; ############################################## @@ -92,7 +90,7 @@ $s2 = Compute("$a*x**2-$e*x-$g")->reduce; BEGIN_PGML_SOLUTION -A rational function has asymptotes at [`x`] values which make the denominator zero and the numerator nonzero. We set the denominator to zero, and then solve the equation: +A rational function's asymptotes occur at [`x`] values which make the denominator zero. We set the denominator to zero, and then solve the equation: [`` \begin{aligned}[t] @@ -109,4 +107,4 @@ Asymptotes of the function [` [$f](x)=[$func] `] is at [` x=[$x1] `] and [`x=[$x END_PGML_SOLUTION -ENDDOCUMENT(); +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDefinition10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDefinition10.pg index 60ca0e9a90..72d7a78895 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDefinition10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDefinition10.pg @@ -7,13 +7,12 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Definition, concept) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -23,8 +22,9 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "answerHints.pl", + "PGcourse.pl", + "PCCmacros.pl", "PGinfo.pl", - "PGcourse.pl" ); @@ -70,7 +70,7 @@ $BR \{ $mc -> print_a() \} $PAR -To receive full credit, you must get each checkbox correct. +\{KeyboardInstructions('To receive full credit, you must get each checkbox correct.')\} END_TEXT Context()->normalStrings; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg index 6af6e46b4f..b6da16f133 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg @@ -7,25 +7,23 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(algebra_functions_domain_range_poly_over_poly) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); # This should be the first executable line in the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "PCCmacros.pl", - "extraAnswerEvaluators.pl", - "PGcourse.pl" +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"extraAnswerEvaluators.pl", +"contextInequalities.pl", ); ############################################## @@ -38,17 +36,18 @@ $b = random(2,5,1); do {$f = RandomVariableName();} until ($f ne 'x'); -Context("Interval"); +Context("Inequalities"); $ans = Interval("(-infinity,0)U(0,infinity)"); ############################################## BEGIN_PGML +Find the domain of the function [`[$f]`] defined by + [``[$f](x)=\frac{x+[$a]}{x^{[$b]}}``] -Using interval notation, the domain of the function [`[$f]`] defined by - [``[$f](x)=\frac{x+[$a]}{x^{[$b]}}``] is [__________________________________]{$ans} +[__________________________________]{$ans} -If the answer includes more than one interval write the intervals separated by the union symbol, *U*. If the answer uses [`-\infty`], input *-inf*; if the answer uses [`\infty`], input *inf*. +[@KeyboardInstructions('You may use interval notation. If the answer is a union of intervals, use [|U|]* for the union symbol. If you need to enter [`\infty`], type [|inf|]*. You may also use an inequality to express the domain, as in [`x\neq1\text{ and }x\neq2`]. To type the [`\neq`] symbol, use [|!=|]*.')@]** END_PGML ############################################## @@ -60,4 +59,4 @@ The only potential for an invalid input value would be if the denominator of thi END_PGML_SOLUTION -ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg index 23b6908682..6a0ed323dd 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg @@ -7,24 +7,23 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); # This should be the first executable line in the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "PCCmacros.pl", - "extraAnswerEvaluators.pl", - "PGcourse.pl" +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"contextInequalities.pl", +"extraAnswerEvaluators.pl" ); ############################################## @@ -38,17 +37,18 @@ $c = $b*$b; do {$f = RandomVariableName();} until ($f ne 'x'); -Context("Interval"); +Context("Inequalities"); $ans = Interval("(-infinity,infinity)"); ############################################## BEGIN_PGML +Find the domain of the function [`[$f]`] defined by + [``[$f](x)=\frac{x+[$a]}{x^2+[$c]}``] -Using interval notation, the domain of the function [`[$f]`] defined by - [``[$f](x)=\frac{x+[$a]}{x^2+[$c]}``] is [__________________________________]{$ans} +[__________________________________]{$ans} -If the answer includes more than one interval write the intervals separated by the union symbol, *U*. If the answer uses [`-\infty`], input *-inf*; if the answer uses [`\infty`], input *inf*. +[@KeyboardInstructions('You may use interval notation. If the answer is a union of intervals, use [|U|]* for the union symbol. If you need to enter [`\infty`], type [|inf|]*. You may also use an inequality to express the domain, as in [`x\neq1\text{ and }x\neq2`]. To type the [`\neq`] symbol, use [|!=|]*.')@]** END_PGML ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg index a3f2f789af..650ed14fc1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg @@ -7,25 +7,23 @@ # ENDDESCRIPTION ## DBCCSS('A-REI.4.b') -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Domain and range) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(HolesRationalFunctions) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') ## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); # This should be the first executable line in the problem. loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "PCCmacros.pl", - "extraAnswerEvaluators.pl", - "PGcourse.pl" +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"contextInequalities.pl", +"extraAnswerEvaluators.pl" ); ############################################## @@ -37,17 +35,18 @@ $a = non_zero_random(-10,10,1); do {$f = RandomVariableName();} until ($f ne 'x'); -Context("Interval"); +Context("Inequalities"); $ans = Interval("(-infinity,-$a)U(-$a,infinity)"); ############################################## BEGIN_PGML +Find the domain of the function [`[$f]`] defined by + [``[$f](x)=\frac{x+[$a]}{x + [$a]}``] -Using interval notation, the domain of the function [`[$f]`] defined by - [``[$f](x)=\frac{x+[$a]}{x + [$a]}``] is [__________________________________]{$ans} +[__________________________________]{$ans} -If the answer includes more than one interval write the intervals separated by the union symbol, *U*. If the answer uses [`-\infty`], input *-inf*; if the answer uses [`\infty`], input *inf*. +[@KeyboardInstructions('You may use interval notation. If the answer is a union of intervals, use [|U|]* for the union symbol. If you need to enter [`\infty`], type [|inf|]*. You may also use an inequality to express the domain, as in [`x\neq1\text{ and }x\neq2`]. To type the [`\neq`] symbol, use [|!=|]*.')@]** END_PGML ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain40.pg new file mode 100644 index 0000000000..e251a71480 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain40.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Give a function's graph, find its domain and range. +# Function is a rational function. +# +# Last update: Carl Yao 08/13/15 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','rational','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGtikz.pl", + "ORCCA.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGasu.pl", + "PCCmacros.pl", + "contextInequalities.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a = non_zero_random(-4,4,1); +$exclude1 = random(-6,6,1); +$func = Compute("($a)/(x-$exclude1)")->reduce; + +$xLimit1 = -10; +$xLimit2 = 10; +$yLimit1 = -10; +$yLimit2 = 10; + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xLimit1,$xLimit2],[min($yLimit1,$yLimit2),max($yLimit1,$yLimit2)]); + +@exclude1 = num_sort($a/$min[1] + $exclude1,$a/$max[1] + $exclude1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick =, + ] + \addplot[firstcurve,domain=$min[0]:$exclude1[0],samples=50] {$a/(x - $exclude1)}; + \addplot[firstcurve,domain=$exclude1[1]:$max[0],samples=50] {$a/(x - $exclude1)}; + \addplot[asymptote] coordinates {($exclude1,$min[1]) ($exclude1,$max[1])}; +\end{axis} +END_TIKZ + +$ALT = "graph of a function, with an asymptote at x=$exclude1"; + + +Context("Inequalities"); +$ans = Compute("(-inf,$exclude1)U($exclude1,inf)"); + + +############################################## + +BEGIN_PGML + +A function is graphed. + +[@EnlargeImageStatementPGML()@]** + + +>>[@image($gr, width=>300, height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +What is its domain? + +[___________]{$ans} + + +[@KeyboardInstructions('You may use interval notation. If the answer is a union of intervals, use [|U|]* for the union symbol. If you need to enter [`\infty`], type [|inf|]*. You may also use an inequality to express the domain, as in [`x\neq1\text{ and }x\neq2`]. To type the [`\neq`] symbol, use [|!=|]*.')@]** + +END_PGML +############################################## + +BEGIN_PGML_SOLUTION + +We can see one asymptote at [`x=[$exclude1]`], so the domain of this function is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain50.pg new file mode 100644 index 0000000000..7765d66513 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionDomain50.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Give a function's graph, find its domain and range. +# Function is a rational function. +# +# Last update: Carl Yao 08/13/15 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','rational','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGtikz.pl", + "ORCCA.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGasu.pl", + "PCCmacros.pl", + "contextInequalities.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a = 6; +$exclude1 = random(-6,-1,1); +$exclude2 = random(1,6,1);; +$func = Compute("($a)/((x-$exclude1)*(x-$exclude2))")->reduce; + +$xLimit1 = -10; +$xLimit2 = 10; +$yLimit1 = -10; +$yLimit2 = 10; + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$xLimit1,$xLimit2],[min($yLimit1,$yLimit2),max($yLimit1,$yLimit2)]); + +@exc = num_sort( + ($exclude1+$exclude2+sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$min[1])))/2, + ($exclude1+$exclude2-sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$min[1])))/2, + ($exclude1+$exclude2+sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$max[1])))/2, + ($exclude1+$exclude2-sqrt(($exclude1+$exclude2)**2 - 4*($exclude1*$exclude2 - $a/$max[1])))/2, +); + +@exclude1 = (@exc)[0,1]; +@exclude2 = (@exc)[2,3]; + + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $min[0], + xmax = $max[0], + ymin = $min[1], + ymax = $max[1], + xtick =, + ytick =, + minor xtick = {$min[0],...,$max[0]}, + minor ytick =, + ] + \addplot[firstcurve,domain=$min[0]:$exclude1[0],samples=50] {$a/(x - $exclude1)/(x - $exclude2)}; + \addplot[firstcurve,domain=$exclude1[1]:$exclude2[0],samples=50] {$a/(x - $exclude1)/(x - $exclude2)}; + \addplot[firstcurve,domain=$exclude2[1]:$max[0],samples=50] {$a/(x - $exclude1)/(x - $exclude2)}; + \addplot[asymptote] coordinates {($exclude1,$min[1]) ($exclude1,$max[1])}; + \addplot[asymptote] coordinates {($exclude2,$min[1]) ($exclude2,$max[1])}; +\end{axis} +END_TIKZ + + +$ALT = "graph of a function, with two asymptotes at x=$exclude1 and x=$exclude2"; + + +Context("Inequalities"); +$ans = Compute("(-inf,$exclude1)U($exclude1,$exclude2)U($exclude2,inf)"); + + +############################################## + +BEGIN_PGML + +A function is graphed. + +[@EnlargeImageStatementPGML()@]** + + +>>[@image($gr, width=>300, height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +What is its domain? + +[___________]{$ans} + + +[@KeyboardInstructions('You may use interval notation. If the answer is a union of intervals, use [|U|]* for the union symbol. If you need to enter [`\infty`], type [|inf|]*. You may also use an inequality to express the domain, as in [`x\neq1\text{ and }x\neq2`]. To type the [`\neq`] symbol, use [|!=|]*.')@]** + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We can see two asymptotes at [`x=[$exclude1]`] and [`x=[$exclude2]`], so the domain of this function is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionGraph10.pg index ceb3bbe33a..d20e6a828c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionGraph10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/rationalFunctionGraph10.pg @@ -6,12 +6,17 @@ # # Last edited: Carl Yao 01/05/2016 -## DBsubject(Algebra) -## DBchapter(Functions) -## DBsection(Graphs) -## Institution(PCC) -## Author(Alex Jordan) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') @@ -37,7 +42,7 @@ TEXT(beginproblem()); Context("Numeric"); -$refreshCachedImages=1; + $xmin = -5; $ymin = -5; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction10.pg index 61193714d8..df8a65a7d5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction10.pg @@ -8,13 +8,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Simplify rational expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,6 +33,7 @@ Context("RestrictedDomains"); Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); +$R = RandomVariableName(type=>'function'); $a = random(1,10,1)*random(-1,1,2); do {$b = random(1,10,1)*random(-1,1,2);} until ($a!=$b); @@ -57,9 +57,9 @@ BEGIN_PGML Simplify the function formula, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** - [`` R([$var]) = [$function] ``] + [`` [$R]([$var]) = [$function] ``] - Reduced [`R([$var])=`] [___________________]{$ans} + Reduced [`[$R]([$var])=`] [___________________]{$ans} END_PGML @@ -73,7 +73,7 @@ To simplify the expression, we first factor both the numerator and denominator, [`` \begin{aligned} - R([$var]) &= [$function] \\ + [$R]([$var]) &= [$function] \\ &= \frac{[$numFactored]}{[$denFactored]} \\ &= [$ans] \end{aligned} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction20.pg index e0aa8e11fc..8ea1026f77 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction20.pg @@ -8,13 +8,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Simplify rational expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,6 +33,8 @@ Context("RestrictedDomains"); Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); +$R = RandomVariableName(type=>'function'); + $a = random(1,10,1); $a2 = $a**2; @@ -48,7 +49,7 @@ $step1Num = Formula("$var($var**2-$a2)")->reduce; $step1Den = Formula("$var($var**2+($a+$b)*$var+$a*$b)")->reduce; $function = Formula("$num/$den")->reduce; -$ans = Formula("($var+$a)/($var+$b), $var != -$a and $var != 0")->reduce; +$ans = Formula("($var-$a)/($var+$b), $var != -$a and $var != 0")->reduce; $ans->{trueDomain} = Compute("$var != -$a and $var != 0 and $var != -$b"); $lostDomain = List(-$a,0); @@ -61,9 +62,9 @@ BEGIN_PGML Simplify the function formula, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** - [`` R([$var]) = [$function] ``] + [`` [$R]([$var]) = [$function] ``] - Reduced [`R([$var])=`] [___________________]{$ans} + Reduced [`[$R]([$var])=`] [___________________]{$ans} END_PGML @@ -75,7 +76,7 @@ To simplify the expression, we first factor both the numerator and denominator, [`` \begin{aligned} - R([$var]) &= [$function] \\ + [$R]([$var]) &= [$function] \\ &= \frac{[$step1Num]}{[$step1Den]} \\ &= \frac{[$numFactored]}{[$denFactored]} \\ &= [$ans] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction30.pg index e90f4c9bbc..9da33e29d4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction30.pg @@ -8,13 +8,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Simplify rational expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -34,6 +33,8 @@ Context("RestrictedDomains"); Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); +$R = RandomVariableName(type=>'function'); + $a = non_zero_random(-5,5,1); $a2 = $a**2; @@ -63,9 +64,9 @@ BEGIN_PGML Simplify the function formula, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** - [`` R([$var]) = [$function] ``] + [`` [$R]([$var]) = [$function] ``] - Reduced [`R([$var])=`] [___________________]{$ans} + Reduced [`[$R]([$var])=`] [___________________]{$ans} END_PGML @@ -77,7 +78,7 @@ To simplify the expression, we first factor both the numerator and denominator, [`` \begin{aligned} - R([$var]) &= [$function] \\ + [$R]([$var]) &= [$function] \\ &= \frac{[$step1Num]}{[$step1Den]} \\ &= \frac{[$numFactored]}{[$denFactored]} \\ &= [$ans] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction40.pg index a30596f858..519841f459 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalFunctions/reduceRationalFunction40.pg @@ -8,14 +8,12 @@ # ENDDESCRIPTION ## DBCC('A-APR.1','A-SSE.2') -## DBsubject(Algebra) -## DBchapter(Operations on polynomial and rational expressions) -## DBsection(Simplify rational expressions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents', 'Factoring') ## KEYWORDS('polynomial','exponents','factoring','simplify','rational') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); @@ -36,6 +34,8 @@ Context("RestrictedDomains"); Context()->noreduce('(-x)-y','(-x)+y'); $var = RandomVariableName(type=>'variable'); Context()->variables->are($var=>'Real'); +$R = RandomVariableName(type=>'function'); + $a = list_random(2,3,5); do {$b = random(1,5,1)*random(-1,1,2);} until (gcd(abs($b),$a)==1); @@ -76,17 +76,14 @@ BEGIN_PGML Simplify the function formula, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var^2 for $var!=1 and $var!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** - [`` R([$var]) = [$function] ``] + [`` [$R]([$var]) = [$function] ``] - Reduced [`R([$var])=`] [___________________]{$ans} + Reduced [`[$R]([$var])=`] [___________________]{$ans} END_PGML ################################################### -$showPartialCorrectAnswers = 1; - -################################################ BEGIN_PGML_SOLUTION @@ -94,7 +91,7 @@ To simplify the expression, we first factor both the numerator and denominator, [`` \begin{aligned} - R([$var]) &= [$function] \\ + [$R]([$var]) &= [$function] \\ &= \frac{[$step1Num]}{[$step1Den]} \\ &= \frac{[$numFactored]}{[$denFactored]} \\ &= [$ans] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation220.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation220.pg new file mode 100644 index 0000000000..83a725396d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation220.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of m=(y2-y1)/(x2-x1) for y2 +# +# Last updated: Carl Yao 08/31/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','subscript') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +do {$var3 = RandomVariableName(type=>'variable');} until ( ($var3 ne $var2) && ($var3 ne $var1) ); + +$correct = "\( $var3 ($var1 _{2}-$var1 _{1})+$var2 _{1} \)"; +$wrong1 = "\( $var3 ($var1 _{2}-$var1 _{1})-$var2 _{1} \)"; +$wrong2 = "\( \frac{$var1 _{2}-$var1 _{1}}{$var3}-$var2 _{1} \)"; +$wrong3 = "\( \frac{$var3}{$var1 _{2}-$var1 _{1}}+$var2 _{1} \)"; + +Context("Numeric"); +$mc = new_multiple_choice(); +$mc->qa( + " ", + $correct +); +$mc->extra( + $wrong1, + $wrong2, + $wrong3, +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve for [`[$var2] _{2}`] in this expression: + + [`` [$var3] = \frac{[$var2]_{2}-[$var2]_{1}}{[$var1]_{2}-[$var1]_{1}} ``] + +END_PGML + + +BEGIN_TEXT +\{ $mc->print_q() \} +$BR +\{ $mc->print_a() \} +END_TEXT + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( radio_cmp( $mc->correct_ans() ) ); + +############################################## +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + [$var3] &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var1] _{2}-[$var1] _{1}} \\ + [$var3] \cdot ([$var1] _{2}-[$var1] _{1}) &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var1] _{2}-[$var1] _{1}} \cdot ([$var1] _{2}-[$var1] _{1}) \\ + [$var3]([$var1] _{2}-[$var1] _{1}) &= [$var2] _{2}-[$var2] _{1} \\ + [$var3]([$var1] _{2}-[$var1] _{1}) \mathbf{+[$var2] _{1}} &= [$var2] _{2}-[$var2] _{1} \mathbf{+[$var2] _{1}} \\ + [$var3]([$var1] _{2}-[$var1] _{1}) +[$var2] _{1} &= [$var2] _{2} \\ + [$var2] _{2} &= [$var3]([$var1] _{2}-[$var1] _{1}) +[$var2] _{1} +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation230.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation230.pg new file mode 100644 index 0000000000..556318b4c2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation230.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of m=(y2-y1)/(x2-x1) for y1 +# +# Last updated: Carl Yao 08/31/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','subscript') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +do {$var3 = RandomVariableName(type=>'variable');} until ( ($var3 ne $var2) && ($var3 ne $var1) ); + + +$correct = "\( $var2 _{2} - $var3 ($var1 _{2}-$var1 _{1}) \)"; +$wrong1 = "\( $var3 ($var1 _{2}-$var1 _{1}) - $var2 _{2} \)"; +$wrong2 = "\( $var2 _{2} - \frac{$var1 _{2}-$var1 _{1}}{$var3} \)"; +$wrong3 = "\( $var2 _{2} - \frac{$var3}{$var1 _{2}-$var1 _{1}} \)"; + +Context("Numeric"); +$mc = new_multiple_choice(); +$mc->qa( + " ", + $correct +); +$mc->extra( + $wrong1, + $wrong2, + $wrong3, +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve for [`[$var2] _{1}`] in this expression: + + [`` [$var3] = \frac{[$var2]_{2}-[$var2]_{1}}{[$var1]_{2}-[$var1]_{1}} ``] + +END_PGML + + +BEGIN_TEXT +\{ $mc->print_q() \} +$BR +\{ $mc->print_a() \} +END_TEXT + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( radio_cmp( $mc->correct_ans() ) ); + +############################################## +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$var3] &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var1] _{2}-[$var1] _{1}} \\ + [$var3] \cdot ([$var1] _{2}-[$var1] _{1}) &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var1] _{2}-[$var1] _{1}} \cdot ([$var1] _{2}-[$var1] _{1}) \\ + [$var3]([$var1] _{2}-[$var1] _{1}) &= [$var2] _{2}-[$var2] _{1} \\ + [$var3]([$var1] _{2}-[$var1] _{1}) \mathbf{+[$var2] _{1}} &= [$var2] _{2}-[$var2] _{1} \mathbf{+[$var2] _{1}} \\ + [$var3]([$var1] _{2}-[$var1] _{1}) +[$var2] _{1} &= [$var2] _{2} \\ + [$var3]([$var1] _{2}-[$var1] _{1}) +[$var2] _{1} -\mathbf{[$var3]([$var1] _{2}-[$var1] _{1})} &= [$var2] _{2}-\mathbf{[$var3]([$var1] _{2}-[$var1] _{1})} \\ + [$var2] _{1} &= [$var2] _{2}-[$var3]([$var1] _{2}-[$var1] _{1}) +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation240.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation240.pg new file mode 100644 index 0000000000..1097dbdee8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation240.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of m=(y2-y1)/(x2-x1) for x1 +# +# Last updated: Carl Yao 08/31/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','subscript') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +do {$var3 = RandomVariableName(type=>'variable');} until ( ($var3 ne $var2) && ($var3 ne $var1) ); + + +$correct = "\( $var1 _{2} - \frac{$var2 _{2}-$var2 _{1}}{$var3} \)"; +$wrong1 = "\( \frac{$var2 _{2}-$var2 _{1}}{$var3} - $var1 _{2} \)"; +$wrong2 = "\( $var2 _{2} - $var3($var1 _{2} - $var1 _{1}) \)"; +$wrong3 = "\( $var3($var1 _{2} - $var1 _{1}) -$var2 _{2} \)"; + +Context("Numeric"); +$mc = new_multiple_choice(); +$mc->qa( + " ", + $correct +); +$mc->extra( + $wrong1, + $wrong2, + $wrong3, +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve for [`[$var1] _{1}`] in this expression: + + [`` [$var3] = \frac{[$var2]_{2}-[$var2]_{1}}{[$var1]_{2}-[$var1]_{1}} ``] + +END_PGML + + +BEGIN_TEXT +\{ $mc->print_q() \} +$BR +\{ $mc->print_a() \} +END_TEXT + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( radio_cmp( $mc->correct_ans() ) ); + +############################################## +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$var3] &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var1] _{2}-[$var1] _{1}} \\ + [$var3] \cdot ([$var1] _{2}-[$var1] _{1}) &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var1] _{2}-[$var1] _{1}} \cdot ([$var1] _{2}-[$var1] _{1}) \\ + [$var3]([$var1] _{2}-[$var1] _{1}) &= [$var2] _{2}-[$var2] _{1} \\ + \frac{[$var3]([$var1] _{2}-[$var1] _{1})}{[$var3]} &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var3]} \\ + [$var1] _{2}-[$var1] _{1} &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var3]} \\ + [$var1] _{2}-[$var1] _{1} \mathbf{+[$var1] _{1}} &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var3]} \mathbf{+[$var1] _{1}} \\ + [$var1] _{2} &= [$var1] _{1} + \frac{[$var2] _{2}-[$var2] _{1}}{[$var3]} \\ + [$var1] _{2} \mathbf{-\frac{[$var2] _{2}-[$var2] _{1}}{[$var3]}} &= [$var1] _{1} + \frac{[$var2] _{2}-[$var2] _{1}}{[$var3]} \mathbf{-\frac{[$var2] _{2}-[$var2] _{1}}{[$var3]}} \\ + [$var1] _{2} -\frac{[$var2] _{2}-[$var2] _{1}}{[$var3]} &= [$var1] _{1} \\ + [$var1] _{1} &= [$var1] _{2} -\frac{[$var2] _{2}-[$var2] _{1}}{[$var3]} +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation250.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation250.pg new file mode 100644 index 0000000000..c9bcc91ea3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation250.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of m=(y2-y1)/(x2-x1) for x2 +# +# Last updated: Carl Yao 08/31/15 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','subscript') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var1 = RandomVariableName(type=>'variable'); +do {$var2 = RandomVariableName(type=>'variable');} until ($var1 ne $var2); +do {$var3 = RandomVariableName(type=>'variable');} until ( ($var3 ne $var2) && ($var3 ne $var1) ); + + +$correct = "\( $var1 _{1} + \frac{$var2 _{2}-$var2 _{1}}{$var3} \)"; +$wrong1 = "\( $var1 _{1} - \frac{$var2 _{2}-$var2 _{1}}{$var3} \)"; +$wrong2 = "\( $var1 _{1} + $var3($var2 _{2} - $var2 _{1}) \)"; +$wrong3 = "\( $var1 _{1} - $var3($var2 _{2} - $var2 _{1}) \)"; + +Context("Numeric"); +$mc = new_multiple_choice(); +$mc->qa( + " ", + $correct +); +$mc->extra( + $wrong1, + $wrong2, + $wrong3, +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve for [`[$var1] _{2}`] in this expression: + + [`` [$var3] = \frac{[$var2]_{2}-[$var2]_{1}}{[$var1]_{2}-[$var1]_{1}} ``] + +END_PGML + + +BEGIN_TEXT +\{ $mc->print_q() \} +$BR +\{ $mc->print_a() \} +END_TEXT + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( radio_cmp( $mc->correct_ans() ) ); + +############################################## +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$var3] &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var1] _{2}-[$var1] _{1}} \\ + [$var3] \cdot ([$var1] _{2}-[$var1] _{1}) &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var1] _{2}-[$var1] _{1}} \cdot ([$var1] _{2}-[$var1] _{1}) \\ + [$var3]([$var1] _{2}-[$var1] _{1}) &= [$var2] _{2}-[$var2] _{1} \\ + \frac{[$var3]([$var1] _{2}-[$var1] _{1})}{[$var3]} &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var3]} \\ + [$var1] _{2}-[$var1] _{1} &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var3]} \\ + [$var1] _{2}-[$var1] _{1} \mathbf{+[$var1] _{1}} &= \frac{[$var2] _{2}-[$var2] _{1}}{[$var3]} \mathbf{+[$var1] _{1}} \\ + [$var1] _{2} &= [$var1] _{1} + \frac{[$var2] _{2}-[$var2] _{1}}{[$var3]} +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation260.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation260.pg new file mode 100644 index 0000000000..81664fce31 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation260.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of t=d/r +# +# Last updated: Carl Yao, 7/20/16 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','multiply','divide','subtract','negative') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName()} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); + +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real',$var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans = Compute("$var2/$var1"); +$ansEq=Formula("$var3=$ans"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this equation for [`[$var3]`]: + + [`` [$var1] = \frac{[$var2]}{[$var3]} ``] + + [_______] + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form $var3 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +[`` +\begin{aligned} + [$var1] &= \frac{[$var2]}{[$var3]} \\ + [$var1] \cdot [$var3] &= \frac{[$var2]}{[$var3]} \cdot [$var3] \\ + [$var1] \cdot [$var3] &= [$var2] \\ + \frac{[$var1] \cdot [$var3]}{[$var1]} &= \frac{[$var2]}{[$var1]} \\ + [$var3] &= \frac{[$var2]}{[$var1]} +\end{aligned} +``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation270.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation270.pg new file mode 100644 index 0000000000..20705582d0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation270.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of t=d/r +# +# Last updated: Carl Yao, 7/20/16 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','multiply','divide','subtract','negative') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName()} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); + +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real',$var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var2 = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans = Compute("$var1*$var3"); +$ansEq=Formula("$var2=$ans"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this equation for [`[$var2]`]: + + [`` [$var1] = \frac{[$var2]}{[$var3]} ``] + + [_______] + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +[`` +\begin{aligned} + [$var1] &= \frac{[$var2]}{[$var3]} \\ + [$var1] \cdot [$var3] &= \frac{[$var2]}{[$var3]} \cdot [$var3] \\ + [$var1] \cdot [$var3] &= [$var2] \\ + [$var2] &= [$var1] \cdot [$var3] +\end{aligned} +``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation280.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation280.pg new file mode 100644 index 0000000000..1251c90d50 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation280.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of 1/2t=1/r +# +# Last updated: Carl Yao, 7/20/16 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','multiply','divide','subtract','negative') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName()} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); + +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real',$var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + +$a = random(2,9,1); +$commonD = Compute("$a*$var1*$var2")->reduce; + +$ans = Compute("$var2/$a"); +$ansEq=Formula("$var1=$ans"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this equation for [`[$var1]`]: + + [`` \frac{1}{[$a][$var1]} = \frac{1}{[$var2]} ``] + + [_______] + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +To solve this equation, we multiple both sides with the common denominator [`[$commonD]`]: + +[`` +\begin{aligned} + \frac{1}{[$a][$var1]} &= \frac{1}{[$var2]} \\ + \frac{1}{[$a][$var1]} \cdot [$a][$var1][$var2] &= \frac{1}{[$var2]} \cdot [$a][$var1][$var2] \\ + [$var2] &= [$a][$var1] \\ + \frac{[$var2]}{[$a]} &= \frac{[$a][$var1]}{[$a]} \\ + \frac{[$var2]}{[$a]} &= [$var1] \\ + [$var1] &= \frac{[$var2]}{[$a]} +\end{aligned} +``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation290.pg b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation290.pg new file mode 100644 index 0000000000..3fe6803098 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation290.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of 1/a=2/(b+3) +# +# Last updated: Carl Yao, 7/20/16 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','multiply','divide','subtract','negative') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName()} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); + +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real',$var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + +$a = random(2,9,1); +$b = random(2,9,1); +$commonD = Compute("$var1*($var2+$b)")->reduce; + +$ans = Compute("$a*$var1-$b"); +$ansEq=Formula("$var2=$ans"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this equation for [`[$var2]`]: + + [`` \frac{1}{[$var1]} = \frac{[$a]}{[$var2]+[$b]} ``] + + [_______] + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +To solve this equation, we multiple both sides with the common denominator [`[$commonD]`]: + +[`` +\begin{aligned} + \frac{1}{[$var1]} &= \frac{[$a]}{[$var2]+[$b]} \\ + \frac{1}{[$var1]} \cdot [$var1]([$var2]+[$b]) &= \frac{[$a]}{[$var2]+[$b]} \cdot [$var1]([$var2]+[$b]) \\ + [$var2]+[$b] &= [$a][$var1] \\ + [$var2] &= [$a][$var1] - [$b] +\end{aligned} +``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg index 8225506c84..441c07a5ef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg @@ -14,15 +14,18 @@ # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.NS.6') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','add','subtract') +## DBCCSS('6.NS.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -70,11 +73,12 @@ TEXT(beginproblem()); BEGIN_PGML -Perform the given addition and subtraction: - - [`` [$func1]= ``] [________]{$ans1} +Perform the given addition and subtraction. +a. [` [$func1] `] + [________]{$ans1} - [`` [$func2]= ``] [________]{$ans2} +a. [` [$func2] `] + [________]{$ans2} END_PGML @@ -82,7 +86,7 @@ END_PGML BEGIN_PGML_SOLUTION -*Problem 1* +a. [` \begin{aligned} @@ -92,7 +96,7 @@ BEGIN_PGML_SOLUTION \end{aligned} `] -*Problem 2* +b. [`\begin{aligned} [$func2] & =[$d]+[$absE]+([$f]) \\ diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers20.pg index a1cd80f792..41f07f35d8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers20.pg @@ -22,15 +22,18 @@ # ENDDESCRIPTION -## DBCCSS('6.NS.6','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','add','subtract','absolute value') +## DBCCSS('6.NS.6','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -42,7 +45,7 @@ loadMacros( "PGML.pl", "answerHints.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,9 +68,6 @@ Context()->flags->set(trimTrailingZeros=>1); Context()->operators->undefine('+','-'); $CurrencyAns = Currency($ans); -BEGIN_TEXT -$y$t -END_TEXT ############################################## TEXT(beginproblem()); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers30.pg index 72345caf62..777154e4d1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers30.pg @@ -20,15 +20,18 @@ # Last updated: Jordan, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.NS.6','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','add','subtract','absolute value') +## DBCCSS('6.NS.6','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -39,7 +42,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg new file mode 100644 index 0000000000..655a6faedc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# A mountain is [`[$a]`] feet _above_ sea level. +# +# A trench is [`[$b]`] feet _below_ sea level. +# +# What is the difference in elevation between the mountain top and the bottom of the trench? Use positive and negative numbers to # solve this problem. +# +# Last updated: Jordan, 6/25/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','negative','add','subtract','absolute value') +## DBCCSS('6.NS.6','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$a=random(1000,1500,100); +$b=random(300,500,10); + +$ans = $a+$b; + + +$UnitAns = NumberWithUnits("$ans ft"); +$wrong = NumberWithUnits("$a-$b ft"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A mountain is [`[$a]`] feet _above_ sea level. A trench is [`[$b]`] feet _below_ sea level. What is the difference in elevation between the mountain top and the bottom of the trench? + + [_]{$UnitAns}{16} + +END_PGML + +############################################## + + +# AnswerHints causing bug; temporarily commenting out +#ANS($UnitAns -> cmp() -> +# withPostFilter(AnswerHints( +# $wrong => +# "Remember that the trench is *below* sea level - does that mean its height has a positive or negative value?"))); + + +BEGIN_PGML_SOLUTION + +The height of the mountain is simply [`[$a]`] feet because it is _above_ sea level. + +The bottom of the trench is [`-[$b]`] feet in height. Note that it is negative because it is _below_ sea level. + +To find the difference in height, we use subtraction: + + [` + \begin{aligned} + [$a]-(-[$b]) & = [$a]+[$b]\\ + & = [$ans] + \end{aligned} + `] + +The difference in elevation from the mountain top to the bottom of the trench is [`[$UnitAns]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg index f2e31ec84d..1ec4fa0564 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.NS') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('integer','negative','add') +## DBCCSS('7.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -63,13 +66,15 @@ TEXT(beginproblem()); BEGIN_PGML -Add the following: +Add the following. +a. [` [$a]+([$b]) `] + [________]{$ans1} - [`` [$a]+([$b])= ``] [________]{$ans1} +a. [` [$c]+([$d]) `] + [________]{$ans2} - [`` [$c]+([$d])= ``] [________]{$ans2} - - [`` [$e]+([$f])= ``] [________]{$ans3} +a. [` [$e]+([$f]) `] + [________]{$ans3} END_PGML @@ -79,7 +84,7 @@ $absA = abs($a); $absB = abs($b); $absAns1 = abs($ans1); -$refreshCachedImages=1; + $gr = init_graph($a-5,-1,$a+5,1, axes=>[$a-6,0], #grid=>[5,5], diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg new file mode 100644 index 0000000000..540f0a538e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg @@ -0,0 +1,150 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Add a negative number to a positive number +# +# Last edited: Jordan 6/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('integer','negative','add') +## DBCCSS('7.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +############################################## + +#adding two negative numbers + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(1,5,1); +$b = random(-10,-6,1); +$c = random(5,10,1); +$d = random(-4,-1,1); +$e = random(1,10,1); +$f = -$e; + +$ans1 = Compute("$a+$b")->reduce; +$ans2 = Compute("$c+$d")->reduce; +$ans3 = Compute("$e+$f")->reduce; + +Context("LimitedNumeric"); +$ans1 = Compute("$ans1"); +$ans2 = Compute("$ans2"); +$ans3 = Compute("$ans3"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Add the following. +a. [` [$a]+([$b]) `] + [________]{$ans1} + +a. [` [$c]+([$d]) `] + [________]{$ans2} + +a. [` [$e]+([$f]) `] + [________]{$ans3} + +END_PGML + +############################################## + +$absA = abs($a); +$absB = abs($b); +$absAns1 = abs($ans1); + + +$gr = init_graph($a-12,-1,$a+12,1, +axes=>[$a-13,0], +#grid=>[5,5], +size=>[400,50] +); + +@ticks = (); +for my $i (-12..12) {push(@ticks,$a+$i);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->stamps( closed_circle($a,0,'blue') ); +$gr->lb( new Label($a,-0.5,"$a",'black','center','middle')); + +$gr->moveTo($a,0.3); +$gr->arrowTo($ans1,0.3,'red',2); +$gr->lb( new Label(($ans1+$a)/2,0.3,'adding '."$b",'black','center','bottom')); + +$gr->stamps( closed_circle($a+$b,0,'blue') ); +$gr->lb( new Label($ans1,-0.5,"$ans1",'black','center','middle')); + + +BEGIN_PGML_SOLUTION + +Here are two different explanations of how two negative numbers can be added together. + +######METHOD 1 + +Use a number line. Let's find [`[$a]+([$b])`]. + +First, find [`[$a]`] on the number line. Next, since we are adding a negative number, we move left, in the negative direction, by [`[$absB]`] units. We will reach [`[$ans1]`] on the number line, which is the answer. + +>> [@image( insertGraph($gr), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'alt="Graph of a number line with a dot at '. + "$a". + ' and an arrow pointing leftward to '. + "$ans1".'.", + title="A number line showing addition with negative numbers'. + '."' )@]* << + + +So, [`[$a]+([$b])=[$ans1]`]. + +Similarly, [`[$c]+([$d])=[$ans2]`], and [`[$e]+([$f])=[$ans3]`]. + +######METHOD 2 + +A second method asks you to think in terms of money. Let's find [`[$a]+([$b])`]. + +The first number is [`[$a]`]. Since it's positive, it's like you won [`[$absA]`] dollars while gambling at the casino this morning. + +The second number is [`[$b]`]. Since it's negative, it's like you lost [`[$absB]`] dollars while gambling at the casino this afternoon. + +Since you lost more money than you won, overall you have lost, implying the answer is negative. + +Since you won [`[$absA]`] dollars and then lost [`[$absB]`] dollars, it makes sense that you lost the difference of [`[$absB]`] and [`[$absA]`] dollars, which is [`[$absAns1]`] dollars. So the final answer is: [`[$a]+([$b])=[$ans1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg new file mode 100644 index 0000000000..3fdeea4121 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg @@ -0,0 +1,150 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Add a positive number to a negative number +# +# Last edited: Jordan 6/21/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('integer','negative','add') +## DBCCSS('7.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +############################################## + +#adding two negative numbers + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$b = random(1,5,1); +$a = random(-10,-6,1); +$d = random(5,10,1); +$c = random(-4,-1,1); +$e = random(-10,-1,1); +$f = -$e; + +$ans1 = Compute("$a+$b")->reduce; +$ans2 = Compute("$c+$d")->reduce; +$ans3 = Compute("$e+$f")->reduce; + +Context("LimitedNumeric"); +$ans1 = Compute("$ans1"); +$ans2 = Compute("$ans2"); +$ans3 = Compute("$ans3"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Add the following. +a. [` [$a]+[$b] `] + [________]{$ans1} + +a. [` [$c]+[$d] `] + [________]{$ans2} + +a. [` [$e]+[$f] `] + [________]{$ans3} + +END_PGML + +############################################## + +$absA = abs($a); +$absB = abs($b); +$absAns1 = abs($ans1); + + +$gr = init_graph($a-8,-1,$a+8,1, +axes=>[$a-9,0], +#grid=>[5,5], +size=>[400,50] +); + +@ticks = (); +for my $i (-8..8) {push(@ticks,$a+$i);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->stamps( closed_circle($a,0,'blue') ); +$gr->lb( new Label($a,-0.5,"$a",'black','center','middle')); + +$gr->moveTo($a,0.3); +$gr->arrowTo($ans1,0.3,'red',2); +$gr->lb( new Label(($ans1+$a)/2,0.3,'adding '."$b",'black','center','bottom')); + +$gr->stamps( closed_circle($a+$b,0,'blue') ); +$gr->lb( new Label($ans1,-0.5,"$ans1",'black','center','middle')); + + +BEGIN_PGML_SOLUTION + +Here are two different explanations of how two negative numbers can be added together. + +######METHOD 1 + +Use a number line. Let's find [`[$a]+[$b]`]. + +First, find [`[$a]`] on the number line. Next, since we are adding a positive number, we move right, in the positive direction, by [`[$absB]`] units. We will reach [`[$ans1]`] on the number line, which is the answer. + +>> [@image( insertGraph($gr), width=>400, height=>50, tex_size=>800, + extra_html_tags=>'alt="Graph of a number line with a dot at '. + "$a". + ' and an arrow pointing leftward to '. + "$ans1".'.", + title="A number line showing addition with negative numbers'. + '."' )@]* << + + +So, [`[$a]+([$b])=[$ans1]`]. + +Similarly, [`[$c]+([$d])=[$ans2]`], and [`[$e]+([$f])=[$ans3]`]. + +######METHOD 2 + +A second method asks you to think in terms of money. Let's find [`[$a]+[$b]`]. + +The first number is [`[$a]`]. Since it's negative, it's like you lost [`[$absA]`] dollars while gambling at the casino this morning. + +The second number is [`[$b]`]. Since it's positive, it's like you won [`[$absB]`] dollars while gambling at the casino this afternoon. + +Since you lost more money than you won, overall you have lost, implying the answer is negative. + +Since you lost [`[$absA]`] dollars and then won [`[$absB]`] dollars, it makes sense that you lost the difference of [`[$absA]`] and [`[$absB]`] dollars, which is [`[$absAns1]`] dollars. So the final answer is: [`[$a]+[$b]=[$ans1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers40.pg new file mode 100644 index 0000000000..e8ff5cdf8d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers40.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# +# Add positive and negative numbers +# +# Last edited: Jordan 6/30/18 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') +## KEYWORDS('integer','negative','add') +## DBCCSS('7.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +############################################## + +#adding two negative numbers + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(-100,-11,1); +$b = random(-100,-11,1); +$c = random(-100,-11,1); +$d = random(11,100,1); +$e = random(11,100,1); +$f = random(-100,-11,1); + +$ans1 = Compute("$a+$b")->reduce; +$ans2 = Compute("$c+$d")->reduce; +$ans3 = Compute("$e+$f")->reduce; + +Context("LimitedNumeric"); +$ans1 = Compute("$ans1"); +$ans2 = Compute("$ans2"); +$ans3 = Compute("$ans3"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Add the following. +a. [` [$a]+([$b]) `] + [________]{$ans1} + +a. [` [$c]+[$d] `] + [________]{$ans2} + +a. [` [$e]+([$f]) `] + [________]{$ans3} + + +END_PGML + +############################################## + +$absA = abs($a); +$absB = abs($b); +$absAns1 = abs($ans1); + + +$gr = init_graph($a-8,-1,$a+8,1, +axes=>[$a-9,0], +#grid=>[5,5], +size=>[400,50] +); + +@ticks = (); +for my $i (-8..8) {push(@ticks,$a+$i);}; + +$gr->h_ticks(0,"black",@ticks); +$gr->stamps( closed_circle($a,0,'blue') ); +$gr->lb( new Label($a,-0.5,"$a",'black','center','middle')); + +$gr->moveTo($a,0.3); +$gr->arrowTo($ans1,0.3,'red',2); +$gr->lb( new Label(($ans1+$a)/2,0.3,'adding '."$b",'black','center','bottom')); + +$gr->stamps( closed_circle($a+$b,0,'blue') ); +$gr->lb( new Label($ans1,-0.5,"$ans1",'black','center','middle')); + + + +ENDDOCUMENT(); + + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers10.pg index e720893fd9..4c7964a162 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers10.pg @@ -13,15 +13,18 @@ # Last updated: Jordan 7/25/13; Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.NS.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Reducing fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','divide') +## DBCCSS('6.NS.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -79,12 +82,14 @@ TEXT(beginproblem()); BEGIN_PGML Evaluate the following. +a. [` \frac{[$num1]}{[$den1]} `] + [________]{$ans1->cmp(studentsMustReduceFractions=>1)} -a) [`` \frac{[$num1]}{[$den1]}= ``] [________]{$ans1->cmp(studentsMustReduceFractions=>1)} - -b) [`` \frac{[$num2]}{[$den2]}= ``] [________]{$ans2->cmp(studentsMustReduceFractions=>1)} +a. [` \frac{[$num2]}{[$den2]} `] + [________]{$ans2->cmp(studentsMustReduceFractions=>1)} -c) [`` \frac{[$num3]}{[$den3]}= ``] [________]{$ans3->cmp(studentsMustReduceFractions=>1)} +a. [` \frac{[$num3]}{[$den3]} `] + [________]{$ans3->cmp(studentsMustReduceFractions=>1)} END_PGML @@ -106,11 +111,11 @@ The rules for dividing positive numbers are the same as those for multiplication The solutions are: -a) [`` \frac{[$num1]}{[$den1]}=[$ans1], ``] +a. [`` \frac{[$num1]}{[$den1]}=[$ans1], ``] -b) [`` \frac{[$num2]}{[$den2]}=[$ans2], ``] +a. [`` \frac{[$num2]}{[$den2]}=[$ans2], ``] -c) [`` \frac{[$num3]}{[$den3]}=[$ans3]. ``] +a. [`` \frac{[$num3]}{[$den3]}=[$ans3]. ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers20.pg index 1a1ef5a81b..45ebc15acf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers20.pg @@ -19,15 +19,18 @@ # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.NS.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Reducing fractions) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','divide') +## DBCCSS('6.NS.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +40,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -72,19 +76,24 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate each of the following - if the result is undefined then say *undefined* (spelling counts). - -a) [`` \frac{[$num1]}{[$den1]}= ``] [________]{$ans1} +Evaluate the following. [@KeyboardInstructions('If the result is undefined then enter [|undefined|]*.')@]** +a. [` \frac{[$num1]}{[$den1]} `] + [________]{$ans1} -b) [`` \frac{[$num2]}{[$den2]}= ``] [________]{$ans2} +a. [` \frac{[$num2]}{[$den2]} `] + [________]{$ans2} -c) [`` \frac{[$num3]}{[$den3]}= ``] [________]{$ans3} +a. [` \frac{[$num3]}{[$den3]} `] + [________]{$ans3} -d) [`` \frac{[$num4]}{[$den4]}= ``] [________]{$ans4} +a. [` \frac{[$num4]}{[$den4]} `] + [________]{$ans4} -e) [`` \frac{[$num5]}{[$den5]}= ``] [________]{$ans5} +a. [` \frac{[$num5]}{[$den5]} `] + [________]{$ans5} -f) [`` \frac{[$num6]}{[$den6]}= ``] [________]{$ans6} +a. [` \frac{[$num6]}{[$den6]} `] + [________]{$ans6} END_PGML @@ -106,17 +115,17 @@ In addition, [`0`] divided by any number (except [`0`]) is [`0`]; any number div The solutions are: -a) [`` \frac{[$num1]}{[$den1]}=[$ans1], ``] +a. [`` \frac{[$num1]}{[$den1]}=[$ans1], ``] -b) [`` \frac{[$num2]}{[$den2]}=[$ans2], ``] +a. [`` \frac{[$num2]}{[$den2]}=[$ans2], ``] -c) [`` \frac{[$num3]}{[$den3]}=[$ans3], ``] +a. [`` \frac{[$num3]}{[$den3]}=[$ans3], ``] -d) [`` \frac{[$num4]}{[$den4]}=[$ans4], ``] +a. [`` \frac{[$num4]}{[$den4]}=[$ans4], ``] -e) [`` \frac{[$num5]}{[$den5]} ``] is undefined +a. [`` \frac{[$num5]}{[$den5]} ``] is undefined -f) [`` \frac{[$num6]}{[$den6]}=[$ans6]. ``] +a. [`` \frac{[$num6]}{[$den6]}=[$ans6]. ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers10.pg index 07a90dd50b..b764d9e299 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers10.pg @@ -17,16 +17,18 @@ # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.NS.6') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MultSignedInt) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','multiply') +## DBCCSS('6.NS.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -37,7 +39,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,15 +67,18 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply the following integers. - -a) [`` ([$a])\cdot([$b])= ``] [________]{$ans1} +Multiply the following. +a. [` ([$a])\cdot([$b]) `] + [________]{$ans1} -b) [`` ([$c])\cdot[$d]= ``] [________]{$ans2} +a. [` ([$c])\cdot[$d] `] + [________]{$ans2} -c) [`` [$e]\cdot([$f])= ``] [________]{$ans3} +a. [` [$e]\cdot([$f]) `] + [________]{$ans3} -d) [`` ([$g])\cdot[$h]= ``] [________]{$ans4} +a. [` ([$g])\cdot[$h] `] + [________]{$ans4} END_PGML @@ -93,13 +98,13 @@ The rules for multiplying positive and negative numbers are: The solutions are: -a) [`` ([$a])\cdot([$b])=[$ans1], ``] +a. [`` ([$a])\cdot([$b])=[$ans1], ``] -b) [`` ([$c])\cdot[$d]=[$ans2], ``] +a. [`` ([$c])\cdot[$d]=[$ans2], ``] -c) [`` [$e]\cdot([$f])=[$ans3], ``] +a. [`` [$e]\cdot([$f])=[$ans3], ``] -d) [`` ([$g])\cdot[$h]=[$ans4]. ``] +a. [`` ([$g])\cdot[$h]=[$ans4]. ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers20.pg index 81b5d57251..91cecfb2b3 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers20.pg @@ -12,16 +12,18 @@ # Last updated: Hughes, 7/30/13, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.NS.6') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MultSignedInt) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','negative','operation','multiply') +## DBCCSS('6.NS.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +34,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,13 +66,15 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply the following integers. - -a) [`` ([$a])\cdot([$b])\cdot([$c]) = ``] [________]{$ans1} +Multiply the following. +a. [` ([$a])\cdot([$b])\cdot([$c]) `] + [________]{$ans1} -b) [`` [$d]\cdot([$e])\cdot([$f])= ``] [________]{$ans2} +a. [` [$d]\cdot([$e])\cdot([$f]) `] + [________]{$ans2} -c) [`` ([$g])\cdot([$h])\cdot[$i]= ``] [________]{$ans3} +a. [` ([$g])\cdot([$h])\cdot[$i] `] + [________]{$ans3} END_PGML @@ -83,19 +87,25 @@ END_PGML BEGIN_PGML_SOLUTION -a) [` +a. + + [` \begin{aligned}[t] ([$a])\cdot([$b])\cdot([$c]) & = [$pro1Step]\cdot([$c]) \\ & = [$ans1] \end{aligned}`] -b) [` +b. + + [` \begin{aligned}[t] [$d]\cdot([$e])\cdot([$f]) & = [$pro2Step]\cdot([$f]) \\ & = [$ans2] \end{aligned}`] -c) [` [$g]\cdot([$h])\cdot[$i] =0 `] +c. + + [` [$g]\cdot([$h])\cdot[$i] =0 `] Note that in the last case there is no need to waste time multiplying the first two numbers because any number multiplied by [`0`] equals [`0`]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg index 99f02b520d..bfac831536 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('integer','negative','subtract') +## DBCCSS('6.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -63,13 +66,15 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract the following integers: +Subtract the following. +a. [` [$a]-[$b] `] + [________]{$ans1} - [`` [$a]-[$b]= ``] [________]{$ans1} +a. [` [$c]-[$d] `] + [________]{$ans2} - [`` [$c]-[$d]= ``] [________]{$ans2} - - [`` [$e]-[$f]= ``] [________]{$ans3} +a. [` [$e]-[$f] `] + [________]{$ans3} END_PGML @@ -79,7 +84,7 @@ END_PGML $negB = -$b; $absAns1 = abs($ans1); -$refreshCachedImages=1; + $gr = init_graph($a-12,-1,$a+12,1, axes=>[$a-13,0], #grid=>[5,5], diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg index 276169a59a..21a3023ac6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('integer','negative','subtract') +## DBCCSS('6.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,13 +65,15 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract the following integers: +Subtract the following. +a. [` [$a]-[$b] `] + [________]{$ans1} - [`` [$a]-[$b]= ``] [________]{$ans1} +a. [` [$c]-[$d] `] + [________]{$ans2} - [`` [$c]-[$d]= ``] [________]{$ans2} - - [`` [$e]-[$f]= ``] [________]{$ans3} +a. [` [$e]-[$f] `] + [________]{$ans3} END_PGML @@ -78,7 +83,7 @@ $absA = abs($a); $negB = -$b; $absAns1 = abs($ans1); -$refreshCachedImages=1; + $gr = init_graph($a-6,-1,$a+6,1, axes=>[$a-7,0], #grid=>[5,5], diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg index ee7a85283a..5d024f18f8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions','Equivalent Expressions','Reordering and Regrouping') ## KEYWORDS('integer','negative','subtract') +## DBCCSS('6.NS') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,13 +65,15 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract the following integers: +Subtract the following. +a. [` -[$a]-([$b]) `] + [________]{$ans1} - [`` -[$a]-([$b])= ``] [________]{$ans1} +a. [` -[$c]-([$d]) `] + [________]{$ans2} - [`` -[$c]-([$d])= ``] [________]{$ans2} - - [`` -[$e]-([$f])= ``] [________]{$ans3} +a. [` -[$e]-([$f]) `] + [________]{$ans3} END_PGML @@ -78,7 +83,7 @@ $absA = abs($a); $negB = -$b; $absAns1 = abs($ans1); -$refreshCachedImages=1; + $gr = init_graph(-$a-12,-1,-$a+12,1, axes=>[-$a-13,0], #grid=>[5,5], diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication10.pg new file mode 100644 index 0000000000..60c32bd632 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication10.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# Application problem. Slope is positive. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context("Numeric")->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m=random(1.5,6.5,1)/100; +$b=random(11,19,1); + +$x1=random(210,300,10); +$y1=$m*$x1+$b; +$x2=random(310,400,10); +$y2=$m*$x2+$b; +$x3=random(110,200,10); +$y3=$m*$x3+$b; +$x4=random(410,500,10); +$y4=$m*$x4+$b; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +Context("Currency")->flags->set(noExtraDecimals=>0); +$cy1 = Currency($y1); +$cy2 = Currency($y2); +$cy3 = Currency($y3); +$cy4 = Currency($y4); +$cm = Currency($m); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +By your cell phone contract, you pay a monthly fee plus some money for each minute you use the phone during the month. In one month, you spent [`[$x1]`] minutes on the phone, and paid [`[$cy1]`]. In another month, you spent [`[$x2]`] minutes on the phone, and paid [`[$cy2]`]. What is the rate (in dollars per minute) that the phone company is charging you? That is, what is the slope of the line if you plotted the bill versus the number of minutes spent on the phone? + +The rate is [__]{$cm}{width=>5} per minute. + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +To find the slope, we need two points on the line. We have been given that [`([$x1],[$y1])`] and [`([$x2],[$y2])`] are points on the linear model, so we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + + First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + + Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m] \end{aligned}``] + + This line's slope is [`[$m]`]. This implies you have to pay [`[$cm]`] per minute that you use the phone. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication20.pg new file mode 100644 index 0000000000..d33ca1d9b1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication20.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# Application problem. Slope is negative. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context("Numeric")->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m= -random(20000,50000,1000); +$b= random(600000,1000000,1000); + +$x1=random(2,4,1); +$y1=$m*$x1+$b; +$x2=random(5,7,1); +$y2=$m*$x2+$b; +$x3=random(9,11,1); +$y3=$m*$x3+$b; + +$x4 = ($y4-$b)/$m; +if ($x4==int($x4)) { + $out1 = "$x4 &= x"; + $yx4 = 2000 + $x4; +} else { + $x4 = sprintf("%.2f", $x4); + $out1 = "$x4 & \approx x"; + $yx4 = 2000 + int($x4); +} + +$y4=0; + +$yx1 = 2000+$x1; +$yx2 = 2000+$x2; +$yx3 = 2000+$x3; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +$cy1 = Currency($y1); +$cy2 = Currency($y2); +$cy3 = Currency($y3); +$cy4 = Currency($y4); +$cb = Currency($b); +$cm = Currency(-$m); +$cz = Currency(0); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A company set aside a certain amount of money in the year 2000. The company spent exactly the same amount from that fund each year on perks for its employees. In [` [$yx1]`], there was still [`[$cy1]`] left in the fund. In [`[$yx2]`], there was [`[$cy2]`] left. What is the rate (in dollars per year) at which this company is spending from this fund? + +The company is spending [__]{$cm}{width=>15} per year on perks for its employees. + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; +$s7=sprintf("%.2f", $s6/$m); + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +To find the slope, we need two points on the line. We have been given that [`([$x1],[$y1])`] and [`([$x2],[$y2])`] are points on the linear model, so we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + + First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + + Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m] \end{aligned}``] + + This line's slope is [`[$m]`]. This implies that the company is spending [`[$cm]`] per year on perks for its employees. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication30.pg new file mode 100644 index 0000000000..be7bb191d7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication30.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# Application problem. Slope is positive. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context("Numeric")->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m=random(10,30,1)/100; +$b=random(110,190,1)/10; + +$x1=random(10,15,1); +$y1=$m*$x1+$b; +$x2=random(16,20,1); +$y2=$m*$x2+$b; +$x3=random(25,30,1); +$y3=$m*$x3+$b; +$x4=random(50,60,1); +$y4=$m*$x4+$b; + +$rate = NumberWithUnits("$m ft/mo"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A biologist has been observing a tree's height. [@ ucfirst( numberWord($x1) )@] months into the observation, the tree was [`[$y1]`] feet tall. [@ ucfirst( numberWord($x2) )@] months into the observation, the tree was [`[$y2]`] feet tall. What is the rate at which the tree is growing? In other words, what is the slope if you plotted height versus time? + +[@KeyboardInstructions('Use [|ft|]* for feet and [|mo|]* for months.')@]** + +[__]{$rate}{width=>15} + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +To find the slope, we need two points on the line. We have been given that [`([$x1],[$y1])`] and [`([$x2],[$y2])`] are points on the linear model, so we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + + First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + + Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m] \end{aligned}``] + + This line's slope is [`[$m]`]. This implies that the tree is growing at a rate of [`[$rate]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication40.pg new file mode 100644 index 0000000000..75f3a44fb2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeApplication40.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# Application problem. Slope is negative. +# +# Last updated: Jordan 8/31/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','application') +## DBCCSS('F-LE.2','8.F.3','A-CED','S-ID.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context("Numeric")->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$x4=random(40,50,1); +$y4=0; + +$m= -random(11,99,1)/10; +$negm = -$m; +$b= -$m*$x4; + +$x1=random(5,10,1); +$y1=$m*$x1+$b; +$x2=random(11,19,1); +$y2=$m*$x2+$b; +$x3=random(30,40,1); +$y3=$m*$x3+$b; + +$rate = NumberWithUnits("-$m g/min"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Scientists are conducting an experiment with a gas in a sealed container. The mass of the gas is measured, and the scientists realize that the gas is leaking over time in a linear way. [@numberWord($x1,capital=>1)@] minutes since the experiment started, the gas had a mass of [`[$y1]`] grams. [@numberWord($x2,capital=>1)@] minutes since the experiment started, the gas had a mass of [`[$y2]`] grams. At what rate is the gas leaking? + +[@KeyboardInstructions('Use [|g|]* for grams and [|min|]* for minutess.')@]** + +[__]{$rate}{width=>15} + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +$s5=$m*$x3; +$s6=$y4-$b; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +To find the slope, we need two points on the line. We have been given that [`([$x1],[$y1])`] and [`([$x2],[$y2])`] are points on the linear model, so we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + + First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + + Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\&=\frac{[$s1]}{[$s2]}\\&=[$m] \end{aligned}``] + + This line's slope is [`[$m]`]. This implies that the gas is leaking with a rate of [`[$rate]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept10.pg index 97d5344a60..2bea65dd58 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept10.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Extract_MandB1) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +31,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "contextFraction.pl", + "PGcourse.pl", ); ############################################## @@ -40,8 +43,8 @@ Context("Numeric"); $m=random(2,10,1); $b=non_zero_random(1,10,1); -Context("LimitedNumeric"); -$m = Compute($m); +Context("LimitedFraction"); +$m = Fraction($m); Context("Point"); Context()->parens->set("[" => {type => "Interval", close => "]"}); @@ -55,7 +58,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation [` y=[$m]x+[$b] `]. Find this line's slope and [`y`]-intercept. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [` y=[$m]x+[$b] `]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept100.pg index ed1ef056ad..d9e23997a8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept100.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Extract_MandB1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,9 +28,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "contextFraction.pl", "answerHints.pl", "parserOneOf.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -52,7 +56,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation [`` x= [$a] ``]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` x= [$a] ``]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept110.pg index 08ca43296d..1a6d701176 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept110.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: standard form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MandB_fromstandard) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,8 +28,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -53,7 +56,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation [`` -[$m]x+y= [$b] ``]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` -[$m]x+y= [$b] ``]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept120.pg index b883fd924a..780f74327b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept120.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: standard form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MandB_fromstandard) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,8 +28,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -52,7 +56,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation [`` -x-y= [$b] ``]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` -x-y= [$b] ``]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept130.pg index 859f7d8cfd..609b17d4bb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept130.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: standard form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MandB_fromstandard) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,8 +29,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -58,7 +62,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation [`` [$a]x+[$b]y= [$c] ``]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` [$a]x+[$b]y= [$c] ``]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept140.pg new file mode 100644 index 0000000000..368c6e16ec --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept140.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find slope and y-intercept of a linear equation, given Ax-By=-C +# Slope is an integer. +# +# Last edited: Jordan 8/15/13; Yao 6/27/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') +## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "contextFraction.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$b = random(2,5,1); +$a = $b*random(1,5,1); +$c = $b*non_zero_random(-5,5,1); +while (abs($c)==abs($a)) {$c = $b*non_zero_random(-5,5,1);} + +$m = $a/$b; +$d = -$c/$b; + +Context("LimitedNumeric"); +$m = Compute($m); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$yInt = Compute("(0,$d)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` [$a]x-[$b]y=[$c] ``]. + + This line's slope is [_______]{$m}. + + This line's [`y`]-intercept is [_______]. + +END_PGML + +ANS($yInt->cmp()->withPostFilter(AnswerHints( + sub {my ($correct,$student,$ans) = @_; + return $student->class eq 'Real'; + } => ["The y-intercept is a point with coordinates, not simply a number", replaceMessage => 1], + ))); + +############################################## + +BEGIN_PGML_SOLUTION + +When an equation of a line is written in the form [` y=mx+b `], it is said to be in *slope-intercept form*. + +In this problem, the line's equation is given in the *standard form* [`` [$a]x-[$b]y=[$c] ``]. If we algebraically rearrange the equation from standard form to slope-intercept form [` y=mx+b `], it will be easy to see the slope and [`y`]-intercept. + + [`` +\begin{aligned} + [$a]x-[$b]y &= [$c] \\ + [$a]x-[$b]y\mathbf{{}-[$a]x} &= [$c]\mathbf{{}-[$a]x} \\ + -[$b]y &= -[$a]x+[$c] \\ + \frac{-[$b]y}{-[$b]} &= \frac{-[$a]x}{-[$b]} + \frac{[$c]}{-[$b]} \\ + y &= [$m]x + [$d] +\end{aligned} + ``] + +Now we can see the line's slope is [` [$m] `], and its [`y`]-intercept has coordinates [` [$yInt] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept150.pg new file mode 100644 index 0000000000..53d8f2c8fd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept150.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find slope and y-intercept of a linear equation, given x+By=-C +# Slope is a fraction. +# +# Last edited: Jordan 8/15/13; Yao 6/27/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') +## KEYWORDS('slope','intercept','slope-intercept','line','equation','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$b = random(2,5,1); +$a = 1; +$c = $b*non_zero_random(-5,5,1); +while (abs($c)==abs($a)) {$c = $b*non_zero_random(-5,5,1);} + +$m = -Fraction($a,$b); +$d = $c/$b; + +Context("LimitedFraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0 +); +$m = Compute($m); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$yInt = Compute("(0,$d)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` x+[$b]y=[$c] ``]. + + This line's slope is [_______]{$m}. + + This line's [`y`]-intercept is [_______]. + +END_PGML + +ANS($yInt->cmp()->withPostFilter(AnswerHints( + sub {my ($correct,$student,$ans) = @_; + return $student->class eq 'Real'; + } => ["The y-intercept is a point with coordinates, not simply a number", replaceMessage => 1], + ))); + +############################################## + +BEGIN_PGML_SOLUTION + +When an equation of a line is written in the form [` y=mx+b `], it is said to be in *slope-intercept form*. + +In this problem, the line's equation is given in the *standard form* [`` x+[$b]y=[$c] ``]. If we algebraically rearrange the equation from standard form to slope-intercept form [` y=mx+b `], it will be easy to see the slope and [`y`]-intercept. + + [`` +\begin{aligned} + x+[$b]y &= [$c] \\ + x+[$b]y\mathbf{{}-x} &= [$c]\mathbf{{}-x} \\ + [$b]y &= -x+[$c] \\ + \frac{[$b]y}{[$b]} &= \frac{-x}{[$b]} + \frac{[$c]}{[$b]} \\ + y &= -\frac{1}{[$b]}x + [$d] +\end{aligned} + ``] + +Now we can see the line's slope is [`` -\frac{1}{[$b]} ``], and its [`y`]-intercept has coordinates [` [$yInt] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept160.pg index 83e01b0bbf..53eb6d50b7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept160.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept160.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: standard form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MandB_fromstandard) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -64,8 +67,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation - [`` [$a]x+[$b]y=[$c] ``]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` [$a]x+[$b]y=[$c] ``]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept170.pg index 67e5bbb0ca..87c71e779e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept170.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept170.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: standard form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MandB_fromstandard) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -64,8 +67,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation - [`` [$a]x-[$b]y=[$c] ``]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` [$a]x-[$b]y=[$c] ``]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept180.pg index d2ec7f3215..0cb94f6c17 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept180.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept180.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: standard form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MandB_fromstandard) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -68,8 +71,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation - [`` [$a]x+[$b]y=[$c] ``]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` [$a]x+[$b]y=[$c] ``]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept190.pg index 4d50c9cfd7..5fbdf6e0a7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept190.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept190.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: standard form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MandB_fromstandard) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -68,8 +71,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation - [`` [$a]x-[$b]y=[$c] ``]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` [$a]x-[$b]y=[$c] ``]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept20.pg index be0f3c909c..97264fb170 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept20.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Extract_MandB1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,7 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,7 +57,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation [` y=[$m]x+[$b] `]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [` y=[$m]x+[$b] `]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept200.pg new file mode 100644 index 0000000000..2134e3031a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept200.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find slope and y-intercept of a linear equation, given Ax-By=0 +# The slope and y-intercept are both fractions. +# +# Last edited: Jordan 8/15/13; Yao 6/27/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') +## KEYWORDS('slope','intercept','slope-intercept','line','equation','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +#create a reducible fraction +$num = random(1,6,1); +$den = random(2,6,1); +while (gcd($num,$den)!=1) {$den = random(2,6,1);} +$factor = random(2,4,1); +$a = $num*$factor; +$b = $den*$factor; + +#make the y-intercept non-reducible +$c = random(1,6,1); +while (gcd($c,$b)!=1) {$c = random(1,6,1);} + +$m = -Fraction($num,$den); +$d = Fraction($c,$b); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->flags->set( + formatStudentAnswer => 'parsed', + reduceConstants => 0 +); +$yInt = Compute("(0,$d)"); + +Context("LimitedFraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0 +); +$m = Compute($m); +$d = Compute($d); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` [$a]x+[$b]y=[$c] ``]. + + This line's slope is [_______]{$m}. + + This line's [`y`]-intercept is [_______]. + +END_PGML + +ANS($yInt->cmp()->withPostFilter(AnswerHints( + sub {my ($correct,$student,$ans) = @_; + return $student->class eq 'Real'; + } => ["The y-intercept is a point with coordinates, not simply a number", replaceMessage => 1], + ))); + +############################################## + +BEGIN_PGML_SOLUTION + +When an equation of a line is written in the form [` y=mx+b `], it is said to be in *slope-intercept form*. + +In this problem, the line's equation is given in the *standard form* [`` [$a]x+[$b]y=[$c] ``]. If we algebraically rearrange the equation from standard form to slope-intercept form [` y=mx+b `], it will be easy to see the slope and [`y`]-intercept. + + [`` +\begin{aligned} + [$a]x+[$b]y &= [$c] \\ + [$a]x+[$b]y\mathbf{{}-[$a]x} &= [$c]\mathbf{{}-[$a]x} \\ + [$b]y &= -[$a]x +[$c] \\ + \frac{[$b]y}{[$b]} &= \frac{-[$a]x}{[$b]} + \frac{[$c]}{[$b]}\\ + y &= -\frac{[$a]}{[$b]}x + \frac{[$c]}{[$b]}\\ + y &= -\frac{[$num]}{[$den]}x + \frac{[$c]}{[$b]} +\end{aligned} + ``] + +Now we can see the line's slope is [` -\frac{[$num]}{[$den]} `], and its [`y`]-intercept has coordinates [` \left(0,\frac{[$c]}{[$b]}\right) `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept30.pg new file mode 100644 index 0000000000..16d21402d6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept30.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Find slope and y-intercept of a linear equation, given y=x+B. +# +# Last edited: Jordan 8/15/13; Yao 6/27/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') +## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +#Identify slope and y-intercept given y=Mx+B. M=1. +Context("Numeric"); + +$m=1; +$b=non_zero_random(-10,10,1); + +Context("LimitedNumeric"); +$m = Compute($m); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$yInt = Compute("(0,$b)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [` y=x+[$b] `]. + + This line's slope is [_______]{$m}. + + This line's [`y`]-intercept is [_______]. + +END_PGML + +ANS($yInt->cmp()->withPostFilter(AnswerHints( + sub {my ($correct,$student,$ans) = @_; + return $student->class eq 'Real'; + } => ["The y-intercept is a point with coordinates, not simply a number", replaceMessage => 1], + ))); + + +############################################## + +BEGIN_PGML_SOLUTION + +When an equation of a line is written in the form [` y=mx+b `], it is said to be in *slope-intercept form*. In this form, [`m`] is the line's slope, and [`b`] is the coordinate on the [`y`]-axis where the line intercepts the [`y`]-axis. + +In this problem, the line's equation is given as [` y=x+[$b] `]. Since there is no written coefficient for [`x`], we have to think of the first term as [`1 \cdot x`]. + +Thus its slope is [`[$m]`], and its [`y`]-intercept has coordinates [` (0,[$b]) `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept40.pg index 07279995f3..b55221b568 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept40.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Extract_MandB1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -53,7 +56,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation [` y=-x+[$b] `]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [` y=-x+[$b] `]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept50.pg index 57a3144964..a1118a330b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept50.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Extract_MandB1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "PGML.pl", "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -60,7 +63,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation [`` y= -\frac{[$num]x}{[$den]} +[$b] ``]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` y= -\frac{[$num]x}{[$den]} +[$b] ``]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept55.pg new file mode 100644 index 0000000000..ba05416bc8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept55.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find slope and y-intercept of a linear equation, given y= (-nx/d)+B. +# +# Last edited: Jordan 8/15/13; Yao 6/27/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') +## KEYWORDS('slope','intercept','slope-intercept','line','equation','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num = random(2,8,2); +$den = random(3,9,2); +while (gcd($num,$den)!=1) {$den = random(3,9,2);} +$m = -Fraction($num,$den); +$b = non_zero_random(-10,10,1); + +Context("LimitedFraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0 +); +$m = Compute($m); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$yInt = Compute("(0,$b)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` y= -\frac{[$num]}{[$den]}x +[$b] ``]. + + This line's slope is [_______]{$m}. + + This line's [`y`]-intercept is [_______]. + +END_PGML + +ANS($yInt->cmp()->withPostFilter(AnswerHints( + sub {my ($correct,$student,$ans) = @_; + return $student->class eq 'Real'; + } => ["The y-intercept is a point with coordinates, not simply a number", replaceMessage => 1], + ))); + + +############################################## + +BEGIN_PGML_SOLUTION + +When an equation of a line is written in the form [` y=mx+b `], it is said to be in *slope-intercept form*. In this form, [`m`] is the line's slope, and [`b`] is the coordinate on the [`y`]-axis where the line intercepts the [`y`]-axis. + +In this problem, the line's equation is given as [`` y= -\frac{[$num]x}{[$den]} +[$b] ``]. We can think of the first term as [``-\frac{[$num]}{[$den]}x ``]. This is because: + + [`` \begin{aligned}-\frac{[$num]x}{[$den]} &= -\frac{[$num]}{[$den]} \cdot \frac{x}{1}\\& = -\frac{[$num]}{[$den]}x \end{aligned}``] + +Thus the line's slope is [``-\frac{[$num]}{[$den]}``], and its [`y`]-intercept has coordinates [` (0,[$b]) `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept60.pg new file mode 100644 index 0000000000..104a6069a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept60.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find slope and y-intercept of a linear equation, given y= (x/d)+B. +# +# Last edited: Jordan 8/15/13; Yao 6/27/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') +## KEYWORDS('slope','intercept','slope-intercept','line','equation','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num = 1; +$den = random(2,10,2); +$m = Fraction($num,$den); +$b = non_zero_random(-10,10,1); + +Context("LimitedFraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0 +); +$m = Compute($m); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$yInt = Compute("(0,$b)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` y= \frac{x}{[$den]} +[$b] ``]. + + This line's slope is [_______]{$m}. + + This line's [`y`]-intercept is [_______]. + +END_PGML + +ANS($yInt->cmp()->withPostFilter(AnswerHints( + sub {my ($correct,$student,$ans) = @_; + return $student->class eq 'Real'; + } => ["The y-intercept is a point with coordinates, not simply a number", replaceMessage => 1], + ))); + + +############################################## + +BEGIN_PGML_SOLUTION + +When an equation of a line is written in the form [` y=mx+b `], it is said to be in *slope-intercept form*. In this form, [`m`] is the line's slope, and [`b`] is the coordinate on the [`y`]-axis where the line intercepts the [`y`]-axis. + +In this problem, the line's equation is given as [`` y= \frac{x}{[$den]} +[$b] ``]. We can think of the first term as [``\frac{1}{[$den]}x ``]. This is because: + + [`` \begin{aligned}\frac{x}{[$den]} &= \frac{1}{[$den]} \cdot \frac{x}{1}\\ &= \frac{1}{[$den]}x\end{aligned} ``] + +Thus the line's slope is [``\frac{1}{[$den]}``], and its [`y`]-intercept has coordinates [` (0,[$b]) `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept65.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept65.pg new file mode 100644 index 0000000000..7d2b74238f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept65.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find slope and y-intercept of a linear equation, given y= (x/d)+B. +# +# Last edited: Jordan 8/15/13; Yao 6/27/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') +## KEYWORDS('slope','intercept','slope-intercept','line','equation','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num = 1; +$den = random(2,10,2); +$m = Fraction($num,$den); +$b = non_zero_random(-10,10,1); + +Context("LimitedFraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0 +); +$m = Compute($m); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$yInt = Compute("(0,$b)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` y= \frac{1}{[$den]}x +[$b] ``]. + + This line's slope is [_______]{$m}. + + This line's [`y`]-intercept is [_______]. + +END_PGML + +ANS($yInt->cmp()->withPostFilter(AnswerHints( + sub {my ($correct,$student,$ans) = @_; + return $student->class eq 'Real'; + } => ["The y-intercept is a point with coordinates, not simply a number", replaceMessage => 1], + ))); + + +############################################## + +BEGIN_PGML_SOLUTION + +When an equation of a line is written in the form [` y=mx+b `], it is said to be in *slope-intercept form*. In this form, [`m`] is the line's slope, and [`b`] is the coordinate on the [`y`]-axis where the line intercepts the [`y`]-axis. + +In this problem, the line's equation is given as [`` y= \frac{x}{[$den]} +[$b] ``]. We can think of the first term as [``\frac{1}{[$den]}x ``]. This is because: + + [`` \begin{aligned}\frac{x}{[$den]} &= \frac{1}{[$den]} \cdot \frac{x}{1}\\ &= \frac{1}{[$den]}x\end{aligned} ``] + +Thus the line's slope is [``\frac{1}{[$den]}``], and its [`y`]-intercept has coordinates [` (0,[$b]) `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept70.pg index 9809d3dcc9..354928826f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept70.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Extract_MandB1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,8 +28,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -52,7 +56,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation [`` y= [$b] +[$m]x ``]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` y= [$b] +[$m]x ``]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept80.pg new file mode 100644 index 0000000000..67bae7ac28 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept80.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find slope and y-intercept of a linear equation, given y= B-x. +# +# Last edited: Jordan 8/15/13; Yao 6/27/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') +## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "contextFraction.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$m = -1; +$b = non_zero_random(1,10,1); + +Context("LimitedNumeric"); +$m = Compute($m); + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$yInt = Compute("(0,$b)"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` y= [$b] -x ``]. + + This line's slope is [_______]{$m}. + + This line's [`y`]-intercept is [_______]. + +END_PGML + +ANS($yInt->cmp()->withPostFilter(AnswerHints( + sub {my ($correct,$student,$ans) = @_; + return $student->class eq 'Real'; + } => ["The y-intercept is a point with coordinates, not simply a number", replaceMessage => 1], + ))); + + +############################################## + +BEGIN_PGML_SOLUTION + +When an equation of a line is written in the form [` y=mx+b `], it is said to be in *slope-intercept form*. In this form, [`m`] is the line's slope, and [`b`] is the coordinate on the [`y`]-axis where the line intercepts the [`y`]-axis. + +In this problem, the line's equation is given as [`` y= [$b]-x ``]. We may rewrite this in slope-intercept form: [`` y= -x+[$b] ``]. + +Since there is no written coefficient (except a negative symbol) for [`x`], we need to think of the term as [`(-1) \cdot x `]. + +Thus the line's slope is [` [$m] `], and its [`y`]-intercept has coordinates [` (0,[$b]) `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept90.pg index f36d4cce18..9e24a7ac25 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept90.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Extract_MandB1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') ## KEYWORDS('slope','intercept','slope-intercept','line','equation') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,8 +28,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -52,7 +56,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line has the equation [`` y= [$b] ``]. Find this line's slope and [`y`]-intercept. If either of these do not exist, you may enter *DNE* or *NONE*. +Find the line's slope and [`y`]-intercept. [@KeyboardInstructions("If either of these do not exist, you may enter [|DNE|]* or [|NONE|]*.")@]** + +A line has equation [`` y= [$b] ``]. This line's slope is [_______]{$m}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial10.pg index 05934fc24b..d1754869ad 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial10.pg @@ -6,14 +6,18 @@ # Last updated: Yao 10/18/2016 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','zero') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -50,7 +54,7 @@ BEGIN_PGML A line passes through the point [`([$x1],[$y1])`], and it's parallel to the line [`y=[$b0]`]. Find an equation for this line. - An equation for this line is [______________]{$ans}. + [______________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial20.pg index 30b1521fd4..48921777a8 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial20.pg @@ -6,14 +6,18 @@ # Last updated: Yao 10/18/2016 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','zero') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -50,7 +54,7 @@ BEGIN_PGML A line passes through the point [`([$x1],[$y1])`], and it's parallel to the line [`x=[$a0]`]. Find an equation for this line. - An equation for this line is [______________]{$ans}. + [______________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial30.pg index e4dc365896..39d80e5e46 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial30.pg @@ -6,14 +6,18 @@ # Last updated: Yao 10/18/2016 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','zero') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial40.pg new file mode 100644 index 0000000000..245dec7c3e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelFindEquationSpecial40.pg @@ -0,0 +1,73 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a point and its parallel line, find the line's equation. The line is y=b. +# +# Last updated: Yao 10/18/2016 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','zero') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->flags->set(showExtraParens=>0); +Context()->variables->are(x=>'Real', y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$a0 = random(-10,10,1); +$b1 = random(-10,10,1); +$y1 = $b1; +do {$x1 = non_zero_random(-10,10,1);} until ($y1!=$x1); + +$ans = ImplicitPlane("y=$b1"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line passes through the point [`([$x1],[$y1])`], and it's perpendicular to the line [`x=[$a0]`]. Find an equation for this line. + + An equation for this line is [______________]{$ans}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since [`x=[$a0]`] is vertical, the unknown line must be horizontal (because they are perpendicular). Assume its equation is [`y=b`]. + +Since the unknown line passes through [`([$x1],[$y1])`], [`b`]'s value must be [`[$y1]`]. The unknown line's equation is [`[$ans]`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular10.pg index 40204053cf..b332d31b92 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular10.pg @@ -8,17 +8,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ParPerp_fromPts) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGchoicemacros.pl", - "PGcourse.pl" + "parserPopUp.pl", + "PGcourse.pl", ); ############################################## @@ -55,9 +56,7 @@ $x22= non_zero_random(-5,5,1); while ($x22==$x21) {$x22= non_zero_random(-5,5,1);} $y22=$m2*$x22+$b2; -$radio = new_multiple_choice(); -$radio->qa("These two lines are ", "parallel"); -$radio->makeLast("parallel","perpendicular","neither parallel nor perpendicular"); +$popup = PopUp(['?', 'parallel', 'perpendicular', 'neither parallel nor perpendicular'], 1); ############################################## @@ -69,10 +68,7 @@ Line [`m`] passes points [` ([$x11],[$y11])`] and [` ([$x12],[$y12]) `]. Line [`n`] passes points [` ([$x21],[$y21])`] and [` ([$x22],[$y22]) `]. -Determine how the two lines are related. - - [@ $radio->print_q() @]* - [@ $radio->print_a() @]* +These two lines are [_]{$popup}. END_PGML @@ -80,7 +76,6 @@ END_PGML $showPartialCorrectAnswers = 0; -ANS( radio_cmp( $radio->correct_ans() ) ); $s11=$y12-$y11; $s12=$x12-$x11; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular100.pg new file mode 100644 index 0000000000..d263dd85a2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular100.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Based on two lines' slopes, tell whether they +# are parallel, perpendicular, or neither. +# In this problem, these two lines are neither parallel nor perpendicular. +# +# Last updated: Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$num = random(3,7,2); +$den = random(2,8,2); +while (gcd($num,$den)!=1) {$den = random(2,8,2);} +$m1 = -$num/$den; +$b1=random(-10,10,1); + +$x11= $den*non_zero_random(-3,3,1); +$y11= $m1*$x11+$b1; +$x12= $den*non_zero_random(-3,3,1); +while ($x12==$x11) {$x12= $den*non_zero_random(-3,3,1);} +$y12= $m1*$x12+$b1; + +$m2= -$den/$num; +$b2=random(-10,10,1); + +$x21= $num*non_zero_random(-3,3,1); +$y21= $m2*$x21+$b2; +$x22= $num*non_zero_random(-3,3,1); +while ($x22==$x21) {$x22= non_zero_random(-3,3,1);} +$y22= $m2*$x22+$b2; + +$radio = new_multiple_choice(); +$radio->qa("These two lines are ", "neither parallel nor perpendicular"); +$radio->makeLast("parallel","perpendicular","neither parallel nor perpendicular"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Line [`m`] passes points [` ([$x11],[$y11])`] and [` ([$x12],[$y12]) `]. + +Line [`n`] passes points [` ([$x21],[$y21])`] and [` ([$x22],[$y22]) `]. + +Determine how the two lines are related. + + [@ $radio->print_q() @]* + [@ $radio->print_a() @]* + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( radio_cmp( $radio->correct_ans() ) ); + +$s11=$y12-$y11; +$s12=$x12-$x11; +$s21=$y22-$y21; +$s22=$x22-$x21; + +$outputx11 = $x11<0 ? "($x11)" : $x11; +$outputy11 = $y11<0 ? "($y11)" : $y11; +$outputx21 = $x21<0 ? "($x21)" : $x21; +$outputy21 = $y21<0 ? "($y21)" : $y21; + +BEGIN_PGML_SOLUTION + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +For line [`m`], we have: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$y12]-[$outputy11]}{[$x12]-[$outputx11]}\\ + &=\frac{[$s11]}{[$s12]}\\ + &= -\frac{[$num]}{[$den]}\end{aligned} ``] + +For line [`n`], we have: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$y22]-[$outputy21]}{[$x22]-[$outputx21]}\\ + &=\frac{[$s21]}{[$s22]}\\ + &=-\frac{[$den]}{[$num]} \end{aligned}``] + +Since [`` -\frac{[$num]}{[$den]} \neq -\frac{[$den]}{[$num]} ``], these two lines are not parallel. + +Since [`` -\frac{[$num]}{[$den]} \cdot \left(-\frac{[$den]}{[$num]}\right) \neq -1 ``], these two lines are not perpendicular. + +The correct answer is these two lines are neither parallel nor perpendicular. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular110.pg new file mode 100644 index 0000000000..d750a817ab --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular110.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Based on two lines' slopes, tell whether they +# are parallel, perpendicular, or neither. +# In this problem, these two lines are neither parallel nor perpendicular. +# +# Last updated: Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$num = random(2,8,2); +$den = random(3,9,2); +while (gcd($num,$den)!=1) {$den = random(3,9,2);} +$m1 = $num/$den; +$b1=random(-10,10,1); + +$x11= $den*non_zero_random(-3,3,1); +$y11= $num/$den*$x11+$b1; +$x12= $den*non_zero_random(-3,3,1); +while ($x12==$x11) {$x12= $den*non_zero_random(-3,3,1);} +$y12= $num/$den*$x12+$b1; + +$m2= -$den; +$b2=random(-10,10,1); + +$x21= non_zero_random(-3,3,1); +$y21=$m2*$x21+$b2; +$x22= non_zero_random(-3,3,1); +while ($x22==$x21) {$x22= non_zero_random(-3,3,1);} +$y22=$m2*$x22+$b2; + +$radio = new_multiple_choice(); +$radio->qa("These two lines are ", "neither parallel nor perpendicular"); +$radio->makeLast("parallel","perpendicular","neither parallel nor perpendicular"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Line [`m`] passes points [` ([$x11],[$y11])`] and [` ([$x12],[$y12]) `]. + +Line [`n`] passes points [` ([$x21],[$y21])`] and [` ([$x22],[$y22]) `]. + +Determine how the two lines are related. + + [@ $radio->print_q() @]* + [@ $radio->print_a() @]* + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( radio_cmp( $radio->correct_ans() ) ); + +$s11=$y12-$y11; +$s12=$x12-$x11; +$s21=$y22-$y21; +$s22=$x22-$x21; + +$outputx11 = $x11<0 ? "($x11)" : $x11; +$outputy11 = $y11<0 ? "($y11)" : $y11; +$outputx21 = $x21<0 ? "($x21)" : $x21; +$outputy21 = $y21<0 ? "($y21)" : $y21; + +BEGIN_PGML_SOLUTION + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +For line [`m`], we have: + + [`` \begin{aligned}\text{slope} &=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$y12]-[$outputy11]}{[$x12]-[$outputx11]}\\ + &=\frac{[$s11]}{[$s12]}\\ + &=\frac{[$num]}{[$den]} \end{aligned}``] + +For line [`n`], we have: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$y22]-[$outputy21]}{[$x22]-[$outputx21]}\\ + &=\frac{[$s21]}{[$s22]}\\ + &=[$m2] \end{aligned}``] + +Since [`` \frac{[$num]}{[$den]} \neq [$m2] ``], these two lines are not parallel. + +Since [`` \frac{[$num]}{[$den]} \cdot ([$m2]) \neq -1 ``], these two lines are not perpendicular. + +The correct answer is these two lines are neither parallel nor perpendicular. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular120.pg index cef1d00ca6..1ed4bfffb2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular120.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ParPerp_fromPts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular130.pg index dc2f2c997d..4ac7b28d60 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular130.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ParPerp_fromPts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGchoicemacros.pl", - "PGcourse.pl" + "parserPopUp.pl", + "PGcourse.pl", ); ############################################## @@ -50,9 +52,7 @@ $x22 = random(-10,10,1); $y22 = $b; while ($x22==$x21) {$x22 = random(-10,10,1);} -$radio = new_multiple_choice(); -$radio->qa("These two lines are ", "parallel"); -$radio->makeLast("parallel","perpendicular","neither parallel nor perpendicular"); +$popup = PopUp(['?','parallel', 'perpendicular', 'neither parallel nor perpendicular'], 1); ############################################## @@ -64,10 +64,7 @@ Line [`m`] passes points [` ([$x11],[$y11])`] and [` ([$x12],[$y12]) `]. Line [`n`] passes points [` ([$x21],[$y21])`] and [` ([$x22],[$y22]) `]. -Determine how the two lines are related. - - [@ $radio->print_q() @]* - [@ $radio->print_a() @]* +These two lines are [_]{$popup}. END_PGML @@ -75,7 +72,6 @@ END_PGML $showPartialCorrectAnswers = 0; -ANS( radio_cmp( $radio->correct_ans() ) ); $s11=$y12-$y11; $s12=$x12-$x11; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular140.pg index ca86d441d9..15110b5ff2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular140.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular140.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ParPerp_fromPts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGchoicemacros.pl", - "PGcourse.pl" + "parserPopUp.pl", + "PGcourse.pl", ); ############################################## @@ -50,9 +52,7 @@ $x22 = $b; $y22 = random(-10,10,1); while ($y22==$y21) {$y22 = random(-10,10,1);} -$radio = new_multiple_choice(); -$radio->qa("These two lines are ", "parallel"); -$radio->makeLast("parallel","perpendicular","neither parallel nor perpendicular"); +$popup = PopUp(['?','parallel', 'perpendicular', 'neither parallel nor perpendicular'], 1); ############################################## @@ -64,10 +64,7 @@ Line [`m`] passes points [` ([$x11],[$y11])`] and [` ([$x12],[$y12]) `]. Line [`n`] passes points [` ([$x21],[$y21])`] and [` ([$x22],[$y22]) `]. -Determine how the two lines are related. - - [@ $radio->print_q() @]* - [@ $radio->print_a() @]* +These two lines are [_]{$popup}. END_PGML @@ -75,7 +72,6 @@ END_PGML $showPartialCorrectAnswers = 0; -ANS( radio_cmp( $radio->correct_ans() ) ); $s11=$y12-$y11; $s12=$x12-$x11; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular20.pg index 08464dcfae..1b3a6cce99 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular20.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ParPerp_fromPts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular30.pg index 0abd240f62..15d6e55c17 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular30.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ParPerp_fromPts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,8 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "parserPopUp.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -58,9 +61,7 @@ $x22= $den*non_zero_random(-5,5,1); while ($x22==$x21) {$x22= $den*non_zero_random(-5,5,1);} $y22=$m2*$x22+$b2; -$radio = new_multiple_choice(); -$radio->qa("These two lines are ", "parallel"); -$radio->makeLast("parallel","perpendicular","neither parallel nor perpendicular"); +$popup = PopUp(['?','parallel', 'perpendicular', 'neither parallel nor perpendicular'], 1); ############################################## @@ -72,10 +73,7 @@ Line [`m`] passes points [` ([$x11],[$y11])`] and [` ([$x12],[$y12]) `]. Line [`n`] passes points [` ([$x21],[$y21])`] and [` ([$x22],[$y22]) `]. -Determine how the two lines are related. - - [@ $radio->print_q() @]* - [@ $radio->print_a() @]* +These two linea are [_]{$popup}. END_PGML @@ -83,7 +81,6 @@ END_PGML $showPartialCorrectAnswers = 0; -ANS( radio_cmp( $radio->correct_ans() ) ); $s11=$y12-$y11; $s12=$x12-$x11; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular40.pg index 6fd35f75a5..687c96b0fb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular40.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ParPerp_fromPts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular50.pg new file mode 100644 index 0000000000..8efbd0959d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular50.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Based on two lines' slopes, tell whether they +# are parallel, perpendicular, or neither. +# In this problem, these two lines are perpendicular. +# +# Last updated: Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$num = 1; +$den = random(2,5,1); + +$m1= -$num/$den; +$b1=random(-10,10,1); + +$x11= $den*non_zero_random(-3,3,1); +$y11=$m1*$x11+$b1; +$x12= $den*non_zero_random(-3,3,1); +while ($x12==$x11) {$x12= $den*non_zero_random(-3,3,1);} +$y12=$m1*$x12+$b1; + +$m2=$den; +$b2=random(-10,10,1); + +$x21= non_zero_random(-5,5,1); +$y21=$m2*$x21+$b2; +$x22= non_zero_random(-5,5,1); +while ($x22==$x21) {$x22= non_zero_random(-5,5,1);} +$y22=$m2*$x22+$b2; + +$popup = PopUp(['?','parallel', 'perpendicular', 'neither parallel nor perpendicular'], 2); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Line [`m`] passes points [` ([$x11],[$y11])`] and [` ([$x12],[$y12]) `]. + +Line [`n`] passes points [` ([$x21],[$y21])`] and [` ([$x22],[$y22]) `]. + +These two lines are [_]{$popup}. + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + + +$s11=$y12-$y11; +$s12=$x12-$x11; +$s21=$y22-$y21; +$s22=$x22-$x21; + +$outputx11 = $x11<0 ? "($x11)" : $x11; +$outputy11 = $y11<0 ? "($y11)" : $y11; +$outputx21 = $x21<0 ? "($x21)" : $x21; +$outputy21 = $y21<0 ? "($y21)" : $y21; + +BEGIN_PGML_SOLUTION + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +For line [`m`], we have: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$y12]-[$outputy11]}{[$x12]-[$outputx11]}\\ + &=\frac{[$s11]}{[$s12]}\\ + &=-\frac{[$num]}{[$den]} \end{aligned}``] + +For line [`n`], we have: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$y22]-[$outputy21]}{[$x22]-[$outputx21]}\\ + &=\frac{[$s21]}{[$s22]}\\ + &=[$m2] \end{aligned}``] + +If the product of two lines' slopes is [`-1`], these two lines are perpendicular. + +Note that [`` [$m2] \cdot \left(-\frac{[$num]}{[$den]}\right) = -1 ``]. This implies these two lines are perpendicular. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular60.pg index 931177c519..6922c8aac7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular60.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ParPerp_fromPts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular70.pg new file mode 100644 index 0000000000..3bc3321500 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular70.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Based on two lines' slopes, tell whether they +# are parallel, perpendicular, or neither. +# In this problem, these two lines are perpendicular. +# +# Last updated: Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$num = random(2,8,2); +$den = random(3,9,2); +while (gcd($num,$den)!=1) {$den = random(3,9,2);} + +$m1=-$num/$den; +$b1=random(-10,10,1); + +$x11= $den*non_zero_random(-3,3,1); +$y11=$m1*$x11+$b1; +$x12= $den*non_zero_random(-3,3,1); +while ($x12==$x11) {$x12= $den*non_zero_random(-3,3,1);} +$y12=$m1*$x12+$b1; + +$m2=$den/$num; +$b2=random(-10,10,1); + +$x21= $num*non_zero_random(-3,3,1); +$y21=$m2*$x21+$b2; +$x22= $num*non_zero_random(-3,3,1); +while ($x22==$x21) {$x22= $num*non_zero_random(-3,3,1);} +$y22=$m2*$x22+$b2; + +$popup = PopUp(['?','parallel', 'perpendicular', 'neither parallel nor perpendicular'], 2); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Line [`m`] passes points [` ([$x11],[$y11])`] and [` ([$x12],[$y12]) `]. + +Line [`n`] passes points [` ([$x21],[$y21])`] and [` ([$x22],[$y22]) `]. + +These two lines are [_]{$popup}. + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + + +$s11=$y12-$y11; +$s12=$x12-$x11; +$s21=$y22-$y21; +$s22=$x22-$x21; + +$outputx11 = $x11<0 ? "($x11)" : $x11; +$outputy11 = $y11<0 ? "($y11)" : $y11; +$outputx21 = $x21<0 ? "($x21)" : $x21; +$outputy21 = $y21<0 ? "($y21)" : $y21; + +BEGIN_PGML_SOLUTION + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +For line [`m`], we have: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$y12]-[$outputy11]}{[$x12]-[$outputx11]}\\ + &=\frac{[$s11]}{[$s12]}\\ + &=-\frac{[$num]}{[$den]} \end{aligned}``] + +For line [`n`], we have: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + &=\frac{[$y22]-[$outputy21]}{[$x22]-[$outputx21]}\\ + &=\frac{[$s21]}{[$s22]}\\ + &=\frac{[$den]}{[$num]} \end{aligned}``] + +If the product of two lines' slopes is [`-1`], these two lines are perpendicular. + +Note that [`` -\frac{[$num]}{[$den]} \cdot \frac{[$den]}{[$num]} = -1 ``]. This implies these two lines are perpendicular. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular80.pg index c583531ff6..5601644507 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular80.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ParPerp_fromPts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGchoicemacros.pl", - "PGcourse.pl" + "parserPopUp.pl", + "PGcourse.pl", ); ############################################## @@ -53,9 +55,7 @@ $x22= non_zero_random(-5,5,1); while ($x22==$x21) {$x22= non_zero_random(-5,5,1);} $y22=$m2*$x22+$b2; -$radio = new_multiple_choice(); -$radio->qa("These two lines are ", "neither parallel nor perpendicular"); -$radio->makeLast("parallel","perpendicular","neither parallel nor perpendicular"); +$popup = PopUp(['?','parallel', 'perpendicular', 'neither parallel nor perpendicular'], 3); ############################################## @@ -67,10 +67,7 @@ Line [`m`] passes points [` ([$x11],[$y11])`] and [` ([$x12],[$y12]) `]. Line [`n`] passes points [` ([$x21],[$y21])`] and [` ([$x22],[$y22]) `]. -Determine how the two lines are related. - - [@ $radio->print_q() @]* - [@ $radio->print_a() @]* +These two lines are [_]{$popup}. END_PGML @@ -78,7 +75,6 @@ END_PGML $showPartialCorrectAnswers = 0; -ANS( radio_cmp( $radio->correct_ans() ) ); $s11=$y12-$y11; $s12=$x12-$x11; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular90.pg index 1ee936845b..b0c70d26a4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular90.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Parallel and perpendicular lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(ParPerp_fromPts) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula','parallel','perpendicular') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGchoicemacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula10.pg new file mode 100644 index 0000000000..0d91ff4d5d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula10.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use the slope formula to find a line's slope. +# +# Last updated: Jordan 8/15/13; Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('line','slope','slope formula') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$m=random(1,5,1); +$b=random(-10,10,1); + +$x1=random(1,5,1); +$y1=$m*$x1+$b; +$x2=random(6,10,1); +$y2=$m*$x2+$b; + +Context("LimitedNumeric"); +$m = Compute($m); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** + + [_______]{$m} + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; + +BEGIN_PGML_SOLUTION + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ +&=\frac{[$y2]-[$y1]}{[$x2]-[$x1]}\\ +&=\frac{[$s1]}{[$s2]}\\ +&=[$m] \end{aligned}``] + +So the line's slope is [`[$m]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg index f7e0889a82..ec8bb43a4c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/15/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Finding the slope) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Slope_from_two_points) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +27,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,9 +52,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. If the slope does not exists, you may enter *DNE* or *NONE*. +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** - This line's slope is [_______]{$m}. + [_______]{$m} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula30.pg new file mode 100644 index 0000000000..cfe74415b6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula30.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use the slope formula to find a line's slope. +# +# Last updated: Jordan 8/15/13; Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('line','slope','slope formula') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$m=random(1,5,1); +$b=random(-10,10,1); + +$x1=random(-4,-1,1); +$y1=$m*$x1+$b; +$x2=random(-8,-5,1); +$y2=$m*$x2+$b; + +Context("LimitedNumeric"); +$m = Compute($m); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** + + [_______]{$m} + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [``\begin{aligned} \text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ +&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\ +&=\frac{[$s1]}{[$s2]}\\ +&=[$m] \end{aligned}``] + +So the line's slope is [`[$m]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg index a428400b0f..c8d0132a7f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg @@ -6,16 +6,18 @@ # Last updated: Jordan 8/15/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Finding the slope) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Slope_from_two_points) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +27,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,9 +52,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. If the slope does not exists, you may enter *DNE* or *NONE*. +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** - This line's slope is [_______]{$m}. + [_______]{$m} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula50.pg new file mode 100644 index 0000000000..d44b529c45 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula50.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use the slope formula to find a line's slope. +# +# Last updated: Jordan 8/15/13; Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('line','slope','slope formula') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$m=non_zero_random(-5,-1,1); +$b=random(-10,10,1); + +$x1=random(-4,-1,1); +$y1=$m*$x1+$b; +$x2=random(-8,-5,1); +$y2=$m*$x2+$b; + +Context("LimitedNumeric"); +$m = Compute($m); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** + + [_______]{$m} + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [``\begin{aligned} \text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ +&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\ +&=\frac{[$s1]}{[$s2]}\\ +&=[$m] \end{aligned}``] + +So the line's slope is [`[$m]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula60.pg new file mode 100644 index 0000000000..55c1757502 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula60.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Use the slope formula to find a line's slope. +# Slope is a fraction. +# +# Last updated: Jordan 8/15/13; Carl Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('line','slope','slope formula','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$num = random(2,8,2); +$den = random(3,9,2); +while (gcd($num,$den)!=1) {$den = random(3,9,2);} +$m = Fraction($num,$den); + +$b=random(-10,10,1); + +$x1=$den*random(1,3,1); +$y1=$m*$x1+$b; +$x2=$den*random(-3,-1,1); +while (abs($x2)==$x1) {$x2=$den*random(-3,-1,1);} +$y2=$m*$x2+$b; + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions => 1, showMixedNumbers=>0); +$m = Compute($m); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** + + [_______]{$m} + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [``\begin{aligned} \text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ +&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\ +&=\frac{[$s1]}{[$s2]}\\ +&=\frac{[$num]}{[$den]} \end{aligned}``] + +So the line's slope is [``\frac{[$num]}{[$den]}``]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg index fdd1937589..89bdda91c0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg @@ -7,15 +7,18 @@ # Last updated: Jordan 8/15/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Finding the slope) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Slope_from_two_points) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,8 +28,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,9 +60,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. If the slope does not exists, you may enter *DNE* or *NONE*. +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** - This line's slope is [_______]{$m}. + [_______]{$m} END_PGML @@ -74,20 +78,20 @@ BEGIN_PGML_SOLUTION To find a line's slope, we can use the slope formula: - [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + [``` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ```] First, we mark which number corresponds to which variable in the formula: - [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + [``` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ```] - [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + [``` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ```] Now we substitute these numbers into the corresponding variables in the slope formula: - [``\begin{aligned} \text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ + [```\begin{aligned} \text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ &=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\ &=\frac{[$s1]}{[$s2]}\\ -&=-\frac{[$num]}{[$den]} \end{aligned}``] +&=-\frac{[$num]}{[$den]} \end{aligned}```] So the line's slope is [``-\frac{[$num]}{[$den]}``]. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg index 48515f5d55..8bbedf7452 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg @@ -7,16 +7,18 @@ # Last updated: Jordan 8/15/13; Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Finding the slope) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Slope_from_two_points) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +28,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -50,9 +53,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. If the slope does not exists, you may enter *DNE* or *NONE*. +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** - This line's slope is [_______]{$m}. + [_______]{$m} END_PGML ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg index 491bd119dd..757c9ad1a9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 6/27/13 # ENDDESCRIPTION -## DBCCSS('8.EE') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Finding the slope) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Slope_from_two_points) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('line','slope','slope formula') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,8 +28,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PCCmacros.pl", "parserOneOf.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -48,9 +51,9 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$a],[$y1])`] and [`([$a],[$y2])`]. Find this line's slope. If the slope does not exists, you may enter *DNE* or *NONE*. +A line passes through the points [`([$a],[$y1])`] and [`([$a],[$y2])`]. Find this line's slope. [@KeyboardInstructions(q!If the slope does not exist, you may enter [|DNE|]* or [|NONE|]*.!)@]** - This line's slope is [_______]{$m}. + [_______]{$m} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeInterceptToStandard10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeInterceptToStandard10.pg new file mode 100644 index 0000000000..09f85e492d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeInterceptToStandard10.pg @@ -0,0 +1,153 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change a line's equation from slope-intercept form to standard form. +# +# Last edited: Yao 5/25/17 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Slope-Intercept','Linear Equations') +## KEYWORDS('slope','intercept','slope-intercept','line','equation','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->flags->set(showExtraParens=>0); +Context()->variables->are(x=>'Real', y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y','(-x)*y','x*(-y)','-n'); + +$b = random(2,9,1)*random(-1,1,2); +$c = non_zero_random(-9,9,1); + +$left0 = Compute("y"); +$right0 = Compute("$b x+$c")->reduce; + +$ansPSstring = "$b*x-y=-$c"; + +if ($b>0) { + $left1 = Compute("$b*x-y")->reduce; + $nC = -$c; + $ansPSstringTeX = $left1->TeX."=$nC"; +} else { + $left1 = Compute("-$b*x+y")->reduce; + $ansPSstringTeX = $left1->TeX."=$c"; +} + +$ansPS = ImplicitPlane($ansPSstring); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +If we change [` [$left0]=[$right0] `] to standard form, the correct answer is: + + [________________] + +END_PGML + +############################################## + +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFormulas=>0); + +ANS($ansPS->cmp(correct_ans_latex_string => $ansPSstringTeX + ) -> withPostFilter(sub { + my $ansHash = shift; + my $student = $ansHash->{original_student_ans}; + my @sides = split('=',"$student"); + + #if it's an implicit plane object, reset how student's answer is displayed: + if (defined $ansHash->{student_formula}) { + if ($ansHash->{student_formula}->cmp_class eq "an Implicit line") { + $ansHash->{preview_text_string} = "$sides[0]=$sides[1]"; + my $leftTex = Formula("$sides[0]")->TeX; + my $rightTex = Formula("$sides[1]")->TeX; + $ansHash->{preview_latex_string} = "$leftTex=$rightTex"; + $ansHash->{student_ans} = $ansHash->{original_student_ans}; + } + }; + + # if they have it correct, then check each side to see + # whether x and y are on the same side of = + if ($ansHash->{score}) { + if ( (($sides[0] =~ /x/) && ($sides[1] =~ /y/)) || (($sides[1] =~ /x/) && ($sides[0] =~ /y/)) ) { + $ansHash->{score} = 0; + $ansHash->{ans_message} = "This is an equation for the line, but it is not in standard form."; + } + } + return $ansHash; + })); + +############################################## + +if ($b>0) { + +$s1 = Compute("-$b*x+y")->reduce; +$s2 = Compute("$b*x-y")->reduce; + +BEGIN_PGML_SOLUTION + +A line's standard form is [`Ax+By=C`]. We need to move [`x`] and [`y`] terms to the same side of the equal sign. + + [`` +\begin{aligned} + [$left0] &= [$right0] \\ + [$left0] \mathbf{-[$b]x} &= [$right0] \mathbf{-[$b]x} \\ + [$s1] &= [$c] \\ + (-1)([$s1]) &= (-1)([$c]) \\ + [$s2] &= [$nC] +\end{aligned} + ``] + +Note that [`[$s1] = [$c]`] is already in standard form, but it's better to get rid of the leading negative sign in an equation. + +END_PGML_SOLUTION + +} else { + +$s1 = Compute("-$b*x+y")->reduce; + +BEGIN_PGML_SOLUTION + +A line's standard form is [`Ax+By=C`]. We need to move [`x`] and [`y`] terms to the same side of the equal sign. + + [`` +\begin{aligned} + [$left0] &= [$right0] \\ + [$left0] \mathbf{-[$b]x} &= [$right0] \mathbf{-[$b]x} \\ + [$s1] &= [$c] +\end{aligned} + ``] + +END_PGML_SOLUTION + +} + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial10.pg new file mode 100644 index 0000000000..0dde629ddb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial10.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation. Line's equation is y=b. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','zero') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->flags->set(showExtraParens=>0); +Context()->variables->are(x=>'Real', y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m=0; +$b=random(-10,10,1); + +$x1=random(-5,5,1); +$y1=$m*$x1+$b; +$x2=random(-5,5,1); +while ($x2==$x1) {$x2=random(-5,5,1);} +$y2=$m*$x2+$b; + +$ansSI = ImplicitPlane("y=$b"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find an equation for this line. + + An equation for this line is [______________]{$ansSI}. + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +To find an equation for a line, we first try to find its slope. To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these values into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ +&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\ +&=\frac{[$s1]}{[$s2]}\\ +&=[$m]\end{aligned} ``] + +This line's slope is [`0`], implying that it is horizontal and that it has an equation in the form [` y=c `]. + +In both of the given points [`([$x1],[$y1])`] and [`([$x2],[$y2])`], we can see their [`y`] value is [`[$b]`]. Thus this line's equation must be [`y=[$b]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial20.pg new file mode 100644 index 0000000000..97316d0bfd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial20.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation. Line's equation is x=a. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','undefined') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserImplicitPlane.pl", + "PGcourse.pl", +); + +############################################## + +Context("ImplicitPlane"); +Context()->flags->set(showExtraParens=>0); +Context()->variables->are(x=>'Real', y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$a=random(-10,10,1); + +$y1=random(-5,5,1); +$x1 = $a; +$y2=random(-5,5,1); +$x2 = $a; +while ($y2==$y1) {$y2=random(-5,5,1);} + +$ansSI = ImplicitPlane("x=$a"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find an equation for this line. + + An equation for this line is [______________]{$ansSI}. + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +To find an equation for a line, we first try to find its slope. To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these values into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ +&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\ +&=\frac{[$s1]}{[$s2]}\\ +&\phantom{={}}\text{this is an undefined quantity}\end{aligned} ``] + +This line's slope is undefined, implying that it is vertical and that it has an equation in the form [` x=c `]. + +In both of the given points [`([$x1],[$y1])`] and [`([$x2],[$y2])`], we can see their [`x`] value is [`[$a]`]. Thus this line's equation must be [`x=[$a]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation10.pg new file mode 100644 index 0000000000..b37f8265a2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation10.pg @@ -0,0 +1,137 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# All numbers are positive. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m=random(2,5,1); +$b=random(1,10,1); + +$x1=random(1,5,1); +$y1=$m*$x1+$b; +$x2=random(1,5,1); +while ($x2==$x1) {$x2=random(1,5,1);} +$y2=$m*$x2+$b; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the following line's equation in slope-intercept form. + +The line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. + +[______________]{$ansSI} + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +The slope-intercept form of a line's equation has the form [` y=mx+b `] where [`m`] is the slope and [`b`] is the [`y`]-coordinate of the [`y`]-intercept. To find a line's slope-intercept equation, we first try to find the line's slope. + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ +&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\ +&=\frac{[$s1]}{[$s2]}\\ +&=[$m] \end{aligned}``] + +Now we have [` y=[$m]x+b `]. The next step is to find the value of [`b`]. There are at least two ways we can do this. + +##One way## +is to substitute one of the given points into [` y=[$m]x+b `]. We choose to use [`([$x1],[$y1])`]. + + [` +\begin{aligned} + y &= [$m]x + b \\ + [$y1] &= [$m] \cdot [$x1] + b \\ + [$y1] &= [$s3] + b \\ + [$y1]\mathbf{{}-[$s3]} &= [$s3] + b\mathbf{{}-[$s3]} \\ + [$b] &= b\\ + b &= [$b] +\end{aligned} +`] + +This line's slope-intercept equation is [` y=[$m]x+[$b] `]. + +##Another way## +is to use the line's point-slope equation [` y-y_{1}=m(x-x_{1}) `]. Again, we choose to use the point [`([$x1],[$y1])`]. + + [` +\begin{aligned} + y-y_{1} &= m(x-x_{1}) \\ + y-[$y1] &= [$m](x-[$x1]) \\ + y-[$y1] &= [$m]x+[$m] \cdot (-[$x1]) \\ + y-[$y1] &= [$m]x+[$s4] \\ + y-[$y1]\mathbf{{}+[$y1]} &= [$m]x+[$s4]\mathbf{{}+[$y1]} \\ + y &= [$m]x+[$b] +\end{aligned} +`] + +This is the second way to find [`b`], and thus the line's slope-intercept equation is [` y=[$m]x+[$b] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation20.pg new file mode 100644 index 0000000000..dc0669eabb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation20.pg @@ -0,0 +1,136 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# Slope is negative. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context("Numeric")->variables->add(y=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$m=random(-5,-2,1); +$b=non_zero_random(-10,10,1); + +$x1=non_zero_random(-5,5,1); +$y1=$m*$x1+$b; +$x2=non_zero_random(-5,5,1); +while ($x2==$x1) {$x2=non_zero_random(-5,5,1);} +$y2=$m*$x2+$b; + +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b")->reduce; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the following line's equation in slope-intercept form. + +The line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. + +[______________]{$ansSI} + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +The slope-intercept form of a line's equation has the form [` y=mx+b `] where [`m`] is the slope and [`b`] is the [`y`]-coordinate of the [`y`]-intercept. To find a line's slope-intercept equation, we first try to find the line's slope. + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ +&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\ +&=\frac{[$s1]}{[$s2]}\\ +&=[$m] \end{aligned}``] + +Now we have [` y=[$m]x+b `]. The next step is to find the value of [`b`]. There are at least two ways we can do this. + +##One way## +is to substitute one of the given points into [` y=[$m]x+b `]. We choose to use [`([$x1],[$y1])`]. + + [` +\begin{aligned} + y &= [$m]x + b \\ + [$y1] &= [$m] \cdot [$x1] + b \\ + [$y1] &= [$s3] + b \\ + [$y1]\mathbf{{}-[$s3]} &= [$s3] + b\mathbf{{}-[$s3]} \\ + [$b] &= b\\ + b &= [$b] +\end{aligned} +`] + +This line's slope-intercept equation is [` y=[$m]x+[$b] `]. + +##Another way## +is to use the line's point-slope equation [` y-y_{1}=m(x-x_{1}) `]. Again, we choose to use the point [`([$x1],[$y1])`]. + + [` +\begin{aligned} + y-y_{1} &= m(x-x_{1}) \\ + y-[$y1] &= [$m](x-[$x1]) \\ + y-[$y1] &= [$m]x+[$m] \cdot (-[$x1]) \\ + y-[$y1] &= [$m]x+[$s4] \\ + y-[$y1]\mathbf{{}+[$y1]} &= [$m]x+[$s4]\mathbf{{}+[$y1]} \\ + y &= [$m]x+[$b] +\end{aligned} +`] + +This is the second way to find [`b`], and thus the line's slope-intercept equation is [` y=[$m]x+[$b] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation30.pg index 8293f77f41..1b6bf3dd68 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation30.pg @@ -7,15 +7,18 @@ # Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(JohnJonesRocks) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','slope-intercept') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserAssignment.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,9 +57,11 @@ TEXT(beginproblem()); BEGIN_PGML -A line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. Find this line's equation in slope-intercept form. +Find the following line's equation in slope-intercept form. + +The line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. - This line's slope-intercept equation is [______________]{$ansSI}. +[______________]{$ansSI} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation35.pg index e036cbe5d6..6f4751ffb0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation35.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation35.pg @@ -7,15 +7,18 @@ # Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 # ENDDESCRIPTION -## DBCCSS('F-LE.2','8.F.3','A-CED') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(JohnJonesRocks) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('linear','equation','slope','slope-intercept') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserAssignment.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation40.pg new file mode 100644 index 0000000000..bdbe63b97a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation40.pg @@ -0,0 +1,151 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# Slope is a positive fraction. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','fraction') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$num=random(1,9,1); +$den=random(2,9,1); +while (gcd($num,$den)!=1) {$den=random(2,9,1);} + +$m=Fraction($num,$den); +$b=random(1,10,1); + +$x1=$den*non_zero_random(-3,3,1); +$y1=$m*$x1+$b; +$x2=$den*non_zero_random(-3,3,1); +while ($x2==$x1) {$x2=$den*random(-3,3,1);} +$y2=$m*$x2+$b; + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->add(y=>'Real'); +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the following line's equation in slope-intercept form. + +The line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. + +[______________]{$ansSI} + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +if ($s4>0) {$s4Output = "+$s4";} +else {$s4Output = "-$s3";} + +$mx = Formula("$m x"); + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +The slope-intercept form of a line's equation has the form [` y=mx+b `] where [`m`] is the slope and [`b`] is the [`y`]-coordinate of the [`y`]-intercept. To find a line's slope-intercept equation, we first try to find the line's slope. + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ +&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\ +&=\frac{[$s1]}{[$s2]}\\ +&=[$m] \end{aligned}``] + +Now we have [` y=[$mx]+b `]. The next step is to find the value of [`b`]. There are at least two ways we can do this. + +##One way## +is to substitute one of the given points into [` y=[$mx]+b `]. We choose to use [`([$x1],[$y1])`]. + + [` +\begin{aligned} + y &= [$mx] + b \\ + [$y1] &= [$m] \cdot [$x1] + b \\ + [$y1] &= [$s3] + b \\ + [$y1]\mathbf{{}-[$s3]} &= [$s3] + b\mathbf{{}-[$s3]} \\ + [$b] &= b\\ + b &= [$b] +\end{aligned} +`] + +This line's slope-intercept equation is [` y=[$mx]+[$b] `]. + +##Another way## +is to use the line's point-slope equation [` y-y_{1}=m(x-x_{1}) `]. Again, we choose to use the point [`([$x1],[$y1])`]. + + [` +\begin{aligned} + y-y_{1} &= m(x-x_{1}) \\ + y-[$y1] &= [$m](x-[$x1]) \\ + y-[$y1] &= [$mx]+[$m] \cdot (-[$x1]) \\ + y-[$y1] &= [$mx][$s4Output] \\ + y-[$y1]\mathbf{{}+[$y1]} &= [$mx][$s4Output]\mathbf{{}+[$y1]} \\ + y &= [$mx]+[$b] +\end{aligned} +`] + +This is the second way to find [`b`], and thus the line's slope-intercept equation is [` y=[$m]x+[$b] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation50.pg new file mode 100644 index 0000000000..ccb576e2a5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation50.pg @@ -0,0 +1,150 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given two points, find a line's equation in slope-intercept form. +# Slope is a negative fraction. +# +# Last updated: Jordan 8/30/13; Carl Yao, 7/9/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') +## KEYWORDS('linear','equation','slope','slope-intercept','fraction') +## DBCCSS('F-LE.2','8.F.3','A-CED') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(showExtraParens=>0); + +$num=random(1,9,1); +$den=random(2,9,1); +while (gcd($num,$den)!=1) {$den=random(2,9,1);} + +$m= -Fraction($num,$den); +$b=random(1,10,1); + +$x1=$den*non_zero_random(-3,3,1); +$y1=$m*$x1+$b; +$x2=$den*non_zero_random(-3,3,1); +while ($x2==$x1) {$x2=$den*random(-3,3,1);} +$y2=$m*$x2+$b; + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->add(y=>'Real'); +parser::Assignment->Allow; +$ansSI=Formula("y=$m*x+$b"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the following line's equation in slope-intercept form. + +The line passes through the points [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. + +[______________]{$ansSI} + +END_PGML + +############################################## + +$s1=$y2-$y1; +$s2=$x2-$x1; +$s3=$m*$x1; +$s4=-$s3; +if ($s4>0) {$s4Output = "+$s4";} +else {$s4Output = "-$s3";} + +$outputy1 = $y1<0 ? "($y1)" : $y1; +$outputx1 = $x1<0 ? "($x1)" : $x1; + +BEGIN_PGML_SOLUTION + +The slope-intercept form of a line's equation has the form [` y=mx+b `] where [`m`] is the slope and [`b`] is the [`y`]-coordinate of the [`y`]-intercept. To find a line's slope-intercept equation, we first try to find the line's slope. + +To find a line's slope, we can use the slope formula: + + [`` \text{slope}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}} ``] + +First, we mark which number corresponds to which variable in the formula: + + [`` ([$x1],[$y1]) \longrightarrow (x_{1},y_{1}) ``] + + [`` ([$x2],[$y2]) \longrightarrow (x_{2},y_{2}) ``] + +Now we substitute these numbers into the corresponding variables in the slope formula: + + [`` \begin{aligned}\text{slope}&=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\ +&=\frac{[$y2]-[$outputy1]}{[$x2]-[$outputx1]}\\ +&=\frac{[$s1]}{[$s2]}\\ +&=[$m] \end{aligned}``] + +Now we have [` y=[$m]x+b `]. The next step is to find the value of [`b`]. There are at least two ways we can do this. + +##One way## +is to substitute one of the given points into [` y=[$m]x+b `]. We choose to use [`([$x1],[$y1])`]. + + [` +\begin{aligned} + y &= [$m]x + b \\ + [$y1] &= [$m] \cdot [$x1] + b \\ + [$y1] &= [$s3] + b \\ + [$y1]\mathbf{{}-[$s3]} &= [$s3] + b\mathbf{{}-[$s3]} \\ + [$b] &= b\\ + b &= [$b] +\end{aligned} +`] + +This line's slope-intercept equation is [` y=[$m]x+[$b] `]. + +##Another way## +is to use the line's point-slope equation [` y-y_{1}=m(x-x_{1}) `]. Again, we choose to use the point [`([$x1],[$y1])`]. + + [` +\begin{aligned} + y-y_{1} &= m(x-x_{1}) \\ + y-[$y1] &= [$m](x-[$x1]) \\ + y-[$y1] &= [$m]x+[$m] \cdot (-[$x1]) \\ + y-[$y1] &= [$m]x[$s4Output] \\ + y-[$y1]\mathbf{{}+[$y1]} &= [$m]x[$s4Output]\mathbf{{}+[$y1]} \\ + y &= [$m]x+[$b] +\end{aligned} +`] + +This is the second way to find [`b`], and thus the line's slope-intercept equation is [`` y=[$m]x+[$b] ``]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + + + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg index 265ab7888e..c3fc4123c0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg @@ -7,37 +7,39 @@ # Last updated Jordan 8/30/13; Hughes 8/25/13 # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Eqn_from_graph2) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", - "PGgraphmacros.pl", "MathObjects.pl", "PGML.pl", "parserAssignment.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); TEXT(beginproblem()); -$refreshCachedImages=1; + $m = random(1,5,1); $b = random(-4,4,1); @@ -66,104 +68,69 @@ $xmin = -5; $xmax = -$xmin; $ymin = -5*(int( abs($y2) /5)+1); $ymax = -$ymin; -$sizex = 400; -$sizey = 400; - -#These two variables decide how many labels are on each axis. -$xmark = ceil($xmax/10); -$ymark = ceil($ymax/10); - -#These variables adjust the label positions in the solution graph. -if ($m>0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = -0.3; - $runXShift = 0.1; -} -if ($m<0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = 0.4; - $runXShift = 0.1; -} - -$gr = init_graph($xmin,$ymin,$xmax,$ymax, - axes=>[0,0], - grid=>[$xmax-$xmin,$ymax-$ymin], - size=>[$sizex,$sizey] -); -$gr->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $gr->lb( new Label($j, -0.1, $j,'black','center','top')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $gr->lb( new Label(0, $j,' '.$j,'black','left','middle')); -} -add_functions($gr, "$m*x+$b for x in <$xmin,$xmax> using color:blue and weight:1"); +$sizex = 240; +$sizey = 240; + + +($start,$stop) = (num_sort($xmin,$xmax,($ymin-$b)/$m+$h,($ymax-$b)/$m+$h))[1,2]; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; +\end{axis} +END_TIKZ $ALTtext = "Graph of a coordinate system with a linear function that goes through ($x1,$y1) and ($x2,$y2)."; ############################################## -Context()->texStrings; +BEGIN_PGML -BEGIN_TEXT +A line's graph is given. What is this line's slope-intercept equation? -$PAR -A line's graph is given. This line's slope-intercept equation is \{ans_rule(15)\}. -$PAR -\{EnlargeImageStatement()\} -$PAR +[@EnlargeImageStatementPGML()@]* -$BCENTER -\{ image( insertGraph($gr), width=>400, height=>400, tex_size=>400, - extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} -$ECENTER -$PAR +>>[@image($gr, width=>300, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< -END_TEXT +[__]{Compute($ansSI)}{width => 15} -Context()->normalStrings; +END_PGML ############################################## -ANS(Compute($ansSI)->cmp()); Context("Numeric"); -$grCorrect = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[$sizex,$sizey] -); -$grCorrect->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $grCorrect->lb( new Label($j, -0.1, $j,'black','center','top')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $grCorrect->lb( new Label(0, $j,' '.$j,'black','left','middle')); -} -add_functions($grCorrect, "$m*x+$b for x in <$xmin,$xmax> using color:blue and weight:1"); -$grCorrect->stamps( closed_circle($x1,$y1,'red') ); -$grCorrect->lb( new Label($x1+$x1labelx,$y1+$y1labely,"$pt1",'red',"$pt1shift",'middle')); -$grCorrect->stamps( closed_circle($x2,$y2,'red') ); -$grCorrect->lb( new Label($x2+$x2labelx,$y2+$y2labely,"$pt2",'red',"$pt2shift",'middle')); - -$grCorrect->moveTo($x1,$y1); -$grCorrect->lineTo($x2,$y1,'red',2); -$grCorrect->lineTo($x2,$y2,'red',2); -$grCorrect->lb( new Label(($x1+$x2)/2,$y1+$riseYShift,"$run",'red','center','middle')); -$grCorrect->lb( new Label($x2+$runXShift,,($y1+$y2)/2,"$rise",'red','left','middle')); +$grCorrect = createTikZImage(); +$grCorrect->addToPreamble(latexImagePreamble()); +$grCorrect->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[left] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[left] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ Context()->texStrings; BEGIN_SOLUTION @@ -178,7 +145,7 @@ Next, we draw a slope triangle and find the "rise" and "run". In this problem, t $PAR $BCENTER -\{ image( insertGraph($grCorrect), width=>400, height=>400, tex_size=>400, +\{ image($grCorrect, width=>300, tex_size=>400, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} $ECENTER $PAR diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg index 899659447b..8851f131a5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg @@ -7,29 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Eqn_from_graph2) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", - "PGgraphmacros.pl", "MathObjects.pl", "PGML.pl", "parserAssignment.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -37,7 +40,7 @@ loadMacros( Context("Numeric"); TEXT(beginproblem()); Context()->flags->set(showExtraParens=>0); -$refreshCachedImages=1; + $m = -random(1,5,1); $b = random(-4,4,1); @@ -68,102 +71,68 @@ $xmin = -5; $xmax = -$xmin; $ymin = -5*(int(abs($y2) /5)+1); $ymax = -$ymin; -$sizex = 400; -$sizey = 400; - -#These two variables decide how many labels are on each axis. -$xmark = ceil($xmax/10); -$ymark = ceil($ymax/10); - -#These variables adjust the label positions in the solution graph. -if ($m>0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = -0.3; - $runXShift = 0.1; -} -if ($m<0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = 0.4; - $runXShift = 0.1; -} - -$gr = init_graph($xmin,$ymin,$xmax,$ymax, - axes=>[0,0], - grid=>[$xmax-$xmin,$ymax-$ymin], - size=>[$sizex,$sizey] -); -$gr->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $gr->lb( new Label($j, -0.1, $j,'black','center','top')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $gr->lb( new Label(0, $j,' '.$j,'black','left','middle')); -} -add_functions($gr, "$m*x+$b for x in <$xmin,$xmax> using color:blue and weight:1"); +$sizex = 240; +$sizey = 240; + +($start,$stop) = (num_sort($xmin,$xmax,($ymin-$b)/$m+$h,($ymax-$b)/$m+$h))[1,2]; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; +\end{axis} +END_TIKZ + $ALTtext = "Graph of a coordinate system with a linear function that goes through ($x1,$y1) and ($x2,$y2)."; ############################################## -Context()->texStrings; +BEGIN_PGML -BEGIN_TEXT +A line's graph is given. What is this line's slope-intercept equation? -$PAR -A line's graph is given. This line's slope-intercept equation is \{ans_rule(15)\}. -$PAR -\{EnlargeImageStatement()\} -$PAR -$BCENTER -\{ image( insertGraph($gr), width=>400, height=>400, tex_size=>400, - extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} -$ECENTER -$PAR +[@EnlargeImageStatementPGML()@]* -END_TEXT +>>[@image($gr, width=>300, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< -Context()->normalStrings; +[__]{$ansSI}{width => 15} + +END_PGML ############################################## -ANS($ansSI->cmp()); Context("Numeric"); -$grCorrect = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[$sizex,$sizey] -); -$grCorrect->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $grCorrect->lb( new Label($j, -0.1, $j,'black','center','top')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $grCorrect->lb( new Label(0, $j,' '.$j,'black','left','middle')); -} -add_functions($grCorrect, "$m*x+$b for x in <$xmin,$xmax> using color:blue and weight:1"); -$grCorrect->stamps( closed_circle($x1,$y1,'red') ); -$grCorrect->lb( new Label($x1+$x1labelx,$y1+$y1labely,"$pt1",'red',"$pt1shift",'middle')); -$grCorrect->stamps( closed_circle($x2,$y2,'red') ); -$grCorrect->lb( new Label($x2+$x2labelx,$y2+$y2labely,"$pt2",'red',"$pt2shift",'middle')); - -$grCorrect->moveTo($x1,$y1); -$grCorrect->lineTo($x2,$y1,'red',2); -$grCorrect->lineTo($x2,$y2,'red',2); -$grCorrect->lb( new Label(($x1+$x2)/2,$y1+$riseYShift,"$run",'red','center','middle')); -$grCorrect->lb( new Label($x2+$runXShift,,($y1+$y2)/2,"$rise",'red','left','middle')); +$grCorrect = createTikZImage(); +$grCorrect->addToPreamble(latexImagePreamble()); +$grCorrect->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[left] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[left] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ Context()->texStrings; BEGIN_SOLUTION @@ -178,7 +147,7 @@ Next, we draw a slope triangle and find the "rise" and "run". In this problem, t $PAR $BCENTER -\{ image( insertGraph($grCorrect), width=>400, height=>400, tex_size=>400, +\{ image($grCorrect, width=>300, tex_size=>400, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} $ECENTER $PAR diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg index eb59e58bb2..3d444775a4 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg @@ -7,43 +7,47 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Eqn_from_graph2) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope','fraction') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( + "PGtikz.pl", + "ORCCA.pl", "PGstandard.pl", - "PGgraphmacros.pl", "MathObjects.pl", "PGML.pl", "contextFraction.pl", "parserAssignment.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Fraction"); TEXT(beginproblem()); -$refreshCachedImages=1; + $num=random(1,9,1); do {$den=random(2,9,1);} until (gcd($den,$num)==1); $m = Fraction($num,$den); +$mperl = $num/$den; Context("Numeric"); $b = random(-4,4,1); @@ -72,108 +76,78 @@ $xmin = -10; $xmax = -$xmin; $ymin = -5*(int(abs($y2) /5)+1); $ymax = -$ymin; -$sizex = 400; -$sizey = 400; - -#These two variables decide how many labels are on each axis. -$xmark = ceil($xmax/10); -$ymark = ceil($ymax/10); - -#These variables adjust the label positions in the solution graph. -if ($m>0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = -0.3; - $runXShift = 0.1; -} -if ($m<0) { - $x1labelx = -0.2; - $y1labely = 0; - $x2labelx = 0.2; - $y2labely = 0; - $pt1shift = "right"; - $pt2shift = "left"; - - $riseYShift = 0.4; - $runXShift = 0.1; -} - -$gr = init_graph($xmin,$ymin,$xmax,$ymax, - axes=>[0,0], - grid=>[$xmax-$xmin,$ymax-$ymin], - size=>[$sizex,$sizey] -); -$gr->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $gr->lb( new Label($j, -0.1, $j,'black','center','top')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $gr->lb( new Label(0, $j,' '.$j,'black','left','middle')); -} -add_functions($gr, "$m*x+$b for x in <$xmin,$xmax> using color:blue and weight:1"); +$sizex = 240; +$sizey = 240; + +($start,$stop) = (num_sort($xmin,$xmax,($ymin-$b)/$mperl+$h,($ymax-$b)/$mperl+$h))[1,2]; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ + $ALTtext = "Graph of a coordinate system with a linear function that goes through ($x1,$y1) and ($x2,$y2)."; +#The variable ansSIRight is for displaying correct answer. + +$ansSIRight=Formula("x+$b")->reduce; + +$evaluator = Compute($ansSI)->cmp( + correct_ans=>"y=($num/$den)"."$ansSIRight", + correct_ans_latex_string=>"y=\frac{$num}{$den}"."$ansSIRight" +); + ############################################## -Context()->texStrings; +BEGIN_PGML -BEGIN_TEXT +A line's graph is given. What is this line's slope-intercept equation? -$PAR -A line's graph is given. This line's slope-intercept equation is \{ans_rule(15)\}. -$PAR -\{EnlargeImageStatement()\} -$PAR -$BCENTER -\{ image( insertGraph($gr), width=>400, height=>400, tex_size=>400, - extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} -$ECENTER -$PAR +[@EnlargeImageStatementPGML()@]* -END_TEXT +>>[@image($gr, width=>300, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< -Context()->normalStrings; +[__]{$evaluator}{width => 15} -############################################## +END_PGML -#The variable ansSIRight is for displaying correct answer. -$ansSIRight=Formula("x+$b")->reduce; +############################################## -ANS(Compute($ansSI)->cmp( - correct_ans=>"y=($num/$den)"."$ansSIRight", - correct_ans_latex_string=>"y=\frac{$num}{$den}"."$ansSIRight" -)); Context("Numeric"); -$grCorrect = init_graph($xmin,$ymin,$xmax,$ymax, -axes=>[0,0], -grid=>[$xmax-$xmin,$ymax-$ymin], -size=>[$sizex,$sizey] -); -$grCorrect->lb('reset'); -for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $grCorrect->lb( new Label($j, -0.1, $j,'black','center','top')); -} -for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { - if (Real($j) == 0) {next;} - $grCorrect->lb( new Label(0, $j,' '.$j,'black','left','middle')); -} -add_functions($grCorrect, "$m*x+$b for x in <$xmin,$xmax> using color:blue and weight:1"); -$grCorrect->stamps( closed_circle($x1,$y1,'red') ); -$grCorrect->lb( new Label($x1+$x1labelx,$y1+$y1labely,"$pt1",'red',"$pt1shift",'middle')); -$grCorrect->stamps( closed_circle($x2,$y2,'red') ); -$grCorrect->lb( new Label($x2+$x2labelx,$y2+$y2labely,"$pt2",'red',"$pt2shift",'middle')); - -$grCorrect->moveTo($x1,$y1); -$grCorrect->lineTo($x2,$y1,'red',2); -$grCorrect->lineTo($x2,$y2,'red',2); -$grCorrect->lb( new Label(($x1+$x2)/2,$y1+$riseYShift,"$run",'red','center','middle')); -$grCorrect->lb( new Label($x2+$runXShift,,($y1+$y2)/2,"$rise",'red','left','middle')); +$grCorrect = createTikZImage(); +$grCorrect->addToPreamble(latexImagePreamble()); +$grCorrect->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + grid = minor, + ] + \addplot+[domain=$start:$stop] {$m*x+$b}; + \addplot[soliddot] coordinates {($x1,$y1)} node[left] {\(($x1,$y1)\)}; + \addplot[soliddot] coordinates {($x2,$y2)} node[left] {\(($x2,$y2)\)}; + \addplot[guideline] coordinates {($x1,$y1) ($x2,$y1) ($x2,$y2)}; +\end{axis} +END_TIKZ Context()->texStrings; BEGIN_SOLUTION @@ -188,7 +162,7 @@ Next, we draw a slope triangle and find the "rise" and "run". In this problem, t $PAR $BCENTER -\{ image( insertGraph($grCorrect), width=>400, height=>400, tex_size=>400, +\{ image($grCorrect, width=>300, tex_size=>400, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} $ECENTER $PAR diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg index 5bf7d96a42..ab3452f50a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg @@ -7,16 +7,18 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Equations of lines: slope-intercept form) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(MLT13) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope','fraction') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') # Updated by Peter Staab (2022.06) to include alt_text for graph and # switch to PGML, tikz. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg index 3ada829aa8..df93b9db9a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg @@ -6,36 +6,38 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Eqn_from_graph2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope','zero') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserAssignment.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); TEXT(beginproblem()); -$refreshCachedImages=1; + $m = 0; $b = non_zero_random(-4,4,1); @@ -58,14 +60,14 @@ Context("Numeric"); Context("Numeric")->variables->add(y=>'Real'); Context()->noreduce('(-x)-y','(-x)+y'); parser::Assignment->Allow; -$ansSI=Compute("y=$b")->reduce; +$ansSI=Formula("y=$b")->reduce; $xmin = -5; $xmax = -$xmin; $ymin = -5*(int($y2 /5)+1); $ymax = -$ymin; -$sizex = 400; -$sizey = 400; +$sizex = 240; +$sizey = 240; #These two variables decide how many labels are on each axis. $xmark = ceil($xmax/10); @@ -102,39 +104,35 @@ $gr = init_graph($xmin,$ymin,$xmax,$ymax, ); $gr->lb('reset'); for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $gr->lb( new Label($j, -0.1, $j,'black','center','top')); + $gr->lb( new Label($j, -0.1, $j,'black','center','top','large')); } for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { if (Real($j) == 0) {next;} - $gr->lb( new Label(0, $j,' '.$j,'black','left','middle')); + $gr->lb( new Label(0, $j,' '.$j,'black','left','middle','large')); } -add_functions($gr, "$m*x+$b for x in <$xmin,$xmax> using color:blue and weight:2"); + +$gr->moveTo(0,$b); +$gr->arrowTo($xmin,$b,'blue',1); +$gr->moveTo(0,$b); +$gr->arrowTo($xmax,$b,'blue',1); + $ALTtext = "Graph of a coordinate system with a linear function that goes through ($x1,$y1) and ($x2,$y2)."; ############################################## -Context()->texStrings; +BEGIN_PGML -BEGIN_TEXT +A line's graph is shown. Write an equation for the line. -$PAR -A line's graph is given. This line's equation is \{ans_rule(15)\}. -$PAR -\{EnlargeImageStatement()\} -$PAR -$BCENTER -\{ image( insertGraph($gr), width=>400, height=>400, tex_size=>400, - extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} -$ECENTER -$PAR +[@EnlargeImageStatementPGML()@]* -END_TEXT +>>[@image( insertGraph($gr), width=>240, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< -Context()->normalStrings; +[__]{Compute($ansSI)}{width => 15} -############################################## +END_PGML -ANS($ansSI->cmp()); +############################################## $grCorrect = init_graph($xmin,$ymin,$xmax,$ymax, axes=>[0,0], diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg index 08e5495590..794c61ed72 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg @@ -6,36 +6,38 @@ # Last updated Jordan 8/30/13; # ENDDESCRIPTION -## DBCCSS('8.EE','F-IF.7.a') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Graphs of lines) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(Eqn_from_graph2) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines') ## KEYWORDS('coordinate','line','linear','equation','graph','slope','zero') +## DBCCSS('8.EE','F-IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserAssignment.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Numeric"); TEXT(beginproblem()); -$refreshCachedImages=1; + $a = non_zero_random(-4,4,1); @@ -56,14 +58,14 @@ $pt2=Compute("($x2,$y2)"); Context("Numeric"); Context()->noreduce('(-x)-y','(-x)+y'); parser::Assignment->Allow; -$ansSI=Compute("x=$a")->reduce; +$ansSI=Formula("x=$a")->reduce; $xmin = -5; $xmax = -$xmin; $ymin = -5*(int( abs($y2) /5)+1); $ymax = -$ymin; -$sizex = 400; -$sizey = 400; +$sizex = 240; +$sizey = 240; #These two variables decide how many labels are on each axis. $xmark = ceil($xmax/10); @@ -88,39 +90,32 @@ $gr = init_graph($xmin,$ymin,$xmax,$ymax, ); $gr->lb('reset'); for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { - $gr->lb( new Label($j, -0.1, $j,'black','center','top')); + $gr->lb( new Label($j, -0.1, $j,'black','center','top','large')); } for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) { if (Real($j) == 0) {next;} - $gr->lb( new Label(0, $j,' '.$j,'black','left','middle')); + $gr->lb( new Label(0, $j,' '.$j,'black','left','middle','large')); } -$gr->moveTo($x1,$ymin); -$gr->lineTo($x1,$ymax,'blue',2); +$gr->moveTo($x1,0); +$gr->arrowTo($x1,$ymax,'blue',1); +$gr->moveTo($x1,0); +$gr->arrowTo($x1,$ymin,'blue',1); $ALTtext = "Graph of a coordinate system with a linear function that goes through ($x1,$y1) and ($x2,$y2)."; ############################################## -Context()->texStrings; +BEGIN_PGML -BEGIN_TEXT +A line's graph is shown. Write an equation for the line. -$PAR -A line's graph is given. This line's equation is \{ans_rule(15)\}. -$PAR -\{EnlargeImageStatement()\} -$PAR -$BCENTER -\{ image( insertGraph($gr), width=>400, height=>400, tex_size=>400, - extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' ) \} -$ECENTER -$PAR +[@EnlargeImageStatementPGML()@]* -END_TEXT +>>[@image( insertGraph($gr), width=>240, extra_html_tags=>'title="$ALTtext" alt="$ALTtext"' )@]*<< -Context()->normalStrings; +[__]{Compute($ansSI)}{width => 15} -############################################## +END_PGML -ANS($ansSI->cmp()); +############################################## $grCorrect = init_graph($xmin,$ymin,$xmax,$ymax, axes=>[0,0], diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LinearOrNonLinearEquations10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LinearOrNonLinearEquations10.pg index c7432e46fa..46ecadf151 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LinearOrNonLinearEquations10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LinearOrNonLinearEquations10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.2.c') -## DBsubject(Algebra) -## DBchapter(Linear equations and functions) -## DBsection(Linear equations) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('formula','expression','evaluate') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') DOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation10.pg new file mode 100644 index 0000000000..f32056e68d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation10.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of x+a=b +# +# Last updated: Jordan 7/23/13; Kling 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','subtract') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); +Context()->noreduce('(-x)-y','(-x)+y'); + +$r=random(1,9,2); +$ans1 = random(2,10,2); +$s=$r+$ans1; + +Context("Numeric"); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real', $var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US or $var2 = $US$US$US"; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans2 = Formula("$var4-$var3"); +$ansEq1=Formula("$var1=$ans1"); +$ansEq2=Formula("$var2=$ans2"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +a. Solve [` [$var1]+[$r]=[$s] `] for [`[$var1]`]. + [_______] + +b) Solve [` [$var2] + [$var3] = [$var4] `] for [`[$var2]`]. + [_______] + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form $var2 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] +[$var1] + [$r] &= [$s] \\ +[$var1] + [$r]\mathbf{{} -[$r]} &= [$s]\mathbf{{} -[$r]} \\ +[$var1] &= [$ans1] +\end{aligned} +`] + + The solution to the equation is [`[$ans1]`]; we can check our work by + substituting [`[$ans1]`] into the original equation for [`[$var1]`]; this is left as an exercise. + +b) [` +\begin{aligned}[t] +[$var2] + [$var3] &= [$var4] \\ +[$var2] + [$var3]\mathbf{{} -[$var3]} &= [$var4] \mathbf{{} -[$var3]} \\ +[$var2] &= [$ans2] +\end{aligned} +`] + + The solution to the equation is [`[$ans2]`]; we can check our work by + substituting [`[$ans2]`] into the original equation for [`[$var2]`]; this is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation100.pg new file mode 100644 index 0000000000..ebd28fc4a5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation100.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of y=mx+b for x, and then for m +# +# Last updated: Jordan 7/23/13; Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','subtract','divide') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName()} until ($var2 ne $var1); +do {$var3 = RandomVariableName(type=>variable)} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context("Numeric"); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real', $var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US or $var2 = $US$US$US"; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans1 = Compute("($var3-$var4)/$var2")->reduce; +$ans2 = Compute("($var3-$var4)/$var1")->reduce; + +$ansEq1=Formula("$var1=$ans1"); +$ansEq2=Formula("$var2=$ans2"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +a. Solve [` [$var3]=[$var2][$var1]+[$var4]`] for [`[$var1]`]. + [_______] + +a. Solve [` [$var3]=[$var2][$var1]+[$var4]`] for [`[$var2]`]. + [_______] + + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form $var2 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +*Solution of Part a):* + +[` +\begin{aligned}[t] + [$var3] &= [$var2][$var1]+[$var4] \\ + [$var3]\mathbf{{}-[$var4]}&= [$var2][$var1] +[$var4]\mathbf{{}-[$var4]} \\ + [$var3]-[$var4] &= [$var2][$var1] \\ + \frac{[$var3]-[$var4]}{[$var2]} &= \frac{[$var2][$var1]}{[$var2]} \\ + [$ans1] &= [$var1]\\ + [$var1] & = [$ans1] +\end{aligned} +`] + + The solution to the equation is [`[$ans1]`]; we can check our work by + substituting [`[$ans1]`] into the original equation for [`[$var1]`]; this is left as an exercise. + +*Solution of Part b):* + +[` +\begin{aligned}[t] + [$var3] &= [$var2][$var1] +[$var4] \\ + [$var3]\mathbf{{}-[$var4]}&= [$var2][$var1] +[$var4]\mathbf{{}-[$var4]} \\ + [$var3]-[$var4] &= [$var2][$var1] \\ + \frac{[$var3]-[$var4]}{[$var1]} &= \frac{[$var2][$var1]}{[$var1]} \\ + [$ans2] &= [$var2]\\ + [$var2] &= [$ans2] +\end{aligned} +`] + + The solution to the equation is [`[$ans2]`]; we can check our work by + substituting [`[$ans2]`] into the original equation for [`[$var2]`]; this is left as an exercise. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation110.pg new file mode 100644 index 0000000000..94b606505d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation110.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of C=2PIr for r +# +# Last updated: Jordan 7/23/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','divide') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + + +Context("Numeric"); +Context()->variables->are(r=>'Real',C=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form r = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; +Context()->{error}{msg}{"Variable 'c' is not defined in this context"} + = "Lowercase 'c' is not the same variable as uppercase 'C'"; + + +Context()->flags->set(reduceConstants=>0); +$ans = Formula("C/ (2 pi)"); +$ansEq=Formula("r=$ans"); + + +$ans = Compute("C/(2 pi)")->reduce; + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this linear equation for [`r`]. [``` C=2 \pi r ```] + + [______________] + +[@KeyboardInstructions(q!Use [|pi|]* to represent [`\pi`].!)@]** + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form r = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form r = $US$US$US" , replaceMessage => 1], + [Formula("r=C/2*pi")] => + "Be careful with parentheses: 1/2x is not the same as 1/(2x).", + [Formula("r=C/pi*2")] => + "Be careful with parentheses: 1/2x is not the same as 1/(2x)." + )) + ); + + + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + C &= 2 \pi r \\ + \frac{C}{2 \pi} &= \frac{2 \pi r}{2 \pi} \\ + [$ans] &= r \\ + r & = [$ans] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation120.pg new file mode 100644 index 0000000000..7cf3340657 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation120.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of y=mx-b for x +# +# Last updated: Jordan 7/23/13; Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','add','divide') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->variables->are(x=>'Real',y=>'Real',m=>'Real', b=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form x = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans = Compute("(y+b)/m")->reduce; +$ansEq=Formula("x=$ans"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this linear equation for [`x`]. [``` y=mx-b```] + + [______________] + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form x = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form x = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + y &=mx -b \\ + y\mathbf{{}+b}&=mx -b\mathbf{{}+b} \\ + y+b &= mx \\ + \frac{y+b}{m} &= \frac{mx}{m} \\ + [$ans] &= x\\ + x &= [$ans] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation130.pg new file mode 100644 index 0000000000..c0a11f27b8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation130.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of y=-mx+b for x +# +# Last updated: Jordan 7/23/13; Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','subtract','divide') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->variables->are(x=>'Real',y=>'Real',m=>'Real', b=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form x = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans = Compute("(b-y)/m")->reduce; +$ansEq=Formula("x=$ans"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this linear equation for [`x`]. + + [``` y=-mx+b```] + + [______________] + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form x = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form x = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + y &=-mx +b \\ + y\mathbf{{}-b}&=-mx +b\mathbf{{}-b} \\ + y-b &= -mx \\ + \frac{y-b}{-m} &= \frac{-mx}{-m} \\ + \frac{-1}{-1}\cdot\frac{y-b}{-m} &= \frac{-mx}{-m} \\ + [$ans] &= x\\ + x &= [$ans] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation140.pg new file mode 100644 index 0000000000..ac975b18d8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation140.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of A=(1/2)bh for b +# +# Last updated: Jordan 7/23/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','multiply','divide') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$r=random(2,10,2); +$ans1 = random(3,10,1); +$l=$r*$ans1/2; + +Context()->variables->are(A=>'Real',b=>'Real',h=>'Real', ); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form b = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans2 = Compute("2A/h"); + +$ansEq1=Formula("b=$ans1"); +$ansEq2=Formula("b=$ans2"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +a. Solve [` [$l]=\frac{1}{2} b \cdot [$r] `] for [`b`]. + [_______] + +a. Solve [` A=\frac{1}{2} b \cdot h `] for [`b`]. + [_______] + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form b = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form b = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +$s1 = 2*$l; + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] + [$l] &= \frac{1}{2}b \cdot[$r] \\ + 2 \cdot [$l] &= 2 \cdot \frac{1}{2}b \cdot[$r] \\ + [$s1] &= b \cdot[$r] \\ + \frac{[$s1]}{[$r]} &= \frac{b \cdot[$r]}{[$r]} \\ + [$ans1] &= b\\ + b &= [$ans1] +\end{aligned} +`] + +b) [` +\begin{aligned}[t] + A &= \frac{1}{2}b \cdot h \\ + 2 \cdot A &= 2 \cdot \frac{1}{2}b \cdot h \\ + 2A &= b \cdot h \\ + \frac{2A}{h} &= \frac{b \cdot h}{h} \\ + [$ans2] &= b\\ + b &= [$ans2] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation150.pg new file mode 100644 index 0000000000..36151a78f7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation150.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of V=PIr^2h for h +# +# Last updated: Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','divide') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') +## COMMENT('variables could be randomized') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->add(V=>'Real',r=>'Real',h=>'Real'); + + +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form h = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; +Context()->{error}{msg}{"Variable 'v' is not defined in this context"} + = "Lowercase 'v' is not the same variable as uppercase 'V'"; + + +Context()->flags->set(reduceConstants=>0); +$ans = Formula("V/ (pi r^2)"); +$ansEq=Formula("h=$ans"); + + + + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this linear equation for [`h`]. [``` V= \pi r^{2} h ```] + + [___________] + +[@KeyboardInstructions(q!Use [|pi|]* to represent [`\pi`].!)@]** + +END_PGML + +############################################## +ANS($ansEq -> cmp() -> + withPostFilter(AnswerHints( + [Formula("h=V/pi*r^2")] => + "Be careful with parentheses: 1/2x is not the same as 1/(2x)."))); + +BEGIN_PGML_SOLUTION + +[` +\begin{alignedat} {2} + V &=\; \pi r^{2} h \\ + \frac{V}{\pi r^{2}} &=\; \frac{\pi r^{2} h}{\pi r^{2}} \\ + [$ans] &=\; h \\ + h &=\; [$ans] +\end{alignedat} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation160.pg new file mode 100644 index 0000000000..546ddad30b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation160.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of x/p+7=q for x +# +# Last updated: Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','multiply','subtract') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=random(1,10,1); +$den = random(2,5,1); +$ans1 = $den*list_random((1,2,3,4,5)); +$b=$ans1/$den+$a; + +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real',); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans2 = Compute("$var2 $var3-$a $var2")->reduce; +$ansEq1=Formula("$var1=$ans1"); +$ansEq2=Formula("$var1=$ans2"); + + + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + + +Solve these linear equations for [`[$var1]`]. +a) [` \frac{[$var1]}{[$den]}+[$a]=[$b] `] + + [_______] + +b) [` \frac{[$var1]}{[$var2]}+[$a]=[$var3] `] + + [_______] + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +$s1 = $a*$den; +$s2 = $b*$den; + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] + \frac{[$var1]}{[$den]} +[$a] &= [$b] \\ + [$den] \cdot \left(\frac{[$var1]}{[$den]} +[$den] [$a]\right) &= [$den] \cdot [$b] \\ +[$den] \cdot \frac{[$var1]}{[$den]} +[$den] \cdot [$a] &= [$den] \cdot [$b] \\ + [$var1] +[$s1] &= [$s2] \\ + [$var1] +[$s1]\mathbf{{} -[$s1]} &= [$s2]\mathbf{{} -[$s1]} \\ + [$var1] &= [$ans1] +\end{aligned} +`] + +b) [` +\begin{aligned}[t] + \frac{[$var1]}{[$var2]} +[$a] &= [$var3] \\ + [$var2] \cdot \left(\frac{[$var1]}{[$var2]} + [$a]\right) &= [$var2] \cdot [$var3] \\ + [$var2] \cdot \frac{[$var1]}{[$var2]} +[$var2] \cdot [$a] &= [$var2] \cdot [$var3] \\ + [$var1] +[$a][$var2] &= [$var2][$var3] \\ + [$var1] +[$a][$var2]\mathbf{{} -[$a][$var2]} &= [$var2][$var3]\mathbf{{} -[$a][$var2]} \\ + [$var1] &= [$ans2] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation170.pg new file mode 100644 index 0000000000..6d52312b9c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation170.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of p/q+r=s for p +# +# Last updated: Jordan 7/23/13; Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','multiply','subtract') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); + +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real', $var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + +$ans = Compute("$var2 $var4 - $var2 $var3")->reduce; +$ansEq=Formula("$var1=$ans"); + + + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this linear equation for [`[$var1]`]. [``` \frac{[$var1]}{[$var2]}+[$var3]=[$var4] ```] + + [_______] + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + \frac{[$var1]}{[$var2]} +[$var3] &= [$var4] \\ + [$var2] \cdot \left(\frac{[$var1]}{[$var2]} + [$var3]\right) &= [$var2] \cdot [$var4] \\ + [$var2] \cdot \frac{[$var1]}{[$var2]} +[$var2] \cdot [$var3] &= [$var2] \cdot [$var4] \\ + [$var1] +[$var2][$var3] &= [$var2][$var4] \\ + [$var1] +[$var2][$var3]\mathbf{{}-[$var2][$var3]} &= [$var2][$var4] \mathbf{{}-[$var2][$var3]} \\ + [$var1] &= [$ans] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation180.pg new file mode 100644 index 0000000000..77b8b73264 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation180.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of p/7+r=s for p +# +# Last updated: Jordan 7/23/13; Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','multiply','subtract') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); + + +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); + + +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + +$ans = Compute("$a*$var3-$a*$var2")->reduce; +$ansEq=Formula("$var1=$ans"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this linear equation for [`[$var1]`]. + + [``` \frac{[$var1]}{[$a]}+[$var2]=[$var3] ```] + + [_______] + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + \frac{[$var1]}{[$a]} +[$var2] &= [$var3] \\ +[$a] \cdot \left(\frac{[$var1]}{[$a]} + [$var2]\right) &= [$a] \cdot [$var3] \\ + [$a] \cdot \frac{[$var1]}{[$a]} +[$a] \cdot [$var2] &= [$a] \cdot [$var3] \\ + [$var1] +[$a][$var2] &= [$a][$var3] \\ + [$var1] +[$a][$var2] \mathbf{{}-[$a][$var2]}&= [$a][$var3]\mathbf{{}-[$a][$var2]} \\ + [$var1] &= [$ans] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation190.pg new file mode 100644 index 0000000000..78e285281e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation190.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of s=r-7p/q for p +# +# Last updated: Jordan 7/23/13; Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','multiply','divide','subtract','negative') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName()} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); + +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); + +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real',$var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + +$ans = -Compute("($var2 $var4 - $var2 $var3)/$a"); +$ansEq=Formula("$var1=$ans"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this linear equation for [`[$var1]`]. + + [``` [$var4]=[$var3]-\frac{[$a][$var1]}{[$var2]} ```] + + [_______] + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + [$var4] &= [$var3]-\frac{[$a][$var1]}{[$var2]} \\ +[$var2] \cdot [$var4] &= [$var2] \cdot\left( [$var3]- [$var2] \frac{[$a][$var1]}{[$var2]}\right) \\ + [$var2] \cdot [$var4] &= [$var2] \cdot [$var3] - [$var2] \cdot \frac{[$a][$var1]}{[$var2]} \\ + [$var2][$var4] &= [$var2][$var3] -[$a][$var1] \\ + [$var2][$var4] \mathbf{{} -[$var2][$var3]}&= [$var2][$var3] -[$a][$var1]\mathbf{{} -[$var2][$var3]} \\ + [$var2][$var4]-[$var2][$var3] &= -[$a][$var1] \\ + \frac{[$var2][$var4]-[$var2][$var3]}{-[$a]} &= \frac{-[$a][$var1]}{-[$a]} \\ + [$ans] &= [$var1]\\ + [$var1] & = [$ans] +\end{aligned} +`] + +Note that you can rewrite the solution in a different format: + + [` +\begin{aligned} +-\frac{[$var2][$var4]-[$var2][$var3]}{[$a]}&=\frac{(-1)([$var2][$var4]-[$var2][$var3])}{[$a]}\\ +&=\frac{(-1) \cdot [$var2][$var4] + (-1) \cdot (-[$var2][$var3])}{[$a]}\\ +&= \frac{-[$var2][$var4]+[$var2][$var3]}{[$a]}\\ +&= \frac{[$var2][$var3]-[$var2][$var4]}{[$a]} +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation20.pg new file mode 100644 index 0000000000..4dab46120c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation20.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of y-a=-5 +# +# Last updated: Jordan 7/23/13; Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','add') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +Context()->noreduce('(-x)-y','(-x)+y'); + +$r=random(1,9,2); +$ans1 = random(2,10,2); +$s=$ans1-$r; + +Context("Numeric"); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US or $var2 = $US$US$US"; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans2 = Compute("$s+$var3")->reduce; +$ansEq1=Formula("$var1=$ans1"); +$ansEq2=Formula("$var2=$ans2"); + + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + + +a. Solve [` [$var1]-[$r]=[$s] `] for [`[$var1]`]. + [_______] + +a. Solve [` [$var2]-[$var3]=[$s] `] for [`[$var2]`]. + [_______] + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form $var2 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] +[$var1] - [$r] &= [$s] \\ +[$var1] - [$r]\mathbf{{}+[$r]} &= [$s]\mathbf{{}+[$r]} \\ +[$var1] &= [$ans1] +\end{aligned} +`] + + The solution to the equation is [`[$ans1]`]; we can check our work by + substituting [`[$ans1]`] into the original equation for [`[$var1]`]; this is left as an exercise. + +b) [` +\begin{aligned}[t] +[$var2] - [$var3] &= [$s] \\ +[$var2] - [$var3]\mathbf{{} +[$var3]} &= [$s]\mathbf{{} +[$var3]} \\ +[$var2] &= [$ans2] +\end{aligned} +`] + + The solution to the equation is [`[$ans2]`]; we can check our work by + substituting [`[$ans2]`] into the original equation for [`[$var2]`]; this is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation200.pg new file mode 100644 index 0000000000..8aa16da658 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation200.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of Ax+By=C for x +# +# Last updated: Jordan 7/23/13; Kling 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','subtract','divide') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + + +Context()->variables->are(x=>'Real', y=>'Real', A=>'Real',B=>'Real',C=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form x = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + +$ans = Compute("(C-By)/A"); +$ansEq=Formula("x=$ans"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this linear equation for [`x`]. + + [``` Ax+By=C ```] + + [_______] + +[@KeyboardInstructions('Note that the variables are upper case [`A`], [`B`], and [`C`] and lower case [`x`] and [`y`].')@]** + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form x = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form x = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + Ax +By &= C \\ + Ax +By \mathbf{{} -By}&= C\mathbf{{} -By} \\ + Ax &= C-By \\ + \frac{Ax}{A} &= \frac{C-By}{A} \\ + x &= [$ans] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation210.pg new file mode 100644 index 0000000000..a6d9e5f7f9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation210.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of Ax+By=C for y +# +# Last updated: Jordan 7/23/13; Kling 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','divide','subtract') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + + +Context()->variables->are(x=>'Real', y=>'Real', A=>'Real',B=>'Real',C=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form x = $US$US$US "; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + +$ans = Compute("(C-Ax)/B"); +$ansEq=Formula("y=$ans"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this linear equation for [`y`]. + + [``` Ax+By=C ```] + + [_______] + +[@KeyboardInstructions('Note that the variables are upper case [`A`], [`B`], and [`C`] and lower case [`x`] and [`y`].')@]** + +END_PGML + +ANS($ansEq->cmp(cmp_class=>"an equation of the form y = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans" => ["You have the solution, but answers to questions like this should be in the form y = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} + Ax +By &= C \\ + Ax +By\mathbf{{}-Ax} &= C\mathbf{{}-Ax} \\ + By &= C-Ax \\ + \frac{By}{B} &= \frac{C-Ax}{B} \\ + y &= [$ans] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation30.pg new file mode 100644 index 0000000000..c0e68371d9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation30.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of -z+a=b +# +# Last updated: Jordan 7/23/13; Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','subtract','negative') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); +Context()->noreduce('(-x)-y','(-x)+y'); + +$r=random(1,9,2); +$ans1 = random(2,10,2); +$s=-$ans1+$r; + +Context("Numeric"); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real', $var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US or $var2 = $US$US$US"; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans2 = Compute("$var3-$var4")->reduce; +$ansEq1=Formula("$var1=$ans1"); +$ansEq2=Formula("$var2=$ans2"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +a. Solve [` -[$var1]+[$r]=[$s] `] for [`[$var1]`]. + [_______] + +a. Solve [` -[$var2]+[$var3]=[$var4] `] for [`[$var2]`]. + [_______] + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form $var2 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] + -[$var1] + [$r] &= [$s] \\ + -[$var1] + [$r]\mathbf{{}-[$r]} &= [$s]\mathbf{{}-[$r]} \\ + -[$var1] &= [$s-$r] \\ + (-1) \cdot (-[$var1]) &= (-1) \cdot ([$s-$r]) \\ + [$var1] &= [$ans1] \\ +\end{aligned} +`] + + The solution to the equation is [`[$ans1]`]; we can check our work by + substituting [`[$ans1]`] into the original equation for [`[$var1]`]; this is left as an exercise. + +b) [` +\begin{aligned}[t] + -[$var2] + [$var3] &= [$var4] \\ + -[$var2] + [$var3]\mathbf{{} -[$var3]} &= [$var4]\mathbf{{} -[$var3]} \\ + -[$var2] &= [$var4]-[$var3] \\ + (-1) \cdot (-[$var2]) &=(-1) \cdot ([$var4]-[$var3]) \\ + (-1) \cdot (-[$var2]) &=(-1) \cdot ([$var4]+(-[$var3])) \\ + [$var2] &=(-1) \cdot [$var4] + (-1) \cdot (-[$var3]) \\ + [$var2] &= -[$var4]+[$var3] \quad (\text{already correct}) \\ + [$var2] &=[$var3]-[$var4] \quad (\text{looks better}) +\end{aligned} +`] + + The solution to the equation is [`[$ans2]`]; we can check our work by + substituting [`[$ans2]`] into the original equation for [`[$var2]`]; this is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation40.pg new file mode 100644 index 0000000000..a39763eb85 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation40.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of cx=d +# +# Last updated: Jordan 7/23/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','divide') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); +Context()->noreduce('(-x)-y','(-x)+y'); + +$r=random(3,9,2); +$ans1 = random(2,10,2); +$s=$ans1*$r; + +Context("Numeric"); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real', $var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US or $var2 = $US$US$US"; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans2 = Compute("$var4/$var3")->reduce; +$ansEq1=Formula("$var1=$ans1"); +$ansEq2=Formula("$var2=$ans2"); + + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + + +a. Solve [` [$r][$var1] = [$s] `] for [`[$var1]`]. + [_______] + +a. Solve [` [$var3][$var2]=[$var4] `] for [`[$var2]`]. + [_______] + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form $var2 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] + [$r][$var1] &= [$s] \\ + \frac{[$r][$var1]}{[$r]} &= \frac{[$s]}{[$r]} \\ + [$var1] &= [$ans1] \\ +\end{aligned} +`] + + The solution to the equation is [`[$ans1]`]; we can check our work by + substituting [`[$ans1]`] into the original equation for [`[$var1]`]; this is left as an exercise. + +b) [` +\begin{aligned}[t] + [$var3][$var2] &= [$var4] \\ + \frac{[$var3][$var2]}{[$var3]} &= \frac{[$var4]}{[$var3]} \\ + [$var2] &= [$ans2] \\ +\end{aligned} +`] + + The solution to the equation is [`[$ans2]`]; we can check our work by + substituting [`[$ans2]`] into the original equation for [`[$var2]`]; this is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation50.pg new file mode 100644 index 0000000000..64dfffa69b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation50.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of x/m = b +# +# Last updated: Jordan 7/23/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','multiply') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); +Context()->noreduce('(-x)-y','(-x)+y'); + +$r=random(3,9,2); +$s=random(2,10,2); +$ans1 = $r*$s; + +Context("Numeric"); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real', $var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US or $var2 = $US$US$US"; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans2 = Compute("$var3 $var4")->reduce; +$ansEq1=Formula("$var1=$ans1"); +$ansEq2=Formula("$var2=$ans2"); + + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + + +a. Solve [` \frac{[$var1]}{[$r]}=[$s] `] for [`[$var1]`]. + [_______] + +a. Solve [` \frac{[$var2]}{[$var3]}=[$var4] `] for [`[$var2]`]. + [_______] + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form $var2 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] + \frac{[$var1]}{[$r]} &= [$s] \\ + [$r] \cdot \frac{[$var1]}{[$r]} &= [$r] \cdot [$s] \\ + [$var1] &= [$ans1] \\ +\end{aligned} +`] + + The solution to the equation is [`[$ans1]`]; we can check our work by + substituting [`[$ans1]`] into the original equation for [`[$var1]`]; this is left as an exercise. + +b) [` +\begin{aligned}[t] + \frac{[$var2]}{[$var3]} &=\; [$var4] \\ + [$var3] \cdot \frac{[$var2]}{[$var3]} &=\; [$var3] \cdot [$var4] \\ + [$var2] &=\; [$ans2] \\ +\end{aligned} +`] + + The solution to the equation is [`[$ans2]`]; we can check our work by + substituting [`[$ans2]`] into the original equation for [`[$var2]`]; this is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation60.pg new file mode 100644 index 0000000000..24995b700b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation60.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of ax+b=c +# +# Last updated: Jordan 7/23/13; Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','subtract','divide') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); +do {$var5 = RandomVariableName()} until (($var5 ne $var1) and ($var5 ne $var2) and ($var5 ne $var3) and ($var5 ne $var4)); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$r=random(2,10,1); +$ans1 = non_zero_random(1,10,1); +$s=random(2,10,1); +$t=$r*$ans1+$s; + +Context("Numeric"); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real', $var4=>'Real',$var5=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US or $var2 = $US$US$US"; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans2 = Compute("($var5-$var4)/$var3")->reduce; +$ansEq1=Formula("$var1=$ans1"); +$ansEq2=Formula("$var2=$ans2"); + + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +a. Solve [` [$r][$var1]+[$s]=[$t] `] for [`[$var1]`]. + [_______] + +a. Solve [` [$var3][$var2]+[$var4]=[$var5] `] for [`[$var2]`]. + [_______] + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form $var2 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned} + [$r][$var1] +[$s] &= [$t] \\ + [$r][$var1] +[$s]\mathbf{{}-[$s]} &= [$t]\mathbf{{}-[$s]} \\ + [$r][$var1] &= [$t-$s] \\ + \frac{[$r][$var1]}{[$r]} &= \frac{[$t-$s]}{[$r]} \\ + [$var1] &= [$ans1] +\end{aligned} +`] + + + The solution to the equation is [`[$ans1]`]; we can check our work by + substituting [`[$ans1]`] into the original equation for [`[$var1]`]; this is left as an exercise. + +b) [` +\begin{aligned}[t] + [$var3][$var2]+[$var4] &= [$var5] \\ + [$var3][$var2] +[$var4]\mathbf{{}-[$var4]} &=[$var5]\mathbf{{}-[$var4]} \\ + [$var3][$var2] &= [$var5]-[$var4] \\ + \frac{[$var3][$var2]}{[$var3]} &= \frac{[$var5]-[$var4]}{[$var3]} \\ + [$var2] & = [$ans2] +\end{aligned} +`] + + The solution to the equation is [`[$ans2]`]; we can check our work by + substituting [`[$ans2]`] into the original equation for [`[$var2]`]; this is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation70.pg new file mode 100644 index 0000000000..4029c950da --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation70.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of cd=e for c, and then cd=e for d +# +# Last updated: Jordan 7/23/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','divide') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context("Numeric"); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real',); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US or $var2 = $US$US$US"; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + +$ans1 = Compute("$var3/$var2")->reduce; +$ans2 = Compute("$var3/$var1")->reduce; + +$ansEq1=Formula("$var1=$ans1"); +$ansEq2=Formula("$var2=$ans2"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +a. Solve [` [$var1][$var2] = [$var3] `] for [`[$var1]`]. + [_______] + + +b. Solve [` [$var1][$var2] = [$var3] `] for [`[$var2]`]. + [_______] + + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form $var2 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +a. [` +\begin{aligned}[t] + [$var1][$var2] &= [$var3] \\ + \frac{[$var1][$var2]}{[$var2]} &= \frac{[$var3]}{[$var2]} \\ + [$var1] &= [$ans1] \\ +\end{aligned} +`] + + The solution to the equation is [`[$ans1]`]; we can check our work by + substituting [`[$ans1]`] into the original equation for [`[$var1]`]; this is left as an exercise. + +b. [` +\begin{aligned}[t] + [$var1][$var2] &= [$var3] \\ + \frac{[$var1][$var2]}{[$var1]} &= \frac{[$var3]}{[$var1]} \\ + [$var2] &= [$ans2] \\ +\end{aligned} +`] + + The solution to the equation is [`[$ans2]`]; we can check our work by + substituting [`[$ans2]`] into the original equation for [`[$var2]`]; this is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation80.pg new file mode 100644 index 0000000000..e43d0be602 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation80.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of x+y=z for x, and then for y. +# +# Last updated: Jordan 7/13/23; Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','subtract') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable)} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context("Numeric"); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real',); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US or $var2 = $US$US$US"; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + +$ans1 = Compute("$var3-$var2")->reduce; +$ans2 = Compute("$var3-$var1")->reduce; + +$ansEq1=Formula("$var1=$ans1"); +$ansEq2=Formula("$var2=$ans2"); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +a. Solve [` [$var1]+[$var2] = [$var3] `] for [`[$var1]`]. + [_______] + + +a. Solve [` [$var1]+[$var2] = [$var3] `] for [`[$var2]`]. + [_______] + + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form $var2 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +a. [` +\begin{aligned}[t] + [$var1]+[$var2] &= [$var3] \\ + [$var1]+[$var2]\mathbf{{}-[$var2]} &= [$var3]\mathbf{{}-[$var2]} \\ + [$var1] &= [$ans1] \\ +\end{aligned} +`] + + The solution to the equation is [`[$ans1]`]; we can check our work by + substituting [`[$ans1]`] into the original equation for [`[$var1]`]; this is left as an exercise. + +b. [` +\begin{aligned}[t] + [$var1]+[$var2] &= [$var3] \\ + [$var1]+[$var2]\mathbf{{}-[$var1]} &= [$var3]\mathbf{{}-[$var1]} \\ + [$var2] &= [$ans2] \\ +\end{aligned} +`] + + The solution to the equation is [`[$ans2]`]; we can check our work by + substituting [`[$ans2]`] into the original equation for [`[$var2]`]; this is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation90.pg new file mode 100644 index 0000000000..79fc9713f5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation90.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equations (with letters) +# in the form of ax+b=c for b, and then for a +# +# Last updated: Jordan 7/23/13; Kling, 7/22/13; Hughes 7/3/13, Carl Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','formula','subtract','divide') +## DBCCSS('A-REI.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName()} until ($var2 ne $var1); +do {$var3 = RandomVariableName(type=>variable)} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context("Numeric"); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real', $var4=>'Real'); +parser::Assignment->Allow; +Context()->flags->set(reduceConstantFunctions=>0,formatStudentAnswer=>parsed);Context()->{error}{msg}{"The left side of an assignment must be a variable or function"} + = "Your answer should be in the form $var1 = $US$US$US or $var2 = $US$US$US"; +Context()->{error}{msg}{"The right side of an assignment must not include the variable being defined"} + = "The right side must not include the variable being defined"; + + +$ans1 = Compute("$var4-$var2 $var3")->reduce; +$ans2 = Compute("($var4-$var1)/$var3")->reduce; + +$ansEq1=Formula("$var1=$ans1"); +$ansEq2=Formula("$var2=$ans2"); + + + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +a. Solve [` [$var2][$var3]+[$var1]=[$var4] `] for [`[$var1]`]. + [_______] + +a. Solve [` [$var2][$var3]+[$var1]=[$var4] `] for [`[$var2]`]. + [_______] + +END_PGML + +ANS($ansEq1->cmp(cmp_class=>"an equation of the form $var1 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans1" => ["You have the solution, but answers to questions like this should be in the form $var1 = $US$US$US" , replaceMessage => 1] + )) + ); + +ANS($ansEq2->cmp(cmp_class=>"an equation of the form $var2 = $US$US$US") -> + withPostFilter(AnswerHints( + "$ans2" => ["You have the solution, but answers to questions like this should be in the form $var2 = $US$US$US" , replaceMessage => 1] + )) + ); + +############################################## + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] + [$var2][$var3]+[$var1] &= [$var4] \\ + [$var2][$var3]+[$var1]\mathbf{{} -[$var2][$var3]} &= [$var4] \mathbf{{} -[$var2][$var3]} \\ + [$var1] &= [$ans1] \\ +\end{aligned} +`] + + The solution to the equation is [`[$ans1]`]; we can check our work by + substituting [`[$ans1]`] into the original equation for [`[$var1]`]; this is left as an exercise. + +b) [` +\begin{aligned}[t] + [$var2][$var3]+[$var1] &= [$var4] \\ + [$var2][$var3]+[$var1]\mathbf{{}-[$var1]} &= [$var4] \mathbf{{}-[$var1]} \\ + [$var2][$var3] & = [$var4]-[$var1] \\ + \frac{[$var2][$var3]}{[$var3]} &= \frac{[$var4]-[$var1]}{[$var3]} \\ + [$var2] &= [$ans2] +\end{aligned} +`] + + The solution to the equation is [`[$ans2]`]; we can check our work by + substituting [`[$ans2]`] into the original equation for [`[$var2]`]; this is left as an exercise. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction05.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction05.pg new file mode 100644 index 0000000000..d0a8142f41 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction05.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# solve equations like x/2+3=4x; +# +# Last edited: Kling, 7/18/2013; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$ans = $a*list_random((2,3,4,5,6)); +$c=random(2,5,1); +$b= $c*$ans-$ans/$a; + +$left = Formula("$var/$a+$b"); +$right = Formula("$c*$var"); +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + + +$step1 = $a*$b; +$step2 = $a*$c; +$s3=$step2-1; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + \frac{[$var]}{[$a]} +[$b] &=[$c][$var] \\ + [$a] \cdot \left(\frac{[$var]}{[$a]} +[$b]\right) &=[$a] \cdot [$c][$var] \\ +[$a] \cdot \frac{[$var]}{[$a]} +[$a] \cdot[$b] &=[$a] \cdot [$c][$var] \\ + [$var] +[$step1] &= [$step2][$var] \\ +[$var] +[$step1]\mathbf{{}-[$var]} &= [$step2][$var] \mathbf{{}-[$var]} \\ + [$step1] &=[$s3][$var] \\ + \frac{[$step1]}{[$s3]} &= \frac{[$s3][$var]}{[$s3]} \\ + [$ans] &= [$var]\\ + [$var] &=[$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction10.pg new file mode 100644 index 0000000000..c907dc27f8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction10.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# solve equations like x/2+3=4; +# +# Last edited: Kling, 7/18/13; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$ans = $a*list_random((2,3,4,5,6)); +$b=random(1,10,1); +$c= $ans/$a+$b; + +$left = Formula("$var/$a+$b"); +$right = Formula("$c"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $a*$b; +$step2 = $a*$c; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + \frac{[$var]}{[$a]} +[$b] &= [$c] \\ +[$a] \cdot \left(\frac{[$var]}{[$a]} +[$b]\right) &= [$a] \cdot [$c] \\ + [$a] \cdot \frac{[$var]}{[$a]} +[$a] \cdot [$b] &= [$a] \cdot [$c] \\ + [$var] +[$step1] &= [$step2] \\ + [$var]+[$step1]\mathbf{{}-[$step1]} &= [$step2]\mathbf{{}-[$step1]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction100.pg new file mode 100644 index 0000000000..99e21c0242 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction100.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 4/3-(1/3)x=8; +# +# Last edited: Kling, 7/18/13; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random(2,10,2); +$num=random(3,9,2); +while (gcd($den,$num)!=1) {$num=random(3,9,2);} + +$b= random(1,10,1); +$ans = $num-$den*$b; + +$frac1 = Fraction($num,$den); +$frac2 = Fraction(1,$den); +$left = Formula("$frac1-$frac2*$var"); +$right = Formula("$b"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den*$b; +$step2 = $step1 - $num; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + \frac{[$num]}{[$den]} - \frac{1}{[$den]}[$var] &= [$b] \\ + [$den] \cdot \left(\frac{[$num]}{[$den]} - \frac{1}{[$den]}[$var]\right) &=[$den] \cdot [$b] \\ + [$den] \cdot \frac{[$num]}{[$den]} - [$den] \cdot \left(\frac{1}{[$den]}[$var]\right) &=[$den] \cdot [$b] \\ + [$num] - [$var] &= [$step1] \\ + [$num] - [$var]\mathbf{{}-[$num]}&= [$step1]\mathbf{{}-[$num]} \\ + -[$var] &= [$step2] \\ + (-1) \cdot (-[$var]) &= (-1) \cdot [$step2] \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction110.pg new file mode 100644 index 0000000000..a031e566fe --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction110.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like (2x/3)-4= -5/3; +# +# Last edited: Kling, 7/18/13; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGcourse.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random(3,9,2); +$num=random(2,8,2); +while (gcd($den,$num)!=1) {$num=random(2,8,2);} + +$a= random(3,10,1); +do { + $ans = non_zero_random(-10,10,1); + $b= $num*$ans-$a*$den; +} until (($b<0) && (gcd($b,$den)==1)); +$b = -$b; + +$left = Formula("$num*$var/$den-$a"); +$frac = Fraction($b,$den); +$right = Formula("-$frac"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den*$a; +$step2 = -$b+$step1; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + \frac{[$num][$var]}{[$den]} - [$a] &= -\frac{[$b]}{[$den]} \\ + [$den] \cdot \left(\frac{[$num][$var]}{[$den]} - [$a]\right) &= [$den] \cdot \left(-\frac{[$b]}{[$den]}\right) \\ + [$den] \cdot \frac{[$num][$var]}{[$den]} -[$den] \cdot [$a] &= [$den] \cdot \left(-\frac{[$b]}{[$den]}\right) \\ + [$num][$var] - [$step1] &= -[$b] \\ + [$num][$var] - [$step1]\mathbf{{}+[$step1]} &= -[$b]\mathbf{{}+[$step1]} \\ + [$num][$var] &= [$step2] \\ + \frac{[$num][$var]}{[$num]} &= \frac{[$step2]}{[$num]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction120.pg new file mode 100644 index 0000000000..e2af0abf9c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction120.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 4/3+(8/3)x=7x; answer is a fraction. +# +# Last edited: Kling, 7/18/13; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random(5,9,2); +$num1 = random(2,10,2); +while (gcd($den,$num1)!=1) {$num1=random(2,10,2);} + +$num2 = random(2,10,2); +while (gcd($den,$num1)!=1 || $num2==$num1) {$num2=random(2,10,2);} + +$b= random(3,9,2); +$ans = Fraction($num1,$b*$den-$num2)->reduce; +@answ = $ans->value; +$ansNum = $answ[0]; +$ansDen = $answ[1]; + +$frac1 = Fraction($num1,$den); +$frac2 = Fraction($num2,$den); +$left = Formula("$frac1+$frac2*$var"); +$right = Formula("$b*$var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den*$b; +$step2 = $step1 - $num2; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + \frac{[$num1]}{[$den]} + \frac{[$num2]}{[$den]}[$var] &= [$b][$var] \\ + [$den] \cdot \left(\frac{[$num1]}{[$den]} + \frac{[$num2]}{[$den]}[$var]\right) &= [$den] \cdot [$b][$var] \\ +[$den] \cdot \frac{[$num1]}{[$den]} + [$den] \cdot \frac{[$num2]}{[$den]}[$var] &= [$den] \cdot [$b][$var] \\ + [$num1] + [$num2][$var] &= [$step1][$var] \\ + [$num1] + [$num2][$var]\mathbf{{}-[$num2][$var]} &= [$step1][$var]\mathbf{{}-[$num2][$var]} \\ + [$num1] &= [$step2][$var] \\ + \frac{[$num1]}{[$step2]} &= \frac{[$step2][$var]}{[$step2]} \\ + \frac{[$ansNum]}{[$ansDen]} &= [$var]\\ + [$var] & = \frac{[$ansNum]}{[$ansDen]} +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction130.pg new file mode 100644 index 0000000000..9cefdee9b4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction130.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like (2x/3)-4/3= (-5/3)x; answer is an integer. +# +# Last edited: Kling, 7/18/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$num1=random(2,5,1); +do {$num3=random(1,5,1);} until ($num3!=$num1); + +$ans=non_zero_random(2,5,1); +$num2 = $num1*$ans+$num3*$ans; + +#make sure the fraction won't be reduced, so all 3 denominators are the same. +$den=3; +while ((gcd($num1,$den)!=1) || (gcd($num2,$den)!=1) || (gcd($num3,$den)!=1)) + {$den=$den+2;} + +$frac2 = Fraction($num2,$den); +$frac3 = Fraction($num3,$den); +$left = Formula("$num1*$var/$den-$frac2"); +$right = Formula("-$frac3*$var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $num1+$num3; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + +[`` +\begin{aligned} + \frac{[$num1][$var]}{[$den]} - \frac{[$num2]}{[$den]} &=-\frac{[$num3]}{[$den]}[$var] \\ + [$den] \cdot \left(\frac{[$num1][$var]}{[$den]} - \frac{[$num2]}{[$den]}\right) &= [$den] \cdot \left(-\frac{[$num3]}{[$den]}[$var]\right) \\ + [$den] \cdot \frac{[$num1][$var]}{[$den]} - [$den] \cdot \left( \frac{[$num2]}{[$den]}\right) &= [$den] \cdot \left(-\frac{[$num3]}{[$den]}[$var]\right) \\ + [$num1][$var] - [$num2] &=-[$num3][$var] \\ + [$num1][$var] - [$num2]\mathbf{{} -[$num1][$var]} &=-[$num3][$var]\mathbf{{} -[$num1][$var]} \\ + - [$num2] &=-[$step1][$var] \\ + \frac{-[$num2]}{-[$step1]} &=\frac{-[$step1][$var]}{-[$step1]} \\ + [$ans] &= [$var]\\ + [$var] &= [$ans] +\end{aligned} +``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction140.pg new file mode 100644 index 0000000000..1045669da1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction140.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 2x/3+3/4=x, answer is fraction. +# +# Last edited: Kling, 7/18/13; Hughes 7/1/13, Wherry, 6/28/2013 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(3,9,2); +#make sure the answer is positive +$num1 = random(2,$den1-1,2); +while (gcd($den1,$num1)!=1) {$num1=random(2,10,2);} + +$den2 = random(2,10,2); +$num2 = random(1,9,2); +while (gcd($den2,$num2)!=1) {$num2=random(1,9,2);} + +$ans = Fraction(-1*$den1*$num2,$num1*$den2-$den1*$den2)->reduce; +@answ = $ans->value; +$ansNum = $answ[0]; +$ansDen = $answ[1]; + +$com = lcm($den1,$den2); + +$frac2 = Fraction($num2,$den2); +$left = Formula("$num1*$var/$den1+$frac2"); +$right = Formula("$var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $com*$num1/$den1; +$step2 = $com*$num2/$den2; +$step3 = $com-$step1; + +if ($ansDen!=1) {$ansOutput = "\frac{$ansNum}{$ansDen}";} +else {$ansOutput = "$ansNum";} + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by a common denominator. For this problem, a common denominator is [`[$com]`]. + + [`` +\begin{aligned} + \frac{[$num1][$var]}{[$den1]} + \frac{[$num2]}{[$den2]} &= [$var] \\ + [$com] \cdot \left(\frac{[$num1][$var]}{[$den1]} + \frac{[$num2]}{[$den2]}\right) &= [$com] \cdot [$var] \\ +[$com] \cdot \frac{[$num1][$var]}{[$den1]} + [$com] \cdot \frac{[$num2]}{[$den2]} &= [$com] \cdot [$var] \\ + [$step1][$var] + [$step2] &= [$com][$var] \\ + [$step1][$var] + [$step2]\mathbf{{}-[$step1][$var]} &= [$com][$var]\mathbf{{}-[$step1][$var]} \\ + [$step2] &= [$step3][$var] \\ + \frac{[$step2]}{[$step3]} &= \frac{[$step3][$var]}{[$step3]} \\ + [$ansOutput] &= [$var]\\ + [$var] & = [$ansOutput] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction150.pg new file mode 100644 index 0000000000..a252d2b860 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction150.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like (2x/3)-4= (-5/4) x; answer is an integer. +# +# Last edited: Kling 7/18/13; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(3,7,2); +$num1 = random(2,6,2); +while (gcd($den1,$num1)!=1) {$num1=random(2,6,2);} + +$den2 = random(2,6,2); +$num2 = random(1,5,2); +while (gcd($den2,$num2)!=1) {$num2=random(1,5,2);} + +$com=lcm($den1,$den2); +$ans = $com*list_random((1,2,3)); +$a= $num1*$ans/$den1+$num2*$ans/$den2; +while ($a==0) { +$ans = $com*list_random((1,2,3)); +$a= $num1*$ans/$den1+$num2*$ans/$den2; +} + +$frac2 = Fraction($num2,$den2); +$left = Formula("$num1*$var/$den1-$a"); +$right = Formula("-$frac2*$var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $num1*$com/$den1; +$step2 = $num2*$com/$den2; +$step3 = $com*$a; +$step4 = $step2+$step1; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by a common denominator. In this problem, a common denominator is [`[$com]`]. + + [`` +\begin{aligned} + \frac{[$num1][$var]}{[$den1]} - [$a] &=-\frac{[$num2]}{[$den2]}[$var] \\ + [$com] \cdot \left(\frac{[$num1][$var]}{[$den1]} - [$a]\right) &= [$com] \cdot \left(-\frac{[$num2]}{[$den2]}[$var]\right) \\ + [$com] \cdot \frac{[$num1][$var]}{[$den1]} - [$com] \cdot [$a] &= [$com] \cdot \left(-\frac{[$num2]}{[$den2]}[$var]\right) \\ + [$step1][$var] - [$step3] &= -[$step2][$var] \\ + [$step1][$var] - [$step3]\mathbf{{} -[$step1][$var]} &= -[$step2][$var]\mathbf{{} -[$step1][$var]} \\ + -[$step3] &= -[$step4][$var] \\ + \frac{-[$step3]}{-[$step4]} &= \frac{-[$step4]}{-[$step4]} \\ + [$ans] &= [$var]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction160.pg new file mode 100644 index 0000000000..eaac36470e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction160.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like (-2/3)x+4= (5/6) x; answer is an integer. +# +# Last updated: Kling 7/18/13; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGcourse.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "contextFraction.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $den1 = random(2,10,2); + $num1 = random(1,9,1); + while (gcd($den1,$num1)!=1) {$num1=random(1,9,1);} + + $den2 = 2*$den1; + $num2 = random(2,9,1); +} while (gcd($den2,$num2)!=1); + +do { + $ans = $den2*list_random((1,2,3)); + $a= $num2*$ans/$den2+$num1*$ans/$den1; +} while ($a==0); + +$frac1 = Fraction($num1,$den1); +$left = Formula("-$frac1*$var+$a"); +$right = Formula("$num2*$var/$den2"); + + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $num1*$den2/$den1; +$step2 = $den2*$a; +$step3 = $num2+$step1; + +BEGIN_PGML_SOLUTION + +To clear fractions from an equation, multiply each side of the equation by a common denominator. In this problem, a common denominator is [`[$den2]`]. + + [`` +\begin{aligned} + -\frac{[$num1]}{[$den1]}[$var] + [$a] &= \frac{[$num2][$var]}{[$den2]} \\ +[$den2] \cdot \left(-\frac{[$num1]}{[$den1]}[$var] + [$a]\right) &= [$den2] \cdot \frac{[$num2][$var]}{[$den2]} \\ + [$den2] \cdot \left(-\frac{[$num1]}{[$den1]}[$var]\right) + [$den2] \cdot [$a] &= [$den2] \cdot \frac{[$num2][$var]}{[$den2]} \\ + -[$step1][$var] + [$step2] &= [$num2][$var] \\ + -[$step1][$var] + [$step2]\mathbf{{}+[$step1][$var]} &= [$num2][$var]\mathbf{{}+[$step1][$var]} \\ + [$step2] &= [$step3][$var] \\ + \frac{[$step2]}{[$step3]} &=\frac{[$step3][$var]}{[$step3]} \\ + [$ans] &= [$var]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction170.pg new file mode 100644 index 0000000000..71fdea2b30 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction170.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 5x/4-6x=3/8; answer is a fraction or integer. +# +# Last edited: Kling, 7/18/13; Jordan, 7/10/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,10,2); +$num1 = random(3,9,2); +while (gcd($den1,$num1)!=1) {$num1=random(3,9,2);} + +$den2 = 2*$den1; +$num2 = random(3,9,2); +while (gcd($den2,$num2)!=1) {$num2=random(3,9,2);} + +#adjust $a's value to make the solution negative +$a=random(5,10,1); +$ans = Fraction($num2*$den1,$num1*$den2-$a*$den1*$den2)->reduce; +@answ = $ans->value; +$ansNum = -$answ[0]; +$ansDen = $answ[1]; + +$frac2 = Fraction($num2,$den2); +$left = Formula("$num1*$var/$den1-$a*$var"); +$right = Formula("$frac2"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den2*$num1/$den1; +$step2 = $a*$den2; +$step3 = $step1-$step2; +if ($ansDen!=1) {$ansOutput="-\frac{$ansNum}{$ansDen}";} +else {$ansOutput="-$ansNum";} + +BEGIN_PGML_SOLUTION + +To clear fractions from an equation, multiply each side of the equation by a common denominator. For this problem, a common denominator is [`[$den2]`]. + + [`` +\begin{aligned} + \frac{[$num1][$var]}{[$den1]} - [$a][$var] &= \frac{[$num2]}{[$den2]} \\ + [$den2] \cdot \left(\frac{[$num1][$var]}{[$den1]} - [$a][$var]\right) &= [$den2] \cdot \frac{[$num2]}{[$den2]} \\ + [$den2] \cdot \frac{[$num1][$var]}{[$den1]} - [$den2] \cdot [$a][$var] &= [$den2] \cdot \frac{[$num2]}{[$den2]} \\ + [$step1][$var] - [$step2][$var] &= [$num2] \\ + [$step3][$var] &= [$num2] \\ + \frac{[$step3][$var]}{[$step3]} &= \frac{[$num2]}{[$step3]} \\ + [$var] &= [$ansOutput] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction180.pg new file mode 100644 index 0000000000..49e4f78ea0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction180.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 5x/4+4/5=(2/3)x; answer is a fraction or integer. +# +# Last edited: Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,6,2); +#make sure the first fraction is >1. +$num1 = random($den1+1,9,2); +while (gcd($den1,$num1)!=1) {$num1=random($den1+1,9,2);} + +$den2 = random(3,9,2); +$num2 = random(2,8,2); +while (gcd($den2,$num2)!=1) {$num2=random(2,8,2);} + +$den3 = random(4,8,2); +while ($den3==$den1) {$den3 = random(4,8,2);} +#make sure the third fraction is <1, so the answer is negative. +$num3 = random(1,$den3-1,2); +while (gcd($den3,$num3)!=1) {$num3 = random(1,$den3-1,2);} + +$ans = Fraction($num2*$den1*$den3,$num3*$den1*$den2-$num1*$den2*$den3)->reduce; +@answ = $ans->value; +#for display solution purposes, change numerator to positive +$ansNum = -$answ[0]; +$ansDen = $answ[1]; + +$com = lcm(lcm($den1,$den2),$den3); + +$frac2=Fraction($num2,$den2); +$frac3=Fraction($num3,$den3); +$left = Formula("$num1*$var/$den1+$frac2"); +$right = Formula("$frac3*$var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $com*$num1/$den1; +$step2 = $com*$num2/$den2; +$step3 = $com*$num3/$den3; +$step4 = $step3-$step1; +if ($ansDen!=1) {$ansOutput="-\frac{$ansNum}{$ansDen}";} +else {$ansOutput="-$ansNum";} + +BEGIN_PGML_SOLUTION + +To clear fractions from an equation, multiply all terms by a common denominator. For this problem, a common denominator is [`[$com]`]. + + [`` +\begin{aligned} + \frac{[$num1][$var]}{[$den1]} + \frac{[$num2]}{[$den2]} &= \frac{[$num3]}{[$den3]}[$var] \\ + [$com] \cdot \frac{[$num1][$var]}{[$den1]} + [$com] \cdot \frac{[$num2]}{[$den2]} &= [$com] \cdot \frac{[$num3]}{[$den3]}[$var] \\ + [$step1][$var] + [$step2] &= [$step3][$var] \\ + [$step1][$var] + [$step2] \mathbf{-[$step1][$var]} &= [$step3][$var] \mathbf{-[$step1][$var]}\\ + [$step2] &= [$step4][$var] \\ + \frac{[$step2]}{[$step4]} &= \frac{[$step4][$var]}{[$step4]} \\ + [$ansOutput] &= [$var]\\ + [$var] & = [$ansOutput] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction190.pg new file mode 100644 index 0000000000..ba77849588 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction190.pg @@ -0,0 +1,129 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 5x/4= -4/5+(2/3)x; answer is a fraction. +# +# Last edited: Kling 7/18/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,7,1); +$den2 = random(2,7,1); +while (gcd($den1,$den2)!=1) {$den2 = random(2,7,1);} +$den3 = random(2,7,1); +while ((gcd($den2,$den3)!=1) || (gcd($den1,$den3)!=1)) + {$den3 = random(2,7,1);} + +$num1=random(1,5,1); +while (gcd($num1,$den1)!=1) {$num1=random(1,5,1);} +$num2=random(1,5,1); +while (gcd($num2,$den2)!=1) {$num2=random(1,5,1);} +$num3=random(2,5,1); +while (gcd($num3,$den3)!=1) {$num3=random(2,5,1);} + +$com=$den1*$den2*$den3; + +$ans=Fraction($num2*$den1*$den3,$num1*$den2*$den3-$num3*$den1*$den2); +@answ = $ans->value; +$ansNum = $answ[0]; +$ansDen = $answ[1]; + +$frac1 = Fraction($num1,$den1); +$frac2 = Fraction($num2,$den2); +$left = Formula("$frac1*$var"); +$right = Formula("$frac2+$num3*$var/$den3"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $com*$num1/$den1; +$step2 = $com*$num2/$den2; +$step3 = $com*$num3/$den3; +$step4 = $step1-$step3; + +if ($ansNum>0) { + $output = "\frac{$ansNum}{$ansDen}"; +} else { + $ansNum=-$ansNum; + $output = "-\frac{$ansNum}{$ansDen}"; +} + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by a common denominator. For this problem, a common denominator is [`[$com]`]. + + [`` +\begin{aligned} + \frac{[$num1]}{[$den1]}[$var] &= \frac{[$num2]}{[$den2]} + \frac{[$num3][$var]}{[$den3]} \\ +[$com] \cdot \frac{[$num1]}{[$den1]}[$var] &= [$com] \cdot \left(\frac{[$num2]}{[$den2]} + \frac{[$num3][$var]}{[$den3]}\right) \\ + [$com] \cdot \frac{[$num1]}{[$den1]}[$var] &= [$com] \cdot \left(\frac{[$num2]}{[$den2]}\right) + [$com] \cdot \frac{[$num3][$var]}{[$den3]} \\ + [$step1][$var] &= [$step2] + [$step3][$var] \\ + [$step1][$var] \mathbf{-[$step3][$var]} &= [$step2] + [$step3][$var] \mathbf{-[$step3][$var]} \\ + [$step4][$var] &= [$step2] \\ + \frac{[$step4][$var]}{[$step4]} &= \frac{[$step2]}{[$step4]} \\ + [$var] &= [$output] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction20.pg new file mode 100644 index 0000000000..f18abcaa12 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction20.pg @@ -0,0 +1,168 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# solve equations like -x/2+3=4; +# +# Last edited: Kling, 7/18/13; Hughes, 7/1/13; Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName()} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); +Context()->variables->are($var1 => 'Real',$var2 => 'Real',$var3 => 'Real',$var4 => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$ans1 = $a*list_random((2,3,4,5,6)); +$b=random(1,10,1); +$c= -$ans1/$a+$b; + +$ans2=-$ans1; + +$left1=Formula("-($var1/$a)+$b"); +$right1=Formula("$c"); +$left2=Formula("(-$var2)/$a+$b"); +$right2=Formula("$c"); +$left3=Formula("$var3/(-$a)+$b"); +$right3=Formula("$c"); +$left4=Formula("(-$var4)/(-$a)+$b"); +$right4=Formula("$c"); + +@vArray = ($var1, $var2, $var3, $var4); +@aArray = ($ans1, $ans1, $ans1, $ans2); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + +a) [`` [$left1]=[$right1] ``] + + [_______] + + +b) [`` [$left2]=[$right2] ``] + + [_______] + + +c) [`` [$left3]=[$right3] ``] + + [_______] + + +d) [`` [$left4]=[$right4] ``] + + [_______] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $a*$b; +$step2 = $a*$c; +$step3 = $step2-$step1; + +BEGIN_PGML_SOLUTION + +To clear fractions from an equation, multiply each side of the equation by a common denominator. + +a) [`` +\begin{aligned}[t] + -\frac{[$var1]}{[$a]} +[$b] &= [$c] \\ + [$a] \cdot \left(-\frac{[$var1]}{[$a]} +[$b]\right) &= [$a] \cdot [$c] \\ +[$a] \cdot \left(-\frac{[$var1]}{[$a]}\right) +[$a] \cdot [$b] &= [$a] \cdot [$c] \\ + -[$var1] +[$step1] &= [$step2] \\ + -[$var1] +[$step1]\mathbf{{}-[$step1]} &= [$step2]\mathbf{{}-[$step1]} \\ + -[$var1] &= [$step3] \\ + (-1) \cdot (-[$var1]) &= (-1) \cdot ([$step3]) \\ + [$var1] &= [$ans1] +\end{aligned} +``] +[@summary($ansEqRef->[0],$left1,$right1);@]** +---- + +b) [`` +\begin{aligned}[t] + \frac{-[$var2]}{[$a]} +[$b] &= [$c] \\ +[$a] \cdot \left(\frac{-[$var2]}{[$a]} + [$b]\right) &= [$a] \cdot [$c]\\ + [$a] \cdot \frac{-[$var2]}{[$a]} +[$a] \cdot [$b] &= [$a] \cdot [$c] \\ + -[$var2] +[$step1] &= [$step2] \\ + -[$var2] +[$step1]\mathbf{{}-[$step1]} &= [$step2]\mathbf{{}-[$step1]} \\ + -[$var2] &= [$step3] \\ + (-1) \cdot (-[$var2]) &=(-1) \cdot ([$step3]) \\ + [$var2] &=[$ans1] +\end{aligned} +``] +[@summary($ansEqRef->[1],$left2,$right2);@]** +---- + +c) [``\begin{aligned}[t] + \frac{[$var3]}{-[$a]} +[$b] &= [$c] \\ + (-[$a]) \cdot \left(\frac{[$var3]}{-[$a]} +[$b]\right) &=(-[$a]) \cdot [$c] \\ + (-[$a]) \cdot \frac{[$var3]}{-[$a]} +(-[$a]) \cdot [$b] &=(-[$a]) \cdot [$c] \\ + [$var3] -[$step1] &= -[$step2] \\ + [$var3] -[$step1]\mathbf{{}+[$step1]}&= -[$step2]\mathbf{{}+[$step1]} \\ + [$var3] & = [$ans1] +\end{aligned} +``] +[@summary($ansEqRef->[2],$left3,$right3);@]** +---- + +d) [``\begin{aligned}[t] + \frac{-[$var4]}{-[$a]} +[$b] &= [$c] \\ + \frac{[$var4]}{[$a]} +[$b] &= [$c] \\ + [$a] \cdot \left(\frac{[$var4]}{[$a]} +[$b]\right) &= [$a] \cdot [$c] \\ + [$a] \cdot \frac{[$var4]}{[$a]} +[$a] \cdot [$b] &= [$a] \cdot [$c] \\ + [$var4] +[$step1] &= [$step2] \\ + [$var4]+[$step1]\mathbf{{}-[$step1]} &= [$step2]\mathbf{{}-[$step1]} \\ + [$var4] &=[$ans2] +\end{aligned} + ``] +[@summary($ansEqRef->[3],$left4,$right4);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction200.pg new file mode 100644 index 0000000000..f29bd733a6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction200.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 4/3=x/12; answer is an integer. +# +# Last updated: Kling, 7/21/13; Jordan 7/17/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,10,2); +$num1 = random(3,9,2); +while (gcd($den1,$num1)!=1) {$num1 = random(3,9,2);} + +$den2 = $den1*random(2,6,1); +$ans = $den2*$num1/$den1; + +$frac1 = Fraction($num1,$den1); +$left = Formula("$frac1"); +$right = Formula("$var/$den2"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each side of the equation by a common denominator. For this problem, a common denominator is [$den2]. + + [`` +\begin{aligned} + \frac{[$num1]}{[$den1]} &= \frac{[$var]}{[$den2]} \\ + [$den2] \cdot \frac{[$num1]}{[$den1]} &= [$den2] \cdot \frac{[$var]}{[$den2]} \\ + [$ans] &= [$var]\\ + [$var]&=[$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction210.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction210.pg new file mode 100644 index 0000000000..342c80763d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction210.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like -x/12=4/3; answer is an integer. +# +# Last updated: Kling, 7/21/13; Jordan 7/17/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(3,9,2); +$num1 = random(2,10,2); +while (gcd($den1,$num1)!=1) {$num1 = random(2,10,2);} + +$den2 = $den1*random(2,6,1); +$ans = -$den2*$num1/$den1; + +$frac1 = Fraction($num1,$den1); +$left = Formula("-($var/$den2)"); +$right = Formula("$frac1"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den2*$num1/$den1; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each side of the equation by a common denominator. For this problem, a common denominator is [$den2]. + + [`` +\begin{aligned} + -\frac{[$var]}{[$den2]} &= \frac{[$num1]}{[$den1]} \\ + [$den2] \cdot \left(-\frac{[$var]}{[$den2]}\right) &= [$den2] \cdot \frac{[$num1]}{[$den1]} \\ + -[$var] &= [$step1] \\ + (-1) \cdot -[$var] &= (-1) \cdot [$step1] \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction220.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction220.pg new file mode 100644 index 0000000000..98aa474674 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction220.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like -x/12=-4/3; answer is an integer. +# +# Last updated: Kling, 7/21/13; Jordan 7/19/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,10,2); +$num1 = random(3,9,2); +while (gcd($den1,$num1)!=1) {$num1 = random(3,9,2);} + +$den2 = $den1*random(2,6,1); +$ans = $den2*$num1/$den1; + +$frac1 = Fraction($num1,$den1); +$left = Formula("-($var/$den2)"); +$right = Formula("-$frac1"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den2*$num1/$den1; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each side of the equation by a common denominator. For this problem, a common denominator is [`[$den2]`]. + + [`` +\begin{aligned} + -\frac{[$var]}{[$den2]} &= -\frac{[$num1]}{[$den1]} \\ + (-1) \cdot \left(-\frac{[$var]}{[$den2]}\right) &= (-1) \cdot \left(-\frac{[$num1]}{[$den1]}\right) \\ + \frac{[$var]}{[$den2]} &= \frac{[$num1]}{[$den1]} \\ + [$den2] \cdot \frac{[$var]}{[$den2]} &= [$den2] \cdot \frac{[$num1]}{[$den1]} \\ + [$var] &= [$ans] \\ +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction230.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction230.pg new file mode 100644 index 0000000000..0925a3d024 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction230.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like -9/14=3x/7; answer is an integer or fraction. +# +# Last updated: Kling, 7/21/13; Jordan 7/19/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,10,1); +$num1 = random(3,9,1); +while (gcd($den1,$num1)!=1) {$num1 = random(3,9,1);} + +$den2 = random(2,10,1); +while ($den2==$den1) {$den2 = random(2,10,1);} +$num2 = random(3,9,1); +while (gcd($den2,$num2)!=1) {$num2 = random(3,9,1);} + +$com = lcm($den1,$den2); +$ans = Fraction(-$num1*$den2,$num2*$den1)->reduce; +@answ = $ans->value; +$ansNum = -$answ[0]; +$ansDen = $answ[1]; + +$frac1 = Fraction($num1,$den1); +$left = Formula("-$frac1"); +$right = Formula("$num2*$var/$den2"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $com*$num1/$den1; +$step2 = $com*$num2/$den2; +if ($ansDen!=1) {$ansOutput = "-\frac{$ansNum}{$ansDen}";} + else {$ansOutput = "$ansNum";} + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each term by a common denominator. For this problem, a common denominator is [$com]. + + [`` +\begin{aligned} + -\frac{[$num1]}{[$den1]} &= \frac{[$num2][$var]}{[$den2]} \\ + [$com] \cdot \left(-\frac{[$num1]}{[$den1]}\right) &= [$com] \cdot \frac{[$num2][$var]}{[$den2]} \\ + -[$step1] &= [$step2][$var] \\ + \frac{-[$step1]}{[$step2]} &= \frac{[$step2][$var]}{[$step2]} \\ + [$ansOutput] &= [$var]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction240.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction240.pg new file mode 100644 index 0000000000..bebd260bb1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction240.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 4/3=(x+1)/12; answer is an integer. +# +# Last updated: Kling, 7/21/13; Jordan 7/19/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','subtract') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,10,2); +$num1 = random(3,9,2); +while (gcd($den1,$num1)!=1) {$num1 = random(3,9,2);} + +$a=random(1,10,1); +$den2 = $den1*random(2,6,1); +$ans = $den2*$num1/$den1-$a; + +$frac1 = Fraction($num1,$den1); +$left = Formula("$frac1"); +$right = Formula("($var+$a)/$den2"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den2*$num1/$den1; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each term by a common denominator. For this problem, a common denominator is [`[$den2]`]. + + [`` +\begin{aligned} + \frac{[$num1]}{[$den1]} &= \frac{[$var]+[$a]}{[$den2]} \\ + [$den2] \cdot \frac{[$num1]}{[$den1]} &= [$den2] \cdot \frac{[$var]+[$a]}{[$den2]} \\ + [$step1] &= [$var]+[$a] \\ + [$step1] \mathbf{{}-[$a]}&= [$var]+[$a]\mathbf{{}-[$a]}\\ + [$ans] &= [$var]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction250.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction250.pg new file mode 100644 index 0000000000..47cdd875ba --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction250.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 5/12=(x-1)/3; answer is a fraction. +# +# Last updated: Kling, 7/21/13; Jordan 7/19/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','add') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,10,2); +$num1 = random(3,9,2); +while (gcd($den1,$num1)!=1) {$num1 = random(3,9,2);} + +$den2 = random(3,9,2); +$a = random(1,10,1); +$ans = Fraction($num1*$den2+$a*$den1,$den1)->reduce; +@answ = $ans->value; +$ansNum = $answ[0]; +$ansDen = $answ[1]; + +$com = lcm($den1,$den2); + +$frac1 = Fraction($num1,$den1); +$left = Formula("$frac1"); +$right = Formula("($var-$a)/$den2"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` \frac{[$num1]}{[$den1]} = \frac{[$var]-[$a]}{[$den2]} ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $com*$num1/$den1; +$step2 = $com/$den2; +$step3 = $step2*$a; +$step4 = $step1+$step3; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each term by a common denominator. For this problem, a common denominator is [`[$com]`]. + + [`` +\begin{aligned} + \frac{[$num1]}{[$den1]} &= \frac{[$var]-[$a]}{[$den2]} \\ + [$com] \cdot \frac{[$num1]}{[$den1]} &= [$com] \cdot \frac{[$var]-[$a]}{[$den2]} \\ + [$step1] &= [$step2]([$var]-[$a]) \\ + [$step1] &= [$step2][$var]-[$step2] \cdot [$a] \\ + [$step1] &= [$step2][$var]-[$step3] \\ + [$step1]\mathbf{{}+[$step3]} &= [$step2][$var]-[$step3]\mathbf{{}+[$step3]} \\ + [$step4] &= [$step2][$var] \\ + \frac{[$step4]}{[$step2]} &= \frac{[$step2][$var]}{[$step2]} \\ + \frac{[$ansNum]}{[$ansDen]} &= [$var]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction260.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction260.pg new file mode 100644 index 0000000000..521fdac0fc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction260.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like (x-2)/10=(x+3)/12; answer is an integer. +# +# Last updated: Kling, 7/21/13; Jordan 7/19/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','add','subtract') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,6,2); +$den2 = $den1+2; +$num1 = random(1,10,1); +$num2 = random(1,10,1); + +$ans = ($den1*$num2+$num1*$den2)/2; +$com = lcm($den1,$den2); + +$left = Formula("($var-$num1)/$den1"); +$right = Formula("($var+$num2)/$den2"); + +$s1 = $com/$den1; +$s2 = $com/$den2; +$s3 = $s1*$num1; +$s4 = $s2*$num2; +$s5 = $s1-$s2; +$s6 = $s3+$s4; + +Context("Numeric")->variables->are($var=>'Real'); +$s2var = Formula("$s2 $var")->reduce; +$s5var = Formula("$s5 $var")->reduce; + +$solnString = ''; +if ($s5 != 1) {$solnString = '\\ \frac{[$s5var]}{[$s5]} &= \frac{[$s6]}{[$s5]}\\ [$var] & = [$ans]';}; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each term by a common denominator. For this problem, a common denominator is [`[$com]`]. + + [`` +\begin{aligned} + \frac{[$var]-[$num1]}{[$den1]} &= \frac{[$var]+[$num2]}{[$den2]} \\ + [$com] \cdot \frac{[$var]-[$num1]}{[$den1]} &= [$com] \cdot \frac{[$var]+[$num2]}{[$den2]} \\ + [$s1]([$var]-[$num1]) &= [$s2]([$var]+[$num2]) \\ + [$s1][$var]-[$s1] \cdot [$num1] &= [$s2][$var]+[$s2] \cdot [$num2] \\ + [$s1][$var] - [$s3] &= [$s2var]+[$s4] \\ + [$s1][$var] - [$s3]\mathbf{{} -[$s2var] +[$s3]} &= [$s2var]+[$s4]\mathbf{ -[$s2var] +[$s3]} \\ + [$s5var] &= [$s6] [$solnString]** +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction270.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction270.pg new file mode 100644 index 0000000000..a089067773 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction270.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like (x+2)/10-(x-3)/12=7/5; answer is an integer. +# +# Last updated: Kling, 7/21/13; Jordan 7/19/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','add','subtract','combine') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,6,2); +$den2 = $den1*2; +$num1 = random(1,10,1); +$num2 = random(1,10,1); + +$ans = non_zero_random(-10,10,1); + +$frac = Fraction($ans+2*$num1+$num2,2*$den1)->reduce; +@fract = $frac->value; +$num3 = $fract[0]; +$den3 = $fract[1]; +while ($den3==1) { + $ans = random(-10,10,1); + Context("Fraction"); + $frac = Fraction($ans+2*$num1+$num2,2*$den1)->reduce; + @fract = $frac->value; + $num3 = $fract[0]; + $den3 = $fract[1]; +} + +$com = lcm(lcm($den1,$den2),$den3); +Context()->variables->are($var=>'Real'); +$frac3 = Fraction($num3,$den3); +$left = Formula("($var+$num1)/$den1-($var-$num2)/$den2"); +$right = Formula("$frac3"); + +$s1 = $com/$den1; +$s2 = $com/$den2; +$s3 = $com*$num3/$den3; +$s4 = $s1*$num1; +$s5 = $s2*$num2; +$s7 = $s4+$s5; + +Context("Numeric")->variables->are($var=>'Real'); +$s2var = Formula("$s2 $var")->reduce; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each term by a common denominator. For this problem, a common denominator is [`[$com]`]. + + [`` +\begin{aligned} + \frac{[$var]+[$num1]}{[$den1]} - \frac{[$var]-[$num2]}{[$den2]} &= \frac{[$num3]}{[$den3]} \\ + [$com] \cdot \frac{[$var]+[$num1]}{[$den1]} - [$com] \cdot \frac{[$var]-[$num2]}{[$den2]} &= [$com] \cdot \frac{[$num3]}{[$den3]} \\ + [$s1]([$var]+[$num1]) - [$s2]([$var]-[$num2]) &= [$s3] \\ + [$s1]([$var]+[$num1]) +(-[$s2])([$var]+(-[$num2])) &= [$s3] \\ + [$s1][$var]+[$s1] \cdot [$num1] +(-[$s2]) \cdot [$var] + (-[$s2]) \cdot (-[$num2]) &= [$s3] \\ + [$s1][$var]+[$s4] - [$s2var] + [$s5] &= [$s3] \\ + [$var] + [$s7] &= [$s3] \\ + [$var] + [$s7] \mathbf{{}-[$s7]}&= [$s3]\mathbf{{}-[$s7]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction280.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction280.pg new file mode 100644 index 0000000000..2dbe4dde3e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction280.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like (2x+3)/4 - (4-x)/8 = 5/6; answer is a fraction. +# +# Last updated: Kling, 7/21/13; Jordan 7/19/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','divide','add','subtract','combine') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,4,2); +$den2 = $den1*2; +$den3 = random(3,9,2); + +$a = random(2,10,1); +$b = random(6,10,1); +$c = random(1,5,1); +$d = random(1,$den3-1,1); +while (gcd($d,$den3)!=1) {$d = random(1,$den3-1,1);} +$ans = Fraction(2*$den1*$d+$den3*$c-2*$den3*$b,2*$den3*$a+$den3)->reduce; +@answ = $ans->value; +$ansNum = $answ[0]; +$ansDen = $answ[1]; + +#make sure answer is a fraction +while ($ansDen==1) { + $b = random(1,10,1); + $c = random(1,10,1); + $ans = Fraction(2*$den1*$d+$den3*$c-2*$den3*$b,2*$den3*$a+$den3)->reduce; + @answ = $ans->value; + $ansNum = $answ[0]; + $ansDen = $answ[1]; +} + +$com = lcm($den2,$den3); + +$frac3 = Fraction($d,$den3); +$left = Formula("($a*$var+$b)/$den1-($c-$var)/$den2"); +$right = Formula("$frac3"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$s1 = $com/$den1; +$s2 = $com/$den2; +$s3 = $com*$d/$den3; +$s4 = $s1*$a; +$s5 = $s1*$b; +$s6 = $s2*$c; +$s7 = $s4+$s2; +$s8 = $s5-$s6; +$s9 = $s3-$s8; +if ($ansNum>0) {$ansOutput = "\frac{$ansNum}{$ansDen}";} + else { + $ansNum = -$ansNum; + $ansOutput = "-\frac{$ansNum}{$ansDen}"; +} + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each term by a common denominator. For this problem, a common denominator is [`[$com]`]. + + [`` +\begin{aligned} + \frac{[$a][$var]+[$b]}{[$den1]} - \frac{[$c]-[$var]}{[$den2]} &= \frac{[$d]}{[$den3]} \\ + [$com] \cdot \frac{[$a][$var]+[$b]}{[$den1]} - [$com] \cdot \frac{[$c]-[$var]}{[$den2]} &= [$com] \cdot \frac{[$d]}{[$den3]} \\ + [$s1]([$a][$var]+[$b]) - [$s2]([$c]-[$var]) &= [$s3] \\ + [$s1]([$a][$var]+[$b]) +(-[$s2])([$c]+(-[$var])) &= [$s3] \\ + [$s1] \cdot [$a][$var] + [$s1] \cdot [$b] + (-[$s2]) \cdot [$c] + (-[$s2]) \cdot (-[$var]) &= [$s3] \\ + [$s4][$var] + [$s5] -[$s6] +[$s2][$var] &= [$s3] \\ + [$s7][$var] + [$s8] &= [$s3] \\ + [$s7][$var] + [$s8]\mathbf{{}-[$s8]} &= [$s3]\mathbf{{}-[$s8]} \\ + [$s7][$var] &= [$s9] \\ + \frac{[$s7][$var]}{[$s7]} &= \frac{[$s9]}{[$s7]} \\ + [$var] &= [$ansOutput] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction290.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction290.pg new file mode 100644 index 0000000000..3000ef86c9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction290.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 8=x/3+x/4; the solution is an integer. +# +# Last updated: Kling 7/21/13; Jordan 7/19/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','add','multiply','divide','combine') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(3,9,2); +$den2 = random(2,10,2); +$com = lcm($den1,$den2); + +$ans = $com*list_random((1,2,3)); +$a= $ans/$den1+$ans/$den2; + +$left=Formula("$a"); +$right=Formula("$var/$den1+$var/$den2"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$s1 = $com*$a; +$s2 = $com/$den1; +$s3 = $com/$den2; +$s4 = $s2+$s3; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each term by a common denominator. For this problem, a common denominator is [`[$com]`]. [``` +\begin{aligned} + [$a] &= \frac{[$var]}{[$den1]}+ \frac{[$var]}{[$den2]} \\ + [$com] \cdot [$a] &= [$com] \cdot \frac{[$var]}{[$den1]}+ [$com] \cdot \frac{[$var]}{[$den2]} \\ + [$s1] &= [$s2][$var] + [$s3][$var] \\ + [$s1] &= [$s4][$var] \\ + \frac{[$s1]}{[$s4]} &= \frac{[$s4][$var]}{[$s4]} \\ + [$ans] &= [$var]\\ + [$var] & = [$ans] +\end{aligned} + ```] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction30.pg new file mode 100644 index 0000000000..8d2535f61b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction30.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# solve equations like 3-x/2=4; +# +# Last edited: Kling, 7/18/13; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(1,10,1); +$b=random(2,10,1); +$ans = $b*list_random((2,3,4,5,6)); +$c= $a-$ans/$b; + +$left = Formula("$a-$var/$b"); +$right = Formula("$c"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $a*$b; +$step2 = $b*$c; +$step3 = $step2-$step1; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + [$a] - \frac{[$var]}{[$b]} &= [$c] \\ + [$b] \cdot \left([$a] + -\frac{[$var]}{[$b]}\right) &= [$b] \cdot [$c] \\ +[$b] \cdot [$a] - [$b] \cdot \left(\frac{[$var]}{[$b]}\right) &= [$b] \cdot [$c] \\ + [$step1] -[$var] &= [$step2] \\ +[$step1] -[$var]\mathbf{{}-[$step1]}&= [$step2]\mathbf{{}-[$step1]} \\ + -[$var] &= [$step3] \\ + (-1) \cdot (-[$var]) &= (-1) \cdot [$step3] \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction300.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction300.pg new file mode 100644 index 0000000000..476da09fd7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction300.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like x/3-8=x/4; the solution is an integer. +# +# Last updated: Kling 7/21/13; Jordan 7/19/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','divide','combine','subtract') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(3,7,2); +$den2 = random($den1+2,10,1); +$com = lcm($den1,$den2); + +$ans = $com*list_random((1,2,3)); +$a= $ans/$den1-$ans/$den2; + +$left = Formula("$var/$den1-$a"); +$right = Formula("$var/$den2"); + +$s1 = $com*$a; +$s2 = $com/$den1; +$s3 = $com/$den2; +$s4 = $s2-$s3; + +$s2var = Formula("$s2 $var")->reduce; +$s3var = Formula("$s3 $var")->reduce; +$s4var = Formula("$s4 $var")->reduce; + +$solnString = ''; +if ($s4 != 1) {$solnString = ' + [$s4var] &= [$s1] \\ + \frac{[$s4var]}{[$s4]} &= \frac{[$s1]}{[$s4]} \\'}; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each term by a common denominator. For this problem, a common denominator is [`[$com]`]. + + [`` +\begin{aligned} + \frac{[$var]}{[$den1]} - [$a] &= \frac{[$var]}{[$den2]} \\ + [$com] \cdot \frac{[$var]}{[$den1]} - [$com] \cdot [$a] &= [$com] \cdot \frac{[$var]}{[$den2]} \\ + [$s2var] - [$s1] &= [$s3var] \\ + [$s2var] - [$s1]\mathbf{{}-[$s3var]+[$s1]} &= [$s3var]\mathbf{{}-[$s3var]+[$s1]} \\ [$solnString]** + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction310.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction310.pg new file mode 100644 index 0000000000..8ca2e03f6b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction310.pg @@ -0,0 +1,126 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like x/3-8=x/4+3; the solution is an integer. +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','add','subtract') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(2,6,2); +$den2 = random($den1+1,10,1); +$com = lcm($den1,$den2); + +$ans = $com*list_random((1,2,3)); +$a = random(1,10,1); +$b = $ans/$den1-$ans/$den2-$a; +#make sure b is positive +while ($b<=0) { + $ans = $com*list_random((1,2,3)); + $a = random(1,10,1); + $b = $ans/$den1-$ans/$den2-$a; +} + +$left = Formula("$var/$den1-$a"); +$right = Formula("$var/$den2+$b"); + +$s1 = $com*$a; +$s2 = $com/$den1; +$s3 = $com/$den2; + +if ($s3==1) {$s3Output = "";} +else {$s3Output = "$s3";} + +$s4 = $com*$b; +$s5 = $s2 - $s3; +$s6 = $s4 + $s1; + +$s5var = Formula("$s5 $var")->reduce; + +$solnstring = ''; +if($s5!=1) {$solnString = '[$s5var] &= [$s6] \\ + \frac{[$s5var]}{[$s5]} &= \frac{[$s6]}{[$s5]} \\';}; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, we multiply each term by a common denominator. For this problem, a common denominator is [`[$com]`]. + + [`` +\begin{aligned} + \frac{[$var]}{[$den1]} - [$a] &= \frac{[$var]}{[$den2]} +[$b] \\ + [$com] \cdot \frac{[$var]}{[$den1]} - [$com] \cdot [$a] &= [$com] \cdot \frac{[$var]}{[$den2]} +[$com] \cdot [$b] \\ + [$s2][$var] - [$s1] &= [$s3Output][$var] + [$s4] \\ + [$s2][$var] - [$s1]\mathbf{{}-[$s3Output][$var] + [$s1]} &= [$s3Output][$var] + [$s4]\mathbf{{}-[$s3Output][$var] + [$s1]} \\ [$solnString]** + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction320.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction320.pg new file mode 100644 index 0000000000..72ce0ed5fa --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction320.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like ax + b= cx + d; the solution is a fraction. +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','add','subtract') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { +$a = random(2,10,1); +$b = random(2,10,1); +$c = random(2,10,1); +$d = random(2,10,1); +} until (abs($c-$a)>1 and $b != $d and ($d-$b)/($c-$a) != int(($d-$b)/($c-$a)) ); + + +$ans = Fraction($d-$b,$a-$c); + +$left = Formula("$a $var + $b"); +$right = Formula("$c $var + $d"); + + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + + +BEGIN_PGML_SOLUTION + +To solve this equation, use addition and subtraction to move variable terms to one side and constant terms to the other. Then divide. + [`` +\begin{aligned} + [$left] &= [$right]\\ + [$left] \mathbf{{}-[$b]}&= [$right]\mathbf{{}-[$b]}\\ + [$a][$var] &= [$c][$var]+[$d-$b]\\ + [$a][$var] \mathbf{{}-[$c][$var]}&= [$c][$var]+[$d-$b]\mathbf{{}-[$c][$var]}\\ + [$a-$c][$var] &= [$d-$b]\\ + \frac{[$a-$c][$var]}{[$a-$c]} &= \frac{[$d-$b]}{[$a-$c]}\\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction330.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction330.pg new file mode 100644 index 0000000000..b1cbcecfdc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction330.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like ax + b= cx + d; the solution is a fraction. +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','add','subtract') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { +$a = random(2,10,1); +$b = random(2,10,1); +$c = random(2,10,1); +$d = random(2,10,1); +} until (abs($c-$a)>1 and $b != $d and ($d-$b)/($c-$a) != int(($d-$b)/($c-$a)) ); + +$den = random(2,10,1); + +$A = Fraction($a,$den); +$B = Fraction($b,$den); +$C = Fraction($c,$den); +$D = Fraction($d,$den); + +$ans = Fraction($d-$b,$a-$c); + +$left = Formula("$A $var + $B"); +$right = Formula("$C $var + $D"); + + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + + +BEGIN_PGML_SOLUTION + +[%Solution needs to be written.%] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction340.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction340.pg new file mode 100644 index 0000000000..f9c600f37c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction340.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like ax + b= cx + d; the solution is a fraction. +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','multiply','add','subtract') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { +$a = random(2,10,1)*random(-1,1,2); +$b = random(2,10,1)*random(-1,1,2); +$c = random(2,10,1)*random(-1,1,2); +$d = random(2,10,1)*random(-1,1,2); +$ad = random(2,10,1); +$bd = random(2,10,1); +$cd = random(2,10,1); +$dd = random(2,10,1); +} until ($a/$ad != $c/$cd); + + +$A = Fraction($a,$ad); +$B = Fraction($b,$bd); +$C = Fraction($c,$cd); +$D = Fraction($d,$dd); + +$ans = ($D-$B)/($A-$C); + +$left = Formula("$A $var + $B")->reduce; +$right = Formula("$C $var + $D")->reduce; + + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + + +BEGIN_PGML_SOLUTION + +[%Solution needs to be written.%] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction40.pg new file mode 100644 index 0000000000..f4efcd1a80 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction40.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 4=3- 2x/3; +# +# Last edited: Kling, 7/17/13; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(1,10,1); +$den = random(3,9,2); +$num=random(2,10,2); +while (gcd($den,$num)!=1) {$num=random(2,10,2);} + +$ans = $den*list_random((2,3,4,5,6)); +$b= $a-$num*$ans/$den; + +$left = Formula("$b"); +$right = Formula("$a-$num*$var/$den"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den*$b; +$step2 = $den*$a; +$step3 = $step1-$step2; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + [$b] &=[$a] - \frac{[$num][$var]}{[$den]} \\ + [$den] \cdot([$b]) &=[$den] \cdot \left([$a] + -\frac{[$num][$var]}{[$den]}\right) \\ +[$den] \cdot([$b]) &=[$den] \cdot [$a] - [$den] \cdot \left(\frac{[$num][$var]}{[$den]}\right) \\ + [$step1] &= [$step2] -[$num][$var] \\ + [$step1]\mathbf{{}-[$step2]}&= [$step2] -[$num][$var]\mathbf{{}-[$step2]} \\ + [$step3] &=-[$num][$var] \\ + \frac{[$step3]}{-[$num]} &=\frac{-[$num][$var]}{-[$num]} \\ + [$ans] &=[$var]\\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction50.pg new file mode 100644 index 0000000000..686a98f0a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction50.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 4=2x/3-8; +# +# Last edited: Kling, 7/18/13; Jordan 7/10/13; Hughes 7/1/13, Wherry 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random(2,10,2); +$num=random(3,9,2); +while (gcd($den,$num)!=1) {$num=random(3,9,2);} + +$ans = $den*list_random((2,3,4,5,6)); +$b=random(2,5,1); +$a= $b*$ans-$num*$ans/$den; + +$left = Formula("$b*$var"); +$right = Formula("$num*$var/$den+$a"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den*$b; +$step2 = $den*$a; +$step3 = $step1-$num; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + [$b][$var] &=\frac{[$num][$var]}{[$den]}+[$a] \\ + [$den] \cdot([$b][$var]) &=[$den] \cdot \left(\frac{[$num][$var]}{[$den]}+ [$a]\right) \\ +[$den] \cdot([$b][$var]) &=[$den] \cdot \frac{[$num][$var]}{[$den]}+[$den] \cdot [$a] \\ + [$step1][$var] &=[$num][$var] +[$step2] \\ + [$step1][$var]\mathbf{{}-[$num][$var]}&=[$num][$var] +[$step2]\mathbf{{}-[$num][$var]} \\ + [$step3][$var] &=[$step2] \\ + \frac{[$step3][$var]}{[$step3]} &=\frac{[$step2]}{[$step3]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction60.pg new file mode 100644 index 0000000000..44d1f47ad7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction60.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 4=(2/3)x+8; +# +# Last edited: Kling, 7/18/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,6,1); +$den = random(3,9,2); +$num=random(2,10,2); +while (gcd($den,$num)!=1) {$num=random(2,10,2);} + +$ans = $den*list_random((2,3,4,5)); +$b= $num*$ans/$den+$a*$ans; + +$left=Formula("$b"); +$frac = Fraction($num,$den); +$right=Formula("$frac*$var+$a*$var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den*$b; +$step2 = $den*$a; +$step3 = $num+$step2; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + [$b] &= \frac{[$num]}{[$den]}[$var] +[$a][$var] \\ + [$den] \cdot[$b] &= [$den] \cdot \left(\frac{[$num]}{[$den]}[$var] + [$a][$var]\right) \\ +[$den] \cdot[$b] &= [$den] \cdot \frac{[$num]}{[$den]}[$var] +[$den] \cdot [$a][$var] \\ + [$step1] &= [$num][$var] +[$step2][$var] \\ + [$step1] &= [$step3][$var] \\ + \frac{[$step1]}{[$step3]} &= \frac{[$step3][$var]}{[$step3]} \\ + [$ans] &= [$var]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction70.pg new file mode 100644 index 0000000000..b5c141926f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction70.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 4-(2/3)x=8; +# +# Last edited: Kling, 7/18/13; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random(2,10,2); +$num=random(3,9,2); +while (gcd($den,$num)!=1) {$num=random(3,9,2);} + +$b = random(2,5,1); +$ans = random(2,6,1)*$den; +$a = $b*$ans+$num*$ans/$den; + +$frac = Fraction($num,$den); +$left = Formula("$a-$frac*$var"); +$right = Formula("$b*$var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den*$a; +$step2 = $den*$b; +$step3 = $step2+$num; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + [$a] - \frac{[$num]}{[$den]}[$var] &= [$b][$var] \\ +[$den] \cdot \left([$a] - \frac{[$num]}{[$den]}[$var]\right) &= [$den] \cdot ([$b][$var]) \\ + [$den] \cdot [$a] - [$den] \cdot \left( \frac{[$num]}{[$den]}[$var]\right) &= [$den] \cdot ([$b][$var]) \\ + [$step1] - [$num][$var] &=[$step2][$var] \\ + [$step1] - [$num][$var]\mathbf{{}+[$num][$var]} &=[$step2][$var]\mathbf{{}+[$num][$var]} \\ + [$step1] &= [$step3][$var] \\ + \frac{[$step1]}{[$step3]} &= \frac{[$step3][$var]}{[$step3]} \\ + [$ans] &= [$var]\\ + [$var] &= [$ans] +\end{aligned} + ``] + + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction80.pg new file mode 100644 index 0000000000..d4a014d705 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction80.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 4=(2/3)x+8; the solution is a fraction. +# +# Last edited: Kling, 7/18/13; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/2013 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=random(1,10,1); +$den = random(3,9,2); +$num=random(2,10,2); +while (gcd($den,$num)!=1) {$num=random(2,10,2);} +$frac = Fraction($num,$den); + +@multiples = (2, 3, 4, 5, 6); +$multiple = list_random(@multiples); +while ($multiple%$num==0) {$multiple = list_random(@multiples);} + +$b=random(2,6,1); +$ans = Fraction($a*$den,$b*$den-$num); +@answ = $ans->value; +$ansNum = $answ[0]; +$ansDen = $answ[1]; + +$frac = Fraction($num,$den); +$left = Formula("$b*$var"); +$right = Formula("$frac*$var+$a"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den*$b; +$step2 = $den*$a; +$step3 = $step1-$num; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + [$b][$var] &= \frac{[$num]}{[$den]}[$var] +[$a] \\ + [$den] \cdot[$b][$var] &=[$den] \cdot \left(\frac{[$num]}{[$den]}[$var]+[$a]\right) \\ +[$den] \cdot[$b][$var] &=[$den] \cdot \frac{[$num]}{[$den]}[$var]+[$den] \cdot [$a] \\ + [$step1][$var] &= [$num][$var] +[$step2] \\ + [$step1][$var]\mathbf{{}-[$num][$var]}&= [$num][$var] +[$step2]\mathbf{{}-[$num][$var]} \\ + [$step3][$var] &= [$step2] \\ + \frac{[$step3][$var]}{[$step3]} &= \frac{[$step2]}{[$step3]} \\ + [$var] &= \frac{[$ansNum]}{[$ansDen]} +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction90.pg new file mode 100644 index 0000000000..f9360c534a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction90.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 4/5 -2x=8; the solution is a fraction. +# +# Last edited: Kling, 7/18/13; Jordan 7/10/13; Hughes 7/1/13, Wherry, 6/28/2013 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random(2,10,2); +$num=random(3,9,2); +while (gcd($den,$num)!=1) {$num=random(3,9,2);} +$frac = Fraction($num,$den); + +$a=random(2,10,1); +$b=random(2,10,1); +$ans = ($b-$frac)/(-$a); + +@answ = $ans->value; +$ansNum = -$answ[0]; +$ansDen = $answ[1]; + +$frac1 = Fraction($num,$den); +$left = Formula("$frac1-$a*$var"); +$right = Formula("$b"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $den*$a; +$step2 = $den*$b; +$step3 = $step2-$num; + +BEGIN_PGML_SOLUTION + +To clear fractions in an equation, multiply each side of the equation by the common denominator. + + [`` +\begin{aligned} + \frac{[$num]}{[$den]} -[$a][$var] &= [$b] \\ + [$den] \cdot \left(\frac{[$num]}{[$den]} - [$a][$var]\right) &= [$den] \cdot [$b] \\ + [$den] \cdot \frac{[$num]}{[$den]} - [$den] \cdot ([$a][$var]) &= [$den] \cdot [$b] \\ + [$num] -[$step1][$var] &= [$step2] \\ + [$num]-[$step1][$var]\mathbf{{} -[$num]} &= [$step2]\mathbf{{} -[$num]} \\ + -[$step1][$var] &= [$step3] \\ + \frac{-[$step1][$var]}{-[$step1]} &= \frac{[$step3]}{-[$step1]} \\ + [$var] &=-\frac{[$ansNum]}{[$ansDen]} +\end{aligned} + ``] + + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses10.pg new file mode 100644 index 0000000000..6cc3330745 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses10.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 2(x+3)=4 +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','distributive','subtract','divide') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$ans = random(2,10,1); +$b=random(1,10,1); +$c= $a*($ans+$b); + +$left = Formula("$a*($var+$b)"); +$right = Formula("$c"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $a*$b; +$step2 = $c-$step1; + +BEGIN_PGML_SOLUTION + +Two alternative approaches are shown below. + + [`` +\begin{aligned} + [$a]([$var]+ [$b]) & = [$c] + & [$a]([$var]+ [$b]) & = [$c] \\ + [$a][$var] +[$step1] & = [$c] + & \frac{[$a]([$var]+ [$b])}{[$a]} & = \frac{[$c]}{[$a]}\\ + [$a][$var] +[$step1]\mathbf{{}-[$step1]} & = [$c]\mathbf{{}-[$step1]} + & [$var]+ [$b] & = [$c/$a]\\ + [$a][$var] & = [$step2] + & [$var]+ [$b]\mathbf{{}-[$b]} & = [$c/$a]\mathbf{{}-[$b]}\\ + \frac{[$a][$var]}{[$a]} &= \frac{[$step2]}{[$a]} + & [$var] & = [$ans]\\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses100.pg new file mode 100644 index 0000000000..76efb245fb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses100.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 3+2(x+3)=7 +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(1,5,1); +$b=random(6,10,1); +$ans = random(-10,10,1); +$c=random(1,10,1); +$d= $a+$b*($ans+$c); + +$left=Formula("$a+$b($var+$c)"); +$right=Formula("$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $b*$c; +$step2 = $a+$step1; +$step3 = $d-$step2; + +BEGIN_PGML_SOLUTION + +Two alternative approaches are shown. + + [`` +\begin{aligned} + [$a] +[$b]([$var] + [$c]) & = [$d] + & [$a] +[$b]([$var] + [$c]) & = [$d] \\ + [$a] +[$b][$var] + [$b] \cdot [$c] & = [$d] + & [$a] +[$b]([$var] + [$c])\mathbf{{}-[$a]} & = [$d]\mathbf{{}-[$a]} \\ + [$a] +[$b][$var] + [$step1] & = [$d] + & [$b]([$var] + [$c]) & = [$d-$a] \\ + [$b][$var] +([$a]+[$step1]) & = [$d] + & \frac{[$b]([$var] + [$c])}{[$b]} & = \frac{[$d-$a]}{[$b]} \\ + [$b][$var] +[$step2] & = [$d] + & [$var] + [$c] & = [$d/$b-$a/$b] \\ + [$b][$var] +[$step2]\mathbf{{}-[$step2]} & = [$d]\mathbf{{}-[$step2]} + & [$var] + [$c]\mathbf{{}-[$c]} & = [$d/$b-$a/$b]\mathbf{{}-[$c]} \\ + [$b][$var] & = [$step3] + & [$var] & = [$ans] \\ + \frac{[$b][$var]}{[$b]} & = \frac{[$step3]}{[$b]} \\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses110.pg new file mode 100644 index 0000000000..f73b4d5eb5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses110.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 3-2(x+3)=7 +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(1,5,1); +$b=random(6,10,1); +$ans = random(-10,10,1); +$c=random(1,10,1); +$d= $a-$b*($ans+$c); + +$left=Formula("$a-$b*($var+$c)"); +$right=Formula("$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $b*$c; +$step2 = abs($a-$step1); +$step3 = $d+$step2; + +BEGIN_PGML_SOLUTION + +Two alternative approaches are shown. + + [`` +\begin{aligned} + [$a] -[$b]([$var] + [$c]) & = [$d] + & [$a] -[$b]([$var] + [$c]) & = [$d] \\ + [$a] +(-[$b]) \cdot ([$var] + [$c]) & = [$d] + & [$a] -[$b]([$var] + [$c])\mathbf{{}-[$a]}& = [$d]\mathbf{{}-[$a]} \\ + [$a] +(-[$b]) \cdot [$var] + (-[$b]) \cdot [$c] & = [$d] + & -[$b]([$var] + [$c])& = [$d-$a] \\ + [$a] -[$b][$var] - [$step1] & = [$d] + & \frac{-[$b]([$var] + [$c])}{-[$b]}& = \frac{[$d-$a]}{-[$b]} \\ + -[$b][$var] +([$a]-[$step1]) & = [$d] + & [$var] + [$c]& = [$d/-$b-$a/-$b] \\ + -[$b][$var] -[$step2] & = [$d] + & [$var] + [$c]\mathbf{{}-[$c]}& = [$d/-$b-$a/-$b]\mathbf{{}-[$c]} \\ + -[$b][$var] -[$step2]\mathbf{{}+[$step2]} & = [$d]\mathbf{{}+[$step2]} + & [$var] & = [$ans] \\ + -[$b][$var] & = [$step3] \\ + \frac{-[$b][$var]}{-[$b]} & = \frac{[$step3]}{-[$b]} \\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses120.pg new file mode 100644 index 0000000000..52d2d0625b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses120.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 10= 2-2(x-3) +# +# Last updated: Kling 7/21/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(1,10,1); +$b=random(2,10,1); +$ans = non_zero_random(-10,10,1); +$c=random(1,10,1); +$d= $a-$b*($ans-$c); + +$left = Formula("$d"); +$right = Formula("$a-$b*($var-$c)"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $b*$c; +$step2 = $a+$step1; +$step3 = $d-$step2; + +BEGIN_PGML_SOLUTION + +Two alternative approaches are shown. + + [`` +\begin{aligned} + [$d] &= [$a] -[$b]([$var]-[$c]) + & [$d] &= [$a] -[$b]([$var]-[$c]) \\ + [$d] &= [$a] +(-[$b]) \cdot ([$var]+(-[$c])) + & [$d]\mathbf{{}-[$a]} &= [$a] -[$b]([$var]-[$c])\mathbf{{}-[$a]} \\ + [$d] &= [$a] +(-[$b]) \cdot [$var]+(-[$b]) \cdot (-[$c]) + & [$d-$a] &= -[$b]([$var]-[$c]) \\ + [$d] &= [$a] -[$b][$var] +[$step1] + & \frac{[$d-$a]}{-[$b]} &= \frac{-[$b]([$var]-[$c])}{-[$b]} \\ + [$d] &= -[$b][$var] +([$a]+[$step1]) + & [$d/-$b-$a/-$b] &= [$var]-[$c] \\ + [$d] &= -[$b][$var] +[$step2] + & [$d/-$b-$a/-$b]\mathbf{{}+[$c]} &= [$var]-[$c]\mathbf{{}+[$c]} \\ + [$d]\mathbf{{}-[$step2]} &= -[$b][$var] +[$step2]\mathbf{{}-[$step2]} + & [$ans] &= [$var] \\ + [$step3] &= -[$b][$var] + & [$var] &= [$ans] \\ + \frac{[$step3]}{-[$b]} &= \frac{-[$b][$var]}{-[$b]} \\ + [$ans] &= [$var]\\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses130.pg new file mode 100644 index 0000000000..3c2084805e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses130.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 3-2(x-3)=7 +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=random(1,5,1); +$b=random(6,10,1); +$ans = random(-10,10,1); +$c=random(1,10,1); +$d= $a-$b*($ans-$c); + +$left = Formula("$a-$b($var-$c)"); +$right = Formula("$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$a]-[$b]([$var]-[$c])=[$d] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); +############################################## + +$step1 = $b*$c; +$step2 = $a+$step1; +$step3 = $d-$step2; + +BEGIN_PGML_SOLUTION + +Two alternative solutions are shown. + + [`` +\begin{aligned} + [$a] -[$b]([$var] - [$c]) & = [$d] + & [$a] -[$b]([$var] - [$c]) & = [$d] \\ + [$a] +(-[$b]) \cdot ([$var] + (-[$c])) & = [$d] + & [$a] -[$b]([$var] - [$c])\mathbf{{}-[$a]} & = [$d]\mathbf{{}-[$a]} \\ + [$a] +(-[$b]) \cdot [$var] + (-[$b]) \cdot (-[$c]) & = [$d] + & -[$b]([$var] - [$c]) & = [$d-$a] \\ + [$a] -[$b][$var] + [$step1] & = [$d] + & \frac{-[$b]([$var] - [$c])}{-[$b]} & = \frac{[$d-$a]}{-[$b]} \\ + -[$b][$var] +([$a]+[$step1]) & = [$d] + & [$var] - [$c] & = [$d/-$b-$a/-$b] \\ + -[$b][$var] +[$step2] & = [$d] + & [$var] - [$c]\mathbf{{}+[$c]} & = [$d/-$b-$a/-$b]\mathbf{{}+[$c]}\\ + -[$b][$var] +[$step2]\mathbf{{}-[$step2]} & = [$d]\mathbf{{}-[$step2]} + & [$var] & = [$ans]\\ + -[$b][$var] & = [$step3] \\ + \frac{[$b][$var]}{-[$b]} & = \frac{[$step3]}{-[$b]} \\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses140.pg new file mode 100644 index 0000000000..dd710e65e7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses140.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 10= 2-(3-x) +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(6,10,1); +$b=random(1,5,1); +$ans = non_zero_random(-10,10,1); +$c= $a-($b-$ans); + +$left = Formula("$c"); +$right = Formula("$a-($b-$var)"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +BEGIN_PGML_SOLUTION + +Two alternative approaches are shown. + + [`` +\begin{aligned} + [$c] &= [$a] - ([$b]-[$var]) + & [$c] &= [$a] - ([$b]-[$var]) \\ + [$c] &= [$a] + (-1) \cdot ([$b]+(-[$var])) + & [$c]\mathbf{{}-[$a]} &= [$a] - ([$b]-[$var])\mathbf{{}-[$a]} \\ + [$c] &= [$a] + (-1) \cdot ([$b]) + (-1) \cdot (-[$var]) + & [$c-$a] &= - ([$b]-[$var])\\ + [$c] &= [$a] -[$b] +[$var] + & (-1)\cdot([$c-$a]) &= (-1)\cdot(- ([$b]-[$var]))\\ + [$c] &= [$a-$b] +[$var] + & [$a-$c] &= [$b]-[$var]\\ + [$c]\mathbf{{}-[$a-$b]} &= [$a-$b] +[$var]\mathbf{{}-[$a-$b]} + & [$a-$c] \mathbf{{}-[$a-$c]+[$var]}&= [$b]-[$var]\mathbf{{}-[$a-$c]+[$var]}\\ + [$ans] &= [$var] + & [$var]&= [$ans]\\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses150.pg new file mode 100644 index 0000000000..d978d14049 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses150.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 3-(x+4)=7 +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(1,5,1); +$b=random(6,10,1); +$ans = random(-10,10,1); +$c= $a-($ans+$b); + +$left = Formula("$a-($var+$b)"); +$right = Formula("$c"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +$step1 = $c+$b-$a; + +BEGIN_PGML_SOLUTION + +Two approaches are shown. + + [`` +\begin{aligned} + [$a] -([$var] + [$b]) &= [$c] + & [$a] -([$var] + [$b]) &= [$c] \\ + [$a] +(-1) \cdot ([$var] + [$b]) &= [$c] + & [$a] -([$var] + [$b])\mathbf{{}-[$a]} &= [$c]\mathbf{{}-[$a]} \\ + [$a] +(-1) \cdot [$var] + (-1) \cdot [$b] & = [$c] + & -([$var] + [$b]) &= [$c-$a] \\ + [$a] -[$var] - [$b] & = [$c] + & (-1)\cdot(-([$var] + [$b])) &= (-1)\cdot([$c-$a]) \\ + -[$var] +([$a]-[$b]) &= [$c] + & [$var] + [$b] &= [$a-$c]\\ + -[$var] -[$b-$a] & = [$c] + & [$var] + [$b]\mathbf{{}-[$b]} &= [$a-$c]\mathbf{{}-[$b]}\\ + -[$var] -[$b-$a]\mathbf{{}+[$b-$a] } & = [$c]\mathbf{{}+[$b-$a] } + & [$var]&= [$ans]\\ + -[$var] & = [$step1] \\ +(-1) \cdot (-[$var]) & = (-1) \cdot [$step1] \\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses160.pg new file mode 100644 index 0000000000..560368fd84 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses160.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 3(x+2)-5(x-3)=7 +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','combine','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,5,1); +$b=random(1,10,1); +$c=random(6,10,1); +$ans = random(-10,10,1); +$d=random(1,10,1); +$e= $a*($ans+$b)-$c*($ans-$d); + +$left = Formula("$a*($var+$b)-$c*($var-$d)"); +$right = Formula("$e"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $a*$b; +$step2 = $c*$d; +$step3 = abs($a-$c); +$step4 = $step1+$step2; +$step5 = $e-$step4; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} +[$a]([$var] +[$b]) -[$c]([$var]-[$d]) &= [$e] \\ +[$a]([$var] +[$b]) +(-[$c])([$var]+(-[$d])) &= [$e] \\ +[$a][$var] +[$a] \cdot [$b] +(-[$c]) \cdot [$var] +(-[$c]) \cdot (-[$d]) &= [$e] \\ +[$a][$var] +[$step1] -[$c][$var] +[$step2] &= [$e] \\ +[$a][$var] -[$c][$var] +[$step1]+[$step2] &= [$e] \\ + -[$step3][$var] +[$step4] &= [$e] \\ + -[$step3][$var] +[$step4]\mathbf{{}-[$step4]} &= [$e]\mathbf{{}-[$step4]} \\ + -[$step3][$var] &= [$step5] \\ + \frac{-[$step3][$var]}{-[$step3]} &= \frac{[$step5]}{-[$step3]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses170.pg new file mode 100644 index 0000000000..92391a6175 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses170.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 1+5(x-3)=7-(4-2x) +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','combine','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=random(1,5,1); +$b=random(7,10,1); +$c=random(3,10,1); +$ans = random(-10,10,1); + +$e=random(1,10,1); +$f=random(2,5,1); +$d= $a+$b*($ans-$c)+$e-$f*$ans; + +$left = Formula("$a+$b*($var-$c)"); +$right = Formula("$d-($e-$f*$var)"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +$step1 = $b*$c; +$step2 = abs($a-$step1); +$step3 = $d-$e; +$step4 = $b-$f; +$step5 = $step3+$step2; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} +[$a]+[$b]([$var]-[$c]) &= [$d]-([$e]-[$f][$var]) \\ +[$a]+[$b]([$var]+(-[$c])) &= [$d]+(-1) \cdot ([$e]+(-[$f][$var])) \\ +[$a]+[$b] \cdot [$var]+[$b] \cdot (-[$c]) &= [$d]+(-1) \cdot [$e]+(-1) \cdot (-[$f][$var]) \\ +[$a]+[$b][$var]-[$step1] &= [$d]-[$e]+[$f][$var] \\ +[$a]-[$step1]+[$b][$var] &= [$d]-[$e]+[$f][$var] \\ +-[$step2]+[$b][$var] &= [$step3]+[$f][$var] \\ +-[$step2]+[$b][$var]\mathbf{{}+[$step2]-[$f][$var]} &= [$step3]+[$f][$var]\mathbf{{}+[$step2]-[$f][$var]} \\ +[$step4][$var] &= [$step5] \\ +\frac{[$step4][$var]}{[$step4]} &= \frac{[$step5]}{[$step4]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses180.pg new file mode 100644 index 0000000000..d1ca6a59dd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses180.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 5(x-3)-x=7-2(4+8x) +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','combine','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(6,10,1); +$b=random(1,10,1); +$ans = random(-10,10,1); + +$e=random(2,5,1); +$f=random(2,10,1); +$g=random(2,5,1); +$d= $a*($ans-$b)-$ans+$e*($f+$g*$ans); + +$left = Formula("$a*($var-$b)-$var"); +$right = Formula("$d-$e*($f+$g*$var)"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $a*$b; +$step2 = $e*$f; +$step3 = $e*$g; +$step4 = $a-1; +$step5 = $d-$step2; +$step6 = $step4+$step3; +$step7 = $step5+$step1; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} +[$a]([$var]-[$b])-[$var] &= [$d]-[$e]([$f]+[$g][$var]) \\ +[$a]([$var]+(-[$b]))-[$var] &= [$d]+(-[$e])([$f]+[$g][$var]) \\ +[$a][$var]+[$a] \cdot (-[$b])-[$var] &= [$d]+(-[$e]) \cdot [$f]+(-[$e]) \cdot [$g][$var] \\ +[$a][$var]-[$step1]-[$var] &= [$d]-[$step2]-[$step3][$var] \\ +[$a][$var]-[$var]-[$step1] &= [$d]-[$step2]-[$step3][$var] \\ +[$step4][$var]-[$step1] &= [$step5]-[$step3][$var] \\ +[$step4][$var]-[$step1]\mathbf{{}+[$step3][$var]+[$step1]} &= [$step5]-[$step3][$var]\mathbf{{}+[$step3][$var]+[$step1]} \\ +[$step6][$var] &= [$step7] \\ +\frac{[$step6][$var]}{[$step6]} &= \frac{[$step7]}{[$step6]} \\ +[$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses190.pg new file mode 100644 index 0000000000..c2ed8f06c7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses190.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 2(-3x+4)=4(-4-8x) +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(3,9,2); +$d=2*$a; + +$c=random(2,10,2); +$e=random(1,10,1); + +$f=random(3,10,1); +$b=2*$f-2; +$ans = (-2*$e-$c)/2; + +$left=Formula("$a(-$b*$var+$c)"); +$right=Formula("$d*(-$e-$f*$var)"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +$step1 = $a*$b; +$step2 = $a*$c; +$step3 = $d*$e; +$step4 = $d*$f; +$step5 = $step4-$step1; +$step6 = -$step3-$step2; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a](-[$b][$var]+[$c]) &= [$d](-[$e]-[$f][$var]) \\ + [$a] \cdot (-[$b][$var])+ [$a] \cdot [$c] &= [$d] \cdot (-[$e]) +[$d] \cdot (-[$f][$var]) \\ + -[$step1][$var] +[$step2] &= -[$step3] - [$step4][$var] \\ + -[$step1][$var] +[$step2]\mathbf{{} +[$step4][$var] -[$step2]} &= -[$step3] - [$step4][$var] \mathbf{{} +[$step4][$var] -[$step2]}\\ + [$step5][$var] &= [$step6] \\ + \frac{[$step5][$var]}{[$step5]} &= \frac{[$step6]}{[$step5]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses20.pg new file mode 100644 index 0000000000..2767c0ca20 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses20.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 2(x-3)=4 +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','distributive','multiply','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=random(2,10,1); +$ans = random(-10,10,1); +$b=random(1,10,1); +$c= $a*($ans-$b); + +$left = Formula("$a*($var-$b)"); +$right = Formula("$c"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +$step1 = $a*$b; +$step2 = $c+$step1; + +BEGIN_PGML_SOLUTION + +Two approaches are shown below. + + [`` +\begin{aligned} + [$a]([$var]- [$b]) & = [$c] + & [$a]([$var]- [$b]) & = [$c] \\ + [$a][$var] -[$step1] &= [$c] + & \frac{[$a]([$var]- [$b])}{[$a]} & = \frac{[$c]}{[$a]} \\ + [$a][$var] -[$step1]\mathbf{{}+[$step1]} &= [$c]\mathbf{{}+[$step1]} + & [$var]- [$b] & = [$c/$a] \\ + [$a][$var] &= [$step2] + & [$var]- [$b]\mathbf{{}+[$b]} & = [$c/$a]\mathbf{{}+[$b]} \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$step2]}{[$a]} + &[$var] & = [$ans]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses200.pg new file mode 100644 index 0000000000..ca1e458430 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses200.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like a+b(c-d]x) = -e(x -f)+g +# Solution is 0. +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','combine','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$b=random(2,6,1); +$c=random(2,6,1); +$d=random(2,6,1); +$e=random(2,6,1); +while ($e==$b*$d) {$e=random(2,6,1);} +$f=random(int($b*$c/$e)+1,int($b*$c/$e)+6,1); +$g=random(1,10,1); +$a=$e*$f+$g-$b*$c; + +$ans = 0; + +$left=Formula("$a+$b*($c-$d*$var)"); +$right=Formula("-$e*($var-$f)+$g"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$s1=$b*$c; +$s2=$b*$d; +$s3=$e*$f; +$s4=$a+$s1; +$s5=$s2-$e; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a]+[$b]([$c]-[$d][$var]) &= -[$e]([$var] -[$f])+[$g] \\ + [$a]+[$b]([$c]+(-[$d][$var])) &= -[$e]([$var] +(-[$f]))+[$g] \\ + [$a]+[$b] \cdot [$c]+[$b] \cdot (-[$d]x) &= -[$e][$var] +(-[$e]) \cdot (-[$f])+[$g] \\ + [$a]+[$s1]-[$s2][$var] &= -[$e][$var] +[$s3]+[$g] \\ + [$s4]-[$s2][$var] &= -[$e][$var] +[$s4] \\ + [$s4]-[$s2][$var]\mathbf{-[$s4]+[$s2][$var]} &= -[$e][$var] +[$s4]\mathbf{-[$s4]+[$s2][$var]} \\ + 0 &= [$s5][$var] \\ + \frac{0}{[$s5]} &= \frac{[$s5][$var]}{[$s5]} \\ + 0 &= [$var]\\ + [$var] & = 0 +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses30.pg new file mode 100644 index 0000000000..ab6a09c52e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses30.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like -10= -2(x+3) +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','distributive','multiply','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=non_zero_random(2,10,1); +$b=random(1,10,1); +$ans = non_zero_random(-10,10,1); +$c= -$a*($ans+$b); + +$left = Formula("$c"); +$right = Formula("-$a*($var+$b)"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $a*$b; +$step2 = $c+$step1; + +BEGIN_PGML_SOLUTION + +Two approaches are shown below. + + [`` +\begin{aligned} + [$c] & = -[$a]([$var] +[$b]) + & [$c] & = -[$a]([$var] +[$b]) \\ + [$c] & = -[$a][$var] +(-[$a]) \cdot [$b] + & \frac{[$c]}{-[$a]} & = \frac{-[$a]([$var] +[$b])}{-[$a]} \\ + [$c] & = -[$a][$var] -[$step1] + & [$c/-$a] & = [$var] +[$b] \\ + [$c] \mathbf{{}+[$step1]} & = -[$a][$var]-[$step1] \mathbf{{}+[$step1]}\\ + [$step2] & = -[$a][$var] + & [$c/-$a]\mathbf{{}-[$b]} & = [$var] +[$b]\mathbf{{}-[$b]} \\ + \frac{[$step2]}{-[$a]} & = \frac{-[$a][$var]}{-[$a]} + & [$ans] & = [$var] \\ + [$ans] & = [$var] + & [$var] & = [$ans]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses40.pg new file mode 100644 index 0000000000..f565c1b6f9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses40.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 10= -2(x-3) +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','multiply','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$b=random(1,10,1); +$ans = non_zero_random(-10,10,1); +$c= -$a*($ans-$b); + +$left = Formula("$c"); +$right = Formula("-$a*($var-$b)"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +$step1 = $a*$b; +$step2 = $c-$step1; + +BEGIN_PGML_SOLUTION + +Two approaches are shown below. + + [`` +\begin{aligned} + [$c] & = -[$a]([$var] -[$b]) + & [$c] & = -[$a]([$var] -[$b])\\ + [$c] & = -[$a]([$var] +(-[$b])) + & \frac{[$c]}{-[$a]} & = \frac{-[$a]([$var] -[$b])}{-[$a]}\\ + [$c] & = -[$a][$var] +(-[$a]) \cdot (-[$b]) + & [$c/-$a] & = [$var] -[$b]\\ + [$c] & = -[$a][$var] +[$step1] + & [$c/-$a]\mathbf{{}+[$b]} & = [$var] -[$b]\mathbf{{}+[$b]}\\ + [$c] \mathbf{{}-[$step1]} & = -[$a][$var] +[$step1]\mathbf{{}-[$step1]} + & [$ans] & = [$var]\\ + [$step2] & = -[$a][$var] + & [$var] & = [$ans]\\ + \frac{[$step2]}{-[$a]} & = \frac{-[$a][$var]}{-[$a]} \\ + [$ans] & = [$var]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses50.pg new file mode 100644 index 0000000000..1a9ff9a11e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses50.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like -(x+3)=4 +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','multiply','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$ans = random(-10,10,1); +$b=random(1,10,1); +$c= -($ans-$b); + +$left = Formula("-($var-$b)"); +$right = Formula("$c"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +$step1 = $a*$b; +$step2 = $c+$step1; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + -([$var]- [$b]) & = [$c] \\ + (-1) \cdot ([$var]+(-[$b])) & = [$c] \\ + (-1) \cdot [$var] +(-1) \cdot (-[$b]) & = [$c] \\ + -[$var] +[$b] & = [$c] \\ + -[$var] +[$b]\mathbf{{}-[$b]} & = [$c]\mathbf{{}-[$b]} \\ + -[$var] & = [$c-$b] \\ + (-1) \cdot (-[$var]) & = (-1) \cdot ([$c-$b]) \\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses60.pg new file mode 100644 index 0000000000..834f0dec9a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses60.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 10= -(3-x) +# +# Last updated: Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','multiply','distributive','subtract','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$b=random(1,10,1); +$ans = non_zero_random(-10,10,1); +$c= -($b-$ans); + +$left = Formula("$c"); +$right = Formula("-($b-$var)"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$c] & = -([$b] -[$var]) \\ + [$c] & = (-1) \cdot ([$b] +(-[$var])) \\ + [$c] & = (-1) \cdot [$b] +(-1) \cdot (-[$var]) \\ + [$c] & = -[$b] +[$var] \\ + [$c]\mathbf{{}+[$b]} & = -[$b] +[$var] \mathbf{{}+[$b]}\\ + [$ans] & = [$var] \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses70.pg new file mode 100644 index 0000000000..c85f5948b1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses70.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 2(3x-4)=22 +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','distributive','subtract','divide') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=random(2,10,1); +$b=random(2,10,1); +$ans = random(-10,10,1); +$c=random(1,10,1); +$d= $a*($b*$ans-$c); + +$left = Formula("$a*($b*$var-$c)"); +$right = Formula("$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $a*$b; +$step2 = $a*$c; +$step3 = $d+$step2; + +BEGIN_PGML_SOLUTION + +Two approaches are shown below. + + [`` +\begin{aligned} + [$a]([$b][$var] - [$c]) & = [$d] + &[$a]([$b][$var] - [$c]) & = [$d] \\ + [$a]([$b][$var] +(-[$c])) & = [$d] + &\frac{[$a]([$b][$var] - [$c])}{[$a]}& = \frac{[$d]}{[$a]} \\ + [$a] \cdot [$b][$var] +[$a] \cdot (-[$c]) & = [$d] + &[$b][$var] - [$c]& = [$d/$a] \\ + [$step1][$var] -[$step2] &= [$d] + &[$b][$var] - [$c]\mathbf{{}+[$c]}& = [$d/$a]\mathbf{{}+[$c]} \\ + [$step1][$var] -[$step2]\mathbf{{}+[$step2]}&= [$d]\mathbf{{}+[$step2]} + &[$b][$var]& = [$d/$a+$c]\\ + [$step1][$var] & = [$step3] + &\frac{[$b][$var]}{[$b]}& = \frac{[$d/$a+$c]}{[$b]}\\ + \frac{[$step1][$var]}{[$step1]} & = \frac{[$step3]}{[$step1]} + &[$var]& = [$ans]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses80.pg new file mode 100644 index 0000000000..e20eb4d1f2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses80.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 20= -2(4-2x) +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','multiply','distributive','subtract','divide','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=random(2,5,1); +$b=random(1,10,1); +$c=random(2,5,1); +$ans = non_zero_random(-10,10,1); +$d= -$a*($b-$c*$ans); + +$left = Formula("$d"); +$right = Formula("-$a*($b-$c*$var)"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $a*$b; +$step2 = $a*$c; +$step3 = $d+$step1; + +BEGIN_PGML_SOLUTION + +two approaches are shown below. + + [`` +\begin{aligned} + [$d] & = -[$a]([$b] -[$c][$var]) + &[$d] & = -[$a]([$b] -[$c][$var]) \\ + [$d] & = -[$a]([$b] +(-[$c][$var])) + &\frac{[$d]}{-[$a]} & = \frac{-[$a]([$b] -[$c][$var])}{-[$a]} \\ + [$d] & = (-[$a]) \cdot [$b]+(-[$a]) \cdot (-[$c][$var]) + &[$d/-$a] & = [$b] -[$c][$var] \\ + [$d] & = -[$step1] +[$step2][$var] + &[$d/-$a]\mathbf{{}-[$b]} & = [$b] -[$c][$var]\mathbf{{}-[$b]} \\ + [$d]\mathrm{{}+[$step1]} & = -[$step1] +[$step2][$var] \mathrm{{}+[$step1]} + &[$d/-$a-$b] & = -[$c][$var]\\ + [$step3] &= [$step2][$var] + &\frac{[$d/-$a-$b]}{-[$c]} & = \frac{-[$c][$var]}{-[$c]}\\ + \frac{[$step3]}{[$step2]} & = \frac{[$step2][$var]}{[$step2]} + &[$ans] & = [$var]\\ + [$ans] & = [$var] + &[$var] & = [$ans]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses90.pg new file mode 100644 index 0000000000..6fc467b7fc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses90.pg @@ -0,0 +1,135 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve equations like 1+(x+3)=4 and 1-(x+3)=4 +# +# Last updated: Kling 7/21/13; Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +# KEYWORDS('solve','linear','equation','integer','distributive','subtract','negative') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); +#to keep the parens from being dropped +Context()->lists->set(AbsoluteValue => {open => "(", close => ")"}); +Context()->parens->set("(" => {type => "AbsoluteValue", close => ")", removable=>0}); + + +$a=random(2,10,1); +$ans1 = random(-10,10,1); +$b=random(1,10,1); +$c= $a+$ans1+$b; +while ($c==$a) { + $ans1 = random(-10,10,1); + $c= $a+$ans1+$b; +} + +$ans2=-($c-$a)-$b; + +$left1 = Formula("$a+($var+$b)"); +$right1 = Formula("$c"); +$left2 = Formula("$a-($var+$b)"); +$right2 = Formula("$c"); + +@vArray = ($var, $var); +@aArray = ($ans1, $ans2); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + +a) [`` [$left1]=[$right1] ``] + + [_______________________________] + + +b) [`` [$left2]=[$right2] ``] + + [_______________________________] + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +$step1 = $c-$a+$b; + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] + [$a] +([$var] +[$b]) & = [$c] \\ + [$a] + [$var] +[$b] & = [$c] \\ + [$var] +([$a]+[$b]) & = [$c] \\ + [$var] +[$a+$b] & = [$c] \\ + [$var] +[$a+$b]\mathbf{{}-[$a+$b]}& = [$c]\mathbf{{}-[$a+$b]} \\ + [$var] & = [$ans1] +\end{aligned} + `] + + [@summary($ansEqRef->[0],$left1,$right1);@]** + + +b) [` +\begin{aligned}[t] + [$a] - ([$var] +[$b]) & = [$c] \\ + [$a] +(-1) \cdot ([$var] +[$b]) & = [$c] \\ + [$a] + (-1) \cdot [$var] +(-1) \cdot [$b] & = [$c] \\ + [$a] -[$var] -[$b] & = [$c] \\ + -[$var] +([$a]-[$b]) & = [$c] \\ + -[$var] +[$a-$b] & = [$c] \\ + -[$var] +[$a-$b]\mathbf{{}-[$a-$b]} & = [$c]\mathbf{{}-[$a-$b]} \\ + -[$var] & = [$step1] \\ + (-1) \cdot (-[$var]) & = (-1) \cdot ([$step1]) \\ + [$var] & = [$ans2] \\ +\end{aligned} + `] + + [@summary($ansEqRef->[1],$left2,$right2);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion10.pg new file mode 100644 index 0000000000..c9565c4827 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion10.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve proportions given in x/b=c/d. +# +# Last updated: Jordan 8/4/13; Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate','ratio','proportion','solve') +## DBCCSS('6.RP','7.RP.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +$var = 'x'; + +$d = random(2,10,1); + +$factor=list_random((4..9)); +$b = $d*$factor; +$c = random(2,10,1); +while (gcd($c,$d)!=1) {$c = random(2,10,1);} + +$ans = $b*$c/$d; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the equation. + + [`` \frac{x}{[$b]}=\frac{[$c]}{[$d]} ``] + + [_________________] + +END_PGML + +answerCheck($ansEqRef, $eqTypesRef); + + + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \frac{x}{[$b]} &= \frac{[$c]}{[$d]} \\ + [$b]\cdot[$d]\cdot\frac{x}{[$b]} &= [$b]\cdot[$d]\cdot\frac{[$c]}{[$d]} \\ + x \cdot [$d] &= [$b] \cdot [$c] \\ + [$d]x &= [$b*$c] \\ + \frac{[$d]x}{[$d]} &= \frac{[$b*$c]}{[$d]} \\ + x &= [$ans] +\end{aligned} +``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion20.pg new file mode 100644 index 0000000000..20f73ce587 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion20.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve proportions given in a/x=c/d. +# +# Last updated: Jordan 8/4/13; Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate','ratio','proportion','solve') +## DBCCSS('6.RP','7.RP.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +$var = 'x'; + +$c = random(2,10,1); + +$factor=list_random((4..9)); +$a = $c*$factor; +$d = random(2,10,1); +while (gcd($c,$d)!=1) {$d = random(2,10,1);} + +$ans = $a*$d/$c; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this proportion for [`x`]: + + [`` \frac{[$a]}{x}=\frac{[$c]}{[$d]} ``] + + [___________] + +END_PGML + +answerCheck($ansEqRef, $eqTypesRef); + + + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \frac{[$a]}{x} &= \frac{[$c]}{[$d]} \\ + x\cdot[$d]\cdot\frac{[$a]}{x} &= x\cdot[$d]\cdot\frac{[$c]}{[$d]} \\ + [$d] \cdot [$a] &= x \cdot [$c] \\ + [$d*$a] &= [$c]x \\ + \frac{[$d*$a]}{[$c]} &= \frac{[$c]x}{[$c]} \\ + [$ans] &= x\\ + x &= [$ans] +\end{aligned} +``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion30.pg new file mode 100644 index 0000000000..8fb57dfc2d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion30.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve proportions given in a/b=x/d. +# +# Last updated: Jordan 8/4/13; Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate','ratio','proportion','solve') +## DBCCSS('6.RP','7.RP.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +$var = 'x'; + +$b = random(2,10,1); + +$factor=list_random((4..9)); +$d = $b*$factor; +$a = random(2,10,1); +while (gcd($b,$a)!=1) {$a = random(2,10,1);} + +$ans = $a*$d/$b; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve the equation. + + [`` \frac{[$a]}{[$b]}=\frac{x}{[$d]} ``] + + [___________] + +END_PGML + +answerCheck($ansEqRef, $eqTypesRef); + + + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \frac{[$a]}{[$b]} &= \frac{x}{[$d]} \\ + [$b]\cdot[$d]\cdot\frac{[$a]}{[$b]} &= [$b]\cdot[$d]\cdot\frac{x}{[$d]} \\ + [$d] \cdot [$a] &= [$b] \cdot x \\ + [$d*$a] &= [$b]x \\ + \frac{[$d*$a]}{[$b]} &= \frac{[$b]x}{[$b]} \\ + [$ans] &= x\\ + x &= [$ans] +\end{aligned} +``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion40.pg new file mode 100644 index 0000000000..a3873b80dc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion40.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao, 2013 +# Portland Community College +# +# Solve proportions given in a/b=c/x. +# +# Last updated: Jordan 8/4/13; Yao, 6/26/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate','ratio','proportion','solve') +## DBCCSS('6.RP','7.RP.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +$var = 'x'; + + +$a = list_random((2,4,5,8,10)); + +$b = random(3,9,2); +$c = random(3,9,2); + +Context("Fraction"); +$ans = Fraction($b*$c,$a); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Solve this proportion for [`x`]: + + [`` \frac{[$a]}{[$b]}=\frac{[$c]}{x} ``] + + [___________] + +END_PGML + +answerCheck($ansEqRef, $eqTypesRef); + + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \frac{[$a]}{[$b]} &= \frac{[$c]}{x} \\ + [$b]x\cdot\frac{[$a]}{[$b]} &= [$b]x\cdot\frac{[$c]}{x} \\ + x \cdot [$a] &= [$b] \cdot [$c] \\ + [$a]x &= [$b*$c] \\ + \frac{[$a]x}{[$a]} &= \frac{[$b*$c]}{[$a]} \\ + x &= [$ans] +\end{aligned} +``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation10.pg new file mode 100644 index 0000000000..1cad4bb870 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation10.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equation with no solution. +# +# Last updated: Jordan 7/20/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','no solution','all real numbers') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,2); +$b=random(1,9,1); + +@vArray = ($var); +@aArray = (0); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + +$ansEq=Compute("no solution"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$a][$var]=[$a][$var]+[$b] ``] + + [_______________________________]{$ansEq->cmp(typeMatch=>Formula("$var=0"), cmp_class=>"an equation of the form $var = $US$US$US")} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a][$var] &= [$a][$var]+[$b] \\ + [$a][$var]\mathbf{{}-[$a][$var]} &= [$a][$var]+[$b]\mathbf{{}-[$a][$var]} \\ + 0 &= [$b] +\end{aligned} + ``] + +Since the original equation is equivalent to an equation that is false no matter what the value of [`[$var]`] is, the equation has no solution. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation20.pg new file mode 100644 index 0000000000..137c7b5e82 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation20.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equation with infinite solutions. +# +# Last updated: Jordan 7/21/13; Kling 7/21/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','no solution','all real numbers') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,2); +$b=random(1,9,1); + + + +@vArray = ($var); +@aArray = (0); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +$ansEq = Compute("all real numbers"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$a][$var]+[$b]=[$a][$var]+[$b] ``] + + [_______________________________]{$ansEq->cmp(typeMatch=>Formula("$var=0"), cmp_class=>"an equation of the form $var = $US$US$US")} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a][$var]+[$b] &= [$a][$var]+[$b] \\ +[$a][$var]+[$b]\mathbf{{}-[$a][$var] -[$b]} &= [$a][$var]+[$b]\mathbf{{}-[$a][$var] -[$b]} \\ + 0&= 0 +\end{aligned} + ``] + +Since the original equation is equivalent to an equation that is true no matter what the value of [`[$var]`] is, the equation's solution set is all real numbers. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation30.pg new file mode 100644 index 0000000000..fa3f28ef7a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation30.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equation with infinite solutions. +# +# Last updated: Jordan 7/21/13; Kling 7/21/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','combine','subtract','no solution','all real numbers') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$b=random(2,10,1); +$c=$a+1; +$f=random(1,5,1); +$d=$b+$f; + +@vArray = ($var); +@aArray = (0); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +$ansEq=Compute("all real numbers"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$a][$var]-[$b]-[$c][$var]=-[$d]-[$var]+[$f] ``] + + [_______________________________]{$ansEq->cmp(typeMatch=>Formula("$var=0"), cmp_class=>"an equation of the form $var = $US$US$US")} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a][$var]-[$b]-[$c][$var] &= -[$d]-[$var]+[$f] \\ + ([$a]-[$c])[$var]-[$b] &= (-[$d]+[$f])-[$var] \\ + -[$var] -[$b] &= -[$b]-[$var] \\ + -[$var] -[$b] \mathbf{{}+[$var] +[$b]} &= -[$b]-[$var]\mathbf{{}+[$var] +[$b]} \\ + 0 &= 0 +\end{aligned} + ``] + +Since the original equation is equivalent to an equation that is true no matter what the value of [`[$var]`] is, the equation's solution set is all real numbers. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation40.pg new file mode 100644 index 0000000000..8c50e6da42 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation40.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equation with no solution. +# +# Last updated: Jordan 7/21/13; Kling, 7/21/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','combine','subtract','no solution','all real numbers') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(5,10,1); +$b=random(5,10,1); +$c=random(1,$a,1); +$e=random(-$a+$c+1,20,1); +$f=$b-1; + +@vArray = ($var); +@aArray = (0); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +$ansEq=Compute("no solution"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` -[$a]-[$b][$var]+[$c] = -[$var]+[$e]-[$f][$var] ``] + + [_______________________________]{$ansEq->cmp(typeMatch=>Formula("$var=0"), cmp_class=>"an equation of the form $var = $US$US$US")} + + + +END_PGML + +############################################## + +$s1 = abs(-$a+$c); +$s2 = $e+$s1; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + -[$a]-[$b][$var]+[$c] &= -[$var]+[$e]-[$f][$var] \\ + (-[$a]+[$c])-[$b][$var] &= (-1-[$f])[$var]+[$e] \\ + (-[$a]+[$c])-[$b][$var] &= (-1-[$f])[$var]+[$e] \\ + -[$s1] -[$b][$var] &= -[$b][$var]+[$e] \\ + -[$s1] -[$b][$var]\mathbf{{}+[$s1]+[$b][$var]} &= -[$b][$var]+[$e]\mathbf{{}+[$s1]+[$b][$var]} \\ + 0 &= [$s2] +\end{aligned} + ``] + +Since the original equation is equivalent to an equation that is false no matter what the value of [`[$var]`] is, the equation has no solution. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation50.pg new file mode 100644 index 0000000000..4d4fe526e9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation50.pg @@ -0,0 +1,135 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equation with no solution, infinitely solutions +# and x=0 as a solution. +# +# Last updated: Jordan 7/21/13; Kling 7/21/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','subtract','no solution','infinite solutions') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserAssignment.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(5,10,1); +$b=random(2,10,1); +$c=random(2,$a-2,1); +$d=$b+random(1,5,1); + +@vArray = ($var); +@aArray = (0); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + +$ansEq2 = Compute("all real numbers"); +$ansEq3 = Compute("no solution"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** +a) [` [$a][$var]+[$b]=[$c][$var]+[$b] `] + + [_______________________________] + +b) [`[$a][$var]+[$b]=[$a][$var]+[$b] `] + + [_______________________________] + +c) [`[$a][$var]+[$b]=[$a][$var]+[$d] `] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +ANS($ansEq2->cmp(typeMatch=>Formula("$var=0"), cmp_class=>"an equation of the form $var = $US$US$US")); + +ANS($ansEq3->cmp(typeMatch=>Formula("$var=0"), cmp_class=>"an equation of the form $var = $US$US$US")); + + + +############################################## + +$s1 = $a-$c; +$s2 = $d-$b; + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] + [$a][$var]+[$b] &= [$c][$var]+[$b] \\ + [$a][$var]+[$b]\mathbf{{}-[$c][$var]-[$b]} &= [$c][$var]+[$b]\mathbf{{}-[$c][$var]-[$b]} \\ + [$s1][$var] &= 0 \\ + \frac{[$s1][$var]}{[$s1]} &= \frac{0}{[$s1]} \\ + [$var] &= 0 +\end{aligned} + `] + + The solution to the equation is [`0`]. + We can check our work by substituting [`0`] into the original equation. + Be sure to check your solution. +---- + +b) [` +\begin{aligned}[t] + [$a][$var]+[$b] &= [$a][$var]+[$b] \\ + [$a][$var]+[$b]\mathbf{{}-[$a][$var]-[$b]} &= [$a][$var]+[$b]\mathbf{{}-[$a][$var]-[$b]} \\ + 0 &= 0 +\end{aligned} + `] + + Since the original equation is equivalent to an equation that is true no matter what the value of [`[$var]`] is, the equation's solution set is all real numbers. +---- + +c) [` +\begin{aligned}[t] + [$a][$var]+[$b] &= [$a][$var]+[$d] \\ + [$a][$var]+[$b]\mathbf{{}- [$a][$var]-[$b]} &= [$a][$var]+[$d]\mathbf{{}- [$a][$var]-[$b]} \\ + 0 &= [$s2] +\end{aligned} + `] + + Since the original equation is equivalent to an equation that is false no matter what the value of [`[$var]`] is, the equation has no solution. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation60.pg new file mode 100644 index 0000000000..76b1a127d5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation60.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equation with no solution. +# +# Last updated: Jordan 7/21/13; Kling 7/21/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','combine','distributive','subtract','no solution','all real numbers') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,5,1); +$b=random(1,9,1); +$c=random(2,10,2); +$d=random(2,10,2); +$e=random(1,10,1); + +$h=random(1,10,1); +$i=($a*$c+$d)/2; +$f=random(2*$h+1,25,1); +#make sure there is no solution +while ($f==$a*$b+$e+2*$h) {$f=random(2*$h+1,25,1);} + +@vArray = ($var); +@aArray = (0); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +$ansEq = Compute("no solution"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$a]([$b]-[$c][$var])-([$d][$var]-[$e]) = [$f]-2([$h]+[$i][$var]) ``] + + [_______________________________]{$ansEq->cmp(typeMatch=>Formula("$var=0"), cmp_class=>"an equation of the form $var = $US$US$US")} + + +END_PGML + +############################################## + +$s1=$a*$b; +$s2=$a*$c; +$s3=2*$h; +$s4=2*$i; +$s5=$s1+$e; +$s6=$s2+$d; +$s7=$f-$s3; +$s8=$s5-$s7; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a]([$b]-[$c][$var])-([$d][$var]-[$e]) &= [$f]-2([$h]+[$i][$var]) \\ + [$a]([$b]+(-[$c][$var]))+ (-1) \cdot ([$d][$var]+(-[$e])) &=[$f]+(-2) \cdot ([$h]+[$i][$var]) \\ + [$a] \cdot [$b]+ [$a] \cdot (-[$c][$var])+ (-1) \cdot [$d][$var]+ (-1) \cdot(-[$e]) &= [$f]+(-2) \cdot [$h]+(-2) \cdot [$i][$var] \\ + [$s1] - [$s2][$var] -[$d][$var]+ [$e] &= [$f]-[$s3]-[$s4][$var] \\ + [$s1]+ [$e] +(- [$s2] -[$d])[$var] &= ([$f]-[$s3])-[$s4][$var] \\ + [$s5] -[$s6][$var] &= [$s7]-[$s4][$var] \\ + [$s5] -[$s6][$var] \mathbf{{}-[$s7]+[$s6][$var]}&= [$s7]-[$s4][$var] \mathbf{{}-[$s7]+[$s6][$var]} \\ + [$s8] &=0 +\end{aligned} + ``] + +Since the original equation is equivalent to an equation that is false no matter what the value of [`[$var]`] is, the equation has no solution. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation70.pg new file mode 100644 index 0000000000..0fc7d41952 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation70.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equation with infinite solutions. +# +# Last updated: Jordan 7/21/13; Kling 7/21/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','distributive','subtract','no solution','all real numbers') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$b=random(3,6,1); +$c=random(2,10,1); +$d=random(3,6,1); +$e=$b*$d+1; +$f=random(1,8,1); +$a=$b*$c-$f; + +Context()->variables->are($var=>'Real'); +$left = Formula("$a-$b($c+$d$var)"); +$right = Formula("-[$e][$var] -([$f]-[$var]) "); + +@vArray = ($var); +@aArray = (0); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +$ansEq = Compute("all real numbers"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________]{$ansEq->cmp(typeMatch=>Formula("$var=0"), cmp_class=>"an equation of the form $var = $US$US$US")} + + + +END_PGML + +############################################## + +$s1=$b*$c; +$s2=$b*$d; +$s3=$a-$s1; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$a]+(-[$b])([$c]+[$d][$var]) &= -[$e][$var] +(-1)([$f]+(-[$var])) \\ + [$a]+(-[$b]) \cdot [$c]+ (-[$b]) \cdot ([$d][$var]) &= -[$e][$var] +(-1) \cdot [$f]+ (-1) \cdot (-[$var]) \\ + [$a]-[$s1]- [$s2][$var] &= -[$e][$var] - [$f]+ [$var] \\ + ([$a]-[$s1])- [$s2][$var] &= (-[$e]+1)[$var] - [$f] \\ + [$s3]- [$s2][$var] &= -[$s2][$var] - [$f] \\ + [$s3]- [$s2][$var]\mathbf{{} +[$s2][$var]+[$f]} &= -[$s2][$var] - [$f]\mathbf{{} +[$s2][$var]+[$f]} \\ + 0 &= 0 +\end{aligned} + ``] + +Since the original equation is equivalent to an equation that is true no matter what the value of [`[$var]`] is, the equation's solution set is all real numbers. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation80.pg new file mode 100644 index 0000000000..3f439f8c2f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation80.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Solve linear equation with infinite solutions. +# +# Last updated: Jordan 7/21/13; Kling 7/21/13; Hughes 7/2/13 Yao, 6/27/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','distributive','no solution','all real numbers') +## DBCCSS('6.EE.7','7.EE.4','8.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,2); +$b=random(5,10,1); +$c=random(1,4,1); + +@vArray = ($var); +@aArray = (0); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +$ansEq = Compute("no solution"); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$a]([$var]-[$b])=[$a]([$var]-[$c]) ``] + + [_______________________________]{$ansEq->cmp(typeMatch=>Formula("$var=0"), cmp_class=>"an equation of the form $var = $US$US$US")} + + + +END_PGML + +############################################## + +$s1=$a*$b; +$s2=$a*$c; +$s3=$s1-$s2; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a]([$var]-[$b]) &= [$a]([$var]-[$c]) \\ + [$a][$var]-[$a] \cdot [$b] &= [$a][$var]-[$a] \cdot [$c] \\ + [$a][$var]-[$s1] &= [$a][$var]-[$s2] \\ + [$a][$var]-[$s1] \mathbf{{} -[$a][$var]+[$s1]}&= [$a][$var]-[$s2]\mathbf{{} -[$a][$var]+[$s1]} \\ + 0 &= [$s3] +\end{aligned} + ``] + +Since the original equation is equivalent to an equation that is false no matter what the value of [`[$var]`] is, the equation has no solution. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/compareEquationExpression10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/compareEquationExpression10.pg new file mode 100644 index 0000000000..a55a672d1c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/compareEquationExpression10.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Compare solving equation and evaluating expression. +# +# Last updated: Yao 4/15/2017 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "PGcourse.pl", + "SolveLinearEquationPCC.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=non_zero_random(-9,9,1); +$ans = random(2,10,1); +$left= Compute("$var+$a")->reduce; +$right = $left->eval($var=>$ans); +$right = Compute($right); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray,~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +a) Solve [`` [$left]=[$right] ``]. + + [_______________________________] + +b) Evaluate [``[$left]``] when [`[$var]=[$ans]`]. + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); +ANS($right->cmp()); + +############################################## + + +BEGIN_PGML_SOLUTION + +a. To solve the equation [`[$left]=[$right]`], we are looking for a number which makes the equation true. The solution should have [`[$var]`] separated on one side of the equal sign, looking like [`[$var]=\text{a number}`]: + + [`` + \begin{aligned} + [$var]+[$a] &= [$right] \\ + [$var]+[$a]\mathbf{{}-[$a]} &= [$right]\mathbf{{}-[$a]} \\ + [$var] &=[$ans] + \end{aligned} + ``] + + +b. To evaluate [`[$left]`] when [`[$var]=[$ans]`], we substitute [`[$var]`] with [`[$ans]`] in [`[$left]`], and we have: + + [`` +\begin{aligned} + [$left] &= [$ans]+[$a] \\ + &= [$right] +\end{aligned} + ``] + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/compareEquationExpression20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/compareEquationExpression20.pg new file mode 100644 index 0000000000..ae4462bb9b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/compareEquationExpression20.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Compare solving equation, evaluating expression and simplifying expression. +# +# Last updated: Yao 4/15/2017 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "PGcourse.pl", + "SolveLinearEquationPCC.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,5,1); +$b=non_zero_random(-9,9,1); +$c=non_zero_random(-9,9,1); +do {$ans = random(2,10,1);} until ($ans!=-$b); +$left= Compute("$a($var+$b)+$c")->reduce; +$right = $left->eval($var=>$ans); +$right = Compute($right); + +$ab = $a*$b; +$s = $ab+$c; +$simplified = Compute("$a*$var+$s")->reduce; +$s1 = $right-$s; +$s2 = $ans+$b; +$s3 = $a*$s2; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray,~~@aArray); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +a) Solve [`` [$left]=[$right] ``]. + + [_______________________________] + +b) Evaluate [``[$left]``] when [`[$var]=[$ans]`]. + + [_______________________________] + +c) Simplify [``[$left]``]. + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); +ANS($right->cmp()); +ANS($simplified->cmp()); + +############################################## + + +BEGIN_PGML_SOLUTION + +a. To solve the equation [`[$left]=[$right]`], we are looking for a number which makes the equation true. The solution should have [`[$var]`] separated on one side of the equal sign, looking like [`[$var]=\text{a number}`]: + + [`` + \begin{aligned} + [$left] &= [$right] \\ + [$a][$var]+[$ab]+[$c] &= [$right] \\ + [$a][$var]+[$s] &= [$right] \\ + [$a][$var]+[$s]\mathbf{{}-[$s]} &= [$right]\mathbf{{}-[$s]} \\ + [$a][$var] &= [$s1] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$s1]}{[$a]} \\ + [$var] &=[$ans] + \end{aligned} + ``] + + +b. To evaluate [`[$left]`] when [`[$var]=[$ans]`], we substitute [`[$var]`] with [`[$ans]`] in [`[$left]`], and we have: + + [`` +\begin{aligned} + [$left] &= [$a]([$ans]+[$b])+[$c] \\ + &= [$a]([$s2])+[$c] \\ + &= [$s3]+[$c] \\ + &= [$right] +\end{aligned} + ``] + +c. To simplify [`[$left]`], we use the distributive property to get rid of parenthesis, and then combine like terms: + + [`` +\begin{aligned} + [$left] &= [$a][$var]+[$ab]+[$c] \\ + &= [$simplified] +\end{aligned} + ``] + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps10.pg new file mode 100644 index 0000000000..ea69d2df0e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps10.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x +b = 0 +# +# a, b are integer. +# +# Last updated: Hughes 7/24/13, Jordan 7/5/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$ans = random(-10,-2,1); +$b= -$a*$ans; +$c = 0; + +$left=Formula("$a*$var+$b"); +$right=Formula("$c"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a][$var] + [$b] &= [$c] \\ + [$a][$var] +[$b]\mathbf{{}-[$b]} &= [$c] \mathbf{{}-[$b]} \\ + [$a][$var] &= [$c-$b] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$c-$b]}{[$a]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps100.pg new file mode 100644 index 0000000000..d13f0ff400 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps100.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve this linear equation: +# +# [`` -[$f]+[$g]=[$a]x-[$d]-[$b]x+[$e]+[$c]x ``] +# +# Solution: [`` \quad x= ``] [_______]{$ans} +# +# Last updated: Jordan, 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +do {$b=random(2,10,1)} until (abs(-1+$b-$a)>1); +$c=-1+$b-$a; + +$d= random(6,10,1); +$e= random(1,5,1); +$ans = random(-10,10,1); +$f=random(1,10,1); +$g = -$ans -$d +$e +$f; + +$left = Formula("-$f+$g"); +$right = Formula("$a*$var-$d-$b*$var+$e+$c*$var")->reduce; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $g-$f+$d-$e; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + -[$f] +[$g] & = [$a][$var] -[$d] -[$b][$var] +[$e] +[$c][$var] \\ + [$g-$f] & = ([$a]-[$b]+[$c])[$var] -[$d]+[$e] \\ + [$g-$f] & = -[$var]-[$d-$e] \\ + [$g-$f]\mathbf{{}+[$d-$e]}& = -[$var]-[$d-$e]\mathbf{{}+[$d-$e]} \\ + [$step1] & = -[$var] \\ + (-1) \cdot ([$step1]) &= (-1) \cdot (-[$var]) \\ + [$ans] &= [$var]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps110.pg new file mode 100644 index 0000000000..54e7569cda --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps110.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve this linear equation: +# +# [`` [$a]x+[$b] = x+[$d] ``] +# +# Solution: [`` \quad x= ``] [_______]{$ans} +# +# Last updated: Jordan 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(6,10,1); +$b=random(2,10,1); +$c=1; +$ans=random(2,10,1); +$d=$a*$ans+$b-$c*$ans; +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left = Formula("$a $var+$b"); +$right = Formula("$var+$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [` [$left] = [$right] `] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + +The first step is to subtract terms in order to separate the variable and non-variable terms. [``` +\begin{aligned} + [$a][$var] +[$b] &= [$var] +[$d] \\ +[$a][$var] +[$b]\mathbf{{}-[$var]-[$b]} &= [$var] +[$d]\mathbf{{}-[$var]-[$b]} \\ + [$a-$c][$var] &= [$d-$b] \\ + \frac{[$a-$c][$var]}{[$a-$c]} & = \frac{[$d-$b]}{[$a-$c]} \\ + [$var] &= [$ans] +\end{aligned} + ```] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps120.pg new file mode 100644 index 0000000000..6d018ba66a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps120.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve this linear equation: +# +# [`` -[$a]z+[$b] = -z-[$d] ``] +# +# Solution: [`` \quad z= ``] [_______]{$ans} +# +# Last updated: Jordan, 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$b=random(2,10,1); +$ans=random(1,10,1); + +#make sure $d is negative +while ($b-($a-1)*$ans>=0) { +$a=random(2,10,1); +$b=random(2,10,1); +$ans=random(1,10,1); +} + +$d=abs($b-($a-1)*$ans); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left = Formula("-$a $var+$b"); +$right = Formula("-$var-$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + -[$a][$var] + [$b] &= -[$var] -[$d] \\ + -[$a][$var] + [$b]\mathbf{{}+[$a][$var] +[$d]} &= -[$var] -[$d]\mathbf{{}+[$a][$var] +[$d]} \\ + [$b+$d] & = [$a-1][$var] \\ + \frac{[$b+$d]}{[$a-1]} &= \frac{[$a-1][$var]}{[$a-1]} \\ + [$ans] & = [$var]\\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps130.pg new file mode 100644 index 0000000000..d3d9f4f8c1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps130.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve this linear equation: +# +# [`` [$a]-[$b]x = [$c]x+[$d] ``] +# +# Solution: [`` \quad x= ``] [_______]{$ans} +# +# Last updated: Jordan 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=random(2,10,1); +$b=random(2,10,1); +$ans=random(-10,-1,1); +$c=random(2,10,1); +$d=$a+(-$b-$c)*$ans; +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left = Formula("$a-$b $var"); +$right = Formula("$c $var+$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] -[$b][$var] &= [$c][$var] +[$d] \\ + [$a]-[$b][$var]\mathbf{{}+[$b][$var] -[$d]}&= [$c][$var]+[$d]\mathbf{{}+[$b][$var] -[$d]} \\ + [$a-$d] &= [$c+$b][$var] \\ + \frac{[$a-$d]}{[$c+$b]} & = \frac{[$c+$b][$var]}{[$c+$b]} \\ + [$ans] &= [$var]\\ + [$var] &=[$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps140.pg new file mode 100644 index 0000000000..8e4ca24d1e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps140.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# +# Solve this linear equation: +# +# [`` a-[$a]-[$b]a = -[$c]-[$d]a+[$e] ``] +# +# Solution: [`` \quad a= ``] [_______]{$ans} +# +# Last updated: Jordan, 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$b=random(3,10,1); +$c=random(2,10,1); +do {$d=random(2,10,1)} until (abs(1-$b+$d)>1); +$ans=random(-10,10,1); + +#make sure $e is positive +$e=$ans-$a-$b*$ans+$c+$d*$ans; +while ($e<=0) { + $ans=random(-10,10,1); + $e=$ans-$a-$b*$ans+$c+$d*$ans; +} +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left = Formula("$var-$a-$b $var"); +$right = Formula("-$c-$d $var+$e"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = 1-$b; +$step2 = 1-$b+$d; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$var] -[$a] -[$b][$var] & = -[$c] -[$d][$var] +[$e] \\ + (1-[$b])[$var] -[$a] &= (-[$c]+[$e])-[$d][$var] \\ + [$step1][$var] -[$a] &= [$e-$c]-[$d][$var] \\ + [$step1][$var] -[$a]\mathbf{{}+[$a] +[$d][$var]} &= [$e-$c]-[$d][$var]\mathbf{{}+[$a] +[$d][$var]} \\ + [$step2][$var] &= [$e-$c+$a] \\ + \frac{[$step2][$var]}{[$step2]} &= \frac{[$e-$c+$a]}{[$step2]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps150.pg new file mode 100644 index 0000000000..caa632fb37 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps150.pg @@ -0,0 +1,142 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve these linear equations: +# +# a) [`` [$a]x+[$b] = [$c]x+[$d] ``] +# +# Solution: [`` \quad x= ``] [_______]{$ans1} +# +# b) [`` [$c]y+[$b] = [$a]y-[$e] ``] +# +# Solution: [`` \quad y= ``] [_______]{$ans2} +# +# Last updated: Jordan, 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName()} until ($var1 ne $var2); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { +$a=random(6,10,1); +$b=random(2,10,1); +$c=random(1,5,1); +$ans1=random(2,10,1); +$d=$a*$ans1+$b-$c*$ans1; + +#Make sure $e is negative. + $ans2=random(2,10,1); + $e=$c*$ans2+$b-$a*$ans2; +} until ($e<0); + +$e= abs($e); #using "-$e" in presentation +Context()->variables->are($var1=>'Real',$var2=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left1 = Formula("$a $var1 + $b"); +$left2 = Formula("$c $var2 + $b"); +$right1 = Formula("$c $var1 + $d"); +$right2 = Formula("$a $var2 - $e"); + + +@vArray = ($var1, $var2); +@aArray = ($ans1, $ans2); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + +a) [`` [$left1] = [$right1] ``] + + [_______________________________] + + +b) [`` [$left2] = [$right2] ``] + + [_______________________________] + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + +a) We should move the [`[$var1]`] terms to the left side, so that their coefficient is positive. + + [`` +\begin{aligned} + [$a][$var1] +[$b] &= [$c][$var1]+[$d] \\ +[$a][$var1] +[$b]\mathbf{{}-[$c][$var1] -[$b]} &= [$c][$var1]+[$d]\mathbf{{}-[$c][$var1] -[$b]} \\ + [$a-$c][$var1] & = [$d-$b] \\ + \frac{[$a-$c][$var1]}{[$a-$c]} &= \frac{[$d-$b]}{[$a-$c]} \\ + [$var1] &= [$ans1] +\end{aligned} +``] + + [@summary($ansEqRef->[0],$left1,$right1);@]** + + +b) We should move the [`[$var2]`] terms to the right side, so that their coefficient is positive. + + [`` +\begin{aligned} + [$c][$var2] +[$b] &= [$a][$var2] -[$e] \\ + [$c][$var2] +[$b]\mathbf{{}-[$c][$var2] +[$e]} &= [$a][$var2] -[$e]\mathbf{{}-[$c][$var2] +[$e]} \\ + [$b+$e] &= [$a-$c][$var2] \\ + \frac{[$b+$e]}{[$a-$c]} &= \frac{[$a-$c][$var2]}{[$a-$c]} \\ + [$ans2] &= [$var2]\\ + [$var2] &= [$ans2] +\end{aligned} +``] + + [@summary($ansEqRef->[1],$left2,$right2);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps160.pg new file mode 100644 index 0000000000..3a30d35375 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps160.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve this linear equation: +# +# [`` -[$a]z+[$b]z = [$c]-[$d]z-[$e] ``] +# +# Solution: [`` \quad z= ``] [_______]{$ans} +# +# Last updated: Jordan, 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(6,10,1); +$b=random(2,5,1); +$c=random(2,10,1); +$d=random(2,10,1); +#make sure x terms are not cancelled +while ((-$a+$b)==(-$d)) {$d=random(2,10,1);} + +$ans=random(-10,10,1); + +#make sure $e's place has a negative value, and $e+$c<0. +$e=-$a*$ans+$b*$ans-$c+$d*$ans; +while ($e+$c>=0) { + $ans=random(-10,10,1); + $e=-$a*$ans+$b*$ans-$c+$d*$ans; +} +$e=-$e; +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + +$left = Formula("-$a $var + $b $var"); +$right = Formula("$c - $d $var - $e"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` -[$a][$var]+[$b][$var] = [$c]-[$d][$var]-[$e] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $b-$a+$d; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + -[$a][$var] +[$b][$var] & = [$c] -[$d][$var] -[$e] \\ + (-[$a]+[$b])[$var] & = ([$c]-[$e]) -[$d][$var] \\ + [$b-$a][$var] &= [$c-$e] -[$d][$var] \\ + [$b-$a][$var]\mathbf{{}+[$d][$var]} &= [$c-$e]-[$d][$var]\mathbf{{}+[$d][$var]} \\ + [$step1][$var] &= [$c-$e] \\ + \frac{[$step1][$var]}{[$step1]} &= \frac{[$c-$e]}{[$step1]} \\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps170.pg new file mode 100644 index 0000000000..d6e4008e8d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps170.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve this linear equation: +# +# [`` [$a]x+[$b] = -[$c]x+[$d]-[$e]x ``] +# +# Solution: [`` \quad x= ``] [_______]{$ans} +# +# Last updated: Jordan 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$b=random(2,10,1); +$c=random(2,10,1); +$d=$b; +$e=random(2,10,1); +#make sure x terms are not cancelled +while (($a+$c)==(-$e)) {$e=random(2,10,1);} + +$ans=0; +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left = Formula("$a $var + $b"); +$right = Formula("-$c $var+$d-$e $var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [` [$left] = [$right] `] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = abs(-$c-$e); +$step2 = $a+$step1; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a][$var] +[$b] &= -[$c][$var] +[$d] -[$e][$var] \\ + [$a][$var] +[$b] &= (-[$c]-[$e])[$var] +[$d] \\ + [$a][$var] +[$b] &= -[$step1][$var]+[$d] \\ + [$a][$var]+[$b]\mathbf{{} +[$step1][$var] -[$b]}&=-[$step1][$var]+[$d]\mathbf{{} +[$step1][$var] -[$b]} \\ + [$step2][$var] &= [$d-$b] \\ + \frac{[$step2][$var]}{[$step2]} &= \frac{[$d-$b]}{[$step2]} \\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps180.pg new file mode 100644 index 0000000000..e967b1279a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps180.pg @@ -0,0 +1,178 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve these linear equation: +# +# 1) [`` -a+[$a]=[$a] ``] +# +# [`` a= ``] [_______]{$ans1} +# +# 2) [`` -b+[$a]=-[$a] ``] +# +# [`` b= ``] [_______]{$ans2} +# +# 3) [`` -c-[$a]=[$a] ``] +# +# [`` c= ``] [_______]{$ans3} +# +# 4) [`` \quad -d-[$a]=-[$a] ``] +# +# [`` d= ``] [_______]{$ans4} +# +# Last updated: Hughes 7/24/13, Jordan 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName()} until ($var2 ne $var1); +do {$var3 = RandomVariableName()} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName()} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real',$var4=>'Real'); +Context()->flags->set(reduceConstants=>0); + +$a=random(2,10,1); +$ans1 = 0; +$ans2 = 2*$a; +$ans3 = -2*$a; +$ans4 = 0; +$left1=Formula("-$var1+$a"); +$left2=Formula("-$var2+$a"); +$left3=Formula("-$var3-$a"); +$left4=Formula("-$var4-$a"); +$right1=Formula("$a"); +$right2=Formula("-$a"); +$right3=Formula("$a"); +$right4=Formula("-$a"); + +@vArray = ($var1, $var2, $var3, $var4); +@aArray = ($ans1, $ans2, $ans3, $ans4); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** +a) [`` [$left1]=[$right1] ``] + + [_______________________________] + + +b) [`` [$left2]=[$right2] ``] + + [_______________________________] + + +c) [`` [$left3]=[$right3] ``] + + [_______________________________] + + +d) [`` [$left4]=[$right4] ``] + + [_______________________________] + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$b = 2*$a; + +BEGIN_PGML_SOLUTION + +a) [`` +\begin{aligned}[t] + -[$var1] +[$a] & = [$a] \\ + -[$var1] +[$a]\mathbf{{}-[$a]} & = [$a]\mathbf{{}-[$a]} \\ + -[$var1] & = 0 \\ + (-1) \cdot (-[$var1]) &= (-1) \cdot 0 \\ + [$var1] &= [$ans1] +\end{aligned} +``] + + [@summary($ansEqRef->[0],$left1,$right1);@]** +---- + +b) [`` +\begin{aligned}[t] + -[$var2] +[$a] &= -[$a] \\ + -[$var2] +[$a]\mathbf{{}-[$a]} &= -[$a]\mathbf{{}-[$a]} \\ + -[$var2] & = -[$b] \\ + (-1) \cdot (-[$var2]) &= (-1) \cdot (-[$b]) \\ + [$var2] & = [$ans2] +\end{aligned} +``] + + [@summary($ansEqRef->[1],$left2,$right2);@]** +---- + +c) [`` +\begin{aligned}[t] + -[$var3] -[$a] &= [$a] \\ + -[$var3] -[$a] \mathbf{{}+[$a]} &= [$a]\mathbf{{}+[$a]} \\ + -[$var3] &= [$b] \\ + (-1) \cdot (-[$var3]) &= (-1) \cdot [$b] \\ + [$var3] & = [$ans3] +\end{aligned} +``] + + [@summary($ansEqRef->[2],$left3,$right3);@]** +---- + +d) [`` +\begin{aligned}[t] + -[$var4] -[$a] &= -[$a] \\ + -[$var4] -[$a] \mathbf{{}+[$a]} &= -[$a]\mathbf{{}+[$a]} \\ + -[$var4] &= 0 \\ + (-1) \cdot (-[$var4]) &=(-1) \cdot 0 \\ + [$var4] & = [$ans4] +\end{aligned} +``] + + [@summary($ansEqRef->[3],$left4,$right4);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps20.pg new file mode 100644 index 0000000000..b56602afb9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps20.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x + bx + c = d +# +# a, b, c are integer. +# +# Last updated: Jordan, 7/5/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$b=random(2,10,1); +$ans = random(2,10,1); +$c=random(1,6,1); + +Context()->variables->are($var=>'Real'); +$func = Compute("$a*$var+$b*$var+$c")->reduce; +$d = $func->eval($var=>$ans); + +$left = Formula("$a*$var+$b*$var+$c"); +$right = Formula("$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a][$var] + [$b][$var] + [$c] &= [$d] \\ + [$a+$b][$var] + [$c] &= [$d] \\ + [$a+$b][$var] +[$c] \mathbf{{}-[$c]}&= [$d]\mathbf{{}-[$c]}\\ + [$a+$b][$var] +[$c]&= [$d-$c] \\ + \frac{[$a+$b][$var]}{[$a+$b]} &= \frac{[$d-$c]}{[$a+$b]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps30.pg new file mode 100644 index 0000000000..a15c91d13c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps30.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x +b + c = d +# +# a, b, c are integer. +# +# Last updated: Jordan 7/5/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$b=random(2,10,1); +$ans = random(2,10,1); +$c=random(1,10,1); + +Context()->variables->are($var=>'Real'); +$func = Compute("$a*$var+$b+$c")->reduce; +$d = $func->eval($var=>$ans); + +$left = Formula("$a*$var+$b+$c"); +$right = Formula("$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a][$var] + [$b] + [$c] &= [$d] \\ + [$a][$var]+ [$b+$c] &= [$d] \\ + [$a][$var]+ [$b+$c]\mathbf{{}-[$b+$c]} &= [$d]\mathbf{{}-[$b+$c]} \\ + [$a][$var]+[$b+$c] &= [$d-$b-$c] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$d-$b-$c]}{[$a]} \\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps40.pg new file mode 100644 index 0000000000..9212a084d9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps40.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# $a + $b = $c * z-z+$d +# +# a, b, c, d are integer. +# +# Last updated: Jordan, 7/5/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var => 'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(-10,-1,1); +$b=random(2,10,1); +$c=random(-10,-2,1); + +$ans = random(-10,-1,1); +$d= -(($c-1)*$ans-$a-$b); +Context()->flags->set(reduceConstants=>0); +$left = Formula("$a+$b"); +$right = Formula("$c*$var-$var+$d")->reduce; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + +The first step is simply to combine like terms. [``` +\begin{aligned} + [$a] + [$b] &= [$c][$var] - [$var] + [$d] \\ + [$a+$b] &= [$c-1][$var] + [$d] \\ + [$a+$b] \mathbf{{}-[$d]}&= [$c-1][$var] + [$d]\mathbf{{}-[$d]} \\ + [$a+$b-$d] &= [$c-1][$var] \\ + \frac{[$a+$b-$d]}{[$c-1]}&= \frac{[$c-1][$var]}{[$c-1]} \\ + [$ans] &= [$var]\\ + [$var] &= [$ans] +\end{aligned} + ```] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps50.pg new file mode 100644 index 0000000000..c877868c61 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps50.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a p + b - c p = d +# +# a, b, c, d integer +# +# Last updated: Jordan, 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','subtract','add') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=random(2,5,1); +$b=random(2,10,1); +$ans = random(-10,-1,1); +$c=random(6,10,1); + +$func = Compute("$a*[$var]+$b-$c*[$var]")->reduce; +$d = $func->eval([$var]=>$ans); + +$left = Formula("$a*$var+$b-$c*$var"); +$right = Formula("$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a][$var] +[$b] -[$c][$var] &= [$d] \\ + ([$a]-[$c])[$var] +[$b] &= [$d] \\ + [$a-$c][$var] +[$b] &= [$d] \\ + [$a-$c][$var] +[$b]\mathbf{{}-[$b]}&= [$d]\mathbf{{}-[$b]} \\ + [$a-$c][$var] &= [$d-$b] \\ + \frac{[$a-$c][$var]}{[$a-$c]} &= \frac{[$d-$b]}{[$a-$c]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps60.pg new file mode 100644 index 0000000000..0b9abeec1e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps60.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve this linear equation: +# +# [`` -[$a]q+[$b]+q=[$d] ``] +# +# Solution: [`` \quad q= ``] [_______]{$ans} +# +# Last updated: Jordan 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(3,10,1); +$b=random(2,10,1); +$ans = random(-10,10,1); +$c=1; +$d= (-$a+1)*$ans+$b; + +$left = Formula("-$a*$var+$b+$var"); +$right = Formula("$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = -1*$a+1; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + -[$a][$var] +[$b] +[$var] &= [$d] \\ + (-[$a]+1)[$var] +[$b] &= [$d] \\ + [$step1][$var] +[$b] &= [$d] \\ + [$step1][$var] +[$b]\mathbf{{}-[$b]}&= [$d]\mathbf{{}-[$b]} \\ + [$step1][$var] &=[$d-$b] \\ + \frac{[$step1][$var]}{[$step1]} &= \frac{[$d-$b]}{[$step1]} \\ + [$var] &=[$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps70.pg new file mode 100644 index 0000000000..caf1c82e0e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps70.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x +b = c +# +# a, b, c are integer. +# +# Last updated: Jordan 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$b=random(2,10,1); +$ans = random(-10,10,1); +$d= (-$a-1)*$ans-$b; + +$left = Formula("$d"); +$right = Formula("-$a*$var-$b-$var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [` [$left]=[$right] `] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = -1*$a-1; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$d] & = -[$a][$var] -[$b] -[$var] \\ + [$d] & = (-[$a]-1)[$var] -[$b] \\ + [$d] & = [$step1][$var] -[$b] \\ + [$d]\mathbf{{}+[$b]}& = [$step1][$var] -[$b]\mathbf{{}+[$b]} \\ + [$d+$b] & = [$step1][$var] \\ + \frac{[$d+$b]}{[$step1]} & = \frac{[$step1][$var]}{[$step1]} \\ + [$ans] & = [$var]\\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps80.pg new file mode 100644 index 0000000000..3da6841244 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps80.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x +b = c +# +# a, b, c are integer. +# +# Last updated: Jordan 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$b=random(2,10,1); +$ans = random(-10,10,1); +$c= (-2)*$ans+$a+$b; + +$left = Formula("$a-$var-$var"); +$right = Formula("-$b + $c"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step1 = $c-$b-$a; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] -[$var] -[$var] & = -[$b]+[$c] \\ + [$a] -2[$var] & = [$c-$b] \\ +[$a] -2[$var]\mathbf{{}-[$a]} & = [$c-$b]\mathbf{{}-[$a]} \\ + {}-2[$var] & = [$step1] \\ + \frac{-2[$var]}{-2} & = \frac{[$step1]}{-2} \\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps90.pg new file mode 100644 index 0000000000..9595648a5b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps90.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# +# Solve this linear equation: +# +# [`` [$a]-[$c]y -[$b] = [$d] ``] +# +# Solution: [`` \quad y= ``] [_______]{$ans} +# +# +# Last updated: Jordan 7/10/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','add','subtract','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,5,1); +$b=random(6,10,1); +$ans = 0; +$c=random(2,10,1); +$d = $a-$b; + +$left = Formula("$a-$c*$var-$b"); +$right = Formula("$d"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] -[$c][$var] -[$b] & = [$d] \\ + [$a-$b] -[$c][$var] & = [$d] \\ + [$a-$b] -[$c][$var]\mathbf{{}+[$b-$a]}& = [$d]\mathbf{{}+[$b-$a]} \\ + -[$c][$var] & = 0 \\ + \frac{-[$c][$var]}{-[$c]} & = \frac{0}{-[$c]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract10.pg new file mode 100644 index 0000000000..94d02fb611 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract10.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# x + a = b +# +# a, b integer +# +# Last updated: Jordan, 6/28/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "PGcourse.pl", + "SolveLinearEquationPCC.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(1,9,2); +$ans = random(2,10,1); +$left= Compute("$var+$a")->reduce; +$right = $left->eval($var=>$ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray,~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$var]+[$a] &= [$right] \\ + [$var]+[$a]\mathbf{{}-[$a]} &= [$right]\mathbf{{}-[$a]} \\ + [$var] &=[$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract100.pg new file mode 100644 index 0000000000..051a993f9a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract100.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# -a = x - (-b) +# +# +# Last updated: Jordan, 6/29/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(-5,-1,1); +$ans = random(-10,-6,1); +$right = Compute("$var-$a"); +$left = $right->eval($var=>$ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$absA=abs($a); + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$left] &= [$var]-([$a]) \\ + [$left] &= [$var]+[$absA] \\ + [$left]\mathbf{{}-[$absA]} &= [$var]+[$absA]\mathbf{{}-[$absA]} \\ + [$ans] &= [$var]\\ + [$var] &= [$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract110.pg new file mode 100644 index 0000000000..ec4e96ce0d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract110.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# +# +# +# Last updated: Hughes, 6/29/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(1,5,1); +$ans = random(-10,-6,1); +$left = Compute("$a+$var")->reduce; +$right = $left->eval($var=>$ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$a]+ [$var] &=[$right] \\ + [$a]+ [$var]\mathbf{{}-[$a]} &=[$right]\mathbf{{}-[$a]} \\ + [$var] &= [$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract120.pg new file mode 100644 index 0000000000..24fbdb2f8c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract120.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# a = -b + y +# +# +# Last updated: Jordan, 6/29/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(-10,-1,1); +$ans = $a; +$ans = random(1,10,1) while(abs($ans)==abs($a)); +$right = Compute("$a+$var")->reduce; +$left = $right->eval($var=>$ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$absA = abs($a); + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$left] &= [$a]+ [$var] \\ + [$left]\mathbf{{}+[$absA]} &= [$a]+ [$var]\mathbf{{}+[$absA]} \\ + [$ans] &= [$var] \\ + [$var] &=[$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract130.pg new file mode 100644 index 0000000000..8547e2a747 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract130.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# x + a/b = c/d +# +# a,b, and c, d are chosen so that a/b and c/d remain fractions (not integers) +# +# Last updated: Jordan, 7/2/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(4,10,2); +$num1 = random(1,7,2); +while (gcd($den1,$num1)!=1) {$num1 = random(1,9,2);} +$frac1 = Fraction($num1,$den1); + +$den2 = $den1; +$num2 = $den2-1; +$right = Fraction($num2,$den2); + +$ans = $right-$frac1; +$left = Compute("$var+$frac1")->reduce; + +$ans=Compute($ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + + + +$absA = abs($a); + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$var]+[$frac1] &= [$right] \\ + [$var]+[$frac1]\mathbf{{}-[$frac1]} &= [$right]\mathbf{{}-[$frac1]} \\ + [$var] &=[$ans] \\ + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract140.pg new file mode 100644 index 0000000000..1e0903a8f5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract140.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# a/b = x - c/d +# +# a, b, c, d are chosen so that a/b and c/d remain as fractions (not integers). +# +# Last updated: Jordan, 7/2/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','add','subtract') +## DBCCSS('6.EE-7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(5,11,2); +$num1 = random(2,10,2); +while (gcd($den1,$num1)!=1) {$num1 = random(2,10,2);} +$frac1 = Fraction($num1,$den1); + +$den2 = $den1; +$num2 = $num1+2; +$left = Fraction($num2,$den2); +$right = Formula("$var-$frac1"); + +$ans = Compute($frac1+$left)->reduce; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + + +$absA = abs($a); + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$left] &= [$var]-[$frac1] \\ + [$left]\mathbf{{}+ [$frac1]} &= [$var]-[$frac1]\mathbf{{}+ [$frac1]} \\ + [$ans] &= [$var]\\ + [$var] &= [$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract150.pg new file mode 100644 index 0000000000..035de2189c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract150.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# -a/b + y = -c/d +# +# a, b, c, d integer and chosen so that a/b and c/d remain fractions. +# +# Last updated: Jordan, 7/2/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','add','subtract','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################# + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(3,11,2); +$num1 = random(2,10,2); +while (gcd($den1,$num1)!=1) {$num1 = random(2,10,2);} +$frac1 = Fraction($num1,$den1); + +$den2 = $den1*2; +$num2 = random(3,$den2-1,2); +while (gcd($den2,$num2)!=1) {$num2 = random(3,$den2-1,2);} +$frac2 = Fraction($num2,$den2); + +$ans = -$frac2+$frac1; + +$right = -$frac2; +$left = Formula("-($frac1)+$var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + + +$absA = abs($a); + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + -[$frac1]+[$var] &=-[$frac2] \\ + -[$frac1]+[$var]\mathbf{{}+[$frac1]} &=-[$frac2]\mathbf{{}+[$frac1]} \\ + [$var] &=[$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract160.pg new file mode 100644 index 0000000000..92ece4272c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract160.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# +# a/b + p = -c/d +# +# Last updated: Jordan, 7/2/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','add','subtract','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = random(3,9,2); +$num1 = random(2,10,2); +while (gcd($den1,$num1)!=1) {$num1 = random(2,10,2);} +$frac1 = Fraction($num1,$den1); + +$den2 = random(2,10,2); +$num2 = random(1,9,2); +while (gcd($den2,$num2)!=1) {$num2 = random(1,9,2);} +$frac2 = Fraction($num2,$den2); + +$ans = Compute(-$frac2-$frac1); +$right = -$frac2; +$left = Formula("$frac1+$var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + + +$absA = abs($a); + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$frac1]+[$var] &=-[$frac2] \\ + [$frac1]+[$var]\mathbf{{}-[$frac1]} &=-[$frac2]\mathbf{{}-[$frac1]} \\ + [$var]&= [$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract170.pg new file mode 100644 index 0000000000..f0776bd3c1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract170.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# a = x - (-a) +# +# The solution is 0. +# +# Last updated: Jordan, 7/2/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(-15,-1,1); +$ans = 0; +$right = Compute("[$var]-$a"); +$left = $right->eval([$var]=>$ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$absA=abs($a); + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$left] &=[$var]-([$a]) \\ + [$left] &=[$var]+[$absA] \\ + [$left]\mathbf{{}-[$absA]} &=[$var]+[$absA]\mathbf{{}-[$absA]} \\ + [$ans] &= [$var]\\ + [$var] &= [$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract180.pg new file mode 100644 index 0000000000..69de96572b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract180.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# a + r = b +# -a +s = b +# +# a, b integer +# +# Last updated: Jordan, 7/2/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName();} until ($var1 ne $var2); + +Context()->noreduce('(-x)-y','(-x)+y'); + +#first problem is in the form of 4+x=10. +$a=random(2,5,1); +$b=random(6,10,1); +$ans1 = $b-$a; + +#second problem is in the form of -4+x=10; +$ans2 = $b+$a; +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$left1 = Formula("$a+$var1"); +$right1 = Formula("$b"); +$left2 = Formula("-$a+$var2"); +$right2 = Formula("$b"); + +@vArray = ($var1, $var2); +@aArray = ($ans1, $ans2); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + +a) [`` [$left1]=[$right1] ``] + + [_______________________________] + + +b) [`` [$left2]=[$right2] ``] + + [_______________________________] + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + +a) [`` + \begin{aligned}[t] + [$a]+ [$var1] &=[$b] \\ + [$a]+ [$var1]\mathbf{{}-[$a]} &=[$b]\mathbf{{}-[$a]} \\ + [$var1] &= [$ans1] + \end{aligned} + ``] + + [@summary($ansEqRef->[0],$left1,$right1);@]** + +b) [`` + \begin{aligned}[t] + -[$a]+ [$var2] &=[$b] \\ + -[$a]+ [$var2]\mathbf{{}+[$a]} &=[$b]+[$a]\mathbf{{}+[$a]} \\ + [$var2] &= [$ans2] + \end{aligned} + ``] + + [@summary($ansEqRef->[1],$left2,$right2);@]** + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract20.pg new file mode 100644 index 0000000000..1d338fad3f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract20.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve +# +# x + a = b +# +# a, b integer +# +# Last updated: Jordan, 6/29/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=random(1,10,1); +$ans = $a; +$ans = random(-10,-2,1) while(abs($ans)==abs($a)); +$left = Compute("$var+$a")->reduce; +$right = $left->eval($var=>$ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$var] + [$a] &= [$right] \\ + [$var] + [$a]\mathbf{{}-[$a]} &=[$right]\mathbf{{}-[$a]} \\ + [$var] &=[$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract30.pg new file mode 100644 index 0000000000..59e2b9e7d1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract30.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# a = z + b +# +# a, b integer +# +# Last updated: Jordan, 6/29/13; Kling 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + + +$a=random(6,12,1); +$ans=$a; +$ans = random(-10,-2,1) while(abs($ans)==abs($a)); +$right = Compute("$var+$a")->reduce; +$left = $right->eval($var=>$ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$left] &=[$right] \\ + [$left]\mathbf{{}-[$a]} &=[$var]+ [$a]\mathbf{{}-[$a]} \\ + [$ans]&=[$var] \\ + [$var]&=[$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract40.pg new file mode 100644 index 0000000000..a3e7a35237 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract40.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# a = t + (-b) +# +# +# Last updated: Jordan, 6/29/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(-10,-6,1); +$ans = random(-5,-1,1); +$right = Compute("$var+($a)")->reduce; +$left = $right->eval($var=>$ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$absA=abs($a); + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$left] &=[$right] \\ + [$left] &=[$var]+([$a]) \\ + [$left]\mathbf{{}-[$a]} &=[$var]+([$a])\mathbf{{}-[$a]} \\ + [$ans] &= [$var]\\ + [$var] &= [$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract50.pg new file mode 100644 index 0000000000..e94a26d70d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract50.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# x + a =0 +# +# +# Last updated: Hughes, 6/29/13, Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(1,80,1); +$ans = -$a; +$left = Compute("$var+$a")->reduce; +$right = Formula("0"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$var]+[$a] &=0 \\ + [$var]+[$a]\mathbf{{}-[$a]} &=0\mathbf{{}-[$a]} \\ + [$var] &=[$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract60.pg new file mode 100644 index 0000000000..34d70ef5f0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract60.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# x - a = b +# +# a, b integer. +# +# Last updated: Hughes, 6/29/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(1,10,1); +$ans = $a; +$ans = random(2,10,1) while($ans==$a); +$left = Compute("$var-$a")->reduce; +$right = $left->eval($var=>$ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$var]-[$a] &=[$right] \\ + [$var]-[$a]\mathbf{{}+[$a]} &=[$right]\mathbf{{}+[$a]} \\ + [$var] &=[$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract70.pg new file mode 100644 index 0000000000..f52d131ba2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract70.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# 0 = z - $a +# +# a is integer. +# +# Last updated: Hughes 7/24/13, Jordan, 6/29/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,99,1); +$ans = $a; +$right = Compute("$var-$a")->reduce; +$left = Formula("0"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + 0 &= [$var]-[$a] \\ + 0\mathbf{{}+[$a]} &= [$var]-[$a]\mathbf{{}+[$a]} \\ + [$ans] &=[$var] \\ + [$var] &=[$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract80.pg new file mode 100644 index 0000000000..a1b0198325 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract80.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# -a = y - b +# +# +# Last updated: Jordan, 6/26/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$ans = random(-10,-1,1); +$right = Compute("$var-$a")->reduce; +$left = $right->eval($var=>$ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + + + [`` + \begin{aligned} + [$left] &=[$var]-[$a] \\ + [$left]\mathbf{{}+[$a]} &=[$var]-[$a]\mathbf{{}+[$a]} \\ + [$ans] &=[$var]\\ + [$var] &=[$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract90.pg new file mode 100644 index 0000000000..407bbdfe3c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract90.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# t - (-a) = b +# +# +# Last updated: Jordan, 6/29/13; Kling, 7/15/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','negative','add','subtract') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(-10,-5,1); +$ans = random(2,5,1); +$left = Compute("$var-$a"); +$right = $left->eval($var=>$ans); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$absA=abs($a); + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$var]-([$a]) &=[$right] \\ + [$var]+[$absA]&=[$right] \\ + [$var]+[$absA]\mathbf{{}-[$absA]}&=[$right]\mathbf{{}-[$absA]} \\ + [$var] &=[$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare10.pg new file mode 100644 index 0000000000..2575a59bdc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare10.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve these linear equations: +# +# a) [`` [$a]x=[$right] ``] +# +# Solution: [`` \quad x= ``] [_______]{$ans1} +# +# b) [`` [$a]+y=[$right] ``] +# +# Solution: [`` \quad y= ``] [_______]{$ans2} +# +# Last updated: Jordan, 7/5/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','subtract') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable);} until ($var2 ne $var1); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,9,2); +$ans1 = random(2,10,2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$right = Formula($a*$ans1); +$ans2 = $right-$a; +$left1 = Formula("$a $var1"); +$left2 = Formula("$a + $var2"); + +@vArray = ($var1, $var2); +@aArray = ($ans1, $ans2); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** +a) [`` [$left1]=[$right] ``] + + [_______________________________] + + +b) [`` [$left2]=[$right] ``] + + [_______________________________] + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] + [$a][$var1] &= [$right] \\ + \frac{[$a][$var1]}{[$a]} &= \frac{[$right]}{[$a]} \\ + [$var1] &= [$ans1] +\end{aligned} +`] + + [@summary($ansEqRef->[0],$left1,$right);@]** + +b) [` +\begin{aligned}[t] + [$a] + [$var2] &= [$right] \\ + [$a] +[$var2]\mathbf{{}-[$a]} &= [$right]\mathbf{{}-[$a]} \\ + [$var2] &= [$ans2] +\end{aligned} +`] + + [@summary($ansEqRef->[1],$left2,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare20.pg new file mode 100644 index 0000000000..1e71738c41 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare20.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve these linear equations: +# +# a) [`` [$product]=[$a]z ``] +# +# Solution: [`` \quad z= ``] [_______]{$ans1} +# +# b) [`` [$product]=[$a]+n ``] +# +# Solution: [`` \quad n= ``] [_______]{$ans2} +# +# Last updated: Jordan, 7/5/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','subtract','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable);} until ($var2 ne $var1); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(-9,-3,2); +$ans1 = random(-10,-2,2); +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$left = Formula($a*$ans1); +$ans2 = $left - $a; +$right1 = Formula("$a $var1"); +$right2 = Formula("$a +$var2"); + +@vArray = ($var1, $var2); +@aArray = ($ans1, $ans2); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** +a) [`` [$left]=[$right1] ``] + + [_______________________________] + + +b) [`` [$left]=[$right2] ``] + + [_______________________________] + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +$absA=abs($a); + +BEGIN_PGML_SOLUTION + +a) [`` +\begin{aligned}[t] + [$left] &= [$a][$var1] \\ + \frac{[$left]}{[$a]} &= \frac{[$a][$var1]}{[$a]} \\ + [$ans1] &= [$var1]\\ + [$var1] &= [$ans1] +\end{aligned} +``] + + [@summary($ansEqRef->[0],$left,$right1);@]** + +b) [`` +\begin{aligned}[t] + [$left] &= [$a] + [$var2] \\ + [$left]\mathbf{{}+[$absA]} &=[$a] +[$var2]\mathbf{{}+[$absA]} \\ + [$ans2] &= [$var2]\\ + [$var2] &= [$ans2] +\end{aligned} +``] + + [@summary($ansEqRef->[1],$left,$right2);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv10.pg new file mode 100644 index 0000000000..9c478b1271 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv10.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x = b +# +# Last updated: Jordan 7/3/13; Hughes, 6/26/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$ans = random(5,12,1); +$right = Formula($a*$ans); +$left = Formula("$a $var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$left] &=[$right] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$right]}{[$a]} \\ + [$var] &= [$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv100.pg new file mode 100644 index 0000000000..1a07176603 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv100.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x = b +# +# a and b are chosen so that x is integer. +# +# Last updated: Jordan 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','divide','multiply') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context("Fraction"); + +do {$den = random (2,10,1); $num = random(2,10,1);} + until (gcd($num,$den) != min($num,$den)); +$frac = Fraction($num,$den); +$fracNum = ($frac->value)[0]; +$fracDen = ($frac->value)[1]; + + +#make sure the answer is a fraction instead of integer +do {$product = random(2,10,1);} until ($product % $fracNum != 0); + +$ans = Compute($product/$frac)->reduce; +@answ = $ans->value; +$ansNum = $answ[0]; +$ansDen = $answ[1]; +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left = Formula("$frac $var"); +$right = Formula("$product"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \frac{[$fracNum]}{[$fracDen]} [$var] & = [$product] \\ + [$fracDen] \cdot \frac{[$fracNum]}{[$fracDen]} [$var] & = [$fracDen] \cdot [$product] \\ + [$fracNum][$var] & = [$fracDen*$product] \\ + \frac{[$fracNum][$var]}{[$fracNum]} & = \frac{[$fracDen*$product]}{[$fracNum]} \\ + [$var] & = \frac{[$ansNum]}{[$ansDen]} +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv110.pg new file mode 100644 index 0000000000..1c9ccbc889 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv110.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x = b +# +# a and b are chosen so that x is integer. +# +# Last updated: Jordan, 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','divide','multiply','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context("Fraction"); +$num = random(2,10,1); +do {$den = random (2,10,1);} until (gcd($num,$den)!=min($num,$den)); +$frac = Fraction($num,$den); + +#make sure the answer is a fraction instead of integer +$a = random(2,10,1); +while ($a%$den==0) {$a = random (2,10,1);} + +$ans = -Compute("$a*$frac")->reduce; +@answ = $ans->value; +$ansNum = $answ[0]; +$ansDen = $answ[1]; +$absAns = abs($ans); +$left = $frac; +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +$right = Formula("-($var/$a)"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] & = [$right] \\ + -[$a] \cdot [$left] & = -[$a] \cdot \left([$right]\right) \\ + [$ans] & = [$var] \\ + [$var] & = [$ans]\\ +\end{aligned} +``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv120.pg new file mode 100644 index 0000000000..29427c00ef --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv120.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x = b +# +# a and b are chosen so that x is integer. +# +# Last updated: Jordan, 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','divide','multiply','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random(2,10,1); +$num = random(2,10,1); +while ($num%$den==0) {$num=random(2,10,1);} + +Context("Fraction"); +$ans = Fraction(-$num,$den); +@answ = $ans->value; +$ansNum = -$answ[0]; +$ansDen = $answ[1]; +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left = Formula("$den $var"); +$right = Formula(-$num); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]= [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$den] [$var] & = -[$num] \\ + \frac{[$den][$var]}{[$den]} & = \frac{-[$num]}{[$den]} \\ + [$var] & = -\frac{[$ansNum]}{[$ansDen]} +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv130.pg new file mode 100644 index 0000000000..f799d46e96 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv130.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x = b +# +# a and b are chosen so that x is integer. +# +# Last updated: Jordan, 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','divide','multiply','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random(2,10,1); +$num = random(2,10,1); +while ($num%$den==0) {$num=random(2,10,1);} + +$factor = list_random((2,3,4,5)); +$num=$num*$factor; +$den=$den*$factor; + +Context("Fraction"); +$ans = Fraction($num,$den)->reduce; +@answ = $ans->value; +$ansNum = $answ[0]; +$ansDen = $answ[1]; +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left = Formula(-$num); +$right = Formula("-$den $var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + -[$num] & = -[$den][$var] \\ + \frac{-[$num]}{-[$den]} & = \frac{-[$den][$var]}{-[$den]} \\ + \frac{[$ansNum]}{[$ansDen]} & = [$var]\\ + [$var] &= \frac{[$ansNum]}{[$ansDen]} +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv140.pg new file mode 100644 index 0000000000..65e8af14bf --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv140.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x +b = c +# +# a, b, c are integer. +# +# Last updated: Hughes 7/24/13, Jordan, 7/5/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$ans = random(2,10,1); +$b=random(1,6,1); + +Context()->variables->are($var=>'Real'); +$left = Compute("$a*$var+$b")->reduce; +$right = Formula($left->eval($var=>$ans)); + + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +BEGIN_PGML_SOLUTION + [`` +\begin{alignedat}{2} + [$a][$var] + [$b] &= [$right] \\ + [$a][$var] + [$b]\mathbf{{}-[$b]}&= [$right] \mathbf{{}-[$b]} \\ + [$a][$var] & = [$right-$b] \\ + \frac{[$a][$var]}{[$a]} & = \frac{[$right-$b]}{[$a]} \\ + [$var] & = [$ans] +\end{alignedat} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv145.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv145.pg new file mode 100644 index 0000000000..6dfea3eae9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv145.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x -b = c +# +# a, b, c are integer. +# +# Last updated: Hughes 7/24/13, Jordan, 7/5/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$ans = non_zero_random(-10,10,1); +$b=random(1,6,1); + +Context()->variables->are($var=>'Real'); +$left = Compute("$a*$var-$b")->reduce; +$right = Formula($left->eval($var=>$ans)); + + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +BEGIN_PGML_SOLUTION + [`` +\begin{alignedat}{2} + [$a][$var] - [$b] &= [$right] \\ + [$a][$var] - [$b]\mathbf{{}+[$b]}&= [$right] \mathbf{{}+[$b]} \\ + [$a][$var] & = [$right+$b] \\ + \frac{[$a][$var]}{[$a]} & = \frac{[$right+$b]}{[$a]} \\ + [$var] & = [$ans] +\end{alignedat} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv150.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv150.pg new file mode 100644 index 0000000000..4c6ee98a10 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv150.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x +b = c +# +# a, b, c are integer. +# +# Last updated: Hughes 7/24/13, Jordan, 7/5/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$ans = random(-10,-2,1); +$b=random(1,6,1); + +Context()->variables->are($var=>'Real'); +$right = Compute("$a*$var+$b")->reduce; +$left = Formula($right->eval($var=>$ans)); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] &= [$a][$var] + [$b] \\ + [$left] \mathbf{{}-[$b]}&= [$a][$var] + [$b]\mathbf{{}-[$b]} \\ + [$left-$b] & = [$a][$var] \\ + \frac{[$left-$b]}{[$a]} & = \frac{[$a][$var]}{[$a]} \\ + [$ans] & = [$var]\\ + [$var] &=[$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv155.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv155.pg new file mode 100644 index 0000000000..415ad6f9ff --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv155.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x -b = c +# +# a, b, c are integer. +# +# Last updated: Hughes 7/24/13, Jordan, 7/5/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(2,10,1); +$ans = non_zero_random(-10,10,1); +$b=random(1,6,1); + +Context()->variables->are($var=>'Real'); +$right = Compute("$a*$var-$b")->reduce; +$left = Formula($right->eval($var=>$ans)); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] &= [$a][$var] - [$b] \\ + [$left] \mathbf{{}+[$b]}&= [$a][$var] - [$b]\mathbf{{}+[$b]} \\ + [$left+$b] & = [$a][$var] \\ + \frac{[$left+$b]}{[$a]} & = \frac{[$a][$var]}{[$a]} \\ + [$ans] & = [$var]\\ + [$var] &=[$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv160.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv160.pg new file mode 100644 index 0000000000..61dae1986e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv160.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x +b = c +# +# a, b, c are integer. +# +# Last updated: Hughes 7/24/13, Jordan, 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(-10,-2,1); +$ans = random(-10,-2,1); +$b=random(1,10,1); + +Context()->variables->are($var=>'Real'); +$left = Compute("$a*$var+$b")->reduce; +$right = Formula($left->eval($var=>$ans)); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a][$var] + [$b] &= [$right] \\ + [$a][$var] + [$b] \mathbf{{}-[$b]} &= [$right]\mathbf{{}-[$b]} \\ + [$a][$var] &= [$right-$b] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$right-$b]}{[$a]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv165.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv165.pg new file mode 100644 index 0000000000..691b4ce165 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv165.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x -b = c +# +# a, b, c are integer. +# +# Last updated: Hughes 7/24/13, Jordan, 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(-10,-2,1); +$ans = random(-10,10,1); +$b=random(1,10,1); + +Context()->variables->are($var=>'Real'); +$left = Compute("$a*$var-$b")->reduce; +$right = Formula($left->eval($var=>$ans)); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a][$var] - [$b] &= [$right] \\ + [$a][$var] - [$b] \mathbf{{}+[$b]} &= [$right]\mathbf{{}+[$b]} \\ + [$a][$var] &= [$right+$b] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$right+$b]}{[$a]} \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv170.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv170.pg new file mode 100644 index 0000000000..e9531f14b9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv170.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# c = -$var + b +# +# a, b, c are integer. +# +# Last updated: Jordan, 7/5/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=-1; +$ans = random(-10,-2,1); +$b=random(1,10,1); + +Context()->variables->are($var=>'Real'); +$right = Compute("$a*$var+$b")->reduce; +$left = Formula($right->eval($var=>$ans)); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] & = -[$var] + [$b] \\ + [$left]\mathbf{{}- [$b]}& = -[$var] + [$b]\mathbf{{}- [$b]} \\ + [$left-$b] & = -[$var] \\ + (-1) \cdot {[$left-$b]} & = (-1) \cdot (-[$var]) \\ + [$ans] & = [$var]\\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv180.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv180.pg new file mode 100644 index 0000000000..7d659a8da0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv180.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve these linear equations: +# +# a) [`` [$den1]x= [$num1] ``] +# +# Solution: [`` \quad x= ``] [_______]{$ans1} +# +# +# b) [`` [$den2]y= [$num2] ``] +# +# Solution: [`` \quad y= ``] [_______]{$ans2} +# +# +# Last updated: Hughes 7/24/13, Jordan, 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','divide','multiply') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable);} until ($var2 ne $var1); +Context()->noreduce('(-x)-y','(-x)+y'); + + +#In Problem 1, the answer is an integer. +$den1 = random(2,10,1); +$ans1 = list_random((2,3,4,5)); +$num1 = $ans1*$den1; + + +#In Problem 2, the answer is a reducible fraction. +$num2 = random(11,20,1); +$den2 = random(2,10,1); +while (gcd($num2,$den2)!=1) {$den2=random(2,10,1);} +$factor = list_random((2,3,4,5)); +$num2 = $num2*$factor; +$den2 = $den2*$factor; + +Context("Fraction"); +$ans2 = Fraction($num2,$den2)->reduce; +@answ = $ans2->value; +$ansNum = $answ[0]; +$ansDen = $answ[1]; +Context()->variables->are($var1=>'Real',$var2=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left1 = Formula("$den1 $var1"); +$right1 = Formula($num1); +$left2 = Formula("$den2 $var2"); +$right2 = Formula($num2); + +@vArray = ($var1, $var2); +@aArray = ($ans1, $ans2); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** +a) [`` [$left1]= [$right1] ``] + + [_______________________________] + + + +b) [`` [$left2]= [$right2] ``] + + [_______________________________] + + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + +a) [`` +\begin{aligned}[t] + [$den1] [$var1] &= [$num1] \\ + \frac{[$den1][$var1]}{[$den1]} &= \frac{[$num1]}{[$den1]} \\ + [$var1] &= [$ans1] +\end{aligned} +``] + + [@summary($ansEqRef->[0],$left1,$right1);@]** + + +b) [`` +\begin{aligned}[t] + [$den2] [$var2] &= [$num2] \\ + \frac{[$den2][$var2]}{[$den2]} &= \frac{[$num2]}{[$den2]} \\ + [$var2] &= \frac{[$ansNum]}{[$ansDen]} +\end{aligned} +``] + + [@summary($ansEqRef->[1],$left2,$right2);@]** + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv190.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv190.pg new file mode 100644 index 0000000000..6f7a32ee32 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv190.pg @@ -0,0 +1,145 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# +# Solve these linear equations: +# +# a) [`` [$num1] = [$den1]x ``] +# +# Solution: [`` \quad x= ``] [_______]{$ans1} +# +# +# b) [`` [$num2] = -[$den2]y ``] +# +# Solution: [`` \quad y= ``] [_______]{$ans2} +# +# Last updated: Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','divide','multiply','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable);} until ($var2 ne $var1); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den1 = -random(2,10,1); +$ans1 = -list_random(2,3,4,5); +$num1 = $ans1*$den1; + +#In Problem 2, the answer is a negative reducible fraction. +Context("Numeric"); +$num2 = random(11,20,1); +$den2 = random(2,10,1); +while (gcd($num2,$den2)!=1) {$den2=random(2,10,1);} +$factor = list_random((2,3,4,5)); +$num2 = $num2*$factor; +$den2 = $den2*$factor; + +Context("Fraction"); +$ans2 = -Fraction($num2,$den2)->reduce; +@answ = $ans2->value; +$ansNum = $answ[0]; +$ansDen = $answ[1]; +Context()->variables->are($var1=>'Real',$var2=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left1=Formula($num1); +$right1=Formula("$den1 $var1"); +$left2=Formula($num2); +$right2=Formula("-$den2 $var2"); + +@vArray = ($var1, $var2); +@aArray = ($ans1, $ans2); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** +a) [`` [$left1] = [$right1] ``] + + [_______________________________] + + + +b) [`` [$left2] = [$right2] ``] + + [_______________________________] + + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + +a) [`` +\begin{aligned}[t] + [$num1] & = [$den1][$var1] \\ + \frac{[$num1]}{[$den1]} & = \frac{[$den1][$var1]}{[$den1]} \\ + [$ans1] & = [$var1]\\ + [$var1] &= [$ans1] +\end{aligned} +``] + + [@summary($ansEqRef->[0],$left1,$right1);@]** + + + ---- +b) [`` +\begin{aligned}[t] + [$num2] & = -[$den2][$var2] \\ + \frac{[$num2]}{-[$den2]} & = \frac{-[$den2][$var2]}{-[$den2]} \\ + [$ans2] & = [$var2]\\ + [$var2] &= [$ans2] +\end{aligned} +``] + + [@summary($ansEqRef->[1],$left2,$right2);@]** + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv20.pg new file mode 100644 index 0000000000..e43ed87244 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv20.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x = b +# +# a and b are chosen so that x is integer. +# +# Last updated: Jordan 7/3/13; Hughes, 6/26/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(type=>variable); +Context()->variables->are($var=>'Real'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=random(-10,-3,1); +$ans = random(-12,-2,1); +$left = Formula($a*$ans); +$right = Formula("$a $var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` + \begin{aligned} + [$left] &=[$a][$var] \\ + \frac{[$left]}{[$a]} & =\frac{[$a][$var]}{[$a]} \\ + [$ans] & =[$var] \\ + [$var] &= [$ans] + \end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv200.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv200.pg new file mode 100644 index 0000000000..5fdab87d0a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv200.pg @@ -0,0 +1,166 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# parts a, b, c, d, e +# +# each one has a linear equation +# +# Last updated: Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','negative') +## DBCCSS('6.EE.7','7.NS.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') +## COMMENT('enumeration seems broken after 5 items in the solution here- deleted the 5th item') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName();} until ($var2 ne $var1); +do {$var3 = RandomVariableName();} until (($var3 ne $var1) and ($var3 ne $var2)); +do {$var4 = RandomVariableName();} until (($var4 ne $var1) and ($var4 ne $var2) and ($var4 ne $var3)); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random (2,10,2); +$a = random(3,9,2); +$ans1 = $a*$den; +$ans2 = -$ans1; +$ans3 = $ans2; +$ans4 = $ans1; +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real',$var4=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left1=Formula("$var1/$den"); +$left2=Formula("$var2/(-$den)"); +$left3=Formula("-$var3/$den"); +$left4=Formula("-$var4/(-$den)"); +$right1=Formula("$a"); +$right2=Formula("$a"); +$right3=Formula("$a"); +$right4=Formula("$a"); + + +@vArray = ($var1, $var2, $var3, $var4); +@aArray = ($ans1, $ans2, $ans3, $ans4); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** +a. [`` \frac{[$var1]}{[$den]} =[$a] ``] + + [_______________________________] + + +b. [`` \frac{[$var2]}{-[$den]} =[$a] ``] + + [_______________________________] + + +c. [`` \frac{-[$var3]}{[$den]} =[$a] ``] + + [_______________________________] + + +d. [`` \frac{-[$var4]}{-[$den]} =[$a] ``] + + [_______________________________] + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + +a. [`` +\begin{aligned}[t] + {\frac{[$var1]}{[$den]}} & = [$a] \\ + [$den] \cdot \frac{[$var1]}{[$den]} & = [$den] \cdot [$a] \\ + [$var1] & = [$ans1] +\end{aligned} +``] + + [@summary($ansEqRef->[0],$left1,$right1);@]** + ----- + +b. [`` +\begin{aligned}[t] + \frac{[$var2]}{-[$den]} & = [$a] \\ + (-[$den]) \cdot \frac{[$var2]}{-[$den]} & = (-[$den]) \cdot [$a] \\ + [$var2] & = [$ans2] +\end{aligned} +``] + + [@summary($ansEqRef->[1],$left2,$right2);@]** + ----- + +c. [`` +\begin{aligned}[t] + \frac{-[$var3]}{[$den]} & = [$a] \\ + [$den] \cdot \frac{-[$var3]}{[$den]} & = [$den] \cdot [$a] \\ + -[$var3] & = [$ans1] \\ + (-1) \cdot -[$var3] & = (-1) \cdot [$ans1] \\ + [$var3] & = [$ans3] +\end{aligned} + ``] + + [@summary($ansEqRef->[2],$left3,$right3);@]** + ----- + +d. Note that those two negative signs "cancel out", because a negative number divided by a negative number is positive. + + [`` +\begin{aligned}[t] + \frac{-[$var4]}{-[$den]} & = [$a] \\ + \frac{[$var4]}{[$den]} & = [$a] \\ + [$den] \cdot \frac{[$var4]}{[$den]} & = [$den] \cdot [$a] \\ + [$var4] & = [$ans4] \\ +\end{aligned} + ``] + + [@summary($ansEqRef->[3],$left4,$right4);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv30.pg new file mode 100644 index 0000000000..4b34da2894 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv30.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve these linear equations: +# +# a) x = -a +# +# b) -y = a +# +# a is integer. +# +# Last updated: Jordan, 7/3/13; Hughes, 6/26/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(type=>variable); +do {$var2 = RandomVariableName(type=>variable);} until ($var1 ne $var2); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(2,20,1); +$ans1 = -$a; +$ans2 = $a; + +Context()->variables->are($var1=>'Real',$var2=>'Real'); +$left1 = Formula("-$var1"); +$right1 = Formula("$ans2"); +$left2 = Formula("-$var2"); +$right2 = Formula("$ans1"); + +@vArray = ($var1, $var2); +@aArray = ($ans1, $ans2); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** +a) [:: [$left1]=[$right1] ::] + + [_______________________________] + + +b) [:: -[$var2]=[$ans1] ::] + + [_______________________________] + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + + +BEGIN_PGML_SOLUTION + +Recall that [`-[$var1]`] means [` -1 \cdot [$var1] `]. To get rid of the [`-1`] in front of [`[$var1]`], we multiply both sides of the equation by [`-1`], because [`(-1) \cdot (-1) = 1 `]. + +a) [` +\begin{aligned}[t] + -[$var1] &= [$ans2] \\ + (-1) \cdot [$var1] &= [$ans2] \\ + (-1) \cdot (-1) \cdot [$var1] &= (-1) \cdot ([$ans2]) \\ + [$var1] &= [$ans1] +\end{aligned} +`] + + [@summary($ansEqRef->[0],$left1,$right1);@]** + +b) [` +\begin{aligned}[t] + -[$var2] &= [$ans1] \\ + (-1) \cdot [$var2] &= [$ans1] \\ + (-1) \cdot (-1) \cdot [$var2]&= (-1) \cdot ([$ans1]) \\ + [$var2] &= [$ans2] +\end{aligned} +`] + + [@summary($ansEqRef->[1],$left2,$right2);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv40.pg new file mode 100644 index 0000000000..42caeecdae --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv40.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x = 0 +# +# a is integer. +# +# Last updated: Jordan 7/3/13; Hughes, 6/26/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','integer','divide','multiply') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a=non_zero_random(-50,50,1); +$ans = 0; + +Context()->variables->are($var=>'Real'); +$left = Formula(0); +$right = Formula("$a $var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + 0 &= [$a][$var] \\ + \frac{0}{[$a]} &= \frac{[$a][$var]}{[$a]} \\ + 0 &=[$var] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv50.pg new file mode 100644 index 0000000000..bfcb46ab14 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv50.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# 1 +# --- x = b +# a +# +# a and b are chosen so that x is integer. +# +# Last updated: Jordan 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','divide','multiply') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random (2,10,1); + +$a = random(2,10,1); +$ans = $a*$den; +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left = Formula("1/$den $var"); +$right = Formula($a); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \frac{1}{[$den]} [$var] &=[$a] \\ + [$den] \cdot \frac{1}{[$den]} [$var] &=[$den] \cdot [$a] \\ + [$var]&=[$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv60.pg new file mode 100644 index 0000000000..596c5e0b2e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv60.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x = b +# +# a and b are chosen so that x is integer. +# +# Last updated: Jordan 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','divide','multiply','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random (2,10,1); +$a = random(-10,-1,1); +$ans = $a*$den; +Context()->variables->are($var=>'Real'); +$left = Formula($a); +$right = Formula("$var/$den"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left] = [$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] &=\frac{[$var]}{[$den]} \\ + [$den] \cdot ([$a]) &= [$den] \cdot \frac{[$var]}{[$den]} \\ + [$ans] &= [$var]\\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv70.pg new file mode 100644 index 0000000000..2ffb4f677f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv70.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x = b +# +# a and b are chosen so that x is integer. +# +# Last updated: Jordan 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','divide','multiply','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName();} until ($var1 ne $var2); +Context()->noreduce('(-x)-y','(-x)+y'); + +$den = random(2,10,1); +$a = random(2,10,1); +$ans1 = -$a*$den; +$ans2 = $a*$den; +Context()->variables->are($var1=>'Real',$var2=>'Real'); +Context()->flags->set(reduceConstants=>0); +$left1 = Formula("-(1/$den)$var1"); +$right1 = Formula($a); +$left2 = Formula("-(1/$den)$var2"); +$right2 = Formula(-$a); + +@vArray = ($var1, $var2); +@aArray = ($ans1, $ans2); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** +a) [`` [$left1]=[$right1] ``] + + [_______________________________] + + +b) [`` [$left2]=[$right2] ``] + + [_______________________________] + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + +Recall that [`-[$var1]`] means [` -1 \cdot [$var1] `]. To get rid of the [`-1`] in front of [`[$var1]`], we multiply both sides of the equation by [`-1`], because [`(-1) \cdot (-1) = 1 `]. + +a) [` +\begin{aligned}[t] + - \frac{1}{[$den]} [$var1] & =[$a] \\ + [$den] \cdot \left(- \frac{1}{[$den]}\right) [$var1] & =[$den] \cdot [$a] \\ + -[$var1] & =[$den*$a] \\ + (-1) \cdot [$var1] & =[$den*$a] \\ + (-1) \cdot (-1) \cdot [$var1] & =(-1) \cdot [$den*$a] \\ + [$var1] & =[$ans1] +\end{aligned} +`] + + [@summary($ansEqRef->[0],$left1,$right1);@]** + +b) [` +\begin{aligned}[t] + - \frac{1}{[$den]} [$var2] & =-[$a] \\ + [$den] \cdot (- \frac{1}{[$den]}) [$var2] & =[$den] \cdot (-[$a]) \\ + -[$var2] & =-[$den*$a] \\ + (-1) \cdot [$var2] & =-[$den*$a] \\ + (-1) \cdot (-1) \cdot [$var2] & =(-1) \cdot (-[$den*$a]) \\ + [$var2] & =[$ans2] +\end{aligned} +`] + + + [@summary($ansEqRef->[1],$left2,$right2);@]** + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv80.pg new file mode 100644 index 0000000000..07f69ea2a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv80.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x = b +# +# a and b are chosen so that x is integer. +# +# Last updated: Jordan 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','divide','multiply') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var = RandomVariableName(); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context("Fraction"); +$num = random(3,7,1); +do {$den = random ($num+1,14,1);} until (gcd($num,$den)==1); +$frac = Fraction($num,$den); + +$ans = $den*list_random((2,3,4,5)); +$right = $frac*$ans; +Context()->variables->are($var=>'Real'); +$left = Formula("$num/$den $var"); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \frac{[$num]}{[$den]} [$var] & = [$right] \\ + [$den] \cdot \frac{[$num]}{[$den]} [$var] & = [$den] \cdot [$right] \\ + [$num][$var] & = [$den*$right] \\ + \frac{[$num][$var]}{[$num]} & = \frac{[$den*$right]}{[$num]} \\ + [$var] & = [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv90.pg new file mode 100644 index 0000000000..9e6d742b6b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv90.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Solve the equation +# +# a x = b +# +# a and b are chosen so that x is integer. +# +# Last updated: Jordan, 7/3/13; Hughes, 6/27/13; Kling, 7/17/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solve','linear','equation','fraction','divide','multiply','negative') +## DBCCSS('6.EE.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +$var1 = RandomVariableName(); +do {$var2 = RandomVariableName();} until ($var2 ne $var1); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context("Fraction"); +$num = random(2,10,1); +do {$den = random (2,10,1);} until (gcd($num,$den)==1); +$frac = Fraction($num,$den); + +$ans1 = -$den*list_random((2,3,4,5)); +$left1 = -$frac*$ans1; +$left2 = -$left1; +$ans2 = -$ans1; +Context()->variables->are($var1=>'Real',$var2=>'Real'); +Context()->flags->set(reduceConstants=>0); +$right1 = Formula("-($num/$den)$var1"); +$right2 = Formula("-($num/$den)$var2"); + +@vArray = ($var1, $var2); +@aArray = ($ans1, $ans2); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@instructions(~~@vArray)@]** +a) [`` [$left1] = [$right1] ``] + + [_______________________________] + + +b) [`` [$left2] = [$right2] ``] + + [_______________________________] + + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$step11 = $left1*$den; + +BEGIN_PGML_SOLUTION + +a) [` +\begin{aligned}[t] + [$left1] & = -\frac{[$num]}{[$den]}[$var1] \\ +[$den] \cdot [$left1] & = [$den] \cdot \left(-\frac{[$num]}{[$den]}\right)[$var1] \\ + [$step11] & = -[$num][$var1] \\ + \frac{[$step11]}{-[$num]} & = \frac {-[$num][$var1]}{-[$num]} \\ + [$ans1] & = [$var1]\\ + [$var1] & = [$ans1] +\end{aligned} +`] + + [@summary($ansEqRef->[0],$left1,$right1);@]** + +b) [` +\begin{aligned}[t] + [$left2] & = -\frac{[$num]}{[$den]}[$var2] \\ +[$den] \cdot ([$left2]) & = [$den] \cdot \left(-\frac{[$num]}{[$den]}\right)[$var2]\\ + -[$step11] & = -[$num][$var2] \\ + \frac{-[$step11]}{-[$num]} & = \frac {-[$num][$var2]}{-[$num]} \\ + [$ans2] & = [$var2]\\ + [$var2] & = [$ans2] +\end{aligned} +`] + + [@summary($ansEqRef->[1],$left2,$right2);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication10.pg index dc9f6a3fc1..8964d29854 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication10.pg @@ -6,14 +6,18 @@ # Last updated: Yao 8/4/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -23,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,9 +51,7 @@ TEXT(beginproblem()); BEGIN_PGML -A test has [`[$totalProblems]`] problems, which are worth a total of [`[$totalPoints]`] points. There are two types of problems in the test. Each multiple-choice problem is worth [`[$worthMulti]`] points, and each short-answer problem is worth [`[$worthShort]`] points. - -Write and solve a system equation to answer the following questions. +A test has [`[$totalProblems]`] problems, which are worth a total of [`[$totalPoints]`] points. There are two types of problems in the test. Each multiple-choice problem is worth [`[$worthMulti]`] points, and each short-answer problem is worth [`[$worthShort]`] points. Write and solve a system of equations to answer the following questions. This test has [__________]{$numMulti} multiple-choice problems and [___________]{$numShort} short-answer problems. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication100.pg index e74858872a..d42c070d1f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication100.pg @@ -6,14 +6,18 @@ # Last updated: Jordan 9/9/13; Yao 8/4/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -23,8 +27,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PCCmacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -51,19 +56,13 @@ TEXT(beginproblem()); BEGIN_PGML -If a boat travels from Town A to Town B, it has to travel [`[$distanceU]`] along a river. - -A boat traveled from Town A to Town B along the river's current with its engine running at full speed. This trip took [`[$time1U]`]. - -Then the boat traveled back from Town B to Town A, again with the engine at full speed, but this time against the river's current. This trip took [`[$time2U]`]. - -Write and solve a system of equations to answer the following questions. +If a boat travels from Town A to Town B, it has to travel [`[$distanceU]`] along a river. A boat traveled from Town A to Town B along the river's current with its engine running at full speed. This trip took [`[$time1U]`]. Then the boat traveled back from Town B to Town A, again with the engine at full speed, but this time against the river's current. This trip took [`[$time2U]`]. Write and solve a system of equations to answer the following questions. The boat's speed in still water with the engine running at full speed is [______________]{$speedStillU}. The river current's speed was [______________]{$speedCurrentU}. -Use *mi* for miles, and *hr* for hours. +[@KeyboardInstructions('Use [|mi|]* for miles, and [|hr|]* for hours.')@]** END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication20.pg index b4dd41493a..2ca16fe8c6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication20.pg @@ -6,14 +6,18 @@ # Last updated: Yao 8/4/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +29,7 @@ loadMacros( "PGML.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,13 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -[$name] invested a total of [`[$cInit]`] in two accounts. One account pays [`[$p1]%`] interest annually; the other pays [`[$p2]%`] interest annually. At the end of the year, [$name] earned a total of [`[$cTotalInt]`] in interest. How much money did [$name] invest in each account? - -Write and solve a system of equations to answer the following questions. - - [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account. +[$name] invested a total of [`[$cInit]`] in two accounts. One account pays [`[$p1]%`] interest annually; the other pays [`[$p2]%`] interest annually. At the end of the year, [$name] earned a total of [`[$cTotalInt]`] in interest. Write and solve a system of equations to find how much money [$name] invested in each account. - [$name] invested [__________]{$cFund2} in the [`[$p2]%`] account. + [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account and [__________]{$cFund2} in the [`[$p2]%`] account. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication30.pg index b89b70a12a..cbc38fa9f0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication30.pg @@ -6,14 +6,18 @@ # Last updated: Jordan 9/9/13; Yao 8/4/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -25,7 +29,7 @@ loadMacros( "PGML.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,13 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -[$name] invested a total of [`[$cInit]`] in two accounts. After a year, one account lost [`[$p1]%`], while the other account gained [`[$p2]%`]. In total, [$name] lost [`[$cTotalInt]`]. How much money did [$name] invest in each account? - -Write and solve a system of equations to answer the following questions. - - [$name] invested [__________]{$cFund1} in the account with [`[$p1]%`] loss. +[$name] invested a total of [`[$cInit]`] in two accounts. After a year, one account lost [`[$p1]%`], while the other account gained [`[$p2]%`]. In total, [$name] lost [`[$cTotalInt]`]. Write and solve a system of equations to find how much money [$name] invested in each. - [$name] invested [__________]{$cFund2} in the account with [`[$p2]%`] gain. + [$name] invested [__________]{$cFund1} in the account with [`[$p1]%`] loss and [__________]{$cFund2} in the account with [`[$p2]%`] gain. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication40.pg index 24065567d1..5879725997 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication40.pg @@ -6,14 +6,18 @@ # Last updated: Jordan 9/9/13; Yao 8/4/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -23,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,9 +60,7 @@ $ethnicity = list_random("Asians", "native Americans", "African Americans", "His TEXT(beginproblem()); BEGIN_PGML -Town A and Town B were located close to each other, and recently merged into one city. Town A had a population with [`[$p1]%`] [$ethnicity]. Town B had a population with [`[$p2]%`] [$ethnicity]. After the merge, the new city has a total of [`[$s3]`] residents, with [`[$p3]%`] [$ethnicity]. How many residents did Town A and Town B used to have? - -Write and solve a system equation to answer the following questions. +Town A and Town B were located close to each other, and recently merged into one city. Town A had a population with [`[$p1]%`] [$ethnicity]. Town B had a population with [`[$p2]%`] [$ethnicity]. After the merge, the new city has a total of [`[$s3]`] residents, with [`[$p3]%`] [$ethnicity]. Write and solve a system of equations to find how many residents Town A and Town B used to have. Town A used to have [__________]{$s1} residents, and Town B used to have [__________]{$s2} residents. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication50.pg index 2cca84d6d3..fd87240a2b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication50.pg @@ -6,14 +6,18 @@ # Last updated: Jordan 9/9/13; Yao 8/4/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -23,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,9 +61,7 @@ TEXT(beginproblem()); BEGIN_PGML -You poured some [`[$p1]%`] alcohol solution and some [`[$p2]%`] alcohol solution into a mixing container. Now you have [`[$s3]`] grams of [`[$p3] %`] alcohol solution. How many grams of [`[$p1]%`] solution and how many grams of [`[$p2] %`] solution did you pour into the mixing container? - -Write and solve a system equation to answer the following questions. +You poured some [`[$p1]%`] alcohol solution and some [`[$p2]%`] alcohol solution into a mixing container. Now you have [`[$s3]`] grams of [`[$p3] %`] alcohol solution. Write and solve a system of equations to find how many grams of [`[$p1]%`] solution and how many grams of [`[$p2] %`] solution you poured into the mixing container. You mixed [__________]{$s1} grams of [`[$p1]%`] solution with [__________]{$s2} grams of [`[$p2]%`] solution. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication60.pg index 959f8b50b4..9041c4d3a9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication60.pg @@ -6,14 +6,18 @@ # Last updated: Jordan 9/9/13; Yao 8/4/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -24,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,9 +57,7 @@ TEXT(beginproblem()); BEGIN_PGML -You will purchase some CDs and DVDs. If you purchase [`[$c1]`] CDs and [`[$d1]`] DVDs, it will cost you [`[$cCost1]`]; if you purchase [`[$c2]`] CDs and [`[$d2]`] DVDs, it will cost you [`[$cCost2]`]. - -Write and solve a system equation to answer the following questions. +You will purchase some CDs and DVDs. If you purchase [`[$c1]`] CDs and [`[$d1]`] DVDs, it will cost you [`[$cCost1]`]; if you purchase [`[$c2]`] CDs and [`[$d2]`] DVDs, it will cost you [`[$cCost2]`]. Write and solve a system of equations to answer the following questions. Each CD costs [__________]{$cCD} and each DVD costs [___________]{$cDVD}. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication70.pg index fb5b433009..ad7e79c96d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication70.pg @@ -6,14 +6,18 @@ # Last updated: Jordan 9/9/13; Yao 8/4/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -24,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,9 +54,7 @@ TEXT(beginproblem()); BEGIN_PGML -A school fund raising event sold a total of [`[$totalTickets]`] tickets and generated a total revenue of [`[$cTotalCost]`]. There are two types of tickets: adult tickets and child tickets. Each adult ticket costs [`[$cAdultTicket]`], and each child ticket costs [`[$cChildTicket]`]. - -Write and solve a system of equations to answer the following questions. +A school fund raising event sold a total of [`[$totalTickets]`] tickets and generated a total revenue of [`[$cTotalCost]`]. There are two types of tickets: adult tickets and child tickets. Each adult ticket costs [`[$cAdultTicket]`], and each child ticket costs [`[$cChildTicket]`]. Write and solve a system of equations to answer the following questions. [__________]{$adultTickets} adult tickets and [___________]{$childTickets} child tickets were sold. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication80.pg index 6d3941caae..af8afc4910 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication80.pg @@ -6,14 +6,18 @@ # Last updated: Jordan 9/9/13; Yao 8/4/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -24,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,11 +58,7 @@ TEXT(beginproblem()); BEGIN_PGML -Phone Company A charges a monthly fee of [`[$cFlatA]`], and [`[$cRateA]`] for each minute of talk time. - -Phone Company B charges a monthly fee of [`[$cFlatB]`], and [`[$cRateB]`] for each minute of talk time. - -Write and solve a system equation to answer the following questions. +Phone Company A charges a monthly fee of [`[$cFlatA]`], and [`[$cRateA]`] for each minute of talk time. Phone Company B charges a monthly fee of [`[$cFlatB]`], and [`[$cRateB]`] for each minute of talk time. Write and solve a system equation to answer the following questions. These two companies would charge the same amount on a monthly bill when the talk time was [__________]{$minutes} minutes. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication90.pg index 582018c76e..257e642955 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication90.pg @@ -6,14 +6,18 @@ # Last updated: Jordan 9/9/13; Yao 8/4/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -24,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,11 +59,7 @@ TEXT(beginproblem()); BEGIN_PGML -Company A's revenue this fiscal year is [`[$cSalesA]`], but its revenue is decreasing by [`[$cRateA]`] each year. - -Company B's revenue this fiscal year is [`[$cSalesB]`], and its revenue is increasing by [`[$cRateB]`] each year. - -Write and solve a system of equations to answer the following question. +Company A's revenue this fiscal year is [`[$cSalesA]`], but its revenue is decreasing by [`[$cRateA]`] each year. Company B's revenue this fiscal year is [`[$cSalesB]`], and its revenue is increasing by [`[$cRateB]`] each year. Write and solve a system of equations to answer the following question. After [___________]{$years} years, Company B will catch up with Company A in revenue. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution01.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution01.pg index 1693b86f24..f5a87045d0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution01.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution01.pg @@ -6,14 +6,18 @@ # Last updated: Yao 10/25/2017 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Algebra) -## DBchapter(Systems of equations and inequalities) -## DBsection(Linear systems) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -47,7 +51,7 @@ TEXT(beginproblem()); BEGIN_PGML -The sum of two numbers is [`[$sum]`]. One number is [`[$less]`] less than [$word] the other number. +The sum of two numbers is [`[$sum]`]. One number is [`[$less]`] less than [$word] of the other number. Write and solve a system equation to answer the following questions. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution05.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution05.pg index 26ae4415ce..888a4d3e32 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution05.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution05.pg @@ -6,14 +6,18 @@ # Last updated: Yao 12/2/2017 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Algebra) -## DBchapter(Systems of equations and inequalities) -## DBsection(Linear systems) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution10.pg index 04ef5079ca..20023c51ca 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution10.pg @@ -6,14 +6,18 @@ # Last updated: Yao 12/2/2017 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Algebra) -## DBchapter(Systems of equations and inequalities) -## DBsection(Linear systems) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -47,9 +51,7 @@ TEXT(beginproblem()); BEGIN_PGML -A test has [`[$totalProblems]`] problems, which are worth a total of [`[$totalPoints]`] points. There are two types of problems in the test. Each multiple-choice problem is worth [`[$worthMulti]`] points, and each short-answer problem is worth [`[$worthShort]`] points. - -Write and solve a system equation to answer the following questions. +A test has [`[$totalProblems]`] problems, which are worth a total of [`[$totalPoints]`] points. There are two types of problems in the test. Each multiple-choice problem is worth [`[$worthMulti]`] points, and each short-answer problem is worth [`[$worthShort]`] points. Write and solve a system equation to answer the following questions. This test has [__________]{$numMulti} multiple-choice problems and [___________]{$numShort} short-answer problems. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution20.pg index 8b35ffa5b0..22ff939330 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution20.pg @@ -6,14 +6,18 @@ # Last updated: Yao 12/2/2017 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Algebra) -## DBchapter(Systems of equations and inequalities) -## DBsection(Linear systems) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -50,9 +54,7 @@ TEXT(beginproblem()); BEGIN_PGML -A school fund raising event sold a total of [`[$totalTickets]`] tickets and generated a total revenue of [`[$cTotalCost]`]. There are two types of tickets: adult tickets and child tickets. Each adult ticket costs [`[$cAdultTicket]`], and each child ticket costs [`[$cChildTicket]`]. - -Write and solve a system of equations to answer the following questions. +A school fund raising event sold a total of [`[$totalTickets]`] tickets and generated a total revenue of [`[$cTotalCost]`]. There are two types of tickets: adult tickets and child tickets. Each adult ticket costs [`[$cAdultTicket]`], and each child ticket costs [`[$cChildTicket]`]. Write and solve a system of equations to answer the following questions. [__________]{$adultTickets} adult tickets and [___________]{$childTickets} child tickets were sold. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution30.pg index b3d16206e7..f98f90ed9c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution30.pg @@ -6,14 +6,18 @@ # Last updated: Yao 12/2/2017 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Algebra) -## DBchapter(Systems of equations and inequalities) -## DBsection(Linear systems) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -62,13 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -[$name] invested a total of [`[$cInit]`] in two accounts. One account pays [`[$p1]%`] interest annually; the other pays [`[$p2]%`] interest annually. At the end of the year, [$name] earned a total of [`[$cTotalInt]`] in interest. How much money did [$name] invest in each account? - -Write and solve a system of equations to answer the following questions. - - [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account. +[$name] invested a total of [`[$cInit]`] in two accounts. One account pays [`[$p1]%`] interest annually; the other pays [`[$p2]%`] interest annually. At the end of the year, [$name] earned a total of [`[$cTotalInt]`] in interest. Write and solve a system of equations to find how much money [$name] invested in each account. - [$name] invested [__________]{$cFund2} in the [`[$p2]%`] account. + [$name] invested [__________]{$cFund1} in the [`[$p1]%`] account and [__________]{$cFund2} in the [`[$p2]%`] account. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution40.pg index cfc7f33d7d..f5932062b9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution40.pg @@ -6,14 +6,18 @@ # Last updated: Yao 12/2/2017 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Algebra) -## DBchapter(Systems of equations and inequalities) -## DBsection(Linear systems) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -62,13 +66,9 @@ TEXT(beginproblem()); BEGIN_PGML -[$name] invested a total of [`[$cInit]`] in two accounts. After a year, one account lost [`[$p1]%`], while the other account gained [`[$p2]%`]. In total, [$name] lost [`[$cTotalInt]`]. How much money did [$name] invest in each account? - -Write and solve a system of equations to answer the following questions. - - [$name] invested [__________]{$cFund1} in the account with [`[$p1]%`] loss. +[$name] invested a total of [`[$cInit]`] in two accounts. After a year, one account lost [`[$p1]%`], while the other account gained [`[$p2]%`]. In total, [$name] lost [`[$cTotalInt]`]. Write and solve a system of equations to find how much money [$name] invested in each account. - [$name] invested [__________]{$cFund2} in the account with [`[$p2]%`] gain. + [$name] invested [__________]{$cFund1} in the account with [`[$p1]%`] loss and [__________]{$cFund2} in the account with [`[$p2]%`] gain. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution50.pg index 602b433304..793843d943 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution50.pg @@ -6,14 +6,18 @@ # Last updated: Jordan 9/9/13; Yao 8/4/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Algebra) -## DBchapter(Systems of equations and inequalities) -## DBsection(Linear systems) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -50,15 +54,13 @@ $p3 = $dp3*100; } while (int($dp3*10000)!=($dp3*10000)); -$ethnicity = list_random("Asians", "native Americans", "African Americans", "Hispanics", "whites"); +$ethnicity = list_random("Asians", "Native Americans", "African Americans", "Hispanics", "whites"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Town A and Town B were located close to each other, and recently merged into one city. Town A had a population with [`[$p1]%`] [$ethnicity]. Town B had a population with [`[$p2]%`] [$ethnicity]. After the merge, the new city has a total of [`[$s3]`] residents, with [`[$p3]%`] [$ethnicity]. How many residents did Town A and Town B used to have? - -Write and solve a system equation to answer the following questions. +Town A and Town B were located close to each other, and recently merged into one city. Town A had a population with [`[$p1]%`] [$ethnicity]. Town B had a population with [`[$p2]%`] [$ethnicity]. After the merge, the new city has a total of [`[$s3]`] residents, with [`[$p3]%`] [$ethnicity]. Write and solve a system of equations to find how many residents Town A and Town B used to have. Town A used to have [__________]{$s1} residents, and Town B used to have [__________]{$s2} residents. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution60.pg index c41c87c240..36ab6b9d36 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution60.pg @@ -6,14 +6,18 @@ # Last updated: Yao 12/2/2017 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Algebra) -## DBchapter(Systems of equations and inequalities) -## DBsection(Linear systems) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -67,9 +71,9 @@ END_PGML ############################################## -$step1 = -$dp1*$s3; -$step2 = $dp2-$dp1; -$step3 = $dp3*$s3; +$step1 = Real(-$dp1*$s3); +$step2 = Real($dp2-$dp1); +$step3 = Real($dp3*$s3); $step4 = Real("$step3 + $step1"); if ($step2!=1) { @@ -78,7 +82,7 @@ if ($step2!=1) { } else {$output = "";} -$s4 = $step3 - $dp2*$s3; +$s4 = Real($step3 - $dp2*$s3); BEGIN_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution70.pg index fb57a11845..3986a56e9c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplicationBySubstitution70.pg @@ -6,14 +6,18 @@ # Last updated: Yao 10/25/2017 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-CED.2') -## DBsubject(Algebra) -## DBchapter(Systems of equations and inequalities) -## DBsection(Linear systems) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('solve','system','equation','application') +## DBCCSS('8.EE.8','A-CED.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord0.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord0.pg index 941e42831b..2266b1ef58 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord0.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord0.pg @@ -12,14 +12,18 @@ # Last updated: Jordan 9/9/13; 9/1/13; Hughes, 7/2/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') ## DBCCSS('8.EE.8','A-REI.3','A-REI.5') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) ## KEYWORDS('linear','equation','solve','system','integer','application') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -109,12 +113,7 @@ Context()->variables->are('x'=>'Real','y'=>'Real'); ############################################## TEXT(beginproblem()); BEGIN_PGML -A small fair charges different admission for adults and children; it -charges [`[$currency_adult]`] for adults, and [`[$currency_child]`] for children. - -On a certain day, the total revenue is [`[$currency_f]`] and the fair admits [`[$e]`] people. - -How many adults and children were admitted? +A small fair charges different admission for adults and children. It charges [`[$currency_adult]`] for adults, and [`[$currency_child]`] for children. On a certain day, the total revenue is [`[$currency_f]`] and the fair admits [`[$e]`] people. How many adults and children were admitted? There were [__________]{$ans1} adults and [____________]{$ans2} children at the fair. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord5.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord5.pg index d216c2acde..4a7f30b321 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord5.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord5.pg @@ -10,15 +10,18 @@ # Last updated: Jordan 9/1/13; Hughes, 7/2/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') ## DBCCSS('8.EE.8','A-REI.3','A-REI.5') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Applications) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) ## KEYWORDS('linear','equation','solve','system','integer','application') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "unorderedAnswer.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem10.pg index af84845c1d..f134e67bec 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem10.pg @@ -8,28 +8,31 @@ # Last updated: Yao 8/19/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('system','equation','solution') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserRadioButtons.pl", + "parserPopUp.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -41,9 +44,9 @@ Context()->noreduce('(-x)-y','(-x)+y'); #Decide the number of solutions. #0-> no solution; 1-> 1 solution; 2-> infinitely solutions. $numSolutions = random(0,2,1); -$string0 = "No solution"; -$string1 = "One solution"; -$string2 = "Infinitely many solutions"; +$string0 = "no solution"; +$string1 = "one solution"; +$string2 = "infinitely many solutions"; #Decide the slope of the first line. It could be a fraction or integer. #Decide the y-intercept of the first line. It's an integer. @@ -70,8 +73,8 @@ if ($numSolutions==0) { $func0 = Compute("$m1*x+$b1")->reduce; $func1 = Compute("$m2*x+$b2")->reduce; -$radio = RadioButtons( - [$string0,$string1,$string2], +$popup = PopUp( + ['?',$string0,$string1,$string2], $corString, order=>[$string0,$string1,$string2] ); @@ -82,27 +85,17 @@ TEXT(beginproblem()); BEGIN_PGML -Simply by looking at this system of equations, decide the number of solutions it has. - - [``\left\{\begin{aligned} +Simply by looking at this system of equations, decide the number of solutions it has. [```\left\{\begin{aligned} y &= [$func0] \\ y &= [$func1] \\ -\end{aligned}\right.``] +\end{aligned}\right.```] +The system has [__]{$popup}. END_PGML -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} - -END_TEXT - - ############################################## -ANS( $radio->cmp() ); - if ($numSolutions==0) { $outputLast = "Notice that these two lines have the same slope, but different y-intercepts. This implies they are parallel lines, which do not intersect. This system of equations has no solution."; } elsif ($numSolutions==1) { diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem20.pg new file mode 100644 index 0000000000..6e72dabc3f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem20.pg @@ -0,0 +1,164 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Decide the number of solutions of a system equation. +# One equation is given in slope-intercept form. +# The other is given in standard form. +# The system could have 0, 1, or infinite solutions. +# +# Last updated: Yao 8/19/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') +## KEYWORDS('system','equation','solution') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->variables->add(y => "Real"); +Context()->noreduce('(-x)-y','(-x)+y'); + +#Decide the number of solutions. +#0-> no solution; 1-> 1 solution; 2-> infinitely solutions. +$numSolutions = random(0,2,1); +$string0 = "no solution"; +$string1 = "one solution"; +$string2 = "infinitely many solutions"; + +#Decide the slope of the first line. It could be a fraction or integer. +#Decide the y-intercept of the first line. It's an integer. +$num0 = non_zero_random(-6,6,1); +$den0 = non_zero_random(-6,6,1); +$m0 = Fraction($num0,$den0)->reduce; +$b0 = random(-5,5,1); + +#Decide the second line's slope and y-intercept based on the solution. +if ($numSolutions==0) { + $m1 = $m0; + do {$b1 = random(-5,5,1);} until ($b1!=$b0); + $corString = $string0; +} elsif ($numSolutions==1) { + do {$m1 = $m0+random(-3,3,2);} until ($m1!=0); + $b1 = random(-5,5,1); + $corString = $string1; +} else { + $m1 = $m0; + $b1 = $b0; + $corString = $string2; +} + +$popup = PopUp( + ['?',$string0,$string1,$string2], + $corString, + order=>[$string0,$string1,$string2] +); + +$func0 = Compute("$m0*x+$b0")->reduce; + +@temp = $m1->value; +$m1Rise = $temp[0]; +$m1Run = $temp[1]; + +$multiple = random(2,4,1); +if ($m1Rise>0) { + $xCoef = $m1Rise*$multiple; + $yCoef = -$m1Run*$multiple; + $right = -$b1*$m1Run*$multiple; +} else { + $xCoef = -$m1Rise*$multiple; + $yCoef = $m1Run*$multiple; + $right = $b1*$m1Run*$multiple; +} +$func1 = Compute("$xCoef*x+$yCoef*y")->reduce; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Without graphing this system of equations, decide the number of solutions it has. [```\left\{\begin{aligned} + y &= [$func0] \\ + [$func1] &= [$right] \\ +\end{aligned}\right.```] + +The system has [__]{$popup}. + +END_PGML + + +############################################## + +$func1si = Compute("$m1*x+ $b1")->reduce; +$output1 = $xCoef==1 ? "-x" : "-$xCoef x"; + +if ($right==0) { + $right1 = ""; + $output3 = ""; + $output4 = ""; +} else { + $right1 = $right>0 ? "+$right" : "$right"; + $output3 = "+ (-1) \cdot ($right)"; + $output4 = "+ \frac{$right}{$yCoef}"; +} + +if ($yCoef==1) {$output2 = "";} +elsif ($yCoef==-1) { + $output2 = "-y &= $output1 $right1 \\ + (-1)\cdot(-y) &= (-1) \cdot ($output1) $output3 \\"; +} else { + $output2 = "$yCoef y &= $output1 $right1 \\ + \frac{$yCoef y}{$yCoef} &= \frac{$output1}{$yCoef} $output4 \\"; +} + + +if ($numSolutions==0) { + $outputLast = "Notice that these two lines have the same slope, but different y-intercepts. This implies they are parallel lines, which do not intersect. This system of equations has no solution."; +} elsif ($numSolutions==1) { + $outputLast = "Notice that these two lines have different slopes. This implies they must intersect at one point. This system of equations has one solution."; +} else { + $outputLast = "Notice that these two lines are exactly the same. This implies they have infinitely many solutions."; +} + +BEGIN_PGML_SOLUTION + +We first need to change the second line's equation from standard form to slope-intercept form. + + [`` +\begin{aligned}[t] + [$func1] &= [$right] \\ + [$func1] \mathbf{[$output1]} &= [$right] \mathbf{[$output1]} \\ + [$output2] + y &= [$func1si] +\end{aligned} + ``] + +Now we can compare these two equations. [$outputLast] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem30.pg new file mode 100644 index 0000000000..d0bea140c9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem30.pg @@ -0,0 +1,215 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Decide the number of solutions of a system equation. +# Both equations are given in standard form. +# The system could have 0, 1, or infinite solutions. +# +# Last updated: Yao 8/19/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') +## KEYWORDS('system','equation','solution') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->variables->add(y => "Real"); +Context()->noreduce('(-x)-y','(-x)+y'); + +#Decide the number of solutions. +#0-> no solution; 1-> 1 solution; 2-> infinitely solutions. +$numSolutions = random(0,2,1); +$string0 = "no solution"; +$string1 = "one solution"; +$string2 = "infinitely many solutions"; + +#Decide the slope of the first line. It could be a fraction or integer. +#Decide the y-intercept of the first line. It's an integer. +$num0 = non_zero_random(-6,6,1); +$den0 = non_zero_random(-6,6,1); +$m0 = Fraction($num0,$den0)->reduce; +$b0 = random(-5,5,1); + +#Decide the second line's slope and y-intercept based on the solution. +if ($numSolutions==0) { + $m1 = $m0; + do {$b1 = random(-5,5,1);} until ($b1!=$b0); + $corString = $string0; +} elsif ($numSolutions==1) { + do {$m1 = $m0+random(-3,3,2);} until ($m1!=0); + $b1 = random(-5,5,1); + $corString = $string1; +} else { + $m1 = $m0; + $b1 = $b0; + $corString = $string2; +} + +$popup = PopUp( + ['?',$string0,$string1,$string2], + $corString, + order=>[$string0,$string1,$string2] +); + +#Change both equations to standard form. +@temp = $m0->value; +$m0Rise = $temp[0]; +$m0Run = $temp[1]; + +$multiple0 = random(2,4,1); +if ($m0Rise>0) { + $xCoef0 = $m0Rise*$multiple0; + $yCoef0 = -$m0Run*$multiple0; + $right0 = -$b0*$m0Run*$multiple0; +} else { + $xCoef0 = -$m0Rise*$multiple0; + $yCoef0 = $m0Run*$multiple0; + $right0 = $b0*$m0Run*$multiple0; +} +$func0 = Compute("$xCoef0*x+$yCoef0*y")->reduce; + +@temp = $m1->value; +$m1Rise = $temp[0]; +$m1Run = $temp[1]; + +do {$multiple1 = random(2,4,1);} until ($multiple1!=$multiple0); +if ($m1Rise>0) { + $xCoef1 = $m1Rise*$multiple1; + $yCoef1 = -$m1Run*$multiple1; + $right1 = -$b1*$m1Run*$multiple1; +} else { + $xCoef1 = -$m1Rise*$multiple1; + $yCoef1 = $m1Run*$multiple1; + $right1 = $b1*$m1Run*$multiple1; +} +$func1 = Compute("$xCoef1*x+$yCoef1*y")->reduce; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Without graphing this system of equations, decide the number of solutions it has. [```\left\{\begin{aligned} + [$func0] &= [$right0] \\ + [$func1] &= [$right1] \\ +\end{aligned}\right.```] + +The system has [__]{$popup}. + +END_PGML + + +############################################## + +# for the purpose of showing how to change the first equation +# from standard form to slope-intercept form +$func0si = Compute("$m0*x+ $b0")->reduce; +$output01 = $xCoef0==1 ? "-x" : "-$xCoef0 x"; + +if ($right0==0) { + $right01 = ""; + $output03 = ""; + $output04 = ""; +} else { + $right01 = $right0>0 ? "+$right0" : "$right0"; + $output03 = "+ (-1) \cdot ($right0)"; + $output04 = "+ \frac{$right0}{$yCoef0}"; +} + +if ($yCoef0==1) {$output02 = "";} +elsif ($yCoef0==-1) { + $output02 = "-y &= $output01 $right01 \\ + (-1)\cdot(-y) &= (-1) \cdot ($output01) $output03 \\"; +} else { + $output02 = "$yCoef0 y &= $output01 $right01 \\ + \frac{$yCoef0 y}{$yCoef0} &= \frac{$output01}{$yCoef0} $output04 \\"; +} + +# for the purpose of showing how to change the second equation +# from standard form to slope-intercept form +$func1si = Compute("$m1*x+ $b1")->reduce; +$output11 = $xCoef1==1 ? "-x" : "-$xCoef1 x"; + +if ($right1==0) { + $right11 = ""; + $output13 = ""; + $output14 = ""; +} else { + $right11 = $right1>0 ? "+$right1" : "$right1"; + $output13 = "+ (-1) \cdot ($right1)"; + $output14 = "+ \frac{$right1}{$yCoef1}"; +} + +if ($yCoef1==1) {$output12 = "";} +elsif ($yCoef1==-1) { + $output12 = "-y &= $output11 $right11 \\ + (-1)\cdot(-y) &= (-1) \cdot ($output11) $output13 \\"; +} else { + $output12 = "$yCoef1 y &= $output11 $right11 \\ + \frac{$yCoef1 y}{$yCoef1} &= \frac{$output11}{$yCoef1} $output14 \\"; +} + + +if ($numSolutions==0) { + $outputLast = "Notice that these two lines have the same slope, but different y-intercepts. This implies they are parallel lines, which do not intersect. This system of equations has no solution."; +} elsif ($numSolutions==1) { + $outputLast = "Notice that these two lines have different slopes. This implies they must intersect at one point. This system of equations has one solution."; +} else { + $outputLast = "Notice that these two lines are exactly the same. This implies they have infinitely many solutions."; +} + +BEGIN_PGML_SOLUTION + +We first need to change both equations from standard form to slope-intercept form: + + [`` +\begin{aligned}[t] + [$func0] &= [$right0] \\ + [$func0] \mathbf{[$output01]} &= [$right0] \mathbf{[$output01]} \\ + [$output02] + y &= [$func0si] +\end{aligned} + ``] + +and + + [`` +\begin{aligned}[t] + [$func1] &= [$right1] \\ + [$func1] \mathbf{[$output11]} &= [$right1] \mathbf{[$output11]} \\ + [$output12] + y &= [$func1si] +\end{aligned} + ``] + +Now we can compare these two equations. [$outputLast] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem40.pg index 1ecb320396..a0340d5472 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem40.pg @@ -8,27 +8,30 @@ # Last updated: Yao 8/19/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('system','equation','solution') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserRadioButtons.pl", - "PGcourse.pl" + "parserPopUp.pl", + "PGcourse.pl", ); ############################################## @@ -41,9 +44,9 @@ Context()->noreduce('(-x)-y','(-x)+y'); #0-> no solution; 1-> 1 solution; #For this problem, there is no case for infinitely many solutions. $numSolutions = random(0,1,1); -$string0 = "No solution"; -$string1 = "One solution"; -$string2 = "Infinitely many solutions"; +$string0 = "no solution"; +$string1 = "one solution"; +$string2 = "infinitely many solutions"; if ($numSolutions==0) { $var = list_random("x","y"); @@ -60,8 +63,8 @@ if ($numSolutions==0) { $corString = $string1; } -$radio = RadioButtons( - [$string0,$string1,$string2], +$popup = PopUp( + ['?',$string0,$string1,$string2], $corString, order=>[$string0,$string1,$string2] ); @@ -72,27 +75,18 @@ TEXT(beginproblem()); BEGIN_PGML -Simply by looking at this system of equations, decide the number of solutions it has. - - [``\left\{\begin{aligned} +Simply by looking at this system of equations, decide the number of solutions it has. [```\left\{\begin{aligned} &[$equ1] \\ &[$equ2] \\ -\end{aligned}\right.``] +\end{aligned}\right.```] +The system has [__]{$popup}. END_PGML -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} - -END_TEXT - ############################################## -ANS( $radio->cmp() ); - if ($numSolutions==0) { $VerOrHor = ($var eq "x") ? "vertical" : "horizontal"; $outputLast = "Both lines are $VerOrHor, and the equations are different. This implies they are parallel lines, which do not intersect. This system of equations has no solution."; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem10.pg index 9d71e04346..4c1ab224bc 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem10.pg @@ -7,27 +7,30 @@ # Last updated: Yao 8/16/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('check','system','equation') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserRadioButtons.pl", - "PGcourse.pl" + "parserPopUp.pl", + "PGcourse.pl", ); ############################################## @@ -48,8 +51,8 @@ do {$e=non_zero_random(-5,5,1);} until ($a*$e-$b*$d!=0); #Randomly decide whether the given point is the solution or not. $TrueOrFalse = random(0,1,1); -$isString = "Yes"; -$notString = "No"; +$isString = "is"; +$notString = "is not"; if ($TrueOrFalse==1) {$corString = $isString} else {$corString = $notString}; #If the point is not solution, decide we should make the first or second equation false. @@ -70,8 +73,8 @@ $func2 = Compute("$d*x+$e*y")->reduce; $c = $FirstIsTrue ? $func1->eval(x=>$x,y=>$y) : $func1->eval(x=>$x,y=>$y)+non_zero_random(-3,3,1); $f = $SecondIsTrue ? $func2->eval(x=>$x,y=>$y) : $func2->eval(x=>$x,y=>$y)+non_zero_random(-3,3,1); -$radio = RadioButtons( - [$isString,$notString], +$popup = PopUp( + ['?',$isString,$notString], $corString, last => [$notString], ); @@ -82,27 +85,18 @@ TEXT(beginproblem()); BEGIN_PGML -Decide whether [`([$x],[$y])`] is a solution to the system of equations - - [``\left\{\begin{aligned} +Decide whether [`([$x],[$y])`] is a solution to the system of equations: [```\left\{\begin{aligned} [$func1] &= [$c] \\ [$func2] &= [$f] \\ -\end{aligned}\right.``] +\end{aligned}\right.```] +The point [`([$x],[$y])`] [__]{$popup} a solution. END_PGML -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} - -END_TEXT - ############################################## -ANS( $radio->cmp() ); - #These will be used to show procedures in solutions. $firstEquationSubstitute = $func1->value; $firstEquationSubstitute =~ s/x/($x)/; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem20.pg index bb877acb64..cf9de6b42d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem20.pg @@ -7,27 +7,30 @@ # Last updated: Yao 8/16/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('check','system','equation') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserRadioButtons.pl", - "PGcourse.pl" + "parserPopUp.pl", + "PGcourse.pl", ); ############################################## @@ -48,8 +51,8 @@ do {$d=non_zero_random(-5,5,1);} until ($a*$e+$b*$d!=0); #Randomly decide whether the given point is the solution or not. $TrueOrFalse = random(0,1,1); -$isString = "Yes"; -$notString = "No"; +$isString = "is"; +$notString = "is not"; if ($TrueOrFalse==1) {$corString = $isString} else {$corString = $notString}; #If the point is not solution, decide we should make the first or second equation false. @@ -71,8 +74,8 @@ $func2 = Compute("-$d*x+$f")->reduce; $c = $FirstIsTrue ? $func1->eval(x=>$x,y=>$y) : $func1->eval(x=>$x,y=>$y)+non_zero_random(-3,3,1); -$radio = RadioButtons( - [$isString,$notString], +$popup = PopUp( + ['?',$isString,$notString], $corString, last => [$notString], ); @@ -83,27 +86,18 @@ TEXT(beginproblem()); BEGIN_PGML -Decide whether [`([$x],[$y])`] is a solution to the system of equations - - [``\left\{\begin{aligned} +Decide whether [`([$x],[$y])`] is a solution to the system of equations: [```\left\{\begin{aligned} [$func1] &= [$c] \\ y &= [$func2] \\ -\end{aligned}\right.``] +\end{aligned}\right.```] +The point [`([$x],[$y])`] [__]{$popup} a solution. END_PGML -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} - -END_TEXT - ############################################## -ANS( $radio->cmp() ); - #These will be used to show procedures in solutions. $firstEquationSubstitute = $func1->value; $firstEquationSubstitute =~ s/x/($x)/; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem30.pg index 3f70e4e510..4f21a217d1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem30.pg @@ -8,28 +8,31 @@ # Last updated: Jordan 9/5/13; Yao 8/17/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('check','system','equation') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserRadioButtons.pl", + "parserPopUp.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,8 +56,8 @@ do {$e=non_zero_random(-3,3,1)*$den;} until ($a*$e-$b*$d!=0); #Randomly decide whether the given point is the solution or not. $TrueOrFalse = random(0,1,1); -$isString = "Yes"; -$notString = "No"; +$isString = "is"; +$notString = "is not"; if ($TrueOrFalse==1) {$corString = $isString} else {$corString = $notString}; #If the point is not solution, decide we should make the first or second equation false. @@ -75,8 +78,8 @@ $func2 = Compute("$d*x+$e*y")->reduce; $c = $FirstIsTrue ? $func1->eval(x=>$x,y=>$y) : $func1->eval(x=>$x,y=>$y)+non_zero_random(-3,3,1); $f = $SecondIsTrue ? $func2->eval(x=>$x,y=>$y) : $func2->eval(x=>$x,y=>$y)+non_zero_random(-3,3,1); -$radio = RadioButtons( - [$isString,$notString], +$popup = PopUp( + ['?',$isString,$notString], $corString, last => [$notString], ); @@ -87,26 +90,18 @@ TEXT(beginproblem()); BEGIN_PGML -Decide whether [`\left([$x],[$y]\right)`] is a solution to the system of equations. - - [``\left\{\begin{aligned} +Decide whether [`\left([$x],[$y]\right)`] is a solution to the system of equations: [```\left\{\begin{aligned} [$func1] &= [$c] \\ [$func2] &= [$f] \\ -\end{aligned}\right.``] +\end{aligned}\right.```] +The point [`\left([$x],[$y]\right)`] [__]{$popup} a solution. END_PGML -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} - -END_TEXT - ############################################## -ANS( $radio->cmp() ); #These will be used to show procedures in solutions. $firstEquationSubstitute = $func1->value; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg index 2cf8b69998..41432f3db1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg @@ -8,37 +8,40 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('system','equation','graph') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", "PCCgraphMacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Point"); Context()->noreduce("(-x)-y","(-x)+y"); -$refreshCachedImages=1; + #These two arrays store the coordinates of the intersections. #(x[0],y[0]) is the correct solution in the correct graph. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg index 009f2264d7..3304bf0feb 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg @@ -9,36 +9,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('system','equation','graph') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", "PCCgraphMacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Point"); -$refreshCachedImages=1; + #These two arrays store the coordinates of the intersections. #(x[0],y[0]) is the correct solution in the correct graph. @@ -288,7 +291,8 @@ $BCENTER \( \begin{aligned} $func2 &= $right \\ - $func2 \mathbf{$output1} &= $right \mathbf{$output1} \\ $output2 + $func2 \mathbf{$output1} &= $right \mathbf{$output1} \\ + $output2 y &= $func3 \end{aligned} \) diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg index 749072e3dc..b2e524edc5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg @@ -8,36 +8,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('system','equation','graph') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", "PCCgraphMacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Point"); -$refreshCachedImages=1; + #These two arrays store the coordinates of the intersections. #(x[0],y[0]) is the correct solution in the correct graph. @@ -321,7 +324,8 @@ $PAR \[ \begin{aligned} $func0 &= $right0 \\ - $func0 \mathbf{$output01} &= $right0 \mathbf{$output01} \\ $output02 + $func0 \mathbf{$output01} &= $right0 \mathbf{$output01} \\ + $output02 y &= $func0si \end{aligned} \] @@ -331,7 +335,8 @@ $PAR \[ \begin{aligned} $func1 &= $right1 \\ - $func1 \mathbf{$output11} &= $right1 \mathbf{$output11} \\ $output12 + $func1 \mathbf{$output11} &= $right1 \mathbf{$output11} \\ + $output12 y &= $func1si \end{aligned} \] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg index 00590d4bff..bc922fc53a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg @@ -9,36 +9,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('system','equation','graph') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", "PCCgraphMacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Point"); -$refreshCachedImages=1; + #These two arrays store the coordinates of the intersections. #(x[0],y[0]) is the correct solution in the correct graph. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg index e5cecb1878..3609b74a34 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg @@ -9,36 +9,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('system','equation','graph') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", "PCCgraphMacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("Point"); -$refreshCachedImages=1; + #These two arrays store the coordinates of the intersections. #(x[0],y[0]) is the correct solution in the correct graph. @@ -288,7 +291,8 @@ $PAR \[ \begin{aligned} $func0 &= $right \\ - $func0 \mathbf{$output1} &= $right \mathbf{$output1} \\ $output2 + $func0 \mathbf{$output1} &= $right \mathbf{$output1} \\ + $output2 y &= $func1 \end{aligned} \] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg index fb55d3f1ac..e185686bc1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg @@ -10,30 +10,33 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('system','equation','graph','parallel','no solution') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", "PCCgraphMacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,7 +53,7 @@ Context("Point"); ); $intersection = Compute("no solution"); -$refreshCachedImages=1; + Context("Fraction"); Context()->variables->add(y => "Real"); @@ -297,7 +300,8 @@ $PAR \[ \begin{aligned} $func1 &= $right \\ - $func1 \mathbf{$output1} &= $right \mathbf{$output1} \\ $output2 + $func1 \mathbf{$output1} &= $right \mathbf{$output1} \\ + $output2 y &= $func2 \end{aligned} \] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg index 5be203c34f..8babd0c44c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg @@ -9,36 +9,39 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('system','equation','graph','parallel','no solution') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", "PCCgraphMacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## -$refreshCachedImages=1; + Context("Point"); Context()->strings->add("no solution"=>{}, "no solutions"=>{alias=>'no solution'}, @@ -333,7 +336,8 @@ Here is how to rewrite the first equation in slope-intercept form: $PAR \[\begin{aligned} $func0 &= $right0 \\ - $func0 \mathbf{$output01} &= $right0 \mathbf{$output01} \\ $output02 + $func0 \mathbf{$output01} &= $right0 \mathbf{$output01} \\ + $output02 y &= $func0si \end{aligned} \] @@ -342,7 +346,8 @@ Here is how to rewrite the second equation in slope-intercept form: $PAR \[\begin{aligned} $func1 &= $right1 \\ - $func1 \mathbf{$output11} &= $right1 \mathbf{$output11} \\ $output12 + $func1 \mathbf{$output11} &= $right1 \mathbf{$output11} \\ + $output12 y &= $func1si \end{aligned} \] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg index ce61261e6c..539186f51f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg @@ -10,35 +10,38 @@ # # ENDDESCRIPTION -## DBCCSS('8.EE.8','A.REI.6') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Systems of Equations and Inequalities') +## DBsection('Systems of Linear Equations') ## KEYWORDS('system','equation','graph','infinitely') +## DBCCSS('8.EE.8','A.REI.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserRadioButtons.pl", "contextFraction.pl", "PCCgraphMacros.pl", "pccTables.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## -$refreshCachedImages=1; + Context("Point"); Context()->strings->add("no solution"=>{}, @@ -305,7 +308,8 @@ $PAR \[ \begin{aligned} $func1 &= $right \\ - $func1 \mathbf{$output1} &= $right \mathbf{$output1} \\ $output2 + $func1 \mathbf{$output1} &= $right \mathbf{$output1} \\ + $output2 y &= $func2 \end{aligned} \] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation10.pg index 3789e41fc9..c6ae6c9ab1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation10.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 6/25/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-REI.3','A-REI.5') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') ## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,9 +32,10 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "PGML.pl", + "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -95,16 +99,14 @@ $ans = Compute("($x,$y)"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Solve the following system of equations, using whichever method you wish. +Solve the following system of equations. - [`\left\{\begin{aligned} +[```\left\{\begin{aligned} [$topLeft] & = [$e] \\ [$botLeft] & = [$f] -\end{aligned}\right.`] +\end{aligned}\right.```] -* If there is one solution, enter it as an ordered pair. -* If there is no solution, enter *no solution*. Spelling counts. -* If there is an infinite number of solutions, enter *infinite number of solutions*. Spelling counts. +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** [_________________________________] @@ -125,16 +127,19 @@ if($a==1 and $a!=$c and $b!=$d) $lhs=Formula("$c*$e-$c*$b*y+$d*y")->reduce; BEGIN_PGML_SOLUTION -* From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +1. From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ equation and solve for [`y`]. -* This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. -* Now that we have [`y`], we find [`x`] using the _first_ equation: - [`\begin{aligned} +1. This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. + +1. Now that we have [`y`], we find [`x`] using the _first_ equation: + + [```\begin{aligned} x&=[$e]-([$b])\cdot([$y])\\ &=[$x] - \end{aligned}`] -* [$commonConclusion]** + \end{aligned}```] + +1. [$commonConclusion]** END_PGML_SOLUTION } elsif($b==1 and $b!=$d and $a!=$c) @@ -145,16 +150,19 @@ elsif($b==1 and $b!=$d and $a!=$c) $rhs=Formula("$e-$a*x")->reduce; BEGIN_PGML_SOLUTION -* From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. -* This gives [`[$lhs]=[$f]`] so [`x=[$x]`] -* Now that we have [`x`], we find [`y`] using the first equation: +1. From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. + +1. This gives [`[$lhs]=[$f]`] so [`x=[$x]`] - [` +1. Now that we have [`x`], we find [`y`] using the first equation: + + [``` \begin{aligned} y&=[$e]-([$a])\cdot([$x])\\ &=[$y] - \end{aligned}`] -* [$commonConclusion]** + \end{aligned}```] + +1. [$commonConclusion]** END_PGML_SOLUTION } elsif($c==1 and $a!=$c and $b!=$d) @@ -164,16 +172,19 @@ elsif($c==1 and $a!=$c and $b!=$d) $rhs=Formula("$f-$d*y")->reduce; $lhs=Formula("$a*$f-$a*$d*y+$b*y")->reduce; BEGIN_PGML_SOLUTION -* From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. -* This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. -* Now that we have [`y`], we find [`x`] using the _second_ equation: +1. From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. + +1. This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. - [` +1. Now that we have [`y`], we find [`x`] using the _second_ equation: + + [``` \begin{aligned} x&=[$f]-([$d])\cdot([$y])\\ &=[$x] - \end{aligned}`] -* [$commonConclusion]** + \end{aligned}```] + +1. [$commonConclusion]** END_PGML_SOLUTION } elsif($d==1 and $d!=$b and $a!=$c) @@ -183,16 +194,19 @@ elsif($d==1 and $d!=$b and $a!=$c) $lhs=Formula("$a*x+$b*$f-$b*$c*x")->reduce; BEGIN_PGML_SOLUTION -* From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. -* This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. -* Now that we have [`x`], we find [`y`] using the _second_ equation: +1. From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. - [` +1. This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. + +1. Now that we have [`x`], we find [`y`] using the _second_ equation: + + [``` \begin{aligned} y&=[$f]-([$c])\cdot([$x])\\ &=[$y] - \end{aligned}`] -* [$commonConclusion]** + \end{aligned}```] + +1. [$commonConclusion]** END_PGML_SOLUTION } else @@ -205,10 +219,13 @@ else $lhs=Formula("$b*y-$d*y")->reduce; $lhs1=Formula("$a*x+$b*($y)")->reduce; BEGIN_PGML_SOLUTION -* We subtract the two equations, which will cancel the terms in involving [`x`] and give [`[$lhs]=[$e]-([$f])`]. -* This gives [`y=[$y]`]. -* Now that we have [`y`], we find [`x`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`x=[$x]`]. -* [$commonConclusion]** +1. We subtract the two equations, which will cancel the terms in involving [`x`] and give [`[$lhs]=[$e]-([$f])`]. + +1. This gives [`y=[$y]`]. + +1. Now that we have [`y`], we find [`x`] using either equation. Let's use the first: [`[$lhs1]=[$e]`], so [`x=[$x]`]. + +1. [$commonConclusion]** END_PGML_SOLUTION } elsif($b==$d) @@ -219,10 +236,13 @@ END_PGML_SOLUTION $lhs=Formula("$a*x-$c*x")->reduce; $lhs1=Formula("$a*($x)+$b*y")->reduce; BEGIN_PGML_SOLUTION -* We subtract the two equations, which will cancel the terms in involving [`y`] and give [`[$lhs]=[$e]-([$f])`]. -* This gives [`x=[$x]`]. -* Now that we have [`x`], we find [`y`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`y=[$y]`]. -* [$commonConclusion]** +1. We subtract the two equations, which will cancel the terms in involving [`y`] and give [`[$lhs]=[$e]-([$f])`]. + +1. This gives [`x=[$x]`]. + +1. Now that we have [`x`], we find [`y`] using either equation. Let's use the first: [`[$lhs1]=[$e]`], so [`y=[$y]`]. + +1. [$commonConclusion]** END_PGML_SOLUTION } else @@ -242,20 +262,22 @@ END_PGML_SOLUTION # put them together BEGIN_PGML_SOLUTION -* Let's multiply the _first_ equation by [$c] and the _second_ equation by [$a] +1. Let's multiply the _first_ equation by [$c] and the _second_ equation by [$a] - [`\begin{aligned} + [```\begin{aligned} [$topleft] &= [$topright]\\ [$bottomleft] &=[$bottomright] - \end{aligned}`] -* Subtracting these two equations gives [`[$lhs]=[$rhs]`], so [`y=[$y]`]. + \end{aligned}```] -* Now that we have [`y`], we can use either equation to find [`x`]; let's use the first one: +1. Subtracting these two equations gives [`[$lhs]=[$rhs]`], so [`y=[$y]`]. - [`[$a]*x+([$b])\cdot([$y])=[$e]`] +1. Now that we have [`y`], we can use either equation to find [`x`]; let's use the first one: + + [```[$a]*x+([$b])\cdot([$y])=[$e]```] so [`x=[$x]`]. -* [$commonConclusion]** + +1. [$commonConclusion]** END_PGML_SOLUTION } } diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg index ea3e7d8ff3..57f9f0cb99 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg @@ -13,15 +13,18 @@ # Last updated: Hughes, 6/16/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-REI.3','A-REI.5') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') ## KEYWORDS('linear', 'equation', 'solve', 'system', 'integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -31,8 +34,9 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "PGML.pl", - "PGcourse.pl" + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -124,16 +128,14 @@ Context()->strings->add("no solution"=>{}, ############################################## TEXT(beginproblem()); BEGIN_PGML -Solve the following system of equations, using whichever method you wish. +Solve the following system of equations. - [`\left\{\begin{aligned} +[```\left\{\begin{aligned} [$topLeft] & = [$e] \\ [$botLeft] & = [$f] -\end{aligned}\right.`] +\end{aligned}\right.```] -* If there is one solution, enter it as an ordered pair. -* If there is no solution, enter *no solution*. Spelling counts. -* If there is an infinite number of solutions, enter *infinite number of solutions*. Spelling counts. +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** [_________________________________]{Compute("($x,$y)")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg index 6b2f0f30a4..9f98d07cd7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 6/25/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-REI.3','A-REI.5') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') ## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,8 +32,9 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "PGML.pl", - "PGcourse.pl" + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -91,16 +95,14 @@ Context()->strings->add("no solution"=>{}, ############################################## TEXT(beginproblem()); BEGIN_PGML -Solve the following system of equations, using whichever method you wish. +Solve the following system of equations. - [`\left\{\begin{aligned} +[```\left\{\begin{aligned} [$topLeft] & = [$e] \\ [$botLeft] & = [$f] -\end{aligned}\right.`] +\end{aligned}\right.```] -* If there is one solution, enter it as an ordered pair. -* If there is no solution, enter *no solution*. Spelling counts. -* If there is an infinite number of solutions, enter *infinite number of solutions*. Spelling counts. +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** [_________________________________]{Compute("($x,$y)")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation40.pg index 748fb29fe7..182c5254a6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation40.pg @@ -12,15 +12,18 @@ # Last updated: Carl Yao, 6/25/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-REI.3','A-REI.5') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') ## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -29,8 +32,9 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "PGML.pl", - "PGcourse.pl" + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -116,16 +120,14 @@ Context()->strings->add("no solution"=>{}, ############################################## TEXT(beginproblem()); BEGIN_PGML -Solve the following system of equations, using whichever method you wish. +Solve the following system of equations. - [`\left\{\begin{aligned} +[```\left\{\begin{aligned} [$topLeft] & = [$e] \\ [$botLeft] & = [$f] -\end{aligned}\right.`] +\end{aligned}\right.```] -* If there is one solution, enter it as an ordered pair. -* If there is no solution, enter *no solution*. Spelling counts. -* If there is an infinite number of solutions, enter *infinite number of solutions*. Spelling counts. +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** [_________________________________]{Compute("($x,$y)")} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg index 173cc8fc1d..ba75166e3c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg @@ -11,15 +11,18 @@ # Last updated: Hughes 7/24/13, Carl Yao, 6/25/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-REI.3','A-REI.5') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') ## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,10 +31,11 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "PGML.pl", + "PGML.pl", "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -87,22 +91,20 @@ $ans = Compute("no solution"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Solve the following system of equations, using whichever method you wish. +Solve the following system of equations. - [`\left\{\begin{aligned} +[```\left\{\begin{aligned} [$topLeft] & = [$e] \\ [$botLeft] & = [$f] -\end{aligned}\right.`] +\end{aligned}\right.```] -* If there is one solution, enter it as an ordered pair. -* If there is no solution, enter *no solution*. Spelling counts. -* If there is an infinite number of solutions, enter *infinite number of solutions*. Spelling counts. +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** [_________________________________] END_PGML -ANS($ans -> cmp() -> +ANS($ans -> cmp(typeMatch=>Point(0,0)) -> withPostFilter(AnswerHints( ["infinity"] => "It doesn't make sense to say 'infinity' here- did you mean 'infinite number of solutions'?."))); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg index 126be0f74e..e2a3386a51 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg @@ -11,15 +11,18 @@ # Last updated: Carl Yao, 6/25/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-REI.3','A-REI.5') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') ## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -28,10 +31,11 @@ DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", - "PGML.pl", + "PGML.pl", "contextFraction.pl", "answerHints.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -88,22 +92,20 @@ $ans = Compute("infinite number of solutions"); ############################################## TEXT(beginproblem()); BEGIN_PGML -Solve the following system of equations, using whichever method you wish. +Solve the following system of equations. - [`\left\{\begin{aligned} +[```\left\{\begin{aligned} [$topLeft] & = [$e] \\ [$botLeft] & = [$f] -\end{aligned}\right.`] +\end{aligned}\right.```] -* If there is one solution, enter it as an ordered pair. -* If there is no solution, enter *no solution*. Spelling counts. -* If there is an infinite number of solutions, enter *infinite number of solutions*. Spelling counts. +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** [_________________________________] END_PGML -ANS($ans -> cmp() -> +ANS($ans -> cmp(typeMatch=>Point(0,0)) -> withPostFilter(AnswerHints( ["infinity"] => "It doesn't make sense to say 'infinity' here- did you mean 'infinite number of solutions'?."))); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub10.pg new file mode 100644 index 0000000000..a07c17b1eb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub10.pg @@ -0,0 +1,292 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Solve the system of linear equations +# a x + b y = e +# c x + d y = f +# where a, b, c, d are (positive) integer values on the interval [1,5] +# +# The solution, (x,y), where x and y are both integers on the interval +# [-10,10]. +# +# Last updated: Carl Yao, 6/25/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +Context()->parens->undefine('['); +Context()->parens->undefine('{'); +Context()->parens->undefine('|'); +Context()->parens->undefine('<'); +#This approach guarantees integer solutions + +# start with the solution +$x=random(-10,10,1); +$y=random(-10,10,1); + +# set up the system +# a x + b y =e +# c x + d y = f +# need to make sure that +# ad - bc != 0 + +# initialize the variables +$a=1; +$b=1; +$c=1; +$d=1; + +# set up $a, $b, $c, $d +while($a*$d -$c*$b == 0){ +$a=random(2,5,1); +$b=random(2,5,1); +$c=random(2,5,1); +$d=random(2,5,1); +# guarantee one is 1 so substitution is the right method +if (list_random(1,0,0,0)) {$a = 1;} +elsif (list_random(1,0,0)) {$b = 1;} +elsif (list_random(1,0,)) {$c = 1;} +else {$d = 1;} +} + +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$topLeft = Formula("$a*x+$b*y")->reduce; +$e = $topLeft->eval(x=>$x,y=>$y); + +$botLeft = Formula("$c*x+$d*y")->reduce; +$f = $botLeft->eval(x=>$x,y=>$y); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "infinite number of solutions"=>{}, + "infinite"=>{alias=>'infinite number of solutions'}, + "infinite solutions"=>{alias=>'infinite number of solutions'}); + +$ans = Compute("($x,$y)"); + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{\begin{aligned} + [$topLeft] & = [$e] \\ + [$botLeft] & = [$f] +\end{aligned}\right.```] + +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** + +[_________________________________] + +END_PGML + +ANS($ans -> cmp() -> + withPostFilter(AnswerHints( + ["infinity"] => + "It doesn't make sense to say 'infinity' here- did you mean 'infinite number of solutions'?."))); + +$commonConclusion = "The solution to the system is [`($x,$y)`]. It is left as an exercise to check. Please also note that you may have solved this problem a different way."; + +if($a==1 and $a!=$c and $b!=$d) +{ + # x + by = e should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$e-$b*y")->reduce; + $lhs=Formula("$c*$e-$c*$b*y+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +1. From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. + +1. This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. + +1. Now that we have [`y`], we find [`x`] using the _first_ equation: + + [```\begin{aligned} + x&=[$e]-([$b])\cdot([$y])\\ + &=[$x] + \end{aligned}```] + +1. [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==1 and $b!=$d and $a!=$c) +{ + # ax + y = e should be solved for y + # provided that $b and $d are not equal- in this case we should use subtraction. + $lhs=Formula("$c*x+$d*$e-$d*$a*x")->reduce; + $rhs=Formula("$e-$a*x")->reduce; + +BEGIN_PGML_SOLUTION +1. From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. + +1. This gives [`[$lhs]=[$f]`] so [`x=[$x]`] + +1. Now that we have [`x`], we find [`y`] using the first equation: + + [``` + \begin{aligned} + y&=[$e]-([$a])\cdot([$x])\\ + &=[$y] + \end{aligned}```] + +1. [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==1 and $a!=$c and $b!=$d) +{ + # x + dy = f should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$f-$d*y")->reduce; + $lhs=Formula("$a*$f-$a*$d*y+$b*y")->reduce; +BEGIN_PGML_SOLUTION +1. From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. + +1. This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. + +1. Now that we have [`y`], we find [`x`] using the _second_ equation: + + [``` + \begin{aligned} + x&=[$f]-([$d])\cdot([$y])\\ + &=[$x] + \end{aligned}```] + +1. [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==1 and $d!=$b and $a!=$c) +{ + # cx + y = f should be solved for y + $rhs=Formula("$f-$c*x")->reduce; + $lhs=Formula("$a*x+$b*$f-$b*$c*x")->reduce; + +BEGIN_PGML_SOLUTION +1. From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. + +1. This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. + +1. Now that we have [`x`], we find [`y`] using the _second_ equation: + + [``` + \begin{aligned} + y&=[$f]-([$c])\cdot([$x])\\ + &=[$y] + \end{aligned}```] + +1. [$commonConclusion]** +END_PGML_SOLUTION +} +else +{ + if($a==$c) + { + # ax + by = e + # ax + dy = f + # should be solved using subtraction + $lhs=Formula("$b*y-$d*y")->reduce; + $lhs1=Formula("$a*x+$b*($y)")->reduce; +BEGIN_PGML_SOLUTION +1. We subtract the two equations, which will cancel the terms in involving [`x`] and give [`[$lhs]=[$e]-([$f])`]. + +1. This gives [`y=[$y]`]. + +1. Now that we have [`y`], we find [`x`] using either equation. Let's use the first: [`[$lhs1]=[$e]`], so [`x=[$x]`]. + +1. [$commonConclusion]** +END_PGML_SOLUTION + } + elsif($b==$d) + { + # ax + by = e + # cx + by = f + # should be solved using subtraction + $lhs=Formula("$a*x-$c*x")->reduce; + $lhs1=Formula("$a*($x)+$b*y")->reduce; +BEGIN_PGML_SOLUTION +1. We subtract the two equations, which will cancel the terms in involving [`y`] and give [`[$lhs]=[$e]-([$f])`]. + +1. This gives [`x=[$x]`]. + +1. Now that we have [`x`], we find [`y`] using either equation. Let's use the first: [`[$lhs1]=[$e]`], so [`y=[$y]`]. + +1. [$commonConclusion]** +END_PGML_SOLUTION + } + else + { + # otherwise use elimination + + # multiply the first equation by $c + $topleft=Formula("$c*$a*x+$c*$b*y")->reduce; + $topright=$c*$e; + + # multiply the second equation by $a + $bottomleft=Formula("$a*$c*x+$a*$d*y")->reduce; + $bottomright=$a*$f; + + $lhs=Formula("$c*$b*y-$a*$d*y")->reduce; + $rhs=$c*$e-$a*$f; + + # put them together +BEGIN_PGML_SOLUTION +1. Let's multiply the _first_ equation by [$c] and the _second_ equation by [$a] + + [```\begin{aligned} + [$topleft] &= [$topright]\\ + [$bottomleft] &=[$bottomright] + \end{aligned}```] + +1. Subtracting these two equations gives [`[$lhs]=[$rhs]`], so [`y=[$y]`]. + +1. Now that we have [`y`], we can use either equation to find [`x`]; let's use the first one: + + [```[$a]*x+([$b])\cdot([$y])=[$e]```] + + so [`x=[$x]`]. + +1. [$commonConclusion]** +END_PGML_SOLUTION + } +} + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub30.pg new file mode 100644 index 0000000000..12663ae371 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub30.pg @@ -0,0 +1,263 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Solve the system of linear equations +# a x + b y =e +# c x + d y = f +# where a, b, c, d are NEGATIVE integer values on the interval [-5,1] +# +# The solution, (x,y), where x and y are both integers on the interval +# [-10,10]. +# +# Last updated: Carl Yao, 6/25/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); + +#This approach guarantees integer solutions + +# start with the solution +$x=random(-10,10,1); +$y=random(-10,10,1); + +# set up the system +# a x + b y =e +# c x + d y = f +# need to make sure that +# ad - bc != 0 + +# initialize the variables +$a=1; +$b=1; +$c=1; +$d=1; + +while($a*$d -$c*$b == 0){ +$a=random(-5,-1,1); +$b=random(-5,-1,1); +$c=random(-5,-1,1); +$d=random(-5,-1,1); +# guarantee one is 1 so substitution is the right method +if (list_random(1,0,0,0)) {$a = 1;} +elsif (list_random(1,0,0)) {$b = 1;} +elsif (list_random(1,0,)) {$c = 1;} +else {$d = 1;} + +} + +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$topLeft = Formula("$a*x+$b*y")->reduce; +$e = $topLeft->eval(x=>$x,y=>$y); + +$botLeft = Formula("$c*x+$d*y")->reduce; +$f = $botLeft->eval(x=>$x,y=>$y); + +$commonConclusion = "The solution to the system is [`($x,$y)`]. It is left as an exercise to check. Please also note that you may have solved this problem a different way."; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "infinite number of solutions"=>{}, + "infinite"=>{alias=>'infinite number of solutions'}, + "infinite solutions"=>{alias=>'infinite number of solutions'}); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{\begin{aligned} + [$topLeft] & = [$e] \\ + [$botLeft] & = [$f] +\end{aligned}\right.```] + +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** + +[_________________________________]{Compute("($x,$y)")} + +END_PGML + + +if($a==-1 and $a != $c and $b!=$d) +{ + # - x + by = e should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$b*y-$e")->reduce; + $lhs=Formula("$c*$b*y-$c*$e+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. +* This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. +* We find [`x`] using the _first_ equation: + + [`\begin{aligned} + x&=([$b])\cdot([$y])-([$e])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==-1 and $b!=$d and $a!=$c) +{ + # ax - y = e should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$a*x-$e")->reduce; + $lhs=Formula("$c*x+$d*$a*x-$d*$e")->reduce; +BEGIN_PGML_SOLUTION +* From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$f]`] so [`x=[$x]`]. +* We find [`y`] using the first equation: + + [`\begin{aligned} + y&=([$a])\cdot([$x])-([$e]) \\ + &=[$y]\end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==-1 and $a!=$c and $b!=$d) +{ + # - x + dy = f should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$d*y-$f")->reduce; + $lhs=Formula("$a*$d*y-$a*$f+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. +* This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. +* We find [`x`] using the _second_ equation: + + [`\begin{aligned} + x&=([$d])\cdot([$y])-([$f])\\ + &=[$x] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==-1 and $b!=$d and $a!=$c) +{ + # cx - y = f should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$c*x-$f")->reduce; + $lhs=Formula("$a*x+$b*$c*x-$b*$f")->reduce; + +BEGIN_PGML_SOLUTION +* From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. +* We find [`y`] using the _second_ equation: + + [`\begin{aligned} + y&=([$c])\cdot([$x])-([$f])\\ + &=[$y] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +else +{ + if($a==$c) + { + # ax + by = e + # ax + dy = f + # should be solved using subtraction + $lhs=Formula("$b*y-$d*y")->reduce; + $lhs1=Formula("$a*x+$b*$y")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms involving [`x`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`y=[$y]`]. +* We find [`x`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + elsif($b==$d) + { + # ax + by = e + # cx + by = f + # should be solved using subtraction + $lhs=Formula("$a*x-$c*x")->reduce; + $lhs1=Formula("$a*($x)+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms involving [`y`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`x=[$x]`]. +* We find [`y`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + else + { + # otherwise use elimination + + # multiply the first equation by $c + $topleft=Formula("$c*$a*x+$c*$b*y")->reduce; + $topright=$c*$e; + + # multiply the second equation by $a + $bottomleft=Formula("$a*$c*x+$a*$d*y")->reduce; + $bottomright=$a*$f; + + $lhs=Formula("$c*$b*y-$a*$d*y")->reduce; + $rhs=$c*$e-$a*$f; + + # put them together +BEGIN_PGML_SOLUTION +* Let's multiply the _first_ equation by [$c] and the _second_ equation by [$a] + + [`\begin{aligned} + [$topleft] &= [$topright]\\ + [$bottomleft] &=[$bottomright] + \end{aligned}`] +* Subtracting these two equations gives [`[$lhs]=[$rhs]`], so [`y=[$y]`]. + +* Now that we have [`y`], we can use either equation to find [`x`]; let's use the first one: + + [`[$a]*x+([$b])\cdot([$y])=[$e]`] + + so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } +} + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub40.pg new file mode 100644 index 0000000000..182c5254a6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquationSub40.pg @@ -0,0 +1,238 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Solve the system of linear equations +# a x + b y =e +# c x + d y = f +# where only ONE of a, b, c, d is ZERO, and the rest will be (non-zero) integer values on the interval [-5,5] +# +# The solution is, (x,y), where x and y are both integers on the interval +# [-10,10]. +# +# Last updated: Carl Yao, 6/25/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); + +#This approach guarantees integer solutions + +# start with the solution +$x=random(-10,10,1); +$y=random(-10,10,1); + +# set up the system +# a x + b y = e +# c x + d y = f +# need to make sure that +# ad - bc != 0 + +# initialize the variables +$a=1; +$c=1; +$b=1; +$d=1; + +while($a*$d -$c*$b == 0){ +$a=random(-5,5,1); +if($a==0) +{ + # if $a==0 then we don't want any of the other variables + # to be 0 + $b=non_zero_random(-5,5,1); +} +else +{ + # otherwise $b can be anything + $b=random(-5,5,1); +} +if($a*$b==0) +{ + # if one of $a or $b is 0, then we don't want $c to be 0 + $c=non_zero_random(-5,5,1); +} +else +{ + # otherwise $c can be zero + $c=random(-5,5,1); +} +if($a*$b*$c==0) +{ + # if one of $a, $b, or $c is 0, then we don't want $d to be 0 + $d=non_zero_random(-5,5,1); +} +else +{ + # otherwise it must be 0 for this particular problem + $d=0 +} +} + +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); + +$topLeft = Formula("$a*x+$b*y")->reduce; +$e = $topLeft->eval(x=>$x,y=>$y); + +$botLeft = Formula("$c*x+$d*y")->reduce; +$f = $botLeft->eval(x=>$x,y=>$y); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "infinite number of solutions"=>{}, + "infinite"=>{alias=>'infinite number of solutions'}, + "infinite solutions"=>{alias=>'infinite number of solutions'}); + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{\begin{aligned} + [$topLeft] & = [$e] \\ + [$botLeft] & = [$f] +\end{aligned}\right.```] + +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** + +[_________________________________]{Compute("($x,$y)")} + +END_PGML + +$commonConclusion = "The solution to the system is [`($x,$y)`]. It is left as an exercise to check. Please also note that you may have solved this problem a different way."; + +# solution key +if($a==0) +{ + # by = e + # ax + dy = f + # should be solved by using y from the first equation + $lhs=Formula("$c*x+$d*$y")->reduce; + # the first step depends on if |$b|=1 + if(abs($b)!=1) + { + $firststep="Let's solve the first equation for [`y`]; we divide both sides of the equation by [`$b`], so [`y=$y`]."; + } + else + { + $firststep="Clearly the first equation tells us that [`y=$y`]"; + } +BEGIN_PGML_SOLUTION +* [$firststep]** +* We find [`x`] by substituting this value of [`y`] in to the second equation: [`[$lhs]=[$f]`], and solving for [`x`]. +* This gives [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==0) +{ + # ax = e + # ax + dy = f + # should be solved by using x from the first equation + $lhs=Formula("$c*$x+$d*y")->reduce; + + # the first step depends on if |$a|=1 + if(abs($a)!=1) + { + $firststep="Let's solve the first equation for [`x`]; we divide both sides of the equation by [`$a`], so [`x=$x`]."; + } + else + { + $firststep="Clearly the first equation tells us that [`x=$x`]."; + } +BEGIN_PGML_SOLUTION +* [$firststep]** +* We find [`y`] by substituting this value of [`x`] in to the second equation: [`[$lhs]=[$f]`], and solving for [`y`]. +* This gives [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==0) +{ + # ax + by = e + # dy = f + # should be solved by using y from the second equation + $lhs=Formula("$a*x+$b*$y")->reduce; + # the first step depends on if |$d|=1 + if(abs($d)!=1) + { + $firststep="Let's solve the second equation for [`y`]; we divide both sides of the equation by [`$d`], so [`y=$y`]."; + } + else + { + $firststep="Clearly the second equation tells us that [`y=$y`]."; + } +BEGIN_PGML_SOLUTION +* [$firststep]** +* We find [`x`] by substituting this value of [`y`] in to the first equation: [`[$lhs]=[$e]`], and solving for [`x`]. +* This gives [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==0) +{ + # ax + by = e + # cx = f + # should be solved by using x from the second equation + $lhs=Formula("$a*$x+$b*y")->reduce; + + # the first step depends on if |$c|=1 + if(abs($c)!=1) + { + $firststep="Let's solve the second equation for [`x`]; we divide both sides of the equation by [`$c`], so [`x=$x`]."; + } + else + { + $firststep="Clearly the second equation tells us that [`x=$x`]."; + } +BEGIN_PGML_SOLUTION +* [$firststep]** +* We find [`y`] by substituting this value of [`x`] in to the first equation: [`[$lhs]=[$e]`], and solving for [`y`]. +* This gives [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} + +TEXT(PGML::Format2(<<'END_PGML_HINT')); +*Hint* +* The solution is an ordered pair, so you'll write it in the form [`(x,y)`] +* Both [`x`] and [`y`] are integers between [`-10`] and [`10`] +END_PGML_HINT + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations05.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations05.pg new file mode 100644 index 0000000000..aea45e7fbd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations05.pg @@ -0,0 +1,166 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -exactly one of the four coefficients is 0 +# -its partner coefficient is +- 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1), $b = Fraction(1,1)}; +if ($zero == 1) {$b = Fraction(0,1), $a = Fraction(1,1)}; +if ($zero == 2) {$c = Fraction(0,1), $d = Fraction(1,1)}; +if ($zero == 3) {$d = Fraction(0,1), $c = Fraction(1,1)}; + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations10.pg new file mode 100644 index 0000000000..b252d785e1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations10.pg @@ -0,0 +1,165 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -exactly one of the four coefficients is 0 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1)}; +if ($zero == 1) {$b = Fraction(0,1)}; +if ($zero == 2) {$c = Fraction(0,1)}; +if ($zero == 3) {$d = Fraction(0,1)}; + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations11.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations11.pg new file mode 100644 index 0000000000..1eacc18a6d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations11.pg @@ -0,0 +1,159 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like y=-2x+8, y=7x-10 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,-1,1), random(1,1,1)); +$d = Fraction(non_zero_random(1,1,1), random(1,1,1)); + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(1,1,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations12.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations12.pg new file mode 100644 index 0000000000..50e09941a8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations12.pg @@ -0,0 +1,159 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like y=2x+1, 2x+3y=# +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(1,5,1), random(1,1,1)); + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations13.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations13.pg new file mode 100644 index 0000000000..78c6e5dd4a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations13.pg @@ -0,0 +1,159 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like y=-2x-1, 2x-3y=# +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,-1,1), random(1,1,1)); + +$det = $a*$d-$b*$c; + +$e = $det*non_zero_random(-3,3,1); +$f = $det*non_zero_random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations14.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations14.pg new file mode 100644 index 0000000000..45f2d695c4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations14.pg @@ -0,0 +1,159 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like x=2y-3, 2x+5y=# +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +$det = $a*$d-$b*$c; + +$e = $det*non_zero_random(-3,3,1); +$f = $det*non_zero_random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,0,1), random(1,1,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations15.pg new file mode 100644 index 0000000000..38e6f572eb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations15.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -one of the coefficients is 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(-1,1)} else {$a = Fraction(1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(-1,1)} else {$b = Fraction(1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(-1,1)} else {$c = Fraction(1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(-1,1)} else {$d = Fraction(1,1)}}; + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations16.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations16.pg new file mode 100644 index 0000000000..927a7bb786 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations16.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -no solutions +# like y=(2/3)x+a, y=(2/3)x+b (no solution) +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = $a; +$d = Fraction(non_zero_random(1,1,1), random(1,1,1)); + +$det = $a*$d-$b*$c; + +$e = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +do {$f = Fraction(non_zero_random(-5,5,1), random(1,5,1));} until ($f != $e); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(1,1,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +#SystemOfLinearEquationsProblemSolutionSetup(); +$Attack = "Since these two lines have the same slope, but different [`y`]-intercepts, they are parallel lines. They never intersect and therefore the system has no solution."; + + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations17.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations17.pg new file mode 100644 index 0000000000..70ebe5b9c6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations17.pg @@ -0,0 +1,163 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# integer coefficients +# fraction solutions +# both equations in standard form +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +$x = 'x'; +$y = 'y'; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +$det = $a*$d-$b*$c; + +$e = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +do {$f = Fraction(non_zero_random(-5,5,1), random(1,1,1));} until ($f != $e); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,0,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations18.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations18.pg new file mode 100644 index 0000000000..819684dc48 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations18.pg @@ -0,0 +1,158 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -no solutions +# like y=(2/3)x+a, y=(2/3)x+b (no solution) +# +# Last updated: Yao 11/26/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); + +do {$a = non_zero_random(-5,5,1);} until ($a!=1); +$b = 1; +do {$m = non_zero_random(-5,5,1);} until (abs($m)!=1); +$c = $m*$a; +$d = $m; +$e = non_zero_random(-5,5,1); +$f = $e*$m; +$det = $a*$d-$b*$c; + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (1,0,1); +($xside2,$yside2,$cside2) = (0,0,1); + +SystemOfLinearEquationsProblemSetup(); + +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); +$right1 = Compute("-$a*$x-$e")->reduce; +$left2 = Compute("$c*$x+$m*$y"); +$s1 = Compute("$c*$x+$m*($right1)"); +$ma = $m*$a; +$me = $m*$e; +$s2 = Compute("-$c*$x+$ma*$x-$me")->reduce; + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + + [`\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + `] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + + $ans = Compute("infinitely many solutions"); + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + +#################################################### + +BEGIN_PGML_SOLUTION + +Since [`[$y]`] is alone in the first equation, we will use substitution to solve this system. + +Substitute [`[$left1]=[$right1]`] into [`[$left2]=[$right2]`], we have: + + [`` +\begin{aligned} + [$left2]&=[$right2] \\ + [$s1]&=[$right2] \\ + [$s2]&=[$right2] \\ + [$right2]&=[$right2] +\end{aligned} + ``] + +Since [`[$right2]=[$right2]`] is true for any value of [`[$x]`], this system has infinitely many solutions . + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations20.pg new file mode 100644 index 0000000000..838187525d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations20.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -one of the coefficients is -1, none of the others are 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(1,1)} else {$a = Fraction(-1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(1,1)} else {$b = Fraction(-1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(1,1)} else {$c = Fraction(-1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(1,1)} else {$d = Fraction(-1,1)}}; + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations25.pg new file mode 100644 index 0000000000..3e51929a96 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations25.pg @@ -0,0 +1,168 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -solutions can be fractions +# -one coefficient is 0 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1)}; +if ($zero == 1) {$b = Fraction(0,1)}; +if ($zero == 2) {$c = Fraction(0,1)}; +if ($zero == 3) {$d = Fraction(0,1)}; + +$e = Fraction(random(-5,5,1), random(1,1,1)); +$f = Fraction(random(-5,5,1), random(1,1,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations30.pg new file mode 100644 index 0000000000..def2373d22 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations30.pg @@ -0,0 +1,169 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -solutions can be fractions +# -no coefficient is 0 +# -one coefficient is 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(-1,1)} else {$a = Fraction(1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(-1,1)} else {$b = Fraction(1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(-1,1)} else {$c = Fraction(1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(-1,1)} else {$d = Fraction(1,1)}}; + +$e = Fraction(random(-5,5,1), random(1,1,1)); +$f = Fraction(random(-5,5,1), random(1,1,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations35.pg new file mode 100644 index 0000000000..5b1eaacc5d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations35.pg @@ -0,0 +1,169 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -solutions can be fractions +# -no coefficient is 0 +# -one coefficient is -1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(1,1)} else {$a = Fraction(-1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(1,1)} else {$b = Fraction(-1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(1,1)} else {$c = Fraction(-1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(1,1)} else {$d = Fraction(-1,1)}}; + +$e = Fraction(random(-5,5,1), random(1,1,1)); +$f = Fraction(random(-5,5,1), random(1,1,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations40.pg new file mode 100644 index 0000000000..9e6dfdef1d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations40.pg @@ -0,0 +1,164 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -fraction coefficients +# -exactly one of the four coefficients is 0 +# -its partner coefficient is +- 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,5,1)); + +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1), $b = Fraction(1,1)}; +if ($zero == 1) {$b = Fraction(0,1), $a = Fraction(1,1)}; +if ($zero == 2) {$c = Fraction(0,1), $d = Fraction(1,1)}; +if ($zero == 3) {$d = Fraction(0,1), $c = Fraction(1,1)}; + +$e = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$f = Fraction(non_zero_random(-5,5,1), random(1,5,1)); + +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations45.pg new file mode 100644 index 0000000000..2547cd255c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations45.pg @@ -0,0 +1,162 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -fraction coefficients +# -exactly one of the four coefficients is 0 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,5,1)); + +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1)}; +if ($zero == 1) {$b = Fraction(0,1)}; +if ($zero == 2) {$c = Fraction(0,1)}; +if ($zero == 3) {$d = Fraction(0,1)}; + +$e = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$f = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations50.pg new file mode 100644 index 0000000000..6f4cb79cd6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations50.pg @@ -0,0 +1,167 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -fraction coefficients +# -one of the coefficients is 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,5,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(-1,1)} else {$a = Fraction(1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(-1,1)} else {$b = Fraction(1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(-1,1)} else {$c = Fraction(1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(-1,1)} else {$d = Fraction(1,1)}}; + +$e = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$f = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations55.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations55.pg new file mode 100644 index 0000000000..6ad348eaec --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations55.pg @@ -0,0 +1,167 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -fraction coefficients +# -one of the coefficients is -1, although randomly another might be 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,5,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,5,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,5,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,5,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(1,1)} else {$a = Fraction(-1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(1,1)} else {$b = Fraction(-1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(1,1)} else {$c = Fraction(-1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(1,1)} else {$d = Fraction(-1,1)}}; + +$e = Fraction(random(-5,5,1), random(1,5,1)); +$f = Fraction(random(-5,5,1), random(1,5,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations60.pg new file mode 100644 index 0000000000..6b44e793ea --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations60.pg @@ -0,0 +1,174 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -the determinant is 0, and there is a 50/50 chance that there are no solutions +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +$d = $b*$c/$a; +($c, $d) = ($c*($d->value)[1], $d*($d->value)[1]); + +if (random(0,1,1)) { +do{ +$e = Fraction(random(-5,5,1), random(1,1,1)); +$f = Fraction(random(-5,5,1), random(1,1,1)); +} until ($e/$a != $f/$b); +} else { +$s = random(-5,5,1); +$t = random(-5,5,1); +$e = $s*$a+$t*$b; +$f = $s*$c+$t*$d; +}; + +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + + [```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub05.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub05.pg new file mode 100644 index 0000000000..f8e20b9865 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub05.pg @@ -0,0 +1,167 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -exactly one of the four coefficients is 0 +# -its partner coefficient is +- 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +# One of the equations is simply variable = number +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1), $b = Fraction(1,1)}; +if ($zero == 1) {$b = Fraction(0,1), $a = Fraction(1,1)}; +if ($zero == 2) {$c = Fraction(0,1), $d = Fraction(1,1)}; +if ($zero == 3) {$d = Fraction(0,1), $c = Fraction(1,1)}; + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub10.pg new file mode 100644 index 0000000000..8bd6904570 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub10.pg @@ -0,0 +1,166 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -exactly one of the four coefficients is 0 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +# One of the equations is simply const*var = const +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1)}; +if ($zero == 1) {$b = Fraction(0,1)}; +if ($zero == 2) {$c = Fraction(0,1)}; +if ($zero == 3) {$d = Fraction(0,1)}; + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub11.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub11.pg new file mode 100644 index 0000000000..114cfc6001 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub11.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like y=-2x+8, y=7x-10 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,-1,1), random(1,1,1)); +$d = Fraction(non_zero_random(1,1,1), random(1,1,1)); +# Above means some coefficients are 1, and solution will use substitution method + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(1,1,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub12.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub12.pg new file mode 100644 index 0000000000..fe5347832b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub12.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like y=2x+1, 2x+3y=# +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(1,5,1), random(1,1,1)); +# Above means one coefficient will be 1, and substitution method will be used + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub13.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub13.pg new file mode 100644 index 0000000000..42f5b406ac --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub13.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like y=-2x-1, 2x-3y=# +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = Fraction(non_zero_random(1,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,-1,1), random(1,1,1)); +# Above means one coefficient will be 1, and substitution method will be used + +$det = $a*$d-$b*$c; + +$e = $det*non_zero_random(-3,3,1); +$f = $det*non_zero_random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub14.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub14.pg new file mode 100644 index 0000000000..edf5fe8336 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub14.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# like x=2y-3, 2x+5y=# +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +# Above means one coefficient will be 1, and substitution method will be used + +$det = $a*$d-$b*$c; + +$e = $det*non_zero_random(-3,3,1); +$f = $det*non_zero_random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,0,1), random(1,1,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub15.pg new file mode 100644 index 0000000000..6721ed3485 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub15.pg @@ -0,0 +1,171 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -one of the coefficients is 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(-1,1)} else {$a = Fraction(1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(-1,1)} else {$b = Fraction(1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(-1,1)} else {$c = Fraction(1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(-1,1)} else {$d = Fraction(1,1)}}; +# Above means one coefficient will be 1, and substitution method will be used + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub16.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub16.pg new file mode 100644 index 0000000000..b57f12d827 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub16.pg @@ -0,0 +1,161 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -no solutions +# like y=(2/3)x+a, y=(2/3)x+b (no solution) +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$b = Fraction(non_zero_random(1,1,1), random(1,1,1)); +$c = $a; +$d = Fraction(non_zero_random(1,1,1), random(1,1,1)); +# Above means the equations have the same slope, so solution is a quick recognition + +$det = $a*$d-$b*$c; + +$e = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +do {$f = Fraction(non_zero_random(-5,5,1), random(1,5,1));} until ($f != $e); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(1,1,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(1,1,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +#SystemOfLinearEquationsProblemSolutionSetup(); +$Attack = "Since these two lines have the same slope, but different [`y`]-intercepts, they are parallel lines. They never intersect and therefore the system has no solution."; + + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub17.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub17.pg new file mode 100644 index 0000000000..70ebe5b9c6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub17.pg @@ -0,0 +1,163 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# integer coefficients +# fraction solutions +# both equations in standard form +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +$x = 'x'; +$y = 'y'; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,1,1)); + +$det = $a*$d-$b*$c; + +$e = Fraction(non_zero_random(-5,5,1), random(1,1,1)); +do {$f = Fraction(non_zero_random(-5,5,1), random(1,1,1));} until ($f != $e); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,0,1), random(0,0,1), random(1,1,1)); +($xside2,$yside2,$cside2) = (random(0,0,1), random(0,0,1), random(1,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub20.pg new file mode 100644 index 0000000000..8d76b6c2ae --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub20.pg @@ -0,0 +1,171 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -integer solutions +# -one of the coefficients is -1, none of the others are 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(1,1)} else {$a = Fraction(-1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(1,1)} else {$b = Fraction(-1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(1,1)} else {$c = Fraction(-1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(1,1)} else {$d = Fraction(-1,1)}}; +# Above means one coefficient will be 1, and substitution method will be used + +$det = $a*$d-$b*$c; + +$e = $det*random(-3,3,1); +$f = $det*random(-3,3,1); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub25.pg new file mode 100644 index 0000000000..ec1e313773 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub25.pg @@ -0,0 +1,169 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -solutions can be fractions +# -one coefficient is 0 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1)}; +if ($zero == 1) {$b = Fraction(0,1)}; +if ($zero == 2) {$c = Fraction(0,1)}; +if ($zero == 3) {$d = Fraction(0,1)}; +# Above means one coefficient will be 0, so one variable is quickly solved for + +$e = Fraction(random(-5,5,1), random(1,1,1)); +$f = Fraction(random(-5,5,1), random(1,1,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub30.pg new file mode 100644 index 0000000000..1ad0f44d92 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub30.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -solutions can be fractions +# -no coefficient is 0 +# -one coefficient is 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(-1,1)} else {$a = Fraction(1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(-1,1)} else {$b = Fraction(1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(-1,1)} else {$c = Fraction(1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(-1,1)} else {$d = Fraction(1,1)}}; +# Above means one coefficient will be 1, and substitution method will be used + +$e = Fraction(random(-5,5,1), random(1,1,1)); +$f = Fraction(random(-5,5,1), random(1,1,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub35.pg new file mode 100644 index 0000000000..9b5d76b991 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub35.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -integer coefficients +# -solutions can be fractions +# -no coefficient is 0 +# -one coefficient is -1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$b = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$c = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); +$d = Fraction(random(2,5,1)*random(-1,1,2), random(1,1,1)); + +$one = random(0,3,1); +if ($one == 0) {if ($xside1) {$a = Fraction(1,1)} else {$a = Fraction(-1,1)}}; +if ($one == 1) {if ($yside1) {$b = Fraction(1,1)} else {$b = Fraction(-1,1)}}; +if ($one == 2) {if ($xside2) {$c = Fraction(1,1)} else {$c = Fraction(-1,1)}}; +if ($one == 3) {if ($yside2) {$d = Fraction(1,1)} else {$d = Fraction(-1,1)}}; +# Above means one coefficient will be 1, and substitution method will be used + +$e = Fraction(random(-5,5,1), random(1,1,1)); +$f = Fraction(random(-5,5,1), random(1,1,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + + + + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub40.pg new file mode 100644 index 0000000000..60daad767e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub40.pg @@ -0,0 +1,165 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -fraction coefficients +# -exactly one of the four coefficients is 0 +# -its partner coefficient is +- 1 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,5,1)); + +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1), $b = Fraction(1,1)}; +if ($zero == 1) {$b = Fraction(0,1), $a = Fraction(1,1)}; +if ($zero == 2) {$c = Fraction(0,1), $d = Fraction(1,1)}; +if ($zero == 3) {$d = Fraction(0,1), $c = Fraction(1,1)}; +# Above means one coefficient will be 0, and one variable can be solved for immediately + +$e = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$f = Fraction(non_zero_random(-5,5,1), random(1,5,1)); + +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub45.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub45.pg new file mode 100644 index 0000000000..b0a2a98670 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquationsSub45.pg @@ -0,0 +1,163 @@ +# WeBWorK problem written by Alex Jordan, 2013 +# Portland Community College +# +# Solve a system with +# -fraction coefficients +# -exactly one of the four coefficients is 0 +# +# Last updated: Jordan 9/9/13; +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','integer') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SystemsOfLinearEquationsProblemPCC.pl", + "PGcourse.pl", +); + +############################################## + + + +# What will the variables be? +if (list_random(0,1)) + {$x = "x"; $y = "y";} + else { + do {$x = RandomVariableName(); $y = RandomVariableName()} + until ($x ne $y + and ($x ne "y" and $y ne "x")); + # it would be bad to swap x and y for point answers. + }; + +#What will the coefficients be? +#Some helpful linear algebra: +#Integer solutions <== det[[a,b],[c,d]] divides both e and f +#Unique solution <==> det[[a,b],[c,d]] != 0 +#No solutions <==> det[[a,b],[c,d]] == 0 and c*e != a*f +Context("Fraction"); +Parser::Number::NoDecimals; +Context()->noreduce('(-x)-y','-(x)+y'); +do { +$a = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$b = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$c = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$d = Fraction(non_zero_random(-5,5,1), random(1,5,1)); + +$zero = random(0,3,1); +if ($zero == 0) {$a = Fraction(0,1)}; +if ($zero == 1) {$b = Fraction(0,1)}; +if ($zero == 2) {$c = Fraction(0,1)}; +if ($zero == 3) {$d = Fraction(0,1)}; +# Above means one coefficient will be 0, and a variable can be solved for immediately + +$e = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +$f = Fraction(non_zero_random(-5,5,1), random(1,5,1)); +} +until (!($a == Fraction(0,1) and $b == Fraction(0,1)) and !($c == Fraction(0,1) and $d == Fraction(0,1))); + + + + +#0 means that term is on the left; 1 on the right. +($xside1,$yside1,$cside1) = (random(0,1,1), random(0,1,1), random(0,1,1)); +($xside2,$yside2,$cside2) = (random(0,1,1), random(0,1,1), random(0,1,1)); + + +SystemOfLinearEquationsProblemSetup(); + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{ + \begin{aligned} + [$left1] & = [$right1]\\ + [$left2] & = [$right2] + \end{aligned} + \right. + ```] + +[$EnterAnswers]** + + [_____________________________] + +END_PGML +############################################## + +SystemOfLinearEquationsProblemSolutionSetup(); + +BEGIN_PGML_SOLUTION + +[$Attack]** + +END_PGML_SOLUTION + + +Context("LinearSystems"); +parser::Assignment->Allow; +Context()->variables->are($x=>'Real', $y=>'Real', constant=>'Real'); + +if ($determinant != Fraction(0,1)) { + $ans = Compute("$x = $xsol, $y = $ysol"); + $pointAns = Compute("($xsol,$ysol)"); + } + elsif ($c*$e != $a*$f) { + $ans = Compute("no solutions"); + } + else { + $ans = Compute("infinitely many solutions"); + }; + + + + +#If there is a unique solution +if ($determinant != Fraction(0,1)) { +ANS($ans->cmp( + entry_type => "a solution", + checker => ~~&solutionChecker, + extra => ~~&extraChecker +) +->withPostFilter(AnswerHints( + ["$x=$xsol","$y=$ysol"] => "A solution would give values for both $x and $y", + ["$xsol,$ysol","$ysol,$xsol"] => ["These are the right values, but you should write $x = $US$US$US and $y= $US$US$US",replaceMessage=>1], +)) + +->withPostFilter( ~~&postFilterForPoints +) +); +} + + +#otherwise +else { +ANS($ans->cmp(typeMatch=>Compute("$x=0,$y=0"))); +}; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations70.pg index 0721346d0f..a15c860c54 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations70.pg @@ -12,15 +12,18 @@ # Last updated: Hughes 7/30/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-REI.3','A-REI.5') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') ## KEYWORDS('linear','equation','solve','system','fraction') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,8 @@ loadMacros( "PGML.pl", "answerHints.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -84,9 +88,9 @@ $d=1; # set up $a, $b, $c, $d while($a*$d -$c*$b == 0){ $a=random(1,5,1)*random(-1,1,2); -$b=random(1,5,1)*random(-1,1,2);; -$c=random(1,5,1)*random(-1,1,2);; -$d=random(1,5,1)*random(-1,1,2);; +$b=random(1,5,1)*random(-1,1,2); +$c=random(1,5,1)*random(-1,1,2); +$d=random(1,5,1)*random(-1,1,2); } $topLeft = Formula("$a*x+$b*y")->reduce; @@ -99,16 +103,14 @@ $f = $botLeft->eval(x=>$x,y=>$y)->reduce; ############################################## TEXT(beginproblem()); BEGIN_PGML -Solve the following system of equations, using whichever method you wish. +Solve the following system of equations. - [`\left\{\begin{aligned} +[```\left\{\begin{aligned} [$topLeft] & = [$e] \\ [$botLeft] & = [$f] -\end{aligned}\right.`] +\end{aligned}\right.```] -* If there is one solution, enter it as an ordered pair. -* If there is no solution, enter *no solution*. Spelling counts. -* If there is an infinite number of solutions, enter *infinite number of solutions*. Spelling counts. +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** [_________________________________] @@ -125,7 +127,7 @@ ANS($ans->cmp( foreach $x ($student->value) { if (Value::classMatch($x,'Fraction') && !$x->isReduced) { $reduced = 0; - last; + break; } } $student->{notReduced} = 1 unless $reduced || $ans->{isPreview}; diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations80.pg index cd805e186c..95d1149be6 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquations80.pg @@ -12,15 +12,18 @@ # Last updated: Hughes 7/30/13 # ENDDESCRIPTION -## DBCCSS('8.EE.8','A-REI.3','A-REI.5') -## DBsubject(Linear algebra) -## DBchapter(Systems of linear equations) -## DBsection(Systems with 2 variables) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') ## KEYWORDS('linear','equation','solve','system','fraction') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -32,7 +35,8 @@ loadMacros( "PGML.pl", "answerHints.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -99,16 +103,14 @@ $f = $botLeft->eval(x=>$x,y=>$y)->reduce; ############################################## TEXT(beginproblem()); BEGIN_PGML -Solve the following system of equations, using whichever method you wish. +Solve the following system of equations. - [`\left\{\begin{aligned} +[```\left\{\begin{aligned} [$topLeft] & = [$e] \\ [$botLeft] & = [$f] -\end{aligned}\right.`] +\end{aligned}\right.```] -* If there is one solution, enter it as an ordered pair. -* If there is no solution, enter *no solution*. Spelling counts. -* If there is an infinite number of solutions, enter *infinite number of solutions*. Spelling counts. +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** [_________________________________] diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub70.pg new file mode 100644 index 0000000000..0749e94b7d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub70.pg @@ -0,0 +1,399 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Solve the system of linear equations +# a x + b y = e +# c x + d y = f +# where a, b, c, d are integer values on the interval [1,5] +# +# The solution is (x,y) where x and y are both fractions with numerators +# and denominators on the interval [-10,10]. +# +# Last updated: Hughes 7/30/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','fraction') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction-NoDecimals"); + Context()->{precedence}{Fraction} = 2.5; + Context()->parens->set('(' => {type => "Point"} ); + Context()->flags->set(reduceFractions=>0,allowMixedNumbers=>1,requirePureFractions=>1); +Context()->{error}{msg}{"Mixed numbers are not allowed; you must use a pure fraction"} + = "Mixed numbers are not allowed; you must use a pure fraction, for example you should enter 5/4 and not 1 1/4"; + +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->are(x=>'Real',y=>'Real'); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "infinite number of solutions"=>{}, + "infinite"=>{alias=>'infinite number of solutions'}, + "infinite solutions"=>{alias=>'infinite number of solutions'}); + +# the solution +$xnumerator = random(2,10,2); # even number +$xdenominator = random(3,11,2); # odd number +$ynumerator = random(3,11,2); # odd number +$ydenominator = random(2,10,2); # even number + +$x = Fraction($xnumerator,$xdenominator)->reduce; +$y = Fraction($ynumerator,$ydenominator)->reduce; +$ans = List("($x,$y)"); + +# set up the system +# a x + b y =e +# c x + d y = f +# need to make sure that +# ad - bc != 0 + +# initialize the variables +$a=1; +$b=1; +$c=1; +$d=1; + +# set up $a, $b, $c, $d +while($a*$d -$c*$b == 0){ +$a=random(2,5,1)*random(-1,1,2); +$b=random(2,5,1)*random(-1,1,2);; +$c=random(2,5,1)*random(-1,1,2);; +$d=random(2,5,1)*random(-1,1,2);; +#make sure one of them is 1 +if (list_random(1,0,0,0)) {$a = 1;} +elsif (list_random(1,0,0)) {$b = 1;} +elsif (list_random(1,0)) {$c = 1} +else {$d = 1}; +} + +$topLeft = Formula("$a*x+$b*y")->reduce; +$e = $topLeft->eval(x=>$x,y=>$y)->reduce; + +$botLeft = Formula("$c*x+$d*y")->reduce; +$f = $botLeft->eval(x=>$x,y=>$y)->reduce; + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{\begin{aligned} + [$topLeft] & = [$e] \\ + [$botLeft] & = [$f] +\end{aligned}\right.```] + +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** + +[_________________________________] + +END_PGML + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp( + checker => sub { + my ($correct, $student, $ans, $nth, $value) = @_; + $student->context->setError("Your $nth $value contains an unreduced fraction","",undef,undef,$Value::CMP_WARNING) + if $student->{notReduced}; + return 0 unless $correct == $student; + my $reduced = 1; + foreach $x ($student->value) { + if (Value::classMatch($x,'Fraction') && !$x->isReduced) { + $reduced = 0; + break; + } + } + $student->{notReduced} = 1 unless $reduced || $ans->{isPreview}; + return $reduced; + } + )->withPostFilter(AnswerHints( + ["infinity"] => ["Infinity doesn't make sense here- do you mean infinite number of solutions?",replaceMessage=>1], +))); + +$commonConclusion = "The solution to the system is [`$ans`]. It is left as an exercise to check. Please also note that you may have solved this problem a different way."; + +if($a==-$c) +{ + # ax + by = e + # -ax + dy = f + # should be solved by addition + $lhs=Formula("$b*y+$d*y")->reduce; + $lhs1=Formula("$a*x+$b*$y")->reduce; +BEGIN_PGML_SOLUTION +* Let's add the two equations, which will cancel the terms involving [`x`] and give [`[$lhs]=[$e]+[$f]`]. +* This gives [`y=[$y]`]. +* We find [`x`] using either equation - let's use the first one: [`[$lhs1]=[$e]`], so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==-$d) +{ + # ax + by = e + # cx + -by = f + # should be solved by addition + $lhs=Formula("$a*x+$c*x")->reduce; + $lhs1=Formula("$a*($x)+($b)*(y)")->reduce; +BEGIN_PGML_SOLUTION +* Let's add the two equations, which will cancel the terms involving [`y`] and give [`[$lhs]=[$e]+([$f])`]. +* This gives [`x=[$x]`]. +* We find [`y`] using either equation - let's use the first one: [`[$lhs1]=[$e]`], so [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($a==1 and $a!=$c and $b!=$d) +{ + # x + by = e should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$e-$b*y")->reduce; + $lhs=Formula("$c*$e-$c*$b*y+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. +* This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using the _first_ equation: + + [`\begin{aligned} + x&=[$e]-([$b])\cdot([$y])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==1 and $b!=$d and $a!=$c) +{ + # ax + y = e should be solved for y + # provided that $b and $d are not equal- in this case we should use subtraction. + $lhs=Formula("$c*x+$d*$e-$d*$a*x")->reduce; + $rhs=Formula("$e-$a*x")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$f]`] so [`x=[$x]`] +* Now that we have [`x`], we find [`y`] using the first equation: + + [` + \begin{aligned} + y&=[$e]-([$a])\cdot([$x])\\ + &=[$y] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==1 and $a!=$c and $b!=$d) +{ + # x + dy = f should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$f-$d*y")->reduce; + $lhs=Formula("$a*$f-$a*$d*y+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. +* This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using the _second_ equation: + + [` + \begin{aligned} + x&=[$f]-([$d])\cdot([$y])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==1 and $d!=$b and $a!=$c) +{ + # cx + y = f should be solved for y + $rhs=Formula("$f-$c*x")->reduce; + $lhs=Formula("$a*x+$b*$f-$b*$c*x")->reduce; + +BEGIN_PGML_SOLUTION +* From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. +* Now that we have [`x`], we find [`y`] using the _second_ equation: + + [` + \begin{aligned} + y&=[$f]-([$c])\cdot([$x])\\ + &=[$y] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($a==-1 and $a != $c and $b!=$d) +{ + # - x + by = e should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$b*y-$e")->reduce; + $lhs=Formula("$c*$b*y-$c*$e+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. +* This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. +* We find [`x`] using the _first_ equation: + + [`\begin{aligned} + x&=([$b])\cdot([$y])-([$e])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==-1 and $b!=$d and $a!=$c) +{ + # ax - y = e should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$a*x-$e")->reduce; + $lhs=Formula("$c*x+$d*$a*x-$d*$e")->reduce; +BEGIN_PGML_SOLUTION +* From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$f]`] so [`x=[$x]`]. +* We find [`y`] using the first equation: + + [`\begin{aligned} + y&=([$a])\cdot([$x])-([$e]) \\ + &=[$y]\end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==-1 and $a!=$c and $b!=$d) +{ + # - x + dy = f should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$d*y-$f")->reduce; + $lhs=Formula("$a*$d*y-$a*$f+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. +* This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. +* We find [`x`] using the _second_ equation: + + [`\begin{aligned} + x&=([$d])\cdot([$y])-([$f])\\ + &=[$x] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==-1 and $b!=$d and $a!=$c) +{ + # cx - y = f should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$c*x-$f")->reduce; + $lhs=Formula("$a*x+$b*$c*x-$b*$f")->reduce; + +BEGIN_PGML_SOLUTION +* From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. +* We find [`y`] using the _second_ equation: + + [`\begin{aligned} + y&=([$c])\cdot([$x])-([$f])\\ + &=[$y] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +else +{ + if($a==$c) + { + # ax + by = e + # ax + dy = f + # should be solved using subtraction + $lhs=Formula("$b*y-$d*y")->reduce; + $lhs1=Formula("$a*x+$b*($y)")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms in involving [`x`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + elsif($b==$d) + { + # ax + by = e + # cx + by = f + # should be solved using subtraction + $lhs=Formula("$a*x-$c*x")->reduce; + $lhs1=Formula("$a*($x)+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms in involving [`y`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`x=[$x]`]. +* Now that we have [`x`], we find [`y`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + else + { + # otherwise use elimination + + # multiply the first equation by $c + $topleft=Formula("$c*$a*x+$c*$b*y")->reduce; + $topright=$c*$e; + + # multiply the second equation by $a + $bottomleft=Formula("$a*$c*x+$a*$d*y")->reduce; + $bottomright=$a*$f; + + $lhs=Formula("$c*$b*y-$a*$d*y")->reduce; + $rhs=$c*$e-$a*$f; + + # put them together +BEGIN_PGML_SOLUTION +* Let's multiply the _first_ equation by [$c] and the _second_ equation by [$a] + + [`\begin{aligned} + [$topleft] &= [$topright]\\ + [$bottomleft] &=[$bottomright] + \end{aligned}`] +* Subtracting these two equations gives [`[$lhs]=[$rhs]`], so [`y=[$y]`]. + +* Now that we have [`y`], we can use either equation to find [`x`]; let's use the first one: + + [`[$a]*x+([$b])\cdot([$y])=[$e]`] + + so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } +} + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub80.pg new file mode 100644 index 0000000000..95d1149be6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/SystemsOfLinearEquations/systemsOfEquationsSub80.pg @@ -0,0 +1,394 @@ +# WeBWorK problem written by Chris Hughes, 2013 +# Portland Community College +# +# Solve the system of linear equations +# a x + b y = e +# c x + d y = f +# where a, b, c, d are fractions. +# +# The solution is (x,y) where x and y are both fractions with numerators +# and denominators on the interval [-10,10]. +# +# Last updated: Hughes 7/30/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Lines', 'Equations') +## KEYWORDS('linear','equation','solve','system','fraction') +## DBCCSS('8.EE.8','A-REI.3','A-REI.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction-NoDecimals"); + Context()->{precedence}{Fraction} = 2.5; + Context()->parens->set('(' => {type => "Point"} ); + Context()->flags->set(reduceFractions=>0,allowMixedNumbers=>1,requirePureFractions=>1); +Context()->{error}{msg}{"Mixed numbers are not allowed; you must use a pure fraction"} + = "Mixed numbers are not allowed; you must use a pure fraction, for example you should enter 5/4 and not 1 1/4"; + +# globally set the reductions one time +# so that we can then merely call ->reduce; +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->are(x=>'Real',y=>'Real'); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no solution"=>{}, + "no solutions"=>{alias=>'no solution'}, + "none"=>{alias=>'no solution'}, + "infinite number of solutions"=>{}, + "infinite"=>{alias=>'infinite number of solutions'}, + "infinite solutions"=>{alias=>'infinite number of solutions'}); + +# the solution +$xnumerator = random(2,10,2); # even number +$xdenominator = random(3,11,2); # odd number +$ynumerator = random(3,11,2); # odd number +$ydenominator = random(2,10,2); # even number + +$x = Fraction($xnumerator,$xdenominator)->reduce; +$y = Fraction($ynumerator,$ydenominator)->reduce; +$ans = List("($x,$y)"); + +# set up the system +# a x + b y =e +# c x + d y = f +# need to make sure that +# ad - bc != 0 + +# initialize the variables +$a=1; +$b=1; +$c=1; +$d=1; + +# set up $a, $b, $c, $d +while(1/$a*1/$d -1/$c*1/$b == 0){ +$a=Fraction(1,random(2,5,1)*random(-1,1,2)); +$b=Fraction(1,random(2,5,1)*random(-1,1,2)); +$c=Fraction(1,random(2,5,1)*random(-1,1,2)); +$d=Fraction(1,random(2,5,1)*random(-1,1,2)); +} + +$topLeft = Formula("$a*x+$b*y")->reduce; +$e = $topLeft->eval(x=>$x,y=>$y)->reduce; + +$botLeft = Formula("$c*x+$d*y")->reduce; +$f = $botLeft->eval(x=>$x,y=>$y)->reduce; + + +############################################## +TEXT(beginproblem()); +BEGIN_PGML +Solve the following system of equations. + +[```\left\{\begin{aligned} + [$topLeft] & = [$e] \\ + [$botLeft] & = [$f] +\end{aligned}\right.```] + +[@KeyboardInstructions('If there is one solution, enter it as an ordered pair. If there is no solution, enter [|no solution|]*. If there is an infinite number of solutions, enter [|infinite number of solutions|]*.')@]** + +[_________________________________] + +END_PGML + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp( + checker => sub { + my ($correct, $student, $ans, $nth, $value) = @_; + $student->context->setError("Your $nth $value contains an unreduced fraction","",undef,undef,$Value::CMP_WARNING) + if $student->{notReduced}; + return 0 unless $correct == $student; + my $reduced = 1; + foreach $x ($student->value) { + if (Value::classMatch($x,'Fraction') && !$x->isReduced) { + $reduced = 0; + break; + } + } + $student->{notReduced} = 1 unless $reduced || $ans->{isPreview}; + return $reduced; + } + )->withPostFilter(AnswerHints( + ["infinity"] => ["Infinity doesn't make sense here- do you mean infinite number of solutions?",replaceMessage=>1], +))); + +$commonConclusion = "The solution to the system is [`$ans`]. It is left as an exercise to check. Please also note that you may have solved this problem a different way."; + +if($a==-$c) +{ + # ax + by = e + # -ax + dy = f + # should be solved by addition + $lhs=Formula("$b*y+$d*y")->reduce; + $lhs1=Formula("$a*x+$b*$y")->reduce; +BEGIN_PGML_SOLUTION +* Let's add the two equations, which will cancel the terms involving [`x`] and give [`[$lhs]=[$e]+[$f]`]. +* This gives [`y=[$y]`]. +* We find [`x`] using either equation - let's use the first one: [`[$lhs1]=[$e]`], so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==-$d) +{ + # ax + by = e + # cx + -by = f + # should be solved by addition + $lhs=Formula("$a*x+$c*x")->reduce; + $lhs1=Formula("$a*($x)+($b)*(y)")->reduce; +BEGIN_PGML_SOLUTION +* Let's add the two equations, which will cancel the terms involving [`y`] and give [`[$lhs]=[$e]+([$f])`]. +* This gives [`x=[$x]`]. +* We find [`y`] using either equation - let's use the first one: [`[$lhs1]=[$e]`], so [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($a==1 and $a!=$c and $b!=$d) +{ + # x + by = e should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$e-$b*y")->reduce; + $lhs=Formula("$c*$e-$c*$b*y+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. +* This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using the _first_ equation: + + [`\begin{aligned} + x&=[$e]-([$b])\cdot([$y])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==1 and $b!=$d and $a!=$c) +{ + # ax + y = e should be solved for y + # provided that $b and $d are not equal- in this case we should use subtraction. + $lhs=Formula("$c*x+$d*$e-$d*$a*x")->reduce; + $rhs=Formula("$e-$a*x")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$f]`] so [`x=[$x]`] +* Now that we have [`x`], we find [`y`] using the first equation: + + [` + \begin{aligned} + y&=[$e]-([$a])\cdot([$x])\\ + &=[$y] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==1 and $a!=$c and $b!=$d) +{ + # x + dy = f should be solved for x + # provided that $a and $c are not equal- in this case we should use subtraction. + $rhs=Formula("$f-$d*y")->reduce; + $lhs=Formula("$a*$f-$a*$d*y+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. +* This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using the _second_ equation: + + [` + \begin{aligned} + x&=[$f]-([$d])\cdot([$y])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==1 and $d!=$b and $a!=$c) +{ + # cx + y = f should be solved for y + $rhs=Formula("$f-$c*x")->reduce; + $lhs=Formula("$a*x+$b*$f-$b*$c*x")->reduce; + +BEGIN_PGML_SOLUTION +* From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. +* Now that we have [`x`], we find [`y`] using the _second_ equation: + + [` + \begin{aligned} + y&=[$f]-([$c])\cdot([$x])\\ + &=[$y] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($a==-1 and $a != $c and $b!=$d) +{ + # - x + by = e should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$b*y-$e")->reduce; + $lhs=Formula("$c*$b*y-$c*$e+$d*y")->reduce; + +BEGIN_PGML_SOLUTION +* From the first equation we see that [`x=[$rhs]`], which we substitute into the _second_ +equation and solve for [`y`]. +* This gives [`[$lhs]=[$f]`] so [`y=[$y]`]. +* We find [`x`] using the _first_ equation: + + [`\begin{aligned} + x&=([$b])\cdot([$y])-([$e])\\ + &=[$x] + \end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($b==-1 and $b!=$d and $a!=$c) +{ + # ax - y = e should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$a*x-$e")->reduce; + $lhs=Formula("$c*x+$d*$a*x-$d*$e")->reduce; +BEGIN_PGML_SOLUTION +* From the first equation we see that [`y=[$rhs]`], which we substitute into the _second_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$f]`] so [`x=[$x]`]. +* We find [`y`] using the first equation: + + [`\begin{aligned} + y&=([$a])\cdot([$x])-([$e]) \\ + &=[$y]\end{aligned}`] +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($c==-1 and $a!=$c and $b!=$d) +{ + # - x + dy = f should be solved for x + # unless $a and $c are the same, in which case + # subtraction should be used + $rhs=Formula("$d*y-$f")->reduce; + $lhs=Formula("$a*$d*y-$a*$f+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* From the second equation we see that [`x=[$rhs]`], which we substitute into the _first_ equation and solve for [`y`]. +* This gives [`[$lhs]=[$e]`] so [`y=[$y]`]. +* We find [`x`] using the _second_ equation: + + [`\begin{aligned} + x&=([$d])\cdot([$y])-([$f])\\ + &=[$x] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +elsif($d==-1 and $b!=$d and $a!=$c) +{ + # cx - y = f should be solved for y + # unless $b and $d are the same, in which case + # subtraction should be used + $rhs=Formula("$c*x-$f")->reduce; + $lhs=Formula("$a*x+$b*$c*x-$b*$f")->reduce; + +BEGIN_PGML_SOLUTION +* From the second equation we see that [`y=[$rhs]`], which we substitute into the _first_ equation and solve for [`x`]. +* This gives [`[$lhs]=[$e]`] so [`x=[$x]`]. +* We find [`y`] using the _second_ equation: + + [`\begin{aligned} + y&=([$c])\cdot([$x])-([$f])\\ + &=[$y] + \end{aligned}`]. +* [$commonConclusion]** +END_PGML_SOLUTION +} +else +{ + if($a==$c) + { + # ax + by = e + # ax + dy = f + # should be solved using subtraction + $lhs=Formula("$b*y-$d*y")->reduce; + $lhs1=Formula("$a*x+$b*($y)")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms in involving [`x`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`y=[$y]`]. +* Now that we have [`y`], we find [`x`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + elsif($b==$d) + { + # ax + by = e + # cx + by = f + # should be solved using subtraction + $lhs=Formula("$a*x-$c*x")->reduce; + $lhs1=Formula("$a*($x)+$b*y")->reduce; +BEGIN_PGML_SOLUTION +* We subtract the two equations, which will cancel the terms in involving [`y`] and give [`[$lhs]=[$e]-([$f])`]. +* This gives [`x=[$x]`]. +* Now that we have [`x`], we find [`y`] using either equation - let's use the first: [`[$lhs1]=[$e]`], so [`y=[$y]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } + else + { + # otherwise use elimination + + # multiply the first equation by $c + $topleft=Formula("$c*$a*x+$c*$b*y")->reduce; + $topright=$c*$e; + + # multiply the second equation by $a + $bottomleft=Formula("$a*$c*x+$a*$d*y")->reduce; + $bottomright=$a*$f; + + $lhs=Formula("$c*$b*y-$a*$d*y")->reduce; + $rhs=$c*$e-$a*$f; + + # put them together +BEGIN_PGML_SOLUTION +* Let's multiply the _first_ equation by [$c] and the _second_ equation by [$a] + + [`\begin{aligned} + [$topleft] &= [$topright]\\ + [$bottomleft] &=[$bottomright] + \end{aligned}`] +* Subtracting these two equations gives [`[$lhs]=[$rhs]`], so [`y=[$y]`]. + +* Now that we have [`y`], we can use either equation to find [`x`]; let's use the first one: + + [`[$a]*x+([$b])\cdot([$y])=[$e]`] + + so [`x=[$x]`]. +* [$commonConclusion]** +END_PGML_SOLUTION + } +} + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/Cofunction10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/Cofunction10.pg new file mode 100644 index 0000000000..dc028bd092 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/Cofunction10.pg @@ -0,0 +1,184 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# +# ENDDESCRIPTION + +## DBsubject('Precalculus') +## DBchapter('Trigonometry') +## DBsection('') +## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub output { + my $n = shift; + if ($n==1) {return "";} + elsif ($n==-1) {return "-";} + else {return $n;} +} + +Context("Fraction"); + +do { + $den = list_random(3,5,6,7,8,9); + $num = random(1,int($den/2),1); +} until gcd($num,$den)==1; + +@angle = (); +$angle[0] = Fraction($num,$den); +$angle[1] = (Fraction(1,2)-$angle[0])->reduce; + +@num = (); +@den = (); +($num[0],$den[0]) = $angle[0]->value; +($num[1],$den[1]) = $angle[1]->value; + +@numShow = (); +for my $i (0..1) { + $numShow[$i] = &output($num[$i]); +} + +@values = ( + ["\sin \left( \frac{$numShow[0]\pi}{$den[0]} \right)", + "\cos \left( \frac{$numShow[1]\pi}{$den[1]} \right)"], + ["\sin \left( \frac{$numShow[1]\pi}{$den[1]} \right)", + "\cos \left( \frac{$numShow[0]\pi}{$den[0]} \right)"], + ["\tan \left( \frac{$numShow[0]\pi}{$den[0]} \right)", + "\cot \left( \frac{$numShow[1]\pi}{$den[1]} \right)"], + ["\tan \left( \frac{$numShow[1]\pi}{$den[1]} \right)", + "\cot \left( \frac{$numShow[0]\pi}{$den[0]} \right)"], + ["\sec \left( \frac{$numShow[0]\pi}{$den[0]} \right)", + "\csc \left( \frac{$numShow[1]\pi}{$den[1]} \right)"], + ["\sec \left( \frac{$numShow[1]\pi}{$den[1]} \right)", + "\csc \left( \frac{$numShow[0]\pi}{$den[0]} \right)"], +); + +$in0 = random(0,3,1); +$in1 = random(0,1,1); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Using your knowledge of cofunctions, find equivalent expressions of \( $values[$in0][$in1] \). There may be more than one correct answer.", + "\( $values[$in0][($in1+1)%2] \) $BR", +); + +$mc -> extra( + "\( $values[($in0+1)%4][0] \) $BR", + "\( $values[($in0+1)%4][1] \) $BR", + "\( $values[($in0+2)%4][0] \) $BR", + "\( $values[($in0+2)%4][1] \) $BR", + "\( $values[($in0+3)%4][0] \) $BR", + "\( $values[($in0+3)%4][1] \) $BR", +); + + +$graph = init_graph(0,0,5,5); +$graph->lb('reset'); + +$graph->moveTo(1,1); +$graph->lineTo(4, 1, red, 2); +$graph->lineTo(4, 3, red, 2); +$graph->lineTo(1, 1, red, 2); + +$graph->moveTo(4, 1.2); +$graph->lineTo(4-0.2, 1.2, red, 2); +$graph->lineTo(4-0.2, 1, red, 2); + +$graph->lb(new Label(1,1,"A",'red',"right","top",large)); +$graph->lb(new Label(4,3,"B",'red',"left","bottom",large)); +$graph->lb(new Label(4,1,"C",'red',"left","top",large)); + +$graph->lb(new Label(4,2,"a",'red',"left","middle",large)); +$graph->lb(new Label(2.5,1,"b",'red',"center","top",large)); +$graph->lb(new Label(2.5,2,"c",'red',"right","bottom",large)); + +$alt = "This is a right triangle ABC, with C being the right angle. Angle A faces side a, Angle B faces side b, and Angle C faces side c."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this right triangle, note that: + + [``\begin{aligned} + \sin(A) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{a}{c} \\ + \cos(B) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{a}{c} + \end{aligned}``] + +Because [`B=\frac{\pi}{2}-A`], we have: + + [`` \sin(A) = \cos \left( \frac{\pi}{2}-A \right), \cos(A) = \sin \left( \frac{\pi}{2}-A \right)``] + +Similarly: + + [``\begin{aligned} + \tan(A) &= \cot \left( \frac{\pi}{2}-A \right), \cot(A) = \tan \left( \frac{\pi}{2}-A \right) \\ + \sec(A) &= \csc \left( \frac{\pi}{2}-A \right), \csc(A) = \sec \left( \frac{\pi}{2}-A \right) + \end{aligned}``] + +Because of such relationships, + +* [`y=\sin(x)`] and [`y=\cos(x)`] are cofunctions. +* [`y=\tan(x)`] and [`y=\cot(x)`] are cofunctions. +* [`y=\sec(x)`] and [`y=\csc(x)`] are cofunctions. + +In this problem, since [` \frac{[$numShow[0]]\pi}{[$den[0]]} = \frac{\pi}{2}-\frac{[$numShow[1]]\pi}{[$den[1]]} `], we have: + + [`` [$values[$in0][$in1]] = [$values[$in0][($in1+1)%2]] ``] + +The correct answer is [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig10.pg index c09c6060b5..42d4246a56 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -172,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the length of the side opposite to the right angle is marked as $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig15.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig15.pg index 6e810bfb9c..d5868b2415 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig15.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig15.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -172,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $base; the length of the side opposite to the right angle is marked as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig20.pg index 7c4cc9822f..3ff69cb591 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig20.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -172,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side adjacent to the given acute angle is marked as x (unknown); the length of the side opposite to the right angle is marked as $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig25.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig25.pg index ebc3855846..f2de86815e 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig25.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig25.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -172,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side adjacent to the given acute angle is marked as $height; the length of the side opposite to the right angle is marked as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig30.pg index 48e37846ff..01c6fbdd02 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig30.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -172,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the length of the side adjacent to the given acute angle is marked as $height."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML @@ -183,7 +187,7 @@ BEGIN_PGML Find the length of [`x`]. Round your answer to two decimal places if needed. - [`x=`][___________]{$height} + [`x=`][___________]{$base} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig35.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig35.pg index 90773c7188..5e9026cb8f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig35.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig35.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -172,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $base; the length of the side adjacent to the given acute angle is marked as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig40.pg index f67a58cbd4..ed0b897a99 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig40.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -172,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the length of the side adjacent to the given acute angle is marked as y (unknown); the length of the side opposite to the right angle is marked as $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig50.pg index 19884351bd..692d70f2ef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig50.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -172,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $base; the length of the side adjacent to the given acute angle is marked as x (unknown); the length of the side opposite to the right angle is marked as y (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig60.pg index 254d80b3c1..ac1e98d85b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrig60.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -172,7 +176,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the length of the side adjacent to the given acute angle is marked as $height; the length of the side opposite to the right angle is marked as y (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication05.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication05.pg index 85971b76a0..c95450da92 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication05.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication05.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -183,16 +187,16 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees, and the vertex of this angle is labeled as Town A. The vertex of the acute angle at the $bPosition is labeled as Town B. The length of the side opposite to the given acute angle is marked as x (unknown); the length of the side opposite to the right angle is marked as $hypotenuseU."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -A straight road connects two towns, which are built on a [`[$alpha]`] degree slope. The road is [`[$hypotenuseU]`] long. Find the difference in elevation between the two towns(vertical distance). +A straight road connects two towns, which are built on a slope with [`[$alpha]`] degrees. The road's distance is [`[$hypotenuseU]`]. Find the difference in those two towns' elevation (vertical distance). Round your answer to two decimal places if needed. -The difference in elevation is [___________]{$baseU}. +The difference of those two towns' elevation is [___________]{$baseU}. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication10.pg index 49d7a9e308..9bf6a2cd51 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -179,16 +183,16 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown), and this same side is also labeled as the wall; the side adjacent to the given acute angle is labeled as the ground; the length of the side opposite to the right angle is marked as $hypotenuseU, and this side is also labeled as the ladder."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -A [`[$hypotenuse]`] foot long ladder is leaning against a wall. The base of the ladder forms a [`[$alpha]`] degree angle with the ground. How high does the ladder reach on the wall? +A [`[$hypotenuse]`]-feet ladder is leaning against the wall. The base of the ladder forms a [`[$alpha]`] degree angle with the ground. How high can the ladder reach on the wall? Round your answer to two decimal places if needed. -The ladder reaches a height of [___________]{$baseU} on the wall. +The ladder can reach [___________]{$baseU} on the wall. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication100.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication100.pg index 394a8d2aa0..fbcdb35808 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication100.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication100.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -171,7 +175,7 @@ if ($corner==0) { $text = "The graph shows a ramp set up from a trunk to the ground. A vertical line is drawn from upper end of the ramp (touching the trunk) straight down to the ground. A horizontal line is drawn from where the ramp touches the ground toward the trunk. The ramp, the vertical line and the horizontal line form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU; the side adjacent to the given acute angle is labeled as the ground; and the side opposite to the right angle is labeled as the ramp, and also labeled as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication110.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication110.pg index 28795ce818..af48d8da93 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication110.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication110.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -189,7 +193,7 @@ if ($corner==0) { $text = "The graph shows an airplane flying toward an airport. A line connects the airplane to the airport. A vertical line is drawn from the airplane to the ground, and a horizontal line is drawn from the airport toward to the airplane. Those three lines form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU; the side adjacent to the given acute angle is marked x (unknown). A dashed horizontal line is drawn from the airplane toward the airport; this line forms a $alpha-degree angle with the hypotenuse of the right triangle."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication120.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication120.pg index e21fc51138..47686be776 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication120.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication120.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -209,7 +213,7 @@ if ($corner==0) { $text = "The graph shows a vertical line, representing a building. The bottom of the building is marked as C; the bottom of the second storey is marked as B; the top of the second storey is marked as A. There is an observation point, marked as D, on the ground $heightU from the bottom of the building (point C). A dashed line connects points D and B, and another dashed line connects points D and A. Angle ADC is $alpha2 degrees, and angle BDC is $alpha1 degrees. The segment AB is marked as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication130.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication130.pg index 2ac25ccc60..4a34550cf5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication130.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication130.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -220,7 +224,7 @@ if ($corner==0) { $text = "The graph shows an airplane (represented by point A) looking over City 1 (point D) and City 2 (point C). A vertical line is drawn from point A down to the ground, crossing the ground at point B. Angle ACB is $alpha2 degrees, while Angle ADB is $alpha1 degrees. A horizontal dashed line is draw from the airplane toward those two cities. The horizontal line forms a $alpha2 degree angle with segment AC, and forms a $alpha1 degree angle with segment AD. Segment AB is labeled as $baseU. The segment between those two cities (segment CD) is labeled as x (unknown)."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication140.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication140.pg new file mode 100644 index 0000000000..6413d270be --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication140.pg @@ -0,0 +1,163 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Law of Sines +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('area','perimeter','triangle') +## DBCCSS('6.G.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + + +$B = random(31, 70, 1); +$C = 90; +$A = 180-$B-$C; +$a = random(50, 100, 1); +$b = $a*sin($B*pi/180)/sin($A*pi/180); +$c = $a*sin($C*pi/180)/sin($A*pi/180); +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$base = ($c*cos($B*pi/180)); +$xmax = ($base)*240/210; +$ymin = 0; +$ymax = (210*$h/$base+30)*$h/(210*$h/$base); + +$xLabelShift = $xmax/20; +$yLabelShift = $ymax/80; + +# Ax, Bx, Cx +@x = (($xmax+$base)/2, ($xmax-$base)/2, ($xmax-$base)/2+$a); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +for my $i (0..1) { +$picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +if ($i==0) { + $picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"$a miles",'black','center','top','large')); +} else { + $picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"c=$a miles",'black','center','top','large')); +} +if ($i==1) { + $picture[$i]->lb( new Label(($x[0]+$x[2])/2+0.5*$xLabelShift, ($y[0]+$y[1])/2,"a",'black','left','bottom','large')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"b",'black','right','bottom','large')); + $picture[$i]->lb( new Label( $x[0], $y[0],"C (boat)",'black','right','bottom','large')); +} else { + $picture[$i]->lb( new Label( $x[0], $y[0],"boat",'black','center','bottom','large')); +} + +$picture[$i]->lb( new Label( $x[1], $y[1],"A",'black','right','top','large')); +$picture[$i]->lb( new Label( $x[1]+2*$xLabelShift, $y[1]+$yLabelShift,$B,'black','left','bottom','large')); +$picture[$i]->lb( new Label( $x[2], $y[2],"B",'black','left','top','large')); +$picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2]+$yLabelShift,$C2,'black','left','bottom','large')); + +$picture[$i]->new_color("darkblue", 100,100,255); + +$picture[$i]->moveTo($x[0],$y[0]); +$picture[$i]->lineTo($x[1],$y[1], darkblue,3); +$picture[$i]->lineTo($x[2],$y[2], darkblue,3); +$picture[$i]->lineTo($x[0],$y[0], darkblue,3); + +$picture[$i]->moveTo($x[2],$y[2]); +$picture[$i]->lineTo($x[0],$y[2], darkblue,1,dashed); + +$xShift = $xmax/200; +$yShift = $xShift*210/240; +$picture[$i]->moveTo($x[0],$y[2]+10*$yShift); +$picture[$i]->lineTo($x[0]-10*$xShift,$y[2]+10*$yShift, darkblue,3); +$picture[$i]->lineTo($x[0]-10*$xShift,$y[2], darkblue,3); + +} + +$text[0] = "This is a right triangle with one side parallel to the ground; this side is marked as $a miles; the top point is marked as boat. The left endpoint is marked as A, and right endpoint is marked as B. The angle of elevation from A to the boat is $B degrees, and the angle of elevation from B to the boat is 90 degrees. The boat is right above Point B, making Angle B inside the triangle a right angle."; + +$text[1] = "This is a right triangle with one side parallel to the ground; this side is marked as c=$a miles; the top point is marked as C (boat). The left endpoint is marked as A, and right endpoint is marked as B. The angle of elevation from A to the boat is $B degrees, and the angle of elevation from B to the boat is 90 degrees. The boat is right above Point B, making Angle B inside the triangle a right angle. The side AC is marked as b, and the side BC is marked as a."; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +To determine how far a boat is from shore, two radar stations [`[$a]`] miles apart find the angles out to the boat, as shown in the figure. The angle of elevation from Station A to the boat is [`[$B]^{\circ}`], and angle of elevation from Station B to the boat is [`[$C]^{\circ}`]. + +Determine the distance of the boat from Station A and Station B. + +The distance from the boat to Station A is [____________]{$c} miles. + +The distance from the boat to Station B is [____________]{$b} miles. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the boat is at Point C. Assume the distance from the boat to Station A is [`b`] miles, and to Station B is [`a`] miles. Assume the distance between those two stations is [`c=[$a]`] miles. + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +We use trigonometry to calculate the length of [`b`]: + + [``\begin{aligned}[t] + \cos(A) &= \frac{c}{b} \\ + b\cdot\cos(A) &= c \\ + b &= \frac{c}{\cos(A)} \\ + b &= \frac{[$a]}{\cos([$B]^{\circ})} \\ + b &= [$c] + \end{aligned}``] + +The distance from the boat to Station A is [`[$c]`] miles. + +And, use trigonometry to calculate the length of [`a`]: + + [``\begin{aligned}[t] + \tan(A) &= \frac{a}{c} \\ + c\cdot\tan(A) &= a \\ + a &= c\cdot\tan(A) \\ + a &= [$a]\cdot{\tan([$B]^{\circ})} \\ + a &= [$b] + \end{aligned}``] + +The distance from the boat to Station B is [`[$b]`] miles. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication20.pg index 289ad17776..a21b7b50b7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication20.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -179,12 +183,12 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown), and this same side is also labeled as the wall; the length of the side opposite to the right angle is marked as $hypotenuseU, and this side is also labeled as the ladder."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -A [`[$hypotenuse]`] foot long ladder is leaning against the wall. The base of the ladder forms a [`[$alpha]`] degree angle with the ground. How far is the ladder's base from the wall? +A [`[$hypotenuse]`]-feet ladder is leaning against the wall. The base of the ladder forms a [`[$alpha]`] degree angle with the ground. How far is the ladder's base from the wall? Round your answer to two decimal places if needed. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication30.pg index 619af69fa8..ea1d6ece45 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication30.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -179,7 +183,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU, and this same side is also labeled as the pole; the side adjacent to the given acute angle is labeled as the ground; the length of the side opposite to the right angle is marked as x (unknown), and this side is also labeled as the wire."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication40.pg index f4e71fa48e..2c96129186 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication40.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -180,7 +184,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU, and this same side is also labeled as the pole; the side adjacent to the given acute angle is marked as x (unknown), and this same side is also labeled as the ground; the side opposite to the right angle is labeled as the wire."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication50.pg index 16b5afa3f8..50f887546f 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication50.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -180,12 +184,12 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU, and this same side is also labeled as the ground; the side adjacent to the given acute angle is marked as x (unknown), and this same side is also labeled as the wall; the side opposite to the right angle is labeled the light beam."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -A spotlight will be installed on a wall, shining light at a spot [`[$baseU]`] from the bottom of the wall. If the angle between the spotlight's light beam and the wall is [`[$alpha]`] degrees, how high on the wall should the spotlight be installed? +A spotlight will be installed on a wall, shining light at a spot on the ground [`[$baseU]`] from the bottom of the wall. If the angle between the spotlight's light beam and the wall is [`[$alpha]`] degrees, how high on the wall should the spotlight be installed? Round your answer to two decimal places if needed. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication60.pg index b93d4918eb..827d0ab773 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication60.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -136,7 +140,7 @@ $picture->moveTo($x[0]-$labelAdjust,$y[0]-1.5*$labelAdjust); $picture->lineTo($x[1]+$labelAdjust,$y[0]-1.5*$labelAdjust,'blue'); #plane $picture->stamps( closed_circle($x[1],$y[1],'blue') ); -$picture->lb( new Label($x[1]+$labelAdjust/7,$y[1]+$labelAdjust/2,'airplane','black','center','middle')); +$picture->lb( new Label($x[1]+$labelAdjust/7,$y[1]+$labelAdjust/2,'object','black','center','middle')); $picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],'x ft','black','center','middle')); #$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner]+$curveAdjust,'wall','black','center','middle')); @@ -197,19 +201,19 @@ if ($corner==0) { $cPosition = $positions[3]; } -$text = "The graph shows a $heightPersonU person on the ground, looking up at a flying airplane. A horizontal line is drawn from his eyes toward the airplane, and a vertical line is drawn from the airplane downward. Another line is connected from his eyes to the airplane. These three lines form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the side adjacent to the given acute angle is marked $heightU."; +$text = "The graph shows a $heightPersonU person on the ground, looking up at a flying object. A horizontal line is drawn from his eyes toward the object, and a vertical line is drawn from the object downward. Another line is connected from his eyes to the object. These three lines form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the side adjacent to the given acute angle is marked $heightU."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -A person is standing straight on the ground, looking up at an airplane which is taking off. His eyes is [`[$heightPersonU]`] from the ground. Horizontally, the person is [`[$heightU]`] away from the airplane. The angle of elevation from his eyes to the airplane is [`[$alpha]`] degrees. Find the height of the airplane. +A person is standing straight on the ground, looking up at an object in the air. His eyes are [`[$heightPersonU]`] from the ground. Horizontally, the person is [`[$heightU]`] away from the object. The angle of elevation from his eyes to the object is [`[$alpha]`] degrees. Find the height of the object. Round your answer to two decimal places if needed. -The height of the airplane is [___________]{$ansU}. +The height of the object is [___________]{$ansU}. END_PGML @@ -217,7 +221,7 @@ END_PGML BEGIN_PGML_SOLUTION -Assume the vertical distance from the person's eyes to the airplane is [`x`] feet. The following graph can represent this situation: +Assume the vertical distance from the person's eyes to the object is [`x`] feet. The following graph can represent this situation: [@EnlargeImageStatementPGML()@]** @@ -254,7 +258,7 @@ Since we need to relate the angle's opposite and adjacent legs, we choose to use Finally, we need to add up the value of [`x`] and the distance from the person's eyes to the ground: [`[$baseShow]+[$heightPerson]=[$ans]`]. -The height of the airplane is approximately [`[$ansU]`]. +The height of the object is approximately [`[$ansU]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication70.pg index afe1084da0..db21d5ddaa 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication70.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -183,12 +187,12 @@ if ($corner==0) { $text = "The graph has a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU, and this same side is also labeled as the ground; the side adjacent to the given acute angle is marked as x (unknown), and this same side is also labeled as the wall; the side opposite to the right angle is labeled the light beam. From the spotlight on the wall, a dashed horizontal line is drawn, and the angle between the triangle's hypotenuse and the horizontal line is $beta degrees."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -A spotlight will be installed on a wall, shining light at a spot [`[$baseU]`] from the bottom of the wall. If the angle of depression is [`[$beta]`] degrees, how high on the wall should the spotlight be installed? +A spotlight will be installed on a wall, shining light at a spot on the ground [`[$baseU]`] from the bottom of the wall. If the angle of depression is [`[$beta]`] degrees, how high on the wall should the spotlight be installed? Round your answer to two decimal places if needed. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication80.pg index cff3a2312a..03982edd74 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication80.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(4) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -189,7 +193,7 @@ if ($corner==0) { $text = "The graph shows a lighthouse with a spotlight on its top, shining light at a boat on the sea. The lighthouse, the line connecting the boat to the lighthouse, and a line connecting the boat to the spotlight form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as $baseU (height of the lighthouse); the side adjacent to the given acute angle is marked x (unknown). A dashed horizontal line is drawn from the spotlight toward the boat; this line forms a $alpha-degree angle with the hypotenuse of the right triangle."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication90.pg index b5e9096366..d7557b34e5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigApplication90.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Applications of special triangles & right triangles) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -201,12 +205,12 @@ if ($corner==0) { $text = "The graph shows a $heightPersonU person on the ground, looking up at a kite. A horizontal line is drawn from his hand (very close to his eyes) toward the kite, and a vertical line is drawn from the kite downward. Another line is connected from his hand to the kite. These three lines form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures $alpha degrees. The length of the side opposite to the given acute angle is marked as x (unknown); the side opposite to the right angle is marked $hypotenuseU."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); BEGIN_PGML -A person is flying a kite. The string is fully extended at [`[$hypotenuseU]`]. The hand holding the string is very close to his eyes, which are [`[$heightPersonU]`] above the ground. When he looks up at the kite, the angle of elevation is [`[$alpha]`] degrees. Find the height of the kite. +A person is flying a kite. The string is fully extended at [`[$hypotenuseU]`]. The hand holding the string is very close to his eyes. When he looks up at the kite, the angle of elevation is [`[$alpha]`] degrees. Find the height of the kite. Round your answer to two decimal places if needed. diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg index a7f40cd664..b8b2a87fa5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg @@ -8,27 +8,30 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RightTriangle3) -## Static(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -116,22 +119,24 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: - [`` \sin \theta = \frac{\text{\text{opposite}}}{\text{\text{hypotenuse}}} ``] + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] - [`` \cos \theta = \frac{\text{\text{adjacent}}}{\text{\text{hypotenuse}}} ``] + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] - [`` \tan \theta = \frac{\text{\text{opposite}}}{\text{\text{adjacent}}} ``] +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`c`] is the hypotenuse, because it is opposite from right angle [`\angle C`]. -For [`\angle A`], side [`a`] is the "opposite side," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent side" in terms of [`\angle A`]. +For [`\angle A`], side [`a`] is the "opposite leg," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent leg" in terms of [`\angle A`]. -For [`\angle B`], side [`b`] is the "opposite side," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent side" in terms of [`\angle B`]. +For [`\angle B`], side [`b`] is the "opposite leg," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent leg" in terms of [`\angle B`]. By the above definitions, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg index f69db7ca60..63aab95b2a 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg @@ -8,26 +8,30 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RightTriangle3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -116,22 +120,24 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: - [`` \sin \theta = \frac{\text{opposite}}{\text{hypotenuse}} ``] + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] - [`` \cos \theta = \frac{\text{adjacent}}{\text{hypotenuse}} ``] + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] - [`` \tan \theta = \frac{\text{opposite}}{\text{adjacent}} ``] +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`c`] is the hypotenuse, because it is opposite from right angle [`\angle C`]. -For [`\angle A`], side [`a`] is the "opposite side," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent side" in terms of [`\angle A`]. +For [`\angle A`], side [`a`] is the "opposite leg," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent leg" in terms of [`\angle A`]. -For [`\angle B`], side [`b`] is the "opposite side," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent side" in terms of [`\angle B`]. +For [`\angle B`], side [`b`] is the "opposite leg," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent leg" in terms of [`\angle B`]. By the above definitions, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg index 79df7cef8d..fa338bf2a0 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg @@ -8,26 +8,30 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RightTriangle3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -116,22 +120,24 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: - [`` \sin \theta = \frac{\text{opposite}}{\text{hypotenuse}} ``] + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] - [`` \cos \theta = \frac{\text{adjacent}}{\text{hypotenuse}} ``] + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] - [`` \tan \theta = \frac{\text{opposite}}{\text{adjacent}} ``] +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`f`] is the hypotenuse, because it is opposite from right angle [`\angle F`]. -For [`\angle D`], side [`d`] is the "opposite side," because it's opposite to [`\angle D`]; this implies side [`e`] is the "adjacent side" in terms of [`\angle D`]. +For [`\angle D`], side [`d`] is the "opposite leg," because it's opposite to [`\angle D`]; this implies side [`e`] is the "adjacent leg" in terms of [`\angle D`]. -For [`\angle E`], side [`e`] is the "opposite side," because it's opposite to [`\angle E`]; this implies side [`d`] is the "adjacent side" in terms of [`\angle E`]. +For [`\angle E`], side [`e`] is the "opposite leg," because it's opposite to [`\angle E`]; this implies side [`d`] is the "adjacent leg" in terms of [`\angle E`]. By the above definitions, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg index 51fbaf5d06..8106cd6353 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg @@ -8,26 +8,30 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RightTriangle3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -116,22 +120,24 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: - [`` \sin \theta = \frac{\text{opposite}}{\text{hypotenuse}} ``] + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] - [`` \cos \theta = \frac{\text{adjacent}}{\text{hypotenuse}} ``] + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] - [`` \tan \theta = \frac{\text{opposite}}{\text{adjacent}} ``] +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`t`] is the hypotenuse, because it is opposite from right angle [`\angle T`]. -For [`\angle S`], side [`s`] is the "opposite side," because it's opposite to [`\angle S`]; this implies side [`r`] is the "adjacent side" in terms of [`\angle S`]. +For [`\angle S`], side [`s`] is the "opposite leg," because it's opposite to [`\angle S`]; this implies side [`r`] is the "adjacent leg" in terms of [`\angle S`]. -For [`\angle R`], side [`r`] is the "opposite side," because it's opposite to [`\angle R`]; this implies side [`s`] is the "adjacent side" in terms of [`\angle R`]. +For [`\angle R`], side [`r`] is the "opposite leg," because it's opposite to [`\angle R`]; this implies side [`s`] is the "adjacent leg" in terms of [`\angle R`]. By the above definitions, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg index 0a67f3c512..abf21a6abf 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg @@ -8,27 +8,31 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RightTriangle3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -197,22 +201,24 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION By definition: - [`` \sin \theta = \frac{\text{opposite}}{\text{hypotenuse}} ``] + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] - [`` \cos \theta = \frac{\text{adjacent}}{\text{hypotenuse}} ``] + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] - [`` \tan \theta = \frac{\text{opposite}}{\text{adjacent}} ``] +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. -In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`c`] is the hypotenuse, because it is opposite from right angle [`\angle C`]. +In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, the side with the length [`[$hypotenuseLength]`] is the hypotenuse, because it is opposite from right angle. -For [`\angle A`], side [`a`] is the "opposite side," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent side" in terms of [`\angle A`]. +For [`\angle A `], the side with the length [`[$baseLength]`] is the "opposite leg," because it's opposite to [`\angle A`]; this implies the side with the length [`[$heightLength]`] is the "adjacent leg" in terms of [`\angle A`]. -For [`\angle B`], side [`b`] is the "opposite side," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent side" in terms of [`\angle B`]. +For [`\angle B`], the side with the length [`[$heightLength]`] is the "opposite leg," because it's opposite to [`\angle B`]; this implies the side with the length [`[$baseLength]`] is the "adjacent leg" in terms of [`\angle B`]. By the above definitions, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg index 8e03b0cce4..99cb4bfb76 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg @@ -10,27 +10,31 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RightTriangle3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle','Pythagorean') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -202,7 +206,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION First, we need to find the missing side. By the Pythagorean Theorem, we have: @@ -219,17 +223,19 @@ First, we need to find the missing side. By the Pythagorean Theorem, we have: By definition: - [`` \sin \theta = \frac{\text{opposite}}{\text{hypotenuse}} ``] + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] - [`` \cos \theta = \frac{\text{adjacent}}{\text{hypotenuse}} ``] + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] - [`` \tan \theta = \frac{\text{opposite}}{\text{adjacent}} ``] +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`c`] is the hypotenuse, because it is opposite from right angle [`\angle C`]. -For [`\angle A`], side [`a`] is the "opposite side," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent side" in terms of [`\angle A`]. +For [`\angle A`], side [`a`] is the "opposite leg," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent leg" in terms of [`\angle A`]. -For [`\angle B`], side [`b`] is the "opposite side," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent side" in terms of [`\angle B`]. +For [`\angle B`], side [`b`] is the "opposite leg," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent leg" in terms of [`\angle B`]. By the above definitions, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg index 9a3861fc81..9373609b34 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg @@ -10,27 +10,31 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RightTriangle3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle','Pythagorean') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -104,9 +108,9 @@ $picture->lb( new Label($labelCx[$corner], $labelCy[$corner],"C",'black','center @labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); -$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],'x','black','center','middle')); +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$baseLength,'black','center','middle')); -$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$heightLength,'black','center','middle')); +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],'x','black','center','middle')); $picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuseLength,'black','center','middle')); @@ -203,7 +207,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION First, we need to find the missing leg's length. By the Pythagorean Theorem, we have: @@ -221,17 +225,19 @@ First, we need to find the missing leg's length. By the Pythagorean Theorem, we By definition: - [`` \sin \theta = \frac{\text{opposite}}{\text{hypotenuse}} ``] + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] - [`` \cos \theta = \frac{\text{adjacent}}{\text{hypotenuse}} ``] + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] - [`` \tan \theta = \frac{\text{opposite}}{\text{adjacent}} ``] +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`c`] is the hypotenuse, because it is opposite from right angle [`\angle C`]. -For [`\angle A`], side [`a`] is the "opposite side," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent side" in terms of [`\angle A`]. +For [`\angle A`], side [`a`] is the "opposite leg," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent leg" in terms of [`\angle A`]. -For [`\angle B`], side [`b`] is the "opposite side," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent side" in terms of [`\angle B`]. +For [`\angle B`], side [`b`] is the "opposite leg," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent leg" in terms of [`\angle B`]. By the above definitions, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg index 1e0bf9a86a..a6f8f67489 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg @@ -11,28 +11,32 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RightTriangle3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('Pythagorean','right triangle','radical','simplify','square root','rationalize','denominator','sine','cosine','tangent','trigonometry') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "contextLimitedRadical.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -163,11 +167,12 @@ sub line2 { ############################################## +TEXT(beginproblem()); Context("Numeric"); do { - $base = random(2,18,1); - $height = random(2,18,1); + $base = random(4,16,1); + $height = random(4,16,1); $hypotenuseSquared = $base**2+$height**2; } until (canBeSimplified($hypotenuseSquared)); @@ -317,9 +322,7 @@ if ($corner==0) { $text = "This is a right triangle. Right angle C is at the $cPosition corner of the picture. Acute angle A is at the $aPosition, and acute angle B is at the $bPosition. The length of the side facing Angle A is $base; the length of the side facing Angle B is $height; the length of the side facing Angle C is x (unknown)."; ############################################## -$refreshCachedImages = 1; -TEXT(beginproblem()); BEGIN_PGML @@ -419,17 +422,19 @@ The length of the hypotenuse is [`[$hypotenuse]`]. By definition: - [`` \sin \theta = \frac{\text{opposite}}{\text{hypotenuse}} ``] + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] - [`` \cos \theta = \frac{\text{adjacent}}{\text{hypotenuse}} ``] + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] - [`` \tan \theta = \frac{\text{opposite}}{\text{adjacent}} ``] +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`c`] is the hypotenuse, because it is opposite from right angle [`\angle C`]. -For [`\angle A`], side [`a`] is the "opposite side," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent side" in terms of [`\angle A`]. +For [`\angle A`], side [`a`] is the "opposite leg," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent leg" in terms of [`\angle A`]. -For [`\angle B`], side [`b`] is the "opposite side," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent side" in terms of [`\angle B`]. +For [`\angle B`], side [`b`] is the "opposite leg," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent leg" in terms of [`\angle B`]. By the above definitions, before we rationalize the denominators, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg index 0f516c4a87..fe896a79e7 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg @@ -11,28 +11,32 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(RightTriangle3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('Pythagorean','right triangle','radical','simplify','square root','rationalize','denominator','sine','cosine','tangent','trigonometry') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PCCgraphMacros.pl", "contextLimitedRadical.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -166,10 +170,11 @@ sub line2 { Context("Numeric"); do { - $base= random(2,18,1); + $base= random(4,16,1); $hypotenuse = random($base+1,25,1); $heightSquared = $hypotenuse**2-$base**2; -} until (canBeSimplified($heightSquared)); + $heightRounded = int(sqrt($heightSquared)+0.5); +} until ( (canBeSimplified($heightSquared)) && ($heightRounded<=16) ); ($in, $out) = simplify($heightSquared); @@ -229,8 +234,6 @@ $ymax = 20; #(0,1,2,3) implies (bottom left,top left,top right,bottom right). $corner = list_random(0..3); -$heightRounded = int(sqrt($heightSquared)+0.5); - if ( ($corner==0) || ($corner==2) ) { @x = (($xmax-$base)/2,($xmax+$base)/2); @y = (($ymax-$heightRounded)/2,($ymax+$heightRounded)/2); @@ -323,7 +326,7 @@ if ($corner==0) { $text = "This is a right triangle. Right angle C is at the $cPosition corner of the picture. Acute angle A is at the $aPosition, and acute angle B is at the $bPosition. The length of the side facing Angle A is $base; the length of the side facing Angle B is x (unknown); the length of the side facing Angle C is $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); @@ -424,17 +427,19 @@ The length of the missing leg is [`[$height]`]. By definition: - [`` \sin \theta = \frac{\text{opposite}}{\text{hypotenuse}} ``] + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] - [`` \cos \theta = \frac{\text{adjacent}}{\text{hypotenuse}} ``] + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] - [`` \tan \theta = \frac{\text{opposite}}{\text{adjacent}} ``] +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`c`] is the hypotenuse, because it is opposite from right angle [`\angle C`]. -For [`\angle A`], side [`a`] is the "opposite side," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent side" in terms of [`\angle A`]. +For [`\angle A`], side [`a`] is the "opposite leg," because it's opposite to [`\angle A`]; this implies side [`b`] is the "adjacent leg" in terms of [`\angle A`]. -For [`\angle B`], side [`b`] is the "opposite side," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent side" in terms of [`\angle B`]. +For [`\angle B`], side [`b`] is the "opposite leg," because it's opposite to [`\angle B`]; this implies side [`a`] is the "adjacent leg" in terms of [`\angle B`]. By the above definitions, before we rationalize the denominators, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek10.pg new file mode 100644 index 0000000000..22bde52958 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek10.pg @@ -0,0 +1,175 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find right triangle trigonometry ratios. The right angle is at the bottom left. +# Answers are in variables. +# +# Last edited by Carl Yao on 8/1/15 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(a=>'Real',b=>'Real',c=>'Real'); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +$base = random(5,17,1); +$height = random(5,17,1); +$hypotenuse = sqrt($base**2+$height**2); +$a = arctan($base/$height); +$b = pi/2-$a; + + +@x = (($xmax-$base)/2,($xmax+$base)/2); +@y = (($ymax-$height)/2,($ymax+$height)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +$xfuncAlpha = sub { my $t = shift(); + return $x[0]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $y[1]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain(3*pi/2,3*pi/2+$a); +$theta = 3*pi/2+$a/2; + +$picture->lb( new Label($x[0]+2*cos($theta), $y[1]+2*sin($theta),"alpha",'black','center','middle')); + +$xfuncBeta = sub { my $t = shift(); + return $x[1]+cos($t); }; +$yfuncBeta = sub { my $t = shift(); + return $y[0]+sin($t); }; +$fnBeta = new Fun( $xfuncBeta, $yfuncBeta, $picture ); +$fnBeta->domain(pi-$b,pi); +$theta = pi-$b/2; +$picture->lb( new Label($x[1]+2*cos($theta), $y[0]+2*sin($theta),"beta",'black','center','middle')); + + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-$labelAdjust,"a",'black','center','middle')); + +$picture->lb( new Label($x[0]-$labelAdjust,($y[0]+$y[1])/2,"b",'black','center','middle')); + +$picture->lb( new Label(($x[0]+$x[1])/2+$labelAdjust,($y[0]+$y[1])/2+$labelAdjust,"c",'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[0], darkblue,3); +$picture->lineTo($x[0],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + + +$cornersize = 0.5; + +$picture->moveTo($x[0]+$cornersize,$y[0]); +$picture->lineTo($x[0]+$cornersize,$y[0]+$cornersize, darkblue,3); +$picture->lineTo($x[0],$y[0]+$cornersize, darkblue,3); + + +$ansSineA = Compute("a/c"); +$ansSineB = Compute("b/c"); +$ansCosineA = Compute("b/c"); +$ansCosineB = Compute("a/c"); +$ansTangentA = Compute("a/b"); +$ansTangentB = Compute("b/a"); + +$text = "This is a right triangle. The right angle is at the bottom left corner of the picture. Acute angle alpha is at the top left, and acute angle beta is at the bottom right. Angle alpha faces side a; Angle beta faces side b; the right angle faces side c."; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Based on the given figure, find the following values of trigonometric functions. Note that in the graph, "alpha" stands for [`\alpha`], and "beta" stands for [`\beta`]. + + [` \sin \alpha={}`][_____________]{$ansSineA} + + [` \sin \beta ={}`][_____________]{$ansSineB} + + [` \cos \alpha={}`][_____________]{$ansCosineA} + + [` \cos \beta={}`][_____________]{$ansCosineB} + + [` \tan \alpha={}`][_____________]{$ansTangentA} + + [` \tan \beta={}`][_____________]{$ansTangentB} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`c`] is the hypotenuse, because it is opposite from right angle. + +For [`\angle \alpha`], side [`a`] is the "opposite leg," because it's opposite to [` \angle \alpha`]; this implies side [`b`] is the "adjacent leg" in terms of [`\angle \alpha`]. + +For [` \angle \beta`], side [`b`] is the "opposite leg," because it's opposite to [`\angle \beta`]; this implies side [`a`] is the "adjacent leg" in terms of [`\angle \beta`]. + +By the above definitions, we have: + + [`` \sin \alpha = \frac{a}{c} ``] + + [`` \sin \beta = \frac{b}{c} ``] + + [`` \cos \alpha = \frac{b}{c} ``] + + [`` \cos \beta = \frac{a}{c} ``] + + [`` \tan \alpha = \frac{a}{b} ``] + + [`` \tan \beta = \frac{b}{a} ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek20.pg new file mode 100644 index 0000000000..0dff16c69d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek20.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find right triangle trigonometry ratios. The right angle is at the top left. +# Answers are in variables. +# +# Last edited by Carl Yao on 8/1/15 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(a=>'Real',b=>'Real',c=>'Real'); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +$base = random(5,17,1); +$height = random(5,17,1); +$hypotenuse = sqrt($base**2+$height**2); +$a = arctan($base/$height); +$b = pi/2-$a; + +@x = (($xmax-$base)/2,($xmax+$base)/2); +@y = (($ymax-$height)/2,($ymax+$height)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +$xfuncAlpha = sub { my $t = shift(); + return $x[0]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $y[0]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain(pi/2-$a,pi/2); +$theta = pi/2-$a/2; +$picture->lb( new Label($x[0]+2*cos($theta), $y[0]+2*sin($theta),"alpha",'black','center','middle')); + +$xfuncBeta = sub { my $t = shift(); + return $x[1]+cos($t); }; +$yfuncBeta = sub { my $t = shift(); + return $y[1]+sin($t); }; +$fnBeta = new Fun( $xfuncBeta, $yfuncBeta, $picture ); +$fnBeta->domain(pi,pi+$b); +$theta = pi+$b/2; +$picture->lb( new Label($x[1]+2*cos($theta), $y[1]+2*sin($theta),"beta",'black','center','middle')); + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[1]+$labelAdjust,"a",'black','center','middle')); + +$picture->lb( new Label($x[0]-$labelAdjust,($y[0]+$y[1])/2,"b",'black','center','middle')); + +$picture->lb( new Label(($x[0]+$x[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,"c",'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[1]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); +$picture->lineTo($x[0],$y[1], darkblue,3); + + +$cornersize = 0.5; + +$picture->moveTo($x[0]+$cornersize,$y[1]); +$picture->lineTo($x[0]+$cornersize,$y[1]-$cornersize, darkblue,3); +$picture->lineTo($x[0],$y[1]-$cornersize, darkblue,3); + + +$ansSineA = Compute("a/c"); +$ansSineB = Compute("b/c"); +$ansCosineA = Compute("b/c"); +$ansCosineB = Compute("a/c"); +$ansTangentA = Compute("a/b"); +$ansTangentB = Compute("b/a"); + +$text = "This is a right triangle. The right angle is at the top left corner of the picture. Acute angle alpha is at the bottom left, and acute angle beta is at the top right. Angle alpha faces side a; Angle beta faces side b; the right angle faces side c."; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + + +Based on the given figure, find the following values of trigonometric functions. Note that in the graph, "alpha" stands for [`\alpha`], and "beta" stands for [`\beta`]. + + [` \sin \alpha ={}`][_____________]{$ansSineA} + + [` \sin \beta ={}`][_____________]{$ansSineB} + + [` \cos \alpha ={}`][_____________]{$ansCosineA} + + [` \cos \beta ={}`][_____________]{$ansCosineB} + + [` \tan \alpha ={}`][_____________]{$ansTangentA} + + [` \tan \beta ={}`][_____________]{$ansTangentB} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`c`] is the hypotenuse, because it is opposite from right angle. + +For [`\angle \alpha`], side [`a`] is the "opposite leg," because it's opposite to [` \angle \alpha`]; this implies side [`b`] is the "adjacent leg" in terms of [`\angle \alpha`]. + +For [` \angle \beta`], side [`b`] is the "opposite leg," because it's opposite to [`\angle \beta`]; this implies side [`a`] is the "adjacent leg" in terms of [`\angle \beta`]. + +By the above definitions, we have: + + [`` \sin \alpha = \frac{a}{c} ``] + + [`` \sin \beta = \frac{b}{c} ``] + + [`` \cos \alpha = \frac{b}{c} ``] + + [`` \cos \beta = \frac{a}{c} ``] + + [`` \tan \alpha = \frac{a}{b} ``] + + [`` \tan \beta = \frac{b}{a} ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek30.pg new file mode 100644 index 0000000000..3fcc17fefc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek30.pg @@ -0,0 +1,176 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find right triangle trigonometry ratios. The right angle is at the top right. +# Answers are in variables. +# +# Last edited by Carl Yao on 8/1/15 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(d=>'Real',e=>'Real',f=>'Real'); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +$base = random(5,17,1); +$height = random(5,17,1); +$hypotenuse = sqrt($base**2+$height**2); +$a = arctan($base/$height); +$b = pi/2-$a; + +@x = (($xmax-$base)/2,($xmax+$base)/2); +@y = (($ymax-$height)/2,($ymax+$height)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +$xfuncAlpha = sub { my $t = shift(); + return $x[0]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $y[1]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain(-$b,0); +$theta = -$b/2; + +$picture->lb( new Label($x[0]+2*cos($theta), $y[1]+2*sin($theta),"alpha",'black','center','middle')); + +$xfuncBeta = sub { my $t = shift(); + return $x[1]+cos($t); }; +$yfuncBeta = sub { my $t = shift(); + return $y[0]+sin($t); }; +$fnBeta = new Fun( $xfuncBeta, $yfuncBeta, $picture ); +$fnBeta->domain(pi/2,pi/2+$a); +$theta = pi/2+$a/2; +$picture->lb( new Label($x[1]+2*cos($theta), $y[0]+2*sin($theta),"beta",'black','center','middle')); + + + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[1]+$labelAdjust,"e",'black','center','middle')); + +$picture->lb( new Label($x[1]+$labelAdjust,($y[0]+$y[1])/2,"d",'black','center','middle')); + +$picture->lb( new Label(($x[0]+$x[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,"f",'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[1],$y[1]); +$picture->lineTo($x[1],$y[0], darkblue,3); +$picture->lineTo($x[0],$y[1], darkblue,3); +$picture->lineTo($x[1],$y[1], darkblue,3); + + +$cornersize = 0.5; + +$picture->moveTo($x[1],$y[1]-$cornersize); +$picture->lineTo($x[1]-$cornersize,$y[1]-$cornersize, darkblue,3); +$picture->lineTo($x[1]-$cornersize,$y[1], darkblue,3); + + +$ansSineD = Compute("d/f"); +$ansSineE = Compute("e/f"); +$ansCosineD = Compute("e/f"); +$ansCosineE = Compute("d/f"); +$ansTangentD = Compute("d/e"); +$ansTangentE = Compute("e/d"); + +$text = "This is a right triangle. The right angle is at the top right corner of the picture. Acute angle alpha is at the top left, and acute angle beta is at the bottom right. Angle alpha faces side d; Angle beta faces side e; the right angle faces side f."; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + + +Based on the given figure, find the following values of trigonometric functions. Note that in the graph, "alpha" stands for [`\alpha`], and "beta" stands for [`\beta`]. + + [` \sin \alpha ={}`][_____________]{$ansSineD} + + [` \sin \beta ={}`][_____________]{$ansSineE} + + [` \cos \alpha ={}`][_____________]{$ansCosineD} + + [` \cos \beta ={}`][_____________]{$ansCosineE} + + [` \tan \alpha ={}`][_____________]{$ansTangentD} + + [` \tan \beta ={}`][_____________]{$ansTangentE} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`f`] is the hypotenuse, because it is opposite from right angle. + +For [`\angle \alpha`], side [`d`] is the "opposite leg," because it's opposite to [` \angle \alpha`]; this implies side [`e`] is the "adjacent leg" in terms of [`\angle \alpha`]. + +For [` \angle \beta`], side [`e`] is the "opposite leg," because it's opposite to [`\angle \beta`]; this implies side [`d`] is the "adjacent leg" in terms of [`\angle \beta`]. + +By the above definitions, we have: + + [`` \sin \alpha = \frac{d}{f} ``] + + [`` \sin \beta = \frac{e}{f} ``] + + [`` \cos \alpha = \frac{e}{f} ``] + + [`` \cos \beta = \frac{d}{f} ``] + + [`` \tan \alpha = \frac{d}{e} ``] + + [`` \tan \beta = \frac{e}{d} ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek40.pg new file mode 100644 index 0000000000..65213939ae --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek40.pg @@ -0,0 +1,174 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find right triangle trigonometry ratios. The right angle is at the bottom right. +# Answers are in variables. +# +# Last edited by Carl Yao on 8/1/15 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->variables->are(t=>'Real',s=>'Real',r=>'Real'); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +$base = random(5,17,1); +$height = random(5,17,1); +$hypotenuse = sqrt($base**2+$height**2); +$a = arctan($base/$height); +$b = pi/2-$a; + +@x = (($xmax-$base)/2,($xmax+$base)/2); +@y = (($ymax-$height)/2,($ymax+$height)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +$xfuncAlpha = sub { my $t = shift(); + return $x[0]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $y[0]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain(0,$b); +$theta = $b/2; + +$picture->lb( new Label($x[0]+2*cos($theta), $y[0]+2*sin($theta),"alpha",'black','center','middle')); + +$xfuncBeta = sub { my $t = shift(); + return $x[1]+cos($t); }; +$yfuncBeta = sub { my $t = shift(); + return $y[1]+sin($t); }; +$fnBeta = new Fun( $xfuncBeta, $yfuncBeta, $picture ); +$fnBeta->domain(3*pi/2-$a,3*pi/2); +$theta = 3*pi/2-$a/2; +$picture->lb( new Label($x[1]+2*cos($theta), $y[1]+2*sin($theta),"beta",'black','center','middle')); + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-$labelAdjust,"s",'black','center','middle')); + +$picture->lb( new Label($x[1]+$labelAdjust,($y[0]+$y[1])/2,"r",'black','center','middle')); + +$picture->lb( new Label(($x[0]+$x[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust,"t",'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[1],$y[1]); +$picture->lineTo($x[1],$y[0], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); +$picture->lineTo($x[1],$y[1], darkblue,3); + + +$cornersize = 0.5; + +$picture->moveTo($x[1],$y[0]+$cornersize); +$picture->lineTo($x[1]-$cornersize,$y[0]+$cornersize, darkblue,3); +$picture->lineTo($x[1]-$cornersize,$y[0], darkblue,3); + + +$ansSineR = Compute("r/t"); +$ansSineS = Compute("s/t"); +$ansCosineR = Compute("s/t"); +$ansCosineS = Compute("r/t"); +$ansTangentR = Compute("r/s"); +$ansTangentS = Compute("s/r"); + +$text = "This is a right triangle. The right angle is at the bottom right corner of the picture. Acute angle alpha is at the bottom left, and acute angle beta is at the top right. Angle alpha faces side r; Angle beta faces side s; the right angle faces side t."; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + + +Based on the given figure, find the following values of trigonometric functions. Note that in the graph, "alpha" stands for [`\alpha`], and "beta" stands for [`\beta`]. + + [` \sin \beta ={}`][_____________]{$ansSineS} + + [` \sin \alpha ={}`][_____________]{$ansSineR} + + [` \cos \beta ={}`][_____________]{$ansCosineS} + + [` \cos \alpha ={}`][_____________]{$ansCosineR} + + [` \tan \beta ={}`][_____________]{$ansTangentS} + + [` \tan \alpha ={}`][_____________]{$ansTangentR} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, side [`t`] is the hypotenuse, because it is opposite from right angle. + +For [`\angle \alpha`], side [`r`] is the "opposite leg," because it's opposite to [` \angle \alpha`]; this implies side [`s`] is the "adjacent leg" in terms of [`\angle \alpha`]. + +For [` \angle \beta`], side [`s`] is the "opposite leg," because it's opposite to [`\angle \beta`]; this implies side [`r`] is the "adjacent leg" in terms of [`\angle \beta`]. + +By the above definitions, we have: + + [`` \sin \beta = \frac{s}{t} ``] + + [`` \sin \alpha = \frac{r}{t} ``] + + [`` \cos \beta = \frac{r}{t} ``] + + [`` \cos \alpha = \frac{s}{t} ``] + + [`` \tan \beta = \frac{s}{r} ``] + + [`` \tan \alpha = \frac{r}{s} ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek50.pg new file mode 100644 index 0000000000..2c55464c9e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek50.pg @@ -0,0 +1,259 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find right triangle trigonometry ratios. The right angle could be at any corner. +# Answers are in numbers. +# +# Last edited by Carl Yao on 8/1/15 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +@triples = ([3,4,5],[5,12,13],[8,15,17],[7,24,25]); +$index = random(0,3,1); + +if ($index==0) { + $base = 12; + $height = 15; +} elsif ($index==1) { + $base = 5; + $height = 12; +} elsif ($index==2) { + $base = 8; + $height = 15; +} else { + $base = 3.5; + $height = 12; +} + +$factor = random(2,5,1); +$baseLength = $triples[$index][0]*$factor; +$heightLength = $triples[$index][1]*$factor; +$hypotenuseLength = $triples[$index][2]*$factor; +$a = arctan($base/$height); +$b = pi/2-$a; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = list_random(0..3); + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$a,pi+$a,pi/2+$a,$a); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$b,pi/2-$b,2*pi-$b,3*pi/2-$b); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; +$picture->lb( new Label($labelAx[$corner]+2*cos($theta), $labelAy[$corner]+2*sin($theta),"alpha",'black','center','middle')); + +$xfuncBeta = sub { my $t = shift(); + return $labelBx[$corner]+cos($t); }; +$yfuncBeta = sub { my $t = shift(); + return $labelBy[$corner]+sin($t); }; +$fnBeta = new Fun( $xfuncBeta, $yfuncBeta, $picture ); +$fnBeta->domain($betaCurveStart[$corner],$betaCurveEnd[$corner]); +$theta = ($betaCurveStart[$corner]+$betaCurveEnd[$corner])/2; +$picture->lb( new Label($labelBx[$corner]+2*cos($theta), $labelBy[$corner]+2*sin($theta),"beta",'black','center','middle')); + + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$baseLength,'black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$heightLength,'black','center','middle')); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuseLength,'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = 0.5; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$ansSineA = Fraction($triples[$index][0],$triples[$index][2]); +$ansSineB = Fraction($triples[$index][1],$triples[$index][2]); +$ansCosineA = Fraction($triples[$index][1],$triples[$index][2]); +$ansCosineB = Fraction($triples[$index][0],$triples[$index][2]); +$ansTangentA = Fraction($triples[$index][0],$triples[$index][1]); +$ansTangentB = Fraction($triples[$index][1],$triples[$index][0]); + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. Acute angle alpha is at the $aPosition, and acute angle beta is at the $bPosition. The length of the side facing angle alpha is $baseLength; the length of the side facing angle beta is $heightLength; the length of the side facing the right angle is $hypotenuseLength."; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + + +Based on the given figure, find the following values of trigonometric functions. Note that in the graph, "alpha" stands for [`\alpha`], and "beta" stands for [`\beta`]. + + [` \sin \alpha ={}`][_____________]{$ansSineA} + + [` \sin \beta ={}`][_____________]{$ansSineB} + + [` \cos \alpha ={}`][_____________]{$ansCosineA} + + [` \cos \beta ={}`][_____________]{$ansCosineB} + + [` \tan \alpha ={}`][_____________]{$ansTangentA} + + [` \tan \beta ={}`][_____________]{$ansTangentB} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, the side with the length [`[$hypotenuseLength]`] is the hypotenuse, because it is opposite from right angle. + +For [`\angle \alpha `], the side with the length [`[$baseLength]`] is the "opposite leg," because it's opposite to [`\angle \alpha`]; this implies the side with the length [`[$heightLength]`] is the "adjacent leg" in terms of [`\angle \alpha`]. + +For [`\angle \beta`], the side with the length [`[$heightLength]`] is the "opposite leg," because it's opposite to [`\angle \beta`]; this implies the side with the length [`[$baseLength]`] is the "adjacent leg" in terms of [`\angle \beta`]. + +By the above definitions, we have: + + [`` \sin \alpha = \frac{[$baseLength]}{[$hypotenuseLength]}=[$ansSineA] ``] + + [`` \sin \beta = \frac{[$heightLength]}{[$hypotenuseLength]}= [$ansSineB] ``] + + [`` \cos \alpha = \frac{[$heightLength]}{[$hypotenuseLength]}=[$ansCosineA] ``] + + [`` \cos \beta = \frac{[$baseLength]}{[$hypotenuseLength]}= [$ansCosineB] ``] + + [`` \tan \alpha = \frac{[$baseLength]}{[$heightLength]}= [$ansTangentA] ``] + + [`` \tan \beta = \frac{[$heightLength]}{[$baseLength]}= [$ansTangentB] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek60.pg index 53395272d2..04a5e4ecef 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek60.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek60.pg @@ -10,14 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle','Pythagorean') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -221,7 +225,7 @@ Based on the given figure, find the following values of trigonometric functions. END_PGML ############################################## -$refreshCachedImages = 1; + BEGIN_PGML_SOLUTION First, we need to find the missing side. By the Pythagorean Theorem, we have: diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek70.pg new file mode 100644 index 0000000000..84d995c16c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek70.pg @@ -0,0 +1,277 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find right triangle trigonometry ratios (sine, cosine and tangent). +# First, use Pythagorean Theorem to find missing length in a right triangle. +# The unknown side is a leg. Answers are fractions not involving radicals. +# The right angle could be at any corner. +# +# Last edited by Carl Yao on 8/8/15 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle','Pythagorean') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +@triples = ([3,4,5],[5,12,13],[8,15,17],[7,24,25]); +$index = random(0,3,1); + +if ($index==0) { + $base = 12; + $height = 15; +} elsif ($index==1) { + $base = 5; + $height = 12; +} elsif ($index==2) { + $base = 8; + $height = 15; +} else { + $base = 3.5; + $height = 12; +} + +$factor = random(1,4,1); +$baseLength = $triples[$index][0]*$factor; +$heightLength = $triples[$index][1]*$factor; +$hypotenuseLength = $triples[$index][2]*$factor; +$ans = $heightLength; +$a = arctan($base/$height); +$b = pi/2-$a; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = list_random(0..3); + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$a,pi+$a,pi/2+$a,$a); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$b,pi/2-$b,2*pi-$b,3*pi/2-$b); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0]-$labelAdjust,$y[1]+$labelAdjust,$y[1]+$labelAdjust,$y[0]-$labelAdjust); + +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; +$picture->lb( new Label($labelAx[$corner]+2*cos($theta), $labelAy[$corner]+2*sin($theta),"alpha",'black','center','middle')); + +$xfuncBeta = sub { my $t = shift(); + return $labelBx[$corner]+cos($t); }; +$yfuncBeta = sub { my $t = shift(); + return $labelBy[$corner]+sin($t); }; +$fnBeta = new Fun( $xfuncBeta, $yfuncBeta, $picture ); +$fnBeta->domain($betaCurveStart[$corner],$betaCurveEnd[$corner]); +$theta = ($betaCurveStart[$corner]+$betaCurveEnd[$corner])/2; +$picture->lb( new Label($labelBx[$corner]+2*cos($theta), $labelBy[$corner]+2*sin($theta),"beta",'black','center','middle')); + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$baseLength,'black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],'x','black','center','middle')); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuseLength,'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = 0.5; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. Acute angle alpha is at the $aPosition, and acute angle beta is at the $bPosition. The length of the side facing angle alpha is $baseLength; the length of the side facing angle beta is x (unknown); the length of the side facing the right angle is $hypotenuseLength."; + + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$ansSineA = Fraction($triples[$index][0],$triples[$index][2]); +$ansSineB = Fraction($triples[$index][1],$triples[$index][2]); +$ansCosineA = Fraction($triples[$index][1],$triples[$index][2]); +$ansCosineB = Fraction($triples[$index][0],$triples[$index][2]); +$ansTangentA = Fraction($triples[$index][0],$triples[$index][1]); +$ansTangentB = Fraction($triples[$index][1],$triples[$index][0]); + +Context("Numeric"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + + +Based on the given figure, find the following values of trigonometric functions. Note that in the graph, "alpha" stands for [`\alpha`], and "beta" stands for [`\beta`]. + + [` \sin \alpha ={}`][_____________]{$ansSineA} + + [` \sin \beta ={}`][_____________]{$ansSineB} + + [` \cos \alpha ={}`][_____________]{$ansCosineA} + + [` \cos \beta ={}`][_____________]{$ansCosineB} + + [` \tan \alpha ={}`][_____________]{$ansTangentA} + + [` \tan \beta ={}`][_____________]{$ansTangentB} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +First, we need to find the missing leg's length. By the Pythagorean Theorem, we have: + + [`` +\begin{aligned} + [$baseLength]^{2} +x^{2} &= [$hypotenuseLength]^{2} \\ + [$baseLength**2] +x^{2} &= [$hypotenuseLength**2] \\ + [$baseLength**2] +x^{2} \mathbf{-[$baseLength**2]}&= [$hypotenuseLength**2] \mathbf{-[$baseLength**2]}\\ + x^{2} &= [$hypotenuseLength**2-$baseLength**2] \\ + x &= \sqrt{[$hypotenuseLength**2-$baseLength**2]} \\ + x &= [$ans] +\end{aligned} + ``] + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +In the given triangle, the longest side (facing the right angle) is the hypotenuse. In other words, the side with the length [`[$hypotenuseLength]`] is the hypotenuse, because it is opposite from right angle. + +For [`\angle \alpha `], the side with the length [`[$baseLength]`] is the "opposite leg," because it's opposite to [`\angle \alpha`]; this implies the side with the length [`[$heightLength]`] is the "adjacent leg" in terms of [`\angle \alpha`]. + +For [`\angle \beta`], the side with the length [`[$heightLength]`] is the "opposite leg," because it's opposite to [`\angle \beta`]; this implies the side with the length [`[$baseLength]`] is the "adjacent leg" in terms of [`\angle \beta`]. + +By the above definitions, we have: + + [`` \sin \alpha = \frac{[$baseLength]}{[$hypotenuseLength]}=[$ansSineA] ``] + + [`` \sin \beta = \frac{[$heightLength]}{[$hypotenuseLength]}= [$ansSineB] ``] + + [`` \cos \alpha = \frac{[$heightLength]}{[$hypotenuseLength]}=[$ansCosineA] ``] + + [`` \cos \beta = \frac{[$baseLength]}{[$hypotenuseLength]}= [$ansCosineB] ``] + + [`` \tan \alpha = \frac{[$baseLength]}{[$heightLength]}= [$ansTangentA] ``] + + [`` \tan \beta = \frac{[$heightLength]}{[$baseLength]}= [$ansTangentB] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek80.pg index f926a734e6..24893d1a6d 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek80.pg @@ -11,14 +11,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('Pythagorean','right triangle','radical','simplify','square root','rationalize','denominator','sine','cosine','tangent','trigonometry') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -337,7 +341,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. Acute angle alpha is at the $aPosition, and acute angle beta is at the $bPosition. The length of the side facing angle alpha is $base; the length of the side facing angle beta is $height; the length of the side facing the right angle is x (unknown)."; ############################################## -$refreshCachedImages = 1; + BEGIN_PGML diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek90.pg index 407d85383b..728eb9582b 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/Trigonometry/RightTriangleTrigDefinitionGreek90.pg @@ -11,14 +11,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3') -## DBsubject(Trigonometry) -## DBchapter(Triangle trigonometry) -## DBsection(Sine, cosine, and tangent of an angle in a right triangle) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('Pythagorean','right triangle','radical','simplify','square root','rationalize','denominator','sine','cosine','tangent','trigonometry') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') ############################################## @@ -342,7 +346,7 @@ if ($corner==0) { $text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. Acute angle alpha is at the $aPosition, and acute angle beta is at the $bPosition. The length of the side facing angle alpha is $base; the length of the side facing angle beta is x (unknown); the length of the side facing the right angle is $hypotenuse."; ############################################## -$refreshCachedImages = 1; + TEXT(beginproblem()); diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication10.pg new file mode 100644 index 0000000000..ceb7592a3b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication10.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Determine if a given number is a solution to an equation in application context. +# +# Last edited: Yao 4/24/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +$base = random(10,20,1); +do {$height = random(10,20,1);} until ($base!=$height); +$area = $base*$height/2; + +$var = 'b'; + +$left = Compute("$area")->reduce; +$right = "\frac{1}{2}($var)($height)"; + +#A proposed solution +$x = list_random($base,$base*2); + +$isString = "Yes"; +$notString = "No"; + +$solution = $base; +if ($x==$solution) {$corString = $isString} else {$corString = $notString}; + +$popup = PopUp( + ['?',$isString,$notString], + $corString, + last => [$notString], +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A triangle's area is [`[$area]`] square meters. Its height is [`[$height]`] meters. Suppose we wanted to find how long is the triangle's base. A triangle's area formula is + + [```A=\frac{1}{2}bh```] + +where [`A`] stands for area, [`b`] for base and [`h`] for height. If we let [`[$var]`] be the triangle's base, in meters, we can solve this problem using the equation: + + [```[$left]=[$right]```] + +Check whether [`[$x]`] is a solution for [`[$var]`] of this equation. [__]{$popup} + +END_PGML + +############################################## + +$s1 = $height*$x/2; + +if ($x == $solution) { + $solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the triangle'."\'".'s base is [`[$x]`] meters.'; +} +else { + $solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the triangle'."\'".'s base _is not_ [`[$x]`] meters.'; +} + +############################################## + +BEGIN_PGML_SOLUTION + +We check to see if [`[$x]`] is a solution for [`[$var]`] by evaluating each side of the equation with [`[$var]=[$x]`]. + + [``\begin{aligned} + [$left]&=[$right] \\ + [$left] &\stackrel{?}{=} \frac{1}{2}([$x])([$height])\\ + [$left] &\stackrel{?}{=} [$s1] + \end{aligned} + ``] + +[$solnString]** + +[$output]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication20.pg new file mode 100644 index 0000000000..e13f3fc977 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication20.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Determine if a given number is a solution to an equation in application context. +# +# Last edited: Yao 4/24/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +$height = random(10,20,1); +$radius = random(3,9,1); +$volume = $radius**2*$height; + +$var = 'r'; + +$left = "$volume \pi"; +$right = "\pi $var^2($height)"; + +#A proposed solution +$x = list_random($radius,$radius**2); + +$isString = "Yes"; +$notString = "No"; + +$solution = $radius; +if ($x==$solution) {$corString = $isString} else {$corString = $notString}; + +$popup = PopUp( + ['?',$isString,$notString], + $corString, + last => [$notString], +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A cylinder's volume is [`[$volume]\pi`] cubic centimeters. Its height is [`[$height]`] centimeters. Suppose we wanted to find how long is the cylinder's radius. A cylinder's volume formula is + + [```V=\pi r^2h```] + +where [`V`] stands for volume, [`r`] for radius and [`h`] for height. Let [`[$var]`] represent the cylinder's radius, in centimeters. We can solve this problem using the equation: + + [```[$left]=[$right]```] + +Check whether [`[$x]`] is a solution for [`[$var]`] of this equation. [__]{$popup} + +END_PGML + +############################################## + + + +$s1 = $x**2*$height; + +if ($x == $solution) { + $solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the cylinder'."\'".'s radius is [`[$x]`] centimeters.'; +} +else { + $solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the cylinder'."\'".'s radius _is not_ [`[$x]`] centimeters.'; +} + +############################################## + +BEGIN_PGML_SOLUTION + +We check to see if [`[$x]`] is a solution for [`[$var]`] by evaluating each side of the equation with [`[$var]=[$x]`]. + + [``\begin{aligned} + [$left] &= [$right] \\ + [$left] &\stackrel{?}{=} \pi ([$x])^2([$height]) \\ + [$left] &\stackrel{?}{=} [$s1]\pi \\ + \end{aligned} + ``] + +[$solnString]** + +[$output]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication30.pg new file mode 100644 index 0000000000..85c6b1c26b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication30.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Determine if a given number is a solution to an equation in application context. +# +# Last edited: Yao 4/24/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +$length = random(2,3,0.1); +$width = random(1,$length-0.5,0.1); +$perimeter = 2*($length+$width); + +$var = 'w'; + +$left = "$perimeter"; +$right = "2($length+w)"; + +#A proposed solution +$x = list_random($width,$perimeter-$length); +$solution = $width; + +$isString = "Yes"; +$notString = "No"; +if ($x==$solution) {$corString = $isString} else {$corString = $notString}; + +$popup = PopUp( + ['?',$isString,$notString], + $corString, + last => [$notString], +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A rectangular frame's perimeter is [`[$perimeter]`] feet. If its length is [`[$length]`] feet, suppose we want to find how long is its width. A rectangle's perimeter formula is + + [```P=2(l+w)```] + +where [`P`] stands for perimeter, [`l`] for length and [`w`] for width. We can solve this problem using the equation: + + [```[$left]=[$right]```] + +Check whether [`[$x]`] is a solution for [`[$var]`] of this equation. [__]{$popup} + +END_PGML + +############################################## + + + +$s1 = 2*($length+$x); + +if ($x == $solution) { + $solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the rectangle'."\'".'s width is [`[$x]`] feet.'; +} +else { + $solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the rectangle'."\'".'s width _is not_ [`[$x]`] feet.'; +} + +############################################## + +BEGIN_PGML_SOLUTION + +We check to see if [`[$x]`] is a solution for [`[$var]`] by evaluating each side of the equation with [`[$var]=[$x]`]. + + [``\begin{aligned} + [$left]&=[$right] \\ + [$left] &\stackrel{?}{=} 2([$length]+[$width]) \\ + [$left] &\stackrel{?}{=} [$s1] + \end{aligned} + ``] + +[$solnString]** + +[$output]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication40.pg new file mode 100644 index 0000000000..21a54f9762 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication40.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Determine if a given number is a solution to an equation in application context. +# +# Last edited: Yao 4/24/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +$rate = random(0.2,1,0.1); +$yInt = random(1,3,0.1); +$x1 = random(10,20,1); +$y1 = $rate*$x1+$yInt; + +$var = 'd'; + +$left = "$rate d+$yInt"; +$right = "$y1"; + +#A proposed solution +$x = list_random($x1,$x1+random(1,3,1)); +$solution = $x1; + +$isString = "Yes"; +$notString = "No"; +if ($x==$solution) {$corString = $isString} else {$corString = $notString}; + +$popup = PopUp( + ['?',$isString,$notString], + $corString, + last => [$notString], +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +When a plant was purchased, it was [`[$yInt]`] inches tall. It grows [`[$rate]`] inches per day. How many days later will the plant be [`[$y1]`] inches tall? + +Assume the plant will be [`[$y1]`] inches tall [`[$var]`] days later. We can solve this problem using the equation: + + [```[$left]=[$right]```] + +Check whether [`[$x]`] is a solution for [`[$var]`] of this equation. [__]{$popup} + +END_PGML + +############################################## + + + +$s1 = $rate*$x+$yInt; + +if ($x == $solution) { + $solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the plant will be [`[$y1]`] inches tall [`[$x]`] days later.'; +} +else { + $solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the plant _will not_ be [`[$y1]`] inches tall [`[$x]`] days later'; +} + +############################################## + +BEGIN_PGML_SOLUTION + +We check to see if [`[$x]`] is a solution for [`[$var]`] by evaluating each side of the equation with [`[$var]=[$x]`]. + + [``\begin{aligned} + [$left]&=[$right] \\ + [$rate]([$x])+[$yInt] &\stackrel{?}{=} [$y1] \\ + [$s1] &\stackrel{?}{=} [$y1] + \end{aligned} + ``] + +[$solnString]** + +[$output]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication50.pg new file mode 100644 index 0000000000..ac88b65059 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication50.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Determine if a given number is a solution to an equation in application context. +# +# Last edited: Yao 4/24/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +$rate = random(5,20,1); +$x1 = random(10,20,1); +$y1 = random(30,50,1); +$yInt = $x1*$rate+$y1; + +$var = 'm'; + +$left = "$yInt-$rate m"; +$right = "$y1"; + +#A proposed solution +$x = list_random($x1,$x1+random(1,3,1)); +$solution = $x1; + +$isString = "Yes"; +$notString = "No"; +if ($x==$solution) {$corString = $isString} else {$corString = $notString}; + +$popup = PopUp( + ['?',$isString,$notString], + $corString, + last => [$notString], +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A water tank has [`[$yInt]`] gallons of water in it, and it is being drained at the rate of [`[$rate]`] gallons per minute. After how many minutes will there be [`[$y1]`] gallons of water left? + +Assume the tank will have [`[$y1]`] gallons of water after [`m`] minutes. We can solve this problem using the equation: + + [```[$left]=[$right]```] + +Check whether [`[$x]`] is a solution for [`[$var]`] of this equation. [__]{$popup} + +END_PGML + +############################################## + + + +$s1 = -$rate*$x+$yInt; + +if ($x == $solution) { + $solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the tank will have [`[$y1]`] gallons of water after [`[$x]`] minutes.'; +} +else { + $solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the tank _will not_ have [`[$y1]`] gallons of water after [`[$x]`] minutes.'; +} + +############################################## + +BEGIN_PGML_SOLUTION + +We check to see if [`[$x]`] is a solution for [`[$var]`] by evaluating each side of the equation with [`[$var]=[$x]`]. + + [``\begin{aligned} + [$left]&=[$right] \\ + [$yInt]-[$rate]([$x]) &\stackrel{?}{=} [$y1] \\ + [$s1] &\stackrel{?}{=} [$y1] + \end{aligned} + ``] + +[$solnString]** + +[$output]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication60.pg new file mode 100644 index 0000000000..ca461050f5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication60.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Determine if a given number is a solution to an equation in application context. +# +# Last edited: Yao 4/24/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +$rate = random(20,70,10); +$yInt = random(100,200,10); +$x1 = random(10,30,1); +$y1 = $rate*$x1+$yInt; + +$var = 'y'; + +$left = "$rate y+$yInt"; +$right = "$y1"; + +#A proposed solution +$x = list_random($x1,$x1+random(1,3,1)*random(-1,1,2)); +$solution = $x1; +$year = 2010+$x; + +$isString = "Yes"; +$notString = "No"; +if ($x==$solution) {$corString = $isString} else {$corString = $notString}; + +$popup = PopUp( + ['?',$isString,$notString], + $corString, + last => [$notString], +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A country's national debt was [`[$yInt]`] million dollars in 2010. The debt increased at [`[$rate]`] million dollars per year. If this trend continues, when will the country's national debt increase to [`[$y1]`] million dollars? + +Assume the country's national debt will become [`[$y1]`] million dollars [`y`] years after 2010. We can solve this problem using the equation: + + [```[$left]=[$right]```] + +Check whether [`[$x]`] is a solution for [`[$var]`] of this equation. [__]{$popup} + +END_PGML + +############################################## + + + +$s1 = $rate*$x+$yInt; + +if ($x == $solution) { + $solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the country'."\'".'s national debt will become [`[$y1]`] million dollars in the year [$year].'; +} +else { + $solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies the country'."\'".'s national debt _will not_ become [`[$y1]`] million dollars in the year [$year].'; +} + +############################################## + +BEGIN_PGML_SOLUTION + +We check to see if [`[$x]`] is a solution for [`[$var]`] by evaluating each side of the equation with [`[$var]=[$x]`]. + + [``\begin{aligned} + [$left]&=[$right] \\ + [$rate]([$x])+[$yInt] &\stackrel{?}{=} [$y1] \\ + [$s1] &\stackrel{?}{=} [$y1] + \end{aligned} + ``] + +[$solnString]** + +[$output]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication70.pg new file mode 100644 index 0000000000..969e294125 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication70.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Determine if a given number is a solution to an equation in application context. +# +# Last edited: Yao 4/24/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +$rate = random(2,3,0.1); +$x1 = random(5,10,1); +$y1 = random(10,15,1); +$yInt = $x1*$rate+$y1; + +$var = 'y'; + +$left = "$yInt-$rate $var"; +$right = "$y1"; + +#A proposed solution +$x = list_random($x1,$x1+random(1,3,1)); +$solution = $x1; + +$isString = "Yes"; +$notString = "No"; +if ($x==$solution) {$corString = $isString} else {$corString = $notString}; + +$popup = PopUp( + ['?',$isString,$notString], + $corString, + last => [$notString], +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A school district has a reserve fund worth [`[$yInt]`] million dollars. It plans to spend [`[$rate]`] million dollars per year. After how many years, will there be [`[$y1]`] million dollars left? + +Assume there will be [`[$y1]`] million dollars left after [`y`] years. We can solve this problem using the equation: + + [```[$left]=[$right]```] + +Check whether [`[$x]`] is a solution for [`[$var]`] of this equation. [__]{$popup} + +END_PGML + +############################################## + + + +$s1 = -$rate*$x+$yInt; + +if ($x == $solution) { + $solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies there will be [`[$y1]`] million dollars left after [`[$x]`] years.'; +} +else { + $solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'; + $output = 'This implies there _will not_ be [`[$y1]`] million dollars left after [`[$x]`] years.'; +} + +############################################## + +BEGIN_PGML_SOLUTION + +We check to see if [`[$x]`] is a solution for [`[$var]`] by evaluating each side of the equation with [`[$var]=[$x]`]. + + [``\begin{aligned} + [$left]&=[$right] \\ + [$yInt]-[$rate]([$x]) &\stackrel{?}{=} [$y1] \\ + [$s1] &\stackrel{?}{=} [$y1] + \end{aligned} + ``] + +[$solnString]** + +[$output]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ10.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ10.pg new file mode 100644 index 0000000000..0a6845a3aa --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ10.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Determine if a given number is a solution to an equation +# of the form x + b = c +# +# Last edited: Jordan 6/11/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +#An actual solution +$sol = non_zero_random(-10,10,1); + +#The components of the equation +$b = non_zero_random(-10,10,1); +$func = Compute("x+$b")->reduce; +$c = $func->eval(x=>$sol); + +#A proposed solution +$x = list_random($sol,$sol,$sol,$sol+1,$sol-1,-$sol); + +$isString = "Yes"; +$notString = "No"; + +if ($x==$sol) {$corString = $isString} else {$corString = $notString}; + +$popup = PopUp( + ['?',$isString,$notString], + $corString, + last => [$notString], +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Is [`[$x]`] a solution for [`x`] in the equation [`[$func] = [$c]`]? [__]{$popup} + +END_PGML + +############################################## + + + +if ($x == $sol) {$solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`x`] in the equation [`[$func] = [$c]`].'} +else {$solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`x`] in the equation [`[$func] = [$c]`].'} + +BEGIN_PGML_SOLUTION +We check to see if [`[$x]`] a solution by evaluating each side of the equation with [`x=[$x]`]. + + [`\begin{aligned} + [$func] &\stackrel{?}{=} [$c] \\ + ([$x])+[$b] &\stackrel{?}{=} [$c]\\ + [$x+$b] &\stackrel{?}{=} [$c] + \end{aligned} + `] + +[$solnString]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ20.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ20.pg index 145a223675..7ac06f66d1 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ20.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.5') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Solving linear equations in one variable) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(check_sol_1var) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,9 +32,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserRadioButtons.pl", + "parserPopUp.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -58,8 +60,8 @@ $notString = "No"; if ($x==$sol) {$corString = $isString} else {$corString = $notString}; -$radio = RadioButtons( - [$isString,$notString], +$popup = PopUp( + ['?',$isString,$notString], $corString, last => [$notString], ); @@ -70,25 +72,15 @@ TEXT(beginproblem()); BEGIN_PGML -Is [`[$x]`] a solution for [`[$myvar]`] in the equation [`[$func] = [$c]`]? +Is [`[$x]`] a solution for [`[$myvar]`] in the equation [`[$func] = [$c]`]? [__]{$popup} END_PGML -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} - -END_TEXT - - - - - ############################################## -ANS( $radio->cmp() ); + if ($x == $sol) {$solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$myvar]`] in the equation [`[$func] = [$c]`].'} else {$solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$myvar]`] in the equation [`[$func] = [$c]`].'} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ30.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ30.pg index 0383790ec6..2f8a1a5e98 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ30.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ30.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.5') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Solving linear equations in one variable) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(check_sol_1var) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,9 +32,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserRadioButtons.pl", + "parserPopUp.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -59,8 +61,8 @@ $notString = "No"; if ($x==$sol) {$corString = $isString} else {$corString = $notString}; -$radio = RadioButtons( - [$isString,$notString], +$popup = PopUp( + ['?',$isString,$notString], $corString, last => [$notString], ); @@ -71,25 +73,16 @@ TEXT(beginproblem()); BEGIN_PGML -Is [`[$x]`] a solution for [`[$myvar]`] in the equation [`[$func] = [$c]`]? +Is [`[$x]`] a solution for [`[$myvar]`] in the equation [`[$func] = [$c]`]? [__]{$popup} END_PGML -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} - -END_TEXT - - - - ############################################## -ANS( $radio->cmp() ); + if ($x == $sol) {$solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$myvar]`] in the equation [`[$func] = [$c]`].'} else {$solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$myvar]`] in the equation [`[$func] = [$c]`].'} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ40.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ40.pg index 4caa85c106..a6a3d25da2 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ40.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ40.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.5') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Solving linear equations in one variable) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(check_sol_1var) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,9 +32,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserRadioButtons.pl", + "parserPopUp.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,8 +66,8 @@ $notString = "No"; if ($x==$sol) {$corString = $isString} else {$corString = $notString}; -$radio = RadioButtons( - [$isString,$notString], +$popup = PopUp( + ['?',$isString,$notString], $corString, last => [$notString], ); @@ -76,25 +78,18 @@ TEXT(beginproblem()); BEGIN_PGML -Is [`[$x]`] a solution for [`[$myvar]`] in the equation [`[$left] = [$right]`]? +Is [`[$x]`] a solution for [`[$myvar]`] in the equation [`[$left] = [$right]`]? [__]{$popup} END_PGML -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} - -END_TEXT - - ############################################## -ANS( $radio->cmp() ); + if ($x == $sol) {$solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$myvar]`] in the equation [`[$left] = [$right]`].'} else {$solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$myvar]`] in the equation [`[$left] = [$right]`].'} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ50.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ50.pg new file mode 100644 index 0000000000..926634593a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ50.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Determine if a given number is a solution to an equation +# of the form a ($myvar + b) = c $myvar +# +# Last edited: Jordan 6/11/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$myvar = RandomVariableName(type=>variable); +Context("Numeric"); +Context()->variables->are($myvar=>'Real'); +Context()->noreduce('(-x)+y','(-x)-y'); + +#An actual solution +$sol = random(-1,1,2)*random(2,10,1); + +#The components of the equation +$b = 1; +while (gcd($b,$sol+$b) == min(abs($b),abs($sol+$b)) or min(abs($b),abs($sol+$b)) == 0) +{$b = $sol + random(2,10,1)*random(-1,1,2);} + +$a = lcm($sol+$b,$sol)/($sol+$b); +$left = Compute("$a ($myvar+$b)")->reduce; +$c = lcm($sol+$b,$sol)/($sol); +$right = Compute("$c $myvar")->reduce; + + +#A proposed solution +$x = list_random($sol,$sol,$sol,$sol+1,$sol-1,-$sol); + +$isString = "Yes"; +$notString = "No"; + +if ($x==$sol) {$corString = $isString} else {$corString = $notString}; + +$popup = PopUp( + ['?',$isString,$notString], + $corString, + last => [$notString], +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Is [`[$x]`] a solution for [`[$myvar]`] in the equation [`[$left] = [$right]`]? [__]{$popup} + +END_PGML + + + + + +############################################## + + + +if ($x == $sol) {$solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$myvar]`] in the equation [`[$left] = [$right]`].'} +else {$solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$myvar]`] in the equation [`[$left] = [$right]`].'} + +BEGIN_PGML_SOLUTION +We check to see if [`[$x]`] a solution by evaluating each side of the equation with [`[$myvar]=[$x]`]. + + [`\begin{aligned} + [$left] &\stackrel{?}{=} [$right] \\ + [$a][([$x])+[$b]] &\stackrel{?}{=} [$c]([$x])\\ + [$a][[$x]+[$b]] &\stackrel{?}{=} [$c]([$x])\\ + [$a*($x+$b)] &\stackrel{?}{=} [$c*$x] + \end{aligned} + `] + +[$solnString]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ60.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ60.pg new file mode 100644 index 0000000000..4bf90e4194 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ60.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Determine if a given number is a solution to an equation +# of the form a ($myvar + b) = c ($myvar +d) +# +# Last edited: Jordan 6/11/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('solution','equation','integer') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$myvar = RandomVariableName(type=>variable); +Context("Numeric"); +Context()->variables->are($myvar=>'Real'); +Context()->noreduce('(-x)+y','(-x)-y'); + +#An actual solution +$sol = non_zero_random(-10,10,1); + +#The components of the equation +$d = non_zero_random(-10,10,1); +$b = 1; +while (gcd($sol+$d,$sol+$b) == min(abs($sol+$d),abs($sol+$b)) or min(abs($b),abs($sol+$d),abs($sol+$b)) == 0) +{$b = $sol + random(2,10,1)*random(-1,1,2); +$d = non_zero_random(-10,10,1);} + +$a = lcm($sol+$b,$sol+$d)/($sol+$b); +$left = Compute("$a ($myvar+$b)")->reduce; +$c = lcm($sol+$b,$sol+$d)/($sol+$d); +$right = Compute("$c ($myvar+$d)")->reduce; + + +#A proposed solution +$x = list_random($sol,$sol,$sol,$sol+1,$sol-1,-$sol); + +$isString = "Yes"; +$notString = "No"; + +if ($x==$sol) {$corString = $isString} else {$corString = $notString}; + +$popup = PopUp( + ['?',$isString,$notString], + $corString, + last => [$notString], +); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Is [`[$x]`] a solution for [`[$myvar]`] in the equation [`[$left] = [$right]`]? [__]{$popup} + +END_PGML + + + + + +############################################## + + + +if ($x == $sol) {$solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$myvar]`] in the equation [`[$left] = [$right]`].'} +else {$solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$myvar]`] in the equation [`[$left] = [$right]`].'} + +BEGIN_PGML_SOLUTION +We check to see if [`[$x]`] a solution by evaluating each side of the equation with [`[$myvar]=[$x]`]. + + [`\begin{aligned} + [$left] &\stackrel{?}{=} [$right] \\ + [$a][([$x])+[$b]] &\stackrel{?}{=} [$c][([$x])+[$d]]\\ + [$a][[$x+$b]] &\stackrel{?}{=} [$c][[$x+$d]]\\ + [$a*($x+$b)] &\stackrel{?}{=} [$c*($x+$d)] + \end{aligned} + `] + +[$solnString]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ70.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ70.pg index 3f898dca7c..4f4bba7be5 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ70.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ70.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.5') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Solving linear equations in one variable) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(check_sol_1var) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solution','equation','fraction') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -30,9 +32,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserRadioButtons.pl", + "parserPopUp.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,8 +62,8 @@ $notString = "No"; if ($x==$sol) {$corString = $isString} else {$corString = $notString}; -$radio = RadioButtons( - [$isString,$notString], +$popup = PopUp( + ['?',$isString,$notString], $corString, last => [$notString], ); @@ -72,25 +74,16 @@ TEXT(beginproblem()); BEGIN_PGML -Is [`[$x]`] a solution for [`x`] in the equation [`[$func] = [$c]`]? +Is [`[$x]`] a solution for [`x`] in the equation [`[$func] = [$c]`]? [__]{$popup} END_PGML -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} - -END_TEXT - - - - ############################################## -ANS( $radio->cmp() ); + if ($x == $sol) {$solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`x`] in the equation [`[$func] = [$c]`].'} else {$solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`x`] in the equation [`[$func] = [$c]`].'} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ80.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ80.pg index fb4ce88013..9d977d34e9 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ80.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ80.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.5') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Solving linear equations in one variable) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(check_sol_1var) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solution','equation','fraction') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -29,10 +31,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserRadioButtons.pl", + "parserPopUp.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -70,8 +72,8 @@ $notString = "No"; if ($x==$sol) {$corString = $isString} else {$corString = $notString}; -$radio = RadioButtons( - [$isString,$notString], +$popup = PopUp( + ['?',$isString,$notString], $corString, last => [$notString], ); @@ -82,20 +84,13 @@ TEXT(beginproblem()); BEGIN_PGML -Is [`[$x]`] a solution for [`[$var]`] in the equation [`[$left] = [$right]`]? +Is [`[$x]`] a solution for [`[$var]`] in the equation [`[$left] = [$right]`]? [__]{$popup} END_PGML - -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} - -END_TEXT - ############################################## -ANS( $radio->cmp() ); + if ($x == $sol) {$solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'} else {$solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'} diff --git a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ90.pg b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ90.pg index 025f8063b8..48f565b13c 100644 --- a/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ90.pg +++ b/OpenProblemLibrary/PCC/BasicAlgebra/VerifySolutionsOneVariable/solutionQ90.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.5') -## DBsubject(Algebra) -## DBchapter(Algebra of real numbers and simplifying expressions) -## DBsection(Solving linear equations in one variable) -## Institution(PCC) -## Author(Alex Jordan, Carl Yao, Chris Hughes) -## MLT(check_sol_1var) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('solution','equation','fraction') +## DBCCSS('6.EE.5') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') @@ -29,10 +31,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "parserRadioButtons.pl", + "parserPopUp.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -74,8 +76,8 @@ $notString = "No"; if ($x==$sol) {$corString = $isString} else {$corString = $notString}; -$radio = RadioButtons( - [$isString,$notString], +$popup = PopUp( + ['?',$isString,$notString], $corString, last => [$notString], ); @@ -86,20 +88,13 @@ TEXT(beginproblem()); BEGIN_PGML -Is [`[$x]`] a solution for [`[$var]`] in the equation [`[$left] = [$right]`]? +Is [`[$x]`] a solution for [`[$var]`] in the equation [`[$left] = [$right]`]? [__]{$popup} END_PGML - -BEGIN_TEXT -$PAR -\{ $radio->buttons() \} - -END_TEXT - ############################################## -ANS( $radio->cmp() ); + if ($x == $sol) {$solnString = 'Since this is a true equation, [`[$x]`] _is_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'} else {$solnString = 'Since this is a false equation, [`[$x]`] _is not_ a solution for [`[$var]`] in the equation [`[$left] = [$right]`].'} diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Addition10.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Addition10.pg new file mode 100644 index 0000000000..9b5b8f5aea --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Addition10.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Basic addition problems +# +# Last updated: Yao, 09/27/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('evaluate','divide','zero') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + $num11 = random(11,80,1); + $num12 = random(1,9,1); + $ans1 = $num11+$num12; +} until (int($ans1/10)==int($num11/10)); + +do { + $num21 = random(11,80,1); + $num22 = random(1,9,1); + $ans2 = $num21+$num22; +} until (int($ans2/10)!=int($num21/10)); + +do { + $num31 = random(11,80,1); + $num32 = random(11,80,1); + $ans3 = $num31+$num32; +} until ( (int($num31/10)+int($num32/10)==int($ans3/10)) && ($ans3<100) ); + +do { + $num41 = random(11,80,1); + $num42 = random(11,80,1); + $ans4 = $num41+$num42; +} until ( (int($num41/10)+int($num42/10)!=int($ans4/10)) && ($ans4<100) ); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Do the following additions without using a calculator. + +a. [`` [$num11] + [$num12] = ``] [________]{$ans1} + +a. [`` [$num21] + [$num22] = ``] [________]{$ans2} + +a. [`` [$num31] + [$num32] = ``] [________]{$ans3} + +a. [`` [$num41] + [$num42] = ``] [________]{$ans4} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + +a. [`` [$num11] + [$num12] = [$ans1] ``] + +a. [`` [$num21] + [$num22] = [$ans2] ``] + +a. [`` [$num31] + [$num32] = [$ans3] ``] + +a. [`` [$num41] + [$num42] = [$ans4] ``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Addition20.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Addition20.pg new file mode 100644 index 0000000000..a385655b40 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Addition20.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Basic addition problems +# +# Last updated: Yao, 09/27/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('evaluate','divide','zero') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +@a = ( ); +@b = ( ); + +$num11 = 0; +$num12 = 0; +for (my $i=0; $i<3; $i++) { + do { + $a[$i] = random(0,9,1); + $b[$i] = random(0,9,1); + } until ($a[$i]+$b[$i]<10); + $num11 += $a[$i]*10**$i; + $num12 += $b[$i]*10**$i; +} +$ans1 = $num11+$num12; + +do { + $num21 = random(101,999,1); + $num22 = random(101,999,1); + $ans2 = $num21+$num22; +} until ($ans2>1000); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Do the following additions without using a calculator. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"",header=>"CH"},], +["\( $num11\)","\( $num21\)"], +["\( \underline{+$num12} \)","\( \underline{+$num22} \)"], +[ans_rule(1),ans_rule(1)], +], allcellcss=>"border:0px solid;", align=>rr); +\} + +$PAR +END_TEXT +Context()->normalStrings; + +ANS( Compute("$ans1") -> cmp); +ANS( Compute("$ans2") -> cmp); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION + +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"",header=>"CH"},], +["\( $num11\)","\( $num21\)"], +["\( \underline{+$num12} \)","\( \underline{+$num22} \)"], +["\( $ans1 \)","\( $ans2 \)"], +], tablecss=>"border:0px solid;", align=>rr); +\} + +$PAR +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications10.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications10.pg index eb6143ae26..16b9ba4c24 100644 --- a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications20.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications20.pg index 3247191915..8795f9b2f6 100644 --- a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications20.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications30.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications30.pg index 9bc1bde362..63bc71c78b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications30.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications40.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications40.pg new file mode 100644 index 0000000000..ded25b72d6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications40.pg @@ -0,0 +1,164 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a pie chart, do addition/subtraction problems. +# +# Last edited by Carl Yao on 09/29/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') +## KEYWORDS('fraction','graph','application','pie chart') +## DBCCSS('3.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +TEXT(beginproblem()); +$refreshCachedImages = 1; +Context("LimitedFraction"); + +@den=(); @num=();@frac=();@per=(); + +$num[0]=0;$den[0]=1;$frac[0]=0; + +do { + for my $i (1..3) { + $den[$i] = list_random(4,5,8,10,20,25); + do {$num[$i] = random(1,int($den[$i]/2),1);} until (gcd($num[$i],$den[$i])==1); + $frac[$i] = Fraction($num[$i],$den[$i]); + $per[$i] = $num[$i]/$den[$i]*100; + } + + $frac[4] = 1-$frac[1]-$frac[2]-$frac[3]; + ($num[4],$den[4]) = $frac[4]->value; + $per[4] = $num[4]/$den[4]*100; + + $flag1 = 0; + for my $i (1..4) { + if (int($per[$i])!=$per[$i]) {$flag1=1;} + } + $flag2 = 0; + my %seen; + foreach my $string (@per) { + next unless $seen{$string}++; + $flag2 = 1; + } +} until ( ($frac[4]>0) && ($den[4]<25) && ($den[1]<$den[2]) && ($flag1==0) && ($flag2==0) && ($per[4]<50) ); + +$scale = 2; +$downshift = -0.4; +$radius = 1; +$gr = init_graph(-$scale,-$scale,$scale,$scale, +size=>[400,400] +); + +$title = "School Population Breakdown by Race"; +$gr->lb( new Label(0, $scale/1.5,$title,'black','center','middle')); + +$xfunc = sub { my $t = shift(); + return $radius*cos($t); }; +$yfunc = sub { my $t = shift(); + return $radius*sin($t)+$downshift; }; +$circle = new Fun( $xfunc, $yfunc, $gr ); +$circle->domain(0,6.2832); + +$gr->new_color("color0", 250,250,210); +$gr->new_color("color1", 255,255,0); +$gr->new_color("color2", 255,218,185); +$gr->new_color("color3", 173,255,47); +@color=("color0","color1","color2","color3"); + +@legend=("White","Black","Hispanic","others"); + +@fracCumulative = (); +$fracCumulative[0] = 0; +$fracTemp=0; + +for my $i (1..4) { + $fracTemp = $fracTemp + $frac[$i]; + $fracCumulative[$i] = $fracTemp; +} + +for my $i (0..3) { + $end0x = $radius*cos($fracCumulative[$i]*2*pi); + $end0y = $radius*sin($fracCumulative[$i]*2*pi)+$downshift; + $end1x = $radius*cos($fracCumulative[$i+1]*2*pi); + $end1y = $radius*sin($fracCumulative[$i+1]*2*pi)+$downshift; + $end2x = $radius/2*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); + $end2y = $radius/2*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; + $end3x = 1.3*$radius*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); + $end3y = 1.3*$radius*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; + + $gr->moveTo(0,0+$downshift); + $gr->lineTo($end0x,$end0y,'blue',1); + $gr->moveTo(0,0+$downshift); + $gr->lineTo($end1x,$end1y,'blue',1); + $gr->fillRegion([$end2x,$end2y,$color[$i]]); + + $gr->lb( new Label($end2x, $end2y,"$per[$i+1]%",'black','center','middle')); + $gr->lb( new Label($end3x, $end3y,$legend[$i],'black','center','middle')); +} + +$ans = $per[1]+$per[2]+$per[3]-$per[4]; +$ans = Compute($ans); + +$alt = "This is a pie chart about a school population breakdown by race. The school has $per[1]% $legend[0] students, $per[2]% $legend[1] students, $per[3]% $legend[2] students and $per[4]% students of other races."; + +############################################## + +BEGIN_PGML + +>>[@image( insertGraph($gr), width=>400, + height=>400, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< + +The pie chart represents a school's student population. Fill in the blank. + +The school's white, black and Hispanic students, altogether, have [__________]{$ans}[`%`] more students than students of other races. + +END_PGML + +############################################## + +$per1 = $per[1]; +$per2 = $per[2]; +$per3 = $per[3]; +$per4 = $per[4]; +$s1 = $per1+$per2+$per3; + +BEGIN_PGML_SOLUTION + +By the pie chart, the school has [`[$per1]%`] white students, [`[$per2]%`] black students and [`[$per3]%`] Hispanic students. Altogether, they make up + + [`` [$per1]%+[$per2]%+[$per3]%=[$s1]% ``] + +of the population. To find the difference between these 3 races and other races, we do subtraction: + + [`` [$s1]%-[$per4]%=[$ans]% ``] + +*Solution*: The school's white, black and Hispanic students, altogether, have [`[$ans]%`] more students than students of other races. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications50.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications50.pg new file mode 100644 index 0000000000..6637a63670 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications50.pg @@ -0,0 +1,207 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Do addition/subtraction problems according to data in a bar graph. +# +# Last edited by Carl Yao on 09/29/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('add','fraction','bar graph') +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserNumberWithUnits.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +sub isStringInArray { + my ($item,@array) = @_; + foreach my $loop (@array) { + if ($item eq $loop) {return 1;} + } + return 0; +} + +sub isNumberInArray { + my ($item,@array) = @_; + foreach my $loop (@array) { + if ($item == $loop) {return 1;} + } + return 0; +} + +############################################## + +Context("LimitedFraction"); + +$numBars = 5; + +@num = (); +@den = (); +@frac = (); +@names = (); +%distanceToName = (); +@miles = (); + +do { + for my $i (0..$numBars-1) { + do {$temp = list_random(2,4,5,10,20,25);} until (!(isNumberInArray($temp,@den))); + $den[$i] = $temp; + do {$num[$i] = random(1,$den[$i]-1,1);} until (gcd($num[$i],$den[$i])==1); + $frac[$i] = Fraction($num[$i],$den[$i]); + $miles[$i] = 100*$frac[$i]; + } + + ($min1,$min2) = (100,100); + ($max1,$max2) = (0,0); + for my $j (0..$numBars-1) { + if ( ($frac[$j]<$min1) && ($frac[$j]<$min2) ) { + $min2 = $min1; + $min1 = $frac[$j]; + } elsif ($frac[$j]<$min2) { + $min2 = $frac[$j]; + } + + if ( ($frac[$j]>$max1) && ($frac[$j]>$max2) ) { + $max2 = $max1; + $max1 = $frac[$j]; + } elsif ($frac[$j]>$max2) { + $max2 = $frac[$j]; + } + + do {$temp = RandomName();} until (!(isStringInArray($temp,@names))); + $names[$j] = $temp; + $distanceToName{$frac[$j]}=$names[$j]; + } + ($min1Num,$min1Den) = $min1->value; + ($min2Num,$min2Den) = $min2->value; + + $ans = $max1+$max2-$min1-$min2; + ($numAns,$denAns) = $ans->value; + $com = lcm($min1Den,$min2Den); + $ans = 100*$ans; + $ans = Compute("$ans"); + +} until ( ($ans<100) && ($denAns!=$com) ); + +$yCover = 1; +$xscale = 1; +$yscale = 0.2; + +$xmin = -$xscale; #The viewing window +$xmax = $numBars+2*$xscale; +$ymin = -$yscale*$yCover; +$ymax = (1+$yscale)*$yCover; + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); +$picture->lb('reset'); + +$picture->moveTo(0,0); +$picture->lineTo($xmax-$xscale, 0, black,3); +$picture->moveTo(0,0); +$picture->arrowTo(0, $ymax-$yscale/2, black,3); +$picture->stamps( closed_circle(0,1,'blue') ); +$picture->lb( new Label(-$xscale/2,1,"100",'black','center','middle')); + +$picture->lb( new Label($xmax-$xscale,-$yscale/4,"runners",'black','left','middle')); +$picture->lb( new Label(0,$ymax-$yscale/3,"distance in miles",'black','left','middle')); + +$picture->new_color("darkred", 159, 64, 16); +$picture->new_color("pink",255,0,127); +$picture->new_color("darkblue", 100,100,255); +$picture->new_color("darkgreen", 0, 86, 34); +$picture->new_color("red", 255,0,0); +@colors = ('darkred','pink','darkblue','darkgreen','red'); + +$alt0 = ""; +for my $i (0..$numBars-1) { + $picture->lb( new + Label(($i+1)*$xscale,-$yscale/(4-2*($i%2)), + "$names[$i]",$colors[$i],'center','middle')); + $picture->moveTo(($i+1-0.4)*$xscale,0); + $picture->lineTo(($i+1-0.4)*$xscale,$frac[$i],$colors[$i],2); + $picture->lineTo(($i+1+0.4)*$xscale,$frac[$i],$colors[$i],2); + $picture->lineTo(($i+1+0.4)*$xscale,0,$colors[$i],2); + $picture->fillRegion([ ($i+1)*$xscale,$frac[$i]/2,$colors[$i] ]); + $picture->lb( new Label(($i+1)*$xscale,$frac[$i]+$yscale/4, + "$miles[$i]",$colors[$i],'center','middle')); + $alt0 = $alt0."$names[$i] ran $miles[$i] miles, "; +} +chop($alt0);chop($alt0); +$alt0 = $alt0.'.'; +$alt = "This is a bar graph displaying the distance run by different runners. $alt0"; + +############################################## + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +BEGIN_PGML + +The following bar graph shows the distance different runners ran in a relay race. + +>>[@ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => "alt = '$alt' title = '$alt'") @]*<< + +Identify those two runners who ran the longest distances, and then identify those two runners who ran the shortest distances. + +The best two runners ran [_____________]{$ans} more miles than the worst two runners. + +END_PGML + +############################################## + + +$nameMin1 = $distanceToName{$min1}; +$nameMin2 = $distanceToName{$min2}; + +$nameMax1 = $distanceToName{$max1}; +$nameMax2 = $distanceToName{$max2}; + +$max1Miles = $max1*100; +$max2Miles = $max2*100; +$min1Miles = $min1*100; +$min2Miles = $min2*100; + +BEGIN_PGML_SOLUTION + +By the bar graph, [$nameMax1] ran [`[$max1Miles]`] miles, and [$nameMax2] ran [`[$max2Miles]`] miles. These two runners ran the longest distance among all runners. Their sum is: + + [``[$max1Miles]+[$max2Miles]=[$max1Miles+$max2Miles]``] + +By the bar graph, [$nameMin1] ran [`[$min1Miles]`] miles, and [$nameMin2] ran [`[$min2Miles]`] miles. These two runners ran the shortest distance among all runners. Their sum is: + + [``[$min1Miles]+[$min2Miles]=[$min1Miles+$min2Miles]``] + +The question is asking for the difference between those two groups, so we do subtraction: + + [`` [$max1Miles+$max2Miles] - [$min1Miles+$min2Miles] = [$ans] ``] + +The best two runners ran [`[$ans]`] more miles than the worst two runners. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications60.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications60.pg new file mode 100644 index 0000000000..f661f553e8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApplications60.pg @@ -0,0 +1,149 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a line graph, find the difference of two numbers. +# +# Last edited by Carl Yao on 09/29/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('percent','graph','application','line graph','rounding') +## DBCCSS('7.RP.3','6.RP.3c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextPercent.pl", + "contextCurrency.pl", +# "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$numPoints = 5; +$maxLimit = 2; + +@days = ("Jan.","Feb.","March","April","May"); +@price = (0,0,0,0,0); +@priceC = (); + +do { + $startPrice = 100*(1+random(-1,1,2)*random(1,50,1)/100); + $price[0] = $startPrice; + for my $i (1..$numPoints-1) { + $price[$i] = $price[$i-1]+random(-1,1,2)*random(1,50,1); + } + $out = 0; + for my $i (1..$numPoints-1) { + if (($price[$i]>=$maxLimit*100) || ($price[$i]<=0)) { + $out = 1; + } + } + $ans = abs($price[$numPoints-1]-$price[0]); +} until ( ($out==0) && ($ans!=0) ); + +Context("LimitedNumeric"); + +$yCover = $maxLimit; +$ystep = $yCover/4; +$xCover = 5; +$xstep = 1; + +$xmin = -$xstep; #The viewing window +$xmax = $xCover + 2*$xstep; +$ymin = -$ystep/2; +$ymax = $yCover + $ystep; + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); +$picture->lb('reset'); + +$picture->moveTo(0,0); +$picture->lineTo($xmax-$xstep, 0, black,3); +$picture->moveTo(0,0); +$picture->arrowTo(0, $ymax-$ystep/2, black,3); + +for my $i (0..4) { + $picture->stamps( closed_circle(0,$i*($maxLimit/4),'blue') ); + $mark = 100*$i*($maxLimit/4); + $picture->lb( new Label(-$xstep/2,$i*($maxLimit/4),"$mark",'black','center','middle')); +} + +$picture->lb( new Label($xmax-$xstep,-$ystep/4,"months",'black','center','middle')); +$picture->lb( new Label($xstep/4,$ymax-$ystep/3,"number of club members",'black','left','middle')); + +$picture->moveTo($xstep,$price[0]/100); +$alt = "This is a line graph about the membership change of a club over $numPoints months. "; +for my $i (0..$numPoints-1) { + $picture->lb( new Label(($i+1)*$xstep,-$ystep/(2*(4-2*($i%2))), + "$days[$i]",'black','center','middle')); + $picture->lineTo(($i+1)*$xstep,$price[$i]/100,'red',1); + $picture->stamps( closed_circle(($i+1)*$xstep,$price[$i]/100,'blue') ); + $picture->lb( new Label(($i+1)*$xstep,$price[$i]/100+$ystep/4, + "$price[$i]",'black','center','middle')); + $alt = $alt."In $days[$i], the club had $price[$i] members. "; +} + +############################################## + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +$day1 = $days[0]; +$dayLast = $days[$numPoints-1]; + +BEGIN_PGML + +This line graph shows a club's membership change over a few months. + +>>[@ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => "alt = '$alt' title = '$alt'") @]*<< + +From [$day1] to [$dayLast], what is the club's membership change? + +From [$day1] to [$dayLast], the club's membership change was [_________]{$ans}. + +END_PGML + +############################################## + +$day1Price = $price[0]; +$dayLastPrice = $price[$numPoints-1]; +$change = abs($dayLastPrice-$day1Price); + +if ($day1Price>$dayLastPrice) { + $minPrice = $dayLastPrice;$maxPrice = $day1Price; +} else { + $maxPrice = $dayLastPrice;$minPrice = $day1Price; +} + +BEGIN_PGML_SOLUTION + +In [$day1], the club had [`[$day1Price]`] members; in [$dayLast], the club had [`[$dayLastPrice]`] members. To find their difference, we do subtraction: + + [`` [$maxPrice] - [$minPrice] = [$ans] ``] + +From [$day1] to [$dayLast], the club's membership changed by [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation10.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation10.pg index fc75764ed7..a5225a1f83 100644 --- a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Estimation) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation20.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation20.pg index 6de86b03b5..eda30ac43b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation20.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -62,7 +66,7 @@ BEGIN_PGML Do the following problem without using a calculator. Round numbers to the hundreds place first, and then do addition or subtraction. -[$name] has [`[$aC]`] left in [$possessive] checking account. [@ucfirst($pronoun)@] plans to purchase a nice table for [`[$bC]`]. Approximately how much money will be left after the purchase? +[$name] has [`[$aC]`] left in [$possessive] check account. [@ucfirst($pronoun)@] plans to purchase a nice table for [`[$bC]`]. Approximately how much money will be left after the purchase? There will be approximately [__________]{$ansC} left after the purchase. diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation30.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation30.pg index 1bd9ee4988..91f023e404 100644 --- a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation30.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Estimation) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation40.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation40.pg index a7b970c8d6..a5fba69724 100644 --- a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/AdditionSubtractionApproximation40.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Estimation) -## Institution(PCC) -## Author(Carl Yao) -## Level(4) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Subtraction10.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Subtraction10.pg new file mode 100644 index 0000000000..692f506778 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Subtraction10.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Basic subtraction problems +# +# Last updated: Yao, 09/27/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('evaluate','divide','zero') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + $num11 = random(11,80,1); + $num12 = random(1,9,1); + $ans1 = $num11-$num12; +} until (int($ans1/10)==int($num11/10)); + +do { + $num21 = random(11,80,1); + $num22 = random(1,9,1); + $ans2 = $num21-$num22; +} until (int($ans2/10)!=int($num21/10)); + + +$num31 = random(20,80,10); +$num32 = random(1,9,1); +$ans3 = $num31-$num32; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Do the following subtractions without using a calculator. + +a. [`` [$num11] - [$num12] = ``] [________]{$ans1} + +a. [`` [$num21] - [$num22] = ``] [________]{$ans2} + +a. [`` [$num31] - [$num32] = ``] [________]{$ans3} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + +a. [`` [$num11] - [$num12] = [$ans1] ``] + +a. [`` [$num21] - [$num22] = [$ans2] ``] + +a. [`` [$num31] - [$num32] = [$ans3] ``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Subtraction20.pg b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Subtraction20.pg new file mode 100644 index 0000000000..217c18be76 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/AdditionSubtraction/Subtraction20.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Basic subtraction problems +# +# Last updated: Yao, 09/27/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('evaluate','divide','zero') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +@a = ( ); +@b = ( ); + +$num11 = 0; +$num12 = 0; +for (my $i=0; $i<3; $i++) { + do { + $a[$i] = random(0,9,1); + $b[$i] = random(1,9,1); + } until ($a[$i]-$b[$i]>0); + $num11 += $a[$i]*10**$i; + $num12 += $b[$i]*10**$i; +} +$ans1 = $num11-$num12; + +$num21 = random(300,900,100); +do {$num22 = random(101,$num21-100,1);} until (int($num22/10)!=$num22/10); +$ans2 = $num21-$num22; + +do { + $num31 = random(101,999,1); + $num32 = random(101,999,1); + $ans3 = $num31-$num32; +} until ( ($ans3>0) && (int($num31/100)-int($num32/100)!=int($ans3/100)) ); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Do the following subtractions without using a calculator. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"",header=>"CH"},], +["\( $num11\)","\( $num21\)","\( $num31 \)"], +["\( \underline{-$num12} \)","\( \underline{-$num22} \)","\( \underline{-$num32} \)"], +[ans_rule(1),ans_rule(1),ans_rule(1)], +], allcellcss=>"border:0px solid;", align=>rrr); +\} + +$PAR +END_TEXT +Context()->normalStrings; + +ANS( Compute("$ans1") -> cmp); +ANS( Compute("$ans2") -> cmp); +ANS( Compute("$ans3") -> cmp); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION + +$PAR +\{ +DataTable([[{data=>"",header=>"CH"},{data=>"",header=>"CH"},], +["\( $num11\)","\( $num21\)","\( $num31 \)"], +["\( \underline{-$num12} \)","\( \underline{-$num22} \)","\( \underline{-$num32} \)"], +["\( $ans1 \)","\( $ans2 \)","\( $ans3 \)"], +], tablecss=>"border:0px solid;", align=>rrr); +\} + +$PAR +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals10.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals10.pg index 8311acd91c..da90016598 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals10.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsPositives) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','add') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,3 +82,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals12.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals12.pg index 30f4f4a47d..edb4a9d5f4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals12.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals12.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsPositives) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','add') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals15.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals15.pg index 61e761d9cc..4fc92affc0 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals15.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals15.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsNegatives) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','add','negative') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,9 +56,10 @@ TEXT(beginproblem()); BEGIN_PGML -Add these two decimals without using a calculator. +Simplify without using a calculator. - [`` [$decimal0] + ([$decimal1]) = ``] [___________]{$sum} +[`` [$decimal0] + ([$decimal1]) ``] +[___________]{$sum} END_PGML @@ -85,3 +87,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals20.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals20.pg index a823a6e1be..53813b673c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals20.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsMixedSigns) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','subtract') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,9 +57,11 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract these two decimals without using a calculator. +Simplify without using a calculator. + +[`` [$decimal0] - [$decimal1] ``] +[___________]{$dif} - [`` [$decimal0] - [$decimal1] = ``] [___________]{$dif} END_PGML @@ -82,3 +85,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals25.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals25.pg index 8c961c4231..e2ea202718 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals25.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals25.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsMixedSigns) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','add','negative') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,9 +57,10 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract these two decimals without using a calculator. +Simplify without using a calculator. - [`` - [$decimal1] + [$decimal0] = ``] [___________]{$dif} +[`` - [$decimal1] + [$decimal0] ``] +[___________]{$dif} END_PGML @@ -79,9 +82,10 @@ Note that we added an extra [`0`] to the end of [`[$decimal0]`] before doing sub Finally, since the absolute value of [` - [$decimal1] `] is smaller than the absolute value of [` [$decimal0] `], the result is positive. -*Solution:* [` - [$decimal1] + [$decimal0] = [$dif] `] +[` - [$decimal1] + [$decimal0] = [$dif] `] END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals26.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals26.pg index 175651ab67..c3ecbb88db 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals26.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals26.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsMixedSigns) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','subtract','negative') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,9 +57,11 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract these two decimals without using a calculator. +Simplify without using a calculator. + +[`` - [$decimal1] - (-[$decimal0]) ``] +[___________]{$dif} - [`` - [$decimal1] - (-[$decimal0]) = ``] [___________]{$dif} END_PGML @@ -83,9 +87,10 @@ Note that we added an extra [`0`] to the end of [`[$decimal0]`] before doing sub Finally, since the absolute value of [` - [$decimal1] `] is smaller than the absolute value of [` [$decimal0] `], the result is positive. -*Solution:* [` - [$decimal1] + [$decimal0] = [$dif] `] +[` - [$decimal1] + [$decimal0] = [$dif] `] END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals30.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals30.pg index eda7ed3ee1..ad6861c5f8 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals30.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsPositives) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','add') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -77,3 +79,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals40.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals40.pg index 8f30c0b491..6680eb3f6b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals40.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsMixedSigns) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','subtract') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,9 +55,10 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract these two decimals without using a calculator. +Simplify without using a calculator. - [`` [$decimal0] - [$decimal1] = ``] [___________]{$dif} +[`` [$decimal0] - [$decimal1] ``] +[___________]{$dif} END_PGML @@ -77,3 +80,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals50.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals50.pg index e3e45afa99..fae195dbfb 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/AddSubtractDecimals50.pg @@ -3,23 +3,24 @@ # # Template # -# Subtract a decimal from an integer, like (-12)+1.05 +# Add a decimal with an integer, like (-12)+1.05 # # Last updated: Yao, 10/23/2013 # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsMixedSigns) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','add','negative') - +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,9 +55,10 @@ TEXT(beginproblem()); BEGIN_PGML -Subtract these two decimals without using a calculator. +Simplify without using a calculator. - [`` [$decimal0] + [$decimal1] = ``] [___________]{$dif} +[`` [$decimal0] + [$decimal1] ``] +[___________]{$dif} END_PGML @@ -78,9 +80,10 @@ When we add a negative number with a positive number, we need to find the differ Next, since the absolute value of [`[$decimal0]`] is bigger than that of [`[$decimal1]`], the result is negative. -*Solution:* [` [$decimal0] + [$decimal1] = [$dif] `] +[` [$decimal0] + [$decimal1] = [$dif] `] END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalAndMoney10.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalAndMoney10.pg index c25f5a9f39..a050c7953d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalAndMoney10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalAndMoney10.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','money') -## MLTleader(1) -## MLT(arithmetic_decimal_application_dollars_and_cents) +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,17 +59,11 @@ BEGIN_PGML If [`1`] dollar is represented by the integer [`1`], write the following money amount with decimals. There is no need to type the dollar sign. ----- - - [`[$money0] `] = [___________]{$decimal0} - ----- - - [`[$money1] `] = [___________]{$decimal1} +a. [`[$money0] `] = [___________]{$decimal0} ----- +a. [`[$money1] `] = [___________]{$decimal1} - [`[$money2] `] = [___________]{$decimal2} +a. [`[$money2] `] = [___________]{$decimal2} END_PGML @@ -79,11 +75,11 @@ At stores, if we see an item costs [` \$1.23 `], the number [`1`] represents [`1 The solutions are: - [``[$money0] = [$decimal0] ``] +a. [``[$money0] = [$decimal0] ``] - [``[$money1] = [$decimal1] ``] +a. [``[$money1] = [$decimal1] ``] - [``[$money2] = [$decimal2] ``] +a. [``[$money2] = [$decimal2] ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalAndMoney20.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalAndMoney20.pg index ae5c069490..22579a20f6 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalAndMoney20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalAndMoney20.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','money') -## MLT(arithmetic_decimal_application_dollars_and_cents) +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,17 +67,11 @@ BEGIN_PGML If [`1`] dollar is represented by the integer [`1`], write the following money amount with decimals. There is no need to type the dollar sign. ----- - - [`[$money0] `] = [___________]{$decimal0} - ----- - - [`[$money1] `] = [___________]{$decimal1} +a. [`[$money0] `] = [___________]{$decimal0} ----- +a. [`[$money1] `] = [___________]{$decimal1} - [`[$money2] `] = [___________]{$decimal2} +a. [`[$money2] `] = [___________]{$decimal2} END_PGML @@ -86,11 +83,11 @@ At stores, if we see an item costs [` \$1.23 `], the number [`1`] represents [`1 The solutions are: - [``[$money0] = [$decimal0] ``] +a. [``[$money0] = [$decimal0] ``] - [``[$money1] = [$decimal1] ``] +a. [``[$money1] = [$decimal1] ``] - [``[$money2] = [$decimal2] ``] +a. [``[$money2] = [$decimal2] ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine10.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine10.pg index 67bd734c3b..71327cdf08 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine10.pg @@ -9,29 +9,33 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('number line','decimal') ## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsFromGraph) -## MLTleader(1) -## Level(1) -## KEYWORDS('number line','decimal') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -77,7 +81,7 @@ BEGIN_PGML The dot in the graph can be represented by what decimal? -Solution: [_________]{$ans} +[_________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine20.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine20.pg index 61f28967c4..31df019ec1 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine20.pg @@ -9,16 +9,20 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('number line','decimal') ## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsFromGraph) -## Level(1) -## KEYWORDS('number line','decimal') ############################################## @@ -26,12 +30,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -81,7 +85,7 @@ BEGIN_PGML The dot in the graph can be represented by what decimal? -Solution: [_________]{$ans} +[_________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine30.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine30.pg index f6d023c68c..66dc0120b3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine30.pg @@ -9,16 +9,20 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('number line','decimal') ## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsFromGraph) -## Level(1) -## KEYWORDS('number line','decimal') ############################################## @@ -26,12 +30,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -81,7 +85,7 @@ BEGIN_PGML The dot in the graph can be represented by what decimal? -Solution: [_________]{$ans} +[_________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine40.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine40.pg index 8169f869fd..2a78287f35 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine40.pg @@ -9,16 +9,20 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('number line','decimal') ## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsFromGraph) -## Level(1) -## KEYWORDS('number line','decimal') ############################################## @@ -26,12 +30,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -77,7 +81,7 @@ BEGIN_PGML The dot in the graph can be represented by what decimal? -Solution: [_________]{$ans} +[_________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine50.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine50.pg index f7b3004f50..a8404f323e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine50.pg @@ -9,16 +9,20 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('number line','decimal') ## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsFromGraph) -## Level(1) -## KEYWORDS('number line','decimal') ############################################## @@ -26,12 +30,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -80,7 +84,7 @@ BEGIN_PGML The dot in the graph can be represented by what decimal? -Solution: [_________]{$ans} +[_________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine60.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine60.pg index 0daec42efd..ae1699bcd4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/DecimalOnNumberLine60.pg @@ -9,16 +9,20 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('number line','decimal') ## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticDecimalsFromGraph) -## Level(1) -## KEYWORDS('number line','decimal') ############################################## @@ -26,12 +30,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -80,7 +84,7 @@ BEGIN_PGML The dot in the graph can be represented by what decimal? -Solution: [_________]{$ans} +[_________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals10.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals10.pg index b33de638ff..29227e5837 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals10.pg @@ -9,18 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalMultiplication) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') - +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,11 +55,11 @@ BEGIN_PGML Calculate without using a calculator. Don't use commas in your answer. -[`[$dec] \cdot [$power] `] = [___________]{$ans1} +a. [`[$dec] \cdot [$power] `] = [___________]{$ans1} -[`[$dec] \cdot [$power*10] `] = [___________]{$ans2} +a. [`[$dec] \cdot [$power*10] `] = [___________]{$ans2} -[`[$dec] \cdot [$power*100] `] = [___________]{$ans3} +a. [`[$dec] \cdot [$power*100] `] = [___________]{$ans3} END_PGML @@ -73,11 +73,11 @@ else {$times = "$numZeroes".' times';} BEGIN_PGML_SOLUTION - [``[$dec] \cdot [$power] =[$ans1]``] as we move the decimal point to the right [$times]. Note that we added in [`[$numZeroes]`] zeroes. +a. [``[$dec] \cdot [$power] =[$ans1]``] as we move the decimal point to the right [$times]. Note that we added in [`[$numZeroes]`] zeroes. - [``[$dec] \cdot [$power*10] =[$ans2]``] as we move the decimal point to the right [$numZeroes+1] times. Note that we added in [`[$numZeroes+1]`] zeroes. +a. [``[$dec] \cdot [$power*10] =[$ans2]``] as we move the decimal point to the right [$numZeroes+1] times. Note that we added in [`[$numZeroes+1]`] zeroes. - [``[$dec] \cdot [$power*100] =[$ans3]``] as we move the decimal point to the right [$numZeroes+2] times. Note that we added in [`[$numZeroes+2]`] zeroes. +a. [``[$dec] \cdot [$power*100] =[$ans3]``] as we move the decimal point to the right [$numZeroes+2] times. Note that we added in [`[$numZeroes+2]`] zeroes. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals100.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals100.pg index 3fd03b860c..9959ccd569 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals100.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals100.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalMultiplication) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,11 +52,11 @@ BEGIN_PGML Calculate without using a calculator. -[`[$int] \cdot 0.1 `] = [___________]{$ans1} +a. [`[$int] \cdot 0.1 `] = [___________]{$ans1} -[`[$int] \cdot 0.01 `] = [___________]{$ans2} +a. [`[$int] \cdot 0.01 `] = [___________]{$ans2} -[`[$int] \cdot 0.001 `] = [___________]{$ans3} +a. [`[$int] \cdot 0.001 `] = [___________]{$ans3} END_PGML @@ -72,13 +74,14 @@ Similarly, multiplying by [`0.01`] is the same as dividing by [`100`]; multiplyi *Solutions:* - [``[$int] \cdot 0.1 = [$int] \div 10 =[$ans1]``] as we move the decimal point to the left once. +a. [``[$int] \cdot 0.1 = [$int] \div 10 =[$ans1]``] as we move the decimal point to the left once. - [``[$int] \cdot 0.01 = [$int] \div 100 =[$ans2]``] as we move the decimal point to the left twice. Note that we need to add in one zero. +a. [``[$int] \cdot 0.01 = [$int] \div 100 =[$ans2]``] as we move the decimal point to the left twice. Note that we need to add in one zero. - [``[$int] \cdot 0.001 = [$int] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in two zeroes. +a. [``[$int] \cdot 0.001 = [$int] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in two zeroes. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals110.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals110.pg index cd2b103dc9..6f8b2647a7 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals110.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals110.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalMultiplication) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,11 +52,11 @@ BEGIN_PGML Calculate without using a calculator. -[`[$int] \cdot 0.1 `] = [___________]{$ans1} +a. [`[$int] \cdot 0.1 `] = [___________]{$ans1} -[`[$int] \cdot 0.01 `] = [___________]{$ans2} +a. [`[$int] \cdot 0.01 `] = [___________]{$ans2} -[`[$int] \cdot 0.001 `] = [___________]{$ans3} +a. [`[$int] \cdot 0.001 `] = [___________]{$ans3} END_PGML @@ -70,13 +72,14 @@ BEGIN_PGML_SOLUTION *Solutions:* - [``[$int] \cdot 0.1 = [$int] \div 10 =[$ans1]``] as we move the decimal point to the left once. +a. [``[$int] \cdot 0.1 = [$int] \div 10 =[$ans1]``] as we move the decimal point to the left once. - [``[$int] \cdot 0.01 = [$int] \div 100 =[$ans2]``] as we move the decimal point to the left twice. Note that we need to add in one zero. +a. [``[$int] \cdot 0.01 = [$int] \div 100 =[$ans2]``] as we move the decimal point to the left twice. Note that we need to add in one zero. - [``[$int] \cdot 0.001 = [$int] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in two zeroes. +a. [``[$int] \cdot 0.001 = [$int] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in two zeroes. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals120.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals120.pg index b71bf691fe..bff528b2a9 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals120.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals120.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Division) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalDivision) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','divide') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,11 +52,11 @@ BEGIN_PGML Calculate without using a calculator. -[`[$int] \div 0.1 `] = [___________]{$ans1} +a. [`[$int] \div 0.1 `] = [___________]{$ans1} -[`[$int] \div 0.01 `] = [___________]{$ans2} +a. [`[$int] \div 0.01 `] = [___________]{$ans2} -[`[$int] \div 0.001 `] = [___________]{$ans3} +a. [`[$int] \div 0.001 `] = [___________]{$ans3} END_PGML @@ -72,13 +74,14 @@ Similarly, dividing by [`0.01`] is the same as multiplying by [`100`]; dividing *Solutions:* - [``[$int] \div 0.1 = [$int] \cdot 10 =[$ans1]``] as we move the decimal point to the right once. +a. [``[$int] \div 0.1 = [$int] \cdot 10 =[$ans1]``] as we move the decimal point to the right once. - [``[$int] \div 0.01 = [$int] \cdot 100 =[$ans2]``] as we move the decimal point to the right twice. +a. [``[$int] \div 0.01 = [$int] \cdot 100 =[$ans2]``] as we move the decimal point to the right twice. - [``[$int] \div 0.001 = [$int] \cdot 1000 =[$ans3]``] as we move the decimal point to the right three times. +a. [``[$int] \div 0.001 = [$int] \cdot 1000 =[$ans3]``] as we move the decimal point to the right three times. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals130.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals130.pg index 537b62f77d..336751a896 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals130.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals130.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Division) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalDivision) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','divide') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -51,11 +52,11 @@ BEGIN_PGML Calculate without using a calculator. -[`[$int] \div 0.1 `] = [___________]{$ans1} +a. [`[$int] \div 0.1 `] = [___________]{$ans1} -[`[$int] \div 0.01 `] = [___________]{$ans2} +a. [`[$int] \div 0.01 `] = [___________]{$ans2} -[`[$int] \div 0.001 `] = [___________]{$ans3} +a. [`[$int] \div 0.001 `] = [___________]{$ans3} END_PGML @@ -73,11 +74,11 @@ Similarly, dividing by [`0.01`] is the same as multiplying by [`100`]; dividing *Solutions:* - [``[$int] \div 0.1 = [$int] \cdot 10 =[$ans1]``] as we move the decimal point to the right once. +a. [``[$int] \div 0.1 = [$int] \cdot 10 =[$ans1]``] as we move the decimal point to the right once. - [``[$int] \div 0.01 = [$int] \cdot 100 =[$ans2]``] as we move the decimal point to the right twice. +a. [``[$int] \div 0.01 = [$int] \cdot 100 =[$ans2]``] as we move the decimal point to the right twice. - [``[$int] \div 0.001 = [$int] \cdot 1000 =[$ans3]``] as we move the decimal point to the right three times. +a. [``[$int] \div 0.001 = [$int] \cdot 1000 =[$ans3]``] as we move the decimal point to the right three times. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals140.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals140.pg index 35a0803489..fa66c32edf 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals140.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals140.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalMultiplication) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,11 +65,11 @@ BEGIN_PGML Calculate the following without using a calculator: -a) [`` [$int10] \cdot [$int11] = ``] [___________]{$product1} +a. [`` [$int10] \cdot [$int11] = ``] [___________]{$product1} -b) [`` [$int20] \cdot [$int21] = ``] [___________]{$product2} +a. [`` [$int20] \cdot [$int21] = ``] [___________]{$product2} -c) [`` [$int30] \cdot [$int31] = ``] [___________]{$product3} +a. [`` [$int30] \cdot [$int31] = ``] [___________]{$product3} END_PGML @@ -94,9 +95,9 @@ Once we understand the math, we can use this shortcut. *Solutions:* -a) [``[$int10] \cdot [$int11] = [$product1] ``] -b) [``[$int20] \cdot [$int21] = [$product2] ``] -c) [``[$int30] \cdot [$int31] = [$product3] ``] +a. [``[$int10] \cdot [$int11] = [$product1] ``] +a. [``[$int20] \cdot [$int21] = [$product2] ``] +a. [``[$int30] \cdot [$int31] = [$product3] ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals150.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals150.pg index fe5b8badf3..07f6b1d70b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals150.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals150.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalMultiplication) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -41,20 +43,29 @@ $int00 = random(2,9,1); $int01 = random(2,9,1); $product0 = $int00*$int01; -$int10 = $int00*10; -$int11 = $int01*10; +$numZeroes10 = 1; +$numZeroes11 = random(1,4,1); +$power11 = 10**$numZeroes11; +if ($numZeroes11 == 1) {$times1 = "once";$times2 = "twice";} + elsif ($numZeroes11 == 2) {$times1 = "twice";$times2 = "3 times";} + elsif ($numZeroes12 == 3) {$times1 = "3 times";$times2 = "4 times";} + else {$times1 = "4 times";$times2 = "5 times";} +$power1Total = $power11*10; +$int10 = $int00*10**$numZeroes10; +$int11 = $int01*$power11; $product1 = $int10*$int11; -$move1 = 2; -$int20 = $int00; -$int21 = $int01*100; +do {$numZeroes20 = random(1,3,1);} until ($numZeroes20 != $numZeroes10); +$numZeroes21 = random(1,3,1); +$int20 = $int00*10**$numZeroes20; +$int21 = $int01*10**$numZeroes21; $product2 = $int20*$int21; -$move2 = 2; -$int30 = $int00*10; -$int31 = $int01*1000; +$numZeroes30 = random(1,3,1); +do {$numZeroes31 = random(1,3,1);} until ( ($numZeroes31 != $numZeroes21) && ($numZeroes31 != $numZeroes01) ); +$int30 = $int00*10**$numZeroes30; +$int31 = $int01*10**$numZeroes31; $product3 = $int30*$int31; -$move3 = 3; ############################################## @@ -64,11 +75,11 @@ BEGIN_PGML Calculate the following without using a calculator: -a) [`` [$int10] \cdot [$int11] = ``] [___________]{$product1} +a. [`` [$int10] \cdot [$int11] = ``] [___________]{$product1} -b) [`` [$int20] \cdot [$int21] = ``] [___________]{$product2} +a. [`` [$int20] \cdot [$int21] = ``] [___________]{$product2} -c) [`` [$int30] \cdot [$int31] = ``] [___________]{$product3} +a. [`` [$int30] \cdot [$int31] = ``] [___________]{$product3} END_PGML @@ -81,9 +92,9 @@ Since [`[$int00] \cdot [$int01] = [$product0] `], we can calculate [` [$int10] \ [`` \begin{aligned}[t] &\phantom{{}=} [$int10] \cdot [$int11] \\ - &= [$int00] \cdot 10 \cdot [$int01] \cdot 10 \\ - &= [$int00] \cdot [$int01] \cdot 10 \cdot 10 \\ - &= [$product0] \cdot 100 \\ + &= [$int00] \cdot 10 \cdot [$int01] \cdot [$power11] \\ + &= [$int00] \cdot [$int01] \cdot 10 \cdot [$power11] \\ + &= [$product0] \cdot [$power1Total] \\ &= [$product1] \end{aligned} ``] @@ -91,17 +102,18 @@ Since [`[$int00] \cdot [$int01] = [$product0] `], we can calculate [` [$int10] \ Once we understand the math, we can use this shortcut to calculate the above problem: 1. From [`[$int00]`] to [`[$int10]`], the decimal point moved to the right once. -2. From [`[$int01]`] to [`[$int11]`], the decimal point moved to the right once. -3. Since [`[$int00] \cdot [$int01] = [$product0] `], to calculate [`[$int10] \cdot [$int11] `], we move the decimal point of [`[$product0]`] to the right twice, and we have: [`[$int10] \cdot [$int11] = [$product1] `]. +2. From [`[$int01]`] to [`[$int11]`], the decimal point moved to the right [$times1]. +3. Since [`[$int00] \cdot [$int01] = [$product0] `], to calculate [`[$int10] \cdot [$int11] `], we move the decimal point of [`[$product0]`] to the right for a total of [$times2], and we have: [`[$int10] \cdot [$int11] = [$product1] `]. *Solutions:* -a) [``[$int10] \cdot [$int11] = [$product1] ``] -b) [``[$int20] \cdot [$int21] = [$product2] ``] -c) [``[$int30] \cdot [$int31] = [$product3] ``] +a. [``[$int10] \cdot [$int11] = [$product1] ``] +a. [``[$int20] \cdot [$int21] = [$product2] ``] +a. [``[$int30] \cdot [$int31] = [$product3] ``] END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals160.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals160.pg index 8c5b1a0934..8d5251a432 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals160.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals160.pg @@ -9,14 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,11 +66,11 @@ BEGIN_PGML Calculate the following without using a calculator: -a) [`` [$int10] \cdot [$int11] = ``] [___________]{$product1} +a. [`` [$int10] \cdot [$int11] = ``] [___________]{$product1} -b) [`` [$int20] \cdot [$int21] = ``] [___________]{$product2} +a. [`` [$int20] \cdot [$int21] = ``] [___________]{$product2} -c) [`` [$int30] \cdot [$int31] = ``] [___________]{$product3} +a. [`` [$int30] \cdot [$int31] = ``] [___________]{$product3} END_PGML @@ -93,9 +97,9 @@ Once we understand the math, we can use this shortcut to calculate the above pro *Solutions:* -a) [``[$int10] \cdot [$int11] = [$product1] ``] -b) [``[$int20] \cdot [$int21] = [$product2] ``] -c) [``[$int30] \cdot [$int31] = [$product3] ``] +a. [``[$int10] \cdot [$int11] = [$product1] ``] +a. [``[$int20] \cdot [$int21] = [$product2] ``] +a. [``[$int30] \cdot [$int31] = [$product3] ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals170.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals170.pg index c86a4daa62..6b88ebabdc 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals170.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals170.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalMultiplication) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,12 +31,13 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## Context("LimitedNumeric"); +Context()->{format}{number} = "%f#"; #Context()->{format}{number} = "%9d"; $int00 = random(2,9,1); @@ -43,18 +46,18 @@ $product0 = $int00*$int01; $int10 = $int00/10; $int11 = $int01/10; -$product1 = $int10*$int11; -$move1 = 2; +$product1 = Real($int10*$int11); $int20 = $int00; -$int21 = $int01/100; -$product2 = $int20*$int21; -$move2 = 2; +$power21 = random(1,4,1); +$int21 = $int01/10**$power21; +$product2 = Real($int20*$int21); -$int30 = $int00/10; -$int31 = $int01/1000; -$product3 = $int30*$int31; -$move3 = 4; +$power30 = random(2,3,1); +$int30 = $int00/10**$power30; +$power31 = random(1,3,1); +$int31 = $int01/10**$power31; +$product3 = Real($int30*$int31); ############################################## @@ -64,11 +67,11 @@ BEGIN_PGML Calculate the following without using a calculator: -a) [`` [$int10] \cdot [$int11] = ``] [___________]{$product1} +a. [`` [$int10] \cdot [$int11] = ``] [___________]{$product1} -b) [`` [$int20] \cdot [$int21] = ``] [___________]{$product2} +a. [`` [$int20] \cdot [$int21] = ``] [___________]{$product2} -c) [`` [$int30] \cdot [$int31] = ``] [___________]{$product3} +a. [`` [$int30] \cdot [$int31] = ``] [___________]{$product3} END_PGML @@ -96,12 +99,13 @@ Once we understand the math, we can use this shortcut to calculate the above pro *Solutions:* -a) [``[$int10] \cdot [$int11] = [$product1] ``] -b) [``[$int20] \cdot [$int21] = [$product2] ``] -c) [``[$int30] \cdot [$int31] = [$product3] ``] +a. [``[$int10] \cdot [$int11] = [$product1] ``] +a. [``[$int20] \cdot [$int21] = [$product2] ``] +a. [``[$int30] \cdot [$int31] = [$product3] ``] END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals180.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals180.pg index 723b72ecef..0881cd70d5 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals180.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals180.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalMultiplication) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,33 +63,30 @@ sub moveOutputShould { Context("LimitedNumeric"); #Context()->{format}{number} = "%9d"; -$int00 = random(2,9,1); -$int01 = random(2,9,1); -$product0 = $int00*$int01; - -@num1 = ($int00/1000,$int00/100,$int00/10); -@num2 = ($int01*10,$int01*100,$int01*1000); - -$int10 = splice(@num1,random(0,$#num1,1),1); -$int11 = splice(@num2,random(0,$#num2,1),1); -$product1 = $int10*$int11; -$move10 = moveOutput($int10,$int00); -$move11 = moveOutput($int11,$int01); -$move1 = moveOutput($product1,$product0); - -$int20 = splice(@num1,random(0,$#num1,1),1); -$int21 = splice(@num2,random(0,$#num2,1),1); -$product2 = $int20*$int21; -#$move20 = moveOutput($int20,$int00); -#$move21 = moveOutput($int21,$int01); -#$move2 = moveOutput($product2,$product0); - -$int30 = splice(@num1,random(0,$#num1,1),1); -$int31 = splice(@num2,random(0,$#num2,1),1); -$product3 = $int30*$int31; -#$move30 = moveOutput($int30,$int00); -#$move31 = moveOutput($int31,$int01); -#$move3 = moveOutput($product3,$product0); +do { + $int00 = random(2,9,1); + $int01 = random(2,9,1); + $product0 = $int00*$int01; + + @num1 = ($int00/1000,$int00/100,$int00/10); + @num2 = ($int01*10,$int01*100,$int01*1000); + + $int10 = splice(@num1,random(0,$#num1,1),1); + $int11 = splice(@num2,random(0,$#num2,1),1); + $product1 = $int10*$int11; + $move10 = moveOutput($int10,$int00); + $move11 = moveOutput($int11,$int01); + $move1 = moveOutput($product1,$product0); + $movingText = moveOutputShould($product1,$product0); + + $int20 = splice(@num1,random(0,$#num1,1),1); + $int21 = splice(@num2,random(0,$#num2,1),1); + $product2 = $int20*$int21; + + $int30 = splice(@num1,random(0,$#num1,1),1); + $int31 = splice(@num2,random(0,$#num2,1),1); + $product3 = $int30*$int31; +} until ( ($product1!=$product2) && ($product1!=$product3) && ($product2!=$product3) ); ############################################## @@ -97,11 +96,11 @@ BEGIN_PGML Calculate the following without using a calculator: -a) [`` [$int10] \cdot [$int11] = ``] [___________]{$product1} +a. [`` [$int10] \cdot [$int11] = ``] [___________]{$product1} -b) [`` [$int20] \cdot [$int21] = ``] [___________]{$product2} +a. [`` [$int20] \cdot [$int21] = ``] [___________]{$product2} -c) [`` [$int30] \cdot [$int31] = ``] [___________]{$product3} +a. [`` [$int30] \cdot [$int31] = ``] [___________]{$product3} END_PGML @@ -114,16 +113,17 @@ We will show how to calculate the first problem: [` [$int10] \cdot [$int11] `]. 1. From [`[$int00]`] to [`[$int10]`], the decimal point [$move10]. 2. From [`[$int01]`] to [`[$int11]`], the decimal point [$move11]. 3. Altogether, the decimal point [$move1]. -4. Since [`[$int00] \cdot [$int01] = [$product0] `], to calculate [`[$int10] \cdot [$int11] `], the decimal point of [`[$product0]`] should [@moveOutputShould($product1,$product0)@], and we have: [`[$int10] \cdot [$int11] = [$product1] `]. +4. Since [`[$int00] \cdot [$int01] = [$product0] `], to calculate [`[$int10] \cdot [$int11] `], the decimal point of [`[$product0]`] should [$movingText], and we have: [`[$int10] \cdot [$int11] = [$product1] `]. *Solutions:* -a) [``[$int10] \cdot [$int11] = [$product1] ``] -b) [``[$int20] \cdot [$int21] = [$product2] ``] -c) [``[$int30] \cdot [$int31] = [$product3] ``] +a. [``[$int10] \cdot [$int11] = [$product1] ``] +a. [``[$int20] \cdot [$int21] = [$product2] ``] +a. [``[$int30] \cdot [$int31] = [$product3] ``] END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals190.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals190.pg index d72e3e3e23..ab0a69ccb8 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals190.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals190.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') - +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -88,17 +91,11 @@ BEGIN_PGML It's given that [`[$num00]\cdot[$num01]=[$product0]`]. Calculate the following without using a calculator. ----- - -[`[$num10] \cdot [$num11] `] = [___________]{$product1} +a. [`[$num10] \cdot [$num11] `] = [___________]{$product1} ----- +a. [`[$num20] \cdot [$num21] `] = [___________]{$product2} -[`[$num20] \cdot [$num21] `] = [___________]{$product2} - ----- - -[`[$num30] \cdot [$num31] `] = [___________]{$product3} +a. [`[$num30] \cdot [$num31] `] = [___________]{$product3} END_PGML @@ -133,7 +130,7 @@ Now, these two equations should make sense: If we multiply [`15`] by [`10`] to get [`150`], we should multiply the product [`225`] by [`10`] to get [`2250`]. -####Question 1 +a. Compare [`[$num00]\cdot[$num01] `] with [`[$num10] \cdot [$num11] `], there are [@$moves[1]@] extra zeros; so we move [`[$product0]`]'s decimal point to the right [@$movesToWords[1]@] to get [`[$product1]`]: @@ -144,7 +141,7 @@ Compare [`[$num00]\cdot[$num01] `] with [`[$num10] \cdot [$num11] `], there are \end{aligned} ``] -####Question 2 +b. Compare [`[$num00]\cdot[$num01] `] with [`[$num20] \cdot [$num21] `], there are [@$moves[2]@] extra zeros; so we move [`[$product0]`]'s decimal point to the right [@$movesToWords[2]@] to get [`[$product2]`]: @@ -155,7 +152,7 @@ Compare [`[$num00]\cdot[$num01] `] with [`[$num20] \cdot [$num21] `], there are \end{aligned} ``] -####Question 3 +c. Compare [`[$num00]\cdot[$num01] `] with [`[$num30] \cdot [$num31] `], there are [@$moves[3]@] extra zeros; so we move [`[$product0]`]'s decimal point to the right [@$movesToWords[3]@] to get [`[$product3]`]: @@ -170,3 +167,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals20.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals20.pg index 086e051078..73a888ae84 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals20.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalMultiplication) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,11 +55,11 @@ BEGIN_PGML Calculate without using a calculator. Don't use commas in your answer. -[`[$dec] \cdot [$power] `] = [___________]{$ans1} +a. [`[$dec] \cdot [$power] `] = [___________]{$ans1} -[`[$dec] \cdot [$power*10] `] = [___________]{$ans2} +a. [`[$dec] \cdot [$power*10] `] = [___________]{$ans2} -[`[$dec] \cdot [$power*100] `] = [___________]{$ans3} +a. [`[$dec] \cdot [$power*100] `] = [___________]{$ans3} END_PGML @@ -93,13 +95,14 @@ When an integer is multiplied by [`10`], [`100`] or [`1000`], we move the decima *Solutions:* - [``[$dec] \cdot [$power] =[$ans1]``] as we move the decimal point to the right [$times]. Note that we added in [`[$numZeroes]`] zeroes. +a. [``[$dec] \cdot [$power] =[$ans1]``] as we move the decimal point to the right [$times]. Note that we added in [`[$numZeroes]`] zeroes. - [``[$dec] \cdot [$power*10] =[$ans2]``] as we move the decimal point to the right [$numZeroes+1] times. Note that we added in [`[$numZeroes+1]`] zeroes. +a. [``[$dec] \cdot [$power*10] =[$ans2]``] as we move the decimal point to the right [$numZeroes+1] times. Note that we added in [`[$numZeroes+1]`] zeroes. - [``[$dec] \cdot [$power*100] =[$ans3]``] as we move the decimal point to the right [$numZeroes+2] times. Note that we added in [`[$numZeroes+2]`] zeroes. +a. [``[$dec] \cdot [$power*100] =[$ans3]``] as we move the decimal point to the right [$numZeroes+2] times. Note that we added in [`[$numZeroes+2]`] zeroes. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals200.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals200.pg index 525d39ae42..c1337dc0b6 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals200.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals200.pg @@ -9,14 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals210.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals210.pg index c9073b92f4..0d569ef2b1 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals210.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals210.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticShiftingDecimals) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply','negative') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,9 +59,10 @@ TEXT(beginproblem()); BEGIN_PGML -It's give that [`[$int1]\cdot[$int2]=[$product1]`]. Use this fact to calculate the following without using a calculator: +It's given that [`[$int1]\cdot[$int2]=[$product1]`]. Use this fact to calculate the following without using a calculator. - [`` [$dec1](-[$dec2]) = ``] [___________]{$product2} +[`` [$dec1](-[$dec2]) = ``] +[___________]{$product2} END_PGML @@ -96,9 +99,10 @@ c) We move the decimal point of [`[$product1]`] to the left by [`[$move1]+[$move Again, don't forget to add back the negative symbol. -*Solution:* [`[$dec1](-[$dec2])=[$product2]`] +[`[$dec1](-[$dec2])=[$product2]`] END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals220.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals220.pg index c5f35e0f09..6d68c400e9 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals220.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals220.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.7') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticShiftingDecimals) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply','negative') +## DBCCSS('5.NBT.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,9 +59,10 @@ TEXT(beginproblem()); BEGIN_PGML -It's give that [`[$int1]\cdot[$int2]=[$product1]`]. Use this fact to calculate the following without using a calculator: +It's given that [`[$int1]\cdot[$int2]=[$product1]`]. Use this fact to calculate the following without using a calculator. - [`` (-[$dec1])(-[$dec2]) = ``] [___________]{$product2} +[`` (-[$dec1])(-[$dec2]) ``] +[___________]{$product2} END_PGML @@ -96,9 +99,10 @@ a) To change [`[$int1]`] to [`[$dec1]`], we moved the decimal point to the left b) To change [`[$int2]`] to [`[$dec2]`], we moved the decimal point to the left by [`[$move2]`] place(s). c) We move the decimal point of [`[$product1]`] to the left by [`[$move1]+[$move2]=[$move1+$move2]`] places to get [`[$dec1]\cdot[$dec2]=[$product2]`]. -*Solution:* [`` (-[$dec1])(-[$dec2]) = [$product2] ``] +[`` (-[$dec1])(-[$dec2]) = [$product2] ``] END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals230.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals230.pg index 118d09e63d..052e0f4021 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals230.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals230.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticShiftingDecimals) -## MLTleader(1) -## Level(3) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -78,17 +79,11 @@ BEGIN_PGML It's given that [`[$num00]\cdot[$num01]=[$product0]`]. Calculate the following without using a calculator. ----- - -[`[$num10] \cdot [$num11] `] = [___________]{$product1} - ----- - -[`[$num20] \cdot [$num21] `] = [___________]{$product2} +a. [`[$num10] \cdot [$num11] `] = [___________]{$product1} ----- +a. [`[$num20] \cdot [$num21] `] = [___________]{$product2} -[`[$num30] \cdot [$num31] `] = [___________]{$product3} +a. [`[$num30] \cdot [$num31] `] = [___________]{$product3} END_PGML @@ -121,7 +116,7 @@ Now, these two equations should make sense: If we divide [`15`] by [`10`] to get [`1.5`], we should divide [`225`] by [`10`] to get [`22.5`]. -####Question 1 +a. Compare [`[$num00]\cdot[$num01] `] with [`[$num10] \cdot [$num11] `], the decimal point moved to the left [@$movesToWords[1]@] in total; so the decimal point in the product should be moved to the left [@$movesToWords[1]@]: @@ -132,7 +127,7 @@ Compare [`[$num00]\cdot[$num01] `] with [`[$num10] \cdot [$num11] `], the decima \end{aligned} ``] -####Question 2 +b. Compare [`[$num00]\cdot[$num01] `] with [`[$num20] \cdot [$num21] `], the decimal point moved to the left [@$movesToWords[2]@] in total; so the decimal point in the product should be moved to the left [@$movesToWords[2]@]: @@ -143,7 +138,7 @@ Compare [`[$num00]\cdot[$num01] `] with [`[$num20] \cdot [$num21] `], the decima \end{aligned} ``] -####Question 3 +c. Compare [`[$num00]\cdot[$num01] `] with [`[$num30] \cdot [$num31] `], the decimal point moved to the left [@$movesToWords[3]@] in total; so the decimal point in the product should be moved to the left [@$movesToWords[3]@]: diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals240.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals240.pg index 07ae8ab53d..f3c3347113 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals240.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals240.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticShiftingDecimals) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -86,17 +88,11 @@ BEGIN_PGML It's given that [`[$num00]\cdot[$num01]=[$product0]`]. Calculate the following without using a calculator. ----- - -[`[$num10] \cdot [$num11] `] = [___________]{$product1} +a. [`[$num10] \cdot [$num11] `] = [___________]{$product1} ----- +a. [`[$num20] \cdot [$num21] `] = [___________]{$product2} -[`[$num20] \cdot [$num21] `] = [___________]{$product2} - ----- - -[`[$num30] \cdot [$num31] `] = [___________]{$product3} +a. [`[$num30] \cdot [$num31] `] = [___________]{$product3} END_PGML @@ -129,7 +125,7 @@ Now, these two equations should make sense: If we divide [`15`] by [`10`] to get [`1.5`], we should divide [`225`] by [`10`] to get [`22.5`]. -####Question 1 +a. Compare [`[$num00]\cdot[$num01] `] with [`[$num10] \cdot [$num11] `], the decimal point moved to the left [@$movesToWords[1]@] in total; so the decimal point in the product should be moved to the left [@$movesToWords[1]@]: @@ -140,7 +136,7 @@ Compare [`[$num00]\cdot[$num01] `] with [`[$num10] \cdot [$num11] `], the decima \end{aligned} ``] -####Question 2 +b. Compare [`[$num00]\cdot[$num01] `] with [`[$num20] \cdot [$num21] `], the decimal point moved to the left [@$movesToWords[2]@] in total; so the decimal point in the product should be moved to the left [@$movesToWords[2]@]: @@ -151,7 +147,7 @@ Compare [`[$num00]\cdot[$num01] `] with [`[$num20] \cdot [$num21] `], the decima \end{aligned} ``] -####Question 3 +c. Compare [`[$num00]\cdot[$num01] `] with [`[$num30] \cdot [$num31] `], the decimal point moved to the left [@$movesToWords[3]@] in total; so the decimal point in the product should be moved to the left [@$movesToWords[3]@]: @@ -166,3 +162,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals250.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals250.pg index 35a95cb666..8601fca6e6 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals250.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals250.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticShiftingDecimals) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -83,17 +85,11 @@ BEGIN_PGML It's given that [`[$num00]\cdot[$num01]=[$product0]`]. Calculate the following without using a calculator. ----- - -[`[$num10] \cdot [$num11] `] = [___________]{$product1} +a. [`[$num10] \cdot [$num11] `] = [___________]{$product1} ----- +a. [`[$num20] \cdot [$num21] `] = [___________]{$product2} -[`[$num20] \cdot [$num21] `] = [___________]{$product2} - ----- - -[`[$num30] \cdot [$num31] `] = [___________]{$product3} +a. [`[$num30] \cdot [$num31] `] = [___________]{$product3} END_PGML @@ -103,7 +99,7 @@ BEGIN_PGML_SOLUTION It's given that [`[$num00]\cdot[$num01]=[$product0]`]. -####Question 1 +a. Compare [`[$num00]\cdot[$num01] `] with [`[$num10] \cdot [$num11] `]. @@ -120,7 +116,7 @@ Put together both movements, the decimal point of the product [`[$product0]`] sh \end{aligned} ``] -####Question 2 +b. Compare [`[$num00]\cdot[$num01] `] with [`[$num20] \cdot [$num21] `]. @@ -137,7 +133,7 @@ Put together both movements, the decimal point of the product [`[$product0]`] sh \end{aligned} ``] -####Question 3 +c. Compare [`[$num00]\cdot[$num01] `] with [`[$num30] \cdot [$num31] `]. @@ -158,3 +154,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals30.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals30.pg index c18d115973..52139f15af 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals30.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalMultiplicationWithDecimal) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,11 +55,11 @@ BEGIN_PGML Calculate without using a calculator. Don't use commas in your answer. -[`[$dec] \cdot [$power] `] = [___________]{$ans1} +a. [`[$dec] \cdot [$power] `] = [___________]{$ans1} -[`[$dec] \cdot [$power*10] `] = [___________]{$ans2} +a. [`[$dec] \cdot [$power*10] `] = [___________]{$ans2} -[`[$dec] \cdot [$power*100] `] = [___________]{$ans3} +a. [`[$dec] \cdot [$power*100] `] = [___________]{$ans3} END_PGML @@ -72,13 +73,14 @@ else {$times = "$numZeroes".' times';} BEGIN_PGML_SOLUTION - [``[$dec] \cdot [$power] =[$ans1]``] as we move the decimal point to the right [$times]. +a. [``[$dec] \cdot [$power] =[$ans1]``] as we move the decimal point to the right [$times]. - [``[$dec] \cdot [$power*10] =[$ans2]``] as we move the decimal point to the right [$numZeroes+1] times. +a. [``[$dec] \cdot [$power*10] =[$ans2]``] as we move the decimal point to the right [$numZeroes+1] times. - [``[$dec] \cdot [$power*100] =[$ans3]``] as we move the decimal point to the right [$numZeroes+2] times. +a. [``[$dec] \cdot [$power*100] =[$ans3]``] as we move the decimal point to the right [$numZeroes+2] times. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals40.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals40.pg index ec4ea0d455..37f0084a30 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals40.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalMultiplicationWithDecimal) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,9 +59,9 @@ BEGIN_PGML Calculate without using a calculator. Don't use commas in your answer. -[`[$dec] \cdot [$power1] `] = [___________]{$ans1} +a. [`[$dec] \cdot [$power1] `] = [___________]{$ans1} -[`[$dec] \cdot [$power2] `] = [___________]{$ans2} +a. [`[$dec] \cdot [$power2] `] = [___________]{$ans2} END_PGML @@ -85,11 +87,12 @@ When a decimal is multiplied by [`10`], [`100`] or [`1000`], we can simply move *Solutions:* - [``[$dec] \cdot [$power1] =[$ans1]``] as we move the decimal point to the right [$times]. +a. [``[$dec] \cdot [$power1] =[$ans1]``] as we move the decimal point to the right [$times]. - [``[$dec] \cdot [$power2] =[$ans2]``] as we move the decimal point to the right [`[$place2]`] times. +a. [``[$dec] \cdot [$power2] =[$ans2]``] as we move the decimal point to the right [`[$place2]`] times. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals50.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals50.pg index c553762229..6def02daba 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals50.pg @@ -9,14 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Integer division) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','divide') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,11 +57,11 @@ BEGIN_PGML Calculate without using a calculator. Don't use commas in your answer. -[`[$dec] \div [$divisor] `] = [___________]{$ans1} +a. [`[$dec] \div [$divisor] `] = [___________]{$ans1} -[`[$dec] \div [$divisor*10] `] = [___________]{$ans2} +a. [`[$dec] \div [$divisor*10] `] = [___________]{$ans2} -[`[$dec] \div [$divisor*100] `] = [___________]{$ans3} +a. [`[$dec] \div [$divisor*100] `] = [___________]{$ans3} END_PGML @@ -85,13 +89,13 @@ When [`2000`] is divided by [`1000`], we move the decimal point to the left 3 ti When an integer is divided by [`10`], [`100`] or [`1000`], we move the decimal point to the left by [`1`], [`2`] or [`3`] times. -*Solution:* +*Solutions:* - [``[$dec] \div [$divisor] =[$ans1]``] as we move the decimal point to the left once. +a. [``[$dec] \div [$divisor] =[$ans1]``] as we move the decimal point to the left once. - [``[$dec] \div [$divisor*10] =[$ans2]``] as we move the decimal point to the left twice. +a. [``[$dec] \div [$divisor*10] =[$ans2]``] as we move the decimal point to the left twice. - [``[$dec] \div [$divisor*100] =[$ans3]``] as we move the decimal point to the left [`[$divisorZeroes+2]`] times. +a. [``[$dec] \div [$divisor*100] =[$ans3]``] as we move the decimal point to the left [`[$divisorZeroes+2]`] times. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals60.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals60.pg index 4eb7e4c0bb..3553cf6f83 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals60.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Integer division) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalDivision) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','divide') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -49,13 +50,13 @@ TEXT(beginproblem()); BEGIN_PGML -Write the following as decimal numbers without using a calculator. +Calculate without using a calculator. -[`[$int] \div 10 `] = [___________]{$ans1} +a. [`[$int] \div 10 `] = [___________]{$ans1} -[`[$int] \div 100 `] = [___________]{$ans2} +a. [`[$int] \div 100 `] = [___________]{$ans2} -[`[$int] \div 1000 `] = [___________]{$ans3} +a. [`[$int] \div 1000 `] = [___________]{$ans3} END_PGML @@ -83,15 +84,16 @@ When [`2000`] is divided by [`1000`], we move the decimal point to the left 3 ti When a number is divided by [`10`], [`100`] or [`1000`], we move the decimal point to the left [`1`], [`2`] or [`3`] times, respectively. -*Solution:* +*Solutions:* - [``[$int] \div 10 =[$ans1]``] as we move the decimal point to the left once. +a. [``[$int] \div 10 =[$ans1]``] as we move the decimal point to the left once. - [``[$int] \div 100 =[$ans2]``] as we move the decimal point to the left twice. Note that we need to add in one zero. +a. [``[$int] \div 100 =[$ans2]``] as we move the decimal point to the left twice. Note that we need to add in one zero. - [``[$int] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in two zeroes. +a. [``[$int] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in two zeroes. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals70.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals70.pg index 3f94140267..a999864032 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals70.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Integer division) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalDivision) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','divide') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,11 +52,11 @@ BEGIN_PGML Calculate without using a calculator. -[`[$int] \div 10 `] = [___________]{$ans1} +a. [`[$int] \div 10 `] = [___________]{$ans1} -[`[$int] \div 100 `] = [___________]{$ans2} +a. [`[$int] \div 100 `] = [___________]{$ans2} -[`[$int] \div 1000 `] = [___________]{$ans3} +a. [`[$int] \div 1000 `] = [___________]{$ans3} END_PGML @@ -84,13 +86,14 @@ When a number is divided by [`10`], [`100`] or [`1000`], we move the decimal poi *Solution:* - [``[$int] \div 10 =[$ans1]``] as we move the decimal point to the left once. +a. [``[$int] \div 10 =[$ans1]``] as we move the decimal point to the left once. - [``[$int] \div 100 =[$ans2]``] as we move the decimal point to the left twice. +a. [``[$int] \div 100 =[$ans2]``] as we move the decimal point to the left twice. - [``[$int] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in one zero. +a. [``[$int] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in one zero. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals80.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals80.pg index ceea4a0bae..9778a0f53a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals80.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Division) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalDivision) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','divide') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,11 +52,11 @@ BEGIN_PGML Calculate without using a calculator. -[`[$dec] \div 10 `] = [___________]{$ans1} +a. [`[$dec] \div 10 `] = [___________]{$ans1} -[`[$dec] \div 100 `] = [___________]{$ans2} +a. [`[$dec] \div 100 `] = [___________]{$ans2} -[`[$dec] \div 1000 `] = [___________]{$ans3} +a. [`[$dec] \div 1000 `] = [___________]{$ans3} END_PGML @@ -82,15 +84,16 @@ When [`2000`] is divided by [`1000`], we move the decimal point to the left 3 ti When a number is divided by [`10`], [`100`] or [`1000`], we move the decimal point to the left [`1`], [`2`] or [`3`] times, respectively. -*Solution:* +*Solutions:* - [``[$dec] \div 10 =[$ans1]``] as we move the decimal point to the left once. +a. [``[$dec] \div 10 =[$ans1]``] as we move the decimal point to the left once. - [``[$dec] \div 100 =[$ans2]``] as we move the decimal point to the left twice. +a. [``[$dec] \div 100 =[$ans2]``] as we move the decimal point to the left twice. - [``[$dec] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in one zero. +a. [``[$dec] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in one zero. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals90.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals90.pg index 3e57a784c5..3db1952f48 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/MultiplyDivideDecimals90.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticMentalMultiplication) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','multiply') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -51,11 +52,11 @@ BEGIN_PGML Calculate without using a calculator. -[`[$int] \cdot 0.1 `] = [___________]{$ans1} +a. [`[$int] \cdot 0.1 `] = [___________]{$ans1} -[`[$int] \cdot 0.01 `] = [___________]{$ans2} +a. [`[$int] \cdot 0.01 `] = [___________]{$ans2} -[`[$int] \cdot 0.001 `] = [___________]{$ans3} +a. [`[$int] \cdot 0.001 `] = [___________]{$ans3} END_PGML @@ -73,13 +74,14 @@ Similarly, multiplying by [`0.01`] is the same as dividing by [`100`]; multiplyi *Solutions:* - [``[$int] \cdot 0.1 = [$int] \div 10 =[$ans1]``] as we move the decimal point to the left once. +a. [``[$int] \cdot 0.1 = [$int] \div 10 =[$ans1]``] as we move the decimal point to the left once. - [``[$int] \cdot 0.01 = [$int] \div 100 =[$ans2]``] as we move the decimal point to the left twice. Note that we need to add in one zero. +a. [``[$int] \cdot 0.01 = [$int] \div 100 =[$ans2]``] as we move the decimal point to the left twice. Note that we need to add in one zero. - [``[$int] \cdot 0.001 = [$int] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in two zeroes. +a. [``[$int] \cdot 0.001 = [$int] \div 1000 =[$ans3]``] as we move the decimal point to the left three times. Note that we need to add in two zeroes. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals10.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals10.pg index fc9489f44e..a71a6da0bb 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals10.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.3.b') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticOrderingPositiveDecimals) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','compare') +## DBCCSS('5.NBT.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,8 +31,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -75,9 +76,8 @@ Order these decimals from biggest to smallest: [`` [@$nums[0]@], [@$nums[1]@], [@$nums[2]@] ``] ----- -[___________]{$ans0} > [___________]{$ans1} > [___________]{$ans2} + [___________]{$ans0} > [___________]{$ans1} > [___________]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals15.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals15.pg index 962029f07f..fc5068d38b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals15.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals15.pg @@ -9,18 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.3.b') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticOrderingNegativeDecimals) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','compare','negative') - +## DBCCSS('5.NBT.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,8 +31,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -76,9 +76,7 @@ Order these decimals from biggest to smallest: [`` [@$nums[0]@], [@$nums[1]@], [@$nums[2]@] ``] ----- - -[___________]{$ans2} > [___________]{$ans1} > [___________]{$ans0} + [___________]{$ans2} > [___________]{$ans1} > [___________]{$ans0} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals20.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals20.pg index 3431470d1a..0896b2c794 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals20.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.3.b') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticOrderingPositiveDecimals) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','compare') +## DBCCSS('5.NBT.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,8 +31,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -75,9 +77,7 @@ Order these decimals from biggest to smallest: [`` [@$nums[0]@], [@$nums[1]@], [@$nums[2]@] ``] ----- - -[___________]{$ans0} > [___________]{$ans1} > [___________]{$ans2} + [___________]{$ans0} > [___________]{$ans1} > [___________]{$ans2} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals25.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals25.pg index ff16bb46de..68e8d42a83 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals25.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals25.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.3.b') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticOrderingNegativeDecimals) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','compare','negative') - +## DBCCSS('5.NBT.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,8 +31,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -76,9 +77,7 @@ Order these decimals from biggest to smallest: [`` [@$nums[0]@], [@$nums[1]@], [@$nums[2]@] ``] ----- - -[___________]{$ans2} > [___________]{$ans1} > [___________]{$ans0} + [___________]{$ans2} > [___________]{$ans1} > [___________]{$ans0} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals30.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals30.pg index c770e9a7a7..7df776f607 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals30.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.3.b') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticOrderingPositiveDecimals) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','compare') +## DBCCSS('5.NBT.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,8 +31,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -75,9 +77,7 @@ Order these decimals from biggest to smallest: [`` [@$nums[0]@], [@$nums[1]@], [@$nums[2]@] ``] ----- - -[___________]{$ans0} > [___________]{$ans1} > [___________]{$ans2} + [___________]{$ans0} > [___________]{$ans1} > [___________]{$ans2} END_PGML @@ -85,8 +85,6 @@ END_PGML BEGIN_PGML_SOLUTION -3.2>1.302>1.23 - The number [`[$ans0]`] is like [`[$int2]`] dollars and [`[$int1]`] dimes. The number [`[$ans1]`] is like [`[$int0]`] dollars, [`[$int2]`] dimes and [@numberWord($int1)@] tenths of a cent. diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals35.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals35.pg index 91d1105107..0f097c16fb 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals35.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals35.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.3.b') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicArithmeticOrderingNegativeDecimals) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','compare','negative') - +## DBCCSS('5.NBT.3.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,8 +31,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -76,9 +77,7 @@ Order these decimals from biggest to smallest: [`` [@$nums[0]@], [@$nums[1]@], [@$nums[2]@] ``] ----- - -[___________]{$ans2} > [___________]{$ans1} > [___________]{$ans0} + [___________]{$ans2} > [___________]{$ans1} > [___________]{$ans0} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals40.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals40.pg index 6e3755fc78..958c7b4376 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals40.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.3') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicDecimalEquivalents) -## MLTleader(1) -## Level(2) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('decimal','compare') +## DBCCSS('5.NBT.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,7 +54,7 @@ Context()->texStrings; $mc = new_checkbox_multiple_choice(); $mc -> qa ( -"Check all numbers which are equivalent to \($dec\)$BR", +"Check all numbers which is equivalent to \($dec\)$BR", "\($given[0]\) $BR", "\($given[1]\) $BR", ); diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals50.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals50.pg index baa4feeb86..7e6ca6c73f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/OrderDecimals50.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT.3') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicDecimalEquivalents) -## Level(2) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('decimal','compare') - +## DBCCSS('5.NBT.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals10.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals10.pg index 9cc1d8654f..387b68d5ce 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals10.pg @@ -10,17 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Converting between fractions and decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicConvertingFromMixedToDecimal) -## MLTleader(1) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,8 +32,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -55,11 +56,11 @@ BEGIN_PGML Write the following decimals: -[$intWord] and [$decWord] tenths = [_________]{$ans1} +a. [$intWord] and [$decWord] tenths = [_________]{$ans1} -[$intWord] and [$decWord] hundredths = [_________]{$ans2} +a. [$intWord] and [$decWord] hundredths = [_________]{$ans2} -[$intWord] and [$decWord] thousandths = [_________]{$ans3} +a. [$intWord] and [$decWord] thousandths = [_________]{$ans3} END_PGML @@ -77,11 +78,11 @@ Let's review decimal place values. In the decimal [`1.234`]: *Solutions:* -[$intWord] and [$decWord] tenths = [`[$ans1]`] +a. [$intWord] and [$decWord] tenths = [`[$ans1]`] -[$intWord] and [$decWord] hundredths = [`[$ans2]`] +a. [$intWord] and [$decWord] hundredths = [`[$ans2]`] -[$intWord] and [$decWord] thousandths = [`[$ans3]`] +a. [$intWord] and [$decWord] thousandths = [`[$ans3]`] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals20.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals20.pg index 01f919bd65..d08e2fce73 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals20.pg @@ -10,17 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Converting between fractions and decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicConvertingFromMixedToDecimal) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal') - +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,8 +32,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -56,9 +57,9 @@ BEGIN_PGML Write the following decimals: -[$intWord] and [$decWord] hundredths = [_________]{$ans1} +a. [$intWord] and [$decWord] hundredths = [_________]{$ans1} -[$intWord] and [$decWord] thousandths = [_________]{$ans2} +a. [$intWord] and [$decWord] thousandths = [_________]{$ans2} END_PGML @@ -72,9 +73,9 @@ If a decimal reads "## thousandths", it implies three decimal places. *Solutions:* -[$intWord] and [$decWord] hundredths = [`[$ans1]`] +a. [$intWord] and [$decWord] hundredths = [`[$ans1]`] -[$intWord] and [$decWord] thousandths = [`[$ans2]`] +a. [$intWord] and [$decWord] thousandths = [`[$ans2]`] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals30.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals30.pg index 004f8f124f..3a8337b5b1 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals30.pg @@ -10,16 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Converting between fractions and decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicConvertingFromMixedToDecimal) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,8 +32,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals40.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals40.pg index d9455cfe05..f3cc896aa2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals40.pg @@ -10,16 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Converting between fractions and decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicConvertingFromMixedToDecimal) -## Level(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,8 +32,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -56,9 +58,9 @@ BEGIN_PGML Write the following decimals: -[$intWord] and [$dec10Word] tenths = [_________]{$ans} +a. [$intWord] and [$dec10Word] tenths = [_________]{$ans} -[$intWord] and [$dec100Word] hundredths = [_________]{$ans} +a. [$intWord] and [$dec100Word] hundredths = [_________]{$ans} END_PGML @@ -76,3 +78,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals50.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals50.pg index eed1dd64d6..0cefa7c138 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals50.pg @@ -9,17 +9,19 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal') ## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Converting between fractions and decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicConvertingFromDecimalToMixed) -## MLTleader(1) -## Level(1) -## KEYWORDS('decimal') ############################################## @@ -29,9 +31,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", "PGchoicemacros.pl", - "PGcourse.pl" ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals60.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals60.pg index 458c6a2171..ccc8d496bc 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals60.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Converting between fractions and decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicConvertingFromDecimalToMixed) -## Level(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('decimal') - +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,13 +30,14 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", "PGchoicemacros.pl", - "PGcourse.pl" ); ############################################## +TEXT(beginproblem()); Context("LimitedNumeric"); $int=random(1,9,1); @@ -77,7 +79,6 @@ $mc -> extra( Context()->normalStrings; -TEXT(beginproblem()); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals70.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals70.pg index f0b34c0928..be6467696f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals70.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Converting between fractions and decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicConvertingFromDecimalToMixed) -## Level(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('decimal') - +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,13 +30,14 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", "PGchoicemacros.pl", - "PGcourse.pl" ); ############################################## +TEXT(beginproblem()); Context("LimitedNumeric"); $int=random(1,9,1); @@ -79,7 +81,6 @@ $mc -> extra( Context()->normalStrings; -TEXT(beginproblem()); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals80.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals80.pg index 220b47629f..4dd0f6e180 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/ReadDecimals80.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Converting between fractions and decimals) -## Institution(PCC) -## Author(Carl Yao) -## MLT(basicConvertingFromDecimalToMixed) -## Level(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('decimal') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,13 +30,14 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", "PGchoicemacros.pl", - "PGcourse.pl" ); ############################################## +TEXT(beginproblem()); Context("LimitedNumeric"); $int=random(10,99,1); @@ -76,7 +79,6 @@ $mc -> extra( Context()->normalStrings; -TEXT(beginproblem()); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/RoundingDecimals10.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/RoundingDecimals10.pg index 079c5d8911..538e87869f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/RoundingDecimals10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/RoundingDecimals10.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Estimation) -## Institution(PCC) -## Author(Carl Yao) -## MLT(roundingDecimalPlaces) -## MLTleader(1) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','round') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,13 +61,13 @@ BEGIN_PGML Round the decimal [`[$dec]`] to the specified places. -Round to a whole number: [___________]{$ans1} +a. Round to a whole number: [___________]{$ans1} -Round to the tenth place: [___________]{$ans2} +a. Round to the tenth place: [___________]{$ans2} -Round to the hundredth place: [___________]{$ans3} +a. Round to the hundredth place: [___________]{$ans3} -Round to the thousandth place: [___________]{$ans4} +a. Round to the thousandth place: [___________]{$ans4} END_PGML @@ -104,25 +105,25 @@ First, let's review place values. For the decimal [`[$dec]`], we identify: To round [`[$dec]`] to a whole number, we first look at the digit *following* the unit digit: The tenth place is [`[$tenth]`]. Since this digit is [@greaterOrSmaller($tenth)@], we [@upOrDown($tenth)@]. -*Solution:* [`[$dec]`] rounded to a whole number is [`[$ans1]`]. +[`[$dec]`] rounded to a whole number is [`[$ans1]`]. ###Round to the tenth place: To round [`[$dec]`] to the tenth place, we first look at the digit *following* the tenth place: The hundredth place is [`[$hundredth]`]. Since this digit is [@greaterOrSmaller($hundredth)@], we [@upOrDown($hundredth)@]. -*Solution:* [`[$dec]`] rounded to the tenth place is [`[$ans2]`]. +[`[$dec]`] rounded to the tenth place is [`[$ans2]`]. ###Round to the hundredth place: To round [`[$dec]`] to the hundredth place, we first look at the digit *following* the hundredth place: The thousandth place is [`[$thousandth]`]. Since this digit is [@greaterOrSmaller($thousandth)@], we [@upOrDown($thousandth)@]. -*Solution:* [`[$dec]`] rounded to the hundredth place is [`[$ans3]`]. +[`[$dec]`] rounded to the hundredth place is [`[$ans3]`]. ###Round to the thousandth place: To round [`[$dec]`] to the thousandth place, we first look at the digit *following* the thousandth place: The ten-thousandth place is [`[$tenThousandth]`]. Since this digit is [@greaterOrSmaller($tenThousandth)@], we [@upOrDown($tenThousandth)@]. -*Solution:* [`[$dec]`] rounded to the thousandth place is [`[$ans4]`]. +[`[$dec]`] rounded to the thousandth place is [`[$ans4]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/RoundingDecimals20.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/RoundingDecimals20.pg index d2a5293907..efa18e8a87 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/RoundingDecimals20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/RoundingDecimals20.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NBT') - -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Estimation) -## Institution(PCC) -## Author(Carl Yao) -## MLT(roundingDecimalPlaces) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','round') +## DBCCSS('5.NBT') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -67,13 +69,13 @@ BEGIN_PGML Round the decimal [`[$dec]`] to the specified places. -Round to a whole number: [___________]{$ans1} +a. Round to a whole number: [___________]{$ans1} -Round to the tenth place: [___________]{$ans2} +a. Round to the tenth place: [___________]{$ans2} -Round to the hundredth place: [___________]{$ans3} +a. Round to the hundredth place: [___________]{$ans3} -Round to the thousandth place: [___________]{$ans4} +a. Round to the thousandth place: [___________]{$ans4} END_PGML @@ -111,27 +113,28 @@ First, let's review place values. For the decimal [`[$dec]`], we identify: To round [`[$dec]`] to a whole number, we first look at the digit *following* the unit digit: The tenth place is [`[$tenth]`]. Since this digit is [@greaterOrSmaller($tenth)@], we [@upOrDown($tenth)@]. -*Solution:* [`[$dec]`] rounded to a whole number is [`[$ans1]`]. +[`[$dec]`] rounded to a whole number is [`[$ans1]`]. ###Round to the tenth place: To round [`[$dec]`] to the tenth place, we first look at the digit *following* the tenth place: The hundredth place is [`[$hundredth]`]. Since this digit is [@greaterOrSmaller($hundredth)@], we [@upOrDown($hundredth)@]. -*Solution:* [`[$dec]`] rounded to the tenth place is [`[$ans2]`]. +[`[$dec]`] rounded to the tenth place is [`[$ans2]`]. ###Round to the hundredth place: To round [`[$dec]`] to the hundredth place, we first look at the digit *following* the hundredth place: The thousandth place is [`[$thousandth]`]. Since this digit is [@greaterOrSmaller($thousandth)@], we [@upOrDown($thousandth)@]. -*Solution:* [`[$dec]`] rounded to the hundredth place is [`[$ans3]`]. +[`[$dec]`] rounded to the hundredth place is [`[$ans3]`]. ###Round to the thousandth place: To round [`[$dec]`] to the thousandth place, we first look at the digit *following* the thousandth place: The ten-thousandth place is [`[$tenThousandth]`]. Since this digit is [@greaterOrSmaller($tenThousandth)@], we [@upOrDown($tenThousandth)@]. -*Solution:* [`[$dec]`] rounded to the thousandth place is [`[$ans4]`]. +[`[$dec]`] rounded to the thousandth place is [`[$ans4]`]. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/WriteDecimalByGraph10.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/WriteDecimalByGraph10.pg index 7ab2fdd6c8..e44df8c850 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/WriteDecimalByGraph10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/WriteDecimalByGraph10.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','graph') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Decimal/WriteDecimalByGraph20.pg b/OpenProblemLibrary/PCC/BasicMath/Decimal/WriteDecimalByGraph20.pg index 3f8002ec25..80a6a7441e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Decimal/WriteDecimalByGraph20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Decimal/WriteDecimalByGraph20.pg @@ -7,14 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Interpreting decimals) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('decimal','graph') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems10.pg index 87174b940f..e216498c63 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems10.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(fractionApplicationSum) -## MLTleader(1) -## Level(5) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','addition','application') +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -67,7 +68,7 @@ BEGIN_PGML [$name] walked [`[$first]`] of a mile in the morning, and then walked [`[$second]`] of a mile in the afternoon. How far did [$name] walk altogether? - [$name] walked a total of [___________]{$total} of a mile. +[$name] walked a total of [___________]{$total} of a mile. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems20.pg index 9f6df40370..54ef0a9d41 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems20.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('fraction','addition','application') ## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(fractionApplicationSum) -## Level(5) -## KEYWORDS('fraction','addition','application') ############################################## @@ -26,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -109,3 +112,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems30.pg index 800588fdd5..10d6206fd4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems30.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','addition','application') -## MLTleader(1) -## MLT(arithmetic_fractions_application_paint) +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -63,7 +65,7 @@ BEGIN_PGML A room needs to be painted. It would take [$name1] [`[$den1]`] hours to paint the whole room, and it would take [$name2] [`[$den2]`] hours to paint the whole room. If they work together, what fraction of the room can be painted in one hour? - If they work together, they can paint [___________]{$total} of the room in one hour. +If they work together, they can paint [___________]{$total} of the room in one hour. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems40.pg index 42b65fc180..473fbf0279 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems40.pg @@ -8,29 +8,31 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(rationalRectanglePerimeter) -## MLTleader(1) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('perimeter','rectangle','add','fraction') +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,12 +52,10 @@ do { ($ansNum,$ansDen) = $perimeter->value; } until ( ($perimeter<1) && ($ansDen!=$den1) ); -$bigger = max($base,$height); - $xmin = 0; #The viewing window -$xmax = $bigger+0.2; +$xmax = $base*1.15; $ymin = 0; -$ymax = $xmax; +$ymax = $height*1.15; @x = (($xmax-$base)/2,($xmax+$base)/2); @y = (($ymax-$height)/2,($ymax+$height)/2); @@ -63,10 +63,10 @@ $ymax = $xmax; $cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/10; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[240,240*$ymax/$xmax]); -$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-0.01,"$num1/$den1 m",'black','center','middle')); -$picture->lb( new Label($x[1]-0.01,($y[0]+$y[1])/2,"$num2/$den2 m",'black','right','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0],"$num1/$den1 m",'black','center','bottom')); +$picture->lb( new Label($x[1],($y[0]+$y[1])/2,"$num2/$den2 m",'black','right','middle')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -92,18 +92,14 @@ $picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,3); TEXT(beginproblem()); $refreshCachedImages = 1; -BEGIN_TEXT +BEGIN_PGML -Find the perimeter of the rectangle.$PAR +Find the perimeter of the rectangle. -$BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') \} -$ECENTER -$PAR +>>[@ image(insertGraph( $picture ), tex_size=>400, height=>(240*$ymax/$xmax), width=>240, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') @]* +<< -END_TEXT -BEGIN_PGML - Its perimeter is [_____________]{$perimeter} meters. (Use a fraction in your answer.) +Its perimeter is [_____________]{$perimeter} meters. (Use a fraction in your answer.) END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems50.pg index 7cfb968cee..3dc1407214 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems50.pg @@ -8,29 +8,33 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(rationalRectanglePerimeter) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('perimeter','rectangle','add','fraction','mixed number') - +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "parserFormulaWithUnits.pl", + "contextLimitedRadical.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -52,23 +56,22 @@ do { ($ansNum,$ansDen) = $perimeter->value; } until ($perimeter<1); -$bigger = max($base,$height); $xmin = 0; #The viewing window -$xmax = $bigger+0.1; +$xmax = $base*240/210; $ymin = 0; -$ymax = $xmax; +$ymax = (210*$height/$base+30)*$height/(210*$height/$base); @x = (($xmax-$base)/2,($xmax+$base)/2); @y = (($ymax-$height)/2,($ymax+$height)/2); -$cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/15; +$cornersize = $xmax*10/240; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[240,240*$ymax/$xmax]); -$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-0.01,"$int1 $num1/$den1 m",'black','center','middle')); -$picture->lb( new Label($x[1]-0.01,($y[0]+$y[1])/2,"$int2 $num2/$den2 m",'black','right','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0],"$int1 $num1/$den1 m",'black','center','top','large')); +$picture->lb( new Label($x[0],($y[0]+$y[1])/2,"$int2 $num2/$den2 m",'black','center','bottom','large','vertical')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -83,10 +86,12 @@ foreach $i (0,1) { foreach $j (0,1) { $picture->moveTo($x[$i]+(-1)**$i*$cornersize,$y[$j]); -$picture->lineTo($x[$i]+(-1)**$i*$cornersize,$y[$j]+(-1)**$j*$cornersize, darkblue,3); -$picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,3); +$picture->lineTo($x[$i]+(-1)**$i*$cornersize,$y[$j]+(-1)**$j*$cornersize, darkblue,1); +$picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,1); }} +Context("LimitedRadical"); +$perimeterU = FormulaWithUnits("$perimeter m"); ############################################## @@ -94,23 +99,23 @@ $picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,3); TEXT(beginproblem()); $refreshCachedImages = 1; -BEGIN_TEXT +BEGIN_PGML -Find the perimeter of the rectangle.$PAR +Find the perimeter of the rectangle below. [@KeyboardInstructions('(Use a fraction in your answer. Use [|m|]* for meters.)')@]** -$BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') \} -$ECENTER -$PAR +[____________]{$perimeterU} + +>>[@ image(insertGraph( $picture ), tex_size=>400, height=>(240*$ymax/$xmax), width=>240, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') @]*<< -END_TEXT -BEGIN_PGML - Its perimeter is [_____________]{$perimeter} meters. (Use a fraction in your answer.) END_PGML ############################################## +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>0); +Context()->flags->set(showMixedNumbers=>1); + $com = lcm($den1,$den2); $frac3 = Fraction($num1*$com/$den1+$num2*$com/$den2,$com); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems60.pg index d1332cbc22..f9343f7a3d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems60.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingRationalApplication) -## MLTleader(1) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('fraction','graph','application','pie chart') +## DBCCSS('3.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +29,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", + "PGcourse.pl", + "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -53,15 +55,18 @@ do { ($num[4],$den[4]) = $frac[4]->value; } until (($frac[4]>0) && ($den[4]<10) && ($den[1]<$den[2])); -$scale = 2; -$downshift = -0.4; -$radius = 1; -$gr = init_graph(-$scale,-$scale,$scale,$scale, -size=>[400,400] +$xmin = -200; +$xmax =200; +$ymin = -120; +$ymax = 120; +$downshift = -6; +$radius = 94; +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +size=>[400,240] ); $title = "School Population Breakdown by Race"; -$gr->lb( new Label(0, $scale/1.5,$title,'black','center','middle')); +$gr->lb( new Label(0, $ymax,$title,'black','center','top')); $xfunc = sub { my $t = shift(); return $radius*cos($t); }; @@ -92,10 +97,10 @@ for my $i (0..3) { $end0y = $radius*sin($fracCumulative[$i]*2*pi)+$downshift; $end1x = $radius*cos($fracCumulative[$i+1]*2*pi); $end1y = $radius*sin($fracCumulative[$i+1]*2*pi)+$downshift; - $end2x = $radius/2*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); - $end2y = $radius/2*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; - $end3x = 1.3*$radius*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); - $end3y = 1.3*$radius*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; + $end2x = 0.67*$radius*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); + $end2y = 0.67*$radius*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; + $end3x = 1.05*$radius*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); + $end3y = 1.05*$radius*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; $gr->moveTo(0,0+$downshift); $gr->lineTo($end0x,$end0y,'blue',1); @@ -103,8 +108,11 @@ for my $i (0..3) { $gr->lineTo($end1x,$end1y,'blue',1); $gr->fillRegion([$end2x,$end2y,$color[$i]]); - $gr->lb( new Label($end2x, $end2y,"$num[$i+1]/$den[$i+1]",'black','center','middle')); - $gr->lb( new Label($end3x, $end3y,$legend[$i],'black','center','middle')); + $lcr = ($end3x < 0) ? 'right' : 'left' ; + $tmb = ($end3y < 0) ? 'top' : 'bottom' ; + + $gr->lb( new Label($end2x, $end2y,"$num[$i+1]/$den[$i+1]",'black','center','middle','small')); + $gr->lb( new Label($end3x, $end3y,$legend[$i],'black',$lcr,$tmb,'small')); } $sum = $frac[1]+$frac[2]; @@ -116,12 +124,14 @@ $alt = "This is a pie chart about a school population breakdown by race. The sch BEGIN_PGML ->>[@image( insertGraph($gr), width=>400, - height=>400, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< +The pie chart represents a school's student population. + +>>[@image( insertGraph($gr), width=>500, + height=>300, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< -The pie chart represents a school's student population. +[@KeyboardInstructions('Fill in the blank with a fraction.')@]** -Together, white and black students make up (as a fraction) [__________]{$sum} of the school's population. +Together, white and black students make up [__________]{$sum} of the school's population. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems70.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems70.pg index ae3726f386..2290d0c152 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionAdditionWordProblems70.pg @@ -8,30 +8,32 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLTleader(1) -## MLT(arithmetic_fractions_application_bar_graph) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('add','fraction','bar graph') +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -103,7 +105,7 @@ $ymin = -$yscale*$yCover; $ymax = (1+$yscale)*$yCover; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[400,240]); $picture->lb('reset'); $picture->moveTo(0,0); @@ -151,15 +153,15 @@ BEGIN_TEXT The following bar graph shows the distance different runners ran in a relay race. $PAR $BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} +\{ image(insertGraph( $picture ), tex_size=>400, height=>240, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} $ECENTER $PAR END_TEXT BEGIN_PGML -Identify the two participants who ran the shortest distances. +Identify those two runners who ran the shortest distances. -These ran a total of [_____________]{$ans} miles. (Use a fraction for your answer.) +Those two runners ran a total of [_____________]{$ans} miles. (Use a fraction in your answer.) END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems10.pg index b600a3db81..9338bfc909 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems10.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','division','application') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -54,9 +55,9 @@ TEXT(beginproblem()); BEGIN_PGML -A school just won a grant but administrators are only allowed to spend [`[$part]`] of the grant funds each month. Grant requirements allow [`[$total]`] of the monies to be used to purchase new equipment which will be purchased using all of the available funding in the first months. +A school just won a grant, and decided to spend [`[$total]`] of the grant to purchase new equipment. School administrators plan to spend [`[$part]`] of that amount of money each month. How many months does it take to spend all the money allocated to purchase new equipment? -Under this plan, it will take [_________] months to purchase the allowed new equipment. +It will take [_________] months to spend all the money allocated to purchase new equipment. END_PGML @@ -99,3 +100,5 @@ It will take [`[$months]`] months to spend all the money allocated to purchase n END_PGML_SOLUTION ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems20.pg index c06198c3be..b762a62e3d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems20.pg @@ -7,16 +7,20 @@ # # ENDDESCRIPTION +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('fraction','division','application') ## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## KEYWORDS('fraction','division','application') ############################################## DOCUMENT(); @@ -25,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -90,3 +94,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems30.pg index b1098a0288..3e574d831f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems30.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','division','application') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -50,17 +51,15 @@ $families = $total/$piece; Context("LimitedFraction"); $families = Compute($families); -$food = list_random("rice", "pasta", "beans"); - ############################################## TEXT(beginproblem()); BEGIN_PGML -A food bank just received [`[$total]`] kilograms of [$food]. Each family in need is to receive [`[$piece]`] kilograms of [$food]. How many families can be served with the [`[$total]`] kilograms of [$food]? +A food bank just received [`[$total]`] kilograms of emergency food. Each family in need is to receive [`[$piece]`] kilograms of food. How many families can be served with the [`[$total]`] kilograms of food? -[__________] families can be served with the [`[$total]`] kilograms of [$food]. +[__________] families can be served with the [`[$total]`] kilograms of food. END_PGML @@ -98,9 +97,10 @@ We can address this problem as repeatedly taking away [`[$piece]`] kilograms fro \end{aligned} ``] -[`[$families]`] families can be served with the [`[$total]`] kilograms of [$food]. +[`[$families]`] families can be served with the [`[$total]`] kilograms of food. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems40.pg index acf743c953..69e17b6bf1 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems40.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','division','application') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -101,3 +102,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems50.pg index ad098ecadb..2145800b34 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems50.pg @@ -7,17 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('fraction','division','application') ## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## MO(1) -## KEYWORDS('fraction','division','application') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -103,3 +105,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems60.pg index 8d22f43f1a..4d2276929a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionDivisionWordProblems60.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','division','application') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -105,3 +106,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems10.pg index d01aa16c92..96562c9633 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems10.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','multiplication','application') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -75,9 +77,10 @@ In this problem, to find [`[$frac]`] of [`[$originalU]`], we do: \end{aligned} ``] -*Solution:* The car is worth [`[$currentU]`] now. +The car is worth [`[$currentU]`] now. END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems20.pg index f6e7fbba81..a034b6fec1 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems20.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','multiplication','application') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -103,3 +104,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems30.pg index a862ac596a..7d555a3470 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems30.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','multiplication','application') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -79,3 +81,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems40.pg index f899513d86..70ffcd600b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems40.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('fraction','multiplication','application') ## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## KEYWORDS('fraction','multiplication','application') ############################################## @@ -26,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -92,3 +95,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems50.pg index 83c3227af1..d36d04a27f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems50.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('fraction','multiplication','application') ## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## KEYWORDS('fraction','multiplication','application') ############################################## @@ -26,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -113,3 +116,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems60.pg index edb30660bf..7a7ac667c2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems60.pg @@ -7,27 +7,33 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(rationalRectanglePerimeter) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','rectangle','multiply','fraction') +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "parserFormulaWithUnits.pl", + "contextLimitedRadical.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -48,23 +54,22 @@ do { } until ($ansDen!=$den1*$den2); -$bigger = max($base,$height); $xmin = 0; #The viewing window -$xmax = $bigger+0.2; +$xmax = $base*240/210; $ymin = 0; -$ymax = $xmax; +$ymax = (210*$height/$base+30)*$height/(210*$height/$base); @x = (($xmax-$base)/2,($xmax+$base)/2); @y = (($ymax-$height)/2,($ymax+$height)/2); -$cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/15; +$cornersize = $xmax*10/240; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[240,240*$ymax/$xmax]); -$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-0.03,"$num1/$den1 m",'black','center','middle')); -$picture->lb( new Label($x[1]-0.01,($y[0]+$y[1])/2,"$num2/$den2 m",'black','right','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0],"$num1/$den1 m",'black','center','top','large')); +$picture->lb( new Label($x[0],($y[0]+$y[1])/2,"$num2/$den2 m",'black','center','bottom','large','vertical')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -79,34 +84,33 @@ foreach $i (0,1) { foreach $j (0,1) { $picture->moveTo($x[$i]+(-1)**$i*$cornersize,$y[$j]); -$picture->lineTo($x[$i]+(-1)**$i*$cornersize,$y[$j]+(-1)**$j*$cornersize, darkblue,3); -$picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,3); +$picture->lineTo($x[$i]+(-1)**$i*$cornersize,$y[$j]+(-1)**$j*$cornersize, darkblue,1); +$picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,1); }} - +Context("LimitedRadical"); +$areaU = FormulaWithUnits("$area m^2"); ############################################## TEXT(beginproblem()); $refreshCachedImages = 1; -BEGIN_TEXT +BEGIN_PGML -Find the area of the rectangle.$PAR +Find the area of the rectangle below. [@KeyboardInstructions('(Use a fraction in your answer. Use [|m^2|]* for square meters.)')@]** -$BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') \} -$ECENTER -$PAR +[_____________]{$areaU} + +>>[@image(insertGraph( $picture ), tex_size=>400, height=>(240*$height/$base), width=>240, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') @]*<< -END_TEXT -BEGIN_PGML - Its area is [_____________]{$area} square meters. (Use a fraction in your answer.) END_PGML ############################################## +Context("LimitedFraction"); + $factor1 = gcd($num1,$den2); $factor2 = gcd($num2,$den1); if (($factor1==1) && ($factor2==1)) { diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems70.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems70.pg index 162a901e52..d553ed47fd 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionMultiplicationWordProblems70.pg @@ -7,29 +7,31 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(rationalTrianglePerimeter) -## MLTleader(1) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','rectangle','multiply','fraction') +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,12 +52,12 @@ do { } until ($ansDen!=2*$den1*$den2); -$bigger = max($base,$height); $xmin = 0; #The viewing window -$xmax = $bigger+0.2; +$xmax = $base*1.15; $ymin = 0; -$ymax = $xmax; +$yscalar = ((1-$xmax/$height**2) < 0) ? 1.5 : (1+sqrt(1-$xmax/$height**2))/2; +$ymax = $height*$yscalar; $xLabelShift = $xmax/30; $yLabelShift = $ymax/30; @@ -67,11 +69,11 @@ $xcross = $base/random(2.5,4,0.1); $cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/15; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[240,240*$ymax/$xmax]); $xTop = $x[0]+$xcross; -$picture->lb( new Label($xTop, $y[0]-$yLabelShift,"$num1/$den1 ft",'black','center','middle')); +$picture->lb( new Label($xTop, $y[0],"$num1/$den1 ft",'black','center','top')); $picture->lb( new Label($xTop,($y[0]+$y[1])/2,"$num2/$den2 ft",'black','center','middle')); $picture->new_color("darkblue", 100,100,255); @@ -96,18 +98,13 @@ $picture->lineTo($xTop+$cornersize,$y[0], darkblue,3); TEXT(beginproblem()); $refreshCachedImages = 1; -BEGIN_TEXT +BEGIN_PGML -Find the area of the triangle.$PAR +Find the area of the triangle. -$BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "a triangle with one side parallel to the ground; this side is $base ft long; the height is $height ft long" title = "a triangle with one side parallel to the ground; this side is $base ft long; the height is $height ft long" ') \} -$ECENTER -$PAR +>>[@image(insertGraph( $picture ), tex_size=>400, height=>(240*$ymax/$xmax), width=>240, extra_html_tags => 'alt = "a triangle with one side parallel to the ground; this side is $base ft long; the height is $height ft long" title = "a triangle with one side parallel to the ground; this side is $base ft long; the height is $height ft long" ') @]*<< -END_TEXT -BEGIN_PGML - The triangle's area is [_____________]{$area} square feet. (Use a fraction in your answer.) +The triangle's area is [_____________]{$area} square feet. (Use a fraction in your answer.) END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems10.pg index 82a2104fdf..69760ffd0b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems10.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(SubtractWordProblem) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','subtraction','application') +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems20.pg index 27dfbe5095..0723aac1a5 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems20.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(SubtractWordProblem) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','subtraction','application') +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems30.pg index b77b8f00c7..4958db4efa 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems30.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(AddSubtractWordProblem) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','addition','application','mixed number') +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" +# "PCCmacros.pl", ); ############################################## @@ -107,3 +110,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems40.pg index 6ef6c07e28..d61b043297 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems40.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','subtraction','application') -## MLT(arithmetic_fractions_application_paint) +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems50.pg index 9d0f2c755b..460bf25bd5 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems50.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(SubtractWordProblem) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','subtraction','application') +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems60.pg index 6cb394bb53..d1a5495c40 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems60.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Author(Carl Yao) -## MLT(AddSubtractWordProblem)## Institution(PCC) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','subtraction','application') +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -60,7 +63,7 @@ TEXT(beginproblem()); BEGIN_PGML -A school had a fund raising event. The revenue came from three resources: ticket sales, auction sales, and donations. Ticket sales account for [`[$frac1]`] of the total revenue; auction sales account for [`[$frac2]`] of the total revenue. What fraction of the revenue came from donations? +A school had a fund-raising event. The revenue came from three resources: ticket sales, auction sales, and donations. Ticket sales account for [`[$frac1]`] of the total revenue; auction sales account for [`[$frac2]`] of the total revenue. What fraction of the revenue came from donations? [__________]{$frac3} of the revenue came from donations. @@ -99,3 +102,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems70.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems70.pg index 9d682fe469..2f85e71ac3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems70.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.NF.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingRationalApplication) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('fraction','graph','application','pie chart') +## DBCCSS('3.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,8 +29,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", + "PGcourse.pl", + "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -51,15 +55,18 @@ do { ($num[4],$den[4]) = $frac[4]->value; } until (($frac[4]>0) && ($den[4]<10) && ($frac[1]>$frac[2])); -$scale = 2; -$downshift = -0.4; -$radius = 1; -$gr = init_graph(-$scale,-$scale,$scale,$scale, -size=>[400,400] +$xmin = -200; +$xmax =200; +$ymin = -120; +$ymax = 120; +$downshift = -6; +$radius = 94; +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +size=>[400,240] ); $title = "School Population Breakdown by Race"; -$gr->lb( new Label(0, $scale/1.5,$title,'black','center','middle')); +$gr->lb( new Label(0, $ymax,$title,'black','center','top')); $xfunc = sub { my $t = shift(); return $radius*cos($t); }; @@ -90,10 +97,10 @@ for my $i (0..3) { $end0y = $radius*sin($fracCumulative[$i]*2*pi)+$downshift; $end1x = $radius*cos($fracCumulative[$i+1]*2*pi); $end1y = $radius*sin($fracCumulative[$i+1]*2*pi)+$downshift; - $end2x = $radius/2*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); - $end2y = $radius/2*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; - $end3x = 1.3*$radius*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); - $end3y = 1.3*$radius*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; + $end2x = 0.67*$radius*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); + $end2y = 0.67*$radius*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; + $end3x = 1.05*$radius*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); + $end3y = 1.05*$radius*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; $gr->moveTo(0,0+$downshift); $gr->lineTo($end0x,$end0y,'blue',1); @@ -101,9 +108,11 @@ for my $i (0..3) { $gr->lineTo($end1x,$end1y,'blue',1); $gr->fillRegion([$end2x,$end2y,$color[$i]]); - $gr->lb( new Label($end2x, $end2y,"$num[$i+1]/$den[$i+1]",'black','center','middle')); - $gr->lb( new Label($end3x, $end3y,$legend[$i],'black','center','middle')); -} + $lcr = ($end3x < 0) ? 'right' : 'left' ; + $tmb = ($end3y < 0) ? 'top' : 'bottom' ; + + $gr->lb( new Label($end2x, $end2y,"$num[$i+1]/$den[$i+1]",'black','center','middle','small')); + $gr->lb( new Label($end3x, $end3y,$legend[$i],'black',$lcr,$tmb,'small'));} $difference = $frac[1]-$frac[2]; ($difNum,$difDen)=$difference->value; @@ -117,10 +126,10 @@ BEGIN_PGML The pie chart represents a school's student population. ->>[@image( insertGraph($gr), width=>400, - height=>400, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< +>>[@image( insertGraph($gr), width=>500, + height=>300, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< -Answer the following question with fraction. +[@KeyboardInstructions('Answer the following question with fraction.')@]** [__________]{$difference} more of the school is white students than black students. diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems75.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems75.pg index 67d9c0119c..c8ce22445f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems75.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems75.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.NF.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingRationalApplication) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('fraction','graph','application','pie chart') - +## DBCCSS('3.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -65,19 +67,23 @@ do { $factor2 = $com/$den2; $factor3 = $com/$den3; $factor4 = $com/$den4; -} until (($frac[4]>0) && ($den[4]<10) && ($com!=$den4)); +} until (($frac[4]>0) && ($den[4]<10) && ($com!=$den4) && ($frac[4]!=.5)); $ans = $frac[4]; -$scale = 2; -$downshift = -0.4; -$radius = 1; -$gr = init_graph(-$scale,-$scale,$scale,$scale, -size=>[400,400] +$xmin = -250; +$xmax =250; +$ymin = -150; +$ymax = 150; +$downshift = 0; +$radius = 120; +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +size=>[500,300] ); $title = "School Population Breakdown by Race"; -$gr->lb( new Label(0, $scale/1.5,$title,'black','center','middle')); +$gr->lb( new Label(0, $ymax,$title,'black','center','top')); + $xfunc = sub { my $t = shift(); return $radius*cos($t); }; @@ -108,10 +114,10 @@ for my $i (0..3) { $end0y = $radius*sin($fracCumulative[$i]*2*pi)+$downshift; $end1x = $radius*cos($fracCumulative[$i+1]*2*pi); $end1y = $radius*sin($fracCumulative[$i+1]*2*pi)+$downshift; - $end2x = $radius/2*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); - $end2y = $radius/2*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; - $end3x = 1.3*$radius*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); - $end3y = 1.3*$radius*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; + $end2x = 0.67*$radius*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); + $end2y = 0.67*$radius*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; + $end3x = 1.05*$radius*cos(($fracCumulative[$i]+$fracCumulative[$i+1])*pi); + $end3y = 1.05*$radius*sin(($fracCumulative[$i]+$fracCumulative[$i+1])*pi)+$downshift; $gr->moveTo(0,0+$downshift); $gr->lineTo($end0x,$end0y,'blue',1); @@ -119,8 +125,14 @@ for my $i (0..3) { $gr->lineTo($end1x,$end1y,'blue',1); $gr->fillRegion([$end2x,$end2y,$color[$i]]); - $gr->lb( new Label($end2x, $end2y,"$num[$i+1]/$den[$i+1]",'black','center','middle')) unless ($i==3); - $gr->lb( new Label($end3x, $end3y,$legend[$i],'black','center','middle')); + $lcr = ($end3x < 0) ? 'right' : 'left' ; + $tmb = ($end3y < 0) ? 'top' : 'bottom' ; + + if ($i!=3) { + $gr->lb( new Label($end2x, $end2y,"$num[$i+1]/$den[$i+1]",'black','center','middle')); + } + $gr->lb( new Label($end3x, $end3y,$legend[$i],'black',$lcr,$tmb)); + } $difference = $frac[1]-$frac[2]; @@ -134,8 +146,8 @@ BEGIN_PGML The pie chart represents a school's student population. ->>[@image( insertGraph($gr), width=>400, - height=>400, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< +>>[@image( insertGraph($gr), width=>500, + height=>300, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< Answer the following question with fraction. diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems80.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems80.pg index 4521266095..c1253c0166 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/FractionSubtractionWordProblems80.pg @@ -7,30 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('subtract','fraction','bar graph') -## MLT(arithmetic_fractions_application_bar_graph) - +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -98,7 +100,7 @@ $ymin = -$yscale*$yCover; $ymax = (1+$yscale)*$yCover; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[400,240]); $picture->lb('reset'); $picture->moveTo(0,0); @@ -146,13 +148,13 @@ BEGIN_TEXT The following bar graph shows the distances run by different runners in a relay race. $PAR $BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} +\{ image(insertGraph( $picture ), tex_size=>400, height=>240, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} $ECENTER $PAR END_TEXT BEGIN_PGML -Identify the runners who ran the longest and the shortest distances. +Identify those two runners who ran the longest and the shortest distances. The runner who ran the longest distance ran [_____________]{$ans} more miles than the runner who ran the shortest distance. (Use a fraction in your answer.) diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems10.pg index 1bf8bfb635..4e4569aa54 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems10.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(AddSubtractWordProblem) -## MLTleader(1) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','addition','application','mixed number') +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" +# "PCCmacros.pl", ); ############################################## @@ -67,11 +69,11 @@ TEXT(beginproblem()); BEGIN_PGML -Each page of a book consists of a header, a footer and the middle part. The header is [`[$header]`] inches in length; the footer is [`[$footer]`] inches in length; and the middle part is [`[$middle]`] inches in length. +Each page of a book consists of a header, a footer and the middle part. The header is [`[$header]`] inches in height; the footer is [`[$footer]`] inches in height; and the middle part is [`[$middle]`] inches in height. -What is the total length of each page in this book? Use mixed number in your answer if needed. +What is the total height of each page in this book? Use mixed number in your answer if needed. -*Solution:* Each page in this book is [___________]{$total} inches in length. +Each page in this book is [___________]{$total} inches in height. END_PGML @@ -86,7 +88,7 @@ $s3 = $s2%$totalDen; BEGIN_PGML_SOLUTION -We add up the length of the header, middle part and footer to find the total length of a page: +We add up the height of the header, middle part and footer to find the total height of a page: [`` \begin{aligned}[t] @@ -103,7 +105,7 @@ We add up the length of the header, middle part and footer to find the total len \end{aligned} ``] -*Solution:* Each page in this book is [`[$total]`] inches in length. +Each page in this book is [`[$total]`] inches in height. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems20.pg index da4dd3fac8..e5c313b0d8 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems20.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number','application') -## MLT(fractionApplicationSum) +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,7 +67,7 @@ BEGIN_PGML To pave the road on Ellis Street, the crew used [`[$int1][$frac1]`] tons of cement on the first day, and used [`[$int2][$frac2]`] tons on the second day. How many tons of cement were used in all? - [___________]{$ans} tons of cement were used in all. +[___________]{$ans} tons of cement were used in all. END_PGML @@ -108,7 +110,7 @@ To add mixed number, we break each mixed number into an integer and a fraction, \end{aligned} ``] -*Solution:* [`[$ans]`] tons of cement were used in all. +[`[$ans]`] tons of cement were used in all. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems30.pg index ae83233775..ae87768195 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number','application') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -63,7 +66,7 @@ BEGIN_PGML A scientist is observing the tide. In the first hour, the sea level increased by [`[$int1][$frac1]`] inches. In the second hour, the sea level decreased by [`[$int2][$frac2]`] inches. In these two hours, what is the sea level's net change? Use signed number to answer this question. - The sea level's net change in these two hours is [___________]{$ans} inches. +The sea level's net change in these two hours is [___________]{$ans} inches. END_PGML @@ -143,7 +146,7 @@ We could simply change the whole number [`[$intSum]`] into a fraction without "s \end{aligned} ``] -*Solution:* The sea level's net change in these two hours is [`[$ans]`] inches. +The sea level's net change in these two hours is [`[$ans]`] inches. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems40.pg index 06de0fac00..76129a2817 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems40.pg @@ -7,29 +7,31 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(mixedRectanglePerimeter) -## MLTleader(1) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('perimeter','rectangle','add','fraction','mixed number') +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,12 +55,11 @@ do { ($ansNum,$ansDen) = $perimeter->value; } until (($num1/$den1+$num2/$den2)>1); -$bigger = max($base,$height); $xmin = 0; #The viewing window -$xmax = $bigger+1; +$xmax = $base*1.15; $ymin = 0; -$ymax = $xmax; +$ymax = $height*1.15; @x = (($xmax-$base)/2,($xmax+$base)/2); @y = (($ymax-$height)/2,($ymax+$height)/2); @@ -66,10 +67,10 @@ $ymax = $xmax; $cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/15; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[240,240*$height/$base]); -$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-0.3,"$int1 $num1/$den1 m",'black','center','middle')); -$picture->lb( new Label($x[1]-0.3,($y[0]+$y[1])/2,"$int2 $num2/$den2 m",'black','right','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0],"$int1 $num1/$den1 m",'black','center','bottom')); +$picture->lb( new Label($x[1],($y[0]+$y[1])/2,"$int2 $num2/$den2 m",'black','right','middle')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -95,18 +96,13 @@ $picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,3); TEXT(beginproblem()); $refreshCachedImages = 1; -BEGIN_TEXT +BEGIN_PGML -Find the perimeter of the rectangle.$PAR +Find the perimeter of the rectangle. -$BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') \} -$ECENTER -$PAR +>>[@image(insertGraph( $picture ), tex_size=>400, height=>(240*$height/$base), width=>240, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') @]*<< -END_TEXT -BEGIN_PGML - Its perimeter is [_____________]{$perimeter} meters. (Use fraction in your answer.) +Its perimeter is [_____________]{$perimeter} meters. (Use fraction in your answer.) END_PGML @@ -161,7 +157,7 @@ For the given rectangle, we have: Don't forget the length unit [`\textrm{m}`]. -*Solution:* The rectangle's perimeter is [`[$perimeter]`] meters. +The rectangle's perimeter is [`[$perimeter]`] meters. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems50.pg index 0f210141f4..af16ace927 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems50.pg @@ -8,30 +8,32 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('add','fraction','bar graph','mixed number') -## MLT(arithmetic_fractions_application_bar_graph) - +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -105,7 +107,7 @@ $ymin = -$yscale*$yCover; $ymax = (1+$yscale)*$yCover; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[400,240]); $picture->lb('reset'); $picture->moveTo(0,0); @@ -153,7 +155,7 @@ BEGIN_TEXT The following bar graph shows the distance ran by different runners in a certain contest. $PAR $BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} +\{ image(insertGraph( $picture ), tex_size=>400, height=>240, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} $ECENTER $PAR @@ -199,7 +201,7 @@ To find the total miles ran by [$name1] and [$name2], we need to add up their mi \end{aligned} ``] -*Solution:* Those two runners who ran the longest distance ran a total of [`[$ans]`] miles. +Those two runners who ran the longest distance ran a total of [`[$ans]`] miles. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems60.pg index aa0e7a6fbd..a9c11ccf05 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberAdditionWordProblems60.pg @@ -7,29 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('add','fraction','bar graph','mixed number') -## MLT(arithmetic_fractions_application_bar_graph) +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -110,7 +113,7 @@ $ymin = -$yscale; $ymax = $yCover+2*$yscale; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[400,240]); $picture->lb('reset'); $picture->moveTo(0,0); @@ -162,13 +165,13 @@ BEGIN_TEXT The following bar graph shows the distance ran by different runners in a certain contest. $PAR $BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} +\{ image(insertGraph( $picture ), tex_size=>400, height=>240, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} $ECENTER $PAR END_TEXT BEGIN_PGML -Identify the runners who ran the longest and shortest distances. +Identify those two runners who ran the longest and shortest distances. Those two runners ran a total of [_____________]{$ans} miles. (Use fraction in your answer.) @@ -213,7 +216,7 @@ To find the total miles ran by [$name1] and [$name2], we need to add up their mi \end{aligned} ``] -*Solution:* Those two runners who ran the longest distance ran a total of [`[$ans]`] miles. +Those two runners who ran the longest distance ran a total of [`[$ans]`] miles. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems10.pg index ae4252295f..ec7dc5fb94 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems10.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','division','application','mixed number') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -55,7 +57,7 @@ BEGIN_PGML A stick is [`[$total]`] inches in length. A carpenter will cut it into [`[$pieces]`] pieces evenly. How long would each piece be? Answer this question with fractions. -*Solution:* Each piece would be [_________]{$each} inches in length. +Each piece would be [_________]{$each} inches in length. END_PGML @@ -88,7 +90,7 @@ In this problem, we cut the total length of [`[$total]`] inches evenly into [`[$ \end{aligned} ``] -*Solution:* Each piece would be [`[$each]`] inches in length. +Each piece would be [`[$each]`] inches in length. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems20.pg index 92f7d1cc13..9f06bef9e5 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems20.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','division','application','mixed number') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -57,7 +59,7 @@ BEGIN_PGML A stick is [`[$total]`] inches in length. A carpenter will cut it into shorter pieces, each [`[$each]`] inches in length. How many pieces will the stick be cut into? -*Solution:* The stick will be cut into [_________]{$pieces} pieces. +The stick will be cut into [_________]{$pieces} pieces. END_PGML @@ -90,7 +92,7 @@ In this problem, we cut the total length of [`[$total]`] inches into pieces of [ \end{aligned} ``] -*Solution:* The stick will be cut into [`[$pieces]`] pieces. +The stick will be cut into [`[$pieces]`] pieces. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems30.pg index adc89c694b..405d33a9b6 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems30.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','division','application','mixed number') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -56,7 +58,7 @@ BEGIN_PGML A team of biologists are searching for a new species in a forest, which has [`[$total]`] square miles. The team can cover [`[$each]`] square miles every day. How many days will it take the team to cover the whole forest? -*Solution:* It will take the team [________]{$days} days to cover the whole forest. +It will take the team [________]{$days} days to cover the whole forest. END_PGML @@ -77,7 +79,7 @@ In this problem, the team covers [`[$each]`] square miles every day. The team wi \end{aligned} ``] -*Solution:* It will take the team [`[$days]`] days to cover the whole forest. +It will take the team [`[$days]`] days to cover the whole forest. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems40.pg index e116cec216..f9a4dd93e8 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems40.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','division','application','mixed number') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -56,7 +58,7 @@ BEGIN_PGML A box of cereal contains about [`[$total]`] cups. By the label, each box contains [`[$servings]`] servings. What's the recommended size (in cups) of each serving? -*Solution:* The recommended size of each serving is [_________]{$each} cups. +The recommended size of each serving is [_________]{$each} cups. END_PGML @@ -82,7 +84,7 @@ In this problem, we need to divide the total box of [`[$total]`] cups evenly int \end{aligned} ``] -*Solution:* The recommended size of each serving is [`[$each]`] cups. +The recommended size of each serving is [`[$each]`] cups. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems50.pg index 1bee12a640..1921609c31 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems50.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionProportion) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','division','application','mixed number') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -58,7 +60,7 @@ BEGIN_PGML A box of cereal contains about [`[$total]`] cups. For kids under the age of [`3`] years old, it's recommended to have [`[$each]`] cups per serving. How many servings does each box contain? -*Solution:* Each box contains [__________]{$servings} servings for kids under the age of [`3`] years old. +Each box contains [__________]{$servings} servings for kids under the age of [`3`] years old. END_PGML @@ -84,7 +86,7 @@ Each box contains [`[$total]`] cups, while each serving contains [`[$each]`] cup \end{aligned} ``] -*Solution:* Each box contains [`[$servings]`] servings for kids under the age of [`3`] years old. +Each box contains [`[$servings]`] servings for kids under the age of [`3`] years old. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems60.pg index abbfa99939..65263e47b4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberDivisionWordProblems60.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','division','application','mixed number') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,7 +68,7 @@ BEGIN_PGML Company A donated [`[$part1]`] lb of food to a food bank, and Company B donated [`[$part2]`] lb. The food bank will hand out these two companies' donation to families in need. Each family will receive [`[$each]`] lb of food. How many families will be fed by the donation? -*Solution:* The donation can be used to feed [________]{$numFamilies} families. +The donation can be used to feed [________]{$numFamilies} families. END_PGML @@ -98,7 +101,7 @@ From a total of [`[$total]`] lb of food, each family will receive [`[$each]`] lb \end{aligned} ``] -*Solution:* The donation can be used to feed [`[$numFamilies]`] families. +The donation can be used to feed [`[$numFamilies]`] families. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems10.pg index cb2b7cf5d3..954eb2fdf9 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems10.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(SubtractWordProblem) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','multiplication','application','mixed number') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems20.pg index 193e2d022b..b9704c4531 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems20.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionApplicationMultiplication) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','multiplication','application','mixed number') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems30.pg index a5babde134..b2ab3c993d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems30.pg @@ -7,29 +7,31 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(mixedRectanglePerimeter) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','rectangle','multiply','fraction','mixed number') -## MLT(rationalRectanglePerimeter) +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,12 +58,10 @@ do { $factor2 = gcd($num2m,$den1); } until (($factor1!=1) || ($factor2!=1)); -$bigger = max($base,$height); - $xmin = 0; #The viewing window -$xmax = $bigger+0.5; +$xmax = $base*1.15; $ymin = 0; -$ymax = $xmax; +$ymax = $height*1.15; @x = (($xmax-$base)/2,($xmax+$base)/2); @y = (($ymax-$height)/2,($ymax+$height)/2); @@ -69,10 +69,10 @@ $ymax = $xmax; $cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/15; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[240,240*$height/$base]); -$picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-0.5,"$int1 $num1/$den1 m",'black','center','middle')); -$picture->lb( new Label($x[1]-0.1,($y[0]+$y[1])/2,"$int2 $num2/$den2 m",'black','right','middle')); +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0],"$int1 $num1/$den1 m",'black','center','bottom')); +$picture->lb( new Label($x[1],($y[0]+$y[1])/2,"$int2 $num2/$den2 m",'black','right','middle')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -98,18 +98,13 @@ $picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,3); TEXT(beginproblem()); $refreshCachedImages = 1; -BEGIN_TEXT +BEGIN_PGML -Find the area of the rectangle.$PAR +Find the area of the rectangle. -$BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') \} -$ECENTER -$PAR +>>[@ image(insertGraph( $picture ), tex_size=>400, height=>(240*$height/$base), width=>240, extra_html_tags => 'alt = "a rectangle with a base of $base m and a height of $height m" title = "a rectangle with a base of $base m and a height of $height m"') @]*<< -END_TEXT -BEGIN_PGML - Its area is [_____________]{$area} square meters. (Use a fraction in your answer.) +Its area is [_____________]{$area} square meters. (Use a fraction in your answer.) END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems40.pg index 37c234ed7a..8b971fe92c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems40.pg @@ -7,28 +7,31 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(rationalTrianglePerimeter) -## Level(5) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','rectangle','multiply','fraction','mixed number') +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -55,29 +58,25 @@ do { $factor2 = gcd($num2m,$den1); } until (($factor1!=1) || ($factor2!=1)); -$bigger = max($base,$height); - $xmin = 0; #The viewing window -$xmax = $bigger+1; +$xmax = $base*240/210; $ymin = 0; -$ymax = $xmax; +$ymax = (210*$height/$base+30)*$height/(210*$height/$base); -$xLabelShift = $xmax/30; -$yLabelShift = $ymax/30; $xcross = $base/random(2.5,4,0.1); @x = (($xmax-$base)/2,($xmax+$base)/2); @y = (($ymax-$height)/2,($ymax+$height)/2); -$cornersize = min(($x[1]-$x[0]),($y[1]-$y[0]))/15; +$cornersize = $xmax*10/240; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[240,240*$ymax/$xmax]); $xTop = $x[0]+$xcross; -$picture->lb( new Label($xTop, $y[0]-$yLabelShift,"$int1 $num1/$den1 ft",'black','center','middle')); -$picture->lb( new Label($xTop,($y[0]+$y[1])/2,"$int2 $num2/$den2 ft",'black','center','middle')); +$picture->lb( new Label($xTop, $y[0],"$int1 $num1/$den1 ft",'black','center','top','large')); +$picture->lb( new Label($xTop,($y[0]+$y[1])/2,"$int2 $num2/$den2 ft",'black','center','bottom','large','vertical')); $picture->new_color("darkblue", 100,100,255); @@ -91,8 +90,8 @@ $picture->moveTo($xTop,$y[1]); $picture->lineTo($xTop,$y[0], darkblue,1,"dashed"); $picture->moveTo($xTop,$y[0]+$cornersize); -$picture->lineTo($xTop+$cornersize,$y[0]+$cornersize, darkblue,3); -$picture->lineTo($xTop+$cornersize,$y[0], darkblue,3); +$picture->lineTo($xTop+$cornersize,$y[0]+$cornersize, darkblue,1); +$picture->lineTo($xTop+$cornersize,$y[0], darkblue,1); @@ -101,18 +100,11 @@ $picture->lineTo($xTop+$cornersize,$y[0], darkblue,3); TEXT(beginproblem()); $refreshCachedImages = 1; -BEGIN_TEXT - -Find the area of the triangle.$PAR +BEGIN_PGML -$BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "a triangle with one side parallel to the ground; this side is $base ft long; the height is $height ft long." title = "a triangle with one side parallel to the ground; this side is $base ft long; the height is $height ft long."') \} -$ECENTER -$PAR +The area of the triangle below is [_]{$area}{5} square feet. [@KeyboardInstructions('(Use a fraction in your answer.)')@]** -END_TEXT -BEGIN_PGML - Its area is [_____________]{$area} square feet. (Use a fraction in your answer.) +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => 'alt = "a triangle with one side parallel to the ground; this side is $base ft long; the height is $height ft long." title = "a triangle with one side parallel to the ground; this side is $base ft long; the height is $height ft long."') @]*<< END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems50.pg index 86d9174667..346267610a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems50.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionApplicationMultiplication) -## MLTleader(1) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','multiplication','application','mixed number') +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,9 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -55,7 +56,7 @@ BEGIN_PGML Each truck can hold [`[$each]`] tons of sand. A work site manager ordered [`[$numLoads]`] truck loads of sand. How many tons of sand were ordered? -*Solution:* [_________]{$total} tons of sand were ordered. +[_________]{$total} tons of sand were ordered. END_PGML @@ -75,7 +76,7 @@ Each truck load has [`[$each]`] tons of sand. To find how many tons of sand [`[$ \end{aligned} ``] -*Solution:* [`[$total]`] tons of sand were ordered. +[`[$total]`] tons of sand were ordered. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems60.pg index 090da49646..878f90e46e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems60.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.6') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','multiplication','application','mixed number') -## MLT(FractionApplicationMultiplication) +## DBCCSS('5.NF.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -27,9 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "contextCurrency.pl", - "PGcourse.pl" ); ############################################## @@ -61,7 +64,7 @@ BEGIN_PGML Each big truck can hold [`[$each0]`] tons of sand, while each small truck can hold [`[$each1]`] tons of sand. A team of [`[$numLoads0]`] big trucks and [`[$numLoads1]`] small trucks will deliver sand to a work site. If each truck has a full load of sand, how many tons of sand in total will be delivered? -*Solution:* In total, [_________]{$total} tons of sand will be delivered. +In total, [_________]{$total} tons of sand will be delivered. END_PGML @@ -97,7 +100,7 @@ Finally, we add up the loads from big and small trucks: [`` [$total0]+[$total1]=[$total] ``] -*Solution:* In total, [`[$total]`] tons of sand will be delivered. +In total, [`[$total]`] tons of sand will be delivered. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems10.pg index 3e8d76191f..02c3f9b443 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems10.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(SubtractWordProblem) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','subtraction','application','mixed number') +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -65,7 +67,7 @@ BEGIN_PGML [$name] prepared [`[$int2]`] containers of fruit punch for a party. After the party, there were still [`[$frac1Display2]`] containers of fruit punch left. How many containers were consumed in the party? -*Solution:* [_________]{$ans} containers of fruit punch were consumed in the party. +[_________]{$ans} containers of fruit punch were consumed in the party. END_PGML @@ -132,7 +134,7 @@ We could simply change the whole number [`[$intSum]`] into a fraction without "s \end{aligned} ``] -*Solution:* [`[$ans]`] containers of fruit punch were consumed in the party. +[`[$ans]`] containers of fruit punch were consumed in the party. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems20.pg index ca511bd76b..47460d1507 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems20.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(fractionApplicationSum) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','subtraction','application','mixed number') +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,9 +31,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -73,7 +75,7 @@ BEGIN_PGML [$name1] and [$name2] are in a running event. [$name1] ran [`[$int1][$frac1]`] miles, and [$name2] ran [`[$int2][$frac2]`] miles. How many more miles did [$name1] run? -*Solution:* [$name1] ran [_________]{$ans} more miles than [$name2]. +[$name1] ran [_________]{$ans} more miles than [$name2]. END_PGML @@ -151,7 +153,7 @@ We could simply change the whole number [`[$intSum]`] into a fraction without "s \end{aligned} ``] -*Solution:* [$name1] ran [`[$ans]`] more miles than [$name2]. +[$name1] ran [`[$ans]`] more miles than [$name2]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems30.pg index 37950deac3..eaedb30a77 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems30.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FractionSubtract) -## MLTleader(1) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','subtraction','application','mixed number') +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -66,7 +67,7 @@ BEGIN_PGML [$name] hired a plant cutter to cut weeds in a yard. The cutter is responsible for cutting the weeds to [`[$frac1Display2]`] inches each time the weeds grow to approximately [`[$int2]`] inches. Approximately how many inches were cut each time? -*Solution:* Approximately [___________]{$ans} inches were cut each time. +Approximately [___________]{$ans} inches were cut each time. END_PGML @@ -121,7 +122,7 @@ We could simply change the whole number [`[$intSum]`] into a fraction without "s \end{aligned} ``] -*Solution:* Approximately [`[$ans]`] inches were cut each time. +Approximately [`[$ans]`] inches were cut each time. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems40.pg index d2c4060efd..5e1717cbc3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems40.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(SubtractWordProblem) -## MLTleader(1) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','subtraction','application','mixed number') +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,9 +31,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -82,7 +83,7 @@ BEGIN_PGML When driving on a high way, [$name1] noticed a sign saying exit to Johnstown is [`[$int2][$frac2]`] miles away, while exit to Jerrystown is [`[$int1][$frac1]`] miles away. How far is Johnstown from Jerrystown? -*Solution:* Johnstown and Jerrystown are [_________]{$ans} miles apart. +Johnstown and Jerrystown are [_________]{$ans} miles apart. END_PGML @@ -170,7 +171,7 @@ We could simply change the whole number [`[$intSum]`] into a fraction without "s \end{aligned} ``] -*Solution:* [$name1] ran [`[$ans]`] more miles than [$name2]. +[$name1] ran [`[$ans]`] more miles than [$name2]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems50.pg index ae03efa45b..8ec5ea2576 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems50.pg @@ -8,29 +8,32 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('subtraction','fraction','bar graph','mixed number') -## MLT(arithmetic_fractions_application_bar_graph) +## DBCCSS('4.MD.3','5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -113,7 +116,7 @@ $ymin = -$yscale; $ymax = $yCover+2*$yscale; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[400,240]); $picture->lb('reset'); $picture->moveTo(0,0); @@ -171,7 +174,7 @@ BEGIN_TEXT The following bar graph shows the distance ran by different runners in a certain contest. $PAR $BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} +\{ image(insertGraph( $picture ), tex_size=>400, height=>240, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} $ECENTER $PAR @@ -251,7 +254,7 @@ To find the difference of their distances, we need to do subtraction: \end{aligned} ``] -*Solution:* The longest runner ran [`[$ans]`] more miles than the shortest runner. +The longest runner ran [`[$ans]`] more miles than the shortest runner. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems60.pg index 0e2a4fe614..b32908874b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionApplication/MixedNumberSubtractionWordProblems60.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.2') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('fraction','addition','application','mixed number') -## MLT(AddSubtractWordProblem) +## DBCCSS('5.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -26,8 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" +# "PCCmacros.pl", ); ############################################## @@ -67,11 +71,11 @@ TEXT(beginproblem()); BEGIN_PGML -Each page of a book consists of a header, a footer and the middle part. The whole page's length is [`[$total]`] inches. +Each page of a book consists of a header, a footer and the middle part. The whole page's height is [`[$total]`] inches. -The header is [`[$header]`] inches in length; and the middle part is [`[$middle]`] inches in length. What is the length of the footer? +The header is [`[$header]`] inches in height; and the middle part is [`[$middle]`] inches in height. What is the height of the footer? -*Solution:* The length of the footer is [___________]{$footer} inches in length. +The height of the footer is [___________]{$footer} inches in height. END_PGML @@ -85,7 +89,7 @@ $s2 = $totalDen*$com1/$totalDen; BEGIN_PGML_SOLUTION -From a page's total length, we subtract the length of the header and the middle part to find the length of the footer: +From a page's total height, we subtract the height of the header and the middle part to find the height of the footer: [`` \begin{aligned}[t] @@ -100,7 +104,7 @@ From a page's total length, we subtract the length of the header and the middle \end{aligned} ``] -*Solution:* The footer is [`[$footer]`] inches in length. +The footer is [`[$footer]`] inches in height. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction10.pg new file mode 100644 index 0000000000..38468d0551 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction10.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change decimal to fraction. Decimals are like 0.2, 0.02, 0.002. +# +# Last updated: Yao, 10/19/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +Context("LimitedFraction"); + +do {$int=random(2,8,1);} until (gcd($int,1000)!=1); + +$dec1 = $int/10; +$dec2 = $int/100; +$dec3 = $int/1000; + +$dec1Word = numberWord($int).' tenths'; +$dec2Word = numberWord($int).' hundredths'; +$dec3Word = numberWord($int).' thousandths'; + +$frac1 = Fraction($int,10); +$frac2 = Fraction($int,100); +$frac3 = Fraction($int,1000); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following decimals to fractions: + +a. [`[$dec1]`] = [___________]{$frac1} + +a. [`[$dec2]`] = [___________]{$frac2} + +a. [`[$dec3]`] = [___________]{$frac3} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +a. [`[$dec1]`] is read as [$dec1Word], so it can be written as [`\frac{[$int]}{10}`], which can be reduced to [`[$frac1]`]. + +a. [`[$dec2]`] is read as [$dec2Word], so it can be written as [`\frac{[$int]}{100}`], which can be reduced to [`[$frac2]`]. + +a. [`[$dec3]`] is read as [$dec3Word], so it can be written as [`\frac{[$int]}{1000}`], which can be reduced to [`[$frac3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction20.pg new file mode 100644 index 0000000000..15202e4f0d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction20.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change decimal to fraction. Decimal is like 0.16 +# +# Last updated: Yao, 10/19/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +Context("LimitedFraction"); + +do {$int=random(1,9,1)*10+list_random(2,4,6,8);} until (gcd($int,100)!=1); + +$factor = gcd($int,100); + +$dec = $int/100; + +$decWord = numberWord($int).' hundredth'; + +$frac = Fraction($int,100); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Write the decimal number as a fraction. + +[`[$dec]`] = [___________]{$frac} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[`[$dec]`] is read as [$decWord], so it can be written as [`\frac{[$int]}{100}`], which can be reduced to [`[$frac]`] by dividing [`[$factor]`] in both the numerator and denominator. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction30.pg new file mode 100644 index 0000000000..65f0d864f2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction30.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change decimal to fraction. Decimal is like 0.15 +# +# Last updated: Yao, 10/19/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +Context("LimitedFraction"); + +do {$int=random(1,9,1)*10+5;} until (gcd($int,100)!=1); + +$factor=gcd($int,100); + +$dec = $int/100; + +$decWord = numberWord($int).' hundredth'; + +$frac = Fraction($int,100); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Write the decimal number as a fraction. + +[`[$dec]`] = [___________]{$frac} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[`[$dec]`] is read as [$decWord], so it can be written as [`\frac{[$int]}{100}`], which can be reduced to [`[$frac]`] by dividing [`[$factor]`] in both the numerator and denominator. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction35.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction35.pg new file mode 100644 index 0000000000..4eefc03430 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction35.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change decimal to fraction. Decimal is like 1.15 +# +# Last updated: Yao, 10/19/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert','mixed number') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +Context("LimitedFraction"); + +$int = random(1,9,1); + +do {$num=random(1,9,1)*10+5;} until (gcd($num,100)!=1); + +$factor=gcd($num,100); + +$decPart = $num/100; +$dec = $int+$num/100; + +$decWord = numberWord($num).' hundredth'; + +$fracPart = Fraction($num,100); +$frac = Fraction($int*100+$num,100); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Write the decimal number as a fraction. + +[`[$dec]`] = [___________]{$frac} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The integer part of the decimal [`[$dec]`] will not change. We will only change the decimal part--[$decPart]. + +[`[$decPart]`] is read as [$decWord], so it can be written as [`\frac{[$num]}{100}`], which can be reduced to [`[$fracPart]`] by dividing [`[$factor]`] in both the numerator and denominator. + + + [`` [$dec] = [$frac] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction40.pg new file mode 100644 index 0000000000..6bbceb6dfa --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction40.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change decimal to fraction. Decimal is like 0.164 +# +# Last updated: Yao, 10/19/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +Context("LimitedFraction"); + +do {$int=random(1,9,1)*100+random(0,9,1)*10+list_random(2,4,6,8);} until (gcd($int,1000)!=1); + +$factor = gcd($int,1000); + +$dec = $int/1000; + +$decWord = numberWord($int).' thousandths'; + +$frac = Fraction($int,1000); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Write the decimal number as a fraction. + +[`[$dec]`] = [___________]{$frac} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[`[$dec]`] is read as [$decWord], so it can be written as [`\frac{[$int]}{1000}`], which can be reduced to [`[$frac]`] by dividing [`[$factor]`] in both the numerator and denominator. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction50.pg new file mode 100644 index 0000000000..a3d1f19f2d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction50.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change decimal to fraction. Decimal is like 0.735. (last digit is 5) +# +# Last updated: Yao, 10/19/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +Context("LimitedFraction"); + +$int=random(1,9,1)*100+random(0,9,1)*10+5; + +$factor = gcd($int,1000); + +$dec = $int/1000; + +$decWord = numberWord($int).' thousandths'; + +$frac = Fraction($int,1000); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Write the decimal number as a fraction. + +[`[$dec]`] = [___________]{$frac} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[`[$dec]`] is read as [$decWord], so it can be written as [`\frac{[$int]}{1000}`], which can be reduced to [`[$frac]`] by dividing [`[$factor]`] in both the numerator and denominator. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction60.pg new file mode 100644 index 0000000000..c99469fd19 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/DecimalToFraction60.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change regularly-used decimals to fraction. +# Students should memorize these conversions. +# +# Last updated: Yao, 10/19/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +# randomly permutate @array in place +sub array_shuffle +{ + my $array = shift; + my $i = @$array; + while ( --$i ) + { + my $j = int random(0,$i,1); + @$array[$i,$j] = @$array[$j,$i]; + } +} + +######################################## + +Context("LimitedFraction"); + +@decimals=(0.5,0.25,0.75,0.2,0.4,0.6,0.8,0.125,0.375,0.625,0.875,0.1,0.3,0.7,0.9); +array_shuffle(~~@decimals); + +@fractions=(); +for my $i (0..@decimals-1) { + $decimals[$i]=Real($decimals[$i]); + $fractions[$i]=Fraction($decimals[$i]); +} + +$frac0 = $fractions[0]; $deci0 = $decimals[0]; +$frac1 = $fractions[1]; $deci1 = $decimals[1]; +$frac2 = $fractions[2]; $deci2 = $decimals[2]; +$frac3 = $fractions[3]; $deci3 = $decimals[3]; +$frac4 = $fractions[4]; $deci4 = $decimals[4]; +$frac5 = $fractions[5]; $deci5 = $decimals[5]; +$frac6 = $fractions[6]; $deci6 = $decimals[6]; +$frac7 = $fractions[7]; $deci7 = $decimals[7]; +$frac8 = $fractions[8]; $deci8 = $decimals[8]; +$frac9 = $fractions[9]; $deci9 = $decimals[9]; +$frac10 = $fractions[10]; $deci10 = $decimals[10]; +$frac11 = $fractions[11]; $deci11 = $decimals[11]; +$frac12 = $fractions[12]; $deci12 = $decimals[12]; +$frac13 = $fractions[13]; $deci13 = $decimals[13]; +$frac14 = $fractions[14]; $deci14 = $decimals[14]; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following decimals to fractions. You should do this problem a few times every day, until you memorize these important conversions. They will be frequently used in later math courses. + +[`[$deci0]`] = [___________]{$frac0} [`\qquad`] [`[$deci1]`] = [___________]{$frac1} [`\qquad`] [`[$deci2]`] = [___________]{$frac2} + +[`[$deci3]`] = [___________]{$frac3} [`\qquad`] [`[$deci4]`] = [___________]{$frac4} [`\qquad`] [`[$deci5]`] = [___________]{$frac5} + +[`[$deci6]`] = [___________]{$frac6} [`\qquad`] [`[$deci7]`] = [___________]{$frac7} [`\qquad`] [`[$deci8]`] = [___________]{$frac8} + +[`[$deci9]`] = [___________]{$frac9} [`\qquad`] [`[$deci10]`] = [___________]{$frac10} [`\qquad`] [`[$deci11]`] = [___________]{$frac11} + +[`[$deci12]`] = [___________]{$frac12} [`\qquad`] [`[$deci13]`] = [___________]{$frac13} [`\qquad`] [`[$deci14]`] = [___________]{$frac14} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +It's easy to change a decimal to fraction by reading the decimal and then writing the corresponding fraction. For example, to change [`0.5`] to fraction, read [`0.5`] as "five tenth," and then write [`\frac{5}{10}`]. Don't forget to reduce fractions if we can. In this example, we have [`0.5=\frac{5}{10}=\frac{1}{2}`]. + +Conversions in this problem must be memorized. They will be frequently used in later math courses. + + [`` +\begin{aligned}[t] + [$deci0] &= [$frac0] & [$deci1] &= [$frac1] & [$deci2] &= [$frac2] \\ + [$deci3] &= [$frac3] & [$deci4] &= [$frac4] & [$deci5] &= [$frac5] \\ + [$deci6] &= [$frac6] & [$deci7] &= [$frac7] & [$deci8] &= [$frac8] \\ + [$deci9] &= [$frac9] & [$deci10] &= [$frac10] & [$deci11] &= [$frac11] \\ + [$deci12] &= [$frac12] & [$deci13] &= [$frac13] & [$deci14] &= [$frac14] +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionPercentDecimal10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionPercentDecimal10.pg new file mode 100644 index 0000000000..34b9739824 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionPercentDecimal10.pg @@ -0,0 +1,192 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Given one form (fraction, decimal, percent), find the other two forms. +# +# Last updated: Yao, 10/23/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','percent','convert') +## DBCCSS('6.RP','7.RP','4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "contextPercent.pl", + "pccTables.pl", + "PCCmacros.pl", +); + +############################################## + +sub readDecimal { + my $dec = shift; + my $word = ""; + if (int($dec*10)==$dec*10) { + $word = numberWord($dec*10).' tenth'; + if ($dec*10!=1) {$word = $word.'s';} + } elsif (int($dec*100)==$dec*100) { + $word = numberWord($dec*100).' hundredth'; + if ($dec*100!=1) {$word = $word.'s';} + } else { + $word = numberWord($dec*1000).' thousandth'; + if ($dec*1000!=1) {$word = $word.'s';} + } + return $word; +} + +sub wholeFraction { + my $dec = shift; + my $output = ""; + if (int($dec*10)==$dec*10) { + my $num = $dec*10; + $output = "\frac{$num}{10}"; + } elsif (int($dec*100)==$dec*100) { + my $num = $dec*100; + $output = "\frac{$num}{100}"; + } else { + my $num = $dec*1000; + $output = "\frac{$num}{1000}"; + } + return $output; +} + +############################################## + +Context("LimitedFraction"); + +@den = (4,5,20,25,50); + +$den1 = list_random(@den); +do {$num1 = random(1,$den1-1,1);} until (gcd($num1,$den1)==1); + +do {$den2 = list_random(@den);} until ($den1!=$den2); +do {$num2 = random(1,$den2-1,1);} until (gcd($num2,$den2)==1); + +do {$den3 = list_random(@den);} until ( ($den3!=$den1) && ($den3!=$den2) ); +do {$num3 = random(1,$den3-1,1);} until (gcd($num3,$den3)==1); + +$frac1 = Fraction($num1,$den1); +$frac2 = Fraction($num2,$den2); +$frac3 = Fraction($num3,$den3); + +Context("LimitedNumeric"); +$dec1 = Compute($num1/$den1); +$dec2 = Compute($num2/$den2); +$dec3 = Compute($num3/$den3); + +$factor1 = 100/$den1; +$factor2 = 100/$den2; +$factor3 = 100/$den3; + +$percent1Int = $factor1*$num1; +$percent2Int = $factor2*$num2; +$percent3Int = $factor3*$num3; + +Context("LimitedPercent-strict"); +Context()->flags->set( + decimalPlaces => 0, + tolerance => 0, +); + +$percent1 = Compute("$percent1Int %"); +$percent2 = Compute("$percent2Int %"); +$percent3 = Compute("$percent3Int %"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +We know a number can be represented by fraction, decimal and percentage. For example, [` \frac{1}{2} = 0.5 = 50% `]. + +Fill out the table. The first row is an example. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT +$PAR +\{ +DataTable([[{data=>"Fraction",header=>"CH"},{data=>"Decimal",header=>"CH"},{data=>"Percentage",header=>"CH"},], + ["\( \frac{1}{2} \)","\( 0.5 \)","\( 50 % \)"], +["\( $frac1 \)",ans_rule(15), ans_rule(15)], + [ans_rule(15),"\( $dec2 \)", ans_rule(15)], + [ans_rule(15),ans_rule(15), "\( $percent3Int % \)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center; width:60pt;", caption => "Fraction/Decimal/Percent Conversions", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +$PAR +END_TEXT +Context()->normalStrings; + +############################################## + +ANS( $dec1 -> cmp); +ANS( $percent1 -> cmp); +ANS( $frac2 -> cmp); +ANS( $percent2 -> cmp); +ANS( $frac3 -> cmp); +ANS( $dec3 -> cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +###Row 1 + +To change [`[$frac1]`] to a decimal, we do division: + + [`` [$frac1] = [$num1] \div [$den1] = [$dec1] ``] + +Next, we move the decimal point in [`[$dec1]`] to the right twice to change the decimal to percentage: + + [`` [$dec1] = [$percent1Int] % ``] + +###Row 2 + +To change [`[$dec2]`] to a fraction, we read the decimal as [@readDecimal($dec2)@], and we have: + + [`` [$dec2] = [@wholeFraction($dec2)@] = [$frac2] ``] + +Next, we move the decimal point in [`[$dec2]`] to the right twice to change the decimal to percentage: + + [`` [$dec2] = [$percent2Int] % ``] + +###Row 3 + +To change [`[$percent3Int] %`] to decimal, we move the decimal point to the left twice: + + [`` [$percent3Int] % = [$dec3] ``] + +Next, to change [`[$dec3]`] to a fraction, we read the decimal as [@readDecimal($dec3)@], and we have: + + [`` [$dec3] = [@wholeFraction($dec3)@] = [$frac3] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal50.pg new file mode 100644 index 0000000000..2a65ea5b19 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal50.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change fraction to decimals. Fractions have denominators of 10, 100 and 1000. +# +# Last updated: Yao, 10/20/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +Context("LimitedFraction"); + +do {$int=random(3,9,1);} until (gcd($int,1000)==1); + +$dec1 = $int/10; +$dec2 = $int/100; +$dec3 = $int/1000; + +$dec1Word = numberWord($int).' tenths'; +$dec2Word = numberWord($int).' hundredths'; +$dec3Word = numberWord($int).' thousandths'; + +$frac1 = Fraction($int,10); +$frac2 = Fraction($int,100); +$frac3 = Fraction($int,1000); + +Context("LimitedNumeric"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following fractions to decimals: + +a. [`[$frac1]`] = [___________]{$dec1} + +a. [`[$frac2]`] = [___________]{$dec2} + +a. [`[$frac3]`] = [___________]{$dec3} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To change a fraction to decimal, we divide the numerator by the denominator. + +a. [`[$frac1] = [$int] \div 10 = [$dec1] `] + +a. [`[$frac2] = [$int] \div 100 = [$dec2] `] + +a. [`[$frac3] = [$int] \div 1000 = [$dec3] `] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal60.pg new file mode 100644 index 0000000000..31c10b9673 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal60.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change fraction to decimals. Decimals do not need to be rounded. +# +# Last updated: Yao, 10/20/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +Context("LimitedFraction"); + +@den=(4,5,8,16,20,25); +$den1 = list_random(@den); +do {$den2 = list_random(@den);} until ($den1!=$den2); + +do {$num1=random(1,$den1-1,1);} until (gcd($num1,$den1)==1); +do {$num2=random(1,$den2-1,1);} until (gcd($num2,$den2)==1); + +$frac1 = Fraction($num1,$den1); +$frac2 = Fraction($num2,$den2); + +Context("LimitedNumeric"); + +$dec1 = $num1/$den1; +$dec2 = $num2/$den2; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Write the fraction as a decimal number. + +[@KeyboardInstructions('Do not round your answers.')@]** + +a. [`[$frac1]`] = [___________]{$dec1} + +a. [`[$frac2]`] = [___________]{$dec2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To change a fraction to decimal, we divide the numerator by the denominator. + +a. [`[$frac1] = [$num1] \div [$den1] = [$dec1] `] + +a. [`[$frac2] = [$num2] \div [$den2] = [$dec2] `] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal70.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal70.pg new file mode 100644 index 0000000000..e77f28e805 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal70.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change mixed numbers to decimals. Decimals do not need to be rounded. +# +# Last updated: Yao, 10/20/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert','mixed number') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +Context("LimitedFraction"); + +@den=(4,5,8,16,20,25); +$den1 = list_random(@den); +do {$den2 = list_random(@den);} until ($den1!=$den2); + +do {$num1=random(1,$den1-1,1);} until (gcd($num1,$den1)==1); +do {$num2=random(1,$den2-1,1);} until (gcd($num2,$den2)==1); + +$int1 = random(1,9,1); +$int2 = random(1,9,1); + +$fracPart1 = Fraction($num1,$den1); +$fracPart2 = Fraction($num2,$den2); + +$frac1 = Fraction($int1*$den1+$num1,$den1); +$frac2 = Fraction($int2*$den2+$num2,$den2); + +Context("LimitedNumeric"); + +$decPart1 = $num1/$den1; +$decPart2 = $num2/$den2; + +$dec1 = $int1+$decPart1; +$dec2 = $int2+$decPart2; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Write the mixed number as a decimal number. + +[@KeyboardInstructions('Do not round your answers.')@]** + +a. [`[$frac1]`] = [___________]{$dec1} + +a. [`[$frac2]`] = [___________]{$dec2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To change a fraction to decimal, we divide the numerator by the denominator. We can simply copy over the integer part of a mixed number. + +a. [`[$frac1] = [$int1] + [$num1] \div [$den1] = [$dec1] `] + +a. [`[$frac2] = [$int2] + [$num2] \div [$den2] = [$dec2] `] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal80.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal80.pg new file mode 100644 index 0000000000..d4941736b1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal80.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change fraction to decimals. Decimals need to be rounded. +# +# Last updated: Yao, 10/20/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert','round') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +Context("LimitedFraction"); + +@den=(3,6,7,9,11,12,13,15); +$den1 = list_random(@den); +do {$den2 = list_random(@den);} until ($den1!=$den2); + +do {$num1=random(1,$den1-1,1);} until (gcd($num1,$den1)==1); +do {$num2=random(1,$den2-1,1);} until (gcd($num2,$den2)==1); + +$frac1 = Fraction($num1,$den1); +$frac2 = Fraction($num2,$den2); + +Context("LimitedNumeric"); + +$dec1 = $num1/$den1; +$dec2 = $num2/$den2; +$dec1Rounded = sprintf("%.2f",$num1/$den1); +$dec2Rounded = sprintf("%.2f",$num2/$den2); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following fractions to decimals. Round your answer to the hundredth place ([`2`] decimal places). + +a. [`[$frac1]`] = [___________]{$dec1Rounded} + +a. [`[$frac2]`] = [___________]{$dec2Rounded} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To change a fraction to decimal, we divide the numerator by the denominator. + +a. [`[$frac1] = [$num1] \div [$den1] = [$dec1] \approx [$dec1Rounded] `] + +a. [`[$frac2] = [$num2] \div [$den2] = [$dec2] \approx [$dec2Rounded] `] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal90.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal90.pg new file mode 100644 index 0000000000..23d672abd8 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToDecimal90.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change regularly-used fractions to decimals. +# Students should memorize these conversions. +# +# Last updated: Yao, 10/20/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','convert') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "PCCmacros.pl", +); + +############################################## + +# randomly permutate @array in place +sub array_shuffle +{ + my $array = shift; + my $i = @$array; + while ( --$i ) + { + my $j = int random(0,$i,1); + @$array[$i,$j] = @$array[$j,$i]; + } +} + +######################################## + +Context("LimitedNumeric"); + +@decimals=(0.5,0.25,0.75,0.2,0.4,0.6,0.8,0.125,0.375,0.625,0.875,0.1,0.3,0.7,0.9); +array_shuffle(~~@decimals); + +$deci0 = $decimals[0]; +$deci1 = $decimals[1]; +$deci2 = $decimals[2]; +$deci3 = $decimals[3]; +$deci4 = $decimals[4]; +$deci5 = $decimals[5]; +$deci6 = $decimals[6]; +$deci7 = $decimals[7]; +$deci8 = $decimals[8]; +$deci9 = $decimals[9]; +$deci10 = $decimals[10]; +$deci11 = $decimals[11]; +$deci12 = $decimals[12]; +$deci13 = $decimals[13]; +$deci14 = $decimals[14]; + +Context("LimitedFraction"); +@fractions=(); +for my $i (0..@decimals-1) { + $decimals[$i]=Real($decimals[$i]); + $fractions[$i]=Fraction($decimals[$i]); +} + +$frac0 = $fractions[0]; +$frac1 = $fractions[1]; +$frac2 = $fractions[2]; +$frac3 = $fractions[3]; +$frac4 = $fractions[4]; +$frac5 = $fractions[5]; +$frac6 = $fractions[6]; +$frac7 = $fractions[7]; +$frac8 = $fractions[8]; +$frac9 = $fractions[9]; +$frac10 = $fractions[10]; +$frac11 = $fractions[11]; +$frac12 = $fractions[12]; +$frac13 = $fractions[13]; +$frac14 = $fractions[14]; + +Context("LimitedNumeric"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following fractions to decimals. You should do this problem a few times every day, until you memorize the conversions. They will be frequently used in later math courses. + +[`[$frac0]`] = [___________]{$deci0} [`\qquad`] [`[$frac1]`] = [___________]{$deci1} [`\qquad`] [`[$frac2]`] = [___________]{$deci2} + +[`[$frac3]`] = [___________]{$deci3} [`\qquad`] [`[$frac4]`] = [___________]{$deci4} [`\qquad`] [`[$frac5]`] = [___________]{$deci5} + +[`[$frac6]`] = [___________]{$deci6} [`\qquad`] [`[$frac7]`] = [___________]{$deci7} [`\qquad`] [`[$frac8]`] = [___________]{$deci8} + +[`[$frac9]`] = [___________]{$deci9} [`\qquad`] [`[$frac10]`] = [___________]{$deci10} [`\qquad`] [`[$frac11]`] = [___________]{$deci11} + +[`[$frac12]`] = [___________]{$deci12} [`\qquad`] [`[$frac13]`] = [___________]{$deci13} [`\qquad`] [`[$frac14]`] = [___________]{$deci14} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To change a fraction to a decimal, divide the numerator by the denominator. For example: [` \frac{1}{2}=1 \div 2 = 0.5 `] + +Conversions in this problem must be memorized. They will be frequently used in later math courses. + + [`` +\begin{aligned}[t] + [$frac0] &= [$deci0] & [$frac1] &= [$deci1] & [$frac2] &= [$deci2] \\ + [$frac3] &= [$deci3] & [$frac4] &= [$deci4] & [$frac5] &= [$deci5] \\ + [$frac6] &= [$deci6] & [$frac7] &= [$deci7] & [$frac8] &= [$deci8] \\ + [$frac9] &= [$deci9] & [$frac10] &= [$deci10] & [$frac11] &= [$deci11] \\ + [$frac12] &= [$deci12] & [$frac13] &= [$deci13] & [$frac14] &= [$deci14] +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent10.pg new file mode 100644 index 0000000000..2a3149914d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent10.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change fraction to percent. Denominators are 100. +# +# Last updated: Yao, 10/23/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','percent','convert') +## DBCCSS('6.RP','7.RP','4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "contextPercent.pl", +); + +############################################## + +Context("LimitedFraction"); + +do {$int1 = random(1,9,1);} until (gcd($int1,100)==1); +do {$int2 = random(11,99,1);} until (gcd($int2,100)==1); + +$frac1 = Fraction($int1,100); +$frac2 = Fraction($int2,100); + +Context("LimitedPercent-strict"); +Context()->flags->set( + decimalPlaces => 0, + tolerance => 0, +); + +$ans1 = Compute("$int1 %"); +$ans2 = Compute("$int2 %"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following fractions to percentages: + +a. [`[$frac1]`] = [___________]{$ans1} + +a. [`[$frac2]`] = [___________]{$ans2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since the denominator of these two fractions is [`100`], by definition of percentage, we have: + +a. [`` [$frac1] = [$int1] %``] + +a. [`` [$frac2] = [$int2] %``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent20.pg new file mode 100644 index 0000000000..48fea0d4ed --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent20.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change fraction to percent. Denominators are factors of 100. +# +# Last updated: Yao, 10/23/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','percent','convert') +## DBCCSS('6.RP','7.RP','4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "contextPercent.pl", +); + +############################################## + +Context("LimitedFraction"); + +@den = (2,4,5,10,20,25,50); + +$den1 = list_random(@den); +do {$num1 = random(1,$den1-1,1);} until (gcd($num1,$den1)==1); + +do {$den2 = list_random(@den);} until ($den1!=$den2); +do {$num2 = random(1,$den2-1,1);} until (gcd($num2,$den2)==1); + +$frac1 = Fraction($num1,$den1); +$frac2 = Fraction($num2,$den2); + +$factor1 = 100/$den1; +$factor2 = 100/$den2; + +$ans1Int = $factor1*$num1; +$ans2Int = $factor2*$num2; + +Context("LimitedPercent-strict"); +Context()->flags->set( + decimalPlaces => 0, + tolerance => 0, +); + +$ans1 = Compute("$ans1Int %"); +$ans2 = Compute("$ans2Int %"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following fractions to percentages: + +a. [`[$frac1]`] = [___________]{$ans1} + +a. [`[$frac2]`] = [___________]{$ans2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +####Method 1 + +Because the denominators can go into [`100`], we can change the denominators to [`100`], and then change the fractions to percentages. + +a. [`` [$frac1] = \frac{[$num1]\cdot[$factor1]}{[$den1]\cdot[$factor1]} = \frac{[$num1*$factor1]}{100} = [$ans1Int] %``] + +a. [`` [$frac2] = \frac{[$num2]\cdot[$factor2]}{[$den2]\cdot[$factor2]} = \frac{[$num2*$factor2]}{100} = [$ans2Int] %``] + +####Method 2 + +We can change a fraction to decimal by division, and then change the decimal to percentage. + +a. [`` [$frac1] = [$num1] \div [$den1] = [$ans1Int/100] = [$ans1Int] % ``] + +a. [`` [$frac2] = [$num2] \div [$den2] = [$ans2Int/100] = [$ans2Int] % ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent30.pg new file mode 100644 index 0000000000..eb49b3ea24 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent30.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change fraction to percent. No rounding is needed. +# +# Last updated: Yao, 10/23/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','percent','convert') +## DBCCSS('6.RP','7.RP','4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "contextPercent.pl", +); + +############################################## + +Context("LimitedFraction"); + +@den = (8,16); + +$den1 = list_random(@den); +do {$num1 = random(1,$den1 -1,1);} until (gcd($num1,$den1)==1); + +do {$den2 = list_random(@den);} until ($den1!=$den2); +do {$num2 = random(1,$den2 -1,1);} until (gcd($num2,$den2)==1); + +$frac1 = Fraction($num1,$den1); +$frac2 = Fraction($num2,$den2); + +$factor1 = 100/$den1; +$factor2 = 100/$den2; + +$ans1Int = $factor1*$num1; +$ans2Int = $factor2*$num2; + + +if ($den1==8) { + Context("LimitedPercent-strict"); + Context()->flags->set( + decimalPlaces => 1, + tolerance => 0, + ); + $ans1 = Compute("$ans1Int %"); + Context("LimitedPercent-strict"); + Context()->flags->set( + decimalPlaces => 2, + tolerance => 0, + ); + $ans2 = Compute("$ans2Int %"); +} else { + Context("LimitedPercent-strict"); + Context()->flags->set( + decimalPlaces => 2, + tolerance => 0, + ); + $ans1 = Compute("$ans1Int %"); + Context("LimitedPercent-strict"); + Context()->flags->set( + decimalPlaces => 1, + tolerance => 0, + ); + $ans2 = Compute("$ans2Int %"); +} + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following fractions to percentages: + +a. [`[$frac1]`] = [___________]{$ans1} + +a. [`[$frac2]`] = [___________]{$ans2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We change a fraction to decimal by division, and then change the decimal to percentage. + +a. [`` [$frac1] = [$num1] \div [$den1] = [$ans1Int/100] = [$ans1Int] % ``] + +a. [`` [$frac2] = [$num2] \div [$den2] = [$ans2Int/100] = [$ans2Int] % ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent40.pg new file mode 100644 index 0000000000..57b2bf94c7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/FractionToPercent40.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change fraction to percent. Rounding is needed. +# +# Last updated: Yao, 10/23/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','percent','convert','rounding') +## DBCCSS('6.RP','7.RP','4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", + "contextPercent.pl", +); + +############################################## + +Context("LimitedFraction"); + +@den = (3,6,7,9,11,13,15); + +$den1 = list_random(@den); +do {$num1 = random(1,$den1 -1,1);} until (gcd($num1,$den1)==1); + +do {$den2 = list_random(@den);} until ($den1!=$den2); +do {$num2 = random(1,$den2 -1,1);} until (gcd($num2,$den2)==1); + +$frac1 = Fraction($num1,$den1); +$frac2 = Fraction($num2,$den2); + +$ans1Dec = $num1/$den1*100; +$ans2Dec = $num2/$den2*100; + +$ans1DecRounded = sprintf("%.2f", $num1/$den1*100); +$ans2DecRounded = sprintf("%.2f", $num2/$den2*100); + +Context("LimitedPercent-strict"); + Context()->flags->set( + decimalPlaces => 2, + tolerance => 0, + ); + $ans1 = Compute("$ans1DecRounded %"); + $ans2 = Compute("$ans2DecRounded %"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following fractions to percentages. Round to two decimal places like [`12.34%`]. + +a. [`[$frac1]`] = [___________]{$ans1} + +a. [`[$frac2]`] = [___________]{$ans2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We change a fraction to decimal by division, and then change the decimal to percentage. + +a. [`` [$frac1] = [$num1] \div [$den1] \approx [$ans1Dec/100] \approx [$ans1DecRounded] % ``] + +a. [`` [$frac2] = [$num2] \div [$den2] \approx [$ans2Dec/100] \approx [$ans2DecRounded] % ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction10.pg new file mode 100644 index 0000000000..be20e54069 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction10.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change percent to fraction. Reduction is needed. +# +# Last updated: Yao, 10/23/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','percent','convert') +## DBCCSS('6.RP','7.RP','4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("LimitedFraction"); + +do {$int1 = random(1,9,1);} until (gcd($int1,100)!=1); +$int2 = $int1*10; + +$factor1 = gcd($int1,100); +$factor2 = gcd($int2,100); + +$frac1 = Fraction($int1,100); +$frac2 = Fraction($int2,100); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following percentages to fractions: + +a. [`[$int1]%`] = [___________]{$frac1} + +a. [`[$int2]%`] = [___________]{$frac2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The percentage symbol means [`\frac{}{100}`]. The solutions are: + +a. [`` [$int1] % = \frac{[$int1]}{100} = [$frac1] ``] (reduce fraction by dividing [`[$factor1]`] in numerator and denominator) + +a. [`` [$int2] % = \frac{[$int2]}{100} = [$frac2] ``] (reduce fraction by dividing [`[$factor2]`] in numerator and denominator) + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction20.pg new file mode 100644 index 0000000000..e894aa6083 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction20.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change percent to fraction. Reduction is needed. +# +# Last updated: Yao, 10/23/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','percent','convert') +## DBCCSS('6.RP','7.RP','4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("LimitedFraction"); + +$int1 = random(0,9,1)*10+5; +$int2 = 4*random(1,24,1); + +$factor1 = gcd($int1,100); +$factor2 = gcd($int2,100); + +$frac1 = Fraction($int1,100); +$frac2 = Fraction($int2,100); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following percentages to fractions: + +a. [`[$int1]%`] = [___________]{$frac1} + +a. [`[$int2]%`] = [___________]{$frac2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The percentage symbol means [`\frac{}{100}`]. The solutions are: + +a. [`` [$int1] % = \frac{[$int1]}{100} = [$frac1] ``] (reduce fraction by dividing [`[$factor1]`] in numerator and denominator) + +a. [`` [$int2] % = \frac{[$int2]}{100} = [$frac2] ``] (reduce fraction by dividing [`[$factor2]`] in numerator and denominator) + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction30.pg new file mode 100644 index 0000000000..f7d9dfe0e3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction30.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change percent to fraction. Reduction is needed. Percent is like 12.5%. +# +# Last updated: Yao, 10/23/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','percent','convert') +## DBCCSS('6.RP','7.RP','4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("LimitedFraction"); + +$int1 = random(1,99,1)*10+5; +$int2 = random(1,99,1)*10+random(2,8,2); + +$factor1 = gcd($int1,1000); +$factor2 = gcd($int2,1000); + +$frac1 = Fraction($int1,1000); +$frac2 = Fraction($int2,1000); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following percentages to fractions: + +a. [`[$int1/10]%`] = [___________]{$frac1} + +a. [`[$int2/10]%`] = [___________]{$frac2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +####Method 1 + +The percentage symbol means [`\frac{}{100}`]. For Problem 1, the first step is: + + [`` [$int1/10]% = \frac{[$int1/10]}{100} ``] + +We don't allow decimals in a fraction, so we need to multiply the numerator and denominator by [`10`] to get rid of decimals: + + [`` \frac{[$int1/10]}{100} = \frac{[$int1/10]\cdot 10}{100 \cdot 10} = \frac{[$int1]}{1000} ``] + +Then we reduce the fraction as usual. In this problem, we divide [`[$factor1]`] in both the numerator and denominator: + + [`` \frac{[$int1]}{1000} = [$frac1] ``] (reduce fraction by dividing [`[$factor1]`] in numerator and denominator) + +Here is the full solution to both problems: + +a. [`` [$int1/10] % = \frac{[$int1/10]}{100} = \frac{[$int1/10]\cdot 10}{100 \cdot 10} = \frac{[$int1]}{1000} = [$frac1] ``] (reduce fraction by dividing [`[$factor1]`] in numerator and denominator) + +a. [`` [$int2/10] % = \frac{[$int2/10]}{100} = \frac{[$int2/10]\cdot 10}{100 \cdot 10} = \frac{[$int2]}{1000} = [$frac2] ``] (reduce fraction by dividing [`[$factor2]`] in numerator and denominator) + +####Method 2 + +The second method is to change a percentage to decimal, and then change the decimal to fraction. + +a. [`` [$int1/10] % = [$int1/1000] = \frac{[$int1]}{1000} = [$frac1] ``] (reduce fraction by dividing [`[$factor1]`] in numerator and denominator) + +a. [`` [$int2/10] % = [$int2/1000] = \frac{[$int2]}{1000} = [$frac2] ``] (reduce fraction by dividing [`[$factor2]`] in numerator and denominator) + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction40.pg new file mode 100644 index 0000000000..ec0d3ac57e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionPercentDecimal/PercentToFraction40.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Change percent to fraction. Reduction is needed. Percent is like 0.5%. +# +# Last updated: Yao, 10/23/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('decimal','fraction','percent','convert') +## DBCCSS('6.RP','7.RP','4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +Context("LimitedFraction"); + +$int1 = 5; +$int2 = random(2,8,2); + +$factor1 = gcd($int1,1000); +$factor2 = gcd($int2,10000); + +$frac1 = Fraction($int1,1000); +$frac2 = Fraction($int2,10000); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Change the following percentages to fractions: + +a. [`[$int1/10]%`] = [___________]{$frac1} + +a. [`[$int2/100]%`] = [___________]{$frac2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +####Method 1 + +The percentage symbol means [`\frac{}{100}`]. For Problem 1, the first step is: + + [`` [$int1/10]% = \frac{[$int1/10]}{100} ``] + +We don't allow decimals in a fraction, so we need to multiply the numerator and denominator by [`10`] to get rid of decimals: + + [`` \frac{[$int1/10]}{100} = \frac{[$int1/10]\cdot 10}{100 \cdot 10} = \frac{[$int1]}{1000} ``] + +Then we reduce the fraction as usual. In this problem, we divide [`[$factor1]`] in both the numerator and denominator: + + [`` \frac{[$int1]}{1000} = [$frac1] ``] (reduce fraction by dividing [`[$factor1]`] in numerator and denominator) + +Here is the full solution to both problems: + +a. [`` [$int1/10] % = \frac{[$int1/10]}{100} = \frac{[$int1/10]\cdot 10}{100 \cdot 10} = \frac{[$int1]}{1000} = [$frac1] ``] (reduce fraction by dividing [`[$factor1]`] in numerator and denominator) + +a. [`` [$int2/100] % = \frac{[$int2/100]}{100} = \frac{[$int2/10]\cdot 100}{100 \cdot 100} = \frac{[$int2]}{10000} = [$frac2] ``] (reduce fraction by dividing [`[$factor2]`] in numerator and denominator) + +####Method 2 + +The second method is to change a percentage to decimal, and then change the decimal to fraction. + +a. [`` [$int1/10] % = [$int1/1000] = \frac{[$int1]}{1000} = [$frac1] ``] (reduce fraction by dividing [`[$factor1]`] in numerator and denominator) + +a. [`` [$int2/100] % = [$int2/10000] = \frac{[$int2]}{10000} = [$frac2] ``] (reduce fraction by dividing [`[$factor2]`] in numerator and denominator) + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions10.pg index 92316514dd..2b5c0d0871 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions10.pg @@ -8,19 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingThreeMixedNumbers) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') - +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -69,7 +68,7 @@ TEXT(beginproblem()); BEGIN_PGML -Add these fractions: [`` [$frac1] + [$frac2] + [$frac3] ``] +Add: [`` [$frac1] + [$frac2] + [$frac3] ``] [___________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions20.pg index 88af8739de..55b63e1ee3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions20.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(add_3_fractions) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,7 +66,7 @@ TEXT(beginproblem()); BEGIN_PGML -Add these fractions: [`` [$frac1] + [$frac2] + [$frac3] ``] +Add: [`` [$frac1] + [$frac2] + [$frac3] ``] [___________]{$ans} @@ -98,3 +99,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions30.pg index 88310c9d4a..5e47653526 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions30.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(add_3_fractions) -## Level(3) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -84,7 +85,7 @@ TEXT(beginproblem()); BEGIN_PGML -Add these fractions: [`` [$frac1] + [$frac2] + [$frac3] ``] +Add: [`` [$frac1] + [$frac2] + [$frac3] ``] [___________]{$ans} @@ -124,3 +125,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions40.pg index 49d3e5c879..812f1bb5b2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/AddThreeFractions40.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(add_3_fractions) -## Level(3) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -84,12 +85,10 @@ TEXT(beginproblem()); BEGIN_PGML -Add these fractions: [`` [$frac1] + [$frac2] + [$frac3] ``] +Add: [`` [$frac1] + [$frac2] + [$frac3] ``] [___________]{$ans} -Express your answer in simplest form. - END_PGML ############################################## @@ -127,3 +126,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg index 4ed0b93de7..0d21195273 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.7.a') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Inequalities) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('compare','fraction') +## DBCCSS('6.NS.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') #This command starts the problem. DOCUMENT(); @@ -23,12 +26,12 @@ DOCUMENT(); ########Begin Load Macro Files############ loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "contextFraction.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -91,4 +94,4 @@ The answer is: END_PGML_SOLUTION -ENDDOCUMENT(); +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg index 773daa3a45..a69d22d19a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.7.a') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Inequalities) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('compare','fraction') +## DBCCSS('6.NS.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') #This command starts the problem. DOCUMENT(); @@ -23,12 +26,12 @@ DOCUMENT(); ########Begin Load Macro Files############ loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "contextFraction.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -93,4 +96,4 @@ The answer is: END_PGML_SOLUTION -ENDDOCUMENT(); +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg index d2e9c186e1..c516c77eb4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.7.a') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Inequalities) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('compare','fraction') +## DBCCSS('6.NS.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') #This command starts the problem. DOCUMENT(); @@ -24,12 +27,12 @@ DOCUMENT(); ########Begin Load Macro Files############ loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "contextFraction.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -96,4 +99,4 @@ The answer is: END_PGML_SOLUTION -ENDDOCUMENT(); +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions40.pg new file mode 100644 index 0000000000..eb266dc676 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions40.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Compare two fractions with the same numerator and different denominators. +# +# Last edited: Yao 9/26/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('compare','fraction') +## DBCCSS('6.NS.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object + "parserPopUp.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +TEXT(beginproblem()); +Context("Fraction"); + +$num = random(2,10,1); +do {$den1 = random($num,15,1);} until (gcd($num,$den1)==1); +do {$den2 = random($num,15,1);} until ((gcd($num,$den2)==1) && ($den2!=$den1)); + +$frac1 = Fraction($num, $den1); +$frac2 = Fraction($num, $den2); + +Context()->strings->add('<'=>{},'>'=>{},'='=>{}); + +if($frac1 < $frac2) +{ + $answer = String('<'); + $popup = PopUp(["?", $LTS, $GTS, "="], $LTS); +} +elsif($frac1 > $frac2) +{ + $answer = String('>'); + $popup = PopUp(["?", $LTS, $GTS, "="], $GTS); +} +else +{ + $answer = String('='); + $popup = PopUp(["?", $LTS, $GTS, "="], "="); +} + +$answer='{}'.$answer.'{}'; + +########Begin What the Student Sees############ + +BEGIN_PGML + +Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement. + + [`` [$frac1] ``] [@$popup->menu()@]* [`` [$frac2] ``] + +END_PGML + +########Begin more complicated answer processing (if needed)############ + +ANS( $popup->cmp(correct_ans_latex_string => "$answer") ); + +if ($den1>$den2) { + $which = "second"; +} else { + $which = "first"; +} + +########Begin solution.############ + +BEGIN_PGML_SOLUTION + +The fraction [` [$frac1] `] represents cutting the whole into [`[$den1]`] pieces evenly, and then taking [`[$num]`] pieces. + +The fraction [` [$frac2] `] represents cutting the whole into [`[$den2]`] pieces evenly, and then takin [`[$num]`] pieces. + +Since the [$which] fraction has bigger pieces, it has a bigger value. + +The answer is: + + [``[$frac1][$answer][$frac2]``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg index bb2fd79c1e..edcdaec476 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.7.a') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Inequalities) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('compare','fraction') +## DBCCSS('6.NS.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') #This command starts the problem. DOCUMENT(); @@ -24,12 +27,12 @@ DOCUMENT(); ########Begin Load Macro Files############ loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "contextFraction.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -106,4 +109,4 @@ the answer is: END_PGML_SOLUTION -ENDDOCUMENT(); +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg index 251160a26a..f93b2f896b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.7.a') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Inequalities) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('compare','fraction') +## DBCCSS('6.NS.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') #This command starts the problem. DOCUMENT(); @@ -24,12 +27,12 @@ DOCUMENT(); ########Begin Load Macro Files############ loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "PGML.pl", - "contextFraction.pl", + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); @@ -106,4 +109,4 @@ the answer is: END_PGML_SOLUTION -ENDDOCUMENT(); +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions70.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions70.pg new file mode 100644 index 0000000000..ae9251e5fd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions70.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Compare two fractions with different denominators. One fraction can be +# reduced. +# +# Last edited: Yao 9/26/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('compare','fraction') +## DBCCSS('6.NS.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object + "parserPopUp.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(reduceFractions=>0); + +$den1 = random(5,10,1); +do {$num1=random(2,$den1,1);} until (gcd($num1,$den1)==1); + +$den2 = $den1; +do {$num2=random(2,$den2,1);} until (gcd($num2,$den2)==1); +$multiple = random(2,5,1); +$den2 = $den2*$multiple; +$num2 = $num2*$multiple; + +$com = lcm($den1,$den2); + +$frac1 = Fraction($num1, $den1); +$frac2 = Fraction($num2, $den2); +$frac2Reduced = $frac2->reduce; + +Context()->strings->add('<'=>{},'>'=>{},'='=>{}); + +if($frac1 < $frac2) +{ + $answer = String('<'); + $popup = PopUp(["?", $LTS, $GTS, "="], $LTS); +} +elsif($frac1 > $frac2) +{ + $answer = String('>'); + $popup = PopUp(["?", $LTS, $GTS, "="], $GTS); +} +else +{ + $answer = String('='); + $popup = PopUp(["?", $LTS, $GTS, "="], "="); +} + + + +########Begin What the Student Sees############ + +BEGIN_PGML + +Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement. + + [`` [$frac1] ``] [@$popup->menu()@]* [`` [$frac2] ``] + +END_PGML + +########Begin more complicated answer processing (if needed)############ + +ANS( $popup->cmp(correct_ans_latex_string => "$answer") ); + +########Begin solution.############ + +$answer='{}'.$answer.'{}'; +BEGIN_PGML_SOLUTION + +It's always helpful to reduce fractions if we can. Notice that the second fraction can be reduced: + + [`` [$frac2] = \frac{[$num2]\div[$multiple]}{[$den2]\div[$multiple]} = [$frac2Reduced] ``] + +Their denominators happen to be the same, so we can simply compare the numerators. Since + + [``[$frac1][$answer][$frac2Reduced]``] + +the answer is: + + [``[$frac1][$answer][$frac2]``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions80.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions80.pg new file mode 100644 index 0000000000..5807cd64d7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions80.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Compare two fractions with different denominators. +# +# Last edited: Yao 9/26/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('compare','fraction') +## DBCCSS('6.NS.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object + "parserPopUp.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +TEXT(beginproblem()); +Context("Fraction"); +#Context()->flags->set(reduceFractions=>0); + +$den1 = random(3,10,1); +do {$num1=random(1,$den1,1);} until (gcd($num1,$den1)==1); + +do {$den2 = random(3,10,1);} until ( ($den1!=$den2) && ($den1%$den2!=0) && ($den2%$den1!=0) ); +do {$num2=random(1,$den2,1);} until ((gcd($num2,$den2)==1) && ($num2!=$num1)); + +$com = lcm($den1,$den2); + +$frac1 = Fraction($num1, $den1); +$frac2 = Fraction($num2, $den2); + +Context()->strings->add('<'=>{},'>'=>{},'='=>{}); + +if($frac1 < $frac2) +{ + $answer = String('<'); + $popup = PopUp(["?", $LTS, $GTS, "="], $LTS); +} +elsif($frac1 > $frac2) +{ + $answer = String('>'); + $popup = PopUp(["?", $LTS, $GTS, "="], $GTS); +} +else +{ + $answer = String('='); + $popup = PopUp(["?", $LTS, $GTS, "="], "="); +} + + +########Begin What the Student Sees############ + +BEGIN_PGML + +Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement. + + [`` [$frac1] ``] [@$popup->menu()@]* [`` [$frac2] ``] + +END_PGML + +########Begin more complicated answer processing (if needed)############ + +ANS( $popup->cmp(correct_ans_latex_string => "$answer") ); + +$multiple1 = $com/$den1; +$multiple2 = $com/$den2; + +########Begin solution.############ + +$answer='{}'.$answer.'{}'; + +BEGIN_PGML_SOLUTION + +To compare two fractions, one method is to change their denominators to the same number. + +For this problem, a common denominator is [`[$com]`]. + +We convert the first fraction to: + + [`` [$frac1] = \frac{[$num1]\cdot[$multiple1]}{[$den1]\cdot[$multiple1]} = \frac{[$num1*$multiple1]}{[$den1*$multiple1]} ``] + +We convert the second fraction to: + + [`` [$frac2] = \frac{[$num2]\cdot[$multiple2]}{[$den2]\cdot[$multiple2]} = \frac{[$num2*$multiple2]}{[$den2*$multiple2]} ``] + +Now we can compare these two fractions. Since + + [``\frac{[$num1*$multiple1]}{[$den1*$multiple1]}[$answer]\frac{[$num2*$multiple2]}{[$den2*$multiple2]}``] + +the answer is: + + [``[$frac1]``] [``{\bf [$answer]}``] [``[$frac2]``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions90.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions90.pg new file mode 100644 index 0000000000..b7b7a15811 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions90.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Compare two fractions with different denominators. +# Both fractions are negative. +# +# Last edited: Yao 9/26/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('compare','fraction') +## DBCCSS('6.NS.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +#This command starts the problem. +DOCUMENT(); + +########Begin Load Macro Files############ + +loadMacros( + "PGstandard.pl", #Always needed + "MathObjects.pl", #Almost always needed + "PGML.pl", #Almost always needed + "contextFraction.pl", #needed to have the Fraction Math Object + "parserPopUp.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +TEXT(beginproblem()); +Context("Fraction"); +#Context()->flags->set(reduceFractions=>0); + +$den1 = random(3,10,1); +do {$num1=random(1,$den1,1);} until (gcd($num1,$den1)==1); + +do {$den2 = random(3,10,1);} until ( ($den1!=$den2) && ($den1%$den2!=0) && ($den2%$den1!=0) ); +do {$num2=random(1,$den2,1);} until ((gcd($num2,$den2)==1) && ($num2!=$num1)); + +$com = lcm($den1,$den2); + +$frac1 = Fraction(-$num1, $den1); +$frac2 = Fraction(-$num2, $den2); + +Context()->strings->add('<'=>{},'>'=>{},'='=>{}); + +if($frac1 < $frac2) +{ + $answer = String('<'); + $popup = PopUp(["?", $LTS, $GTS, "="], $LTS); +} +elsif($frac1 > $frac2) +{ + $answer = String('>'); + $popup = PopUp(["?", $LTS, $GTS, "="], $GTS); +} +else +{ + $answer = String('='); + $popup = PopUp(["?", $LTS, $GTS, "="], "="); +} + +########Begin What the Student Sees############ + +BEGIN_PGML + +Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement. + + [`` [$frac1] ``] [@$popup->menu()@]* [`` [$frac2] ``] + +END_PGML + +########Begin more complicated answer processing (if needed)############ + +ANS( $popup->cmp(correct_ans_latex_string => "$answer") ); + +$multiple1 = $com/$den1; +$multiple2 = $com/$den2; + +########Begin solution.############ + +$answer='{}'.$answer.'{}'; + +BEGIN_PGML_SOLUTION + +To compare two fractions, one method is to change their denominators to the same number. + +For this problem, a common denominator is [`[$com]`]. + +We convert the first fraction to: + + [`` [$frac1] = -{\frac{[$num1]\cdot[$multiple1]}{[$den1]\cdot[$multiple1]}} = -{\frac{[$num1*$multiple1]}{[$den1*$multiple1]}} ``] + +We convert the second fraction to: + + [`` [$frac2] = -{\frac{[$num2]\cdot[$multiple2]}{[$den2]\cdot[$multiple2]}} = -{\frac{[$num2*$multiple2]}{[$den2*$multiple2]}} ``] + +Now we can compare these two fractions. Since + + [``{-{\frac{[$num1*$multiple1]}{[$den1*$multiple1]}}}[$answer]{-{\frac{[$num2*$multiple2]}{[$den2*$multiple2]}}}``] + +the answer is: + + [``[$frac1][$answer][$frac2]``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions11.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions11.pg index 8b90fd45b2..53b2180d25 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions11.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions11.pg @@ -9,18 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.4.a') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Division) -## Institution(PCC) -## Author(Carl Yao) -## MLT(dividingTwoRationals) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('divide','fraction','reduce') - +## DBCCSS('5.NF.4.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') @@ -34,7 +34,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -95,3 +95,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions12.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions12.pg index 35c3954e5d..186644d1d2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions12.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions12.pg @@ -9,17 +9,21 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('divide','fraction','reduce','negative') ## DBCCSS('5.NF.4.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Division) -## Institution(PCC) -## Author(Carl Yao) -## MLT(dividingTwoRationals) -## Level(2) -## MO(1) -## KEYWORDS('divide','fraction','reduce','negative') ############################################## @@ -30,7 +34,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -94,3 +98,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions32.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions32.pg index d78c2b3688..8b6f1afb7b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions32.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions32.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.4.a','4.NF.4.b') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Division) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('divide','fraction') +## DBCCSS('5.NF.4.a','4.NF.4.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions42.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions42.pg index 8a31076e80..da1696d191 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions42.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/DivideFractions42.pg @@ -7,18 +7,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('divide','fraction') ## DBCCSS('5.NF.4.a','4.NF.4.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Division) -## Institution(PCC) -## Author(Carl Yao) -## MLT(divideRationalByInteger) -## MLTleader(1) -## Level(2) -## MO(1) -## KEYWORDS('divide','fraction') ############################################## @@ -30,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/EquivalentFraction10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/EquivalentFraction10.pg index 1a8cb8c328..5273a3c38b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/EquivalentFraction10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/EquivalentFraction10.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Ratio/proportions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(equlvalentRationalNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('equivalent','fraction') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,12 +29,21 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "bizarroArithmetic.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedNumeric"); +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showStudentAnswer=>'parsed'); +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); $den1 = random(2,9,1); do {$num1 = random(1,$den1-1,1);} until (gcd($num1,$den1)==1); @@ -44,17 +53,33 @@ $factor=random(2,5,1); $den2 = $factor*$den1; $num2 = $factor*$num1; +$answer = Formula("$num2/$den2"); +$evaluator = $answer -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0); + Value::Error("Your fraction is equivalent to the given fraction but it does not have denominator $den2.") unless $OK; + return $OK; +}); + ############################################## TEXT(beginproblem()); BEGIN_PGML -Find an equivalent fraction to [`\frac{[$num1]}{[$den1]}`]: - - [`` \frac{[$num1]}{[$den1]} = \frac{?}{[$den2]} ``] +Find an equivalent fraction to [`\frac{[$num1]}{[$den1]}`] with denominator [`[$den2]`]. -The question mark should be the number [________]{$num2}. +[________]{$evaluator} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/EquivalentFraction20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/EquivalentFraction20.pg index ef6f5b1fc3..811626d13e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/EquivalentFraction20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/EquivalentFraction20.pg @@ -7,19 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Ratio/proportions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(equlvalentRationalNumbers) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('equivalent','fraction') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,14 +29,24 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "bizarroArithmetic.pl", + "PGcourse.pl", ); ############################################## -Context("LimitedNumeric"); +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(showStudentAnswer=>'parsed'); +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); -$den1 = random(2,9,1); + +$den1 = random(2,19,1); do {$num1 = random(1,$den1-1,1);} until (gcd($num1,$den1)==1); $factor=random(2,5,1); @@ -45,17 +54,34 @@ $factor=random(2,5,1); $den2 = $factor*$den1; $num2 = $factor*$num1; +$answer = Formula("$num2/$den2"); +$evaluator = $answer -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0); + Value::Error("Your fraction is equivalent to the given fraction but it does not have denominator $den2.") unless $OK; + return $OK; +}); + + ############################################## TEXT(beginproblem()); BEGIN_PGML -Find an equivalent fraction to [`\frac{[$num1]}{[$den1]}`]: - - [`` \frac{[$num1]}{[$den1]} = \frac{[$num2]}{?} ``] +Find an equivalent fraction to [`\frac{[$num1]}{[$den1]}`] with denominator [`[$den2]`]. -The question mark should be the number [________]{$den2}. +[________]{$evaluator} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation10.pg new file mode 100644 index 0000000000..61f5286918 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation10.pg @@ -0,0 +1,158 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the result of fraction additions. +# +# Last edited by Alex Jordan 7/5/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +$refreshCachedImages = 1; + +Context("Numeric"); + +@nums = ( ); +@dens = ( ); +@popups = ( ); + +do { + do { + $dens[0][0] = random(5,20,1); + $nums[0][0] = random(1,3,1); + } until ($nums[0][0]/$dens[0][0]<0.1); + do { + do {$dens[0][1] = random(5,20,1);} until ($dens[0][1]!=$dens[0][0]); + $nums[0][1] = random(1,3,1); + } until ($nums[0][1]/$dens[0][1]<0.1); +} until ( (gcd($nums[0][0],$dens[0][0])==1) && (gcd($nums[0][1],$dens[0][1])==1) && ($nums[0][0]/$dens[0][0]+$nums[0][1]/$dens[0][1]<0.15) ); +$popups[0] = PopUp( + ['?', "zero","half","one", "two"], + 1, # correct answer +); + +do { + $dens[1][0] = random(5,20,1); + $nums[1][0] = ($dens[1][0]%2==0) ? $dens[1][0]/2-1 : int($dens[1][0]/2); + do { + do {$dens[1][1] = random(5,20,1);} until ($dens[1][1]!=$dens[1][0]); + $nums[1][1] = random(1,3,1); + } until ($nums[1][1]/$dens[1][1]<0.1); +} until ( (gcd($nums[1][0],$dens[1][0])==1) && (gcd($nums[1][1],$dens[1][1])==1) && ($nums[1][0]/$dens[1][0]>0.4) && ($nums[1][1]/$dens[1][1]<0.1) ); +$popups[1] = PopUp( + ['?', "zero","half","one", "two"], + 2, # correct answer +); + +do { + $dens[2][0] = random(5,20,1); + $nums[2][0] = ($dens[2][0]%2==0) ? $dens[2][0]/2-1 : int($dens[2][0]/2); + do {$dens[2][1] = random(5,20,1);} until ($dens[2][1]!=$dens[2][0]); + $nums[2][1] = int($dens[2][1]/2)+1; +} until ( (gcd($nums[2][0],$dens[2][0])==1) && (gcd($nums[2][1],$dens[2][1])==1) && ($nums[2][0]/$dens[2][0]>0.4) && ($nums[2][1]/$dens[2][1]<0.6) ); +$popups[2] = PopUp( + ['?', "zero","half","one", "two"], + 3, # correct answer +); + + +do { + do { + $dens[3][0] = random(5,20,1); + $nums[3][0] = random($dens[3][0]-3,$dens[3][0]-1,1); + } until ($nums[3][0]/$dens[3][0]>0.9); + do { + do {$dens[3][1] = random(5,20,1);} until ($dens[3][1]!=$dens[3][0]); + $nums[3][1] = random($dens[3][1]-3,$dens[3][1]-1,1); + } until ($nums[3][1]/$dens[3][1]>0.9); +} until ( (gcd($nums[3][0],$dens[3][0])==1) && (gcd($nums[3][1],$dens[3][1])==1) ); +$popups[3] = PopUp( + ['?', "zero","half","one", "two"], + 4, # correct answer +); + +#Create a hash and its inverse that randomizes the order of the three problems. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +############################################## + +BEGIN_PGML + +Estimate the sum of each expression, and choose an appropriate answer. + +a. [`\frac{[$nums[$scramble{0}][0]]}{[$dens[$scramble{0}][0]]}+\frac{[$nums[$scramble{0}][1]]}{[$dens[$scramble{0}][1]]}`] is close to [__]{$popups[$scramble{0}]} + +a. [`\frac{[$nums[$scramble{1}][0]]}{[$dens[$scramble{1}][0]]}+\frac{[$nums[$scramble{1}][1]]}{[$dens[$scramble{1}][1]]}`] is close to [__]{$popups[$scramble{1}]} + +a. [`\frac{[$nums[$scramble{2}][0]]}{[$dens[$scramble{2}][0]]}+\frac{[$nums[$scramble{2}][1]]}{[$dens[$scramble{2}][1]]}`] is close to [__]{$popups[$scramble{2}]} + +a. [`\frac{[$nums[$scramble{3}][0]]}{[$dens[$scramble{3}][0]]}+\frac{[$nums[$scramble{3}][1]]}{[$dens[$scramble{3}][1]]}`] is close to [__]{$popups[$scramble{3}]} + + +END_PGML + +############################################## + +$text0 = ($nums[0][0]==1) ? "piece" : "pieces"; + +BEGIN_PGML_SOLUTION + +Here is how to estimate the value of a fraction: + +Fraction [`\frac{[$nums[0][0]]}{[$dens[0][0]]}`] implies: We cut the whole evenly into [`[$dens[0][0]]`] pieces, and then take only [`[$nums[0][0]]`] [$text0]. This fraction's value is very close to zero. + +Fraction [`\frac{[$nums[1][0]]}{[$dens[1][0]]}`] implies: We cut the whole evenly into [`[$dens[1][0]]`] pieces, and then take [`[$nums[1][0]]`] pieces. Since [`[$nums[1][0]]`] is a little less than half of [`[$dens[1][0]]`], this fraction's value is a little less than half. + +Fraction [`\frac{[$nums[2][1]]}{[$dens[2][1]]}`] implies: We cut the whole evenly into [`[$dens[2][1]]`] pieces, and then take [`[$nums[2][1]]`] pieces. Since [`[$nums[2][1]]`] is a little greater than half of [`[$dens[2][1]]`], this fraction's value is a little greater than half. + +Fraction [`\frac{[$nums[3][0]]}{[$dens[3][0]]}`] implies: We cut the whole evenly into [`[$dens[3][0]]`] pieces, and then take [`[$nums[3][0]]`] pieces. Since almost all pieces were taken, this fraction's value is very close to one. + +Here is how to solve each problem: + +For [`\frac{[$nums[0][0]]}{[$dens[0][0]]}+\frac{[$nums[0][1]]}{[$dens[0][1]]}`], both fractions are very close to zero. As a result, the sum is also very close to zero. + +For [`\frac{[$nums[1][0]]}{[$dens[1][0]]}+\frac{[$nums[1][1]]}{[$dens[1][1]]}`], the first fraction is close to half, the second fraction is close to zero. As a result, the sum is very close to half. + +For [`\frac{[$nums[2][0]]}{[$dens[2][0]]}+\frac{[$nums[2][1]]}{[$dens[2][1]]}`], both fractions are close to half. As a result, the sum is very close to one. + +For [`\frac{[$nums[3][0]]}{[$dens[3][0]]}+\frac{[$nums[3][1]]}{[$dens[3][1]]}`], both fractions are close to one. As a result, the sum is very close to two. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation20.pg new file mode 100644 index 0000000000..fde2195944 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation20.pg @@ -0,0 +1,148 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the result of fraction additions. +# +# Last edited by Alex Jordan 6/5/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + + +############################################## +TEXT(beginproblem()); +$refreshCachedImages = 1; + +Context("Numeric"); + +@nums = ( ); +@dens = ( ); +@popups = ( ); + +do { + $dens[0][0] = random(5,20,1); + $nums[0][0] = ($dens[0][0]%2==0) ? $dens[0][0]/2-1 : int($dens[0][0]/2); + do {$dens[0][1] = random(5,20,1);} until ($dens[0][1]!=$dens[0][0]); + $nums[0][1] = ($dens[0][1]%2==0) ? $dens[0][1]/2-1 : int($dens[0][1]/2); +} until ( (gcd($nums[0][0],$dens[0][0])==1) && (gcd($nums[0][1],$dens[0][1])==1) && ($nums[0][0]/$dens[0][0]+$nums[0][1]/$dens[0][1]>0.8) ); +$popups[0] = PopUp( + ['?', "greater","less"], + 2, # correct answer +); + +do { + $dens[1][0] = random(5,20,1); + $nums[1][0] = int($dens[1][0]/2)+1; + do {$dens[1][1] = random(5,20,1);} until ($dens[1][1]!=$dens[1][0]); + $nums[1][1] = int($dens[1][1]/2)+1; +} until ( (gcd($nums[1][0],$dens[1][0])==1) && (gcd($nums[1][1],$dens[1][1])==1) && ($nums[1][0]/$dens[1][0]+$nums[1][1]/$dens[1][1]<1.2) ); +$popups[1] = PopUp( + ['?', "greater","less"], + 1, # correct answer +); + +do { + $dens[2][0] = random(5,20,1); + $nums[2][0] = int($dens[2][0]/2)+1; + do {$dens[2][1] = random(5,20,1);} until ($dens[2][1]!=$dens[2][0]); + $nums[2][1] = random(1,3,1); +} until ( (gcd($nums[2][0],$dens[2][0])==1) && (gcd($nums[2][1],$dens[2][1])==1) && ($nums[2][0]/$dens[2][0]<0.6) && ($nums[2][1]/$dens[2][1]<0.1) ); +$popups[2] = PopUp( + ['?', "greater","less"], + 2, # correct answer +); + + +do { + $dens[3][0] = random(5,20,1); + $nums[3][0] = random($dens[3][0]-3,$dens[3][0]-1,1); + do {$dens[3][1] = random(5,20,1);} until ($dens[3][1]!=$dens[3][0]); + $nums[3][1] = int($dens[3][1]/2)-1; +} until ( (gcd($nums[3][0],$dens[3][0])==1) && (gcd($nums[3][1],$dens[3][1])==1) && ($nums[3][0]/$dens[3][0]>0.9) && ($nums[3][1]/$dens[3][1]>0.3) ); +$popups[3] = PopUp( + ['?', "greater","less"], + 1, # correct answer +); + +#Create a hash and its inverse that randomizes the order of the three problems. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +############################################## + +BEGIN_PGML + +Estimate the sum of each expression, and choose an appropriate answer. + +a. [`\frac{[$nums[$scramble{0}][0]]}{[$dens[$scramble{0}][0]]}+\frac{[$nums[$scramble{0}][1]]}{[$dens[$scramble{0}][1]]}`] is [__]{$popups[$scramble{0}]} than one. + +a. [`\frac{[$nums[$scramble{1}][0]]}{[$dens[$scramble{1}][0]]}+\frac{[$nums[$scramble{1}][1]]}{[$dens[$scramble{1}][1]]}`] is [__]{$popups[$scramble{1}]} than one. + +a. [`\frac{[$nums[$scramble{2}][0]]}{[$dens[$scramble{2}][0]]}+\frac{[$nums[$scramble{2}][1]]}{[$dens[$scramble{2}][1]]}`] is [__]{$popups[$scramble{2}]} than one. + +a. [`\frac{[$nums[$scramble{3}][0]]}{[$dens[$scramble{3}][0]]}+\frac{[$nums[$scramble{3}][1]]}{[$dens[$scramble{3}][1]]}`] is [__]{$popups[$scramble{3}]} than one. + +END_PGML + +############################################## + +$text0 = ($nums[2][1]==1) ? "piece" : "pieces"; + +BEGIN_PGML_SOLUTION + +Here is how to estimate the value of a fraction: + +Fraction [`\frac{[$nums[2][1]]}{[$dens[2][1]]}`] implies: We cut the whole evenly into [`[$dens[2][1]]`] pieces, and then take only [`[$nums[2][1]]`] [$text0]. This fraction's value is very close to zero. + +Fraction [`\frac{[$nums[0][0]]}{[$dens[0][0]]}`] implies: We cut the whole evenly into [`[$dens[0][0]]`] pieces, and then take [`[$nums[0][0]]`] pieces. Since [`[$nums[0][0]]`] is a little bit less than half of [`[$dens[0][0]]`], this fraction's value is a little bit less than half. + +Fraction [`\frac{[$nums[1][0]]}{[$dens[1][0]]}`] implies: We cut the whole evenly into [`[$dens[1][0]]`] pieces, and then take [`[$nums[1][0]]`] pieces. Since [`[$nums[1][0]]`] is a little bit greater than half of [`[$dens[1][0]]`], this fraction's value is a little bit greater than half. + +Fraction [`\frac{[$nums[3][0]]}{[$dens[3][0]]}`] implies: We cut the whole evenly into [`[$dens[3][0]]`] pieces, and then take [`[$nums[3][0]]`] pieces. Since almost all pieces were taken, this fraction's value is very close to one. + +Here is how to solve each problem: + +For [`\frac{[$nums[0][0]]}{[$dens[0][0]]}+\frac{[$nums[0][1]]}{[$dens[0][1]]}`], both fractions are less than half. As a result, the sum is less than one. + +For [`\frac{[$nums[1][0]]}{[$dens[1][0]]}+\frac{[$nums[1][1]]}{[$dens[1][1]]}`], both fractions are greater than half. As a result, the sum is greater than one. + +For [`\frac{[$nums[2][0]]}{[$dens[2][0]]}+\frac{[$nums[2][1]]}{[$dens[2][1]]}`], the first fraction is a little greater than half, and the second fraction is close to zero. As a result, their sum is less than one. + +For [`\frac{[$nums[3][0]]}{[$dens[3][0]]}+\frac{[$nums[3][1]]}{[$dens[3][1]]}`], the first fraction is close to one, and the second fraction is close to half. As a result, their sum is greater than one. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation30.pg new file mode 100644 index 0000000000..80e5dab5c5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation30.pg @@ -0,0 +1,156 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the result of fraction additions. +# +# Last edited by Alex Jordan 6/5/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## +TEXT(beginproblem()); +$refreshCachedImages = 1; + +Context("Numeric"); + +$shift1 = random(2,5,1); +do {$shift2 = random(2,5,1);} until ($shift2!=$shift1); +$word1 = numberWord($shift1+$shift2); +$word2 = numberWord($shift1+$shift2+1); +$word3 = numberWord($shift1+$shift2+2); +@nums = ( ); +@dens = ( ); +@popups = ( ); + +do { + do { + $dens[0][0] = random(5,20,1); + $nums[0][0] = random(1,3,1); + } until ($nums[0][0]/$dens[0][0]<0.1); + do { + do {$dens[0][1] = random(5,20,1);} until ($dens[0][1]!=$dens[0][0]); + $nums[0][1] = random(1,3,1); + } until ($nums[0][1]/$dens[0][1]<0.1); +} until ( (gcd($nums[0][0],$dens[0][0])==1) && (gcd($nums[0][1],$dens[0][1])==1) && ($nums[0][0]/$dens[0][0]+$nums[0][1]/$dens[0][1]<0.15) ); +$popups[0] = PopUp( + ['?', "$word1","$word1 and a half","$word2", "$word3"], + 1, # correct answer +); + +do { + $dens[1][0] = random(5,20,1); + $nums[1][0] = ($dens[1][0]%2==0) ? $dens[1][0]/2-1 : int($dens[1][0]/2); + do {$dens[1][1] = random(5,20,1);} until ($dens[1][1]!=$dens[1][0]); + $nums[1][1] = random(1,3,1); +} until ( (gcd($nums[1][0],$dens[1][0])==1) && (gcd($nums[1][1],$dens[1][1])==1) && ($nums[1][0]/$dens[1][0]>0.4) && ($nums[1][1]/$dens[1][1]<0.1) ); +$popups[1] = PopUp( + ['?', "$word1","$word1 and a half","$word2", "$word3"], + 2, # correct answer +); + +do { + $dens[2][0] = random(5,20,1); + $nums[2][0] = ($dens[2][0]%2==0) ? $dens[2][0]/2-1 : int($dens[2][0]/2); + do {$dens[2][1] = random(5,20,1);} until ($dens[2][1]!=$dens[2][0]); + $nums[2][1] = int($dens[2][1]/2)+1; +} until ( (gcd($nums[2][0],$dens[2][0])==1) && (gcd($nums[2][1],$dens[2][1])==1) && ($nums[2][0]/$dens[2][0]>0.4) && ($nums[2][1]/$dens[2][1]<0.6) ); +$popups[2] = PopUp( + ['?', "$word1","$word1 and a half","$word2", "$word3"], + 3, # correct answer +); + + +do { + $dens[3][0] = random(5,20,1); + $nums[3][0] = random($dens[3][0]-3,$dens[3][0]-1,1); + do {$dens[3][1] = random(5,20,1);} until ($dens[3][1]!=$dens[3][0]); + $nums[3][1] = random($dens[3][1]-3,$dens[3][1]-1,1); +} until ( (gcd($nums[3][0],$dens[3][0])==1) && (gcd($nums[3][1],$dens[3][1])==1) && ($nums[3][0]/$dens[3][0]>0.85) && ($nums[3][1]/$dens[3][1]>0.85) ); +$popups[3] = PopUp( + ['?', "$word1","$word1 and a half","$word2", "$word3"], + 4, # correct answer +); + +#Create a hash and its inverse that randomizes the order of the three problems. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +############################################## + +BEGIN_PGML + +Estimate the sum of each expression, and choose an appropriate answer. + +a. [`[$shift1]\,\frac{[$nums[$scramble{0}][0]]}{[$dens[$scramble{0}][0]]}+[$shift2]\,\frac{[$nums[$scramble{0}][1]]}{[$dens[$scramble{0}][1]]}`] is close to [__]{$popups[$scramble{0}]} + +a. [`[$shift1]\,\frac{[$nums[$scramble{1}][0]]}{[$dens[$scramble{1}][0]]}+[$shift2]\,\frac{[$nums[$scramble{1}][1]]}{[$dens[$scramble{1}][1]]}`] is close to [__]{$popups[$scramble{1}]} + +a. [`[$shift1]\,\frac{[$nums[$scramble{2}][0]]}{[$dens[$scramble{2}][0]]}+[$shift2]\,\frac{[$nums[$scramble{2}][1]]}{[$dens[$scramble{2}][1]]}`] is close to [__]{$popups[$scramble{2}]} + +a. [`[$shift1]\,\frac{[$nums[$scramble{3}][0]]}{[$dens[$scramble{3}][0]]}+[$shift2]\,\frac{[$nums[$scramble{3}][1]]}{[$dens[$scramble{3}][1]]}`] is close to [__]{$popups[$scramble{3}]} + +END_PGML + +############################################## + +$text0 = ($nums[0][0]==1) ? "piece" : "pieces"; + +BEGIN_PGML_SOLUTION + +Here is how to estimate the value of a fraction: + +Fraction [`\frac{[$nums[0][0]]}{[$dens[0][0]]}`] implies: We cut the whole evenly into [`[$dens[0][0]]`] pieces, and then take only [`[$nums[0][0]]`] [$text0]. The value of [`[$shift1] \frac{[$nums[0][0]]}{[$dens[0][0]]}`] is very close to [`[$shift1]`]. + +Fraction [`\frac{[$nums[1][0]]}{[$dens[1][0]]}`] implies: We cut the whole evenly into [`[$dens[1][0]]`] pieces, and then take [`[$nums[1][0]]`] pieces. Since [`[$nums[1][0]]`] is a little less than half of [`[$dens[1][0]]`], the value of [`[$shift1] \frac{[$nums[1][0]]}{[$dens[1][0]]}`] is a little smaller than [`[$shift1] \frac{1}{2}`]. + +Fraction [`\frac{[$nums[2][1]]}{[$dens[2][1]]}`] implies: We cut the whole evenly into [`[$dens[2][1]]`] pieces, and then take [`[$nums[2][1]]`] pieces. Since [`[$nums[2][1]]`] is a little greater than half of [`[$dens[2][1]]`], the value of [`[$shift2] \frac{[$nums[2][1]]}{[$dens[2][1]]}`] is a little greater than [`[$shift2] \frac{1}{2}`]. + +Fraction [`\frac{[$nums[3][0]]}{[$dens[3][0]]}`] implies: We cut the whole evenly into [`[$dens[3][0]]`] pieces, and then take [`[$nums[3][0]]`] pieces. Since almost all pieces were taken, the the value of [`[$shift1] \frac{[$nums[3][0]]}{[$dens[3][0]]}`] is very close to [`[$shift1+1]`]. + +Here is how to solve each problem: + +For [`[$shift1] \frac{[$nums[0][0]]}{[$dens[0][0]]}+ [$shift2] \frac{[$nums[0][1]]}{[$dens[0][1]]}`], both numbers' fraction parts are very close to zero. As a result, the sum is very close to [`[$shift1+$shift2]`]. + +For [`[$shift1] \frac{[$nums[1][0]]}{[$dens[1][0]]}+ [$shift2] \frac{[$nums[1][1]]}{[$dens[1][1]]}`], the first fraction is close to [`[$shift1] \frac{1}{2}`], the second fraction is close to [`[$shift2]`]. As a result, the sum is very close to [`[$shift1+$shift2] \frac{1}{2}`]. + +For [`[$shift1] \frac{[$nums[2][0]]}{[$dens[2][0]]}+ [$shift2] \frac{[$nums[2][1]]}{[$dens[2][1]]}`], both numbers' fraction parts are close to half. As a result, the sum is very close to [`[$shift1+$shift2+1]`]. + +For [`[$shift1] \frac{[$nums[3][0]]}{[$dens[3][0]]}+ [$shift2] \frac{[$nums[3][1]]}{[$dens[3][1]]}`], both numbers' fraction parts are close to one. As a result, the sum is very close to [`[$shift1+$shift2+2]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation40.pg new file mode 100644 index 0000000000..90c2615db5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionAdditionEstimation40.pg @@ -0,0 +1,155 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the result of fraction additions. +# +# Last edited by Alex Jordan 6/5/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## +TEXT(beginproblem()); +$refreshCachedImages = 1; + +Context("Numeric"); + +$shift0 = random(2,5,1); +do {$shift1 = random(2,5,1);} until ($shift0!=$shift1); +$word1 = numberWord($shift1+$shift0); +$word2 = numberWord($shift1+$shift0+1); +$word3 = numberWord($shift1+$shift0+2); +@nums = ( ); +@dens = ( ); +@popups = ( ); + +do { + $dens[0][0] = random(5,20,1); + $nums[0][0] = ($dens[0][0]%2==0) ? $dens[0][0]/2-1 : int($dens[0][0]/2); + do {$dens[0][1] = random(5,20,1);} until ($dens[0][1]!=$dens[0][0]); + $nums[0][1] = ($dens[0][1]%2==0) ? $dens[0][1]/2-1 : int($dens[0][1]/2); +} until ( (gcd($nums[0][0],$dens[0][0])==1) && (gcd($nums[0][1],$dens[0][1])==1) && ($nums[0][0]/$dens[0][0]+$nums[0][1]/$dens[0][1]>0.85) ); +$popups[0] = PopUp( + ['?', "greater","less"], + 2, # correct answer +); + +do { + $dens[1][0] = random(5,20,1); + $nums[1][0] = int($dens[1][0]/2)+1; + do {$dens[1][1] = random(5,20,1);} until ($dens[1][1]!=$dens[1][0]); + $nums[1][1] = int($dens[1][1]/2)+1; +} until ( (gcd($nums[1][0],$dens[1][0])==1) && (gcd($nums[1][1],$dens[1][1])==1) && ($nums[1][0]/$dens[1][0]+$nums[1][1]/$dens[1][1]<1.15) ); +$popups[1] = PopUp( + ['?', "greater","less"], + 1, # correct answer +); + +do { + $dens[2][0] = random(5,20,1); + $nums[2][0] = int($dens[2][0]/2)+1; + do {$dens[2][1] = random(5,20,1);} until ($dens[2][1]!=$dens[2][0]); + $nums[2][1] = random(1,3,1); +} until ( (gcd($nums[2][0],$dens[2][0])==1) && (gcd($nums[2][1],$dens[2][1])==1) && ($nums[2][0]/$dens[2][0]<0.6) && ($nums[2][1]/$dens[2][1]<0.1) ); +$popups[2] = PopUp( + ['?', "greater","less"], + 2, # correct answer +); + + +do { + $dens[3][0] = random(5,20,1); + $nums[3][0] = random($dens[3][0]-3,$dens[3][0]-1,1); + do {$dens[3][1] = random(5,20,1);} until ($dens[3][1]!=$dens[3][0]); + $nums[3][1] = ($dens[3][1]%2==0) ? $dens[3][1]/2-1 : int($dens[3][1]/2); +} until ( (gcd($nums[3][0],$dens[3][0])==1) && (gcd($nums[3][1],$dens[3][1])==1) && ($nums[3][0]/$dens[3][0]>0.85) && ($nums[3][1]/$dens[3][1]>0.3) ); +$popups[3] = PopUp( + ['?', "greater","less"], + 1, # correct answer +); + +#Create a hash and its inverse that randomizes the order of the three problems. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +############################################## + +BEGIN_PGML + +Estimate the sum of each expression, and choose an appropriate answer. + +a. [`[$shift0]\,\frac{[$nums[$scramble{0}][0]]}{[$dens[$scramble{0}][0]]}+[$shift1]\,\frac{[$nums[$scramble{0}][1]]}{[$dens[$scramble{0}][1]]}`] is [__]{$popups[$scramble{0}]} than [$word2] + +a. [`[$shift0]\,\frac{[$nums[$scramble{1}][0]]}{[$dens[$scramble{1}][0]]}+[$shift1]\,\frac{[$nums[$scramble{1}][1]]}{[$dens[$scramble{1}][1]]}`] is [__]{$popups[$scramble{1}]} than [$word2] + +a. [`[$shift0]\,\frac{[$nums[$scramble{2}][0]]}{[$dens[$scramble{2}][0]]}+[$shift1]\,\frac{[$nums[$scramble{2}][1]]}{[$dens[$scramble{2}][1]]}`] is [__]{$popups[$scramble{2}]} than [$word2] + +a. [`[$shift0]\,\frac{[$nums[$scramble{3}][0]]}{[$dens[$scramble{3}][0]]}+[$shift1]\,\frac{[$nums[$scramble{3}][1]]}{[$dens[$scramble{3}][1]]}`] is [__]{$popups[$scramble{3}]} than [$word2] + +END_PGML + +############################################## + +$text0 = ($nums[2][1]==1) ? "piece" : "pieces"; + +BEGIN_PGML_SOLUTION + +Here is how to estimate the value of a fraction: + +Fraction [`\frac{[$nums[2][1]]}{[$dens[2][1]]}`] implies: We cut the whole evenly into [`[$dens[2][1]]`] pieces, and then take only [`[$nums[2][1]]`] [$text0]. The value of [`[$shift1] \frac{[$nums[2][1]]}{[$dens[2][1]]}`] is very close to [`[$shift1]`]. + +Fraction [`\frac{[$nums[0][0]]}{[$dens[0][0]]}`] implies: We cut the whole evenly into [`[$dens[0][0]]`] pieces, and then take [`[$nums[0][0]]`] pieces. Since [`[$nums[0][0]]`] is a little bit less than half of [`[$dens[0][0]]`], the value of [`[$shift0] \frac{[$nums[0][0]]}{[$dens[0][0]]}`] is a little bit less than [`[$shift0] \frac{1}{2}`]. + +Fraction [`\frac{[$nums[1][0]]}{[$dens[1][0]]}`] implies: We cut the whole evenly into [`[$dens[1][0]]`] pieces, and then take [`[$nums[1][0]]`] pieces. Since [`[$nums[1][0]]`] is a little bit greater than half of [`[$dens[1][0]]`], the value of [`[$shift0] \frac{[$nums[1][0]]}{[$dens[1][0]]}`] is a little bit greater than [`[$shift0] \frac{1}{2}`]. + +Fraction [`\frac{[$nums[3][0]]}{[$dens[3][0]]}`] implies: We cut the whole evenly into [`[$dens[3][0]]`] pieces, and then take [`[$nums[3][0]]`] pieces. Since almost all pieces were taken, the value of [`[$shift0] \frac{[$nums[3][0]]}{[$dens[3][0]]}`] is very close to [`[$shift0+1]`]. + +Here is how to solve each problem: + +For [`[$shift0] \frac{[$nums[0][0]]}{[$dens[0][0]]}+ [$shift1] \frac{[$nums[0][1]]}{[$dens[0][1]]}`], both numbers' fraction parts are less than half. As a result, the sum is less than [`[$shift1+$shift0+1]`]. + +For [`[$shift0] \frac{[$nums[1][0]]}{[$dens[1][0]]}+ [$shift1] \frac{[$nums[1][1]]}{[$dens[1][1]]}`], both numbers' fraction parts are greater than half. As a result, the sum is greater than [`[$shift1+$shift0+1]`]. + +For [`[$shift0] \frac{[$nums[2][0]]}{[$dens[2][0]]}+ [$shift1] \frac{[$nums[2][1]]}{[$dens[2][1]]}`], the first number's fraction part is a little greater than half, and the second number's fraction part is close to zero. As a result, their sum is less than [`[$shift1+$shift0+1]`]. + +For [`[$shift0] \frac{[$nums[3][0]]}{[$dens[3][0]]}+ [$shift1] \frac{[$nums[3][1]]}{[$dens[3][1]]}`], the first number's fraction part is close to one, and the second number's fraction part is close to half. As a result, their sum is greater than [`[$shift1+$shift0+1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionBarEstimation10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionBarEstimation10.pg new file mode 100644 index 0000000000..9d515d6b39 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionBarEstimation10.pg @@ -0,0 +1,193 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate what fraction of a bar is shaded. +# +# Last edited by Carl Yao 10/14/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## +TEXT(beginproblem()); +$refreshCachedImages = 1; + +Context("Numeric"); + +@nums = ( ); +@dens = ( ); + +do { + $dens[0] = random(5,16,1); + $nums[0] = random(1,3,1); +} until ( (gcd($nums[0],$dens[0])==1) && ($nums[0]/$dens[0]<0.15) ); + +do { + $dens[1] = random(5,16,1); + $nums[1] = int($dens[1]/2)-1; +} until ( (gcd($nums[1],$dens[1])==1) && ($nums[1]/$dens[1]>0.4) ); + +do { + $dens[2] = random(5,16,1); + $nums[2] = int($dens[2]/2)+1; +} until ( (gcd($nums[2],$dens[2])==1) && ($nums[2]/$dens[2]<0.6) ); + +do { + $dens[3] = random(5,16,1); + $nums[3] = random($dens[3]-3,$dens[3]-1,1); +} until ( (gcd($nums[3],$dens[3])==1) && ($nums[3]/$dens[3]>0.85) ); + +@radios = ( ); +$radios[0] = RadioButtons( + ["A","B","C","D"], + "A", # correct answer + order => ["A","B","C","D"], +); + +$radios[1] = RadioButtons( + ["A","B","C","D"], + "B", # correct answer + order => ["A","B","C","D"], +); + +$radios[2] = RadioButtons( + ["A","B","C","D"], + "C", # correct answer + order => ["A","B","C","D"], +); + +$radios[3] = RadioButtons( + ["A","B","C","D"], + "D", # correct answer + order => ["A","B","C","D"], +); + +@gr = ( ); +for my $i (0..3) { + $gr[$i] = init_graph(0,-1,10,1, + size=>[400,50] + ); + $gr[$i]->moveTo(0,-1); + $gr[$i]->lineTo(10*$nums[$i]/$dens[$i],-1,'black'); + $gr[$i]->lineTo(10*$nums[$i]/$dens[$i],1,'black'); + $gr[$i]->lineTo(0,1,'black'); + $gr[$i]->lineTo(0,0,'black'); + $gr[$i]->fillRegion([0.1,0.1,'black']); +} + +$alt0 = "The graph is a partially filled bar. The filled region is a very small portion of the bar."; +$alt1 = "The graph is a partially filled bar. The filled region is close to half of the bar, but a little smaller than half."; +$alt2 = "The graph is a partially filled bar. The filled region is close to half of the bar, but a little bigger than half."; +$alt3 = "The graph is a partially filled bar. The filled region is almost the whole bar."; + +#Create a hash and its inverse that randomizes the order of the three problems. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +############################################## + +BEGIN_PGML + +Match each fraction with the graph representing it. (Shaded regions represent fractions.) + +A: [@image( insertGraph($gr[0]), width=>400, + height=>50, tex_size=>800, extra_html_tags => "alt = '$alt0' title = '$alt0'")@]* + +B: [@image( insertGraph($gr[1]), width=>400, + height=>50, tex_size=>800, extra_html_tags => "alt = '$alt1' title = '$alt1'")@]* + +C: [@image( insertGraph($gr[2]), width=>400, + height=>50, tex_size=>800, extra_html_tags => "alt = '$alt2' title = '$alt2'")@]* + +D: [@image( insertGraph($gr[3]), width=>400, + height=>50, tex_size=>800, extra_html_tags => "alt = '$alt3' title = '$alt3'")@]* + +[@DataTable( + [ + [[PF('Fraction'), + rowcss => 'border-bottom: 2px solid; ',], + [PF('Which Graph?'),], + ], + [[PF('[`\frac{[$nums[$scramble{0}]]}{[$dens[$scramble{0}]]}`]'), + rowcss => 'border-bottom: 2px solid;'], + [PF('[___]{$radios[$scramble{0}]}'),], + ], + [[PF('[`\frac{[$nums[$scramble{1}]]}{[$dens[$scramble{1}]]}`]'), + rowcss => 'border-bottom: 2px solid;'], + [PF('[___]{$radios[$scramble{1}]}'),], + ], + [[PF('[`\frac{[$nums[$scramble{2}]]}{[$dens[$scramble{2}]]}`]'), + rowcss => 'border-bottom: 2px solid;'], + [PF('[___]{$radios[$scramble{2}]}'),], + ], + [[PF('[`\frac{[$nums[$scramble{3}]]}{[$dens[$scramble{3}]]}`]'),], + [PF('[___]{$radios[$scramble{3}]}'),], + ], + ], + align => 'c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +END_PGML + +############################################## + +$text0 = ($nums[0]==1) ? "piece" : "pieces"; +$text1 = ($nums[1]==1) ? "piece" : "pieces"; +$text2 = ($nums[2]==1) ? "piece" : "pieces"; +$text3 = ($nums[3]==1) ? "piece" : "pieces"; + +$half1 = $dens[1]/2; +$half2 = $dens[2]/2; + +BEGIN_PGML_SOLUTION + +Fraction [`\frac{[$nums[0]]}{[$dens[0]]}`] implies: We evenly cut the bar into [`[$dens[0]]`] pieces, and then shade [`[$nums[0]]`] [$text0]. The shaded region should be a very small part of the bar, and thus Graph A represents [`\frac{[$nums[0]]}{[$dens[0]]}`]. + +Fraction [`\frac{[$nums[1]]}{[$dens[1]]}`] implies: We evenly cut the bar into [`[$dens[1]]`] pieces, and then shade [`[$nums[1]]`] [$text1]. Note that half of [`[$dens[1]]`] is [`[$half1]`], and [`[$nums[1]]`] is a little bit smaller than [`[$half1]`]. The shaded region should be a little bit smaller than half, and thus Graph B represents [`\frac{[$nums[1]]}{[$dens[1]]}`]. + +Fraction [`\frac{[$nums[2]]}{[$dens[2]]}`] implies: We evenly cut the bar into [`[$dens[2]]`] pieces, and then shade [`[$nums[2]]`] [$text2]. Note that half of [`[$dens[2]]`] is [`[$half2]`], and [`[$nums[2]]`] is a little bit bigger than [`[$half2]`]. The shaded region should be a little bit bigger than half, and thus Graph C represents [`\frac{[$nums[2]]}{[$dens[2]]}`]. + +Fraction [`\frac{[$nums[3]]}{[$dens[3]]}`] implies: We evenly cut the bar into [`[$dens[3]]`] pieces, and then shade [`[$nums[3]]`] [$text3]. The shaded region should be a very big part of the bar, and thus Graph D represents [`\frac{[$nums[3]]}{[$dens[3]]}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionMultiplicationEstimation10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionMultiplicationEstimation10.pg new file mode 100644 index 0000000000..7b95393641 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionMultiplicationEstimation10.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the result of 1/3*280 +# +# Last edited: Carl Yao 10/13/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('fraction','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +Context()->{format}{number} = "%u"; + +$a = random(3,9,1); +$b = random(5,9,1); + +$a1Exp = random(2,4,1); +$a1Ten = 10**$a1Exp; +$a1 = $a*$a1Ten*$b; +$a1Close = $a1+10**($a1Exp-1)*non_zero_random(-2,2,1)+10**($a1Exp-2)*non_zero_random(-2,2,1); + +$ans1 = $a1/$b; + +$c = random(3,9,1); +$d = random(5,9,1); + +$a2Exp = random(2,4,1); +$a2Ten = 10**$a2Exp; +$b2Exp = random(1,2,1); +$b2Ten = 10**$b2Exp; + +$a2 = $c*$a2Ten*$d*$b2Ten; +$a2Close = $a2+10**($a2Exp+$b2Exp-1)*non_zero_random(-2,2,1)+10**($a2Exp+$b2Exp-2)*non_zero_random(-2,2,1); + +$b2 = $d*$b2Ten; +if ($b2Exp==2) { + $b2Close = $b2+10**($b2Exp-1)*non_zero_random(-2,2,1)+10**($b2Exp-2)*non_zero_random(-2,2,1);} +else { + $b2Close = $b2+10**($b2Exp-1)*non_zero_random(-2,2,1); +} + +$ans2 = $a2/$b2; + +##################################################### + +BEGIN_PGML + +Without using a calculator, round numbers until the calculation is easy, and then estimate the quotient. + +a. [`` [$a1Close] \cdot \frac{1}{[$b]} \approx``] [_______]{$ans1} + +a. [`` [$a2Close] \cdot \frac{1}{[$b2Close]} \approx``] [_______]{$ans2} + +END_PGML + +############################################################ + +$s1 = $a2/$b2Ten; +$s2 = int($a1Close/10**$a1Exp); +$s3 = $a*$b; + +$s4 = int($a2Close/10**($a2Exp+$b2Exp)); +$s5 = $c*$d; + +BEGIN_PGML_SOLUTION + +*Part a:* We will look at the first two digit of [`[$a1Close]`], which is [`[$s2]`]. We will find a multiple of [`[$b]`] which is close to [`[$s2]`], and that number is [`[$s3]`]. This is why we will round [`[$a1Close]`] to [`[$a1]`]. + + [`` +\begin{aligned} + [$a1Close] \cdot \frac{1}{[$b]} &\approx [$a1] \cdot \frac{1}{[$b]} \\ + &= [$a1] \div [$b] \\ + &= [$ans1] +\end{aligned} + ``] + +*Part b:* We will first round [`[$b2Close]`] to [`[$b2]`]. Ignore trailing zeroes, we will simply look at the number [`[$d]`]. + +We look at the first two digit of [`[$a2Close]`], which is [`[$s4]`]. We will find a multiple of [`[$d]`] which is close to [`[$s4]`], and that number is [`[$s5]`]. This is why we will round [`[$a2Close]`] to [`[$a2]`]. + + [`` +\begin{aligned} + [$a2Close] \cdot \frac{1}{[$b2Close]} &\approx [$a2] \cdot \frac{1}{[$b2]} \\ + &= \frac{[$a2]}{[$b2]} \\ + &= \frac{[$s1]}{[$d]} \\ + &= [$s1] \div [$d] \\ + &= [$ans2] +\end{aligned} + ``] + + + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine10.pg index 9ffc49be06..eed67fa13a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.NF') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('number line','fraction') +## DBCCSS('3.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') @@ -26,12 +29,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -52,15 +55,15 @@ $xmax = $den+3; $gr = init_graph($xmin,-1,$xmax,1, axes=>[$xmin-10,0], #grid=>[5,5], -size=>[400,50] +size=>[240,34] ); @ticks = (); for my $j (($xmin)..($xmax)) {push(@ticks,$j);}; $gr->h_ticks(0,"black",@ticks); -$gr->lb( new Label(0,-0.5,0,'black','center','middle')); -$gr->lb( new Label($den,-0.5,1,'black','center','middle')); +$gr->lb( new Label(0,-0.5,0,'black','center','middle','large')); +$gr->lb( new Label($den,-0.5,1,'black','center','middle','large')); $gr->stamps( closed_circle($num,0,'blue') ); ############################################## @@ -74,12 +77,11 @@ $alt = "The graph has a number line. The segment between 0 and 1 is cut into $de BEGIN_PGML ->>[@image( insertGraph($gr), width=>400, - height=>50, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< - The dot in the graph can be represented by what fraction? -Answer: [_________]{$frac} +>>[@image( insertGraph($gr), width=>240, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< + +[_________]{$frac} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine20.pg index ffd531b9c0..06f5475cd5 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine20.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.NF') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('number line','fraction') +## DBCCSS('3.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') @@ -26,12 +29,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -52,15 +55,15 @@ $xmax = 3; $gr = init_graph($xmin,-1,$xmax,1, axes=>[$xmax+10,0], #grid=>[5,5], -size=>[400,50] +size=>[240,34] ); @ticks = (); for my $j (($xmin)..($xmax)) {push(@ticks,$j);}; $gr->h_ticks(0,"black",@ticks); -$gr->lb( new Label(0,-0.5,0,'black','center','middle')); -$gr->lb( new Label(-$den,-0.5,-1,'black','center','middle')); +$gr->lb( new Label(0,-0.5,0,'black','center','middle','large')); +$gr->lb( new Label(-$den,-0.5,-1,'black','center','middle','large')); $gr->stamps( closed_circle(-$num,0,'blue') ); ############################################## @@ -74,12 +77,11 @@ $alt = "The graph has a number line. The segment between -1 and 0 is cut into $d BEGIN_PGML ->>[@image( insertGraph($gr), width=>400, - height=>50, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< - The dot in the graph can be represented by what fraction? -Answer: [_________]{$frac} +>>[@image( insertGraph($gr), width=>240, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< + +[_________]{$frac} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine30.pg index 154ef985d7..a99539084c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine30.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('number line','fraction','mixed number') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') @@ -27,12 +30,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -54,15 +57,15 @@ $xmax = $den+3; $gr = init_graph($xmin,-1,$xmax,1, axes=>[$xmin-10,0], #grid=>[5,5], -size=>[400,50] +size=>[240,34] ); @ticks = (); for my $j (($xmin)..($xmax)) {push(@ticks,$j);}; $gr->h_ticks(0,"black",@ticks); -$gr->lb( new Label(0,-0.5,$int,'black','center','middle')); -$gr->lb( new Label($den,-0.5,$int+1,'black','center','middle')); +$gr->lb( new Label(0,-0.5,$int,'black','center','middle','large')); +$gr->lb( new Label($den,-0.5,$int+1,'black','center','middle','large')); $gr->stamps( closed_circle($num,0,'blue') ); ############################################## @@ -78,12 +81,11 @@ $alt = "The graph has a number line. The segment between $int and $intNext is cu BEGIN_PGML ->>[@image( insertGraph($gr), width=>400, - height=>50, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< - The dot in the graph can be represented by what fraction? -Answer: [_________]{$frac} +>>[@image( insertGraph($gr), width=>240, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< + +[_________]{$frac} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine40.pg index b31bf61184..3f6cc17976 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionOnNumberLine40.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('number line','fraction') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') @@ -27,12 +30,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -54,15 +57,15 @@ $xmax = 3; $gr = init_graph($xmin,-1,$xmax,1, axes=>[$xmax+10,0], #grid=>[5,5], -size=>[400,50] +size=>[240,34] ); @ticks = (); for my $j (($xmin)..($xmax)) {push(@ticks,$j);}; $gr->h_ticks(0,"black",@ticks); -$gr->lb( new Label(0,-0.5,$int,'black','center','middle')); -$gr->lb( new Label(-$den,-0.5,$int-1,'black','center','middle')); +$gr->lb( new Label(0,-0.5,$int,'black','center','middle','large')); +$gr->lb( new Label(-$den,-0.5,$int-1,'black','center','middle','large')); $gr->stamps( closed_circle(-$num,0,'blue') ); ############################################## @@ -78,12 +81,11 @@ $alt = "The graph has a number line. The segment between $intNext and $int is cu BEGIN_PGML ->>[@image( insertGraph($gr), width=>400, - height=>50, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< - The dot in the graph can be represented by what fraction? -Answer: [_________]{$frac} +>>[@image( insertGraph($gr), width=>240, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< + +[_________]{$frac} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionSubtractionEstimation10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionSubtractionEstimation10.pg new file mode 100644 index 0000000000..8a06c8a46b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionSubtractionEstimation10.pg @@ -0,0 +1,158 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the result of fraction subtractions. +# +# Last edited by Alex Jordan 6/5/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## +TEXT(beginproblem()); +$refreshCachedImages = 1; + +Context("Numeric"); + +@nums = ( ); +@dens = ( ); +@popups = ( ); + +do { + do { + $dens[0][0] = random(5,20,1); + $nums[0][0] = random(1,3,1); + } until ($nums[0][0]/$dens[0][0]<0.1); + do { + do {$dens[0][1] = random(5,20,1);} until ($dens[0][1]!=$dens[0][0]); + $nums[0][1] = random(1,3,1); + } until ($nums[0][1]/$dens[0][1]<0.1); +} until ( (gcd($nums[0][0],$dens[0][0])==1) && (gcd($nums[0][1],$dens[0][1])==1) && ($nums[0][0]/$dens[0][0]-$nums[0][1]/$dens[0][1]<0.1) && ($nums[0][0]/$dens[0][0]-$nums[0][1]/$dens[0][1]>-0.1)); +$popups[0] = PopUp( + ['?', "zero","half","one"], + 1, # correct answer +); + +do { + $dens[1][0] = random(5,20,1); + $nums[1][0] = int($dens[1][0]/2)+1; + do { + do {$dens[1][1] = random(5,20,1);} until ($dens[1][1]!=$dens[1][0]); + $nums[1][1] = random(1,3,1); + } until ($nums[1][1]/$dens[1][1]<0.1); +} until ( (gcd($nums[1][0],$dens[1][0])==1) && (gcd($nums[1][1],$dens[1][1])==1) && ($nums[1][0]/$dens[1][0]-$nums[1][1]/$dens[1][1])>0.4 ); +$popups[1] = PopUp( + ['?', "zero","half","one"], + 2, # correct answer +); + +do { + $dens[2][0] = random(5,20,1); + $nums[2][0] = int($dens[2][0]/2)+1; + do {$dens[2][1] = random(5,20,1);} until ($dens[2][1]!=$dens[2][0]); + $nums[2][1] = ($dens[2][1]%2==0) ? $dens[2][1]/2-1 : int($dens[2][1]/2); +} until ( (gcd($nums[2][0],$dens[2][0])==1) && (gcd($nums[2][1],$dens[2][1])==1) && ($nums[2][0]/$dens[2][0]-$nums[2][1]/$dens[2][1]<0.1) ); +$popups[2] = PopUp( + ['?', "zero","half","one"], + 1, # correct answer +); + + +do { + do { + $dens[3][0] = random(5,20,1); + $nums[3][0] = random($dens[3][0]-3,$dens[3][0]-1,1); + } until ($nums[3][0]/$dens[3][0]>0.9); + do { + do {$dens[3][1] = random(5,20,1);} until ($dens[3][1]!=$dens[3][0]); + $nums[3][1] = random(1,3,1); + } until ($nums[3][1]/$dens[3][1]<0.1); +} until ( (gcd($nums[3][0],$dens[3][0])==1) && (gcd($nums[3][1],$dens[3][1])==1) && ($nums[3][0]/$dens[3][0]-$nums[3][1]/$dens[3][1]>0.85) ); +$popups[3] = PopUp( + ['?', "zero","half","one"], + 3, # correct answer +); + +#Create a hash and its inverse that randomizes the order of the three problems. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +############################################## + +BEGIN_PGML + +Estimate the difference of each expression, and choose an appropriate answer. + +a. [`\frac{[$nums[$scramble{0}][0]]}{[$dens[$scramble{0}][0]]}-\frac{[$nums[$scramble{0}][1]]}{[$dens[$scramble{0}][1]]}`] is close to [__]{$popups[$scramble{0}]} + +a. [`\frac{[$nums[$scramble{1}][0]]}{[$dens[$scramble{1}][0]]}-\frac{[$nums[$scramble{1}][1]]}{[$dens[$scramble{1}][1]]}`] is close to [__]{$popups[$scramble{1}]} + +a. [`\frac{[$nums[$scramble{2}][0]]}{[$dens[$scramble{2}][0]]}-\frac{[$nums[$scramble{2}][1]]}{[$dens[$scramble{2}][1]]}`] is close to [__]{$popups[$scramble{2}]} + +a. [`\frac{[$nums[$scramble{3}][0]]}{[$dens[$scramble{3}][0]]}-\frac{[$nums[$scramble{3}][1]]}{[$dens[$scramble{3}][1]]}`] is close to [__]{$popups[$scramble{3}]} + +END_PGML + +############################################## + +$text0 = ($nums[0][0]==1) ? "piece" : "pieces"; + +BEGIN_PGML_SOLUTION + +Here is how to estimate the value of a fraction: + +Fraction [`\frac{[$nums[0][0]]}{[$dens[0][0]]}`] implies: We cut the whole evenly into [`[$dens[0][0]]`] pieces, and then take only [`[$nums[0][0]]`] [$text0]. This fraction's value is very close to zero. + +Fraction [`\frac{[$nums[2][1]]}{[$dens[2][1]]}`] implies: We cut the whole evenly into [`[$dens[2][1]]`] pieces, and then take [`[$nums[2][1]]`] pieces. Since [`[$nums[2][1]]`] is a little less than half of [`[$dens[2][1]]`], this fraction's value is a little less than half. + +Fraction [`\frac{[$nums[2][0]]}{[$dens[2][0]]}`] implies: We cut the whole evenly into [`[$dens[2][0]]`] pieces, and then take [`[$nums[2][0]]`] pieces. Since [`[$nums[2][0]]`] is a little greater than half of [`[$dens[2][0]]`], this fraction's value is a little greater than half. + +Fraction [`\frac{[$nums[3][0]]}{[$dens[3][0]]}`] implies: We cut the whole evenly into [`[$dens[3][0]]`] pieces, and then take [`[$nums[3][0]]`] pieces. Since almost all pieces were taken, this fraction's value is very close to one. + +Here is how to solve each problem: + +For [`\frac{[$nums[0][0]]}{[$dens[0][0]]}-\frac{[$nums[0][1]]}{[$dens[0][1]]}`], both fractions are very close to zero. As a result, the difference is also very close to zero. + +For [`\frac{[$nums[1][0]]}{[$dens[1][0]]}-\frac{[$nums[1][1]]}{[$dens[1][1]]}`], the first fraction is close to half, the second fraction is close to zero. As a result, the difference is very close to half. + +For [`\frac{[$nums[2][0]]}{[$dens[2][0]]}-\frac{[$nums[2][1]]}{[$dens[2][1]]}`], both fractions are close to half. As a result, the difference is very close to zero. + +For [`\frac{[$nums[3][0]]}{[$dens[3][0]]}-\frac{[$nums[3][1]]}{[$dens[3][1]]}`], the first fraction is close to one, the second fraction is close to zero. As a result, the difference is close to one. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionSubtractionEstimation20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionSubtractionEstimation20.pg new file mode 100644 index 0000000000..1e115e4508 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionSubtractionEstimation20.pg @@ -0,0 +1,156 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the result of fraction subtractions. +# +# Last edited by Alex Jordan 6/5/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +$refreshCachedImages = 1; + +Context("Numeric"); + +@nums = ( ); +@dens = ( ); +@popups = ( ); + +do { + do { + $dens[0][0] = random(5,20,1); + $nums[0][0] = random($dens[0][0]-3,$dens[0][0]-1,1); + } until ($nums[0][0]/$dens[0][0]>0.9); + do { + do {$dens[0][1] = random(5,20,1);} until ($dens[0][1]!=$dens[0][0]); + $nums[0][1] = random(1,3,1); + } until ($nums[0][1]/$dens[0][1]<0.1); +} until ( (gcd($nums[0][0],$dens[0][0])==1) && (gcd($nums[0][1],$dens[0][1])==1) ); +$popups[0] = PopUp( + ['?', "greater","smaller"], + 1, # correct answer +); + +do { + do { + $dens[1][0] = random(5,20,1); + $nums[1][0] = random($dens[1][0]-3,$dens[1][0]-1,1); + } until ($nums[1][0]/$dens[1][0]>0.9); + do {$dens[1][1] = random(5,20,1);} until ($dens[1][1]!=$dens[1][0]); + $nums[1][1] = int($dens[1][1]/2)+1; +} until ( (gcd($nums[1][0],$dens[1][0])==1) && (gcd($nums[1][1],$dens[1][1])==1) ); +$popups[1] = PopUp( + ['?', "greater","smaller"], + 2, # correct answer +); + +do { + $dens[2][0] = random(5,20,1); + $nums[2][0] = int($dens[2][0]/2)+1; + do {$dens[2][1] = random(5,20,1);} until ($dens[2][1]!=$dens[2][0]); + $nums[2][1] = ($dens[2][1]%2==0) ? $dens[2][1]/2-1 : int($dens[2][1]/2); +} until ( (gcd($nums[2][0],$dens[2][0])==1) && (gcd($nums[2][1],$dens[2][1])==1) ); +$popups[2] = PopUp( + ['?', "greater","smaller"], + 2, # correct answer +); + +do { + do { + $dens[3][0] = random(5,20,1); + $nums[3][0] = random($dens[3][0]-3,$dens[3][0]-1,1); + } until ($nums[3][0]/$dens[3][0]>0.9); + do { + do {$dens[3][1] = random(5,20,1);} until ($dens[3][1]!=$den[3][0]); + $nums[3][1] = random($dens[3][1]-3,$dens[3][1]-1,1); + } until ($nums[3][0]/$dens[3][0]>0.9); +} until ( (gcd($nums[3][0],$dens[3][0])==1) && (gcd($nums[3][1],$dens[3][1])==1) && ($nums[3][1],$dens[3][1]-$nums[3][0],$dens[3][0]>0) ); +$popups[3] = PopUp( + ['?', "greater","smaller"], + 2, # correct answer +); + +#Create a hash and its inverse that randomizes the order of the three problems. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +############################################## + +BEGIN_PGML + +Estimate the difference of each expression, and choose an appropriate answer. + +a. [`\frac{[$nums[$scramble{0}][0]]}{[$dens[$scramble{0}][0]]}-\frac{[$nums[$scramble{0}][1]]}{[$dens[$scramble{0}][1]]}`] is [__]{$popups[$scramble{0}]} than half + +a. [`\frac{[$nums[$scramble{1}][0]]}{[$dens[$scramble{1}][0]]}-\frac{[$nums[$scramble{1}][1]]}{[$dens[$scramble{1}][1]]}`] is [__]{$popups[$scramble{1}]} than half + +a. [`\frac{[$nums[$scramble{2}][0]]}{[$dens[$scramble{2}][0]]}-\frac{[$nums[$scramble{2}][1]]}{[$dens[$scramble{2}][1]]}`] is [__]{$popups[$scramble{2}]} than half + +a. [`\frac{[$nums[$scramble{3}][0]]}{[$dens[$scramble{3}][0]]}-\frac{[$nums[$scramble{3}][1]]}{[$dens[$scramble{3}][1]]}`] is [__]{$popups[$scramble{3}]} than half + +END_PGML + +############################################## + +$text0 = ($nums[0][1]==1) ? "piece" : "pieces"; + +BEGIN_PGML_SOLUTION + +Here is how to estimate the value of a fraction: + +Fraction [`\frac{[$nums[0][1]]}{[$dens[0][1]]}`] implies: We cut the whole evenly into [`[$dens[0][1]]`] pieces, and then take only [`[$nums[0][1]]`] [$text0]. This fraction's value is very close to zero. + +Fraction [`\frac{[$nums[2][1]]}{[$dens[2][1]]}`] implies: We cut the whole evenly into [`[$dens[2][1]]`] pieces, and then take [`[$nums[2][1]]`] pieces. Since [`[$nums[2][1]]`] is a little less than half of [`[$dens[2][1]]`], this fraction's value is a little less than half. + +Fraction [`\frac{[$nums[1][1]]}{[$dens[1][1]]}`] implies: We cut the whole evenly into [`[$dens[1][1]]`] pieces, and then take [`[$nums[1][1]]`] pieces. Since [`[$nums[1][1]]`] is a little greater than half of [`[$dens[1][1]]`], this fraction's value is a little greater than half. + +Fraction [`\frac{[$nums[3][0]]}{[$dens[3][0]]}`] implies: We cut the whole evenly into [`[$dens[3][0]]`] pieces, and then take [`[$nums[3][0]]`] pieces. Since almost all pieces were taken, this fraction's value is very close to one. + +Here is how to solve each problem: + +For [`\frac{[$nums[0][0]]}{[$dens[0][0]]}-\frac{[$nums[0][1]]}{[$dens[0][1]]}`], the first fraction is close to [`1`], and the second fraction is close to [`0`]. As a result, the difference is greater than half. + +For [`\frac{[$nums[1][0]]}{[$dens[1][0]]}-\frac{[$nums[1][1]]}{[$dens[1][1]]}`], the first fraction is close to one, the second fraction is greater than half. As a result, the difference is smaller than half. + +For [`\frac{[$nums[2][0]]}{[$dens[2][0]]}-\frac{[$nums[2][1]]}{[$dens[2][1]]}`], both fractions are close to half. As a result, the difference is smaller than half. + +For [`\frac{[$nums[3][0]]}{[$dens[3][0]]}-\frac{[$nums[3][1]]}{[$dens[3][1]]}`], both fractions are close to [`1`]. As a result, the difference is smaller than half. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionSubtractionEstimation30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionSubtractionEstimation30.pg new file mode 100644 index 0000000000..930c3c3974 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/FractionSubtractionEstimation30.pg @@ -0,0 +1,161 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the result of fraction subtraction. +# +# Last edited by Alex Jordan 6/5/2017 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +$refreshCachedImages = 1; + +Context("Numeric"); + +$shift0 = random(6,9,1); +$shift1 = random(1,3,1); +$word0 = numberWord($shift0-$shift1-1); +$word1 = numberWord($shift0-$shift1); +$word2 = numberWord($shift0-$shift1+1); +@nums = ( ); +@dens = ( ); +@popups = ( ); + +do { + do { + $dens[0][0] = random(5,20,1); + $nums[0][0] = random($dens[0][0]-3,$dens[0][0]-1,1); + } until ($nums[0][0]/$dens[0][0]>0.9); + do { + do {$dens[0][1] = random(5,20,1);} until ($dens[0][1]!=$dens[0][0]); + $nums[0][1] = random(1,3,1); + } until ($nums[0][1]/$dens[0][1]<0.1); +} until ( (gcd($nums[0][0],$dens[0][0])==1) && (gcd($nums[0][1],$dens[0][1])==1) && ($nums[0][0]/$dens[0][0]-$nums[0][1]/$dens[0][1]>0.85) ); +$popups[0] = PopUp( + ['?', "$word2","$word1 and a half","$word1", "$word0 and a half"], + 1, # correct answer +); + +do { + do { + $dens[1][0] = random(5,20,1); + $nums[1][0] = random($dens[1][0]-3,$dens[1][0]-1,1); + } until ($nums[1][0]/$dens[1][0]>0.9); + do {$dens[1][1] = random(5,20,1);} until ($dens[1][1]!=$dens[1][0]); + $nums[1][1] = ($dens[1][1]%2==0) ? $dens[1][1]/2-1 : int($dens[1][1]/2); +} until ( (gcd($nums[1][0],$dens[1][0])==1) && (gcd($nums[1][1],$dens[1][1])==1) ); +$popups[1] = PopUp( + ['?', "$word2","$word1 and a half","$word1", "$word0 and a half"], + 2, # correct answer +); + +do { + do { + $dens[2][0] = random(5,20,1); + $nums[2][0] = random(1,3,1); + } until ($nums[2][0]/$dens[2][0]<0.1); + do { + do {$dens[2][1] = random(5,20,1);} until ($dens[2][1]!=$den[2][0]); + $nums[2][1] = random($dens[2][1]-3,$dens[2][1]-1,1); + } until ($nums[2][1]/$dens[2][1]>0.9); +} until ( (gcd($nums[2][0],$dens[2][0])==1) && (gcd($nums[2][1],$dens[2][1])==1) ); +$popups[2] = PopUp( + ['?', "$word2","$word1 and a half","$word1", "$word0"], + 4, # correct answer +); + + +do { + $dens[3][0] = random(5,20,1); + $nums[3][0] = ($dens[3][0]%2==0) ? $dens[3][0]/2-1 : int($dens[3][0]/2); + do {$dens[3][1] = random(5,20,1);} until ($dens[3][1]!=$dens[3][0]); + $nums[3][1] = int($dens[3][1]/2)+1; +} until ( (gcd($nums[3][0],$dens[3][0])==1) && (gcd($nums[3][1],$dens[3][1])==1) ); +$popups[3] = PopUp( + ['?', "$word2","$word1 and a half","$word1", "$word0 and a half"], + 3, # correct answer +); + +#Create a hash and its inverse that randomizes the order of the three problems. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +############################################## + +BEGIN_PGML + +Estimate the sum of each expression, and choose an appropriate answer. + +a. [`[$shift0]\,\frac{[$nums[$scramble{0}][0]]}{[$dens[$scramble{0}][0]]}-[$shift1]\,\frac{[$nums[$scramble{0}][1]]}{[$dens[$scramble{0}][1]]}`] is close to [__]{$popups[$scramble{0}]} + +a. [`[$shift0]\,\frac{[$nums[$scramble{1}][0]]}{[$dens[$scramble{1}][0]]}-[$shift1]\,\frac{[$nums[$scramble{1}][1]]}{[$dens[$scramble{1}][1]]}`] is close to [__]{$popups[$scramble{1}]} + +a. [`[$shift0]\,\frac{[$nums[$scramble{2}][0]]}{[$dens[$scramble{2}][0]]}-[$shift1]\,\frac{[$nums[$scramble{2}][1]]}{[$dens[$scramble{2}][1]]}`] is close to [__]{$popups[$scramble{2}]} + +a. [`[$shift0]\,\frac{[$nums[$scramble{3}][0]]}{[$dens[$scramble{3}][0]]}-[$shift1]\,\frac{[$nums[$scramble{3}][1]]}{[$dens[$scramble{3}][1]]}`] is close to [__]{$popups[$scramble{3}]} + +END_PGML + +############################################## + +$text0 = ($nums[0][0]==1) ? "piece" : "pieces"; + +BEGIN_PGML_SOLUTION + +Here is how to estimate the value of a fraction: + +Fraction [`\frac{[$nums[0][1]]}{[$dens[0][1]]}`] implies: We cut the whole evenly into [`[$dens[0][1]]`] pieces, and then take only [`[$nums[0][1]]`] [$text0]. The value of [`[$shift1] \frac{[$nums[0][1]]}{[$dens[0][1]]}`] is very close to [`[$shift1]`]. + +Fraction [`\frac{[$nums[3][0]]}{[$dens[3][0]]}`] implies: We cut the whole evenly into [`[$dens[3][0]]`] pieces, and then take [`[$nums[3][0]]`] pieces. Since [`[$nums[3][0]]`] is a little less than half of [`[$dens[3][0]]`], the value of [`[$shift0] \frac{[$nums[3][0]]}{[$dens[3][0]]}`] is a little smaller than [`[$shift0] \frac{1}{2}`]. + +Fraction [`\frac{[$nums[3][1]]}{[$dens[3][1]]}`] implies: We cut the whole evenly into [`[$dens[3][1]]`] pieces, and then take [`[$nums[3][1]]`] pieces. Since [`[$nums[3][1]]`] is a little greater than half of [`[$dens[3][1]]`], the value of [`[$shift1] \frac{[$nums[3][1]]}{[$dens[3][1]]}`] is a little greater than [`[$shift1] \frac{1}{2}`]. + +Fraction [`\frac{[$nums[0][0]]}{[$dens[0][0]]}`] implies: We cut the whole evenly into [`[$dens[0][0]]`] pieces, and then take [`[$nums[0][0]]`] pieces. Since almost all pieces were taken, the the value of [`[$shift0] \frac{[$nums[0][0]]}{[$dens[0][0]]}`] is very close to [`[$shift0+1]`]. + +Here is how to solve each problem: + +For [`[$shift0] \frac{[$nums[0][0]]}{[$dens[0][0]]}- [$shift1] \frac{[$nums[0][1]]}{[$dens[0][1]]}`], the first fraction is close to [`[$shift0+1]`], and the second fraction is close to [`[$shift1]`]. As a result, the difference is very close to [`[$shift0-$shift1+1]`]. + +For [`[$shift0] \frac{[$nums[1][0]]}{[$dens[1][0]]}- [$shift1] \frac{[$nums[1][1]]}{[$dens[1][1]]}`], the first fraction is close to [`[$shift0+1]`], the second fraction is close to [`[$shift1] \frac{1}{2}`]. As a result, the difference is very close to [`[$shift0-$shift1] \frac{1}{2}`]. + +For [`[$shift0] \frac{[$nums[2][0]]}{[$dens[2][0]]}- [$shift1] \frac{[$nums[2][1]]}{[$dens[2][1]]}`], the first fraction is close to [`[$shift0]`], the second fraction is close to [`[$shift1+1]`]. As a result, the difference is very close to [`[$shift0-$shift1-1]`]. + +For [`[$shift0] \frac{[$nums[3][0]]}{[$dens[3][0]]}- [$shift1] \frac{[$nums[3][1]]}{[$dens[3][1]]}`], the first fraction is close to [`[$shift0]\frac{1}{2}`], the second fraction is close to [`[$shift1]\frac{1}{2}`]. As a result, the difference is very close to [`[$shift0-$shift1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition10.pg index d3c3c10fbd..a921f31683 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition10.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(add_fracs_same_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -99,3 +101,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition100.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition100.pg index 4e92af14ec..89e96b1ba8 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition100.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition100.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition110.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition110.pg index 924d216e1a..8442116d07 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition110.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition110.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition120.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition120.pg index 8f90e57ded..92d0152e9e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition120.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition120.pg @@ -9,18 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition130.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition130.pg index b45900f385..564caf70b3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition130.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition130.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -52,7 +52,7 @@ $den2 = $den1; do {$num1 = random(1,$den1-1,1);} until (gcd($num1,$den1)==1); $num2 = $numReduced*$multiple - $num1; -} until ((gcd($num2,$den2)==1) && ($num2<$den2)); +} until ((gcd($num2,$den2)==1) && ($num2<$den2) && ($num2 > 0) ); $int1 = random(1,5,1); $frac1 = Fraction($num1,$den1); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition140.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition140.pg index c42b61adfd..c9d0ccc81a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition140.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition140.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition150.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition150.pg index 8842a90b9a..206547da9a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition150.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition150.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition160.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition160.pg index 232e01a4dd..d902a75a82 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition160.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition160.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition170.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition170.pg index 3b01c5aef9..dc342d95e7 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition170.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition170.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition180.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition180.pg index 6276812c7b..11a43d6326 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition180.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition180.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition190.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition190.pg index af309c5fb0..6fa3a0121b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition190.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition190.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition20.pg index 8c2fae3882..993bd3e253 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition20.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition200.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition200.pg index 018e0594b1..1d07d25143 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition200.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition200.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition210.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition210.pg index b1356965d4..9065580d5b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition210.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition210.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition220.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition220.pg index d989738def..35511b85a4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition220.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition220.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition230.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition230.pg index 68f98b023f..6a993ef637 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition230.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition230.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition240.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition240.pg index a40c5e6c7a..6b92533653 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition240.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition240.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition30.pg index 3f746e5ddb..97556cea8a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition30.pg @@ -9,17 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(add_fracs_diff_denom) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -106,3 +107,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition40.pg index 8f88021666..2f5386ea28 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition40.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(add_fracs_diff_denom) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -109,3 +110,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition46.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition46.pg index bace4f689e..9b0c09a778 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition46.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition46.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addRationalToInteger) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition47.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition47.pg index 7a001a54b3..9d6e79f785 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition47.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition47.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addRationalToInteger) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -83,9 +84,10 @@ To add a positive integer and a positive fraction, we simply put them together a Don't forget that the result should be negative. -*Answer:* [`\left(-[$int1]\right) + \left(-[$frac2]\right) = [$ans] `] +[`\left(-[$int1]\right) + \left(-[$frac2]\right) = [$ans] `] END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition48.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition48.pg index 24704aca16..731e3e7b51 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition48.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition48.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addRationalToInteger) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -90,7 +91,7 @@ Note that we changed [`1`] to [`\frac{[$den2]}{[$den2]}`]. Finally, since the absolute value of the negative number, [`[$int1]`], is bigger than that of the positive number, [`[$frac2]`], the answer is negative. -*Answer:* [` [$frac2] + ([$int1]) = [$ans] `] +[` [$frac2] + ([$int1]) = [$ans] `] ##Method2 @@ -112,3 +113,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition49.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition49.pg index e9cd19b2d3..702754ad45 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition49.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition49.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addRationalToInteger) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -90,7 +91,7 @@ Note that we changed [`1`] to [`\frac{[$den2]}{[$den2]}`]. Finally, since the absolute value of the positive number, [`[$int1]`], is bigger than that of the negative number, [`[$frac2]`], the answer is positive. -*Solution:* [` (-[$frac2]) + [$int1] = [$ans] `] +[` (-[$frac2]) + [$int1] = [$ans] `] ##Method2 @@ -112,3 +113,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition50.pg index e87b8641ea..11b658e845 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition50.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition60.pg index 6c0aa0bc86..96c40b8ef0 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition60.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition70.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition70.pg index a8ae3e701d..b4c49f04ff 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition70.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition80.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition80.pg index 54e3630f07..06ccd6c673 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition80.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition90.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition90.pg index 3457719b80..e22fe9c45d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberAddition90.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(addingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('add','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision15.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision15.pg index 83d9a9d61b..5d44231027 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision15.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision15.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(dividingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('divide','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision20.pg index a9fa02fb01..b7af262cc2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision20.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('divide','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision25.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision25.pg index a5b1e37ba9..96f78702ed 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision25.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision25.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(dividingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('divide','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision30.pg index 5dccfb8d7d..e4002eeebe 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision30.pg @@ -7,19 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(dividingMixedNumbers) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('divide','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -121,3 +120,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision35.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision35.pg index 8e4bfd1041..44db990bf1 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision35.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberDivision35.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(dividingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('divide','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -72,7 +72,7 @@ $ansDen = $ans[1]; TEXT(beginproblem()); BEGIN_PGML -Multiply the following: [``-[$frac1] \div \left( -[$frac2] \right) ``] +Divide the following: [``-[$frac1] \div \left( -[$frac2] \right) ``] [___________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication15.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication15.pg index 7db6b691ce..ec8b1dcf69 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication15.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication15.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(multiplyingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -121,3 +122,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication20.pg index d32beaba6e..ffc7224a68 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication20.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(multiplyingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication25.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication25.pg index f7df29d5cf..efe7951103 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication25.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication25.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(multiplyingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication30.pg index a818e9bff0..ffff1e96c3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication30.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(multiplyingMixedNumbers) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication35.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication35.pg index ae21a15716..4931bce189 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication35.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberMultiplication35.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(multiplyingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -121,3 +122,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction10.pg index 7b7d19a488..afdae0e821 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction10.pg @@ -9,18 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction100.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction100.pg index ccf1232983..cc6dc5c342 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction100.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction100.pg @@ -9,18 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction110.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction110.pg index 11d61ab971..c1d635f19f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction110.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction110.pg @@ -9,18 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction120.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction120.pg index 9a3827934b..2924809902 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction120.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction120.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction130.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction130.pg index c9f58213c6..9cab338268 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction130.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction130.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction140.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction140.pg index 7261104cb6..8d9a9ce490 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction140.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction140.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction150.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction150.pg index 44135ed135..dfe425b149 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction150.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction150.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction160.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction160.pg index 23a0c7c1d2..a64d2bee07 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction160.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction160.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction170.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction170.pg index 90ec6dac5a..b8a9fc94f7 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction170.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction170.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction180.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction180.pg index 0385047094..b1d19992b4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction180.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction180.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -113,3 +113,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction190.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction190.pg index 268def536a..3dafd5f05e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction190.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction190.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction20.pg index 7a20c92eef..ead8aea8dd 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction20.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtract_fracs_same_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -103,3 +105,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction200.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction200.pg index b3d27bfdac..575ff94cfa 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction200.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction200.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction210.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction210.pg index 12d5fc83e4..3bf766082f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction210.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction210.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction220.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction220.pg index c43bb9652d..9d92db3f04 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction220.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction220.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction230.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction230.pg index a7d80d2e4c..991970c836 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction230.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction230.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtraction','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction240.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction240.pg index 9b03f2e618..495b15cab0 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction240.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction240.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction30.pg index fc759897da..e4db2bcf2a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction30.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtract_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -108,3 +110,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction40.pg index 623851ecc4..d66bb7d99d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction40.pg @@ -9,16 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtract_fracs_diff_denom) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -112,3 +114,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction50.pg index 0382d860bf..ad52f13fbb 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction50.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction60.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction60.pg index 92b2b141ea..8ed2b25882 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction60.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction70.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction70.pg index edfb5078e9..c767ff6b54 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction70.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction80.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction80.pg index 59bb51861c..e4bd51b207 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction80.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction90.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction90.pg index 10b8977fd5..ed645d5377 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MixedNumberSubtraction90.pg @@ -9,18 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Mixed/improper fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(subtractingMixedNumbers) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('subtract','mixed number') - +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,7 +53,7 @@ $den2 = $den1; do {$num1 = random(1,$den1-1,1);} until (gcd($num1,$den1)==1); $num2 = $numReduced*$multiple - $num1; -} until ((gcd($num2,$den2)==1) && ($num2<$den2)); +} until ((gcd($num2,$den2)==1) && ($num2<$den2) && ($num2 >0) ); $int1 = random(1,5,1); $frac1 = Fraction($num1,$den1); diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions15.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions15.pg index 87df3d5402..fc208c3794 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions15.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions15.pg @@ -9,16 +9,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('multiply','fraction','reduce') ## DBCCSS('5.NF.4.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(multiplyingTwoRationals) -## Level(2) -## KEYWORDS('multiply','fraction','reduce') @@ -31,7 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -64,7 +68,7 @@ BEGIN_PGML Multiply these two fractions: [`` \frac{[$num1]}{[$den1]} \cdot \frac{[$num2]}{[$den2]} ``] -If needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [_______]{$ans} @@ -95,3 +99,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions16.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions16.pg index 733b7960e1..b5315ac747 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions16.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions16.pg @@ -9,16 +9,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('multiply','fraction','reduce') ## DBCCSS('5.NF.4.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(multiplyingTwoRationals) -## Level(2) -## KEYWORDS('multiply','fraction','reduce') @@ -31,7 +34,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -64,7 +68,7 @@ BEGIN_PGML Multiply these two fractions: [`` \frac{[$num1]}{[$den1]} \cdot \frac{[$num2]}{[$den2]} ``] -If needed, use an improper fraction in your answer. Don't use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [_______]{$ans} @@ -95,3 +99,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions69.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions69.pg index cbb53ac124..5663238e41 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions69.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyFractions69.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.4.a','4.NF.4.b') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(multIntegerWithRational) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','fraction') +## DBCCSS('5.NF.4.a','4.NF.4.b') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') @@ -31,7 +33,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -66,7 +69,7 @@ BEGIN_PGML Multiply the integer with the fraction: [``-[$integer]\cdot \frac{[$num]}{[$den]} ``] -If needed, use an improper fraction in your answer. Don’t use a mixed number. +[@KeyboardInstructions("If needed, use an improper fraction in your answer. Don't use a mixed number.")@]** [___________]{$ans} @@ -100,3 +103,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions10.pg index ee64ca460f..54d7907298 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions10.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(long_fraction_multiplication) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','fraction') - +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -67,7 +67,7 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply these fractions: [`` [$frac1] \cdot [$frac2] \cdot [$frac3] ``] +Multiply: [`` [$frac1] \cdot [$frac2] \cdot [$frac3] ``] [___________]{$ans} @@ -94,3 +94,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions20.pg index 6d3c30b48e..ec12f8eadd 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions20.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(long_fraction_multiplication) -## Level(3) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','fraction','negative') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,7 +67,7 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply these fractions: [`` \left( -[$frac1] \right) \cdot \left( -[$frac2] \right) \cdot \left( -[$frac3] \right) ``] +Multiply: [`` \left( -[$frac1] \right) \cdot \left( -[$frac2] \right) \cdot \left( -[$frac3] \right) ``] [___________]{$ans} @@ -96,3 +97,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions30.pg index 221f2a8f79..63cf5a9135 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions30.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(long_fraction_multiplication) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','fraction') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,7 +63,7 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply these fractions: [`` [$frac1] \cdot [$frac2] \cdot [$frac3] ``] +Multiply: [`` [$frac1] \cdot [$frac2] \cdot [$frac3] ``] [___________]{$ans} @@ -92,3 +93,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions40.pg index a39ef123a3..af52a55a2b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/MultiplyThreeFractions40.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## MLT(long_fraction_multiplication) -## Level(3) -## MO(1) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('multiply','fraction','negative') +## DBCCSS('5.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,7 +63,7 @@ TEXT(beginproblem()); BEGIN_PGML -Multiply these fractions: [`` \left(- [$frac1] \right) \cdot [$frac3] \cdot \left(- [$frac2] \right) ``] +Multiply: [`` \left(- [$frac1] \right) \cdot [$frac3] \cdot \left(- [$frac2] \right) ``] [___________]{$ans} @@ -95,3 +96,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/ReduceFraction25.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/ReduceFraction25.pg index a09495cb9d..94beb8dfe9 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/ReduceFraction25.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/ReduceFraction25.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('fraction','reduce') ## DBCCSS('3.NF.3.b','4.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Reducing fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(reduceRational) -## Level(2) -## KEYWORDS('fraction','reduce') @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/ReduceFraction50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/ReduceFraction50.pg index c50c23ff56..7528292c1c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/ReduceFraction50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/ReduceFraction50.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.NF.3.b','4.NF.1') - -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Reducing fractions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(reduceRational) -## Level(2) +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') ## KEYWORDS('fraction','reduce') - +## DBCCSS('3.NF.3.b','4.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,11 +63,9 @@ BEGIN_PGML Reduce the following fractions: - [`` \frac{[$num0]}{[$den0]} =``][_________]{$ans0} - - +a. [`` \frac{[$num0]}{[$den0]} =``][_________]{$ans0} - [`` \frac{[$num1]}{[$den1]} =``][_________]{$ans1} +a. [`` \frac{[$num1]}{[$den1]} =``][_________]{$ans1} END_PGML @@ -76,9 +75,9 @@ BEGIN_PGML_SOLUTION The fraction line is like the division symbol. We have: - [`` \frac{[$num0]}{[$den0]} = [$num0] \div [$den0] = [$ans0] ``] +a. [`` \frac{[$num0]}{[$den0]} = [$num0] \div [$den0] = [$ans0] ``] - [`` \frac{[$num1]}{[$den1]} = [$num1] \div [$den1] = [$ans1] ``] +a. [`` \frac{[$num1]}{[$den1]} = [$num1] \div [$den1] = [$ans1] ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph10.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph10.pg index c61529b967..5fadc546d5 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph10.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.NF.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('fraction','graph') +## DBCCSS('3.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,8 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -77,9 +80,9 @@ BEGIN_PGML Fill in blanks with fractions: -[_________]{$frac1} of the figure is shaded. +a. [_________]{$frac1} of the figure is shaded. -[_________]{$frac2} of the figure is not shaded. +a. [_________]{$frac2} of the figure is not shaded. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph20.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph20.pg index f8a5670418..7bf0eb45ca 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph20.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.NF.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('fraction','graph') +## DBCCSS('3.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,8 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -88,9 +91,9 @@ BEGIN_PGML Fill in blanks with fractions: -[_________]{$frac1} of the figure is shaded. +a. [_________]{$frac1} of the figure is shaded. -[_________]{$frac2} of the figure is not shaded. +a. [_________]{$frac2} of the figure is not shaded. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph30.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph30.pg index 1f19a50a4e..af50745c6c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph30.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NF') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('fraction','graph','reduce') +## DBCCSS('4.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,8 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -79,9 +82,9 @@ BEGIN_PGML Fill in blanks with fractions. Don't forget to reduce fractions if you can. -[_________]{$frac1} of the figure is shaded. +a. [_________]{$frac1} of the figure is shaded. -[_________]{$frac2} of the figure is not shaded. +a. [_________]{$frac2} of the figure is not shaded. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph40.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph40.pg index ac4732010e..7a62d7c8b6 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph40.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.NF.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('fraction','graph') +## DBCCSS('3.NF.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,8 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -91,11 +94,11 @@ BEGIN_PGML >>[@image( insertGraph($gr), width=>400, height=>200, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< -Fill in blanks with fractions. Don’t forget to reduce fractions if you can. +Fill in blanks with fractions. Don’t forget to reduce fractions if you can. -[_________]{$frac1} of the figure is shaded. +a. [_________]{$frac1} of the figure is shaded. -[_________]{$frac2} of the figure is not shaded. +a. [_________]{$frac2} of the figure is not shaded. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph50.pg b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph50.pg index 06ede8e019..f7261dc35a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/WriteFractionByGraph50.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.NF') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Interpreting fractions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('fraction','graph','mixed number') +## DBCCSS('5.NF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,8 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -98,7 +101,7 @@ BEGIN_PGML Fill in blanks with a mixed number and an improper fraction as required. -The shaded area can be represented by the mixed number [_________]{$mixAns}. + a. The shaded area can be represented by the mixed number [_________]{$mixAns}. END_PGML @@ -112,7 +115,7 @@ $improperAns = Fraction($int*$den+$num,$den); BEGIN_PGML -The shaded area can be represented by the improper fraction [_________]{$improperAns}. + b. The shaded area can be represented by the improper fraction [_________]{$improperAns}. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/AbsoluteValue11.pg b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/AbsoluteValue11.pg index 4601a1feab..96f3f44545 100644 --- a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/AbsoluteValue11.pg +++ b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/AbsoluteValue11.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.7') -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Solving equations with absolute values) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') ## KEYWORDS('absolute value') +## DBCCSS('6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -49,15 +52,15 @@ TEXT(beginproblem()); BEGIN_PGML -Find the absolute value of the following numbers. +Evaluate the following. a. [`` |{[$num1]}|= ``] [______]{$ans1} -b. [`` |{[$num2]}|= ``] [______]{$ans2} +a. [`` |{[$num2]}|= ``] [______]{$ans2} -c. [`` -|{[$num1]}|= ``] [______]{$ans3} +a. [`` -|{[$num1]}|= ``] [______]{$ans3} -d. [`` -|{[$num2]}|= ``] [______]{$ans4} +a. [`` -|{[$num2]}|= ``] [______]{$ans4} END_PGML @@ -65,13 +68,13 @@ END_PGML BEGIN_PGML_SOLUTION -a. The absolute value of [`[$num1]`] measures how many units are between [`[$num1]`] and [`0`] on the number line, so [` |{[$num1]}|=[$ans1] `]. +a. The absolute value of [`[$num1]`] measures how many units are between [`[$num1]`] and [`0`] on the number line, so [` |{[$num1]}|=[$ans1] `]. -b. The absolute value of [`[$num2]`] measures how many units are between [`[$num2]`] and [`0`] on the number line, so [` |{[$num2]}|=[$ans2] `]. +a. The absolute value of [`[$num2]`] measures how many units are between [`[$num2]`] and [`0`] on the number line, so [` |{[$num2]}|=[$ans2] `]. -c. The absolute value symbols cannot affect what are outside them, so we have [` -|{[$num1]}|=[$ans3] `]. +a. The absolute value symbols cannot affect what are outside them, so we have [` -|{[$num1]}|=[$ans3] `]. -d. Similar to Part c, we have [` -|{[$num2]}|=[$ans4] `]. +a. Similar to Part c, we have [` -|{[$num2]}|=[$ans4] `]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/CompareNumbers50.pg b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/CompareNumbers50.pg index 332dc6e7f8..d88eed68f9 100644 --- a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/CompareNumbers50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/CompareNumbers50.pg @@ -8,17 +8,20 @@ # # ENDDESCRIPTION +## DBsubject('Middle School') +## DBchapter('') +## DBsection('') +## KEYWORDS('compare','negative','integer') ## DBCCSS('4.NF.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + -## DBsubject(Algebra) -## DBchapter(Absolute value expressions and functions) -## DBsection(Absolute value inequalities) -## Institution(PCC) -## Author(Carl Yao) -## MLT(comparisionAbsoluteValues) -## Level(1) -## MO(1) -## KEYWORDS('compare','negative','integer') ############################################## @@ -26,12 +29,12 @@ DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserPopUp.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -75,10 +78,10 @@ for my $i (0..2) { for my $i (0..2) { if ($pairs[$i][0]>$pairs[$i][1]) { - $popups[$i] = PopUp(['?', $LTS, $GTS, '='], $GTS); + $popups[$i] = PopUp(['?', '<', '>', '='], 2); $correct[$i]='\gt'; } else { - $popups[$i] = PopUp(['?', $LTS, $GTS, '='], $LTS); + $popups[$i] = PopUp(['?', '<', '>', '='], 1); $correct[$i]='\lt'; } } @@ -119,28 +122,20 @@ $ALT = "This is a number line with $first, $second, 0 and $pos marked, from left TEXT(beginproblem()); -BEGIN_TEXT +BEGIN_PGML Compare the following integers: -$PAR -$BCENTER -$pairs[0][0] \{ $popups[0]->menu() \} $pairs[0][1] -$PAR -$pairs[1][0] \{ $popups[1]->menu() \} $pairs[1][1] -$PAR -$pairs[2][0] \{ $popups[2]->menu() \} $pairs[2][1] -$PAR -$ECENTER - -END_TEXT -################################################### +a. [`[$pairs[0][0]]`] [__]{$popups[0]} [`[$pairs[0][1]]`] -ANS( $popups[0]->cmp(correct_ans_latex_string=>$correct[0]) ); -ANS( $popups[1]->cmp(correct_ans_latex_string=>$correct[1]) ); -ANS( $popups[2]->cmp(correct_ans_latex_string=>$correct[2]) ); +a. [`[$pairs[1][0]]`] [__]{$popups[1]} [`[$pairs[1][1]]`] + +a. [`[$pairs[2][0]]`] [__]{$popups[2]} [`[$pairs[2][1]]`] + +END_PGML + +################################################### -############################################## BEGIN_PGML_SOLUTION @@ -157,3 +152,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/MultiplyWithNegativeIntegers30.pg b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/MultiplyWithNegativeIntegers30.pg new file mode 100644 index 0000000000..d3a84821da --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/MultiplyWithNegativeIntegers30.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# Multiply the following integers: +# +# a) (-1)(-2)(-3)(-4)=? +# +# b) 2(-3)(-4)(-1)=? +# +# Last updated: Carl Yao 2/25/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','negative','operation','multiply') +## DBCCSS('6.NS.6') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "answerHints.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +@nums = (1,2,3); + +$a = -1*list_random(@nums); +$absA = abs($a); +$b = -1*list_random(@nums); +$absB = abs($b); +$c = -1*list_random(@nums); +$absC = abs($c); +$d = -1*list_random(@nums); +$absD = abs($d); + +$e = random(-1,1,2)*list_random(@nums); +$absE = abs($e); +$f = -1*list_random(@nums); +$absF = abs($f); +$g = random(-1,1,2)*list_random(@nums); +$absG = abs($g); +$h = -1*list_random(@nums); +$absH = abs($h); + +$ans1 = Compute($a*$b*$c*$d); +$ans2 = Compute($e*$f*$g*$h); + +if ($ans2>0) {$symbol = "";} +else {$symbol = "-";} + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Multiply the following. + +a. [`` ([$a])([$b])([$c])([$d]) ``] + [________]{$ans1} + +a. [`` ([$e])([$f])([$g])([$h]) ``] + [________]{$ans2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +In multiplication, each pair of negative signs cancel. If all negative signs are canceled, the product is positive; if there is one negative sign left, the product is negative. + +a. + + [` + \begin{aligned}[t] + &\phantom{{}=}([$a])([$b])([$c])([$d]) \\ + &= ([$absA])([$absB])([$absC])([$absD]) \\ + &= [$ans1] + \end{aligned}`] + +b. + + [` + \begin{aligned}[t] + &\phantom{{}=}([$e])([$f])([$g])([$h]) \\ + &= [$symbol]([$absE])([$absF])([$absG])([$absH]) \\ + &= [$ans2] + \end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/RoundWholeNumbers10.pg b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/RoundWholeNumbers10.pg index 8914aefc34..3f3d08e894 100644 --- a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/RoundWholeNumbers10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/RoundWholeNumbers10.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NBT.3') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Rounding) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('round','whole number') +## DBCCSS('4.NBT.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## @@ -92,9 +96,9 @@ BEGIN_PGML Round the following numbers to the nearest _[$roundToWord]_. (Don't use commas in your answer.) - [`` [$num1] = ``] [_____________] +a. [`` [$num1] = ``] [_____________] - [`` [$num2] = ``] [_____________] +a. [`` [$num2] = ``] [_____________] END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/RoundWholeNumbers20.pg b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/RoundWholeNumbers20.pg index 950c4a86e6..33359e6467 100644 --- a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/RoundWholeNumbers20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/RoundWholeNumbers20.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.NBT.3') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Rounding) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('round','whole number') +## DBCCSS('4.NBT.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); @@ -93,9 +97,9 @@ BEGIN_PGML Round the following numbers to the nearest _[$roundToWord]_. (Don't use commas in your answer.) - [`` [$num1] = ``] [_____________] +a. [`` [$num1] = ``] [_____________] - [`` [$num2] = ``] [_____________] +a. [`` [$num2] = ``] [_____________] END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers10.pg b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers10.pg new file mode 100644 index 0000000000..7160e4e148 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers10.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Identify square numbers smaller than or equal to 144. +# +# Last edited: Carl Yao 9/22/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('radical','square root','square number','identify') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); + +@given = (); +$numCorrect = 3; + +@squareNums = (1,4,9,16,25,36,49,64,81,100,121,144); + +for my $i (0..$numCorrect-1) { + push(@given,splice(@squareNums,random(0,$#squareNums,1),1)); +} + +$nonSquare = 0; +for my $i (0..$numCorrect-1) { + do {$nonSquare=random(2,143,1);} until + (sqrt($nonSquare)!=int(sqrt($nonSquare))); + push(@given,$nonSquare); +} + +Context()->texStrings; +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Which of the following are square numbers? There may be more than +one correct answer.", +"\($given[0]\) $BR", +"\($given[1]\) $BR", +"\($given[2]\) $BR", +); + +$mc -> extra( +"\($given[3]\) $BR", +"\($given[4]\) $BR", +"\($given[5]\) $BR", +); + +Context()->normalStrings; + + + +############################################## + +BEGIN_TEXT + +\{ $mc -> print_q() \} + +$SPACE $SPACE $SPACE \{ $mc -> print_a() \} + +END_TEXT + + + + +############################################## +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +You can quickly find the first few square numbers on scratch paper: + + [`` +\begin{aligned}[t] + 1^{2} &= 1 \\ + 2^{2} &= 4 \\ + 3^{2} &= 9 \\ + 4^{2} &= 16 \\ + 5^{2} &= 25 \\ + 6^{2} &= 36 \\ + 7^{2} &= 49 \\ + 8^{2} &= 64 \\ + 9^{2} &= 81 \\ + 10^{2} &= 100 \\ + 11^{2} &= 121 \\ + 12^{2} &= 144 \\ +\end{aligned} + ``] + +It would be very helpful if you can memorize the above 12 square numbers. + +So the correct answers are [@$mc->correct_ans()@]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers20.pg b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers20.pg new file mode 100644 index 0000000000..56414a4929 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers20.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Find square root of some perfect square numbers. +# +# Last edited: Carl Yao 9/22/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('radical','square root','square number') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("LimitedNumeric"); + +@squareNums = (1,4,9,16,25,36,49,64,81,100,121,144); + +$num1=splice(@squareNums,random(0,$#squareNums,1),1); +$num2=splice(@squareNums,random(0,$#squareNums,1),1); +$num3=splice(@squareNums,random(0,$#squareNums,1),1); + +$ans1 = sqrt($num1); +$ans2 = sqrt($num2); +$ans3 = sqrt($num3); + +############################################## + +BEGIN_PGML + +Evaluate the following. + +a. [`` \sqrt{[$num1]} ``] = [_____________]{$ans1} + +a. [`` \sqrt{[$num2]} ``] = [_____________]{$ans2} + +a. [`` \sqrt{[$num3]} ``] = [_____________]{$ans3} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +You can quickly find the first few square numbers on scratch paper: + + [`` +\begin{aligned}[t] + 1^{2} &= 1 \\ + 2^{2} &= 4 \\ + 3^{2} &= 9 \\ + 4^{2} &= 16 \\ + 5^{2} &= 25 \\ + 6^{2} &= 36 \\ + 7^{2} &= 49 \\ + 8^{2} &= 64 \\ + 9^{2} &= 81 \\ + 10^{2} &= 100 \\ + 11^{2} &= 121 \\ + 12^{2} &= 144 \\ +\end{aligned} + ``] + +It would be very helpful if you can memorize the above 12 square numbers. + +So the correct answers are: + +a. [``\sqrt{[$num1]} = [$ans1]``] +a. [``\sqrt{[$num2]} = [$ans2]``] +a. [``\sqrt{[$num3]} = [$ans3]``] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers30.pg b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers30.pg new file mode 100644 index 0000000000..1131c4d7a9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers30.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find square root of 4/9, 9/4 and -4/9. +# +# Last edited: Carl Yao 12/17/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('radical','square root','square number','fraction') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextForm.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@squareNums = (1,4,9,16,25,36,49,64,81,100,121,144); + +$num1=splice(@squareNums,random(0,$#squareNums,1),1); +do {$index = random(0,$#squareNums,1);} until ((gcd($squareNums[$index],$num1)==1) && ($squareNums[$index]!=1)); +$num2=splice(@squareNums,$index,1); + +$num5=splice(@squareNums,random(0,$#squareNums,1),1); +do {$index = random(0,$#squareNums,1);} until ((gcd($squareNums[$index],$num5)==1) && ($squareNums[$index]!=1)); +$num6=splice(@squareNums,$index,1); + +$frac1 = Fraction($num1,$num2); +$ans1 = sqrt($frac1); +$frac3 = -Fraction($num5,$num6); +Context("Form"); +$ans3 = Compute("Not a real number"); + +############################################## + +BEGIN_PGML + +Evaluate the following. + +[@KeyboardInstructions("Don't use mixed numbers. When needed, use improper fractions, like ".'[` \frac{3}{2} `]'.". If a square root does not exist, enter [|not a real number|]*.")@]** + +a. [`` \sqrt{[$frac1]} ``] = [_____________]{$ans1} + +a. [`` \sqrt{[$frac3]} ``] = [_____________]{$ans3} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +"Square root" is the opposite operation of "square." + +Since [` \left(\frac{2}{3}\right)^{2} = \left(\frac{2}{3}\right)\left(\frac{2}{3}\right) = \frac{4}{9} `], we have: [` \sqrt{\frac{4}{9}} = \frac{2}{3} `]. + +The answers are: + +a. [``\sqrt{[$frac1]} = [$ans1] ``] +a. [``\sqrt{[$frac3]} \text{ is not a real number} ``] + +Note that square root of a negative number does not exist. This is because any number squared is always positive or [`0`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers40.pg b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers40.pg new file mode 100644 index 0000000000..f6552dc710 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers40.pg @@ -0,0 +1,78 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find square root of 0.25, 25, 2500 +# +# Last edited: Carl Yao 12/20/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('radical','square root','square number','decimal') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("LimitedNumeric"); + +@squareNums = (4,9,16,25,36,49,64,81,100,121,144); + +$num1=$squareNums[random(0,$#squareNums,1)]; + +$ans1 = sqrt($num1); +$ans2 = sqrt($num1/100); +$ans3 = sqrt($num1*100); + +############################################## + +BEGIN_PGML + +Evaluate the following. + +Do not use a calculator. + +a. [`` \sqrt{[$num1]} ``] = [_____________]{$ans1} + +a. [`` \sqrt{[$num1/100]} ``] = [_____________]{$ans2} + +a. [`` \sqrt{[$num1*100]} ``] = [_____________]{$ans3} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +First, recognize that [`[$num1]`] is a square number. Since [`[$ans1]\cdot[$ans1]=[$num1]`], we have [` \sqrt{[$num1]}=[$ans1] `]. + +Next, since [`[$ans2]\cdot[$ans2]=[$num1/100]`], we have [`\sqrt{[$num1/100]}=[$ans2]`]. + +Finally, since [`[$ans3]\cdot[$ans3]=[$num1*100]`], we have [`\sqrt{[$num1*100]}=[$ans3]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers50.pg b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers50.pg new file mode 100644 index 0000000000..1e384d025b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers50.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find square root of 25, 2500, 250000 +# +# Last edited: Carl Yao 12/20/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('radical','square root','square number','decimal') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("LimitedNumeric"); +Context()->{format}{number} = "%9d"; + +@squareNums = (1,4,9,16,25,36,49,64,81,100,121,144); + +$num1=$squareNums[random(0,$#squareNums,1)]; + +$ans1 = sqrt($num1); +$ans2 = sqrt($num1*100); +$ans3 = sqrt($num1*10000); + +############################################## + +BEGIN_PGML + +Evaluate the following. + +Do not use a calculator. + +a. [`` \sqrt{[$num1]} ``] = [_____________]{$ans1} + +a. [`` \sqrt{[$num1*100]} ``] = [_____________]{$ans2} + +a. [`` \sqrt{[$num1*10000]} ``] = [_____________]{$ans3} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +First, recognize that [`[$num1]`] is a square number. Since [`[$ans1]\cdot[$ans1]=[$num1]`], we have [` \sqrt{[$num1]}=[$ans1] `]. + +Next, since [`[$ans2]\cdot[$ans2]=[$num1*100]`], we have [`\sqrt{[$num1*100]}=[$ans2]`]. + +Finally, since [`[$ans3]\cdot[$ans3]=[$num1*10000]`], we have [`\sqrt{[$num1*10000]}=[$ans3]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers60.pg b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers60.pg new file mode 100644 index 0000000000..fa3ef6e9fe --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/identifySquareNumbers60.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find square root of 25, 0.25, 0.0025 +# +# Last edited: Carl Yao 12/20/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('radical','square root','square number','decimal') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "contextFraction.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("LimitedNumeric"); +#Context()->{format}{number} = "%9d"; + +@squareNums = (1,4,9,16,25,36,49,64,81,100,121,144); + +$num1=$squareNums[random(0,$#squareNums,1)]; + +$ans1 = sqrt($num1); +$ans2 = sqrt($num1/100); +$ans3 = sqrt($num1/10000); + +############################################## + +BEGIN_PGML + +Evaluate the following. + +Do not use a calculator. + +a. [`` \sqrt{[$num1]} ``] = [_____________]{$ans1} + +a. [`` \sqrt{[$num1/100]} ``] = [_____________]{$ans2} + +a. [`` \sqrt{[$num1/10000]} ``] = [_____________]{$ans3} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +First, recognize that [`[$num1]`] is a square number. Since [`[$ans1]\cdot[$ans1]=[$num1]`], we have [` \sqrt{[$num1]}=[$ans1] `]. + +Next, since [`[$ans2]\cdot[$ans2]=[$num1/100]`], we have [`\sqrt{[$num1/100]}=[$ans2]`]. + +Finally, since [`[$ans3]\cdot[$ans3]=[$num1/10000]`], we have [`\sqrt{[$num1/10000]}=[$ans3]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode10.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode10.pg new file mode 100644 index 0000000000..022b680d4a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode10.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean of some numbers. Answer is integer. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(3,6,1); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(1,20,1); + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $listAdd."$nums[$i]+"; + } + $mean = $sum/$dim; +} until (int($mean)==$mean); + +$listComma = substr($listComma,0,-5); +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The mean of this group of numbers is [___________]{$mean}. + + [`` [$listComma] ``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode100.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode100.pg new file mode 100644 index 0000000000..fcc0f69ad2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode100.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find median of some positive and negative numbers. +# There are an even number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + +$dim = random(4,8,2); + +@nums = (); +$mean=0; +$listComma=""; +for my $i (0..$dim-1) { + $nums[$i] = random(-10,5,1); + $listComma = $listComma."$nums[$i],\;\;"; +} + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$mid1 = $ordered[$dim/2-1]; +$mid2 = $ordered[$dim/2]; + +$median = ($mid1+$mid2)/2; + +} until ($median==int($median)); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The median of this group of numbers is [___________]{$median}. + + [`` [$listComma] ``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. In this case, there are two numbers in the middle: [` [$mid1],[$mid2] `]. The median is the average of these two numbers: + + [`` \text{median}=\frac{[$mid1]+[$mid2]}{2}=[$median] ``] + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode110.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode110.pg new file mode 100644 index 0000000000..275ad9c94b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode110.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mode of some numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mode') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +sub shuffle { + my $array = shift; + my $i; + for ($i = @$array; --$i; ) { + my $j = random(0,$i,1); + next if $i == $j; + @$array[$i,$j] = @$array[$j,$i]; + } +} + +###################################### + +Context("LimitedNumeric"); + +$dim = random(6,10,1); + +@nums = (); +$listComma=""; + +$dup = random(1,20,1); +do {$mode = random(1,20,1);} until ($mode!=$dup); + +$nums[0]=$dup; +$nums[1]=$dup; +$nums[2]=$mode; +$nums[3]=$mode; +$nums[4]=$mode; + +for my $i (5..$dim-1) { + do {$nums[$i] = random(1,20,1);} until ($nums[$i]!=$dup); +} + +shuffle(~~@nums); + +$listComma = ""; +foreach my $item (@nums) { + $listComma = $listComma."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The mode of this group of numbers is [___________]{$mode}. + + [`` [$listComma] ``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The mode of a group of numbers is the most frequent number, so the mode is [` [$mode] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode120.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode120.pg new file mode 100644 index 0000000000..61c2595854 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode120.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean and median of some numbers. All numbers are positive integers. +# There are an odd number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean','median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(5,9,2); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(1,20,1); + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $listAdd."$nums[$i]+"; + } + $mean = $sum/$dim; +} until (int($mean)==$mean); + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$median = $ordered[int($dim/2)]; + +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the mean and median of this group of numbers: + + [`` [$listComma] ``] + +a. The mean of this list of numbers is [___________]{$mean}. + +a. The median of this list of numbers is [___________]{$median}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +####Find the mean + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +####Find the median + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode130.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode130.pg new file mode 100644 index 0000000000..cdad77345b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode130.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean and median of some numbers. +# All numbers are positive or negative integers. +# There are an odd number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean','median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(5,9,2); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(-10,5,1); + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $nums[$i]>=0 ? $listAdd."$nums[$i]+" : $listAdd."($nums[$i])+"; + } + $mean = $sum/$dim; +} until (int($mean)==$mean); + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$median = $ordered[int($dim/2)]; + +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the mean and median of this group of numbers: + + [`` [$listComma] ``] + +a. The mean of this list of numbers is [___________]{$mean}. + +a. The median of this list of numbers is [___________]{$median}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +####Find the mean + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +####Find the median + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode140.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode140.pg new file mode 100644 index 0000000000..dedf405acc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode140.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean and median of some numbers. All numbers are positive decimals. +# There are an odd number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean','median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(5,9,2); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(1,20,1)+random(1,99,1)/100; + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $listAdd."$nums[$i]+"; + } + $mean = $sum/$dim; +} until (int($mean*100)==$mean*100); + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$median = $ordered[int($dim/2)]; + +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the mean and median of this group of numbers: + + [`` [$listComma] ``] + +a. The mean of this list of numbers is [___________]{$mean}. + +a. The median of this list of numbers is [___________]{$median}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +####Find the mean + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +####Find the median + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode150.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode150.pg new file mode 100644 index 0000000000..1036b82cc0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode150.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean and median of some numbers. +# Numbers are positive or negative decimals. +# There are an odd number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean','median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(5,9,2); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(-1,1,2)*(random(1,20,1)+random(1,99,1)/100); + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $nums[$i]>=0 ? $listAdd."$nums[$i]+" : $listAdd."($nums[$i])+"; + } + $mean = $sum/$dim; +} until (int($mean*100)==$mean*100); + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$median = $ordered[int($dim/2)]; + +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the mean and median of this group of numbers: + + [`` [$listComma] ``] + +a. The mean of this list of numbers is [___________]{$mean}. + +a. The median of this list of numbers is [___________]{$median}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +####Find the mean + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +####Find the median + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode160.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode160.pg new file mode 100644 index 0000000000..f9f7a2128f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode160.pg @@ -0,0 +1,126 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean and median of some numbers. All numbers are positive integers. +# There are an even number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean','median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + +$dim = random(4,8,2); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(1,20,1); + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $listAdd."$nums[$i]+"; + } + $mean = $sum/$dim; +} until (int($mean)==$mean); + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$mid1 = $ordered[$dim/2-1]; +$mid2 = $ordered[$dim/2]; + +$median = ($mid1+$mid2)/2; + +} until ($median==int($median)); + +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the mean and median of this group of numbers: + + [`` [$listComma] ``] + +a. The mean of this list of numbers is [___________]{$mean}. + +a. The median of this list of numbers is [___________]{$median}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +####Find the mean + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +####Find the median + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. In this case, there are two numbers in the middle: [` [$mid1],[$mid2] `]. The median is the average of these two numbers: + + [`` \text{median}=\frac{[$mid1]+[$mid2]}{2}=[$median] ``] + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode170.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode170.pg new file mode 100644 index 0000000000..b0cdbf2130 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode170.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean and median of some numbers. +# Numbers are positive or negative integers. +# There are an even number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean','median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(4,8,2); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(-10,5,1); + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $nums[$i]>=0 ? $listAdd."$nums[$i]+" : $listAdd."($nums[$i])+"; + } + $mean = $sum/$dim; +} until (int($mean)==$mean); + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$mid1 = $ordered[$dim/2-1]; +$mid2 = $ordered[$dim/2]; + +$median = ($mid1+$mid2)/2; + +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the mean and median of this group of numbers: + + [`` [$listComma] ``] + +a. The mean of this list of numbers is [___________]{$mean}. + +a. The median of this list of numbers is [___________]{$median}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +####Find the mean + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +####Find the median + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. In this case, there are two numbers in the middle: [` [$mid1],[$mid2] `]. The median is the average of these two numbers: + + [`` \text{median}=\frac{[$mid1]+[$mid2]}{2}=[$median] ``] + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode180.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode180.pg new file mode 100644 index 0000000000..0fc585613c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode180.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean and median of some numbers. +# All numbers are positive decimals. +# There are an even number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean','median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + +$dim = random(4,8,2); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(1,20,1)+random(1,9,1)/10; + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $listAdd."$nums[$i]+"; + } + $mean = $sum/$dim; +} until (int($mean*100)==$mean*100); + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$mid1 = $ordered[$dim/2-1]; +$mid2 = $ordered[$dim/2]; + +$median = ($mid1+$mid2)/2; + +} until ($median*100==int($median*100)); + +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the mean and median of this group of numbers: + + [`` [$listComma] ``] + +a. The mean of this list of numbers is [___________]{$mean}. + +a. The median of this list of numbers is [___________]{$median}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +####Find the mean + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +####Find the median + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. In this case, there are two numbers in the middle: [` [$mid1],[$mid2] `]. The median is the average of these two numbers: + + [`` \text{median}=\frac{[$mid1]+[$mid2]}{2}=[$median] ``] + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode190.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode190.pg new file mode 100644 index 0000000000..2ab4c314d7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode190.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean and median of some numbers. +# Numbers are positive or negative decimals. +# There are an even number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean','median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(4,8,2); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(-1,1,2)*(random(1,5,1)+random(1,9,1)/10); + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $nums[$i]>=0 ? $listAdd."$nums[$i]+" : $listAdd."($nums[$i])+"; + } + $mean = $sum/$dim; +} until (int($mean*100)==$mean*100); + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$mid1 = $ordered[$dim/2-1]; +$mid2 = $ordered[$dim/2]; + +$median = ($mid1+$mid2)/2; + +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the mean and median of this group of numbers: + + [`` [$listComma] ``] + +a. The mean of this list of numbers is [___________]{$mean}. + +a. The median of this list of numbers is [___________]{$median}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +####Find the mean + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +####Find the median + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. In this case, there are two numbers in the middle: [` [$mid1],[$mid2] `]. The median is the average of these two numbers: + + [`` \text{median}=\frac{[$mid1]+[$mid2]}{2}=[$median] ``] + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode20.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode20.pg new file mode 100644 index 0000000000..1842b2a920 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode20.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean of some numbers. Numbers are decimals. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(3,6,1); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(1,20,1)+random(1,99,1)/100; + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $listAdd."$nums[$i]+"; + } + $mean = $sum/$dim; +} until (int($mean*100)==$mean*100); + +$listComma = substr($listComma,0,-5); +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The mean of this group of numbers is [___________]{$mean}. + + [`` [$listComma] ``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode200.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode200.pg index 5b6317a283..b5bc0a8f6e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode200.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode200.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.SP') -## DBsubject(Statistics) -## DBchapter(Exploratory data analysis/descriptive statistics) -## DBsection(Summary statistics) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('mean','median','application') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +31,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", +# "contextCurrency.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -89,9 +93,9 @@ Here is a list of some cities' population: [`` [$listComma] ``] -The mean of these cities' population is [___________]{$mean}. +a. The mean of these cities' population is [___________]{$mean}. -The median of these cities' population is [___________]{$median}. +a. The median of these cities' population is [___________]{$median}. Which number, mean or median, is a better way to represent these cities' population? @@ -115,7 +119,7 @@ Next, we divide the sum by how many numbers there are: [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] -*Solution:* The mean of these cities' population is [`[$mean]`]. +The mean of these cities' population is [`[$mean]`]. ####Find the median @@ -125,7 +129,7 @@ To find the median of a list of number, we first need to order these numbers fro The number in the middle is the median: [`[$median]`]. -*Solution:* The median of these cities' population is [` [$median] `]. +The median of these cities' population is [` [$median] `]. ####Mean or median? diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode210.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode210.pg index 63a37ef89d..8687eda9ff 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode210.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode210.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.SP') -## DBsubject(Statistics) -## DBchapter(Exploratory data analysis/descriptive statistics) -## DBsection(Summary statistics) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('mean','median','application') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "PCCmacros.pl", "contextCurrency.pl", "parserRadioButtons.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -101,9 +104,9 @@ Some students conducted a survey on some people's weekly income: [`` [$listComma] ``] -The mean of these people's weekly income is [___________]{$mean}. +a. The mean of these people's weekly income is [___________]{$mean}. -The median of these people's weekly income is [___________]{$median}. +a. The median of these people's weekly income is [___________]{$median}. Which number, mean or median, is a better way to represent these people's weekly income? @@ -127,7 +130,7 @@ Next, we divide the sum by how many numbers there are: [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] -*Solution:* The mean of these people's weekly income is [`[$mean]`]. +The mean of these people's weekly income is [`[$mean]`]. ####Find the median @@ -139,7 +142,7 @@ The number in the middle is the median. In this case, there are two numbers in t [`` \text{median}=\frac{[$mid1]+[$mid2]}{2}=[$median] ``] -*Solution:* The median of these people's weekly income is [` [$median] `]. +The median of these people's weekly income is [` [$median] `]. ####Mean or median? diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode220.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode220.pg index 5f7a669800..4b172032b9 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode220.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode220.pg @@ -7,28 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('6.SP') -## DBsubject(Statistics) -## DBchapter(Exploratory data analysis/descriptive statistics) -## DBsection(Summary statistics) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('mean','median','application','bar graph','rounding') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "contextPercent.pl", +# "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -137,7 +141,8 @@ BEGIN_PGML Find the mean and median of the class's scores on this quiz. Round to two decimal places when needed. - The mean score was [___________]{$mean}, and the median score was [__________]{$median}. +a. The mean score was [___________]{$mean}. +a. The median score was [__________]{$median}. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode230.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode230.pg index 8bc9bf9ac6..25b545f754 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode230.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode230.pg @@ -7,7 +7,7 @@ ## DBchapter(Exploratory data analysis/descriptive statistics) ## DBsection(Summary statistics) ## Institution(PCC) -## Author(Carl Yao)Peter Staab) +## Author(Carl Yao, Peter Staab) ## Level(2) ## MO(1) ## KEYWORDS('mean','application','bar graph', 'DEI') @@ -219,7 +219,7 @@ $output1 = BEGIN_PGML_SOLUTION -####Question 1 +a. To find the mean number of commuter students in this class, we first add up the number of commuter students in all [`4`] terms: @@ -233,9 +233,7 @@ Now we can find the mean by dividing the sum by the number of terms ([`4`]): *Solution:* In these [`4`] terms, the mean number of commuter students in this class was [`[$meanA]`]. ----- - -####Question 2 +b. To find the mean number of residential students in this class, we first add up the number of residential students in all [`4`] terms: diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode30.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode30.pg new file mode 100644 index 0000000000..fb167f763a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode30.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean of some numbers. Some numbers are negative. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(3,6,1); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(-10,5,1); + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $nums[$i]>=0 ? $listAdd."$nums[$i]+" : $listAdd."($nums[$i])+"; + } + $mean = $sum/$dim; +} until (int($mean)==$mean); + +$listComma = substr($listComma,0,-5); +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The mean of this group of numbers is [___________]{$mean}. + + [`` [$listComma] ``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode40.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode40.pg new file mode 100644 index 0000000000..316aa83db9 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode40.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find mean of some numbers. Some numbers are negative decimals. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('mean') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(3,6,1); + +do { + @nums = (); + $sum=0; + $mean=0; + $listComma=""; + $listAdd=""; + for my $i (0..$dim-1) { + $nums[$i] = random(-10,5,1)+random(1,99,1)/100; + $sum = $sum + $nums[$i]; + $listComma = $listComma."$nums[$i],\;\;"; + $listAdd = $nums[$i]>=0 ? $listAdd."$nums[$i]+" : $listAdd."($nums[$i])+"; + } + $mean = $sum/$dim; +} until (int($mean*100)==$mean*100); + +$listComma = substr($listComma,0,-5); +chop($listAdd); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The mean of this group of numbers is [___________]{$mean}. + + [`` [$listComma] ``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the mean of a group of numbers, we first add up all numbers and find their sum: + + [`` \text{sum} = [$listAdd] = [$sum] ``] + +Next, we divide the sum by how many numbers there are: + + [`` \text{mean} = \frac{[$sum]}{[$dim]} = [$mean] ``] + +The mean of this group of numbers is [`[$mean]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode50.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode50.pg new file mode 100644 index 0000000000..e0ce3b5e97 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode50.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find median of some positive numbers. There are an odd number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(5,9,2); + +@nums = (); +$mean=0; +$listComma=""; +for my $i (0..$dim-1) { + $nums[$i] = random(1,20,1); + $listComma = $listComma."$nums[$i],\;\;"; +} + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$median = $ordered[int($dim/2)]; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The median of this group of numbers is [___________]{$median}. + + [`` [$listComma] ``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode60.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode60.pg new file mode 100644 index 0000000000..3700482029 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode60.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find median of some positive decimals. There are an odd number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +sub shuffle { + my $array = shift; + my $i; + for ($i = @$array; --$i; ) { + my $j = random(0,$i,1); + next if $i == $j; + @$array[$i,$j] = @$array[$j,$i]; + } +} + +###################################### + +Context("LimitedNumeric"); + +$dim = 7; + +@nums = (); +$listComma=""; + +$int = random(1,20,1); +$digit1 = random(1,9,1); +do {$digit2 = random(1,9,1);} until ($digit1!=$digit2); +$nums[0] = $int+list_random($digit1,$digit2)/10; +$nums[1] = $int+list_random($digit1,$digit2)/100; +$nums[2] = $int+list_random($digit1,$digit2)/10+list_random($digit1,$digit2)/100; +$nums[3] = $int+list_random($digit1,$digit2)/1000; +$nums[4] = $int+list_random($digit1,$digit2)/10+list_random($digit1,$digit2)/1000; +$nums[5] = $int+list_random($digit1,$digit2)/100+list_random($digit1,$digit2)/1000; +$nums[6] = $int+list_random($digit1,$digit2)/10+list_random($digit1,$digit2)/100+list_random($digit1,$digit2)/1000; + +shuffle(~~@nums); + +for my $i (0..$dim-1) { + $listComma = $listComma."$nums[$i]".",\;\;"; +} + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$median = $ordered[int($dim/2)]; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The median of this group of numbers is [___________]{$median}. + + [`` [$listComma] ``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode70.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode70.pg new file mode 100644 index 0000000000..82664fdc3a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode70.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find median of some positive and negative numbers. +# There are an odd number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(5,9,2); + +@nums = (); +$mean=0; +$listComma=""; +for my $i (0..$dim-1) { + $nums[$i] = random(-10,5,1); + $listComma = $listComma."$nums[$i],\;\;"; +} + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$median = $ordered[int($dim/2)]; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The median of this group of numbers is [___________]{$median}. + + [`` [$listComma] ``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode80.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode80.pg new file mode 100644 index 0000000000..cf8a211ba4 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode80.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find median of some positive numbers. There are an even number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +do { + +$dim = random(4,8,2); + +@nums = (); +$mean=0; +$listComma=""; +for my $i (0..$dim-1) { + $nums[$i] = random(1,20,1); + $listComma = $listComma."$nums[$i],\;\;"; +} + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$mid1 = $ordered[$dim/2-1]; +$mid2 = $ordered[$dim/2]; + +$median = ($mid1+$mid2)/2; + +} until ($median==int($median)); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The median of this group of numbers is [___________]{$median}. + + [`` [$listComma] ``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. In this case, there are two numbers in the middle: [` [$mid1],[$mid2] `]. The median is the average of these two numbers: + + [`` \text{median}=\frac{[$mid1]+[$mid2]}{2}=[$median] ``] + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode90.pg b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode90.pg new file mode 100644 index 0000000000..d4ca78015d --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MeanMedianMode/MeanMedianMode90.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find median of some positive decimals. There are an even number of numbers. +# +# Last updated: Yao, 12/01/2013 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') +## KEYWORDS('median') +## DBCCSS('6.SP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$dim = random(4,8,2); + +@nums = (); +$mean=0; +$listComma=""; +for my $i (0..$dim-1) { + $nums[$i] = random(1,20,1)+random(1,9,1)/10; + $listComma = $listComma."$nums[$i],\;\;"; +} + +$listOrdered = ""; +@ordered = num_sort(@nums); +foreach my $item (@ordered) { + $listOrdered = $listOrdered."$item".",\;\;"; +} + +$listComma = substr($listComma,0,-5); +$listOrdered = substr($listOrdered,0,-5); + +$mid1 = $ordered[$dim/2-1]; +$mid2 = $ordered[$dim/2]; + +$median = ($mid1+$mid2)/2; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +The median of this group of numbers is [___________]{$median}. + + [`` [$listComma] ``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the median of a list of number, we first need to order these numbers from smallest to largest: + + [`` [$listOrdered] ``] + +The number in the middle is the median. In this case, there are two numbers in the middle: [` [$mid1],[$mid2] `]. The median is the average of these two numbers: + + [`` \text{median}=\frac{[$mid1]+[$mid2]}{2}=[$median] ``] + +The median of this group of numbers is [` [$median] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger10.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger10.pg new file mode 100644 index 0000000000..6f348e30bf --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger10.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Expand a whole number like 123=100+20+3 +# +# +# Last updated: Yao 1/31/2017 +# ENDDESCRIPTION + +## DBCC('6.EE.1') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','operation','integer exponent','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->operators->redefine('+',using=>',',from=>'Numeric'); +Context()->operators->set('+'=>{string=>' + ',TeX=>'+'}); +Context()->lists->set(List => {separator => "+"}); +Context()->operators->undefine(','); + +@digits = ( ); +@answers = ( ); + +$num = 0; +for my $i (0..4) { + $digits[$i] = random(1,9,1); + $answers[$i] = $digits[$i]*10**$i; + $num += $answers[$i]; +} + +$ans = List($answers[4]); +for ($i=3;$i>=0;$i--) { + if ($digits[$i]!=0) { + $tempList = List($answers[$i]); + $ans = $ans + $tempList; + } +} + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Write the number [`[$num]`] in expanded form. Use the addition symbol to connect numbers. + + [``[$num]=``][________________________________]{$ans->cmp(showTypeWarnings=>0)} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +In expanded form, the number [`[$num]`] can be written as: + + [`` [$num]=[$ans] ``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger15.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger15.pg new file mode 100644 index 0000000000..6eae5f63eb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger15.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Expand a whole number like 123=100+20+3 +# +# +# Last updated: Yao 1/31/2017 +# ENDDESCRIPTION + +## DBCC('6.EE.1') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','operation','integer exponent','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->operators->redefine('+',using=>',',from=>'Numeric'); +Context()->operators->set('+'=>{string=>' + ',TeX=>'+'}); +Context()->lists->set(List => {separator => "+"}); +Context()->operators->undefine(','); + +@digits = ( ); +@answers = ( ); + +$num = 0; +for my $i (0..4) { + $digits[$i] = random(1,9,1); + $answers[$i] = $digits[$i]*10**$i; + $num += $answers[$i]; +} + +$zero = random(0,3,1); +$digits[$zero] = 0; +$num -= $answers[$zero]; +$answers[$zero] = 0; + +$ans = List($answers[4]); +for ($i=3;$i>=0;$i--) { + if ($digits[$i]!=0) { + $tempList = List($answers[$i]); + $ans = $ans + $tempList; + } +} + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Write the number [`[$num]`] in expanded form. Use the addition symbol to connect numbers. + + [``[$num]=``][________________________________]{$ans->cmp(showTypeWarnings=>0)} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +In expanded form, the number [`[$num]`] can be written as: + + [`` [$num]=[$ans] ``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger20.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger20.pg new file mode 100644 index 0000000000..1c8a4d46d6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger20.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Write an expanded number to its number form. +# +# +# Last updated: Yao 2/10/2017 +# ENDDESCRIPTION + +## DBCC('6.EE.1') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','operation','integer exponent','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->operators->redefine('+',using=>',',from=>'Numeric'); +Context()->operators->set('+'=>{string=>' + ',TeX=>'+'}); +Context()->lists->set(List => {separator => "+"}); +Context()->operators->undefine(','); + +@digits = ( ); +@answers = ( ); + +$num = 0; +for my $i (0..4) { + $digits[$i] = random(1,9,1); + $answers[$i] = $digits[$i]*10**$i; + $num += $answers[$i]; +} + +$ans = List($answers[4]); +for ($i=3;$i>=0;$i--) { + if ($digits[$i]!=0) { + $tempList = List($answers[$i]); + $ans = $ans + $tempList; + } +} + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A number's expanded form is [`[$ans]`]. Write this number's value. + + [``[$ans]=``][_________]{$num} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The number's value is: + + [`` [$ans]=[$num] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger25.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger25.pg new file mode 100644 index 0000000000..62bb9305a5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExpandInteger25.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Write an expanded number to its number form. +# +# +# Last updated: Yao 2/10/2017 +# ENDDESCRIPTION + +## DBCC('6.EE.1') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','operation','integer exponent','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->operators->redefine('+',using=>',',from=>'Numeric'); +Context()->operators->set('+'=>{string=>' + ',TeX=>'+'}); +Context()->lists->set(List => {separator => "+"}); +Context()->operators->undefine(','); + +@digits = ( ); +@answers = ( ); + +$num = 0; +for my $i (0..4) { + $digits[$i] = random(1,9,1); + $answers[$i] = $digits[$i]*10**$i; + $num += $answers[$i]; +} + +$zero = random(0,3,1); +$digits[$zero] = 0; +$num -= $answers[$zero]; +$answers[$zero] = 0; + +$ans = List($answers[4]); +for ($i=3;$i>=0;$i--) { + if ($digits[$i]!=0) { + $tempList = List($answers[$i]); + $ans = $ans + $tempList; + } +} + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +A number's expanded form is [`[$ans]`]. Write this number's value. + + [``[$ans]=``][_________]{$num} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The number's value is: + + [`` [$ans]=[$num] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition05.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition05.pg new file mode 100644 index 0000000000..744394d1a0 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition05.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# Evaluate exponent expressions. No negative numbers are involved. +# +# +# Last updated: Yao 02/25/2014 +# ENDDESCRIPTION + +## DBCC('6.EE.1') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','operation','integer exponent','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a = random(2,5,1); +$b = random(2,5,1); +while ($b==$a) {$b = random(2,5,1);} + +$ans1 = Compute(($a)**2); +$ans2 = Compute(($b)**3); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Evaluate the following expressions that have integer exponents: + +a. [`` [$a]^{2}= ``] [________]{$ans1} + +a. [`` [$b]^{3}= ``] [________]{$ans2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The answers can be computed as follows: + +a. + + [` + \begin{aligned}[t] + [$a]^{2}&=[$a]\cdot[$a]\\ + &=[$ans1] + \end{aligned}`] + +b. + + [` + \begin{aligned}[t] + [$b]^{3}&=[$b]\cdot[$b]\cdot[$b]\\ + &=[$ans2] + \end{aligned}`] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition15.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition15.pg new file mode 100644 index 0000000000..68add2c9f2 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition15.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Evaluate the following expressions that have integer exponents: +# +# 1^100, 0^50, 3^1 +# +# Last updated: Yao 02/26/2014 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','operation','integer exponents','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$a=random(10,20,1); +$b=random(30,40,1); +$c=random(12,18,2); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Evaluate the following expressions that have integer exponents: + +a. [`` 1^{[$a]}= ``] [________]{1} + +a. [`` 0^{[$b]}= ``] [________]{0} + +a. [`` [$c]^{1}= ``] [________]{$c} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The answers can be computed as follows: + +a. + + [`` \begin{aligned}[t] + 1^{[$a]}&=1\cdot1\cdot1\ldots\cdot1\\ + &=1\end{aligned} ``] + +b. + + [`` \begin{aligned}[t] + 0^{[$b]}&=0\cdot0\cdot0\ldots\cdot0\\ + &=0\end{aligned} ``] + +c. + + [`` \begin{aligned}[t] + [$c]^{1}&=[$c] \end{aligned} ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition40.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition40.pg new file mode 100644 index 0000000000..b7f79ae8f6 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition40.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Evaluate these expressions: (2/3)^2, (2/3)^3 +# +# Last updated: Yao 10/15/2013 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction','exponent','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +#Context()->flags->set(requirePureFractions=>1); +#Context()->flags->set(showMixedNumbers=>0); + +$den1=random(3,5,1); +do {$num1= random(2,$den1-1,1);} until (gcd($num1,$den1)==1); +$frac1=Fraction($num1,$den1); + +$ans1=Compute("($frac1)**2"); +$ans2=Compute("($frac1)**3"); + +Context("LimitedFraction"); +$ans1 = Compute($ans1); +$ans2 = Compute($ans2); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Evaluate the following expressions: + +a. [`` \left( [$frac1] \right) ^{2}= ``] [________]{$ans1} + +a. [`` \left( [$frac1] \right) ^{3}= ``] [________]{$ans2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +"A number to the second power" means the number is multiplied with itself. + +"A number to the third power" means the number is multiplied with itself three times. + +a. + [`` +\begin{aligned}[t] + \left( [$frac1] \right) ^{2} + & = \left( [$frac1] \right) \cdot \left( [$frac1] \right) \\ + & = \frac{[$num1] \cdot [$num1]}{[$den1] \cdot [$den1]} \\ + & = [$ans1] +\end{aligned}``] + +b. + [`` +\begin{aligned}[t] + \left( [$frac1] \right) ^{3} + & = \left( [$frac1] \right) \cdot \left( [$frac1] \right) \cdot \left( [$frac1] \right) \\ + & = \frac{[$num1] \cdot [$num1] \cdot [$num1]}{[$den1] \cdot [$den1] \cdot [$den1]} \\ + & = [$ans2] +\end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition50.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition50.pg new file mode 100644 index 0000000000..4d374df734 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ExponentDefinition50.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Evaluate these expressions: (-2/3)^2, (-2/3)^3 +# +# Last updated: Yao 10/15/2013 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction','exponent','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$den1=random(3,5,1); +do {$num1= random(2,$den1-1,1);} until (gcd($num1,$den1)==1); +$frac1=Fraction($num1,$den1); + +$ans1=Compute("(-$frac1)**2"); +$ans2=Compute("(-$frac1)**3"); + +Context("LimitedFraction"); +#Context()->flags->set(requirePureFractions=>1); +#Context()->flags->set(showMixedNumbers=>0); + +$ans1 = Compute($ans1); +$ans2 = Compute($ans2); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Evaluate the following expressions: + +a. [`` \left( -[$frac1] \right) ^{2}= ``] [________]{$ans1} + +a. [`` \left( -[$frac1] \right) ^{3}= ``] [________]{$ans2} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +"A number to the second power" means the number is multiplied with itself. + +"A number to the third power" means the number is multiplied with itself three times. + +a. + [`` +\begin{aligned}[t] + \left( -[$frac1] \right) ^{2} + & = \left( -[$frac1] \right) \cdot \left( -[$frac1] \right) \\ + & = \left( [$frac1] \right) \cdot \left( [$frac1] \right) & \text{Two negative signs canceled.} \\ + & = \frac{[$num1] \cdot [$num1]}{[$den1] \cdot [$den1]} \\ + & = [$ans1] +\end{aligned}``] + +b. + [`` +\begin{aligned}[t] + \left( -[$frac1] \right) ^{3} + & = \left( -[$frac1] \right) \cdot \left( -[$frac1] \right) \cdot \left( -[$frac1] \right) \\ + & = - \left( [$frac1] \right) \cdot \left( [$frac1] \right) \cdot \left( [$frac1] \right) & \text{Two negative signs canceled, but one is still left.} \\ + & = - \frac{[$num1] \cdot [$num1] \cdot [$num1]}{[$den1] \cdot [$den1] \cdot [$den1]} \\ + & = [$ans2] +\end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers10.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers10.pg new file mode 100644 index 0000000000..516b4fbb47 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers10.pg @@ -0,0 +1,124 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Read a whole number like 1,234,567 +# +# +# Last updated: Yao 2/10/2017 +# ENDDESCRIPTION + +## DBCC('6.EE.1') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','operation','integer exponent','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +@digits = ( ); +@ans = ( ); + +for my $i (0..3) { + $ans[$i] = ""; +} + +$num = ""; + +$digits[6] = random(1,9,1); +for my $i (0..2) { + $ans[$i] .= numberWord($digits[6]).' million '; +} +$ans[1] .= ' and '; +$num .= $digits[6].','; + +for (my $i=5; $i>=3; $i--) { + $digits[$i] = random(1,9,1); + $num .= $digits[$i]; +} +$num .= ','; +$ans[0] .= numberWord($digits[5]).' hundred '.numberWord(10*$digits[4]+$digits[3]).' thousand '; +$ans[1] .= numberWord($digits[5]).' hundred '.numberWord(10*$digits[4]+$digits[3]).' thousand and '; +$ans[2] .= numberWord($digits[5]).' hundred and '.numberWord(10*$digits[4]+$digits[3]).' thousand '; +$ans[3] .= numberWord($digits[6]).' thousand '.numberWord($digits[5]).' hundred '.numberWord(10*$digits[4]+$digits[3]).' thousand '; + +for (my $i=2; $i>=0; $i--) { + $digits[$i] = random(1,9,1); + $num .= $digits[$i]; +} +$ans[0] .= numberWord($digits[2]).' hundred '.numberWord(10*$digits[1]+$digits[0]); +$ans[1] .= numberWord($digits[2]).' hundred '.numberWord(10*$digits[1]+$digits[0]); +$ans[2] .= numberWord($digits[2]).' hundred and '.numberWord(10*$digits[1]+$digits[0]); +$ans[3] .= numberWord($digits[2]).' hundred '.numberWord(10*$digits[1]+$digits[0]); + + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +@answersShuffled = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; + $answersShuffled[$i] = $ans[$scramble{$i}]; +}; + +$correctAns = $answersShuffled[$inverse{0}]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + labels => "ABC", +); + +############################################## + +ANS( $radio->cmp() ); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +How to read the number [`[$num]`]? + + [@$radio->buttons()@]* + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The number [`[$num]`] reads: + + [$ans[0]] + +Note that we don't use the word "and" when we read whole numbers. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers20.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers20.pg new file mode 100644 index 0000000000..f9cdb46e33 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers20.pg @@ -0,0 +1,148 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Read a whole number like 1,204,067 +# +# +# Last updated: Yao 2/10/2017 +# ENDDESCRIPTION + +## DBCC('6.EE.1') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','operation','integer exponent','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +@digits = ( ); +@ans = ( ); + +for my $i (0..3) { + $ans[$i] = ""; +} + +$num = ""; + +$digits[6] = random(1,9,1); +for my $i (0..2) { + $ans[$i] .= numberWord($digits[6]).' million '; +} +$ans[1] .= ' and '; +$num .= $digits[6].','; + +for (my $i=5; $i>=3; $i--) { + $digits[$i] = random(1,9,1); + $num .= $digits[$i]; +} +$num .= ','; + +$zero = random(0,1,1); +if ($zero==0) { + $digits[5] = 0; + substr($num,2,1) = '0'; + $ans[0] .= numberWord(10*$digits[4]+$digits[3]).' thousand '; + $ans[1] .= numberWord(10*$digits[4]+$digits[3]).' thousand and '; + $ans[2] .= numberWord(10*$digits[4]+$digits[3]).' thousand '; + $ans[3] .= numberWord($digits[6]).' thousand '.numberWord(10*$digits[4]+$digits[3]).' thousand '; +} else { + $digits[4] = 0; + substr($num,3,1) = '0'; + $ans[0] .= numberWord($digits[5]).' hundred '.numberWord(10*$digits[4]+$digits[3]).' thousand '; + $ans[1] .= numberWord($digits[5]).' hundred '.numberWord(10*$digits[4]+$digits[3]).' thousand and '; + $ans[2] .= numberWord($digits[5]).' hundred and '.numberWord(10*$digits[4]+$digits[3]).' thousand '; + $ans[3] .= numberWord($digits[6]).' thousand '.numberWord($digits[5]).' hundred '.numberWord(10*$digits[4]+$digits[3]).' thousand '; +} + +for (my $i=2; $i>=0; $i--) { + $digits[$i] = random(1,9,1); + $num .= $digits[$i]; +} +if ($zero==0) { + $digits[1] = 0; + substr($num,-2,1) = '0'; + $ans[0] .= numberWord($digits[2]).' hundred '.numberWord($digits[0]); + $ans[1] .= numberWord($digits[2]).' hundred '.numberWord($digits[0]); + $ans[2] .= numberWord($digits[2]).' hundred and '.numberWord($digits[0]); + $ans[3] .= numberWord($digits[2]).' hundred '.numberWord($digits[0]); +} else { + $digits[2] = 0; + substr($num,-3,1) = '0'; + $ans[0] .= numberWord(10*$digits[1]+$digits[0]); + $ans[1] .= numberWord(10*$digits[1]+$digits[0]); + $ans[2] .= numberWord(10*$digits[1]+$digits[0]); + $ans[3] .= numberWord(10*$digits[1]+$digits[0]); +} + + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +@answersShuffled = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; + $answersShuffled[$i] = $ans[$scramble{$i}]; +}; + +$correctAns = $answersShuffled[$inverse{0}]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + labels => "ABC", +); + +############################################## + +ANS( $radio->cmp() ); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +How to read the number [`[$num]`]? + + [@$radio->buttons()@]* + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The number [`[$num]`] reads: + + [$ans[0]] + +Note that we don't use the word "and" when we read whole numbers. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers30.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers30.pg new file mode 100644 index 0000000000..be1f5eb35b --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers30.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Identify the digit in a certain place in 1,234,567 +# +# +# Last updated: Yao 2/12/2017 +# ENDDESCRIPTION + +## DBCC('6.EE.1') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','operation','integer exponent','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +@digits =(); +$num = ""; + +for my $i (0..9) {$digits[$i]=$i;} + +my $i = $#digits; +while ( --$i ) { + my $j = random(0,$i,1); + ($digits[$i],$digits[$j]) = ($digits[$j],$digits[$i]); +} +if ($digits[6]==0) { + ($digits[6],$digits[0]) = ($digits[0],$digits[6]); +} + +for (my $i=6; $i>=0; $i--){ + $num .= $digits[$i]; + if ( ($i==6) || ($i==3) ) { + $num .= ','; + } +} + +@names = ( + "the ones place", + "the tens place", + "the hundreds place", + "the thousands place", + "the ten thousands place", + "the hundred thousands place", + "the millions place", +); + +$chosen = random(0,6,1); + +my @ans; + +$ans[0] = $names[$chosen]; +$ans[1] = $names[($chosen+1)%6]; +$ans[2] = $names[($chosen-1)%6]; +$ans[3] = $names[($chosen+random(-2,2,4))%6]; + +#Create a hash and its inverse that randomizes the order of the four choices. +%scramble = (); +%inverse = (); +@answersShuffled = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; + $answersShuffled[$i] = $ans[$scramble{$i}]; +}; + +$correctAns = $answersShuffled[$inverse{0}]; + +$radio = RadioButtons( + ~~@answersShuffled, + $correctAns, # correct answer + labels => "ABC", +); + +############################################## + +ANS( $radio->cmp() ); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +In the number [`[$num]`], the digit [`[$digits[$chosen]]`] is in: + + [@$radio->buttons()@]* + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +In the number [`[$num]`], + + the digit [`[$digits[6]]`] is in [$names[6]], + + the digit [`[$digits[5]]`] is in [$names[5]], + + the digit [`[$digits[4]]`] is in [$names[4]], + + the digit [`[$digits[3]]`] is in [$names[3]], + + the digit [`[$digits[2]]`] is in [$names[2]], + + the digit [`[$digits[1]]`] is in [$names[1]], + + the digit [`[$digits[0]]`] is in [$names[0]]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers40.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers40.pg new file mode 100644 index 0000000000..6b0b30e023 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/ReadWholeNumbers40.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Identify the digit in a certain place in 1,234,567 +# +# +# Last updated: Yao 2/12/2017 +# ENDDESCRIPTION + +## DBCC('6.EE.1') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer','operation','integer exponent','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); + +@digits =(); +$num = ""; + +for my $i (0..9) {$digits[$i]=$i;} + +my $i = $#digits; +while ( --$i ) { + my $j = random(0,$i,1); + ($digits[$i],$digits[$j]) = ($digits[$j],$digits[$i]); +} +if ($digits[6]==0) { + ($digits[6],$digits[0]) = ($digits[0],$digits[6]); +} + +for (my $i=6; $i>=0; $i--){ + $num .= $digits[$i]; + if ( ($i==6) || ($i==3) ) { + $num .= ','; + } +} + +@names = ( + "the ones place", + "the tens place", + "the hundreds place", + "the thousands place", + "the ten thousands place", + "the hundred thousands place", + "the millions place", +); + +$place1 = random(0,6,1); +do {$place2 = random(0,6,1);} until ($place1 != $place2); + + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +In the number [`[$num]`]: + +a. The digit in [$names[$place1]] is [_______]{$digits[$place1]}, + +a. The digit in [$names[$place2]] is [_______]{$digits[$place2]}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +In the number [`[$num]`], + + the digit in [$names[6]] is [`[$digits[6]]`], + + the digit in [$names[5]] is [`[$digits[5]]`], + + the digit in [$names[4]] is [`[$digits[4]]`], + + the digit in [$names[3]] is [`[$digits[3]]`], + + the digit in [$names[2]] is [`[$digits[2]]`], + + the digit in [$names[1]] is [`[$digits[1]]`], + + the digit in [$names[0]] is [`[$digits[0]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/SquarePerimeterArea10.pg b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/SquarePerimeterArea10.pg new file mode 100644 index 0000000000..8c0b6a214c --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Miscellaneous/SquarePerimeterArea10.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find the perimeter and area of a square. +# +# Last edited by Carl Yao on 2/25/2014 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('area','perimeter','square') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$refreshCachedImages = 1; +Context("Numeric"); + +$base = random(5,15,1); +$height = $base; + +$xmin = 0; #The viewing window +$xmax = $base*240/120; +$ymin = 0; +$ymax = (120*$height/$base+30)*$height/(120*$height/$base); + +@x = (($xmax-$base)/2,($xmax+$base)/2); +@y = (($ymax-$height)/2,($ymax+$height)/2); + +$cornersize = $xmax*10/240; + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label(($x[0]+$x[1])/2, $y[0],"$base cm",'black','center','top','large')); +#$picture->lb( new Label($x[1]+1,($y[0]+$y[1])/2,"$height cm",'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[0], darkblue,3); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[1], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +foreach $i (0,1) { + foreach $j (0,1) { + +$picture->moveTo($x[$i]+(-1)**$i*$cornersize,$y[$j]); +$picture->lineTo($x[$i]+(-1)**$i*$cornersize,$y[$j]+(-1)**$j*$cornersize, darkblue,1); +$picture->lineTo($x[$i],$y[$j]+(-1)**$j*$cornersize, darkblue,1); +}} + + +$perimeter = 2*($base+$height); +$area = $base*$height; +$ansP = NumberWithUnits("$perimeter cm"); +$ansA = NumberWithUnits("$area cm^2"); +$baseWithUnit = NumberWithUnits("$base cm"); + +$alt = "a square with a base of $base cm"; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Find the perimeter and area of the square. + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$alt' title = '$alt' ") @]*<< + +a. The perimeter is [_]{$ansP}{5}. +a. The area is [_]{$ansA}{5}. + +[@KeyboardInstructions(q!(Use [|cm|]* for centimeters and [|cm^2|]* for square centimeters.)!)@]** + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We usually use the following formulas for squares: + + [` \text{square perimeter} = 4 \cdot \text{(side length)} `] + + [` \text{square area} = \text{(side length)}^{2} `] + +a. +For the given square, we have: + + [``\begin{aligned} + \text{square perimeter} + & = 4 \cdot \text{(side length)} \\ + & = 4 \cdot [$baseWithUnit] \\ + & = [$ansP] + \end{aligned}``] + +Don't forget the length unit [`\textrm{cm}`]. + +b. +Also, + [``\begin{aligned} + \text{square area} + & = \text{(side length)}^{2} \\ + & = ([$baseWithUnit])^{2} \\ + & = [$ansA] + \end{aligned}``] + +Don't forget the area unit [`\textrm{cm}^{2}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivideByZero10.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivideByZero10.pg index 74b3ae6a0b..4e905bc834 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivideByZero10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivideByZero10.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Integer division) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('evaluate','divide','zero') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,11 +58,10 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the following expressions. If the answer is undefined, type *DNE* (meaning "does not exist"). - -a) [`` [$frac0] = ``] [________]{$ans0} +Evaluate the following expressions. If the answer is undefined, you may answer with [|DNE|]* (meaning "does not exist"). +a. [`` [$frac0] = ``] [________]{$ans0} -b) [`` [$frac1] = ``] [________]{$ans1} +a. [`` [$frac1] = ``] [________]{$ans1} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivideTrailingZero10.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivideTrailingZero10.pg new file mode 100644 index 0000000000..8ecb758416 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivideTrailingZero10.pg @@ -0,0 +1,143 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# 140000/70 +# +# Last updated: Yao, 10/13/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('evaluate','multiply') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); +Context()->{format}{number} = "%u"; + +$b = random(2,9,1); +$a = $b*random(2,9,1); + + $a1Exp = random(1,4,1); + $a1Ten = 10**$a1Exp; + $a1 = $a*$a1Ten; + $b1 = $b; + $ans1 = $a1/$b1; + $ans1 = Compute("$ans1"); + +$d = random(2,9,1); +$c = $d*random(2,9,1); + + $a2Exp = random(3,5,1); + $a2Ten = 10**$a2Exp; + $b2Exp = random(1,$a2Exp-1,1); + $b2Ten = 10**$b2Exp; + $a2 = $c*$a2Ten; + $b2 = $d*$b2Ten; + $ans2 = $a2/$b2; + $ans2 = Compute("$ans2"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Do the following division problems without using a calculator. + +a. [`` [$a1] \div [$b1] = ``] [________]{$ans1} + +a. [`` [$a2] \div [$b2] = ``] [________]{$ans2} + +END_PGML + +############################################## + +$s1 = $a2/10**$b2Exp; +$s2 = $b2/10**$b2Exp; +$s3 = 10**$a1Exp; +$s4 = $a/$b; + +$s5 = 10**$a2Exp; +$s6 = 10**$b2Exp; +$s7 = 10**($a2Exp-$b2Exp); + +$zeroText1 = ($a1Exp==1) ? "zero" : "zeroes"; +$itOrThem = ($a1Exp==1) ? "it" : "them"; +$zeroText2 = ($b2Exp==1) ? "zero" : "zeroes"; + + +BEGIN_PGML_SOLUTION + +*Part 1:* When the number being divided has trailing zeroes, we can ignore them, do the division, and then add back those zeroes. + +[`[$a1]`] has [`[$a1Exp]`] trailing [$zeroText1]. We can ignore [$itOrThem], and simply do [`[$a]\div[$b]=[$a/$b]`] first. + +Then, we add back [`[$a1Exp]`] [$zeroText1], and the answer is [`[$a1]\div[$b1]=[$ans1]`]. + +*Part 2:* When we do division of numbers with trailing zeroes, we can cross out the same number of zeroes from those two numbers, and then do the division. + +[`[$a2]`] has [`[$a2Exp]`] trailing zeroes, and [`[$b2]`] has [`[$b2Exp]`] trailing [$zeroText2]. We will cross out [`[$b2Exp]`] trailing [$zeroText2], and do: + + [`` +\begin{aligned} + [$a2]\div[$b2] &= [$s1] \div [$s2] \\ + &= [$ans2] +\end{aligned} + ``] + +*More Explanations of Part 1:* First, we need to understand that division and fraction line are the same operation. For example, [`6 \div 2 = 3`], while [`\frac{6}{2}=3`]. + +The number [`[$a1]`] can be viewed as [`[$a]\cdot[$s3]`]. When we do [`[$a1]\div[$b1]`], we can do: + + [`` +\begin{aligned} + [$a1]\div[$b1] &= \frac{[$a1]}{[$b1]} \\ + &= \frac{[$a] \cdot [$s3]}{[$b1]} \\ + &= \frac{[$a]}{[$b1]} \cdot [$s3] \\ + &= [$s4] \cdot [$s3] \\ + &= [$ans1] +\end{aligned} + ``] + +*More Explanations of Part 2:* + + [`` +\begin{aligned} + [$a2]\div[$b2] &= \frac{[$a2]}{[$b2]} \\ + &= \frac{[$a] \cdot [$s5]}{[$b] \cdot [$s6]} \\ + &= \frac{[$a]}{[$b]} \cdot \frac{[$s5]}{[$s6]} \\ + &= [$s4] \cdot [$s7] \\ + &= [$ans2] +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionEstimation10.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionEstimation10.pg new file mode 100644 index 0000000000..c07ab87048 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionEstimation10.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the quotient for 2390/76 +# +# Last edited: Carl Yao 10/13/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('divide','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +Context()->{format}{number} = "%u"; + +$a = random(3,9,1); +$b = random(5,9,1); + +$a1Exp = random(2,4,1); +$a1Ten = 10**$a1Exp; +$a1 = $a*$a1Ten*$b; +$a1Close = $a1+10**($a1Exp-1)*non_zero_random(-2,2,1)+10**($a1Exp-2)*non_zero_random(-2,2,1); + +$ans1 = $a1/$b; + +$c = random(3,9,1); +$d = random(5,9,1); + +$a2Exp = random(2,4,1); +$a2Ten = 10**$a2Exp; +$b2Exp = random(2,4,1); +$b2Ten = 10**$b2Exp; + +$a2 = $c*$a2Ten*$d*$b2Ten; +$a2Close = $a2+10**($a2Exp+$b2Exp-1)*non_zero_random(-2,2,1)+10**($a2Exp+$b2Exp-2)*non_zero_random(-2,2,1); + +$b2 = $d*$b2Ten; +$b2Close = $b2+10**($b2Exp-1)*non_zero_random(-2,2,1)+10**($b2Exp-2)*non_zero_random(-2,2,1); + +$ans2 = $a2/$b2; + +##################################################### + +BEGIN_PGML + +Without using a calculator, round numbers until the calculation is easy, and then estimate the quotient. + +a. [`` [$a1Close] \div [$b] \approx``] [_______]{$ans1} + +a. [`` [$a2Close] \div [$b2Close] \approx``] [_______]{$ans2} + +END_PGML + +############################################################ + +$s1 = $a2/$b2Ten; +$s2 = int($a1Close/10**$a1Exp); +$s3 = $a*$b; + +$s4 = int($a2Close/10**($a2Exp+$b2Exp)); +$s5 = $c*$d; + +BEGIN_PGML_SOLUTION + +*Part a:* We will look at the first two digit of [`[$a1Close]`], which is [`[$s2]`]. We will find a multiple of [`[$b]`] which is close to [`[$s2]`], and that number is [`[$s3]`]. This is why we will round [`[$a1Close]`] to [`[$a1]`]. + + [`` +\begin{aligned} + [$a1Close] \div [$b] &\approx [$a1] \div [$b] \\ + &= [$ans1] +\end{aligned} + ``] + +*Part b:* We will first round [`[$b2Close]`] to [`[$b2]`]. Ignore trailing zeroes, we will simply look at the number [`[$d]`]. + +We look at the first two digit of [`[$a2Close]`], which is [`[$s4]`]. We will find a multiple of [`[$d]`] which is close to [`[$s4]`], and that number is [`[$s5]`]. This is why we will round [`[$a2Close]`] to [`[$a2]`]. + + [`` +\begin{aligned} + [$a2Close] \div [$b2Close] &\approx [$a2] \div [$b2] \\ + &= \frac{[$a2]}{[$b2]} \\ + &= \frac{[$s1]}{[$d]} \\ + &= [$ans2] +\end{aligned} + ``] + + + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem10.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem10.pg index eb6e96c2c7..af2ccc7d5e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem10.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionWordProblems) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## @@ -46,7 +49,7 @@ BEGIN_PGML In a class, the teacher will hand out a total of [`[$product]`] marbles to all his [`[$numStudents]`] students evenly. How many marbles will each student receive? -Solution: Each student will receive [_______]{$each} marbles. +Each student will receive [_______]{$each} marbles. END_PGML @@ -58,7 +61,7 @@ Division is used when we divide a number of objects evenly into groups. In this [`` [$product] \div [$numStudents] = [$each] ``] -*Solution:* Each student will receive [`[$each]`] marbles. +Each student will receive [`[$each]`] marbles. We should get used to using the fraction line instead of the division symbol: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem100.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem100.pg index 2f06736fef..05d4f3b3c0 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem100.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem100.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionWordProblems) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -47,7 +49,7 @@ BEGIN_PGML An archeology team is studying a buried city. The team can cover [`[$rate]`] square meters every day. The whole area covers about [`[$total]`] square meters. How many days will it take the team to complete studying the whole area? -Solution: It would take the team [____________]{$days} days to cover the whole area. +It would take the team [____________]{$days} days to cover the whole area. END_PGML @@ -59,7 +61,7 @@ We can address this problem as "repeatedly taking away [`[$rate]`] square meters [`` [$total] \div [$rate] = [$days] ``] -*Solution:* It would take the team [`[$days]`] days to cover the whole area. +It would take the team [`[$days]`] days to cover the whole area. We should get used to using the fraction line instead of the division symbol: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem110.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem110.pg index b50e779af9..a30084bc18 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem110.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem110.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionWordProblems) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -47,7 +49,7 @@ BEGIN_PGML One piece of paper is approximately [`[$each]`] millimeters in thickness. A stack of paper is [`[$total]`] millimeters tall. About how many pieces of paper are there in the stack? -Solution: There are about [_________]{$pieces} pieces of paper in the stack. +There are about [_________]{$pieces} pieces of paper in the stack. END_PGML @@ -59,7 +61,7 @@ We can address this problem as "how many [`[$each]`] millimeters are there in [` [`` [$total] \div [$each] = [$pieces] ``] -*Solution:* There are about [`[$pieces]`] pieces of paper in the stack. +There are about [`[$pieces]`] pieces of paper in the stack. We should get used to using the fraction line instead of the division symbol: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem20.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem20.pg index 87d694a0a0..340083d5b7 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem20.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## @@ -45,7 +49,7 @@ BEGIN_PGML For an activity in a class, each student will use [`[$each]`] marbles. The teacher purchased a total of [`[$product]`] marbles for his class. How many students are there in this class? -Solution: There are [__________]{$numStudents} students in this class. +There are [__________]{$numStudents} students in this class. END_PGML @@ -57,7 +61,7 @@ Division is used when we divide a number of objects evenly into groups. In this [`` [$product] \div [$each] = [$numStudents] ``] -*Solution:* There are [`[$numStudents]`] students in this class. +There are [`[$numStudents]`] students in this class. We should get used to using the fraction line instead of the division symbol: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem30.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem30.pg index af9aef0590..df6e53cd60 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem30.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionWordProblems) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -61,7 +63,7 @@ BEGIN_PGML [$name] saved [`[$totalU]`], and will start spending [$possessive] money on Lego figures. Each week, [$name] will spend [`[$weeklySpendingU]`] to buy a Lego figure. In how many weeks will [$name] have spent all [$possessive] money? -Solution: [$name] will have spent all [$possessive] money in [__________]{$weeks} weeks. +[$name] will have spent all [$possessive] money in [__________]{$weeks} weeks. END_PGML @@ -75,7 +77,7 @@ We could do this problem by subtracting [`[$weeklySpendingU]`] repeatedly from [ [`` [$total] \div [$weeklySpending] = [$weeks] ``] -*Solution:* [$name] will spend all [$possessive] money in [`[$weeks]`] weeks. +[$name] will spend all [$possessive] money in [`[$weeks]`] weeks. We should get used to using the fraction line instead of the division symbol: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem40.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem40.pg index 4c89302f01..625beff77b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem40.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionWordProblems) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -57,7 +59,7 @@ BEGIN_PGML [$name] just bought a total of [`[$total]`] movies. [@ucfirst($pronoun)@] will watch [`[$weekly]`] movies every week. In how many weeks will [$name] finish watching all the movies? -Solution: [$name] will finish watching all movies in [__________]{$weeks} weeks. +[$name] will finish watching all movies in [__________]{$weeks} weeks. END_PGML @@ -71,7 +73,7 @@ We could do this problem by subtracting [`[$weekly]`] repeatedly from [`[$total] [`` [$total] \div [$weekly] = [$weeks] ``] -*Solution:* [$name] will finish watching all the movies in [`[$weeks]`] weeks. +[$name] will finish watching all the movies in [`[$weeks]`] weeks. We should get used to using the fraction line instead of the division symbol: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem50.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem50.pg index 3785cdad3d..057e6ce893 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem50.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionWordProblems) -## MLTleader(1) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" ); ############################################## @@ -60,9 +61,9 @@ TEXT(beginproblem()); BEGIN_PGML -[$name] drove a total of [`[$totalU]`] in [`[$hoursU]`] at a constant speed. What was [$name]'s speed in miles per hour? +[$name] drove a total of [`[$totalU]`] in [`[$hoursU]`]. What was [$name]'s speed in miles per hour? -Solution: [$name] drove at the speed of [___________]{$speedU}. +[$name] drove at the speed of [___________]{$speedU}. Use *mi* for miles, *hr* for hours, and *mi/hr* for miles per hour. @@ -76,7 +77,7 @@ Division is used when we need to find speed. In this problem, the speed is the n [`` [$total] \div [$hours] = [$speed] ``] -*Solution:* [$name] drove at the speed of [`[$speedU]`]. +[$name] drove at the speed of [`[$speedU]`]. We should get used to using the fraction line instead of the division symbol: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem52.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem52.pg index 3caeca130d..097ba12223 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem52.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem52.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionWordProblems) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" ); ############################################## @@ -61,7 +63,7 @@ BEGIN_PGML [$name] drove [`[$totalU]`] at a constant speed of [`[$speedU]`]. How many hours did [$name] drive? In your answer, use *mi* for miles, *hr* for hours, and *mi/hr* for miles per hour. -[$name] drove for [___________]{$hoursU}. + [$name] drove for [___________]{$hoursU}. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem60.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem60.pg index 6be7b97379..d3fcb6c44f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem60.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionWordProblems) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" ); ############################################## @@ -52,7 +54,7 @@ BEGIN_PGML A tank can drain [`[$totalU]`] (liters) of water in [`[$minutesU]`] minutes. How many liters of water does the tank drain per minute? -Solution: The tank drains water at the rate of [____________]{$rateU}. +The tank drains water at the rate of [____________]{$rateU}. Use *L* for liters, *min* for minutes, and *L/min* for liters per minute. @@ -66,7 +68,7 @@ Division is used when we need to find the rate of change. In this problem, the r [`` [$total] \div [$minutes] = [$rate] ``] -*Solution:* The tank drains water at the rate of [`[$rateU]`]. +The tank drains water at the rate of [`[$rateU]`]. We should be used to using the fraction line instead of the division symbol: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem62.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem62.pg index b816f09aa3..79d4dee770 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem62.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem62.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionWordProblems) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" ); ############################################## @@ -52,7 +54,7 @@ BEGIN_PGML A tank drains [`[$rate]`] liters of water per minute. How many minutes does it take to drain [`[$totalU]`] (liters) of water? -Solution: It takes [____________]{$minutesU} to drain [`[$totalU]`] of water. +It takes [____________]{$minutesU} to drain [`[$totalU]`] of water. Use *L* for liters, *min* for minutes, and *L/min* for liters per minute. @@ -66,7 +68,7 @@ We can address this problem as "repeatedly taking away [`[$rate]`] liters of wat [`` [$total] \div [$rate] = [$minutes] ``] -*Solution:* It takes [`[$minutesU]`] to drain [`[$totalU]`] of water. +It takes [`[$minutesU]`] to drain [`[$totalU]`] of water. We should get used to using the fraction line instead of the division symbol: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem70.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem70.pg index 545a31af9b..07fa85ba06 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem70.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionWordProblems) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,7 +49,7 @@ BEGIN_PGML A queen termite produces [`[$numPerWeek]`] eggs every week. How many eggs does the queen produce every minute? -*Solution:* The queen termite produces [__________]{$numPerMinute} eggs every minute. +The queen termite produces [__________]{$numPerMinute} eggs every minute. END_PGML @@ -61,7 +63,7 @@ There are [`24`] hours in a day, so the queen termite can produce [` [$numPerDay There are [`60`] minutes in an hour, so the queen termite can produce [` [$numPerHour] \div 60 = [$numPerMinute] `] eggs every minute. -*Solution:* The queen termite can produce [` [$numPerMinute] `] eggs every minute. +The queen termite can produce [` [$numPerMinute] `] eggs every minute. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem80.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem80.pg index 4414380bb4..cddcd5521c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem80.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -57,7 +60,7 @@ BEGIN_PGML [$name] is a star player in [$possessive] basketball team. Last season, [$name] scored a total of [`[$totalPoints]`] points in the whole season. The season had a total of [`[$numGamesTotal]`] games, but [$name] missed [`[$numGamesMissed]`] games. On average, how many points did [$name] score in each game? -*Solution:* On average, [$name] scored [___________]{$numPerGame} points in each game. +On average, [$name] scored [___________]{$numPerGame} points in each game. END_PGML @@ -71,7 +74,7 @@ It's given [$name] scored a total of [`[$totalPoints]`] points in the season. To [`` [$totalPoints] \div [$numGamesPlayed] = [$numPerGame]``] -*Solution:* On average, [$name] scored [`[$numPerGame]`] points in each game. +On average, [$name] scored [`[$numPerGame]`] points in each game. We could have done this problem with one math expression: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem90.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem90.pg index 65b1e79d72..073f334e6c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/DivisionWordProblem90.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionWordProblems) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -47,7 +49,7 @@ BEGIN_PGML A team is climbing a mountain, which is [`[$total]`] meters high. The team plans to climb [`[$rate]`] meters every day. How many days would it take the team to climb to the top? -Solution: It would take the team [____________]{$days} days to climb to the top. +It would take the team [____________]{$days} days to climb to the top. END_PGML @@ -59,7 +61,7 @@ We can address this problem as "repeatedly taking away [`[$rate]`] meters from [ [`` [$total] \div [$rate] = [$days] ``] -*Solution:* It would take the team [`[$days]`] days to climb to the top. +It would take the team [`[$days]`] days to climb to the top. We should get used to using the fraction line instead of the division symbol: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationEstimation10.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationEstimation10.pg new file mode 100644 index 0000000000..655087f86a --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationEstimation10.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Estimate the product of multiplication like 2856*4 +# +# Last edited: Carl Yao 10/13/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Exponents and Radicals') +## KEYWORDS('multiply','estimate') +## DBCCSS('8.EE') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "PGcourse.pl", +); + +###################################### + +TEXT(beginproblem()); +Context("Numeric"); +Context()->{format}{number} = "%u"; + +$a = random(2,9,1); +$b = random(2,7,1); + +$a1Exp = random(2,4,1); +$a1Ten = 10**$a1Exp; +$a1 = $a*$a1Ten; +$a1Close = $a1+10**($a1Exp-1)*non_zero_random(-2,2,1)+10**($a1Exp-2)*non_zero_random(-2,2,1); + +$ans1 = $a1*$b; +$ans2 = int($a1Close/10**($a1Exp-1)+0.5)*10**($a1Exp-1)*$b; + +@estimates1 = ($ans1,$ans2); +$answer1=OneOf(@estimates1); + +$c = random(2,9,1); +$d = random(2,7,1); + +$a2Exp = random(2,4,1); +$a2Ten = 10**$a2Exp; +$a2 = $c*$a2Ten; +$a2Close = $a2+10**($a2Exp-1)*non_zero_random(-2,2,1)+10**($a2Exp-2)*non_zero_random(-2,2,1); + +$b2Exp = random(2,4,1); +$b2Ten = 10**$b2Exp; +$b2 = $d*$b2Ten; +$b2Close = $b2+10**($b2Exp-1)*non_zero_random(-2,2,1)+10**($b2Exp-2)*non_zero_random(-2,2,1); + +$ans3 = $a2*$b2; +$ans4 = int($a2Close/10**($a2Exp-1)+0.5)*10**($a2Exp-1)*$b2; +$ans5 = int($b2Close/10**($b2Exp-1)+0.5)*10**($b2Exp-1)*$a2; + +@estimates2 = ($ans3,$ans4,$ans5); +$answer2=OneOf(@estimates2); + +##################################################### + +BEGIN_PGML + +Without using a calculator, round the first number to a number easier to calculate, and then estimate the product. + +a. [`` [$a1Close] \cdot [$b] \approx``] [_______]{$answer1} + +a. [`` [$a2Close] \cdot [$b2Close] \approx``] [_______]{$answer2} + +END_PGML + +############################################################ + +BEGIN_PGML_SOLUTION + +*Part a:* + [`` +\begin{aligned} + [$a1Close] \cdot [$b] &\approx [$a1] \cdot [$b] \\ + &= [$ans1] +\end{aligned} + ``] + +*Part b:* + [`` +\begin{aligned} + [$a2Close] \cdot [$b2Close] &\approx [$a2] \cdot [$b2] \\ + &= [$ans3] +\end{aligned} + ``] + + + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem10.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem10.pg index b06ac4b030..c90fb5a72e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem10.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## MLT(IntegerMultiplicationApp) -## MLTleader(1) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('multiplication','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## @@ -61,7 +63,7 @@ It's easier to use multiplication: [`` [$each] \cdot [$numStudents] = [$product] ``] -*Solution:* The teacher handed out a total of [`[$product]`] marbles. +The teacher handed out a total of [`[$product]`] marbles. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem20.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem20.pg index 4064271d9b..5abcff9bba 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem20.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('multiplication','application') -## MLTleader(1) -## MLT(arithmetic_decimal_application_saving_money) +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -77,7 +78,7 @@ It's easier to use multiplication: [`` [$unitPriceU] \cdot [$num] = [$productU] ``] -*Solution:* To buy [`[$num]`] Lego figures, [$name] needs to save [`[$productU]`]. +To buy [`[$num]`] Lego figures, [$name] needs to save [`[$productU]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem30.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem30.pg index 0954078cdb..86beb092aa 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem30.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('multiplication','application') -## MLT(arithmetic_decimal_application_saving_money) +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -26,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -94,7 +97,7 @@ Finally, the total cost of Smurf and SpongeBob action figures is: [`` [$productSmurfU] + [$productSpongeU] = [$totalU] ``] -*Solution:* To buy [`[$numSmurf]`] Smurf action figures and [`[$numSponge]`] SpongeBob action figures, [$name] needs to save [`[$totalU]`]. +To buy [`[$numSmurf]`] Smurf action figures and [`[$numSponge]`] SpongeBob action figures, [$name] needs to save [`[$totalU]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem40.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem40.pg index be55e6eea5..aeb0c5f0f6 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem40.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('multiplication','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -76,7 +79,7 @@ BEGIN_PGML In total, how many minutes of [$event] will [$name] play in [`[$weeks]`] weeks? -Solution: [$name] will play [_______]{$minutesTotal} minutes of [$event] in [`[$weeks]`] weeks. +[$name] will play [_______]{$minutesTotal} minutes of [$event] in [`[$weeks]`] weeks. END_PGML @@ -88,7 +91,7 @@ We won't need to use all given numbers, as the question only asks for the number [`` [$minutesWeekly] \cdot [$weeks] = [$minutesTotal] ``] -*Solution:* [$name] plays a total of [`[$minutesTotal]`] minutes of [$event] in [`[$weeks]`] weeks. +[$name] plays a total of [`[$minutesTotal]`] minutes of [$event] in [`[$weeks]`] weeks. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem50.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem50.pg index f8a4688df8..8feddf5ce2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem50.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(MultiplicationMultiStep) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('multiplication','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -53,7 +55,7 @@ BEGIN_PGML How many pages will [$name2] read in [`[$days]`] days? -Solution: [$name2] will read [_______]{$total} pages in [`[$days]`] days. +[$name2] will read [_______]{$total} pages in [`[$days]`] days. END_PGML @@ -67,7 +69,7 @@ To find the total number of pages [$name2] reads in [`[$days]`] days, we do mult [`` [$pages1+$more] \cdot [$days] = [$total] ``] -*Solution:* [$name2] will read a total of [`[$total]`] pages in [`[$days]`] days. +[$name2] will read a total of [`[$total]`] pages in [`[$days]`] days. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem60.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem60.pg index c7432fd9bf..df444d1879 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem60.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(MultiplicationMultiStep) -## MLTleader(1) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('multiplication','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -54,7 +55,7 @@ BEGIN_PGML How many *more* pages will [$name2] read than [$name1] in [`[$days]`] days? -Solution: [$name2] will read [_______]{$totalMore} more pages than [$name1] in [`[$days]`] days. +[$name2] will read [_______]{$totalMore} more pages than [$name1] in [`[$days]`] days. END_PGML @@ -66,7 +67,7 @@ It's given that [$name2] reads [`[$more]`] more pages than [$name1] every day. T [`` [$more] \cdot [$days] = [$totalMore] ``] -*Solution:* [$name2] will read a total of [`[$totalMore]`] more pages than [$name1] in [`[$days]`] days. +[$name2] will read a total of [`[$totalMore]`] more pages than [$name1] in [`[$days]`] days. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem70.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem70.pg index 541561687d..9b93c3036b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem70.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(IntegerMultiplicationApp) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('multiplication','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,7 +49,7 @@ BEGIN_PGML A queen termite produces [`[$numPerMinute]`] eggs every minute. How many eggs does the queen produce every week? -*Solution:* The queen termite produces [__________]{$numPerWeek} eggs every week. +The queen termite produces [__________]{$numPerWeek} eggs every week. END_PGML @@ -61,7 +63,7 @@ There are [`24`] hours in a day, so the queen termite can produce [` [$numPerHou There are [`7`] days in a week, so the queen termite can produce [` [$numPerDay] \cdot 7 = [$numPerWeek] `] eggs in a week. -*Solution:* The queen termite can produce [` [$numPerWeek] `] eggs in a week. +The queen termite can produce [` [$numPerWeek] `] eggs in a week. We could have done this problem in one line: @@ -71,3 +73,4 @@ END_PGML_SOLUTION ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem80.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem80.pg index a2c7a0de9b..f624a2213b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem80.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(MultiplicationMultiStep) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('multiplication','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -56,9 +58,9 @@ TEXT(beginproblem()); BEGIN_PGML -[$name] is a star player in [$possessive] basketball team. Last season, [$name] scored an average of [`[$numPerGame]`] points per game. The season had a total of [`[$numGamesTotal]`] games, but [$name] missed [`[$numGamesMissed]`] games. How many points did [$name] score in total last season? +[$name] plays in [$possessive] school's basketball team. Last season, [$name] scored an average of [`[$numPerGame]`] points per game. The season had a total of [`[$numGamesTotal]`] games, but [$name] missed [`[$numGamesMissed]`] games. How many points did [$name] score in total last season? -*Solution:* [$name] scored a total of [___________]{$totalPoints} points last season. +[$name] scored a total of [___________]{$totalPoints} points last season. END_PGML @@ -72,7 +74,7 @@ On average, [$name] scored [`[$numPerGame]`] points per game. To find the total [`` [$numPerGame] \cdot [$numGamesPlayed] = [$totalPoints] ``] -*Solution:* [$name] scored a total of [`[$totalPoints]`] points last season. +[$name] scored a total of [`[$totalPoints]`] points last season. We could have done this problem with one math expression: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem90.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem90.pg index 7a4a3156be..5843ec5cf4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplicationWordProblem90.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('multiplication','application') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" ); ############################################## @@ -64,7 +67,7 @@ BEGIN_PGML A city holds a walking competition [$numGamesOutput] per month. The competition covers [`[$kmPerEventU]`] (kilometers). [$name] completed each event in the past [`[$years]`] years. How many total kilometers did [$name] walk in this event in the past [`[$years]`] years? -*Solution:* [$name] walked a total of [___________]{$kmTotalU} in this event in the past [`[$years]`] years. +[$name] walked a total of [___________]{$kmTotalU} in this event in the past [`[$years]`] years. Use *km* for kilometers. @@ -80,7 +83,7 @@ The city holds the competition [`[$numGamesPerMonth]`] times per month. This imp [`` [$kmPerEvent] \cdot [$numGamesTotal] = [$kmTotal] ``] -*Solution:* [$name] walked a total of [`[$kmTotalU]`] in this event in the past [`[$years]`] years. +[$name] walked a total of [`[$kmTotalU]`] in this event in the past [`[$years]`] years. We could have done this problem in one line: diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplyTrailingZero10.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplyTrailingZero10.pg new file mode 100644 index 0000000000..fd1a51befc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/MultiplyTrailingZero10.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# 70*40 +# +# Last updated: Yao, 10/13/2016 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('evaluate','multiply') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); +Context()->{format}{number} = "%u"; + +$a = random(2,9,1); +$b = random(2,9,1); + +do { + $a1Exp = random(1,4,1); + $a1Ten = 10**$a1Exp; + $b1Exp = random(1,4,1); + $b1Ten = 10**$b1Exp; + $a1 = $a*$a1Ten; + $b1 = $b*$b1Ten; + $ans1 = $a1*$b1; + $ans1 = Compute("$ans1"); + + $a2Exp = random(1,4,1); + $a2Ten = 10**$a2Exp; + $b2Exp = random(1,4,1); + $b2Ten = 10**$b2Exp; + $a2 = $a*$a2Ten; + $b2 = $b*$b2Ten; + $ans2 = $a2*$b2; + $ans2 = Compute("$ans2"); +} until ( ($a1!=$a2) || ($b1!=$b2) ); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Do the following multiplication problems without using a calculator. + +a. [`` [$a1] \cdot [$b1] = ``] [________]{$ans1} + +a. [`` [$a2] \cdot [$b2] = ``] [________]{$ans2} + +END_PGML + +############################################## + +$zeroText1 = ($a1Exp==1) ? "zero" : "zeroes"; +$zeroText2 = ($b1Exp==1) ? "zero" : "zeroes"; + +BEGIN_PGML_SOLUTION + +*Shortcut:* We can ignore trailing zeroes in each number, do the multiplication, and then add the number of trailing zeroes to the product. + +[`[$a1]`] has [`[$a1Exp]`] trailing [$zeroText1], and [`[$b1]`] has [`[$b1Exp]`] trailing [$zeroText2]. Altogether, they have [`[$a1Exp+$b1Exp]`] trailing zeroes. + +We will ignore those trailing zeroes, and do [`[$a]\cdot[$b]=[$a*$b]`]. + +Next, we will add back [`[$a1Exp+$b1Exp]`] trailing zeroes, and the answer is [`[$a1]\cdot[$b1]=[$ans1]`]. + +Similarly, the second problem has a total of [`[$a2Exp+$b2Exp]`] trailing zeroes, so the answer is [`[$a2]\cdot[$b2]=[$ans2]`]. + +*More Explanations:* For a number with trailing zeroes, we can understand the number as the non-zero part and the zero part. For example: + + [`` [$a1] = [$a] \cdot [$a1Ten] ``] + + [`` [$b1] = [$b] \cdot [$b1Ten] ``] + +For Problem 1, we have: + + [`` +\begin{aligned} + [$a1] \cdot [$b1] &= [$a]\cdot[$a1Ten]\cdot[$b]\cdot[$b1Ten] \\ + &= [$a]\cdot[$b]\cdot[$a1Ten]\cdot[$b1Ten] \\ + &=[$a*$b]\cdot[$a1Ten*$b1Ten] \\ + &=[$ans1] +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem10.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem10.pg index 648a3680ce..41dbb63040 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem10.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionAppWithRemainder) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application','remainder') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## @@ -47,7 +50,6 @@ BEGIN_PGML In a class, the teacher will hand out [`[$total]`] marbles to all his [`[$numStudents]`] students evenly. How many marbles will each student receive? How many marbles will be left over? -*Solution:* Each student will receive [_______]{$each} marbles. @@ -88,7 +90,6 @@ We can re-write the division equation as: The character *R* represents "remainder". -*Solution:* Each student will receive [`[$each]`] marbles. diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem20.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem20.pg index 73bcccee7b..9272d150ab 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem20.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionAppWithRemainder) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application','remainder') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -103,7 +105,6 @@ Now we can rewrite the division expression as: [`` [$total] \div [$weeklySpending] = [$weeks] \text{ R } [$remainder] ``] -*Solution:* [$name] can spend money this way for [`[$weeks]`] weeks. diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem30.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem30.pg index 2550fd3939..78c63408ec 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem30.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionAppWithRemainder) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application','remainder') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## @@ -48,7 +51,7 @@ BEGIN_PGML A school is planning for a field trip for [`[$total]`] students and staff. Each school bus can hold [`[$each]`] people. How many school buses are needed? -*Solution:* [______]{$busesNeeded} school buses are needed. +[______]{$busesNeeded} school buses are needed. END_PGML @@ -74,7 +77,7 @@ The decimal quotient implies [`[$each]`] doesn't go into [`[$total]`] evenly, so There is no need to find the remainder of this division, because we need one more bus to hold the last group of people anyway. -*Solution:* [`[$busesNeeded]`] buses are needed. +[`[$busesNeeded]`] buses are needed. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem40.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem40.pg index 0c62d96d44..73f60c4570 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem40.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionAppWithRemainder) -## MLTleader(1) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application','remainder') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -64,7 +65,7 @@ BEGIN_PGML [$name] saved [`[$totalU]`], and will purchase some Lego figures. Each Lego figure costs [`[$eachU]`]. How many Lego figures can [$name] afford? -*Solution:* [$name] can afford [__________]{$numLegoes} Lego figures. +[$name] can afford [__________]{$numLegoes} Lego figures. END_PGML @@ -90,7 +91,7 @@ The decimal quotient [`[$s1]`] implies [`[$each]`] doesn't go into [`[$total]`] There is no need to find how much is left, as the problem is only asking how many figures [$name] can afford. -*Solution:* [$name] can afford [`[$numLegoes]`] Lego figures. +[$name] can afford [`[$numLegoes]`] Lego figures. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem50.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem50.pg index cde9d00243..dd01c3d254 100644 --- a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/RemainderWordProblem50.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('3.OA','4.OA') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(DivisionAppWithRemainder) -## Level(5) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('division','application','remainder') +## DBCCSS('3.OA','4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## @@ -52,7 +55,7 @@ A teacher is doing an activity in a class with [`[$numStudents]`] students. The How many marbles are in each pile? -*Solution:* There are [_________]{$eachPile} marbles in each pile. +There are [_________]{$eachPile} marbles in each pile. END_PGML @@ -93,7 +96,7 @@ Next, the teacher divided [`[$remainder]`] left-over marbles evenly into [`[$num [`` [$remainder] \div [$numPiles] = [$eachPile] ``] -*Solution:* There are [`[$eachPile]`] marbles in each pile. +There are [`[$eachPile]`] marbles in each pile. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable10.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable10.pg new file mode 100644 index 0000000000..86b34961dc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable10.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Practice the multiplication table. Numbers range from 2 to 9. +# +# Last edited: Carl Yao 9/25/13 +# +# ENDDESCRIPTION + +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('multiplication') +## DBCCSS('3.OA.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("LimitedNumeric"); + +@num1 = (); +@num2 = (); +@products = (); + +do +{for my $i (0..9) { + $num1[$i] = random(2,9,1); + $num2[$i] = random(2,9,1); + $products[$i] = $num1[$i]*$num2[$i]; + } + +my %seen = (); +@duplicates = (); +@duplicates = map { 1==$seen{$_}++ ? $_ : () } @products; + +} until (@duplicates == 0); + +############################################## + +BEGIN_PGML + +##Multiplication Facts + +If you have not memorized the multiplication table yet, silently chant the multiplication table once or twice, and then do the following multiplication problems. If you need to look at a multiplication table, use Google to find one. + +Do this problem every day until you are fluent with the multiplication table. + + [`` [@$num1[0]@] \cdot [@$num2[0]@] ``] = [_______]{$products[0]} + + [`` [@$num1[1]@] \cdot [@$num2[1]@] ``] = [_______]{$products[1]} + + [`` [@$num1[2]@] \cdot [@$num2[2]@] ``] = [_______]{$products[2]} + + [`` [@$num1[3]@] \cdot [@$num2[3]@] ``] = [_______]{$products[3]} + + [`` [@$num1[4]@] \cdot [@$num2[4]@] ``] = [_______]{$products[4]} + + [`` [@$num1[5]@] \cdot [@$num2[5]@] ``] = [_______]{$products[5]} + + [`` [@$num1[6]@] \cdot [@$num2[6]@] ``] = [_______]{$products[6]} + + [`` [@$num1[7]@] \cdot [@$num2[7]@] ``] = [_______]{$products[7]} + + [`` [@$num1[8]@] \cdot [@$num2[8]@] ``] = [_______]{$products[8]} + + [`` [@$num1[9]@] \cdot [@$num2[9]@] ``] = [_______]{$products[9]} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Please make sure you are fluent with the multiplication table. This is the basis for a lot of later studies in mathematics. + + [`` +\begin{aligned}[t] + [@$num1[0]@] \cdot [@$num2[0]@] &= [@$products[0]@] \\ + [@$num1[1]@] \cdot [@$num2[1]@] &= [@$products[1]@] \\ + [@$num1[2]@] \cdot [@$num2[2]@] &= [@$products[2]@] \\ + [@$num1[3]@] \cdot [@$num2[3]@] &= [@$products[3]@] \\ + [@$num1[4]@] \cdot [@$num2[4]@] &= [@$products[4]@] \\ + [@$num1[5]@] \cdot [@$num2[5]@] &= [@$products[5]@] \\ + [@$num1[6]@] \cdot [@$num2[6]@] &= [@$products[6]@] \\ + [@$num1[7]@] \cdot [@$num2[7]@] &= [@$products[7]@] \\ + [@$num1[8]@] \cdot [@$num2[8]@] &= [@$products[8]@] \\ + [@$num1[9]@] \cdot [@$num2[9]@] &= [@$products[9]@] +\end{aligned} + ``] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable15.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable15.pg new file mode 100644 index 0000000000..40b521bfae --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable15.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Practice the multiplication table. Numbers range from 1 to 12. +# +# Last edited: Carl Yao 9/25/13 +# +# ENDDESCRIPTION + +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('multiplication') +## DBCCSS('3.OA.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("LimitedNumeric"); + +@num1 = (); +@num2 = (); +@products = (); + +do { +for my $i (0..9) { + $num1[$i] = random(2,12,1); + $num2[$i] = random(2,12,1); + $products[$i] = $num1[$i]*$num2[$i]; + } + +my %seen = (); +@duplicates = (); +@duplicates = map { 1==$seen{$_}++ ? $_ : () } @products; + +} until (@duplicates == 0); + + + +############################################## + +BEGIN_PGML + +##Multiplication Facts + +If you have not memorized the multiplication table yet, silently chant the multiplication table once or twice, and then do the following multiplication problems. If you need to look at a multiplication table, use Google to find one. + +Do this problem every day until you are fluent with the multiplication table. + + [`` [@$num1[0]@] \cdot [@$num2[0]@] ``] = [_______]{$products[0]} + + [`` [@$num1[1]@] \cdot [@$num2[1]@] ``] = [_______]{$products[1]} + + [`` [@$num1[2]@] \cdot [@$num2[2]@] ``] = [_______]{$products[2]} + + [`` [@$num1[3]@] \cdot [@$num2[3]@] ``] = [_______]{$products[3]} + + [`` [@$num1[4]@] \cdot [@$num2[4]@] ``] = [_______]{$products[4]} + + [`` [@$num1[5]@] \cdot [@$num2[5]@] ``] = [_______]{$products[5]} + + [`` [@$num1[6]@] \cdot [@$num2[6]@] ``] = [_______]{$products[6]} + + [`` [@$num1[7]@] \cdot [@$num2[7]@] ``] = [_______]{$products[7]} + + [`` [@$num1[8]@] \cdot [@$num2[8]@] ``] = [_______]{$products[8]} + + [`` [@$num1[9]@] \cdot [@$num2[9]@] ``] = [_______]{$products[9]} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Please make sure you are fluent with the multiplication table. This is the basis for a lot of later studies in mathematics. + + [`` +\begin{aligned}[t] + [@$num1[0]@] \cdot [@$num2[0]@] &= [@$products[0]@] \\ + [@$num1[1]@] \cdot [@$num2[1]@] &= [@$products[1]@] \\ + [@$num1[2]@] \cdot [@$num2[2]@] &= [@$products[2]@] \\ + [@$num1[3]@] \cdot [@$num2[3]@] &= [@$products[3]@] \\ + [@$num1[4]@] \cdot [@$num2[4]@] &= [@$products[4]@] \\ + [@$num1[5]@] \cdot [@$num2[5]@] &= [@$products[5]@] \\ + [@$num1[6]@] \cdot [@$num2[6]@] &= [@$products[6]@] \\ + [@$num1[7]@] \cdot [@$num2[7]@] &= [@$products[7]@] \\ + [@$num1[8]@] \cdot [@$num2[8]@] &= [@$products[8]@] \\ + [@$num1[9]@] \cdot [@$num2[9]@] &= [@$products[9]@] +\end{aligned} + ``] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable20.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable20.pg new file mode 100644 index 0000000000..ce1e2d8fe5 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable20.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Practice multiplication facts by doing division problems. Numbers range from 2 to 9. +# +# Last edited: Carl Yao 9/25/13 +# +# ENDDESCRIPTION + +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('multiplication','division') +## DBCCSS('3.OA.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("LimitedNumeric"); + +@num1 = (); +@num2 = (); +@products = (); + +do +{for my $i (0..9) { + $num1[$i] = random(2,9,1); + $num2[$i] = random(2,9,1); + $products[$i] = $num1[$i]*$num2[$i]; + } + +my %seen = (); +@duplicates = (); +@duplicates = map { 1==$seen{$_}++ ? $_ : () } @products; + +} until (@duplicates == 0); + +############################################## + +BEGIN_PGML + +##Division Facts + +Use multiplication facts reversely to do the following division problems. For example, since [` 7 \cdot 8 = 56 `], we know [` 56 \div 7 = 8 `]. + +Do this problem every day until you are fluent with doing this type of problem. + + [`` [@$products[0]@] \div [@$num2[0]@] ``] = [_______]{$num1[0]} + + [`` [@$products[1]@] \div [@$num2[1]@] ``] = [_______]{$num1[1]} + + [`` [@$products[2]@] \div [@$num2[2]@] ``] = [_______]{$num1[2]} + + [`` [@$products[3]@] \div [@$num2[3]@] ``] = [_______]{$num1[3]} + + [`` [@$products[4]@] \div [@$num2[4]@] ``] = [_______]{$num1[4]} + + [`` [@$products[5]@] \div [@$num2[5]@] ``] = [_______]{$num1[5]} + + [`` [@$products[6]@] \div [@$num2[6]@] ``] = [_______]{$num1[6]} + + [`` [@$products[7]@] \div [@$num2[7]@] ``] = [_______]{$num1[7]} + + [`` [@$products[8]@] \div [@$num2[8]@] ``] = [_______]{$num1[8]} + + [`` [@$products[9]@] \div [@$num2[9]@] ``] = [_______]{$num1[9]} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + [@$products[0]@] \div [@$num2[0]@] &= [@$num1[0]@] \\ + [@$products[1]@] \div [@$num2[1]@] &= [@$num1[1]@] \\ + [@$products[2]@] \div [@$num2[2]@] &= [@$num1[2]@] \\ + [@$products[3]@] \div [@$num2[3]@] &= [@$num1[3]@] \\ + [@$products[4]@] \div [@$num2[4]@] &= [@$num1[4]@] \\ + [@$products[5]@] \div [@$num2[5]@] &= [@$num1[5]@] \\ + [@$products[6]@] \div [@$num2[6]@] &= [@$num1[6]@] \\ + [@$products[7]@] \div [@$num2[7]@] &= [@$num1[7]@] \\ + [@$products[8]@] \div [@$num2[8]@] &= [@$num1[8]@] \\ + [@$products[9]@] \div [@$num2[9]@] &= [@$num1[9]@] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable25.pg b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable25.pg new file mode 100644 index 0000000000..1ebe81dd04 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/MultiplicationDivision/multiplicationTable25.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Practice multiplication facts by doing division problems. Numbers range from 2 to 12. +# +# Last edited: Carl Yao 9/25/13 +# +# ENDDESCRIPTION + +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('multiplication','division') +## DBCCSS('3.OA.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("LimitedNumeric"); + +@num1 = (); +@num2 = (); +@products = (); + +do +{for my $i (0..9) { + $num1[$i] = random(2,12,1); + $num2[$i] = random(2,12,1); + $products[$i] = $num1[$i]*$num2[$i]; + } + +my %seen = (); +@duplicates = (); +@duplicates = map { 1==$seen{$_}++ ? $_ : () } @products; + +} until (@duplicates == 0); + +############################################## + +BEGIN_PGML + +##Division Facts + +Use multiplication facts reversely to do the following division problems. For example, since [` 7 \cdot 8 = 56 `], we know [` 56 \div 7 = 8 `]. + +Do this problem every day until you are fluent with doing this type of problems. + + [`` [@$products[0]@] \div [@$num2[0]@] ``] = [_______]{$num1[0]} + + [`` [@$products[1]@] \div [@$num2[1]@] ``] = [_______]{$num1[1]} + + [`` [@$products[2]@] \div [@$num2[2]@] ``] = [_______]{$num1[2]} + + [`` [@$products[3]@] \div [@$num2[3]@] ``] = [_______]{$num1[3]} + + [`` [@$products[4]@] \div [@$num2[4]@] ``] = [_______]{$num1[4]} + + [`` [@$products[5]@] \div [@$num2[5]@] ``] = [_______]{$num1[5]} + + [`` [@$products[6]@] \div [@$num2[6]@] ``] = [_______]{$num1[6]} + + [`` [@$products[7]@] \div [@$num2[7]@] ``] = [_______]{$num1[7]} + + [`` [@$products[8]@] \div [@$num2[8]@] ``] = [_______]{$num1[8]} + + [`` [@$products[9]@] \div [@$num2[9]@] ``] = [_______]{$num1[9]} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned}[t] + [@$products[0]@] \div [@$num2[0]@] &= [@$num1[0]@] \\ + [@$products[1]@] \div [@$num2[1]@] &= [@$num1[1]@] \\ + [@$products[2]@] \div [@$num2[2]@] &= [@$num1[2]@] \\ + [@$products[3]@] \div [@$num2[3]@] &= [@$num1[3]@] \\ + [@$products[4]@] \div [@$num2[4]@] &= [@$num1[4]@] \\ + [@$products[5]@] \div [@$num2[5]@] &= [@$num1[5]@] \\ + [@$products[6]@] \div [@$num2[6]@] &= [@$num1[6]@] \\ + [@$products[7]@] \div [@$num2[7]@] &= [@$num1[7]@] \\ + [@$products[8]@] \div [@$num2[8]@] &= [@$num1[8]@] \\ + [@$products[9]@] \div [@$num2[9]@] &= [@$num1[9]@] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations09.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations09.pg index f4ae97572e..cf9eaff8c3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations09.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations09.pg @@ -12,15 +12,18 @@ # Last updated: Hughes, 6/25/13 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Addition/subtraction) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','operation','add','subtract','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,7 +34,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -55,9 +58,9 @@ BEGIN_PGML Evaluate these expressions: -a) [`` [$a]+[$b]-[$c]= ``] [________]{$ans2} +a. [`` [$a]+[$b]-[$c]= ``] [________]{$ans2} -b) [`` [$a]-[$b]+[$c]= ``] [________]{$ans1} +a. [`` [$a]-[$b]+[$c]= ``] [________]{$ans1} END_PGML @@ -70,14 +73,16 @@ BEGIN_PGML_SOLUTION We perform the operations from left to right, since addition and subtraction have the same priority in the order of operations. -a) [` +a. + [` \begin{aligned}[t] [$a]+[$b]-[$c] & = [$pro2Step1] + [$c] \\ & = [$ans2] \end{aligned} `] -b) [` +b. + [` \begin{aligned}[t] [$a]-[$b]+[$c] & = [$pro1Step1] + [$c] \\ & = [$ans1] diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations108.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations108.pg index 6667e0dd2f..bc82d70493 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations108.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations108.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -51,7 +54,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]-[$b][[$c]^{2}-([$d]-[$e])] = ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations109.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations109.pg index 1ec7ea3ad9..d345bb425b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations109.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations109.pg @@ -10,15 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,9 +53,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. - [`` ([$a]-[$b])^{2}+[$c]([$a]-[$b]^{2}) ``][________]{$ans} + [`` ([$a]-[$b])^{2}+[$c]([$a]-[$b]^{2}) = ``][________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations163.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations163.pg index 7058ad41a5..f07c80ca56 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations163.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations163.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE-1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','evaluate','fraction') +## DBCCSS('6.EE-1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,7 +64,8 @@ END_PGML BEGIN_PGML_SOLUTION -a. [` +a. + [` \begin{aligned}[t] \frac{[$a]}{[$b]}+[$c] & = [$a/$b]+[$c] \\ & = [$ans1] @@ -69,7 +73,8 @@ a. [` `] In this problem, by order of operations, division has higher priority than addition. -a. [` +b. + [` \begin{aligned}[t] \frac{[$a]}{[$b]+[$c]} & = \frac{[$a]}{[$b+$c]} \\ & = [$ans2] diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations164.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations164.pg index 9b0fd80c6b..d86da309e3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations164.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations164.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE-1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','evaluate','fraction') +## DBCCSS('6.EE-1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -59,7 +62,8 @@ END_PGML BEGIN_PGML_SOLUTION -a. [` +a. + [` \begin{aligned}[t] [$a]+\frac{[$b]}{[$den]} & = [$a]+[$b/$den] \\ & = [$ans1] @@ -67,7 +71,8 @@ a. [` `] In this problem, by order of operations, division has higher priority than addition. -a. [` +b. + [` \begin{aligned}[t] \frac{[$a]+[$b]}{[$den]} & = \frac{[$a+$b]}{[$den]} \\ & = [$ans2] diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations165.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations165.pg index a9929a0ce2..d39c66ee89 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations165.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations165.pg @@ -10,15 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +33,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,9 +56,9 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. - [`` \frac{[$a]+[$b]}{[$c]-[$d]} ``][________]{$ans} + [`` \frac{[$a]+[$b]}{[$c]-[$d]}= ``][________]{$ans} END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations199.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations199.pg index 25e5a30663..884a910acc 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations199.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations199.pg @@ -8,15 +8,18 @@ # Last updated: Carl Yao 01/23/2013 # ENDDESCRIPTION -## DBCCSS('6.EE.1','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','subtract','evaluate','absolute value') +## DBCCSS('6.EE.1','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,7 +50,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate these expressions: +Evaluate the following. [`` -\left| [$a]-[$b] \right| = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations21.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations21.pg index 325e610bdc..4c6d11760b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations21.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations21.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer',,'operation','multiply','divide','evaluate') ## DBCCSS('6.EE-1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) -## KEYWORDS('integer','operation','multiply','divide','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations22.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations22.pg index 86d8ab00af..ba6dafec4a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations22.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations22.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('integer',,'operation','multiply','divide','evaluate') ## DBCCSS('6.EE-1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) -## KEYWORDS('integer','operation','multiply','divide','evaluate') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations23.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations23.pg index 48a2f8f9e1..dd422e184c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations23.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations23.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE-1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','operation','multiply','divide','evaluate') +## DBCCSS('6.EE-1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -46,7 +49,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the expression: +Evaluate the following. [`` [$c]+[$a]([$b])= ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations24.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations24.pg index ecfbe7a9c3..024d6e2fab 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations24.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations24.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE-1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','operation','multiply','divide','evaluate') +## DBCCSS('6.EE-1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -46,7 +49,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate the expression: +Evaluate the following. [`` [$a]([$b]+[$c])= ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations241.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations241.pg index d9e7aac705..48893106c5 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations241.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations241.pg @@ -8,15 +8,18 @@ # Last updated: Carl Yao 01/23/2014 # ENDDESCRIPTION -## DBCCSS('6.EE.1','6.NS.7') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','subtract','divide','evaluate','absolute value') +## DBCCSS('6.EE.1','6.NS.7') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -46,7 +49,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` \left| \frac{[$a]+(-[$b])^{3}}{[$c]} \right| = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations25.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations25.pg index e89276806d..e377306c97 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations25.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations25.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE-1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','operation','multiply','divide','evaluate') +## DBCCSS('6.EE-1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations26.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations26.pg index 2a0847610a..6364ee039b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations26.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations26.pg @@ -3,22 +3,25 @@ # # Template # -# Evaluate this expression: +# Evaluate the following. # # (2*3)^3=? # # Last updated: Carl Yao, 01/14/2014 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('order of operations','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,7 +53,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` ([$a]\cdot[$b])^{[$c]}= ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations27.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations27.pg index a161b62e07..a9cb866a35 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations27.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations27.pg @@ -3,22 +3,25 @@ # # Template # -# Evaluate this expression: +# Evaluate the following. # # 2*3^3=? # # Last updated: Carl Yao, 01/14/2014 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('order of operations','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,7 +53,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]\cdot[$b]^{[$c]}= ``] [________]{$ans} @@ -74,6 +77,4 @@ In the order of operations, exponents take priority above multiplication. END_PGML_SOLUTION -ENDDOCUMENT(); - - +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations28.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations28.pg index 1d0c133bc8..d56fa147c4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations28.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations28.pg @@ -3,22 +3,25 @@ # # Template # -# Evaluate this expression: +# Evaluate the following. # # (10-2)*3=? Answer is positive. # # Last updated: Carl Yao, 01/14/2014 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('order of operations','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -49,7 +52,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` ([$a]-[$b])\cdot[$c]= ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations285.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations285.pg index 498a26fb6b..743c31b6dd 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations285.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations285.pg @@ -10,15 +10,18 @@ # Last updated: Yao 10/15/2013 # ENDDESCRIPTION -## DBCCSS('7.NS.1','6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('fraction','order of operations','evaluate','integer exponent','subtract') +## DBCCSS('7.NS.1','6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations286.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations286.pg new file mode 100644 index 0000000000..611efe209f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations286.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Template +# +# Evaluate these expressions: +# +# -(2/3)^3, -(2/3)^3 and -(-2/3)^3 +# +# Last updated: Yao 10/15/2013 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('fraction','order of operations','evaluate','integer exponent','subtract') +## DBCCSS('7.NS.1','6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); + +$den1=random(3,6,1); +do {$num1= random(2,$den1-1,1);} until (gcd($num1,$den1)==1); +$frac1=Fraction($num1,$den1); + +$ans1=Compute("(-$frac1)**3"); +$ans2=Compute("-($frac1)**3"); +$ans3=Compute("-(-$frac1)**3"); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$ans1 = Compute($ans1); +$ans2 = Compute($ans2); +$ans3 = Compute($ans3); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Evaluate the following expressions: + +a) [`` \left( -[$frac1] \right) ^{3}= ``] [________]{$ans1} + +b) [`` - \left( [$frac1] \right) ^{3}= ``] [________]{$ans2} + +c) [`` - \left( -[$frac1] \right) ^{3}= ``] [________]{$ans3} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Notice the difference in the position of the negative symbol. + +a. [`` +\begin{aligned}[t] + \left( -[$frac1] \right) ^{3} + & = \left( -[$frac1] \right) \cdot \left( -[$frac1] \right) \cdot \left( -[$frac1] \right) \\ + & = \frac{[$num1*$num1]}{[$den1*$den1]} \cdot \left( -[$frac1] \right) \\ + & = [$ans1] +\end{aligned}``] +In Part a, parentheses have higher priority than exponents. + +a. [`` +\begin{aligned}[t] + -\left( [$frac1] \right) ^{3} + & = -\left( [$frac1] \right) \cdot \left( [$frac1] \right) \cdot \left( [$frac1] \right) \\ + & = -\frac{[$num1*$num1]}{[$den1*$den1]} \cdot \left( [$frac1] \right) \\ + & = [$ans2] +\end{aligned}``] +In Part b, exponents have higher priority than the negative symbol (which is, in essence, multiplication). + +a. [`` +\begin{aligned}[t] + -\left( -[$frac1] \right) ^{3} + & = -\left( -[$frac1] \right) \cdot \left( -[$frac1] \right) \cdot \left( -[$frac1] \right) \\ + & = \left( [$frac1] \right) \cdot \left( -[$frac1] \right) \cdot \left( -[$frac1] \right) \\ + & = -\frac{[$num1*$num1]}{[$den1*$den1]} \cdot \left( -[$frac1] \right) \\ + & = [$ans3] +\end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations29.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations29.pg index b0e5e31e61..da2e16bc7b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations29.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations29.pg @@ -3,22 +3,25 @@ # # Template # -# Evaluate this expression: +# Evaluate the following. # # 10-2*3=? Answer is positive. # # Last updated: Carl Yao, 01/14/2014 # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('order of operations','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -49,7 +52,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]-[$b]\cdot[$c]= ``] [________] @@ -59,10 +62,13 @@ END_PGML ############################################## $wrong=($a-$b)*$c; -ANS($ans -> cmp() -> +ANS($ans -> cmp() + -> withPostFilter(AnswerHints( - [Formula("$wrong")] => - "Remember to do the multiplication first (order of operations)."))); + Real($wrong) => + "Remember to do the multiplication first (order of operations)." +)) +); $step1 = $b*$c; @@ -80,6 +86,4 @@ In the order of operations, multiplication takes priority above subtraction. END_PGML_SOLUTION -ENDDOCUMENT(); - - +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations46.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations46.pg index 65d4ec1e87..1ccdcfec5c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations46.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations46.pg @@ -11,15 +11,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,7 +34,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -51,7 +54,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]-[$b]([$c])[$d] = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations47.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations47.pg index 26c26af39f..a1c2a802dd 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations47.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations47.pg @@ -12,15 +12,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','multiply','subtract','negative','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -63,7 +66,7 @@ END_PGML BEGIN_PGML_SOLUTION -a. This problem is a straightforward subtraction: +a. This problem is a straightforward subtraction: [`` \begin{aligned}[t] [$a]-[$b] & = [$ans1] diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations48.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations48.pg index 852a1332d6..535370a367 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations48.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations48.pg @@ -12,15 +12,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','multiply','subtract','negative','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -32,7 +35,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations49.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations49.pg index 8243f129c5..8f1c100097 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations49.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations49.pg @@ -11,15 +11,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiplication) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','multiply','subtract','negative','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,7 +34,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -51,7 +54,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]-[$b](-[$c])[$d] = ``] [________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations51.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations51.pg index 6b29474ea1..df73de0183 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations51.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations51.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','multiply','subtract','negative','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,7 +56,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` -[[$a]-([$b]-[$c])^{2}]= ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations52.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations52.pg index 1bce9f8951..85967ca528 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations52.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations52.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','multiply','subtract','negative','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -52,7 +55,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]-[$b] [ [$c]-([$d]+[$e]\cdot[$f])]= ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations53.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations53.pg index 809b1323f0..521494c4d2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations53.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations53.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -52,7 +55,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` [$a]+[$b]([$c]-[$d]\cdot[$e]^{[$f]})= ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations54.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations54.pg index c3cc62901b..8abaa9b9f7 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations54.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations54.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','multiply','subtract','negative','evaluate') +## DBCCSS('6.EE.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "answerHints.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,7 +56,7 @@ TEXT(beginproblem()); BEGIN_PGML -Evaluate this expression: +Evaluate the following. [`` -[$a] [ [$b]-([$c]-[$d]\cdot[$e])^{2}]= ``][________]{$ans} diff --git a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations82.pg b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations82.pg index 11c9f9ed9d..9587225908 100644 --- a/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations82.pg +++ b/OpenProblemLibrary/PCC/BasicMath/OrderOfOperations_More/orderOfOperations82.pg @@ -10,15 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.EE-1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Multiple operations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') ## KEYWORDS('integer','order of operations','evaluate') +## DBCCSS('6.EE-1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +31,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -79,25 +82,28 @@ and \end{aligned} `] -### Solutions +*Solutions:* -a) [` +a. + [` \begin{aligned}[t] (-[$a])^{2}-[$a]^{2} & = [$a2] - [$a]^{2} \\ & = [$a2] - [$a2] \\ & = [$ans1] \end{aligned} `] ----- -a) [` + +b. + [` \begin{aligned}[t] -[$a]^{2}-(-[$a])^{2} & = -[$a2] -(-[$a])^{2} \\ & = -[$a2] - [$a2] \\ & = [$ans2] \end{aligned} `] ----- -a) [` + +c. + [` \begin{aligned}[t] -[$a]^{2}-[$a]^{2} & = -[$a2] -[$a]^{2} \\ & = -[$a2] - [$a2] \\ diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_10.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_10.pg index a2d6372433..1837abffd2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_10.pg @@ -7,15 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,8 +28,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -53,7 +56,7 @@ BEGIN_PGML In last season's basketball games, [$name] made [` [$per]%`] in free throws. If he attempted a total of [`[$whole]`] free throws, how many free throws did [$pronoun] make? -*Solution:* [$name] made [__________]{$part} free throws last season. +[$name] made [__________]{$part} free throws last season. END_PGML @@ -79,7 +82,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [$name] made [`[$part]`] free throws last season. +[$name] made [`[$part]`] free throws last season. ####Method 2 @@ -96,7 +99,7 @@ The question is: What is [` [$per]% `] of [` [$whole] `]? Assume [`x`] is [` [$p \end{aligned} ``] -*Solution:* [$name] made [`[$part]`] free throws last season. +[$name] made [`[$part]`] free throws last season. ####Method 3 @@ -110,7 +113,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$per]% \cdot [$whole] = [$per/100] \cdot [$whole] = [$part] ``] -*Solution:* [$name] made [`[$part]`] free throws last season. +[$name] made [`[$part]`] free throws last season. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_100.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_100.pg index f2388a01d3..7a17278d4e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_100.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_100.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", +# "PCCmacros.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_110.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_110.pg index 111c4bf72b..944233b50a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_110.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_110.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('percent','graph','application','pie chart') -## MLTleader(1) -## MLT(arithmetic_percents_calculation_pie_chart) +## DBCCSS('7.RP.3','6.RP.3c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", - "PGcourse.pl" + "PGcourse.pl", +# "contextFraction.pl", ); ############################################## @@ -147,7 +149,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* There are [`[$beatles]`] signatures by the Beatles in this collection. +There are [`[$beatles]`] signatures by the Beatles in this collection. ####Method 2 @@ -164,7 +166,7 @@ The question is: What is [` [$perBeatles]% `] of [` [$whole] `]? Assume [`x`] is \end{aligned} ``] -*Solution:* There are [`[$beatles]`] signatures by the Beatles in this collection. +There are [`[$beatles]`] signatures by the Beatles in this collection. ####Method 3 @@ -178,7 +180,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$perBeatles]% \cdot [$whole] = [$perBeatles/100] \cdot [$whole] = [$beatles] ``] -*Solution:* There are [`[$beatles]`] signatures by the Beatles in this collection. +There are [`[$beatles]`] signatures by the Beatles in this collection. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_120.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_120.pg index 9e587293b2..251f2570d4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_120.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_120.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('percent','graph','application','pie chart') -## MLT(arithmetic_percents_calculation_pie_chart) +## DBCCSS('7.RP.3','6.RP.3c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", - "PGcourse.pl" + "PGcourse.pl", +# "contextFraction.pl", ); ############################################## @@ -57,12 +60,16 @@ $numParts = 5; $scale = 2; $downshift = -0.4; $radius = 1; -$gr = init_graph(-$scale,-$scale,$scale,$scale, -size=>[400,400] +$top = $scale/1.5; +$bottom=-$scale; +$xpixels=400; +$ypixels=$xpixels*($top-$bottom)/(2*$scale); +$gr = init_graph(-$scale,$bottom,$scale,$top, +size=>[$xpixels,$ypixels] ); $title = "Collection of Signatures from Different Artists"; -$gr->lb( new Label(0, $scale/1.5,$title,'black','center','middle')); +$gr->lb( new Label(0, $top,$title,'black','center','top')); $xfunc = sub { my $t = shift(); return $radius*cos($t); }; @@ -78,7 +85,7 @@ $gr->new_color("color3", 200,230,100); $gr->new_color("color4", 220,220,220); @color=("color0","color1","color2","color3","color4"); -@legend=("Beatles","Rolling Stone","Four Seasons","Michael Jackson","Sting"); +@legend=("Beatles","Rolling Stones","Four Seasons","Michael Jackson","Sting"); @perCumulative = (); $perCumulative[0] = 0; @@ -105,8 +112,8 @@ for my $i (0..$numParts-1) { $gr->lineTo($end1x,$end1y,'blue',1); $gr->fillRegion([$end2x,$end2y,$color[$i]]); - $gr->lb( new Label($end2x, $end2y,"$artists[$i+1]%",'black','center','middle')) unless ($i==$numParts-1); - $gr->lb( new Label($end3x, $end3y,$legend[$i],'black','center','middle')); + $gr->lb( new Label($end2x, $end2y,"$artists[$i+1]%",'black','center','middle','large')) unless ($i==$numParts-1); + $gr->lb( new Label($end3x, $end3y,$legend[$i],'black','center','middle','large')); } $alt = "This is a pie chart about a collection of artist signatures. The collection has $artists[1]% $legend[0] signatures, $artists[2]% $legend[1] signatures, $artists[3]% $legend[2] signatures, $artists[4]% $legend[3] signatures and unknown percent of $legend[4] signatures."; @@ -115,10 +122,9 @@ $alt = "This is a pie chart about a collection of artist signatures. The collect BEGIN_PGML ->>[@image( insertGraph($gr), width=>400, - height=>400, tex_size=>800, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< +The pie chart represents a collector's collection of signatures from various artists. -The pie chart represents a collector's collection of signatures from various artists. Answer the following question. +>>[@image( insertGraph($gr), width=>$xpixels, extra_html_tags => "alt = '$alt' title = '$alt'")@]*<< If the collector has a total of [`[$whole]`] signatures, there are [__________]{$sting} signatures by Sting. @@ -157,7 +163,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* There are [`[$sting]`] signatures by Sting in this collection. +There are [`[$sting]`] signatures by Sting in this collection. ####Method 2 @@ -174,7 +180,7 @@ The question is: What is [` [$perSting]% `] of [` [$whole] `]? Assume [`x`] is [ \end{aligned} ``] -*Solution:* There are [`[$sting]`] signatures by Sting in this collection. +There are [`[$sting]`] signatures by Sting in this collection. ####Method 3 @@ -188,7 +194,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$perSting]% \cdot [$whole] = [$perSting/100] \cdot [$whole] = [$sting] ``] -*Solution:* There are [`[$sting]`] signatures by Sting in this collection. +There are [`[$sting]`] signatures by Sting in this collection. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_20.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_20.pg index a607453b57..52a386ba55 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_20.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(population_number_answer) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +28,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", +# "PCCmacros.pl", ); ############################################## @@ -46,7 +49,7 @@ BEGIN_PGML A county has [`[$whole]`] residents. In the last election, [`[$per]%`] turned out to vote. How many residents voted? -*Solution:* In the last election, [__________]{$part} residents in the county turned out to vote. +In the last election, [__________]{$part} residents in the county turned out to vote. END_PGML @@ -72,7 +75,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* In the last election, [`[$part]`] residents in the county. turned out to vote. +In the last election, [`[$part]`] residents in the county. turned out to vote. ####Method 2 @@ -89,7 +92,7 @@ The question is: What is [` [$per]% `] of [` [$whole] `]? Assume [`x`] is [` [$p \end{aligned} ``] -*Solution:* In the last election, [`[$part]`] residents in the county. turned out to vote. +In the last election, [`[$part]`] residents in the county. turned out to vote. ####Method 3 @@ -103,7 +106,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$per]% \cdot [$whole] = [$per/100] \cdot [$whole] = [$part] ``] -*Solution:* In the last election, [`[$part]`] residents in the county. turned out to vote. +In the last election, [`[$part]`] residents in the county. turned out to vote. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_30.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_30.pg index f6cc0fb5b7..99654b5d4b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_30.pg @@ -7,17 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') -## MLTleader(1) -## MLT(arithmetic_percents_calculation_painting) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", +# "PCCmacros.pl", ); ############################################## @@ -55,7 +57,7 @@ BEGIN_PGML A painting is on sale with [`[$sale]%`] off. Its original price was [`[$wholeC]`]. What is its price on sale? -*Solution:* The painting sells for [_________]{$partC} on sale. +The painting sells for [_________]{$partC} on sale. END_PGML @@ -83,7 +85,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The painting sells for [`[$partC]`] on sale. +The painting sells for [`[$partC]`] on sale. ####Method 2 @@ -100,7 +102,7 @@ The question is: What is [` [$per]% `] of [` [$whole] `]? Assume [`x`] is [` [$p \end{aligned} ``] -*Solution:* The painting sells for [`[$partC]`] on sale. +The painting sells for [`[$partC]`] on sale. ####Method 3 @@ -114,7 +116,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$per]% \cdot [$whole] = [$per/100] \cdot [$whole] = [$part] ``] -*Solution:* The painting sells for [`[$partC]`] on sale. +The painting sells for [`[$partC]`] on sale. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_40.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_40.pg index dc91deb4d9..f7a6a5a239 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_40.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(moneymoneymoney) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -59,7 +61,7 @@ BEGIN_PGML [$name] invested [`[$wholeC]`] in a mutual fund, and earned [`[$per]%`] of interest. How much interest did [$name] earn? -*Solution:* [$name] earned [_________]{$partC} of interest. +[$name] earned [_________]{$partC} of interest. END_PGML @@ -85,7 +87,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [$name] earned [`[$partC]`] of interest. +[$name] earned [`[$partC]`] of interest. ####Method 2 @@ -102,7 +104,7 @@ The question is: What is [` [$per]% `] of [` [$whole] `]? Assume [`x`] is [` [$p \end{aligned} ``] -*Solution:* [$name] earned [`[$partC]`] of interest. +[$name] earned [`[$partC]`] of interest. ####Method 3 @@ -116,7 +118,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$per]% \cdot [$whole] = [$per/100] \cdot [$whole] = [$part] ``] -*Solution:* [$name] earned [`[$partC]`] of interest. +[$name] earned [`[$partC]`] of interest. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_50.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_50.pg index dbd979a89b..beef862665 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_50.pg @@ -9,16 +9,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(moneymoneymoney) -## Level(3) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,8 +31,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -67,7 +69,7 @@ BEGIN_PGML One month, [$name] made [`[$wholeC]`] in sales. How much income did [$pronoun] earn in total in that month? -*Solution:* [$name] earned [_________]{$ansC} in total in that month. +[$name] earned [_________]{$ansC} in total in that month. END_PGML @@ -97,7 +99,7 @@ We will write and solve the proportion: [$name] earned [`[$partC]`] in commission in that month, on top of her [`[$baseC]`] base pay. -*Solution:* [$name] earned a total of [`[$partC]+[$baseC]=[$ansC]`] in that month. +[$name] earned a total of [`[$partC]+[$baseC]=[$ansC]`] in that month. ####Method 2 @@ -116,7 +118,7 @@ The question is: What is [` [$per]% `] of [` [$whole] `]? Assume [`x`] is [` [$p [$name] earned [`[$partC]`] in commission in that month, on top of her [`[$baseC]`] base pay. -*Solution:* [$name] earned a total of [`[$partC]+[$baseC]=[$ansC]`] in that month. +[$name] earned a total of [`[$partC]+[$baseC]=[$ansC]`] in that month. ####Method 3 @@ -132,7 +134,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [$name] earned [`[$partC]`] in commission in that month, on top of her [`[$baseC]`] base pay. -*Solution:* [$name] earned a total of [`[$partC]+[$baseC]=[$ansC]`] in that month. +[$name] earned a total of [`[$partC]+[$baseC]=[$ansC]`] in that month. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_60.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_60.pg index 2043d76075..3e6b677eec 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_60.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) ## KEYWORDS('percent','proportion','application') -## MLT(arithmetic_percents_calculation_mixing_chemicals) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -50,7 +53,7 @@ BEGIN_PGML A bottle of [`[$per]%`] alcohol solution weighs [`[$whole]`] grams. How many grams of pure alcohol is in this bottle? -*Solution:* There are [_________]{$partU} of pure alcohol in this bottle. +There are [_________]{$partU} of pure alcohol in this bottle. Use *g* for grams. @@ -78,7 +81,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* There are [`[$partU]`] of pure alcohol in this bottle. +There are [`[$partU]`] of pure alcohol in this bottle. ####Method 2 @@ -95,7 +98,7 @@ The question is: What is [` [$per]% `] of [` [$whole] `]? Assume [`x`] is [` [$p \end{aligned} ``] -*Solution:* There are [`[$partU]`] of pure alcohol in this bottle. +There are [`[$partU]`] of pure alcohol in this bottle. ####Method 3 @@ -109,7 +112,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$per]% \cdot [$whole] = [$per/100] \cdot [$whole] = [$part] ``] -*Solution:* There are [`[$partU]`] of pure alcohol in this bottle. +There are [`[$partU]`] of pure alcohol in this bottle. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_70.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_70.pg index 9e97d56d80..fe59eab0b1 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_70.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(population_number_answer) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", +# "PCCmacros.pl", ); ############################################## @@ -52,7 +55,7 @@ BEGIN_PGML A town has [`[$whole]`] registered residents. Among them, [`[$perDem]%`] were Democrats, [`[$perRep]%`] were Republicans. The rest were Independents. How many registered Independents live in this town? -*Solution:* There are [__________]{$part} registered Independent residents in this town. +There are [__________]{$part} registered Independent residents in this town. END_PGML @@ -89,7 +92,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* There are [`[$part]`] registered Independent residents in this town. +There are [`[$part]`] registered Independent residents in this town. ####Method 2 @@ -106,7 +109,7 @@ The question is: What is [` [$per]% `] of [` [$whole] `]? Assume [`x`] is [` [$p \end{aligned} ``] -*Solution:* There are [`[$part]`] registered Independent residents in this town. +There are [`[$part]`] registered Independent residents in this town. ####Method 3 @@ -120,7 +123,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$per]% \cdot [$whole] = [$per/100] \cdot [$whole] = [$part] ``] -*Solution:* There are [`[$part]`] registered Independent residents in this town. +There are [`[$part]`] registered Independent residents in this town. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_80.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_80.pg index 92cb1a8e25..d696a5b958 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_80.pg @@ -7,17 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') -## MLTleader(1) -## MLT(arithmetic_percents_calculation_tip) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -60,7 +61,7 @@ BEGIN_PGML [$name] is paying a dinner bill of [`[$wholeC]`]. [$name] plans to pay [`[$per]%`] in tips. How much tip will [$name] pay? -*Solution:* [$name] will pay [_________]{$partC} in tip. +[$name] will pay [_________]{$partC} in tip. END_PGML @@ -86,7 +87,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [$name] will pay [`[$partC]`] in tip. +[$name] will pay [`[$partC]`] in tip. ####Method 2 @@ -103,7 +104,7 @@ The question is: What is [` [$per]% `] of [` [$whole] `]? Assume [`x`] is [` [$p \end{aligned} ``] -*Solution:* [$name] will pay [`[$partC]`] in tip. +[$name] will pay [`[$partC]`] in tip. ####Method 3 @@ -117,7 +118,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$per]% \cdot [$whole] = [$per/100] \cdot [$whole] = [$part] ``] -*Solution:* [$name] will pay [`[$partC]`] in tip. +[$name] will pay [`[$partC]`] in tip. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_90.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_90.pg index eb89d85e2b..1b4a9566ea 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType1_90.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') -## MLT(arithmetic_percents_calculation_tip) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", + "PGcourse.pl", "PCCmacros.pl", - "PGcourse.pl" ); ############################################## @@ -60,7 +62,7 @@ BEGIN_PGML [$name] is paying a dinner bill of [`[$wholeC]`]. [$name] plans to pay [`[$per]%`] in tips. How much in total (including bill and tip) will [$name] pay? -*Solution:* [$name] will pay [_________]{$totalC} in total (including bill and tip). +[$name] will pay [_________]{$totalC} in total (including bill and tip). END_PGML @@ -88,7 +90,7 @@ We will write and solve the proportion: [$name] will pay [`[$partC]`] in tip. In total, [$pronoun] will pay [`[$wholeC]+[$partC]=[$totalC]`]. -*Solution:* [$name] will pay [`[$totalC]`] in total (including bill and tip). +[$name] will pay [`[$totalC]`] in total (including bill and tip). ####Method 2 @@ -107,7 +109,7 @@ The question is: What is [` [$per]% `] of [` [$whole] `]? Assume [`x`] is [` [$p [$name] will pay [`[$partC]`] in tip. In total, [$pronoun] will pay [`[$wholeC]+[$partC]=[$totalC]`]. -*Solution:* [$name] will pay [`[$totalC]`] in total (including bill and tip). +[$name] will pay [`[$totalC]`] in total (including bill and tip). ####Method 3 @@ -123,7 +125,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [$name] will pay [`[$partC]`] in tip. In total, [$pronoun] will pay [`[$wholeC]+[$partC]=[$totalC]`]. -*Solution:* [$name] will pay [`[$totalC]`] in total (including bill and tip). +[$name] will pay [`[$totalC]`] in total (including bill and tip). END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_10.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_10.pg index 2aa42f5ec7..81fb5ca419 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_10.pg @@ -7,17 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(answer_is_percent1) -## MLTleader(1) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "PGML.pl", "contextPercent.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -61,9 +62,9 @@ BEGIN_PGML In the past few seasons' basketball games, [$name] attempted [`[$whole]`] free throws, and made [`[$part]`] of them. What percent of free throws did [$name] make? -Fill in the blank with a percent. +[@KeyboardInstructions('Fill in the blank with a percent.')@]** -*Solution:* [$name] made [__________]{$perP} of free throws in the past few seasons. +[$name] made [__________]{$perP} of free throws in the past few seasons. END_PGML @@ -93,7 +94,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [$name] made [`[$per]%`] of free throws in the past few seasons. +[$name] made [`[$per]%`] of free throws in the past few seasons. ####Method 2 @@ -114,7 +115,7 @@ Assume [`[$part]`] is [`x`] (as a percent) of [` [$whole] `]. We have: \end{aligned} ``] -*Solution:* [$name] made [`[$per]%`] of free throws in the past few seasons. +[$name] made [`[$per]%`] of free throws in the past few seasons. ####Method 3 @@ -128,7 +129,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$part]}{[$whole]} = [$per/100] = [$per]% ``] -*Solution:* [$name] made [`[$per]%`] of free throws in the past few seasons. +[$name] made [`[$per]%`] of free throws in the past few seasons. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_100.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_100.pg index fafef42725..7cc8a226f5 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_100.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_100.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(answer_is_percent1) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "PGML.pl", "contextPercent.pl", "contextCurrency.pl", - "PGcourse.pl" +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -65,7 +68,7 @@ A watch's original price was [`[$wholeC]`]. The seller marked up the price to [` Fill in the blank with a percent. -*Solution:* The watch was marked up by [_________]{$perP}. +The watch was marked up by [_________]{$perP}. END_PGML @@ -93,7 +96,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The watch was marked up by [`[$per]%`]. +The watch was marked up by [`[$per]%`]. ####Method 2 @@ -114,7 +117,7 @@ Assume [`[$part]`] is [`x`] (as a percent) of [` [$whole] `]. We have: \end{aligned} ``] -*Solution:* The watch was marked up by [`[$per]%`]. +The watch was marked up by [`[$per]%`]. ####Method 3 @@ -128,7 +131,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$part]}{[$whole]} = [$per/100] = [$per]% ``] -*Solution:* The watch was marked up by [`[$per]%`]. +The watch was marked up by [`[$per]%`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_110.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_110.pg index f1ceeec881..7f0e300aac 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_110.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_110.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('percent','graph','application','pie chart') -## MLT(arithmetic_percents_calculation_pie_chart) +## DBCCSS('7.RP.3','6.RP.3c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "PGML.pl", "contextPercent.pl", "PGgraphmacros.pl", - "PGcourse.pl" + "PGcourse.pl", +# "contextFraction.pl", ); ############################################## @@ -164,7 +167,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* Michael Jackson's signatures make up [`[$perMichael]%`] of all the collector's signatures. +Michael Jackson's signatures make up [`[$perMichael]%`] of all the collector's signatures. ####Method 2 @@ -185,7 +188,7 @@ Assume [`[$michael]`] is [`x`] (as a percent) of [` [$whole] `]. We have: \end{aligned} ``] -*Solution:* Michael Jackson's signatures make up [`[$perMichael]%`] of all the collector's signatures. +Michael Jackson's signatures make up [`[$perMichael]%`] of all the collector's signatures. ####Method 3 @@ -199,7 +202,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$michael]}{[$whole]} = [$perMichael/100] = [$perMichael]% ``] -*Solution:* Michael Jackson's signatures make up [`[$perMichael]%`] of all the collector's signatures. +Michael Jackson's signatures make up [`[$perMichael]%`] of all the collector's signatures. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_120.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_120.pg index 87afee9537..98f1876428 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_120.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_120.pg @@ -7,30 +7,32 @@ # # ENDDESCRIPTION -## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_from_table5) -## MLTleader(1) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('percent','graph','application','bar graph','rounding') +## DBCCSS('7.RP.3','6.RP.3c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "contextPercent.pl", +# "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +42,7 @@ Context("LimitedNumeric"); $numBars = 5; $maxLimit = 200; -@names = ("No. 1","No. 2","No. 3","No. 4","No. 5"); +@names = ("#1","#2","#3","#4","#5"); @numStudents = (); $total = 0; $busName = $names[0]; @@ -74,7 +76,7 @@ $ymin = -$ystep/2; $ymax = $yCover+$ystep; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[400,240]); $picture->lb('reset'); $picture->moveTo(0,0); @@ -83,13 +85,14 @@ $picture->moveTo(0,0); $picture->arrowTo(0, $ymax-$ystep/2, black,3); for my $i (0..4) { - $picture->stamps( closed_circle(0,$i*($maxLimit/4),'blue') ); + $picture->moveTo(-$xstep/10,$i*$ystep);$picture->lineTo($xstep/10,$i*$ystep,'black',1); $mark = $i*($maxLimit/4); - $picture->lb( new Label(-$xstep/2,$i*($maxLimit/4),"$mark",'black','center','middle')); + $picture->lb( new Label(-$xstep/2,$i*($maxLimit/4),"$mark",'black','center','middle','large')); } -$picture->lb( new Label($xmax-$xstep/3,-$ystep/4,"bus lines",'black','right','middle')); -$picture->lb( new Label($xstep/4,$ymax-$ystep/3,"number of people",'black','left','middle')); +$picture->lb( new Label($xmax-$xstep,0,"bus",'black','center','bottom','large')); +$picture->lb( new Label($xmax-$xstep,0,"line",'black','center','top','large')); +$picture->lb( new Label($xstep/4,$ymax-$ystep/3,"number of people",'black','left','middle','large')); $picture->new_color("darkred", 159, 64, 16); $picture->new_color("pink",255,0,127); @@ -100,15 +103,15 @@ $picture->new_color("red", 255,0,0); $alt0 = ""; for my $i (0..$numBars-1) { - $picture->lb( new Label(($i+1)*$xstep,-$ystep/(2*(4-2*($i%2))), - "$names[$i]",$colors[$i],'center','middle')); + $picture->lb( new Label(($i+1)*$xstep,0, + "$names[$i]",$colors[$i],'center','top','large')); $picture->moveTo(($i+1-0.4)*$xstep,0); $picture->lineTo(($i+1-0.4)*$xstep,$numStudents[$i],$colors[$i],2); $picture->lineTo(($i+1+0.4)*$xstep,$numStudents[$i],$colors[$i],2); $picture->lineTo(($i+1+0.4)*$xstep,0,$colors[$i],2); $picture->fillRegion([ ($i+1)*$xstep,$numStudents[$i]/2,$colors[$i] ]); $picture->lb( new Label(($i+1)*$xstep,$numStudents[$i]+$ystep/4, - "$numStudents[$i]",$colors[$i],'center','middle')); + "$numStudents[$i]",$colors[$i],'center','middle','large')); $alt0 = $alt0."$numStudents[$i] students ride Bus $names[$i], "; } chop($alt0);chop($alt0); @@ -125,7 +128,7 @@ BEGIN_TEXT A community college conducted a survey about the number of students riding each bus line available. The following bar graph is the result of the survey. $PAR $BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} +\{ image(insertGraph( $picture ), width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} $ECENTER $PAR @@ -134,9 +137,9 @@ BEGIN_PGML What percent of students ride Bus [$busName]? -Fill in the blank with a percent. Round your percent to whole numbers, like [`11%`]. +[@KeyboardInstructions('Fill in the blank with a percent. Round your percent to whole numbers, like [`11%`].')@]** -*Solution:* Approximately [_________]{$perP} of students ride Bus [$busName]. +Approximately [_________]{$perP} of students ride Bus [$busName]. END_PGML @@ -175,7 +178,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* Approximately [`[$perOne]`] of students ride Bus [$busName]. +Approximately [`[$perOne]`] of students ride Bus [$busName]. ####Method 2 @@ -196,7 +199,7 @@ Assume [`[$numStudentsOne]`] is [`x`] (as a percent) of [` [$total] `]. We have: \end{aligned} ``] -*Solution:* Approximately [`[$perOne]`] of students ride Bus [$busName]. +Approximately [`[$perOne]`] of students ride Bus [$busName]. ####Method 3 @@ -210,7 +213,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$numStudentsOne]}{[$total]} \approx [$decNotRounded] \approx [$perOne]% ``] -*Solution:* Approximately [`[$perOne]`] of students ride Bus [$busName]. +Approximately [`[$perOne]`] of students ride Bus [$busName]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_20.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_20.pg index e44b076805..fe38dbbaba 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_20.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(population_number_answer) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "contextPercent.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -63,7 +65,7 @@ A county has [`[$whole]`] residents. In the last election, [`[$part]`] of them t Fill in the blank with a percent. -*Solution:* In the last election, [__________]{$perP} of the county's residents turned out to vote. +In the last election, [__________]{$perP} of the county's residents turned out to vote. END_PGML @@ -91,7 +93,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* In the last election, [`[$per]%`] of the county's residents turned out to vote. +In the last election, [`[$per]%`] of the county's residents turned out to vote. ####Method 2 @@ -112,7 +114,7 @@ Assume [`[$part]`] is [`x`] (as a percent) of [` [$whole] `]. We have: \end{aligned} ``] -*Solution:* In the last election, [`[$per]%`] of the county's residents turned out to vote. +In the last election, [`[$per]%`] of the county's residents turned out to vote. ####Method 3 @@ -126,7 +128,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$part]}{[$whole]} = [$per/100] = [$per]% ``] -*Solution:* In the last election, [`[$per]%`] of the county's residents turned out to vote. +In the last election, [`[$per]%`] of the county's residents turned out to vote. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_30.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_30.pg index db6e7f7471..108de232de 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_30.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') -## MLT(arithmetic_percents_calculation_painting) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "PGML.pl", "contextPercent.pl", "contextCurrency.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -60,11 +63,11 @@ TEXT(beginproblem()); BEGIN_PGML -A painting is on sale at [`[$newPriceC]`]. Its original price was [`[$wholeC]`]. What percentage is off its original price? +A painting is on sale at [`[$newPriceC]`]. Its original price was [`[$wholeC]`]. What percentage is this off its original price? -Fill in the blank with a percent. +[@KeyboardInstructions('Fill in the blank with a percent.')@]** -*Solution:* The painting was [_________]{$perP} off its original price. +The painting was [_________]{$perP} off its original price. END_PGML @@ -96,7 +99,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The painting was [`[$per]%`] off its original price. +The painting was [`[$per]%`] off its original price. ####Method 2 @@ -117,7 +120,7 @@ Assume [`[$part]`] is [`x`] (as a percent) of [` [$whole] `]. We have: \end{aligned} ``] -*Solution:* The painting was [`[$per]%`] off its original price. +The painting was [`[$per]%`] off its original price. ####Method 3 @@ -131,7 +134,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$part]}{[$whole]} = [$per/100] = [$per]% ``] -*Solution:* The painting was [`[$per]%`] off its original price. +The painting was [`[$per]%`] off its original price. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_40.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_40.pg index 3cefdfb8a9..7b4ee380ff 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_40.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(answer_is_percent1) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application','rounding') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "contextPercent.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -72,7 +74,7 @@ BEGIN_PGML Fill in the blank with a percent. Round your percent to two decimal places, like [`1.23%`]. -*Solution:* [$name] earned approximately [_________]{$perP} of interest. +[$name] earned approximately [_________]{$perP} of interest. END_PGML @@ -101,7 +103,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [$name] earned approximately [`[$per]%`] of interest. +[$name] earned approximately [`[$per]%`] of interest. ####Method 2 @@ -122,7 +124,7 @@ Assume [`[$part]`] is [`x`] (as a percent) of [` [$whole] `]. We have: \end{aligned} ``] -*Solution:* [$name] earned approximately [`[$per]%`] of interest. +[$name] earned approximately [`[$per]%`] of interest. ####Method 3 @@ -136,7 +138,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$part]}{[$whole]} \approx [$decNotRounded] \approx [$per]% ``] -*Solution:* [$name] earned approximately [`[$per]%`] of interest. +[$name] earned approximately [`[$per]%`] of interest. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_50.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_50.pg index fe2af2769e..40b2798343 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_50.pg @@ -10,16 +10,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(answer_is_percent1) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -32,7 +34,7 @@ loadMacros( "contextPercent.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -74,11 +76,11 @@ BEGIN_PGML [$name] sells cars for a living. Each month, [$pronoun] earns [`[$baseC]`] of base pay, plus a certain percentage of commission from [$possessive] sales. -One month, [$name] made [`[$wholeC]`] in sales, and earned a total of [`[$ansC]`] in that month (including base pay and commission). What percent of commission did [$name] earn? +One month, [$name] made [`[$wholeC]`] in sales, and earned a total of [`[$ansC]`] in that month (including base pay and commission). What percent commission did [$name] earn? -Fill in the blank with a percent. +[@KeyboardInstructions('Fill in the blank with a percent.')@]** -*Solution:* [$name] earned [_________]{$perP} in commission. +[$name] earned [_________]{$perP} in commission. END_PGML @@ -108,7 +110,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [$name] earned [`[$per]%`] in commission. +[$name] earned [`[$per]%`] in commission. ####Method 2 @@ -129,7 +131,7 @@ Assume [`[$part]`] is [`x`] (as a percent) of [` [$whole] `]. We have: \end{aligned} ``] -*Solution:* [$name] earned [`[$per]%`] in commission. +[$name] earned [`[$per]%`] in commission. ####Method 3 @@ -143,7 +145,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$part]}{[$whole]} = [$per/100] = [$per]% ``] -*Solution:* [$name] earned [`[$per]%`] in commission. +[$name] earned [`[$per]%`] in commission. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_60.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_60.pg index a3b0a46e3c..a87140afa3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_60.pg @@ -8,17 +8,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) ## KEYWORDS('percent','proportion','application','rounding') -## MLTleader(1) -## MLT(arithmetic_percents_calculation_mixing_chemicals) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,9 @@ loadMacros( "PGML.pl", "contextPercent.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" +# "contextCurrency.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -67,7 +70,7 @@ BEGIN_PGML Fill in the blank with a percent. Round your percent to one decimal place, like [`1.2%`]. -*Solution:* The solution has approximately [_________]{$perP} of alcohol. +The solution has approximately [_________]{$perP} of alcohol. END_PGML @@ -96,7 +99,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The solution has approximately [`[$per]%`] of alcohol. +The solution has approximately [`[$per]%`] of alcohol. ####Method 2 @@ -117,7 +120,7 @@ Assume [`[$part]`] is [`x`] (as a percent) of [` [$whole] `]. We have: \end{aligned} ``] -*Solution:* The solution has approximately [`[$per]%`] of alcohol. +The solution has approximately [`[$per]%`] of alcohol. ####Method 3 @@ -131,7 +134,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$part]}{[$whole]} \approx [$decNotRounded] \approx [$per]% ``] -*Solution:* The solution has approximately [`[$per]%`] of alcohol. +The solution has approximately [`[$per]%`] of alcohol. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_70.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_70.pg index 3f65c71e31..a24fed6af5 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_70.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(population_number_answer) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGML.pl", "contextPercent.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,9 +67,9 @@ BEGIN_PGML A town has [`[$whole]`] registered residents. Among them, there are [`[$numDem]`] Democrats and [`[$numRep]`] Republicans. The rest are Independents. What percentage of registered voters in this town are Independents? -Fill in the blank with a percent. +[@KeyboardInstructions('Fill in the blank with a percent.')@]** -*Solution:* In this town, [__________]{$perP} of all registered voters are Independents. +In this town, [__________]{$perP} of all registered voters are Independents. END_PGML @@ -97,7 +99,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* In this town, [`[$per]%`] of all registered voters are Independents. +In this town, [`[$per]%`] of all registered voters are Independents. ####Method 2 @@ -118,7 +120,7 @@ Assume [`[$part]`] is [`x`] (as a percent) of [` [$whole] `]. We have: \end{aligned} ``] -*Solution:* In this town, [`[$per]%`] of all registered voters are Independents. +In this town, [`[$per]%`] of all registered voters are Independents. ####Method 3 @@ -132,7 +134,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$part]}{[$whole]} = [$per/100] = [$per]% ``] -*Solution:* In this town, [`[$per]%`] of all registered voters are Independents. +In this town, [`[$per]%`] of all registered voters are Independents. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_80.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_80.pg index d6fd32760f..9473c28d58 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_80.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(answer_is_percent1) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application','rounding') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "contextPercent.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -72,7 +74,7 @@ A dinner bill of [`[$wholeC]`] came. [$name] paid the bill, plus [`[$partC]`] in Fill in the blank with a percent. Round your percentage to whole numbers, like [`11%`]. -*Solution:* [$name] left approximately [_________]{$perP} of tips. +[$name] left approximately [_________]{$perP} of tips. END_PGML @@ -101,7 +103,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [$name] left approximately [`[$per]%`] of tips. +[$name] left approximately [`[$per]%`] of tips. ####Method 2 @@ -122,7 +124,7 @@ Assume [`[$part]`] is [`x`] (as a percent) of [` [$whole] `]. We have: \end{aligned} ``] -*Solution:* [$name] left approximately [`[$per]%`] of tips. +[$name] left approximately [`[$per]%`] of tips. ####Method 3 @@ -136,7 +138,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$part]}{[$whole]} \approx [$decNotRounded] \approx [$per]% ``] -*Solution:* [$name] left approximately [`[$per]%`] of tips. +[$name] left approximately [`[$per]%`] of tips. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_90.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_90.pg index c8bdddfd07..017362b014 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType2_90.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(answer_is_percent1) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application','rounding') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "contextPercent.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -74,7 +76,7 @@ A dinner bill of [`[$wholeC]`] came. [$name] paid a total of [`[$totalC]`], incl Fill in the blank with a percent. Round your percent to whole numbers, like [`11%`]. -*Solution:* [$name] left [_________]{$perP} of tips. +[$name] left [_________]{$perP} of tips. END_PGML @@ -103,7 +105,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [$name] left approximately [`[$per]%`] of tips. +[$name] left approximately [`[$per]%`] of tips. ####Method 2 @@ -124,7 +126,7 @@ Assume [`[$part]`] is [`x`] (as a percent) of [` [$whole] `]. We have: \end{aligned} ``] -*Solution:* [$name] left approximately [`[$per]%`] of tips. +[$name] left approximately [`[$per]%`] of tips. ####Method 3 @@ -138,7 +140,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$part]}{[$whole]} \approx [$decNotRounded] \approx [$per]% ``] -*Solution:* [$name] left approximately [`[$per]%`] of tips. +[$name] left approximately [`[$per]%`] of tips. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_10.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_10.pg index 79f737600b..10de841fa9 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_10.pg @@ -7,15 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -51,7 +54,7 @@ BEGIN_PGML In the past few seasons' basketball games, [$name] made [` [$per]% `] of his free throw attempts. If [$pronoun] made [`[$part]`] free throws, how many free throws did [$pronoun] attempt? -*Solution:* In the past few seasons, [$name] attempted a total of [___________]{$whole} free throws. +In the past few seasons, [$name] attempted a total of [___________]{$whole} free throws. END_PGML @@ -77,7 +80,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* In the past few seasons, [$name] attempted a total of [`[$whole]`] free throws. +In the past few seasons, [$name] attempted a total of [`[$whole]`] free throws. ####Method 2 @@ -95,7 +98,7 @@ The question is: [`[$part]`] is [` [$per]% `] of what? Assume [`[$part]`] is [` \end{aligned} ``] -*Solution:* In the past few seasons, [$name] attempted a total of [`[$whole]`] free throws. +In the past few seasons, [$name] attempted a total of [`[$whole]`] free throws. ####Method 3 @@ -109,7 +112,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$per]%} = \frac{[$part]}{[$per/100]} = [$whole] ``] -*Solution:* In the past few seasons, [$name] attempted a total of [`[$whole]`] free throws. +In the past few seasons, [$name] attempted a total of [`[$whole]`] free throws. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_100.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_100.pg index 952f0654a2..a8a11f68eb 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_100.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_100.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Fractions') ## KEYWORDS('percent','graph','application','pie chart') -## MLT(arithmetic_percents_calculation_pie_chart) +## DBCCSS('7.RP.3','6.RP.3c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", - "PGcourse.pl" + "PGcourse.pl", +# "contextFraction.pl", ); ############################################## @@ -152,7 +155,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The collector has a total of [`[$whole]`] signatures from all artists. +The collector has a total of [`[$whole]`] signatures from all artists. ####Method 2 @@ -170,7 +173,7 @@ The question is: [`[$rolling]`] is [` [$perRolling]% `] of what? Assume [`[$roll \end{aligned} ``] -*Solution:* The collector has a total of [`[$whole]`] signatures from all artists. +The collector has a total of [`[$whole]`] signatures from all artists. ####Method 3 @@ -184,7 +187,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$rolling]}{[$perRolling]%} = \frac{[$rolling]}{[$perRolling/100]} = [$whole] ``] -*Solution:* The collector has a total of [`[$whole]`] signatures from all artists. +The collector has a total of [`[$whole]`] signatures from all artists. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_110.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_110.pg index 84ef827d11..08c337d007 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_110.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_110.pg @@ -7,28 +7,31 @@ # # ENDDESCRIPTION -## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_from_table5) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('percent','proportion','application') +## DBCCSS('7.RP.3','6.RP.3c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -102,9 +105,9 @@ BEGIN_PGML The highlighted row means each serving of macaroni and cheese in this box contains [`[$partU]`] of fat, which is [`[$per]%`] of an average person's daily intake of fat. What's the recommended daily intake of fat for an average person? -*Solution:* The recommended daily intake of fat for an average person is [___________]{$wholeU}. +The recommended daily intake of fat for an average person is [___________]{$wholeU}. -Use *g* for grams. +[@KeyboardInstructions('Use [|g|]* for grams.')@]** END_PGML @@ -131,7 +134,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The recommended daily intake of fat for an average person is [`[$wholeU]`]. +The recommended daily intake of fat for an average person is [`[$wholeU]`]. ####Method 2 @@ -149,7 +152,7 @@ The question is: [`[$part]`] is [` [$per]% `] of what? Assume [`[$part]`] is [` \end{aligned} ``] -*Solution:* The recommended daily intake of fat for an average person is [`[$wholeU]`]. +The recommended daily intake of fat for an average person is [`[$wholeU]`]. ####Method 3 @@ -163,7 +166,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$per]%} = \frac{[$part]}{[$per/100]} = [$whole] ``] -*Solution:* The recommended daily intake of fat for an average person is [`[$wholeU]`]. +The recommended daily intake of fat for an average person is [`[$wholeU]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_20.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_20.pg index 3ad77eeda9..b6ae01b0ee 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_20.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(population_number_answer) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +28,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,7 +49,7 @@ BEGIN_PGML In the last election, [`[$per]%`] of a county's residents, or [`[$part]`] people, turned out to vote. How many residents live in this county? -*Solution:* This county has [_________]{$whole} residents. +This county has [_________]{$whole} residents. END_PGML @@ -72,7 +75,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* This county has [`[$whole]`] residents. +This county has [`[$whole]`] residents. ####Method 2 @@ -90,7 +93,7 @@ The question is: [`[$part]`] is [` [$per]% `] of what? Assume [`[$part]`] is [` \end{aligned} ``] -*Solution:* This county has [`[$whole]`] residents. +This county has [`[$whole]`] residents. ####Method 3 @@ -104,7 +107,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$per]%} = \frac{[$part]}{[$per/100]} = [$whole] ``] -*Solution:* This county has [`[$whole]`] residents. +This county has [`[$whole]`] residents. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_30.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_30.pg index b1ba100884..9004f80ba5 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_30.pg @@ -7,17 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(moneymoneymoney) -## MLTleader(1) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -55,7 +57,7 @@ BEGIN_PGML A painting is on sale with [`[$sale]%`] off. Its current price is [`[$partC]`]. What was the painting's original price? -*Solution:* The painting's original price was [_________]{$wholeC}. +The painting's original price was [_________]{$wholeC}. END_PGML @@ -83,7 +85,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The painting's original price was [`[$wholeC]`]. +The painting's original price was [`[$wholeC]`]. ####Method 2 @@ -101,7 +103,7 @@ The question is: [`[$part]`] is [` [$per]% `] of what? Assume [`[$part]`] is [` \end{aligned} ``] -*Solution:* The painting's original price was [`[$wholeC]`]. +The painting's original price was [`[$wholeC]`]. ####Method 3 @@ -115,7 +117,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$per]%} = \frac{[$part]}{[$per/100]} = [$whole] ``] -*Solution:* The painting's original price was [`[$wholeC]`]. +The painting's original price was [`[$wholeC]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_40.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_40.pg index 2995b1d94d..10252d22bb 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_40.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(moneymoneymoney) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -58,7 +60,7 @@ BEGIN_PGML [$name] earned [`[$partC]`] of interest from a mutual fund, which was [`[$per]%`] of his total investment. How much money did [$name] invest into this mutual fund? -*Solution:* [$name] invested [_________]{$wholeC} in this mutual fund. +[$name] invested [_________]{$wholeC} in this mutual fund. END_PGML @@ -84,7 +86,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [$name] invested [`[$wholeC]`] in this mutual fund. +[$name] invested [`[$wholeC]`] in this mutual fund. ####Method 2 @@ -102,7 +104,7 @@ The question is: [`[$part]`] is [` [$per]% `] of what? Assume [`[$part]`] is [` \end{aligned} ``] -*Solution:* [$name] invested [`[$wholeC]`] in this mutual fund. +[$name] invested [`[$wholeC]`] in this mutual fund. ####Method 3 @@ -116,7 +118,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$per]%} = \frac{[$part]}{[$per/100]} = [$whole] ``] -*Solution:* [$name] invested [`[$wholeC]`] in this mutual fund. +[$name] invested [`[$wholeC]`] in this mutual fund. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_50.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_50.pg index 9a93592c62..eda9128077 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_50.pg @@ -9,16 +9,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(moneymoneymoney) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +32,7 @@ loadMacros( "PGML.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -67,7 +69,7 @@ BEGIN_PGML One month, [$name] earned a total of [`[$ansC]`], including base pay and commission. How much in sales did [$name] make in that month? -*Solution:* [$name] made [_________]{$wholeC} in sales in that month. +[$name] made [_________]{$wholeC} in sales in that month. END_PGML @@ -95,7 +97,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [$name] made [`[$wholeC]`] in sales in that month. +[$name] made [`[$wholeC]`] in sales in that month. ####Method 2 @@ -113,7 +115,7 @@ The question is: [`[$part]`] is [` [$per]% `] of what? Assume [`[$part]`] is [` \end{aligned} ``] -*Solution:* [$name] made [`[$wholeC]`] in sales in that month. +[$name] made [`[$wholeC]`] in sales in that month. ####Method 3 @@ -127,7 +129,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$per]%} = \frac{[$part]}{[$per/100]} = [$whole] ``] -*Solution:* [$name] made [`[$wholeC]`] in sales in that month. +[$name] made [`[$wholeC]`] in sales in that month. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_60.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_60.pg index 1a54b5d0c9..322b5facea 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_60.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(arithmetic_percents_calculation_mixing_chemicals) -## Level(3) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -48,11 +51,9 @@ TEXT(beginproblem()); BEGIN_PGML -[`[$part]`] grams of pure alcohol was used to produce a bottle of [`[$per]%`] alcohol solution. What is the weight of the solution in grams? +[`[$part]`] grams of pure alcohol was used to produce a bottle of [`[$per]%`] alcohol solution. What is the weight of the solution in grams? [@KeyboardInstructions('Use [|g|]* for grams.')@]** -*Solution:* The alcohol solution weighs [_________]{$wholeU}. - -Use *g* for grams. +The alcohol solution weighs [_________]{$wholeU}. END_PGML @@ -78,7 +79,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The alcohol solution weighs [`[$wholeU]`]. +The alcohol solution weighs [`[$wholeU]`]. ####Method 2 @@ -96,7 +97,7 @@ The question is: [`[$part]`] is [` [$per]% `] of what? Assume [`[$part]`] is [` \end{aligned} ``] -*Solution:* The alcohol solution weighs [`[$wholeU]`]. +The alcohol solution weighs [`[$wholeU]`]. ####Method 3 @@ -110,7 +111,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$per]%} = \frac{[$part]}{[$per/100]} = [$whole] ``] -*Solution:* The alcohol solution weighs [`[$wholeU]`]. +The alcohol solution weighs [`[$wholeU]`]. END_PGML_SOLUTION ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_70.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_70.pg index 7e0c5eb9d7..26b3be50b4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_70.pg @@ -9,16 +9,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(population_number_answer) -## Level(3) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -55,7 +58,7 @@ Among a town's registered voters, there are [`[$perDem]%`] Democrats and [`[$per If there are [`[$part]`] registered Independent voters in this town, how many total registered voters are there? -*Solution:* This town has [_________]{$whole} registered Independent voters. +This town has [_________]{$whole} registered Independent voters. END_PGML @@ -92,7 +95,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* This town has [`[$whole]`] registered Independent voters. +This town has [`[$whole]`] registered Independent voters. ####Method 2 @@ -110,7 +113,7 @@ The question is: [`[$part]`] is [` [$per]% `] of what? Assume [`[$part]`] is [` \end{aligned} ``] -*Solution:* This town has [`[$whole]`] registered Independent voters. +This town has [`[$whole]`] registered Independent voters. ####Method 3 @@ -124,7 +127,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$per]%} = \frac{[$part]}{[$per/100]} = [$whole] ``] -*Solution:* This town has [`[$whole]`] registered Independent voters. +This town has [`[$whole]`] registered Independent voters. END_PGML_SOLUTION ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_80.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_80.pg index 920660c912..8900863b5a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_80.pg @@ -7,16 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(moneymoneymoney) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "PGML.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -59,7 +61,7 @@ BEGIN_PGML [$name] paid a dinner and left [`[$per]%`], or [`[$partC]`], in tips. How much was the original bill (without counting the tip)? -*Solution:* The original bill (not including the tip) was [_________]{$wholeC}. +The original bill (not including the tip) was [_________]{$wholeC}. END_PGML @@ -85,7 +87,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The original bill (not including the tip) was [`[$wholeC]`]. +The original bill (not including the tip) was [`[$wholeC]`]. ####Method 2 @@ -103,7 +105,7 @@ The question is: [`[$part]`] is [` [$per]% `] of what? Assume [`[$part]`] is [` \end{aligned} ``] -*Solution:* The original bill (not including the tip) was [`[$wholeC]`]. +The original bill (not including the tip) was [`[$wholeC]`]. ####Method 3 @@ -117,7 +119,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$per]%} = \frac{[$part]}{[$per/100]} = [$whole] ``] -*Solution:* The original bill (not including the tip) was [`[$wholeC]`]. +The original bill (not including the tip) was [`[$wholeC]`]. END_PGML_SOLUTION ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_90.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_90.pg index da38cc29ed..3de253f2b2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentApplicationType3_90.pg @@ -7,17 +7,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLTleader(1) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "PGML.pl", "contextCurrency.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,7 +57,7 @@ BEGIN_PGML The seller of a watch marked up the price by [`[$per]%`], and the new price is [`[$totalC]`]. What was the watch's original price before the markup? -*Solution:* The watch's original price was [_________]{$wholeC}. +The watch's original price was [_________]{$wholeC}. END_PGML @@ -86,7 +87,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The watch's original price was [`[$wholeC]`]. +The watch's original price was [`[$wholeC]`]. ####Method 2 @@ -104,7 +105,7 @@ The question is: [`[$total]`] is [` [$per+100]% `] of what? Assume [`[$total]`] \end{aligned} ``] -*Solution:* The watch's original price was [`[$wholeC]`]. +The watch's original price was [`[$wholeC]`]. ####Method 3 @@ -118,7 +119,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$total]}{[$per+100]%} = \frac{[$total]}{[$s1]} = [$whole] ``] -*Solution:* The watch's original price was [`[$wholeC]`]. +The watch's original price was [`[$wholeC]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease10.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease10.pg index 884e3744a7..3132a003f6 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease10.pg @@ -6,16 +6,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','decrease','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,8 +27,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "answerHints.pl",, "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,7 +59,7 @@ BEGIN_PGML The population of cats in a shelter decreased from [`[$original]`] to [`[$new]`]. What is the percentage decrease of the shelter's cat population? -*Solution:* The percentage decrease is [________]{$ans}. +The percentage decrease is [________]{$ans}. END_PGML @@ -104,7 +107,7 @@ We will use proportion to solve this problem. \end{aligned} ``] -*Solution:* The percentage decrease of the shelter's cat population is [`[$per]%`]. +The percentage decrease of the shelter's cat population is [`[$per]%`]. ####Method 2 @@ -125,7 +128,7 @@ Let [`x`] be the unknown percentage, and let the decrease [`[$decrease]`] be [`x \end{aligned} `] -*Solution:* The percentage decrease of the shelter's cat population is [`[$per]%`]. +The percentage decrease of the shelter's cat population is [`[$per]%`]. ####Method 3 @@ -135,7 +138,7 @@ We first divide the "new number" by the "original number": So the new number is [`[$s2]%`] of the original number, implying the percentage decrease is [` 100% - [$s2]% = [$per]% `]. -*Solution:* The percentage decrease of the shelter's cat population is [`[$per]%`]. +The percentage decrease of the shelter's cat population is [`[$per]%`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease100.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease100.pg index 32333b8d99..67cf251ebd 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease100.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease100.pg @@ -7,16 +7,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','decrease','increase','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease110.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease110.pg index 1247d9007a..c59ace7a56 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease110.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease110.pg @@ -7,16 +7,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','decrease','increase','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease120.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease120.pg index 22b11dc980..03ccb2d3c6 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease120.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease120.pg @@ -7,16 +7,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','increase','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -59,7 +61,7 @@ BEGIN_PGML A house was bought two years ago at the price of [`[$value0C]`]. Each year, the house's value increased by [`[$per]%`]. What's the house's value this year? -*Solution:* The house's value this year is [__________]{$value2C}. +The house's value this year is [__________]{$value2C}. END_PGML @@ -113,7 +115,7 @@ Or we can use the percentage formula to find the amount of increase: After two years, the house's value became [`[$value1C]+[$increase1C]=[$value2C]`]. -*Solution:* The house's value this year is [`[$value2C]`]. +The house's value this year is [`[$value2C]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease130.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease130.pg index e61079de3a..80267d3dbf 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease130.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease130.pg @@ -7,16 +7,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','decrease','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -59,7 +61,7 @@ BEGIN_PGML A house was bought two years ago at the price of [`[$value0C]`]. Each year, the house's value decreased by [`[$per]%`]. What's the house's value this year? -*Solution:* The house's value this year is [__________]{$value2C}. +The house's value this year is [__________]{$value2C}. END_PGML @@ -113,7 +115,7 @@ Or we can use the percentage formula to find the amount of decrease: After two years, the house's value became [`[$value1C]-[$decrease1C]=[$value2C]`]. -*Solution:* The house's value this year is [`[$value2C]`]. +The house's value this year is [`[$value2C]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease140.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease140.pg index a6ae13c926..eced50b421 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease140.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease140.pg @@ -8,16 +8,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(population_number_answer) -## Level(2) -## MO(1) ## KEYWORDS('percent','increase','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -47,7 +49,7 @@ BEGIN_PGML A small town experienced explosive population increase. Originally, the town had [`[$original]`] population. Within 3 years, the town's population increased by [`[$per]%`]. What's the town's current population? -*Solution:* The town's current population is [__________]{$new}. +The town's current population is [__________]{$new}. END_PGML diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease150.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease150.pg index 7b7cb2cde1..7880af6a5f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease150.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease150.pg @@ -8,17 +8,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(population_number_answer) -## MLTleader(1) -## Level(2) -## MO(1) ## KEYWORDS('percent','increase','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,7 +81,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The town's original population was [`[$ans]`]. +The town's original population was [`[$ans]`]. ####Method 2 @@ -98,7 +99,7 @@ The question is: [`[$new]`] is [` [$per+100]% `] of what? Assume [`[$new]`] is [ \end{aligned} ``] -*Solution:* The town's original population was [`[$ans]`]. +The town's original population was [`[$ans]`]. ####Method 3 @@ -112,7 +113,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$new]}{[$per+100]%} = \frac{[$new]}{[$s1]} = [$ans] ``] -*Solution:* The town's original population was [`[$ans]`]. +The town's original population was [`[$ans]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease160.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease160.pg index a90b667823..6f63788e66 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease160.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease160.pg @@ -8,16 +8,18 @@ # Last updated: Carl Yao 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(moneymoneymoney) -## Level(3) -## MO(1) ## KEYWORDS('percent','increase','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,9 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PCCmacros.pl", + "PCCmacros.pl",, "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -94,7 +96,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* One year ago, the balance was [`[$ansC]`]. +One year ago, the balance was [`[$ansC]`]. ####Method 2 @@ -112,7 +114,7 @@ The question is: [`[$new]`] is [` [$per+100]% `] of what? Assume [`[$new]`] is [ \end{aligned} ``] -*Solution:* One year ago, the balance was [`[$ansC]`]. +One year ago, the balance was [`[$ansC]`]. ####Method 3 @@ -126,7 +128,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$new]}{[$per+100]%} = \frac{[$new]}{[$s1]} = [$ans] ``] -*Solution:* One year ago, the balance was [`[$ansC]`]. +One year ago, the balance was [`[$ansC]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease170.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease170.pg index 7482286578..ef1b950e84 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease170.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease170.pg @@ -8,16 +8,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(moneymoneymoney) -## Level(1) -## MO(1) ## KEYWORDS('percent','decrease','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -84,7 +86,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The sweater's original price was [`[$ansC]`]. +The sweater's original price was [`[$ansC]`]. ####Method 2 @@ -102,7 +104,7 @@ The question is: [`[$new]`] is [` [$newPer]% `] of what? Assume [`[$new]`] is [` \end{aligned} ``] -*Solution:* The sweater's original price was [`[$ansC]`]. +The sweater's original price was [`[$ansC]`]. ####Method 3 @@ -116,7 +118,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$new]}{[$newPer]%} = \frac{[$new]}{[$newPer/100]} = [$ans] ``] -*Solution:* The sweater's original price was [`[$ansC]`]. +The sweater's original price was [`[$ansC]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease20.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease20.pg index 49466a331d..cff6696fb2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease20.pg @@ -6,16 +6,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','increase','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,8 +27,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "answerHints.pl",, "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -56,7 +59,7 @@ BEGIN_PGML The population of cats in a shelter increased from [`[$original]`] to [`[$new]`]. What is the percentage increase of the shelter's cat population? -*Solution:* The percentage increase is [________]{$ans}. +The percentage increase is [________]{$ans}. END_PGML @@ -82,7 +85,7 @@ Next, since we started with [`[$original]`] cats, we need to ask: [`[$increase]` Notice that [`[$increase]=[$dec]\cdot[$original]`]. This implies the population increase is [`[$per]%`]. -*Solution:* The percentage increase of the shelter's cat population is [`[$per]%`]. +The percentage increase of the shelter's cat population is [`[$per]%`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease30.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease30.pg index 04c401b09e..2cf6ad8461 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease30.pg @@ -6,16 +6,18 @@ # Last updated: Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','increase','application','rounding') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,8 +27,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "answerHints.pl", "contextPercent.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -59,9 +63,9 @@ BEGIN_PGML The population of cats in a shelter increased from [`[$original]`] to [`[$new]`]. What is the percentage increase of the shelter's cat population? -Fill in the blank with percent. Round your answer to [`2`] decimal places, like [`12.34%`]. +[@KeyboardInstructions('Fill in the blank with percent. Round your answer to [`2`] decimal places, like [`12.34%`].')@]** -*Solution:* The percentage increase is approximately [________]{$ans}. +The percentage increase is approximately [________]{$ans}. END_PGML @@ -113,7 +117,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The percentage increase of the shelter's cat population is approximately [`[$perInc]%`]. +The percentage increase of the shelter's cat population is approximately [`[$perInc]%`]. ####Method 2 @@ -134,7 +138,7 @@ Let the increase [`[$inc]`] be [`x`] (as a percent) of [`[$original]`]. That mea \end{aligned} `] -*Solution:* The percentage increase of the shelter's cat population is approximately [`[$perInc]%`]. +The percentage increase of the shelter's cat population is approximately [`[$perInc]%`]. ####Method 3 @@ -144,7 +148,7 @@ We first divide the "new number" by the "original number": So the new number is approximately [`[$s3]%`] of the original number, implying the percentage increase is approximately [` [$s3]% - 100% = [$perInc]% `]. -*Solution:* The percentage increase of the shelter's cat population is approximately [`[$perInc]%`]. +The percentage increase of the shelter's cat population is approximately [`[$perInc]%`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease40.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease40.pg index 6136cd030e..97418de7ac 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease40.pg @@ -7,16 +7,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(moneymoneymoney) -## Level(2) -## MO(1) ## KEYWORDS('percent','increase','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PCCmacros.pl", "contextPercent.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -71,7 +73,7 @@ BEGIN_PGML [$name] used to make [`[$originalC]`] dollars per hour. After [$pronoun] earned [$modify] Bachelor's degree, [$modify] pay rate increased to [`[$newC]`] dollars per hour. What is the percentage increase in [$name]'s salary? -*Solution:* The percentage increase is [________]{$ans}. +The percentage increase is [________]{$ans}. END_PGML @@ -109,7 +111,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The percentage increase in [$name]'s salary was [`[$per]%`]. +The percentage increase in [$name]'s salary was [`[$per]%`]. ####Method 2 @@ -129,7 +131,7 @@ Let the increase [`[$increase]`] be [`x`] (as a percent) of [`[$original]`]. Tha \end{aligned} `] -*Solution:* The percentage increase in [$name]'s salary was [`[$per]%`]. +The percentage increase in [$name]'s salary was [`[$per]%`]. ####Method 3 @@ -139,7 +141,7 @@ We first divide the "new number" by the "original number": So the new number is [`[$s3]%`] of the original number, implying the percentage increase is [` [$s3]% - 100% = [$per]% `]. -*Solution:* The percentage increase in [$name]'s salary was [`[$per]%`]. +The percentage increase in [$name]'s salary was [`[$per]%`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease50.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease50.pg index 9eed4b7ab9..fb1fae1c71 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease50.pg @@ -7,16 +7,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','decrease','application','rounding') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,7 +64,7 @@ An Internet service provider used to have [`[$original]`] dial-up customers abou Fill in the blank with a percent. Round your answer to a whole percent, like [`12%`]. -*Solution:* The total percent decrease was approximately [________]{$ans}. +The total percent decrease was approximately [________]{$ans}. END_PGML @@ -104,7 +106,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The percentage decrease of the number of dial-up users was approximately [`[$per]%`]. +The percentage decrease of the number of dial-up users was approximately [`[$per]%`]. ####Method 2 @@ -125,7 +127,7 @@ Let the decrease [`[$decrease]`] be [`x`] (as a percent) of [`[$original]`]. Tha \end{aligned} `] -*Solution:* The percentage decrease of the number of dial-up users was approximately [`[$per]%`]. +The percentage decrease of the number of dial-up users was approximately [`[$per]%`]. ####Method 3 @@ -135,7 +137,7 @@ We first divide the "new number" by the "original number": So the new number is [`[$s2]%`] of the original number, implying the percentage decrease is [` 100% - [$s2]% = [$per]% `]. -*Solution:* The percentage decrease of the number of dial-up users was approximately [`[$per]%`]. +The percentage decrease of the number of dial-up users was approximately [`[$per]%`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease60.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease60.pg index 017af53ad7..0283c1ceaf 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease60.pg @@ -7,16 +7,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(answer_is_percent1) -## Level(2) -## MO(1) ## KEYWORDS('percent','increase','application','rounding') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PCCmacros.pl", "contextPercent.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -77,7 +79,7 @@ Last year, [$name] purchased a house at the cost of [`[$originalC]`]. The house Fill in blank with a percent. Round your answer to two decimal places, like [`1.23%`]. -*Solution:* The percentage increase of the house value is [________]{$ans}. +The percentage increase of the house value is [________]{$ans}. END_PGML @@ -115,7 +117,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The percentage increase in the house value was approximately [`[$per]%`]. +The percentage increase in the house value was approximately [`[$per]%`]. ####Method 2 @@ -136,7 +138,7 @@ Let the increase [`[$increase]`] be [`x`] (as a percent) of [`[$original]`]. Tha \end{aligned} `] -*Solution:* The percentage increase in the house value was approximately [`[$per]%`]. +The percentage increase in the house value was approximately [`[$per]%`]. ####Method 3 @@ -146,7 +148,7 @@ We first divide the "new number" by the "original number": So the new number is approximately [`[$s3]%`] of the original number, implying the percentage increase is approximately [` [$s3]% - 100% = [$per]% `]. -*Solution:* The percentage increase in the house value was approximately [`[$per]%`]. +The percentage increase in the house value was approximately [`[$per]%`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease70.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease70.pg index 587cdc8975..448d29a88a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease70.pg @@ -7,16 +7,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(answer_is_percent1) -## Level(2) -## MO(1) ## KEYWORDS('percent','increase','application','rounding') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "PGML.pl", "PCCmacros.pl", "contextPercent.pl", - "PGcourse.pl" +# "contextCurrency.pl", + "PGcourse.pl", ); ############################################## @@ -67,11 +70,11 @@ TEXT(beginproblem()); BEGIN_PGML -Last year, a small town had [`[$original]`] population. This year, the population decreased to [`[$new]`]. What is the percentage decrease of the town's population? +Last year, a small town's population was [`[$original]`]. This year, the population decreased to [`[$new]`]. What is the percentage decrease? -Fill in blank with a percent. Round your answer to two decimal places, like [`1.23%`]. +[@KeyboardInstructions('Fill in blank with a percent. Round your answer to two decimal places, like [`1.23%`].')@]** -*Solution:* The percentage decrease of the town's population was approximately [________]{$ans}. +The percentage decrease of the town's population was approximately [________]{$ans}. END_PGML @@ -113,7 +116,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The percentage decrease of the town's population was approximately [`[$per]%`]. +The percentage decrease of the town's population was approximately [`[$per]%`]. ####Method 2 @@ -134,7 +137,7 @@ Let the decrease [`[$decrease]`] be [`x`] (as a percent) of [`[$original]`]. Tha \end{aligned} `] -*Solution:* The percentage decrease of the town's population was approximately [`[$per]%`]. +The percentage decrease of the town's population was approximately [`[$per]%`]. ####Method 3 @@ -144,7 +147,7 @@ We first divide the "new number" by the "original number": So the new number is [`[$s2]%`] of the original number, implying the percentage decrease is [` 100% - [$s2]% = [$per]% `]. -*Solution:* The percentage decrease of the town's population was approximately [`[$per]%`]. +The percentage decrease of the town's population was approximately [`[$per]%`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease80.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease80.pg index e1208e0a39..db8fb8b77f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease80.pg @@ -7,16 +7,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','increase','application','rounding') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,8 +28,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "PCCmacros.pl", "contextPercent.pl", - "PGcourse.pl" +# "contextCurrency.pl", + "PGcourse.pl", ); ############################################## @@ -63,7 +67,7 @@ A baby was born [`2`] years ago. In these [`2`] years, the baby grew [`[$increas Fill in blank with a percent. Round your answer to a whole percent, like [`12%`]. -*Solution:* The percentage increase of the baby's weight was approximately [________]{$ans}. +The percentage increase of the baby's weight was approximately [________]{$ans}. END_PGML @@ -102,7 +106,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The percentage increase of the baby's weight was approximately [`[$per]%`]. +The percentage increase of the baby's weight was approximately [`[$per]%`]. ####Method 2 @@ -123,7 +127,7 @@ Let the increase [`[$increase]`] be [`x`] (as a percent) of [`[$original]`]. Tha \end{aligned} `] -*Solution:* The percentage increase of the baby's weight was approximately [`[$per]%`]. +The percentage increase of the baby's weight was approximately [`[$per]%`]. ####Method 3 @@ -133,7 +137,7 @@ We first divide the "new number" by the "original number": So the new number is approximately [`[$s3]%`] of the original number, implying the percentage increase was approximately [` [$s3]% - 100% = [$per]% `]. -*Solution:* The percentage increase of the baby's weight was approximately [`[$per]%`]. +The percentage increase of the baby's weight was approximately [`[$per]%`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease90.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease90.pg index 3c01ba27e6..c305eb00da 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease90.pg @@ -8,16 +8,18 @@ # Carl Yao, 11/15/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_IncrDecr_direct2) -## Level(2) -## MO(1) ## KEYWORDS('percent','decrease','application') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +32,7 @@ loadMacros( "PCCmacros.pl", "contextPercent.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,7 +66,7 @@ BEGIN_PGML A company's stock value (per share) dropped by [`[$decreaseC]`], and its current value is [`[$newC]`]. What is the percentage decrease of the stock's value? -*Solution:* The percentage decrease in the stock's value was [________]{$ans}. +The percentage decrease in the stock's value was [________]{$ans}. END_PGML @@ -102,7 +104,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* The percentage decrease in the stock's value was [`[$per]%`]. +The percentage decrease in the stock's value was [`[$per]%`]. ####Method 2 @@ -123,7 +125,7 @@ Let the decrease [`[$decrease]`] be [`x`] (as a percent) of [`[$original]`]. Tha \end{aligned} `] -*Solution:* The percentage decrease in the stock's value was [`[$per]%`]. +The percentage decrease in the stock's value was [`[$per]%`]. ####Method 3 @@ -133,7 +135,7 @@ We first divide the "new number" by the "original number": So the new number is [`[$s2]%`] of the original number, implying the percentage decrease is [` 100% - [$s2]% = [$per]% `]. -*Solution:* The percentage decrease in the stock's value was [`[$per]%`]. +The percentage decrease in the stock's value was [`[$per]%`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease95.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease95.pg index 3f0a3de1bc..502955dbbb 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease95.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentIncreaseDecrease95.pg @@ -7,30 +7,33 @@ # # ENDDESCRIPTION -## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## MLT(percents_from_table5) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('') ## KEYWORDS('percent','graph','application','line graph','rounding') +## DBCCSS('7.RP.3','6.RP.3c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "contextPercent.pl", "contextCurrency.pl", +# "contextFraction.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -40,7 +43,7 @@ Context("LimitedNumeric"); $numPoints = 5; $maxLimit = 2; -@days = ("Nov. 1","Nov. 2","Nov. 3","Nov. 4","Nov. 5"); +@days = ("11/1","11/2","11/3","11/4","11/5"); @price = (0,0,0,0,0); @priceC = (); @@ -88,35 +91,32 @@ $ymin = -$ystep/2; $ymax = $yCover + $ystep; $picture = init_graph($xmin,$ymin,$xmax,$ymax, - pixels=>[400,400]); + pixels=>[600/1.5,600/3]); $picture->lb('reset'); $picture->moveTo(0,0); -$picture->lineTo($xmax-$xstep, 0, black,3); +$picture->arrowTo($xmax-$xstep, 0, black,3); $picture->moveTo(0,0); $picture->arrowTo(0, $ymax-$ystep/2, black,3); for my $i (0..4) { - $picture->stamps( closed_circle(0,$i*($maxLimit/4),'blue') ); + $picture->moveTo(-$xstep/10,$i*$ystep);$picture->lineTo($xstep/10,$i*$ystep,'black',1); $mark = $i*($maxLimit/4); - Context("Currency"); - $mark = Currency($mark); - $picture->lb( new Label(-$xstep/2,$i*($maxLimit/4),"$mark",'black','center','middle')); - Context("LimitedNumeric"); + $picture->lb( new Label(-$xstep/2,$i*($maxLimit/4),'$'.sprintf("%.2f", $mark),'black','center','middle','large')); } -$picture->lb( new Label($xmax-$xstep,-$ystep/4,"days",'black','center','middle')); -$picture->lb( new Label($xstep/4,$ymax-$ystep/3,"stock price in dollars",'black','left','middle')); +$picture->lb( new Label($xmax-$xstep,-$ystep/4,"day",'black','center','middle','large')); +$picture->lb( new Label($xstep/4,$ymax-$ystep/3,"stock price in dollars",'black','left','middle','large')); $picture->moveTo($xstep,$price[0]); $alt = "This is a line graph about a stock's price change over $numPoints days. "; for my $i (0..$numPoints-1) { - $picture->lb( new Label(($i+1)*$xstep,-$ystep/(2*(4-2*($i%2))), - "$days[$i]",'black','center','middle')); + $picture->lb( new Label(($i+1)*$xstep,0, + "$days[$i]",'black','center','top','large')); $picture->lineTo(($i+1)*$xstep,$price[$i],'red',1); - $picture->stamps( closed_circle(($i+1)*$xstep,$price[$i],'blue') ); - $picture->lb( new Label(($i+1)*$xstep,$price[$i]+$ystep/4, - "$priceC[$i]",'black','center','middle')); + $picture->stamps( closed_circle(($i+1)*$xstep,$price[$i],'black') ); + $picture->lb( new Label(($i+1)*$xstep,$price[$i]+$ystep/10, + '$'.sprintf("%.2f",$price[$i]),'black','center','bottom','large')); $alt = $alt."On $days[$i], the stock's price was $priceC[$i]. "; } @@ -133,7 +133,7 @@ BEGIN_TEXT This line graph shows a certain stock's price change over a few days. $PAR $BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} +\{ image(insertGraph( $picture ), width=>600, extra_html_tags => 'alt = "$alt" title = "$alt"') \} $ECENTER $PAR @@ -142,9 +142,9 @@ BEGIN_PGML From [$day1] to [$dayLast], what is the stock price's percentage change? -Fill in the blank with a percent. Round your percent to two decimal places, like [`12.34%`]. +[@KeyboardInstructions('Fill in the blank with a percent. Round your percent to two decimal places, like [`12.34%`].')@]** -*Solution:* From [$day1] to [$dayLast], the stock price's percentage change was approximately [_________]{$perP}. +From [$day1] to [$dayLast], the stock price's percentage change was approximately [_________]{$perP}. END_PGML @@ -191,7 +191,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* From [$day1] to [$dayLast], the percentage change in the stock's value was approximately [`[$per]%`]. +From [$day1] to [$dayLast], the percentage change in the stock's value was approximately [`[$per]%`]. ####Method 2 @@ -213,7 +213,7 @@ Let the change [`[$change]`] be [`x`] (as a percent) of [`[$day1Price]`]. That m \end{aligned} `] -*Solution:* From [$day1] to [$dayLast], the percentage change in the stock's value was approximately [`[$per]%`]. +From [$day1] to [$dayLast], the percentage change in the stock's value was approximately [`[$per]%`]. ####Method 3 @@ -223,7 +223,7 @@ We first divide the "new number" by the "original number": So the new number is approximately [`[$s3]%`] of the original number, implying the percentage change was approximately [` [$s3]% - 100% = [$per]% `]. -*Solution:* From [$day1] to [$dayLast], the percentage change in the stock's value was approximately [`[$per]%`]. +From [$day1] to [$dayLast], the percentage change in the stock's value was approximately [`[$per]%`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_10.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_10.pg index c0f1876067..f72ea24023 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_10.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -24,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -42,7 +45,7 @@ TEXT(beginproblem()); BEGIN_PGML -[` [$p1]% `] of [` [$num] `] is [_______]{$ans1}? +[` [$p1]% `] of [` [$num] `] is [_______]{$ans1}. END_PGML @@ -66,7 +69,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. ####Method 2 @@ -83,7 +86,7 @@ The question is: What is [` [$p1]% `] of [` [$num] `]? Assume [`x`] is [` [$p1]% \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. ####Method 3 @@ -97,7 +100,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$p1]% \cdot [$num] = [$d1] \cdot [$num] = [$ans1] ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_20.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_20.pg index c2dd575e58..6dc3a541d3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_20.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -24,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -42,7 +45,7 @@ TEXT(beginproblem()); BEGIN_PGML -[` [$p1]% `] of [` [$num] `] is [_______]{$ans1}? +[` [$p1]% `] of [` [$num] `] is [_______]{$ans1}. END_PGML @@ -66,7 +69,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. ####Method 2 @@ -83,7 +86,7 @@ The question is: What is [` [$p1]% `] of [` [$num] `]? Assume [`x`] is [` [$p1]% \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. ####Method 3 @@ -97,7 +100,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$p1]% \cdot [$num] = [$d1] \cdot [$num] = [$ans1] ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_30.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_30.pg index 58567868bd..7497f2275c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_30.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -24,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -42,7 +45,7 @@ TEXT(beginproblem()); BEGIN_PGML -[` [$p1]% `] of [` [$num] `] is [_______]{$ans1}? +[` [$p1]% `] of [` [$num] `] is [_______]{$ans1}. END_PGML @@ -66,7 +69,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. ####Method 2 @@ -83,7 +86,7 @@ The question is: What is [` [$p1]% `] of [` [$num] `]? Assume [`x`] is [` [$p1]% \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. ####Method 3 @@ -97,7 +100,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$p1]% \cdot [$num] = [$d1] \cdot [$num] = [$ans1] ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_40.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_40.pg index 5ea09d4cc3..dd635763ab 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_40.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -24,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,7 +69,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. ####Method 2 @@ -83,7 +86,7 @@ The question is: What is [` [$p1]% `] of [` [$num] `]? Assume [`x`] is [` [$p1]% \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. ####Method 3 @@ -97,7 +100,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$p1]% \cdot [$num] = [$d1] \cdot [$num] = [$ans1] ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_50.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_50.pg index 503a4b2685..b3c76b9661 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_50.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -24,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,7 +69,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. ####Method 2 @@ -83,7 +86,7 @@ The question is: What is [` [$p1]% `] of [` [$num] `]? Assume [`x`] is [` [$p1]% \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. ####Method 3 @@ -97,7 +100,7 @@ By the formula [` \text{percentage} = \text{rate} \cdot \text{base} `], we do a [`` \text{percentage } = \text{rate} \cdot \text{base} = [$p1]% \cdot [$num] = [$d1] \cdot [$num] = [$ans1] ``] -*Solution:* [` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. +[` [$p1]% `] of [` [$num] `] is [`[$ans1]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_60.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_60.pg new file mode 100644 index 0000000000..8173b9f9e1 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_60.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# mental math: Find 25%, 50%, 75% and 100% of a number. +# +# Last updated: Carl Yao, 11/11/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$num = list_random(20,40,80,120,160); +$ans0 = 0.25*$num; +$ans1 = 0.5*$num; +$ans2 = 0.75*$num; +$ans3 = $num; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Mental math practice: + +a. [` 25% `] of [` [$num] `] is [_______]{$ans0}? +a. [` 50% `] of [` [$num] `] is [_______]{$ans1}? +a. [` 75% `] of [` [$num] `] is [_______]{$ans2}? +a. [` 100% `] of [` [$num] `] is [_______]{$ans3}? + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +a. + [`25%`] is equivalent to a quarter. To find a quarter of [`[$num]`], we simply do [`[$num]\div 4=[$ans0]`]. + + [` 25% `] of [` [$num] `] is [`[$ans0]`]. + +b. + [`50%`] is equivalent to half. To find half of [`[$num]`], we simply do [`[$num]\div 2=[$ans1]`]. + + [` 50% `] of [` [$num] `] is [`[$ans1]`]. + +c. + [`75%`] is equivalent to three quarters. To find a quarter of [`[$num]`], we do [`[$num]\div 4=[$ans0]`]. Next, we do [`[$ans0]\cdot 3 = [$ans2]`] to find three quarters of [`[$num]`]. + + [` 75% `] of [` [$num] `] is [`[$ans2]`]. + +d. + [`100%`] of a number is simply the number itself, so [`100%`] of [`[$num]`] is simply [`[$num]`]. + + [` 100% `] of [` [$num] `] is [`[$ans3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_70.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_70.pg new file mode 100644 index 0000000000..2be1f73691 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_70.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# mental math: Find 10%, 20% and 30% of a number. +# +# Last updated: Carl Yao, 11/11/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$num = list_random(20,30,40,50,60,70,80,90); + +$per0 = 10; +$dec0 = $per0/100; +$ans0 = $dec0*$num; + +do {$per1 = random(20,90,10);} until ($per1!=50); +$dec1 = $per1/100; +$ans1 = $dec1*$num; + +do {$per2 = random(20,90,10);} until ( ($per2!=50) && ($per2!=$per1) ); +$dec2 = $per2/100; +$ans2 = $dec2*$num; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Mental math practice: + +a) [` [$per0]% `] of [` [$num] `] is [_______]{$ans0}? +b) [` [$per1]% `] of [` [$num] `] is [_______]{$ans1}? +c) [` [$per2]% `] of [` [$num] `] is [_______]{$ans2}? + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +*Part a)* [`[$per0]%`] is equivalent to one tenth. To find one tenth of [`[$num]`], we simply do [`[$num]\div 10=[$ans0]`]. + +[` [$per0]% `] of [` [$num] `] is [`[$ans0]`]. + +*Part b)* [`[$per1]%`] is equivalent to [@numberWord($per1/10)@] tenths. First, we find one tenth of [`[$num]`], which is [`[$ans0]`] by Part a. + +Next, to find [@numberWord($per1/10)@] tenths of [`[$num]`], we do [`[$ans0]\cdot[$per1/10]=[$ans1]`]. + +[` [$per1]% `] of [` [$num] `] is [`[$ans1]`]. + +*Part c)* [`[$per2]%`] is equivalent to [@numberWord($per2/10)@] tenths. First, we find one tenth of [`[$num]`], which is [`[$ans0]`] by Part a. + +Next, to find [@numberWord($per2/10)@] tenths of [`[$num]`], we do [`[$ans0]\cdot[$per2/10]=[$ans2]`]. + +[` [$per2]% `] of [` [$num] `] is [`[$ans2]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_80.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_80.pg new file mode 100644 index 0000000000..07cbd57c4f --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_80.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# mental math: Find 15% of a number. +# +# Last updated: Carl Yao, 11/11/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextCurrency.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +@nums = (20,30,40,50,60,70,80,90); + +$num0 = splice(@nums,random(0,$#nums,1),1); +$ans0 = 0.15*$num0; + +$num1 = splice(@nums,random(0,$#nums,1),1); +$ans1 = 0.15*$num1; + +$num2 = splice(@nums,random(0,$#nums,1),1); +$ans2 = 0.15*$num2; + +Context("Currency"); +$num0C = Currency($num0); +$num1C = Currency($num1); +$num2C = Currency($num2); + +$ans0C = Currency($ans0); +$ans1C = Currency($ans1); +$ans2C = Currency($ans2); + +Context("LimitedNumeric"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +We typically give [`15%`] tip, and we need to learn how to find [`15%`] of a certain number without using a calculator or paper/pencil. + +a. [` 15% `] of [` [$num0C] `] is [_______]{$ans0C}? +a. [` 15% `] of [` [$num1C] `] is [_______]{$ans1C}? +a. [` 15% `] of [` [$num2C] `] is [_______]{$ans2C}? + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find [`15%`] of a number, first we find [`10%`] of the number and [`5%`] of the number, and then add up those two parts. + +*Part a)* [`10%`] of [`[$num0]`] is [`[$num0]\div 10=[$num0/10]`]. + +[`5%`] of [`[$num0]`] is half of [`10%`] of [`[$num0]`], which is [`[$num0/10]\div 2=[$num0/20]`]. + +Finally, we add up those two parts, and we have [`[$num0/10]+[$num0/20]=[$ans0]`]. + +[` 15% `] of [` [$num0C] `] is [`[$ans0C]`]. + +*Part b)* [`10%`] of [`[$num1]`] is [`[$num1]\div 10=[$num1/10]`]. + +[`5%`] of [`[$num1]`] is half of [`10%`] of [`[$num1]`], which is [`[$num1/10]\div 2=[$num1/20]`]. + +Finally, we add up those two parts, and we have [`[$num1/10]+[$num1/20]=[$ans1]`]. + +[` 15% `] of [` [$num1C] `] is [`[$ans1C]`]. + +*Part c)* [`10%`] of [`[$num2]`] is [`[$num2]\div 10=[$num2/10]`]. + +[`5%`] of [`[$num2]`] is half of [`10%`] of [`[$num2]`], which is [`[$num2/10]\div 2=[$num2/20]`]. + +Finally, we add up those two parts, and we have [`[$num2/10]+[$num2/20]=[$ans2]`]. + +[` 15% `] of [` [$num2C] `] is [`[$ans2C]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_90.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_90.pg new file mode 100644 index 0000000000..897b6a3fcc --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType1_90.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# mental math: Find 100%, 200% and 300% of a number. +# +# Last updated: Carl Yao, 11/11/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +$num = list_random(5,20,30,40,50,60,70,80,90); + +@per = (200,300,400,500,600); + +$per0 = 100; +$ans0 = $num; + +$per1 = splice(@per,random(0,$#per,1),1); +$ans1 = $num*$per1/100; + +$per2 = splice(@per,random(0,$#per,1),1); +$ans2 = $num*$per2/100; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Mental math practice: + +a. [` [$per0]% `] of [` [$num] `] is [_______]{$ans0}? +a. [` [$per1]% `] of [` [$num] `] is [_______]{$ans1}? +a. [` [$per2]% `] of [` [$num] `] is [_______]{$ans2}? + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +*Part a)* [`100%`] of a number is simply the number itself. + +[` 100% `] of [` [$num] `] is [`[$ans0]`]. + +*Part b)* [`[$per1]%`] of a number is [@numberWord($per1/100)@] times as big as the number. We do [`[$num]\cdot[$per1/100]=[$ans1]`]. + +[` [$per1]% `] of [` [$num] `] is [`[$ans1]`]. + +*Part c)* [`[$per2]%`] of a number is [@numberWord($per2/100)@] times as big as the number. We do [`[$num]\cdot[$per2/100]=[$ans2]`]. + +[` [$per2]% `] of [` [$num] `] is [`[$ans2]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_10.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_10.pg index 824c9a7f44..faa97f21c1 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_10.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,9 +53,9 @@ TEXT(beginproblem()); BEGIN_PGML -Fill in the blank with percent: +Answer with a percent. -[`[$a1]`] is [____]{$ans1P} of [` [$b] `]? +[`[$a1]`] is [____]{$ans1P} of [` [$b] `]. END_PGML @@ -81,7 +84,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. ####Method 2 @@ -102,7 +105,7 @@ Assume [`[$a1]`] is [`x`] (as a percent) of [` [$b] `]. We have: \end{aligned} ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. ####Method 3 @@ -116,7 +119,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$a1]}{[$b]} = [$ans1/100] = [$ans1]% ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_20.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_20.pg index 527f1e271e..44c3113474 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_20.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -81,7 +84,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. ####Method 2 @@ -102,7 +105,7 @@ Assume [`[$a1]`] is [`x`] (as a percent) of [` [$b] `]. We have: \end{aligned} ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. ####Method 3 @@ -116,7 +119,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$a1]}{[$b]} = [$ans1/100] = [$ans1]% ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_30.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_30.pg index 21b252168b..d6e94cc64d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_30.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -81,7 +84,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. ####Method 2 @@ -102,7 +105,7 @@ Assume [`[$a1]`] is [`x`] (as a percent) of [` [$b] `]. We have: \end{aligned} ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. ####Method 3 @@ -116,7 +119,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$a1]}{[$b]} = [$ans1/100] = [$ans1]% ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_40.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_40.pg index 84fea1b7e4..4749172fcd 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_40.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -50,9 +53,9 @@ TEXT(beginproblem()); BEGIN_PGML -Fill in the blank with percent: +Answer with a percent. -[`[$a1]`] is [____]{$ans1P} of [` [$b] `]? +[`[$a1]`] is [____]{$ans1P} of [` [$b] `]. END_PGML @@ -81,7 +84,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. ####Method 2 @@ -102,7 +105,7 @@ Assume [`[$a1]`] is [`x`] (as a percent) of [` [$b] `]. We have: \end{aligned} ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. ####Method 3 @@ -116,7 +119,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{\text{percentage}}{\text{base}} = \frac{[$a1]}{[$b]} = [$ans1/100] = [$ans1]% ``] -*Solution:* [`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. +[`[$a1]`] is [`[$ans1][@$PERCENT@]`] of [` [$b] `]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_50.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_50.pg index 97cffa542f..da58850e2d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_50.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion','rounding') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,7 +28,8 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,9 +58,9 @@ TEXT(beginproblem()); BEGIN_PGML -Fill in the blank with percent. Round to the hundredth place, like [`12.34%`]. +Answer with a percent. [@KeyboardInstructions('Round to the hundredth place, like [`12.34%`].')@]** -[`[$a]`] is approximately [_______]{$ansP} of [` [$b] `]? +[`[$a]`] is about [_______]{$ansP} of [` [$b] `]. END_PGML @@ -83,7 +87,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. +[`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. ####Method 2 @@ -104,7 +108,7 @@ Assume [`[$a]`] is [`x`] (as a percent) of [` [$b] `]. We have: \end{aligned} ``] -*Solution:* [`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. +[`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. ####Method 3 @@ -118,7 +122,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{[$a]}{[$b]} \approx [$ansNotRounded/100] \approx [$ans]% ``] -*Solution:* [`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. +[`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_60.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_60.pg index 107a50e106..6d371891b4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_60.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion','rounding') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,7 +28,7 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextPercent.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -38,7 +41,7 @@ do { $ansNotRounded = $a/$b*100; } until ($ansNotRounded != int($ansNotRounded)); -$ans = round($ansNotRounded); +$ans = sprintf("%.0f",$ansNotRounded); Context("LimitedPercent-strict"); Context()->flags->set( @@ -83,7 +86,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. +[`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. ####Method 2 @@ -104,7 +107,7 @@ Assume [`[$a]`] is [`x`] (as a percent) of [` [$b] `]. We have: \end{aligned} ``] -*Solution:* [`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. +[`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. ####Method 3 @@ -118,7 +121,7 @@ By the formula [` \text{rate} = \frac{\text{percentage}}{\text{base}} `], we do [`` \text{rate} = \frac{[$a]}{[$b]} \approx [$ansNotRounded/100] \approx [$ans]% ``] -*Solution:* [`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. +[`[$a]`] is approximately [`[$ans][@$PERCENT@]`] of [` [$b] `]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_70.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_70.pg new file mode 100644 index 0000000000..2e301db380 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_70.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Mental math: 5 is what percent of 20? +# +# Last updated: Carl Yao, 11/11/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextPercent.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +@per = (10,20,25,50); +@num = (20,40,60,200,400,600); +%frac = ( + 10 => 'one tenth', + 20 => 'one fifth', + 25 => 'one fourth', + 50 => 'half' +); + +$per0 = splice(@per,random(0,$#per,1),1); +$num0 = splice(@num,random(0,$#num,1),1); +$part0 = $per0/100*$num0; + +$per1 = splice(@per,random(0,$#per,1),1); +$num1 = splice(@num,random(0,$#num,1),1); +$part1 = $per1/100*$num1; + +Context("LimitedPercent-strict"); +Context()->flags->set( + trimTrailingZeros => 1, + decimalPlaces => 0, + tolerance => .00005, +); +$ans0 = Compute("$per0 %"); +$ans1 = Compute("$per1 %"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Fill in the blanks with percent. Don't use calculator or paper/pencil. Use mental math. + +a. [`[$part0]`] is [______]{$ans0} of [` [$num0] `]? +a. [`[$part1]`] is [______]{$ans1} of [` [$num1] `]? + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +*Part a:* Notice that [`[$part0]`] is [@$frac{$per0}@] of [`[$num0]`], which is equivalent to [`[$per0]%`]. + +[`[$part0]`] is [`[$per0]%`] of [` [$num0] `]. + +*Part b:* Notice that [`[$part1]`] is [@$frac{$per1}@] of [`[$num1]`], which is equivalent to [`[$per1]%`]. + +[`[$part1]`] is [`[$per1]%`] of [` [$num1] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_80.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_80.pg new file mode 100644 index 0000000000..10fe8e6b38 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType2_80.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Mental math: 40 is what percent of 20? +# +# Last updated: Carl Yao, 11/11/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextPercent.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +@per = (100,200,300,400); +@num = (2,3,4,5,10,20,30); +%frac = ( + 100 => 'the same as ', + 200 => 'twice as big as ', + 300 => 'three times as big as ', + 400 => 'four times as big as ' +); + +$per0 = splice(@per,random(0,$#per,1),1); +$num0 = splice(@num,random(0,$#num,1),1); +$part0 = $per0/100*$num0; + +$per1 = splice(@per,random(0,$#per,1),1); +$num1 = splice(@num,random(0,$#num,1),1); +$part1 = $per1/100*$num1; + +Context("LimitedPercent-strict"); +Context()->flags->set( + trimTrailingZeros => 1, + decimalPlaces => 0, + tolerance => .00005, +); +$ans0 = Compute("$per0 %"); +$ans1 = Compute("$per1 %"); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Fill in the blanks with percent. Don't use calculator or paper/pencil. Use mental math. + +a. [`[$part0]`] is [______]{$ans0} of [` [$num0] `]? +a. [`[$part1]`] is [______]{$ans1} of [` [$num1] `]? + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +*Part a:* Notice that [`[$part0]`] is [@$frac{$per0}@] [`[$num0]`], which is equivalent to [`[$per0]%`]. + +[`[$part0]`] is [`[$per0]%`] of [` [$num0] `]. + +*Part b:* Notice that [`[$part1]`] is [@$frac{$per1}@] [`[$num1]`], which is equivalent to [`[$per1]%`]. + +[`[$part1]`] is [`[$per1]%`] of [` [$num1] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_10.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_10.pg index aac2d3cc24..5245c0a82b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_10.pg @@ -6,16 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion') -## MLT(arithmetic_percents_single_percent_computation) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -67,7 +69,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. ####Method 2 @@ -85,7 +87,7 @@ The question is: [`[$part]`] is [` [$p1]% `] of what? Assume [`[$part]`] is [` [ \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. ####Method 3 @@ -99,7 +101,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$p1]%} = \frac{[$part]}{[$p1/100]} = [$whole] ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_20.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_20.pg index 696c02307d..349714cc19 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_20.pg @@ -6,17 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) ## KEYWORDS('percent','proportion') -## MLTleader(1) -## MLT(arithmetic_percents_single_percent_computation) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -68,7 +69,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. ####Method 2 @@ -86,7 +87,7 @@ The question is: [`[$part]`] is [` [$p1]% `] of what? Assume [`[$part]`] is [` [ \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. ####Method 3 @@ -100,7 +101,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{[$part]}{[$p1]%} = \frac{[$part]}{[$p1/100]} = [$whole] ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. ####Method 3 @@ -114,7 +115,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$p1]%} = \frac{[$part]}{[$p1/100]} = [$whole] ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_30.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_30.pg index 42c62794f3..0412e5a7d0 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_30.pg @@ -6,16 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion') -## MLT(arithmetic_percents_single_percent_computation) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -67,7 +69,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. ####Method 2 @@ -85,7 +87,7 @@ The question is: [`[$part]`] is [` [$p1]% `] of what? Assume [`[$part]`] is [` [ \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. ####Method 3 @@ -99,7 +101,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$p1]%} = \frac{[$part]}{[$p1/100]} = [$whole] ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_40.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_40.pg index 23b5df2dd8..9bd2bafac3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_40.pg @@ -6,16 +6,18 @@ # Last updated: Carl Yao, 11/11/13 # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') ## DBCCSS('7.RP.3','6.RP.3c') -## DBsubject(Arithmetic) -## DBchapter(Percents) -## DBsection(Calculations) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) ## KEYWORDS('percent','proportion') -## MLT(arithmetic_percents_single_percent_computation) +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -25,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -43,7 +45,7 @@ TEXT(beginproblem()); BEGIN_PGML -[` [$p1]% `] of [__________]{$whole} is [`[$part]`]. +[` [$p1]% `] of [__________]{$whole} is [`[$part]`]? END_PGML @@ -67,7 +69,7 @@ We will write and solve the proportion: \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. ####Method 2 @@ -85,7 +87,7 @@ The question is: [`[$part]`] is [` [$p1]% `] of what? Assume [`[$part]`] is [` [ \end{aligned} ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. ####Method 3 @@ -99,7 +101,7 @@ By the formula [` \text{base} = \frac{\text{percentage}}{\text{rate}} `], we do [`` \text{base} = \frac{\text{percentage}}{\text{rate}} = \frac{[$part]}{[$p1]%} = \frac{[$part]}{[$p1/100]} = [$whole] ``] -*Solution:* [` [$p1]% `] of [` [$whole] `] is [`[$part]`]. +[` [$p1]% `] of [` [$whole] `] is [`[$part]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_50.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_50.pg new file mode 100644 index 0000000000..0cf070fef7 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_50.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Problems like: 25% of what number is 10? (mental math) +# +# Last updated: Carl Yao, 11/11/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +@per = (10,20,25,50); +@num = (20,40,60,200,400,600); + +%frac = ( + 10 => 'one tenth', + 20 => 'one fifth', + 25 => 'one fourth', + 50 => 'half' +); + +$per0 = splice(@per,random(0,$#per,1),1); +$whole0 = splice(@num,random(0,$#num,1),1); +$part0 = $per0/100*$whole0; + +$per1 = splice(@per,random(0,$#per,1),1); +$whole1 = splice(@num,random(0,$#num,1),1); +$part1 = $per1/100*$whole1; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Fill in the blanks. Don't use calculators or paper/pencil. Use mental math. + +a. [` [$per0]% `] of [__________]{$whole0} is [`[$part0]`]. +a. [` [$per1]% `] of [__________]{$whole1} is [`[$part1]`]. + +END_PGML + +############################################## + +$s0 = 100/$per0; +$s1 = 100/$per1; + +BEGIN_PGML_SOLUTION + +*Part a:* Recognize that [`[$per0]%`] is like [@$frac{$per0}@]. To find [@$frac{$per0}@] of what number is [`[$part0]`], we do [`[$part0]\cdot[$s0]=[$whole0]`]. + + [` [$per0]% `] of [`[$whole0]`] is [`[$part0]`]. + +*Part b:* Recognize that [`[$per1]%`] is like [@$frac{$per1}@]. To find [@$frac{$per1}@] of what number is [`[$part1]`], we do [`[$part1]\cdot[$s1]=[$whole1]`]. + + [` [$per1]% `] of [`[$whole1]`] is [`[$part1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_60.pg b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_60.pg new file mode 100644 index 0000000000..fcf48d740e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Percent/MTH20PercentOfNumberType3_60.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Problems like: 200% of what number is 10? (mental math) +# +# Last updated: Carl Yao, 11/11/13 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBCCSS('7.RP.3','6.RP.3c') +## KEYWORDS('percent') +## DBsection('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedNumeric"); + +%frac = ( + 200 => 'twice of the number', + 300 => 'three times of the number', + 400 => 'four times of the number', + 500 => 'five times of the number', + 600 => 'six times of the number', + 700 => 'seven times of the number', + 800 => 'eight times of the number', + 900 => 'nine times of the number', +); + +$per0 = random(200,900,100); +$whole0 = random(2,9,1); +$part0 = $whole0*$per0/100; + +do {$per1 = random(200,900,100);} until ($per0!=$per1); +$whole1 = random(2,9,1); +$part1 = $whole1*$per1/100; + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Fill in the blanks. Don't use calculators or paper/pencil. Use mental math. + +a. [` [$per0]% `] of [__________]{$whole0} is [`[$part0]`]. +a. [` [$per1]% `] of [__________]{$whole1} is [`[$part1]`]. + +END_PGML + +############################################## + +$s0 = $per0/100; +$s1 = $per1/100; + +BEGIN_PGML_SOLUTION + +*Part a:* Recognize that "[`[$per0]%`] of a number" is the same as "[@$frac{$per0}@]," so we do [`[$part0]\div[$s0]=[$whole0]`]. + +[` [$per0]% `] of [`[$whole0]`] is [`[$part0]`]. + +*Part b:* Recognize that "[`[$per1]%`] of a number" is the same as "[@$frac{$per1}@]," so we do [`[$part1]\div[$s1]=[$whole1]`]. + +[` [$per1]% `] of [`[$whole1]`] is [`[$part1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF10.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF10.pg index 768427ebcd..ed4f863641 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF10.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.4') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(GCDs and LCMs) -## Institution(PCC) -## Author(Carl Yao) -## MLT(findgcd) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('greatest common factor') +## DBCCSS('6.NS.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF20.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF20.pg index c09fd6289d..6b5b514ebc 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.4') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(GCDs and LCMs) -## Institution(PCC) -## Author(Carl Yao) -## MLT(GCF_ratherThanD) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('greatest common factor') +## DBCCSS('6.NS.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF30.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF30.pg index 501836db33..f4bfb58766 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/GCF30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.4') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(GCDs and LCMs) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('greatest common factor') +## DBCCSS('6.NS.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM10.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM10.pg index cbf467e638..5043dc4c7d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM10.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.4') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(GCDs and LCMs) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FindLCM) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('least common multiple') +## DBCCSS('6.NS.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM20.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM20.pg index ec27d67453..5a15eec47e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM20.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.4') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(GCDs and LCMs) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FindLCM) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('least common multiple') +## DBCCSS('6.NS.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM25.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM25.pg index b69d8a730f..c5ca674bd5 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM25.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM25.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.4') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(GCDs and LCMs) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FindLCM) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('least common multiple') +## DBCCSS('6.NS.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM30.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM30.pg index 910a33598a..31641496e4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM30.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.4') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(GCDs and LCMs) -## Institution(PCC) -## Author(Carl Yao) -## MLT(FindLCM) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('least common multiple') +## DBCCSS('6.NS.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM40.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM40.pg index d32df42395..47eeef2b7c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/LCM40.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.4') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(GCDs and LCMs) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('least common multiple') +## DBCCSS('6.NS.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,8 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", + ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors10.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors10.pg new file mode 100644 index 0000000000..8ca5e9f47e --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors10.pg @@ -0,0 +1,133 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# List all factors of a number smaller than 50. The number is composite. +# +# Last edited: Yao 9/25/13 +# +# ENDDESCRIPTION + +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('factor') +## DBCCSS('4.NBT.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + +############################################## + +sub isPrime { + my $num = shift; + if ($num%2==0) {return 0;} + for (my $i=3; $i<=int(sqrt($num)); $i=$i+2) { + if ($num%$i==0) {return 0;} + } + return 1; +} + +#This subroutine returns an array of a number's factors. + +sub returnFactors { + my ($number, @facs) = @_; + for my $i (1..$number) { + if ($number%$i==0) {push(@facs,$i);} + } + return @facs; +} + +################################################ + +Context("Numeric"); + +$num=0; +do {$num=random(20,50,1);} until (!(isPrime($num)) && ($num!=18)); + +@factors = (); +@factors = returnFactors($num,@factors); + +$ans = List(@factors); + + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +List all factors of [` [$num] `]: [_____________]{$ans} + +Use commas to separate factors. + +END_PGML + +############################################# + +$factorList = "{1,$num}"; + +$s1 = $num/2; +if ($s1==int($s1)) { + $factorList = "{1,2,$s1,$num}"; + $output1 = "we found two factors: [`2`] and [`$s1`]. Now the factor list has [`\{$factorList\}`]."; +} else { + $output1 = "[`2`] is not a factor of [`$num`]."; +} + + +$s2 = $num/3; +if ($s2==int($s2)) { + $factorList = ($s1==int($s1)) ? "{1,2,3,$s2,$s1,$num}" : "{1,3,$s2,$num}"; + $output2 = "we found two factors: [`3`] and [`$s2`]. Now the factor list has [`\{$factorList\}`]."; +} else { + $output2 = "[`3`] is not a factor of [`$num`]."; +} + +############################################ + +BEGIN_PGML_SOLUTION + +To find all factors of a number, we start from the number [`1`], and go up one by one until we "meet" a factor we already found. We always find pairs of factors. + +Let's find all factors of [`18`] as an example. + +* We start from [`1`]. Since [` 18 \div 1 = 18 `], we found two factors: [`1`] and [`18`]. Now the factor list has [` ~~{1, 18 ~~}`]. +* Next number is [`2`]. Since [` 18 \div 2 = 9 `], we found two factors: [`2`] and [`9`]. Now the factor list has [` ~~{1, 2, 9, 18 ~~}`]. +* Next number is [`3`]. Since [` 18 \div 3 = 6 `], we found two factors: [`3`] and [`6`]. Now the factor list has [` ~~{1, 2, 3, 6, 9, 18 ~~}`]. +* Next number is [`4`]. Since [` 18 \div 4 = 4.5 `], [`4`] is not a factor of [`18`]. +* Next number is [`5`]. Since [` 18 \div 5 = 3.6 `], [`5`] is not a factor of [`18`]. +* Next number is [`6`]. Since we already have [`6`] in the list of factors, we are done. + +We have found all factors of [`18`]: [` ~~{1, 2, 3, 6, 9, 18 ~~} `]. + +With this method, we can find all factors of [`[$num]`]. We will show the first few step: + +* We start from [`1`]. Since [` [$num] \div 1 = [$num] `], we found two factors: [`1`] and [` [$num] `]. Now the factor list has [` ~~{1, [$num] ~~}`]. +* Next number is [`2`]. Since [` [$num] \div 2 = [$s1] `], [$output1]** +* Next number is [`3`]. Since [` [$num] \div 3 = [$s2] `], [$output2]** +* ... + +In the end, [`[$num]`] has the following factors: [` ~~{[$ans] ~~}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors20.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors20.pg new file mode 100644 index 0000000000..a707273fbd --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors20.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# List all factors of a number smaller than 50. The number is prime. +# +# Last edited: Yao 9/25/13 +# +# ENDDESCRIPTION + +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('factor') +## DBCCSS('4.NBT.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + +############################################## + +sub isPrime { + my $num = shift; + if ($num%2==0) {return 0;} + for (my $i=3; $i<=int(sqrt($num)); $i=$i+2) { + if ($num%$i==0) {return 0;} + } + return 1; +} + +#This subroutine returns an array of a number's factors. + +sub returnFactors { + my ($number, @facs) = @_; + for my $i (1..$number) { + if ($number%$i==0) {push(@facs,$i);} + } + return @facs; +} + +################################################ + +Context("Numeric"); + +$num=0; +do {$num=random(20,50,1);} until ((isPrime($num)) && ($num!=18)); + +@factors = (); +@factors = returnFactors($num,@factors); + +$ans = List(@factors); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +List all factors of [` [$num] `]: [_____________]{$ans} + +Use commas to separate factors. + +END_PGML + +############################################# + +$factorList = "{1,$num}"; + +$s1 = $num/2; +if ($s1==int($s1)) { + $factorList = "{1,2,$s1,$num}"; + $output1 = "we found two factors: [`2`] and [`$s1`]. Now the factor list has [`\{$factorList\}`]."; +} else { + $output1 = "[`2`] is not a factor of [`$num`]."; +} + + +$s2 = $num/3; +if ($s2==int($s2)) { + $factorList = ($s1==int($s1)) ? "{1,2,3,$s2,$s1,$num}" : "{1,3,$s2,$num}"; + $output2 = "we found two factors: [`3`] and [`$s2`]. Now the factor list has [`\{$factorList\}`]."; +} else { + $output2 = "[`3`] is not a factor of [`$num`]."; +} + +############################################ + +BEGIN_PGML_SOLUTION + +To find all factors of a number, we start from the number [`1`], and go up one by one until we "meet" a factor we already found. We always find pairs of factors. + +Let's find all factors of [`18`] as an example. + +* We start from [`1`]. Since [` 18 \div 1 = 18 `], we found two factors: [`1`] and [`18`]. Now the factor list has [` ~~{1, 18 ~~}`]. +* Next number is [`2`]. Since [` 18 \div 2 = 9 `], we found two factors: [`2`] and [`9`]. Now the factor list has [` ~~{1, 2, 9, 18 ~~}`]. +* Next number is [`3`]. Since [` 18 \div 3 = 6 `], we found two factors: [`3`] and [`6`]. Now the factor list has [` ~~{1, 2, 3, 6, 9, 18 ~~}`]. +* Next number is [`4`]. Since [` 18 \div 4 = 4.5 `], [`4`] is not a factor of [`18`]. +* Next number is [`5`]. Since [` 18 \div 5 = 3.6 `], [`5`] is not a factor of [`18`]. +* Next number is [`6`]. Since we already have [`6`] in the list of factors, we are done. + +We have found all factors of [`18`]: [` ~~{1, 2, 3, 6, 9, 18 ~~} `]. + +With this method, we can find all factors of [`[$num]`]. We will show the first few step: + +* We start from [`1`]. Since [` [$num] \div 1 = [$num] `], we found two factors: [`1`] and [` [$num] `]. Now the factor list has [` ~~{1, [$num] ~~}`]. +* Next number is [`2`]. Since [` [$num] \div 2 = [$s1] `], [$output1]** +* Next number is [`3`]. Since [` [$num] \div 3 = [$s2] `], [$output2]** +* ... + +In the end, [`[$num]`] has the following factors: [` ~~{[$ans] ~~}`]. Since [`[$num]`] only has [`2`] factors, it is a prime number. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors30.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors30.pg new file mode 100644 index 0000000000..d1a96b7409 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors30.pg @@ -0,0 +1,133 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# List all factors of a number in the range (50,100). The number is composite. +# +# Last edited: Yao 9/26/13 +# +# ENDDESCRIPTION + +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('factor') +## DBCCSS('4.NBT.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + +############################################## + +sub isPrime { + my $num = shift; + if ($num%2==0) {return 0;} + for (my $i=3; $i<=int(sqrt($num)); $i=$i+2) { + if ($num%$i==0) {return 0;} + } + return 1; +} + +#This subroutine returns an array of a number's factors. + +sub returnFactors { + my ($number, @facs) = @_; + for my $i (1..$number) { + if ($number%$i==0) {push(@facs,$i);} + } + return @facs; +} + +################################################ + +Context("Numeric"); + +$num=0; +do {$num=random(51,99,1);} until (!(isPrime($num)) && ($num!=18)); + +@factors = (); +@factors = returnFactors($num,@factors); + +$ans = List(@factors); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +List all factors of [` [$num] `]: [_____________]{$ans} + +Use commas to separate factors. + +END_PGML + +############################################# + +$factorList = "{1,$num}"; + +$s1 = $num/2; +if ($s1==int($s1)) { + $factorList = "{1,2,$s1,$num}"; + $output1 = "we found two factors: [`2`] and [`$s1`]. Now the factor list has [`\{$factorList\}`]."; +} else { + $output1 = "[`2`] is not a factor of [`$num`]."; +} + + +$s2 = $num/3; +if ($s2==int($s2)) { + $factorList = ($s1==int($s1)) ? "{1,2,3,$s2,$s1,$num}" : "{1,3,$s2,$num}"; + $output2 = "we found two factors: [`3`] and [`$s2`]. Now the factor list has [`\{$factorList\}`]."; +} else { + $output2 = "[`3`] is not a factor of [`$num`]."; +} + + +############################################ + +BEGIN_PGML_SOLUTION + +To find all factors of a number, we start from the number [`1`], and go up one by one until we "meet" a factor we already found. We always find pairs of factors. + +Let's find all factors of [`18`] as an example. + +* We start from [`1`]. Since [` 18 \div 1 = 18 `], we found two factors: [`1`] and [`18`]. Now the factor list has [` ~~{1, 18 ~~}`]. +* Next number is [`2`]. Since [` 18 \div 2 = 9 `], we found two factors: [`2`] and [`9`]. Now the factor list has [` ~~{1, 2, 9, 18 ~~}`]. +* Next number is [`3`]. Since [` 18 \div 3 = 6 `], we found two factors: [`3`] and [`6`]. Now the factor list has [` ~~{1, 2, 3, 6, 9, 18 ~~}`]. +* Next number is [`4`]. Since [` 18 \div 4 = 4.5 `], [`4`] is not a factor of [`18`]. +* Next number is [`5`]. Since [` 18 \div 5 = 3.6 `], [`5`] is not a factor of [`18`]. +* Next number is [`6`]. Since we already have [`6`] in the list of factors, we are done. + +We have found all factors of [`18`]: [` ~~{1, 2, 3, 6, 9, 18 ~~} `]. + +With this method, we can find all factors of [`[$num]`]. We will show the first few step: + +* We start from [`1`]. Since [` [$num] \div 1 = [$num] `], we found two factors: [`1`] and [` [$num] `]. Now the factor list has [` ~~{1, [$num] ~~}`]. +* Next number is [`2`]. Since [` [$num] \div 2 = [$s1] `], [$output1]** +* Next number is [`3`]. Since [` [$num] \div 3 = [$s2] `], [$output2]** +* ... + +In the end, [`[$num]`] has the following factors: [` ~~{[$ans] ~~}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors40.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors40.pg new file mode 100644 index 0000000000..edc1753a43 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/ListFactors40.pg @@ -0,0 +1,133 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# List all factors of a number in the range (50,100). The number is prime. +# +# Last edited: Yao 9/26/13 +# +# ENDDESCRIPTION + +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') +## KEYWORDS('factor') +## DBCCSS('4.NBT.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + +############################################## + +sub isPrime { + my $num = shift; + if ($num%2==0) {return 0;} + for (my $i=3; $i<=int(sqrt($num)); $i=$i+2) { + if ($num%$i==0) {return 0;} + } + return 1; +} + +#This subroutine returns an array of a number's factors. + +sub returnFactors { + my ($number, @facs) = @_; + for my $i (1..$number) { + if ($number%$i==0) {push(@facs,$i);} + } + return @facs; +} + +################################################ + +Context("Numeric"); + +$num=0; +do {$num=random(51,99,1);} until ((isPrime($num)) && ($num!=18)); + +@factors = (); +@factors = returnFactors($num,@factors); + +$ans = List(@factors); + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +List all factors of [` [$num] `]: [_____________]{$ans} + +Use commas to separate factors. + +END_PGML + +############################################# + +$factorList = "{1,$num}"; + +$s1 = $num/2; +if ($s1==int($s1)) { + $factorList = "{1,2,$s1,$num}"; + $output1 = "we found two factors: [`2`] and [`$s1`]. Now the factor list has [`\{$factorList\}`]."; +} else { + $output1 = "[`2`] is not a factor of [`$num`]."; +} + + +$s2 = $num/3; +if ($s2==int($s2)) { + $factorList = ($s1==int($s1)) ? "{1,2,3,$s2,$s1,$num}" : "{1,3,$s2,$num}"; + $output2 = "we found two factors: [`3`] and [`$s2`]. Now the factor list has [`\{$factorList\}`]."; +} else { + $output2 = "[`3`] is not a factor of [`$num`]."; +} + + +############################################ + +BEGIN_PGML_SOLUTION + +To find all factors of a number, we start from the number [`1`], and go up one by one until we "meet" a factor we already found. We always find pairs of factors. + +Let's find all factors of [`18`] as an example. + +* We start from [`1`]. Since [` 18 \div 1 = 18 `], we found two factors: [`1`] and [`18`]. Now the factor list has [` ~~{1, 18 ~~}`]. +* Next number is [`2`]. Since [` 18 \div 2 = 9 `], we found two factors: [`2`] and [`9`]. Now the factor list has [` ~~{1, 2, 9, 18 ~~}`]. +* Next number is [`3`]. Since [` 18 \div 3 = 6 `], we found two factors: [`3`] and [`6`]. Now the factor list has [` ~~{1, 2, 3, 6, 9, 18 ~~}`]. +* Next number is [`4`]. Since [` 18 \div 4 = 4.5 `], [`4`] is not a factor of [`18`]. +* Next number is [`5`]. Since [` 18 \div 5 = 3.6 `], [`5`] is not a factor of [`18`]. +* Next number is [`6`]. Since we already have [`6`] in the list of factors, we are done. + +We have found all factors of [`18`]: [` ~~{1, 2, 3, 6, 9, 18 ~~} `]. + +With this method, we can find all factors of [`[$num]`]. We will show the first few step: + +* We start from [`1`]. Since [` [$num] \div 1 = [$num] `], we found two factors: [`1`] and [` [$num] `]. Now the factor list has [` ~~{1, [$num] ~~}`]. +* Next number is [`2`]. Since [` [$num] \div 2 = [$s1] `], [$output1]** +* Next number is [`3`]. Since [` [$num] \div 3 = [$s2] `], [$output2]** +* ... + +In the end, [`[$num]`] has the following factors: [` ~~{[$ans] ~~}`]. Since [`[$num]`] only has [`2`] factors, it is a prime number. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility10.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility10.pg index e531566d80..eb5098f337 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility10.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.OA') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Definitions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('factor','divisibility') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility20.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility20.pg index 1585a7bcf7..b86c53a2db 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility20.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.OA') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Definitions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(div-by-this) -## MLTleader(1) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('factor','divisibility') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility30.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility30.pg index 756cc16f85..76f51e497c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility30.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.OA') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Definitions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(div-by-this) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('factor','divisibility') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility40.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility40.pg index 186c912c55..b0733ff894 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility40.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.OA') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Definitions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(div-by-this) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('factor','divisibility') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility50.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility50.pg index bfe2c3af33..f6cff6ebdc 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility50.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.OA') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Definitions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(div-by-this) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('factor','divisibility') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility60.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility60.pg index 7a1105a328..d76de595da 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility60.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.OA') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Definitions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(div-by-this) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('factor','divisibility') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility70.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility70.pg index a781f132ea..df89f19d65 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility70.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.OA') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Definitions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(div-by-this) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('factor','divisibility') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility80.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility80.pg index fead494a8b..32b5b31baf 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/divisibility80.pg @@ -8,14 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.OA') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Definitions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('factor','divisibility') +## DBCCSS('4.OA') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +31,7 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/primeOrComposite10.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/primeOrComposite10.pg index cbdbebba4f..df38e91103 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/primeOrComposite10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/primeOrComposite10.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('4.OA.4') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Definitions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('prime','composite') +## DBCCSS('4.OA.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,7 @@ loadMacros( "MathObjects.pl", "PGchoicemacros.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -123,11 +126,11 @@ A _prime number_ only has two factors: [`1`] and itself. In the list, [`[@$given[0]@]`], [`[@$given[1]@]`] and [`[@$given[2]@]`] are prime numbers. -For [`[@$given[3]@]`], the number [`[@$factor[3]@]`] divides into it. This implies [`[@$given[3]@]`] is not a prime number. It is called a _composite number_. +For [`[@$given[3]@]`], the number [`[@$factor[3]@]`] can divide it. This implies [`[@$given[3]@]`] is not a prime number. It is called a _composite number_. Similarly, the number [`[@$factor[4]@]`] divides into [`[@$given[4]@]`], making [`[@$given[4]@]`] a composite number. -And the number [`[@$factor[5]@]`] divides into [`[@$given[5]@]`], making [`[@$given[5]@]`] a composite number. +And, the number [`[@$factor[5]@]`] divides into [`[@$given[5]@]`], making [`[@$given[5]@]`] a composite number. So the correct answers are [@$mc->correct_ans()@]. diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/relativePrime10.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/relativePrime10.pg index cd3d7d3fa7..3a3fa339e1 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/relativePrime10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/relativePrime10.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.4') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Definitions) -## Institution(PCC) -## Author(Carl Yao) -## Level(4) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('prime') +## DBCCSS('6.NS.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -141,14 +144,14 @@ for (my $i=0;$i<=$#primes;$i++) { $primesList = join( ',', @primes ); @examples = (); -$product0 = $primes[0]**2; -$examples[1] = "$primes[0]^2=$product0"; -$product1 = $primes[0]*$primes[1]; -$examples[0] = "$primes[0] \cdot $primes[1]=$product1"; -$product2 = $primes[0]*$primes[2]; -$examples[2] = "$primes[0] \cdot $primes[2]=$product2"; -$product3 = $primes[1]*$primes[2]; -$examples[3] = "$primes[1] \cdot $primes[2]=$product3"; +$product0 = $primes[0]*$primes[1]; +$examples[0] = "$primes[0] \cdot $primes[1]=$product0"; +$product1 = $primes[0]*$primes[2]; +$examples[1] = "$primes[0] \cdot $primes[2]=$product1"; +$product2 = $primes[1]*$primes[2]; +$examples[2] = "$primes[1] \cdot $primes[2]=$product2"; +$product3 = $primes[0]**2*$primes[2]; +$examples[3] = "$primes[0]^2 \cdot $primes[2]=$product3"; $examplesOutput = $product0.', '.$product1.', '.$product2.', '.$product3.' ...'; diff --git a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/relativePrime20.pg b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/relativePrime20.pg index bea5907d1d..6c585bfdfc 100644 --- a/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/relativePrime20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/PrimeLCMGCF/relativePrime20.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.NS.4') -## DBsubject(Number theory) -## DBchapter(Divisibility) -## DBsection(Definitions) -## Institution(PCC) -## Author(Carl Yao) -## Level(4) -## MO(1) +## DBsubject('Elementary School') +## DBchapter('') +## DBsection('') ## KEYWORDS('prime') +## DBCCSS('6.NS.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -143,14 +146,14 @@ for (my $i=0;$i<=$#primes;$i++) { $primesList = join( ',', @primes ); @examples = (); -$product0 = $primes[0]**2; -$examples[0] = "$primes[0]^2=$product0"; -$product1 = $primes[0]*$primes[1]; -$examples[1] = "$primes[0] \cdot $primes[1]=$product1"; -$product2 = $primes[0]*$primes[2]; -$examples[2] = "$primes[0] \cdot $primes[2]=$product2"; -$product3 = $primes[1]*$primes[2]; -$examples[3] = "$primes[1] \cdot $primes[2]=$product3"; +$product0 = $primes[0]*$primes[1]; +$examples[0] = "$primes[0] \cdot $primes[1]=$product0"; +$product1 = $primes[0]*$primes[2]; +$examples[1] = "$primes[0] \cdot $primes[2]=$product1"; +$product2 = $primes[1]*$primes[2]; +$examples[2] = "$primes[1] \cdot $primes[2]=$product2"; +$product3 = $primes[0]**2*$primes[2]; +$examples[3] = "$primes[0]^2 \cdot $primes[2]=$product3"; $examplesOutput = $product0.', '.$product1.', '.$product2.', '.$product3.' ...'; @@ -160,8 +163,7 @@ TEXT(beginproblem()); BEGIN_PGML -Find a *composite* number that is relatively prime to [`[$num1]`]. -Answer: [_______] +A *composite* number relatively prime to [`[$num1]`] is [_______]. END_PGML @@ -197,21 +199,21 @@ First, we will factor the given number: A number relatively prime to [`[$num1]`] cannot share any of its factors, which are [`[$num1FactorNoDupList]`]. -However, we cannot simply choose one prime number which is not a factor of [`[$num1]`], because the answer must be a *composite* number. +However, we cannot simply choose a prime number which is not [`[$num1]`]'s factor, because the answer must be a compositive number. -One easy method is to find two or more prime numbers which are not factors of [`[$num1]`], and use their product to form a composite number. +One easy method is to find two or more prime numbers which are not [`[$num1]`]'s factors, and use their product to form a composite number. -A list of prime numbers that are not factors of [`[$num1]`] includes: [`[$primesList]`], ... +A list of prime numbers which are not [`[$num1]`]'s factors have: [`[$primesList]`], ... The product of the first two numbers in the list is: - [``[$examples[1]]``] + [``[$examples[0]]``] -[`[$product1]`] is a composite number because it has factors [`[$primes[0]]`] and [`[$primes[1]]`], and it's relatively prime to [`[$num1]`], because they don't share any factors except [`1`]. +[`[$product0]`] is a composite number because it has factors [`[$primes[0]]`] and [`[$primes[1]]`], and it's relatively prime to [`[$num1]`], because they don't share any factors except [`1`]. -Similarly, we could use products of other prime numbers which are not factors of [`[$num1]`] to find other correct answers, for example: +Similarly, we can use other prime numbers which are not [`[$num1]`]'s factors to find other correct answers: - [``[$examples[0]]``] + [``[$examples[1]]``] [``[$examples[2]]``] diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion10.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion10.pg index a8a782c0c9..5465224bd3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion10.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') +## DBCCSS('6.RP','7.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +31,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", +# "contextFraction.pl", ); ############################################## @@ -50,7 +57,7 @@ BEGIN_PGML According to a salad recipe, each serving requires [`[$oil1]`] teaspoons of vegetable oil and [`[$vinegar1]`] teaspoons of vinegar. If [`[$oil2]`] teaspoons of vegetable oil were used, how many teaspoons of vinegar should be used? -*Solution:* If [`[$oil2]`] teaspoons of vegetable oil were used, [___________]{$vinegar2} teaspoons of vinegar should be used. +If [`[$oil2]`] teaspoons of vegetable oil were used, [___________]{$vinegar2} teaspoons of vinegar should be used. END_PGML @@ -78,7 +85,7 @@ The rate is [`\frac{[$rateVO] \text{ teaspoons of vinegar}}{1 \text{ teaspoon of \end{aligned} ``] -*Solution:* If [`[$oil2]`] teaspoons of vegetable oil were used, [`[$vinegar2]`] teaspoons of vinegar should be used. +If [`[$oil2]`] teaspoons of vegetable oil were used, [`[$vinegar2]`] teaspoons of vinegar should be used. ####Method 2 @@ -97,7 +104,7 @@ In the proportion, the top (numerators) have the number of teaspoons of vinegar, \end{aligned} ``] -*Solution:* If [`[$oil2]`] teaspoons of vegetable oil were used, [`[$vinegar2]`] teaspoons of vinegar should be used. +If [`[$oil2]`] teaspoons of vegetable oil were used, [`[$vinegar2]`] teaspoons of vinegar should be used. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion11.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion11.pg index 12da7a7f64..3c68fed8bf 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion11.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion11.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') +## DBCCSS('6.RP','7.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +31,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", +# "contextFraction.pl", ); ############################################## @@ -50,7 +57,7 @@ BEGIN_PGML According to a salad recipe, each serving requires [`[$oil1]`] teaspoons of vegetable oil and [`[$vinegar1]`] teaspoons of vinegar. If [`[$vinegar2]`] teaspoons of vinegar were used, how many teaspoons of vegetable oil should be used? -*Solution:* If [`[$vinegar2]`] teaspoons of vinegar were used, [___________]{$oil2} teaspoons of vegetable oil should be used. +If [`[$vinegar2]`] teaspoons of vinegar were used, [___________]{$oil2} teaspoons of vegetable oil should be used. END_PGML @@ -80,7 +87,7 @@ The rate is [`\frac{1 \text{ teaspoons of vegetable oil}}{[$rateOV] \text{ teasp \end{aligned} ``] -*Solution:* If [`[$vinegar2]`] teaspoons of vinegar were used, [`[$oil2]`] teaspoons of vegetable oil should be used. +If [`[$vinegar2]`] teaspoons of vinegar were used, [`[$oil2]`] teaspoons of vegetable oil should be used. ####Method 2 @@ -99,7 +106,7 @@ In the proportion, the top (numerators) have the number of teaspoons of vinegar, \end{aligned} ``] -*Solution:* If [`[$vinegar2]`] teaspoons of vinegar were used, [`[$oil2]`] teaspoons of vegetable oil should be used. +If [`[$vinegar2]`] teaspoons of vinegar were used, [`[$oil2]`] teaspoons of vegetable oil should be used. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion13.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion13.pg index d24ca0af94..dc6da5e1b7 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion13.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion13.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','fraction') +## DBCCSS('6.RP','7.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +31,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -57,7 +63,7 @@ BEGIN_PGML According to a salad recipe, each serving requires [`[$oil1]`] teaspoons of vegetable oil and [`[$vinegar1]`] teaspoons of vinegar. If [`[$oil2]`] teaspoons of vegetable oil were used, how many teaspoons of vinegar should be used? -*Solution:* If [`[$oil2]`] teaspoons of vegetable oil were used, [___________]{$vinegar2} teaspoons of vinegar should be used. +If [`[$oil2]`] teaspoons of vegetable oil were used, [___________]{$vinegar2} teaspoons of vinegar should be used. END_PGML @@ -87,7 +93,7 @@ The rate is [`[$rateVO] \frac{\text{teaspoons of vinegar}}{\text{per teaspoon of \end{aligned} ``] -*Solution:* If [`[$oil2]`] teaspoons of vegetable oil were used, [`[$vinegar2]`] teaspoons of vinegar should be used. +If [`[$oil2]`] teaspoons of vegetable oil were used, [`[$vinegar2]`] teaspoons of vinegar should be used. ####Method 2 @@ -106,7 +112,7 @@ In the proportion, the top (numerators) have the number of teaspoons of vinegar, \end{aligned} ``] -*Solution:* If [`[$oil2]`] teaspoons of vegetable oil were used, [`[$vinegar2]`] teaspoons of vinegar should be used. +If [`[$oil2]`] teaspoons of vegetable oil were used, [`[$vinegar2]`] teaspoons of vinegar should be used. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion14.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion14.pg index f43b13aa47..de832449e8 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion14.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion14.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','fraction') +## DBCCSS('6.RP','7.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +31,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion20.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion20.pg index 9043de663a..ebb8799d48 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion20.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') -## MLTleader(1) -## MLT(arithmetic_decimal_application_mutual_fund) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,8 +30,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", + "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", +# "contextFraction.pl", ); ############################################## @@ -65,9 +69,9 @@ $bond1C=Currency($bond1); BEGIN_PGML -A mutual fund consists of [`[$stock]`][@$PERCENT@] stock and [`[$bond]`][@$PERCENT@] bond. In other words, for each [`[$stock]`] of stock, there are [`[$bond]`] dollars of bond. For a mutual fund with [`[$stock1C]`] of stock, how many dollars of bond are there? +A mutual fund consists of [`[$stock]`]% stock and [`[$bond]`]% bond. In other words, for each [`[$stock]`] dollars of stock, there are [`[$bond]`] dollars of bond. For a mutual fund with [`[$stock1C]`] of stock, how many dollars of bond are there? -Fill in the blank with decimal rounded to the hundredth place. +[@KeyboardInstructions('Answer to the nearest cent.')@]** For a mutual fund with [`[$stock1C]`] of stock, there are approximately [___________]{$bond1C} of bond. @@ -84,7 +88,7 @@ First, we will use rate to solve this problem. To find the amount of bond corresponding to [`[$stock1C]`] of stock, we first need to find the amount of bond corresponding to each dollar of stock (rate): - [`` \frac{\text{value of bond}}{\text{value of stock}} = \frac{[$bond]\text{ dollars in bond}}{[$stock]\text{ dollars in stock}} \approx \frac{[$rateBSR] \text{ dollars in bond}}{$1 \text{ in stock}}``] + [`` \frac{\text{value of bond}}{\text{value of stock}} = \frac{[$bond]\text{ dollars in bond}}{[$stock]\text{ dollars in stock}} \approx \frac{[$rateBSR] \text{ dollars in bond}}{\$1 \text{ in stock}}``] For each dollar of stock, there are approximately [`[$rateBSR]`] dollars of bond. The problem asks us to round the final answer to the hundredth place (2 decimal places). For intermediate steps, we should round to a few more places. @@ -92,7 +96,7 @@ Next, we will use this rate to find the amount of bond corresponding to [`[$stoc [`` \begin{aligned}[t] - &\phantom{{}=} [$stock1C] \text{ in stock} \cdot \frac{[$rateBSR] \text{ dollars in bond}}{$1 \text{ in stock}} \\ + &\phantom{{}=} [$stock1C] \text{ in stock} \cdot \frac{[$rateBSR] \text{ dollars in bond}}{\$1 \text{ in stock}} \\ &= [$stock1] \cdot \frac{[$rateBSR] \text{ dollars in bond}}{1} \\ &= [$stock1] \cdot [$rateBSR] \text{ dollars in bond} \\ &= [$stock1*$rateBSR] \text{ dollars in bond} \\ @@ -100,7 +104,7 @@ Next, we will use this rate to find the amount of bond corresponding to [`[$stoc \end{aligned} ``] -*Solution:* For a mutual fund with [`[$stock1C]`] of stock, there are approximately [`[$bond1C]`] of bond. +For a mutual fund with [`[$stock1C]`] of stock, there are approximately [`[$bond1C]`] of bond. ####Method 2 @@ -119,7 +123,7 @@ In the proportion, the top (numerators) have the amount of stock, and the bottom \end{aligned} ``] -*Solution:* For a mutual fund with [`[$stock1C]`] of stock, there are approximately [`[$bond1C]`] of bond. +For a mutual fund with [`[$stock1C]`] of stock, there are approximately [`[$bond1C]`] of bond. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion21.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion21.pg index ab0c2ffe64..8c2b11429c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion21.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion21.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +30,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", + "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", +# "contextFraction.pl", ); ############################################## @@ -64,9 +70,9 @@ $bond1C=Currency($bond1); BEGIN_PGML -A mutual fund consists of [`[$stock]`][@$PERCENT@] stock and [`[$bond]`][@$PERCENT@] bond. In other words, for each [`[$stock]`] of stock, there are [`[$bond]`] dollars of bond. For a mutual fund with [`[$bond1C]`] of bond, how many dollars of stock are there? +A mutual fund consists of [`[$stock]`]% stock and [`[$bond]`]% bond. In other words, for each [`[$stock]`] dollars of stock, there are [`[$bond]`] dollars of bond. For a mutual fund with [`[$bond1C]`] of bond, how many dollars of stock are there? -Fill in the blank with decimal rounded to the hundredth place. +[@KeyboardInstructions('Answer to the nearest cent.')@]** For a mutual fund with [`[$bond1C]`] of bond, there are approximately [___________]{$stock1C} of stock. @@ -91,7 +97,7 @@ Next, we will use this rate to find the amount of stock corresponding to [`[$bon [`` \begin{aligned}[t] - &\phantom{{}=} [$bond1C] \text{ in bond} \cdot \frac{[$rateSBR] \text{ dollars in stock}}{$1 \text{ in bond}} \\ + &\phantom{{}=} [$bond1C] \text{ in bond} \cdot \frac{[$rateSBR] \text{ dollars in stock}}{\$1 \text{ in bond}} \\ &= [$bond1] \cdot \frac{[$rateSBR] \text{ dollars in stock}}{1} \\ &= [$bond1] \cdot [$rateSBR] \text{ dollars in stock} \\ &= [$bond1*$rateSBR] \text{ dollars in stock} \\ @@ -99,7 +105,7 @@ Next, we will use this rate to find the amount of stock corresponding to [`[$bon \end{aligned} ``] -*Solution:* For a mutual fund with [`[$bond1C]`] of bond, there are approximately [`[$stock1C]`] of stock. +For a mutual fund with [`[$bond1C]`] of bond, there are approximately [`[$stock1C]`] of stock. ####Method 2 @@ -118,7 +124,7 @@ In the proportion, the top (numerators) have the amount of stock, and the bottom \end{aligned} ``] -*Solution:* For a mutual fund with [`[$bond1C]`] of bond, there are approximately [`[$stock1C]`] of stock. +For a mutual fund with [`[$bond1C]`] of bond, there are approximately [`[$stock1C]`] of stock. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion30.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion30.pg index 05f5a49796..6eb001323b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion30.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') -## MLTleader(1) -## MLT(arithmetic_decimal_application_jogging) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +31,7 @@ loadMacros( "PGML.pl", "parserNumberWithUnits.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +40,8 @@ TEXT(beginproblem()); Context("LimitedNumeric"); -$rate = random(0,3,1)+random(1,9,1)/10; +#Human jogging speed is between 3.5 and 6 mph +$rate = list_random(35..39,41..49,51..59)/10; $hours = random(5,20,0.5); $distance = $rate*$hours; $hours1 = random(30,50,0.5); @@ -68,9 +70,9 @@ BEGIN_PGML [$name] jogs every day. Last month, [$pronoun] jogged [`[$hours]`] hours for a total of [`[$distance]`] miles. At this speed, if [$name] runs [`[$hours1]`] hours, how far can [$pronoun] run? -*Solution:* At this speed, [$name] can run [_________]{$distance1U} in [`[$hours1]`] hours. +At this speed, [$name] can run [_________]{$distance1U} in [`[$hours1]`] hours. -Use *mi* for miles and *hr* for hours. +[@KeyboardInstructions(q!Use [|mi|]* for miles and [|hr|]* for hours.!)@]** END_PGML @@ -95,7 +97,7 @@ To find how far [$name] can run in [`[$hours1U]`], we need to find how far [$nam \end{aligned} ``] -*Solution:* At this speed, [$name] can run [`[$distance1]`] miles in [`[$hours1]`] hours. +At this speed, [$name] can run [`[$distance1]`] miles in [`[$hours1]`] hours. ####Method 2 @@ -114,7 +116,7 @@ In the proportion, the top (numerators) have the distance in miles, and the bott \end{aligned} ``] -*Solution:* At this speed, [$name] can run [`[$distance1U]`] in [`[$hours1]`] hours. +At this speed, [$name] can run [`[$distance1U]`] in [`[$hours1]`] hours. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion31.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion31.pg index 5e4c6e50f5..abfdafe752 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion31.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion31.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') -## MLT(arithmetic_decimal_application_jogging) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +32,7 @@ loadMacros( "PGML.pl", "parserNumberWithUnits.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -39,7 +41,8 @@ TEXT(beginproblem()); Context("LimitedNumeric"); -$rate = random(0,3,1)+random(1,9,1)/10; +#Human jogging speed is between 3.5 and 6 mph +$rate = list_random(35..39,41..49,51..59)/10; $hours = random(5,20,0.5); $distance = $rate*$hours; $hours1 = random(30,50,0.5); @@ -62,9 +65,9 @@ BEGIN_PGML [$name] jogs every day. Last month, [$pronoun] jogged [`[$hours]`] hours for a total of [`[$distance]`] miles. At this speed, how long would it take [$name] to run [`[$distance1]`] miles? -*Solution:* At this speed, [$name] can run [`[$distance1U]`] in [___________]{$hours1U}. +At this speed, [$name] can run [`[$distance1U]`] in [___________]{$hours1U}. -Use *mi* for miles and *hr* for hours. +[@KeyboardInstructions(q!Use [|mi|]* for miles and [|hr|]* for hours.!)@]** END_PGML @@ -96,7 +99,7 @@ Next, we do: \end{aligned} ``] -*Solution:* At this speed, [$name] can run [`[$distance1U]`] in [`[$hours1U]`]. +At this speed, [$name] can run [`[$distance1U]`] in [`[$hours1U]`]. ####Method 2 @@ -115,7 +118,7 @@ In the proportion, the top (numerators) have the distance in miles, and the bott \end{aligned} ``] -*Solution:* At this speed, [$name] can run [`[$distance1U]`] in [`[$hours1U]`]. +At this speed, [$name] can run [`[$distance1U]`] in [`[$hours1U]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion40.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion40.pg index 86065e5e7f..f99b31715f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion40.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') -## MLTleader(1) -## MLT(arithmetic_decimal_application_apple) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -31,7 +32,7 @@ loadMacros( "parserNumberWithUnits.pl", "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,7 +67,7 @@ BEGIN_PGML [$name] purchased [`[$lbs]`] pounds of apples at the total cost of [`[$totalU]`]. If [$pronoun] purchases [`[$lbs1]`] pounds of apples at this store, how much would it cost? -*Solution:* It would cost [__________]{$total1U} to purchase [`[$lbs1]`] pounds of apples. +It would cost [__________]{$total1U} to purchase [`[$lbs1]`] pounds of apples. END_PGML @@ -92,7 +93,7 @@ The unit price of apples is [`[$rateU]`] per pound. Next, we do: \end{aligned} ``] -*Solution:* It would cost [`[$total1U]`] to purchase [`[$lbs1]`] pounds of apples. +It would cost [`[$total1U]`] to purchase [`[$lbs1]`] pounds of apples. ####Method 2 @@ -111,7 +112,7 @@ In the proportion, the top (numerators) have the cost in dollars, and the bottom \end{aligned} ``] -*Solution:* It would cost [`[$total1U]`] to purchase [`[$lbs1]`] pounds of apples. +It would cost [`[$total1U]`] to purchase [`[$lbs1]`] pounds of apples. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion41.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion41.pg index 75e2d2a3e9..bee7fdbc42 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion41.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion41.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') -## MLT(arithmetic_decimal_application_apple) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -29,7 +32,7 @@ loadMacros( "parserNumberWithUnits.pl", "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,9 +68,9 @@ BEGIN_PGML [$name] purchased [`[$lbs]`] pounds of apples at the total cost of [`[$totalU]`]. If the price doesn't change, how many pounds of apples can [$name] purchase with [`[$total1U]`]? -*Solution:* With [`[$total1U]`], [$name] can purchase [__________]{$lbs1U} of apples. +With [`[$total1U]`], [$name] can purchase [__________]{$lbs1U} of apples. -Use *lb* for pounds. +[@KeyboardInstructions(q!Use [|lb|]* for pounds.!)@]** END_PGML @@ -99,7 +102,7 @@ Next, we do: \end{aligned} ``] -*Solution:* With [`[$total1U]`], [$name] can purchase [`[$lbs1U]`] of apples. +With [`[$total1U]`], [$name] can purchase [`[$lbs1U]`] of apples. ####Method 2 @@ -118,7 +121,7 @@ In the proportion, the top (numerators) have the cost in dollars, and the bottom \end{aligned} ``] -*Solution:* With [`[$total1U]`], [$name] can purchase [`[$lbs1U]`] of apples. +With [`[$total1U]`], [$name] can purchase [`[$lbs1U]`] of apples. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion50.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion50.pg index d7d8242729..9342dcc1ce 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion50.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", "PCCmacros.pl", - "PGcourse.pl" +# "contextCurrency.pl", + "PGcourse.pl", ); ############################################## @@ -55,7 +60,7 @@ BEGIN_PGML [$name] collected a total of [`[$total]`] stamps over the past [`[$years]`] years. At this rate, how many stamps would [$pronoun] collect in [`[$years1]`] years? -*Solution:* At this rate, [$name] would collect [_________]{$total1} stamps in [`[$years1]`] years. +At this rate, [$name] would collect [_________]{$total1} stamps in [`[$years1]`] years. END_PGML @@ -81,7 +86,7 @@ So, [$name] collected [`[$rate]`] stamps per year. Next, we do: \end{aligned} ``] -*Solution:* At this rate, [$name] would collect [`[$total1]`] stamps in [`[$years1]`] years. +At this rate, [$name] would collect [`[$total1]`] stamps in [`[$years1]`] years. ####Method 2 @@ -100,7 +105,7 @@ In the proportion, the numerators (top) have the number of stamps collected, and \end{aligned} ``] -*Solution:* At this rate, [$name] would collect [`[$total1]`] stamps in [`[$years1]`] years. +At this rate, [$name] would collect [`[$total1]`] stamps in [`[$years1]`] years. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion51.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion51.pg index ab6c2e6b4f..c1eb23d443 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion51.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion51.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", "PCCmacros.pl", - "PGcourse.pl" +# "contextCurrency.pl", + "PGcourse.pl", ); ############################################## @@ -55,7 +60,7 @@ BEGIN_PGML [$name] collected a total of [`[$total]`] stamps over the past [`[$years]`] years. At this rate, how many years would it take [$pronoun] to collect [`[$total1]`] stamps? -*Solution:* At this rate, [$name] can collect [`[$total1]`] stamps in [_________]{$years1} years. +At this rate, [$name] can collect [`[$total1]`] stamps in [_________]{$years1} years. END_PGML @@ -87,7 +92,7 @@ Next, we do: \end{aligned} ``] -*Solution:* At this rate, [$name] can collect [`[$total1]`] stamps in [`[$years1]`] years. +At this rate, [$name] can collect [`[$total1]`] stamps in [`[$years1]`] years. ####Method 2 @@ -106,7 +111,7 @@ In the proportion, the numerators (top) have the number of stamps collected, and \end{aligned} ``] -*Solution:* At this rate, [$name] can collect [`[$total1]`] stamps in [`[$years1]`] years. +At this rate, [$name] can collect [`[$total1]`] stamps in [`[$years1]`] years. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion60.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion60.pg index 86ce8bcee4..23efb76376 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion60.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') -## MLTleader(1) -## MLT(arithmetic_decimal_application_property_tax) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,8 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -60,7 +63,7 @@ BEGIN_PGML In a city, the owner of a house valued at [`[$value]`] thousand dollars needs to pay [`[$taxU]`] in property tax. At this tax rate, how much property tax should the owner pay if a house is valued at [`[$value1]`] thousand dollars? -*Solution:* The owner of a [`[$value1]`]-thousand-dollar house should pay [_________]{$tax1U} in property tax. +The owner of a [`[$value1]`]-thousand-dollar house should pay [_________]{$tax1U} in property tax. END_PGML @@ -86,7 +89,7 @@ Next, we do: \end{aligned} ``] -*Solution:* The owner of a [`[$value1]`]-thousand-dollar house should pay [`[$tax1U]`] in property tax. +The owner of a [`[$value1]`]-thousand-dollar house should pay [`[$tax1U]`] in property tax. ####Method 2 @@ -105,7 +108,7 @@ In the proportion, the numerators (top) have property tax in dollars, and the de \end{aligned} ``] -*Solution:* The owner of a [`[$value1]`]-thousand-dollar house should pay [`[$tax1U]`] in property tax. +The owner of a [`[$value1]`]-thousand-dollar house should pay [`[$tax1U]`] in property tax. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion61.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion61.pg index 7926e07b11..cda0b6746b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion61.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion61.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') -## MLT(arithmetic_decimal_application_property_tax) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -57,7 +61,7 @@ BEGIN_PGML In a city, the owner of a house valued at [`[$value]`] thousand dollars needs to pay [`[$taxU]`] in property tax. At this tax rate, if the owner of a house paid [`[$tax1U]`] of property tax, how much is the house worth? -*Solution:* If the owner of a house paid [`[$tax1U]`] of property tax, the house is worth [_________]{$value1} thousand dollars. +If the owner of a house paid [`[$tax1U]`] of property tax, the house is worth [_________]{$value1} thousand dollars. END_PGML @@ -87,7 +91,7 @@ Next, we do: \end{aligned} ``] -*Solution:* If the owner of a house paid [`[$tax1U]`] of property tax, the house is worth [`[$value1]`] thousand dollars. +If the owner of a house paid [`[$tax1U]`] of property tax, the house is worth [`[$value1]`] thousand dollars. ####Method 2 @@ -106,7 +110,7 @@ In the proportion, the numerators (top) have property tax in dollars, and the de \end{aligned} ``] -*Solution:* If the owner of a house paid [`[$tax1U]`] of property tax, the house is worth [`[$value1]`] thousand dollars. +If the owner of a house paid [`[$tax1U]`] of property tax, the house is worth [`[$value1]`] thousand dollars. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion70.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion70.pg index 2a591883ad..98fa451649 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion70.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') -## MLT(arithmetic_decimal_application_vegetable_oil) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", ); ############################################## @@ -53,9 +57,9 @@ BEGIN_PGML A restaurant used [`[$totalU]`] of vegetable oil in [`[$days]`] days. At this rate, how many pounds of vegetable oil will be used in [`[$days1]`] days? -*Solution:* The restaurant will use [_________]{$total1U} of vegetable oil in [`[$days1]`] days. +The restaurant will use [_________]{$total1U} of vegetable oil in [`[$days1]`] days. -Use *lb* for pounds. +[@KeyboardInstructions('Use [|lb|]* for pounds.')@]** END_PGML @@ -81,7 +85,7 @@ On average, the restaurant uses [`[$rateU]`] of vegetable oil per day. Next, we \end{aligned} ``] -*Solution:* The restaurant will use [`[$total1U]`] of vegetable oil in [`[$days1]`] days. +The restaurant will use [`[$total1U]`] of vegetable oil in [`[$days1]`] days. ####Method 2 @@ -100,7 +104,7 @@ In the proportion, the numerators (top) have the amount of oil used in pounds, a \end{aligned} ``] -*Solution:* The restaurant will use [`[$total1U]`] of vegetable oil in [`[$days1]`] days. +The restaurant will use [`[$total1U]`] of vegetable oil in [`[$days1]`] days. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion71.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion71.pg index db864b348d..8284aa5a6f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion71.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion71.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion') -## MLT(arithmetic_decimal_application_vegetable_oil) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", ); ############################################## @@ -53,7 +57,7 @@ BEGIN_PGML A restaurant used [`[$totalU]`] of vegetable oil in [`[$days]`] days. At this rate, [`[$total1U]`] of oil will last how many days? -*Solution:* The restaurant will use [`[$total1U]`] of vegetable oil in [_________]{$days1} days. +The restaurant will use [`[$total1U]`] of vegetable oil in [_________]{$days1} days. END_PGML @@ -85,7 +89,7 @@ We have: \end{aligned} ``] -*Solution:* The restaurant will use [`[$total1U]`] of vegetable oil in [`[$days1]`] days. +The restaurant will use [`[$total1U]`] of vegetable oil in [`[$days1]`] days. ####Method 2 @@ -104,7 +108,7 @@ In the proportion, the numerators (top) have the amount of oil used in pounds, a \end{aligned} ``] -*Solution:* The restaurant will use [`[$total1U]`] of vegetable oil in [`[$days1]`] days. +The restaurant will use [`[$total1U]`] of vegetable oil in [`[$days1]`] days. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion80.pg b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion80.pg index f9c85b239a..62fcc7b1ed 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Proportion/MTH20Proportion80.pg @@ -6,15 +6,18 @@ # Last updated: Carl Yao, 2/28/2014 # ENDDESCRIPTION -## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','ratio','proportion','solve','word problem') +## DBCCSS('6.RP','7.RP.2','7.RP.3','A-CED.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -24,7 +27,7 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -80,7 +83,7 @@ Now we can set up and solve a proportion: \end{aligned} ``] -*Solution:* There are approximately [`[$ans]`] fish living in the lake. +There are approximately [`[$ans]`] fish living in the lake. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange10.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange10.pg new file mode 100644 index 0000000000..93ee7912e3 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange10.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# 2 teaspoons of vinegar corresponds to 7 teaspoons of oil. +# Each teaspoon of vinegar corresponds to how many teaspoons of oil? +# Each teaspoon of oil corresponds to how many teaspoons of vinegar? +# +# Last edited: Carl Yao 10/27/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate') +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(showMixedNumbers => 0); + +do { + $vinegar = random(2,10,1); + $oil = random(2,10,1); +} until ((gcd($vinegar,$oil)!=1) && ($oil!=$vinegar)); +$ratioVOf = Fraction($vinegar,$oil); +$ratioOVf = Fraction($oil,$vinegar); + +############################################## + +BEGIN_PGML + +According to a salad recipe, each serving requires [`[$vinegar]`] teaspoons of vinegar and [`[$oil]`] teaspoons of vegetable oil. + +Fill in the blanks with fractions or integers. + +a. By this recipe, for each teaspoon of vinegar, we should add [_______]{$ratioOVf} teaspoons of vegetable oil. + +a. For each teaspoon of vegetable oil, we should add [_______]{$ratioVOf} teaspoons of vinegar. + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +It's given that each serving of salad requires [`[$vinegar]`] teaspoons of vinegar and [`[$oil]`] teaspoons of vegetable oil. + +*Part a:* The key part is "for each teaspoon of vinegar". This implies the rate's unit should be "teaspoons of vegetable oil per teaspoon of vinegar." We do: + + [`` \frac{\text{teaspoons of vegetable oil}}{\text{teaspoons of vinegar}} = \frac{[$oil]\text{ teaspoons of vegetable oil}}{[$vinegar]\text{ teaspoons of vinegar}} = [$ratioOVf]\text{ teaspoons of vegetable oil per teaspoon of vinegar} ``] + +For each teaspoon of vinegar, we should add [`[$ratioOVf]`] teaspoons of vegetable oil. + +*Part b:* The key part is "for each teaspoon of vegetable oil". This implies the rate's unit should be "teaspoons of vinegar per teaspoon of vegetable oil." We do: + + [`` \frac{\text{teaspoons of vinegar}}{\text{teaspoons of vegetable oil}}= \frac{[$vinegar]\text{ teaspoons of vinegar}}{[$oil]\text{ teaspoons of vegetable oil}} = [$ratioVOf] \text{ teaspoons of vinegar per teaspoon of vegetable oil} ``] + +For each teaspoon of vegetable oil, we should add [`[$ratioVOf]`] teaspoons of vinegar. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange20.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange20.pg new file mode 100644 index 0000000000..1eb3a4aa71 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange20.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# A mutual fund consists of a% of stock and b% of bond. +# For each dollar of stock, how many dollars of bond are there? +# For each dollar of bond, how many dollars of stock are there? +# +# Last edited: Carl Yao 10/27/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate') +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", +# "contextFraction.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("LimitedNumeric"); + +$stock = random(11,89,1); +$bond = 100-$stock; +$ratioSB = $stock/$bond; +$ansSB = sprintf("%.2f",$ratioSB); +$ratioBS = $bond/$stock; +$ansBS = sprintf("%.2f",$ratioBS); + +############################################## + +BEGIN_PGML + +A mutual fund consists of [`[$stock]`][@$PERCENT@] stock and [`[$bond]`][@$PERCENT@] bond. In other words, for each [`[$stock]`] dollars of stock, there are [`[$bond]`] dollars of bond. + +Fill in the blanks with decimal rounded to the hundredth place. + +a. For each dollar of stock, there are approximately [___________]{$ansBS} dollars of bond. + +a. For each dollar of bond, there are approximately [___________]{$ansSB} dollars of stock. + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +It's given that for each [`[$stock]`] dollars of stock, there are [`[$bond]`] dollars of bond. + +*Part a:* The key part is "for each dollar of stock". This implies the rate's unit should be "dollars in bond per dollar in stock." We do: + + [`` \frac{\text{value of bond}}{\text{value of stock}} = \frac{[$bond]\text{ dollars in bond}}{[$stock]\text{ dollars in stock}} \approx [$ansBS] \text{ dollars in bond per dollar in stock}``] + +For each dollar of stock, there are approximately [`[$ansBS]`] dollars of bond. + +*Part b:* The key part is "for each dollar of bond". This implies the rate's unit should be "dollars in stock per dollar in bond." We do: + + [`` \frac{\text{value of stock}}{\text{value of bond}} = \frac{[$stock]\text{ dollars in stock}}{[$bond]\text{ dollars in bond}} \approx [$ansSB] \text{ dollars in stock per dollar in bond}``] + +For each dollar of bond, there are approximately [`[$ansSB]`] dollars of stock. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange30.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange30.pg index 015958242f..e55042b8c4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange30.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') -## MLT(arithmetic_decimal_application_jogging) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +31,7 @@ loadMacros( "PGML.pl", "parserNumberWithUnits.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -38,11 +40,12 @@ TEXT(beginproblem()); Context("LimitedNumeric"); -$rate = random(0,3,1)+random(1,9,1)/10; +#Human jogging speed is between 3.5 and 6 mph +$rate = list_random(35..39,41..49,51..59)/10; $hours = random(5,20,0.5); $distance = $rate*$hours; $hourPerMile = 1/$rate; -$hourPerMileRounded = sprintf("%.2f",$hourPerMile); +$hourPerMileRounded = int( ($hourPerMile+0.005)*100 ) /100; $rateU = NumberWithUnits("$rate mi/hr"); $hoursU = NumberWithUnits("$hours hr"); @@ -62,11 +65,9 @@ BEGIN_PGML Answer the following questions with decimals. Round your answers to the hundredth place when needed. -*Question 1:* [$name]'s average speed was [__________]{$rateU}. - ----- +a. [$name]'s average speed was [__________]{$rateU}. -*Question 2:* On average, it takes [$name] [__________]{$hourPerMileRoundedU} to run each mile. +b. On average, it takes [$name] [__________]{$hourPerMileRoundedU} to run each mile. Use *mi* for miles and *hr* for hours. @@ -77,17 +78,13 @@ END_PGML BEGIN_PGML_SOLUTION -###Question 1 - -[$name] jogged [`[$distanceU]`] in [`[$hoursU]`]. The unit of speed is "miles per hour," so we should divide "miles" by "hours": +*Part a:* [$name] jogged [`[$distanceU]`] in [`[$hoursU]`]. The unit of speed is "miles per hour," so we should divide "miles" by "hours": [`` \frac{[$distanceU]}{[$hoursU]} = [$rateU] ``] [$name]'s average speed was [`[$rate]`] miles per hour. -###Question 2 - -In Question 2, the key word is "each mile". This implies the unit of the rate is "hours per mile," so we divide "hours" by "miles": +*Part b:* In Question 2, the key word is "each mile". This implies the unit of the rate is "hours per mile," so we divide "hours" by "miles": [`` \frac{[$hoursU]}{[$distanceU]} \approx [$hourPerMileRoundedU]\text{ per mi} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange40.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange40.pg index 09ac66ddc4..8b39341479 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange40.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') -## MLT(arithmetic_decimal_application_apple) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -30,7 +33,7 @@ loadMacros( "parserNumberWithUnits.pl", "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,11 +67,9 @@ BEGIN_PGML Fill in the blanks with decimals. Round to two decimal places if needed. -*Question 1:* The unit price of apples at this store is [__________]{$rateU} per pound. +a. The unit price of apples at this store is [__________]{$rateU} per pound. ----- - -*Question 2:* [_________]{$lbPerDollarRounded} pounds of apples can be purchased with each dollar. +b. [_________]{$lbPerDollarRounded} pounds of apples can be purchased with each dollar. END_PGML @@ -77,17 +78,13 @@ END_PGML BEGIN_PGML_SOLUTION -###Question 1: - -[`[$lbs]`] pounds of apples cost a total of [`[$totalU]`]. The unit of the "unit price" is "dollars per pound." This implies we should divide "dollars" by "pounds." +*Part a:* [`[$lbs]`] pounds of apples cost a total of [`[$totalU]`]. The unit of the "unit price" is "dollars per pound." This implies we should divide "dollars" by "pounds." [`` \frac{[$total]\text{ dollars}}{[$lbs]\text{ pounds}} = [$rate] \text{ dollars per pound}``] The unit price of apples is [`[$rateU]`] per pound. -###Question 2: - -The key part in the question is "with each dollar." This implies the rate's unit is "pounds per dollar," so we divide "pounds" with "dollars": +*Part b:* The key part in the question is "with each dollar." This implies the rate's unit is "pounds per dollar," so we divide "pounds" with "dollars": [`` \frac{[$lbs]\text{ pounds}}{[$total]\text{ dollars}} \approx [$lbPerDollarRounded] \text{ pounds per dollar}``] diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange50.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange50.pg index f46085e00c..f43bcbed4a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange50.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,7 @@ loadMacros( "parserNumberWithUnits.pl", "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,7 +57,7 @@ BEGIN_PGML [$name] collected a total of [`[$total]`] stamps over the past [`[$years]`] years. On average, how many stamps did [$name] collect each year? -*Solution:* On average, [$name] collected [__________]{$rate} stamps each year. +On average, [$name] collected [__________]{$rate} stamps each year. END_PGML @@ -67,7 +70,7 @@ BEGIN_PGML_SOLUTION [`` \frac{[$total] \text{ stamps}}{[$years]\text{ years}} = [$rate] \text{ stamps per year}``] -*Solution:* On average, [$name] collected [`[$rate]`] stamps each year. +On average, [$name] collected [`[$rate]`] stamps each year. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange60.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange60.pg index 085f97eb7d..5d575bb89c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange60.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') -## MLT(arithmetic_decimal_application_property_tax) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +29,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,7 +58,7 @@ BEGIN_PGML In a city, the owner of a house valued at [`[$value]`] thousand dollars needs to pay [`[$taxU]`] in property tax. Find the property tax rate at this city. In other words, how much property tax does the owner need to pay for each thousand dollars of property value? -*Solution:* For each thousand dollars of property value, the owner needs to pay [________]{$rateU}. +For each thousand dollars of property value, the owner needs to pay [________]{$rateU}. END_PGML @@ -67,7 +71,7 @@ It's given that [`[$taxU]`] needs to be paid for [`[$value]`] thousand dollars o [`` \frac{[$tax]\text{ dollars in tax}}{[$value] \text{ thousand dollars in property value}} = [$rate] \text{ dollars in tax per thousand dollars in property value}``] -*Solution:* For each thousand dollars of property value, the owner needs to pay [`[$rateU]`]. +For each thousand dollars of property value, the owner needs to pay [`[$rateU]`]. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange70.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange70.pg index ed8efa8754..8ce711e2ce 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/FindRateOfChange70.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') -## MLT(arithmetic_decimal_application_vegetable_oil) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", ); ############################################## @@ -48,7 +53,7 @@ BEGIN_PGML A restaurant used [`[$total]`] lb of vegetable oil in [`[$days]`] days. On average, how many lb of vegetable oil does the restaurant use every day? -*Solution:* On average, the restaurant uses [__________]{$rate} lb of vegetable oil every day. +On average, the restaurant uses [__________]{$rate} lb of vegetable oil every day. END_PGML @@ -61,7 +66,7 @@ It's given that [`[$total]`] lb of vegetable oil were used in [`[$days]`] days. [`` \frac{[$total]\text{ lb}}{[$days]\text{ days}} = [$rate]\text{ lb per day} ``] -*Solution:* On average, the restaurant uses [`[$rate]`] lb of vegetable oil every day. +On average, the restaurant uses [`[$rate]`] lb of vegetable oil every day. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange10.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange10.pg index e89db012bf..e1f6267f08 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange10.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +31,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -52,11 +58,9 @@ According to a salad recipe, each teaspoon of vegetable oil should be mixed with Fill in the blanks. -*Question 1:* By this recipe, [_______]{$vinegar1} teaspoons of vinegar should be mixed with [`[$oil1]`] teaspoons of vegetable oil. - ----- +a. By this recipe, [_______]{$vinegar1} teaspoons of vinegar should be mixed with [`[$oil1]`] teaspoons of vegetable oil. -*Question 2:* By this recipe, [_______]{$oil2} teaspoons of vegetable oil should be mixed with [`[$vinegar2]`] teaspoons of vinegar. +a. By this recipe, [_______]{$oil2} teaspoons of vegetable oil should be mixed with [`[$vinegar2]`] teaspoons of vinegar. END_PGML @@ -69,7 +73,7 @@ There is more than one way to do these problems. I will show the "cancelling uni It's given that each teaspoon of vegetable oil should be mixed with [`[$rateOV]`] teaspoons of vinegar. This rate can be written as either [`\frac{1 \text{ teaspoon of vegetable oil}}{[$rateOV] \text{ teaspoons of vinegar}}`], or [`\frac{[$rateOV] \text{ teaspoons of vinegar}}{1 \text{ teaspoon of vegetable oil}}`]. In the following two questions, we will use one of these two rates based on what's given. -*Question 1:* It's given that we have [`[$oil1]`] teaspoons of vegetable oil. We need to pick the fraction with "teaspoons of vegetable oil" in the denominator, so the units can cancel: +*Part a:* It's given that we have [`[$oil1]`] teaspoons of vegetable oil. We need to pick the fraction with "teaspoons of vegetable oil" in the denominator, so the units can cancel: [`` \begin{aligned}[t] @@ -82,7 +86,7 @@ It's given that each teaspoon of vegetable oil should be mixed with [`[$rateOV]` By this recipe, [`[$vinegar1]`] teaspoons of vinegar should be mixed with [`[$oil1]`] teaspoons of vegetable oil. -*Question 2:* It's given that we have [`[$vinegar2]`] teaspoons of vinegar. We need to pick the fraction with "teaspoons of vinegar" in the denominator, so the units can cancel: +*Part b:* It's given that we have [`[$vinegar2]`] teaspoons of vinegar. We need to pick the fraction with "teaspoons of vinegar" in the denominator, so the units can cancel: [`` \begin{aligned}[t] diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange11.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange11.pg index 75b13a1b88..926f723aa2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange11.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange11.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +31,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -52,11 +58,9 @@ According to a salad recipe, each teaspoon of vinegar should be mixed with [`[$r Fill in the blanks. -*Question 1:* By this recipe, [_______]{$vinegar1} teaspoons of vinegar should be mixed with [`[$oil1]`] teaspoons of vegetable oil. - ----- +a. By this recipe, [_______]{$vinegar1} teaspoons of vinegar should be mixed with [`[$oil1]`] teaspoons of vegetable oil. -*Question 2:* By this recipe, [_______]{$oil2} teaspoons of vegetable oil should be mixed with [`[$vinegar2]`] teaspoons of vinegar. +b. By this recipe, [_______]{$oil2} teaspoons of vegetable oil should be mixed with [`[$vinegar2]`] teaspoons of vinegar. END_PGML @@ -69,7 +73,7 @@ There is more than one way to do these problems. I will show the "cancelling uni It's given that each teaspoon of vinegar should be mixed with [`[$rateVO]`] teaspoons of vegetable oil. This rate can be written as either [`\frac{1 \text{ teaspoon of vinegar}}{[$rateVO] \text{ teaspoons of vegetable oil}}`], or [`\frac{[$rateVO] \text{ teaspoons of vegetable oil}}{1 \text{ teaspoon of vinegar}}`]. In the following two questions, we will use one of these two rates based on what's given. -*Question 1:* It's given that we have [`[$oil1]`] teaspoons of vegetable oil. We need to pick the fraction with "teaspoons of vegetable oil" in the denominator, so the units can cancel: +*Part a:* It's given that we have [`[$oil1]`] teaspoons of vegetable oil. We need to pick the fraction with "teaspoons of vegetable oil" in the denominator, so the units can cancel: [`` \begin{aligned}[t] @@ -82,7 +86,7 @@ It's given that each teaspoon of vinegar should be mixed with [`[$rateVO]`] teas By this recipe, [`[$vinegar1]`] teaspoons of vinegar should be mixed with [`[$oil1]`] teaspoons of vegetable oil. -*Question 2:* It's given that we have [`[$vinegar2]`] teaspoons of vinegar. We need to pick the fraction with "teaspoons of vinegar" in the denominator, so the units can cancel: +*Part b:* It's given that we have [`[$vinegar2]`] teaspoons of vinegar. We need to pick the fraction with "teaspoons of vinegar" in the denominator, so the units can cancel: [`` \begin{aligned}[t] diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange20.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange20.pg index 55d47b67e7..ac888edbae 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange20.pg @@ -9,16 +9,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') -## MLT(arithmetic_decimal_application_mutual_fund) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -28,8 +31,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", +# "contextFraction.pl", ); ############################################## @@ -59,11 +65,9 @@ In a mutual fund, each dollar of stock is matched by [`[$rateSBU]`] of bond. Fill in the blanks. -*Question 1:* If a mutual fund has [`[$stock1U]`] in stock, it has [___________]{$bond1U} in bond. - ----- +a. If a mutual fund has [`[$stock1U]`] in stock, it has [___________]{$bond1U} in bond. -*Question 2:* If a mutual fund has [`[$bond2U]`] in bond, it has [___________]{$stock2U} in stock. +b. If a mutual fund has [`[$bond2U]`] in bond, it has [___________]{$stock2U} in stock. END_PGML @@ -76,7 +80,7 @@ There is more than one way to solve this problem. I will use the "cancel unit" m It's given that for each dollar of stock, there are [`[$rateSBU]`] of bond. The rate can be written in two ways: [`\frac{$1 \text{ in stock}}{[$rateSBU] \text{ in bond}}`] and [`\frac{[$rateSBU] \text{ in bond}}{$1 \text{ in stock}}`]. We will choose one of these two rates based on what's given. -*Question 1:* It's given that there are [`[$stock1U]`] in stock, so we should choose the rate [`\frac{[$rateSBU] \text{ in bond}}{$1 \text{ in stock}}`], so the unit "dollars in stock" can cancel: +*Part a:* It's given that there are [`[$stock1U]`] in stock, so we should choose the rate [`\frac{[$rateSBU] \text{ in bond}}{$1 \text{ in stock}}`], so the unit "dollars in stock" can cancel: [`` \begin{aligned}[t] @@ -89,7 +93,7 @@ It's given that for each dollar of stock, there are [`[$rateSBU]`] of bond. The If a mutual fund has [`[$stock1U]`] in stock, it has [`[$bond1U]`] in bond. -*Question 2:* It's given that there are [`[$bond2U]`] in bond, so we should choose the rate [`\frac{$1 \text{ in stock}}{[$rateSBU] \text{ in bond}}`], so the unit "dollars in bond" can cancel: +*Part b:* It's given that there are [`[$bond2U]`] in bond, so we should choose the rate [`\frac{$1 \text{ in stock}}{[$rateSBU] \text{ in bond}}`], so the unit "dollars in bond" can cancel: [`` \begin{aligned}[t] diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange21.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange21.pg index 28d5e9d9df..40d1891e42 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange21.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange21.pg @@ -9,16 +9,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') -## MLT(arithmetic_decimal_application_mutual_fund) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -28,8 +31,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", +# "contextFraction.pl", ); ############################################## @@ -59,11 +65,9 @@ In a mutual fund, each dollar of bond is matched by [`[$rateBSU]`] of stock. Fill in the blanks. -*Question 1:* If a mutual fund has [`[$stock1U]`] in stock, it has [___________]{$bond1U} in bond. - ----- +a. If a mutual fund has [`[$stock1U]`] in stock, it has [___________]{$bond1U} in bond. -*Question 2:* If a mutual fund has [`[$bond2U]`] in bond, it has [___________]{$stock2U} in stock. +b. If a mutual fund has [`[$bond2U]`] in bond, it has [___________]{$stock2U} in stock. END_PGML @@ -76,7 +80,7 @@ There is more than one way to solve this problem. I will use the "cancel unit" m It's given that for each dollar of bond, there are [`[$rateBSU]`] of stock. The rate can be written in two ways: [`\frac{$1 \text{ in bond}}{[$rateBSU] \text{ in stock}}`] and [`\frac{[$rateBSU] \text{ in stock}}{$1 \text{ in bond}}`]. We will choose one of these two rates based on what's given. -*Question 1:* It's given that there are [`[$stock1U]`] in stock, so we should choose the rate [`\frac{$1 \text{ in bond}}{[$rateBSU] \text{ in stock}}`], so the unit "dollars in stock" can cancel: +*Part a:* It's given that there are [`[$stock1U]`] in stock, so we should choose the rate [`\frac{$1 \text{ in bond}}{[$rateBSU] \text{ in stock}}`], so the unit "dollars in stock" can cancel: [`` \begin{aligned}[t] @@ -91,7 +95,7 @@ It's given that for each dollar of bond, there are [`[$rateBSU]`] of stock. The If a mutual fund has [`[$stock1U]`] in stock, it has [`[$bond1U]`] in bond. -*Question 2:* It's given that there are [`[$bond2U]`] in bond, so we should choose the rate [`\frac{[$rateBSU] \text{ in stock}}{$1 \text{ in bond}}`], so the unit "dollars in bond" can cancel: +*Part b:* It's given that there are [`[$bond2U]`] in bond, so we should choose the rate [`\frac{[$rateBSU] \text{ in stock}}{$1 \text{ in bond}}`], so the unit "dollars in bond" can cancel: [`` \begin{aligned}[t] diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange30.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange30.pg index ea8426eb31..79238e4c64 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange30.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') -## MLT(arithmetic_decimal_application_jogging) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +32,7 @@ loadMacros( "PGML.pl", "parserNumberWithUnits.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -64,11 +66,9 @@ On average, [$name] jogs at [`[$rate]`] miles per hour. Fill in blanks. -*Question 1:* At this speed, [$name] can jog [__________]{$distance1U} in [`[$hours1]`] hours. - ----- +a. At this speed, [$name] can jog [__________]{$distance1U} in [`[$hours1]`] hours. -*Question 2:* At this speed, [$name] can jog [`[$distance2]`] miles in [__________]{$hours2U}. +b. At this speed, [$name] can jog [`[$distance2]`] miles in [__________]{$hours2U}. Use *mi* for miles and *hr* for hours. @@ -83,9 +83,7 @@ There are more then one way to do this problem. I will use the "cancelling unit" It's given that [$name] jogs at [`[$rate]`] miles per hour. This rate can be written in two ways: [`\frac{[$rate]\text{ mi}}{1 \text{ hr}}`] or [`\frac{1 \text{ hr}}{[$rate]\text{ mi}}`]. In the following questions, we will choose one of them based on what's given. -###Question 1 - -It's given that [$name] ran [`[$hours1]`] hours. We choose to use the rate [`\frac{[$rate]\text{ mi}}{1 \text{ hr}}`], so the unit "hr" can cancel: +*Part a:* It's given that [$name] ran [`[$hours1]`] hours. We choose to use the rate [`\frac{[$rate]\text{ mi}}{1 \text{ hr}}`], so the unit "hr" can cancel: [`` \begin{aligned}[t] @@ -98,9 +96,7 @@ It's given that [$name] ran [`[$hours1]`] hours. We choose to use the rate [`\fr At this speed, [$name] can jog [`[$distance1]`] miles in [`[$hours1]`] hours. -###Question 2 - -It's given that [$name] ran [`[$distance2]`] miles. We choose to use the rate [`\frac{1 \text{ hr}}{[$rate]\text{ mi}}`], so the unit "mi" can cancel: +*Part b:* It's given that [$name] ran [`[$distance2]`] miles. We choose to use the rate [`\frac{1 \text{ hr}}{[$rate]\text{ mi}}`], so the unit "mi" can cancel: [`` \begin{aligned}[t] diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange31.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange31.pg index 3c284482b0..8a6a704683 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange31.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange31.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') -## MLT(arithmetic_decimal_application_jogging) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +32,7 @@ loadMacros( "PGML.pl", "parserNumberWithUnits.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,11 +67,9 @@ On average, [$name] can jog one mile in [`[$rate]`] hours. Fill in blanks. -*Question 1:* At this speed, [$name] can jog [__________]{$distance1U} in [`[$hours1]`] hours. - ----- +a. At this speed, [$name] can jog [__________]{$distance1U} in [`[$hours1]`] hours. -*Question 2:* At this speed, [$name] can jog [`[$distance2]`] miles in [__________]{$hours2U}. +b. At this speed, [$name] can jog [`[$distance2]`] miles in [__________]{$hours2U}. Use *mi* for miles and *hr* for hours. @@ -84,9 +84,7 @@ There are more then one way to do this problem. I will use the "cancelling unit" On average, [$name] can jog one mile in [`[$rate]`] hours. This rate can be written in two ways: [`\frac{1 \text{ mi}}{[$rate] \text{ hr}}`] or [`\frac{[$rate] \text{ hr}}{1 \text{ mi}}`]. In the following questions, we will choose one of them based on what's given. -###Question 1 - -It's given that [$name] ran [`[$hours1]`] hours. We choose to use the rate [`\frac{1 \text{ mi}}{[$rate] \text{ hr}}`], so the unit "hr" can cancel: +*Part a:* It's given that [$name] ran [`[$hours1]`] hours. We choose to use the rate [`\frac{1 \text{ mi}}{[$rate] \text{ hr}}`], so the unit "hr" can cancel: [`` \begin{aligned}[t] @@ -101,9 +99,7 @@ It's given that [$name] ran [`[$hours1]`] hours. We choose to use the rate [`\fr At this speed, [$name] can jog [`[$distance1]`] miles in [`[$hours1]`] hours. -###Question 2 - -It's given that [$name] ran [`[$distance2]`] miles. We choose to use the rate [`\frac{[$rate] \text{ hr}}{1 \text{ mi}}`], so the unit "mi" can cancel: +*Part b:* It's given that [$name] ran [`[$distance2]`] miles. We choose to use the rate [`\frac{[$rate] \text{ hr}}{1 \text{ mi}}`], so the unit "mi" can cancel: [`` \begin{aligned}[t] diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange40.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange40.pg index 3d9f076453..99813696d8 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange40.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') -## MLT(arithmetic_decimal_application_apple) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -30,7 +33,7 @@ loadMacros( "parserNumberWithUnits.pl", "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -65,11 +68,9 @@ Apples cost [`[$rateU]`] per pound at a store. Fill in blanks: -*Question 1:* It costs [__________]{$totalU} to purchase [`[$lbs]`] pounds of apples. +a. It costs [__________]{$totalU} to purchase [`[$lbs]`] pounds of apples. ----- - -*Question 2:* It costs [`[$total1U]`] to purchase [__________]{$lbs1} pounds of apples. +b. It costs [`[$total1U]`] to purchase [__________]{$lbs1} pounds of apples. END_PGML @@ -83,9 +84,7 @@ $rate3U = Currency($rate*3); BEGIN_PGML_SOLUTION -###Question 1 - -It's given that apples sell for [`[$rateU]`] per pound, or [`\frac{[$rateU]}{1 \text{ lb}}`]. To purchase [`[$lbs]`] lb of apples, we do: +*Part a:* It's given that apples sell for [`[$rateU]`] per pound, or [`\frac{[$rateU]}{1 \text{ lb}}`]. To purchase [`[$lbs]`] lb of apples, we do: [`` \begin{aligned}[t] @@ -98,11 +97,9 @@ It's given that apples sell for [`[$rateU]`] per pound, or [`\frac{[$rateU]}{1 \ Notice that the unit *lb* cancelled. -*Solution:* It costs [`[$totalU]`] to purchase [`[$lbs]`] pounds of apples. - -###Question 2 +It costs [`[$totalU]`] to purchase [`[$lbs]`] pounds of apples. -It's given there are [`[$total1U]`] to spend. We cannot still do [`[$total1U] \cdot \frac{[$rateU]}{1 \text{ lb}} `], because the unit "dollars" will not cancel. We need to "flip" the rate from [` \frac{[$rateU]}{1 \text{ lb}} `] to [` \frac{1 \text{ lb}}{[$rateU]} `] first, and then do: +*Part b:* It's given there are [`[$total1U]`] to spend. We cannot still do [`[$total1U] \cdot \frac{[$rateU]}{1 \text{ lb}} `], because the unit "dollars" will not cancel. We need to "flip" the rate from [` \frac{[$rateU]}{1 \text{ lb}} `] to [` \frac{1 \text{ lb}}{[$rateU]} `] first, and then do: [`` \begin{aligned}[t] @@ -115,7 +112,7 @@ It's given there are [`[$total1U]`] to spend. We cannot still do [`[$total1U] \c \end{aligned} ``] -*Solution:* It costs [`[$total1U]`] to purchase [`[$lbs1]`] pounds of apples. +It costs [`[$total1U]`] to purchase [`[$lbs1]`] pounds of apples. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange50.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange50.pg index eb8425216b..67e76a18df 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange50.pg @@ -11,15 +11,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Integers) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -33,7 +36,7 @@ loadMacros( "parserNumberWithUnits.pl", "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,11 +65,9 @@ On average, [$name] collects [`[$rate]`] stamps every year. Fill in blanks: -*Question 1:* At this rate, [$name] would collect [_________]{$total} stamps in [`[$years]`] years. - ----- +a. At this rate, [$name] would collect [_________]{$total} stamps in [`[$years]`] years. -*Question 2:* At this rate, [$name] would collect [`[$total1]`] stamps in [___________]{$years1} years. +b. At this rate, [$name] would collect [`[$total1]`] stamps in [___________]{$years1} years. END_PGML @@ -75,9 +76,7 @@ END_PGML BEGIN_PGML_SOLUTION -###Question 1 - -It's given that [$name] collects [`[$rate]`] stamps every year, or [`\frac{[$rate] \text{ stamps}}{1 \text{ year}} `]. +*Part a:* It's given that [$name] collects [`[$rate]`] stamps every year, or [`\frac{[$rate] \text{ stamps}}{1 \text{ year}} `]. To find the number of stamps [$name] can collect in [`[$years]`] years, we do: @@ -92,11 +91,9 @@ To find the number of stamps [$name] can collect in [`[$years]`] years, we do: Notice that the unit *year* cancelled. -*Solution:* At this rate, [$name] would collect [`[$total]`] stamps in [`[$years]`] years. - -###Question 2 +At this rate, [$name] would collect [`[$total]`] stamps in [`[$years]`] years. -To find how long it would take to collect [`[$total1]`] stamps, we cannot still do [`[$total1] \text{ stamps} \cdot \frac{[$rate] \text{ stamps}}{1 \text{ year}} `], because the unit "stamps" will not cancel. We need to "flip" the rate from [` \frac{[$rate] \text{ stamps}}{1 \text{ year}} `] to [` \frac{1 \text{ year}}{[$rate] \text{ stamps}} `] first, and then do: +*Part b:* To find how long it would take to collect [`[$total1]`] stamps, we cannot still do [`[$total1] \text{ stamps} \cdot \frac{[$rate] \text{ stamps}}{1 \text{ year}} `], because the unit "stamps" will not cancel. We need to "flip" the rate from [` \frac{[$rate] \text{ stamps}}{1 \text{ year}} `] to [` \frac{1 \text{ year}}{[$rate] \text{ stamps}} `] first, and then do: [`` \begin{aligned}[t] @@ -109,7 +106,7 @@ To find how long it would take to collect [`[$total1]`] stamps, we cannot still \end{aligned} ``] -*Solution:* At this rate, [$name] would collect [`[$total1]`] stamps in [`[$years1]`] years. +At this rate, [$name] would collect [`[$total1]`] stamps in [`[$years1]`] years. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange60.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange60.pg index 4d544e7baa..674c0ed75d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange60.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') -## MLT(arithmetic_decimal_application_property_tax) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextCurrency.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -62,11 +66,9 @@ In a city, the property tax rate for per thousand dollars of property value is [ Fill in blanks: -*Question 1:* The owner of a house worth [`[$value]`] thousand dollars should pay [________]{$tax} dollars in tax. - ----- +a. The owner of a house worth [`[$value]`] thousand dollars should pay [________]{$tax} dollars in tax. -*Question 2:* The owner of a house worth [__________]{$value1} thousand dollars should pay [`[$tax1U]`] in tax. +b. The owner of a house worth [__________]{$value1} thousand dollars should pay [`[$tax1U]`] in tax. END_PGML @@ -75,9 +77,7 @@ END_PGML BEGIN_PGML_SOLUTION -###Question 1 - -It's given that, for each thousand dollars of property value, the owner needs to pay [`[$rate]`] dollars, or [`\frac{[$rate] \text{ dollars in tax}}{1 \text{ thousand dollars in property value}} `]. +*Part a:* It's given that, for each thousand dollars of property value, the owner needs to pay [`[$rate]`] dollars, or [`\frac{[$rate] \text{ dollars in tax}}{1 \text{ thousand dollars in property value}} `]. To find how much the owner of a house worth [`[$value]`] thousand dollars should pay, we do: @@ -92,11 +92,9 @@ To find how much the owner of a house worth [`[$value]`] thousand dollars should Notice that the unit *thousand dollars* cancelled. -*Solution:* The owner of a house worth [`[$value]`] thousand dollars should pay [`[$tax]`] dollars in tax. - -###Question 2 +The owner of a house worth [`[$value]`] thousand dollars should pay [`[$tax]`] dollars in tax. -It's given the property tax of a house is [`[$tax1]`] dollars in tax. We cannot still do [`[$tax1] \text{ dollars in tax} \cdot \frac{[$rate] \text{ dollars in tax}}{1 \text{ thousand dollars in property value}} `], because the unit "dollars in tax" will not cancel. We need to "flip" the rate from [` \frac{[$rate] \text{ dollars in tax}}{1 \text{ thousand dollars in property value}} `] to [` \frac{1 \text{ thousand dollars in property value}}{[$rate] \text{ dollars in tax}} `] first, and then do: +*Part b:* It's given the property tax of a house is [`[$tax1]`] dollars in tax. We cannot still do [`[$tax1] \text{ dollars in tax} \cdot \frac{[$rate] \text{ dollars in tax}}{1 \text{ thousand dollars in property value}} `], because the unit "dollars in tax" will not cancel. We need to "flip" the rate from [` \frac{[$rate] \text{ dollars in tax}}{1 \text{ thousand dollars in property value}} `] to [` \frac{1 \text{ thousand dollars in property value}}{[$rate] \text{ dollars in tax}} `] first, and then do: [`` \begin{aligned}[t] @@ -109,7 +107,7 @@ It's given the property tax of a house is [`[$tax1]`] dollars in tax. We cannot \end{aligned} ``] -*Solution:* The owner of a house worth [`[$value1]`] thousand dollars should pay [`[$tax1U]`] in tax. +The owner of a house worth [`[$value1]`] thousand dollars should pay [`[$tax1U]`] in tax. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange70.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange70.pg index c6dfef4e8e..83780184f1 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRateOfChange70.pg @@ -11,17 +11,19 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Decimals) -## DBsection(Applications) -## Institution(PCC) -## Author(Carl Yao) -## Level(5) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate') -## MLTleader(1) -## MLT(arithmetic_decimal_application_vegetable_oil) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -32,7 +34,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", ); ############################################## @@ -60,9 +64,9 @@ On average, a restaurant uses [`[$rateU]`] of vegetable oil per day. Fill in blanks. -*Question 1:* The restaurant will use [_________]{$totalU} of vegetable oil in [`[$days]`] days. +a. The restaurant will use [_________]{$totalU} of vegetable oil in [`[$days]`] days. -*Question 2:* The restaurant will use [`[$total1U]`] of vegetable oil in [__________]{$days1} days. +b. The restaurant will use [`[$total1U]`] of vegetable oil in [__________]{$days1} days. Use *lb* for pounds. @@ -73,9 +77,7 @@ END_PGML BEGIN_PGML_SOLUTION -###Question 1 - -It's given that [`[$rateU]`] of vegetable oil is used every day, or [`\frac{[$rateU]}{1 \text{ day}} `]. +*Part a:* It's given that [`[$rateU]`] of vegetable oil is used every day, or [`\frac{[$rateU]}{1 \text{ day}} `]. To find the amount of oil used in [`[$days]`] days, we do: @@ -90,11 +92,9 @@ To find the amount of oil used in [`[$days]`] days, we do: Notice that the unit *days* cancelled. -*Solution:* In [`[$days]`] days, the restaurant will use [` [$total] `] lb of vegetable oil. - -###Question 2 +In [`[$days]`] days, the restaurant will use [` [$total] `] lb of vegetable oil. -It's given there are [`[$total1U]`] of vegetable oil to use. We cannot still do [`[$total1U] \cdot \frac{[$rateU]}{1 \text{ day}} `], because the unit "lb" will not cancel. We need to "flip" the rate from [` \frac{[$rateU]}{1 \text{ day}} `] to [` \frac{1 \text{ day}}{[$rateU]} `] first, and then do: +*Part a:* It's given there are [`[$total1U]`] of vegetable oil to use. We cannot still do [`[$total1U] \cdot \frac{[$rateU]}{1 \text{ day}} `], because the unit "lb" will not cancel. We need to "flip" the rate from [` \frac{[$rateU]}{1 \text{ day}} `] to [` \frac{1 \text{ day}}{[$rateU]} `] first, and then do: [`` \begin{aligned}[t] @@ -107,7 +107,7 @@ It's given there are [`[$total1U]`] of vegetable oil to use. We cannot still do \end{aligned} ``] -*Solution:* The restaurant will use [`[$total1U]`] of vegetable oil in [`[$days1]`] days. +The restaurant will use [`[$total1U]`] of vegetable oil in [`[$days1]`] days. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio10.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio10.pg index ff55ce0bd1..d21249afea 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio10.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Ratio/proportions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('ratio','application') -## MLTleader(1) -## MLT(arithmetic_fractions_ratio_students) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,8 +30,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -50,7 +54,7 @@ BEGIN_PGML The ratio of a school's male students to female students is [`[$maleR]:[$femaleR]`]. If the school has [`[$male]`] male students, how many female students are there? -*Solution:* If the school has [`[$male]`] male students, the school has [_________]{$female} female students. +If the school has [`[$male]`] male students, the school has [_________]{$female} female students. END_PGML @@ -74,7 +78,7 @@ It's given the school has [`[$male]`] male students, so we will use the ratio [` \end{aligned} ``] -*Solution:* If the school has [`[$male]`] male students, the school has [`[$female]`] female students. +If the school has [`[$male]`] male students, the school has [`[$female]`] female students. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio11.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio11.pg index 581f9bbd7a..bd9691150d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio11.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio11.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Ratio/proportions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('ratio','application') -## MLT(arithmetic_fractions_ratio_students) +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +30,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", +# "contextCurrency.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -49,7 +54,7 @@ BEGIN_PGML The ratio of a school's male students to female students is [`[$maleR]:[$femaleR]`]. If the school has [`[$female]`] female students, how many male students are there? -*Solution:* If the school has [`[$female]`] female students, the school has [_________]{$male} male students. +If the school has [`[$female]`] female students, the school has [_________]{$male} male students. END_PGML @@ -73,7 +78,7 @@ It's given the school has [`[$female]`] female students, so we will use the rati \end{aligned} ``] -*Solution:* If the school has [`[$female]`] female students, the school has [`[$male]`] male students. +If the school has [`[$female]`] female students, the school has [`[$male]`] male students. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio20.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio20.pg index 177f305d7c..05c2e40c05 100644 --- a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio20.pg @@ -10,15 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('6.RP') -## DBsubject(Arithmetic) -## DBchapter(Fractions/rational numbers) -## DBsection(Ratio/proportions) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('ratio','application') +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,9 +32,11 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextCurrency.pl", + "PGcourse.pl", "contextFraction.pl", - "PGcourse.pl" ); ############################################## @@ -55,7 +60,7 @@ BEGIN_PGML According to a school's budget, the money spent on buying new equipment and money spent on maintenance of old equipment should be in the ratio of [`[$newR]:[$oldR]`]. In one year, if the money spent on buying new equipment is [`[$newC]`], how much money was spent on maintenance of old equipment? -*Solution:* In one year, if the money spent on buying new equipment was [`[$newC]`], [_________]{$oldC} was spent on maintenance of old equipment. +In one year, if the money spent on buying new equipment was [`[$newC]`], [_________]{$oldC} was spent on maintenance of old equipment. END_PGML @@ -79,7 +84,7 @@ It's given the school spent [`[$newC]`] dollars on new equipment, so we will use \end{aligned} ``] -*Solution:* In one year, if the money spent on buying new equipment was $[`[$new]`], [`[$oldC]`] was spent on maintenance of old equipment. +In one year, if the money spent on buying new equipment was $[`[$new]`], [`[$oldC]`] was spent on maintenance of old equipment. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio21.pg b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio21.pg new file mode 100644 index 0000000000..9de1f31f31 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/Rate/UseRatio21.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# According to a school's budget, the money spent on buying new equipment +# and money spent on maintenance of old equipment should be in the ratio of 5:3. +# In one year, if the money spent on maintenance is $24,000, +# how much money was spent on buying new equipment? +# +# Last edited: Carl Yao 10/27/13 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('ratio','application') +## DBCCSS('6.RP') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "contextCurrency.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("LimitedNumeric"); + +$newR=random(2,9,1); +do {$oldR=random(2,9,1);} until (gcd($oldR,$newR)==1); +$new = $newR*random(10000,20000,100); +$old= $new*$oldR/$newR; + +Context("Currency"); +$newC = Currency($new); +$oldC = Currency($old); + +############################################## + +BEGIN_PGML + +According to a school's budget, the money spent on buying new equipment and money spent on maintenance of old equipment should be in the ratio of [`[$newR]:[$oldR]`]. In one year, if the money spent on maintenance of old equipment was [`[$oldC]`], how much money was spent on buying new equipment? + +In one year, if the money spent on maintenance of old equipment was [`[$oldC]`], then [_________]{$newC} was spent on buying new equipment. + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +The ratio of new equipment buying to old equipment maintenance is given as [`[$newR]:[$oldR]`]. This can be written as either [`\frac{[$newR] \text{ dollars spent on new equipment}}{[$oldR] \text{ dollars spent on maintenance}}`] or [`\frac{[$oldR] \text{ dollars spent on maintenance}}{[$newR] \text{ dollars spent on new equipment}}`]. + +It's given the school spent [`[$oldC]`] dollars on maintenance of old equipment, so we will use the ratio [`\frac{[$newR] \text{ dollars spent on new equipment}}{[$oldR] \text{ dollars spent on maintenance}}`], so the unit "dollars spent on maintenance" will cancel: + + [`` +\begin{aligned}[t] + &\phantom{{}=}[$old] \text{ dollars spent on maintenance} \cdot \frac{[$newR] \text{ dollars spent on new equipment}}{[$oldR] \text{ dollars spent on new equipment}} \\ + &= \frac{[$old] \text{ dollars spent on maintenance}}{1} \cdot \frac{[$newR] \text{ dollars spent on new equipment}}{[$oldR] \text{ dollars spent on maintenance}} \\ + &= \frac{[$old]}{1} \cdot \frac{[$newR] \text{ dollars spent on new equipment}}{[$oldR]} \\ + &= \frac{[$old]\cdot[$newR]}{1 \cdot [$oldR]} \text{ dollars spent on new equipment} \\ + &= \frac{[$old*$newR]}{[$oldR]} \text{ dollars spent on new equipment} \\ + &= [$new] \text{ dollars spent on new equipment} +\end{aligned} + ``] + +In one year, if the money spent on maintenance of old equipment was [`[$oldC]`], then [`[$newC]`] was spent on buying new equipment. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican10.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican10.pg index 44d4337628..775bae5e1b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican10.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -50,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ foot} = 12 \text{ inches} `]. Do the following unit conversions. ----- - - [`` [$ft1] \text{ feet} = ``] [__________]{$in1} [`` \text{ inches} ``] - ----- +a. [`` [$ft1] \text{ feet} = ``] [__________]{$in1} [`` \text{ inches} ``] - [`` [$in2] \text{ inches} = ``] [__________]{$ft2} [`` \text{ feet} ``] +b. [`` [$in2] \text{ inches} = ``] [__________]{$ft2} [`` \text{ feet} ``] END_PGML @@ -80,7 +79,7 @@ To convert [` [$ft1] `] feet to inches, we will use [` \frac{12 \text{ in}}{1 \t \end{aligned} ``] -*Solution:* [`` [$ft1] \text{ ft} = [$in1] \text{ in} ``] + So, [`` [$ft1] \text{ ft} = [$in1] \text{ in} ``] Next, to convert [` [$in2] `] inches to feet, we will use [` \frac{1 \text{ ft}}{12 \text{ in}} `], so the unit *in* will cancel: @@ -95,7 +94,7 @@ Next, to convert [` [$in2] `] inches to feet, we will use [` \frac{1 \text{ ft}} \end{aligned} ``] -*Solution:* [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] + So, [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] ####Proportion Method @@ -113,7 +112,7 @@ Assume [`[$ft1] \text{ ft} = x \text{ in} `]. We have: \end{aligned} ``] -*Solution:* [`` [$ft1] \text{ ft} = [$in1] \text{ in} ``] + So, [`` [$ft1] \text{ ft} = [$in1] \text{ in} ``] Next, assume [`x \text{ ft} = [$in2] \text{ in} `]. We have: @@ -129,7 +128,7 @@ Next, assume [`x \text{ ft} = [$in2] \text{ in} `]. We have: \end{aligned} ``] -*Solution:* [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] + So, [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican100.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican100.pg index 829d0cf713..d0651c85c7 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican100.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican100.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ yard} = 3 \text{ feet} `] and [` 1 \text{ foot} = 12 \text{ inches} `]. Do the following unit conversion. ----- - [`` [$in] \text{ inches} = ``] [__________]{$yd} [`` \text{ yards} ``] END_PGML @@ -75,7 +77,7 @@ Next, we change the given number [` [$in] \text{ inches} `] into a fraction, [` \end{aligned} ``] -*Solution:* [`` [$in] \text{ in} = [$yd] \text{ yd} ``] + So, [`` [$in] \text{ in} = [$yd] \text{ yd} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican110.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican110.pg index 97cff231ad..f061116b98 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican110.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican110.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') - +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +49,6 @@ BEGIN_PGML It's given that [` 1 \text{ yard} = 3 \text{ feet} `] and [` 1 \text{ foot} = 12 \text{ inches} `]. Do the following unit conversion. ----- - [`` [$in] \text{ inches} = ``] [__________]{$yd} [`` \text{ yards} ``] END_PGML @@ -75,7 +76,7 @@ Next, we change the given number [` [$in] \text{ inches} `] into a fraction, [` \end{aligned} ``] -*Solution:* [`` [$in] \text{ in} = [$yd] \text{ yd} ``] + So, [`` [$in] \text{ in} = [$yd] \text{ yd} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican120.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican120.pg index a950e684ed..4ec6418298 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican120.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican120.pg @@ -8,18 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') - +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -30,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -50,13 +52,9 @@ BEGIN_PGML It's given that [` 1 \text{ mile} = 5280 \text{ feet} `]. Do the following unit conversions. ----- - - [`` [$mi1] \text{ miles} = ``] [__________]{$ft1} [`` \text{ feet} ``] - ----- +a. [`` [$mi1] \text{ miles} = ``] [__________]{$ft1} [`` \text{ feet} ``] - [`` [$ft2] \text{ feet} = ``] [__________]{$mi2} [`` \text{ miles} ``] +b. [`` [$ft2] \text{ feet} = ``] [__________]{$mi2} [`` \text{ miles} ``] END_PGML @@ -80,7 +78,7 @@ To convert [` [$mi1] `] miles to feet, we will use [` \frac{5280 \text{ ft}}{1 \ \end{aligned} ``] -*Solution:* [`` [$mi1] \text{ mi} = [$ft1] \text{ ft} ``] + So, [`` [$mi1] \text{ mi} = [$ft1] \text{ ft} ``] Next, to convert [` [$ft2] `] feet to miles, we will use [` \frac{1 \text{ mi}}{5280 \text{ ft}} `], so the unit *in* will cancel: @@ -95,7 +93,7 @@ Next, to convert [` [$ft2] `] feet to miles, we will use [` \frac{1 \text{ mi}}{ \end{aligned} ``] -*Solution:* [`` [$ft2] \text{ ft} = [$mi2] \text{ mi} ``] + So, [`` [$ft2] \text{ ft} = [$mi2] \text{ mi} ``] ####Proportion Method @@ -113,7 +111,7 @@ Assume [`[$mi1] \text{ mi} = x \text{ ft} `]. We have: \end{aligned} ``] -*Solution:* [`` [$mi1] \text{ mi} = [$ft1] \text{ ft} ``] + So, [`` [$mi1] \text{ mi} = [$ft1] \text{ ft} ``] Next, assume [`x \text{ mi} = [$ft2] \text{ ft} `]. We have: @@ -129,17 +127,17 @@ Next, assume [`x \text{ mi} = [$ft2] \text{ ft} `]. We have: \end{aligned} ``] -*Solution:* [`` [$ft2] \text{ ft} = [$mi2] \text{ mi} ``] + So, [`` [$ft2] \text{ ft} = [$mi2] \text{ mi} ``] ####Shortcut It's given that [` 1 \text{ miles} = 5280 \text{ feet} `]. To convert between these two units, we either multiply or divide by [`5280`]. -For Question 1, to convert [` [$mi1] `] miles to feet, the number will become bigger. So we do: +For Part a, to convert [` [$mi1] `] miles to feet, the number will become bigger. So we do: [`` [$mi1] \text{ mi} = [$mi1] \cdot 5280 \text{ ft} = [$ft1] \text{ ft} ``] -For Question 2, to convert [` [$ft2] `] feet to miles, the number will become smaller. So we do: +For Part b, to convert [` [$ft2] `] feet to miles, the number will become smaller. So we do: [`` [$ft2] \text{ ft} = [$ft2] \div 5280 \text{ mi} = [$mi2] \text{ mi} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican130.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican130.pg index c523061a19..732188b4d4 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican130.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican130.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') - +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +49,6 @@ BEGIN_PGML It's given that [` 1 \text{ mile} = 5280 \text{ feet} `] and [` 1 \text{ foot} = 12 \text{ inches} `]. Do the following unit conversion. ----- - [`` [$mi] \text{ miles} = ``] [__________]{$in} [`` \text{ inches} ``] END_PGML @@ -75,7 +76,7 @@ Next, we change the given number [` [$mi] \text{ miles} `] into a fraction, [` \ \end{aligned} ``] -*Solution:* [`` [$mi] \text{ mi} = [$in] \text{ in} ``] + So, [`` [$mi] \text{ mi} = [$in] \text{ in} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican140.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican140.pg index 7e5346155c..556982a276 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican140.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican140.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') - +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +49,6 @@ BEGIN_PGML It's given that [` 1 \text{ mile} = 5280 \text{ feet} `] and [` 1 \text{ yard} = 3 \text{ feet} `]. Do the following unit conversion. ----- - [`` [$mi] \text{ miles} = ``] [__________]{$yd} [`` \text{ yards} ``] END_PGML @@ -75,7 +76,7 @@ Next, we change the given number [` [$mi] \text{ miles} `] into a fraction, [` \ \end{aligned} ``] -*Solution:* [`` [$mi] \text{ mi} = [$yd] \text{ yd} ``] + So, [`` [$mi] \text{ mi} = [$yd] \text{ yd} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican150.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican150.pg index a8193e7690..c1b65f5571 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican150.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican150.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') - +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +49,6 @@ BEGIN_PGML It's given that [` 1 \text{ mile} = 5280 \text{ feet} `] and [` 1 \text{ foot} = 12 \text{ inches} `]. Do the following unit conversion. ----- - [`` [$in] \text{ inches} = ``] [__________]{$mi} [`` \text{ miles} ``] END_PGML @@ -75,7 +76,7 @@ Next, we change the given number [` [$in] \text{ inches} `] into a fraction, [` \end{aligned} ``] -*Solution:* [`` [$in] \text{ in} = [$mi] \text{ mi} ``] + So, [`` [$in] \text{ in} = [$mi] \text{ mi} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican160.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican160.pg index c2633d815b..ec5f977296 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican160.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican160.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') - +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +49,6 @@ BEGIN_PGML It's given that [` 1 \text{ mile} = 5280 \text{ feet} `] and [` 1 \text{ yard} = 3 \text{ feet} `]. Do the following unit conversion. ----- - [`` [$yd] \text{ yards} = ``] [__________]{$mi} [`` \text{ miles} ``] END_PGML @@ -75,7 +76,7 @@ Next, we change the given number [` [$yd] \text{ yards} `] into a fraction, [` \ \end{aligned} ``] -*Solution:* [`` [$yd] \text{ yd} = [$mi] \text{ mi} ``] + So, [`` [$yd] \text{ yd} = [$mi] \text{ mi} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican170.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican170.pg index 03ca21f92c..b26dbbf900 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican170.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican170.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_weight) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -55,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ ton} = 2000 \text{ lb} `]. Do the following unit conversions. ----- - - [`` [$t1] \text{ tons} = ``] [__________]{$lb1} [`` \text{ lb} ``] - ----- +a. [`` [$t1] \text{ tons} = ``] [__________]{$lb1} [`` \text{ lb} ``] - [`` [$lb2] \text{ lb} = ``] [__________]{$t2} [`` \text{ tons} ``] +b. [`` [$lb2] \text{ lb} = ``] [__________]{$t2} [`` \text{ tons} ``] END_PGML @@ -85,7 +84,7 @@ To convert [` [$t1] `] tons to lb, we will use [` \frac{2000 \text{ lb}}{1 \text \end{aligned} ``] -*Solution:* [`` [$t1] \text{ t} = [$lb1] \text{ lb} ``] + So, [`` [$t1] \text{ t} = [$lb1] \text{ lb} ``] Next, to convert [` [$lb2] `] lb to tons, we will use [` \frac{1 \text{ t}}{2000 \text{ lb}} `], so the unit *lb* will cancel: @@ -100,7 +99,7 @@ Next, to convert [` [$lb2] `] lb to tons, we will use [` \frac{1 \text{ t}}{2000 \end{aligned} ``] -*Solution:* [`` [$lb2] \text{ lb} = [$t2] \text{ t} ``] + So, [`` [$lb2] \text{ lb} = [$t2] \text{ t} ``] ####Proportion Method @@ -118,7 +117,7 @@ Assume [`[$t1] \text{ t} = x \text{ lb} `]. We have: \end{aligned} ``] -*Solution:* [`` [$t1] \text{ t} = [$lb1] \text{ lb} ``] + So, [`` [$t1] \text{ t} = [$lb1] \text{ lb} ``] Next, assume [`x \text{ t} = [$lb2] \text{ lb} `]. We have: @@ -134,17 +133,17 @@ Next, assume [`x \text{ t} = [$lb2] \text{ lb} `]. We have: \end{aligned} ``] -*Solution:* [`` [$lb2] \text{ lb} = [$t2] \text{ t} ``] + So, [`` [$lb2] \text{ lb} = [$t2] \text{ t} ``] ####Shortcut It's given that [` 1 \text{ ton} = 2000 \text{ lb} `]. To convert between these two units, we either multiply or divide by [`2000`]. -For Question 1, to convert [` [$t1] `] tons to lb, the number will become bigger. So we do: +For Part a, to convert [` [$t1] `] tons to lb, the number will become bigger. So we do: [`` [$t1] \text{ t} = [$t1] \cdot 2000 \text{ lb} = [$lb1] \text{ lb} ``] -For Question 2, to convert [` [$lb2] `] lb to tons, the number will become smaller. So we do: +For Part b, to convert [` [$lb2] `] lb to tons, the number will become smaller. So we do: [`` [$lb2] \text{ lb} = [$lb2] \div 2000 \text{ t} = [$t2] \text{ t} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican180.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican180.pg index da2215ba54..8bd9a93b0e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican180.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican180.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_weight) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American','decimal') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ ton} = 2000 \text{ lb} `]. Do the following unit conversions. ----- - - [`` [$t1] \text{ tons} = ``] [__________]{$lb1} [`` \text{ lb} ``] - ----- +a. [`` [$t1] \text{ tons} = ``] [__________]{$lb1} [`` \text{ lb} ``] - [`` [$lb2] \text{ lb} = ``] [__________]{$t2} [`` \text{ tons} ``] +b. [`` [$lb2] \text{ lb} = ``] [__________]{$t2} [`` \text{ tons} ``] END_PGML @@ -84,7 +84,7 @@ To convert [` [$t1] `] tons to lb, we will use [` \frac{2000 \text{ lb}}{1 \text \end{aligned} ``] -*Solution:* [`` [$t1] \text{ t} = [$lb1] \text{ lb} ``] + So, [`` [$t1] \text{ t} = [$lb1] \text{ lb} ``] Next, to convert [` [$lb2] `] lb to tons, we will use [` \frac{1 \text{ t}}{2000 \text{ lb}} `], so the unit *lb* will cancel: @@ -99,7 +99,7 @@ Next, to convert [` [$lb2] `] lb to tons, we will use [` \frac{1 \text{ t}}{2000 \end{aligned} ``] -*Solution:* [`` [$lb2] \text{ lb} = [$t2] \text{ t} ``] + So, [`` [$lb2] \text{ lb} = [$t2] \text{ t} ``] ####Proportion Method @@ -117,7 +117,7 @@ Assume [`[$t1] \text{ t} = x \text{ lb} `]. We have: \end{aligned} ``] -*Solution:* [`` [$t1] \text{ t} = [$lb1] \text{ lb} ``] + So, [`` [$t1] \text{ t} = [$lb1] \text{ lb} ``] Next, assume [`x \text{ t} = [$lb2] \text{ lb} `]. We have: @@ -133,17 +133,17 @@ Next, assume [`x \text{ t} = [$lb2] \text{ lb} `]. We have: \end{aligned} ``] -*Solution:* [`` [$lb2] \text{ lb} = [$t2] \text{ t} ``] + So, [`` [$lb2] \text{ lb} = [$t2] \text{ t} ``] ####Shortcut It's given that [` 1 \text{ ton} = 2000 \text{ lb} `]. To convert between these two units, we either multiply or divide by [`2000`]. -For Question 1, to convert [` [$t1] `] tons to lb, the number will become bigger. So we do: +For Part a, to convert [` [$t1] `] tons to lb, the number will become bigger. So we do: [`` [$t1] \text{ t} = [$t1] \cdot 2000 \text{ lb} = [$lb1] \text{ lb} ``] -For Question 2, to convert [` [$lb2] `] lb to tons, the number will become smaller. So we do: +For Part b, to convert [` [$lb2] `] lb to tons, the number will become smaller. So we do: [`` [$lb2] \text{ lb} = [$lb2] \div 2000 \text{ t} = [$t2] \text{ t} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican190.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican190.pg index 9b8041113e..04c01e4c77 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican190.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican190.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_weight) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ ton} = 2000 \text{ lb} `] and [` 1 \text{ lb} = 16 \text{ oz} `].Do the following unit conversion. ----- - [`` [$oz] \text{ oz} = ``] [__________]{$t} [`` \text{ tons} ``] END_PGML @@ -75,7 +77,7 @@ Next, we change the given number [` [$oz] \text{ oz} `] into a fraction, [` \fra \end{aligned} ``] -*Solution:* [`` [$oz] \text{ g} = [$t] \text{ t} ``] + So, [`` [$oz] \text{ g} = [$t] \text{ t} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican20.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican20.pg index 7c918662d6..bcba5d7169 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ foot} = 12 \text{ inches} `]. Do the following unit conversions. ----- - - [`` [$ft1] \text{ feet} = ``] [__________]{$in1} [`` \text{ inches} ``] - ----- +a. [`` [$ft1] \text{ feet} = ``] [__________]{$in1} [`` \text{ inches} ``] - [`` [$in2] \text{ inches} = ``] [__________]{$ft2} [`` \text{ feet} ``] +b. [`` [$in2] \text{ inches} = ``] [__________]{$ft2} [`` \text{ feet} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$ft1] `] feet to inches, we will use [` \frac{12 \text{ in}}{1 \t \end{aligned} ``] -*Solution:* [`` [$ft1] \text{ ft} = [$in1] \text{ in} ``] + So, [`` [$ft1] \text{ ft} = [$in1] \text{ in} ``] Next, to convert [` [$in2] `] inches to feet, we will use [` \frac{1 \text{ ft}}{12 \text{ in}} `], so the unit *in* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$in2] `] inches to feet, we will use [` \frac{1 \text{ ft}} \end{aligned} ``] -*Solution:* [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] + So, [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$ft1] \text{ ft} = x \text{ in} `]. We have: \end{aligned} ``] -*Solution:* [`` [$ft1] \text{ ft} = [$in1] \text{ in} ``] + So, [`` [$ft1] \text{ ft} = [$in1] \text{ in} ``] Next, assume [`x \text{ ft} = [$in2] \text{ in} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ ft} = [$in2] \text{ in} `]. We have: \end{aligned} ``] -*Solution:* [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] + So, [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican30.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican30.pg index d085b947f7..7626a4b007 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican30.pg @@ -8,17 +8,19 @@ # # ENDDESCRIPTION +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate','proportion','unit','conversion','American','fraction') ## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) -## KEYWORDS('rate','proportion','unit','conversion','American','fraction') ############################################## @@ -28,8 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ foot} = 12 \text{ inches} `]. Do the following unit conversions. Use fractions in your answer when needed. ----- - - [`` [$ft1] \text{ feet} = ``] [__________]{$in1} [`` \text{ inches} ``] - ----- +a. [`` [$ft1] \text{ feet} = ``] [__________]{$in1} [`` \text{ inches} ``] - [`` [$in2] \text{ inches} = ``] [__________]{$ft2} [`` \text{ feet} ``] +b. [`` [$in2] \text{ inches} = ``] [__________]{$ft2} [`` \text{ feet} ``] END_PGML @@ -84,7 +84,7 @@ To convert [` [$ft1] `] feet to inches, we will use [` \frac{12 \text{ in}}{1 \t \end{aligned} ``] -*Solution:* [`` [$ft1] \text{ ft} = [$in1] \text{ in} ``] + So, [`` [$ft1] \text{ ft} = [$in1] \text{ in} ``] Next, to convert [` [$in2] `] inches to feet, we will use [` \frac{1 \text{ ft}}{12 \text{ in}} `], so the unit *in* will cancel: @@ -99,7 +99,7 @@ Next, to convert [` [$in2] `] inches to feet, we will use [` \frac{1 \text{ ft}} \end{aligned} ``] -*Solution:* [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] + So, [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican40.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican40.pg index 499a3b65e3..bd1ae3be2a 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican40.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American','fraction') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,13 +70,9 @@ BEGIN_PGML It's given that [` 1 \text{ foot} = 12 \text{ inches} `]. Do the following unit conversions. Use mixed numbers (like 1 1/2) in your answer when needed. ----- - - [`` [$ft1Display] \text{ feet} = ``] [__________]{$in1} [`` \text{ inches} ``] - ----- +a. [`` [$ft1Display] \text{ feet} = ``] [__________]{$in1} [`` \text{ inches} ``] - [`` [$in2] \text{ inches} = ``] [__________]{$ft2Display} [`` \text{ feet} ``] +b. [`` [$in2] \text{ inches} = ``] [__________]{$ft2Display} [`` \text{ feet} ``] END_PGML @@ -99,7 +99,7 @@ To convert [` [$ft1] `] feet to inches, we will use [` \frac{12 \text{ in}}{1 \t \end{aligned} ``] -*Solution:* [`` [$ft1Display] \text{ ft} = [$in1] \text{ in} ``] + So, [`` [$ft1Display] \text{ ft} = [$in1] \text{ in} ``] Next, to convert [` [$in2] `] inches to feet, we will use [` \frac{1 \text{ ft}}{12 \text{ in}} `], so the unit *in* will cancel: @@ -115,17 +115,17 @@ Next, to convert [` [$in2] `] inches to feet, we will use [` \frac{1 \text{ ft}} \end{aligned} ``] -*Solution:* [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] + So, [`` [$in2] \text{ in} = [$ft2] \text{ ft} ``] ####Shortcut It's given that [` 1 \text{ feet} = 12 \text{ inches} `]. To convert between these two units, we either multiply or divide by [`12`]. -For Question 1, to convert [` [$ft1] `] feet to inches, the number will become bigger. So we do: +For Part a, to convert [` [$ft1] `] feet to inches, the number will become bigger. So we do: [`` [$ft1] \text{ ft} = [$ft1] \cdot 12 \text{ in} = \frac{[$int1*$den1+$num1]}{[$den1]} \cdot \frac{12}{1} \text{ in} = \frac{[$int1*$den1+$num1]}{1} \cdot \frac{[$s1]}{1} \text{ in} = [$in1] \text{ in} ``] -For Question 2, to convert [` [$in2] `] inches to feet, the number will become smaller. So we do: +For Part b, to convert [` [$in2] `] inches to feet, the number will become smaller. So we do: [`` [$in2] \text{ in} = \frac{[$in2]}{12} \text{ ft} = \frac{[$den2*$int2+$num2]}{[$den2]} \text{ ft} = [$ft2] \text{ ft} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican50.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican50.pg index 35379edcbb..99bd360fed 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican50.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +52,9 @@ BEGIN_PGML It's given that [` 1 \text{ yard} = 3 \text{ feet} `]. Do the following unit conversions. ----- - - [`` [$yd1] \text{ yards} = ``] [__________]{$ft1} [`` \text{ feet} ``] - ----- +a. [`` [$yd1] \text{ yards} = ``] [__________]{$ft1} [`` \text{ feet} ``] - [`` [$ft2] \text{ feet} = ``] [__________]{$yd2} [`` \text{ yards} ``] +b. [`` [$ft2] \text{ feet} = ``] [__________]{$yd2} [`` \text{ yards} ``] END_PGML @@ -79,7 +78,7 @@ To convert [` [$yd1] `] yards to feet, we will use [` \frac{3 \text{ ft}}{1 \tex \end{aligned} ``] -*Solution:* [`` [$yd1] \text{ yd} = [$ft1] \text{ ft} ``] + So, [`` [$yd1] \text{ yd} = [$ft1] \text{ ft} ``] Next, to convert [` [$yd2] `] feet to yards, we will use [` \frac{1 \text{ yd}}{3 \text{ ft}} `], so the unit *in* will cancel: @@ -94,7 +93,7 @@ Next, to convert [` [$yd2] `] feet to yards, we will use [` \frac{1 \text{ yd}}{ \end{aligned} ``] -*Solution:* [`` [$ft2] \text{ ft} = [$yd2] \text{ yd} ``] + So, [`` [$ft2] \text{ ft} = [$yd2] \text{ yd} ``] ####Proportion Method @@ -112,7 +111,7 @@ Assume [`[$yd1] \text{ yd} = x \text{ ft} `]. We have: \end{aligned} ``] -*Solution:* [`` [$yd1] \text{ yd} = [$ft1] \text{ ft} ``] + So, [`` [$yd1] \text{ yd} = [$ft1] \text{ ft} ``] Next, assume [`x \text{ yd} = [$ft2] \text{ ft} `]. We have: @@ -128,7 +127,7 @@ Next, assume [`x \text{ yd} = [$ft2] \text{ ft} `]. We have: \end{aligned} ``] -*Solution:* [`` [$ft2] \text{ ft} = [$yd2] \text{ yd} ``] + So, [`` [$ft2] \text{ ft} = [$yd2] \text{ yd} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican60.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican60.pg index b279985a66..d5ee4eed35 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican60.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -48,13 +52,9 @@ BEGIN_PGML It's given that [` 1 \text{ yard} = 3 \text{ feet} `]. Do the following unit conversions. ----- - - [`` [$yd1] \text{ yards} = ``] [__________]{$ft1} [`` \text{ feet} ``] - ----- +a. [`` [$yd1] \text{ yards} = ``] [__________]{$ft1} [`` \text{ feet} ``] - [`` [$ft2] \text{ feet} = ``] [__________]{$yd2} [`` \text{ yards} ``] +a. [`` [$ft2] \text{ feet} = ``] [__________]{$yd2} [`` \text{ yards} ``] END_PGML @@ -78,7 +78,7 @@ To convert [` [$yd1] `] yards to feet, we will use [` \frac{3 \text{ ft}}{1 \tex \end{aligned} ``] -*Solution:* [`` [$yd1] \text{ yd} = [$ft1] \text{ ft} ``] + So, [`` [$yd1] \text{ yd} = [$ft1] \text{ ft} ``] Next, to convert [` [$yd2] `] feet to yards, we will use [` \frac{1 \text{ yd}}{3 \text{ ft}} `], so the unit *in* will cancel: @@ -93,7 +93,7 @@ Next, to convert [` [$yd2] `] feet to yards, we will use [` \frac{1 \text{ yd}}{ \end{aligned} ``] -*Solution:* [`` [$ft2] \text{ ft} = [$yd2] \text{ yd} ``] + So, [`` [$ft2] \text{ ft} = [$yd2] \text{ yd} ``] ####Proportion Method @@ -111,7 +111,7 @@ Assume [`[$yd1] \text{ yd} = x \text{ ft} `]. We have: \end{aligned} ``] -*Solution:* [`` [$yd1] \text{ yd} = [$ft1] \text{ ft} ``] + So, [`` [$yd1] \text{ yd} = [$ft1] \text{ ft} ``] Next, assume [`x \text{ yd} = [$ft2] \text{ ft} `]. We have: @@ -127,17 +127,17 @@ Next, assume [`x \text{ yd} = [$ft2] \text{ ft} `]. We have: \end{aligned} ``] -*Solution:* [`` [$ft2] \text{ ft} = [$yd2] \text{ yd} ``] + So, `` [$ft2] \text{ ft} = [$yd2] \text{ yd} ``] ####Shortcut It's given that [` 1 \text{ yards} = 3 \text{ feet} `]. To convert between these two units, we either multiply or divide by [`3`]. -For Question 1, to convert [` [$yd1] `] yards to feet, the number will become bigger. So we do: +For Part a, to convert [` [$yd1] `] yards to feet, the number will become bigger. So we do: [`` [$yd1] \text{ yd} = [$yd1] \cdot 3 \text{ ft} = [$ft1] \text{ ft} ``] -For Question 2, to convert [` [$ft2] `] feet to yards, the number will become smaller. So we do: +For Part b, to convert [` [$ft2] `] feet to yards, the number will become smaller. So we do: [`` [$ft2] \text{ ft} = [$ft2] \div 3 \text{ yd} = [$yd2] \text{ yd} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican70.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican70.pg index baff5fb5da..6f2ddc7cba 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican70.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American','fraction') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,13 +70,9 @@ BEGIN_PGML It's given that [` 1 \text{ yard} = 3 \text{ feet} `]. Do the following unit conversions. Use mixed numbers (like 1 1/2) in your answer when needed. ----- - - [`` [$yd1Display] \text{ yards} = ``] [__________]{$ft1} [`` \text{ feet} ``] - ----- +a. [`` [$yd1Display] \text{ yards} = ``] [__________]{$ft1} [`` \text{ feet} ``] - [`` [$ft2] \text{ feet} = ``] [__________]{$yd2Display} [`` \text{ yards} ``] +b. [`` [$ft2] \text{ feet} = ``] [__________]{$yd2Display} [`` \text{ yards} ``] END_PGML @@ -99,7 +99,7 @@ To convert [` [$yd1] `] yards to feet, we will use [` \frac{3 \text{ ft}}{1 \tex \end{aligned} ``] -*Solution:* [`` [$yd1Display] \text{ yd} = [$ft1] \text{ ft} ``] + So, [`` [$yd1Display] \text{ yd} = [$ft1] \text{ ft} ``] Next, to convert [` [$ft2] `] feet to yards, we will use [` \frac{1 \text{ yd}}{3 \text{ ft}} `], so the unit *in* will cancel: @@ -114,17 +114,17 @@ Next, to convert [` [$ft2] `] feet to yards, we will use [` \frac{1 \text{ yd}}{ \end{aligned} ``] -*Solution:* [`` [$ft2] \text{ ft} = [$yd2] \text{ yd} ``] + So, [`` [$ft2] \text{ ft} = [$yd2] \text{ yd} ``] ####Shortcut It's given that [` 1 \text{ yards} = 3 \text{ feet} `]. To convert between these two units, we either multiply or divide by [`3`]. -For Question 1, to convert [` [$yd1] `] yards to feet, the number will become bigger. So we do: +For Part a, to convert [` [$yd1] `] yards to feet, the number will become bigger. So we do: [`` [$yd1] \text{ yd} = [$yd1] \cdot 3 \text{ ft} = \frac{[$int1*$den1+$num1]}{[$den1]} \cdot \frac{3}{1} \text{ ft} = \frac{[$int1*$den1+$num1]}{1} \cdot \frac{[$s1]}{1} \text{ ft} = [$ft1] \text{ ft} ``] -For Question 2, to convert [` [$ft2] `] feet to yards, the number will become smaller. So we do: +For Part b, to convert [` [$ft2] `] feet to yards, the number will become smaller. So we do: [`` [$ft2] \text{ ft} = \frac{[$ft2]}{3} \text{ yd} = [$yd2] \text{ yd} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican80.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican80.pg index 7313d0375a..a49145e2ad 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican80.pg @@ -7,18 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') - - +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -47,8 +49,6 @@ BEGIN_PGML It's given that [` 1 \text{ yard} = 3 \text{ feet} `] and [` 1 \text{ foot} = 12 \text{ inches} `]. Do the following unit conversion. ----- - [`` [$yd] \text{ yards} = ``] [__________]{$in} [`` \text{ inches} ``] END_PGML @@ -76,7 +76,7 @@ Next, we change the given number [` [$yd] \text{ yards} `] into a fraction, [` \ \end{aligned} ``] -*Solution:* [`` [$yd] \text{ yd} = [$in] \text{ in} ``] + So, [`` [$yd] \text{ yd} = [$in] \text{ in} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican90.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican90.pg index 009fa84590..b665eb6910 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmerican90.pg @@ -7,17 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','American') - +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +49,6 @@ BEGIN_PGML It's given that [` 1 \text{ yard} = 3 \text{ feet} `] and [` 1 \text{ foot} = 12 \text{ inches} `]. Do the following unit conversion. ----- - [`` [$yd] \text{ yards} = ``] [__________]{$in} [`` \text{ inches} ``] END_PGML @@ -75,7 +76,7 @@ Next, we change the given number [` [$yd] \text{ yards} `] into a fraction, [` \ \end{aligned} ``] -*Solution:* [`` [$yd] \text{ yd} = [$in] \text{ in} ``] + So, [`` [$yd] \text{ yd} = [$in] \text{ in} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication10.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication10.pg index 6abfa02e64..5dd7de7001 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication10.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','American','application','fraction','mixed number') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -53,13 +58,9 @@ BEGIN_PGML A team of geologists are observing a sink hole in a remote area. When they arrived at the scene, the hole was [`[$ft]`] feet deep. Three days later, the hole sank [`[$in]`] inches further. How deep was the sink hole three days later? Answer this question first in inches, and then in feet. ----- - -*Question 1:* The sink hole was [__________]{$ansIn} [`` \text{ inches} ``] deep three days later. +a. The sink hole was [__________]{$ansIn} [`` \text{ inches} ``] deep three days later. ----- - -*Question 2:* The sink hole was [__________]{$ansFt} [`` \text{ feet} ``] deep three days later. Use fractions in your answer. Don't use decimal. +b. The sink hole was [__________]{$ansFt} [`` \text{ feet} ``] deep three days later. Use fractions in your answer. Don't use decimal. END_PGML @@ -70,9 +71,7 @@ BEGIN_PGML_SOLUTION We will use the formula [` 1 \text{ foot} = 12 \text{ inches} `]. -####Question 1: - -We need to change [`[$ft]`] feet into inches: +*Part a:* We need to change [`[$ft]`] feet into inches: [`` [$ft] \text{ ft} = [$ft] \cdot 12 \text{ in} = [$ft*12] \text{ in} ``] @@ -80,11 +79,9 @@ Next, we add up the distances: [`` [$ft*12] \text{ in} + [$in] \text{ in} = [$ansIn] \text{ in} ``] -*Solution:* The sink hole was [`[$ansIn]`] [`` \text{ inches} ``] deep three days later. - -####Question 2: +The sink hole was [`[$ansIn]`] [`` \text{ inches} ``] deep three days later. -We need to change [`[$in]`] inches into feet: +*Part b:* We need to change [`[$in]`] inches into feet: [`` [$in] \text{ in} = \frac{[$in]}{12} \text{ ft} = [$frac] \text{ ft} ``] @@ -92,7 +89,7 @@ Next, we add up the distances: [`` [$frac] \text{ ft} + [$ft] \text{ ft} = [$ansFt] \text{ ft} ``] -*Solution:* The sink hole was [`[$ansFt]`] [`` \text{ feet} ``] deep three days later. +The sink hole was [`[$ansFt]`] [`` \text{ feet} ``] deep three days later. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication20.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication20.pg index 7d4cbb2c06..96610df5aa 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication20.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','American','application','fraction','mixed number') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -59,13 +64,10 @@ $factor = 12/$den; BEGIN_PGML A carpenter cut [`[$in]`] inches off a piece of wood measuring [`[$ft]`] feet long. How long was left after the cut? Answer this question first in inches, and then in feet. ----- - -*Question 1:* After the cut, [__________]{$ansIn} [`` \text{ inches} ``] of wood were left. ----- +a. After the cut, [__________]{$ansIn} [`` \text{ inches} ``] of wood were left. -*Question 2:* After the cut, [__________]{$ansFt} [`` \text{ feet} ``] of wood were left. Use fractions in your answer. Don't use decimal. +b. After the cut, [__________]{$ansFt} [`` \text{ feet} ``] of wood were left. Use fractions in your answer. Don't use decimal. END_PGML @@ -76,9 +78,7 @@ BEGIN_PGML_SOLUTION We will use the formula [` 1 \text{ foot} = 12 \text{ inches} `]. -####Question 1: - -We need to change the length of [`[$ft]`] feet into inches: +*Part a:* We need to change the length of [`[$ft]`] feet into inches: [`` [$ft] \text{ ft} = [$ft] \cdot 12 \text{ in} = [$ft*12] \text{ in} ``] @@ -86,11 +86,9 @@ Since [`[$in]`] inches will be cut off the wood, we use subtraction to find the [`` [$ft*12] \text{ in} - [$in] \text{ in} = [$ansIn] \text{ in} ``] -*Solution:* After the cut, [`[$ansIn]`] [`` \text{ inches} ``] of wood were left. - -####Question 2: +After the cut, [`[$ansIn]`] [`` \text{ inches} ``] of wood were left. -It's given [`[$in]`] inches of wood will be cut off. We need to change [`[$in]`] inches into feet: +*Part b:* It's given [`[$in]`] inches of wood will be cut off. We need to change [`[$in]`] inches into feet: [`` [$in] \text{ in} = \frac{[$in]}{12} \text{ ft} = \frac{[$in/$factor]}{[$den]} \text{ ft} = [$frac] \text{ ft} ``] @@ -105,7 +103,7 @@ Next, we use subtraction to find the leftover: \end{aligned} ``] -*Solution:* After the cut, [`[$ansFt]`] [`` \text{ feet} ``] of wood were left. +After the cut, [`[$ansFt]`] [`` \text{ feet} ``] of wood were left. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication30.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication30.pg index ddd1191436..f4f76fdb5d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','American','application','fraction','mixed number') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +31,9 @@ loadMacros( "MathObjects.pl", "PGML.pl", "contextFraction.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -63,13 +68,9 @@ BEGIN_PGML A car moved forward [`[$ydForward]`] yards, stopped, and then backed off [`[$ftBackward]`] feet. How far was the car from the starting point? Answer the question in both yards and feet. ----- - -*Question 1:* The car was [_________]{$ansFt} feet from the starting point. +a. The car was [_________]{$ansFt} feet from the starting point. ----- - -*Question 2:* The car was [_________]{$ansYd} yards from the starting point. Use fractions in your answer. Don't use decimal. +b. The car was [_________]{$ansYd} yards from the starting point. Use fractions in your answer. Don't use decimal. END_PGML @@ -80,9 +81,7 @@ BEGIN_PGML_SOLUTION We will use the formula [` 1 \text{ yard} = 3 \text{ feet} `]. -####Question 1: - -We need to change the length of [`[$ydForward]`] yards into feet: +*Part a:* We need to change the length of [`[$ydForward]`] yards into feet: [`` [$ydForward] \text{ yd} = [$ydForward] \cdot 3 \text{ ft} = [$ftForward] \text{ ft} ``] @@ -90,11 +89,9 @@ Since the car moved backward [`[$ftBackward]`] feet, we use subtraction to find [`` [$ftForward] \text{ ft} - [$ftBackward] \text{ ft} = [$ansFt] \text{ ft} ``] -*Solution:* The car was [`[$ansFt]`] feet from the starting point. - -####Question 2: +The car was [`[$ansFt]`] feet from the starting point. -We need to change [`[$ftBackward]`] feet into yards: +*Part b:* We need to change [`[$ftBackward]`] feet into yards: [`` [$ftBackward] \text{ ft} = \frac{[$ftBackward]}{3} \text{ yd} = [$ydBackward] \text{ yd} ``] @@ -109,7 +106,7 @@ Next, we use subtraction to find the leftover: \end{aligned} ``] -*Solution:* The car was [`[$ansYd]`] yards from the starting point. +The car was [`[$ansYd]`] yards from the starting point. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication40.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication40.pg index 50945d1001..ec19401f0c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication40.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','American','application') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,8 +29,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "contextFraction.pl", +# "parserNumberWithUnits.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -51,7 +56,7 @@ BEGIN_PGML A [`[$totalYd]`]-yard string will be cut into [@numberWord($eachIn)@]-inch strings. How many [@numberWord($eachIn)@]-inch strings can be made? -*Solution:* [_________]{$numShort} [@numberWord($eachIn)@]-inch strings can be made. +[_________]{$numShort} [@numberWord($eachIn)@]-inch strings can be made. END_PGML @@ -84,7 +89,7 @@ Now we can do division: [`` [$totalIn] \text{ in} \div [$eachIn] \text{ in} = [$numShort] \text{ strings} ``] -*Solution:* [`[$numShort]`] [@numberWord($eachIn)@]-inch strings can be made. +[`[$numShort]`] [@numberWord($eachIn)@]-inch strings can be made. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication50.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication50.pg index c2d9d4beeb..e7adcbba9b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication50.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','American','application') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "contextFraction.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -52,7 +58,7 @@ It's given that [` 1 \text{ pound (lb)} = 16 \text{ ounces (oz)} `]. A baker owns a small business. He produces bread in bags. Each bag needs [`[$eachOz]`] oz of dough. The baker purchased [`[$totalLb]`] lb of dough. How many bags of bread can be produced? -*Solution:* The baker can produce [__________]{$num} bags of bread with [`[$totalLb]`] lb of dough. +The baker can produce [__________]{$num} bags of bread with [`[$totalLb]`] lb of dough. END_PGML @@ -75,7 +81,7 @@ Now we can do division: [`` [$totalOz] \text{ oz} \div [$eachOz] \text{ oz} = [$num] ``] -*Solution:* The baker can produce [`[$num]`] bags of bread with [`[$totalLb]`] lb of dough. +The baker can produce [`[$num]`] bags of bread with [`[$totalLb]`] lb of dough. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication60.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication60.pg index 94777dfdff..fa3516acc7 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionAmericanApplication60.pg @@ -7,29 +7,30 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.MD.1') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Area) -## Institution(PCC) -## Author(Carl Yao) -## MLT(area_of_rectangle) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','rectangle','conversion') - +## DBCCSS('4.MD.3','5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -37,16 +38,18 @@ loadMacros( $refreshCachedImages = 1; Context("Numeric"); -$xmin = 0; #The viewing window -$xmax = 20; -$ymin = 0; -$ymax = 20; - $base = random(6,9,1); $height = random(2,5,1); $baseFt = $base*3; $heightFt = $height*3; +$xmin = 0; #The viewing window +$xmax = $base*1.2; +$ymin = 0; +$ymax = $xmax; + +$shift = $xmax/25; + @x = (($xmax-$base)/2,($xmax+$base)/2); @y = (($ymax-$height)/2,($ymax+$height)/2); @@ -56,7 +59,7 @@ $picture = init_graph($xmin,$ymin,$xmax,$ymax, pixels=>[400,400]); $picture->lb( new Label(($x[0]+$x[1])/2, $y[0]-0.5,"$base yd",'black','center','middle')); -$picture->lb( new Label($x[1]+1,($y[0]+$y[1])/2,"$height yd",'black','center','middle')); +$picture->lb( new Label($x[1]-$shift,($y[0]+$y[1])/2,"$height yd",'black','center','middle')); $picture->new_color("lightblue", 200,200,255); # RGB $picture->new_color("darkblue", 100,100,255); @@ -84,7 +87,7 @@ $areaFt = $areaYd*9; $ansP = NumberWithUnits("$perimeterFt ft"); $ansA = NumberWithUnits("$areaFt ft^2"); - +$alt = "a rectangle with a base of $base yards and a height of $height yards"; ############################################## @@ -94,17 +97,8 @@ BEGIN_PGML Find the perimeter and area of the rectangle *in feet and square feet*. (Use *ft* for feet and *ft[$CARET]2* for square feet.) -END_PGML -BEGIN_TEXT -$PAR +>>[@ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => "alt =$alt '' title = '$alt' ") @]*<< -$BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "a rectangle with a base of $base yards and a height of $height yards" title = "a rectangle with a base of $base yards and a height of $height yards"') \} -$ECENTER -$PAR - -END_TEXT -BEGIN_PGML Its perimeter is [_____________]{$ansP} and its area is [_____________]{$ansA}. @@ -127,8 +121,7 @@ Review the following formulas for rectangles: [` \text{rectangle area} = \text{base} \cdot \text{height} `] ----- -For the given rectangle, we have: +*Part a:* For the given rectangle, we have: [``\begin{aligned} \text{rectangle perimeter} @@ -138,8 +131,9 @@ For the given rectangle, we have: \end{aligned}``] Don't forget the length unit [`\textrm{ft}`]. ----- -Also, + +*Part b:* + [``\begin{aligned} \text{rectangle area} & = \text{base} \cdot \text{height}\\ @@ -149,8 +143,6 @@ Also, Don't forget the area unit [`\textrm{ft}^{2}`]. ----- - When you calculate perimeter, it's OK to find the perimeter in yards first, and then convert: [`` diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric10.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric10.pg index f9bb216e7a..862bafac18 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric10.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -55,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ kilometer} = 1000 \text{ meters} `]. Do the following unit conversions. ----- - - [`` [$km1] \text{ kilometers} = ``] [__________]{$m1} [`` \text{ meters} ``] - ----- +a. [`` [$km1] \text{ kilometers} = ``] [__________]{$m1} [`` \text{ meters} ``] - [`` [$m2] \text{ meters} = ``] [__________]{$km2} [`` \text{ kilometers} ``] +a. [`` [$m2] \text{ meters} = ``] [__________]{$km2} [`` \text{ kilometers} ``] END_PGML @@ -85,7 +84,7 @@ To convert [` [$km1] `] kilometers to meters, we will use [` \frac{1000 \text{ m \end{aligned} ``] -*Solution:* [`` [$km1] \text{ km} = [$m1] \text{ m} ``] + So, [`` [$km1] \text{ km} = [$m1] \text{ m} ``] Next, to convert [` [$m2] `] meters to kilometers, we will use [` \frac{1 \text{ km}}{1000 \text{ m}} `], so the unit *m* will cancel: @@ -100,7 +99,7 @@ Next, to convert [` [$m2] `] meters to kilometers, we will use [` \frac{1 \text{ \end{aligned} ``] -*Solution:* [`` [$m2] \text{ m} = [$km2] \text{ km} ``] + So, [`` [$m2] \text{ m} = [$km2] \text{ km} ``] ####Proportion Method @@ -118,7 +117,7 @@ Assume [`[$km1] \text{ km} = x \text{ m} `]. We have: \end{aligned} ``] -*Solution:* [`` [$km1] \text{ km} = [$m1] \text{ m} ``] + So, [`` [$km1] \text{ km} = [$m1] \text{ m} ``] Next, assume [`x \text{ km} = [$m2] \text{ m} `]. We have: @@ -134,7 +133,7 @@ Next, assume [`x \text{ km} = [$m2] \text{ m} `]. We have: \end{aligned} ``] -*Solution:* [`` [$m2] \text{ m} = [$km2] \text{ km} ``] + So, [`` [$m2] \text{ m} = [$km2] \text{ km} ``] ####Shortcut @@ -144,11 +143,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$km1] `] kilometers to meters, the number will become bigger. So we do: +For Part a, to convert [` [$km1] `] kilometers to meters, the number will become bigger. So we do: [`` [$km1] \text{ km} = [$km1] \cdot 1000 \text{ m} = [$m1] \text{ m} ``] -For Question 2, to convert [` [$m2] `] meters to kilometers, the number will become smaller. So we do: +For Part b, to convert [` [$m2] `] meters to kilometers, the number will become smaller. So we do: [`` [$m2] \text{ m} = [$m2] \div 1000 \text{ km} = [$km2] \text{ km} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric100.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric100.pg index e3f99f9c2d..61afc3c85c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric100.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric100.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ meter} = 100 \text{ centimeters} `]. Do the following unit conversions. ----- - - [`` [$m1] \text{ meters} = ``] [__________]{$cm1} [`` \text{ centimeters} ``] - ----- +a. [`` [$m1] \text{ meters} = ``] [__________]{$cm1} [`` \text{ centimeters} ``] - [`` [$cm2] \text{ centimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] +a. [`` [$cm2] \text{ centimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$m1] `] meters to centimeters, we will use [` \frac{100 \text{ cm \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$cm1] \text{ cm} ``] + So, [`` [$m1] \text{ m} = [$cm1] \text{ cm} ``] Next, to convert [` [$cm2] `] centimeters to meters, we will use [` \frac{1 \text{ m}}{100 \text{ cm}} `], so the unit *cm* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$cm2] `] centimeters to meters, we will use [` \frac{1 \tex \end{aligned} ``] -*Solution:* [`` [$cm2] \text{ cm} = [$m2] \text{ m} ``] + So, [`` [$cm2] \text{ cm} = [$m2] \text{ m} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$m1] \text{ m} = x \text{ cm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$cm1] \text{ cm} ``] + So, [`` [$m1] \text{ m} = [$cm1] \text{ cm} ``] Next, assume [`x \text{ m} = [$cm2] \text{ cm} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ m} = [$cm2] \text{ cm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$cm2] \text{ cm} = [$m2] \text{ m} ``] + So, [`` [$cm2] \text{ cm} = [$m2] \text{ m} ``] ####Shortcut @@ -138,11 +138,11 @@ Recall that multiplying [`100`] causes the decimal point to move right once, lik Dividing by [`100`] causes the decimal point to move left once, like in [` 3000 \div 100 = 30 `]. -For Question 1, to convert [` [$m1] `] meters to centimeters, the number will become bigger. So we do: +For Part a, to convert [` [$m1] `] meters to centimeters, the number will become bigger. So we do: [`` [$m1] \text{ m} = [$m1] \cdot 100 \text{ cm} = [$cm1] \text{ cm} ``] -For Question 2, to convert [` [$cm2] `] centimeters to meters, the number will become smaller. So we do: +For Part b, to convert [` [$cm2] `] centimeters to meters, the number will become smaller. So we do: [`` [$cm2] \text{ cm} = [$cm2] \div 100 \text{ m} = [$m2] \text{ m} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric110.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric110.pg index a9685b8c64..dbceea1629 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric110.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric110.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ meter} = 100 \text{ centimeters} `]. Do the following unit conversions. ----- - - [`` [$m1] \text{ meters} = ``] [__________]{$cm1} [`` \text{ centimeters} ``] - ----- +a. [`` [$m1] \text{ meters} = ``] [__________]{$cm1} [`` \text{ centimeters} ``] - [`` [$cm2] \text{ centimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] +a. [`` [$cm2] \text{ centimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$m1] `] meters to centimeters, we will use [` \frac{100 \text{ cm \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$cm1] \text{ cm} ``] + So, [`` [$m1] \text{ m} = [$cm1] \text{ cm} ``] Next, to convert [` [$cm2] `] centimeters to meters, we will use [` \frac{1 \text{ m}}{100 \text{ cm}} `], so the unit *cm* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$cm2] `] centimeters to meters, we will use [` \frac{1 \tex \end{aligned} ``] -*Solution:* [`` [$cm2] \text{ cm} = [$m2] \text{ m} ``] + So, [`` [$cm2] \text{ cm} = [$m2] \text{ m} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$m1] \text{ m} = x \text{ cm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$cm1] \text{ cm} ``] + So, [`` [$m1] \text{ m} = [$cm1] \text{ cm} ``] Next, assume [`x \text{ m} = [$cm2] \text{ cm} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ m} = [$cm2] \text{ cm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$cm2] \text{ cm} = [$m2] \text{ m} ``] + So, [`` [$cm2] \text{ cm} = [$m2] \text{ m} ``] ####Shortcut @@ -138,11 +138,11 @@ Recall that multiplying [`100`] causes the decimal point to move right once, lik Dividing by [`100`] causes the decimal point to move left once, like in [` 3000 \div 100 = 30 `]. -For Question 1, to convert [` [$m1] `] meters to centimeters, the number will become bigger. So we do: +For Part a, to convert [` [$m1] `] meters to centimeters, the number will become bigger. So we do: [`` [$m1] \text{ m} = [$m1] \cdot 100 \text{ cm} = [$cm1] \text{ cm} ``] -For Question 2, to convert [` [$cm2] `] centimeters to meters, the number will become smaller. So we do: +For Part b, to convert [` [$cm2] `] centimeters to meters, the number will become smaller. So we do: [`` [$cm2] \text{ cm} = [$cm2] \div 100 \text{ m} = [$m2] \text{ m} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric120.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric120.pg index 84540a82f6..ab81c4de49 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric120.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric120.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCmmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ decimeter} = 100 \text{ millimeters} `]. Do the following unit conversions. ----- - - [`` [$dm1] \text{ decimeters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - ----- +a. [`` [$dm1] \text{ decimeters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - [`` [$mm2] \text{ millimeters} = ``] [__________]{$dm2} [`` \text{ decimeters} ``] +a. [`` [$mm2] \text{ millimeters} = ``] [__________]{$dm2} [`` \text{ decimeters} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$dm1] `] decimeters to millimeters, we will use [` \frac{100 \tex \end{aligned} ``] -*Solution:* [`` [$dm1] \text{ dm} = [$mm1] \text{ mm} ``] + So, [`` [$dm1] \text{ dm} = [$mm1] \text{ mm} ``] Next, to convert [` [$mm2] `] millimeters to decimeters, we will use [` \frac{1 \text{ dm}}{100 \text{ mm}} `], so the unit *mm* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$mm2] `] millimeters to decimeters, we will use [` \frac{1 \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$dm2] \text{ dm} ``] + So, [`` [$mm2] \text{ mm} = [$dm2] \text{ dm} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$dm1] \text{ dm} = x \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$dm1] \text{ dm} = [$mm1] \text{ mm} ``] + So, [`` [$dm1] \text{ dm} = [$mm1] \text{ mm} ``] Next, assume [`x \text{ dm} = [$mm2] \text{ mm} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ dm} = [$mm2] \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$dm2] \text{ dm} ``] + So, [`` [$mm2] \text{ mm} = [$dm2] \text{ dm} ``] ####Shortcut @@ -138,11 +138,11 @@ Recall that multiplying [`100`] causes the decimal point to move right once, lik Dividing by [`100`] causes the decimal point to move left once, like in [` 3000 \div 100 = 30 `]. -For Question 1, to convert [` [$dm1] `] decimeters to millimeters, the number will become bigger. So we do: +For Part a, to convert [` [$dm1] `] decimeters to millimeters, the number will become bigger. So we do: [`` [$dm1] \text{ dm} = [$dm1] \cdot 100 \text{ mm} = [$mm1] \text{ mm} ``] -For Question 2, to convert [` [$mm2] `] millimeters to decimeters, the number will become smaller. So we do: +For Part b, to convert [` [$mm2] `] millimeters to decimeters, the number will become smaller. So we do: [`` [$mm2] \text{ mm} = [$mm2] \div 100 \text{ dm} = [$dm2] \text{ dm} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric130.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric130.pg index 40a56147b9..6ae0ccaf44 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric130.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric130.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCmmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ decimeter} = 100 \text{ millimeters} `]. Do the following unit conversions. ----- - - [`` [$dm1] \text{ decimeters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - ----- +a. [`` [$dm1] \text{ decimeters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - [`` [$mm2] \text{ millimeters} = ``] [__________]{$dm2} [`` \text{ decimeters} ``] +a. [`` [$mm2] \text{ millimeters} = ``] [__________]{$dm2} [`` \text{ decimeters} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$dm1] `] decimeters to millimeters, we will use [` \frac{100 \tex \end{aligned} ``] -*Solution:* [`` [$dm1] \text{ dm} = [$mm1] \text{ mm} ``] + So, [`` [$dm1] \text{ dm} = [$mm1] \text{ mm} ``] Next, to convert [` [$mm2] `] millimeters to decimeters, we will use [` \frac{1 \text{ dm}}{100 \text{ mm}} `], so the unit *mm* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$mm2] `] millimeters to decimeters, we will use [` \frac{1 \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$dm2] \text{ dm} ``] + So, [`` [$mm2] \text{ mm} = [$dm2] \text{ dm} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$dm1] \text{ dm} = x \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$dm1] \text{ dm} = [$mm1] \text{ mm} ``] + So, [`` [$dm1] \text{ dm} = [$mm1] \text{ mm} ``] Next, assume [`x \text{ dm} = [$mm2] \text{ mm} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ dm} = [$mm2] \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$dm2] \text{ dm} ``] + So, [`` [$mm2] \text{ mm} = [$dm2] \text{ dm} ``] ####Shortcut @@ -138,11 +138,11 @@ Recall that multiplying [`100`] causes the decimal point to move right once, lik Dividing by [`100`] causes the decimal point to move left once, like in [` 3000 \div 100 = 30 `]. -For Question 1, to convert [` [$dm1] `] decimeters to millimeters, the number will become bigger. So we do: +For Part a, to convert [` [$dm1] `] decimeters to millimeters, the number will become bigger. So we do: [`` [$dm1] \text{ dm} = [$dm1] \cdot 100 \text{ mm} = [$mm1] \text{ mm} ``] -For Question 2, to convert [` [$mm2] `] millimeters to decimeters, the number will become smaller. So we do: +For Part b, to convert [` [$mm2] `] millimeters to decimeters, the number will become smaller. So we do: [`` [$mm2] \text{ mm} = [$mm2] \div 100 \text{ dm} = [$dm2] \text{ dm} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric140.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric140.pg index b655383168..83cb60dafd 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric140.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric140.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ meter} = 1000 \text{ millimeters} `]. Do the following unit conversions. ----- - - [`` [$m1] \text{ meters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - ----- +a. [`` [$m1] \text{ meters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - [`` [$mm2] \text{ millimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] +a. [`` [$mm2] \text{ millimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] END_PGML @@ -84,7 +84,7 @@ To convert [` [$m1] `] meters to millimeters, we will use [` \frac{1000 \text{ m \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$mm1] \text{ mm} ``] + So, [`` [$m1] \text{ m} = [$mm1] \text{ mm} ``] Next, to convert [` [$mm2] `] millimeters to meters, we will use [` \frac{1 \text{ m}}{1000 \text{ mm}} `], so the unit *mm* will cancel: @@ -99,7 +99,7 @@ Next, to convert [` [$mm2] `] millimeters to meters, we will use [` \frac{1 \tex \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$m2] \text{ m} ``] + So, [`` [$mm2] \text{ mm} = [$m2] \text{ m} ``] ####Proportion Method @@ -117,7 +117,7 @@ Assume [`[$m1] \text{ m} = x \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$mm1] \text{ mm} ``] + So, [`` [$m1] \text{ m} = [$mm1] \text{ mm} ``] Next, assume [`x \text{ m} = [$mm2] \text{ mm} `]. We have: @@ -133,7 +133,7 @@ Next, assume [`x \text{ m} = [$mm2] \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$m2] \text{ m} ``] + So, [`` [$mm2] \text{ mm} = [$m2] \text{ m} ``] ####Shortcut @@ -143,11 +143,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$m1] `] meters to millimeters, the number will become bigger. So we do: +For Part a, to convert [` [$m1] `] meters to millimeters, the number will become bigger. So we do: [`` [$m1] \text{ m} = [$m1] \cdot 1000 \text{ mm} = [$mm1] \text{ mm} ``] -For Question 2, to convert [` [$mm2] `] millimeters to meters, the number will become smaller. So we do: +For Part b, to convert [` [$mm2] `] millimeters to meters, the number will become smaller. So we do: [`` [$mm2] \text{ mm} = [$mm2] \div 1000 \text{ m} = [$m2] \text{ m} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric150.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric150.pg index df3ad9c3cc..4c5de5e26e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric150.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric150.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ meter} = 1000 \text{ millimeters} `]. Do the following unit conversions. ----- - - [`` [$m1] \text{ meters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - ----- +a. [`` [$m1] \text{ meters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - [`` [$mm2] \text{ millimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] +a. [`` [$mm2] \text{ millimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] END_PGML @@ -84,7 +84,7 @@ To convert [` [$m1] `] meters to millimeters, we will use [` \frac{1000 \text{ m \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$mm1] \text{ mm} ``] + So, [`` [$m1] \text{ m} = [$mm1] \text{ mm} ``] Next, to convert [` [$mm2] `] millimeters to meters, we will use [` \frac{1 \text{ m}}{1000 \text{ mm}} `], so the unit *mm* will cancel: @@ -99,7 +99,7 @@ Next, to convert [` [$mm2] `] millimeters to meters, we will use [` \frac{1 \tex \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$m2] \text{ m} ``] + So, [`` [$mm2] \text{ mm} = [$m2] \text{ m} ``] ####Proportion Method @@ -117,7 +117,7 @@ Assume [`[$m1] \text{ m} = x \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$mm1] \text{ mm} ``] + So, [`` [$m1] \text{ m} = [$mm1] \text{ mm} ``] Next, assume [`x \text{ m} = [$mm2] \text{ mm} `]. We have: @@ -133,7 +133,7 @@ Next, assume [`x \text{ m} = [$mm2] \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$m2] \text{ m} ``] + So, [`` [$mm2] \text{ mm} = [$m2] \text{ m} ``] ####Shortcut @@ -143,11 +143,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$m1] `] meters to millimeters, the number will become bigger. So we do: +For Part a, to convert [` [$m1] `] meters to millimeters, the number will become bigger. So we do: [`` [$m1] \text{ m} = [$m1] \cdot 1000 \text{ mm} = [$mm1] \text{ mm} ``] -For Question 2, to convert [` [$mm2] `] millimeters to meters, the number will become smaller. So we do: +For Part b, to convert [` [$mm2] `] millimeters to meters, the number will become smaller. So we do: [`` [$mm2] \text{ mm} = [$mm2] \div 1000 \text{ m} = [$m2] \text{ m} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric160.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric160.pg index 7bff687bb4..f9c73ba45d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric160.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric160.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ kilometer} = 1000 \text{ meters} `] and [` 1 \text{ meter} = 100 \text{ centimeters} `]. Do the following unit conversion. ----- - [`` [$km] \text{ kilometers} = ``] [__________]{$cm} [`` \text{ centimeters} ``] END_PGML @@ -75,7 +77,7 @@ Next, we change the given number [` [$km] \text{ kilometers} `] into a fraction, \end{aligned} ``] -*Solution:* [`` [$km] \text{ km} = [$cm] \text{ cm} ``] + So, [`` [$km] \text{ km} = [$cm] \text{ cm} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric170.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric170.pg index 30e6ef54e2..2e05bbc5a8 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric170.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric170.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') -## MLT(metric_to_metric_conversion_length) +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ kilometer} = 1000 \text{ meters} `] and [` 1 \text{ meter} = 100 \text{ centimeters} `]. Do the following unit conversion. ----- - [`` [$km] \text{ kilometers} = ``] [__________]{$cm} [`` \text{ centimeters} ``] END_PGML @@ -75,7 +77,7 @@ Next, we change the given number [` [$km] \text{ kilometers} `] into a fraction, \end{aligned} ``] -*Solution:* [`` [$km] \text{ km} = [$cm] \text{ cm} ``] + So, [`` [$km] \text{ km} = [$cm] \text{ cm} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric180.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric180.pg index 724e2b3343..d9d089db8e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric180.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric180.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ kilometer} = 1000 \text{ meters} `] and [` 1 \text{ meter} = 100 \text{ centimeters} `]. Do the following unit conversion. ----- - [`` [$cm] \text{ centimeters} = ``] [__________]{$km} [`` \text{ kilometers} ``] END_PGML @@ -75,7 +77,7 @@ Next, we change the given number [` [$cm] \text{ centimeters} `] into a fraction \end{aligned} ``] -*Solution:* [`` [$cm] \text{ cm} = [$km] \text{ km} ``] + So, [`` [$cm] \text{ cm} = [$km] \text{ km} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric190.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric190.pg index fc843f3ef1..2cfcd86fcf 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric190.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric190.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ kilometer} = 1000 \text{ meters} `] and [` 1 \text{ meter} = 100 \text{ centimeters} `]. Do the following unit conversion. ----- - [`` [$cm] \text{ centimeters} = ``] [__________]{$km} [`` \text{ kilometers} ``] END_PGML @@ -75,7 +77,7 @@ Next, we change the given number [` [$cm] \text{ centimeters} `] into a fraction \end{aligned} ``] -*Solution:* [`` [$cm] \text{ cm} = [$km] \text{ km} ``] + So, [`` [$cm] \text{ cm} = [$km] \text{ km} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric20.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric20.pg index e6b1d331a3..edf58d9b47 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ kilometer} = 1000 \text{ meters} `]. Do the following unit conversions. ----- - - [`` [$km1] \text{ kilometers} = ``] [__________]{$m1} [`` \text{ meters} ``] - ----- +a. [`` [$km1] \text{ kilometers} = ``] [__________]{$m1} [`` \text{ meters} ``] - [`` [$m2] \text{ meters} = ``] [__________]{$km2} [`` \text{ kilometers} ``] +a. [`` [$m2] \text{ meters} = ``] [__________]{$km2} [`` \text{ kilometers} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$km1] `] kilometers to meters, we will use [` \frac{1000 \text{ m \end{aligned} ``] -*Solution:* [`` [$km1] \text{ km} = [$m1] \text{ m} ``] + So, [`` [$km1] \text{ km} = [$m1] \text{ m} ``] Next, to convert [` [$m2] `] meters to kilometers, we will use [` \frac{1 \text{ km}}{1000 \text{ m}} `], so the unit *m* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$m2] `] meters to kilometers, we will use [` \frac{1 \text{ \end{aligned} ``] -*Solution:* [`` [$m2] \text{ m} = [$km2] \text{ km} ``] + So, [`` [$m2] \text{ m} = [$km2] \text{ km} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$km1] \text{ km} = x \text{ m} `]. We have: \end{aligned} ``] -*Solution:* [`` [$km1] \text{ km} = [$m1] \text{ m} ``] + So, [`` [$km1] \text{ km} = [$m1] \text{ m} ``] Next, assume [`x \text{ km} = [$m2] \text{ m} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ km} = [$m2] \text{ m} `]. We have: \end{aligned} ``] -*Solution:* [`` [$m2] \text{ m} = [$km2] \text{ km} ``] + So, [`` [$m2] \text{ m} = [$km2] \text{ km} ``] ####Shortcut @@ -138,11 +138,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$km1] `] kilometers to meters, the number will become bigger. So we do: +For Part a, to convert [` [$km1] `] kilometers to meters, the number will become bigger. So we do: [`` [$km1] \text{ km} = [$km1] \cdot 1000 \text{ m} = [$m1] \text{ m} ``] -For Question 2, to convert [` [$m2] `] meters to kilometers, the number will become smaller. So we do: +For Part b, to convert [` [$m2] `] meters to kilometers, the number will become smaller. So we do: [`` [$m2] \text{ m} = [$m2] \div 1000 \text{ km} = [$km2] \text{ km} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric200.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric200.pg index 67260d19f6..598925903f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric200.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric200.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ kilometer} = 1000 \text{ meters} `] and [` 1 \text{ meter} = 1000 \text{ millimeters} `]. Do the following unit conversion. ----- - [`` [$km] \text{ kilometers} = ``] [__________]{$mm} [`` \text{ millimeters} ``] END_PGML @@ -75,7 +77,7 @@ Next, we change the given number [` [$km] \text{ kilometers} `] into a fraction, \end{aligned} ``] -*Solution:* [`` [$km] \text{ km} = [$mm] \text{ mm} ``] + So, [`` [$km] \text{ km} = [$mm] \text{ mm} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric210.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric210.pg index e21407cefb..9ace884e3c 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric210.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric210.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ kilometer} = 1000 \text{ meters} `] and [` 1 \text{ meter} = 1000 \text{ millimeters} `]. Do the following unit conversion. ----- - [`` [$km] \text{ kilometers} = ``] [__________]{$mm} [`` \text{ millimeters} ``] END_PGML @@ -75,7 +77,7 @@ Next, we change the given number [` [$km] \text{ kilometers} `] into a fraction, \end{aligned} ``] -*Solution:* [`` [$km] \text{ km} = [$mm] \text{ mm} ``] + So, [`` [$km] \text{ km} = [$mm] \text{ mm} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric220.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric220.pg index 2d33b5a707..7055e3aac6 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric220.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric220.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ kilometer} = 1000 \text{ meters} `] and [` 1 \text{ meter} = 1000 \text{ millimeters} `]. Do the following unit conversion. ----- - [`` [$mm] \text{ millimeters} = ``] [__________]{$km} [`` \text{ kilometers} ``] END_PGML @@ -75,7 +77,7 @@ Next, we change the given number [` [$mm] \text{ millimeters} `] into a fraction \end{aligned} ``] -*Solution:* [`` [$mm] \text{ mm} = [$km] \text{ km} ``] + So, [`` [$mm] \text{ mm} = [$km] \text{ km} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric230.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric230.pg index 5b58bef4df..eb4a4fd37d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric230.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric230.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -46,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ kilometer} = 1000 \text{ meters} `] and [` 1 \text{ meter} = 1000 \text{ millimeters} `]. Do the following unit conversion. ----- - [`` [$mm] \text{ millimeters} = ``] [__________]{$km} [`` \text{ kilometers} ``] END_PGML @@ -75,7 +77,7 @@ Next, we change the given number [` [$mm] \text{ millimeters} `] into a fraction \end{aligned} ``] -*Solution:* [`` [$mm] \text{ mm} = [$km] \text{ km} ``] + So, [`` [$mm] \text{ mm} = [$km] \text{ km} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric240.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric240.pg index f39f883e1b..c47f5f3e52 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric240.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric240.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_mass) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -55,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ kilogram} = 1000 \text{ grams} `]. Do the following unit conversions. ----- - - [`` [$kg1] \text{ kilograms} = ``] [__________]{$g1} [`` \text{ grams} ``] - ----- +a. [`` [$kg1] \text{ kilograms} = ``] [__________]{$g1} [`` \text{ grams} ``] - [`` [$g2] \text{ grams} = ``] [__________]{$kg2} [`` \text{ kilograms} ``] +a. [`` [$g2] \text{ grams} = ``] [__________]{$kg2} [`` \text{ kilograms} ``] END_PGML @@ -85,7 +84,7 @@ To convert [` [$kg1] `] kilograms to grams, we will use [` \frac{1000 \text{ g}} \end{aligned} ``] -*Solution:* [`` [$kg1] \text{ kg} = [$g1] \text{ g} ``] + So, [`` [$kg1] \text{ kg} = [$g1] \text{ g} ``] Next, to convert [` [$g2] `] grams to kilograms, we will use [` \frac{1 \text{ kg}}{1000 \text{ g}} `], so the unit *g* will cancel: @@ -100,7 +99,7 @@ Next, to convert [` [$g2] `] grams to kilograms, we will use [` \frac{1 \text{ k \end{aligned} ``] -*Solution:* [`` [$g2] \text{ g} = [$kg2] \text{ kg} ``] + So, [`` [$g2] \text{ g} = [$kg2] \text{ kg} ``] ####Proportion Method @@ -118,7 +117,7 @@ Assume [`[$kg1] \text{ kg} = x \text{ g} `]. We have: \end{aligned} ``] -*Solution:* [`` [$kg1] \text{ kg} = [$g1] \text{ g} ``] + So, [`` [$kg1] \text{ kg} = [$g1] \text{ g} ``] Next, assume [`x \text{ kg} = [$g2] \text{ g} `]. We have: @@ -134,7 +133,7 @@ Next, assume [`x \text{ kg} = [$g2] \text{ g} `]. We have: \end{aligned} ``] -*Solution:* [`` [$g2] \text{ g} = [$kg2] \text{ kg} ``] + So, [`` [$g2] \text{ g} = [$kg2] \text{ kg} ``] ####Shortcut @@ -144,11 +143,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$kg1] `] kilograms to grams, the number will become bigger. So we do: +For Part a, to convert [` [$kg1] `] kilograms to grams, the number will become bigger. So we do: [`` [$kg1] \text{ kg} = [$kg1] \cdot 1000 \text{ g} = [$g1] \text{ g} ``] -For Question 2, to convert [` [$g2] `] grams to kilograms, the number will become smaller. So we do: +For Part b, to convert [` [$g2] `] grams to kilograms, the number will become smaller. So we do: [`` [$g2] \text{ g} = [$g2] \div 1000 \text{ kg} = [$kg2] \text{ kg} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric250.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric250.pg index e3b8663fec..0eec620460 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric250.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric250.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_mass) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -27,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -53,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ kilogram} = 1000 \text{ grams} `]. Do the following unit conversions. ----- - - [`` [$kg1] \text{ kilograms} = ``] [__________]{$g1} [`` \text{ grams} ``] - ----- +a. [`` [$kg1] \text{ kilograms} = ``] [__________]{$g1} [`` \text{ grams} ``] - [`` [$g2] \text{ grams} = ``] [__________]{$kg2} [`` \text{ kilograms} ``] +b. [`` [$g2] \text{ grams} = ``] [__________]{$kg2} [`` \text{ kilograms} ``] END_PGML @@ -83,7 +84,7 @@ To convert [` [$kg1] `] kilograms to grams, we will use [` \frac{1000 \text{ g}} \end{aligned} ``] -*Solution:* [`` [$kg1] \text{ kg} = [$g1] \text{ g} ``] + So, [`` [$kg1] \text{ kg} = [$g1] \text{ g} ``] Next, to convert [` [$g2] `] grams to kilograms, we will use [` \frac{1 \text{ kg}}{1000 \text{ g}} `], so the unit *g* will cancel: @@ -98,7 +99,7 @@ Next, to convert [` [$g2] `] grams to kilograms, we will use [` \frac{1 \text{ k \end{aligned} ``] -*Solution:* [`` [$g2] \text{ g} = [$kg2] \text{ kg} ``] + So, [`` [$g2] \text{ g} = [$kg2] \text{ kg} ``] ####Proportion Method @@ -116,7 +117,7 @@ Assume [`[$kg1] \text{ kg} = x \text{ g} `]. We have: \end{aligned} ``] -*Solution:* [`` [$kg1] \text{ kg} = [$g1] \text{ g} ``] + So, [`` [$kg1] \text{ kg} = [$g1] \text{ g} ``] Next, assume [`x \text{ kg} = [$g2] \text{ g} `]. We have: @@ -132,7 +133,7 @@ Next, assume [`x \text{ kg} = [$g2] \text{ g} `]. We have: \end{aligned} ``] -*Solution:* [`` [$g2] \text{ g} = [$kg2] \text{ kg} ``] + So, [`` [$g2] \text{ g} = [$kg2] \text{ kg} ``] ####Shortcut @@ -142,11 +143,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$kg1] `] kilograms to grams, the number will become bigger. So we do: +For Part a, to convert [` [$kg1] `] kilograms to grams, the number will become bigger. So we do: [`` [$kg1] \text{ kg} = [$kg1] \cdot 1000 \text{ g} = [$g1] \text{ g} ``] -For Question 2, to convert [` [$g2] `] grams to kilograms, the number will become smaller. So we do: +For Part b, to convert [` [$g2] `] grams to kilograms, the number will become smaller. So we do: [`` [$g2] \text{ g} = [$g2] \div 1000 \text{ kg} = [$kg2] \text{ kg} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric260.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric260.pg index ae7b8c4036..13108a0030 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric260.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric260.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_mass) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -27,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -53,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ gram} = 1000 \text{ milligrams} `]. Do the following unit conversions. ----- - - [`` [$g1] \text{ grams} = ``] [__________]{$mg1} [`` \text{ milligrams} ``] - ----- +a. [`` [$g1] \text{ grams} = ``] [__________]{$mg1} [`` \text{ milligrams} ``] - [`` [$mg2] \text{ milligrams} = ``] [__________]{$g2} [`` \text{ grams} ``] +a. [`` [$mg2] \text{ milligrams} = ``] [__________]{$g2} [`` \text{ grams} ``] END_PGML @@ -83,7 +84,7 @@ To convert [` [$g1] `] grams to milligrams, we will use [` \frac{1000 \text{ mg} \end{aligned} ``] -*Solution:* [`` [$g1] \text{ g} = [$mg1] \text{ mg} ``] + So, [`` [$g1] \text{ g} = [$mg1] \text{ mg} ``] Next, to convert [` [$mg2] `] milligrams to grams, we will use [` \frac{1 \text{ g}}{1000 \text{ mg}} `], so the unit *mg* will cancel: @@ -98,7 +99,7 @@ Next, to convert [` [$mg2] `] milligrams to grams, we will use [` \frac{1 \text{ \end{aligned} ``] -*Solution:* [`` [$mg2] \text{ mg} = [$g2] \text{ g} ``] + So, [`` [$mg2] \text{ mg} = [$g2] \text{ g} ``] ####Proportion Method @@ -116,7 +117,7 @@ Assume [`[$g1] \text{ g} = x \text{ mg} `]. We have: \end{aligned} ``] -*Solution:* [`` [$g1] \text{ g} = [$mg1] \text{ mg} ``] + So, [`` [$g1] \text{ g} = [$mg1] \text{ mg} ``] Next, assume [`x \text{ g} = [$mg2] \text{ mg} `]. We have: @@ -132,7 +133,7 @@ Next, assume [`x \text{ g} = [$mg2] \text{ mg} `]. We have: \end{aligned} ``] -*Solution:* [`` [$mg2] \text{ mg} = [$g2] \text{ g} ``] + So, [`` [$mg2] \text{ mg} = [$g2] \text{ g} ``] ####Shortcut @@ -142,11 +143,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$g1] `] grams to milligrams, the number will become bigger. So we do: +For Part a, to convert [` [$g1] `] grams to milligrams, the number will become bigger. So we do: [`` [$g1] \text{ g} = [$g1] \cdot 1000 \text{ mg} = [$mg1] \text{ mg} ``] -For Question 2, to convert [` [$mg2] `] milligrams to grams, the number will become smaller. So we do: +For Part b, to convert [` [$mg2] `] milligrams to grams, the number will become smaller. So we do: [`` [$mg2] \text{ mg} = [$mg2] \div 1000 \text{ g} = [$g2] \text{ g} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric270.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric270.pg index 4182357bf1..5e0508fa1b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric270.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric270.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_mass) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -27,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -53,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ gram} = 1000 \text{ milligrams} `]. Do the following unit conversions. ----- - - [`` [$g1] \text{ grams} = ``] [__________]{$mg1} [`` \text{ milligrams} ``] - ----- +a. [`` [$g1] \text{ grams} = ``] [__________]{$mg1} [`` \text{ milligrams} ``] - [`` [$mg2] \text{ milligrams} = ``] [__________]{$g2} [`` \text{ grams} ``] +b. [`` [$mg2] \text{ milligrams} = ``] [__________]{$g2} [`` \text{ grams} ``] END_PGML @@ -83,7 +84,7 @@ To convert [` [$g1] `] grams to milligrams, we will use [` \frac{1000 \text{ mg} \end{aligned} ``] -*Solution:* [`` [$g1] \text{ g} = [$mg1] \text{ mg} ``] + So, [`` [$g1] \text{ g} = [$mg1] \text{ mg} ``] Next, to convert [` [$mg2] `] milligrams to grams, we will use [` \frac{1 \text{ g}}{1000 \text{ mg}} `], so the unit *mg* will cancel: @@ -98,7 +99,7 @@ Next, to convert [` [$mg2] `] milligrams to grams, we will use [` \frac{1 \text{ \end{aligned} ``] -*Solution:* [`` [$mg2] \text{ mg} = [$g2] \text{ g} ``] + So, [`` [$mg2] \text{ mg} = [$g2] \text{ g} ``] ####Proportion Method @@ -116,7 +117,7 @@ Assume [`[$g1] \text{ g} = x \text{ mg} `]. We have: \end{aligned} ``] -*Solution:* [`` [$g1] \text{ g} = [$mg1] \text{ mg} ``] + So, [`` [$g1] \text{ g} = [$mg1] \text{ mg} ``] Next, assume [`x \text{ g} = [$mg2] \text{ mg} `]. We have: @@ -132,7 +133,7 @@ Next, assume [`x \text{ g} = [$mg2] \text{ mg} `]. We have: \end{aligned} ``] -*Solution:* [`` [$mg2] \text{ mg} = [$g2] \text{ g} ``] + So, [`` [$mg2] \text{ mg} = [$g2] \text{ g} ``] ####Shortcut @@ -142,11 +143,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$g1] `] grams to milligrams, the number will become bigger. So we do: +For Part a, to convert [` [$g1] `] grams to milligrams, the number will become bigger. So we do: [`` [$g1] \text{ g} = [$g1] \cdot 1000 \text{ mg} = [$mg1] \text{ mg} ``] -For Question 2, to convert [` [$mg2] `] milligrams to grams, the number will become smaller. So we do: +For Part b, to convert [` [$mg2] `] milligrams to grams, the number will become smaller. So we do: [`` [$mg2] \text{ mg} = [$mg2] \div 1000 \text{ g} = [$g2] \text{ g} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric280.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric280.pg index f816fdbd99..6c4729172f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric280.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric280.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_metric_tons) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -55,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ metric ton} = 1000 \text{ kilograms} `]. (Note that a metric ton is different from a US ton.) Do the following unit conversions. ----- - - [`` [$t1] \text{ metric tons} = ``] [__________]{$kg1} [`` \text{ kilograms} ``] - ----- +a. [`` [$t1] \text{ metric tons} = ``] [__________]{$kg1} [`` \text{ kilograms} ``] - [`` [$kg2] \text{ kilograms} = ``] [__________]{$t2} [`` \text{ metric tons} ``] +b. [`` [$kg2] \text{ kilograms} = ``] [__________]{$t2} [`` \text{ metric tons} ``] END_PGML @@ -85,7 +84,7 @@ To convert [` [$t1] `] metric tons to kilograms, we will use [` \frac{1000 \text \end{aligned} ``] -*Solution:* [`` [$t1] \text{ t} = [$kg1] \text{ kg} ``] + So, [`` [$t1] \text{ t} = [$kg1] \text{ kg} ``] Next, to convert [` [$kg2] `] kilograms to metric tons, we will use [` \frac{1 \text{ t}}{1000 \text{ kg}} `], so the unit *kg* will cancel: @@ -100,7 +99,7 @@ Next, to convert [` [$kg2] `] kilograms to metric tons, we will use [` \frac{1 \ \end{aligned} ``] -*Solution:* [`` [$kg2] \text{ kg} = [$t2] \text{ t} ``] + So, [`` [$kg2] \text{ kg} = [$t2] \text{ t} ``] ####Proportion Method @@ -118,7 +117,7 @@ Assume [`[$t1] \text{ t} = x \text{ kg} `]. We have: \end{aligned} ``] -*Solution:* [`` [$t1] \text{ t} = [$kg1] \text{ kg} ``] + So, [`` [$t1] \text{ t} = [$kg1] \text{ kg} ``] Next, assume [`x \text{ t} = [$kg2] \text{ kg} `]. We have: @@ -134,7 +133,7 @@ Next, assume [`x \text{ t} = [$kg2] \text{ kg} `]. We have: \end{aligned} ``] -*Solution:* [`` [$kg2] \text{ kg} = [$t2] \text{ t} ``] + So, [`` [$kg2] \text{ kg} = [$t2] \text{ t} ``] ####Shortcut @@ -144,11 +143,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$t1] `] metric tons to kilograms, the number will become bigger. So we do: +For Part a, to convert [` [$t1] `] metric tons to kilograms, the number will become bigger. So we do: [`` [$t1] \text{ t} = [$t1] \cdot 1000 \text{ kg} = [$kg1] \text{ kg} ``] -For Question 2, to convert [` [$kg2] `] kilograms to metric tons, the number will become smaller. So we do: +For Part b, to convert [` [$kg2] `] kilograms to metric tons, the number will become smaller. So we do: [`` [$kg2] \text{ kg} = [$kg2] \div 1000 \text{ t} = [$t2] \text{ t} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric290.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric290.pg index 3378412852..b8857e1324 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric290.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric290.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(american_to_american_conversion_metric_tons) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ metric ton} = 1000 \text{ kilograms} `]. (Note that a metric ton is different from a US ton.) Do the following unit conversions. ----- - - [`` [$t1] \text{ metric tons} = ``] [__________]{$kg1} [`` \text{ kilograms} ``] - ----- +a. [`` [$t1] \text{ metric tons} = ``] [__________]{$kg1} [`` \text{ kilograms} ``] - [`` [$kg2] \text{ kilograms} = ``] [__________]{$t2} [`` \text{ metric tons} ``] +b. [`` [$kg2] \text{ kilograms} = ``] [__________]{$t2} [`` \text{ metric tons} ``] END_PGML @@ -84,7 +84,7 @@ To convert [` [$t1] `] metric tons to kilograms, we will use [` \frac{1000 \text \end{aligned} ``] -*Solution:* [`` [$t1] \text{ t} = [$kg1] \text{ kg} ``] + So, [`` [$t1] \text{ t} = [$kg1] \text{ kg} ``] Next, to convert [` [$kg2] `] kilograms to metric tons, we will use [` \frac{1 \text{ t}}{1000 \text{ kg}} `], so the unit *kg* will cancel: @@ -99,7 +99,7 @@ Next, to convert [` [$kg2] `] kilograms to metric tons, we will use [` \frac{1 \ \end{aligned} ``] -*Solution:* [`` [$kg2] \text{ kg} = [$t2] \text{ t} ``] + So, [`` [$kg2] \text{ kg} = [$t2] \text{ t} ``] ####Proportion Method @@ -117,7 +117,7 @@ Assume [`[$t1] \text{ t} = x \text{ kg} `]. We have: \end{aligned} ``] -*Solution:* [`` [$t1] \text{ t} = [$kg1] \text{ kg} ``] + So, [`` [$t1] \text{ t} = [$kg1] \text{ kg} ``] Next, assume [`x \text{ t} = [$kg2] \text{ kg} `]. We have: @@ -133,7 +133,7 @@ Next, assume [`x \text{ t} = [$kg2] \text{ kg} `]. We have: \end{aligned} ``] -*Solution:* [`` [$kg2] \text{ kg} = [$t2] \text{ t} ``] + So, [`` [$kg2] \text{ kg} = [$t2] \text{ t} ``] ####Shortcut @@ -143,11 +143,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$t1] `] metric tons to kilograms, the number will become bigger. So we do: +For Part a, to convert [` [$t1] `] metric tons to kilograms, the number will become bigger. So we do: [`` [$t1] \text{ t} = [$t1] \cdot 1000 \text{ kg} = [$kg1] \text{ kg} ``] -For Question 2, to convert [` [$kg2] `] kilograms to metric tons, the number will become smaller. So we do: +For Part b, to convert [` [$kg2] `] kilograms to metric tons, the number will become smaller. So we do: [`` [$kg2] \text{ kg} = [$kg2] \div 1000 \text{ t} = [$t2] \text{ t} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric30.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric30.pg index 15c9f4959c..fa54b6d250 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric30.pg @@ -8,16 +8,19 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -27,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +54,9 @@ BEGIN_PGML It's given that [` 1 \text{ kilometer} = 1000 \text{ meters} `]. Do the following unit conversions. ----- - - [`` [$km1] \text{ kilometers} = ``] [__________]{$m1} [`` \text{ meters} ``] - ----- +a. [`` [$km1] \text{ kilometers} = ``] [__________]{$m1} [`` \text{ meters} ``] - [`` [$m2] \text{ meters} = ``] [__________]{$km2} [`` \text{ kilometers} ``] +a. [`` [$m2] \text{ meters} = ``] [__________]{$km2} [`` \text{ kilometers} ``] END_PGML @@ -79,7 +80,7 @@ To convert [` [$km1] `] kilometers to meters, we will use [` \frac{1000 \text{ m \end{aligned} ``] -*Solution:* [`` [$km1] \text{ km} = [$m1] \text{ m} ``] + So, [`` [$km1] \text{ km} = [$m1] \text{ m} ``] Next, to convert [` [$m2] `] meters to kilometers, we will use [` \frac{1 \text{ km}}{1000 \text{ m}} `], so the unit *m* will cancel: @@ -94,7 +95,7 @@ Next, to convert [` [$m2] `] meters to kilometers, we will use [` \frac{1 \text{ \end{aligned} ``] -*Solution:* [`` [$m2] \text{ m} = [$km2] \text{ km} ``] + So, [`` [$m2] \text{ m} = [$km2] \text{ km} ``] ####Proportion Method @@ -112,7 +113,7 @@ Assume [`[$km1] \text{ km} = x \text{ m} `]. We have: \end{aligned} ``] -*Solution:* [`` [$km1] \text{ km} = [$m1] \text{ m} ``] + So, [`` [$km1] \text{ km} = [$m1] \text{ m} ``] Next, assume [`x \text{ km} = [$m2] \text{ m} `]. We have: @@ -128,7 +129,7 @@ Next, assume [`x \text{ km} = [$m2] \text{ m} `]. We have: \end{aligned} ``] -*Solution:* [`` [$m2] \text{ m} = [$km2] \text{ km} ``] + So, [`` [$m2] \text{ m} = [$km2] \text{ km} ``] ####Shortcut @@ -138,11 +139,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$km1] `] kilometers to meters, the number will become bigger. So we do: +For Part a, to convert [` [$km1] `] kilometers to meters, the number will become bigger. So we do: [`` [$km1] \text{ km} = [$km1] \cdot 1000 \text{ m} = [$m1] \text{ m} ``] -For Question 2, to convert [` [$m2] `] meters to kilometers, the number will become smaller. So we do: +For Part b, to convert [` [$m2] `] meters to kilometers, the number will become smaller. So we do: [`` [$m2] \text{ m} = [$m2] \div 1000 \text{ km} = [$km2] \text{ km} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric300.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric300.pg index a084dae99b..06c6a42db9 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric300.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric300.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_mass) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -26,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -45,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ kilogram} = 1000 \text{ grams} `] and [` 1 \text{ gram} = 1000 \text{ milligrams} `]. Do the following unit conversion. ----- - [`` [$kg] \text{ kilograms} = ``] [__________]{$mg} [`` \text{ milligrams} ``] END_PGML @@ -74,7 +77,7 @@ Next, we change the given number [` [$kg] \text{ kilograms} `] into a fraction, \end{aligned} ``] -*Solution:* [`` [$kg] \text{ kg} = [$mg] \text{ mg} ``] + So, [`` [$kg] \text{ kg} = [$mg] \text{ mg} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric310.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric310.pg index 39ff5f4fd8..4de429a617 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric310.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric310.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -45,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ kilogram} = 1000 \text{ grams} `] and [` 1 \text{ gram} = 1000 \text{ milligrams} `]. Do the following unit conversion. ----- - [`` [$kg] \text{ kilograms} = ``] [__________]{$mg} [`` \text{ milligrams} ``] END_PGML @@ -74,7 +77,7 @@ Next, we change the given number [` [$kg] \text{ kilograms} `] into a fraction, \end{aligned} ``] -*Solution:* [`` [$kg] \text{ kg} = [$mg] \text{ mg} ``] + So, [`` [$kg] \text{ kg} = [$mg] \text{ mg} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric320.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric320.pg index 00bb55362d..8a325dce53 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric320.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric320.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_mass) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -26,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -45,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ kilogram} = 1000 \text{ grams} `] and [` 1 \text{ gram} = 1000 \text{ milligrams} `]. Do the following unit conversion. ----- - [`` [$mg] \text{ milligrams} = ``] [__________]{$kg} [`` \text{ kilograms} ``] END_PGML @@ -74,7 +77,7 @@ Next, we change the given number [` [$mg] \text{ milligrams} `] into a fraction, \end{aligned} ``] -*Solution:* [`` [$mg] \text{ mg} = [$kg] \text{ kg} ``] + So, [`` [$mg] \text{ mg} = [$kg] \text{ kg} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric330.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric330.pg index c3d1d4a51d..22355d4415 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric330.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric330.pg @@ -7,16 +7,19 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_mass) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + ############################################## @@ -26,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -45,8 +50,6 @@ BEGIN_PGML It's given that [` 1 \text{ metric ton} = 1000 \text{ kilograms} `] and [` 1 \text{ kilogram} = 1000 \text{ grams} `]. (Note that a metric ton is different from a US ton.) Do the following unit conversion. ----- - [`` [$g] \text{ grams} = ``] [__________]{$t} [`` \text{ metric tons} ``] END_PGML @@ -74,7 +77,7 @@ Next, we change the given number [` [$g] \text{ grams} `] into a fraction, [` \f \end{aligned} ``] -*Solution:* [`` [$g] \text{ g} = [$t] \text{ t} ``] + So, [`` [$g] \text{ g} = [$t] \text{ t} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric340.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric340.pg index 3bfc9c2946..34ee807e80 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric340.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric340.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_volume) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -55,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ liter} = 1000 \text{ milliliters} `]. Do the following unit conversions. ----- - - [`` [$L1] \text{ liters} = ``] [__________]{$mL1} [`` \text{ milliliters} ``] - ----- +a. [`` [$L1] \text{ liters} = ``] [__________]{$mL1} [`` \text{ milliliters} ``] - [`` [$mL2] \text{ milliliters} = ``] [__________]{$L2} [`` \text{ liters} ``] +a. [`` [$mL2] \text{ milliliters} = ``] [__________]{$L2} [`` \text{ liters} ``] END_PGML @@ -85,7 +84,7 @@ To convert [` [$L1] `] liters to milliliters, we will use [` \frac{1000 \text{ m \end{aligned} ``] -*Solution:* [`` [$L1] \text{ L} = [$mL1] \text{ mL} ``] + So, [`` [$L1] \text{ L} = [$mL1] \text{ mL} ``] Next, to convert [` [$mL2] `] milliliters to liters, we will use [` \frac{1 \text{ L}}{1000 \text{ mL}} `], so the unit *mL* will cancel: @@ -100,7 +99,7 @@ Next, to convert [` [$mL2] `] milliliters to liters, we will use [` \frac{1 \tex \end{aligned} ``] -*Solution:* [`` [$mL2] \text{ mL} = [$L2] \text{ L} ``] + So, [`` [$mL2] \text{ mL} = [$L2] \text{ L} ``] ####Proportion Method @@ -118,7 +117,7 @@ Assume [`[$L1] \text{ L} = x \text{ mL} `]. We have: \end{aligned} ``] -*Solution:* [`` [$L1] \text{ L} = [$mL1] \text{ mL} ``] + So, [`` [$L1] \text{ L} = [$mL1] \text{ mL} ``] Next, assume [`x \text{ L} = [$mL2] \text{ mL} `]. We have: @@ -134,7 +133,7 @@ Next, assume [`x \text{ L} = [$mL2] \text{ mL} `]. We have: \end{aligned} ``] -*Solution:* [`` [$mL2] \text{ mL} = [$L2] \text{ L} ``] + So, [`` [$mL2] \text{ mL} = [$L2] \text{ L} ``] ####Shortcut @@ -144,11 +143,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$L1] `] liters to milliliters, the number will become bigger. So we do: +For Part a, to convert [` [$L1] `] liters to milliliters, the number will become bigger. So we do: [`` [$L1] \text{ L} = [$L1] \cdot 1000 \text{ mL} = [$mL1] \text{ mL} ``] -For Question 2, to convert [` [$mL2] `] milliliters to liters, the number will become smaller. So we do: +For Part b, to convert [` [$mL2] `] milliliters to liters, the number will become smaller. So we do: [`` [$mL2] \text{ mL} = [$mL2] \div 1000 \text{ L} = [$L2] \text{ L} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric350.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric350.pg index 3e1c4432e6..02f3808f0e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric350.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric350.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_volume) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -54,13 +58,9 @@ BEGIN_PGML It's given that [` 1 \text{ liter} = 1000 \text{ milliliters} `]. Do the following unit conversions. ----- - - [`` [$L1] \text{ liters} = ``] [__________]{$mL1} [`` \text{ milliliters} ``] - ----- +a. [`` [$L1] \text{ liters} = ``] [__________]{$mL1} [`` \text{ milliliters} ``] - [`` [$mL2] \text{ milliliters} = ``] [__________]{$L2} [`` \text{ liters} ``] +a. [`` [$mL2] \text{ milliliters} = ``] [__________]{$L2} [`` \text{ liters} ``] END_PGML @@ -84,7 +84,7 @@ To convert [` [$L1] `] liters to milliliters, we will use [` \frac{1000 \text{ m \end{aligned} ``] -*Solution:* [`` [$L1] \text{ L} = [$mL1] \text{ mL} ``] + So, [`` [$L1] \text{ L} = [$mL1] \text{ mL} ``] Next, to convert [` [$mL2] `] milliliters to liters, we will use [` \frac{1 \text{ L}}{1000 \text{ mL}} `], so the unit *mL* will cancel: @@ -99,7 +99,7 @@ Next, to convert [` [$mL2] `] milliliters to liters, we will use [` \frac{1 \tex \end{aligned} ``] -*Solution:* [`` [$mL2] \text{ mL} = [$L2] \text{ L} ``] + So, [`` [$mL2] \text{ mL} = [$L2] \text{ L} ``] ####Proportion Method @@ -117,7 +117,7 @@ Assume [`[$L1] \text{ L} = x \text{ mL} `]. We have: \end{aligned} ``] -*Solution:* [`` [$L1] \text{ L} = [$mL1] \text{ mL} ``] + So, [`` [$L1] \text{ L} = [$mL1] \text{ mL} ``] Next, assume [`x \text{ L} = [$mL2] \text{ mL} `]. We have: @@ -133,7 +133,7 @@ Next, assume [`x \text{ L} = [$mL2] \text{ mL} `]. We have: \end{aligned} ``] -*Solution:* [`` [$mL2] \text{ mL} = [$L2] \text{ L} ``] + So, [`` [$mL2] \text{ mL} = [$L2] \text{ L} ``] ####Shortcut @@ -143,11 +143,11 @@ Recall that multiplying [`1000`] causes the decimal point to move right [`3`] ti Dividing by [`1000`] causes the decimal point to move left [`3`] times, like in [` 3000 \div 1000 = 3 `]. -For Question 1, to convert [` [$L1] `] liters to milliliters, the number will become bigger. So we do: +For Part a, to convert [` [$L1] `] liters to milliliters, the number will become bigger. So we do: [`` [$L1] \text{ L} = [$L1] \cdot 1000 \text{ mL} = [$mL1] \text{ mL} ``] -For Question 2, to convert [` [$mL2] `] milliliters to liters, the number will become smaller. So we do: +For Part b, to convert [` [$mL2] `] milliliters to liters, the number will become smaller. So we do: [`` [$mL2] \text{ mL} = [$mL2] \div 1000 \text{ L} = [$L2] \text{ L} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric40.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric40.pg index 0b962386aa..2797ae1f57 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric40.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ meter} = 10 \text{ decimeters} `]. Do the following unit conversions. ----- - - [`` [$m1] \text{ meters} = ``] [__________]{$dm1} [`` \text{ decimeters} ``] - ----- +a. [`` [$m1] \text{ meters} = ``] [__________]{$dm1} [`` \text{ decimeters} ``] - [`` [$dm2] \text{ decimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] +a. [`` [$dm2] \text{ decimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$m1] `] meters to decimeters, we will use [` \frac{10 \text{ dm}} \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$dm1] \text{ dm} ``] + So, [`` [$m1] \text{ m} = [$dm1] \text{ dm} ``] Next, to convert [` [$dm2] `] decimeters to meters, we will use [` \frac{1 \text{ m}}{10 \text{ dm}} `], so the unit *dm* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$dm2] `] decimeters to meters, we will use [` \frac{1 \text \end{aligned} ``] -*Solution:* [`` [$dm2] \text{ dm} = [$m2] \text{ m} ``] + So, [`` [$dm2] \text{ dm} = [$m2] \text{ m} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$m1] \text{ m} = x \text{ dm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$dm1] \text{ dm} ``] + So, [`` [$m1] \text{ m} = [$dm1] \text{ dm} ``] Next, assume [`x \text{ m} = [$dm2] \text{ dm} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ m} = [$dm2] \text{ dm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$dm2] \text{ dm} = [$m2] \text{ m} ``] + So, [`` [$dm2] \text{ dm} = [$m2] \text{ m} ``] ####Shortcut @@ -138,11 +138,11 @@ Recall that multiplying [`10`] causes the decimal point to move right once, like Dividing by [`10`] causes the decimal point to move left once, like in [` 3000 \div 10 = 300 `]. -For Question 1, to convert [` [$m1] `] meters to decimeters, the number will become bigger. So we do: +For Part a, to convert [` [$m1] `] meters to decimeters, the number will become bigger. So we do: [`` [$m1] \text{ m} = [$m1] \cdot 10 \text{ dm} = [$dm1] \text{ dm} ``] -For Question 2, to convert [` [$dm2] `] decimeters to meters, the number will become smaller. So we do: +For Part b, to convert [` [$dm2] `] decimeters to meters, the number will become smaller. So we do: [`` [$dm2] \text{ dm} = [$dm2] \div 10 \text{ m} = [$m2] \text{ m} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric50.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric50.pg index 235458e3a9..c74e6881be 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric50.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ meter} = 10 \text{ decimeters} `]. Do the following unit conversions. ----- - - [`` [$m1] \text{ meters} = ``] [__________]{$dm1} [`` \text{ decimeters} ``] - ----- +a. [`` [$m1] \text{ meters} = ``] [__________]{$dm1} [`` \text{ decimeters} ``] - [`` [$dm2] \text{ decimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] +a. [`` [$dm2] \text{ decimeters} = ``] [__________]{$m2} [`` \text{ meters} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$m1] `] meters to decimeters, we will use [` \frac{10 \text{ dm}} \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$dm1] \text{ dm} ``] + So, [`` [$m1] \text{ m} = [$dm1] \text{ dm} ``] Next, to convert [` [$dm2] `] decimeters to meters, we will use [` \frac{1 \text{ m}}{10 \text{ dm}} `], so the unit *dm* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$dm2] `] decimeters to meters, we will use [` \frac{1 \text \end{aligned} ``] -*Solution:* [`` [$dm2] \text{ dm} = [$m2] \text{ m} ``] + So, [`` [$dm2] \text{ dm} = [$m2] \text{ m} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$m1] \text{ m} = x \text{ dm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$m1] \text{ m} = [$dm1] \text{ dm} ``] + So, [`` [$m1] \text{ m} = [$dm1] \text{ dm} ``] Next, assume [`x \text{ m} = [$dm2] \text{ dm} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ m} = [$dm2] \text{ dm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$dm2] \text{ dm} = [$m2] \text{ m} ``] + So, [`` [$dm2] \text{ dm} = [$m2] \text{ m} ``] ####Shortcut @@ -138,11 +138,11 @@ Recall that multiplying [`10`] causes the decimal point to move right once, like Dividing by [`10`] causes the decimal point to move left once, like in [` 3000 \div 10 = 300 `]. -For Question 1, to convert [` [$m1] `] meters to decimeters, the number will become bigger. So we do: +For Part a, to convert [` [$m1] `] meters to decimeters, the number will become bigger. So we do: [`` [$m1] \text{ m} = [$m1] \cdot 10 \text{ dm} = [$dm1] \text{ dm} ``] -For Question 2, to convert [` [$dm2] `] decimeters to meters, the number will become smaller. So we do: +For Part b, to convert [` [$dm2] `] decimeters to meters, the number will become smaller. So we do: [`` [$dm2] \text{ dm} = [$dm2] \div 10 \text{ m} = [$m2] \text{ m} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric60.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric60.pg index ea7ac31e2d..8c53b0746b 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric60.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ decimeter} = 10 \text{ centimeters} `]. Do the following unit conversions. ----- - - [`` [$dm1] \text{ decimeters} = ``] [__________]{$cm1} [`` \text{ centimeters} ``] - ----- +a. [`` [$dm1] \text{ decimeters} = ``] [__________]{$cm1} [`` \text{ centimeters} ``] - [`` [$cm2] \text{ centimeters} = ``] [__________]{$dm2} [`` \text{ decimeters} ``] +a. [`` [$cm2] \text{ centimeters} = ``] [__________]{$dm2} [`` \text{ decimeters} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$dm1] `] decimeters to centimeters, we will use [` \frac{10 \text \end{aligned} ``] -*Solution:* [`` [$dm1] \text{ dm} = [$cm1] \text{ cm} ``] + So, [`` [$dm1] \text{ dm} = [$cm1] \text{ cm} ``] Next, to convert [` [$cm2] `] centimeters to decimeters, we will use [` \frac{1 \text{ dm}}{10 \text{ cm}} `], so the unit *cm* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$cm2] `] centimeters to decimeters, we will use [` \frac{1 \end{aligned} ``] -*Solution:* [`` [$cm2] \text{ cm} = [$dm2] \text{ dm} ``] + So, [`` [$cm2] \text{ cm} = [$dm2] \text{ dm} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$dm1] \text{ dm} = x \text{ cm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$dm1] \text{ dm} = [$cm1] \text{ cm} ``] + So, [`` [$dm1] \text{ dm} = [$cm1] \text{ cm} ``] Next, assume [`x \text{ dm} = [$cm2] \text{ cm} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ dm} = [$cm2] \text{ cm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$cm2] \text{ cm} = [$dm2] \text{ dm} ``] + So, [`` [$cm2] \text{ cm} = [$dm2] \text{ dm} ``] ####Shortcut @@ -138,11 +138,11 @@ Recall that multiplying [`10`] causes the decimal point to move right once, like Dividing by [`10`] causes the decimal point to move left once, like in [` 3000 \div 10 = 300 `]. -For Question 1, to convert [` [$dm1] `] decimeters to centimeters, the number will become bigger. So we do: +For Part a, to convert [` [$dm1] `] decimeters to centimeters, the number will become bigger. So we do: [`` [$dm1] \text{ dm} = [$dm1] \cdot 10 \text{ cm} = [$cm1] \text{ cm} ``] -For Question 2, to convert [` [$cm2] `] centimeters to decimeters, the number will become smaller. So we do: +For Part b, to convert [` [$cm2] `] centimeters to decimeters, the number will become smaller. So we do: [`` [$cm2] \text{ cm} = [$cm2] \div 10 \text{ dm} = [$dm2] \text{ dm} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric70.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric70.pg index 6df1f481e9..886e4563b3 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric70.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ decimeter} = 10 \text{ centimeters} `]. Do the following unit conversions. ----- - - [`` [$dm1] \text{ decimeters} = ``] [__________]{$cm1} [`` \text{ centimeters} ``] - ----- +a. [`` [$dm1] \text{ decimeters} = ``] [__________]{$cm1} [`` \text{ centimeters} ``] - [`` [$cm2] \text{ centimeters} = ``] [__________]{$dm2} [`` \text{ decimeters} ``] +a. [`` [$cm2] \text{ centimeters} = ``] [__________]{$dm2} [`` \text{ decimeters} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$dm1] `] decimeters to centimeters, we will use [` \frac{10 \text \end{aligned} ``] -*Solution:* [`` [$dm1] \text{ dm} = [$cm1] \text{ cm} ``] + So, [`` [$dm1] \text{ dm} = [$cm1] \text{ cm} ``] Next, to convert [` [$cm2] `] centimeters to decimeters, we will use [` \frac{1 \text{ dm}}{10 \text{ cm}} `], so the unit *cm* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$cm2] `] centimeters to decimeters, we will use [` \frac{1 \end{aligned} ``] -*Solution:* [`` [$cm2] \text{ cm} = [$dm2] \text{ dm} ``] + So, [`` [$cm2] \text{ cm} = [$dm2] \text{ dm} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$dm1] \text{ dm} = x \text{ cm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$dm1] \text{ dm} = [$cm1] \text{ cm} ``] + So, [`` [$dm1] \text{ dm} = [$cm1] \text{ cm} ``] Next, assume [`x \text{ dm} = [$cm2] \text{ cm} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ dm} = [$cm2] \text{ cm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$cm2] \text{ cm} = [$dm2] \text{ dm} ``] + So, [`` [$cm2] \text{ cm} = [$dm2] \text{ dm} ``] ####Shortcut @@ -138,11 +138,11 @@ Recall that multiplying [`10`] causes the decimal point to move right once, like Dividing by [`10`] causes the decimal point to move left once, like in [` 3000 \div 10 = 300 `]. -For Question 1, to convert [` [$dm1] `] decimeters to centimeters, the number will become bigger. So we do: +For Part a, to convert [` [$dm1] `] decimeters to centimeters, the number will become bigger. So we do: [`` [$dm1] \text{ dm} = [$dm1] \cdot 10 \text{ cm} = [$cm1] \text{ cm} ``] -For Question 2, to convert [` [$cm2] `] centimeters to decimeters, the number will become smaller. So we do: +For Part b, to convert [` [$cm2] `] centimeters to decimeters, the number will become smaller. So we do: [`` [$cm2] \text{ cm} = [$cm2] \div 10 \text{ dm} = [$dm2] \text{ dm} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric80.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric80.pg index c397686511..bef9793992 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric80.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCmmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ centimeter} = 10 \text{ millimeters} `]. Do the following unit conversions. ----- - - [`` [$cm1] \text{ centimeters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - ----- +a. [`` [$cm1] \text{ centimeters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - [`` [$mm2] \text{ millimeters} = ``] [__________]{$cm2} [`` \text{ centimeters} ``] +a. [`` [$mm2] \text{ millimeters} = ``] [__________]{$cm2} [`` \text{ centimeters} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$cm1] `] centimeters to millimeters, we will use [` \frac{10 \tex \end{aligned} ``] -*Solution:* [`` [$cm1] \text{ cm} = [$mm1] \text{ mm} ``] + So, [`` [$cm1] \text{ cm} = [$mm1] \text{ mm} ``] Next, to convert [` [$mm2] `] millimeters to centimeters, we will use [` \frac{1 \text{ cm}}{10 \text{ mm}} `], so the unit *mm* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$mm2] `] millimeters to centimeters, we will use [` \frac{1 \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$cm2] \text{ cm} ``] + So, [`` [$mm2] \text{ mm} = [$cm2] \text{ cm} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$cm1] \text{ cm} = x \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$cm1] \text{ cm} = [$mm1] \text{ mm} ``] + So, [`` [$cm1] \text{ cm} = [$mm1] \text{ mm} ``] Next, assume [`x \text{ cm} = [$mm2] \text{ mm} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ cm} = [$mm2] \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$cm2] \text{ cm} ``] + So, [`` [$mm2] \text{ mm} = [$cm2] \text{ cm} ``] ####Shortcut @@ -138,11 +138,11 @@ Recall that multiplying [`10`] causes the decimal point to move right once, like Dividing by [`10`] causes the decimal point to move left once, like in [` 3000 \div 10 = 300 `]. -For Question 1, to convert [` [$cm1] `] centimeters to millimeters, the number will become bigger. So we do: +For Part a, to convert [` [$cm1] `] centimeters to millimeters, the number will become bigger. So we do: [`` [$cm1] \text{ cm} = [$cm1] \cdot 10 \text{ mm} = [$mm1] \text{ mm} ``] -For Question 2, to convert [` [$mm2] `] millimeters to centimeters, the number will become smaller. So we do: +For Part b, to convert [` [$mm2] `] millimeters to centimeters, the number will become smaller. So we do: [`` [$mm2] \text{ mm} = [$mm2] \div 10 \text{ cm} = [$cm2] \text{ cm} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric90.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric90.pg index f1118ebfd1..2bb62f1081 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetric90.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(metric_to_metric_conversion_length) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','metric') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCmmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +53,9 @@ BEGIN_PGML It's given that [` 1 \text{ centimeter} = 10 \text{ millimeters} `]. Do the following unit conversions. ----- - - [`` [$cm1] \text{ centimeters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - ----- +a. [`` [$cm1] \text{ centimeters} = ``] [__________]{$mm1} [`` \text{ millimeters} ``] - [`` [$mm2] \text{ millimeters} = ``] [__________]{$cm2} [`` \text{ centimeters} ``] +a. [`` [$mm2] \text{ millimeters} = ``] [__________]{$cm2} [`` \text{ centimeters} ``] END_PGML @@ -79,7 +79,7 @@ To convert [` [$cm1] `] centimeters to millimeters, we will use [` \frac{10 \tex \end{aligned} ``] -*Solution:* [`` [$cm1] \text{ cm} = [$mm1] \text{ mm} ``] + So, [`` [$cm1] \text{ cm} = [$mm1] \text{ mm} ``] Next, to convert [` [$mm2] `] millimeters to centimeters, we will use [` \frac{1 \text{ cm}}{10 \text{ mm}} `], so the unit *mm* will cancel: @@ -94,7 +94,7 @@ Next, to convert [` [$mm2] `] millimeters to centimeters, we will use [` \frac{1 \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$cm2] \text{ cm} ``] + So, [`` [$mm2] \text{ mm} = [$cm2] \text{ cm} ``] ####Proportion Method @@ -112,7 +112,7 @@ Assume [`[$cm1] \text{ cm} = x \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$cm1] \text{ cm} = [$mm1] \text{ mm} ``] + So, [`` [$cm1] \text{ cm} = [$mm1] \text{ mm} ``] Next, assume [`x \text{ cm} = [$mm2] \text{ mm} `]. We have: @@ -128,7 +128,7 @@ Next, assume [`x \text{ cm} = [$mm2] \text{ mm} `]. We have: \end{aligned} ``] -*Solution:* [`` [$mm2] \text{ mm} = [$cm2] \text{ cm} ``] + So, [`` [$mm2] \text{ mm} = [$cm2] \text{ cm} ``] ####Shortcut @@ -138,11 +138,11 @@ Recall that multiplying [`10`] causes the decimal point to move right once, like Dividing by [`10`] causes the decimal point to move left once, like in [` 3000 \div 10 = 300 `]. -For Question 1, to convert [` [$cm1] `] centimeters to millimeters, the number will become bigger. So we do: +For Part a, to convert [` [$cm1] `] centimeters to millimeters, the number will become bigger. So we do: [`` [$cm1] \text{ cm} = [$cm1] \cdot 10 \text{ mm} = [$mm1] \text{ mm} ``] -For Question 2, to convert [` [$mm2] `] millimeters to centimeters, the number will become smaller. So we do: +For Part b, to convert [` [$mm2] `] millimeters to centimeters, the number will become smaller. So we do: [`` [$mm2] \text{ mm} = [$mm2] \div 10 \text{ cm} = [$cm2] \text{ cm} ``] diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication10.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication10.pg index b870335135..9b0e5ae2f0 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication10.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','metric','application','decimal') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "contextFraction.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -50,13 +56,10 @@ $ansKm = $ansM/1000; BEGIN_PGML Hill A is [`[$kmA]`] kilometers in height, while Hill B is [`[$mB]`] meters in height. What is the difference in their height? Answer this question in both meters and kilometers. ----- - -*Question 1:* The difference in these two hills' height is [_________]{$ansM} meters. ----- +a. The difference in these two hills' height is [_________]{$ansM} meters. -*Question 2:* The difference in these two hills' height is [_________]{$ansKm} kilometers. Use decimal in your answer. +b. The difference in these two hills' height is [_________]{$ansKm} kilometers. Use decimal in your answer. END_PGML @@ -67,9 +70,7 @@ BEGIN_PGML_SOLUTION We will use the formula [` 1 \text{ kilometer} = 1000 \text{ meters} `]. -####Question 1: - -We need to change Hill A's height from [`[$kmA]`] kilometers to meters: +*Part a:* We need to change Hill A's height from [`[$kmA]`] kilometers to meters: [`` [$kmA] \text{ km} = [$kmA] \cdot 1000 \text{ m} = [$mA] \text{ m} ``] @@ -77,11 +78,9 @@ Next, we find their difference in height by subtraction: [`` [$mA] \text{ m} - [$mB] \text{ m} = [$ansM] \text{ m} ``] -*Solution:* The difference in these two hills' height is [`[$ansM]`] meters. - -####Question 2: +The difference in these two hills' height is [`[$ansM]`] meters. -We need to change Hill B's height from [`[$mB]`] meters to kilometers: +*Part b:* We need to change Hill B's height from [`[$mB]`] meters to kilometers: [`` [$mB] \text{ m} = [$mB] \div 1000 \text{ km} = [$kmB] \text{ km} ``] @@ -89,7 +88,7 @@ Next, we find their difference in height by subtraction: [`` [$kmA] \text{ km} - [$kmB] \text{ km} = [$ansKm] \text{ km} ``] -*Solution:* The difference in these two hills' height is [`[$ansKm]`] kilometers. +The difference in these two hills' height is [`[$ansKm]`] kilometers. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication20.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication20.pg index 00d0d99f29..322f5bd734 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication20.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','metric','application','decimal') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "contextFraction.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -50,7 +56,7 @@ BEGIN_PGML A mountain grows by [`[$eachCM]`] centimeters every year. At this rate, in how many years will the mountain grow by [`[$totalM]`] meters? -*Solution:* The mountain will grow by [`[$totalM]`] meters in [__________]{$years} years. +The mountain will grow by [`[$totalM]`] meters in [__________]{$years} years. END_PGML @@ -73,7 +79,7 @@ Next, we use division to find the number of years it will take the mountain to g [`` [$totalM] \text{ m} \div [$eachM] \text{ m} = [$years] \text{ years} ``] -*Solution:* The mountain will grow by [`[$totalM]`] meters in [`[$years]`] years. +The mountain will grow by [`[$totalM]`] meters in [`[$years]`] years. ####Solution 2: @@ -85,7 +91,7 @@ Next, we use division to find the number of years it will take the mountain to g [`` [$totalCM] \text{ cm} \div [$eachCM] \text{ cm} = [$years] \text{ years} ``] -*Solution:* The mountain will grow by [`[$totalM]`] meters in [`[$years]`] years. +The mountain will grow by [`[$totalM]`] meters in [`[$years]`] years. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication30.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication30.pg index 1c8c2d63aa..a35b3ead7f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','metric','application','decimal') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "contextFraction.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -50,7 +56,7 @@ BEGIN_PGML A snail crawls [`[$eachMM]`] millimeters per second. How many centimeters can it crawl in [`[$seconds]`] seconds? -*Solution:* The snail can crawl [__________]{$totalCM} centimeters in [`[$seconds]`] seconds. +The snail can crawl [__________]{$totalCM} centimeters in [`[$seconds]`] seconds. END_PGML @@ -69,7 +75,7 @@ Next, we need to convert the result to centimeters: [`` [$totalMM] \text{ mm} = [$totalMM] \div 10 \text{ cm} = [$totalCM] \text{ cm} ``] -*Solution:* The snail can crawl [`[$totalCM]`] centimeters in [`[$seconds]`] seconds. +The snail can crawl [`[$totalCM]`] centimeters in [`[$seconds]`] seconds. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication40.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication40.pg index 231e521688..55d7683b0f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication40.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','metric','application','decimal') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "contextFraction.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -51,7 +57,7 @@ BEGIN_PGML A mountain moves toward the west by [`[$eachMM]`] millimeters per year. In the past [`[$yearsM]`] million years, how many kilometers did the mountain move toward the west? -*Solution:* The mountain moved to the west by [__________]{$totalKM} kilometers in [`[$yearsM]`] million years. +The mountain moved to the west by [__________]{$totalKM} kilometers in [`[$yearsM]`] million years. END_PGML @@ -78,7 +84,7 @@ Next, we convert meters to kilometers: [`` [$totalMM/1000] \text{ m} = [$totalMM/1000] \div 1000 \text{ km} = [$totalKM] \text{ km} ``] -*Solution:* The mountain moved to the west by [`[$totalKM]`] kilometers in [`[$yearsM]`] million years. +The mountain moved to the west by [`[$totalKM]`] kilometers in [`[$yearsM]`] million years. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication50.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication50.pg index cce8f94049..717dec9d54 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication50.pg @@ -7,15 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','metric','application','decimal') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -26,7 +29,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "contextFraction.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -48,7 +54,7 @@ BEGIN_PGML A factory ordered [`[$totalT]`] tons of plastics to make smart phones. Each phone will use [`[$eachG]`] grams of plastics. How many smart phones can be made from this order? -*Solution:* This order can be used to produce [_________]{$num} smart phones. +This order can be used to produce [_________]{$num} smart phones. END_PGML @@ -81,7 +87,7 @@ Now we can do division: [`` [$totalG] \text{ g} \div [$eachG] \text{ g} = [$num] \text{ phones} ``] -*Solution:* This order can be used to produce [`[$num]`] smart phones. +This order can be used to produce [`[$num]`] smart phones. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication60.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication60.pg index 0e3acf1efb..fd8c006f43 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication60.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','metric','application','decimal') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "contextFraction.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -48,7 +54,7 @@ BEGIN_PGML A chemistry teacher will order saline for a lab lesson for the upcoming school year. Each experiment will use [`[$eachMl]`] milliliters of saline, and approximately [`[$num]`] experiments will be conducted in this school year. How many liters of saline should the teacher order? -*Solution:* The teacher should order [_________]{$totalL} liters of saline for the school year. +The teacher should order [_________]{$totalL} liters of saline for the school year. END_PGML @@ -69,7 +75,7 @@ Next, we need to convert the result from milliliters to liters: [`` [$totalMl] \text{ ml} = [$totalMl] \div 1000 \text{ l} = [$totalL] \text{ l} ``] -*Solution:* The teacher should order [`[$totalL]`] liters of saline for the school year. +The teacher should order [`[$totalL]`] liters of saline for the school year. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication70.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication70.pg index a8d0c356ab..31da63db34 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionMetricApplication70.pg @@ -7,27 +7,30 @@ # # ENDDESCRIPTION -## DBCCSS('4.MD.3','5.MD.1') -## DBsubject(Geometry) -## DBchapter(Shapes) -## DBsection(Area) -## Institution(PCC) -## Author(Carl Yao) -## Level(2) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') ## KEYWORDS('area','perimeter','triangle','conversion') +## DBCCSS('4.MD.3','5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## DOCUMENT(); loadMacros( - "PGstandard.pl", "PGgraphmacros.pl", + "PGstandard.pl", "MathObjects.pl", "PGML.pl", "parserNumberWithUnits.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -36,20 +39,20 @@ $refreshCachedImages = 1; TEXT(beginproblem()); Context("Numeric"); -$xmin = 0; #The viewing window -$xmax = 30; -$ymin = 0; -$ymax = 30; - -$xLabelShift = $xmax/40; -$yLabelShift = $ymax/40; - $base = random(15,25,1); $height = random(8,14,1); $xcross = $base/random(2.5,4,0.1); $leftSide = round(sqrt($height**2+$xcross**2)); $rightSide = round(sqrt($height**2+($base-$xcross)**2)); +$xmin = 0; #The viewing window +$xmax = $base*1.2; +$ymin = 0; +$ymax = $xmax; + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + $baseCM = $base*100; $heightCM = $height*100; $leftSideCM = $leftSide*100; @@ -94,16 +97,11 @@ $altText = "a triangle with one side parallel to the ground; this side is $baseC ############################################## -BEGIN_TEXT +BEGIN_PGML -Find the perimeter and area of the triangle in terms of $BBOLD meters $EBOLD and $BBOLD square meters. $EBOLD $PAR +Find the perimeter and area of the triangle in terms of *meters* and *square meters.* -$BCENTER -\{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "$altText" title = "$altText" ') \} -$ECENTER -$PAR -END_TEXT -BEGIN_PGML +>>[@ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => "alt = '$altText' title = '$altText' ") @]*<< Its perimeter is [_____________]{$ansP} and its area is [_____________]{$ansA}. @@ -133,7 +131,7 @@ To find the perimeter of a triangle, we simply add up the length of its 3 sides: \end{aligned}``] Don't forget the length unit [`\textrm{m}`]. ----- + A triangle's area formula is: [`` \text{triangle area} = \frac{1}{2} \cdot \text{base} \cdot \text{height} ``] @@ -148,8 +146,6 @@ Using this formula, we have: Don't forget the area unit [`\textrm{m}^{2}`]. ----- - When you calculate perimeter, it's OK to find the perimeter in centimeters first, and then convert: [`` diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionSpeed10.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionSpeed10.pg new file mode 100644 index 0000000000..8d7e049408 --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionSpeed10.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change 3 km/hr to x mi/min +# +# Last edited: Carl Yao 8/9/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate','proportion','unit','conversion','time') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("LimitedNumeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$mps = random(0.001,0.01,0.001); +$s1 = $mps*5280*12*2.54/100000; +$kph = $s1*3600; + +############################################## + +BEGIN_PGML + +It's given that: + + [`` +\begin{aligned} + 1\text{mile} &= 5280\text{ft} \\ + 1\text{ft} &= 12\text{in} \\ + 1\text{in} &= 2.54\text{cm} \\ + 1\text{m} &= 100\text{cm} \\ + 1\text{km} &= 1000\text{m} +\end{aligned} + ``] + +Do the following unit conversion. Use decimals in your answer when needed. + +[`` [$mps] \frac{\text{mile}}{\text{second}} = ``] [__________]{$kph} [`` \frac{\text{km}}{\text{hr}} ``] + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$mps] \frac{\text{mile}}{\text{second}} `] to [` \frac{\text{km}}{\text{hr}} `], we will first convert the unit *mile* to *km*: + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$mps] \frac{\text{mile}}{\text{second}} \cdot \frac{5280 \text{ ft}}{1 \text{ mile}} \cdot \frac{12 \text{ in}}{1 \text{ ft}} \cdot \frac{2.54 \text{ cm}}{1 \text{ in}} \cdot \frac{1 \text{ m}}{100 \text{ cm}} \cdot \frac{1 \text{ km}}{1000 \text{ m}} \\ + &= \frac{[$mps]\cdot 5280\cdot 12 \cdot 2.54 \text{ km}}{100\cdot 1000 \text{ second}} \\ + &= [$s1] \frac{\text{ km}}{\text{second}} +\end{aligned} + ``] + +Next, convert the unit *second* to *hr*: + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$s1] \frac{\text{ km}}{\text{second}} \cdot \frac{60 \text{ seconds}}{1 \text{ min}} \cdot \frac{60 \text{ min}}{1 \text{ hr}} \\ + &= \frac{[$s1]\cdot 60\cdot 60 \text{ km}}{1 \text{ hr}} \\ + &= [$kph] \frac{\text{ km}}{\text{second}} +\end{aligned} + ``] + +So [`` [$mps] \frac{\text{mile}}{\text{second}} = [$kph] \frac{\text{km}}{\text{hr}} ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionSpeed20.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionSpeed20.pg new file mode 100644 index 0000000000..95bc7434bb --- /dev/null +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionSpeed20.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Change 3 km/hr to x mi/min +# +# Last edited: Carl Yao 8/9/2019 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') +## KEYWORDS('rate','proportion','unit','conversion','time') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("LimitedNumeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$kph = random(1000,2000,1); +$s1 = $kph*100000/(5280*12*2.54); +$mps = $s1/3600; + +############################################## + +BEGIN_PGML + +It's given that: + + [`` +\begin{aligned} + 1\text{mile} &= 5280\text{ft} \\ + 1\text{ft} &= 12\text{in} \\ + 1\text{in} &= 2.54\text{cm} \\ + 1\text{m} &= 100\text{cm} \\ + 1\text{km} &= 1000\text{m} +\end{aligned} + ``] + +Do the following unit conversion. Use decimals in your answer when needed. + +[`` [$kph] \frac{\text{km}}{\text{hr}} = ``] [__________]{$mps} [`` \frac{\text{miles}}{\text{second}} ``] + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$kph] \frac{\text{km}}{\text{hr}} `] to [` \frac{\text{miles}}{\text{second}} `], we will first convert the unit *km* to *mi*: + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$kph] \frac{\text{km}}{\text{hr}} \cdot \frac{1000 \text{ m}}{1 \text{ km}} \cdot \frac{100 \text{ cm}}{1 \text{ m}} \cdot \frac{1 \text{ in}}{2.54 \text{ cm}} \cdot \frac{1 \text{ ft}}{12 \text{ in}} \cdot \frac{1 \text{ mile}}{5280 \text{ ft}} \\ + &= \frac{[$kph]\cdot 1000\cdot 100 \text{ mile}}{2.54\cdot 12 \cdot 5280 \text{ hr}} \\ + &= [$s1] \frac{\text{ miles}}{\text{hr}} +\end{aligned} + ``] + +Next, convert the unit *hr* to *second*: + + [`` +\begin{aligned}[t] + &\phantom{{}=} [$s1] \frac{\text{ miles}}{\text{hr}} \cdot \frac{1 \text{ hr}}{60 \text{ min}} \cdot \frac{1 \text{ min}}{60 \text{ seconds}} \\ + &= \frac{[$s1] \text{ miles}}{60 \cdot 60 \text{ second}} \\ + &= [$mps] \frac{\text{ km}}{\text{second}} +\end{aligned} + ``] + +So [`` [$kph] \frac{\text{km}}{\text{hr}} = [$mps] \frac{\text{miles}}{\text{second}} ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime10.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime10.pg index 87bb373848..ff3d922a7e 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime10.pg @@ -8,17 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(conversion_time) -## MLTleader(1) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -49,13 +52,9 @@ BEGIN_PGML Do the following unit conversions. ----- - - [`` [$hr1] \text{ hours} = ``] [__________]{$min1} [`` \text{ minutes} ``] - ----- +a. [`` [$hr1] \text{ hours} = ``] [__________]{$min1} [`` \text{ minutes} ``] - [`` [$sec2] \text{ seconds} = ``] [__________]{$min2} [`` \text{ minutes} ``] +a. [`` [$sec2] \text{ seconds} = ``] [__________]{$min2} [`` \text{ minutes} ``] END_PGML @@ -79,7 +78,7 @@ To convert [` [$hr1] `] hours to minutes, we will use [` \frac{60 \text{ min}}{1 \end{aligned} ``] -*Solution:* [`` [$hr1] \text{ hr} = [$min1] \text{ min} ``] + So, [`` [$hr1] \text{ hr} = [$min1] \text{ min} ``] We know [` 1 \text{ minutes} = 60 \text{ seconds} `]. This can be written as either [` \frac{1 \text{ min}}{60 \text{ sec}} `] or [` \frac{60 \text{ sec}}{1 \text{ min}} `]. @@ -96,7 +95,7 @@ To convert [` [$sec2] `] seconds to minutes, we will use [` \frac{1 \text{ min}} \end{aligned} ``] -*Solution:* [`` [$sec2] \text{ sec} = [$min2] \text{ min} ``] + So, [`` [$sec2] \text{ sec} = [$min2] \text{ min} ``] ####Proportion Method @@ -114,7 +113,7 @@ Assume [`[$hr1] \text{ hr} = x \text{ min} `]. We have: \end{aligned} ``] -*Solution:* [`` [$hr1] \text{ hr} = [$min1] \text{ min} ``] + So, [`` [$hr1] \text{ hr} = [$min1] \text{ min} ``] We know [` 1 \text{ minutes} = 60 \text{ seconds} `]. Assume [`x \text{ min} = [$sec2] \text{ sec} `]. We have: @@ -130,7 +129,7 @@ We know [` 1 \text{ minutes} = 60 \text{ seconds} `]. Assume [`x \text{ min} = [ \end{aligned} ``] -*Solution:* [`` [$sec2] \text{ sec} = [$min2] \text{ min} ``] + So, [`` [$sec2] \text{ sec} = [$min2] \text{ min} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime100.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime100.pg index 08da4ac098..7ef854c9e2 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime100.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime100.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(conversion_time) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -79,7 +83,7 @@ Next, we change the given number [` [$sec] \text{ sec} `] into a fraction, [` \f \end{aligned} ``] -*Solution:* [`` [$sec] \text{ seconds} = [$week] \text{ weeks} ``] +[`` [$sec] \text{ seconds} = [$week] \text{ weeks} ``] ####Shortcut @@ -95,7 +99,7 @@ Similarly, we do: [`` [$day] \text{ days} = [$day] \div 7 \text{ weeks} = [$week] \text{ weeks} ``] -*Solution:* [`` [$sec] \text{ seconds} = [$week] \text{ weeks} ``] +[`` [$sec] \text{ seconds} = [$week] \text{ weeks} ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime20.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime20.pg index 43e1bb4020..81957d6e6f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime20.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(conversion_time) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,7 +30,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -48,13 +52,9 @@ BEGIN_PGML Do the following unit conversions. Use decimals in your answer when needed. ----- - - [`` [$hr1] \text{ hours} = ``] [__________]{$min1} [`` \text{ minutes} ``] - ----- +a. [`` [$hr1] \text{ hours} = ``] [__________]{$min1} [`` \text{ minutes} ``] - [`` [$sec2] \text{ seconds} = ``] [__________]{$min2} [`` \text{ minutes} ``] +b. [`` [$sec2] \text{ seconds} = ``] [__________]{$min2} [`` \text{ minutes} ``] END_PGML @@ -78,7 +78,7 @@ To convert [` [$hr1] `] hours to minutes, we will use [` \frac{60 \text{ min}}{1 \end{aligned} ``] -*Solution:* [`` [$hr1] \text{ hr} = [$min1] \text{ min} ``] + So, [`` [$hr1] \text{ hr} = [$min1] \text{ min} ``] We know [` 1 \text{ minutes} = 60 \text{ seconds} `]. This can be written as either [` \frac{1 \text{ min}}{60 \text{ sec}} `] or [` \frac{60 \text{ sec}}{1 \text{ min}} `]. @@ -95,7 +95,7 @@ To convert [` [$sec2] `] seconds to minutes, we will use [` \frac{1 \text{ min}} \end{aligned} ``] -*Solution:* [`` [$sec2] \text{ sec} = [$min2] \text{ min} ``] + So, [`` [$sec2] \text{ sec} = [$min2] \text{ min} ``] ####Proportion Method @@ -113,7 +113,7 @@ Assume [`[$hr1] \text{ hr} = x \text{ min} `]. We have: \end{aligned} ``] -*Solution:* [`` [$hr1] \text{ hr} = [$min1] \text{ min} ``] + So, [`` [$hr1] \text{ hr} = [$min1] \text{ min} ``] We know [` 1 \text{ minutes} = 60 \text{ seconds} `]. Assume [`x \text{ min} = [$sec2] \text{ sec} `]. We have: @@ -129,7 +129,7 @@ We know [` 1 \text{ minutes} = 60 \text{ seconds} `]. Assume [`x \text{ min} = [ \end{aligned} ``] -*Solution:* [`` [$sec2] \text{ sec} = [$min2] \text{ min} ``] + So, [`` [$sec2] \text{ sec} = [$min2] \text{ min} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime30.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime30.pg index c01fb94d83..ad80729edf 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime30.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(conversion_time) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time','fraction') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -54,13 +58,9 @@ BEGIN_PGML Do the following unit conversions. Use fractions in your answer when needed. ----- - - [`` [$hr1] \text{ hours} = ``] [__________]{$min1} [`` \text{ minutes} ``] - ----- +a. [`` [$hr1] \text{ hours} = ``] [__________]{$min1} [`` \text{ minutes} ``] - [`` [$min2] \text{ minutes} = ``] [__________]{$hr2} [`` \text{ hours} ``] +b. [`` [$min2] \text{ minutes} = ``] [__________]{$hr2} [`` \text{ hours} ``] END_PGML @@ -84,7 +84,7 @@ To convert [` [$hr1] `] hours to minutes, we will use [` \frac{60 \text{ min}}{1 \end{aligned} ``] -*Solution:* [`` [$hr1] \text{ hr} = [$min1] \text{ min} ``] + So, [`` [$hr1] \text{ hr} = [$min1] \text{ min} ``] Next, to convert [` [$min2] `] minutes to hours, we will use [` \frac{1 \text{ hr}}{60 \text{ min}} `], so the unit *min* will cancel: @@ -99,7 +99,7 @@ Next, to convert [` [$min2] `] minutes to hours, we will use [` \frac{1 \text{ h \end{aligned} ``] -*Solution:* [`` [$min2] \text{ min} = [$hr2] \text{ hr} ``] + So, [`` [$min2] \text{ min} = [$hr2] \text{ hr} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime40.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime40.pg index dc1ce457fb..64251347a9 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime40.pg @@ -8,16 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(conversion_time) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time','fraction') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -66,13 +70,9 @@ BEGIN_PGML It's given that [` 1 \text{ minute} = 60 \text{ seconds} `]. Do the following unit conversions. Use mixed numbers (like 1 1/2) in your answer when needed. ----- - - [`` [$min1Display] \text{ minutes} = ``] [__________]{$sec1} [`` \text{ seconds} ``] - ----- +a. [`` [$min1Display] \text{ minutes} = ``] [__________]{$sec1} [`` \text{ seconds} ``] - [`` [$sec2] \text{ seconds} = ``] [__________]{$min2Display} [`` \text{ minutes} ``] +b. [`` [$sec2] \text{ seconds} = ``] [__________]{$min2Display} [`` \text{ minutes} ``] END_PGML @@ -99,7 +99,7 @@ To convert [` [$min1] `] minutes to seconds, we will use [` \frac{60 \text{ sec} \end{aligned} ``] -*Solution:* [`` [$min1Display] \text{ min} = [$sec1] \text{ sec} ``] + So, [`` [$min1Display] \text{ min} = [$sec1] \text{ sec} ``] Next, to convert [` [$sec2] `] seconds to minutes, we will use [` \frac{1 \text{ min}}{60 \text{ sec}} `], so the unit *sec* will cancel: @@ -115,7 +115,7 @@ Next, to convert [` [$sec2] `] seconds to minutes, we will use [` \frac{1 \text{ \end{aligned} ``] -*Solution:* [`` [$sec2] \text{ sec} = [$min2] \text{ min} ``] + So, [`` [$sec2] \text{ sec} = [$min2] \text{ min} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime50.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime50.pg index d527569353..656f8bee3d 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime50.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime50.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(conversion_time) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -45,8 +49,6 @@ BEGIN_PGML Do the following unit conversion. ----- - [`` [$hr] \text{ hours} = ``] [__________]{$sec} [`` \text{ seconds} ``] END_PGML @@ -74,7 +76,7 @@ Next, we change the given number [` [$hr] \text{ hours} `] into a fraction, [` \ \end{aligned} ``] -*Solution:* [`` [$hr] \text{ hr} = [$sec] \text{ sec} ``] + So, [`` [$hr] \text{ hr} = [$sec] \text{ sec} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime60.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime60.pg index 64d878b46a..6125f847cf 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime60.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime60.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(conversion_time) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -45,8 +49,6 @@ BEGIN_PGML Do the following unit conversion. ----- - [`` [$hr] \text{ hours} = ``] [__________]{$sec} [`` \text{ seconds} ``] END_PGML @@ -74,7 +76,7 @@ Next, we change the given number [` [$hr] \text{ hours} `] into a fraction, [` \ \end{aligned} ``] -*Solution:* [`` [$hr] \text{ hr} = [$sec] \text{ sec} ``] + So, [`` [$hr] \text{ hr} = [$sec] \text{ sec} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime70.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime70.pg index 1fb4ad8e35..67d9e14c24 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime70.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime70.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(conversion_time) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -45,8 +49,6 @@ BEGIN_PGML Do the following unit conversion. ----- - [`` [$sec] \text{ seconds} = ``] [__________]{$hr} [`` \text{ hours} ``] END_PGML @@ -74,7 +76,7 @@ Next, we change the given number [` [$sec] \text{ seconds} `] into a fraction, [ \end{aligned} ``] -*Solution:* [`` [$sec] \text{ sec} = [$hr] \text{ hr} ``] + So, [`` [$sec] \text{ sec} = [$hr] \text{ hr} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime80.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime80.pg index 330595868d..ce25929000 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime80.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime80.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(conversion_time) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -45,8 +49,6 @@ BEGIN_PGML Do the following unit conversion. Use decimals in your answer if needed. ----- - [`` [$sec] \text{ seconds} = ``] [__________]{$hr} [`` \text{ hours} ``] END_PGML @@ -74,7 +76,7 @@ Next, we change the given number [` [$sec] \text{ seconds} `] into a fraction, [ \end{aligned} ``] -*Solution:* [`` [$sec] \text{ sec} = [$hr] \text{ hr} ``] + So, [`` [$sec] \text{ sec} = [$hr] \text{ hr} ``] ####Shortcut diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime90.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime90.pg index 4ebc53e8da..3b810b9a07 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime90.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTime90.pg @@ -7,16 +7,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## MLT(conversion_time) -## Level(1) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,7 +29,9 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "parserNumberWithUnits.pl", +# "PCinacros.pl", + "PGcourse.pl", ); ############################################## @@ -77,7 +81,7 @@ Next, we change the given number [` [$week] \text{ weeks} `] into a fraction, [` \end{aligned} ``] -*Solution:* [`` [$week] \text{ weeks} = [$sec] \text{ sec} ``] +[`` [$week] \text{ weeks} = [$sec] \text{ sec} ``] ####Shortcut @@ -93,7 +97,7 @@ Similarly, we do: [`` [$min] \text{ min} = [$min] \cdot 60 \text{ sec} = [$sec] \text{ sec} ``] -*Solution:* [`` [$week] \text{ weeks} = [$sec] \text{ sec} ``] +[`` [$week] \text{ weeks} = [$sec] \text{ sec} ``] END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication10.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication10.pg index 636fcc0050..ed47a7637f 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication10.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication10.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time','fraction','application') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +31,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication20.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication20.pg index 228a85610b..6fa59e9ca7 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication20.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication20.pg @@ -9,15 +9,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('rate','proportion','unit','conversion','time','fraction','application') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -28,8 +31,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", "contextFraction.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication30.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication30.pg index 4fab74cf3d..b5237f05e9 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication30.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication30.pg @@ -8,15 +8,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','time','application') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -27,8 +30,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", +# "contextFraction.pl", +# "parserNumberWithUnits.pl", "PCCmacros.pl", - "PGcourse.pl" + "PGcourse.pl", ); ############################################## @@ -53,7 +58,7 @@ BEGIN_PGML A machine can produce a nail every [`[$eachSec]`] seconds. If the machine keeps running for [`[$totalDay]`] days without stop, how many nails can be produced? -*Solution:* The machine can produce [__________]{$num} nails in [`[$totalDay]`] days. +The machine can produce [__________]{$num} nails in [`[$totalDay]`] days. END_PGML @@ -82,7 +87,7 @@ Now we can do division: [`` [$totalSec] \text{ sec} \div [$eachSec] \text{ sec} = [$num] \text{ nails} ``] -*Solution:* The machine can produce [`[$num]`] nails in [`[$totalDay]`] days. +The machine can produce [`[$num]`] nails in [`[$totalDay]`] days. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication40.pg b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication40.pg index 5ddc96a6be..e1269ee0a1 100644 --- a/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication40.pg +++ b/OpenProblemLibrary/PCC/BasicMath/UnitConversion/UnitConversionTimeApplication40.pg @@ -10,15 +10,18 @@ # # ENDDESCRIPTION -## DBCCSS('5.MD.1') -## DBsubject(Arithmetic) -## DBchapter(Units) -## DBsection(Conversions) -## Institution(PCC) -## Author(Carl Yao) -## Level(3) -## MO(1) +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Real Numbers') ## KEYWORDS('unit','conversion','time','application','decimal') +## DBCCSS('5.MD.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') ############################################## @@ -29,7 +32,10 @@ loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", - "PGcourse.pl" +# "contextFraction.pl", +# "parserNumberWithUnits.pl", +# "PCCmacros.pl", + "PGcourse.pl", ); ############################################## @@ -48,7 +54,7 @@ BEGIN_PGML Each second, an atom clock runs [`[$eachSec]`] second slower than usual. This clock and a normal clock start running side by side. After [`[$numDays]`] days, how much slower would the slower clock run compared to the normal clock? -*Solution:* After [`[$numDays]`] days, the slower clock would be [___________]{$ans} seconds slower than the normal clock. (Don't round your answer.) +After [`[$numDays]`] days, the slower clock would be [___________]{$ans} seconds slower than the normal clock. (Don't round your answer.) END_PGML @@ -74,7 +80,7 @@ So [`[$numDays]`] days is equivalent to [`[$numDays*24*60*60]`] seconds. Each se [`` [$eachSec] \cdot [$numDays*24*60*60] = [$ans] ``] -*Solution:* After [`[$numDays]`] days, the slower clock would be [`[$ans]`] seconds slower than the normal clock. +After [`[$numDays]`] days, the slower clock would be [`[$ans]`] seconds slower than the normal clock. END_PGML_SOLUTION diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph10.pg new file mode 100644 index 0000000000..58538062ef --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph10.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Average Rate of Change: Increasing and Decreasing Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserRadioButtons.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$A = random(20,40,1); +$sign = random(-1,1,2); +$A = $sign*$A; + +$b = random(0.5,1.3,0.2); + +$func = Formula("50+$A*($b**x)"); +$top = max(50,50+$A*($b**4),50+$A); +$top = 10*round($top/10); +$gr = init_graph(-1,-10,4,$top,axes=>[0,0],grid=>[5,($top+10)/10],size=>[400,400]); + +add_functions($gr, "$func for x in <-1,4> using color:blue and weight:2"); + +if ($A < 1) {$answer = "concave down"; $side = "lower";} +else {$answer = "concave up"; $side = "upper";}; + +$radio = RadioButtons( + ["concave up","concave down"], + $answer, # correct answer + last => ["concave up","concave down"], # can be a list +); + + + + + +############################################## + +$refreshCachedImages = 1; + +BEGIN_PGML + +Does the function given by this graph appear to be concave down or concave up? + +[@EnlargeImageStatementPGML()@]** + +>> [@image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + + + [@$radio->buttons()@]* + + +END_PGML + + +############################################## + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +This graph has a cavity on its [$side] side, so the function is [$answer]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph20.pg new file mode 100644 index 0000000000..4aca6d4579 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph20.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, find where the function +# is concave-up/down. +# +# Last update: Carl Yao 03/31/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +do { + $a = random(0.01,1,0.01)*random(-1,1,2); + $x1 = random(-4,-1,1); + do {$x2 = random(1,4,1);} until (abs($x1)!=abs($x2)); + $b = random(-3,3,1); + $func = Compute("$a*x**3-1.5*$a*($x1+$x2)*x**2+3*$a*$x1*$x2*x+$b")->reduce; + $y1 = $func->eval(x=>$x1); + $y2 = $func->eval(x=>$x2); + $inflectionX = ($x1+$x2)/2; + $inflectionY = $func->eval(x=>$inflectionX); +} until ( (abs($y1)<10) && (abs($y2)<10) && ($inflectionX==int($inflectionX)) ); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([2*$x1,2*$x2],[$y1,$y2,0],centerOrigin=>0); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $leftBound = $min[0]-1; + $rightBound = $max[0]+1; + + add_functions($gr[$i], "$func for x in ($leftBound,$rightBound) using color:blue and weight:1"); + + $gr[$i]->stamps( closed_circle($inflectionX,$inflectionY,'blue') ); + $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); +} + +Context("Interval"); + +if ($a>0) { + $ALT = "This is a graph of a function starting at the bottom left, going up till the point ($x1,$y1), turning down and passing the inflection point ($inflectionX, $inflectionY), continuing down till the point ($x2,$y2), and then turning up toward the top right."; + $ansDown = Compute("(-inf,$inflectionX)"); + $ansUp = Compute("($inflectionX,inf)"); +} else { + $ALT = "This is a graph of a function starting at the top left, going down till the point ($x1,$y1), turning up and passing the inflection point ($inflectionX, $inflectionY), continuing up till the point ($x2,$y2), and then turning down toward the bottom right."; + $ansUp = Compute("(-inf,$inflectionX)"); + $ansDown = Compute("($inflectionX,inf)"); +} + + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +A function's graph is shown below. A few points are highlighted for your reference. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +[@KeyboardInstructions('If the answer includes more than one interval write the intervals separated by the union symbol, which you can type as [|U|]*. If the answer uses [`\infty`], you may type it as [|inf|]*.')@]** + +The function is concave-up in the interval [_____________________]{$ansUp}. + +The function is concave-down in the interval [_____________________]{$ansDown}. + +END_PGML +############################################## + +BEGIN_PGML_SOLUTION + +The function is concave-up in the interval [`[$ansUp]`]. + +The function is concave-down in the interval [`[$ansDown]`]. + +We always use open intervals when we identify where a function is concave-up or concave-down. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph30.pg new file mode 100644 index 0000000000..974d597ec9 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromGraph30.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, find where the function +# is concave-up/down. +# +# Last update: Carl Yao 03/31/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +do { + $a = random(0.01,0.05,0.01)*random(-1,1,2); + $x1 = random(-4,-2,1); + do {$x2 = random(2,4,1);} until (abs($x1)!=abs($x2)); + $func = Compute("$a/12*x**4-$a*($x1+$x2)/6*x**3+$a/2*$x1*$x2*x**2")->reduce; + $y1 = $func->eval(x=>$x1); + $y2 = $func->eval(x=>$x2); + $o = $a/3; + $p = -$a*($x1+$x2)/2; + $q = $a*$x1*$x2; + $d = ($p)**2-4*$o*$q; + $x3 = Real((-$p+sqrt($d))/(2*$o)); + $x4 = Real((-$p-sqrt($d))/(2*$o)); + ($x3,$x4) = num_sort($x3,$x4); + $y3 = $func->eval(x=>$x3); + $y4 = $func->eval(x=>$x4); +} until ( (abs($y1)<10) && (abs($y2)<10) && (abs($y3)<10) && (abs($y4)<10) ); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([2*$x1,2*$x2],[$y1,$y2,0,$y3,$y4],centerOrigin=>0); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $leftBound = $min[0]-1; + $rightBound = $max[0]+1; + + add_functions($gr[$i], "$func for x in ($leftBound,$rightBound) using color:blue and weight:1"); + + $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); + $gr[$i]->stamps( closed_circle($x3,$y3,'blue') ); + $gr[$i]->stamps( closed_circle($x4,$y4,'blue') ); + $gr[$i]->stamps( closed_circle(0,0,'blue') ); +} + +Context("Interval"); + +if ($a>0) { + $ALT = "This is a graph of a function starting at the top left, going down till the point ($x3,$y3), turning up to the inflection point ($x1,$y1), continuing up till the point (0,0), turning down to the inflection point ($x2,$y2), continuing down till the point ($x4,$y4), and finally turning up to the top right."; + $ansDown = Compute("($x1,$x2)"); + $ansUp = Compute("(-inf,$x1)U($x2,inf)"); +} else { + $ALT = "This is a graph of a function starting at the bottom left, going up till the point ($x3,$y3), turning down to the inflection point ($x1,$y1), continuing down till the point (0,0), turning up to the inflection point ($x2,$y2), continuing up till the point ($x4,$y4), and finally turning down to the bottom right."; + $ansUp = Compute("($x1,$x2)"); + $ansDown = Compute("(-inf,$x1)U($x2,inf)"); +} + + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +A function's graph is shown below. A few points are highlighted for your reference. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +[@KeyboardInstructions('If the answer includes more than one interval write the intervals separated by the union symbol, which you can type as [|U|]*. If the answer uses [`\infty`], you may type it as [|inf|]*.')@]** + +The function is concave-up in the interval [_____________________]{$ansUp}. + +The function is concave-down in the interval [_____________________]{$ansDown}. + +END_PGML +############################################## + +BEGIN_PGML_SOLUTION + +The function is concave-up in the interval [`[$ansUp]`]. + +The function is concave-down in the interval [`[$ansDown]`]. + +We always use open intervals when we identify where a function is concave-up or concave-down. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromTable10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromTable10.pg new file mode 100644 index 0000000000..b20d23d826 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityFromTable10.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Average Rate of Change: Increasing and Decreasing Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserRadioButtons.pl", + "PGML.pl", + "pccTables.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$A = random(20,40,1); +$sign = random(-1,1,2); +$A = $sign*$A; + +$b = random(0.5,1.3,0.2); + +@table = (); + +for my $i (0..4) { +$table[$i] =1/100*round((50+$A*($b**$i))*100); +} + + +if ($A < 1) {$answer = "concave down";} +else {$answer = "concave up";}; + +$radio = RadioButtons( + ["concave up","concave down"], + $answer, # correct answer + last => ["concave up","concave down"], # can be a list +); + + + + + +############################################## + +BEGIN_PGML + +Does the function given by the numbers in this table appear to be concave down or concave up? + +END_PGML + +BEGIN_TEXT +$PAR +\{DataTable( +[ +[{data=>"\(t\)", header=>'RH'}, "0", "1", "2", "3", "4"], +[{data=>"\(f(t)\)", header=>'RH',rowcss=>"border-bottom:solid 1px;"}, $table[0], $table[1], $table[2], $table[3], $table[4]] +], +allcellcss=>"padding:6pt; border-top:solid 1px;" +) +\} + +END_TEXT + +BEGIN_PGML + + [@ $radio->buttons() @]* + + +END_PGML + + +############################################## + + +ANS( $radio->cmp() ); + + +############################################## + +$incdec = ($A > 1) ? "increasing" : "decreasing"; + +BEGIN_PGML_SOLUTION + +To examine concavity of a function given by a table, consider the rates of change from one entry to the next. Our rates of change are + + [``\frac{[@$table[1]@]-[@$table[0]@]}{1-0}, +\frac{[@$table[2]@]-[@$table[1]@]}{2-1}, +\frac{[@$table[3]@]-[@$table[2]@]}{3-2}, +\frac{[@$table[4]@]-[@$table[3]@]}{4-3}, ``] + +which are + + [``[@$table[1]-$table[0]@], +[@$table[2]-$table[1]@], +[@$table[3]-$table[2]@], +[@$table[4]-$table[3]@]``] + +We can see that these rates are [$incdec], so the function is [$answer]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext10.pg new file mode 100644 index 0000000000..1ae593dfdf --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext10.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Average Rate of Change: Increasing and Decreasing Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserRadioButtons.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + + +$change = "increasing"; +$concavity = "concave up"; + +$radioChange = RadioButtons( + ["increasing","decreasing"], + $change, # correct answer + last => ["increasing","decreasing"], # can be a list +); + + + +$radioConcavity = RadioButtons( + ["concave up","concave down"], + $concavity, # correct answer + last => ["concave up","concave down"], # can be a list +); + + + + +############################################## + + +BEGIN_PGML + +When an invasive species invades a new territory, the population starts off small and increases slowly. When there are more individuals the population starts to grow more rapidly. + + +a) Is this situation describing a function that is increasing or decreasing? + + [@$radioChange->buttons()@]* + +a) Is this situation describing a function that is concave up or concave down? + + [@ $radioConcavity->buttons() @]* + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=0; + + +ANS( $radioChange->cmp() ); +ANS( $radioConcavity->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +The population becomes larger as time passes, so the function is increasing. + +Since the population is increasing at a rate that increases as time increases, the function is concave up. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext20.pg new file mode 100644 index 0000000000..14c6ea1c24 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext20.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Average Rate of Change: Increasing and Decreasing Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserRadioButtons.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + + +$change = "decreasing"; +$concavity = "concave up"; + +$radioChange = RadioButtons( + ["increasing","decreasing"], + $change, # correct answer + last => ["increasing","decreasing"], # can be a list +); + + + +$radioConcavity = RadioButtons( + ["concave up","concave down"], + $concavity, # correct answer + last => ["concave up","concave down"], # can be a list +); + + + + +############################################## + + +BEGIN_PGML + +When a pie comes out of the oven, it cools off very rapidly at first, but then cools off more slowly as it gets closer to room temperature. + +a) Is this situation describing a function that is increasing or decreasing? + + [@$radioChange->buttons()@]* + +a) Is this situation describing a function that is concave up or concave down? + + [@ $radioConcavity->buttons() @]* + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=0; + + +ANS( $radioChange->cmp() ); +ANS( $radioConcavity->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +The temperature lowers as time passes, so the function is decreasing. + +Since the temperature is decreasing at a decreasing rate, the function is concave up. Another way to put this is that the function is increasing with a _negative_ rate that becomes less negative over time. So the rate of increase is technically increasing once you think about how these terms apply to negative numbers. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext30.pg new file mode 100644 index 0000000000..37992cf17c --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext30.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Average Rate of Change: Increasing and Decreasing Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserRadioButtons.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +@gr = ( ); +for my $i (0..1) { + $gr[$i] = init_graph(0,0,10,10, + size=>[400,400] + ); +} + +$func0 = Compute("7/64*(x-8)**2+1"); +add_functions($gr[0], "$func0 for x in <0,8> using color:blue and weight:2"); +$gr[0]->moveTo(0,8); +for my $i (0..3) { + $gr[0]->lineTo($i+1,$func0->eval(x=>$i),'red'); + $gr[0]->lineTo($i+1,$func0->eval(x=>$i+1),'red'); +} +$gr[0]->lb( new Label(0,9,'Amount of Water','black','left','middle')); +$gr[0]->lb( new Label(9,0,'Time','black','left','bottom')); + +$func1 = Compute("-1/8*x**2+8"); +add_functions($gr[1], "$func1 for x in <0,8> using color:blue and weight:2"); +$gr[1]->moveTo(4,$func1->eval(x=>4)); +for my $i (4..7) { + $gr[1]->lineTo($i+1,$func1->eval(x=>$i),'red'); + $gr[1]->lineTo($i+1,$func1->eval(x=>$i+1),'red'); +} +$gr[1]->lb( new Label(0,9,'Height','black','left','middle')); +$gr[1]->lb( new Label(9,0,'Time','black','left','bottom')); + +@problems = ( + ["Some taps are turned on to drain water from a tank. As there is less and less water left, water pressure decreases, causing the taps to drain water at a slower rate. A function models the amount of water left in the tank as time passes.", + "decreasing", + "concave up", + "The amount of water in the tank is being drained, so the function is decreasing.", + "The amount of water (y-value) decreases at a slower and slower rate, so the function is concave-up.", + "This is the graph of a concave-up and decreasing curve. A few rate-of-change triangles are drawn, showing the y-value decreases at a slower and slower rate.", + ], + ["An object drops from an airplane. The function models the height as time passes until the object hits the ground.", + "decreasing", + "concave down", + "The height of the object becomes lower and lower as time passes, so the function is decreasing.", + "The height (y-value) decreases at a faster and faster rate, so the function is concave-down.", + "This is the graph of a concave-down and decreasing curve. A few rate-of-change triangles are drawn, showing the y-value decreases at a faster and faster rate.", + ], +); + +$i = random(0,1,1); +$problem = $problems[$i][0]; +$solution1 = $problems[$i][3]; +$solution2 = $problems[$i][4]; +$graph = $gr[$i]; +$ALT = $problems[$i][5]; + +$radioChange = RadioButtons( + ["increasing","decreasing"], + $problems[$i][1], # correct answer + last => ["increasing","decreasing"], # can be a list +); + +$radioConcavity = RadioButtons( + ["concave up","concave down"], + $problems[$i][2], # correct answer + last => ["concave up","concave down"], # can be a list +); + + +############################################## + + +BEGIN_PGML + +[$problem] + +a) Is this situation describing a function that is increasing or decreasing? + + [@$radioChange->buttons()@]* + +a) Is this situation describing a function that is concave up or concave down? + + [@ $radioConcavity->buttons() @]* + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=0; + + +ANS( $radioChange->cmp() ); +ANS( $radioConcavity->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +[$solution1] + +[$solution2] + +>>[@image(insertGraph($graph), width=>250, height=>250, tex_size=>250, extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext40.pg new file mode 100644 index 0000000000..30017eaa3b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Concavity/ConcavityInContext40.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Average Rate of Change: Increasing and Decreasing Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserRadioButtons.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +@gr = ( ); +for my $i (0..1) { + $gr[$i] = init_graph(0,0,10,10, + size=>[400,400] + ); +} + +$func0 = Compute("1/8*x**2"); +add_functions($gr[0], "$func0 for x in <0,8> using color:blue and weight:2"); +$gr[0]->moveTo(4,$func0->eval(x=>4)); +for my $i (4..7) { + $gr[0]->lineTo($i+1,$func0->eval(x=>$i),'red'); + $gr[0]->lineTo($i+1,$func0->eval(x=>$i+1),'red'); +} +$gr[0]->lb( new Label(0,9,'Distance','black','left','middle')); +$gr[0]->lb( new Label(9,0,'Time','black','left','bottom')); + +$func1 = Compute("-1/8*(x-8)**2+8"); +add_functions($gr[1], "$func1 for x in <0,8> using color:blue and weight:2"); +$gr[1]->moveTo(1,$func1->eval(x=>1)); +for my $i (1..4) { + $gr[1]->lineTo($i+1,$func1->eval(x=>$i),'red'); + $gr[1]->lineTo($i+1,$func1->eval(x=>$i+1),'red'); +} +$gr[1]->lb( new Label(0,9,'Distance','black','left','middle')); +$gr[1]->lb( new Label(9,0,'Time','black','left','bottom')); + +@problems = ( + ["A runner completes a 100-meter dash race. He started from a speed of zero, and then sped up during the whole race. The function models the runner's distance from the starting line as time passes.", + "increasing", + "concave up", + "The distance increases as time passes, so the function is increasing.", + "As the runner speeds up, the distance (y-value) increases at a faster and faster rate, so the function is concave-up.", + "This is the graph of a concave-up and increasing curve. A few rate-of-change triangles are drawn, showing the y-value increases at a faster and faster rate.", + ], + ["A driver hits the break when he drives. The function models the distance traveled by the car since the break is applied, until the car stops.", + "increasing", + "concave down", + "Since the break is applied, the car still moves forward, so the function is increasing.", + "The distance (y-value) traveled increases at a slower and slower rate since the break is applied, so the function is concave-down.", + "This is the graph of a concave-down and increasing curve. A few rate-of-change triangles are drawn, showing the y-value increases at a slower and slower rate.", + ], +); + +$i = random(0,1,1); +$problem = $problems[$i][0]; +$solution1 = $problems[$i][3]; +$solution2 = $problems[$i][4]; +$graph = $gr[$i]; +$ALT = $problems[$i][5]; + +$radioChange = RadioButtons( + ["increasing","decreasing"], + $problems[$i][1], # correct answer + last => ["increasing","decreasing"], # can be a list +); + +$radioConcavity = RadioButtons( + ["concave up","concave down"], + $problems[$i][2], # correct answer + last => ["concave up","concave down"], # can be a list +); + + +############################################## + + +BEGIN_PGML + +[$problem] + +a) Is this situation describing a function that is increasing or decreasing? + + [@$radioChange->buttons()@]* + +a) Is this situation describing a function that is concave up or concave down? + + [@ $radioConcavity->buttons() @]* + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=0; + + +ANS( $radioChange->cmp() ); +ANS( $radioConcavity->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +[$solution1] + +[$solution2] + +>>[@image(insertGraph($graph), width=>250, height=>250, tex_size=>250, extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/CalculatorFreeLogs.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/CalculatorFreeLogs.pg new file mode 100644 index 0000000000..83de91ce7d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/CalculatorFreeLogs.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "unorderedAnswer.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("LimitedNumeric"); +Context()->operators->redefine("/"); + + +############################################## + +BEGIN_PGML + +You should be able to evaluate each of these expressions _without a calculator_. + +END_PGML +BEGIN_TEXT +$PAR + +\{ +DataTable( +[ +["\log 1","=",[ans_rule(8),noencase=>1]], +["\log 0.1","=",[ans_rule(8),noencase=>1]], +["\ln\left(\textrm{e}^3\right)","=",[ans_rule(8),noencase=>1]], +["\log\sqrt{10}","=",[ans_rule(8),noencase=>1]], +["\log\left(10^{100}\right)","=",[ans_rule(8),noencase=>1]], +["\ln 1","=",[ans_rule(8),noencase=>1]], +["\ln \sqrt[3]{\textrm{e}}","=",[ans_rule(8),noencase=>1]] +], +encase=>['\(','\)'], +) +\} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS( Compute("0")->cmp); +ANS( Compute("-1")->cmp); +ANS( Compute("3")->cmp); +ANS( Compute("1/2")->cmp); +ANS( Compute("100")->cmp); +ANS( Compute("0")->cmp); +ANS( Compute("1/3")->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +We need to know that [`\log`] is the logarithm with base [`10`], and [`\ln`] is the logarithm with base [`e`]. We also need to know that for any base [`b>0`], it's true that [`\log_b(b^x)=x`]. + +[`\log(1)=\log(10^0)=0`]. (It doesn't matter what the base is, [`\log_b(1)`] always equals [`0`].) + +[`\begin{aligned} +\log(0.1)&=\log\left(\frac{1}{10}\right)\\ +&= -\log(10)\\ +&=-1 +\end{aligned}`] + +[`\begin{aligned} +\ln\left(e^3\right)&=3 +\end{aligned}`] + +[`\begin{aligned} +\log\sqrt{10}&=\log\left(10^{1/2}\right)\\ +&= \frac12 +\end{aligned}`] + +[`\begin{aligned} +\log\left(10^{100}\right)&=100 +\end{aligned}`] + +[`\ln(1)=\ln(e^0)=0`]. (It doesn't matter what the base is, [`\log_b(1)`] always equals [`0`].) + + +[`\begin{aligned} +\ln\sqrt[3]{e}&=\ln\left(e^{1/3}\right)\\ +&= \frac13 +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ContPopulation.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ContPopulation.pg new file mode 100644 index 0000000000..bd763b002b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ContPopulation.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "contextPercent.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(t=>'Real'); + +$initial = random(15000,45000,1000); +$r = random(3,8,0.1); + + +############################################## + +BEGIN_PGML + +A population grows from an initial level of [`[$initial]`] individuals at a continuous growth rate of [`[$r]%`] per year. + +a) Find a formula for [`P(t)`], the population in year [`t`]. Your answer should be in the form *P(t)=...*. + + [_____________________] + +a) By what relative growth rate does the population increase each year? + + [_____________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("Numeric")->variables->are(t=>"Real"); +parser::Assignment->Allow; +parser::Assignment->Function("P"); +Context()->flags->set(tolType=>absolute,tolerance=>0.001); + +$ans1 = Formula("P(t)=$initial*e^($r/100*t)")->reduce; +$ans2 = (2.718281828**($r/100)-1); + + +ANS( $ans1->cmp ); + +Context("Percent"); +Context()->flags->set(decimalPlaces => 3); +Context()->flags->set(tolerance => .000005,); +ANS( Percent($ans2)->cmp ); + +############################################## + +BEGIN_PGML_SOLUTION + +We've been asked for an exponential formula and have an initial value and a continuous growth rate. So we should use the form [`P(t)=a\,e^{kt}`]. We have [`P(t)=[$initial]\,e^{[@$r/100@]t}`]. + +Next we are asked for the (regular, not continuous) relative growth rate, often referred to as [`r`]. Using the basic relations between the quantities that arise when working with exponential quantities: + + [`\begin{aligned} +r&=b-1\\ +&=e^k-1\\ +&=e^{[@$r/100@]}-1\\ +&\approx[$ans2]\\ +&\approx[@Percent($ans2)@] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ContinuousDoublingTime.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ContinuousDoublingTime.pg new file mode 100644 index 0000000000..9d06da83ae --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ContinuousDoublingTime.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "parserNumberWithUnits.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->variables->are(t=>'Real'); +parser::Assignment->Allow; +parser::Assignment->Function("N"); + + +$a2005 = 353.2; +$a1998 = 36.7; + +$k = ln($a2005/$a1998)/7; + +$N = Formula("N(t)=$a1998*e^($k t)"); + +$kPercent = Compute($k*100); + +$doublingTime = ln(2)/$k; +$doublingTime = NumberWithUnits("$doublingTime","yr"); + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +In July 2005, the Internet was linked by a global network of about \($a2005\) million host computers. The number of host computers has been growing approximately exponentially and was about \($a1998\) million in July 1998. + + +$PAR + +$BBOLD(a.)$EBOLD Find a formula for \(N\), the number of internet host computers (measured in millions) as an exponential function of \(t\), the number of years since July 1998. Your answer should be in the form $BBOLD N(t)=...$EBOLD. $PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + +$PAR +$BBOLD(b.)$EBOLD At what continuous annual percent rate does \(N\) increase? $PAR + +$SPACE $SPACE $SPACE \{ans_rule(6)\}$PERCENT + +$PAR +$BBOLD(c.)$EBOLD What is the doubling time? Use $BBOLD yr$EBOLD for years. +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(10)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + + + + +ANS( $N->cmp() ); + +ANS( $kPercent->cmp() ); + +ANS( $doublingTime->cmp() ); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Domain.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Domain.pg new file mode 100644 index 0000000000..baea5e3368 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Domain.pg @@ -0,0 +1,81 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(2,20,1); +$b = random(4,30,1); + +$f = Formula("$a*ln(x-$b)"); + +Context("Interval"); +$domain = Compute("($b,INF)"); + + +############################################## + +BEGIN_PGML + +Find the domain of the function, using interval notation. If you need to enter [`\infty`], type *INF*. If you need to use the union symbol [`\cup`], type *U*. + + [`f(x)=[$f]`] + + [________________________] + +END_PGML + +############################################## + +ANS( $domain->cmp ); + +############################################## + +BEGIN_PGML_SOLUTION + +For the [`\ln`] to have an acceptable input, we need [`x-[$b]>0`]. + + [`\begin{aligned} +x-[$b]&>0\\ +x&>[$b] +\end{aligned}`] + +So the domain of [`f`] is [`[$domain]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Domain2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Domain2.pg new file mode 100644 index 0000000000..3d9f49905d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Domain2.pg @@ -0,0 +1,74 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(2,20,1); +$b = random(4,30,1); + +$f = Formula("ln($a x^2+$b)"); + +Context("Interval"); +$domain = Compute("(-INF,INF)"); + + +############################################## + +BEGIN_PGML + +Find the domain of the function, using interval notation. If you need to enter [`\infty`], type *INF*. If you need to use the union symbol [`\cup`], type *U*. + + [`f(x)=[$f]`] + + [_________________________] + +END_PGML + + +############################################## + +ANS( $domain->cmp ); + +############################################## + +BEGIN_PGML_SOLUTION + +For the [`\ln`] to have an acceptable input, we need [`[$a] x^2+[$b]>0`]. But since [`x^2`] is nonnegative no matter what [`x`] is, and since both [`[$a]`] and [`[$b]`] are positive, it is automatic that [`[$a] x^2+[$b]>0`] no matter what [`x`] is. So any [`x`]-value is a valid input, and the domain of [`f`] is [`[$domain]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Domain3.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Domain3.pg new file mode 100644 index 0000000000..0b1052b555 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Domain3.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(2,20,1); +$b = random(4,30,1); + +$f = Formula("ln($a ln(x)+$b)"); + +Context("Interval"); +$domain = Compute("(e^(-$b/$a),INF)"); + + +############################################## + +BEGIN_PGML + +Find the domain of the function, using interval notation. If you need to enter [`\infty`], type *INF*. If you need to use the union symbol [`\cup`], type *U*. + + [`f(x)=[$f]`] + + [________________________] + +END_PGML + +############################################## + +ANS( $domain->cmp ); + +############################################## + +BEGIN_PGML_SOLUTION + +For the outer [`\ln`] to have an acceptable input, we need [`[$a]\ln(x)+[$b]>0`]. + + [`\begin{aligned} +[$a]\ln(x)+[$b]&>0\\ +[$a]\ln(x)&>-[$b]\\ +\ln(x)&>-{\frac{[$b]}{[$a]}}\\ +x&>e^{-[$b]/[$a]} +\end{aligned}`] + +We should also be concerned about which [`x`] will make the inner [`\ln`] have an acceptable input, but if [`x>e^{-[$b]/[$a]}`], then [`x`] is automatically positive, so it will also be acceptable input for the inner [`\ln`]. + +So the domain of [`f`] is [`\left(e^{-[$b]/[$a]},\infty\right)`], which is about [`[$domain]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ExponentsToLns.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ExponentsToLns.pg new file mode 100644 index 0000000000..bc529f4232 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ExponentsToLns.pg @@ -0,0 +1,151 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserMultiAnswer.pl", + "parserFunction.pl", + "niceTables.pl", + "PGML.pl", + "PGcourse.pl", +); + + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(4.1,8.1,0.2); +$b = round(2.718281828**$a); + + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override log() to sneakily return sin(x) when evaluated + # + sub log { + my $self = shift; + my $x = shift; + return sin($x); + } + + # + # end of subclass + # + package main; + + + # + # make log() use our subclass + # + Context()->functions->set(log=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # + + +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->operators->undefine('*','+','-','/'); + + +$multians = MultiAnswer( +Compute($a), +Compute("ln($b)")) +->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $f1stu, $f2stu ) = @{$student}; + my ( $f1, $f2 ) = @{$correct}; + if ( ($f1 == $f1stu && $f2 == $f2stu) || + ($f1 == $f2stu && $f2 == $f1stu) ) { + return 1; + } else { + if ($f1stu == $f2stu) { + Value::Error("This equation is a true equation, but it is not what was asked for."); + } else { + return 0; + } + } + } +); + + +############################################## + +BEGIN_PGML + +Rewrite the statement using logarithms instead of exponents. + +END_PGML +BEGIN_TEXT +$PAR + +\{ +LayoutTable( +[ +["\(e^{$a}\)","\({}={}\)","\($b\)"], +[$multians->ans_rule(6),"\({}={}\)",$multians->ans_rule(12)], +], +allcellcss=>'padding:0px; padding-bottom:6px;' +) +\} + +END_TEXT + +############################################## + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS( $multians->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +When one side of an equation is a number raised to a power, then that base can be moved to the other side of the equation in the form of a logarithm. That is + + [`\begin{aligned} +b^{\text{left}}&=\text{right}\\ +\underset{\hookrightarrow}{b}^{\text{left}}&=\text{right}\\ +\text{left} &= \log_b(\text{right}) +\end{aligned}`] + +So we have the equation + + [`[$a]=\ln([$b])`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ExponentsToLogs2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ExponentsToLogs2.pg new file mode 100644 index 0000000000..1cf0f9e88c --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/ExponentsToLogs2.pg @@ -0,0 +1,136 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserMultiAnswer.pl", + "parserFunction.pl", + "niceTables.pl", + "PGML.pl", + "unorderedAnswer.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(x=>'Real',y=>'Real',t=>'Real',P=>'Real'); +Context()->variables->set(y=>{limits=>[0.1,10]}); +Context()->variables->set(P=>{limits=>[0.1,10]}); + +$multians = MultiAnswer(Formula("x"), Formula("ln(y)"))->with( + singleResult => 0, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $f1stu, $f2stu ) = @{$student}; + my ( $f1, $f2 ) = @{$correct}; + if ( ($f1 == $f1stu && $f2 == $f2stu) || + ($f1 == $f2stu && $f2 == $f1stu) ) { + return [1,1]; + } else { + if ($f1 == $f1stu || $f2 == $f1stu) { + return [1,0]; + } elsif ($f1 == $f2stu || $f2 == $f2stu) { + return [0,1]; + } else { + return [0,0]; + } + } + } +); + + +############################################## + +BEGIN_PGML + +Rewrite the statements using logarithms instead of exponents. + +END_PGML +BEGIN_TEXT +$PAR + +\{ +LayoutTable( +[ +["\(e^x\)","\(=\)","\(y\)"], +[$multians->ans_rule(6),"\(=\)",$multians->ans_rule(6)], +], +allcellcss=>"padding:0pt;", +)\} + +$PAR + +\{ +LayoutTable( +[ +["\(10^t\)","\(=\)","\(P\)"], +[ans_rule(6),"\(=\)",ans_rule(6)], +], +allcellcss=>"padding:0pt;", +)\} + + +END_TEXT + +############################################## + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(formatStudentAnswers=>parsed); + + +ANS( $multians->cmp() ); + +UNORDERED_ANS( +Formula("t")->cmp(), +Formula("log(P)")->cmp(), +); + +############################################## + +BEGIN_PGML_SOLUTION + +When one side of an equation is a number raised to a power, then that base can be moved to the other side of the equation in the form of a logarithm. That is + + [`\begin{aligned} +b^{\text{left}}&=\text{right}\\ +\underset{\hookrightarrow}{b}^{\text{left}}&=\text{right}\\ +\text{left} &= \log_b(\text{right}) +\end{aligned}`] + +So we have the equations + + [`x=\ln(y)`] + +and + + [`t=\log(P)`] + +END_PGML_SOLUTION +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates1.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates1.pg new file mode 100644 index 0000000000..2383d7a12d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates1.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "contextPercent.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(0.1,8.1,0.001); +$k = random(0.2,0.9,0.01); + +$r = exp($k)-1; + +############################################## + +BEGIN_PGML + +Give the initial value [`a`], the relative growth rate [`r`], and the continuous relative growth rate [`k`]. + + [`Q=[$a]\,e^{[$k]t}`] + + [`a={}`][______________] + + [`r={}`][______________] + + [`k={}`][______________] + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("LimitedNumeric"); +$a = Compute("$a"); + +Context("Percent"); +Context()->flags->set(decimalPlaces => 3); +Context()->flags->set(tolType => "relative", tolerance=>0.001); +$k = Percent("$k"); +$r = Percent("$r"); + + +ANS($a->cmp); +ANS($r->cmp); +ANS($k->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +From the given formula, we can simply read that [`a=[$a]`] and [`k=[@($k->value)*100@]%`]. For [`r`]: + + [`\begin{aligned} +r &= b-1\\ +&= e^k-1\\ +&=e^{[@$k->value@]}-1\\ +&=[@Real(($r->value)*100)@]% +\end{aligned}`] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates2.pg new file mode 100644 index 0000000000..360a095784 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates2.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "contextPercent.pl", + "PGML.pl", + "PGcourse.pl", + +); + + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(2,8,1); +$reciprocal = random(2,10,1); + +$r = 2**(1/$reciprocal)-1; +$k = ln(1+$r); + +############################################## + +BEGIN_PGML + +Give the initial value [`a`], the relative growth rate [`r`], and the continuous relative growth rate [`k`]. + + [`Q=[$a]\cdot 2^{t/[$reciprocal]}`] + + [`a={}`][______________] + + [`r={}`][______________] + + [`k={}`][______________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("LimitedNumeric"); +$a = Compute("$a"); + +Context("Percent"); +Context()->flags->set(decimalPlaces => 3); +Context()->flags->set(tolType => "relative", tolerance=>0.001); +$k = Percent("$k"); +$r = Percent("$r"); + + +ANS($a->cmp); +ANS($r->cmp); +ANS($k->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +[`a`] is initial value: + + [`\begin{aligned} +a &= [$a]\cdot 2^{0/[$reciprocal]}\\ +&= [$a]\cdot 2^{0}\\ +&= [$a]\cdot 1\\ +&= [$a] +\end{aligned}`] + +To find [`r`] and [`k`], it would help to know the growth factor [`b`]. If we try to put the formula into the form [`Q=a\,b^t`], we can succeed and get [`Q=[$a]\left(2^{1/[$reciprocal]}\right)^t`]. So [`b=2^{1/[$reciprocal]}`]. Now: + + [`\begin{aligned} +r &= b-1\\ +&= 2^{1/[$reciprocal]}-1\\ +&\approx[@$r->value@]\\ +&\approx[@Real(($r->value)*100)@]% +\end{aligned}`] + + [`\begin{aligned} +k &= \ln(b)\\ +&= \ln\left(2^{1/[$reciprocal]}\right)\\ +&\approx[@$k->value@]\\ +&\approx[@Real(($k->value)*100)@]% +\end{aligned}`] + + + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates3.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates3.pg new file mode 100644 index 0000000000..93d652d0c6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates3.pg @@ -0,0 +1,135 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "contextPercent.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a2 = random(10,100,2); +$reciprocal = random(5,20,1); +$shift = random(1,8,1); + + +$r = exp(1/$reciprocal)-1; +$k = ln(1+$r); + + +############################################## + +BEGIN_PGML + +Give the initial value [`a`], the relative growth rate [`r`], and the continuous relative growth rate [`k`]. + + [`Q=[$a2]\,e^{(t-[$shift])/[$reciprocal]}`] + + [`a={}`][______________] + + [`r={}`][______________] + + [`k={}`][______________] + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 1; + + +$a = $a2*exp(-$shift/$reciprocal); +Context("LimitedNumeric"); +Context()->flags->set(tolerance=>0.01); +$a = Compute("$a"); +Context("Percent"); +Context()->flags->set(decimalPlaces => 3); +Context()->flags->set(tolType => "relative", tolerance=>0.001); +$k = Percent("$k"); +$r = Percent("$r"); + +ANS($a->cmp); +ANS($r->cmp); +ANS($k->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +[`a`] is initial value: + + [`\begin{aligned} +a &= [$a2]\,e^{(0-[$shift])/[$reciprocal]}\\ +&= [$a2]\,e^{-[$shift]/[$reciprocal]}\\ +&\approx [$a] +\end{aligned}`] + +To find [`r`] and [`k`], it would help to know the growth factor [`b`]. (There are other ways to find [`r`] and [`k`], but the following is one way.) We already know [`Q(0)`]. So let's also find [`Q(1)`] and compare. + + [`\begin{aligned} +Q(1) &= [$a2]\,e^{(1-[$shift])/[$reciprocal]}\\ +&\approx [@$a2*exp((1-$shift)/$reciprocal)@] +\end{aligned}`] + +Since [`b`] is used to multiply each unit of time: + + [`\begin{aligned} +Q(1) &= b\cdot Q(0)\\ +[@$a2*exp((1-$shift)/$reciprocal)@] &\approx b\cdot [$a]\\ +b&\approx [@exp($k->value)@] +\end{aligned}`] + +Now: + + [`\begin{aligned} +r &= b-1\\ +&\approx [@exp($k->value)@]-1\\ +&\approx[@$r->value@]\\ +&\approx[@Real(($r->value)*100)@]% +\end{aligned}`] + + [`\begin{aligned} +k &= \ln(b)\\ +&\approx \ln\left([@exp($k->value)@]\right)\\ +&\approx[@$k->value@]\\ +&\approx[@Real(($k->value)*100)@]% +\end{aligned}`] + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/HalvingTime.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/HalvingTime.pg new file mode 100644 index 0000000000..2044fa7fb7 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/HalvingTime.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserNumberWithUnits.pl" +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$k = random(4,30,1); + + +$halvingTime = ln(1/2)/(-$k/100); + + + +Context("LimitedNumeric"); +Context()->flags->set(tolerance=>0.01); + + + +$halvingTime = Compute("$halvingTime"); +$halvingTime = NumberWithUnits("$halvingTime","min"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +A radioactive material decays at a continuous rate of \($k\)$PERCENT per minute. Find the half-life of the substance. Use $BBOLD min$EBOLD for minutes. + + +$PAR + +$BCENTER +$SPACE $SPACE $SPACE \{ans_rule(10)\} +$ECENTER + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + + + + +ANS( $halvingTime->cmp() ); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/HalvingTime2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/HalvingTime2.pg new file mode 100644 index 0000000000..9ee5a182fd --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/HalvingTime2.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserNumberWithUnits.pl" +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$r = random(4,30,1); +$t = random(3,20,1); + +$k = ln(1-$r/100)/(-$t); + +$halvingTime = ln(1/2)/(-$k); + + + +Context("LimitedNumeric"); +Context()->flags->set(tolerance=>0.01); + + + +$halvingTime = Compute("$halvingTime"); +$halvingTime = NumberWithUnits("$halvingTime","hr"); + + +$t = NumberWithUnits("$t", "hr"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +If \($r\)$PERCENT of a radioactive substance decays in \($t\), what is the half-life of the substance. Use $BBOLD hr$EBOLD for hours. + + +$PAR + +$BCENTER +$SPACE $SPACE $SPACE \{ans_rule(10)\} +$ECENTER + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + + + + +ANS( $halvingTime->cmp() ); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/LnsToExponents.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/LnsToExponents.pg new file mode 100644 index 0000000000..c20057bfcc --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/LnsToExponents.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "parserMultiAnswer.pl", + "bizarroArithmetic.pl", + "PGML.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(18,92); +$b = round(ln($a)*1000)/1000; + +Context()->operators->set( +'**' => {class => 'bizarro::BOP::power', isCommand => 1, perl=>undef}, +'^' => {class => 'bizarro::BOP::power', isCommand => 1, perl=>undef}, +); + +Context()->flags->set(bizarroPow=>1); + +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->operators->undefine('*','+','-','/'); + + +$multians = MultiAnswer( +Compute($a), +Compute("e^($b)")) +->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $f1stu, $f2stu ) = @{$student}; + my ( $f1, $f2 ) = @{$correct}; + if ( ($f1 == $f1stu && $f2 == $f2stu) || + ($f1 == $f2stu && $f2 == $f1stu) ) { + return 1; + } else { + if ($f1stu == $f2stu) { + Value::Error("This equation is a true equation, but it is not what was asked for."); + } else { + return 0; + } + } + } +); + + +############################################## + +BEGIN_PGML + +Rewrite the statement using exponents instead of logarithms. + +END_PGML +BEGIN_TEXT +$PAR + +\{ +LayoutTable( +[ +["\(\ln $a\)","\({}={}\)","\($b\)"], +[$multians->ans_rule(6),"\({}={}\)",$multians->ans_rule(12)], +], +allcellcss=>'padding:0px; padding-bottom:6px;' +) +\} + +END_TEXT + +############################################## + +ANS( $multians->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +When one side of an equation is a logarithm with base [`b`] of something, then [`b`] can be moved to the other side of the equation in the form of an exponential base. That is + + [`\begin{aligned} +\log_b(\text{left})&=\text{right}\\ +\underset{\hookrightarrow}{\log_b}(\text{left})&=\text{right}\\ +\text{left} &=b^{\text{right}} +\end{aligned}`] + +So we have the equation + + [`[$a]=e^{[$b]}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/LnsToExponents2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/LnsToExponents2.pg new file mode 100644 index 0000000000..ef35c86419 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/LnsToExponents2.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "parserMultiAnswer.pl", + "bizarroArithmetic.pl", + "PGML.pl", + "PGcourse.pl", +); + + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(0.2,0.9,0.01); +$b = round(ln($a)*10000)/10000; + +Context()->operators->set( +'**' => {class => 'bizarro::BOP::power', isCommand => 1, perl=>undef}, +'^' => {class => 'bizarro::BOP::power', isCommand => 1, perl=>undef}, +); + +Context()->flags->set(bizarroPow=>1); + +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->operators->undefine('*','+','-','/'); + + +$multians = MultiAnswer( +Compute($a), +Compute("e^($b)")) +->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $f1stu, $f2stu ) = @{$student}; + my ( $f1, $f2 ) = @{$correct}; + if ( ($f1 == $f1stu && $f2 == $f2stu) || + ($f1 == $f2stu && $f2 == $f1stu) ) { + return 1; + } else { + if ($f1stu == $f2stu) { + Value::Error("This equation is a true equation, but it is not what was asked for."); + } else { + return 0; + } + } + } +); + + +############################################## + +BEGIN_PGML + +Rewrite the statement using exponents instead of logarithms. + +END_PGML +BEGIN_TEXT +$PAR + +\{ +LayoutTable( +[ +["\(\ln $a\)","\({}={}\)","\($b\)"], +[$multians->ans_rule(6),"\({}={}\)",$multians->ans_rule(12)], +], +allcellcss=>'padding:0px; padding-bottom:6px;' +) +\} + +END_TEXT + +############################################## + +ANS( $multians->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +When one side of an equation is a logarithm with base [`b`] of something, then [`b`] can be moved to the other side of the equation in the form of an exponential base. That is + + [`\begin{aligned} +\log_b(\text{left})&=\text{right}\\ +\underset{\hookrightarrow}{\log_b}(\text{left})&=\text{right}\\ +\text{left} &=b^{\text{right}} +\end{aligned}`] + +So we have the equation + + [`[$a]=e^{[$b]}`] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs.pg new file mode 100644 index 0000000000..52f1c3a00d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$b[0] = random(1.8,2.5,0.1); +$b[1] = 2.718281; +$b[2] = random(3,3.5,0.1); + +$f[0] = Formula("$b[0]^x"); +$f[1] = Formula("$b[1]^x"); +$f[2] = Formula("$b[2]^x"); + + + +$gr = init_graph(-1,-5,5,25, axes=>[0,0], grid=>[6,6],size=>[400,400]); + +add_functions($gr, "$f[0] for x in <-1,5> " . + "using color:blue and weight:2"); +add_functions($gr, "$f[1] for x in <-1,5> " . + "using color:red and weight:2"); +add_functions($gr, "$f[2] for x in <-1,5> " . + "using color:green and weight:2"); + + +# +# Create a matching list and use popups +# +$ml = new_match_list(); +$ml->rf_print_q(~~&pop_up_list_print_q); +$ml->ra_pop_up_list([ +"No answer" => "?", +"A" => "A", "B" => "B", "C" => "C"]); + +# +# Add correct questions and answers +# +$ml->qa( +"\(f(x)=$b[0]^x\)", "blue", +"\(g(x)=\textrm{e}^x\)", "red", +"\(h(x)=$b[2]^x\)", "green", +); +$ml->choose(3); + + +############################################## + +BEGIN_PGML + +The graphs of [`f(x)=[@$b[0]@]^x`], [`g(x)=e^x`], and [`h(x)=[@$b[2]@]^x`] are shown below. + +[@EnlargeImageStatementPGML()@]** + + +>>[@ image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + +END_PGML +BEGIN_TEXT + +$PAR + +Match each function with its color. +\{ ColumnMatchTable($ml) \} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 0; + +install_problem_grader(~~&std_problem_grader); + +ANS( str_cmp( $ml->ra_correct_ans ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +We can see in the graph that there are three exponentially increasing functions, all with the same initial value but different rates of growth. We can compare the three formulas by looking at their growth factors. If we know that [`e\approx2.718\ldots`], then we can see that [`f`] has the smallest growth factor, [`g`] has the second smallest, and [`h`] has the largest growth factor. So [`f`] has the blue graph, [`g`] has the red graph, and [`h`] has the green graph. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs2.pg new file mode 100644 index 0000000000..ec0418de08 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs2.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGgraders.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$r[0] = random(0.2,0.3,0.01); +$r[1] = $r[0]+0.05; + +$k[0] = $r[1]; +$k[1] = $k[0]+0.05; + +$b[0] = 1+$r[0]; +$b[1] = 1+$r[1]; + +$f[0] = Formula("$b[0]^x")->reduce; +$f[1] = Formula("$b[1]^x")->reduce; +$f[2] = Formula("e^{($k[0] x)}")->reduce; +$f[3] = Formula("e^{($k[1] x)}")->reduce; + + + +$gr = init_graph(0,0,2,4, axes=>[0,0],size=>[400,400]); + +add_functions($gr, "$f[0] for x in <-1,5> " . + "using color:blue and weight:2"); +add_functions($gr, "$f[1] for x in <-1,5> " . + "using color:red and weight:2"); +add_functions($gr, "$f[2] for x in <-1,5> " . + "using color:green and weight:2"); +add_functions($gr, "$f[3] for x in <-1,5> " . + "using color:black and weight:2"); + +# +# Create a matching list and use popups +# +$ml = new_match_list(); +$ml->rf_print_q(~~&pop_up_list_print_q); +$ml->ra_pop_up_list([ +"No answer" => "?", +"A" => "A", "B" => "B", "C" => "C", "D" => "D"]); + +Context()->texStrings; +# +# Add correct questions and answers +# +$ml->qa( +"\(f(x)=$f[0]\)", "blue", +"\(g(x)=$f[1]\)", "red", +"\(h(x)=$f[2]\)", "green", +"\(k(x)=$f[3]\)", "black", + +); + +Context()->normalStrings; +$ml->choose(4); + + +############################################## + +BEGIN_PGML + +The graphs of [`f(x)=[@$f[0]->TeX@]`], [`g(x)=[@$f[1]->TeX@]`], [`h(x)=[@$f[2]->TeX@]`], and [`k(x)=[@$f[3]->TeX@]`] are shown below. + +[@EnlargeImageStatementPGML()@]** + +>>[@ image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + + +Match each function with its color without using a calculator. + +END_PGML +BEGIN_TEXT +$PAR +\{ ColumnMatchTable($ml) \} + +END_TEXT + +############################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS( str_cmp( $ml->ra_correct_ans ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +We can see in the graph that we have four increasing exponential functions. We need to compare the four formulas somehow. They all have the same initial value, but different growth factors. One way to compare them is to find decimal approximations for their growth factors. + +* [`f`] has growth factor [`[@$b[0]@]`]. +* [`g`] has growth factor [`[@$b[1]@]`]. +* [`h`] has growth factor [`e^{[@$k[0]@]}\approx[@exp($k[0])@]`]. +* [`k`] has growth factor [`e^{[@$k[1]@]}\approx[@exp($k[1])@]`]. + +So we can see that as far as growth rates go, [`fflags->set(reduceConstants=>0); + + +$k[0] = 1; +$k[1] = -1; +$k[2] = random(-2,-1.4,0.1); +$k[3] = $k[2]-random(0.5,1.5,0.2); + + +$f[0] = Formula("e^{($k[0] x)}")->reduce; +$f[1] = Formula("e^{($k[1] x)}")->reduce; +$f[2] = Formula("e^{($k[2] x)}")->reduce; +$f[3] = Formula("e^{($k[3] x)}")->reduce; + + + +$gr = init_graph(-2,-1,1,3, axes=>[0,0],size=>[400,400]); + +add_functions($gr, "$f[0] for x in <-2,1> " . + "using color:blue and weight:2"); +add_functions($gr, "$f[1] for x in <-2,1> " . + "using color:red and weight:2"); +add_functions($gr, "$f[2] for x in <-2,1> " . + "using color:green and weight:2"); +add_functions($gr, "$f[3] for x in <-2,1> " . + "using color:black and weight:2"); + +# +# Create a matching list and use popups +# +$ml = new_match_list(); +$ml->rf_print_q(~~&pop_up_list_print_q); +$ml->ra_pop_up_list([ +"No answer" => "?", +"A" => "A", "B" => "B", "C" => "C", "D" => "D"]); + +Context()->texStrings; +# +# Add correct questions and answers +# +$ml->qa( +"\(f(x)=$f[0]\)", "blue", +"\(g(x)=$f[1]\)", "red", +"\(h(x)=$f[2]\)", "green", +"\(k(x)=$f[3]\)", "black", + +); + +Context()->normalStrings; +$ml->choose(4); + + + +############################################## + +BEGIN_PGML + +The graphs of [`f(x)=[@$f[0]->TeX@]`], [`g(x)=[@$f[1]->TeX@]`], [`h(x)=[@$f[2]->TeX@]`], and [`k(x)=[@$f[3]->TeX@]`] are shown below. + +[@EnlargeImageStatementPGML()@]** + +>>[@ image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + + +Match each function with its color without using a calculator. + +END_PGML +BEGIN_TEXT +$PAR +\{ ColumnMatchTable($ml) \} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS( str_cmp( $ml->ra_correct_ans ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +We can see in the graph that we three decreasing exponential functions, and one increasing exponential function. Clearly [`f`], with its positive continuous relative growth rate of [`[@$k[0]/100@]`] has the increasing graph, the blue graph. + +We need to compare the other three formulas somehow. They are all showing us their continuous relative growth rates (which are all negative). The largest continuous relative _decay_ rate is [`[@$k[3]*-1@]`] (with continuous relative _growth_ rate [`[@$k[3]@]`]), so [`k`] is the black curve. + +The smallest continuous relative _decay_ rate is [`1`] (with continuous relative _growth_ rate [`-1`]), so [`g`] is the red curve. + +And in the middle, [`h`] is the green curve. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/MatchLogGraphs.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/MatchLogGraphs.pg new file mode 100644 index 0000000000..edb8d99a62 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/MatchLogGraphs.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGgraders.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + + +$k[0] = random(1.5,3.5,0.1); +$k[1] = $k[0]+random(-1,1,2); +$k[2] = -$k[0]; + + + +$f[0] = Formula("e**($k[0] *x)")->reduce; +$f[1] = Formula("e**($k[1] *x)")->reduce; +$f[2] = Formula("e**($k[2] *x)")->reduce; +$f[3] = Formula("ln(x)")->reduce; +$f[4] = Formula("log10(x)")->reduce; + + + +$gr = init_graph(0,0,3,3, axes=>[0,0],size=>[400,400]); + +add_functions($gr, "$f[0] for x in <0,3> " . + "using color:red and weight:2"); +add_functions($gr, "$f[1] for x in <0,3> " . + "using color:blue and weight:2"); +add_functions($gr, "$f[2] for x in <0,3> " . + "using color:black and weight:2"); +add_functions($gr, "$f[3] for x in <0,3> " . + "using color:orange and weight:2"); +add_functions($gr, "$f[4] for x in <0,3> " . + "using color:green and weight:2"); + +# +# Create a matching list and use popups +# +$ml = new_match_list(); +$ml->rf_print_q(~~&pop_up_list_print_q); +$ml->ra_pop_up_list([ +"No answer" => "?", +"A" => "A", "B" => "B", "C" => "C", "D" => "D", "E" => "E"]); + +Context()->texStrings; +# +# Add correct questions and answers +# +$ml->qa( +"\(f(x)=$f[0]\)", "red", +"\(g(x)=$f[1]\)", "blue", +"\(h(x)=$f[2]\)", "black", +"\(k(x)=$f[3]\)", "orange", +"\(m(x)=$f[4]\)", "green", + +); + +Context()->normalStrings; +$ml->choose(5); + +############################################## + +BEGIN_PGML + +The graphs of five functions are shown below. + +[@EnlargeImageStatementPGML()@]** + +>>[@ image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + + +Match each function with its color without using a calculator. + +END_PGML +BEGIN_TEXT +$PAR +\{ ColumnMatchTable($ml) \} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS( str_cmp( $ml->ra_correct_ans ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +We can see in the graph that we have two logarithmic functions, two increasing exponential functions, and one decreasing exponential function. The decreasing exponential function, the black curve, must be [`h`]. + +To compare the two increasing exponential curves, note that the red one has a larger continuous relative growth rate. So the red one must be [`f`] and the blues one must be [`g`]. + +To compare the two logarithmic curves, note that the green one is growing more slowly. Since [`\log`] base [`10`] has a larger base than [`\ln`], it must be the more slowly growing curve. So the green curve is [`m`] and the orange curve is [`k`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/RadioDecay.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/RadioDecay.pg new file mode 100644 index 0000000000..1afa11974a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/RadioDecay.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "parserNumberWithUnits.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(t=>'Real'); + +$initialReal = random(30,100,1); +$thresholdReal = $initialReal/10; + +$initial = NumberWithUnits($initialReal, "mg"); +$threshold = NumberWithUnits($thresholdReal, "mg"); + +$r = -random(10,30,0.1); + + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +A radioactive substance decays at a continuous rate of $r$PERCENT per year, and +\($initial\) of the substance is present in the year 2011. +$PAR + +$BBOLD(a.)$EBOLD Find a formula for \(A(t)\), the amount present \(t\) years after 2011. Your answer should be in the form $BBOLD A(t)=...$EBOLD. + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + +$PAR + +$BBOLD(b.)$EBOLD How much will be present in the year 2020? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + +$PAR + +$BBOLD(c.)$EBOLD Estimate when the quantity drops below \($threshold\). You may use a graph or guess-and-check. Answer in years, using $BBOLD yr$EBOLD. + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("Numeric")->variables->are(t=>"Real"); +parser::Assignment->Allow; +parser::Assignment->Function("A"); + + +$ans1 = Formula("A(t)=$initialReal*e^($r/100*t)")->reduce; +$ans1->{limits} = [2,10]; +$ans2 = $initialReal*(2.718281828**($r/100*9)); +$ans3 = 100*ln($thresholdReal/$initialReal)/($r); + +ANS( $ans1->cmp() ); + +ANS( NumberWithUnits($ans2, "mg")->cmp ); + +ANS( NumberWithUnits($ans3, "yr")->cmp(tolType=>absolute,tolerance=>1) ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Simplify.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Simplify.pg new file mode 100644 index 0000000000..fc485999df --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Simplify.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->functions->undefine("ln","log","log10"); + +$k = random(2,20,1); + +$c = random(30,300,10); + +$ans = Formula("$k*x+$c"); + +############################################## + +BEGIN_PGML + +Simplify the expression. + + [``\ln\left(e^{[$k] x+[$c]}\right)``] + + This expression is equivalent to [_____________]. + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS( $ans->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +Remember that exponentiating base [`e`] and taking a logarithm base [`e`] are inverse functions. So the expression simplifies to [`[$k]x+[$c]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Simplify2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Simplify2.pg new file mode 100644 index 0000000000..9336a03bfe --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Simplify2.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->functions->undefine("ln","log","log10"); + +$k = random(2,20,1); + +$c = random(30,300,10); + +$ans = Formula("$k*x+$c"); + +############################################## + +BEGIN_PGML + +Simplify the expression. + + [``e^{\ln([$k] x+[$c])}``] + + This expression is undefined for [`x`] in [_____________] (use interval notation). + Otherwise, it is equivalent to [_____________]. + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(formatStudentAnswers=>parsed); + +Context("Interval"); +ANS(Compute("(-inf,-$c/$k]")->cmp); +ANS( $ans->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +Since the expression asks us to take [`\ln`] of [`[$k] x+[$c]`], we need + + [`\begin{aligned} +[$k] x+[$c] &>0\\ +[$k] x &>-[$c]\\ +x &>-{\frac{[$c]}{[$k]}} +\end{aligned}`] + +So to be defined, we must have [`x`] in [`\left(-{\frac{[$c]}{[$k]}},\infty\right)`]. That means that the expression is undefined if [`x`] is in [`\left(-\infty,-{\frac{[$c]}{[$k]}}\right]`]. + +Once we've cleared that hurdle, remember that exponentiating base [`e`] and taking a logarithm base [`e`] are inverse functions. So the expression simplifies to [`[$k]x+[$c]`]. + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Simplify3.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Simplify3.pg new file mode 100644 index 0000000000..d652dcd56e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Simplify3.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->functions->undefine("ln","log","log10"); +Context()->flags->set(reduceConstants=>0); + +$k = random(2,20,1); + +$c = random(30,300,10); + +$n = random(3,5,1); + +$ans = Formula("1/$n($k*x+$c)"); + +############################################## + +BEGIN_PGML + +Simplify the expression. + + [``\ln\sqrt[[$n]]{\textrm{e}^{[$k] x+[$c]}}``] + + This expression is equivalent to [_____________]. + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS( $ans->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +It may help to first apply some rules of radicals and expoenents: + + [`\begin{aligned}\ln\sqrt[[$n]]{\textrm{e}^{[$k] x+[$c]}} +&=\ln\left(\left(\textrm{e}^{[$k] x+[$c]}\right)^{1/[$n]}\right)\\ +&=\ln\left(\textrm{e}^{([$k] x+[$c])/[$n]}\right) +\end{aligned}`] + +Remember that exponentiating base [`e`] and taking a logarithm base [`e`] are inverse functions. So the expression simplifies to [`\frac{[$k]x+[$c]}{[$n]}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Solve.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Solve.pg new file mode 100644 index 0000000000..31ba3d46b5 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/Solve.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$k = random(2,8,1); +$a = random(10,20,1); + +$b = random(2,9,1); + + +$ans = (1-ln($a-$b))/$k; +$app = $ans; + +Context("LimitedNumeric"); +parser::Assignment->Allow; +Context()->variables->add(t=>'Real'); + + +$ans = Formula("t=$ans"); + +############################################## + +BEGIN_PGML + +Solve the equation. + + [`[$a]e^{[$k]t} - e = [$b]e^{[$k] t}`] + + [_______________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $ans->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +We can start by arranging terms so that like terms can be combined. + + [`\begin{aligned} +[$a]e^{[$k]t} - e &= [$b]e^{[$k] t}\\ +[$a]e^{[$k]t} - [$b]e^{[$k] t} &= e\\ +[@$a-$b@]e^{[$k]t} &= e\\ +\ln\left([@$a-$b@]e^{[$k]t}\right) &= \ln(e)\\ +\ln([@$a-$b@])+\ln\left(e^{[$k]t}\right) &= \ln(e)\\ +\ln([@$a-$b@])+[$k]t &= 1\\ +[$k]t &= 1-\ln([@$a-$b@])\\ +t &= \frac{1-\ln([@$a-$b@])}{[$k]}\\ +t&\approx[$app] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/SolveUsingLogs7.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/SolveUsingLogs7.pg new file mode 100644 index 0000000000..e8d5b09e77 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/SolveUsingLogs7.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +parser::Assignment->Allow; + +#$a = random(1,100,1); +$m = random(2,10,1); + +$b = random(1,5,0.01); + +$c = $b+random(100,500,0.01); + + + +$app = (ln($c)-$b)/$m; + + +$ans = Formula("x=$app"); + + + +############################################## + +BEGIN_PGML + +Solve the equation. Remember, when solving an equation for [`x`], your answer should be in the form *x=...*. When exponents are involved, it becomes very important to be precise. Use at least four significant digits in your answers. + + [`e^{[$m] x+[$b]} = [$c]`] + + [_______________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS($ans->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +We can slide the exponentiation with base [`e`] on the left over to the right, in the form of a logarithm with base [`e`]: + + [`\begin{aligned} +e^{[$m] x+[$b]} &= [$c]\\ +[$m] x+[$b] &= \ln([$c])\\ +[$m] x &= \ln([$c])-[$b]\\ +x &= \frac{\ln([$c])-[$b]}{[$m]}\\ +x&\approx[$app] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/SolveUsingLogs8.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/SolveUsingLogs8.pg new file mode 100644 index 0000000000..3d850af964 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/SolveUsingLogs8.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +parser::Assignment->Allow; + +$a = random(2,5,1); +$m = random(2,10,1); + +$b = random(1,5,0.01); + +$c = round($b)+random(100,500,1); + + + +$app = (ln($c)-$b)/($m-ln($a)); + +$ans = Formula("x=$app"); + + + +############################################## + +BEGIN_PGML + +Solve the equation. Remember, when solving an equation for [`x`], your answer should be in the form *x=...*. When exponents are involved, it becomes very important to be precise. Use at least four significant digits in your answers. + + [`e^{[$m] x+[$b]} = [$c]\cdot[$a]^x`] + + [__________________________] + + + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS($ans->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +We can begin by applying any logarithm to both sides. The natural logarithm is a good choice since base [`e`] is present. + + [`\begin{aligned} +e^{[$m] x+[$b]} &= [$c]\cdot[$a]^x\\ +\ln\left(e^{[$m] x+[$b]}\right) &= \ln\left([$c]\cdot[$a]^x\right)\\ +[$m] x+[$b] &= \ln([$c])+\ln\left([$a]^x\right)\\ +[$m] x+[$b] &= \ln([$c])+x\ln([$a])\\ +[$m] x-x\ln([$a]) &= \ln([$c])-[$b]\\ +x([$m]-\ln([$a])) &= \ln([$c])-[$b]\\ +x &= \frac{\ln([$c])-[$b]}{[$m]-\ln([$a])}\\ +x &\approx[$app] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/bForm1.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/bForm1.pg new file mode 100644 index 0000000000..e71b17ba23 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/bForm1.pg @@ -0,0 +1,103 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "bizarroArithmetic.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(t=>'Real'); + +$a = random(0.1,0.9,0.01); +$k = random(0.1,0.9,0.1); + +$b = exp($k); + + +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +); + + + + +############################################## + +BEGIN_PGML + +Convert this exponential expression to the form [`Q=ab^{t}`]. Write the base [`b`] in exact form, not as a decimal approximation. + + [`Q=[$a]\cdot e^{[$k] t}`] + + [`Q={}`][_____________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS(Formula("$a*(e^$k)^t") -> cmp( +checker=>sub{ +my ( $correct, $student, $ansHash ) = @_; +return 0 if $ansHash->{isPreview} || $correct != $student; +$student = $ansHash->{student_formula}; +$correct = $correct->{original_formula} if defined $correct->{original_formula}; +$student = Formula("$student"); $correct = Formula("$correct"); +return 0 unless ($correct == $student); +Context()->flags->set(bizarroMul=>1); +delete $correct->{test_values}, $student->{test_values}; +my $OK = (($correct == $student) or ($student == $correct)); +Context()->flags->set(bizarroMul=>0); +Value::Error("Your answer is the same as the given expression, but not in the form that was asked for") unless $OK; +return $OK; +})); + +############################################## + +BEGIN_PGML_SOLUTION + +Recall the exponent rule that has to do with a product in the exponent: + + [`\begin{aligned} +Q &= [$a]\cdot e^{[$k] t}\\ +Q &= [$a]\cdot \left(e^{[$k]}\right)^t\\ +Q &\approx [$a]\cdot[@exp([$k])@]^t\\ +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/bForm2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/bForm2.pg new file mode 100644 index 0000000000..c008c34f06 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/bForm2.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "bizarroArithmetic.pl", + "PGML.pl", + "PGcourse.pl", + +); + + + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(t=>'Real'); + +$a = random(0.1,0.9,0.01); +$k = -random(0.1,0.9,0.1); + +$b = exp($k); + +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +); + +############################################## + +BEGIN_PGML + +Convert this exponential expression to the form [`Q=ab^{t}`]. Write the base [`b`] in exact form, not as a decimal approximation. + + + [`Q=[$a]\cdot e^{[$k] t}`] + + [`Q={}`][_____________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS(Formula("$a*(e^$k)^t") -> cmp( +checker=>sub{ +my ( $correct, $student, $ansHash ) = @_; +return 0 if $ansHash->{isPreview} || $correct != $student; +$student = $ansHash->{student_formula}; +$correct = $correct->{original_formula} if defined $correct->{original_formula}; +$student = Formula("$student"); $correct = Formula("$correct"); +return 0 unless ($correct == $student); +Context()->flags->set(bizarroMul=>1); +delete $correct->{test_values}, $student->{test_values}; +my $OK = (($correct == $student) or ($student == $correct)); +Context()->flags->set(bizarroMul=>0); +Value::Error("Your answer is the same as the given expression, but not in the form that was asked for") unless $OK; +return $OK; +})); + +############################################## + +BEGIN_PGML_SOLUTION + +Recall the exponent rule that has to do with a product in the exponent: + + [`\begin{aligned} +Q &= [$a]\cdot e^{[$k] t}\\ +Q &= [$a]\cdot \left(e^{[$k]}\right)^t\\ +Q &\approx [$a]\cdot[@exp([$k])@]^t\\ +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/bForm3.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/bForm3.pg new file mode 100644 index 0000000000..90f59c6798 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/bForm3.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "bizarroArithmetic.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(t=>'Real'); + +$a = random(12,120,1); +$k = -random(0.05,0.0.15,0.01); + +$b = exp($k); + +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +); + +############################################## + +BEGIN_PGML + +Convert this exponential expression to the form [`Q=ab^{t}`]. Write the base [`b`] in exact form, not as a decimal approximation. + + + [`Q=[$a]\cdot e^{[$k] t}`] + + [`Q={}`][_____________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS(Formula("$a*(e^$k)^t") -> cmp( +checker=>sub{ +my ( $correct, $student, $ansHash ) = @_; +return 0 if $ansHash->{isPreview} || $correct != $student; +$student = $ansHash->{student_formula}; +$correct = $correct->{original_formula} if defined $correct->{original_formula}; +$student = Formula("$student"); $correct = Formula("$correct"); +return 0 unless ($correct == $student); +Context()->flags->set(bizarroMul=>1); +delete $correct->{test_values}, $student->{test_values}; +my $OK = (($correct == $student) or ($student == $correct)); +Context()->flags->set(bizarroMul=>0); +Value::Error("Your answer is the same as the given expression, but not in the form that was asked for") unless $OK; +return $OK; +})); + +############################################## + +BEGIN_PGML_SOLUTION + +Recall the exponent rule that has to do with a product in the exponent: + + [`\begin{aligned} +Q &= [$a]\cdot e^{[$k] t}\\ +Q &= [$a]\cdot \left(e^{[$k]}\right)^t\\ +Q &\approx [$a]\cdot[@exp([$k])@]^t\\ +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/eForm1.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/eForm1.pg new file mode 100644 index 0000000000..d777277417 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/EulersConstantAndNaturalLog/eForm1.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserMultiAnswer.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(2,13,1); +$b = random(2,10,1); + + +$k = ln($b); + +Context("LimitedNumeric"); + + + +$multians = MultiAnswer(Compute("$a"), Compute("$k"))->with( + singleResult => 0, + allowBlankAnswers => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $f1stu, $f2stu ) = @{$student}; + my ( $f1, $f2 ) = @{$correct}; + + if ( ( $f1==$f1stu && $f2==$f2stu) ) { + return [1,1]; + } elsif ( $f1==$f1stu) { + return [1,0]; + } elsif ( $f2==$f2stu) { + return [0,1]; + } else { + return [0,0]; + } + } +); + + + +Context()->texStrings; +if ($displayMode eq 'TeX') { + $showExpression = + "\( \displaystyle $expression = " . ans_rule(6) . "\textrm{e}^{" . ans_rule(6) . "t}\)"; +} else { + $showExpression = + ColumnTable( + "\( \displaystyle Q = \) " . ans_rule(6) . " \( \textrm{e} \)", + ans_rule(6)."\(\,t\)".$BR.$BR, + indent => 0, separation => 0, valign => "BOTTOM" + ); +} +Context()->normalStrings; + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Convert this exponential expression to the form \(Q=a\textrm{e}^{kt}\). + +\[Q=$a\cdot $b^t\] + +$PAR + +$BCENTER +$showExpression +$ECENTER + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + + + + +ANS( $multians->cmp() ); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/AverageRateOfChange10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/AverageRateOfChange10.pg new file mode 100644 index 0000000000..15b53c25fd --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/AverageRateOfChange10.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserRadioButtons.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->variables->are(b=>'Real',x=>'Real'); + +$A = random(2,8,1); + +$b = random(1.3,1.5,0.01); + + +$left = 1; +$right = random(4,6,1); + +$gr = init_graph(-1,-$A,10,$A*($b**$right)*1.1,axes=>[0,0],size=>[400,400]); + +add_functions($gr, "$A*($b^x) for x in <-1,10> using color:blue and weight:2"); + +$gr->lb( new Label($left,-0.25,"$left", + 'black','center','top')); + +$gr->lb( new Label($right,-0.25,"$right", + 'black','center','top')); + +$gr->moveTo($left,0.2); +$gr->lineTo($left,-0.2); + +$gr->moveTo($right,0.2); +$gr->lineTo($right,-0.2); + + +$gr->stamps( closed_circle($left,$A*($b**$left),'black') ); +$gr->stamps( closed_circle($right,$A*($b**$right),'black') ); + +$gr->lb( new Label($left+0.5,$A*($b**$left)-0.5,"P", + 'black','center','middle')); +$gr->lb( new Label($right+0.5,$A*($b**$right)-0.5,"Q", + 'black','center','middle')); + + + +$denominator = $right-$left; +$numerator = Formula("$A*b^$left(b^($right-$left)-1)")->reduce; +$answer = Formula("$numerator/$denominator")->reduce; + + +############################################## +$refreshCachedImages = 1; + +BEGIN_PGML + +Below is the graph of [`f`] where [`f(x)=[$A](b)^x`]. What is the slope of the straight line segment connecting [`P`] to [`Q`]? Your answer will be in terms of [`b`]. + +[@EnlargeImageStatementPGML()@]** + +>> [@ image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + + + The slope is [___________________________________]{$answer} + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +In general, the slope between two points is found by dividing their vertical difference (often called the rise) by their horizontal difference (often called the run). Here, the horizontal difference is [`[$right]-[$left]`], which is [`[$denominator]`]. + +To find the vertical difference, we need the [`y`]-values of the points. We find these by evaluating the function at [`[$left]`] and [`[$right]`]: + + [`\begin{aligned} +f([$right])-f([$left])&= [$A]*(b)^[$right]-[$A](b)^[$left]\\ +&= [$numerator]\\ +\end{aligned}`] + +So the slope is [`[$answer]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/CalculatorExponential10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/CalculatorExponential10.pg new file mode 100644 index 0000000000..6d912c21f2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/CalculatorExponential10.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(30,60,1); +$b = random(1.08,1.28,0.01); + +$c = random(80,120,1); + + +############################################## + +BEGIN_PGML + +Suppose [`y=[$a]([$b])^x`]. Use a graphing calculator or some other kind of computer to graphically or automatically solve for [`x`] if [`y=[$c]`]. You should be practicing this with whichever device you be allowed to use during part of an exam. Enter the answer correctly to the nearest tenth. + + [__________________] + + +END_PGML + + +############################################## + + +$answer = Real(round(log($c/$a)/log($b)*10)/10); +Context()->flags->set(tolType=>'absolute'); +Context()->flags->set(tolerance=>.100001); +ANS($answer->cmp); + + +############################################## + +BEGIN_PGML_SOLUTION + +The procedures and syntax for doing this will be different on different devices. The solution to the nearest tenth is [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/CompareGraphs2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/CompareGraphs2.pg new file mode 100644 index 0000000000..3fc6ae4f69 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/CompareGraphs2.pg @@ -0,0 +1,135 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGgraders.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$b[0] = random(0.6,0.7,0.01); +$b[1] = $b[0]+random(0.08,0.12,0.01); +$b[2] = $b[1]+random(0.08,0.12,0.01); + +$f[0] = Formula("$b[0]^x"); +$f[1] = Formula("$b[1]^x"); +$f[2] = Formula("$b[2]^x"); + + + +$gr = init_graph(-1,-1,5,3, axes=>[0,0], grid=>[6,4],size=>[400,400]); + +add_functions($gr, "$f[0] for x in <-1,5> " . + "using color:blue and weight:2"); +add_functions($gr, "$f[1] for x in <-1,5> " . + "using color:red and weight:2"); +add_functions($gr, "$f[2] for x in <-1,5> " . + "using color:green and weight:2"); + + +# +# Create a matching list and use popups +# +$ml = new_match_list(); +$ml->rf_print_q(~~&pop_up_list_print_q); +$ml->ra_pop_up_list([ +"No answer" => "?", +"A" => "A", "B" => "B", "C" => "C"]); + +# +# Add correct questions and answers +# +$ml->qa( +"\(f(x)=$b[0]^x\)", "blue", +"\(g(x)=$b[1]^x\)", "red", +"\(h(x)=$b[2]^x\)", "green", +); +$ml->choose(3); + + + + + + +############################################## + +BEGIN_PGML + +The graphs of [`y=f(x)=[@$b[0]@]^x`], [`y=g(x)=[@$b[1]@]^x`], and [`y=h(x)=[@$b[2]@]^x`] are shown below. + +[@EnlargeImageStatementPGML()@]** + +>> [@ image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + +END_PGML + +BEGIN_TEXT +$PAR + +Match each function with its color. +\{ ColumnMatchTable($ml) \} + + + + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 0; + + + +install_problem_grader(~~&std_problem_grader); + +ANS( str_cmp( $ml->ra_correct_ans ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +These three exponential functions all have the same initial value of [`1`]. We can tell them apart by their growth factors. The growth factors are all smaller than [`1`] since the cures are not actually growing from left to right. The blue curve has the smallest growth factor, so it must be [`y=[@$f[0]@]`]. + +The green curve has the largest growth factor, so it must be [`y=[@$f[2]@]`]. + +And so the red curve must be [`y=[@$f[1]@]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/CompareGraphs3.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/CompareGraphs3.pg new file mode 100644 index 0000000000..4b29c893e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/CompareGraphs3.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + + +$f[0] = Formula("2*2^x"); +$f[1] = Formula("2*1.5^x"); +$f[2] = Formula("3*0.8^x"); +$f[3] = Formula("4*0.3^x"); + + + +$gr = init_graph(-3,-1,3,5, axes=>[0,0], grid=>[6,6],size=>[400,400]); + +add_functions($gr, "$f[0] for x in <-3,3> " . + "using color:blue and weight:2"); +add_functions($gr, "$f[1] for x in <-3,3> " . + "using color:red and weight:2"); +add_functions($gr, "$f[2] for x in <-3,3> " . + "using color:orange and weight:2"); +add_functions($gr, "$f[3] for x in <-3,3> " . + "using color:black and weight:2"); + + +$gr->lb( new Label(0.75,4,'A','blue','center','middle')); +$gr->lb( new Label(1.75,4.5,'B','red','center','middle')); +$gr->lb( new Label(2.25,1.9,'C','orange','center','middle')); +$gr->lb( new Label(2.75,0.25,'D','black','center','middle')); + + +$popupA = PopUp( + ["?","A","B","C","D"], + "A", +); +$popupB = PopUp( + ["?","A","B","C","D"], + "B", +); +$popupC = PopUp( + ["?","A","B","C","D"], + "C", +); +$popupD = PopUp( + ["?","A","B","C","D"], + "D", +); + + +############################################## + +BEGIN_PGML + +Below are the graphs of four functions. All of the equations for curves [`A`], [`B`], [`C`], and [`D`] can be written in the form [`y=a\,b^x`]. + +[@EnlargeImageStatementPGML()@]** + +>> [@image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + +a. Which curve has the largest value for [`a`]? + + [@ $popupD->menu() @]* + +a. Which two curves (Out of [`A`], [`B`], [`C`], or [`D`]) have the same value for [`a`]? Enter them as a list, with commas for separation. + + [__________________] + +a. Which function has the lowest value for [`b`]? + + [@ $popupD->menu() @]* + +a. Which function has the highest value for [`b`]? + + [@ $popupA->menu() @]* + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + + + +ANS( $popupD->cmp() ); + + +Context()->strings->add(A=>{},B=>{},C=>{},D=>{}); +ANS( List("A,B")->cmp); + +ANS( $popupD->cmp() ); + +ANS( $popupA->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +a. [`a`] is the initial value of an exponential function, so we are looking for the curve with the highest [`y`]-intercept. This is curve [`D`]. + +a. Again since [`a`] is the initial value of an exponential function, we are looking for the two curves that have the same [`y`]-intercept. These are the curves [`A,B`]. + +a. Curves [`C`] and [`D`] have growth factors smaller than [`1`], so the curve with the lowest value for [`b`] must be one of these two. [`D`] seems to have a much smaller growth factor, since it drops beneath [`C`] despite starting above [`C`]. So [`D`] has the smallest value for [`b`]. + +a. Curves [`A`] and [`B`] have growth factors larger than [`1`], so the curve with the largest value for [`b`] must be one of these two. The both have the same initial value, so it is easy to see that [`A`] has the largest value for [`b`]. + +END_PGML_SOLUTION +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialBasics10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialBasics10.pg new file mode 100644 index 0000000000..c23ef78c59 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialBasics10.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextPercent.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$initial = Real(random(12,300,0.1));; + +$growthFactor = Real(random(0.501,1.501,0.004)); +$growthRate = Real($growthFactor - 1); + + +Context("Percent"); +$growthFactorP = Percent("$growthFactor"); +$growthRateP = Percent("$growthRate"); + + +############################################## + +BEGIN_PGML + +If the quantity [`Q`] is given by [`Q= [$initial]([$growthFactor])^t`] + + then the initial value of [`Q`] is [___________]{$initial}, + + and the growth factor per unit [`t`] is [___________]{$growthFactorP}, + + and the relative growth rate per unit [`t`] is [___________]{$growthRateP}. + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; + +############################################## + +BEGIN_PGML_SOLUTION + +In an exponential expression of the form [`a(b)^t`], the number [`a`] is the initial value (the value when [`t=0`]). So here, the initial value of [`Q`] is [`[$initial]`]. + +And the number [`b`] is the growth factor per unit [`t`]. So here, the growth factor is [`[$growthFactor]`], which can also be expressed as [`[@$growthFactor*100@]%`]. + +The relative growth rate per unit [`t`] is often denoted [`r`], and [`r=b-1`]. So here, [`r=[$growthFactor]-1`], which is [`[$growthRate]`]. This can also be expresses as [`[@$growthRate*100@]%`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialBasics20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialBasics20.pg new file mode 100644 index 0000000000..7ab6a9a3f0 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialBasics20.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGchoicemacros.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$b[0] = 1.1; +$b[1] = $b[0]+random(0.05,0.15,0.01); +$b[2] = $b[1]+random(0.05,0.15,0.01); + + +$f[0] = Formula("$b[0]^x"); +$f[1] = Formula("$b[1]^x"); +$f[2] = Formula("$b[2]^x"); + + + +$gr = init_graph(-1,-1,5,3, axes=>[0,0], grid=>[6,4],size=>[400,400]); + +$bluepos = random(0,2,1); +$redpos = list_random(0..$bluepos-1,$bluepos+1..2); +$greenpos = 3 - $bluepos - $redpos; + +$colors[$bluepos] = "blue"; +$colors[$redpos] = "red"; +$colors[$greenpos] = "green"; + +add_functions($gr, "$f[0] for x in <-1,5> " . + "using color:$colors[0] and weight:2"); +add_functions($gr, "$f[1] for x in <-1,5> " . + "using color:$colors[1] and weight:2"); +add_functions($gr, "$f[2] for x in <-1,5> " . + "using color:$colors[2] and weight:2"); + + +$popup0 = PopUp(["?","blue", "red", "green"], $colors[0]); +$popup1 = PopUp(["?","blue", "red", "green"], $colors[1]); +$popup2 = PopUp(["?","blue", "red", "green"], $colors[2]); + + +############################################## + +$refreshCachedImages = 1; + +BEGIN_PGML + +The graphs of [`f`], [`g`], and [`h`] are shown below, where + + [`\begin{aligned} +f(t)&=[@$b[0]@]^t\\ +g(t)&=[@$b[1]@]^t\\ +h(t)&=[@$b[2]@]^t +\end{aligned}`] + +[@EnlargeImageStatementPGML()@]** + +>> [@ image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + + +Match each function with its color. + + [`f(t)=[@$b[0]@]^t`] [@$popup0->menu@]* + + [`g(t)=[@$b[1]@]^t`] [@$popup1->menu@]* + + [`h(t)=[@$b[2]@]^t`] [@$popup2->menu@]* + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( $popup0->cmp ); +ANS( $popup1->cmp ); +ANS( $popup2->cmp ); + +############################################## + +BEGIN_PGML_SOLUTION + +Examining their formulas, these functions are all exponential, and they all have the same initial value. Their growth factor varies, with [`f`] having the smallest growth factor and [`h`] having the largest. Therefore [`f`] has the [@$colors[0]@] graph, [`g`] has the [@$colors[1]@] graph, and [`h`] has the [@$colors[2]@] graph. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations05.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations05.pg new file mode 100644 index 0000000000..5d8784a683 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations05.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SolveLinearEquationPCC.pl", + "answerHints.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$a = non_zero_random(-4,4,1); +$b = list_random(2,3,5); +$c = non_zero_random(-5,5,1); +$d = list_random(2,4,1); +$ans = Fraction($d-$a,$c); + +$left = Formula("$b**($c*$var+$a)")->reduce; +$right = Formula("$b**($d)")->reduce; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + +############################################## + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$e = $d-$a; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] &= [$b]^{[$d]} \\ + [$c][$var]+[$a] &= [$d] \\ + [$c][$var] &= [$e] \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations10.pg new file mode 100644 index 0000000000..73a0d9295e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations10.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SolveLinearEquationPCC.pl", + "answerHints.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$ans = non_zero_random(5,5,1); +$a = -1-$ans; +$b = list_random(2,3,4,5,6); + +$left = Formula("$b**($var+$a)")->reduce; +$right = Fraction(1,$b); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + +############################################## + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left] &= [$b]^{-1} \\ + [$var]+[$a] &= -1 \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations15.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations15.pg new file mode 100644 index 0000000000..0cdad07832 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations15.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserAssignment.pl", + "SolveLinearEquationPCC.pl", + "answerHints.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$base = list_random(2,3,5); +$b = non_zero_random(-5,5,1); +$c = random(2,4,1); +$ans = -$b-$c; + +$leftE = Formula("$var+$b")->reduce; +$right = Formula("$base**$c")->reduce; + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + +############################################## + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` \left(\frac{1}{[$base]}\right)^{[$leftE]}=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + +$s1 = $b+$c; +$left = Compute(1); + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \left(\frac{1}{[$base]}\right)^{[$leftE]} &= [$right] \\ + \left(([$base])^{-1}\right)^{[$leftE]} &= [$base]^{[$c]} \\ + [$base]^{-[$var]-[$b]} &= [$base]^{[$c]} \\ + -[$var]-[$b] &= [$c] \\ + -[$var] &= [$s1] \\ + [$var] &= [$ans] +\end{aligned} + ``] + +The solution could also be written in set notation: [`\{[$ans]\}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations20.pg new file mode 100644 index 0000000000..2392c47607 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations20.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextFraction.pl", + "SolveLinearEquationPCC.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $ans = non_zero_random(-4,4,1); + $c = random(2,4,1)*random(-1,1,2); + $b = list_random(2,3,4,5); + $a = $c-$ans; +} until ($a!=0); +$d = ($a>0) ? $b**$a : Fraction(1,$b**(-$a)); + +$left = Formula("$d*$b**$var")->reduce; +$right = ($c>0) ? Compute($b**$c) : Fraction(1,$b**(-$c)); + +@vArray = ($var); +@aArray = ($ans); +($ansEqRef, $eqTypesRef) = contextSetup(~~@vArray, ~~@aArray); + +############################################## + +BEGIN_PGML + +[@instructions(~~@vArray)@]** + + [`` [$left]=[$right] ``] + + [_______________________________] + +END_PGML + +############################################## + +answerCheck($ansEqRef, $eqTypesRef); + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$b]^{[$a]}\cdot[$b]^{[$var]} &= [$b]^{[$c]} \\ + [$b]^{[$a]+[$var]} &= [$b]^{[$c]} \\ + [$a]+[$var] &= [$c] \\ + [$var] &= [$ans] +\end{aligned} + ``] + +[@summary($ansEqRef->[0],$left,$right);@]** + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations30.pg new file mode 100644 index 0000000000..47404575d5 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations30.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("FiniteSolutionSets"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$base = list_random(2,3,5); +do { + $x1 = non_zero_random(-5,5,1); + do {$x2 = non_zero_random(-5,5,1);} until ($x1!=$x2); + $ans = Formula("{$x1,$x2}"); + + $a = 1; + $b = -$x1-$x2; + $c = $x1*$x2; + + $f1 = random(2,4,1); + do {$f2 = random(2,4,1);} until ($f1!=$f2); + + $b1 = $b/$f1; + $b1n = -$b1; + $c1 = $c/$f2; + $bn = -$b; +} until ( ($b%$f1==0) && ($c%$f2==0) && (abs($c1)!=1) && ($b!=0) ) ; + + +$d = $base**$f2; +$e = $base**$f1; + +$f = Compute("$b1n*$var")->reduce; + +############################################## + +BEGIN_PGML + +Solve the exponential equation + + [`` [$base]^{[$var]^2}\cdot [$d]^{[$c1]} = [$e]^{[$f]}``] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$base]^{[$var]^2}\cdot [$d]^{[$c1]} &= [$e]^{[$f]} \\ + [$base]^{[$var]^2}\cdot \left([$base]^{[$f2]}\right)^{[$c1]} &= \left([$base]^{[$f1]}\right)^{[$f]} \\ + [$base]^{[$var]^2}\cdot [$base]^{[$c]} &= [$base]^{[$bn][$var]} \\ + [$base]^{[$var]^2+[$c]} &= [$base]^{[$bn][$var]} \\ + [$var]^2+[$c] &= [$bn][$var] \\ + [$var]^2+[$b][$var]+[$c] &= 0 \\ + ([$var]-[$x1])([$var]-[$x2]) &= 0 \\ + [$var]-[$x1] &=0 \text{ or } [$var]-[$x2]=0 \\ + [$var] &=[$x1] \text{ or } [$var]=[$x2] +\end{aligned} + ``] + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations40.pg new file mode 100644 index 0000000000..2888b8fba8 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations40.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("FiniteSolutionSets"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); +do { + $x1 = non_zero_random(-5,5,1); + do {$x2 = non_zero_random(-5,5,1);} until $x1 != $x2; + $ans = Formula("{$x1,$x2}"); + + $a = 1; + $b = -$x1-$x2; + $c = $x1*$x2; + + $b2h = non_zero_random(-5,5,1); + $b2 = 2*$b2h; + $b1 = $b2-$b; + $c2 = non_zero_random(-5,5,1); + $c1 = $c2-$c; + $b2n = -$b2; + $c2n = -$c2; +} until ( ($c2<0) && ($c2n != 1) && (abs($b2n)!=1) ); + +$f = Compute("$b1*$var+$c1")->reduce; +$e1 = Compute("$b2h*$var")->reduce; + +############################################## + +BEGIN_PGML + +Solve the exponential equation + + [` e^{[$f]} = \frac{e^{[$var]^2}}{e^{[$c2n]}}\cdot \left(e^{[$e1]}\right)^2 `] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; +#ANS($ans->cmp(list_checker => ~~&radicalListCheck)); + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + e^{[$f]} &= \frac{e^{[$var]^2}}{e^{[$c2n]}}\cdot \left(e^{[$b2h][$var]}\right)^2 \\ + e^{[$f]} &= e^{[$var]^2+[$c2]}\cdot e^{[$b2][$var]} \\ + e^{[$f]} &= e^{[$var]^2+[$b2][$var]+[$c2]} \\ + [$f] &= [$var]^2+[$b2][$var]+[$c2] \\ + 0 &= [$var]^2+[$b][$var]+[$c] \\ + 0 &= ([$var]-[$x1])([$var]-[$x2]) \\ + [$var]-[$x1] &=0 \text{ or } [$var]-[$x2]=0 \\ + [$var] &= [$x1] \text{ or } [$var]=[$x2] +\end{aligned} + ``] + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations50.pg new file mode 100644 index 0000000000..937ff16574 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations50.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$a = random(2,9,1); +do {$b = random(2,9,1);} until ($b!=$a); +$left = Compute("e**(2*$var)+($b-$a)*e**($var)")->reduce->reduce; +$right = $a*$b; + +Context("FiniteSolutionSets"); +Context()->variables->are($var => 'Real'); +$ans = Formula("{ln($a)}"); + +############################################## + +BEGIN_PGML + +Solve the exponential equation + + [` [$left] = [$right] `] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left( e^{[$var]} \right)^2 +[$b-$a]e^{[$var]} - [$right] &= 0 \\ + \left( e^{[$var]}-[$a] \right) \left( e^{[$var]}+[$b] \right) &= 0 \\ + e^{[$var]}-[$a] &= 0 \text{ or } e^{[$var]}+[$b] = 0 \\ + e^{[$var]} &= [$a] \text{ or } e^{[$var]} = [$b*-1] \\ + [$var] &= \ln([$a]) \text{ or no solution} \\ +\end{aligned} + ``] + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations60.pg new file mode 100644 index 0000000000..d09663cef4 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialEquations60.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $a = list_random(2,3,5); + $b = random(1,5,1);} +until gcd($b,$a)==1; +$c = random(1,5,1); +$d = $a*$c-$b; +$bc = $b*$c; +$left = Compute("$a*e**(2*$var)")->reduce; +$right = Compute("$bc-$d*e**{$var}")->reduce; +$ans1 = Fraction($b,$a); +$s1 = Compute("$d*e**{$var}")->reduce; + +Context("FiniteSolutionSets"); +Context()->variables->are($var => 'Real'); +$ans = Formula("{ln($ans1)}"); + +############################################## + +BEGIN_PGML + +Solve the exponential equation + + [` [$left] = [$right] `] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left( [$a]e^{[$var]} \right)^2 +[$s1] - [$bc] &= 0 \\ + \left( [$a]e^{[$var]}-[$b] \right) \left( e^{[$var]}+[$c] \right) &= 0 \\ + [$a]e^{[$var]}-[$b] &= 0 \text{ or } e^{[$var]}+[$c] = 0 \\ + e^{[$var]} &= [$ans1] \text{ or } e^{[$var]} = [$c*-1] \\ + [$var] &= \ln\left([$ans1]\right) \text{ or no solution} \\ +\end{aligned} + ``] + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation10.pg new file mode 100644 index 0000000000..d89b638eab --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation10.pg @@ -0,0 +1,250 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$a = random(1.5,3.5,0.5); +$vshift = non_zero_random(-2,2,1); +$vshiftN = -$vshift; +$hshift = non_zero_random(-2,2,1); + +$fp = Formula("($a)**x")->reduce; +$func = Formula("($a)**(x+$hshift)+$vshift")->reduce; +$f[0] = $func; +$f[1] = Formula("($a)**(x-$hshift)-$vshift")->reduce; +$f[2] = Formula("(1/$a)**(x+$hshift)+$vshift")->reduce; +$f[3] = Formula("(1/$a)**(x-$hshift)-$vshift")->reduce; +$f[4] = $fp; + +@fx = ( ); +@fy = ( ); +$fx[0][0] = -$hshift; +$fx[0][1] = 1-$hshift; +$fx[1][0] = $hshift; +$fx[1][1] = 1+$hshift; +$fx[2][0] = -$hshift; +$fx[2][1] = -1-$hshift; +$fx[3][0] = $hshift; +$fx[3][1] = -1+$hshift; + +$fx[0][2] = 0; +$fx[0][3] = 1; +$fy[0][2] = $fp->eval(x=>$fx[0][2]); +$fy[0][3] = $fp->eval(x=>$fx[0][3]); + +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fy[$i][$j] = $f[$i]->eval(x=>$fx[$i][$j]); + } +} + +@alt = (); +$alt[0] = "This is a graph of a smooth curve. The function approaches y=$vshift when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1]). There is a horizontal asymptote at y=$vshift."; +$alt[1] = "This is a graph of a smooth curve. The function approaches y=$vshiftN when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[1][0],$fy[1][0]) and ($fx[1][1],$fy[1][1]). There is a horizontal asymptote at y=$vshiftN."; +$alt[2] = "This is a graph of a smooth curve. The function approaches y=$vshift when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[2][0],$fy[2][0]) and ($fx[2][1],$fy[2][1]). There is a horizontal asymptote at y=$vshift."; +$alt[3] = "This is a graph of a smooth curve. The function approaches y=$vshiftN when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[3][0],$fy[3][0]) and ($fx[3][1],$fy[3][1]). There is a horizontal asymptote at y=$vshiftN."; +$alt[4] = "This is a graph of a smooth curve. The function approaches y=0 when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][2],$fy[0][2]) and ($fx[0][3],$fy[0][3]). There is a horizontal asymptote at y=0."; + + +$bound = 5; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$bound> " . + "using color:blue and weight:2"); + if ( ($i==0) || ($i==2) ) { + $graphs[$i]->moveTo(-$bound,$vshift); + $graphs[$i]->lineTo($bound,$vshift,'red',2,'dashed'); + } elsif ( ($i==1) || ($i==3) ) { + $graphs[$i]->moveTo(-$bound,-$vshift); + $graphs[$i]->lineTo($bound,-$vshift,'red',2,'dashed'); + } else { + $graphs[$i]->moveTo(-$bound,0); + $graphs[$i]->lineTo($bound,0,'red',2,'dashed'); + } +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$uod = ($vshift>0) ? "up" : "down"; +$lor = ($hshift>0) ? "left" : "right"; +$vshiftA = abs($vshift); +$hshiftA = abs($hshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=[$fp]`]. This function passes the points [`([$fx[0][2]],[$fy[0][2]])`] and [`([$fx[0][3]],[$fy[0][3]])`]. The function has a horizontal asymptote at [`y=0`]. + +>>[@image(insertGraph( $graphs[4] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'")@]*<< + +To transform from [`y=[$fp]`] to [`f(x)=[$f[0]]`], there is a vertical shift [$uod] by [`[$vshiftA]`] units, and there is a horizontal shift to the [$lor] by [`[$hshiftA]`] units. + +This implies the point [`([$fx[0][2]],[$fy[0][2]])`] on [`y=[$fp]`] is transformed to [`([$fx[0][0]],[$fy[0][0]])`] on [`f(x)=[$f[0]]`]. + +The point [`([$fx[0][3]],[$fy[0][3]])`] on [`y=[$fp]`] is transformed to [`([$fx[0][1]],[$fy[0][1]])`] on [`f(x)=[$f[0]]`]. + +The horizontal asymptote is transformed to [`y=[$vshift]`]. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation20.pg new file mode 100644 index 0000000000..f8cc200f78 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation20.pg @@ -0,0 +1,250 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$a = random(0.3,0.9,0.1); +$vshift = non_zero_random(-2,2,1); +$hshift = non_zero_random(-2,2,1); +$vshiftN = -$vshift; + +$fp = Formula("($a)**x")->reduce; +$func = Formula("($a)**(x+$hshift)+$vshift")->reduce; +$f[0] = $func; +$f[1] = Formula("($a)**(x-$hshift)-$vshift")->reduce; +$f[2] = Formula("(1/$a)**(x+$hshift)+$vshift")->reduce; +$f[3] = Formula("(1/$a)**(x-$hshift)-$vshift")->reduce; +$f[4] = $fp; + +@fx = ( ); +@fy = ( ); +$fx[0][0] = -$hshift; +$fx[0][1] = 1-$hshift; +$fx[1][0] = $hshift; +$fx[1][1] = 1+$hshift; +$fx[2][0] = -$hshift; +$fx[2][1] = -1-$hshift; +$fx[3][0] = $hshift; +$fx[3][1] = -1+$hshift; + +$fx[0][2] = 0; +$fx[0][3] = 1; +$fy[0][2] = $fp->eval(x=>$fx[0][2]); +$fy[0][3] = $fp->eval(x=>$fx[0][3]); + +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fy[$i][$j] = $f[$i]->eval(x=>$fx[$i][$j]); + } +} + +@alt = (); +$alt[0] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches negative infinity, and approaches y=$vshift when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1]). There is a horizontal asymptote at y=$vshift."; +$alt[1] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches negative infinity, and approaches y=$vshiftN when x-value approaches positive infinity. The graph passes the points ($fx[1][0],$fy[1][0]) and ($fx[1][1],$fy[1][1]). There is a horizontal asymptote at y=$vshiftN."; +$alt[2] = "This is a graph of a smooth curve. The function approaches y=$vshift when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[2][0],$fy[2][0]) and ($fx[2][1],$fy[2][1]). There is a horizontal asymptote at y=$vshift."; +$alt[3] = "This is a graph of a smooth curve. The function approaches y=$vshiftN when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[3][0],$fy[3][0]) and ($fx[3][1],$fy[3][1]). There is a horizontal asymptote at y=$vshiftN."; +$alt[4] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches negative infinity, and approaches y=0 when x-value approaches positive infinity. The graph passes the points ($fx[0][2],$fy[0][2]) and ($fx[0][3],$fy[0][3]). There is a horizontal asymptote at y=0."; + +$bound = 5; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$bound> " . + "using color:blue and weight:2"); + if ( ($i==0) || ($i==2) ) { + $graphs[$i]->moveTo(-$bound,$vshift); + $graphs[$i]->lineTo($bound,$vshift,'red',2,'dashed'); + } elsif ( ($i==1) || ($i==3) ) { + $graphs[$i]->moveTo(-$bound,-$vshift); + $graphs[$i]->lineTo($bound,-$vshift,'red',2,'dashed'); + } else { + $graphs[$i]->moveTo(-$bound,0); + $graphs[$i]->lineTo($bound,0,'red',2,'dashed'); + } + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$uod = ($vshift>0) ? "up" : "down"; +$lor = ($hshift>0) ? "left" : "right"; +$vshiftA = abs($vshift); +$hshiftA = abs($hshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=[$fp]`]. This function passes the points [`([$fx[0][2]],[$fy[0][2]])`] and [`([$fx[0][3]],[$fy[0][3]])`]. The function has a horizontal asymptote at [`y=0`]. + +>>[@image(insertGraph( $graphs[4] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'")@]*<< + +To transform from [`y=[$fp]`] to [`f(x)=[$f[0]]`], there is a vertical shift [$uod] by [`[$vshiftA]`] units, and there is a horizontal shift to the [$lor] by [`[$hshiftA]`] units. + +This implies the point [`([$fx[0][2]],[$fy[0][2]])`] on [`y=[$fp]`] is transformed to [`([$fx[0][0]],[$fy[0][0]])`] on [`f(x)=[$f[0]]`]. + +This implies the point [`([$fx[0][3]],[$fy[0][3]])`] on [`y=[$fp]`] is transformed to [`([$fx[0][1]],[$fy[0][1]])`] on [`f(x)=[$f[0]]`]. + +The horizontal asymptote is transformed to [`y=[$vshift]`]. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation30.pg new file mode 100644 index 0000000000..f866f5b553 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation30.pg @@ -0,0 +1,251 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$a = random(1.5,3.5,0.5); +$vshift = non_zero_random(-2,2,1); +$vshiftN = -$vshift; +$hshift = 0; + +$fp = Formula("($a)**(x)")->reduce; +$func = Formula("-($a)**(x)+$vshift")->reduce; +$f[0] = $func; +$f[1] = Formula("($a)**(-x)+$vshift")->reduce; +$f[2] = Formula("-($a)**(x)-$vshift")->reduce; +$f[3] = Formula("-(1/$a)**(x)-$vshift")->reduce; +$f[4] = $fp; + +@fx = ( ); +@fy = ( ); +$fx[0][0] = -$hshift; +$fx[0][1] = 1-$hshift; +$fx[1][0] = $hshift; +$fx[1][1] = 1+$hshift; +$fx[2][0] = -$hshift; +$fx[2][1] = 1-$hshift; +$fx[3][0] = $hshift; +$fx[3][1] = 1+$hshift; + +$fx[0][2] = 0; +$fx[0][3] = 1; +$fy[0][2] = $fp->eval(x=>$fx[0][2]); +$fy[0][3] = $fp->eval(x=>$fx[0][3]); + +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fy[$i][$j] = $f[$i]->eval(x=>$fx[$i][$j]); + } +} + +@alt = (); +$alt[0] = "This is a graph of a smooth curve. The function approaches y=$vshift when x-value approaches negative infinity, and approaches negative infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1]). There is a horizontal asymptote at y=$vshift."; +$alt[1] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches negative infinity, and approaches y=$vshift when x-value approaches positive infinity. The graph passes the points ($fx[1][0],$fy[1][0]) and ($fx[1][1],$fy[1][1]). There is a horizontal asymptote at y=$vshift."; +$alt[2] = "This is a graph of a smooth curve. The function approaches y=$vshiftN when x-value approaches negative infinity, and approaches negative infinity when x-value approaches positive infinity. The graph passes the points ($fx[2][0],$fy[2][0]) and ($fx[2][1],$fy[2][1]). There is a horizontal asymptote at y=$vshiftN."; +$alt[3] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches negative infinity, and approaches y=$vshiftN when x-value approaches positive infinity. The graph passes the points ($fx[3][0],$fy[3][0]) and ($fx[3][1],$fy[3][1]). There is a horizontal asymptote at y=$vshiftN."; +$alt[4] = "This is a graph of a smooth curve. The function approaches y=0 when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][2],$fy[0][2]) and ($fx[0][3],$fy[0][3]). There is a horizontal asymptote at y=0."; + + +$bound = 5; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$bound> " . + "using color:blue and weight:2"); + if ( ($i==0) || ($i==1) ) { + $graphs[$i]->moveTo(-$bound,$vshift); + $graphs[$i]->lineTo($bound,$vshift,'red',2,'dashed'); + } elsif ( ($i==2) || ($i==3) ) { + $graphs[$i]->moveTo(-$bound,-$vshift); + $graphs[$i]->lineTo($bound,-$vshift,'red',2,'dashed'); + } else { + $graphs[$i]->moveTo(-$bound,0); + $graphs[$i]->lineTo($bound,0,'red',2,'dashed'); + } + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$uod = ($vshift>0) ? "up" : "down"; +$lor = ($hshift>0) ? "left" : "right"; +$vshiftA = abs($vshift); +$hshiftA = abs($hshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=[$fp]`]. This function passes the points [`([$fx[0][2]],[$fy[0][2]])`] and [`([$fx[0][3]],[$fy[0][3]])`]. The function has a horizontal asymptote at [`y=0`]. + +>>[@image(insertGraph( $graphs[4] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'")@]*<< + +To transform from [`y=[$fp]`] to [`f(x)=[$f[0]]`], there is a reflection by the [`x`]-axis, and a vertical shift [$uod] by [`[$vshiftA]`] units. By order of transformations, we need to reflect, and then shift. + +This implies the point [`([$fx[0][2]],[$fy[0][2]])`] on [`y=[$fp]`] is transformed to [`([$fx[0][0]],[$fy[0][0]])`] on [`f(x)=[$f[0]]`]. + +Similarly, the point [`([$fx[0][3]],[$fy[0][3]])`] on [`y=[$fp]`] is transformed to [`([$fx[0][1]],[$fy[0][1]])`] on [`f(x)=[$f[0]]`]. + +The horizontal asymptote is transformed to [`y=[$vshift]`]. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation40.pg new file mode 100644 index 0000000000..6a40c25772 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation40.pg @@ -0,0 +1,244 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$a = random(0.3,0.9,0.1); +$hshift = non_zero_random(-2,2,1); +$hshiftN = -$hshift; + +$fp = Formula("($a)**(x)")->reduce; +$func = Formula("($a)**(-x-$hshift)")->reduce; +$funcFactored = Formula("($a)**(-(x+$hshift))")->reduce; +$f[0] = $func; +$f[1] = Formula("($a)**(-x+$hshift)")->reduce; +$f[2] = Formula("($a)**(x+$hshift)")->reduce; +$f[3] = Formula("($a)**(x-$hshift)")->reduce; +$f[4] = $fp; + +@fx = ( ); +@fy = ( ); +$fx[0][0] = $hshiftN; +$fx[0][1] = -1-$hshift; +$fx[1][0] = $hshift; +$fx[1][1] = -1+$hshift; +$fx[2][0] = $hshiftN; +$fx[2][1] = 1-$hshift; +$fx[3][0] = $hshift; +$fx[3][1] = 1+$hshift; + +$fx[0][2] = 0; +$fx[0][3] = 1; +$fy[0][2] = $fp->eval(x=>$fx[0][2]); +$fy[0][3] = $fp->eval(x=>$fx[0][3]); + +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fy[$i][$j] = $f[$i]->eval(x=>$fx[$i][$j]); + } +} + +@alt = (); +$alt[0] = "This is a graph of a smooth curve. The function approaches y=0 when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1]). There is a horizontal asymptote at y=0."; +$alt[1] = "This is a graph of a smooth curve. The function approaches y=0 when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[1][0],$fy[1][0]) and ($fx[1][1],$fy[1][1]). There is a horizontal asymptote at y=0."; +$alt[2] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches negative infinity, and approaches y=0 when x-value approaches positive infinity. The graph passes the points ($fx[2][0],$fy[2][0]) and ($fx[2][1],$fy[2][1]). There is a horizontal asymptote at y=0."; +$alt[3] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches negative infinity, and approaches y=0 when x-value approaches positive infinity. The graph passes the points ($fx[3][0],$fy[3][0]) and ($fx[3][1],$fy[3][1]). There is a horizontal asymptote at y=0."; +$alt[4] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches negative infinity, and approaches y=0 when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1]). There is a horizontal asymptote at y=0."; + + +$bound = 5; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$bound> " . + "using color:blue and weight:2"); + + $graphs[$i]->moveTo(-$bound,0); + $graphs[$i]->lineTo($bound,0,'red',2,'dashed'); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$lor = ($hshift>0) ? "left" : "right"; +$hshiftA = abs($hshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=[$fp]`]. This function passes the points [`([$fx[0][2]],[$fy[0][2]])`] and [`([$fx[0][3]],[$fy[0][3]])`]. The function has a horizontal asymptote at [`y=0`]. + +>>[@image(insertGraph( $graphs[4] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'")@]*<< + +Before we do transformations, we need to factor out the number in front of [`x`], and convert [`f(x)=[$f[0]]`] to [`f(x)=[$funcFactored]`]. + +To transform from [`y=[$fp]`] to [`f(x)=[$funcFactored]`], there is a reflection by the [`y`]-axis, and a horizontal shift to the [$lor] by [`[$hshiftA]`] units. By order of transformations, we need to reflect, and then shift. + +This implies the point [`([$fx[0][2]],[$fy[0][2]])`] on [`y=[$fp]`] is transformed to [`([$fx[0][0]],[$fy[0][0]])`] on [`f(x)=[$f[0]]`]. + +Similarly, the point [`([$fx[0][3]],[$fy[0][3]])`] on [`y=[$fp]`] is transformed to [`([$fx[0][1]],[$fy[0][1]])`] on [`f(x)=[$f[0]]`]. + +The horizontal asymptote stays at [`y=0`]. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation50.pg new file mode 100644 index 0000000000..9dbf24e097 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation50.pg @@ -0,0 +1,256 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +do { + +$a = e; +$vshift = non_zero_random(-2,2,1); +$vshiftN = -$vshift; +$hshift = 0; +$c = list_random(0.2,0.4,0.5,1.5,2,3); +$vshift2 = $c*$vshift; + +$fp = Formula("($a)**(x)")->reduce; +$func = Formula("$c*($a)**(x)+$vshift")->reduce; +$f[0] = $func; +$f[1] = Formula("$c*(($a)**(x)+$vshift)")->reduce; +$f[2] = Formula("$c*(1/$a)**(x)+$vshift")->reduce; +$f[3] = Formula("$c*((1/$a)**(x)+$vshift)")->reduce; +$f[4] = $fp; + +@fx = ( ); +@fy = ( ); + +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fx[$i][$j] = ($j==0) ? 0 : 1; + } +} + +$fx[0][2] = 0; +$fx[0][3] = 1; +$fy[0][2] = $fp->eval(x=>$fx[0][2]); +$fy[0][3] = $fp->eval(x=>$fx[0][3]); + +$flag = 0; +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fy[$i][$j] = $f[$i]->eval(x=>$fx[$i][$j]); + if ($fy[$i][$j]>5) {$flag=1;} + } +} + +} until ($flag==0); + +@alt = (); +$alt[0] = "This is a graph of a smooth curve. The function approaches y=$vshift when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1]). There is a horizontal asymptote at y=$vshift."; +$alt[1] = "This is a graph of a smooth curve. The function approaches y=$vshift2 when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[1][0],$fy[1][0]) and ($fx[1][1],$fy[1][1]). There is a horizontal asymptote at y=$vshift2."; +$alt[2] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches negative infinity, and approaches y=$vshift when x-value approaches positive infinity. The graph passes the points ($fx[2][0],$fy[2][0]) and ($fx[2][1],$fy[2][1]). There is a horizontal asymptote at y=$vshift."; +$alt[3] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches negative infinity, and approaches y=$vshift2 when x-value approaches positive infinity. The graph passes the points ($fx[3][0],$fy[3][0]) and ($fx[3][1],$fy[3][1]). There is a horizontal asymptote at y=$vshift2."; +$alt[4] = "This is a graph of a smooth curve. The function approaches y=0 when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][2],$fy[0][2]) and (1,e). There is a horizontal asymptote at y=0."; + +$bound = 5; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$bound> " . + "using color:blue and weight:2"); + if ( ($i==0) || ($i==2) ) { + $graphs[$i]->moveTo(-$bound,$vshift); + $graphs[$i]->lineTo($bound,$vshift,'red',2,'dashed'); + } elsif ( ($i==1) || ($i==3) ) { + $graphs[$i]->moveTo(-$bound,$vshift2); + $graphs[$i]->lineTo($bound,$vshift2,'red',2,'dashed'); + } else { + $graphs[$i]->moveTo(-$bound,0); + $graphs[$i]->lineTo($bound,0,'red',2,'dashed'); + } + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$soc = ($c>1) ? "stretch" : "compression"; +$soc2 = ($c>1) ? "stretch" : "compress"; +$uod = ($vshift>0) ? "up" : "down"; +$vshiftA = abs($vshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=[$fp]`]. This function passes the points [`([$fx[0][2]],[$fy[0][2]])`] and [`([$fx[0][3]],e)`]. (Recall that [`e\approx2.718`].) The function has a horizontal asymptote at [`y=0`]. + +>>[@image(insertGraph( $graphs[4] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'")@]*<< + +To transform from [`y=[$fp]`] to [`f(x)=[$f[0]]`], there is a vertical [$soc] by a factor of [`[$c]`], and a vertical shift [$uod] by [`[$vshiftA]`] units. By order of transformations, we need to [$soc2] first, and then shift. + +This implies the point [`([$fx[0][2]],[$fy[0][2]])`] on [`y=[$fp]`] is transformed to [`([$fx[0][0]],[$fy[0][0]])`] on [`f(x)=[$f[0]]`]. + +Similarly, the point [`([$fx[0][3]],e)`] on [`y=[$fp]`] is transformed to [`([$fx[0][1]],[$fy[0][1]])`] on [`f(x)=[$f[0]]`]. + +The horizontal asymptote is transformed to [`y=[$vshift]`]. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation60.pg new file mode 100644 index 0000000000..ff528bfd4a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialGraphTransformation60.pg @@ -0,0 +1,248 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +do { + +$a = e; +$hshift = non_zero_random(-2,2,1); +$hshiftN = -$hshift; +do {$c = random(0.2,1.5,0.1);} until ($c!=1); + +$fp = Formula("($a)**(x)")->reduce; +$func = Formula("-$c*($a)**(x+$hshift)")->reduce; +$f[0] = $func; +$f[1] = Formula("-$c*($a)**(x-$hshift)")->reduce; +$f[2] = Formula("$c*($a)**(-x+$hshift)")->reduce; +$f[3] = Formula("$c*($a)**(-x-$hshift)")->reduce; +$f[4] = $fp; + +@fx = ( ); +@fy = ( ); + +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fx[$i][$j] = ($j==0) ? 0 : 1; + } +} + +$fx[0][2] = 0; +$fx[0][3] = 1; +$fy[0][2] = $fp->eval(x=>$fx[0][2]); +$fy[0][3] = $fp->eval(x=>$fx[0][3]); + +$flag = 0; +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fy[$i][$j] = $f[$i]->eval(x=>$fx[$i][$j]); + if ($fy[$i][$j]>5) {$flag=1;} + } +} + +} until ($flag==0); + +@alt = (); +$alt[0] = "This is a graph of a smooth curve. The function approaches y=0 when x-value approaches negative infinity, and approaches negative infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1])."; +$alt[1] = "This is a graph of a smooth curve. The function approaches y=0 when x-value approaches negative infinity, and approaches negative infinity when x-value approaches positive infinity. The graph passes the points ($fx[1][0],$fy[1][0]) and ($fx[1][1],$fy[1][1])."; +$alt[2] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches negative infinity, and approaches y=0 when x-value approaches positive infinity. The graph passes the points ($fx[2][0],$fy[2][0]) and ($fx[2][1],$fy[2][1])."; +$alt[3] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches negative infinity, and approaches y=0 when x-value approaches positive infinity. The graph passes the points ($fx[3][0],$fy[3][0]) and ($fx[3][1],$fy[3][1])."; +$alt[4] = "This is a graph of a smooth curve. The function approaches y=0 when x-value approaches negative infinity, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][2],$fy[0][2]) and (1,e). There is a horizontal asymptote at y=0."; + + +$bound = 5; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$bound> " . + "using color:blue and weight:2"); + + $graphs[$i]->moveTo(-$bound,0); + $graphs[$i]->lineTo($bound,0,'red',2,'dashed'); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$soc = ($c>1) ? "stretch" : "compression"; +$soc2 = ($c>1) ? "stretch" : "compress"; +$lor = ($hshift>0) ? "left" : "right"; +$hshiftA = abs($hshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=[$fp]`]. This function passes the points [`([$fx[0][2]],[$fy[0][2]])`] and [`([$fx[0][3]],e)`]. (Recall that [`e\approx2.718`].) The function has a horizontal asymptote at [`y=0`]. + +>>[@image(insertGraph( $graphs[4] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'")@]*<< + +To transform from [`y=[$fp]`] to [`f(x)=[$f[0]]`], there is a reflection by the [`x`]-axis, a vertical [$soc] by a factor of [`[$c]`], and a horizontal shift to the [$uod] by [`[$hshiftA]`] units. By order of transformations, we need to reflect, then [$soc2], and finally shift. + +This implies the point [`([$fx[0][2]],[$fy[0][2]])`] on [`y=[$fp]`] is transformed to [`([$fx[0][0]],[$fy[0][0]])`] on [`f(x)=[$f[0]]`]. + +Similarly, the point [`([$fx[0][3]],e)`] on [`y=[$fp]`] is transformed to [`([$fx[0][1]],[$fy[0][1]])`] on [`f(x)=[$f[0]]`]. + +The horizontal asymptote stays at [`y=0`]. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable.pg new file mode 100644 index 0000000000..c7f43a1fd2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable.pg @@ -0,0 +1,129 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$b = list_random(2,4,5,10,20); + +@x = (1,2,4,5,8,9); + +for my $i (0..5) { +$fOfx[$i] = $b**(6-$x[$i]); +}; + + +$radio = RadioButtons( + ["Yes, this could be an exponential function.","No, this couldn't be an exponential function."], + "Yes, this could be an exponential function.", # correct answer + last => ["No, this couldn't be an exponential function."], # can be a list +); + + + +############################################## + +BEGIN_PGML + +Could the function whose values are in the table be an exponential function? + +END_PGML + +BEGIN_TEXT +$PAR +\{ +DataTable( +[ +['x',$x[0],$x[1],$x[2],$x[3],$x[4],$x[5]], +['f(x)',$fOfx[0],$fOfx[1],$fOfx[2],$fOfx[3],$fOfx[4],$fOfx[5]], +], +rowheaders=>1, +encase=>['\(','\)'], +midrules=>1, +)\} +$PAR +END_TEXT + +BEGIN_PGML + +[@ $radio->buttons() @]* + + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +The ratio between [`f(2)`] and [`f(1)`] is [`\frac{[@$fOfx[1]@]}{[@$fOfx[0]@]}`], which is [`\frac{1}{[$b]}`]. So if this is an exponential function, its growth factor would have to be [`\frac{1}{[$b]}`]. + +In moving from [`x=2`] to [`x=4`], we would have to multiply [`f(2)`] by [`\frac{1}{[$b]}`] twice: + + [`[@$fOfx[1]@]\cdot \frac{1}{[$b]}\cdot \frac{1}{[$b]} =[@$fOfx[2]@] `] + +and this agrees with [`f(4)`]. + +In moving from [`x=4`] to [`x=5`], we would have to multiply [`f(4)`] by [`\frac{1}{[$b]}`] once: + + [`[@$fOfx[2]@]\cdot \frac{1}{[$b]} =[@$fOfx[3]@] `] + +and this agrees with [`f(5)`]. + +In moving from [`x=5`] to [`x=8`], we would have to multiply [`f(5)`] by [`\frac{1}{[$b]}`] three times: + + [`[@$fOfx[3]@]\cdot \frac{1}{[$b]}\cdot \frac{1}{[$b]}\cdot \frac{1}{[$b]} =[@$fOfx[4]@] `] + +and this agrees with [`f(8)`]. + +In moving from [`x=8`] to [`x=9`], we would have to multiply [`f(8)`] by [`\frac{1}{[$b]}`] once: + + [`[@$fOfx[4]@]\cdot \frac{1}{[$b]}=[@$fOfx[5]@] `] + +and this agrees with [`f(9)`]. + +So the table is completely consistent with [`f`] being an exponential function whose growth factor is [`\frac{1}{[$b]}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable10.pg new file mode 100644 index 0000000000..4981799c25 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable10.pg @@ -0,0 +1,189 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find exponential equation based on data in table. +# +# Last updated: Carl Yao, 6/13/2018 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinates','exponential equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserPopUp.pl", + "contextFraction.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$startX = random(-2,0,1); +$ratio = list_random(2,3,4,5); +do {$startY = random(1,5,1);} until ($startY!=$ratio); +$function = Compute("$startY*$ratio**x")->reduce; + +@xValues = ( ); +@yValues = ( ); +@xIncrease = ( ); +@yIncrease = ( ); +@yIncreaseAbs = ( ); +@yMessage = ( ); + +$xValues[0] = $startX; +$yValues[0] = ($startX>0) ? $startY*$ratio**$startX : Fraction($startY,$ratio**(-$startX)); + +for (my $i=1;$i<=4;$i++) { + $xValues[$i] = $xValues[$i-1]+1; + $yValues[$i] = ($xValues[$i]>0) ? $startY*$ratio**$xValues[$i] : Fraction($startY,$ratio**(-$xValues[$i])); + $xIncrease[$i] = $xValues[$i]-$xValues[$i-1]; +} + +$ans = $function; + + +############################################## + +BEGIN_PGML + +Write an exponential equation which fits data in the table. + +[@DataTable( + [ + [[PF('[`x`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF('[`y`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + ], + [[PF('[`[$xValues[0]]`]'),], + [PF('[`[$yValues[0]]`]'),], + ], + [[PF('[`[$xValues[1]]`]'),], + [PF('[`[$yValues[1]]`]'),], + ], + [[PF('[`[$xValues[2]]`]'),], + [PF('[`[$yValues[2]]`]'),], + ], + [[PF('[`[$xValues[3]]`]'),], + [PF('[`[$yValues[3]]`]'),], + ], + [[PF('[`[$xValues[4]]`]'),], + [PF('[`[$yValues[4]]`]'),], + ], + ], + align => 'c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +The exponential equation is [`y=`][__________]{$ans}. + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + + +[@DataTable( + [ + [[PF(''),], + [PF('[`x`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF('[`y`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF(''),], + ], + [[PF(''),], + [PF('[`[$xValues[0]]`]'),], + [PF('[`[$yValues[0]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[1]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[1]]`]'),], + [PF('[`[$yValues[1]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[2]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[2]]`]'),], + [PF('[`[$yValues[2]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[3]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[3]]`]'),], + [PF('[`[$yValues[3]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[4]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[4]]`]'),], + [PF('[`[$yValues[4]]`]'),], + [PF(''),], + ], + ], + align => 'c c c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +An exponential function usually looks like [`y=C\cdot a^x`], where [`C`] is the *initial value*, and [`a`] is the *ratio*. We need to find the values of [`C`] and [`a`]. + +Since each time when [`x`] increases by [`1`], [`y`] multiplies by [`[$ratio]`], the function's ratio is [`[$ratio]`]. + +Since when [`x=0`], [`y=[$startY]`], the starting value is [`[$startY]`]. + +Finally, the exponential function is [`y=[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable20.pg new file mode 100644 index 0000000000..5667146d1a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable20.pg @@ -0,0 +1,189 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find exponential equation based on data in table. +# +# Last updated: Carl Yao, 6/13/2018 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinates','exponential equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserPopUp.pl", + "contextFraction.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$startX = random(-3,-1,1); +$den = random(2,5,1); +$ratio = Fraction(1,$den); +do {$startY = random(1,5,1);} until ($startY!=$ratio); +$function = Compute("$startY/$den**x")->reduce; + +@xValues = ( ); +@yValues = ( ); +@xIncrease = ( ); +@yIncrease = ( ); +@yIncreaseAbs = ( ); +@yMessage = ( ); + +$xValues[0] = $startX; +$yValues[0] = ($startX>0) ? Fraction($startY,$den**($startX)) : $startY*$den**(-$startX); + +for (my $i=1;$i<=4;$i++) { + $xValues[$i] = $xValues[$i-1]+1; + $yValues[$i] = ($xValues[$i]>0) ? Fraction($startY,$den**($xValues[$i])) : $startY*$den**(-$xValues[$i]); + $xIncrease[$i] = $xValues[$i]-$xValues[$i-1]; +} + +$ans = $function; + + +############################################## + +BEGIN_PGML + +Write an exponential equation which fits data in the table. + +[@DataTable( + [ + [[PF('[`x`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF('[`y`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + ], + [[PF('[`[$xValues[0]]`]'),], + [PF('[`[$yValues[0]]`]'),], + ], + [[PF('[`[$xValues[1]]`]'),], + [PF('[`[$yValues[1]]`]'),], + ], + [[PF('[`[$xValues[2]]`]'),], + [PF('[`[$yValues[2]]`]'),], + ], + [[PF('[`[$xValues[3]]`]'),], + [PF('[`[$yValues[3]]`]'),], + ], + [[PF('[`[$xValues[4]]`]'),], + [PF('[`[$yValues[4]]`]'),], + ], + ], + align => 'c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +The exponential equation is [`y=`][__________]{$ans}. + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +[@DataTable( + [ + [[PF(''),], + [PF('[`x`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF('[`y`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF(''),], + ], + [[PF(''),], + [PF('[`[$xValues[0]]`]'),], + [PF('[`[$yValues[0]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[1]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[1]]`]'),], + [PF('[`[$yValues[1]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[2]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[2]]`]'),], + [PF('[`[$yValues[2]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[3]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[3]]`]'),], + [PF('[`[$yValues[3]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[4]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[4]]`]'),], + [PF('[`[$yValues[4]]`]'),], + [PF(''),], + ], + ], + align => 'c c c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +An exponential function usually looks like [`y=C\cdot a^x`], where [`C`] is the *initial value*, and [`a`] is the *ratio*. We need to find the values of [`C`] and [`a`]. + +Since each time when [`x`] increases by [`1`], [`y`] multiplies by [`[$ratio]`], the function's ratio is [`[$ratio]`]. + +Since when [`x=0`], [`y=[$startY]`], the starting value is [`[$startY]`]. + +Finally, the exponential function is [`y=[$startY]\cdot(\frac{1}{[$den]})^{x}=[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable30.pg new file mode 100644 index 0000000000..e02e0bc155 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable30.pg @@ -0,0 +1,230 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find exponential equation based on data in table. +# +# Last updated: Carl Yao, 6/13/2018 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinates','exponential equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserPopUp.pl", + "contextFraction.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$startX = random(-3,-1,1); +$ratio = list_random(2,3,4,5); +do {$startY = random(1,5,1);} until ($startY!=$ratio); +$function = Compute("$startY*$ratio**x")->reduce; + +@xValues = ( ); +@yValues = ( ); +@xIncrease = ( ); +@yIncrease = ( ); +@yIncreaseAbs = ( ); +@yMessage = ( ); + +$xValues[0] = $startX; +$yValues[0] = ($startX>0) ? $startY*$ratio**$startX : Fraction($startY,$ratio**(-$startX)); + +for (my $i=1;$i<=8;$i++) { + $xValues[$i] = $xValues[$i-1]+1; + $yValues[$i] = ($xValues[$i]>0) ? $startY*$ratio**$xValues[$i] : Fraction($startY,$ratio**(-$xValues[$i])); + $xIncrease[$i] = $xValues[$i]-$xValues[$i-1]; +} + +$ans = $function; + + +############################################## + +BEGIN_PGML + +Write an exponential equation which fits data in the table. + +[@DataTable( + [ + [[PF('[`x`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF('[`y`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + ], + [[PF('[`[$xValues[4]]`]'),], + [PF('[`[$yValues[4]]`]'),], + ], + [[PF('[`[$xValues[5]]`]'),], + [PF('[`[$yValues[5]]`]'),], + ], + [[PF('[`[$xValues[6]]`]'),], + [PF('[`[$yValues[6]]`]'),], + ], + [[PF('[`[$xValues[7]]`]'),], + [PF('[`[$yValues[7]]`]'),], + ], + [[PF('[`[$xValues[8]]`]'),], + [PF('[`[$yValues[8]]`]'),], + ], + ], + align => 'c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +The exponential equation is [`y=`][__________]{$ans}. + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +Based on the data's pattern, we can fill out a few more rows: + +[@DataTable( + [ + [[PF(''),], + [PF('[`x`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF('[`y`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF(''),], + ], + [[PF(''),], + [PF('[`[$xValues[0]]`]'),], + [PF('[`[$yValues[0]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[1]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[1]]`]'),], + [PF('[`[$yValues[1]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[2]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[2]]`]'),], + [PF('[`[$yValues[2]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[3]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[3]]`]'),], + [PF('[`[$yValues[3]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[4]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[4]]`]'),], + [PF('[`[$yValues[4]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[5]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[5]]`]'),], + [PF('[`[$yValues[5]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[6]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[6]]`]'),], + [PF('[`[$yValues[6]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[7]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[7]]`]'),], + [PF('[`[$yValues[7]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[8]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[8]]`]'),], + [PF('[`[$yValues[8]]`]'),], + [PF(''),], + ], + ], + align => 'c c c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +An exponential function usually looks like [`y=C\cdot a^x`], where [`C`] is the *initial value*, and [`a`] is the *ratio*. We need to find the values of [`C`] and [`a`]. + +Since each time when [`x`] increases by [`1`], [`y`] multiplies by [`[$ratio]`], the function's ratio is [`[$ratio]`]. + +Since when [`x=0`], [`y=[$startY]`], the starting value is [`[$startY]`]. + +Finally, the exponential function is [`y=[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable40.pg new file mode 100644 index 0000000000..05e4d00729 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/ExponentialTable40.pg @@ -0,0 +1,231 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Find exponential equation based on data in table. +# +# Last updated: Carl Yao, 6/13/2018 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Coordinate Geometry') +## KEYWORDS('coordinates','exponential equation') +## DBCCSS('F-IF.4') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserPopUp.pl", + "contextFraction.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$startX = random(-3,-1,1); +$den = random(2,5,1); +$ratio = Fraction(1,$den); +do {$startY = random(1,5,1);} until ($startY!=$ratio); +$function = Compute("$startY/$den**x")->reduce; + +@xValues = ( ); +@yValues = ( ); +@xIncrease = ( ); +@yIncrease = ( ); +@yIncreaseAbs = ( ); +@yMessage = ( ); + +$xValues[0] = $startX; +$yValues[0] = ($startX>0) ? Fraction($startY,$den**($startX)) : $startY*$den**(-$startX); + +for (my $i=1;$i<=8;$i++) { + $xValues[$i] = $xValues[$i-1]+1; + $yValues[$i] = ($xValues[$i]>0) ? Fraction($startY,$den**($xValues[$i])) : $startY*$den**(-$xValues[$i]); + $xIncrease[$i] = $xValues[$i]-$xValues[$i-1]; +} + +$ans = $function; + + +############################################## + +BEGIN_PGML + +Write an exponential equation which fits data in the table. + +[@DataTable( + [ + [[PF('[`x`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF('[`y`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + ], + [[PF('[`[$xValues[4]]`]'),], + [PF('[`[$yValues[4]]`]'),], + ], + [[PF('[`[$xValues[5]]`]'),], + [PF('[`[$yValues[5]]`]'),], + ], + [[PF('[`[$xValues[6]]`]'),], + [PF('[`[$yValues[6]]`]'),], + ], + [[PF('[`[$xValues[7]]`]'),], + [PF('[`[$yValues[7]]`]'),], + ], + [[PF('[`[$xValues[8]]`]'),], + [PF('[`[$yValues[8]]`]'),], + ], + ], + align => 'c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +The exponential equation is [`y=`][__________]{$ans}. + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +Based on the data's pattern, we can fill out a few more rows: + +[@DataTable( + [ + [[PF(''),], + [PF('[`x`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF('[`y`]-values'), + cellcss => 'border-bottom: 3px solid; ',], + [PF(''),], + ], + [[PF(''),], + [PF('[`[$xValues[0]]`]'),], + [PF('[`[$yValues[0]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[1]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[1]]`]'),], + [PF('[`[$yValues[1]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[2]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[2]]`]'),], + [PF('[`[$yValues[2]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[3]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[3]]`]'),], + [PF('[`[$yValues[3]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[4]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[4]]`]'),], + [PF('[`[$yValues[4]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[5]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[5]]`]'),], + [PF('[`[$yValues[5]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[6]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[6]]`]'),], + [PF('[`[$yValues[6]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[7]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[7]]`]'),], + [PF('[`[$yValues[7]]`]'),], + [PF(''),], + ], + [[PF('[`x`] increases by [`[$xIncrease[8]]`]'),], + [PF(''),], + [PF(''),], + [PF('[`y`] multiplies by [`[$ratio]`]'),], + ], + [[PF(''),], + [PF('[`[$xValues[8]]`]'),], + [PF('[`[$yValues[8]]`]'),], + [PF(''),], + ], + ], + align => 'c c c c', + columnscss => + ['border-right: 0px solid; ', + ' ', + ' ',], +);@]* + +An exponential function usually looks like [`y=C\cdot a^x`], where [`C`] is the *initial value*, and [`a`] is the *ratio*. We need to find the values of [`C`] and [`a`]. + +Since each time when [`x`] increases by [`1`], [`y`] multiplies by [`[$ratio]`], the function's ratio is [`[$ratio]`]. + +Since when [`x=0`], [`y=[$startY]`], the starting value is [`[$startY]`]. + +Finally, the exponential function is [`y=[$startY]\cdot(\frac{1}{[$den]})^{x}=[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FindExponentialFromGraph.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FindExponentialFromGraph.pg new file mode 100644 index 0000000000..d0960955d1 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FindExponentialFromGraph.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + "parserAssignment.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Fraction"); +Context()->flags->set(reduceConstants=>0); + +$x[0] = Compute(0); +$x[1] = Compute(random(2,4,1)); + +$y[0] = random(0.6,2.6,0.1); + +$factor = list_random(Fraction(3,2),Fraction(2,3),Compute(2),Compute(3)); + +$y[1] = Real($y[0]*($factor**($x[1]))); + +Context("Numeric"); +parser::Assignment->Allow; +parser::Assignment->Function("f"); + +$exponential = Compute("$y[0]*$factor^x"); + +$xmax = max(4,$x[1]+2); +$ymax = max($y[1]+2,1.1*$y[1]); + +$gr = init_graph(-1,-1,$xmax,$ymax, axes=>[0,0], size=>[400,400]); + + +add_functions($gr, "$exponential for x in <-1,$xmax> " . + "using color:blue and weight:2"); + +@halign=($factor>1)?('right','left'):('left','right'); +@valign=($factor>1)?('bottom','top'):('top','bottom'); + +$gr->lb( new Label($x[0],$y[0],"($x[0], $y[0])", + 'black',$halign[0],$valign[0])); +$gr->lb( new Label($x[1],$y[1],"($x[1], $y[1])", + 'black',$halign[1],$valign[1])); + +$gr->stamps( closed_circle($x[0],$y[0],'black') ); +$gr->stamps( closed_circle($x[1],$y[1],'black') ); + + + +$exponential = Compute("f(x)=$y[0]*$factor^x"); + + +############################################## + +BEGIN_PGML + +Find the formula for the exponential function with the graph below + +[@EnlargeImageStatementPGML()@]** + +>>[@image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + +Your answer must be in the form *f(x)=...*. + + [_____________________________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( $exponential->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +We can see from the graph that the initial value of this exponential function is [`[@$y[0]@]`]. So we know that for some value of [`b`] that we have to find, that + + [`f(x)=[@$y[0]@] (b^x)`] + +Using the second data point on the graph, we have + + [`\begin{aligned} +[@$y[1]@] & = [@$y[0]@] (b^[@$x[1]@])\\ +[@$y[1]/$y[0]@] & = b^[@$x[1]@]\\ +[@$y[1]/$y[0]@]^{1/[@$x[1]@]} & = b\\ +b&=[@($y[1]/$y[0])**(1/$x[1])@] +\end{aligned}`] + +So [`[$exponential]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FindRate2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FindRate2.pg new file mode 100644 index 0000000000..e8f880d177 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FindRate2.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextPercent.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + + +$multiYearRate = random(20,40,1); +$time = random(4,10,1); + +$r = ((1+$multiYearRate/100)**(1/$time)-1)*100; + +$bigb = 1+$multiYearRate/100; + +Context("Percent"); +$ans = Percent($r/100); + +############################################## + +BEGIN_PGML + +An investment grows by a total of [`[$multiYearRate]%`] over a [`[$time]`]-year period. What is its effective annual interest rate? + + [________________________] + +END_PGML + +############################################## + +ANS( $ans->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +Let's call the annual growth factor [`[b]`]. Each year, the balance in the account is multiplied by [`b`]. So after [`[$time]`] years, it will have been multiplied by [`b^[$time]`]. And we have been told that after all that time, we have multiplied our original investment by [`[$bigb]`]. This tells us that: + + [`\begin{aligned} +b^[$time] &= [$bigb]\\ +b &= [$bigb]^{1/[$time]}\\ +b &= [@$bigb**(1/$time)@] +\end{aligned}`] + +We have been asked to find the annual growth _rate_, and right now we have found the annual growth _factor_. + + [`\begin{aligned} +r &= b-1\\ +&=[@$bigb**(1/$time)@] - 1\\ +&=[@$bigb**(1/$time)-1@]\\ +&=[@($ans->value)*100@]% +\end{aligned}`] +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints10.pg new file mode 100644 index 0000000000..51dce780ae --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints10.pg @@ -0,0 +1,126 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserAssignment.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Fraction"); + + +$x[0] = random(1,6,1); +$x[1] = random(7,10,1); + +$y[0] = Fraction(random(0.25,2.25,0.25)); +$y[1] = $y[0]*(2**($x[1]-$x[0])); + +$initial = $y[0]*Fraction(1,2**($x[0])); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(x=>'Real', t=>'Real'); + + +parser::Assignment->Allow; +parser::Assignment->Function("f"); + + +$answer = Compute("f(t)=$initial*2^t"); + + + +############################################## + +$x0 = $x[0]; +$x1 = $x[1]; +$y0 = $y[0]; +$y1 = $y[1]; + +BEGIN_PGML + +Find a formula for an exponential function [`f`] with the given conditions. You should answer with a statement of the form *f(x)=...* or *f(t)=...*. + + [`\begin{aligned} +f([$x0]) = [$y0]\\ +f([$x1]) = [$y1] +\end{aligned}`] + + [_____________________________]{$answer} + + +END_PGML + + +############################################## + +$s = $y1/$y0; + +BEGIN_PGML_SOLUTION + +If [`f(t) = a(b)^t`], the two equations tell us: + + [` +\left\{ +\begin{aligned} +[$y0] &= a (b)^{[$x0]}\\ +[$y1] &= a (b)^{[$x1]}\\ +\end{aligned} +\right. +`] + +The result from dividing the second equation's left side by the first equation's left side should equal the result from dividing the second equation's right side by the first equation's right side: + + [`\begin{aligned} +\frac{[$y1]}{[$y0]} &= \frac{a (b)^{[$x1]}}{a (b)^{[$x0]}}\\ +[$s] & = b^{[@$x1-$x0@]}\\ +2 &= b\\ +b &= 2 +\end{aligned}`] + +We can use this in the first equation from our first step: + + [`\begin{aligned} +[$y0] &= a (b)^{[$x0]}\\ +[$y0] &= a (2)^{[$x0]}\\ +[$initial] &= a\\ +a &= [$initial] +\end{aligned}`] + +So [`[$answer]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints100.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints100.pg new file mode 100644 index 0000000000..b52ba3b17d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints100.pg @@ -0,0 +1,171 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "parserAssignment.pl", + "contextPercent.pl", + "contextCurrency.pl", + "answerHints.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$x[0] = 2; +$x[1] = 7; + + +$y[0] = random(1000,5000,100); +$factor = random(1.08,1.21,0.01); +$y[1] = ceil($y[0]*($factor**($x[1]-$x[0]))); + +$factor = ($y[1]/$y[0])**(1/($x[1]-$x[0])); + +$deposit = round($y[0]/($factor**2)*100)/100; +$exponential = Compute("$deposit*$factor^x"); + + +$gr = init_graph(-1,-$y[0]/2,10,$y[1]*1.5, axes=>[0,0], size=>[400,400]); + +add_functions($gr, "$exponential for x in <-1,10> " . + "using color:blue and weight:1"); + +$gr->lb( new Label($x[0],$y[0],"($x[0],$y[0])", + 'black','left','top')); + +$gr->lb( new Label($x[1],$y[1],"($x[1],$y[1])", + 'black','left','top')); + +$gr->stamps( closed_circle($x[0],$y[0],'black') ); +$gr->stamps( closed_circle($x[1],$y[1],'black') ); + + + + + +Context("Numeric"); +Context()->variables->are(t=>'Real'); +parser::Assignment->Allow; +parser::Assignment->Function("P"); + + +$deposit = round($y[0]/($factor**2)*100)/100; +$exponential = Compute("P(t)=$deposit*$factor^t"); + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->flags->set(tolerance=>0.501); +Context()->currency->addSymbol("dollars","dollar"); + +$depositC = Currency($deposit); + +Context("Percent"); +$rate = Percent($factor-1); + + +############################################## +$refreshCachedImages = 1; + +BEGIN_PGML + +This is a graph of the balance [`P`] in a bank account (measured in dollars), as a function of time [`t`] (measured in years since the initial deposit). + +[@EnlargeImageStatementPGML()@]** + +>> [@image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + + +Find a possible formula for [`P(t)`], assuming the balance grew exponentially. Your answer should be in the form *P(t)=...*. + + [__________________________]{$exponential} + +What was the initial balance? + + [__________________________]{$depositC} + +What annual interest rate does the account pay? + + [__________________________] + + + +END_PGML + + + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS($rate->cmp()->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$ans) = @_; + return $student > 1; + } => "Did you mean to enter a %?", +))); + + +############################################## + +$x0 = $x[0]; +$x1 = $x[1]; +$y0 = $y[0]; +$y1 = $y[1]; + +$year = ($x0 == 1) ? "year" : "years"; + +BEGIN_PGML_SOLUTION + +Let the annual growth factor be [`b`]. At year [`[$x0]`] the balance was [`[$y0]`]. After [`[@$x1-$x0@]`] more years, it had grown to [`[$y1]`]. This tells us that: + + [`\begin{aligned} +[$y0](b)^{[@$x1-$x0@]} &= [$y1]\\ +b^{[@$x1-$x0@]} &= \frac{[$y1]}{[$y0]}\\ +b &= \sqrt[[@$x1-$x0@]]{\frac{[$y1]}{[$y0]}}\\ +b &\approx [$factor] +\end{aligned}`] + +We can find [`a`], the initial value of the exponential function, by moving backwards in time [`[$x0]`] [$year] from year [`[$x0]`]: + + [`\begin{aligned} +a &\approx [$y0]\div([$factor])^{[$x0]}\\ +&\approx [$deposit] +\end{aligned}`] + +So [`[$exponential]`]. The initial balance was [`[$depositC]`]. And the annual interest rate was [`[$factor]-1`], or [`[@($factor-1)*100@]%`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints20.pg new file mode 100644 index 0000000000..7be6e1d55e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints20.pg @@ -0,0 +1,158 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserAssignment.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Fraction"); +Context()->flags->set(reduceConstants=>0); + +$x[0] = Compute(random(1,6,1)); +$x[1] = Compute(random(7,10,1)); + +$y[0] = Fraction(random(1,9,1),4); +$temp = 2**($x[0]-$x[1]); +$y[1] = $y[0]/$temp; + +$temp = 2**($x[0]); + +$initialExp = Fraction($y[0]/$temp); + +$slope = Compute("($y[1]-$y[0])/($x[1]-$x[0])"); +$initialLin = $y[0]-$slope*$x[0]; + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(x=>'Real', t=>'Real'); + + +parser::Assignment->Allow; +parser::Assignment->Function("f"); + + +$exponential = Compute("f(t)=$initialExp*2^t"); +$linear = Formula("x*t+$initialLin")->reduce; +$linear = $linear->substitute(x=>Formula("$slope")); +$linear = Formula("f(t) = $linear"); + +############################################## + +Context()->texStrings; + +BEGIN_PGML + +Suppose that: + + [`\begin{aligned} +f([@$x[0]@]) &= [@$y[0]@]\\ +f([@$x[1]@]) &= [@$y[1]@] +\end{aligned}`] + +a) Find a formula for [`f`] assuming that [`f`] is linear. You should answer with a statement of the form *f(x)=...* or *f(t)=...*. + + [____________________________]{$linear} + +a) Find a formula for [`f`] assuming that [`f`] is exponential. You should answer with a statement of the form *f(x)=...* or *f(t)=...*. + + [____________________________]{$exponential} + + +END_PGML + + + +############################################## + +$showPartialCorrectAnswers = 1; +$s = $y[1]/$y[0]; + +BEGIN_PGML_SOLUTION + +a) If [`f`] is linear, we find its slope using + + [`\begin{aligned} +m &= \frac{y_2-y_1}{x_2-x_1}\\ +&= \frac{[@$y[1]@]-[@$y[0]@]}{[@$x[1]@]-[@$x[0]@]}\\ +& = [$slope] +\end{aligned}`] + + and we can find the [`y`]-intercept [`B`] by solving the following: + + [`\begin{aligned} +y &= mx+B\\ +[@$y[0]@] &= [$slope]\left([@$x[0]@]\right)+B\\ +[@$y[0]@] &= [@$slope*$x[0]@]+B\\ +[$initialLin] & = B\\ +B &= [$initialLin] +\end{aligned}`] + + So [`[$linear]`]. + +a) If [`f`] is exponential, the two equations tell us: + + [` +\left\{ +\begin{aligned} +[@$y[0]@] &= a (b)^{[@$x[0]@]}\\ +[@$y[1]@] &= a (b)^{[@$x[1]@]}\\ +\end{aligned} +\right. +`] + + The result from dividing the second equation's left side by the first equation's left side should equal the result from dividing the second equation's right side by the first equation's right side: + + [`\begin{aligned} +\frac{[@$y[1]@]}{[@$y[0]@]} &= \frac{a (b)^{[@$x[1]@]}}{a (b)^{[@$x[0]@]}}\\ +[$s] & = b^{[@$x[1]-$x[0]@]}\\ +2 &= b\\ +b &= 2 +\end{aligned}`] + + We can use this in the first equation from our first step: + + [`\begin{aligned} +[@$y[0]@] &= a (b)^{[@$x[0]@]}\\ +[@$y[0]@] &= a (2)^{[@$x[0]@]}\\ +[$initialExp] &= a\\ +a &= [$initialExp] +\end{aligned}`] + + So [`[$exponential]`]. + +END_PGML_SOLUTION + +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/GrowthFactor.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/GrowthFactor.pg new file mode 100644 index 0000000000..c00614304a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/GrowthFactor.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$percent = random(20,30,1); + +$growthFactor = 1+$percent/100; + + + + + +############################################## + +BEGIN_PGML + +A city grows by [`{[$percent]}%`] per decade. What is the growth factor each decade? + + [__________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; + + +ANS( Compute("$growthFactor")->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +We have been told that we have a positive growth rate. Specifically, [`r=[@$percent/100@]`]. If the growth factor is denoted [`b`], then we use the relationship: + + [`\begin{aligned} +b&=1+r\\ +b&= 1+[@$percent/100@]\\ +b&=[$growthFactor] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/GrowthFactor2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/GrowthFactor2.pg new file mode 100644 index 0000000000..38d5507aac --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/GrowthFactor2.pg @@ -0,0 +1,73 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$percent = random(1,10,1); + +$growthFactor = 1-$percent/100; + +############################################## + +BEGIN_PGML + +A deer population is depleted by [`{[$percent]}%`] per year. What is the growth factor each year? + + [_________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; + +ANS( Compute("$growthFactor")->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +We have been told that we have a negative growth rate. Specifically, [`r=-[@$percent/100@]`]. If the growth factor is denoted [`b`], then we use the relationship: + + [`\begin{aligned} +b&=1+r\\ +b&= 1-[@$percent/100@]\\ +b&=[$growthFactor] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/LinearTable.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/LinearTable.pg new file mode 100644 index 0000000000..13f1d40b72 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/LinearTable.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$b = random(0.12,3.12,0.2); + +@x = (1,2,4,5,8,9); + +for my $i (0..5) { +$fOfx[$i] = 58.23-($x[$i]*$b); +}; + + +$radio = RadioButtons( + ["Yes, this could be an exponential function.","No, this couldn't be an exponential function."], + "No, this couldn't be an exponential function.", # correct answer + last => ["No, this couldn't be an exponential function."], # can be a list +); + + + +############################################## + +BEGIN_PGML + +Could the function whose values are in the table be an exponential function? + +END_PGML + +BEGIN_TEXT +$PAR +\{ +DataTable( +[ +['x',$x[0],$x[1],$x[2],$x[3],$x[4],$x[5]], +['f(x)',$fOfx[0],$fOfx[1],$fOfx[2],$fOfx[3],$fOfx[4],$fOfx[5]], +], +rowheaders=>1, +encase=>['\(','\)'], +midrules=>1, +)\} +$PAR +END_TEXT + +BEGIN_PGML + +[@ $radio->buttons() @]* + + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +############################################## + +$g = Real($fOfx[1]/$fOfx[0]); + +BEGIN_PGML_SOLUTION + +The ratio between [`f(2)`] and [`f(1)`] is [`\frac{[@$fOfx[1]@]}{[@$fOfx[0]@]}`], which is [`[$g]`]. So if this is an exponential function, its growth factor would have to be [`[$g]`]. + +In moving from [`x=2`] to [`x=4`], we would have to multiply [`f(2)`] by [`[$g]`] twice: + + [`[@$fOfx[1]@]\cdot [$g]\cdot [$g] =[@$fOfx[1]*$g*$g@] `] + +and this does not agree with [`f(4)`]. + +So the table is not consistent with [`f`] being an exponential function. (In fact, by looking at the _differences_ between values of [`f`], we could show that this function is in fact _linear_. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/LinearVsExponential.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/LinearVsExponential.pg new file mode 100644 index 0000000000..0f8dcbf76c --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/LinearVsExponential.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->variables->are(t=>'Real'); +parser::Assignment->Allow; +parser::Assignment->Function("P"); + + + +$initial = random(4000,8000,100); +$absoluteDecrease = random(80,150,10); +$percentDecrease = random(5,15,1); +$factor = 1-$percentDecrease/100; + + +$linear = Formula("P(t)=$initial-$absoluteDecrease*t"); +$exponential = Formula("P(t)=$initial*($factor)^t"); + + + +############################################## + +BEGIN_PGML + +A population has size [`[$initial]`] at time [`t=0`], with [`t`] in years. + +a. If the population decreases by [`[$absoluteDecrease]`] per year, find a formula for the population [`P`] at time [`t`]. Write your answer using function notation, in the form *P(t) = ...*. + + [_________________________________] + +a. If the population decreases by [`[$percentDecrease]%`] per year, find a formula for the population [`P`] at time [`t`]. Write your answer using function notation, in the form *P(t) = ...*. + + [_________________________________] + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; + + +ANS( $linear->cmp() ); +ANS( $exponential->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +a. The population is decreases by [`[$absoluteDecrease]`] _individuals_ per year. This means that we have a linear function. Its initial value is [`[$initial]`] and its slope is [`-[$absoluteDecrease]`]. So [`[$linear]`]. + +a. The population is decreases by [`[$percentDecrease]`] _percent_ per year. This means that we have an exponential function. Its initial value is [`[$initial]`] and its growth factor is [`1-[$percentDecrease/100]`], which is [`[$factor]`]. So [`[$exponential]`]. + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Modeling10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Modeling10.pg new file mode 100644 index 0000000000..7628d9959c --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Modeling10.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->variables->are(t=>"Real"); +parser::Assignment->Allow; +parser::Assignment->Function("P"); + + +$initial = random(6,8,0.1); + +$growthRate = random(0.9,2.9,0.2); + +$growthFactor = 1-$growthRate/100; + +$answer = Formula("P(t)=$initial($growthFactor)^t"); + + +############################################## + +BEGIN_PGML + +In 2010, the population of a city was [`[$initial]`] million and declining at a rate of [`[$growthRate]%`] per year. Assuming the percentage growth rate remains constant, express the population [`P`] as a function of [`t`], the number of years after 2010. Continue to measure population in millions. Give your answer as a formula for [`P(t)`], written in the form *P(t)=...*. + + [__________________________________]{$answer} + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Using the standard form for an exponentially declining quantity, [`P(t)=a(b)^t`], where [`a`] is the initial value and [`b`] is the growth factor per year. Here, we were given that [`a`] is [`[$initial]`]. To find [`b`], we use the relation + + [`b=1+r`] + +where [`r`] is the relative growth rate per year. Here, [`r=-[@$growthRate/100@]`], so [`b=1-[@$growthRate/100@]`], and [`b=[$growthFactor]`]. So we have: + + [`[$answer]`] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Modeling20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Modeling20.pg new file mode 100644 index 0000000000..540296e1dc --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Modeling20.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", + +); + + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->variables->are(t=>"Real"); +parser::Assignment->Allow; +parser::Assignment->Function("P"); + + +$initial = random(60,80,1); + +$growthRate = random(0.9,2.9,0.2); + +$growthFactor = 1+$growthRate/100; + +$answer = Formula("P(t)=$initial($growthFactor)^t"); + + +############################################## + +BEGIN_PGML + +In 2010, the population of a country was [`[$initial]`] million and growing at a rate of [`[$growthRate]%`] per year. Assuming the percentage growth rate remains constant, express the population [`P`], measured in millions, as a function of [`t`], the number of years after 2010. Continue to measure population in millions. Give your answer as a formula for [`P(t)`], written in the form *P(t)=...*. + + [__________________________________]{$answer} + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Using the standard form for an exponentially declining quantity, [`P(t)=a(b)^t`], where [`a`] is the initial value and [`b`] is the growth factor per year. Here, we were given that [`a`] is [`[$initial]`]. To find [`b`], we use the relation + + [`b=1+r`] + +where [`r`] is the relative growth rate per year. Here, [`r=[@$growthRate/100@]`], so [`b=1+[@$growthRate/100@]`], and [`b=[$growthFactor]`]. So we have: + + [`[$answer]`] + +END_PGML_SOLUTION + + + + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Modeling30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Modeling30.pg new file mode 100644 index 0000000000..6c278dae93 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Modeling30.pg @@ -0,0 +1,126 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + "PGML.pl", + "contextPercent.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$initial = random(20,30,1); +$factor = random(0.81,0.95,0.02); +$percent = Real(100*(1-$factor)); +$after10 = Real($initial*(($factor)**10)); +$timeTo1 = Real(log(1/$initial)/log($factor)); + +$ans1 = NumberWithUnits($initial, "mg"); +$ans3 = NumberWithUnits($after10, "mg"); +$ans4 = NumberWithUnits($timeTo1, "hr"); + +$onemg = NumberWithUnits(1,"mg"); + +Context("Percent"); + +$ans2 = Percent("$percent %"); + + + +############################################## + +BEGIN_PGML + +The amount of a certain drug (in mg) in the body [`t`] hours after taking a pill is given by [`A(t) = [$initial]([$factor])^t`]. + +a) What is the dose in the pill? + + [__________________]{$ans1} + +a) What proportion of the drug leaves the body each hour? + + [__________________]{$ans2} + +a) What is the amount left in the body after [`10`] hours? + + [__________________]{$ans3} + +a) How long will it be until there less than [`[$onemg]`] left in the body? + + [__________________]{$ans4} + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + + +BEGIN_PGML_SOLUTION + +a) The formula shows us that the initial value is [`[$initial]`], so the the dose of the pill is [`[$ans1]`]. + +a) The formula shows us that the exponential growth factor is [`[$factor]`] per hour. So the relative growth rate is [`[$factor]-1`], which [`[@$factor-1@]`]. So the body loses [`[$percent]%`] each hour. + +a) [`A(10)=[$after10]`], so after 10 hours there is still [`[$ans3]`] left in the body. + +a) We need to solve the equation + + [`\begin{aligned} +A(t)&=1\\ +[$initial]([$factor])^t & = 1 +\end{aligned}`] + + If you have not yet learned about logarithms, you would use a graphing calculator or other computing tool to solve this equation, and find that [`t=[$timeTo1]`]. So it will take [`[$ans4]`] to bring the drug presence down to [`[$onemg]`]. + + If you have learned about logarithms, then you are expected to be able to do at least one of the following three approaches to find a solution. + + [`\begin{aligned} +[$initial]([$factor])^t & = 1 & [$initial]([$factor])^t & = 1 & [$initial]([$factor])^t & = 1\\ +\log\left([$initial]([$factor])^t\right) & = \log(1) & \ln\left([$initial]([$factor])^t\right) & = \ln(1) & [$factor]^t & = \frac{1}{[$initial]}\\ +\log\left([$initial]\right)+\log\left([$factor]^t\right) & = 0 & \ln\left([$initial]\right)+\ln\left([$factor]^t\right) & = 0 & t & = \log_{[$factor]}\left(\frac{1}{[$initial]}\right)\\ +t\log\left([$factor]\right) & = -\log\left([$initial]\right) & t\ln\left([$factor]\right) & = -\ln\left([$initial]\right) \\ +t & = -\frac{\log\left([$initial]\right)}{\log\left([$factor]\right)} & t& = -\frac{\ln\left([$initial]\right)}{\ln\left([$factor]\right) } \\ +\end{aligned}`] + + All three of these are ways to represent the exact solution, and a calculator can give the decimal approximation [`t\approx[$timeTo1]`]. So it will take [`[$ans4]`] to bring the drug presence down to [`[$onemg]`]. + + + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Percentage10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Percentage10.pg new file mode 100644 index 0000000000..8a4ca60c21 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Percentage10.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$initial = Real(random(400,900,100)); + +$percent = Real(random(40,65,1)); + +$incDec = random(-1,1,2); +if ($incDec == -1) { +$incDecString = "decrease"; +} +else {$incDecString = "increase";}; + + +$final = $initial*(1+$incDec*$percent/100); + + + + +############################################## + +BEGIN_PGML + +If you start with [`[$initial]`] items, how many do you have after a [`[$percent]%`] [$incDecString]? + + [__________________]{ $final} + + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +[`[$percent]%`] of [`[$initial]`] is found by multiplying: + + [`\begin{aligned} +[@$percent/100@]\cdot[$initial] & = [@$percent/100*$initial@] +\end{aligned}`] + +And if we start with [`[$initial]`] items and have a [$incDecString] of [`[@$percent/100*$initial@] `], we end up with [`[$final]`] items. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Percentage20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Percentage20.pg new file mode 100644 index 0000000000..50ae8557a8 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/Percentage20.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextPercent.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$start0 = random(8,15,1); + +$start1 = 10*$start0; + +$absoluteIncrease = random(1,4,1); + +$final0 = $start0 + $absoluteIncrease; + +$final1 = $start1 + $absoluteIncrease; + +$increaseR = Real(($final0/$start0-1)*100); +$increaseR2 = Real(($final1/$start1-1)*100); + + + +Context("LimitedPercent-strict"); +Context()->flags->set(noExtraDecimals => 0); + +$increase = Percent("$increaseR %"); +$increase2 = Percent("$increaseR2 %"); + + +############################################## + + +BEGIN_PGML + +a) A quantity increases from [`[$start0]`] to [`[$final0]`]. By what percent was the increase? + + [______________]{$increase} + +a) A second quantity increases from [`[$start1]`] to [`[$final1]`], an increase by the same number of [`[$absoluteIncrease]`]. By what percent was this increase? + + [______________]{$increase2} + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + +BEGIN_PGML_SOLUTION + +a) The quantity increased from [`[$start0]`] by [`[$absoluteIncrease]`]. So it increased by a relative amount of [`\frac{[$absoluteIncrease]}{[$start0]}`], which is [`[$increaseR]%`]. + +a) The quantity increased from [`[$start1]`] by [`[$absoluteIncrease]`]. So it increased by a relative amount of [`\frac{[$absoluteIncrease]}{[$start1]}`], which is [`[$increaseR2]%`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/RelativeGrowthRate10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/RelativeGrowthRate10.pg new file mode 100644 index 0000000000..d28a4e901d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/ExponentialFunctions/RelativeGrowthRate10.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextPercent.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Percent"); + + +$percentDecrease = random(3,8,1); +$numberYears = random(4,7); + +$b = 1-$percentDecrease/100; + +$lb = ($b)**$numberYears; + +$totalDecreaseRate = (1-$lb)*100; + +$answer = Percent(1-$lb); + +############################################## + +BEGIN_PGML + +An investment decreases by [`[$percentDecrease]%`] each year for [`[$numberYears]`] years. By what total percent does it decrease? + + [__________________]{$answer} + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The basic exponential function template is [`A(t)=A_0(b)^t`], where [`b`] is the growth factor per unit time. We have been given the relative growth rate per year of [`-[$percentDecrease]%`], which is [`-[@$percentDecrease/100@]`] as a decimal. This means that the growth factor per year is [`1-[@$percentDecrease/100@]`], which is [`[$b]`]. + +So after [`t`] years, [`A(t)=A_0([$b])^t`]. After [`[$numberYears]`] years, we find that + + [`\begin{aligned} +A([$numberYears]) &= A_0([$b])^{[$numberYears]}\\ +&= A_0([$lb]) +\end{aligned}`] + +So the [`[$numberYears]`]-year growth factor is [`[$lb]`]. This means that the [`[$numberYears]`]-year relative growth rate is [`[$lb]-1`], which is [`[@$lb-1@]`]. + +So the investment will decrease by [`[$totalDecreaseRate]%`]. + +END_PGML_SOLUTION + + + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains02.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains02.pg new file mode 100644 index 0000000000..4f0238bb86 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains02.pg @@ -0,0 +1,85 @@ +##DESCRIPTION +## Algebra problem: combining functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'combining functions', 'domain') + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Combining Functions') +## Date('') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +######################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl", +); + +######################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(1,15,1); +$b = $a + random(5,8,1); + +$c = $a +non_zero_random(-2,2,1); +$d = $b +non_zero_random(-2,2,1); + +Context("Interval"); + +$left1 = list_random('(','['); +$left2 = list_random('(','['); +$right1 = list_random(')',']'); +$right2 = list_random(')',']'); + + +$I1 = Interval("$left1 $a,$b $right1"); +$I2 = Interval("$left2 $c,$d $right2"); + +do { +$f = RandomVariableName(type=>'function'); +$g = RandomVariableName(type=>'function'); +} until ($f ne $g); + +$op=list_random('+','-',''); + +$Intersection = $I1->intersect($I2); + +######################################## + +BEGIN_PGML + +The function [`[$f]`] has domain [`[$I1]`], and the function [`[$g]`] has domain [`[$I2]`]. What is the domain of the function [`[$f] [$op] [$g]`]? + + [__]{$Intersection}{10} + +END_PGML + +######################################## + + +BEGIN_PGML_SOLUTION + +Since [`\left([$f] [$op] [$g]\right)(x)=[$f](x) [$op] [$g](x)`], the function [`[$f] [$op] [$g]`] is only defined for [`x`] such that _both_ [`[$f](x)`] and [`[$g](x)`] are defined. Looking at the intervals [`[$I1]`] and [`[$I2]`], they overlap on the interval [`[$Intersection]`]. + +So the domain of [`[$f] [$op] [$g]`] is [`[$Intersection]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains10.pg new file mode 100644 index 0000000000..82585ebb84 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains10.pg @@ -0,0 +1,111 @@ +##DESCRIPTION +## Algebra problem: combining functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'combining functions', 'domain') +## tsch tagged and PAID on 12-12-2003 + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Combining Functions') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('College Algebra') +## EditionText1('3') +## AuthorText1('Stewart, Redlin, Watson') +## Section1('4.7') +## Problem1('1') + +######################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +"contextRationalFunction.pl", +"contextLimitedPolynomial.pl", +); + +######################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(1,15,1); +do {$b = random(2,15,1)} until ($b != $a); + + +Context("LimitedPolynomial"); +Context()->flags->set(singlePowers=>1); +$f = Formula("x^2-$a x")->reduce; +$g = Formula("x + $b")->reduce; + +$fpg = Formula("x**2-($a-1)*x+$b")->reduce; +$fmg = Formula("x**2-($a+1)*x-$b")->reduce; +$ftg = Formula("x**3+($b-$a)x**2-($a*$b)x")->reduce; + +Context("RationalFunction"); +$fdg = Formula("(x**2-$a*x)/(x+$b)")->reduce; + +Context("Interval"); + +$fpgd = Interval("(-inf,inf)"); +$fmgd = Interval("(-inf,inf)"); +$ftgd = Interval("(-inf,inf)"); +$fdgd = Interval("(-inf,-$b)U(-$b,inf)"); + +######################################## + +BEGIN_PGML +In the following, if your answer includes more than one interval write the intervals separated by the "union" symbol, [`\cup`], which you can type as *U*. If you need to enter the [`\infty`] symbol, type it as *inf*. + + +Given that [`f(x)=[$f]`] and [`g(x)=[$g]`], find and simplify the following: + +a) [`\left(f+g\right)(x)={}`][________________________]{$fpg} and the domain of [`\left(f+g\right)`] is [________________________]{$fpgd} +a) [`\left(f-g\right)(x)={}`][________________________]{$fmg} and the domain of [`\left(f-g\right)`] is [________________________]{$fmgd} +a) [`\left(fg\right)(x)={}`][________________________]{$ftg} and the domain of [`\left(fg\right)`] is [________________________]{$ftgd} +a) [`\left(\frac{f}{g}\right)(x)={}`][________________________]{$fdg} and the domain of [`\left(\frac{f}{g}\right)`] is [________________________]{$fdgd} + +END_PGML + +######################################## + + +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +\left(f+g\right)(x) +&= f(x) + g(x)\\ +&= [$f] + [$g]\\ +&=[$fpg] +\end{aligned}`] +And since both [`f`] and [`g`] have [`(-\infty, \infty)`] for their domains, so does [`f+g`]. +a) [`\begin{aligned}[t] +\left(f-g\right)(x) +&= f(x) - g(x)\\ +&= [$f] -\left([$g]\right)\\ +&=[$fmg] +\end{aligned}`] +And since both [`f`] and [`g`] have [`(-\infty, \infty)`] for their domains, so does [`f+-g`]. +a) [`\begin{aligned}[t] +\left(fg\right)(x) +&= f(x)g(x)\\ +&= ([$f])([$g])\\ +&= [$ftg] +\end{aligned}`] +And since both [`f`] and [`g`] have [`(-\infty, \infty)`] for their domains, so does [`fg`]. +a) [`\begin{aligned}[t] +\left(\frac{f}{g}\right)(x) +&= \frac{f(x)}{g(x)}\\ +&= [$fdg] +\end{aligned}`] +Both [`f`] and [`g`] have [`(-\infty, \infty)`] for their domains. However, for the domain of [`\frac{f}{g}`] we must also exclude input values that lead to an output of [`0`] for [`g`]. In this case, [`-[$b]`] is such a value. So the domain of [`\frac{f}{g}`] is [`[$fdgd]`]. +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains20.pg new file mode 100644 index 0000000000..6b798a2a67 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains20.pg @@ -0,0 +1,121 @@ +##DESCRIPTION +## Algebra problem: combining functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'combining functions', 'domain') +## tcao tagged and PAID on 2-20-2004 + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Combining Functions') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('College Algebra') +## EditionText1('3') +## AuthorText1('Stewart, Redlin, Watson') +## Section1('4.7') +## Problem1('6') + + +######################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextRationalFunction.pl", +"contextLimitedPolynomial.pl", +"PGcourse.pl", +); + +######################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +do +{$a = random(2,15,1); +$b = random(1,15,1); +$c=random(1,15,1); +$d=random(-15,-1,1);} until (gcd($a, $c) == 1 ); + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1); + +$f = Formula("$a/(x-$b)")->reduce; +$g = Formula("$c/(x-$d)")->reduce; + +$fpg=Formula("(($a+$c)x - ($a*$d+$b*$c))/((x-$b)*(x-$d))")->reduce; +$fmg=Formula("(($a-$c)x - ($a*$d-$b*$c))/((x-$b)*(x-$d))")->reduce; +$ftg = Formula("$a*$c/((x-$b)*(x-$d))")->reduce; +$fdg = Formula("($a*x-$d*$a)/($c*x-$b*$c)")->reduce; + +Context("Interval"); + +$fpgd = Interval("(-infinity,$d)U($d,$b)U($b,infinity)"); +$fmgd = Interval("(-infinity,$d)U($d,$b)U($b,infinity)"); +$ftgd = Interval("(-infinity,$d)U($d,$b)U($b,infinity)"); +$fdgd = Interval("(-infinity,$d)U($d,$b)U($b,infinity)"); + +######################################## + +BEGIN_PGML +In the following, if your answer includes more than one interval write the intervals separated by the "union" symbol, [`\cup`], which you can type as *U*. If you need to enter the [`\infty`] symbol, type it as *inf*. + +Given that [`\displaystyle f(x)=[$f]`] and [`\displaystyle g(x)=[$g]`], find and simplify the following: + + +a) [`\left(f+g\right)(x)={}`][________________________]{$fpg} and the domain of [`\left(f+g\right)`] is [________________________]{$fpgd} +a) [`\left(f-g\right)(x)={}`][________________________]{$fmg} and the domain of [`\left(f-g\right)`] is [________________________]{$fmgd} +a) [`\left(fg\right)(x)={}`][________________________]{$ftg} and the domain of [`\left(fg\right)`] is [________________________]{$ftgd} +a) [`\left(\frac{f}{g}\right)(x)={}`][________________________]{$fdg} and the domain of [`\left(\frac{f}{g}\right)`] is [________________________]{$fdgd} + +END_PGML + +######################################## + +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +\left(f+g\right)(x) +&= f(x) + g(x)\\ +&= [$f] + [$g]\\ +&= \frac{[$a](x-[$d])+[$c](x-[$b])}{(x - [$b])(x - [$d])}\\ +&= [$fpg] +\end{aligned}`] +Since [`f`]'s domain excludes [`[$b]`] and [`g`]'s domain excludes [`[$d]`], then the domain of [`f+g`] must exclude both of these. So its domain is [`[$fpgd]`]. + +a) [`\begin{aligned}[t] +\left(f-g\right)(x) +&= f(x) - g(x)\\ +&= [$f] - [$g]\\ +&= \frac{[$a](x-[$d])-[$c](x-[$b])}{(x - [$b])(x - [$d])}\\ +&= [$fmg] +\end{aligned}`] +Since [`f`]'s domain excludes [`[$b]`] and [`g`]'s domain excludes [`[$d]`], then the domain of [`f-g`] must exclude both of these. So its domain is [`[$fmgd]`]. + +a) [`\begin{aligned}[t] +\left(fg\right)(x) +&= f(x)\cdot g(x)\\ +&= [$f]\cdot[$g]\\ +&= [$ftg] +\end{aligned}`] +Since [`f`]'s domain excludes [`[$b]`] and [`g`]'s domain excludes [`[$d]`], then the domain of [`fg`] must exclude both of these. So its domain is [`[$ftgd]`]. + +a) [`\begin{aligned}[t] +\left(\frac{f}{g}\right)(x) +&= \frac{f(x)}{g(x)}\\ +&= \frac{\phantom{x}[$f]\phantom{x}}{[$g]}\\ +&= \frac{[$a](x-[$d])}{[$c](x - [$b])}\\ +&= [$fdg] +\end{aligned}`] +Since [`f`]'s domain excludes [`[$b]`] and [`g`]'s domain excludes [`[$d]`], then the domain of [`\frac{f}{g}`] must exclude both of these. Normally to find the domain of [`\frac{f}{g}`] we would also need to exclude all input values that would make [`g`] have output [`0`]. However for this function [`g`], there are no such input values. So its domain is [`[$fdgd]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains30.pg new file mode 100644 index 0000000000..c01b48b1e6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains30.pg @@ -0,0 +1,82 @@ +##DESCRIPTION +## Algebra problem: combining functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'combining functions', 'domain') +## tcao tagged and PAID on 2-20-2004 + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Combining Functions') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('College Algebra') +## EditionText1('3') +## AuthorText1('Stewart, Redlin, Watson') +## Section1('4.7') +## Problem1('3') + +######################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +######################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$a = random(1,15,1); + +$ans1 = -$a; +$ans2 = $a; +$ans3 = -$a; +$ans4 = $a; +$ans5 = -$a; +$ans6 = $a; +$ans7 = 2; + +Context("Interval"); +$fpgd = Interval("[-$a,$a]"); +$fmgd = Interval("[-$a,$a]"); +$ftgd = Interval("[-$a,$a]"); +$fdgd = Interval("[-$a,$a)"); + + +######################################## + +BEGIN_PGML +In the following, if your answer includes more than one interval write the intervals separated by the "union" symbol, [`\cup`], which you can type as *U*. If you need to enter the [`\infty`] symbol, type it as *inf*. + +Given that [` f(x)=\sqrt{[$a]+x}`] and [` g(x)=\sqrt{[$a]-x}`], + +a) The domain of [`\left(f+g\right)`] is [________________________]{$fpgd} +a) The domain of [`\left(f-g\right)`] is [________________________]{$fmgd} +a) The domain of [`\left(fg\right)`] is [________________________]{$ftgd} +a) The domain of [`\left(\frac{f}{g}\right)`] is [________________________]{$fdgd} + +END_PGML + +######################################## + +BEGIN_PGML_SOLUTION + +If we examine [`f`]'s domain, we need inputs such that [`[$a]+x\geq 0`], or in other words we need [`x\geq -[$a]`]. +If we examine [`g`]'s domain, we need inputs such that [`[$a]-x\geq 0`], or in other words we need [`x\leq [$a]`]. + +a) The domain of [`f+g`] is the intersection of the domain of [`f`] with the domain of [`g`]. That is, we need [`x`]-values that are both greater than or equal to [`-[$a]`] and less than or equal to [`[$a]`]. So the domain of [`f+g`] is [`[-[$a],[$a]]`]. +a) The same reasoning and domain applies to [`f-g`]. +a) The same reasoning and domain applies to [`fg`]. +a) To find the domain of [`\frac{f}{g}`], we first consider the intersection of the domain of [`f`] with the domain of [`g`]. That is, we need [`x`]-values that are both greater than or equal to [`-[$a]`] and less than or equal to [`[$a]`]. That leaves us with [`[-[$a],[$a]]`]. But then we must also exclude any [`x`]-values for which [`g(x)`] is [`0`]. In this case, that would be [`[$a]`]. So the domain of [`\frac{f}{g}`] is [`[-[$a],[$a])`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains40.pg new file mode 100644 index 0000000000..b34edb31e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains40.pg @@ -0,0 +1,100 @@ +##DESCRIPTION +## Algebra problem: combining functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'combining functions', 'domain') + + +## DBsubject() +## DBchapter() +## DBsection() +## Date() +## Author('') +## Institution('') + +######################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextRationalFunction.pl", +"contextLimitedPolynomial.pl", +"PGcourse.pl", +); + +######################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(1,11,1); +$a1=$a**2; +do {$b = random(1,15,1);} until ($b != $a); +$c=random(12,25,1); + +Context("LimitedPolynomial"); +Context()->flags->set(singlePowers=>1); +$f = Formula("x^2-$a1")->reduce; + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1); +$g = Formula("$b/(x-$c)")->reduce; +$ftg = Formula("($b*(x^2-$a1))/(x-$c)")->reduce; +$fdg = Formula("(x**2-$a1)(x-$c)/($b)")->reduce; +$gdf = Formula("$b/((x^2-$a1)*(x-$c))")->reduce; + +Context("Interval"); +$ftgd = Interval("(-infinity,$c)U($c,infinity)"); +$fdgd = Interval("(-infinity,$c)U($c,infinity)"); +$gdfd = Interval("(-infinity,-$a)U(-$a,$a)U($a,$c)U($c,infinity)"); + +######################################## + +BEGIN_PGML +In the following, if your answer includes more than one interval write the intervals separated by the "union" symbol, [`\cup`], which you can type as *U*. If you need to enter the [`\infty`] symbol, type it as *inf*. + +Given that [` f(x)=[$f]`] and [`\displaystyle g(x)=[$g]`], find and simplify each of the following: + +a) [`\left(fg\right)(x)={}`][________________________]{$ftg} and the domain of [`\left(fg\right)`] is [________________________]{$ftgd} +a) [`\left(\frac{f}{g}\right)(x)={}`][________________________]{$fdg} and the domain of [`\left(\frac{f}{g}\right)`] is [________________________]{$fdgd} +a) [`\left(\frac{g}{f}\right)(x)={}`][________________________]{$gdf} and the domain of [`\left(\frac{g}{f}\right)`] is [________________________]{$gdfd} + + +END_PGML + +######################################## + +BEGIN_PGML_SOLUTION + +Note that the domain of [`f`] is [`(-\infty,\infty)`] and the domain of [`g`] is [`(-\infty,[$c])\cup([$c], \infty)`]. + +a) [`\begin{aligned}[t] +\left(fg\right)(x) +&= f(x)\cdot g(x)\\ +&= \left([$f]\right)\left([$g]\right)\\ +&= [$ftg] +\end{aligned}`] +To find the domain of [`fg`] we just need to intersect the domains of [`f`] and [`g`]. That is, we take all [`x`]-values that are in both [`f`]'s domain and [`g`]'s domain. So its domain is [`[$ftgd]`]. + +a) [`\begin{aligned}[t] +\left(\frac{f}{g}\right)(x) +&= \frac{f(x)}{g(x)}\\ +&= \frac{[$f]}{[$g]}\\ +&= [$fdg] +\end{aligned}`] +To find the domain of [`\frac{f}{g}`] we _start_ by intersecting the domains of [`f`] and [`g`]. That is, we take all [`x`]-values that are in both [`f`]'s domain and [`g`]'s domain. This gives us [`[$ftgd]`]. Normally we _also_ have to exclude any [`x`]-values that cause [`g(x)`] to equal [`0`]. In this case, there are no such [`x`]-values though. So the domain of [`\frac{f}{g}`] is [`[$fdgd]`]. + +a) [`\begin{aligned}[t] +\left(\frac{g}{f}\right)(x) +&= \frac{g(x)}{f(x)}\\ +&= \frac{[$g]}{[$f]}\\ +&= [$gdf] +\end{aligned}`] +To find the domain of [`\frac{g}{f}`] we _start_ by intersecting the domains of [`f`] and [`g`]. That is, we take all [`x`]-values that are in both [`f`]'s domain and [`g`]'s domain. This gives us [`[$ftgd]`]. We _also_ have to exclude any [`x`]-values that cause [`f(x)`] to equal [`0`]. In this case, that means we need to exclude [`[$a]`] and [`-[$a]`]. So the domain of [`\frac{g}{f}`] is [`[$gdfd]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains50.pg new file mode 100644 index 0000000000..700b17f3bc --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains50.pg @@ -0,0 +1,116 @@ +##DESCRIPTION +## Algebra problem: combining functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'combining functions', 'domain') + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Combining Functions') +## Date('') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +######################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "parserMultiAnswer.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", +); + +######################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +do { +$f = RandomVariableName(type=>'function'); +$g = RandomVariableName(type=>'function'); +} until ($f ne $g); + +Context("Numeric"); +Context()->variables->add($f=>'Real', $g=>'Real'); +Context()->strings->add( + "independent"=>{}, + "dependent"=>{}, + "input"=>{}, + "output"=>{}, + "explanatory"=>{}, + "response"=>{}, + "argument"=>{}, + "domain"=>{}, + "range"=>{}, +); + +$multians = MultiAnswer(Compute($f), Compute($g))->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $fstu, $gstu ) = @{$student}; + my ( $fcor, $gcor ) = @{$correct}; + if ( ($fcor == $fstu && $gcor == $gstu) || + ($fcor == $gstu && $gcor == $fstu) ) { + return 1; + } else {return 0;} + } +); + +parser::Assignment->Function("$f"); +parser::Assignment->Function("$g"); + +$gfun = Compute("$g(x)"); + +$multians2 = MultiAnswer(Compute($gfun), Formula(0))->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self, $ansHash ) = @_; + $ansHash->{ans_preview} = $ansHash->{original_student_ans}; + my ( $gstu, $zstu ) = @{$student}; + my ( $gcor, $zcor ) = @{$correct}; + if ( ($gcor == $gstu && $zcor == $zstu) || + ($gcor == $zstu && $zcor == $gstu) ) { + return 1; + } else {return 0;} + } +); + + + +######################################## + +Context()->texStrings; +BEGIN_TEXT + +If \($f\) and \($g\) are functions, the domain of \(\frac{$f}{$g}\) is the collection of all numbers \(x\) such that \(x\) is in the \{ans_rule(10)\} of both \{$multians->ans_rule(5)\} and \{$multians->ans_rule(5)\} and for which \{$multians2->ans_rule(5)\}\(\neq\)\{$multians2->ans_rule(5)\}. + +END_TEXT +Context()->normalStrings; + +ANS(Compute('domain')->cmp); +ANS($multians->cmp()); +ANS($multians2->cmp(correct_ans_latex_string => "$g(x);\,0")); + +######################################## + + +BEGIN_PGML_SOLUTION + +If [`[$f]`] and [`[$g]`] are functions, the domain of [`\frac{[$f]}{[$g]}`] is the collection of all numbers [`x`] such that [`x`] is in the _domain_ of both [`[$f]`] and [`[$g]`] and for which [`[$g](x)\neq0`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Domain10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Domain10.pg new file mode 100644 index 0000000000..08e21edd1e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Domain10.pg @@ -0,0 +1,68 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + + +## DBsubject(Algebra) +## DBchapter(Functions) +## DBsection(Domain and range) +## Institution(ASU) +## MLT(HolesRationalFunctions) +## Level(2) +## KEYWORDS('algebra','function','domain') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"extraAnswerEvaluators.pl" +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(1,20,1); +do {$b = random(1,20,1);} until($b != $a); +$c = $b*$b; + +do {$f = RandomVariableName();} until ($f ne 'x'); + +Context("Interval"); +$ans = Interval("(-infinity,-$b)U(-$b,$b)U($b,infinity)"); + +############################################## + +BEGIN_PGML + +Find the domain of [`[$f]`] where [``[$f](x)=\frac{x+[$a]}{x^2-[$c]}``]. + +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + + [_____________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The only potential for an invalid input value would be if the denominator of this expression works out to [`0`]. So we need: + + [`\begin{aligned} +x^2-[$c] &\neq 0\\ +x^2 &\neq [$c]\\ +x &\neq [$b] & \mbox{and}&& x&\neq-[$b]\\ +\end{aligned}`] + +Therefore the domain is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Domain20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Domain20.pg new file mode 100644 index 0000000000..3584bc024b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Domain20.pg @@ -0,0 +1,72 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','function','domain') + +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"extraAnswerEvaluators.pl" +); + +############################################## + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; + +$a = random(2,7,1); +$b = non_zero_random(-12,12,1); +$c = 2*$a**2; +$d = -2*$a; + +do {$f = RandomVariableName();} until ($f ne 'x'); + +Context("Interval"); +$ans = Interval("(-infinity,$d)U($d,$a)U($a,infinity)"); + +############################################## + +BEGIN_PGML + +Find the domain of [`[$f]`] where [``[$f](x)= \frac{16x+[$b]}{x^2+ [$a] x-[$c]} ``]. + +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + + [_______________________]{$ans} + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The only potential for an invalid input value would be if the denominator of this expression works out to [`0`]. So we need: + + [`\begin{aligned} +x^2+ [$a] x-[$c] &\neq 0\\ +(x-[$a])(x-[$d]) &\neq 0\\ +x &\neq [$a] & \mbox{and}&& x&\neq[$d]\\ +\end{aligned}`] + +Therefore the domain is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Domain30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Domain30.pg new file mode 100644 index 0000000000..ad10d93498 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Domain30.pg @@ -0,0 +1,70 @@ +## DESCRIPTION +## Algebra and Number Theory +## ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Functions) +## DBsection(Domain and range) +## Institution(ASU) +## MLT(DomainRootFraction) +## Level(2) +## KEYWORDS('algebra', 'functions', 'domain of function') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"extraAnswerEvaluators.pl" +); + +############################################## + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; + +$a = random(1, 20, 1); +$b = random(1, 10, 1); + + +do {$f = RandomVariableName();} until ($f ne 'x'); + +Context("Interval"); +$ans = Interval("[-$a, $b) U ($b, infinity)"); + +############################################## + +BEGIN_PGML + +Find the domain of [`[$f]`] where [``[$f](x)= \frac{\sqrt{[$a] + x}}{[$b] - x}``]. + +[@KeyboardInstructions('Answer using interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + + [_______________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +There are two potential sources for an invalid input value. One is if the denominator of this expression works out to [`0`]. The other is if the expression inside the radical is works out to something negative. So we need: + + [`\begin{aligned} +[$b] - x &\neq 0& \mbox{and}&&[$a] + x&\geq0\\ +[$b] &\neq x& \mbox{and}&& x&\geq -[$a]\\ +x &\neq [$b] & \mbox{and}&& x&\geq -[$a]\\ +\end{aligned}`] + +Therefore the domain is [`[$ans]`]. + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainInContext10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainInContext10.pg new file mode 100644 index 0000000000..5b45b25d16 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainInContext10.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Yao 03/26/2018 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"extraAnswerEvaluators.pl" +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$p = random(100,400,50); +$q = $p/2; + +Context("Interval"); +$ans = Interval("(0,$q)"); + +############################################## + +BEGIN_PGML + +You will build a rectangular pen with [`[$p]`] yards of fence. If the pen's height is [`h`] yards, the length of the pen's base, in yards, can be modeled by the function [`b(h)`]. In this context, find the domain of [`b(h)`]. + +Using interval notation, the domain of the function [`b(h)`] is [__________________________________]{$ans} + +[@KeyboardInstructions('If the answer includes more than one interval write the intervals separated by the union symbol, which you can type as [|U|]*. If the answer uses [`\infty`], you may type it as [|inf|]*.')@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since you have [`[$p]`] yards of fence to use, the rectangular pen's perimeter is [`[$p]`] yards. Assume the pen's base is [`b`] yards, and its height is [`h`] yards. We have: + + [`` +\begin{aligned} + 2(b+h)&=[$p] \\ + b+h&=[$q] \\ + b&=[$q]-h +\end{aligned} + ``] + +In function notation, we have [`b(h)=[$q]-h`]. + +The value of [`h`] must be greater than [`0`] in this context. + +The value of [`h`] cannot be greater than or equal to [`[$q]`]; otherwise the pen's base would have a negative length. + +Therefore the domain is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainInContext20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainInContext20.pg new file mode 100644 index 0000000000..90f2826540 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainInContext20.pg @@ -0,0 +1,73 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Yao 03/26/2018 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"extraAnswerEvaluators.pl" +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$rate = random(10,50,5); +$days = random(10,30,2); +$total = $rate*$days; + +Context("Interval"); +$ans = Interval("[0,$days]"); + +############################################## + +BEGIN_PGML + +A person purchased [`[$total]`] grams of protein powder. Every day, he takes [`[$rate]`] grams. The amount of protein left in the bottle, in grams, can be modeled by the function [`p(d)`], where [`d`] is the number of days since the person started to consume the protein. + +Using interval notation, the domain of the function [`p(d)`] is [__________________________________]{$ans} + +[@KeyboardInstructions('If the answer includes more than one interval write the intervals separated by the union symbol, which you can type as [|U|]*. If the answer uses [`\infty`], you may type it as [|inf|]*.')@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +There were [`[$total]`] grams of protein in the bottle, and the person consumes [`[$rate]`] grams every day. The bottle will last [`\frac{[$total]}{[$rate]}=[$days]`] days. + +The function [`p(d)`] models the amount of protein, in grams, left int he bottle, where [`d`] is the number of days since the person started to consume the protein. + +The value of [`d`] must be greater than or equal to [`0`] in this context. + +The value of [`d`] cannot be greater than [`[$days]`]; otherwise the amount of protein left would become negative. + +Therefore the domain is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainInContext30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainInContext30.pg new file mode 100644 index 0000000000..0a6c474a88 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainInContext30.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Evaluate a function. Function is quadratic. +# +# Last updated: Yao 03/26/2018 +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','evaluate') +## DBCCSS('F-IF1.2') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Numeric"); +Context()->variables->add(t => 'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); + +$initSpeed = random(320,640,32); +$a = -16; +$b = $initSpeed; +$c = 0; + +$func = Compute("$a*t**2+$b*t+$c")->reduce; +$func2 = Compute("-$a*t-$b")->reduce; +$func3 = Compute("-$a*t")->reduce; + +$xVertex = -$b/(2*$a); +$tBack = 2*$xVertex; +$tBackU = NumberWithUnits("$tBack s"); + +Context("Interval"); +$ans = Interval("[0,$tBack]"); + +############################################## + +BEGIN_PGML + +An object was shot up into the air at an initial vertical speed of [`[$initSpeed]`] feet per second. Its height as time passes can be modeled by the quadratic function [`f`], where [`f(t)=[$func]`]. Here [`t`] represents the number of seconds since the object's release, and [`f(t)`] represents the object's height in feet. + +Using interval notation, the domain of the function [`f(t)`] is [__________________________________]{$ans} + +[@KeyboardInstructions('If the answer includes more than one interval write the intervals separated by the union symbol, which you can type as [|U|]*. If the answer uses [`\infty`], you may type it as [|inf|]*.')@]** +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The parabola's [`x`]-intercepts represent the moments when the object was at a height of [`0`]: on the ground. We will solve the equation [`f(t)=0`] to find its [`x`]-intercepts. We have: + + [` +\begin{aligned} + f(t) &= [$func] \\ + 0 &= [$func] \\ + 0 &= -t([$func2]) \\ + -t &= 0 & \text{or} && [$func2]&=0 \\ + t &= 0 & \text{or} && [$func3]&=[$b] \\ + t &= 0 & \text{or} && t&=[$tBack] +\end{aligned} +`] + +This parabola has two [`x`]-intercepts: [`(0,0)`] and [`([$tBack],0)`]. The point [`(0,0)`] represents the moment when the object was released; the point [`([$tBack],0)`] implies the object fell back to the ground after [`[$tBackU]`]. + +Therefore the domain in this context is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainRange10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainRange10.pg new file mode 100644 index 0000000000..0a545ac06c --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/DomainRange10.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Domain and Range') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Interval"); + +$a = non_zero_random(-10,10,1); + +$f = Formula("x^2-$a")->reduce; + +$domain = Interval("(-INF,INF)"); +$range = Interval("[-$a,INF)"); + + +$fname = RandomVariableName(type=>'function'); + +############################################## + + + +BEGIN_PGML + +Consider the function [`[$fname]`] defined by [`[$fname](x)=\displaystyle [$f]`] + + +What is the domain and range of this function? Enter your answer in interval notation. If needed, use *INF* for [`\infty`]. If needed, use *U* for the union symbol. For example, to enter [`(-\infty,0]\cup(2,4)`], type *(-INF,0] U (2,4)*. + + The domain of [`[$fname]`] is [___________________________]{$domain}. + The range of [`[$fname]`] is [___________________________]{$range}. + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + +############################################## + +$ma = -$a; + +BEGIN_PGML_SOLUTION + +Considering the rule for this function, every real number could be entered for [`x`], and we would be able to compute an output [`y`]-value. So the domain is [`[$domain]`]. + +Since squaring a number either leaves a positive result or zero, the lowest possible output for [`[$fname]`] is [`[$ma]`]. Since the graph of [`[$fname]`] is an upward opening parabola, every [`y`]-value greater than or equal to [`[$ma]`] is a possible output. So the range of [`[$fname]`] is [`[$range]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve10.pg new file mode 100644 index 0000000000..2e5ef2ab00 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve10.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## +$var = RandomVariableName(type=>"variable"); +$f = RandomVariableName(type=>"function"); + + +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0,'(-x)+y'=>0); +Context()->variables->are($var=>'Real'); + +$slope = non_zero_random(-5,5,1); +$slope = (abs($slope)+1)*$slope/(abs($slope)); +$intercept = non_zero_random(-11,11,1); + +$function = Formula("$slope*$var+$intercept")->reduce; + +Context("LimitedFraction"); +Context()->variables->are($var=>'Real'); + +Context()->flags->set(showMixedNumbers=>0); + +$fof0 = Compute($intercept); +$solvefequals0 = Fraction(-$intercept,$slope); + +Context("Numeric"); +Context()->variables->are($var=>'Real'); +parser::Assignment->Allow; +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set(","=>{string=>"or",TeX=>"or ",perl=>","}); +$formula = Formula("$var=$solvefequals0 "); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$solvefequals0}"); + +############################################## + + +BEGIN_PGML +If [`[$f]`] is a function defined by [`[$f]([$var]) = [$function]`], + +a. Find [`[$f](0)`]. + [_]{$fof0}{20} + +a. Solve [`[$f]([$var])=0`]. + [_]{$ans}{20} + +END_PGML + + +############################################## + + +$showPartialCorrectAnswers=1; + + +############################################## + +$s = -$intercept; + +BEGIN_PGML_SOLUTION + +To evaluate [`[$f](0)`], + + [`\begin{aligned} +[$f](0) +&= [$slope]\cdot(0)+[$intercept]\\ +&= 0+[$intercept]\\ +&= [$intercept]\\ +\end{aligned}`] + + +To solve [`[$f]([$var])=0`], + + [`\begin{aligned} +[$f]([$var]) +&= 0\\ +[$function] +&= 0\\ +[$slope][$var] +&=[$s]\\ +[$var] +&=[$solvefequals0 ]\\ +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve20.pg new file mode 100644 index 0000000000..a39b9e182b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve20.pg @@ -0,0 +1,176 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + +$var = RandomVariableName(type=>"variable"); +$f = RandomVariableName(type=>"function"); + +Context("Numeric"); +Context()->variables->are($var=>'Real'); + +$leadingCoefficient = non_zero_random(1,5,1); +$constant = non_zero_random(1,11,1); + +$function = Formula("$leadingCoefficient*$var^2-$constant")->reduce; + +Context("LimitedNumeric"); +Context()->variables->are($var=>'Real'); + +Context()->flags->set(showMixedNumbers=>0); + +$fof0 = Compute("-$constant"); + +Context("Fraction"); +Context()->variables->are($var=>'Real'); + +$a = Fraction($constant,$leadingCoefficient); +($num, $den) = $a->value; +$newnum = $num*$den; +$squarepart = 1; +for my $i (2..$newnum/2) { + if ($newnum % $i**2 == 0) { + $squarepart = $i; + } +} + +$newnewnum = $newnum/$squarepart**2; +$b = Fraction($squarepart,$den); + + +Context("Numeric"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstantFunctions=>0); + +parser::Assignment->Allow; +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set(","=>{string=>"or",TeX=>"or ",perl=>","}); + + +$c = Formula("sqrt($newnewnum)"); +if ($c == 1) {$c = ''}; + +if ($b == 1 and $c ne '') {$b = ''}; + + +$solvefequals0 = Compute("$var=$b $c or $var=-$b $c"); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$b $c, -$b $c}"); + + +############################################## + +BEGIN_PGML +If [`[$f]`] is a function defined by [`[$f]([$var]) = [$function]`], + +a. Find [`[$f](0)`]. + [_]{$fof0}{20} + +a. Solve [`[$f]([$var])=0`]. + [@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + [_]{$ans}{20} + +END_PGML + + + +############################################## + +$showPartialCorrectAnswers=1; + +Context("Numeric")->variables->are($var=>'Real'); +$leading = Formula("$leadingCoefficient*$var^2")->reduce; + +$solve = ''; + +if ($leadingCoefficient == 1) { + $solve = '[$f]([$var]) &= 0\\ + [$function] &= 0\\ + [$var]^2 &= [$a]\\ + [$var] &= \pm\sqrt{[$a]}\\'; + if ($c eq '') {$solve .= '&= \pm [$b]';} + elsif ($b ne '') {$solve .= '&= \pm [$b] [$c]';} +} elsif ($den == 1 or $den == 4) { + $solve = '[$f]([$var]) &= 0\\ + [$function] &= 0\\ + [$leading] &= [$constant]\\ + [$var]^2 &= [$a]\\ + [$var] &= \pm\sqrt{[$a]}\\'; + if ($c eq '') {$solve .= '&= \pm [$b]';} + elsif ($b ne '') {$solve .= '&= \pm\sqrt{[$squarepart**2]\cdot[$newnewnum]}\\ &= \pm [$b] [$c]';} +} else { + $solve = '[$f]([$var]) &= 0\\ + [$function] &= 0\\ + [$leading] &= [$constant]\\ + [$var]^2 &= [$a]\\ + [$var] &= \pm\sqrt{[$a]}\\ + [$var] &= \pm\sqrt{[$a]\cdot\frac{[$den]}{[$den]}}\\ + [$var] &= \pm\sqrt{\frac{[$num*$den]}{[$den*$den]}}\\ + [$var] &= \pm\sqrt{\frac{[$squarepart**2]\cdot[$newnewnum]}{[$den*$den]}}\\'; + if ($c eq '') {$solve .= '&= \pm [$b]';} + elsif ($b ne '') {$solve .= '&= \pm [$b] [$c]';} +}; + + +############################################## + +BEGIN_PGML_SOLUTION + +To evaluate [`[$f](0)`], + + [`\begin{aligned} +[$f](0) &= [$leadingCoefficient]*(0)^2-[$constant]\\ +&= [$leadingCoefficient]*(0)-[$constant]\\ +&= 0-[$constant]\\ +&= -[$constant]\\ +\end{aligned}`] + + +To solve [`[$f]([$var])=0`], + + [`\begin{aligned} +[$solve]** +\end{aligned}`] + +So the solution set is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve30.pg new file mode 100644 index 0000000000..a02f666b5f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve30.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + + +TEXT(beginproblem()); + +############################################## +$var = RandomVariableName(type=>"variable"); +$f = RandomVariableName(type=>"function"); + + +Context("Numeric"); +Context()->variables->are($var=>'Real'); + +$root1 = non_zero_random(1,5,1); +$root2 = non_zero_random(-11,11,1); +while ($root1 == $root2) +{$root2 = non_zero_random(-11,11,1);} + +$b = -($root1+$root2); +$c = $root1*$root2; + +$function = Formula("$var^2+$b*$var+$c")->reduce; + +Context("Numeric"); +Context()->flags->set(showMixedNumbers=>0); +Context()->variables->are($var=>'Real'); + + +$fof0 = Compute($c); + +parser::Assignment->Allow; +Context()->operators->set(","=>{string=>"or",TeX=>"\text{ or }",perl=>","});Context()->operators->redefine('or',using=>',',from=>'Numeric'); + + + + +$solvefequals0 = Compute("$var=$root1 or $var=$root2"); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$root1, $root2}"); + +############################################## + + +BEGIN_PGML +If [`[$f]`] is a function defined by [`[$f]([$var]) = [$function]`], + +a. Find [`[$f](0)`]. + [_]{$fof0}{20} + +a. Solve [`[$f]([$var])=0`]. + [@KeyboardInstructions("If you need to use the square root symbol, as in [`x=\\sqrt{17}`], type it as [|x=sqrt(17)|]*. If there are no real solutions, enter [|no real solutions|]*.")@]** + [_]{$ans}{20} + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; + + + +############################################## + +BEGIN_PGML_SOLUTION + +To evaluate [`[$f](0)`], + + [`\begin{aligned} +[$f](0) +&= (0)^2+[$b]\cdot(0)+[$c]\\ +&= 0+[$b]\cdot(0)+[$c]\\ +&= 0+0+[$c]\\ +&= [$c]\\ +\end{aligned}`] + + +To solve [`[$f]([$var])=0`], + + [`\begin{aligned} +[$f]([$var]) +&= 0\\ +[$function] +&= 0\\ +([$var]-[$root1])([$var]-[$root2]) +&=0\\ +[$var] +&=[$root1]&\mbox{ or }&&[$var]&=[$root2]\\ +\end{aligned}`] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve40.pg new file mode 100644 index 0000000000..2a2a68b7b3 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve40.pg @@ -0,0 +1,154 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + + +TEXT(beginproblem()); + +############################################## + +$var = RandomVariableName(type=>"variable"); +$f = RandomVariableName(type=>"function"); + + +Context("Numeric"); +Context()->variables->are($var=>'Real'); + +$h = non_zero_random(-5,5,1); +$k = non_zero_random(-5,5,1); + + +$function = Formula("1/($var+$h)+$k")->reduce; + +Context("Fraction"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(showMixedNumbers=>0); + +$fof0 = Fraction(1+$h*$k,$h); + +Context("LimitedFraction"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(showMixedNumbers=>0); + +$fof0 = Compute("$fof0"); + +parser::Assignment->Allow; +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set(","=>{string=>"or",TeX=>"or ",perl=>","}); + +$solvefequals0 = -Fraction(1+$h*$k,$k); + +Context("LimitedFraction"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(showMixedNumbers=>0); + +$solvefequals0 = Compute("$solvefequals0"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +If \($f\) is a function defined by \($f($var) = $function\),$PAR + +\{ +LayoutTable( +[["Find \($f(0)\).",ans_rule(25)], +["Solve \($f($var)=0\).",ans_rule(25)]], +allcellcss=>"padding:6pt; text-align:left;", +center=>0, +); +\} + + +Remember that when you are asked to solve an equation for \($var\), the answer should be in the form $BBOLD $var=23$EBOLD, and not simply give the numerical value of the solution, like 23. If there are two solutions, use the word $BBOLD or$EBOLD, as in $BBOLD $var=23 or $var=12$EBOLD. If you need to use the square root sign, as in \(\sqrt{23}\), type it as $BBOLD sqrt(23)$EBOLD. + +END_TEXT + +Context()->normalStrings; + +############################################## + + +$showPartialCorrectAnswers=1; + +parser::Assignment->Allow; +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set(","=>{string=>"or",TeX=>"or ",perl=>","}); + + +ANS( $fof0 -> cmp ); +ANS( Formula("$var=$solvefequals0 ") -> cmp ); + +############################################## + +$s = Fraction(-1,$k); + +BEGIN_PGML_SOLUTION + +To evaluate [`[$f](0)`], + + [`\begin{aligned} +[$f](0) +&= \frac{1}{0+[$h]}+[$k]\\ +&= \frac{1}{[$h]}+[$k]\\ +&= [$fof0]\\ +\end{aligned}`] + + +To solve [`[$f]([$var])=0`], + + [`\begin{aligned} +[$f]([$var]) +&= 0\\ +[$function] +&= 0\\ +\frac{1}{[$var]+[$h]} +&=-[$k]\\ +[$var]+[$h] +&=[$s]\\ +[$var] +&=[$s]-[$h]\\ +[$var] +&=[$solvefequals0 ]\\ +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve50.pg new file mode 100644 index 0000000000..4062bfb07b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve50.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$coefficient = random(2,5,1); +$exponentNumerator = random(1,5,2); +$exponentDenominator = random(2,6,2); +$constant = non_zero_random(-3,3,1); + + +$function = Formula("$coefficient*x^(-($exponentNumerator/$exponentDenominator))+$constant")->reduce; +$inverse = Formula("((x-$constant)/$coefficient)**(-($exponentDenominator/$exponentNumerator))"); + + +$givenx = random(2,5,1); +$giveny = $givenx; +while ($giveny == $givenx) { +$giveny = non_zero_random(2,5,1)+$constant; +} + +$foundy = $function->substitute(x=>Formula("$givenx")); +$foundx = $inverse->substitute(x=>Formula("$giveny")); + + + +############################################## + + +BEGIN_PGML + +Let [`f`] be the function given by [`f(x) = [$coefficient]x^{-[$exponentNumerator]/[$exponentDenominator]}+[$constant]`] + + When [`y=f([$givenx])`], the value of [`y`] is [__________]{$foundy}. + + When [`f(x)=[$giveny]`], the value of [`x`] is [__________]{$foundx}. + + +END_PGML + +############################################## + +Context("Fraction"); +$s = Fraction($giveny-$constant, $coefficient); +$sr = Real($s)**(-$exponentDenominator/$exponentNumerator); + +$showPartialCorrectAnswers=1; + + +BEGIN_PGML_SOLUTION + +If [`y=f([$givenx])`], then we have + + [`\begin{aligned} +y +&=f([$givenx])\\ +&=[$coefficient]\left([$givenx]^{-[$exponentNumerator]/[$exponentDenominator]}\right)+[$constant]\\ +&\approx[$coefficient]\left([$givenx]^{-[$exponentNumerator/$exponentDenominator]}\right)+[$constant]\\ +&\approx[$coefficient]\left([$givenx**(-$exponentNumerator/$exponentDenominator)]\right)+[$constant]\\ +&\approx[$coefficient*$givenx**(-$exponentNumerator/$exponentDenominator)]+[$constant]\\ +&\approx[$coefficient*$givenx**(-$exponentNumerator/$exponentDenominator)+$constant]\\ +\end{aligned}`] + + +If [`f(x)=[$giveny]`], then we have + + [`\begin{aligned} +f(x) +&=[$giveny]\\ +[$coefficient]\left(x^{-[$exponentNumerator]/[$exponentDenominator]}\right)+[$constant] +&=[$giveny]\\ +[$coefficient]\left(x^{-[$exponentNumerator]/[$exponentDenominator]}\right) +&=[$giveny-$constant]\\ +x^{-[$exponentNumerator]/[$exponentDenominator]} +&=[$s]\\ +x +&=\left([$s]\right)^{-[$exponentDenominator]/[$exponentNumerator]}\\ +x +&=[$sr] +\end{aligned}`] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve60.pg new file mode 100644 index 0000000000..c6dbe1ae0a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve60.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +do{ + +$top = random(1,6,1); +$botConst = random(2,7,1); +$botSign = random(-2,2,4); + + +$function = Formula("$top/($botConst+$botSign*x^3)")->reduce; + +$givenx = non_zero_random(-2,2,1); +$foundx = $givenx; +while ($foundx == $givenx) { +$foundx = non_zero_random(-2,2,1); +} + +$foundyDenominator = $botConst+$botSign*$givenx**3; +$givenyDenominator = $botConst+$botSign*$foundx**3; + +} until (($foundyDenominator != 0) and ($givenyDenominator != 0)); + +$foundy = Fraction($top,$foundyDenominator); +$giveny = Fraction($top,$givenyDenominator); + +Context("LimitedFraction"); +Context()->flags->set(showMixedNumbers=>0); + +$foundx = Compute("$foundx"); +$foundy = Compute("$foundy"); + + +############################################## + +BEGIN_PGML + +Let [`f`] be the function given by [`f(x) = [$function]`] + + When [`y=f([$givenx])`], the value of [`y`] is [__________]{$foundy}. + + When [`f(x)=[$giveny]`], the value of [`x`] is [__________]{$foundx}. + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + +$s = 1/$giveny; +$s2 = $top/$giveny; +$s3 = ($s2-$botConst)/$botSign; + +BEGIN_PGML_SOLUTION + +If [`y=f([$givenx])`], then we have + + [`\begin{aligned} +y +&=f([$givenx])\\ +&=\frac{[$top]}{[$botConst]+[$botSign]([$givenx])^3}\\ +&=\frac{[$top]}{[$botConst]+[$botSign]([$givenx**3])}\\ +&=\frac{[$top]}{[$botConst]+[$botSign*$givenx**3]}\\ +&=\frac{[$top]}{[$botConst+$botSign*$givenx**3]}\\ +&=[$foundy]\\ +\end{aligned}`] + + +If [`f(x)=[$giveny]`], then we have + + [`\begin{aligned} +f(x) +&=[$giveny]\\ +\frac{[$top]}{[$botConst]+[$botSign]x^3} +&=[$giveny]\\ +\frac{[$botConst]+[$botSign]x^3}{[$top]} +&=[$s]\\ +[$botConst]+[$botSign]x^3 +&=[$s2]\\ +[$botSign]x^3 +&=[$s2-$botConst]\\ +x^3 +&=[$s3]\\ +x +&=[$foundx] +\end{aligned}`] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction23.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction23.pg new file mode 100644 index 0000000000..871b3c0ac1 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction23.pg @@ -0,0 +1,72 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College + + +#DESCRIPTION +#KEYWORDS('functions') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('Alex Jordan') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +#ENDDESCRIPTION + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", +); + +############################################## + +TEXT(beginproblem()); + +$showPartialCredit = 1; +$a = random(100,200,1); +$b = random(250,350,1); + +Context("LimitedNumeric"); + +$f = RandomVariableName(type=>'function'); +$x = RandomVariableName(type=>'variable'); + +############################################## + +BEGIN_PGML +Given [`[$f]([$x]) = \left|[$x] - [$b]\right|`], +find and simplify [`[$f]([$a])`]. + + [`[$f]([$a])={}`][___________]{abs($a-$b)} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} +[$f]([$a]) +&=\left|[$a] - [$b]\right|\\ +&=\left|[$a-$b]\right|\\ +&=[@abs($a-$b)@] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction24.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction24.pg new file mode 100644 index 0000000000..a7708bd162 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction24.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College + + +#DESCRIPTION +#KEYWORDS('functions') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('Alex Jordan') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +#ENDDESCRIPTION + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->noreduce('(-x)+y', '(-x)-y'); + +$showPartialCredit = 1; +$a = random(10,20,1); +$b = non_zero_random(-30,30,1); +$m = non_zero_random(-4,4,1); + + +$f = RandomVariableName(type=>'function'); +$x = RandomVariableName(type=>'variable'); +Context()->variables->are($x=>'Real'); + +$inner = Formula("$m $x + $b"); +$abs = Formula("|$x|"); +$formula =$abs->substitute($x=>$inner)->reduce; + +Context("LimitedNumeric"); +$answer = Compute($formula->eval($x=>$a)); + +############################################## + +BEGIN_PGML +Given [`[$f]([$x]) = [$formula]`], +find and simplify [`[$f]([$a])`]. + + [`[$f]([$a])={}`][___________]{$answer} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} +[$f]([$a]) +&=[$formula->substitute($x=>"$a")]\\ +&=[$abs->substitute($x=>$inner->eval($x=>$a))]\\ +&=[$answer] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction25.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction25.pg new file mode 100644 index 0000000000..8a1175f96d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction25.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College + + +#DESCRIPTION +#KEYWORDS('functions') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('Alex Jordan') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +#ENDDESCRIPTION + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->noreduce('(-x)+y', '(-x)-y'); + +$showPartialCredit = 1; +$a = random(10,20,1); +$b = non_zero_random(-30,30,1); +$m = non_zero_random(-4,4,1); +$c = random(10,20,1); + +$f = RandomVariableName(type=>'function'); +$x = RandomVariableName(type=>'variable'); +Context()->variables->are($x=>'Real'); + +$inner = Formula("$m $x + $b"); +$outer = Formula("$c - |$x|"); +$formula =$outer->substitute($x=>$inner)->reduce; + +Context("LimitedNumeric"); +$answer = Compute($formula->eval($x=>$a)); + + +############################################## + +BEGIN_PGML +Given [`[$f]([$x]) = [$formula]`], +find and simplify [`[$f]([$a])`]. + + [`[$f]([$a])={}`][___________]{$answer} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} +[$f]([$a]) +&=[$formula->substitute($x=>"$a")]\\ +&=[$outer->substitute($x=>$inner->eval($x=>$a))]\\ +&=[$answer] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction26.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction26.pg new file mode 100644 index 0000000000..bc8737349a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction26.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College + + +#DESCRIPTION +#KEYWORDS('functions') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('Alex Jordan') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +#ENDDESCRIPTION + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->noreduce('(-x)+y', '(-x)-y'); + +$showPartialCredit = 1; +$a = random(10,20,1); +$b = non_zero_random(-30,30,1); +$m = non_zero_random(-4,4,1); + +$f = RandomVariableName(type=>'function'); +$x = RandomVariableName(type=>'variable'); + +Context()->variables->are($x=>'Real'); + +$inner = Formula("$m $x + $b"); +$abs = Formula("|$x|"); +$formula = Formula("$x") + $abs->substitute($x=>$inner)->reduce; + +Context("LimitedNumeric"); +$answer = Compute($formula->eval($x=>$a)); + + + +############################################## + +BEGIN_PGML +Given [`[$f]([$x]) = [$formula]`], +find and simplify [`[$f]([$a])`]. + + [`[$f]([$a])={}`][___________]{$answer} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} +[$f]([$a]) +&=[$formula->substitute($x=>"$a")]\\ +&=[$a] + \left\lvert [$inner->eval($x=>$a)]\right\rvert\\ +&=[$answer] +\end{aligned} +`] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction27.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction27.pg new file mode 100644 index 0000000000..d87ffb22e9 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvaluateFunction27.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College + + +#DESCRIPTION +#KEYWORDS('functions') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('Alex Jordan') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +#ENDDESCRIPTION + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", +); + +############################################## + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->noreduce('(-x)+y', '(-x)-y'); + +$showPartialCredit = 1; +$r1 = random(3,6,1); +$r2 = random(-6,-3,1); + +$m = -$r1 - $r2; +$b = $r1*$r2; + +$a = random(-7,7,1); + +$f = RandomVariableName(type=>'function'); +$x = RandomVariableName(type=>'variable'); +Context()->variables->are($x=>'Real'); + + +$inner = Formula("$x^2 + $m $x + $b"); +$abs = Formula("|$x|"); +$formula =$abs->substitute($x=>$inner)->reduce; + +Context("LimitedNumeric"); +$answer = Compute($formula->eval($x=>$a)); + + +############################################## + +BEGIN_PGML +Given [`[$f]([$x]) = [$formula]`], +find and simplify [`[$f]([$a])`]. + + [`[$f]([$a])={}`][___________]{$answer} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[` +\begin{aligned} +[$f]([$a]) +&=[$formula->substitute($x=>"$a")]\\ +&=[$abs->substitute($x=>$inner->eval($x=>$a))]\\ +&=[$answer] +\end{aligned} +`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof10.pg new file mode 100644 index 0000000000..a4d6b90c5e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof10.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Prove a function is odd/even. +# +# Last update: Carl Yao 03/28/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = non_zero_random(-3,-1,1); +$c = non_zero_random(-3,3,1); + +if (random(1,4,1)==1) { + $func = Compute("$a*x**2+$c")->reduce; + $s1 = Compute("$a*(-x)**2+$c")->reduce; +} elsif (random(1,4,1)==2) { + $func = Compute("$a*abs(x)+$c")->reduce; + $s1 = Compute("$a*abs(-x)+$c")->reduce; +} elsif (random(1,4,1)==3) { + $func = Compute("$a/x**2+$c")->reduce; + $s1 = Compute("$a/(-x)**2+$c")->reduce; +} else { + $func = Compute("$a/x**4+$c*x**2")->reduce; + $s1 = Compute("$a/(-x)**4+$c*(-x)**2")->reduce; +} + +$ans = Compute($func); + +############################################## + +BEGIN_PGML + +The following is a proof that the function [`f(x)=[$func]`] is even. Fill in the blank to complete the proof. + +Proof: + +[`` f(-x) = [$s1] ``] + +[``=``][______________]{$ans} + +[``=f(x)``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Proof: + + [`` +\begin{aligned} + f(-x) &= [$s1] \\ + &= [$func] \\ + &= f(x) +\end{aligned} + ``] + +Since [`f(-x)=f(x)`], [`f(x)`] is an even function. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof20.pg new file mode 100644 index 0000000000..0ba56f5f28 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof20.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Prove a function is odd/even. +# +# Last update: Carl Yao 03/28/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'u-' => {class => 'bizarro::UOP::minus', isCommand => 1}, +); + +$a = random(2,4,1); +$c = random(2,4,1); + +if (random(1,4,1)==1) { + $func = Compute("$a*x**2+$c")->reduce; + $ans = Compute("$a*(-x)**2+$c")->reduce; +} elsif (random(1,4,1)==2) { + $func = Compute("$a*abs(x)+$c")->reduce; + $ans = Compute("$a*abs(-x)+$c")->reduce; +} elsif (random(1,4,1)==3) { + $func = Compute("$a/x**2+$c")->reduce; + $ans = Compute("$a/(-x)**2+$c")->reduce; +} else { + $func = Compute("$a/x**4+$c*x**2")->reduce; + $ans = Compute("$a/(-x)**4+$c*(-x)**2")->reduce; +} + +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroNeg=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroNeg=>0); + Value::Error("Your answer is equivalent to the correct answer, but does not work in this proof.") unless $OK; + return $OK; +}); + +############################################## + +BEGIN_PGML + +The following is a proof that the function [`f(x)=[$func]`] is even. Fill in the blank to complete the proof. + +Proof: + +[`` f(-x) = ``][__________________]{$evaluator} + +[``= [$func]``] + +[``=f(x)``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Proof: + + [`` +\begin{aligned} + f(-x) &= [$ans] \\ + &= [$func] \\ + &= f(x) +\end{aligned} + ``] + +Since [`f(-x)=f(x)`], [`f(x)`] is an even function. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof30.pg new file mode 100644 index 0000000000..9b51af8420 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof30.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Prove a function is odd/even. +# +# Last update: Carl Yao 03/28/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'u-' => {class => 'bizarro::UOP::minus', isCommand => 1}, +); + +$a = non_zero_random(2,4,1); +$c = non_zero_random(2,4,1); + +if (random(1,4,1)==1) { + $func = Compute("$a*x**3+$c*x"); + $ans = Compute("$a*(-x)**3+$c*(-x)"); + $s2 = Compute("-$a*x**3-$c*x"); +} elsif (random(1,4,1)==2) { + $func = Compute("$a*x**5+x"); + $ans = Compute("$a*(-x)**5+(-x)"); + $s2 = Compute("-$a*x**5-x"); +} elsif (random(1,4,1)==3) { + $func = Compute("$a/x+x"); + $ans = Compute("$a/(-x)+(-x)"); + $s2 = "-\frac{$a}{x}-x"; +} else { + $func = Compute("$a/x+$c*x"); + $ans = Compute("$a/(-x)+$c*(-x)"); + $s2 = "-\frac{$a}{x}-$c x"; +} + +$s3 = Compute("-($func)"); + +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroNeg=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroNeg=>0); + Value::Error("Your answer is equivalent to the correct answer, but does not work in this proof.") unless $OK; + return $OK; +}); + +############################################## + +BEGIN_PGML + +The following is a proof that the function [`f(x)=[$func]`] is odd. Fill in the blank to complete the proof. + +Proof: + +[`` f(-x) = ``][__________________]{$evaluator} + +[``= [$s2]``] + +[``= [$s3]``] + +[``=-f(x)``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Proof: + + [`` +\begin{aligned} + f(-x) &= [$ans] \\ + &= [$s2] \\ + &= [$s3] \\ + &= f(x) +\end{aligned} + ``] + +Since [`f(-x)=-f(x)`], [`f(x)`] is an odd function. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof40.pg new file mode 100644 index 0000000000..a1596c1bb2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof40.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Prove a function is odd/even. +# +# Last update: Carl Yao 03/28/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'u-' => {class => 'bizarro::UOP::minus', isCommand => 1}, +); + +$a = non_zero_random(2,4,1); +$c = non_zero_random(2,4,1); + +if (random(1,4,1)==1) { + $func = Compute("$a*x**3+$c*x"); + $s1 = Compute("$a*(-x)**3+$c*(-x)"); + $s2 = Compute("-$a*x**3-$c*x"); +} elsif (random(1,4,1)==2) { + $func = Compute("$a*x**5+x"); + $s1 = Compute("$a*(-x)**5+(-x)"); + $s2 = Compute("-$a*x**5-x"); +} elsif (random(1,4,1)==3) { + $func = Compute("$a/x+x"); + $s1 = Compute("$a/(-x)+(-x)"); + $s2 = Compute("-$a/x-x"); +} else { + $func = Compute("$a/x+$c*x"); + $s1 = Compute("$a/(-x)+$c*(-x)"); + $s2 = Compute("-$a/x-$c*x"); +} + +$s3 = Compute("-($func)"); + +$evaluator = $s2->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroNeg=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroNeg=>0); + Value::Error("Your answer is equivalent to the correct answer, but does not work in this proof.") unless $OK; + return $OK; +}); + +############################################## + +BEGIN_PGML + +The following is a proof that the function [`f(x)=[$func]`] is odd. Fill in the blank to complete the proof. + +Proof: + +[`` f(-x) = [$s1]``] + +[`=`][__________________]{$evaluator} + +[``= [$s3]``] + +[``=-f(x)``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Proof: + + [`` +\begin{aligned} + f(-x) &= [$s1] \\ + &= [$s2] \\ + &= [$s3] \\ + &= f(x) +\end{aligned} + ``] + +Since [`f(-x)=-f(x)`], [`f(x)`] is an odd function. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof50.pg new file mode 100644 index 0000000000..32455ca204 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/EvenOddProof50.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Prove a function is odd/even. +# +# Last update: Carl Yao 03/28/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'u-' => {class => 'bizarro::UOP::minus', isCommand => 1}, +); + +$a = non_zero_random(2,4,1); +$c = non_zero_random(2,4,1); + +if (random(1,4,1)==1) { + $func = Compute("$a*x**3+$c*x"); + $s1 = Compute("$a*(-x)**3+$c*(-x)"); + $s2 = Compute("-$a*x**3-$c*x"); +} elsif (random(1,4,1)==2) { + $func = Compute("$a*x**5+x"); + $s1 = Compute("$a*(-x)**5+(-x)"); + $s2 = Compute("-$a*x**5-x"); +} elsif (random(1,4,1)==3) { + $func = Compute("$a/x+x"); + $s1 = Compute("$a/(-x)+(-x)"); + $s2 = "-\frac{$a}{x}-x"; +} else { + $func = Compute("$a/x+$c*x"); + $s1 = Compute("$a/(-x)+$c*(-x)"); + $s2 = "-\frac{$a}{x}-$c x"; +} + +$s3 = Compute("-($func)"); + +$evaluator = $s3->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroMul=>1,bizarroNeg=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroMul=>0,bizarroNeg=>0); + Value::Error("Your answer is equivalent to the correct answer, but does not work in this proof.") unless $OK; + return $OK; +}); + +############################################## + +BEGIN_PGML + +The following is a proof that the function [`f(x)=[$func]`] is odd. Fill in the blank to complete the proof. + +Proof: + +[`` f(-x) = [$s1]``] + +[``= [$s2]``] + +[`=`][__________________]{$evaluator} + +[``=-f(x)``] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Proof: + + [`` +\begin{aligned} + f(-x) &= [$s1] \\ + &= [$s2] \\ + &= [$s3] \\ + &= f(x) +\end{aligned} + ``] + +Since [`f(-x)=-f(x)`], [`f(x)`] is an odd function. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros10.pg new file mode 100644 index 0000000000..9ad135ad00 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros10.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + +############################################## +$var = RandomVariableName(type=>"variable"); +$f = RandomVariableName(type=>"function"); + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0,'(-x)+y'=>0); +Context()->variables->are($var=>'Real'); + +$zero = non_zero_random(-10,10,1); +$m = non_zero_random(2,5,1)*random(-1,1,2); +$b = -$zero*$m; + +$function = Formula("$m*$var+$b")->reduce; + +$ans = List($zero); + +############################################## + +BEGIN_PGML + +Use commas to separate numbers if there is more than one solution. + +The zero(s) of the function [`[$f]([$var])=[$function]`] is/are [________________]{$ans}. + +END_PGML + + +############################################## + +$nB = -$b; + +############################################## + +BEGIN_PGML_SOLUTION + +Zeroes of a function, say [`f(x)`], are [`x`]-values which make [`f(x)=0`]. + +To find the zeroes of [`[$f]([$var])`], we solve for [`[$var]`] in [`[$f]([$var])=0`]: + + [``\begin{aligned} +[$f]([$var]) &= 0\\ +[$function] &= 0\\ +[$m][$var] &=[$nB]\\ +[$var] &=[$zero ]\\ + \end{aligned}``] + +The zero of [`[$f]([$var])`] is [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros20.pg new file mode 100644 index 0000000000..b07ee6b418 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros20.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + +$var = RandomVariableName(type=>"variable"); +$f = RandomVariableName(type=>"function"); + +Context("Numeric"); +Context()->variables->are($var=>'Real'); +Context()->reduction->set('(-x)-y'=>0,'(-x)+y'=>0); + +$zero1 = non_zero_random(-5,5,1); +$zero2 = -$zero1; +$a = random(2,5,1)*random(-1,1,2); +$b = -$a*($zero1)**2; + +$function = Compute("$a*$var**2+$b")->reduce; + +$ans = List($zero1,$zero2); + + +############################################## + +BEGIN_PGML + +Use commas to separate numbers if there is more than one solution. + +The zero(s) of the function [`[$f]([$var])=[$function]`] is/are [________________]{$ans}. + +END_PGML + + +############################################## + +$nB= -$b; +$c = $nB/$a; + +############################################## + +BEGIN_PGML_SOLUTION + +Zeroes of a function, say [`f(x)`], are [`x`]-values which make [`f(x)=0`]. + +To find the zeroes of [`[$f]([$var])`], we solve for [`[$var]`] in [`[$f]([$var])=0`]: + + [``\begin{aligned} +[$f]([$var]) &= 0\\ +[$function] &= 0\\ +[$a][$var]^2 &=[$nB]\\ +[$var]^2 &=[$c] \\ +[$var] &=[$zero1] \text{ or } [$var]=[$zero2] \\ + \end{aligned}``] + +The zeros of [`[$f]([$var])`] are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros30.pg new file mode 100644 index 0000000000..8d91bac92a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros30.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + +$var = RandomVariableName(type=>"variable"); +$f = RandomVariableName(type=>"function"); + +Context("Numeric"); +Context()->variables->are($var=>'Real'); +Context()->reduction->set('(-x)-y'=>0,'(-x)+y'=>0); +Context()->strings->add("none"=>{alias=>DNE},); + +do { + $a = random(2,5,1)*random(-1,1,2); + $b = random(2,5,1)*random(-1,1,2); +} until ( (gcd(abs($a),abs($b))==1) && (-$b/$a<0) ); + +$function = Compute("$a*$var**2+$b")->reduce; + +$ans = List(DNE); + + +############################################## + +BEGIN_PGML + +* Use commas to separate numbers if there is more than one solution. +* If the function has no zeros, type *none*. + +The zero(s) of the function [`[$f]([$var])=[$function]`] is/are [________________]{$ans}. + +END_PGML + + +############################################## + +$nB= -$b; + +############################################## + +BEGIN_PGML_SOLUTION + +Zeroes of a function, say [`f(x)`], are [`x`]-values which make [`f(x)=0`]. + +To find the zeroes of [`[$f]([$var])`], we solve for [`[$var]`] in [`[$f]([$var])=0`]: + + [``\begin{aligned} +[$f]([$var]) &= 0\\ +[$function] &= 0\\ +[$a][$var]^2 &=[$nB]\\ +[$var]^2 &= \frac{[$nB]}{[$a]} \\ + \end{aligned}``] + +Since a number squared cannot be negative, [`[$f]([$var])`] has no zeros. Type *none* as the solution. + +If a function has no zeros, it implies the function doesn't have any [`x`]-intercept. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros40.pg new file mode 100644 index 0000000000..111e0406b3 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros40.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + +$var = RandomVariableName(type=>"variable"); +$f = RandomVariableName(type=>"function"); + +Context("Numeric"); +Context()->variables->are($var=>'Real'); +Context()->reduction->set('(-x)-y'=>0,'(-x)+y'=>0); + +$zero1 = non_zero_random(-5,5,1); +do {$zero2 = non_zero_random(-5,5,1);} until (abs($zero2)!=abs($zero1)); +$b = -($zero1+$zero2); +$c = $zero1*$zero2; + +$function = Compute("$var**2+$b*$var+$c")->reduce; + +$ans = List($zero1,$zero2); + + +############################################## + +BEGIN_PGML + +Use commas to separate numbers if there is more than one solution. + +The zero(s) of the function [`[$f]([$var])=[$function]`] is/are [________________]{$ans}. + +END_PGML + + +############################################## + + + +############################################## + +BEGIN_PGML_SOLUTION + +Zeroes of a function, say [`f(x)`], are [`x`]-values which make [`f(x)=0`]. + +To find the zeroes of [`[$f]([$var])`], we solve for [`[$var]`] in [`[$f]([$var])=0`]: + + [``\begin{aligned} +[$f]([$var]) &= 0\\ +[$function] &= 0\\ +([$var]-[$zero1])([$var]-[$zero2]) &=0\\ +[$var]-[$zero1] &=0 \text{ or } [$var]-[$zero2]=0 \\ +[$var] &=[$zero1] \text{ or } [$var]=[$zero2] \\ + \end{aligned}``] + +The zeros of [`[$f]([$var])`] are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros50.pg new file mode 100644 index 0000000000..fb00854b96 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros50.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + +$var = RandomVariableName(type=>"variable"); +$f = RandomVariableName(type=>"function"); + +Context("Numeric"); +Context()->variables->are($var=>'Real'); +Context()->reduction->set('(-x)-y'=>0,'(-x)+y'=>0); + +$zero = non_zero_random(-5,5,1); +do {$a=non_zero_random(-5,5,1);} until ($zero!=$a); + +$function = Compute("($var-$zero)/($var-$a)")->reduce; + +$ans = List($zero); + + +############################################## + +BEGIN_PGML + +Use commas to separate numbers if there is more than one solution. + +The zero(s) of the function [`[$f]([$var])=[$function]`] is/are [________________]{$ans}. + +END_PGML + + +############################################## + + + +############################################## + +BEGIN_PGML_SOLUTION + +Zeroes of a function, say [`f(x)`], are [`x`]-values which make [`f(x)=0`]. + +To find the zeroes of [`[$f]([$var])`], we solve for [`[$var]`] in [`[$f]([$var])=0`]: + + [``\begin{aligned} +[$f]([$var]) &= 0\\ +[$function] &= 0\\ +[$var]-[$zero] &=0\\ +[$var] &= [$zero] \\ + \end{aligned}``] + +The zero of [`[$f]([$var])`] is [`[$ans]`]. + +Note that [`\frac{a}{b}=0`] if [`a=0`]. In other words, a fraction's value is [`0`] if its numerator is [`0`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros60.pg new file mode 100644 index 0000000000..a4768d651a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros60.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "pccTables.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + +$var = RandomVariableName(type=>"variable"); +$f = RandomVariableName(type=>"function"); + +Context("Numeric"); +Context()->variables->are($var=>'Real'); +Context()->reduction->set('(-x)-y'=>0,'(-x)+y'=>0); +Context()->strings->add("none"=>{alias=>DNE},); + +$a=non_zero_random(-5,5,1); +$b=non_zero_random(-5,5,1); + +$function = Compute("$a/($var+$b)")->reduce; + +$ans = List(DNE); + + +############################################## + +BEGIN_PGML + +* Use commas to separate numbers if there is more than one solution. +* If the function has no zeros, type *none*. + +The zero(s) of the function [`[$f]([$var])=[$function]`] is/are [________________]{$ans}. + +END_PGML + + +############################################## + + + +############################################## + +BEGIN_PGML_SOLUTION + +Zeroes of a function, say [`f(x)`], are [`x`]-values which make [`f(x)=0`]. + +To find the zeroes of [`[$f]([$var])`], we solve for [`[$var]`] in [`[$f]([$var])=0`]: + + [``\begin{aligned} +[$f]([$var]) &= 0\\ +[$function] &= 0\\ + \end{aligned}``] + +Since the numerator of the fraction can never be [`0`], [`[$f]([$var])`] has no zeros. Type *none* as the solution. + +If a function has no zeros, it implies the function doesn't have any [`x`]-intercept. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros70.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros70.pg new file mode 100644 index 0000000000..0fdf01be4d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FindingZeros70.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, find its zeros. +# +# Last update: Carl Yao 03/27/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +$zero1 = random(-8,-5,1); +$zero2 = random(5,8,1); +$yInt = non_zero_random(-8,8,1); +$a = -$yInt/($zero1*($zero2)**2); +$func = Compute("$a*(x-$zero1)*(x-$zero2)**2")->reduce; + +$ans = List($zero1,$zero2); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$zero1,$zero2],[$yInt,0],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $domainLow = $min[0]-1; + $domainHigh = $max[0]+1; + + add_functions($gr[$i], "$func for x in ($domainLow,$domainHigh) using color:blue and weight:1"); + + $gr[$i]->stamps( closed_circle(0,$yInt,'blue') ); + $gr[$i]->stamps( closed_circle($zero1,0,'blue') ); + $gr[$i]->stamps( closed_circle($zero2,0,'blue') ); +} + +$ALT = "graph of a function passing the following points: (0,$yInt), ($zero1,0) and ($zero2,0)"; + + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +A function's graph is shown below. + +[@EnlargeImageStatementPGML()@]** + + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +Locate the function's zeros. Use commas to separate your answers. + +The function's zero(s) is/are [_____________________]{$ans}. + +END_PGML +############################################## + +BEGIN_PGML_SOLUTION + +A function's zeros are simply the [`x`]-values of its [`x`]-intercepts. This function's zeros are [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionApplication10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionApplication10.pg new file mode 100644 index 0000000000..31f9e473b7 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionApplication10.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College + + +#DESCRIPTION +#KEYWORDS('functions') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('Alex Jordan') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +#ENDDESCRIPTION + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; + +@output = ("seconds","minutes","hours"); +@input = ("days","weeks","years"); +@inputsingular = ("day","week","year"); + +$pickinput = random(0,2,1); +$pickoutput = random(0,2,1); +@outputmultiple = (60*60*24,60*24,24); #number of units per day +@inputmultiple = (1,7,365); #number of units per day +@outputmultiplestring = ("60\cdot60\cdot24","60\cdot24",24); #number of units per day +@inputmultiplestring = ("", "\cdot7", "\cdot365"); #times number of days + +$m = $inputmultiple[$pickinput]*$outputmultiple[$pickoutput]; + +$a = $output[$pickoutput]; +$b = $input[$pickinput]; +$c = $inputsingular[$pickinput]; + +$d = $outputmultiplestring[$pickoutput]; +$e = $inputmultiplestring[$pickinput]; + +Context("Numeric"); +parser::Assignment->Allow; +parser::Assignment->Function("f"); +$formula = Formula("f(x)=$m x"); + +############################################## + +BEGIN_PGML + +Find a formula for the function [`f`] that gives the number of [$a] in [`x`] [$b]. +[@KeyboardInstructions(qw!Include the function's name and an equals sign in the formula.!)@]** + +[_____________]{$formula} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Knowing that there are [`60`] second in a minute, [`60`] minutes in an hour, [`24`] hours in a day, [`7`] days in a week, and [`365`] days in a year, we compute that there are [`[$d][$e]=[$m]`] [$a] in one [$c]. Therefore in [`x`] [$b], there will be [`[$m]x`] [$a]. + +So [`f(x)=[$m]x`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs05.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs05.pg new file mode 100644 index 0000000000..782f06521a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs05.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PGunion.pl", + "imageChoice.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$xmin = -5; +$ymin = -5; +$xmax = -$xmin; +$ymax = -$ymin; + + + +# make graphs for each +@gr = (); +foreach my $i (0..7) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0],'grid'=>[$xmax-$xmin,$ymax-$ymin]); +} + +$f[0] = Formula(non_zero_random(-4,4,1)); +add_functions($gr[0], "$f[0] for x in <$xmin,$xmax> using color:blue and weight:2"); +$f[1] = Formula("x"); +add_functions($gr[1], "$f[1] for x in <$xmin,$xmax> using color:blue and weight:2"); +$f[2] = Formula("x^2"); +add_functions($gr[2], "$f[2] for x in <$xmin,$xmax> using color:blue and weight:2"); +$f[3] = Formula("x^3"); +add_functions($gr[3], "$f[3] for x in <$xmin,$xmax> using color:blue and weight:2"); +$f[4] = Formula("abs(x)"); +add_functions($gr[4], "$f[4] for x in <$xmin,$xmax> using color:blue and weight:2"); +$f[5] = Formula("1/x"); +add_functions($gr[5], "$f[5] for x in <$xmin,-0.1> using color:blue and weight:2"); +add_functions($gr[5], "$f[5] for x in <0.1,$xmax> using color:blue and weight:2"); +$f[6] = Formula("sqrt(x)"); +add_functions($gr[6], "$f[6] for x in <0,$xmax> using color:blue and weight:2"); +$f[7] = Formula("1/x^2"); +add_functions($gr[7], "$f[7] for x in <$xmin,$xmax> using color:blue and weight:2"); + + +@QA = (); +Context()->texStrings; +foreach my $i (0..7) { push( @QA, "\(f(x)=$f[$i]\)", $gr[$i] ); } +Context()->normalStrings; + + +$ml = new_image_match_list( + link => 1, # do not link to separate image + size => [200,200], # image size in pixels + tex_size => 450, # tex size in precent times 10 + columns => 2, # number of columns + separation => 20, # separation between image columns +); + +$ml->rf_print_q(~~&pop_up_list_print_q); # use pop-up-lists +$ml->ra_pop_up_list([ No_answer=>"?", A=>"A", B=>"B", C=>"C", D=>"D", E=>"E", F=>"F", G=>"G", H=>"H"] ); + +$ml->qa(@QA); # set the questions and answers +$ml->choose(8); # select 4 of them +#$ml->choose_extra(0); # and show the other 1 + +############################################## + +BEGIN_TEXT +\{ +ColumnTable( +"Match the graphs with the corresponding formulas.". +$ml->print_q() # no period! +, # comma! +$BCENTER. +$ml->print_a(). +$BR. +"(Click on a graph to enlarge it)". +$ECENTER # no period! +, # comma! +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS(str_cmp($ml->ra_correct_ans)); + +foreach my $i (0..7) { + $a[$i] = $ml->ra_correct_ans->[$i]; +} + +BEGIN_SOLUTION +The formulas match as follows: +1 matches graph $a[0], +2 matches graph $a[1], +3 matches graph $a[2], +4 matches graph $a[3], +5 matches graph $a[4], +6 matches graph $a[5], +7 matches graph $a[6], and +8 matches graph $a[7]. +END_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs10.pg new file mode 100644 index 0000000000..0738b4fe00 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs10.pg @@ -0,0 +1,219 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "pccTables.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$leftRoot = random(-3,-1,1); +$rightRoot = random(1,2,1); + + +$h = Formula("(x-$leftRoot)*(x-$rightRoot)^2"); + +$g = $h->eval(x=>-3); +for my $i (-2,-1,0,1,2,3) +{$g = gcd($g,$h->eval(x=>$i));} + +$h = $h/$g; + + +for my $i (-3..3) { +$hevaluated[$i+3] = $h->eval(x=>$i); +} + +$pt1 = $rightRoot+1; +$pt2 = $rightRoot-2; +$pt3 = $rightRoot; +$pt4 = $rightRoot-3; + + +$ans[1] = $hevaluated[$pt1+3] - $hevaluated[$pt2+3]; +$ans[2] = $hevaluated[$pt3+3] - $hevaluated[$pt4+3]; +$ans[3] = 2*$hevaluated[$pt4+3]; +$ans[4] = $hevaluated[$pt2+3] + 3; + + + +$xmin = $leftRoot-1; +$xmax = $rightRoot+2; +$ymin = min((@hevaluated)[1..5])-4; +$ymax = max((@hevaluated)[1..5])+4; + +$refreshCachedImages=1; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[240,240] +); + + $gr->lb('reset'); + for my $j ($xmin+1..$xmax-1) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j,0, $j,'black','center','top','large')); + } + +$ysep = max(1,int(log($ymax-$ymin)/log(2))); + for my $j ($ymin+1..$ymax-1) { + if (abs($j)<10**(-10) or $j%$ysep != 0) {next;} + $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); + } + + $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); + $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); + + + +add_functions($gr, "$h for x in <$xmin,$xmax>" . + " using color:blue and weight:1"); + +$f = RandomVariableName(type=>'function'); + +$alt = 'a graph of a curve that starts on the left moving upward, reaches a peak, comes back down some, flattens out, and then moves upward to the right; it passes through '; +for my $i (-3..2) +{ $x = $xmin+$i+3; + $y = $hevaluated[$i+3]; + $alt .= "($x, $y), "; +} +$x = $xmin+6; +$y = $hevaluated[6]; +$alt .= "and ($x, $y)."; +############################################## + + +BEGIN_PGML + +Use the graph of [`[$f]`] in the figure to fill in the table. + +[@EnlargeImageStatementPGML()@]** + +>> [@ image( insertGraph($gr), width=>240, extra_html_tags => "alt = '$alt'" ) @]* << + + +[@ + DataTable([ + [{data=>general_math_ev3('x'), header=>'RH'}, + general_math_ev3('-2'), + general_math_ev3('-1'), + general_math_ev3('0'), + general_math_ev3('1'), + general_math_ev3('2'),], + [{data=>general_math_ev3("$f(x)"), header=>'RH'}, + ans_rule(5),ans_rule(5),ans_rule(5),ans_rule(5),ans_rule(5)] + ], +allcellcss=>"text-align:center; border:solid; border-width:1px;", +headercss=>"text-align:left", +); +@]* + +a. Evaluate [`[$f]([$pt1])-[$f]([$pt2])`]. + [_____] + +a. Evaluate [`[$f]([$pt3])-[$f]([$pt4])`]. + [_____] + +a. Evaluate [`2[$f]([$pt4])`]. + [_____] + +a. Evaluate [`[$f]([$pt2])+3`]. + [_____] + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + +ANS( $hevaluated[-2+3]-> cmp ); +ANS( $hevaluated[-1+3]-> cmp ); +ANS( $hevaluated[0+3]-> cmp ); +ANS( $hevaluated[1+3]-> cmp ); +ANS( $hevaluated[2+3]-> cmp ); + +ANS( $ans[1]-> cmp ); +ANS( $ans[2]-> cmp ); +ANS( $ans[3]-> cmp ); +ANS( $ans[4]-> cmp ); + + +############################################## + +BEGIN_SOLUTION + +We read the graph by locating \(x\)-values on the \(x\)-axis, and moving straight up or down until we hit the graph. Wherever we land, the \(y\)-value is the corresponding output. + +$PAR +\{ + DataTable( +[[{data=>'\(x\)', header=>'RH'},'\(-2\)','\(-1\)','\(0\)','\(1\)','\(2\)',], +[{data=>'\($f(x)\)', header=>'RH'}, "\($hevaluated[-2+3]\)","\($hevaluated[-1+3]\)","\($hevaluated[0+3]\)","\($hevaluated[1+3]\)","\($hevaluated[2+3]\)",]], +allcellcss=>"text-align:center; border:solid; border-width:1px; width: 60pt", +headercss=>"text-align:left", +); +\} +$PAR + +Then we can use the values from the table to simplify the expressions we were given:$PAR + +\[ +\begin{aligned} +$f($pt1)-$f($pt2) +&= $hevaluated[$pt1+3] - $hevaluated[$pt2+3]\\ +&= $ans[1]\\ +$f($pt3)-$f($pt4) +&= $hevaluated[$pt3+3] - $hevaluated[$pt4+3]\\ +&= $ans[2]\\ +2$f($pt4) +&= 2\cdot($hevaluated[$pt4+3])\\ +&= $ans[3]\\ +$f($pt2)+3 +&= $hevaluated[$pt2+3] + 3\\ +&= $ans[4] +\end{aligned} +\] + + + + + +END_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs20.pg new file mode 100644 index 0000000000..fbc5a4032a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs20.pg @@ -0,0 +1,223 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "pccTables.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCgraphMacros.pl", + "answerHints.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + + + +$f = Formula("x^3/2-1"); + + + + +$xmin = -2; +$xmax = 3; +$ymin = -5; +$ymax = 8; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +size=>[240,120] +); + + +add_functions($gr, "$f for x in <$xmin,$xmax>" . + " using color:blue and weight:1"); + +$gr->stamps( closed_circle(2,3,'blue') ); +$gr->stamps( closed_circle(-1.5,-2.6975,'blue') ); + + +$labela = new Label(0,3,'a', + 'black','right','middle'); +$labela->font(GD::Font->Large); +$gr -> lb($labela); + +$labele = new Label(0,-2.6975,'e', + 'black','right','middle'); +$labele->font(GD::Font->Large); +$gr -> lb($labele); + +$labelc = new Label(0,-1,'c', + 'black','right','middle',); +$labelc->font(GD::Font->Large); +$gr -> lb($labelc); + +$labelb = new Label(2,0,'b', + 'black','center','top',); +$labelb->font(GD::Font->Large); +$gr -> lb($labelb); + +$labelh = new Label(1.26,0,'h', + 'black','center','top',); +$labelh->font(GD::Font->Large); +$gr -> lb($labelh); + +$labeld = new Label(-1.5,0,'d', + 'black','center','top',); +$labeld->font(GD::Font->Large); +$gr -> lb($labeld); + +$labelP = new Label(2,3,'P', + 'black','left','top',); +$labelP->font(GD::Font->Large); +$gr -> lb($labelP); + +$labelQ = new Label(-1.5,-2.6975,'Q', + 'black','left','top',); +$labelQ->font(GD::Font->Large); +$gr -> lb($labelQ); + +$gr->moveTo(-.05,3); +$gr->lineTo(0.05,3,'black',1); + +$gr->moveTo(-.05,-2.6975); +$gr->lineTo(0.05,-2.6975,'black',1); + +$gr->moveTo(-.05,-1); +$gr->lineTo(0.05,-1,'black',1); + +$gr->moveTo(2,-0.05); +$gr->lineTo(2,0.05,'black',1); + +$gr->moveTo(-1.5,-0.05); +$gr->lineTo(-1.5,0.05,'black',1); + +$gr->moveTo(1.26,-0.05); +$gr->lineTo(1.26,0.05,'black',1); + + $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); + $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); + + + +Context("Point"); +Context()->variables->are(x=>'Real',h=>'Real',a=>'Real',b=>'Real',c=>'Real',d=>'Real',e=>'Real',P=>'Real', Q=>'Real'); + + + +$ans[0] = Point("(b,a)"); +$ans[1] = Point("(d,e)"); +$ans[2] = Compute("a"); + +parser::Assignment->Allow; + +$ans[3] = Formula("x=d"); +$ans[4] = Compute("x=h"); + +$alt = "a graph that begins at the lower left corner; as the curve moves left, it moves up; as the curve reaches the y-axis, it flattens, but then begins moving up again; it crosses the x-axis, and continues upward and to the right; the curve has a point Q in the lower left quadrant; Q is horizontally aligned with a mark e on the y-axis, and vertically aligned with a mark d on the x-axis; it crosses the y-axis at a mark c, and it crosses the x-axis at a mark h; in the upper right quadrant the curve has a point P; P is horizontally aligned with a mark a on the y-axis, and vertically aligned with a mark b on the x-axis"; + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Use the given graph of a function \(f\), along with \(a, b, c, d, e\), and \(h\) to answer the following questions. Some answers are points, and should be entered as ordered pairs. Some answers ask you to solve for \(x\), so the answer should be in the form $BBOLD x=...$EBOLD + +$PAR +\{EnlargeImageStatement()\} +$PAR + +$BCENTER +\{ image( insertGraph($gr), +width=>240, +extra_html_tags=>"alt = '$alt'" ) \} +$BR +$ECENTER + +END_TEXT +Context()->normalStrings; + +BEGIN_PGML + +a. What are the coordinates of the point [`P`]? + [__________] + +a. What are the coordinates of the point [`Q`]? + [__________] + +a. Evaluate [`f(b)`]. (The answer is symbolic, not a specific number.) + [__________] + +a. Solve [`f(x)=e`] for [`x`]. (The answer is symbolic, not a specific number.) + [__________] + +a. Suppose [`c=f(z)`]. Solve the equation [`z=f(x)`] for [`x`]. + [__________] + +END_PGML + + +############################################## + + + +$showPartialCorrectAnswers=1; + + +ANS( $ans[0]-> cmp ); +ANS( $ans[1]-> cmp ); +ANS( $ans[2]-> cmp->withPostFilter(AnswerHints( + Formula("P") => "P is a point, not an output of the function", + Formula("Q") => "Q is a point, not an output of the function", +)) ); +ANS( $ans[3]-> cmp ); +ANS( $ans[4]-> cmp ); + +############################################## + +BEGIN_PGML_SOLUTION + +a. [`P`] is located at [`[@$ans[0]@]`]. + +a. [`Q`] is located at [`[@$ans[1]@]`]. + +a. Since [`[@$ans[0]@]`] is on the graph of [`f`], this means that [`f(b)=a`]. + +a. To solve [`f(x)=e`], we look for all points of the form [`(\phantom{x},e)`] that are on the graph of [`f`]. This means we look to [`e`] on the [`y`]-axis, and scan left and right looking for points on the graph. The only such point is [`[@$ans[1]@]`], so the solution is [`[@$ans[3]@]`]. + +a. Since [`c=f(z)`], we deduce that [`z=0`], because [`(0,c)`] is on the graph. Now we have to solve [`0=f(x)`]. Since [`(h,0)`] is the only point on the graph that has [`y`]-coordinate [`0`], then it must mean that the solution to [`0=f(x)`] is [`x=h`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs30.pg new file mode 100644 index 0000000000..a389ff3655 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs30.pg @@ -0,0 +1,119 @@ + DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGML.pl", +"extraAnswerEvaluators.pl", +"PGasu.pl" +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +$refreshCachedImages = 1; + +#GRAPH +$a1=random(1,3); +$a2=random(1,3); +$b1=random(3,5); +do {$b2=random(-5,-3);} until $b1 != -$b2; +$f1=random(-4,-1,1); +$f2=random(4,6,1); +$g1=$b2-3; +$g2=$b1+3; +$xdom1=9; +$ydom1=int(max(-$f1 + $a1,.05*($g1-$b2)*($g1-$b1)))+1; +$endf1 = $f1 - $a1; +$endf2 = $a2 - $a1; +$endg1 = .05*($g1 - $b2)*($g1 - $b1); +$endg2 = .05*($g2 - $b2)*($g2 - $b1); +$xvert = ($b1 + $b2) / 2; +$yvert = .05*($xvert - $b2)*($xvert - $b1); +$xgrid=2*$xdom1; +$ygrid=2*$ydom1; +$graph = init_graph(-$xdom1,-$ydom1,$xdom1,$ydom1,'axes'=>[0,0],'grid'=>[$xgrid,$ygrid]); +$graph->moveTo($f1,$f1-$a1); +$graph->lineTo($a2, $a2 - $a1, 'blue', 2, 'dashed'); +$graph->lineTo($f2, $a2 - $a1, 'blue', 2, 'dashed'); +$g = FEQ(".05(x-$b2)*(x-$b1) for x in <$g1,$g2> using color:red and weight:2"); +$graph->stamps( closed_circle($g1,$endg1,'red') ); +$graph->stamps( closed_circle($g2,$endg2,'red') ); +$graph->stamps( closed_circle($f1,$endf1,'blue') ); +$graph->stamps( closed_circle($f2,$endf2,'blue') ); + +($fref) = plot_functions( $graph, $g); +$graph->lb( new Label($a2,$a2 - $a1 - 0.5,'f', 'blue','center','center')); +$graph->lb( new Label($xvert,$yvert + 0.5,'g', 'red','center','center')); + +$c = random($f1,$a2,1); +$d=random($a2, $f2,1); +$e = random(-1, $a2 - 1); +$e1 = $e - $a1; + + +$flefty = $f1-$a1; +$fmidy = $a2-$a1; + +$glefty = .05*($g1-$b2)*($g1-$b1); +$gmidx = ($g1 + $g2) / 2; +$gmidy = .05*($gmidx-$b2)*($gmidx-$b1); +$grighty = .05*($g2-$b2)*($g2-$b1); + + +$alt = "a graph of two functions; the graph of f consists of a line segment from ($f1, $flefty) to ($a2, $fmidy), and another line segment from ($a2, $fmidy) to ($f2, $fmidy); the graph of g is a section of an an upward-opening parabola that starts at ($g1, $glefty), dips to its vertex at ($gmidx, $gmidy), and rises back to ($g2, $grighty)"; + +Context("Interval"); +$ans2 = ($c - $a1) + ($a2 - $a1); +############################################## + +BEGIN_TEXT +Use the graphs of \(f\) (in blue and dashed) and \(g\) (in red and solid) +to answer these questions: $PAR + +\{EnlargeImageStatement()\} + +$BCENTER +\{ image(insertGraph($graph),height=>400,width=>400, extra_html_tags=>"alt = '$alt'") \} $BR +$ECENTER +$PAR + +END_TEXT + +BEGIN_PGML + +a) What is the domain of [`g`]? Give your answer in interval notation. +[_______________]{"[$g1,$g2]"} +a) If [`t= [$c]`], then [`f(t)+f([$d])={}`][_______________]{$ans2} +a) Estimate the solution of the equation [`f(x) = [$e1]`]. +[`x={}`][_______________]{$e} +a) On what interval is the function [`f`] increasing? Give your answer in interval notation. Round your endpoints to the nearest whole number. +[_______________]{Interval("($f1,$a2)")->cmp(requireParenMatch=>0)} +a) For what values is [`g(x) \leq 0`]? Write your answer in interval notation. +[_______________]{"[$b2,$b1]"} + + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION +a) If we look at the graph of [`g`], the [`x`]-values that are covered by this graph are the ones starting with [`[$g1]`] and ending with [`[$g2]`], so the domain of [`g`] is [`[[$g1],[$g2]]`]. +a) [`\begin{aligned}[t] +f(t)+f([$d]) & = f([$c])+f([$d])\\ +&= [$c - $a1] + [$a2 - $a1]\\ +&= [$ans2] +\end{aligned}`] +a) The only place on the graph of [`f`] where the [`y`]-coordinate is [`[$e1]`] is at [`([$e],[$e1])`]. So the solution to [`f(x)=[$e1]`] is [`x=[$e]`]. +a) [`f`] is increasing for [`x`] values between [`[$f1]`] and [`[$a2]`]. Beyond that, [`f`] is constant. So [`f`] is increasing on the interval [`[[$f1],[$a2]]`]. +a) The outputs of [`g`] are equal to [`0`] at [`x=[$b2]`] and [`x=[$b1]`]. For [`x`]-values in between the output of [`g`] is negative. For all other [`x`]-values in the domain of [`g`], the output is positive. So [`g(x) \leq 0`] on the interval [`[[$b2],[$b1]]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs40.pg new file mode 100644 index 0000000000..ff312c7742 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs40.pg @@ -0,0 +1,84 @@ + DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"PGML.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"extraAnswerEvaluators.pl", +"PGasu.pl" +); + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +#GRAPH + +$a1=random(1,2); +$a2=list_random(-1,1); +$a3=random(2,4); +$xdom1=2*$a3; +$xgriddom=2*$a3+1; +$x1 = 2*$a3; +$x2 = -$a3; +$g1 = $a2*(-0.25*$a1*$x1); +$g2 = $a2*(-0.25*$a1*$x2); +$ymax= int(abs($g1)) + 1; +$ymin = -$ymax; + +if ($a2 > 0) {$str = "negative";} +else {$str = "positive";} +if ($a1 == 1) { + if ($a3 == 2) {$int1 = 1.5;} + if ($a3 == 3) {$int1 = 2.5;} + if ($a3 == 4) {$int1 = 3;} +} +if ($a1 == 2) { + $int1 = 2; + if ($a3 == 2) {$int1 = 1.5;} +} + +$b = $a1*non_zero_random(-10,10)*0.01; + +$xgrid=2*$xgriddom; +$graph = init_graph(-$xgriddom,$ymin,$xgriddom,$ymax,'axes'=>[0,0],'grid'=>[$xgrid, $ymax - $ymin]); +$f = FEQ("$a2*(-0.25*$a1*x + sin(pi/$a3*x)) for x in [-$xdom1,$xdom1] using color:black and weight:2"); +($fref) = plot_functions( $graph, $f); + + +BEGIN_TEXT +Use the the graph of \(g\) to answer the questions. Assume the domain of \(g\) is \([-$xdom1,$xdom1]\). +$PAR +\{EnlargeImageStatement()\} +$PAR + +$BCENTER +\{ image(insertGraph($graph), height=>300, width=>300) \} $BR + +$ECENTER +$PAR + +END_TEXT + +BEGIN_PGML +a) [`g([$x1]) ={}`][_____________]{$g1} +a) [`g([$x2]) ={}`][_____________]{$g2} +a) For _how many_ values of [`x`] does [`g(x) = [$b]`]? [_____]{3} +a) On what interval or union of intervals is [`g`] [$str]? [_______________________]{Interval("(-$int1,0)U($int1,$xdom1]")->cmp(tolType=>'absolute', tolerance=>0.5)} (You may round to the nearest half of a unit). + +END_PGML + + +BEGIN_PGML_SOLUTION + +a) Since the graph has the point [`([$x1],[$g1])`], that tells is that [`g([$x1])=[$g1]`]. +a) Since the graph has the point [`([$x2],[$g2])`], that tells is that [`g([$x2])=[$g2]`]. +a) The horizontal line [`y=[$b]`] intersects the graph in three places, so there are [`3`] solutions to [`g(x) = [$b]`]. +a) The [`x`]-values that correspond to [$str] outputs of [`g`] are those in [`(-[$int1],0)\cup([$int1],[$xdom1]]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs50.pg new file mode 100644 index 0000000000..9151b0fa05 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs50.pg @@ -0,0 +1,129 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, find where the function +# is increasing/decreasing. +# +# Last update: Carl Yao 03/27/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +do { + $a = random(0.01,1,0.01)*random(-1,1,2); + $x1 = random(-3,-1,1); + $x2 = random(1,3,1); + $b = random(-3,3,1); + $func = Compute("$a*x**3-1.5*$a*($x1+$x2)*x**2+3*$a*$x1*$x2*x+$b")->reduce; + $y1 = $func->eval(x=>$x1); + $y2 = $func->eval(x=>$x2); +} until ( (abs($y1)<10) && (abs($y2)<10) ); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([2*$x1,2*$x2],[$y1,$y2,0],centerOrigin=>0); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $leftBound = $min[0]-1; + $rightBound = $max[0]+1; + + add_functions($gr[$i], "$func for x in ($leftBound,$rightBound) using color:blue and weight:1"); + + $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); +} + +Context("Interval"); + +if ($a>0) { + $ALT = "graph of a function starting at the bottom left, going up till the point ($x1,$y1), turning down till the point ($x2,$y2), and then turning up toward the top right."; + $ansInc = Compute("(-inf,$x1)U($x2,inf)"); + $ansDec = Compute("($x1,$x2)"); +} else { + $ALT = "graph of a function starting at the top left, going down till the point ($x1,$y1), turning up till the point ($x2,$y2), and then turning down toward the bottom right."; + $ansDec = Compute("(-inf,$x1)U($x2,inf)"); + $ansInc = Compute("($x1,$x2)"); +} + + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +A function's graph is shown below. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +[@KeyboardInstructions('If the answer includes more than one interval write the intervals separated by the union symbol, which you can type as [|U|]*. If the answer uses [`\infty`], you may type it as [|inf|]*.')@]** + +The function is increasing in the interval [_____________________]{$ansInc}. + +The function is decreasing in the interval [_____________________]{$ansDec}. + +END_PGML +############################################## + +BEGIN_PGML_SOLUTION + +The function is increasing in the interval [`[$ansInc]`]. + +The function is decreasing in the interval [`[$ansDec]`]. + +We always use open intervals when we identify where a function is increasing/decreasing. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs55.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs55.pg new file mode 100644 index 0000000000..edfb85d023 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs55.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, find where the function +# is increasing/decreasing. +# +# Last update: Carl Yao 03/31/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +do { + $x1 = random(-5,-2,1); + $x2 = random(-1,1,1); + $x3 = random(2,5,1); + $a = random(0.01,0.05,0.01)*random(-1,1,2); + $b = random(-5,5,1); + $func = Compute("$a/4*x**4-$a*($x1+$x2+$x3)/3*x**3+$a*($x1*$x2+$x1*$x3+$x2*$x3)/2*x**2-$a*$x1*$x2*$x3*x+$b"); + $y1 = $func->eval(x=>$x1); + $y2 = $func->eval(x=>$x2); + $y3 = $func->eval(x=>$x3); +} until ( (abs($y1)<10) && (abs($y2)<10) && (abs($y3)<10) && ($x2-$x1>1) && ($x3-$x2>1) ); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([2*$x1,2*$x3],[$y1,$y2,0,$y3],centerOrigin=>0); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $leftBound = $min[0]-1; + $rightBound = $max[0]+1; + + add_functions($gr[$i], "$func for x in ($leftBound,$rightBound) using color:blue and weight:1"); + + $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); + $gr[$i]->stamps( closed_circle($x3,$y3,'blue') ); +} + +Context("Interval"); + +if ($a>0) { + $ALT = "This is a graph of a function starting at the top left, going down till the point ($x1,$y1), turning up till the point ($x2,$y2), turning down till the point ($x3,$y3), and finally turning up to the top right."; + $ansInc = Compute("($x1,$x2)U($x3,inf)"); + $ansDec = Compute("(-inf,$x1)U($x2,$x3)"); +} else { + $ALT = "This is a graph of a function starting at the bottom left, going up till the point ($x1,$y1), turning down till the point ($x2,$y2), turning up till the point ($x3,$y3), and finally turning down to the bottom right."; + $ansDec = Compute("($x1,$x2)U($x3,inf)"); + $ansInc = Compute("(-inf,$x1)U($x2,$x3)"); +} + + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +A function's graph is shown below. A few points are highlighted for your reference. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +[@KeyboardInstructions('If the answer includes more than one interval write the intervals separated by the union symbol, which you can type as [|U|]*. If the answer uses [`\infty`], you may type it as [|inf|]*.')@]** + +The function is increasing in the interval [_____________________]{$ansInc}. + +The function is decreasing in the interval [_____________________]{$ansDec}. + +END_PGML +############################################## + +BEGIN_PGML_SOLUTION + +The function is increasing in the interval [`[$ansInc]`]. + +The function is decreasing in the interval [`[$ansDec]`]. + +We always use open intervals when we identify where a function is increasing or decreasing. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs60.pg new file mode 100644 index 0000000000..5ca306360b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionGraphs60.pg @@ -0,0 +1,180 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, find where the function +# is increasing/decreasing/constant. +# +# Last update: Carl Yao 03/27/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +$p1x = random(-3,-1,1); +$p1y = non_zero_random(-5,5,1); +$p2x = random(1,3,1); +$p2y = $p1y; + +$a1 = random(0.03,0.06,0.01)*random(-1,1,2); +$func1 = Compute("$a1*(x-$p1x)**2+$p1y"); +$func2 = Compute("$p1y"); +$a3 = random(0.03,0.06,0.01)*random(-1,1,2); +$func3 = Compute("$a3*(x-$p2x)**2+$p2y"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([2*$p1x,2*$p2x],[$p1y,$p2y,0],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $leftBound = $min[0]-1; + $rightBound = $max[0]+1; + + add_functions($gr[$i], "$func1 for x in ($leftBound,$p1x) using color:blue and weight:1"); + add_functions($gr[$i], "$func2 for x in ($p1x,$p2x) using color:blue and weight:1"); + add_functions($gr[$i], "$func3 for x in ($p2x,$rightBound) using color:blue and weight:1"); + + $gr[$i]->stamps( closed_circle($p1x,$p1y,'blue') ); + $gr[$i]->stamps( closed_circle($p2x,$p2y,'blue') ); +} + +Context("Interval"); + +$ansCon = Compute("($p1x,$p2x)"); + +if ( ($a1>0) && ($a3>0) ) { + $ALT = "graph of a function starting at the top left, curving down till the point ($p1x,$p1y), going horizontally till the point ($p2x,$p2y), and then curving up toward the top right."; + $ansInc = Compute("($p2x,inf)"); + $ansDec = Compute("(-inf,$p1x)"); +} elsif ( ($a1>0) && ($a3<0) ) { + $ALT = "graph of a function starting at the top left, curving down till the point ($p1x,$p1y), going horizontally till the point ($p2x,$p2y), and then curving down toward the bottom right."; + $ansInc = Compute(DNE); + $ansDec = Compute("(-inf,$p1x)U($p2x,inf)"); +} elsif ( ($a1<0) && ($a3>0) ) { + $ALT = "graph of a function starting at the bottom left, curving up till the point ($p1x,$p1y), going horizontally till the point ($p2x,$p2y), and then curving up toward the top right."; + $ansInc = Compute("(-inf,$p1x)U($p2x,inf)"); + $ansDec = Compute(DNE); +} else { + $ALT = "graph of a function starting at the bottom left, curving up till the point ($p1x,$p1y), going horizontally till the point ($p2x,$p2y), and then curving down toward the bottom right."; + $ansInc = Compute("(-inf,$p1x)"); + $ansDec = Compute("($p2x,inf)"); +} + + + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +A function's graph is shown below. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +[@KeyboardInstructions('* If the answer includes more than one interval write the intervals separated by the union symbol, which you can type as [|U|]*. If the answer uses [`\infty`], you may type it as [|inf|]*.')@]** + +[@KeyboardInstructions('* If the answer is an empty interval, type DNE (does not exist).')@]** + +The function is increasing in the interval [_____________________]{$ansInc}. + +The function is constant in the interval [_____________________]{$ansCon}. + +The function is decreasing in the interval [_____________________]{$ansDec}. + +END_PGML +############################################## + +if ( $a1*$a3>0 ) { + +BEGIN_PGML_SOLUTION + +The function is increasing in the interval [`[$ansInc]`]. + +The function is constant in the interval [`[$ansCon]`]. + +The function is decreasing in the interval [`[$ansDec]`]. + +We always use open intervals when we identify where a function is increasing/decreasing. + +END_PGML_SOLUTION + +} elsif ( ($a1>0) && ($a3<0) ) { + +BEGIN_PGML_SOLUTION + +The function does not increase. + +The function is constant in the interval [`[$ansCon]`]. + +The function is decreasing in the interval [`[$ansDec]`]. + +We always use open intervals when we identify where a function is increasing/decreasing. + +END_PGML_SOLUTION + +} else { + +BEGIN_PGML_SOLUTION + +The function is increasing in the interval [`[$ansInc]`]. + +The function is constant in the interval [`[$ansCon]`]. + +The function does not decrease. + +We always use open intervals when we identify where a function is increasing/decreasing. + +END_PGML_SOLUTION + +} + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin10.pg new file mode 100644 index 0000000000..4464a4e0ef --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin10.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, find the maximum and minimum. +# +# Last update: Carl Yao 09/06/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $a = random(0.1,1,0.1)*random(-1,1,2); + $x1 = random(-5,-1,1); + $x2 = random(1,5,1); + $b = random(-3,3,1); + $func = Compute("$a*x**3-1.5*$a*($x1+$x2)*x**2+3*$a*$x1*$x2*x+$b")->reduce; + $y1 = $func->eval(x=>$x1); + $y2 = $func->eval(x=>$x2); + $x3 = random($x1-4,$x1-1,1); + $x4 = random($x2+1,$x2+4,1); + $y3 = $func->eval(x=>$x3); + $y4 = $func->eval(x=>$x4); + + $y1 = Round($y1,2); + $y2 = Round($y2,2); + $y3 = Round($y3,2); + $y4 = Round($y4,2); + + %points = ( + $y1 => $x1, + $y2 => $x2, + $y3 => $x3, + $y4 => $x4, + ); + + if ($a>0) { + $localMinX = $x2; + $localMinY = $y2; + $localMaxX = $x1; + $localMaxY = $y1; + } else { + $localMinX = $x1; + $localMinY = $y1; + $localMaxX = $x2; + $localMaxY = $y2; + } + + $globalMinY = min($y1,$y2,$y3,$y4); + $globalMinX = Real($points{$globalMinY}); + $globalMaxY = max($y1,$y2,$y3,$y4); + $globalMaxX = Real($points{$globalMaxY}); +} until ( + abs($y1)<10 && + abs($y2)<10 && + abs($y3)<10 && + abs($y4)<10 && + $y3 != $y2 && + $y4 != $y1 && + ( ($localMaxX != $globalMaxX) || ($localMinX != $globalMinX) ) +); + + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x3,$x4],[$y1,$y2,$y3,$y4],centerOrigin=>0); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + $leftBound = $x3; + $rightBound = $x4; + + add_functions($gr[$i], "$func for x in [$leftBound,$rightBound] using color:blue and weight:1"); + + $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); + if ($a>0) { + $adjust1 = ($max[1]-$min[1])/30; + $adjust2 = -$adjust1; + } else { + $adjust1 = -($max[1]-$min[1])/30; + $adjust2 = -$adjust1; + } + $gr[$i]->lb( new Label($x1, $y1+$adjust1, "($x1,$y1)",'blue','center','middle')); + $gr[$i]->lb( new Label($x2, $y2+$adjust2, "($x2,$y2)",'blue','center','middle')); + $gr[$i]->lb( new Label($x3, $y3+$adjust2, "($x3,$y3)",'blue','center','middle')); + $gr[$i]->lb( new Label($x4, $y4+$adjust1, "($x4,$y4)",'blue','center','middle')); +} + +if ($a>0) { + $ALT = "graph of a function starting at the bottom left at ($x3,$y3), going up till the point ($x1,$y1), turning down till the point ($x2,$y2), and then turning up and ends at ($x4,$y4)."; +} else { + $ALT = "graph of a function starting at the top left at ($x3,$y3), going down till the point ($x1,$y1), turning up till the point ($x2,$y2), and then turning down and ends at ($x4,$y4)."; +} + + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +A function's graph is shown below. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +If a value doesn't exist, type *DNE* (meaning "does not exist"). + +The function has a local minimum at [_______]{$localMinX}, and the local minimum is [_______]{$localMinY}. + +The function has a local maximum at [_______]{$localMaxX}, and the local maximum is [_______]{$localMaxY}. + +The function's global minimum is at [_______]{$globalMinX}, and the global minimum is [_______]{$globalMinY}. + +The function's global maximum is at [_______]{$globalMaxX}, and the global maximum is [_______]{$globalMaxY}. + +END_PGML +############################################## + +BEGIN_PGML_SOLUTION + +The function has a local minimum at [`[$localMinX]`], and the local minimum is [`[$localMinY]`]. + +The function has a local maximum at [`[$localMaxX]`], and the local maximum is [`[$localMaxY]`]. + +The function's global minimum is at [`[$globalMinX]`], and the global minimum is [`[$globalMinY]`]. + +The function's global maximum is at [`[$globalMaxX]`], and the global maximum is [`[$globalMaxY]`]. + +Note that a local maximum/minimum must have an open interval containing its [`x`]-value, so a point at the end of an interval, like [`([$x3],[$y3])`] and [`([$x4],[$y4])`], does not qualify as a local maximum/minimum. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin20.pg new file mode 100644 index 0000000000..231e62db5b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin20.pg @@ -0,0 +1,172 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, find the function's max/min. +# +# Last update: Carl Yao 09/06/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $x1 = random(-4,-2,1); + $x2 = random(-1,1,1); + $x3 = random(2,4,1); + $a = random(0.005,0.01,0.001)*random(-1,1,2); + $b = random(-5,5,1); + $func = Compute("$a/4*x**4-$a*($x1+$x2+$x3)/3*x**3+$a*($x1*$x2+$x1*$x3+$x2*$x3)/2*x**2-$a*$x1*$x2*$x3*x+$b"); + $y1 = $func->eval(x=>$x1); + $y2 = $func->eval(x=>$x2); + $y3 = $func->eval(x=>$x3); +} until ( (abs($y1)<10) && (abs($y2)<10) && (abs($y3)<10) && ($x2-$x1>1) && ($x3-$x2>1) ); + +$x4 = $x1-1; +$y4 = $func->eval(x=>$x4); +$x5 = $x3+1; +$y5 = $func->eval(x=>$x5); + +$y1 = Round($y1,2); +$y2 = Round($y2,2); +$y3 = Round($y3,2); +$y4 = Round($y4,2); +$y5 = Round($y5,2); + +%points = ( + $x1 => $y1, + $x2 => $y2, + $x3 => $y3, + $x4 => $y4, + $x5 => $y5, +); + +if ($a > 0) { + $localMinX = List($x1,$x3); + $localMaxX = List($x2); +} else { + $localMinX = List($x2); + $localMaxX = List($x1,$x3); +} + +$globalMinY = min($y1,$y2,$y3,$y4,$y5); +my @minx; +for my $xx ($x1,$x2,$x3,$x4,$x5) { + push (@minx,$xx) if ($points{$xx} == $globalMinY); +} +$globalMinX = List(@minx); +$globalMaxY = max($y1,$y2,$y3,$y4,$y5); +my @maxx; +for my $xx ($x1,$x2,$x3,$x4,$x5) { + push (@maxx,$xx) if ($points{$xx} == $globalMaxY); +} +$globalMaxX = List(@maxx); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x4,$x5],[$y1,$y2,$y3,$y4,$y5],centerOrigin=>0); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + add_functions($gr[$i], "$func for x in [$x4,$x5] using color:blue and weight:1"); + + $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); + $gr[$i]->stamps( closed_circle($x3,$y3,'blue') ); + + if ($a>0) { + $adjust1 = -($max[1]-$min[1])/25; + $adjust2 = -$adjust1; + } else { + $adjust1 = ($max[1]-$min[1])/25; + $adjust2 = -$adjust1; + } + $gr[$i]->lb( new Label($x1, $y1+$adjust1, "($x1,$y1)",'blue','center','middle')); + $gr[$i]->lb( new Label($x2, $y2+$adjust2, "($x2,$y2)",'blue','center','middle')); + $gr[$i]->lb( new Label($x3, $y3+$adjust1, "($x3,$y3)",'blue','center','middle')); + $gr[$i]->lb( new Label($x4, $y4+$adjust2, "($x4,$y4)",'blue','center','middle')); + $gr[$i]->lb( new Label($x5, $y5+$adjust2, "($x5,$y5)",'blue','center','middle')); +} + +if ($a>0) { + $ALT = "This is a graph of a function starting at the top left at ($x4,$y4), going down till the point ($x1,$y1), turning up till the point ($x2,$y2), turning down till the point ($x3,$y3), and finally turning up to the top right and ends at ($x5,$y5)."; +} else { + $ALT = "This is a graph of a function starting at the bottom left at ($x4,$y4), going up till the point ($x1,$y1), turning down till the point ($x2,$y2), turning up till the point ($x3,$y3), and finally turning down to the bottom right and ends at ($x5,$y5)."; +} + + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +A function's graph is shown below. A few points are highlighted for your reference. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +If a value doesn't exist, type [|DNE|]* (meaning "does not exist"). Use commas to separate your answers if needed. + +The function has a local minimum at [_______]{$localMinX}. + +The function has a local maximum at [_______]{$localMaxX}. + +The function's global minimum is at [_______]{$globalMinX}, and the global minimum is [_______]{$globalMinY}. + +The function's global maximum is at [_______]{$globalMaxX}, and the global maximum is [_______]{$globalMaxY}. + +END_PGML +############################################## + +BEGIN_PGML_SOLUTION + +The function has a local minimum at [`[$localMinX]`]. + +The function has a local maximum at [`[$localMaxX]`]. + +The function's global minimum is at [`[$globalMinX]`], and the global minimum is [`[$globalMinY]`]. + +The function's global maximum is at [`[$globalMaxX]`], and the global maximum is [`[$globalMaxY]`]. + +Note that a local maximum/minimum must have an open interval containing its [`x`]-value, so a point at the end of an interval, like [`([$x4],[$y4])`] and [`([$x5],[$y5])`], does not qualify as a local maximum/minimum. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin30.pg new file mode 100644 index 0000000000..99311cc101 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionMaxMin30.pg @@ -0,0 +1,234 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, find the maximum and minimum. +# +# Last update: Carl Yao 09/06/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $a = random(0.1,1,0.1)*random(-1,1,2); + $x1 = random(-5,-1,1); + $x2 = random(1,5,1); + $b = random(-3,3,1); + $func = Compute("$a*x**3-1.5*$a*($x1+$x2)*x**2+3*$a*$x1*$x2*x+$b")->reduce; + $y1 = $func->eval(x=>$x1); + $y2 = $func->eval(x=>$x2); + $x3 = random($x1-4,$x1-1,1); + $x4 = random($x2+1,$x2+4,1); + $y3 = $func->eval(x=>$x3); + $y4 = $func->eval(x=>$x4); + + $y1 = Round($y1,2); + $y2 = Round($y2,2); + $y3 = Round($y3,2); + $y4 = Round($y4,2); + + %points = ( + $y1 => $x1, + $y2 => $x2, + $y3 => $x3, + $y4 => $x4, + ); + + if ($a>0) { + $localMinX = $x2; + $localMinY = $y2; + $localMaxX = $x1; + $localMaxY = $y1; + } else { + $localMinX = $x1; + $localMinY = $y1; + $localMaxX = $x2; + $localMaxY = $y2; + } + + $globalMinY = min($y1,$y2,$y3,$y4); + $globalMinX = Real($points{$globalMinY}); + $globalMaxY = max($y1,$y2,$y3,$y4); + $globalMaxX = Real($points{$globalMaxY}); +} until ( + abs($y1)<10 && + abs($y2)<10 && + abs($y3)<10 && + abs($y4)<10 && + $y3 != $y2 && + $y4 != $y1 && + ( (($globalMaxX == $localMaxX) && ($globalMinX != $localMinX)) || (($globalMaxX != $localMaxX) && ($globalMinX == $localMinX)) ) +); + +if ($globalMaxX == $localMaxX) { + $localMaxXAns = Compute("DNE"); + $localMaxYAns = Compute("DNE"); + $globalMaxXAns = Compute("DNE"); + $globalMaxYAns = Compute("DNE"); + $localMinXAns = $localMinX; + $localMinYAns = $localMinY; + $globalMinXAns = $globalMinX; + $globalMinYAns = $globalMinY; +} else { + $localMaxXAns = $localMaxX; + $localMaxYAns = $localMaxY; + $globalMaxXAns = $globalMaxX; + $globalMaxYAns = $globalMaxY; + $localMinXAns = Compute("DNE"); + $localMinYAns = Compute("DNE"); + $globalMinXAns = Compute("DNE"); + $globalMinYAns = Compute("DNE"); +} + + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x3,$x4],[$y1,$y2,$y3,$y4],centerOrigin=>0); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + $leftBound = $x3; + $rightBound = $x4; + + add_functions($gr[$i], "$func for x in [$leftBound,$rightBound] using color:blue and weight:1"); + + if ($a>0) { + $adjust1 = ($max[1]-$min[1])/30; + $adjust2 = -$adjust1; + if ($globalMaxX == $localMaxX) { + $gr[$i]->stamps( open_circle($x1,$y1,'blue') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); + } else { + $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); + $gr[$i]->stamps( open_circle($x2,$y2,'blue') ); + } + } else { + $adjust1 = -($max[1]-$min[1])/30; + $adjust2 = -$adjust1; + if ($globalMaxX == $localMaxX) { + $gr[$i]->stamps( closed_circle($x1,$y1,'blue') ); + $gr[$i]->stamps( open_circle($x2,$y2,'blue') ); + } else { + $gr[$i]->stamps( open_circle($x1,$y1,'blue') ); + $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); + } + } + $gr[$i]->lb( new Label($x1, $y1+$adjust1, "($x1,$y1)",'blue','center','middle')); + $gr[$i]->lb( new Label($x2, $y2+$adjust2, "($x2,$y2)",'blue','center','middle')); + $gr[$i]->lb( new Label($x3, $y3+$adjust2, "($x3,$y3)",'blue','center','middle')); + $gr[$i]->lb( new Label($x4, $y4+$adjust1, "($x4,$y4)",'blue','center','middle')); +} + +if ($a>0) { + if ($globalMaxX == $localMaxX) { + $ALT = "graph of a function starting at the bottom left at ($x3,$y3), going up till the point ($x1,$y1), turning down till the point ($x2,$y2) which is an empty point, and then turning up and ends at ($x4,$y4)."; + } else { + $ALT = "graph of a function starting at the bottom left at ($x3,$y3), going up till the point ($x1,$y1) which is an empty point, turning down till the point ($x2,$y2), and then turning up and ends at ($x4,$y4)."; + } +} else { + if ($globalMaxX == $localMaxX) { + $ALT = "graph of a function starting at the top left at ($x3,$y3), going down till the point ($x1,$y1), turning up till the point ($x2,$y2) which is an empty point, and then turning down and ends at ($x4,$y4)."; + } else { + $ALT = "graph of a function starting at the top left at ($x3,$y3), going down till the point ($x1,$y1) which is an empty point, turning up till the point ($x2,$y2), and then turning down and ends at ($x4,$y4)."; + } +} + + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +A function's graph is shown below. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +If a value doesn't exist, type *DNE* (meaning "does not exist"). + +The function has a local minimum at [_______]{$localMinXAns}, and the local minimum is [_______]{$localMinYAns}. + +The function has a local maximum at [_______]{$localMaxXAns}, and the local maximum is [_______]{$localMaxYAns}. + +The function's global minimum is at [_______]{$globalMinXAns}, and the global minimum is [_______]{$globalMinYAns}. + +The function's global maximum is at [_______]{$globalMaxXAns}, and the global maximum is [_______]{$globalMaxYAns}. + +END_PGML +############################################## + +if ($globalMaxX == $localMaxX) { + +BEGIN_PGML_SOLUTION + +The function has a local minimum at [`[$localMinXAns]`], and the local minimum is [`[$localMinYAns]`]. + +If the point at [`([$localMaxX],[$localMaxY])`] were not empty, the function would have a local maximum at [`[$localMaxX]`], and the local maximum would be [`[$localMaxY]`]. Since the point is empty, the function doesn't have a local maximum. (Type *DNE* for the answer.) + +The function's global minimum is at [`[$globalMinXAns]`], and the global minimum is [`[$globalMinYAns]`]. + +If the point at [`([$globalMaxX],[$globalMaxY])`] were not empty, the function would have a global maximum at [`[$globalMaxX]`], and the global maximum would be [`[$globalMaxY]`]. Since the point is empty, the function doesn't have a global maximum. (Type *DNE* for the answer.) + +Note that a local maximum/minimum must have an open interval containing its [`x`]-value, so a point at the end of an interval, like [`([$x3],[$y3])`] and [`([$x4],[$y4])`], does not qualify as a local maximum/minimum. + +END_PGML_SOLUTION + +} else { + +BEGIN_PGML_SOLUTION + +If the point at [`([$localMinX],[$localMinY])`] were not empty, the function would have a local minimum at [`[$localMinX]`], and the local minimum would be [`[$localMinY]`]. Since the point is empty, the function doesn't have a local minimum. (Type *DNE* for the answer.) + +The function has a local maximum at [`[$localMaxXAns]`], and the local maximum is [`[$localMaxYAns]`]. + +If the point at [`([$globalMinX],[$globalMinY])`] were not empty, the function would have a global minimum at [`[$globalMinX]`], and the global minimum would be [`[$globalMinY]`]. Since the point is empty, the function doesn't have a global minimum. (Type *DNE* for the answer.) + +The function has a global maximum at [`[$globalMaxXAns]`], and the global maximum is [`[$globalMaxYAns]`]. + +Note that a local maximum/minimum must have an open interval containing its [`x`]-value, so a point at the end of an interval, like [`([$x3],[$y3])`] and [`([$x4],[$y4])`], does not qualify as a local maximum/minimum. + +END_PGML_SOLUTION + + +} + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations10.pg new file mode 100644 index 0000000000..6602326beb --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations10.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Equations relating x and y; do they define y as a function of x? +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() +## KEYWORDS('function',) +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +$a = random(2,5,1); +$b = random(2,5,1); +$c = (random(1,10,1))**2; +$d = random(2,8,2); +$e = (random(1,10,1))**2; +$f = random(2,5,1); +$g = random(2,5,1); +$h = $g/gcd($g,$h); +$i = random(2,8,1); +$j = random(2,8,1); +$k = $d+1; +$l = random(3,9,1); + +@fs = ( +"\( y=x^{$a} \) $BR", +"\( y=\frac{1}{x^{$b}} \) $BR", +"\( y=\left| x \right| \) $BR", +"\( y=\sqrt{$c-x^2} \) $BR", +"\( $f x+ $g y=$h \) $BR", +"\( y=\frac{x+$i}{$j-x}\) $BR", +"\( x=y^{$k} \) $BR", +"\( y=\sqrt[$l]{x} \) $BR", +); + +@notfs = ( +"\( y=\pm\sqrt{$c-x^2} \) $BR", +"\( x=y^{$d} \) $BR", +"\( x^2+y^2=$e \) $BR", +"\( \left| y\right|=x \) $BR", +); + + +@findices = NchooseK(8,8); +@notfindices = NchooseK(4,4); + +for my $i (0..3) { +$mc[$i] = new_checkbox_multiple_choice(); + +$mc[$i] -> qa ( +"Select all of the following relations that make \(y\) a function of \(x\).", +$fs[$findices[2*$i]], +$fs[$findices[2*$i + 1]], +); + +$mc[$i] -> extra( +$notfs[$notfindices[$i]] +); +} + + +############################################## + +Context()->texStrings; +BEGIN_TEXT +\{KeyboardInstructions("To receive credit you must get each checkbox correct. For this problem, WeBWorK will not tell you which parts you have right or wrong, or you could just change your checks after one submission, and you wouldn't have to think. If you do not get full credit, carefully review your response for each checkbox. If you do not have full credit after several attempts, contact a tutor or your instructor.")\} +$PAR + +\{ $mc[0] -> print_q() \} +$BR +\{ $mc[0] -> print_a() \} +$BR + +\{ $mc[1] -> print_q() \} +$BR +\{ $mc[1] -> print_a() \} +$BR + +\{ $mc[2] -> print_q() \} +$BR +\{ $mc[2] -> print_a() \} +$BR + +\{ $mc[3] -> print_q() \} +$BR +\{ $mc[3] -> print_a() \} +$BR + +END_TEXT +Context()->normalStrings; + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc[0]->correct_ans() ) ); +ANS( checkbox_cmp( $mc[1]->correct_ans() ) ); +ANS( checkbox_cmp( $mc[2]->correct_ans() ) ); +ANS( checkbox_cmp( $mc[3]->correct_ans() ) ); + + + +############################################## + + +BEGIN_SOLUTION + +The correct answers are \{ $mc[0]->correct_ans() \}, \{ $mc[1]->correct_ans() \}, \{ $mc[2]->correct_ans() \}, and \{ $mc[3]->correct_ans() \}. In each of those answers, whenever a value would be substituted in for \(x\), then either there is exactly one \(y\)-value that will make the relation true, or perhaps none at all. + +In the other answers, there can be an \(x\)-value where more than one \(y\)-value will make the relation true. + + +END_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations20.pg new file mode 100644 index 0000000000..1b0a612e92 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations20.pg @@ -0,0 +1,135 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College + + +#DESCRIPTION +#KEYWORDS('functions') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('Alex Jordan') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +#ENDDESCRIPTION + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); + +$showPartialCredit = 1; + +$a = random(2,9,1); +$b = random(2,9,1); +$c = random(2,9,1); +if ($a == $b) {$a++;} + +$mc = new_checkbox_multiple_choice(); +$mc2 = new_checkbox_multiple_choice(); + + +$mc -> qa ( +"Select all of the following relations that make \(y\) a function of \(x\). There are several correct answers.", +"\( x+y=1 \) $BR", +"\( $a x + $b y + $c = 0 \) $BR", +"\( y - \left|x\right| = 0 \) $BR", +"\( y + x^2 = 1 \) $BR", +"\( y^3 + x^4 = 1 \) $BR", +); + +$mc -> extra( +"\( \left|y\right| - x = 0 \) $BR", +"\( y^2 + x^2 = 1 \) $BR", +"\( y^6 + x = 1 \) $BR", +); + + + + +$mc2 -> qa ( +"Select all of the following relations that make \(x\) a function of \(y\). There are several correct answers.", +"\( $a x + $b y + $c = 0 \) $BR", +"\( \left|y\right| - x = 0 \) $BR", +"\( y^4 + x^5 = 1\) $BR", +); + +$mc2 -> extra( +"\( y - \left|x\right| = 0 \) $BR", +"\( y^2 + x^2 = 1 \) $BR", +); + + +############################################## + +Context()->texStrings; +BEGIN_TEXT + +Some equations involving \(x\) and \(y\) define \(y\) as a function of +\(x\), and others do not. For example, if \(x+y=1\), we can solve for +\(y\) and obtain \(y = 1-x\). And we can then think of \(y = f(x) = +1-x\). On the other hand, if we have the equation \(x=y^2\) then +\(y\) is not a function of \(x\), since for a given positive value +of \(x\), the value of \(y\) could equal \(\sqrt{x}\) or it could equal \(-\sqrt{x}\). +Select all of the following relations that make \(y\) a function of \(x\). There are several correct answers. + +$BR +\{ $mc -> print_a() \} + +$PAR +On the other hand, some equations involving \(x\) and \(y\) define \(x\) as a function of \(y\) (the other way round). + +Select all of the following relations that make \(x\) a function of \(y\). There are several correct answers. + +$BR +\{ $mc2 -> print_a() \} + + +$PAR +\{KeyboardInstructions("To receive credit you must get each checkbox correct. For this problem, WeBWorK will not tell you which parts you have right or wrong, or you could just change your checks after one submission, and you wouldn't have to think. If you do not get full credit, carefully review your response for each checkbox. If you do not have full credit after several attempts, contact a tutor or your instructor.")\} +END_TEXT +Context()->normalStrings; + + + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); +ANS( checkbox_cmp( $mc2->correct_ans() ) ); + +############################################## + +BEGIN_SOLUTION + +The correct answer to the first part is \{ $mc->correct_ans() \}. In each of those answers, whenever a value would be substituted in for \(x\), then either there is exactly one \(y\)-value that will make the relation true, or perhaps none at all. In the other answers, there can be an \(x\)-value where more than one \(y\)-value will make the relation true. +$PAR + +For the second part, the answer is \{ $mc2->correct_ans() \}. In each of those answers, whenever a value would be substituted in for \(y\), then either there is exactly one \(x\)-value that will make the relation true, or perhaps none at all. In the other answers, there can be a \(y\)-value where more than one \(x\)-value will make the relation true. + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables10.pg new file mode 100644 index 0000000000..b6b4eb9226 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables10.pg @@ -0,0 +1,307 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Given a quadratic function's formula, build a table and graph it. +# y=ax^2, where |a|>1, and a could be positive or negative. +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('quadratic','function','parabola','table','graph') +## DBCCSS('F.IF.7.a') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "parserMultiAnswer.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); +$refreshCachedImages=1; + +#This array stores value of a in y=ax^2. +#$a[0] is the correct graph. The others are used in wrong graphs. +#$a[4] is used in the correct graph. +@a=(); +$a[0] = list_random(-5..-2,2..5); +$a[1] = $a[0]-1; +$a[2] = $a[0]+1; +$a[3] = $a[0]+2; +$a[4] = $a[0]; + +$left = Compute("y"); +$right = Compute("$a[0]*x**2")->reduce; + +@defaultAnswers = (); +for my $i (0..4) { + $x[$i] = $i-2; + $y[$i] = $right->eval(x=>$x[$i]); + push(@defaultAnswers,$x[$i]); + push(@defaultAnswers,$y[$i]); +} + +$multians = MultiAnswer(@defaultAnswers)->with( + singleResult => 1, + allowBlankAnswers => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my @sxy = @{$student}; + my @xs, @ys; + for my $k (0..4) + {$xs[$k] = $sxy[2*$k]; + $ys[$k] = $sxy[2*$k+1];} + # + # Loop though the student answers + ## + for ($i = 0; $i <= 4; $i++) { + my $ith = Value::List->NameForNumber($i+1); + # + # Check that the student's answers are Reals + # + Value->Error("Enter a number for your $ith x-value") if ($xs[$i] eq ""); + Value->Error("Enter a number for your $ith y-value") if ($ys[$i] eq ""); + Value->Error("Your $ith x-value is not a number") if ($xs[$i]->type ne "Number"); + Value->Error("Your $ith y-value is not a number") if ($ys[$i]->type ne "Number"); + # + # Check that the point hasn't been given before + # + for ($j = 0, $used = 0; $j < $i; $j++) { + my $jth = Value::List->NameForNumber($j+1); + if ($xs[$j] == $xs[$i] and $ys[$j] == $ys[$i]) { + Value->Error("Your $ith row in the table is the same as your $jth row") unless $ansHash->{isPreview}; + $used = 1; last; + } + } + # + # If not already used, check that it satisfies the equation + # and increase the score if so. + # + if (!$used) { + Value->Error("Your $ith row is not correct") unless $ansHash->{isPreview} or $left->eval(x=>$xs[$i],y=>$ys[$i]) == $right->eval(x=>$xs[$i],y=>$ys[$i]); + } + } + return 1; +}); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + +$xmin = -5; +$xmax = -$xmin; +if ($a[0]>0) { + $ymin = -5; + $ymax = 50; +} else { + $ymin = -50; + $ymax = 5; +} + +#These two variables decide how many labels are on each axis. +$xmark = 1; +$ymark = 5; + +@gr=(); + +#$gr[0] through $gr[3] are options; $gr[4] is used in solution. +for ($i=0;$i<=4;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[$xmax-$xmin,($ymax-$ymin)/5], + size=>[240,240] + ); + $gr[$i]->lb('reset'); + for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { + $gr[$i]->lb( new Label($j, -0.1, $j,'black','center','top')); + } + for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(0, $j,' '.$j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + add_functions($gr[$i], "$a[$i]*x**2 for x in <$xmin,$xmax> using color:red and weight:1"); + $xpoint1 = $xmin; + $xpoint2 = 0; + $xpoint3 = $xmax; + + $ypoint1 = $a[$i]*($xpoint1**2); + $ypoint2 = $a[$i]*($xpoint2**2); + $ypoint3 = $a[$i]*($xpoint3**2); + if($i==4) + { + push(@alt,"Graph $ALPHABET[$inverse{0}]: graph of a parabola passing through the points ($xpoint1,$ypoint1), ($xpoint2,$ypoint2) and ($xpoint3,$ypoint3)"); + } + else + { + push(@alt,"Graph $ALPHABET[$inverse{$i}]: graph of a parabola passing through the points ($xpoint1,$ypoint1), ($xpoint2,$ypoint2) and ($xpoint3,$ypoint3)"); + } + + +} + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +$f =RandomVariableName(type=>'function'); +############################################## + +BEGIN_PGML + +Make a table of values for the function [`[$f]`], defined by [`[$f](x)=[$right]`]. Based on values in the table, sketch a graph of [`[$f]`]. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +\{ +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\($f(x)\)",header=>"CH"},], + [$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "\($f(x)=$right\)", captioncss =>"padding:4pt; text-decoration:none;"); +\} + + +$PAR + +END_TEXT + +Context()->normalStrings; + +#Context()->texStrings; +#BEGIN_TEXT +#$PAR +#$BCENTER +#\{ +#LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{0}]" title = "$alt[$scramble{0}]"' ), +#image( insertGraph($gr[$scramble{1}]), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{1}]" title = "$alt[$scramble{1}]"' ), +#], +#[image( insertGraph($gr[$scramble{2}]), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{2}]" title = "$alt[$scramble{2}]"' ), +#image( insertGraph($gr[$scramble{3}]), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{3}]" title = "$alt[$scramble{3}]"' ) +#]], allcellcss => "padding:20pt;") + +#\} +#$ECENTER +#$PAR + +#END_TEXT +#Context()->normalStrings; + +#BEGIN_PGML +# The correct graph is graph +# [@$radio->buttons()@]* +#END_PGML + +############################################## + +ANS( $multians->cmp() ); +#ANS( $radio->cmp() ); + +############################################## + +#Plot some points in the correct solution graph. +for my $i (0..4) { + $gr[4]->stamps( closed_circle($defaultAnswers[2*$i], $defaultAnswers[2*$i+1],'black') ); + if ($defaultAnswers[2*$i]>=0) { + $gr[4]->lb( new Label($defaultAnswers[2*$i],$defaultAnswers[2*$i+1], " ($defaultAnswers[2*$i],$defaultAnswers[2*$i+1]) ",'black','left','top')); + } else { + $gr[4]->lb( new Label($defaultAnswers[2*$i],$defaultAnswers[2*$i+1], " ($defaultAnswers[2*$i],$defaultAnswers[2*$i+1]) ",'black','right','top')); + } +} + +sub format_list { + return "" if !@_; + my $last = pop(@_); + return '\('.$last.'\)' if !@_; + return '\('.join('\), \(', @_) .'\) and \('. $last.'\)'; +} + +$xvals = format_list(@x); + +for my $i (0..4) { +$ls[$i] = $left->substitute(x=>$x[$i]); +$rs[$i] = $right->substitute(x=>$x[$i]); +} + +Context()->texStrings; +BEGIN_SOLUTION + +This solution will use the \(x\)-values $xvals. The choice to use these \(x\)-values is arbitrary. Since they are small numbers, they might make calculations easier. It's important to include negative numbers if they are in the domain of the function. + +One at a time, we substitute these \(x\)-values into the formula for \($f(x)\), and simplify: + +\[\begin{aligned} +$f($x[0]) = $rs[0] &\implies $f($x[0])=$y[0]\\ +$f($x[1]) = $rs[1] &\implies $f($x[1])=$y[1]\\ +$f($x[2]) = $rs[2] &\implies $f($x[2])=$y[2]\\ +$f($x[3]) = $rs[3] &\implies $f($x[3])=$y[3]\\ +$f($x[4]) = $rs[4] &\implies $f($x[4])=$y[4]\\ +\end{aligned} +\] + +So the table may be completed as: + +\{ +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\($f(x)\)",header=>"CH"},], + ["\($x[0]\)", "\($y[0]\)"], +["\($x[1]\)", "\($y[1]\)"], +["\($x[2]\)", "\($y[2]\)"], +["\($x[3]\)", "\($y[3]\)"], +["\($x[4]\)", "\($y[4]\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;width:60pt;", caption => "\($f(x)=$right\)", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +#$PAR +#By values in the table, graph \{ $radio->correct_ans() \} is the correct graph. +#$PAR +Here is a graph of [`[$f]`]. +$BCENTER +\{ image( insertGraph($gr[4]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{4}]" title = "$alt[$scramble{4}]"' ) \} +$ECENTER +$PAR +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables20.pg new file mode 100644 index 0000000000..7e0775ba13 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables20.pg @@ -0,0 +1,319 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Given an function's formula, build a table and graph it. +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('function','table','graph') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "parserMultiAnswer.pl", + "parserRadioButtons.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); +Context("Numeric"); +Context()->variables->add(y=>'Real'); +Context()->flags->set(showExtraParens=>0, reduceConstants=>0); +Context()->noreduce("(-x)-y","(-x)+y"); +$refreshCachedImages=1; + +#These arrays store values of a and b in y=(2^x+a) /(x^2+b) +#$a[0] is the correct graph. The others are used in wrong graphs. +#$a[4] is used in the correct graph. +@a=(); +$a[0] = list_random(-5..-2,2..5); +$a[1] = $a[0]-1; +$a[2] = $a[0]+1; +$a[3] = $a[0]+2; +$a[4] = $a[0]; + +$b[0] = non_zero_random(2,4,1); +$b[1] = $b[0]-1; +$b[2] = $b[0]+1; +$b[3] = $b[0]+2; +$b[4] = $b[0]; + + + +$left = Compute("y"); +$right = Compute("(2^x+$a[0])/(x^2+$b[0])")->reduce; + +@defaultAnswers = (); +for my $i (0..4) { + $x[$i] = $i-2; + $y[$i] = $right->eval(x=>$x[$i]); + push(@defaultAnswers,$x[$i]); + push(@defaultAnswers,$y[$i]); +} + +$multians = MultiAnswer(@defaultAnswers)->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my @sxy = @{$student}; + my @xs, @ys; + for my $k (0..4) + {$xs[$k] = $sxy[2*$k]; + $ys[$k] = $sxy[2*$k+1];} + # + # Loop though the student answers + ## + for ($i = 0; $i <= 4; $i++) { + my $ith = Value::List->NameForNumber($i+1); + # + # Check that the student's answers are Reals + # + Value->Error("Your $ith x-value is not a number") if ($xs[$i]->type ne "Number"); + Value->Error("Your $ith y-value is not a number") if ($ys[$i]->type ne "Number"); + # + # Check that the point hasn't been given before + # + for ($j = 0, $used = 0; $j < $i; $j++) { + my $jth = Value::List->NameForNumber($j+1); + if ($xs[$j] == $xs[$i] and $ys[$j] == $ys[$i]) { + Value->Error("Your $ith row in the table is the same as your $jth row") unless $ansHash->{isPreview}; + $used = 1; last; + } + } + # + # If not already used, check that it satisfies the equation + # and increase the score if so. + # + if (!$used) { + Value->Error("Your $ith row is not correct") unless $ansHash->{isPreview} or $left->eval(x=>$xs[$i],y=>$ys[$i]) == $right->eval(x=>$xs[$i],y=>$ys[$i]); + } + } + return 1; +}); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + +$xmin = -5; +$xmax = -$xmin; +$ymax = round(max( +abs((2**($xmin) + $a[0]) / ($xmin**2 + $b[0])), +abs((2**($xmin) + $a[1]) / ($xmin**2 + $b[1])), +abs((2**($xmin) + $a[2]) / ($xmin**2 + $b[2])), +abs((2**($xmin) + $a[3]) / ($xmin**2 + $b[3])), +abs((2**(0) + $a[0]) / (0**2 + $b[0])), +abs((2**(0) + $a[1]) / (0**2 + $b[1])), +abs((2**(0) + $a[2]) / (0**2 + $b[2])), +abs((2**(0) + $a[3]) / (0**2 + $b[3])), +abs((2**($xmax) + $a[0]) / ($xmax**2 + $b[0])), +abs((2**($xmax) + $a[1]) / ($xmax**2 + $b[1])), +abs((2**($xmax) + $a[2]) / ($xmax**2 + $b[2])), +abs((2**($xmax) + $a[3]) / ($xmax**2 + $b[3])), +)) + 1; +$ymin = -$ymax; + +#These two variables decide how many labels are on each axis. +$xmark = 1; +$ymark = 1; + +@gr=(); + +#$gr[0] through $gr[3] are options; $gr[4] is used in solution. +for ($i=0;$i<=4;$i++) { + $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[$xmax-$xmin,($ymax-$ymin)/$ymark], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) { + $gr[$i]->lb( new Label($j, -0.1, $j,'black','center','top')); + } + for ($j=$ymin+$ymark;$j<$ymax;$j=$j+$ymark) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label(0, $j,' '.$j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + add_functions($gr[$i], "(2**(x)+$a[$i])/(x**2+$b[$i]) for x in <$xmin,$xmax> using color:red and weight:1"); + $xpoint1 = $xmin; + $xpoint2 = 0; + $xpoint3 = $xmax; + + $ypoint1 = (2**($xpoint1)+$a[$i])/($xpoint1**2+$b[$i]); + $ypoint2 = (2**($xpoint2)+$a[$i])/($xpoint2**2+$b[$i]); + $ypoint3 = (2**($xpoint3)+$a[$i])/($xpoint3**2+$b[$i]); + if($i==4) + { + push(@alt,"Graph $ALPHABET[$inverse{0}]: graph of a curve passing through the points ($xpoint1,$ypoint1), ($xpoint2,$ypoint2) and ($xpoint3,$ypoint3)"); + } + else + { + push(@alt,"Graph $ALPHABET[$inverse{$i}]: graph of a curve passing through the points ($xpoint1,$ypoint1), ($xpoint2,$ypoint2) and ($xpoint3,$ypoint3)"); + } + + +} + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +$f =RandomVariableName(type=>'function'); +############################################## + +BEGIN_PGML + +Make a table of values for the function [`[$f]`], defined by [`\displaystyle [$f](x)=[$right]`]. Based on values in the table, sketch a graph of [`[$f]`]. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT + +\{ +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\($f(x)\)",header=>"CH"},], + [$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +[$multians->ans_rule(8), $multians->ans_rule(8)], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;", caption => "\(\displaystyle $f(x)=$right\)", captioncss =>"padding:4pt; text-decoration:none;"); +\} + + +$PAR + +END_TEXT + +Context()->normalStrings; + + +#Context()->texStrings; +#BEGIN_TEXT +#$PAR +#$BCENTER +#\{ +#LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{0}]" title = "$alt[$scramble{0}]"' ), +#image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{1}]" title = "$alt[$scramble{1}]"' ), +#], +#[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{2}]" title = "$alt[$scramble{2}]"' ), +#image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{3}]" title = "$alt[$scramble{3}]"' ) +#]], allcellcss => "padding:20pt;") + +#\} +#$ECENTER +#$PAR + +#END_TEXT +#Context()->normalStrings; + +#BEGIN_PGML +# The correct graph is graph +# [@$radio->buttons()@]* +#END_PGML + +############################################## + +ANS( $multians->cmp() ); + +############################################## + +#Plot some points in the correct solution graph. +for my $i (0..4) { + $gr[4]->stamps( closed_circle($defaultAnswers[2*$i], $defaultAnswers[2*$i+1],'black') ); + if ($defaultAnswers[2*$i]>=0) { + $gr[4]->lb( new Label($defaultAnswers[2*$i],$defaultAnswers[2*$i+1], " ($defaultAnswers[2*$i],$defaultAnswers[2*$i+1]) ",'black','left','top')); + } else { + $gr[4]->lb( new Label($defaultAnswers[2*$i],$defaultAnswers[2*$i+1], " ($defaultAnswers[2*$i],$defaultAnswers[2*$i+1]) ",'black','right','top')); + } +} + +sub format_list { + return "" if !@_; + my $last = pop(@_); + return '\('.$last.'\)' if !@_; + return '\('.join('\), \(', @_) .'\) and \('. $last.'\)'; +} + +$xvals = format_list(@x); + +for my $i (0..4) { +$ls[$i] = $left->substitute(x=>$x[$i]); +$rs[$i] = $right->substitute(x=>$x[$i]); +} + +Context()->texStrings; +BEGIN_SOLUTION + +This solution will use the \(x\) values $xvals. The choice to use these \(x\)-values is arbitrary. Since they are small numbers, they might make calculations easier. It's important to include negative numbers if they are in the domain of the function. + +One at a time, we substitute these \(x\)-values into the formula for \($f(x)\), and simplify: + +\[\begin{aligned} +$f($x[0]) = $rs[0] &\implies $f($x[0])=$y[0]\\ +$f($x[1]) = $rs[1] &\implies $f($x[1])=$y[1]\\ +$f($x[2]) = $rs[2] &\implies $f($x[2])=$y[2]\\ +$f($x[3]) = $rs[3] &\implies $f($x[3])=$y[3]\\ +$f($x[4]) = $rs[4] &\implies $f($x[4])=$y[4]\\ +\end{aligned} +\] + +So the table may be completed as: + +\{ +DataTable([[{data=>"\(x\)",header=>"CH"},{data=>"\($f(x)\)",header=>"CH"},], + ["\($x[0]\)", "\($y[0]\)"], +["\($x[1]\)", "\($y[1]\)"], +["\($x[2]\)", "\($y[2]\)"], +["\($x[3]\)", "\($y[3]\)"], +["\($x[4]\)", "\($y[4]\)"], +], allcellcss=>"border:1px solid;padding:4pt;text-align:center;width:60pt;", caption => "\(\displaystyle $f(x)=$right\)", captioncss =>"padding:4pt; text-decoration:none;"); +\} + +#$PAR +#By values in the table, graph \{ $radio->correct_ans() \} is the correct graph. +#$PAR +Here is a graph of [`[$f]`]. +$BCENTER +\{ image( insertGraph($gr[4]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$alt[$scramble{4}]" title = "$alt[$scramble{4}]"' ) \} +$ECENTER +$PAR +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables30.pg new file mode 100644 index 0000000000..9282c9479b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables30.pg @@ -0,0 +1,126 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College + + +#DESCRIPTION +#KEYWORDS('functions') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('Alex Jordan') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +#ENDDESCRIPTION + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +$a = random(-20,20,1); +$b = random(-20,20,1); +$c = random(-20,20,1); +$d = random(-20,20,1); +$e = random(-20,20,1); +$f = random(-20,20,1); +$g = random(-10,10,1); +$h = random(-20,20,1); +$i = random(11,30,1); +$j = random(-20,20,1); + +$popup1 = PopUp(['yes','no'],0); +$popup2 = PopUp(['-2','2','4','6','8','None, the table could be the table of values of a function.'],5); +$popup3 = PopUp(['yes','no'],1); +$popup4 = PopUp(['-4','-3','-2','-1','None, the table could be the table of values of a function.'],1); + +############################################## + +BEGIN_PGML + +Determine whether or not each of the following tables could be the table of values of a function. If the table can not be the table of values of a function, give an input that has more than one possible output. + +END_PGML + +BEGIN_TEXT +$BCENTER +\{DataTable( +[[{data=>'Input',headerrow=>1}, 'Output'], +["\(2\)", "\($a\)"], +["\(4\)", "\($b\)"], +["\(6\)", "\($a\)"], +["\(8\)", "\($d\)"], +["\(-2\)", "\($e\)"], +], +allcellcss=>"padding-left:6pt; padding-right:6pt; border-left:solid; border-right:solid; border-width: 1px;", +tablecss=>"border:solid; border-width: 1px;", +headercss=>"border:solid; border-width: 1px;") +\} +$ECENTER +END_TEXT + +BEGIN_PGML + +Could this be the table of values for a function? [__]{$popup1} +If not, which input has more than one possible output? [__]{$popup2} + +END_PGML + + +BEGIN_TEXT +$PAR +$BCENTER +\{DataTable( +[[{data=>'Input',headerrow=>1}, 'Output'], +["\(-4\)", "\($f\)"], +["\(-3\)", "\($g\)"], +["\(-2\)", "\($h\)"], +["\(-3\)", "\($i\)"], +["\(-1\)", "\($j\)"], +], +allcellcss=>"padding-left:6pt; padding-right:6pt; border-left:solid; border-right:solid; border-width: 1px;", +tablecss=>"border:solid; border-width: 1px;", +headercss=>"border:solid; border-width: 1px;") +\} +$ECENTER +END_TEXT + +BEGIN_PGML + +Could this be the table of values for a function? [__]{$popup3} +If not, which input has more than one possible output? [__]{$popup4} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +The first table could be the table of values for a function, because each input leads to only one output. Note that it is irrelevant whether or not two different inputs lead to the same output. + +The second table cannot be the table of values for a function. What would [`f(-3)`] be? + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables31.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables31.pg new file mode 100644 index 0000000000..afb85ebb1e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables31.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College + + +#DESCRIPTION +#KEYWORDS('functions') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('Alex Jordan') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +#ENDDESCRIPTION + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +$a = random(-20,20,1); +$b = random(-20,20,1); +$c = random(-20,20,1); +$d = random(-20,20,1); +$e = random(-20,20,1); +$f = random(-20,20,1); +$g = random(-10,10,1); +$h = random(-20,20,1); +$i = random(11,30,1); +$j = random(-20,20,1); + +$popup1 = PopUp(['yes','no'],0); +$popup2 = PopUp(['-2','2','4','6','8','None, the table represents a function.'],5); +$popup3 = PopUp(['yes','no'],1); +$popup4 = PopUp(['-4','-3','-2','-1','None, the table represents a function.'],1); + +############################################## + +BEGIN_PGML + +Determine whether or not the following table could be the table of values of a function. If the table can not be the table of values of a function, give an input that has more than one possible output. + +[@DataTable( +[[{data=>'Input',headerrow=>1}, 'Output'], +['\(2\)', '\('."$a".'\)'], +['\(4\)', '\('."$b".'\)'], +['\(6\)', '\('."$c".'\)'], +['\(8\)', '\('."$d".'\)'], +['\(-2\)', '\('."$e".'\)'], +], +allcellcss=>"padding-left:6pt; padding-right:6pt; border-left:solid; border-right:solid; border-width: 1px;", +tablecss=>"border:solid; border-width: 1px;", +headercss=>"border:solid; border-width: 1px;") +@]*** + +Could this be the table of values for a function? [__]{$popup1} +If not, which input has more than one possible output? [__]{$popup2} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +The first table could be the table of values for a function, because each input leads to only one output. Note that it is irrelevant whether or not two different inputs lead to the same output. + +The second table cannot be the table of values for a function. What would [`f(-3)`] be? + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables32.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables32.pg new file mode 100644 index 0000000000..6a85651df6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionTables32.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College + + +#DESCRIPTION +#KEYWORDS('functions') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('Alex Jordan') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +#ENDDESCRIPTION + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); + +$a = random(-20,20,1); +$b = random(-20,20,1); +$c = random(-20,20,1); +$d = random(-20,20,1); +$e = random(-20,20,1); +$f = random(-20,20,1); +$g = random(-10,10,1); +$h = random(-20,20,1); +$i = random(11,30,1); +$j = random(-20,20,1); + +$popup1 = PopUp(['yes','no'],0); +$popup2 = PopUp(['-2','2','4','6','8','None, the table represents a function.'],5); +$popup3 = PopUp(['yes','no'],1); +$popup4 = PopUp(['-4','-3','-2','-1','None, the table represents a function.'],1); + +############################################## + +BEGIN_PGML + +Determine whether or not the following table could be the table of values of a function. If the table can not be the table of values of a function, give an input that has more than one possible output. + +[@DataTable( +[[{data=>'Input',headerrow=>1}, 'Output'], +['\(-4\)', '\('."$f".'\)'], +['\(-3\)', '\('."$g".'\)'], +['\(-2\)', '\('."$h".'\)'], +['\(-3\)', '\('."$i".'\)'], +['\(-1\)', '\('."$j".'\)'], +], +allcellcss=>"padding-left:6pt; padding-right:6pt; border-left:solid; border-right:solid; border-width: 1px;", +tablecss=>"border:solid; border-width: 1px;", +headercss=>"border:solid; border-width: 1px;") +@]*** + +Could this be the table of values for a function? [__]{$popup3} +If not, which input has more than one possible output? [__]{$popup4} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +The first table could be the table of values for a function, because each input leads to only one output. Note that it is irrelevant whether or not two different inputs lead to the same output. + +The second table cannot be the table of values for a function. What would [`f(-3)`] be? + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionVocabulary10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionVocabulary10.pg new file mode 100644 index 0000000000..156ab1c606 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionVocabulary10.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Basic vocabulary questions +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() +## KEYWORDS('function',) +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "PGcourse.pl", +); + + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->strings->add( + "independent"=>{}, + "dependent"=>{}, + "input"=>{}, + "output"=>{}, + "explanatory"=>{}, + "response"=>{}, + "argument"=>{}, + "domain"=>{}, + "range"=>{}, +); + +#random order + +@questions = ( +'When we write [`y=f(x)`], we call [`x`] the [__________]{OneOf("independent, input, explanatory, argument")} variable, and we call [`y`] the [__________]{OneOf("dependent, output, response")} variable. ', +'The collection of all possible output values from a function is called the [__________]{range} of that function. ', +'The collection of all valid input values for a function is called the [__________]{domain} of that function. '); + + + + +$a = random(0,2,1); +$b = random(0,1,1); +$question1 = splice(@questions,$a,1); +$question2 = splice(@questions,$b,1); +$question3 = $questions[0]; + +############################################## + +BEGIN_PGML + +Answer the following vocabulary questions. Each answer blank may accept several correct options as long as they mean the same thing. Whatever you answer with, correct spelling is important. + +a. [@$question1@]** +a. [@$question2@]** +a. [@$question3@]** + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +According to definition, the _domain_ of a function is the collection of all valid input values for the function. + +According to definition, the _range_ of a function is the collection of all possible output values for the function. + +If we write [`y=f(x)`], then [`x`] can be referred to as the _input_ variable, the _independent_ variable, the _explanatory_ variable, or the _argument_ variable. And [`y`] is referred to as the _output_ variable, the _dependent_ variable, or the _response_ variable. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionVocabulary20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionVocabulary20.pg new file mode 100644 index 0000000000..e18112cb6a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/FunctionVocabulary20.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Basic vocabulary questions +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection() +## KEYWORDS('function',) +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextInequalities.pl", + "parserMultiAnswer.pl", + "parserOneOf.pl", + "PGcourse.pl", +); + + +############################################## +TEXT(beginproblem()); + +Context("Inequalities"); + +Context()->variables->are(a=>'Real'); +Context()->constants->add(b=>exp(sqrt(2))); +Context()->constants->set(b => {TeX=>'b'}); + +Context()->strings->add( + "increasing"=>{}, + "decreasing"=>{}, +); + +$ans1 = OneOf("increasing","decreasing"); +$ans2 = OneOf("awith( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $stu1, $stu2 ) = @{$student}; + if ( (String("increasing") == $stu1 && Inequality("aans_rule(10)\} on an interval \(I\) if for any two numbers \(a\), \(b\) in \(I\) where \{$multians->ans_rule(10)\}, it's true that \(f(a)cmp(correct_ans_latex_string=>'\text{increasing (or decreasing)};\,ab`], it's true that [`f(a)1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); +@ALTtags = (); + +for my $i (0..5) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, Real($j),'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, Real($j),'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')); + $ALTtags[$i] = "Graph $ALPHABET[$inverse{$i}]: "; +}; + + + +add_functions($gr[0], "$f0 for x in <$min[0],$max[0]> using color:blue and weight:1"); + +@x = (-1,0,1); +@y = (); +for my $i (@x) { + push (@y, $f0->eval(x=>$i)); +} +$ALTtags[0] .= "a graph connecting the following points in order with straight lines: ($x[0],$y[0]), ($x[1],$y[1]), ($x[2],$y[2])"; + +add_functions($gr[1], "$f1 for x in <$min[0],$max[0]] using color:blue and weight:1"); +@x = (-1,-0.5,0,0.5,1); +@y = (); +for my $i (@x) { + push (@y, $f1->eval(x=>$i)); +} +if ($b>0) { + $ALTtags[1] .= "a graph that begins on the left passing ($x[0],$y[0]) and ($x[1],$y[1]) while curving up, passes (0,0), and then curves up and passes ($x[3],$y[3]) and ($x[4],$y[5])"; +} else { + $ALTtags[1] .= "a graph that begins on the left passing ($x[0],$y[0]) and ($x[1],$y[1]) while curving down, passes (0,0), and then curves down and passes ($x[3],$y[3]) and ($x[4],$y[5])"; +} + +add_functions($gr[2], "$f2 for x in <$min[0],$max[0]> using color:blue and weight:1"); +@x = (-Real(pi)/2,0,Real(pi)/2); +@y = (); +for my $i (@x) { + push (@y, $f2->eval(x=>$i)); +} +if ($c>0) { + $ALTtags[2] .= "a wave that moves up and down as we read the graph from left to right, with (-pi/2,$y[0]) at the bottom, crossing (0,0), and (pi/2,$y[2]) at the top, ..."; +} else { + $ALTtags[2] .= "a wave that moves up and down as we read the graph from left to right, with (-pi/2,$y[0]) at the top, crossing (0,0), and (pi/2,$y[2]) at the bottom, ..."; +} + +add_functions($gr[3], "$f3 for x in <$min[0],$max[0]> using color:blue and weight:1"); +$ALTtags[3] .= "a parabola-looking graph, facing up, with (0,$d) as its vertex"; + +add_functions($gr[4], "$f4 for x in <$min[0],$max[0]> using color:blue and weight:1"); +@x = (-1,0,1); +@y = (); +for my $i (@x) { + push (@y, $f4->eval(x=>$i)); +} +$ALTtags[4] .= "a graph connecting the following points in order with straight lines: ($x[0],$y[0]), ($x[1],$y[1]), ($x[2],$y[2])"; + +add_functions($gr[5], "$f5 for x in <$f,$max[0]> using color:blue and weight:1"); +@x = ($f,$f+1,$f+2); +@y = (); +for my $i (@x) { + push (@y, $f5->eval(x=>$i)); +} +$ALTtags[5] .= "a curve starting at ($x[0],$y[0]) and going up to pass ($x[1],$y[1]) and ($x[2],$y[2])"; + +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( +"Select the letters of graphs of odd functions", + "$ALPHABET[$inverse{0}]", + "$ALPHABET[$inverse{1}]", + "$ALPHABET[$inverse{2}]", +); +$mc -> extra( + "$ALPHABET[$inverse{3}]", + "$ALPHABET[$inverse{4}]", + "$ALPHABET[$inverse{5}]", +); +$mc -> makeLast("A","B","C","D","E","F","None of the above"); + + +############################################## + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ + +LayoutTable([ +[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ),], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' )], +[image( insertGraph($gr[$scramble{4}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ), +image( insertGraph($gr[$scramble{5}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{5}]" title = "$ALTtags[$scramble{5}]"' )], +], allcellcss => "padding:20pt;") +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +BEGIN_PGML + +[@$mc -> print_q() @]** + [@$mc -> print_a() @]* + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + + + +####################################################### + +Context()->texStrings; + +BEGIN_SOLUTION + +Odd functions are symmetric by the origin. Graphs \{$mc->correct_ans()\} are odd functions. + +END_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven20.pg new file mode 100644 index 0000000000..d36cc1292b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven20.pg @@ -0,0 +1,241 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Decide which of six graphs represent even functions. +# +# Last update: Carl Yao 09/01/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','odd','even','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", + "PGchoicemacros.pl", + "pccTables.pl", + "unionTables.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); + +$a = non_zero_random(-2,2,0.5); +$f0 = Formula("abs(x)+$a"); + +$b = non_zero_random(-2,2,0.5); +$f1 = Formula("$b*x**4-$b*x**2"); + +$c = non_zero_random(-2,2,0.5); +$f2 = Formula("$c*cos(x)"); + +$d = non_zero_random(-2,2,1); +$f3 = Formula("$d*x"); + +$e = non_zero_random(-2,2,1); +$f4 = Formula("x+$e"); + +$f = non_zero_random(-2,2,1); +$f5 = Formula("$f*sin(x)"); + + +#Create a hash and its inverse that randomizes the order of the six graphs. +%scramble = (); +%inverse = (); +for my $i (0..5) { + do {$temp = list_random(0..5)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$bound = 2; +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters( + [-$bound,$bound], + [-$bound,$bound],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); +@ALTtags = (); + +for my $i (0..5) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, Real($j),'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, Real($j),'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')); + $ALTtags[$i] = "Graph $ALPHABET[$inverse{$i}]: "; +}; + + + +add_functions($gr[0], "$f0 for x in <$min[0],$max[0]> using color:blue and weight:1"); + +@x = (-1,0,1); +@y = (); +for my $i (@x) { + push (@y, $f0->eval(x=>$i)); +} +$ALTtags[0] .= "a ray starting at ($x[1],$y[1]) and passing ($x[0],$y[0]), connected with another ray starting at ($x[1],$y[1]) and passing ($x[2],$y[2])"; + +add_functions($gr[1], "$f1 for x in <$min[0],$max[0]] using color:blue and weight:1"); +@x = (-0.5,-sqrt(1/6),0,sqrt(1/6),0.5); +@y = (); +for (my $i=0; $i<=$#x; $i++) { + push (@y, $f1->eval(x=>$x[$i])); + $x[$i] = Round($x[$i],2); + $y[$i] = Round($y[$i],2); +} +if ($b>0) { + $ALTtags[1] .= "a concave-up graph that begins on the left from positive infinity coming down to ($x[0],$y[0]), curves up to pass ($x[1],$y[1]), became concave down and passes (0,0) and ($x[3],$y[3]), became concave up again and passes ($x[4],$y[4]), and then continue to positive infinity"; +} else { + $ALTtags[1] .= "a concave-down graph that begins on the left from negative infinity coming up to ($x[0],$y[0]), curves down to pass ($x[1],$y[1]), became concave up and passes (0,0) and ($x[3],$y[3]), became concave down again and passes ($x[4],$y[4]), and then continue to negative infinity"; +} + +add_functions($gr[2], "$f2 for x in <$min[0],$max[0]> using color:blue and weight:1"); +@x = (-Real(pi),0,Real(pi)); +@y = (); +for my $i (@x) { + push (@y, $f2->eval(x=>$i)); +} +if ($c>0) { + $ALTtags[2] .= "a wave that moves up and down as we read the graph from left to right, with (-pi,$y[0]) at the bottom, crossing (0,$y[1]) at the top, and crossing (pi,$y[2]) at the bottom, ..."; +} else { + $ALTtags[2] .= "a wave that moves up and down as we read the graph from left to right, with (-pi,$y[0]) at the top, crossing (0,$y[1]) at the bottom, and crossing (pi,$y[2]) at the top, ..."; +} + +add_functions($gr[3], "$f3 for x in <$min[0],$max[0]> using color:blue and weight:1"); +@x = (-1,0,1); +@y = (); +for my $i (@x) { + push (@y, $f3->eval(x=>$i)); +} +$ALTtags[3] .= "a graph connecting the following points in order with straight lines: ($x[0],$y[0]), ($x[1],$y[1]), ($x[2],$y[2])"; + +add_functions($gr[4], "$f4 for x in <$min[0],$max[0]> using color:blue and weight:1"); +@x = (-1,0,1); +@y = (); +for my $i (@x) { + push (@y, $f4->eval(x=>$i)); +} +$ALTtags[4] .= "a graph connecting the following points in order with straight lines: ($x[0],$y[0]), ($x[1],$y[1]), ($x[2],$y[2])"; + +add_functions($gr[5], "$f5 for x in <$min[0],$max[0]> using color:blue and weight:1"); +@x = (-Real(pi)/2,0,Real(pi)/2); +@y = (); +for my $i (@x) { + push (@y, $f5->eval(x=>$i)); +} +if ($c>0) { + $ALTtags[5] .= "a wave that moves up and down as we read the graph from left to right, with (-pi/2,$y[0]) at the bottom, crossing (0,0), and (pi/2,$y[2]) at the top, ..."; +} else { + $ALTtags[5] .= "a wave that moves up and down as we read the graph from left to right, with (-pi/2,$y[0]) at the top, crossing (0,0), and (pi/2,$y[2]) at the bottom, ..."; +} + +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( +"Select the letters of graphs of even functions", + "$ALPHABET[$inverse{0}]", + "$ALPHABET[$inverse{1}]", + "$ALPHABET[$inverse{2}]", +); +$mc -> extra( + "$ALPHABET[$inverse{3}]", + "$ALPHABET[$inverse{4}]", + "$ALPHABET[$inverse{5}]", +); +$mc -> makeLast("A","B","C","D","E","F","None of the above"); + + +############################################## + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ + +LayoutTable([ +[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ),], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' )], +[image( insertGraph($gr[$scramble{4}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ), +image( insertGraph($gr[$scramble{5}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{5}]" title = "$ALTtags[$scramble{5}]"' )], +], allcellcss => "padding:20pt;") +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +BEGIN_PGML + +[@$mc -> print_q() @]** + [@$mc -> print_a() @]* + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + + + +####################################################### + +Context()->texStrings; + +BEGIN_SOLUTION + +Even functions are symmetric by the \(y\)-axis. Graphs \{$mc->correct_ans()\} are even functions. + +END_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven30.pg new file mode 100644 index 0000000000..5ece794606 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven30.pg @@ -0,0 +1,236 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Decide which of six graphs represent neither odd nor even functions. +# +# Last update: Carl Yao 09/01/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','odd','even','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", + "PGchoicemacros.pl", + "pccTables.pl", + "unionTables.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); + +$a = non_zero_random(-2,2,0.5); +$f0 = Formula("x+$a"); + +$b = non_zero_random(-2,2,1); +$f1 = Formula("sqrt(x-$b)"); + +$c = non_zero_random(-2,2,0.5); +$f2 = Formula("(x+$c)**2"); + +$d = non_zero_random(-2,2,1); +$f3 = Formula("$d*x"); + +$e = non_zero_random(-2,2,1); +$f4 = Formula("$e*cos(x)"); + +$f = non_zero_random(-2,2,1); +$f5 = Formula("$f*sin(x)"); + + +#Create a hash and its inverse that randomizes the order of the six graphs. +%scramble = (); +%inverse = (); +for my $i (0..5) { + do {$temp = list_random(0..5)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$bound = 2; +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters( + [-$bound,$bound], + [-$bound,$bound],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); +@ALTtags = (); + +for my $i (0..5) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, Real($j),'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, Real($j),'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')); + $ALTtags[$i] = "Graph $ALPHABET[$inverse{$i}]: "; +}; + + + +add_functions($gr[0], "$f0 for x in <$min[0],$max[0]> using color:blue and weight:1"); +@x = (-1,0,1); +@y = (); +for my $i (@x) { + push (@y, $f0->eval(x=>$i)); +} +$ALTtags[0] .= "a graph connecting the following points in order with straight lines: ($x[0],$y[0]), ($x[1],$y[1]), ($x[2],$y[2])"; + +add_functions($gr[1], "$f1 for x in <$b,$max[0]> using color:blue and weight:1"); +@x = ($b,$b+1,$b+2); +@y = (); +for my $i (@x) { + push (@y, $f1->eval(x=>$i)); +} +$ALTtags[1] .= "a curve starting at ($x[0],$y[0]) and going up to pass ($x[1],$y[1]) and ($x[2],$y[2])"; + +add_functions($gr[2], "$f2 for x in <$min[0],$max[0]> using color:blue and weight:1"); +@x = ($c-1,$c,$c+1); +@y = (); +for my $i (@x) { + push (@y, $f2->eval(x=>$i)); +} +$ALTtags[2] .= "a parabola facing upward with ($c,0) as the vertex"; + +add_functions($gr[3], "$f3 for x in <$min[0],$max[0]> using color:blue and weight:1"); +@x = (-1,0,1); +@y = (); +for my $i (@x) { + push (@y, $f3->eval(x=>$i)); +} +$ALTtags[3] .= "a graph connecting the following points in order with straight lines: ($x[0],$y[0]), ($x[1],$y[1]), ($x[2],$y[2])"; + +add_functions($gr[4], "$f4 for x in <$min[0],$max[0]> using color:blue and weight:1"); +@x = (-Real(pi),0,Real(pi)); +@y = (); +for my $i (@x) { + push (@y, $f4->eval(x=>$i)); +} +if ($c>0) { + $ALTtags[4] .= "a wave that moves up and down as we read the graph from left to right, with (-pi,$y[0]) at the bottom, crossing (0,$y[1]) at the top, and crossing (pi,$y[2]) at the bottom, ..."; +} else { + $ALTtags[4] .= "a wave that moves up and down as we read the graph from left to right, with (-pi,$y[0]) at the top, crossing (0,$y[1]) at the bottom, and crossing (pi,$y[2]) at the top, ..."; +} + +add_functions($gr[5], "$f5 for x in <$min[0],$max[0]> using color:blue and weight:1"); +@x = (-Real(pi)/2,0,Real(pi)/2); +@y = (); +for my $i (@x) { + push (@y, $f5->eval(x=>$i)); +} +if ($c>0) { + $ALTtags[5] .= "a wave that moves up and down as we read the graph from left to right, with (-pi/2,$y[0]) at the bottom, crossing (0,0), and (pi/2,$y[2]) at the top, ..."; +} else { + $ALTtags[5] .= "a wave that moves up and down as we read the graph from left to right, with (-pi/2,$y[0]) at the top, crossing (0,0), and (pi/2,$y[2]) at the bottom, ..."; +} + +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( +"Select the letters of graphs with functions that are neither odd nor even", + "$ALPHABET[$inverse{0}]", + "$ALPHABET[$inverse{1}]", + "$ALPHABET[$inverse{2}]", +); +$mc -> extra( + "$ALPHABET[$inverse{3}]", + "$ALPHABET[$inverse{4}]", + "$ALPHABET[$inverse{5}]", +); +$mc -> makeLast("A","B","C","D","E","F","None of the above"); + + +############################################## + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ + +LayoutTable([ +[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ),], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' )], +[image( insertGraph($gr[$scramble{4}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ), +image( insertGraph($gr[$scramble{5}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{5}]" title = "$ALTtags[$scramble{5}]"' )], +], allcellcss => "padding:20pt;") +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +BEGIN_PGML + +[@$mc -> print_q() @]** + [@$mc -> print_a() @]* + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + + + +####################################################### + +Context()->texStrings; + +BEGIN_SOLUTION + +Odd functions are symmetric by the origin, and even functions are symmetric by the \(y\)-axis. The other functions are neither odd nor even. + +Graphs \{$mc->correct_ans()\} show neither odd nor even functions . + +END_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven40.pg new file mode 100644 index 0000000000..12df141937 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven40.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Decide which of six functions represent odd functions. +# +# Last update: Carl Yao 09/01/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','odd','even','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce("(-x)-y","(-x)+y"); +@func = (); + +$a = non_zero_random(-5,5,1); +$func[0] = Formula("$a*x")->reduce; + +do { + $b1 = non_zero_random(-5,5,1); + $b2 = non_zero_random(-5,5,1); + $func[1] = Formula("$b1*x**3+$b2*x")->reduce; + $g = $func[1]->eval(x=>-1); + $h = $func[1]->eval(x=>1); +} until ($g!=$h); + +$c = non_zero_random(-5,5,1); +$func[2] = Formula("$c/x")->reduce; + +$d1 = non_zero_random(-5,5,1); +$d2 = non_zero_random(-5,5,1); +$func[3] = Formula("$d1*x**2+$d2*x")->reduce; + +$e = non_zero_random(-5,5,1); +$func[4] = Formula("$e")->reduce; + +$f = non_zero_random(-5,5,1); +$func[5] = Formula("sqrt(x-$f)")->reduce; + +($f0, $f1, $f2, $f3, $f4, $f5) = ('g','h','p','q','r','s')[NchooseK(6,6)]; + +Context()->texStrings; +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( +"Select odd functions", + "\($f0(x)=$func[0]\) $BR", + "\($f1(x)=$func[1]\) $BR", + "\($f2(x)=$func[2]\) $BR", +); +$mc -> extra( + "\($f3(x)=$func[3]\) $BR", + "\($f4(x)=$func[4]\) $BR", + "\($f5(x)=$func[5]\) $BR", +); +Context()->normalStrings; + +############################################## + +BEGIN_PGML + +[@$mc -> print_q() @]* + +[@$mc -> print_a() @]* + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + + + +####################################################### + +BEGIN_PGML_SOLUTION + +For a multiple-choice problem, there is no need to do write formal proofs. + +[`f(x)`] is odd if [`f(-x)=-f(x)`]. + +For example, to judge whether [`[$f1](x)=[$func[1]]`] is odd or not, substitute [`x=-1`] and [`x=1`] into [`[$f1](x)`], and we have [`[$f1](-1)=[$g]`] and [`[$f1](1)=[$h]`]. + +Since [`[$f1](-1)=-[$f1](1)`], we can guess that [`[$f1](x)`] is odd. + +[@$mc->correct_ans()@]* are odd functions. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven50.pg new file mode 100644 index 0000000000..34d295c12a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven50.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Decide which of six functions represent even functions. +# +# Last update: Carl Yao 09/01/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','odd','even','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce("(-x)-y","(-x)+y"); +@func = (); + +$a = non_zero_random(-5,5,1); +$func[0] = Formula("$a*abs(x)")->reduce; + +do { + $b1 = non_zero_random(-5,5,1); + $b2 = non_zero_random(-5,5,1); + $func[1] = Formula("$b1*x**4+$b2*x**2")->reduce; + $g = $func[1]->eval(x=>-1); + $h = $func[1]->eval(x=>1); +} until ($g!=0); + +$c = non_zero_random(-5,5,1); +$func[2] = Formula("$c")->reduce; + +$d1 = non_zero_random(-5,5,1); +$d2 = non_zero_random(-5,5,1); +$func[3] = Formula("$d1*x**3+$d2*x")->reduce; + +$e = non_zero_random(-5,5,1); +$func[4] = Formula("x+$e")->reduce; + +$f = non_zero_random(-5,5,1); +$func[5] = Formula("$f*sqrt(x)")->reduce; + +($f0, $f1, $f2, $f3, $f4, $f5) = ('g','h','p','q','r','s')[NchooseK(6,6)]; + +Context()->texStrings; +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( +"Select even functions", + "\($f0(x)=$func[0]\) $BR", + "\($f1(x)=$func[1]\) $BR", + "\($f2(x)=$func[2]\) $BR", +); +$mc -> extra( + "\($f3(x)=$func[3]\) $BR", + "\($f4(x)=$func[4]\) $BR", + "\($f5(x)=$func[5]\) $BR", +); +Context()->normalStrings; + +############################################## + +BEGIN_PGML + +[@$mc -> print_q() @]* + +[@$mc -> print_a() @]* + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +####################################################### + +BEGIN_PGML_SOLUTION + +For a multiple-choice problem, there is no need to do write formal proofs. + +[`f(x)`] is even if [`f(-x)=f(x)`]. + +For example, to judge whether [`[$f1](x)=[$func[1]]`] is even or not, substitute [`x=-1`] and [`x=1`] into [`[$f1](x)`], and we have [`[$f1](-1)=[$g]`] and [`[$f1](1)=[$h]`]. + +Since [`[$f1](-1)=[$f1](1)`], we can guess that [`[$f1](x)`] is even. + +Note that a constant function is even. + +[@$mc->correct_ans()@]* are even functions. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven60.pg new file mode 100644 index 0000000000..2fddec30d6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/OddOrEven60.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Decide which of six functions represent neither odd nor even functions. +# +# Last update: Carl Yao 09/01/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','odd','even','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce("(-x)-y","(-x)+y"); +@func = (); + +$a = non_zero_random(-5,5,1); +$func[0] = Formula("$a*sqrt(x)")->reduce; + +do { + $b1 = non_zero_random(-5,5,1); + $b2 = non_zero_random(-5,5,1); + $func[1] = Formula("$b1*x**2+$b2*x")->reduce; + $g = $func[1]->eval(x=>-1); + $h = $func[1]->eval(x=>1); +} until (abs($g)!=abs($h)); + +$c = non_zero_random(-5,5,1); +$func[2] = Formula("x+$c")->reduce; + +$d1 = non_zero_random(-5,5,1); +$d2 = non_zero_random(-5,5,1); +$func[3] = Formula("$d1*x**3+$d2*x")->reduce; + +$e = non_zero_random(-5,5,1); +$func[4] = Formula("$e*x**2")->reduce; + +$f = non_zero_random(-5,5,1); +$func[5] = Formula("$f")->reduce; + +($f0, $f1, $f2, $f3, $f4, $f5) = ('g','h','p','q','r','s')[NchooseK(6,6)]; + +Context()->texStrings; +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( +"Select functions that are neither odd nor even", + "\($f0(x)=$func[0]\) $BR", + "\($f1(x)=$func[1]\) $BR", + "\($f2(x)=$func[2]\) $BR", +); +$mc -> extra( + "\($f3(x)=$func[3]\) $BR", + "\($f4(x)=$func[4]\) $BR", + "\($f5(x)=$func[5]\) $BR", +); +Context()->normalStrings; + +############################################## + +BEGIN_PGML + +[@$mc -> print_q() @]* + +[@$mc -> print_a() @]* + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +####################################################### + +BEGIN_PGML_SOLUTION + +For a multiple-choice problem, there is no need to do write formal proofs. + +[`f(x)`] is even if [`f(-x)=f(x)`], and [`f(x)`] is odd if [`f(-x)=-f(x)`]. + +For example, to judge whether [`[$f1](x)=[$func[1]]`] is even or odd, substitute [`x=-1`] and [`x=1`] into [`[$f1](x)`], and we have [`[$f1](-1)=[$g]`] and [`[$f1](1)=[$h]`]. + +Since neither [`[$f1](-1)=[$f1](1)`] nor [`[$f1](-1)=-[$f1](1)`] is true, we can conclude that [`[$f1](x)`] is neither even nor odd. + +[@$mc->correct_ans()@]* are neither even nor odd. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise10.pg new file mode 100644 index 0000000000..28a6604c08 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise10.pg @@ -0,0 +1,152 @@ +##DESCRIPTION + + +## Type: evaluation +##ENDDESCRIPTION + +######################################## + +DOCUMENT(); # This should be the first executable line in the problem. + + +loadMacros( +"PGstandard.pl", +"PGML.pl", +"MathObjects.pl", +"parserAssignment.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGcourse.pl", + +); + +######################################## + +TEXT(beginproblem()); + + +$a = random(2,10,1); +$b = random(2,10,1); +$c = random(2,10,1); +$d = random(2,5,1); + +$co1 = $d-5; +$co2 = $d+1; +$co3 = $d*2; +$co4 = $co3+3; + +$h = $co3 + random(7,15); +$e = $c - $h; + +$lcb ="\{"; + +$ans1 = $a*$co1**2+$b; +$ans2 = $a; +$ans2 = $a; +$ans3 = $a; +$ans4 = $c-$co4; + +$ans5 = $h; + +parser::Assignment->Allow; + +######################################## + + +BEGIN_PGML + +Let [` f(x)=\begin{cases} + [$a] x^2 + [$b] & x<[$d]\\ + [$a] & [$d] \leq x \leq [$co3]\\ + [$c] - x & x > [$co3] + \end{cases} + `] + +a) [`f([$co1])={}`][_________________________]{$ans1} + +a) [`f([$co2])={}`][_________________________]{$ans2} + +a) [`f([$co3])={}`][_________________________]{$ans3} + +a) [`f([$co4])={}`][_________________________]{$ans4} + +a) Solve the equation [`f(x)=[$e]`]. All solutions should be expressed in the form *x=[$US][$US][$US] *. If there is more than one solution, use commas to separate them. +[_________________________]{Formula("x = $ans5")} + +a) The domain of [`f`] is [_________________________]{Interval("(-infinity, infinity)")}. + + +END_PGML + +######################################## + +($xmin, $xmax, $ymin, $ymax, $xticknumber, $yticknumber) = NiceGraphParameters([0, $d, $co3, $ans5],[0, $a*$d**2+$b,$a, $c-$co3, $e]); + +$refreshCachedImages = 1; +$gr = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[$xticknumber,$yticknumber], + size=>[xPixels(),yPixels()] + ); + +add_functions($gr, "$a*x**2+$b for x in <$xmin,$d>" . + " using color:blue and weight:1"); +add_functions($gr, "$a for x in <$d,$co3>" . + " using color:blue and weight:1"); +add_functions($gr, "$c - x for x in <$co3,$xmax>" . + " using color:blue and weight:1"); +add_functions($gr, "$e for x in <$xmin,$xmax>" . + " using color:red and weight:1"); +$gr->stamps( open_circle($d,$a*($d**2)+$b,'blue') ); +$gr->stamps( open_circle($co3,$c - $co3,'blue') ); +$gr->stamps( closed_circle($d,$a,'blue') ); +$gr->stamps( closed_circle($co3,$a,'blue') ); +$gr->stamps( closed_circle($ans5,$e,'red') ); + +$altb = "This is a graph of a piecewise function. In ($xmin,$d), the function is $a*x**2+$b, with an open dot at $d. In [$d,$co3], the function is y=$a, with closed dots at $d and $co3. In ($co3,$xmax), the function is y=$c-x, with an open dot at $co3. A horizontal line y=$e is graphed, intersecting with y=$c-x at ($ans5,$e)."; + +BEGIN_PGML_SOLUTION + +a) Since [`[$co1]<[$d]`], to find [`f([$co1])`], we apply the first rule. +[`\begin{aligned} +f([$co1]) +&= [$a]([$co1])^2 + [$b]\\ +&= [$ans1] +\end{aligned}`] + +a) Since [`[$d]\leq[$co2]\leq[$co3]`], to find [`f([$co2])`], we apply the second rule. +[`\begin{aligned} +f([$co2]) +&= [$a] +\end{aligned}`] + +a) Since [`[$d]\leq[$co3]\leq[$co3]`], to find [`f([$co3])`], we apply the second rule. +[`\begin{aligned} +f([$co3]) +&= [$a] +\end{aligned}`] + +a) Since [`[$co4]>[$co3]`], to find [`f([$co4])`], we apply the third rule. +[`\begin{aligned} +f([$co4]) +&= [$c] - [$co4]\\ +&= [$ans4] +\end{aligned}`] + +a) To solve the equation [`f(x)=[$e]`], it can help to create a graph of [`f`]. +[@EnlargeImageStatementPGML()@] +>>[@image( insertGraph($gr), +width=>400,height=>400,tex_size=>800, extra_html_tags=>"alt = '$altb'" )@]* << + We can see that the only solution happens in the part of the domain where the third rule is used. So we set up an equation to solve: +[`\begin{aligned} +[$c] - x &= [$e]\\ +-x &= [$e-$c]\\ +x & = [$c-$e] +\end{aligned}`] + + [|f.|] Every real number meets one of the three conditions from the definition of this piecewise defined function, so the domain is [`(-\infty,\infty)`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise20.pg new file mode 100644 index 0000000000..666487ccbb --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise20.pg @@ -0,0 +1,172 @@ +##DESCRIPTION + + +## Type: evaluation +##ENDDESCRIPTION + +######################################## + +DOCUMENT(); # This should be the first executable line in the problem. + + +loadMacros( +"PGstandard.pl", +"PGML.pl", +"MathObjects.pl", +"parserAssignment.pl", +"PGgraphmacros.pl", +"contextFraction.pl", +"PCCgraphMacros.pl", +"PGcourse.pl", + +); + +######################################## + +TEXT(&beginproblem); + +$showPartialCorrectAnswers = 1; + +Context("Numeric"); + +do { +$x1 = random(-5,-2,1); +$x2 = $x1 + random(3,5,1); +$x3 = $x2 + random(1,4,1); + +$m1 = random(2,4,0.1); +do {$m2 = -random(2,4,0.1);} until (abs($m2) != abs($m1)); + +$h1 = $x1; +$k1 = random(2,10,1); + +$temp = $k1 - $m1*$x1; +$f1 = Formula("$m1 x + $temp ")->reduce; + +$h2 = $x2; +$k2 = $f1->eval(x=>$h2); + +$temp = $k2 - $m2*$h2; +$f2 = Formula("$m2 x + $temp")->reduce; + +$h3 = $x3; +$k3 = $f2->eval(x=>$h3); +} until ($k3 > 0); + + +Context("Fraction"); +$c = Fraction($k3/2**(-$x3)); + +Context("Numeric"); +$f3 = Formula("$c*2^(-x)"); + +$a = random($x2, $x3,1); +$b = random($x3+1,$x3+4,1); + +$ans1 = $f2->eval(x=>$a); +$ans2 = $f3->eval(x=>$b); + +$y = random(max(0.1,($k2+$k3)/2), $k2-0.1, 0.1 ); + + + +$domain = Interval("($x1,inf)"); +$range = Interval("(0,$k2]"); + +Context("Fraction"); +parser::Assignment->Allow; + +$s1 = ($y - $k1)/$m1+$h1; +$s2 = ($y - $k2)/$m2+$h2; +$ans3 = List(Formula("x = $s1"), Formula("x = $s2")); + +######################################## + + +BEGIN_PGML + +Let [` f(x)=\begin{cases} + [$f1] & [$x1]\lt x\lt[$x2]\\ + [$f2] & [$x2] \leq x \leq [$x3]\\ + [$f3] & x \gt [$x3] + \end{cases} + `] + +a) [`f([$a])={}`][_________________________]{$ans1} + +a) [`f([$b])={}`][_________________________]{$ans2} + +a) Solve the equation [`f(x)=[$y]`]. All solutions should be expressed in the form *x=[$US][$US][$US] *. If there is more than one solution, use commas to separate them. +[_________________________]{$ans3} + +a) The domain of [`f`] is [_________________________]{$domain}. + +a) The range of [`f`] is [_________________________]{$range}. + +END_PGML + +######################################## + +($xmin, $xmax, $ymin, $ymax, $xticknumber, $yticknumber) = NiceGraphParameters([0, $x1, $x2, $x3, $a, $b],[0, $k1, $k2, $k3]); + +$refreshCachedImages = 1; +$gr = init_graph($xmin,$ymin,$xmax,$ymax, + axes=>[0,0], + grid=>[$xticknumber,$yticknumber], + size=>[xPixels(),yPixels()] + ); + +add_functions($gr, "$f1 for x in <$x1,$x2>" . + " using color:blue and weight:1"); +add_functions($gr, "$f2 for x in <$x2,$x3>" . + " using color:blue and weight:1"); +add_functions($gr, "$f3 for x in <$x3,$xmax>" . + " using color:blue and weight:1"); +add_functions($gr, "$y for x in <$xmin,$xmax>" . + " using color:red and weight:1"); +$gr->stamps( open_circle($x1,$k1,'blue') ); + +$gr->stamps( closed_circle($s1,$y,'red') ); +$gr->stamps( closed_circle($s2,$y,'red') ); + +$altb = "This is a graph of a piecewise function. In ($x1,$x2], the function is $f1, with an open dot at $x1. In [$x2,$x3], the function is $f2. In [$x3,$xmax], the function is $f3. Those three functions are continuous. A horizontal line y=$y is graphed, intersecting with the piecewise function at ($s1,$y) and ($s2,$y)."; + +$sol1 = $f2->substitute(x=>Formula("$a")); +$sol2 = $f3->substitute(x=>Formula("$b")); + +BEGIN_PGML_SOLUTION + +a) Since [`[$x1]<[$a]<[$x2]`], to find [`f([$a])`], we apply the second rule. +[`\begin{aligned} +f([$a]) +&= [$sol1]\\ +&= [$ans1] +\end{aligned}`] + +a) Since [`[$b] > [$x3]`], to find [`f([$b])`], we apply the third rule. +[`\begin{aligned} +f([$b]) +&= [$sol2]\\ +&= [$ans2] +\end{aligned}`] + + +a) To solve the equation [`f(x)=[$y]`], it can help to create a graph of [`f`]. +[@EnlargeImageStatementPGML()@]** +>>[@image( insertGraph($gr), +width=>400,height=>400,tex_size=>800, extra_html_tags=>"alt = '$altb'" )@]* << + We can see that the only solutions happen in the part of the domain where the first and second rules are used. So we set up equations to solve: +[`\begin{aligned} +[$f1]&=[$y]&[$f2]&=[$y]\\ +[$m1] x &=[$y-$k1+$m1*$x1]&[$m2]x&=[$y-$k2+$m2*$h2]\\ +x&=[$s1]&x&=[$s2] +\end{aligned}`] +[|d.|] Every real number meets one of the three conditions from the definition of this piecewise defined function, so the domain is [`[$domain]`]. +[|e.|] We can see from the graph that the highest output achieved by [`f`] is [`f([$x2])`], which is [`[$k2]`]. The graph also indicates that [`f`]'s outputs get arbitrarily close to [`0`], but never reach it. So the range is [`[$range]`]. + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise30.pg new file mode 100644 index 0000000000..a0497a7387 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise30.pg @@ -0,0 +1,203 @@ +##DESCRIPTION + + +## Type: evaluation +##ENDDESCRIPTION + +######################################## + +DOCUMENT(); # This should be the first executable line in the problem. + + +loadMacros( +"PGstandard.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"extraAnswerEvaluators.pl", +"MathObjects.pl", +"PGML.pl", +"contextCurrency.pl", +"PGcourse.pl", +); + +######################################## + +TEXT(&beginproblem); + +$showPartialCorrectAnswers = 1; + +Context("Numeric"); +$f1 = Formula("0.1x"); +$f2 = Formula("0.15x - 418.75"); +$f3 = Formula("0.25x - 3818.75"); +$f4 = Formula("0.28x - 6290.75"); +$f5 = Formula("0.33x - 14883.3"); +$f6 = Formula("0.35x - 22356.2"); + +$a = random(1000,6000,1000); +$ansa = (0.1*$a); +$b1 = random(9000,30000,1000); +$b2 = random(90000,170000,10000); +$pickquestionb = random(0,1); +if ($pickquestionb == 0) { +$questionb = $b1; +$ansb = 0.15*$b1 - 418.75; +$solnstring = "Since [`8375 < $questionb \leq 34000`], we find [`T($questionb)`] by using the second formula: +[`\begin{aligned} +T($questionb) +&= 0.15($questionb) - 418.75\\ +&= $ansb +\end{aligned}`]";} +else { +$questionb = $b2; +$ansb = 0.28*$b2 - 6290.75; +$solnstring = "Since [`82400 < $questionb \leq 171850`], we find [`T($questionb)`] by using the fourth formula: +[`\begin{aligned} +T($questionb) +&= 0.28($questionb) - 6290.75\\ +&= $ansb +\end{aligned}`]";}; + +Context()->texStrings; +$c1 = random(5000,16000,1000); +$c2 = random(45000,105000,10000); +$pickquestionc = random(0,1); +if ($pickquestionc == 0) { +$questionc = $c1; +$ansc = (($c1 + 3818.75)/0.25); +$temp = $questionc + 3818.75; +$solnstringc = "The graph reveals that the solution lies in the third region, so we can use the third formula to solve for [`x`]. +[`\begin{aligned} +T(x) +&= $questionc\\ +$f3 +&= $questionc\\ +0.25x +&= $temp\\ +x +&= $ansc +\end{aligned}`]";} +else { +$questionc = $c2; +$ansc = (($c2 + 14883.3)/0.33); +$temp = $questionc + 14883.3; +$solnstringc = "The graph reveals that the solution lies in the fifth region, so we can use the fifth formula to solve for [`x`]. +[`\begin{aligned} +T(x) +&= $questionc\\ +$f5 +&= $questionc\\ +0.33x +&= $temp\\ +x +&= $ansc +\end{aligned}`]";} +Context()->normalStrings; + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); + +$ac = Currency("$a"); +$ansac = Currency("$ansa"); +$questionbc = Currency("$questionb"); +$ansbc = Currency("$ansb"); +$questioncc = Currency("$questionc"); +$anscc = Currency("$ansc"); + +($xmin, $xmax, $ymin, $ymax, $xticknumber, $yticknumber) = NiceGraphParameters([0, 400000], [0, $f6->eval(x=>400000)]); + +$refreshCachedImages = 1; +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xticknumber, $yticknumber], +size=>[400,400] +); + +add_functions($gr, "$f1 for x in <0,8375>" . + " using color:blue and weight:1"); +add_functions($gr, "$f1 for x in <0,8375>" . + " using color:blue and weight:1"); +add_functions($gr, "$f2 for x in <8375, 34000>" . + " using color:blue and weight:1"); +add_functions($gr, "$f3 for x in <34000,82400>" . + " using color:blue and weight:1"); +add_functions($gr, "$f4 for x in <82400,171850>" . + " using color:blue and weight:1"); +add_functions($gr, "$f5 for x in <171850,373650>" . + " using color:blue and weight:1"); +add_functions($gr, "$f6 for x in <373650,$xmax>" . + " using color:blue and weight:1"); +add_functions($gr, "$questionc for x in <$xmin,$xmax>" . + " using color:red and weight:1"); +$gr->stamps( closed_circle(8375,$f1->eval(x=>8375),'blue') ); +$gr->stamps( closed_circle(34000,$f2->eval(x=>34000),'blue') ); +$gr->stamps( closed_circle(82400,$f3->eval(x=>82400),'blue') ); +$gr->stamps( closed_circle(171850,$f4->eval(x=>171850),'blue') ); +$gr->stamps( closed_circle(373650,$f5->eval(x=>373650),'blue') ); + + +######################################## + +BEGIN_PGML + +The U.S. 2010 federal income tax for a single person with taxable income [`x`] dollars is [`T(x)`] dollars, where [`T`] is the function defined by federal law as follows: + + [` T(x)=\begin{cases} + [$f1] & \text{if } 0 \leq x \leq 8375 \\ + [$f2] & \text{if } 8375 < x \leq 34000 \\ + [$f3] & \text{if } 34000 < x \leq 82400 \\ + [$f4] & \text{if } 82400 < x \leq 171850 \\ + [$f5] & \text{if } 171850 < x \leq 373650 \\ + [$f6] & \text{if } 373650 < x \\ + \end{cases}`] + + +a) What is the 2010 federal income tax for a single person whose taxable income that year was [`[$ac]`] dollars? + + [____________________]{$ansac} + + +b) What is the 2010 federal income tax for a single person whose taxable income that year was [`[$questionbc]`]? + + [____________________]{$ansbc} + + +c) What is the taxable income for a single person whose 2010 federal income tax was [`[$questioncc]`]? + + [____________________]{$anscc->cmp(tolerance=>1)} + + + +END_PGML + +######################################## +Context()->flags->set(reduceConstants=>0); + +BEGIN_PGML_SOLUTION + +a) Since [`[$a] < 8375`], we find [`T([$a])`] by using the first formula: +[`\begin{aligned} +T([$a]) +&= 0.1([$a])\\ +&= [$ansa] +\end{aligned}`] +So the tax is [`[$ansac]`]. + +a) [$solnstring]** +So the tax is [`[$ansbc]`]. + +a) To help solve the equation [`T(x)=[$questionc]`], we produce a graph of the function [`T`]. In the graph, dots are used to mark where use of each formula ends and the next one begins. + + [@EnlargeImageStatementPGML()@] +>> [@image( insertGraph($gr), +width=>400,height=>400,tex_size=>800 )@]* << + + [$solnstringc]** + + So the person's income was [`[$anscc]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise40.pg new file mode 100644 index 0000000000..3995f93108 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise40.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## Find a Constant to Make a Function Continuous +## ENDDESCRIPTION + +## Tagged by nhamblet + +## DBsubject(Calculus - single variable) +## DBchapter(Limits and continuity) +## DBsection(Continuity - concept of) +## Date(8/23/07) +## Institution(Union College) +## Author(K. Lesh) +## MLT(cc-m1) +## MLTleader(1) +## Level(4) +## KEYWORDS('Continuous', 'Piecewise') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextPiecewiseFunction.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + +################################### +# Setup + +Context("PiecewiseFunction")->variables->add(b=>'Real'); + +$m1 = random(2,8,1); +$b1 = random(1,6,1); +$m2 = random(2,8,1); +$x = random(2,10,1); + +$f = PiecewiseFunction( + "${m1}x-$b1 if x <= $x else + -${m2}x+b if x > $x" +); + +Context("Numeric"); + +$ans = Real($m1*$x+$m2*$x-$b1); + +################################### +# Main text + +BEGIN_PGML +Find the value of the constant [`b`] that makes the function [`f`] continuous on [`(-\infty,\infty)`]. [`f`] is defined by + + [`f(x) = [$f]`] + + + [`b={}`][__________]{$ans} + +Now check a graph of [`f`] to confirm. + +END_PGML + +################################### +# Answers + +$showPartialCorrectAnswers = 1; + +################################### + +BEGIN_PGML_SOLUTION + +For [`f`] to be continuous, we'd need + + [`\begin{aligned} +[$m1]([$x])-[$b1]&=-[$m2]([$x])+b\\ +[$m1*$x]-[$b1]&=[$m2*$x*-1]+b\\ +[$m1*$x-$b1]&=[$m2*$x*-1]+b\\ +[$ans]&=b\\ +b&=[$ans]\\ +\end{aligned}`] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise50.pg new file mode 100644 index 0000000000..3a9631eedb --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise50.pg @@ -0,0 +1,187 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, write a piecewise function's equations. +# +# Last update: Carl Yao 09/07/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "niceTables.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$m1 = random(0.5,2,0.5)*random(-1,1,2); +$b1 = random(-3,3,1); +$func1 = Compute("$m1*x+$b1")->reduce; +$x1 = random(-6,-3,1); +$y1 = $func1->eval(x=>$x1); +$x2 = random($x1+2,$x1+4,1); +$y2 = $func1->eval(x=>$x2); + +$func2 = Compute("$y2"); +$x3 = random($x2+2,$x2+4,1); +$y3 = $y2; + +$m3 = random(0.5,2,0.5); +$m3 = $m1 > 0 ? -$m3 : $m3; +$func3 = Compute("$m3*x+(-$m3*$x3+$y3)")->reduce; +$x4 = random($x3+2,$x3+4,1); +$y4 = $func3->eval(x=>$x4); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x1,$x4,0],[$y1,$y2,$y4,0],centerOrigin=>0); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + add_functions($gr[$i], "$func1 for x in [$x1,$x2] using color:blue and weight:1"); + add_functions($gr[$i], "$func2 for x in [$x2,$x3] using color:blue and weight:1"); + add_functions($gr[$i], "$func3 for x in [$x3,$x4] using color:blue and weight:1"); + +} + + +$ALT = "There are three line segments. The first segment is from ($x1,$y1) to ($x2,$y2), the second from ($x2,$y2) to ($x3,$y3), the third from ($x3,$y3) to ($x4,$y4)."; + + +############################################## + +BEGIN_PGML + +A function's graph is shown below. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +Write the equations of this piecewise function. + +[@DataTable( + [ + [[PF(''), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('[_______________]{$func1}'),], + [PF('[`\text{if }[$x1]\le x\lt[$x2]`]'),], + ], + [[PF('[`f(x)=`]'), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('[_______________]{$func2}'),], + [PF('[`\text{if }[$x2]\le x\lt[$x3]`]'),], + ], + [[PF(''), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('[_______________]{$func3}'),], + [PF('[`\text{if }[$x3]\le x\le[$x4]`]'),], + ], + ], + align => 'c c c', + columnscss => + ['border-right: 0px solid; ', + ' ',], +);@]* + +END_PGML +############################################## + +$s1 = Compute("$m1*x")->reduce; +if ($m1 == 1) { + $s2 = "$x1"; + $s3 = ""; +} elsif ($m1 == -1) { + $s2 = "-($x1)"; + $x1N = -$x1; + $s3 = "$y1 &= $x1N+b \\"; +} else { + $s2 = "$m1($x1)"; + $c = $m1*$x1; + $s3 = "$y1 &= $c+b \\"; +} + +BEGIN_PGML_SOLUTION + +The left piece is a line passing [`([$x1],[$y1])`] and [`([$x2],[$y2])`]. We can use the slope formula to find the line's slope: + + [`` +\begin{aligned} + \text{slope} + &= \frac{y_2-y_1}{x_2-x_1} \\ + &= \frac{[$y2]-([$y1])}{[$x2]-([$x1])} \\ + &= \frac{[$y2-$y1]}{[$x2-$x1]} \\ + &= [$m1] +\end{aligned} + ``] + +Next, substitute [`([$x1],[$y1])`] into [`y=[$s1]+b`], and we have + + [`` +\begin{aligned} + y &= [$s1]+b \\ + [$y1] &= [$s2]+b \\ + [$s3] + [$b1] &= b +\end{aligned} + ``] + +If [`[$x1]\le x\lt[$x2]`], [`f(x)=[$func1]`]. + +The second piece is a horizontal line with the equation [`y=[$y2]`]. + +The third piece is a line passing [`([$x3],[$y3])`] and [`([$x4],[$y4])`]. With the same method above, you can find the third piece's equation as [`f(x)=[$func3]`] if [`[$x3]\le x\le[$x4]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise60.pg new file mode 100644 index 0000000000..94ff0c7e51 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise60.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Write a piecewise function based on given conditions. +# +# Last update: Carl Yao 09/07/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "niceTables.pl", + "contextCurrency.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## +TEXT(beginproblem()); + +Context("Currency"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$cut = random(15000,30000,1000); +$cutC = Currency($cut); +$lowerP = random(5,15,1); +$higherP = random($lowerP+5,$lowerP+10,1); +$func1 = Compute("$lowerP/100*x")->reduce; +$func2 = Compute("$lowerP/100*$cut+$higherP/100*(x-$cut)")->reduce; + +############################################## + +BEGIN_PGML + +A country taxes income in the following manner: + +For the amount lower than or equal to [`[$cutC]`], the tax rate is [`[$lowerP]`]%. + +For the amount over [`[$cutC]`], the tax rate is [`[$higherP]`]%. + +Write the equations of a piecewise function, [`f(x)`], which calculates a person's income rax, where [`x`] is a person's income in dollars. + +[@DataTable( + [ + [[PF(''), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('[_______________]{$func1}'),], + [PF('[`\text{if }0\lt x\le[$cutC]`]'),], + ], + [[PF('[`f(x)=`]'), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF(''),], + [PF(''),], + ], + [[PF(''), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('[_______________]{$func2}'),], + [PF('[`\text{if }[$cutC]\lt x`]'),], + ], + ], + align => 'c c c', + columnscss => + ['border-right: 0px solid; ', + ' ',], +);@]* + +END_PGML +############################################## + +$tax1 = $lowerP/100*$cut; +$tax1C = Currency($tax1); + +BEGIN_PGML_SOLUTION + +[@DataTable( + [ + [[PF(''), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('[`[$func1]`]'),], + [PF('[`\text{if }0\lt x\le[$cutC]`]'),], + ], + [[PF('[`f(x)=`]'), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF(''),], + [PF(''),], + ], + [[PF(''), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('[`[$func2]`]'),], + [PF('[`\text{if }[$cutC]\lt x`]'),], + ], + ], + align => 'c c c', + columnscss => + ['border-right: 0px solid; ', + ' ',], +);@]* + +For an income lower than [`[$cutC]`], the income tax is [`f(x)=[$func1]`]. + +For an income higher than [`[$cutC]`], the part [`[$cutC]`] is taxed at a lower rate of [`[$lowerP/100]\cdot[$cutC]=[$tax1C]`]. The rest, [`(x-[$cut])`] dollars, is taxed at a higher rate, and the amount of tax is [`[$higherP/100](x-[$cut])`] dollars. + +For an income higher than [`[$cutC]`], the total tax is [`f(x)=[$func2]`] dollars. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise70.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise70.pg new file mode 100644 index 0000000000..6ad4d033ea --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise70.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Write a piecewise function based on given conditions. +# +# Last update: Carl Yao 09/07/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "niceTables.pl", + "contextCurrency.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## +TEXT(beginproblem()); + +Context("Currency"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$base = random(20,50,5); +$baseC = Currency($base); +$cut = random(200,500,100); +$rate1 = random(0.6,0.9,0.05); +$rate1C = Currency($rate1); +$rate2 = random(0.3,$rate1-0.1,0.05); +$rate2C = Currency($rate2); +$func1 = Compute("$base+$rate1*x")->reduce; +$func2 = Compute("$base+$rate1*$cut+$rate2*(x-$cut)")->reduce; + +############################################## + +BEGIN_PGML + +A moving truck rental company charges in the following way: + +A base fee of [`[$baseC]`] is charged. + +For the first [`[$cut]`] miles driven, the company charges [`[$rate1C]`] per mile. + +For miles driven beyond [`[$cut]`] miles, the company charges [`[$rate2C]`] per mile. + +Write a piecewise function, [`f(x)`], to model the charge if a renter drives [`x`] miles. + +[@DataTable( + [ + [[PF(''), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('[_______________]{$func1}'),], + [PF('[`\text{if }0\lt x\le[$cut]`]'),], + ], + [[PF('[`f(x)=`]'), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF(''),], + [PF(''),], + ], + [[PF(''), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('[_______________]{$func2}'),], + [PF('[`\text{if }[$cut]\lt x`]'),], + ], + ], + align => 'c c c', + columnscss => + ['border-right: 0px solid; ', + ' ',], +);@]* + +END_PGML +############################################## + +$charge1 = $base+$rate1*$cut; +$charge1C = Currency($charge1); + +BEGIN_PGML_SOLUTION + +[@DataTable( + [ + [[PF(''), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('[`[$func1]`]'),], + [PF('[`\text{if }0\lt x\le[$cut]`]'),], + ], + [[PF('[`f(x)=`]'), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF(''),], + [PF(''),], + ], + [[PF(''), + midrule => '0', + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('[`[$func2]`]'),], + [PF('[`\text{if }[$cut]\lt x`]'),], + ], + ], + align => 'c c c', + columnscss => + ['border-right: 0px solid; ', + ' ',], +);@]* + +If a renter drives fewer than [`[$cut]`] miles, the charge is [`f(x)=[$func1]`]. + +If a renter drives more than [`[$cut]`] miles, the first [`[$cut]`] miles are charged [`[$baseC]+[$rate1C]\cdot[$cut]=[$charge1C]`]. The extra [`(x-[$cut])`] miles is charged at a lower rate of [`[$rate2C]`], and the charge is [`[$rate2](x-[$cut])`] dollars. + +If a renter drives more than [`[$cut]`] miles, the total charge is [`f(x)=[$func2]`] dollars. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise80.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise80.pg new file mode 100644 index 0000000000..5033d71426 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise80.pg @@ -0,0 +1,178 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Sketch the graph of a piecewise function, and find domain and range. +# +# Last update: Carl Yao 09/07/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(-3,3,1); +$func1 = Compute("x**2+$a")->reduce; +$x1 = random(-1,0,1); +$y1 = $func1->eval(x=>$x1); + +$x2 = $x1; +$y2 = random($y1+1,$y1+3,1); + +$m2 = random(0.5,3,0.5); +$x3 = $x2; +$y3 = random(-3,$y1,1); +$b2 = -$m2*$x3+$y3; +$func2 = Compute("$m2*x+$b2")->reduce; + + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-3,3],[$y1,$y2+1,$y3-1,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $lower = $min[0]-0.5; + $upper = $max[0]+0.5; + add_functions($gr[$i], "$func1 for x in ($lower,$x1) using color:blue and weight:1"); + add_functions($gr[$i], "$func2 for x in ($x3,$upper) using color:blue and weight:1"); + $gr[$i]->stamps( closed_circle($x2,$y2,'blue') ); + +} + +$ALT = "This is the graph of a piecewise function. The left piece if part of a parabola with the domain from negative infinity to $x1, not including $x1. The parabola ends at ($x1,$y1), but this point is not included. There is a dot on the function at ($x2,$y2). The right piece is part of a line with the domain from $x3 to positive infinity. The line starts at ($x3,$y3), but this point is not included."; + +$x4 = random(-10,$x1-1,1); +$y4 = $func1->eval(x=>$x4); +$x5 = random($x3+1,10,1); +$y5 = $func2->eval(x=>$x5); + +Context("Interval"); +$domain = Compute("(-inf,inf)"); +$minValue = min($y1,$y3); +$range = Compute("($minValue,inf)"); + + +############################################## + +BEGIN_PGML + +A piecewise function's equation is given: + + [`` +f(x)= +\begin{cases} + [$func1] &\text{if }x\lt[$x1] \\ + [$y2] &\text{if }x=[$x2] \\ + [$func2] &\text{if }[$x2]\lt x \\ +\end{cases} + ``] + +Sketch the function's graph on scratch paper, and then answer the following questions. + +###Question 1 + +[`f([$x4])=`] [______________]{$y4} + +[`f([$x2])=`] [______________]{$y2} + +[`f([$x5])=`] [______________]{$y5} + +###Question 2 + +* Use *inf* to represent [`\infty`]. +* Use upper case U to represent "union" in set notation. + +The function's domain is [_______________]{$domain}. + +The function's range is [______________]{$range}. + +END_PGML +############################################## + +if ($m2 == 1) { + $s1 = "$x5"; +} elsif ($m2 == -1) { + $s1 = "-($x5)"; +} else { + $s1 = "$m2($x5)"; +} + +if ($b2 == 0) { + $s2 = ""; +} elsif ($b2 < 0) { + $s2 = "$b2"; +} else { + $s2 = "+$b2"; +} + +BEGIN_PGML_SOLUTION + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +###Question 1 + +Since [`[$x4]\lt[$x1]`], we use [`f(x)=[$func1]`] to calculate [`f([$x4])`]: + + [`` f([$x4]) = ([$x4])^2+[$a] = [$y4] ``] + +Since [`f(x)=[$y2]`] when [`x=[$x2]`], [`f([$x2])=[$y2]`]. + +Since [`x\lt[$x5]`], we use [`f(x)=[$func2]`] to calculate [`f([$x5])`]: + + [`` f([$x5]) = [$s1][$s2] = [$y5] ``] + +###Question 2 + +By the graph, the function's domain is [`[$domain]`], and its range is [`[$range]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise90.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise90.pg new file mode 100644 index 0000000000..9fb69e5b1f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Piecewise90.pg @@ -0,0 +1,238 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Sketch the graph of a piecewise function, and find domain and range. +# +# Last update: Carl Yao 09/07/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +do { + $m1 = random(-2,2,0.5); + $b1 = random(-3,3,1); + $func1 = Compute("$m1*x+$b1")->reduce; + $x1 = random(-7,-4,1); + $y1 = $func1->eval(x=>$x1); + $x2 = random(-3,-1,1); + $y2 = $func1->eval(x=>$x2); +} until $y1 != $y2; + +do { + $m2 = random(-2,2,0.5); + $b2 = random(-3,3,1); + $func2 = Compute("$m2*x+$b2")->reduce; + $x4 = random(1,3,1); + $y4 = $func2->eval(x=>$x4); + $x5 = random(4,7,1); + $y5 = $func2->eval(x=>$x5); +} until $y4 != $y5; + +$x3 = random(0,1,1) ? $x2 : $x4; +if (random(0,1,1) == 0) { + $y3 = random(min($y1,$y2)+0.1,max($y1,$y2)-0.1,0.1); +} else { + $y3 = random(min($y4,$y5)+0.1,max($y4,$y5)-0.1,0.1); +} + +$x1orc = random(0,1,1) ? "(" : "["; +$x2orc = $x3 == $x2 ? "]" : ")"; +$x4orc = $x3 == $x4 ? "[" : "("; +$x5orc = random(0,1,1) ? ")" : "]"; + +Context("Interval"); + +$domain1 = Compute("$x1orc $x1,$x2 $x2orc"); +if ($m1 > 0) { + $y1orc = $x1orc eq "(" ? "(" : "["; + $y2orc = ")"; + $range1 = Compute("$y1orc $y1,$y2 $y2orc"); +} else { + $y2orc = "("; + $y1orc = $x1orc eq "(" ? ")" : "]"; + $range1 = Compute("$y2orc $y2,$y1 $y1orc"); +} + +$domain2 = Compute("$x4orc $x4,$x5 $x5orc"); +if ($m2 > 0) { + $y4orc = "("; + $y5orc = $x5orc eq ")" ? ")" : "]"; + $range2 = Compute("$y4orc $y4,$y5 $y5orc"); +} else { + $y5orc = $x5orc eq ")" ? "(" : "["; + $y4orc = ")"; + $range2 = Compute("$y5orc $y5,$y4 $y4orc"); +} + +$domain = $domain1 + $domain2; +$range = Union($range1,$range2); + +$x6 = random($x1+0.5,$x2-0.5,0.5); +$y6 = $func1->eval(x=>$x6); +$x7 = random($x4+0.5,$x5-0.5,0.5); +$y7 = $func2->eval(x=>$x7); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([$x1,$x5],[$y1,$y2,$y4,$y5,0]); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + + add_functions($gr[$i], "$func1 for x in $x1orc $x1,$x2) using color:blue and weight:1"); + add_functions($gr[$i], "$func2 for x in ($x4,$x5 $x5orc using color:blue and weight:1"); + $gr[$i]->stamps( closed_circle($x3,$y3,'blue') ); + +} + +$ALT = "This is the graph of a piecewise function. The left piece if part of a line with the domain $x1orc $x1,$x2). There is a dot on the function at ($x3,$y3). The right piece is part of a line with the domain $x4orc $x4,$x5 $x5orc."; + +$x1s = $x1orc eq '(' ? '\lt' : '\le'; +$x5s = $x5orc eq ')' ? '\lt' : '\le'; + +############################################## + +BEGIN_PGML + +A piecewise function's equation is given: + + [`` +f(x)= +\begin{cases} + [$func1] &\text{if }[$x1] [$x1s] x \lt [$x2] \\ + [$y3] &\text{if }x=[$x3] \\ + [$func2] &\text{if }[$x4]\lt x [$x5s] [$x5] \\ +\end{cases} + ``] + +Sketch the function's graph on scratch paper, and then answer the following questions. + +###Question 1 + +[`f([$x6])=`] [______________]{$y6} + +[`f([$x3])=`] [______________]{$y3} + +[`f([$x7])=`] [______________]{$y7} + +###Question 2 + +* Use *inf* to represent [`\infty`]. +* Use upper case U to represent "union" in set notation. + +The function's domain is [_______________]{$domain}. + +The function's range is [______________]{$range}. + +END_PGML +############################################## + +if ($m1 == 1) { + $s1 = "$x6"; +} elsif ($m1 == -1) { + $s1 = "-($x6)"; +} else { + $s1 = "$m1($x6)"; +} + +if ($b1 == 0) { + $s2 = ""; +} elsif ($b1 < 0) { + $s2 = "$b1"; +} else { + $s2 = "+$b1"; +} + +if ($m2 == 1) { + $s3 = "$x7"; +} elsif ($m2 == -1) { + $s3 = "-($x7)"; +} else { + $s3 = "$m2($x7)"; +} + +if ($b2 == 0) { + $s4 = ""; +} elsif ($b2 < 0) { + $s4 = "$b2"; +} else { + $s4 = "+$b2"; +} + +BEGIN_PGML_SOLUTION + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +###Question 1 + +Since [`[$x1] [$x1s] [$x6] \lt [$x2]`], we use [`f(x)=[$func1]`] to calculate [`f([$x6])`]: + + [`` f([$x6]) = [$s1][$s2] = [$y6] ``] + +Since [`f(x)=[$y3]`] when [`x=[$x3]`], [`f([$x3])=[$y3]`]. + +Since [`x\lt[$x7]`], we use [`f(x)=[$func2]`] to calculate [`f([$x7])`]: + + [`` f([$x7]) = [$s3][$s4] = [$y7] ``] + +###Question 2 + +The segment on the left side starts at [`x=[$x1]`], and we can calculate the corresponding [`y`]-value by [`f([$x1])=[$y1]`]. It ends at [`([$x2],[$y2])`]. + +Similarly, the segment on the right side starts at [`x=[$x4]`], and we can calculate the corresponding [`y`]-value by [`f([$x4])=[$y4]`]. It ends at [`([$x5],[$y5])`]. + +By the graph, the function's domain is [`[$domain]`], and its range is [`[$range]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/PositionVelocity10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/PositionVelocity10.pg new file mode 100644 index 0000000000..91832545d7 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/PositionVelocity10.pg @@ -0,0 +1,143 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "PGML.pl", + "parserFormulaWithUnits.pl", + "parserAssignment.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->variables->are(t=>'Real'); + +$a = random(20,26,2); +$b = non_zero_random(-3,3,1); +$c = random(1,3,1)*100; + +$v = Formula("$a t+$b")->reduce; +$d = $a/2; +$s = Formula("$d t^2+$b t+ $c")->reduce; + +$t1 = random(1.5, 4,0.1); +Context()->flags->set(reduceConstants=>0); +$st1 = $s->substitute(t=>Formula("$t1")); + + +Context()->strings->add("s($t1)"=>{}); + + +$ans[0] = String("s($t1)"); +$ans[1] = $s->eval(t=>$t1); +$ans[1] = FormulaWithUnits($ans[1],"mi"); + +parser::Assignment->Allow; +parser::Assignment->Function("s","v"); + +$vel1 = random(40,70,1); +$ans[2] = Formula("v(t)=$vel1"); +$vel1 = FormulaWithUnits($vel1,"mi/hr"); + +$time = random(1,3,2); +$st2 = $s->substitute(t=>Formula("$time")); +$v2 = $v->eval(t=>$time); +$ans[3] = $s->eval(t=>$time); +$ans[3] = FormulaWithUnits($ans[3],"mi"); +$vel2 = FormulaWithUnits($v2,"mi/hr"); + + +############################################## + + +BEGIN_PGML + +Let [`s(t)=[$s]`], where [`s`] is the position (in mi) of a car driving on a straight road at time [`t`] (in hr). The car's velocity (in mi/hr) at time [`t`] is given by [`v(t)=[$v]`]. + +a. _Using function notation_, express the car's position after [`[$t1]`] hours. The answer here is not a formula, it's just something using function notation like [|f(8)|]*. + [__________] + +a. Where is the car then? The answer here is a number with units. + [__________] + +a. _Use function notation_ to express the question, "When is the car going [`[$vel1]`]?" The answer is an equation that uses function notation; something like [|f(x)=23|]*. You are not being asked to actually solve the equation, just to write down the equation. + [__________] + +a. Where is the car when it is going [`[$vel2]`]? The answer here is a number with units. You are being asked a question about its position, but have been given information about its speed. + [__________] + + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + + +ANS( $ans[0]-> cmp ); +ANS( $ans[1]-> cmp ); +ANS( $ans[2]-> cmp ); +ANS( $ans[3]-> cmp ); + +############################################## + + +Context()->texStrings; + +BEGIN_PGML_SOLUTION + +a. The car's position after [`[$t1]`] hours is [`[@$ans[0]@]`], using function notation and the definition of [`s`]. + +a. [`\begin{aligned}[t] +s([$t1]) &= [$st1]\\ +&=[@$ans[1]@] +\end{aligned}`] + +a. Using function notation and the definition of [`v`], "When is the car going [`[$vel1]`]?" is the same as asking to solve the equation [`[@$ans[2]@]`]. + +a. "...when it is going [`[@$vel2@]`]" means we need to solve + [`\begin{aligned} +v(t) & = [$v2]\\ +[$a] t+[$b] & = [$v2]\\ +[$a] t & = [$v2-$b]\\ +t &= [$time] +\end{aligned}`] +Then we use this time and the formula for [`s`] to find the position at that time: + [`\begin{aligned} +s([$time]) & = [$st2]\\ +&= [@$ans[3]@] +\end{aligned}`] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range20.pg new file mode 100644 index 0000000000..aa1dd18ed3 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range20.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Domain and Range') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Interval"); + +$constant = list_random(4,9,16); +$f = Formula("x^2-$constant"); +$left = random(-5,-3); +$right = random(1,2); + +$answer = Interval("[-$constant,($left)^2-$constant]"); + + + + +############################################## + + +BEGIN_PGML + +Let the function [`f`] be defined by + + [``f(x)=[$f]\quad [$left]\leq x\leq [$right]``] + + +What is the range of this function? It will help if you make a graph of this _function with a restricted domain_. Enter your answer in interval notation. If needed, use *INF* for [`\infty`]. If needed, use *U* for the union symbol. For example, to enter [`(-\infty,0]\cup(2,4)`], type *(-INF,0] U (2,4)*. + +Using interval notation, the range is [_____________________]{$answer}. + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; +$refreshCachedImages=1; + +($xmin, $xmax, $ymin, $ymax, $xticknumber, $yticknumber) = NiceGraphParameters([$left,$right],[-$constant,($left)**2-$constant]); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xticknumber,$yticknumber], +size=>[400,400] +); + +add_functions($gr, "$f for x in <$left,$right>" . + " using color:blue and weight:1"); + +$lo = ($left)**2-$constant; +$ro = ($right)**2-$constant; +$gr->stamps( closed_circle($left,$lo,'blue') ); +$gr->stamps( closed_circle($right,$ro,'blue') ); + +$alt = "a graph of a portion of an upward-opening parabola; the graph begins at ($left,$lo), dips down to its vertex at (0,-$constant), and then rises to ($right, $ro)"; + +Context()->texStrings; +BEGIN_SOLUTION +We first create a graph of \(f\). +$PAR + +\{EnlargeImageStatement()\} +$PAR + +$BCENTER +\{image( insertGraph($gr), +width=>400,height=>400,tex_size=>800, extra_html_tags=>"alt = '$alt'" )\} +$ECENTER +$PAR + +From the graph, we can see that the range of \(f\) is \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range30.pg new file mode 100644 index 0000000000..29606bc6a8 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range30.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Domain and Range') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Interval"); + +$a = random(3,7,1); +$b = random(1,2,1); +$asquared = $a**2; +$f = Formula("sqrt($asquared-x^2)"); + +$left = -$a; +$right = $b; + +$answer = Interval("[0,$a]"); + + + + +############################################## + +BEGIN_PGML + +Let the function [`f`] be defined by + + [``f(x)=[$f]\quad [$left]\leq x\leq [$right]``] + + +What is the range of this function? It will help if you make a graph of this _function with a restricted domain_. Enter your answer in interval notation. If needed, use*INF* for [`\infty`]. If needed, use *U* for the union symbol. For example, to enter [`(-\infty,0]\cup(2,4)`], type *(-INF,0] U (2,4)*. + +Using interval notation, the range is [_____________________]{$answer}. + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; +$refreshCachedImages=1; + +($xmin, $xmax, $ymin, $ymax, $xticknumber, $yticknumber) = NiceGraphParameters([$left,$right],[0,$a]); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xticknumber,$yticknumber], +size=>[400,400] +); + +add_functions($gr, "$f for x in <$left,$right>" . + " using color:blue and weight:1"); + +$lo = sqrt($a**2 - $left**2); +$ro = sqrt($a**2 - $right**2); +$gr->stamps( closed_circle($left,$lo,'blue') ); +$gr->stamps( closed_circle($right,$ro,'blue') ); + +$alt = "a graph of an upper portion of a circle that is centered at the origin; the graph begins at ($left,$lo), curves up to a peak at (0,$a), and then curves back downto ($right, $ro)"; + +Context()->texStrings; +BEGIN_SOLUTION +We first create a graph of \(f\). +$PAR + +\{EnlargeImageStatement()\} +$PAR + +$BCENTER +\{image( insertGraph($gr), +width=>400,height=>400,tex_size=>800, extra_html_tags=>"alt = '$alt'" )\} +$ECENTER +$PAR + +From the graph, we can see that the range of \(f\) is \($answer\). +END_SOLUTION +Context()->normalStrings; + + + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range40.pg new file mode 100644 index 0000000000..1499fc7037 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range40.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Domain and Range') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Interval"); + +$f = Formula("1/x"); +$left = random(-4,-1); +$right = random(2,5); + +$answer = Interval("(-INF,1/$left] U [1/$right,INF)"); + + + + +############################################## + + +BEGIN_PGML + +Let the function [`f`] be defined by + + [``f(x)=[$f]\quad [$left]\leq x\leq [$right], x\neq0``] + + +What is the range of this function? It will help if you make a graph of this _function with a restricted domain_. Enter your answer in interval notation. If needed, use*INF* for [`\infty`]. If needed, use *U* for the union symbol. For example, to enter [`(-\infty,0]\cup(2,4)`], type *(-INF,0] U (2,4)*. + +Using interval notation, the range is [_____________________]{$answer}. + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; +$refreshCachedImages=1; + +($xmin, $xmax, $ymin, $ymax, $xticknumber, $yticknumber) = NiceGraphParameters([$left,$right],[-5,5]); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xticknumber,$yticknumber], +size=>[400,400] +); + +add_functions($gr, "$f for x in <$left,-0.1>" . + " using color:blue and weight:1"); +add_functions($gr, "$f for x in <0.1,$right>" . + " using color:blue and weight:1"); + +$lo = 1/$left; +$ro = 1/$right; +$gr->stamps( closed_circle($left,$lo,'blue') ); +$gr->stamps( closed_circle($right,$ro,'blue') ); + +$gr->lb( new Label($left,2*$lo,"($left,$lo)", + 'black','center','top')); +$gr->lb( new Label($right,2*$ro,"($right,$ro)", + 'black','center','bottom')); + +$alt = "a graph of a function with two components; one component begins at ($left,$lo) and moves downward as we move right, getting closer and closer to the left side of the y-axis, down to minus infinity; the other component comes down on the right side of the y-axis from infinity, and moves rightward some ending at ($right,$ro) "; + +Context()->texStrings; +BEGIN_SOLUTION +We first create a graph of \(f\). +$PAR + +\{EnlargeImageStatement()\} +$PAR + +$BCENTER +\{image( insertGraph($gr), +width=>400,height=>400,tex_size=>800, extra_html_tags=>"alt = '$alt'" )\} +$ECENTER +$PAR + +From the graph, we can see that the range of \(f\) is \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range50.pg new file mode 100644 index 0000000000..066fba5bd9 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Range50.pg @@ -0,0 +1,185 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','function','absolute value') + + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +$showPartialCredit = 1; + +$v = non_zero_random(-5,5); +$a = random(2,8); +$b = random($a + 1,10); +do {$c = random(-10,-2); +$d = random(2,10);} until $c != -1*$d; +$maxcd = max(-1*$c,$d); + +Context("Interval"); + + +$answera =Interval("[$v+$a,$b+$v]"); +$answerb = Interval("[$v,$maxcd+$v]"); +$answerc = Interval("($v,infinity)"); + + +BEGIN_PGML + +Suppose [`h`] is defined by [`h(t) = \left| t \right| + [$v]`]. Find the range of [`h`] if its domain is as indicated. Write your answers as intervals or unions of intervals Use *U* for the union symbol [`\cup`], if needed. Write *inf* for [`\infty`], if needed. + +a) What is the range of [`h`] if the domain of [`h`] is [`[[$a],[$b]]`]? +[__________________________]{$answera} +a) What is the range of [`h`] if the domain of [`h`] is [`[[$c],[$d]]`]? +[__________________________]{$answerb} +a) What is the range of [`h`] if the domain of [`h`] is the set of negative numbers? +[__________________________]{$answerc} + +END_PGML + +############################################ + +$showPartialCorrectAnswers=1; +$refreshCachedImages=1; + +$left = $a; +$right = $b; +$lo = abs($left)+$v; +$ro = abs($right)+$v; +($xmin, $xmax, $ymin, $ymax, $xticknumber, $yticknumber) = NiceGraphParameters([$left,$right,0],[$lo, $ro, 0]); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xticknumber,$yticknumber], +size=>[400,400] +); + +add_functions($gr, "abs(x)+$v for x in <$left,$right>" . + " using color:blue and weight:1"); + +$gr->stamps( closed_circle($left,$lo,'blue') ); +$gr->stamps( closed_circle($right,$ro,'blue') ); + +$alt = "a graph of a line segment that begins at ($left,$lo)and ends at ($right, $ro)"; + + +$left = $c; +$right = $d; +$lo = abs($left)+$v; +$ro = abs($right)+$v; +($xmin, $xmax, $ymin, $ymax, $xticknumber, $yticknumber) = NiceGraphParameters([$left,$right,0],[$lo, $ro, 0, $v]); + +$grb = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xticknumber,$yticknumber], +size=>[400,400] +); + +add_functions($grb, "abs(x)+$v for x in <$left,$right>" . + " using color:blue and weight:1"); + +$grb->stamps( closed_circle($left,$lo,'blue') ); +$grb->stamps( closed_circle($right,$ro,'blue') ); + +$altb = "a graph of two connect line segments that begin at ($left,$lo), meet at (0,$v), and ends at ($right, $ro)"; + + +$left = -10; +$right = 0; +$lo = abs($left)+$v; +$ro = abs($right)+$v; +($xmin, $xmax, $ymin, $ymax, $xticknumber, $yticknumber) = NiceGraphParameters([$left,$right,0],[$lo, $ro, 0]); + +$grc = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xticknumber,$yticknumber], +size=>[400,400] +); + +add_functions($grc, "abs(x)+$v for x in <$xmin,$right>" . + " using color:blue and weight:1"); + +$grc->stamps( open_circle($right,$ro,'blue') ); + +$altc = "a graph of a line segments that begins at ($right, $ro) and extends upward and to the left forever; there is a hollow dot at ($right, $ro) "; + + +Context()->texStrings; +BEGIN_SOLUTION +a. We first create a graph of \(h\). +$PAR + +\{EnlargeImageStatement()\} +$PAR + +$BCENTER +\{image( insertGraph($gr), +width=>400,height=>400,tex_size=>800, extra_html_tags=>"alt = '$alt'" )\} +$ECENTER +$PAR + +From the graph, we can see that the range of \(h\) is \($answera\). +$PAR + +b. We first create a graph of \(h\). +$PAR + +\{EnlargeImageStatement()\} +$PAR + +$BCENTER +\{image( insertGraph($grb), +width=>400,height=>400,tex_size=>800, extra_html_tags=>"alt = '$altb'" )\} +$ECENTER +$PAR + +From the graph, we can see that the range of \(h\) is \($answerb\). +$PAR + +c. We first create a graph of \(h\). +$PAR + +\{EnlargeImageStatement()\} +$PAR + +$BCENTER +\{image( insertGraph($grc), +width=>400,height=>400,tex_size=>800, extra_html_tags=>"alt = '$altc'" )\} +$ECENTER +$PAR + +From the graph, we can see that the range of \(h\) is \($answerc\). +$PAR +END_SOLUTION +Context()->normalStrings; + +###################################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Solve20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Solve20.pg new file mode 100644 index 0000000000..4f44fa2ed4 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Solve20.pg @@ -0,0 +1,133 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserAssignment.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +$showPartialCorrectAnswers = 0; + +$a = random(-10,-2,1); +$b = random(2,10,1); +$c = non_zero_random(-10,10,1); +$d = random(11,20,1); + +$f = RandomVariableName(type=>'function'); + +############################################## + +BEGIN_PGML + +For [`[$f]`] defined by [`[$f](x)= \left|[$a]x +[$b]\right |+[$c]`], solve the equation [`[$f](x) = [$d]`]. Remember that when you are asked to solve an equation for [`x`], the answer should be in the form *x=23*, and not simply give the numerical value of the solution, like 23. If there are two solutions, use the word *or*, as in *x=23 or x=12*. + + [__________________] + +END_PGML + +############################################## + +Context("Fraction"); +$e=$d-$c-$b; +$g=-$d+$c-$b; +$ans1 = Fraction($e,$a); +$ans2= Fraction($g,$a); + +$refreshCachedImages=1; +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +# ANS(List(Formula("x=$ans1"), Formula("x=$ans2"))->cmp(list_checker => ~~&radicalListCheck)); + +Context("Numeric"); +Context()->flags->set(showMixedNumbers=>0); + +parser::Assignment->Allow; +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set(","=>{string=>"or",TeX=>"or ",perl=>","}); + +$answers = Compute("x=$ans1 or x=$ans2"); + +ANS($answers ->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +To solve the equation, we proceed as follows. + + [`\begin{aligned} +[$f](x) +&= [$d]\\ +\left|[$a]x +[$b]\right |+[$c] +&= [$d]\\ +\left|[$a]x +[$b]\right | +&= [$d-$c]\\ +[$a]x +[$b] +&= [$d-$c] +&\mbox{or}&&[$a]x +[$b] +&= [$c-$d]\\ +[$a]x +&= [$d-$c-$b] +&\mbox{or}&&[$a]x +&= [$c-$d-$b]\\ +x +&= [$ans1] +&\mbox{or}&&x +&= [$ans2]\\ +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem.; + + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Solve60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Solve60.pg new file mode 100644 index 0000000000..1e7f4564e9 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/Solve60.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +TEXT(&beginproblem); + +$showPartialCredit = 1; + + +$a=non_zero_random(-9,9,1); +$b=non_zero_random(-9,9,1); +while($b==-2) {$b=non_zero_random(-9,9,1);} +$c=non_zero_random(-9,9,1); +$ans=($c*(2+$b)-$a)/2; + +$f = RandomVariableName(type=>'function'); +$d = RandomVariableName(type=>'constant'); + +############################################## + +BEGIN_PGML + +Consider the function [`[$f]`] defined by +[`\displaystyle [$f](x) = \frac{[$d]x+[$a]}{x+[$b]}`]. + + + If [`[$f](2) = [$c]`], then [`[$d]={}`][____________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We know that [`\displaystyle [$f](2) = [$c]`], so + + [`\begin{aligned} +\frac{[$d](2)+[$a]}{2+[$b]}&=[$c]\\ +\frac{2[$d]+[$a]}{[$b+2]}&=[$c]\\ +2[$d]+[$a] & = [$c*($b+2)]\\ +2[$d] & = [$c*($b+2)-$a]\\ +[$d] & = [$ans]\\ +\end{aligned}`] + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/SolveInequality20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/SolveInequality20.pg new file mode 100644 index 0000000000..afe139f229 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/SolveInequality20.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextRationalFunction.pl", + "PCCmacros.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +TEXT(&beginproblem); + +$showPartialCredit = 1; + +$a = non_zero_random(-10,10,1); + +$b = random(1,10,1); +$c=$a-$b; +$d=$a+$b; + +Context("Interval"); +$f = RandomVariableName(type=>'function'); +$ans = Compute("(-infinity,$c)U($d,infinity)"); + +############################################## + +BEGIN_PGML + +Given [` [$f](x) = \left|x - [$a]\right| `], find all values of [` x`] such that [`[$f](x) > [$b]`]. Write your answer in interval notation. + +*Note:* If the answer includes more than one interval, write the intervals separated by the "union" symbol, U. If needed enter [`\infty`] as *inf* and [`-\infty`] as *-inf*. + + [______________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`\begin{aligned} +[$f](x) & > [$b]\\ +\left|x - [$a]\right| & > [$b]\\ +x - [$a] & > [$b] &\mbox{or}&&x - [$a] & <- [$b] \\ +x & > [$b+$a] &\mbox{or}&&x & < [$a-$b] \\ +\end{aligned}`] + +So the solution set is [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/SolveInequality30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/SolveInequality30.pg new file mode 100644 index 0000000000..0be07426d2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/SolveInequality30.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + "contextFraction.pl", +); + +############################################## + +TEXT(&beginproblem); + +$showPartialCorrectAnswers = 1; + +$a = random(1,10,1); +$b = random(11,20,1); +$c = random(2,5,1); + +Context("Fraction"); +$ans1 = Fraction($a-$b,$c); +$ans2 = Fraction($a+$b,$c); + +Context("Interval"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$ans = Compute("[$ans1,$ans2]"); + +$f = RandomVariableName(type=>'function'); + +############################################## + +BEGIN_PGML + +Given [` [$f](x) = \left|[$c]x - [$a]\right| `], find all values of [` x`] such that [`[$f](x) \leq [$b]`]. Write your answer in interval notation. + +*Note:* If the answer includes more than one interval, write the intervals separated by the "union" symbol, U. If needed enter [`\infty`] as *inf* and [`-\infty`] as *-inf*. + + [______________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`\begin{aligned} +[$f](x) & \leq [$b]\\ +\left|[$c]x - [$a]\right| & \leq [$b]\\ +[$c]x - [$a] & \leq [$b] &\mbox{and}&&[$c]x - [$a] & \geq -[$b] \\ +[$c]x & \leq [$b+$a] &\mbox{and}&&[$c]x & \geq [$a-$b] \\ +x & \leq [$ans2] &\mbox{and}&&x & \geq [$ans1] \\ +\end{aligned}`] + +So the solution set is [`\left[ [$ans1],[$ans2]\right] `]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/VariousQuestions10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/VariousQuestions10.pg new file mode 100644 index 0000000000..e0d1291806 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/VariousQuestions10.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "pccTables.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +do { +$n = random( 2,6,1); +$m = random($n,7,1); +} until (gcd($m,$n) == 1); + +$a = $m**2 - $n**2; +$b = 2*$m*$n; +$c = $m**2 + $n**2; + + +$f = Formula("sqrt(x^2+$b**2)-$c"); + +$ans[0] = Compute($b - $c); + +$ans[2] = Compute("0"); + +Context("Point"); +$ans[3] = Point(0,$b - $c); +$ans[4] = List("(-$a,0),($a,0)"); + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + + +$ans[1] = List(Formula("x=-$a"),Formula("x=$a")); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Let \(f(x)=$f\).$PAR + +\{ +LayoutTable( +[["$BBOLD(a)$EBOLD Find \(f(0)\).",ans_rule(20)], +["$BBOLD(b)$EBOLD Solve \(f(x)=0\).",ans_rule(20)], +["$BBOLD(c)$EBOLD Find \(f($a)\).",ans_rule(20)], +["$BBOLD(d)$EBOLD What is the vertical intercept of the graph of \(f(x)\)? $BR Recall that intercepts are points, not numbers.",ans_rule(20)], +["$BBOLD(e)$EBOLD Where does the graph cross the \(x\)-axis? $BR Recall that intercepts are points, not numbers.",ans_rule(20)]], +allcellcss=>"padding-left:6pt; padding-right:6pt; text-align:left;", +texalignment=>"Xl", +); +\} + +$PAR +Remember that the vertical intercept is a point, and so it should be entered as an $BITALIC ordered pair$EITALIC. If you need to enter more than one point for an answer, use commas to separate them like in this list of points: $BBOLD(1,4), (2,3)$EBOLD. + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers=1; + + +ANS( $ans[0]-> cmp ); +ANS( $ans[1]-> cmp ); +ANS( $ans[2]-> cmp ); +ANS( $ans[3]-> cmp ); +ANS( $ans[4]-> cmp ); + +############################################## + +BEGIN_PGML_SOLUTION + +a. [`\begin{aligned}[t] +f(0) & = \sqrt{0^2+[$b**2]}-[$c]\\ +& = \sqrt{[$b**2]}-[$c]\\ +& = [$b]-[$c]\\ +& = [$b-$c]\\ +\end{aligned}`] + +a. [`\begin{aligned}[t] +f(x) & = 0\\ +\sqrt{x^2+[$b**2]}-[$c]& =0\\ +\sqrt{x^2+[$b**2]}&=[$c]\\ +x^2+[$b**2]&=[$c**2]\\ +x^2&=[$a**2]\\ +x& = [$a] &\mbox{or}&& x&=-[$a]\\ +\end{aligned}`] + +a. [`\begin{aligned}[t] +f([$a]) & = \sqrt{[$a]^2+[$b**2]}-[$c]\\ +& = \sqrt{[$c**2]}-[$c]\\ +& = [$c]-[$c]\\ +& = 0\\ +\end{aligned}`] + +a. The vertical intercept is a point along the vertical axis, which means that [`x=0`]. Since we already found [`f(0)=[$b-$c]`], the vertical intercept is at [`[@$ans[3]@]`]. + +a. The horizontal intercepts are points along the horizontal axis, which means that [`f(x)=0`]. Since we already found solutions to [`f(x)=0`], the horizontal intercepts are at [`[@$ans[4]@]`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/graphs_of_functions_12.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/graphs_of_functions_12.pg new file mode 100644 index 0000000000..14d9777a89 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/graphs_of_functions_12.pg @@ -0,0 +1,107 @@ + DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGchoicemacros.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGcourse.pl", +); + + +################################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +#GRAPH + +$a1=random(1,2); +$a2=list_random(-1,1); +$a3=random(2,4); +$xdom1=2*$a3; +$xgriddom=2*$a3+1; +$x1 = 2*$a3; +$x2 = -$a3; +$g1 = $a2*(-0.25*$a1*$x1); +$g2 = $a2*(-0.25*$a1*$x2); +$xpeak = 2*3.14-acos($a1*$a2/4/3.14); +$peak = $a2*(-$a1/4*$a3/3.14*$xpeak+ 3.14/$a3*sin(3.14/$a3*$xpeak)); +$ymax= int(max(abs($peak),abs($g1) ,abs($g2) )) + 1; +$ymin = -$ymax; + +if ($a2 > 0) {$str = "negative";} +else {$str = "positive";} +if ($a1 == 1) { + if ($a3 == 2) {$int1 = 1.5;} + if ($a3 == 3) {$int1 = 2.5;} + if ($a3 == 4) {$int1 = 3;} +} +if ($a1 == 2) { + $int1 = 2; + if ($a3 == 2) {$int1 = 1.5;} +} + +$b = $a1*non_zero_random(-10,10)*0.01; + +$xgrid=2*$xgriddom; +$graph = init_graph(-$xgriddom,$ymin,$xgriddom,$ymax,'axes'=>[0,0],'grid'=>[$xgrid, $ymax - $ymin]); +$f = FEQ("$a2*(-0.25*$a1*x + sin(pi/$a3*x)) for x in [-$xdom1,$xdom1] using color:blue and weight:1"); +($fref) = plot_functions( $graph, $f); + +################################################## + +BEGIN_PGML +Use the the graph of [`g`] to answer the questions. Assume the domain of [`g`] is [`[-[$xdom1],[$xdom1]]`]. + +[@EnlargeImageStatementPGML()@]** + +>>[@ image(insertGraph($graph), height=>400, width=>400) @]* << + + +a) [`g([$x1]) ={}`][_______________] + +a) [`g([$x2]) ={}`][_______________] + +a) For _how many_ values of [`x`] does [`g(x) = [$b]`]? + + [______] + +a) On what interval or union of intervals is [`g`] [$str]? (You may round to the nearest half of a unit.) + + [_____________________________] + +END_PGML + +################################################## + +Context("Numeric"); +Context()->flags->set(tolerance=>0.2); +Context()->flags->set(tolType=>'absolute'); +ANS(Compute($g1)->cmp()); +ANS(Compute($g2)->cmp()); + +ANS(Compute(3)->cmp(tolerance=>0.0001)); + +Context("Interval"); +Context()->flags->set(ignoreEndpointTypes => 1); +ANS(Compute("(-$int1,0)U($int1,$xdom1)")->cmp()); + +################################################## + +BEGIN_PGML_SOLUTION + +a) To find [`g([$x1])`], locate [`[$x1]`] on the horizontal axis. Then move straight up or down until you find the curve. The point where this happens has coordinates [`([$x1],[$g1])`]. So [`g([$x1])=[$g1]`]. + +a) To find [`g([$x2])`], locate [`[$x2]`] on the horizontal axis. Then move straight up or down until you find the curve. The point where this happens has coordinates [`([$x2],[$g2])`]. So [`g([$x2])=[$g2]`]. + +a) If we were trying to solve [`g(x)=[$b]`], we would consider the horizontal line [`y=[$b]`]. This line crosses the graph of [`g`] in [`3`] places, so there are [`3`] solutions to [`g(x)=[$b]`]. + +a) There are two segments of the curve where [`g`] is [$str]. One is the hump from [`x=-[$int1]`] to [`x=0`], and the other is the tail from [`x=[$int1]`] to [`x=[$xdom1]`]. So the region on which [`g`] is [$str] is [`(-[$int1],0)\cup([$int1],[$xdom1])`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/new_problem_142.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/new_problem_142.pg new file mode 100644 index 0000000000..15efbbf90d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/new_problem_142.pg @@ -0,0 +1,93 @@ + DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGcourse.pl", +); + +################################################## +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +$refreshCachedImages = 1; + +#GRAPH +#f(x) has relative extrema at 0, $a, $b, and $c + +$a = random(-3,-1); +$b = random(1,3); +$c = random($b+1,5); + +$xmin = $a - 1; +$xmax = $c + 1; + +$pmax = $xmax+1; +$pmin = $xmin-1; + +$f = FEQ("x^2*(1/5*x^3 - ($a + $b + $c)/4*x^2+($a*$b + $a*$c + $b*$c)/3*x - $a*$b*$c/2) for x in [$pmin,$pmax] using color:blue and weight:1"); + +$ymin = +min( + floor( + min($c**2*(1/5*$c**3 - ($a + $b + $c)/4*$c**2+($a*$b + $a*$c + $b*$c)/3*$c - $a*$b*$c/2), + $xmin**2*(1/5*$xmin**3 - ($a + $b + $c)/4*$xmin**2+($a*$b + $a*$c + $b*$c)/3*$xmin - $a*$b*$c/2))), +-10); + +$ymax = +max( + ceil( + max($a**2*(1/5*$a**3 - ($a + $b + $c)/4*$a**2+($a*$b + $a*$c + $b*$c)/3*$a - $a*$b*$c/2), + $b**2*(1/5*$b**3 - ($a + $b + $c)/4*$b**2+($a*$b + $a*$c + $b*$c)/3*$b - $a*$b*$c/2), + $xmax**2*(1/5*$xmax**3 - ($a + $b + $c)/4*$xmax**2+($a*$b + $a*$c + $b*$c)/3*$xmax - $a*$b*$c/2))), +10); + +$ymin = floor($ymin/10)*10; +$ymax= ceil($ymax/10)*10; + +$graph = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0],'grid'=>[$xmax - $xmin, ($ymax-$ymin)/10]); + +($fref) = plot_functions( $graph, $f); + +$fname = RandomVariableName(type=>'function'); + +################################################## +BEGIN_PGML + +Use the graph of [`[$fname]`] to fill in the blanks and complete each sentence. Assume that the domain of [`[$fname]`] is [`(-\infty,\infty)`]. + +[@EnlargeImageStatementPGML()@]** + +>> [@ image(insertGraph($graph),height=>400,width=>400) @]* << + + +a) [`[$fname]`] has relative minima at [`x`] in the set [`\Big\{`] [___________] [`\Big\}`]. (Use commas to separate members of the set.) + +a) [`[$fname]`] has relative maxima at [`x`] in the set [`\Big\{`] [___________] [`\Big\}`]. (Use commas to separate members of the set.) + +a) [`[$fname]`] has a [`y`]-intercept at [`x={}`] [____________]. + +END_PGML + +################################################## + +ANS(Compute("0,$c")->cmp); +ANS(Compute("$a,$b")->cmp); +ANS(Compute(0)->cmp); + +################################################## + +BEGIN_PGML_SOLUTION + +a) A relative minimum happens where the graph of a function, as read from left to right, changes from moving downward to moving upward. In the graph of [`[$fname]`] we see this happening at [`x=0`] and at [`x=[$c]`]. + +a) A relative maximum happens where the graph of a function, as read from left to right, changes from moving upward to moving downward. In the graph of [`[$fname]`] we see this happening at [`x=[$a]`] and at [`x=[$b]`]. + +a) The [`y`]-intercept of a function is a point on the [`y`]-axis where the graph crosses it (if there even is such a point). So by definition, if there even is a [`y`]-intercept, it happens where [`x=0`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/new_problem_337.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/new_problem_337.pg new file mode 100644 index 0000000000..773345b7c6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionBasics/new_problem_337.pg @@ -0,0 +1,110 @@ + DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGcourse.pl", +); + +################################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +$refreshCachedImages = 1; +#GRAPH +#f(x) = +/-(ax^3 - $bx) + +$sign = list_random(-1,1); + +$a = random(1,3); +$b = list_random(3*$a,12*$a); + +$relmax = $sign*-sqrt($b / (3*$a)); +$relmin = $sign*sqrt($b / (3*$a)); + +$xmin = min($relmax - 2,$relmin - 2); +$xmax = max($relmin + 2,$relmax + 2); +$ymin = min($sign*($a*($relmin)**3 - $b*($relmin)), $sign*($a*($relmax)**3 - $b*($relmax))); +$ymax = max($sign*($a*($relmin)**3 - $b*($relmin)), $sign*($a*($relmax)**3 - $b*($relmax))); +TEXT($ymin); +$ymingraph = floor(1.5*$ymin/10)*10; +$ymaxgraph = ceil(1.5*$ymax/10)*10; + + + +$graph = init_graph($xmin,$ymingraph,$xmax,$ymaxgraph,'axes'=>[0,0],'grid'=>[$xmax - $xmin, ($ymaxgraph - $ymingraph)/5]); +$start = $xmin - 1; +$stop = $xmax + 1; +$f = FEQ("$sign*($a*x^3-$b*x) for x in [$start,$stop] using color:blue and weight:1"); + +($fref) = plot_functions( $graph, $f); + +$fname = RandomVariableName(type=>'function'); + +################################################## + +BEGIN_PGML + +Use the graph of [`[$fname]`] to fill in the blanks and complete each sentence. Assume that the domain of [`[$fname]`] is [`(-\infty,\infty)`]. + +[@EnlargeImageStatementPGML()@]** + +>> [@ image(insertGraph($graph),height=>400,width=>400) @]* << + + +a) [`[$fname]`] has a relative minimum at [`x = {}`][________] with a value of [________]. + +a) [`[$fname]`] has a relative maximum at [`x = {}`][________] with a value of [________]. + +a) In the following question, if there is more than one interval for the answer, list the intervals using commas to separate them. A union is not appropriate. For example, write [|[1,2],[3,4]|] for [`[1,2], [3,4]`]. Write [|inf|] for [`\infty`] and [|-inf|] for [`-\infty`]. Remember to assume that the domain of [`[$fname]`] is [`(-\infty,\infty)`]. + + [`[$fname]`] is decreasing on the interval(s) [________________________]. + +a) In the following question, if there is more than one interval for the answer, list the intervals using commas to separate them. A union is not appropriate. For example, write [|[1,2],[3,4]|] for [`[1,2], [3,4]`]. Write [|inf|] for [`\infty`] and [|-inf|] for [`-\infty`]. Remember to assume that the domain of [`[$fname]`] is [`(-\infty,\infty)`]. + + [`[$fname]`] is increasing on the interval(s) [________________________]. + +END_PGML + +################################################## +Context("Interval"); +Context()->flags->set(ignoreEndpointTypes=>1); + + + +if ($sign < 0) { +$ansc = Compute("(-infinity,$relmin),($relmax,infinity)"); +$ansd = Compute("($relmin,$relmax)"); +} +else { +$ansc = Compute("($relmax,$relmin)"); +$ansd = Compute("(-infinity,$relmax),($relmin,infinity)"); +} + +ANS(Compute($relmin)->cmp); +ANS(Compute($ymin)->cmp); +ANS(Compute($relmax)->cmp); +ANS(Compute($ymax)->cmp); +ANS($ansc->cmp()); +ANS($ansd->cmp()); + +################################################## + +BEGIN_PGML_SOLUTION + +a) A relative minimum happens where the graph of a function, as read from left to right, changes from moving downward to moving upward. In the graph of [`[$fname]`] we see this happening at [`x=[$relmin]`]. And the graph show us that [`[$fname]([$relmin])=[$ymin]`]. + +a) A relative maximum happens where the graph of a function, as read from left to right, changes from moving upward to moving downward. In the graph of [`[$fname]`] we see this happening at [`x=[$relmax]`]. And the graph show us that [`[$fname]([$relmax])=[$ymax]`]. + +a) [`[$fname]`] is decreasing on [`[$ansc]`]. + +a) [`[$fname]`] is increasing on [`[$ansd]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient10.pg new file mode 100644 index 0000000000..71bc48fbff --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient10.pg @@ -0,0 +1,81 @@ +## DESCRIPTION +## Algebra - difference quotient +## ENDDESCRIPTION + +## KEYWORDS('Algebra','Functions','Evaluation') +## Tagged by dgt5v +DOCUMENT(); # This should be the first executable line in the problem. + +############################################### + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedFactor.pl", + "contextLimitedPolynomial.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################### + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +do {$a = non_zero_random(2,8,1); +$b = non_zero_random(-8,8,1);} until (gcd($a,$b) == 1); + +Context("LimitedFactor"); +Context()->variables->add(a=>'Real', h=>'Real'); +Context()->flags->set(factorableObject=>'expression'); + +do {$fn = RandomVariableName()} until ($fn ne "x" and $fn ne "a" and $fn ne "h"); +$f = Formula("$a x + $b")->reduce; + +$ans1 = Formula("$a*a+$b")->reduce; +$ans2 = Formula("$a*a+$a*h+$b"); +$ans3 = Formula("$a"); + +############################################### + +BEGIN_PGML + +Given the function [`[$fn]`] defined by [`[$fn](x)=[$f]`], expand and simplify the following expressions: + +a) [`[$fn](a)={}`][_____________________]{$ans1} + +a) [`[$fn](a+h)={}`][_____________________]{$ans2} + +a) [`\displaystyle \frac{[$fn](a+h)-[$fn](a)}{h}={}`][_____________________]{$ans3} + +END_PGML + +############################################### + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +[$fn](a) &= [@$f->substitute(x=>Formula("a"))@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +[$fn](a+h) &= [@$f->substitute(x=>Formula("a+h"))@]\\ +&=[$ans2] +\end{aligned}`] + +a) [`\begin{aligned}[t] +\frac{[$fn](a+h)-[$fn](a)}{h} &= \frac{[@$f->substitute(x=>Formula("a+h"))@]-\left([$ans1]\right)}{h}\\ +&= \frac{[$ans2]-\left([$ans1]\right)}{h}\\ +&= \frac{[$a] h}{h}\\ +&=[$ans3] +\end{aligned}`] + + +END_PGML_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient20.pg new file mode 100644 index 0000000000..524e041b1d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient20.pg @@ -0,0 +1,102 @@ +## DESCRIPTION +## Algebra - difference quotient +## ENDDESCRIPTION + +## KEYWORDS('Algebra','Functions','Evaluation') +## Tagged by dgt5v + +############################################### + +DOCUMENT(); # This should be the first executable line in the problem. + +############################################### + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedFactor.pl", + "contextLimitedPolynomial.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################### + + +TEXT(beginproblem()); + +$a = non_zero_random(2,8,1); +do {$b = non_zero_random(-8,8,1);} until $a != $b; +$d = random(2,6); + +Context("LimitedFactor"); +Context()->variables->add(h=>'Real'); +Context()->flags->set(factorableObject=>'expression'); + +do {$fn = RandomVariableName()} until ($fn ne "x"); +$f = Formula("$a x^2 + $b x")->reduce; + +$ans1 = Real($a*($d)**2+$b*$d); + +$u = $a*$d**2+$b*$d; +$v = 2*$a*$d+$b; + +$ans2 = Formula("$u + $v h + $a h^2")->reduce; +$ans3 = Formula("$v+$a h")->reduce; + + +############################################### + +BEGIN_PGML + +Given the function [`[$fn]`] defined by [`[$fn](x)=[$f]`], expand and simplify the following expressions: + +a) [`[$fn]([$d])={}`][_____________________]{$ans1} + +a) [`[$fn]([$d]+h)={}`][_____________________]{$ans2} + +a) [`\displaystyle \frac{[$fn]([$d]+h)-[$fn]([$d])}{h}={}`][_____________________]{$ans3} + +END_PGML + +############################################### + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(reduceConstants=>0); + +$s = Formula("$d^2+2*$d*h+h^2")->reduce; +$s2 = Formula("$b*$d+$b*h")->reduce; +$s3 = Formula("$d^2*$a+2*$d*$a*h+h^2")->reduce; + + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +[$fn]([$d]) &= [@$f->substitute(x=>Formula("$d"))@]\\ +&=[$ans1] +\end{aligned}`] + +a) [`\begin{aligned}[t] +[$fn]([$d]+h) &= [@$f->substitute(x=>Formula("$d+h"))@]\\ +&=[$a]\left([$s]\right)+[$s2]\\ +&=[$s3]+[$s2]\\ +&=[$ans2] +\end{aligned}`] + +a) [`\begin{aligned}[t] +\frac{[$fn]([$d]+h)-[$fn]([$d])}{h} &= \frac{[$ans2]-\left([$ans1]\right)}{h}\\ +&= \frac{[$v] h+[$a] h^2}{h}\\ +&=[$ans3] +\end{aligned}`] + + +END_PGML_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient30.pg new file mode 100644 index 0000000000..4ac5ef8507 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient30.pg @@ -0,0 +1,134 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Coordinates and Graphs') +## DBsection('Graphs of Equations') +## KEYWORDS('function','table','graph') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextRationalFunction.pl", + "PCCmacros.pl", + "contextFraction.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", + +); + +############################################## + +TEXT(&beginproblem); + +$showPartialCorrectAnswers = 1; + + + + +$d = list_random(11, 13, 17, 19, 23); +do {$a = random(6,22);} until $d - $a > 0 && $d - $a < 6; +# make sure the answers a + b and c + b are relatively prime +$b=$d - $a; +$c = random(2,4); + +$f = RandomVariableName(type=>'function'); + +Context("Fraction"); +$s = Fraction($c-$a,$c+$b); +($sa, $sb) = $s->value; +$sign = ($sa/abs($sa) == 1) ? '-' : '+'; +$sa = abs($sa); + +Context("RationalFunction"); +Parser::Number::NoDecimals(); +Context()->operators->set( +'+' => {class => 'bizarro::BOP::add', isCommand => 1}, +'-' => {class => 'bizarro::BOP::subtract', isCommand => 1}, +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'**' => {class => 'bizarro::BOP::power', isCommand => 1, perl=>undef}, +'^' => {class => 'bizarro::BOP::power', isCommand => 1, perl=>undef}, +); + +$t = Compute("-$a*$sb$sign$sa*$b"); +$apb = $a+$b; +$cpb = $c+$b; + +$ans = Formula("$apb/($cpb(x+$b))")->reduce; + +############################################## + +BEGIN_PGML + +Consider the function [`[$f]`] defined by [`\displaystyle [$f](x) = \frac{x-[$a]}{x+[$b]}`]. +Evaluate and simplify the expression [`\displaystyle\frac{[$f](x)-[$f]([$c])}{x-[$c]}`]. + + + [`\displaystyle \frac{[$f](x)-[$f]([$c])}{x-[$c]} ={}`][___________________________________________] + +END_PGML + +############################################## + +ANS($ans -> cmp( +checker=>sub{ +my ( $correct, $student, $ansHash ) = @_; +return 0 if $ansHash->{isPreview} || $correct != $student; +$student = $ansHash->{student_formula}; +$correct = $correct->{original_formula} if defined $correct->{original_formula}; +$student = Formula("$student"); $correct = Formula("$correct"); +return 0 unless ($correct == $student); +Context()->flags->set(bizarroDiv =>1 ); +delete $correct->{test_values}, $student->{test_values}; +my $OK = (($correct == $student) or ($student == $correct)); +Context()->flags->set(bizarroDiv =>0); +Value::Error("Your answer is correct so far, but please simplify it further") unless $OK; +return $OK; +})); + + +Context("Fraction"); +$s = Fraction($c-$a,$c+$b); +($sa, $sb) = $s->value; +$sign = ($sa/abs($sa) == 1) ? '-' : '+'; +$sa = abs($sa); + + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} +\frac{[$f](x)-[$f]([$c])}{x-[$c]} +&= \frac{\frac{x-[$a]}{x+[$b]}-\frac{[$c]-[$a]}{[$c]+[$b]}}{x-[$c]}\\ +&= \frac{\frac{x-[$a]}{x+[$b]}[$sign]\frac{[$sa]}{[$sb]}}{x-[$c]}\\ +&= \frac{\frac{x-[$a]}{x+[$b]}[$sign]\frac{[$sa]}{[$sb]}}{x-[$c]}\frac{[$sb](x+[$b])}{[$sb](x+[$b])}\\ +&= \frac{[$sb](x-[$a])[$sign][$sa](x+[$b])}{[$sb](x+[$b])(x-[$c])}\\ +&= \frac{[$apb](x-[$c])}{[$sb](x+[$b])(x-[$c])}\\ +&= [$ans]\\ +\end{aligned}``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient40.pg new file mode 100644 index 0000000000..1a94887d26 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient40.pg @@ -0,0 +1,95 @@ +## DESCRIPTION +## Algebra - difference quotient +## ENDDESCRIPTION + +## KEYWORDS('Algebra','Functions','Evaluation') +## Tagged by dgt5v + +############################################### + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedFactor.pl", + "parserOneOf.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################### + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = non_zero_random(2,8,1); + +Context("LimitedFactor"); +Context()->variables->add(a=>'Real', h=>'Real'); +Context()->flags->set(factorableObject=>'expression'); + +do {$fn = RandomVariableName()} until ($fn ne "x"); +$f = Formula("$a/x"); + +$ans1 = Formula("$a/a"); +$ans2 = Formula("$a/(a+h)"); +$ans3 = Formula("-$a/(a(a+h))"); + + +############################################### + +BEGIN_PGML + +Given the function [`[$fn]`] defined by [`[$fn](x)= [$f]`], expand and simplify the following expressions: + +a) [`[$fn](a)={}`][_____________________]{$ans1} + +a) [`[$fn](a+h)={}`][_____________________]{$ans2} + +a) [`\displaystyle \frac{[$fn](a+h)-[$fn](a)}{h}={}`][_____________________] + +END_PGML + +############################################### + +ANS($ans3 -> cmp()->withPostFilter(AnswerHints( + Formula("-$a/(a^2+a h)") => ["Factor the denominator",replaceMessage=>1] +))); + + +############################################### + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +[$fn](a) &= [@$f->substitute(x=>Formula("a"))@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +[$fn](a+h) &=[$ans2] +\end{aligned}`] + +a) [`\begin{aligned}[t] +\frac{[$fn](a+h)-[$fn](a)}{h} &= \frac{[$ans2]-\left([$ans1]\right)}{h}\\ +&= \frac{[$ans2]-\left([$ans1]\right)}{h}\cdot\frac{a+h}{a+h}\\ +&= \frac{[$a]-\left([$ans1]\right)(a+h)}{h(a+h)}\\ +&= \frac{[$a]-\left([$ans1]\right)(a+h)}{h(a+h)}\cdot\frac{a}{a}\\ +&= \frac{[$a]a-[$a](a+h)}{ha(a+h)}\\ +&= \frac{[$a]a-[$a]a-[$a]h}{ha(a+h)}\\ +&= \frac{-[$a]h}{ha(a+h)}\\ +&=[$ans3] +\end{aligned}`] + + +END_PGML_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient50.pg new file mode 100644 index 0000000000..8d37ba3c9b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient50.pg @@ -0,0 +1,71 @@ +############################################### +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedFactor.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################### + +TEXT(beginproblem()); + +$a = random(2,4); +$b = list_random(-5-4,-3,-2,2,3,4,5); +$c = non_zero_random(-6,6); +$k = random(1,3); + +Context("LimitedFactor"); +Context()->flags->set(factorableObject=>'expression'); +Context()->noreduce('(-x)+y', '(-x)-y'); + +do {$fn = RandomVariableName()} until ($fn ne "x"); +$f = Formula("$a x^2 + $b x + $c.")->reduce; + +$q = 2*$a*$k + $b; +$ans = Formula("$q+ $a*x"); + +############################################### + +BEGIN_PGML + +Define a function [`[$fn]`] by + [``[$fn](x)=[$f]``] + +Find and simplify the given expression. + + [`\displaystyle \frac{[$fn]([$k]+x)-[$fn]([$k])}{x}={}`][_____________________]{$ans} + +END_PGML + +############################################### + +Context()->flags->set(reduceConstants=>0); + +$s = Formula("$a ($k^2+2*$k x+ x^2) + $b*($k+x) + $c")->reduce; +$s2 = Formula("$a*$k^2+2*$a*$k x+ $a*x^2 + $b*$k+$b*x + $c")->reduce; +$s3 = Formula("(2*$a*$k+$b) x+ $a*x^2")->reduce; + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +[`\begin{aligned}[t] +\frac{[$fn]([$k]+x)-[$fn]([$k])}{x} +&= \frac{[@$f->substitute(x=>Formula("[$k]+x"))@]-\left([@$f->substitute(x=>Formula("[$k]"))@]\right)}{x}\\ +&= \frac{[$s]-\left([@$f->eval(x=>$k)@]\right)}{x}\\ +&= \frac{[$s2]-\left([@$f->eval(x=>$k)@]\right)}{x}\\ +&= \frac{[$s3]}{x}\\ +&=[$ans] +\end{aligned}`] + + +END_PGML_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient60.pg new file mode 100644 index 0000000000..a813cd3219 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/DifferenceQuotient60.pg @@ -0,0 +1,101 @@ +## DESCRIPTION +## Algebra and Number Theory +## ENDDESCRIPTION + +## KEYWORDS('algebra', 'functions', 'definition of function', 'function evaluation') +## Tagged by XW + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Combining Functions') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +############################################### + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedFactor.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################### + +TEXT(beginproblem()); + +$a = non_zero_random(2,9); + +Context("LimitedFactor"); +Context()->variables->add(a=>'Real', h=>'Real'); +Context()->flags->set(factorableObject=>'expression'); + +do {$fn = RandomVariableName()} until ($fn ne "x"); +$f = Formula("1/(x+$a)"); + +$ans1 = Formula("1/(a+$a)"); +$ans2 = Formula("1/(a+h+$a)"); +$ans3 = Formula("-1/((a+h+$a)(a+$a))"); + + +############################################### + +BEGIN_PGML + +Given the function [`[$fn]`] defined by [`[$fn](x)= [$f]`], expand and simplify the following expressions: + +a) [`[$fn](a)={}`][_____________________]{$ans1} + +a) [`[$fn](a+h)={}`][_____________________]{$ans2} + +a) [`\displaystyle \frac{[$fn](a+h)-[$fn](a)}{h}={}`][_____________________] + +END_PGML + +############################################### + + +ANS($ans3 -> cmp()->withPostFilter(AnswerHints( + Formula("-$a/(a^2+a h)") => ["Factor the denominator",replaceMessage=>1] +))); + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +[$fn](a) &= [@$f->substitute(x=>Formula("a"))@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +[$fn](a+h) &=[$ans2] +\end{aligned}`] + +a) [`\begin{aligned}[t] +\frac{[$fn](a+h)-[$fn](a)}{h} &= \frac{[$ans2]-\left([$ans1]\right)}{h}\\ +&= \frac{[$ans2]-\left([$ans1]\right)}{h}\cdot\frac{a+h+[$a]}{a+h+[$a]}\\ +&= \frac{1-\left([$ans1]\right)(a+h+[$a])}{h(a+h+[$a])}\\ +&= \frac{1-\left([$ans1]\right)(a+h+[$a])}{h(a+h+[$a])}\cdot\frac{a+[$a]}{a+[$a]}\\ +&= \frac{a+[$a]-(a+h+[$a])}{h(a+h+[$a])(a+[$a])}\\ +&= \frac{a+[$a]-a-h-[$a]}{h(a+h+[$a])(a+[$a])}\\ +&= \frac{-h}{h(a+h+[$a])(a+[$a])}\\ +&=[$ans3] +\end{aligned}`] + + +END_PGML_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition1.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition1.pg new file mode 100644 index 0000000000..468262d304 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition1.pg @@ -0,0 +1,55 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); +$showPartialCredit = 1; + +$str = list_random("a","b","c"); + +$a=random(2,6); +$b=non_zero_random(-5,5,1); +do{$d=non_zero_random(-5,5,1);} until $b != $d; + +Context("Fraction"); +$ans = Fraction($a*$d + $b - $d,$b); + +############################################## + +BEGIN_PGML +Find a number [`[$str]`] such that [`f \circ g = g \circ f`], where [`f(x) = [$a] x + [$b]`] and [`g(x) = [$str] x + [$d]`]. + + [`[$str] ={}`][______________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[``\begin{aligned} +f \circ g &= g \circ f\\ +\left(f \circ g\right)(x) &=\left(g \circ f\right)(x)\\ +f\left(g\left(x\right)\right)&=g\left(f\left(x\right)\right)\\ +f\left([$str] x + [$d]\right)&=g\left([$a] x + [$b]\right)\\ +[$a]\left([$str] x + [$d]\right)+[$b]&=[$str]\left([$a] x + [$b]\right)+[$d]\\ +[$a][$str] x + [$a*$d+$b]&=[$a][$str] x + [$b][$str]+[$d]\\ +[$a*$d+$b-$d]&= [$b][$str]\\ +[$ans]&= [$str]\\ +[$str] &= [$ans] +\end{aligned}``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition10.pg new file mode 100644 index 0000000000..6277d63275 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition10.pg @@ -0,0 +1,147 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','function') + + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +########################################### + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +########################################### +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +do {$fname = RandomVariableName()} until ($fname ne "x"); +$a = random(2,8,1); +$b = random(1,8,1); +$c = random(1,8,1); +$d = random(2,5,1); +$f = Formula("$a x^2 + $b x - $c")->reduce; + +$k1 = 2*$a +$b; +$k2 =$a+$b-$c; + +Context("LimitedNumeric"); + +$ans1 = Real($f->eval(x=>0)); +$ans2 = Real($f->eval(x=>$d)); +$ans3 = Real($f->eval(x=>-$d)); + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +Parser::Number::NoDecimals(); + +$ans4 = $f->substitute(x=>Formula("pi")); +$ans4 = Compute("$a*pi**2 + $b*pi - $c"); + +Context("LimitedPolynomial"); +Context()->flags->set(singlePowers=>1); + +$ans5 = Formula("$a*x**2+$k1*x + $k2")->reduce; +$ans6 = Formula("$a*x**2 - $b*x - $c")->reduce; + +########################################### + +BEGIN_PGML +Given the function [`[$fname]`] defined be [`[$fname](x)= [$f]`], calculate the following exactly. + +a) [`[$fname](0)={}`][____________________]{$ans1} + +a) [`[$fname]([$d])={}`][____________________]{$ans2} + +a) [`[$fname](-[$d])={}`][____________________]{$ans3} + +a) [`[$fname](\pi)={}`][____________________]{$ans4} +Use *pi* to represent [`\pi`]. + +Now find and simplify the following. + [|e.|] [`[$fname](x+1)={}`][____________________]{$ans5} + + [|f.|] [`[$fname](-x)={}`][____________________]{$ans6} + + +END_PGML + +########################################### + +$s = Formula("$b*x+$b")->reduce; +$s2 = Formula("$a*x^2+2*$a x+$a")->reduce; + +Context()->texStrings; +Context()->flags->set(reduceConstants=>0); + +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +[$fname](0) +&= [@$f->substitute(x=>0)@]\\ +&= [$ans1] +\end{aligned}`] + +a) [`\begin{aligned}[t] +[$fname]([$b]) +&= [@$f->substitute(x=>$b)@]\\ +&= [$ans2] +\end{aligned}`] + +a) [`\begin{aligned}[t] +[$fname](-[$b]) +&= [@$f->substitute(x=>-$b)@]\\ +&= [$ans3] +\end{aligned}`] + +a) [`\begin{aligned}[t] +[$fname](\pi) +&= [@$f->substitute(x=>Formula("pi"))@]\\ +\end{aligned}`] + +a) [`\begin{aligned}[t] +[$fname](x+1) +&= [@$f->substitute(x=>Formula("x+1"))@]\\ +&= [$a](x^2+2x+1)+[$s]-[$c]\\ +&= [$s2]+[$s]-[$c]\\ +&= [$ans5] +\end{aligned}`] + +a) [`\begin{aligned}[t] +[$fname](-x) +&= [@$f->substitute(x=>Formula("-x"))@]\\ +&= [$ans6] +\end{aligned}`] + +END_PGML_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition100.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition100.pg new file mode 100644 index 0000000000..bf0d423259 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition100.pg @@ -0,0 +1,158 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## Tagged by cmd6a 8/6/06 + +## DBsubject(Algebra) +## DBchapter(Functions) +## DBsection(Compositions and combinations of functions) +## Date(6/3/2002) +## Institution(Rochester) +## Author(K. Lesh) +## MLT(ccf-graphs-evaluate-comp) +## Level(2) +## TitleText1('College Algebra') +## AuthorText1('Stewart, Redlin, Watson') +## EditionText1('3') +## Section1('4.7') +## Problem1('11') +## KEYWORDS('algebra','function','composition of functions', 'combining functions', 'domain','domain', 'function' 'composition') + +################################### +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "PGcourse.pl", # Customization file for the course +); + +TEXT(beginproblem()); + +################################### + +$refreshCachedImages = 1; + +$b=random(-2,2,1); +Context("Numeric"); + +$f = Formula("x+$b"); +$g = Formula("(x-2)^2"); + +$xmin = -2; +$xmax = 6; +$ymin = -4; +$ymax = 8; + + + +$gr = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0],'grid'=>[$xmax-$xmin,$ymax-$ymin],'size'=>[400,400]); + +add_functions($gr, "$g for x in <0,4>" . + " using color:red and weight:2"); +$gr->moveTo(-1,$f->eval(x=>-1)); +$gr->lineTo(5,$f->eval(x=>5),'blue', 2, 'dashed'); + +$gr->lb( new Label(5,$f->eval(x=>5)+0.3,'y=f(x)', + 'blue','center','middle')); +$gr->lb( new Label(4,$g->eval(x=>4)+0.3,'y=g(x)', + 'red','center','middle')); + +$gr->stamps( closed_circle(-1,$f->eval(x=>-1),'blue') ); +$gr->stamps( closed_circle(5,$f->eval(x=>5),'blue') ); +$gr->stamps( closed_circle(0,$g->eval(x=>0),'red') ); +$gr->stamps( closed_circle(4,$g->eval(x=>4),'red') ); + +$ans1 = $b; +$ans2 = $b**2; +$ans3 = 2 + 2*$b; +$ans4 = 4; +$ans5 = 8 + $b; +$ans6 = String("DNE"); + + +################################### +# Main text + + + +BEGIN_PGML +In the graph below, let [`f`] be the linear function (in blue and dashed) and let [`g`] be theparabolic function (in red and solid). + +[@EnlargeImageStatementPGML()@]** + +>>[@ image( insertGraph($gr), width=>400, height=>400, tex_size=>800 ); @]* << + +Evaluate the following. Enter *DNE* if a value is undefined ("does not exist"). + +a) [`\left(f \circ g\right)( 2 )={}`][_______________]{$ans1} + +a) [`\left(g \circ f\right)( 2 )={}`][_______________]{$ans2} + +a) [`\left(f \circ f\right)( 2 )={}`][_______________]{$ans3} + +a) [`\left(g \circ g\right)( 2 )={}`][_______________]{$ans4} + +a) [`\left(f + g\right)( 4 )={}`][_______________]{$ans5} + +a) [`\left(\frac{f}{g}\right)( 2 )={}`][_______________]{$ans6} + + + +END_PGML +################################### + +BEGIN_PGML_SOLUTION + +We use the graphs to evaluate the functions. + +a) [`\begin{aligned}[t] +\left(f \circ g\right)( 2 ) +&= f\left(g\left(2\right)\right)\\ +&= f\left([@$g->eval(x=>2)@]\right)\\ +&= [@$f->eval(x=>$g->eval(x=>2))@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +\left(g \circ f\right)( 2 ) +&= g\left(f\left(2\right)\right)\\ +&= g\left([@$f->eval(x=>2)@]\right)\\ +&= [@$g->eval(x=>$f->eval(x=>2))@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +\left(f \circ f\right)( 2 ) +&= f\left(f\left(2\right)\right)\\ +&= f\left([@$f->eval(x=>2)@]\right)\\ +&= [@$f->eval(x=>$f->eval(x=>2))@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +\left(g \circ g\right)( 2 ) +&= g\left(g\left(2\right)\right)\\ +&= g\left([@$g->eval(x=>2)@]\right)\\ +&= [@$g->eval(x=>$g->eval(x=>2))@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +\left(f+g\right)( 2 ) +&=f(2)+g(2)\\ +&= [@$f->eval(x=>2)@]+[@$g->eval(x=>2)@]\\ +&= [$ans5] +\end{aligned}`] + +a) [`\begin{aligned}[t] +\left(\frac{f}{g}\right)( 2 ) +&=\frac{f(2)}{g(2)}\\ +&= \frac{[@$f->eval(x=>2)@]}{[@$g->eval(x=>2)@]}\\ +&= [$ans6] +\end{aligned}`] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition110.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition110.pg new file mode 100644 index 0000000000..829a36d3b0 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition110.pg @@ -0,0 +1,108 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','function','composition of functions') +## + +## DBsubject('') +## DBchapter() +## DBsection() +## Date('') +## Author('') +## Institution() +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +########################################### + +DOCUMENT(); # This should be the first executable line in the problem. +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +########################################### + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,9,1); +$b = random(1,9,1); + +Context("Numeric"); + +$f = Formula("|x|"); +$g = Formula("$a/(x-$b)"); + +$ans1 = Formula("abs($a/(x - $b))")->with(test_at => [[0],[2*$b]]); +$ans2 = Formula("$a/(abs(x) - $b)")->with(test_at => [[$b+1],[-$b-1]]); + +Context("Interval"); + +$ans1d = Interval("(-infinity,$b)U($b,infinity)"); +$ans2d = Interval("(-infinity,-$b)U(-$b,$b)U($b,infinity)"); + +########################################### + +BEGIN_PGML + + +Given that [`f(x)=[$f]`] and [`g(x)=[$g]`], find and simplify the following. Give the domains in interval notation. If the answer includes more than one interval write the intervals separated by the "union" symbol, [`\cup`], by typing *U*. If needed enter \(\infty\) as *inf*. + +a) [`\left(f\circ g\right)(x)={}`][__________________] and its domain is [____________________________________] + +a) [`\left(g\circ f\right)(x)={}`][__________________] and its domain is [____________________________________] + + +END_PGML + +########################################### + +ANS($ans1->cmp()); +ANS($ans1d->cmp()); +ANS($ans2->cmp()); +ANS($ans2d->cmp()); + +########################################### + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +\left(f\circ g\right)(x) +&= f\left(g\left(x\right)\right)\\ +&= f\left([$g]\right)\\ +&= [@$f->substitute(x=>$g)@]\\ +\end{aligned}`] +To find the domain of [`f\circ g`], we first exclude any [`x`]-values that are not in [`g`]'s domain. In this case, the only such value is [`[$b]`]. We then _also_ exclude any [`x`]-values that would put [`g(x)`] outside the domain of [`f`]. But in this case, [`f`]'s domain is all real numbers, so there is nothing more to exclude. So the domain of [`f\circ g`] is [`[$ans1d]`]. + +a) [`\begin{aligned}[t] +\left(g\circ f\right)(x) +&= g\left(f\left(x\right)\right)\\ +&= g\left([$f]\right)\\ +&= [@$g->substitute(x=>$f)@]\\ +\end{aligned}`] +To find the domain of [`g\circ f`], we first exclude any [`x`]-values that are not in [`f`]'s domain. In this case, [`f`]'s domain is all real numbers, so there is nothing to exclude. We then _also_ exclude any [`x`]-values that would put [`f(x)`] outside the domain of [`g`]. In this case, that would mean + + [`\begin{aligned}[t] +f(x) +&= [$b]\\ +[$f] +&= [$b]\\ +x +&= [$b]&\mbox{or}&&x&=-[$b] +\end{aligned}`] +So the domain of [`g\circ f`] is [`[$ans2d]`]. + +END_PGML_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition115.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition115.pg new file mode 100644 index 0000000000..db2241b9f6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition115.pg @@ -0,0 +1,64 @@ +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"parserNumberWithUnits.pl", +"parserFormulaWithUnits.pl", +"PGML.pl", +"PGcourse.pl", +); + +############################################# + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,9,1); +$b = random(10,29); + +Context("Numeric"); +Context()->variables->are(t=>'Real', r=>'Real', A=>'Real', S=>'Real'); + +$au = NumberWithUnits("$a cm/s"); +$bu = NumberWithUnits("$b cm"); + +$ans1 = FormulaWithUnits("4 pi ($a *t + $b)^2 cm^2"); +$r = FormulaWithUnits("$a *t + $b cm"); + +############################################# + +BEGIN_PGML + +A spherical weather balloon is being inflated. With a beginning radius of [`[$bu]`], the radius of the balloon increases at the rate of [`[$au]`]. Express the surface area of the balloon as a function of time [`t`] (in seconds). If needed you can enter +[` \pi `] as *pi*. (Hint: The surface area of a sphere of radius [`r`] is [`4 \pi r^2`].) + + [`S(t) = {}`][__________________]{$ans1}. + +END_PGML + +############################################# + +BEGIN_PGML_SOLUTION + +We have been given the formula for the surface area as a function of the radius: + + [`S(r) = 4\pi r^2`] + +And we have been given some information about how the radius of the balloon is changing over time. It starts at [`[$bu]`] and then grows at a constant rate of [`[$au]`]. This is precisely what it means for [`r`] to be a linear function of time with [`y`]-intercept [`[$b]`] and slope [`[$a]`]. So if [`t`] is measured in seconds, we have that: + + [`r(t) = [$r]`] + +and now we can substitute this in to our formula for [`S`]. Since we will be left with an expression in [`t`], we can write our new formula using function notation with [`S`] depending on [`t`]. + + [`S(t) = [$ans1]`] + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition120.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition120.pg new file mode 100644 index 0000000000..198e3796c2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition120.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Inverse Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + "parserFormulaWithUnits.pl", + "contextCurrency.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->variables->are(s=>'Real',A=>'Real'); + + +$realPrice = random(25,32,0.5); + + +$area = random(150,300,25); + + + + +Context("Numeric"); +Context()->variables->are(s=>'Real',A=>'Real'); + +Context()->flags->set(reduceConstants=>0); + +$ans1 = Formula("s^2"); +$ans2 = Formula("$realPrice/$area*A"); +$ans3 = Formula("$realPrice/$area*s^2"); +$ans4 = NumberWithUnits("64 ft^2"); + + +$s = FormulaWithUnits("s ft"); + +$areau = NumberWithUnits("$area ft^2"); + + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); +$price = Currency("$realPrice"); +$ans5 = Currency("$realPrice/$area*80"); +$ans6 = Currency("$realPrice/$area*10^2"); + +############################################## + + +BEGIN_PGML + +The area of a square wooden deck is a function of the side length, [`[$s]`] feet. So we can write [`A=f(s)\mbox{ }\mathrm{ft}^2`]. A can of stain costs [`[$price]`] and covers [`[$areau]`] of wood. + +a) Write the formula for [`f(s)`]. +[`f(s)={}`][_____________]{$ans1} + +a) If [`C`] is the cost of staining [`A`] square feet, and [`C=g(A)\mbox{ }\mathrm{dollars}`], find a formula for [`g(A)`]. +[`g\left(A\right) ={}`][_____________]{$ans2} + +a) Find and simplify [`g(f(s))`]. +[`g\left(f(s)\right) ={}`][_____________]{$ans3} + +a) Find [`f(8)`], and attach the appropriate units to it. +[`f(8) = {}`][_____________]{$ans4} + +a) Find [`g(80)`], and attach the appropriate units to it. +[`g(80) = {}`][_____________]{$ans5} + +a) Find [`g(f(10))`], and attach the appropriate units to it. +[`g\left(f(10)\right) = {}`][_____________]{$ans6} + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +a) The area of a square is given by the relation [`A=s^2`], where [`s`] is the side length. So [`f(s)=[$ans1]`]. + +a) Since it costs nothing to stain no wood, [`g(0)=0`]. Also, we know that we can stain more wood at a rate of [`[$price]`] for every [`[$areau]`]. So [`g`] is a linear function whose graph passes through the origin and has slope [`\frac{[$realPrice]}{[$area]}`]. In other words, [`g(A) = [$ans2]`]. + +a) [`\begin{aligned}[t] +g\left(f(s)\right) +&= g\left([$ans1]\right)\\ +&=[$ans3] +\end{aligned}`] + +a) [`f(8) = 64`]. Since [`f`] outputs area in [`\mathrm{ft}^2`], the correct answer here is [`[$ans4]`]. + +a) [`g(80) =[@$ans2->eval(A=>80)@] `]. Since [`g`] outputs cost in [`\mathrm{dollars}`], the correct answer here is [`[$ans5]`]. + +a) [`g\left(f(10)\right) = g(100)=[@$ans3->eval(s=>10)@] `]. Since [`g`] outputs cost in [`\mathrm{dollars}`], the correct answer here is [`[$ans6]`]. + + +END_PGML_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition130.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition130.pg new file mode 100644 index 0000000000..311caa7bd4 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition130.pg @@ -0,0 +1,81 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Inverse Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->variables->are(t=>'Real',r=>'Real',V=>'Real'); + +$base = random(48,60,2); +$rate = random(2,2.5,0.1); + +Context()->flags->set(reduceConstants=>0); +$Voft = Formula("4/3pi($base-$rate t)^3"); + + +############################################## + +BEGIN_PGML + +The radius [`r`] (in centimeters) of a melting snowball is given by [`r=[$base]-[$rate] t`], where [`t`] is time in hours. The snowball is spherical, with volume given by [`V=\frac43\pi r^3`] (with [`V`] measured in cubic centimeters). Find a formula for [`f(t)`], where [`V=f(t)\mbox{ }\mathrm{cm}^3`], the volume of the snowball as a function of time. + + [`f(t) ={}`][___________________]{$Voft} + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; + +BEGIN_PGML_SOLUTION + +We have been given the formula for the volume as a function of the radius: + + [`V(r) = \frac43\pi r^3`] + +And we have been given some information about how the radius of the snowball is changing over time. + + [`r(t) = [$base]-[$rate] t`] + +and now we can substitute this in to our formula for [`V`]. Since we will be left with an expression in [`t`], we can write our new formula using function notation with [`V`] depending on [`t`]. + + [`V(t) = [$Voft]`] + + +END_PGML_SOLUTION + + + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition140.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition140.pg new file mode 100644 index 0000000000..6a2a167590 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition140.pg @@ -0,0 +1,129 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerComposition.pl", + "parserAssignment.pl", + "PGML.pl", + "contextLimitedPolynomial.pl", + "parserRadioButtons.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric")->variables->are(p=>"Real"); +parser::Assignment->Allow; +parser::Assignment->Function("f"); +parser::Assignment->Function("g"); + + +$rebate = random(100,200,20); +$perc = random(10,40,5); + +$percreal = $perc/100; +$perccomp = 1-$percreal; + +$q = $perccomp*$rebate; + +$comp = 1-$percreal; + +$answer1 = Formula("f(p)=p-$rebate"); +$answer2 = Formula("g(p)=$comp*p"); + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are(p=>"Real"); +$answer3 = Formula("$perccomp p -$rebate"); +$answer4 = Formula("$perccomp p -$q"); + +Context()->texStrings; +$radio = RadioButtons( + ['Apply the discount before the rebate','Apply the rebate before the discount'], + 'Apply the discount before the rebate', # correct answer + last => ['Apply the discount before the rebate','Apply the rebate before the discount'], # can be a list +); +Context()->normalStrings; + +############################################## + + +BEGIN_PGML + +The manufacturer of a computer is offering two discounts on last year's model computer. The first discount is at a [`\$[$rebate]`] rebate and the second discount is [`[$perc]%`] off the regular price [`p`]. + + +a) Write a formula for a function [`f`] that represents the sale price as a function of the regular price if only the rebate applies. Your answer should be in the form *f(p)=...*. + + [______________________] + +a) Write a formula for a function [`g`] that represents the sale price as a function of the regular price if only the [`[$perc]%`] discount applies. Your answer should be in the form *g(p)=...*. + + [______________________] + +a) Find [`f`] composed with [`g`] and [`g`] composed with [`f`]. Expand and simplify both answers to polynomials in standard form. + + [`(f\circ g)(p)={}`][______________________] + + [`(g\circ f)(p)={}`][______________________] + +a) Which combination of discounts represents a better deal for the consumer? + [@ $radio->buttons() @]* + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $answer1 ->cmp); +ANS( $answer2 ->cmp); +ANS( $answer3 ->cmp); +ANS( $answer4 ->cmp); +ANS( $radio->cmp() ); + + +BEGIN_PGML_SOLUTION + +a) A rebate reduces the cost through subtraction. So [`[$answer1]`]. + +a) A percentage discount reduces the cost by multiplication using the complement of the percentage discount. So [`[$answer2]`]. + +a) [`\begin{aligned}[t] +(f\circ g)(p) +&= f(g(p))\\ +&=f([$comp]p)\\ +&=[$comp]p-[$rebate] +\end{aligned}`] +[`\begin{aligned}[t] +(g\circ f)(p) +&= g(f(p))\\ +&=g(p - [$rebate])\\ +&=[$comp](p-[$rebate])\\ +&= [$comp]p - [$comp*$rebate] +\end{aligned}`] + +a) Comparing the formulas for [`f\circ g`] with [`g\circ f`], we see that [`f\circ g`] reduces the price by more. So we should apply the percentage discount before the rebate. + + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition150.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition150.pg new file mode 100644 index 0000000000..7dc297c8b4 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition150.pg @@ -0,0 +1,61 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerComposition.pl", + "PGML.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################################## + + +Context("Numeric"); + + +$a = random(2,9,1); + +$f = Formula("sqrt(x)"); +$g = Formula("x^2+$a"); + + +############################################## + +BEGIN_PGML + +Express the quantity [`\sqrt{ x^2 + [$a] }`] as a composition of two simpler functions. If [`\sqrt{ x^2 + [$a] }=f(g(x))`], what are formulas for [`f`] and [`g`]? + + [`f(x)={}`][_________________] + [`g(x)={}`][_________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +COMPOSITION_ANS( $f, $g, vars=>['x','x'], showVariableHints=>1); + +############################################## + +BEGIN_PGML_SOLUTION + +There are actually many correct ways to answer this question, but perhaps the simplest way is to recognize the square root radical as the "outer" function. So we can use [`f(x)=\sqrt{x}`]. Then the "inner" function would be given by [`g(x)=x^2+[$a]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition160.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition160.pg new file mode 100644 index 0000000000..6063f81aae --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition160.pg @@ -0,0 +1,44 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl" +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = non_zero_random(-9,9); +$b = random(2,9); +$n = random(3,6); + +Context("Numeric"); +Context()->variables->set(x=>{limits=>[1,10]}); +$ans1 = Formula("1/x+$b*sqrt(x)"); + +############################################## + +BEGIN_PGML +If [`h`] is defined by [`h(x)=\frac{1}{x + [$a]} + [$b]\sqrt{x + [$a]}`], and if [`g(x)=x+[$a]`], express [`h`] in the form [`f \circ g`]. Find a formula for the function [`f`]. + + [`f(x)={}`][________________]{$ans1} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since [`h(x)=\frac{1}{x + [$a]} + [$b]\sqrt{x + [$a]}`], and [`g(x)=x+[$a]`], then [`h(x)=\frac{1}{g(x)} + [$b]\sqrt{g(x)}`]. But if [`h=f\circ g`], then this means + + [`f(g(x))=\frac{1}{g(x)} + [$b]\sqrt{g(x)}`] + +We deduce that [`f(\mathrm{input})=\frac{1}{\mathrm{input}}+[$b]\sqrt{\mathrm{input}}`]. In other words, [`f(x)=[$ans1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition170.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition170.pg new file mode 100644 index 0000000000..1a1a277c55 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition170.pg @@ -0,0 +1,62 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','function','composition of functions') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Combining Functions') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", # Customization file for the course +); + +TEXT(beginproblem); + +################################### +# Setup +$a = non_zero_random(-9,9,1); +$b = random(2,9,1); + +$f=Formula("x^$b")->reduce; +$g=Formula("x+$a ")->reduce; + +$fcompg = $f ->substitute(x=>$g); +#$gcompf = $g ->substitute(x=>$f); + +################################### +# Main text + +BEGIN_PGML +If the function [`h`] is defined by [`h(x)=[$fcompg]`], and [`h`] is expressed in the form [`f \circ g`] with [`f(x)=[$f]`], then find a formula for the function [`g`]. + + [`g(x)={}`][__________________]{$g} + +END_PGML + +################################### + +BEGIN_PGML_SOLUTION + +Executing the function [`h`] is a two-step process according to the order of operations. First you shift the input by [`[$a]`], and then you raise that result to the power of [`[$b]`]. If [`h`] is [`f\circ g`], and [`f`] is the process of raising to the power of [`[$b]`], then [`g`] must be the process of shifting its input by [`[$a]`]. So [`g(x)=[$g]`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition180.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition180.pg new file mode 100644 index 0000000000..468262d304 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition180.pg @@ -0,0 +1,55 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); +$showPartialCredit = 1; + +$str = list_random("a","b","c"); + +$a=random(2,6); +$b=non_zero_random(-5,5,1); +do{$d=non_zero_random(-5,5,1);} until $b != $d; + +Context("Fraction"); +$ans = Fraction($a*$d + $b - $d,$b); + +############################################## + +BEGIN_PGML +Find a number [`[$str]`] such that [`f \circ g = g \circ f`], where [`f(x) = [$a] x + [$b]`] and [`g(x) = [$str] x + [$d]`]. + + [`[$str] ={}`][______________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +[``\begin{aligned} +f \circ g &= g \circ f\\ +\left(f \circ g\right)(x) &=\left(g \circ f\right)(x)\\ +f\left(g\left(x\right)\right)&=g\left(f\left(x\right)\right)\\ +f\left([$str] x + [$d]\right)&=g\left([$a] x + [$b]\right)\\ +[$a]\left([$str] x + [$d]\right)+[$b]&=[$str]\left([$a] x + [$b]\right)+[$d]\\ +[$a][$str] x + [$a*$d+$b]&=[$a][$str] x + [$b][$str]+[$d]\\ +[$a*$d+$b-$d]&= [$b][$str]\\ +[$ans]&= [$str]\\ +[$str] &= [$ans] +\end{aligned}``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition20.pg new file mode 100644 index 0000000000..71e2746261 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition20.pg @@ -0,0 +1,126 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Evaluation and Solving') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + "parserAssignment.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1); + +Context()->variables->are(x=>'Real',t=>'Real'); + +$constant = non_zero_random(-9,9,1); + +do {$fname = RandomVariableName()} until ($fname ne "x" and $fname ne "t"); +$f = Formula("x/(x+$constant)")->reduce; + +$b = random(1,5,1); +$c = 1+$b*$constant; + +$ans1 = Formula("1/(1+$constant t)")->reduce; +$ans2 = Formula("1/($constant t+$c)")->reduce; + +$solveValue = random(2,6,1); + +Context("Fraction"); +$numerator = $constant*$solveValue; +$denominator = 1-$solveValue; + +$frac = Fraction($numerator,$denominator); + +parser::Assignment->Allow; + +$ans3 = Formula("x=$frac"); + +############################################## + +BEGIN_PGML + +Let [`[$fname](x) = [$f]`]. + +a. Find and simplify [`[$fname]\left(\frac{1}{t}\right)`]. +[`[$fname]\left(\frac{1}{t}\right)={}`][___________________________]{$ans1} + +a. Find and simplify [`[$fname]\left(\frac{1}{t+[$b]}\right)`]. +[`[$fname]\left(\frac{1}{t+[$b]}\right)={}`][___________________________]{$ans2} + +a. Solve [`[$fname](x)=[$solveValue]`]. Remember that when you are asked to solve for [`x`], your answer should be of the form *x=[$US][$US][$US] *, and not simply be the number. +[___________________________]{$ans3} + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; +Context("Numeric"); +Context()->texStrings; + +Context()->variables->are(x=>'Real',t=>'Real'); + +$s = Formula("(1-$solveValue)x")->reduce; + +BEGIN_PGML_SOLUTION + +a. [`\begin{aligned}[t] +[$fname]\left(\frac{1}{t}\right) +&=[@$f->substitute(x=>Formula("1/t"))@]\\ +&=[@$f->substitute(x=>Formula("1/t"))@]\cdot\frac{t}{t}\\ +&=[$ans1] +\end{aligned}`] + +a. [`\begin{aligned}[t] +[$fname]\left(\frac{1}{t+[$b]}\right) +&=[@$f->substitute(x=>Formula("1/(t+$b)"))@]\\ +&=[@$f->substitute(x=>Formula("1/(t+$b)"))@]\cdot\frac{t+[$b]}{t+[$b]}\\ +&=\frac{1}{1+[$constant](t+[$b])}\\ +&=[$ans2] +\end{aligned}`] + +a. [`\begin{aligned}[t] +[$fname](x)&=[$solveValue]\\ +[$f]&=[$solveValue]\\ +x&=[$solveValue](x+[$constant])\\ +x&=[$solveValue]x+[$constant*$solveValue]\\ +[$s]&=[$constant*$solveValue]\\ +x&=[$frac]\\ +\end{aligned}`] + +END_PGML_SOLUTION + +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition30.pg new file mode 100644 index 0000000000..0d5b9a97c5 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition30.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$a = non_zero_random(2,5,1)*random(-1,1,2); + +$b = random(-10,10,1); + +$c = non_zero_random(-3,3,1); + +$d = non_zero_random(-3,3,1); + +Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->flags->set(reduceConstants=>0); + +$f = Formula("$a x+$b")->reduce; +$g = Formula("$c x^2+$d")->reduce; + + +$h = random(-4,4,1); +$j = $h; +while ($j == $h) +{$j = random(-4,4,1);}; +$k = $h; +while (($k == $h) || ($k == $j)) +{$k = random(-4,4,1);}; + + +$ans[0] = $g->eval(x=>($f->eval(x=>$h))); +$ans[1] = $f->eval(x=>($g->eval(x=>$j))); +$ans[2] = $f->eval(x=>($f->eval(x=>$k))); + + + +############################################## + + +BEGIN_PGML + +Let [`f(x)=[$f]`] and [`g(x)=[$g]`]. Evaluate each of the following. + +a) [`(g\circ f)([$h])={}`][__________] + +a) [`(f\circ g)([$j])={}`][__________] + +a) [`(f\circ f)([$k])={}`][__________] + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("LimitedNumeric"); +ANS( Compute("$ans[0]")->cmp); +ANS( Compute("$ans[1]")->cmp); +ANS( Compute("$ans[2]")->cmp); + +############################################## + + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +(g\circ f)([$h]) +&=g\left(f\left([$h]\right)\right) & f\left([$h]\right)&=[@$f->substitute(x=>Formula("$h"))@]\\ +&&&=[@$f->eval(x=>$h)@]\\ +&=g\left([@$f->eval(x=>$h)@]\right)\\ +&=[@$g->substitute(x=>Formula($f->eval(x=>$h)))@]\\ +&=[@$g->eval(x=>($f->eval(x=>$h)))@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(f\circ g)([$j]) +&=f\left(g\left([$j]\right)\right) & g\left([$j]\right)&=[@$g->substitute(x=>Formula("$j"))@]\\ +&&&=[@$g->eval(x=>$j)@]\\ +&=f\left([@$g->eval(x=>$j)@]\right)\\ +&=[@$f->substitute(x=>Formula($g->eval(x=>$j)))@]\\ +&=[@$f->eval(x=>($g->eval(x=>$j)))@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(f\circ f)([$k]) +&=f\left(f\left([$k]\right)\right) & f\left([$k]\right)&=[@$f->substitute(x=>Formula("$k"))@]\\ +&&&=[@$f->eval(x=>$k)@]\\ +&=f\left([@$f->eval(x=>$k)@]\right)\\ +&=[@$f->substitute(x=>Formula($f->eval(x=>$k)))@]\\ +&=[@$f->eval(x=>($f->eval(x=>$k)))@] +\end{aligned}`] + + +END_PGML_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition40.pg new file mode 100644 index 0000000000..3f5879be0b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition40.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedFactor.pl", + "PGML.pl", + "answerHints.pl", + "PGcourse.pl", + +); + +TEXT(beginproblem()); + +############################################## + + +Context("LimitedFactor"); +Context()->flags->set(factorableObject=>'expression'); +Context()->noreduce('(-x)-y', '(-x)+y'); +Context()->flags->set(reduceConstants=>0); + + +do{ +$a = non_zero_random(-3,3,1); +$b = non_zero_random(-3,3,1); +$c = non_zero_random(-3,3,1); +$d = non_zero_random(1,10,1); +$e = 1; +$h = random(-10,10,1); + +$f = Formula("($a)/($b x+$c)")->reduce; +$g = Formula("($d)/($e x+$h)")->reduce; +$k = Formula("$e x+$h")->reduce; + +$ae = $a*$e; +$ah = $a*$h; +$bdpch = $b*$d+$c*$h; +$ce = $c*$e; + +} until (gcd(gcd($ae,$ah ),$ce) == 1); + +$ans = Formula("($ae x+$ah)/($ce x+$bdpch)")->reduce; + +############################################## + + +BEGIN_PGML + +Find and simplify the rule for [`f\circ g`], where + + [``f(x) = [$f]``] and [``g(x) = [$g]``] + + + [`(f\circ g)(x)={}`][__________________________] + +END_PGML + + +############################################## + +ANS($ans -> cmp()->withPostFilter(AnswerHints( + Formula("$a($e x+$h)/($ce x+$bdpch)") => ["Expand the numerator",replaceMessage=>1] +))); + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +[`\begin{aligned} +(f\circ g)(x) +&=f\left(g\left(x\right)\right)\\ +&=f\left([$g]\right)\\ +&=[@$f->substitute(x=>$g)@]\\ +&=[@$f->substitute(x=>$g)@]\cdot\frac{[$k]}{[$k]}\\ +&=\frac{[$a]\left([$k]\right)}{[$b*$d]+[$c]\left([$k]\right)}\\ +&=[$ans] +\end{aligned}`] + +END_PGML_SOLUTION +Context()->normalStrings; + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition50.pg new file mode 100644 index 0000000000..48bbb7c413 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition50.pg @@ -0,0 +1,206 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Combining Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "contextPolynomialFactors.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + + Context("PolynomialFactors")->flags->set(singlePowers=>1); +Context()->flags->set(reduceConstants=>0); + +$a = non_zero_random(-4,5,1); +$m = random(2,8,1); +$b = random(1,10,1); + +$f = Formula("x^2+$a")->reduce; +$g = Formula("$m*x+$b")->reduce; + +$r = $m**2; +$s = 2*$b*$m; +$t = $b**2+$a; +$u = $m*$a+$b; + +$fOfg = Formula("$r x^2+$s x+$t"); +$gOff = Formula("$m x^2+$u"); + +Context("LimitedNumeric"); +@at = (0,1,2); + +for my $i (0,1,2) { +$fOfgans[$i] = $g->eval(x=>$at[$i]); +$fOfgans[$i] = $f->eval(x=>$fOfgans[$i]); +$fOfgans[$i] = Real($fOfgans[$i]); + +$gOffans[$i] = $f->eval(x=>$at[$i]); +$gOffans[$i] = $g->eval(x=>$gOffans[$i]); +$gOffans[$i] = Real($gOffans[$i]); +} + +############################################## + + +BEGIN_PGML + +Let [`f`] and [`g`] be functions given by [`f(x)=[$f]`] and [`g(x)=[$g]`]. Find the values of these expressions. + +END_PGML + +Context()->texStrings; +BEGIN_TEXT +$PAR +\{ + LayoutTable( +[ +["\(f\left(g\left($at[0]\right)\right)={}\)".ans_rule(5), "\(f\left(g\left($at[1]\right)\right)={}\)".ans_rule(5), "\(f\left(g\left($at[2]\right)\right)={}\)".ans_rule(5)], +["\(g\left(f\left($at[0]\right)\right)={}\)".ans_rule(5), "\(g\left(f\left($at[1]\right)\right)={}\)".ans_rule(5), "\(g\left(f\left($at[2]\right)\right)={}\)".ans_rule(5)] +], +allcellcss=>"text-align:left; padding:10pt; ", +center=>0, + +) +\} + +$PAR + +END_TEXT +Context()->normalStrings; + +BEGIN_PGML + +Give a fully simplified expression for [`f\left(g\left(x\right)\right)`]. + + [`f\left(g\left(x\right)\right)={}`][________________] + +Give a fully simplified expression for [`g\left(f\left(x\right)\right)`]. + + [`g\left(f\left(x\right)\right)={}`][________________] + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + + +ANS( $fOfgans[0]->cmp() ); +ANS( $fOfgans[1]->cmp() ); +ANS( $fOfgans[2]->cmp() ); +ANS( $gOffans[0]->cmp() ); +ANS( $gOffans[1]->cmp() ); +ANS( $gOffans[2]->cmp() ); + +ANS( $fOfg->cmp() ); +ANS( $gOff->cmp() ); + +############################################## + + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +[`\begin{aligned}[t] +(f\circ g)([@$at[0]@]) +&=f\left(g\left([@$at[0]@]\right)\right) & g\left([@$at[0]@]\right)&=[@$g->substitute(x=>Formula("$at[0]"))@]\\ +&&&=[@$g->eval(x=>$at[0])@]\\ +&=f\left([@$g->eval(x=>$at[0])@]\right)\\ +&=[@$f->substitute(x=>Formula($g->eval(x=>$at[0])))@]\\ +&=[@$f->eval(x=>($g->eval(x=>$at[0])))@] +\end{aligned}`] + +[`\begin{aligned}[t] +(f\circ g)([@$at[1]@]) +&=f\left(g\left([@$at[1]@]\right)\right) & g\left([@$at[1]@]\right)&=[@$g->substitute(x=>Formula("$at[1]"))@]\\ +&&&=[@$g->eval(x=>$at[1])@]\\ +&=f\left([@$g->eval(x=>$at[1])@]\right)\\ +&=[@$f->substitute(x=>Formula($g->eval(x=>$at[1])))@]\\ +&=[@$f->eval(x=>($g->eval(x=>$at[1])))@] +\end{aligned}`] + +[`\begin{aligned}[t] +(f\circ g)([@$at[2]@]) +&=f\left(g\left([@$at[2]@]\right)\right) & g\left([@$at[2]@]\right)&=[@$g->substitute(x=>Formula("$at[2]"))@]\\ +&&&=[@$g->eval(x=>$at[2])@]\\ +&=f\left([@$g->eval(x=>$at[2])@]\right)\\ +&=[@$f->substitute(x=>Formula($g->eval(x=>$at[2])))@]\\ +&=[@$f->eval(x=>($g->eval(x=>$at[2])))@] +\end{aligned}`] + +[`\begin{aligned}[t] +(g\circ f)([@$at[0]@]) +&=g\left(f\left([@$at[0]@]\right)\right) & f\left([@$at[0]@]\right)&=[@$f->substitute(x=>Formula("$at[0]"))@]\\ +&&&=[@$f->eval(x=>$at[0])@]\\ +&=g\left([@$f->eval(x=>$at[0])@]\right)\\ +&=[@$g->substitute(x=>Formula($f->eval(x=>$at[0])))@]\\ +&=[@$g->eval(x=>($f->eval(x=>$at[0])))@] +\end{aligned}`] + +[`\begin{aligned}[t] +(g\circ f)([@$at[1]@]) +&=g\left(f\left([@$at[1]@]\right)\right) & f\left([@$at[1]@]\right)&=[@$f->substitute(x=>Formula("$at[1]"))@]\\ +&&&=[@$f->eval(x=>$at[1])@]\\ +&=g\left([@$f->eval(x=>$at[1])@]\right)\\ +&=[@$g->substitute(x=>Formula($f->eval(x=>$at[1])))@]\\ +&=[@$g->eval(x=>($f->eval(x=>$at[1])))@] +\end{aligned}`] + +[`\begin{aligned}[t] +(g\circ f)([@$at[2]@]) +&=g\left(f\left([@$at[2]@]\right)\right) & f\left([@$at[2]@]\right)&=[@$f->substitute(x=>Formula("$at[2]"))@]\\ +&&&=[@$f->eval(x=>$at[2])@]\\ +&=g\left([@$f->eval(x=>$at[2])@]\right)\\ +&=[@$g->substitute(x=>Formula($f->eval(x=>$at[2])))@]\\ +&=[@$g->eval(x=>($f->eval(x=>$at[2])))@] +\end{aligned}`] + +[`\begin{aligned}[t] +(f\circ g)(x) +&=f\left(g\left(x\right)\right)\\ +&=f\left([$g]\right)\\ +&=[@$f->substitute(x=>$g)@]\\ +&=[$fOfg] +\end{aligned}`] + +[`\begin{aligned}[t] +(g\circ f)(x) +&=g\left(f\left(x\right)\right)\\ +&=g\left([$f]\right)\\ +&=[@$g->substitute(x=>$f)@]\\ +&=[$gOff] +\end{aligned}`] + +END_PGML_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition60.pg new file mode 100644 index 0000000000..eec70d2aa5 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition60.pg @@ -0,0 +1,121 @@ +##DESCRIPTION +## Composite Functions +##DESCRIPTION +## Algebra problem: combining functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'combining functions', 'domain') + + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +############################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "pccTables.pl", + "contextPolynomialFactors.pl", + "PGcourse.pl", + +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = non_zero_random(-9,9,1); +$b = non_zero_random(-9,9,1); + +Context("PolynomialFactors")->flags->set(singlePowers=>1); +Context()->flags->set(reduceConstants=>0); + +$f = Formula("x^2 +$a x")->reduce; +$g = Formula("x+ $b")->reduce; + + +$fg1 = 2*$b+$a; +$fg0 = $b**2+$a*$b; + +$ansa = Formula("x^2 + $fg1*x + $fg0")->reduce; +$ansb = Formula("x^2 + $a*x + $b")->reduce; +$ff3 = 2*$a; +$ff2 = $a**2+$a; +$ff1 = $a**2; +$ansc = Formula("x^4+$ff3*x^3 + $ff2*x^2+$ff1*x")->reduce; +$gg0 = 2*$b; +$ansd = Formula("x + $gg0")->reduce; + +############################################## + + +BEGIN_PGML + +Let [`f`] and [`g`] be functions given by [`f(x)=[$f]`] and [`g(x)=[$g]`]. Find and simplify the following: + +a) [`(f\circ g)(x)={}`][_________________________________________]{$ansa} + +a) [`(g\circ f)(x)={}`][_________________________________________]{$ansb} + +a) [`(f\circ f)(x)={}`][_________________________________________]{$ansc} + +a) [`(g\circ g)(x)={}`][_________________________________________]{$ansd} + + +END_PGML + +############################################## + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +(f\circ g)(x) +&=f\left(g\left(x\right)\right)\\ +&=f\left([$g]\right)\\ +&=[@$f->substitute(x=>$g)@]\\ +&=[$ansa] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(g\circ f)(x) +&=g\left(f\left(x\right)\right)\\ +&=g\left([$f]\right)\\ +&=[@$g->substitute(x=>$f)@]\\ +&=[$ansb] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(f\circ f)(x) +&=f\left(f\left(x\right)\right)\\ +&=f\left([$f]\right)\\ +&=[@$f->substitute(x=>$f)@]\\ +&=[$ansc] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(g\circ g)(x) +&=g\left(g\left(x\right)\right)\\ +&=g\left([$g]\right)\\ +&=[@$g->substitute(x=>$g)@]\\ +&=[$ansd] +\end{aligned}`] + +END_PGML_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition70.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition70.pg new file mode 100644 index 0000000000..d6db1701a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition70.pg @@ -0,0 +1,122 @@ +#DESCRIPTION +#KEYWORDS('functions', 'composition', 'combinations', 'derivatives') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +# Calculate new functions from old ones: composition, addition, products +#ENDDESCRIPTION + +############################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"pccTables.pl", +"PGML.pl", +"PGcourse.pl" +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(-20,20,1); +$b = random(-20,20,1); +$c = random(-20,20,1); +$d = random(-20,20,1); +$e = random(-20,20,1); +$f = random(-20,20,1); + +Context("LimitedNumeric"); + +############################################## + +BEGIN_PGML +The table below gives some data for the functions [`f`] and [`g`]. Use the table to calculate the quantities that are asked for: + +END_PGML + +BEGIN_TEXT +$PAR + +\{DataTable( +[ +[{data=>"\(x\)", headerrow=>1}, "\(f(x)\)", "\(g(x)\)"], +["\(1\)","\(6\)","\($a\)"], +["\(2\)","\(3\)","\($b\)"], +["\(3\)","\(2\)","\(6\)"], +["\(4\)","\(5\)","\($c\)"], +["\(5\)","\(1\)","\($d\)"], +["\(6\)","\($f\)","\($e\)"] +], +allcellcss=>"padding-left:10pt; padding-right:10pt;", +headercss=>"border-bottom: solid; border-width: 1px;", +datacss=>"text-align:right;" +) +\} +$PAR +END_TEXT + +BEGIN_PGML +a) [`(g\circ f)(4)={}`][___________________]{$d} + +a) [`(f\circ g)(3)={}`][___________________]{$f} + +a) [`(g\circ f)(5)={}`][___________________]{$a} + +a) [`(g\circ g)(3)={}`][___________________]{$e} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION +Using the table to look up values of [`f`] and [`g`], we find + +a) [`\begin{aligned}[t] +(g\circ f)(4) +&=g\left(f\left(4\right)\right)\\ +&=g\left(5\right)\\ +&=[$d] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(f\circ g)(3) +&=f\left(g\left(3\right)\right)\\ +&=f\left(6\right)\\ +&=[$f] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(g\circ f)(5) +&=g\left(f\left(5\right)\right)\\ +&=g\left(1\right)\\ +&=[$a] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(g\circ g)(3) +&=g\left(g\left(3\right)\right)\\ +&=g\left(6\right)\\ +&=[$e] +\end{aligned}`] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition80.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition80.pg new file mode 100644 index 0000000000..b121db4436 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition80.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "PGML.pl", + "PGcourse.pl", + +); + +TEXT(beginproblem()); + + +############################################## + + +Context("LimitedNumeric"); + +for my $i (0..6) +{$f[$i] = random(-10,10,1); +$g[$i] = random(-10,10,1);} + +$a = random(-3,3,1); +$b = random(-3,3,1); +$c = random(-3,3,1); + +$f[$a+3] = random(-3,3,1); +$g[$b+3] = random(-3,3,1); +$f[$c+3] = random(-3,3,1); + +$ans[0] = $g[$f[$a+3]+3]; +$ans[1] = $f[$g[$b+3]+3]; +$ans[2] = $f[$f[$c+3]+3]; + + +Context("LimitedNumeric"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Evaluate each expression using the values given in the table. + +$PAR + +\{ +DataTable( +[ +[{data=>"\(x\)", headerrow=>1, header=>"TH"},"\(-3\)","\(-2\)","\(-1\)","\(0\)","\(1\)","\(2\)","\(3\)"], +[{data=>"\(f(x)\)", header=>"RH"},"\($f[0]\)","\($f[1]\)","\($f[2]\)","\($f[3]\)","\($f[4]\)","\($f[5]\)","\($f[6]\)"], +[{data=>"\(g(x)\)", header=>"RH"},"\($g[0]\)","\($g[1]\)","\($g[2]\)","\($g[3]\)","\($g[4]\)","\($g[5]\)","\($g[6]\)"] +], +allcellcss=>"padding-left:10pt; padding-right:10pt;", +headercss=>"border-bottom: solid; border-width: 1px;", +datacss=>"text-align:right;" +) +\} + + +$PAR +END_TEXT +Context()->normalStrings; + + +BEGIN_PGML + +a) [`(g\circ f)([$a])={}`][_________] + +a) [`(f\circ g)([$b])={}`][_________] + +a) [`(f\circ f)([$c])={}`][_________] + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( Compute("$ans[0]")->cmp); +ANS( Compute("$ans[1]")->cmp); +ANS( Compute("$ans[2]")->cmp); + +############################################## +$s0 = $f[$a+3]; +$s1 = $g[$b+3]; +$s2 = $f[$c+3]; + +BEGIN_PGML_SOLUTION +Using the table to look up values of [`f`] and [`g`], we find + +a) [`\begin{aligned}[t] +(g\circ f)([$a]) +&=g\left(f\left([$a]\right)\right)\\ +&=g\left([$s0]\right)\\ +&=[@$ans[0]@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(f\circ g)([$b]) +&=f\left(g\left([$b]\right)\right)\\ +&=f\left([$s1]\right)\\ +&=[@$ans[1]@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(f\circ f)([$c]) +&=f\left(f\left([$c]\right)\right)\\ +&=f\left([$s2]\right)\\ +&=[@$ans[2]@] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition90.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition90.pg new file mode 100644 index 0000000000..b504139781 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/FunctionComposition/FunctionComposition90.pg @@ -0,0 +1,134 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$a = non_zero_random(-3,3,1); +$b = random(-3,3,1); +$c = non_zero_random(-1,1,1); + +$d = non_zero_random(-1,1,1); +$e = random(-2,2,1); + +$g = Formula("$a*sin(pi/2*x)+$c*x"); +$f = Formula("$d*x + $e"); + + +$h = random(-1,4,1); +$j = $h; +while ($j == $h) +{$j = random(-1,4,1);}; +$k = $h; +while (($k == $h) || ($k == $j)) +{$k = random(-1,4,1);}; + +$ans[0] = $g->eval(x=>($f->eval(x=>$h))); +$ans[1] = $f->eval(x=>($g->eval(x=>$j))); +$ans[2] = $g->eval(x=>($g->eval(x=>$k))); + + +$xmin = -8; +$xmax = 8; +$ymin = -8; +$ymax = 8; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[400,400] +); + +add_functions($gr, "$g for x in <$xmin,$xmax> " . + "using color:blue and weight:1"); +$gr->moveTo($xmin,$f->eval(x=>$xmin)); +$gr->lineTo($xmax,$f->eval(x=>$xmax),'black', 1, dashed); + + + + +############################################## +$refreshCachedImages = 1; + +BEGIN_PGML + +Evaluate each expression using the graph. The graph of [`f`] is in black and dashed, and the graph of [`g`] is in blue and solid. + +[@EnlargeImageStatementPGML()@] + +>>[@ image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + +a) [`(g\circ f)([$h]) ={}`][_______] + +a) [`(f\circ g)([$j]) ={}`][_______] + +a) [`(g\circ g)([$k]) ={}`][_______] + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("LimitedNumeric"); +ANS( Compute("$ans[0]")->cmp); +ANS( Compute("$ans[1]")->cmp); +ANS( Compute("$ans[2]")->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +We use the graph to evaluate the functions. + +a) [`\begin{aligned}[t] +(g\circ f)([$h]) +&= g\left(f\left([$h]\right)\right)\\ +&= g\left([@$f->eval(x=>$h)@]\right)\\ +&= [@$g->eval(x=>$f->eval(x=>$h))@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(f\circ g)([$j]) +&= f\left(g\left([$j]\right)\right)\\ +&= f\left([@$g->eval(x=>$j)@]\right)\\ +&= [@$f->eval(x=>$g->eval(x=>$j))@] +\end{aligned}`] + +a) [`\begin{aligned}[t] +(g\circ g)([$k]) +&= g\left(g\left([$k]\right)\right)\\ +&= g\left([@$g->eval(x=>$k)@]\right)\\ +&= [@$g->eval(x=>$g->eval(x=>$k))@] +\end{aligned}`] + + + +END_PGML_SOLUTION +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/Compounding.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/Compounding.pg new file mode 100644 index 0000000000..fd587ca3bc --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/Compounding.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "contextCurrency.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + + +$initial = random(400,700,20); +$r = random(3, 8, 0.25); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +What's the balance (to the nearest cent) after one year if you invest $DOLLAR$initial at a nominal annual rate of $r$PERCENT if: + +$PAR + +$BBOLD(a.)$EBOLD interest is compounded annually? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + +$PAR + +$BBOLD(b.)$EBOLD interest is compounded weekly? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + +$PAR + +$BBOLD(c.)$EBOLD interest is compounded daily? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + +$PAR + +$BBOLD(d.)$EBOLD interest is compounded continuously? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + +$ans1 = $initial*(1+$r/100); +$ans2 = $initial*((1+($r/100)/52)**52); +$ans3 = $initial*((1+($r/100)/365)**365); +$ans4 = $initial*(2.718281828**($r/100)); + +Context("Currency"); +Context("Currency")->currency->addSymbol("dollars","dollar"); + + +ANS( Currency($ans1)->cmp ); +ANS( Currency($ans2)->cmp ); +ANS( Currency($ans3)->cmp ); +ANS( Currency($ans4)->cmp ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/Compounding2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/Compounding2.pg new file mode 100644 index 0000000000..e73321b27a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/Compounding2.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "contextCurrency.pl", + "parserNumberWithUnits.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + + +$initial = random(400,700,20); +$r = random(3, 8, 0.25); +$timeReal = random(8,15,1); +$time = NumberWithUnits($timeReal,"yr"); + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +What's the balance (to the nearest cent) after \($time\) if you invest $DOLLAR$initial at a nominal annual rate of $r$PERCENT if: + +$PAR + +$BBOLD(a.)$EBOLD interest is compounded annually? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + +$PAR + +$BBOLD(b.)$EBOLD interest is compounded weekly? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + +$PAR + +$BBOLD(c.)$EBOLD interest is compounded daily? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + +$PAR + +$BBOLD(d.)$EBOLD interest is compounded continuously? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + +$ans1 = $initial*((1+$r/100)**$timeReal); +$ans2 = $initial*((1+($r/100)/52)**(52*$timeReal)); +$ans3 = $initial*((1+($r/100)/365)**(365*$timeReal)); +$ans4 = $initial*(2.718281828**($r/100*$timeReal)); + +Context("Currency"); +Context("Currency")->currency->addSymbol("dollars","dollar"); + + +ANS( Currency($ans1)->cmp ); +ANS( Currency($ans2)->cmp ); +ANS( Currency($ans3)->cmp ); +ANS( Currency($ans4)->cmp ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/ContInterest.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/ContInterest.pg new file mode 100644 index 0000000000..25e546de79 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/ContInterest.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "contextCurrency.pl", + "parserNumberWithUnits.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(t=>'Real'); + +$initial = random(800,2000,100); +$k = random(0.025, 0.045, 0.002); + +$B = Formula("$initial*e^($k*t)")->reduce; + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +At time \(t=0\), you deposit $DOLLAR$initial in a bank account, and the balance grows according to \[B=$B.\] + +$PAR + +$BBOLD(a.)$EBOLD What is the balance at the end of 100 years, to the nearest cent? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + +$PAR + +$BBOLD(b.)$EBOLD When does the balance first go over $DOLLAR\(\)60,000? Answer in years, using $BBOLD yr$EBOLD for the unit. For example, $BBOLD 5 yr$EBOLD for 5 years. If you've already studied logarithms, use them. Otherwise, use a graphical method. + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + +$ans1 = $B->eval(t=>100); +$ans2 = round(ln(60000/$initial)/$k); + +Context("Currency"); +Context("Currency")->currency->addSymbol("dollars","dollar"); + + +ANS( Currency($ans1)->cmp ); + +Context("Numeric"); +Context()->flags->set(tolType=>absolute,tolerance=>1); + +ANS( NumberWithUnits($ans2,"yr")->cmp ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/ContVersusAnnual.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/ContVersusAnnual.pg new file mode 100644 index 0000000000..a49c75a000 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/ContVersusAnnual.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "contextCurrency.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(t=>'Real'); + +$initial = random(800,2000,100); +$r = random(3,7,1); +$time = random(10,20,1); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +You deposit $DOLLAR$initial in a bank account. Determine the amount (to the nearest cent) after $time years if: + +$PAR + +$BBOLD(a.)$EBOLD the interest rate is an annual $r$PERCENT. + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + +$PAR + +$BBOLD(b.)$EBOLD the interest rate is $r$PERCENT compounded continuously. + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + +$ans1 = $initial*((1+$r/100)**$time); +$ans2 = $initial*((2.7182818)**($r*$time/100)); + +Context("Currency"); +Context("Currency")->currency->addSymbol("dollars","dollar"); + + +ANS( Currency($ans1)->cmp ); + +ANS( Currency($ans2)->cmp ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/EffectiveRate.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/EffectiveRate.pg new file mode 100644 index 0000000000..cfdd526184 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/EffectiveRate.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + + + +$r = random(5, 12, 0.25); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +A bank's nominal annual interest rate is $r$PERCENT. What is the effective annual interest rate if: + +$PAR + +$BBOLD(a.)$EBOLD interest is compounded annually? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(8)\}$PERCENT + + +$PAR + +$BBOLD(b.)$EBOLD interest is compounded monthly? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(8)\}$PERCENT + +$PAR + +$BBOLD(c.)$EBOLD interest is compounded daily? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(8)\}$PERCENT + +$PAR + +$BBOLD(d.)$EBOLD interest is compounded continuously? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(8)\}$PERCENT + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + +$ans1 = $r; +$ans2 = ((1+($r/100)/12)**(12)-1)*100; +$ans3 = ((1+($r/100)/365)**(365)-1)*100; +$ans4 = (2.718281828**($r/100)-1)*100; + + + +ANS( Compute($ans1)->cmp ); +ANS( Compute($ans2)->cmp ); +ANS( Compute($ans3)->cmp ); +ANS( Compute($ans4)->cmp ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/FindRate.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/FindRate.pg new file mode 100644 index 0000000000..c006e0ab86 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/FindRate.pg @@ -0,0 +1,81 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + + +$initial = random(1800,3300,150); +$nominal = random(6.1, 12.9, 0.2); +$time = random(6,10,1); +$final = $initial*((1+$nominal/100/4)**(4*$time)); + +Context("Currency"); +$final = Currency("$final"); +$initial = Currency("$initial"); + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +A sum of \($initial\) is invested for $time years, and interest is awarded quarterly. There is \($final\) in the account at the end of the $time years. What was the nominal annual interest rate? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(4)\}$PERCENT + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("Numeric"); +Context()->flags->set(tolType=>absolute,tolerance=>0.01); + + + +ANS( Compute($nominal)->cmp() ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/FindRate2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/FindRate2.pg new file mode 100644 index 0000000000..7c9f1e4232 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/FindRate2.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + + +$multiYearRate = random(20,40,1); +$time = random(4,10,1); + +$r = ((1+$multiYearRate/100)**(1/$time)-1)*100; + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +An investment grows by $multiYearRate$PERCENT over a $time-year period. What is its effective annual interest rate? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(4)\}$PERCENT + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("Numeric"); +Context()->flags->set(tolType=>absolute,tolerance=>0.05); + + + +ANS( Compute($r)->cmp() ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/InterestChoice.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/InterestChoice.pg new file mode 100644 index 0000000000..018f8ee6eb --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/InterestChoice.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserRadioButtons.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + + + +$r[0] = random(3, 8, 0.1); +$r[1] = ceil(1000*(2.718281828**($r[0]/100)-1))/10; + + +$radio = RadioButtons( + ["$r[0]$PERCENT compounded continuously","$r[1]$PERCENT compounded annually"], + "$r[1]$PERCENT compounded annually", # correct answer + last => ["$r[1]$PERCENT compounded annually"], # can be a list +); + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Which is a better investment? An account paying $r[0]$PERCENT compounded continuously, or one that pays $r[1]$PERCENT compounded annually? + +$PAR + +\{ $radio->buttons() \} + +$PAR + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + +ANS( $radio->cmp() ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/Nominal.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/Nominal.pg new file mode 100644 index 0000000000..ce0a21a1db --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/Nominal.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + + + +$nominal = random(6.1, 12.9, 0.2); +$yearlyFactor = ($nominal/100/12+1)**12; +$effective = $yearlyFactor - 1; + + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +A certain bank account will take your deposit of \(P\) dollars, compound interest monthly, and after \(t\) years leave you with \[A(t)=P($yearlyFactor)^t.\] + + +$PAR + +$BBOLD(a.)$EBOLD What is the effective annual rate? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(5)\}$PERCENT + +$PAR + +$BBOLD(b.)$EBOLD What is the nominal annual rate? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(5)\}$PERCENT + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(tolType=>absolute,tolerance=>0.1); + +ANS( Compute($effective*100)->cmp() ); + +ANS( Compute($nominal)->cmp() ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/NominalForm.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/NominalForm.pg new file mode 100644 index 0000000000..3bf1269718 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Interest/NominalForm.pg @@ -0,0 +1,108 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +%frequencyword = (12 => "monthly", 52 => "weekly", 4 => "quarterly"); + +$frequency = list_random(12, 52, 4); +$word = $frequencyword{$frequency}; + +$nominal = random(6.1, 12.9, 0.2); +$nominaldecimal = $nominal/100; +$yearlyFactor = ($nominal/100/$frequency+1)**$frequency; +$effective = $yearlyFactor - 1; +$effectiveans = $effective*100; + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +A certain bank account will take your deposit of \(P\) dollars, compound interest $word, and after \(t\) years leave you with \[A(t)=P\left(1+\frac{$nominaldecimal}{$frequency}\right)^{$frequency t}.\] + + +$PAR + +$BBOLD(a.)$EBOLD What is the effective annual rate? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(5)\}$PERCENT + +$PAR + +$BBOLD(b.)$EBOLD What is the nominal annual rate? + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(5)\}$PERCENT + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(tolType=>absolute,tolerance=>0.04); + +ANS( Compute($effective*100)->cmp() ); + +ANS( Compute($nominal)->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +From the given formula, we can simply read that the nominal annual rate is [`[$nominal]%`]. + +In the standard form of an exponential function, [`f(t)=ab^t`], we know the growth factor is [`b`]. The growth factor is one plus the growth rate or [`b=1+r`] then [`r=b-1`]. From the formula given in this problem the growth factor is [`b=\left(1+\frac{[$nominaldecimal]}{[$frequency]}\right)^{[$frequency]}`] and the effective annual rate is: + + [`\begin{aligned} +r&=b-1\\ +&=\left(1+\frac{{[$nominaldecimal]}}{[$frequency]}\right)^{[$frequency]}-1\\ +&\approx [$effective*100]%\\ +\end{aligned}`] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions10.pg new file mode 100644 index 0000000000..c49be86309 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions10.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## Tagged by tda2d + +## DBsubject(Algebra) +## DBchapter(Inverse functions) +## DBsection(1-1 functions) +## Date(6/3/2002) +## Level(2) +## TitleText1('College Algebra') +## AuthorText1('Stewart, Redlin, Watson') +## EditionText1('3') +## Section1('4.8') +## Problem1('18') +## KEYWORDS('function' 'inverse','functions', 'inverse functions', 'one-to-one' ) + +############################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"PGcourse.pl" +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +do {$a1 = random(-15,15,1); +$b1 = random(1,15,1);} until ($a1 != $b1); + +do {$c1 = random(-15,15,1); +$d1 = random(1,15,1);} until ($c1 != $d1); + +Context("Numeric"); +$ans1 = Real($a1); +$ans3 = Real($c1); + +Context("Fraction"); +$ans2 = Fraction(1,$b1); +$ans4 = Fraction(1,$d1); + + + +############################################## + +BEGIN_PGML + +a) If [` f `] is one-to-one and [` f([$a1]) = [$b1]`], then + + [` f^{-1}( [$b1] ) ={}`][_______________________]{$ans1} + + and [` \left(f( [$a1] )\right)^{-1} ={}`][_______________________]{$ans2}. + +a) If [` g `] is one-to-one and [` g([$c1]) = [$d1] `], then + + [` g^{-1}( [$d1] ) ={}`][_______________________]{$ans3} + + and [` \left(g( [$c1] )\right)^{-1} {}`][_______________________]{$ans4}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +a) Since [`f`] takes [`[$a1]`] to [`[$b1]`], [`f^{-1}`] takes [`[$b1]`] to [`[$a1]`]. So [` f^{-1}( [$b1] ) =[$a1]`]. + + In the next expression, the [`-1`] in the superscript means something very different: + [`\begin{aligned} \left(f( [$a1] )\right)^{-1} &=([$b1])^{-1}\\&=[$ans2]\end{aligned}`] + +a) Since [`g`] takes [`[$c1]`] to [`[$d1]`], [`g^{-1}`] takes [`[$d1]`] to [`[$c1]`]. So [` g^{-1}( [$d1] ) =[$c1]`]. + + In the next expression, the [`-1`] in the superscript means something very different: + [`\begin{aligned} \left(g( [$c1] )\right)^{-1} &=([$d1])^{-1}\\&=[$ans4]\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions100.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions100.pg new file mode 100644 index 0000000000..806f639260 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions100.pg @@ -0,0 +1,128 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGcourse.pl" +); + +########################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,5); +$per = 6*random(1,3); +$d = non_zero_random(-2,2); + +$xdom1 = -0.125*$per; +$xdom2 = .875*$per; +#$xdom1 = -$per/(2*pi)*arccos(1 - 1/$a); +#$xdom2 = $xdom1 + $per; +$xmin = floor($xdom1) - 1; +$xmax = floor($xdom2) + 2; +$ymax = $a + $d + 1; +$ymin = -$a + $d - 1; +$end_height = $a + $d - 1; + +$g = FEQ("$a*cos(2*pi/$per*x) + $d for x in [$xdom1,$xdom2] using color:black and weight:2"); + +$xgrid = $xmax - $xmin; +$ygrid = $ymax - $ymin; +$graph = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0],'grid'=>[$xgrid,$ygrid], size =>[400,400]); +$gRef = plot_functions($graph,$g); + +$x1 = 0; +$g1 = $a + $d; +$x2 = $per/2; +$g2 = $d - $a; +$x3 = $xdom2; +$g3 = $a*cos(2*pi/$per*$x3) + $d; + +Context("Interval"); +Context()->flags->set(ignoreEndpointTypes => 1); +Context()->flags->set(tolType => absolute); +Context()->flags->set(tolerance => 0.3); + +$ans1 = Interval("[$x2,$x3]"); +$ans2 = Interval("[$g2,$g3]"); +$ans3 = Interval("[$x2,$x3]"); +$ans4 = Interval("[$x1,$x2]"); +$ans5 = Interval("[$g2,$g1]"); +$ans6 = Interval("[$x1,$x2]"); + + +########################################## + +$refreshCachedImages = 1; + +BEGIN_PGML + +Use the graph of [`g`] below to answer the questions that follow. Assume that the domain of [`g`] is [`[[$xdom1], [$xdom2]]`]. + +[@EnlargeImageStatementPGML@]** + +>>[@ image(insertGraph($graph),height=>400,width=>400,tex_size=>800) @]* << + +a) What is the largest interval on which [`g`] is increasing? + + [__________________]{$ans1} + +a) Let [`G`] denote the function obtained from [`g`] by restricting the domain to the interval in part (a). What is the domain of [`G^{-1}`]? + + [__________________]{$ans2} + +a) What is the range of [`G^{-1}`] + + [__________________]{$ans3} + +a) What is the largest interval contained in the domain of [`g`] on which [`g`] is decreasing? + + [__________________]{$ans4} + +a) Let [`J`] denote the function obtained from [`g`] by restricting the domain to the interval in (d). What is the domain of [`J^{-1}`]? + + [__________________]{$ans5} + +a) What is the range of [`J^{-1}`]? + + [__________________]{$ans6} + +END_PGML + +########################################## + + + +$graphG = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0],'grid'=>[$xgrid,$ygrid], size =>[400,400]); +add_functions($graphG, "$a*cos(2*pi/$per*x) + $d for x in <$x2,$x3>" . + " using color:black and weight:2"); +$graphG->stamps( closed_circle($x2,$g2,'black') ); +$graphG->stamps( closed_circle($x3,$g3,'black') ); + + +$graphJ = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0],'grid'=>[$xgrid,$ygrid], size =>[400,400]); +add_functions($graphJ, "$a*cos(2*pi/$per*x) + $d for x in <$x1,$x2>" . + " using color:black and weight:2"); +$graphJ->stamps( closed_circle($x1,$g1,'black') ); +$graphJ->stamps( closed_circle($x2,$g2,'black') ); + + +BEGIN_PGML_SOLUTION + +The largest interval on which [`g`] is increasing is [`[$ans1]`]. If we restrict [`g`] to this interval to get the function [`G`], graphed below. The domain of [`G^{-1}`] is the same as the range of [`G`], which is [`[$ans2]`]. And the range of [`G^{-1}`] is the same as the domain of [`G`], which is [`[$ans3]`]. + +>>[@ image(insertGraph($graphG),height=>400,width=>400,tex_size=>800) @]* << + + +The largest interval on which [`g`] is increasing is [`[$ans4]`]. If we restrict [`g`] to this interval to get the function [`J`], graphed below. The domain of [`J^{-1}`] is the same as the range of [`J`], which is [`[$ans5]`]. And the range of [`J^{-1}`] is the same as the domain of [`J`], which is [`[$ans6]`]. + +>>[@ image(insertGraph($graphJ),height=>400,width=>400,tex_size=>800) @]* << + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions110.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions110.pg new file mode 100644 index 0000000000..5809f792b7 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions110.pg @@ -0,0 +1,164 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGchoicemacros.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"extraAnswerEvaluators.pl", +"answerHints.pl", +"parserPopUp.pl", +"PGcourse.pl", +); + +#################################### + +TEXT(beginproblem()); + +$a = random(2,4); +$b1 = random(-3, -1); +$d = list_random(-2,-1,1,2); +$b = $b1 - $a*$d; +do {$c = random(2,4);} until $c != $d; + +$xdom1 = $b1 - 3; +$xdom2 = $c + 3; + +# y-coord at edges of graph +$y0dom1 = 1/$a * $xdom1 - $b/$a; +$y0dom2 = sqrt($xdom2 - $c) + $d; +$y1dom1 = 1/$a *$xdom1 + $b; +$y1dom2 = sqrt($xdom2 - $d) + $c; +$y2dom1 = $a*$b1 + $b/$a; +$y2dom2 = sqrt($xdom2 - $c) + $d; +$y3dom1 = -1/$a*$xdom1 + $b; +$y3dom2 = sqrt($xdom2) + $c; + +# y-coord at end of line +$y0end1 = 1/$a * $b1 - $b/$a; +$y1end1 = 1/$a * $b1 + $b; +$y2end1 = $b/$a; +$y3end1 = -1/$a * $b1 + $b; + +# y-coord at tip of the parabola/root function graph +$y0end2 = $d; +$y1end2 = sqrt($c - $d) + $c; +$y2end2 = $d; +$y3end2 = sqrt($c) + $c; + +$maxydom1 = int(min($y0dom1, $y1dom1, $y2dom1, $y3dom1))-1; +$maxydom2 = int(max($y0dom2, $y1dom2, $y2dom2, $y3dom2))+1; + +@slice = &NchooseK(5,5); +@shuffle = &shuffle(scalar(@slice)); +@sc = ("red", "green", "blue", "orange", "black"); + +$ga[0] = FEQ("1/$a*x- $b/$a for x in <$xdom1,$b1> using color:$sc[$shuffle[0]] and weight:2"); +$gb[0] = FEQ("sqrt(x - $c) + $d for x in <$c,$xdom2> using color:$sc[$shuffle[0]] and weight:2"); + +$ga[1] = FEQ("1/$a *x + $b for x in <$xdom1,$b1> using color:$sc[$shuffle[1]] and weight:2"); +$gb[1] = FEQ("sqrt(x - $d) + $c for x in <$c,$xdom2> using color:$sc[$shuffle[1]] and weight:2"); + +$ga[2] = FEQ("$a*x + $b/$a for x in <$xdom1,0> using color:$sc[$shuffle[2]] and weight:2"); +$gb[2] = FEQ("(x - $c)^2 + $d for x in <$c,$xdom2> using color:$sc[$shuffle[2]] and weight:2"); + +$ga[3] = FEQ("-1/$a*x + $b for x in <$xdom1,$b1> using color:$sc[$shuffle[3]] and weight:2"); +$gb[3] = FEQ("sqrt(x) + $c for x in <$c,$xdom2> using color:$sc[$shuffle[3]] and weight:2"); + +$graphg = init_graph($xdom1,$maxydom1,$xdom2,$maxydom2,'axes'=>[0,0],'grid'=>[$xdom2 - $xdom1,$maxydom2-$maxydom1],size=>[400,400]); + +($gaRef[0],$gbRef[0],$gaRef[1],$gbRef[1],$gaRef[2],$gbRef[2],$gaRef[3],$gbRef[3]) = plot_functions( $graphg,$ga[0],$gb[0],$ga[1],$gb[1],$ga[2],$gb[2],$ga[3],$gb[3]); +$graphg->stamps( open_circle($b1,$y0end1,$sc[$shuffle[0]]) ); +$graphg->stamps( open_circle($b1,$y1end1,$sc[$shuffle[1]]) ); +$graphg->stamps( open_circle(0,$y2end1,$sc[$shuffle[2]]) ); +$graphg->stamps( open_circle($b1,$y3end1,$sc[$shuffle[3]]) ); +$graphg->stamps( closed_circle($c,$y0end2,$sc[$shuffle[0]]) ); +$graphg->stamps( closed_circle($c,$y1end2,$sc[$shuffle[1]]) ); +$graphg->stamps( closed_circle($c,$y2end2,$sc[$shuffle[2]]) ); +$graphg->stamps( closed_circle($c,$y3end2,$sc[$shuffle[3]]) ); + +$popup = PopUp(['?',"red", "green", "blue", "orange", "black"], $sc[$shuffle[0]]); + +#################################### +$refreshCachedImages = 1; +BEGIN_PGML + +Consider the piecewise function [`f`] defined by + + [`f(x)= \begin{cases} + [$a] x + [$b] & x < [$d]\\ + (x - [$d])^2 + [$c] & x \geq [$d]\end{cases} `] + +a) What is the domain of [`f^{-1}`]? + + [__________________________] + +a) Which of the following is the graph of the inverse of [`f`], [`y=f^{-1}(x)`]? + +[@EnlargeImageStatementPGML()@]** + +>> [@ image(insertGraph($graphg), width=>400, height=>400, tex_size=>800) @]* << + +The graph of [`f^{-1}`] is the [@$popup->menu@]* graph. + +END_PGML + +#################################### +$ans = Interval("(-infinity,$b1)U[$c,infinity)"); +ANS($ans->cmp()->withPostFilter(AnswerHints( + Interval("(-infinity, infinity)") => "(-infinity, infinity) is the domain of f, not of f inverse", +))); +ANS($popup->cmp); + +#################################### + +$graphf = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[16,16],size=>[400,400]); + +add_functions($graphf, "$a*x+$b for x in <-8,$d>" . + " using color:black and weight:2"); +add_functions($graphf, "(x - [$d])^2 + [$c] for x in <$d, 8>" . + " using color:black and weight:2"); +$graphf->stamps( open_circle($y0end1,$b1,'black') ); +$graphf->stamps( closed_circle($y0end1,$c,'black') ); + +$graphfinv = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[16,16],size=>[400,400]); + +add_functions($graphfinv, "$a*x+$b for x in <-8,$d>" . + " using color:black and weight:1"); +add_functions($graphfinv, "(x - [$d])^2 + [$c] for x in <$d, 8>" . + " using color:black and weight:1"); +$graphfinv->stamps( open_circle($y0end1,$b1,'black') ); +$graphfinv->stamps( closed_circle($y0end1,$c,'black') ); + +$graphfinv->moveTo(-8,-8); +$graphfinv->lineTo(8,8,'black',1,'dashed'); + +$corcolor = $popup->correct_ans; +add_functions($graphfinv, "(x-($b))/$a for x in <-8,$b1>" . + " using color:$corcolor and weight:2"); +add_functions($graphfinv, "sqrt(x-($c))+$d for x in <$c, 8>" . + " using color:$corcolor and weight:2"); +$graphfinv->stamps( open_circle($b1,$y0end1,$corcolor) ); +$graphfinv->stamps( closed_circle($c,$y0end1,$corcolor) ); + + + +BEGIN_PGML_SOLUTION + +To find the domain of [`f^{-1}`], we will find the range of [`f`]. One way to find the range of [`f`] is to graph [`f`] and examine its graph. Below is the graph of + +>> [@ image(insertGraph($graphf), width=>400, height=>400, tex_size=>800) @]* << + +And we can see that the range of [`f`] (and therefore the domain of [`f^{-1}`]) is [`[$ans]`]. + +To find the graph of [`f^{-1}`], we reflect the graph of [`f`] over the line [`y=x`]: + +>> [@ image(insertGraph($graphfinv), width=>400, height=>400, tex_size=>800) @]* << + +And we can see that the graph of [`f^{-1}`] is the [@$popup->correct_ans@] graph. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions120.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions120.pg new file mode 100644 index 0000000000..410c574f3f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions120.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Inverse Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "parserRoot.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("LimitedRadical"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(r=>'Real',V=>'Real'); + + +$f = Formula("4/3 pi r^3"); + +$inverse = Formula("root(3, (3*V)/(4*pi))"); + + +############################################## + + +BEGIN_PGML + +The formula [`V=f(r)=[$f]`] gives the volume of a sphere of radius [`r`]. Find a formula for the inverse function [`f^{-1}`]. If you need to enter [`\pi`], type *pi*. If you need to use an nth root, as in [`\sqrt[n]{x}`], type it as *root(n,x)*. + + [`f^{-1}(V) ={}`][____________________]{$inverse} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +To find a formula for [`f^{-1}`], we can start with a formula for [`f`], replace [`f(r)`] with [`V`], and solve for [`r`]: + + [`\begin{aligned} +f(r)&=[$f]\\ +V&=[$f]\\ +\frac{3V}{4\pi}&= r^3\\ +[$inverse] &= r +\end{aligned}`] + +So [`f^{-1}(V)=[$inverse]`]. +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions130.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions130.pg new file mode 100644 index 0000000000..2ec3c61a32 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions130.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Inverse Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(q=>'Real', C=>'Real'); + + +$base = random(80,120,5); +$rate = random(0.1,0.2,0.1); + +$f = Formula("$base + $rate*q"); + +$inverse = Formula("(C-$base)/$rate"); + + +############################################## + + +BEGIN_PGML + +The cost [`C`] (in thousands of dollars) of producing [`q\;\mathrm{kg}`] of a chemical is given by [`C=f(q)=[$f]`]. + +a) Find [`f(10)`]. + + [`f(10)={}`][_______________] + +a) Find [`f^{-1}(200)`]. + + [`f^{-1}(200)={}`][_______________] + + +a) Find [`f^{-1}(C)`]. + + [`f^{-1}(C)={}`][_______________] + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + + +ANS( $f->eval(q=>10)->cmp() ); +ANS( $inverse->eval(C=>200)->cmp() ); +ANS( $inverse->cmp() ); + +############################################## + +Context()->texStrings; + +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +f(10) &= [@$f->substitute(q=>Formula("10"))@]\\ +&= [@$f->eval(q=>10)@] +\end{aligned}`] + + This means that to produce [`10\;\mathrm{kg}`] of the chemical will cost [`$[@1000*$f->eval(q=>10)@]`]. + +a) To find [`f^{-1}(200)`], we solve the equation + + [`\begin{aligned}[t] +f(q) &= 200\\ +[$f] &= 200\\ +[$rate]q & = [@200-$base@]\\ +q &= [@$inverse->eval(C=>200)@] +\end{aligned}`] + + This means that if it had cost [`$200000`] to produce some amount of the chemical, then [`[@$inverse->eval(C=>200)@]\;\mathrm{kg}`] of the chemical was produced. + +a) To find [`f^{-1}(C)`], we solve the equation + + [`\begin{aligned}[t] +f(q) &= C\\ +[$f] &= C\\ +[$rate]q & = C - [$base]\\ +q &= \frac{C - [$base]}{[$rate]} +\end{aligned}`] + + So [`f^{-1}(C)=\frac{C - [$base]}{[$rate]}`]. + +END_PGML_SOLUTION + +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions131.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions131.pg new file mode 100644 index 0000000000..7723dd7c12 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions131.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Inverse Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(q=>'Real', C=>'Real'); + + +$base = random(80,120,5); +$rate = random(0.1,0.2,0.1); + +$f = Formula("$base + $rate*q"); + +$inverse = Formula("(C-$base)/$rate"); + +############################################## + + +BEGIN_PGML + +The cost [`C`] (in thousands of dollars) of producing [`q\;\mathrm{kg}`] of a chemical is given by [`C=f(q)=[$f]`]. + +a) Find [`f(10)`]. + + [`f(10)={}`][_______________] + +a) Find [`f^{-1}(200)`]. + + [`f^{-1}(200)={}`][_______________] + + +a) Find [`f^{-1}(C)`]. + + [`f^{-1}(C)={}`][_______________] + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + + +ANS( $f->eval(q=>10)->cmp() ); +ANS( $inverse->eval(C=>200)->cmp() ); +ANS( Formula("q")->cmp() ); + +############################################## + +Context()->texStrings; + +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +f(10) &= [@$f->substitute(q=>Formula("10"))@]\\ +&= [@$f->eval(q=>10)@] +\end{aligned}`] + + This means that to produce [`10\;\mathrm{kg}`] of the chemical will cost [`$[@1000*$f->eval(q=>10)@]`]. + +a) To find [`f^{-1}(200)`], we solve the equation + + [`\begin{aligned}[t] +f(q) &= 200\\ +[$f] &= 200\\ +[$rate]q & = [@200-$base@]\\ +q &= [@$inverse->eval(C=>200)@] +\end{aligned}`] + + This means that if it had cost [`$200000`] to produce some amount of the chemical, then [`[@$inverse->eval(C=>200)@]\;\mathrm{kg}`] of the chemical was produced. + +a) Since [`C=f(q)`] is the original function, [`f^{-1}(C)=f^{-1}\left(f(q)\right)=q`] + + So [`f^{-1}(C)=q`]. In other words, [`C=f(q)`] and [`f^{-1}(C)`] canceled out each other. + +END_PGML_SOLUTION + +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions140.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions140.pg new file mode 100644 index 0000000000..a4fac7f98b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions140.pg @@ -0,0 +1,78 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Inverse Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$base = random(500,800,50); +$rate = random(35,55,5); + +$g = Formula("$base + $rate*x"); + +Context()->variables->add(C=>'Real'); +$inverse = Formula("(C-$base)/$rate"); + + +############################################## + + +BEGIN_PGML + +The cost (in dollars) of producing [`x`] high-end plasma television sets is [`C=g(x)=[$g]`]. Find a formula for the inverse function [`g^{-1}`]. + + [`g^{-1}(C) ={}`][_____________________]{$inverse} + +END_PGML + + + +############################################## + +BEGIN_PGML_SOLUTION + +We can find the inverse of [`g`] by starting with a formula for [`g`], replacing [`g(x)`] with [`C`], and solving for [`x`]: + + [`\begin{aligned} +g(x) &= [$g]\\ +C &= [$g]\\ +C - [$base] &= [$rate]x\\ +[$inverse] &= x +\end{aligned}`] + +So [`g^{-1}(C)=[$inverse]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions150.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions150.pg new file mode 100644 index 0000000000..b2bbbf576a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions150.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Inverse Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->variables->are(t=>'Real',y=>'Real'); + +$a = non_zero_random(-4,5,1); + +$g = Formula("sqrt(t)+$a")->reduce; + +$inverse = Formula("(y-$a)^2")->reduce; + +Context("Interval"); +$domain = Interval("[$a,INF)"); + + +############################################## + + +BEGIN_PGML + +Let [`y=g(t)=[$g]`]. + +Find a formula for the inverse function of [`g`]. + + [`g^{-1}\left(y\right) ={}`][___________________]{$inverse} + +The inverse function has a restricted domain. What is the domain of [`g^{-1}`]? Use interval notation. If you need to enter [`\infty`], type *inf*. + + The domain of [`g^{-1}`] is [_____________________]{$domain} + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers=1; + +BEGIN_PGML_SOLUTION + +We can find the inverse of [`g`] by starting with a formula for [`g`], replacing [`g(x)`] with [`y`], and solving for [`t`]: + + [`\begin{aligned} +g(t) &= [$g]\\ +y &= [$g]\\ +y - [$a] &= \sqrt{t}\\ +[$inverse] &= t +\end{aligned}`] + +So [`g^{-1}\left(y\right)=[$inverse]`]. + +Since the range of [`g`] is [`[$domain]`], this is the domain of [`g^{-1}`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions160.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions160.pg new file mode 100644 index 0000000000..a87cdf99c8 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions160.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Inverse Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$tableStart = random(-3,0,1); +@xVals = ($tableStart..$tableStart+4); + + +%f = ( + $xVals[0] => non_zero_random(1,3,1), + $xVals[1] => non_zero_random(4,6,1), + $xVals[2] => non_zero_random(7,15,1), + $xVals[3] => 0, + $xVals[4] => non_zero_random(-5,-1,1), + ); + + +############################################## + +BEGIN_PGML +Use the table below to find the values to fill in the blanks. + +END_PGML + +BEGIN_TEXT +$PAR + +\{ +DataTable( +[ +[{data=>"\(x\)", header=>'RH'},"\($xVals[0]\)","\($xVals[1]\)","\($xVals[2]\)","\($xVals[3]\)","\($xVals[4]\)"], +[{data=>"\(f(x)\)", header=>'RH', rowcss=>"border-bottom:solid 1px"},"\($f{$xVals[0]}\)","\($f{$xVals[1]}\)","\($f{$xVals[2]}\)","\($f{$xVals[3]}\)","\($f{$xVals[4]}\)"] +], +allcellcss=>"padding:6pt; border-top:solid 1px;" +); +\} +$PAR + + +\{ + LayoutTable( +[ +["\(f(0)={}?\)",ans_rule(15)], +["\(f(?)={}0\)",ans_rule(15)], +["\(f^{-1}(0)={}?\)",ans_rule(15)], +["\(f^{-1}(?)=0\)",ans_rule(15)] +] +) +\} + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers=1; + + +ANS( Compute($f{0})->cmp() ); +ANS( Compute($xVals[3])->cmp() ); +ANS( Compute($xVals[3])->cmp() ); +ANS( Compute($f{0})->cmp() ); + +############################################## + +$s = $f{0}; +$s2 = $xVals[3]; + +BEGIN_PGML_SOLUTION + +The table show us that [`f(0)=[$s]`]. This also means that [`f^{-1}([$s])=0`]. + +The table show us that [`f([$s2])=0`]. This also means that [`f^{-1}(0)=[$s2]`]. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions170.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions170.pg new file mode 100644 index 0000000000..9f6a50cefd --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions170.pg @@ -0,0 +1,142 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Inverse Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "pccTables.pl", + "PGML.pl", + "parserAssignment.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$c = -random(1,3,1); +$b = random(-5,-2,1); +$a = random(2,4,1); + +$A = $a - $c; +$B = ln(-$c/$A)/$b; +$f = Formula("$A*exp($B*x)+$c"); + + + + +$xmin = 2*$b; +$xmax = -$b; +$ymin = 2*$c; +$ymax = 3*$a; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +size=>[400,400] +); + + +add_functions($gr, "$f for x in <$xmin,$xmax>" . + " using color:blue and weight:1"); + + +$gr->lb( new Label(0.1,$a,$a, + 'black','left','top')); + +$gr->lb( new Label($b,-0.1,$b, + 'black','left','top')); + +$gr->lb( new Label(0.1,$ymax-1,'y', + 'black','left','top')); + +$gr->lb( new Label($xmax-1,-0.1,'x', + 'black','left','top')); + + +$ans[0] = Compute("$a"); +$ans[1] = Compute("$b"); +$ans[2] = Compute("$b"); +$ans[3] = Compute("$a"); + + + +############################################## +$refreshCachedImages = 1; + +BEGIN_PGML + +Use the graph below to find the missing values. + +[@EnlargeImageStatementPGML@]** + +>>[@image( insertGraph($gr), +width=>400,height=>400,tex_size=>800 )@]* << + +END_PGML + +BEGIN_TEXT +$PAR + +\{ + LayoutTable( +[ +["\(f(0)={}?\)",ans_rule(15)], +["\(f(?)={}0\)",ans_rule(15)], +["\(f^{-1}(0)={}?\)",ans_rule(15)], +["\(f^{-1}(?)=0\)",ans_rule(15)] +] +) +\} + + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers=1; + + +ANS( $ans[0]-> cmp ); +ANS( $ans[1]-> cmp ); +ANS( $ans[2]-> cmp ); +ANS( $ans[3]-> cmp ); + +############################################## + +BEGIN_PGML_SOLUTION + +The table show us that [`f(0)=[$a]`]. This also means that [`f^{-1}([$a])=0`]. + +The table show us that [`f([$b])=0`]. This also means that [`f^{-1}(0)=[$b]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions180.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions180.pg new file mode 100644 index 0000000000..7efeabc598 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions180.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Inverse Functions') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "pccTables.pl", + "PGML.pl", + "parserAssignment.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + + +Context("Numeric"); + + + +$f = Formula("-x-1/(x+1)+2+1/3"); + + + + +$xmin = -0.5; +$xmax = 2.5; +$ymin = -0.5; +$ymax = 2; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +size=>[400,400] +); + + +add_functions($gr, "$f for x in <0,2>" . + " using color:blue and weight:1"); + + +$gr->lb( new Label(-0.1,1+1/3,'b', + 'black','left','top')); + +$gr->lb( new Label(2,-0.1,'a', + 'black','left','bottom')); + +$gr->lb( new Label(-0.1,$ymax-0.2,'y', + 'black','left','top')); + +$gr->lb( new Label($xmax-0.2,-0.1,'x', + 'black','left','bottom')); + +Context()->variables->are(a=>'Real',b=>'Real'); + +$ans[0] = Compute("b"); +$ans[1] = Compute("a"); +$ans[2] = Compute("a"); +$ans[3] = Compute("b"); + + + +############################################## +$refreshCachedImages = 1; + +BEGIN_PGML + +Use the graph below to find the missing values. + +[@EnlargeImageStatementPGML@]** + +>>[@image( insertGraph($gr), +width=>400,height=>400,tex_size=>800 )@]* << + +END_PGML + +BEGIN_TEXT +$PAR + +\{ + LayoutTable( +[ +["\(f(0)={}?\)",ans_rule(15)], +["\(f(?)={}0\)",ans_rule(15)], +["\(f^{-1}(0)={}?\)",ans_rule(15)], +["\(f^{-1}(?)=0\)",ans_rule(15)] +] +) +\} + + +END_TEXT + + +############################################## + + +$showPartialCorrectAnswers=1; + + +ANS( $ans[0]-> cmp ); +ANS( $ans[1]-> cmp ); +ANS( $ans[2]-> cmp ); +ANS( $ans[3]-> cmp ); + +############################################## + +BEGIN_PGML_SOLUTION + +The table show us that [`f(0)=b`]. This also means that [`f^{-1}(b)=0`]. + +The table show us that [`f(a)=0`]. This also means that [`f^{-1}(0)=a`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions190.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions190.pg new file mode 100644 index 0000000000..ea09df2b80 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions190.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +do{ $a = random(2,8,1); +$b = random(2,10,1); +$c = random(-1,1,2)*random(2,5,1);} until ($a != -$c); +while (gcd($b,$c) != 1) +{$c = non_zero_random(-5,5,1);}; + + +$f = Formula("$a x / ($b x + $c)")->reduce; + + + +Context("Numeric"); +$answer = Formula("-$c x/($b x -$a)"); + +Context("Fraction"); +$negcob = Fraction("-$c","$b"); +$aob = Fraction("$a","$b"); + +Context("Interval"); +Context()->flags->set(reduceConstants=>0); + +$domf = Compute("(-INF,$negcob)U($negcob,INF)"); +$domfi = Compute("(-INF,$aob)U($aob,INF)"); + + + +############################################## + + +BEGIN_PGML + +Find a formula for the inverse function of [`f`], where [`f(x)=[$f]`]. + + [`f^{-1}(x) ={}`][___________________] + + +For the next questions, give your answer using interval notation. If you have to use [`\infty`], type *inf*. If you need to use the union symbol [`\cup`], type *U*. + +END_PGML + +BEGIN_TEXT + +\{ +LayoutTable( +[ +["What is the domain of \(f\)?",ans_rule(20)], +["What is the range of \(f\)?",ans_rule(20)], +["What is the domain of \(f^{-1}\)?",ans_rule(20)], +["What is the range of \(f^{-1}\)?",ans_rule(20)] +], +allcellcss => 'text-align:left;' +) +\} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 1; + + +ANS( $answer->cmp() ); +ANS( $domf->cmp() ); +ANS( $domfi->cmp() ); +ANS( $domfi->cmp() ); +ANS( $domf->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +To find a formula for the inverse of [`f`], we can use the formula for [`f`] and replace [`f(x)`] with [`y`], and then solve for [`x`]. + + [`\begin{aligned} +f(x)&=[$f]\\ +y&=[$f]\\ +y([$b] x + [$c])&=[$a] x \\ +[$b] xy + [$c]y&=[$a] x \\ +[$b] xy - [$a] x&= [$c*-1]y\\ +x\left([$b] y - [$a] \right)&= [$c*-1]y\\ +x&= \frac{[$c*-1]y}{[$b] y - [$a]} +\end{aligned}`] + +So [`f^{-1}\left(y\right)=\frac{[$c*-1]y}{[$b] y - [$a]}`]. Since we have been asked to find [`f^{-1}(x)`], we write [`f^{-1}\left(x\right)=[$answer]`]. + + +Now that we have formulas for both [`f`] and [`f^{-1}`], we can see that [`f`]'s domain excludes [`[$negcob]`]. So the domain of [`f`] is [`\left(-\infty,[$negcob]\right)\cup\left([$negcob],\infty\right)`]. And that means that the range of [`f^{-1}`] is also [`\left(-\infty,[$negcob]\right)\cup\left([$negcob],\infty\right)`]. + +We can see that [`f^{-1}`]'s domain excludes [`[$aob]`]. So the domain of [`f^{-1}`] is [`\left(-\infty,[$aob]\right)\cup\left([$aob],\infty\right)`]. And that means that the range of [`f`] is also [`\left(-\infty,[$aob]\right)\cup\left([$aob],\infty\right)`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions20.pg new file mode 100644 index 0000000000..ad91f16b0e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions20.pg @@ -0,0 +1,112 @@ +## Author('') +## Institution('') +## DBsubject('') +## DBchapter('') +## DBsection('') +## AuthorText1('') +## TitleText1('') +## EditionText1('') +## Section1('') +## Problem1('') +## KEYWORDS('') + +DOCUMENT(); # This should be the first executable line in the problem. + +########################################### + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"parserPopUp.pl", +"PGcourse.pl", +); + +########################################### + +TEXT(&beginproblem); + +#Pick random numbers so that the inverse is defined at the point of interest and so that the values from parts (a) and (b) are not equal, by coincidence +do { + do {$a = non_zero_random(-9,9,1); + $b = non_zero_random(-9,9,1); + $ans2 = Compute((1-$b)/$a);} until ($a + $b != 0 and abs($a) != 1) ; +$ans3 = Compute(1/($a+$b));} until $ans2 != $ans3; + +Context("Numeric"); +Context()->variables->are(x=>'Real',y=>'Real'); +Context()->noreduce('(-x)-y'); +Context()->flags->set(reduceConstants=>0); + +$f = Formula("$a x + $b")->reduce; +$finv = Formula("(y- $b)/$a")->reduce; + +$popup = PopUp(["?", "Yes", "No"], "No"); + +Context("Fraction"); +$ans1 = Fraction(1-$b,$a); +$ans2 = Fraction(1, $a+$b); + +########################################### + +BEGIN_PGML + +a) Find the inverse of the one-to-one function [`f`] defined by [`f(x) = [$f]`]. + + [`f^{-1}\left(y\right)={}`][____________________]{$finv} + +b) Calculate the following values: + + [`f^{-1}(1) = {}`][______]{$ans1} + + [`\left(f(1)\right)^{-1} = {}`][______]{$ans2} + +c) Do [`f^{-1}\left(y\right)`] and [`\left(f\left(y\right)\right)^{-1}`] mean the same thing? [@$popup->menu@]* + +END_PGML + +########################################### + +ANS($popup->cmp); + +########################################### + +$s = Formula("$a x"); +$w = ($b > 0) ? "adds" : "subtracts"; +$n = ($b > 0) ? "subtract" : "add"; + +$v = abs($b); + +Context()->texStrings; + +BEGIN_PGML_SOLUTION + +a) To find a formula for [`f^{-1}`], we can start with the formula for [`f`], replace [`f(x)`] with [`y`], and solve for [`x`]: + + [`\begin{aligned} +f(x) & = [$f]\\ +y &= [$f]\\ +y - [$b] &= [$s]\\ +x&= [$finv] +\end{aligned}`] + + So [`f^{-1}\left(y\right)=[$finv]`]. Alternatively, we could note that [`f`] multiplies its input by [`[$a]`] and then [$w] [`[$v]`], so [`f^{-1}`] should [$n] [`[$v]`] and then divide by [`[$a]`]. + +a) [`\begin{aligned}[t] +f^{-1}(1) & = [@$finv->substitute(y=>Formula("1"))@]\\ +& = [$ans1] +\end{aligned}`] + + [`\begin{aligned}[t] +\left(f(1)\right)^{-1} & = \left([@$f->substitute(x=>Formula("1"))@]\right)^{-1}\\ +& = \left([@$f->eval(x=>1)@]\right)^{-1}\\ +& = [$ans2$] +\end{aligned}`] + +a) Since we have seen that [`f^{-1}(1) \neq \left(f(1)\right)^{-1}`], [`f^{-1}\left(y\right)`] and [`\left(f\left(y\right)\right)^{-1}`] do not mean the same thing. One is the inverse of a _function_ [`f`], and the other is the inverse of a _number_ (specifically, of an output from [`f`]). + +END_PGML_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions200.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions200.pg new file mode 100644 index 0000000000..b15db9c7a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions200.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("LimitedNumeric"); + +$fout = (1,2,3,4,5,6,7); +$gout = (1,2,3,4,5,6,7); + + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($fout, $fzero) = shufflemap(7); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +($gout, $gzero) = shufflemap(7); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + + + +$answer1 = random(0,6,1); +$fout1 = $fout->{$answer1}; + +$gout2 = $gout->{0}; + +$gout3 = $gout->{$fzero}; + +$b = random(1,6,1); + +############################################## + + +BEGIN_TEXT + +Evaluate each expression using the values given in the table. + +$PAR + +\{ +DataTable( +[ +[{data=>"\(x\)",header=>'RH'},"\(0\)","\(1\)","\(2\)","\(3\)","\(4\)","\(5\)","\(6\)"], +[{data=>"\(f(x)\)",header=>'RH'},"\($fout->{0}\)","\($fout->{1}\)","\($fout->{2}\)","\($fout->{3}\)","\($fout->{4}\)","\($fout->{5}\)","\($fout->{6}\)"], +[{data=>"\(g(x)\)",header=>'RH',rowcss=>"border-bottom:solid 1px;"},"\($gout->{0}\)","\($gout->{1}\)","\($gout->{2}\)","\($gout->{3}\)","\($gout->{4}\)","\($gout->{5}\)","\($gout->{6}\)"] +], +allcellcss=>"padding:6pt; border-top:solid 1px;", +) +\} + +END_TEXT + +BEGIN_PGML + +a) What is [`f^{-1}([$fout1])`]? [____________] + +a) What is [`f^{-1}\left(g^{-1}([$gout2])\right)`]? [____________] + +a) What is [`f\left(g^{-1}([$gout3])\right)`]? [____________] + +a) What is [`g\left(g^{-1}([$b])\right)`]? [____________] + + + +END_PGML + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + +ANS( Compute("$answer1")->cmp); +ANS( Compute("$fzero")->cmp); +ANS( Compute("0")->cmp); +ANS( Compute("$b")->cmp); + +############################################## + +$s = $gout->{0}; + +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +f^{-1}([$fout1]) &= [$answer1] +\end{aligned}`] + +a) [`\begin{aligned}[t] +f^{-1}\left(g^{-1}([$gout2])\right) &= f^{-1}(0)\\ +&= [$fzero] +\end{aligned}`] + +a) [`\begin{aligned}[t] +f\left(g^{-1}([$gout3])\right) &= f([$fzero])\\ +&= 0 +\end{aligned}`] + +a) [`\begin{aligned}[t] +g\left(g^{-1}([$b])\right) &= [$b] +\end{aligned}`] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions30.pg new file mode 100644 index 0000000000..591bbb51cf --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions30.pg @@ -0,0 +1,99 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +########################################### + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,15,1); +$b = random(1,15,1); +$c = random(2,15,1); +$d = random(1,15,1); + +Context("Numeric"); +Context()->variables->are(x=>'Real', y=>'Real'); +Context()->flags->set(reduceConstants=>0); +Context()->noreduce('(-x)+y','(-x)-y'); + +$func1 = Formula("$a x + $b")->reduce; +$func2 = Formula("$c x^2 - $d")->reduce; +$func3 = Formula("$a/(x + $d)")->reduce; + +$inv1 = Formula("(y-$b)/$a")->reduce; +$inv2 = Formula("sqrt((y+$d)/$c)"); +$inv3 = Formula("($a/y)-$d"); + +########################################### + +BEGIN_PGML +Find a formula for the inverse function of the following functions. + +a) [`f`] is defined by [`f(x) = [$func1]`] + + [`f^{-1}\left( y \right) = {}`][_______________________________]{$inv1} + +a) [`g`] is defined by [`g(x) = [$func2]`] with domain [`x \geq 0`] + + [`g^{-1}\left( y \right) = {}`][_______________________________]{$inv2} + +a) [`h`] is defined by [`h(x) = [$func3]`] + + [`h^{-1}\left( y \right) = {}`][_______________________________]{$inv3} + +END_PGML + +########################################### + +BEGIN_PGML_SOLUTION + +a) To find a formula for [`f^{-1}`], we can start with the formula for [`f`], replace [`f(x)`] with [`y`], and solve for [`x`]: + + [`\begin{aligned} +f(x) & = [$func1]\\ +y &= [$func1]\\ +y - [$b] &= [$a] x\\ +x&= [$inv1] +\end{aligned}`] + + So [`f^{-1}\left(y\right)=[$inv1]`]. Alternatively, we could note that [`f`] multiplies its input by [`[$a]`] and then adds [`[$b]`], so [`f^{-1}`] should subtract [`[$b]`] and then divide by [`[$a]`]. + +a) To find a formula for [`g^{-1}`], we can start with the formula for [`g`], replace [`g(x)`] with [`y`], and solve for [`x`]: + + [`\begin{aligned} +g(x) & = [$func2]\\ +y &= [$func2]\\ +y + [$d] &= [$c] x^2\\ +\frac{y+[$d]}{[$c]}&= x^2 +\end{aligned}`] + + At this point we need to decide if we should take a positive or negative square root. Since the domain of [`g`] specifies that [`x`] is positive, we take the postive square root. + + [`\begin{aligned} +\frac{y+[$d]}{[$c]}&= x^2\\ +x &= [$inv2] +\end{aligned}`] + + So [`g^{-1}\left(y\right)=[$inv2]`]. Alternatively, we could note that [`g`] squares its input, then multiplies its input by [`[$c]`] and then subtracts [`[$d]`], so [`g^{-1}`] should add [`[$d]`], then divide by [`[$c]`], and then take either the positive or the negative square root. The domain of [`g`] lets us know we would take the _positive_ square root. + +a) To find a formula for [`h^{-1}`], we can start with the formula for [`h`], replace [`h(x)`] with [`y`], and solve for [`x`]: + + [`\begin{aligned} +h(x) & = [$func3]\\ +y &= [$func3]\\ +y(x+[$d]) &= [$a]\\ +x+[$d] &= \frac{[$a]}{y}\\ +x &= \frac{[$a]}{y}-[$d]\\ +\end{aligned}`] + + So [`h^{-1}\left(y\right)=[$inv3]`]. Alternatively, we could note that [`h`] adds [$d] to its input, then takes the reciprocal, and then then multiplies by [`[$a]`], so [`h^{-1}`] should divide by [`[$a]`], then take the reciprocal, and then subtract [`[$d]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions40.pg new file mode 100644 index 0000000000..6edb830bfc --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions40.pg @@ -0,0 +1,78 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## Tagged by cmd6a 8/6/06 + +## DBsubject(Algebra) +## DBchapter(Inverse functions) +## DBsection(Finding the inverse function) +## Date(8/23/07) +## Institution(Union College) +## MLT(InverseFunctions_FindInverse_03) +## Level(3) +## TitleText1('Calculus') +## AuthorText1('Anton') +## EditionText1('7') +## Section1('4.1') +## Problem1('16') +## KEYWORDS('algebra','inverse functions') + +######################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGML.pl", + "MathObjects.pl", + "PGcourse.pl", # Customization file for the course +); + +TEXT(beginproblem()); + +################################### +# Setup + +$a = random(2,10,2); +$b = random(2,10,1); +$c = random(2,10,1); +do {$d = random(1,9,2)} until $a*$d - $b*$c != 0; + +$f=Formula("{$a x+$b} / {$c x + $d} ")->reduce; +$inv =Formula( "($b - $d x)/($c x - $a)")->reduce; + +################################### +# Main text + +BEGIN_PGML +Let [`f(x) = [$f]`]. Find a formula for [`f^{-1}(x)`]. + + [`f^{-1}(x) ={}`][_______________________________]{$inv} + +END_PGML + +################################### + +BEGIN_PGML_SOLUTION + +We begin with the formula for [`f`] and work towards isolating [`x`]. + + [`\begin{aligned} +f(x)&=[$f]\\ +y & = [$f]\\ +y([$c]x+[$d]) &= [$a]x+[$b]\\ +[$c]xy + [$d]y&= [$a]x+[$b]\\ +[$c]xy - [$a]x&=[$b] - [$d]y\\ +x\left([$c]y - [$a]\right)&=[$b] - [$d]y\\ +x &= \frac{[$b] - [$d]y}{[$c]y - [$a]} +\end{aligned}`] + +So [`f^{-1}\left(y\right)=\frac{[$b] - [$d]y}{[$c]y - [$a]}`]. Since we have been asked to give a formula for [`f^{-1}`] using [`x`] as the variable, we write [`f^{-1}(x)=[$inv]`]. + + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions50.pg new file mode 100644 index 0000000000..722c86f377 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions50.pg @@ -0,0 +1,103 @@ +##DESCRIPTION +## Algebra problem: one-to-one functions, inverses +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'one-to-one function', 'inverse') + + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +############################### + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextLimitedFactor.pl", +"parserPopUp.pl", +"PGcourse.pl", +); + +############################### +TEXT(beginproblem()); + +Context("LimitedFactor"); +Context()->flags->set(factorableObject=>"function"); +$showPartialCorrectAnswers = 1; + +$a = random(2,9,1); +do {$b = non_zero_random(-9,9,1)} until $b != 1; +$c = non_zero_random(-9,9,1); + +$f = Formula("$c/($a x+$b)")->reduce; +$g = Formula("($c-$b x)/($a x)")->reduce; + +$ans = Formula("x"); + +$popup = PopUp(['?','is','is not'],'is'); + +############################### +BEGIN_PGML + +If [`f(x)=[$f]`] and [`g(x)=[$g]`], then + +a) [`f\left(g(x)\right)={}`][__________________________]{$ans} + +a) [`g\left(f(x)\right)={}`][__________________________]{$ans} + +a) Thus [`g`] [@$popup->menu@]* the [____________] function of [`f`]. + +END_PGML + +############################### + +Context()->strings->add("inverse"=>{}); +ANS($popup-> cmp); +ANS(Compute("inverse")->cmp); + +############################### + +Context()->texStrings; +BEGIN_PGML_SOLUTION + +a) [`\begin{aligned}[t] +f\left(g(x)\right) & = f\left([$g]\right)\\ +&= [@$f->substitute(x=>$g)@]\\ +&= \frac{[$c]}{\frac{[$c]-[$b]x}{x}+[$b]}\\ +&= \frac{[$c]}{\frac{[$c]-[$b]x}{x}+[$b]}\cdot\frac{x}{x}\\ +&= \frac{[$c]x}{[$c]-[$b]x+[$b]x}\\ +&= \frac{[$c]x}{[$c]}\\ +&=x +\end{aligned}`] + + and + +a) [`\begin{aligned}[t] +g\left(f(x)\right) & = g\left([$f]\right)\\ +&= [@$g->substitute(x=>$f)@]\\ +&= [@$g->substitute(x=>$f)@]\cdot\frac{[$a]x+[$b]}{[$a]x+[$b]}\\ +&= \frac{[$c]([$a]x+[$b])-[$b]([$c])}{[$a]([$c])}\\ +&= \frac{[$a]x+[$b]-[$b]}{[$a]}\\ +&= \frac{[$a]x}{[$a]}\\ +&= x +\end{aligned}`] + +a) Since [`f\left(g(x)\right)=x`] and [`g\left(f(x)\right)=x`], this is means that [`g`] _is_ the _inverse_ function of [`f`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions60.pg new file mode 100644 index 0000000000..6b1324b2ee --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions60.pg @@ -0,0 +1,113 @@ +#DESCRIPTION +# graph of inverse function +#ENDDESCRIPTION + +#KEYWORDS('graphs', 'transformation', 'inverse' +## lcao tagged and PAID on 2-20-2004 + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('One-to-one Functions and Their Inverses') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('College Algebra') +## EditionText1('3') +## AuthorText1('Stewart, Redlin, Watson') +## Section1('4.8') +## Problem1('2') + +######################################### + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"PGchoicemacros.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGML.pl", +"parserPopUp.pl", +"PGcourse.pl", +); + +######################################### + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@slice = &NchooseK(4,4); +@shuffle = &shuffle(scalar(@slice)); +$bk="black"; +@sc = ("red", "green", "blue","yellow"); + + +# FEQ (Format EQuations) cleans up the writing of the functions (see FEQ in PGbasicmacros) +# Otherwise we would need to worry about the signs of $a, $b and so forth. + +$f = FEQ("3-(1.5)^x for x in <-10,10> using color:$bk and weight:2"); +$g[0] = FEQ("log(3-x)/log(1.5) for x in <-10,2.99> using color:$sc[$shuffle[0]] and weight:2"); +$g[1] = FEQ("3-(1.5)^(-x) for x in <-10,10> using color:$sc[$shuffle[1]] and weight:2"); +$g[2] = FEQ("-3+(1.5)^x for x in <-10,10> using color:$sc[$shuffle[2]] and weight:2"); +$g[3] = FEQ("-3+(1.5)^(-x) for x in <-10,10> using color:$sc[$shuffle[3]] and weight:2"); + +$graphf = init_graph(-10,-10,10,10,'axes'=>[0,0],size=>[400,400]); +$graphg = init_graph(-10,-10,10,10,'axes'=>[0,0],size=>[400,400]); + +($fRef) = plot_functions( $graphf,$f); +($gRef[0],$gRef[1],$gRef[2],$gRef[3]) = plot_functions( $graphg,$g[0],$g[1],$g[2],$g[3]); + +$label_f = new Label ( -1,9,'A',$bk,'left');$graphf->lb($label_f); +$label_g = new Label ( -1,9,'B',$bk,'left');$graphg->lb($label_g); + +$popup = PopUp(["?", "red", "green", "blue","yellow"], $sc[$shuffle[0]]); + +######################################### + +$refreshCachedImages = 1; + +BEGIN_PGML + +A function [`f`] is graphed below in plane [`A`]. It is clearly a one-to-one function, so it must have an inverse. Which graph ("red", "green", "blue", or "yellow") in plane [`B`] is the graph of this inverse function? Use what you know about the graphs of inverse functions rather than algebraic calculations based on what you might guess the function to be. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($graphf), width=>400,height=>400,tex_size=>800) @]* [@image(insertGraph($graphg), width=>400,height=>400,tex_size=>800)@]* << + + + [`f^{-1}`] is the [@$popup->menu@]* graph + +END_PGML + +######################################### + +ANS($popup->cmp); + +######################################### + +$graphsol = init_graph(-10,-10,10,10,'axes'=>[0,0],size=>[400,400]); + +add_functions($graphsol, "3-(1.5)^x for x in <-10,10>" . + " using color:black and weight:2"); + +$graphsol->moveTo(-10,-10); +$graphsol->lineTo(10,10,'black',1,'dashed'); + +$corcolor = $popup->correct_ans; +add_functions($graphsol, "ln(3-x)/ln(1.5) for x in <-10,2.999>" . + " using color:$corcolor and weight:2"); + + +BEGIN_PGML_SOLUTION + +The graphs of a function and its inverse are reflections over the diagonal line [`y=x`]. So we can see that [`f^{-1}`] has the [@$popup->correct_ans@] graph. + +>>[@image(insertGraph($graphsol), width=>400,height=>400,tex_size=>800) @]* << + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions70.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions70.pg new file mode 100644 index 0000000000..fcf6a8add3 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions70.pg @@ -0,0 +1,151 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## Tagged by tda2d + +## DBsubject(Algebra) +## DBchapter(Inverse functions) +## DBsection(Finding the inverse function) +## Date(6/3/2002) +## MLT(InverseFunctions_FindInverse_08) +## Level(2) +## TitleText1('College Algebra') +## AuthorText1('Stewart, Redlin, Watson') +## EditionText1('3') +## Section1('4.8') +## Problem1('6') +## KEYWORDS('function' 'inverse' 'graph','functions', 'inverse functions') + +############################################ + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"PGchoicemacros.pl", +"PGML.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"pccTables.pl", +"parserPopUp.pl", +"PGcourse.pl", +); + +############################################ + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +#Define the graph +$graph_object1 = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[20,20],size=>[400,400]); +$graph_object2 = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[20,20],size=>[400,400]); +$graph_object3 = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[20,20],size=>[400,400]); +$graph_object4 = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[20,20],size=>[400,400]); + +#create a scrambled list of colors and letters +@colors =("blue", "red", "green"); +@slice = NchooseK(3,3); +@sc = @colors[@slice]; +@ans = ('A', 'B', 'C'); +@sa = @ans[@slice]; + +#now we are ready to write the strings which define the function +$dom = 10; +$a = random(-8,-2,1); +$b = random(2,5,1); +$c = random(4,8,1); +$d = $c/$b; +$f1 = FEQ ("$a x for x in <-$dom, 0> using color=black and weight=2"); +$f2 = FEQ ("-(1/$b) x for x in <0, $c> using color=black and weight=2"); +$f3 = FEQ ("(-($c/$b)+$c)-x for x in <$c, $dom> using color=black and weight=2"); +add_functions($graph_object1, $f1, $f2, $f3); +$g1 = FEQ ("-$a x for x in <-$dom, 0> using color=$sc[0] and weight=2"); +$g2 = FEQ ("(1/$b) x for x in <0, $c> using color=$sc[0] and weight=2"); +$g3 = FEQ ("x+(($c/$b)-$c) for x in <$c, $dom> using color=$sc[0] and weight=2"); +add_functions($graph_object2, $g1, $g2, $g3); +$h1 = FEQ ("-$a x for x in <0, $dom> using color=$sc[1] and weight=2"); +$h2 = FEQ ("(1/$b) x for x in <-$c, 0> using color=$sc[1] and weight=2"); +$h3 = FEQ ("x-($c/$b)+$c for x in <-$dom, -$c> using color=$sc[1] and weight=2"); +add_functions($graph_object3, $h1, $h2, $h3); +$i1 = FEQ ("(1/$a) x for x in <0, $dom> using color=$sc[2] and weight=2"); +$i2 = FEQ ("(-$b)x for x in <-$d, 0> using color=$sc[2] and weight=2"); +$i3 = FEQ ("($c-($c/$b))- x for x in <-$dom, -$d> using color=$sc[2] and weight=2"); +add_functions($graph_object4, $i1, $i2, $i3); + +@graph = ($graph_object2, $graph_object3, $graph_object4); +@randomGraph = @graph[@slice]; + +#get the index of the correct answer in the permutation +for($i = 0; $i < @slice; $i++ ) +{ + if( $slice[$i] == 2 ) + { + $correctIndex = $i; + last; + } +} + +$popup = PopUp(["?", "A", "B", "C"], $ans[$correctIndex]); + +############################################ + +$refreshCachedImages = 1; + +BEGIN_PGML +Below is the graph of a function [`f`] and three other graphs. + +[@EnlargeImageStatementPGML()@]** + +[@LayoutTable( +[ +["y=f(x)".$BR.image(insertGraph($graph_object1), width=>400, height=>400,tex_size=>400), "Graph A".$BR.image(insertGraph($randomGraph[0]), width=>400, height=>400,tex_size=>400)], +["Graph B ".$BR.image(insertGraph($randomGraph[1]), width=>400, height=>400,tex_size=>400), "Graph C ".$BR.image(insertGraph($randomGraph[2]), width=>400, height=>400,tex_size=>400)], +], +allcellcss => "padding:6pt;text-align:left;vertical-align:top;font-weight:bold;" +)@]* + +The graph of [`f^{-1}`] is Graph [@$popup->menu@]*. + +END_PGML + +############################################ +ANS($popup->cmp ); + +############################################ + +$graphsol = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[20,20],size=>[400,400]); + +add_functions($graphsol, "$a*x for x in <-10,0>" . + " using color:black and weight:2"); +add_functions($graphsol, "-(1/$b)*x for x in <0,$c>" . + " using color:black and weight:2"); +add_functions($graphsol, "(-($c/$b)+$c)-x for x in <$c, 10>" . + " using color:black and weight:2"); + +$graphsol->moveTo(-10,-10); +$graphsol->lineTo(10,10,'black',1,'dashed'); + +add_functions($graphsol, "(1/$a)*x for x in <0,10>" . + " using color:$sc[2] and weight:2"); +add_functions($graphsol, "(-$b)*x for x in <-$d,0>" . + " using color:$sc[2] and weight:2"); +add_functions($graphsol, "($c-($c/$b))- x for x in <-10, -$d>" . + " using color:$sc[2] and weight:2"); + + + +BEGIN_PGML_SOLUTION + +The graphs of a function and its inverse are reflections over the diagonal line [`y=x`]. So we can see that the graph of [`f^{-1}`] is Graph [@$popup->correct_ans@]. + +>>[@image(insertGraph($graphsol), width=>400,height=>400,tex_size=>400) @]* << + + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions80.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions80.pg new file mode 100644 index 0000000000..95aa4317e5 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions80.pg @@ -0,0 +1,117 @@ +#DESCRIPTION +# graph of inverse function +#ENDDESCRIPTION + +#KEYWORDS('graphs', 'transformation', 'inverse') +## lcao tagged and PAID on 2-20-2004 + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('One-to-one Functions and Their Inverses') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('College Algebra') +## EditionText1('3') +## AuthorText1('Stewart, Redlin, Watson') +## Section1('4.8') +## Problem1('2') +DOCUMENT(); # This should be the first executable line in the problem. + +######################################### + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"PGchoicemacros.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGML.pl", +"parserPopUp.pl", +"PGcourse.pl", +); + +######################################### + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@slice = &NchooseK(3,3); +@shuffle = &shuffle(scalar(@slice)); +$bk="black"; +@sc = ("red", "green", "blue"); + +# FEQ (Format EQuations) cleans up the writing of the functions (see FEQ in PGbasicmacros) +# Otherwise we would need to worry about the signs of $a, $b and so forth. + +$f = FEQ("x^3 for x in <-1.5,1.5> using color:$bk and weight:2"); +$g[0] = FEQ("-x^3 for x in <-1.5,1.5> using color:$sc[$shuffle[0]] and weight:2"); +$g[1] = FEQ("-x^(1/3) for x in <0,1.5> using color:$sc[$shuffle[1]] and weight:2"); +$ga[1] = FEQ("(-x)^(1/3) for x in <-1.5,0> using color:$sc[$shuffle[1]] and weight:2"); +$g[2] = FEQ("x^(1/3) for x in <0,1.5> using color:$sc[$shuffle[2]] and weight:2"); +$ga[2] = FEQ("-(-x)^(1/3) for x in <-1.5,0> using color:$sc[$shuffle[2]] and weight:2"); + +$graphf = init_graph(-1.5,-1.5,1.5,1.5,'axes'=>[0,0]); +$graphg = init_graph(-1.5,-1.5,1.5,1.5,'axes'=>[0,0]); + +($fRef) = plot_functions( $graphf,$f); +($gRef[0],$gRef[1],$gaRef[1],$gRef[2],$gaRef[2]) = plot_functions( $graphg,$g[0],$g[1],$ga[1],$g[2],$ga[2]); + +$label_f = new Label ( -1,9,'A',$bk,'left');$graphf->lb($label_f); +$label_g = new Label ( -1,2.75,'B',$bk,'left');$graphg->lb($label_g); + +$popup = PopUp(["?", "red", "green", "blue","yellow"], $sc[$shuffle[2]]); + +######################################### + +$refreshCachedImages = 1; + +BEGIN_PGML + +A function [`f`] is graphed below in plane [`A`]. It is clearly a one-to-one function, so it must have an inverse. Which graph ("red", "green", "blue", or "yellow") in plane [`B`] is the graph of this inverse function? Use what you know about the graphs of inverse functions rather than algebraic calculations based on what you might guess the function to be. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($graphf), width=>400,height=>400,tex_size=>800) @]* [@image(insertGraph($graphg), width=>400,height=>400,tex_size=>800)@]* << + + + [`f^{-1}`] is the [@$popup->menu@]* graph + +END_PGML + +######################################### + +ANS($popup->cmp); + +######################################### + +$graphsol = init_graph(-1.5,-1.5,1.5,1.5,'axes'=>[0,0],size=>[400,400]); + +add_functions($graphsol, "x^3 for x in <-1.5,1.5>" . + " using color:black and weight:2"); + +$graphsol->moveTo(-1.5,-1.5); +$graphsol->lineTo(1.5,1.5,'black',1,'dashed'); + +$corcolor = $popup->correct_ans; +add_functions($graphsol, "x^(1/3) for x in <0,1.5>" . + " using color:$corcolor and weight:2"); +add_functions($graphsol, "-(-x)^(1/3) for x in <-1.5,0>" . + " using color:$corcolor and weight:2"); + + +BEGIN_PGML_SOLUTION + +The graphs of a function and its inverse are reflections over the diagonal line [`y=x`]. So we can see that [`f^{-1}`] has the [@$popup->correct_ans@] graph. + +>>[@image(insertGraph($graphsol), width=>400,height=>400,tex_size=>800) @]* << + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions90.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions90.pg new file mode 100644 index 0000000000..c68a07583a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/InversesOfFunctions90.pg @@ -0,0 +1,156 @@ +##DESCRIPTION +## lcao tagged and PAID on 2-20-2004 + +## DBsubject(Algebra) +## DBchapter(Inverse functions) +## DBsection(Finding the inverse function) +## Date(6/3/2002) +## Institution(Rochester) +## MLT(InverseFunctions_FindInverse_08) +## Level(2) +## TitleText1('College Algebra') +## AuthorText1('Stewart, Redlin, Watson') +## EditionText1('3') +## Section1('4.8') +## Problem1('5') +## KEYWORDS('functions', 'inverse functions','function' 'inverse' 'graph') +## Find the inverse function +##ENDDESCRIPTION + +############################################ + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"PGchoicemacros.pl", +"PGML.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"pccTables.pl", +"parserPopUp.pl", +"PGcourse.pl", +); + +############################################ + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +#Define the graph +$graph_object1 = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[20,20]); +$graph_object2 = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[20,20]); +$graph_object3 = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[20,20]); +$graph_object4 = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[20,20]); +$graph_object5 = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[20,20]); + +#create a scrambled list of colors and letters +@colors =("blue", "red", "green", "orange"); +@slice = NchooseK(4,4); +@sc = @colors[@slice]; +@ans = ('A', 'B', 'C', 'D'); +@sa = @ans[@slice]; + +#now we are ready to write the strings which define the function +$dom = 10; +$a = random(3,9,1); +$b = $a-.000001; +$f1 = FEQ("$a-(e**(-x)) for x in <-$dom, $dom> using color=black and weight=2"); +add_functions($graph_object1, $f1); +$g1 = FEQ("$a-(e**x) for x in <-$dom, $dom> using color=$sc[0] and weight=2"); +add_functions($graph_object2, $g1); +$h1 = FEQ("(e**x)-$a for x in <-$dom, $dom> using color=$sc[1] and weight=2"); +add_functions($graph_object3, $h1); + +$xfunci = sub { my $t = shift(); + return $a - (exp($t)); }; + $yfunci = sub { my $t = shift(); + return $t; }; + $fni = new Fun( $xfunci, $yfunci, $graph_object4 ); + $fni->color($sc[2]); + $fni->domain(-10,$b); + + +$xfuncj = sub { my $t = shift(); + return $a - (exp(-$t)); }; + $yfuncj = sub { my $t = shift(); + return $t; }; + $fnj = new Fun( $xfuncj, $yfuncj, $graph_object5 ); + $fnj->color($sc[3]); + $fnj->domain(-$b,10); + + + + +@graph = ($graph_object2, $graph_object3, $graph_object4, $graph_object5); +@randomGraph = @graph[@slice]; + +#get the index of the correct answer in the permutation +for($i = 0; $i < @slice; $i++ ) +{ + if( $slice[$i] == 3 ) + { + $correctIndex = $i; + last; + } +} + +$popup = PopUp(["?", "A", "B", "C", "D"], $ans[$correctIndex]); + +############################################ +$refreshCachedImages = 1; + +BEGIN_PGML +Below is the graph of a function [`f`] and three other graphs. + +[@EnlargeImageStatementPGML()@]** + +[@LayoutTable( +[ +["y=f(x)".$BR.image(insertGraph($graph_object1), width=>400, height=>400,tex_size=>400), ], +["Graph A".$BR.image(insertGraph($randomGraph[0]), width=>400, height=>400,tex_size=>400),"Graph B ".$BR.image(insertGraph($randomGraph[1]), width=>400, height=>400,tex_size=>400), ], +["Graph C ".$BR.image(insertGraph($randomGraph[2]), width=>400, height=>400,tex_size=>400),"Graph D ".$BR.image(insertGraph($randomGraph[3]), width=>400, height=>400,tex_size=>400), ], +], +allcellcss => "padding:6pt;text-align:left;vertical-align:top;font-weight:bold;" +)@]* + +The graph of [`f^{-1}`] is Graph [@$popup->menu@]*. + +END_PGML + +############################################ +ANS($popup->cmp ); + +############################################ + +$graphsol = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[20,20],size=>[400,400]); + +add_functions($graphsol, "$a-(e**(-x)) for x in <-$dom,$dom>" . + " using color:black and weight:2"); + +$graphsol->moveTo(-10,-10); +$graphsol->lineTo(10,10,'black',1,'dashed'); + +$xfuncsol = sub { my $t = shift(); + return $a - (exp(-$t)); }; + $yfuncsol = sub { my $t = shift(); + return $t; }; + $fnsol = new Fun( $xfuncsol, $yfuncsol, $graphsol ); + $fnsol->color($sc[3]); + $fnsol->domain(-$b,10); + + +BEGIN_PGML_SOLUTION + +The graphs of a function and its inverse are reflections over the diagonal line [`y=x`]. So we can see that the graph of [`f^{-1}`] is Graph [@$popup->correct_ans@]. + +>>[@image(insertGraph($graphsol), width=>400,height=>400,tex_size=>400) @]* << + + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/OneToOne10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/OneToOne10.pg new file mode 100644 index 0000000000..1776f4680b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/OneToOne10.pg @@ -0,0 +1,141 @@ +#DESCRIPTION +## Algebra: One-to-one functions +##ENDDESCRIPTION + + +## DBsubject(Algebra) +## DBchapter(Inverse functions) +## DBsection(1-1 functions) +## Date(6/3/2002) +## Institution(ASU) +## Author(Justin Sukiennik) +## Level(3) +## TitleText1('Algebra for College Students') +## AuthorText1('Kaufmann, Schwitters') +## EditionText1('8') +## Section1('10.3') +## Problem1('') +## TitleText2('Precalculus') +## AuthorText2('Stewart, Redlin, Watson') +## EditionText2('3') +## Section2('2.7') +## Problem2('11 9 10 7') +## KEYWORDS('algebra', 'functions', 'one to one', 'inverse functions', 'one to one function', 'inverse', 'one-to-one function') + +##################################################################### +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserPopUp.pl", + "PGchoicemacros.pl", + "PGML.pl", + "PGcourse.pl", +); +########################################### + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 0; + + +Context("Numeric"); + +$a = random(1,2,1); +if ($a==1) { +$a1 = random(2,6,1); +$f1 = Formula("x^2+$a1"); +$popup1 = PopUp(['?','Yes', 'No'],'No'); +$sol1 = 'If we try to solve the equation [`y=[$f1]`] for [`x`], then we have + + [`\begin{aligned} +y&=[$f1]\\ +y-[$a1]&=x^2\\ +x^2&=y-[$a1]\\ +\end{aligned}`] + At this point we cannot determine what [`x`] is exactly. It could be [`\sqrt{y-[$a1]}`] or it could be [`-\sqrt{y-[$a1]}`]. Since we cannot solve for [`x`] in terms of [`y`], [`[$f1]`] is not a one-to-one function of [`x`]. ' +} +else { +$a1 = random(2,6,1); +$f1 = Formula("x^3+$a1"); +$popup1 = PopUp(['?','Yes', 'No'],'Yes'); +$sol1 = 'If we try to solve the equation [`y=[$f1]`] for [`x`], then we have + + [`\begin{aligned} +y&=[$f1]\\ +y-[$a1]&=x^3\\ +x^3&=y-[$a1]\\ +x&=\sqrt[3]{y-[$a1]}\\ +\end{aligned}`] + Note that in the last step, it is legitimate to take a 3rd root of both sides of the equation because 3 is odd. Since we can solve for [`x`] in terms of [`y`], [`[$f1]`] is a one-to-one function of [`x`]. ' +} +$b = random(2,8,2); +$f2 = Formula("|x-$b|"); +$popup2 = PopUp(['?','Yes', 'No'],'No'); + +$c = random(2,6,1); +$f3 = Formula("$c*x+4"); +$popup3 = PopUp(['?','Yes', 'No'],'Yes'); + +$f4 = Formula("1/x"); +$popup4 = PopUp(['?','Yes', 'No'],'Yes'); + +########################################### + + +BEGIN_PGML +Are the following functions _one-to-one_? + +a) [`f`], where [`\displaystyle f(x) = [$f1]`] [@$popup1->menu@]* + +a) [`f`], where [`\displaystyle f(x) = [$f2]`] [@$popup2->menu@]* + +a) [`f`], where [`\displaystyle f(x) = [$f3]`] [@$popup3->menu@]* + +a) [`f`], where [`\displaystyle f(x) = [$f4]`] [@$popup4->menu@]* + + +END_PGML + +########################################### + +ANS($popup1->cmp); +ANS($popup2->cmp); +ANS($popup3->cmp); +ANS($popup4->cmp); + +########################################### + +BEGIN_PGML_SOLUTION + +a) [$sol1]** +a) If we try to solve the equation [`y=[$f2]`] for [`x`], then we have + + [`\begin{aligned} +y&=[$f2]\\ +[$f2]&=y\\ +\end{aligned}`] + At this point we cannot determine what [`x`] is exactly. Maybe [`x-[$b]=y`] or maybe [`x-[$b]=-y`]. So maybe [`x=y+[$b]`] or maybe [`x=-y+[$b]`]. Since we cannot solve for [`x`] in terms of [`y`], [`[$f2]`] is not a one-to-one function of [`x`]. +a) If we try to solve the equation [`y=[$f3]`] for [`x`], then we have + + [`\begin{aligned} +y&=[$f3]\\ +[$f3]&=y\\ +[$c]x&=y-4\\ +x&=\frac{y-4}{[$c]}\\ +\end{aligned}`] + Since we can solve for [`x`] in terms of [`y`], [`[$f3]`] is a one-to-one function of [`x`]. +a) If we try to solve the equation [`y=[$f4]`] for [`x`], then we have + + [`\begin{aligned} +y&=[$f4]\\ +xy&=1\\ +x&=\frac{1}{y}\\ +\end{aligned}`] + Since we can solve for [`x`] in terms of [`y`], [`[$f4]`] is a one-to-one function of [`x`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/OneToOne20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/OneToOne20.pg new file mode 100644 index 0000000000..b172e287a2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/InversesOfFunctions/OneToOne20.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserRadioButtons.pl", + "PGcourse.pl", + +); + +TEXT(beginproblem()); + + +############################################## + + +Context("Numeric"); + +$gr = init_graph(-4,-4,4,4, +axes=>[0,0], +size=>[400,400] +); + +$a = random(0,2,1); + +@functions = ( +Formula("e^(x+$a)"), +Formula("x^3/3+x"), +Formula("sqrt(x+$a)"), +Formula("ln(x+$a)"), +Formula("1/(x+$a)"), +Formula("x^2/2-$a"), +Formula("x^3-x"), +Formula("abs(x-$a)"), +Formula("x^2-x^4/4"), +Formula("sin(x-$a)") +); + +$one = "one-to-one"; +$not = "not one-to-one"; + +@answer = ( +$one, +$one, +$one, +$one, +$one, +$not, +$not, +$not, +$not, +$not); + +@xmin = (-4,-4, -$a,-$a+0.001,-4,-4,-4,-4,-4,-4); +@xmax = (4,4,4,4,-$a-0.001,4,4,4,4,4); +$xmin2 = -$a+0.001; +$xmax2 = 4; + +$index = random(0,9,1); + + +add_functions($gr, "$functions[$index] for x in <$xmin[$index],$xmax[$index]>" . + " using color:blue and weight:1"); + +if ($index == 4) {add_functions($gr, "$functions[$index] for x in <$xmin2,$xmax2>" . + " using color:blue and weight:1");}; + + +$radio = RadioButtons( + [$one,$not], + $answer[$index], # correct answer + last => [$one,$not], # can be a list +); + + +############################################## +$refreshCachedImages = 1; + +BEGIN_PGML + +Determine whether the function represented in the graph below is one-to-one or not. + +[@EnlargeImageStatementPGML()@]** + + +>> [@image( insertGraph($gr), +width=>400,height=>400,tex_size=>800 )@]* << + + +[@ $radio->buttons() @]* + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 1; + + +ANS( $radio->cmp() ); + +############################################## + +if ($answer[$index] eq 'not') {$explanation = 'The graph shows us that the function does not pass the horizontal line test. That is, a horizontal line can intersect the graph at more than one point. Therefore the function is not one-to-one.'} +else {$explanation = 'The graph shows us that the function passes the horizontal line test. That is, a horizontal never intersects the graph at more than one point. Therefore the function is one-to-one.'} + +BEGIN_PGML_SOLUTION + +[$explanation] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/CompoundInternet10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/CompoundInternet10.pg new file mode 100644 index 0000000000..4977147d7b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/CompoundInternet10.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Exponential/logarithm application problem +# +# Last edited: Yao 7/10/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$name = RandomName(); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +$initial = random(10000,100000,1000); +$r = random(2,5,0.1); +$rd = $r/100; +$x = random(3,15,1); +$y1 = $initial*(1+$rd/1)**(1*$x); +$y2 = $initial*(1+$rd/4)**(4*$x); +$y3 = $initial*(1+$rd/12)**(12*$x); +$y4 = $initial*(1+$rd/365)**(365*$x); + +Context("Currency"); +$initialC = Currency($initial); +$y1C = Currency($y1); +$y2C = Currency($y2); +$y3C = Currency($y3); +$y4C = Currency($y4); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +The compound interest formula is + + [`` A(t) = P(1+\frac{r}{n})^{nt} ``] + +where [`A(t)`] models the amount of money, [`t`] is the number of years, [`P`] is the initial amount, [`r`] is the annual interest and [`n`] is the number of compoundings per year. + +[$name] saved [`[$initialC]`] in an account with an annual interest of [`[$r]%`]. Answer the following questions: + +1) The amount of money in the account would be [___________]{$y1C} after [`[$x]`] years, if the interest is compounded yearly. + +2) The amount of money in the account would be [___________]{$y2C} after [`[$x]`] years, if the interest is compounded quarterly. + +3) The amount of money in the account would be [___________]{$y3C} after [`[$x]`] years, if the interest is compounded monthly. + +4) The amount of money in the account would be [___________]{$y4C} after [`[$x]`] years, if the interest is compounded daily (assuming that year has 365 days). + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +###Question 1 + + [`` +\begin{aligned}[t] + A(t) + &= [$initial](1+\frac{[$rd]}{1})^{(1)([$x])} \\ + &\approx [$y1] \\ +\end{aligned} + ``] + +The amount of money in the account would be [`[$y1C]`] after [`[$x]`] years, if the interest is compounded yearly. + +###Question 2 + + [`` +\begin{aligned}[t] + A(t) + &= [$initial](1+\frac{[$rd]}{4})^{(4)([$x])} \\ + &\approx [$y2] \\ +\end{aligned} + ``] + +The amount of money in the account would be [`[$y2C]`] after [`[$x]`] years, if the interest is compounded quarterly. + +###Question 3 + + [`` +\begin{aligned}[t] + A(t) + &= [$initial](1+\frac{[$rd]}{12})^{(12)([$x])} \\ + &\approx [$y3] \\ +\end{aligned} + ``] + +The amount of money in the account would be [`[$y3C]`] after [`[$x]`] years, if the interest is compounded monthly. + +###Question 4 + + [`` +\begin{aligned}[t] + A(t) + &= [$initial](1+\frac{[$rd]}{365})^{(365)([$x])} \\ + &\approx [$y4] \\ +\end{aligned} + ``] + +The amount of money in the account would be [`[$y4C]`] after [`[$x]`] years, if the interest is compounded daily. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/CompoundInternet20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/CompoundInternet20.pg new file mode 100644 index 0000000000..19de6d95fb --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/CompoundInternet20.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Exponential/logarithm application problem +# +# Last edited: Yao 7/10/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$name = RandomName(); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); +Context()->{format}{number} = "%.7g"; + +$initial = random(5000,10000,1000); +$r = random(8,20,0.1); +$rd = $r/100; +do { + $x1 = random(3,15,1); + $y1 = $initial*Real(e)**($rd*$x1); + $y2 = random($initial+2000,$initial*2.5,1000); + $x2 = ln($y2/$initial)/$rd; +} until (abs($x1-$x2)>3); + +$x2R = int($x2*10+0.5)/10; + +Context("Currency"); +$initialC = Currency($initial); +$y1C = Currency($y1); +$y2C = Currency($y2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +The continuously compounded interest formula is + + [`` A(t) = P\cdot e^{rt} ``] + +where [`A(t)`] models the amount of money, [`t`] is the number of years, [`P`] is the initial amount and [`r`] is the annual interest. + +[$name] borrowed [`[$initialC]`] from a credit card company, with an annual interest of [`[$r]%`]. The interest is compounded continuously. Answer the following questions: + +1) The amount owed would become [___________]{$y1C} after [`[$x1]`] years. + +2) The amount owed would become [`[$y2C]`] after [_____________]{$x2R} years. Round your answer to one decimal place. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +###Question 1 + +Substitute [`t=[$x1]`] into [`A(t)`], we have: + + [`` +\begin{aligned}[t] + A(t) &= [$initial]e^{[$rd]t} \\ + A([$x1]) &= [$initial]e^{[$rd]([$x1])} \\ + &\approx [$y1] +\end{aligned} + ``] + +The amount owed would become [`[$y1C]`] after [`[$x1]`] years. + +###Question 2 + +Substitute [`A(t)=[$y2]`] into [`A(t)`] and solve for [`t`]: + + [`` +\begin{aligned}[t] + A(t) &= [$initial]e^{[$rd]t} \\ + [$y2] &= [$initial]e^{[$rd]t} \\ + \frac{[$y2]}{[$initial]} &= e^{[$rd]t} \\ + \ln\left( \frac{[$y2]}{[$initial]} \right) &= [$rd]t \\ + \frac{\ln\left( \frac{[$y2]}{[$initial]} \right)}{[$rd]} &= t \\ + t &\approx [$x2R] +\end{aligned} + ``] + +The amount owed would become [`[$y2C]`] after [`[$x2R]`] years. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/CompoundInternet30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/CompoundInternet30.pg new file mode 100644 index 0000000000..9de5f2ed6f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/CompoundInternet30.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Exponential/logarithm application problem +# +# Last edited: Yao 7/10/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$name = RandomName(); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +$initial = random(10000,100000,1000); +$r = random(2,5,0.1); +$rd = $r/100; +$y = random($initial+2000, 1.5*$initial, 1000); +$n = list_random(4,12,365); + +$x = ln($y/$initial)/ln(1+$rd/$n)/$n; +$xR = int($x*10+0.5)/10; + +Context("Currency"); +$initialC = Currency($initial); +$yC = Currency($y); + +if ($n==4) { + $f = "quarterly"; +} elsif ($n==12) { + $f = "monthly"; +} else { + $f = "daily"; +} + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +The compound interest formula is + + [`` A(t) = P(1+\frac{r}{n})^{nt} ``] + +where [`A(t)`] models the amount of money, [`t`] is the number of years, [`P`] is the initial amount, [`r`] is the annual interest and [`n`] is the number of compoudings per year. + +[$name] saved [`[$initialC]`] in an account with an annual interest of [`[$r]%`]. Answer the following question: + +The amount of money in the account would be [`[$yC]`] after [____________]{$xR} years, if the interest is compounded [$f]. Round your answer to one decimal place. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since the interested is compounded [$f], the formula is + + [`` A(t) = [$initial](1+\frac{[$rd]}{[$n]})^{[$n]t} ``] + +Substitute [`A(t)=[$y]`] into [`A(t)`] and solve for [`t`]: + + [`` +\begin{aligned}[t] + A(t) &= [$initial](1+\frac{[$rd]}{[$n]})^{[$n]t} \\ + [$y] &= [$initial](1+\frac{[$rd]}{[$n]})^{[$n]t} \\ + \frac{[$y]}{[$initial]} &= (1+\frac{[$rd]}{[$n]})^{[$n]t} \\ + \ln\left( \frac{[$y]}{[$initial]} \right) &= \ln\left( (1+\frac{[$rd]}{[$n]})^{[$n]t} \right) \\ + \ln\left( \frac{[$y]}{[$initial]} \right) &= [$n]t\cdot \ln\left( 1+\frac{[$rd]}{[$n]} \right) \\ + \frac{ \ln\left( \frac{[$y]}{[$initial]} \right) }{ \ln\left( 1+\frac{[$rd]}{[$n]} \right) } &= [$n]t \\ + \frac{1}{[$n]}\cdot \frac{ \ln\left( \frac{[$y]}{[$initial]} \right) }{ \ln\left( 1+\frac{[$rd]}{[$n]} \right) } &= t \\ + [$x] &\approx t +\end{aligned} + ``] + +The amount of money in the account would be [`[$yC]`] after [`[$xR]`] years, if the interest is compounded [$f]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/DoublingTime.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/DoublingTime.pg new file mode 100644 index 0000000000..f422c358b7 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/DoublingTime.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$r = random(4,30,1); + + +$doublingTime = ln(2)/ln(1+$r/100); + + + +Context("LimitedNumeric"); +Context()->flags->set(tolerance=>0.01); + + + +$doublingTime = Compute("$doublingTime"); +$doublingTime = NumberWithUnits("$doublingTime","yr"); + +############################################## + +BEGIN_PGML + +A city is growing by [`[$r]%`] per year. Find the time it takes for the population to double. Use *yr* for years. + + [____________________] + + + +END_PGML + +############################################## + +ANS( $doublingTime->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +We know that [`P(t)=P_0(1+[@$r/100@])^t`]. So we need to solve: + + [`\begin{aligned} +2P_0 &=P_0([@1+$r/100@])^t\\ +2 &=[@1+$r/100@]^t\\ +\log(2) &= \log\left([@1+$r/100@]^t\right)\\ +\log(2) &= t\cdot\log\left([@1+$r/100@]\right)\\ +\frac{\log(2)}{\log\left([@1+$r/100@]\right)} &= t\\ +t &= \frac{\log(2)}{\log\left([@1+$r/100@]\right)}\\ +t &= [@$doublingTime->value@] +\end{aligned}`] + +So the doubling time is [`[$doublingTime]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/DrugInBody.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/DrugInBody.pg new file mode 100644 index 0000000000..9c426a673d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/DrugInBody.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + "contextPercent.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +$initial = random(20,30,1); + +$factor = random(0.81,0.95,0.02); + +$after10 = $initial*(($factor)**10); + +$timeTo1 = round(log(1/$initial)/log($factor)); + +Context("Percent"); +$percent = Percent(1-$factor); + +Context("Numeric"); + +############################################## + +BEGIN_PGML + +The amount (in mg) of a drug in the body [`t`] hours after taking a pill is given by + + [``A(t) = [$initial]([$factor])^t``] + +a. What is the initial dose given? + + [_____________________] + +a. What percent of the drug leaves the body each hour? + + [_____________________] + +a. What is the amount left in the body after [`10`] hours? + + [_____________________] + +a. After how long is there less than [`1`] mg left in the body? + + [_____________________] + + +END_PGML + +############################################## + +$showPartialCorrectAnswers=1; + +$idose = NumberWithUnits($initial, "mg"); +$afterten = NumberWithUnits($after10, "mg"); +$timeTo1 = NumberWithUnits("$timeTo1", "hr"); + +ANS( $idose -> cmp() ); +ANS( $percent->cmp() ); +ANS( $afterten -> cmp() ); +ANS( $timeTo1->cmp(tolType=>"absolute", tolerance=>0.50001) ); + +############################################## + +BEGIN_PGML_SOLUTION + +a. We can read from the formula that the initial dose is [`[$idose]`]. (Or we could conclude this by evaluating [`A(0)`].) + +a. The formula shows us that the growth factor is [`b=[$factor]`]. We need to find the relative growth rate [`r`]. + + [`\begin{aligned}r&=b-1\\&=[@$factor-1@]\end{aligned}`] + + So [`A(t)`] decreases by [`[@($percent->value)*100@]%`] each hour. + +a. We need to compute [`A(10)`]. + + [`\begin{aligned}[t] +A(10) &= [$initial]([$factor])^{10}\\ +&\approx [@$afterten->value@] +\end{aligned}`] + + So after ten hours, there is [`[$afterten]`] left in the body. + +a. We need to solve: + + [`\begin{aligned} +[$initial]([$factor])^{t} &= 1\\ +([$factor])^{t} &= \frac{1}{[$initial]}\\ +\log\left(([$factor])^{t}\right) &= \log\left(\frac{1}{[$initial]}\right)\\ +t\cdot\log([$factor]) &= -\log([$initial])\\ +t &= \frac{-\log([$initial])}{\log([$factor])}\\ +t &\approx [@(-log($initial))/(log($factor))@] +\end{aligned}`] + + So it will take about [`[$timeTo1]`] until there is only [`1`] mg left. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions10.pg new file mode 100644 index 0000000000..565ba5c63b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions10.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$base = random(2,5,1); +do {$ex = random(2,5,1);} until ($base!=$ex); +$value = $base**($ex); + +@choices = (); +$choices[0] = "\log_{$base}($value)=$ex"; +$choices[1] = "\log_{$ex}($base)=$value"; +$choices[2] = "\log_{$base}($ex)=$value"; +$choices[3] = "\log_{$ex}($value)=$base"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the exponential equation + + [`` [$base]^{[$ex]}=[$value] ``], + +the corresponding logarithm equation is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +In the exponential equation + + [`` [$base]^{[$ex]}=[$value] ``], + +[`[$base]`] is the _base_, and [`[$ex]`] is the _exponent_. + +In the corresponding logarithm equation + + [`` \log_{[$base]}([$value])=[$ex] ``], + +[`[$base]`] is still the _base_, and [`[$ex]`] is still the _exponent_. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions20.pg new file mode 100644 index 0000000000..2b403822ac --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions20.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$exDen = random(2,5,1); +$value = random(2,10,1); +$base = $value**$exDen; + +@choices = (); +$choices[0] = "\log_{$base}($value)=\frac{1}{$exDen}"; +$choices[1] = "\log_{\frac{1}{$exDen}}($base)=$value"; +$choices[2] = "\log_{$base}(\frac{1}{$exDen})=$value"; +$choices[3] = "\log_{\frac{1}{$exDen}}($value)=$base"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the exponential equation + + [`` [$base]^{\frac{1}{[$exDen]}}=[$value] ``], + +the corresponding logarithm equation is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +In the exponential equation + + [`` [$base]^{\frac{1}{[$exDen]}}=[$value] ``], + +[`[$base]`] is the _base_, and [`\frac{1}{[$exDen]}`] is the _exponent_. + +In the corresponding logarithm equation + + [`` \log_{[$base]}([$value])=\frac{1}{[$exDen]} ``], + +[`[$base]`] is still the _base_, and [`\frac{1}{[$exDen]}`] is still the _exponent_. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions30.pg new file mode 100644 index 0000000000..1225987d69 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions30.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$base = random(2,5,1); +$ex = random(-5,-1,1); +$valueDen = $base**(abs($ex)); + +@choices = (); +$choices[0] = "\log_{$base}(\frac{1}{$valueDen})=$ex"; +$choices[1] = "\log_{\frac{1}{$valueDen}}($base)=$ex"; +$choices[2] = "\log_{$base}($ex)=\frac{1}{$valueDen}"; +$choices[3] = "\log_{\frac{1}{$valueDen}}($ex)=$base"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the exponential equation + + [`` [$base]^{[$ex]}=\frac{1}{[$valueDen]} ``], + +the corresponding logarithm equation is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +In the exponential equation + + [`` [$base]^{[$ex]}=\frac{1}{[$valueDen]} ``], + +[`[$base]`] is the _base_, and [`[$ex]`] is the _exponent_. + +In the corresponding logarithm equation + + [`` \log_{[$base]}(\frac{1}{[$valueDen]})=[$ex] ``], + +[`[$base]`] is still the _base_, and [`[$ex]`] is still the _exponent_. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions35.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions35.pg new file mode 100644 index 0000000000..03be51ba1a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions35.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$base = 10; +$ex = random(2,5,1); +$value = $base**($ex); + +@choices = (); +$choices[0] = "\log($value)=$ex"; +$choices[1] = "\ln($value)=$ex"; +$choices[2] = "\ln($ex)=$value"; +$choices[3] = "\log($ex)=$value"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the exponential equation + + [`` [$base]^{[$ex]}=[$value] ``], + +the corresponding logarithm equation is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +For [`10`]-based logarithm (_natural logarithm_), we can omit writing the base. + +In the exponential equation + + [`` [$base]^{[$ex]}=[$value] ``], + +[`[$base]`] is the _base_, and [`[$ex]`] is the _exponent_. + +In the corresponding logarithm equation + + [`` \log([$value])=[$ex] ``], + +[`[$base]`] is still the _base_, and [`[$ex]`] is still the _exponent_. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions36.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions36.pg new file mode 100644 index 0000000000..0242489676 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions36.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$base = Real(e); +$ex = random(2,5,1); +$value = Real(e)**($ex); + +@choices = (); +$choices[0] = "\ln($value) \approx $ex"; +$choices[1] = "\ln($ex) \approx $value"; +$choices[2] = "\log($ex) \approx $value"; +$choices[3] = "\log($value) \approx $ex"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the exponential equation + + [`` e^{[$ex]}\approx[$value] ``], + +the corresponding logarithm equation is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +For [`e`]-based logarithm (_natural logarithm_), we write [`\ln`] instead of [`\log_e`]. + +In the exponential equation + + [`` e^{[$ex]} \approx [$value] ``], + +[`e`] is the _base_, and [`[$ex]`] is the _exponent_. + +In the corresponding logarithm equation + + [`` \ln([$value]) \approx [$ex] ``], + +[`e`] is still the _base_, and [`[$ex]`] is still the _exponent_. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions40.pg new file mode 100644 index 0000000000..e5b22a1c89 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions40.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$base = random(2,5,1); +do {$ex = random(2,5,1);} until ($base!=$ex); +$value = $base**($ex); + +@choices = (); +$choices[0] = "$base^{$ex}=$value"; +$choices[1] = "$ex^{$base}=$value"; +$choices[2] = "$value^{$ex}=$base"; +$choices[3] = "$base^{$value}=$ex"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm equation + + [`` \log_{[$base]}([$value])=[$ex] ``], + +the corresponding exponential equation is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +In the logarithm equation + + [`` \log_{[$base]}([$value])=[$ex] ``], + +[`[$base]`] is the _base_, and [`[$ex]`] is the _exponent_. + +In the corresponding exponential equation + + [`` [$base]^{[$ex]} = [$value] ``], + +[`[$base]`] is still the _base_, and [`[$ex]`] is still the _exponent_. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions50.pg new file mode 100644 index 0000000000..8e773c9e30 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions50.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$exDen = random(2,5,1); +$value = random(2,10,1); +$base = $value**$exDen; + +@choices = (); +$choices[0] = "$base^{\frac{1}{$exDen}}=$value"; +$choices[1] = "$base^{$value}=\frac{1}{$exDen}"; +$choices[2] = "$value^{$base}=\frac{1}{$exDen}"; +$choices[3] = "$value^{\frac{1}{$exDen}}=$base"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm equation + + [`` \log_{[$base]}([$value])=\frac{1}{[$exDen]} ``], + +the corresponding exponential equation is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +In the logarithm equation + + [`` \log_{[$base]}([$value])=\frac{1}{[$exDen]} ``], + +[`[$base]`] is the _base_, and [`[$ex]`] is the _exponent_. + +In the corresponding exponential equation + + [`` [$base]^{\frac{1}{[$exDen]}} = [$value] ``], + +[`[$base]`] is still the _base_, and [`[$ex]`] is still the _exponent_. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions60.pg new file mode 100644 index 0000000000..d3bdbfefa6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions60.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$base = random(2,5,1); +$ex = random(-5,-1,1); +$valueDen = $base**(abs($ex)); + +@choices = (); +$choices[0] = "$base^{$ex}=\frac{1}{$valueDen}"; +$choices[1] = "$base^{\frac{1}{$valueDen}}=$ex"; +$choices[2] = "($ex)^{$base}=\frac{1}{$valueDen}"; +$choices[3] = "($ex)^{\frac{1}{$valueDen}}=$base"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm equation + + [`` \log_{[$base]}(\frac{1}{[$valueDen]})=[$ex] ``], + +the corresponding exponential equation is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +In the exponential equation + + [`` \log_{[$base]}(\frac{1}{[$valueDen]})=[$ex] ``], + +[`[$base]`] is the _base_, and [`[$ex]`] is the _exponent_. + +In the corresponding logarithm equation + + [`` [$base]^{[$ex]}=\frac{1}{[$valueDen]} ``], + +[`[$base]`] is still the _base_, and [`[$ex]`] is still the _exponent_. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions65.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions65.pg new file mode 100644 index 0000000000..af1484f1c3 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions65.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$base = 10; +$ex = random(2,5,1)*random(-1,1,2); +$value = $base**($ex); + +@choices = (); +$choices[0] = "$base^{$ex}=$value"; +$choices[1] = "e^{$ex}=$value"; +$choices[2] = "e^{$value}=$ex"; +$choices[3] = "$base^{$value}=$ex"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm equation + + [`` \log([$value])=[$ex] ``], + +the corresponding exponential equation is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +When the base of a logarithm expression is missing, it's implied the base is [`10`]. We call [`10`]-based logarithm the _common logarithm_. + +In the logarithm equation + + [`` \log([$value])=[$ex] ``], + +[`[$base]`] is the _base_, and [`[$ex]`] is the _exponent_. + +In the corresponding exponential equation + + [`` [$base]^{[$ex]} = [$value] ``], + +[`[$base]`] is still the _base_, and [`[$ex]`] is still the _exponent_. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions66.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions66.pg new file mode 100644 index 0000000000..aa8b7744bd --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentialLogarithmExpressions66.pg @@ -0,0 +1,123 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$base = Real(e); +$ex = random(2,5,1)*random(-1,1,2); +$value = Real(e)**($ex); + +@choices = (); +$choices[0] = "e^{$ex}=$value"; +$choices[1] = "10^{$ex}=$value"; +$choices[2] = "10^{$value}=$ex"; +$choices[3] = "e^{$value}=$ex"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm equation + + [`` \ln([$value])=[$ex] ``], + +the corresponding exponential equation is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +*[`\ln`]* is the _natural logarithm_ with [`e`] as the base. + +In the logarithm equation + + [`` \ln([$value])=[$ex] ``], + +[`e`] is the _base_, and [`[$ex]`] is the _exponent_. + +In the corresponding exponential equation + + [`` e^{[$ex]} = [$value] ``], + +[`e`] is still the _base_, and [`[$ex]`] is still the _exponent_. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentsToLogs.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentsToLogs.pg new file mode 100644 index 0000000000..61e9ba26d0 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/ExponentsToLogs.pg @@ -0,0 +1,150 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserMultiAnswer.pl", + "parserFunction.pl", + "niceTables.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(4.1,8.1,0.2); +$b = round(10**$a); + + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override log() to sneakily return sin(x) when evaluated + # + sub log { + my $self = shift; + my $x = shift; + return sin($x); + } + + # + # end of subclass + # + package main; + + + # + # make log() use our subclass + # + Context()->functions->set(log=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # + + +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->operators->undefine('*','+','-','/'); + + +$multians = MultiAnswer( +Compute($a), +Compute("log($b)")) +->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $f1stu, $f2stu ) = @{$student}; + my ( $f1, $f2 ) = @{$correct}; + if ( ($f1 == $f1stu && $f2 == $f2stu) || + ($f1 == $f2stu && $f2 == $f1stu) ) { + return 1; + } else { + if ($f1stu == $f2stu) { + Value::Error("This equation is a true equation, but it is not what was asked for."); + } else { + return 0; + } + } + } +); + + + +############################################## + +BEGIN_PGML + +Rewrite the statement using logarithms instead of exponents. + +END_PGML +BEGIN_TEXT +$PAR + +\{ +LayoutTable( +[ +["\(10^{$a}\)","\({}={}\)","\($b\)"], +[$multians->ans_rule(6),"\({}={}\)",$multians->ans_rule(12)], +], +allcellcss=>'padding:0px; padding-bottom:6px;' +) +\} + +END_TEXT + + +############################################## + +ANS( $multians->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +When one side of an equation is a number raised to a power, then that base can be moved to the other side of the equation in the form of a logarithm. That is + + [`\begin{aligned} +b^{\text{left}}&=\text{right}\\ +\underset{\hookrightarrow}{b}^{\text{left}}&=\text{right}\\ +\text{left} &= \log_b(\text{right}) +\end{aligned}`] + +So we have the equation + + [`[$a]=\log([$b])`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/HalvingTime.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/HalvingTime.pg new file mode 100644 index 0000000000..9c4179f215 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/HalvingTime.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl" +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$k = random(4,30,1); +$kN = 100-$k; +$kp = $k/100; +$kpN = 1-$kp; + +$halvingTime = ln(1/2)/(ln($kpN)); + + + +Context("LimitedNumeric"); +Context()->flags->set(tolerance=>0.01); + +$halvingTime = Compute("$halvingTime"); +$halvingTimeU = NumberWithUnits("$halvingTime","min"); + +############################################## + +BEGIN_PGML + +A radioactive material decays at a continuous rate of [`[$k]`]% per minute. Find the half-life of the substance. Use *min* for minutes. + +[_______________]{$halvingTimeU} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +The mass of a radioactive decay substance can be modeled by the exponential function + + [`` A(t)=A_0e^{kt} ``] + +where [`A_0`] is the initial mass, [`k`] is the decay rate and [`t`] is time. + +In this problem, after [`1`] minute, the substance loses [`[$k]`]% of its mass, implying [`[$kpN]`]% of its mass is left after [`1`] minute. + +Substitute [`t=1`] and [`A(t)=[$kpN]A_0`] into the formula, we have + + [`` +\begin{aligned} + [$kpN]A_0 &= A_0e^{k(1)} \\ + [$kpN] &= e^k \\ + \ln([$kpN]) &= k +\end{aligned} + ``] + +The mass of the substance can be modeled by the function + + [`` A(t)=A_0e^{\ln([$kpN])t} ``] + +To find the substance's half life, substitute in [`A(t)=0.5A_0`] and solve for [`t`], we have + + [`` +\begin{aligned} + 0.5A_0 &= A_0e^{\ln([$kpN])t} \\ + 0.5 &= e^{\ln([$kpN])t} \\ + \ln(0.5) &= \ln([$kpN])t \\ + \frac{\ln(0.5)}{\ln([$kpN])} &= t \\ + [$halvingTime] \approx t +\end{aligned} + ``] + +The substance's half life is approximately [`[$halvingTimeU]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/HalvingTime2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/HalvingTime2.pg new file mode 100644 index 0000000000..6dc3391e1c --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/HalvingTime2.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unionTables.pl", + "parserNumberWithUnits.pl" +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$r = random(4,30,1); +$t = random(3,20,1); +$rN = 100-$r; +$rp = $r/100; +$rpN = 1-$rp; + +$k = ln($rpN)/(-$t); + +$halvingTime = ln(1/2)/(-$k); + + + +Context("LimitedNumeric"); +Context()->flags->set(tolerance=>0.01); + + + +$halvingTime = Compute("$halvingTime"); +$halvingTimeU = NumberWithUnits("$halvingTime","hr"); + + +$tU = NumberWithUnits("$t", "hr"); + +############################################## + +BEGIN_PGML + +If [`[$r]`]% of a radioactive substance decays in [`[$t]`], what is the half-life of the substance. Use *hr* for hours. + +[_______________]{$halvingTimeU} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The mass of a radioactive decay substance can be modeled by the exponential function + + [`` A(t)=A_0e^{kt} ``] + +where [`A_0`] is the initial mass, [`k`] is the decay rate and [`t`] is time. + +In this problem, after [`[$t]`] hours, the substance loses [`[$r]`]% of its mass, implying [`[$rN]`]% of its mass is left after [`[$t]`] hours. + +Substitute [`t=[$t]`] and [`A(t)=[$rpN]A_0`] into the formula, we have + + [`` +\begin{aligned} + [$rpN]A_0 &= A_0e^{k([$t])} \\ + [$rpN] &= e^{[$t]k} \\ + \ln([$rpN]) &= [$t]k \\ + \frac{\ln{([$rpN])}}{[$t]} &= k +\end{aligned} + ``] + +The mass of the substance can be modeled by the function + + [`` A(t)=A_0e^{\frac{\ln{([$rpN]})}{[$t]}t} ``] + +To find the substance's half life, substitute in [`A(t)=0.5A_0`] and solve for [`t`], we have + + [`` +\begin{aligned} + 0.5A_0 &= A_0e^{\frac{\ln{([$rpN])}}{[$t]}t} \\ + 0.5 &= e^{\frac{\ln{([$rpN])}}{[$t]}t} \\ + \ln(0.5) &= \frac{\ln{([$rpN])}}{[$t]}t \\ + [$t]\ln(0.5) &= \ln{([$rpN])}t \\ + \frac{[$t]\ln(0.5)}{\ln([$rpN])} &= t \\ + [$halvingTime] \approx t +\end{aligned} + ``] + +The substance's half life is approximately [`[$halvingTimeU]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/Iodine.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/Iodine.pg new file mode 100644 index 0000000000..720af83f02 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/Iodine.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "parserNumberWithUnits.pl", + "PGML.pl", + "PGcourse.pl", + "parserOneOf.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->variables->are(t=>'Real'); +parser::Assignment->Allow; +parser::Assignment->Function("A"); + + +$halfLife = 13; +$halfLifeHrs = NumberWithUnits("$halfLife", "hr"); + +$a = 50; +$amg = NumberWithUnits("$a","mg"); + + +$k = ln(2)/$halfLife; + +$b = exp(-$k); + +$Ac = Formula("A(t)=$a*e^(-$k t)"); +$Ab = Formula("A(t)=$a*$b^t"); + +$final = random(1,15,1); +$finalmg = NumberWithUnits("$final","mg"); + + +$ans = ln($final/$a)/(-$k); +$ans = NumberWithUnits("$ans","hr"); + +############################################## + +BEGIN_PGML + +The half-life of Iodine-123 is about [`[$halfLifeHrs]`]. You begin with [`[$amg]`] of Iodine-123. + + +a. Find a formula for [`A`], the amount of Iodine-123 (in mg) remaining after [`t`] hours. Your answer should be in the form *A(t)=...*. + + [______________________] + + +a. How long until you only have [`[$finalmg]`]? Use *hr* for hours. + + [______________________] + + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + + + +ANS( OneOf($Ab,$Ac)->cmp() ); + +ANS( $ans->cmp() ); + + +############################################## + +BEGIN_PGML_SOLUTION + +a. We know that the amount of a radioactive substance decays exponentially, and here we have an initial value of [`[$amg]`]. So we know that [`A(t)=[$a](b)^t`], and we just need to establish what [`b`] is. Since the half-life is [`[$halfLife]`], + + [`\begin{aligned} +[@$a/2@]&=[$a](b)^{[$halfLife]}\\ +\frac12 &= b^{[$halfLife]}\\ +\left(\frac12\right)^{1/[$halfLife]} &= b\\ +b & \approx [$b] +\end{aligned}`] + + So [`[$Ab]`]. + +a. We need to solve the equation + + [`\begin{aligned} +[$final] &= [$a]([$b])^{t}\\ +\log([$final]) &= \log\left([$a]([$b])^{t}\right)\\ +\log([$final]) &= \log([$a])+\log\left([$b]^{t}\right)\\ +\log([$final]) &= \log([$a])+t\cdot \log([$b])\\ +\log([$final]) - \log([$a]) &= t\cdot \log([$b])\\ +\frac{\log([$final]) - \log([$a])}{\log([$b])} &= t\\ +[@$ans->value@] &= t +\end{aligned}`] + + So it will take [`[$ans]`] until you only have [`[$finalmg]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication10.pg new file mode 100644 index 0000000000..0f8827923a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication10.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Exponential/logarithm application problem +# +# Last edited: Yao 7/10/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +$name = RandomName(); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +do { + $initial = random(1000,20000,1000); + $interestP = random(1.1,3,0.1); + $interest = $interestP/100; + $a = 1+$interest; + + $func = Compute("$initial*$a**t")->reduce; + $upper = $func->eval(t=>10); + + $x1 = random(3,10,1); + $y1 = $initial*$a**$x1; + $y1Show = int($y1*1000+0.5)/1000; + + $y2 = random($initial+1000,$upper,1000); +} until (abs($y2-$y1)>2000); +$funcX = Compute("$initial*$a**x")->reduce; + +$x2 = ln($y2/$initial)/ln($a); +$x2Show = int($x2*1000+0.5)/1000; +$x2R = int($x2*10+0.5)/10; + +Context("Currency"); +$initialC = Currency($initial); +$y1C = Currency($y1); +$y2C = Currency($y2); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +[$name] purchased [`[$initialC]`] of bonds, which pay an annual interest of [`[$interestP]%`]. The value of the bonds, in dollars, can be modeled by the exponential function + + [`` v(t)=[$func] ``] + +where [`t`] is the number of years passed since the purchase. + +Answer the following questions: + +1) The bonds would be worth [___________]{$y1C} after [`[$x1]`] years. Round your answers to two decimal places (to the cent). + +2) The bonds would be worth [`[$y2C]`] after [___________]{$x2R} years. Round your answers to one decimal place (the tenth digit). + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +###Question 1 + +We need to substitute the function's [`t`] value with [`[$x1]`] to get the corresponding [`y`] value. + + [`` +\begin{aligned}[t] + v(t) &= [$func] \\ + v([$x1]) &= [$initial]\cdot[$a]^{[$x1]} \\ + v([$x1]) &\approx [$y1C] +\end{aligned} + ``] + +The bonds would be worth [`[$y1C]`] after [`[$x1]`] years. + +###Question 2 + +We need to substitute the function's value with [`[$y2]`], and then solve for [`t`]. + + [`` +\begin{aligned}[t] + v(t) &= [$func] \\ + [$y2] &= [$func] \\ + \frac{[$y2]}{[$initial]} &= [$a]^{t} \\ + \ln\left(\frac{[$y2]}{[$initial]}\right) &= \ln\left([$a]^{t}\right) \\ + \ln\left(\frac{[$y2]}{[$initial]}\right) &= t\ln([$a]) \\ + \frac{\ln\left(\frac{[$y2]}{[$initial]}\right)}{\ln([$a])} &= t \\ + [$x2] &\approx t +\end{aligned} + ``] + +The bonds would be worth [`[$y2C]`] after [`[$x2R]`] years. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication20.pg new file mode 100644 index 0000000000..b668876cc6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication20.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Exponential/logarithm application problem +# +# Last edited: Yao 7/12/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +do { + $initial = random(180,205,5); + $room = random(50,80,5); + $c = $initial-$room; + $k = -random(0.03,0.09,0.001); + + $func = Compute("$c*e**($k*t)+$room")->reduce; + + do { + $x1 = random(10,$initial-90,5); + $y1 = $func->eval(t=>$x1); + $y2 = random($room+10,$initial-90,5); + } until abs($y2-$y1)>20; + $y1Show = int($y1*1000+0.5)/1000; + $y1R = int($y1*100+0.5)/100; + $x2 = ln(($y2-$room)/$c)/$k; + $x2R = int($x2*10+0.5)/10; +} until (abs($x1-$x2)>10); +$funcX = Compute("$c*e**($k*x)+$room")->reduce; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A cup of coffee's temperature was [`[$initial]`] degrees (Fahrenheit) when it was poured into a cup. The coffee's temperature, in Fahrenheit degrees, can be modeled by the following function: + + [`` f(t)=[$func] ``] + +where [`t`] is the number of minutes passed since the coffee was poured into the cup. + +Answer the following questions: + +1) After [`[$x1]`] minutes, the coffee's temperature would be [___________]{$y1R} degrees. Round your answer to two decimal places. + +2) After [___________]{$x2R} minutes, the coffee's temperature would be [`[$y2]`] degrees. Round your answer to one decimal place. + +3) In the long run, the coffee's temperature would be [___________]{$room} degrees. + +END_PGML + +############################################## + +$s1 = $y2-$room; + +BEGIN_PGML_SOLUTION + +###Question 1 + +We need to substitute the function's [`x`] value with [`[$x1]`] to get the corresponding [`y`] value. + + [`` +\begin{aligned}[t] + v(t) &= [$func] \\ + v([$x1]) &= [$c]\cdot e^{[$k]\cdot([$x1])}+[$room] \\ + v([$x1]) &\approx [$y1R] +\end{aligned} + ``] + +After [`[$x1]`] minutes, the coffee's temperature would be [`[$y1R]`] degrees. + +###Question 2 + +We need to substitute the function's value with [`[$y2]`], and then solve for [`t`]. + + [`` +\begin{aligned}[t] + v(t) &= [$func] \\ + [$y2] &= [$func] \\ + [$s1] &= [$c]\cdot e^{[$k]t} \\ + \frac{[$s1]}{[$c]} &= e^{[$k]t} \\ + \ln\left(\frac{[$s1]}{[$c]}\right) &= [$k]t \\ + \frac{\ln\left(\frac{[$s1]}{[$c]}\right)}{[$k]} &= t \\ + [$x2R] &\approx t +\end{aligned} + ``] + +After [`[$x2R]`] minutes, the coffee's temperature would be [`[$y2]`] degrees. + +###Part 3: + +To find what value the function is approaching as [`x`] becomes bigger and bigger, we can substitute the [`x`] value with infinity. Since [`e^{-\infty}=0`], we have: + + [`` +\begin{aligned}[t] + v(t) &= [$func] \\ + v(\infty) &= [$c]\cdot e^{[$k](\infty)}+[$room] \\ + &= [$c]\cdot e^{-\infty}+[$room] \\ + &= [$c]\cdot 0+[$room] \\ + &= [$room] +\end{aligned} + ``] + +In the long run, the coffee's temperature would be [`[$room]`] degrees (the room temperature). + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication30.pg new file mode 100644 index 0000000000..b177e012fd --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication30.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Exponential/logarithm application problem +# +# Last edited: Yao 7/12/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +do { + $initial = random(5,20,1); + $k = random(0.05,0.20,0.01); + + $func = Compute("$initial*e**($k*t)")->reduce; + + $x1 = random(10,30,1); + $y1 = $func->eval(t=>$x1); + $y1R = int($y1*100+0.5)/100; + + $y2 = random($initial+5,$initial+20,1); +} until (abs($y2-$y1)>5); + +$x2 = ln($y2/$initial)/$k; +$x2R = int($x2*10+0.5)/10; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +The population of bacteria in a container follows the law of uninhibited growth. The bacteria's weight, [`w(t)`], can be modeled by the following function: + + [`` w(t)=[$func] ``] + +where [`t`] is the number of hours. + +Answer the following questions: + +1) After [`[$x1]`] hours, there would be [___________]{$y1R} grams of bacteria. Round your answer to two decimal places. + +2) After [___________]{$x2R} hours, there would be [`[$y2]`] grams of bacteria. Round your answer to one decimal place. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +###Question 1 + +We need to substitute the function's [`x`] value with [`[$x1]`] to get the corresponding [`y`] value. + + [`` +\begin{aligned}[t] + w(t) &= [$func] \\ + w([$x1]) &= [$initial]\cdot e^{[$k]\cdot([$x1])} \\ + w([$x1]) &\approx [$y1R] +\end{aligned} + ``] + +After [`[$x1]`] hours, there would be [`[$y1R]`] grams of bacteria. + +###Question 2 + +We need to substitute the function's value with [`[$y2]`], and then solve for [`t`]. + + [`` +\begin{aligned}[t] + w(t) &= [$func] \\ + [$y2] &= [$func] \\ + \frac{[$y2]}{[$initial]} &= e^{[$k]t} \\ + \ln\left(\frac{[$y2]}{[$initial]}\right) &= [$k]t \\ + \frac{\ln\left(\frac{[$y2]}{[$initial]}\right)}{[$k]} &= t \\ + [$x2R] &\approx t +\end{aligned} + ``] + +After [`[$x2R]`] hours, there would be [`[$y2]`] grams of bacteria. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication40.pg new file mode 100644 index 0000000000..988b97cf7a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication40.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Exponential/logarithm application problem +# +# Last edited: Yao 7/12/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +do { + $initial = random(5,20,1); + $k = random(0.05,0.20,0.01); + + $func = Compute("$initial*e**($k*t)")->reduce; + + $x1 = random(10,30,1); + $y1 = $func->eval(t=>$x1); + $y1R = int($y1*100+0.5)/100; + + $y2 = random($initial+5,$initial+20,1); +} until (($y2-$y1)>5); + +$k1 = ln($y1R/$initial)/$x1; +$func1 = Compute("$initial*e**($k1*t)")->reduce; + +$x2 = ln($y2/$initial)/$k1; +$x2R = int($x2*10+0.5)/10; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +The population of bacteria in a container follows the law of uninhibited growth. At the beginning, there were [`[$initial]`] grams of bacteria. After [`[$x1]`] hours, there were [`[$y1R]`] grams of bacteria. + +Answer the following question. + +After [___________]{$x2R} hours, there would be [`[$y2]`] grams of bacteria. Round your answer to one decimal place. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since the bacteria population follows the law of unihibited growth, with an initial weight of [`[$initial]`] grams, we can model the bacteria's weight by the following function: + + [`` w(t) = [$initial]e^{kt}, ``] + +where [`k`] is the growth rate and [`t`] is the number of hours. To solve for the constant [`k`], we need to use the given condition that, after [`[$x1]`] hours, there were [`[$y1R]`] grams of bacteria. Substitute in those two given values, we have: + + [`` +\begin{aligned}[t] + w(t) &= [$initial]e^{kt} \\ + [$y1R] &= [$initial]\cdot e^{k([$x1])} \\ + \frac{[$y1R]}{[$initial]} &= e^{k([$x1])} \\ + \ln\left( \frac{[$y1R]}{[$initial]} \right) &= k([$x1]) \\ + \frac{\ln\left( \frac{[$y1R]}{[$initial]} \right)}{[$x1]} &= k +\end{aligned} + ``] + +The bacteria's weight can be modeled by the function + + [`` w(t) = [$initial]e^{\frac{\ln\left( \frac{[$y1R]}{[$initial]} \right)}{[$x1]}t}, ``] + +where [`k`] is the growth rate and [`t`] is the number of hours. Note that we didn't round the value of [`k`] in order to get more accurate answers. + +To find when there would be [`[$y2]`] grams of bacteria, we need to substitute the function's value with [`[$y2]`], and then solve for [`t`]. + + [`` +\begin{aligned}[t] + w(t) &= [$initial]e^{\frac{\ln\left( \frac{[$y1R]}{[$initial]} \right)}{[$x1]}t} \\ + [$y2] &= [$initial]e^{\frac{\ln\left( \frac{[$y1R]}{[$initial]} \right)}{[$x1]}t} \\ + \frac{[$y2]}{[$initial]} &= e^{\frac{\ln\left( \frac{[$y1R]}{[$initial]} \right)}{[$x1]}t} \\ + \ln\left(\frac{[$y2]}{[$initial]}\right) &= \frac{\ln\left( \frac{[$y1R]}{[$initial]} \right)}{[$x1]}t \\ + [$x1]\ln\left(\frac{[$y2]}{[$initial]}\right) &= \ln\left( \frac{[$y1R]}{[$initial]} \right)t \\ + \frac{[$x1]\ln\left(\frac{[$y2]}{[$initial]}\right)}{\ln\left( \frac{[$y1R]}{[$initial]} \right)} &= t \\ + [$x2R] &\approx t +\end{aligned} + ``] + +After [`[$x2R]`] hours, there would be [`[$y2]`] grams of bacteria. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication50.pg new file mode 100644 index 0000000000..d2c2eb899c --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication50.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Exponential/logarithm application problem +# +# Last edited: Yao 7/12/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +$p = random(30,80,1); +$pd = $p/100; +$x = -ln($pd)/0.693*5730; +$xR = int($x+0.5); + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +Carbon 14 decay can be modeled by the following function: + + [`` w(t)=C\cdot e^{\frac{-0.693t}{5730}} ``] + +where [`w(t)`] is Carbon 14's weight in grams, [`C`] is Carbon 14's initial weight in grams and [`t`] is the number of years. + +If an antient bone is found to have [`[$p]%`] of Carbon 14 left, determine the bone's age. + +The bone's age is approximately [___________]{$xR} years. Round your answer to a whole number. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +If the bone had [`C`] grams of Carbon 14 when it was buried, it has [`[$pd]C`] grams left now. We have: + + [`` +\begin{aligned}[t] + w(t) &= C\cdot e^{\frac{-0.693t}{5730}} \\ + [$pd]C &= C\cdot e^{\frac{-0.693t}{5730}} \\ + [$pd] &= e^{\frac{-0.693t}{5730}} \\ + \ln([$pd]) &= \frac{-0.693t}{5730} \\ + 5730\ln([$pd]) &= -0.693t \\ + 5730\frac{\ln([$pd])}{-0.693} &= t \\ + [$xR] &\approx t +\end{aligned} + ``] + +The bone's age is approximately [`[$xR]`] years. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication60.pg new file mode 100644 index 0000000000..e30770a99f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication60.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Exponential/logarithm application problem +# +# Last edited: Yao 7/12/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +$h = random(5,20,1); +$initial = random(20,50,1); +$k = ln(0.5)/$h; +$kR = int($k*1000+0.5)/1000; + +$hR = ln(0.5)/$kR; +$hR = int($hR*100+0.5)/100; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A radioactive material's weight, in grams, can be modeled by the following function: + + [`` w(t)=C\cdot e^{[$kR]t} ``] + +where [`C`] is the material's initial weight in grams and [`t`] is the number of hours. + +Answer the following question. + +The material's half life is [___________]{$hR} hours. Round your answer to two decimal places. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To find the material's half life, substitute the function's value with [`0.5C`], and then solve for [`t`]: + + [`` +\begin{aligned}[t] + w(t) &= C\cdot e^{[$kR]t} \\ + 0.5C &= C\cdot e^{[$kR]t} \\ + 0.5 &= e^{[$kR]t} \\ + \ln(0.5) &= [$kR]t \\ + \frac{\ln(0.5)}{[$kR]} &= t \\ + [$hR] &\approx t +\end{aligned} + ``] + +The material's half life is appoximately [`[$hR]`] hours. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication70.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication70.pg new file mode 100644 index 0000000000..6543ab3fa0 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication70.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Exponential/logarithm application problem +# +# Last edited: Yao 7/12/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Algebraic Expressions') +## KEYWORDS('calculator','graphing','intersection') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => 'Real'); + +$h = random(5,20,1); +$initial = random(20,50,1); +$x = random($h+1,2*$h,1); +$y = $initial*Real(e)**(ln(0.5)/$h*$x); +$yR = int($y*100+0.5)/100; + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +A radioactive material's half life is [`[$h]`] hours. There were [`[$initial]`] grams of this material initially. Answer the following question. + +There would be [___________]{$yR} grams left after [`[$x]`] hours. Round your answer to two decimal places. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Let the following function model the material's weight, in grams: + + [`` w(t)=C\cdot e^{kt} ``] + +where [`k`] is a constant, [`C`] is the material's initial weight in grams and [`t`] is the number of hours. + +Since the material's half life is [`[$h]`] hours, we can substitute [`t=[$h]`] and [`w(t)=0.5C`] into the function, and solve for [`k`]: + + [`` +\begin{aligned}[t] + w(t) &= C\cdot e^{kt} \\ + 0.5C &= C\cdot e^{k([$h])} \\ + 0.5 &= e^{k([$h])} \\ + \ln(0.5) &= k([$h]) \\ + \frac{\ln(0.5)}{[$h]} &= k +\end{aligned} + ``] + +We have found [`k`]'s value. It's given there were [`[$initial]`] grams of materials initially, so the function to model the material's weight is: + + [`` w(t)=[$initial]\cdot e^{\frac{\ln(0.5)}{[$h]}t} ``] + +Note that we didn't round [`k`]'s value in order to get more accurate values. + +To find the material's weight after [`[$x]`] hours, we substitute [`t=[$x]`] into [`w(t)`], and we have: + + [`` +\begin{aligned}[t] + w(t) &= [$initial]\cdot e^{\frac{\ln(0.5)}{[$h]}t} \\ + w([$x]) &= [$initial]\cdot e^{\frac{\ln(0.5)}{[$h]}([$x])} \\ + w([$x]) &\approx [$yR] +\end{aligned} + ``] + +There would be [`[$yR]`] grams left after [`[$x]`] hours. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication80.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication80.pg new file mode 100644 index 0000000000..fcfdb4a5b6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication80.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl" +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$k = random(4,30,1); +$kp = $k/100; +$kpN = -$kp; +$halvingTime = ln(1/2)/$kpN; + +Context("LimitedNumeric"); +Context()->flags->set(tolerance=>0.01); + +$halvingTime = Compute("$halvingTime"); +$halvingTimeU = NumberWithUnits("$halvingTime","min"); + +############################################## + +BEGIN_PGML + +The growth/decay formula is + + [``A(t) = A_0e^{rt},``] + +where [`A(t)`] models the mass of material, [`A_0`] is the initial mass, [`r`] is the growth or decay rate, and [`t`] is time. + +A radioactive material decays at the rate of [`[$k]%`] per minute. Find the half-life of the substance. Use [|min|]* for minutes. + +[_______________]{$halvingTimeU} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Since the decay rate is given as [`[$k]%`] per minute, the mass of the substance can be modeled by the function + + [`` A(t)=A_0e^{[$kpN]t}, ``] + +where [`A_0`] is the initial mass, and [`t`] is time in minutes. + +To find the substance's half life, substitute in [`A(t)=0.5A_0`] and solve for [`t`], we have + + [`` +\begin{aligned} + 0.5A_0 &= A_0e^{[$kpN]t} \\ + 0.5 &= e^{[$kpN]t} \\ + \ln(0.5) &= [$kpN]t \\ + \frac{\ln(0.5)}{[$kpN]} &= t \\ + [$halvingTime] \approx t +\end{aligned} + ``] + +The substance's half life is approximately [`[$halvingTimeU]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication90.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication90.pg new file mode 100644 index 0000000000..9282ca511e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmApplication90.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "unionTables.pl", + "parserNumberWithUnits.pl" +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$r = random(4,30,1); +$t = random(3,20,1); +$rN = 100-$r; +$rp = $r/100; +$rpN = 1-$rp; + +$k = ln($rpN)/(-$t); + +$halvingTime = ln(1/2)/(-$k); + + + +Context("LimitedNumeric"); +Context()->flags->set(tolerance=>0.01); + + + +$halvingTime = Compute("$halvingTime"); +$halvingTimeU = NumberWithUnits("$halvingTime","hr"); + + +$tU = NumberWithUnits("$t", "hr"); + +############################################## + +BEGIN_PGML + +The growth/decay formula is + + [``A(t) = A_0e^{rt},``] + +where [`A(t)`] models the mass of material, [`A_0`] is the initial mass, [`r`] is the growth or decay rate, and [`t`] is time. + +If [`[$r]%`] of a radioactive substance have decayed in [`[$tU]`], what is the half-life of the substance. Use [|hr|]* for hours. + +[_______________]{$halvingTimeU} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +In this problem, after [`[$t]`] hours, the substance loses [`[$r]%`] of its mass, implying [`[$rN]%`] of its mass is left after [`[$t]`] hours. + +Substitute [`t=[$t]`] and [`A(t)=[$rpN]A_0`] into the formula, we have + + [`` +\begin{aligned} + [$rpN]A_0 &= A_0e^{k([$t])} \\ + [$rpN] &= e^{[$t]k} \\ + \ln([$rpN]) &= [$t]k \\ + \frac{\ln{([$rpN])}}{[$t]} &= k +\end{aligned} + ``] + +The mass of the substance can be modeled by the function + + [`` A(t)=A_0e^{\frac{\ln{([$rpN]})}{[$t]}t} ``] + +To find the substance's half life, substitute in [`A(t)=0.5A_0`] and solve for [`t`], we have + + [`` +\begin{aligned} + 0.5A_0 &= A_0e^{\frac{\ln{([$rpN])}}{[$t]}t} \\ + 0.5 &= e^{\frac{\ln{([$rpN])}}{[$t]}t} \\ + \ln(0.5) &= \frac{\ln{([$rpN])}}{[$t]}t \\ + [$t]\ln(0.5) &= \ln{([$rpN])}t \\ + \frac{[$t]\ln(0.5)}{\ln([$rpN])} &= t \\ + [$halvingTime] \approx t +\end{aligned} + ``] + +The substance's half life is approximately [`[$halvingTimeU]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks10.pg new file mode 100644 index 0000000000..9dc7aa8b38 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks10.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +@nums = ([2,6],[3,4],[4,3],[5,3],[6,2],[7,2],[8,2],[9,2],[10,2]); +$index0 = random(0,8,1); +$index1 = random(0,8,1); +do {$index2 = random(0,8,1);} until ($index2!=$index0); + +$base0 = $nums[$index0][0]; +$base1 = $nums[$index1][0]; +$base2 = $nums[$index2][0]; + +$ex0 = random(2,$nums[$index0][1],1); +$ex1 = 0; +$ex2 = -random(2,$nums[$index2][1],1); + +$value0 = $base0**($ex0); +$value1 = $base1**($ex1); +$value2Den = $base2**(abs($ex2)); + + +############################################## + +BEGIN_PGML + +Fill in the blanks: + +a. [`` \log_{[$base0]}([$value0])=``] [__________]{$ex0} + +a. [`` \log_{[$base1]}([$value1])=``] [__________]{$ex1} + +a. [`` \log_{[$base2]}(\frac{1}{[$value2Den]})=``] [__________]{$ex2} + +END_PGML + + +############################################## + + + +############################################## + +BEGIN_PGML_SOLUTION + +a. [`` \log_{[$base0]}([$value0])=[$ex0]``] because [`` [$base0]^{[$ex0]}=[$value0] ``]. + +a. [`` \log_{[$base1]}([$value1])=[$ex1]``] because [`` [$base1]^{[$ex1]}=[$value1] ``]. + +a. [`` \log_{[$base2]}(\frac{1}{[$value2Den]})=[$ex2]``] because [`` [$base2]^{[$ex2]}=\frac{1}{[$value2Den]} ``]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks20.pg new file mode 100644 index 0000000000..2874c86ad3 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks20.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +@nums = ([2,6],[3,4],[4,3],[5,3],[6,2],[7,2],[8,2],[9,2],[10,2]); + +do { + $index0 = random(0,8,1); + $base0 = $nums[$index0][0]; + $exDen0 = random(2,$nums[$index0][1],1); + $value0 = $base0**($exDen0); + + do {$index1 = random(0,8,1);} until ($index0!=$index1); + $base1 = $nums[$index1][0]; + $exDen1 = random(2,$nums[$index1][1],1); + $value1 = $base1**($exDen1); +} until ($exDen1 != $exDen0); + + $ex0 = Fraction(1,$exDen0); + $ex1 = Fraction(1,$exDen1); + +############################################## + +BEGIN_PGML + +Fill in the blanks: + +a. [`` \log_{[$value0]}([$base0])=``] [__________]{$ex0} + +a. [`` \log_{[$value1]}([$base1])=``] [__________]{$ex1} + +END_PGML + + +############################################## + + + +############################################## + +$s0 = ($exDen0==2) ? "=\sqrt{$value0}" : "=\sqrt[$exDen0]{$value0}"; +$s1 = ($exDen1==2) ? "=\sqrt{$value1}" : "=\sqrt[$exDen1]{$value1}"; + +BEGIN_PGML_SOLUTION + +a. [`` \log_{[$value0]}([$base0])=[$ex0]``] because [`` [$value0]^{[$ex0]}[$s0]=[$base0] ``]. + +a. [`` \log_{[$value1]}([$base1])=[$ex1]``] because [`` [$value1]^{[$ex1]}[$s1]=[$base1] ``]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks30.pg new file mode 100644 index 0000000000..bf9496501d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks30.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$base0 = list_random(2,3,5); +do {$base1 = list_random(2,3,5);} until ($base1 != $base0); + +do { + $exHalf0 = random(2,6,1); + $value0 = $base0**$exHalf0; + $exThird1 = random(2,6,1); + $value1 = $base1**$exThird1; +} until ( ($value0<=125) && ($value1<=125) ); + +$ex0 = 2*$exHalf0; +$ex1 = 3*$exThird1; + + +############################################## + +BEGIN_PGML + +Fill in the blanks: + +a. [`` \log_{\sqrt{[$base0]}}([$value0])=``] [__________]{$ex0} + +a. [`` \log_{\sqrt[3]{[$base1]}}([$value1])=``] [__________]{$ex1} + +END_PGML + + +############################################## + + + +############################################## + +BEGIN_PGML_SOLUTION + +a. [`` \log_{\sqrt{[$base0]}}([$value0])=[$ex0]``] because [`` (\sqrt{[$base0]})^{[$ex0]}=([$base0]^{\frac{1}{2}})^{[$ex0]}=[$base0]^{[$exHalf0]}=[$value0] ``]. + +a. [`` \log_{\sqrt[3]{[$base1]}}([$value1])=[$ex1]``] because [`` (\sqrt[3]{[$base1]})^{[$ex1]}=([$base1]^{\frac{1}{3}})^{[$ex1]}=[$base1]^{[$exThird1]}=[$value1] ``]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks40.pg new file mode 100644 index 0000000000..f09260eded --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks40.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +@nums = ([2,6],[3,4],[4,3],[5,3],[6,2],[7,2],[8,2],[9,2],[10,2]); + +do { + $index0 = random(0,8,1); + $index1 = random(0,8,1); + + $base0 = $nums[$index0][0]; + $base1 = $nums[$index1][0]; + + $ex0 = -random(2,$nums[$index0][1],1); + $ex1 = -random(2,$nums[$index1][1],1); +} until $ex0 != $ex1 && $index1!= $index0; + +$value0 = $base0**(-$ex0); +$value1 = $base1**(-$ex1); + + +############################################## + +BEGIN_PGML + +Fill in the blanks: + +a. [`` \log_{\frac{1}{[$base0]}}([$value0])=``] [__________]{$ex0} + +a. [`` \log_{\frac{1}{[$base1]}}([$value1])=``] [__________]{$ex1} + +END_PGML + + +############################################## + + + +############################################## + +BEGIN_PGML_SOLUTION + +a. [`` \log_{\frac{1}{[$base0]}}([$value0])=[$ex0]``] because [`` (\frac{1}{[$base0]})^{[$ex0]}=([$base0]^{-1})^{[$ex0]}=[$base0]^{[$ex0*-1]}=[$value0] ``]. + +a. [`` \log_{\frac{1}{[$base1]}}([$value1])=[$ex1]``] because [`` (\frac{1}{[$base1]})^{[$ex1]}=([$base1]^{-1})^{[$ex1]}=[$base1]^{[$ex1*-1]}=[$value1] ``]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks50.pg new file mode 100644 index 0000000000..4ed09e427a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmBlanks50.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$base0 = "e"; +$base1 = 10; + +$ex0 = non_zero_random(-5,5,1); +$ex0Abs = abs($ex0); +$ex1 = non_zero_random(-4,4,1); + +$value0 = ($ex0>0) ? "e^{$ex0}" : "\frac{1}{e^{$ex0Abs}}"; +if ($ex0==1) {$value0 = "e";} +if ($ex0==-1) {$value0 = "\frac{1}{e}";} +$value1 = $base1**($ex1); + + +############################################## + +BEGIN_PGML + +Fill in the blanks: + +a. [`` \ln([$value0])=``] [__________]{$ex0} + +a. [`` \log([$value1])=``] [__________]{$ex1} + +END_PGML + + +############################################## + + + +############################################## + +BEGIN_PGML_SOLUTION + +For _common logarithm_, we can omit writing the base of [`10`]. For example, [`\log(100)=2`]. + +For _natural logarithm_, we write [`\ln`] instead of [`\log_{e}`]. For example, [`\ln(e)=1`]. + +a. [`` \ln([$value0])=[$ex0]``] because [`` e^{[$ex0]}=[$value0] ``]. + +a. [`` \log([$value1])=[$ex1]``] because [`` 10^{[$ex1]}=[$value1] ``]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmCalculatorValue10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmCalculatorValue10.pg new file mode 100644 index 0000000000..6b2bc6f6df --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmCalculatorValue10.pg @@ -0,0 +1,73 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +do { + $base = random(2,9,1); + $value = random(2,100,1); + $ex = ln($value)/ln($base); +} until ($ex != int($ex)); + + +############################################## + +BEGIN_PGML + +Use a scientific calculator to find the value of the logarithm expression. Round your answer to four significant digits. + + [`` \log_{[$base]}([$value])\approx``] [__________]{$ex} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To use a scientific calculator to calculate the value of a logarithm with a base other than [`e`] and [`10`], we can use the change base formula: + + [`` \log_{a}(M)=\frac{\log_{b}(M)}{\log_{b}(a)} ``] + +For the given problem, we can change the base to either [`e`] or [`10`]: + + [`` \log_{[$base]}([$value])=\frac{\ln([$value])}{\ln([$base])}\approx[$ex] ``] + +or + + [`` \log_{[$base]}([$value])=\frac{\log([$value])}{\log([$base])}\approx[$ex] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmDomain10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmDomain10.pg new file mode 100644 index 0000000000..0d8fc2f105 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmDomain10.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# Last updates: Yao 7/3/2018 +# ENDDESCRIPTION + +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') +##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem('') +##Author('Carl Yao') +##Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## +TEXT(beginproblem()); + + + +$fname = RandomVariableName(type=>function); #get a name for the function + + +Context("Numeric"); +$a = random(2,10,1); +$f = Formula("log($a-x)")->reduce; #generate a radical function + + +Context("Interval"); +$domain = Compute("(-inf,$a)"); + +############################################## + +BEGIN_PGML + + +Find the domain of [`[$fname]`] where [`[$fname](x)=[$f]`]. + +[@KeyboardInstructions('Use interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + +[____________________]{$domain} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +To ensure that we are not taking the logarithm of a negative number, we need to solve the following inequality: + + + [`\begin{aligned}[t] +[$a]-x & \gt 0\\ +[$a] & \gt x +\end{aligned}`] + +This tells us that [`x`] must be less than or equal to [`[$a]`] or be in the interval [`[$domain]`]. + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations10.pg new file mode 100644 index 0000000000..157f87312f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations10.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("FiniteSolutionSets"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $base = random(2,10,1); + $ex = random(0,6,1); + $c = $base**$ex; +} until ($c<=125); +$a = random(2,5,1)*random(-1,1,2); +$x1 = non_zero_random(-5,5,1); +$ax = $a*$x1; +$b = $c-$ax; + +$ans = Formula("{$x1}"); + + +$f1 = Compute("$a*$var+$b")->reduce; + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` \log_{[$base]}([$f1])=[$ex] ``] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \log_{[$base]}([$f1]) &= [$ex] \\ + [$base]^{[$ex]} &= [$f1] \\ + [$c] &= [$f1] \\ + [$ax] &= [$a][$var] \\ + [$x1] &= [$var] +\end{aligned} + ``] + +When we solve logarithm equations, make sure to substitute the solution into the original equation. If the solution causes a logarithm of a negative number, the solution is extraneous. + +For this problem, the solution [`[$var]=[$x1]`] is valid. + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations100.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations100.pg new file mode 100644 index 0000000000..660cc89a34 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations100.pg @@ -0,0 +1,129 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); + + +Context("Numeric"); +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $x1 = random(-10,10,1); + do {$x2 = random(-10,10,1);} until ($x1!=$x2); + $B = -$x1-$x2; + $C = $x1*$x2; + $a = random(-10,10,1); + $b = -$B-$a; + $ab = $a*$b; + $c = $ab-$C; +} until ( ($c>0) && (($x2-$b<=0) || ($x2-$a<=0)) ); + +Context("FiniteSolutionSets"); +Context()->variables->are($var => 'Real'); +$ans = Formula("{$x1}"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended +Context()->variables->are($var => 'Real'); + +$exp1 = Compute("$var-$a")->reduce; +$exp2 = Compute("$var-$b")->reduce; + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` \ln([$exp1]) + \ln([$exp2]) = \ln([$c]) ``] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + +$s1 = Compute("$var**2+$B*$var+$ab")->reduce; +$s2 = Compute("$var**2+$B*$var+$C")->reduce; +if ($x2==0) { + $s3 = Compute("($var-$x2)($var-$x1)")->reduce; + $s5 = Compute("$var-$x2")->reduce; + $s6 = Compute("$var-$x1")->reduce; + $show1 = "$x2"; + $show2 = "$x1"; +} else { + $s3 = Compute("($var-$x1)($var-$x2)")->reduce; + $s5 = Compute("$var-$x1")->reduce; + $s6 = Compute("$var-$x2")->reduce; + $show1 = "$x1"; + $show2 = "$x2"; +} +$s4 = Compute("($exp1)($exp2)")->reduce; + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \ln([$exp1]) + \ln([$exp2]) &= \ln([$c]) \\ + \ln([$s4]) &= \ln([$c]) \\ + [$s4] &= [$c] \\ + [$s1] &= [$c] \\ + [$s2] &= 0 \\ + [$s3] &= 0 \\ + [$s5] &= 0 \text{ or } [$s6]=0 \\ + [$var] &= [$show1] \text{ or } [$var]=[$show2] +\end{aligned} + ``] + +When we solve logarithm equations, make sure to substitute the solution into the original equation. If the solution causes a logarithm of a negative number, the solution is extraneous. + +For this problem, [`[$var]=[$x2]`] is an extraneous solution. The only solution is [`[$var]=[$x1]`]. + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations110.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations110.pg new file mode 100644 index 0000000000..ca735f859d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations110.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); + + +Context("Numeric"); +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $base = random(2,5,1); + $ex1 = random(0,6,1); + $value1 = $base**$ex1; + do {$ex2 = random(0,6,1);} until ($ex1!=$ex2); + $value2 = $base**$ex2; + $c = $ex1+$ex2; + $d = $base**$c; + $x1 = non_zero_random(-5,5,1); + $a = $value1-$x1; + $b = $value2-$x1; + $B = $a+$b; + $ab = $a*$b; + $C = $a*$b-$d; + $D = ($B)**2-4*$C; + $x3 = (-$B+sqrt($D))/2; + $x4 = (-$B-sqrt($D))/2; + $x2 = ($x3==$x1) ? $x4 : $x3; +} until ( ($value1<=125) && ($value2<=125) && ($d<=125) && (abs($a)<10) && (abs($b)<10) && (($x2+$b<=0) || ($x2+$a<=0)) ); + +Context("FiniteSolutionSets"); +Context()->variables->are($var => 'Real'); +$ans = Formula("{$x1}"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended +Context()->variables->are($var => 'Real'); + +$exp1 = Compute("$var+$a")->reduce; +$exp2 = Compute("$var+$b")->reduce; + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` \log_{[$base]}([$exp1]) + \log_{[$base]}([$exp2]) = [$c] ``] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + +$s1 = Compute("$var**2+$B*$var+$ab")->reduce; +$s2 = Compute("$var**2+$B*$var+$C")->reduce; +if ($x2==0) { + $s3 = Compute("($var-$x2)($var-$x1)")->reduce; + $s5 = Compute("$var-$x2")->reduce; + $s6 = Compute("$var-$x1")->reduce; + $show1 = "$x2"; + $show2 = "$x1"; +} else { + $s3 = Compute("($var-$x1)($var-$x2)")->reduce; + $s5 = Compute("$var-$x1")->reduce; + $s6 = Compute("$var-$x2")->reduce; + $show1 = "$x1"; + $show2 = "$x2"; +} +$s4 = Compute("($exp1)($exp2)")->reduce; + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \log_{[$base]}([$exp1]) + \log_{[$base]}([$exp2]) &= [$c] \\ + \log_{[$base]}\left([$s4]\right) &= [$c] \\ + [$s4] &= [$base]^{[$c]} \\ + [$s1] &= [$d] \\ + [$s2] &= 0 \\ + [$s3] &= 0 \\ + [$s5] &= 0 \text{ or } [$s6]=0 \\ + [$var] &= [$show1] \text{ or } [$var]=[$show2] +\end{aligned} + ``] + +When we solve logarithm equations, make sure to substitute the solution into the original equation. If the solution causes a logarithm of a negative number, the solution is extraneous. + +For this problem, [`[$var]=[$x2]`] is an extraneous solution. The only solution is [`[$var]=[$x1]`]. + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations120.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations120.pg new file mode 100644 index 0000000000..5b15aac4b4 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations120.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("FiniteSolutionSets"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $base = random(2,10,1); + $ex = random(2,6,2); + $value = $base**$ex; + $den = $value-1; + $x = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); + $eb = $value*$b; + $a = $x*$den+$eb; +} until ( ($value<=125) && ($x+$a>0) && ($x+$b>0) ); + +$ans = Formula("{$x}"); +$exp1 = Compute("$var+$a")->reduce; +$exp2 = Compute("$var+$b")->reduce; + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` \log_{[$base]}([$exp1]) - \log_{[$base]}([$exp2]) = [$ex] ``] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \log_{[$base]}([$exp1]) - \log_{[$base]}([$exp2]) = [$ex] \\ + \log_{[$base]}\left( \frac{[$exp1]}{[$exp2]} \right) = [$ex] \\ + \frac{[$exp1]}{[$exp2]} &= [$base]^{[$ex]} \\ + \frac{[$exp1]}{[$exp2]} &= [$value] \\ + [$exp1] &= [$value]([$exp2]) \\ + [$exp1] &= [$value][$var]+[$eb] \\ + [$a]-[$eb] &= [$value][$var]-[$var] \\ + [$a-$eb] &= [$den][$var] \\ + [$x] &= [$var] +\end{aligned} + ``] + +When we solve logarithm equations, make sure to substitute the solution into the original equation. If the solution causes a logarithm of a negative number, the solution is extraneous. + +For this problem, [`[$var]=[$x]`] is a solution. The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations130.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations130.pg new file mode 100644 index 0000000000..585435b2f1 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations130.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); + + +do { + $base = random(2,3,1); + $ex = random(2,3,2); + $value = $base**$ex; + $den = $value+1; + $a = non_zero_random(-10,10,1); + $va = $value*$a; + $num = $a-$va; +} until ( ($value<=125) && ($a-$num/$den>0) && ($a+$num/$den>0) ); + +Context("Fraction"); +$x = Fraction($num,$den)->reduce; +($numR,$denR) = $x->value; + +Context("FiniteSolutionSets"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$ans = $denR==1 ? Formula("{$numR}") : Formula("{$numR/$denR}"); +$exp1 = Compute("$a-$var")->reduce; +$exp2 = Compute("$a+$var")->reduce; + + + + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` \log_{[$base]}([$exp1]) = [$ex] + \log_{[$base]}([$exp2]) ``] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \log_{[$base]}([$exp1]) &= [$ex] + \log_{[$base]}([$exp2]) \\ + \log_{[$base]}([$exp1]) - \log_{[$base]}([$exp2]) &= [$ex] \\ + \log_{[$base]}\left( \frac{[$exp1]}{[$exp2]} \right) &= [$ex] \\ + \frac{[$exp1]}{[$exp2]} &= [$base]^{[$ex]} \\ + \frac{[$exp1]}{[$exp2]} &= [$value] \\ + [$exp1] &= [$value]([$exp2]) \\ + [$exp1] &= [$va]+[$value][$var] \\ + [$a]-[$va] &= [$value][$var]+[$var] \\ + [$num] &= [$den][$var] \\ + [$x] &= [$var] +\end{aligned} + ``] + +When we solve logarithm equations, make sure to substitute the solution into the original equation. If the solution causes a logarithm of a negative number, the solution is extraneous. + +For this problem, [`[$var]=[$x]`] is a solution. The solutions could be written in set notation: [`\{[$x]\}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations140.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations140.pg new file mode 100644 index 0000000000..ac268dca61 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations140.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $base = random(2,5,1); + do {$a = -random(2,9,1);} until (-$a != $base); + $f = random(2,5,1); + $b = $a*$f; +} until ( (ln($f)/ln($base))!=int(ln($f)/ln($base)) ); + +$bN = -$b; +$aN = -$a; + +@choices = (); +$choices[0] = "$var=\log_{$base}($f)"; +$choices[1] = "$var=\ln($f)"; +$choices[2] = "$var=\frac{1}{$aN}\log_{$base}($bN)"; +$choices[3] = "\text{no real solution}"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` [$a]\cdot [$base]^{[$var]} = [$b] ``] + +The correct solution is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a]\cdot [$base]^{[$var]} &= [$b] \\ + \frac{[$a]\cdot [$base]^{[$var]}}{[$a]} &= \frac{[$b]}{[$a]} \\ + [$base]^{[$var]} &= [$f] \\ + [$var] &= \log_{[$base]}([$f]) +\end{aligned} + ``] + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations141.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations141.pg new file mode 100644 index 0000000000..5fee6552d9 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations141.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserAssignment.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); +parser::Assignment->Allow; + +do { + $base = random(2,5,1); + do {$a = random(2,9,1);} until ($a != $base); + $f = random(2,5,1); + $b = $a*$f; + $x = ln($f)/ln($base); +} until ( ($x)!=int($x) ); + +$ans = Compute("$var=$x"); + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` [$a]\cdot [$base]^{[$var]} = [$b] ``] + +* Write your answer in the form of [`x=\ldots`] +* Round your answer to four significant digits, like [`x=1.234`] and [`x=0.01234`] + +The solution is [__________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a]\cdot [$base]^{[$var]} &= [$b] \\ + \frac{[$a]\cdot [$base]^{[$var]}}{[$a]} &= \frac{[$b]}{[$a]} \\ + [$base]^{[$var]} &= [$f] \\ + \ln\left( [$base]^{[$var]} \right) &= \ln([$f]) \\ + [$var]\cdot\ln([$base]) &= \ln([$f]) \\ + [$var] &= \frac{\ln([$f])}{\ln([$base])} \\ + [$var] &= [$x]\ldots +\end{aligned} + ``] + +The solution is [`[$ans]\ldots`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations150.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations150.pg new file mode 100644 index 0000000000..b30f34976a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations150.pg @@ -0,0 +1,135 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $base1 = list_random(2,3,5,7); + $base2 = list_random(2,3,5,7); +} until ($base2-$base1>1); +do {$a = random(2,9,1);} until ( ($a!=$base1) && ($a!=$base2) ); + +$d = $base2 - $base1; + +@choices = (); +$choices[0] = "$var = \log_{ \frac{$base2}{$base1} } ($a)"; +$choices[1] = "$var = \log_{ \frac{$base1}{$base2} } ($a)"; +$choices[2] = "$var = \log_{ $a } (\frac{$base2}{$base1})"; +$choices[3] = "$var = \log_{ $d } ($a)";; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` [$a]\cdot [$base1]^{[$var]} = [$base2]^{[$var]} ``] + +The correct solution is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a]\cdot [$base1]^{[$var]} &= [$base2]^{[$var]} \\ + \ln\left( [$a]\cdot [$base1]^{[$var]} \right) &= \ln\left( [$base2]^{[$var]} \right) \\ + \ln([$a]) + \ln\left([$base1]^{[$var]} \right) &= \ln\left( [$base2]^{[$var]} \right) \\ + \ln([$a]) + [$var]\ln([$base1]) &= [$var]\ln([$base2]) \\ + \ln([$a]) &= [$var]\ln([$base2]) - [$var]\ln([$base1]) \\ + \ln([$a]) &= [$var]\left( \ln([$base2]) - \ln([$base1]) \right) \\ + \frac{\ln([$a])}{\ln([$base2]) - \ln([$base1])} &= [$var] \\ + \frac{\ln([$a])}{\ln\left(\frac{[$base2]}{[$base1]}\right)} &= [$var] \\ + \log_{ \frac{[$base2]}{[$base1]} } ([$a]) &= [$var] +\end{aligned} + ``] + +The correct answer is [$pop->correct_ans()]. + +Note that, in the last step, we used the change base formula: + + [`` \frac{\log_{b}(M)}{\log_{b}(a)} = \log_{a}(M) ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations151.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations151.pg new file mode 100644 index 0000000000..469a839e89 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations151.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); +parser::Assignment->Allow; + +do { + $base1 = list_random(2,3,5,7); + $base2 = list_random(2,3,5,7); +} until ($base2!=$base1); +do {$a = random(2,9,1);} until ( ($a!=$base1) && ($a!=$base2) ); + +$x = ln($a)/ln($base2/$base1); +$ans = Compute("$var=$x"); + + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` [$a]\cdot [$base1]^{[$var]} = [$base2]^{[$var]} ``] + +* Write your answer in the form of [`x=\ldots`] +* Round your answer to four significant digits, like [`x=1.234`] and [`x=0.01234`] + +The solution is [__________________]{$ans} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a]\cdot [$base1]^{[$var]} &= [$base2]^{[$var]} \\ + \ln\left( [$a]\cdot [$base1]^{[$var]} \right) &= \ln\left( [$base2]^{[$var]} \right) \\ + \ln([$a]) + \ln\left([$base1]^{[$var]} \right) &= \ln\left( [$base2]^{[$var]} \right) \\ + \ln([$a]) + [$var]\ln([$base1]) &= [$var]\ln([$base2]) \\ + \ln([$a]) &= [$var]\ln([$base2]) - [$var]\ln([$base1]) \\ + \ln([$a]) &= [$var]\left( \ln([$base2]) - \ln([$base1]) \right) \\ + \frac{\ln([$a])}{\ln([$base2]) - \ln([$base1])} &= [$var] \\ + [$x]\ldots &= [$var] +\end{aligned} + ``] + +The solution is [`[$ans]\ldots`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations160.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations160.pg new file mode 100644 index 0000000000..94941fa4f7 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations160.pg @@ -0,0 +1,162 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $base1 = list_random(2,3,5,7); + $base2 = list_random(2,3,5,7); + $b = random(-4,-2,1); + $bN = -$b; + do {$a = random(2,9,1);} until ( ($a!=$base1) && ($a!=$base2) ); + $c = $base1**(-$b); +} until ( ($base2-$base1>1) && (abs($c)<100) && ($a!=$c) ); + +$f = Fraction($a,$c); +($num,$den) = $f->value; + +$d = $base2 - $base1; +$e = $a - $c; +if ($e>0) { + $choice2 = ( (ln($e)/ln($d))==int(ln($e)/ln($d)) ) ? ln($e)/ln($d) : "\log_{$d}($e)"; +} else { + $eN = -$e; + $choice2 = ( (ln($eN)/ln($d))==int(ln($eN)/ln($d)) ) ? -ln($eN)/ln($d) : "-\log_{$d}($eN)"; +} + +$g = Fraction($e,$d); +($numG, $denG) = $g->value; +if (abs($g)==1) { + $choice3 = 0; +} else { + $numGN = -$numG; + $choice3 = $g>0 ? "\ln\left(\frac{$numG}{denG}\right)" : "-\ln\left(\frac{$numGN}{$denG}\right)"; + if ($denG==1) { + $choice3 = $g>0 ? "\ln($numG)" : "-\ln($numGN)"; + } +} + +@choices = (); +$choices[0] = "$var = \log_{ \frac{$base2}{$base1} } \left( \frac{$num}{$den} \right)"; +$choices[1] = "$var = \log_{ \frac{$num}{$den} } \left( \frac{$base2}{$base1} \right)"; +$choices[2] = "$var=".$choice2; +$choices[3] = "$var=".$choice3; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` [$a]\cdot [$base1]^{[$var]+[$b]} = [$base2]^{[$var]} ``] + +The correct solution is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a]\cdot [$base1]^{[$var]+[$b]} &= [$base2]^{[$var]} \\ + \ln\left( [$a]\cdot [$base1]^{[$var]+[$b]} \right) &= \ln\left( [$base2]^{[$var]} \right) \\ + \ln([$a]) + \ln\left([$base1]^{[$var]+[$b]} \right) &= \ln\left( [$base2]^{[$var]} \right) \\ + \ln([$a]) + ([$var]+[$b])\ln([$base1]) &= [$var]\ln([$base2]) \\ + \ln([$a]) + [$var]\ln([$base1]) +[$b]\ln([$base1]) &= [$var]\ln([$base2]) \\ + \ln([$a]) +[$b]\ln([$base1]) &= [$var]\ln([$base2]) - [$var]\ln([$base1]) \\ + \ln([$a]) +[$b]\ln([$base1]) &= [$var]\left( \ln([$base2]) - \ln([$base1]) \right) \\ + \frac{\ln([$a])-\ln([$base1]^{[$bN]})}{\ln([$base2]) - \ln([$base1])} &= [$var] \\ + \frac{ \ln\left( \frac{[$a]}{[$base1]^{[$bN]}} \right) } {\ln\left(\frac{[$base2]}{[$base1]}\right)} &= [$var] \\ + \log_{ \frac{[$base2]}{[$base1]} } ([$f]) &= [$var] +\end{aligned} + ``] + +The correct answer is [$pop->correct_ans()]. + +Note that, in the last step, we used the change base formula: + + [`` \frac{\log_{b}(M)}{\log_{b}(a)} = \log_{a}(M) ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations161.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations161.pg new file mode 100644 index 0000000000..972dcf2f6a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations161.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); +parser::Assignment->Allow; + +do { + $base1 = list_random(2,3,5,7); + do {$base2 = list_random(2,3,5,7);} until ($base1!=$base2); + $b = random(-4,-2,1); + $bN = -$b; + do {$a = random(2,9,1);} until ( ($a!=$base1) && ($a!=$base2) ); + $c = $base1**(-$b); +} until (abs($c)<100); + +$x = ln($a*$base1**($b))/ln($base2/$base1); + +$ans = Compute("$var=$x"); + + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` [$a]\cdot [$base1]^{[$var]+[$b]} = [$base2]^{[$var]} ``] + +* Write your answer in the form of [`x=\ldots`] +* Round your answer to four significant digits, like [`x=1.234`] and [`x=0.01234`] + +The solution is [__________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a]\cdot [$base1]^{[$var]+[$b]} &= [$base2]^{[$var]} \\ + \ln\left( [$a]\cdot [$base1]^{[$var]+[$b]} \right) &= \ln\left( [$base2]^{[$var]} \right) \\ + \ln([$a]) + \ln\left([$base1]^{[$var]+[$b]} \right) &= \ln\left( [$base2]^{[$var]} \right) \\ + \ln([$a]) + ([$var]+[$b])\ln([$base1]) &= [$var]\ln([$base2]) \\ + \ln([$a]) + [$var]\ln([$base1]) +[$b]\ln([$base1]) &= [$var]\ln([$base2]) \\ + \ln([$a]) +[$b]\ln([$base1]) &= [$var]\ln([$base2]) - [$var]\ln([$base1]) \\ + \ln([$a]) +[$b]\ln([$base1]) &= [$var]\left( \ln([$base2]) - \ln([$base1]) \right) \\ + \frac{\ln([$a])+[$b]\ln([$base1])}{\ln([$base2]) - \ln([$base1])} &= [$var] \\ + [$x]\ldots &= [$var] +\end{aligned} + ``] + +The solution is [`[$ans]\ldots`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations170.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations170.pg new file mode 100644 index 0000000000..be79281bb1 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations170.pg @@ -0,0 +1,156 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $base1 = list_random(2,3,5,7); + do {$base2 = list_random(2,3,5,7);} until ($base1!=$base2); + $a = random(2,4,1); + do {$b = random(-4,-2,1);} until (abs($b)!=$a); + $bN = -$b; + $num1 = $base1**$a*$base2**($bN); + $result = ln($num1)/ln($base2/$base1); +} until ( ($base2-$base1>1) && ($num1<1000) && ($result!=int($result)) ); + +$s1 = $base1**$a; +$s2 = $base2**$bN; +$d = $base2 - $base1; +$e = $s1 + $s2; +$choice2 = ( (ln($e)/ln($d))==int(ln($e)/ln($d)) ) ? ln($e)/ln($d) : "\log_{$d}($e)"; + +$g = Fraction($num1*$base1,$base2); +($num2,$den2) = $g->value; +if (abs($g)==1) { + $choice3 = 0; +} else { + $num2N = -$num2; + $choice3 = $g>0 ? "\ln\left(\frac{$num2}{den2}\right)" : "-\ln\left(\frac{$num2N}{$den2}\right)"; + if ($den2==1) { + $choice3 = $g>0 ? "\ln($num2)" : "-\ln($num2N)"; + } +} + +@choices = (); +$choices[0] = "$var = \log_{ \frac{$base2}{$base1} }($num1)"; +$choices[1] = "$var = \log_{ $num1 }\left( \frac{$base2}{$base1}\right)"; +$choices[2] = "$var=".$choice2; +$choices[3] = "$var=".$choice3; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` [$base1]^{[$var]+[$a]} = [$base2]^{[$var]+[$b]} ``] + +The correct solution is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$base1]^{[$var]+[$a]} &= [$base2]^{[$var]+[$b]} \\ + \ln\left( [$base1]^{[$var]+[$a]} \right) &= \ln\left( [$base2]^{[$var]+[$b]} \right) \\ + ([$var]+[$a])\ln([$base1]) &= ([$var]+[$b])\ln([$base2]) \\ + [$var]\ln([$base1]) +[$a]\ln([$base1]) &= [$var]\ln([$base2]) +[$b]\ln([$base2]) \\ + [$a]\ln([$base1]) -[$b]\ln([$base2]) &= [$var]\ln([$base2]) - [$var]\ln([$base1]) \\ + \ln\left([$base1]^{[$a]}\right) +\ln\left([$base2]^{[$bN]}\right) &= [$var]\left( \ln([$base2]) - \ln([$base1]) \right) \\ + \frac{\ln([$s1]) + \ln([$s2])}{\ln([$base2]) - \ln([$base1])} &= [$var] \\ + \frac{\ln([$num1])}{\ln\left( \frac{[$base2]}{[$base1]} \right)} &= [$var] \\ + \log_{ \frac{[$base2]}{[$base1]} }([$num1]) &= [$var] \\ +\end{aligned} + ``] + +The correct answer is [$pop->correct_ans()]. + +Note that, in the last step, we used the change base formula: + + [`` \frac{\log_{b}(M)}{\log_{b}(a)} = \log_{a}(M) ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations171.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations171.pg new file mode 100644 index 0000000000..3d73398fad --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations171.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserAssignment.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); +parser::Assignment->Allow; + +do { + $base1 = list_random(2,3,5,7); + do {$base2 = list_random(2,3,5,7);} until ($base1!=$base2); + $a = random(2,4,1); + do {$b = random(-4,-2,1);} until (abs($b)!=$a); + $bN = -$b; + $num1 = $base1**$a*$base2**($bN); + $x = ln($num1)/ln($base2/$base1); +} until ( ($num1<1000) && ($x!=int($x)) ); + +$ans = Compute("$var=$x"); + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` [$base1]^{[$var]+[$a]} = [$base2]^{[$var]+[$b]} ``] + +* Write your answer in the form of [`x=\ldots`] +* Round your answer to four significant digits, like [`x=1.234`] and [`x=0.01234`] + +The solution is [__________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$base1]^{[$var]+[$a]} &= [$base2]^{[$var]+[$b]} \\ + \ln\left( [$base1]^{[$var]+[$a]} \right) &= \ln\left( [$base2]^{[$var]+[$b]} \right) \\ + ([$var]+[$a])\ln([$base1]) &= ([$var]+[$b])\ln([$base2]) \\ + [$var]\ln([$base1]) +[$a]\ln([$base1]) &= [$var]\ln([$base2]) +[$b]\ln([$base2]) \\ + [$a]\ln([$base1]) -[$b]\ln([$base2]) &= [$var]\ln([$base2]) - [$var]\ln([$base1]) \\ + [$a]\ln([$base1]) -[$b]\ln([$base2]) &= [$var]\left( \ln([$base2]) - \ln([$base1]) \right) \\ + \frac{[$a]\ln([$base1]) -[$b]\ln([$base2])}{\ln([$base2]) - \ln([$base1])} &= [$var] \\ + [$x]\ldots &= [$var] \\ +\end{aligned} + ``] + +The solution is [`[$ans]\ldots`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations20.pg new file mode 100644 index 0000000000..911a7c3e22 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations20.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("FiniteSolutionSets"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$aMinusB = random(0,3,1); +$a = non_zero_random(-10,10,1); +$b = $a-$aMinusB; +$c = 10**$aMinusB; +$x = non_zero_random(-5,5,1); +$d = $c-$x; + +$ans = Formula("{$x}"); +$f1 = Compute("$var+$d")->reduce; + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` [$a] - \log([$f1])= [$b] ``] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] - \log([$f1]) &= [$b] \\ + - \log([$f1]) &= [$b-$a] \\ + \log([$f1]) &= [$aMinusB] \\ + [$f1] &= 10^{[$aMinusB]} \\ + [$f1] &= [$c] \\ + [$var] &= [$x] +\end{aligned} + ``] + +When we solve logarithm equations, make sure to substitute the solution into the original equation. If the solution causes a logarithm of a negative number, the solution is extraneous. + +For this problem, the solution [`[$var]=[$x]`] is valid. + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations30.pg new file mode 100644 index 0000000000..43cbe6621b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations30.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("FiniteSolutionSets"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $base = random(2,10,1); + $ex = random(0,6,1); + $d = $base**$ex; + $g = list_random(2,3,5); +} until ( ($d<=125) && ($d%$g==0) ); +$g = -$g; +$x = $d/$g; +$a = random(2,5,1)*random(-1,1,2); +$h = $a*$ex; +$b = non_zero_random(-10,10,1); +$c = $h+$b; + +$ans = Formula("{$x}"); +$f1 = Compute("$g*$var")->reduce; + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` [$a] \log_{[$base]}([$f1]) + [$b] = [$c] ``] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a] \log_{[$base]}([$f1]) + [$b] &= [$c] \\ + [$a] \log_{[$base]}([$f1]) &= [$h] \\ + \log_{[$base]}([$f1]) &= [$ex] \\ + [$base]^{[$ex]} &= [$f1] \\ + [$d] &= [$f1] \\ + [$x] &= [$var] +\end{aligned} + ``] + +When we solve logarithm equations, make sure to substitute the solution into the original equation. If the solution causes a logarithm of a negative number, the solution is extraneous. + +For this problem, the solution [`[$var]=[$x]`] is valid. + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations40.pg new file mode 100644 index 0000000000..e17438167a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations40.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("FiniteSolutionSets"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $base = random(2,10,1); + $ex = random(0,6,1); + $value = $base**$ex; +} until ($value<=125); + + +$a = random(2,5,1)*random(-1,1,2); +$x = non_zero_random(-5,5,1); +$ax = $a*$x; +$b = $ex-$ax; + +$ans = Formula("{$x}"); +$f1 = Compute("$a*$var+$b")->reduce; + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` \log_{[$base]}([$value]) = [$f1] ``] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \log_{[$base]}([$value]) &= [$f1] \\ + [$ex] &= [$f1] \\ + [$ax] &= [$a][$var] \\ + [$x] &= [$var] +\end{aligned} + ``] + +Since the variable [`[$var]`] is not part of the logarithm expression [`\log_{[$base]}([$value])`], there is no need to check the solution. + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations50.pg new file mode 100644 index 0000000000..0deed4ab3f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations50.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Last updated: Yao 7/3/2018 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','logarithm','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$a = random(2,10,1); +$x = ln($a); +$ans = Formula("$var=$x"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation + + [`` e^{[$var]}=[$a] ``] + + [__________________________________] + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp( + list_checker => ~~&radicalListCheck, + correct_ans=>"$var=ln($a)", + correct_ans_latex_string=>"$var=\ln($a)" +)); + + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + e^{[$var]} &= [$a] \\ + [$var] &= \ln([$a]) +\end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations60.pg new file mode 100644 index 0000000000..6fda280046 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations60.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Last updated: Yao 7/3/2018 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','logarithm','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$d = random(2,5,1); +$b = random(2,5,1)*random(-1,1,2); +$bN = -$b; +$cMinusA = -$b*random(2,10,1); +$a = non_zero_random(-5,5,1); +$c = $cMinusA+$a; +$value = -$cMinusA/$b; +$x = ln($value)/$d; +$ans = Formula("$var=$x"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation + + [`` [$a]-[$b]e^{[$d][$var]}=[$c] ``] + + [__________________________________] + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp( + list_checker => ~~&radicalListCheck, + correct_ans=>"$var=ln($value)/$d", + correct_ans_latex_string=>"$var=\frac{\ln($value)}{$d}" +)); + + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a]-[$b]e^{[$d][$var]} &= [$c] \\ + -[$b]e^{[$d][$var]} &= [$cMinusA] \\ + e^{[$d][$var]} &= [$value] \\ + \ln([$value]) &= [$d][$var] \\ + \frac{\ln([$value])}{[$d]} &= [$var] +\end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations70.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations70.pg new file mode 100644 index 0000000000..fb42185163 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations70.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Last updated: Yao 7/3/2018 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','logarithm','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +parser::Assignment->Allow; + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); + Context()->operators->redefine('or',using=>',',from=>'Numeric'); + Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); + Context()->lists->set(List => {separator => " or "}); + +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$a = random(2,5,1)*random(-1,1,2); +$cMinusB = $a*random(2,9,1); +$b = non_zero_random(-5,5,1); +$c = $b+$cMinusB; +$d = random(1,5,1); + +$value = $cMinusB/$a; +$x = log($value)-$d; +$ans = Formula("$var=$x"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation + + [`` [$a]\cdot 10^{[$var]+[$d]}+[$b]=[$c] ``] + + [__________________________________] + +END_PGML + +############################################## + + +$showPartialCorrectAnswers = 1; +ANS($ans->cmp( + list_checker => ~~&radicalListCheck, + correct_ans=>"$var=log($value)-$d", + correct_ans_latex_string=>"$var=\log($value)-$d" +)); + + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$a]\cdot 10^{[$var]+[$d]}+[$b] &= [$c] \\ + [$a]\cdot 10^{[$var]+[$d]} &= [$cMinusB] \\ + 10^{[$var]+[$d]} &= [$value] \\ + \log([$value]) &= [$var]+[$d] \\ + \log([$value])-[$d] &= [$var] +\end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations80.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations80.pg new file mode 100644 index 0000000000..a38a8b601e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations80.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Last updated: Yao 7/3/2018 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('solve','logarithm','equation') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PCCmacros.pl", + "answerHints.pl", + "contextLimitedRadical.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedRadical"); +#Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); + +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} + ); +Context()->lists->set(List => {separator => " or "}); + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$mymsg = "Are you sure your solution satisfies the equation?"; +Context()->{error}{msg}{"Unexpected character '='"} + = "$mymsg"; + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $c = random(2,5,1); + $bMinusA = random(-5,-1,1); + $b = non_zero_random(-5,5,1); + $a = $b-$bMinusA; +} until ($a!=0); + +$ans = Compute("no real solutions"); + +$mymsg = "Incorrect"; +Context()->{error}{msg}{"Unexpected character '='"} + = "$mymsg"; + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation + + [`` 10^{[$c][$var]}+[$a]=[$b] ``] + +* If there is no solution, type *no real solutions*. + + [__________________________________] + +END_PGML + +############################################## + + +ANS($ans->cmp(checker=>sub { + my ($correct,$student,$ansHash) = @_; + if(!Value::String->typeMatch($student)) + { + Value->Error("$mymsg"); + return 0; + } + $check = ($student->value eq "no real solutions"); + Value->Error("$mymsg") unless($check); + return $check; + }, +)); + + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + 10^{[$c][$var]}+[$a] &= [$b] \\ + 10^{[$c][$var]} &= [$bMinusA] +\end{aligned} + ``] + +Since [` 10^{[$c][$var]} `] cannot have a negative value, this equation has no solution. + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations90.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations90.pg new file mode 100644 index 0000000000..aa30fa0ce4 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmEquations90.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl", +); + + +############################################## + +TEXT(beginproblem()); +Context("FiniteSolutionSets"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $base = random(2,10,1); + $ex = random(2,6,2); + $value = $base**$ex; + $base1 = random(2,9,1); +} until ( ($value<=125) && (ln($value)/ln($base1)!=int(ln($value)/ln($base1))) ); + +$ans = Formula("{$base}"); + +############################################## + +BEGIN_PGML + +Solve the equation + + [`` \log_{[$base1]}([$value]) = [$ex]\log_{[$base1]}([$var]) ``] + +* Enter multiple answers in set notation, such as [`\{1,-1\}`], or separated by commas, such as [` x=1, x=-1 `]. +* If there are no real solutions, enter *no real solutions* + + [__________________________________]{$ans} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +############################################## + +$s1 = ($ex==2) ? "\sqrt{$value}" : "\sqrt[$ex]{$value}"; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \log_{[$base1]}([$value]) &= [$ex]\log_{[$base1]}([$var]) \\ + \log_{[$base1]}([$value]) &= \log_{[$base1]}\left([$var]^{[$ex]}\right) \\ + [$value] &= [$var]^{[$ex]} \\ + \pm[$s1] &= [$var] \\ + \pm[$base] &= [$var] +\end{aligned} + ``] + +When we solve logarithm equations, make sure to substitute the solution into the original equation. If the solution causes a logarithm of a negative number, the solution is extraneous. + +For this problem, [`[$var]=-[$base]`] is an extraneous solution. The only solution is [`[$var]=[$base]`]. + +The solutions could be written in set notation: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation10.pg new file mode 100644 index 0000000000..18c4504cfb --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation10.pg @@ -0,0 +1,253 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$a = random(2,5,1); +$vshift = non_zero_random(-2,2,1); +$vshiftN = -$vshift; +$hshift = non_zero_random(-2,2,1); +$hshiftN = -$hshift; + +$fp = Formula("ln(x)/ln($a)")->reduce; +$f[0] = Formula("ln(x+$hshift)/ln($a)+$vshift")->reduce; +$f[1] = Formula("ln(x+$hshift)/ln($a)-$vshift")->reduce; +$f[2] = Formula("ln(x-$hshift)/ln($a)+$vshift")->reduce; +$f[3] = Formula("ln(x-$hshift)/ln($a)-$vshift")->reduce; +$f[4] = $fp; + +@fx = ( ); +@fy = ( ); +$fx[0][0] = 1-$hshift; +$fx[0][1] = $a-$hshift; +$fx[1][0] = 1-$hshift; +$fx[1][1] = $a-$hshift; +$fx[2][0] = 1+$hshift; +$fx[2][1] = $a+$hshift; +$fx[3][0] = 1+$hshift; +$fx[3][1] = $a+$hshift; + +$fx[0][2] = 1; +$fx[0][3] = $a; +$fy[0][2] = $fp->eval(x=>$fx[0][2]); +$fy[0][3] = $fp->eval(x=>$fx[0][3]); + +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fy[$i][$j] = $f[$i]->eval(x=>$fx[$i][$j]); + } +} + +@alt = (); +$alt[0] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshiftN from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[1] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshiftN from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[1][0],$fy[1][0]) and ($fx[1][1],$fy[1][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[2] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshift from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[2][0],$fy[2][0]) and ($fx[2][1],$fy[2][1]). There is a vertical asymptote at x=$hshift."; +$alt[3] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshift from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[3][0],$fy[3][0]) and ($fx[3][1],$fy[3][1]). There is a vertical asymptote at x=$hshift."; +$alt[4] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=0 from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][2],$fy[0][2]) and ($fx[0][3],$fy[0][3]). There is a vertical asymptote at x=0."; + + +$bound = 8; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<=4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + if ( ($i==0) || ($i==1) ) { + $graphs[$i]->moveTo($hshiftN,-$bound); + $graphs[$i]->lineTo($hshiftN,$bound,'red',2,'dashed'); + $break = $hshiftN+0.01; + } elsif ( ($i==2) || ($i==3) ) { + $graphs[$i]->moveTo($hshift,-$bound); + $graphs[$i]->lineTo($hshift,$bound,'red',2,'dashed'); + $break = $hshift+0.01; + } else { + $graphs[$i]->moveTo(0,-$bound); + $graphs[$i]->lineTo(0,$bound,'red',2,'dashed'); + $break = 0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <$break,$bound> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=\log_[$a](x+[$hshift])+[$vshift]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$uod = ($vshift>0) ? "up" : "down"; +$lor = ($hshift>0) ? "left" : "right"; +$vshiftA = abs($vshift); +$hshiftA = abs($hshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=\log_[$a](x)`]. This function passes the points [`([$fx[0][2]],[$fy[0][2]])`] and [`([$fx[0][3]],[$fy[0][3]])`]. The function has a vertical asymptote at [`x=0`]. + +>>[@image(insertGraph( $graphs[4] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'")@]*<< + +To transform from [`y=\log_[$a](x)`] to [`f(x)=\log_[$a](x+[$hshift])+[$vshift]`], there is a vertical shift [$uod] by [`[$vshiftA]`] units, and there is a horizontal shift to the [$lor] by [`[$hshiftA]`] units. + +This implies the point [`([$fx[0][2]],[$fy[0][2]])`] on [`y=\log_[$a](x)`] is transformed to [`([$fx[0][0]],[$fy[0][0]])`] on [`f(x)=\log_[$a](x+[$hshift])+[$vshift]`]. + +The point [`([$fx[0][3]],[$fy[0][3]])`] on [`y=\log_[$a](x)`]is transformed to [`([$fx[0][1]],[$fy[0][1]])`] on [`f(x)=\log_[$a](x+[$hshift])+[$vshift]`]. + +The horizontal asymptote is transformed to [`x=[$hshiftN]`]. + +The correct graph for [`f(x)=\log_[$a](x+[$hshift])+[$vshift]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation20.pg new file mode 100644 index 0000000000..e36791913b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation20.pg @@ -0,0 +1,253 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$a = random(0.2,0.9,0.1); +$vshift = non_zero_random(-2,2,1); +$vshiftN = -$vshift; +$hshift = non_zero_random(-2,2,1); +$hshiftN = -$hshift; + +$fp = Formula("ln(x)/ln($a)")->reduce; +$f[0] = Formula("ln(x+$hshift)/ln($a)+$vshift")->reduce; +$f[1] = Formula("ln(x+$hshift)/ln($a)-$vshift")->reduce; +$f[2] = Formula("ln(x-$hshift)/ln($a)+$vshift")->reduce; +$f[3] = Formula("ln(x-$hshift)/ln($a)-$vshift")->reduce; +$f[4] = $fp; + +@fx = ( ); +@fy = ( ); +$fx[0][0] = 1-$hshift; +$fx[0][1] = $a-$hshift; +$fx[1][0] = 1-$hshift; +$fx[1][1] = $a-$hshift; +$fx[2][0] = 1+$hshift; +$fx[2][1] = $a+$hshift; +$fx[3][0] = 1+$hshift; +$fx[3][1] = $a+$hshift; + +$fx[0][2] = 1; +$fx[0][3] = $a; +$fy[0][2] = $fp->eval(x=>$fx[0][2]); +$fy[0][3] = $fp->eval(x=>$fx[0][3]); + +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fy[$i][$j] = $f[$i]->eval(x=>$fx[$i][$j]); + } +} + +@alt = (); +$alt[0] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches x=$hshiftN from the right, and approaches negative infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[1] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches x=$hshiftN from the right, and approaches negative infinity when x-value approaches positive infinity. The graph passes the points ($fx[1][0],$fy[1][0]) and ($fx[1][1],$fy[1][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[2] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches x=$hshift from the right, and approaches negative infinity when x-value approaches positive infinity. The graph passes the points ($fx[2][0],$fy[2][0]) and ($fx[2][1],$fy[2][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[3] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches x=$hshift from the right, and approaches negative infinity when x-value approaches positive infinity. The graph passes the points ($fx[3][0],$fy[3][0]) and ($fx[3][1],$fy[3][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[4] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches x=0 from the right, and approaches negative infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][2],$fy[0][2]) and ($fx[0][3],$fy[0][3]). There is a vertical asymptote at x=$hshiftN."; + + +$bound = 8; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<=4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + if ( ($i==0) || ($i==1) ) { + $graphs[$i]->moveTo($hshiftN,-$bound); + $graphs[$i]->lineTo($hshiftN,$bound,'red',2,'dashed'); + $break = $hshiftN+0.01; + } elsif ( ($i==2) || ($i==3) ) { + $graphs[$i]->moveTo($hshift,-$bound); + $graphs[$i]->lineTo($hshift,$bound,'red',2,'dashed'); + $break = $hshift+0.01; + } else { + $graphs[$i]->moveTo(0,-$bound); + $graphs[$i]->lineTo(0,$bound,'red',2,'dashed'); + $break = 0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <$break,$bound> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=\log_{[$a]}(x+[$hshift])+[$vshift]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$uod = ($vshift>0) ? "up" : "down"; +$lor = ($hshift>0) ? "left" : "right"; +$vshiftA = abs($vshift); +$hshiftA = abs($hshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=\log_{[$a]}(x)`]. This function passes the points [`([$fx[0][2]],[$fy[0][2]])`] and [`([$fx[0][3]],[$fy[0][3]])`]. The function has a vertical asymptote at [`x=0`]. + +>>[@image(insertGraph( $graphs[4] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'")@]*<< + +To transform from [`y=\log_{[$a]}(x)`] to [`f(x)=\log_{[$a]}(x+[$hshift])+[$vshift]`], there is a vertical shift [$uod] by [`[$vshiftA]`] units, and there is a horizontal shift to the [$lor] by [`[$hshiftA]`] units. + +This implies the point [`([$fx[0][2]],[$fy[0][2]])`] on [`y=\log_{[$a]}(x)`] is transformed to [`([$fx[0][0]],[$fy[0][0]])`] on [`f(x)=\log_{[$a]}(x+[$hshift])+[$vshift]`]. + +The point [`([$fx[0][3]],[$fy[0][3]])`] on [`y=\log_{[$a]}(x)`]is transformed to [`([$fx[0][1]],[$fy[0][1]])`] on [`f(x)=\log_{[$a]}(x+[$hshift])+[$vshift]`]. + +The horizontal asymptote is transformed to [`x=[$hshiftN]`]. + +The correct graph for [`f(x)=\log_{[$a]}(x+[$hshift])+[$vshift]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation30.pg new file mode 100644 index 0000000000..e800fe8914 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation30.pg @@ -0,0 +1,263 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +do { + $a = random(2,5,1); + $b = list_random(2,4,5); +} until ($a!=$b); +$hshift = non_zero_random(-2,2,1); +$hshiftN = -$hshift; +$c = $b*$hshift; +$cN = -$c; + +$fp = Formula("ln(x)/ln($a)")->reduce; +$f[0] = Formula("ln($b*(x+$hshift))/ln($a)")->reduce; +$f[1] = Formula("ln($b*(x-$hshift))/ln($a)")->reduce; +$f[2] = Formula("ln($b*(x+$c))/ln($a)")->reduce; +$f[3] = Formula("ln($b*(x-$c))/ln($a)")->reduce; +$f[4] = $fp; + +@fx = ( ); +@fy = ( ); +$fx[0][0] = 1/$b-$hshift; +$fx[0][1] = $a/$b-$hshift; +$fx[1][0] = 1/$b+$hshift; +$fx[1][1] = $a/$b+$hshift; +$fx[2][0] = 1/$b-$c; +$fx[2][1] = $a/$b-$c; +$fx[3][0] = 1/$b+$c; +$fx[3][1] = $a/$b+$c; + +$fx[0][2] = 1; +$fx[0][3] = $a; +$fy[0][2] = $fp->eval(x=>$fx[0][2]); +$fy[0][3] = $fp->eval(x=>$fx[0][3]); + +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fy[$i][$j] = $f[$i]->eval(x=>$fx[$i][$j]); + } +} + +@alt = (); +$alt[0] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshiftN from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[1] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshift from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[1][0],$fy[1][0]) and ($fx[1][1],$fy[1][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[2] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$cN from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[2][0],$fy[2][0]) and ($fx[2][1],$fy[2][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[3] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$c from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[3][0],$fy[3][0]) and ($fx[3][1],$fy[3][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[4] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=0 from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][2],$fy[0][2]) and ($fx[0][3],$fy[0][3]). There is a vertical asymptote at x=$hshiftN."; + + +$bound = 8; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<=4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + if ($i==0) { + $va = $hshiftN; + $break = $hshiftN+0.01; + } elsif ( $i==1 ) { + $va = $hshift; + $break = $hshift+0.01; + } elsif ($i==2) { + $va = $cN; + $break = $cN+0.01; + } elsif ($i==3) { + $va = $c; + $break = $c+0.01; + } else { + $va = 0; + $break = 0.01; + } + $graphs[$i]->moveTo($va,-$bound); + $graphs[$i]->lineTo($va,$bound,'red',2,'dashed'); + add_functions($graphs[$i], "$f[$i] for x in <$break,$bound> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=\log_[$a]([$b]x+[$c])`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$lor = ($hshift>0) ? "left" : "right"; +$hshiftA = abs($hshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=\log_[$a](x)`]. This function passes the points [`([$fx[0][2]],[$fy[0][2]])`] and [`([$fx[0][3]],[$fy[0][3]])`]. The function has a vertical asymptote at [`x=0`]. + +>>[@image(insertGraph( $graphs[4] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'")@]*<< + +Since there is a constant in front of [`x`] in [`f(x)=\log_[$a]([$b]x+[$c])`], we need to do factoring first: + + [`` f(x)=\log_[$a]([$b]x+[$c])=\log_[$a]([$b](x+[$hshift])) ``] + +To transform from [`y=\log_[$a](x)`] to [`f(x)=\log_[$a]([$b](x+[$hshift]))`], there is a horizontal compression by a factor of [`[$b]`], and there is a horizontal shift to the [$lor] by [`[$hshiftA]`] units. By order of transformations, we need to do the compression first, and then the shift. + +This implies the point [`([$fx[0][2]],[$fy[0][2]])`] on [`y=\log_[$a](x)`] is transformed to [`([$fx[0][0]],[$fy[0][0]])`] on [`f(x)=\log_[$a]([$b](x+[$hshift]))`]. + +The point [`([$fx[0][3]],[$fy[0][3]])`] on [`y=\log_[$a](x)`]is transformed to [`([$fx[0][1]],[$fy[0][1]])`] on [`f(x)=\log_[$a]([$b](x+[$hshift]))`]. + +The horizontal asymptote is transformed to [`x=[$hshiftN]`]. + +The correct graph for [`f(x)=\log_[$a]([$b]x+[$c])`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation40.pg new file mode 100644 index 0000000000..009e4f56a0 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation40.pg @@ -0,0 +1,269 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +do { + $a = random(2,5,1); + $b = -1; +} until ($a!=$b); +$hshift = non_zero_random(-2,2,1); +$hshiftN = -$hshift; + +$fp = Formula("ln(x)/ln($a)")->reduce; +$f[0] = Formula("ln($b*(x+$hshift))/ln($a)")->reduce; +$f[1] = Formula("ln($b*(x-$hshift))/ln($a)")->reduce; +$f[2] = Formula("-ln(x+$hshift)/ln($a)")->reduce; +$f[3] = Formula("-ln(x-$hshift)/ln($a)")->reduce; +$f[4] = $fp; + +@fx = ( ); +@fy = ( ); +$fx[0][0] = 1/$b-$hshift; +$fx[0][1] = $a/$b-$hshift; +$fx[1][0] = 1/$b+$hshift; +$fx[1][1] = $a/$b+$hshift; +$fx[2][0] = -$hshift+1; +$fx[2][1] = -$hshift+$a; +$fx[3][0] = $hshift+1; +$fx[3][1] = $hshift+$a; + +$fx[0][2] = 1; +$fx[0][3] = $a; +$fy[0][2] = $fp->eval(x=>$fx[0][2]); +$fy[0][3] = $fp->eval(x=>$fx[0][3]); + +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fy[$i][$j] = $f[$i]->eval(x=>$fx[$i][$j]); + } +} + +@alt = (); +$alt[0] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshiftN from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[1] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshift from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[1][0],$fy[1][0]) and ($fx[1][1],$fy[1][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[2] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches x=$hshiftN from the right, and approaches negative infinity when x-value approaches positive infinity. The graph passes the points ($fx[2][0],$fy[2][0]) and ($fx[2][1],$fy[2][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[3] = "This is a graph of a smooth curve. The function approaches positive infinity when x-value approaches x=$hshift from the right, and approaches negative infinity when x-value approaches positive infinity. The graph passes the points ($fx[3][0],$fy[3][0]) and ($fx[3][1],$fy[3][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[4] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=0 from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][2],$fy[0][2]) and ($fx[0][3],$fy[0][3]). There is a vertical asymptote at x=$hshiftN."; + + +$bound = 8; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<=4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + if ($i==0) { + $va = $hshiftN; + $break = $hshiftN-0.01; + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$break> " . + "using color:blue and weight:2"); + } elsif ( $i==1 ) { + $va = $hshift; + $break = $hshift-0.01; + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$break> " . + "using color:blue and weight:2"); + } elsif ($i==2) { + $va = $hshiftN; + $break = $hShiftN+0.01; + add_functions($graphs[$i], "$f[$i] for x in <$break,$bound> " . + "using color:blue and weight:2"); + } elsif ($i==3) { + $va = $hshift; + $break = $hshift+0.01; + add_functions($graphs[$i], "$f[$i] for x in <$break,$bound> " . + "using color:blue and weight:2"); + } else { + $va = 0; + $break = 0.01; + add_functions($graphs[$i], "$f[$i] for x in <$break,$bound> " . + "using color:blue and weight:2"); + } + $graphs[$i]->moveTo($va,-$bound); + $graphs[$i]->lineTo($va,$bound,'red',2,'dashed'); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=\log_[$a](-x+[$hshiftN])`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$lor = ($hshift>0) ? "left" : "right"; +$hshiftA = abs($hshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=\log_[$a](x)`]. This function passes the points [`([$fx[0][2]],[$fy[0][2]])`] and [`([$fx[0][3]],[$fy[0][3]])`]. The function has a vertical asymptote at [`x=0`]. + +>>[@image(insertGraph( $graphs[4] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'")@]*<< + +Since there is a constant, [`-1`], in front of [`x`] in [`f(x)=\log_[$a](-x+[$hshiftN])`], we need to do factoring first: + + [`` f(x)=\log_[$a](-x+[$hshiftN])=\log_[$a](-(x+[$hshift])) ``] + +To transform from [`y=\log_[$a](x)`] to [`f(x)=\log_[$a](-(x+[$hshift]))`], there is a horizontal reflection by the [`y`]-axis, and there is a horizontal shift to the [$lor] by [`[$hshiftA]`] units. By order of transformations, we need to do the reflection first, and then the shift. + +This implies the point [`([$fx[0][2]],[$fy[0][2]])`] on [`y=\log_[$a](x)`] is transformed to [`([$fx[0][0]],[$fy[0][0]])`] on [`f(x)=\log_[$a](-(x+[$hshift]))`]. + +The point [`([$fx[0][3]],[$fy[0][3]])`] on [`y=log_[$a](x)`]is transformed to [`([$fx[0][1]],[$fy[0][1]])`] on [`f(x)=log_[$a](-(x+[$hshift]))`]. + +The horizontal asymptote is transformed to [`x=[$hshiftN]`]. + +The correct graph for [`f(x)=\log_[$a](-x+[$hshiftN])`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation50.pg new file mode 100644 index 0000000000..bc04f1f434 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmFunctionTransformation50.pg @@ -0,0 +1,255 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$a = Real(e); +$b = list_random(0.5,0.6,0.7,1.5,2,2.5,3,3.5,4); +$vshift = non_zero_random(-2,2,1); +$vshiftN = -$vshift; +$hshift = non_zero_random(-2,2,1); +$hshiftN = -$hshift; + +$fp = Formula("ln(x)")->reduce; +$f[0] = Formula("$b*ln(x+$hshift)+$vshift")->reduce; +$f[1] = Formula("$b*ln(x-$hshift)+$vshift")->reduce; +$f[2] = Formula("1/$b*ln(x+$hshift)+$vshift")->reduce; +$f[3] = Formula("1/$b*ln(x-$hshift)+$vshift")->reduce; +$f[4] = $fp; + +@fx = ( ); +@fy = ( ); +$fx[0][0] = 1-$hshift; +$fx[0][1] = $a-$hshift; +$fx[1][0] = 1+$hshift; +$fx[1][1] = $a+$hshift; +$fx[2][0] = 1-$hshift; +$fx[2][1] = $a-$hshift; +$fx[3][0] = 1+$hshift; +$fx[3][1] = $a+$hshift; + +$fx[0][2] = 1; +$fx[0][3] = $a; +$fy[0][2] = $fp->eval(x=>$fx[0][2]); +$fy[0][3] = $fp->eval(x=>$fx[0][3]); + +for (my $i=0; $i<=3; $i++) { + for (my $j=0; $j<=1; $j++) { + $fy[$i][$j] = $f[$i]->eval(x=>$fx[$i][$j]); + } +} + +@alt = (); +$alt[0] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshiftN from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][0],$fy[0][0]) and ($fx[0][1],$fy[0][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[1] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshift from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[1][0],$fy[1][0]) and ($fx[1][1],$fy[1][1]). There is a vertical asymptote at x=$hshift."; +$alt[2] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshiftN from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[2][0],$fy[2][0]) and ($fx[2][1],$fy[2][1]). There is a vertical asymptote at x=$hshiftN."; +$alt[3] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=$hshift from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[3][0],$fy[3][0]) and ($fx[3][1],$fy[3][1]). There is a vertical asymptote at x=$hshift."; +$alt[4] = "This is a graph of a smooth curve. The function approaches negative infinity when x-value approaches x=0 from the right, and approaches positive infinity when x-value approaches positive infinity. The graph passes the points ($fx[0][2],$fy[0][2]) and (e,1). There is a vertical asymptote at x=0."; + + +$bound = 8; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<=4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + if ( ($i==0) || ($i==2) ) { + $graphs[$i]->moveTo($hshiftN,-$bound); + $graphs[$i]->lineTo($hshiftN,$bound,'red',2,'dashed'); + $break = $hshiftN+0.01; + } elsif ( ($i==1) || ($i==3) ) { + $graphs[$i]->moveTo($hshift,-$bound); + $graphs[$i]->lineTo($hshift,$bound,'red',2,'dashed'); + $break = $hshift+0.01; + } else { + $graphs[$i]->moveTo(0,-$bound); + $graphs[$i]->lineTo(0,$bound,'red',2,'dashed'); + $break = 0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <$break,$bound> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$b]\ln(x+[$hshift])+[$vshift]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$uod = ($vshift>0) ? "up" : "down"; +$lor = ($hshift>0) ? "left" : "right"; +$vshiftA = abs($vshift); +$hshiftA = abs($hshift); +$soc = ($b>1) ? "stretch" : "compression"; + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=\ln(x)`]. This function passes the points [`([$fx[0][2]],[$fy[0][2]])`] and [`(e,1)`]. The function has a vertical asymptote at [`x=0`]. Recall that [`e=2.718\ldots`] + +>>[@image(insertGraph( $graphs[4] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'")@]*<< + +To transform from [`y=\ln(x)`] to [`f(x)=[$b]\ln(x+[$hshift])+[$vshift]`], there is a vertical [$soc] by the factor of [`[$b]`], a vertical shift [$uod] by [`[$vshiftA]`] units, and a horizontal shift to the [$lor] by [`[$hshiftA]`] units. + +This implies the point [`([$fx[0][2]],[$fy[0][2]])`] on [`y=\ln(x)`] is transformed to [`([$fx[0][0]],[$fy[0][0]])`] on [`f(x)=[$b]\ln(x+[$hshift])+[$vshift]`]. + +The point [`([$fx[0][3]],[$fy[0][3]])`] on [`y=\ln(x)`]is transformed to [`([$fx[0][1]],[$fy[0][1]])`] on [`f(x)=[$b]\ln(x+[$hshift])+[$vshift]`]. + +The horizontal asymptote is transformed to [`x=[$hshiftN]`]. + +The correct graph for [`f(x)=[$b]\ln(x+[$hshift])+[$vshift]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse10.pg new file mode 100644 index 0000000000..60b755b361 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse10.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# Last updates: Yao 7/3/2018 +# ENDDESCRIPTION + +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') +##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem('') +##Author('Carl Yao') +##Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## +TEXT(beginproblem()); + + + +$fname = RandomVariableName(type=>function); #get a name for the function + + +Context("Numeric"); +$a = non_zero_random(-10,10,1); +$f = Formula("ln(x-$a)")->reduce; #generate a radical function + +$ans = Compute("e**x+$a")->reduce; + +############################################## + +BEGIN_PGML + + +Find the inverse of [`[$fname]`] where [`[$fname](x)=[$f]`]. + + [``[$fname]^{-1}(x)=``][____________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +If the point [`(x,y)`] is on [`[$fname](x)`], the point [`(y,x)`] is on [`[$fname]^{-1}(x)`]. To find the inverse of [`[$fname](x)`], switch the positions of [`x`] and [`y`] in [`[$fname](x)`]'s equation, and then solve for [`y`], which represents [`[$fname]^{-1}(x)`]. + + [`` +\begin{aligned}[t] + [$fname](x) &= [$f] \\ + y &= [$f] \\ + x &= \ln(y-[$a]) \\ + e^{x} &= y-[$a] \\ + e^{x} +[$a] &= y \\ + [$fname]^{-1}(x) &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse20.pg new file mode 100644 index 0000000000..622a2c52be --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse20.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# Last updates: Yao 7/3/2018 +# ENDDESCRIPTION + +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') +##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem('') +##Author('Carl Yao') +##Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## +TEXT(beginproblem()); + + + +$fname = RandomVariableName(type=>function); #get a name for the function + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(2,5,1); +$b = non_zero_random(-5,5,1); +$c = non_zero_random(-5,5,1); +$base = random(2,9,1); + +$ans = Compute("$base**((x-$b)/$a)")->reduce; + +############################################## + +BEGIN_PGML + + +Find the inverse of [`[$fname]`] where [`[$fname](x)=[$a]\log_{[$base]}(x)+[$b]`]. + + [``[$fname]^{-1}(x)=``][____________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +If the point [`(x,y)`] is on [`[$fname](x)`], the point [`(y,x)`] is on [`[$fname]^{-1}(x)`]. To find the inverse of [`[$fname](x)`], switch the positions of [`x`] and [`y`] in [`[$fname](x)`]'s equation, and then solve for [`y`], which represents [`[$fname]^{-1}(x)`]. + + [`` +\begin{aligned}[t] + [$fname](x) &= [$a]\log_{[$base]}(x)+[$b] \\ + y &= [$a]\log_{[$base]}(x)+[$b] \\ + x &= [$a]\log_{[$base]}(y)+[$b] \\ + x - [$b] &= [$a]\log_{[$base]}(y) \\ + \frac{x-[$b]}{[$a]} &= \log_{[$base]}(y) \\ + [$base]^{\frac{x-[$b]}{[$a]}} &= y \\ + [$fname]^{-1}(x) &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse30.pg new file mode 100644 index 0000000000..015da43305 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse30.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# Last updates: Yao 7/3/2018 +# ENDDESCRIPTION + +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') +##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem('') +##Author('Carl Yao') +##Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## +TEXT(beginproblem()); + + + +$fname = RandomVariableName(type=>function); #get a name for the function + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(2,5,1); +$b = random(1,5,1); +$base = random(2,9,1); + +$f = Compute("$b-10**($a*x)")->reduce; +$ans = Compute("log(([$b]-x))/$a")->reduce; + +############################################## + +BEGIN_PGML + + +Find the inverse of [`[$fname]`] where [`[$fname](x)=[$f]`]. + + [``[$fname]^{-1}(x)=``][____________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +If the point [`(x,y)`] is on [`[$fname](x)`], the point [`(y,x)`] is on [`[$fname]^{-1}(x)`]. To find the inverse of [`[$fname](x)`], switch the positions of [`x`] and [`y`] in [`[$fname](x)`]'s equation, and then solve for [`y`], which represents [`[$fname]^{-1}(x)`]. + + [`` +\begin{aligned}[t] + [$fname](x) &= [$b]-10^{[$a]x} \\ + y &= [$b]-10^{[$a]x} \\ + x &= [$b]-10^{[$a]y} \\ + x - [$b] &= -10^{[$a]y}\\ + \mathbf{(-1)\cdot}(x - [$b]) &= \mathbf{(-1)\cdot}\left(-10^{[$a]y}\right)\\ + [$b]-x &= 10^{[$a]y} \\ + \log([$b]-x) &= [$a]y \\ + \frac{\log([$b]-x)}{[$a]} &= y \\ + [$fname]^{-1}(x) &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse40.pg new file mode 100644 index 0000000000..0ac68806f4 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmInverse40.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# Last updates: Yao 7/3/2018 +# ENDDESCRIPTION + +##DBsubject('Algebra') +##DBchapter('') +##DBsection('') +##KEYWORDS('domain,function') +##DBCCSS('F.IF.5') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem('') +##Author('Carl Yao') +##Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## +TEXT(beginproblem()); + + + +$fname = RandomVariableName(type=>function); #get a name for the function + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(2,5,1); +$b = random(2,5,1); +$c = non_zero_random(-5,5,1); +$base = random(2,9,1); + +$f = Compute("$a*e**($b-x)+$c")->reduce; +$ans = Compute("$b-ln((x-[$c])/$a)")->reduce; +$ans->{limits} = [$c+1,$c+10]; + +############################################## + +BEGIN_PGML + + +Find the inverse of [`[$fname]`] where [`[$fname](x)=[$f]`]. + + [``[$fname]^{-1}(x)=``][____________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +If the point [`(x,y)`] is on [`[$fname](x)`], the point [`(y,x)`] is on [`[$fname]^{-1}(x)`]. To find the inverse of [`[$fname](x)`], switch the positions of [`x`] and [`y`] in [`[$fname](x)`]'s equation, and then solve for [`y`], which represents [`[$fname]^{-1}(x)`]. + + [`` +\begin{aligned}[t] + [$fname](x) &= [$a]*e^{[$b]-x}+[$c] \\ + y &= [$a]*e^{[$b]-x}+[$c] \\ + x &= [$a]*e^{[$b]-y}+[$c] \\ + x - [$c] &= [$a]*e^{[$b]-y} \\ + \frac{x-[$c]}{[$a]} &= e^{[$b]-y} \\ + \ln(\frac{x-[$c]}{[$a]}) &= [$b]-y \\ + \ln(\frac{x-[$c]}{[$a]})-[$b] &= -y \\ + \mathbf{(-1)\cdot}\left(\ln(\frac{x-[$c]}{[$a]})-[$b] \right)&= \mathbf{(-1)\cdot}(-y) \\ + [$b]-\ln(\frac{x-[$c]}{[$a]}) &= y \\ + [$fname]^{-1}(x) &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties10.pg new file mode 100644 index 0000000000..89b5df6856 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties10.pg @@ -0,0 +1,65 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$base0 = random(2,9,1); +$base1 = random(2,9,1); +$ans0 = 1; +$ans1 = 0; + +############################################## + +BEGIN_PGML + +Evaluate the following logarithm expressions. + +a. [`` \log_{[$base0]}([$base0])=``] [__________]{$ans0} + +a. [`` \log_{[$base1]}(1)=``] [__________]{$ans1} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +a. [`` \log_{[$base0]}([$base0])=[$ans0]``] because [`[$base0]^{[$ans0]}=[$base0]`]. + +a. [`` \log_{[$base1]}(1)=[$ans1]``] because [`[$base1]^{[$ans1]}=1`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties100.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties100.pg new file mode 100644 index 0000000000..3d477b71ab --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties100.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +$a = random(2,10,1); +do {$b = non_zero_random(-10,10,1);} until ( ($b!=1) && (abs($a)!=abs($b)) ); +$aPlusB = $a+$b; +$ab = $a*$b; + +$question = "\log_{$a}($var^2+$aPlusB $var+$ab) - 2 \log_{$a}($var+$a)"; + +$s1 = "\log_{$a}($var^2+$aPlusB $var+$ab) - \log_{$a}\left( ($var+$a)^2 \right)"; +$s2 = "\log_{$a} \left( \frac{$var^2+$aPlusB $var+$ab}{($var+$a)^2} \right)"; +$s3 = "\log_{$a} \left( \frac{($var+$a)($var+$b)}{($var+$a)^2} \right)"; +$s4 = "\log_{$a} \left( \frac{$var+$b}{$var+$a} \right)"; + +@choices = (); +$choices[0] = $s4; +$choices[1] = "\log_{$a} \left( \frac{$var+$a}{$var+$b} \right)"; +$choices[2] = "\log_{$a} \left( \frac{$var+$b}{$var+1} \right)"; +$choices[3] = "\log_{$a} \left( \frac{$var+$b}{2} \right)"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm expression + + [`` [$question] ``], + +an equivalent expression is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$s2] \\ + &= [$s3] \\ + &= [$s4] +\end{aligned} + ``] + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties110.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties110.pg new file mode 100644 index 0000000000..c353248958 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties110.pg @@ -0,0 +1,136 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + +do { + $a = random(2,10,1); + do {$b = random(2,10,1);} until ($a!=$b); + $top = $a*$b; + do { + $c = random(2,10,1); + $d = random(2,10,1); + } until (gcd($c,$d)==1); + $bottom = "\frac{$c}{$d}"; + $f = Fraction($top*$d,$c); + ($fNum,$fDen) = $f->value; +} until ($fDen!=1); + +$question = "\frac{\ln($a)+\ln($b)}{\ln($c)-\ln($d)}"; + +@choices = (); +$choices[0] = "\log_{\frac{$c}{$d}}($top)"; +$choices[1] = "\log_{$top}\left(\frac{$c}{$d}\right)"; +$choices[2] = "\ln \left( \frac{$fNum}{$fDen} \right)"; +$choices[3] = "\ln \left( \frac{$fDen}{$fNum} \right)"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm expression + + [`` [$question] ``], + +an equivalent expression is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[$shuffle->{0}]] ``] + + [`` \text{B. } [$choices[$shuffle->{1}]] ``] + + [`` \text{C. } [$choices[$shuffle->{2}]] ``] + + [`` \text{D. } [$choices[$shuffle->{3}]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= \frac{\ln([$a]\cdot[$b])}{\ln\left(\frac{[$c]}{[$d]}\right)} \\ + &= \frac{\ln([$top])}{\ln\left(\frac{[$c]}{[$d]}\right)} \\ + &= [$choices[0]] +\end{aligned} + ``] + +In the last step, we used the change base formula: [` \log_{a}(M)=\frac{\log_{b}(M)}{\log_{b}(a)} `]. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties120.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties120.pg new file mode 100644 index 0000000000..845c4e0c06 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties120.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var = RandomVariableName('type' => variable); +Context()->variables->are($var => 'Real'); + + do { + $a = random(2,5,1); + $b = random(2,5,1); + } until (gcd($a,$b)==1); + $c = random(2,3,1); + $bc = $b**$c; + $top = "\frac{$a}{$bc}"; + do {$d = random(2,5,1);} until ($d!=$a); + $dc = $d**$c; + $bottom = $a*$dc; + $e = $bc*$dc; + +$question = "\frac{\ln($a)-$c\ln($b)}{\ln($a)+$c\ln($d)}"; + +@choices = (); +$choices[0] = "\log_{$bottom}\left($top\right)"; +$choices[1] = "\log_{$top}($bottom)"; +$choices[2] = "\ln \left( \frac{1}{$e} \right)"; +$choices[3] = "\frac{1}{$e}"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm expression + + [`` [$question] ``], + +an equivalent expression is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$s1 = $a*$dc; + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= \frac{\ln([$a])-\ln\left([$b]^[$c]\right)}{\ln([$a])+\ln\left([$d]^[$c]\right)} \\ + &= \frac{\ln([$a])-\ln([$bc])}{\ln([$a])+\ln([$dc])} \\ + &= \frac{\ln\left(\frac{[$a]}{[$bc]}\right)}{\ln([$a]\cdot[$dc])} \\ + &= \frac{\ln\left(\frac{[$a]}{[$bc]}\right)}{\ln([$s1])} \\ + &= [$choices[0]] +\end{aligned} + ``] + +In the last step, we used the change base formula: [` \log_{a}(M)=\frac{\log_{b}(M)}{\log_{b}(a)} `]. + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties20.pg new file mode 100644 index 0000000000..fc7caee494 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties20.pg @@ -0,0 +1,71 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$base0 = random(2,9,1); +$ans0 = random(2,9,1)*random(-1,1,2); +do { + $base1 = random(2,9,1); + $ans1 = random(2,100,1); +} until ( int(ln($ans1)/ln($base1))!=ln($ans1)/ln($base1) ); + +############################################## + +BEGIN_PGML + +Evaluate the following logarithm expressions. + +a. [`` \log_{[$base0]}([$base0]^{[$ans0]})=``] [__________]{$ans0} + +a. [`` [$base1]^{\log_{[$base1]}([$ans1])}=``] [__________]{$ans1} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +a. [``\log_{[$base0]}([$base0]^{[$ans0]})=[$ans0]``] because [`f(x)=\log_{[$base0]}(x)`] and [`f^{-1}(x)=[$base0]^{x}`] are inverse functions, and + + [``\log_{[$base0]}([$base0]^{[$ans0]})=f\left(f^{-1}([$ans0])\right)=[$ans0]``] + +a. [``[$base1]^{\log_{[$base1]}([$ans1])}=[$ans1]``] because [`f(x)=\log_{[$base1]}(x)`] and [`f^{-1}(x)=[$base1]^{x}`] are inverse functions, and + + [``[$base1]^{\log_{[$base1]}([$ans1])}=f^{-1}\left(f([$ans1])\right)=[$ans1]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties30.pg new file mode 100644 index 0000000000..646a090f09 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties30.pg @@ -0,0 +1,81 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +do { + do { + $base = list_random(4,6,8,9); + $ans = random(2,6,1); + $value = $base**$ans; + } until ( $value<=100 ); + do { + $a = random(2,$value-1,1); + $b = $value/$a; + } until (int($b)==$b); +} until ( (int(ln($a)/ln($base))!=ln($a)/ln($base)) && (int(ln($b)/ln($base))!=ln($b)/ln($base)) ); + +############################################## + +BEGIN_PGML + +Evaluate the following logarithm expressions without using a calculator. Use logarithm properties. + + [`` \log_{[$base]}([$a])+\log_{[$base]}([$b])=``] [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To solve this problem, we use the property of logarithm + + [`` \log_{a}(M)+\log_{a}(N) = \log_{a}(MN) ``] + +We have: + + [`` +\begin{aligned} + \log_{[$base]}([$a])+\log_{[$base]}([$b]) + &= \log_{[$base]}([$a]\cdot[$b]) \\ + &= \log_{[$base]}([$value]) \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties40.pg new file mode 100644 index 0000000000..b185303b59 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties40.pg @@ -0,0 +1,81 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +do { + do { + $base = random(2,9,1); + $ans = random(2,6,1); + $value = $base**$ans; + } until ( value<=100 ); + do { + $a = random(2,$value-1,1); + } until (int(ln($a)/ln($base))!=ln($a)/ln($base)); + $b = $value*$a; +} until ($b<=100); + +############################################## + +BEGIN_PGML + +Evaluate the following logarithm expressions without using a calculator. Use logarithm properties. + + [`` \log_{[$base]}([$b])-\log_{[$base]}([$a])=``] [__________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To solve this problem, we use the property of logarithm + + [`` \log_{a}(M)-\log_{a}(N) = \log_{a}(\frac{M}{N}) ``] + +We have: + + [`` +\begin{aligned} + \log_{[$base]}([$b])-\log_{[$base]}([$a]) + &= \log_{[$base]}(\frac{[$b]}{[$a]}) \\ + &= \log_{[$base]}([$value]) \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties50.pg new file mode 100644 index 0000000000..ad85718507 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties50.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$a = random(2,10,1); +$b = random(2,10,1); +$ab = $a*$b; + +@choices = (); +$choices[0] = "\ln($a)+$b"; +$choices[1] = "$b\ln($a)+$b"; +$choices[2] = "$ab"; +$choices[3] = "$b\ln($a)"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm expression + + [`` \ln\left([$a]e^{[$b]}\right) ``], + +an equivalent expression is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \ln\left([$a]e^{[$b]}\right) + &= \ln([$a])+\ln\left(e^{[$b]}\right) \\ + &= \ln([$a])+[$b]\ln(e) \\ + &= \ln([$a])+[$b] +\end{aligned} + ``] + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties60.pg new file mode 100644 index 0000000000..025ccef3bf --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties60.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var1 = RandomVariableName('type' => variable); +Context()->variables->are($var1 => 'Real'); + +do {$var2 = RandomVariableName('type' => variable);} until ($var1 ne $var2); +Context()->variables->add($var2 => 'Real'); + +do { + $base = random(2,9,1); + $ex = random(1,6,1); + $value = $base**$ex; +} until ($value<=125); + +$a = random(2,5,1); +$b = $a*$ex; + +@choices = (); +$choices[0] = "\log_{$base}($var1)-$ex-$a\log_{$base}($var2)"; +$choices[1] = "\log_{$base}($var1)-$ex+$a\log_{$base}($var2)"; +$choices[2] = "\log_{$base}($var1)-$b-$a\log_{$base}($var2)"; +$choices[3] = "\log_{$base}($var1)-$b+$a\log_{$base}($var2)"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm expression + + [`` \log_{[$base]}\left( \frac{[$var1]}{[$value][$var2]^{[$a]}} \right) ``], + +an equivalent expression is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \log_{[$base]}\left( \frac{[$var1]}{[$value][$var2]^{[$a]} \right) + &= \log_{[$base]}([$var1])-\log_{[$base]}\left( [$value][$var2]^{[$a]} \right) \\ + &= \log_{[$base]}([$var1])- \left( \log_{[$base]}([$value]) + \log_{[$base]}\left([$var2]^{[$a]} \right) \right) \\ + &= \log_{[$base]}([$var1])- \left( [$ex] + [$a]\log_{[$base]}([$var2]) \right) \\ + &= \log_{[$base]}([$var1])- [$ex] - [$a]\log_{[$base]}([$var2]) \\ +\end{aligned} + ``] + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties70.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties70.pg new file mode 100644 index 0000000000..85dc71ccb8 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties70.pg @@ -0,0 +1,132 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var1 = RandomVariableName('type' => variable); +Context()->variables->are($var1 => 'Real'); + +do {$var2 = RandomVariableName('type' => variable);} until ($var1 ne $var2); +Context()->variables->add($var2 => 'Real'); + +$a = random(2,5,1); +$b = random(2,5,1); + +$question = ($b==2) ? "\log \left( $var1^{$a} \cdot \sqrt{$var2^{$b}+1} \right)" : "\log \left( $var1^{$a} \cdot \sqrt[$b]{$var2^{$b}+1} \right)"; + +$s1 = ($b==2) ? "\log \left( $var1^{$a} \right) + \log \left( \sqrt{$var2^{$b}+1} \right)" : "\log \left( $var1^{$a} \right) + \log \left( \sqrt[$b]{$var2^{$b}+1} \right)"; + +$s2 = "\log \left( $var1^{$a} \right) + \log \left( ($var2^{$b}+1)^{\frac{1}{$b}} \right)"; + +$s3 = "$a \log ($var1) + \frac{1}{$b} \log \left( $var2^{$b}+1 \right)"; + +@choices = (); +$choices[0] = $s3; +$choices[1] = "$a \log ($var1) + \log($var2+1)"; +$choices[2] = "$a \log ($var1) + $b \log \left( $var2^{$b}+1 \right)"; +$choices[3] = "$a \log ($var1) + \log($var2)"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm expression + + [`` [$question] ``], + +an equivalent expression is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$s2] \\ + &= [$s3] +\end{aligned} + ``] + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties80.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties80.pg new file mode 100644 index 0000000000..99f134dfac --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties80.pg @@ -0,0 +1,134 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var1 = RandomVariableName('type' => variable); +Context()->variables->are($var1 => 'Real'); + +do {$var2 = RandomVariableName('type' => variable);} until ($var1 ne $var2); +Context()->variables->add($var2 => 'Real'); + +do { + $a = random(2,9,1); + $b = random(2,5,1); + $c = $a**$b; + $ab = $a*$b; +} until ( ($c < 100) && ($c != $ab) ); +$d = random(2,5,1); + +$question = "$b \log($a) - $d \log($var1)"; + +$s1 = "\log \left( $a^{$b} \right) - \log \left( $var1^{$d} \right)"; + +$s2 = "\log \left( \frac{$c}{$var1^{$d}} \right)"; + +@choices = (); +$choices[0] = $s2; +$choices[1] = "\log \left( $c $var1^{$d} \right)"; +$choices[2] = "\log \left( \frac{$var1^{$d}}{$c} \right)"; +$choices[3] = "\log \left( \frac{$ab}{$var1^{$d}} \right)"; + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm expression + + [`` [$question] ``], + +an equivalent expression is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$s2] +\end{aligned} + ``] + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties90.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties90.pg new file mode 100644 index 0000000000..57d4209ae1 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogarithmProperties90.pg @@ -0,0 +1,168 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$var1 = RandomVariableName('type' => variable); +Context()->variables->are($var1 => 'Real'); + +do {$var2 = RandomVariableName('type' => variable);} until ($var1 ne $var2); +Context()->variables->add($var2 => 'Real'); + +$ex1 = random(1,5,1); +do {$ex2 = random(1,5,1);} until ($ex1 != $ex2); +$r1 = list_random(2,3,5); +do {$r2 = list_random(2,3,5);} until ($r1 != $r2); + +$exp1 = ($ex1==1) ? "$var1" : "$var1^{$ex1}"; +$exp3 = ($ex2==1) ? "$var1" : "$var1^{$ex2}"; +$exp2 = ($r1==2) ? "\sqrt{$var2}" : "\sqrt[$r1]{$var2}"; +$exp4 = ($r2==2) ? "\sqrt{$var2}" : "\sqrt[$r2]{$var2}"; + +$a = "\frac{\ln($var2)}{$r1}"; +$b = "\frac{1}{$r1}\ln($var2)"; +$c = "\ln\left($var2^{\frac{1}{$r1}}\right)"; +$d = "\ln\left($var2^{\frac{1}{$r2}}\right)"; + +$question = "\ln($exp1)-\ln($exp3)+$a-\ln($exp4)"; +$s1 = "\ln($exp1)-\ln($exp3)+$b-\ln($exp4)"; +$s2 = "\ln($exp1)-\ln($exp3)+$c-$d"; +$s3 = "\ln\left(\frac{$exp1\cdot $var2^{\frac{1}{$r1}}}{$exp3\cdot $var2^{\frac{1}{$r2}}}\right)"; + +$exd1 = abs($ex1-$ex2); +$num = abs($r1-$r2); +$den = $r1*$r2; +$exd2 = "\frac{$num}{$den}"; + + @choices = (); + $choices[0] = ($exd1==1) ? "\ln\left( $var1 \cdot $var2^{$exd2} \right)" : "\ln\left( $var1^{$exd1} \cdot $var2^{$exd2} \right)"; + $choices[1] = ($exd1==1) ? "\ln\left( \frac{1}{$var1\cdot $var2^{$exd2}} \right)" : "\ln\left( \frac{1}{$var1^{$exd1}\cdot $var2^{$exd2}} \right)"; + $choices[2] = ($exd1==1) ? "\ln\left( \frac{$var1}{$var2^{$exd2}} \right)" : "\ln\left( \frac{$var1^{$exd1}}{$var2^{$exd2}} \right)"; + $choices[3] = ($exd1==1) ? "\ln\left( \frac{$var2^{$exd2}}{$var1} \right)" : "\ln\left( \frac{$var2^{$exd2}}{$var1^{$exd1}} \right)"; + +if ( ($ex1>$ex2) && ($r1>$r2) ) { + $s4 = "\ln\left( \frac{$var1^{$ex1-$ex2}}{$var2^{\frac{1}{$r2}-\frac{1}{$r1}}} \right)"; + $s5 = $choices[2]; + $choices[2] = $choices[0]; + $choices[0] = $s5; +} elsif ( ($ex1>$ex2) && ($r1<$r2) ) { + $s4 = "\ln\left( $var1^{$ex1-$ex2} \cdot $var2^{\frac{1}{$r1}-\frac{1}{$r2}} \right)"; + $s5 = $choices[0]; +} elsif ( ($ex1<$ex2) && ($r1>$r2) ) { + $s4 = "\ln\left( \frac{1}{ $var1^{$ex2-$ex1} \cdot $var2^{\frac{1}{$r2}-\frac{1}{$r1}} } \right)"; + $s5 = $choices[1]; + $choices[1] = $choices[0]; + $choices[0] = $s5; +} else { + $s4 = "\ln\left( \frac{$var2^{\frac{1}{$r1}-\frac{1}{$r2}}}{$var1^{$ex2-$ex1}} \right)"; + $s5 = $choices[3]; + $choices[3] = $choices[0]; + $choices[0] = $s5; +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct answer + +$pop = PopUp( [qw(? A B C D)], $zero+1 ); + + +############################################## + +BEGIN_PGML + +For the logarithm expression + + [`` [$question] ``], + +an equivalent expression is [@ $pop->menu() @]*. + + [`` \text{A. } [$choices[[$shuffle->{0}]]] ``] + + [`` \text{B. } [$choices[[$shuffle->{1}]]] ``] + + [`` \text{C. } [$choices[[$shuffle->{2}]]] ``] + + [`` \text{D. } [$choices[[$shuffle->{3}]]] ``] + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$question] + &= [$s1] \\ + &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$s5] +\end{aligned} + ``] + +The correct answer is [$pop->correct_ans()]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogsToExponents.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogsToExponents.pg new file mode 100644 index 0000000000..c351a97f53 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/LogsToExponents.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "parserMultiAnswer.pl", + "bizarroArithmetic.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(18,92); +$b = round(log10($a)*1000)/1000; + +Context()->operators->set( +'**' => {class => 'bizarro::BOP::power', isCommand => 1, perl=>undef}, +'^' => {class => 'bizarro::BOP::power', isCommand => 1, perl=>undef}, +); + +Context()->flags->set(bizarroPow=>1); + +Context()->flags->set(formatStudentAnswer=>'parsed'); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->operators->undefine('*','+','-','/'); + + +$multians = MultiAnswer( +Compute($a), +Compute("10^($b)")) +->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $f1stu, $f2stu ) = @{$student}; + my ( $f1, $f2 ) = @{$correct}; + if ( ($f1 == $f1stu && $f2 == $f2stu) || + ($f1 == $f2stu && $f2 == $f1stu) ) { + return 1; + } else { + if ($f1stu == $f2stu) { + Value::Error("This equation is a true equation, but it is not what was asked for."); + } else { + return 0; + } + } + } +); + + +############################################## + +BEGIN_PGML + +Rewrite the statement using exponents instead of logarithms. + +END_PGML +BEGIN_TEXT +$PAR + +\{ +LayoutTable( +[ +["\(\log($a)\)","\({}={}\)","\($b\)"], +[$multians->ans_rule(6),"\({}={}\)",$multians->ans_rule(12)], +], +allcellcss=>'padding:0px; padding-bottom:6px;' +) +\} + +END_TEXT + +############################################## + +ANS( $multians->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +When one side of an equation is a logarithm with base [`b`] of something, then [`b`] can be moved to the other side of the equation in the form of an exponential base. That is + + [`\begin{aligned} +\log_b(\text{left})&=\text{right}\\ +\underset{\hookrightarrow}{\log_b}(\text{left})&=\text{right}\\ +\text{left} &=b^{\text{right}} +\end{aligned}`] + +So we have the equation + + [`[$a]=10^{[$b]}`] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/Solve2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/Solve2.pg new file mode 100644 index 0000000000..7230132344 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/Solve2.pg @@ -0,0 +1,168 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + + +$a = random(2,5,1); + +$b = random(6,10,1); + +$shift = $b-$a; + +$c = $a*$b; + + + +Context("LimitedNumeric"); +parser::Assignment->Allow; +Context()->operators->redefine(',',using=>',',from=>'Numeric'); +Context()->operators->redefine('or',using=>',',from=>'Numeric'); +Context()->operators->set( + ','=>{string=>' or ',TeX=>'\hbox{ or }'}, + 'or'=>{string=>' or ',TeX=>'\hbox{ or }'} +); +Context()->lists->set(List => {separator => " or "}); +Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '*' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '+' in this context"} + = "Please simplify your answer further"; +Context()->{error}{msg}{"Can't use '-' in this context"} + = "Please simplify your answer further"; + +# add solution strings to context- this means that if +# students enter these (and they are not correct), then +# WW will not give a Context warning +Context()->strings->add("no real solutions"=>{}, + "no real solution"=>{alias=>'no real solutions'}, + "none"=>{alias=>'no real solutions'}, + ); + +$ans = Compute("x = $a"); + + +############################################## + +BEGIN_PGML + +Solve the equation below. Enter solutions in the form *x=...*. If there are multiple solutions, enter a comma-separated list. + + [`\log(x)+\log(x+[$shift])=\log([$c])`] + + [____________________________] + + +END_PGML + + +############################################## + +ANS($ans->cmp( + checker => sub { + my ($correct,$student,$ans) = @_; + # count the number of student answers + my $fullStudent = $ans->{student_formula}; + my @fullStudentValue = $fullStudent->value; + my $n = scalar(@fullStudentValue); # number of student answers + if($n>1) + { + $student->context->setError("Have you checked that each of your possible solutions are actually solutions?","",undef,undef,$Value::CMP_WARNING) + unless $ans->{isPreview}; + return; + } + # if the student has said no real solutions, ask them about it + if($student eq "no real solutions") + { + $student->context->setError("This equation does have some solutions- try factoring or using the quadratic formula","",undef,undef,$Value::CMP_WARNING) + unless $ans->{isPreview}; + return; + } + # check that the student has written x= + if ($student->type ne "Assignment" && $ans->{student_formula}->type ne "Assignment") { + $student->context->setError("Your entry should be written $var = $US$US$US","",undef,undef,$Value::CMP_WARNING) + unless $ans->{isPreview}; + return; + } + return $correct == $student; + } +)->withPostFilter(sub { + my $ansHash = shift; + if ($ansHash->{score}) { + my ($cvar,$cfrac) = $ansHash->{correct_value}->value; # get + my ($svar,$sfrac) = $ansHash->{student_value}->value; # get + my $check = $cfrac->cmp->evaluate($sfrac->string); # do a + $ansHash->{score} = $check->{score}; + $ansHash->{ans_message} = $check->{ans_message}; # and any + } + return $ansHash; + }, + ), +); + + +############################################## + +Context("Numeric"); +$s = Formula("x^2+$shift x- $c")->reduce; + +BEGIN_PGML_SOLUTION + +To start, we can combine the logarithms on the left: + + [`\begin{aligned} +\log(x)+\log(x+[$shift])&=\log([$c])\\ +\log(x(x+[$shift]))&=\log([$c]) +\end{aligned}`] + +Now we can raise [`10`] to both sides, effectively removing the [`\log`]s. + + [`\begin{aligned} +x(x+[$shift])&=[$c]\\ +[$s]&=0\\ +(x-[$a])(x+[$b]) &=0\\ +x&=[$a]&&\text{or}&x&=-[$b] +\end{aligned}`] + +We check each of these possibilities in the original equation and see that [`x=[$a]`] is a solution, but [`x=-[$b]`] is not, since we cannot use a negative input into [`\log(x)`]. + + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs.pg new file mode 100644 index 0000000000..b832ae50dc --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +parser::Assignment->Allow; + +$a = random(1,100,1); +$b = random(2,12,1); +$c = random(40,1000,1); + +$ans = ln($c/$a)/ln($b); + +$ans = Formula("x=$ans"); + + + +############################################## + +BEGIN_PGML + +Solve the equation by using logarithms. Remember, when solving an equation for [`x`], your answer should be in the form *x=...*. When exponents are involved, it becomes very important to be precise. Use at least four significant digits in your answers. + + [`[$a]([$b])^x=[$c]`] + + + [_____________________] + +END_PGML + +############################################## + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS($ans->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +One approach is to immediately apply a logarithm to both sides: + + [`\begin{aligned} +[$a]([$b])^x&=[$c]\\ +\log\left([$a]([$b])^x\right)&=\log([$c])\\ +\log([$a])+\log\left([$b]^x\right)&=\log([$c])\\ +\log([$a])+x\log([$b])&=\log([$c])\\ +x\log([$b])&=\log([$c])-\log([$a])\\ +x&=\frac{\log([$c])-\log([$a])}{\log([$b])}\\ +x&\approx[@(log($c)-log($a))/(log($b))@] +\end{aligned}`] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs2.pg new file mode 100644 index 0000000000..37e036d68d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs2.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +parser::Assignment->Allow; + +$a = random(1,100,1); +$b = random(2,12,1); +$c = random(40,1000,1); +$k = random(2,8,1); + +$ans = ln($c/$a)/ln($b)/$k; + +$ans = Formula("x=$ans"); + + + +############################################## + +BEGIN_PGML + +Solve the equation by using logarithms. Remember, when solving an equation for [`x`], your answer should be in the form *x=...*. When exponents are involved, it becomes very important to be precise. Use at least four significant digits in your answers. + + [`[$a]([$b])^{[$k] x}=[$c]`] + + [____________________] + + +END_PGML + +############################################## + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS($ans->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +We can being by applying [`\log`] to both sides: + + [`\begin{aligned} +[$a]([$b])^{[$k] x}&=[$c]\\ +\log\left([$a]([$b])^{[$k] x}\right)&=\log([$c])\\ +\log([$a])+\log\left([$b]^{[$k] x}\right)&=\log([$c])\\ +\log([$a])+[$k] x\log([$b])&=\log([$c])\\ +[$k] x\log([$b])&=\log([$c])-\log([$a])\\ +x&=\frac{\log([$c])-\log([$a])}{[$k] \log([$b])}\\ +x&\approx[@(log($c)-log($a))/($k*log($b))@] +\end{aligned}`] + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs3.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs3.pg new file mode 100644 index 0000000000..a4453a0e9f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs3.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +parser::Assignment->Allow; + +$a = random(1,100,1); +$b = random(1.01,1.8,0.001); +$c = 2*$a+10; + + +$ans = ln($c/$a)/ln($b); + +$ans = Formula("x=$ans"); + + + +############################################## + +BEGIN_PGML + +Solve the equation by using logarithms. Remember, when solving an equation for [`x`], your answer should be in the form *x=...*. When exponents are involved, it becomes very important to be precise. Use at least four significant digits in your answers. + + [`[$a]([$b])^{x}=[$c]`] + + [____________________] + + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS($ans->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +We can being by applying [`\log`] to both sides: + + [`\begin{aligned} +[$a]([$b])^{x}&=[$c]\\ +\log\left([$a]([$b])^{x}\right)&=\log([$c])\\ +\log([$a])+\log\left([$b]^{x}\right)&=\log([$c])\\ +\log([$a])+x\log([$b])&=\log([$c])\\ +x\log([$b])&=\log([$c])-\log([$a])\\ +x&=\frac{\log([$c])-\log([$a])}{\log([$b])}\\ +x&\approx[@(log($c)-log($a))/log($b)@] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs4.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs4.pg new file mode 100644 index 0000000000..0d35eb717b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs4.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +parser::Assignment->Allow; + +$a[0] = random(1,100,1); +$a[1] = random(1,100,1); + +$b[0] = random(1.01,1.8,0.001); +$b[1] = $b[0]+0.34; + + + +$ans = ln($a[1]/$a[0])/(ln($b[0])-ln($b[1])); + +$ans = Formula("x=$ans"); + + + +############################################## + +BEGIN_PGML + +Solve the equation by using logarithms. Remember, when solving an equation for [`x`], your answer should be in the form *x=...*. When exponents are involved, it becomes very important to be precise. Use at least four significant digits in your answers. + + [`[@$a[0]@]([@$b[0]@])^{x}=[@$a[1]@]([@$b[1]@])^{x}`] + + [____________________] + + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS($ans->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +We can being by applying [`\log`] to both sides: + + [`\begin{aligned} +[@$a[0]@]([@$b[0]@])^{x}&=[@$a[1]@]([@$b[1]@])^{x}\\ +\log\left([@$a[0]@]([@$b[0]@])^{x}\right)&=\log\left([@$a[1]@]([@$b[1]@])^{x}\right)\\ +\log([@$a[0]@])+\log\left([@$b[0]@]^{x}\right)&=\log([@$a[1]@])+\log\left([@$b[1]@]^{x}\right)\\ +\log([@$a[0]@])+x\log([@$b[0]@])&=\log([@$a[1]@])+x\log([@$b[1]@])\\ +x\log([@$b[0]@])-x\log([@$b[1]@])&=\log([@$a[1]@])-\log([@$a[0]@])\\ +x\left(\log([@$b[0]@])-\log([@$b[1]@])\right)&=\log([@$a[1]@])-\log([@$a[0]@])\\ +x&=\frac{\log([@$a[1]@])-\log([@$a[0]@])}{\log([@$b[0]@])-\log([@$b[1]@])}\\ +x&\approx[@(log($a[1])-log($a[0]))/(log($b[0])-log($b[1]))@] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs5.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs5.pg new file mode 100644 index 0000000000..153585c611 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs5.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +parser::Assignment->Allow; + +$a = random(2,100,1); +$m = random(2,100,1); + +$b = random(10,50,0.01); + +$c = random(10,50,0.01); + + + +$d = Real("(10**($c/$a)-$b)/$m"); + +$ans = Formula("x=$d"); + + + +############################################## + +BEGIN_PGML + +Solve the equation. Remember, when solving an equation for [`x`], your answer should be in the form *x=...*. When exponents are involved, it becomes very important to be precise. Use at least four significant digits in your answers. + + [`[$a]\log([$m] x+[$b])=[$c]`] + + [________________________] + + +END_PGML + +############################################## + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS($ans->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +We can begin with division so that the left side is only a logarithm of an expression: + + [`\begin{aligned} +[$a]\log([$m] x+[$b])&=[$c]\\ +\log([$m] x+[$b])&=\frac{[$c]}{[$a]}\\ +\underset{\hookrightarrow}{\log}([$m] x+[$b])&=\frac{[$c]}{[$a]}\\ +[$m] x+[$b] &= 10^{[$c]/[$a]}\\ +[$m] x &= 10^{[$c]/[$a]}-[$b]\\ +x &= \frac{10^{[$c]/[$a]}-[$b]}{[$m]}\\ +x&\approx[$d] +\end{aligned}`] + + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs6.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs6.pg new file mode 100644 index 0000000000..896847d845 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/SolveUsingLogs6.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +parser::Assignment->Allow; + +$a = random(1,100,1); +$m = random(2,10,1); + +$b = random(10,50,0.01); + +$c = $b+random(10,50,0.01); + + + +$ans = ln(($c-$b)/$a)/ln($m); + +$ans = Formula("x=$ans"); + + + +############################################## + +BEGIN_PGML + +Solve the equation. Remember, when solving an equation for [`x`], your answer should be in the form *x=...*. When exponents are involved, it becomes very important to be precise. Use at least four significant digits in your answers. + + [`[$a]\cdot[$m]^x+[$b]=[$c]`] + + [________________________] + +END_PGML + +############################################## + +Context()->flags->set(formatStudentAnswers=>parsed); + +ANS($ans->cmp); + +############################################## + +BEGIN_PGML_SOLUTION + +Before applying any logarithms, we can combine like terms if they are moved to the same side of the equation: + + [`\begin{aligned} +[$a]\cdot[$m]^x+[$b]&=[$c]\\ +[$a]\cdot[$m]^x&=[@$c-$b@]\\ +[$m]^x&=\frac{[@$c-$b@]}{[$a]}\\ +\log\left([$m]^x\right)&=\log\left(\frac{[@$c-$b@]}{[$a]}\right)\\ +x\log([$m])&=\log\left(\frac{[@$c-$b@]}{[$a]}\right)\\ +x&=\frac{\log\left(\frac{[@$c-$b@]}{[$a]}\right)}{\log([$m])}\\ +x&\approx[@ln(($c-$b)/$a)/ln($m)@] +\end{aligned}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/TrueFalse.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/TrueFalse.pg new file mode 100644 index 0000000000..a2c12a07ca --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Logarithms/TrueFalse.pg @@ -0,0 +1,130 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserRadioButtons.pl", + "PGML.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + + +$radioTrue = RadioButtons( + ["True","False"], + "True", + last => ["False"], +); + +$radioFalse = RadioButtons( + ["True","False"], + "False", + last => ["False"], +); + + +############################################## + +BEGIN_PGML + +Are each of these statements true or false? If you have incorrect parts, you will not be shown which ones are incorrect. If you cannot determine which parts you have incorrect using your notes or a textbook, contact your instructor or a tutor for assistance. + +a) [`\log(AB) = \log(A)+\log(B)`] + + [@ $radioTrue->buttons() @]* + +b) [`\log(A + B) = \log(A)+\log(B)`] + + [@ $radioFalse->buttons() @]* + +c) [`\log(A + B) = \log(A)\cdot\log(B)`] + + [@ $radioFalse->buttons() @]* + +d) [`\frac{\log(A)}{\log(B)} = \log(A)-\log(B)`] + + [@ $radioFalse->buttons() @]* + +e) [`p\log(A) = \log(A^p)`] + + [@ $radioTrue->buttons() @]* + +f) [`\log\Big(\frac{1}{A}\Big) = -\log(A)`] + + [@ $radioTrue->buttons() @]* + +g) [`\sqrt{\log(A)} = \log\big(A^{1/2}\big)`] + + [@ $radioFalse->buttons() @]* + +h) [`\log\big(\sqrt{A}\big) = \frac12\log(A)`] + + [@ $radioTrue->buttons() @]* + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( $radioTrue->cmp() ); +ANS( $radioFalse->cmp() ); +ANS( $radioFalse->cmp() ); +ANS( $radioFalse->cmp() ); +ANS( $radioTrue->cmp() ); +ANS( $radioTrue->cmp() ); +ANS( $radioFalse->cmp() ); +ANS( $radioTrue->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +a) This one is *true*. It is the basic product-addition rule for logarithms. + +a) This one is *false*. You cannot break up a logarithm over a plus sign. + +a) This one is *false*. It kind of resembles the basic product-addition rule for logarithms, but it is backwards. + +a) This one is *false*. It kind of resembles the basic quotient-subtraction rule for logarithms, but that rule involves a quotient _inside_ a logarithm. + +a) This one is *true*. This is one of the basic logarithm rules. + +a) This one is *true*. It is one on the basic logarithm rules. Also, it is the same equation as the previous question with [`k=-1`]. + +a) This one is *false*. Raising to the [`1/2`] power is the same as taking a square root, and so this would say that having a square root outside of a logarithm is equivalent to having it inside. But that is just not true. Try evaluating both sides with [`x=10`] and you should see that the equation is false. + +a) This one is *true*. Since a square root is the same as raising to the [`1/2`] power, this is the same question as part e, but with [`k=1/2`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/IdentifyPolynomials10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/IdentifyPolynomials10.pg new file mode 100644 index 0000000000..24d18f0b42 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/IdentifyPolynomials10.pg @@ -0,0 +1,138 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Difference between polynomial and non-polynomial functions +# +# Last edited: Yao 4/11/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('Problem Solving with Equations') +## KEYWORDS('formula','expression','evaluate') +## DBCCSS('6.EE.2.c') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +DOCUMENT(); + +########Begin Load Macro Files############ +#This section loads any and all .pl files that contain useful subroutines for the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +########Begin Problem Setup############ + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$var0 = RandomVariableName(type=>variable); +do {$var1 = RandomVariableName(type=>variable)} until ($var0 ne $var1); +do {$var2 = RandomVariableName(type=>variable)} until (($var2 ne $var1) and ($var2 ne $var0)); +do {$var3 = RandomVariableName(type=>variable)} until (($var3 ne $var1) and ($var3 ne $var2) and ($var3 ne $var0)); +Context()->variables->are($var1=>'Real',$var2=>'Real',$var3=>'Real', $var0=>'Real'); + +@choices = ('f','g','h','p','q','j','k','m','n'); +@slice = NchooseK(8,8); +@fnames = @choices[@slice]; + +do { + $a = list_random(2,3,5,6,7,8); + $b = random(2,9,1); +} until (gcd($a,$b)==1); +$c = random(2,9,1); +$d = random(2,9,1); +$aPlusB = $a+$b; + +$poly1 = "$fnames[0]($var0)=\frac{$var0}{$a}"; +$poly2 = "$fnames[1]($var1)=$b $var1^2-\sqrt{$a} $var1"; +$poly3 = "$fnames[2]($var2)=$d $var2($var2-$b)"; +$poly4 = "$fnames[3]($var3)=$d+$a $var3-$b $var3^3"; + +$nonPoly1 = "$fnames[4]($var0)=$c $var0^{\frac{$a}{$b}}"; +$nonPoly2 = "$fnames[5]($var1)=$d $var1^3-$a $var1^{-$c}"; +$nonPoly3 = "$fnames[6]($var2)=$c $var2^{$b} - \sqrt{$a $var2}"; +$nonPoly4 = "$fnames[7]($var3)=\frac{$a}{$var3}"; + +$mc1 = new_checkbox_multiple_choice(); +$mc1 -> qa ( + "Identify all polynmial functions.", + "\( $poly1 \)", + "\( $poly2 \)", + "\( $poly3 \)", + "\( $poly4 \)", +); +$mc1 -> extra( + "\( $nonPoly1 \)", + "\( $nonPoly2 \)", + "\( $nonPoly3 \)", + "\( $nonPoly4 \)", +); + + +########Begin What the Student Sees############ + +TEXT(beginproblem()); + +BEGIN_PGML + + [@$mc1 -> print_q()@]* + + [@$mc1 -> print_a()@]* + +END_PGML + +########Begin more complicated answer processing (if needed)############ + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc1->correct_ans() ) ); + +########Begin solution.############ + +$bd = $b*$d; + +BEGIN_PGML_SOLUTION + +A polynomial function's variable can only have non-negative integer exponents. + +In the list, the following are polynomial functions: + +* [``[$poly1] = \frac{1}{[$a]}[$var0]``] + +* [``[$poly2]``] A polynomial function's coefficients could be irrational numbers like [`\sqrt{[$a]}`]. + +* [``[$poly3] = [$d] [$var2]^2 - [$bd] [$var2]``] + +* [``[$poly4] = -[$b] [$var3]^3 + [$a] [$var3] +[$d]``] + +The following are not polynomial functions: + +* [``[$nonPoly1]``] A polynomial function can only have integer exponents. + +* [``[$nonPoly2]``] A polynomial function can only have positive exponents. + +* [``[$nonPoly3] = [$c] [$var2]^{[$b]} - \sqrt{[$a]} [$var2]^{\frac{1}{2}}``] A polynomial function can only have integer exponents. + +* [``[$nonPoly4] = [$a] [$var3]^{-1}``] A polynomial function can only have positive exponents. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation10.pg new file mode 100644 index 0000000000..d9b0a7f164 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation10.pg @@ -0,0 +1,208 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(-3,3,1); +$vershift = non_zero_random(-3,3,1); +$ex = list_random(3,5,7); +$horshiftN = -$horshift; +$vershiftN = -$vershift; + +$func = Formula("x**$ex")->reduce; +$f[0] = Formula("(x+$horshift)**$ex+$vershift")->reduce; +$f[1] = Formula("(x-$horshift)**$ex+$vershift")->reduce; +$f[2] = Formula("(x+$horshift)**$ex-$vershift")->reduce; +$f[3] = Formula("(x-$horshift)**$ex-$vershift")->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=$func, with the center of the function at ($horshiftN,$vershift)"; +$alt[1] = "graph with the shape of y=$func, with the center of the function at ($horshift,$vershift)"; +$alt[2] = "graph with the shape of y=$func, with the center of the function at ($horshiftN,$vershiftN)"; +$alt[3] = "graph with the shape of y=$func, with the center of the function at ($horshift,$vershiftN)"; + + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +If [`f(x)]`] is a transformation of the function [`g(x)=[$func]`], choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$lor = $horshift>0 ? "left" : "right"; +$uod = $vershift>0 ? "up" : "down"; +$horshiftA = abs($horshift); +$vershiftA = abs($vershift); + +BEGIN_PGML_SOLUTION + +The parent function, before transformation, is [`g(x)=[$func]`]. + +To transform from [`g(x)=[$func]`] to [`f(x)=[$f[0]]`], there is a horizontal shift, and a vertical shift. The order doesn't matter, since they are both shifts. + +We can shift the graph of [`g(x)=[$func]`] to the [$lor] by [`[$horshiftA]`] units, and then shift [$uod] by [`[$vershiftA]`] units. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation20.pg new file mode 100644 index 0000000000..e10397a2d0 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation20.pg @@ -0,0 +1,208 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(-3,3,1); +$vershift = non_zero_random(-3,3,1); +$ex = list_random(3,5,7); +$horshiftN = -$horshift; +$vershiftN = -$vershift; + +$func = Formula("x**$ex")->reduce; +$f[0] = Formula("-(x+$horshift)**$ex+$vershift")->reduce; +$f[1] = Formula("-(x+$horshift)**$ex-$vershift")->reduce; +$f[2] = Formula("-(x-$horshift)**$ex+$vershift")->reduce; +$f[3] = Formula("-(x-$horshift)**$ex-$vershift")->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=$func reflected by the x-axis, with the center of the function at ($horshiftN,$vershift)"; +$alt[1] = "graph with the shape of y=$func reflected by the x-axis, with the center of the function at ($horshiftN,$vershiftN)"; +$alt[2] = "graph with the shape of y=$func reflected by the x-axis, with the center of the function at ($horshift,$vershift)"; +$alt[3] = "graph with the shape of y=$func reflected by the x-axis, with the center of the function at ($horshift,$vershiftN)"; + + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +If [`f(x)]`] is a transformation of the function [`g(x)=[$func]`], choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$lor = $horshift>0 ? "left" : "right"; +$uod = $vershift>0 ? "up" : "down"; +$horshiftA = abs($horshift); +$vershiftA = abs($vershift); + +BEGIN_PGML_SOLUTION + +The parent function, before transformation, is [`g(x)=[$func]`]. + +To transform from [`g(x)=[$func]`] to [`f(x)=[$f[0]]`], there is reflection by the [`x`]-axis, a horizontal shift, and a vertical shift. By order of transformations, we need to do reflection first, and then shift. + +First, reflect the graph by the [`x`]-axis, and then shift the graph of [`g(x)=-[$func]`] to the [$lor] by [`[$horshiftA]`] units, and then shift [$uod] by [`[$vershiftA]`] units. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation30.pg new file mode 100644 index 0000000000..3375e7dc07 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation30.pg @@ -0,0 +1,208 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(-3,3,1); +$vershift = non_zero_random(-3,3,1); +$ex = list_random(4,6,8); +$horshiftN = -$horshift; +$vershiftN = -$vershift; + +$func = Formula("x**$ex")->reduce; +$f[0] = Formula("(x+$horshift)**$ex+$vershift")->reduce; +$f[1] = Formula("(x+$horshift)**$ex-$vershift")->reduce; +$f[2] = Formula("(x-$horshift)**$ex+$vershift")->reduce; +$f[3] = Formula("(x-$horshift)**$ex-$vershift")->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=$func, with the center of the function at ($horshiftN,$vershift)"; +$alt[1] = "graph with the shape of y=$func, with the center of the function at ($horshiftN,$vershiftN)"; +$alt[2] = "graph with the shape of y=$func, with the center of the function at ($horshift,$vershift)"; +$alt[3] = "graph with the shape of y=$func, with the center of the function at ($horshift,$vershiftN)"; + + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +If [`f(x)]`] is a transformation of the function [`g(x)=[$func]`], choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$lor = $horshift>0 ? "left" : "right"; +$uod = $vershift>0 ? "up" : "down"; +$horshiftA = abs($horshift); +$vershiftA = abs($vershift); + +BEGIN_PGML_SOLUTION + +The parent function, before transformation, is [`g(x)=[$func]`]. + +To transform from [`g(x)=[$func]`] to [`f(x)=[$f[0]]`], there is a horizontal shift, and a vertical shift. The order doesn't matter, because they are both shifts. + +We shift the graph of [`g(x)=[$func]`] to the [$lor] by [`[$horshiftA]`] units, and then shift [$uod] by [`[$vershiftA]`] units. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation40.pg new file mode 100644 index 0000000000..ca2917c4b4 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation40.pg @@ -0,0 +1,208 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(-3,3,1); +$vershift = non_zero_random(-3,3,1); +$ex = list_random(4,6,8); +$horshiftN = -$horshift; +$vershiftN = -$vershift; + +$func = Formula("x**$ex")->reduce; +$f[0] = Formula("-(x+$horshift)**$ex+$vershift")->reduce; +$f[1] = Formula("-(x-$horshift)**$ex-$vershift")->reduce; +$f[2] = Formula("(x+$horshift)**$ex+$vershift")->reduce; +$f[3] = Formula("(x-$horshift)**$ex+$vershift")->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=$func reflected by the x-axis, with the center of the function at ($horshiftN,$vershift)"; +$alt[1] = "graph with the shape of y=$func reflected by the x-axis, with the center of the function at ($horshift,$vershiftN)"; +$alt[2] = "graph with the shape of y=$func, with the center of the function at ($horshiftN,$vershift)"; +$alt[3] = "graph with the shape of y=$func, with the center of the function at ($horshift,$vershift)"; + + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +If [`f(x)]`] is a transformation of the function [`g(x)=[$func]`], choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$lor = $horshift>0 ? "left" : "right"; +$uod = $vershift>0 ? "up" : "down"; +$horshiftA = abs($horshift); +$vershiftA = abs($vershift); + +BEGIN_PGML_SOLUTION + +The parent function, before transformation, is [`g(x)=[$func]`]. + +To transform from [`g(x)=[$func]`] to [`f(x)=[$f[0]]`], there is reflection by the [`x`]-axis, a horizontal shift, and a vertical shift. By order of transformations, we need to do reflection first, and then shift. + +First, reflect the graph by the [`x`]-axis, and then shift the graph of [`g(x)=-[$func]`] to the [$lor] by [`[$horshiftA]`] units, and then shift [$uod] by [`[$vershiftA]`] units. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation50.pg new file mode 100644 index 0000000000..151a01ebd6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/PolynomialTransformation50.pg @@ -0,0 +1,215 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(-3,3,1); +$vershift = non_zero_random(-3,3,1); +$ex = list_random(4,6,8); +$horshiftN = -$horshift; +$vershiftN = -$vershift; + +$func = Formula("x**$ex")->reduce; +$f[0] = Formula("(-x-$horshift)**$ex+$vershift")->reduce; +$f[1] = Formula("(-x+$horshift)**$ex+$vershift")->reduce; +$f[2] = Formula("-(x+$horshift)**$ex+$vershift")->reduce; +$f[3] = Formula("-(x-$horshift)**$ex+$vershift")->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=$func, with the center of the function at ($horshiftN,$vershift)"; +$alt[1] = "graph with the shape of y=$func, with the center of the function at ($horshift,$vershift)"; +$alt[2] = "graph with the shape of y=$func reflected by the x-axis, with the center of the function at ($horshiftN,$vershift)"; +$alt[3] = "graph with the shape of y=$func reflected by the x-axis, with the center of the function at ($horshift,$vershift)"; + + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +If [`f(x)]`] is a transformation of the function [`g(x)=[$func]`], choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$lor = $horshift>0 ? "left" : "right"; +$uod = $vershift>0 ? "up" : "down"; +$horshiftA = abs($horshift); +$vershiftA = abs($vershift); +$funcFactored = Formula("(-(x+$horshift))**$ex+$vershift")->reduce; + +BEGIN_PGML_SOLUTION + +The parent function, before transformation, is [`g(x)=[$func]`]. + +Before doing transformation for [`f(x)=[$f[0]]`], since there is a number, [`-1`], in front of the independent variable [`x`], we need to factor the expression and convert the function to: + + [``f(x)=[$f[0]]=[$funcFactored]``] + +To transform from [`g(x)=[$func]`] to [`f(x)=[$funcFactored]`], there is reflection by the [`y`]-axis, a horizontal shift, and a vertical shift. By order of transformations, we need to do reflection first, and then shift. + +First, reflect the graph of [`g(x)=[$func]`] by the [`y`]-axis, but the function's graph will not change, since the graph is symmetric about the [`y`]-axis. + +Next, we shift the graph of [`g(x)=[$func]`] to the [$lor] by [`[$horshiftA]`] units, and then shift [$uod] by [`[$vershiftA]`] units. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials1.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials1.pg new file mode 100644 index 0000000000..6f9d3ee485 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials1.pg @@ -0,0 +1,105 @@ +## Author('Utah ww group') +## Institution('Univeristy of Utah') +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## AuthorText1('Ron Larson and Robert Hostetler') +## TitleText1('Precalculus') +## EditionText1('7') +## Section1('Polynomial and Rational Functions') +## Problem1('') +## KEYWORDS('algebra') + +##################################################### + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"answerHints.pl", +); +TEXT(beginproblem()); + +do { +$degf = random(2,3,1); +$degg = random(3,5,1); +} until ($degf < $degg); + +for my $i (0..$degf) +{ $c[$i] = non_zero_random(-9,9,1); } +for my $i (0..$degg) +{ $d[$i] = non_zero_random(-9,9,1); } + +$f = "$c[$degf] x^($degf)"; +for my $i (1..$degf) +{ $f .= "+".$c[$degf-$i]."x^($degf-$i)"; } +$g = "$d[$degg] x^($degg)"; +for my $i (1..$degg) +{ $g .= "+".$d[$degg-$i]."x^($degg-$i)"; } + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); + +$f = Formula($f)->reduce->reduce; +$g = Formula($g)->reduce->reduce; + + +##################################################### + + +BEGIN_PGML + +Let [`f(x) = [$f]`] and [`g(x) = [$g]`]. + +For brevity let's write [`\deg(p)`] for the degree of a +polynomial [`p`]. So in the above example, [`\deg(f) = [$degf]`] and +[`\deg(g) = [$degg]`]. Find the following. + +a) [`\deg(f+g)={}`][____________] +a) [`\deg(f-g)={}`][____________] +a) [`\deg(fg)={}`][____________] + +END_PGML + +##################################################### + +ANS(Compute($degg)->cmp()->withPostFilter(AnswerHints( + Compute("$degf+$degg") => "You have computed deg(f)+deg(g); this is not the same as deg(f+g).", +))); +ANS(Compute($degg)->cmp()->withPostFilter(AnswerHints( + Compute("$degf-$degg") => "You have computed deg(f)-deg(g); this is not the same as deg(f-g).", +))); +ANS(Compute($degf+$degg)->cmp()->withPostFilter(AnswerHints( + Compute("$degf*$degg") => "You have computed deg(f)*deg(g); this is not the same as deg(fg).", +))); + +##################################################### + +$fpg = "$d[$degg] x^($degg)"; +for my $i (1..$degg-$degf-1) +{ $fpg .= "+".$d[$degg-$i]."x^($degg-$i)"; } +for my $i ($degg-$degf..$degg) +{ $fpg .= "+".($c[$degg-$i]+$d[$degg-$i])."x^($degg-$i)"; } +$fpg = Formula($fpg)->reduce->reduce; + +$fmg = "-$d[$degg] x^($degg)"; +for my $i (1..$degg-$degf-1) +{ $fmg .= "-".$d[$degg-$i]."x^($degg-$i)"; } +for my $i ($degg-$degf..$degg) +{ $fmg .= "+".($c[$degg-$i]-$d[$degg-$i])."x^($degg-$i)"; } +$fmg = Formula($fmg)->reduce->reduce; + +$fg = "$c[$degf]*$d[$degg] x^($degf+$degg)"; +$fg = Formula($fg)->reduce->reduce; + +BEGIN_PGML_SOLUTION + +a) Since [`(f+g)(x)=[$fpg]`], then [`\deg(f+g)=[$degg]`]. +a) Since [`(f-g)(x)=[$fmg]`], then [`\deg(f-g)=[$degg]`]. +a) Since [`(fg)(x)=[$fg]+\ldots`], then [`\deg(fg)=[@$degf+$degg@]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials10.pg new file mode 100644 index 0000000000..50a5a54150 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials10.pg @@ -0,0 +1,51 @@ +##DESCRIPTION +## Algebra problem: polynomial functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'construct a polynomial') +## tsch tagged and PAID on 12-12-2003 + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Dividing Polynomials') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('College Algebra') +## EditionText1('3') +## AuthorText1('Stewart, Redlin, Watson') +## Section1('5.2') +## Problem1('46,47') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl" +); +TEXT(beginproblem()); + + +$showPartialCorrectAnswers = 1; + +$a = random(5,8,1); +$b = random(1,4,1); +$c = random(1,4,1); +$d = random(5,8,1); + +TEXT(EV2(<flags->set(reduceConstants=>0); +$function = Formula("(x-$A)*(x-$B)*(x-$C)")->reduce; +$function = Formula("$coeff $function"); + +####################################################### + +BEGIN_PGML +Given that [`f`] is a cubic function with zeros at [`[$A]`], [`[$B]`], and [`[$C]`], find +a formula for [`f(x)`] given that [`f([$D]) = [$E]`]. + + [`f(x) ={}`] [_________________________________] + +END_PGML + +####################################################### + +ANS($function->cmp); + +####################################################### + +BEGIN_PGML_SOLUTION + +Since [`[$A]`], [`[$B]`], and [`[$C]`] are zeros of [`f`], then [`(x-[$A])`], [`(x-[$B])`], and [`(x-[$C])`] must be factors of [`f(x)`]. There can't be any more linear factors because [`f`] is cubic. But there could be an additional constant factor. + +So [`f(x)=c(x-[$A])(x-[$B])(x-[$C])`] for some value of [`c`]. We can find [`c`] by using the fact that [`f([$D]) = [$E]`] as follows: + + [`\begin{aligned} +f([$D]) &= [$E]\\ +c([$D]-[$A])([$D]-[$B])([$D]-[$C])&= [$E]\\ +c([$D-$A])([$D-$B])([$D-$C])&= [$E]\\ +c([@($D-$A)*($D-$B)*($D-$C)@])&= [$E]\\ +c&= [$coeff] +\end{aligned}`] + +So [`f(x)=[$function]`]. + +END_PGML_SOLUTION +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials13.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials13.pg new file mode 100644 index 0000000000..3c743549ba --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials13.pg @@ -0,0 +1,82 @@ +##DESCRIPTION +## Algebra problem: polynomial functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'construct a polynomial') + + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +################################################# +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"PGcourse.pl", +); +TEXT(beginproblem()); + + +$showPartialCorrectAnswers = 1; +################################################# + + +$r1 = random(-10,-2,1); +do { $r2 = random(2,10,1)} until $r1 != -$r2; +$d = non_zero_random(-5,5,1); + +$b = $r1+$r2; +$c = $r1*$r2-$d-1; + +do { +$var = RandomVariableName() +} until ($var ne 'x'); + +Context("Numeric"); +Context()->variables->are(x=>'Real', $var=>'Real'); +Context()->noreduce('(-x)+y'=>0, '(-x)-y'=>0); +$poly = Formula("x^4+[$b][$var]x^3 + [$var]^2 x^2 +[$c] x+[$d]")->reduce; + +BEGIN_PGML + +Find a negative number [`[$var]`], so that [`(x-1)`] is a factor of [`[$poly]`]. + + [`[$var]={}`][________________]{-$r2} + +END_PGML + +################################################# + +$factored = Formula("(x+$r1)(x+$r2)")->reduce; + +BEGIN_PGML_SOLUTION + +If [`(x-1)`] is a factor of the polynomial, then evaluating the polynomial at [`x=1`] will result in [`0`]. So + + [`\begin{aligned} +1^4+[$b][$var](1)^3 + [$var]^2 (1)^2 +[$c] (1)+[$d]&= 0\\ +1+[$b][$var] + [$var]^2 +[$c]+[$d]&= 0\\ +[$var]^2 +[$b][$var] + [$c+$d+1]&= 0\\ +[$factored] &= 0 +\end{aligned} `] + +The solutions to this equation are [`[$var]=[@$r1*-1@]`] and [`[$var]=[@$r2*-1@]`]. We were asked to find a negative value for [`[$var]`], so [`[$var]=[@$r2*-1@]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials14.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials14.pg new file mode 100644 index 0000000000..bdcb227194 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials14.pg @@ -0,0 +1,105 @@ +##DESCRIPTION +## +##ENDDESCRIPTION + +##KEYWORDS('') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +############################################## +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGcourse.pl", +); +TEXT(beginproblem()); + +############################################## + + +$a=random(-3, -1,1); +$b=random(1, 3,1); +$c=random(6,7,1); +$d=random(-7,-5,1); + +$lead = random(-.08,-.01,0.1); + +$xdom=9; +$xgrid=2*$xdom; + +$yy=$lead*(($b+$c-$d-$a)/4)**4; +$y1dom=floor(2*$yy); +$y2dom=ceil(abs(2*$yy)); +$ygrid=$y2dom-$y1dom; + +$graph = init_graph(-$xdom,$y1dom,$xdom,$y2dom,'axes'=>[0,0],'grid'=>[$xgrid]); + +$f = FEQ("$lead*(x-$a)*(x-$b)*(x-$c)*(x-$d) for x in <-$xdom,$xdom> using color:blue and weight:2"); +($fref) = plot_functions( $graph, $f); +$val = $lead*(5-$a)*(5-$b)*(5-$c)*(5-$d); + +$graph->stamps( closed_circle(5,$val,'blue') ); +$graph->lb( new Label(5,$val,"(5,$val)", + 'black','left','bottom')); + +############################################## + + +BEGIN_PGML + +The curve below is the graph of a degree four polynomial. It passes through the point [`(5, [$val])`]. You should assume that any coordinates on the graph that appear to be integers actually are integers. + +[@EnlargeImageStatementPGML()@]** + +>> [@image(insertGraph($graph), width=>400, height=>400) @]* << + +Find a formula for the polynomial. + + [`p(x)={}`][_________________________________________________________]{Formula("$lead*(x-$a)*(x-$b)*(x-$c)*(x-$d)")->reduce} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The graph indicates that each of [`[$a]`], [`[$b]`], [`[$c]`], and [`[$d]`] are zeros of degree one. So there are factors [`(x-[$a])`], [`(x-[$b])`], [`(x-[$c])`], and [`(x-[$d])`]. There cannot be any more factors involving [`x`], because the polynomial is degree four. But there can be a constant factor [`c`]. So we have established that for some [`c`], + + [`p(x)=c(x-[$a])(x-[$b])(x-[$c])(x-[$d])`] + +Now we also know that [`p(5)=[$val]`]. This tells us that + + [`\begin{aligned} +p(5) &= [$val]\\ +c(5-[$a])(5-[$b])(5-[$c])(5-[$d]) &= [$val]\\ +c([@(5-$a)*(5-$b)*(5-$c)*(5-$d)@]) &= [$val]\\ +c&=[$lead] +\end{aligned}`] + +So [`p(x)=[$lead](x-[$a])(x-[$b])(x-[$c])(x-[$d])`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials15.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials15.pg new file mode 100644 index 0000000000..b5da069476 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials15.pg @@ -0,0 +1,122 @@ +##DESCRIPTION +## +##ENDDESCRIPTION + +##KEYWORDS('') +## + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +################################################ + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGcourse.pl", +"parserPopUp.pl", +); +TEXT(beginproblem()); + + +################################################ + + +$a=list_random(-1,1); +$b=random(-6,-4); +$c=random(-2,0); +$d=random(2,4); +$e=random(6,8); + +$xdom=max(-$b,$e) + 2; +$xgrid=2*$xdom; + +$func = Formula("0.0001*$a*(x-$b)*(x-$c)^2*(x-$d)*(x-$e)^2"); +for my $i (0..($e-$b)) { +$ya[$i] = abs($func->eval(x=>($i+$b+0.5))); +} +$yy=max(@ya); +$y1dom=min(floor(-1.2*$yy)); +$y2dom=max(ceil(1.2*$yy)); + + +$graph = init_graph(-$xdom,$y1dom,$xdom,$y2dom,'axes'=>[0,0],'grid'=>[$xgrid]); + +$f = FEQ("$func for x in <-$xdom,$xdom> using color:blue and weight:2"); +$fref = plot_functions( $graph, $f); + +$evenodd = PopUp(['?','even','odd'], 'even'); + +$ans2 = "positive"; +if ($a != 1) {$ans2 = "negative";} +$posneg = PopUp(['?','positive','negative'], $ans2); + +################################################ + +BEGIN_PGML +The curve below is a graph of the polynomial function [`p`]. Use the graph to answer the questions that follow. + +[@EnlargeImageStatementPGML()@]** + +>>[@ image(insertGraph($graph), width=>400, height=>400) @]* << + +a. Is the degree of [`p`] even or odd? [@$evenodd->menu@]* + +a. Is the leading coefficient of [`p`] positive or negative? [@$posneg->menu@]* + +a. List the real roots of [`p`]. [________________] + +a. What is the smallest possible degree of [`p`]? [_______] + +END_PGML + +################################################ +$Roots = List("$b,$c,$d,$e"); + +ANS($evenodd->cmp); +ANS($posneg->cmp); +ANS($Roots->cmp); +ANS(Real(6)->cmp); + +################################################ + +$dir = ($a > 0) ? "up" : "down"; +$lim = ($a > 0) ? "\infty" : "-\infty"; + +BEGIN_PGML_SOLUTION + +a. Since both arms of [`p`] point in the same direction ([$dir]), [`p`] has an even degree. + +a. Since [`p(x)\to[$lim]`] as [`x\to\infty`], the leading coefficient of [`p`] is [$ans2]. In other words, since the arm on the right points [$dir], the leading coefficient of [`p`] is [$ans2]. + +a. Roots are the [`x`]-values where the curve touches the [`x`]-axis. This happens at [`[$Roots]`]. + +a. At [`x=[$b]`] and [`x=[$d]`], the curve crosses through the [`x`] axis just like a linear function would. So the corresponding factors [`(x-[$b])`] and [`(x-[$d])`] are degree [`1`]. That is, they are not raised to a power (other than [`1`]). + + At [`x=[$c]`] and [`x=[$e]`], the curve touches the [`x`] axis and turns around. This tells us that the corresponding factors [`(x-[$c])`] and [`(x-[$e])`] are raised to an even power [`2`] or more. Each of them might be raised to [`2`], [`4`], or some such positive even power. + + All together this means that the total degree of [`p`] is at least [`1+1+2+2`], or [`6`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials16.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials16.pg new file mode 100644 index 0000000000..0301e327f2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials16.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); +TEXT(beginproblem()); + + + +############################################## + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +for my $i (1..2) +{ + $r[$i] = $r[$i-1] + random(1,5,1); +} + +$p = Compute("(x-$r[0])*(x-$r[1])*(x-$r[2])")->reduce; + +############################################## + +BEGIN_PGML + +Find a formula for a degree three polynomial function [`f`] whose zeros are [`[@$r[0]@]`], [`[@$r[1]@]`], and [`[@$r[2]@]`]. Technically, there are many correct answers for this question. + + [`f(x) = {}`][________________________________________] + +END_PGML + + +############################################## + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"$c0 * $p"); + return $correct == $student; + } +) ); + +############################################## + +BEGIN_PGML_SOLUTION + +Since the zeros are [`[@$r[0]@]`], [`[@$r[1]@]`], and [`[@$r[2]@]`], there are corresponding factors [`(x-[@$r[0]@])`], [`(x-[@$r[1]@])`], and [`(x-[@$r[2]@])`]. Since the polynomial is degree [`3`], there cannot be any more factors that use [`x`]. But there could be a constant factor. So any answer of the form [`c(x-[@$r[0]@])(x-[@$r[1]@])(x-[@$r[2]@])`] with [`c\neq0`] works. In particular, [`(x-[@$r[0]@])(x-[@$r[1]@])(x-[@$r[2]@])`] is one correct answer. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials17.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials17.pg new file mode 100644 index 0000000000..5caccfa980 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials17.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + +); +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$r[0] = 0; +$r[1] = random(1,6,1); +$r[2] = $r[1]+random(1,6,1); + + +$p = Compute("(x-$r[0])*(x-$r[1])*(x-$r[2])")->reduce; + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Find a formula for a degree three polynomial function \(f\) whose zeros are \($r[0]\), \($r[1]\), and \($r[2]\). $PAR + +\(f(x)\) = \{ans_rule(50)\} + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"$c0 * $p"); + return $correct == $student; + } +) ); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials18.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials18.pg new file mode 100644 index 0000000000..cae56af3c2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials18.pg @@ -0,0 +1,76 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + +); +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +for my $i (1..3) +{ + $r[$i] = $r[$i-1] + random(1,5,1); +} + +$p = Compute("(x-$r[0])*(x-$r[1])*(x-$r[2])*(x-$r[3])")->reduce; + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Find a formula for a degree four polynomial function \(f\) whose zeros are \($r[0]\), \($r[1]\), \($r[2]\), and \($r[3]\). $PAR + +\(f(x)\) = \{ans_rule(50)\} + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"$c0 * $p"); + return $correct == $student; + } +) ); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials19.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials19.pg new file mode 100644 index 0000000000..dba6a501d8 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials19.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); +TEXT(beginproblem()); + + + +############################################## + + +Context("Numeric"); + +$r[0] = random(1,6,1); +$r[1] = $r[0]+random(1,6,1); + + +$p = Compute("(x-$r[0])*(x-$r[1])**2")->reduce; + +############################################## + +BEGIN_PGML + +Find a formula for a degree three polynomial function [`f`] whose zeros are [`[@$r[0]@]`] with multiplicity [`1`], and [`[@$r[1]@]`] with multiplicity [`2`]. There are many possible correct answers to this question. + + [`f(x)={}`][____________________________________] + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"$c0 * $p"); + return $correct == $student; + } +) ); + +############################################## + +BEGIN_PGML_SOLUTION + +Since [`[@$r[0]@]`] is a zero with multiplicity [`1`], [`(x-[@$r[0]@])`] is a factor. And since [`[@$r[1]@]`] is a zero with multiplicity [`2`], [`(x-[@$r[1]@])^2`] is a factor. The polynomial is degree three, so there can be no more factors involving [`x`]. There might be an additional constant factor, so we can say that for some [`c\neq 0`], [`f(x)=c(x-[@$r[0]@])(x-[@$r[1]@])^2`]. You could take [`c=1`] for instance, and [`f(x)=(x-[@$r[0]@])(x-[@$r[1]@])^2`] is a formula that meets the necessary conditions. + + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials2.pg new file mode 100644 index 0000000000..37181b7b24 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials2.pg @@ -0,0 +1,72 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +"contextLimitedPolynomial.pl" +); +TEXT(beginproblem()); + + + + +$b = list_random(-5-4,-3,-2,2,3,4,5); +$c = random(1,6); +$d = list_random(-5-4,-3,-2,2,3,4,5); +$e = non_zero_random(-5,5); +$k1 = random (2,5); +$k2 = random(2,5); + +BEGIN_TEXT +Define functions +\[ p(x) = x^2 + $b x + $c, \] and \[q(x) = 2 x^3 + $d x + $e.\] +Find and simplify each of the following. + +$PAR +a) \((p - q)(x) = \) \{ans_rule(30)\} +$PAR +b) \(($k2 q + $k1 p)(x) = \) \{ans_rule(30)\} +$PAR +c) \((pq)(x) = \) \{ans_rule(30)\} +$PAR + + +END_TEXT + +$k3 = $b - $d; +$k4 = $c - $e; +$k5 = $k2*2; +$k6 = $k1*$b + $k2*$d; +$k7 = $b * 2; +$k8 = $d + 2*$c; +$k9 = $e + $b*$d; +$k10 = $c*$d + $b*$e; +$k11 =$c*$e; +$k12 = 4*$d; +$k13 = 2*$b + 4*$e; +$k14 = ($d)**2; +$k15 = (2*$e + $b)*$d; +$k16 = ($e)**2 + $b*$e + $c; +$k17 = $k2*$e + $k1*$c; + +Context("LimitedPolynomial"); + +$ans1 = Compute("-2*x^3 + x^2 + $k3*x + $k4"); +$ans2 = Compute("$k5*x^3 + $k1*x^2 + $k6*x + $k17"); +$ans3 = Compute("2*x^5 + $k7*x^4 + $k8*x^3 + $k9*x^2 + $k10*x + $k11"); + + + + +ANS($ans1->cmp()); +ANS($ans2->cmp()); +ANS($ans3->cmp()); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials20.pg new file mode 100644 index 0000000000..a353a0c6d9 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials20.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "PGML.pl", + "contextFraction.pl", + "parserMultiAnswer.pl", + "PGcourse.pl", + +); +TEXT(beginproblem()); + + + +############################################## + + +Context("Numeric"); + +$r[0] = random(-8,-2,1); +$r[1] = random(1,10,1); + +Context("Fraction"); +$c = Fraction(1,random(2,10,1)); + +$m[0] = 1; +$m[1] = 2; + +Context("Numeric"); +$p = Compute("(x-$r[0])**($m[0])*(x-$r[1])**($m[1])")->reduce; +Context()->flags->set(reduceConstants=>0); +$p = Compute("$c*$p"); + + + +$multians = MultiAnswer($r[0], $m[0], $r[1], $m[1])->with( + singleResult => 0, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $zstu0, $mstu0, $zstu1, $mstu1 ) = @{$student}; + my ( $z0, $m0, $z1, $m1 ) = @{$correct}; + if ( ($z0 == $zstu0 && $m0 == $mstu0 + && $z1 == $zstu1 && $m1 == $mstu1) || + ($z0 == $zstu1 && $m0 == $mstu1 + && $z1 == $zstu0 && $m1 == $mstu0)) { + return [1,1,1,1]; + } else { + return [0,0,0,0]; + } + } +); + + +############################################## + +BEGIN_PGML + +Suppose that [`f`] is given by [`f(x)=[$p]`]. + +List the zeros of [`f`] and their multiplicities. + +END_PGML + +BEGIN_TEXT +$PAR +\{DataTable( +[ +[["zero",headerrow=>1],"multiplicity"], +[$multians->ans_rule(5),$multians->ans_rule(5)], +[$multians->ans_rule(5),$multians->ans_rule(5)], +], +allcellcss => "border: solid 1px;", +)\} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( $multians->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +We can see from the formula that [`[@$r[0]@]`] is a zero of multiplicity [`[@$m[0]@]`], and [`[@$r[1]@]`] is a zero of multiplicity [`[@$m[1]@]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials21.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials21.pg new file mode 100644 index 0000000000..30c4eac7dc --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials21.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "PGML.pl", + "contextFraction.pl", + "parserMultiAnswer.pl", + "PGcourse.pl", + +); +TEXT(beginproblem()); + + + +############################################## + + +Context("Numeric"); + +$r[0] = random(-8,-2,1); +$r[1] = random(1,10,1); + +Context("Fraction"); +$c = Fraction(2,random(2,10,1)); + +$m[0] = 3; +$m[1] = 2; + +Context("Numeric"); +$p = Compute("(x-$r[0])**($m[0])*(x-$r[1])**($m[1])")->reduce; +Context()->flags->set(reduceConstants=>0); +$p = Compute("$c*$p"); + + + +$multians = MultiAnswer($r[0], $m[0], $r[1], $m[1])->with( + singleResult => 0, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $zstu0, $mstu0, $zstu1, $mstu1 ) = @{$student}; + my ( $z0, $m0, $z1, $m1 ) = @{$correct}; + if ( ($z0 == $zstu0 && $m0 == $mstu0 + && $z1 == $zstu1 && $m1 == $mstu1) || + ($z0 == $zstu1 && $m0 == $mstu1 + && $z1 == $zstu0 && $m1 == $mstu0)) { + return [1,1,1,1]; + } else { + return [0,0,0,0]; + } + } +); + + +############################################## + +BEGIN_PGML + +Suppose that [`f`] is given by [`f(x)=[$p]`]. + +List the zeros of [`f`] and their multiplicities. + +END_PGML + +BEGIN_TEXT +$PAR +\{DataTable( +[ +[["zero",headerrow=>1],"multiplicity"], +[$multians->ans_rule(5),$multians->ans_rule(5)], +[$multians->ans_rule(5),$multians->ans_rule(5)], +], +allcellcss => "border: solid 1px;", +)\} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( $multians->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +We can see from the formula that [`[@$r[0]@]`] is a zero of multiplicity [`[@$m[0]@]`], and [`[@$r[1]@]`] is a zero of multiplicity [`[@$m[1]@]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials22.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials22.pg new file mode 100644 index 0000000000..b1a4bcee0e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials22.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", + +); +TEXT(beginproblem()); + + + +############################################## + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +for my $i (1..2) +{ + $r[$i] = $r[$i-1] + random(1,5,1); +} + +$p = Compute("(x-$r[0])*(x-$r[1])*(x-$r[2])")->reduce; + +for my $i ($r[0]..$r[2]-1) +{$vals[$i-$r[0]] = abs($p->eval(x=>$i+0.5));} + +$ymax = 1.3*max(@vals); + +$xmax = max($r[2]+1,5); +$gr = init_graph(-5,-$ymax,$xmax,$ymax,axes=>[0,0],grid=>[$xmax+5,10],size=>[400,400]); +$gr -> lb('reset'); + + +foreach my $i (1..$xmax) { + $gr -> lb(new Label ( $i,-0.05*$ymax, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.05*$ymax,-$i,'black','center','middle')); +} + +add_functions($gr, "$p for x in <-5,$xmax> using color:blue and weight:2"); + +############################################## + + +BEGIN_PGML + +Find a formula for a degree three polynomial function [`f`] that might have the graph below. There are many possible correct answers. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>400, height=>400, tex_size=>700) @]* << + + [`f(x)={}`][________________________________] + + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"abs($c0) * $p"); + return $correct == $student; + } +) ); + +############################################## + +BEGIN_PGML_SOLUTION + +We can see from the graph that [`[@$r[0]@]`], [`[@$r[1]@]`], and [`[@$r[2]@]`] are zeros. Therefore [`(x-[@$r[0]@])`], [`(x-[@$r[1]@])`], and [`(x-[@$r[2]@])`], are factors of [`f(x)`]. Since [`f`] is cubic, there can be no more factors involving [`x`]. However there may be an additional constant factor [`c`], and we can say that for some [`c\neq0`], [`f(x)=c[$p]`]. + +The graph indicates that as [`x\to\infty`], then [`f(x)\to\infty`]. In other words, the right arm of the graph points upward. This indicates that the leading coefficient of [`f(x)`] must be positive. So [`c`] must be positive. You can use any positive value for [`c`] to submit an answer. For instance, taking [`c=1`], we have that [`f(x)=[$p]`] is one possible answer to this question. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials23.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials23.pg new file mode 100644 index 0000000000..8ee5ea6f12 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials23.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", + +); +TEXT(beginproblem()); + + +############################################## + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +for my $i (1..2) +{ + $r[$i] = $r[$i-1] + random(2,3,1); +} + +$p = Compute("(x-$r[0])**2*(x-$r[1])*(x-$r[2])")->reduce; + +for my $i ($r[0]..$r[2]-1) +{$vals[$i-$r[0]] = abs($p->eval(x=>$i+0.5));} + +$ymax = 1.3*max(@vals); + +$xmax = max(5,$r[2]+1); +$gr = init_graph(-5,-$ymax,$xmax,$ymax,axes=>[0,0],grid=>[10,10],size=>[400,400]); +$gr -> lb('reset'); + + +foreach my $i (1..4) { + $gr -> lb(new Label ( $i,-0.5, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.5,-$i,'black','center','middle')); +} + +add_functions($gr, "$p for x in <-5,$xmax> using color:blue and weight:2"); + +############################################## + +BEGIN_PGML + +Find a formula for a degree four polynomial function [`f`] that might have the graph below. There are many possible correct answers. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>400, height=>400, tex_size=>700) @]* << + + [`f(x)={}`][________________________________] + + +END_PGML + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"abs($c0) * $p"); + return $correct == $student; + } +) ); + +############################################## + +BEGIN_PGML_SOLUTION + +We can see from the graph that [`[@$r[0]@]`], [`[@$r[1]@]`], and [`[@$r[2]@]`] are zeros. Also, at [`x=[@$r[0]@]`], the graph resembles a parabola. This indicates that [`[@$r[0]@]`] is a degree two zero. + +Therefore [`(x-[@$r[0]@])^2`], [`(x-[@$r[1]@])`], and [`(x-[@$r[2]@])`], are factors of [`f(x)`]. Since [`f`] is degree four, there can be no more factors involving [`x`]. However there may be an additional constant factor [`c`], and we can say that for some [`c\neq0`], [`f(x)=c[$p]`]. + +The graph indicates that as [`x\to\infty`], then [`f(x)\to\infty`]. In other words, the right arm of the graph points upward. This indicates that the leading coefficient of [`f(x)`] must be positive. So [`c`] must be positive. You can use any positive value for [`c`] to submit an answer. For instance, taking [`c=1`], we have that [`f(x)=[$p]`] is one possible answer to this question. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials24.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials24.pg new file mode 100644 index 0000000000..0b527efc8e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials24.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", + +); +TEXT(beginproblem()); + + + +############################################## + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +for my $i (1..2) +{ + $r[$i] = $r[$i-1] + 3; +} + +$p = Compute("-(x-$r[0])*(x-$r[1])**3*(x-$r[2])")->reduce; + +for my $i ($r[0]..$r[2]-1) +{$vals[$i-$r[0]] = abs($p->eval(x=>$i+0.5));} + +$ymax = 1.3*max(@vals); +$xmax = max(5, $r[2]+1); +$gr = init_graph(-5,-$ymax,$xmax,$ymax,axes=>[0,0],grid=>[$xmax+5,10],size=>[400,400]); +$gr -> lb('reset'); + + +foreach my $i (1..4) { + $gr -> lb(new Label ( $i,-0.5, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.5,-$i,'black','center','middle')); +} + +add_functions($gr, "$p for x in <-5,$xmax> using color:blue and weight:2"); + +############################################## + +BEGIN_PGML + +Find a formula for a degree five polynomial function [`f`] that might have the graph below. There are many possible correct answers. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>400, height=>400, tex_size=>700) @]* << + + [`f(x)={}`][________________________________] + + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"abs($c0) * $p"); + return $correct == $student; + } +) ); + +############################################## + +$np = Compute("(x-$r[0])*(x-$r[1])**3*(x-$r[2])")->reduce; + +BEGIN_PGML_SOLUTION + +We can see from the graph that [`[@$r[0]@]`], [`[@$r[1]@]`], and [`[@$r[2]@]`] are zeros. Also, at [`x=[@$r[1]@]`], the graph has the serpentine shape that resembles a [`y=x^3`]. This indicates that [`[@$r[1]@]`] is a degree three zero. + +Therefore [`(x-[@$r[0]@])`], [`(x-[@$r[1]@])^3`], and [`(x-[@$r[2]@])`], are factors of [`f(x)`]. Since [`f`] is degree five, there can be no more factors involving [`x`]. However there may be an additional constant factor [`c`], and we can say that for some [`c\neq0`], [`f(x)=c[$np]`]. + +The graph indicates that as [`x\to\infty`], then [`f(x)\to-\infty`]. In other words, the right arm of the graph points downward. This indicates that the leading coefficient of [`f(x)`] must be negative. So [`c`] must be negative. You can use any negative value for [`c`] to submit an answer. For instance, taking [`c=-1`], we have that [`f(x)=[$p]`] is one possible answer to this question. + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials25.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials25.pg new file mode 100644 index 0000000000..d53065b69b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials25.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", + +); +TEXT(beginproblem()); + + + +############################################## + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +for my $i (1..1) +{ + $r[$i] = $r[$i-1] + random(3,5,1); +} + +$c = random(-1,1,2); +$p = Compute("$c*(x-$r[0])**2*(x-$r[1])**2")->reduce; + +for my $i ($r[0]..$r[1]-1) +{$vals[$i-$r[0]] = abs($p->eval(x=>$i+0.5));} + +$ymax = 1.3*max(@vals); + +$gr = init_graph(-5,-$ymax,5,$ymax,axes=>[0,0],grid=>[10,10],size=>[400,400]); +$gr -> lb('reset'); + + +foreach my $i (1..4) { + $gr -> lb(new Label ( $i,-0.5, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.5,-$i,'black','center','middle')); +} + +add_functions($gr, "$p for x in <-5,5> using color:blue and weight:2"); + +############################################## + +BEGIN_PGML + +Find a formula for a degree four polynomial function [`f`] that might have the graph below. There are many possible correct answers. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>400, height=>400, tex_size=>700) @]* << + + [`f(x)={}`][________________________________] + + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"abs($c0) * $p"); + return $correct == $student; + } +) ); + +############################################## + +$np = Compute("(x-$r[0])**2*(x-$r[1])**2")->reduce; +$lim = ($c > 0) ? "\infty" : "-\infty"; +$dir = ($c > 0) ? "upward" : "downward"; +$posneg = ($c > 0) ? "positive" : "negative"; + + + +BEGIN_PGML_SOLUTION + +We can see from the graph that [`[@$r[0]@]`] and [`[@$r[1]@]`], are zeros. Also, at each of these zeros the graph resembles a parabola. This indicates that they are degree two zeros. + +Therefore [`(x-[@$r[0]@])^2`] and [`(x-[@$r[1]@])^2`] are factors of [`f(x)`]. Since [`f`] is degree four, there can be no more factors involving [`x`]. However there may be an additional constant factor [`c`], and we can say that for some [`c\neq0`], [`f(x)=c[$np]`]. + +The graph indicates that as [`x\to\infty`], then [`f(x)\to[$lim]`]. In other words, the right arm of the graph points [$dir]. This indicates that the leading coefficient of [`f(x)`] must be [$posneg]. So [`c`] must be [$posneg]. You can use any [$posneg] value for [`c`] to submit an answer. For instance, taking [`c=[$c]`], we have that [`f(x)=[$p]`] is one possible answer to this question. + + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials26.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials26.pg new file mode 100644 index 0000000000..56fa135ba0 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials26.pg @@ -0,0 +1,201 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); +TEXT(beginproblem()); + + $refreshCachedImages = 1; + + + + + +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$r[0] = random(-4,-2,1); +for my $i (1..2) +{ + $r[$i] = $r[$i-1] + random(2,3,1); +} + +$c = random(-1,1,2); +$p = Compute("$c*(x-$r[0])*(x-$r[1])*(x-$r[2])")->reduce; + +for my $i ($r[0]..$r[2]-1) +{$vals[$i-$r[0]] = abs($p->eval(x=>$i+0.5));} + +$ymax = 3*max(@vals); + +$horshift = non_zero_random(-4,4,2); +$vershift = non_zero_random(-5,5,10); +$horscale = 2; + +$f[1] = $p->substitute(x=>Formula("x/$horscale")); +$f[7] = $p->substitute(x=>Formula("x+$horshift")); +$f[2] = $p->substitute(x=>Formula("x-$horshift")); +$f[3] = $p+$vershift; +$f[4] = $p-$vershift; +$f[0] = $p; +$f[6] = $p->substitute(x=>Formula("$horscale*x")); +$f[5] = -$p; +$f[8] = -($p->substitute(x=>Formula("x+$horshift"))); +$f[9] = -($p->substitute(x=>Formula("x-$horshift"))); +$f[10] = $p**2/50; +$f[11] = -($p->substitute(x=>Formula("x/$horscale"))); + +$xmin = -10; #The viewing window +$xmax = 10; +$ymin = -$ymax; +$ymax = $ymax; + + +@graphs = (); +# Start making the graphs + +for ( my $i=0; $i<12; $i++ ) { + + +# Background +$size = 220; + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,10],axes=>[0,0],pixels=>[$size,$size]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (2,4,6,8) { +# $graphs[$i]->lb( new Label(-9.7, $j, $j,'black','center','middle')); +# $graphs[$i]->lb( new Label(-9.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j, 0, $j,'black','center','top')); + $graphs[$i]->lb( new Label( -$j, 0, "-$j",'black','center','top')); + } + $graphs[$i]->lb( new Label(9.7,0,'x','black','center','top')); + $graphs[$i]->lb( new Label(0.2,0.95*$ymax,'y','black','left','middle')); + +add_functions($graphs[$i], "$f[$i] for x in <-10,10> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(12); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4 5 6 7 8 9 10 11 12)], $zero+1 ); + + + + + +############################################## + +BEGIN_PGML +On paper, sketch the graph of [`f`], where [`f(x)=[$p]`]. (During exams, you may be required to actually sketch graphs, and cannot rely on multiple choices.) Once you have your graph, find it among these choices. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +["${BBOLD}1.$EBOLD".image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}2.$EBOLD".image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}3.$EBOLD".image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'),], +["${BBOLD}4.$EBOLD" .image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}5.$EBOLD".image(insertGraph( $graphs[ $shuffle->{4} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}6.$EBOLD".image(insertGraph( $graphs[ $shuffle->{5} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'),], +["${BBOLD}7.$EBOLD".image(insertGraph( $graphs[ $shuffle->{6} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}8.$EBOLD" .image(insertGraph( $graphs[ $shuffle->{7} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}9.$EBOLD".image(insertGraph( $graphs[ $shuffle->{8} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'),], +["${BBOLD}10.$EBOLD".image(insertGraph( $graphs[ $shuffle->{9} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}11.$EBOLD".image(insertGraph( $graphs[ $shuffle->{10} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}12.$EBOLD" .image(insertGraph( $graphs[ $shuffle->{11} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"') ], +], +allcellcss => "padding:5pt;", +)\} + +END_TEXT + + +BEGIN_PGML + The correct graph is graph [@$pop->menu() @]*. + +END_PGML + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$dir = ($c>0) ? "an upward" : "a downward"; + +BEGIN_PGML_SOLUTION + +The formula tells us that the zeros are at [`[@$r[0]@]`], [`[@$r[1]@]`], and [`[@$r[2]@]`]. The formula also tells us that each of these zeros are degree one. So when the graph reaches the [`x`]-intercepts, it will pass through the [`x`]-axis in a way similar to how a straight line would pass through. + +Also, the leading coefficient is [`[$c]`], which tells us that the right arm of the graph should point in [$dir] direction. We use all this to sketch a graph that looks like graph [@$zero+1@]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials27.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials27.pg new file mode 100644 index 0000000000..3b4a4aac20 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials27.pg @@ -0,0 +1,201 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); +TEXT(beginproblem()); + + $refreshCachedImages = 1; + +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$r[0] = random(-4,-2,1); +for my $i (1..2) +{ + $r[$i] = $r[$i-1] + random(3,6,1); +} + +$c = random(-1,1,2); +$p = Compute("$c*(x-$r[0])*(x-$r[1])**2")->reduce; + +for my $i ($r[0]..$r[1]-1) +{$vals[$i-$r[0]] = abs($p->eval(x=>$i+0.5));} + +$ymax = 3*max(@vals); + + +$horshift = non_zero_random(-4,4,2); +$vershift = non_zero_random(-5,5,10); +$horscale = 2; + + +$f[1] = $p->substitute(x=>Formula("x/$horscale")); +$f[7] = $p->substitute(x=>Formula("x+$horshift")); +$f[2] = $p->substitute(x=>Formula("x-$horshift")); +$f[3] = $p+$vershift; +$f[4] = $p-$vershift; +$f[0] = $p; +$f[6] = $p->substitute(x=>Formula("$horscale*x")); +$f[5] = -$p; +$f[8] = -($p->substitute(x=>Formula("x+$horshift"))); +$f[9] = Compute("$c*(x-$r[0])**2*(x-$r[1])**2")->reduce; +$f[10] = Compute("$c*(x-$r[0])*(x-$r[1])")->reduce; +$f[11] = -($p->substitute(x=>Formula("x/$horscale"))); + +$xmin = -10; #The viewing window +$xmax = 10; +$ymin = -$ymax; +$ymax = $ymax; + + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<12; $i++ ) { + + +# Background +$size = 220; + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,10],axes=>[0,0],pixels=>[$size,$size]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (2,4,6,8) { +# $graphs[$i]->lb( new Label(-9.7, $j, $j,'black','center','middle')); +# $graphs[$i]->lb( new Label(-9.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j, 0, $j,'black','center','top')); + $graphs[$i]->lb( new Label( -$j, 0, "-$j",'black','center','top')); + } + $graphs[$i]->lb( new Label(9.7,0,'x','black','center','top')); + $graphs[$i]->lb( new Label(0.2,0.95*$ymax,'y','black','left','middle')); + + +add_functions($graphs[$i], "$f[$i] for x in <-10,10> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(12); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4 5 6 7 8 9 10 11 12)], $zero+1 ); + + + + + +############################################## + +BEGIN_PGML +On paper, sketch the graph of [`f`], where [`f(x)=[$p]`]. (During exams, you may be required to actually sketch graphs, and cannot rely on multiple choices.) Once you have your graph, find it among these choices. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +["${BBOLD}1.$EBOLD".image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}2.$EBOLD".image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}3.$EBOLD".image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'),], +["${BBOLD}4.$EBOLD" .image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}5.$EBOLD".image(insertGraph( $graphs[ $shuffle->{4} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}6.$EBOLD".image(insertGraph( $graphs[ $shuffle->{5} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'),], +["${BBOLD}7.$EBOLD".image(insertGraph( $graphs[ $shuffle->{6} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}8.$EBOLD" .image(insertGraph( $graphs[ $shuffle->{7} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}9.$EBOLD".image(insertGraph( $graphs[ $shuffle->{8} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'),], +["${BBOLD}10.$EBOLD".image(insertGraph( $graphs[ $shuffle->{9} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}11.$EBOLD".image(insertGraph( $graphs[ $shuffle->{10} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}12.$EBOLD" .image(insertGraph( $graphs[ $shuffle->{11} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"') ], +], +allcellcss => "padding:5pt;", +)\} + +END_TEXT + + +BEGIN_PGML + The correct graph is graph [@$pop->menu() @]*. + +END_PGML + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$dir = ($c>0) ? "an upward" : "a downward"; + +BEGIN_PGML_SOLUTION + +The formula tells us that the zeros are at [`[@$r[0]@]`] and [`[@$r[1]@]`]. The formula also tells us that [`[@$r[0]@]`] is a degree one zero, and [`[@$r[1]@]`] is a degree two zero. So when the graph reaches the [`x`]-intercept at [`([@$r[0]@],0)`], it will pass through the [`x`]-axis in a way similar to how a straight line would pass through. And when it reaches the [`x`]-intercept at [`([@$r[1]@],0)`], it will behave similar to the vertex of a parabola, and turn around. + +Also, the leading coefficient is [`[$c]`], which tells us that the right arm of the graph should point in [$dir] direction. We use all this to sketch a graph that looks like graph [@$zero+1@]. + +END_PGML_SOLUTION +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials28.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials28.pg new file mode 100644 index 0000000000..caa297efe6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials28.pg @@ -0,0 +1,201 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + +TEXT(beginproblem()); + + $refreshCachedImages = 1; + + +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$r[0] = random(-4,-2,1); +for my $i (1..2) +{ + $r[$i] = $r[$i-1] + random(3,4,1); +} + +$c = random(-1,1,2); +$q = Compute("$c*(x-$r[0])**3*(x-$r[1])*(x-$r[2])**2")->reduce; + +for my $i ($r[0]..$r[2]-1) +{$vals[$i-$r[0]] = abs($q->eval(x=>$i+0.5));} + +$ymax = max(@vals); +$p = $q/$ymax*5; + +$ymax = 10; + +$horshift = non_zero_random(-4,4,2); +$vershift = non_zero_random(-5,5,10); +$horscale = 2; + +$f[1] = $p->substitute(x=>Formula("x/$horscale")); +$f[7] = $p->substitute(x=>Formula("x+$horshift")); +$f[2] = $p->substitute(x=>Formula("x-$horshift")); +$f[3] = $p+$vershift; +$f[4] = $p-$vershift; +$f[0] = $p; +$f[6] = Compute("$c*(x-$r[0])*(x-$r[1])*(x-$r[2])/$ymax*5")->reduce; +$f[5] = -$p; +$f[8] = -($p->substitute(x=>Formula("x+$horshift"))); +$f[9] = Compute("abs((x-$r[0])*(x-$r[1])*(x-$r[2])/$ymax*5)")->reduce; +$f[10] = $p->substitute(x=>Formula("-$horscale*x")); +$f[11] = -($p->substitute(x=>Formula("x/$horscale"))); + +$xmin = -10; #The viewing window +$xmax = 10; +$ymin = -$ymax; +$ymax = $ymax; + + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<16; $i++ ) { + + +# Background +$size = 220; + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,10],axes=>[0,0],pixels=>[$size,$size]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (2,4,6,8) { +# $graphs[$i]->lb( new Label(-9.7, $j, $j,'black','center','middle')); +# $graphs[$i]->lb( new Label(-9.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j, 0, $j,'black','center','top')); + $graphs[$i]->lb( new Label( -$j, 0, "-$j",'black','center','top')); + } + $graphs[$i]->lb( new Label(9.7,0,'x','black','center','top')); + $graphs[$i]->lb( new Label(0.2,0.95*$ymax,'y','black','left','middle')); + + +add_functions($graphs[$i], "$f[$i] for x in <-10,10> " . + "using color:blue and weight:2"); +($graphs[$i]->fn)[0]->steps(200); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(12); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4 5 6 7 8 9 10 11 12)], $zero+1 ); + + +############################################## + +BEGIN_PGML +On paper, sketch the graph of [`f`], where [`f(x)=[$q]`]. (During exams, you may be required to actually sketch graphs, and cannot rely on multiple choices.) Once you have your graph, find it among these choices. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +["${BBOLD}1.$EBOLD".image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}2.$EBOLD".image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}3.$EBOLD".image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'),], +["${BBOLD}4.$EBOLD" .image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}5.$EBOLD".image(insertGraph( $graphs[ $shuffle->{4} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}6.$EBOLD".image(insertGraph( $graphs[ $shuffle->{5} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'),], +["${BBOLD}7.$EBOLD".image(insertGraph( $graphs[ $shuffle->{6} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}8.$EBOLD" .image(insertGraph( $graphs[ $shuffle->{7} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}9.$EBOLD".image(insertGraph( $graphs[ $shuffle->{8} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'),], +["${BBOLD}10.$EBOLD".image(insertGraph( $graphs[ $shuffle->{9} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}11.$EBOLD".image(insertGraph( $graphs[ $shuffle->{10} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"${BBOLD}12.$EBOLD" .image(insertGraph( $graphs[ $shuffle->{11} ] ), tex_size=>100, height=>$size, width=>$size, extra_html_tags=>'alt="graph"') ], +], +allcellcss => "padding:5pt;", +)\} + +END_TEXT + + +BEGIN_PGML + The correct graph is graph [@$pop->menu() @]*. + +END_PGML + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$dir = ($c>0) ? "an upward" : "a downward"; + +BEGIN_PGML_SOLUTION + +The formula tells us that the zeros are at [`[@$r[0]@]`], [`[@$r[1]@]`], and [`[@$r[2]@]`]. The formula also tells us that [`[@$r[0]@]`] is a degree three zero, [`[@$r[1]@]`] is a degree one zero, and [`[@$r[2]@]`] is a degree two zero. So when the graph reaches the [`x`]-intercept at [`([@$r[0]@],0)`], it will pass through the [`x`]-axis in a serpentine way similar to how [`y=x^3`] passes through it. When the graph reaches the [`x`]-intercept at [`([@$r[1]@],0)`], it will pass through the [`x`]-axis in a way similar to how a straight line would pass through. And when it reaches the [`x`]-intercept at [`([@$r[2]@],0)`], it will behave similar to the vertex of a parabola, and turn around. + +Also, the leading coefficient is [`[$c]`], which tells us that the right arm of the graph should point in [$dir] direction. We use all this to sketch a graph that looks like graph [@$zero+1@]. + +END_PGML_SOLUTION +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials29.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials29.pg new file mode 100644 index 0000000000..67916213e1 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials29.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", + +); +TEXT(beginproblem()); + + + +############################################## + + +Context("Numeric"); + +$r[0] = random(-8,-2,1); +for my $i (1,2) +{ +$r[$i] = $r[$i-1]+random(2,4,1); +} + +Context("Fraction"); +do {$den = random(2,10,1)} until ($den != 6); +$c = Fraction(6,$den); + + +Context("Numeric"); +$p = Compute("(x-$r[0])*(x-$r[1])*(x-$r[2])")->reduce; +Context()->flags->set(reduceConstants=>0); +$p = Compute("$c*$p"); + +$d = $p->D; + +for my $i (0..2) +{ +$slope[$i] = $d->eval(x=>$r[$i]); +} + + +############################################## + +BEGIN_PGML + +Suppose that [`f`] is given by [`f(x)=[$p]`]. + +Find the slope of the curve [`y=[$p]`] at each of the zeros of [`f`]. +END_PGML + +BEGIN_TEXT +$PAR +\{ +DataTable([ +[["zero",headerrow=>1],"slope"], +["$r[0]",ans_rule(10)], +["$r[1]",ans_rule(10)], +["$r[2]",ans_rule(10)], +], +allcellcss=>"border: solid 1px;", +) +\} +END_TEXT + +############################################## + +$showPartialCorrectAnswers = 0; + +for my $i (0..2) +{ +ANS( $slope[$i]->cmp() ); +} + +############################################## + +$r0 = $r[0]; +$r1 = $r[1]; +$r2 = $r[2]; + +Context()->variables->add(y=>'Real'); +$p0 = Compute("(x-$r[0])*(y-$r[1])*(y-$r[2])")->reduce; +$p1 = Compute("(y-$r[0])*(x-$r[1])*(y-$r[2])")->reduce; +$p2 = Compute("(y-$r[0])*(y-$r[1])*(x-$r[2])")->reduce; + +$f0 = Compute("(x-$r[0])")->reduce; +$f1 = Compute("(x-$r[1])")->reduce; +$f2 = Compute("(x-$r[2])")->reduce; + +BEGIN_PGML_SOLUTION + +Each of the three zeros is a degree one zero. So we can determine the slope at each zero by preserving that zero's corresponding factor, and substituting in the zero in other factors. + +At [`x=[$r0]`], + + [`\begin{aligned} +[$p] &\longrightarrow [$c][@$p0->substitute(y=>Formula("$r0"))->TeX@] += [@$slope[0]@]([$f0])\\ +\end{aligned}`] + +So the slope at [`x=[$r0]`] is [`[@$slope[0]@]`]. Basically, this has told us that for [`x`]-values close to [`[$r0]`], our function is very much like [`[@$slope[0]@]([$f0])`], which is a line with slope [`[@$slope[0]@]`] that has been shifted to cross the [`x`]-axis at [`[$r0]`]. + +At [`x=[$r1]`], + + [`\begin{aligned} +[$p] &\longrightarrow [$c][@$p1->substitute(y=>Formula("$r1"))->TeX@] += [@$slope[1]@]([$f1])\\ +\end{aligned}`] + +So the slope at [`x=[$r1]`] is [`[@$slope[1]@]`]. + +At [`x=[$r2]`], + + [`\begin{aligned} +[$p] &\longrightarrow [$c][@$p2->substitute(y=>Formula("$r2"))->TeX@] += [@$slope[2]@]([$f2])\\ +\end{aligned}`] + +So the slope at [`x=[$r2]`] is [`[@$slope[2]@]`]. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials3.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials3.pg new file mode 100644 index 0000000000..676bfece24 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials3.pg @@ -0,0 +1,36 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); +TEXT(beginproblem()); + + + +$a = random(2,4); +$b = list_random(-5-4,-3,-2,2,3,4,5); +$c = non_zero_random(-6,6); +$k = random(1,3); + +BEGIN_TEXT +Define a function +\[ p(x) = $a x^2 + $b x + $c. \] +Find and simplify the given expression. + +$PAR +\(\displaystyle \frac{p($k + x) - p($k)}{x} = \) \{ans_rule(35)\}, \(x \neq 0\) + +END_TEXT +$q = 2*$a*$k + $b; + +$ans = "$a*x + $q"; + +ANS(fun_cmp($ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials30.pg new file mode 100644 index 0000000000..ac81ce756e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials30.pg @@ -0,0 +1,140 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl", + +); +TEXT(beginproblem()); + + + +############################################## + + +Context("Numeric"); + +$a[0] = non_zero_random(-8,8,2); +$a[1] = random(-7,7,2); +$r[1] = $a[1]; + +Context("Fraction"); +$r[0] = Fraction($a[0],3); +do {$den = random(2,10,1)} until ($den != 6); +$c = Fraction(6,$den); + + + +Context("Numeric"); +$p = Compute("(3*x-$a[0])*(x-$a[1])**2")->reduce; +Context()->flags->set(reduceConstants=>0); +$p = Compute("$c*$p"); + +$d = $p->D; + +for my $i (0..1) +{ +$slope[$i] = $d->eval(x=>$r[$i]); +} + + + + + + +############################################## + +BEGIN_PGML + +Suppose that [`f`] is given by [`f(x)=[$p]`]. + +Find the slope of the curve [`y=[$p]`] at each of the zeros of [`f`]. +END_PGML + +BEGIN_TEXT +$PAR +\{ +DataTable([ +[["zero",headerrow=>1],"slope"], +["$r[0]",ans_rule(10)], +["$r[1]",ans_rule(10)], +], +allcellcss=>"border: solid 1px;", +) +\} +END_TEXT + +############################################## + +$showPartialCorrectAnswers = 0; + +ANS( $slope[0]->cmp() ); +ANS( $slope[1]->cmp() ); + +############################################## + +$r0 = $r[0]; +$r1 = $r[1]; + +Context()->variables->add(y=>'Real'); +$p0 = Compute("(3*x-$a[0])*(y-$a[1])**2")->reduce; +$p1 = Compute("(3*y-$a[0])*(x-$a[1])**2")->reduce; + +$f0 = Compute("(3x-$a[0])")->reduce; +$c1 = $c*(3*$r1-$a[0]); +$f1 = Compute("(x-$a[1])^2")->reduce; +$f1 = Compute("$c1*$f1"); + +BEGIN_PGML_SOLUTION + +The zero at [`[$r0]`] is a degree one zero. So we can determine the slope there by preserving that zero's corresponding factor, and substituting in the zero elsewhere. + +At [`x=[$r0]`], + + [`\begin{aligned} +[$p] &\longrightarrow [$c][@$p0->substitute(y=>Formula("$r0"))->TeX@] += [@($slope[0]/3)->TeX@]([$f0])\\ +\end{aligned}`] + +So the slope at [`x=[$r0]`] is [`[@($slope[0]/3)->TeX@]\cdot3`], which is [`[@$slope[0]->TeX@]`]. Basically, this has told us that for [`x`]-values close to [`[$r0]`], our function is very much like [`[@($slope[0]/3)->TeX@]([$f0])`], which is a line with slope [`[@$slope[0]->TeX@]`] that has been shifted to cross the [`x`]-axis at [`[$r0]`]. + +The other zero, [`[$r1]`], is a degree two zero. This means that as the curve approaches [`([$r1],0)`], it will behave like the vertex of the parabola and turn around. That means the slope at that point will be [`0`], without any further calculation needed. + +We can do as with did with the first zero anyway, to confirm this. + + [`\begin{aligned} +[$p] &\longrightarrow [$c][@$p1->substitute(y=>Formula("$r1"))->TeX@] += [$f1]\\ +\end{aligned}`] + +This tells us that near [`[$r1]`], the curve is very similar to [`y=[$f1]`], which is the parabola [`y=x^2`] after a shift and a vertical scaling. So at [`x=[$r1]`], the curve behaves like tip of a parabola, and has slope [`0`]. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials4.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials4.pg new file mode 100644 index 0000000000..e132bde7b1 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials4.pg @@ -0,0 +1,39 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +"contextLimitedPolynomial.pl" +); +TEXT(beginproblem()); + + + +$a = random(2,4); +$c = non_zero_random(-6,6); +$k = random(1,3); + +BEGIN_TEXT +Define a function +\[ s(x) = $a x^3 + $c. \] +Find and simplify the given expression. + +$PAR +\(\displaystyle \frac{s($k + x) - s($k)}{x} = \) \{ans_rule(35)\}, \(x \neq 0\) + +END_TEXT +$k1 = 3*$a*$k; +$k2 = 3*$a*($k)**2; + +Context("LimitedPolynomial"); +$ans = Compute("$a*x^2 + $k1*x + $k2 "); + +ANS($ans->cmp()); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials5.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials5.pg new file mode 100644 index 0000000000..5289eaebb7 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials5.pg @@ -0,0 +1,46 @@ +##DESCRIPTION +## Algebra problem: polynomial functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'polynomial function', 'end behavior') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"MathObjects.pl" +); +TEXT(beginproblem()); + + +$showPartialCorrectAnswers = 1; +$showPartialCredit = 1; + +$a = random(2,28,2); +$b = random(2,8,2); +$c = random(2,8,2); + +TEXT(EV2(<cmp()); +ANS($ans->cmp()); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials50.pg new file mode 100644 index 0000000000..2235a99586 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials50.pg @@ -0,0 +1,94 @@ +##DESCRIPTION +## Algebra problem: polynomial functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'polynomial function', 'end behavior') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; +$showPartialCredit = 1; + +############################# + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(2,8,2); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); +$d = non_zero_random(-10,10,1); + +$ex0 = random(6,9,1); +$ex1 = random(2,$ex0-1,1); + +$s = random(-1,1,2); +$a = $s*$a; + +$func = Compute("$a*x**$ex0+$b*x**$ex1+$c*x+$d")->reduce; + +if ($a>0) { + if ($ex0%2==1) { + $ans0 = Compute("-infinity"); + $ans1 = Compute("infinity"); + } else { + $ans0 = Compute("infinity"); + $ans1 = Compute("infinity"); + } +} else { + if ($ex0%2==1) { + $ans0 = Compute("infinity"); + $ans1 = Compute("-infinity"); + } else { + $ans0 = Compute("-infinity"); + $ans1 = Compute("-infinity"); + } +} + +############################# + +BEGIN_PGML + +Given [`P(x)=[$func]`], answer the following questions. + +[@KeyboardInstructions( +"\n".'* Enter [|inf|]* for [`\infty`].' +)@]** + +* As [`x \rightarrow -\infty`], [`P(x) \rightarrow `][________]{$ans0}. + +* As [`x \rightarrow \infty`], [`P(x) \rightarrow `][________]{$ans1}. + +END_PGML + +############################# + +BEGIN_PGML_SOLUTION + +A polynomial's leading term determines its end behaviors. You need to know that: + +* For [`y=x^2`] or other even power, [`y \rightarrow \infty`] as [`x \rightarrow -\infty`] or as [`x \rightarrow \infty`]. + +* For [`y=x^3`] or other odd power, [`y \rightarrow -\infty`] as [`x \rightarrow -\infty`], and [`y \rightarrow \infty`] as [`x \rightarrow \infty`]. + +For [`P(x)=[$func]`], the leading term is [`[$a]x^{[$ex0]}`], so: + +* As [`x \rightarrow -\infty`], [`P(x) \rightarrow [$ans0]`]. + +* As [`x \rightarrow \infty`], [`P(x) \rightarrow [$ans1]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials6.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials6.pg new file mode 100644 index 0000000000..eb86b2545c --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials6.pg @@ -0,0 +1,95 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +); +TEXT(beginproblem()); + +################################################## + +$showPartialCorrectAnswers = 1; +$showPartialCredit = 1; + +$a = random(1,6,2); +$b = random(7,12,2); +##$d x(x+$a)(x-$b) +$d=non_zero_random(-1,1,1); +$b1=$d*($a-$b); +$c1=$d*(-$a*$b); + +################################################## + +Context("Numeric"); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); +$P=Formula("$d x^3 + $b1 x^2 + $c1 x")->reduce; +$Pfactored = Formula("$d x(x+$a)(x-$b)")->reduce; +$L = Formula("$d x^3 ")->reduce; + +$f = RandomVariableName(type=>'function'); + +################################################## +BEGIN_PGML + +Given the function [`[$f]`] defined by [`[$f](x)=[$P]`], find the following: + +a) The [`x`]- and [`y`]-intercepts of the graph of [`[$f]`]. *Note:* intercepts are _points_, not simple numbers. + + The [`y`]-intercept is [__________]. + + The [`x`]-intercepts are [__________] (If there is more than one, enter as a comma-separated list; for example [|(1,2), (2,3)|] ) + +a) The end behavior of the graph of [`[$f]`]. If you need to enter [`\infty`] you can type *inf*. + + [`[$f](x)\to{}`][__________] as [`x\to -\infty`] + [`[$f](x)\to{}`][__________] as [`x\to \infty`] + +END_PGML + +################################################## + +Context()->normalStrings; + +$leftlimit = Compute("-infinity"); +if ($d != 1) {$leftlimit = Compute("infinity");} +$rightlimit = Compute("infinity"); +if ($d != 1) {$rightlimit = Compute("-infinity");} + +Context("Point"); + +$xint1 = Point("(0,0)"); +$xint2 = Point("(-$a,0)"); +$xint3 = Point("($b,0)"); +$yint = Point("(0,0)"); + +ANS($yint->cmp); +ANS(List($xint1, $xint2, $xint3)->cmp); +ANS($leftlimit->cmp()); +ANS($rightlimit->cmp()); + +################################################## + +BEGIN_PGML_SOLUTION + +a) The [`y`]-intercept can be found by evaluating [`[$f](0)`], which is [`0`]. So the [`y`]-intercept is [`[$yint]`]. + + To find the [`x`]-intercept(s), we need to solve the equation + [`\begin{aligned} +[$f](x) & = 0\\ +[$P] & = 0\\ +[$Pfactored] &= 0\\ +x&=0&&\text{or}&x&=-[$a]&&\text{or}&x&=[$b] +\end{aligned}`] + So the [`x`]-intercepts are [`[$xint1]`], [`[$xint2]`], and [`[$xint3]`]. + +a) The end behavior of [`[$f]`] is the same as that of its leading term, [`[$L]`]. + + As [`x\to -\infty`], [`[$f](x)\to[$leftlimit]`]. + And as [`x\to \infty`], [`[$f](x)\to[$rightlimit]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials7.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials7.pg new file mode 100644 index 0000000000..65e2b4dcf7 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials7.pg @@ -0,0 +1,99 @@ +##DESCRIPTION +## Algebra problem: polynomial functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'polynomial function', 'graph') + + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"Parser.pl", +"MathObjects.pl", +); +TEXT(beginproblem()); + + +$showPartialCorrectAnswers = 1; + +$a = random(1,8,2); +$b = random(2,8,2); +##x^2(x+$a)(x-$b) + +$d=non_zero_random(-1,1,1); +$b1=($a-$b)*$d; +$c1=(-$a*$b)*$d; + +$p="P(x)= $d x^4 "; +if ($b1 != 0) + { + $p=$p."? {$b1} x^3 "; + }; +if ($c1 != 0) + { + $p=$p."? {$c1} x^2 "; + }; + +Context("Numeric"); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); +$q = Formula("$d x^4+$b1 x^3+{$c1} x^2")->reduce; + +#P(x)=x^4 ? {$b1} x^3 ? {$c1} x^2 +Context()->texStrings; +TEXT(EV2(<normalStrings; +$limit = Compute("infinity"); +if ($d !=1) {$limit= Compute("-infinity");} + +Context("Point"); + +$xint1 = Point("(0,0)"); +$xint2 = Point("(-$a,0)"); +$xint3 = Point("($b,0)"); +$yint = Point("(0,0)"); + +ANS($yint->cmp); +ANS(List($xint1, $xint2, $xint3)->cmp); +ANS($limit->cmp()); +ANS($limit->cmp()); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials8.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials8.pg new file mode 100644 index 0000000000..8a68926d6e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials8.pg @@ -0,0 +1,50 @@ +##DESCRIPTION + + +##KEYWORDS('algebra') +## Type: evaluation +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros("PG.pl", "PGbasicmacros.pl", "PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"extraAnswerEvaluators.pl"); + +TEXT(beginproblem()); +install_problem_grader(~~&std_problem_grader); + +$showPartialCredit = 1; +$showPartialCredit = 1; + + + +# output the text of the problem + +$a = random(2,9,1); +$b = random(2,9,1); +$co1 = 2*$a+$b; +$co2 = $a*($a+$b); + +TEXT(EV2(<noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$x0 = random(1,5,1); +$x1 = -$x0; +do {$x2 = random(1,5,1);} until ($x2 != $x1); +$x3 = -$x2; + +$x02 = $x0**2; +$x22 = $x2**2; + +$b = -$x22-$x02; +$c = $x02*$x22; + +$func = Compute("x**4+$b*x**2+$c")->reduce; +$ans = List($x0,$x1,$x2,$x3); + +############################# + +BEGIN_PGML + +Find all real zeroes of [`` f(x) = [$func] ``]. + +[@KeyboardInstructions( +"\n".'* If there is more than one answer, enter them separated by a comma, like [`1, 2`].' +)@]** + + [`x=`][______________________]{$ans} + +END_PGML + +############################# + +$s1 = Compute("x**2-$x02")->reduce; +$s2 = Compute("x**2-$x22")->reduce; + +BEGIN_PGML_SOLUTION + +To find zeroes of [`f(x)`], we solve for [`x`] in [`f(x)=0`]. + + [``\begin{aligned} + [$func] &= 0 \\ + ([$s1])([$s2]) &= 0 \\ + (x-[$x0])(x-[$x1])(x-[$x2])(x-[$x3]) &= 0 \\ + x &= [$x0] \text{ or } [$x1] \text{ or } [$x2] \text{ or } [$x3] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials9.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials9.pg new file mode 100644 index 0000000000..a8c11fef5f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Polynomials9.pg @@ -0,0 +1,95 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('Algebra', 'Functions','Polynomial') +## Tagged by LD + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Polynomial') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +################################################ + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"PGcourse.pl", +); +TEXT(beginproblem()); + +################################################ + +$showPartialCorrectAnswers = 0; + +do {$a = random(2,10);} until(($a != 4) && ($a != 9)); +##x(x+sqrt($a))^2(x-sqrt($a))^2 +$b1=-2*$a; +$c1=$a*$a; + +Context("Numeric")->noreduce('(-x)+y', '(-x)-y'); +$f = Formula("x^5 + {$b1} x^3 + {$c1} x")->reduce; + +$fn = RandomVariableName(type=>'function'); + +################################################ + +BEGIN_PGML + +For the function [`[$fn]`] defined by + + [``[$fn](x) = [$f]``] + +find all distinct real zeros and enter them as a comma separated list. If there +are no real zeros, enter the word *none*. You should be capable of finding any and all zeros for this function without using a calculator. + + The distinct real zeros are [_____________________]. + +END_PGML + +$ans1 = 0; +$ans2 = -sqrt($a); +$ans3 = sqrt($a); + +################################################ + +Context()->flags->set(reduceConstantFunctions =>0); +ANS(List(Formula("-sqrt($a)"), Formula("0"),Formula("sqrt($a)"))->cmp); + +################################################ + +$g = Formula("x^4 + {$b1} x^2 + {$c1}")->reduce; +$h = Formula("x^2 - {$a}")->reduce; + +BEGIN_PGML_SOLUTION + +To find the zeros of a function [`[$fn]`], we set out to solve the equation [`[$fn]=0`]. With this particular function, we are able to solve without using a calculator. + + [`\begin{aligned} +[$fn](x) &= 0\\ +[$f] &= 0\\ +x\left([$g]\right) &= 0\\ +x\left([$h]\right)^2 &= 0\\ +x&=0&&\text{or}&[$h]&=0\\ +x&=0&&\text{or}&x^2&=[$a]\\ +x&=0&&\text{or}&x&=\sqrt{[$a]}&&\text{or}&x&=-\sqrt{[$a]}\\ +\end{aligned}`] + +So the zeros are: [`-\sqrt{[$a]}, 0, \sqrt{[$a]}`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_103.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_103.pg new file mode 100644 index 0000000000..cd5dd52a94 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_103.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", +); + + + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); + +$a[0] = random(-5,-1,1); +$a[1] = $a[0]+random(1,5,1); +$a[2] = $a[1]+random(1,5,1); + +$m[0] = random(2,3,1); +$m[1] = random(1,2,1); +$m[2] = 1; + +$d = non_zero_random(-10,10,1); + +$denominator = (-$a[0])**($m[0])*(-$a[1])**($m[1])*(-$a[2])**($m[2]); + +while ($denominator == 0) +{$a[0] = random(-5,-1,1); +$a[1] = $a[0]+random(1,5,1); +$a[2] = $a[1]+random(1,5,1); + +$m[0] = random(2,3,1); +$m[1] = random(1,2,1); +$m[2] = 1; + +$d = non_zero_random(-10,10,1); + +$denominator = (-$a[0])**($m[0])*(-$a[1])**($m[1])*(-$a[2])**($m[2]);} + +$e = Fraction("$d","$denominator"); + +#Context("Numeric"); + +$f = Formula("$e (x-$a[0])^($m[0])(x-$a[1])^($m[1])(x-$a[2])^($m[2])")->reduce; + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Construct a polynomial function with the following characteristics: + +$PAR + +\{ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow(["\($a[0]\) is a zero with multiplicity \($m[0]\)."], align=>LEFT, separation=>0). +AlignedRow(["\($a[1]\) is a zero with multiplicity \($m[1]\)."], align=>LEFT, separation=>0). +AlignedRow(["\($a[2]\) is a zero with multiplicity \($m[2]\)."], align=>LEFT, separation=>0). +AlignedRow(["The \(y\)-intercept is \($d\)."], align=>LEFT, separation=>0). +EndTable() +\} + + + +$PAR + +$SPACE $SPACE $SPACE \(f(x) = \) $SPACE \{ans_rule(40)\} + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + +$s1 = Compute("(x-$a[1])**$m[1]")->reduce; +if ($m[1]==1) {$s1 = "(".$s1->TeX.")";} +$s2 = Compute("(x-$a[2])**$m[2]")->reduce; +$s3 = $m[1]==1 ? "" : "^{$m[1]}"; + +ANS( $f->cmp() ); + +BEGIN_PGML_SOLUTION + +Since [$a[0]] is a zero with multiplicity [$m[0]], [`(x-[$a[0]])^{[$m[0]]}`] is a factor. + +Similarly, [`[$s1]`] and [`([$s2])`] are factors. + +Now we have [`f(x)= a(x-[$a[0]])^{[$m[0]]}[$s1]([$s2])`]. + +It's given that the [`y`]-intercept is [`[$d]`], we can substitute in [`x=0`] and [`y=[$d]`], and we have: + + [``\begin{aligned} + f(x) &= a(x-[$a[0]])^{[$m[0]]}[$s1]([$s2]) \\ + [$d] &= a(0-[$a[0]])^{[$m[0]]}(0-[$a[1]])[$s3](0-[$a[2]]) \\ + [$d] &= [$denominator]a \\ + [$e] &= a + \end{aligned}``] + +The function is [`f(x)=[$f]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_120.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_120.pg new file mode 100644 index 0000000000..55f4495ed0 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_120.pg @@ -0,0 +1,178 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + "parserRadioButtons.pl", + "PGML.pl", + "PGcourse.pl", +); + + + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); + +$a = random(2,3,1); +$b = $a+random(1,3,1); +$c = $b+random(1,2,1); + +$zeropower = list_random(0,1,2); +$deg = 6+$zeropower; +$turn = $deg-1; + +$s = random(-1,1,2); + + +Context("Numeric"); + +$f = Compute("$s*x^($zeropower)*(x+$c)(x+$b)(x+$a)(x-$a)(x-$b)(x-$c)"); + + +$xmax = $c+1; +$xmin = -$xmax; +$ymax = $c**($z+2)*($b)**2*abs($c**2-$a**2); +$ymin = -$ymax; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +size=>[400,400]); + + + + + +add_functions($gr, "$f for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); + +if ((-1)**$zeropower == 1) +{$degree = "even";} +else {$degree = "odd";}; + +$radiodegree = RadioButtons( + ["even","odd"], + "$degree", # correct answer + last => ["even","odd"] +); + + +if ($s == 1) +{$lead= "positive";} +else {$lead = "negative";}; + +$radiolead = RadioButtons( + ["positive","negative"], + "$lead", # correct answer + last => ["positive","negative"] +); + +if ((-1)**$zeropower == 1) +{$sym = "even symmetry";} +else {$sym = "odd symmetry";}; + +$radiosym = RadioButtons( + ["even symmetry","odd symmetry","neither"], + "$sym", # correct answer + last => ["even symmetry","odd symmetry","neither"] +); + +$n = 6+$zeropower; + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Here is the graph of a polynomial function. + +$PAR + +$BCENTER +\{ image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) \} +$ECENTER + + +$PAR + +$BBOLD (a.)$EBOLD The degree of the polynomial is $BR \{ $radiodegree->buttons() \}. + +$PAR + +$BBOLD (b.)$EBOLD The leading coefficient is $BR \{ $radiolead->buttons() \}. + +$PAR + +$BBOLD (c.)$EBOLD The function has $BR \{ $radiosym->buttons() \}. + +$PAR + +$BBOLD (d.)$EBOLD What is the minimum possible degree of the polynomial? \{ ans_rule(10)\} + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + +ANS( $radiodegree->cmp() ); +ANS( $radiolead->cmp() ); +ANS( $radiosym->cmp() ); +ANS( Compute("$n")->cmp() ); + +############################################## + +$s1 = ($deg%2==0) ? 'the same infinity' : 'opposite infinities'; +if ($s>0) { + $s2 = ($deg%2==0) ? '\infty' : '-\infty'; + $s3 = 'positive'; +} else { + $s2 = ($deg%2==0) ? '-\infty' : '\infty'; + $s3 = 'negative'; +} + +BEGIN_PGML_SOLUTION + +###Part a + +When [`x \rightarrow -\infty`] and [`x \rightarrow \infty`], the function is approaching [$s1], implying the function has [$degree] degrees. + +###Part b + +Recall the end behaviors of [`y=x^2`] and [`y=x^3`]. + +Since the function has [$degree] degrees, and [`y \rightarrow [$s2]`] as [`x \rightarrow -\infty`], we can tell the leading coefficient is [$s3]. + +###Part c + +By the graph, the function has [$sym]. + +###Part d + +The function's graph has [`[$turn]`] turns, implying its minimum degree is [`[$deg]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_49.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_49.pg new file mode 100644 index 0000000000..51cd2ea10d --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_49.pg @@ -0,0 +1,136 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "PGML.pl", + "parserMultiAnswer.pl", + "PGcourse.pl", +); + + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); + +$a = non_zero_random(-8,8,1); +$b = random(1,10,1); +$c = random(1,8,1)+$b; + +$f = Formula("$a (x-$b)(x-$c)^2"); + +$zeros = List("$b,$c,$c"); + +$crosses = "crosses"; +$touches = "touches"; + +Context()->strings->add("crosses"=>{},"touches"=>{}); + +$multians = MultiAnswer(Compute("$b"), Compute("1"),Compute("$crosses"),Compute("$c"), Compute("2"),Compute("$touches"))->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $r1stud, $m1stud, $b1stud, $r2stud, $m2stud, $b2stud ) = @{$student}; + my ( $r1cor, $m1cor, $b1cor, $r2cor, $m2cor, $b2cor ) = @{$correct}; + if ( ($r1stud == $r1cor && $m1stud == $m1cor && $b1stud == $b1cor && $r2stud == $r2cor && $m2stud == $m2cor && $b2stud == $b2cor) || + ($r1stud == $r2cor && $m1stud == $m2cor && $b1stud == $b2cor && $r2stud == $r1cor && $m2stud == $m1cor && $b2stud == $b1cor) ) { + return 1;} + else {return 0;}; + + } +); + +if ($a > 0) +{$right = Compute("INF"); +$left = Compute("-INF"); +$rdir = 'an upward'; +$ldir = 'a downward';} +else {$right = Compute("-INF"); +$left = Compute("INF"); +$ldir = 'an upward'; +$rdir = 'a downward'; +}; + + + + +############################################## + +BEGIN_PGML + +Let [`f(x)=[$f]`]. + + +Fill out the table below. In the third column, type the word *crosses* for a zero where the curve crosses through to the other side of the [`x`]-axis, or *touches* for a zero where the curve approaches the [`x`]-axis, touches it, and reverses direction without crossing over it. + +END_PGML +BEGIN_TEXT +$PAR + +\{ +DataTable([ +[["zero",headerrow=>1],"multiplicity","crosses or touches the \(x\)-axis"], [$multians->ans_rule(5),$multians->ans_rule(5),$multians->ans_rule(15)], [$multians->ans_rule(5),$multians->ans_rule(5),$multians->ans_rule(15)], +], +allcellcss=> 'border: solid 1px;', +) +\} + +$PAR +END_TEXT + +BEGIN_PGML + +What is the number of turning points of the graph of [`f`]? (A turning point is a point where the curve changes from increasing to decreasing, or from decreasing to increasing.) + + [________________________] + +As [`x\to\infty,\quad f(x)\to{}`][______________] + +As [`x\to-\infty,\quad f(x)\to{}`][______________] + + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + + +ANS( $multians->cmp() ); +ANS( Compute("2")->cmp() ); +ANS( $right->cmp() ); +ANS( $left->cmp() ); + +############################################## + +$lt = Compute("$a x^3")->reduce; + +BEGIN_PGML_SOLUTION + +The zero at [`[$b]`] has degree [`1`], and since this is odd, the curve crosses the [`x`]-axis there. + +The zero at [`[$c]`] has degree [`2`], and since this is even, the curve touches the [`x`]-axis there and turns around. + +We can now sketch a rough graph of [`f`], and see that there would have to be [`2`] turning points (one in between [`[$b]`] and [`[$c]`], and one _at_ [`[$c]`]). + +Since the leading term is [`[$lt]`], the long-term behavior of the graph on the right is [$rdir] pointing arm. So as [`x\to\infty,\quad f(x)\to[$right]`]. + +And the long-term behavior of the graph on the left is [$ldir] pointing arm. So as [`x\to-\infty,\quad f(x)\to[$left]`]. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_61.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_61.pg new file mode 100644 index 0000000000..e5233bbbf2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_61.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + + +); + + + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); + +$a = random(1,4,1); +$b = random(1,3,1); +$c = random(2+$b,5,1); + +$d = non_zero_random(-3,3,1); + +$e = Fraction("$d","$a*$b*$c"); + +Context("Numeric"); + +$f = Compute("$e (x+$a)(x-$b)(x-$c)"); + + +$xmax = 5; +$xmin = -$xmax; +$ymax = $xmax; +$ymin = $xmin; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[10,10], +size=>[400,400]); + + + + + +add_functions($gr, "$f for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Construct a polynomial function that might have the given graph. + +$PAR + +$BCENTER +\{ image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) \} +$ECENTER + + +$PAR + +$SPACE $SPACE $SPACE \(f(x) = \) $SPACE \{ans_rule(20)\} + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + +ANS( $f->cmp() ); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_97.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_97.pg new file mode 100644 index 0000000000..e40d6b8ef6 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_97.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + "PCCmacros.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); + +$r1 = random(-9,-1,1); +$r2 = random(1,9,1); + +$b = -($r1+$r2); +$c = $r1*$r2; + +Context()->reductions->set("(-x)+y"=>0,"(-x)-y"=>0); + +$f = Compute("x^3+$b x^2+$c x")->reduce; + +$fn = RandomVariableName(type=>function); + +############################################## + +BEGIN_PGML + +Let [`[$fn](x)=[$f]`]. + +a. What are the zeros of [`[$fn]`]? Give your answer as a comma-separated list. + + [___________________________] + +a. What is [`\lim\limits_{x\to\infty}[$fn](x)`]? This is another way of asking "as [`x\to\infty,\quad [$fn](x)\to{} ?`]" If you need to enter [`\infty`], type *INF*. + + [_____] + +a. What is [`\lim\limits_{x\to-\infty}[$fn](x)`]? This is another way of asking "as [`x\to-\infty,\quad [$fn](x)\to{} ?`]" If you need to enter [`\infty`], type *INF*. + + [_____] + + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + + +ANS( List("$r1,0,$r2")->cmp() ); +ANS( Compute("INF")->cmp() ); +ANS( Compute("-INF")->cmp() ); + +############################################## +$s = Compute("x^2+$b x+$c")->reduce; + +BEGIN_PGML_SOLUTION + +a. To find the zeros of [`[$fn]`], we try to factor it. + + [`\begin{aligned} +[$fn](x) &= [$f]\\ +&= x\left([$s]\right)\\ +&= x(x-[$r1])(x-[$r2]) +\end{aligned}`] + + So the zeros are [`[$r1]`], [`0`], [`[$r2]`]. + +a. Since the leading term is [`x^3`], the long-term behavior of the graph on the right is an upward pointing arm. So as [`x\to\infty,\quad [$fn](x)\to\infty`]. In other words, [`\lim\limits_{x\to\infty}[$fn](x)=\infty`]. + +a. Also since the leading term is [`x^3`], the long-term behavior of the graph on the left is an downward pointing arm. So as [`x\to-\infty,\quad [$fn](x)\to-\infty`]. In other words, [`\lim\limits_{x\to-\infty}[$fn](x)=-\infty`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_a.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_a.pg new file mode 100644 index 0000000000..7c80171bb3 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_a.pg @@ -0,0 +1,62 @@ +# WeBWorK problem written by Alex Jordan an Debbie Neft +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(2,10,1); +$b = random(2,6,1); + +$answer = Formula("$a x^($b)"); + +$c[0] = random(2,4,1); +$c[1] = $c[0] +random(1,3,1); + +for my $i (0..1) +{$d[$i] = $answer->eval(x=>$c[$i]);}; + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Find a power function \(f\) whose graph passes through the points \(\left($c[0],$d[0]\right)\) and \(\left($c[1],$d[1]\right)\). + +$PAR + +$SPACE $SPACE $SPACE \(f(x) = \) $SPACE\{ ans_rule(15) \} + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + +ANS( $answer->cmp); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes05.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes05.pg new file mode 100644 index 0000000000..c666246401 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes05.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rational function, find its vertical asymptotes +# +# Last update: Carl Yao 04/18/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", + +); + +#################################### + +parser::Assignment->Allow; + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = non_zero_random(-10,10,1); +do {$b = non_zero_random(-10,10,1);} until($b != $a); + +Context()->strings->add("none"); + +$ans = Formula("x=0,x = -$a, x = -$b"); + +$apb = $a+$b; +$ab = $a*$b; + +$den = Compute("x^3+[$apb]x^2+[$ab]x")->reduce; +$denF1 = Compute("x*(x^2+[$apb]x+[$ab])")->reduce; +$denF2 = Compute("x*(x+$a)*(x+$b)")->reduce; + +#################################### + +BEGIN_PGML + +Find the vertical asymptotes of the function [`f`] defined by: + + [``f(x)=\frac{[$a]}{[$den]}``] + +* If there is more than one answer, enter as a comma-separated list. For example, [`x=1,x=2`]. +* Enter *none* if there are no vertical asymptotes. + + The equation(s) of the vertical asymptote(s) of [`f`] is/are [_________________]{$ans} + + +END_PGML + +#################################### + +BEGIN_PGML_SOLUTION + +Factor the denominator: + + [`` +\begin{aligned} + f(x) &= \frac{[$a]}{[$den]} \\ + &= \frac{[$a]}{[$denF1]} \\ + &= \frac{[$a]}{[$denF2]} +\end{aligned} + ``] + +The denominator is [`0`] when [`x=0, -[$a],`] or [`-[$b]`], so the function has vertical asymptotes at [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes06.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes06.pg new file mode 100644 index 0000000000..da9af69432 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes06.pg @@ -0,0 +1,119 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rational function, find its vertical asymptotes +# +# Last update: Carl Yao 04/18/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", + +); + +#################################### + +parser::Assignment->Allow; + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = non_zero_random(-10,10,1); +do {$b = non_zero_random(-10,10,1);} until($b != $a); + +Context()->strings->add("none"); + +$apb = $a+$b; +$ab = $a*$b; + +$c = list_random(0,$a,$b); +$cN = -$c; +$num = Compute("x+$c")->reduce; + +$den = Compute("x^3+[$apb]x^2+[$ab]x")->reduce; +$denF1 = Compute("x*(x^2+[$apb]x+[$ab])")->reduce; +$denF2 = Compute("x*(x+$a)*(x+$b)")->reduce; + +if ($c==0) { + $ans = Formula("x = -$a, x = -$b"); + $denReduced = Compute("(x+$a)*(x+$b)")->reduce; +} elsif ($c==$a) { + $ans = Formula("x = 0, x = -$b"); + $denReduced = Compute("x*(x+$b)")->reduce; +} else { + $ans = Formula("x = -$a, x = 0"); + $denReduced = Compute("x*(x+$a)")->reduce; +} + +#################################### + +BEGIN_PGML + +Find the vertical asymptotes of the function [`f`] defined by: + + [``f(x)=\frac{[$num]}{[$den]}``] + +* If there is more than one answer, enter as a comma-separated list. +* For example, [`x=1,x=2`]. Enter *none* if there are no vertical asymptotes. + + The equation(s) of the vertical asymptote(s) of [`f`] is/are [_________________]{$ans} + + +END_PGML + +#################################### + +BEGIN_PGML_SOLUTION + +Factor the denominator: + + [`` +\begin{aligned} + f(x) &= \frac{[$num]}{[$den]} \\ + &= \frac{[$num]}{[$denF1]} \\ + &= \frac{[$num]}{[$denF2]} +\end{aligned} + ``] + +Then, the function can be reduced to: + + [`` +\begin{aligned} + f(x) &= \frac{[$num]}{[$denF2]} \\ + &= \frac{1}{[$denReduced]} +\end{aligned} + ``] + +Since [`[$num]`] is canceled, there is no vertical asymptote at [`x=[$cN]`]. Instead, there is a hole on the function's graph at [`x=[$cN]`]. + +The denominator in [`\frac{1}{[$denReduced]}`] is [`0`] when [`[$ans]`], so the function has vertical asymptotes at [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes10.pg new file mode 100644 index 0000000000..8b5b8440ec --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes10.pg @@ -0,0 +1,80 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','function','domain') + + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +#################################### + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", + +); + +#################################### + +parser::Assignment->Allow; + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(1,13,1); +do {$b = random(1,10,1);} until($b != $a); +$c = $a**2; +$d = 1/($b**2-$c); + +Context()->strings->add("none"); + +$ans = Formula("x = $a, x = -$a"); + + +#################################### + +BEGIN_PGML + +Find the vertical asymptotes of the function [`f`] defined by: + + [`` f(x)=\frac{x-[$b]}{(x-[$b])(x^2-[$c])}``] + +* If there is more than one answer, enter as a comma-separated list. For example, [`x=1,x=2`]. +* Enter *none* if there are no vertical asymptotes. + + The equation(s) of the vertical asymptote(s) of [`f`] is/are [_________________]{$ans} + + +END_PGML + +#################################### + +BEGIN_PGML_SOLUTION + +The domain of [`f`] is all [`x`]-values except [`[$b]`], [`[$a]`], and [`-[$a]`]. Since the factor [`(x-[$b])`] appears with equal multiplicity in the numerator and denominator, there is a hole at [`x=[$b]`], not an asymptote. + +Since the factors [`(x-[$a])`] and [`(x+[$a])`] appear with higher multiplicity in the denominator than they do in the numerator, there are vertical asymptotes at [`[$ans]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes15.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes15.pg new file mode 100644 index 0000000000..e519aa5844 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes15.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rational function, find its horizontal asymptotes +# +# Last update: Carl Yao 04/18/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", + +); + +######################################### + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$d = non_zero_random(-5,5,1); +$ansy = non_zero_random(-5,5,1); +$a = $d*$ansy; +$b = non_zero_random(-15,15,1); +$c = non_zero_random(-15,15,1); +$e = non_zero_random(-15,15,1); +$f = non_zero_random(-15,15,1); + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); + +do { + $ed1 = random(1,3,1); + $ed2 = random($ed1+1,$ed1+3,1); + $en1 = random(1,3,1); + $en2 = $ed2; +} until ($en2>$en1); + +$func = Formula("($a x^$en2 + $b x^$en1 + $c)/($d x^$ed2 + $e x^$ed1 + $f)")->reduce; + +parser::Assignment->Allow; + +Context()->strings->add("none"); +Context()->variables->add(y=>'Real'); + +$ans = Formula("y = $ansy"); + +######################################### + +BEGIN_PGML + +Find the horizontal asymptote(s) of the function [`f`] defined by: + + [``f(x)=[$func] ``] + +* If there is more than one answer, enter as a comma-separated list. For example, [`y=1,y=2`]. +* Enter *none* if there are no horizontal asymptotes. + + The equation(s) of the horizontal asymptote(s) is/are [___________]{$ans}. + +END_PGML + +######################################### + +BEGIN_PGML_SOLUTION + +Since the numerator and denominator have the same degree, the leading coefficients determine the horizontal asymptote: + + [`` +\begin{aligned} + y &=\frac{[$a]}{[$d]} \\ + y &=[$ansy] +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes16.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes16.pg new file mode 100644 index 0000000000..32ca4c5d50 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes16.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rational function, find its horizontal asymptotes +# +# Last update: Carl Yao 04/18/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", + +); + +######################################### + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +do { + $c = random(2,5,1); + $d = random(2,5,1); + $cd = $c*$d; + $ansy = non_zero_random(-3,3,1); + $ab = $cd*$ansy; + $a = random(2,10,1); + $b = $ab/$a; +} until ( ($b==int($b)) && ($a!=$c) ); + +$a1 = non_zero_random(-3,3,1); +$b1 = non_zero_random(-3,3,1); +$c1 = non_zero_random(-3,3,1); +$d1 = non_zero_random(-3,3,1); + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); + +$ed = random(1,3,1); +$en = $ed; +$func = Formula("($a x^$en + $a1)*($b x^$en + $b1)/( ($c x^$ed + $c1)*($d x^$ed +$d1) )")->reduce; + +parser::Assignment->Allow; + +Context()->strings->add("none"); +Context()->variables->add(y=>'Real'); + +$ans = Formula("y = $ansy"); + +######################################### + +BEGIN_PGML + +Find the horizontal asymptote(s) of the function [`f`] defined by: + + [``f(x)=[$func] ``] + +* If there is more than one answer, enter as a comma-separated list. For example, [`y=1,y=2`]. +* Enter *none* if there are no horizontal asymptotes. + + The equation(s) of the horizontal asymptote(s) is/are [___________]{$ans}. + +END_PGML + +######################################### + +$en2 = 2*$en; +$ed2 = 2*$ed; + +BEGIN_PGML_SOLUTION + +Once we FOIL the numerator and denominator, we have: + + [`` +\begin{aligned} + y &=[$func] \\ + y &=\frac{[$ab]x^{[$en2]}+\ldots}{[$cd]x^{[$ed2]}+\ldots} +\end{aligned} + ``] + + +Since the numerator and denominator have the same degree, the leading coefficients determine the horizontal asymptote: + + [`` +\begin{aligned} + y &=\frac{[$ab]}{[$cd]} \\ + y &=[$ansy] +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes20.pg new file mode 100644 index 0000000000..c707c690c2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes20.pg @@ -0,0 +1,87 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','function','domain') + + +## DBsubject('') +## DBchapter('') +## DBsection('') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +######################################### + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", + +); + +######################################### + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = non_zero_random(-15,15,1); +$b = non_zero_random(-15,15,1); +$c = non_zero_random(-15,15,1); +$d = non_zero_random(-15,15,1); +$e = non_zero_random(-15,15,1); +$f = non_zero_random(-15,15,1); + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); + +$en1 = random(1,3,1); +$en2 = random($en1+1,$en1+3,1); +$ed1 = random(1,3,1); +$ed2 = random($en2+1,$en2+3,1); +$func = Formula("($a x^$en2 + $b x^$en1 + $c)/($d x^$ed2 + $e x^$ed1 + $f)")->reduce; + +parser::Assignment->Allow; + +Context()->strings->add("none"); +Context()->variables->add(y=>'Real'); + +$ans = Formula("y = 0"); + +######################################### + +BEGIN_PGML + +Find the horizontal asymptote(s) of the function [`f`] defined by: + + [``f(x)=[$func]``] + +* If there is more than one answer, enter as a comma-separated list. For example, [`y=1,y=2`]. +* Enter *none* if there are no horizontal asymptotes. + + The equation(s) of the horizontal asymptote(s) is/are [___________]{$ans}. + +END_PGML + +######################################### + +BEGIN_PGML_SOLUTION + +Since the denominator has a larger degree, there is a horizontal asymptote at [`y=0`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes21.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes21.pg new file mode 100644 index 0000000000..c1f6f0f35f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes21.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rational function, find its horizontal asymptotes +# +# Last update: Carl Yao 04/18/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", + +); + +######################################### + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,5,1); +$b = non_zero_random(-5,5,1); +$c = non_zero_random(-5,5,1); +$d = non_zero_random(-5,5,1); +$e = non_zero_random(-5,5,1); +$f = non_zero_random(-5,5,1); + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); + +do { + $ed1 = random(1,3,1); + $ed2 = random($en2+1,$en2+3,1); + $en1 = random(1,3,1); + $en2 = random($en1+1,$en1+3,1); +} until ( ($en1+$en2)<($ed1+$ed2) ); + +$func = Formula("$a*(x^$en2 + $b)(x^$en1 + $c) / ( (x^$ed2 + $d)*(x^$ed1 + $e) )")->reduce; + +parser::Assignment->Allow; + +Context()->strings->add("none"); +Context()->variables->add(y=>'Real'); + +$ans = Formula("y=0"); + +######################################### + +BEGIN_PGML + +Find the horizontal asymptote(s) of the function [`f`] defined by: + + [``f(x)=[$func]``] + +* If there is more than one answer, enter as a comma-separated list. For example, [`y=1,y=2`]. +* Enter *none* if there are no horizontal asymptotes. + + The equation(s) of the horizontal asymptote(s) is/are [___________]{$ans}. + +END_PGML + +######################################### + +$en = $en1+$en2; +$ed = $ed1+$ed2; + +BEGIN_PGML_SOLUTION + +If we FOIL the function's numerator and denominator, we have: + + [`` +\begin{aligned} + y &=[$func] \\ + y &=\frac{[$a]x^{[$en]}+\ldots}{x^{[$ed]}+\ldots} +\end{aligned} + ``] + +Since the denominator has a larger degree, the function's horizontal asymptote is [`y=0`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes25.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes25.pg new file mode 100644 index 0000000000..340921428e --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes25.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rational function, find its horizontal asymptotes +# +# Last update: Carl Yao 04/18/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", + +); + +######################################### + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = non_zero_random(-15,15,1); +$b = non_zero_random(-15,15,1); +$c = non_zero_random(-15,15,1); +$d = non_zero_random(-15,15,1); +$e = non_zero_random(-15,15,1); +$f = non_zero_random(-15,15,1); + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); + +$en1 = random(1,3,1); +$en2 = random($en1+1,$en1+3,1); +$ed1 = random(1,3,1); +$ed2 = random($en2+1,$en2+3,1); +$func = Formula("($a x^$ed2 + $b x^$ed1 + $c)/($d x^$en2 + $e x^$en1 + $f)")->reduce; + +parser::Assignment->Allow; + +Context()->strings->add("none"); +Context()->variables->add(y=>'Real'); + +$ans = Formula("none"); + +######################################### + +BEGIN_PGML + +Find the horizontal asymptote(s) of the function [`f`] defined by: + + [``f(x)=[$func]``] + +* If there is more than one answer, enter as a comma-separated list. For example, [`y=1,y=2`]. +* Enter *none* if there are no horizontal asymptotes. + + The equation(s) of the horizontal asymptote(s) is/are [___________]{$ans}. + +END_PGML + +######################################### + +BEGIN_PGML_SOLUTION + +Since the numerator has a larger degree, the function has no horizontal asymptote. Type *none* in the answer field. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes26.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes26.pg new file mode 100644 index 0000000000..6656e0785f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes26.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rational function, find its horizontal asymptotes +# +# Last update: Carl Yao 04/18/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "contextFraction.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", + +); + +######################################### + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,5,1); +$b = non_zero_random(-5,5,1); +$c = non_zero_random(-5,5,1); +$d = non_zero_random(-5,5,1); +$e = non_zero_random(-5,5,1); +$f = non_zero_random(-5,5,1); + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); + +do { + $ed1 = random(1,3,1); + $ed2 = random($en2+1,$en2+3,1); + $en1 = random(1,3,1); + $en2 = random($en1+1,$en1+3,1); +} until ( ($en1+$en2)>($ed1+$ed2) ); + +$func = Formula("$a*(x^$en2 + $b)(x^$en1 + $c) / ( (x^$ed2 + $d)*(x^$ed1 + $e) )")->reduce; + +parser::Assignment->Allow; + +Context()->strings->add("none"); +Context()->variables->add(y=>'Real'); + +$ans = Formula("none"); + +######################################### + +BEGIN_PGML + +Find the horizontal asymptote(s) of the function [`f`] defined by: + + [``f(x)=[$func]``] + +* If there is more than one answer, enter as a comma-separated list. For example, [`y=1,y=2`]. +* Enter *none* if there are no horizontal asymptotes. + + The equation(s) of the horizontal asymptote(s) is/are [___________]{$ans}. + +END_PGML + +######################################### + +$en = $en1+$en2; +$ed = $ed1+$ed2; + +BEGIN_PGML_SOLUTION + +If we FOIL the function's numerator and denominator, we have: + + [`` +\begin{aligned} + y &=[$func] \\ + y &=\frac{[$a]x^{[$en]}+\ldots}{x^{[$ed]}+\ldots} +\end{aligned} + ``] + +Since the numerator has a larger degree, the function doesn't have any horizontal asymptote. Type *none* in the answer field. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes30.pg new file mode 100644 index 0000000000..316643b4e8 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes30.pg @@ -0,0 +1,127 @@ +## DBsubject(Algebra) +## DBchapter(Rational equations and functions) +## DBsection(Graphs of rational functions) +## Institution(Univeristy of Utah) +## Author(Utah ww group) +## Level(2) +## TitleText1('Precalculus') +## AuthorText1('Ron Larson and Robert Hostetler') +## EditionText1('7') +## Section1('.') +## Problem1('') +## KEYWORDS('algebra') + +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"PGchoicemacros.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGML.pl", +"PGcourse.pl", +"parserPopUp.pl", +); + +############################################# + +install_problem_grader(~~&std_problem_grader); +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +$showPartialCredit = 0; + +$popupa = PopUp(["?","red","green","black","blue","yellow"],"black"); +$popupb = PopUp(["?","red","green","black","blue","yellow"],"blue"); +$popupc = PopUp(["?","red","green","black","blue","yellow"],"yellow"); +$popupd = PopUp(["?","red","green","black","blue","yellow"],"red"); +$popupe = PopUp(["?","red","green","black","blue","yellow"],"green"); + +$xmin = -2; +$ymin = -2; +$xmax = -$xmin; +$ymax = -$ymin; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[4,-1], +size=>[400,400] +); + +add_functions($gr, "1/x for x in <$xmin,-0.1>" . + " using color:black and weight:2"); +add_functions($gr, "1/x for x in <0.1,$xmax>" . + " using color:black and weight:2"); + +add_functions($gr, "1/(x^2+1) for x in <$xmin,$xmax>" . + " using color:blue and weight:2"); + +add_functions($gr, "x/(x^2-1) for x in <$xmin,-1.1>" . + " using color:yellow and weight:2"); +add_functions($gr, "x/(x^2-1) for x in <-0.9,0.9>" . + " using color:yellow and weight:2"); +add_functions($gr, "x/(x^2-1) for x in <1.1,$xmax>" . + " using color:yellow and weight:2"); + +add_functions($gr, "x^2/(x^2+1)for x in <$xmin,$xmax>" . + " using color:red and weight:2"); + +add_functions($gr, "x^3/(x^2-1)for x in <$xmin,-1.1>" . + " using color:green and weight:2"); +add_functions($gr, "x^3/(x^2-1)for x in <-0.9,0.9>" . + " using color:green and weight:2"); +add_functions($gr, "x^3/(x^2-1)for x in <1.1,$xmax>" . + " using color:green and weight:2"); + +############################################# + +$refreshCachedImages = 1; + +BEGIN_PGML + +Match the graphs shown with the functions listed below. + +[@EnlargeImageStatementPGML()@]** + +>> [@image( insertGraph($gr), +width=>400,height=>400,tex_size=>800 ) @]* << + + +a) [``f(x) = \frac{1}{x}``] [@$popupa->menu@]* + +a) [``f(x) = \frac{1}{x^2+1}``] [@$popupb->menu@]* + +a) [``f(x) = \frac{x}{x^2-1}``] [@$popupc->menu@]* + +a) [``f(x) = \frac{x^2}{x^2+1}``] [@$popupd->menu@]* + +a) [``f(x) = \frac{x^3}{x^2-1}``] [@$popupe->menu@]* + +END_PGML + +############################################# + +ANS($popupa->cmp()); +ANS($popupb->cmp()); +ANS($popupc->cmp()); +ANS($popupd->cmp()); +ANS($popupe->cmp()); + +############################################# + +BEGIN_PGML_SOLUTION + +The black graph has two asymptotes, the [`x`]- and [`y`]-axes. It's the familiar graph of [`f`] with [`f(x) = \frac{1}{x}`]. + +The red graph has [`y=1`] as a horizontal asymptote, and no vertical asymptotes. The leading terms of numerator and denominator must be equal, and the denominator is never zero. So the red graph is the graph of [`f`] with [`f(x) = \frac{x^2}{x^2+1}`]. + +The green and yellow graphs each have two vertical asymptotes, at [`x=\pm 1`]. So their functions are the ones with the denominator being [`x^2-1`]. The green graph has a slanted asymptote. So the numerator of its function must be of degree one larger than the denominator. The green graph is the graph of [`f`] with [`f(x) =\frac{x^3}{x^2-1}`]. The yellow graph has the [`x`]-axis as an asymptote, it's the graph of [`f`] with [`f(x) = \frac{x}{x^2-1}`]. + +The blue graph has the [`x`]-axis as an asymptote, and there are no vertical asymptotes. It's the graph of [`f`] with [`f(x) = \frac{1}{1+x^2}`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes40.pg new file mode 100644 index 0000000000..b201bb3047 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes40.pg @@ -0,0 +1,115 @@ +## DBsubject(Algebra) +## DBchapter(Rational equations and functions) +## DBsection(Graphs of rational functions) +## Institution(Univeristy of Utah) +## Author(Utah ww group) +## Level(2) +## TitleText1('Precalculus') +## AuthorText1('Ron Larson and Robert Hostetler') +## EditionText1('7') +## Section1('.') +## Problem1('') +## KEYWORDS('algebra') + +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"PGchoicemacros.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGML.pl", +"PGcourse.pl", +"parserPopUp.pl", +); + +############################################# + + +install_problem_grader(~~&std_problem_grader); +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +$showPartialCredit = 0; + + +$popupa = PopUp(["?","red","green","yellow"],"red"); +$popupb = PopUp(["?","red","green","yellow"],"green"); +$popupc = PopUp(["?","red","green","yellow"],"yellow"); + +$xmin = -4; +$ymin = -4; +$xmax = -$xmin; +$ymax = -$ymin; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +size=>[400,400] +); + +foreach my $i (-3..3) { + $gr -> moveTo($i,-0.1); + $gr -> lineTo($i,0.1); + $gr -> lb(new Label ( $i,-0.2, $i,'black','center','middle')); +} + +add_functions($gr, "x/(x-1) for x in <$xmin,0.9>" . + " using color:red and weight:2"); +add_functions($gr, "x/(x-1) for x in <1.1,$xmax>" . + " using color:red and weight:2"); + +add_functions($gr, "x^2/(5*x+5) for x in <$xmin,-1.01>" . + " using color:green and weight:2"); +add_functions($gr, "x^2/(5*x+5) for x in <-0.99,$xmax>" . + " using color:green and weight:2"); + +add_functions($gr, "x/(x^2+1) for x in <$xmin,$xmax>" . + " using color:yellow and weight:2"); + +############################################# + + +$refreshCachedImages = 1; + +BEGIN_PGML + +Match the graphs shown with the functions listed below. + +[@EnlargeImageStatementPGML()@]** + +>> [@image( insertGraph($gr), +width=>400,height=>400,tex_size=>800 ) @]* << + + +a) [``f(x) = \frac{x}{x-1}``] [@$popupa->menu@]* + +a) [``f(x) = \frac{x^2}{5(x+1)}``] [@$popupb->menu@]* + +a) [``f(x) = \frac{x}{x^2+1}``] [@$popupc->menu@]* + + +END_PGML + +############################################# + + +ANS($popupa->cmp()); +ANS($popupb->cmp()); +ANS($popupc->cmp()); + +############################################# + +BEGIN_PGML_SOLUTION + +All of the graphs have a zero at [`x=0`], but the green graph turns around at [`x=0`] and looks like a parabola if we zoomed in. So the green graph must be the graph of [`f`] with [`f(x) = \frac{x^2}{5(x+1)}`]. As further confirmation, the gren graph has a vertical asymptote at [`x=-1`], and this is evident from the factor of [`(x+1)`] in the denominator. + +The red graph has [`x=1`] as a vertical asymptote, so the corresponding function would have [`(x-1)`] as a factor of its denominator. So the red graph must be the graph of [`f`] with [`f(x)=\frac{x}{x-1}`]. + +The yellow graph must be the remaining function, [`f`] with [`f(x)=x/(x^2+1)`]. As confirmation, note that there are no zeros for this function's denominator, and there are no vertical asymptotes in the graph. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes50.pg new file mode 100644 index 0000000000..83bac9ecdb --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes50.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## Rational Functions +## ENDDESCRIPTION + +## KEYWORDS('Algebra' 'Rational Functions') +## Tagged by tda2d + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Rational Functions') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +# +# First comes some stuff that appears at the beginning of every problem +# + +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl" +); + +############################################# +TEXT(beginproblem()); + +# Make sure the average cost (a) begins above $c, (b) dips below $c eventually, and (c) has domain at least [0,inf) +do {$a1 = random(2,4); +$b1 = list_random(4,5,8,10);} until $a1 < $b1; +$a2 = random(2,4); +do {$b2 = random(2,4); +$a3 = random(10,50,5); +$b3 = random(10,50,5);} until $a3 > $b3 && ($b2)**2 - 4*$b1*$b3 < 0; +$c = random(600,800,100); + +Context("Numeric"); +Context()->noreduce('(-x)+y', '(-x)-y'); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(n=>'Real'); + +$f = Formula("$c(($a1 n^2 +$a2 n + $a3)/($b1 n^2 + $b2 n + $b3))")->reduce; + +Context("LimitedNumeric"); +$ans = $c*$a1/($b1); + +############################################# + +BEGIN_PGML + +A bicycle company finds that its average cost per bicycle for producing [`n`] thousand bicycles is [`a(n)`] dollars where + + [``a(n) = [$f]``] + +What will be the approximate cost per bicycle when the company is producing many bicycles? + + The approximate cost per bicycle will be [________________________]{$ans} dollars per bicycle. + +END_PGML + +############################################# + +BEGIN_PGML_SOLUTION + +"When the company is producing many bicycles" suggests that we think of [`n`] as being very large. So the question is asking for the long-term behavior of the function [`a`] as [`n`] gets large. + +Since this is a rational function with the degree of the numerator equal to the degree of the denominator, it has a horizontal asymptote at + + [`y=\frac{\mbox{leading coefficient of numerator}}{\mbox{leading coefficient of denominator}}`] + +So that is at [`y=\frac{[$c]\cdot[$a1]}{[$b1]}`], which is at [`y=[$ans]`]. So in the graph of [`a`], as [`n`] moves farther to the right, [`a(n)`] gets closer to [`[$ans]`]. So the average cost approaches [`[$ans]`] dollars per bicycle. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes60.pg new file mode 100644 index 0000000000..1161fcbe8a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes60.pg @@ -0,0 +1,109 @@ +## DESCRIPTION +## Rational Functions +## ENDDESCRIPTION + +## Tagged by tda2d + +## DBsubject(Algebra) +## DBchapter(Rational equations and functions) +## DBsection(Applications and models) +## Institution(ASU) +## Level(3) +## KEYWORDS('Algebra' 'Rational Functions') +# +# First comes some stuff that appears at the beginning of every problem +# + +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextCurrency.pl", +"PGcourse.pl" +); + +############################################# + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# + +$a = random(6,12); +$b = random(0.2,1,.2); +$c = random(1,5); + +$ans1 = (($a/$c)*1000); +$ans2 = (1/$b*1000); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(t=>'Real'); + +$f = Formula("(t^2 + $a)/($b t^2 + $c)")->reduce; + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(tolerance=>1); + +$ans1c = Currency("$ans1"); +$ans2c = Currency("$ans2"); + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +############################################# + +BEGIN_PGML +A once thriving company had its monthly profits, _in thousands of +dollars_, modeled by the equation + + [``f(t) = [$f]``] + +where [` t `] is in months after June, 2002. Graph this function on your calculator. + +a) Estimate the company's monthly profits for June, 2002. + + The profits for June, 2002 were about [___________]{$ans1c} + +a) Estimate the company's monthly profits many years into the future. + + The monthly profits many years into the future will be about [___________]{$ans2c} + +END_PGML + +############################################# + +BEGIN_PGML_SOLUTION + +a) In June, 2002, we have [`t=0`]. So we evaluate [`f(0)`] and get [`[$ans1/1000]`]. . Note that we have found the [`y`]-intercept of the graph for [`f`]. Since the function is giving outputs in thousands of dollars, the profits that month were [`[$ans1c]`]. + +a) "Many years into the future" suggests we examine the long term behavior of [`f`], as [`t`] becomes large. + + Since this is a rational function with the degree of the numerator equal to the degree of the denominator, it has a horizontal asymptote at + + [`y=\frac{\mbox{leading coefficient of numerator}}{\mbox{leading coefficient of denominator}}`] + + So that is at [`y=\frac{1}{[$b]}`], which is at [`y=[$ans2/1000]`]. So in the graph of [`f`], as [`t`] moves farther to the right, [`f(t)`] gets closer to [`[$ans2/1000]`]. So the monthly profits approach [`[$ans2c]`]. + + + + + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes61.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes61.pg new file mode 100644 index 0000000000..0b42a8b255 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes61.pg @@ -0,0 +1,162 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rational function, find its horizontal asymptote in the context +# of an application. +# +# Last update: Carl Yao 04/30/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextCurrency.pl", +"PGcourse.pl" +); + +############################################# + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0); +Context()->variables->add(t=>'Real'); + +do { + $c = random(0.2,0.9,0.1); + $y4 = random(50,60,5); + $a = $c*$y4; + + $d = random(1,10,1); + $y1 = random(2,8,0.5); + $b = $d*$y1; + + $f = Formula("($a t^2 + $b)/($c t^2 + $d)")->reduce; + do { + $x2 = random(3,10,1); + $y2Raw = $f->eval(t=>$x2); + $y2 = int($y2Raw+0.5); + + $y3 = random($y1+10,$y4-10,5); + $s1 = $y3*$c; + $s2 = $y3*$d; + $s3 = $s1-$a; + $s4 = $b-$s2; + $x3Raw = sqrt($s4/$s3); + $x3 = int($x3Raw+0.5); + } until (abs($x2-$x3)>2); + +} until ($s4/$s3>0); + +$num = Formula("$a t^2 + $b")->reduce; +$den = Formula("$c t^2 + $d")->reduce; + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(tolerance=>1); + +$y1t = $y1*1000; +$y2t = $y2*1000; +$y3t = $y3*1000; +$y4t = $y4*1000; + +$y1C = Currency("$y1t"); +$y2C = Currency("$y2t"); +$y3C = Currency("$y3t"); +$y4C = Currency("$y4t"); + +############################################# + +BEGIN_PGML +A once thriving company had its monthly profits, _in thousands of +dollars_, modeled by the equation + + [``f(t) = [$f]``] + +where [` t `] is in months after January 2000. + +Answer the following questions. + +a) In January 2000, the company's monthly profit was approximately [___________]{$y1C}. + +a) [`[$x2]`] months since January 2000, the company's monthly profit was approximately [___________]{$y2C}. (Round to *thousands of dollars*.) + +a) Approximately [___________]{$x3} months since January 2000, the company's monthly profit was approximately [`[$y3C]`]. (Round to a *whole number*.) + +d) In the long run, the company's monthly profit would stabilize at approximately [___________]{$y4C}. + +END_PGML + +############################################# + +BEGIN_PGML_SOLUTION + +a) In January 2000, we have [`t=0`]. So we evaluate [`f(0)`]: + + [``f(0)=\frac{[$a](0)^2+[$b]}{[$c](0)^2+[$d]}=[$y1]``] + + In January 2000, the company's monthly profit was approximately [`[$y1C]`]. + +a) "[`[$x2]`] months since January 2000" implies [`t=[$x2]`]. We substitute [`t=[$x2]`] into [`f(t)`], and we have: + + [``f([$x2])=\frac{[$a]([$x2])^2+[$b]}{[$c]([$x2])^2+[$d]}=[$y2Raw]\ldots``] + + [`[$x2]`] months since January 2000, the company's monthly profit was approximately [`[$y2C]`]. + +a) To find when the company's monthly profit was [`[$y3C]`], we substitute [`[$y3]`] into the function's [`y`] value and solve for [`t`]: + + [`` +\begin{aligned} + f(t) &= [$f] \\ + [$y3] &= [$f] \\ + [$y3]\cdot([$den]) &= [$f]\cdot([$den])\\ + [$s1]t^2+[$s2] &= [$num] \\ + [$s1]t^2 -[$a]t^2 &= [$b]-[$s2] \\ + [$s3]t^2 &= [$s4] \\ + t^2 &= \frac{[$s4]}{[$s3]} \\ + t &= \sqrt{\frac{[$s4]}{[$s3]}} \\ + t &\approx [$x3Raw] +\end{aligned} + ``] + + Approximately [`[$x3]`] months since January 2000, the company's monthly profit was approximately [`[$y3C]`]. + +a) "In the long run" suggests we examine the long term behavior of [`f`], as [`t`] becomes large. + + Since this is a rational function with the degree of the numerator equal to the degree of the denominator, it has a horizontal asymptote at + + [`y=\frac{\mbox{leading coefficient of numerator}}{\mbox{leading coefficient of denominator}}`] + + So the horizontal asymptote is at [`y=\frac{[$a]}{[$c]}=[$y4]`]. In the graph of [`f(t)`], as [`t`] moves farther to the right, [`f(t)`] gets closer to [`[$y4]`]. + + In the long run, the company's monthly profit would stabilize at approximately [`[$y4C]`]. + + + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes70.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes70.pg new file mode 100644 index 0000000000..5233825fae --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes70.pg @@ -0,0 +1,159 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a rational function, find its horizontal asymptote in the context +# of an application. +# +# Last update: Carl Yao 04/30/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl" +); + +############################################# + +TEXT(beginproblem()); + +do { + $e = random(0.02,0.06,0.01); + $y4 = random(1000,2000,100); + $ac = $e*$y4; + $a=random(10,100,10); + $c = $ac/$a; + + $d = random(1,10,1); + $y1 = random(20,80,5); + $ab = $d*$y1; + $b = $ab/$a; +} until ( (int($c)==$c) && ($b==int($b)) && ($c!=1) ); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are(t=>'Real'); + +$num = Formula("$a*($b+$c*t)")->reduce; +$den = Formula("$d+$e*t")->reduce; +$f = Formula("$a*($b+$c*t)/($d+$e*t)")->reduce; +$numE1 = Formula("$ab+$ac*t")->reduce; +$numE2 = Formula("$ac*t+$ab")->reduce; +$denE1 = Formula("$e*t+$d")->reduce; + +do { + $x2 = random(10,30,1); + $y2Raw = $f->eval(t=>$x2); + $y2 = int($y2Raw+0.5); + + $y3 = random(100,$y4-100,100); + $x3Raw = ($y3*$d-$ab)/($ac-$y3*$e); + $x3 = int($x3Raw+0.5); +} until (abs($x2-$x3)>10); + +############################################# + +BEGIN_PGML + +Some moths were introduced into a ranch, and their population can be modeled by the following function: + + [``f(t) = [$f]``] + +where [` t `] is in months since January 2000. + +Answer the following questions. Round your answers to *whole numbers* when necessary. + +a) In January 2000, [___________]{$y1} moths were introduced into the ranch. + +a) [`[$x2]`] months since January 2000, approximately [___________]{$y2} moths live on the ranch. + +a) Approximately [___________]{$x3} months since January 2000, there were [`[$y3]`] moths living on the ranch. + +d) In the long run, the moth population on the ranch would stablize at approximately [___________]{$y4}. + +END_PGML + +############################################# + +$s1 = $y3*$d; +$s2 = $y3*$e; +$s3 = $y3*$e-$ac; +$s4 = $ab-$y3*$d; + +$s5 = ($x3Raw*100==int($x3Raw*100)) ? "=$x3" : "\approx $x3Raw \ldots"; + +BEGIN_PGML_SOLUTION + +a) In January 2000, we have [`t=0`]. So we evaluate [`f(0)`]: + + [``f(0)=\frac{[$a]([$b]+[$c](0))}{[$d]+[$e](0)}=[$y1]``] + + In January 2000, [`[$y1]`] moths were introduced into the ranch. + +a) "[`[$x2]`] months since January 2000" implies [`t=[$x2]`]. We substitute [`t=[$x2]`] into [`f(t)`], and we have: + + [``f([$x2])=\frac{[$a]([$b]+[$c]([$x2]))}{[$d]+[$e]([$x2])}=[$y2Raw]\ldots``] + + [`[$x2]`] months since January 2000, approximately [`[$y2]`] moths live on the ranch. + +a) To find when there were [`[$y3]`] moths living on the ranch, we substitute [`[$y3]`] into the function's [`y`] value and solve for [`t`]: + + [`` +\begin{aligned} + f(t) &= [$f] \\ + [$y3] &= [$f] \\ + [$y3]\cdot([$den]) &= [$f]\cdot([$den])\\ + [$s1]+[$s2]t &= [$num] \\ + [$s1]+[$s2]t &= [$ab]+[$ac]t \\ + [$s2]t -[$ac]t &= [$ab]-[$s1] \\ + [$s3]t &= [$s4] \\ + t & [$s5] \\ +\end{aligned} + ``] + + Approximately [`[$x3]`] months since January 2000, there were [`[$y3]`] moths living on the ranch. + +a) "In the long run" suggests we examine the long term behavior of [`f`], as [`t`] becomes large. + + Since this is a rational function with the degree of the numerator equal to the degree of the denominator, it has a horizontal asymptote at + + [`y=\frac{\mbox{leading coefficient of numerator}}{\mbox{leading coefficient of denominator}}`] + + We need to re-write [`f(t)`]: + + [`` +\begin{aligned} + f(t) &= [$f] \\ + &= \frac{[$numE1]}{[$den]} \\ + &= \frac{[$numE2]}{[$denE1]} \\ +\end{aligned} + ``] + + So the horizontal asymptote is at [`y=\frac{[$ac]}{[$e]}=[$y4]`]. In the graph of [`f(t)`], as [`t`] moves farther to the right, [`f(t)`] gets closer to [`[$y4]`]. + + In the long run, the moth population on the ranch would stablize at approximately [`[$y4]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes80.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes80.pg new file mode 100644 index 0000000000..915d73c953 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Asymptotes80.pg @@ -0,0 +1,112 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Rational function application. +# +# Last updated: Yao 5/8/2018 +# ENDDESCRIPTION + +## DBCCSS('A-REI.4.b') +## DBsubject('Algebra') +## DBchapter('Basic Algebra') +## DBsection('equations', 'Simplification') +## KEYWORDS('rational','domain') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +); + +############################################## + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Numeric"); + +do { + $a = random(30,60,5); + $a2 = $a**2; + $num = Compute("x**2")->reduce; + $den = Compute("$a2-$a*x")->reduce; + $func = Compute("x**2/($a2-$a*x)")->reduce; + $x1 = random($a-20,$a-5,1); + $y1 = $func->eval(x=>$x1); + $y1r = int((10*$y1+5)/10); + do {$x2 = random($a-20,$a-5,1);} until (abs($x1-$x2)>5); + $y2 = $func->eval(x=>$x2); + $y2r = int((10*$y2+5)/10); +} until ( ($y1>2) && ($y2>2) ); + +$A = 1; +$B = $y2r*$a; +$C = -$y2r*$a2; +$D = ($B)**2-4*$A*$C; +$D2 = sqrt($D); +$r1 = (-$B+$D2)/(2*$A); +$r2 = (-$B-$D2)/(2*$A); +$ans2 = int($r1+0.5); + +############################################## + +BEGIN_PGML + +In a certain store, cashiers can serve [`[$a]`] customers per hour on average. If [`x`] customers arrive at the store in a given hour, then the average number of customers [`C`] waiting in line can be modeled by the function + + [`` C(x) = [$func] ``] + +where [`x<[$a]`]. + +Answer the following questions with a graphing calculator. Round your answers to integers. + +a. If [`[$x1]`] customers arrived in the store in the past hour, there are approximately [__________]{$y1r} customers waiting in line. + +a. If there are [`[$y2r]`] customers waiting in line, approximately [__________]{$ans2} customers arrived in the past hour. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +a. If [`[$x1]`] customers arrived in the store in the past hour, approximately how many customers are waiting in line. To answer this question, we substitute [`x`] with [`[$x1]`], and we have: + + [`` C([$x1]) = \frac{[$x1]^{2}}{[$a2]-[$a]([$x1])} \approx [$y1] \approx [$y1r] ``] + + If [`[$x1]`] customers arrived in the store in the past hour, there are approximately [`[$y1r]`] customers waiting in line. + +a. If there are [`[$y2r]`] customers waiting in line, approximately how many customers arrived in the past hour? To answer this question, we substitute [`C`] with [`[$y2r]`], and we have: + + [`` [$y2r]= [$func] ``] + +We will solve for [`x`] in this equation: + + [`` +\begin{aligned} + [$y2r] &= [$func] \\ + [$y2r]\cdot([$den]) &= [$func]\cdot([$den]) \\ + [$y2r*$a2]-[$y2r*$a]x &= [$num] \\ + 0 &= x^2 + [$B]x + [$C] \\ + x &= \frac{-[$B]\pm\sqrt{([$B])^2-4([$A])([$C])}}{2([$A])} \\ + x &= \frac{-[$B]\pm[$D2]}{[$A*2]} \\ + x &= \frac{-[$B]+[$D2]}{[$A*2]} \text{ or } x = \frac{-[$B]-[$D2]}{[$A*2]} \\ + x &= [$r1] \text{ or } x = [$r2] +\end{aligned} + ``] + + Ignore the negative solution, and round the reasonable solution to [`[$ans2]`]. + + If there are [`[$y2r]`] customers waiting in line, approximately [`[$ans2]`] customers arrived in the past hour. + + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas10.pg new file mode 100644 index 0000000000..6ba05a7d26 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas10.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +for my $i (1..3) +{ + $r[$i] = $r[$i-1] + random(1,5,1); +} + +$p = Compute("(x-$r[0])*(x-$r[1])/((x-$r[2])*(x-$r[3]))")->reduce; + +$f = RandomVariableName(type=>'function'); + +############################################## + + +BEGIN_PGML + +Find a formula for a rational function [`[$f]`] with degree-one zeros at [`[@$r[0]@]`] and [`[@$r[1]@]`], and degree-one vertical asymptotes at [`[@$r[2]@]`] and [`[@$r[3]@]`]. + + [`[$f](x)={}`][______________________________________] + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"$c0 * $p"); + return $correct == $student; + } +) ); + +############################################## + +BEGIN_PGML_SOLUTION + +Since this is a rational function, having zeros at [`[@$r[0]@]`] and [`[@$r[1]@]`] means that [`(x-[@$r[0]@])`] and [`(x-[@$r[1]@])`] are factors of the numerator. Since they are degree-1 zeros, there is no exponent on these factors (other than [`1`]). + +Having vertical asymptotes at [`[@$r[2]@]`] and [`[@$r[3]@]`] means that [`(x-[@$r[2]@])`] and [`(x-[@$r[3]@])`] are factors of the denominator. Since they are degree-1 asymptotes, there is no exponent on these factors (other than [`1`]). + +So far, this tells us that [`[$f](x)=c[$p]`] for some constant [$c]. You can enter any formula that has this pattern to get credit for this problem, including just [`[$p]`] (where [`c=1`]). + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas20.pg new file mode 100644 index 0000000000..49a9d22ae2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas20.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +for my $i (1..3) +{ + $r[$i] = $r[$i-1] + random(1,5,1); +} + +$p = Compute("(x-$r[0])*(x-$r[1])/((x-$r[2])**2)")->reduce; + +$f = RandomVariableName(type=>'function'); + +############################################## + + +BEGIN_PGML + +Find a formula for a rational function [`[$f]`] whose only solutions to [`f(x)=0`] are [`x=[@$r[0]@]`] and [`x=[@$r[1]@]`], whose graph at those [`x`]-values has a nonzero slope, and that is undefined at [`x=[@$r[2]@]`] with a degree-two vertical asymptote in its graph. + + [`[$f](x)={}`][______________________________________] + + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"$c0 * $p"); + return $correct == $student; + } +) ); + +############################################## + +BEGIN_PGML_SOLUTION + +We have been told that there are zeros at [`[@$r[0]@]`] and [`[@$r[1]@]`]. Since this is a rational function, having zeros at [`[@$r[0]@]`] and [`[@$r[1]@]`] means that [`(x-[@$r[0]@])`] and [`(x-[@$r[1]@])`] are factors of the numerator. Since the function has nonzero slope at those zeros, they must be degree-1 zeros. Since they are degree-1 zeros, there is no exponent on these factors (other than [`1`]). + +Having a vertical asymptote at [`[@$r[2]@]`] means that [`(x-[@$r[2]@])`] is a factor of the denominator. Since it is a degree-2 asymptote, there is an exponent of [`2`] on that factor. + +So far, this tells us that [`[$f](x)=c[$p]`] for some constant [`c`]. You can enter any formula that has this pattern to get credit for this problem, including just [`[$p]`] (where [`c=1`]). + +END_PGML_SOLUTION + +############################################## + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas30.pg new file mode 100644 index 0000000000..748a2d9df9 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas30.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl" +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +for my $i (1..2) +{ + $r[$i] = $r[$i-1] + random(1,5,1); +} + +$p = Compute("(x-$r[0])*(x-$r[2])/(x-$r[1])")->reduce; + +for my $i ($r[0]..$r[2]-1) +{$vals[$i-$r[0]] = abs($p->eval(x=>$i+0.5));} + +$ymax = 1.3*max(@vals); + +$xmax = max($r[2]+1,5); +$gr = init_graph(-5,-$ymax,$xmax,$ymax,axes=>[0,0],grid=>[$xmax+5,10],size=>[400,400]); +$gr -> lb('reset'); + + +foreach my $i (1..$r[2]) { + $gr -> lb(new Label ( $i,-0.5, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.5,-$i,'black','center','middle')); +} + +$r1low = $r[1] - 0.0001; +$r1high = $r[1] + 0.0001; + +add_functions($gr, "$p for x in <-5,$r1low> using color:blue and weight:1"); +add_functions($gr, "$p for x in <$r1high,$xmax> using color:blue and weight:1"); + +############################################## + +$refreshCachedImages = 1; +BEGIN_PGML + +Find a formula for a rational function [`f`] that might have this graph. Do not over-complicate things: assume that all degrees are as small as can be compatible with this graph. + +[@EnlargeImageStatementPGML()@]** + + +>>[@image(insertGraph($gr), width=>400, height=>400, tex_size=>800)@]* << + + + [`f(x)={}`][________________________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"abs($c0) * $p"); + return $correct == $student; + } +) ); + +############################################## + +BEGIN_PGML_SOLUTION + +We need to see from the graph that there are zeros at [`[@$r[0]@]`] and [`[@$r[2]@]`]. Further, since the graph passes through them is a straight-line fashion, they are degree-1 zeros. + +We also need to see that there is a vertical asymptote at [`[@$r[1]@]`]. Since the arms of the function go in opposite directions (one up, one down) as [`x`] approaches [`[@$r[1]@]`], then the degree of the vertical asymptote must be odd: [`1`], [`3`], [`5`], etc. + +Since this is a rational function, having zeros at [`[@$r[0]@]`] and [`[@$r[2]@]`] means that [`(x-[@$r[0]@])`] and [`(x-[@$r[2]@])`] are factors of the numerator. Since they are degree-1 zeros, there is no exponent on these factors (other than [`1`]). + +Having a vertical asymptote at [`[@$r[1]@]`] means that [`(x-[@$r[1]@])`] is a factor of the denominator. At first thought, the exponent on this factor could be [`1`] or [`3`] or [`5`], etc. But we can see that the function has a slant-line asymptote, and so the polynomial long division of the numerator by the denominator must result in a degree-1 polynomial. Since we know the numerator has total degree [`2`], the denominator must therefore have total degree [`1`]. + +So far, this tells us that [`f(x)=c[$p]`] for some constant [`c`]. If [`c`] were negative, then the long-term behavior (slant-line asymptote) would have a downward trend. But the graph shows it has an upward trend. So [`c`] must be positive, and you can enter any formula that has this pattern to get credit for this problem, including just [`[$p]`] (where [`c=1`]). + +END_PGML_SOLUTION + +############################################## + + + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas40.pg new file mode 100644 index 0000000000..116b24e540 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas40.pg @@ -0,0 +1,133 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl" +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +do { + for my $i (1..3) { + $r[$i] = $r[$i-1] + random(1,5,1); + } +} until ( ($r[1]!=0) && ($r[2]!=0) ); + +$p = Compute("(x-$r[0])*(x-$r[3])/((x-$r[1])*(x-$r[2]))")->reduce; + +for my $i ($r[0]..$r[3]-1) +{$vals[$i-$r[0]] = abs($p->eval(x=>$i+0.5));} + +$ymax = 1.3*max(@vals); + +$xmax = max($r[3]+1,5); +$gr = init_graph(-5,-$ymax,$xmax,$ymax,axes=>[0,0],grid=>[$xmax+5,10],size=>[400,400]); +$gr -> lb('reset'); + + +foreach my $i (1..$xmax) { + $gr -> lb(new Label ( $i,-0.5, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.5,-$i,'black','center','middle')); +} + +$r1low = $r[1] - 0.0001; +$r1high = $r[1] + 0.0001; + +$r2low = $r[2] - 0.0001; +$r2high = $r[2] + 0.0001; + +add_functions($gr, "$p for x in <-5,$r1low> using color:blue and weight:1"); +add_functions($gr, "$p for x in <$r1high,$r2low> using color:blue and weight:1"); +add_functions($gr, "$p for x in <$r2high,$xmax> using color:blue and weight:1"); + +$gr->stamps( closed_circle($r[0],0,'black') ); +$gr->stamps( closed_circle($r[3],0,'black') ); + +############################################## + +$refreshCachedImages = 1; +BEGIN_PGML + +Find a formula for a rational function [`f`] that might have this graph. Do not over-complicate things: assume that all degrees are as small as can be compatible with this graph. + +[@EnlargeImageStatementPGML()@]** + + +>>[@image(insertGraph($gr), width=>400, height=>400, tex_size=>800)@]* << + + + [`f(x)={}`][________________________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"abs($c0) * $p"); + return $correct == $student; + } +) ); + + +############################################## + +BEGIN_PGML_SOLUTION + +We need to see from the graph that there are zeros at [`[@$r[0]@]`] and [`[@$r[3]@]`]. + +We also need to see that there are vertical asymptotes at [`[@$r[1]@]`] and [`[@$r[2]@]`]. Since the arms of the function go in opposite directions (one up, one down) as [`x`] approaches either of these, then the degree of the vertical asymptotes must be odd: [`1`], [`3`], [`5`], etc. + +Since this is a rational function, having zeros at [`[@$r[0]@]`] and [`[@$r[3]@]`] means that [`(x-[@$r[0]@])`] and [`(x-[@$r[3]@])`] are factors of the numerator. + +Having vertical asymptotes at [`[@$r[1]@]`] and [`[@$r[2]@]`] means that [`(x-[@$r[1]@])`] and [`(x-[@$r[2]@])`] are factors of the denominator. + +So far, this tells us that [`f(x)=c\frac{(x-[@$r[0]@])^m(x-[@$r[3]@])^n}{(x-[@$r[1]@])^p(x-[@$r[2]@])^q}`] for some constant [`c`] and some whole number exponents [`m`], [`n`], [`p`], and [`q`]. The instructions say that we should make the exponents as small as is compatible with the graph, and letting them all be [`1`] is compatible with the graph. + +So then we know that [`f(x)=c[$p]`]. The long term-behavior (horizontal asymptote) is the line [`y=c`] since the total degree of the numerator equals the total degree of the denominator. We can see in the graph that whatever [`c`] is, it is positive. You can enter any formula that has this pattern to get credit for this problem, including just [`[$p]`] (where [`c=1`]). + +END_PGML_SOLUTION + +############################################## + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas50.pg new file mode 100644 index 0000000000..18f3dc026c --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas50.pg @@ -0,0 +1,152 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl" +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +for my $i (1..3) +{ + $r[$i] = $r[$i-1] + random(1,5,1); +} + +$p = Compute("(x-$r[0])**2/((x-$r[1])**2*(x-$r[2]))")->reduce; + +for my $i ($r[0]..$r[3]-1) +{$vals[$i-$r[0]] = abs($p->eval(x=>$i+0.5));} + +$ymax = 1.3*max(@vals); + +$xmax = max($r[3]+1,5); +$gr = init_graph(-5,-$ymax,$xmax,$ymax,axes=>[0,0],grid=>[$xmax+5,10],size=>[400,400]); + +$zoommin = $r[0]-0.5; +$zoommax = $r[0]+0.5; +$zoomheight = max(abs($p->eval(x=>($zoommin))), abs($p->eval(x=>($zoommax)))); +$gr2 = init_graph($zoommin,-$zoomheight,$zoommax,$zoomheight,axes=>[0,0],size=>[200,200]); + +$gr -> lb('reset'); +$gr2 -> lb('reset'); + +foreach my $i (1..$xmax) { + $gr -> lb(new Label ( $i,-0.8, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.8,-$i,'black','center','middle')); +} + +foreach my $i (1..5) { + $label = $r[0]+($i-3)*0.2; + $gr2 -> lb(new Label ( $label,-0.08*$zoomheight, $label,'black','center','middle')); +} + +$eps = 0.01; +$d[0] = $r[1]-$eps; +$d[1] = $r[1]+$eps; +$d[2] = $r[2]-$eps; +$d[3] = $r[2]+$eps; + + +add_functions($gr, "$p for x in <-5,$d[0]> using color:blue and weight:1"); +add_functions($gr, "$p for x in <$d[1],$d[2]> using color:blue and weight:1"); +add_functions($gr, "$p for x in <$d[3],$xmax> using color:blue and weight:1"); + +add_functions($gr2, "$p for x in <$zoommin,$zoommax> using color:blue and weight:1"); + + +$gr->stamps( closed_circle($r[0],0,'black') ); +$gr2->stamps( closed_circle($r[0],0,'black') ); + + + +############################################## + +$refreshCachedImages = 1; +BEGIN_PGML + +Find a formula for a rational function [`f`] that might have this graph. Do not over-complicate things: assume that all degrees are as small as can be compatible with this graph. + +[@EnlargeImageStatementPGML()@]** + + +>>[@image(insertGraph($gr), width=>400, height=>400, tex_size=>800)@]* << + +>> Zoomed in near [`x=[@$r[0]@]`]: [@image(insertGraph($gr2), width=>200, height=>200, tex_size=>400)@]* << + + + [`f(x)={}`][________________________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"abs($c0) * $p"); + return $correct == $student; + } +) ); + +############################################## + +BEGIN_PGML_SOLUTION + +We need to see from the graph that there is a zero at [`[@$r[0]@]`]. Based on the zoomed-in graph, we can see that this zero has an even degree. + +We also need to see that there are vertical asymptotes at [`[@$r[1]@]`] and [`[@$r[2]@]`]. Since the arms of the function go in opposite directions (one up, one down) as [`x`] approaches [`[@$r[2]@]`], then the degree of the vertical asymptote there must be odd: [`1`], [`3`], [`5`], etc. Since the arms of the function go in the _same_ direction (both down) as [`x`] approaches [`[@$r[1]@]`], then the degree of the vertical asymptote there must be even: [`2`], [`4`], [`6`], etc. + +Since this is a rational function, having a zero at [`[@$r[0]@]`] means that [`(x-[@$r[0]@])`] is a factor of the numerator. + +Having vertical asymptotes at [`[@$r[1]@]`] and [`[@$r[2]@]`] means that [`(x-[@$r[1]@])`] and [`(x-[@$r[2]@])`] are factors of the denominator. + +So far, this tells us that [`[$f](x)=c\frac{(x-[@$r[0]@])^m}{(x-[@$r[1]@])^p(x-[@$r[2]@])^q}`] for some constant [`c`] and some whole number exponents [`m`], [`p`], and [`q`]. We have established that [`m`] and [`p`] are even, while [`q`] is odd. The instructions say that we should make the exponents as small as is compatible with the graph, and letting [`m=2`], [`p=2`], and [`q=1`] is compatible with the graph. + +So then we know that [`f(x)=c[$p]`]. The long term-behavior (horizontal asymptote) is the line [`y=0`] since the total degree of the numerator is less than the total degree of the denominator, and this agrees with what we see in the graph. + +For a really large [`x`]-value, the quantity [`[$p]`] gives a positive output since all factors will be positive. And so [`c[$p]`] will have the same sign as [`c`]. We can see in the graph that when [`x`] is large, that [`f(x)`] is positive, and therefore [`c`] needs to be positive. You can enter any formula that has this pattern to get credit for this problem, including just [`[$p]`] (where [`c=1`]). + +END_PGML_SOLUTION + +############################################## + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas60.pg new file mode 100644 index 0000000000..e073528d49 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Formulas60.pg @@ -0,0 +1,150 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Polynomial and Rational Functions') +## DBsection('Polynomial Functions and their Graphs') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl" +); + + +TEXT(beginproblem()); + +############################################## + + + +Context("Numeric"); + +$r[0] = random(-4,-1,1); +for my $i (1..3) +{ + $r[$i] = $r[$i-1] + random(1,5,1); +} + +$p = Compute("-(x-$r[0])/((x-$r[1])*(x-$r[2]))")->reduce; + +for my $i ($r[0]..$r[3]-1) +{$vals[$i-$r[0]] = abs($p->eval(x=>$i+0.5));} + +$ymax = 1.3*max(@vals); + +$xmax = max($r[3]+1,5); +$gr = init_graph(-5,-$ymax,$xmax,$ymax,axes=>[0,0],grid=>[$xmax+5,10],size=>[400,400]); + +$zoommin = $r[0]-0.5; +$zoommax = $r[0]+0.5; +$zoomheight = max(abs($p->eval(x=>($zoommin))), abs($p->eval(x=>($zoommax)))); +$gr2 = init_graph($zoommin,-$zoomheight,$zoommax,$zoomheight,axes=>[0,0],size=>[200,200]); + +$gr -> lb('reset'); +$gr2 -> lb('reset'); + + + +foreach my $i (1..$xmax) { + $gr -> lb(new Label ( $i,-0.8, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.8,-$i,'black','center','middle')); +} + +foreach my $i (1..5) { + $label = $r[0]+($i-3)*0.2; + $gr2 -> lb(new Label ( $label,-0.08*$zoomheight, $label,'black','center','middle')); +} + +$eps = 0.01; +$d[0] = $r[1]-$eps; +$d[1] = $r[1]+$eps; +$d[2] = $r[2]-$eps; +$d[3] = $r[2]+$eps; + + +add_functions($gr, "$p for x in <-5,$d[0]> using color:blue and weight:1"); +add_functions($gr, "$p for x in <$d[1],$d[2]> using color:blue and weight:1"); +add_functions($gr, "$p for x in <$d[3],$xmax> using color:blue and weight:1"); + +add_functions($gr2, "$p for x in <$zoommin,$zoommax> using color:blue and weight:1"); + +$gr->stamps( closed_circle($r[0],0,'black') ); +$gr2->stamps( closed_circle($r[0],0,'black') ); + +############################################## + +$refreshCachedImages = 1; +BEGIN_PGML + +Find a formula for a rational function [`f`] that might have this graph. Do not over-complicate things: assume that all degrees are as small as can be compatible with this graph. + +[@EnlargeImageStatementPGML()@]** + + +>>[@image(insertGraph($gr), width=>400, height=>400, tex_size=>800)@]* << + +>> Zoomed in near [`x=[@$r[0]@]`]: [@image(insertGraph($gr2), width=>200, height=>200, tex_size=>400)@]* << + + + [`f(x)={}`][________________________________] + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $p->cmp(checker => sub { + my ( $correct, $student, $self ) = @_; + my $context = Context()->copy; + return 0 if $student == 0; + $context->flags->set(no_parameters=>0); + $context->variables->add('C0'=>'Parameter'); + my $c0 = Formula($context,'C0'); + $student = Formula($context,$student); + $correct = Formula($context,"abs($c0) * $p"); + return $correct == $student; + } +) ); + +############################################## + +BEGIN_PGML_SOLUTION + +We need to see from the graph that there is a zero at [`[@$r[0]@]`]. Based on the zoomed-in graph, we can see that this zero has degree [`1`]. + +We also need to see that there are vertical asymptotes at [`[@$r[1]@]`] and [`[@$r[2]@]`]. Since the arms of the function go in opposite directions (one up, one down) as [`x`] approaches either [`[@$r[1]@]`] or [`[@$r[2]@]`], then the degrees of these vertical asymptotes must be odd: [`1`], [`3`], [`5`], etc. + +Since this is a rational function, having a zero at [`[@$r[0]@]`] means that [`(x-[@$r[0]@])`] is a factor of the numerator. Since it is a degree-1 zero, there is no exponent on this factor (other than [`1`]). + +Having vertical asymptotes at [`[@$r[1]@]`] and [`[@$r[2]@]`] means that [`(x-[@$r[1]@])`] and [`(x-[@$r[2]@])`] are factors of the denominator. The instructions say to keep the degrees as small as is compatible with the graph, and taking the degrees to be [`1`] for both factors is compatible with the graph. + +So far, this tells us that [`f(x)=c\frac{(x-[@$r[0]@])}{(x-[@$r[1]@])(x-[@$r[2]@])}`] for some constant [`c`]. The long term-behavior (horizontal asymptote) is the line [`y=0`] since the total degree of the numerator is less than the total degree of the denominator, and this agrees with what we see in the graph. + +For a really large [`x`]-value, the quantity [`\frac{(x-[@$r[0]@])}{(x-[@$r[1]@])(x-[@$r[2]@])}`] gives a positive output since all factors will be positive. And so [`c\frac{(x-[@$r[0]@])}{(x-[@$r[1]@])(x-[@$r[2]@])}`] will have the same sign as [`c`]. We can see in the graph that when [`x`] is large, that [`f(x)`] is negative, and therefore [`c`] needs to be negative. You can enter any formula that has this pattern to get credit for this problem, including just [`[$p]`] (where [`c=-1`]). + +END_PGML_SOLUTION + +############################################## + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions10.pg new file mode 100644 index 0000000000..c9005e4fad --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions10.pg @@ -0,0 +1,227 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$h = non_zero_random(-4,4,1); +$v = non_zero_random(-4,4,1); +$k = random(2,5,1); +$hN = -$h; + +$func = Formula("$k/(x+$h)+$v")->reduce; +$funcF = Formula("$k/(x+$h)")->reduce; +$f[0] = Formula("$k/(x+$h)+$v")->reduce; +$f[1] = Formula("$k/(x-$h)+$v")->reduce; +$f[2] = Formula("-$k/(x+$h)+$v")->reduce; +$f[3] = Formula("-$k/(x-$h)+$v")->reduce; +$f[4] = Formula("1/x")->reduce; + +@alt = (); +$alt[0] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $hN from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $hN from the right."; +$alt[1] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $h from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $h from the right."; +$alt[2] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $hN from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches negative infinity as x-value approaches $hN from the right."; +$alt[3] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $h from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches negative infinity as x-value approaches $h from the right."; +$alt[4] = "This is the graph of f(x)=1/x, with two pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches 0 from the left. The right piece approaches y=0 horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches 0 from the right."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. +if ( ($i==0) || ($i==2) ) { + $breakL = -$h-0.01; + $breakR = -$h+0.01; +} else { + $breakL = $h-0.01; + $breakR = $h+0.01; +} +if ($i==4) { + $breakL = -0.01; + $breakR = 0.01; +} +add_functions($graphs[$i], "$f[$i] for x in <-$bound,$breakL> " . + "using color:blue and weight:2"); +add_functions($graphs[$i], "$f[$i] for x in <$breakR,$bound> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$absH = abs($h); +$absV = abs($v); +$lor = ($h>0) ? "left" : "right"; +$uod = ($v>0) ? "up" : "down"; + +BEGIN_PGML_SOLUTION + +First, you need to be familiar with the graph of [`y=\frac{1}{x}`]: + +>>[@ image(insertGraph( $graphs[ 4 ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'") @]*<< + +The given function, [`f(x)=[$f[0]]`], is a transformation of [`y=\frac{1}{x}`]: + +* The number [`[$k]`] in [`[$funcF]`] does a vertical stretch by a factor of [`[$k]`]. +* The number [`[$h]`] does a horizontal shift to the [$lor] by [`[$absH]`] units. +* The number [`[$v]`] does a vertical shift [$uod] by [`[$absV]`] units. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions100.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions100.pg new file mode 100644 index 0000000000..25ea23b9f2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions100.pg @@ -0,0 +1,309 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$x1 = non_zero_random(1,4,1); +do {$x2 = non_zero_random(-4,-1,1);} until (abs($x1)!=abs($x2)); +$x1N = -$x1; +$x2N = -$x2; +do {$x3 = non_zero_random(-4,4,1);} until ( ($x3!=$x1) && (abs($x3)!=abs($x2)) ); +$x3N = -$x3; + +$x1p3 = -$x1-$x3; +$x13 = $x1*$x3; +$x2p3 = -$x2-$x3; +$x23 = $x2*$x3; + +$numF = Formula("(x-$x1)*(x-$x3)")->reduce; +$denF = Formula("(x-$x2)*(x-$x3)")->reduce; +$num = Formula("x**2+$x1p3*x+$x13")->reduce; +$den = Formula("x**2+$x2p3*x+$x23")->reduce; +$func = Formula("$num/$den")->reduce; +$f[0] = Formula("(x-$x1)/(x-$x2)")->reduce; +$f[1] = Formula("(x-$x1)/(x-$x2)")->reduce; +$f[2] = Formula("(x-$x1)/(x+$x2)")->reduce; +$f[3] = Formula("(x-$x1)/(x-$x2)**2")->reduce; + +$yInt = $x1/$x2; +$xInt = $x1; + +@hx = ( ); +@hy = ( ); +$hx[0] = $x3; +$hy[0] = $f[0]->eval(x=>$hx[0]); +$hx[2] = $x3; +$hy[2] = $f[2]->eval(x=>$hx[2]); +$hx[3] = $x3; +$hy[3] = $f[3]->eval(x=>$hx[3]); + +@alt = (); +$alt[0] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x2 from the left. The right piece approaches negative infinity as x-value approaches $x2 from the right, and approaches y=1 horizontally as x-value approaches positive infinity. There is a hole at ($hx[0],$hy[0])."; +$alt[1] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $x2 from the left. The right piece approaches negative infinity as x-value approaches $x2 from the right, and approaches y=1 horizontally as x-value approaches positive infinity. There is no hole on this function's graph."; +$alt[2] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x2N from the left. The right piece approaches negative infinity as x-value approaches $x2N from the right, and approaches y=1 horizontally as x-value approaches positive infinity. There is a hole at ($hx[2],$hy[2])."; +$alt[3] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $x2 from the left. The right piece approaches negative infinity as x-value approaches $x2 from the right, crosses ($x1,0), curves downward and approaches y=0 horizontally as x-value approaches positive infinity. There is a hole at ($hx[3],$hy[3])."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + if ( $i==2 ) { + $breakL = -$x2-0.01; + $breakR = -$x2+0.01; + } else { + $breakL = $x2-0.01; + $breakR = $x2+0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$breakL> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$breakR,$bound> " . + "using color:blue and weight:2"); + + if ($i!=1) { + $graphs[$i]->stamps( open_circle($hx[$i],$hy[$i],'blue') ); + } +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +Choose the graph of the function [`f(x)=[$func]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$s1 = $f[0]->eval(x=>-10); + +BEGIN_PGML_SOLUTION + +###Simplifying Function and Locating Hole(s) + +The function [`f(x)=[$func]`] can be factored and reduced: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= \frac{[$numF]}{[$denF]} \\ + &= [$f[0]] +\end{aligned} + ``] + +This implies the function has a hole at [`x=[$x3]`]. To find the hole's [`y`]-value, we substitute [`x=[$x3]`] into [`f(x)=[$f[0]]`], and we have: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + &= \frac{[$x3]-[$x1]}{[$x3]-[$x2]} \\ + &= [$hy[0]] +\end{aligned} + ``] + +The function's graph has a hole at [`([$hx[0]],[$hy[0]])`]. + +###Finding [`X`]-Intercept(s) and [`Y`]-Intercept + +The function's [`y`]-intercept is at [`f(0)=[$yInt]`]. By solving for [`x`] in [`[$f[0]]=0`], we can see the function's [`x`]-intercept is at [`[$xInt]`]. + +###Finding Vertical and Horizontal Asymptote(s) + +By the denominator of [`f(x)=[$f[0]]`], we can tell the function has a vertical asymptote at [`x=[$x2]`]. + +The degree of both the numerator and the denominator in [`f(x)=[$f[0]]`] is [`1`]. This implies the function's horizontal asymptote is determined by the leading coefficients of the numerator and denominator. We can see the horizontal asymptote is at [`y=1`]. + +###Locating Where the Function Intersects its Horizontal Asymptote + +Next, we need to find where the function's graph intersects with its horizontal asymptote. We set [`f(x)=1`] and then solve for [`x`]: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + 1 &= [$f[0]] \\ + 1 \cdot (x-[$x2]) &= [$f[0]] \cdot (x-[$x2]) \\ + x-[$x2] &= x-[$x1] \\ + [$x2N] &= [$x1N] +\end{aligned} + ``] + +Since the equation has no solution, the function's graph doesn't intersect its horizontal asymptote. + +###Determining the Function's Behavior When [`X`]-Value Approaches Negative Infinity + +We need to know whether the function approaches [`y=1`] from above or below when its [`x`]-value approaches negative infinity. We can do this by substituting [`x=-10`] (or a similarly small number) into [`f(x)`], and we have: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + &= \frac{-10-[$x1]}{-10-[$x2]} \\ + &= [$s1] +\end{aligned} + ``] + +The result implies the function's value approaches [`y=1`] from above when the [`x`]-value approaches negative infinity. + +###Sketching the Function's Graph + +The following is an analysis of the function's graph. + +* The function's graph approaches [`y=1`] from above when the [`x`]-value approaches negative infinity. +* As [`x`]-value increases, the function curves up and approaches positive infinity as [`x`]-value approaches [`[$x2]`] from the left. +* In the denominator of [`f(x)=[$f[0]]`], the power of [`(x-[$x2])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x2]`]. The function's graph approaches negative infinity as [`x`]-value approaches [`[$x2]`] from the right. +* The function's graph curves up to meet its [`x`]-intercept at [`x=[$x1]`], crossing the [`y`]-intercept at [`(0,[$yInt])`]. +* In the numerator of [`f(x)=[$f[0]]`], the power of [`(x-[$x1])`] is [`1`], implying the function crosses the [`x`]-axis at [`([$x1],0)`]. +* Finally, the function's graph approaches [`y=1`] from below as [`x`]-value approaches positive infinity. +* Don't forget the function has a hole at [`([$hx[0]],[$hy[0]])`]. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions110.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions110.pg new file mode 100644 index 0000000000..2176544661 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions110.pg @@ -0,0 +1,317 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +do { +$a = list_random(2,3,5); +do { + $b = random(1,10,1); +} until ( (gcd($a,$b)==1) && ($b/$a<=5) ); + +$x1 = $b/$a; +do {$x2 = non_zero_random(-4,-1,1);} until (abs($x1)!=abs($x2)); +$x1N = -$x1; +$x2N = -$x2; +do {$x3 = non_zero_random(-4,4,1);} until (abs($x3)!=abs($x2)); +$x3N = -$x3; + +$x1p3 = -$b-$a*$x3; +$x13 = $b*$x3; +$x2p3 = -$x2-$x3; +$x23 = $x2*$x3; + +$numF = Formula("($a*x-$b)*(x-$x3)")->reduce; +$denF = Formula("(x-$x2)*(x-$x3)")->reduce; +$num = Formula("$a*x**2+$x1p3*x+$x13")->reduce; +$den = Formula("x**2+$x2p3*x+$x23")->reduce; +$func = Formula("$num/$den")->reduce; +$f[0] = Formula("($a*x-$b)/(x-$x2)")->reduce; +$f[1] = Formula("($a*x-$b)/(x-$x2)")->reduce; +$f[2] = Formula("($a*x-$b)/(x+$x2)")->reduce; +$f[3] = Formula("($a*x-$b)/(x-$x2)**2")->reduce; + +$yInt = $b/$x2; +$xInt = $x1; + +@hx = ( ); +@hy = ( ); +$hx[0] = $x3; +$hy[0] = $f[0]->eval(x=>$hx[0]); +$hx[2] = $x3; +$hy[2] = $f[2]->eval(x=>$hx[2]); +$hx[3] = $x3; +$hy[3] = $f[3]->eval(x=>$hx[3]); + +} until ( (abs($hy[0])<10) && (abs($hy[2])<10) && (abs($hy[3])<10) ); + +@alt = (); +$alt[0] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$a horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x2 from the left. The right piece approaches negative infinity as x-value approaches $x2 from the right, and approaches y=$a horizontally as x-value approaches positive infinity. There is a hole at ($hx[0],$hy[0])."; +$alt[1] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$a horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $x2 from the left. The right piece approaches negative infinity as x-value approaches $x2 from the right, and approaches y=$a horizontally as x-value approaches positive infinity. There is no hole on this function's graph."; +$alt[2] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$a horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x2N from the left. The right piece approaches negative infinity as x-value approaches $x2N from the right, and approaches y=$a horizontally as x-value approaches positive infinity. There is a hole at ($hx[2],$hy[2])."; +$alt[3] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $x2 from the left. The right piece approaches negative infinity as x-value approaches $x2 from the right, crosses ($x1,0), curves downward and approaches y=0 horizontally as x-value approaches positive infinity. There is a hole at ($hx[3],$hy[3])."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + if ( $i==2 ) { + $breakL = -$x2-0.01; + $breakR = -$x2+0.01; + } else { + $breakL = $x2-0.01; + $breakR = $x2+0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$breakL> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$breakR,$bound> " . + "using color:blue and weight:2"); + + if ($i!=1) { + $graphs[$i]->stamps( open_circle($hx[$i],$hy[$i],'blue') ); + } +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +Choose the graph of the function [`f(x)=[$func]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$s1 = $f[0]->eval(x=>-10); + +BEGIN_PGML_SOLUTION + +###Simplifying Function and Locating Hole(s) + +The function [`f(x)=[$func]`] can be factored and reduced: + + [`` +\begin{aligned} + f(x) &= [$func] \\ + &= \frac{[$numF]}{[$denF]} \\ + &= [$f[0]] +\end{aligned} + ``] + +This implies the function has a hole at [`x=[$x3]`]. To find the hole's [`y`]-value, we substitute [`x=[$x3]`] into [`f(x)=[$f[0]]`], and we have: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + &= \frac{[$x3]-[$x1]}{[$x3]-[$x2]} \\ + &= [$hy[0]] +\end{aligned} + ``] + +The function's graph has a hole at [`([$hx[0]],[$hy[0]])`]. + +###Finding [`X`]-Intercept(s) and [`Y`]-Intercept + +The function's [`y`]-intercept is at [`f(0)=[$yInt]`]. By solving for [`x`] in [`[$a]x-[$b]=0`], we can see the function's [`x`]-intercept is at [`[$xInt]`]. + +###Finding Vertical and Horizontal Asymptote(s) + +By the denominator of [`f(x)=[$f[0]]`], we can tell the function has a vertical asymptote at [`x=[$x2]`]. + +The degree of both the numerator and the denominator in [`f(x)=[$f[0]]`] is [`1`]. This implies the function's horizontal asymptote is determined by the leading coefficients of the numerator and denominator. We can see the horizontal asymptote is at [`y=\frac{[$a]}{1}=[$a]`]. + +###Locating Where the Function Intersects its Horizontal Asymptote + +Next, we need to find where the function's graph intersects with its horizontal asymptote. We set [`f(x)=[$a]`] and then solve for [`x`]: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + [$a] &= [$f[0]] \\ + [$a] \cdot (x-[$x2]) &= [$f[0]] \cdot (x-[$x2]) \\ + [$a]x-[$a*$x2] &= [$a]x-[$b] \\ + [$a*$x2*-1] &= [$b*-1] +\end{aligned} + ``] + +Since the equation has no solution, the function's graph doesn't intersect its horizontal asymptote. + +###Determining the Function's Behavior When [`X`]-Value Approaches Negative Infinity + +We need to know whether the function approaches [`y=[$a]`] from above or below when its [`x`]-value approaches negative infinity. We can do this by substituting [`x=-10`] (or a similarly small number) into [`f(x)`], and we have: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + f(-10) &= \frac{[$a](-10)-[$b]}{-10-[$x2]} \\ + &= [$s1] +\end{aligned} + ``] + +The result implies the function's value approaches [`y=[$a]`] from above when the [`x`]-value approaches negative infinity. + +###Sketching the Function's Graph + +The following is an analysis of the function's graph. + +* The function's graph approaches [`y=[$a]`] from above when the [`x`]-value approaches negative infinity. +* As [`x`]-value increases, the function curves up and approaches positive infinity as [`x`]-value approaches [`[$x2]`] from the left. +* In the denominator of [`f(x)=[$f[0]]`], the power of [`(x-[$x2])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x2]`]. The function's graph approaches negative infinity as [`x`]-value approaches [`[$x2]`] from the right. +* The function's graph curves up to meet its [`x`]-intercept at [`x=[$x1]`], crossing the [`y`]-intercept at [`(0,[$yInt])`]. +* In the numerator of [`f(x)=[$f[0]]`], the power of [`([$a]x-[$b])`] is [`1`], implying the function crosses the [`x`]-axis at [`([$x1],0)`]. +* Finally, the function's graph approaches [`y=[$a]`] from below as [`x`]-value approaches positive infinity. +* Don't forget the function has a hole at [`([$hx[0]],[$hy[0]])`]. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions120.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions120.pg new file mode 100644 index 0000000000..69d4257d05 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions120.pg @@ -0,0 +1,345 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +do { + +do { + $x1 = random(1,4,1); + $x3 = non_zero_random(-2,$x1-1,1); + $x4 = non_zero_random(-3,$x3-1,1); + $x2 = non_zero_random(-4,$x4-1,1); + $b1 = -$x3-$x4; + $c1 = $x3*$x4; + $b2 = -$x1-$x2; + $c2 = $x1*$x2; +} until ( ($b1!=$b2) && (abs($x3)!=abs($x1)) && (abs($x3)!=abs($x2)) && (abs($x4)!=abs($x1)) && (abs($x4)!=abs($x2)) ); + +$x1N = -$x1; +$x2N = -$x2; +$x3N = -$x3; +$x4N = -$x4; + +$s5 = $c1-$c2; +$s6 = $s5/($b2-$b1); + +$numF = Formula("(x-$x3)*(x-$x4)")->reduce; +$denF = Formula("(x-$x1)*(x-$x2)")->reduce; +$num = Formula("x**2+$b1*x+$c1")->reduce; +$den = Formula("x**2+$b2*x+$c2")->reduce; +$func = Formula("$numF/($denF)")->reduce; +$f[0] = Formula("$num/($den)")->reduce; +$f[1] = Formula("(x+$x3)(x+$x4)/((x+$x1)(x+$x2))")->reduce; +$f[2] = Formula("(x-$x1)(x-$x2)/((x-$x3)(x-$x4))")->reduce; +$f[3] = Formula("$num/((x-$x1)*(x-$x2)**2)")->reduce; + +$yInt = $c1/$c2; +$xIntL = min($x3,$x4); +$xIntR = max($x3,$x4); + +@hy = ( ); +$hy[0] = $f[0]->eval(x=>5); +$hy[1] = $f[1]->eval(x=>5); +$hy[2] = $f[2]->eval(x=>5); +$hy[3] = $f[3]->eval(x=>5); +$hy[4] = $f[0]->eval(x=>-5); +$hy[5] = $f[1]->eval(x=>-5); +$hy[6] = $f[2]->eval(x=>-5); +$hy[7] = $f[3]->eval(x=>-5); +$hy[8] = $f[0]->eval(x=>($x2+$x3)/2+0.1); +$hy[9] = $f[1]->eval(x=>($x2+$x3)/2+0.1); +$hy[10] = $f[2]->eval(x=>($x2+$x3)/2+0.1); +$hy[11] = $f[3]->eval(x=>($x2+$x3)/2+0.1); + +$flag = 0; +for (my $i=0; $i<=11; $i++) { + if (abs($hy[$i])>10) { + $flag = 1; + last; + } +} + +} until ( ($flag==0) && (abs($s6)<=5) && ($s6<$x4) ); + +@alt = (); +$alt[0] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x2 from the left. The middle piece approaches negative infinity as x-value approaches $x2 from the right, crosses ($x4,0) and ($x3,0), and approaches negative infinity as x-value approaches $x1 from the left. The right piece approaches positive infinity as x-value approaches $x1 from the right, and approaches y=1 horizontally as x-value approaches positive infinity."; +$alt[1] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x1N from the left. The middle piece approaches negative infinity as x-value approaches $x1N from the right, crosses ($x3N,0) and ($x4N,0), and approaches negative infinity as x-value approaches $x2N from the left. The right piece approaches positive infinity as x-value approaches $x2N from the right, and approaches y=1 horizontally as x-value approaches positive infinity."; +$alt[2] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, crosses ($x2,0), and approaches negative infinity as x-value approaches $x4 from the left. The middle piece approaches positive infinity as x-value approaches $x4 from the right, and approaches positive infinity as x-value approaches $x3 from the left. The right piece approaches negative infinity as x-value approaches $x3 from the right, crosses ($x1,0), and approaches y=1 horizontally as x-value approaches positive infinity."; +$alt[3] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $x2 from the left. The middle piece approaches negative infinity as x-value approaches $x2 from the right, crosses ($x4,0) and ($x3,0), and approaches negative infinity as x-value approaches $x1 from the left. The right piece approaches positive infinity as x-value approaches $x1 from the right, and approaches y=0 horizontally as x-value approaches positive infinity."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + if ( ($i==0) || ($i==3) ) { + $break1L = $x2-0.01; + $break1R = $x2+0.01; + $break2L = $x1-0.01; + $break2R = $x1+0.01; + } elsif ($i==2) { + $break1L = min($x3,$x4)-0.01; + $break1R = min($x3,$x4)+0.01; + $break2L = max($x3,$x4)-0.01; + $break2R = max($x3,$x4)+0.01; + } else { + $break1L = -$x1-0.01; + $break1R = -$x1+0.01; + $break2L = -$x2-0.01; + $break2R = -$x2+0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$break1L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break1R,$break2L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break2R,$bound> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$s1 = $f[0]->eval(x=>-10); +$boa = ($s1>1) ? "above" : "below"; +$s2 = Compute("$b2*x+$c2")->reduce; +$s3 = Compute("$b1*x+$c1")->reduce; +$s4 = Compute("($b2-$b1)*x")->reduce; +if ($b1==1) {$s7 = "+(-10)";} + elsif ($b1==-1) {$s7 = "-(-10)";} + elsif ($b1==0) {$s7 = "";} + else {$s7 = ($b1>0) ? "+$b1(-10)" : "$b1(-10)";} +if ($b2==1) {$s8 = "+(-10)";} + elsif ($b2==-1) {$s8 = "-(-10)";} + elsif ($b2==0) {$s8 = "";} + else {$s8 = ($b2>0) ? "+$b2(-10)" : "$b2(-10)";} + +BEGIN_PGML_SOLUTION + +###Simplifying Function and Locating Hole(s) + +The function [`f(x)=[$f[0]]`] can be factored: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + &= [$func] \\ +\end{aligned} + ``] + +Since the function cannot be reduced, its graph has no holes. + +###Finding [`X`]-Intercept(s) and [`Y`]-Intercept + +The function's [`y`]-intercept is at [`f(0)=[$yInt]`]. By solving for [`x`] in [`[$numF]=0`], we can see the function's [`x`]-intercept is at [`[$xIntL]`] and [`[$xIntR]`]. + +###Finding Vertical and Horizontal Asymptote(s) + +By the denominator of [`f(x)=[$func]`], we can tell the function has two vertical asymptotes at [`x=[$x1]`] and [`x=[$x2]`]. + +The degree of both the numerator and the denominator in [`f(x)=[$f[0]]`] is [`2`]. This implies the function's horizontal asymptote is determined by the leading coefficients of the numerator and denominator. We can see the horizontal asymptote is at [`y=\frac{1}{1}=1`]. + +###Locating Where the Function Intersects its Horizontal Asymptote + +Next, we need to find where the function's graph intersects with its horizontal asymptote. We set [`f(x)=1`] and then solve for [`x`]: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + 1 &= [$f[0]] \\ + 1 \cdot ([$den]) &= [$f[0]] \cdot ([$den]) \\ + [$den] &= [$num]\\ + [$s2] &= [$s3] \\ + [$s4] &= [$s5] \\ + x &= [$s6] +\end{aligned} + ``] + +The result implies the function's graph intersects with [`y=1`] at [`([$s6],1)`]. + +###Determining the Function's Behavior When [`X`]-Value Approaches Negative Infinity + +We need to know whether the function approaches [`y=1`] from above or below when its [`x`]-value approaches negative infinity. We can do this by substituting [`x=-10`] (or a similarly small number) into [`f(x)`], and we have: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + f(-10) &= \frac{(-10)^2[$s7]+[$c1]}{(-10)^2[$s8]+[$c2]} \\ + &= [$s1] +\end{aligned} + ``] + +The result implies the function's value approaches [`y=1`] from below when the [`x`]-value approaches negative infinity. + +###Sketching the Function's Graph + +The following is an analysis of the function's graph. + +* The function's graph approaches [`y=1`] from below when the [`x`]-value approaches negative infinity. +* The function's graph curves down first, and then curves up to cross [`y=1`] at [`([$s6],1)`], and then approaches positive infinity as [`x`]-value approaches [`[$x2]`] from the left. +* In the denominator of [`f(x)=[$func]`], the power of [`(x-[$x2])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x2]`]. The function's graph approaches negative infinity as [`x`]-value approaches [`[$x2]`] from the right. +* The function's graph curves up to meet its [`x`]-intercept at [`x=[$x4]`]. In the numerator of [`f(x)=[$func]`], the power of [`(x-[$x4])`] is [`1`], implying the function's graph crosses the [`x`]-axis at [`([$x4],0)`]. +* The function's graph curves down to meet its second [`x`]-intercept at [`[$x3]`], In the numerator of [`f(x)=[$func]`], the power of [`(x-[$x3])`] is [`1`], implying the function crosses the [`x`]-axis at [`([$x3],0)`]. +* The function's graph approaches negative infinity as [`x`]-value approaches [`[$x1]`] from the left. +* In the denominator of [`f(x)=[$func]`], the power of [`(x-[$x1])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x1]`]. The function's graph approaches positive infinity as [`x`]-value approaches [`[$x1]`] from the right. +* Finally, the function's graph approaches [`y=1`] from above as [`x`]-value approaches positive infinity. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions130.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions130.pg new file mode 100644 index 0000000000..0c6553043c --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions130.pg @@ -0,0 +1,345 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +do { + +do { + $x1 = random(1,4,1); + $x3 = non_zero_random(-2,$x1-1,1); + $x2 = non_zero_random(-3,$x3-1,1); + $x4 = non_zero_random(-4,$x2-1,1); + $b1 = -$x3-$x4; + $c1 = $x3*$x4; + $b2 = -$x1-$x2; + $c2 = $x1*$x2; +} until ( ($b1!=$b2) && (abs($x3)!=abs($x1)) && (abs($x3)!=abs($x2)) && (abs($x4)!=abs($x1)) && (abs($x4)!=abs($x2)) ); + +$x1N = -$x1; +$x2N = -$x2; +$x3N = -$x3; +$x4N = -$x4; + +$s5 = $c1-$c2; +$s6 = $s5/($b2-$b1); + +$numF = Formula("(x-$x3)*(x-$x4)")->reduce; +$denF = Formula("(x-$x1)*(x-$x2)")->reduce; +$num = Formula("x**2+$b1*x+$c1")->reduce; +$den = Formula("x**2+$b2*x+$c2")->reduce; +$func = Formula("$numF/($denF)")->reduce; +$f[0] = Formula("$num/($den)")->reduce; +$f[1] = Formula("(x+$x3)(x+$x4)/((x+$x1)(x+$x2))")->reduce; +$f[2] = Formula("(x-$x1)(x-$x2)/((x-$x3)(x-$x4))")->reduce; +$f[3] = Formula("$num/((x-$x1)*(x-$x2)**2)")->reduce; + +$yInt = $c1/$c2; +$xIntL = min($x3,$x4); +$xIntR = max($x3,$x4); + +@hy = ( ); +$hy[0] = $f[0]->eval(x=>5); +$hy[1] = $f[1]->eval(x=>5); +$hy[2] = $f[2]->eval(x=>5); +$hy[3] = $f[3]->eval(x=>5); +$hy[4] = $f[0]->eval(x=>-5); +$hy[5] = $f[1]->eval(x=>-5); +$hy[6] = $f[2]->eval(x=>-5); +$hy[7] = $f[3]->eval(x=>-5); +$hy[8] = $f[0]->eval(x=>($x2+$x3)/2+0.1); +$hy[9] = $f[1]->eval(x=>($x2+$x3)/2+0.1); +$hy[10] = $f[2]->eval(x=>($x2+$x3)/2+0.1); +$hy[11] = $f[3]->eval(x=>($x2+$x3)/2+0.1); + +$flag = 0; +for (my $i=0; $i<=11; $i++) { + if (abs($hy[$i])>10) { + $flag = 1; + last; + } +} + +} until ( ($flag==0) && (abs($s6)<=5) ); + +@alt = (); +$alt[0] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, crosses ($x4,0), and approaches negative infinity as x-value approaches $x2 from the left. The middle piece approaches positive infinity as x-value approaches $x2 from the right, crosses ($x3,0), and approaches negative infinity as x-value approaches $x1 from the left. The right piece approaches positive infinity as x-value approaches $x1 from the right, and approaches y=1 horizontally as x-value approaches positive infinity."; +$alt[1] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x1N from the left. The middle piece approaches negative infinity as x-value approaches $x1N from the right, crosses ($x3N,0), and approaches positive infinity as x-value approaches $x2N from the left. The right piece approaches negative infinity as x-value approaches $x2N from the right, crosses ($x4N,0), and approaches y=1 horizontally as x-value approaches positive infinity."; +$alt[2] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x4 from the left. The middle piece approaches negative infinity as x-value approaches $x4 from the right, crosses ($x2,0), and approaches positive infinity as x-value approaches $x3 from the left. The right piece approaches negative infinity as x-value approaches $x3 from the right, crosses ($x1,0), and approaches y=1 horizontally as x-value approaches positive infinity."; +$alt[3] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, crosses ($x4,0), and approaches positive infinity as x-value approaches $x2 from the left. The middle piece approaches positive infinity as x-value approaches $x2 from the right, crosses ($x3,0), and approaches negative infinity as x-value approaches $x1 from the left. The right piece approaches positive infinity as x-value approaches $x1 from the right, and approaches y=0 horizontally as x-value approaches positive infinity."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + if ( ($i==0) || ($i==3) ) { + $break1L = $x2-0.01; + $break1R = $x2+0.01; + $break2L = $x1-0.01; + $break2R = $x1+0.01; + } elsif ($i==2) { + $break1L = min($x3,$x4)-0.01; + $break1R = min($x3,$x4)+0.01; + $break2L = max($x3,$x4)-0.01; + $break2R = max($x3,$x4)+0.01; + } else { + $break1L = -$x1-0.01; + $break1R = -$x1+0.01; + $break2L = -$x2-0.01; + $break2R = -$x2+0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$break1L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break1R,$break2L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break2R,$bound> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$s1 = $f[0]->eval(x=>-10); +$boa = ($s1>1) ? "above" : "below"; +$s2 = Compute("$b2*x+$c2")->reduce; +$s3 = Compute("$b1*x+$c1")->reduce; +$s4 = Compute("($b2-$b1)*x")->reduce; +if ($b1==1) {$s7 = "+(-10)";} + elsif ($b1==-1) {$s7 = "-(-10)";} + elsif ($b1==0) {$s7 = "";} + else {$s7 = ($b1>0) ? "+$b1(-10)" : "$b1(-10)";} +if ($b2==1) {$s8 = "+(-10)";} + elsif ($b2==-1) {$s8 = "-(-10)";} + elsif ($b2==0) {$s8 = "";} + else {$s8 = ($b2>0) ? "+$b2(-10)" : "$b2(-10)";} + +BEGIN_PGML_SOLUTION + +###Simplifying Function and Locating Hole(s) + +The function [`f(x)=[$f[0]]`] can be factored: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + &= [$func] \\ +\end{aligned} + ``] + +Since the function cannot be reduced, its graph has no holes. + +###Finding [`X`]-Intercept(s) and [`Y`]-Intercept + +The function's [`y`]-intercept is at [`f(0)=[$yInt]`]. By solving for [`x`] in [`[$numF]=0`], we can see the function's [`x`]-intercept is at [`[$xIntL]`] and [`[$xIntR]`]. + +###Finding Vertical and Horizontal Asymptote(s) + +By the denominator of [`f(x)=[$func]`], we can tell the function has two vertical asymptotes at [`x=[$x1]`] and [`x=[$x2]`]. + +The degree of both the numerator and the denominator in [`f(x)=[$f[0]]`] is [`2`]. This implies the function's horizontal asymptote is determined by the leading coefficients of the numerator and denominator. We can see the horizontal asymptote is at [`y=\frac{1}{1}=1`]. + +###Locating Where the Function Intersects its Horizontal Asymptote + +Next, we need to find where the function's graph intersects with its horizontal asymptote. We set [`f(x)=1`] and then solve for [`x`]: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + 1 &= [$f[0]] \\ + 1 \cdot ([$den]) &= [$f[0]] \cdot ([$den]) \\ + [$den] &= [$num]\\ + [$s2] &= [$s3] \\ + [$s4] &= [$s5] \\ + x &= [$s6] +\end{aligned} + ``] + +The result implies the function's graph intersects with [`y=1`] at [`([$s6],1)`]. + +###Determining the Function's Behavior When [`X`]-Value Approaches Negative Infinity + +We need to know whether the function approaches [`y=1`] from above or below when its [`x`]-value approaches negative infinity. We can do this by substituting [`x=-10`] (or a similarly small number) into [`f(x)`], and we have: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + f(-10) &= \frac{(-10)^2[$s7]+[$c1]}{(-10)^2[$s8]+[$c2]} \\ + &= [$s1] +\end{aligned} + ``] + +The result implies the function's value approaches [`y=1`] from below when the [`x`]-value approaches negative infinity. + +###Sketching the Function's Graph + +The following is an analysis of the function's graph. + +* The function's graph approaches [`y=1`] from below when the [`x`]-value approaches negative infinity. +* The function's graph curves down to meet its [`x`]-intercept at [`([$x4],0)`]. In the numerator of [`f(x)=[$func]`], the power of [`(x-[$x4])`] is [`1`], implying the function's graph crosses the [`x`]-axis at [`([$x4],0)`]. +* The function's graph approaches negative infinity as [`x`]-value approaches [`[$x2]`] from the left. +* In the denominator of [`f(x)=[$func]`], the power of [`(x-[$x2])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x2]`]. The function's graph approaches negative infinity as [`x`]-value approaches [`[$x2]`] from the right. +* The function's graph curves down and crosses its horizontal asymptote, [`y=1`], at [`([$s6],1)`], and then meet its [`x`]-intercept at [`([$x3],0)`]. In the numerator of [`f(x)=[$func]`], the power of [`(x-[$x3])`] is [`1`], implying the function's graph crosses the [`x`]-axis at [`([$x3],0)`]. +* The function's graph approaches negative infinity as [`x`]-value approaches [`[$x1]`] from the left. +* In the denominator of [`f(x)=[$func]`], the power of [`(x-[$x1])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x1]`]. The function's graph approaches negative infinity as [`x`]-value approaches [`[$x1]`] from the right. +* Finally, the function's graph approaches [`y=1`] from above as [`x`]-value approaches positive infinity. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions140.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions140.pg new file mode 100644 index 0000000000..d96ecb6845 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions140.pg @@ -0,0 +1,344 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +do { + +do { + $x3 = non_zero_random(-1,4,1); + $x1 = non_zero_random(-2,$x3-1,1); + $x2 = $x1; + $x4 = non_zero_random(-4,$x2-1,1); + $b1 = -$x3-$x4; + $c1 = $x3*$x4; + $b2 = -$x1-$x2; + $c2 = $x1*$x2; +} until ( ($b1!=$b2) && (abs($x3)!=abs($x1)) && (abs($x3)!=abs($x2)) && (abs($x4)!=abs($x1)) && (abs($x4)!=abs($x2)) ); + +$x1N = -$x1; +$x2N = -$x2; +$x3N = -$x3; +$x4N = -$x4; + +$s5 = $c1-$c2; +$s6 = $s5/($b2-$b1); + +$numF = Formula("(x-$x3)*(x-$x4)")->reduce; +$denF = Formula("(x-$x1)**2")->reduce; +$num = Formula("x**2+$b1*x+$c1")->reduce; +$den = Formula("x**2+$b2*x+$c2")->reduce; +$func = Formula("$numF/($denF)")->reduce; +$f[0] = Formula("$num/($den)")->reduce; +$f[1] = Formula("(x+$x3)(x+$x4)/((x+$x1)(x+$x2))")->reduce; +$f[2] = Formula("(x-$x1)(x-$x2)/((x-$x3)(x-$x4))")->reduce; +$f[3] = Formula("$num/((x-$x1)*(x-$x2)**2)")->reduce; + +$yInt = $c1/$c2; +$xIntL = min($x3,$x4); +$xIntR = max($x3,$x4); + +@hy = ( ); +$hy[0] = $f[0]->eval(x=>5); +$hy[1] = $f[1]->eval(x=>5); +$hy[2] = $f[2]->eval(x=>5); +$hy[3] = $f[3]->eval(x=>5); +$hy[4] = $f[0]->eval(x=>-5); +$hy[5] = $f[1]->eval(x=>-5); +$hy[6] = $f[2]->eval(x=>-5); +$hy[7] = $f[3]->eval(x=>-5); + +$flag = 0; +for (my $i=0; $i<=7; $i++) { + if (abs($hy[$i])>10) { + $flag = 1; + last; + } +} + +} until ( ($flag==0) && (abs($s6)<=5) && ($s6>$x1) ); + +@alt = (); +$alt[0] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, crosses ($x4,0), and approaches negative infinity as x-value approaches $x2 from the left. The right piece approaches negative infinity as x-value approaches $x2 from the right, crosses ($x3,0), and approaches y=1 horizontally as x-value approaches positive infinity."; +$alt[1] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, crosses ($x3N,0), and approaches negative infinity as x-value approaches $x2N from the left. The right piece approaches negative infinity as x-value approaches $x2N from the right, crosses ($x4N,0), and approaches y=1 horizontally as x-value approaches positive infinity."; +$alt[2] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x4 from the left. The middle piece approaches negative infinity as x-value approaches $x4 from the right, touches ($x2,0), and approaches negative infinity as x-value approaches $x3 from the left. The right piece approaches positive infinity as x-value approaches $x3 from the right, and approaches y=1 horizontally as x-value approaches positive infinity."; +$alt[3] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, crosses ($x4,0), and approaches positive infinity as x-value approaches $x2 from the left. The right piece approaches negative infinity as x-value approaches $x2 from the right, and approaches y=0 horizontally as x-value approaches positive infinity."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + if ( ($i==0) || ($i==3) ) { + $breakL = $x2-0.01; + $breakR = $x2+0.01; + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$breakL> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$breakR,$bound> " . + "using color:blue and weight:2"); + } elsif ($i==1) { + $breakL = -$x2-0.01; + $breakR = -$x2+0.01; + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$breakL> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$breakR,$bound> " . + "using color:blue and weight:2"); + } else { + $break1L = min($x3,$x4)-0.01; + $break1R = min($x3,$x4)+0.01; + $break2L = max($x3,$x4)-0.01; + $break2R = max($x3,$x4)+0.01; + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$break1L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break1R,$break2L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break2R,$bound> " . + "using color:blue and weight:2"); + } + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$s1 = $f[0]->eval(x=>-10); +$boa = ($s1>1) ? "above" : "below"; +$s2 = Compute("$b2*x+$c2")->reduce; +$s3 = Compute("$b1*x+$c1")->reduce; +$s4 = Compute("($b2-$b1)*x")->reduce; +if ($b1==1) {$s7 = "+(-10)";} + elsif ($b1==-1) {$s7 = "-(-10)";} + elsif ($b1==0) {$s7 = "";} + else {$s7 = ($b1>0) ? "+$b1(-10)" : "$b1(-10)";} +if ($b2==1) {$s8 = "+(-10)";} + elsif ($b2==-1) {$s8 = "-(-10)";} + elsif ($b2==0) {$s8 = "";} + else {$s8 = ($b2>0) ? "+$b2(-10)" : "$b2(-10)";} + +BEGIN_PGML_SOLUTION + +###Simplifying Function and Locating Hole(s) + +The function [`f(x)=[$f[0]]`] can be factored: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + &= [$func] \\ +\end{aligned} + ``] + +Since the function cannot be reduced, its graph has no holes. + +###Finding [`X`]-Intercept(s) and [`Y`]-Intercept + +The function's [`y`]-intercept is at [`f(0)=[$yInt]`]. By solving for [`x`] in [`[$numF]=0`], we can see the function's [`x`]-intercept is at [`[$xIntL]`] and [`[$xIntR]`]. + +###Finding Vertical and Horizontal Asymptote(s) + +By the denominator of [`f(x)=[$func]`], we can tell the function has one vertical asymptotes at [`x=[$x1]`]. + +The degree of both the numerator and the denominator in [`f(x)=[$f[0]]`] is [`2`]. This implies the function's horizontal asymptote is determined by the leading coefficients of the numerator and denominator. We can see the horizontal asymptote is at [`y=\frac{1}{1}=1`]. + +###Locating Where the Function Intersects its Horizontal Asymptote + +Next, we need to find where the function's graph intersects with its horizontal asymptote. We set [`f(x)=1`] and then solve for [`x`]: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + 1 &= [$f[0]] \\ + 1 \cdot ([$den]) &= [$f[0]] \cdot ([$den]) \\ + [$den] &= [$num]\\ + [$s2] &= [$s3] \\ + [$s4] &= [$s5] \\ + x &= [$s6] +\end{aligned} + ``] + +The result implies the function's graph intersects with [`y=1`] at [`([$s6],1)`]. + +###Determining the Function's Behavior When [`X`]-Value Approaches Negative Infinity + +We need to know whether the function approaches [`y=1`] from above or below when its [`x`]-value approaches negative infinity. We can do this by substituting [`x=-10`] (or a similarly small number) into [`f(x)`], and we have: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + f(-10) &= \frac{(-10)^2[$s7]+[$c1]}{(-10)^2[$s8]+[$c2]} \\ + &= [$s1] +\end{aligned} + ``] + +The result implies the function's value approaches [`y=1`] from below when the [`x`]-value approaches negative infinity. + +###Sketching the Function's Graph + +The following is an analysis of the function's graph. + +* The function's graph approaches [`y=1`] from below when the [`x`]-value approaches negative infinity. +* The function's graph curves down to meet its [`x`]-intercept at [`([$x4],0)`]. In the numerator of [`f(x)=[$func]`], the power of [`(x-[$x4])`] is [`1`], implying the function's graph crosses the [`x`]-axis at [`([$x4],0)`]. +* The function's graph approaches negative infinity as [`x`]-value approaches [`[$x2]`] from the left. +* In the denominator of [`f(x)=[$func]`], the power of [`(x-[$x2])`] is [`2`], implying the function's graph approaches the same infinity at both sides of [`x=[$x2]`]. The function's graph approaches negative infinity as [`x`]-value approaches [`[$x2]`] from the right. +* The function's graph curves up and meets its [`x`]-intercept at [`([$x3],0)`]. In the numerator of [`f(x)=[$func]`], the power of [`(x-[$x3])`] is [`1`], implying the function's graph crosses the [`x`]-axis at [`([$x3],0)`]. +* The function's graph crosses its horizontal asymptote, [`y=1`] at [`([$s6],1)`], and then curves down to approach [`y=1`] from above as [`x`]-value approaches positive infinity. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions20.pg new file mode 100644 index 0000000000..cd86b7bec5 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions20.pg @@ -0,0 +1,229 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$h = non_zero_random(-4,4,1); +$v = non_zero_random(-4,4,1); +$k = -random(2,5,1); +$hN = -$h; +$kN = -$k; + +$func = Formula("$k/(x+$h)+$v")->reduce; +$funcF = Formula("$k/(x+$h)")->reduce; +$f[0] = Formula("$k/(x+$h)+$v")->reduce; +$f[1] = Formula("$k/(x-$h)+$v")->reduce; +$f[2] = Formula("-$k/(x+$h)+$v")->reduce; +$f[3] = Formula("-$k/(x-$h)+$v")->reduce; +$f[4] = Formula("-1/x")->reduce; + +@alt = (); +$alt[0] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $hN from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches negative infinity as x-value approaches $hN from the right."; +$alt[1] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $h from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches negative infinity as x-value approaches $h from the right."; +$alt[2] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $hN from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $hN from the right."; +$alt[3] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $h from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $h from the right."; +$alt[4] = "This is the graph of f(x)=1/x, with two pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches 0 from the left. The right piece approaches y=0 horizontally as x-value approaches positive infinity, and approaches negative infinity as x-value approaches 0 from the right."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. +if ( ($i==0) || ($i==2) ) { + $breakL = -$h-0.01; + $breakR = -$h+0.01; +} else { + $breakL = $h-0.01; + $breakR = $h+0.01; +} +if ($i==4) { + $breakL = -0.01; + $breakR = 0.01; +} +add_functions($graphs[$i], "$f[$i] for x in <-$bound,$breakL> " . + "using color:blue and weight:2"); +add_functions($graphs[$i], "$f[$i] for x in <$breakR,$bound> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$absH = abs($h); +$absV = abs($v); +$lor = ($h>0) ? "left" : "right"; +$uod = ($v>0) ? "up" : "down"; + +BEGIN_PGML_SOLUTION + +First, you need to be familiar with the graph of [`y=-\frac{1}{x}`]: + +>>[@ image(insertGraph( $graphs[ 4 ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'") @]*<< + +The given function, [`f(x)=[$f[0]]`], is a transformation of [`y=\frac{1}{x}`]: + +* The leading negative symbol in [`[$funcF]`] does a reflection by the [`x`]-axis. +* The number [`[$kN]`] in [`[$funcF]`] does a vertical stretch by a factor of [`[$k]`]. +* The number [`[$h]`] does a horizontal shift to the [$lor] by [`[$absH]`] units. +* The number [`[$v]`] does a vertical shift [$uod] by [`[$absV]`] units. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions30.pg new file mode 100644 index 0000000000..a9c303aba9 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions30.pg @@ -0,0 +1,228 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$h = non_zero_random(-4,4,1); +$v = non_zero_random(-4,4,1); +$k = random(2,5,1); +$hN = -$h; +$vN = -$v; + +$func = Formula("$k/(x+$h)^2+$v")->reduce; +$funcF = Formula("$k/(x+$h)^2")->reduce; +$f[0] = Formula("$k/(x+$h)^2+$v")->reduce; +$f[1] = Formula("$k/(x-$h)^2+$v")->reduce; +$f[2] = Formula("$k/(x+$h)+$v")->reduce; +$f[3] = Formula("$k/(x-$h)+$v")->reduce; +$f[4] = Formula("1/x^2")->reduce; + +@alt = (); +$alt[0] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $hN from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $hN from the right."; +$alt[1] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $h from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $h from the right."; +$alt[2] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $hN from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $hN from the right."; +$alt[3] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $h from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $h from the right."; +$alt[4] = "This is the graph of f(x)=1/x^2, with two pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches 0 from the left. The right piece approaches y=0 horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches 0 from the right."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. +if ( ($i==0) || ($i==2) ) { + $breakL = -$h-0.01; + $breakR = -$h+0.01; +} else { + $breakL = $h-0.01; + $breakR = $h+0.01; +} +if ($i==4) { + $breakL = -0.01; + $breakR = 0.01; +} +add_functions($graphs[$i], "$f[$i] for x in <-$bound,$breakL> " . + "using color:blue and weight:2"); +add_functions($graphs[$i], "$f[$i] for x in <$breakR,$bound> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$absH = abs($h); +$absV = abs($v); +$lor = ($h>0) ? "left" : "right"; +$uod = ($v>0) ? "up" : "down"; + +BEGIN_PGML_SOLUTION + +First, you need to be familiar with the graph of [`y=\frac{1}{x^2}`]: + +>>[@ image(insertGraph( $graphs[ 4 ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'") @]*<< + +The given function, [`f(x)=[$f[0]]`], is a transformation of [`y=\frac{1}{x^2}`]: + +* The number [`[$k]`] in [`[$funcF]`] does a vertical stretch by a factor of [`[$k]`]. +* The number [`[$h]`] does a horizontal shift to the [$lor] by [`[$absH]`] units. +* The number [`[$v]`] does a vertical shift [$uod] by [`[$absV]`] units. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions40.pg new file mode 100644 index 0000000000..43a4bfe224 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions40.pg @@ -0,0 +1,231 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$h = non_zero_random(-4,4,1); +$v = non_zero_random(-4,4,1); +$k = -random(2,5,1); +$hN = -$h; +$vN = -$v; +$kN = -$k; + +$func = Formula("$k/(x+$h)^2+$v")->reduce; +$funcF = Formula("$k/(x+$h)^2")->reduce; +$f[0] = Formula("$k/(x+$h)^2+$v")->reduce; +$f[1] = Formula("$k/(x-$h)^2+$v")->reduce; +$f[2] = Formula("$k/(x+$h)+$v")->reduce; +$f[3] = Formula("$k/(x-$h)+$v")->reduce; +$f[4] = Formula("1/x^2")->reduce; + +@alt = (); +$alt[0] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $hN from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches negative infinity as x-value approaches $hN from the right."; +$alt[1] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $h from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches negative infinity as x-value approaches $h from the right."; +$alt[2] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $hN from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches negative infinity as x-value approaches $hN from the right."; +$alt[3] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $h from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches negative infinity as x-value approaches $h from the right."; +$alt[4] = "This is the graph of f(x)=-1/x^2, with two pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches 0 from the left. The right piece approaches y=0 horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches 0 from the right."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. +if ( ($i==0) || ($i==2) ) { + $breakL = -$h-0.01; + $breakR = -$h+0.01; +} else { + $breakL = $h-0.01; + $breakR = $h+0.01; +} +if ($i==4) { + $breakL = -0.01; + $breakR = 0.01; +} +add_functions($graphs[$i], "$f[$i] for x in <-$bound,$breakL> " . + "using color:blue and weight:2"); +add_functions($graphs[$i], "$f[$i] for x in <$breakR,$bound> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$absH = abs($h); +$absV = abs($v); +$lor = ($h>0) ? "left" : "right"; +$uod = ($v>0) ? "up" : "down"; + +BEGIN_PGML_SOLUTION + +First, you need to be familiar with the graph of [`y=[$f[4]]`]: + +>>[@ image(insertGraph( $graphs[ 4 ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'") @]*<< + +The given function, [`f(x)=[$f[0]]`], is a transformation of [`y=[$f[4]]`]: + + +* The leading negative symbol in [`[$funcF]`] does a reflection by the [`x`]-axis. +* The number [`[$kN]`] in [`[$funcF]`] does a vertical stretch by a factor of [`[$k]`]. +* The number [`[$h]`] does a horizontal shift to the [$lor] by [`[$absH]`] units. +* The number [`[$v]`] does a vertical shift [$uod] by [`[$absV]`] units. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions50.pg new file mode 100644 index 0000000000..c5922110a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions50.pg @@ -0,0 +1,257 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$h = non_zero_random(-4,4,1); +$v = non_zero_random(-4,4,1); +$k = random(2,5,1); +$hN = -$h; +@holex = ( ); +@holey = ( ); +do {$holex[0] = non_zero_random(-4,4,1);} until (abs($holex[0])!=abs($h)); + +$func = Formula("$k*(x-$holex[0])/((x+$h)*(x-$holex[0]))+$v")->reduce; +$funcF = Formula("$k*(x-$holex[0])/((x+$h)*(x-$holex[0]))")->reduce; +$f[0] = Formula("$k/(x+$h)+$v")->reduce; +$f[1] = Formula("$k/(x+$h)+$v")->reduce; +$f[2] = Formula("$k/(x-$h)+$v")->reduce; +$f[3] = Formula("$k/(x-$h)+$v")->reduce; +$f[4] = Formula("1/x")->reduce; + +$holey[0] = $f[0]->eval(x=>$holex[0]); +$holex[1] = -$holex[0]; +$holey[1] = $f[1]->eval(x=>$holex[1]); +$holex[2] = $holex[0]; +$holey[2] = $f[2]->eval(x=>$holex[2]); +$holex[3] = -$holex[0]; +$holey[3] = $f[3]->eval(x=>$holex[3]); + +@alt = (); +$alt[0] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $hN from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $hN from the right. There is a hole at ($holex[0],$holey[0])."; +$alt[1] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $hN from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $hN from the right. There is a hole at ($holex[1],$holey[1])."; +$alt[2] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $h from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $h from the right. There is a hole at ($holex[2],$holey[2])."; +$alt[3] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=$v horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $h from the left. The right piece approaches y=$v horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $h from the right. There is a hole at ($holex[3],$holey[3])."; +$alt[4] = "This is the graph of f(x)=1/x, with two pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches 0 from the left. The right piece approaches y=0 horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches 0 from the right."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + if ( ($i==0) || ($i==1) ) { + $breakL = -$h-0.01; + $breakR = -$h+0.01; + } else { + $breakL = $h-0.01; + $breakR = $h+0.01; + } + if ($i==4) { + $breakL = -0.01; + $breakR = 0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$breakL> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$breakR,$bound> " . + "using color:blue and weight:2"); + + $graphs[$i]->stamps( open_circle($holex[$i],$holey[$i],'blue') ); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +Choose the graph of the function [`f(x)=[$func]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$absH = abs($h); +$absV = abs($v); +$lor = ($h>0) ? "left" : "right"; +$uod = ($v>0) ? "up" : "down"; + +BEGIN_PGML_SOLUTION + +The given function can be reduced: + + [``f(x)=[$func]=[$f[0]]``] + +Note that there is a hole at [`x=[$holex[0]]`]. To calculate the [`y`] value of the hole, we can substitute [`x=[$holex[0]]`] into [`f(x)=[$f[0]]`]: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + f([$holex[0]]) &= \frac{[$k]}{[$holex[0]]+[$h]}+[$v] \\ + f([$holex[0]]) &= [$holey[0]] +\end{aligned} + ``] + +The function [`f(x)=[$func]`] has a hole at [`([$holex[0]],[$holey[0]])`]. + +To sketch the graph of [`f(x)=[$f[0]]`], you need to be familiar with the graph of [`y=\frac{1}{x}`]: + +>>[@ image(insertGraph( $graphs[ 4 ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>"alt='$alt[4]' title = '$alt[4]'") @]*<< + +The function, [`f(x)=[$f[0]]`], is a transformation of [`y=\frac{1}{x}`]: + +* The number [`[$k]`] in [`[$funcF]`] does a vertical stretch by a factor of [`[$k]`]. +* The number [`[$h]`] does a horizontal shift to the [$lor] by [`[$absH]`] units. +* The number [`[$v]`] does a vertical shift [$uod] by [`[$absV]`] units. + +The correct graph for [`f(x)=[$func]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions60.pg new file mode 100644 index 0000000000..4d14d04936 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions60.pg @@ -0,0 +1,262 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$x1 = non_zero_random(1,4,1); +do {$x2 = non_zero_random(-4,-1,1);} until (abs($x1)!=abs($x2)); +$k = random(2,5,1); +$x1N = -$x1; +$x2N = -$x2; + +$num = Formula("$k*x")->reduce; +$den = Formula("(x-$x1)*(x-$x2)")->reduce; +$f[0] = Formula("($k*x)/((x-$x1)*(x-$x2))")->reduce; +$f[1] = Formula("-($k*x)/((x-$x1)*(x-$x2))")->reduce; +$f[2] = Formula("($k*x)/((x+$x1)*(x+$x2))")->reduce; +$f[3] = Formula("($k*x)/((x-$x1)*(x-$x2))+$k")->reduce; + +$yInt = 0; +$xInt = 0; + +@alt = (); +$alt[0] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $x2 from the left. The middle piece approaches positive infinity as x-value approaches $x2 from the right, and approaches negative infinity as x-value approaches $x1 from the left. The right piece approaches positive infinity as x-value approaches $x1 from the right, and approaches y=0 horizontally as x-value approaches positive infinity."; +$alt[1] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x2 from the left. The middle piece approaches negative infinity as x-value approaches $x2 from the right, and approaches positive infinity as x-value approaches $x1 from the left. The right piece approaches negative infinity as x-value approaches $x1 from the right, and approaches y=0 horizontally as x-value approaches positive infinity."; +$alt[2] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $x1N from the left. The middle piece approaches positive infinity as x-value approaches $x1N from the right, and approaches negative infinity as x-value approaches $x2N from the left. The right piece approaches positive infinity as x-value approaches $x2N from the right, and approaches y=0 horizontally as x-value approaches positive infinity."; +$alt[3] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=$k horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $x2 from the left. The middle piece approaches positive infinity as x-value approaches $x2 from the right, and approaches negative infinity as x-value approaches $x1 from the left. The right piece approaches positive infinity as x-value approaches $x1 from the right, and approaches y=$k horizontally as x-value approaches positive infinity."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + if ($i==2) { + $break1L = -$x1-0.01; + $break1R = -$x1+0.01; + $break2L = -$x2-0.01; + $break2R = -$x2+0.01; + } else { + $break1L = $x2-0.01; + $break1R = $x2+0.01; + $break2L = $x1-0.01; + $break2R = $x1+0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$break1L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break1R,$break2L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break2R,$bound> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +###Simplifying Function and Locating Hole(s) + +This function cannot be simplified, and thus has no hole. + +###Finding [`X`]-Intercept(s) and [`Y`]-Intercept + +The function's [`y`]-intercept is at [`f(0)=[$yInt]`]. By solving for [`x`] in [`[$f[0]]=0`], we can see the function's [`x`]-intercept is at [`[$xInt]`]. + +###Finding Vertical and Horizontal Asymptote(s) + +By the denominator [`[$den]`], we can tell the function has two vertical asymptotes at [`x=[$x1N]`] and [`x=[$x2N]`]. + +The degree of the numerator, [`[$num]`] is [`1`], while the degree of the denominator, [`[$den]=x^2+\ldots`], is [`2`]. This implies the function's horizontal asymptote is at [`y=0`]. + +###Locating Where the Function Intersects its Horizontal Asymptote + +Since the function's horizontal asymptote is the [`x`]-axis, its [`x`]-intercept, [`(0,0)`], is where the function intersects its horizontal asymptote. + +###Determining the Function's Behavior When [`X`]-Value Approaches Negative Infinity + +We need to know whether the function approaches [`y=0`] from the top (positive values) or the bottom (negative values) when its [`x`]-value approaches negative infinity. We can do this by substituting [`x=-10`] (or a similarly small number) into [`f(x)`], and we have: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + f(-10) &= \frac{[$k](-10)}{(-10+[$x1])(-10+[$x2])} \\ + &= \frac{\text{negative number}}{(\text{negative number})(\text{negative number})} \\ + &= \text{negative number} +\end{aligned} + ``] + +The result implies the function's value is negative when its [`x`]-value approaches negative infinity. + +###Sketching the Function's Graph + +The following is an analysis of the function's graph. + +* The function's graph approaches [`y=0`] from below when its [`x`]-value approaches negative infinity. +* As [`x`]-value increases, the function approaches negative infinity as [`x`]-value approaches [`[$x2]`] from the left. +* In the denominator, the power of [`(x-[$x2])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x2]`]. The function's graph approaches positive infinity as [`x`]-value approaches [`[$x2]`] from the right. +* The function's graph curves down to meet its [`x`]-intercept at [`x=0`]. +* In the numerator, the power of [`x`] is [`1`], implying the function crosses the [`x`]-axis at [`(0,0)`]. +* The function's graph approaches negative infinity as [`x`]-value approaches [`[$x1]`] from the left. +* In the denominator, the power of [`(x-[$x1])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x1]`]. The function's graph approaches positive infinity as [`x`]-value approaches [`[$x1]`] from the right. +* Finally, the function's graph approaches [`y=0`] from above as [`x`]-value approaches positive infinity. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions70.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions70.pg new file mode 100644 index 0000000000..cbd9e854a5 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions70.pg @@ -0,0 +1,263 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$x1 = non_zero_random(1,4,1); +do {$x2 = non_zero_random(-4,-1,1);} until (abs($x1)!=abs($x2)); +$k = -random(2,5,1); +$kN = -$k; +$x1N = -$x1; +$x2N = -$x2; + +$num = Formula("$k*x")->reduce; +$den = Formula("(x-$x1)*(x-$x2)")->reduce; +$f[0] = Formula("($k*x)/((x-$x1)*(x-$x2))")->reduce; +$f[1] = Formula("-($k*x)/((x-$x1)*(x-$x2))")->reduce; +$f[2] = Formula("($k*x)/((x+$x1)*(x+$x2))")->reduce; +$f[3] = Formula("($k*x)/((x-$x1)*(x-$x2))+$k")->reduce; + +$yInt = 0; +$xInt = 0; + +@alt = (); +$alt[0] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x2 from the left. The middle piece approaches negative infinity as x-value approaches $x2 from the right, and approaches positive infinity as x-value approaches $x1 from the left. The right piece approaches negative infinity as x-value approaches $x1 from the right, and approaches y=0 horizontally as x-value approaches positive infinity."; +$alt[1] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $x2 from the left. The middle piece approaches positive infinity as x-value approaches $x2 from the right, and approaches negative infinity as x-value approaches $x1 from the left. The right piece approaches positive infinity as x-value approaches $x1 from the right, and approaches y=0 horizontally as x-value approaches positive infinity."; +$alt[2] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x1N from the left. The middle piece approaches negative infinity as x-value approaches $x1N from the right, and approaches positive infinity as x-value approaches $x2N from the left. The right piece approaches negative infinity as x-value approaches $x2N from the right, and approaches y=0 horizontally as x-value approaches positive infinity."; +$alt[3] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=$k horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x2 from the left. The middle piece approaches negative infinity as x-value approaches $x2 from the right, and approaches positive infinity as x-value approaches $x1 from the left. The right piece approaches negative infinity as x-value approaches $x1 from the right, and approaches y=$k horizontally as x-value approaches positive infinity."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + if ($i==2) { + $break1L = -$x1-0.01; + $break1R = -$x1+0.01; + $break2L = -$x2-0.01; + $break2R = -$x2+0.01; + } else { + $break1L = $x2-0.01; + $break1R = $x2+0.01; + $break2L = $x1-0.01; + $break2R = $x1+0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$break1L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break1R,$break2L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break2R,$bound> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +BEGIN_PGML_SOLUTION + +###Simplifying Function and Locating Hole(s) + +This function cannot be simplified, and thus has no hole. + +###Finding [`X`]-Intercept(s) and [`Y`]-Intercept + +The function's [`y`]-intercept is at [`f(0)=[$yInt]`]. By solving for [`x`] in [`[$f[0]]=0`], we can see the function's [`x`]-intercept is at [`[$xInt]`]. + +###Finding Vertical and Horizontal Asymptote(s) + +By the denominator [`[$den]`], we can tell the function has two vertical asymptotes at [`x=[$x1N]`] and [`x=[$x2N]`]. + +The degree of the numerator, [`[$num]`] is [`1`], while the degree of the denominator, [`[$den]=x^2+\ldots`], is [`2`]. This implies the function's horizontal asymptote is at [`y=0`]. + +###Locating Where the Function Intersects its Horizontal Asymptote + +Since the function's horizontal asymptote is the [`x`]-axis, its [`x`]-intercept, [`(0,0)`], is where the function intersects its horizontal asymptote. + +###Determining the Function's Behavior When [`X`]-Value Approaches Negative Infinity + +We need to know whether the function approaches [`y=0`] from the top (positive values) or the bottom (negative values) when its [`x`]-value approaches negative infinity. We can do this by substituting [`x=-10`] (or a similarly small number) into [`f(x)`], and we have: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + f(-10) &= -\frac{[$kN](-10)}{(-10+[$x1])(-10+[$x2])} \\ + &= -\frac{\text{negative number}}{(\text{negative number})(\text{negative number})} \\ + &= \text{positive number} +\end{aligned} + ``] + +The result implies the function's value is positive when its [`x`]-value approaches negative infinity. + +###Sketching the Function's Graph + +The following is an analysis of the function's graph. + +* The function's graph approaches [`y=0`] from above when its [`x`]-value approaches negative infinity. +* As [`x`]-value increases, the function approaches positive infinity as [`x`]-value approaches [`[$x2]`] from the left. +* In the denominator, the power of [`(x-[$x2])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x2]`]. The function's graph approaches negative infinity as [`x`]-value approaches [`[$x2]`] from the right. +* The function's graph curves up to meet its [`x`]-intercept at [`x=0`]. +* In the numerator, the power of [`x`] is [`1`], implying the function crosses the [`x`]-axis at [`(0,0)`]. +* The function's graph approaches positive infinity as [`x`]-value approaches [`[$x1]`] from the left. +* In the denominator, the power of [`(x-[$x1])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x1]`]. The function's graph approaches negative infinity as [`x`]-value approaches [`[$x1]`] from the right. +* Finally, the function's graph approaches [`y=0`] from below as [`x`]-value approaches positive infinity. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions80.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions80.pg new file mode 100644 index 0000000000..d81f0826b4 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions80.pg @@ -0,0 +1,308 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$x1 = non_zero_random(1,4,1); +do {$x2 = non_zero_random(-4,-1,1);} until (abs($x1)!=abs($x2)); +$k = random(2,5,1)*random(-1,1,2); +$kN = -$k; +$x1N = -$x1; +$x2N = -$x2; + +$num = Formula("$k*(x)**2")->reduce; +$den = Formula("(x-$x1)*(x-$x2)")->reduce; +$f[0] = Formula("($k*(x)**2)/((x-$x1)*(x-$x2))")->reduce; +$f[1] = Formula("($k*(x)**2)/((x+$x1)*(x+$x2))")->reduce; +$f[2] = Formula("($k*x)/((x-$x1)*(x-$x2))")->reduce; +$f[3] = Formula("($k*x)/((x+$x1)*(x+$x2))")->reduce; + +$yInt = 0; +$xInt = 0; + +$pon1 = ($k>0) ? "negative" : "positive"; +$pon2 = ($k<0) ? "negative" : "positive"; + +@alt = (); +$alt[0] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=$k horizontally as x-value approaches negative infinity, and approaches $pon2 infinity as x-value approaches $x2 from the left. The middle piece approaches $pon1 infinity as x-value approaches $x2 from the right, and approaches $pon1 infinity as x-value approaches $x1 from the left. The right piece approaches $pon2 infinity as x-value approaches $x1 from the right, and approaches y=$k horizontally as x-value approaches positive infinity."; +$alt[1] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=$k horizontally as x-value approaches negative infinity, and approaches $pon2 infinity as x-value approaches $x1N from the left. The middle piece approaches $pon1 infinity as x-value approaches $x1N from the right, and approaches $pon1 infinity as x-value approaches $x2N from the left. The right piece approaches $pon2 infinity as x-value approaches $x2N from the right, and approaches y=$k horizontally as x-value approaches positive infinity."; +$alt[2] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches $pon1 infinity as x-value approaches $x2 from the left. The middle piece approaches $pon2 infinity as x-value approaches $x2 from the right, and approaches $pon1 infinity as x-value approaches $x1 from the left. The right piece approaches $pon2 infinity as x-value approaches $x1 from the right, and approaches y=0 horizontally as x-value approaches positive infinity."; +$alt[3] = "This is a function's graph with three pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches $pon1 infinity as x-value approaches $x1N from the left. The middle piece approaches $pon2 infinity as x-value approaches $x1N from the right, and approaches $pon1 infinity as x-value approaches $x2N from the left. The right piece approaches $pon2 infinity as x-value approaches $x2N from the right, and approaches y=0 horizontally as x-value approaches positive infinity."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + if ( ($i==1) || ($i==3) ) { + $break1L = -$x1-0.01; + $break1R = -$x1+0.01; + $break2L = -$x2-0.01; + $break2R = -$x2+0.01; + } else { + $break1L = $x2-0.01; + $break1R = $x2+0.01; + $break2L = $x1-0.01; + $break2R = $x1+0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$break1L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break1R,$break2L> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$break2R,$bound> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +if ($k>0) { + $s1 = "\frac{$k x^2}{x^2+\ldots}"; + $s2 = "\frac{$k}{1}"; + $s3 = "\frac{$k(-10)}{(-10+$x1)(-10-$x2N)}"; +} else { + $s1 = "-\frac{$kN x^2}{x^2+\ldots}"; + $s2 = "-\frac{$kN}{1}"; + $s3 = "-\frac{$kN(-10)}{(-10+$x1)(-10-$x2N)}"; +} +$s4 = $f[0]->eval(x=>-10); + +$s5 = -$x1-$x2; +$s6 = $x1*$x2; +$s7 = $k*$s5; +$s8 = $k*$s6; +$s9 = -$s8; +$s10 = $s9/$s7; +$s11 = Compute("x^2+$s5*x+$s6")->reduce; + +BEGIN_PGML_SOLUTION + +###Simplifying Function and Locating Hole(s) + +This function cannot be simplified, and thus has no hole. + +###Finding [`X`]-Intercept(s) and [`Y`]-Intercept + +The function's [`y`]-intercept is at [`f(0)=[$yInt]`]. By solving for [`x`] in [`[$f[0]]=0`], we can see the function's [`x`]-intercept is at [`[$xInt]`]. + +###Finding Vertical and Horizontal Asymptote(s) + +By the denominator [`[$den]`], we can tell the function has two vertical asymptotes at [`x=[$x1N]`] and [`x=[$x2N]`]. + +The degree of the numerator is [`2`], while the degree of the denominator, [`[$den]=x^2+\ldots`], is also [`2`]. This implies the function's horizontal asymptote is determined by the leading coefficients of the numerator and denominator: + + [`` +\begin{aligned} + f(x) &= [$f[1]] \\ + &= [$s1] +\end{aligned} + ``] + +The function's horizontal asymptote is [`y=[$s2]=[$k]`]. + +###Locating Where the Function Intersects its Horizontal Asymptote + +Next, we need to find where the function's graph intersects with its horizontal asymptote. We set [`f(x)=[$k]`] and then solve for [`x`]: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + [$k] &= [$f[0]] \\ + [$k] \cdot [$den] &= [$f[0]] \cdot [$den] \\ + [$k]([$s11]) &= [$num] \\ + [$k]x^2+[$s7]x+[$s8] &= [$num] \\ + [$s7]x+[$s8] &= 0 \\ + [$s7]x &= [$s9] \\ + x &= [$s10] +\end{aligned} + ``] + +The result shows the function's graph intersects with its horizontal asymptote at [`([$s10],[$k])`]. + +###Determining the Function's Behavior When [`X`]-Value Approaches Negative Infinity + +We need to know whether the function approaches [`y=[$k]`] from above or below when its [`x`]-value approaches negative infinity. We can do this by substituting [`x=-10`] (or a similarly small number) into [`f(x)`], and we have: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + &= [$s3] \\ + &= [$s4] +\end{aligned} + ``] + +The result implies the function's value approaches [`y=[$k]`] from below when its [`x`]-value approaches negative infinity. + +###Sketching the Function's Graph + +The following is an analysis of the function's graph. + +* The function's graph approaches [`y=[$k]`] from below when its [`x`]-value approaches negative infinity. +* As [`x`]-value increases, the function curves up and crosses its horizontal asymptote at [`([$s10],[$k])`], and then approaches positive infinity as [`x`]-value approaches [`[$x2]`] from the left. +* In the denominator, the power of [`(x-[$x2])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x2]`]. The function's graph approaches negative infinity as [`x`]-value approaches [`[$x2]`] from the right. +* The function's graph curves up to meet its [`x`]-intercept at [`x=0`]. +* In the numerator, the power of [`x^2`] is [`2`], implying the function touches the [`x`]-axis at [`(0,0)`], and then goes down. +* The function's graph approaches negative infinity as [`x`]-value approaches [`[$x1]`] from the left. +* In the denominator, the power of [`(x-[$x1])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x1]`]. The function's graph approaches positive infinity as [`x`]-value approaches [`[$x1]`] from the right. +* Finally, the function's graph approaches [`y=[$k]`] from above as [`x`]-value approaches positive infinity. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions90.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions90.pg new file mode 100644 index 0000000000..3b474f0bd1 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/GraphingRationalFunctions90.pg @@ -0,0 +1,279 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$x1 = non_zero_random(1,4,1); +do {$x2 = non_zero_random(-4,-1,1);} until (abs($x1)!=abs($x2)); +$x1N = -$x1; +$x2N = -$x2; + +$num = Formula("(x-$x1)**2")->reduce; +$den = Formula("(x-$x1)*(x-$x2)")->reduce; +$func = Formula("(x-$x1)**2/((x-$x1)(x-$x2))")->reduce; +$f[0] = Formula("(x-$x1)/(x-$x2)")->reduce; +$f[1] = Formula("(x-$x1)/(x-$x2)")->reduce; +$f[2] = Formula("(x-$x1)/(x+$x2)")->reduce; +$f[3] = Formula("(x-$x1)/(x-$x2)**2")->reduce; + +$yInt = $x1/$x2; +$xInt = $x1; + +@hx = ( ); +@hy = ( ); +$hx[0] = $x1; +$hy[0] = $f[0]->eval(x=>$hx[0]); +$hx[2] = $x1; +$hy[2] = $f[2]->eval(x=>$hx[2]); +$hx[3] = $x1; +$hy[3] = $f[3]->eval(x=>$hx[3]); + +@alt = (); +$alt[0] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x2 from the left. The right piece approaches negative infinity as x-value approaches $x2 from the right, and approaches y=1 horizontally as x-value approaches positive infinity. There is a hole at ($hx[0],$hy[0])."; +$alt[1] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches positive infinity, and approaches positive infinity as x-value approaches $x2 from the left. The right piece approaches negative infinity as x-value approaches $x2 from the right, and approaches y=1 horizontally as x-value approaches positive infinity. There is no hole on this function's graph."; +$alt[2] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=1 horizontally as x-value approaches negative infinity, and approaches positive infinity as x-value approaches $x2N from the left. The right piece approaches negative infinity as x-value approaches $x2N from the right, and approaches y=1 horizontally as x-value approaches positive infinity. There is a hole at ($hx[2],$hy[2])."; +$alt[3] = "This is a function's graph with two pieces of smooth curves. The left piece approaches y=0 horizontally as x-value approaches negative infinity, and approaches negative infinity as x-value approaches $x2 from the left. The right piece approaches negative infinity as x-value approaches $x2 from the right, crosses ($x1,0), curves downward and approaches y=0 horizontally as x-value approaches positive infinity. There is a hole at ($hx[3],$hy[3])."; + +$bound = 10; +$xmin = -$bound; #The viewing window +$xmax = $bound; +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<4; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..$bound-1) { + $graphs[$i]->lb( new Label(-$bound+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-$bound+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-$bound+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-$bound+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($bound-0.3,0.4,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.4,$bound-0.3,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + if ( $i==2 ) { + $breakL = -$x2-0.01; + $breakR = -$x2+0.01; + } else { + $breakL = $x2-0.01; + $breakR = $x2+0.01; + } + add_functions($graphs[$i], "$f[$i] for x in <-$bound,$breakL> " . + "using color:blue and weight:2"); + add_functions($graphs[$i], "$f[$i] for x in <$breakR,$bound> " . + "using color:blue and weight:2"); + + if ($i!=1) { + $graphs[$i]->stamps( open_circle($hx[$i],$hy[$i],'blue') ); + } +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); +$answer = $zero+1; + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +Choose the graph of the function [`f(x)=[$func]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$s1 = $f[0]->eval(x=>-10); + +BEGIN_PGML_SOLUTION + +###Simplifying Function and Locating Hole(s) + +The function [`f(x)=[$func]`] can be reduced to [`f(x)=[$f[0]]`], implying the function has a hole at [`x=[$x1]`]. To find the hole's [`y`]-value, we substitute [`x=[$x1]`] into [`f(x)=[$f[0]]`], and we can see the hole is at [`([$x1],0)`]. + +###Finding [`X`]-Intercept(s) and [`Y`]-Intercept + +The function's [`y`]-intercept is at [`f(0)=[$yInt]`]. By solving for [`x`] in [`[$f[0]]=0`], we can see the function's [`x`]-intercept is at [`[$xInt]`]. + +###Finding Vertical and Horizontal Asymptote(s) + +By the denominator of [`f(x)=[$f[0]]`], we can tell the function has a vertical asymptote at [`x=[$x2]`]. + +The degree of both the numerator and the denominator in [`f(x)=[$f[0]]`] is [`1`]. This implies the function's horizontal asymptote is determined by the leading coefficients of the numerator and denominator. We can see the horizontal asymptote is at [`y=1`]. + +###Locating Where the Function Intersects its Horizontal Asymptote + +Next, we need to find where the function's graph intersects with its horizontal asymptote. We set [`f(x)=1`] and then solve for [`x`]: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + 1 &= [$f[0]] \\ + 1 \cdot (x-[$x2]) &= [$f[0]] \cdot (x-[$x2]) \\ + x-[$x2] &= x-[$x1] \\ + [$x2N] &= [$x1N] +\end{aligned} + ``] + +Since the equation has no solution, the function's graph doesn't intersect its horizontal asymptote. + +###Determining the Function's Behavior When [`X`]-Value Approaches Negative Infinity + +We need to know whether the function approaches [`y=1`] from above or below when its [`x`]-value approaches negative infinity. We can do this by substituting [`x=-10`] (or a similarly small number) into [`f(x)`], and we have: + + [`` +\begin{aligned} + f(x) &= [$f[0]] \\ + &= \frac{-10-[$x1]}{-10-[$x2]} \\ + &= [$s1] +\end{aligned} + ``] + +The result implies the function's value approaches [`y=1`] from above when the [`x`]-value approaches negative infinity. + +###Sketching the Function's Graph + +The following is an analysis of the function's graph. + +* The function's graph approaches [`y=1`] from above when the [`x`]-value approaches negative infinity. +* As [`x`]-value increases, the function curves up and approaches positive infinity as [`x`]-value approaches [`[$x2]`] from the left. +* In the denominator of [`f(x)=[$f[0]]`], the power of [`(x-[$x2])`] is [`1`], implying the function's graph approaches opposite infinities at both sides of [`x=[$x2]`]. The function's graph approaches negative infinity as [`x`]-value approaches [`[$x2]`] from the right. +* The function's graph curves up to meet its [`x`]-intercept at [`x=[$x1]`], crossing the [`y`]-intercept at [`(0,[$yInt])`]. However, a hole exists at [`([$x1],0)`], so the [`x`]-intercept is actually a hole. +* In the numerator of [`f(x)=[$f[0]]`], the power of [`(x-[$x1])`] is [`1`], implying the function crosses the [`x`]-axis at [`([$x1],0)`] (actually a hole). +* Finally, the function's graph approaches [`y=1`] from below as [`x`]-value approaches positive infinity. + +The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Limits10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Limits10.pg new file mode 100644 index 0000000000..6d179a8e44 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Limits10.pg @@ -0,0 +1,62 @@ +##DESCRIPTION +## Algebra problem: polynomial functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'polynomial function', 'end behavior') + +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +############################################# + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +$showPartialCredit = 1; + +$a = random(2,28,2); +$b = random(2,8,2); +$c = random(2,8,2); + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); + +$P = Formula("($a x^{10}+$c x +10)/($b x^{7} -3)")->reduce; + +$ans = Compute("inf"); + +############################################# + +BEGIN_PGML + +Given [``P(x)=[$P]``], + +a) As [`x\to \infty`], [`P(x)\to`][__________]{$ans} + +a) As [`x\to -\infty`], [`P(x)\to`][__________]{-$ans} + +END_PGML + +############################################# + +BEGIN_PGML_SOLUTION + +If we begin the long division for [`P(x)`], we have a quotient that begins [`\frac{[$a]}{[$b]}x^3+\cdots`]. + +So the function has long term behavior similar to [`x^3`]. This means that + +a) As [`x\to \infty`], [`P(x)\to[$ans]`] + +a) As [`x\to -\infty`], [`P(x)\to-[$ans]`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Limits20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Limits20.pg new file mode 100644 index 0000000000..c262c8c417 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Limits20.pg @@ -0,0 +1,63 @@ +##DESCRIPTION +## Algebra problem: polynomial functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'polynomial function', 'end behavior') + +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +############################################# + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; +$showPartialCredit = 1; + +$a = random(2,28,2); +$b = random(2,8,2); +$c = random(2,8,2); + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); + +$P = Formula("(-$a x^{4}+10)/($b x^{5} -$c)")->reduce; + +$ans = Compute("0"); + +############################################# + +BEGIN_PGML + +Given [``P(x)=[$P]``], + +a) As [`x\to \infty`], [`P(x)\to`][__________]{$ans} + +a) As [`x\to -\infty`], [`P(x)\to`][__________]{$ans} + +END_PGML + +############################################# + +BEGIN_PGML_SOLUTION + +Since the denominator has a higher degree than the numerator, there is a horizontal asymptote in both directions at [`y=0`]. (If we try long division for [`P(x)`], we have a quotient of [`0`] since we can't divide [`x^5`] into [`x^4`].) + +This means that + +a) As [`x\to \infty`], [`P(x)\to[$ans]`] + +a) As [`x\to -\infty`], [`P(x)\to[$ans]`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Limits30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Limits30.pg new file mode 100644 index 0000000000..b96d4471f4 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/RationalFunctions/Limits30.pg @@ -0,0 +1,65 @@ +##DESCRIPTION +## Algebra problem: polynomial functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'polynomial function', 'end behavior') + +############################################# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +############################################# + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; +$showPartialCredit = 1; + +$a = random(2,28,2); +$b = random(2,8,2); +$c = random(2,8,2); + +Context("Numeric"); +Context()->noreduce('(-x)+y','(-x)-y'); + +$P = Formula("(-$a x^{7}+10)/($b x^{5} -$c)")->reduce; + +$ans = Compute("-inf"); + +############################################# + +BEGIN_PGML + +Given [``P(x)=[$P]``], + +a) As [`x\to \infty`], [`P(x)\to`][__________]{$ans} + +a) As [`x\to -\infty`], [`P(x)\to`][__________]{$ans} + +END_PGML + +############################################# + +BEGIN_PGML_SOLUTION + +If we begin the long division for [`P(x)`], we have a quotient that begins [`\frac{-[$a]}{[$b]}x^2+\cdots`]. + +So the function has long term behavior similar to [`-x^2`]. This means that + +a) As [`x\to \infty`], [`P(x)\to[$ans]`] + +a) As [`x\to -\infty`], [`P(x)\to[$ans]`] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ChooseGraph2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ChooseGraph2.pg new file mode 100644 index 0000000000..4c2484d853 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ChooseGraph2.pg @@ -0,0 +1,218 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(-4,4,1); +$vershift = non_zero_random(-4,4,1); +$horscale = random(2,4,1); +$verscale = random(2,4,1); + +$f[0] = Formula("abs(x/$horscale)"); +$f[1] = Formula("abs(x+$horshift)"); +$f[2] = Formula("abs(x-$horshift)"); +$f[3] = Formula("abs(x)+$vershift"); +$f[4] = Formula("abs(x)-$vershift"); +$f[5] = Formula("abs(x)"); +$f[6] = Formula("$verscale*abs(x)"); +$f[7] = Formula("-abs(x)"); +$f[8] = Formula("-abs(x+$horshift)"); +$f[9] = Formula("-abs(x-$horshift)"); +$f[10] = Formula("-$verscale*abs(x)"); +$f[11] = Formula("-abs(x/$horscale)"); + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<16; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(12); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4 5 6 7 8 9 10 11 12)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the equation [`y=f\left(\frac{1}{[$horscale]}x\right)`] if [`f(x)=|x|`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"')], +['5.'.image(insertGraph( $graphs[ $shuffle->{4} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +'6.'.image(insertGraph( $graphs[ $shuffle->{5} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +'7.'.image(insertGraph( $graphs[ $shuffle->{6} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +'8.'.image(insertGraph( $graphs[ $shuffle->{7} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"')], +['9.'.image(insertGraph( $graphs[ $shuffle->{8} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +'10.'.image(insertGraph( $graphs[ $shuffle->{9} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +'11.'.image(insertGraph( $graphs[ $shuffle->{10} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +'12.'.image(insertGraph( $graphs[ $shuffle->{11} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"')], +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +[`y=f\left(\frac{1}{[$horscale]}x\right)`] has had a horizontal transformation from [`y=f\left(x\right)`], since the _input_ has been affected. Horizontal transformations are "counterintuitive", in the sense that while [`\frac{1}{[$horscale]}`] often suggests making something [`\frac{1}{[$horscale]}`] as large, here we will make the graph [`[$horscale]`] times as large (in the horizontal direction.) + +So the familiar "V" shape of [`y=\left|x\right|`] is stretched horizontally away from the [`y`]-axis by a factor of [`[$horscale]`], giving us graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/General1.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/General1.pg new file mode 100644 index 0000000000..8f87df5253 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/General1.pg @@ -0,0 +1,138 @@ +#DESCRIPTION +# Tests the ability to verbalize translation and stretching transformations +#ENDDESCRIPTION +## Author('') +## Institution('') +## DBsubject('') +## DBchapter('') +## DBsection('') +## AuthorText1('') +## TitleText1('') +## EditionText1('') +## Section1('') +## Problem1('') +## KEYWORDS('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"PGML.pl", +"MathObjects.pl", +"PGchoicemacros.pl", +"PGcourse.pl", + +); +#################################### +install_problem_grader(~~&std_problem_grader); +#TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; + + +$offset1=random(2,20,1); +$factor1=$offset1; +$toggle=random(0,2,1); + +# basic answers +@ansStr = ( +"shifted $offset1 units down", +"shifted $offset1 units up", +"shifted $offset1 units left", +"shifted $offset1 units right", +"compressed horizontally by the factor $factor1", +"stretched horizontally by the factor $factor1", +"compressed vertically by the factor $factor1", +"stretched vertically by the factor $factor1", +); + +@explanations = ( +"The transformation affects the output of the function, so it is a vertical transformation. Subtraction indicates it has been shifted down by $offset.", +"The transformation affects the output of the function, so it is a vertical transformation. Addition indicates it has been shifted up by $offset.", +"The transformation affects the input of the function, so it is a horizontal transformation. Horizontal transformations are ${LQ}counterintuitive$RQ in the sense that the addition sign here indicates a shift to the left by $offset.", +"The transformation affects the input of the function, so it is a horizontal transformation. Horizontal transformations are ${LQ}counterintuitive$RQ in the sense that the subtraction sign here indicates a shift to the right by $offset.", +"The transformation affects the input of the function, so it is a horizontal transformation. Horizontal transformations are ${LQ}counterintuitive$RQ in the sense that multiplication by \($factor1\) indicates a horizontal compression (toward the vertical axis) by a factor of \($factor1\).", +"The transformation affects the input of the function, so it is a horizontal transformation. Horizontal transformations are ${LQ}counterintuitive$RQ in the sense that division by \($factor1\) indicates a horizontal stretching (away from the vertical axis) by a factor of \($factor1\).", +"The transformation affects the output of the function, so it is a vertical transformation. Division by \($factor1\) indicates a vertical compression (towards the horizontal axis) by a factor of \($factor1\).", +"The transformation affects the output of the function, so it is a vertical transformation. Multiplication by \($factor1\) indicates a vertical stretching (away from the horizontal axis) by a factor of \($factor1\).", +); +$funcA = "y=x^2"; +@questStrA = ( +"\(y=x^2-$offset1\)", +"\(y=x^2+$offset1\)", +"\(y=(x+$offset1)^2\)", +"\(y=(x-$offset1)^2\)", +"\(y=(${factor1}x)^2\)", +"\(y=\left(\frac{x}{$factor1}\right)^2\)", +"\(y=\frac{x^2}{$factor1}\)", +"\(y=${factor1}x^2\)", +); +$temp = $factor1**3; +$funcB = "y=x^3"; +@questStrB = ( +"\(y=x^3-$offset1\)", +"\(y=x^3+$offset1\)", +"\(y=(x+$offset1)^3\)", +"\(y=(x-$offset1)^3\)", +"\(y=(${factor1}x)^3\)", +"\(y=\left(\frac{x}{$factor1}\right)^3\)", +"\(y=\frac{x^3}{$factor1}\)", +"\(y=${factor1}x^3\)", +); +$funcC = "y=\sqrt{x}"; +@questStrC = ( +"\(y=\sqrt{x}-$offset1\)", +"\(y=\sqrt{x}+$offset1\)", +"\(y=\sqrt{x+$offset1}\)", +"\(y=\sqrt{x-$offset1}\)", +"\(y=\sqrt{${factor1}x}\)", +"\(y=\sqrt{\frac{x}{$factor1}}\)", +"\(y=\frac{\sqrt{x}}{$factor1}\)", +"\(y=${factor1}\sqrt{x}\)", +); +@questStr = @questStrA if $toggle==0; +@questStr = @questStrB if $toggle==1; +@questStr = @questStrC if $toggle==2; +$func = $funcA if $toggle==0; +$func = $funcB if $toggle==1; +$func = $funcC if $toggle==2; + +@slice = NchooseK(8,4); +@shuffle = shuffle(scalar(@slice)); + +#################################### +BEGIN_PGML +Relative to the graph of [` [$func] `] the graphs of the following equations +have been changed in what way? + +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$PAR +\{ &match_questions_list(@questStr[@slice]) \} +\{ &OL(@ansStr[@slice[@shuffle]]) \} + +END_TEXT + +Context()->normalStrings; + +#################################### +@ans = @ALPHABET[&invert(@shuffle)] ; +ANS(str_cmp ( [@ans] ) ); + +#################################### + +$explanation = ''; +for my $i (0..3) +{$explanation .= $questStr[$slice[$i]]; + $explanation .= $BR; + $explanation .= $explanations[$slice[$i]]; + $explanation .= $PAR;}; + +BEGIN_SOLUTION +$explanation + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/General3.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/General3.pg new file mode 100644 index 0000000000..e1ab23ab5a --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/General3.pg @@ -0,0 +1,67 @@ +#DESCRIPTION +## Algebra problem: Transformations of functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'transformation of function') + +## tcao , PAID on 11-24-2003 + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Transformations of Functions') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Precalculus') +## EditionText1('3') +## AuthorText1('Stewart, Redlin, Watson') +## Section1('2.4') +## Problem1('25') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl" +); + +#TEXT(beginproblem()); +$showPartialCredit = 1; +$showHint = 3; + +$a=random(2,15,2); +$b=random(3,30,2); + +BEGIN_PGML +Start with [`f`], where [`f(x)=\sqrt{x} `]. Let [`g`] be the function that we have after performing the following transformations: +shift to the left [`[$a]`] units, scale horizontally by a factor of +[`[$b]`], and reflect over the [`x`]-axis. + +Using [|sqrt(x)|] for [`\sqrt{x}`], The new function has formula + + [`g(x)={}`][_____________________] + +END_PGML + +$ans1 = "-sqrt(1/$b *x + $a)"; + +ANS(fun_cmp($ans1)); + + +BEGIN_PGML_SOLUTION + +After a shift of [`[$a]`] units to the left, the function looks like [`f(x + [$a])`], which is [`\sqrt{x + [$a]}`]. + +The subsequent scaling is the hardest part. There are two things to remember: +a) horizontal scaling works in the opposite way from what intuition dictates, so scaling by a factor of [`[$b]`] means the graph is compressing toward the [`y`]-axis by a factor of [`\frac{1}{[$b]}`]. + +a) The scaling factor affects only the [`x`], not the [`x + [$a]`]. + +Thus the function now looks like [`f\left(\frac{1}{[$b]} x + [$a]\right)`], which is [`\sqrt{\frac{1}{[$b]} x + [$a]}`]. + +Finally, when reflecting through the [`x`]-axis, a _vertical_ reflection, we have [`g(x) = -{\sqrt{\frac{1}{[$b]} x + [$a]}}`]. +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/General4.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/General4.pg new file mode 100644 index 0000000000..2e732ec525 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/General4.pg @@ -0,0 +1,68 @@ +#DESCRIPTION +## Algebra problem: Transformations of functions +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'transformation of function') + +## tcao , PAID on 11-24-2003 + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Transformations of Functions') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Precalculus') +## EditionText1('3') +## AuthorText1('Stewart, Redlin, Watson') +## Section1('2.4') +## Problem1('25') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl" +); + +#TEXT(beginproblem()); +$showPartialCredit = 1; +$showHint = 3; + +$a=random(2,15,2); +$b=random(3,30,2); + +BEGIN_PGML +Start with [`f`], where [`f(x)=\sqrt{x} `]. Let [`g`] be the function that we have after performing the following transformations: + +1) reflect over the [`x`]-axis, + +2) stretch horizontally by a factor of [`[$b]`], and + +3) shift to the left [`[$a]`] units. + + +Using [|sqrt(x)|] for [`\sqrt{x}`], The new function has formula + + [`g(x)={}`][_____________________] + +END_PGML + +$ans1 = "-sqrt(1/$b *(x + $a))"; + +ANS(fun_cmp($ans1)); + + +BEGIN_PGML_SOLUTION + +1) Reflect over the [`x`]-axis, making the function [`f(x)=-\sqrt{x} `]. + +2) Stretch horizontally by a factor of [`[$b]`], making the function [`f(x)=-\sqrt{\frac{1}{[$b]}x} `]. + +3) Shift to the left [`[$a]`] units, making the function [`g(x) = -{\sqrt{\frac{1}{[$b]} (x + [$a])}}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations10.pg new file mode 100644 index 0000000000..01d5004d4f --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations10.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + +do {$var = "x"; +$fn = RandomVariableName(type=>"function"); +$fno = RandomVariableName(type=>"function");} until ($var ne $fn and $var ne $fno and $fn ne $fno); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->variables->are($var=>'Real'); + +parser::Assignment->Allow; +parser::Assignment->Function("$fn"); + + +$a = random(2,4,1); +$b = random(-6,-1,1); +$c = random(3,20,1); +$d = random(3,8,1); + +$f = Formula("$a $var^2+$b $var +$c")->reduce; + +$e = $c+$d; +$answer = Formula("$fn($var)=$a $var^2-$b $var+$e")->reduce; + + +############################################## + +BEGIN_PGML + +Suppose that [`[$fno]\left([$var]\right)=[$f]`]. Find a formula for the function [`[$fn]`] whose graph is the graph of [`[$fno]`] reflected over the [`y`]-axis and shifted up by [`[$d]`]. Your answer should be in the form *[$fn]([$var])=...*. + + [__________________________]{$answer} + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +If we let [`(x_{[$fno]},y_{[$fno]})`] be points on the graph of [`[$fno]`], and [`(x_{[$fn]},y_{[$fn]})`] be points on the graph of [`[$fn]`], then we know that + +* [`x_{[$fn]}=-x_{[$fno]}`] + +* [`y_{[$fn]}=y_{[$fno]}+[$d]`] + +* [`y_{[$fno]} = [$a] \left(x_{[$fno]}\right)^2+[$b] \left(x_{[$fno]}\right) +[$c]`] + +So now we set out to solve for [`y_{[$fn]}`] in terms of [`x_{[$fn]}`]. + + [`\begin{aligned} +y_{[$fno]} +&= y_{[$fno]}+[$d]\\ +&= [$a] \left(x_{[$fno]}\right)^2+[$b] \left(x_{[$fno]}\right) +[$c]+[$d]\\ +&= [$a] \left(-x_{[$fn]}\right)^2+[$b] \left(-x_{[$fn]}\right) +[$c]+[$d]\\ +&= [$a] \left(x_{[$fn]}\right)^2-[$b] \left(x_{[$fn]}\right) +[$c+$d] +\end{aligned}`] + +So [`[$answer]`]. +END_PGML_SOLUTION + + + + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations100.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations100.pg new file mode 100644 index 0000000000..a0a46074d9 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations100.pg @@ -0,0 +1,210 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(-4,4,1); +$a = -1; +$b = $a*$horshift; +$horshiftN = -$horshift; +$bN = -$b; + +$func = Formula("x**2")->reduce; +$f[0] = Formula("($a*x+$b)**2")->reduce; +$f[1] = Formula("($a*(x+$b))**2")->reduce; +$f[2] = Formula("-($a*x+$b)**2")->reduce; +$f[3] = Formula("-($a*(x+$b))**2")->reduce; + +@alt = (); +$alt[0] = "This is a graph with the shape of y=$func, with the vertex at ($horshiftN,0). The curve is concave-up."; +$alt[1] = "This is a graph with the shape of y=$func, with the vertex at ($bN,0). The curve is concave-up."; +$alt[2] = "This is a graph with the shape of y=$func, with the vertex at ($horshiftN,0). The curve is concave-down."; +$alt[3] = "This is a graph with the shape of y=$func, with the vertex at ($bN,0). The curve is concave-down."; + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$funcFactored = Formula("(-(x+$horshift))**2")->reduce; +$lor = $horshift>0 ? "left" : "right"; +$horshiftA = abs($horshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=x^2`]. + +Before doing transformation for [`f(x)=[$f[0]]`], since there is a number, [`-1`], in front of the independent variable [`x`], we need to factor the expression and convert the function to: + + [``f(x)=[$f[0]]=[$funcFactored]``] + +To transform from [`y=x^2`] to [`f(x)=[$funcFactored]`], there is a reflection by the [`y`]-axis, and a horizontal shift to the [$lor] by [`[$horshiftA]`] units. + +By order of transformations, first we need to reflect [`y=x^2`] by the [`y`]-axis (which doesn't change the graph), and then do the shift. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations110.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations110.pg new file mode 100644 index 0000000000..df686beb58 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations110.pg @@ -0,0 +1,202 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$vershift = non_zero_random(-4,4,1); +$a = -1; +$vershiftN = -$vershift; + +$f[0] = Formula("$a*abs(x)+$vershift")->reduce; +$f[1] = Formula("abs(x)+$vershift")->reduce; +$f[2] = Formula("$a*abs(x)-$vershift")->reduce; +$f[3] = Formula("abs(x)-$vershift")->reduce; + +@alt = (); +$alt[0] = "This is a graph with the shape of the absolute value function, with the center of the function at (0,$vershift). The function faces down."; +$alt[1] = "This is a graph with the shape of the absolute value function, with the center of the function at (0,$vershift). The function faces up."; +$alt[2] = "This is a graph with the shape of the absolute value function, with the center of the function at (0,$vershiftN). The function faces down."; +$alt[3] = "This is a graph with the shape of the absolute value function, with the center of the function at (0,$vershiftN). The function faces up."; + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$uod = $vershift>0 ? "up" : "down"; +$vershiftA = abs($vershift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=\left| x\right|}`]. + +To transform from [`y=\left| x\right|}`] to [`f(x)=[$f[0]]`], there is a reflection by the [`x`]-axis, and a vertical shift [$uod] by [`[$vershiftA]`] units. + +By order of transformations, first we need to do the reflection, and then the shift. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations120.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations120.pg new file mode 100644 index 0000000000..a752841777 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations120.pg @@ -0,0 +1,207 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$vershift = non_zero_random(-2,2,1); +$a = random(0.3,0.6,0.1); +if (random(0,1,1)==0) {$a = random(1.5,3,0.1);} +$tow = $a>1 ? "thinner" : "wider"; +$tow1 = $a<1 ? "thinner" : "wider"; +$vershift2 = 2*$vershift; + +$func = Formula("x**2")->reduce; +$f[0] = Formula("$a*x**2+$vershift")->reduce; +$f[1] = Formula("(1/$a)*x**2+$vershift")->reduce; +$f[2] = Formula("2*$a*x**2+2*$vershift")->reduce; +$f[3] = Formula("(1/$a)*x**2+2*$vershift")->reduce; + +@alt = (); +$alt[0] = "This is a graph with the shape of y=$func, with the vertex at (0,$vershift). The graph is $tow than the graph of y=$func."; +$alt[1] = "This is a graph with the shape of y=$func, with the vertex at (0,$vershift). The graph is $tow1 than the graph of y=$func."; +$alt[2] = "This is a graph with the shape of y=$func, with the vertex at (0,$vershift2). The graph is much $tow than the graph of y=$func."; +$alt[3] = "This is a graph with the shape of y=$func, with the vertex at (0,$vershift2). The graph is $tow1 than the graph of y=$func."; + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$uod = $vershift>0 ? "up" : "down"; +$cos = $a>1 ? "stretch" : "compression"; +$vershiftA = abs($vershift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=x^2`]. + +To transform from [`y=x^2`] to [`f(x)=[$f[0]]`], there is a vertical [$cos], and a vertical shift [$uod] by [`[$vershiftA]`] units. + +By order of transformations, first we need to do the [$cos], and then do the shift. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations130.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations130.pg new file mode 100644 index 0000000000..86d061c374 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations130.pg @@ -0,0 +1,207 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(1,4,1)*random(-1,1,2); +$a = random(0.3,0.6,0.1); +if (random(0,1,1)==0) {$a = random(1.5,2,0.1);} +$lot = $a>1 ? "taller" : "shorter"; +$lot1 = $a<1 ? "taller" : "shorter"; +$horshiftN = -$horshift; + +$f[0] = Formula("$a*(sqrt(x+$horshift))")->reduce; +$f[1] = Formula("$a*sqrt(x-$horshift)")->reduce; +$f[2] = Formula("(1/$a)*sqrt(x+$horshift)")->reduce; +$f[3] = Formula("(1/$a)*sqrt(x-$horshift)")->reduce; + +@alt = (); +$alt[0] = "This is a graph with the shape of the square root function, with the starting point at ($horshiftN,0). The graph is $lot than the square root function."; +$alt[1] = "This is a graph with the shape of the square root function, with the starting point at ($horshift,0). The graph is $lot than the square root function."; +$alt[2] = "This is a graph with the shape of the square root function, with the starting point at ($horshiftN,0). The graph is $lot1 than the square root function."; +$alt[3] = "This is a graph with the shape of the square root function, with the starting point at ($horshift,0). The graph is $lot1 than the square root function."; + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$soc = $a>1 ? "stretch" : "compression"; +$lor = $horshift>0 ? "left" : "right"; +$horshiftA = abs($horshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=\sqrt{x}`]. + +To transform from [`y=\sqrt{x}`] to [`f(x)=[$f[0]]`], there is a vertical [$soc], and a horizontal shift to the [$lor] by [`[$horshiftA]`] units. + +By order of transformations, we need to do the [$soc] first, and then do the shift. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations140.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations140.pg new file mode 100644 index 0000000000..dc3a48cbf5 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations140.pg @@ -0,0 +1,213 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$vershiftH = non_zero_random(1,2,1)*random(-1,1,2); +$a = random(0.3,0.6,0.1); +if (random(0,1,1)==0) {$a = random(1.5,2,0.1);} +$vershift = $a*$vershiftH; +$los = $a>1 ? "taller" : "shorter"; +$vershiftHN = -$vershiftH; +$vershiftN = -$vershift; + +$f[0] = Formula("$a*(sqrt(x)+$vershiftH)")->reduce; +$f[1] = Formula("$a*sqrt(x)+$vershiftH")->reduce; +$f[2] = Formula("$a*sqrt(x+$vershiftH)")->reduce; +$f[3] = Formula("$a*sqrt(x+$vershift)")->reduce; + +@alt = (); +$alt[0] = "This is a graph with the shape of the square root function, with the starting point at (0,$vershift). The graph is $los than the square root function."; +$alt[1] = "This is a graph with the shape of the square root function, with the starting point at (0,$vershiftH). The graph is $los than the square root function."; +$alt[2] = "This is a graph with the shape of the square root function, with the starting point at ($vershiftHN,0). The graph is $los than the square root function."; +$alt[3] = "This is a graph with the shape of the square root function, with the starting point at ($vershiftN,0). The graph is $los than the square root function."; + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$func = Formula("$a*sqrt(x)+$vershift")->reduce; +$soc = $a>1 ? "stretch" : "compression"; +$lor = $vershift>0 ? "up" : "down"; +$vershiftA = abs($vershift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=\sqrt{x}`]. + +Before doing transformation for [`f(x)=[$f[0]]`], we need to do distribution and convert the function to: + + [``f(x)=[$f[0]]=[$func]``] + +To transform from [`y=\sqrt{x}`] to [`f(x)=[$f[0]]`], there is a vertical [$soc], and a vertical shift [$lor] by [`[$vershiftA]`] units. + +By order of transformations, we need to do the [$soc] first, and then do the shift. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations20.pg new file mode 100644 index 0000000000..2ba8d08873 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations20.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +########################### + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"parserFunction.pl", +"PGML.pl", +"PGgraphmacros.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +$refreshCachedImages = 1; + + +########################### +# Setup + +Context("Numeric"); +parserFunction(f => "sin(e*x)+0.5*pi*x^2"); + + +$b = random(2,6,1); + +$answer = Formula("f(-x) + $b"); + +# +# Graph canvas +# +$gr = init_graph(-5,-1,5,9,axes=>[0,0],grid=>[10,10],size=>[300,300]); +$gr -> lb('reset'); + +# +# Graph labels and functions +# +$gr -> lb(new Label ( 4.5,0,'x','black','left','bottom')); +$gr -> lb(new Label ( 0.25,8.5,'y','black','left','bottom')); +$gr -> lb(new Label ( 0.25,$c,'y = f(x)','black','left','bottom')); +foreach my $i (1..4) { + $gr -> lb(new Label ( $i,-0.5, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.5,-$i,'black','center','middle')); +} +foreach my $j (1..8) { + $gr -> lb(new Label (-4.5,$j,$j,'black','center','middle')); +} +add_functions($gr, "f(x) for x in <-5,5> using color:blue and weight:2"); +add_functions($gr, "f(-x)+$b for x in <-5,5> using color:green and weight:2"); + + +########################### +# Main text + +BEGIN_PGML +The function [` f `] is plotted in blue. Find a formula for the green function [` g`] in terms of the function [`f `]. + + +>> [@ image(insertGraph($gr), width=>300, height=>300, tex_size=>700)@]* << + + [`g(x) ={}`][__________________]{$answer} + +END_PGML + +############################ +# Answer evaluation + +$showPartialCorrectAnswers = 1; + + +############################ + +$bh = abs($b); +$dirv = ($b > 0) ? 'up' : 'down'; +$unitv = ($bh == 1) ? 'unit' : 'units'; + + + +BEGIN_PGML_SOLUTION + +The graph of [`g`] is the graph of [`f`], reflected over the [`y`]-axis and shifted [`[$bh]`] [$unitv] [$dirv]. So [`g(x) = [$answer]`]. + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations30.pg new file mode 100644 index 0000000000..2eef2aa023 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations30.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +########################### + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"parserFunction.pl", +"PGML.pl", +"PGgraphmacros.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +$refreshCachedImages = 1; + + +########################### +# Setup + +Context("Numeric"); +parserFunction(f => "3*e^(-abs(x)/2)+sin(2x)/(1+x^2)"); + +$a = non_zero_random(-4,4,1); +$b = random(-4,4,1); + + +$answer = Formula("-f(x-$a)")->reduce; + + +# +# Graph canvas +# +$gr = init_graph(-5,-5,5,5,axes=>[0,0],grid=>[10,10],size=>[300,300]); +$gr -> lb('reset'); + +# +# Graph labels and functions +# +$gr -> lb(new Label ( 4.5,0,'x','black','left','bottom')); +$gr -> lb(new Label ( 0.25,8.5,'y','black','left','bottom')); + +foreach my $i (1..4) { + $gr -> lb(new Label ( $i,-0.5, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.5,-$i,'black','center','middle')); + $gr -> lb(new Label (-0.5,$i,$i,'black','center','middle')); + $gr -> lb(new Label (-0.5,-$i,-$i,'black','center','middle')); +} + +add_functions($gr, "f(x) for x in <-5,5> using color:blue and weight:2"); +add_functions($gr, "-f(x-$a) for x in <-5,5> using color:green and weight:2"); + + +########################### +# Main text + +BEGIN_PGML +The function [` f `] is plotted in blue. Find a formula for the green function [` g`] in terms of the function [`f `]. + + +>> [@ image(insertGraph($gr), width=>300, height=>300, tex_size=>700)@]* << + + [`g(x) ={}`][__________________]{$answer} + +END_PGML + + +############################ +# Answer evaluation + +$showPartialCorrectAnswers = 1; + +$ah = abs($a); +$dir = ($a > 0) ? 'right' : 'left'; +$unit = ($ah == 1) ? 'unit' : 'units'; + + + +BEGIN_PGML_SOLUTION + +The graph of [`g`] is the graph of [`f`], shifted [`[$ah]`] [$unit] to the [$dir] and reflected over the [`y`]-axis. So [`g(x) = [$answer]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations40.pg new file mode 100644 index 0000000000..46f54c7ff7 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations40.pg @@ -0,0 +1,88 @@ +##DESCRIPTION +##ENDDESCRIPTION +## Author('') +## Institution('') +## DBsubject('') +## DBchapter('') +## DBsection('') +## AuthorText1('') +## TitleText1('') +## EditionText1('') +## Section1('') +## Problem1('') +##KEYWORDS('') + +###################################### + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +"parserPopUp.pl", +); + +install_problem_grader(~~&std_problem_grader); +#TEXT(&beginproblem); + +###################################### + +$showPartialCredit = 1; +$showPartialCredit = 1; + +$a1 = non_zero_random(-1,1,1); +$a2 = non_zero_random(-1,1,1); + +$ansa = "up"; +if ($a1 != 1) {$ansa = "down";}; +$popupa = PopUp(['?','up','down','left','right'],$ansa ); + +$ansb = "left"; +if ($a2 != 1) {$ansb = "right";}; +$popupb = PopUp(['?','up','down','left','right'],$ansb ); + +$ansc = "the y-axis"; +$popupc = PopUp(['?','the x-axis','the y-axis', 'the diagonal line y=x'],$ansc ); + +$ansd = "the x-axis"; +$popupd = PopUp(['?','the x-axis','the y-axis', 'the diagonal line y=x'],$ansd ); + +###################################### +BEGIN_PGML + +Suppose you are given a function [`f`], and you consider shifting and reflecting the graph of [`f`]. Answer the following questions. + +a) The graph of [`g`], where [`g(x) = f(x) + [$a1]`] is obtained by shifting the graph of [`f`] [@$popupa->menu@]* one unit. + +a) The graph of [`g`], where [`g(x) = f(x + [$a2])`] is obtained by shifting the graph of [`f`] [@$popupb->menu@]* one unit. + +a) The graph of [`g`], where [`g(x) = f(-x) `] is obtained by reflecting the graph of [`f`] over [@$popupc->menu@]*. + +a) The graph of [`g`], where [`g(x) = -f(x) `] is obtained by reflecting the graph of [`f`] over [@$popupd->menu@]*. + +END_PGML +###################################### + +ANS($popupa->cmp); +ANS($popupb->cmp); +ANS($popupc->cmp); +ANS($popupd->cmp); + +###################################### + +BEGIN_PGML_SOLUTION + +a) If [`g(x) = f(x) + [$a1]`], then [`g`] has a modification from [`f`] that is external to [`f`]'s formula, so the transformation is of a vertical nature. Vertical transformations work in an intuitive way, where addition means shifting up and subtraction means shifting down. So The graph of [`g`] is obtained by shifting the graph of [`f`] [@$popupa->correct_ans@] one unit. + +a) If [`g(x) = f(x+[$a2])`], then [`g`] has a modification from [`f`] that is internal to [`f`]'s formula, so the transformation is of a horizontal nature. Horizontal transformations work in a counterintuitive way, where addition means shifting left and subtraction means shifting right. So The graph of [`g`] is obtained by shifting the graph of [`f`] [@$popupb->correct_ans@] one unit. + +a) If [`g(x) = f(-x)`], then [`g`] has a modification from [`f`] that is internal to [`f`]'s formula, so the transformation is of a horizontal nature. The negation implies a reflection about one of the main axes, and a vertical reflection would be over the [`y`]-axis. + +a) If [`g(x) = -f(x)`], then [`g`] has a modification from [`f`] that is external to [`f`]'s formula, so the transformation is of a vertical nature. The negation implies a reflection about one of the main axes, and a vertical reflection would be over the [`x`]-axis. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations50.pg new file mode 100644 index 0000000000..449ff0c342 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations50.pg @@ -0,0 +1,152 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, write its equation +# based on transformation rules. +# +# Last update: Carl Yao 04/03/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +@functionBases = ("x**2","abs(x)","sqrt(x)"); +$index = random(0,2,1); +$temp = $functionBases[$index]; +$func0 = Compute("$temp")->reduce; + +$hori = non_zero_random(-5,5,1); +do {$vert = non_zero_random(-5,5,1);} until (abs($hori)!=abs($vert)); +@functions = ("(x+$hori)**2+$vert","abs(x+$hori)+$vert","sqrt(x+$hori)+$vert"); +$temp = $functions[$index]; +$func1 = Compute("$temp")->reduce; +if ($index==2) { + $func1->{limits} = [-$hori,-$hori+2]; +} + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([1.5*$hori,-1.5*$hori],[1.5*$vert,-1.5*$vert],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@func0Low = (-sqrt($max[1]),-$max[1],0+0.5); +@func0High = (sqrt($max[1]),$max[1],$max[0]); +@func1Low = ( + max($min[0],-sqrt($max[1]-$vert)-$hori), + max($min[0],-($max[1]-$vert)-$hori), + max($min[0],-$hori)+0.5 +); +@func1High = ( + min($max[0],sqrt($max[1]-$vert)-$hori), + min($max[0],$max[1]-$vert-$hori), + min($max[0],($max[1]-$vert)**2-$hori) +); + + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $func0LowTemp = $func0Low[$index]-0.5; + $func0HighTemp = $func0High[$index]+0.5; + $func1LowTemp = $func1Low[$index]-0.5; + $func1HighTemp = $func1High[$index]+0.5; + + add_functions($gr[$i], "$func0 for x in ($func0LowTemp,$func0HighTemp) using color:black and weight:1"); + add_functions($gr[$i], "$func1 for x in ($func1LowTemp,$func1HighTemp] using color:blue and weight:2"); + + $gr[$i]->stamps( closed_circle(0,0,'black') ); + $gr[$i]->stamps( closed_circle(-$hori,$vert,'blue') ); + $cushion = ($max[0]-$min[0])/40; + if ($hori>0) { + $gr[$i]->lb( new Label($cushion,0,"A",'black','left','top')); + $gr[$i]->lb( new Label(-$hori-$cushion,$vert,"B",'black','right','top')); + } else { + $gr[$i]->lb( new Label(-$cushion,0,"A",'black','right','top')); + $gr[$i]->lb( new Label(-$hori+$cushion,$vert,"B",'black','left','top')); + } +} + +$nHori = -$hori; + +$ALT = "There is the graph of the function f(x)=$func0 in black, and the graph of a function in blue. The point A (0,0) on the black function is highlighted. The point B ($nHori,$vert) on the blue function is highlighted. This is the corresponding point of A (0,0) in f(x)=func0 after the transformation."; + + +############################################## +Context("LimitedNumeric"); +BEGIN_PGML + +The function [`f(x)=[$func0]`] is graphed in black. The blue function, [`g(x)`], is a transformation of [`f(x)`]. In particular, Point A on [`f(x)`] is tranformed to Point B on [`g(x)`]. Write the blue function's equation. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +* Use *sqrt( )* for the square root symbol. +* Use *abs( )* for the absolute value symbols. +* Use the carot sign (Shift+6 on keyboard) for "to the power of". For example, 3^2 means 3 squared. + +The blue function's equation is [`g(x)=`][_____________________]{$func1}. + +END_PGML +############################################## + +$leftOrRight = ($hori>0) ? "left" : "right"; +$absHori = abs($hori); +$upOrDown = ($vert>0) ? "up" : "down"; +$absVert = abs($vert); + +BEGIN_PGML_SOLUTION + +If we transform [`f(x)=[$func0]`] (in black) by shifting it to the [$leftOrRight] by [`[$absHori]`] units, and then [$upOrDown] by [`[$absVert]`] units, we can get the blue graph ([`g(x)`]). + +The equation for the blue graph is [`g(x)=[$func1]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations60.pg new file mode 100644 index 0000000000..96c6330677 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations60.pg @@ -0,0 +1,142 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, write its equation +# based on transformation rules. +# +# Last update: Carl Yao 04/03/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +@functionBases = ("x**2","abs(x)","sqrt(x)"); +$index = random(0,2,1); +$temp = $functionBases[$index]; +$func0 = Compute("$temp")->reduce; + +$a = random(1,3,0.1); +if (random(0,1,1)==0) {$a = random(0.3,0.6,0.1);} +@functions = ("$a*x**2","$a*abs(x)","$a*sqrt(x)"); +$temp = $functions[$index]; +$func1 = Compute("$temp")->reduce; +if ($index==2) { + $func1->{limits} = [0,2]; +} + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([-3,3],[0,1,$a],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@func0Low = (-sqrt($max[1]),-$max[1],0+0.5); +@func0High = (sqrt($max[1]),$max[1],$max[0]); +@func1Low = ( + max($min[0],-sqrt($max[1]/$a)), + max($min[0],-($max[1]/$a)), + max($min[0],0)+0.5 +); +@func1High = ( + min($max[0],sqrt($max[1]/$a)), + min($max[0],$max[1]/$a), + min($max[0],($max[1]/$a)**2) +); + + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + + $func0LowTemp = $func0Low[$index]-0.5; + $func0HighTemp = $func0High[$index]+0.5; + $func1LowTemp = $func1Low[$index]-0.5; + $func1HighTemp = $func1High[$index]+0.5; + + add_functions($gr[$i], "$func0 for x in [$func0LowTemp,$func0HighTemp) using color:black and weight:1"); + add_functions($gr[$i], "$func1 for x in [$func1LowTemp,$func1HighTemp) using color:blue and weight:2"); + + $cushion = ($max[0]-$min[0])/40; + $gr[$i]->stamps( closed_circle(1,1,'black') ); + $gr[$i]->lb( new Label(1+$cushion, 1, "A(1,1)",'black','left','middle')); + $gr[$i]->stamps( closed_circle(1,$a,'blue') ); + $gr[$i]->lb( new Label(1+$cushion, $a, "B(1,$a)",'blue','left','middle')); +} + +$ALT = "There is the graph of the function f(x)=$func0 in black, and the graph of a function in blue. The point A(1,1) on the black function is highlighted. The point B(1,$a) on the blue function is highlighted. This is the corresponding point of A(1,1) in f(x)=func0 after the transformation."; + + +############################################## + +BEGIN_PGML + +The function [`f(x)=[$func0]`] is graphed in black. The blue function, [`g(x)`], is a transformation of [`f(x)`]. In particular, Point A on [`f(x)`] is tranformed to Point B on [`g(x)`]. Write the blue function's equation. Write the blue function's equation. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +* Use *sqrt( )* for the square root symbol. +* Use *abs( )* for the absolute value symbols. +* Use the carot sign (Shift+6 on keyboard) for "to the power of". For example, 3^2 means 3 squared. + +The blue function's equation is [`g(x)=`][_____________________]{$func1}. + +END_PGML +############################################## + +$SOC = ($a>1) ? "stretching" : "compressing"; + +BEGIN_PGML_SOLUTION + +If we transform [`f(x)=[$func0]`] (in black) by [$SOC] it along the [`y`]-axis by a factor of [$a], we can get the blue graph ([`g(x)`]). + +The equation for the blue graph is [`g(x)=[$func1]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations70.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations70.pg new file mode 100644 index 0000000000..71c61fef57 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations70.pg @@ -0,0 +1,147 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Given a function's graph, write its equation +# based on transformation rules. +# +# Last update: Carl Yao 04/09/2018 +# +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Function') +## DBsection('Domain and Range') +## KEYWORDS('function','domain','range','graph') +## DBCCSS('8.F','F-IF') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +@functionBases = ("x**2","abs(x)","sqrt(x)"); +$index = random(0,2,1); +$temp = $functionBases[$index]; +$func0 = Compute("$temp")->reduce; + +$a = list_random(2,4,5); +if (random(0,1,1)==0) {$a = list_random(0.2,0.4,0.5);} +@functions = ("($a*x)**2","abs($a*x)","sqrt($a*x)"); +$temp = $functions[$index]; +$func1 = Compute("$temp")->reduce; +if ($index==2) { + $func1->{limits} = [0,2]; +} +$x1 = 1/$a; + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([1,1/$a],[0,1],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@func0Low = (-sqrt($max[1]),-$max[1],0+0.5); +@func0High = (sqrt($max[1]),$max[1],$max[0]); +@func1Low = ( + max($min[0],-sqrt($max[1])/$a), + max($min[0],-($max[1])/$a), + max($min[0],0)+0.5 +); +@func1High = ( + min($max[0],sqrt($max[1])/$a), + min($max[0],$max[1]/$a), + min($max[0],($max[1])**2/$a) +); + + +for my $i (0..0) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label(-$marksep[0]/8, $j, $j,'black','right','middle')); + } + + $func0LowTemp = $func0Low[$index]-0.5; + $func0HighTemp = $func0High[$index]+0.5; + $func1LowTemp = $func1Low[$index]-0.5; + $func1HighTemp = $func1High[$index]+0.5; + + add_functions($gr[$i], "$func0 for x in [$func0LowTemp,$func0HighTemp) using color:black and weight:1"); + add_functions($gr[$i], "$func1 for x in [$func1LowTemp,$func1HighTemp) using color:blue and weight:2"); + + $cushion = 0; #($max[0]-$min[0])/40; + $gr[$i]->stamps( closed_circle(1,1,'black') ); + $gr[$i]->lb( new Label(1, 1-$cushion, "A(1,1)",'black','center','bottom')); + $gr[$i]->stamps( closed_circle($x1,1,'blue') ); + $gr[$i]->lb( new Label($x1, 1+$cushion, "B($x1,1)",'blue','center','top')); +} + +$ALT = "There is the graph of the function f(x)=$func0 in black, and the graph of a function in blue. The point A(1,1) on the black function is highlighted. The point B(1,$y1) on the blue function is highlighted. This is the corresponding point of A(1,1) in f(x)=func0 after the transformation."; + + +############################################## + +BEGIN_PGML + +The function [`f(x)=[$func0]`] is graphed in black. The blue function, [`g(x)`], is a transformation of [`f(x)`]. In particular, Point A on [`f(x)`] is tranformed to Point B on [`g(x)`]. Write the blue function's equation. Write the blue function's equation. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr[0]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + +* Use *sqrt( )* for the square root symbol. +* Use *abs( )* for the absolute value symbols. +* Use the carot sign (Shift+6 on keyboard) for "to the power of". For example, 3^2 means 3 squared. + +The blue function's equation is [`g(x)=`][_____________________]{$func1}. + +END_PGML +############################################## + +$SOC = ($a<1) ? "stretching" : "compressing"; + +Context("Fraction"); +$factor = Fraction(1/$a); + +BEGIN_PGML_SOLUTION + +If we transform [`f(x)=[$func0]`] (in black) by [$SOC] it along the [`x`]-axis by a factor of [`[$factor]`], we can get the blue graph ([`g(x)`]). + +The equation for the blue graph is [`g(x)=[$func1]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations80.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations80.pg new file mode 100644 index 0000000000..c7ee0a7287 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations80.pg @@ -0,0 +1,215 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(-4,4,1); +$a = random(0.3,0.6,0.1); +if (random(0,1,1)==1) + {$a = random(1.1,3,0.1);} +$b = $a*$horshift; +$horshiftN = -$horshift; +$aN = -$a; +$tow = $a>1 ? "thinner" : "wider"; + +$func = Formula("abs(x)")->reduce; +$f[0] = Formula("abs($a*x+$b)")->reduce; +$f[1] = Formula("abs($a*(x+$a))")->reduce; +$f[2] = Formula("abs($a*x-$b)")->reduce; +$f[3] = Formula("abs($a*(x-$a))")->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=$func, with the center of the function at ($horshiftN,0) but $tow than the graph of y=func"; +$alt[1] = "graph with the shape of y=$func, with the center of the function at ($aN,0) but $tow than the graph of y=func"; +$alt[2] = "graph with the shape of y=$func, with the center of the function at ($horshift,0) but $tow than the graph of y=func"; +$alt[3] = "graph with the shape of y=$func, with the center of the function at ($a,0) but $tow than the graph of y=func"; + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$funcFactored = Formula("abs($a*(x+$horshift))")->reduce; +$soc = $a<1 ? "stretch away from" : "compression toward"; +$soc1 = $a<1 ? "stretch" : "compression"; +$lor = $horshift>0 ? "left" : "right"; +$horshiftA = abs($horshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=\left| x\right|`]. + +Before doing transformation for [`f(x)=[$f[0]]`], since there is a number in front of the independent variable [`x`], we need to factor the expression and convert the function to: + + [``f(x)=[$f[0]]=[$funcFactored]``] + +To transform from [`y=\left| x\right|`] to [`[$funcFactored]`], there is a horizontal [$soc] the [`y`]-axis by a factor of [`\frac{1}{[$a]}`], and a horizontal shift to the [$lor] by [`[$horshiftA]`] units. + +By order of transformations, first we need to do the [$soc1] on [`y=\left| x\right|`], and then the shift. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations90.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations90.pg new file mode 100644 index 0000000000..eee2848a83 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/GeneralTransformations90.pg @@ -0,0 +1,209 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", + +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(2,4,1)*random(-1,1,2); +$a = -1; +$b = $a*$horshift; +$horshiftN = -$horshift; +$bN = -$b; + +$f[0] = Formula("sqrt($a*x+$b)")->reduce; +$f[1] = Formula("sqrt($a*x-$b)")->reduce; +$f[2] = Formula("-sqrt(x+$b)")->reduce; +$f[3] = Formula("-sqrt(x-$b)")->reduce; + +@alt = (); +$alt[0] = "graph with the shape of the square root function, with the starting point at ($horshiftN,0), while going from the center to the top left"; +$alt[1] = "graph with the shape of the square root function, with the starting point at ($horshift,0), while going from the center to the top left"; +$alt[2] = "graph with the shape of the square root function, with the starting point at ($bN,0), while going from the center to the bottom right"; +$alt[3] = "graph with the shape of the square root function, with the starting point at ($b,0), while going from the center to the bottom right"; + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<5; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$funcFactored = Formula("sqrt($a*(x+$horshift))")->reduce; +$lor = $horshift>0 ? "left" : "right"; +$horshiftA = abs($horshift); + +BEGIN_PGML_SOLUTION + +Identify that the parent function, before transformation, is [`y=\sqrt{x}`]. + +Before doing transformation for [`f(x)=[$f[0]]`], since there is a number, [`-1`], in front of the independent variable [`x`], we need to factor the expression and convert the function to: + + [``f(x)=[$f[0]]=[$funcFactored]``] + +To transform from [`y=\sqrt{x}`] to [`f(x)=[$funcFactored]`], there is a reflection by the [`y`]-axis, and a horizontal shift to the [$lor] by [`[$horshiftA]`] units. + +By order of transformations, we need to reflect [`y=\sqrt{x}`] by the [`y`]-axis first, and then do the shift. The correct graph for [`f(x)=[$f[0]]`] is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs1.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs1.pg new file mode 100644 index 0000000000..c14cf045ab --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs1.pg @@ -0,0 +1,152 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGgraders.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + + +$gr0 = init_graph(-2,-4,4,4, axes=>[0,0],size=>[400,400]); + +add_functions($gr0, "x^(3/2) for x in <-2,4> " . + "using color:blue and weight:2"); + +$k[0] = non_zero_random(-2,2,1); +$k[1] = random(1,3); +$k[2] = non_zero_random(-2,2,1); +$k[3] = random(0.2,0.6,0.1); + + +$f[0] = Formula("x^(3/2)-$k[0]")->reduce; +$f[1] = Formula("(x-$k[1])^(3/2)")->reduce; +$f[2] = Formula("$k[2]-x^(3/2)")->reduce; +$f[3] = Formula("$k[3]*x^(3/2)")->reduce; + + + +$gr = init_graph(-2,-4,4,4, axes=>[0,0],size=>[400,400]); + +add_functions($gr, "$f[0] for x in <-2,4> " . + "using color:blue and weight:1"); +add_functions($gr, "$f[1] for x in <-2,4> " . + "using color:red and weight:2"); +add_functions($gr, "$f[2] for x in <-2,4> " . + "using color:green and weight:3"); +add_functions($gr, "$f[3] for x in <-2,4> " . + "using color:black and weight:4"); + +# +# Create a matching list and use popups +# +$ml = new_match_list(); +$ml->rf_print_q(~~&pop_up_list_print_q); +$ml->ra_pop_up_list([ +"No answer" => "?", +"A" => "A", "B" => "B", "C" => "C", "D" => "D"]); + +Context()->texStrings; +# +# Add correct questions and answers +# +$ml->qa( +"\(y=$f[0]\)", "blue, thinnest", +"\(y=$f[1]\)", "red, thinner", +"\(y=$f[2]\)", "green, thicker", +"\(y=$f[3]\)", "black, thickest", + +); + +Context()->normalStrings; +$ml->choose(4); + + + + + + +############################################## + + +BEGIN_PGML +Here is the graph of [`y=x^{1.5}`]. + +[@EnlargeImageStatementPGML()@]** + +>>[@ image( insertGraph($gr0), width=>400, + height=>400, tex_size=>800 ) @]* << + +Match each function with its graph. + + +>>[@ image( insertGraph($gr), width=>400, + height=>400, tex_size=>800 ) @]* << + +[@ ColumnMatchTable($ml) @]* + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 1; + + + +install_problem_grader(~~&std_problem_grader); + +ANS( str_cmp( $ml->ra_correct_ans ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +The blue graph has been shifted down, so this is the graph of [`[@$f[0]->TeX@]`]. + +The red graph has been shifted right, so this is the graph of [`[@$f[1]->TeX@]`]. + +The green graph has been reflected vertically over the [`x`]-axis and shifted down, so this is the graph of [`[@$f[2]->TeX@]`]. + +The black graph has been compressed vertically toward the [`x`]-axis, so this is the graph of [`[@$f[3]->TeX@]`]. + + + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs10.pg new file mode 100644 index 0000000000..968aa8f511 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs10.pg @@ -0,0 +1,150 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); +loadMacros( +"PGstandard.pl", +"PGgraphmacros.pl", +"PGunion.pl", +"imageChoice.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + + + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(1,3,1); + +$f[0] = Formula("x**2+$a"); +$f[1] = Formula("x**2-$a"); +$f[2] = Formula("(x+$a)**2"); +$f[3] = Formula("(x-$a)**2"); +$f[4] = Formula("2x^2"); +$f[5] = Formula("1/2x^2"); + +$num = 5; + +# make graphs for each +@gr = (); +foreach my $i (0..$num) { + $gr[$i] = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[1,1]); + add_functions($gr[$i], "$f[$i] for x in <-10,10>" . + " using color:blue and weight:2"); + add_functions($gr[$i], "x^2 for x in <-10,10>" . + " using color:black and weight:1"); + +} +Context()->texStrings; +@QA = (); +foreach my $i (0..$num) { push( @QA, "\(y=$f[$i]\)", $gr[$i] ); } +Context()->normalStrings; + +$ml = new_image_match_list( + link => 1, # do not link to separate image + size => [200,200], # image size in pixels + tex_size => 450, # tex size in precent times 10 + columns => 2, # number of columns + separation => 20, # separation between image columns +); + +$ml->rf_print_q(~~&pop_up_list_print_q); # use pop-up-lists +$ml->ra_pop_up_list([ No_answer=>"?", A=>"A", B=>"B", C=>"C", D=>"D", E=>"E", F=>"F"] ); + +$ml->qa(@QA); # set the questions and answers +$ml->choose($num+1); # select 4 of them + + + + + +############################################## +Context()->texStrings; + +BEGIN_TEXT +\{ +ColumnTable( +"Match the graphs (thicker and in blue) with the corresponding formulas. For reference, the graph of \(y=x^2\) is thinner and in black.". +$ml->print_q() # no period! +, # comma! +$BCENTER. +$ml->print_a(). +$BR. +"(Click on a graph to enlarge it)". +$ECENTER # no period! +, # comma! +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT + +Context()->normalStrings; +############################################## + +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +ANS(str_cmp($ml->ra_correct_ans)); + +foreach my $i (0..$num) { + $a[$i] = $ml->ra_correct_ans->[$i]; +} + +############################################## + + +BEGIN_PGML_SOLUTION + +The graph of [`y=[@$f[0]->TeX@]`] is the graph of [`y=x^2`] after shifting up by [`[$a]`] units. So that is the graph + +>>[@image( insertGraph($gr[0]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[1]->TeX@]`] is the graph of [`y=x^2`] after shifting down by [`[$a]`] units. So that is the graph + +>>[@image( insertGraph($gr[1]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[2]->TeX@]`] is the graph of [`y=x^2`] after shifting left by [`[$a]`] units. So that is the graph + +>>[@image( insertGraph($gr[2]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[3]->TeX@]`] is the graph of [`y=x^2`] after shifting right by [`[$a]`] units. So that is the graph + +>>[@image( insertGraph($gr[3]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[4]->TeX@]`] is the graph of [`y=x^2`] after having been stretched vertically away from the [`x`]-axis by a factor of [`2`]. So that is the graph + +>>[@image( insertGraph($gr[4]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[5]->TeX@]`] is the graph of [`y=x^2`] after having been compressed vertically toward the [`x`]-axis by a factor of [`\frac{1}{2}`]. So that is the graph + +>>[@image( insertGraph($gr[5]), +width=>200,height=>200,tex_size=>800 )@]* << + + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs2.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs2.pg new file mode 100644 index 0000000000..144be0df47 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs2.pg @@ -0,0 +1,152 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); +loadMacros( +"PGstandard.pl", +"PGgraphmacros.pl", +"PGunion.pl", +"imageChoice.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + + + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(1.5,3,0.1); +$b = $a + random(-1,1,2); +$c = $a+$b; + + +$f[0] = Formula("1/2x^2"); +$f[1] = Formula("1/2x^2-$a"); +$f[2] = Formula("1/2(x-$a)^2"); +$f[3] = Formula("1/2(x+$c)^2+$b"); +$f[4] = Formula("1/2(x+$c)^2-$a"); +$f[5] = Formula("1/2(x-$c)^2+$a"); + + +# make graphs for each +@gr = (); +foreach my $i (0..5) { + $gr[$i] = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[1,1]); + add_functions($gr[$i], "$f[$i] for x in <-10,10>" . + " using color:blue and weight:2"); + add_functions($gr[$i], "x^2 for x in <-10,10>" . + " using color:black and weight:1"); + +} +Context()->texStrings; +@QA = (); +foreach my $i (0..5) { push( @QA, "\(y=$f[$i]\)", $gr[$i] ); } +Context()->normalStrings; + +$ml = new_image_match_list( + link => 1, # do not link to separate image + size => [200,200], # image size in pixels + tex_size => 450, # tex size in precent times 10 + columns => 2, # number of columns + separation => 20, # separation between image columns +); + +$ml->rf_print_q(~~&pop_up_list_print_q); # use pop-up-lists +$ml->ra_pop_up_list([ No_answer=>"?", A=>"A", B=>"B", C=>"C", D=>"D", E=>"E", F=>"F"] ); + +$ml->qa(@QA); # set the questions and answers +$ml->choose(6); # select 4 of them + + + + + +############################################## +Context()->texStrings; + +BEGIN_TEXT +\{ +ColumnTable( +"Match the graphs (thicker and in blue) with the corresponding formulas. For reference, the graph of \(y=x^2\) is thinner and in black.". +$ml->print_q() # no period! +, # comma! +$BCENTER. +$ml->print_a(). +$BR. +"(Click on a graph to enlarge it)". +$ECENTER # no period! +, # comma! +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT + +Context()->normalStrings; +############################################## + +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +ANS(str_cmp($ml->ra_correct_ans)); + +foreach my $i (0..3) { + $a[$i] = $ml->ra_correct_ans->[$i]; +} + +############################################## + + +BEGIN_PGML_SOLUTION + +The graph of [`y=[@$f[0]->TeX@]`] is the graph of [`y=x^2`] after having been compressed vertically toward the [`x`]-axis by a factor of [`2`]. So that is the graph + +>>[@image( insertGraph($gr[0]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[1]->TeX@]`] is the graph of [`y=x^2`] after having been compressed vertically toward the [`x`]-axis by a factor of [`2`], and shifted down by [`[$a]`] units. So that is the graph + +>>[@image( insertGraph($gr[1]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[2]->TeX@]`] is the graph of [`y=x^2`] after having been compressed vertically toward the [`x`]-axis by a factor of [`2`], and shifted right by [`[$a]`] units. So that is the graph + +>>[@image( insertGraph($gr[2]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[3]->TeX@]`] is the graph of [`y=x^2`] after having been compressed vertically toward the [`x`]-axis by a factor of [`2`], shifted up by [`[$b]`] units, and shifted left by [`[$c]`] units. So that is the graph + +>>[@image( insertGraph($gr[3]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[4]->TeX@]`] is the graph of [`y=x^2`] after having been compressed vertically toward the [`x`]-axis by a factor of [`2`], shifted down by [`[$a]`] units, and shifted left by [`[$c]`] units. So that is the graph + +>>[@image( insertGraph($gr[4]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[5]->TeX@]`] is the graph of [`y=x^2`] after having been compressed vertically toward the [`x`]-axis by a factor of [`2`], shifted up by [`[$a]`] units, and shifted right by [`[$c]`] units. So that is the graph + +>>[@image( insertGraph($gr[5]), +width=>200,height=>200,tex_size=>800 )@]* << + + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs20.pg new file mode 100644 index 0000000000..e6d05a74a7 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs20.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); +loadMacros( +"PGstandard.pl", +"PGgraphmacros.pl", +"PGunion.pl", +"imageChoice.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + + + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(1,3,1); + +$f[0] = Formula("(2*x)^2"); +$f[1] = Formula("(1/2*x)^2"); + +$num = 1; + +# make graphs for each +@gr = (); +foreach my $i (0..$num) { + $gr[$i] = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[1,1]); + add_functions($gr[$i], "$f[$i] for x in <-10,10>" . + " using color:blue and weight:2"); + add_functions($gr[$i], "x^2 for x in <-10,10>" . + " using color:black and weight:1"); + +} +Context()->texStrings; +@QA = (); +foreach my $i (0..$num) { push( @QA, "\(y=$f[$i]\)", $gr[$i] ); } +Context()->normalStrings; + +$ml = new_image_match_list( + link => 1, # do not link to separate image + size => [200,200], # image size in pixels + tex_size => 450, # tex size in precent times 10 + columns => 2, # number of columns + separation => 20, # separation between image columns +); + +$ml->rf_print_q(~~&pop_up_list_print_q); # use pop-up-lists +$ml->ra_pop_up_list([ No_answer=>"?", A=>"A", B=>"B"] ); + +$ml->qa(@QA); # set the questions and answers +$ml->choose($num+1); # select 4 of them + + + + + +############################################## +Context()->texStrings; + +BEGIN_TEXT +\{ +ColumnTable( +"Match the graphs (thicker and in blue) with the corresponding formulas. For reference, the graph of \(y=x^2\) is thinner and in black.". +$ml->print_q() # no period! +, # comma! +$BCENTER. +$ml->print_a(). +$BR. +"(Click on a graph to enlarge it)". +$ECENTER # no period! +, # comma! +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT + +Context()->normalStrings; +############################################## + +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +ANS(str_cmp($ml->ra_correct_ans)); + +foreach my $i (0..$num) { + $a[$i] = $ml->ra_correct_ans->[$i]; +} + +############################################## + + +BEGIN_PGML_SOLUTION + +The graph of [`y=[@$f[0]->TeX@]`] is the graph of [`y=x^2`] after being compressed horizontally toward the [`y`]-axis by a factor of [`\frac{1}{2}`]. So that is the graph + +>>[@image( insertGraph($gr[0]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[0]->TeX@]`] is the graph of [`y=x^2`] after being streatched horizontally toward the [`y`]-axis by a factor of [`2`]. So that is the graph + +>>[@image( insertGraph($gr[1]), +width=>200,height=>200,tex_size=>800 )@]* << + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs30.pg new file mode 100644 index 0000000000..66850a5fd2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphs30.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); +loadMacros( +"PGstandard.pl", +"PGgraphmacros.pl", +"PGunion.pl", +"imageChoice.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + + + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(1,3,1); + +$f[0] = Compute("-sqrt(x)")->reduce; +$f[1] = Compute("sqrt(-x)")->reduce; +$f[2] = Compute("-sqrt(-x)")->reduce; + +$num = 2; + +# make graphs for each +@gr = (); +foreach my $i (0..$num) { + $gr[$i] = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[1,1]); + add_functions($gr[$i], "$f[$i] for x in <-10,10>" . + " using color:blue and weight:2"); + add_functions($gr[$i], "sqrt(x) for x in <-10,10>" . + " using color:black and weight:1"); + +} +Context()->texStrings; +@QA = (); +foreach my $i (0..$num) { push( @QA, "\(y=$f[$i]\)", $gr[$i] ); } +Context()->normalStrings; + +$ml = new_image_match_list( + link => 1, # do not link to separate image + size => [200,200], # image size in pixels + tex_size => 450, # tex size in precent times 10 + columns => 2, # number of columns + separation => 20, # separation between image columns +); + +$ml->rf_print_q(~~&pop_up_list_print_q); # use pop-up-lists +$ml->ra_pop_up_list([ No_answer=>"?", A=>"A", B=>"B", C=>"C"] ); + +$ml->qa(@QA); # set the questions and answers +$ml->choose($num+1); # select 4 of them + + + + + +############################################## +Context()->texStrings; + +BEGIN_TEXT +\{ +ColumnTable( +"Match the graphs (thicker and in blue) with the corresponding formulas. For reference, the graph of \(y=\sqrt{x}\) is thinner and in black.". +$ml->print_q() # no period! +, # comma! +$BCENTER. +$ml->print_a(). +$BR. +"(Click on a graph to enlarge it)". +$ECENTER # no period! +, # comma! +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT + +Context()->normalStrings; +############################################## + +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +ANS(str_cmp($ml->ra_correct_ans)); + +foreach my $i (0..$num) { + $a[$i] = $ml->ra_correct_ans->[$i]; +} + +############################################## + + +BEGIN_PGML_SOLUTION + +The graph of [`y=[@$f[0]->TeX@]`] is the graph of [`y=\sqrt{x}`] after being reflected by the [`x`]-axis. So that is the graph + +>>[@image( insertGraph($gr[0]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[1]->TeX@]`] is the graph of [`y=\sqrt{x}`] after being reflected by the [`y`]-axis. So that is the graph + +>>[@image( insertGraph($gr[1]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=[@$f[2]->TeX@]`] is the graph of [`y=\sqrt{x}`] after being reflected by the [`x`]-axis and then by the [`y`]-axis. So that is the graph + +>>[@image( insertGraph($gr[2]), +width=>200,height=>200,tex_size=>800 )@]* << + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphsReflected.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphsReflected.pg new file mode 100644 index 0000000000..f456501225 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/MatchGraphsReflected.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); +loadMacros( +"PGstandard.pl", +"PGgraphmacros.pl", +"PCCgraphMacros.pl", +"PGunion.pl", +"imageChoice.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + + + +############################################## + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a = random(1.5,3,0.1); +$b = $a + random(-1,1,2); +$c = $a+$b; + + +$f[0] = Formula("6x/(x^2+1)+$a"); +$f[1] = Formula("-6(x-$b)/((x-$b)^2+1)"); +$f[2] = Formula("6(x+$c)/((x+$c)^2+1)"); +$f[3] = Formula("-6x/(x^2+1)+$a"); +$f[4] = Formula("6(x-$a)/((x-$a)^2+1)+$b"); +$f[5] = Formula("-6x/(x^2+1)"); + + +$fgraph = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[1,1]); + add_functions($fgraph, "6x/(x^2+1) for x in <-10,10>" . + " using color:blue and weight:2"); + + +# make graphs for each +@gr = (); +foreach my $i (0..5) { + $gr[$i] = init_graph(-10,-10,10,10,'axes'=>[0,0],'grid'=>[1,1]); + add_functions($gr[$i], "$f[$i] for x in <-10,10>" . + " using color:blue and weight:2"); + +} +Context()->texStrings; +@QA = (); + +push( @QA, "\(y=f(x)+$a\)", $gr[0] ); +push( @QA, "\(y=-f(x-$b)\)", $gr[1] ); +push( @QA, "\(y=f(x+$c)\)", $gr[2] ); +push( @QA, "\(y=-f(x)+$a\)", $gr[3] ); +push( @QA, "\(y=f(x-$a)+$b\)", $gr[4] ); +push( @QA, "\(y=-f(x)\)", $gr[5] ); + + + +Context()->normalStrings; + +$ml = new_image_match_list( + link => 1, # do not link to separate image + size => [200,200], # image size in pixels + tex_size => 450, # tex size in precent times 10 + columns => 2, # number of columns + separation => 20, # separation between image columns +); + +$ml->rf_print_q(~~&pop_up_list_print_q); # use pop-up-lists +$ml->ra_pop_up_list([ No_answer=>"?", A=>"A", B=>"B", C=>"C", D=>"D", E=>"E", F=>"F"] ); + +$ml->qa(@QA); # set the questions and answers +$ml->choose(6); # select 4 of them + + + + + +############################################## +Context()->texStrings; + +BEGIN_PGML + +The graph of [`f`] is given in the first image below. [@EnlargeImageStatementPGML()@]** + +>>[@ image( insertGraph($fgraph), tex_size=>450, width=>200, height=>200 ) @]* << + +END_PGML +BEGIN_TEXT +$PAR + +\{ +ColumnTable( +"Match the graphs with the corresponding formulas.". +$ml->print_q() # no period! +, # comma! +$BCENTER. +$ml->print_a(). +$BR. +"(Click on a graph to enlarge it)". +$ECENTER # no period! +, # comma! +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT + +Context()->normalStrings; +############################################## + +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +ANS(str_cmp($ml->ra_correct_ans)); + +foreach my $i (0..3) { + $a[$i] = $ml->ra_correct_ans->[$i]; +} + +############################################## + +BEGIN_PGML_SOLUTION + +The graph of [`y=f(x)+[$a]`] is the graph of [`y=f(x)`] after having been shifted up by [`[$a]`] units. So that is the graph + +>>[@image( insertGraph($gr[0]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=-f(x-$b)`] is the graph of [`y=f(x)`] after having been reflected vertically over the [`x`]-axis and shifted right by [`[$b]`] units. So that is the graph + +>>[@image( insertGraph($gr[1]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=f(x+$c)`] is the graph of [`y=f(x)`] after having been shifted left by [`[$c]`] units. So that is the graph + +>>[@image( insertGraph($gr[2]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=-f(x)+$a`] is the graph of [`y=f(x)`] after having been reflected vertically over the [`x`]-axis and shifted up by [`[$a]`] units. Both of these transformations are vertical, so they apply in the order consistent with the order of operations: first reflect, then shift. So that is the graph + +>>[@image( insertGraph($gr[3]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=f(x-$a)+$b`] is the graph of [`y=f(x)`] after having been shifted up [`[$b]`] units and shifted right by [`[$a]`] units. So that is the graph + +>>[@image( insertGraph($gr[4]), +width=>200,height=>200,tex_size=>800 )@]* << + +The graph of [`y=-f(x)`] is the graph of [`y=f(x)`] after having been reflected vertically over the [`x`]-axis. So that is the graph + +>>[@image( insertGraph($gr[5]), +width=>200,height=>200,tex_size=>800 )@]* << + + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Painting.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Painting.pg new file mode 100644 index 0000000000..a4592e43cb --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Painting.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGgraders.pl", + "PGML.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +# +# Create a matching list and use popups +# +$ml = new_match_list(); +$ml->rf_print_q(~~&pop_up_list_print_q); +$ml->ra_pop_up_list([ +"No answer" => "?", +"A" => "A", "B" => "B", "C" => "C", +]); + +# +# Add correct questions and answers +# + +Context()->texStrings; + +$ml->qa( + +"I figured out how many gallons I needed and then bought two extra gallons just in case.", "f(A)+2", +"I bought enough paint to cover my house twice.", "2f(A)", +"I bought enough paint to cover my house and my welcome sign, which measures 2 square feet.", " f(A+2) " +); +$ml->choose(3); + + + + +Context()->normalStrings; + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +The number of gallons of paint, \(n=f(A)\), needed to cover a house is a function of the surface area, in \(\textrm{ft}^2\). Match each story to one expression. + +$PAR + + +\{ ColumnMatchTable($ml) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +$showPartialCorrectAnswers = 1; + + + +install_problem_grader(~~&std_problem_grader); + +ANS( str_cmp( $ml->ra_correct_ans ) ); + +############################################## + +BEGIN_PGML_SOLUTION + +a. "I figured out how many gallons I needed and then bought two extra gallons just in case." This indicates we will have [`2`] more gallons than what the function [`f`] will output. So this statement corresponds to [`f(A)+2`]. + +a. "I bought enough paint to cover my house twice." This indicates we will have [`2`] times as much paint as what [`f`] will output. So this statement corresponds to [`2f(A)`]. + +a. "I bought enough paint to cover my house and my welcome sign, which measures 2 square feet." This indicates we took the area of our house, [`A`], and added two more square feet before we used the function [`f`] to determine the necessary amount of paint. So this statement corresponds to [`f(A+2)`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ScalingAndReflecting10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ScalingAndReflecting10.pg new file mode 100644 index 0000000000..a3d7ee2b3b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ScalingAndReflecting10.pg @@ -0,0 +1,216 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + + + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(-4,4,1); +$vershift = non_zero_random(-4,4,1); +$horscale = random(2,4,1); +$verscale = random(2,4,1); + +$f[0] = Formula("-$verscale*abs(x)"); +$f[1] = Formula("abs(x+$horshift)"); +$f[2] = Formula("abs(x-$horshift)"); +$f[3] = Formula("abs(x)+$vershift"); +$f[4] = Formula("abs(x)-$vershift"); +$f[5] = Formula("abs(x/$horscale)"); +$f[6] = Formula("$verscale*abs(x)"); +$f[7] = Formula("-abs(x)"); +$f[8] = Formula("-abs(x+$horshift)"); +$f[9] = Formula("-abs(x-$horshift)"); +$f[10] = Formula("abs(x)"); +$f[11] = Formula("-abs(x/$horscale)"); + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<16; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(12); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4 5 6 7 8 9 10 11 12)], $zero+1 ); + + + +$size = 200; + +############################################## + +BEGIN_PGML +Choose the graph of the transformation [`y=-[$verscale] f(x)`] if [`f(x)=|x|`]. Don't use a graphing calculator or any technology; only use your understanding of graph transformations. + + +[@EnlargeImageStatementPGML()@]** + +[@LayoutTable( +[ +["1. ".image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"2. ".image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"3. ".image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"4. ".image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"')], +["5. ".image(insertGraph( $graphs[ $shuffle->{4} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"6. ".image(insertGraph( $graphs[ $shuffle->{5} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"7. ".image(insertGraph( $graphs[ $shuffle->{6} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"8. ".image(insertGraph( $graphs[ $shuffle->{7} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"')], +["9. ".image(insertGraph( $graphs[ $shuffle->{8} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"10. ".image(insertGraph( $graphs[ $shuffle->{9} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"11. ".image(insertGraph( $graphs[ $shuffle->{10} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"12. ".image(insertGraph( $graphs[ $shuffle->{11} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"')] +], +allcellcss=>"vertical-align:top; padding:12pt; font-weight:bold; text-align:left;" +)@]* + + + + The graph of the given transformation is [@ $pop->menu() @]*. + +END_PGML + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$ah = abs($horshift); +$dir = ($horshift > 0) ? 'left' : 'right'; +$unit = ($ah == 1) ? 'unit' : 'units'; + +BEGIN_PGML_SOLUTION + +The graph of [`y=-[$verscale] f(x)`] is the graph of [`y=f(x)`], scaled vertically by a factor of [`[$verscale]`] and reflected over the [`x`]-axis (which is a vertical reflection.) So we look for the graph of [`y=|x|`] (which is a "V" with arms of slope [`-1`] and [`1`] and its vertex at the origin) with these changes having been made. The "V" will be taller (by a factor of [`[$verscale]`]) and upside down. We find this in graph [@$pop->correct_ans@]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ScalingAndReflecting20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ScalingAndReflecting20.pg new file mode 100644 index 0000000000..65b11ed062 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ScalingAndReflecting20.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +############################################## + +DOCUMENT(); + + + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + +do {$var = "x"; +$fn = RandomVariableName(type=>"function"); +$fno = RandomVariableName(type=>"function");} until ($var ne $fn and $var ne $fno and $fn ne $fno); + + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +Context()->noreduce('(-x)+y', '(-x)-y'); +Context()->variables->are($var=>'Real'); + +parser::Assignment->Allow; +parser::Assignment->Function("$fn"); + + +$a = random(1,3,1); +$b = random(-6,-1,1); +$c = random(3,20,1); + +$f = Formula("$a $var^2+$b $var +$c")->reduce; + +$answer = Formula("$fn($var)=(-$a) $var^2-$b $var-$c")->reduce; + + +############################################## + +BEGIN_PGML + +Suppose that [`[$fno]\left([$var]\right)=[$f]`]. Find a formula for the function [`[$fn]`] whose graph is the graph of [`[$fno]`] reflected over the [`x`]-axis. Your answer should be in the form *[$fn]([$var])=...*. + + [__________________________]{$answer} + +END_PGML + + +############################################## + +$showPartialCorrectAnswers = 0; + + + +############################################## + +BEGIN_PGML_SOLUTION + +To reflect over the [`x`]-axis, we just need to write down that [`[$fn](x)=-[$fno](x)`]. So [`[$answer]`]. +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ScalingAndReflecting30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ScalingAndReflecting30.pg new file mode 100644 index 0000000000..b3ca9985bc --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/ScalingAndReflecting30.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "PGML.pl", + "parserMultiAnswer.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a[0] = random(-3,-1,1); +$a[1] = $a[0] + random(1,6,1); +$a[2] = $a[1] + random(1,6,1); +$a[3] = $a[2] + random(1,6,1); +$a[4] = $a[3] - random(1,6,1); + + +$multiansg = MultiAnswer(Compute("$a[4]"), Compute("$a[3]"), Compute("$a[2]"), Compute("$a[1]"), Compute("$a[0]"))->with( + singleResult => 1,checker => sub { + my ( $correct, $student, $self ) = @_; + my ( @stu ) = @{$student}; + my ( @cor ) = @{$correct}; + my $return = 1; + for my $i (0..4) { + if ($stu[$i] != $cor[$i]) {$return = 0;} + }; + return $return; + } +); + + +############################################## + +BEGIN_PGML + +The first table gives values for the function \(f\). + +END_PGML +BEGIN_TEXT +$PAR +\{DataTable( +[ +[{data=>"\(x\)",header=>'RH',rowcss=>"border-top:solid 1px;"},"\( -2 \)","\(-1\)","\(0\)","\(1\)","\(2\)"], +[{data=>"\(f(x)\)",header=>'RH',rowcss=>"border-bottom:solid 1px;"},"\($a[0]\)","\($a[1]\)","\($a[2]\)","\($a[3]\)","\($a[4]\)"] +], +allcellcss=>"padding:6pt;" +) +\} +$PAR +END_TEXT +BEGIN_PGML + + +Let [`g(x)=f(-x)`]. Fill in as many values in the table below as possible. + +END_PGML +BEGIN_TEXT +$PAR + +\{DataTable( +[ +[{data=>"\(x\)",header=>'RH',rowcss=>"border-top:solid 1px;"},"\( -2 \)","\(-1\)","\(0\)","\(1\)","\(2\)"], +[{data=>"\(g(x)\)",header=>'RH',rowcss=>"border-bottom:solid 1px;"},$multiansg->ans_rule(5), $multiansg->ans_rule(5), $multiansg->ans_rule(5), $multiansg->ans_rule(5), $multiansg->ans_rule(5)] +], +allcellcss=>"padding:6pt;" +) +\} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 1; + +ANS( $multiansg->cmp() ); + +############################################## + +BEGIN_SOLUTION + +\(g\) is the function \(f\) reflected about the \(y\)-axis (which is a horizontal transformation). So the points that are represented in the table for \(f\) need to be refelcted over the \(y\)-axis to get points that are on \(g\)'s graph: + +\[\begin{aligned} +(-2,$a[0])&\to(2,$a[0])\\ +(-1,$a[1])&\to(-1,$a[1])\\ +(0,$a[2])&\to(0,$a[2])\\ +(1,$a[3])&\to(-1,$a[3])\\ +(2,$a[4])&\to(-2,$a[4]) +\end{aligned}\] + +And so we find \(g(-2)=$a[4]\), \(g(-1)=$a[3]\), \(g(0)=$a[2]\), \(g(1)=$a[1]\), and \(g(2)=$a[0]\), giving us all five values for the table for \(g\). + +END_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting10.pg new file mode 100644 index 0000000000..c433b5e8b9 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting10.pg @@ -0,0 +1,216 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + + + + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$horshift = non_zero_random(-4,4,1); +$vershift = non_zero_random(-4,4,1); +$horscale = random(2,4,1); +$verscale = random(2,4,1); + +$f[1] = Formula("abs(x/$horscale)"); +$f[0] = Formula("abs(x+$horshift)"); +$f[2] = Formula("abs(x-$horshift)"); +$f[3] = Formula("abs(x)+$vershift"); +$f[4] = Formula("abs(x)-$vershift"); +$f[5] = Formula("abs(x)"); +$f[6] = Formula("$verscale*abs(x)"); +$f[7] = Formula("-abs(x)"); +$f[8] = Formula("-abs(x+$horshift)"); +$f[9] = Formula("-abs(x-$horshift)"); +$f[10] = Formula("-$verscale*abs(x)"); +$f[11] = Formula("-abs(x/$horscale)"); + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<16; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(12); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4 5 6 7 8 9 10 11 12)], $zero+1 ); + + + +$size = 200; + +############################################## + +BEGIN_PGML +Choose the graph of the transformation [`y=f(x+[$horshift])`] if [`f(x)=|x|`]. Don't use a graphing calculator or any technology; only use your understanding of graph transformations. + +[@EnlargeImageStatementPGML()@]** + +[@LayoutTable( +[ +["1. ".image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"2. ".image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"3. ".image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"4. ".image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"')], +["5. ".image(insertGraph( $graphs[ $shuffle->{4} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"6. ".image(insertGraph( $graphs[ $shuffle->{5} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"7. ".image(insertGraph( $graphs[ $shuffle->{6} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"8. ".image(insertGraph( $graphs[ $shuffle->{7} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"')], +["9. ".image(insertGraph( $graphs[ $shuffle->{8} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"10. ".image(insertGraph( $graphs[ $shuffle->{9} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"11. ".image(insertGraph( $graphs[ $shuffle->{10} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"'), +"12. ".image(insertGraph( $graphs[ $shuffle->{11} ] ), tex_size=>100, + height=>$size, width=>$size, extra_html_tags=>'alt="graph"')] +], +allcellcss=>"vertical-align:top; padding:12pt; font-weight:bold; text-align:left;" +)@]* + + + + The graph of the given transformation is [@ $pop->menu() @]*. + +END_PGML + + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$ah = abs($horshift); +$dir = ($horshift > 0) ? 'left' : 'right'; +$unit = ($ah == 1) ? 'unit' : 'units'; + +BEGIN_PGML_SOLUTION + +The graph of [`y=f(x+[$horshift])`] is the graph of [`y=f(x)`], shifted [`[$ah]`] [$unit] to the [$dir]. So we look for the graph of [`y=|x|`] (which is a "V" with arms of slope [`-1`] and [`1`] and its vertex at the origin) shifted [`[$ah]`] [$unit] to the [$dir]. We find this in graph [@$pop->correct_ans@]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting20.pg new file mode 100644 index 0000000000..11be755ae2 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting20.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +########################### + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"parserFunction.pl", +"PGML.pl", +"PGgraphmacros.pl", +"PGcourse.pl", +); + + +$refreshCachedImages = 1; + +TEXT(beginproblem()); +########################### +# Setup + +Context("Numeric"); +parserFunction(f => "sin(abs(x))+x/pi"); + +$a = non_zero_random(-3,3,1); +$b = random(-3,3,1); + +$answer = Formula("f(x+$a) + $b")->reduce; + +# +# Graph canvas +# +$gr = init_graph(-5,-5,5,5,axes=>[0,0],grid=>[10,10],size=>[300,300]); +$gr -> lb('reset'); + +# +# Graph labels and functions +# +$gr -> lb(new Label ( 4.5,0,'x','black','left','bottom')); +$gr -> lb(new Label ( 0.25,8.5,'y','black','left','bottom')); +$gr -> lb(new Label ( 0.25,$c,'y = f(x)','black','left','bottom')); +foreach my $i (1..4) { + $gr -> lb(new Label ( $i,-0.5, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.5,-$i,'black','center','middle')); + $gr -> lb(new Label (-0.5,$i,$i,'black','center','middle')); + $gr -> lb(new Label (-0.5,-$i,-$i,'black','center','middle')); + } + +add_functions($gr, "f(x) for x in <-5,5> using color:blue and weight:2"); +add_functions($gr, "f(x+$a)+$b for x in <-5,5> using color:green and weight:2"); + + +########################### +# Main text + +BEGIN_PGML +The function [` f `] is plotted in blue. Find a formula for the green function [` g`] in terms of the function [` f `]. + + +>> [@ image(insertGraph($gr), width=>300, height=>300, tex_size=>700)@]* << + + [`g(x) ={}`][__________________]{$answer} + +END_PGML + + +############################ +# Answer evaluation + +$showPartialCorrectAnswers = 1; + +############################ + +$ah = abs($a); +$dir = ($a > 0) ? 'left' : 'right'; +$unit = ($ah == 1) ? 'unit' : 'units'; + +$bh = abs($b); +$dirv = ($b > 0) ? 'up' : 'down'; +$unitv = ($bh == 1) ? 'unit' : 'units'; + + + +BEGIN_PGML_SOLUTION + +The graph of [`g`] is the graph of [`f`], shifted [`[$ah]`] [$unit] to the [$dir] and [`[$bh]`] [$unitv] [$dirv]. So [`g(x) = [$answer]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting30.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting30.pg new file mode 100644 index 0000000000..6fcbfcf8dd --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting30.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +########################### + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"parserFunction.pl", +"PGML.pl", +"PGgraphmacros.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +$refreshCachedImages = 1; + + +########################### +# Setup + +Context("Numeric"); +parserFunction(f => "sin(e*x)+0.5*pi*x^2"); + +$a = random(-3,3,2); +$b = random(2,6,1); + +$answer = Formula("f(x-$a) + $b")->reduce; + +# +# Graph canvas +# +$gr = init_graph(-5,-1,5,9,axes=>[0,0],grid=>[10,10],size=>[300,300]); +$gr -> lb('reset'); + +# +# Graph labels and functions +# +$gr -> lb(new Label ( 4.5,0,'x','black','left','bottom')); +$gr -> lb(new Label ( 0.25,8.5,'y','black','left','bottom')); +$gr -> lb(new Label ( 0.25,$c,'y = f(x)','black','left','bottom')); +foreach my $i (1..4) { + $gr -> lb(new Label ( $i,-0.5, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.5,-$i,'black','center','middle')); +} +foreach my $j (1..8) { + $gr -> lb(new Label (-4.5,$j,$j,'black','center','middle')); +} +add_functions($gr, "f(x) for x in <-5,5> using color:blue and weight:2"); +add_functions($gr, "f(x-$a)+$b for x in <-5,5> using color:green and weight:2"); + + +########################### +# Main text + +BEGIN_PGML +The function [` f `] is plotted in blue. Find a formula for the green function [` g`] in terms of the function [`f `]. + + +>> [@ image(insertGraph($gr), width=>300, height=>300, tex_size=>700)@]* << + + [`g(x) ={}`][__________________]{$answer} + +END_PGML + + +############################ +# Answer evaluation + +$showPartialCorrectAnswers = 1; + + +$ah = abs($a); +$dir = ($a > 0) ? 'right' : 'left'; +$unit = ($ah == 1) ? 'unit' : 'units'; + +$bh = abs($b); +$dirv = ($b > 0) ? 'up' : 'down'; +$unitv = ($bh == 1) ? 'unit' : 'units'; + + + +BEGIN_PGML_SOLUTION + +The graph of [`g`] is the graph of [`f`], shifted [`[$ah]`] [$unit] to the [$dir] and [`[$bh]`] [$unitv] [$dirv]. So [`g(x) = [$answer]`]. + +END_PGML_SOLUTION + + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting40.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting40.pg new file mode 100644 index 0000000000..aa7f579050 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting40.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +########################### + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", + +); + + + + +TEXT(beginproblem()); +########################### + + + +$a = non_zero_random(12,33,1); +$b = non_zero_random(12,33,1); +$c = non_zero_random(12,33,1); + +$shift[0] = Point("0","$a"); +$shift[1] = Point("-$b","0"); +$shift[2] = Point("$a","-$c"); + +$p = random(3,100,1); +$q = random(18,40,1); + + +Context("Point"); + +$A = Point("$p","$q"); + +$answer[0] = $A + $shift[0]; +$answer[1] = $A + $shift[1]; +$answer[2] = $A + $shift[2]; + +########################### + + +BEGIN_PGML +The graph of [` f `] contains the point [`[$A]`]. Use what you know about graph transformations to answer these questions. + + +a) What point must be on the graph of [`y=f(x)+[$a]`]? + + [______________] + +a) What point must be on the graph of [`y=f(x+[$b])`]? + + [______________] + +a) What point must be on the graph of [`y=f(x-[$a])-[$c]`]? + + [______________] + + +END_PGML + +############################ + + +$showPartialCorrectAnswers = 1; + +for my $i (0..2) { +ANS( $answer[$i]->cmp() ); +} + +############################ + +BEGIN_PGML_SOLUTION + +a) The graph of [`y=f(x)+[$a]`] is the graph of [`f`] shifted up by [`[$a]`] units. So this graph will contain the point [`([$p],[$q]+[$a])`], which is [`([$p],[$q+$a])`]. + +a) The graph of [`y=f(x+[$b])`] is the graph of [`f`] shifted left by [`[$b]`] units. So this graph will contain the point [`([$p]-[$b],[$q])`], which is [`([$p-$b],[$q])`]. + +a) The graph of [`y=f(x-[$a])-[$c]`] is the graph of [`f`] shifted right by [`[$a]`] units and down by [`[$c]`] units. So this graph will contain the point [`([$p]+[$a],[$q]-[$c])`], which is [`([$p+$a],[$q-$c])`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting50.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting50.pg new file mode 100644 index 0000000000..ea8e982a58 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting50.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +########################### + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", + +); + + + +TEXT(beginproblem()); +########################### + + + +$a = non_zero_random(12,33,1); +$b = non_zero_random(12,33,1); +$c = non_zero_random(12,33,1); + +$shift[0] = Point("0","$a"); +$shift[1] = Point("-$b","0"); +$shift[2] = Point("$a","-$c"); + +$p = random(-40,100,1); +$q = $p+random(18,40,1); +$r = random(-40,100,1); +$s = $r+random(18,40,1); + + +Context("Interval"); + +$domain = Interval("(-inf,$q)"); +$range = Interval("($r,$s]"); + +$domanswer[0] = $domain; +$domanswer[1] = Interval("(-inf,$q+$b)"); +$domanswer[2] = Interval("(-inf,$q+$a)"); + + +$rangeanswer[0] = Interval("($r+$a,$s+$a]"); +$rangeanswer[1] = $range; +$rangeanswer[2] = Interval("($r+$c,$s+$c]"); + +########################### + +BEGIN_PGML +The function [` f `] has domain [`[$domain]`] and range [`[$range]`]. Use what you know about graph transformations to find the domain and range of these other functions. + + +a) Let [`g(x) = f(x)+[$a]`]. + + [`g`] has domain [__________________] and range [__________________] + + +a) Let [`h(x) = f(x-[$b])`]. + + [`h`] has domain [__________________] and range [__________________] + +a) Let [`k(x) = f(x-[$a])+[$c]`]. + + [`k`] has domain [__________________] and range [__________________] + +END_PGML + +############################ + + +$showPartialCorrectAnswers = 1; + +for my $i (0..2) { +ANS( $domanswer[$i]->cmp() ); +ANS( $rangeanswer[$i]->cmp() ); + +} + +############################ + +BEGIN_PGML_SOLUTION + +a) The graph of [`g`] is the graph of [`f`] shifted up by [`[$a]`] units, so the two functions have the same domain, but the range of [`g`] is [`([$r]+[$a],[$s]+[$a]]`], which is [`([$r+$a],[$s+$a]]`]. + +a) The graph of [`h`] is the graph of [`f`] shifted right by [`[$b]`] units, so the two functions have the same range, but the domain of [`h`] is [`(-\infty,[$q]+[$b])`], which is [`(-\infty,[$q+$b])`]. + +a) The graph of [`k`] is the graph of [`f`] shifted right by [`[$a]`] units and up by [`[$c]`] units. So the domain of [`k`] is [`(-\infty,[$q]+[$a])`], which is [`(-\infty,[$q+$a])`], and the range of [`k`] is [`([$r]+[$c],[$s]+[$c]]`], which is [`([$r+$c],[$s+$c]]`]. + + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting60.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting60.pg new file mode 100644 index 0000000000..f6dde6f195 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Shifting60.pg @@ -0,0 +1,235 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "pccTables.pl", + "PGML.pl", + "parserMultiAnswer.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); + +$a[0] = random(-3,-1,1); +$a[1] = $a[0] + random(1,6,1); +$a[2] = $a[1] + random(1,6,1); +$a[3] = $a[2] + random(1,6,1); +$a[4] = $a[3] - random(1,6,1); + + +$multiansg = MultiAnswer(String(""), Compute("$a[0]"), Compute("$a[1]"), Compute("$a[2]"), Compute("$a[3]"))->with( + singleResult => 1,checker => sub { + my ( $correct, $student, $self ) = @_; + my ( @stu ) = @{$student}; + my ( @cor ) = @{$correct}; + my $return = 1; + for my $i (0..4) { + if ($stu[$i] != $cor[$i]) {$return = 0;} + }; + return $return; + } +); + + +$multiansh = MultiAnswer(Compute("$a[1]"), Compute("$a[2]"), Compute("$a[3]"), Compute("$a[4]"),String(""))->with( + singleResult => 1,checker => sub { + my ( $correct, $student, $self ) = @_; + my ( @stu ) = @{$student}; + my ( @cor ) = @{$correct}; + my $return = 1; + for my $i (0..4) { + if ($stu[$i] != $cor[$i]) {$return = 0;} + }; + return $return; + } +); + +$multiansk = MultiAnswer(Compute("$a[0]")+3, Compute("$a[1]")+3, Compute("$a[2]")+3, Compute("$a[3]")+3, Compute("$a[4]")+3)->with( + singleResult => 1,checker => sub { + my ( $correct, $student, $self ) = @_; + my ( @stu ) = @{$student}; + my ( @cor ) = @{$correct}; + my $return = 1; + for my $i (0..4) { + if ($stu[$i] != $cor[$i]) {$return = 0;} + }; + return $return; + } +); + +$multiansm = MultiAnswer(String(""), Compute("$a[0]")+3, Compute("$a[1]")+3, Compute("$a[2]")+3, Compute("$a[3]")+3)->with( + singleResult => 1,checker => sub { + my ( $correct, $student, $self ) = @_; + my ( @stu ) = @{$student}; + my ( @cor ) = @{$correct}; + my $return = 1; + for my $i (0..4) { + if ($stu[$i] != $cor[$i]) {$return = 0;} + }; + return $return; + } +); + +############################################## + +BEGIN_PGML + +The first table gives values for the function [`f`]. + + +END_PGML +BEGIN_TEXT +$PAR +\{DataTable( +[ +[{data=>"\(x\)",header=>'RH',rowcss=>"border-top:solid 1px;"},"\( -2 \)","\(-1\)","\(0\)","\(1\)","\(2\)"], +[{data=>"\(f(x)\)",header=>'RH',rowcss=>"border-bottom:solid 1px;"},"\($a[0]\)","\($a[1]\)","\($a[2]\)","\($a[3]\)","\($a[4]\)"] +], +allcellcss=>"padding:6pt;" +) +\} +$PAR +END_TEXT +BEGIN_PGML + + +Let [`g(x)=f(x-1)`], [`h(x)=f(x+1)`], [`k(x)=f(x)+3`], and [`m(x)=f(x-1)+3`]. Fill in as many values for these functions in the tables below as possible. Some spaces are meant to be left blank, since you do not have enough information to fill in everything. This problem will not tell you which parts you have correct, so to not give away which spaces should be left blank. + +END_PGML +BEGIN_TEXT +$PAR + +\{DataTable( +[ +[{data=>"\(x\)",header=>'RH',rowcss=>"border-top:solid 1px;"},"\( -2 \)","\(-1\)","\(0\)","\(1\)","\(2\)"], +[{data=>"\(g(x)\)",header=>'RH',rowcss=>"border-bottom:solid 1px;"},$multiansg->ans_rule(5), $multiansg->ans_rule(5), $multiansg->ans_rule(5), $multiansg->ans_rule(5), $multiansg->ans_rule(5)] +], +allcellcss=>"padding:6pt;" +) +\} + +$PAR + +\{DataTable( +[ +[{data=>"\(x\)",header=>'RH',rowcss=>"border-top:solid 1px;"},"\( -2 \)","\(-1\)","\(0\)","\(1\)","\(2\)"], +[{data=>"\(h(x)\)",header=>'RH',rowcss=>"border-bottom:solid 1px;"},$multiansh->ans_rule(5), $multiansh->ans_rule(5), $multiansh->ans_rule(5), $multiansh->ans_rule(5), $multiansh->ans_rule(5)] +], +allcellcss=>"padding:6pt;" +) +\} + +$PAR + +\{DataTable( +[ +[{data=>"\(x\)",header=>'RH',rowcss=>"border-top:solid 1px;"},"\( -2 \)","\(-1\)","\(0\)","\(1\)","\(2\)"], +[{data=>"\(k(x)\)",header=>'RH',rowcss=>"border-bottom:solid 1px;"},$multiansk->ans_rule(5), $multiansk->ans_rule(5), $multiansk->ans_rule(5), $multiansk->ans_rule(5), $multiansk->ans_rule(5)] +], +allcellcss=>"padding:6pt;" +) +\} + +$PAR + + +\{DataTable( +[ +[{data=>"\(x\)",header=>'RH',rowcss=>"border-top:solid 1px;"},"\( -2 \)","\(-1\)","\(0\)","\(1\)","\(2\)"], +[{data=>"\(m(x)\)",header=>'RH',rowcss=>"border-bottom:solid 1px;"},$multiansm->ans_rule(5), $multiansm->ans_rule(5), $multiansm->ans_rule(5), $multiansm->ans_rule(5), $multiansm->ans_rule(5)] +], +allcellcss=>"padding:6pt;" +) +\} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 1; + + +ANS( $multiansg->cmp() ); +ANS( $multiansh->cmp() ); +ANS( $multiansk->cmp() ); +ANS( $multiansm->cmp() ); + + +############################################## + +for my $i (0..4) {$k[$i] = $a[$i]+3;}; + +BEGIN_SOLUTION + +\(g\) is the function \(f\) shifted \(1\) unit to the right. So the points that are represented in the table for \(f\) need to be shifted \(1\) unit right to get points that are on \(g\)'s graph: + +\[\begin{aligned} +(-2,$a[0])&\to(-1,$a[0])\\ +(-1,$a[1])&\to(0,$a[1])\\ +(0,$a[2])&\to(1,$a[2])\\ +(1,$a[3])&\to(2,$a[3])\\ +(2,$a[4])&\to(3,$a[4]) +\end{aligned}\] + +And so we find \(g(-1)=$a[0]\), \(g(0)=$a[1]\), \(g(1)=$a[2]\), and \(g(2)=$a[3]\), giving us four values for the table for \(g\). We have no information for \(g(-2)\), so we leave that entry blank. +$PAR + +\(h\) is the function \(f\) shifted \(1\) unit to the left. So the points that are represented in the table for \(f\) need to be shifted \(1\) unit left to get points that are on \(h\)'s graph: + +\[\begin{aligned} +(-2,$a[0])&\to(-3,$a[0])\\ +(-1,$a[1])&\to(-2,$a[1])\\ +(0,$a[2])&\to(-1,$a[2])\\ +(1,$a[3])&\to(0,$a[3])\\ +(2,$a[4])&\to(1,$a[4]) +\end{aligned}\] + +And so we find \(h(-2)=$a[1]\), \(h(-1)=$a[2]\), \(h(0)=$a[3]\), and \(h(1)=$a[4]\), giving us four values for the table for \(h\). We have no information for \(h(2)\), so we leave that entry blank. +$PAR + +\(k\) is the function \(f\) shifted \(3\) units up. So the points that are represented in the table for \(f\) need to be shifted \(4\) units up to get points that are on \(k\)'s graph: + +\[\begin{aligned} +(-2,$a[0])&\to(-2,$k[0])\\ +(-1,$a[1])&\to(-1,$k[1])\\ +(0,$a[2])&\to(0,$k[2])\\ +(1,$a[3])&\to(1,$k[3])\\ +(2,$a[4])&\to(2,$k[4]) +\end{aligned}\] + +And so we find \(k(-2)=$k[0]\), \(k(-1)=$k[1]\), \(k(0)=$k[2]\), \(k(1)=$k[3]\), and \(k(2)=$k[4]\), giving us all five values for the table for \(k\). +$PAR + +\(m\) is the function \(f\) shifted \(1\) unit to the right and \(3\) units up. So the points that are represented in the table for \(f\) need to be shifted \(1\) unit right and \(3\) up to get points that are on \(m\)'s graph: + +\[\begin{aligned} +(-2,$a[0])&\to(-1,$k[0])\\ +(-1,$a[1])&\to(0,$k[1])\\ +(0,$a[2])&\to(1,$k[2])\\ +(1,$a[3])&\to(2,$k[3])\\ +(2,$a[4])&\to(3,$k[4]) +\end{aligned}\] + +And so we find \(m(-1)=$k[0]\), \(m(0)=$k[1]\), \(m(1)=$k[2]\), and \(m(2)=$k[3]\), giving us four values for the table for \(m\). We have no information for \(m(-2)\), so we leave that entry blank. + +END_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry1.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry1.pg new file mode 100644 index 0000000000..ab61339090 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry1.pg @@ -0,0 +1,108 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + + +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +################################################ + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"PGchoicemacros.pl", +"MathObjects.pl", +"parserPopUp.pl", +"PGML.pl", +"PGcourse.pl", +); + +install_problem_grader(~~&std_problem_grader); +TEXT(&beginproblem); +$showPartialCredit = 1; + +################################################ + +$q[0] = "f(x) = x^4+x^2"; +$popup[0] = PopUp(["?","even","odd","neither"], "even"); +$e[0] = '\begin{aligned}[t] f(-x) &= (-x)^4+(-x)^2\\&=x^4+x^2\\&=f(x)\end{aligned}'; + +$q[1] = "f(x) = x^5+x^3"; +$popup[1] = PopUp(["?","even","odd","neither"], "odd"); +$e[1] = '\begin{aligned}[t] f(-x) &= (-x)^5+(-x)^3\\&=-x^5-x^3\\&=-\left(x^5+x^3\right)\\&=-f(x)\end{aligned}'; + +$q[2] = "f(x) = x^4+x^5"; +$popup[2] = PopUp(["?","even","odd","neither"], "neither"); +$e[2] = '\begin{aligned}[t] f(-x) &= (-x)^4+(-x)^5\\&=x^4-x^5\\&\neq f(x)\mbox{ or }-f(x)\end{aligned}'; + +$q[3] = "f(x) = \left| x\right|"; +$popup[3] = PopUp(["?","even","odd","neither"], "even"); +$e[3] = '\begin{aligned}[t] f(-x) &= \left|-x\right|\\&=\left|x\right|\\&=f(x)\end{aligned}'; + +$q[4] = "f(x) = \left|x\right|^3"; +$popup[4] = PopUp(["?","even","odd","neither"], "even"); +$e[4] = '\begin{aligned}[t] f(-x) &= \left|-x\right|^3\\&=\left|x\right|^3\\&=f(x)\end{aligned}'; + +$q[5] = "f(x) = \frac{x^2}{x^2+1}"; +$popup[5] = PopUp(["?","even","odd","neither"], "even"); +$e[5] = '\begin{aligned}[t] f(-x) &= \frac{(-x)^2}{(-x)^2+1}\\&=\frac{x^2}{x^2+1}\\&=f(x)\end{aligned}'; + + +@shuffle = NchooseK(6, 6); + +@q = @q[@shuffle]; +@popup = @popup[@shuffle]; +@e = @e[@shuffle]; + +BEGIN_PGML + +For each function below, decide if the function is even, odd, or neither. + +a. [`[@$q[0]@]`][@$BR@]* + [@$popup[0]->menu@]* [@$PAR@]* +a. [`[@$q[1]@]`][@$BR@]* + [@$popup[1]->menu@]* [@$PAR@]* +a. [`[@$q[2]@]`][@$BR@]* + [@$popup[2]->menu@]* [@$PAR@]* +a. [`[@$q[3]@]`][@$BR@]* + [@$popup[3]->menu@]* [@$PAR@]* +a. [`[@$q[4]@]`][@$BR@]* + [@$popup[4]->menu@]* [@$PAR@]* +a. [`[@$q[5]@]`][@$BR@]* + [@$popup[5]->menu@]* [@$PAR@]* + +END_PGML + +for my $i (0..5) {ANS($popup[$i]->cmp);}; + +################################################ + +BEGIN_PGML_SOLUTION + +a. Since [`[@$e[0]@]`], [`f`] is [@$popup[0]->correct_ans@].[@$PAR@]* +a. Since [`[@$e[1]@]`], [`f`] is [@$popup[1]->correct_ans@].[@$PAR@]* +a. Since [`[@$e[2]@]`], [`f`] is [@$popup[2]->correct_ans@].[@$PAR@]* +a. Since [`[@$e[3]@]`], [`f`] is [@$popup[3]->correct_ans@].[@$PAR@]* +a. Since [`[@$e[4]@]`], [`f`] is [@$popup[4]->correct_ans@].[@$PAR@]* +a. Since [`[@$e[5]@]`], [`f`] is [@$popup[5]->correct_ans@].[@$PAR@]* + +END_PGML_SOLUTION + + + + + + + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry10.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry10.pg new file mode 100644 index 0000000000..61d82cb85b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry10.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +########################### + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + + + + + +########################### + +TEXT(beginproblem()); + +$p = random(3,100,1); +$q = random(18,40,1); + + +Context("Point"); + +$A = Point("$p","$q"); + +$answer[0] = Point("-$p","$q"); +$answer[1] = Point("$p","-$q"); +$answer[2] = Point("-$p","-$q"); + +########################### + +BEGIN_PGML +The graph of [` f `] contains the point [`[$A]`]. + +a) If the graph has even symmetry, which other point must lie on the graph? + + [_____________] + +a) What point must be on the graph of [`-f`]? + + [_____________] + +a) If the graph has symmetry about the origin, which other point must lie on the graph? + + [_____________] + +END_PGML + + +############################ + + +$showPartialCorrectAnswers = 1; + +for my $i (0..2) { +ANS( $answer[$i]->cmp() ); +} + + +############################ + +BEGIN_PGML_SOLUTION + +a) If [`f`] is even, then it has symmetry with respect to the [`y`] axis. So the horizontal reflection of [`[$A]`] over the [`y`]-axis must be on its graph. So [`[@$answer[0]->TeX@]`] is on the graph of [`f`]. + +a) [`-f`] is a function that has the same graph as [`f`], only it has been reflected over the [`x`]-axis. So the vertical reflection of [`[$A]`] over the [`x`]-axis must be on its graph. So [`[@$answer[1]->TeX@]`] is on the graph of [`-f`]. + +a) If [`f`] has symmetry about the origin, then we can spin the grpah 180 degrees around the origin and obtain the same graph. Spinning by 180 degrees yields the same result as reflecting over the [`y`]-axis _and_ over the [`x`]-axis. So there must be a counterpoint to [`[$A]`] on its graph at [`[@$answer[2]->TeX@]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry20.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry20.pg new file mode 100644 index 0000000000..8eb1682250 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry20.pg @@ -0,0 +1,228 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGchoicemacros.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$a=random(1,3,1)*random(-1,1,2); +$b=random(1,3,1)*random(-1,1,2); +$c=random(1,3,1)*random(-1,1,2); +$d=random(1,3,1)*random(-1,1,2); +$e=random(1,3,1)*random(-1,1,2); + +$f[0] = Formula("x"); +$f[1] = Formula("x**3"); +$f[2] = Formula("1/x"); +$f[3] = Formula("-x/abs($a)"); +$f[4] = Formula("sin(x)"); +$f[5] = Formula("$a"); +$f[6] = Formula("abs(x)+$a"); +$f[7] = Formula("x**2+$b"); +$f[8] = Formula("-x**2+$c"); +$f[9] = Formula("cos(x)"); +$f[10] = Formula("1/x**2"); +$f[11] = Formula("x+$d"); +$f[12] = Formula("sqrt(x)"); +$f[13] = Formula("(x+$e)**2"); + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<16; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +#Create a hash and its inverse that randomizes the order of the four graphs. +@scramble = NchooseK(14,14); +@inverse = (); +for my $i (0..13) { + $inverse[$scramble[$i]] = $i+1; +} + +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( + "Select all odd functions:", + "$inverse[0]", + "$inverse[1]", + "$inverse[2]", + "$inverse[3]", + "$inverse[4]", +); +$mc -> makeLast("1","2","3","4","5","6","7","8","9","10","11","12","13","14"); + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +[@ $mc -> print_q() @]* +[@ $mc -> print_a() @]* + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $scramble[0] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'2.'.image(insertGraph( $graphs[ $scramble[1] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'3.'.image(insertGraph( $graphs[ $scramble[2] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'4.'.image(insertGraph( $graphs[ $scramble[3] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +['5.'.image(insertGraph( $graphs[ $scramble[4] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'6.'.image(insertGraph( $graphs[ $scramble[5] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'7.'.image(insertGraph( $graphs[ $scramble[6] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'8.'.image(insertGraph( $graphs[ $scramble[7] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +['9.'.image(insertGraph( $graphs[ $scramble[8] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'10.'.image(insertGraph( $graphs[ $scramble[9] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'11.'.image(insertGraph( $graphs[ $scramble[10] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'12.'.image(insertGraph( $graphs[ $scramble[11] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +['13.'.image(insertGraph( $graphs[ $scramble[12] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'14.'.image(insertGraph( $graphs[ $scramble[13] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 1; +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + + +BEGIN_PGML_SOLUTION + +Odd functions are symmetric by the origin. The correct answers are: + + [@$mc->correct_ans()@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry21.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry21.pg new file mode 100644 index 0000000000..b7b892d83b --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry21.pg @@ -0,0 +1,229 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGchoicemacros.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$a=random(1,3,1)*random(-1,1,2); +$b=random(1,3,1)*random(-1,1,2); +$c=random(1,3,1)*random(-1,1,2); +$d=random(1,3,1)*random(-1,1,2); +$e=random(1,3,1)*random(-1,1,2); + +$f[0] = Formula("x"); +$f[1] = Formula("x**3"); +$f[2] = Formula("1/x"); +$f[3] = Formula("-x/abs($a)"); +$f[4] = Formula("sin(x)"); +$f[5] = Formula("$a"); +$f[6] = Formula("abs(x)+$a"); +$f[7] = Formula("x**2+$b"); +$f[8] = Formula("-x**2+$c"); +$f[9] = Formula("cos(x)"); +$f[10] = Formula("1/x**2"); +$f[11] = Formula("x+$d"); +$f[12] = Formula("sqrt(x)"); +$f[13] = Formula("(x+$e)**2"); + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<16; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +#Create a hash and its inverse that randomizes the order of the four graphs. +@scramble = NchooseK(14,14); +@inverse = (); +for my $i (0..13) { + $inverse[$scramble[$i]] = $i+1; +} + +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( + "Select all even functions:", + "$inverse[5]", + "$inverse[6]", + "$inverse[7]", + "$inverse[8]", + "$inverse[9]", + "$inverse[10]", +); +$mc -> makeLast("1","2","3","4","5","6","7","8","9","10","11","12","13","14"); + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +[@ $mc -> print_q() @]* +[@ $mc -> print_a() @]* + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $scramble[0] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'2.'.image(insertGraph( $graphs[ $scramble[1] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'3.'.image(insertGraph( $graphs[ $scramble[2] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'4.'.image(insertGraph( $graphs[ $scramble[3] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +['5.'.image(insertGraph( $graphs[ $scramble[4] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'6.'.image(insertGraph( $graphs[ $scramble[5] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'7.'.image(insertGraph( $graphs[ $scramble[6] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'8.'.image(insertGraph( $graphs[ $scramble[7] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +['9.'.image(insertGraph( $graphs[ $scramble[8] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'10.'.image(insertGraph( $graphs[ $scramble[9] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'11.'.image(insertGraph( $graphs[ $scramble[10] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'12.'.image(insertGraph( $graphs[ $scramble[11] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +['13.'.image(insertGraph( $graphs[ $scramble[12] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'14.'.image(insertGraph( $graphs[ $scramble[13] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 1; +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + + +BEGIN_PGML_SOLUTION + +Even functions are symmetric by the [`y`]-axis. The correct answers are: + + [@$mc->correct_ans()@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry22.pg b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry22.pg new file mode 100644 index 0000000000..cd40631048 --- /dev/null +++ b/OpenProblemLibrary/PCC/CollegeAlgebra/Transformations/Symmetry22.pg @@ -0,0 +1,228 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Algebra') +## DBchapter('Functions') +## DBsection('Exponential') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Carl Yao') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "PGchoicemacros.pl", + "niceTables.pl", + "PGcourse.pl", +); + + $refreshCachedImages = 1; + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed inequalities +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$a=random(1,3,1)*random(-1,1,2); +$b=random(1,3,1)*random(-1,1,2); +$c=random(1,3,1)*random(-1,1,2); +$d=random(1,3,1)*random(-1,1,2); +$e=random(1,3,1)*random(-1,1,2); + +$f[0] = Formula("x"); +$f[1] = Formula("x**3"); +$f[2] = Formula("1/x"); +$f[3] = Formula("-x/abs($a)"); +$f[4] = Formula("sin(x)"); +$f[5] = Formula("$a"); +$f[6] = Formula("abs(x)+$a"); +$f[7] = Formula("x**2+$b"); +$f[8] = Formula("-x**2+$c"); +$f[9] = Formula("cos(x)"); +$f[10] = Formula("1/x**2"); +$f[11] = Formula("x+$d"); +$f[12] = Formula("sqrt(x)"); +$f[13] = Formula("(x+$e)**2"); + +$xmin = -5; #The viewing window +$xmax = 5; +$ymin = -5; +$ymax = 5; + + +@graphs = (); + + +# Start making the graphs + +for ( my $i=0; $i<16; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb('reset'); + foreach my $j (1..4) { + $graphs[$i]->lb( new Label(-4.7, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label(-4.7, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label( $j,-4.7, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,-4.7,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + +# Define new graph colors + + $graphs[$i]->new_color("lightblue", 214,230,244); # RGB + $graphs[$i]->new_color("darkblue", 100,100,255); + $graphs[$i]->new_color("lightgreen",156,215,151); # other color options + $graphs[$i]->new_color("darkgreen", 0, 86, 34); # for future author use + $graphs[$i]->new_color("lightred", 245,234,229); # light red-purple + $graphs[$i]->new_color("darkred", 159, 64, 16); # red-brown + + $graphs[$i]->new_color("white", 255, 255, 255); # needed to seal off + # areas bordered with + # dashed lines + +# Choose colors + + $light[$i] = "lightblue"; # Graphs will all be blue + $dark[$i] = "darkblue"; # This could be modified to give different + # graphs different colors. + + +add_functions($graphs[$i], "$f[$i] for x in <-5,5> " . + "using color:blue and weight:2"); + +} + +#Create a hash and its inverse that randomizes the order of the four graphs. +@scramble = NchooseK(14,14); +@inverse = (); +for my $i (0..13) { + $inverse[$scramble[$i]] = $i+1; +} + +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( + "Select all functions that are neither odd nor even:", + "$inverse[11]", + "$inverse[12]", + "$inverse[13]", +); +$mc -> makeLast("1","2","3","4","5","6","7","8","9","10","11","12","13","14"); + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML + +[@ $mc -> print_q() @]* +[@ $mc -> print_a() @]* + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $scramble[0] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'2.'.image(insertGraph( $graphs[ $scramble[1] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'3.'.image(insertGraph( $graphs[ $scramble[2] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'4.'.image(insertGraph( $graphs[ $scramble[3] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +['5.'.image(insertGraph( $graphs[ $scramble[4] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'6.'.image(insertGraph( $graphs[ $scramble[5] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'7.'.image(insertGraph( $graphs[ $scramble[6] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'8.'.image(insertGraph( $graphs[ $scramble[7] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +['9.'.image(insertGraph( $graphs[ $scramble[8] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'10.'.image(insertGraph( $graphs[ $scramble[9] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'11.'.image(insertGraph( $graphs[ $scramble[10] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'12.'.image(insertGraph( $graphs[ $scramble[11] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +['13.'.image(insertGraph( $graphs[ $scramble[12] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'), +'14.'.image(insertGraph( $graphs[ $scramble[13] ] ), + tex_size=>$texsize, height=>$size, width=>$size, + extra_html_tags=>'alt="graph"'),], +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +$showPartialCorrectAnswers = 1; +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + + +BEGIN_PGML_SOLUTION + +Odd functions are symmetric by the origin; even functions are symmetric by the [`y`]-axis. All other functions are neither odd nor even. + +The correct answers are: + + [@$mc->correct_ans()@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/CompSci/CS161/problemSample.pg b/OpenProblemLibrary/PCC/CompSci/CS161/problemSample.pg new file mode 100644 index 0000000000..e917b969fc --- /dev/null +++ b/OpenProblemLibrary/PCC/CompSci/CS161/problemSample.pg @@ -0,0 +1,61 @@ +## DESCRIPTION +## Precalculus: function decomposition +## ENDDESCRIPTION +## KEYWORDS('precalculus', 'function decomposition') +## DBsubject('WeBWorK') +## DBchapter('WeBWorK Tutorial') +## DBsection('Fort Lewis Tutorial 2011') +## Date('01/30/2011') +## Author('Paul Pearson') +## Institution('Fort Lewis College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +########################### +# Initialization +DOCUMENT(); +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"answerComposition.pl", +"AnswerFormatHelp.pl", +); +TEXT(beginproblem()); +########################### +# Setup +Context("Numeric"); +Context()->variables->add(u=>"Real"); +$a = random(2,9,1); +$f = Formula("sqrt(u)"); +$g = Formula("x^2+$a"); +########################### +# Main text +Context()->texStrings; +BEGIN_TEXT +Express the function \( y = \sqrt{ x^2 + $a } \) +as a composition \( y = f(g(x)) \) of two simpler +functions \( y = f(u) \) and \( u = g(x) \). +$BR +$BR +\( f(u) \) = \{ ans_rule(20) \} +\{ AnswerFormatHelp("formulas") \} +$BR +\( g(x) \) = \{ ans_rule(20) \} +\{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; +############################ +# Answer evaluation +$showPartialCorrectAnswers = 1; +COMPOSITION_ANS( $f, $g, vars=>['u','x'], showVariableHints=>1); +############################ +# Solution +Context()->texStrings; +BEGIN_SOLUTION +Solution explanation goes here. +END_SOLUTION +Context()->normalStrings; +COMMENT('MathObject version.'); +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_01_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_01_AbsValEq.pg new file mode 100644 index 0000000000..b326c22447 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_01_AbsValEq.pg @@ -0,0 +1,91 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(AbsVal3) +## MLTleader(1) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$RequiredFormat = "Enter your answer in the form: ". +"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". +"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". +"(include the word ${BBOLD}or$EBOLD between the solutions), ". +"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". +"For no solution, type ${BITALIC}NONE${EITALIC} and ". +"if all real numbers are solutions, ". +"type ${BITALIC}All real numbers${EITALIC}."; + +$a = random(1,12,1); + +Context("Inequalities-AllowStrings"); +Context()->variables->are($var=>'Real'); +Context()->strings->add("No solution"=>{NONE}); +Context('FiniteSolutionSets'); +Context()->variables->are($var=>'Real'); +$ans = Formula("{-$a, $a}"); + +###################################### +# Main text + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert [$var] \right\rvert = [$a] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); + + + + + + + + + + + + + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_02_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_02_AbsValEq.pg new file mode 100644 index 0000000000..1cb0eca13a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_02_AbsValEq.pg @@ -0,0 +1,78 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(AbsVal1) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(1,7,2); +$b = random(9,17,2); + +$RequiredFormat = "Enter your answer in the form: ". +"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". +"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". +"(include the word ${BBOLD}or$EBOLD between the solutions), ". +"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". +"For no solution, type ${BITALIC}NONE${EITALIC} and ". +"if all real numbers are solutions, ". +"type ${BITALIC}All real numbers${EITALIC}."; +Context("Inequalities-AllowStrings"); +Context()->variables->are($var=>'Real'); +Context()->strings->add("No solution"=>{NONE}); +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans1 = -$b+$a; +$ans2 = $b+$a; +$ans = Formula("{$ans1, $ans2}"); + +###################################### +# Main text + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert [$var] - [$a] \right\rvert = [$b] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_03_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_03_AbsValEq.pg new file mode 100644 index 0000000000..c4ee72db7d --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_03_AbsValEq.pg @@ -0,0 +1,78 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(AbsVal1) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "contextFraction.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(1,7,2); +$b = random(9,17,2); + +$RequiredFormat = "Enter your answer in the form: ". +"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". +"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". +"(include the word ${BBOLD}or$EBOLD between the solutions), ". +"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". +"For no solution, type ${BITALIC}NONE${EITALIC} and ". +"if all real numbers are solutions, ". +"type ${BITALIC}All real numbers${EITALIC}."; +Context("Inequalities-AllowStrings"); +Context()->variables->are($var=>'Real'); +Context()->strings->add("No solution"=>{NONE}); +Context("Fraction"); +@sol = (Fraction(-$b-$a,2),Fraction($b-$a,2)); +Context("FiniteSolutionSets"); +$ans = Formula("{$sol[0],$sol[1]}"); + +###################################### +# Main text + +TEXT(beginproblem()); +BEGIN_PGML +Solve the eqation. + +[`` \left\lvert 2[$var] + [$a] \right\rvert = [$b] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_04_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_04_AbsValEq.pg new file mode 100644 index 0000000000..0be15c8490 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_04_AbsValEq.pg @@ -0,0 +1,78 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl" +); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(1,7,2); +$b = random(3,9,2); +$c = random(1,3,2); + +$RequiredFormat = "Enter your answer in the form: ". +"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". +"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". +"(include the word ${BBOLD}or$EBOLD between the solutions), ". +"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". +"For no solution, type ${BITALIC}NONE${EITALIC} and ". +"if all real numbers are solutions, ". +"type ${BITALIC}All real numbers${EITALIC}."; +Context("Inequalities-AllowStrings"); +Context()->variables->are($var=>'Real'); +Context()->strings->add("No solution"=>{NONE}); +Context("Fraction"); +$sol1 = Fraction($a-$b*$c,2); +$sol2 = Fraction($a+$b*$c,2); +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$sol1,$sol2}"); + +###################################### +# Main text + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + +[``\displaystyle \left\lvert\frac{2 [$var] - [$a]}{[$b]}\right\rvert = [$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_05_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_05_AbsValEq.pg new file mode 100644 index 0000000000..334c846a00 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_05_AbsValEq.pg @@ -0,0 +1,62 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(-10,-3,2); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Compute("no solutions"); + +###################################### +# Main text + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert [$var] \right\rvert = [$a] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_06_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_06_AbsValEq.pg new file mode 100644 index 0000000000..ab256718f0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_06_AbsValEq.pg @@ -0,0 +1,76 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(2,4,2); + +$RequiredFormat = "Enter your answer in the form: ". +"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". +"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". +"(include the word ${BBOLD}or$EBOLD between the solutions), ". +"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". +"For no solution, type ${BITALIC}NONE${EITALIC} and ". +"if all real numbers are solutions, ". +"type ${BITALIC}All real numbers${EITALIC}."; +Context("Inequalities-AllowStrings"); +Context()->variables->are($var=>'Real'); +Context()->strings->add("No solution"=>{NONE}); +$ans = List(-$a); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{-$a}"); + +###################################### +# Main text + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert [$var] + [$a] \right\rvert = 0 ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_07_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_07_AbsValEq.pg new file mode 100644 index 0000000000..ae9c7624d2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_07_AbsValEq.pg @@ -0,0 +1,82 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(AbsVal1) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(2,4,2); +$b = random(5,14,1); + +$RequiredFormat = "Enter your answer in the form: ". +"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". +"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". +"(include the word ${BBOLD}or$EBOLD between the solutions), ". +"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". +"For no solution, type ${BITALIC}NONE${EITALIC} and ". +"if all real numbers are solutions, ". +"type ${BITALIC}All real numbers${EITALIC}."; +Context("Inequalities-AllowStrings"); +Context()->variables->are($var=>'Real'); +Context()->strings->add("No solution"=>{NONE}); +($n1,$d1) = reduce($b+$a,3); #---To get a nice looking answer +$v1 = "$n1/$d1"; +if ($d1==1) {$v1 = "$n1";} +($n2,$d2) = reduce($a-$b,3); +$v2 = "$n2/$d2"; +if ($d2==1) {$v2 = "$n2";} +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$v1, $v2}"); + + +###################################### +# Main text + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert [$a] - 3[$var] \right\rvert = [$b] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_08_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_08_AbsValEq.pg new file mode 100644 index 0000000000..cef7f6612e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_08_AbsValEq.pg @@ -0,0 +1,70 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## Updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(AbsVal1) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(2,4,2); +$b = random(1,7,2); +$c = random(1,5,2); +if ($b == $c) { + $b = $c + 2; +} + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans1 = (-$c-$b)*$a; +$ans2 = ($c-$b)*$a; +$ans = Formula("{$ans1,$ans2}"); + +###################################### +# Main text + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert\frac{1}{[$a]}[$var] + [$b]\right\rvert = [$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_09_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_09_AbsValEq.pg new file mode 100644 index 0000000000..0cffba9659 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_09_AbsValEq.pg @@ -0,0 +1,84 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(0.1,0.9,0.1); +$b = list_random(0.1,0.2,0.4,0.5,0.8); +$c = random(1,5,1); + +$RequiredFormat = "Enter your answer in the form: ". +"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". +"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". +"(include the word ${BBOLD}or$EBOLD between the solutions), ". +"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". +"For no solution, type ${BITALIC}NONE${EITALIC} and ". +"if all real numbers are solutions, ". +"type ${BITALIC}All real numbers${EITALIC}."; +Context("Inequalities-AllowStrings"); +Context()->variables->are($var=>'Real'); +Context()->strings->add("No solution"=>{NONE}); +$ans = List(($c+$a)/$b, (-$c+$a)/$b); + +Context("Fraction"); +$soln1 = Fraction(($c+$a)/$b); +$soln2 = Fraction((-$c+$a)/$b); + +Context("FiniteSolutionSets"); +#Context()->flags->remove("NumberCheck"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$soln1,$soln2}"); + +###################################### +# Main text + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert[$a]- [$b][$var]\right\rvert = [$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_10_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_10_AbsValEq.pg new file mode 100644 index 0000000000..8009b0d5c9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_10_AbsValEq.pg @@ -0,0 +1,68 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(AbsVal5) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(1,9,2); +$b = random(2,8,2); +$c = random(2,6,2); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$d = -$c-$b-$a; +$e = $c+$b-$a; +$ans = Formula("{$d, $e}"); + +###################################### +# Main text + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert [$var] + [$a]\right\rvert - [$b] = [$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + + +[__]{$ans}{width=>20} + + +END_PGML + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_12_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_12_AbsValEq.pg new file mode 100644 index 0000000000..e30e9c89e9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_12_AbsValEq.pg @@ -0,0 +1,79 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(AbsVal5) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(1,9,2); +$c = random(2,6,2); +$b = $c + random(1,5,1); #This gives a negative for the absolute value + +$RequiredFormat = "Enter your answer in the form: ". +"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". +"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". +"(include the word ${BBOLD}or$EBOLD between the solutions), ". +"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". +"For no solution, type ${BITALIC}NONE${EITALIC} and ". +"if all real numbers are solutions, ". +"type ${BITALIC}All real numbers${EITALIC}."; +Context("Inequalities-AllowStrings"); +Context()->variables->are($var=>'Real'); ## +Context()->strings->add("No solution"); +$ans = Compute("NONE"); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); ## +$ans = Compute("no solutions"); + +###################################### +# Main text + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert [$var] + [$a] \right\rvert + [$b] = [$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_13_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_13_AbsValEq.pg new file mode 100644 index 0000000000..c15d8e3511 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_13_AbsValEq.pg @@ -0,0 +1,67 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(AbsVal5) +## MLTleader(1) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(1,9,2); +$c = random(2,6,2); +$b = $c + random(1,5,1); #This gives a negative for the absolute value +$d = random(2,8,2); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Compute("no solutions"); + +###################################### +# Main text + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert [$d] [$var] + [$a]\right\rvert + [$b] = [$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_14_AbsValEq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_14_AbsValEq.pg new file mode 100644 index 0000000000..e709dd4f26 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_14_AbsValEq.pg @@ -0,0 +1,66 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(AbsVal5) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(2,5,1); +$n = random(1,5,1); +$b = $a * $n; +$c = random(1,8,1); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$n}"); + +###################################### +# Main text + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert[$a] [$var] - [$b]\right\rvert + [$c] = [$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + + +[__]{$ans}{width=>20} + + +END_PGML + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_15_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_15_AbsValIneq.pg new file mode 100644 index 0000000000..3d537ddc8e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_15_AbsValIneq.pg @@ -0,0 +1,71 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(simpleIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(2,8,1); + + +###################################### + +# Main text + + +BEGIN_PGML +Solve the following inequality: \( |x| < $a \) + +Answer: \{ans_rule(20) \} +END_PGML + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + +$ans = Compute("-$acmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + + +; +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_16_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_16_AbsValIneq.pg new file mode 100644 index 0000000000..ba870bedbb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_16_AbsValIneq.pg @@ -0,0 +1,69 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(simpleIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = non_zero_random(-6,6,1); + +$b = random(1,8,1); +$c=-$b+$a; +$d=$b+$a; + +###################################### +# Main text + +BEGIN_PGML +Solve: [`|x-$a| < $b `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + +Answer: \{ans_rule(20) \} +END_PGML + +###################################### +# Answer + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + +$ans = Compute("$ccmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_17_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_17_AbsValIneq.pg new file mode 100644 index 0000000000..37bc527a7b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_17_AbsValIneq.pg @@ -0,0 +1,69 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(simpleIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = non_zero_random(-6,6,1); + +$b = random(1,8,1); +$c=-$b-$a; +$d=$b-$a; + +###################################### +# Main text + +BEGIN_PGML +Solve: [`|x+$a| < $b `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + +Answer: \{ans_rule(20) \} +END_PGML + +###################################### +# Answer + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + +$ans = Compute("$ccmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_18_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_18_AbsValIneq.pg new file mode 100644 index 0000000000..0d9eb3fc39 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_18_AbsValIneq.pg @@ -0,0 +1,68 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(algIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(1,7,2); +$b = $a + random(1,5,2); +$c = (-$b+$a)/2; +$d = ($b+$a)/2; + +###################################### +# Main text + +BEGIN_PGML +Solve: [` |2x-$a| \leq $b `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + +Answer: \{ans_rule(20) \} +END_PGML + +###################################### +# Answer + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + +$ans = Compute("$c<=x<=$d"); +ANS($ans->cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_19_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_19_AbsValIneq.pg new file mode 100644 index 0000000000..970fc9c4fb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_19_AbsValIneq.pg @@ -0,0 +1,86 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(simpleIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + + +$a = random(2,8,1); + + + +###################################### + +# Main text + + + +BEGIN_PGML + +Solve: [` |x| \ge $a `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + + + +Answer: \{ans_rule(20) \} + +END_PGML + + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + +$ans = Compute("x<=-$a or x>=$a"); +ANS($ans->cmp); + + + +$showPartialCorrectAnswers = 1; + +###################################### + + + + +; +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_20_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_20_AbsValIneq.pg new file mode 100644 index 0000000000..7cdb7b6380 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_20_AbsValIneq.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setAlgebra_05_06_Factoring/56IntAlg_34_AbsoluteValIneq_Review.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setAlgebra_05_06_Factoring/56IntAlg_34_AbsoluteValIneq_Review.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_21_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_21_AbsValIneq.pg new file mode 100644 index 0000000000..b2b2190536 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_21_AbsValIneq.pg @@ -0,0 +1,79 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(simpleIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = non_zero_random(1,6,1); +$b = random(1,8,1); +$c = -$a-$b; +$d = -$a+$b; + + +###################################### + +# Main text + + +BEGIN_PGML +Solve: [` |x+$a| \ge $b `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + +Answer: \{ans_rule(20) \} +END_PGML + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + +$ans = Compute("x<=$c or x>=$d"); +ANS($ans->cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_22_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_22_AbsValIneq.pg new file mode 100644 index 0000000000..3a99be72f3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_22_AbsValIneq.pg @@ -0,0 +1,96 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(simpleIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + + +$a = random(4,8,1); + +$b = $a - random(1,3,1); + +$c = -$a-$b; + +$d = -$a+$b; + + +###################################### + +# Main text + + + +BEGIN_PGML + +Solve: [` |x+$a| > $b `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + + + +Answer: \{ans_rule(20) \} + +END_PGML + + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + +$ans = Compute("x<$c or x>$d"); +ANS($ans->cmp); + + +$showPartialCorrectAnswers = 1; + +###################################### + + + + +; +ENDDOCUMENT(); + + + + + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_23_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_23_AbsValIneq.pg new file mode 100644 index 0000000000..881c8ac9a2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_23_AbsValIneq.pg @@ -0,0 +1,84 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(algIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(2,3,1); +$c = random(2,5,1); +$d = $a * random(1,3,1); #To get integer answers. +$b = $a * random(1,3,1); + +$e1 = (-1*$d*$c-$b)/$a; +$e2 =($d*$c-$b)/$a; + +if($e1<$e2){$min=$e1 and $max=$e2} else {$min=$e2 and $max=$e1}; + + +###################################### + +# Main text + + +BEGIN_PGML +Solve: [` \displaystyle \left| \frac{$a x+ $b}{$c} \right| \le $d `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + +Answer: \{ans_rule(20) \} +END_PGML + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + +$ans = Compute("$min<=x<=$max"); +ANS($ans->cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_24_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_24_AbsValIneq.pg new file mode 100644 index 0000000000..0cdb4ec99a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_24_AbsValIneq.pg @@ -0,0 +1,80 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(algIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(1,9,1); +$b = $a + random(2,10,2); + +$e1 = ($a-$b)/2; +$e2 = ($a+$b)/2; + + +###################################### + +# Main text + + +BEGIN_PGML +Solve: [` |2x-$a| \le $b `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + +Answer: \{ans_rule(20) \} +END_PGML + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + +$ans = Compute("$e1<=x<=$e2"); +ANS($ans->cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_25_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_25_AbsValIneq.pg new file mode 100644 index 0000000000..e2c1089c71 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_25_AbsValIneq.pg @@ -0,0 +1,95 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(algIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + + +$a = random(1,10,1); + +$b = random(-10,-2,1); + + + +###################################### + +# Main text + + + +BEGIN_PGML + +Solve: [` |3x-$a| < $b `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + + + +Answer: \{ans_rule(20) \} + +END_PGML + + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + + +$ans = Compute("NONE"); + +ANS($ans->cmp); + + +$showPartialCorrectAnswers = 1; + +###################################### + + + + +; +ENDDOCUMENT(); + + + + + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_26_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_26_AbsValIneq.pg new file mode 100644 index 0000000000..c2515da7b0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_26_AbsValIneq.pg @@ -0,0 +1,95 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(simpleIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + + +$a = random(1,10,1); + +$b = random(-10,-2,1); + + + +###################################### + +# Main text + + + +BEGIN_PGML + +Solve: [` |x+$a| > $b `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + + + +Answer: \{ans_rule(20) \} + +END_PGML + + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + + +$ans = Compute("All real numbers"); + +ANS($ans->cmp); + + +$showPartialCorrectAnswers = 1; + +###################################### + + + + +; +ENDDOCUMENT(); + + + + + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_27_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_27_AbsValIneq.pg new file mode 100644 index 0000000000..d85d14fcba --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_27_AbsValIneq.pg @@ -0,0 +1,96 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(algIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + + +$a = random(1,9,2); + +$b = random(5,13,2); + +$c = $b - random(1,3,1); # b is bigger + + +###################################### + +# Main text + + + +BEGIN_PGML + +Solve: [` |x+$a| + $b > $c `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + + + +Answer: \{ans_rule(20) \} + +END_PGML + + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + + +$ans = Compute("All real numbers"); + +ANS($ans->cmp); + + +$showPartialCorrectAnswers = 1; + +###################################### + + + + +; +ENDDOCUMENT(); + + + + + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_28_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_28_AbsValIneq.pg new file mode 100644 index 0000000000..39f1a58619 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_28_AbsValIneq.pg @@ -0,0 +1,93 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(algIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + + +$a = random(1,9,2); + +$b = random(5,13,2); + +$c = $b + random(1,3,1); # Need c to be bigger than b for a solution. + + + +###################################### + +# Main text + + + +BEGIN_PGML + +Solve: [` |x+$a| + $b > $c `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + + + +Answer: \{ans_rule(20) \} + +END_PGML + + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + +$ans = Compute("x<(-1*$a - ($c-$b)) or x>(-1*$a + ($c-$b))")->reduce; +ANS($ans->cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + + +; +ENDDOCUMENT(); + + + + + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_29_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_29_AbsValIneq.pg new file mode 100644 index 0000000000..61da858356 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_29_AbsValIneq.pg @@ -0,0 +1,81 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(algIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(1,5,1); +$b = random(2,5,1); +$c = random(1,4,1); + +$e1=($a-$c)*$b; +$e2=($a+$c)*$b; + + +###################################### + +# Main text + + +BEGIN_PGML +Solve: [` \left| $a-\frac{1}{$b}x \right| \le $c `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + +Answer: \{ans_rule(20) \} +END_PGML + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + +$ans = Compute("$e1<=x<=$e2"); +ANS($ans->cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_30_AbsValIneq.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_30_AbsValIneq.pg new file mode 100644 index 0000000000..7378a7a89f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_30_AbsValIneq.pg @@ -0,0 +1,81 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Absolute value inequalities) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(algIneq) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(1,10,1); +$c = random(1,4,1); +$b = $c * random(3,7,4); + +$e1 = -($b+$c)/4-$a; +$e2 = ($b+$c)/4-$a; + + +###################################### + +# Main text + + +BEGIN_PGML +Solve: [` 4|x+$a| -$b < $c `] + +[@KeyboardInstructions("If there is more than one solution, enter the solutions as a comma-separated list. If there are no solutions, enter [|NONE|]*.")@]** + + +Answer: \{ans_rule(20) \} +END_PGML + + +###################################### + +# Answer + + + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + + +$ans = Compute("$e1cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_31_AbsValFunc.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_31_AbsValFunc.pg new file mode 100644 index 0000000000..6306326cab --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_31_AbsValFunc.pg @@ -0,0 +1,90 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Functions) +## DBsection(Function notation) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(AbsVal_Evaluate) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(1,5,1); +$b = random(2,7,1); +$num1 = random(1,4,1); +$num2 = random(-5,-1,1); + + +###################################### + +# Main text + + +BEGIN_PGML +For \( f(x) = |$a - $b x| \), Find: + +a) \( f($num1) = \) \{ ans_rule(15) \} + +b) \( f($num2) = \) \{ ans_rule(15) \} +END_PGML + + +###################################### + +# Answer + + +Context()->strings->add("No solution"=>{}); + + +$ans_a = Real(abs($a - $b * $num1)); +ANS($ans_a->cmp); + +$ans_b = Real(abs($a - $b * $num2)); +ANS($ans_b->cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); + + + + + + + + + + + + + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_32_AbsValFunc.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_32_AbsValFunc.pg new file mode 100644 index 0000000000..694e36b2b0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_32_AbsValFunc.pg @@ -0,0 +1,69 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(2,3,1); +$b = $a * random(2,3,1) + random(1,3,1); +$num1 = random(2,4,1); +$c = $a*$num1 - $b + random(5,9,1); +$num2 = non_zero_random(-3,3,1); +if ($num1==$num2) {$num2=$num1-1;} + +###################################### +# Main text + +BEGIN_PGML +For \( f(x) = |$a x -$b| - $c \), find: + +a) \( f($num1) = \) \{ ans_rule(15) \} + +b) \( f($num2) = \) \{ ans_rule(15) \} +END_PGML + +###################################### +# Answer + +Context()->strings->add("No solution"=>{}); + +$ans_a = Real(abs($a*$num1 - $b) -$c); +ANS(num_cmp($ans_a)); + +$ans_b = Real(abs($a*$num2 - $b) -$c); +ANS($ans_b->cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + +; +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_33_AbsValGraph.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_33_AbsValGraph.pg new file mode 100644 index 0000000000..7fcb6adab8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_33_AbsValGraph.pg @@ -0,0 +1,139 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Graphs with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('.') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "contextInequalitiesAllowStrings.pl", + "parserUtils.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +#----Define the functions +$f = Formula("abs(x)"); +$tf = $f->TeX; #For the text +$sf = $f->string; #For the label + +$a = random(2,4,1); +$g = Formula("$a"); + +#---Define the graph +($xm,$xM) = (-6,6); #min and ma x for x +($ym,$yM) = (-6,6); #min and ma x for y +$size = [300,300]; +$tex_size = 600; + +@slice = NchooseK(3,3); +@colors = ("blue", "red", "green"); +@sc = @colors[@slice]; #scrambled colors + +@Goptions = ( + $xm,$ym,$xM,$yM, + axes => [0,0], + grid => [$xM-$xm,$yM-$ym], + size => $size +); +@imageoptions = (size=>$size,tex_size=>$tex_size); + +$xdomain = "x in <$xm,$xM>"; +$f_options = "using color:$sc[0] and weight:3"; +$g_options = "using color:$sc[1] and weight:3"; + +$graph = init_graph_no_labels(@Goptions); +plot_functions($graph, + "$f for $xdomain $f_options", + "$g for $xdomain $g_options"); + +$labelf = new Label(-3,5, "f(x) = $sf",'black','center'); +$labelg = new Label(3,$a, "y = $a",'black','center'); +$graph->lb($labelf,$labelg); + +$i = 0; # Number the axes +do { + $xtick = $i + $xm + 1; + $labelx[$i] = new Label($xtick,0, "$xtick",'black','center'); + if ($xtick!=0) {$graph->lb($labelx[$i]);} + $i =$i+1; +} while ($i<($xM-$xm)-1); + +$i = 0; +do { + $ytick = $i +$ym + 1; + $labely[$i] = new Label(-.2,$ytick+.1, "$ytick",'black','center'); + if ($ytick!=0) {$graph->lb($labely[$i]);} + $i =$i+1; +} while ($i<($yM-$ym)-1); + +$Image = Image($graph,@imageoptions); + +###################################### +# Main text + +BEGIN_PGML +$Image +$BR $BR +The graph of \( f(x) = $tf \) is given above with the line \( y = $a \). +For what values of \(x\) are the following true? + +a) \( $tf = $a \) +$BR +Answer: \{ans_rule(20) \} + +b) \( $tf < $a \) +$BR +Answer: \{ans_rule(20) \} + +c) \( $tf > $a \) +$BR +Answer: \{ans_rule(20) \} +END_PGML + +###################################### +# Answer + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + +$ans_a = Compute("x=-$a or x=$a"); +ANS($ans_a->cmp); + +$ans_b = Compute("-$acmp); + +$ans_c = Compute("x<-$a or x>$a"); +ANS($ans_c->cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_34_AbsValGraph.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_34_AbsValGraph.pg new file mode 100644 index 0000000000..4fe9e272fe --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_34_AbsValGraph.pg @@ -0,0 +1,139 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Graphs with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('4.3') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "contextInequalitiesAllowStrings.pl", + "parserUtils.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +#----Define the functions +$f = Formula("abs(x)"); +$tf = $f->TeX; #For the text +$sf = $f->string; #For the label + +$a = random(-4,-2,1); +$g = Formula("$a"); + +#---Define the graph +($xm,$xM) = (-6,6); #min and ma x for x +($ym,$yM) = (-6,6); #min and ma x for y +$size = [300,300]; +$tex_size = 600; + +@slice = NchooseK(3,3); +@colors = ("blue", "red", "green"); +@sc = @colors[@slice]; #scrambled colors + +@Goptions = ( + $xm,$ym,$xM,$yM, + axes => [0,0], + grid => [$xM-$xm,$yM-$ym], + size => $size +); +@imageoptions = (size=>$size,tex_size=>$tex_size); + +$xdomain = "x in <$xm,$xM>"; +$f_options = "using color:$sc[0] and weight:3"; +$g_options = "using color:$sc[1] and weight:3"; + +$graph = init_graph_no_labels(@Goptions); +plot_functions($graph, + "$f for $xdomain $f_options", + "$g for $xdomain $g_options"); + +$labelf = new Label(-3,5, "f(x) = $sf",'black','center'); +$labelg = new Label(3,$a, "y = $a",'black','center'); +$graph->lb($labelf,$labelg); + +$i = 0; # Number the axes +do { + $xtick = $i + $xm + 1; + $labelx[$i] = new Label($xtick,0, "$xtick",'black','center'); + if ($xtick!=0) {$graph->lb($labelx[$i]);} + $i =$i+1; +} while ($i<($xM-$xm)-1); + +$i = 0; +do { + $ytick = $i +$ym + 1; + $labely[$i] = new Label(-.2,$ytick+.1, "$ytick",'black','center'); + if ($ytick!=0) {$graph->lb($labely[$i]);} + $i =$i+1; +} while ($i<($yM-$ym)-1); + +$Image = Image($graph,@imageoptions); + +###################################### +# Main text + +BEGIN_PGML +$Image +$BR $BR +The graph of \( f(x) = $tf \) is given above with the line \( y = $a \). +For what values of \(x\) are the following true? + +a) \( $tf = $a \) +$BR +Answer: \{ans_rule(20) \} + +b) \( $tf < $a \) +$BR +Answer: \{ans_rule(20) \} + +c) \( $tf > $a \) +$BR +Answer: \{ans_rule(20) \} +END_PGML + +###################################### +# Answer + +Context("Inequalities-AllowStrings"); +Context()->strings->add("No solution"=>{}); + +$ans_a = Compute("NONE"); +ANS($ans_a->cmp); + +$ans_b = Compute("NONE"); +ANS($ans_b->cmp); + +$ans_a = Compute("All real numbers"); +ANS($ans_a->cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_35_LinearSystem.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_35_LinearSystem.pg new file mode 100644 index 0000000000..3dbc4f20fb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_35_LinearSystem.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setAlgebra_05_01_IntroPolynomials/51IntAlg_29_LinearSystem_Review.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setAlgebra_05_01_IntroPolynomials/51IntAlg_29_LinearSystem_Review.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_36_ScientificNot.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_36_ScientificNot.pg new file mode 100644 index 0000000000..8f4719cf69 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/43IntAlg_36_ScientificNot.pg @@ -0,0 +1,72 @@ +##DESCRIPTION +## Absolute Value Equalites and Inequalities +## +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Algebra of real numbers and simplifying expressions) +## DBsection(Scientific notation) +## Institution(The College of Idaho) +## Author(RA Cruz) +## MLT(Div_scientific) +## MLTleader(1) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('4.3') +## Problem1('') +## KEYWORDS('inequalities','absolute value') +## Date: 2007/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextScientificNotation.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +do { + $num2 = random(1.5,9,.1); + $num1 = -1*$num2*random(.2,.9,.05); #Keep the decimal length small +} until ($num1<-1); + +$exp1 = random(-7,-1,1); +$exp2 = random(3,7,1); + +Context("ScientificNotation"); + +$a = ScientificNotation($num1 * 10**$exp1); +$b = ScientificNotation($num2 * 10**$exp2); + +###################################### +# Main text + +BEGIN_PGML +Perform the computation and write the result in scientific notation: + +\( \displaystyle \frac{\{$a->TeX\}}{\{$b->TeX\}} \) = \{ ans_rule(20) \} +END_PGML + +###################################### +# Answer + +$answer = Compute($a/$b)->reduce; +ANS($answer->cmp); + +$showPartialCorrectAnswers = 1; + +###################################### + + +; +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/54IntAlg_35_AbsoluteValEq_Review.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/54IntAlg_35_AbsoluteValEq_Review.pg new file mode 100644 index 0000000000..98ce14e20e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/54IntAlg_35_AbsoluteValEq_Review.pg @@ -0,0 +1,91 @@ +###DESCRIPTION +## REVIEW: Absolute value equation +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('5.4') +## Problem1('') +## KEYWORDS('Absolute value','inequalities') +## Date: 2007/11 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(2,4,2); +$b = random(1,5,2); +$c = $a * random(1,3,1) - $b; + +$RequiredFormat = "Enter your answer in the form: ". +"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". +"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". +"(include the word ${BBOLD}or$EBOLD between the solutions), ". +"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". +"For no solution, type ${BITALIC}NONE${EITALIC} and ". +"if all real numbers are solutions, ". +"type ${BITALIC}All real numbers${EITALIC}."; + +###################################### +# Main text + +BEGIN_TEXT +Solve: \( $a|$var| - $b = $c \). +$PAR +Answer: \{ ans_rule(25) \} +\{ knowlLink("help(entering answers)", +value=>($RequiredFormat)) \} +END_TEXT + +###################################### +# Answer + +Context("Inequalities-AllowStrings"); +Context()->variables->are($var=>'Real'); +Context()->strings->add("No solution"=>{NONE}); + +($n1,$d1) = reduce(-1*($c + $b),$a); #---To get a nice looking answer +$v1 = "$n1/$d1"; +if ($d1==1) {$v1 = "$n1";} +($n2,$d2) = reduce($c + $b,$a); +$v2 = "$n2/$d2"; +if ($d2==1) {$v2 = "$n2";} + +sub errMsg { + my $ans = shift; + $ans->{ans_message} = $RequiredFormat + if $ans->{ans_message} =~ /it looks like/; + return $ans; +} + +$ans = Compute("$var=$v1 or $var=$v2"); +ANS($ans->cmp->withPostFilter(~~&errMsg)); + +$showPartialCorrectAnswers = 1; + +###################################### + +; +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/57IntAlg_32_AbsoluteValEq_Review.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/57IntAlg_32_AbsoluteValEq_Review.pg new file mode 100644 index 0000000000..3f85b156ea --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/57IntAlg_32_AbsoluteValEq_Review.pg @@ -0,0 +1,99 @@ +##DESCRIPTION +## REVIEW: Absolute Value Equality +## updated -rac 12/2014 +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(The College of Idaho) +## Author(RA Cruz) +## Level(2) +## MO(1) +## TitleText1('Essentials of Intermediate Algebra') +## AuthorText1('Blitzer') +## EditionText1('1') +## Section1('5.7') +## Problem1('') +## KEYWORDS('absolute value') +## Date: 2007/11 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalitiesAllowStrings.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +###################################### +# Setup + +@alphbet = ("a", "b","t","x","y"); +$n = random(0,4,1); +$var = $alphbet[$n]; + +$a = random(2,3,1); +$b = random(5,13,2); +$c = random(-2,4,1); + +$RequiredFormat = "Enter your answer in the form: ". +"${BITALIC}$var=m.$EITALIC $BR For more than one answer: ". +"${BITALIC}$var=m$EITALIC or ${BITALIC}$var=n$EITALIC ". +"(include the word ${BBOLD}or$EBOLD between the solutions), ". +"or enter your answer as a set ${BITALIC}{m, n}${EITALIC}. $BR". +"For no solution, type ${BITALIC}NONE${EITALIC} and ". +"if all real numbers are solutions, ". +"type ${BITALIC}All real numbers${EITALIC}."; + +###################################### +# Main text + +BEGIN_TEXT +Solve: \( |$a $var + $b| = $c \) +$PAR +Answer: \{ ans_rule(20) \} +\{ knowlLink("help(entering answers)", +value=>($RequiredFormat)) \} +END_TEXT + +###################################### +# Answer + +Context("Inequalities-AllowStrings"); +Context()->variables->are($var=>'Real'); +Context()->strings->add("No solution"=>{NONE}); +sub errMsg { + my $ans = shift; + $ans->{ans_message} = $RequiredFormat + if $ans->{ans_message} =~ /it looks like/; + return $ans; +} + +if ($c>0) + { + $ans = Compute("$var=(-$c-$b)/$a or $var=($c-$b)/$a")->reduce; + } +else + { + if ($c==0) + { + $ans = Compute("$var=-$b/$a")->reduce; + } + else + { + $ans = Compute("NONE"); + } + } + +ANS($ans->cmp->withPostFilter(~~&errMsg)); + +$showPartialCorrectAnswers = 1; + +###################################### + +; +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/MCH1-3-3-12-Absolute-value.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/MCH1-3-3-12-Absolute-value.pg new file mode 100644 index 0000000000..030f4088bb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/MCH1-3-3-12-Absolute-value.pg @@ -0,0 +1,118 @@ +## DESCRIPTION +## Absolute value equations and inequalities +## ENDDESCRIPTION + + +## BookTitle('Algebra: Form and Function') +## BookChapter('Rules for Equations and the Reasons For Them') +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Date(01/01/10) +## Institution(Fort Lewis College) +## Author(Paul Pearson) +## Level(3) +## MO(1) +## TitleText1('Algebra: Form and Function') +## AuthorText1('McCallum, Connally, and Hughes-Hallett') +## EditionText1('1') +## Section1('3.3') +## Problem1('12') +## KEYWORDS('Absolute value','Solving equations','Solving Inequalities') + + +################################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserMultiAnswer.pl", + "parserImplicitPlane.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + + +################################### +# Setup + +Context("ImplicitPlane"); +Context()->variables->are(x=>"Real",y=>"Real"); +Context()->variables->set(x=>{limits=>[2,8]}); + +$a = random(3,7,1); +$b = random(3,7,1); +$c = random(3,7,1); +while ($a == $b) { $b = random(3,7,1); } + +$eqn = "$a = |$c x| - $b"; + +$sol = List(Real("($a+$b)/$c"),Real("-($a+$b)/$c")); + +$plane1 = ImplicitPlane("$a = $c x - $b"); +$plane2 = ImplicitPlane("$a = -$c x - $b"); + +$multians = MultiAnswer($plane1, $plane2)->with( + singleResult => 0, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $f1stu, $f2stu ) = @{$student}; + my ( $f1, $f2 ) = @{$correct}; + if ( ($f1 == $f1stu && $f2 == $f2stu) || + ($f1 == $f2stu && $f2 == $f1stu) ) { + return [1,1]; + } else { + if ($f1 == $f1stu || $f2 == $f1stu) { + return [1,0]; + } elsif ($f1 == $f2stu || $f2 == $f2stu) { + return [0,1]; + } else { + return [0,0]; + } + } + } +); + + +#Context()->functions->disable("abs"); +Context()->functions->disable("All"); +Context()->operators->undefine("^","**"); +Context()->parens->remove("|"); +Context()->{error}{convert} = sub { + my $message = shift; + $message =~ s/Unexpected character '~~|'/Absolute value is not allowed/; + return $message; +}; + +Context("Fraction"); +$soln1 = Fraction(($a+$b)/$c); +$soln2 = Fraction(-($a+$b)/$c); + +Context("FiniteSolutionSets"); +$sol = Formula("{$soln1,$soln2}"); + +################################### +# Main text + +BEGIN_PGML +a. Write the equation [`[$eqn]`] as two separate equations. Neither of your equations should use absolute value. + + [__]{$multians}{width=>30} + [__]{$multians}{width=>30} + +a. Solve the original equation by solveing each of the equations above. + + [__]{$sol}{width=>20} + +END_PGML + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/MCH1-3-3-14-Absolute-value.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/MCH1-3-3-14-Absolute-value.pg new file mode 100644 index 0000000000..3f10907ec3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/MCH1-3-3-14-Absolute-value.pg @@ -0,0 +1,116 @@ +## DESCRIPTION +## Absolute value equations and inequalities +## ENDDESCRIPTION + + +## BookTitle('Algebra: Form and Function') +## BookChapter('Rules for Equations and the Reasons For Them') +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Date(01/01/10) +## Institution(Fort Lewis College) +## Author(Paul Pearson) +## Level(2) +## MO(1) +## TitleText1('Algebra: Form and Function') +## AuthorText1('McCallum, Connally, and Hughes-Hallett') +## EditionText1('1') +## Section1('3.3') +## Problem1('12') +## KEYWORDS('Absolute value','Solving equations','Solving Inequalities') + + +################################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserMultiAnswer.pl", + "parserImplicitPlane.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PCCmacros.pl", + "parserImplicitEquation.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + + +################################### +# Setup + +Context("ImplicitEquation"); +Context()->variables->are(r=>"Real"); +#Context()->variables->set(x=>{limits=>[2,8]}); + + +$a = random(2,8,2); +$b = random(3,7,2); +$c = random(3,7,2); +while ($b == $c) { $c = random(3,7,2); } + +$eqn = "\displaystyle \left| $a - \frac{r}{$b} \right| = $c"; + + +$plane1 = ImplicitPlane("$a - r/$b = $c"); +$plane2 = ImplicitPlane("-$a + r/$b = $c"); + + +$multians = MultiAnswer($plane1, $plane2)->with( + singleResult => 0, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $f1stu, $f2stu ) = @{$student}; + my ( $f1, $f2 ) = @{$correct}; + if ( ($f1 == $f1stu && $f2 == $f2stu) || + ($f1 == $f2stu && $f2 == $f1stu) ) { + return [1,1]; + } else { + if ($f1 == $f1stu || $f2 == $f1stu) { + return [1,0]; + } elsif ($f1 == $f2stu || $f2 == $f2stu) { + return [0,1]; + } else { + return [0,0]; + } + } + } +); + + +#Context()->functions->disable("abs"); +Context()->functions->disable("All"); +Context()->operators->undefine("^","**"); +Context()->parens->remove("|"); +Context()->{error}{convert} = sub { + my $message = shift; + $message =~ s/Unexpected character '~~|'/Absolute value is not allowed/; + return $message; +}; + +Context("FiniteSolutionSets"); +$sol1 = $b*($a-$c); $sol2 = $b*($a+$c); +$sol = Formula("{$sol1,$sol2}"); + +################################### +# Main text + +BEGIN_PGML +a. Write the equation [`[$eqn]`] as two separate equations. Neither of your equations should use absolute value. + + [__]{$multians}{width=>30} + [__]{$multians}{width=>30} + +a. Solve the equation [`[$eqn]`], possibly by solving each equation from part a. + + [__]{$sol}{width=>10} + +END_PGML + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/ks_2_7_60.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/ks_2_7_60.pg new file mode 100644 index 0000000000..54c0d0b161 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/ks_2_7_60.pg @@ -0,0 +1,65 @@ +##DESCRIPTION +## Algebra: absolute value equation +##ENDDESCRIPTION + + +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Date(8/31/2009) +## Institution(University of Minnesota) +## Author(Jonathan Rogness) +## Level(2) +## MO(1) +## TitleText1('Algebra for College Students') +## AuthorText1('Kaufmann, Schwitters') +## EditionText1('8') +## Section1('2.7') +## Problem1('60') +## KEYWORDS('algebra', 'equation', 'absolute value') + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl" +); + +# Print problem number and point value (weight) for the problem +TEXT(beginproblem()); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## + +Context("FiniteSolutionSets"); + +$a = random(4,7,1); +$x = random(2,4,1); +$b = $a*$x; + +$ans = Formula("{-$x}"); + +############################################################## + +BEGIN_PGML +Solve the equation _by inspection_ (meaning in your head). + +[``\left\lvert [$a]x + [$b]\right\rvert = 0 ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + +END_PGML + +############################################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/ks_2_7_70.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/ks_2_7_70.pg new file mode 100644 index 0000000000..84c305410b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/ks_2_7_70.pg @@ -0,0 +1,86 @@ +##DESCRIPTION +## Algebra: absolute value equation +##ENDDESCRIPTION + + +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Date(8/31/2009) +## Institution(University of Minnesota) +## Author(Jonathan Rogness) +## MLT(AbsVal4) +## Level(4) +## Static(1) +## MO(1) +## TitleText1('Algebra for College Students') +## AuthorText1('Kaufmann, Schwitters') +## EditionText1('8') +## Section1('2.7') +## Problem1('70') +## KEYWORDS('algebra', 'equation', 'absolute value') + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionLists.pl", + "extraAnswerEvaluators.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +# Print problem number and point value (weight) for the problem +TEXT(beginproblem()); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## + +do{ +Context("Numeric"); +Context()->strings->add(none=>{},EmptySet=>{alias=>"none"}); +Context()->noreduce('(-x)+y','(-x)-y'); + +do{ +$a = non_zero_random(-4,4,1); +$b = non_zero_random(-4,4,1); +$c = non_zero_random(-4,4,1); +$d = non_zero_random(-4,4,1); +} until ($a - $c != 0 and $a + $c != 0); + +$f = Formula("$a x + $b")->reduce; +$g = Formula("$c x + $d")->reduce; + +Context("Fraction"); +$an1 = Fraction($d-$b,$a-$c); +$an2 = Fraction(-$d-$b,$a+$c); +} until ($an1 != $an2); + +Context("FiniteSolutionSets"); +$ans = Formula("{$an1, $an2}"); + +############################################################## + +BEGIN_PGML +The equation [` \lvert x\rvert =\lvert y\rvert `] is satisfied if [` x=y `] or [` x=-y `]. Use this fact to solve the following equation. + +[``\left\lvert [$f] \right\rvert = \left\lvert [$g] \right\rvert``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + +END_PGML + +############################################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/ks_2_7_72.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/ks_2_7_72.pg new file mode 100644 index 0000000000..a32178583b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/ks_2_7_72.pg @@ -0,0 +1,74 @@ +##DESCRIPTION +## Algebra: absolute value equation +##ENDDESCRIPTION + + +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Date(8/31/2009) +## Institution(University of Minnesota) +## Author(Jonathan Rogness) +## MLT(AbsVal4) +## MLTleader(1) +## Level(4) +## MO(1) +## TitleText1('Algebra for College Students') +## AuthorText1('Kaufmann, Schwitters') +## EditionText1('8') +## Section1('2.7') +## Problem1('72') +## KEYWORDS('algebra', 'equation', 'absolute value') + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionLists.pl", + "contextInequalities.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +# Print problem number and point value (weight) for the problem +TEXT(beginproblem()); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## + +$a = random(2,6,2); +$b = random(-5,-1,2); +$c = -$a-$b; + +Context("Fraction"); +$c = Fraction( -$a-$b,2); + +Context("FiniteSolutionSets"); +$ans = Formula("{$c}"); + +############################################################## + +BEGIN_PGML +The equation [` \lvert x\rvert =\lvert y\rvert `] is satisfied if [` x=y `] or [` x=-y `]. Use this fact to solve the following equation. + +[``\left\lvert x + [$a] \right\rvert = \left\lvert x + [$b] \right\rvert``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + +END_PGML + +############################################################## + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/lh1-6_66.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/lh1-6_66.pg new file mode 100644 index 0000000000..def8cbd224 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/lh1-6_66.pg @@ -0,0 +1,57 @@ +## DESCRIPTION +## Solve Equation with Absolute Value +## ENDDESCRIPTION + +## Tagged by nhamblet + +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Date(6/3/2002) +## MLT(AbsVal1) +## Level(2) +## TitleText1('College Algebra') +## AuthorText1('Stewart, Redlin, Watson') +## EditionText1('3') +## Section1('3.8') +## Problem1('7') +## KEYWORDS('Solve', 'Equation', 'Absolute Value','algebra', 'Other types of equations') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a=random(2,5,1); +$b=non_zero_random(-4,4,1); +$c=random(10,20,1); + +Context("Fraction"); +$ans1=Fraction(-$c-$b,$a); +$ans2=Fraction($c-$b,$a); +Context("FiniteSolutionSets"); +$answer = Formula("{$ans1,$ans2}"); + +BEGIN_PGML + +Solve the equation. + +[``\left\lvert [$a] x ? {[$b]}\right\rvert =[$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$answer}{width=>20} +END_PGML + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/pn4.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/pn4.pg new file mode 100644 index 0000000000..93d7fa23d6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/pn4.pg @@ -0,0 +1,69 @@ +## DESCRIPTION +## Algebra, Absolute Value +## ENDDESCRIPTION + +## Tagged by jjh2b + +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(ASU) +## MLT(AbsVal1) +## MLTleader(1) +## Level(2) +## TitleText1('College Algebra') +## AuthorText1('Stewart, Redlin, Watson') +## EditionText1('3') +## Section1('3.6') +## Problem1('27') +## KEYWORDS('algebra', 'absolute value','Solve', 'Equation', 'equations','absolute value') + + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "PGasu.pl", + "extraAnswerEvaluators.pl", + "PGML.pl", + "PCCmacros.pl", + "contextFraction.pl", + "contextFiniteSolutionSets.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$a = random(1,10,1); +$b = non_zero_random(-10,10,1); +$c=random(1,10); +$pol = nicestring([$a, $b]); + +$d=$c-$b; +$e=-($b+$c); +$ans1 = "$d/$a"; +$ans2= "$e/$a"; + +Context("Fraction"); +$ans1 = Fraction($d,$a); +$ans2 = Fraction($e,$a); + +Context("FiniteSolutionSets"); +$ans = Formula("{$ans1,$ans2}"); + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert [$pol] \right\rvert = [$c] ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + +END_PGML + + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/pn5.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/pn5.pg new file mode 100644 index 0000000000..6c00524fe5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/pn5.pg @@ -0,0 +1,58 @@ +## DESCRIPTION +## Solve an Equation with Absolute Values +## ENDDESCRIPTION + +## Tagged by nhamblet + +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Date(6/3/2002) +## Institution(ASU) +## MLT(AbsVal1) +## Level(3) +## TitleText1('College Algebra') +## AuthorText1('Stewart, Redlin, Watson') +## EditionText1('3') +## Section1('3.6') +## Problem1('35') +## KEYWORDS('Solve', 'Equation', 'Absolute Value','algebra', 'equations') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "extraAnswerEvaluators.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$a = random(2,10,1); + +$b = random(1,12,1); +$c=random(1,10); + +$ans1=$b/$a+1/($a*$c); +$ans2=$b/$a-1/($a*$c); + +BEGIN_PGML +Solve the following equation. + +[@KeyboardInstructions('If there is more than one solution, write them separated by commas.')@]** + +>>[`` \frac{1}{\left\lvert[$b]-[$a] x\right\rvert} = [$c] ``]<< + +[__]{List($ans1,$ans2)}{width=>20} + +END_PGML + +ENDDOCUMENT(); # This should be the last executable line in the problem.; + + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/s5p6.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/s5p6.pg new file mode 100644 index 0000000000..03ed192dc6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/s5p6.pg @@ -0,0 +1,70 @@ +##DESCRIPTION +##ENDDESCRIPTION +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(Univeristy of Utah) +## Author(Utah ww group) +## MLT(AbsVal4) +## Level(3) +## TitleText1('Intermediate Algebra') +## AuthorText1('Ron Larson and Robert P. Hostetler') +## EditionText1('4') +## Section1('.') +## Problem1('') +## KEYWORDS('algebra') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "PGML.pl", + "contextFiniteSolutionSets.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +install_problem_grader(~~&std_problem_grader); +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +$showPartialCredit = 0; + +$a = random(2,8,2); +$b = random(2,9,1); +$c = random(3,9,2); +$d = random(2,9,1); +Context("Fraction"); +$answer1 = Fraction($b+$d,$a-$c); +$answer2 = Fraction($b-$d,$a+$c); + +if ($answer2 < $answer1) + { $dummy = $answer1; $answer1 = $answer2; $answer2 = $dummy; } + +Context("FiniteSolutionSets"); +$ans = Formula("{$answer1,$answer2}"); + +BEGIN_PGML +Solve the equation. + +[`` \left\lvert [$a] x - [$b] \right\rvert = \left\lvert [$c] x + [$d]\right\rvert ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + +END_PGML + + +SOLUTION(EV3(<<'EOT')); +$BR $BBOLD Solution:$EBOLD There are two +possible ways in which this equation may be satisfied: +\[$a x - $b = -$c x -$d\] and +\[$a x - $b = $c x + $d.\] +In the first case we obtain +\(x=$answer1\) and in the second +\(x=$answer2\). +EOT + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/zhu12.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/zhu12.pg new file mode 100644 index 0000000000..9e9c6834fa --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/zhu12.pg @@ -0,0 +1,54 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## Tagged by cmd6a 8/6/06 + +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(ASU) +## Level(4) +## KEYWORDS('algebra','absolute value') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "PGasu.pl", + "extraAnswerEvaluators.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$a = random(1,8,1); +$b = random(1,8,1); +do {$b=random(1,8,1);} until ($b != $a); + +$c=random(10,20,1); +$d=random(1,8,1); +$e1=($d+$c-$b)/$a; +$e2=(-$d-$c-$b)/$a; +$e3=(-$d+$c-$b)/$a; +$e4=($d-$c-$b)/$a; +$ans = List($e1,$e2,$e3,$e4); + +BEGIN_PGML +Solve the following inequality. + +>>[`` \big\lvert\left\lvert [$a] x+ [$b]\right\rvert-[$c]\big\rvert = [$d] ``]<< + +[@KeyboardInstructions('If there is more than one solution, enter the solutions as a comma-separated list.')@]** + +[__]{$ans}{width=>20} + +END_PGML + +ENDDOCUMENT(); # This should be the last executable line in the problem.; + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueEquations/zhu2.pg b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/zhu2.pg new file mode 100644 index 0000000000..105c7eaf46 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueEquations/zhu2.pg @@ -0,0 +1,53 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## Tagged by cmd6a 8/6/06 + +## DBsubject(Algebra) +## DBchapter(Absolute value expressions and functions) +## DBsection(Solving equations with absolute values) +## Institution(ASU) +## MLT(AbsVal5) +## Level(4) +## KEYWORDS('algebra','absolute value') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "PGasu.pl", + "extraAnswerEvaluators.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$a = random(-10,-1,1); +$b = random(2,10,1); +$c = non_zero_random(-10,10,1); +$d = random(10,20,1); + +TEXT(EV2(<reduce; + +Context("Fraction"); +$ans1 = Fraction($e,$f); +$ans2 = Fraction($g,$h); + +Context("FiniteSolutionSets"); +$ans = Formula("{$ans1,$ans2}"); +if ($ans1 == $ans2) {$ans = Formula("{$ans1}");}; + +BEGIN_PGML +Solve the equation. + +[``\left\lvert [$func] \right\rvert = \left\lvert[$c] x +[$d]\right\rvert ``] + +[@KeyboardInstructions("If there are no solutions, you may type [|no solutions|]*.")@]** + +[__]{$ans}{width=>20} + +END_PGML + + + +ENDDOCUMENT(); # This should be the last executable line in the problem.; + + + diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities1.pg b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities1.pg new file mode 100644 index 0000000000..bbee0095c7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities1.pg @@ -0,0 +1,136 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "contextFraction.pl", + "PGML.pl", +); + + + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0,'(-x)+y'=>0); + +$yes = "is"; +$no = "is not"; + + +$a[0] = random(1,9,1); +$b[0] = random(1,9,1); +$var[0] = "x"; +$x[0] = random(0,9,1); +$left[0] = Formula("|x-$a[0]|")->reduce; +$right[0] = Formula("$b[0]")->reduce; +$comp[0] = "$LTE"; +if ($left[0]->eval(x=>$x[0]) <= $right[0]->eval(x=>$x[0])) +{$ans[0] = $yes;} +else {$ans[0] = $no;}; + +Context("Fraction"); +$a[1] = random(1,9,1); +$b[1] = random(1,9,1); +$c[1] = random(1,9,1); +$d[1] = random(1,9,1); +$e[1] = random(1,9,1); +$f[1] = random(1,9,1); +$A[1] = Fraction("$a[1]","$b[1]"); +$B[1] = Fraction("$c[1]","$d[1]"); +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0,'(-x)+y'=>0); +Context()->flags->set(reduceConstants=>0); +$var[1] = "x"; +$x[1] = random(-9,9,1); +$left[1] = Formula("|$A[1] x-$B[1]|"); +$right[1] = Formula("$e[1]")->reduce; +$comp[1] = "$GTE"; +if ($left[1]->eval(x=>$x[1]) >= $right[1]->eval(x=>$x[1])) +{$ans[1] = $yes;} +else {$ans[1] = $no;}; + + + +$a[2] = random(1,9,1); +$b[2] = random(1,9,1); +$c[2] = random(1,9,1); +$d[2] = random(1,9,1); +$e[2] = random(1,9,1); +$var[2] = "t"; +Context()->variables->are(t=>'Real'); +$x[2] = random(-9,9,1); +$left[2] = Formula("|$a[2] t - $b[2]|"); +$right[2] = Formula("$c[2] ")->reduce; +$comp[2] = "$GTS"; +if ($left[2]->eval(t=>$x[2]) > $right[2]->eval(t=>$x[2])) +{$ans[2] = $yes;} +else {$ans[2] = $no;}; + + +$a[3] = random(1,9,1); +$b[3] = random(1,9,1); +$c[3] = random(1,9,1); +$d[3] = random(1,9,1); +$e[3] = random(1,9,1); +$var[3] = "z"; +Context()->variables->are(z=>'Real'); +$x[3] = pi; +$left[3] = Formula("|$a[3](z - $b[3])|"); +$right[3] = Formula("$c[3]")->reduce; +$comp[3] = "$LTS"; +if ($left[3]->eval(z=>3.1415926) < $right[3]->eval(z=>3.1415926)) +{$ans[3] = $yes;} +else {$ans[3] = $no;}; +$x[3] = "\pi"; + +Context()->texStrings; + + +for my $i (0..3) { +$statement[$i] = general_math_ev3("$left[$i] $comp[$i] $right[$i]\qquad $var[$i] = $x[$i]"); +$popup[$i] = PopUp([$yes,$no],"$ans[$i]"); +} + + +############################################## + + +BEGIN_PGML + +Decide whether the given value for the variable is a solution. + +a. [$statement[0]]* +The given value [__]{$popup[0]} a solution. + +a. [$statement[1]]* +The given value [__]{$popup[1]} a solution. + +a. [$statement[2]]* +The given value [__]{$popup[2]} a solution. + +a. [$statement[3]]* +The given value [__]{$popup[3]} a solution. + + + + +END_PGML + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities10.pg b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities10.pg new file mode 100644 index 0000000000..ea41892d7a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities10.pg @@ -0,0 +1,193 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "contextFraction.pl", + "PGML.pl", +); + + + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0,'(-x)+y'=>0); + +$yes = "is"; +$no = "is not"; + + +$a[0] = random(1,9,1); +$b[0] = random(1,9,1); +$var[0] = "x"; +$x[0] = random(0,9,1); +$left[0] = Formula("|x-$a[0]|")->reduce; +$right[0] = Formula("$b[0]")->reduce; +$comp[0] = "$LTE"; +$leftValue[0] = $left[0]->eval(x=>$x[0]); +$rightValue[0] = $right[0]->eval(x=>$x[0]); +if ( $leftValue[0] <= $rightValue[0] ) +{$ans[0] = $yes;$tof[0]="true";} +else {$ans[0] = $no;$tof[0]="false";}; + +Context("Fraction"); +$a[1] = random(1,9,1); +do {$b[1] = random(2,9,1);} until ($b[1]!=$a[1]); +$c[1] = random(1,9,1); +$d[1] = random(1,9,1); +$e[1] = random(1,9,1); +$f[1] = random(1,9,1); +$A[1] = Fraction("$a[1]","$b[1]"); +$B[1] = Fraction("$c[1]","$d[1]"); +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0,'(-x)+y'=>0); +Context()->flags->set(reduceConstants=>0); +$var[1] = "x"; +$x[1] = random(-9,9,1); +$left[1] = Formula("|$A[1] x-$B[1]|"); +$right[1] = Formula("$e[1]")->reduce; +$comp[1] = "$GTE"; +$leftValue[1] = $left[1]->eval(x=>$x[1]); +$rightValue[1] = $right[1]->eval(x=>$x[1]); +if ($leftValue[1] >= $rightValue[1]) +{$ans[1] = $yes;$tof[1]="true";} +else {$ans[1] = $no;$tof[1]="false";}; + + + +$a[2] = random(1,9,1); +$b[2] = random(1,9,1); +$c[2] = random(1,9,1); +$d[2] = random(1,9,1); +$e[2] = random(1,9,1); +$var[2] = "t"; +Context()->variables->are(t=>'Real'); +$x[2] = random(-9,9,1); +$left[2] = Formula("|$a[2] t - $b[2]|"); +$right[2] = Formula("$c[2] ")->reduce; +$comp[2] = "$GTS"; +$leftValue[2] = $left[2]->eval($var[2]=>$x[2]); +$rightValue[2] = $right[2]->eval($var[2]=>$x[2]); +if ($leftValue[2] > $rightValue[2]) +{$ans[2] = $yes;$tof[2]="true";} +else {$ans[2] = $no;$tof[2]="false";}; + + +$a[3] = random(1,9,1); +$b[3] = random(1,9,1); +$c[3] = random(1,9,1); +$d[3] = random(1,9,1); +$e[3] = random(1,9,1); +$var[3] = "z"; +Context()->variables->are(z=>'Real'); +$x[3] = pi; +$left[3] = Formula("|$a[3](z - $b[3])|"); +$right[3] = Formula("$c[3]")->reduce; +$comp[3] = "$LTS"; +$leftValue[3] = $left[3]->eval(z=>3.1415926); +$rightValue[3] = $right[3]->eval(z=>3.1415926); +if ( $leftValue[3] < $rightValue[3] ) +{$ans[3] = $yes;$tof[3]="true";} +else {$ans[3] = $no;$tof[3]="false";}; +$x[3] = "\pi"; + +Context()->texStrings; + + +for my $i (0..3) { +$statement[$i] = "\($left[$i] $comp[$i] $right[$i]\qquad $var[$i] = $x[$i]\)"; +$popup[$i] = PopUp([$yes,$no],"$ans[$i]"); +} + + +############################################## + + +BEGIN_PGML + +Decide whether the given value for the variable is a solution. + +1. [$statement[0]]* +The given value [__]{$popup[0]} a solution. + +2. [$statement[1]]* +The given value [__]{$popup[1]} a solution. + +3. [$statement[2]]* +The given value [__]{$popup[2]} a solution. + +4. [$statement[3]]* +The given value [__]{$popup[3]} a solution. + +END_PGML + +######################################## + +BEGIN_PGML_SOLUTION + +To check whether a number is a solution of an inequality, we substitute the number into the inequality, and see whether the inequality is true or false. + +###Question 1 + + [`` +\begin{aligned} + [$left[0]] &[$comp[0]] [$right[0]] &\text{when }[$var[0]] = [$x[0]]\\ + \left| ([$x[0]])-[$a[0]] \right| &[$comp[0]] [$right[0]] \\ + [$leftValue[0]] &[$comp[0]] [$rightValue[0]] \\ +\end{aligned} + ``] + +Since the statement above is [$tof[0]], [`[$var[0]] = [$x[0]]`] [@$popup[0]->correct_ans()@] a solution. + +###Question 2 + + [`` +\begin{aligned} + [$left[1]] &[$comp[1]] [$right[1]] &\text{when }[$var[1]] = [$x[1]]\\ + \left| [$A[1]] ([$x[1]])-[$B[1]] \right| &[$comp[1]] [$right[1]] \\ + [$leftValue[1]] &[$comp[1]] [$rightValue[1]] \\ +\end{aligned} + ``] + +Since the statement above is [$tof[1]], [`[$var[1]] = [$x[1]]`] [@$popup[1]->correct_ans()@] a solution. + +###Question 3 + + [`` +\begin{aligned} + [$left[2]] &[$comp[2]] [$right[2]] &\text{when }[$var[2]] = [$x[2]]\\ + \left| [$a[2]] ([$x[2]]) - [$b[2]] \right| &[$comp[2]] [$right[2]] \\ + [$leftValue[2]] &[$comp[2]] [$rightValue[2]] \\ +\end{aligned} + ``] + +Since the statement above is [$tof[2]], [`[$var[2]] = [$x[2]]`] [@$popup[2]->correct_ans()@] a solution. + +###Question 4 + + [`` +\begin{aligned} + [$left[3]] &[$comp[3]] [$right[3]] &\text{when }[$var[3]] = [$x[3]]\\ + \left| [$a[3]]( [$x[3]] - [$b[3]]) \right| &[$comp[3]] [$right[3]] \\ + [$leftValue[3]] &[$comp[3]] [$rightValue[3]] \\ +\end{aligned} + ``] + +Since the statement above is [$tof[3]], [`[$var[3]] = [$x[3]]`] [@$popup[3]->correct_ans()@] a solution. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities2.pg b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities2.pg new file mode 100644 index 0000000000..edc8370001 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities2.pg @@ -0,0 +1,62 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','absolute value','inequality') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Absolute Value') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course + "contextInequalities.pl", +); + + + +################################### +TEXT(beginproblem()); + + +Context("Inequalities"); + +$a = random(1,8,1); +$b = random(2,10,1); +$c = random(3,15,1); +$min = $a-$b*$c; +$max = $a+$b*$c; +$f = Formula("|($a-x)/$b|")->reduce; + +$answer = Union("(-INF,$min]U[$max,INF)"); +################################### +# Main text + +BEGIN_PGML +Solve the inequality. + +[@KeyboardInstructions('Enter the answer in interval notation. If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[`` [$f] \geq [$c] ``]<< + +[__]{$answer}{width=>20} + +END_PGML + + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities3.pg b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities3.pg new file mode 100644 index 0000000000..0a0c4cc59b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities3.pg @@ -0,0 +1,62 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','absolute value','inequality') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Absolute Value') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + + +Context("Interval"); + +$a = random(1,8,1); +$b = random(2,10,1); +$c = random(3,15,1); +$min = ($c-$b)/(-$a); +$max = ($c+$b)/($a); +$f = Formula("|$b -$a x|")->reduce; +$answer = Union("(-INF,$min]U[$max,INF)"); + +################################### +# Main text + +BEGIN_PGML +Solve the inequality. + +[@KeyboardInstructions('Enter the answer in interval notation. If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[`` [$f] \geq [$c] ``]<< + +[__]{$answer}{width=>20} + +END_PGML + + +################################### +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities4.pg b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities4.pg new file mode 100644 index 0000000000..7bb406d93b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities4.pg @@ -0,0 +1,63 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','absolute value','inequality') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Absolute Value') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + + +Context("Interval"); + +$a = random(1,8,1); +$b = random(2,10,1); +$c = random(3,15,1); +$min = ($b-$c)/$a; +$max = ($b+$c)/$a; +$f = Formula("|$a x -$b|")->reduce; +$answer = Interval("($min,$max)"); + +################################### +# Main text + +BEGIN_PGML +Solve the inequality. + +[@KeyboardInstructions('Enter the answer in interval notation. If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[`` [$f] < [$c] ``]<< + +[__]{$answer}{width=>20} + +END_PGML + + +################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities5.pg b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities5.pg new file mode 100644 index 0000000000..f623be669f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities5.pg @@ -0,0 +1,63 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','absolute value','inequality') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Absolute Value') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + + +Context("Interval"); + +$a = random(1,8,1); +$b = random(2,10,1); +$c = random(3,15,1); +$min = -$a-$b*$c; +$max = -$a+$b*$c; +$f = Formula("|(x+$a)/$b|")->reduce; +$answer = Interval("[$min,$max]"); + +################################### +# Main text + +BEGIN_PGML +Solve the inequality. + +[@KeyboardInstructions('Enter the answer in interval notation. If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[`` [$f] \leq [$c] ``]<< + +[__]{$answer}{width=>20} + +END_PGML + + +################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities6.pg b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities6.pg new file mode 100644 index 0000000000..bd3f396511 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities6.pg @@ -0,0 +1,65 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','absolute value','inequality') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Absolute Value') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + + +Context("Interval"); + +$a = random(1,8,1); +$b = random(8,15,1); + +$min = $a-$b; +$max = $a+$b; + +$f=Formula("|x-$a|")->reduce; +$answer = Union("(-INF,$min)U($max,INF)"); + +################################### +# Main text + +BEGIN_PGML +Solve the inequality. + +[@KeyboardInstructions('Enter the answer in interval notation. If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[`` [$f] > [$b] ``]<< + +[__]{$answer}{width=>20} + +END_PGML + + +################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities7.pg b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities7.pg new file mode 100644 index 0000000000..73ff37778c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities7.pg @@ -0,0 +1,62 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','absolute value','inequality') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Absolute Value') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + + +Context("Interval"); + +$a = random(1,8,1); +$b = random(2,10,1); +$c = random(3,15,1); +$min = ($b-$c)/($a); +$max = ($b+$c)/($a); +$f = Formula("|$b -$a x|")->reduce; +$answer = Interval("($min,$max)"); + +################################### +# Main text + +BEGIN_PGML +Solve the inequality. + +[@KeyboardInstructions('Enter the answer in interval notation. If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[`` [$f] < [$c] ``]<< + +[__]{$answer}{width=>20} + +END_PGML + + +################################### +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities8.pg b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities8.pg new file mode 100644 index 0000000000..f39faa0d02 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities8.pg @@ -0,0 +1,85 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','absolute value','inequality') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Absolute Value') +## Date('8/24/07') +## Author('') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "unionTables.pl", # Union College utilities + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "choiceUtils.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + + +$a =random(1,5,1); +$b =random(6,10,1); +$c = $a-$b; +$d = $a+$b; + +########################################### +# +# Make the matching list and then choose five problems +# + +$ml = new_match_list(); +$ml->rf_print_q(~~&alt_print_q); +$ml->{separation} = 10; +$ml->{separation} = 3; + +$ml->qa( +"\(|x-$a| \lt $b \)", "\(x \in ($c,$d) \)", +"\(|x-$a| \leq $b \)","\(x \in [$c,$d] \)", +"\(|x-$a| = $b \)" ,"\( x \in \lbrace $c,$d \rbrace \)", +"\(|x-$a| \geq $b \)" , "\(x \in (-\infty,$c] \cup [$d,\infty ) \)", +"\(|x-$a| \gt $b \)" , "\(x \in (-\infty,$c) \cup ($d,\infty ) \)", +"\(|x-$a| \lt \infty \)" , "\(x \in (-\infty,\infty) \)" +); + +$ml->choose(5); + +################################################## +# Main text + +BEGIN_TEXT +Match the statements in the lefthand column with their equivalent statements in the righthand column. +$PAR +\{ColumnMatchTable($ml,indent => 3)\} +$PAR + +END_TEXT + +################################### +# Answers + +ANS(str_cmp($ml->ra_correct_ans)); + +$showPartialCorrectAnswers = 0; + +################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities9.pg b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities9.pg new file mode 100644 index 0000000000..c208286408 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/AbsValueInequalities/AbsValueInequalities9.pg @@ -0,0 +1,63 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','absolute value') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Absolute Value') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 0; + +$a = random(2,8,1); +$b = random(1,8,1); +do {$b=random(1,8,1);} until ($b != $a); + +$c=random(1,8,1); +$d=random(10,20,1); + +$e1=($d-$c-$b)/$a; +$e2=(-$d+$c-$b)/$a; + +if($e1<$e2){$min=$e1 and $max=$e2} else {$min=$e2 and $max=$e1}; + +Context("Interval"); +$answer = Union("(-infinity,$e2]U[$e1,infinity)"); + +BEGIN_PGML +Solve the inequality. + +[@KeyboardInstructions('Enter the answer in interval notation. If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[`` [$d] - \left\lvert[$a]x + [$b]\right\rvert \leq [$c] ``]<< + +[__]{$answer}{width=>20} + +END_PGML + + +ENDDOCUMENT(); # This should be the last executable line in the problem.; + + diff --git a/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions1.pg b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions1.pg new file mode 100644 index 0000000000..a92d2c14a2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions1.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextRationalFunction.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", + "PGML.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +$index = random(0,4,1); +$var[0] = ('x','a','s','p','m')[$index]; +$var[1] = ('y','b','t','q','n')[$index]; +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real'); + +$a = random(3,6,1); +$b = $a - 1; +$num = Formula("$var[0]/$var[1]"); +$den = Formula("($a*$var[0])/($b*$var[1]^2)"); + +Context("RationalFunction"); +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); + + +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real'); +$ans = Formula("($b $var[1])/$a"); + +$evaluator = $ans -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form. + Maybe it needs to be simplified, factored, expanded, have its denominator rationalized, etc.") unless $OK; + return $OK; +}); + +############################################## + +BEGIN_PGML + + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + +[``\frac{[$num]}{[$den]}=``][__]{$evaluator}{width=>40} + +END_PGML + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions10.pg b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions10.pg new file mode 100644 index 0000000000..8e6da32a5b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions10.pg @@ -0,0 +1,59 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("RestrictedDomains"); +$index = random(0,4,1); +$var[0] = ('x','a','s','p','m')[$index]; +$var[1] = ('y','b','t','q','n')[$index]; +$var[2] = ('z','c','u','r','k')[$index]; +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); + +$a = list_random(2,3,5,6,7,10); +$b = random(2,10,1); +$c = random(2,10,1); +while ($b*($c+1) == 2*($b+$a)) {$c = random(2,10,1);} + +Context()->flags->set(reduceConstants=>0); +$num = Formula("$var[2]/($var[2]^2-$a**2)-1/($var[2]^2-$a**2)")->reduce; +$den = Formula("1/($var[2]+$a**2)")->reduce; + + +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); +$ans = Formula("($var[2]-1)*($var[2]+$a**2)/(($var[2]+$a)($var[2]-$a)), $var[2] != -$a**2")->reduce; +$ans->{trueDomain} = Compute("$var[2] != -$a**2 and $var[2] != -$a and $var[2] != $a"); + + +############################################## + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var[2]^2 for $var[2]!=1 and $var[2]!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + +[``\frac{[$num]}{[$den]}=``] [__]{$ans}{width=>40} + +END_PGML + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions2.pg b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions2.pg new file mode 100644 index 0000000000..3ee5611466 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions2.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextRationalFunction.pl", + "bizarroArithmetic.pl", + "PCCmacros.pl", + "PGML.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +$index = random(0,4,1); +$var[0] = ('x','a','s','p','m')[$index]; +$var[1] = ('y','b','t','q','n')[$index]; +$var[2] = ('z','c','u','r','k')[$index]; +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); + +$a = random(3,10,1); +$b = random(2,10,1); +$num = Formula("$var[0]*$var[1]^2/($a $var[2])"); +$den = Formula("($var[0])/($b*$var[1]*$var[2])"); + +$as = $a/gcd($a,$b); +$bs = $b/gcd($a,$b); + +Context("RationalFunction"); +Context()->operators->set( +'*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); + + +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); +$ans = Formula("($bs*$var[1]^3)/$as")->reduce; + +$evaluator = $ans -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); + Value::Error("Your answer is equivalent to the correct answer, but not in the expected form. + Maybe it needs to be simplified, factored, expanded, have its denominator rationalized, etc.") unless $OK; + return $OK; +}); + +############################################## + +BEGIN_PGML + + +Simplify this expression. [@KeyboardInstructions('Just enter the simplified expression. Do not try to enter its restricted domain.')@]** + +[``\frac{[$num]}{[$den]}=``][__]{$evaluator}{width=>40} + +END_PGML + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions3.pg b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions3.pg new file mode 100644 index 0000000000..63f68f3493 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions3.pg @@ -0,0 +1,62 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextRestrictedDomains.pl", + "PGML.pl", + "PCCmacros.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("RestrictedDomains"); +$index = random(0,4,1); +$var[0] = ('x','a','s','p','m')[$index]; +$var[1] = ('y','b','t','q','n')[$index]; +$var[2] = ('z','c','u','r','k')[$index]; +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); + +$a = random(3,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); +while ($a*$c+$b==0) {$c = non_zero_random(-10,10,1);} + +$num = Formula("($a $var[0]+$b)/$var[0]")->reduce; +$den = Formula("($var[0]-$c)/($var[0])")->reduce; + +$g = gcd($a, $b); +$A = $a/$g; +$B = $b/$g; +$ans = Formula("$g($A*$var[0]+$B)/($var[0]-$c), $var[0] != 0")->reduce->reduce; +$ans->{trueDomain} = Compute("$var[0] != 0 and $var[0] != $c"); + +############################################## + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var[0]^2 for $var[0]!=1 and $var[0]!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + +[``\frac{[$num]}{[$den]}``] = [__]{$ans}{width=>40} + +END_PGML + +############################################## + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions4.pg b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions4.pg new file mode 100644 index 0000000000..ab8c8b3637 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions4.pg @@ -0,0 +1,59 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextRestrictedDomains.pl", + "PGML.pl", + "PCCmacros.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("RestrictedDomains"); +$index = random(0,4,1); +$var[0] = ('x','a','s','p','m')[$index]; +$var[1] = ('y','b','t','q','n')[$index]; +$var[2] = ('z','c','u','r','k')[$index]; +Context()->variables->are($var[2]=>'Real'); + +$a = random(1,10,1); +$b = non_zero_random(2,10,1); + + +$num = Formula("($var[2])/($var[2]-$a)^2")->reduce; +$den = Formula("($b $var[2])/($var[2]^2-$a**2)")->reduce; + + +$ans = Formula("($var[2]+$a)/($b*($var[2]-$a)), $var[2] != 0 and $var[2] != -$a")->reduce; +$ans->{trueDomain} = Compute("$var[2] != 0 and $var[2] != -$a and $var[2] != $a"); + +############################################## + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var[2]^2 for $var[2]!=1 and $var[2]!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + +[``\frac{[$num]}{[$den]}=``] [__]{$ans}{width=>40} + +END_PGML + +############################################## +$showPartialCorrectAnswers = 1; + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions5.pg b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions5.pg new file mode 100644 index 0000000000..db502a7d50 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions5.pg @@ -0,0 +1,57 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("RestrictedDomains"); +$index = random(0,4,1); +$var[0] = ('x','a','s','p','m')[$index]; +$var[1] = ('y','b','t','q','n')[$index]; +$var[2] = ('z','c','u','r','k')[$index]; +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); + +$a = random(2,10,1); +$b = non_zero_random(2,10,1); + + +$num = Formula("$a+1/$var[0]")->reduce; +$den = Formula("$var[0]+$b")->reduce; + + +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); +$ans = Formula("($a $var[0]+1)/($var[0]*($var[0]+$b)), (-inf, inf)")->reduce; +$ans->{trueDomain} = Compute("$var[0] != 0 and $var[0] != -$b"); + +############################################## + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var[0]^2 for $var[0]!=1 and $var[0]!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + +[``\frac{[$num]}{[$den]}=``] [__]{$ans}{width=>40} + +END_PGML + +############################################## +$showPartialCorrectAnswers = 1; + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions6.pg b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions6.pg new file mode 100644 index 0000000000..073f907da5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions6.pg @@ -0,0 +1,57 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("RestrictedDomains"); +$index = random(0,4,1); +$var[0] = ('x','a','s','p','m')[$index]; +$var[1] = ('y','b','t','q','n')[$index]; +$var[2] = ('z','c','u','r','k')[$index]; +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); + +$a = random(2,10,1); +$b = random(1,10,1); +$c = random(1,10,1); + +Context()->flags->set(reduceConstants=>0); +$num = Formula("$a+1/($var[1]-$b)"); +$den = ($c == 1) ? Formula("1/($var[1]-$b)-1") : Formula("1/($var[1]-$b)-1/$c"); + + +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); +$ans = Formula("$c ($a $var[1]+(1-$a*$b))/(-$var[1]+($b+$c)), $var[1] != $b")->reduce->reduce; +$ans->{trueDomain} = Compute("$var[1] != $b and $var[1] != $b+$c"); + +############################################## + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var[1]^2 for $var[1]!=1 and $var[1]!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + +[``\frac{[$num]}{[$den]}=``] [__]{$ans}{width=>40} + +END_PGML + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions7.pg b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions7.pg new file mode 100644 index 0000000000..4e85592e78 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions7.pg @@ -0,0 +1,60 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("RestrictedDomains"); +$index = random(0,4,1); +$var[0] = ('x','a','s','p','m')[$index]; +$var[1] = ('y','b','t','q','n')[$index]; +$var[2] = ('z','c','u','r','k')[$index]; +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); + +$a = random(1,10,1); +$b = random(1,10,1); +$c = random(1,10,1); + +Context()->flags->set(reduceConstants=>0); +$num = Formula("1/($var[2]+$a)+$b/($var[2]-$a)"); +$den = Formula("$c-1/($var[2]-$a)"); + +$g = gcd($b+1,($b-1)*$a); +$A = ($b+1)/$g; +$B = ($b-1)*$a/$g; + +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); +$ans = Formula("$g($A*$var[2]+$B)/(($c $var[2] - ($c*$a+1))($var[2] + $a)), $var[2] != $a")->reduce->reduce; +$ans->{trueDomain} = Compute("$var[2] != $a and $var[2] != -$a and $var[2] != $a+1/$c"); + +############################################## + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var[2]^2 for $var[2]!=1 and $var[2]!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + +[``\frac{[$num]}{[$den]}=``] [__]{$ans}{width=>40} + +END_PGML + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions8.pg b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions8.pg new file mode 100644 index 0000000000..b79f712a2f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions8.pg @@ -0,0 +1,58 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", +); + +############################################## +TEXT(beginproblem()); + +Context("RestrictedDomains"); +$index = random(0,4,1); +$var[0] = ('x','a','s','p','m')[$index]; +$var[1] = ('y','b','t','q','n')[$index]; +$var[2] = ('z','c','u','r','k')[$index]; +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); + +$a = random(1,10,1); +$b = random(2,10,1); +$c = random(2,10,1); + +Context()->flags->set(reduceConstants=>0); +$num = Formula("1/($var[0]-$a)+$b/($var[0]-$a)"); +$den = Formula("$c-1/($var[0]+$a)"); + + +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); +$ans = Formula("(($b+1)*($var[0]+$a))/(($c $var[0]+($c*$a-1))*($var[0]-$a)), $var[0] != -$a")->reduce; +$ans->{trueDomain} = Compute("$var[0] != $a and $var[0] != -$a and $var[0] != (1-$c*$a)/$c"); + + +############################################## + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var[0]^2 for $var[0]!=1 and $var[0]!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + +[``\frac{[$num]}{[$den]}=``] [__]{$ans}{width=>40} + +END_PGML + +############################################## + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions9.pg b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions9.pg new file mode 100644 index 0000000000..0f0e913eca --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexFractions/ComplexFractions9.pg @@ -0,0 +1,66 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("RestrictedDomains"); +$index = random(0,4,1); +$var[0] = ('x','a','s','p','m')[$index]; +$var[1] = ('y','b','t','q','n')[$index]; +$var[2] = ('z','c','u','r','k')[$index]; +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); + +$a = random(1,10,1); +$b = random(2,10,1); +$c = random(2,10,1); +while ($b*($c+1) == 2*($b+$a)) {$c = random(2,10,1);} + +Context()->flags->set(reduceConstants=>0); +$num = Formula("$a/($var[1]-1)-$b"); +$den = Formula("1/($var[1]-1)+1/($var[1]-$c)"); + + +Context()->variables->are($var[0]=>'Real',$var[1]=>'Real',$var[2]=>'Real'); +$g = gcd(2,$c+1); +$p = 2/$g; +$q = ($c+1)/$g; +$G = gcd(-$b,$b+$a); +$A = -$b/$G; +$B = ($b+$a)/$G; +$gr = $g/gcd($g,$G); +$GR = $G/gcd($g,$G); +$ans = Formula("$GR ($A $var[1]+$B)*($var[1]-$c)/($gr($p $var[1] - $q)), $var[1] != 1 and $var[1] != $c")->reduce; +$ans->{trueDomain} = Compute("$var[1] != 1 and $var[1] != $c and $var[1] != ($c+1)/2"); + +############################################## + + +BEGIN_PGML + +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|$var[1]^2 for $var[1]!=1 and $var[1]!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + +[``\frac{[$num]}{[$den]}=``] [__]{$ans}{width=>40} + +END_PGML + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers1.pg b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers1.pg new file mode 100644 index 0000000000..f1aebc1063 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers1.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedComplex.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Complex"); + +$a = random(-10,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); +$d = random(-10,10,1); + +$u = Compute("$a+$b i"); +$v = Compute("$c+$d i"); + +$w = $u+$v; + +Context("LimitedComplex"); +$w = Compute("$w"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Write the complex number in standard form. + +\[($u)+($v) \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $w->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers2.pg b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers2.pg new file mode 100644 index 0000000000..f1aebc1063 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers2.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedComplex.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Complex"); + +$a = random(-10,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); +$d = random(-10,10,1); + +$u = Compute("$a+$b i"); +$v = Compute("$c+$d i"); + +$w = $u+$v; + +Context("LimitedComplex"); +$w = Compute("$w"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Write the complex number in standard form. + +\[($u)+($v) \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $w->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers3.pg b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers3.pg new file mode 100644 index 0000000000..1052fd9c44 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers3.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedComplex.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Complex"); + +$a = random(-10,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); +$d = random(-10,10,1); + +$u = Compute("$a+$b i"); +$v = Compute("$c+$d i"); + +$w = $u-$v; + +Context("LimitedComplex"); +$w = Compute("$w"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Write the complex number in standard form. + +\[($u)-($v) \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $w->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers4.pg b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers4.pg new file mode 100644 index 0000000000..1052fd9c44 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers4.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedComplex.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Complex"); + +$a = random(-10,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); +$d = random(-10,10,1); + +$u = Compute("$a+$b i"); +$v = Compute("$c+$d i"); + +$w = $u-$v; + +Context("LimitedComplex"); +$w = Compute("$w"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Write the complex number in standard form. + +\[($u)-($v) \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $w->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers5.pg b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers5.pg new file mode 100644 index 0000000000..02c0c0df27 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers5.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedComplex.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Complex"); + +$a = random(-10,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); +$d = random(-10,10,1); + +$u = Compute("$a+$b i"); +$v = Compute("$c+$d i"); + +$w = $u*$v; + +Context("LimitedComplex"); +$w = Compute("$w"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Write the complex number in standard form. + +\[($u)($v) \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $w->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers6.pg b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers6.pg new file mode 100644 index 0000000000..02c0c0df27 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers6.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedComplex.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Complex"); + +$a = random(-10,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); +$d = random(-10,10,1); + +$u = Compute("$a+$b i"); +$v = Compute("$c+$d i"); + +$w = $u*$v; + +Context("LimitedComplex"); +$w = Compute("$w"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Write the complex number in standard form. + +\[($u)($v) \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $w->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers7.pg b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers7.pg new file mode 100644 index 0000000000..e0e5577f8f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers7.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedComplex.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Complex"); + +$a = random(-10,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); +$d = non_zero_random(-10,10,1); + +$u = Compute("$a+$b i"); +$v = Compute("$c+$d i"); + +$w = $u/$v; + +Context("LimitedComplex"); +$w = Compute("$w"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Write the complex number in standard form. + +\[\frac{$u}{$v} \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $w->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers8.pg b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers8.pg new file mode 100644 index 0000000000..e0e5577f8f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexNumbers/ComplexNumbers8.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedComplex.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Complex"); + +$a = random(-10,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); +$d = non_zero_random(-10,10,1); + +$u = Compute("$a+$b i"); +$v = Compute("$c+$d i"); + +$w = $u/$v; + +Context("LimitedComplex"); +$w = Compute("$w"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Write the complex number in standard form. + +\[\frac{$u}{$v} \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $w->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots1.pg b/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots1.pg new file mode 100644 index 0000000000..373f8a22c9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots1.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserRadioButtons.pl", + "parserPopUp.pl", + + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-20,20,1); +$c = non_zero_random(-10,10,1); + +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$left = Compute("$a $var**2 + $b $var + $c")->reduce; +$right = Compute("0"); + +Context()->flags->set(reduceConstantFunctions=>0); + +$real = "two real solutions"; +$comp = "two non-real solutions"; +$dbld = "one doubled real solution"; + + +if ($b**2-4*$a*$c <0) +{$ans = $comp;$pon = "negative";} +elsif ($b**2-4*$a*$c == 0) +{$ans = $dbld;$pon = 0;} +else +{$ans = $real;$pon = "positive";}; + +$radio = RadioButtons( + ["$real","$comp","$dbld","none of these"], + "$ans", # correct answer + last => ["none of these"], # can be a list +); + +$popup = PopUp(["$real","$comp","$dbld","none of these"],$ans); + + +############################################## + +BEGIN_PGML + +Determine the nature of the solutions to this quadratic equation. + +[``[$left] = [$right]``] + +[__]{$popup} + + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION +We don't actually need to _solve_ this equation in order to determine how many real solutions it has. Remember the quadratic formula + + [` + x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} + `] + +The quantity [`b^2-4ac`] is known as the *discriminant*; the sign of the discriminant completely determines the number of real solutions: +* if [`b^2-4ac<0`] then the equation has *no* real solutions +* if [`b^2-4ac=0`] then the equation has *one* real solution +* if [`b^2-4ac>0`] then the equation has *two* real solutions + +In the equation [`[$left] = [$right]`], we can see [`a=[$a], b=[$b]`] and [`c=[$c]`]. Let's calculate the discriminant: + + [` + \begin{aligned} + b^2-4ac &= ([$b])^2-4([$a])([$c]) \\ + & = [$b**2]-[$a*4*$c]\\ + & = [$b**2-$a*4*$c]\\ + \end{aligned} + `] + +Since the discriminant is [$pon], we conclude that this equation has [@$popup->correct_ans@]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots2.pg b/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots2.pg new file mode 100644 index 0000000000..94346aeeaf --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots2.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserRadioButtons.pl", + "parserPopUp.pl", + + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-20,20,1); +$c = non_zero_random(-10,10,1); + +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$left = Compute("$a $var**2 + $b $var + $c")->reduce; +$right = Compute("0"); + +Context()->flags->set(reduceConstantFunctions=>0); + +$real = "two real solutions"; +$comp = "two non-real solutions"; +$dbld = "one doubled real solution"; + + +if ($b**2-4*$a*$c <0) +{$ans = $comp;$pon = "negative";} +elsif ($b**2-4*$a*$c == 0) +{$ans = $dbld;$pon = 0;} +else +{$ans = $real;$pon = "positive";}; + +$radio = RadioButtons( + ["$real","$comp","$dbld","none of these"], + "$ans", # correct answer + last => ["none of these"], # can be a list +); + + + + +$popup = PopUp(["$real","$comp","$dbld","none of these"],$ans); + + +############################################## + +BEGIN_PGML + +Determine the nature of the solutions to this quadratic equation. + +[``[$left] = [$right]``] + +[__]{$popup} + + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION +We don't actually need to _solve_ this equation in order to determine how many real solutions it has. Remember the quadratic formula + + [` + x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} + `] + +The quantity [`b^2-4ac`] is known as the *discriminant*; the sign of the discriminant completely determines the number of real solutions: +* if [`b^2-4ac<0`] then the equation has *no* real solutions +* if [`b^2-4ac=0`] then the equation has *one* real solution +* if [`b^2-4ac>0`] then the equation has *two* real solutions + +In the equation [`[$left] = [$right]`], we can see [`a=[$a], b=[$b]`] and [`c=[$c]`]. Let's calculate the discriminant: + + [` + \begin{aligned} + b^2-4ac &= ([$b])^2-4([$a])([$c]) \\ + & = [$b**2]-[$a*4*$c]\\ + & = [$b**2-$a*4*$c]\\ + \end{aligned} + `] + +Since the discriminant is [$pon], we conclude that this equation has [@$popup->correct_ans@]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots3.pg b/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots3.pg new file mode 100644 index 0000000000..4c276a326a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots3.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserRadioButtons.pl", + "parserPopUp.pl", + + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-5,5,1); +$c = non_zero_random(-10,10,1); + +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$left = Compute("$a $var**2 + $b $var + $c")->reduce; +$right = Compute("0"); + +Context()->flags->set(reduceConstantFunctions=>0); + +$real = "two real solutions"; +$comp = "two non-real solutions"; +$dbld = "one doubled real solution"; + + +if ($b**2-4*$a*$c <0) +{$ans = $comp;$pon = "negative";} +elsif ($b**2-4*$a*$c == 0) +{$ans = $dbld;$pon = 0;} +else +{$ans = $real;$pon = "positive";}; + +$radio = RadioButtons( + ["$real","$comp","$dbld","none of these"], + "$ans", # correct answer + last => ["none of these"], # can be a list +); + +$popup = PopUp(["$real","$comp","$dbld","none of these"],$ans); + + +############################################## + +BEGIN_PGML + +Determine the nature of the solutions to this quadratic equation. + +[``[$left] = [$right]``] + +[__]{$popup} + + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION +We don't actually need to _solve_ this equation in order to determine how many real solutions it has. Remember the quadratic formula + + [` + x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} + `] + +The quantity [`b^2-4ac`] is known as the *discriminant*; the sign of the discriminant completely determines the number of real solutions: +* if [`b^2-4ac<0`] then the equation has *no* real solutions +* if [`b^2-4ac=0`] then the equation has *one* real solution +* if [`b^2-4ac>0`] then the equation has *two* real solutions + +In the equation [`[$left] = [$right]`], we can see [`a=[$a], b=[$b]`] and [`c=[$c]`]. Let's calculate the discriminant: + + [` + \begin{aligned} + b^2-4ac &= ([$b])^2-4([$a])([$c]) \\ + & = [$b**2]-[$a*4*$c]\\ + & = [$b**2-$a*4*$c]\\ + \end{aligned} + `] + +Since the discriminant is [$pon], we conclude that this equation has [@$popup->correct_ans@]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots4.pg b/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots4.pg new file mode 100644 index 0000000000..4c276a326a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ComplexRoots/ComplexRoots4.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserRadioButtons.pl", + "parserPopUp.pl", + + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-5,5,1); +$c = non_zero_random(-10,10,1); + +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$left = Compute("$a $var**2 + $b $var + $c")->reduce; +$right = Compute("0"); + +Context()->flags->set(reduceConstantFunctions=>0); + +$real = "two real solutions"; +$comp = "two non-real solutions"; +$dbld = "one doubled real solution"; + + +if ($b**2-4*$a*$c <0) +{$ans = $comp;$pon = "negative";} +elsif ($b**2-4*$a*$c == 0) +{$ans = $dbld;$pon = 0;} +else +{$ans = $real;$pon = "positive";}; + +$radio = RadioButtons( + ["$real","$comp","$dbld","none of these"], + "$ans", # correct answer + last => ["none of these"], # can be a list +); + +$popup = PopUp(["$real","$comp","$dbld","none of these"],$ans); + + +############################################## + +BEGIN_PGML + +Determine the nature of the solutions to this quadratic equation. + +[``[$left] = [$right]``] + +[__]{$popup} + + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION +We don't actually need to _solve_ this equation in order to determine how many real solutions it has. Remember the quadratic formula + + [` + x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} + `] + +The quantity [`b^2-4ac`] is known as the *discriminant*; the sign of the discriminant completely determines the number of real solutions: +* if [`b^2-4ac<0`] then the equation has *no* real solutions +* if [`b^2-4ac=0`] then the equation has *one* real solution +* if [`b^2-4ac>0`] then the equation has *two* real solutions + +In the equation [`[$left] = [$right]`], we can see [`a=[$a], b=[$b]`] and [`c=[$c]`]. Let's calculate the discriminant: + + [` + \begin{aligned} + b^2-4ac &= ([$b])^2-4([$a])([$c]) \\ + & = [$b**2]-[$a*4*$c]\\ + & = [$b**2-$a*4*$c]\\ + \end{aligned} + `] + +Since the discriminant is [$pon], we conclude that this equation has [@$popup->correct_ans@]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities1.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities1.pg new file mode 100644 index 0000000000..4361069c70 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities1.pg @@ -0,0 +1,142 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "contextFraction.pl", + "PGML.pl", +); + + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0,'(-x)+y'=>0); + +$yes = "is"; +$no = "is not"; + + +$a[0] = random(1,9,1); +$b[0] = random(1,9,1); +$var[0] = "x"; +$x[0] = random(0,9,1); +$left1[0] = Formula("x")->reduce; +$right1[0] = Formula("$a[0]")->reduce; +$left2[0] = Formula("x")->reduce; +$right2[0] = Formula("$b[0]")->reduce; +$comp1[0] = "$GTS"; +$comp2[0] = "$LTE"; +$comb[0] = "and"; +if (($left1[0]->eval(x=>$x[0]) > $right1[0]->eval(x=>$x[0])) +&& ($left2[0]->eval(x=>$x[0]) <= $right2[0]->eval(x=>$x[0]))) +{$ans[0] = $yes;} +else {$ans[0] = $no;}; + +$a[1] = random(1,9,1); +$b[1] = random(1,9,1); +$var[1] = "x"; +$x[1] = random(0,9,1); +$left1[1] = Formula("x")->reduce; +$right1[1] = Formula("$a[1]")->reduce; +$left2[1] = Formula("x")->reduce; +$right2[1] = Formula("$b[1]")->reduce; +$comp1[1] = "$LTS"; +$comp2[1] = "$GTE"; +$comb[1] = "or"; +if (($left1[1]->eval(x=>$x[1]) < $right1[1]->eval(x=>$x[1])) +|| ($left2[1]->eval(x=>$x[1]) >= $right2[1]->eval(x=>$x[1]))) +{$ans[1] = $yes;} +else {$ans[1] = $no;}; + + + +$a[2] = random(-9,-1,1); +$b[2] = random(1,9,1); +$var[2] = "x"; +$x[2] = random(-9,9,1); +$left1[2] = Formula("x")->reduce; +$right1[2] = Formula("$a[2]")->reduce; +$left2[2] = Formula("x")->reduce; +$right2[2] = Formula("$b[2]")->reduce; +$comp1[2] = "$GTE"; +$comp2[2] = "$LTE"; +$comb[2] = "and"; +if (($left1[2]->eval(x=>$x[2]) >= $right1[2]->eval(x=>$x[2])) +&& ($left2[2]->eval(x=>$x[2]) <= $right2[2]->eval(x=>$x[2]))) +{$ans[2] = $yes;} +else {$ans[2] = $no;}; + + +$a[3] = random(-4,-1,1); +$b[3] = random(1,4,1); +$var[3] = "x"; +$x[3] = random(-9,9,1); +$left1[3] = Formula("$a[3]")->reduce; +$right1[3] = Formula("x")->reduce; +$left2[3] = Formula("x")->reduce; +$right2[3] = Formula("$b[3]")->reduce; +$comp1[3] = "$LTE"; +$comp2[3] = "$LTE"; +$comb[3] = "and"; +if (($left1[3]->eval(x=>$x[3]) <= $right1[3]->eval(x=>$x[3])) +and ($left2[3]->eval(x=>$x[3]) <= $right2[3]->eval(x=>$x[3]))) +{$ans[3] = $yes;} +else {$ans[3] = $no;}; + +Context()->texStrings; + +for my $i (0..2) { +$statement[$i] = general_math_ev3("$left1[$i] $comp1[$i] $right1[$i]".'\quad\text{'."$comb[$i]".'}\quad '."$left2[$i] $comp2[$i] $right2[$i] \qquad $var[$i] = $x[$i]"); +$popup[$i] = PopUp(['?',$yes,$no],"$ans[$i]"); +} + +$statement[3] = general_math_ev3("$left1[3] $comp1[3] $right1[3] $comp2[3] $right2[3] \qquad $var[3] = $x[3]"); +$popup[3] = PopUp(['?',$yes,$no],"$ans[3]"); + + +############################################## + + +BEGIN_PGML + +Decide whether the given value for the variable is a solution. + +a. [$statement[0]]* +The given value [__]{$popup[0]} a solution. + +a. [$statement[1]]* +The given value [__]{$popup[1]} a solution. + +a. [$statement[2]]* +The given value [__]{$popup[2]} a solution. + +a. [$statement[3]]* +The given value [__]{$popup[3]} a solution. + + + + +END_PGML + + + +############################################## + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities10.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities10.pg new file mode 100644 index 0000000000..542071e6f3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities10.pg @@ -0,0 +1,56 @@ +## DESCRIPTION +## Algebra - Inequalities +## ENDDESCRIPTION + +## KEYWORDS('Algebra','Inequalities') +## Tagged by dgt5v + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + +TEXT(beginproblem()); + + +################################### +# Setup + +$a = random(-10,-1,1); +$b = random(1,10,1); +Context("Interval"); +$answer=Union("[$b,inf)"); + +################################### +# Main text + +BEGIN_PGML +Express the following inequality using interval notation. + +[@KeyboardInstructions('If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[``[$a] < x \text{ and } x\geq [$b]``]<< + +[__]{$answer}{width=>20} +END_PGML + +ENDDOCUMENT(); # This should be the last executable line in the problem.; + + diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities11.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities11.pg new file mode 100644 index 0000000000..238005a28f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities11.pg @@ -0,0 +1,57 @@ +## DESCRIPTION +## Algebra - Inequalities +## ENDDESCRIPTION + +## KEYWORDS('Algebra','Inequalities') +## Tagged by dgt5v + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + +TEXT(beginproblem()); + + +################################### +# Setup + +$a = random(-10,-1,1); +$b = random(1,10,1); +Context("Interval"); +$answer=Union("[$a,$b)"); + +################################### +# Main text + +BEGIN_PGML +Express the following inequality using interval notation. + +[@KeyboardInstructions('If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[``[$a] \leq x\text{ and } x < [$b]``]<< + +[__]{$answer}{width=>20} +END_PGML + + +ENDDOCUMENT(); # This should be the last executable line in the problem.; + + diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities12.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities12.pg new file mode 100644 index 0000000000..54d7c30af2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities12.pg @@ -0,0 +1,92 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','inequalities') + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('2/21/18') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextInequalities.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + +%nice = ('<' => '<', + '<=' => '\leq', + '>' => '>', + '>=' => '\geq', +); + + +%opposite = ('<' => '>', + '<=' => '>=', + '>' => '<', + '>=' => '<=', +); + +$conj = list_random('and', 'or'); + +do { + Context("Numeric"); + Context()->noreduce('(-x)-y', '(-x)+y'); + + for my $i (0,1) { + $a[$i] = non_zero_random(-20,20,1); + $b[$i] = non_zero_random(-20,20,1); + $c[$i] = non_zero_random(-20,20,1); + $sign[$i] = list_random('<', '<=', '>', '>='); + $left[$i] = Formula("$a[$i] x + $b[$i]")->reduce; + $ineq[$i] = $left[$i]->TeX . $nice{$sign[$i]} . $c[$i]; + }; + + Context("Inequalities"); + for my $i (0,1) { + $modsign[$i] = ($a[$i] > 0) ? $sign[$i] : $opposite{$sign[$i]}; + $sol[$i] = Interval(Compute("x $modsign[$i] ($c[$i] - $b[$i])/$a[$i]")); + } + +} until (($conj eq 'and' and $sol[0]->intersects($sol[1])) or ($conj eq 'or' and not($sol[0]->intersects($sol[1])))); + +$answer = ($conj eq 'and') ? $sol[0]->intersect($sol[1])->reduce : Union($sol[0],$sol[1])->reduce; + + + +################################### +# Main text + +BEGIN_PGML +Solve the compound inequality algebraically. + +[@KeyboardInstructions('Write the solution set in interval notation. If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[``[$ineq[0]] \quad \text{[$conj]} \quad [$ineq[1]]``]<< + +[__]{$answer}{width=>25} + +END_PGML + + +################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities2.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities2.pg new file mode 100644 index 0000000000..f768e24f9b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities2.pg @@ -0,0 +1,58 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','inequalities') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + +$a = random(-10,-1,1); +$b = random(1,10,1); +Context("Interval"); +$answer=Union("($a,$b]"); + +################################### +# Main text + +BEGIN_PGML +Solve the compound inequality. Write the solution set in interval notation. + +[@KeyboardInstructions('If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[``[$a] < x \leq [$b]``]<< + +[__]{$answer}{width=>20} +END_PGML + +################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities3.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities3.pg new file mode 100644 index 0000000000..4caf7810a9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities3.pg @@ -0,0 +1,65 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','inequalities') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + +$a = random(1,20,1); +$b = random(1,20,1); +$c=-$a+5; +Context("Interval"); +$left = $a+$b-5; +$right =$a+$b; + +$answer=Union("[$left,$right)"); + + +################################### +# Main text + +BEGIN_PGML +Solve the compound inequality algebraically. + +[@KeyboardInstructions('Write the solution set in interval notation. If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[``-[$a] < [$b] - x \leq [$c]``]<< + +[__]{$answer}{width=>20} +END_PGML + +################################### +# Answers + +$showPartialCorrectAnswers = 0; + +################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities4.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities4.pg new file mode 100644 index 0000000000..e6663866bb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities4.pg @@ -0,0 +1,60 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','inequalities') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + +$a = random(1,20,1); +$b = random(1,20,1); +$c=$a+5; +$left = $a-$b; +$right = $a-$b+5; + +Context("Interval"); +$answer = Union("[ $left, $right ) "); + +################################### +# Main text + +BEGIN_PGML +Solve the compound inequality algebraically. + +[@KeyboardInstructions('Write the solution set in interval notation. If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[``[$a] \leq x+[$b] < [$c]``]<< + +[__]{$answer}{width=>20} +END_PGML + + +################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities5.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities5.pg new file mode 100644 index 0000000000..f2cb6237e3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities5.pg @@ -0,0 +1,56 @@ +## DESCRIPTION +## Algebra, Interval Notation +## ENDDESCRIPTION + +## KEYWORDS('algebra', 'inequality', 'interval') +## Tagged by XW + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + +$a = random(-10,-1,1); +$b = random(1,10,1); +Context("Interval"); +$answer=Union("(-inf,$a)U[$b,inf)"); + +################################### +# Main text + +BEGIN_PGML +Solve the compound inequality. Write the solution set in interval notation. + +[@KeyboardInstructions('If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[``[$a] > x\text{ or } x \geq [$b]``]<< + +[__]{$answer}{width=>20} +END_PGML + + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities6.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities6.pg new file mode 100644 index 0000000000..4c374767a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities6.pg @@ -0,0 +1,55 @@ +## DESCRIPTION +## Algebra, Inequalities +## ENDDESCRIPTION + +## KEYWORDS('algebra', 'linear inequality') +## Tagged by jjh2b + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + +$a = random(-10,-1,1); +$b = random(1,10,1); +Context("Interval"); +$answer=Union("(-inf,$b]"); + +################################### +# Main text + +BEGIN_PGML +Express the following inequality using interval notation. + +[@KeyboardInstructions('If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[``x < [$a] \text{ or } x \leq [$b]``]<< + +[__]{$answer}{width=>20} +END_PGML + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities7.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities7.pg new file mode 100644 index 0000000000..5d99b2e2d1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities7.pg @@ -0,0 +1,55 @@ +## DESCRIPTION +## Algebra, Inequalities +## ENDDESCRIPTION + +## KEYWORDS('algebra', 'linear inequality') +## Tagged by jjh2b + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; + +$a = random(1,30,1); +$b = random(31,50,1); +$ans1 = 9*$a/5+32; +$ans2 = 9*$b/5+32; +Context("Interval"); +$answer = Union("[$ans1,$ans2]"); + + +BEGIN_PGML + +Solve the compound inequality algebraically. + +[@KeyboardInstructions('Write the solution set in interval notation. If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[`` [$a] \le \frac{5}{9}(F-32) \le [$b] ``]<< + +[`F`] is in [__]{$answer}{width=>20} + +END_PGML + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities8.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities8.pg new file mode 100644 index 0000000000..87f1680975 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities8.pg @@ -0,0 +1,81 @@ +## DESCRIPTION +## Algebra and Number Theory +## ENDDESCRIPTION + +## KEYWORDS('algebra', 'inequality') +## Tagged by XW + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + + +$a = random(15,25,1); +$b = random(5,10,1); +$ans1 = Formula("$a-10*x")->reduce; +$low = $a-$b*10; +Context("Interval"); +$ans2 = Union("[$low, $a]"); + +BEGIN_PGML +As dry air moves upward, it expands. In so doing, it cools at a rate of about [`1^{\circ}\text{C}`] for every [`100\,\text{m}`] rise, up to about [`12\,\text{km}`]. + +a. If the ground temperature is [`[$a]^{\circ}\text{C}`], write a formula for the temperature at height [`x\,\text{km}`]. + [`T(x)= `] [__]{$ans1}{width=>20} + +a. What range of temperature will a plane be exposed to if it takes off and reaches a maximum height of [`[$b]\,\text{km}`]? Write answer in interval notation. + [@KeyboardInstructions('If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + The range is [__]{$ans2}{width=>20}. + +END_PGML + +######################################### + +BEGIN_PGML_SOLUTION + +###Question 1 + +It's given that dry air cools at a rate of about [`1^{\circ}\text{C}`] for every [`100\,\text{m}`] rise. The problem uses the unit [`\text{km}`] everywhere else, so we need to do: + + [`` 100\,\text{m}=0.1\,\text{km}, ``] + +since [`1\,\text{km}=1,000\,\text{m}`]. + +Since dry air cools at a rate of about [`1^{\circ}\text{C}`] for every [`0.1\,\text{km}`] rise, the rate is [`10^{\circ}\text{C}`] for every [`1\,\text{km}`] rise. + +The rate of change is constant, implying a linear function [`T(x)=mx+b`]. Since temperature decreases, [`m=-10 \frac{^{\circ}\text{C}}{\text{km}}`]. The starting temperature (ground temperature) is given as [`[$a]^{\circ}\text{C}`], we have [`b=[$a]`]. As a result, the function to model the temperature at height [`x\,\text{km}`] is + + [``T(x)=[$ans1].``] + +###Question 2 + +The ground temperature is given as [`[$a]^{\circ}\text{C}`], which is the maximum temperature the plane will encounter. As the plane rises to [`[$b]\,\text{km}`], the temperature decreases to + + [``T([$b]) = [$a]-10([$b]) = [$low]^{\circ}\text{C}``] + +The range of temperature a plane is exposed to if it takes off and reaches a maximum height of [`[$b]\,\text{km}`] is [`[$ans2]`] in [`^{\circ}\text{C}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities9.pg b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities9.pg new file mode 100644 index 0000000000..d6535db844 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities9.pg @@ -0,0 +1,62 @@ +## DESCRIPTION +## Algebra, Inequalities +## ENDDESCRIPTION + +## KEYWORDS('algebra', 'linear inequality') +## Tagged by jjh2b + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PCCmacros.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 0; + +$a = random(1,8,1); + +do {$b=random(1,8,1);} until ($b != $a); + +$c=random(-8,-1,1); +$d=($c*$b-$a)/($c-1); +if($d<$b){$min=$d and $max=$b and $flag=1} else {$min=$b and $max=$d and $flag =0}; + +Context("Interval"); +if ($flag==1) +{$answer = Union("[$min,$max)");} +else +{$answer = Union("($min,$max]");} + +BEGIN_PGML +Solve the following inequality. Write the answer in interval notation. + +[@KeyboardInstructions('If you need to use the [`\infty`] symbol, type [|INF|]*. If you need to use the union symbol [`\cup`], type [|U|]*.')@]** + +>>[``\frac{x-[$a]}{x-[$b]} \le [$c] ``]<< + +[`x`] is in [__]{$answer}{width=>20} + +END_PGML + + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals1.pg b/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals1.pg new file mode 100644 index 0000000000..d2b65ba763 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals1.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# bx^2 = c +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + + +Context("Numeric"); +$var = list_random('a','b','c','d','h','k','m','n','p','q','r','t','v','w','x','y','z'); +Context()->variables->are($var=>'Real'); + +$a = random(3,10,1); +$b = random(2,10,1); + +$c = $b*$a**2; + +$left = Formula("$b $var^2")->reduce; +$right = Formula("$c")->reduce; + + +$r[0] = Compute("$a"); +$r[1] = Compute("-$a"); + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$r[0],$r[1]}"); + + +############################################## + + +BEGIN_PGML + +Solve the equation for [`[$var]`]. Enter the solution set using set notation. For example: [`\{1,2\}`]. + +>>[``[$left] = [$right]``]<< + + +If you need to use a square root, type *sqrt(23)* for [`\sqrt{23}`] (for example). +If the equation has no solutions, you can still use set notation by entering [`\{\}`]. + + +The solution set is [__________] + +END_PGML + + +############################################## + + +ANS( $ans->cmp(tolerance=>0)); + + +############################################## + + +BEGIN_PGML_SOLUTION + +In order to find out what [`[$var]`] is, we first have to solve the equation for [`[$var]^2`]: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \frac{[$left]}{[$b]} &= \frac{[$right]}{[$b]} \\ + [$var]^2 &= [$c/$b] \\ +\end{aligned} + ``] + +Now we can take the square root on both sides to find [`[$var]`]. Whenever we take the square root or any other even-numbered root, we will have a positive and a negative solution of the root. We express that by using the absolute value. + + [`` +\begin{aligned} + [$var]^2 &= [$c/$b] \\ + \sqrt{[$var]^2} &= \sqrt{[$c/$b]} \\ + \left|[$var]\right| &= [$a] \\ + [$var] &= \pm[$a] \\ +\end{aligned} + ``] + +The solution set is therefore [`\{[$r[0]],[$r[1]]\}`]. Make sure to check your answer by substituting it into the original equation. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals2.pg b/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals2.pg new file mode 100644 index 0000000000..9b2bc58023 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals2.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# (bx-c)^2 = d +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + + +Context("Numeric"); +$var = list_random('a','b','c','d','h','k','m','n','p','q','r','t','v','w','x','y','z'); +Context()->variables->are($var=>'Real'); + +$a = random(3,12,1); +$b = random(2,10,1); +$c = random(2,12,1); + +$d = ($b*$a-$c)**2; + +$left = Formula("($b $var-$c)^2")->reduce; +$right = Formula("$d")->reduce; + + +$r[0] = Compute("$a"); +Context("Fraction"); + +$r[1] = Fraction("(-sqrt($d)+$c)","$b"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$r[0],$r[1]}"); + + +############################################## + + +BEGIN_PGML + +Solve the equation for [`[$var]`]. Enter the solution set using set notation. For example: [`\{1,2\}`]. + +>>[``[$left] = [$right]``]<< + + +If you need to use a square root, type *sqrt(23)* for [`\sqrt{23}`] (for example). +If the equation has no solutions, you can still use set notation by entering [`\{\}`]. + + +The solution set is [__________] + +END_PGML + + +############################################## + + +ANS( $ans->cmp(tolerance=>0)); + + +############################################## + + +BEGIN_PGML_SOLUTION + +In order to solve for [`[$var]`], we first take the square root on both sides. Whenever we take the square root or any other even-numbered root, we will have a positive and a negative solution of the root. We express that by using the absolute value. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \sqrt{[$left]} &= \sqrt{[$right]} \\ + \left|[$b][$var]-[$c]\right| &= [$b*$a-$c] \\ + [$b][$var]-[$c] &= \pm[$b*$a-$c] \\ +\end{aligned} + ``] + +Now we solve for [`[$var]`]. However, since we have two solutions, we have to solve two equations: + + [`` +\begin{aligned} + [$b][$var]-[$c] &= [$b*$a-$c] && & [$b][$var]-[$c] &= -[$b*$a-$c] \\ + [$b][$var]-[$c]+[$c] &= [$b*$a-$c]+[$c] && & [$b][$var]-[$c]+[$c] &= -[$b*$a-$c]+[$c] \\ + [$b][$var] &= [$b*$a] && & [$b][$var] &= -[$b*$a-$c*2] \\ + \frac{[$b][$var]}{[$b]} &= \frac{[$b*$a]}{[$b]} && & \frac{[$b][$var]}{[$b]} &= \frac{-[$b*$a-$c*2]}{[$b]} \\ + [$var] &= [$r[0]] && & [$var] &= [$r[1]] \\ +\end{aligned} + ``] + +The solution set is therefore [`\{[$r[0]],[$r[1]]\}`]. Make sure to check your answer by substituting it into the original equation. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals3.pg b/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals3.pg new file mode 100644 index 0000000000..d3d2f8eedf --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals3.pg @@ -0,0 +1,116 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# (b-x)^3 = d +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('a','b','c','d','h','k','m','n','p','q','r','t','v','w','x','y','z'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-15,15,1); +$b = random(1,8,1); + + +$d = ($b-$a)**3; + +$left = Formula("($b - $var)^3")->reduce; +$right = Formula("$d")->reduce; + + +$r[0] = Compute("$a"); + + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$r[0]}"); + + +############################################## + + +BEGIN_PGML + +Solve the equation for [`[$var]`]. Enter the solution set using set notation. For example: [`\{1,2\}`]. + +>>[``[$left] = [$right]``]<< + + +If you need to use a square root, type *sqrt(23)* for [`\sqrt{23}`] (for example). +If the equation has no solutions, you can still use set notation by entering [`\{\}`]. + + +The solution set is [__________] + +END_PGML + + +############################################## + + +ANS( $ans->cmp(tolerance=>0)); + + +############################################## + + +BEGIN_PGML_SOLUTION + +In order to solve for [`[$var]`], we first take the cube root on both sides. Since this is an odd-numbered root, there will only be one answer. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \sqrt[3]{[$left]} &= \sqrt[3]{[$right]} \\ + [$b]-[$var] &= [$b-$a] \\ +\end{aligned} + ``] + +Now we solve for [`[$var]`]: + + [`` +\begin{aligned} + [$b]-[$var] &= [$b-$a] \\ + [$b]-[$var]-[$b] &= [$b-$a]-[$b] \\ + -[$var] &= -[$a] \\ + [$var] &= [$a] \\ +\end{aligned} + ``] + +The solution set is therefore [`\{[$r[0]]\}`]. Make sure to check your answer by substituting it into the original equation. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals4.pg b/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals4.pg new file mode 100644 index 0000000000..6f9a2bc592 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/EquationsNeedingRadicals/EquationsNeedingRadicals4.pg @@ -0,0 +1,133 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# (1/c)(x-b)^5 = d +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('a','b','c','d','h','k','m','n','p','q','r','t','v','w','x','y','z'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-3,3,1); + +$b = random(1,8,1); +while (abs($a+$b) <= 1) +{$b = random(1,8,1);} + +$c = $a+$b; + +Context("Fraction"); +Context()->variables->are($var=>'Real'); +$d = Fraction("($a-$b)**5","$c"); + +Context()->flags->set(reduceConstants=>0); + +$left = Formula("1/$c*($var-$b)^5"); +$right = Formula("$d"); + + +$r[0] = Compute("$a"); + + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$r[0]}"); + + +############################################## + + +BEGIN_PGML + +Solve the equation for [`[$var]`]. Enter the solution set using set notation. For example: [`\{1,2\}`]. + +>>[``[$left] = [$right]``]<< + + +If you need to use a square root, type *sqrt(23)* for [`\sqrt{23}`] (for example). +If the equation has no solutions, you can still use set notation by entering [`\{\}`]. + + +The solution set is [__________] + +END_PGML + + +############################################## + + +ANS( $ans->cmp(tolerance=>0)); + + +############################################## + + +BEGIN_PGML_SOLUTION + +In order to find out what [`[$var]`] is, we first have to solve the equation for [`[$var]^5`] by multiplying each side of the equation with [`[$c]`]: + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left(\frac{[$c]}{1}\right)[$left] &= ([$c])([$right]) \\ + ([$var]-[$b])^5 &= [$c*$d] \\ +\end{aligned} + ``] + +Now we take the 5th root on both sides. Since this is an odd-numbered root, there will only be one answer. + + [`` +\begin{aligned} + ([$var]-[$b])^5 &= [$c*$d] \\ + \sqrt[5]{([$var]-[$b])^5} &= \sqrt[5]{[$c*$d]} \\ + [$var]-[$b] &= [$a-$b] \\ +\end{aligned} + ``] + +Now we solve for [`[$var]`]: + + [`` +\begin{aligned} + [$var]-[$b] &= [$a-$b] \\ + [$var]-[$b]+[$b] &= [$a-$b]+[$b] \\ + [$var] &= [$a] \\ +\end{aligned} + ``] + +The solution set is therefore [`\{[$r[0]]\}`]. Make sure to check your answer by substituting it into the original equation. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring1.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring1.pg new file mode 100644 index 0000000000..cffc0a65bd --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring1.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + +); + +TEXT(beginproblem()); +############################################## + +Context("Numeric"); +Context()->variables->are(x=>'Real'); +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->flags->set(partialCredit=>0); + +$a = non_zero_random(-20,20,1); + +$exp = "x^2+$a x"; + +$fac1 = Compute("x"); +$fac2 = Compute("(x+$a)")->reduce; + +$fctd = Compute("$fac1 $fac2"); +$fctd2 = Compute("$fac2 $fac1"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial using the greatest common factor. +$PAR + + +$SPACE $SPACE $SPACE \( $exp \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($fctd->cmp(typeMatch=>Formula("x"), checker => sub { + my ($correct,$student,$ans) = @_; + if (($student eq $correct) || ($student eq $fctd2)) + {return 1}; + })); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring10.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring10.pg new file mode 100644 index 0000000000..ebc58b4962 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring10.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real'); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + +$r1 = random(-10,-1,1); +$r2 = random(-10,-1,1); +while ($r1 == $r2) {$r2 = random(-10,-1,1);} + + +$t1 = Compute("$r1"); +$t2 = Compute("$r2"); + +$b = $t1+$t2; +$c = $t1*$t2; + +$polynomial = Formula("$var^2+$b*$var+$c")->reduce; + + + +Context("PolynomialFactors-Strict"); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( +minPower => 0, maxPower => 1, +message => "either 0 or 1", +); +$factored = Compute("($var+$t1)($var+$t2)")->reduce; + + +Context()->variables->are($var=>'Real'); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp()); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring11.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring11.pg new file mode 100644 index 0000000000..911d4e1840 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring11.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real'); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + +$r1 = random(-10,-1,1); +$r2 = non_zero_random(-10,10,1); +while ($r1 == $r2) {$r2 = non_zero_random(-10,10,1);} + + +$t1 = Compute("$r1"); +$t2 = Compute("$r2"); + +$b = $t1+$t2; +$c = $t1*$t2; + +$polynomial = Formula("$var^2+$b*$var+$c")->reduce; + + + +Context("PolynomialFactors-Strict"); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( +minPower => 0, maxPower => 1, +message => "either 0 or 1", +); +$factored = Compute("($var+$t1)($var+$t2)")->reduce; + + +Context()->variables->are($var=>'Real'); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp()); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring12.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring12.pg new file mode 100644 index 0000000000..5f499f120a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring12.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = 'z'; +Context()->variables->are($var=>'Real'); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + +$r1 = non_zero_random(-10,10,1); +$r2 = non_zero_random(-20,20,1); +while ($r1 == $r2) {$r2 = non_zero_random(-10,10,1);} + + +$t1 = Compute("$r1"); +$t2 = Compute("$r2"); + +$b = $t1+$t2; +$c = $t1*$t2; + +$polynomial = Formula("$var^2+$b*$var+$c")->reduce; + + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( +minPower => 0, maxPower => 1, +message => "either 0 or 1", +); +$factored = Compute("($var+$t1)($var+$t2)")->reduce; + + +Context()->variables->are($var=>'Real'); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp()); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring13.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring13.pg new file mode 100644 index 0000000000..ce72e54d80 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring13.pg @@ -0,0 +1,232 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$var = 'y'; +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,4,1); +$b = random(1,4,1); +$c = random(1,4,1); +$d = random(1,4,1); +$e = random(1,4,1); + +while ($a*$d == $b*$c) {$d = random(1,4,1);} + + +@coef = ([$a,$b], #One factor is (5x+10), etc. Could be randomized. + [$c,$d], + [$e]); + +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + +$polynomial = Formula(PolyString(~~@prod))->reduce; +$polynomial = $polynomial->substitute(x=>$var); + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of x attached. Remove all empty slots, like 0*x. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c x^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, ($const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]))->substitute(x=>$var) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); + +$factored = Compute("$altFtions[0]")->reduce; + + +Context()->variables->are($var=>'Real'); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial completely. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring14.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring14.pg new file mode 100644 index 0000000000..e5efa9f65c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring14.pg @@ -0,0 +1,231 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$var = 'y'; +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,6,1); +$b = random(1,6,1); +$c = random(1,6,1); +$d = random(1,6,1); +$e = random(1,6,1); + +while ($a*$d == $b*$c) {$d = random(1,4,1);} + + +@coef = ([$a,$b], #One factor is (5x+10), etc. Could be randomized. + [$c,$d], + [$e]); + +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + +$polynomial = Formula(PolyString(~~@prod))->reduce; +$polynomial = $polynomial->substitute(x=>$var); + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of x attached. Remove all empty slots, like 0*x. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c x^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, ($const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]))->substitute(x=>$var) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + +Context()->variables->are($var=>'Real'); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial completely. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring15.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring15.pg new file mode 100644 index 0000000000..8bdcabd023 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring15.pg @@ -0,0 +1,231 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$var = 'x'; +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,6,1); +$b = non_zero_random(-6,6,1); +$c = random(1,6,1); +$d = random(1,6,1); +$e = random(1,6,1); + +while ($a*$d == $b*$c) {$d = random(1,4,1);} + + +@coef = ([$a,$b], #One factor is (5x+10), etc. Could be randomized. + [$c,$d], + [$e]); + +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + +$polynomial = Formula(PolyString(~~@prod))->reduce; +$polynomial = $polynomial->substitute(x=>$var); + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of x attached. Remove all empty slots, like 0*x. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c x^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, ($const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]))->substitute(x=>$var) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + +Context()->variables->are($var=>'Real'); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial completely. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring16.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring16.pg new file mode 100644 index 0000000000..4f23fb1ac6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring16.pg @@ -0,0 +1,231 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$var = 'x'; +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,6,1); +$b = non_zero_random(-10,10,1); +$c = random(1,6,1); +$d = non_zero_random(-6,6,1); +$e = random(1,6,1); + +while ($a*$d == $b*$c) {$d = random(1,4,1);} + + +@coef = ([$a,$b], #One factor is (5x+10), etc. Could be randomized. + [$c,$d], + [$e]); + +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + +$polynomial = Formula(PolyString(~~@prod))->reduce; +$polynomial = $polynomial->substitute(x=>$var); + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of x attached. Remove all empty slots, like 0*x. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c x^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, ($const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]))->substitute(x=>$var) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + +Context()->variables->are($var=>'Real'); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial completely. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring17.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring17.pg new file mode 100644 index 0000000000..971c9d8d2a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring17.pg @@ -0,0 +1,231 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$var = 'x'; +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,6,1); +$b = non_zero_random(-10,10,1); +$c = random(1,6,1); +$d = non_zero_random(-8,8,1); +$e = random(1,6,1); + +while ($a*$d == $b*$c) {$d = random(1,4,1);} + + +@coef = ([$a,$b], #One factor is (5x+10), etc. Could be randomized. + [$c,$d], + [$e,0]); + +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + +$polynomial = Formula(PolyString(~~@prod))->reduce; +$polynomial = $polynomial->substitute(x=>$var); + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of x attached. Remove all empty slots, like 0*x. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c x^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, ($const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]))->substitute(x=>$var) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + +Context()->variables->are($var=>'Real'); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial completely. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring18.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring18.pg new file mode 100644 index 0000000000..0b52a56f80 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring18.pg @@ -0,0 +1,231 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$var = 'x'; +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,6,1); +$b = non_zero_random(-10,10,1); +$c = random(1,6,1); +$d = non_zero_random(-8,8,1); +$e = random(1,6,1); + +while ($a*$d == $b*$c) {$d = random(1,4,1);} + + +@coef = ([$a,$b], #One factor is (5x+10), etc. Could be randomized. + [$c,$d], + [$e,0,0,0]); + +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + +$polynomial = Formula(PolyString(~~@prod))->reduce; +$polynomial = $polynomial->substitute(x=>$var); + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of x attached. Remove all empty slots, like 0*x. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c x^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, ($const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]))->substitute(x=>$var) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + +Context()->variables->are($var=>'Real'); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial completely. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring19.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring19.pg new file mode 100644 index 0000000000..08a880d71b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring19.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real'); + + +@p1 = (random(1,8,1),2); +@p2 = (1,random(1,8,1)); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +Context()->operators->undefine('/'); +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring2.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring2.pg new file mode 100644 index 0000000000..ff57f1a3a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring2.pg @@ -0,0 +1,226 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + +); + +TEXT(beginproblem()); +############################################## + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +#In my opinion, not desired reductions for this kind of problem. + + +@coef = ([random(2,5,1),0,0], + [random(2,10,1),random(3,6,1)], + [1]); + +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + +$polynomial = Formula(PolyString(~~@prod))->reduce; + + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of x attached. Remove all empty slots, like 0*x. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c x^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. +#We will make use of a two-dimensional array of indices +$t0 = @{$altF[0]}-1; +$t1 = @{$altF[1]}-1; +$t2 = @{$altF[2]}-1; + +@indices = ([0..$t0],[0..$t1],[0..$t2],); + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$indices[$S3{$k}{0}]->[$m0]]) + *($altF[$S3{$k}{1}]->[$indices[$S3{$k}{1}]->[$m1]]) + *($altF[$S3{$k}{2}]->[$indices[$S3{$k}{2}]->[$m2]]) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +$factored = Compute("$altFtions[0]")->reduce; + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial using the greatest common factor. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("x"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring20.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring20.pg new file mode 100644 index 0000000000..02d3f5cdfb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring20.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real'); + + +@p1 = (random(1,3,1),random(1,8,1)); +@p2 = (random(1,3,1),random(1,8,1)); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +Context()->operators->undefine('/'); +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring21.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring21.pg new file mode 100644 index 0000000000..d137c968f6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring21.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = list_random('x','y','r','z','t'); +Context()->variables->are(x=>'Real',$var=>'Real'); + + +@p1 = (random(1,3,1),random(1,8,1)); +@p2 = (random(1,3,1),random(1,8,1)); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +Context()->operators->undefine('/'); +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring22.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring22.pg new file mode 100644 index 0000000000..28623a9b33 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring22.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = list_random('x','y','r','z','t'); +Context()->variables->are(x=>'Real',$var=>'Real'); + + +@p1 = (random(1,2,1),non_zero_random(-12,12,1)); +@p2 = (random(1,5,1),non_zero_random(-12,12,1)); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + +Context()->operators->undefine('/'); + +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring23.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring23.pg new file mode 100644 index 0000000000..55c732e393 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring23.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = list_random('x','y','r','z','t'); +Context()->variables->are(x=>'Real',$var=>'Real'); + + +@p1 = (random(1,2,1),random(1,12,1)); +@p2 = (random(1,7,1),non_zero_random(-15,15,1)); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + +Context()->operators->undefine('/'); + +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring24.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring24.pg new file mode 100644 index 0000000000..88f8a303fd --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring24.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = list_random('x','y','r','z','t'); +Context()->variables->are(x=>'Real',$var=>'Real'); + + +@p1 = (random(1,2,1),non_zero_random(-12,12,1)); +@p2 = (random(1,7,1),non_zero_random(-15,15,1)); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +Context()->operators->undefine('/'); +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring25.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring25.pg new file mode 100644 index 0000000000..88f8a303fd --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring25.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = list_random('x','y','r','z','t'); +Context()->variables->are(x=>'Real',$var=>'Real'); + + +@p1 = (random(1,2,1),non_zero_random(-12,12,1)); +@p2 = (random(1,7,1),non_zero_random(-15,15,1)); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +Context()->operators->undefine('/'); +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring26.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring26.pg new file mode 100644 index 0000000000..ca0e2326d2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring26.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = list_random('x','y','r','z','t'); +Context()->variables->are(x=>'Real',$var=>'Real'); + + +@p1 = (random(1,2,1),non_zero_random(-12,12,1)); +@p2 = (random(1,7,1),non_zero_random(-20,20,1)); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +Context()->operators->undefine('/'); +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring27.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring27.pg new file mode 100644 index 0000000000..54524edad8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring27.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = list_random('x','y','r','z','t'); +Context()->variables->are(x=>'Real',$var=>'Real'); + + +@p1 = (random(1,7,1),non_zero_random(-12,12,1)); +@p2 = (random(1,7,1),non_zero_random(-20,20,1)); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +Context()->operators->undefine('/'); +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring28.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring28.pg new file mode 100644 index 0000000000..59b1299f9e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring28.pg @@ -0,0 +1,235 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + + +@coef = ([random(1,5,1),0], #One factor is (5x+10), etc. Could be randomized. + [random(1,4,1),non_zero_random(-10,10,1)], + [random(1,2,1),non_zero_random(-3,3,1)]); +$var = list_random('x','y','z','r','t'); +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + + +Context()->variables->are(x=>'Real',$var=>'Real'); +$polynomial = Formula(PolyString(~~@prod))->reduce->substitute(x=>$var); + + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of $var attached. Remove all empty slots, like 0*$var. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely or you are writing terms in an unusual order, like yx instead of xy.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring29.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring29.pg new file mode 100644 index 0000000000..850607a620 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring29.pg @@ -0,0 +1,235 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + + +@coef = ([random(1,5,1),0,0], #One factor is (5x+10), etc. Could be randomized. + [random(1,4,1),non_zero_random(-10,10,1)], + [random(1,2,1),non_zero_random(-3,3,1)]); +$var = list_random('x','y','z','r','t'); +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + + +Context()->variables->are(x=>'Real',$var=>'Real'); +$polynomial = Formula(PolyString(~~@prod))->reduce->substitute(x=>$var); + + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of $var attached. Remove all empty slots, like 0*$var. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely or you are writing terms in an unusual order, like yx instead of xy.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring3.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring3.pg new file mode 100644 index 0000000000..27d74abf66 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring3.pg @@ -0,0 +1,227 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + +); + +TEXT(beginproblem()); +############################################## + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +#In my opinion, not desired reductions for this kind of problem. + + +@coef = ([random(2,5,1),0,0], + [random(2,10,1),random(3,6,1)], + [1]); + +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + +$polynomial = Formula(PolyString(~~@prod))->reduce; + + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of x attached. Remove all empty slots, like 0*x. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c x^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. +#We will make use of a two-dimensional array of indices +$t0 = @{$altF[0]}-1; +$t1 = @{$altF[1]}-1; +$t2 = @{$altF[2]}-1; + +@indices = ([0..$t0],[0..$t1],[0..$t2],); + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$indices[$S3{$k}{0}]->[$m0]]) + *($altF[$S3{$k}{1}]->[$indices[$S3{$k}{1}]->[$m1]]) + *($altF[$S3{$k}{2}]->[$indices[$S3{$k}{2}]->[$m2]]) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +$factored = Compute("$altFtions[0]")->reduce; + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Factor the polynomial using the greatest common factor. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("x"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring30.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring30.pg new file mode 100644 index 0000000000..6adbcdf641 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring30.pg @@ -0,0 +1,235 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + + +@coef = ([random(1,10,1),0,0,0,0], #One factor is (5x+10), etc. Could be randomized. + [random(1,4,1),non_zero_random(-10,10,1)], + [random(1,5,1),non_zero_random(-3,3,1)]); +$var = list_random('x','y','z','r','t'); +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + + +Context()->variables->are(x=>'Real',$var=>'Real'); +$polynomial = Formula(PolyString(~~@prod))->reduce->substitute(x=>$var); + + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of $var attached. Remove all empty slots, like 0*$var. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Use the method of your choice to factor the trinomial, or state that the trinomial is $BBOLD prime$EBOLD. Check your factorization using FOIL multiplication. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely or you are writing terms in an unusual order, like yx instead of xy.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring31.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring31.pg new file mode 100644 index 0000000000..5b34b45f40 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring31.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = list_random('x','y','z','t','r'); +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,1,1); +$b = random(1,8,1); + +@p1 = ($a,$b); +@p2 = ($a,-$b); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor this polynomial. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring32.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring32.pg new file mode 100644 index 0000000000..3b6294f04a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring32.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = list_random('x','y','z','t','r'); +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(2,8,1); +$b = random(1,8,1); + +@p1 = ($a,$b); +@p2 = ($a,-$b); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +Context()->operators->undefine('/'); +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor this polynomial. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring33.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring33.pg new file mode 100644 index 0000000000..ec59e6c8f5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring33.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = list_random('x','y','z','t','r'); +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,10,1); +$b = random(1,10,1); + +@p1 = ($a,$b); +@p2 = ($a,-$b); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +Context()->operators->undefine('/'); +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor this polynomial. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring34.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring34.pg new file mode 100644 index 0000000000..ec59e6c8f5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring34.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = list_random('x','y','z','t','r'); +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,10,1); +$b = random(1,10,1); + +@p1 = ($a,$b); +@p2 = ($a,-$b); +@product = PolyMult(~~@p1,~~@p2); + +$poly1 = Formula(PolyString(~~@p1)); +$poly2 = Formula(PolyString(~~@p2)); +$polynomial = Formula(PolyString(~~@product)); +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$polynomial = $polynomial->substitute(x=>$var); + + +Context("PolynomialFactors-Strict"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( minPower => 0, maxPower => 1, + message => "either 0 or 1",); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +Context()->operators->undefine('/'); +$factored = Compute("($poly1)($poly2)")->reduce; +#$factored = Compute("prime"); + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor this polynomial. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"))); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring35.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring35.pg new file mode 100644 index 0000000000..6555aab70b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring35.pg @@ -0,0 +1,238 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$a = random(1,1,1); +$b = random(1,9,1); + +@coef = ([random(1,7,1),0], #One factor is (5x+10), etc. Could be randomized. + [$a,$b], + [$a,-$b]); +$var = list_random('x','y','z','r','t'); +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + + +Context()->variables->are(x=>'Real',$var=>'Real'); +$polynomial = Formula(PolyString(~~@prod))->reduce->substitute(x=>$var); + + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of $var attached. Remove all empty slots, like 0*$var. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + + + + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial completely, or state that it is $BBOLD prime$EBOLD. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely or you are writing terms in an unusual order, like yx instead of xy.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring36.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring36.pg new file mode 100644 index 0000000000..d5a5bc27ad --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring36.pg @@ -0,0 +1,241 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$a = random(1,3,1); +$b = non_zero_random(-4,4,1); + +@coef = ([$a,$b], #One factor is (5x+10), etc. Could be randomized. + [$a**2,-$a*$b,$b**2], + [1]); +$var = list_random('x','y','z','r','t'); +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + + +Context()->variables->are(x=>'Real',$var=>'Real'); +$polynomial = Formula(PolyString(~~@prod))->reduce->substitute(x=>$var); + + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of $var attached. Remove all empty slots, like 0*$var. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]) + ); + }; + }; + }; +}; + + + + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + + + + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely or you are writing terms in an unusual order, like yx instead of xy.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring37.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring37.pg new file mode 100644 index 0000000000..e9195610d0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring37.pg @@ -0,0 +1,240 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$a = random(1,5,1); +$b = non_zero_random(-10,10,1); + +@coef = ([$a,$b], #One factor is (5x+10), etc. Could be randomized. + [$a**2,-$a*$b,$b**2], + [1]); +$var = list_random('x','y','z','r','t'); +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + + +Context()->variables->are(x=>'Real',$var=>'Real'); +$polynomial = Formula(PolyString(~~@prod))->reduce->substitute(x=>$var); + + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of $var attached. Remove all empty slots, like 0*$var. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]) + ); + }; + }; + }; +}; + + + + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + + + + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Factor the polynomial. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely or you are writing terms in an unusual order, like yx instead of xy.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring38.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring38.pg new file mode 100644 index 0000000000..7af34b7a1a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring38.pg @@ -0,0 +1,240 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$a = random(1,10,1); +$b = non_zero_random(-10,10,1); + +@coef = ([$a,$b], #One factor is (5x+10), etc. Could be randomized. + [$a**2,-$a*$b,$b**2], + [1]); +$var = list_random('x','y','z','r','t'); +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + + +Context()->variables->are(x=>'Real',$var=>'Real'); +$polynomial = Formula(PolyString(~~@prod))->reduce->substitute(x=>$var); + + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of $var attached. Remove all empty slots, like 0*$var. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]) + ); + }; + }; + }; +}; + + + + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + + + + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Factor the polynomial. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely or you are writing terms in an unusual order, like yx instead of xy.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring39.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring39.pg new file mode 100644 index 0000000000..29425c359c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring39.pg @@ -0,0 +1,240 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$a = random(1,5,1); +$b = non_zero_random(-5,5,1); + +@coef = ([random(1,2,1),0], #One factor is (5x+10), etc. Could be randomized. + [$a,$b], + [$a**2,-$a*$b,$b**2]); +$var = list_random('y','x','z','r','t'); +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + + +Context()->variables->are(x=>'Real',$var=>'Real'); +$polynomial = Formula(PolyString(~~@prod))->reduce->substitute(x=>$var); + + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of $var attached. Remove all empty slots, like 0*$var. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]) + ); + }; + }; + }; +}; + + + + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + + + + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Factor the polynomial. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely or you are writing terms in an unusual order, like yx instead of xy.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring4.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring4.pg new file mode 100644 index 0000000000..49eded62d6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring4.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + +); + +TEXT(beginproblem()); +############################################## + +Context("Numeric"); +$var = 'y'; +Context()->variables->are($var=>'Real'); +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->flags->set(partialCredit=>0); + +$a = random(1,20,1); +$b = random(1,20,1); +while (gcd($a,$b) != 1) +{$b = random(1,20,1);} + + +$exp = Compute("$a y^2-$b y")->reduce; + +$fac1 = Compute("y"); +$fac2 = Compute("($a y-$b)")->reduce; + +$fctd = Compute("$fac1 $fac2"); +$fctd2 = Compute("$fac2 $fac1"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Factor the polynomial. +$PAR + + +$SPACE $SPACE $SPACE \( $exp \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($fctd->cmp(typeMatch=>Formula($var), checker => sub { + my ($correct,$student,$ans) = @_; + if (($student eq $correct) || ($student eq $fctd2)) + {return 1}; + })); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring40.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring40.pg new file mode 100644 index 0000000000..4110784c7f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring40.pg @@ -0,0 +1,240 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +#In my opinion, not desired reductions for this kind of problem. + +$a = random(1,10,1); +$b = non_zero_random(-10,10,1); + +@coef = ([random(1,2,1),0], #One factor is (5x+10), etc. Could be randomized. + [$a,$b], + [$a**2,-$a*$b,$b**2]); +$var = list_random('y','x','z','r','t'); +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + + +Context()->variables->are(x=>'Real',$var=>'Real'); +$polynomial = Formula(PolyString(~~@prod))->reduce->substitute(x=>$var); + + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of $var attached. Remove all empty slots, like 0*$var. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. + + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$m0]) + *($altF[$S3{$k}{1}]->[$m1]) + *($altF[$S3{$k}{2}]->[$m2]) + ); + }; + }; + }; +}; + + + + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +Context()->operators->undefine('/'); +$factored = Compute("$altFtions[0]")->reduce; + + + + + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Factor the polynomial. + +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("$var"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely or you are writing terms in an unusual order, like yx instead of xy.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring5.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring5.pg new file mode 100644 index 0000000000..81003fceae --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring5.pg @@ -0,0 +1,241 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + +); + +TEXT(beginproblem()); +############################################## + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +#In my opinion, not desired reductions for this kind of problem. +$var = 'y'; +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,8,1); +$b = random(2,5,1); +$c = random(2,10,1); + +@coef = ([$a,0,0,0,0], + [$b,0,$c], + [1]); + +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + +$polynomial = Formula(PolyString(~~@prod))->reduce; +$polynomial = $polynomial->substitute(x=>'y'); + + + +$polynomial = Formula("$a*$b*y^6+$a*$c*y^4")->reduce; + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of x attached. Remove all empty slots, like 0*x. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. +#We will make use of a two-dimensional array of indices +$t0 = @{$altF[0]}-1; +$t1 = @{$altF[1]}-1; +$t2 = @{$altF[2]}-1; + +@indices = ([0..$t0],[0..$t1],[0..$t2],); + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$indices[$S3{$k}{0}]->[$m0]]) + *($altF[$S3{$k}{1}]->[$indices[$S3{$k}{1}]->[$m1]]) + *($altF[$S3{$k}{2}]->[$indices[$S3{$k}{2}]->[$m2]]) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +$factored = Compute("$altFtions[0]")->reduce; + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial using the greatest common factor. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("x"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring6.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring6.pg new file mode 100644 index 0000000000..a0ba7d8899 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring6.pg @@ -0,0 +1,242 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + +); + +TEXT(beginproblem()); +############################################## + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +#In my opinion, not desired reductions for this kind of problem. +$var = 'y'; +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,8,1); +$b = random(2,5,1); +$c = random(2,10,1); +$d = random(2,10,1); + +@coef = ([$a,0,$b], + [$c,$d], + [1]); + +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + +$polynomial = Formula(PolyString(~~@prod))->reduce; +$polynomial = $polynomial->substitute(x=>'y'); + + + +$polynomial = Formula("$a*$c*y^3+($a*$d)*y^2+($b*$c)*y+$b*$d")->reduce; + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of x attached. Remove all empty slots, like 0*x. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. +#We will make use of a two-dimensional array of indices +$t0 = @{$altF[0]}-1; +$t1 = @{$altF[1]}-1; +$t2 = @{$altF[2]}-1; + +@indices = ([0..$t0],[0..$t1],[0..$t2],); + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$indices[$S3{$k}{0}]->[$m0]]) + *($altF[$S3{$k}{1}]->[$indices[$S3{$k}{1}]->[$m1]]) + *($altF[$S3{$k}{2}]->[$indices[$S3{$k}{2}]->[$m2]]) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +$factored = Compute("$altFtions[0]")->reduce; + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("x"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring7.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring7.pg new file mode 100644 index 0000000000..4646d9eb88 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring7.pg @@ -0,0 +1,242 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + +); + +TEXT(beginproblem()); +############################################## + +%S3 = (A => {0 => 0, 1 => 1, 2 => 2}, B => {0 => 0, 1 => 2, 2 => 1}, + C => {0 => 1, 1 => 0, 2 => 2}, D => {0 => 1, 1 => 2, 2 => 0}, + E => {0 => 2, 1 => 1, 2 => 0}, F => {0 => 2, 1 => 0, 2 => 1},); +%S2 = (A => {0 => 0, 1 => 1}, B => {0 => 1, 1 => 0},); +%S1 = (A => {0 => 0},); + + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +#In my opinion, not desired reductions for this kind of problem. +$var = 't'; +Context()->variables->are(x=>'Real',$var=>'Real'); + +$a = random(1,8,1); +$b = random(2,5,1); +$c = random(2,10,1); +$d = random(2,10,1); + +@coef = ([$a,0,$b], + [$c,$d], + [1]); + +$n = $#coef; + + + +#Get the array of coefficients for the product + +@prod = PolyMult(~~@{$coef[0]},~~@{$coef[1]}); +@prod = PolyMult(~~@prod,~~@{$coef[2]}); + +#Make the presented polynomial. I'm using PolyString (included in +#PGpolynomialmacros.pl) but it currently doesn't handle negative Math Objects +#correctly. That could easily be fixed. Anyway, for this current example, +#keep the original coefficients as Perl reals. + +$polynomial = Formula(PolyString(~~@prod))->reduce; +$polynomial = $polynomial->substitute(x=>$var); + + + +$polynomial = Formula("$a*$c*$var^3+($a*$d)*$var^2+($b*$c)*$var+$b*$d")->reduce; + + +#Pull out any constants that can be pulled out. +$const = 1; +foreach my $i (0..$n) { + my $z = @{$coef[$i]}-1; + my $g = 1; + if ($z > 0) { + $g = gcd(@{$coef[$i]}); + foreach my $j (2..$z) { + $g = gcd($g,$coef[$i]->[$j]); + } + } + else {$g = $coef[$i]->[0];}; + $const = $const * $g; + + + my @temp = (); + foreach my $j (0..$z) { + @temp = (@temp,($coef[$i]->[$j])/$g); + }; + $coef[$i] = [ @temp ]; +} + +#A Formula reduction pushes constants to the left anyway, so we won't worry about all the places student could conceivable put this constant. $const is put back in toward the end, below. + + + + +#Upgrade @coef so that each entry is a Formula with the proper +#power of x attached. Remove all empty slots, like 0*x. + +@terms =([]); + +foreach my $i (0..$n) { + my @temp = (); + my $temp2 = @{$coef[$i]}-1; + foreach my $j (0..$temp2) { + my $c = $coef[$i]->[$j]; + my $d = $temp2-$j; + if ($c != 0) { + @temp = (@temp, Formula("$c $var^{$d}")->reduce); + }; + }; + $terms[$i] = [ @temp ]; +}; + + +#Make the array of acceptable alternative factorizations. + +#First, make a two-dimensional array indexed by the original factors, +#then by order of terms within that factor. If the factorization includes a +#trinomial, that row should be handled differently. + +@altF = ([]); + + + + +foreach my $i (0..$n) { + my $t = @{$terms[$i]}; + if ($t == 1) { #for monomial factors + $altF[$i] = [ ( $terms[$i]->[0] ) ]; + }; + + if ($t == 2) { #for binomial factors + my @tmp = (); + foreach my $j (A,B) { + @tmp = (@tmp, ($terms[$i]->[$S2{$j}{0}] + + $terms[$i]->[$S2{$j}{1}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + + if ($t == 3) { #for trinomial factors + my @tmp = (); + foreach my $j (A..F) { + @tmp = (@tmp, Compute($terms[$i]->[$S3{$j}{0}] + $terms[$i]->[$S3{$j}{1}] + + $terms[$i]->[$S3{$j}{2}])->reduce ); + }; + $altF[$i] = [ @tmp ]; + }; + +}; + + +#Make a one-dimensional array with all legal alternative factorizations. +#We will make use of a two-dimensional array of indices +$t0 = @{$altF[0]}-1; +$t1 = @{$altF[1]}-1; +$t2 = @{$altF[2]}-1; + +@indices = ([0..$t0],[0..$t1],[0..$t2],); + +@altFtions = (); + +foreach my $k (A..F) { + $s0 = @{$altF[$S3{$k}{0}]}-1; + $s1 = @{$altF[$S3{$k}{1}]}-1; + $s2 = @{$altF[$S3{$k}{2}]}-1; + foreach my $m0 (0..$s0) { + foreach my $m1 (0..$s1) { + foreach my $m2 (0..$s2) { + + @altFtions = (@altFtions, $const + *($altF[$S3{$k}{0}]->[$indices[$S3{$k}{0}]->[$m0]]) + *($altF[$S3{$k}{1}]->[$indices[$S3{$k}{1}]->[$m1]]) + *($altF[$S3{$k}{2}]->[$indices[$S3{$k}{2}]->[$m2]]) + ); + }; + }; + }; +}; + +#Pick the version that is displayed as correct. Return the turned-off reductions. + +Context()->reduction->set('(-x)-y'=>1, '(-x)+y'=>1); +$factored = Compute("$altFtions[0]")->reduce; + + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Factor the polynomial. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp(typeMatch=>Formula("x"), checker => sub { + my ($correct,$student,$ans) = @_; + my $ret = 0; + my $l = 0; + while (($ret != 1) && ($l <= $#altFtions)) { + if ($student->reduce eq $altFtions[$l]->reduce) {$ret = 1;}; + $l = $l + 1; + } + Value->Error("You haven't factored completely.") + if (($ret == 0) && ($student == $correct)); + + Value->Error("Your factorization is incorrect.") + if ($student != $correct); + + return $ret + })); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring8.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring8.pg new file mode 100644 index 0000000000..2129852da9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring8.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real'); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + +$r1 = random(1,10,1); +$r2 = random(1,10,1); +while ($r1 == $r2) {$r2 = random(1,20,1);} + +$t1 = Compute("$r1"); +$t2 = Compute("$r2"); + +$b = $t1+$t2; +$c = $t1*$t2; + +$polynomial = Formula("$var^2+$b*$var+$c"); + + + +Context("PolynomialFactors-Strict"); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( +minPower => 0, maxPower => 1, +message => "either 0 or 1", +); +$factored = Compute("($var+$t1)($var+$t2)")->reduce; + + +Context()->variables->are($var=>'Real'); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Factor the polynomial. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp()); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Factoring/Factoring9.pg b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring9.pg new file mode 100644 index 0000000000..7e8fac314c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Factoring/Factoring9.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGpolynomialmacros.pl", + "contextPolynomialFactors.pl", + "contextLimitedPowers.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0, '(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real'); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + +$r1 = random(1,20,1); +$r2 = random(1,20,1); +while ($r1 == $r2) {$r2 = random(1,20,1);} + +$t1 = Compute("$r1"); +$t2 = Compute("$r2"); + +$b = $t1+$t2; +$c = $t1*$t2; + +$polynomial = Formula("$var^2+$b*$var+$c"); + + + +Context("PolynomialFactors-Strict"); +Context()->flags->set(singleFactors=>0); +LimitedPowers::OnlyIntegers( +minPower => 0, maxPower => 1, +message => "either 0 or 1", +); +$factored = Compute("($var+$t1)($var+$t2)")->reduce; + + +Context()->variables->are($var=>'Real'); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Factor the polynomial. +$PAR + + +$SPACE $SPACE $SPACE \( $polynomial \) + +$PAR + + +\{ans_rule(20)\} + + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($factored->cmp()); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions10.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions10.pg new file mode 100644 index 0000000000..5d60e4fa8f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions10.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + +Context("Numeric"); + +$a = random(-2,3,1); +$c = $a+2; +$e = $c + random(1,3,1); + +$b = random(1,5,1); +$d = random(-3,10,1); +$f = random(-5,5,1); + +Context("Point"); +$P = Point("($a,$b)"); +$Q = Point("($c,$d)"); +$R = Point("($e,$f)"); + +Context()->parens->set('{'=>{type=>'List'}); +$pairs = List("{$P,$Q,$R}"); + +Context("Interval"); +#Context()->parens->set('{'=>{type=>'Set'},'('=>{type=>'Point'},'['=>{type=>'Interval'}); +$domain = Set("{$a,$c,$e}"); +$range = Set("{$b,$d,$f}"); + +############################################## + + +BEGIN_PGML +Below is all of the information that exists about a function [`[$fname]`]. + + [`\begin{aligned} +[$fname]([$a])&=[$b]& +[$fname]([$c])&=[$d]& +[$fname]([$e])&=[$f] +\end{aligned}`] + + +Write [`[$fname]`] as a set of ordered pairs. [@KeyboardInstructions('Remember that a _set_ is written with [|{|]* and [|}|]* surrounding the list.')@]** + + [____________________] + +[`[$fname]`] has domain [____________________] and range [____________________]. + + +END_PGML + + +############################################## + +ANS($pairs->cmp(showEqualErrors=>0)); +ANS($domain->cmp); +ANS($range->cmp); + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions11.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions11.pg new file mode 100644 index 0000000000..d9ea18df2a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions11.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + + +Context("Numeric"); +Context()->variables->are(a=>'Real',b=>'Real',c=>'Real',d=>'Real'); + +$a[0] = Compute("a"); +$a[1] = Compute("b"); +$a[2] = Compute("c"); +$a[3] = Compute("d"); + + +$i[0] = random(1,5,1); +$i[1] = random(-3,10,1); +$i[2] = random(-5,5,1); +$i[3] = $i[random(0,2,1)]; + + +Context("Point"); +Context()->variables->are(a=>'Real',b=>'Real',c=>'Real',d=>'Real'); +for my $j (0..3) { +$P[$j] = Point("($a[$j],$i[$j])"); +} + +Context()->parens->set('{'=>{type=>'List'}); +$pairs = List("{$P[0],$P[1],$P[2],$P[3]}"); + +Context("Numeric"); +Context()->variables->are(a=>'Real',b=>'Real',c=>'Real',d=>'Real'); +Context()->parens->set('{'=>{type=>'Set'},'('=>{type=>'Point'},'['=>{type=>'Interval'}); +$domain = Set("{$a[0],$a[1],$a[2],$a[3]}"); +$range = Set("{$i[0],$i[1],$i[2]}"); + +############################################## + + +BEGIN_PGML +Below is all of the information about a function [`[$fname]`]. + + [`\begin{aligned} +[$fname]([@$a[0]@])&=[@$i[0]@]& +[$fname]([@$a[1]@])&=[@$i[1]@]\\ +[$fname]([@$a[2]@])&=[@$i[2]@]& +[$fname]([@$a[3]@])&=[@$i[3]@] +\end{aligned}`] + +Write [`[$fname]`] as a set of ordered pairs. [@KeyboardInstructions('Remember that a _set_ is written with [|{|]* and [|}|]* surrounding the list.')@]** + + [____________________] + +[`[$fname]`] has domain [____________________] and range [____________________]. + +END_PGML + + +############################################## + +ANS($pairs->cmp(showEqualErrors=>0)); +ANS($domain->cmp); +ANS($range->cmp); + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions12.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions12.pg new file mode 100644 index 0000000000..c6691329a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions12.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + +Context("Fraction"); +$b = non_zero_random(-2,2,1); +$n = non_zero_random(-1,1,1); +$d = random(1,4,1); +$m = Fraction("$n","$d"); + +Context("Numeric"); +$f = Formula("$m *x + $b"); + +$x1 = random(-3,0,1); +$x2 = random(1,3,1); + +Context()->flags->set(tolType=>absolute,tolerance=>0.07); + +$y1 = $f->eval(x=>$x1); +$y2 = $f->eval(x=>$x2); + + +$xmin = -5; +$xmax = 5; +$ymin = -5; +$ymax = 5; + + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[240,240] +); + + $gr->lb('reset'); + for my $j (-4..4) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label($j,0, $j,'black','center','top','large')); + } + + for my $j (-4..4) { + if (abs($j)<10**(-10)) {next;} + $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); + } + + $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); + $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); + + @xvalues = num_sort($xmin,$xmax,($ymin-$b)/$m,($ymax-$b)/$m); + $midx = ($xvalues[1]+$xvalues[2])/2; + $midy = $m*$midx+$b; + $gr->moveTo($midx,$midy); + $gr->arrowTo($xvalues[1],$m*$xvalues[1]+$b,'blue',1); + $gr->moveTo($midx,$midy); + $gr->arrowTo($xvalues[2],$m*$xvalues[2]+$b,'blue',1); + + + +$ALT = "a graph of a line with y-intercept $b and slope $m"; + +############################################## + + +BEGIN_PGML +Use the graph of [`[$fname]`] below to evaluate the given expressions. (Estimates are OK.) + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'") @]*<< + + +a. [`[$fname]([$x1])={}`][_____]{$y1->cmp(tolType=>absolute, tolerance=>0.1)} + +a. [`[$fname]([$x2])={}`][_____]{$y2->cmp(tolType=>absolute, tolerance=>0.1)} + + +END_PGML + + +############################################## + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions13.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions13.pg new file mode 100644 index 0000000000..c6a392e69f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions13.pg @@ -0,0 +1,115 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + +Context("Numeric"); +$a = non_zero_random(1,3,1); +$q = random(2,4,1); +$s = random(0,$q); + + +$f = Formula("$a sin(2*pi*(x-$s)/(4*$q))"); + +do{ +$x1 = $s-random(1,3)*$q; +$x2 = $s+random(0,3)*$q; + +$y1 = $f->eval(x=>$x1); +$y2 = $f->eval(x=>$x2); +} until ($y1 != $y2); + +$xmin = min($x1-2,-5); +$xmax = max($x2+3,5); +$ymin = -5; +$ymax = 5; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + minor xtick = {$xmin,...,$xmax}, + trig format plots=rad, + ] + \addplot+[domain=$xmin:$xmax, smooth] {$f}; + \legend{\(y=$fname(x)\)}; +\end{axis} +END_TIKZ + + + +$peak = $q+$s; +$trough = $peak+$q; + +$ALT = "a graph of a wave moving up and down as we read it left to right; there is a peak at ($peak,$a) and then the first trough after that is at ($trough,-$a)"; + +############################################## + +BEGIN_PGML +Use the graph of [`[$fname]`] below to evaluate the given expressions. (Estimates are OK.) + +[@EnlargeImageStatementPGML()@]** + +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + + +a. [`[$fname]([$x1])={}`][_____]{$y1->cmp(tolType=>absolute, tolerance=>0.1)} + +a. [`[$fname]([$x2])={}`][_____]{$y2->cmp(tolType=>absolute, tolerance=>0.1)} + + +END_PGML + + +############################################## + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions14.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions14.pg new file mode 100644 index 0000000000..f2eb5ece4b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions14.pg @@ -0,0 +1,131 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGML.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + +Context("Numeric"); +$a = random(-1,1,2); +$h = non_zero_random(-4,4,1); +$k = -random(0,2,1)*$a; + + +$f = Formula("$a (x-$h)^2+$k"); + +do{ +$x1 = $h-random(0,3,1); +$x2 = $h+random(1,3,1); + +$y1 = $f->eval(x=>$x1); +$y2 = $f->eval(x=>$x2); +} until ($y1 != $y2); + +$xmin = -10; +$xmax = 10; +$ymin = -10; +$ymax = 10; + + +@xvalues = ($xmin,$xmax); +if ($a > 0) { + push(@xvalues,sqrt(($ymax-$k)/$a)+$h); + push(@xvalues,-sqrt(($ymax-$k)/$a)+$h); +} +else { + push(@xvalues,sqrt(($ymin-$k)/$a)+$h); + push(@xvalues,-sqrt(($ymin-$k)/$a)+$h); +} +@xvalues = num_sort(@xvalues); +$start = $xvalues[1]; +$stop = $xvalues[2]; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + ] + \addplot+[domain=$start:$stop, smooth] {$a*(x-$h)^2+$k}; + \legend{\(y=$fname(x)\)}; +\end{axis} +END_TIKZ + + +$direction = ($a == 1) ? "upward" : "downward"; +$yint = $f->eval(x=>0); + +$ALT = "a graph of a parabola opening $direction with vertex at ($h,$k) and passing through (0,$yint)"; + + +############################################## + +BEGIN_PGML +Use the graph of [`[$fname]`] below to evaluate the given expressions. (Estimates are OK.) + +[@EnlargeImageStatementPGML()@]** + +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + + +a. [`[$fname]([$x1])={}`][_____]{$y1->cmp(tolType=>absolute, tolerance=>0.1)} + +a. [`[$fname]([$x2])={}`][_____]{$y2->cmp(tolType=>absolute, tolerance=>0.1)} + + +END_PGML + + +############################################## + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions15.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions15.pg new file mode 100644 index 0000000000..a28e820906 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions15.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + +Context("Numeric"); +$s = random(1,5,1); +$x[0] = Real(random(-2*$s+1,1,1)); +for my $i (1..4) { +$x[$i] = $x[$i-1]+$s; +} + +for my $i (0..4) { +Real($y[$i] = Real(random(-2,10,0.1))); +} + + +$j1 = random(0,2); +$j2 = random(3,4); + +$x1 = $x[$j1]; +$x2 = $x[$j2]; + +$y1 = $y[$j1]; +$y2 = $y[$j2]; + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Use the table of values for \($fname\) below to evaluate the given expressions. + +$PAR + +\{ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow(["\(x\)","\($x[0]\)","\($x[1]\)","\($x[2]\)","\($x[3]\)","\($x[4]\)"], align=>RIGHT, separation=>0). +AlignedRow(["\($fname(x)\)","\($y[0]\)","\($y[1]\)","\($y[2]\)","\($y[3]\)","\($y[4]\)"], align=>RIGHT, separation=>0). +EndTable() +\} + +END_TEXT +Context()->normalStrings; + +BEGIN_PGML + +a. [`[$fname]([$x1])={}`][_____]{Compute($y1)->cmp} + +a. [`[$fname]([$x2])={}`][_____]{Compute($y2)->cmp} + + + +END_PGML + + +############################################## + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions16.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions16.pg new file mode 100644 index 0000000000..25549ce978 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions16.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "PGML.pl", + "PCCmacros.pl", + "parserAssignment.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + +Context("Numeric"); + +@numberWord = ("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve"); +@multiplyBy = ("", "", "double", "triple", "quadruple"); +@raiseTo = ("", "", "square", "cube"); +@RaiseTo = ("", "", "Square", "Cube"); + +$i = random(2,3,1); + +$f = Formula("x^($i)"); + +Context("LimitedNumeric"); +for my $i (0..4) { +$y[$i] = Compute($f->eval(x=>$i)); + +} + +$raisetoi = $RaiseTo[$i]; + +Context("Numeric"); +parser::Assignment->Allow; +parser::Assignment->Function("$fname"); +$formula = Formula("$fname(x)=$f"); + +############################################## + +BEGIN_PGML +Here is a verbal description of a function [`[$fname]`]. + +"[$raisetoi] the input [`x`] to obtain the output [`y`]." + +a. Give a numeric representation of [`[$fname]`]. +[@ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow([general_math_ev3('x'),general_math_ev3('0'),general_math_ev3('1'),general_math_ev3('2'),general_math_ev3('3'),general_math_ev3('4')], align=>LEFT, separation=>0). +AlignedRow([general_math_ev3("$fname(x)"), ans_rule(1), ans_rule(1),ans_rule(1),ans_rule(1),ans_rule(1),], align=>RIGHT, separation=>0). +EndTable() +@]* + + +a. Give a formula for [`[$fname]`]. + [@KeyboardInstructions(qw!Include the function's name and an equals sign in the formula.!)@]** + + [__________] + +END_PGML + + +############################################## + +for my $i (0..4) { +ANS($y[$i]->cmp); +} +ANS($formula->cmp); + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions17.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions17.pg new file mode 100644 index 0000000000..fa117da356 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions17.pg @@ -0,0 +1,106 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "PGML.pl", + "PCCmacros.pl", + "parserAssignment.pl", + "PGcourse.pl", + +); + + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + +Context("Numeric"); + +@multiplyBy = ("", "", "double", "triple", "quadruple"); +@MultiplyBy = ("", "", "Double", "Triple", "Quadruple"); +@raiseTo = ("", "", "square", "cube"); +@RaiseTo = ("", "", "Square", "Cube"); + +$i = random(2,4,1); +$j = random(2,12,1); + +$f = Formula("$i x-$j"); + +Context("LimitedNumeric"); +for my $i (0..4) { +$y[$i] = Compute($f->eval(x=>$i)); + +} + +$multiplybyi = $MultiplyBy[$i]; + +Context("Numeric"); +parser::Assignment->Allow; +parser::Assignment->Function("$fname"); +$formula = Formula("$fname(x)=$f"); + +############################################## + +BEGIN_PGML +Here is a verbal description of a function [`[$fname]`]. + +"[$multiplybyi] the input [`x`] and then subtract [@numberWord($j)@] to obtain the output [`y`]." + +a. Give a numeric representation of [`[$fname]`]: +[@ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow([general_math_ev3('x'),general_math_ev3('0'),general_math_ev3('1'),general_math_ev3('2'),general_math_ev3('3'),general_math_ev3('4')], align=>LEFT, separation=>0). +AlignedRow([general_math_ev3("$fname(x)"), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1)], align=>RIGHT, separation=>0). +EndTable() +@]* + + +a. Give a formula for [`[$fname]`]. + [@KeyboardInstructions(qw!Include the function's name and an equals sign in the formula.!)@]** + + [__________] + +END_PGML + + + +############################################## + +for my $i (0..4) { +ANS($y[$i]->cmp); +} +ANS($formula->cmp); + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions18.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions18.pg new file mode 100644 index 0000000000..b47380b069 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions18.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + +Context("Numeric"); + +$a = random(1,2,1); +$b = random(2,3,1); +$c = random(2,3,1); + +Context()->flags->set(reduceConstants=>0); +$f1 = Formula("$a x^($b)")->reduce; +$f2 = Formula("x^($b-1)")->reduce; +$f = Formula("$f1-1/$c*$f2"); + +Context("Fraction-NoDecimals"); +for my $i (0..6) { +$x[$i] = $i-3; +$y[$i] = Fraction("$a ($x[$i])^($b)-1/$c*($x[$i])^($b-1)"); +} + +Context()->operators->undefine('+','-','*','^'); +for my $i (0..6) { +$y[$i] = Compute($y[$i]); +} +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Express the function \($fname\) numerically with the table. + +\[$fname(x) = $f\] + +$PAR + +\{ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow(["\(x\)","\($x[0]\)","\($x[1]\)","\($x[2]\)","\($x[3]\)","\($x[4]\)","\($x[5]\)","\($x[6]\)"], align=>LEFT, separation=>0). +AlignedRow(["\($fname(x)\)", ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1)], align=>LEFT, separation=>0). +EndTable() +\} + +$PAR + +On graphing paper, you should be able to give a graphical representation of \($fname\) too. + + +END_TEXT + +Context()->normalStrings; + +############################################## + +for my $i (0..6) { +ANS($y[$i]->cmp); +} + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions19.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions19.pg new file mode 100644 index 0000000000..0cc66522e4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions19.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + +Context("Numeric"); + +$a = random(1,8,1); +$b = random(4,8,1); + + +Context()->flags->set(reduceConstants=>0); +$f = Formula("($a-x)/($b+x)"); + +Context("Fraction"); +for my $i (0..6) { +$x[$i] = $i-3; +$y[$i] = Fraction("($a-$x[$i])/($b+$x[$i])"); +} + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Express the function \($fname\) numerically with the table. + +\[$fname(x) = $f\] + +$PAR + +\{ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow(["\(x\)","\($x[0]\)","\($x[1]\)","\($x[2]\)","\($x[3]\)","\($x[4]\)","\($x[5]\)","\($x[6]\)"], align=>LEFT, separation=>0). +AlignedRow(["\($fname(x)\)", ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1), ans_rule(1)], align=>RIGHT, separation=>0). +EndTable() +\} + +$PAR + +On graphing paper, you should be able to give a graphical representation of \($fname\) too. + + +END_TEXT + +Context()->normalStrings; + +############################################## + +for my $i (0..6) { +ANS($y[$i]->cmp); +} + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions20.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions20.pg new file mode 100644 index 0000000000..d54836f84a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions20.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + +Context("Numeric"); +$r[0] = random(-3,0,1); +$s = random(2,3,1); +$r[1] = $r[0]+$s; +$r[2] = $r[1]+$s; + +$a = 1; +$b = -($r[0]+$r[1]+$r[2]); +$c = $r[0]*$r[1]+$r[0]*$r[2]+$r[1]*$r[2]; +$d = -$r[0]*$r[1]*$r[2]; + +$f = Formula("$a x^3+$b x^2+$c x + $d"); +$crit = (-2*$b+sqrt(4*$b**2-12*$a*$c))/(6*$a); + +$peak = random(2,5,1); +$ch = $f->eval(x=>$crit); +$f = $f*$peak/$ch; + +Context("Interval"); +$domain = Interval("[$r[0],$r[2])"); +$range = Interval("[-$peak,$peak]"); + + +$xmin = min(-5,$r[0]-3); +$xmax = max(5,$r[2]+3); +$ymin = -$peak-3; +$ymax = $peak+3; + + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+[-,domain=$r[0]:$r[2],samples=50] {($a*x^3+$b*x^2+$c*x + $d)*$peak/$ch}; + \addplot[soliddot] coordinates {($r[0],0)}; + \addplot[hollowdot] coordinates {($r[2],0)}; +\end{axis} +END_TIKZ + +$starty = $f->eval(x=>$r[0]); +$endy = $f->eval(x=>$r[2]); + +$ALT = "a graph of a wave that starts at ($r[0],$starty), moves down and right to a height of -$peak, then moves up and right to a height of $peak, and then turns back downward ending at ($r[2],$endy); ($r[0],$starty) has a filled dot and ($r[2],$endy) has a hollow dot"; +############################################## + +BEGIN_PGML + +A function is graphed. + +[@EnlargeImageStatementPGML()@]** + +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + +[@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** + + The function has domain [__________]{$domain} and range [__________]{$range}. + + +END_PGML + + +############################################## + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions21.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions21.pg new file mode 100644 index 0000000000..91502d5812 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions21.pg @@ -0,0 +1,122 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + + +Context("Numeric"); +$h = random(-2,4,1); +$k = random(-4,2,1); + +$f = Formula("(x-$h)**2/4+$k"); + +$left = $h-2; +$right = $h+4; + + +Context("Interval"); +$domain = Interval("[$left,$right]"); +$upper = $f->eval(x=>$right); +$range = Interval("[$k,$upper]"); + + +$xmin = min(-5,$h-3); +$xmax = max(5,$h+6); +$ymin = -5; +$ymax = 10; + + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[240,240] +); + + $gr->lb('reset'); + for my $j ($xmin+1..$xmax-1) { + if (abs($j)<10**(-10) or $j%2 != 0) {next;} + $gr->lb( new Label($j, 0, $j,'black','center','top','large')); + } + + for my $j ($ymin+1..$ymax-1) { + if (abs($j)<10**(-10) or $j%2 != 0) {next;} + $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); + } + + $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); + $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); + +add_functions($gr, "$f for x in <$left,$right>" . + " using color:blue and weight:1"); +$gr->stamps( closed_circle($left,$f->eval(x=>$left),'blue') ); +$gr->stamps( closed_circle($right,$f->eval(x=>$right),'blue') ); + +$starty = $f->eval(x=>$left); +$endy = $f->eval(x=>$right); + +$ALT = "a graph of a curve that starts at ($left,$starty), moves down and right to ($h,$k), and then moves up and right to a ($right,$endy); ($left,$starty) has a filled dot and ($right,$endy) also has a filled dot"; + +############################################## + +BEGIN_PGML + +A function is graphed. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + + [@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** + + The function has domain [__________]{$domain} and range [__________]{$range}. + + + +END_PGML + +############################################## + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions22.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions22.pg new file mode 100644 index 0000000000..fb83944180 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions22.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + + +Context("Numeric"); +$x[0] = random(-3,-1,1); +$x[1] = $x[1] + random(2,4,1); +$x[2] = $x[1] + random(2,4,1); + +$y[0] = random(-2,2,1); +$y[1] = $y[0]+random(1,5,1); +$y[2] = $y[0]-random(1,2,1); + +Context("Interval"); +$domain = Interval("(-inf,inf)"); +$range = Interval("[$y[2],inf)"); + + +$xmin = min(-5,$x[0]-3); +$xmax = max(5,$x[2]+3); +$ymin = min(-5,$y[2]-2); +$ymax = $y[1]+4; + + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[240,240] +); + + $gr->lb('reset'); + for my $j ($xmin+1..$xmax-1) { + if (abs($j)<10**(-10) or $j%2 != 0) {next;} + $gr->lb( new Label($j, 0, $j,'black','center','top','large')); + } + + for my $j ($ymin+1..$ymax-1) { + if (abs($j)<10**(-10) or $j%2 != 0) {next;} + $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); + } + + $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); + $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); + +$gr->moveTo($x[0],$y[0]); +$gr->arrowTo($xmin+1,$ymax,'blue','1'); +$gr->moveTo($x[0],$y[0],); +$gr->lineTo($x[1],$y[1],'blue','1'); +$gr->lineTo($x[2],$y[2],'blue','1'); +$gr->arrowTo($xmax-0.5,$ymax,'blue','1'); + +$ALT = "a graph of a curve resembling the letter W, except that arrows indicate the arms of the W extend forever up and to the left, and up and to the right; the corners of the W are at ($x[0],$y[0]), ($x[1],$y[1]), and ($x[2],$y[2])"; + +############################################## + +BEGIN_PGML + +A function is graphed. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + + [@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** + + The function has domain [__________]{$domain} and range [__________]{$range}. + + +END_PGML + +############################################## + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Functions/Functions23.pg b/OpenProblemLibrary/PCC/Math95/Functions/Functions23.pg new file mode 100644 index 0000000000..3882f9aecd --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Functions/Functions23.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + +Context("Numeric"); + +$a = random(1,2,1); +$b = random(2,3,1); +$c = random(2,3,1); + +Context()->flags->set(reduceConstants=>0); +$f1 = Formula("$a x^($b)")->reduce; +$f2 = Formula("x^($b-1)")->reduce; +$f = Formula("$f1-1/$c*$f2"); + +Context("Fraction-NoDecimals"); +for my $i (0..6) { +$x[$i] = $i-3; +$y[$i] = Fraction("$a ($x[$i])^($b)-1/$c*($x[$i])^($b-1)"); +} + +Context()->operators->undefine('+','-','*','^'); +for my $i (0..6) { +$y[$i] = Compute($y[$i]); +} +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Express the function \($fname\) numerically with the table. + +\[$fname(x) = $f\] + +$PAR + +\{ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow(["\(x\)","\($x[0]\)","\($x[1]\)","\($x[2]\)","\($x[3]\)","\($x[4]\)","\($x[5]\)","\($x[6]\)"], align=>LEFT, separation=>0). +AlignedRow(["\($fname(x)\)", ans_rule(3), ans_rule(3), ans_rule(3), ans_rule(3), ans_rule(3), ans_rule(3), ans_rule(3)], align=>LEFT, separation=>0). +EndTable() +\} + +$PAR + +On graphing paper, you should be able to give a graphical representation of \($fname\) too. + + +END_TEXT + +Context()->normalStrings; + +############################################## + +for my $i (0..6) { +ANS($y[$i]->cmp); +} + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving1.pg b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving1.pg new file mode 100644 index 0000000000..b7a9399f3a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving1.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "contextFraction.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +@numWord = ('zero', 'one', 'two' ,'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve'); +@NumWord = ('Zero', 'One', 'Two' ,'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven'); + +@opSign = ('+', '-', '*', '/'); + +# x opWordSign y = x % y +@opWordSign = ('plus', 'minus', 'times', 'divided by'); +# the opWordResult x and y is x % y +@opWordResult = ('sum of', 'difference between', 'product of', 'quotient of'); +# x opWordPPBy by y = x % y +@opWordPPBy = ('increased', 'decreased', 'multiplied', 'divided'); +# x opWordPPAlt opWordPpos y = y % x +@opWordPPAlt = ('added', 'subtracted', 'multiplied', 'divided'); +@opWordPpos = ('to', 'from', 'by', 'into'); +# x opWordComp y = y % x +$opWordComp = ('more than', 'less than', 'scaled by', 'divided by'); + + + +@eqWord = ('equals', 'is', 'gives', 'yields'); + + +$a = non_zero_random(2,20,1)*random(-1,1,2); +$b = non_zero_random(-20,20,1); +while ($a == $b) {$b = non_zero_random(-20,20,1);} + +$opindex = random(0,3,1); +$opindex2 = $opindex+2*(-1)**floor($opindex/2); + +$eqindex = random(0,3,1); + + +Context("Fraction"); +if ($opindex == 0) +{$ans = Fraction("$b-$a","1");} +if ($opindex == 1) +{$ans = Fraction("$a-$b","1");} +if ($opindex == 2) +{$ans = Fraction("$b","$a");} +if ($opindex == 3) +{$ans = Fraction("$a","$b");} + +Context("LimitedFraction"); +$ans = Compute("$ans"); + +Context()->flags->set(showMixedNumbers=>0); + +$ans = Compute("$ans"); + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +The $opWordResult[$opindex] \($a\) and number $eqWord[$eqindex] \($b\). What is the number? + +$BBLOCKQUOTE +The number is \{ans_rule(10)\} +$EBLOCKQUOTE + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp() ); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving2.pg b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving2.pg new file mode 100644 index 0000000000..4b6408d6bc --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving2.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "contextFraction.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +@numWord = ('zero', 'one', 'two' ,'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve'); +@NumWord = ('Zero', 'One', 'Two' ,'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven'); + +@opSign = ('+', '-', '*', '/'); + +# x opWordSign y = x % y +@opWordSign = ('plus', 'minus', 'times', 'divided by'); +# the opWordResult x and y is x % y +@opWordResult = ('sum of', 'difference between', 'product of', 'quotient of'); +# x opWordPPBy by y = x % y +@opWordPPBy = ('increased', 'decreased', 'multiplied', 'divided'); +# x opWordPPAlt opWordPpos y = y % x +@opWordPPAlt = ('added', 'subtracted', 'multiplied', 'divided'); +@opWordPpos = ('to', 'from', 'by', 'into'); +# x opWordComp y = y % x +$opWordComp = ('more than', 'less than', 'scaled by', 'divided by'); + + + +@eqWord = ('equals', 'is', 'gives', 'yields'); + + +$a = non_zero_random(2,20,1)*random(-1,1,2); +$b = non_zero_random(-20,20,1); +while ($a == $b) {$b = non_zero_random(-20,20,1);} + +$opindex = random(0,3,1); +$opindex2 = $opindex+2*(-1)**floor($opindex/2); + +$eqindex = random(0,3,1); + + +Context("Fraction"); +if ($opindex == 0) +{$ans = Fraction("$a","$b-1");} +if ($opindex == 1) +{$ans = Fraction("$a*$b","$b-1");} +if ($opindex == 2) +{$ans = Fraction("$b","$a-1");} +if ($opindex == 3) +{$ans = Fraction("$a*$b","$a-1");} + +Context("LimitedFraction"); +$ans = Compute("$ans"); + +Context()->flags->set(showMixedNumbers=>0); + +$ans = Compute("$ans"); + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +A number $opWordPPBy[$opindex] by \($a\) $eqWord[$eqindex] that number $opWordSign[$opindex2] \($b\). What is the number? + +$BBLOCKQUOTE +The number is \{ans_rule(10)\} +$EBLOCKQUOTE + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp() ); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving3.pg b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving3.pg new file mode 100644 index 0000000000..9871bef6a5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving3.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "parserNumberWithUnits.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +@numWord = ('zero', 'one', 'two' ,'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve'); +@NumWord = ('Zero', 'One', 'Two' ,'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven'); + +@opSign = ('+', '-', '*', '/'); + +# x opWordSign y = x % y +@opWordSign = ('plus', 'minus', 'times', 'divided by'); +# the opWordResult x and y is x % y +@opWordResult = ('sum of', 'difference between', 'product of', 'quotient of'); +# x opWordPPBy by y = x % y +@opWordPPBy = ('increased', 'decreased', 'multiplied', 'divided'); +# x opWordPPAlt opWordPpos y = y % x +@opWordPPAlt = ('added', 'subtracted', 'multiplied', 'divided'); +@opWordPpos = ('to', 'from', 'by', 'into'); +# x opWordComp y = y % x +$opWordComp = ('more than', 'less than', 'scaled by', 'divided by'); + + + +@eqWord = ('equals', 'is', 'gives', 'yields'); + + +$n = random(8,15,1); +$d = random(3,12,1); +$m = $n+$d; + +$p = 2*$n+2*$m; + +$dUnits = NumberWithUnits("$d","ft"); +$pUnits = NumberWithUnits("$p","ft"); + +$nUnits = NumberWithUnits("$n","ft"); +$mUnits = NumberWithUnits("$m","ft"); + +$perimeter = 2*$n+2*$m; + + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +A room is $numWord[$d] \(\mathrm{ft}\) longer than it is wide. If the perimeter is \($pUnits\), what are the dimensions of the room? + +$BBLOCKQUOTE +The room is \{ans_rule(10)\} wide and \{ans_rule(10)\} long. +$EBLOCKQUOTE + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $nUnits->cmp() ); +ANS( $mUnits->cmp() ); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving4.pg b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving4.pg new file mode 100644 index 0000000000..849f726d4c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving4.pg @@ -0,0 +1,69 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + + +); + +TEXT(beginproblem()); +############################################## + +Context("Currency"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); + +$realinit = random(50000,60000,1000); +$initial = Currency($realinit); +$pctintrate1 = random(12,15,1); +$pctintrate2 = random(5,8,1); +$intrate1 = $pctintrate1/100; +$intrate2 = $pctintrate2/100; +$interest = Currency(random(5000,6000,100)); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Your grandmother needs your help. She has \($initial\) to invest. Part of this money is to be invested in noninsured bonds paying \($pctintrate1\)$PERCENT annual interest. The rest of this money is to be invested in a government-insured certificate of deposit paying \($pctintrate2\)$PERCENT annual interest. She told you that she requires a total of \($interest\) per year in extra income from these investments. How much money should be placed in each investment? Your answers need to be within $DOLLAR\(\)100 of correct. + +$PAR + + + + + +$BBLOCKQUOTE +$PAR +She should invest \{ans_rule(10)\} at \($pctintrate1\)$PERCENT and \{ans_rule(10)\} at \($pctintrate2\)$PERCENT. + +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers=1; + +Context()->flags->set(tolerance=>100); +ANS( Compute(($interest-$initial*$intrate2)/($intrate1-$intrate2)) -> cmp); +ANS( Compute($initial-($interest-$initial*$intrate2)/($intrate1-$intrate2)) -> cmp); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving5.pg b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving5.pg new file mode 100644 index 0000000000..2ff0a54afa --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving5.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +@numWord = ('zero', 'one', 'two' ,'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve'); +@NumWord = ('Zero', 'One', 'Two' ,'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven'); + +@opSign = ('+', '-', '*', '/'); + +# x opWordSign y = x % y +@opWordSign = ('plus', 'minus', 'times', 'divided by'); +# the opWordResult x and y is x % y +@opWordResult = ('sum of', 'difference between', 'product of', 'quotient of'); +# x opWordPPBy by y = x % y +@opWordPPBy = ('increased', 'decreased', 'multiplied', 'divided'); +# x opWordPPAlt opWordPpos y = y % x +@opWordPPAlt = ('added', 'subtracted', 'multiplied', 'divided'); +@opWordPpos = ('to', 'from', 'by', 'into'); +# x opWordComp y = y % x +$opWordComp = ('more than', 'less than', 'scaled by', 'divided by'); + + + +@eqWord = ('equals', 'is', 'gives', 'yields'); + + +$n = random(15,100,1); +$m = random(3,5,1); + +$total = $n*$m+($m)*($m-1)/2; + +$ans = "$n"; +for my $i (1..$m-1) +{$ans = $ans.",$n+$i";} + +$ans = List("$ans"); + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +The sum of $numWord[$m] consecutive integers is \($total\). What are the integers? + +$BBLOCKQUOTE +The numbers are \{ans_rule(10)\}$BR(Enter the numbers as a list separated by commas.) +$EBLOCKQUOTE + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp() ); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving6.pg b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving6.pg new file mode 100644 index 0000000000..05847d8a1a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving6.pg @@ -0,0 +1,65 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + +); + +TEXT(beginproblem()); +############################################## + +Context("Numeric"); + + +$dist = random(250,400,5); +$speed1 = random(45,70,5); +$speed2 = random(45,70,5); +while ($speed1 == $speed2) {$speed2 = random(45,70,5);} + +$time = Compute("$dist/($speed1+$speed2)"); + +$ans = NumberWithUnits("$time","hr"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Two cities are \($dist\) miles apart. A car leaves one of the cities traveling toward the second city at \($speed1\) miles per hour. At the same time, a bus leaves the second city bound for the first city at \($speed2\) miles per hour. How long will it take before they meet? (Use $BBOLD hr$EBOLD for hours.) + +$PAR + + + +$BBLOCKQUOTE +$PAR +It will take \{ans_rule(10)\} for them to meet. + +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +Context()->flags->set(tolType=>absolute,tolerance=>0.1); +ANS($ans->cmp); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving7.pg b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving7.pg new file mode 100644 index 0000000000..88907cddeb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/IntroProblemSolving/IntroProblemSolving7.pg @@ -0,0 +1,64 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + +TEXT(beginproblem()); +############################################## + +Context("Numeric"); + + +$pct1 = random(45,50,1); +$realpct1 = $pct/100; +$pct2 = random(15,25,1); +$realpct2 = $pct2/100; +$pct3 = 40; +$realpct3 = $pct3/100; +$volume = Compute("80"); + +$ans = ($realpct3-$realpct2)*$volume/($realpct1-$realpct3); +$ans = Compute("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +How many oz of a \($pct1\)$PERCENT alcohol solution must be mixed with \($volume\) oz of a \($pct2\)$PERCENT alcohol solution to make a \($pct3\)$PERCENT alcohol solution? +$PAR + + + + +$BBLOCKQUOTE +$PAR +\{ans_rule(10)\} oz of \($pct1\)$PERCENT alcohol solution must be mixed with \($volume\) oz of \($pct2\)$PERCENT alcohol solution to make \($pct3\)$PERCENT alcohol solution. + +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($ans->cmp); + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearEquationApplications/LinearEquationApplications1.pg b/OpenProblemLibrary/PCC/Math95/LinearEquationApplications/LinearEquationApplications1.pg new file mode 100644 index 0000000000..e29ba1a0fc --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearEquationApplications/LinearEquationApplications1.pg @@ -0,0 +1,69 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context("Numeric")->variables->are(t=>"Real"); +parser::Assignment->Allow; +parser::Assignment->Function("P"); + + + +$start = random(1970,1990,1); +$initial = random(100,130,1); +$today = random(2005,2010,1); +$popnow = $initial + random(20,50,1); + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +In a certain country in $start, the population was $initial million people. By $today, the population had risen to $popnow million. + +$PAR + +Using the identification that \(t=0\) corresponds to $start, find a linear model for this country's population. That is, find the formula for the population \(t\) years after $start. Your answer should be in the form \(P(t)=...\) $PAR + +$BBLOCKQUOTE + +\{ ans_rule(30) \} + +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +$slope = ($popnow-$initial)/($today-$start); + +ANS( Formula("P(t)=$slope t + $initial")->cmp() ); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations1.pg b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations1.pg new file mode 100644 index 0000000000..1df78289d0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations1.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "unionTables.pl", + "PGstandard.pl", + "MathObjects.pl", + "parserRadioButtons.pl", + +); + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +Context()->variables->add(y=>"Real"); + + +$left = Compute("y"); +$a = random(2,10,1); +$b = random(-10,10,1); +$right = Compute("$a x+$b")->reduce; + +$x[0] = random(-5,5,1); +$x[1] = $x[0]+random(3,10,1); +$x[2] = $x[1]+random(2,5,1); + +$on = 'This point is on the line.'; +$off = 'This point is not on the line.'; + + +for my $i (0..2) { +$y[$i] = $right->eval(x=>$x[$i])+random(-1,1,1); +if ($right->eval(x=>$x[$i]) eq $y[$i]) {$ans[$i] = "$on";} +else {$ans[$i] = "$off";}; + +$radio[$i] = RadioButtons( + ["$on","$off"], + $ans[$i], # correct answer + last => ["$on","$off"], # can be a list +); +} + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + + +Determine whether each point lies of the given line. +$PAR + + +$BBLOCKQUOTE + +\($left = $right \) +$PAR + +\{ +BeginTable(border=>0, tex_border=>"0pt", spacing=>0, padding=>4,center=>0). +AlignedRow(["\(($x[0],$y[0]) \)", $radio[0]->buttons() ], align=>RIGHT, separation=>0). +AlignedRow(["\(($x[1],$y[1]) \)", $radio[1]->buttons() ], align=>RIGHT, separation=>0). +AlignedRow(["\(($x[2],$y[2]) \)", $radio[2]->buttons() ], align=>RIGHT, separation=>0). +EndTable() +\} + +$EBLOCKQUOTE + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 0; + +for my $i (0..2) { +ANS( $radio[$i]->cmp() ); +} + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations2 b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations2 new file mode 100644 index 0000000000..8b7660ee1a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations2 @@ -0,0 +1,104 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "unionTables.pl", + "PGstandard.pl", + "MathObjects.pl", + + "parserMultiAnswer.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->variables->add(y=>"Real"); +Context()->strings->add("answers"=>{},"vary"=>{}); + + +$a = random(1,10,1); +$b = random(-10,10,1); +$left = Compute("y"); +$right = Compute("$a x+$b")->reduce; + + +$multians = MultiAnswer("answers","vary","answers","vary","answers","vary","answers","vary","answers","vary")->with( + singleResult => 1, checkTypes =>0, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $x1stu, $y1stu, $x2stu, $y2stu, $x3stu, $y3stu, $x4stu, $y4stu, $x5stu, $y5stu ) = @{$student}; + my $y1 = $right->eval(x=>$x1stu); + my $y2 = $right->eval(x=>$x2stu); + my $y3 = $right->eval(x=>$x3stu); + my $y4 = $right->eval(x=>$x4stu); + my $y5 = $right->eval(x=>$x5stu); + if ( ($y1 == $y1stu) && + ($y2 == $y2stu) && + ($y3 == $y3stu) && + ($y4 == $y4stu) && + ($y5 == $y5stu) && + ((($x1stu-$x2stu)*($x1stu-$x3stu)*($x1stu-$x4stu)*($x1stu-$x5stu)*($x2stu-$x3stu)*($x2stu-$x4stu)*($x2stu-$x5stu)*($x3stu-$x4stu)*($x3stu-$x5stu)*($x4stu-$x5stu)) != 0) ) + { + return 1; + } else { + return 0; + + }; + } +); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Find five points on the line with the given equation. + +$PAR + +$SPACE $SPACE $SPACE \($left = $right \) + +$PAR + +\{ +BeginTable(border=>0, tex_border=>"0pt", spacing=>0, padding=>4,center=>0). +AlignedRow(["\(x \)","\(y\)"], separation=>0). +AlignedRow([$multians->ans_rule(4),$multians->ans_rule(4)], separation=>0). +AlignedRow([$multians->ans_rule(4),$multians->ans_rule(4)], separation=>0). +AlignedRow([$multians->ans_rule(4),$multians->ans_rule(4)], separation=>0). +AlignedRow([$multians->ans_rule(4),$multians->ans_rule(4)], separation=>0). +AlignedRow([$multians->ans_rule(4),$multians->ans_rule(4)], separation=>0). +EndTable() +\} + + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $multians->cmp() ); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations2.pg b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations2.pg new file mode 100644 index 0000000000..1e19b11983 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations2.pg @@ -0,0 +1,249 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "parserPopUp.pl", + "contextFraction.pl", + +); + + +$refreshCachedImages = 1; +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$a = random(1,5,1); #The coefficients +$b = random(max(1,$a-2),$a+2)*random(-1,1,2); +$c = random(0,7,1)*abs($b); + +$slope = Fraction("-$a","$b"); +$intercept = Fraction("$c","$b"); + +Context()->variables->add(y=>'Real'); +Context()->reduction->set('(-x)-y'=>0); #So that the displayed equations +Context()->reduction->set('(-x)+y'=>0); #will look as intended + +$left=Compute("y")->reduce; #The displayed equation +$right=Compute("$slope x + $intercept")->reduce; + + +Context("Numeric"); + + + + + + + +@a = ($a); #There will be an array of images +@b = ($b); #with the first image the correct +@c = ($c); #one, and all of the others not. + #These arrays will hold the + #parameters for the graphs + +#Second graph is vertically flipped about x-axis +$a[1] = $a[0]; +$b[1] = -$b[0]; +$c[1] = $c[0]; + +#Third and fourth are first and second, flipped about y-axis +for ( my $k=2; $k<4; $k++ ) { + $a[$k] = -$a[$k-2]; + $b[$k] = $b[$k-2]; + $c[$k] = $c[$k-2]; + } + +#Next four are first four reflected across y=x. If the slope is 1 or -1, the value of c is changed to produce distinct new graphs. + +$shift = 0; +if (($a/$b)**2 == 1) {$shift = 2;} + +for ( my $k=4; $k<8; $k++ ) { + $a[$k] = $b[$k-4]; + $b[$k] = $a[$k-4]; + $c[$k] = $c[$k-4]+$shift; + } + +#Remaining eight are first eight, scaled by 1/2 about the y-axis +for ( my $k=8; $k<16; $k++ ) { + $a[$k] = $a[$k-8]; + $b[$k] = $b[$k-8]*2; + $c[$k] = $c[$k-8]; + } + + + + + + +$xmin = -10; #The viewing window +$xmax = 10; +$ymin = -10; +$ymax = 10; + + +@graphs = (); #The array of graphs we will create + + +# Start making the graphs + +for ( my $i=0; $i<16; $i++ ) { + + +# Background + + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + +# Labels + + $graphs[$i]->lb( new Label(4.7,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,4.7,'y','black','center','middle')); + + + + + + + +# Graph the lines. + +add_functions($graphs[$i], "-$a[$i]/$b[$i]*x+$c[$i]/$b[$i] for x in <$xmin,$xmax> using color:blue and weight:2"); + +} + + + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(16); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)], $zero+1 ); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Select which graph is the graph of the equation using the dropdown menu below. +$PAR + +$SPACE $SPACE $SPACE \($left=$right\) + + + +$PAR +${BITALIC}(Click on a graph to enlarge it.)$EITALIC +$PAR + + + +\{ begintable(4) \} +\{ row( "${BBOLD}1.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}2.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}3.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}4.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"') ) \} +\{ row( "${BBOLD}5.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{4} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}6.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{5} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}7.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{6} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}8.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{7} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"') ) \} +\{ row( "${BBOLD}9.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{8} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}10.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{9} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}11.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{10} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}12.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{11} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"') ) \} +\{ row( "${BBOLD}13.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{12} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}14.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{13} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}15.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{14} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"'), + "${BBOLD}16.$EBOLD" . + image(insertGraph( $graphs[ $shuffle->{15} ] ), tex_size=>150, + height=>150, width=>150, extra_html_tags=>'alt="graph"') ) \} +\{ endtable() \} + +$PAR + +The correct graph is \{ $pop->menu() \}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +$showPartialCorrectAnswers = 1; + +ANS( $pop->cmp() ); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations3 b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations3 new file mode 100644 index 0000000000..cfcf096178 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations3 @@ -0,0 +1,110 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + + "PGgraphmacros.pl" +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->strings->add("none"=>{}); +Context()->flags->set(tolType=>absolute,tolerance=>0.2); + +$q = random(1,10,1); +$p = 4; + +$m = random(-1,1,2)*$p/$q; +$b = random(1,4,1); + +$xint = Compute(-$b/$m); +$yint = Compute($b); + + +$xmin = -6; +$xmax = 6; +$ymin = -6; +$ymax = 6; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[400,400] +); + +add_functions($gr, "$m*x+$b for x in <$xmin,$xmax>" . + " using color:blue and weight:2"); + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + + + +$PAR +Use the graph to answer the questions below. +$PAR + +$BBLOCKQUOTE +\{ image( insertGraph($gr), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) + +$PAR + + + +$BBOLD A. $EBOLD Identify the $BITALIC x$EITALIC-intercept, or state that there is none with the word 'none'.$PAR +\{ ans_rule(10) \} (as a numerical value on the \(x\)-axis) $BR +\{ ans_rule(10) \} (as a point in the plane) $BR +$PAR +$BBOLD B. $EBOLD Identify the $BITALIC y$EITALIC-intercept, or state that there is none with the word 'none'.$PAR +\{ ans_rule(10) \} (as a numerical value on the \(y\)-axis) $BR +\{ ans_rule(10) \} (as a point in the plane) $BR + + + +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## +Context("Point"); + +$xpoint = Compute("($xint,0)"); +$ypoint = Compute("(0,$yint)"); + + + +ANS( $xint->cmp()); +ANS( $xpoint->cmp()); +ANS( $yint->cmp()); +ANS( $ypoint->cmp()); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations3.pg b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations3.pg new file mode 100644 index 0000000000..5cdf3aa5d1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations3.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGtikz.pl", + "ORCCA.pl", + "contextFraction.pl" +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction-NoDecimals"); +Context()->operators->undefine('+','-','*','^'); +$n = random(1,5,1); +$d = random(max(1,$n-3),$n+3,1); + +$m = Fraction("$n","$d"); +$mperl = $n/$d; +$bperl = random(-3,3,1); +$b = Compute("$bperl"); +$ans = $m; + +$xmin = min(-6,-$d-2); +$xmax = max(6,$d+2); +$ymin = -6; +$ymax = 6; + +($start,$stop) = (num_sort($xmin,$xmax,($ymin-$bperl)/$mperl,($ymax-$bperl)/$mperl))[1,2]; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + ] + \addplot+[domain=$start:$stop] {$mperl*x+$b}; +\end{axis} +END_TIKZ + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Below is a line's graph. +$PAR + + +$BBLOCKQUOTE +\{ image( insertGraph($gr), +width=>240,height=>240,tex_size=>800 ) \} + +$PAR +The slope of this line is \{ ans_rule(10) \}. + +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); + + + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations4 b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations4 new file mode 100644 index 0000000000..4d6f3e9c58 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations4 @@ -0,0 +1,90 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "unionTables.pl", + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + + +$a = random(2,3,1); +$b = random(2,5,1); +$c = random(-15,-10,1); + +$xint = Compute("$c/$a")->reduce; +$yint = Compute("-$c/$b")->reduce; + + + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + + + +$PAR +Find the $BITALIC x$EITALIC-intercept and $BITALIC y$EITALIC-intercept of the graph of the equation. Do not graph the equation. +$PAR + + +$BBLOCKQUOTE + +\($a x= $b y+$c\) +$PAR +\{ +BeginTable(border=>0, tex_border=>"0pt", spacing=>0, padding=>4,center=>0). +AlignedRow(["$BITALIC x$EITALIC-intercept", ans_rule(10) ,"as a numerical value on the $BITALIC x$EITALIC-axis"], align=>LEFT, separation=>0). +AlignedRow(["", ans_rule(10) ,"as a point in the plane"], align=>LEFT, separation=>0). +AlignedRow(["$BITALIC y$EITALIC-intercept", ans_rule(10) ,"as a numerical value on the $BITALIC y$EITALIC-axis"], align=>LEFT, separation=>0). +AlignedRow(["", ans_rule(10) ,"as a point in the plane"], align=>LEFT, separation=>0). +EndTable() +\} + + + + +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +Context("Point"); + +ANS( $xint->cmp()); +ANS( Compute("($xint,0)")->cmp()); +ANS( $yint->cmp()); +ANS( Compute("(0,$yint)")->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations4.pg b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations4.pg new file mode 100644 index 0000000000..5cdf3aa5d1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearEquations/LinearEquations4.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGtikz.pl", + "ORCCA.pl", + "contextFraction.pl" +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction-NoDecimals"); +Context()->operators->undefine('+','-','*','^'); +$n = random(1,5,1); +$d = random(max(1,$n-3),$n+3,1); + +$m = Fraction("$n","$d"); +$mperl = $n/$d; +$bperl = random(-3,3,1); +$b = Compute("$bperl"); +$ans = $m; + +$xmin = min(-6,-$d-2); +$xmax = max(6,$d+2); +$ymin = -6; +$ymax = 6; + +($start,$stop) = (num_sort($xmin,$xmax,($ymin-$bperl)/$mperl,($ymax-$bperl)/$mperl))[1,2]; + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick = {$xmin,...,$xmax}, + minor ytick = {$ymin,...,$ymax}, + ] + \addplot+[domain=$start:$stop] {$mperl*x+$b}; +\end{axis} +END_TIKZ + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Below is a line's graph. +$PAR + + +$BBLOCKQUOTE +\{ image( insertGraph($gr), +width=>240,height=>240,tex_size=>800 ) \} + +$PAR +The slope of this line is \{ ans_rule(10) \}. + +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); + + + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions1.pg b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions1.pg new file mode 100644 index 0000000000..820e2f2eef --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions1.pg @@ -0,0 +1,159 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", +); + + + +############################################## + +TEXT(beginproblem()); +$a = random(1,20,1); +$f[0] = Formula("x-$a")->reduce; + +$b = random(-20,20,1); +$c = random(-20,20,1); +$f[1] = Formula("$b x+$c")->reduce; + +$d = random(2,10,1); +$f[2] = Formula("x^2-$d")->reduce; + +$e = random(2,10,1); +$f = random(2,20,1); +$f[3] = Formula("$e x^2+$f")->reduce; + +$g = random(2,10,1); +$f[4] = Formula("$g/x")->reduce; + +$h = random(2,10,1); +$j = random(2,10,1); +$f[5] = Formula("$j-$h/x")->reduce; + +Context()->flags->set(reduceConstantFunctions=>0); +$k = random(2,3,1); +$f[6] = Formula("sqrt($k) x"); + +$f[7] = Formula("pi x-$h"); + +$l = random(1,10,1); +$f[8] = Formula("abs(x-$l)"); + +$m = random(2,10,1); +$n = random(1,10,1); +$f[9] = Formula("abs($m x+$n)"); + +Context()->texStrings; + +for my $i (0..9) { +$radio[$i] = new_multiple_choice(); +} + + +for my $i (0,1,6,7) { +$radio[$i]->qa("\(f(x)=$f[$i]\)", "\(f\) is linear.");} +for my $i (2,3,4,5,8,9) { +$radio[$i]->qa("\(f(x)=$f[$i]\)", "\(f\) is not linear.");} + +for my $i (0..9) { +$radio[$i]->extra("\(f\) is linear.", "\(f\) is not linear."); +$radio[$i]->makeLast("\(f\) is not linear."); +} + + +############################################## + + +BEGIN_PGML + +Identify which functions are linear functions and which are not. + +[@ $radio[0]->print_q() @]* + +[@ $radio[0]->print_a() @]* + +---- + +[@ $radio[1]->print_q() @]* + +[@ $radio[1]->print_a() @]* + +---- + +[@ $radio[2]->print_q() @]* + +[@ $radio[2]->print_a() @]* + +---- + +[@ $radio[3]->print_q() @]* + +[@ $radio[3]->print_a() @]* + +---- + +[@ $radio[4]->print_q() @]* + +[@ $radio[4]->print_a() @]* + +---- + + +[@ $radio[5]->print_q() @]* + +[@ $radio[5]->print_a() @]* + +---- + + +[@ $radio[6]->print_q() @]* + +[@ $radio[6]->print_a() @]* + +---- + + +[@ $radio[7]->print_q() @]* + +[@ $radio[7]->print_a() @]* + +---- + + +[@ $radio[8]->print_q() @]* + +[@ $radio[8]->print_a() @]* + +---- + + +[@ $radio[9]->print_q() @]* + +[@ $radio[9]->print_a() @]* + + +END_PGML + + +############################################## + +for my $i (0..9){ +ANS( radio_cmp( $radio[$i]->correct_ans() ) );} + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions2.pg b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions2.pg new file mode 100644 index 0000000000..423b6a078b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions2.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserRadioButtons.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$a = random(1,20,1); +$b = random(-5,5,1); +$f = Formula("$a x+$b"); + +for my $i (0..4) { +$y[$i] = $f->eval(x=>$i);} + +$radio = RadioButtons( + ["This table could represent a linear function","This table could not represent a linear function"], + "This table could represent a linear function", # correct answer + last => ["This table could not represent a linear function"], # can be a list +); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + + +The table below represents a function \(f\). Decide whether or not \(f\) could be a linear function. + +\{ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow(["\(x = \)","0","1","2","3"], align=>RIGHT, separation=>0). +AlignedRow(["\(f(x) = \)","$y[0]","$y[1]","$y[2]","$y[3]"], align=>RIGHT, separation=>0). +EndTable() +\} + +\{ $radio->buttons() \} + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions3.pg b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions3.pg new file mode 100644 index 0000000000..7c20b4f86a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions3.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserRadioButtons.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$a = random(1,3,1); +$b = random(-5,-1,1); +$f = Formula("$a x**2+$b"); + +for my $i (0..4) { +$y[$i] = $f->eval(x=>$i);} + +$radio = RadioButtons( + ["This table could represent a linear function","This table could not represent a linear function"], + "This table could not represent a linear function", # correct answer + last => ["This table could not represent a linear function"], # can be a list +); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + + +The table below represents a function \(f\). Decide whether or not \(f\) could be a linear function. + +\{ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow(["\(x = \)","0","1","2","3"], align=>RIGHT, separation=>0). +AlignedRow(["\(f(x) = \)","$y[0]","$y[1]","$y[2]","$y[3]"], align=>RIGHT, separation=>0). +EndTable() +\} + +\{ $radio->buttons() \} + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions4.pg b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions4.pg new file mode 100644 index 0000000000..bd097b914b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions4.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserRadioButtons.pl", + +); + + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); + +$a = random(1,3,1); +$b = random(-5,-1,1); +$f = Formula("$a x+$b"); + +for my $i (0..4) { +$y[$i] = $f->eval(x=>$i);} + +$y[2] = $y[2]-4; + +$radio = RadioButtons( + ["This table could represent a linear function","This table could not represent a linear function"], + "This table could not represent a linear function", # correct answer + last => ["This table could not represent a linear function"], # can be a list +); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + + +The table below represents a function \(f\). Decide whether or not \(f\) could be a linear function. + +\{ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow(["\(x = \)","0","1","2","3"], align=>RIGHT, separation=>0). +AlignedRow(["\(f(x) = \)","$y[0]","$y[1]","$y[2]","$y[3]"], align=>RIGHT, separation=>0). +EndTable() +\} + +\{ $radio->buttons() \} + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions5.pg b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions5.pg new file mode 100644 index 0000000000..872ec3cf3e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions5.pg @@ -0,0 +1,53 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PCCmacros.pl", + +); + + + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +parser::Assignment->Allow; +parser::Assignment->Function("f"); + +$fun = Formula("f(x)=10x"); + + +############################################## + + +BEGIN_PGML +Suppose that [`f`] is the function that tells you how many dimes are in [`x`] dollars. Write a formula for [`f`]. [@KeyboardInstructions('You need to write the entire formula, including [|f(x)=|]*.')@]** + +[__]{$fun}{width=>20} + + + +END_PGML + + +############################################## + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions6.pg b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions6.pg new file mode 100644 index 0000000000..1d89afff6a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions6.pg @@ -0,0 +1,62 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PCCmacros.pl", + +); + + + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +Context()->variables->are(t=>'Real'); +parser::Assignment->Allow; +parser::Assignment->Function("f"); + +$b = random(1,5,0.05); +$m = random(0.05,0.2,0.01); +$mC = $m*100; + +$fun = Formula("f(t)=$m*t+$b"); + + +############################################## + + +BEGIN_PGML +Suppose that [`f`] is the function that the phone company uses to determine what your bill will be (in dollars) for a long-distance phone call that lasts [`t`] minutes. Each call costs a fixed price of $[`[$b]`] plus [`[$mC]`] cents per minute. Write a formula for this linear function [`f`]. [@KeyboardInstructions('You need to write the entire formula, including [|f(t)=|]*.')@]** + +[__]{$fun}{width=>20} + + + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +Linear function [`f(x)=mx+b`] models situations with a constant rate of change. In this situation, the rate of change is [`[$mC]`] cents per minute, or [`[$m]`] dollar(s) per minute. With the starting cost of [`[$b]`] dollars for a call, the function is + + [``[$fun]``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions7.pg b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions7.pg new file mode 100644 index 0000000000..1e2891639e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions7.pg @@ -0,0 +1,54 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserAssignment.pl", + "PGML.pl", + "PCCmacros.pl", + +); + + + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +parser::Assignment->Allow; +parser::Assignment->Function("f"); + +$fun = Formula("f(x)=500"); + + +############################################## + + +BEGIN_PGML +Suppose that [`f`] is the function that gives the total cost (in dollars) of downhill skiing [`x`] times during a season with a $500 season pass. Write a formula for [`f`]. [@KeyboardInstructions('You need to write the entire formula, including [|f(x)=|]*.)@]** + + +[__]{$fun}{width=>20} + + + +END_PGML + + +############################################## + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions8.pg b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions8.pg new file mode 100644 index 0000000000..82c675cd5c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions8.pg @@ -0,0 +1,149 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "parserPopUp.pl", + +); + + + +############################################## + +TEXT(beginproblem()); +for my $i (0..3) { +$gr[$i] = init_graph(-5,-5,5,5, +axes=>[0,0], +grid=>[10,10], +size=>[400,400] +);} + +$yes = "represents a linear function"; +$no = "does not represent a linear function"; + + +$a = random(-4,-1,1); +$b = random(0,4,1); +$gr[0]->moveTo($a,5); +$gr[0]->arrowTo($b,-5,'blue',2); +$gr[0]->moveTo($b,-5); +$gr[0]->arrowTo($a,5,'blue',2); +$popup[0] = PopUp( + ["?",$yes,$no], + $yes, +); + + + + +$c = random(-2,2,1); +$d = random(-2,2,1); +add_functions($gr[1], "((x-$c)^2)+$d for x in <-5,5>" . + " using color:blue and weight:2"); +$popup[1] = PopUp( + ["?",$yes,$no], + $no, +); + + +$e = random(-4,-1,1); +$f = random(1,4,1); +$gr[2]->moveTo(0,0); +$gr[2]->arrowTo($e,5,'blue',2); +$gr[2]->moveTo(0,0); +$gr[2]->arrowTo($f,5,'blue',2); +$popup[2] = PopUp( + ["?",$yes,$no], + $no, +); + + +$g = random(-4,-1,1); +$h = random(0,4,1); +$gr[3]->moveTo(-5,$g); +$gr[3]->arrowTo(5,$h,'blue',2); +$gr[3]->moveTo(5,$h); +$gr[3]->arrowTo(-5,$g,'blue',2); +$popup[3] = PopUp( + ["?",$yes,$no], + $yes, +); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Which of the following graphs represent a linear function of \(x\)? + + +$PAR + +\{ image( insertGraph($gr[0]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[0]->menu() \} + + +$PAR + +\{ image( insertGraph($gr[1]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[1]->menu() \} + + +$PAR + +\{ image( insertGraph($gr[2]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[2]->menu() \} + +$PAR + +\{ image( insertGraph($gr[3]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[3]->menu() \} + +$PAR + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $popup[0]->cmp() ); +ANS( $popup[1]->cmp() ); +ANS( $popup[2]->cmp() ); +ANS( $popup[3]->cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions9.pg b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions9.pg new file mode 100644 index 0000000000..f3033d3297 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearFunctions/LinearFunctions9.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "unionTables.pl", + + +); + + + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0,'(-x)+y'=>0); + +# +# Create a matching list and use popups +# +$ml = new_match_list(); +$ml->rf_print_q(~~&pop_up_list_print_q); +$ml->ra_pop_up_list([ +"No answer" => "?", +"A" => "A", "B" => "B", "C" => "C", +"D" => "D", +]); + + + + +for my $i (0..3) { +$gr[$i] = init_graph(-5,-5,5,5, +axes=>[0,0], +grid=>[10,10], +size=>[400,400] +);} + + +$a = random(-3,-1,1); +$fa = Formula("$a x")->reduce; +add_functions($gr[0], "$a x for x in <-5,5>" . + " using color:blue and weight:2"); + +$b = random(1,4,1); +$fb = Formula("$b x")->reduce; +add_functions($gr[1], "$b x for x in <-5,5>" . + " using color:blue and weight:2"); + +$c0 = random(1,4,1); +$c1 = non_zero_random(-2,2,1); +$fc = Formula("$c1 x + $c0")->reduce; +add_functions($gr[2], "$c1 x + $c0 for x in <-5,5>" . + " using color:blue and weight:2"); + +$d0 = random(-4,-1,1); +$d1 = non_zero_random(-2,2,1); +$fd = Formula("$d1 x + $d0")->reduce; +add_functions($gr[3], "$d1 x + $d0 for x in <-5,5>" . + " using color:blue and weight:2"); + + + +# +# Add correct questions and answers +# +Context()->texStrings; +$ml->qa( +"\(f(x)=$fa\)", image( insertGraph($gr[0]), +width=>200,height=>200,tex_size=>800 ) , +"\(f(x)=$fb\)", image( insertGraph($gr[1]), +width=>200,height=>200,tex_size=>800 ) , +"\(f(x)=$fc\)", image( insertGraph($gr[2]), +width=>200,height=>200,tex_size=>800 ) , +"\(f(x)=$fd\)", image( insertGraph($gr[3]), +width=>200,height=>200,tex_size=>800 ) , +); +$ml->choose(4); + + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Match the rule for \(f\) with its graph. + + +\{ ColumnMatchTable($ml) \} + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( str_cmp( $ml->ra_correct_ans ) ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/LinearInequalities/LinearInequalities8.pg b/OpenProblemLibrary/PCC/Math95/LinearInequalities/LinearInequalities8.pg new file mode 100644 index 0000000000..28c63729e4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearInequalities/LinearInequalities8.pg @@ -0,0 +1,72 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + +################################### + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + + + +################################### +TEXT(beginproblem()); + +$a = random(11,20,1); +$b = random(27,33,1); +$c = random(45,52,1); +$ans1 = ($c-$b)/$a*100; + +Context("Interval"); +Context()->flags->set(ignoreEndpointTypes => 1); +Context()->flags->set(tolType=>absolute); +Context()->flags->set(tolerance=>0.5); + + +################################### + + +BEGIN_PGML +A car rental company offers the following two plans for renting a car. + + Plan A: [`\$[$b]`] per day and [`[$a]`] cents per mile + + Plan B: [`\$[$c]`] per day with free unlimited mileage + +How many miles must one drive in order to justify choosing Plan B? + + One must drive more than [_____]{Real($ans1)} miles to justify choosing Plan B. In other words, it's more economical to use plan B if your number of miles driven will be in the interval [__________]{Interval("($ans1,inf)")}. [@KeyboardInstructions('(Answer using interval notation.)')@]* + +END_PGML + +################################### + + + + +################################### +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/LinearInequalities/LinearInequalities9.pg b/OpenProblemLibrary/PCC/Math95/LinearInequalities/LinearInequalities9.pg new file mode 100644 index 0000000000..51ffd2bd5d --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/LinearInequalities/LinearInequalities9.pg @@ -0,0 +1,64 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + +################################### + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextCurrency.pl", + "PCCmacros.pl", + "PGcourse.pl", # Customization file for the course +); + +TEXT(beginproblem()); +################################### + +$p1 = random(1,4); +$p2 = $p1 + random(1,5); +$a = random(200,500,10); + + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context("Currency")->currency->addSymbol("dollars","dollar"); + +$ansReal = 100*$a/($p2-$p1); +$ans = Currency($ansReal); + +Context("Interval"); +Context()->flags->set(ignoreEndpointTypes => 1); + +################################### + +BEGIN_PGML +You are offered two different sales jobs. The first company offers a straight commission of [`[$p2]%`] of the sales. The second company offers a salary of [`\$[$a]`] per week _plus_ [`[$p1]%`] of the sales. How much would you have to sell in a week in order for the straight commission offer to be at least as good? + +You'd have to sell more than [________]{$ans} worth of goods for the straight commission to be better for you. In other words, the dollar amount of goods sold would have to be in the interval [__________]{Interval("($ansReal,inf)")}. [@KeyboardInstructions('(Answer using interval notation.)')@]* +END_PGML + +################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations1.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations1.pg new file mode 100644 index 0000000000..df16d19597 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations1.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + +Context("Fraction"); +$b = random(2,20,1); +$c = random(1,3,1); +$d = random(1,7,1)+$c; +$e = random(1,8,1); +$f = random(1,4,1)+$e; + +$B = Fraction("$c","$d"); +$C = Fraction("$e","$f"); + +$sol = Fraction("$b*$d*$e-$b*$c*$f","$d*$f"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("$var/$b+$B"); +$right = Formula("$C"); + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations10.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations10.pg new file mode 100644 index 0000000000..dfa936c537 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations10.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +$a = random(1,8,1); +$b = random(1,6,1); +$c = random(2,10,1); +$d = non_zero_random(-5,5,1)+$b; + +while ((($p+$b)*($p+$d)==0)||($a*($p+$d)+$c*$p*($p+$b)==0)) {$d = non_zero_random(-5,5,1)+$b;}; + +$p = non_zero_random(1,8,1); + +$e = $a*($p+$d)+$c*$p*($p+$b); +$f = ($p+$b)*($p+$d); +while ($f ==0) +{$p = non_zero_random(1,8,1); + +$e = $a*($p+$d)+$c*$p*($p+$b); +$f = ($p+$b)*($p+$d); +} + + +$C = Fraction("$e","$f"); + + +$sol[0] = Fraction("$p","1"); +$sol[1] = Fraction("$d*($a*$b+$b*$c*$p+$b**2*$c-$a*$p-$a*$b-$a*$d)","$a*($p+$d)+$c*$p*($p+$b)-$c*($p+$b)*($p+$d)"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("($a)/($var+$b)+($c $var)/($var+$d)")->reduce; +$right = Formula("$C"); + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol[0],$sol[1]}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations11.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations11.pg new file mode 100644 index 0000000000..c82804e0a1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations11.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +do{ +$a = non_zero_random(-8,8,1); +$b = non_zero_random(-6,6,1); +$c = random(1,10,1); +$d = $c**2+$a*$c+$b; + + +$sol[0] = Fraction("-$a-$c","1"); +} until ($c != $sol[0]); +#$sol[1] = Fraction("-$d*($a*$b+$b*$c*$p+$b**2*$c-$a*$p-$a*$b-$a*$d)","$a*($p+$d)+$c*$p*($p+$b)"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("($var^2+$a $var+$b)/($var-$c)-$d/($var-$c)")->reduce; +$right = Formula("0"); + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol[0]}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations12.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations12.pg new file mode 100644 index 0000000000..a399f49187 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations12.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); + +$b = random(1,10,1); +$c = random(1,10,1); +while ($c == $b) {$c = random(1,10,1);} +$a = 2*$b*$c; + + + +$sol[0] = Fraction("-$c","1"); +#$sol[1] = Fraction("-$d*($a*$b+$b*$c*$p+$b**2*$c-$a*$p-$a*$b-$a*$d)","$a*($p+$d)+$c*$p*($p+$b)"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("$a/($var^2-($b)**2)+$c/($var+$b)")->reduce; +$right = Formula("$var/($b-$var)")->reduce; + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol[0]}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations2.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations2.pg new file mode 100644 index 0000000000..f6455ee5f9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations2.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +$b = random(2,20,1); +$c = random(1,3,1); +$d = random(1,7,1)+$c; +$e = random(1,8,1); +$f = random(1,4,1)+$e; + +$B = Fraction("$c","$d"); +$C = Fraction("$e","$f"); + +$sol = Fraction("$f+$b*$c*$f","$b*$e"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("1/($b $var)+$c/($var)"); +$right = Formula("$C"); + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations3.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations3.pg new file mode 100644 index 0000000000..de914a903e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations3.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +$b = random(2,20,1); +$c = random(1,3,1); +$d = random(1,7,1)+$c; +$e = random(1,8,1); +$f = random(1,4,1)+$e; + +$B = Fraction("$c","$d"); +$C = Fraction("$e","$f"); + +$sol = Fraction("$f-$b*$c*$f","$b*$e"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("1/($b $var)-$c/($var)"); +$right = Formula("$C"); + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations4.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations4.pg new file mode 100644 index 0000000000..0a7ae86c53 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations4.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +$a = random(1,8,1); +$b = random(1,10,1); +$c = random(1,10,1); +$d = random(1,7,1)+$c; +$e = random(1,8,1); +$f = random(1,4,1)+$e; + +while ($b*$c == $b*$c+$e-$a) {$e = random(1,8,1);} + +$B = Fraction("$c","$d"); +$C = Fraction("$e","$f"); + +$sol = Fraction("$b*$c+$e-$a","$c"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("$a/($var-$b)+$c"); +$right = Formula("$e/($var-$b)"); + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations5.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations5.pg new file mode 100644 index 0000000000..18cc529c63 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations5.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +$a = random(1,8,1); +$b = random(1,10,1); +$c = random(1,10,1); +do {$d = non_zero_random(-10,10,1);} until ($b != $d); +$e = random(1,8,1); +$f = random(1,4,1)+$e; + +while ($a == $c) {$c = random(1,10,1);} + +$B = Fraction("$c","$d"); +$C = Fraction("$e","$f"); + +$sol = Fraction("$a*$d-$b*$c","$a-$c"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("$a/($var-$b)")->reduce; +$right = Formula("$c/($var-$d)")->reduce; + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations6.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations6.pg new file mode 100644 index 0000000000..7bbde52c84 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations6.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +$a = random(1,8,1); +$b = random(1,6,1); +$c = non_zero_random(-10,10,1); +$d = non_zero_random(-10,10,1); +$e = random(1,8,1); +$f = random(1,4,1)+$e; + +while ($a == -$c) {$c = non_zero_random(-10,10,1);} + +$B = Fraction("$c","$d"); +$C = Fraction("$e","$f"); + +$sol = Fraction("$e+$b*$c-$b*$a","$a+$c"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("$a/($var-$b)+$c/($var+$b)")->reduce; +$right = Formula("$e/($var^2-($b)**2)")->reduce; + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations7.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations7.pg new file mode 100644 index 0000000000..5766d430ee --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations7.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +$a = random(1,8,1); +$b = random(1,6,1); +$c = non_zero_random(-10,10,1); +$d = non_zero_random(-10,10,1); +$e = random(1,8,1); +$f = $b+1; + + +$B = Fraction("$c","$d"); +$C = Fraction("$e","$f"); + +$sol = Fraction("$f-$b","$b*$c*$f"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("1/($b*$var)-$c")->reduce; +$right = Formula("1/($f*$var)")->reduce; + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations8.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations8.pg new file mode 100644 index 0000000000..7ed35206ed --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations8.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +$a = random(1,4,1); +$b = random(1,4,1); +$c = non_zero_random(-10,10,1); +$d = non_zero_random(-10,10,1); + + + +$p = random(1,3,1); +$q = random(1,3,1); +while (($p+$d*$q==0)||($a*$p+$a*$d*$q+$c*$p)==0) {$d = non_zero_random(-10,10,1);} + +$e = $a*$q*($p+$d*$q)+$c*$p*$q; +$f = $p*($p+$d*$q); +$C = Fraction("$e","$f"); + +$sol[0] = Fraction("$p","$q"); +$sol[1] = Fraction("-$a*($p+$d*$q)*$d","$a*$p+$a*$d*$q+$c*$p"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("$a/($var)+$c/($var+$d)")->reduce; +$right = Formula("$C"); + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol[0],$sol[1]}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations9.pg b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations9.pg new file mode 100644 index 0000000000..122c63398a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MoreRationalEquations/MoreRationalEquations9.pg @@ -0,0 +1,84 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +$a = random(1,8,1); +$b = random(1,6,1); +$c = random(2,10,1); +$d = non_zero_random(-10,10,1); +$e = non_zero_random(-6,6,1); +$f = 1; +while (($c*$e == $b) || ($a-$c*$d==0)) {$c = random(2,10,1);} + + +$sol[0] = Fraction("$c*$e-$b","$a-$c*$d"); +#$sol[1] = Fraction("-$a*($p+$d*$q)","$a*$p+$a*$d*$q+$c*$p"); + +Context("Numeric"); +Context()->flags->set(reduceConstants=>0); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$left = Formula("($a $var+$b)/($c $var)-($d $var+$e)/($var)")->reduce; +$right = Formula("0"); + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$sol[0]}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR +Consider solving this equation with several methods: algebraically with factoring, algebraically with the quadratic formula (if appropriate), and graphically. On the exam, you might or might not have access to your graphing calculator for a problem like this. You should be prepared to use it if it helps, and also be prepared to solve without your calculator if it is reasonable to do so. $PAR +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MultiplyingRationals/MultiplyingRationals1.pg b/OpenProblemLibrary/PCC/Math95/MultiplyingRationals/MultiplyingRationals1.pg new file mode 100644 index 0000000000..3379572e2c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MultiplyingRationals/MultiplyingRationals1.pg @@ -0,0 +1,69 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextRationalFunction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +do {$a = random(1,20,1); +$b = random(1,20,1);} until (gcd($a,$b) == 1); + +$n = random(1,2,1); +$m = random(1,4,1)+$n; + +$expression = Formula("($a $var^($m-$n))/($b $var^($m))")->reduce; + +Context("RationalFunction-Strict"); +Context()->variables->are($var=>'Real'); + +$ans = Formula("$a/($b $var^$n)"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Simplify the rational expression. $PAR + + +\[$expression \] + +$PAR + + +$SPACE $SPACE $SPACE \{ans_rule(30)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0.0000001)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/MultiplyingRationals/MultiplyingRationals2.pg b/OpenProblemLibrary/PCC/Math95/MultiplyingRationals/MultiplyingRationals2.pg new file mode 100644 index 0000000000..7feede6919 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MultiplyingRationals/MultiplyingRationals2.pg @@ -0,0 +1,91 @@ +##DESCRIPTION +## Rational Expressions and Functions: Multipy and Divide +## Modified by Alex Jordan +## +##ENDDESCRIPTION +## DBsubject('Intermediate Algebra') +## DBchapter('Ch 06: Rational Expressions, Functions and Equations') +## DBsection('Rational Expressions and Functions: Multipying and Dividing') +## KEYWORDS('rational expressions','rational functions') +## TitleText1('Essentials of Intermediate Algebra') +## EditionText1('1') +## AuthorText1('Blitzer') +## Section1('6.1') +## Problem1('') +## Author('RA Cruz') +## Institution('The College of Idaho') +## Date: 2007/11 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRestrictedDomains.pl", + "PGcourse.pl", + + +); + +TEXT(beginproblem); + +###################################### +# Setup +# Form: x(x+a)/(x-b)(x+b) / (x-a)(x+a)/(x+b)(x+c), c neq (-a or -b), b neq (-a or a) + +Context("RestrictedDomains"); +$a = list_random(-5,-4,-3,-2,2,3,4,5); +do {$b = non_zero_random(-5,5,1);} while (abs($a)==abs($b)); +do {$c = non_zero_random(-5,5,1);} while ( abs($c)==abs($a)||abs($c)==abs($b) ); +$aN = -$a; +$bN = -$b; +$cN = -$c; + +($f1,$f2) = (Formula("(x^2 + $a x)/(x^2 - $b*$b)")->reduce->reduce, + Formula("(x^2 - $a*$a)/(x^2 + ($b+$c)x + $b*$c)")->reduce->reduce); + +$f1num1 = Formula("x*(x+$a)")->reduce; +$f1den1 = Formula("(x+$b)*(x-$b)")->reduce; +$f2num1 = Formula("(x+$a)*(x-$a)")->reduce; +$f2den1 = Formula("(x+$b)*(x+$c)")->reduce; + + +$ans = Formula("(x*(x+$c))/((x-$a)*(x-$b)), x != -$a and x != -$b and x != -$c")->reduce; +$ans->{trueDomain} = Compute("x != -$a and x != -$b and x != -$c and x != $a and x != $b"); + +###################################### +# Main text + +BEGIN_PGML +Simplify this expression, and if applicable, write the restricted domain. [@KeyboardInstructions("The problem accepts many ways to format the answers here, but one way is like typing [|x^2 for x!=1 and x!=2|]* where [|!=|]* is how to type the [`\\neq`] symbol.")@]** + + + [``[$f1] \div [$f2]={}``][__________________________________]{$ans} + +END_PGML + + + +###################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$f1] \div [$f2] + &= \frac{[$f1num1]}{[$f1den1]} \div \frac{[$f2num1]}{[$f2den1]} \\ + &= \frac{[$f1num1]}{[$f1den1]} \cdot \frac{[$f2den1]}{[$f2num1]} \\ + &= [$ans] +\end{aligned} + ``] + +Since the factors [`x+[$a]`] and [`x+[$b]`] were canceled, [`x \ne [$aN]`] and [`x \ne [$bN]`] are lost domain conditions. + +Note that [`x+[$c]`] used to be in the denominator, but not any more in the solution. This is why [`x \ne [$cN]`] is also a lost domain condition. + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Math95/MultiplyingRationals/MultiplyingRationals2nodomain.pg b/OpenProblemLibrary/PCC/Math95/MultiplyingRationals/MultiplyingRationals2nodomain.pg new file mode 100644 index 0000000000..74f3311b10 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/MultiplyingRationals/MultiplyingRationals2nodomain.pg @@ -0,0 +1,86 @@ +##DESCRIPTION +## Rational Expressions and Functions: Multipy and Divide +## Modified by Alex Jordan +## +##ENDDESCRIPTION +## DBsubject('Intermediate Algebra') +## DBchapter('Ch 06: Rational Expressions, Functions and Equations') +## DBsection('Rational Expressions and Functions: Multipying and Dividing') +## KEYWORDS('rational expressions','rational functions') +## TitleText1('Essentials of Intermediate Algebra') +## EditionText1('1') +## AuthorText1('Blitzer') +## Section1('6.1') +## Problem1('') +## Author('RA Cruz') +## Institution('The College of Idaho') +## Date: 2007/11 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedFactor.pl", + "PGcourse.pl", + + +); + +TEXT(beginproblem); + +###################################### +# Setup +# Form: x(x+a)/(x-b)(x+b) / (x-a)(x+a)/(x+b)(x+c), c neq (-a or -b), b neq (-a or a) + +Context("LimitedFactor"); +$a = list_random(-5,-4,-3,-2,2,3,4,5); +do {$b = non_zero_random(-5,5,1);} while (abs($a)==abs($b)); +do {$c = non_zero_random(-5,5,1);} while ( abs($c)==abs($a)||abs($c)==abs($b) ); +$aN = -$a; +$bN = -$b; +$cN = -$c; + +($f1,$f2) = (Formula("(x^2 + $a x)/(x^2 - $b*$b)")->reduce->reduce, + Formula("(x^2 - $a*$a)/(x^2 + ($b+$c)x + $b*$c)")->reduce->reduce); + +$f1num1 = Formula("x*(x+$a)")->reduce; +$f1den1 = Formula("(x+$b)*(x-$b)")->reduce; +$f2num1 = Formula("(x+$a)*(x-$a)")->reduce; +$f2den1 = Formula("(x+$b)*(x+$c)")->reduce; + + +$ans = Formula("(x*(x+$c))/((x-$a)*(x-$b))")->reduce; + +###################################### +# Main text + +BEGIN_PGML +Simplify this expression. + + + [``[$f1] \div [$f2]={}``][__________________________________]{$ans} + +END_PGML + + + +###################################### + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$f1] \div [$f2] + &= \frac{[$f1num1]}{[$f1den1]} \div \frac{[$f2num1]}{[$f2den1]} \\ + &= \frac{[$f1num1]}{[$f1den1]} \cdot \frac{[$f2den1]}{[$f2num1]} \\ + &= [$ans] +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents1.pg b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents1.pg new file mode 100644 index 0000000000..a102c2dbf5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents1.pg @@ -0,0 +1,51 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "contextRationalFunction.pl" + ); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$n = random(3,12,1); +$a = random(5,20,1); + +$show = Compute("$a x^(-$n)"); + +Context("RationalFunction"); +LimitedPowers::OnlyPositiveIntegers(); + +$tell = Compute("$a/x^($n)"); + + + +############################################## + +BEGIN_PGML +Rewrite the expression simplified and using only positive exponents. + + [``\displaystyle [$show]= ``] [____________]{$tell} + +END_PGML + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents10.pg b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents10.pg new file mode 100644 index 0000000000..28aec86fbf --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents10.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "contextRationalFunction.pl" + ); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$n = random(3,30,1); +$m = $n+ non_zero_random(-$n+2,2*$n,1); +$a = random(5,20,1); +$b = $a+1; +$c = random(1,10,1); +$d = random(2,8,1); + +$p = random(3,30,1); +$q = $p-random(1,$p-1,1); + + + +$show = Compute("$a x^($q)($d x+$c)^(-$n)/($b x^(-$p)($d x+$c)^(-$m))"); + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1,); +Context()->flags->set(singleFactors=>1); + +LimitedPowers::OnlyPositiveIntegers(); + +if (-$n+$m<0) +{$tell = Compute("$a x^($p+$q)/ ($b ($d x+$c)^($n-$m))")->reduce;} +else {$tell = Compute("$a x^($p+$q)($d x+$c)^($m-$n)/($b)")->reduce;} + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Rewrite the expression simplified and using only positive exponents. $PAR + +$SPACE $SPACE $SPACE \($show\) $PAR + + +\{ans_rule(20)\} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($tell->cmp()); + + + + + + + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents11.pg b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents11.pg new file mode 100644 index 0000000000..5284e9671e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents11.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "contextRationalFunction.pl" + ); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$n = random(3,30,1); +$m = $n+ non_zero_random(-$n+2,2*$n,1); +$a = random(5,20,1); +$b = $a+1; +$c = random(1,10,1); +$d = random(2,8,1); + +$p = random(3,30,1); +$q = $p-random(1,$n-1,1); + + + +$show = Compute("$a x^(-$q)($d x+$c)^(-$n)/($b x^(-$p)($d x+$c)^(-$m))"); + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1,); +Context()->flags->set(singleFactors=>1); + +LimitedPowers::OnlyPositiveIntegers(); + +if (-$n+$m<0) +{$tell = Compute("$a x^($p-$q)/ ($b ($d x+$c)^($n-$m))")->reduce;} +else {$tell = Compute("$a x^($p-$q)($d x+$c)^($m-$n)/($b)")->reduce;} + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Rewrite the expression simplified and using only positive exponents. $PAR + +$SPACE $SPACE $SPACE \($show\) $PAR + + +\{ans_rule(20)\} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($tell->cmp()); + + + + + + + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents2.pg b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents2.pg new file mode 100644 index 0000000000..226a07ef7a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents2.pg @@ -0,0 +1,52 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "contextRationalFunction.pl" + ); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$n = random(3,12,1); +$a = random(5,20,1); + +$show = Compute("$a/x^(-$n)"); + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1,); +Context()->flags->set(singleFactors=>1); + +LimitedPowers::OnlyPositiveIntegers(); + +$tell = Compute("$a x^($n)"); + + + +############################################## + +BEGIN_PGML +Rewrite the expression simplified and using only positive exponents. + + [``\displaystyle [$show]= ``] [____________]{$tell} + +END_PGML + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents3.pg b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents3.pg new file mode 100644 index 0000000000..c1fe99ea1f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents3.pg @@ -0,0 +1,52 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "contextRationalFunction.pl" + ); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$n = random(3,12,1); +$a = random(5,20,1); + +$show = Compute("$a x^(-$n)/x"); + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1,); +Context()->flags->set(singleFactors=>1); + +LimitedPowers::OnlyPositiveIntegers(); + +$tell = Compute("$a/ x^($n+1)")->reduce; + + + +############################################## + +BEGIN_PGML +Rewrite the expression simplified and using only positive exponents. + + [``\displaystyle [$show]= ``] [____________]{$tell} + +END_PGML + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents4.pg b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents4.pg new file mode 100644 index 0000000000..29161b2f47 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents4.pg @@ -0,0 +1,55 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "contextRationalFunction.pl" + ); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$n = random(3,20,1); +$m = $n+ non_zero_random(-$n+2,20,1); +$a = random(5,20,1); + +$show = Compute("$a x^(-$n)/x^(-$m)"); + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1,); +Context()->flags->set(singleFactors=>1); + +LimitedPowers::OnlyPositiveIntegers(); + +if (-$n+$m<0) +{$tell = Compute("$a/ x^($n-$m)")->reduce;} +else {$tell = Compute("$a x^($m-$n)")->reduce;} + + + +############################################## + +BEGIN_PGML +Rewrite the expression simplified and using only positive exponents. + + [``\displaystyle [$show]= ``] [____________]{$tell} + +END_PGML + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents5.pg b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents5.pg new file mode 100644 index 0000000000..f83ab3bf1b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents5.pg @@ -0,0 +1,57 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "contextRationalFunction.pl" + ); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$n = random(3,30,1); +$m = $n+ non_zero_random(-$n+2,20,1); +$a = random(5,20,1); +$b = $a+1; + + +$show = Compute("$a x^(-$n)/($b x^(-$m))"); + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1,); +Context()->flags->set(singleFactors=>1); + +LimitedPowers::OnlyPositiveIntegers(); + +if (-$n+$m<0) +{$tell = Compute("$a/ ($b x^($n-$m))")->reduce;} +else {$tell = Compute("$a x^($m-$n)/$b")->reduce;} + + + +############################################## + +BEGIN_PGML +Rewrite the expression simplified and using only positive exponents. + + [``\displaystyle [$show]= ``] [____________]{$tell} + +END_PGML + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents6.pg b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents6.pg new file mode 100644 index 0000000000..173975b500 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents6.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "contextRationalFunction.pl" + ); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$n = random(3,30,1); +$m = $n+ non_zero_random(-$n+2,20,1); +$a = random(5,20,1); +$b = $a+1; +$c = random(1,10,1); + + +$show = Compute("$a (x+$c)^(-$n)/($b (x+$c)^(-$m))"); + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1,); +Context()->flags->set(singleFactors=>1); + +LimitedPowers::OnlyPositiveIntegers(); + +if (-$n+$m<0) +{$tell = Compute("$a/ ($b (x+$c)^($n-$m))")->reduce;} +else {$tell = Compute("$a (x+$c)^($m-$n)/$b")->reduce;} + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Rewrite the expression simplified and using only positive exponents. $PAR + +$SPACE $SPACE $SPACE \($show\) $PAR + + +\{ans_rule(20)\} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($tell->cmp()); + + + + + + + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents7.pg b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents7.pg new file mode 100644 index 0000000000..69d341c89e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents7.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "contextRationalFunction.pl" + ); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$n = random(3,30,1); +$m = $n+ non_zero_random(-$n+2,2*$n,1); +$a = random(5,20,1); +$b = $a+1; +$c = random(1,10,1); +$d = random(2,8,1); + + +$show = Compute("$a ($d x+$c)^(-$n)/($b ($d x+$c)^(-$m))"); + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1,); +Context()->flags->set(singleFactors=>1); + +LimitedPowers::OnlyPositiveIntegers(); + +if (-$n+$m<0) +{$tell = Compute("$a/ ($b ($d x+$c)^($n-$m))")->reduce;} +else {$tell = Compute("$a ($d x+$c)^($m-$n)/$b")->reduce;} + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Rewrite the expression simplified and using only positive exponents. $PAR + +$SPACE $SPACE $SPACE \($show\) $PAR + + +\{ans_rule(20)\} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($tell->cmp()); + + + + + + + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents8.pg b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents8.pg new file mode 100644 index 0000000000..04f145c301 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents8.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "contextRationalFunction.pl" + ); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$n = random(3,30,1); +$m = $n+ non_zero_random(-$n+2,2*$n,1); +$a = random(5,20,1); +$b = $a+1; +$c = random(1,10,1); +$d = random(2,8,1); + +$p = random(3,30,1); +$q = $n+ non_zero_random(-$n+2,2*$n,1); + + + +$show = Compute("$a x^(-$p)($d x+$c)^(-$n)/($b ($d x+$c)^(-$m))"); + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1,); +Context()->flags->set(singleFactors=>1); + +LimitedPowers::OnlyPositiveIntegers(); + +if (-$n+$m<0) +{$tell = Compute("$a/ ($b x^($p)($d x+$c)^($n-$m))")->reduce;} +else {$tell = Compute("$a ($d x+$c)^($m-$n)/($b x^($p))")->reduce;} + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Rewrite the expression simplified and using only positive exponents. $PAR + +$SPACE $SPACE $SPACE \($show\) $PAR + + +\{ans_rule(20)\} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($tell->cmp()); + + + + + + + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents9.pg b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents9.pg new file mode 100644 index 0000000000..2975d68938 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/NegativeExponents/NegativeExponents9.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "contextRationalFunction.pl" + ); + + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$n = random(3,30,1); +$m = $n+ non_zero_random(-$n+2,2*$n,1); +$a = random(5,20,1); +$b = $a+1; +$c = random(1,10,1); +$d = random(2,8,1); + +$p = random(3,30,1); +$q = $n+ non_zero_random(-$n+2,2*$n,1); + + + +$show = Compute("$a ($d x+$c)^(-$n)/($b x^(-$p)($d x+$c)^(-$m))"); + +Context("RationalFunction"); +Context()->flags->set(singleQuotients=>1,); +Context()->flags->set(singleFactors=>1); + +LimitedPowers::OnlyPositiveIntegers(); + +if (-$n+$m<0) +{$tell = Compute("$a x^($p)/ ($b ($d x+$c)^($n-$m))")->reduce;} +else {$tell = Compute("$a x^($p)($d x+$c)^($m-$n)/($b)")->reduce;} + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Rewrite the expression simplified and using only positive exponents. $PAR + +$SPACE $SPACE $SPACE \($show\) $PAR + + +\{ans_rule(20)\} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($tell->cmp()); + + + + + + + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions1.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions1.pg new file mode 100644 index 0000000000..b72dec6c80 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions1.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + + + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); + +$a = Real(random(1,10,1)); +$b = $a + non_zero_random(-5,5,1); + +$c = Real(random(1,10,1)); +$d = $c + non_zero_random(-5,5,1); + + + +Context("Point"); +$P = Point("($a,$b)"); +$Q = Point("($c,$d)"); + + +############################################## + + +BEGIN_PGML +If [`f([$a])=[$b]`], then the point [________]{$P} is on the graph of [`f`]. + +If [`[$Q]`] is on the graph of [`f`], then [`f\Big(`] [_____]{$c} [`\Big)={}`] [_____]{$d}. + +END_PGML + + +############################################## + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions2.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions2.pg new file mode 100644 index 0000000000..4fb593ae47 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions2.pg @@ -0,0 +1,67 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + +do { +$var1 = RandomVariableName(); +$var2 = RandomVariableName(); +} until ($var1 ne $var2); + +Context("Point"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$P = Point("($var1,$var2)"); + + + +############################################## + +BEGIN_PGML +If [`f([$var1])=[$var2]`], then the point [__________]{$P} is on the graph of [`f`]. + +END_PGML + + +############################################## + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions23.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions23.pg new file mode 100644 index 0000000000..45a06b0fd9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions23.pg @@ -0,0 +1,59 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + +TEXT(beginproblem()); + + +############################################## + + +Context("Numeric"); +$m = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); + +$f = Formula("$m x+$b")->reduce; + +Context("Interval"); +$domain = Interval("(-inf,inf)"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Find the domain of the function \(f\) where \(f(x)=$f\). + +$PAR + +The domain is \{ans_rule(10)\} (in interval notation). +$BR If you need to enter \(\infty\), you can type $BBOLD INF$EBOLD or $BBOLD INFINITY$EBOLD. If you need to union two (or more) intervals, use the letter $BBOLD U$EBOLD. For example, to enter \((-\infty,5)\cup(5,10]\) you can type $BBOLD (-inf,5)U(5,10]$EBOLD. + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($domain->cmp); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions24.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions24.pg new file mode 100644 index 0000000000..2ed8373f80 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions24.pg @@ -0,0 +1,63 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Fraction"); +$n = random(1,10,1); +$d = random(1,10,1); +$c = Fraction("$n","$d"); +$b = random(2,5,1); + +#Context("Numeric"); +$f = Compute("$c x^($b)"); + +Context("Interval"); +$domain = Interval("(-inf,inf)"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Find the domain of the function \(f\) where \(f(x)=$f\). + +$PAR + +The domain is \{ans_rule(10)\} (in interval notation). +$BR If you need to enter \(\infty\), you can type $BBOLD INF$EBOLD or $BBOLD INFINITY$EBOLD. If you need to union two (or more) intervals, use the letter $BBOLD U$EBOLD. For example, to enter \((-\infty,5)\cup(5,10]\) you can type $BBOLD (-inf,5)U(5,10]$EBOLD. + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($domain->cmp); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions25.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions25.pg new file mode 100644 index 0000000000..7d7b362d64 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions25.pg @@ -0,0 +1,60 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); +$a = non_zero_random(-10,10,1); +$b = random(1,8,1); + +Context("Numeric"); +$f = Formula("($b x)/(x-$a)")->reduce; + +Context("Interval"); +$domain = Interval("(-inf,$a)U($a,inf)"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Find the domain of the function \(f\) where \(f(x)=$f\). + +$PAR + +The domain is \{ans_rule(20)\} (in interval notation). +$BR If you need to enter \(\infty\), you can type $BBOLD INF$EBOLD or $BBOLD INFINITY$EBOLD. If you need to union two (or more) intervals, use the letter $BBOLD U$EBOLD. For example, to enter \((-\infty,5)\cup(5,10]\) you can type $BBOLD (-inf,5)U(5,10]$EBOLD. + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($domain->cmp); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions26.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions26.pg new file mode 100644 index 0000000000..a75ac76578 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions26.pg @@ -0,0 +1,66 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + + +############################################## + + +Context("Fraction"); +$a = non_zero_random(-10,10,1); +$c = random(2,10,1); +$b = random(1,8,1); +while (gcd($b,$c)!=1) {$b = random(1,8,1);} + +$r = Fraction("$a","$c"); + + +Context("Numeric"); +$f = Formula("($b x)/($c x-$a)")->reduce; + +Context("Interval"); +$domain = Compute("(-inf,$r)U($r,inf)"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Find the domain of the function \(f\) where \(f(x)=$f\). + +$PAR + +The domain is \{ans_rule(20)\} (in interval notation). +$BR If you need to enter \(\infty\), you can type $BBOLD INF$EBOLD or $BBOLD INFINITY$EBOLD. If you need to union two (or more) intervals, use the letter $BBOLD U$EBOLD. For example, to enter \((-\infty,5)\cup(5,10]\) you can type $BBOLD (-inf,5)U(5,10]$EBOLD. + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($domain->cmp); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions27.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions27.pg new file mode 100644 index 0000000000..47d1213dbe --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions27.pg @@ -0,0 +1,62 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Fraction"); +$a = random(2,10,1); + + + +Context("Numeric"); +$f = Formula("sqrt($a-x)")->reduce; + +Context("Interval"); +$domain = Compute("(-inf,$a]"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Find the domain of the function \(f\) where \(f(x)=$f\). + +$PAR + +The domain is \{ans_rule(20)\} (in interval notation). +$BR If you need to enter \(\infty\), you can type $BBOLD INF$EBOLD or $BBOLD INFINITY$EBOLD. If you need to union two (or more) intervals, use the letter $BBOLD U$EBOLD. For example, to enter \((-\infty,5)\cup(5,10]\) you can type $BBOLD (-inf,5)U(5,10]$EBOLD. + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($domain->cmp); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions28.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions28.pg new file mode 100644 index 0000000000..f2cfb2c18d --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions28.pg @@ -0,0 +1,64 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Fraction"); +$a = random(2,10,1); +$b = random(2,20,1); +while (gcd($a,$b) != 1) {$b = random(2,20,1);} + +$r = Fraction("-$a","$b"); + +Context("Numeric"); +$f = Formula("sqrt($a+$b x)")->reduce; + +Context("Interval"); +$domain = Compute("[$r,inf)"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Find the domain of the function \(f\) where \(f(x)=$f\). + +$PAR + +The domain is \{ans_rule(20)\} (in interval notation). +$BR If you need to enter \(\infty\), you can type $BBOLD INF$EBOLD or $BBOLD INFINITY$EBOLD. If you need to union two (or more) intervals, use the letter $BBOLD U$EBOLD. For example, to enter \((-\infty,5)\cup(5,10]\) you can type $BBOLD (-inf,5)U(5,10]$EBOLD. + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($domain->cmp); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions29.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions29.pg new file mode 100644 index 0000000000..fdacaada51 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions29.pg @@ -0,0 +1,257 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "parserPopUp.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +for my $i (0..7) { +$gr[$i] = init_graph(-5,-5,5,5, +axes=>[0,0], +grid=>[10,10], +size=>[400,400] +);} + +$yes = "represents a function"; +$no = "does not represent a function"; + + +$a = non_zero_random(-5,5,1); +$b = random(abs($a),abs($a)+5,1); +$gr[0]->moveTo(0,0); +$gr[0]->arrowTo(-5,-5*$a/$b,'blue',2); +$gr[0]->moveTo(0,0); +$gr[0]->arrowTo(5,5*$a/$b,'blue',2); +$popup[0] = PopUp( + ["?",$yes,$no], + $yes, +); + + + + +$c = random(-2,2,1); +$l = $c-2; +$u = $c+2; +add_functions($gr[1], "((x-$c)^3)/2 for x in <$l,$u>" . + " using color:blue and weight:2"); +$gr[1]->stamps( closed_circle($c-2,-4,'blue') ); +$gr[1]->stamps( closed_circle($c+2,4,'blue') ); +$popup[1] = PopUp( + ["?",$yes,$no], + $yes, +); + + +Context()->variables->add(t=>'Real'); +$d = random(-4,-1,1); +$x = Formula("$d*cos(t)/(1+cos(t))"); +$y = Formula("$d*sin(t)/(1+cos(t))"); +$f = new Fun( $x->perlFunction, $y->perlFunction, $gr[2] ); +$f->domain(0,6.28); +$f->steps(90); +$f->weight(2); +$f->color('blue'); +$popup[2] = PopUp( + ["?",$yes,$no], + $no, +); + + +$e = random(1,3,1); +$g = random(1,3,0.1); +add_functions($gr[3], "$e sin($g x) for x in <-5,5>" . + " using color:blue and weight:2"); +$popup[3] = PopUp( + ["?",$yes,$no], + $yes, +); + + +$h = random(-1,1,1); +add_functions($gr[4], "(x-$h)^2/4 for x in <-4,4>" . + " using color:blue and weight:2"); +$gr[4]->stamps( closed_circle(-4,(-4-$h)**2/4,'blue') ); +$gr[4]->stamps( closed_circle(4,(4-$h)**2/4,'blue') ); +$popup[4] = PopUp( + ["?",$yes,$no], + $yes, +); + + + +$i = random(-1,1,1); +add_functions($gr[4], "(x-$h)^2/4 for x in <-4,4>" . + " using color:blue and weight:2"); +$gr[4]->stamps( closed_circle(-4,(-4-$h)**2/4,'blue') ); +$gr[4]->stamps( closed_circle(4,(4-$h)**2/4,'blue') ); +$popup[4] = PopUp( + ["?",$yes,$no], + $yes, +); + + + +$j = random(2,4,1); +$x = Formula("$j cos(t)"); +$y = Formula("$j sin(t)"); +$f = new Fun( $x->perlFunction, $y->perlFunction, $gr[5] ); +$f->domain(0,6.28); +$f->steps(90); +$f->weight(2); +$f->color('blue'); +$popup[5] = PopUp( + ["?",$yes,$no], + $no, +); + + +$k = non_zero_random(-3,3,1); +$gr[6]->moveTo(0,$k); +$gr[6]->arrowTo(-5,$k,'blue',2); +$gr[6]->moveTo(0,$k); +$gr[6]->arrowTo(5,$k,'blue',2); +$popup[6] = PopUp( + ["?",$yes,$no], + $yes, +); + +$l = non_zero_random(-3,3,1); +$gr[7]->moveTo($l,0); +$gr[7]->arrowTo($l,-5,'blue',2); +$gr[7]->moveTo($l,0); +$gr[7]->arrowTo($l,5,'blue',2); +$popup[7] = PopUp( + ["?",$yes,$no], + $no, +); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Which of the following graphs represent a function of \(x\)? + + +$PAR + +\{ image( insertGraph($gr[0]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[0]->menu() \} + + +$PAR + +\{ image( insertGraph($gr[1]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[1]->menu() \} + + +$PAR + +\{ image( insertGraph($gr[2]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[2]->menu() \} + +$PAR + +\{ image( insertGraph($gr[3]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[3]->menu() \} + +$PAR + + +\{ image( insertGraph($gr[4]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[4]->menu() \} + + +$PAR + + +\{ image( insertGraph($gr[5]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[5]->menu() \} + + +$PAR + + +\{ image( insertGraph($gr[6]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[6]->menu() \} + + + +$PAR + + +\{ image( insertGraph($gr[7]), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) +$BR +\{ $popup[7]->menu() \} + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $popup[0]->cmp() ); +ANS( $popup[1]->cmp() ); +ANS( $popup[2]->cmp() ); +ANS( $popup[3]->cmp() ); +ANS( $popup[4]->cmp() ); +ANS( $popup[5]->cmp() ); +ANS( $popup[6]->cmp() ); +ANS( $popup[7]->cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions3.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions3.pg new file mode 100644 index 0000000000..415c5237f0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions3.pg @@ -0,0 +1,72 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl", +); + + + +############################################## +TEXT(beginproblem()); + +do { +$var1 = RandomVariableName(); +$var2 = RandomVariableName(); +} until ($var1 ne $var2); + +Context("Point"); +Context()->variables->are($var1=>'Real',$var2=>'Real'); + +$P = Point("($var1,$var2)"); + + + +############################################## + + +BEGIN_PGML +If [`[$P]`] is on the graph of [`g`], then [`g([$var1])={}`] [_____]{Formula($var2)}. + + + + +END_PGML + + +############################################## + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions4.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions4.pg new file mode 100644 index 0000000000..3f3c1a6a0c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions4.pg @@ -0,0 +1,63 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$a = random(3,12,1); +$b = non_zero_random(-5,5,1); + +$c = random(2,4,1)*random(-1,1,2); + +$f = Formula("$a x+$b")->reduce; + +$answer = $f->eval(x=>$c); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Evaluate \(f\) at the given value of \(x\). $BR + +\[f(x)=$f \qquad x=$c\] $PAR + +The function evaluates to \{ans_rule(5)\}. + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($answer->cmp); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions5.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions5.pg new file mode 100644 index 0000000000..9f88043541 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions5.pg @@ -0,0 +1,61 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$a = non_zero_random(-3,3,1); + +$c = random(2,5,1)*random(-1,1,2); + +$f = Formula("$a x^2")->reduce; + +$answer = $f->eval(x=>$c); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Evaluate \(f\) at the given value of \(x\). $BR + +\[f(x)=$f \qquad x=$c\] $PAR + +The function evaluates to \{ans_rule(5)\}. + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($answer->cmp); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions6.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions6.pg new file mode 100644 index 0000000000..87cdad5b07 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions6.pg @@ -0,0 +1,65 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + + +); + +TEXT(beginproblem()); + + +############################################## + + +Context("Numeric"); + +$a = random(10,100,1); + + +$c = random(1,10,1)*random(-1,1,2); + +$f = Formula("$a")->reduce; + + +$answer = $f->eval(x=>$a); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Evaluate \(f\) at the given value of \(x\). $BR + +\[f(x)=$f \qquad x=$c\] $PAR + +The function evaluates to \{ans_rule(5)\}. + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($answer->cmp()); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions7.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions7.pg new file mode 100644 index 0000000000..31ef613fbc --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions7.pg @@ -0,0 +1,71 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$a = random(1,4,1); +$b = random(1,5,1); + +$c = random(1,10,1)*random(-1,1,2); +while ($c == $b) { +$c = random(1,10,1)*random(-1,1,2); +} + +$f = Formula("($a x)/(x-$b)")->reduce; + +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); +$n = $a*$c; +$d = $c-$b; +$answer = Fraction("$n","$d"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Evaluate \(f\) at the given value of \(x\). $BR + +\[f(x)=$f \qquad x=$c\] $PAR + +The function evaluates to \{ans_rule(5)\}. + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($answer->cmp(studentsMustReduceFractions=>1)); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions8.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions8.pg new file mode 100644 index 0000000000..88482855fe --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions8.pg @@ -0,0 +1,58 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); + +$M = Formula("x/5280"); + +$c = random(10000,30000,1000); + +$ans = $M->eval(x=>$c); + + +############################################## + + +BEGIN_PGML +Suppose that [`M`] is the function that computes how many miles are in [`x`] feet. Find the algebraic rule for [`M`]. (If you do not know how many feet are in one mile, you can look it up on Google.) + + [`M(x) ={}`][_______________]{$M} + + +Evaluate [`M`] when [`x=[$c]`] and interpret the result. + + [`M\Big(`][_____]{$c}[`\Big){}={}`][_____]{$ans->cmp(tolType=>absolute,tolerance=>0.05)} + + There are about [__________]{$ans->cmp(tolType=>absolute,tolerance=>0.05)} miles in [__________]{Compute($c)} feet. + + +END_PGML + +############################################## + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions9.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions9.pg new file mode 100644 index 0000000000..1c8ec1b568 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/Functions9.pg @@ -0,0 +1,72 @@ +# WeBWorK problem written by Alex Jordan, 2011 +# Portland Community College +# +# Evaluate a function. Function is linear. +# +# Last updated: Jordan 12/22/13; +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", + +); + + + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); + +$K = Formula("x/2.20462262"); + +$c = random(100,300,1); + +$ans = $K->eval(x=>$c); + + +############################################## + +BEGIN_PGML +Suppose that [`K`] is the function that computes how many kilograms are in [`x`] pounds (on Earth, for sticklers). Find the algebraic rule for [`K`]. (If you do not know how many pounds are in one kilogram, you can look it up on Google.) + +[`K(x) ={}`][_______________]{$K->cmp(tolerance=>0.01)} + +Evaluate [`K`] when [`x=[$c]`] and interpret the result. + + [`K\Big(`][_____]{$c}[`\Big){}={}`][_____]{$ans->cmp(tolerance=>0.01)} + + Something that weighs [_____]{$c} pounds has a mass of about [_____]{$ans->cmp(tolerance=>0.01)} kilograms. + + +END_PGML + + +############################################## + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities1.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities1.pg new file mode 100644 index 0000000000..40b4714aed --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities1.pg @@ -0,0 +1,154 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PGML.pl", + "contextFraction.pl", +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0,'(-x)+y'=>0); + +$yes = "The given value is a solution to the inequality."; +$no = "The given value is not a solution to the inequality."; + + +$a[0] = random(1,9,1); +$b[0] = random(1,9,1); +$var[0] = "x"; +$x[0] = random(0,9,1); +$left[0] = Formula("x-$a[0]")->reduce; +$right[0] = Formula("$b[0]")->reduce; +$comp[0] = "$LTE"; +if ($left[0]->eval(x=>$x[0]) <= $right[0]->eval(x=>$x[0])) +{$ans[0] = $yes;} +else {$ans[0] = $no;}; + +Context("Fraction"); +$a[1] = random(1,9,1); +$b[1] = random(1,9,1); +$c[1] = random(1,9,1); +$d[1] = random(1,9,1); +$e[1] = random(1,9,1); +$f[1] = random(1,9,1); +$A[1] = Fraction("$a[1]","$b[1]"); +$B[1] = Fraction("$c[1]","$d[1]"); +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0,'(-x)+y'=>0); +Context()->flags->set(reduceConstants=>0); +$var[1] = "x"; +$x[1] = random(-9,9,1); +$left[1] = Formula("$A[1] x-$B[1]"); +$right[1] = Formula("$e[1] -$f[1] x")->reduce; +$comp[1] = "$GTE"; +if ($left[1]->eval(x=>$x[1]) >= $right[1]->eval(x=>$x[1])) +{$ans[1] = $yes;} +else {$ans[1] = $no;}; + + + +$a[2] = random(1,9,1); +$b[2] = random(1,9,1); +$c[2] = random(1,9,1); +$d[2] = random(1,9,1); +$e[2] = random(1,9,1); +$var[2] = "t"; +Context()->variables->are(t=>'Real'); +$x[2] = random(-9,9,1); +$left[2] = Formula("$a[2] t - $b[2]"); +$right[2] = Formula("$c[2] t - ($d[2] t+$e[2])")->reduce; +$comp[2] = "$GTS"; +if ($left[2]->eval(t=>$x[2]) > $right[2]->eval(t=>$x[2])) +{$ans[2] = $yes;} +else {$ans[2] = $no;}; + + +$a[3] = random(1,9,1); +$b[3] = random(1,9,1); +$c[3] = random(1,9,1); +$d[3] = random(1,9,1); +$e[3] = random(1,9,1); +$var[3] = "z"; +Context()->variables->are(z=>'Real'); +$x[3] = pi; +$left[3] = Formula("$a[3](z - $b[3])"); +$right[3] = Formula("$c[3]($d[3] z + $e[3])")->reduce; +$comp[3] = "$LTS"; +if ($left[3]->eval(z=>$x[3]) < $right[3]->eval(z=>$x[3])) +{$ans[3] = $yes;} +else {$ans[3] = $no;}; +$x[3] = "\pi"; + +Context()->texStrings; + +for my $i (0..3) { +$radio[$i] = new_multiple_choice(); +$radio[$i]->qa("\($left[$i] $comp[$i] $right[$i]\qquad $var[$i] = $x[$i]\)", "$ans[$i]"); +$radio[$i]->extra("$yes", "$no"); +$radio[$i]->makeLast("$no"); +} + + + +############################################## + + +BEGIN_PGML + +Decide whether the given value for the variable is a solution to the inequality. + +[@ $radio[0]->print_q() @]* + +[@ $radio[0]->print_a() @]* + +---- + +[@ $radio[1]->print_q() @]* + +[@ $radio[1]->print_a() @]* + +---- + +[@ $radio[2]->print_q() @]* + +[@ $radio[2]->print_a() @]* + +---- + +[@ $radio[3]->print_q() @]* + +[@ $radio[3]->print_a() @]* + + + + + +END_PGML + + +############################################## + +for my $i (0..3){ +ANS( radio_cmp( $radio[$i]->correct_ans() ) );} + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities10.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities10.pg new file mode 100644 index 0000000000..9d51f90747 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities10.pg @@ -0,0 +1,56 @@ +## DESCRIPTION +## Algebra - Inequalities +## ENDDESCRIPTION + +## KEYWORDS('Algebra','Inequalities') +## Tagged by dgt5v + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"extraAnswerEvaluators.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(1,20,1); +$b = random(1,20,1); + +TEXT(EV2(<cmp); + +################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities3.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities3.pg new file mode 100644 index 0000000000..71a3db3916 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities3.pg @@ -0,0 +1,56 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','inequalities') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGunion.pl", # Union College utilities + "MathObjects.pl", + "PGcourse.pl", # Customization file for the course +); + + +TEXT(beginproblem()); + +################################### +# Setup + +$a = random(-12,12,1); + +################################### +# Main text + +BEGIN_TEXT +Solve the following inequality and express the solution using interval notation. +\[ x $GE $a \] +\(x\) is in \{ans_rule(35)\} +$PAR +$INFINITY_UNION_MESSAGE +END_TEXT + +################################### +# Answers + +$showPartialCorrectAnswers = 0; + +$ans1="[$a,infinity)"; +ANS(Union($ans1)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities4.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities4.pg new file mode 100644 index 0000000000..fcfc360cee --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities4.pg @@ -0,0 +1,59 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','inequalities') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGunion.pl", # Union College utilities + "MathObjects.pl", + "PGcourse.pl", # Customization file for the course +); + + +TEXT(beginproblem()); + +################################### +# Setup + +$a = random(1,20,1); +$b = random(1,20,1); + +################################### +# Main text + +BEGIN_TEXT +Solve the following inequality and express the solution using interval notation. +\[ \frac{1}{2}x -$a > $b \] +\(x\) is in \{ans_rule(35)\} +$PAR +$INFINITY_UNION_MESSAGE +END_TEXT + +################################### +# Answers + +$showPartialCorrectAnswers = 0; + +$ans1 = "( 2*($a+$b), INF) "; +ANS(Union($ans1)->cmp); + +################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities5.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities5.pg new file mode 100644 index 0000000000..be0af1c23f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities5.pg @@ -0,0 +1,72 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','inequalities') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGunion.pl", # Union College utilities + "MathObjects.pl", + "PGcourse.pl", # Customization file for the course +); + + +TEXT(beginproblem()); + +################################### +# Setup + +Context("Interval"); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); +while($c==1){$c=random(-10,10,1);} +$d = non_zero_random(-10,10,1); +while($a-$c*$d==0){$d=non_zero_random(-10,10,1);} + +$g=$a-$c*$d; +$e = non_zero_random(-6,6,1); +$f = non_zero_random(-6,6,1); + +$h=$c*$e+$f-$b; +$k=$h/$g; + +################################### +# Main text + +BEGIN_TEXT +Solve the following inequality. Enter the answer in interval notation. +\[ ${a}x +$b < $c(${d}x +$e)+$f \] +\(x\) is in \{ans_rule(35)\} +$PAR +$INFINITY_UNION_MESSAGE +END_TEXT + +################################### +# Answers + +$showPartialCorrectAnswers = 1; +if($g>0) +{ANS(Interval("(-INF,$k)")->cmp);} +else +{ANS(Interval("($k,INF)")->cmp);} + +################################### +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities6.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities6.pg new file mode 100644 index 0000000000..ad4ebebd17 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities6.pg @@ -0,0 +1,57 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','inequalities') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGunion.pl", # Union College utilities + "MathObjects.pl", + "PGcourse.pl", # Customization file for the course +); + + +TEXT(beginproblem()); + +################################### +# Setup + +$a = non_zero_random(-5,5,1); +$b = non_zero_random(-5,5,1); +while ($b == $a){$b = random(-5,5,1);} + +################################### +# Main text + +BEGIN_TEXT +Solve the following inequality. Enter the answer in interval notation. +\[ $a - x < $b \] +\(x\) is in \{ans_rule(35)\} +$PAR +$INFINITY_UNION_MESSAGE +END_TEXT + +################################### +# Answers +$showPartialCorrectAnswers = 1; +$c = $a-$b; +ANS(Interval("($c,INF)")->cmp); + +################################### +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities7.pg b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities7.pg new file mode 100644 index 0000000000..4c584a6214 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/OldFilesAlreadyRepresentedInPrecollegeAlgebra/LinearInequalities7.pg @@ -0,0 +1,56 @@ +## DESCRIPTION +## Algebra +## ENDDESCRIPTION + +## KEYWORDS('algebra','inequalities') +## Tagged by cmd6a 8/6/06 + +## DBsubject('Algebra') +## DBchapter('Equations and Inequalities') +## DBsection('Linear Inequalities') +## Date('8/23/07') +## Author('K. Lesh') +## Institution('Union College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGunion.pl", # Union College utilities + "MathObjects.pl", + "PGcourse.pl", # Customization file for the course +); + + +TEXT(beginproblem()); + +################################### +# Setup + +$a = random(-10,10,1); + +################################### +# Main text + +BEGIN_TEXT +Solve the following inequality and express the solution using interval notation. +\[x < $a\] +\(x\) is in \{ans_rule(35)\} +$PAR +$INFINITY_UNION_MESSAGE +END_TEXT + +################################### +# Answers + +$showPartialCorrectAnswers = 0; + +$ans1="(-INF,$a)"; +ANS(Union($ans1)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex1.pg b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex1.pg new file mode 100644 index 0000000000..ea53130d4a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex1.pg @@ -0,0 +1,72 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$a = non_zero_random(-10,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); + +$f = Formula("$a x^2+$b x+$c")->reduce; + +$h = Fraction("-$b","2*$a"); +$k = $f->eval(x=>$h); + +Context("Point"); +Context()->flags->set(reduceConstants=>0); + +$v = Compute("($h,$k)"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Find the vertex of the graph of + +\[y=$f \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $v->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex2.pg b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex2.pg new file mode 100644 index 0000000000..ea53130d4a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex2.pg @@ -0,0 +1,72 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$a = non_zero_random(-10,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); + +$f = Formula("$a x^2+$b x+$c")->reduce; + +$h = Fraction("-$b","2*$a"); +$k = $f->eval(x=>$h); + +Context("Point"); +Context()->flags->set(reduceConstants=>0); + +$v = Compute("($h,$k)"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Find the vertex of the graph of + +\[y=$f \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $v->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex3.pg b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex3.pg new file mode 100644 index 0000000000..7e2c075dae --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex3.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$a = non_zero_random(-10,10,1); +$h = non_zero_random(-10,10,1); +$k = non_zero_random(-10,10,1); + +Context()->noreduce('(-x)-y','(-x)+y'); +$f = Formula("$a (x-$h)^2+$k")->reduce; + + + +Context("Point"); +Context()->flags->set(reduceConstants=>0); + +$v = Compute("($h,$k)"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Find the vertex of the graph of \(y=$f \). + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $v->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex4.pg b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex4.pg new file mode 100644 index 0000000000..6fc27e8600 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex4.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$a = non_zero_random(-10,10,0.1); +$h = non_zero_random(-10,10,0.1); +$k = non_zero_random(-10,10,0.1); + +Context()->noreduce('(-x)-y','(-x)+y'); +$f = Formula("$a (x-$h)^2+$k")->reduce; + + + +Context("Point"); +Context()->flags->set(reduceConstants=>0); + +$v = Compute("($h,$k)"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Find the vertex of the graph of \(y=$f \). + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $v->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex5.pg b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex5.pg new file mode 100644 index 0000000000..f2d96e6d74 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex5.pg @@ -0,0 +1,72 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$a = non_zero_random(1,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); + +$f = Formula("$a x^2+$b x+$c")->reduce; + +$h = Fraction("-$b","2*$a"); +$k = $f->eval(x=>$h); + + +Context()->flags->set(reduceConstants=>0); + +$v = Compute("$k"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Find the minimum value of the function + +\[f(x)=$f \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $v->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex6.pg b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex6.pg new file mode 100644 index 0000000000..1d5ee77061 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex6.pg @@ -0,0 +1,72 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$a = -non_zero_random(1,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); + +$f = Formula("$a x^2+$b x+$c")->reduce; + +$h = Fraction("-$b","2*$a"); +$k = $f->eval(x=>$h); + + +Context()->flags->set(reduceConstants=>0); + +$v = Compute("$k"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Find the maximum value of the function + +\[f(x)=$f \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $v->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex7.pg b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex7.pg new file mode 100644 index 0000000000..4a363fe587 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex7.pg @@ -0,0 +1,73 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$a = -non_zero_random(1,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); + +$f = Formula("$a x^2+$b x+$c")->reduce; + +$h = Fraction("-$b","2*$a"); +$k = $f->eval(x=>$h); + + +Context("Interval"); +Context()->flags->set(reduceConstants=>0); + +$v = Compute("(-inf,$k]"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Find the range of the function + +\[f(x)=$f \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $v->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex8.pg b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex8.pg new file mode 100644 index 0000000000..f6494ef430 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex8.pg @@ -0,0 +1,73 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$a = non_zero_random(1,10,1); +$b = random(-10,10,1); +$c = random(-10,10,1); + +$f = Formula("$a x^2+$b x+$c")->reduce; + +$h = Fraction("-$b","2*$a"); +$k = $f->eval(x=>$h); + + +Context("Interval"); +Context()->flags->set(reduceConstants=>0); + +$v = Compute("[$k,inf)"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Find the range of the function + +\[f(x)=$f \] + +$PAR + + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $v->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex9.pg b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex9.pg new file mode 100644 index 0000000000..75a84c72bf --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/ParabolaVertex/ParabolaVertex9.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->variables->are(t=>'Real'); + +$v0 = random(50,70,1); +$h0 = 2; +$a = -16; +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$f = Formula("$a/2 t^2+$v0 t+$h0")->reduce; + +$h = -$v0/($a); +$k = $f->eval(t=>$h); + + +$velocity = NumberWithUnits("$v0","ft/s"); + + +Context("Interval"); +Context()->flags->set(reduceConstants=>0); + +$maxheight = NumberWithUnits("$k","ft"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +If a ball is throw straight up with a speed of \($velocity\), its height at time \(t\) (in seconds) is given by + +\[h(t)=$f \] + +$PAR + +Find the maximum height the ball reaches. + + +$SPACE $SPACE $SPACE \{ans_rule(20)\} + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $maxheight->cmp()); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition1.pg b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition1.pg new file mode 100644 index 0000000000..60954f6e77 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition1.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real',x=>'Real'); + +@poly1array = (random(5,10,1),random(5,10,1)); +@poly2array = (random(-20,-10,1),random(3,7,1)); + + +@sumarray = PolyAdd(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@sumarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Add the polynomials. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)+\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition10.pg b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition10.pg new file mode 100644 index 0000000000..36537541ed --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition10.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", + "contextFraction.pl", + +); + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real',x=>'Real'); + +$a = random(1,15,1); +$b = $a+3; + +$c = random(1,15,1); +$d = $d+4; + +$e = random(1,15,1); +$f = $e+1; + +$g = random(5,20,1); +$h = random(-30,-5,1); +$i = non_zero_random(-5,5,1); +$j = Compute("$a/$b"); +$k = Compute("$c/$d"); +$l = 1; +$m = 1; +$n = Compute("$e/$f"); + +$o = $g - $k; +$p = $h - $l; +$q = $i - $m; +$r = $j - $n; + + +$poly1 = Formula("$g x^3+$h x^2+$i x+$j")->reduce; +$poly2 = Formula("$k x^3+$l x^2+$m x+$n")->reduce; +$ans = Formula("$o x^3+$p x^2+$q x+$r")->reduce; + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Subtract the polynomials. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)-\left($poly2\right)\) + +$PAR +\{ ans_rule(30) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition11.pg b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition11.pg new file mode 100644 index 0000000000..f9bd6bd40e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition11.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacrosPCC.pl", + + +); + + + + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +$var = 'y'; +Context()->variables->are($var=>'Real',x=>'Real'); + +@poly1array = (random(5,9,1),random(-6,-2,1),2); +@poly2array = (random(7,17,1),random(2,4,1),random(-8,-2,1)); +@poly3array = (5,-2,random(-12,-4,1)); +@poly4array = (random(-12,-5,1),random(5,10,1),-23); + +@sum1array = PolySub(~~@poly1array,~~@poly2array); +@sum2array = PolyAdd(~~@poly3array,~~@poly4array); +@sumarray = PolySub(~~@sum1array,~~@sum2array); + +@poly1 = PolyTerms(~~@poly1array,$var,"descending"); +@poly2 = PolyTerms(~~@poly2array,$var,"descending"); +@poly3 = PolyTerms(~~@poly3array,$var,"descending"); +@poly4 = PolyTerms(~~@poly4array,$var,"descending"); +@sum = PolyTerms(~~@sumarray,$var,"descending"); + + + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); + +$ans = Compute("@sum"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Perform the indicated operations. $PAR + + + +$SPACE $SPACE $SPACE +\(\left[\left(@poly1\right) - \left(@poly2\right)\right]-\left[\left(@poly3\right)+\left(@poly4\right)\right]\) + +$PAR +$SPACE +$PAR + +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition2.pg b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition2.pg new file mode 100644 index 0000000000..cb092bd2f5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition2.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real',x=>'Real'); + +@poly1array = (random(5,10,1),random(5,10,1),non_zero_random(-10,10,1)); +@poly2array = (random(-20,-10,1),random(3,7,1)); + + +@sumarray = PolyAdd(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@sumarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Add the polynomials. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)+\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition3.pg b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition3.pg new file mode 100644 index 0000000000..388d0c81ff --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition3.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real',x=>'Real'); + +@poly1array = (non_zero_random(-20,20,1),0,non_zero_random(-10,10,1)); +@poly2array = (random(-20,-10,1),random(3,7,1)); + + +@sumarray = PolyAdd(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@sumarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Add the polynomials. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)+\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition4.pg b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition4.pg new file mode 100644 index 0000000000..0b1917bb3c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition4.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real',x=>'Real'); + +@poly1array = (non_zero_random(-20,20,1),non_zero_random(-10,10,1),0); +@poly2array = (non_zero_random(-20,10,1),random(3,7,1)); + + +@sumarray = PolyAdd(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@sumarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Add the polynomials. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)+\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition5.pg b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition5.pg new file mode 100644 index 0000000000..2f5388e691 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition5.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", + "contextFraction.pl", + +); + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real',x=>'Real'); + +$a = random(1,15,1); +$b = $a+3; + +$c = random(1,15,1); +$d = $d+4; + +$e = random(1,15,1); +$f = $e+1; + +$g = random(5,20,1); +$h = random(-30,-5,1); +$i = non_zero_random(-5,5,1); +$j = Compute("$a/$b"); +$k = Compute("$c/$d"); +$l = 1; +$m = 1; +$n = Compute("$e/$f"); + +$o = $g + $k; +$p = $h + $l; +$q = $i + $m; +$r = $j + $n; + + +$poly1 = Formula("$g x^3+$h x^2+$i x+$j")->reduce; +$poly2 = Formula("$k x^3+$l x^2+$m x+$n")->reduce; +$ans = Formula("$o x^3+$p x^2+$q x+$r")->reduce; + + +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); + + +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Add the polynomials. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)+\left($poly2\right)\) + +$PAR +\{ ans_rule(40) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition6.pg b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition6.pg new file mode 100644 index 0000000000..44d9498f0c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition6.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real',x=>'Real'); + +@poly1array = (random(5,10,1),random(5,10,1)); +@poly2array = (random(-20,-10,1),random(3,7,1)); + + +@sumarray = PolySub(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@sumarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Subtract the polynomials. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)-\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition7.pg b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition7.pg new file mode 100644 index 0000000000..bf2c40f806 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition7.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real',x=>'Real'); + +@poly1array = (random(5,10,1),random(5,10,1),non_zero_random(-10,10,1)); +@poly2array = (random(-20,-10,1),random(3,7,1)); + + +@sumarray = PolySub(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@sumarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Subtract the polynomials. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)-\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition8.pg b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition8.pg new file mode 100644 index 0000000000..2e39d66b7a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition8.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real',x=>'Real'); + +@poly1array = (non_zero_random(-20,20,1),0,non_zero_random(-10,10,1)); +@poly2array = (random(-20,-10,1),random(3,7,1)); + + +@sumarray = PolySub(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@sumarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Subtract the polynomials. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)-\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition9.pg b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition9.pg new file mode 100644 index 0000000000..4b40376292 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialAddition/PolynomialAddition9.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +$var = 'x'; +Context()->variables->are($var=>'Real',x=>'Real'); + +@poly1array = (non_zero_random(-20,20,1),non_zero_random(-10,10,1),0); +@poly2array = (non_zero_random(-20,10,1),random(3,7,1)); + + +@sumarray = PolySub(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@sumarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Subtract the polynomials. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)-\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision1.pg b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision1.pg new file mode 100644 index 0000000000..77423f817e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision1.pg @@ -0,0 +1,74 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + +); + + + + + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(2,6,1); +$b = random(4,8,1)*random(-1,1,2); +$c = random(2,6,1); + +$A = Fraction("$a","$c"); +$B = Fraction("$b","$c"); + +$f = Formula("($a x+$b)/($c)")->reduce; + +Context("LimitedPolynomial"); + +$quo = Formula("$A x + $B"); + + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +Divide the polynomials. + +$PAR + +\[$f\] + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(15)\} + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $quo -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision10.pg b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision10.pg new file mode 100644 index 0000000000..bdc9acc143 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision10.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + +); + + + + + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(2,5,1); +$b = random(-9,-5,1); +$c = random(6,10,1); +$d = random(2,4,1)*random(-1,1,2); +$d1 = random(2,3,1); +$e = non_zero_random(-4,4,1); + + + +$f = Formula("(($a*$d1) x^3 + ($b*$d1-$a*$d) x^2 + ($c*$d1-$b*$d) x + ($c*(-$d)+$e))/($d1 x-$d)")->reduce; + +Context("LimitedPolynomial"); + +$quo = Formula("$a x^2 + $b x + $c")->reduce; + +Context("RationalFunction"); +$rem = Formula("($e)/($d1 x-$d)")->reduce; + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +Divide the polynomials. If there is a remainder, enter the quotient in the first box and the rest in the second box. For example, since \(\frac{x}{x+1}= 1 - \frac{1}{x+1}\), you would enter \(1\) in the first box, and \(\frac{1}{x+1}\) in the second box. + +$PAR + +\[$f\] + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(30)\} \(+\) \{ans_rule(30)\} + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $quo -> cmp() ); +ANS( $rem -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision11.pg b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision11.pg new file mode 100644 index 0000000000..486b395a57 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision11.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + +); + + + + + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(2,5,1); +$b = random(-9,-5,1); +$c = random(6,10,1); +$d = random(2,4,1)*random(-1,1,2); +$d1 = random(3,5,1); +$e = non_zero_random(-4,4,1); + + + +$f = Formula("(($a*$d1) x^3 + ($b*$d1-$a*$d) x^2 + ($c*$d1-$b*$d) x + ($c*(-$d)+$e))/($d1 x-$d)")->reduce; + +Context("LimitedPolynomial"); + +$quo = Formula("$a x^2 + $b x + $c")->reduce; + +Context("RationalFunction"); +$rem = Formula("($e)/($d1 x-$d)")->reduce; + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +Divide the polynomials. If there is a remainder, enter the quotient in the first box and the rest in the second box. For example, since \(\frac{x}{x+1}= 1 - \frac{1}{x+1}\), you would enter \(1\) in the first box, and \(\frac{1}{x+1}\) in the second box. + +$PAR + +\[$f\] + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(30)\} \(+\) \{ans_rule(30)\} + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $quo -> cmp() ); +ANS( $rem -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision2.pg b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision2.pg new file mode 100644 index 0000000000..70a14f8934 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision2.pg @@ -0,0 +1,76 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + +); + + + + + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(2,6,1); +$b = random(4,8,1)*random(-1,1,2); +$c = random(2,6,1); +$n = random(2,3,1); +$m = $n+random(1,3,1); + +$A = Fraction("$a","$c"); +$B = Fraction("$b","$c"); + +$f = Formula("($a x^($m)+$b x^($n))/($c x^($n))")->reduce; + +Context("LimitedPolynomial"); + +$quo = Formula("$A x^($m-$n) + $B")->reduce; + + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +Divide the polynomials. + +$PAR + +\[$f\] + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(15)\} + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $quo -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision3.pg b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision3.pg new file mode 100644 index 0000000000..e1da4f93be --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision3.pg @@ -0,0 +1,78 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + +); + + + + + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(7,11,1); +$b = random(8,16,1)*random(-1,1,2); +$c = random(1,5,1)*random(-1,1,2); +$d = random(2,8,1); +#$n = random(2,3,1); +#$m = $n+random(1,3,1); + +$A = Fraction("$a","$d"); +$B = Fraction("$b","$d"); +$C = Fraction("$c","$d"); + +$f = Formula("($a x^2+$b x + $c)/($d)")->reduce; + +Context("LimitedPolynomial"); + +$quo = Formula("$A x^2 + $B x + $C")->reduce; + + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +Divide the polynomials. + +$PAR + +\[$f\] + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(30)\} + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $quo -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision4.pg b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision4.pg new file mode 100644 index 0000000000..d0fcd4493d --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision4.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + +); + + + + + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(20,50,5); +$b = random(10,25,5)*random(-1,1,2); +$c = random(40,100,5)*random(-1,1,2); +$d = random(5,25,5); +$n = random(1,3,1); +$m = random(4,5,1); +$m2 = $m-2; +$m3 = $m-3; + +$A = Fraction("$a","$d"); +$B = Fraction("$b","$d"); +$C = Fraction("$c","$d"); + +$f = Formula("($a x^($m+$n)+$b x^($m+$n-2) + $c x^($m+$n-3))/($d x^($n))")->reduce; + +Context("LimitedPolynomial"); + +$quo = Formula("$A x^($m) + $B x^($m2) + $C x^($m3)")->reduce; + + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +Divide the polynomials. + +$PAR + +\[$f\] + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(30)\} + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $quo -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision5.pg b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision5.pg new file mode 100644 index 0000000000..0aaf5bc2f9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision5.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + +); + + + + + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(4,8,1); +$b = random(6,12,1)*random(-1,1,2); +#$c = random(40,100,5)*random(-1,1,2); +$d = random(2,5,1); +#$n = random(1,3,1); +#$m = random(3,4,1); + +$A = Fraction("$a","$d"); +$B = Fraction("$b","$d"); +#$C = Fraction("$c","$d"); + +Context()->variables->are(p=>'Real',q=>'Real'); +$f = Formula("($a p^2 q^4+$b p^6 q^2)/($d p q)")->reduce; + +Context("LimitedPolynomial"); +Context()->variables->are(p=>'Real',q=>'Real'); + +$quo = Formula("$A p q^3 + $B p^5 q")->reduce; + + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +Divide the polynomials. + +$PAR + +\[$f\] + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(30)\} + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $quo -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision6.pg b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision6.pg new file mode 100644 index 0000000000..d0a369b46e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision6.pg @@ -0,0 +1,72 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + +); + + + + + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(1,5,1); +$b = random(2,5,1); +$c = random(4,9,1)*random(-1,1,2); + + +$f = Formula("($b x^2 + (-$a*$b+$c) x + (-$a*$c))/(x-$a)")->reduce; + +Context("LimitedPolynomial"); + +$quo = Formula("$b x + $c")->reduce; + + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +Divide the polynomials. + +$PAR + +\[$f\] + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(30)\} + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $quo -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision7.pg b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision7.pg new file mode 100644 index 0000000000..757df31226 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision7.pg @@ -0,0 +1,78 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + +); + + + + + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(1,3,1); +$b = random(-9,-5,1); +$c = random(6,10,1); +$d = random(1,4,1); +$e = non_zero_random(-4,4,1); + + + +$f = Formula("($a x^3 + ($b-$a*$d) x^2 + ($c-$b*$d) x + ($c*(-$d)+$e))/(x-$d)")->reduce; + +Context("LimitedPolynomial"); + +$quo = Formula("$a x^2 + $b x + $c")->reduce; + +Context("RationalFunction"); +$rem = Formula("($e)/(x-$d)")->reduce; + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +Divide the polynomials. If there is a remainder, enter the quotient in the first box and the rest in the second box. For example, since \(\frac{x}{x+1}= 1 - \frac{1}{x+1}\), you would enter \(1\) in the first box, and \(\frac{1}{x+1}\) in the second box. + +$PAR + +\[$f\] + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(30)\} \(+\) \{ans_rule(30)\} + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $quo -> cmp() ); +ANS( $rem -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision8.pg b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision8.pg new file mode 100644 index 0000000000..cf46a718f3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision8.pg @@ -0,0 +1,78 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + +); + + + + + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(2,5,1); +$b = random(-9,-5,1); +$c = random(6,10,1); +$d = random(2,4,1)*random(-1,1,2); +$e = non_zero_random(-4,4,1); + + + +$f = Formula("($a x^3 + ($b-$a*$d) x^2 + ($c-$b*$d) x + ($c*(-$d)+$e))/(x-$d)")->reduce; + +Context("LimitedPolynomial"); + +$quo = Formula("$a x^2 + $b x + $c")->reduce; + +Context("RationalFunction"); +$rem = Formula("($e)/(x-$d)")->reduce; + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +Divide the polynomials. If there is a remainder, enter the quotient in the first box and the rest in the second box. For example, since \(\frac{x}{x+1}= 1 - \frac{1}{x+1}\), you would enter \(1\) in the first box, and \(\frac{1}{x+1}\) in the second box. + +$PAR + +\[$f\] + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(30)\} \(+\) \{ans_rule(30)\} + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $quo -> cmp() ); +ANS( $rem -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision9.pg b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision9.pg new file mode 100644 index 0000000000..cf46a718f3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialDivision/PolynomialDivision9.pg @@ -0,0 +1,78 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "contextRationalFunction.pl", + "contextFraction.pl", + +); + + + + + +############################################## + + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(2,5,1); +$b = random(-9,-5,1); +$c = random(6,10,1); +$d = random(2,4,1)*random(-1,1,2); +$e = non_zero_random(-4,4,1); + + + +$f = Formula("($a x^3 + ($b-$a*$d) x^2 + ($c-$b*$d) x + ($c*(-$d)+$e))/(x-$d)")->reduce; + +Context("LimitedPolynomial"); + +$quo = Formula("$a x^2 + $b x + $c")->reduce; + +Context("RationalFunction"); +$rem = Formula("($e)/(x-$d)")->reduce; + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +Divide the polynomials. If there is a remainder, enter the quotient in the first box and the rest in the second box. For example, since \(\frac{x}{x+1}= 1 - \frac{1}{x+1}\), you would enter \(1\) in the first box, and \(\frac{1}{x+1}\) in the second box. + +$PAR + +\[$f\] + +$PAR + +$SPACE $SPACE $SPACE \{ans_rule(30)\} \(+\) \{ans_rule(30)\} + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $quo -> cmp() ); +ANS( $rem -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations1.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations1.pg new file mode 100644 index 0000000000..a4c9ceaeab --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations1.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = random(1,10,1); +$b = random(1,10,1); + +$left = Compute("$a**2 $var**2 - $b**2")->reduce; +$right = Compute("0"); + +Context("Fraction"); +$r1 = Fraction("$b","$a"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$r1,-$r1}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations10.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations10.pg new file mode 100644 index 0000000000..de97f64f4b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations10.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = random(1,10,1); +$b = random(1,10,1); + +$left = Compute("$a**2 $var**2 + $b**2")->reduce; +$right = Compute("0"); + +Context("Fraction"); +$r1 = Fraction("$b","$a"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations11.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations11.pg new file mode 100644 index 0000000000..84f753626d --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations11.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = random(1,10,1); +$b = random(1,10,1); + +$left = Compute("$a**2 $var**3")->reduce; +$right = Compute("$b**2 $var")->reduce; + +Context("Fraction"); +$r1 = Fraction("$b","$a"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{0,$r1,-$r1}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations12.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations12.pg new file mode 100644 index 0000000000..1750088413 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations12.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = random(1,10,1); +$b = random(1,10,1); + +$left = Compute("$a**2 $var**3 + $b**2 $var")->reduce; +$right = Compute("0"); + +Context("Fraction"); +$r1 = Fraction("$b","$a"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{0}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations13.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations13.pg new file mode 100644 index 0000000000..bc1ea89c95 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations13.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(4,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(0,4,1); +$d = non_zero_random(-6,6,1); +while ($a*$d == $b*$c) {$d = non_zero_random(-6,6,1);}; + + +$left = Compute("$a*$c $var**3 - ($a*$d+$b*$c) $var^2 ")->reduce; +$right = Compute("-$b*$d $var")->reduce; + +Context("Fraction"); +$r1 = Fraction("$b","$a"); +$r2 = Fraction("$d","$c"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{0,$r1,$r2}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations14.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations14.pg new file mode 100644 index 0000000000..4ac7a13fe6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations14.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(1,10,1); +$b = non_zero_random(-15,15,1); +$c = non_zero_random(0,4,1); +$d = non_zero_random(-6,6,1); +while ($a*$d == $b*$c) {$d = non_zero_random(-6,6,1);}; + + +$left = Compute("$a*$c $var**4 - ($a*$d+$b*$c) $var**3 + $b*$d $var**2")->reduce; +$right = Compute("0"); + +Context("Fraction"); +$r1 = Fraction("$b","$a"); +$r2 = Fraction("$d","$c"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{0,$r1,$r2}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations15.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations15.pg new file mode 100644 index 0000000000..9a3399a439 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations15.pg @@ -0,0 +1,78 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-20,20,1); +$b = non_zero_random(-10,10,1); +while ($b**2 == $a) {$b = non_zero_random(-10,10,1);}; + + +$left = Compute("$var**3 - $a $var**2 - $b**2 $var+$a*$b**2")->reduce; +$right = Compute("0"); + +#Context("Fraction"); +#$r1 = Fraction("$b","$a"); +#$r2 = Fraction("$d","$c"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$a,$b,-$b}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations16.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations16.pg new file mode 100644 index 0000000000..f08a98dbed --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations16.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); +Context()->reductions->set('(-x)-y'=>0,'(-x)+y'=>0); + +$a = non_zero_random(-20,20,1); +$b = non_zero_random(-10,10,1); +while ($b**2 == $a) {$b = non_zero_random(-10,10,1);}; + + +$left = Compute("$var**3+$a*$b**2")->reduce; +$right = Compute(" $a $var**2 +$b**2 $var")->reduce; + +#Context("Fraction"); +#$r1 = Fraction("$b","$a"); +#$r2 = Fraction("$d","$c"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$a,$b,-$b}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations2.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations2.pg new file mode 100644 index 0000000000..2a75fa3fdb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations2.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = random(1,10,1); +$b = random(1,10,1); + +$left = Compute("$a**2 $var**2 - $b**2")->reduce; +$right = Compute("0"); + +Context("Fraction"); +$r1 = Fraction("$b","$a"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$r1,-$r1}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations3.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations3.pg new file mode 100644 index 0000000000..25557f718c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations3.pg @@ -0,0 +1,76 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = random(1,10,1); +$b = random(1,10,1); +while ($a == $b) {$b = random(1,10,1);} + +$left = Compute("$var**2 - ($a+$b) $var + $a*$b")->reduce; +$right = Compute("0"); + +#Context("Fraction"); +#$r1 = Fraction("$b","$a"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$a,$b}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations4.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations4.pg new file mode 100644 index 0000000000..f97be8d5b8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations4.pg @@ -0,0 +1,76 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +while ($a == $b) {$b = random(1,10,1);} + +$left = Compute("$var**2 - ($a+$b) $var + $a*$b")->reduce; +$right = Compute("0"); + +#Context("Fraction"); +#$r1 = Fraction("$b","$a"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$a,$b}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations5.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations5.pg new file mode 100644 index 0000000000..702da7c61b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations5.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(0,4,1); +$b = non_zero_random(-6,6,1); +$c = non_zero_random(0,4,1); +$d = non_zero_random(-6,6,1); +while ($a*$d == $b*$c) {$d = non_zero_random(-6,6,1);}; + + +$left = Compute("$a*$c $var**2 - ($a*$d+$b*$c) $var + $b*$d")->reduce; +$right = Compute("0"); + +Context("Fraction"); +$r1 = Fraction("$b","$a"); +$r2 = Fraction("$d","$c"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$r1,$r2}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations6.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations6.pg new file mode 100644 index 0000000000..c0c03b098a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations6.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = random(1,10,1); +$b = random(1,10,1); + +$left = Compute("$a**2 $var**2")->reduce; +$right = Compute("$b**2"); + +Context("Fraction"); +$r1 = Fraction("$b","$a"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$r1,-$r1}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations7.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations7.pg new file mode 100644 index 0000000000..50cbd8c423 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations7.pg @@ -0,0 +1,76 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = random(1,10,1); +$b = random(1,10,1); +while ($a == $b) {$b = random(1,10,1);} + +$left = Compute("$var**2 + $a*$b")->reduce; +$right = Compute("($a+$b) $var")->reduce; + +#Context("Fraction"); +#$r1 = Fraction("$b","$a"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$a,$b}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations8.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations8.pg new file mode 100644 index 0000000000..2ce7d96599 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations8.pg @@ -0,0 +1,75 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = random(1,10,1); +$b = non_zero_random(1,10,1); + +$left = Compute("$a**2 $var**2 -2*$a*$b $var")->reduce; +$right = Compute("- $b**2"); + +Context("Fraction"); +$r1 = Fraction("$b","$a"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$r1}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations9.pg b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations9.pg new file mode 100644 index 0000000000..0e326fd2ed --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialEquations/PolynomialEquations9.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(0,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(0,4,1); +$d = non_zero_random(-6,6,1); +while ($a*$d == $b*$c) {$d = non_zero_random(-6,6,1);}; + + +$left = Compute("$a*$c $var**2 - ($a*$d+$b*$c) $var ")->reduce; +$right = Compute("-$b*$d"); + +Context("Fraction"); +$r1 = Fraction("$b","$a"); +$r2 = Fraction("$d","$c"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$r1,$r2}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions1.pg b/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions1.pg new file mode 100644 index 0000000000..4ecb4887f1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions1.pg @@ -0,0 +1,143 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0,'(-x)+y'=>0); +$a = random(1,20,1); +$f[0] = Formula("x^(-$a)")->reduce; + +$b = random(-20,20,1); +$c = random(-20,20,1); +$f[1] = Formula("$b x^4+$c x")->reduce; + +$d = random(2,10,1); +$f[2] = Formula("1/(x^2+$d)")->reduce; + +$e = random(2,10,1); +$f = random(2,20,1); +$f[3] = Formula("$e x+$f x^2")->reduce; + +$g = random(2,10,1); +$f[4] = Formula("$g x^3")->reduce; + +$h = random(2,10,1); +$j = random(2,10,1); +$f[5] = Formula("$j-$h|x|")->reduce; + +Context()->flags->set(reduceConstantFunctions=>0); +$k = random(2,3,1); +$l = random(2,3,1); +$f[6] = Formula("$k x-$l"); + +$f[7] = Formula("x-$h x^(-1)"); + + + +Context()->texStrings; + +for my $i (0..7) { +$radio[$i] = new_multiple_choice(); +} + + +for my $i (1,3,4,6) { +$radio[$i]->qa("\(f(x)=$f[$i]\)", "\(f\) is a polynomial function.");} +for my $i (0,2,5,7) { +$radio[$i]->qa("\(f(x)=$f[$i]\)", "\(f\) is not a polynomial function.");} + +for my $i (0..7) { +$radio[$i]->extra("\(f\) is a polynomial function.", "\(f\) is not a polynomial function."); +$radio[$i]->makeLast("\(f\) is not a polynomial function."); +} + + +############################################## + + +BEGIN_PGML + + + +$PAR +Identify which functions are polynomial functions and which are not. + +[@ $radio[0]->print_q() @]* + +[@ $radio[0]->print_a() @]* + +---- + +[@ $radio[1]->print_q() @]* + +[@ $radio[1]->print_a() @]* + +---- + +[@ $radio[2]->print_q() @]* + +[@ $radio[2]->print_a() @]* + +---- + +[@ $radio[3]->print_q() @]* + +[@ $radio[3]->print_a() @]* + +---- + +[@ $radio[4]->print_q() @]* + +[@ $radio[4]->print_a() @]* + +---- + +[@ $radio[5]->print_q() @]* + +[@ $radio[5]->print_a() @]* + +---- + +[@ $radio[6]->print_q() @]* + +[@ $radio[6]->print_a() @]* + +---- + +[@ $radio[7]->print_q() @]* + +[@ $radio[7]->print_a() @]* + + + +END_PGML + + +############################################## + +for my $i (0..7){ +ANS( radio_cmp( $radio[$i]->correct_ans() ) );} + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions2.pg b/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions2.pg new file mode 100644 index 0000000000..569aaca9b3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions2.pg @@ -0,0 +1,63 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$a = random(3,12,1); +$b = non_zero_random(-5,5,1); + +$c = random(2,4,1)*random(-1,1,2); + +$f = Formula("$a x^2+$b")->reduce; + +$answer = $f->eval(x=>$c); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Evaluate \(f\) at the given value of \(x\). $BR + +\[f(x)=$f\] $PAR + +\(f($c) = \) \{ans_rule(5)\}. + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($answer->cmp); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions3.pg b/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions3.pg new file mode 100644 index 0000000000..094e823385 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions3.pg @@ -0,0 +1,62 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + + + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); + +$a = non_zero_random(-3,3,1); + +$c = random(2,5,1)*random(-1,1,2); + +$f = Formula("$a x^3")->reduce; + +$answer = $f->eval(x=>$c); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Evaluate \(f\) at the given value of \(x\). $BR + +\[f(x)=$f \] $PAR + +\(f($c) = \) \{ans_rule(5)\}. + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($answer->cmp); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions4.pg b/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions4.pg new file mode 100644 index 0000000000..62e5e55e24 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialFunctions/PolynomialFunctions4.pg @@ -0,0 +1,66 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + + +); + +TEXT(beginproblem()); + +############################################## + + +Context("Numeric"); + +$a = random(10,14,.1); +$b = random(10,100,.1); +$d = random(10,100,1); +$e = random(10,100,.1); + +$c = random(2,4,1)*random(-1,1,2); + +$f = Formula("$a x^3-$b x^2 + $d x + $e")->reduce; + + +$answer = $f->eval(x=>$c); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Evaluate \(f\) at the given value of \(x\). $BR + +\[f(x)=$f \] $PAR + +\(f($c) = \) \{ans_rule(5)\}. + + + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS($answer->cmp()); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/MultiplyingPolynomials1.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/MultiplyingPolynomials1.pg new file mode 100644 index 0000000000..2648d30258 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/MultiplyingPolynomials1.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +Context()->variables->add(y=>'Real'); +$var = 'y'; + +@poly1array = (random(-6,-3,1)); +foreach my $i (1..random(2,5,1)) {$poly1array[$i] = 0}; +@poly2array = (random(2,10,1),random(4,10,1)); + + + +@productarray = PolyMult(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@productarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Find the product, simplified. $PAR + +$SPACE $SPACE $SPACE \($poly1\!\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/MultiplyingPolynomials2.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/MultiplyingPolynomials2.pg new file mode 100644 index 0000000000..a9ae6b1367 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/MultiplyingPolynomials2.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +Context()->variables->add(y=>'Real'); +$var = 'x'; + +@poly1array = (random(2,6,1),random(3,8,1),0,0); +@poly2array = (random(2,20,1)); +foreach my $i (1..random(1,4,1)) {$poly2array[$i] = 0}; + + + +@productarray = PolyMult(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@productarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Find the product, simplified. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)\!\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/MultiplyingPolynomials3.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/MultiplyingPolynomials3.pg new file mode 100644 index 0000000000..1b894111c8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/MultiplyingPolynomials3.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +Context()->variables->add(y=>'Real'); +$var = 'x'; + +@poly1array = (random(2,6,1),random(3,8,1),random(1,15,1),0); +@poly2array = (random(2,20,1)); +foreach my $i (1..random(1,4,1)) {$poly2array[$i] = 0}; + + + +@productarray = PolyMult(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@productarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->are($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Find the product, simplified. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)\!\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication10.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication10.pg new file mode 100644 index 0000000000..d0008ba937 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication10.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +Context()->variables->add(y=>'Real'); +$var = 'y'; + +@poly1array = (1,random(1,10,1)); +@poly2array = (random(1,2,1),random(1,10,1),non_zero_random(-20,20,1),non_zero_random(-5,5,1)); + + + +@productarray = PolyMult(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@productarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Find the product. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)\!\left($poly2\right)\) + +$PAR +\{ ans_rule(30) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication11.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication11.pg new file mode 100644 index 0000000000..86c5b5944c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication11.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +Context()->variables->are(x=>'Real'); +$var = 'x'; + +@poly1array = (1,non_zero_random(-6,6,1),random(1,10,1)); +@poly2array = (random(1,2,1),random(1,10,1),non_zero_random(-5,5,1)); + + + +@productarray = PolyMult(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@productarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +#Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Find the product. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)\!\left($poly2\right)\) + +$PAR +\{ ans_rule(30) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication12.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication12.pg new file mode 100644 index 0000000000..c591d772f2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication12.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +Context()->variables->add(y=>'Real'); +$var = 'y'; + +@poly1array = (random(1,2,1),random(1,4,1)); +@poly2array = (random(1,2,1),non_zero_random(-2,2,1),random(1,2,1)); +@poly3array = (1,random(-3,-1,1)); +@poly4array = (1,1,random(1,4,1)); + + +@product1array = PolyMult(~~@poly1array,~~@poly2array); +@product2array = PolyMult(~~@poly3array,~~@poly4array); + +@sumarray = PolyAdd(~~@product1array,~~@product2array); + + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$poly3 = Formula(PolyString(~~@poly3array))->reduce; +$poly4 = Formula(PolyString(~~@poly4array))->reduce; +$ans = Formula(PolyString(~~@sumarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); +$poly3 = $poly3->substitute(x=>$var); +$poly4 = $poly4->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Perform the indicated operations, expanding the polynomial answer to its simplest form. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)\!\left($poly2\right)+\left($poly3\right)\!\left($poly4\right)\) + + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication4.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication4.pg new file mode 100644 index 0000000000..5654685a4e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication4.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +#Context()->variables->add(y=>'Real'); +$var = 'x'; + +@poly1array = (random(1,10,1),random(2,20,1)); +@poly2array = (random(1,20,1),random(2,5,1)); + + + +@productarray = PolyMult(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@productarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +#Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Find the product. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)\!\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication5.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication5.pg new file mode 100644 index 0000000000..3128410f35 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication5.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +#Context()->variables->add(y=>'Real'); +$var = 'x'; + +@poly1array = (random(1,10,1),non_zero_random(-8,8,1)); +@poly2array = (random(1,10,1),non_zero_random(-5,5,1)); + + + +@productarray = PolyMult(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@productarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +#Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Find the product. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)\!\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication6.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication6.pg new file mode 100644 index 0000000000..4134a2606b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication6.pg @@ -0,0 +1,79 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +#Context()->variables->add(y=>'Real'); +$var = 'x'; + +@poly1array = (non_zero_random(-10,10,1),non_zero_random(-100,100,1)); +@poly2array = (random(1,20,1),non_zero_random(-20,30,1)); + + + +@productarray = PolyMult(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@productarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +#Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Find the product. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)\!\left($poly2\right)\) + +$PAR +\{ ans_rule(15) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication7.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication7.pg new file mode 100644 index 0000000000..d92bb62dca --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication7.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +#Context()->variables->add(y=>'Real'); +$var = 'x'; + +$a = random(2,10,1); +$b = random(2,10,2); +$c = $b + random(1,9,1); +$h = non_zero_random(-10,10,1); +$k = non_zero_random(-10,10,1); + +#@poly1array = (Compute("1/$a"),non_zero_random(-10,10,1)); +#@poly2array = (Compute("$b/$c"),non_zero_random(-10,10,1)); + +$d = Compute("$b/($a*$c)"); +$e = Compute("$k/$a+$h*$b/$c"); +$g = $h*$k; + + +@productarray = PolyMult(~~@poly1array,~~@poly2array); + + +$poly1 = Formula("1/$a x+$h")->reduce; +$poly2 = Formula("$b/$c x+$k")->reduce; +$ans = Formula("$d x^2 + $e x + $g")->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +#Context()->variables->add($var=>'Real'); +$ans = Formula("$ans"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Find the product. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)\!\left($poly2\right)\) + +$PAR +\{ ans_rule(30) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication8.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication8.pg new file mode 100644 index 0000000000..66e75faaeb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication8.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +#Context()->variables->add(y=>'Real'); +$var = 'x'; + +@poly1array = (1,random(1,10,1)); +@poly2array = (random(1,2,1),random(1,10,1),non_zero_random(-20,20,1)); + + + +@productarray = PolyMult(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@productarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +#Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Find the product. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)\!\left($poly2\right)\) + +$PAR +\{ ans_rule(30) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication9.pg b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication9.pg new file mode 100644 index 0000000000..470e364c4e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/PolynomialMultiplication/PolynomialMultiplication9.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPolynomial.pl", + "PGpolynomialmacros.pl", +# "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + + +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); +Context()->variables->add(a=>'Real'); +$var = 'a'; + +@poly1array = (1,random(1,10,1)); +@poly2array = (random(1,2,1),random(1,10,1),non_zero_random(-20,20,1)); + + + +@productarray = PolyMult(~~@poly1array,~~@poly2array); + + +$poly1 = Formula(PolyString(~~@poly1array))->reduce; +$poly2 = Formula(PolyString(~~@poly2array))->reduce; +$ans = Formula(PolyString(~~@productarray))->reduce; + +$poly1 = $poly1->substitute(x=>$var); +$poly2 = $poly2->substitute(x=>$var); + +$ans = $ans->substitute(x=>$var); +Context("LimitedPolynomial-Strict"); +Context()->variables->add($var=>'Real'); +$ans = Formula($ans); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Find the product. $PAR + +$SPACE $SPACE $SPACE \(\left($poly1\right)\!\left($poly2\right)\) + +$PAR +\{ ans_rule(30) \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + + +ANS( $ans -> cmp() ); + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Proportions/Proportions1.pg b/OpenProblemLibrary/PCC/Math95/Proportions/Proportions1.pg new file mode 100644 index 0000000000..9ef3af4d6b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Proportions/Proportions1.pg @@ -0,0 +1,74 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + + + + + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(5,20,1); +$b = random(5,20,1); + +$c = random(3,20,1); +while (gcd($b,$c) != 1) +{$c = random(3,20,1);} + +$d = random(2,8,1); + +$left = "\displaystyle\frac{x-$d}{$a}"; +$right = "\frac{$b}{$c}"; + +$ans = Fraction("$d*$c+$a*$b","$c"); + + +############################################## + + + + +BEGIN_TEXT +Solve the proportion. +$BR + + +$PAR +\( $left = $right \) +$PAR +$BBLOCKQUOTE +\(x = \) $SPACE \{ ans_rule(10) \} + +$EBLOCKQUOTE + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $ans -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Proportions/Proportions2.pg b/OpenProblemLibrary/PCC/Math95/Proportions/Proportions2.pg new file mode 100644 index 0000000000..ec7a25bf42 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Proportions/Proportions2.pg @@ -0,0 +1,74 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + + + + + +############################################## + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(5,20,1); +$b = random(5,20,1); + +$c = random(3,20,1); +while (gcd($b,$c) != 1) +{$c = random(3,20,1);} + +$d = random(2,8,1); + +$left = "\displaystyle\frac{$a}{$b x+$c}"; +$right = "\frac{$d}{x}"; + +$ans = Fraction("$d*$c","$a-$b*$d"); + + +############################################## + + + + +BEGIN_TEXT +Solve the proportion. +$BR + + +$PAR +\( $left = $right \) +$PAR +$BBLOCKQUOTE +\(x = \) $SPACE \{ ans_rule(10) \} + +$EBLOCKQUOTE + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $ans -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Proportions/Proportions3.pg b/OpenProblemLibrary/PCC/Math95/Proportions/Proportions3.pg new file mode 100644 index 0000000000..cfa822ca37 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Proportions/Proportions3.pg @@ -0,0 +1,74 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + + + + + +############################################## +TEXT(beginproblem()); + + +Context("Fraction"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(5,20,1); +$b = random(5,20,1); + +$c = random(3,20,1); +while (gcd($b,$c) != 1) +{$c = random(3,20,1);} + +$d = random(2,8,1); + +$left = "\displaystyle\frac{$a}{$b x-$c}"; +$right = "\frac{1}{$d x}"; + +$ans = Fraction("$c","$b-$a*$d"); + + +############################################## + + + + +BEGIN_TEXT +Solve the proportion. +$BR + + +$PAR +\( $left = $right \) +$PAR +$BBLOCKQUOTE +\(x = \) $SPACE \{ ans_rule(10) \} + +$EBLOCKQUOTE + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $ans -> cmp() ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Proportions/Proportions4.pg b/OpenProblemLibrary/PCC/Math95/Proportions/Proportions4.pg new file mode 100644 index 0000000000..0729ca97dc --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Proportions/Proportions4.pg @@ -0,0 +1,66 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + +); + + + + + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(5,6.5,0.5); +$b = random(3,12,0.1); + +$c = random(20,40,1); + +$manHeight = NumberWithUnits("$a","ft"); +$manShadow = NumberWithUnits("$b","ft"); + +$treeShadow = NumberWithUnits("$c","ft"); +$treeHeight = NumberWithUnits("$c*$a/$b","ft"); + + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +A \($manHeight\) person casts a \($manShadow\) shadow and a nearby tree casts a \($treeShadow\) shadow. Estimate the height of the tree. + +$PAR + +The tree is about \{ ans_rule(10) \} tall. + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( $treeHeight -> cmp(tolerance=>0.01) ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Proportions/Proportions5.pg b/OpenProblemLibrary/PCC/Math95/Proportions/Proportions5.pg new file mode 100644 index 0000000000..f442f19c1a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Proportions/Proportions5.pg @@ -0,0 +1,62 @@ +# WeBWorK problem written by Alex Jordan +# and Julia Partlow, Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + +); + + + + + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +Context()->flags->set(showMixedNumbers=>0); + +$a = random(200,350,10); +$b = random(100,150,1); + +$c = random(8,30,1); + +$ans = $a*$b/$c; + + +############################################## + +Context()->texStrings; + + +BEGIN_TEXT +An ecologist caught and tagged \($a\) largemouth bass and released them back into the lake. Later, a sample of \($b\) largemouth bass had \($c\) tagged bass. Estimate the total largemouth bass population in the lake. + +$PAR + +There are about \{ ans_rule(10) \} largemouth bass in the lake. + + + +END_TEXT + +############################################## + +Context()->normalStrings; + +ANS( Compute(round($ans)) -> cmp(tolType=>absolute,tolerance=>1) ); + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/QuadraticData/QuadraticData1.pg b/OpenProblemLibrary/PCC/Math95/QuadraticData/QuadraticData1.pg new file mode 100644 index 0000000000..7a74ce2983 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/QuadraticData/QuadraticData1.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserRadioButtons.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +$a = random(0.1,0.9,0.1); +$b =non_zero_random(-10,10,1); +$c = random(80,200,1); + +$f = Formula("$a x^2+$b x +$c"); + +for my $i (0..6) +{$d[$i] = $f->eval(x=>$i); +$d[$i] = $d[$i]*random(0.9999,1.0001,0.00001); +$d[$i] = round($d[$i]*100)/100}; + + +$radio = RadioButtons( + ["This data could be reasonably modeled with a quadratic function.","This data could not be reasonably modeled with a quadratic function."], + "This data could be reasonably modeled with a quadratic function.", # correct answer + last => ["This data could be reasonably modeled with a quadratic function.","This data could not be reasonably modeled with a quadratic function."], # can be a list +); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Could the data collected below be reasonably modeled with a quadratic function? +$PAR + +\{ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow(["\(x \)","\(y\)"], align=>LEFT, separation=>0). +AlignedRow(["\(2000\)","$d[0]"], separation=>0). +AlignedRow(["\(2002\)","$d[1]"], separation=>0). +AlignedRow(["\(2004\)","$d[2]"], separation=>0). +AlignedRow(["\(2006\)","$d[3]"], separation=>0). +AlignedRow(["\(2008\)","$d[4]"], separation=>0). +AlignedRow(["\(2010\)","$d[5]"], separation=>0). +AlignedRow(["\(2012\)","$d[6]"], separation=>0). +EndTable() +\} + +$PAR + +\{ $radio->buttons() \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/QuadraticData/QuadraticData2.pg b/OpenProblemLibrary/PCC/Math95/QuadraticData/QuadraticData2.pg new file mode 100644 index 0000000000..61a093804c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/QuadraticData/QuadraticData2.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserRadioButtons.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +$a = random(0.1,0.9,0.1); +$b =non_zero_random(-10,10,1); +$c = random(80,200,1); + +$f = Formula("$c e^($a x)"); + +for my $i (0..6) +{$d[$i] = $f->eval(x=>$i); +$d[$i] = $d[$i]*random(0.9999,1.0001,0.00001); +$d[$i] = round($d[$i]*100)/100}; + + +$radio = RadioButtons( + ["This data could be reasonably modeled with a quadratic function.","This data could not be reasonably modeled with a quadratic function."], + "This data could not be reasonably modeled with a quadratic function.", # correct answer + last => ["This data could be reasonably modeled with a quadratic function.","This data could not be reasonably modeled with a quadratic function."], # can be a list +); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Could the data collected below be reasonably modeled with a quadratic function? +$PAR + +\{ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow(["\(x \)","\(y\)"], align=>LEFT, separation=>0). +AlignedRow(["\(2000\)","$d[0]"], separation=>0). +AlignedRow(["\(2002\)","$d[1]"], separation=>0). +AlignedRow(["\(2004\)","$d[2]"], separation=>0). +AlignedRow(["\(2006\)","$d[3]"], separation=>0). +AlignedRow(["\(2008\)","$d[4]"], separation=>0). +AlignedRow(["\(2010\)","$d[5]"], separation=>0). +AlignedRow(["\(2012\)","$d[6]"], separation=>0). +EndTable() +\} + +$PAR + +\{ $radio->buttons() \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/QuadraticData/QuadraticData3.pg b/OpenProblemLibrary/PCC/Math95/QuadraticData/QuadraticData3.pg new file mode 100644 index 0000000000..47283aa508 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/QuadraticData/QuadraticData3.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "unionTables.pl", + "parserRadioButtons.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +$a = -random(0.1,0.9,0.1); +$b =non_zero_random(10,50,1); +$c = random(80,200,1); + +$f = Formula("$a x^2+$b x +$c"); + +for my $i (0..6) +{$d[$i] = $f->eval(x=>$i); +$d[$i] = $d[$i]*random(0.9999,1.0001,0.00001); +$d[$i] = round($d[$i]*100)/100}; + + +$radio = RadioButtons( + ["This data could be reasonably modeled with a quadratic function.","This data could not be reasonably modeled with a quadratic function."], + "This data could be reasonably modeled with a quadratic function.", # correct answer + last => ["This data could be reasonably modeled with a quadratic function.","This data could not be reasonably modeled with a quadratic function."], # can be a list +); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Could the data collected below be reasonably modeled with a quadratic function? +$PAR + +\{ +BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). +AlignedRow(["\(x \)","\(y\)"], align=>LEFT, separation=>0). +AlignedRow(["\(2000\)","$d[0]"], separation=>0). +AlignedRow(["\(2002\)","$d[1]"], separation=>0). +AlignedRow(["\(2004\)","$d[2]"], separation=>0). +AlignedRow(["\(2006\)","$d[3]"], separation=>0). +AlignedRow(["\(2008\)","$d[4]"], separation=>0). +AlignedRow(["\(2010\)","$d[5]"], separation=>0). +AlignedRow(["\(2012\)","$d[6]"], separation=>0). +EndTable() +\} + +$PAR + +\{ $radio->buttons() \} + + + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula1.pg b/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula1.pg new file mode 100644 index 0000000000..a1d057babc --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula1.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); +while ($b**2-4*$a*$c <= 0) +{$b=$b+$b/abs($b);} + + +$left = Compute("$a $var**2 + $b $var + $c")->reduce; +$right = Compute("0"); + +Context()->flags->set(reduceConstantFunctions=>0); + +$r1 = Compute("(-$b+sqrt(($b)**2-4*$a*$c))/(2*$a)"); +$r2 = Compute("(-$b-sqrt(($b)**2-4*$a*$c))/(2*$a)"); + +Context("Interval"); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$r1,$r2}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(40)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0.00001)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula2.pg b/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula2.pg new file mode 100644 index 0000000000..5ed6493396 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula2.pg @@ -0,0 +1,80 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); +while ($b**2-4*$a*$c <= 0) +{$b=$b+$b/abs($b);} + +$left = Compute("$a $var**2 + $b $var + $c")->reduce; +$right = Compute("0"); + +Context()->flags->set(reduceConstantFunctions=>0); + +$r1 = Compute("(-$b+sqrt(($b)**2-4*$a*$c))/(2*$a)"); +$r2 = Compute("(-$b-sqrt(($b)**2-4*$a*$c))/(2*$a)"); + +Context("Interval"); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$r1,$r2}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(40)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0.00001)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula3.pg b/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula3.pg new file mode 100644 index 0000000000..c6e2c63915 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula3.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); +while ($b**2-4*$a*$c <= 0) +{$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1);} + +$left = Compute("$a $var**2 + $b $var + $c")->reduce; +$right = Compute("0"); + +Context()->flags->set(reduceConstantFunctions=>0); + +$r1 = Compute("(-$b+sqrt(($b)**2-4*$a*$c))/(2*$a)"); +$r2 = Compute("(-$b-sqrt(($b)**2-4*$a*$c))/(2*$a)"); + +Context("Interval"); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$r1,$r2}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(40)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0.00001)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula4.pg b/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula4.pg new file mode 100644 index 0000000000..c6e2c63915 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/QuadraticFormula/QuadraticFormula4.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); +############################################## + +Context("Numeric"); +$var = list_random('x','y','z','t','r'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); +while ($b**2-4*$a*$c <= 0) +{$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1);} + +$left = Compute("$a $var**2 + $b $var + $c")->reduce; +$right = Compute("0"); + +Context()->flags->set(reduceConstantFunctions=>0); + +$r1 = Compute("(-$b+sqrt(($b)**2-4*$a*$c))/(2*$a)"); +$r2 = Compute("(-$b-sqrt(($b)**2-4*$a*$c))/(2*$a)"); + +Context("Interval"); +Context()->flags->set(reduceConstantFunctions=>0); +Context()->parens->set('{'=>{type=>'Set'}); +$ans = Compute("{$r1,$r2}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). +$PAR + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(40)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0.00001)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions1.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions1.pg new file mode 100644 index 0000000000..53c1672247 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions1.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Find the domain of the function f where +# +# f(x) = sqrt(x-a) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$a = non_zero_random(-10,10,1); +$f = Formula("sqrt(x-$a)")->reduce; + + +Context("Interval"); +$domain = Compute("[$a,inf)"); + + +############################################## + + +BEGIN_PGML + +Find the domain of the function. + +[`f(x)=[$f]`] + +[@KeyboardInstructions('Use interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + +[____________________]{$domain} + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +For this function, the domain is restricted by the square root. The radicand must not be negative. Therefore, we will find all the [`x`] for which that is true: + + [`` +\begin{aligned} + x-[$a] &\geq 0 \\ + x-[$a]+[$a] &\geq 0+[$a] \\ + x &\geq [$a] \\ +\end{aligned} + ``] + +So only the [`x`] that are greater than or equal to [`[$a]`] are part of the domain. In interval notation, the domain can be written as [`[[$a],\infty)`]. In WeBWorK, we enter the answer as [`[[$a],\text{inf})`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions2.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions2.pg new file mode 100644 index 0000000000..f990828d7c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions2.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Find the domain of the function f where +# +# f(x) = sqrt(a-bx) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->reductions->set('(-x)+y'=>0, '(-x)-y'=>0); + +$a = non_zero_random(-10,10,1); +$b = random(2,8,1); +$f = Formula("sqrt($a-$b x)")->reduce; + +Context("Fraction"); +$r = Fraction("$a","$b"); + +Context("Interval"); +$domain = Compute("(-inf,$r]"); + + +############################################## + + +BEGIN_PGML + +Find the domain of the function. + +[`f(x)=[$f]`] + +[@KeyboardInstructions('Use interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + +[____________________]{$domain} + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +For this function, the domain is restricted by the square root. The radicand must not be negative. Therefore, we will find all the [`x`] for which that is true: + + [`` +\begin{aligned} + [$a]-[$b]x &\geq 0 \\ + [$a]-[$b]x-[$a] &\geq 0-[$a] \\ + -[$b]x &\geq -[$a] \\ + \frac{-[$b]x}{-[$b]} &\leq \frac{-[$a]}{-[$b]} \\ + x &\leq [$r] \\ +\end{aligned} + ``] + +So only the [`x`] that are less than or equal to [`[$r]`] are part of the domain. In interval notation, the domain can be written as [`\left(-\infty,[$r]\right]`]. In WeBWorK, we enter the answer as [`\left(-\text{inf},[$r]\right]`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions3.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions3.pg new file mode 100644 index 0000000000..199114f328 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions3.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Find the domain of the function f where +# +# f(x) = 1/sqrt(a-bx) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->reductions->set('(-x)+y'=>0, '(-x)-y'=>0); + +$a = non_zero_random(-100,100,1); +$b = random(2,80,1); + +$f = Formula("1/sqrt($a-$b x)")->reduce; + +Context("Fraction"); +$r = Fraction("$a","$b"); + +Context("Interval"); +$domain = Compute("(-inf,$r)"); + + +############################################## + + +BEGIN_PGML + +Find the domain of the function. + +[`f(x)=[$f]`] + +[@KeyboardInstructions('Use interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + +[____________________]{$domain} + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +For this function, the domain is restricted by the square root AND the fraction. The radicand must not be negative and the denominator must not be zero. Therefore, we will find all the [`x`] for which that is true: + + [`` +\begin{aligned} + [$a]-[$b]x &> 0 \\ + [$a]-[$b]x-[$a] &> 0-[$a] \\ + -[$b]x &> -[$a] \\ + \frac{-[$b]x}{-[$b]} &< \frac{-[$a]}{-[$b]} \\ + x &< [$r] \\ +\end{aligned} + ``] + +So only the [`x`] that are less than [`[$r]`] are part of the domain. In interval notation, the domain can be written as [`\left(-\infty,[$r]\right)`]. In WeBWorK, we enter the answer as [`\left(-\text{inf},[$r]\right)`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions4.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions4.pg new file mode 100644 index 0000000000..f37b6b6bb7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions4.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Find the domain of the function f where +# +# f(x) = 1/sqrt(bx+a) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->reductions->set('(-x)+y'=>0, '(-x)-y'=>0); + +$a = non_zero_random(-100,100,1); +$b = random(2,80,1); + +$f = Formula("1/sqrt($b x+$a)")->reduce; + +Context("Fraction"); +$r = Fraction("-$a","$b"); + +Context("Interval"); +$domain = Compute("($r,inf)"); + + +############################################## + + +BEGIN_PGML + +Find the domain of the function. + +[`f(x)=[$f]`] + +[@KeyboardInstructions('Use interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + +[____________________]{$domain} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +For this function, the domain is restricted by the square root AND the fraction. The radicand must not be negative and the denominator must not be zero. Therefore, we will find all the [`x`] for which that is true: + + [`` +\begin{aligned} + [$b]x+[$a] &> 0 \\ + [$b]x+[$a]-[$a] &> 0-[$a] \\ + [$b]x &> -[$a] \\ + \frac{[$b]x}{[$b]} &> \frac{-[$a]}{[$b]} \\ + x &> [$r] \\ +\end{aligned} + ``] + +So only the [`x`] that are greater than [`[$r]`] are part of the domain. In interval notation, the domain can be written as [`\left([$r],\infty\right)`]. In WeBWorK, we enter the answer as [`\left([$r],\text{inf}\right)`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions5.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions5.pg new file mode 100644 index 0000000000..b825e9e5a7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions5.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Find the domain of the function f where +# +# f(x) = (x+c)/sqrt(bx^2+a) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->reductions->set('(-x)+y'=>0, '(-x)-y'=>0); + +$a = non_zero_random(1,100,1); +$b = random(2,80,1); +$c = random(2,80,1); + + +$f = Formula("(x+$c)/sqrt($b x^2+$a)")->reduce; + +Context("Fraction"); +$r = Fraction("-$a","$b"); + +Context("Interval"); +$domain = Compute("(-inf,inf)"); + + +############################################## + + +BEGIN_PGML + +Find the domain of the function. + +[`f(x)=[$f]`] + +[@KeyboardInstructions('Use interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + +[____________________]{$domain} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +For this function, the domain is restricted by the square root AND the fraction. The radicand must not be negative and the denominator must not be zero. Therefore, we will find all the [`x`] for which that is true: + + [`` +\begin{aligned} + [$b]x^2+[$a] &> 0 \\ + [$b]x^2+[$a]-[$a] &> 0-[$a] \\ + [$b]x^2 &> -[$a] \\ + \frac{[$b]x^2}{[$b]} &> \frac{-[$a]}{[$b]} \\ + x^2 &> [$r] \\ +\end{aligned} + ``] + +Now this case is interesting because [`x^2`] is always greater than or equal to zero. So there is no [`x`] that can make [`x^2`] a negative number. Ever! Therefore, all real numbers are part of the domain. In interval notation, the domain can be written as [`\left(-\infty,\infty\right)`]. In WeBWorK, we enter the answer as [`\left(-\text{inf},\text{inf}\right)`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions6.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions6.pg new file mode 100644 index 0000000000..71b7a04708 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions6.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Find the domain of the function f where +# +# n-th-root(x+a) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->reductions->set('(-x)+y'=>0, '(-x)-y'=>0); + +$a = non_zero_random(1,100,1); +$n = 2*random(1,5,1)+1; + +$f = "\sqrt[$n]{x+$a}"; + + +Context("Interval"); +$domain = Compute("(-inf,inf)"); + + +############################################## + + +BEGIN_PGML + +Find the domain of the function. + +[`f(x)=[$f]`] + +[@KeyboardInstructions('Use interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + +[____________________]{$domain} + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +For this function, the domain is not restricted. Odd-numbered roots do not restrict the domain of a function and there is no fraction. Therefore, all real numbers are part of the domain. In interval notation, the domain can be written as [`\left(-\infty,\infty\right)`]. In WeBWorK, we enter the answer as [`\left(-\text{inf},\text{inf}\right)`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions7.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions7.pg new file mode 100644 index 0000000000..1438826d6d --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions7.pg @@ -0,0 +1,91 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Find the domain of the function f where +# +# 1/n-th-root(bx+a) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->reductions->set('(-x)+y'=>0, '(-x)-y'=>0); + +$a = non_zero_random(1,100,1); +$b = random(2,100,1); +$n = 2*random(1,5,1)+1; +$f = "\frac{1}{\sqrt[$n]{$b x+$a}}"; + +Context("Fraction"); +$r = Fraction("-$a","$b"); + +Context("Interval"); +$domain = Compute("(-inf,$r)U($r,inf)"); + + +############################################## + + +BEGIN_PGML + +Find the domain of the function. + +[`f(x)=[$f]`] + +[@KeyboardInstructions('Use interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + +[____________________]{$domain} + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +For this function, the domain is restricted only by the fraction. The denominator must not be zero but odd-numbered roots do not restrict the domain of a function. Therefore, we will find all the [`x`] for which the denominator is zero so that we can exclude them from the domain: + + [`` +\begin{aligned} + [$b]x+[$a] &= 0 \\ + [$b]x+[$a]-[$a] &= 0-[$a] \\ + [$b]x &= -[$a] \\ + \frac{[$b]x}{[$b]} &= \frac{-[$a]}{[$b]} \\ + x &= [$r] \\ +\end{aligned} + ``] + +With the exception that [`x\neq[$r]`], all real numbers are part of the domain. In interval notation, the domain can be written as [`\left(-\infty,[$r]\right)\cup\left([$r],\infty\right)`]. In WeBWorK, we enter the answer as [`\left(-\text{inf},[$r]\right)\text{U}\left([$r],\text{inf}\right)`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions8.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions8.pg new file mode 100644 index 0000000000..d9967284eb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctions8.pg @@ -0,0 +1,90 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Find the domain of the function f where +# +# f(x) = 1/n-th-root(bx+a) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->reductions->set('(-x)+y'=>0, '(-x)-y'=>0); + +$a = non_zero_random(1,100,1); +$b = random(2,10,1); +$n = 2*random(1,5,1); +$f = "\frac{1}{\sqrt[$n]{$b x+$a}}"; + +Context("Fraction"); +$r = Fraction("-$a","$b"); + +Context("Interval"); +$domain = Compute("($r,inf)"); + + +############################################## + +BEGIN_PGML + +Find the domain of the function. + +[`f(x)=[$f]`] + +[@KeyboardInstructions('Use interval notation. If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(\infty,5)\cup(5,10]`] you can type [|(-inf,5) U (5,10]|]*.')@]** + +[____________________]{$domain} + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +For this function, the domain is restricted by the even root AND the fraction. The radicand must not be negative and the denominator must not be zero. Therefore, we will find all the [`x`] for which that is true: + + [`` +\begin{aligned} + [$b]x+[$a] &> 0 \\ + [$b]x+[$a]-[$a] &> 0-[$a] \\ + [$b]x &> -[$a] \\ + \frac{[$b]x}{[$b]} &> \frac{-[$a]}{[$b]} \\ + x &> [$r] \\ +\end{aligned} + ``] + +So only the [`x`] that are greater than [`[$r]`] are part of the domain. In interval notation, the domain can be written as [`\left([$r],\infty\right)`]. In WeBWorK, we enter the answer as [`\left([$r],\text{inf}\right)`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically100.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically100.pg new file mode 100644 index 0000000000..188e1868a2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically100.pg @@ -0,0 +1,134 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Use the graph of G below to estimate its domain and range. +# +# G(x) = sqrt(x-h) +# +# +# Last updated: Spoddeck 11/9/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck') +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + + +Context("Numeric"); +$h = non_zero_random(-4,4,1); +$k = 0; + +$f = Formula("sqrt(x-$h)"); + +$left = $h; +$right = 5; + + +Context("Interval"); +$domain = Compute("[$left,inf)"); +$range = Compute("[$k,inf)"); + + +$xmin = min(-5,$h-3); +$xmax = max(5,$h+5); +$ymin = min(-5,$k-3); +$ymax = max(5,$k+5); + + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[240,240] +); + +add_functions($gr, "$f for x in <$left,$right>" . + " using color:blue and weight:1"); +$gr->stamps( closed_circle($left,$f->eval(x=>$left),'blue') ); +$gr->moveTo($right-0.2,sqrt($right-0.2-$h)); +$gr->arrowTo($right,sqrt($right-$h),'blue',1); + +$starty = $f->eval(x=>$left); +$endy = $f->eval(x=>$right); + +$ALT = "a graph of a square root function, which is a curve that starts at ($left,$starty) and then moves up and right, not ending"; + + +############################################## + + +BEGIN_PGML +Use the graph of [`[$fname]`] below to estimate its domain and range. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + + + The domain is [__________]{$domain} (in interval notation). + [@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** + + + The range is [__________]{$range} (in interval notation). + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +*Domain:* + +The function [`[$fname]`] is shown in blue. In order to determine the domain, we read the graph from left to right. At first, there is no graph, but as we keep going to the right, we find the blue graph starting at the point [`([$left],[$starty])`]. For the domain, we are only looking at [`x`]. Therefore, our domain interval starts at [`x=[$h]`]. + +We now keep walking to the right and find that the graph keeps going and going without ending point. If the graph ended at the edge of the coordinate system, we would find a solid or open dot there. Since there is no such dot, we know that the graph will keep going and going without end; it will go to infinity. Therefore, our domain in interval notation is [`[$domain]`]. In WeBWorK, we enter the answer as [`[[$left],\text{inf})`]. + +*Range:* + +For the range, we move in [`y`] direction from bottom to top. We find that in this case, we again meet nothing until the point [`([$left],[$starty])`]. This time, however, we focus on the [`y`] so our range starts at [`y=[$starty]`]. + +As we keep going up, the graph keeps going without ending. Therefore the range is [`[$range]`]. In WeBWorK, we enter the answer as [`[[$starty],\text{inf})`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically110.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically110.pg new file mode 100644 index 0000000000..f364678a60 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically110.pg @@ -0,0 +1,134 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Use the graph of G below to estimate its domain and range. +# +# G(x) = sqrt(x)+k +# +# +# Last updated: Spoddeck 11/9/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck') +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + + +Context("Numeric"); +$h = 0; +$k = non_zero_random(-4,4,1); + +$f = Formula("sqrt(x)+$k"); + + + +$xmin = min(-5,$h-3); +$xmax = max(5,$h+5); +$ymin = min(-5,$k-3); +$ymax = max(5,$k+5); + +$left = $h; +$right = min($xmax,($ymax-$k)**2); + + +Context("Interval"); +$domain = Interval("[$left,inf)"); +$range = Interval("[$k,inf)"); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[240,240] +); + +add_functions($gr, "$f for x in <$left,$right>" . + " using color:blue and weight:1"); +$gr->stamps( closed_circle($left,$f->eval(x=>$left),'blue') ); +$gr->moveTo($right-0.2,sqrt($right-0.2)+$k); +$gr->arrowTo($right,sqrt($right)+$k,'blue',1); + +$starty = $f->eval(x=>$left); +$endy = $f->eval(x=>$right); + +$ALT = "a graph of a square root function, which is a curve that starts at ($left,$starty) and then moves up and right, not ending"; + + +############################################## + + +BEGIN_PGML + +Use the graph of [`[$fname]`] below to estimate its domain and range. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + + + The domain is [__________]{$domain} (in interval notation). + [@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** + + + The range is [__________]{$range} (in interval notation). + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +*Domain:* + +The function [`[$fname]`] is shown in blue. In order to determine the domain, we read the graph from left to right. At first, there is no graph, but as we keep going to the right, we find the blue graph starting at the point [`([$left],[$starty])`]. For the domain, we are only looking at [`x`]. Therefore, our domain interval starts at [`x=[$h]`]. + +We now keep walking to the right and find that the graph keeps going and going without ending point. If the graph ended at the edge of the coordinate system, we would find a solid or open dot there. Since there is no such dot, we know that the graph will keep going and going without end; it will go to infinity. Therefore, our domain in interval notation is [`[$domain]`]. In WeBWorK, we enter the answer as [`[[$left],\text{inf})`]. + +*Range:* + +For the range, we move in [`y`] direction from bottom to top. We find that in this case, we again meet nothing until the point [`([$left],[$starty])`]. This time, however, we focus on the [`y`] so our range starts at [`y=[$starty]`]. + +As we keep going up, the graph keeps going without ending. Therefore the range is [`[$range]`]. In WeBWorK, we enter the answer as [`[[$starty],\text{inf})`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically120.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically120.pg new file mode 100644 index 0000000000..c270e74d28 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically120.pg @@ -0,0 +1,135 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Use the graph of G below to estimate its domain and range. +# +# G(x) = sqrt(x-h)+k +# +# +# Last updated: Spoddeck 11/9/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck') +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + + +Context("Numeric"); +$h = non_zero_random(-4,4,1); +$k = non_zero_random(-4,4,1); + +$f = Formula("sqrt(x-$h)+$k"); + + + +$xmin = min(-5,$h-3); +$xmax = max(5,$h+5); +$ymin = min(-5,$k-3); +$ymax = max(5,$k+5); + +$left = $h; +$right = min($xmax,($ymax-$k)**2+$h); + + +Context("Interval"); +$domain = Interval("[$left,inf)"); +$range = Interval("[$k,inf)"); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[240,240] +); + +add_functions($gr, "$f for x in <$left,$right>" . + " using color:blue and weight:1"); +$gr->stamps( closed_circle($left,$f->eval(x=>$left),'blue') ); +$gr->moveTo($right-0.2,sqrt($right-0.2-$h)+$k); +$gr->arrowTo($right,sqrt($right-$h)+$k,'blue',1); + +$starty = $f->eval(x=>$left); +$endy = $f->eval(x=>$right); + +$ALT = "a graph of a square root function, which is a curve that starts at ($left,$starty) and then moves up and right, not ending"; + + +############################################## + + +BEGIN_PGML + +Use the graph of [`[$fname]`] below to estimate its domain and range. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + + + The domain is [__________]{$domain} (in interval notation). + [@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** + + + The range is [__________]{$range} (in interval notation). + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +*Domain:* + +The function [`[$fname]`] is shown in blue. In order to determine the domain, we read the graph from left to right. At first, there is no graph, but as we keep going to the right, we find the blue graph starting at the point [`([$left],[$starty])`]. For the domain, we are only looking at [`x`]. Therefore, our domain interval starts at [`x=[$h]`]. + +We now keep walking to the right and find that the graph keeps going and going without ending point. If the graph ended at the edge of the coordinate system, we would find a solid or open dot there. Since there is no such dot, we know that the graph will keep going and going without end; it will go to infinity. Therefore, our domain in interval notation is [`[$domain]`]. In WeBWorK, we enter the answer as [`[[$left],\text{inf})`]. + +*Range:* + +For the range, we move in [`y`] direction from bottom to top. We find that in this case, we again meet nothing until the point [`([$left],[$starty])`]. This time, however, we focus on the [`y`] so our range starts at [`y=[$starty]`]. + +As we keep going up, the graph keeps going without ending. Therefore the range is [`[$range]`]. In WeBWorK, we enter the answer as [`[[$starty],\text{inf})`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically130.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically130.pg new file mode 100644 index 0000000000..6bc1e16aff --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically130.pg @@ -0,0 +1,148 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Use the graph of G below to estimate its domain and range. +# +# G(x) = -sqrt(x-h)+k +# +# +# Last updated: Spoddeck 11/9/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck') +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + + +Context("Numeric"); +$h = non_zero_random(-4,4,1); +$k = non_zero_random(-4,4,1); + +$f = Formula("-sqrt(x-$h)+$k"); + + + +$xmin = min(-5,$h-3); +$xmax = max(5,$h+5); +$ymin = min(-5,$k-5); +$ymax = max(5,$k+3); + +$left = $h; +$right = min($xmax,($ymin-$k)**2+$h); + + +Context("Interval"); +$domain = Interval("[$left,inf)"); +$range = Interval("(-inf,$k]"); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[240,240] +); + + $gr->lb('reset'); + for my $j ($xmin+1..$xmax-1) { + if (abs($j)<10**(-10) or $j%2 != 0) {next;} + $gr->lb( new Label($j, 0, $j,'black','center','top','large')); + } + + for my $j ($ymin+1..$ymax-1) { + if (abs($j)<10**(-10) or $j%2 != 0) {next;} + $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); + } + $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); + $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); + + +add_functions($gr, "$f for x in <$left,$right>" . + " using color:blue and weight:1"); +$gr->stamps( closed_circle($left,$f->eval(x=>$left),'blue') ); +$gr->moveTo($right-0.2,-sqrt($right-0.2-$h)+$k); +$gr->arrowTo($right,-sqrt($right-$h)+$k,'blue',1); + +$starty = $f->eval(x=>$left); +$endy = $f->eval(x=>$right); + +$ALT = "a graph of a square root function, which is a curve that starts at ($left,$starty) and then moves down and right, not ending"; + + +############################################## + + +BEGIN_PGML + +A function is graphed. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + + [@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** + + The function has domain [__________]{$domain} and range [__________]{$range}. + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +*Domain:* + +The function [`[$fname]`] is shown in blue. In order to determine the domain, we read the graph from left to right. At first, there is no graph, but as we keep going to the right, we find the blue graph starting at the point [`([$left],[$starty])`]. For the domain, we are only looking at [`x`]. Therefore, our domain interval starts at [`x=[$h]`]. + +We now keep walking to the right and find that the graph keeps going and going without ending point. If the graph ended at the edge of the coordinate system, we would find a solid or open dot there. Since there is no such dot, we know that the graph will keep going and going without end; it will go to infinity. Therefore, our domain in interval notation is [`[$domain]`]. In WeBWorK, we enter the answer as [`[[$left],\text{inf})`]. + +*Range:* + +For the range, we look at the [`y`] direction of the graph. We find that in this case, the graph moves downwards from the point [`([$left],[$starty])`] without ending. + +However, if we determine the range, we move in [`y`] direction from *bottom to top*. Therefore, we find that the graph starts in negative infinity. Then, as we keep going up, the graph keeps going until the point [`([$left],[$starty])`] and ends there. + +Therefore the range is [`[$range]`]. In WeBWorK, we enter the answer as [`(-\text{inf},[$starty]]`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically140.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically140.pg new file mode 100644 index 0000000000..ed9a3cfc35 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically140.pg @@ -0,0 +1,148 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Use the graph of G below to estimate its domain and range. +# +# G(x) = sqrt(-(x-h))+k +# +# +# Last updated: Spoddeck 11/9/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck') +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + + +Context("Numeric"); +$h = non_zero_random(-4,4,1); +$k = non_zero_random(-4,4,1); + +$f = Formula("sqrt(-(x-$h))+$k"); + + + +$xmin = min(-5,$h-5); +$xmax = max(5,$h+3); +$ymin = min(-5,$k-3); +$ymax = max(5,$k+5); + +$left = max($xmin,-($ymax-$k)**2+$h); +$right = $h; + + +Context("Interval"); +$domain = Interval("(-inf,$right]"); +$range = Interval("[$k,inf)"); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[240,240] +); + + $gr->lb('reset'); + for my $j ($xmin+1..$xmax-1) { + if (abs($j)<10**(-10) or $j%2 != 0) {next;} + $gr->lb( new Label($j, 0, $j,'black','center','top','large')); + } + + for my $j ($ymin+1..$ymax-1) { + if (abs($j)<10**(-10) or $j%2 != 0) {next;} + $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); + } + $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); + $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); + + +add_functions($gr, "$f for x in <$left,$right>" . + " using color:blue and weight:1"); +$gr->stamps( closed_circle($right,$f->eval(x=>$right),'blue') ); +$gr->moveTo($left+0.2,sqrt(-($left+0.2-$h))+$k); +$gr->arrowTo($left,sqrt(-($left-$h))+$k,'blue',1); + +$starty = $f->eval(x=>$right); +$endy = $f->eval(x=>$left); + +$ALT = "a graph of a square root function, which is a curve that starts at ($right,$starty) and then moves up and left, not ending"; + + +############################################## + + +BEGIN_PGML + +A function is graphed. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + + [@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** + + The function has domain [__________]{$domain} and range [__________]{$range}. + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +*Domain:* + +The function [`[$fname]`] is shown in blue. In order to determine the domain, we look at the [`x`] direction of the graph. We find that in this case, the graph moves left from the point [`([$right],[$starty])`] without ending. + +However, if we determine the domain, we move in [`x`] direction from *left to right*. Therefore, we find that the graph starts in negative infinity. Then, as we keep going right, the graph keeps going until the point [`([$right],[$starty])`] and ends there. + +Therefore the domain is [`[$domain]`]. In WeBWorK, we enter the answer as [`(-\text{inf},[$right]]`]. + +*Range:* + +For the range, we move in [`y`] direction from bottom to top. We find that in this case, we meet nothing until the point [`([$right],[$starty])`]. Since we focus on the [`y`], our range starts at [`y=[$starty]`]. + +As we keep going up, the graph keeps going without ending. Therefore the range is [`[$range]`]. In WeBWorK, we enter the answer as [`[[$starty],\text{inf})`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically150.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically150.pg new file mode 100644 index 0000000000..559023c97f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically150.pg @@ -0,0 +1,149 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Use the graph of G below to estimate its domain and range. +# +# G(x) = sqrt(-(x-h))+k +# +# +# Last updated: Spoddeck 11/9/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck') +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + + +Context("Numeric"); +$h = non_zero_random(-4,4,1); +$k = non_zero_random(-4,4,1); + +$f = Formula("-sqrt(-(x-$h))+$k"); + + + +$xmin = min(-5,$h-5); +$xmax = max(5,$h+3); +$ymin = min(-5,$k-5); +$ymax = max(5,$k+3); + +$left = max($xmin,-($ymin-$k)**2+$h); +$right = $h; + + +Context("Interval"); +$domain = Interval("(-inf,$right]"); +$range = Interval("(-inf,$k]"); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[240,240] +); + + $gr->lb('reset'); + for my $j ($xmin+1..$xmax-1) { + if (abs($j)<10**(-10) or $j%2 != 0) {next;} + $gr->lb( new Label($j, 0, $j,'black','center','top','large')); + } + + for my $j ($ymin+1..$ymax-1) { + if (abs($j)<10**(-10) or $j%2 != 0) {next;} + $gr->lb( new Label(0, $j, $j,'black','right','middle','large')); + } + $gr->lb(new Label($xmax,0,'x','black','right','bottom','large')); + $gr->lb(new Label(0,$ymax,'y','black','left','top','large')); + + +add_functions($gr, "$f for x in <$left,$right>" . + " using color:blue and weight:1"); +$gr->stamps( closed_circle($right,$f->eval(x=>$right),'blue') ); +$gr->moveTo($left+0.2,-sqrt(-($left+0.2-$h))+$k); +$gr->arrowTo($left,-sqrt(-($left-$h))+$k,'blue',1); + +$starty = $f->eval(x=>$right); +$endy = $f->eval(x=>$left); + +$ALT = "a graph of a square root function, which is a curve that starts at ($right,$starty) and then moves down and left, not ending"; + + +############################################## + + +BEGIN_PGML + +A function is graphed. + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($gr), width=>240, height=>240, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + + [@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** + + The function has domain [__________]{$domain} and range [__________]{$range}. + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +*Domain:* + +The function [`[$fname]`] is shown in blue. In order to determine the domain, we look at the [`x`] direction of the graph. We find that in this case, the graph moves left from the point [`([$right],[$starty])`] without ending. + +However, if we determine the domain, we move in [`x`] direction from *left to right*. Therefore, we find that the graph starts in negative infinity. Then, as we keep going right, the graph keeps going until the point [`([$right],[$starty])`] and ends there. + +Therefore the domain is [`[$domain]`]. In WeBWorK, we enter the answer as [`(-\text{inf},[$right]]`]. + +*Range:* + +For the range, we look at the [`y`] direction of the graph. We find that in this case, the graph moves downwards from the point [`([$right],[$starty])`] without ending. + +However, if we determine the range, we move in [`y`] direction from *bottom to top*. Therefore, we find that the graph starts in negative infinity. Then, as we keep going up, the graph keeps going until the point [`([$right],[$starty])`] and ends there. + +Therefore the range is [`[$range]`]. In WeBWorK, we enter the answer as [`(-\text{inf},[$starty]]`]. +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg new file mode 100644 index 0000000000..013bc6bd0d --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg @@ -0,0 +1,139 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Use the graph of G below to estimate its domain and range. +# +# G(x) = sqrt(x) +# +# +# Last updated: Spoddeck 10/24/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck') +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PCCgraphMacros.pl", + "PGtikz.pl", + "ORCCA.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$fname = RandomVariableName(type=>function); + + +Context("Numeric"); +$h = 0; +$k = 0; + +$f = Formula("sqrt(x)"); + +$left = $h; +$right = 5; + + +Context("Interval"); +$domain = Compute("[$left,inf)"); +$range = Compute("[$k,inf)"); + + +$xmin = -5; +$xmax = 5; +$ymin = -5; +$ymax = 5; + + +$gr = createTikZImage(); +$gr->addToPreamble(latexImagePreamble()); +$gr->BEGIN_TIKZ +\begin{axis}[ + xmin = $xmin, + xmax = $xmax, + ymin = $ymin, + ymax = $ymax, + xtick =, + ytick =, + minor xtick =, + minor ytick =, + ] + \addplot+[-{Kite},domain=$left:$right,smooth] {$f}; + \addplot[soliddot] coordinates {(0,0)}; +\end{axis} +END_TIKZ + +$starty = $f->eval(x=>$left); +$endy = $f->eval(x=>$right); + +$ALT = "a graph of a square root function, which is a curve that starts at ($left,$starty) and then moves up and right, not ending"; + + +############################################## + + +BEGIN_PGML + +A function is graphed. + +[@EnlargeImageStatementPGML()@]** + +>>[@image($gr, width=>300, tex_size=>TeXscalar(), extra_html_tags=>"alt = '$ALT' title = '$ALT'")@]*<< + +[@KeyboardInstructions('If you need to enter [`\infty`], you can type [|inf|]* or [|infinity|]*. If you need to union two (or more) intervals, use the letter [|U|]*. For example, to enter [`(-\infty,5)\cup(5,10]`] you can type [|(-inf,5)U(5,10]|]*.')@]** + + The function has domain [__________]{$domain} and range [__________]{$range}. + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +*Domain:* + +The function [`[$fname]`] is shown in blue. In order to determine the domain, we read the graph from left to right. At first, there is no graph, but as we keep going to the right, we find the blue graph starting at the point [`([$left],[$starty])`]. For the domain, we are only looking at [`x`]. Therefore, our domain interval starts at [`x=[$h]`]. + +We now keep walking to the right and find that the graph keeps going and going without ending point. If the graph ended at the edge of the coordinate system, we would find a solid or open dot there. Since there is no such dot, we know that the graph will keep going and going without end; it will go to infinity. Therefore, our domain in interval notation is [`[$domain]`]. In WeBWorK, we enter the answer as [`[[$left],\text{inf})`]. + +*Range:* + +For the range, we move in [`y`] direction from bottom to top. We find that in this case, we again meet nothing until the point [`([$left],[$starty])`]. This time, however, we focus on the [`y`] so our range starts at [`y=[$starty]`]. + +As we keep going up, the graph keeps going without ending. Therefore the range is [`[$range]`]. In WeBWorK, we enter the answer as [`[[$starty],\text{inf})`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg new file mode 100644 index 0000000000..a28a8e622b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg @@ -0,0 +1,95 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# sqrt(nx^2) +# +# +# Last updated: Yao 07/23/2013, Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +$showPartialCorrectAnswers = 1; + +$n = random(2,10,1); +$n2 = $n**2; + +$display = Formula("sqrt($n2 $var^2)"); + +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyNonNegativeIntegers(); + + +$ans = Formula("$n|$var|"); + +$evaluator = $ans->cmp()->withPostFilter(AnswerHints( + Formula("$n*$var") => "Almost correct, with absolute value symbols missing.", +)); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. Do not assume the variables take only positive values. + +[@KeyboardInstructions('To enter [`\sqrt{x}`], type [|sqrt(x)|]*. To enter [`|x|`], type [||x||]* or [|abs(x)|]*.@]** + +>>[``[$display]``]<< + + [__________]{$evaluator} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` \sqrt{x^2} = |x| `]. Whenever possible, we will use the absolute value [`|x|`] instead of [`\pm x`] to show that [`x`] can be positive or negative. + + [`` +\begin{aligned} + \sqrt{[$n2][$var]^2} &= \sqrt{[$n]^2[$var]^2} \\ + &= |[$n]|\cdot|[$var]| \\ + &= [$n]|[$var]| \\ +\end{aligned} + ``] + +The answer is either positive or negative, so it is sufficient to only have [`[$var]`] within the absolute value. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents10.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents10.pg new file mode 100644 index 0000000000..bd8d39a2f3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents10.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Convert the expression to radical notation. +# +# a^(1/n)x^(m/n) +# +# +# Last updated: Spoddeck 11/1/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "PGML.pl", + "PCCmacros.pl", + "parserRoot.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +parser::Root->Enable; +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); + +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); +Context()->flags->set(reduceConstants=>0); + + + +$m = random(2,5,1); +$n = $m+1; + +$a = random(2,20,1); +while (int($a**(1/$n)) == $a) {$a = random(2,20,1);} + +$display = Formula("$a^(1/$n) $var^($m/$n)"); + +Context()->flags->set(limits=>[0.5,5]); + +$ans = Formula("root($n,$a $var^($m))"); + +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is not in the expected form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0); + return 1; + } +); + + +############################################## + + +BEGIN_PGML + +Convert the expression to radical notation. + +[@KeyboardInstructions('To enter something like [`\sqrt[3]{x+1}`], type [|root(3,x+1)|]*.')@]** + +[``[$display]``] = [__]{$evaluator}{width=>7} + +END_PGML + +############################################## +BEGIN_PGML_SOLUTION + +When we have fractions as exponents, the numerator indicates the power while the denominator indicates the radical: [` x^\frac{m}{n} = \sqrt[n]{x^m} `]. So we can rewrite our expression as follows. We then use radical properties to simplify. + + [`` +\begin{aligned} + [$a]^\frac{1}{[$n]}[$var]^\frac{[$m]}{[$n]} &= \sqrt[[$n]]{[$a]}\sqrt[[$n]]{[$var]^[$m]} \\ + &= \sqrt[[$n]]{[$a][$var]^[$m]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg new file mode 100644 index 0000000000..bdf8b17e79 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg @@ -0,0 +1,81 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Use rational exponents to write the expression. +# +# sqrt(x) +# +# +# Last updated: Yao 1/5/2017 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + +$n = random(2,9,1); + +if ($n==2) {$problem="\sqrt{$var}";} +else {$problem = "\sqrt[$n]{$var}";} + +Context()->functions->undefine('sqrt'); + +$ans = Formula("$var^(1/$n)"); +Context()->flags->set(limits=>[0.5,5]); + +############################################## + + +BEGIN_PGML + +Use rational exponents to write the expression. + +[@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.@]** + + [``[$problem]``]=[_________________]{$ans} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$problem] &= [$ans] \\ +\end{aligned} + ``] + +The answer in calculator/WeBWorK notation is [`[$var]`]^[`(1/[$n])`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg new file mode 100644 index 0000000000..220b816680 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# sqrt(ax+b) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = random(2,10,1); +$b = random(1,10,1); +$rad = Compute("$a*$var+$b")->reduce; + +$n = random(2,5,1); +if ($n==2) {$problem="\sqrt{$a $var + $b}";} +else {$problem = "\sqrt[$n]{$a $var + $b}";} + +Context()->functions->undefine('sqrt'); + +Context()->flags->set(limits=>[0.5,5]); + +$ans = Formula("($rad)^(1/$n)"); + + +############################################## + + +BEGIN_PGML + +Use rational exponents to write the expression. + +[@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.@]** + + [``[$problem]=``][_________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + [$problem] &= [$ans] \\ +\end{aligned} + ``] + +So the answer in calculator/WeBWorK notation is [`([$rad])`]^[`(1/[$n])`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg new file mode 100644 index 0000000000..dd73389936 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg @@ -0,0 +1,114 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Use rational exponents to write the expression. +# +# n-th-root(x)n-th-root(x) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->variables->set($var=>{limits=>[0,1]}); +Context()->flags->set(reduceConstants=>0); + +$n = random(3,11,2); + + + +Context()->functions->undefine('sqrt','abs'); + + +$ans = Formula("$var^(2/$n)"); + +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is not in the expected form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0); + return 1; + } +); + +############################################## + + +BEGIN_PGML + +Simplify the expression, answering with rational exponents and not radicals. [@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.')@]** + +[``\sqrt[[$n]]{[$var]}\,\sqrt[[$n]]{[$var]}=``] [______]{$evaluator} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the following properties: + + [`` \sqrt[m]{x^n}=x^{\frac{n}{m}} ``] + + [`` x^m\cdot x^n=x^{m+n} ``] + +The solution is: + + [`` +\begin{aligned} + \sqrt[[$n]]{[$var]}\sqrt[[$n]]{[$var]} &= [$var]^\frac{1}{[$n]}[$var]^\frac{1}{[$n]} \\ + &= [$var]^\left(\frac{1}{[$n]}+\frac{1}{[$n]}\right) \\ + &= [$var]^\frac{2}{[$n]} \\ +\end{aligned} + ``] + +So the answer in calculator/WeBWorK notation is [`[$ans]`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents14.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents14.pg new file mode 100644 index 0000000000..c99f0cd8f6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents14.pg @@ -0,0 +1,135 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Use rational exponents to write the expression. +# +# cuberoot(a^3x^2) +# +# +# Last updated: Yao 1/5/2016 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); + +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + +do { + $num = random(1,5,1); + $den = random(2,5,1); +} until (gcd($num,$den)==1); + +if ($den==2) { + $a = list_random(2,3,5,7); +} elsif ($den==3) { + $a = list_random(2,3,5); +} elsif ($den==4) { + $a = random(2,3,1); +} else { + $a = 2; +} +$b = $a**$den; + +if ($den==2) { + $question = ($num==1) ? "\sqrt{$b $var}" : "\sqrt{$b $var^{$num}}"; +} else { + $question = ($num==1) ? "\sqrt[$den]{$b $var}" : "\sqrt[$den]{$b $var^{$num}}"; +} + +Context("Numeric"); +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); +Context()->flags->set(limits=>[2,5]); + + +$ans = Formula("$a $var^($num/$den)"); + +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1,bizarroPow=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is not in the expected form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0,bizarroPow=>0); + return 1; + } +); + +############################################## + + +BEGIN_PGML + +Simplify the expression, answering with rational exponents and not radicals. [@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.')@]** + +[``[$question]=``] [_________________]{$evaluator} + +END_PGML + + + +############################################## + +$s1 = ($num==1) ? "$var" : "$var^{$num}"; + +BEGIN_PGML_SOLUTION + +We first use radical properties to simplify. Then we rewrite the expression using rational exponents [` \sqrt[n]{x} = x^\frac{1}{n} `]. + + [`` +\begin{aligned} + [$question] + &= ([$b][$s1])^{\frac{1}{[$den]}} \\ + &= ([$a]^[$den][$s1])^{\frac{1}{[$den]}} \\ + &= ([$a]^[$den])^{\frac{1}{[$den]}}([$s1])^{\frac{1}{[$den]}} \\ + &= [$ans] +\end{aligned} + ``] + +So the answer in calculator/WeBWorK notation is [`[$a][$var]`]^[`([$num]/[$den])`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents15.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents15.pg new file mode 100644 index 0000000000..6c5b469e97 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents15.pg @@ -0,0 +1,113 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Use rational exponents to write the expression. +# +# cuberoot(a^3x^2) +# +# +# Last updated: Yao 1/5/2016 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + +do { + $num = random(2,6,1); + $den = list_random(4,6,8,9); + $factor = gcd($num,$den); + $ansNum = $num/$factor; + $ansDen = $den/$factor; +} until ( ($factor!=1) && ($ansDen!=1) ); + +if ($den==2) { + $a = list_random(2,3,5,7); +} elsif ($den==3) { + $a = list_random(2,3,5); +} elsif ($den==4) { + $a = random(2,3,1); +} else { + $a = 2; +} +$b = $a**$den; + +if ($den==2) { + $question = ($num==1) ? "\sqrt{$b $var}" : "\sqrt{$b $var^{$num}}"; +} else { + $question = ($num==1) ? "\sqrt[$den]{$b $var}" : "\sqrt[$den]{$b $var^{$num}}"; +} + +Context("Numeric"); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); +Context()->flags->set(limits=>[2,5]); + + +$ans = Formula("$a $var^($ansNum/$ansDen)"); + + +############################################## + + +BEGIN_PGML + +Use rational exponents to write the expression. + +* To enter [`x^y`], type *x^y*. + + [``[$question]=``][______________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +We first use radical properties to simplify. Then we rewrite the expression using rational exponents [` \sqrt[n]{x} = x^\frac{1}{n} `]. + + [`` +\begin{aligned} + [$question] + &= ([$b][$var]^{[$num]})^{\frac{1}{[$den]}} \\ + &= ([$a]^[$den][$var]^{[$num]})^{\frac{1}{[$den]}} \\ + &= ([$a]^[$den])^{\frac{1}{[$den]}}([$var]^{[$num]})^{\frac{1}{[$den]}} \\ + &= [$a][$var]^{\frac{[$num]}{[$den]}} \\ + &= [$ans] +\end{aligned} + ``] + +So the answer in calculator/WeBWorK notation is [`[$a][$var]`]^[`([$ansNum]/[$ansDen])`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents16.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents16.pg new file mode 100644 index 0000000000..8bf70abc49 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents16.pg @@ -0,0 +1,144 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Use rational exponents to write the expression. +# +# sqrt(a^2x)/cuberoot(x^2) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Fraction"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +do { + $num1 = 1; + $den1 = random(2,5,1); + $num2 = random(2,5,1); + do {$den2 = random($num2+1,10,1);} until ( ($den2!=$den1) && (gcd($den2,$num2)==1) ); + $commonD = lcm($den1,$den2); + $f1 = $commonD/$den1; + $f2 = $commonD/$den2; + $frac = Fraction($num1*$den2-$num2*$den1,$den1*$den2)->reduce; + ($ansNum,$ansDen) = $frac->value; +} until ($ansDen != $commonD); + +if ($den1==2) { + $a = random(2,10,1); +} elsif ($den1==3) { + $a = random(2,5,1); +} elsif ($den1==4) { + $a = random(2,3,1); +} else { + $a = 2; +} +$b = $a**$den1; + +$problem = ($den1==2) ? "\frac{\sqrt{$b $var}}{\sqrt[$den2]{$var^{$num2}}}" : "\frac{\sqrt[$den1]{$b $var}}{\sqrt[$den2]{$var^{$num2}}}"; + +Context("Numeric"); +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); + +Context()->variables->are($var=>'Real'); +Context()->variables->set($var=>{limits=>[0,5]}); +Context()->flags->set(reduceConstants=>0); +Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); + +$ans = Formula("$a*$var^($frac)"); +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is not in the expected form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0); + return 1; + } +); + +############################################## + + +BEGIN_PGML + +Simplify the expression, answering with rational exponents and not radicals. [@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.')@]** + +[``[$problem]=``] [_________________]{$evaluator} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the following properties: + + [`` \sqrt[m]{x^n}=x^{\frac{n}{m}} ``] + + [`` x^m \cdot x^n=x^{m+n} ``] + + [`` \frac{x^m}{x^n}=x^{m-n} ``] + +The solution is: + + [`` +\begin{aligned} + [$problem] + &= \frac{([$b][$var])^{\frac{[$num1]}{[$den1]}}}{[$var]^{\frac{[$num2]}{[$den2]}}} \\ + &= \frac{([$a]^[$den1][$var])^{\frac{[$num1]}{[$den1]}}}{[$var]^{\frac{[$num2]}{[$den2]}}} \\ + &= \frac{([$a]^[$den1])^{\frac{[$num1]}{[$den1]}}([$var])^{\frac{[$num1]}{[$den1]}}}{[$var]^{\frac{[$num2]}{[$den2]}}} \\ + &= \frac{[$a][$var]^{\frac{[$num1]}{[$den1]}}}{[$var]^{\frac{[$num2]}{[$den2]}}} \\ + &= [$a][$var]^{\frac{[$num1]}{[$den1]}-\frac{[$num2]}{[$den2]}} \\ + &= [$a][$var]^{\frac{[$num1*$f1]}{[$den1*$f1]}-\frac{[$num2*$f2]}{[$den2*$f2]}} \\ + &= [$a][$var]^{\frac{[$num1*$f1-$num2*$f2]}{[$den1*$f1]}} \\ + &= [$a][$var]^{[$frac]} +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents17.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents17.pg new file mode 100644 index 0000000000..423f3234b6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents17.pg @@ -0,0 +1,150 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Use rational exponents to write the expression. +# +# sqrt(a^2x)/cuberoot(x^2) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Fraction"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +do { + $num1 = random(1,4,1); + do {$den1 = random(2,5,1);} until (gcd($num1,$den1)==1); + $num2 = random(1,5,1); + do {$den2 = random(2,10,1);} until ( ($den2!=$den1) && (gcd($den2,$num2)==1) ); + $commonD = lcm($den1,$den2); + $f1 = $commonD/$den1; + $f2 = $commonD/$den2; + $frac = Fraction($num1*$den2-$num2*$den1,$den1*$den2)->reduce; + ($ansNum,$ansDen) = $frac->value; +} until ($ansDen != $commonD); + +if ($den1==2) { + $a = list_random(2,3,5,7); +} elsif ($den1==3) { + $a = list_random(2,3,5); +} elsif ($den1==4) { + $a = random(2,3,1); +} else { + $a = 2; +} +$b = $a**$den1; + +$s1 = ($num1==1) ? "$var" : "$var^{$num1}"; +$s2 = ($num2==1) ? "$var" : "$var^{$num2}"; +if ($den1==2) { + $problem = ($den2==2) ? "\frac{\sqrt{$b $s1}}{\sqrt{$s2}}" : "\frac{\sqrt{$b $s1}}{\sqrt[$den2]{$s2}}"; +} else { + $problem = ($den2==2) ? "\frac{\sqrt[$den1]{$b $s1}}{\sqrt{$s2}}" : "\frac{\sqrt[$den1]{$b $s1}}{\sqrt[$den2]{$s2}}"; +} + +Context("Numeric"); +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); + +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); + +$ans = ($num1==1) ? Formula("$a*$var^($frac)") : Formula("$a*$var^($frac)"); +Context()->variables->set($var=>{limits=>[2,5]}); + +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is not in the expected form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0); + return 1; + } +); + + +############################################## + + +BEGIN_PGML + +Simplify the expression, answering with rational exponents and not radicals. [@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.')@]** + +[``[$problem]=``] [_________________]{$evaluator} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We will use the following properties: + + [`` \sqrt[m]{x^n}=x^{\frac{n}{m}} ``] + + [`` x^m \cdot x^n=x^{m+n} ``] + + [`` \frac{x^m}{x^n}=x^{m-n} ``] + +The solution is: + + [`` +\begin{aligned} + [$problem] + &= \frac{([$b][$s1])^{\frac{1}{[$den1]}}}{[$var]^{\frac{[$num2]}{[$den2]}}} \\ + &= \frac{([$a]^[$den1][$s1])^{\frac{1}{[$den1]}}}{[$var]^{\frac{[$num2]}{[$den2]}}} \\ + &= \frac{([$a]^[$den1])^{\frac{1}{[$den1]}}([$s1])^{\frac{1}{[$den1]}}}{[$var]^{\frac{[$num2]}{[$den2]}}} \\ + &= \frac{[$a][$var]^{\frac{[$num1]}{[$den1]}}}{[$var]^{\frac{[$num2]}{[$den2]}}} \\ + &= [$a][$var]^{\frac{[$num1]}{[$den1]}-\frac{[$num2]}{[$den2]}} \\ + &= [$a][$var]^{\frac{[$num1*$f1]}{[$den1*$f1]}-\frac{[$num2*$f2]}{[$den2*$f2]}} \\ + &= [$a][$var]^{\frac{[$num1*$f1-$num2*$f2]}{[$den1*$f1]}} \\ + &= [$a][$var]^{[$frac]} +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents18.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents18.pg new file mode 100644 index 0000000000..70df59689c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents18.pg @@ -0,0 +1,97 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. For this problem you may assume that all variables are positive. +# +# (x^b)^(a/b) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +Context()->variables->set($var=>{limits=>[0.1,10]}); + +$b = random(2,5,1); +$a = random(2,5,1); +$a = $a/gcd($a,$b); + +$display = Formula("($var^($b))^($a/$b)"); + +Context()->operators->undefine('/'); +#Context()->functions->undefine('sqrt'); +Context()->functions->undefine('abs'); +LimitedPowers::OnlyIntegers(); + + +$ans = Formula("$var^($a)"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. For this problem you may assume that all variables are positive. + +>>[``[$display]``]<< + + [_________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp()); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We use the exponent property that [` \left(x^m\right)^n = x^{m\cdot n} `]. + + [`` +\begin{aligned} + \left([$var]^[$b]\right)^{\frac{[$a]}{[$b]}} + &= [$var]^{\left([$b]\right)\cdot\left(\frac{[$a]}{[$b]}\right)} \\ + &= [$var]^1 \\ + &= [$var] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents19.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents19.pg new file mode 100644 index 0000000000..cdfc5f1e00 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents19.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. For this problem you may assume that all variables are positive. +# +# sqrt(a^2x^(4b)) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + +$a = random(2,10,1); +$a2 = $a**2; +$b = random(1,5,1); +$b4 = $b*4; +$b2 = $b*2; + +$display = Formula("sqrt($a2 $var^($b4))"); + +Context()->operators->undefine('/'); +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyIntegers(); + + +$ans = Formula("$a $var^($b2)"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. For this problem you may assume that all variables are positive. + +>>[``[$display]``]<< + + [_________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp()); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We rewrite the expression using rational exponents [` \sqrt[n]{x^m} = x^\frac{m}{n} `]. Then we simplify the fractions. + + [`` +\begin{aligned} + \sqrt{[$a**2][$var]^{[$b*4]}} + &= \sqrt{[$a]^2[$var]^{[$b*4]}} \\ + &= [$a]^{\frac{2}{2}}[$var]^{\frac{[$b*4]}{2}} \\ + &= [$a]^1[$var]^{[$b*2]} \\ + &= [$a][$var]^{[$b*2]} \\ +\end{aligned} + ``] + +So the answer in calculator/WeBWorK notation is [`[$a][$var]`]^[`[$b*2]`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg new file mode 100644 index 0000000000..4cb443b2d0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# sqrt((x-b)^2) +# +# +# Last updated: Yao 07/25/2013, Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +$b = random(1,100,1); +Context()->flags->set(limits=>[$b-2,$b+2]); + +$display = Formula("sqrt(($var-$b)^2)"); + +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyNonNegativeIntegers(); + + +$ans = Formula("|$var-$b|"); + +$evaluator = $ans->cmp()->withPostFilter(AnswerHints( + Formula("$var-$b") => "Almost correct, with absolute value symbols missing.", + Formula("$b-$var") => "Almost correct, with absolute value symbols missing.", +)); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. + +[@KeyboardInstructions('To enter [`\sqrt{x}`], type [|sqrt(x)|]*. To enter [`|x|`], type [||x||]* or [|abs(x)|]*.@]** + +>>[``[$display]``]<< + + [__________]{$evaluator} + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` \sqrt{x^2} = |x| `]. Whenever possible, we will use the absolute value [`|x|`] instead of [`\pm x`] to show that [`x`] can be positive or negative. + + [`` +\begin{aligned} + \sqrt{([$var]-[$b])^2} &= |[$var]-[$b]| \\ +\end{aligned} + ``] + +We cannot simplify this expression any further. So the answer is [` |[$var]-[$b]| `] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents20.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents20.pg new file mode 100644 index 0000000000..6ff84d497e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents20.pg @@ -0,0 +1,129 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. For this problem you may assume that all variables are positive. +# +# sqrt(x^n)n-th-root(x^2) +# +# +# Last updated: Yao 1/5/2017 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Fraction"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +Context()->variables->set($var=>{limits=>[0,2]}); +do { + $num1 = 1; + $den1 = random(2,5,1); + $num2 = random(2,5,1); + do {$den2 = random($num2+1,10,1);} until ( ($den2!=$den1) && (gcd($den2,$num2)==1) ); + $commonD = lcm($den1,$den2); + $f1 = $commonD/$den1; + $f2 = $commonD/$den2; + $frac = Fraction($num1*$den2+$num2*$den1,$den1*$den2)->reduce; + ($ansNum,$ansDen) = $frac->value; +} until ( $ansDen != $commonD ); + +$problem = ($den1==2) ? "\sqrt{$var} \cdot \sqrt[$den2]{$var^{$num2}}" : "\sqrt[$den1]{$var}\cdot\sqrt[$den2]{$var^{$num2}}"; + +Context("Numeric"); +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); + +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +Context()->operators->undefine('*'); +Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); +Context()->variables->set($var=>{limits=>[0,2]}); + +$ans = Formula("$var^($frac)"); +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is not in the expected form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0); + return 1; + } +); + + +############################################## + +BEGIN_PGML + +Simplify the expression, answering with rational exponents and not radicals. [@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.')@]** + +[``[$problem]=``] [_________________]{$evaluator} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +We will use the following properties: + + [`` \sqrt[m]{x^n}=x^{\frac{n}{m}} ``] + + [`` x^m\cdot x^n=x^{m+n} ``] + +The solution is: + + [`` +\begin{aligned} + [$problem] + &= [$var]^{\frac{[$num1]}{[$den1]}} \cdot [$var]^{\frac{[$num2]}{[$den2]}} \\ + &= [$var]^{\frac{[$num1]}{[$den1]}+\frac{[$num2]}{[$den2]}} \\ + &= [$var]^{\frac{[$num1*$f1]}{[$den1*$f1]}+\frac{[$num2*$f2]}{[$den2*$f2]}} \\ + &= [$var]^{\frac{[$num1*$f1+$num2*$f2]}{[$den1*$f1]}} \\ + &= [$var]^{[$frac]} +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents21.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents21.pg new file mode 100644 index 0000000000..e046d6d70f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents21.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. For this problem you may assume that all variables are positive. +# +# (a^n/x^(2n))^(-1/n) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$a = list_random(2,3,5,7); +if ($a==2) { + $n=random(2,10,1); +} elsif ($a==3) { + $n=random(2,4,1); +} elsif ($a==5) { + $n=random(2,3,1); +} else { + $n=2; +} + +$an = $a**$n; +$n2 = $n*2; + + +Context("Fraction"); +$m = Fraction("-1","$n"); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + + + + +Context()->operators->undefine('*'); +Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); +#LimitedPowers::OnlyIntegers(); + + +$ans = Formula("$var^(2)/($a)"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. For this problem you may assume that all variables are positive. + + [``\left(\frac{[$an]}{[$var]^{[$n2]}}\right)^{[$m]}=``][_________________]{$ans} + +END_PGML + + +############################################## + +BEGIN_PGML_SOLUTION + +We use the exponent property that [` \left(x^m\right)^n = x^{m\cdot n} `]. + + [`` +\begin{aligned} + \left(\frac{[$a**$n]}{[$var]^{[$n*2]}}\right)^{-\frac{1}{[$n]}} + &= \left(\frac{[$a]^[$n]}{[$var]^{[$n*2]}}\right)^{-\frac{1}{[$n]}} \\ + &= \frac{[$a]^{-\frac{1}{[$n]}\cdot[$n]}}{[$var]^{-\frac{1}{[$n]}\cdot[$n*2]}} \\ + &= \frac{[$a]^{-1}}{[$var]^{-2}} \\ + &= \frac{[$var]^{2}}{[$a]^{1}} \\ + &= \frac{[$var]^{2}}{[$a]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg new file mode 100644 index 0000000000..381917348f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. For this problem you may assume that all variables are positive. +# +# n-th-root(n-th-root(x)) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "bizarroArithmetic.pl", + "contextFraction.pl", + "unionTables.pl", + "PGML.pl", + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +$m = random(2,5,1); +$n = random(2,5,1); +$mn = $m*$n; + +if ($m==2) { + $question = ($n==2) ? "\sqrt{\sqrt{$var}}" : "\sqrt[$n]{\sqrt{$var}}"; +} else { + $question = ($n==2) ? "\sqrt{\sqrt[$m]{$var}}" : "\sqrt[$n]{\sqrt[$m]{$var}}"; +} + +Context("Fraction"); +$frac = Fraction(1,$mn); + +Context("Numeric"); +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); + +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); +Context()->flags->set(limits=>[2,5]); +Context()->operators->undefine('*'); +Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); + +$ans = Formula("$var^($frac)"); +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is not in the expected form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0); + return 1; + } +); + + +############################################## + + +BEGIN_PGML + +Simplify the expression, answering with rational exponents and not radicals. [@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.')@]** + +[``[$question]=``] [_________________]{$evaluator} + +END_PGML + +############################################## + +$s1 = ($m==2) ? "\sqrt{$var}" : "\sqrt[$m]{$var}"; + +BEGIN_PGML_SOLUTION + +We rewrite the expression using rational exponents [` \sqrt[n]{x} = x^\frac{1}{n} `]. Then we use exponent properties and multiply the fractions. + + [`` +\begin{aligned} + [$question] + &= \left( [$s1] \right)^{\frac{1}{[$n]}} \\ + &= \left([$var]^{\frac{1}{[$m]}}\right)^{\frac{1}{[$n]}} \\ + &= [$var]^{\frac{1}{[$m]}\cdot\frac{1}{[$n]}} \\ + &= [$var]^{\frac{1}{[$mn]}} \\ +\end{aligned} + ``] + +So the answer in calculator/WeBWorK notation is [`[$var]`]^[`(1/[$mn])`]. + +END_PGML_SOLUTION + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg new file mode 100644 index 0000000000..88e071678f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg @@ -0,0 +1,92 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. For this problem you may assume that all variables are positive. +# +# (x^(-b/a))^(a/b) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextRationalFunction.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + +############################################## + +TEXT(beginproblem()); +Context("RationalFunction-Strict"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +Context()->operators->set( + '/' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, + ' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '//' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + ' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}); + + +do { + $a = random(2,10,1); + $b=random(2,10,1); +} until (gcd($a,$b)==1); + +$f1 = random(1,5,1); +$c = $a*$f1; + +$problem = "\left($var^{-\frac{$c}{$b}}\right)^{\frac{$b}{$a}}"; +$ans = Formula("1/($var^$f1)"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. Please only use positive exponents in your answer. + +For this problem you may assume that all variables are positive. + + [``[$problem]=``][_________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +We use the exponent property that [` \left(x^m\right)^n = x^{m\cdot n} `]. + + [`` +\begin{aligned} + \left([$var]^{-\frac{[$c]}{[$b]}}\right)^{\frac{[$b]}{[$a]}} + &= [$var]^{\left(-\frac{[$c]}{[$b]}\right)\cdot\left(\frac{[$b]}{[$a]}\right)} \\ + &= [$var]^{-[$f1]} \\ + &= \frac{1}{[$var]^[$f1]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents24.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents24.pg new file mode 100644 index 0000000000..d9f60eed81 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents24.pg @@ -0,0 +1,117 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# Portland Community College +# +# Template: +# Simplify the expression. For this problem you may assume that all variables are positive. +# +# sqrt(x)n-th-root(x) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$n = random(3,10,1); +Context("Fraction"); +$m = Fraction("$n+2","$n*2"); + + +Context("Numeric"); +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); + +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->variables->set($var=>{limits=>[1,4]}); +Context()->flags->set(reduceConstants=>0); + + +Context()->operators->undefine('*'); +Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt','abs'); +#LimitedPowers::OnlyIntegers(); + + +$ans = Formula("$var^($m)"); +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is not in the expected form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0); + return 1; + } +); + + +############################################## + + +BEGIN_PGML + +Simplify the expression, answering with rational exponents and not radicals. [@KeyboardInstructions('To enter [`x^{m/n}`], type [|x^(m/n)|]*.')@]** + +[``\sqrt{[$var]}\sqrt[[$n]]{[$var]}=``] [_________________]{$evaluator} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +We rewrite the expression using rational exponents [` \sqrt[n]{x^m} = x^\frac{m}{n} `]. Then we use exponent properties and add the fractions. + + [`` +\begin{aligned} + \sqrt{[$var]}\sqrt[[$n]]{[$var]} + &= [$var]^{\frac{1}{2}}[$var]^{\frac{1}{[$n]}} \\ + &= [$var]^{\frac{1}{2}+\frac{1}{[$n]}} \\ + &= [$var]^{\frac{[$n]}{[$n*2]}+\frac{2}{[$n*2]}} \\ + &= [$var]^{\frac{[$n+2]}{[$n*2]}} \\ +\end{aligned} + ``] + +If the fraction in the exponent is not fully simplified after the last step, make sure to reduce it to its lowest terms. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg new file mode 100644 index 0000000000..98d366a8e9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. For this problem you may assume that all variables are positive. +# +# x^(a/b)(x^(1/b)+x^(-1/b)) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$a = random(2,10,1); +$b = $a+1; +Context("Fraction"); +$m[0] = Fraction("$a","$b"); +$m[1] = Fraction("1","$b"); +$m[2] = Fraction("$a+1","$b"); +$m[3] = Fraction("$a-1","$b"); + + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + + +Context()->operators->undefine('*'); +#Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt','abs'); +#LimitedPowers::OnlyIntegers(); + +Context()->variables->set($var=>{limits=>[1,6]}); +$ans = Formula("$var^($m[2])+$var^($m[3])"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. For this problem you may assume that all variables are positive. + +>>[``[$var]^{[$m[0]]}\left([$var]^{[$m[1]]}+[$var]^{-[$m[1]]}\right)``]<< + + [_________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp()); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We distribute [`[$var]^{[$m[0]]}`]. Then we use the exponent property that [` x^m\!\cdot\! x^n = x^{m+n} `] and simplify the resulting fractions in the exponents. + + [`` +\begin{aligned} + [$var]^{[$m[0]]}\left([$var]^{[$m[1]]}+[$var]^{-[$m[1]]}\right) + &= [$var]^{[$m[0]]}[$var]^{[$m[1]]}+[$var]^{[$m[0]]}[$var]^{-[$m[1]]} \\ + &= [$var]^{[$m[0]]+[$m[1]]}+[$var]^{[$m[0]]+\left(-[$m[1]]\right)} \\ + &= [$var]^{[$m[2]]}+[$var]^{\frac{[$a-1]}{[$b]}} \\ + &= [$var]+[$var]^{[$m[3]]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg new file mode 100644 index 0000000000..db436cff8c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. For this problem you may assume that all variables are positive. +# +# sqrt(x)(sqrt(x)+4n-th-root(x^(2n)) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$n = random(1,4,1); +$n4 = 4*$n; +$n2 = 2*$n; + + + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + + +Context()->operators->undefine('/'); +Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt','abs'); +#LimitedPowers::OnlyIntegers(); + + +$ans = Formula("2 $var"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. For this problem you may assume that all variables are positive. + +>>[``\sqrt{[$var]}\left(\sqrt{[$var]}+\sqrt[[$n4]]{[$var]^{[$n2]}}\right)``]<< + + [_________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp()); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We rewrite the radical expression using rational exponents. Then we distribute [`[$var]^{\frac{1}{2}}`] and use the exponent property that [` x^m\!\cdot\! x^n = x^{m+n} `]. We simplify fractions whenever we can. + + [`` +\begin{aligned} + \sqrt{[$var]}\left(\sqrt{[$var]}+\sqrt[[$n*4]]{[$var]^{[$n*2]}}\right) + &= [$var]^{\frac{1}{2}}\left([$var]^{\frac{1}{2}}+[$var]^{\frac{[$n*2]}{[$n*4]}}\right) \\ + &= [$var]^{\frac{1}{2}}\left([$var]^{\frac{1}{2}}+[$var]^{\frac{1}{2}}\right) \\ + &= [$var]^{\frac{1}{2}}[$var]^{\frac{1}{2}}+[$var]^{\frac{1}{2}}[$var]^{\frac{1}{2}} \\ + &= [$var]^{\frac{1}{2}+\frac{1}{2}}+[$var]^{\frac{1}{2}+\frac{1}{2}} \\ + &= [$var]^{1}+[$var]^{1} \\ + &= [$var]+[$var] \\ + &= 2[$var] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents27.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents27.pg new file mode 100644 index 0000000000..2aadf3e023 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents27.pg @@ -0,0 +1,94 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# sqrt((-a)^2) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$a = random(1239,19278,1); + + + + +Context("LimitedNumeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + + +#Context()->operators->undefine('/'); +#Context()->operators->undefine('+'); +#Context()->functions->undefine('sqrt','abs'); +#LimitedPowers::OnlyIntegers(); + + +$ans = Formula("$a"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. + +>>[``\sqrt{\left(-[$a]\right)^2}``]<< + + [_________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp()); + + +############################################## + + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` \sqrt{x^2} = |x| `]. + + [`` +\begin{aligned} + \sqrt{(-[$a])^2} &= |-[$a]| \\ + &= [$a] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents28.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents28.pg new file mode 100644 index 0000000000..a9c05a1bf3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents28.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. For this problem you may assume that all variables are positive. +# +# sqrt(x^(4n)) +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$n = random(1,10,1); +$n2 = $n*2; +$n4 = $n*4; + + + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + + +#Context()->operators->undefine('/'); +#Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyIntegers(); + + +$ans = Formula("$var^($n2)"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. For this problem you may assume that all variables are positive. + +>>[``\sqrt{[$var]^{[$n4]}}``]<< + + [_________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp()); + + +############################################## + + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` \sqrt{x^2} = |x| `]. However, since in this case the exponent is not [`2`], the formula becomes [` \sqrt{x^n} = \left|x^{\frac{n}{2}}\right| `]. + + [`` +\begin{aligned} + \sqrt{[$var]^{[$n*4]}} &= \left|[$var]^{\frac{[$n*4]}{2}}\right| \\ + &= \left|[$var]^{[$n*2]}\right| \\ + &= [$var]^{[$n*2]} \\ +\end{aligned} + ``] + +The reason that we do not need the absolute value at the end is that [`[$var]^{[$n*2]}`] has an even-numbered exponent and is therefore always positive. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents29.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents29.pg new file mode 100644 index 0000000000..28cd631b2b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents29.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# sqrt(x^(4n+2)) +# +# +# Last updated: Yao 07/25/2013, Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$n = random(1,10,1); +$n42 = $n*4+2; +$n21 = $n*2+1; + + + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + + +#Context()->operators->undefine('/'); +#Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyIntegers(); + + +$ans = Formula("|$var^($n21)|"); + +$evaluator = $ans->cmp()->withPostFilter(AnswerHints( + Formula("$var^($n21)") => "Almost correct, with absolute value symbols missing.", +)); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. + +>>[``\sqrt{[$var]^{[$n42]}}``]<< + + [_________________]{$evaluator} + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` \sqrt{x^2} = |x| `]. However, since in this case the exponent is not [`2`], the formula becomes [` \sqrt{x^n} = \left|x^{\frac{n}{2}}\right| `]. + + [`` +\begin{aligned} + \sqrt{[$var]^{[$n*4+2]}} &= \left|[$var]^{\frac{[$n*4+2]}{2}}\right| \\ + &= \left|[$var]^{[$n*2+1]}\right| \\ +\end{aligned} + ``] + +So the answer in calculator/WeBWorK notation is abs([`[$var]`]^[`[$n*2+1]`]). + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents3.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents3.pg new file mode 100644 index 0000000000..a0bcefcec9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents3.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# cuberoot(a^3*x^(3m)) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); + +$a = random(1,5,1); +$m = random(2,4,1); + +$internal = Formula("$a**3 $var^(3*$m)")->reduce; + + +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyNonNegativeIntegers(); + + +$ans = Formula("-$a $var^($m)"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. +* To enter [`\sqrt{x}`], type *sqrt(x)*. +* To enter [`x^y`], type *x^y*. +* To enter [`|x|`], type *|x|* or *abs(x)*. +* If a value is not defined as a real number or function, type *DNE* for "does not exist". + +>>[``-\sqrt[3]{[$internal]}``]<< + + [__________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp()); + + +############################################## + + +if ($a==1) { + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` (x^m)^n = x^{mn} `]. + + [`` +\begin{aligned} + -\sqrt[3]{[$var]^[$m*3]} &= -\sqrt[3]{\left([$var]^[$m]\right)^3} \\ + &= -[$var]^[$m] \\ +\end{aligned} + ``] + +Since this is an odd-numbered root, the sign of [` -[$var]^[$m] `] is not affected when we simplify the expression. + +END_PGML_SOLUTION + +} else { + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` (x^m)^n = x^{mn} `]. + + [`` +\begin{aligned} + -\sqrt[3]{[$a**3][$var]^[$m*3]} &= -\sqrt[3]{[$a]^3\left([$var]^[$m]\right)^3} \\ + &= -[$a][$var]^[$m] \\ +\end{aligned} + ``] + +Since this is an odd-numbered root, the sign of [` -[$a][$var]^[$m] `] is not affected when we simplify the expression. + +END_PGML_SOLUTION + +} + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents30.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents30.pg new file mode 100644 index 0000000000..ec59969c4b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents30.pg @@ -0,0 +1,99 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# sqrt(x^2+2ax+a^2) +# +# +# Last updated: Yao 07/25/2013, Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$a = random(1,10,1); +$a2 = $a*2; +$aa = $a**2; + + + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + + +#Context()->operators->undefine('/'); +#Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyIntegers(); + + +$ans = Formula("|$var+$a|"); + +Context()->flags->set(limits=>[-$a-2,-$a+2]); +$evaluator = $ans->cmp()->withPostFilter(AnswerHints( + Formula("$var+$a") => "Almost correct, with absolute value symbols missing.", +)); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. + +>>[``\sqrt{[$var]^{2}+[$a2][$var]+[$aa]}``]<< + + [_________________]{$evaluator} + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` \sqrt{x^2} = |x| `]. But first, we need to factor the polynomial. + + [`` +\begin{aligned} + \sqrt{[$var]^{2}+[$a*2][$var]+[$a**2]} + &= \sqrt{([$var]+[$a])([$var]+[$a])} \\ + &= \sqrt{([$var]+[$a])^2} \\ + &= \left|[$var]+[$a]\right| \\ +\end{aligned} + ``] + +We cannot simplify this expression any further. So the answer in calculator/WeBWorK notation is abs([`[$var]+[$a]`]). + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents31.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents31.pg new file mode 100644 index 0000000000..664344736c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents31.pg @@ -0,0 +1,96 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# n-th-root(x^n) +# +# +# Last updated: Yao 07/25/2013, Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +$n = random(2,20,2); + + + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->flags->set(reduceConstants=>0); + + +#Context()->operators->undefine('/'); +#Context()->operators->undefine('+'); +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyIntegers(); + + +$ans = Formula("|$var|"); + +$evaluator = $ans->cmp()->withPostFilter(AnswerHints( + Formula("$var") => "Almost correct, with absolute value symbols missing.", +)); + + + +############################################## + + +BEGIN_PGML + +Simplify the expression. + +>>[``\sqrt[[$n]]{[$var]^{[$n]}}``]<< + + [_________________]{$evaluator} + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` \sqrt{x^2} = |x| `]. However, since in this case the exponent is not [`2`] and the radical is not [`2`] yet still an even number, the formula becomes [` \sqrt[m]{x^n} = \left|x^{\frac{n}{m}}\right| `]. + + [`` +\begin{aligned} + \sqrt[[$n]]{[$var]^{[$n]}} &= \left|[$var]^{\frac{[$n]}{[$n]}}\right| \\ + &= \left|[$var]^1\right| \\ + &= \left|[$var]\right| \\ +\end{aligned} + ``] + +So the answer in calculator/WeBWorK notation is abs([`[$var]`]). + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents4.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents4.pg new file mode 100644 index 0000000000..6c13f236f4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents4.pg @@ -0,0 +1,135 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# cuberoot((ax+b)^(3) +# +# +# Last updated: Yao 07/25/2013, Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "answerHints.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$a = non_zero_random(-5,5,1); +$b = non_zero_random(-10,10,1); + +$internal = Formula("($a $var + $b)^3")->reduce; + + +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyNonNegativeIntegers(); + + +$ans = Formula("$a $var + $b"); + +$evaluator = $ans->cmp()->withPostFilter(AnswerHints( + Formula("|$a $var + $b|") => "Are absolute value symbols really necessary?", +)); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. +* To enter [`\sqrt{x}`], type *sqrt(x)*. +* To enter [`x^y`], type *x^y*. +* To enter [`|x|`], type *|x|* or *abs(x)*. +* If a value is not defined as a real number or function, type *DNE* for "does not exist". + +>>[``\sqrt[3]{[$internal]}``]<< + + [__________]{$evaluator} + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +############################################## + + +if ($a==1) { + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` \sqrt[3]{x^3} = x `]. + + [`` +\begin{aligned} + \sqrt[3]{([$var]+[$b])^3} &= [$var]+[$b] \\ +\end{aligned} + ``] + +Since this is an odd-numbered root, the sign of [` [$var]+[$b] `] is not affected when we simplify the expression. + +END_PGML_SOLUTION + +} elsif ($a==-1) { + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` \sqrt[3]{x^3} = x `]. + + [`` +\begin{aligned} + \sqrt[3]{(-[$var]+[$b])^3} &= -[$var]+[$b] \\ +\end{aligned} + ``] + +Since this is an odd-numbered root, the sign of [` -[$var]+[$b] `] is not affected when we simplify the expression. + +END_PGML_SOLUTION + +} else { + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` \sqrt[3]{x^3} = x `]. + + [`` +\begin{aligned} + \sqrt[3]{([$a][$var]+[$b])^3} &= [$a][$var]+[$b] \\ +\end{aligned} + ``] + +Since this is an odd-numbered root, the sign of [` [$a][$var]+[$b] `] is not affected when we simplify the expression. + +END_PGML_SOLUTION + +} + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents5.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents5.pg new file mode 100644 index 0000000000..b848e3146a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents5.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# fourthroot(-m^4) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + + +$m = random(2,5,1); + +$internal = Formula("-($m**4)")->reduce; + + +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyNonNegativeIntegers(); + + +$ans = Formula("DNE"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. +* To enter [`\sqrt{x}`], type *sqrt(x)*. +* To enter [`x^y`], type *x^y*. +* To enter [`|x|`], type *|x|* or *abs(x)*. +* If a value is not defined as a real number or function, type *DNE* for "does not exist". + +>>[``\sqrt[4]{[$internal]}``]<< + + [__________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp()); + + +############################################## + + +BEGIN_PGML_SOLUTION + +There is no solution to this expression because we cannot take an even-numbered root of a negative number. So the answer is DNE. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents6.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents6.pg new file mode 100644 index 0000000000..57fc19991c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents6.pg @@ -0,0 +1,98 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# fifthroot(-m^5) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + + +$m = random(2,3,1); + +$internal = Formula("-($m**5)")->reduce; + + +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyNonNegativeIntegers(); + + +$ans = Formula("-$m"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. +* To enter [`\sqrt{x}`], type *sqrt(x)*. +* To enter [`x^y`], type *x^y*. +* To enter [`|x|`], type *|x|* or *abs(x)*. +* If a value is not defined as a real number or function, type *DNE* for "does not exist". + +>>[``\sqrt[5]{[$internal]}``]<< + + [__________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp()); + + +############################################## + + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use that [` \sqrt[5]{x^5} = x `]. + + [`` +\begin{aligned} + \sqrt[5]{-[$m**5]} &= \sqrt[5]{(-[$m])^5} \\ + &= -[$m] \\ +\end{aligned} + ``] + +Since this is an odd-numbered root, the sign of [` -[$m] `] is not affected when we simplify the expression. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents7.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents7.pg new file mode 100644 index 0000000000..13d3590a7a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents7.pg @@ -0,0 +1,111 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Convert the expression to radical notation. +# +# x^(m/n) +# +# +# Last updated: Spoddeck 11/1/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "PGML.pl", + "PCCmacros.pl", + "parserRoot.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +parser::Root->Enable; +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); +Context()->flags->set(reduceConstants=>0); + +$m = random(2,5,1); +$n = $m+1; + +$display = Formula("$var^($m/$n)"); + + +Context()->flags->set(limits=>[0.5,5]); + +$ans = Formula("root($n,$var^($m))"); + +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is not in the expected form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0); + return 1; + } +); + + + +############################################## + + +BEGIN_PGML + +Convert the expression to radical notation. + +[@KeyboardInstructions('To enter something like [`\sqrt[3]{x+1}`], type [|root(3,x+1)|]*.')@]** + +[``[$display]``] = [__]{$evaluator}{7} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +When we have fractions as exponents, the numerator indicates the power while the denominator indicates the radical: [` x^\frac{m}{n} = \sqrt[n]{x^m} `]. So we can rewrite our expression as follows: + + [`` +\begin{aligned} + [$var]^\frac{[$m]}{[$n]} &= \sqrt[[$n]]{[$var]^[$m]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents8.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents8.pg new file mode 100644 index 0000000000..d85ee32a23 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents8.pg @@ -0,0 +1,110 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Convert the expression to radical notation. +# +# x^(m/n) +# +# +# Last updated: Spoddeck 11/1/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "niceTables.pl", + "PGML.pl", + "PCCmacros.pl", + "parserRoot.pl", + "bizarroArithmetic.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +parser::Root->Enable; +Context()->operators->set( +'/' => {class => 'bizarro::BOP::divide', isCommand => 1}, +' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, +'//' => {class => 'bizarro::BOP::divide', isCommand => 1}, +); + +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); +Context()->flags->set(reduceConstants=>0); + +do { +$m = random(2,9,1); +$n = random(2,9,1); +} until (gcd($m,$n) == 1); + +$display = Formula("$var^($m/$n)"); + +Context()->flags->set(limits=>[0.5,5]); + +$ans = Formula("root($n,$var^($m))"); + +$evaluator = $ans->cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1); + delete $correct->{test_values}; + delete $student->{test_values}; + Value->Error("Your answer is not in the expected form") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0); + return 1; + } +); + + + +############################################## + + +BEGIN_PGML + +Convert the expression to radical notation. + +[@KeyboardInstructions('To enter something like [`\sqrt[3]{x+1}`], type [|root(3,x+1)|]*.')@]** + +[``[$display]``] = [__]{$evaluator}{width=>7} + +END_PGML + +############################################## +BEGIN_PGML_SOLUTION + +When we have fractions as exponents, the numerator indicates the power while the denominator indicates the radical: [` x^\frac{m}{n} = \sqrt[n]{x^m} `]. So we can rewrite our expression as follows: + + [`` +\begin{aligned} + [$var]^\frac{[$m]}{[$n]} &= \sqrt[[$n]]{[$var]^[$m]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents9.pg b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents9.pg new file mode 100644 index 0000000000..c6fcf59bc4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RadicalsRationalExponents/RadicalsRationalExponents9.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# m-th-root((ax)^n) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n','a','b','c'); +Context()->variables->are($var=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); +Context()->flags->set(reduceConstants=>0); + +do { + $a = list_random(2,3,5,7); + $n = random(2,10,1); +} until ($a**$n<200); +$m = random(3,7,2); + +$internal = Formula("($a $var)^($m*$n)")->reduce; + + +Context()->functions->undefine('sqrt'); +LimitedPowers::OnlyNonNegativeIntegers(); + +$an = $a**$n; +$ans = Formula("$an*$var^$n"); + + +############################################## + + +BEGIN_PGML + +Simplify the expression. +* To enter [`\sqrt{x}`], type *sqrt(x)*. +* To enter [`x^y`], type *x^y*. +* To enter [`|x|`], type *|x|* or *abs(x)*. +* If a value is not defined as a real number or function, type *DNE* for "does not exist". + +>>[``\sqrt[[$m]]{[$internal]}``]<< + + [__________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp()); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We can rewrite this expression using rational exponents [` \sqrt[n]{x^m} = x^\frac{m}{n} `]. + + [`` +\begin{aligned} + \sqrt[[$m]]{([$a][$var])^{[$m*$n]}} &= ([$a][$var])^\frac{[$m*$n]}{[$m]} \\ + &= ([$a][$var])^[$n] \\ + &= [$a]^{[$n]}[$var]^[$n] \\ + &= [$ans] \\ +\end{aligned} + ``] + +We can simplify fractions that are in the exponent just like any other fraction. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications1.pg b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications1.pg new file mode 100644 index 0000000000..7f0aa3d902 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications1.pg @@ -0,0 +1,59 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +$a = random(30,50,1); +$b = random(10,20,1)+$a; + +$largeRate = NumberWithUnits("$a","hr"); +$smallRate = NumberWithUnits("$b","hr"); + + +$c = 1/(1/$a+1/$b); +$ans = NumberWithUnits("$c","hr"); + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Suppose that a large pump can empty a swimming pool in \($largeRate\) and that a small pump can empty the same pool in \($smallRate\). If both pumps are used at the same time, how long will it take to empty the pool? + +$PAR + +If both pumps are used at the same time, it will take \{ans_rule(15)\} to empty the pool. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0.01)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications2.pg b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications2.pg new file mode 100644 index 0000000000..b89aa1957a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications2.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); +$a = random(4,10,1); +$rate[1] = random(3,5,0.1); +$rate[0] = $rate[1]+random(0.5,1,0.1); + +$x = $a/($rate[0]); +$hlead = $a/($rate[1])-$x; + +$lead = round($hlead*60*100)/100; +$lead = NumberWithUnits("$lead","min"); + +$distance = NumberWithUnits("$a","mi"); + +$b = round(($rate[0]-$rate[1])*100)/100; +$speedDifference = NumberWithUnits("$b","mi/hr"); + +$rate[0]=($hlead*$b+sqrt(($hlead*$b)**2+4*$hlead*$b*$a))/(2*$hlead); +$rate[1]=$rate[0]-$b; + +for my $i (0,1) +{$ans[$i] = NumberWithUnits("$rate[$i]","mi/hr");}; + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +The winner of a \($distance\) race finishes \($lead\) ahead of the second-place runner. On average, the winner ran \($speedDifference\) faster than the second place runner. Find the average running speed for each runner. + +$PAR + +The winner's average speed was \{ans_rule(15)\} and the second-place runner's average speed was \{ans_rule(15)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + +for my $i (0,1) +{ANS( $ans[$i]->cmp(tolerance=>0.01));} + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications3.pg b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications3.pg new file mode 100644 index 0000000000..71467a4064 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications3.pg @@ -0,0 +1,69 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); + +$current = random(1,4,0.1); +$stillSpeed = random(12,20,1); +$s = $stillSpeed; + +$distance = random(30,50,1); +$d = $distance; + +$time = $distance/($stillSpeed-$current)+$distance/($stillSpeed+$current); +$time = round($time*100)/100; +$t = $time; + +$current = sqrt(($t*$s**2-2*$d*$s)/$t); + +$current = NumberWithUnits("$current","mi/hr"); +$stillSpeed = NumberWithUnits("$stillSpeed","mi/hr"); +$distance = NumberWithUnits("$distance","mi"); +$time = NumberWithUnits("$time","hr"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +In still water a tugboat can travel \($stillSpeed\). It travels \($distance\) upstream and then \($distance\) downstream in a total time of \($time\). Find the speed of the current. + +$PAR + +The current's speed is \{ans_rule(15)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + +ANS( $current->cmp(tolerance=>0.05)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications4.pg b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications4.pg new file mode 100644 index 0000000000..95223001ae --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications4.pg @@ -0,0 +1,69 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); + +$current = random(10,30,0.1); +$stillSpeed = random(180,300,1); +$s = $stillSpeed; + +$distance = random(600,1000,10); +$d = $distance; + +$time = $distance/($stillSpeed-$current)+$distance/($stillSpeed+$current); +$time = round($time*100)/100; +$t = $time; + +$current = sqrt(($t*$s**2-2*$d*$s)/$t); + +$current = NumberWithUnits("$current","mi/hr"); +$stillSpeed = NumberWithUnits("$stillSpeed","mi/hr"); +$distance = NumberWithUnits("$distance","mi"); +$time = NumberWithUnits("$time","hr"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +Without any wind an airplane flies at \($stillSpeed\). The plane travels \($distance\) into the wind and then returns with the wind in a total time of \($time\). Find the average speed of the wind. + +$PAR + +The wind's speed is \{ans_rule(15)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + +ANS( $current->cmp(tolerance=>0.01)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications5.pg b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications5.pg new file mode 100644 index 0000000000..0794adb829 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications5.pg @@ -0,0 +1,68 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); + +$windSpeed = random(10,30,0.1); +$w = $windSpeed; +$airSpeed = random(180,300,1); + +$distance[0] = random(600,1000,10); +$d0 = $distance[0]; +$distance[1] = ($airSpeed-$windSpeed)*$distance[0]/($airSpeed+$windSpeed); +$distance[1] = round($distance[1]); +$d1 = $distance[1]; + +$airSpeed = -$w*($d0+$d1)/($d1-$d0); + +$windSpeed = NumberWithUnits("$windSpeed","mi/hr"); +$airSpeed = NumberWithUnits("$airSpeed","mi/hr"); +$distance[0] = NumberWithUnits("$distance[0]","mi"); +$distance[1] = NumberWithUnits("$distance[1]","mi"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +When there is a \($windSpeed\) wind, an airplane can fly \($distance[0]\) with the wind in the same time that it can fly \($distance[1]\) against the wind. Find the speed of the plane when there is no wind. +$PAR + +The plane's airspeed is \{ans_rule(15)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + +ANS( $airSpeed->cmp(tolerance=>0.01)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications6.pg b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications6.pg new file mode 100644 index 0000000000..e5297095dd --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications6.pg @@ -0,0 +1,65 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); + +$longer = random(2,5,0.5); +$togetherTime = random(1.5,3,0.1); +$b = $longer - 2*$togetherTime; +$c = -$longer*$togetherTime; +$oldTime = (-$b+sqrt(($b)**2-4*($c)))/2; +$oldTime = round($oldTime*100)/100; +$newTime = $oldTime+$longer; + + +$longer = NumberWithUnits("$longer","hr"); +$togetherTime = NumberWithUnits("$togetherTime","hr"); +$oldTime = NumberWithUnits("$oldTime","hr"); +$newTime = NumberWithUnits("$newTime","hr"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +It takes one employee \($longer\) longer to mow a football field than it does a more experienced employee. Together they can mow the grass in \($togetherTime\). How long does it take each person to mow the football field working alone? +$PAR + +The more experienced worker takes \{ans_rule(15)\} to mow the field alone, and the less experienced worker takes \{ans_rule(15)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + +ANS( $oldTime->cmp(tolerance=>0.01)); +ANS( $newTime->cmp(tolerance=>0.01)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications7.pg b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications7.pg new file mode 100644 index 0000000000..2bf57e3dd8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications7.pg @@ -0,0 +1,65 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); + +$longer = random(10,20,1); +$togetherTime = random(20,30,1); +$b = $longer - 2*$togetherTime; +$c = -$longer*$togetherTime; +$oldTime = (-$b+sqrt(($b)**2-4*($c)))/2; +$oldTime = round($oldTime*100)/100; +$newTime = $oldTime+$longer; + + +$longer = NumberWithUnits("$longer","hr"); +$togetherTime = NumberWithUnits("$togetherTime","hr"); +$oldTime = NumberWithUnits("$oldTime","hr"); +$newTime = NumberWithUnits("$newTime","hr"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +It takes one painter \($longer\) longer to paint a house than it does a more experienced painter. Together they can paint the house in \($togetherTime\). How long does it take for each painter to paint the house working alone? +$PAR + +The more experienced painter takes \{ans_rule(15)\} to paint the house alone, and the less experienced painter takes \{ans_rule(15)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + +ANS( $oldTime->cmp(tolerance=>0.01)); +ANS( $newTime->cmp(tolerance=>0.01)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications8.pg b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications8.pg new file mode 100644 index 0000000000..5d8ab02d04 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RatEqApplications/RatEqApplications8.pg @@ -0,0 +1,118 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# This problem guarantees rational solutions. +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", +); + +############################################## +TEXT(beginproblem()); + + +Context("Numeric"); + +$pythagoreanTriple = list_random( +[3,4,5], +[6,8,10], +[9,12,15], +[12,16,20], +[15,20,25], +[18,24,30], +[21,28,35], +[24,32,40], +[27,36,45], +[30,40,50], +[33,44,55], +[36,48,60], +[39,52,65], +[42,56,70], +[45,60,75], +[48,64,80], +[51,68,85], +[54,72,90], +[57,76,95], +[5,12,13], +[10,24,26], +[15,36,39], +[20,48,42], +[25,60,65], +[30,72,78], +[35,84,91], +[7,24,25], +[14,48,50], +[21,72,75], +[8,15,17], +[16,30,34], +[24,45,51], +[32,60,68], +[40,75,85], +[9,40,41], +[18,80,82], +[11,60,61], +[12,35,37], +[24,70,74], +[13,84,85], +[16,63,65], +[20,21,29], +[40,42,58], +[60,63,87], +[28,45,53], +[33,56,65], +[36,77,85] +); + + +my $A, $B, $C; +do{ + ($A,$B,$C) = @{$pythagoreanTriple}; + if ($B % 2 != 0) {($A,$B) = ($B,$A)}; + $togetherTime = $B/2; + $fastTime = ($B-$A+$C)/2; + $slowTime = $fastTime+$A; +} until ($togetherTime > 10 and ($slowTime - $fastTime) < 4*$togetherTime); + + +$longer = NumberWithUnits("$A","hr"); +$togetherTime = NumberWithUnits("$togetherTime","hr"); +$fastTime = NumberWithUnits("$fastTime","hr"); +$slowTime = NumberWithUnits("$slowTime","hr"); + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + + +It takes one contractor \($longer\) longer to install drywall in a new building than it does a more experienced contractor. +Together they can install all the drywall in \($togetherTime\). How long does it take for each contractor to install the drywall working alone? +$PAR + +The more experienced contractor takes \{ans_rule(15)\} to install the drywall, and the less experienced contractor takes \{ans_rule(15)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + +ANS( $fastTime->cmp(tolerance=>0.01)); +ANS( $slowTime->cmp(tolerance=>0.01)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations1.pg b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations1.pg new file mode 100644 index 0000000000..435f2f2794 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations1.pg @@ -0,0 +1,76 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$a = random(2,10,1); +$b = random(2,10,1); + +$left = Compute("$a/$var")->reduce; +$right = Compute("$b"); + +Context("Fraction"); +$r1 = Fraction("$a","$b"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$r1}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations2.pg b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations2.pg new file mode 100644 index 0000000000..8f600003ad --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations2.pg @@ -0,0 +1,76 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = random(2,10,1); + +$left = Compute("$var/($var+$a)")->reduce; +$right = Compute("$b"); + +Context("Fraction"); +$r1 = Fraction("$a*$b","1-$b"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$r1}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations3.pg b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations3.pg new file mode 100644 index 0000000000..6f2f0fef40 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations3.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-5,5,1); +$b = random(2,5,1); +$c = non_zero_random(-5,5,1); +$d = random(2,5,1); + +while($a*$d == $b*$c) {$d = random(2,5,1);}; + + +$left = Compute("(-$a*$c)/($b*$d*$var-($a*$d+$b*$c))")->reduce; +$right = Compute("$var"); + +Context("Fraction"); +$r1 = Fraction("$a","$b"); +$r2 = Fraction("$c","$d"); + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$r1,$r2}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations4.pg b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations4.pg new file mode 100644 index 0000000000..85674cd003 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations4.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = random(-10,10,1); +$c = non_zero_random(-10,10,1); +$d = random(2,5,1); + +while($a == $c) {$c = non_zero_random(-10,10,1);}; + +$e = non_zero_random(-10,10,1); +while ($e == ($d-$b)/($a-$c)) {$e = non_zero_random(-10,10,1);}; + +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); +$left = Compute("($a $var + $b)/($var+$e)")->reduce; +$right = Compute("($c $var + $d)/($var+$e)")->reduce; + +Context("Fraction"); +$r1 = Fraction("$d-$b","$a - $c"); + + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$r1}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations5.pg b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations5.pg new file mode 100644 index 0000000000..b316e8d4af --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations5.pg @@ -0,0 +1,85 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = 0; +$c = non_zero_random(-10,10,1); +$d = random(2,5,1); + +while($a == $c) {$c = non_zero_random(-10,10,1);}; + +$e = non_zero_random(-10,10,1); +while ($e == ($d-$b)/($a-$c)) {$e = non_zero_random(-10,10,1);}; + +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); +$left = Compute("($a $var + $b)/($var+$e)")->reduce; +$right = Compute("($c $var + $d)/($var+$e)")->reduce; + +Context("Fraction"); +$r1 = Fraction("$d-$b","$a - $c"); + + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$r1}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[{$left} = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations6.pg b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations6.pg new file mode 100644 index 0000000000..de8c6881a9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations6.pg @@ -0,0 +1,86 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,10,1); +$b = random(2,5,1); +$c = non_zero_random(-10,10,1); +$d = random(2,5,1); +$e = non_zero_random(-10,10,1); +$f = random(2,5,1); + +while ($a*$d - $c*$b == 0){$d = random(2,5,1);} +while ($a*$f - $c*$e == 0){$f = random(2,5,1);} + +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); +$left = Compute("($a $var + $b)/($c $var + $d)")->reduce; + + +Context("Fraction"); +$right = Fraction("$e","$f"); +$r1 = Fraction("$d*$e-$b*$f","$a*$f - $c*$e"); + + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{$r1}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations7.pg b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations7.pg new file mode 100644 index 0000000000..8585529cf1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/RationalEquations/RationalEquations7.pg @@ -0,0 +1,81 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +############################################## +TEXT(beginproblem()); + +Context("Numeric"); +$var = list_random('x','y','z','t','r','m','n'); +Context()->variables->are($var=>'Real'); + +$a = non_zero_random(-10,-1,1); +$b = random(2,5,1); +$c = non_zero_random(-10,10,1); + + +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); +$left = Compute("$a/($b $var + $c)")->reduce; +$right = Compute("$b $var + $c")->reduce; + +Context("Fraction"); + +#$r1 = Fraction("$d*$e-$b*$f","$a*$f - $c*$e"); + + + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +$ans = Compute("{}"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Solve the equation for \($var\). Enter the solution set using set notation. For example: \($LBRACE 1,2$RBRACE\). $PAR + + +\[$left = $right \] + +$PAR + +If you need to use a square root, type $BBOLD sqrt(23)$EBOLD for \(\sqrt{23}\) (for example). +$BR +If the equation has no solutions, you can still use set notation by entering \($LBRACE$RBRACE\). +$PAR + +The solution set is \{ans_rule(10)\}. + + + +END_TEXT + +Context()->normalStrings; + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS( $ans->cmp(tolerance=>0)); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals1.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals1.pg new file mode 100644 index 0000000000..1a7dc71229 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals1.pg @@ -0,0 +1,163 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the radical expression. +# +# sqrt(a) * sqrt(b) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); +$a = random(2,20,1); +while ((round($a/4)*4 == $a) || (round($a/9)*9 == $a)) +{$a = random(2,20,1);} + +$b = random(21,40,1); +while ((round($b/4)*4 == $b) || (round($b/9)*9 == $b) || (round($b/25)*25 == $b)) +{$b = random(21,40,1);} +$b = $b/gcd($a,$b); + +$c = $a*$b; + +$expression = "\sqrt{$a}\cdot\!\sqrt{$b}"; +$stringans = "sqrt($c)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("LimitedFraction"); + Context()->strings->add("cannot be simplified"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the multiplication property of radicals: + + [`` \sqrt{a} \cdot \sqrt{b} = \sqrt{ab} ``] + +These are the steps to simplify the expression: + + [`` +\begin{aligned} + \sqrt{[$a]}\cdot\sqrt{[$b]} &= \sqrt{[$a]\cdot[$b]} \\ + &= \sqrt{[$a*$b]} \\ +\end{aligned} + ``] + +[`\sqrt{[$a*$b]}`] is the answer since it is not a square number and has no square number as a factor. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals10.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals10.pg new file mode 100644 index 0000000000..e29b64f6ba --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals10.pg @@ -0,0 +1,166 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the radical expression. +# +# sqrt(c)/sqrt(b) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); +$a = random(2,10,1); +while ((round($a/4)*4 == $a) || (round($a/9)*9 == $a)) +{$a = random(2,10,1);} + +$b = random(21,40,1); +while ((round($b/4)*4 == $b) || (round($b/9)*9 == $b) || (round($b/25)*25 == $b)) +{$b = random(21,40,1);} +$b = $b/gcd($a,$b); + +$d = random(2,3,1); + +$c = $a**2*$d*$b; + + +$expression = "\frac{\sqrt{$c}}{\sqrt{$b}}"; +$stringans = "$a sqrt($d)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + Context()->operators->undefine('/',' /','/ '); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the division property of radicals: + + [`` \sqrt{\frac{a}{b}} = \frac{\sqrt{a}}{\sqrt{b}} ``] + +Following are the steps to simplify the radical expression. We are also using prime factorization. + + [`` +\begin{aligned} + \frac{\sqrt{[$c]}}{\sqrt{[$b]}} &= \frac{\sqrt{[$a**2*$d]\cdot[$b]}}{\sqrt{[$b]}} \\ + &= \sqrt{\frac{[$a**2*$d]\cdot[$b]}{[$b]}} \\ + &= \sqrt{[$a]^2\cdot[$d]} \\ + &= [$a]\sqrt[$d] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals11.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals11.pg new file mode 100644 index 0000000000..a4bb621ad4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals11.pg @@ -0,0 +1,151 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Add or subtract as indicated. +# +# b*sqrt(a)+c*sqrt(a) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); +$a = list_random(2,3,5,6,7,10); +$b = random(4,10,1); +$c = $b + non_zero_random(-2,5,1); +$d = $b+$c; + +$expression = "$b\sqrt{$a}+$c\sqrt{$a}"; +$stringans = "$d sqrt($a)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Add or subtract as indicated. If the terms are not like radicals and cannot be combined, then type that they *cannot be combined* . + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We know that we can combine like terms: + + [`` [$b]x+[$c]x = [$b+$c]x ``] + +In the same way, we can combine like radicals: + + [`` [$b]\sqrt{[$a]}+[$c]\sqrt{[$a]}=[$b+$c]\sqrt{[$a]} ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals12.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals12.pg new file mode 100644 index 0000000000..9b8093286f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals12.pg @@ -0,0 +1,173 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Add or subtract as indicated. +# +# b*sqrt(a)-c*sqrt(a) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a = list_random(2,3,5,6,7,10); +$b = random(4,10,1); +$c = $b + non_zero_random(-2,5,1); +$d = $b-$c; + + + +$expression = "$b\sqrt{$a}-$c\sqrt{$a}"; +$stringans = "$d sqrt($a)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Add or subtract as indicated. If the terms are not like radicals and cannot be combined, then type that they *cannot be combined* . + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +# If the resulting coefficient is one, it should not appear as part of the final answer +if ($d==1) { + +BEGIN_PGML_SOLUTION + +We know that we can combine like terms: + + [`` [$b]x-[$c]x = [$b-$c]x = x ``] + +In the same way, we can combine like radicals: + + [`` [$b]\sqrt{[$a]}-[$c]\sqrt{[$a]}=[$b-$c]\sqrt{[$a]}=\sqrt{[$a]} ``] + +END_PGML_SOLUTION + +} +else { + +BEGIN_PGML_SOLUTION + +We know that we can combine like terms: + + [`` [$b]x-[$c]x = [$b-$c]x ``] + +In the same way, we can combine like radicals: + + [`` [$b]\sqrt{[$a]}-[$c]\sqrt{[$a]}=[$b-$c]\sqrt{[$a]} ``] + +END_PGML_SOLUTION + +} + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals13.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals13.pg new file mode 100644 index 0000000000..4f908b820a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals13.pg @@ -0,0 +1,159 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Add or subtract as indicated. +# +# b*sqrt(a)+c*sqrt(a)+d*sqrt(a) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +TEXT(beginproblem()); +############################################## + + +$a = list_random(2,3,5,6,7,10); +$b = random(4,10,1); +$c = $b + non_zero_random(-2,5,1); +$d = random(2,15,1); +$e = $b+$c+$d; + +$expression = "$b\sqrt{$a}+$c\sqrt{$a}+$d\sqrt{$a}"; +$stringans = "$e sqrt($a)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Add or subtract as indicated. If the terms are not like radicals and cannot be combined, then type that they *cannot be combined* . + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We know that we can combine like terms: + + [`` [$b]x+[$c]x = [$b+$c]x ``] + +In the same way, we can combine like radicals: + + [`` +\begin{aligned} + [$b]\sqrt{[$a]}+[$c]\sqrt{[$a]}+[$d]\sqrt{[$a]} + &= [$b+$c]\sqrt{[$a]}+[$d]\sqrt{[$a]} \\ + &= [$b+$c+$d]\sqrt{[$a]} \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals14.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals14.pg new file mode 100644 index 0000000000..28e0b0c29c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals14.pg @@ -0,0 +1,156 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Add or subtract as indicated. +# +# sqrt(a)+sqrt(b) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a = list_random(2,3,5,6,7,10); + +$b = $a**3; + +$c = $a+1; + +$expression = "\sqrt{$a}+\sqrt{$b}"; +$stringans = "$c sqrt($a)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Add or subtract as indicated. You will need to simplify terms before they can be combined. If the terms are not like radicals and cannot be combined after you simplify, then type that they *cannot be combined* . + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use prime factorization and combine like radicals: + + [`` +\begin{aligned} + \sqrt{[$a]}+\sqrt{[$b]} &= \sqrt{[$a]}+\sqrt{[$a]^3} \\ + &= \sqrt{[$a]}+\sqrt{[$a]^2\cdot[$a]} \\ + &= \sqrt{[$a]}+[$a]\sqrt{[$a]} \\ + &= [$a+1]\sqrt{[$a]} \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals15.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals15.pg new file mode 100644 index 0000000000..73775d256d --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals15.pg @@ -0,0 +1,181 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Add or subtract as indicated. +# +# sqrt(c)-sqrt(b) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a = list_random(2,3,5,6,7,10); + +$b = list_random(2,3,5,6,7,10); + +$c = $a**2*$b; + +$d = $a-1; + +$expression = "\sqrt{$c}-\sqrt{$b}"; +$stringans = "$d sqrt($b)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Add or subtract as indicated. You will need to simplify terms before they can be combined. If the terms are not like radicals and cannot be combined after you simplify, then type that they *cannot be combined* . + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +# If the resulting coefficient is one, it should not appear as part of the final answer +if (d==1) { + +BEGIN_PGML_SOLUTION + +We will use prime factorization and combine like radicals: + + [`` +\begin{aligned} + \sqrt{[$c]}-\sqrt{[$b]} &= \sqrt{[$a]^2\cdot[$b]}-\sqrt{[$b]} \\ + &= [$a]\sqrt{[$b]}-\sqrt{[$b]} \\ + &= [$a-1]\sqrt{[$b]} \\ + &= \sqrt{[$b]} \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + +} +else { + +BEGIN_PGML_SOLUTION + +We will use prime factorization and combine like radicals: + + [`` +\begin{aligned} + \sqrt{[$c]}-\sqrt{[$b]} &= \sqrt{[$a]^2\cdot[$b]}-\sqrt{[$b]} \\ + &= [$a]\sqrt{[$b]}-\sqrt{[$b]} \\ + &= [$a-1]\sqrt{[$b]} \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + +} + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals16.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals16.pg new file mode 100644 index 0000000000..25a11376f5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals16.pg @@ -0,0 +1,160 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Add or subtract as indicated. +# +# sqrt(d)+sqrt(e) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a = list_random(2,3,5,6,7,10); + +$b = random(2,5,1); + +$c = $b+3; + +$d = $b**2*$a; +$e = $c**2*$a; + +$f = $b+$c; + +$expression = "\sqrt{$d}+\sqrt{$e}"; +$stringans = "$f sqrt($a)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Add or subtract as indicated. You will need to simplify terms before they can be combined. If the terms are not like radicals and cannot be combined after you simplify, then type that they *cannot be combined* . + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use prime factorization and combine like radicals: + + [`` +\begin{aligned} + \sqrt{[$d]}+\sqrt{[$e]} &= \sqrt{[$b]^2\cdot[$a]}+\sqrt{[$c]^2\cdot[$a]} \\ + &= [$b]\sqrt{[$a]}+[$c]\sqrt{[$a]} \\ + &= [$b+$c]\sqrt{[$a]} \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals17.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals17.pg new file mode 100644 index 0000000000..0f745aa0f3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals17.pg @@ -0,0 +1,154 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Add or subtract as indicated. +# +# a*sqrt(27)-b*sqrt(18) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a = random(2,5,1); +$b = $a+random(1,2,1); + +$expression = "$a\sqrt{27}-$b\sqrt{18}"; +$stringans = "cannot be combined"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Add or subtract as indicated. You will need to simplify terms before they can be combined. If the terms are not like radicals and cannot be combined after you simplify, then type that they *cannot be combined* . + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use prime factorization and combine like radicals: + + [`` +\begin{aligned} + [$a]\sqrt{27}+[$b]\sqrt{18} + &= [$a]\sqrt{3^2\cdot 3}+[$b]\sqrt{3^2\cdot 2} \\ + &= [$a]\!\cdot\! 3\sqrt{3}+[$b]\!\cdot\! 3\sqrt{2} \\ + &= [$a*3]\sqrt{3}+[$b*3]\sqrt{2} \\ +\end{aligned} + ``] + +After being fully simplified, the radicals are not like radicals and therefore cannot be combined. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals18.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals18.pg new file mode 100644 index 0000000000..3c50931407 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals18.pg @@ -0,0 +1,156 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the radical expression. +# +# sqrt(dx)+sqrt(ex) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a = random(2,5,1); +$b = $a+random(1,2,1); +$c = $a+$b; + +$d = $a**2; +$e = $b**2; + +$expression = "\sqrt{$d x}+\sqrt{$e x}"; +$stringans = "$c sqrt(x)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### +# Context("Fraction-NoDecimals"); + Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use prime factorization and combine like radicals: + + [`` +\begin{aligned} + \sqrt{[$d]x}+\sqrt{[$e]x} &= \sqrt{[$a]^2x}+\sqrt{[$b]^2x} \\ + &= [$a]\sqrt{x}+[$b]\sqrt{x} \\ + &= [$a+$b]\sqrt{x} \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals19.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals19.pg new file mode 100644 index 0000000000..2f698eddc8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals19.pg @@ -0,0 +1,157 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the radical expression. +# +# sqrt(dx+e)+sqrt(x+b) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a = random(2,5,1); +$b = random(2,10,1); + +$d = $a**2; +$e = $d*$b; +$f = $a+1; + +$expression = "\sqrt{$d x+$e}+\sqrt{x+$b}"; +$stringans = "$f sqrt(x+$b)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### +# Context("Fraction-NoDecimals"); +# Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will factor out like terms and combine like radicals: + + [`` +\begin{aligned} + \sqrt{[$d]x+[$e]}+\sqrt{x+[$b]} &= \sqrt{[$a**2](x+[$b])}+\sqrt{x+[$b]} \\ + &= \sqrt{[$a]^2(x+[$b])}+\sqrt{x+[$b]} \\ + &= [$a]\sqrt{x+[$b]}+\sqrt{x+[$b]} \\ + &= [$a+1]\sqrt{x+[$b]} \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals2.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals2.pg new file mode 100644 index 0000000000..20701645ca --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals2.pg @@ -0,0 +1,153 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the radical expression. +# +# sqrt(a) * sqrt(a) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); +$a = random(8,30,1); + +$expression = "\sqrt{$a}\cdot\!\sqrt{$a}"; +$stringans = "$a"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("LimitedFraction"); + Context()->strings->add("cannot be simplified"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the multiplication property of radicals: + + [`` \sqrt{a} \cdot \sqrt{b} = \sqrt{ab} ``] + +These are the steps to simplify the expression: + + [`` +\begin{aligned} + \sqrt{[$a]}\cdot\sqrt{[$a]} &= \sqrt{[$a]\cdot[$a]} \\ + &= \sqrt{[$a]^2} \\ + &= [$a] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals20.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals20.pg new file mode 100644 index 0000000000..db88c02561 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals20.pg @@ -0,0 +1,166 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the radical expression. +# +# a[0]sqrt(d[0]x)+a[1]sqrt(d[1]x)+a[2]sqrt(d[2]x) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a[0] = random(2,5,1); +$a[1] = random(2,5,1); +$a[2] = random(2,5,1); + +$b = list_random(2,3,5,6,7,10); + +$c[0] = 1; +$c[1] = random(2,4,1); +$c[2] = $c[1]+1; + +for my $i (0..2) +{$d[$i] = $c[$i]**2*$b;} + +$e = $a[0]*$c[0]+$a[1]*$c[1]+$a[2]*$c[2]; + +$expression = "$a[0]\sqrt{$d[0]x}+$a[1]\sqrt{$d[1]x}+$a[2]\sqrt{$d[2]x}"; +$stringans = "$e sqrt($b x)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### +# Context("Fraction-NoDecimals"); +# Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use prime factorization and combine like radicals: + + [`` +\begin{aligned} + [$a[0]]\sqrt{[$d[0]]x}+[$a[1]]\sqrt{[$d[1]]x}+[$a[2]]\sqrt{[$d[2]]x} + &= [$a[0]]\sqrt{[$b]x}+[$a[1]]\sqrt{[$c[1]]^2\!\cdot\![$b]x}+[$a[2]]\sqrt{[$c[2]]^2\!\cdot\![$b]x} \\ + &= [$a[0]]\sqrt{[$b]x}+[$a[1]]\!\cdot\![$c[1]]\sqrt{[$b]x}+[$a[2]]\!\cdot\![$c[2]]\sqrt{[$b]x} \\ + &= [$a[0]]\sqrt{[$b]x}+[$a[1]*$c[1]]\sqrt{[$b]x}+[$a[2]*$c[2]]\sqrt{[$b]x} \\ + &= [$a[0]+$a[1]*$c[1]+$a[2]*$c[2]]\sqrt{[$b]x} \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals21.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals21.pg new file mode 100644 index 0000000000..e1bf56c402 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals21.pg @@ -0,0 +1,199 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Multiply and simplify the radical expression. +# +# (sqrt(x)+a)(sqrt(x)+b) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); + +$c = $a+$b; +$d = $a*$b; + +$expression = "\left(\sqrt{x}+$a\right)\left(\sqrt{x}+$b\right)"; +$stringans = "x+$c sqrt(x)+$d"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### +# Context("Fraction-NoDecimals"); +# Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Multiply and simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +# If the resulting coefficient is one, it should not appear as part of the final answer +if ($c==1) { + +BEGIN_PGML_SOLUTION + +We will use the FOIL method and combine like radicals: + + [`` +\begin{aligned} + \left(\sqrt{x}+[$a]\right)\left(\sqrt{x}+[$b]\right) + &= \left(\sqrt{x}\right)^2+[$b]\sqrt{x}+[$a]\sqrt{x}+([$a])([$b]) \\ + &= x+[$a+$b]\sqrt{x}+[$a*$b] \\ + &= x+\sqrt{x}+[$a*$b] \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + +} + +# If the resulting coefficient is -1, it should not appear as part of the final answer +elsif ($c==-1) { + +BEGIN_PGML_SOLUTION + +We will use the FOIL method and combine like radicals: + + [`` +\begin{aligned} + \left(\sqrt{x}+[$a]\right)\left(\sqrt{x}+[$b]\right) + &= \left(\sqrt{x}\right)^2+[$b]\sqrt{x}+[$a]\sqrt{x}+([$a])([$b]) \\ + &= x+[$a+$b]\sqrt{x}+[$a*$b] \\ + &= x-\sqrt{x}+[$a*$b] \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + +} else { + +BEGIN_PGML_SOLUTION + +We will use the FOIL method and combine like radicals: + + [`` +\begin{aligned} + \left(\sqrt{x}+[$a]\right)\left(\sqrt{x}+[$b]\right) + &= \left(\sqrt{x}\right)^2+[$b]\sqrt{x}+[$a]\sqrt{x}+([$a])([$b]) \\ + &= x+[$a+$b]\sqrt{x}+[$a*$b] \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + +} + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals22.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals22.pg new file mode 100644 index 0000000000..94b13360d2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals22.pg @@ -0,0 +1,203 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Multiply and simplify the radical expression. +# +# (e*sqrt(x)+a)(sqrt(x)+b) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$e = random(2,4,1); +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); + +$c = $a+$e*$b; +$d = $a*$b; + +$expression = "\left($e \sqrt{x}+$a\right)\left(\sqrt{x}+$b\right)"; +$stringans = "$e x+$c sqrt(x)+$d"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### +# Context("Fraction-NoDecimals"); +# Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Multiply and simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +# If the resulting coefficient is one, it should not appear as part of the final answer +if ($c==1) { + +BEGIN_PGML_SOLUTION + +We will use the FOIL method and combine like radicals: + + [`` +\begin{aligned} + \left([$e]\sqrt{x}+[$a]\right)\left(\sqrt{x}+[$b]\right) + &= [$e]\left([$e]\sqrt{x}\right)^2+([$e])([$b])\sqrt{x}+[$a]\sqrt{x}+([$a])([$b]) \\ + &= [$e]x+[$b*$e]\sqrt{x}+[$a]\sqrt{x}+[$a*$b] \\ + &= [$e]x+[$a+$b*$e]\sqrt{x}+[$a*$b] \\ + &= [$e]x+\sqrt{x}+[$a*$b] \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + +} + +# If the resulting coefficient is -1, it should not appear as part of the final answer +elsif ($c==-1) { + +BEGIN_PGML_SOLUTION + +We will use the FOIL method and combine like radicals: + + [`` +\begin{aligned} + \left([$e]\sqrt{x}+[$a]\right)\left(\sqrt{x}+[$b]\right) + &= [$e]\left(\sqrt{x}\right)^2+([$e])([$b])\sqrt{x}+[$a]\sqrt{x}+([$a])([$b]) \\ + &= [$e]x+[$b*$e]\sqrt{x}+[$a]\sqrt{x}+[$a*$b] \\ + &= [$e]x+[$a+$b*$e]\sqrt{x}+[$a*$b] \\ + &= [$e]x-\sqrt{x}+[$a*$b] \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + +} else { + +BEGIN_PGML_SOLUTION + +We will use the FOIL method and combine like radicals: + + [`` +\begin{aligned} + \left([$e]\sqrt{x}+[$a]\right)\left(\sqrt{x}+[$b]\right) + &= [$e]\left(\sqrt{x}\right)^2+([$e])([$b])\sqrt{x}+[$a]\sqrt{x}+([$a])([$b]) \\ + &= [$e]x+[$b*$e]\sqrt{x}+[$a]\sqrt{x}+[$a*$b] \\ + &= [$e]x+[$a+$b*$e]\sqrt{x}+[$a*$b] \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + +} + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals23.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals23.pg new file mode 100644 index 0000000000..0ebf396430 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals23.pg @@ -0,0 +1,172 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Multiply and simplify the radical expression. +# +# (sqrt(x)+a)(sqrt(x)-a) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a = random(5,15,1); +$b = $a**2; + +$expression = "\left(\sqrt{x}+$a\right)\left(\sqrt{x}-$a\right)"; +$stringans = "x-$b"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### +# Context("Fraction-NoDecimals"); +# Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Multiply and simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the FOIL method and combine like radicals: + + [`` +\begin{aligned} + \left(\sqrt{x}+[$a]\right)\left(\sqrt{x}-[$a]\right) + &= \left(\sqrt{x}\right)^2-[$a]\sqrt{x}+[$a]\sqrt{x}-([$a])^2 \\ + &= x-[$a**2] \\ +\end{aligned} + ``] + + [`` +\begin{aligned} + && && \text{OR} +\end{aligned} + ``] + +We can also use the Difference of Squares formula: + + [`` (a+b)(a-b) = a^2-b^2 ``] + +We then get: + + [`` +\begin{aligned} + \left(\sqrt{x}+[$a]\right)\left(\sqrt{x}-[$a]\right) + &= \left(\sqrt{x}\right)^2-([$a])^2 \\ + &= x-[$a**2] \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals24.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals24.pg new file mode 100644 index 0000000000..327ad66d5c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals24.pg @@ -0,0 +1,100 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Rationalize the denominator +# +# a/(sqrt(b)+c) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextForm.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); + +############################################## + +do{ +$a = random(2,9,1); +$b = list_random(2,3,5,6,7,10,11,13,14,15,17,19,21,22,23); +$c = random(2,9,1); + +$d = $a*$c; +$e = $c**2-$b; +} until (gcd($d,$e)==1 and gcd($a,$e)==1); + +$expression = "\dfrac{$a}{\sqrt{$b}+$c}"; +$stringans = "($d-$a sqrt($b))/$e"; +if ($e == 1) {$stringans = "$d-$a sqrt($b)";}; +if ($e == -1) {$stringans = "-$d+$a sqrt($b)";}; +$G = gcd($a,$d); +$D = $d/$G; +$A = $a/$G; +$factored = "$G($D-$A sqrt($b))/$e"; +if ($e == 1) {$factored = "$G($D-$A sqrt($b))";}; +if ($e == -1) {$factored = "$G(-$D+$A sqrt($b))";}; + +Context("Form"); +$ans = Formula("$stringans"); +#if ($G != 1) {$ans = OneOf(Formula("$stringans"),Formula("$factored"));}; + + +############################################## + + +BEGIN_PGML + +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + +[``[$expression]=``][__]{$ans}{width=>30} + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the Difference of Squares formula: + + [`` (a+b)(a-b) = a^2-b^2 ``] + +This will help us get rid of the radical in the denominator by multiplying with the conjugate: + + [`` +\begin{aligned} + \dfrac{[$a]}{\sqrt{[$b]}+[$c]} + &= \dfrac{[$a]}{\sqrt{[$b]}+[$c]}\cdot\dfrac{\sqrt{[$b]}-[$c]}{\sqrt{[$b]}-[$c]} \\ + &= \dfrac{[$a]\sqrt{[$b]}-([$a])([$c])}{\left(\sqrt{[$b]}\right)^2-([$c])^2} \\ + &= \dfrac{[$a]\sqrt{[$b]}-[$a*$c]}{[$b]-[$c**2]} \\ + &= \dfrac{[$a]\sqrt{[$b]}-[$a*$c]}{[$b-$c**2]} \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals25.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals25.pg new file mode 100644 index 0000000000..a4964982ee --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals25.pg @@ -0,0 +1,161 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Rationalize the denominator +# +# a/(c-sqrt(x)) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a = random(5,15,1); +#$b = list_random(2,3,5,6,7,10); +$c = random(2,6,1); + +$d = $a*$c; +$e = $c**2; + +$expression = "\dfrac{$a}{$c-\sqrt{x}}"; +$stringans = "($d+$a*sqrt(x))/($e-x)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### +# Context("Fraction-NoDecimals"); +# Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Rationalize the denominator of the radical expression and make sure your answer is simplified. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [______________________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified and has a rational denominator.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the Difference of Squares formula: + + [`` (a+b)(a-b) = a^2-b^2 ``] + +This will help us get rid of the radical in the denominator by multiplying with the conjugate: + + [`` +\begin{aligned} + \dfrac{[$a]}{[$c]-\sqrt{x}} + &= \dfrac{[$a]}{[$c]-\sqrt{x}}\cdot\dfrac{[$c]+\sqrt{x}}{[$c]+\sqrt{x}} \\ + &= \dfrac{([$a])([$c])+[$a]\sqrt{x}}{([$c])^2-\left(\sqrt{x}\right)^2} \\ + &= \dfrac{[$a*$c]+[$a]\sqrt{x}}{[$c**2]-x} \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals26.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals26.pg new file mode 100644 index 0000000000..12dc7a096e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals26.pg @@ -0,0 +1,93 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Rationalize the denominator +# +# (sqrt(b)-a)/(sqrt(c)+d) +# +# +# Last updated: Spoddeck 11/11/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + + +$a = random(5,15,1); +$b = list_random(2,3,5); +$c = list_random(7,11,13); +$d = random(2,10,1); + +$e = $a*$d; +$f = $b*$c; +$g = $c-$d**2; + +$expression = "\dfrac{\sqrt{$b}-$a}{\sqrt{$c}+$d}"; +$stringans = "($e-$a*sqrt($c)-$d*sqrt($b)+sqrt($f))/($g)"; + + +Context("LimitedRadical"); +$ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Rationalize the denominator and simplify the expression. [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + + +[``[$expression]=``][__]{$ans}{width=>30} + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the Difference of Squares formula: + + [`` (a+b)(a-b) = a^2-b^2 ``] + +This will help us get rid of the radical in the denominator by multiplying with the conjugate: + + [`` +\begin{aligned} + \dfrac{\sqrt{[$b]}-[$a]}{\sqrt{[$c]}+[$d]} + &= \dfrac{\sqrt{[$b]}-[$a]}{\sqrt{[$c]}+[$d]}\cdot\dfrac{\sqrt{[$c]}-[$d]}{\sqrt{[$c]}-[$d]} \\ + &= \dfrac{\sqrt{[$b]}\sqrt{[$c]}-[$d]\sqrt{[$b]}-[$a]\sqrt{[$c]}+([$a])([$d])}{\left(\sqrt{[$c]}\right)^2-([$d])^2} \\ + &= \dfrac{\sqrt{([$b])([$c])}-[$d]\sqrt{[$b]}-[$a]\sqrt{[$c]}+[$a*$d]}{[$c]-[$d**2]} \\ + &= \dfrac{\sqrt{[$b*$c]}-[$d]\sqrt{[$b]}-[$a]\sqrt{[$c]}+[$a*$d]}{[$c-$d**2]} \\ +\end{aligned} + ``] + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals3.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals3.pg new file mode 100644 index 0000000000..f7e067d6ea --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals3.pg @@ -0,0 +1,155 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the radical expression. +# +# sqrt(a/b) * sqrt(b/c) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + +TEXT(beginproblem()); +$a = list_random(3,5,7,11,13); +$b = $a+2; +$c = $b+2; + + +$expression = "\sqrt{\frac{$a}{$b}}\cdot\!\sqrt{\frac{$b}{$c}}"; +$stringans = "sqrt($a/$c)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("LimitedFraction"); + Context()->strings->add("cannot be simplified"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the multiplication property of radicals: + + [`` \sqrt{a} \cdot \sqrt{b} = \sqrt{ab} ``] + +These are the steps to simplify the expression: + + [`` +\begin{aligned} + \sqrt{\frac{[$a]}{[$b]}}\cdot\!\sqrt{\frac{[$b]}{[$c]}} + &= \sqrt{\frac{[$a]}{[$b]}\cdot\!\frac{[$b]}{[$c]}} \\ + &= \sqrt{\frac{[$a]}{[$c]}} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals4.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals4.pg new file mode 100644 index 0000000000..4ea74fb37c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals4.pg @@ -0,0 +1,150 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# sqrt(b) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); +$a = list_random(2,3,5); +$b = $a**3; + +$expression = "\sqrt{$b}"; +$stringans = "$a sqrt($a)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use the prime factorization of [`[$b]`]: + + [`` +\begin{aligned} + \sqrt{[$b]} &= \sqrt{[$a]\cdot[$a]\cdot[$a]} \\ + &= \sqrt{[$a]^2\cdot[$a]} \\ + &= [$a]\sqrt{[$a]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals5.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals5.pg new file mode 100644 index 0000000000..32ef001239 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals5.pg @@ -0,0 +1,151 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the expression. +# +# sqrt(c) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); +$a = random(2,5,1); +$b = list_random(3,5,6,7,10,11); +$c = $a**2*$b; + +$expression = "\sqrt{$c}"; +$stringans = "$a sqrt($b)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +In order to simplify the expression, we use the prime factorization of [`[$c]`]: + + [`` +\begin{aligned} + \sqrt{[$c]} &= \sqrt{[$a]\cdot[$a]\cdot[$b]} \\ + &= \sqrt{[$a]^2\cdot[$b]} \\ + &= [$a]\sqrt{[$b]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals6.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals6.pg new file mode 100644 index 0000000000..9eb59da4b6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals6.pg @@ -0,0 +1,155 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Multiply, and simplify if possible. +# +# sqrt(a)*sqrt(c) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + +TEXT(beginproblem()); +$a = random(2,6,1); +$b = list_random(2,3,5,6,7,10,11,13,14,15); +while (gcd($a,$b) != 1) +{$b = list_random(2,3,5,6,7,10,11,13,14,15);} + +$c = $a*$b; + + +$expression = "\sqrt{$a}\cdot\!\sqrt{$c}"; +$stringans = "$a sqrt($b)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We use the multiplication property of radicals and prime factorization: + + [`` +\begin{aligned} + \sqrt{[$a]}\cdot\!\sqrt[$c] &= \sqrt{[$a]\cdot[$c]} \\ + &= \sqrt{[$a]\cdot[$a]\cdot[$b]} \\ + &= \sqrt{[$a]^2\cdot[$b]} \\ + &= [$a]\sqrt{[$b]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals7.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals7.pg new file mode 100644 index 0000000000..592eff52ad --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals7.pg @@ -0,0 +1,154 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the radical expression. +# +# sqrt(d/c) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); +$a = random(3,7,1); +$b = $a+2; +while (gcd($a,$b) != 1) +{$b = $a + random(1,5,1);} + +$c = $a**2; +$d = $b**2; + +$expression = "\sqrt{\frac{$d}{$c}}"; +$stringans = "$b/$a"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("LimitedFraction"); + + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +These are the steps to simplify the radical expression: + + [`` +\begin{aligned} + \sqrt{\frac{[$d]}{[$c]}} &= \sqrt{\frac{[$b]^2}{[$a]^2}} \\ + &= \frac{[$b]}{[$a]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals8.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals8.pg new file mode 100644 index 0000000000..88e95dd2ab --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals8.pg @@ -0,0 +1,162 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the radical expression. +# +# sqrt(b/c) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); +$a = random(4,12,1); +while ((round($a/4)*4 == $a) || (round($a/9)*9 == $a)) +{$a = random(4,12,1);} + +$b = random(21,40,1); +while ((round($b/4)*4 == $b) || (round($b/9)*9 == $b) || (round($b/25)*25 == $b)) +{$b = random(21,40,1);} +$b = $b/gcd($a,$b); + +$c = $a**2; + +$expression = "\sqrt{\frac{$b}{$c}}"; +$stringans = "sqrt($b)/$a"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + Context()->operators->undefine('*',' *','* '); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the division property of radicals: + + [`` \sqrt{\frac{a}{b}} = \frac{\sqrt{a}}{\sqrt{b}} ``] + +These are the steps to simplify the radical expression: + + [`` +\begin{aligned} + \sqrt{\frac{[$b]}{[$c]}} &= \frac{\sqrt{[$b]}}{\sqrt{[$c]}} \\ + &= \frac{\sqrt{[$b]}}{\sqrt{[$a]^2}} \\ + &= \frac{\sqrt{[$b]}}{[$a]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals9.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals9.pg new file mode 100644 index 0000000000..7c8fa470d3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicals9.pg @@ -0,0 +1,156 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Simplify the radical expression. +# +# sqrt(c)/sqrt(b) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + + +TEXT(beginproblem()); +$a = random(2,12,1); +$b = random(5,15,1); +$c = $a**2*$b; + +$expression = "\frac{\sqrt{$c}}{\sqrt{$b}}"; +$stringans = "$a"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### + Context("Fraction-NoDecimals"); + Context()->operators->undefine('/',' /','/ '); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +Simplify the radical expression. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use the division property of radicals: + + [`` \sqrt{\frac{a}{b}} = \frac{\sqrt{a}}{\sqrt{b}} ``] + +These are the steps to simplify the radical expression: + + [`` +\begin{aligned} + \frac{\sqrt{[$c]}}{\sqrt{[$b]}} &= \frac{\sqrt{[$a**2]\cdot[$b]}}{\sqrt{[$b]}} \\ + &= \sqrt{\frac{[$a**2]\cdot[$b]}{[$b]}} \\ + &= \sqrt{[$a]^2} \\ + &= [$a] \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicalsApplication10.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicalsApplication10.pg new file mode 100644 index 0000000000..7ae7901769 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicalsApplication10.pg @@ -0,0 +1,162 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Rationalize the denominator +# +# 2pi*sqrt(L/32) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + +$expression = "2\pi\sqrt{\dfrac{L}{32}}"; +$stringans = "pi*(sqrt(2*L))/(4)"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### +# Context("Fraction-NoDecimals"); +# Context()->operators->undefine("+","-"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + L => ["Real", limits => [0,2]], # only needed if L is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +The time in seconds that a pendulum swings back and forth can be calculated by the formula below. The pendulum is [`L`] feet long. + +Rationalize the denominator of the radical expression and make sure your answer is simplified. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + +If you need the [`\pi`] symbol, type *pi*. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use that: + + [`` \sqrt{x}\sqrt{x} = \sqrt{x^2} = x ``] + +This will help us get rid of the radical in the denominator by multiplying it with itself: + + [`` +\begin{aligned} + 2\pi\sqrt{\dfrac{L}{32}} + &= 2\pi\dfrac{\sqrt{L}}{\sqrt{32}} \\ + &= 2\pi\dfrac{\sqrt{L}}{\sqrt{32}}\cdot\dfrac{\sqrt{32}}{\sqrt{32}} \\ + &= 2\pi\dfrac{\sqrt{32L}}{\sqrt{32^2}} \\ + &= 2\pi\dfrac{\sqrt{16*2L}}{32} \\ + &= 4\pi\dfrac{\sqrt{2L}}{16} \\ + &= \pi\dfrac{\sqrt{2L}}{4} \\ +\end{aligned} + ``] + +The answer can also be written as [`\dfrac{\pi\sqrt{2L}}{4}`]. + + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicalsApplication20.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicalsApplication20.pg new file mode 100644 index 0000000000..83d38074af --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicalsApplication20.pg @@ -0,0 +1,154 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Rationalize the denominator +# +# 1/sqrt(2) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + + +############################################## + +$expression = "\dfrac{1}{\sqrt{2}}"; +$stringans = "sqrt(2)/2"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### +# Context("Fraction-NoDecimals"); +# Context()->operators->undefine("+","-"); + Context()->operators->undefine("*"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +In trigonometry, we often get the answer below and then need to rationalize the denominator. + +Rationalize the denominator of the radical expression and make sure your answer is simplified. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use that: + + [`` \sqrt{x}\sqrt{x} = \sqrt{x^2} = x ``] + +This will help us get rid of the radical in the denominator by multiplying it with itself: + + [`` +\begin{aligned} + \dfrac{1}{\sqrt{2}} + &= \dfrac{1}{\sqrt{2}}\cdot\dfrac{\sqrt{2}}{\sqrt{2}} \\ + &= \dfrac{\sqrt{2}}{\sqrt{2^2}} \\ + &= \dfrac{\sqrt{2}}{2} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicalsApplication30.pg b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicalsApplication30.pg new file mode 100644 index 0000000000..a650e4c8a2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SimplifyRadicals/SimplifyRadicalsApplication30.pg @@ -0,0 +1,157 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Rationalize the denominator +# +# 1/sqrt(a) +# +# +# Last updated: Spoddeck 11/10/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedPowers.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl", + ); + +TEXT(beginproblem()); + +############################################## + +$a = list_random(3,5,6,7,11); + +$expression = "\dfrac{1}{\sqrt{$a}}"; +$stringans = "sqrt($a)/$a"; + + + # code essentially from Davide Cervone 4/25/10 + ########################### + # + # Subclass the numeric functions + # + package my::Function::numeric; + our @ISA = ('Parser::Function::numeric'); + + # + # Override sqrt() to return a special value (usually 1) when evaluated + # effectively eliminating it from the product. + # + sub sqrt { + my $self = shift; + my $value = $self->context->flag("setSqrt"); + return $value+1 if $value && $_[0] == 1; # force sqrt(1) to be incorrect + return $value if $value; + return $self->SUPER::sqrt(@_); + } + + # + # end of subclass + # + package main; + + ########################### +# Context("Fraction-NoDecimals"); +# Context()->operators->undefine("+","-"); + Context()->operators->undefine("*"); + Context()->strings->add("cannot be combined"=>{}); + + Context()->variables->are( + x => ["Real", limits => [0,2]], # only needed if x is used in the square roots + ); + # + # make sqrt() use our subclass + # + Context()->functions->set(sqrt=>{class=>'my::Function::numeric'}); + Context()->flags->set(reduceConstantFunctions=>0); + # + # Don't allow fractional powers (avoids 1/2 power) + # [Could subclass exponentiation to handle that as well] + # + LimitedPowers::OnlyPositiveIntegers(); + + $ans = Compute($stringans); + + +############################################## + + +BEGIN_PGML + +In trigonometry, we often get the answer similar to the one below and then need to rationalize the denominator. + +Rationalize the denominator of the radical expression and make sure your answer is simplified. + +>>[``[$expression]``]<< + +If you need to enter a square root symbol, you need to type *sqrt* and use parentheses to enclose what goes inside the radical. +For example, type *sqrt(3)* to enter [`\sqrt{3}`]. + + [____________________] + +END_PGML + + +############################################## +$showPartialCorrectAnswers = 1; + + +ANS($ans->cmp(typeMatch=>Formula("1"), + checker => sub { + my ($correct,$student,$ans) = @_; + return 0 if $ans->{isPreview} || $correct != $student; + # + # Get parsed formula for student and correct answers + # + $student = $ans->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + # + # check if equal when sqrt's are replaced by 1 + # + Context()->flags->set(setSqrt => 1); + delete $correct->{test_values}, $student->{test_values}; + my $OK = ($correct == $student); + Context()->flags->set(setSqrt => 0); + # + Value::Error("Check to see if your answer is simplified and has a rational denominator.") unless $OK; + return $OK; + },formatStudentAnswer=>"reduced")); + + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use that: + + [`` \sqrt{x}\sqrt{x} = \sqrt{x^2} = x ``] + +This will help us get rid of the radical in the denominator by multiplying it with itself: + + [`` +\begin{aligned} + \dfrac{1}{\sqrt{[$a]}} + &= \dfrac{1}{\sqrt{[$a]}}\cdot\dfrac{\sqrt{[$a]}}{\sqrt{[$a]}} \\ + &= \dfrac{\sqrt{[$a]}}{\sqrt{[$a]^2}} \\ + &= \dfrac{\sqrt{[$a]}}{[$a]} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Slope/Slope1.pg b/OpenProblemLibrary/PCC/Math95/Slope/Slope1.pg new file mode 100644 index 0000000000..cecfa496bb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Slope/Slope1.pg @@ -0,0 +1,69 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + + +$x1 = random(1,5,1); +$y1 = random(-4,10,1); +$x2 = $x1+random(3,8,1); +$y2 = random(-4,10,1); + +Context("Fraction"); +$slope = Fraction("($y2-$y1)/($x2-$x1)"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + + +Find the slope of the line passing through the pair of points. $BR You may enter 'DNE' for a slope that does not exist. +$PAR + + + +\(($x1,$y1)\) and \(($x2,$y2)\) +$PAR +The slope is \{ ans_rule(10) \}. + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $slope->cmp()); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Slope/Slope2.pg b/OpenProblemLibrary/PCC/Math95/Slope/Slope2.pg new file mode 100644 index 0000000000..86d9b01ace --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Slope/Slope2.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGgraphmacros.pl", +); + + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$n = random(1,3,1); +$d = random(1,5,1); +$m = Fraction("$n","$d"); +$b = random(-3,3,1); +$ans = $m; + +$xmin = -6; +$xmax = 6; +$ymin = -6; +$ymax = 6; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[400,400] +); + +add_functions($gr, "$m*x+$b for x in <$xmin,$xmax>" . + " using color:blue and weight:2"); + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + + + +$PAR +Find the slope of the line, or state that the slope is undefined by typing $BBOLD DNE$EBOLD (which stands for 'does not exist'). +$PAR + + +$BBLOCKQUOTE +\{ image( insertGraph($gr), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) + +$PAR +The slope is \{ ans_rule(10) \}. + +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); + + + + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Slope/Slope3.pg b/OpenProblemLibrary/PCC/Math95/Slope/Slope3.pg new file mode 100644 index 0000000000..30da77531e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Slope/Slope3.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGgraphmacros.pl", +); + + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$n = random(1,3,1); +$d = random(1,5,1); +$m = -Fraction("$n","$d"); +$b = random(-3,3,1); +$ans = $m; + +$xmin = -6; +$xmax = 6; +$ymin = -6; +$ymax = 6; + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, +axes=>[0,0], +grid=>[$xmax-$xmin,$ymax-$ymin], +size=>[400,400] +); + +add_functions($gr, "$m*x+$b for x in <$xmin,$xmax>" . + " using color:blue and weight:2"); + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + + + +$PAR +Find the slope of the line, or state that the slope is undefined by typing $BBOLD DNE$EBOLD (which stands for 'does not exist'). +$PAR + + +$BBLOCKQUOTE +\{ image( insertGraph($gr), +width=>200,height=>200,tex_size=>800 ) \} +$BR +(Click on graph to enlarge) + +$PAR +The slope is \{ ans_rule(10) \}. + +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); + + + + + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Math95/Slope/Slope4.pg b/OpenProblemLibrary/PCC/Math95/Slope/Slope4.pg new file mode 100644 index 0000000000..7cec5849ac --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Slope/Slope4.pg @@ -0,0 +1,73 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +for my $i (0..7) { +$n[$i] = random(1,10,1);} + + +$x1 = Fraction($n[0],$n[1]); +$y1 = Fraction($n[2],$n[3]); +$x2 = Fraction($n[4],$n[5]); +$y2 = Fraction($n[6],$n[7]); + + +$slope = Fraction("($y2-$y1)/($x2-$x1)"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + + +Find the slope of the line passing through the pair of points. $BR You may enter 'DNE' for a slope that does not exist. +$PAR + + + +\(\left($x1,$y1\right)\) and \(\left($x2,$y2\right)\) +$PAR +The slope is \{ ans_rule(10) \}. + + +END_TEXT + +Context()->normalStrings; + +############################################## + +Context("LimitedFraction"); +ANS( Compute("$slope")->cmp()); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Slope/Slope5.pg b/OpenProblemLibrary/PCC/Math95/Slope/Slope5.pg new file mode 100644 index 0000000000..642f44338a --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Slope/Slope5.pg @@ -0,0 +1,72 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->variables->are(a=>'Real',b=>'Real'); + +for my $i (0..3) { +$n[$i] = random(2,10,1);} + + +$x1 = Compute("$n[0]*a"); +$y1 = Compute("$n[1]*b"); +$x2 = Compute("a"); +$y2 =Compute("$n[3]*a");; + +$h = $n[0]-1; +$slope = Compute("($y1-$y2)/($h a)"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + + +Find the slope of the line passing through the pair of points. $BR You may enter 'DNE' for a slope that does not exist. +$PAR + + + +\(\left($x1,$y1\right)\) and \(\left($x2,$y2\right)\) +$PAR +The slope is \{ ans_rule(10) \}. + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $slope->cmp()); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/Slope/Slope6.pg b/OpenProblemLibrary/PCC/Math95/Slope/Slope6.pg new file mode 100644 index 0000000000..e424de4a11 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/Slope/Slope6.pg @@ -0,0 +1,72 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->variables->are(a=>'Real',b=>'Real'); + +for my $i (0..3) { +$n[$i] = random(5,20,1);} + + +$x1 = Compute("$n[0]*a"); +$y1 = Compute("$n[1]*b"); +$x2 = Compute("$n[2]"); +$y2 = Compute("$n[3]");; + +$h = $n[0]-1; +$slope = Compute("($n[1] b-$n[3])/($n[0] a-$n[2])"); + + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + + +Find the slope of the line passing through the pair of points. $BR You may enter 'DNE' for a slope that does not exist. +$PAR + + + +\(\left($x1,$y1\right)\) and \(\left($x2,$y2\right)\) +$PAR +The slope is \{ ans_rule(10) \}. + + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $slope->cmp()); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations1.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations1.pg new file mode 100644 index 0000000000..e2037c4a32 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations1.pg @@ -0,0 +1,70 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); + +$left = Formula("$a x+$b")->reduce; +$right = Formula("$c")->reduce; + + +$ans = Fraction("$c-$b","$a"); + +Context("LimitedFraction"); +Context()->flags->set(showMixedNumbers=>0); +$ans = Fraction($ans); + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Use algebra to solve the equation \[$left=$right\] + +$BBLOCKQUOTE +The solution is \(x = \)$SPACE \{ans_rule(10)\}. $PAR +The solution set is \{ans_rule(10)\}.$BR +(Use set notation.) +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +ANS( Compute("{$ans}")->cmp(tolerance=>0)); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations10.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations10.pg new file mode 100644 index 0000000000..8d122934da --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations10.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); +#Context()->variables->are(n=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$a = non_zero_random(-20,20,0.1); +$b = non_zero_random(-20,20,0.1); +$c = non_zero_random(-20,20,1); +$d = non_zero_random(max(1,abs($c)-3),abs(c)+3,0.1); +while($a == $c/$d) {$a = non_zero_random(-5,5,0.1);}; +$e = non_zero_random(-20,20,0.1); + +$f = Fraction("$c*10","$d*10"); + +while($e == $b){$e = non_zero_random(-20,20,0.1);} + + +$left = Formula("$a x+$b")->reduce; +$right = Formula("$f x+$e")->reduce; + +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +$ans = Compute("($e-$b)/($a-$f)"); + +Context("Numeric"); +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +$ans = Real("$ans"); + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Use a $BITALIC graphical method $EITALIC to solve the equation \[$left=$right\] $BR +Practice $BITALIC using your graphing calculator$EITALIC. + +$BBLOCKQUOTE +The solution is \(x = \)$SPACE \{ans_rule(10)\}. $PAR +The solution set is \{ans_rule(10)\}.$BR +(Use set notation.) +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); +Context("Interval"); +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +Context()->parens->set('{'=>{type=>'Set'}); +ANS( Compute("{$ans}")->cmp()); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations11.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations11.pg new file mode 100644 index 0000000000..2f7d3a0e3c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations11.pg @@ -0,0 +1,88 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "parserPopUp.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0); + +$a = non_zero_random(-20,20,1); +$b = non_zero_random(-20,20,1); + +$c = random(0,1,1); +$d = non_zero_random(-10,10,1); +$e = $c*$d; + +$i = $a+$e; + +$f = random(0,1,1); +$g = non_zero_random(-10,10,1); +$h = $f*$g; + +$j = $b+$h; + +$left = Formula("$a x + $b")->reduce; +$right = Formula("$i x + $j")->reduce; + +$id = 'The equation is an identity.'; +$co = 'The equation is a contradiction.'; +$un = 'The equation has a unique solution.'; + +if ($a != $i) +{$ans = $un;} +elsif ($b == $j) +{$ans = $id;} +else {$ans = $co;}; + +$popup = PopUp( + ["?","$id","$co","$un"], + "$ans", +); + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Determine if the equation is an identity, a contradiction, or has a unique solution. + +\[$left=$right\] +$PAR + +\{ $popup->menu() \} + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $popup->cmp() ); + + + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations12.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations12.pg new file mode 100644 index 0000000000..83da72fc19 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations12.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "parserPopUp.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0); + +$a = non_zero_random(-20,20,1); +$b = non_zero_random(-20,20,1); + +$c = random(0,1,1); +$d = non_zero_random(-10,10,1); +$e = $c*$d; + +$i = $a+$e; + +$f = random(0,1,1); +$g = non_zero_random(-10,10,1); +$h = $f*$g; + +$j = $b+$h; + +$left = Formula("$a x + $b")->reduce; +$right = Formula("$i x + $j")->reduce; + +$id = 'The equation is an identity.'; +$co = 'The equation is a contradiction.'; +$un = 'The equation has a unique solution.'; + +if ($a != $i) +{$ans = $un;} +elsif ($b == $j) +{$ans = $id;} +else {$ans = $co;}; + +$popup = PopUp( + ["?","$id","$co","$un"], + "$ans", +); + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Determine if the equation is an identity, a contradiction, or has a unique solution. + +\[$left=$right\] +$PAR + +\{ $popup->menu() \} + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $popup->cmp() ); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations13.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations13.pg new file mode 100644 index 0000000000..83da72fc19 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations13.pg @@ -0,0 +1,87 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "parserPopUp.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); +Context()->reductions->set('(-x)-y'=>0); + +$a = non_zero_random(-20,20,1); +$b = non_zero_random(-20,20,1); + +$c = random(0,1,1); +$d = non_zero_random(-10,10,1); +$e = $c*$d; + +$i = $a+$e; + +$f = random(0,1,1); +$g = non_zero_random(-10,10,1); +$h = $f*$g; + +$j = $b+$h; + +$left = Formula("$a x + $b")->reduce; +$right = Formula("$i x + $j")->reduce; + +$id = 'The equation is an identity.'; +$co = 'The equation is a contradiction.'; +$un = 'The equation has a unique solution.'; + +if ($a != $i) +{$ans = $un;} +elsif ($b == $j) +{$ans = $id;} +else {$ans = $co;}; + +$popup = PopUp( + ["?","$id","$co","$un"], + "$ans", +); + + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Determine if the equation is an identity, a contradiction, or has a unique solution. + +\[$left=$right\] +$PAR + +\{ $popup->menu() \} + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $popup->cmp() ); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations2.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations2.pg new file mode 100644 index 0000000000..4aebccdeeb --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations2.pg @@ -0,0 +1,78 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); +Context()->variables->are(t=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); +$d = non_zero_random(-10,10,1); +$e = non_zero_random(-10,10,1); +$f = non_zero_random(-10,10,1); +while($f == $a*$b) {$f = non_zero_random(-10,10,1);}; + +$g = Fraction("$d","$e"); + +$left = Formula("$a($b t+$c)")->reduce; +$right = Formula("$g +$f t")->reduce; + + +$ans = Fraction("$d-$a*$c*$e","$a*$b*$e-$f*$e"); + +Context("LimitedFraction"); +Context()->flags->set(showMixedNumbers=>0); +$ans = Fraction($ans); + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Use algebra to solve the equation \[$left=$right\] + +$BBLOCKQUOTE +The solution is \(t = \)$SPACE \{ans_rule(10)\}. $PAR +The solution set is \{ans_rule(10)\}.$BR +(Use set notation.) +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +ANS( Compute("{$ans}")->cmp(tolerance=>0)); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations3.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations3.pg new file mode 100644 index 0000000000..380d77c8b3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations3.pg @@ -0,0 +1,83 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); +Context()->variables->are(z=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); +$d = non_zero_random(-10,10,1); +$e = non_zero_random(-10,10,1); +while($b*$d == $a*$e) {$e = non_zero_random(-10,10,1);}; +$f = non_zero_random(-10,10,1); +$g = non_zero_random(-10,10,1); +$h = non_zero_random(-10,10,1); + + +$i = Fraction("$a","$b"); +$j = Fraction("$d","$e"); +$k = Fraction("$g","$h"); + +$left = Formula("$i($c-z)+$j(z+$f)")->reduce; +$right = Formula("$k"); + + +$ans = Fraction("$b*$e*$g-$a*$c*$e*$h-$b*$d*$h*$f","$b*$d*$h-$a*$e*$h"); + +Context("LimitedFraction"); +Context()->flags->set(showMixedNumbers=>0); +$ans = Fraction($ans); + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Use algebra to solve the equation \[$left=$right\] + +$BBLOCKQUOTE +The solution is \(z = \)$SPACE \{ans_rule(10)\}. $PAR +The solution set is \{ans_rule(10)\}.$BR +(Use set notation.) +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +ANS( Compute("{$ans}")->cmp(tolerance=>0)); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations4.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations4.pg new file mode 100644 index 0000000000..7093967c4c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations4.pg @@ -0,0 +1,77 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); +#Context()->variables->are(z=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$c = non_zero_random(-10,10,1); +$d = non_zero_random(-10,10,1); +$e = non_zero_random(-10,10,1); +$f = non_zero_random(-10,10,1); +while($a*$f == $c*$d) {$f = non_zero_random(-10,10,1);}; + + +$left = Formula("($a x+$b)/($c)")->reduce; +$right = Formula("($d x+$e)/($f)")->reduce; + + +$ans = Fraction("$c*$e-$b*$f","$a*$f-$c*$d"); + +Context("LimitedFraction"); +Context()->flags->set(showMixedNumbers=>0); +$ans = Fraction($ans); + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Use algebra to solve the equation \[$left=$right\] + +$BBLOCKQUOTE +The solution is \(x = \)$SPACE \{ans_rule(10)\}. $PAR +The solution set is \{ans_rule(10)\}.$BR +(Use set notation.) +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +ANS( Compute("{$ans}")->cmp(tolerance=>0)); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations5.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations5.pg new file mode 100644 index 0000000000..79a67b2162 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations5.pg @@ -0,0 +1,74 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); +#Context()->variables->are(z=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$a = non_zero_random(1,10,1); +$b = non_zero_random(1980,2010,1); +$c = non_zero_random(100,200,1); +$d = non_zero_random(100,200,1); + + +$left = Formula("$a(x-$b)+$c")->reduce; +$right = Formula("$d")->reduce; + + +$ans = Fraction("$d-$c+$a*$b","$a"); + +Context("Numeric"); + +$ans = Real("$ans"); + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Use algebra to solve the equation \[$left=$right\] + +$BBLOCKQUOTE +The solution is \(x = \)$SPACE \{ans_rule(10)\}. $PAR +The solution set is \{ans_rule(10)\}.$BR +(Use set notation.) +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +ANS( Compute("{$ans}")->cmp()); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations6.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations6.pg new file mode 100644 index 0000000000..9bf61e808f --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations6.pg @@ -0,0 +1,74 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); +Context()->variables->are(n=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$a = non_zero_random(1,10,0.1); +$b = non_zero_random(-10,10,0.01); +$c = non_zero_random(-10,10,1); +$d = non_zero_random(-10,10,0.1); + + +$left = Formula("$a(n-$b)+$c n")->reduce; +$right = Formula("$d")->reduce; + + +$ans = Compute("($d+$a*$b)/($a+$c)"); + +Context("Numeric"); + +$ans = Real("$ans"); + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Use algebra to solve the equation \[$left=$right\] + +$BBLOCKQUOTE +The solution is \(n = \)$SPACE \{ans_rule(10)\}. $PAR +The solution set is \{ans_rule(10)\}.$BR +(Use set notation.) +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +ANS( Compute("{$ans}")->cmp()); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations7.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations7.pg new file mode 100644 index 0000000000..4bf274c5a5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations7.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); +#Context()->variables->are(n=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$a = non_zero_random(-5,5,1); +$b = non_zero_random(-8,8,1); +$c = non_zero_random(-4,4,1); +$d = non_zero_random(max(1,abs($c)-3),abs(c)+3,1); +while($a == $c/$d) {$a = non_zero_random(-5,5,1);}; +$e = non_zero_random(-8,8,1); + +$f = Fraction("$c","$d"); + +while($e == $b){$e = non_zero_random(-8,8,1);} + + +$left = Formula("$a x+$b")->reduce; +$right = Formula("$f x+$e")->reduce; + +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +$ans = Compute("($e-$b)/($a-$f)"); + +Context("Numeric"); +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +$ans = Real("$ans"); + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Use a $BITALIC graphical method $EITALIC to solve the equation \[$left=$right\] $BR +Practice sketching the graphs $BITALIC by hand $EITALIC. + +$BBLOCKQUOTE +The solution is \(x = \)$SPACE \{ans_rule(10)\}. $PAR +The solution set is \{ans_rule(10)\}.$BR +(Use set notation.) +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); +Context("Interval"); +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +Context()->parens->set('{'=>{type=>'Set'}); +ANS( Compute("{$ans}")->cmp()); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations8.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations8.pg new file mode 100644 index 0000000000..4bf274c5a5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations8.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); +#Context()->variables->are(n=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$a = non_zero_random(-5,5,1); +$b = non_zero_random(-8,8,1); +$c = non_zero_random(-4,4,1); +$d = non_zero_random(max(1,abs($c)-3),abs(c)+3,1); +while($a == $c/$d) {$a = non_zero_random(-5,5,1);}; +$e = non_zero_random(-8,8,1); + +$f = Fraction("$c","$d"); + +while($e == $b){$e = non_zero_random(-8,8,1);} + + +$left = Formula("$a x+$b")->reduce; +$right = Formula("$f x+$e")->reduce; + +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +$ans = Compute("($e-$b)/($a-$f)"); + +Context("Numeric"); +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +$ans = Real("$ans"); + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Use a $BITALIC graphical method $EITALIC to solve the equation \[$left=$right\] $BR +Practice sketching the graphs $BITALIC by hand $EITALIC. + +$BBLOCKQUOTE +The solution is \(x = \)$SPACE \{ans_rule(10)\}. $PAR +The solution set is \{ans_rule(10)\}.$BR +(Use set notation.) +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); +Context("Interval"); +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +Context()->parens->set('{'=>{type=>'Set'}); +ANS( Compute("{$ans}")->cmp()); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations9.pg b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations9.pg new file mode 100644 index 0000000000..9231917bd0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingLinearEquations/SolvingLinearEquations9.pg @@ -0,0 +1,82 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGunion.pl", +); + +TEXT(beginproblem()); + +############################################## + +Context("Fraction"); +#Context()->variables->are(n=>'Real'); +Context()->reductions->set('(-x)+y'=>0,'(-x)-y'=>0); + +$a = non_zero_random(-20,20,1); +$b = non_zero_random(-20,20,1); +$c = non_zero_random(-20,20,1); +$d = non_zero_random(max(1,abs($c)-3),abs(c)+3,1); +while($a == $c/$d) {$a = non_zero_random(-5,5,1);}; +$e = non_zero_random(-20,20,1); + +$f = Fraction("$c","$d"); + +while($e == $b){$e = non_zero_random(-20,20,1);} + + +$left = Formula("$a x+$b")->reduce; +$right = Formula("$f x+$e")->reduce; + +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +$ans = Compute("($e-$b)/($a-$f)"); + +Context("Numeric"); +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +$ans = Real("$ans"); + +############################################## + + + +Context()->texStrings; + +BEGIN_TEXT + +Use a $BITALIC graphical method $EITALIC to solve the equation \[$left=$right\] $BR +Practice $BITALIC using your graphing calculator$EITALIC. + +$BBLOCKQUOTE +The solution is \(x = \)$SPACE \{ans_rule(10)\}. $PAR +The solution set is \{ans_rule(10)\}.$BR +(Use set notation.) +$EBLOCKQUOTE + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $ans->cmp()); +Context("Interval"); +Context()->flags->set(tolType=>absolute,tolerance=>0.2); +Context()->parens->set('{'=>{type=>'Set'}); +ANS( Compute("{$ans}")->cmp()); + + + + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations1.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations1.pg new file mode 100644 index 0000000000..d2af444079 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations1.pg @@ -0,0 +1,102 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# sqrt(ax) = b +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Fraction"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = random(2,10,1); +$b = random(2,10,1); + + +$left = Formula("sqrt($a $var)")->reduce; +$right = Formula("$b")->reduce; + + +$r[0] = Fraction("$b**2","$a"); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$r[0]}"); + + +############################################## + + +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +To get rid of the square root in this equation, we square the left side and the right side of the equation. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left([$left]\right)^2 &= \left([$right]\right)^2 \\ + [$a][$var] &= [$b**2] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$b**2]}{[$a]} \\ + [$var] &= [$r[0]] \\ +\end{aligned} + ``] + +We must check our solutions when we solve radical equations. We therefore substitute our answer into the original equation: + + [`` +\begin{aligned} + [$left] &\stackrel{?}{=} [$right] \\ + \sqrt{[$a]\cdot[$r[0]]} &\stackrel{?}{=} [$b] \\ + \sqrt{[$a*$r[0]]} &\stackrel{?}{=} [$b] \\ + [$b] &\stackrel{?}{=} [$b] \\ +\end{aligned} + ``] + +That is true, so the solution set is [`\{[$r[0]]\}`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations10.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations10.pg new file mode 100644 index 0000000000..36c6b6c296 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations10.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# F = 1/(2pi*sqrt(LC)) solve for C +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->are(F=>'Real',L=>'Real',C=>'Real'); + +$left = Formula("F"); +$right = Formula("1/(2 pi sqrt(L C))"); + +$ans = Formula("1/(4 pi^2 F^2 L)"); + + +############################################## + + +BEGIN_PGML + +Solve the equation for [`C`]. + +>>[``[$left] = [$right]``]<< + +If you need to use a square root, type *sqrt(23)* for [`\sqrt{23}`] (for example). To enter [`\pi`], type *pi*. + + [`C = `] [____________________]. + +END_PGML + + +############################################## + + +ANS( $ans->cmp()); + + +############################################## + + +BEGIN_PGML_SOLUTION + + +Since there is no addition or subtraction in this problem, we can square the equation at any point. We will do that again as our first step. So to get rid of the square root, we square the left side and the right side of the equation, using exponent rules to simplify. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left(F\right)^2 &= \left(\frac{1}{2\pi\sqrt{LC}}\right)^2 \\ + F^2 &= \frac{1}{4\pi^2LC} \\ +\end{aligned} + ``] + +In order to solve for [`C`], we need to get it out of the denominator by multiplying with [`C`] (which is also [`\frac{C}{1}`]) on both sides: + + [`` +\begin{aligned} + F^2 &= \frac{1}{4\pi^2LC} \\ + F^2\cdot C &= \frac{1}{4\pi^2LC}\cdot \frac{C}{1} \\ + F^2C &= \frac{1}{4\pi^2L} \\ +\end{aligned} + ``] + +Since we want to solve for [`C`], we need to divide by [`F^2`]. Since we have a fraction on the right side, we will multiply by the reciprocal of [`F^2`] instead. + + [`` +\begin{aligned} + F^2C &= \frac{1}{4\pi^2L} \\ + \frac{F^2C}{F^2} &= \frac{1}{4\pi^2LC}\cdot \frac{1}{F^2} \\ + C &= \frac{1}{4\pi^2LF^2} \\ +\end{aligned} + ``] + +So [`C=[$ans]`] is the solution to [`[$left]=[$right]`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg new file mode 100644 index 0000000000..3a72b55ead --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# CubeRoot(x-a) = b b is positive +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Fraction"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = random(2,10,1); +$b = random(2,10,1); + + +$left = "\sqrt[3]{$var-$a}"; +$right = Formula("$b")->reduce; + + +$r[0] = Fraction("$b**3+$a","1"); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$r[0]}"); + + +############################################## + +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + + + + +############################################## + + +BEGIN_PGML_SOLUTION + +To get rid of the cube root in this equation, we raise the left side and the right side of the equation each to the third power. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left([$left]\right)^3 &= \left([$b]\right)^3 \\ + [$var]-[$a] &= [$b**3] \\ + [$var]-[$a]+[$a] &= [$b**3]+[$a] \\ + [$var] &= [$r[0]] \\ +\end{aligned} + ``] + +We must check our solutions when we solve radical equations. We therefore substitute our answer into the original equation: + + [`` +\begin{aligned} + [$left] &\stackrel{?}{=} [$right] \\ + \sqrt[3]{[$r[0]]-[$a]} &\stackrel{?}{=} [$b] \\ + \sqrt[3]{[$r[0]-[$a]]} &\stackrel{?}{=} [$b] \\ + [$b] &\stackrel{?}{=} [$b] \\ +\end{aligned} + ``] + +That is true, so the solution set is [`\{[$r[0]]\}`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg new file mode 100644 index 0000000000..919c123a9e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg @@ -0,0 +1,121 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# sqrt(ax+b)+c = d +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Fraction"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = random(2,10,1); +$b = random(2,10,1); +$c = random(2,10,1); +$d = $c + random(2,10,1); +$h1 = $d - $c; #helper variable 1 + + +$left = Formula("sqrt($a $var+$b)+$c"); +$right = Formula("$d")->reduce; + + +$r[0] = Fraction("($d-$c)**2-$b","$a"); +$h2 = sqrt($a*$r[0]+$b); #helper variable 2 + + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$r[0]}"); + + +############################################## + +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +The first step is to get the square root on one side of the equation and everything else on the other side. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left]-[$c] &= [$right]-[$c] \\ + \sqrt{[$a][$var]+[$b]} &= [$d-$c] \\ +\end{aligned} + ``] + +To get rid of the square root, we square the left side and the right side of the equation. + + [`` +\begin{aligned} + \sqrt{[$a][$var]+[$b]} &= [$d-$c] \\ + \left(\sqrt{[$a][$var]+[$b]}\right)^2 &= \left([$d-$c]\right)^2 \\ + [$a][$var]+[$b] &= [$h1**2] \\ + [$a][$var]+[$b]-[$b] &= [$h1**2]-[$b] \\ + [$a][$var] &= [$h1**2-$b] \\ + \frac{[$a][$var]}{[$a]} &= \frac{[$h1**2-$b]}{[$a]} \\ + [$var] &= [$r[0]] \\ +\end{aligned} + ``] + +We must check our solutions when we solve radical equations. We therefore substitute our answer into the original equation: + + [`` +\begin{aligned} + [$left] &\stackrel{?}{=} [$right] \\ + \sqrt{[$a]\cdot[$r[0]]+[$b]}+[$c] &\stackrel{?}{=} [$d] \\ + \sqrt{[$a*$r[0]]+[$b]}+[$c] &\stackrel{?}{=} [$d] \\ + \sqrt{[$a*$r[0]+$b]}+[$c] &\stackrel{?}{=} [$d] \\ + [$h2]+[$c] &\stackrel{?}{=} [$d] \\ + [$d] &\stackrel{?}{=} [$d] \\ +\end{aligned} + ``] + +That is true, so the solution set is [`\{[$r[0]]\}`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg new file mode 100644 index 0000000000..6260bce4ba --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg @@ -0,0 +1,148 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# sqrt(x)+b = x +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Fraction"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = random(4,12,1); +$b = $a**2-$a; +$A = 1; # for solving the quadratic formula +$B = -($b*2+1); # for solving the quadratic formula +$C = $b**2; # for solving the quadratic formula +$h1 = sqrt($B**2-$A*$C*4); # helper variable for solving the quadratic formula +$h2 = (-$B-$h1)/($A*2); # helper variable for solving the quadratic formula + + +$left = Formula("sqrt($var)+$b")->reduce; +$right = Formula("$var")->reduce; + + +$r[0] = Fraction("$a**2","1"); +$h3 = sqrt($r[0]); # helper variable for checking solution +$h4 = sqrt($h2); # helper variable for checking solution + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$r[0]}"); + + +############################################## + + +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + + + +############################################## + + +BEGIN_PGML_SOLUTION + + +Since the solution is rather long, make sure to look also at the very end of the solution below, especially if you have difficulties finding the right answer. + +The first step is to get the square root on one side of the equation and everything else on the other side. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left]-[$b] &= [$right]-[$b] \\ + \sqrt{[$var]} &= [$var]-[$b] \\ +\end{aligned} + ``] + +To get rid of the square root, we square the left side and the right side of the equation. + + [`` +\begin{aligned} + \sqrt{[$var]} &= [$var]-[$b] \\ + \left(\sqrt{[$var]}\right)^2 &= \left([$var]-[$b]\right)^2 \\ + [$var] &= \left([$var]-[$b]\right)\left([$var]-[$b]\right) \\ + [$var] &= [$var]^2-[$b][$var]-[$b][$var]+[$b]^2 \\ + [$var] &= [$var]^2-[$b*2][$var]+[$b**2] \\ + [$var]-[$var] &= [$var]^2-[$b*2][$var]+[$b**2]-[$var] \\ + 0 &= [$var]^2-[$b*2+1][$var]+[$b**2] \\ +\end{aligned} + ``] + +We can now use the Quadratic Formula: + + [` +\begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{-[$B]\pm\sqrt{[$B]^2-4\cdot[$A]\cdot[$C]}}{2\cdot[$A]}\\ +\end{aligned} `] + +Following you see the step-by-step solution. If you use a calculator, make sure you can also do these steps on your own. + + [` +\begin{aligned} + [$var] & = \frac{-[$B]\pm\sqrt{[$B]^2-4\cdot[$A]\cdot[$C]}}{2\cdot[$A]}\\ + & = \frac{-[$B]\pm\sqrt{[$B**2]-[$A*$C*4]}}{[$A*2]}\\ + & = \frac{-[$B]\pm\sqrt{[$B**2-$A*$C*4]}}{[$A*2]}\\ + & = \frac{-[$B]\pm[$h1]}{[$A*2]}\\ + [$var] & = \frac{-[$B]+[$h1]}{[$A*2]} \text{ or } [$var] = \frac{-[$B]-[$h1]}{[$A*2]}\\ + [$var] & = [$r[0]] \text{ or } [$var] = [$h2]\\ +\end{aligned} + `] + + +We must check EACH solution when we solve radical equations. We therefore substitute our answers into the original equation: + + [`` +\begin{aligned} + [$left] &\stackrel{?}{=} [$right] && & [$left] &\stackrel{?}{=} [$right] \\ + \sqrt{[$r[0]]}+[$b] &\stackrel{?}{=} [$r[0]] && \text{ and } & \sqrt{[$h2]}+[$b] &\stackrel{?}{=} [$h2] \\ + [$h3]+[$b] &\stackrel{?}{=} [$r[0]] && & [$h4]+[$b] &\stackrel{?}{=} [$h2] \\ + [$h3+$b] &\stackrel{?}{=} [$r[0]] && & [$h4+$b] &\stackrel{?}{=} [$h2] \\ +\end{aligned} + ``] + +The first solution [`[$var] = [$r[0]]`] works out fine but the second solution [`[$var] = [$h2]`] does not fulfill the equation [`[$left]=[$right]`]. So the solution set is [`\{[$r[0]]\}`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations5.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations5.pg new file mode 100644 index 0000000000..163e5eda5e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations5.pg @@ -0,0 +1,104 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# CubeRoot(x-a) = b b is negative +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Fraction"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = random(1,12,1); +$b = non_zero_random(-10,10,1); + + +$left = "\sqrt[3]{$var-$a}"; +$right = Formula("$b")->reduce; + + +$r[0] = Fraction("$b**3+$a","1"); + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$r[0]}"); + + + +############################################## + + +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +To get rid of the cube root in this equation, we raise the left side and the right side of the equation each to the third power. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left([$left]\right)^3 &= \left([$b]\right)^3 \\ + [$var]-[$a] &= [$b**3] \\ + [$var]-[$a]+[$a] &= [$b**3]+[$a] \\ + [$var] &= [$r[0]] \\ +\end{aligned} + ``] + +We must check our solutions when we solve radical equations. We therefore substitute our answer into the original equation: + + [`` +\begin{aligned} + [$left] &\stackrel{?}{=} [$right] \\ + \sqrt[3]{[$r[0]]-[$a]} &\stackrel{?}{=} [$b] \\ + \sqrt[3]{[$r[0]-[$a]]} &\stackrel{?}{=} [$b] \\ + [$b] &\stackrel{?}{=} [$b] \\ +\end{aligned} + ``] + +That is true, so the solution set is [`\{[$r[0]]\}`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg new file mode 100644 index 0000000000..4e8cd05a2b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg @@ -0,0 +1,148 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# x = sqrt(x+b)+c +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Fraction"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = random(4,12,1); +$b = random(1,4,1); +$c = $a**2-$b-$a; +$A = 1; # for solving the quadratic formula +$B = -($c*2+1); # for solving the quadratic formula +$C = $c**2-$b; # for solving the quadratic formula +$h1 = sqrt($B**2-$A*$C*4); # helper variable for solving the quadratic formula +$h2 = (-$B-$h1)/($A*2); # helper variable for solving the quadratic formula + +$left = Formula("$var"); +$right = Formula("sqrt($var+$b)+$c")->reduce; + + +$r[0] = Fraction("$a**2-$b","1"); +$h3 = sqrt($r[0]+$b); # helper variable for checking solution +$h4 = sqrt($h2+$b); # helper variable for checking solution + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$r[0]}"); + + +############################################## + +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + + + +############################################## + + +BEGIN_PGML_SOLUTION + + +Since the solution is rather long, make sure to look also at the very end of the solution below, especially if you have difficulties finding the right answer. + +The first step is to get the square root on one side of the equation and everything else on the other side. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + [$left]-[$c] &= [$right]-[$c] \\ + [$var]-[$c] &= \sqrt{[$var]+[$b]} \\ +\end{aligned} + ``] + +To get rid of the square root, we square the left side and the right side of the equation. + + [`` +\begin{aligned} + [$var]-[$c] &= \sqrt{[$var]+[$b]} \\ + \left([$var]-[$c]\right)^2 &= \left(\sqrt{[$var]+[$b]}\right)^2 \\ + \left([$var]-[$c]\right)\left([$var]-[$c]\right) &= [$var]+[$b] \\ + [$var]^2-[$c][$var]-[$c][$var]+[$c]^2 &= [$var]+[$b] \\ + [$var]^2-[$c*2][$var]+[$c**2] &= [$var]+[$b] \\ + [$var]^2-[$c*2][$var]+[$c**2]-[$var]-[$b] &= [$var]+[$b]-[$var]-[$b] \\ + [$var]^2-[$c*2+1][$var]+[$c**2-$b] &= 0 \\ +\end{aligned} + ``] + +We can now use the Quadratic Formula: + + [` +\begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{-[$B]\pm\sqrt{[$B]^2-4\cdot[$A]\cdot[$C]}}{2\cdot[$A]}\\ +\end{aligned} `] + +Following you see the step-by-step solution. If you use a calculator, make sure you can also do these steps on your own. + + [` +\begin{aligned} + [$var] & = \frac{-[$B]\pm\sqrt{[$B]^2-4\cdot[$A]\cdot[$C]}}{2\cdot[$A]}\\ + & = \frac{-[$B]\pm\sqrt{[$B**2]-[$A*$C*4]}}{[$A*2]}\\ + & = \frac{-[$B]\pm\sqrt{[$B**2-$A*$C*4]}}{[$A*2]}\\ + & = \frac{-[$B]\pm[$h1]}{[$A*2]}\\ + [$var] & = \frac{-[$B]+[$h1]}{[$A*2]} \text{ or } [$var] = \frac{-[$B]-[$h1]}{[$A*2]}\\ + [$var] & = [$r[0]] \text{ or } [$var] = [$h2]\\ +\end{aligned} + `] + + +We must check EACH solution when we solve radical equations. We therefore substitute our answers into the original equation: + + [`` +\begin{aligned} + [$left] &\stackrel{?}{=} [$right] && & [$left] &\stackrel{?}{=} [$right] \\ + [$r[0]] &\stackrel{?}{=} \sqrt{[$r[0]]+[$b]}+[$c] && \text{ and } & [$h2] &\stackrel{?}{=} \sqrt{[$h2]+[$b]}+[$c] \\ + [$r[0]] &\stackrel{?}{=} \sqrt{[$r[0]+$b]}+[$c] && & [$h2] &\stackrel{?}{=} \sqrt{[$h2+$b]}+[$c] \\ + [$r[0]] &\stackrel{?}{=} [$h3]+[$c] && & [$h2] &\stackrel{?}{=} [$h4]+[$c] \\ + [$r[0]] &\stackrel{?}{=} [$h3+$c] && & [$h2] &\stackrel{?}{=} [$h4+$c] \\ +\end{aligned} + ``] + +The first solution [`[$var] = [$r[0]]`] works out fine but the second solution [`[$var] = [$h2]`] does not fulfill the equation [`[$left]=[$right]`]. So the solution set is [`\{[$r[0]]\}`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg new file mode 100644 index 0000000000..78133298b0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg @@ -0,0 +1,136 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# sqrt(b-x) = x+c +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PCCmacros.pl", + "contextFiniteSolutionSets.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Fraction"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = random(4,12,1); +$b = random(1,4,1)+$a**2; +$c = -($b-$a**2-$a); +$A = 1; # for solving the quadratic formula +$B = $c*2+1; # for solving the quadratic formula +$C = $c**2-$b; # for solving the quadratic formula +$h1 = sqrt($B**2-$A*$C*4); # helper variable for solving the quadratic formula +$h2 = (-$B-$h1)/($A*2); # helper variable for solving the quadratic formula + +$left = Formula("sqrt($b-$var)"); +$right = Formula("$var+$c")->reduce; + + +$r[0] = Fraction("-$a**2+$b","1"); +$h3 = sqrt($b-$r[0]); # helper variable for checking solution +$h4 = sqrt($b-$h2); # helper variable for checking solution + +Context("FiniteSolutionSets"); +Context()->variables->are($var=>'Real'); +$ans = Formula("{$r[0]}"); + + +############################################## + +BEGIN_PGML +Solve the equation. + + [`` [$left] = [$right] ``] + + [__________________________________]{$ans} + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + + +Since the solution is rather long, make sure to look also at the very end of the solution below, especially if you have difficulties finding the right answer. + +To get rid of the square root, we square the left side and the right side of the equation. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left(\sqrt{[$b]-[$var]}\right)^2 &= \left([$var]+[$c]\right)^2 \\ + [$b]-[$var] &= \left([$var]+[$c]\right)\left([$var]+[$c]\right) \\ + [$b]-[$var] &= [$var]^2+[$c][$var]+[$c][$var]+[$c]^2 \\ + [$b]-[$var] &= [$var]^2+[$c*2][$var]+[$c**2] \\ + [$b]-[$var]-[$b]+[$var] &= [$var]^2+[$c*2][$var]+[$c**2]-[$b]+[$var] \\ + 0 &= [$var]^2+[$c*2+1][$var]+[$c**2-$b] \\ +\end{aligned} + ``] + +We can now use the Quadratic Formula: + + [` +\begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{-[$B]\pm\sqrt{[$B]^2-4([$A])([$C])}}{2([$A])}\\ +\end{aligned} `] + +Following you see the step-by-step solution. If you use a calculator, make sure you can also do these steps on your own. + + [` +\begin{aligned} + [$var] & = \frac{-[$B]\pm\sqrt{[$B]^2-4([$A])([$C]})}{2([$A])}\\ + & = \frac{-[$B]\pm\sqrt{[$B**2]-[$A*$C*4]}}{[$A*2]}\\ + & = \frac{-[$B]\pm\sqrt{[$B**2-$A*$C*4]}}{[$A*2]}\\ + & = \frac{-[$B]\pm[$h1]}{[$A*2]}\\ + [$var] & = \frac{-[$B]+[$h1]}{[$A*2]} & \text{ or } && [$var] & = \frac{-[$B]-[$h1]}{[$A*2]}\\ + [$var] & = [$r[0]] & \text{ or } && [$var] & = [$h2]\\ +\end{aligned} + `] + + +We must check EACH solution when we solve radical equations. We therefore substitute our answers into the original equation: + + [`` +\begin{aligned} + [$left] &\stackrel{?}{=} [$right] && & [$left] &\stackrel{?}{=} [$right] \\ + \sqrt{[$b]-[$r[0]]} &\stackrel{?}{=} [$r[0]]+[$c] && & \sqrt{[$b]-[$h2]} &\stackrel{?}{=} [$h2]+[$c] \\ + \sqrt{[$b-$r[0]]} &\stackrel{?}{=} [$r[0]+$c] && & \sqrt{[$b-$h2]} &\stackrel{?}{=} [$h2+$c] \\ + [$h3] &\stackrel{?}{=} [$r[0]+$c] && & [$h4] &\stackrel{?}{=} [$h2+$c] \\ +\end{aligned} + ``] + +The first solution [`[$var] = [$r[0]]`] works out fine but the second solution [`[$var] = [$h2]`] does not fulfill the equation [`[$left]=[$right]`]. So the solution set is [`\{[$r[0]]\}`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations8.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations8.pg new file mode 100644 index 0000000000..f36e4b325e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations8.pg @@ -0,0 +1,182 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# sqrt(ax+b)+sqrt(x) = c +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +$a = random(4,12,1); +$b = random(1,4,1); +$c = random(4,12,1); +$h1 = $c**2-$b; # helper variable +$h2 = $a+1; # helper variable +$A = $h2**2-$a*4; # for solving the quadratic formula +$B = -($h1*$h2*2+$b*4); # for solving the quadratic formula +$C = $h1**2; # for solving the quadratic formula +$h3 = sqrt($B**2-$A*$C*4); # helper variable for solving the quadratic formula + +$left = Formula("sqrt($a $var+$b)+sqrt($var)")->reduce; +$right = Formula("$c")->reduce; + +Context()->flags->set(reduceConstantFunctions=>0); +$r[0] = Formula("(-2*($a-1)*($b-$c**2)+4*$c**2+sqrt((2*($a-1)*($b-$c**2)-4*$c**2)**2-4*($a-1)**2*($b-$c**2)**2))/(2*($a-1)**2)"); +$r[1] = Formula("(-2*($a-1)*($b-$c**2)+4*$c**2-sqrt((2*($a-1)*($b-$c**2)-4*$c**2)**2-4*($a-1)**2*($b-$c**2)**2))/(2*($a-1)**2)"); +$d[0] = sprintf("%0.5f",(-$B+$h3)/($A*2)); # solution as decimal +$d[1] = sprintf("%0.5f",(-$B-$h3)/($A*2)); # solution as decimal + +#$h4[0] = sprintf("%0.5f",sqrt($a*$d[0]+$b)); # helper variable to check solutions +#$h5[0] = sprintf("%0.5f",sqrt($d[0])); # helper variable to check solutions +#$h4[1] = sprintf("%0.5f",sqrt($a*$d[1]+$b)); # helper variable to check solutions +#$h5[1] = sprintf("%0.5f",sqrt($d[1])); # helper variable to check solutions + +for( $i=0; $i<=1; $i++){ +$h4[$i] = sprintf("%0.5f",sqrt($a*$d[$i]+$b)); # helper variable to check solutions +$h5[$i] = sprintf("%0.5f",sqrt($d[$i])); # helper variable to check solutions +} + +Context("Interval"); +Context()->parens->set('{'=>{type=>'Set'}); +Context()->flags->set(formatStudentAnswer=>'parsed'); +if (sqrt($a*$r[0]+$b)+sqrt($r[0]) == $c) +{$ans = Compute("{$r[0]}");} +else {$ans = Compute("{}");}; +if (sqrt($a*$r[1]+$b)+sqrt($r[1]) == $c) +{$ans = Union("$ans U {$r[1]}");} +else {$ans = Union("$ans U {}");}; +$ans = $ans->reduce; + + +############################################## + + +BEGIN_PGML + +Solve the equation for [`[$var]`]. Enter the solution set using set notation. For example: [`\{1,2\}`]. + +>>[``[$left] = [$right]``]<< + +If you need to use a square root, type *sqrt(23)* for [`\sqrt{23}`] (for example). +If the equation has no solutions, you can still use set notation by entering [`\{\}`]. + +The solution set is [__________]{$ans->cmp(tolerance=>0.001)}. + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + + +Since the solution is rather long, make sure to look also at the very end of the solution below, especially if you have difficulties finding the right answer. + +To get rid of the *all* the square roots in this problem, we have to: +1. Square the left side and the right side of the equation, +2. Simplify, +3. Leave the term with the remaining square roots on one side of the equation and move any other terms to the other side of the equation, +4. Square again the left side and the right side of the equation, +5. Simplify, +6. Solve the quadratic equation. + + +Steps 1-3: + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left(\sqrt{[$a][$var]+[$b]}+\sqrt{[$var]}\right)^2 &= \left([$c]\right)^2 \\ + \left(\sqrt{[$a][$var]+[$b]}+\sqrt{[$var]}\right)\left(\sqrt{[$a][$var]+[$b]}+\sqrt{[$var]}\right) &= [$c**2] \\ + \left(\sqrt{[$a][$var]+[$b]}\right)^2+\sqrt{[$var]}\sqrt{[$a][$var]+[$b]}+\sqrt{[$var]}\sqrt{[$a][$var]+[$b]}+\left(\sqrt{[$var]}\right)^2 &= [$c**2] \\ + [$a][$var]+[$b]+2\sqrt{[$var]}\sqrt{[$a][$var]+[$b]}+[$var] &= [$c**2] \\ + [$a+1][$var]+[$b]+2\sqrt{[$var]}\sqrt{[$a][$var]+[$b]} &= [$c**2] \\ + [$a+1][$var]+[$b]+2\sqrt{[$var]}\sqrt{[$a][$var]+[$b]}-[$a+1][$var]-[$b] &= [$c**2]-[$a+1][$var]-[$b] \\ + 2\sqrt{[$var]}\sqrt{[$a][$var]+[$b]} &= [$c**2-$b]-[$a+1][$var] \\ +\end{aligned} + ``] + +Steps 4-5: + [`` +\begin{aligned} + 2\sqrt{[$var]}\sqrt{[$a][$var]+[$b]} &= [$c**2-$b]-[$a+1][$var] \\ + \left(2\sqrt{[$var]}\sqrt{[$a][$var]+[$b]}\right)^2 &= \left([$c**2-$b]-[$a+1][$var]\right)^2 \\ + \left(2\right)^2 \left(\sqrt{[$var]}\right)^2 \left(\sqrt{[$a][$var]+[$b]}\right)^2 &= \left([$c**2-$b]-[$a+1][$var]\right)\left([$c**2-$b]-[$a+1][$var]\right) \\ + 4[$var]\left([$a][$var]+[$b]\right) &= \left([$c**2-$b]\right)^2-[$a+1]([$c**2-$b])[$var]-[$a+1]([$c**2-$b])[$var]+\left([$a+1][$var]\right)^2 \\ + [$a*4][$var]^2+[$b*4][$var] &= [$h1**2]-[$h1*$h2*2][$var]+[$h2**2][$var]^2 \\ + [$a*4][$var]^2+[$b*4][$var]-[$a*4][$var]^2-[$b*4][$var] &= [$h1**2]-[$h1*$h2*2][$var]+[$h2**2][$var]^2-[$a*4][$var]^2-[$b*4][$var] \\ + 0 &= [$h2**2-$a*4][$var]^2-[$h1*$h2*2+$b*4][$var]+[$h1**2] \\ +\end{aligned} + ``] + +For step 6, we can now use the Quadratic Formula: + + [` +\begin{aligned} + [$var] & = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\\ + & = \frac{-[$B]\pm\sqrt{([$B])^2-4([$A])([$C])}}{2([$A])}\\ +\end{aligned} `] + +Following you see the step-by-step solution. If you use a calculator, make sure you can also do these steps on your own. + + [` +\begin{aligned} + [$var] & = \frac{-[$B]\pm\sqrt{([$B])^2-4([$A])([$C]})}{2([$A])}\\ + & = \frac{-[$B]\pm\sqrt{[$B**2]-[$A*$C*4]}}{[$A*2]}\\ + & = \frac{-[$B]\pm\sqrt{[$B**2-$A*$C*4]}}{[$A*2]}\\ + [$var] & = [$r[0]] & \text{ or } && [$var] & = [$r[1]]\\ + [$var] & \approx \frac{-[$B]+[$h3]}{[$A*2]} & \text{ or } && [$var] & \approx \frac{-[$B]-[$h3]}{[$A*2]}\\ + [$var] & \approx [$d[0]] & \text{ or } && [$var] & \approx [$d[1]]\\ +\end{aligned} + `] + + +We must check EACH solution when we solve radical equations. We therefore substitute our answers into the original equation: + + [`` +\begin{aligned} + [$left] &\stackrel{?}{=} [$right] & [$left] &\stackrel{?}{=} [$right] \\ + \sqrt{[$a]([$d[0]])+[$b]}+\sqrt{[$d[0]]} &\stackrel{?}{\approx} [$c] & \sqrt{[$a]([$d[1]])+[$b]}+\sqrt{[$d[1]]} &\stackrel{?}{\approx} [$c] \\ + \sqrt{[$a*$d[0]]+[$b]}+\sqrt{[$d[0]]} &\stackrel{?}{\approx} [$c] & \sqrt{[$a*$d[1]]+[$b]}+\sqrt{[$d[1]]} &\stackrel{?}{\approx} [$c] \\ + [$h4[0]]+[$h5[0]] &\stackrel{?}{\approx} [$c] & [$h4[1]]+[$h5[1]] &\stackrel{?}{\approx} [$c] \\ + [$h4[0]+$h5[0]] &\stackrel{?}{\approx} [$c] & [$h4[1]+$h5[1]] &\stackrel{?}{\approx} [$c] \\ +\end{aligned} + ``] + +The first solution [`[$var] = [$d[0]]`] does not work out but the second solution [`[$var] = [$d[1]]`] does fulfill the equation [`[$left]=[$right]`]. So the solution set is [`\{[$d[1]]\}`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations9.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations9.pg new file mode 100644 index 0000000000..52e147091c --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquations9.pg @@ -0,0 +1,101 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# Z = sqrt(L^2+R^2) solve for R +# +# +# Last updated: Spoddeck 11/12/15 +# ENDDESCRIPTION + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->are(L=>'Real',R=>'Real',Z=>'Real'); +Context()->variables->set(Z=>{limits=>[5,10]}, L=>{limits=>[0,5]}); + +$left = Formula("Z"); +$right = Formula("sqrt(L^2+R^2)"); + +$ans = Formula("sqrt(Z^2-L^2)"); + + +############################################## + + +BEGIN_PGML + +Solve the equation for [`R`]. Assume that [`R`] is positive. + +[```[$left] = [$right]```] + +[@KeyboardInstructions('If you need to use a square root, type [|sqrt(23)|]* for [`\sqrt{23}`] (for example).')@]** + + [`R = `] [____________________]. + +END_PGML + + +############################################## + + +ANS( $ans->cmp()); + + +############################################## + + +BEGIN_PGML_SOLUTION + + +To get rid of the square root, we square the left side and the right side of the equation. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left(Z\right)^2 &= \left(\sqrt{L^2+R^2}\right)^2 \\ + Z^2 &= L^2+R^2 \\ + Z^2-L^2 &= L^2+R^2-L^2 \\ + Z^2-L^2 &= R^2 \\ +\end{aligned} + ``] + +Now we take the square root on both sides: + [`` +\begin{aligned} + Z^2-L^2 &= R^2 \\ + \pm\sqrt{Z^2-L^2} &= \sqrt{R^2} \\ + \pm\sqrt{Z^2-L^2} &= R \\ +\end{aligned} + ``] + +Since [`R`] is positive as stated in the problem, [`R=[$ans]`] is the solution to [`[$left]=[$right]`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication102.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication102.pg new file mode 100644 index 0000000000..af8273baba --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication102.pg @@ -0,0 +1,145 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# r = sqrt(x^2+y^2) solve for y with x and r given +# +# +# Last updated: Spoddeck 12/8/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck") +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->are(x=>'Real',y=>'Real',r=>'Real'); + +$y = list_random(3,5,8,7,9); + +if ($y==3) { + $x = 4; + $r = 5; +} elsif ($y==5) { + $x = 12; + $r = 13; +} elsif ($y==8) { + $x = 15; + $r = 17; +} elsif ($y==7) { + $x = 24; + $r = 25; +} elsif ($y==9) { + $x = 40; + $r = 41; +} + +$x2 = $x**2; +$r2 = $r**2; +$xU = NumberWithUnits("$x cm"); +$rU = NumberWithUnits("$r cm"); + +$left = Formula("r"); +$right = Formula("sqrt(x^2+y^2)"); + +Context("LimitedNumeric"); +Parser::Number::NoDecimals(); +$yU = NumberWithUnits("$y cm"); +$ans = $yU; + + +############################################## + + +BEGIN_PGML + +In a coordinate system, the distance [`r`] of a point [`(x,y)`] from the origin [`(0,0)`] is given by the following equation. [```[$left] = [$right]```] + +If a point in a coordinate system is [`[$rU]`] away from the origin and its x coordinate is [`[$xU]`], what is its [`y`] coordinate? Assume that [`y`] is positive. + +[@KeyboardInstructions('If you need to use a square root, type [|sqrt(23)|]* for [`\sqrt{23}`] (for example).')@]** + + [`y = `] [____________________]{$ans}. + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + + +First we substitute the values we know into the formula. The distance [`r`] from the origin is [`[$rU]`]. The [`x`] coordinate is [`[$xU]`]. + +Our formula now becomes: + + [`` +\begin{aligned} + [$r] &= \sqrt{[$x]^2+y^2} \\ + [$r] &= \sqrt{[$x2]+y^2} \\ +\end{aligned} + ``] + +To get rid of the square root, we square the left side and the right side of the equation. + + [`` +\begin{aligned} + [$r] &= \sqrt{[$x2]+y^2} \\ + \left([$r]\right)^2 &= \left(\sqrt{[$x2]+y^2}\right)^2 \\ + [$r2] &= [$x2]+y^2 \\ + [$r2]-[$x2] &= [$x2]+y^2-[$x2] \\ + [$r2-$x2] &= y^2 \\ +\end{aligned} + ``] + +Now we take the square root on both sides: + [`` +\begin{aligned} + [$r2-$x2] &= y^2 \\ + \pm\sqrt{[$r2-$x2]} &= \sqrt{y^2} \\ + \pm[$y] &= y \\ +\end{aligned} + ``] + +Since [`y`] is positive as stated in the problem, [`y=[$ans]`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication122.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication122.pg new file mode 100644 index 0000000000..b0d681222b --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication122.pg @@ -0,0 +1,125 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# T = 2pi*sqrt(L/32)) solve for L with T given +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck") +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->are(T=>'Real',L=>'Real'); + +$left = Formula("T"); +$right = Formula("2 pi sqrt(L/32)"); + +$T = random(2,10,2); +$TU = NumberWithUnits("$T s"); + +$L = Real(8*$T**2 / pi**2); +$Lnum = 8*$T**2; +$LU = NumberWithUnits("$Lnum/pi^2 ft"); + + +############################################## + + +BEGIN_PGML +A pendulum has length [`L`], measured in feet. The time period [`T`] that it takes to swing back and forth one time is [`[$TU]`]. The following formula from physics relates [`T`] to [`L`]. [```[$left] = [$right]```] Use this formula to find the length of the pendulum. + +[_]{$LU}{20} + + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + +First, we fill our known values into the formula. We know that [`T = [$TU]`]: + + [`` +\begin{aligned} + [$T] &= 2\pi\sqrt{\frac{L}{32}} \\ +\end{aligned} + ``] + +Since there is no addition or subtraction in this problem, we can square the equation at any point. We will do that again as our first step. So to get rid of the square root, we square the left side and the right side of the equation, using exponent rules to simplify. + + [`` +\begin{aligned} + [$T] &= 2\pi\sqrt{\frac{L}{32}} \\ + \left([$T]\right)^2 &= \left(2\pi\sqrt{\frac{L}{32}}\right)^2 \\ + [$T**2] &= 4\pi^2\frac{L}{32} \\ +\end{aligned} + ``] + +In order to solve for [`L`], we need to move everything else to the other side using algebra: + + [`` +\begin{aligned} + [$T**2] &= 4\pi^2\frac{L}{32} \\ + [$T**2]\cdot 32 &= 4\pi^2\frac{L}{32}\cdot \frac{32}{1} \\ + [$T**2*32] &= 4\pi^2L \\ +\end{aligned} + ``] + +Since we want to solve for [`L`], we need to divide by [`4\pi^2`]. + + [`` +\begin{aligned} + [$T**2*32] &= 4\pi^2L \\ + \frac{[$T**2*32]}{4\pi^2} &= \frac{4\pi^2L}{4\pi^2} \\ + \frac{[$T**2*32/4]}{\pi^2} &= L \\ + [$LU] &\approx L \\ +\end{aligned} + ``] + +So the pendulum is approximately [`[$LU]`] long. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication92.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication92.pg new file mode 100644 index 0000000000..f7d250c3d7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication92.pg @@ -0,0 +1,145 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# c = sqrt(a^2+b^2) solve for a with b and c given +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck") +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->are(a=>'Real',b=>'Real',c=>'Real'); + +$a = list_random(3,5,8,7,9); + +if ($a==3) { + $b = 4; + $c = 5; +} elsif ($a==5) { + $b = 12; + $c = 13; +} elsif ($a==8) { + $b = 15; + $c = 17; +} elsif ($a==7) { + $b = 24; + $c = 25; +} elsif ($a==9) { + $b = 40; + $c = 41; +} + +$b2 = $b**2; +$c2 = $c**2; +$bU = NumberWithUnits("$b ft"); +$cU = NumberWithUnits("$c ft"); + +$left = Formula("c"); +$right = Formula("sqrt(a^2+b^2)"); + +Context("LimitedNumeric"); +Parser::Number::NoDecimals(); +$aU = NumberWithUnits("$a ft"); +$ans = $aU; + + +############################################## + + +BEGIN_PGML + +According to the Pythagorean Theorem, the length [`c`] of the hypothenuse of a rectangular triangle can be found through the following equation. [```[$left] = [$right]```] + +If a rectangular triangle has a hypothenuse of [`[$cU]`] and one leg is [`[$bU]`] long, how long is the third side of the triangle? + +[@KeyboardInstructions('If you need to use a square root, type [|sqrt(23)|]* for [`\sqrt{23}`] (for example).')@]** + + The third side of the triangle is [__________]{$ans} long. + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + + +First we substitute the values we know into the formula. The hypothenuse [`c`] is [`[$cU]`] long. One of the legs, let's say [`b`], is [`[$bU]`] long. (We could have also said it is [`a`].) + +Our formula now becomes: + + [`` +\begin{aligned} + [$c] &= \sqrt{a^2+[$b]^2} \\ + [$c] &= \sqrt{a^2+[$b2]} \\ +\end{aligned} + ``] + +To get rid of the square root, we square the left side and the right side of the equation. + + [`` +\begin{aligned} + [$c] &= \sqrt{a^2+[$b2]} \\ + \left([$c]\right)^2 &= \left(\sqrt{a^2+[$b2]}\right)^2 \\ + [$c2] &= a^2+[$b]^2 \\ + [$c2]-[$b2] &= a^2+[$b2]-[$b2] \\ + [$c2-$b2] &= a^2 \\ +\end{aligned} + ``] + +Now we take the square root on both sides: + [`` +\begin{aligned} + [$c2-$b2] &= a^2 \\ + \pm\sqrt{[$c2-$b2]} &= \sqrt{a^2} \\ + \pm[$a] &= a \\ +\end{aligned} + ``] + +[`a`] is positive since it is a length. Therefore, the third side of the triangle is [`[$ans]`] long. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral100.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral100.pg new file mode 100644 index 0000000000..55b583bc7e --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral100.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# r = sqrt(x^2+y^2) solve for y +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck") +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("LimitedRadical"); +Context()->variables->are(x=>'Real',y=>'Real',r=>'Real'); + +$left = Formula("r"); +$right = Formula("sqrt(x^2+y^2)"); + +$ans = Formula("sqrt(r^2-x^2)"); + + +############################################## + + +BEGIN_PGML + +In a coordinate system, the distance [`r`] from a point [`(x,y)`] to the origin [`(0,0)`] is given by the following equation: + +[```[$left] = [$right]```] + +Solve the equation for the coordinate [`y`]. Assume that [`y`] is positive. + +[@KeyboardInstructions('If you need to use a square root, type [|sqrt(23)|]* for [`\sqrt{23}`] (for example).')@]** + + [`y = `] [____________________]{$ans}. + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + + +To get rid of the square root, we square the left side and the right side of the equation. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left(r\right)^2 &= \left(\sqrt{x^2+y^2}\right)^2 \\ + r^2 &= x^2+y^2 \\ + r^2-x^2 &= x^2+y^2-x^2 \\ + r^2-x^2 &= y^2 \\ +\end{aligned} + ``] + +Now we take the square root on both sides: + [`` +\begin{aligned} + r^2-x^2 &= y^2 \\ + \pm\sqrt{r^2-x^2} &= \sqrt{y^2} \\ + \pm\sqrt{r^2-x^2} &= y \\ +\end{aligned} + ``] + +Since [`y`] is positive as stated in the problem, [`y=[$ans]`] is the solution when we solve [`[$left]=[$right]`] for [`y`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral110.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral110.pg new file mode 100644 index 0000000000..b82f0a75ff --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral110.pg @@ -0,0 +1,149 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# f = 1/(2pi*sqrt(LC)) solve for C +# +# +# Last updated: Spoddeck 12/8/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck") +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "bizarroArithmetic.pl", + "PGML.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->are(f=>'Real',L=>'Real',C=>'Real'); +Context()->operators->set( + '/' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '/ ' => {class => 'bizarro::BOP::divide', isCommand => 1}, + ' /' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '//' => {class => 'bizarro::BOP::divide', isCommand => 1}, + '*' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + '* ' => {class => 'bizarro::BOP::multiply', isCommand => 1}, + ' *' => {class => 'bizarro::BOP::multiply', isCommand => 1}); + +$left = Formula("f"); +$right = Formula("1/(2 pi sqrt(L C))"); + +$ans = Formula("1/(4 pi^2 L f^2)"); + + +############################################## + + +BEGIN_PGML + +In an electric circuit, resonance occurs when the frequency [`f`], inductance [`L`], and capacitance C fulfill the following equation: + +>>[``[$left] = [$right]``]<< + +Solve the equation for the capacitance [`C`]. + +The frequency is measured in Hertz, the inductance in Henry, and the capacitance in Farad. + +If you need to use a square root, type *sqrt(23)* for [`\sqrt{23}`] (for example). To enter [`\pi`], type *pi*. + + [`C = `] [____________________]. + +END_PGML + + +############################################## + + +ANS($ans -> cmp( + checker=>sub{ + my ( $correct, $student, $ansHash ) = @_; + Context()->flags->set(limits=>[0.95,1.05]); + return 0 if $ansHash->{isPreview} || $correct != $student; + $student = $ansHash->{student_formula}; + $correct = $correct->{original_formula} if defined $correct->{original_formula}; + $student = Formula("$student"); $correct = Formula("$correct"); + return 0 unless ($correct == $student); + Context()->flags->set(bizarroDiv=>1,bizarroMul=>1); + delete $correct->{test_values}, $student->{test_values}; + Context()->flags->set(limits=>[0.25,0.4]); + Value->Error("Your answer is correct, but please simplify it further") unless (($correct == $student) or ($student == $correct)); + Context()->flags->set(bizarroDiv=>0,bizarroMul=>0); + return 1; +} +)); + + +############################################## + + +BEGIN_PGML_SOLUTION + + +Since there is no addition or subtraction in this problem, we can square the equation at any point. We will do that again as our first step. So to get rid of the square root, we square the left side and the right side of the equation, using exponent rules to simplify. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left(f\right)^2 &= \left(\frac{1}{2\pi\sqrt{LC}}\right)^2 \\ + f^2 &= \frac{1}{4\pi^2LC} \\ +\end{aligned} + ``] + +In order to solve for [`C`], we need to get it out of the denominator by multiplying with [`C`] (which is also [`\frac{C}{1}`]) on both sides: + + [`` +\begin{aligned} + f^2 &= \frac{1}{4\pi^2LC} \\ + f^2\cdot C &= \frac{1}{4\pi^2LC}\cdot \frac{C}{1} \\ + f^2C &= \frac{1}{4\pi^2L} \\ +\end{aligned} + ``] + +Since we want to solve for [`C`], we need to divide by [`f^2`]. Since we have a fraction on the right side, we will multiply by the reciprocal of [`f^2`] instead. + + [`` +\begin{aligned} + f^2C &= \frac{1}{4\pi^2L} \\ + \frac{f^2C}{f^2} &= \frac{1}{4\pi^2L}\cdot \frac{1}{f^2} \\ + C &= \frac{1}{4\pi^2Lf^2} \\ +\end{aligned} + ``] + +So [`C=[$ans]`] is the solution when we solve [`[$left]=[$right]`] for [`C`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral112.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral112.pg new file mode 100644 index 0000000000..24d4af16b8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral112.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# f = 1/(2pi*sqrt(LC)) solve for L +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck") +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("LimitedRadical"); +Context()->variables->are(f=>'Real',L=>'Real',C=>'Real'); + +$left = Formula("f"); +$right = Formula("1/(2 pi sqrt(L C))"); + +$ans = Formula("1/(4 pi^2 C f^2)"); + + +############################################## + + +BEGIN_PGML + +In an electric circuit, resonance occurs when the frequency [`f`], inductance [`L`], and capacitance [`C`] fulfill the following equation: + +[```[$left] = [$right]```] + +Solve the equation for the inductance [`L`]. + +The frequency is measured in Hertz, the inductance in Henry, and the capacitance in Farad. + +[@KeyboardInstructions('If you need to use a square root, type [|sqrt(23)|]* for [`\sqrt{23}`] (for example).')@]** + + [`L = `] [____________________]{$ans}. + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + + +Since there is no addition or subtraction in this problem, we can square the equation at any point. We will do that again as our first step. So to get rid of the square root, we square the left side and the right side of the equation, using exponent rules to simplify. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left(f\right)^2 &= \left(\frac{1}{2\pi\sqrt{LC}}\right)^2 \\ + f^2 &= \frac{1}{4\pi^2LC} \\ +\end{aligned} + ``] + +In order to solve for [`L`], we need to get it out of the denominator by multiplying with [`L`] (which is also [`\frac{L}{1}`]) on both sides: + + [`` +\begin{aligned} + f^2 &= \frac{1}{4\pi^2LC} \\ + f^2\cdot L &= \frac{1}{4\pi^2LC}\cdot \frac{L}{1} \\ + f^2L &= \frac{1}{4\pi^2C} \\ +\end{aligned} + ``] + +Since we want to solve for [`L`], we need to divide by [`f^2`]. Since we have a fraction on the right side, we will multiply by the reciprocal of [`f^2`] instead. + + [`` +\begin{aligned} + f^2L &= \frac{1}{4\pi^2C} \\ + \frac{f^2L}{f^2} &= \frac{1}{4\pi^2C}\cdot \frac{1}{f^2} \\ + L &= \frac{1}{4\pi^2Cf^2} \\ +\end{aligned} + ``] + +So [`L=[$ans]`] is the solution when we solve [`[$left]=[$right]`] for [`L`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral120.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral120.pg new file mode 100644 index 0000000000..73bb0d3150 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral120.pg @@ -0,0 +1,120 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# T = 2pi*sqrt(L/32)) solve for L +# +# +# Last updated: Spoddeck 12/7/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck") +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("LimitedRadical"); +Context()->variables->are(T=>'Real',L=>'Real'); + +$left = Formula("T"); +$right = Formula("2 pi sqrt(L/32)"); + +$ans = Formula("8 T^2 / pi^2"); + + +############################################## + + +BEGIN_PGML + +A pendulum has the length [`L`]. The time period [`T`] that it takes to once swing back and forth can be found with the following formula: + +[```[$left] = [$right]```] + +Solve the equation for the length [`L`]. + +The length is measured in feet and the time period in seconds. + +[@KeyboardInstructions('If you need to use a square root, type [|sqrt(23)|]* for [`\sqrt{23}`] (for example).')@]** + + [`L = `] [____________________]{$ans}. + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + + +Since there is no addition or subtraction in this problem, we can square the equation at any point. We will do that again as our first step. So to get rid of the square root, we square the left side and the right side of the equation, using exponent rules to simplify. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left(T\right)^2 &= \left(2\pi\sqrt{\frac{L}{32}}\right)^2 \\ + T^2 &= 4\pi^2\frac{L}{32} \\ +\end{aligned} + ``] + +In order to solve for [`L`], we need to move everything else to the other side using algebra: + + [`` +\begin{aligned} + T^2 &= 4\pi^2\frac{L}{32} \\ + T^2\cdot 32 &= 4\pi^2\frac{L}{32}\cdot \frac{32}{1} \\ + 32T^2 &= 4\pi^2L \\ +\end{aligned} + ``] + +Since we want to solve for [`L`], we need to divide by [`4\pi^2`]. + + [`` +\begin{aligned} + 32T^2 &= 4\pi^2L \\ + \frac{32T^2}{4\pi^2} &= \frac{4\pi^2L}{4\pi^2} \\ + \frac{8T^2}{\pi^2} &= L \\ +\end{aligned} + ``] + +So [`L=[$ans]`] is the solution when we solve [`[$left]=[$right]`] for [`L`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral90.pg b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral90.pg new file mode 100644 index 0000000000..51a41ecb95 --- /dev/null +++ b/OpenProblemLibrary/PCC/Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral90.pg @@ -0,0 +1,109 @@ +# WeBWorK problem written by Heiko Spoddeck +# Portland Community College +# +# Template: +# Solve the following radical equation +# +# c = sqrt(a^2+b^2) solve for a +# +# +# Last updated: Spoddeck 12/22/15 +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan', 'Heiko Spoddeck") +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + + +############################################## + + +TEXT(beginproblem()); + +Context("LimitedRadical"); +Context()->variables->are(a=>'Real',b=>'Real',c=>'Real'); + +$left = Formula("c"); +$right = Formula("sqrt(a^2+b^2)"); + +$ans = Formula("sqrt(c^2-b^2)"); + + +############################################## + + +BEGIN_PGML + +According to the Pythagorean Theorem, the length [`c`] of the hypothenuse of a rectangular triangle can be found through the following equation: + +[```[$left] = [$right]```] + +Solve the equation for the length [`a`] of one of the triangle's legs. + +[@KeyboardInstructions('If you need to use a square root, type [|sqrt(23)|]* for [`\sqrt{23}`] (for example).')@]** + + [`a = `] [____________________]{$ans}. + +END_PGML + + +############################################## + + +BEGIN_PGML_SOLUTION + + +To get rid of the square root, we square the left side and the right side of the equation. + + [`` +\begin{aligned} + [$left] &= [$right] \\ + \left(c\right)^2 &= \left(\sqrt{a^2+b^2}\right)^2 \\ + c^2 &= a^2+b^2 \\ + c^2-b^2 &= a^2+b^2-b^2 \\ + c^2-b^2 &= a^2 \\ +\end{aligned} + ``] + +Now we take the square root on both sides: + [`` +\begin{aligned} + c^2-b^2 &= a^2 \\ + \pm\sqrt{c^2-b^2} &= \sqrt{a^2} \\ + \pm\sqrt{c^2-b^2} &= a \\ +\end{aligned} + ``] + +[`a`] is positive since it is a length. Therefore, [`a=[$ans]`] is the solution when we solve [`[$left]=[$right]`] for [`a`]. + +END_PGML_SOLUTION + + +############################################## + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setAbsolute_Value.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setAbsolute_Value.def new file mode 100644 index 0000000000..d24431c409 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setAbsolute_Value.def @@ -0,0 +1,12 @@ + +openDate = 12/11/2013 at 12:12am PST +dueDate = 06/30/2014 at 01:06am PDT +answerDate = 06/30/2014 at 01:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AbsoluteValue.pg +description = basic absolute value calculations +problemList = +BasicAlgebra/NumberBasics/AbsoluteValue10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setAccount_Interest_Word_Problems.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setAccount_Interest_Word_Problems.def new file mode 100644 index 0000000000..567cc4e823 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setAccount_Interest_Word_Problems.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 01:28am PST +dueDate = 06/30/2014 at 02:38am PDT +answerDate = 06/30/2014 at 02:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AccountInterestWordProblems.pg +description = word problems involving accounts earning a net interest rate +problemList = +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setAdd_Subtract_Fractions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setAdd_Subtract_Fractions.def new file mode 100644 index 0000000000..f21431ff96 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setAdd_Subtract_Fractions.def @@ -0,0 +1,42 @@ + +openDate = 12/11/2013 at 12:06am PST +dueDate = 06/30/2014 at 01:03am PDT +answerDate = 06/30/2014 at 01:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AddSubtractFractions.pg +description = adding and subtracting fractions +problemList = +BasicAlgebra/FractionArithmetic/AddFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions04.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions08.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions09.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions12.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions22.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions24.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions26.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions01.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions05.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions90.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions90.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions100.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def new file mode 100644 index 0000000000..479a1ee2ac --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def @@ -0,0 +1,38 @@ + +openDate = 12/11/2013 at 12:42am PST +dueDate = 06/30/2014 at 01:44am PDT +answerDate = 06/30/2014 at 01:44am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicPercentageWordProblems.pg +description = percent and decimal conversion; percent calculations +problemList = +BasicAlgebra/NumberBasics/PercentDecimalConversion10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber110.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber120.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber90.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber100.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setBasic_Word_Problems.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setBasic_Word_Problems.def new file mode 100644 index 0000000000..2b1d8035de --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setBasic_Word_Problems.def @@ -0,0 +1,35 @@ + +openDate = 12/11/2013 at 12:36am PST +dueDate = 06/30/2014 at 01:40am PDT +answerDate = 06/30/2014 at 01:40am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicWordProblems.pg +description = translating English to math equations; solving some basic word problems +problemList = +BasicAlgebra/EnglishToMath/EnglishToMathEquation10.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation20.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation30.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation40.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation50.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation60.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation70.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation80.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation90.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation100.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation110.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation120.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation130.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation140.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation150.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation160.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation170.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation180.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation30.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation40.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setCoordinate_System.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setCoordinate_System.def new file mode 100644 index 0000000000..72a8c5a5dd --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setCoordinate_System.def @@ -0,0 +1,14 @@ + +openDate = 12/11/2013 at 01:00am PST +dueDate = 06/30/2014 at 02:10am PDT +answerDate = 06/30/2014 at 02:10am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/CoordinateSystem.pg +description = the basics of the Cartesian coordinate system +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/Quadrant10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setDistance_Word_Problems.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setDistance_Word_Problems.def new file mode 100644 index 0000000000..28b4367034 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setDistance_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 01:26am PST +dueDate = 06/30/2014 at 02:37am PDT +answerDate = 06/30/2014 at 02:37am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/DistanceWordProblems.pg +description = word problems involving distance traveled +problemList = +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setEvaluating_Expressions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setEvaluating_Expressions.def new file mode 100644 index 0000000000..4dcf1a4cda --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setEvaluating_Expressions.def @@ -0,0 +1,27 @@ + +openDate = 12/11/2013 at 12:02am PST +dueDate = 06/30/2014 at 01:01am PDT +answerDate = 06/30/2014 at 01:01am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/EvaluatingExpressions.pg +description = evaluating symbols in mathematical expressions +problemList = +BasicAlgebra/EvaluateExpressions/evaluate10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate12.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate15.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate18.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate20.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate50.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate60.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate80.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate90.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar0.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar5.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluateInContext10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluateInContext20.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/FahrenheitCelsius10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula40.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setExponent_Basics.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setExponent_Basics.def new file mode 100644 index 0000000000..1451106031 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setExponent_Basics.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 12:18am PST +dueDate = 06/30/2014 at 01:14am PDT +answerDate = 06/30/2014 at 01:14am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentBasics.pg +description = the basics of exponents +problemList = +BasicAlgebra/Exponents/ExponentDefinition10.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition20.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setExponent_Rules.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setExponent_Rules.def new file mode 100644 index 0000000000..10b72c3844 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setExponent_Rules.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:20am PST +dueDate = 06/30/2014 at 01:16am PDT +answerDate = 06/30/2014 at 01:16am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentRules.pg +description = the rules of working with exponents +problemList = +BasicAlgebra/Exponents/exponentsMultiplication10.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication09.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication0.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication15.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication20.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication23.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication24.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Graph.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Graph.def new file mode 100644 index 0000000000..8e8987a989 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Graph.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 01:12am PST +dueDate = 06/30/2014 at 02:22am PDT +answerDate = 06/30/2014 at 02:22am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByGraph.pg +description = using a grpah to identify the equation of a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def new file mode 100644 index 0000000000..a17e032d8a --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 01:14am PST +dueDate = 06/30/2014 at 02:24am PDT +answerDate = 06/30/2014 at 02:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByPointSlope.pg +description = use information about a point and slope to find an equation of a line +problemList = +BasicAlgebra/PointSlopeForm/PointSlopeBasics10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeBasics20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeBasics30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept40.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation40.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation50.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Two_Points.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Two_Points.def new file mode 100644 index 0000000000..d706a91dc2 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFind_Equation_by_Two_Points.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 01:16am PST +dueDate = 06/30/2014 at 02:26am PDT +answerDate = 06/30/2014 at 02:26am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByTwoPoints.pg +description = use information about two points to find an equation for a line +problemList = +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation35.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFunctions_Intro.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFunctions_Intro.def new file mode 100644 index 0000000000..15afffba4f --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setFunctions_Intro.def @@ -0,0 +1,28 @@ +openDate = 12/11/2013 at 01:24am PST +dueDate = 06/30/2014 at 02:36am PDT +answerDate = 06/30/2014 at 02:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FunctionsIntro.pg +description = an introduction to functions +problemList = +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setGraph_Lines_by_Table.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setGraph_Lines_by_Table.def new file mode 100644 index 0000000000..cec8e9661b --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setGraph_Lines_by_Table.def @@ -0,0 +1,29 @@ + +openDate = 12/11/2013 at 01:02am PST +dueDate = 06/30/2014 at 02:12am PDT +answerDate = 06/30/2014 at 02:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphLineByTable.pg +description = graphing lines by making a table of values; checking if a point is on a line +problemList = +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable20.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine110.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot30.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot150.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def new file mode 100644 index 0000000000..45c26f1206 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def @@ -0,0 +1,26 @@ + +openDate = 12/11/2013 at 01:22am PST +dueDate = 06/30/2014 at 02:34am PDT +answerDate = 06/30/2014 at 02:34am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphTwoVariableInequalities.pg +description = inequalities in two variables +problemList = +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot70.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot90.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setGraphing_Line_Summary.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setGraphing_Line_Summary.def new file mode 100644 index 0000000000..540c4ec403 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setGraphing_Line_Summary.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 01:10am PST +dueDate = 06/30/2014 at 02:20am PDT +answerDate = 06/30/2014 at 02:20am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphingLineSummary.pg +description = a summary of techniques that can be used to graph a line from its equation +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setInequality_Applications.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setInequality_Applications.def new file mode 100644 index 0000000000..eee2160463 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setInequality_Applications.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 12:58am PST +dueDate = 06/30/2014 at 01:52am PDT +answerDate = 06/30/2014 at 01:52am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/InequalityApplications.pg +description = applications of inequalities +problemList = +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setInteger_Operations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setInteger_Operations.def new file mode 100644 index 0000000000..2ec3e34279 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setInteger_Operations.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 12:16am PST +dueDate = 06/30/2014 at 01:08am PDT +answerDate = 06/30/2014 at 01:08am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/IntegerOperations.pg +description = multiplying, dividing, adding, and subtracting with both positive and negative integers +problemList = +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/SignedNumberInterpretations10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setLinear_Equation_Applications.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setLinear_Equation_Applications.def new file mode 100644 index 0000000000..b378ac9e07 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setLinear_Equation_Applications.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 01:18am PST +dueDate = 06/30/2014 at 02:30am PDT +answerDate = 06/30/2014 at 02:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/LinearEquationApplications.pg +description = applications of finding equations of lines +problemList = +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication80.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def new file mode 100644 index 0000000000..e928bef3ed --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 12:04am PST +dueDate = 06/30/2014 at 01:02am PDT +answerDate = 06/30/2014 at 01:02am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixedNumbersEquivalentFractions.pg +description = translating between mixed numbers and improper fractions; reducing fractions +problemList = +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction05.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction30.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setMixture_Word_Problems.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setMixture_Word_Problems.def new file mode 100644 index 0000000000..dbda55cc4f --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setMixture_Word_Problems.def @@ -0,0 +1,19 @@ + +openDate = 12/11/2013 at 01:30am PST +dueDate = 06/30/2014 at 02:39am PDT +answerDate = 06/30/2014 at 02:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixtureWordProblems.pg +description = word problems involving mixtures of solutions or populations +problemList = +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setMultiply_Divide_Fractions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setMultiply_Divide_Fractions.def new file mode 100644 index 0000000000..984edc6dbb --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setMultiply_Divide_Fractions.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:08am PST +dueDate = 06/30/2014 at 01:04am PDT +answerDate = 06/30/2014 at 01:04am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MultiplyDivideFractions.pg +description = multiplying and dividing with fractions +problemList = +BasicAlgebra/FractionArithmetic/MultiplyFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setNumber_Sets.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setNumber_Sets.def new file mode 100644 index 0000000000..076f2c2bec --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setNumber_Sets.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 12:10am PST +dueDate = 06/30/2014 at 01:05am PDT +answerDate = 06/30/2014 at 01:05am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/NumberSets.pg +description = identifying types of numbers; using number lines +problemList = +BasicAlgebra/NumberBasics/TypesOfNumbers10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setOrder_of_Operations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setOrder_of_Operations.def new file mode 100644 index 0000000000..e4ac385610 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setOrder_of_Operations.def @@ -0,0 +1,39 @@ + +openDate = 12/11/2013 at 12:22am PST +dueDate = 06/30/2014 at 01:18am PDT +answerDate = 06/30/2014 at 01:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/OrderOfOperations.pg +description = using the order of operations +problemList = +BasicAlgebra/OrderOfOperations/orderOfOperations10.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations20.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations30.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations40.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations50.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations60.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations70.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations80.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations90.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations100.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations110.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations120.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations140.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations130.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations150.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations160.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations170.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations180.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations190.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations230.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations200.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations210.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations220.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations240.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations250.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/OOOFractions10.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations260.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations270.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations280.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations290.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setParallel_Perpendicular_Lines.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setParallel_Perpendicular_Lines.def new file mode 100644 index 0000000000..6716f9f757 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setParallel_Perpendicular_Lines.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 01:20am PST +dueDate = 06/30/2014 at 02:32am PDT +answerDate = 06/30/2014 at 02:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ParallelPerpendicularLines.pg +description = questions regarding parallel or perpendicular pairs of lines and their slopes +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular90.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular100.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular110.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular120.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular130.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular140.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular150.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular160.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular170.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular180.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular190.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular200.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular210.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setPercent_of_Increase_Decrease.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setPercent_of_Increase_Decrease.def new file mode 100644 index 0000000000..1ea63d363f --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setPercent_of_Increase_Decrease.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 12:44am PST +dueDate = 06/30/2014 at 01:45am PDT +answerDate = 06/30/2014 at 01:45am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/PercentOfIncreaseDecrease.pg +description = calculating the percent increase or decrease of a change +problemList = +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setPerimeter_and_Area.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setPerimeter_and_Area.def new file mode 100644 index 0000000000..e2233ccacf --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setPerimeter_and_Area.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:46am PST +dueDate = 06/30/2014 at 01:46am PDT +answerDate = 06/30/2014 at 01:46am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/PerimeterArea.pg +description = questions about the areas and perimeters of basic two-dimensional shapes +problemList = +BasicAlgebra/Geometry/RectanglePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea40.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea40.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea50.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setProportion_Word_Problems.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setProportion_Word_Problems.def new file mode 100644 index 0000000000..7082c491b0 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setProportion_Word_Problems.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 12:52am PST +dueDate = 06/30/2014 at 01:49am PDT +answerDate = 06/30/2014 at 01:49am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ProportionWordProblems.pg +description = word problems that involve a proportional equation +problemList = +BasicAlgebra/LinearEquationApplications/ProportionWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem90.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem100.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem110.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem120.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def new file mode 100644 index 0000000000..6e10a82e6e --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 12:40am PST +dueDate = 06/30/2014 at 01:43am PDT +answerDate = 06/30/2014 at 01:43am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/RateAndStartValueWordProblem.pg +description = word problems involving an initial value that cahnges with a fixed rate +problemList = +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSimplify_Expressions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSimplify_Expressions.def new file mode 100644 index 0000000000..8cee679e94 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSimplify_Expressions.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 12:14am PST +dueDate = 06/30/2014 at 01:07am PDT +answerDate = 06/30/2014 at 01:07am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SimplifyExpressions.pg +description = simplifying expressions +problemList = +BasicAlgebra/PolynomialBasics/SimplifyExpression10.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression30.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty10.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty20.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty30.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty40.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty50.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty60.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty70.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty80.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty90.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/SimplifyInContext10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSlope.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSlope.def new file mode 100644 index 0000000000..5af94ddb27 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSlope.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 01:04am PST +dueDate = 06/30/2014 at 02:14am PDT +answerDate = 06/30/2014 at 02:14am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Slope.pg +description = using a graph to compute slope; using the slope formula to compute slope +problemList = +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSlope_Intercept_Equations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSlope_Intercept_Equations.def new file mode 100644 index 0000000000..03f0a00beb --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSlope_Intercept_Equations.def @@ -0,0 +1,27 @@ + +openDate = 12/11/2013 at 01:06am PST +dueDate = 06/30/2014 at 02:16am PDT +answerDate = 06/30/2014 at 02:16am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SlopeInterceptEquation.pg +description = find the slope and y-intercept of a line; use the point-slope form to garph a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept90.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Equations_with_Fractions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Equations_with_Fractions.def new file mode 100644 index 0000000000..dc490db970 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Equations_with_Fractions.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 12:32am PST +dueDate = 06/30/2014 at 01:36am PDT +answerDate = 06/30/2014 at 01:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveEquationsWithFractions.pg +description = solving linear equations that involve fractions +problemList = +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction05.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction290.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction300.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction310.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction210.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction220.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction240.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction260.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction270.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Inequalities.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Inequalities.def new file mode 100644 index 0000000000..296618b649 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Inequalities.def @@ -0,0 +1,45 @@ + +openDate = 12/11/2013 at 12:54am PST +dueDate = 06/30/2014 at 01:50am PDT +answerDate = 06/30/2014 at 01:50am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveInequalities.pg +description = set-builder and interval notation; solving linear inequalities +problemList = +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation110.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality150.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality180.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality200.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality220.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality260.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality280.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality320.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Multi_Step_Equations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Multi_Step_Equations.def new file mode 100644 index 0000000000..c8d08d623e --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Multi_Step_Equations.def @@ -0,0 +1,35 @@ + +openDate = 12/11/2013 at 12:28am PST +dueDate = 06/30/2014 at 01:32am PDT +answerDate = 06/30/2014 at 01:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveMultiStepEquations.pg +description = solving linear equations that may require multiple steps +problemList = +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses200.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_One_Step_Equations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_One_Step_Equations.def new file mode 100644 index 0000000000..054ba50db2 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_One_Step_Equations.def @@ -0,0 +1,52 @@ + +openDate = 12/11/2013 at 12:24am PST +dueDate = 06/30/2014 at 01:26am PDT +answerDate = 06/30/2014 at 01:26am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveOneStepEquation.pg +description = solving equations that only require one step to solve +problemList = +BasicAlgebra/VerifySolutionsOneVariable/solutionQ10.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ20.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ30.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ40.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ50.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ60.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ70.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv190.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Proportions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Proportions.def new file mode 100644 index 0000000000..e10430de0d --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Proportions.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:50am PST +dueDate = 06/30/2014 at 01:48am PDT +answerDate = 06/30/2014 at 01:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveProportions.pg +description = solving proporiton equations +problemList = +BasicAlgebra/SolveLinearEquations/SolveProportion10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Two-Step_Equations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Two-Step_Equations.def new file mode 100644 index 0000000000..d261d00360 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_Two-Step_Equations.def @@ -0,0 +1,19 @@ + +openDate = 12/11/2013 at 12:26am PST +dueDate = 06/30/2014 at 01:30am PDT +answerDate = 06/30/2014 at 01:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveTwoStepEquations.pg +description = solving equations that require two steps to solve +problemList = +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps130.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_for_Variable.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_for_Variable.def new file mode 100644 index 0000000000..eccdea6c6b --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSolve_for_Variable.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 12:34am PST +dueDate = 06/30/2014 at 01:38am PDT +answerDate = 06/30/2014 at 01:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveForVariable.pg +description = symbolically solving a linear equation to isolate a variable +problemList = +BasicAlgebra/SolveLinearEquations/LiteralEquation10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation190.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation210.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSpecial_Case_Inequalities.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSpecial_Case_Inequalities.def new file mode 100644 index 0000000000..75f08f8146 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSpecial_Case_Inequalities.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:56am PST +dueDate = 06/30/2014 at 01:51am PDT +answerDate = 06/30/2014 at 01:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialCaseInequalities.pg +description = linear inequalities that may have something special about them +problemList = +BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSpecial_Solutions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSpecial_Solutions.def new file mode 100644 index 0000000000..0ed77f524d --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSpecial_Solutions.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:30am PST +dueDate = 06/30/2014 at 01:34am PDT +answerDate = 06/30/2014 at 01:34am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialSolutions.pg +description = linear equations that may have something special about them +problemList = +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation70.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setStandard_Form_Equations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setStandard_Form_Equations.def new file mode 100644 index 0000000000..de8c027e91 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setStandard_Form_Equations.def @@ -0,0 +1,47 @@ + +openDate = 12/11/2013 at 01:08am PST +dueDate = 06/30/2014 at 02:18am PDT +answerDate = 06/30/2014 at 02:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/StandardFormEquations.pg +description = find the slope and y-intercept of a line; find a line's x- and y-intercepts; use intercepts to graph a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept110.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept120.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept130.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept140.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept150.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept160.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept170.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept180.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept190.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept200.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts150.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts130.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSum_and_Part_Word_Problems.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSum_and_Part_Word_Problems.def new file mode 100644 index 0000000000..b8d9aae6bc --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setSum_and_Part_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 12:38am PST +dueDate = 06/30/2014 at 01:42am PDT +answerDate = 06/30/2014 at 01:42am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SumAndPartWordProblems.pg +description = solving word problems involving two numbers that combine in some way +problemList = +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setTranslating_Words_into_Algebra.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setTranslating_Words_into_Algebra.def new file mode 100644 index 0000000000..1dc609ee0c --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setTranslating_Words_into_Algebra.def @@ -0,0 +1,31 @@ +openDate = 12/11/2013 at 12:00am PST +dueDate = 06/30/2014 at 01:00am PDT +answerDate = 06/30/2014 at 01:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/TranslatingWordsIntoAlgebra.pg +description = translating English into algebra +problemList = +BasicAlgebra/EnglishToMath/englishToMath10.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath20.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath25.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath30.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath40.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath45.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath50.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath55.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath60.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath70.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath140.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath150.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath160.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath170.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath80.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath82.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath84.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath90.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath100.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath110.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath120.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath130.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath180.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setTrigonometry.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setTrigonometry.def new file mode 100644 index 0000000000..ded9435294 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setTrigonometry.def @@ -0,0 +1,13 @@ +openDate = 12/11/2013 at 12:48am PST +dueDate = 06/30/2014 at 02:38am PDT +answerDate = 06/30/2014 at 02:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Trigonometry.pg +description = questions about the definition of trigonometry ratios (sine, cosine and tangent) +problemList = +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setVolume.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setVolume.def new file mode 100644 index 0000000000..a35af66f6f --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH060/setVolume.def @@ -0,0 +1,16 @@ + +openDate = 12/11/2013 at 12:48am PST +dueDate = 06/30/2014 at 01:47am PDT +answerDate = 06/30/2014 at 01:47am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Volume.pg +description = questions about the volumes of prisms and cylinders +problemList = +BasicAlgebra/Geometry/RectangularPrismVolume10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectangularPrismVolume20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectangularPrismVolume30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume10.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume20.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setAdd_Subtract_Polynomials.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setAdd_Subtract_Polynomials.def new file mode 100644 index 0000000000..445d55a7e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setAdd_Subtract_Polynomials.def @@ -0,0 +1,26 @@ + +openDate = 12/11/2013 at 02:44am PST +dueDate = 06/30/2014 at 03:21am PDT +answerDate = 06/30/2014 at 03:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/AddSubtractPolynomials.pg +description = adding and subtracting polynomial expressions +problemList = +BasicAlgebra/PolynomialBasics/PolyAddSubtract0.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract5.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract10.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract15.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression30.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract25.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract35.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract85.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract90.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract95.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract100.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar25.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setDivide_Polynomials.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setDivide_Polynomials.def new file mode 100644 index 0000000000..11c2f3a665 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setDivide_Polynomials.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 02:48am PST +dueDate = 06/30/2014 at 03:30am PDT +answerDate = 06/30/2014 at 03:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/DividePolynomials.pg +description = division of polynomials by a monomial +problemList = +BasicAlgebra/Exponents/exponentDivision105.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision100.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision125.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision120.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision130.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision135.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision140.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision150.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setExponent_Review.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setExponent_Review.def new file mode 100644 index 0000000000..93c938dfcd --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setExponent_Review.def @@ -0,0 +1,31 @@ +openDate = 12/11/2013 at 02:42am PST +dueDate = 06/30/2014 at 03:15am PDT +answerDate = 06/30/2014 at 03:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ExponentReview.pg +description = rules of working with exponents +problemList = +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication20.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication50.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision75.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision70.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision60.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision105.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision100.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision50.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision80.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision10.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision0.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision15.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication35.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_Special_Polynomials.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_Special_Polynomials.def new file mode 100644 index 0000000000..18ace46835 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_Special_Polynomials.def @@ -0,0 +1,33 @@ + +openDate = 12/11/2013 at 03:02am PST +dueDate = 06/30/2014 at 03:45am PDT +answerDate = 06/30/2014 at 03:45am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorSpecialPolynomials.pg +description = factoring special polynomials where a special form can be applied +problemList = +BasicAlgebra/Factoring/factoring445.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring450.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring455.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring460.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring465.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring470.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring475.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring480.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring485.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring490.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring495.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring500.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring505.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring520.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring525.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring530.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring535.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring540.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring555.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring560.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring590.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring595.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring600.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring615.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def new file mode 100644 index 0000000000..a00b17d07f --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def @@ -0,0 +1,29 @@ +openDate = 12/11/2013 at 02:58am PST +dueDate = 06/30/2014 at 03:39am PDT +answerDate = 06/30/2014 at 03:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialWhenAIs1.pg +description = factoring trinomials with a leading coefficient of 1 +problemList = +BasicAlgebra/Factoring/factoring170.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring175.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring180.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring170.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring175.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring180.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring355.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring360.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring365.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring370.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring360.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring365.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring370.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring375.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring385.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring390.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring400.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring405.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring410.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring415.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring420.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def new file mode 100644 index 0000000000..6a96d03b04 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:00am PST +dueDate = 06/30/2014 at 03:42am PDT +answerDate = 06/30/2014 at 03:42am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialsWhenAIsNot1.pg +description = factoring trinomials whose leading coefficient is not 1 +problemList = +BasicAlgebra/Factoring/factoring185.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring190.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring195.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring200.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring205.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring210.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring235.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring240.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring245.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring280.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring285.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring295.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring325.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_by_Grouping.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_by_Grouping.def new file mode 100644 index 0000000000..a5d05392d2 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_by_Grouping.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 02:56am PST +dueDate = 06/30/2014 at 03:36am PDT +answerDate = 06/30/2014 at 03:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorByGrouping.pg +description = factoring polynomials using the grouping technique +problemList = +BasicAlgebra/Factoring/factoring105.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring110.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring115.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring120.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring125.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring130.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring135.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring140.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring150.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring120.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring125.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring135.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring140.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring150.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_out_Common_Factors.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_out_Common_Factors.def new file mode 100644 index 0000000000..adcd221338 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFactor_out_Common_Factors.def @@ -0,0 +1,28 @@ + +openDate = 12/11/2013 at 02:54am PST +dueDate = 06/30/2014 at 03:33am PDT +answerDate = 06/30/2014 at 03:33am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorOutCommonFactors.pg +description = factoring out the greatest common factor +problemList = +BasicAlgebra/Factoring/factoring5.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring10.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring15.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring20.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring25.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring30.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring36.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring37.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring38.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring41.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring56.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring71.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring76.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring77.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring80.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring85.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring90.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring95.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring100.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFalling_Object_Applications.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFalling_Object_Applications.def new file mode 100644 index 0000000000..5136393b3d --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFalling_Object_Applications.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:36am PST +dueDate = 06/30/2014 at 04:36am PDT +answerDate = 06/30/2014 at 04:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FallingObjectApplications.pg +description = applications of quadratic expressions to falling objects +problemList = +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFunctions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFunctions.def new file mode 100644 index 0000000000..4c3b2a8714 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setFunctions.def @@ -0,0 +1,29 @@ + +openDate = 12/11/2013 at 03:38am PST +dueDate = 06/30/2014 at 04:37am PDT +answerDate = 06/30/2014 at 04:37am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/Functions.pg +description = introduction to functions +problemList = +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setIntroduction_to_Square_Root.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setIntroduction_to_Square_Root.def new file mode 100644 index 0000000000..7f12438bf9 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setIntroduction_to_Square_Root.def @@ -0,0 +1,16 @@ + +openDate = 12/11/2013 at 03:04am PST +dueDate = 06/30/2014 at 03:48am PDT +answerDate = 06/30/2014 at 03:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/IntroductionToSquareRoot.pg +description = evaluating square roots +problemList = +BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setMaximum_Minimum_Applications.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setMaximum_Minimum_Applications.def new file mode 100644 index 0000000000..cb7a7aa3c0 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setMaximum_Minimum_Applications.def @@ -0,0 +1,14 @@ + +openDate = 12/11/2013 at 03:34am PST +dueDate = 06/30/2014 at 04:33am PDT +answerDate = 06/30/2014 at 04:33am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MaximumMinimumApplications.pg +description = applications of quadratic expressions to finding a maximal or minimal value +problemList = +BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setMoving_Parabola_Up_Down.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setMoving_Parabola_Up_Down.def new file mode 100644 index 0000000000..bf99a3b23e --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setMoving_Parabola_Up_Down.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 03:20am PST +dueDate = 06/30/2014 at 04:12am PDT +answerDate = 06/30/2014 at 04:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MovingParabolaUpDown.pg +description = shifting a parabola up and down +problemList = +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setMultiplying_Polynomials.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setMultiplying_Polynomials.def new file mode 100644 index 0000000000..2bbc293875 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setMultiplying_Polynomials.def @@ -0,0 +1,41 @@ + +openDate = 12/11/2013 at 02:46am PST +dueDate = 06/30/2014 at 03:24am PDT +answerDate = 06/30/2014 at 03:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MultiplyingPolynomials.pg +description = multiplication of polynomial expressions +problemList = +BasicAlgebra/PolynomialMultiplication/polyMultVar60.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication0.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication5.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication10.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication15.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication20.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication30.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication35.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication40.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication45.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication50.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication55.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication60.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication65.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication70.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication75.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication80.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication160.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication165.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication170.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication175.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication185.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication190.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication195.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication200.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication205.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication210.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication225.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar100.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar135.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar160.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setNegative_Exponents.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setNegative_Exponents.def new file mode 100644 index 0000000000..637b215a32 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setNegative_Exponents.def @@ -0,0 +1,32 @@ + +openDate = 12/11/2013 at 02:50am PST +dueDate = 06/30/2014 at 03:31am PDT +answerDate = 06/30/2014 at 03:31am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/NegativeExponents.pg +description = practice working with negative exponents +problemList = +BasicAlgebra/Exponents/negExp75.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp90.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp60.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp85.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp65.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp70.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp10.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp45.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp50.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp20.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp25.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp5.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp0.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp55.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp41.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp100.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp105.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp110.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp115.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp120.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp135.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp150.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp155.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Axis_and_Vertex.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Axis_and_Vertex.def new file mode 100644 index 0000000000..53c889ea00 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Axis_and_Vertex.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 03:28am PST +dueDate = 06/30/2014 at 04:24am PDT +answerDate = 06/30/2014 at 04:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaAxisAndVertex.pg +description = identifying the vertex and axis of symmetry of a parabola +problemList = +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Intercepts.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Intercepts.def new file mode 100644 index 0000000000..0a96aa5d43 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Intercepts.def @@ -0,0 +1,33 @@ + +openDate = 12/11/2013 at 03:30am PST +dueDate = 06/30/2014 at 04:27am PDT +answerDate = 06/30/2014 at 04:27am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaIntercepts.pg +description = identifying the intercepts of a parabola +problemList = +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts115.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts150.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts170.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts180.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts190.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts210.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts220.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts230.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Movement_Summary.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Movement_Summary.def new file mode 100644 index 0000000000..ce70d11632 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Movement_Summary.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 03:26am PST +dueDate = 06/30/2014 at 04:21am PDT +answerDate = 06/30/2014 at 04:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaMovementSummary.pg +description = summary of graph transformations to a parabola +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Shifting_Left_Right.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Shifting_Left_Right.def new file mode 100644 index 0000000000..682473e4e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Shifting_Left_Right.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:24am PST +dueDate = 06/30/2014 at 04:18am PDT +answerDate = 06/30/2014 at 04:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaShiftingLeftRight.pg +description = shifting a parabola left or right +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Thinner_Wider.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Thinner_Wider.def new file mode 100644 index 0000000000..d3d29c9400 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setParabola_Thinner_Wider.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:22am PST +dueDate = 06/30/2014 at 04:15am PDT +answerDate = 06/30/2014 at 04:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaThinnerWider.pg +description = stretching a parabola vertically to make it appear thinner +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setQuadratic_Equation_Applications.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setQuadratic_Equation_Applications.def new file mode 100644 index 0000000000..0f58ce13dc --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setQuadratic_Equation_Applications.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 03:18am PST +dueDate = 06/30/2014 at 04:09am PDT +answerDate = 06/30/2014 at 04:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/QuadraticEquationApplications.pg +description = applications of quadratic equations +problemList = +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setRationalize_Denominator.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setRationalize_Denominator.def new file mode 100644 index 0000000000..c005bd45ce --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setRationalize_Denominator.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:10am PST +dueDate = 06/30/2014 at 03:57am PDT +answerDate = 06/30/2014 at 03:57am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/RationalizeDenominator.pg +description = rationalizing the denominator of a radical expression +problemList = +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator110.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setReview_Graphing_Lines.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setReview_Graphing_Lines.def new file mode 100644 index 0000000000..aee0c2126d --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setReview_Graphing_Lines.def @@ -0,0 +1,22 @@ +openDate = 12/11/2013 at 02:32am PST +dueDate = 06/30/2014 at 03:00am PDT +answerDate = 06/30/2014 at 03:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ReviewGraphingLines.pg +description = review of graphing lines +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setScientific_Notation.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setScientific_Notation.def new file mode 100644 index 0000000000..bfbf62dabc --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setScientific_Notation.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 02:52am PST +dueDate = 06/30/2014 at 03:32am PDT +answerDate = 06/30/2014 at 03:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ScientificNotation.pg +description = practice using scientific notation +problemList = +BasicAlgebra/NumberBasics/ScientificNotation10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation90.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation100.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation110.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation120.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSimplify_Square_Roots.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSimplify_Square_Roots.def new file mode 100644 index 0000000000..74d5cfc36c --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSimplify_Square_Roots.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 03:06am PST +dueDate = 06/30/2014 at 03:51am PDT +answerDate = 06/30/2014 at 03:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SimplifySquareRoots.pg +description = simplifying expressions with square roots +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSketching_Parabolas.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSketching_Parabolas.def new file mode 100644 index 0000000000..27bd59b81c --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSketching_Parabolas.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 03:32am PST +dueDate = 06/30/2014 at 04:30am PDT +answerDate = 06/30/2014 at 04:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SketchingParabolas.pg +description = sketching the graph of a quadratic expression +problemList = +BasicAlgebra/GraphingQuadratics/SketchParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def new file mode 100644 index 0000000000..c1019c39e7 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def @@ -0,0 +1,34 @@ + +openDate = 12/11/2013 at 03:14am PST +dueDate = 06/30/2014 at 04:03am PDT +answerDate = 06/30/2014 at 04:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByFactoring.pg +description = solve a quadratic equation by factoring +problemList = +BasicAlgebra/QuadraticEquations/solveQuad95.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad230.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad220.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad235.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad240.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad250.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad255.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad265.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad210.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad215.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad270.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad280.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad285.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad290.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad295.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad105.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad200.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad300.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad305.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad325.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad330.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad335.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad340.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def new file mode 100644 index 0000000000..bfe9283033 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 03:16am PST +dueDate = 06/30/2014 at 04:06am PDT +answerDate = 06/30/2014 at 04:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByQuadraticFormula.pg +description = solve a quadratic equation using the quadratic formula +problemList = +BasicAlgebra/QuadraticEquations/solveQuad145.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad150.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad155.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad185.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad375.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad380.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad385.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def new file mode 100644 index 0000000000..4e04c67950 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:12am PST +dueDate = 06/30/2014 at 04:00am PDT +answerDate = 06/30/2014 at 04:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationBySquareRootProperty.pg +description = solve a quadratic equation by using the square root +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad35.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad40.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad45.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad50.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad55.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad65.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad70.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad75.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad80.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad85.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Elimination.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Elimination.def new file mode 100644 index 0000000000..d204b7d870 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Elimination.def @@ -0,0 +1,20 @@ +openDate = 12/11/2013 at 02:38am PST +dueDate = 06/30/2014 at 03:09am PDT +answerDate = 06/30/2014 at 03:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByElimination.pg +description = solve a systme of linear equations using the elimination (aka addition) method +problemList = +BasicAlgebra/SystemsOfLinearEquations/SystemEquation10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations55.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Graphing.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Graphing.def new file mode 100644 index 0000000000..af48e49847 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Graphing.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 02:34am PST +dueDate = 06/30/2014 at 03:03am PDT +answerDate = 06/30/2014 at 03:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByGraphing.pg +description = solve a system of linear equations by graphing the lines +problemList = +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem40.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Substitution.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Substitution.def new file mode 100644 index 0000000000..94f347423e --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSolve_System_by_Substitution.def @@ -0,0 +1,14 @@ +openDate = 12/11/2013 at 02:36am PST +dueDate = 06/30/2014 at 03:06am PDT +answerDate = 06/30/2014 at 03:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemBySubstitution.pg +description = solve a system of linear equations by isolating one variable and using substitution +problemList = +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations11.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations12.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations13.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations14.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations16.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations25.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations30.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSquare_Root_Operations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSquare_Root_Operations.def new file mode 100644 index 0000000000..4b4ff93965 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSquare_Root_Operations.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 03:08am PST +dueDate = 06/30/2014 at 03:54am PDT +answerDate = 06/30/2014 at 03:54am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SquareRootOperations.pg +description = simplifying radical expressions +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical1.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSystem_Equation_Applications.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSystem_Equation_Applications.def new file mode 100644 index 0000000000..8e99e61a60 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setSystem_Equation_Applications.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 02:40am PST +dueDate = 06/30/2014 at 03:12am PDT +answerDate = 06/30/2014 at 03:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SystemEquationApplications.pg +description = applications of solving systems of linear equations +problemList = +BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord5.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication70.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication80.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication90.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication100.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setTrigonometryRatios.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setTrigonometryRatios.def new file mode 100644 index 0000000000..27f4a3ce63 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH065/setTrigonometryRatios.def @@ -0,0 +1,92 @@ +assignmentType = default +openDate = 12/11/2013 at 03:10am PST +dueDate = 06/30/2014 at 03:58am PDT +answerDate = 06/30/2014 at 03:58am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeaders_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/TrigonometryRatios.pg +description = +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 2 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 3 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 4 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 5 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 6 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 7 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 8 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 9 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def new file mode 100644 index 0000000000..38c093ce74 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def @@ -0,0 +1,24 @@ +openDate = 12/01/2015 at 12:26am PST +dueDate = 03/01/2016 at 12:26am PST +answerDate = 03/01/2016 at 12:26am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Add_Subtract_Rational_Expressions.pg +description = subtract rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions110.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions120.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions130.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions140.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions150.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setCalculator_Basics.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setCalculator_Basics.def new file mode 100644 index 0000000000..9fdb03ef6f --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setCalculator_Basics.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:00am PST +dueDate = 03/01/2016 at 12:00am PST +answerDate = 03/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Calculator_Basics.pg +description = learning the basics about using graphing calculators +problemList = +BasicAlgebra/Calculator/CalculatorBasics10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics20.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics30.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics40.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics50.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics60.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics70.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics80.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics90.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorIntersection10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorIntersection20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setComplex_Number_Operations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setComplex_Number_Operations.def new file mode 100644 index 0000000000..340fac9eed --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setComplex_Number_Operations.def @@ -0,0 +1,23 @@ +openDate = 12/01/2015 at 12:44am PST +dueDate = 03/01/2016 at 12:44am PST +answerDate = 03/01/2016 at 12:44am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Complex_Number_Operations.pg +description = add, subtract, multiply complex numbers +problemList = +BasicAlgebra/ComplexNumber/complexNumberBasics10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberBasics20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberBasics30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations40.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations50.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations60.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations70.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations80.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setDivide_Rational_Expressions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setDivide_Rational_Expressions.def new file mode 100644 index 0000000000..598d861b47 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setDivide_Rational_Expressions.def @@ -0,0 +1,17 @@ +openDate = 12/01/2015 at 12:22am PST +dueDate = 03/01/2016 at 12:22am PST +answerDate = 03/01/2016 at 12:22am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Divide_Rational_Expressions.pg +description = divide rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions25.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions45.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions60.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setFunction_Domain_Range.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setFunction_Domain_Range.def new file mode 100644 index 0000000000..aa4e0dd9e3 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setFunction_Domain_Range.def @@ -0,0 +1,31 @@ +openDate = 12/01/2015 at 12:04am PST +dueDate = 03/01/2016 at 12:04am PST +answerDate = 03/01/2016 at 12:04am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Domain_Range.pg +description = finding the domain and range functions +problemList = +FunctionBasics/Functions90.pg, 1, -1, 0 +FunctionBasics/Functions100.pg, 1, -1, 0 +FunctionBasics/Functions110.pg, 1, -1, 0 +FunctionBasics/Functions120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg, 1, -1, 0 +FunctionBasics/Functions170.pg, 1, -1, 0 +FunctionBasics/Functions180.pg, 1, -1, 0 +FunctionBasics/Functions200.pg, 1, -1, 0 +FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg, 1, -1, 0 +FunctionBasics/Functions225.pg, 1, -1, 0 +FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setFunction_Notation.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setFunction_Notation.def new file mode 100644 index 0000000000..b00d94b3b3 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setFunction_Notation.def @@ -0,0 +1,32 @@ +openDate = 12/01/2015 at 12:02am PST +dueDate = 03/01/2016 at 12:02am PST +answerDate = 03/01/2016 at 12:02am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Notation.pg +description = learning and applying function notation +problemList = +BasicAlgebra/FunctionBasics/FunctionInContext10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction85.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition65.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition65.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition66.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition66.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools20.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorTable10.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setMultiply_Rational_Expressions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setMultiply_Rational_Expressions.def new file mode 100644 index 0000000000..7236470059 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setMultiply_Rational_Expressions.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:20am PST +dueDate = 03/01/2016 at 12:20am PST +answerDate = 03/01/2016 at 12:20am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Multiply_Rational_Expressions.pg +description = multiply rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions100.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setOperations_with_Radicals.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setOperations_with_Radicals.def new file mode 100644 index 0000000000..2d26974f77 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setOperations_with_Radicals.def @@ -0,0 +1,43 @@ +openDate = 12/01/2015 at 12:37am PST +dueDate = 03/01/2016 at 12:37am PST +answerDate = 03/01/2016 at 12:37am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Operations_with_Radicals.pg +description = operations that include radicals +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals13.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals14.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals15.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals51.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals52.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals55.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals56.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals57.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals58.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals91.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals92.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals93.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals94.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals95.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals44.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals55.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals65.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty11.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty12.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty41.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty43.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty60.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def new file mode 100644 index 0000000000..83ee97340c --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def @@ -0,0 +1,14 @@ +openDate = 12/01/2015 at 12:58am PST +dueDate = 03/01/2016 at 12:58am PST +answerDate = 03/01/2016 at 12:58am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Equations_with_Complex_Solutions.pg +description = find, understand, and interpret complex solutions of quadratic equations +problemList = +BasicAlgebra/ComplexNumber/complexSolutions10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions40.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions50.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Formula.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Formula.def new file mode 100644 index 0000000000..0f5d59d87d --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Formula.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:56am PST +dueDate = 03/01/2016 at 12:56am PST +answerDate = 03/01/2016 at 12:56am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Formula.pg +description = solve a quadratic equation using the quadratic formula +problemList = +BasicAlgebra/QuadraticEquations/solveQuad375.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad380.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad385.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad185.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools30.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools40.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools50.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorQuadraticFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions.def new file mode 100644 index 0000000000..2e43c931df --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:50am PST +dueDate = 03/01/2016 at 12:50am PST +answerDate = 03/01/2016 at 12:50am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions.pg +description = quadratic functions their graphs +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def new file mode 100644 index 0000000000..a88a2e2d3f --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def @@ -0,0 +1,24 @@ +openDate = 12/01/2015 at 12:52am PST +dueDate = 03/01/2016 at 12:52am PST +answerDate = 03/01/2016 at 12:52am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions_Vertex_Form.pg +description = quadratic functions in vertex form and their graphs +problemList = +BasicAlgebra/QuadraticFunctions/CompleteSquare10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare40.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare50.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare60.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare70.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm40.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRadical_Functions_Domain_Range.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRadical_Functions_Domain_Range.def new file mode 100644 index 0000000000..abf0dc5bae --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRadical_Functions_Domain_Range.def @@ -0,0 +1,23 @@ +openDate = 12/01/2015 at 12:34am PST +dueDate = 03/01/2016 at 12:34am PST +answerDate = 03/01/2016 at 12:34am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Radical_Functions_Domain_Range.pg +description = determine the domain and range of radical functions +problemList = +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions2.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions3.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions4.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions5.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions6.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions7.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions8.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically100.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically110.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically120.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically130.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically140.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically150.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRational_Exponents.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRational_Exponents.def new file mode 100644 index 0000000000..eb4b66091b --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRational_Exponents.def @@ -0,0 +1,50 @@ +openDate = 12/01/2015 at 12:35am PST +dueDate = 03/01/2016 at 12:35am PST +answerDate = 03/01/2016 at 12:35am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Exponents.pg +description = using rational exponents to simplify radical expressions +problemList = +Math95/RadicalsRationalExponents/RadicalsRationalExponents7.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents8.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent26.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent40.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots35.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents9.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents14.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents15.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents16.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents17.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents18.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents19.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents21.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents24.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents27.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents28.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents29.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents31.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRational_Functions_Domain.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRational_Functions_Domain.def new file mode 100644 index 0000000000..bb6730e752 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRational_Functions_Domain.def @@ -0,0 +1,29 @@ +openDate = 12/01/2015 at 12:16am PST +dueDate = 03/01/2016 at 12:16am PST +answerDate = 03/01/2016 at 12:16am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Functions_Domain.pg +description = determine the domain and range of rational functions +problemList = +BasicAlgebra/RationalFunctions/rationalFunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions211.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions212.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions213.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions214.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions215.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions216.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions217.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain40.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote30.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote40.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def new file mode 100644 index 0000000000..7947d00d13 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def @@ -0,0 +1,15 @@ +openDate = 12/01/2015 at 12:46am PST +dueDate = 03/01/2016 at 12:46am PST +answerDate = 03/01/2016 at 12:46am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Complex_Number_Denominators.pg +description = rationalize denominators that include complex numbers +problemList = +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRationalize_Radical_Denominators.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRationalize_Radical_Denominators.def new file mode 100644 index 0000000000..7ea176a347 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setRationalize_Radical_Denominators.def @@ -0,0 +1,35 @@ +openDate = 12/01/2015 at 12:38am PST +dueDate = 03/01/2016 at 12:38am PST +answerDate = 03/01/2016 at 12:38am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Radical_Denominators.pg +description = rationalize denominators that include radicals +problemList = +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator35.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator36.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator37.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator81.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator82.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator83.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator84.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator85.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator86.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator87.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator110.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator140.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator150.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication10.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication20.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication30.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals24.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals25.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals26.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator160.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator165.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator170.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator180.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator190.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator200.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator210.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_1-1.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_1-1.def new file mode 100644 index 0000000000..3cf3e98ca6 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_1-1.def @@ -0,0 +1,54 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:00am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = evaluating formulaic functions; domain and range; graphs of functions +problemList = +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction110.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction140.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions110.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions150.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions160.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions170.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions200.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions225.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/Functions/Functions10.pg, 1, -1, 0 +Math95/Functions/Functions11.pg, 1, -1, 0 +Math95/Functions/Functions12.pg, 1, -1, 0 +Math95/Functions/Functions13.pg, 1, -1, 0 +Math95/Functions/Functions14.pg, 1, -1, 0 +Math95/Functions/Functions15.pg, 1, -1, 0 +Math95/Functions/Functions16.pg, 1, -1, 0 +Math95/Functions/Functions17.pg, 1, -1, 0 +Math95/Functions/Functions18.pg, 1, -1, 0 +Math95/Functions/Functions19.pg, 1, -1, 0 +Math95/Functions/Functions20.pg, 1, -1, 0 +Math95/Functions/Functions22.pg, 1, -1, 0 +Math95/Functions/Functions21.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_2-3.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_2-3.def new file mode 100644 index 0000000000..8f7407ea3e --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_2-3.def @@ -0,0 +1,60 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:01am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = inequalities with number lines, interval notation, and set-builder notation; solving linear inequalities; applications +problemList = +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality130.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality170.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality190.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality210.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality230.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality240.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality260.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality280.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality290.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality310.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 +Math95/LinearInequalities/LinearInequalities8.pg, 1, -1, 0 +Math95/LinearInequalities/LinearInequalities9.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_2-4.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_2-4.def new file mode 100644 index 0000000000..b3ced9082e --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_2-4.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:02am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = compound inequalities +problemList = +Math95/CompoundLinearInequalities/CompoundLinearInequalities1.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities2.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities3.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities4.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities5.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities6.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities11.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities10.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities7.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities8.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities9.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_2-5.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_2-5.def new file mode 100644 index 0000000000..fc9073ba2c --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_2-5.def @@ -0,0 +1,17 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:03am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = absolute value inequalities +problemList = +Math95/AbsValueInequalities/AbsValueInequalities1.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities4.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities6.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities7.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities2.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities3.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities5.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities9.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities8.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-1.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-1.def new file mode 100644 index 0000000000..3856fa3c8f --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-1.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:04am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = rational functions; easier rational equations +problemList = +Math95/Functions/Functions19.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions200.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations1.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations2.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations4.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations5.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations6.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations7.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations3.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-2.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-2.def new file mode 100644 index 0000000000..e09e4fd088 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-2.def @@ -0,0 +1,21 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:05am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = multiplication and division of rational expressions +problemList = +Math95/MultiplyingRationals/MultiplyingRationals1.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_15_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_18_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_22_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_20_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_19_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_16_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_23_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_24_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_25_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_27_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_26_MultDivRatExp.pg, 1, -1, 0 +Math95/MultiplyingRationals/MultiplyingRationals2.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-3.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-3.def new file mode 100644 index 0000000000..95dc9b7346 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-3.def @@ -0,0 +1,24 @@ + +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:06am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = addition and subtraction of rational expressions +problemList = +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_01_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_06_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_07_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_05_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_02_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_03_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_04_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_20_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_17_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_24_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_25_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_21_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_27_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_19_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_18_AddSubRatExp.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-4.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-4.def new file mode 100644 index 0000000000..92902cdd2a --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-4.def @@ -0,0 +1,32 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:07am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = more rational equations; applications +problemList = +Math95/MoreRationalEquations/MoreRationalEquations1.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations2.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations3.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations4.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations5.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations6.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations7.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations8.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations9.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations10.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations11.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations12.pg, 1, -1, 0 +Math95/Proportions/Proportions1.pg, 1, -1, 0 +Math95/Proportions/Proportions2.pg, 1, -1, 0 +Math95/Proportions/Proportions3.pg, 1, -1, 0 +Math95/Proportions/Proportions4.pg, 1, -1, 0 +Math95/Proportions/Proportions5.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications1.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications2.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications3.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications4.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications5.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications6.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications7.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-5.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-5.def new file mode 100644 index 0000000000..364f7293ed --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_4-5.def @@ -0,0 +1,18 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:08am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = "complex" fractions (rational expressions with more than two "levels") +problemList = +Math95/ComplexFractions/ComplexFractions1.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions2.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions3.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions4.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions5.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions6.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions7.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions8.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions9.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-1_5-2.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-1_5-2.def new file mode 100644 index 0000000000..7ecbfb27e8 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-1_5-2.def @@ -0,0 +1,40 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:09am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = square roots and radicals; rational exponents +problemList = +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents6.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents5.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents3.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents4.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents9.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents27.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents28.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents29.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents31.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents7.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents8.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents18.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p13.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p16.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p12.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-3.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-3.def new file mode 100644 index 0000000000..111ce86936 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-3.def @@ -0,0 +1,31 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:10am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = multiplying radical and rational exponent expressions +problemList = +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents14.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents15.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents16.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents17.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents21.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents24.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-4.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-4.def new file mode 100644 index 0000000000..bdde53a100 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-4.def @@ -0,0 +1,34 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:11am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = adding like radicals; reducing radicals; rationalizing denominators; binomial multiplication with radicals and rational exponents +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical1.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-5.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-5.def new file mode 100644 index 0000000000..f581cb19fe --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-5.def @@ -0,0 +1,20 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:12am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = radical functions +problemList = +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions225.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions2.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions3.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions4.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions5.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions6.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions7.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions8.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-6.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-6.def new file mode 100644 index 0000000000..f9bd162940 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-6.def @@ -0,0 +1,33 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:13am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = equations that radicals help solve; Pythagorean Theorem; equations with radicals in them +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad35.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad40.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad50.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad70.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad75.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad85.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad115.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad110.pg, 1, -1, 0 +Math95/EquationsNeedingRadicals/EquationsNeedingRadicals3.pg, 1, -1, 0 +Math95/EquationsNeedingRadicals/EquationsNeedingRadicals4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations1.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations5.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations8.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations9.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations10.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad135.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad140.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-7.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-7.def new file mode 100644 index 0000000000..c183d725ec --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_5-7.def @@ -0,0 +1,20 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:14am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = arithmetic with complex numbers; counting real and nonreal roots of quadratic polynomials +problemList = +Math95/ComplexNumbers/ComplexNumbers1.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers2.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers3.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers4.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers5.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers6.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers7.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers8.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-1.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-1.def new file mode 100644 index 0000000000..6d8014412d --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-1.def @@ -0,0 +1,24 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:15am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = graph quadratic functions; parabola axis of symmetry and vertex +problemList = +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-2.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-2.def new file mode 100644 index 0000000000..256be791df --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-2.def @@ -0,0 +1,25 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:16am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = transformations of y=x^2; quadratic data +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms10.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData1.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData2.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData3.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-3.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-3.def new file mode 100644 index 0000000000..11f4905628 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-3.def @@ -0,0 +1,46 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:17am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = solve quadratic equations using factoring, square root, and completing the square; find x-intercepts of parabolas; applications +problemList = +BasicAlgebra/QuadraticEquations/solveQuad95.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad230.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad220.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad235.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad240.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad120.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad180.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad265.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad270.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad280.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad285.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad295.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad335.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad330.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad325.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts220.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts230.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola100.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-4.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-4.def new file mode 100644 index 0000000000..8b77a87ae4 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSection_6-4.def @@ -0,0 +1,21 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:18am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = the quadratic formula; applications +problemList = +BasicAlgebra/QuadraticEquations/solveQuad145.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad150.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad176.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def new file mode 100644 index 0000000000..7c8e046444 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def @@ -0,0 +1,18 @@ +openDate = 12/01/2015 at 12:28am PST +dueDate = 03/01/2016 at 12:28am PST +answerDate = 03/01/2016 at 12:28am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Complex_Rational_Expressions.pg +description = simplify complex rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions11.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions12.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions70.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSimplify_Radical_Expressions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSimplify_Radical_Expressions.def new file mode 100644 index 0000000000..207d476ffa --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSimplify_Radical_Expressions.def @@ -0,0 +1,28 @@ +openDate = 12/01/2015 at 12:36am PST +dueDate = 03/01/2016 at 12:36am PST +answerDate = 03/01/2016 at 12:36am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Radical_Expressions.pg +description = simplify radical expressions +problemList = +Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents3.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents4.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents5.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents6.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals07.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals09.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals150.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals160.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals170.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals180.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals185.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals190.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals200.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals210.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals220.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEstimateRadical10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEstimateRadical20.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSimplify_Rational_Expressions.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSimplify_Rational_Expressions.def new file mode 100644 index 0000000000..722ea2a715 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSimplify_Rational_Expressions.def @@ -0,0 +1,27 @@ +openDate = 12/01/2015 at 12:18am PST +dueDate = 03/01/2016 at 12:18am PST +answerDate = 03/01/2016 at 12:18am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Rational_Expressions.pg +description = simplify rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions100.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions110.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions120.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions130.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions150.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions160.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions170.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions180.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def new file mode 100644 index 0000000000..20167defb9 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:12am PST +dueDate = 03/01/2016 at 12:12am PST +answerDate = 03/01/2016 at 12:12am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Equations.pg +description = solve absolute value equations +problemList = +BasicAlgebra/AbsoluteValue/absoluteValueEquation10.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation20.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation30.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation40.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation50.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation60.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation65.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation70.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation80.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation90.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation95.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation100.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation110.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation120.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation130.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation140.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation150.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def new file mode 100644 index 0000000000..2c025f8c71 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:14am PST +dueDate = 03/01/2016 at 12:14am PST +answerDate = 03/01/2016 at 12:14am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Inequalities.pg +description = solve absolute value inequalities +problemList = +BasicAlgebra/AbsoluteValue/absoluteValueInequality10.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality20.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality50.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality70.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality100.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality130.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality140.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality150.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequalityApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveInequality10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveInequality20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Inequalities.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Inequalities.def new file mode 100644 index 0000000000..14a7378064 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Inequalities.def @@ -0,0 +1,34 @@ +openDate = 12/01/2015 at 12:08am PST +dueDate = 03/01/2016 at 12:08am PST +answerDate = 03/01/2016 at 12:08am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Inequalities.pg +description = solve inequalities and compound inequalities +problemList = +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality320.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality300.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def new file mode 100644 index 0000000000..6baeeeeadd --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def @@ -0,0 +1,17 @@ +openDate = 12/01/2015 at 12:32am PST +dueDate = 03/01/2016 at 12:32am PST +answerDate = 03/01/2016 at 12:32am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Literal_Rational_Equations.pg +description = solve literal rational equations +problemList = +BasicAlgebra/RationalLiteralEquations/LiteralEquation220.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation230.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation240.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation250.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation260.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation270.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation280.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation290.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Quadratic_Equations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Quadratic_Equations.def new file mode 100644 index 0000000000..7093359a79 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Quadratic_Equations.def @@ -0,0 +1,21 @@ +openDate = 12/01/2015 at 12:54am PST +dueDate = 03/01/2016 at 12:54am PST +answerDate = 03/01/2016 at 12:54am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Quadratic_Equations.pg +description = learning more advanced skills for graphing calculators +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Radical_Equations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Radical_Equations.def new file mode 100644 index 0000000000..878f61f5f0 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Radical_Equations.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:40am PST +dueDate = 03/01/2016 at 12:40am PST +answerDate = 03/01/2016 at 12:40am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Radical_Equations.pg +description = solve radical equations +problemList = +Math95/SolvingRadicalEquations/SolvingRadicalEquations1.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations5.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations8.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral90.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral100.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral110.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral120.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRadicalEquation10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRadicalEquation20.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication92.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication102.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication122.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication20.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations.def new file mode 100644 index 0000000000..922baf84da --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations.def @@ -0,0 +1,25 @@ +openDate = 12/01/2015 at 12:30am PST +dueDate = 03/01/2016 at 12:30am PST +answerDate = 03/01/2016 at 12:30am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations.pg +description = solve rational equations +problemList = +BasicAlgebra/RationalEquations/solveRationalEquations10.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations20.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations25.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations27.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations28.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations30.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations40.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations50.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations55.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations60.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations61.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations65.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations66.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations70.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRationalEquation10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRationalEquation20.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def new file mode 100644 index 0000000000..a93cb61e19 --- /dev/null +++ b/OpenProblemLibrary/PCC/OldSetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def @@ -0,0 +1,22 @@ +openDate = 12/01/2015 at 12:31am PST +dueDate = 03/01/2016 at 12:31am PST +answerDate = 03/01/2016 at 12:31am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations_Applications.pg +description = solve rational equations +problemList = +BasicAlgebra/RationalEquations/rationalEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication15.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication25.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication35.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication44.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication45.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_1.1-2.3_header.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_1.1-2.3_header.pg new file mode 100644 index 0000000000..d016f98a06 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_1.1-2.3_header.pg @@ -0,0 +1,87 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, sections 1.1 through 2.3. +$PAR + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_2.4-3.7_header.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_2.4-3.7_header.pg new file mode 100644 index 0000000000..f1168a947c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_2.4-3.7_header.pg @@ -0,0 +1,87 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, sections 2.4 through 3.7. +$PAR + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Final_Exam_202003_30022_header.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Final_Exam_202003_30022_header.pg new file mode 100644 index 0000000000..4d1a54fd8e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH060/Final_Exam_202003_30022_header.pg @@ -0,0 +1,87 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, chapters 1 through 4. +$PAR + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Exam_ORCCA_ed2_10.1-11.2_header.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Exam_ORCCA_ed2_10.1-11.2_header.pg new file mode 100644 index 0000000000..6a75b5ec83 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Exam_ORCCA_ed2_10.1-11.2_header.pg @@ -0,0 +1,89 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, sections 10.1 through 11.2. +$PAR + +The last question instructs you to write responses outside of WeBWorK +(such as on paper, using MS Word, etc) and upload them into an Assignment in D2L. + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Final_Exam_202004_40038_header.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Final_Exam_202004_40038_header.pg new file mode 100644 index 0000000000..6a62b0bcb0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Final_Exam_202004_40038_header.pg @@ -0,0 +1,84 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, chapters 10 through 13. + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Midterm_Exam_202004_40038_header.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Midterm_Exam_202004_40038_header.pg new file mode 100644 index 0000000000..6b8e633aa5 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/CombinedHeaders/MTH095/Midterm_Exam_202004_40038_header.pg @@ -0,0 +1,84 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {\{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +# +#EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +This Exam covers ORCCA 2nd edition, chapters 10 and 11. + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg new file mode 100644 index 0000000000..2714f8bbb8 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg @@ -0,0 +1,113 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +Go to \{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH20Course!,"http://spot.pcc.edu/~cyao/MTH20Course", "TARGET='_blank'") \} for MTH20 lecture notes and video lectures. +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg new file mode 100644 index 0000000000..04856c28e8 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg @@ -0,0 +1,93 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +Go to \{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH60Course!,"http://spot.pcc.edu/~cyao/MTH60Course", "TARGET='_blank'") \} for MTH60 lecture notes and video lectures. +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg new file mode 100644 index 0000000000..7be5627b2c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg @@ -0,0 +1,93 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +Go to \{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH65Course!,"http://spot.pcc.edu/~cyao/MTH65Course", "TARGET='_blank'") \} for MTH65 lecture notes and video lectures. +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg new file mode 100644 index 0000000000..5cfc4b9436 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg @@ -0,0 +1,185 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg new file mode 100644 index 0000000000..5cfc4b9436 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg @@ -0,0 +1,185 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg new file mode 100644 index 0000000000..5cfc4b9436 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg @@ -0,0 +1,185 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractFractions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractFractions.pg new file mode 100644 index 0000000000..caefb6f84e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractFractions.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L2AddSubtractFractions.pdf +!,"Add/Subtract Fractions Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Add Fractions with Common Denominators Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/4pQIw5h8iUw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Fractions with Different Denominators Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/89eHMYsw8MU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Fractions with Different Denominators Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/N-TEyv7VNgY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Fractions with Different Denominators Involving Negative Numbers +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GgWnw4L9POA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractIntegers.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractIntegers.pg new file mode 100644 index 0000000000..cb19f79682 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractIntegers.pg @@ -0,0 +1,139 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U2L2AddSubtractIntegers.pdf +!,"Add and Subtract Integers Lecture Notes", "TARGET='_blank'") \}. + +$PAR +First Method to Add/Subtract Integers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/C38B33ZywWs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Second Method to Add Integers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/AIWPLvTNhXs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Second Method to Subtract Integers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/0sMIJkFV1uw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractMixedNumbers.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractMixedNumbers.pg new file mode 100644 index 0000000000..2e297725ed --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractMixedNumbers.pg @@ -0,0 +1,170 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L6AddSubtractMixedNumbers.pdf +!,"Add/Subtract Mixed Numbers Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Add Mixed Numbers with Common Denominators Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/MBZrYacUDyc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Mixed Numbers with Different Denominators Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CfBYGFm5gPA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Mixed Numbers with Common Denominators Involving Negative Numbers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Pj2LGQ2gHgw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add Mixed Numbers with Uncommon Denominators Involving Negative Numbers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/MwqgHvdKlmQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Subtract Mixed Numbers Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/WF7L2waDwLw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Subtract Mixed Numbers Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/4LYtLMmDuzw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Subtract a Fraction from a Whole Number Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ZpdTfe30N1s +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAdditionSubtraction.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAdditionSubtraction.pg new file mode 100644 index 0000000000..a2807f71e6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAdditionSubtraction.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L2DecimalAdditionSubtraction.pdf +!,"Add/Subtract Decimals Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Add Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/-wJXRgTDghA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Subtract Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/kMD7M9MSbO0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add/Subtract Decimals Involving Negative Numbers Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/7QEmT3iJBtU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Add/Subtract Decimals Involving Negative Numbers Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/qJzYcLE7_Mg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAndFraction.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAndFraction.pg new file mode 100644 index 0000000000..8fa4597963 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAndFraction.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L4DecimalAndFraction.pdf +!,"Decimals and Fractions Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Change Decimal to Fraction Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/bA5ZoFW1ztE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Change Decimal to Fraction Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/iOvxUXl3flc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Change Fraction to Decimal Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/I7L-vNLki5w +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Convert between Fractions and Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/5PYVMuI3qoc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalDefinition.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalDefinition.pg new file mode 100644 index 0000000000..8e2f6dd51f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalDefinition.pg @@ -0,0 +1,139 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L1DecimalDefinition.pdf +!,"Introduction to Decimals Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Introduction to Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/oCnZ6ZpafNg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Compare Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/VmaY9mNy4ak +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +$PAR +Round Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/g8hRCisK8to +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalMultiplicationDivision.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalMultiplicationDivision.pg new file mode 100644 index 0000000000..c09db8c05f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalMultiplicationDivision.pg @@ -0,0 +1,147 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L3DecimalMultiplicationDivision.pdf +!,"Multiply/Divide Decimals Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Multiply by Power of 10 Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/mV0RxDZG05A +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +$PAR +Divide by Power of 10 Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/W_VhVHRal6o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Multiply Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/xpuZIC3nolQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Divide Decimals Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/wYh0eUCdJWQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivideFractions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivideFractions.pg new file mode 100644 index 0000000000..b5ea98fafd --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivideFractions.pg @@ -0,0 +1,119 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L4DivideFractions.pdf +!,"Divide Fractions Lecture Notes", "TARGET='_blank'") \}. + +\{ scalableiframe("// +www.youtube.com/embed/7VGgnESa498 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivisibilityTest.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivisibilityTest.pg new file mode 100644 index 0000000000..d4867edb93 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivisibilityTest.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L5DivisivilityTest.pdf +!,"Divisibility Test Lecture Notes", "TARGET='_blank'") \}. + +\{ scalableiframe("// +www.youtube.com/embed/Df9h5t64NlQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Division.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Division.pg new file mode 100644 index 0000000000..e63977fcd6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Division.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L3Division.pdf +!,"Division Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Division Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/MTzTqvzWzm8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Division Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/8Ft5iHhauJ0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Remainder Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/fjAbh_LCxcI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Divide by Zero Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/UjRob36yuJI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/ExponentsAndRoundingWholeNumbers.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/ExponentsAndRoundingWholeNumbers.pg new file mode 100644 index 0000000000..69260f6d3a --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/ExponentsAndRoundingWholeNumbers.pg @@ -0,0 +1,131 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L1ExponentAndRoundingWholeNumber.pdf +!,"Exponent and Rounding Whole Numbers Lecture Notes", "TARGET='_blank'") \} + +$PAR +Exponent Definition Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/i4m9jMGv4AA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +$PAR +Round Whole Numbers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vNsmn4SMD4k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/FractionDefinition.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/FractionDefinition.pg new file mode 100644 index 0000000000..a1761b58cf --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/FractionDefinition.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L1FractionDefinition.pdf +!,"Fraction Definition and Equivalent Fractions Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Definition of Fractions Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/cmBdd_GmFh4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Reduce Fractions Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/eAzfN0o3CgY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Reduce Fractions Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/sznPsgkHEyA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Compare Fractions Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/nt-83HOnQHU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GCFAndLCM.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GCFAndLCM.pg new file mode 100644 index 0000000000..9fe7581d86 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GCFAndLCM.pg @@ -0,0 +1,136 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L7GCFAndLCM.pdf +!,"Greatest Common Factor and Least Common Multiple Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Greatest Common Factor Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ECFmsS7z9sE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Least Common Multiple Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/D6yHKOYJiso +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Least Common Multiple Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/znmPfDfsir8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Least Common Multiple Video Lecture 3 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/w_GwBDOSNp4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GeometryBasics.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GeometryBasics.pg new file mode 100644 index 0000000000..7c4370e760 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/GeometryBasics.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L4GeometryBasics.pdf +!,"Geometry Basics Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/kqqmJiJez6o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/IntegersAndAbsoluteValue.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/IntegersAndAbsoluteValue.pg new file mode 100644 index 0000000000..10b1fca043 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/IntegersAndAbsoluteValue.pg @@ -0,0 +1,131 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U2L1IntegersAndAbsoluteValue.pdf +!,"Integers and Absolute Value Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Introduction to Negative Numbers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Hlal9ME2Aig +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Absolute Value Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/L8fGfc7Wcco +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MeanMedianMode.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MeanMedianMode.pg new file mode 100644 index 0000000000..4342283a11 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MeanMedianMode.pg @@ -0,0 +1,121 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L6MeanMedianMode.pdf +!,"Mean, Median and Mode Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/pk8_c0hAuRI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MixedNumberDefinition.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MixedNumberDefinition.pg new file mode 100644 index 0000000000..762b888d8d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MixedNumberDefinition.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L5MixedNumberDefinition.pdf +!,"Introduction to Mixed Numbers Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/HkELb2btWQQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Multiplication.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Multiplication.pg new file mode 100644 index 0000000000..4abbec3df2 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Multiplication.pg @@ -0,0 +1,138 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L2Multiplication.pdf +!,"Multiplication Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Multiplication Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/mvOkMYCygps +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Multiplication Table Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/xO_1bYgoQvA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Multiplication Table Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/qihoczo1Ujk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideIntegers.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideIntegers.pg new file mode 100644 index 0000000000..fa1f5f03ca --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideIntegers.pg @@ -0,0 +1,131 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U2L3MultiplyDivideIntegers.pdf +!,"Multiply and Divide Integers Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Multiply and Divide Integers Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/d8lP5tR2R3Q +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Negative Number and Exponent Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/AneubQTnoL4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideMixedNumbers.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideMixedNumbers.pg new file mode 100644 index 0000000000..765026dbc4 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideMixedNumbers.pg @@ -0,0 +1,127 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L7MultiplyDivideMixedNumbers.pdf +!,"Multiply/Divide Mixed Numbers Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/BhUwTsPEZuM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vVx7qwUf5KU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyFractions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyFractions.pg new file mode 100644 index 0000000000..73af1c1fba --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyFractions.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L3MultiplyFractions.pdf +!,"Multiply Fractions Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/rxISl5boIuE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_1.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_1.pg new file mode 100644 index 0000000000..519146625d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_1.pg @@ -0,0 +1,132 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L8OrderOfOperations_1.pdf +!,"Order of Operations Part I (involving positive numbers only) Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ahwlw4OCEAc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/NCixeuWvLS0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/wTHSBsoDDqY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_2.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_2.pg new file mode 100644 index 0000000000..c7ba2f6179 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_2.pg @@ -0,0 +1,126 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U2L4OrderOfOperations_2.pdf +!,"Order of Operations Part II Lecture Notes (involving negative numbers and absolute values)", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/a329hvX8yDA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/UzQZfvYPlzI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_3.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_3.pg new file mode 100644 index 0000000000..00cc6e321e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_3.pg @@ -0,0 +1,126 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U3L8OrderOfOperations_3.pdf +!,"Order of Operations involving Fractions Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/EpX9ohiti6o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/a329hvX8yDA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentDefinition.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentDefinition.pg new file mode 100644 index 0000000000..2936c5dc20 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentDefinition.pg @@ -0,0 +1,155 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U6L1PercentDefinition.pdf +!,"Introduction to Percent Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Introduction to Percent Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/xB7d4SqI25M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +$PAR +Change Percent to Decimal Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/KBtjkblzbrw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Change Percent to Fraction Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/17sdYa0y1wo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Change Decimals/Fractions to Percent Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/eLBMph6iSiY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Percent, Fraction and Decimal Conversions Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Hkwfibux88s +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentFormula.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentFormula.pg new file mode 100644 index 0000000000..03b1e59bc8 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentFormula.pg @@ -0,0 +1,154 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U6L2PercentFormula.pdf +!,"Percent Formula Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Type I Percent Formula Problems Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/dKVOGoHMsfc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Type II Percent Formula Problems Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/N4kDzoQOngY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Type III Percent Formula Problems Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/DAikW24_O0A +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Solve Percent Problems with Proportion Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/T8dAK1RDexI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Solve Percent Problems with Proportion Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vuSMdL0Mke4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentOfIncreaseDecrease.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentOfIncreaseDecrease.pg new file mode 100644 index 0000000000..e4be0e6241 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentOfIncreaseDecrease.pg @@ -0,0 +1,130 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U6L4PercentOfIncreaseDecrease.pdf +!,"Percent of Increase/Decrease Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/KVfRWj5CU5E +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LP9UJmBxAnw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +$PAR +\{ scalableiframe("// +www.youtube.com/embed/wzLUsEU_fvE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentWordProblems.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentWordProblems.pg new file mode 100644 index 0000000000..2c4e582bc1 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentWordProblems.pg @@ -0,0 +1,130 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U6L3PercentWordProblem.pdf +!,"Percent Word Problems Lecture Notes", "TARGET='_blank'") \}. + +$PAR +\{ scalableiframe("// +www.youtube.com/embed/cAPXFDev8B4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +$PAR +\{ scalableiframe("// +www.youtube.com/embed/STMZeuWT4Ss +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +$PAR +\{ scalableiframe("// +www.youtube.com/embed/1LtBcfk1uHg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PrimeNumbers.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PrimeNumbers.pg new file mode 100644 index 0000000000..10e32fc9a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/PrimeNumbers.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U1L6PrimeNumber.pdf +!,"Prime Number Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Find Factors Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vcn2ruTOwFo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Prime Number Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/mIStB5X4U8M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Prime Number Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/3h4UK62Qrbo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Prime Factor Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/XpUCTicRBjQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Proportion.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Proportion.pg new file mode 100644 index 0000000000..6a12238e22 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/Proportion.pg @@ -0,0 +1,138 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U5L2Proportion.pdf +!,"Proportion Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Solve Proportions Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/EdM-jYtAtAM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Solve Proportions Word Problem Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/89H0Vsn7oC4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Solve Proportions Word Problem Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/KaxpT_R9a-c +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/RateAndRatio.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/RateAndRatio.pg new file mode 100644 index 0000000000..5d243927f9 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/RateAndRatio.pg @@ -0,0 +1,130 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U5L1RateAndRatio.pdf +!,"Rate and Ratio Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Ratio Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/MTzTqvzWzm8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Rate and Ratio Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/8Ft5iHhauJ0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/SquareRoot.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/SquareRoot.pg new file mode 100644 index 0000000000..e02ad4fd9e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/SquareRoot.pg @@ -0,0 +1,130 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U4L5SquareRoot.pdf +!,"Square Root Lecture Notes", "TARGET='_blank'") \}. + +$PAR +Introduction to Square Root Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/yVUtSYPYM5M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Evaluate Square Root Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CCd1HrPizmw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/UnitConversion.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/UnitConversion.pg new file mode 100644 index 0000000000..4315d6685f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH020/UnitConversion.pg @@ -0,0 +1,146 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR +END_TEXT + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH20Docs/U5L3UnitConversion.pdf +!,"Unit Conversion Lecture Notes", "TARGET='_blank'") \}. + +$PAR +American Sytem Unit Conversion Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/bcM5J-wYHjE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Metric System Video Lecture +$PAR +\{ scalableiframe("// +www.youtube.com/embed/6sBmVPIJwrw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Unit Cancellation Method Video Lecture 1 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/OL7liIliMD0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Unit Cancellation Method Video Lecture 2 +$PAR +\{ scalableiframe("// +www.youtube.com/embed/daVdxGfchWI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AbsoluteValue.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AbsoluteValue.pg new file mode 100644 index 0000000000..7a9c358d34 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AbsoluteValue.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L2_AbsoluteValue.pdf +!,"lecture notes on absolute value", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/L8fGfc7Wcco +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AccountInterestWordProblems.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AccountInterestWordProblems.pg new file mode 100644 index 0000000000..d5d06d3d78 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AccountInterestWordProblems.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U7L3_AccountInterestProblems.pdf +!,"lecture notes on account interest word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/7i_35zNMsjg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ieCNfN7Uwog +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AddSubtractFractions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AddSubtractFractions.pg new file mode 100644 index 0000000000..5bb75ed070 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/AddSubtractFractions.pg @@ -0,0 +1,102 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH60Docs/U2L2_AddSubtractFractions.pdf!,"lecture notes on adding/subtracting fractions", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/89eHMYsw8MU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GgWnw4L9POA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicPercentageWordProblems.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicPercentageWordProblems.pg new file mode 100644 index 0000000000..c0458f16b1 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicPercentageWordProblems.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U7L1_BasicPercentProblems.pdf +!,"lecture notes on basic percentage word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/qs-5b2IBvB8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicWordProblems.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicWordProblems.pg new file mode 100644 index 0000000000..99fd9415c3 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicWordProblems.pg @@ -0,0 +1,130 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U5L1_BasicWordProblems.pdf +!,"lecture notes on basic word problems", "TARGET='_blank'") \} +$PAR + +First video lecture on number word problems +$PAR +\{ scalableiframe("// +www.youtube.com/embed/0Z5k2I-0mHo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Second video lecture on number word problems +$PAR +\{ scalableiframe("// +www.youtube.com/embed/UvOwDgZzxvw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on consecutive integers word problems +$PAR +\{ scalableiframe("// +www.youtube.com/embed/o5T6PYD5zmY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on consecutive odd/even integers word problems +$PAR +\{ scalableiframe("// +www.youtube.com/embed/d8De3xcVmnw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on rectangle perimeter word problems +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ja-g2qB9P9Y +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/CoordinateSystem.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/CoordinateSystem.pg new file mode 100644 index 0000000000..85ec0d6474 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/CoordinateSystem.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L1_CoordinateSystemBasics.pdf +!,"lecture notes on coordinate system basics", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/dzNHVMQVy84 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/DistanceWordProblems.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/DistanceWordProblems.pg new file mode 100644 index 0000000000..4f94911e91 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/DistanceWordProblems.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U7L2_DistanceWordProblems.pdf +!,"lecture notes on distance word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/SBTAFvqMlfk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/jcETNCbcGsY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/EvaluatingExpressions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/EvaluatingExpressions.pg new file mode 100644 index 0000000000..ee12ec36f1 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/EvaluatingExpressions.pg @@ -0,0 +1,105 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L5_EvaluateExpressions.pdf +!,"lecture notes on evaluating expressions", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/Sa6bBkztsoo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/7vt6IerxYdw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentBasics.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentBasics.pg new file mode 100644 index 0000000000..6dcc54efa0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentBasics.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L3_IntroductionToExponents.pdf +!,"lecture notes on exponent basics", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/AneubQTnoL4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentRules.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentRules.pg new file mode 100644 index 0000000000..ebc3368a55 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentRules.pg @@ -0,0 +1,102 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L3_ThreeExponentRules.pdf +!,"lecture notes on exponent rules", "TARGET='_blank'") \} +$PAR +\{ htmlLink(qq! +http://www.youtube.com/watch?v=jjajaVnVQKY +!,"a video lecture on product rule of exponents", "TARGET='_blank'") \} +$PAR +\{ htmlLink(qq! +http://www.youtube.com/watch?v=Y967TsThSGA +!,"a video lecture on some other exponent rules", "TARGET='_blank'") \} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByGraph.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByGraph.pg new file mode 100644 index 0000000000..c810f8336e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByGraph.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L7_WriteLinearEquationByGraph.pdf +!,"lecture notes on finding equation by graph", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/9wOalujeZf4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByPointSlope.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByPointSlope.pg new file mode 100644 index 0000000000..cfbe9da402 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByPointSlope.pg @@ -0,0 +1,114 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L7_GivenPointSlopeFindEquation.pdf +!,"lecture notes on finding equation by point and slope", "TARGET='_blank'") \} +$PAR + +First video lecture on finding equation by point and slope +$PAR +\{ scalableiframe("// +www.youtube.com/embed/9h78OnmH6gk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +Second video lecture on finding equation by point and slope +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GNEKDFKVBOc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +Video lecture on point-slope form equations +$PAR +\{ scalableiframe("// +www.youtube.com/embed/YGAN_b2anv0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByTwoPoints.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByTwoPoints.pg new file mode 100644 index 0000000000..7575d052f9 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByTwoPoints.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L7_GivenTwoPointsFindEquation.pdf +!,"lecture notes on finding equation by two points", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/U1oZU8Xzoik +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Ltapa5XJAkI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/gvwKv6F69F0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Functions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Functions.pg new file mode 100644 index 0000000000..179335b812 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Functions.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U11L1_IntroductionToFunctions.pdf +!,"lecture notes on functions", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/JZmIsxayvxY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FunctionsIntro.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FunctionsIntro.pg new file mode 100644 index 0000000000..b5191510a1 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/FunctionsIntro.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U11L1_IntroductionToFunctions.pdf +!,"lecture notes on functions", "TARGET='_blank'") \} + +\{ scalableiframe("// +www.youtube.com/embed/JZmIsxayvxY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphLineByTable.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphLineByTable.pg new file mode 100644 index 0000000000..4acd9c9503 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphLineByTable.pg @@ -0,0 +1,125 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L2_GraphLineByTable.pdf +!,"lecture notes on graphing a line by table", "TARGET='_blank'") \} +$PAR + +Video lecture on graphing a line by table +$PAR +\{ scalableiframe("// +www.youtube.com/embed/8OUvFd-jMGY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L2_VerticalAndHorizontalLines.pdf +!,"lecture notes on vertical and horizontal lines", "TARGET='_blank'") \} +$PAR + +Video lecture on vertical and horizontal lines +$PAR +\{ scalableiframe("// +www.youtube.com/embed/8OUvFd-jMGY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L2_IsPointOnLine.pdf +!,"lecture notes on whether a point is on a line", "TARGET='_blank'") \} +$PAR +Video lecture on whether a point is on a line (start from 4:50) +$PAR +\{ scalableiframe("// +www.youtube.com/embed/l2veOwP9xr4?start=290 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphTwoVariableInequalities.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphTwoVariableInequalities.pg new file mode 100644 index 0000000000..5859ad3722 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphTwoVariableInequalities.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L10_GraphTwoVariableInequalities.pdf +!,"lecture notes on graphing two-variable inequalities", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/_E0GKBVkins +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphingLineSummary.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphingLineSummary.pg new file mode 100644 index 0000000000..1c1ba555aa --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphingLineSummary.pg @@ -0,0 +1,101 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L6_SummaryOfGraphingLines.pdf +!,"lecture notes on summary of graphing lines", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/hs7BxU2strY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/InequalityApplications.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/InequalityApplications.pg new file mode 100644 index 0000000000..e80872fc1e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/InequalityApplications.pg @@ -0,0 +1,105 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U6L3_InequalityApplications.pdf +!,"lecture notes on inequality applications", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/yzv1JyywmSk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/2dSExvlPj3Y +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/IntegerOperations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/IntegerOperations.pg new file mode 100644 index 0000000000..cf53be0329 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/IntegerOperations.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH60Docs/U1L1_MultiplyDivideIntegers.pdf!,"Lecture notes on how to multiply/divide integers", "TARGET='_blank'") \} +$PAR +\{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH60Docs/U1L1_AddSubtractIntegers.pdf!,"lecture notes on how to add/subtract integers", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/JvoAnytWm7A +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/LinearEquationApplications.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/LinearEquationApplications.pg new file mode 100644 index 0000000000..4ebc0ff302 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/LinearEquationApplications.pg @@ -0,0 +1,105 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L8_LinearEquationApplications.pdf +!,"lecture notes on linear equation applications", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/sc6folGNeiY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/LT6-O-4pjg4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixedNumbersEquivalentFractions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixedNumbersEquivalentFractions.pg new file mode 100644 index 0000000000..7fcffb0961 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixedNumbersEquivalentFractions.pg @@ -0,0 +1,109 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq!http://spot.pcc.edu/~cyao/MTH60Docs/U2L1_MixedNumbersAndEquivalentFractions.pdf!,"lecture notes on mixed numbers and how to reduce fractions", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/87DiYdRXZDI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/HkELb2btWQQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/eAzfN0o3CgY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixtureWordProblems.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixtureWordProblems.pg new file mode 100644 index 0000000000..8395a8d675 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixtureWordProblems.pg @@ -0,0 +1,115 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U7L4_MixtureProblems.pdf +!,"lecture notes on mixture word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/OBVGQt1Eeug +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/JVlfQEhzLMM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/QKiN9K2DXBI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/o1XpzeUpcRI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MultiplyDivideFractions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MultiplyDivideFractions.pg new file mode 100644 index 0000000000..fb6942e987 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/MultiplyDivideFractions.pg @@ -0,0 +1,117 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U2L3_MultiplyDivideFractions.pdf +!,"lecture notes on multiplying/dividing fractions", "TARGET='_blank'") \} +$PAR + +Video lecture on multiplying fractions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/rxISl5boIuE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on dividing fractions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/zQMU-lsMb3U +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on multiplying and dividing fractions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/8zWZnNpEFY4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/NumberSets.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/NumberSets.pg new file mode 100644 index 0000000000..e6d4e1d6d9 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/NumberSets.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L1_SubsetsOfRealNumbers.pdf +!,"lecture notes on subsets of real numbers", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/4FyqMDHAo48 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/OrderOfOperations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/OrderOfOperations.pg new file mode 100644 index 0000000000..3f79c2c122 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/OrderOfOperations.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L4_OrderOfOperations.pdf +!,"lecture notes on order of operations", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/vDaIKB19TvY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/si_OegYqXDo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/OlVvUd1XVVg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ParallelPerpendicularLines.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ParallelPerpendicularLines.pg new file mode 100644 index 0000000000..b2b166ed0e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ParallelPerpendicularLines.pg @@ -0,0 +1,109 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L9_ParallelAndPerpendicularLines.pdf +!,"lecture notes on parallel and perpendicular lines", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/9hryH94KFJA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/O397kMqSBKI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Ad9fwGCJ6WU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PercentOfIncreaseDecrease.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PercentOfIncreaseDecrease.pg new file mode 100644 index 0000000000..28b4c08174 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PercentOfIncreaseDecrease.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U7L1_PercentOfIncreaseAndDecrease.pdf +!,"lecture notes on percent of increase/decrease word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/qs-5b2IBvB8?start=983 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PerimeterArea.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PerimeterArea.pg new file mode 100644 index 0000000000..b436a1cc80 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/PerimeterArea.pg @@ -0,0 +1,115 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U9L1_PerimeterAndCircumference.pdf +!,"lecture notes on perimeter and circumference", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/CPNGuZsjDxA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U9L2_AreaOfCommonShapes.pdf +!,"lecture notes on area of common shapes", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/kqqmJiJez6o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/tCrDyJsSFok +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ProportionWordProblems.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ProportionWordProblems.pg new file mode 100644 index 0000000000..a5024c974d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/ProportionWordProblems.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U8L2_ProportionWordProblems.pdf +!,"lecture notes on proportion word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/89H0Vsn7oC4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/PoEzBw7hJVU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/RateAndStartValueWordProblem.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/RateAndStartValueWordProblem.pg new file mode 100644 index 0000000000..e4931ae209 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/RateAndStartValueWordProblem.pg @@ -0,0 +1,109 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U5L3_RateAndStartingValueWordProblems.pdf +!,"lecture notes on Rate and Starting Value word problems", "TARGET='_blank'") \} +$PAR +First video lecture on Rate and Starting Value word problems (watch from 11:23 till 16:17) +$PAR +\{ scalableiframe("// +www.youtube.com/embed/qs-5b2IBvB8?start=683 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/cxGw0C9kXek +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/qPx7i1jwXX4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SimplifyExpressions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SimplifyExpressions.pg new file mode 100644 index 0000000000..14afc8dd48 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SimplifyExpressions.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L6_SimplifyExpressions.pdf +!,"lecture notes on simplifying expressions", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/xqLDbfbL7pI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/YURDKBg9-Aw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Slope.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Slope.pg new file mode 100644 index 0000000000..4eaff90270 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Slope.pg @@ -0,0 +1,111 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L3_Slope.pdf +!,"lecture notes on slope", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/fCIuiQz2Zv4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/SM3bj7zA0FM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/bploNzF7cxg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/hPryexyt6Sg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SlopeInterceptEquation.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SlopeInterceptEquation.pg new file mode 100644 index 0000000000..2b2f753e9d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SlopeInterceptEquation.pg @@ -0,0 +1,114 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L4_SlopeInterceptFormEquations.pdf +!,"lecture notes on slope-intercept equations", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/U6x-L49_P0k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +Second video lecture on slope-intercept equations (watch from 7:08 to 13:50) +$PAR +\{ scalableiframe("// +www.youtube.com/embed/OxAlSHlEpwk?start=428 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L4_GraphWithPointAndSlope.pdf +!,"lecture notes on graphing a line by slope and y-intercept", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/DBr4o6SVE2k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveEquationsWithFractions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveEquationsWithFractions.pg new file mode 100644 index 0000000000..a149417878 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveEquationsWithFractions.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L5_SolveLinearEquationsWithFractions.pdf +!,"lecture notes on solving linear equations with fractions", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/c8H1kqK1XnA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/1jjlful2BBY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveForVariable.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveForVariable.pg new file mode 100644 index 0000000000..f922b084c6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveForVariable.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L6_SolveForVariable.pdf +!,"lecture notes on solving for a variable", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/OQBJep7Gctw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/rS4JPQE4WHw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/IaE5RTnL8C8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveInequalities.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveInequalities.pg new file mode 100644 index 0000000000..9e8d40144c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveInequalities.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U6L1_SolveInequalities.pdf +!,"lecture notes on solving inequalities", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/XFggbIhEvvE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveMultiStepEquations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveMultiStepEquations.pg new file mode 100644 index 0000000000..d1390758c5 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveMultiStepEquations.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L3_SolveMultiStepLinearEquations.pdf +!,"lecture notes on solving multi-step equations", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/MA2-tCfmQnw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/VDIXnZH6q00 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/5lZDQnRcAVc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/typP7RBQ6ps +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveOneStepEquation.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveOneStepEquation.pg new file mode 100644 index 0000000000..b84bbbfd71 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveOneStepEquation.pg @@ -0,0 +1,123 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L1_SolveOneStepLinearEquations.pdf +!,"lecture notes on solving one-step equations", "TARGET='_blank'") \} +$PAR +Video lecture on how to check solutions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/BmzsG2LMUnI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Video lecture on solving one-step equations +$PAR +\{ scalableiframe("// +www.youtube.com/embed/g6jeSuHYhyY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +First video lecture on solving one-step equations with fractions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/jWlEyVkqw_Q +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +Second video lecture on solving one-step equations with fractions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LWV7bjoh4rQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveProportions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveProportions.pg new file mode 100644 index 0000000000..aa4a24041f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveProportions.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U8L1_SolveProportions.pdf +!,"lecture notes on solving proportions", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/l_s3t5zgnOs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveTwoStepEquations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveTwoStepEquations.pg new file mode 100644 index 0000000000..cb88f3274c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveTwoStepEquations.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L2_SolveTwoStepLinearEquations.pdf +!,"lecture notes on solving two-step equations", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/XdKQIKjV_LY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/1c5HY3z4k8M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/f15zA0PhSek +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialCaseInequalities.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialCaseInequalities.pg new file mode 100644 index 0000000000..5bc3aabaf9 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialCaseInequalities.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U6L2_SpecialCaseInequalities.pdf +!,"lecture notes on solving inequalities with special solutions", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/v=jNomYBR5rMU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialSolutions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialSolutions.pg new file mode 100644 index 0000000000..945964fe7a --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialSolutions.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U4L4_SpecialLinearEquations.pdf +!,"lecture notes on solving linear equations with special solutions", "TARGET='_blank'") \} +$PAR +First video lecture on solving linear equations with special solutions +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GM76QU5Tr9k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.khanacademy.org/embed_video?v=qsL_5Y8uWPU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.khanacademy.org/embed_video?v=uQs100shv-A +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.khanacademy.org/embed_video?v=Dq0xFgQB9qo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/StandardFormEquations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/StandardFormEquations.pg new file mode 100644 index 0000000000..85e18982b6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/StandardFormEquations.pg @@ -0,0 +1,114 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L5_StandardFormEquation.pdf +!,"lecture notes on standard-form equations", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/V6Xynlqc_tc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/dZT203NHvaM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L5_GraphLineByIntercepts.pdf +!,"lecture notes on graphing a line by intercepts", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/0o4gps38dBU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SumAndPartWordProblems.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SumAndPartWordProblems.pg new file mode 100644 index 0000000000..fc217ea188 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/SumAndPartWordProblems.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U5L2_GivenSumFindPartsWordProblems.pdf +!,"lecture notes on 'Given Sum, Find Parts' word problems", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/GQhGGZc772E +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/TranslatingWordsIntoAlgebra.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/TranslatingWordsIntoAlgebra.pg new file mode 100644 index 0000000000..c38dd9e859 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/TranslatingWordsIntoAlgebra.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U3L7_TranslateWordsIntoAlgebraicExpressions.pdf +!,"lecture notes on translating words to Algebraic expressions", "TARGET='_blank'") \} +$PAR + +\{ scalableiframe("// +www.youtube.com/embed/Gm8AaLLMepU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/g6jeSuHYhyY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Trigonometry.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Trigonometry.pg new file mode 100644 index 0000000000..b67d33f0bc --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Trigonometry.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U11L1_RightTriangleTrigonometry.pdf +!,"lecture notes on trigonometry", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Jsiy4TxgIME +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Volume.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Volume.pg new file mode 100644 index 0000000000..79ded627b1 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH060/Volume.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U9L3_VolumeOfCommonSolids.pdf +!,"lecture notes on volume", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/b_JhWim9mR0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/AddSubtractPolynomials.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/AddSubtractPolynomials.pg new file mode 100644 index 0000000000..57f703c79b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/AddSubtractPolynomials.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U3L1_AddAndSubtractPolynomials.pdf +!,"lecture notes on adding/subtracting polynomials", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ZN-IzpUR8WQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/DividePolynomials.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/DividePolynomials.pg new file mode 100644 index 0000000000..61bd007289 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/DividePolynomials.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U3L3_DivideMonomials.pdf +!,"lecture notes on dividing polynomials", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/OZjqWAaUkFU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/uERRlY-WmmU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ExponentReview.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ExponentReview.pg new file mode 100644 index 0000000000..713be39cb8 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ExponentReview.pg @@ -0,0 +1,115 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U2L1_MoreExponentRules.pdf +!,"lecture notes on exponent rules", "TARGET='_blank'") \} +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U2L1_UseMultipleExponentRules.pdf +!,"lecture notes on using exponent rules", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/5oJobyGnhDk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/oHNe8AK0E9M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/heUUBzvYA1o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CrJEOQh5UXg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorByGrouping.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorByGrouping.pg new file mode 100644 index 0000000000..2f09ad6aec --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorByGrouping.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"lecture notes on factoring by grouping", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/N9Yg6pVGP7A +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/2MtsZRjxjMo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorOutCommonFactors.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorOutCommonFactors.pg new file mode 100644 index 0000000000..333e9bea77 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorOutCommonFactors.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U4L1_CommonFactors.pdf +!,"lecture notes on factoring out common factors", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/WOCCSoaZRv8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/bLI6NOZ8kdY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorSpecialPolynomials.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorSpecialPolynomials.pg new file mode 100644 index 0000000000..f6c2514361 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorSpecialPolynomials.pg @@ -0,0 +1,107 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U4L5_FactorSpecialPolynomials.pdf +!,"lecture notes on factoring special polynomials", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LdOgluTLBxQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Fwqh9vq0sq8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/icm6zjdOYek +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialWhenAIs1.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialWhenAIs1.pg new file mode 100644 index 0000000000..63ee61eba7 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialWhenAIs1.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U4L3_FactorTrinomialsPart1.pdf +!,"lecture notes on factoring trinomials with leading coefficient 1", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/06RdArZXthg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/BQaOVcJ7KmE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/BG53n9Ef4fM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialsWhenAIsNot1.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialsWhenAIsNot1.pg new file mode 100644 index 0000000000..21422a6b32 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialsWhenAIsNot1.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U4L4_FactorTrinomialsPart2.pdf +!,"lecture notes on factoring ax^2+bx+c", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/thMv6JovewA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/85a9bkP85ag +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ld4VT_ml3Nk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/a1VOMsR8iZo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FallingObjectApplications.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FallingObjectApplications.pg new file mode 100644 index 0000000000..c3d99a4be6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/FallingObjectApplications.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L9_FallingObjectApplication.pdf +!,"lecture notes on falling object applications", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/3PfiCtfmJA8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/F--p_CeKJNQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/cNU8mnAlGus +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/Functions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/Functions.pg new file mode 100644 index 0000000000..179335b812 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/Functions.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U11L1_IntroductionToFunctions.pdf +!,"lecture notes on functions", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/JZmIsxayvxY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/IntroductionToSquareRoot.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/IntroductionToSquareRoot.pg new file mode 100644 index 0000000000..b5e78e31a5 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/IntroductionToSquareRoot.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U5L1_IntroductionToSquareRoot.pdf +!,"lecture notes on square roots", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/yVUtSYPYM5M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CCd1HrPizmw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MaximumMinimumApplications.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MaximumMinimumApplications.pg new file mode 100644 index 0000000000..0c8ea2f3ae --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MaximumMinimumApplications.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L8_ParabolaMinMaxApplications.pdf +!,"lecture notes on maximum/minimum value applications", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Qs_WqhoVBDI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ipBoVSMVzp0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MovingParabolaUpDown.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MovingParabolaUpDown.pg new file mode 100644 index 0000000000..4f2b4af756 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MovingParabolaUpDown.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L1_ParabolaUpDown.pdf +!,"lecture notes on moving parabola up/down", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/33CYnBnYsyk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MultiplyingPolynomials.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MultiplyingPolynomials.pg new file mode 100644 index 0000000000..4c3c02effd --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/MultiplyingPolynomials.pg @@ -0,0 +1,117 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U3L2_MultiplyPolynomials.pdf +!,"lecture notes on multiplying polynomials", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/7eifTvsbU38 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/iQ6NaQOECTA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U3L2_SpecialProductOfPolynomials.pdf +!,"lecture notes on special product of polynomials", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/AecdR8wpIWM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/bRonwACbTnc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/NegativeExponents.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/NegativeExponents.pg new file mode 100644 index 0000000000..713be39cb8 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/NegativeExponents.pg @@ -0,0 +1,115 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U2L1_MoreExponentRules.pdf +!,"lecture notes on exponent rules", "TARGET='_blank'") \} +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U2L1_UseMultipleExponentRules.pdf +!,"lecture notes on using exponent rules", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/5oJobyGnhDk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/oHNe8AK0E9M +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/heUUBzvYA1o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CrJEOQh5UXg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaAxisAndVertex.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaAxisAndVertex.pg new file mode 100644 index 0000000000..f161047df4 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaAxisAndVertex.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L5_ParabolaAxisAndVertex.pdf +!,"lecture notes on parabola axis and vertex", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/RkLSWfoYg98 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaIntercepts.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaIntercepts.pg new file mode 100644 index 0000000000..3224f0bf38 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaIntercepts.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L6_ParabolaIntercepts.pdf +!,"lecture notes on parabola intercepts", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Ep2Tdu6Xn5E +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaMovementSummary.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaMovementSummary.pg new file mode 100644 index 0000000000..be3fe3362c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaMovementSummary.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L4_ParabolaMovementPatterns.pdf +!,"lecture notes on parabola movement summary", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/HC5DDlEwTJw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Fw8vuktklwE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaShiftingLeftRight.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaShiftingLeftRight.pg new file mode 100644 index 0000000000..6d743f4564 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaShiftingLeftRight.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L3_ParabolaLeftRight.pdf +!,"lecture notes on parabolas shifting left or right", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/g_FXRRKg3UM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaThinnerWider.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaThinnerWider.pg new file mode 100644 index 0000000000..20795afec2 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaThinnerWider.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L2_ParabolaThinnerWider.pdf +!,"lecture notes on parabolas becoming thinner or wider", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/WtHgKSv02lM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/TGLjBgxvaFY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/QuadraticEquationApplications.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/QuadraticEquationApplications.pg new file mode 100644 index 0000000000..32dd9f482b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/QuadraticEquationApplications.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L4_QuadraticEquationApplications.pdf +!,"lecture notes on quadratic equation applications", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/uoT5gmF1HoQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/haJJLYT6lro +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/RationalizeDenominator.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/RationalizeDenominator.pg new file mode 100644 index 0000000000..65eda8710e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/RationalizeDenominator.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U5L4_RationalizeDenominator.pdf +!,"lecture notes on rationalizing denominator", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/mYiN8KzQ5n8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ReviewGraphingLines.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ReviewGraphingLines.pg new file mode 100644 index 0000000000..8ce52e0d44 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ReviewGraphingLines.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH60Docs/U10L6_SummaryOfGraphingLines.pdf +!,"lecture notes on summary of graphing lines", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/hs7BxU2strY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ScientificNotation.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ScientificNotation.pg new file mode 100644 index 0000000000..d24f0d48d8 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/ScientificNotation.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U2L2_ScientificNotation.pdf +!,"lecture notes on scientific notations", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/b1HmilCg5Uw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SimplifySquareRoots.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SimplifySquareRoots.pg new file mode 100644 index 0000000000..723184dddb --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SimplifySquareRoots.pg @@ -0,0 +1,117 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U5L2_SimplifySquareRoot.pdf +!,"lecture notes on simplifying square roots", "TARGET='_blank'") \} +$PAR +First video lecture on simplifying square roots +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ZDyScPdbTNs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Second video lecture on simplifying square roots (watch from 2:08 to 4:48) +$PAR +\{ scalableiframe("// +www.youtube.com/embed/uL4uJ3BrTJw?start=128 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +$PAR +Video lecture on Quotient Rule of Radicals (watch till 3:20) +$PAR +\{ scalableiframe("// +www.youtube.com/embed/OhzCKJt4uQI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SketchingParabolas.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SketchingParabolas.pg new file mode 100644 index 0000000000..a4f6fc5503 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SketchingParabolas.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U7L7_SketchingParabolas.pdf +!,"lecture notes on sketching parabolas", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/BXkLUY5JxAE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/9HE1kWHMTEI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByFactoring.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByFactoring.pg new file mode 100644 index 0000000000..ba827c0bbf --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByFactoring.pg @@ -0,0 +1,107 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L2_SolveQuadraticEquationsByFactoring.pdf +!,"lecture notes on solving quadratic equation by factoring", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/2ZzuZvz33X0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/04RpkdaNzr8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vl9o9XEfXtw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByQuadraticFormula.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByQuadraticFormula.pg new file mode 100644 index 0000000000..1cb89802cb --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByQuadraticFormula.pg @@ -0,0 +1,116 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L3_SolveQuadraticEquationsByQuadraticFormula.pdf +!,"lecture notes on solving quadratic equation by Quadratic Formula", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LkmjnxZ-FuU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/uhHWlBLpvWA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CLrImGKeuEI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L3_NumberOfSolutionsOfQuadraticEquation.pdf +!,"lecture notes on the number of solutions of a quadratic equation", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/QOqA8KQMJhE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationBySquareRootProperty.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationBySquareRootProperty.pg new file mode 100644 index 0000000000..68d81513d3 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationBySquareRootProperty.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L1_SolveQuadraticEquationsBySquareRootProperty.pdf +!,"lecture notes on solving quadratic equation by square root property", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/6QTNwvnIoDk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/lpscRx-Mfdk?start=217 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByElimination.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByElimination.pg new file mode 100644 index 0000000000..324464e8a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByElimination.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U1L4_SolveSystemsByElimination.pdf +!,"lecture notes on solving system equations by elimination", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/sZJIzbxBQSg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByGraphing.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByGraphing.pg new file mode 100644 index 0000000000..783557f5ca --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByGraphing.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U1L2_SolveSystemByGraphing.pdf +!,"lecture notes on solving system equations by graphing", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/3VbpmoGCWPA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U1L2_CheckSolutionOfSystemEquation.pdf +!,"lecture notes on checking solution of a system equation", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Pe-7dgD6bRE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemBySubstitution.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemBySubstitution.pg new file mode 100644 index 0000000000..bfdd2c5279 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemBySubstitution.pg @@ -0,0 +1,103 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U1L3_SolveSystemBySubstitution.pdf +!,"lecture notes on solving system equations by substitution", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Y3lx2S8uCX4 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ZqEDFqX4OwE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SquareRootOperations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SquareRootOperations.pg new file mode 100644 index 0000000000..b5ab830247 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SquareRootOperations.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U5L3_SquareRootOperations.pdf +!,"lecture notes on square root operations", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/-4Z3cfQbSCk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/hmr73HQqEa0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SystemEquationApplications.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SystemEquationApplications.pg new file mode 100644 index 0000000000..00f0ef1dad --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/SystemEquationApplications.pg @@ -0,0 +1,99 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U1L5_SystemEquationApplications.pdf +!,"lecture notes on system equation applications", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CF_BCdOoxhk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/TrigonometryRatios.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/TrigonometryRatios.pg new file mode 100644 index 0000000000..0a21697878 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH065/TrigonometryRatios.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U5L5_TrigonometryValues.pdf +!,"lecture notes on trigonometry ratios", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Jsiy4TxgIME +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/G-T_6hCdMQc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Add_Subtract_Rational_Expressions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Add_Subtract_Rational_Expressions.pg new file mode 100644 index 0000000000..2077576e2d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Add_Subtract_Rational_Expressions.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/w7NhLkQynS8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/IKsi-DQU2zo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Calculator_Basics.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Calculator_Basics.pg new file mode 100644 index 0000000000..ad1541cd45 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Calculator_Basics.pg @@ -0,0 +1,96 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"There are unfortunately no videos available. Please use the Show Me Another button (which has solutions) and tutors for help.", "TARGET='_blank'") \} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Complex_Number_Operations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Complex_Number_Operations.pg new file mode 100644 index 0000000000..ca5ee30013 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Complex_Number_Operations.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/zK25rGJBfB0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/b9jIuySxN8c +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/My9MfX2dv54 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LuyODzozd44 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Divide_Rational_Expressions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Divide_Rational_Expressions.pg new file mode 100644 index 0000000000..2acb5776c6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Divide_Rational_Expressions.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/gcnk8TnzsLc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Domain_Range.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Domain_Range.pg new file mode 100644 index 0000000000..f0a8bb08b9 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Domain_Range.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/CTQK6Sthn7k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/QAxZEelInJc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Notation.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Notation.pg new file mode 100644 index 0000000000..ea53566efb --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Notation.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/j4t73jk2VzE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/EmTvdKkAUtE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/kzYtx_AqzjM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg new file mode 100644 index 0000000000..be4f013e69 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg @@ -0,0 +1,184 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Multiply_Rational_Expressions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Multiply_Rational_Expressions.pg new file mode 100644 index 0000000000..3f4afd04f6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Multiply_Rational_Expressions.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/f-wz_ZzSDdg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/3GL69IA2q4s +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Operations_with_Radicals.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Operations_with_Radicals.pg new file mode 100644 index 0000000000..8564b14e7c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Operations_with_Radicals.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/egNq4tSfi1I +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/qH4IQfDD1Nw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GEeKOeGHddY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/sBvRJUwXJPo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Equations_with_Complex_Solutions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Equations_with_Complex_Solutions.pg new file mode 100644 index 0000000000..6cdb26e1e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Equations_with_Complex_Solutions.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/dnjK4DPqh0k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Formula.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Formula.pg new file mode 100644 index 0000000000..1cb89802cb --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Formula.pg @@ -0,0 +1,116 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L3_SolveQuadraticEquationsByQuadraticFormula.pdf +!,"lecture notes on solving quadratic equation by Quadratic Formula", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LkmjnxZ-FuU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/uhHWlBLpvWA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/CLrImGKeuEI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +\{ htmlLink(qq! +http://spot.pcc.edu/~cyao/MTH65Docs/U6L3_NumberOfSolutionsOfQuadraticEquation.pdf +!,"lecture notes on the number of solutions of a quadratic equation", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/QOqA8KQMJhE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions.pg new file mode 100644 index 0000000000..28514b713f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/02h9yhc7ruc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/w3OSfRSaVeQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions_Vertex_Form.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions_Vertex_Form.pg new file mode 100644 index 0000000000..7e087c5508 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions_Vertex_Form.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/aOS6OfB5-9o +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/jP43EY-S_tg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/Ur3mFyTKqQg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/lgWa6CvJjYw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/02h9yhc7ruc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/w3OSfRSaVeQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Radical_Functions_Domain_Range.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Radical_Functions_Domain_Range.pg new file mode 100644 index 0000000000..60cba97d92 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Radical_Functions_Domain_Range.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/4h54s7BBPpA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/hZEGZMb4uzQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Exponents.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Exponents.pg new file mode 100644 index 0000000000..7a4b22e603 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Exponents.pg @@ -0,0 +1,116 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/3YbwhlqlvPs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/LoZn5mfbHr8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ry-oYLDi4L8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GJWekWPKopo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/AyS4qUtTYcA +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Functions_Domain.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Functions_Domain.pg new file mode 100644 index 0000000000..5fb2c67649 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Functions_Domain.pg @@ -0,0 +1,108 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/Gvhplmx9QPM +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/v0IhvIzCc_I +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/GeOZHxQRMvc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Complex_Number_Denominators.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Complex_Number_Denominators.pg new file mode 100644 index 0000000000..9e743b7199 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Complex_Number_Denominators.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/EyzepHsj7OI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/PCHqM_2rtbw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Radical_Denominators.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Radical_Denominators.pg new file mode 100644 index 0000000000..9509f5866b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Radical_Denominators.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/6864x4JSmxY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/zLS469sfcJI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Complex_Rational_Expressions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Complex_Rational_Expressions.pg new file mode 100644 index 0000000000..2b1bf155f5 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Complex_Rational_Expressions.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/S0LekyH8yVU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/q4aMMtSvsvI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/jSnHRp8TjXY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/aMswqN951OY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Radical_Expressions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Radical_Expressions.pg new file mode 100644 index 0000000000..7828e4f525 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Radical_Expressions.pg @@ -0,0 +1,104 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/uggD8mwglyc +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/c-wtvEdEoVs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Rational_Expressions.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Rational_Expressions.pg new file mode 100644 index 0000000000..d7ab4985db --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Rational_Expressions.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/7Uos1ED3KHI +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/XChok8XlF90 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ey_b3aPsRl8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/dstNU7It-Ro +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Equations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Equations.pg new file mode 100644 index 0000000000..cf445b3a6b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Equations.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/iTV9CRmfA-w +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/1tbve9nAq-Y +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/sJWCz2UGuZg +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/YW1vdoKDzjE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Inequalities.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Inequalities.pg new file mode 100644 index 0000000000..5772b07d8f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Inequalities.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/dArQeGaXOh0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/pqcCcj1UMPw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/s5Jr6RJBl28 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/wfFdzihH87s +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/SSWUbC9fQoQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/4u-s5mB6MDU +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Inequalities.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Inequalities.pg new file mode 100644 index 0000000000..74af98e1e1 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Inequalities.pg @@ -0,0 +1,116 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/JBjMwlyaqnw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ewsTyLdgryw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/5P3kfiHpErs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/HX4YVZt9mgo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/S8Ul3rqVpVQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Literal_Rational_Equations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Literal_Rational_Equations.pg new file mode 100644 index 0000000000..ae48e9d5c0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Literal_Rational_Equations.pg @@ -0,0 +1,100 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/iqneTqLbMfY +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Quadratic_Equations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Quadratic_Equations.pg new file mode 100644 index 0000000000..a2bc6824b9 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Quadratic_Equations.pg @@ -0,0 +1,117 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR +$PAR +\{ scalableiframe("// +www.youtube.com/embed/6QTNwvnIoDk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/lpscRx-Mfdk?start=217 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/2ZzuZvz33X0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/04RpkdaNzr8 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/vl9o9XEfXtw +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"There are unfortunately no videos available. Please use the Show Me Another button (which has solutions) and tutors for help.", "TARGET='_blank'") \} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Radical_Equations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Radical_Equations.pg new file mode 100644 index 0000000000..da8544cec5 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Radical_Equations.pg @@ -0,0 +1,116 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/n6NBXVUS29U +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/ILBqcnXTDBE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/52xMzV5EqNE +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/DNp5slhIh6k +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/luQqQbBK2uo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations.pg new file mode 100644 index 0000000000..69ae3b3508 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations.pg @@ -0,0 +1,120 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/5vrUyeKemLs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/vvWAIdPHG68 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/MxnlmG61lXo +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/R96n_Jze8E0 +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/Z50kmCwgivs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/dGM7obRrJqs +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations_Applications.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations_Applications.pg new file mode 100644 index 0000000000..e5539b2c87 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations_Applications.pg @@ -0,0 +1,112 @@ +# ASimpleCombinedHeaderFile.pg +# This header file can be used for both the screen and hardcopy output + + +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + +TEXT($BEGIN_ONE_COLUMN); + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# +#################################################### + + + +TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +{\large \bf {\{protect_underbar($courseName)\}}} +% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX +% {\large \bf { Section: \{protect_underbar($sectionName)\} } } +\par +\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}} +\par\noindent \bigskip +% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. +%See the course web page for information http://yoururl/yourcourse + +%$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : %$formattedDueDate. $EBOLD +%$PAR +%Here's the list of +%\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and %symbols", "TARGET='_blank'") \} +% which WeBWorK understands. +%$BR + +EOT + +#################################################### +# +# End of hardcopy only output. +# +#################################################### + + +#################################################### +# +# The items below are printed out only when set is displayed on screen +# +#################################################### +TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); + +$PAR +\{ htmlLink(qq! +%http://spot.pcc.edu/~cyao/MTH65Docs/U4L2_FactorByGrouping.pdf +!,"", "TARGET='_blank'") \} +$PAR +\{ scalableiframe("https:// +www.youtube.com/embed/B83AVXXJrdQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/E1j8W64NQ0Y +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/B0Z4s38YIgQ +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR +\{ scalableiframe("// +www.youtube.com/embed/G-JFTXtXSqk +", style=>'position: relative; width: 100%; height: 0px; padding-bottom: 62%;' )\} +$PAR + + +EOT + +#################################################### +# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); +#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} +#EOT +#################################################### + +#################################################### +# +# End of screen only output. +# +#################################################### + +#################################################### +# +# Anything between the BEGIN_TEXT AND END_TEXT lines +# will be printed in both screen and hardcopy output +# +#################################################### + +BEGIN_TEXT + +END_TEXT + + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg new file mode 100644 index 0000000000..be4f013e69 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg @@ -0,0 +1,184 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg new file mode 100644 index 0000000000..be4f013e69 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg @@ -0,0 +1,184 @@ +DOCUMENT(); + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + +); + + + +#################################################### +# +# The item below printed out only when a hardcopy is made. +# It puts the student's name at top left, course name +# and section number at top right +# +#################################################### + +TEXT($BEGIN_ONE_COLUMN); + +TEXT(MODES(TeX =>EV3(<<'END_TEXT'),HTML=>"")); + +\noindent {\large \bf $studentName} +\hfill +\noindent {\large \bf \{protect_underbar($courseName)\} +$sectionNumber } +\par + +END_TEXT + +########################################################## +# +# Items printed both to the screen and when a hardcopy is made. +# +# A statement with the due date. +# +# A link to MyPCC. You could change this to your course's +# website, if there is one. +# +########################################################## + +BEGIN_TEXT + +$BBOLD This assignment (\{ protect_underbar($setNumber) \} ) +is due : $formattedDueDate. $EBOLD + +$PAR + +More information about your course can be found in MyPCC or DesireToLearn: +\{ +htmlLink(qq!http://my.pcc.edu/!,"MyPCC") +\}. +$PAR + +END_TEXT +########################################################### +# +# This is a good place to issue instructions or give comments +# that are specific for this problem set. You might need some +# WeBWorK formatting commands though. Here is a fairly complete +# list: +# +# $BR line break +# $PAR paragraph break +# $BBOLD and $EBOLD begin and end boldface +# $BITALIC and $EITALIC begin and end italics +# $BUL and $EUL begin and end underline +# $BCENTER and $ECENTER begin and end centering +# $HR make a horizontal rule (line) +# +# $SPACE force a space where one isn't +# automatically created +# +# Some characters should not be literally typed, since they have +# control functions in Perl or produce different characters in LaTeX. +# Also, the character might not even be a keyboard character. Using +# them will either cause erroneous text in WeBWorK or in the printed +# hardcopy version of an assignment. If you need to use these +# characters, here are their commands: +# +# $CARET ^ a caret +# $PERCENT % percent sign +# $DOLLAR $ dollar sign +# $US _ underscore +# $LQ left double quote +# $RQ right double quote +# +# These two require special attention. For the set header, use: +# $GTS > greater than sign +# $LTS < less than sign +# But for the hardcopy header, use: +# \textgreater > greater than sign +# \textless < less than sign +# +# And these two require special attention. For the set header, +# type them as is +# { { left brace +# } } right brace +# But for the hardcopy header, use: +# $LBRACE { left brace +# $RBRACE } right brace +# +# +# Also, here are some basic LaTeX commands that will probably +# come in handy. All LaTeX needs to be encased in \( and \). +# (Or you can encase them in \[ and \] for display math mode.) +# +# \frac{a}{b} to make a fraction +# \pi pi +# \geq greater than or equal to +# \leq less than or equal to +# \sin, \cos, \ln nicely typeset function names +# \{, \} braces in math mode +# \left( if you write a grouping symbol +# \left[ this way, it will be large enough +# \left\{ to encase whatever comes between +# it and the corresponding \right) +# \right] +# \right\} +# +########################################################### +BEGIN_TEXT +$HR +$PAR + + + +This assignment covers material from \{ protect_underbar($setNumber) \}. + + +$PAR +$HR +END_TEXT +########################################################### +# EDIT ABOVE 'END_TEXT' +########################################################### + +########################################################### +# +# The item below will be printed for both the screen version and the +# hardcopy version. This is a section for general information about +# using WeBWorK. +# +########################################################### +$two = 2; +BEGIN_TEXT + +The primary purpose of WeBWorK is to let you know that you are getting the +correct answer or to alert you if you are making some kind of mistake. Usually +you can attempt a problem multiple times before the due date and try to learn from your mistakes. If you are having trouble with a problem, you should consult the book or your notes, or ask a fellow student, a tutor, or your professor for help. Don't spend a lot of time guessing - it's not very efficient or effective. + +$PAR + +Give 4 or 5 significant digits for decimal answers. However, sometimes a +problem will require you to give an exact answer, and a decimal approximation +will be counted as wrong. + +$PAR + +If you get a problem wrong, always read the feedback message if there is one. WeBWorK tries to let you know what format it is expecting. It also tries to let you know how your math might be wrong. + +$PAR + +Here's the list of +\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} + that WeBWorK understands. + +$PAR +Most of the time if WeBWorK is telling you that your answer is incorrect, your +answer is actually incorrect. This is a good thing - it gives +you a chance to learn. Read the error message if WeBWorK makes one for you. +This may help you find your mistake. Otherwise, you have the opportunity to +ask your instructor for help. +$PAR +You can use the Email instructor button on each problem +page to send e-mail to the instructor. + + + +END_TEXT + +TEXT($END_ONE_COLUMN); + +ENDDOCUMENT(); # This should be the last executable line. \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Fractions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Fractions.def new file mode 100644 index 0000000000..e755d94658 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Fractions.def @@ -0,0 +1,48 @@ +openDate = 01/01/2014 at 12:48am PST +dueDate = 06/30/2015 at 01:48am PDT +answerDate = 06/30/2015 at 01:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractFractions.pg +description = add and subtract fractions, not involving mixed numbers +problemList = +BasicAlgebra/FractionArithmetic/AddFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions08.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions12.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions24.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions01.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions05.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions90.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions90.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems60.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionAdditionWordProblems70.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems60.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems70.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems75.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionSubtractionWordProblems80.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Integers.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Integers.def new file mode 100644 index 0000000000..0fb426d0af --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Integers.def @@ -0,0 +1,27 @@ +openDate = 01/01/2014 at 12:33am PST +dueDate = 06/30/2015 at 01:33am PDT +answerDate = 06/30/2015 at 01:33am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractIntegers.pg +description = add and subtract positive and negative numbers +problemList = +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Mixed_Numbers.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Mixed_Numbers.def new file mode 100644 index 0000000000..1d1c363f1f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setAdd_Subtract_Mixed_Numbers.def @@ -0,0 +1,49 @@ +openDate = 01/01/2014 at 01:03am PST +dueDate = 06/30/2015 at 02:03am PDT +answerDate = 06/30/2015 at 02:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/AddSubtractMixedNumbers.pg +description = add and subtract mixed numbers +problemList = +BasicMath/FractionsCalculation/MixedNumberAddition10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition40.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition46.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition48.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition49.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition60.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition70.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition80.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition90.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition110.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition120.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition160.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition190.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition220.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition230.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberAddition240.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction60.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction70.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction80.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction140.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction160.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction190.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction210.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction220.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction230.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberSubtraction240.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberAdditionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberAdditionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberAdditionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberAdditionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberAdditionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberSubtractionWordProblems60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Addition_Subtraction.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Addition_Subtraction.def new file mode 100644 index 0000000000..7e25833db6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Addition_Subtraction.def @@ -0,0 +1,17 @@ +openDate = 01/01/2014 at 01:18am PST +dueDate = 06/30/2015 at 02:18am PDT +answerDate = 06/30/2015 at 02:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAdditionSubtraction.pg +description = add and subtract decimals +problemList = +BasicMath/Decimal/AddSubtractDecimals10.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals12.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals15.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals20.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals25.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals26.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals30.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals40.pg, 1, -1, 0 +BasicMath/Decimal/AddSubtractDecimals50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Definition.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Definition.def new file mode 100644 index 0000000000..7e5bb43477 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Definition.def @@ -0,0 +1,38 @@ +openDate = 01/01/2014 at 01:15am PST +dueDate = 06/30/2015 at 02:15am PDT +answerDate = 06/30/2015 at 02:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalDefinition.pg +description = definition of decimals +problemList = +BasicMath/Decimal/WriteDecimalByGraph10.pg, 1, -1, 0 +BasicMath/Decimal/WriteDecimalByGraph20.pg, 1, -1, 0 +BasicMath/Decimal/DecimalAndMoney10.pg, 1, -1, 0 +BasicMath/Decimal/DecimalAndMoney20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine50.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine10.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine20.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine30.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine40.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine50.pg, 1, -1, 0 +BasicMath/Decimal/DecimalOnNumberLine60.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals10.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals15.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals20.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals25.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals30.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals35.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals40.pg, 1, -1, 0 +BasicMath/Decimal/OrderDecimals50.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals10.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals20.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals30.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals40.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals50.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals60.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals70.pg, 1, -1, 0 +BasicMath/Decimal/ReadDecimals80.pg, 1, -1, 0 +BasicMath/Decimal/RoundingDecimals10.pg, 1, -1, 0 +BasicMath/Decimal/RoundingDecimals20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Multiplication_Division.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Multiplication_Division.def new file mode 100644 index 0000000000..fed2ad1720 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_Multiplication_Division.def @@ -0,0 +1,28 @@ +openDate = 01/01/2014 at 01:21am PST +dueDate = 06/30/2015 at 02:21am PDT +answerDate = 06/30/2015 at 02:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalMultiplicationDivision.pg +description = multiply and divide decimals +problemList = +BasicMath/Decimal/MultiplyDivideDecimals10.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals20.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals30.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals40.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals50.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals60.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals70.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals80.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals140.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals150.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals160.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals170.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals180.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals190.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals200.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals210.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals220.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals230.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals240.pg, 1, -1, 0 +BasicMath/Decimal/MultiplyDivideDecimals250.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_and_Fraction.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_and_Fraction.def new file mode 100644 index 0000000000..0a5bcba842 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDecimal_and_Fraction.def @@ -0,0 +1,20 @@ +openDate = 01/01/2014 at 01:24am PST +dueDate = 06/30/2015 at 02:24am PDT +answerDate = 06/30/2015 at 02:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DecimalAndFraction.pg +description = convert between decimal and fraction +problemList = +BasicMath/FractionPercentDecimal/FractionToDecimal50.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToDecimal60.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToDecimal70.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToDecimal80.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToDecimal90.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction10.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction20.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction30.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction35.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction40.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction50.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/DecimalToFraction60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivide_Fractions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivide_Fractions.def new file mode 100644 index 0000000000..b7a26f65bd --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivide_Fractions.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:57am PST +dueDate = 06/30/2015 at 01:57am PDT +answerDate = 06/30/2015 at 01:57am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivideFractions.pg +description = divide fractions, not including mixed numbers +problemList = +BasicAlgebra/FractionArithmetic/DivideFractions10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/DivideFractions11.pg, 1, -1, 0 +BasicMath/FractionsCalculation/DivideFractions12.pg, 1, -1, 0 +BasicMath/FractionsCalculation/DivideFractions32.pg, 1, -1, 0 +BasicMath/FractionsCalculation/DivideFractions42.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionDivisionWordProblems60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivisibility_Test.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivisibility_Test.def new file mode 100644 index 0000000000..f0f19b2a55 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivisibility_Test.def @@ -0,0 +1,16 @@ +openDate = 01/01/2014 at 12:15am PST +dueDate = 06/30/2015 at 01:15am PDT +answerDate = 06/30/2015 at 01:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/DivisibilityTest.pg +description = decide whether 2, 3, 5 and 9 can go into a given integer +problemList = +BasicMath/PrimeLCMGCF/divisibility10.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility20.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility40.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility60.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility70.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility80.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility80.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/divisibility80.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivision.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivision.def new file mode 100644 index 0000000000..3916b9bee3 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setDivision.def @@ -0,0 +1,29 @@ +openDate = 01/01/2014 at 12:09am PST +dueDate = 06/30/2015 at 01:09am PDT +answerDate = 06/30/2015 at 01:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/Division.pg +description = introduction to division and application problems +problemList = +BasicMath/MultiplicationDivision/multiplicationTable20.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/multiplicationTable25.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivideByZero10.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem10.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem20.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem30.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem40.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem50.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem52.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem60.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem62.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem70.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem80.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem90.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem100.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivisionWordProblem110.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/RemainderWordProblem10.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/RemainderWordProblem20.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/RemainderWordProblem30.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/RemainderWordProblem40.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/RemainderWordProblem50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setExponents_and_Rounding_Whole_Numbers.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setExponents_and_Rounding_Whole_Numbers.def new file mode 100644 index 0000000000..a22c135317 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setExponents_and_Rounding_Whole_Numbers.def @@ -0,0 +1,15 @@ +openDate = 01/01/2014 at 12:03am PST +dueDate = 06/30/2015 at 01:03am PDT +answerDate = 06/30/2015 at 01:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/ExponentsAndRoundingWholeNumbers.pg +description = definition of exponent, and how to round whole numbers +problemList = +BasicMath/Miscellaneous/ExponentDefinition05.pg, 1, -1, 0 +BasicMath/Miscellaneous/ExponentDefinition05.pg, 1, -1, 0 +BasicMath/Miscellaneous/ExponentDefinition15.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/RoundWholeNumbers10.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/RoundWholeNumbers20.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/RoundWholeNumbers10.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/RoundWholeNumbers20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setFraction_Definition.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setFraction_Definition.def new file mode 100644 index 0000000000..e7bc6aa069 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setFraction_Definition.def @@ -0,0 +1,30 @@ +openDate = 01/01/2014 at 12:45am PST +dueDate = 06/30/2015 at 01:45am PDT +answerDate = 06/30/2015 at 01:45am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/FractionDefinition.pg +description = definition of fractions +problemList = +BasicMath/FractionsCalculation/WriteFractionByGraph10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/WriteFractionByGraph20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/WriteFractionByGraph30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/WriteFractionByGraph40.pg, 1, -1, 0 +BasicMath/FractionsCalculation/EquivalentFraction10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/EquivalentFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction05.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/ReduceFraction25.pg, 1, -1, 0 +BasicMath/FractionsCalculation/ReduceFraction50.pg, 1, -1, 0 +BasicMath/FractionsCalculation/FractionOnNumberLine10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/FractionOnNumberLine20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions40.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions50.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions60.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions70.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions80.pg, 1, -1, 0 +BasicMath/FractionsCalculation/CompareFractions90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGCF_and_LCM.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGCF_and_LCM.def new file mode 100644 index 0000000000..adbd8cc1c8 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGCF_and_LCM.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:21am PST +dueDate = 06/30/2015 at 01:21am PDT +answerDate = 06/30/2015 at 01:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/GCFAndLCM.pg +description = find Great Common Factor and Least Common Multiple of a group of numbers +problemList = +BasicMath/PrimeLCMGCF/GCF10.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/GCF20.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/GCF30.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM10.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM10.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM20.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM20.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM25.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM30.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM30.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/LCM40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGeometry_Basics.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGeometry_Basics.def new file mode 100644 index 0000000000..7db1d8f28a --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setGeometry_Basics.def @@ -0,0 +1,13 @@ +openDate = 01/01/2014 at 12:12am PST +dueDate = 06/30/2015 at 01:12am PDT +answerDate = 06/30/2015 at 01:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/GeometryBasics.pg +description = find perimeter and area of rectangles, squares and triangles +problemList = +BasicAlgebra/Geometry/RectanglePerimeterArea10.pg, 1, -1, 0 +BasicMath/Miscellaneous/SquarePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setIntegers_and_Absolute_Value.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setIntegers_and_Absolute_Value.def new file mode 100644 index 0000000000..aff2ba6dd4 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setIntegers_and_Absolute_Value.def @@ -0,0 +1,15 @@ +openDate = 01/01/2014 at 12:30am PST +dueDate = 06/30/2015 at 01:30am PDT +answerDate = 06/30/2015 at 01:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/IntegersAndAbsoluteValue.pg +description = introduction to negative numbers and absolute value +problemList = +BasicAlgebra/NumberBasics/NumberLine10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine10.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/CompareNumbers50.pg, 1, -1, 0 +BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue10.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/AbsoluteValue11.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/SignedNumberInterpretations10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMean_Median_Mode.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMean_Median_Mode.def new file mode 100644 index 0000000000..2cb661278d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMean_Median_Mode.def @@ -0,0 +1,31 @@ +openDate = 01/01/2014 at 01:30am PST +dueDate = 06/30/2015 at 02:30am PDT +answerDate = 06/30/2015 at 02:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/MeanMedianMode.pg +description = find mean, median and mode of data, when to use which +problemList = +BasicMath/MeanMedianMode/MeanMedianMode10.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode20.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode30.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode40.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode50.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode60.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode70.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode80.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode90.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode100.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode110.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode120.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode130.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode140.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode150.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode160.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode170.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode180.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode190.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode200.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode210.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode220.pg, 1, -1, 0 +BasicMath/MeanMedianMode/MeanMedianMode230.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMixed_Number_Definition.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMixed_Number_Definition.def new file mode 100644 index 0000000000..bab4b8b305 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMixed_Number_Definition.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 01:00am PST +dueDate = 06/30/2015 at 02:00am PDT +answerDate = 06/30/2015 at 02:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/MixedNumberDefinition.pg +description = introduction to mixed numbers, convert between mixed number and improper fraction +problemList = +BasicMath/FractionsCalculation/WriteFractionByGraph50.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction30.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction40.pg, 1, -1, 0 +BasicMath/FractionsCalculation/FractionOnNumberLine30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/FractionOnNumberLine40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiplication.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiplication.def new file mode 100644 index 0000000000..32a2e8016c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiplication.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:06am PST +dueDate = 06/30/2015 at 01:06am PDT +answerDate = 06/30/2015 at 01:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/Multiplication.pg +description = introduction to multiplication and application problems +problemList = +BasicMath/MultiplicationDivision/multiplicationTable10.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/multiplicationTable15.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem10.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem20.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem30.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem40.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem50.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem60.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem70.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem80.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/MultiplicationWordProblem90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Integers.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Integers.def new file mode 100644 index 0000000000..fb8b92c52c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Integers.def @@ -0,0 +1,18 @@ +openDate = 01/01/2014 at 12:36am PST +dueDate = 06/30/2015 at 01:36am PDT +answerDate = 06/30/2015 at 01:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideIntegers.pg +description = multiply and divide positive and negative numbers +problemList = +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers20.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/MultiplyWithNegativeIntegers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers20.pg, 1, -1, 0 +BasicMath/MultiplicationDivision/DivideByZero10.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition10.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition20.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Mixed_Numbers.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Mixed_Numbers.def new file mode 100644 index 0000000000..5066f5c853 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Divide_Mixed_Numbers.def @@ -0,0 +1,33 @@ +openDate = 01/01/2014 at 01:06am PST +dueDate = 06/30/2015 at 02:06am PDT +answerDate = 06/30/2015 at 02:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyDivideMixedNumbers.pg +description = multiply and divide mixed numbers +problemList = +BasicAlgebra/FractionArithmetic/MixedNumberMultiplication10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberMultiplication15.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberMultiplication20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberMultiplication25.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberMultiplication30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberMultiplication35.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MixedNumberDivision10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions30.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberDivision15.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberDivision20.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberDivision25.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MixedNumberDivision35.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberMultiplicationWordProblems60.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/MixedNumberDivisionWordProblems60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Fractions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Fractions.def new file mode 100644 index 0000000000..254afdc1e4 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setMultiply_Fractions.def @@ -0,0 +1,23 @@ +openDate = 01/01/2014 at 12:51am PST +dueDate = 06/30/2015 at 01:51am PDT +answerDate = 06/30/2015 at 01:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/MultiplyFractions.pg +description = multiply fractions, not including mixed numbers +problemList = +BasicAlgebra/FractionArithmetic/MultiplyFractions10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MultiplyFractions15.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MultiplyFractions16.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MultiplyThreeFractions10.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MultiplyThreeFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions50.pg, 1, -1, 0 +BasicMath/FractionsCalculation/MultiplyFractions69.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems10.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems20.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems30.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems40.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems50.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems60.pg, 1, -1, 0 +BasicMath/FractionApplication/FractionMultiplicationWordProblems70.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_1.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_1.def new file mode 100644 index 0000000000..ec98129e59 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_1.def @@ -0,0 +1,29 @@ +openDate = 01/01/2014 at 12:24am PST +dueDate = 06/30/2015 at 01:24am PDT +answerDate = 06/30/2015 at 01:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_1.pg +description = order of operations problems involving positive integers only +problemList = +BasicMath/OrderOfOperations_More/orderOfOperations09.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations20.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations30.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations70.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations120.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations170.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations21.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations23.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations24.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations25.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations26.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations27.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations28.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations29.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations46.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations53.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations108.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations109.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations163.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations164.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations165.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_2.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_2.def new file mode 100644 index 0000000000..03acf96950 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_2.def @@ -0,0 +1,35 @@ +openDate = 01/01/2014 at 12:39am PST +dueDate = 06/30/2015 at 01:39am PDT +answerDate = 06/30/2015 at 01:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_2.pg +description = order of operations problems involving positive and negative integers +problemList = +BasicAlgebra/OrderOfOperations/orderOfOperations40.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations50.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations60.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations22.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations47.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations48.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations49.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations80.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations90.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations100.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations110.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations140.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations150.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations160.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations180.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations190.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations51.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations52.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations54.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations82.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations199.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations241.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations240.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations200.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations210.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations220.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations230.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_3.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_3.def new file mode 100644 index 0000000000..78abbce50a --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setOrder_of_Operations_3.def @@ -0,0 +1,18 @@ +openDate = 01/01/2014 at 01:09am PST +dueDate = 06/30/2015 at 02:09am PDT +answerDate = 06/30/2015 at 02:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/OrderOfOperations_3.pg +description = order of operations problems involving fractions +problemList = +BasicMath/Miscellaneous/ExponentDefinition40.pg, 1, -1, 0 +BasicMath/Miscellaneous/ExponentDefinition50.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations285.pg, 1, -1, 0 +BasicMath/OrderOfOperations_More/orderOfOperations286.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations250.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/OOOFractions10.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations280.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations290.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations260.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations270.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Definition.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Definition.def new file mode 100644 index 0000000000..098366d793 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Definition.def @@ -0,0 +1,27 @@ +openDate = 01/01/2014 at 01:48am PST +dueDate = 06/30/2015 at 02:48am PDT +answerDate = 06/30/2015 at 02:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentDefinition.pg +description = introduction to percent +problemList = +BasicAlgebra/NumberBasics/PercentDecimalConversion10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToPercent10.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToPercent20.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToPercent30.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionToPercent40.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/PercentToFraction10.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/PercentToFraction20.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/PercentToFraction30.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/PercentToFraction40.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionPercentDecimal10.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionPercentDecimal10.pg, 1, -1, 0 +BasicMath/FractionPercentDecimal/FractionPercentDecimal10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Formula.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Formula.def new file mode 100644 index 0000000000..4200535a3b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Formula.def @@ -0,0 +1,31 @@ +openDate = 01/01/2014 at 01:51am PST +dueDate = 06/30/2015 at 02:51am PDT +answerDate = 06/30/2015 at 02:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentFormula.pg +description = use Percent Formula to solve basic percent problems +problemList = +BasicMath/Percent/MTH20PercentOfNumberType1_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType1_90.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType2_80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentOfNumberType3_60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Word_Problem.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Word_Problem.def new file mode 100644 index 0000000000..f6cc1b83c8 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_Word_Problem.def @@ -0,0 +1,43 @@ +openDate = 01/01/2014 at 01:54am PST +dueDate = 06/30/2015 at 02:54am PDT +answerDate = 06/30/2015 at 02:54am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentWordProblems.pg +description = application problems involving percent +problemList = +BasicMath/Percent/MTH20PercentApplicationType1_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_90.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_100.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_110.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType1_120.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_90.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_100.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_110.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType2_120.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_90.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_100.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentApplicationType3_110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_of_Increase_Decrease.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_of_Increase_Decrease.def new file mode 100644 index 0000000000..1d2598bfdb --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPercent_of_Increase_Decrease.def @@ -0,0 +1,26 @@ +openDate = 01/01/2014 at 01:57am PST +dueDate = 06/30/2015 at 02:57am PDT +answerDate = 06/30/2015 at 02:57am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/PercentOfIncreaseDecrease.pg +description = percent of increase and decrease application problems +problemList = +BasicMath/Percent/MTH20PercentIncreaseDecrease10.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease20.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease30.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease40.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease50.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease60.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease70.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease80.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease90.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease95.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease100.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease110.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease120.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease130.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease140.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease150.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease160.pg, 1, -1, 0 +BasicMath/Percent/MTH20PercentIncreaseDecrease170.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPrime_Numbers.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPrime_Numbers.def new file mode 100644 index 0000000000..b9c2811cdf --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setPrime_Numbers.def @@ -0,0 +1,15 @@ +openDate = 01/01/2014 at 12:18am PST +dueDate = 06/30/2015 at 01:18am PDT +answerDate = 06/30/2015 at 01:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/PrimeNumbers.pg +description = introduction to prime and composite numbers, prime factor an integer +problemList = +BasicMath/PrimeLCMGCF/primeOrComposite10.pg, 1, -1, 0 +BasicMath/PrimeLCMGCF/primeOrComposite10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/FactorInteger10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/FactorInteger20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/FactorInteger30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/FactorInteger40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/FactorInteger60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setProportion.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setProportion.def new file mode 100644 index 0000000000..ace52481ef --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setProportion.def @@ -0,0 +1,29 @@ +openDate = 01/01/2014 at 01:39am PST +dueDate = 06/30/2015 at 02:39am PDT +answerDate = 06/30/2015 at 02:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/Proportion.pg +description = introduction to proportion and proportion application problems +problemList = +BasicAlgebra/SolveLinearEquations/SolveProportion10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion40.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion10.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion11.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion13.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion14.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion20.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion21.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion30.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion31.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion40.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion41.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion50.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion51.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion60.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion61.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion70.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion71.pg, 1, -1, 0 +BasicMath/Proportion/MTH20Proportion80.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setRate_and_Ratio.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setRate_and_Ratio.def new file mode 100644 index 0000000000..38f785e2aa --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setRate_and_Ratio.def @@ -0,0 +1,31 @@ +openDate = 01/01/2014 at 01:36am PST +dueDate = 06/30/2015 at 02:36am PDT +answerDate = 06/30/2015 at 02:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/RateAndRatio.pg +description = definition of rate and ratio, find rate and ratio +problemList = +BasicMath/Rate/FindRateOfChange10.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange20.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange30.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange40.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange50.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange60.pg, 1, -1, 0 +BasicMath/Rate/FindRateOfChange70.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange10.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange11.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange20.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange21.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange30.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange31.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange40.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange50.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange60.pg, 1, -1, 0 +BasicMath/Rate/UseRateOfChange70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/Ratio10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/Ratio20.pg, 1, -1, 0 +BasicMath/Rate/UseRatio10.pg, 1, -1, 0 +BasicMath/Rate/UseRatio11.pg, 1, -1, 0 +BasicMath/Rate/UseRatio20.pg, 1, -1, 0 +BasicMath/Rate/UseRatio21.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setSquare_Root.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setSquare_Root.def new file mode 100644 index 0000000000..5a51a418e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setSquare_Root.def @@ -0,0 +1,17 @@ +openDate = 01/01/2014 at 01:27am PST +dueDate = 06/30/2015 at 02:27am PDT +answerDate = 06/30/2015 at 02:27am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/SquareRoot.pg +description = introduction to square root +problemList = +BasicMath/IntegerAndSquareRoot/identifySquareNumbers10.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers30.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers30.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers50.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers60.pg, 1, -1, 0 +BasicMath/IntegerAndSquareRoot/identifySquareNumbers40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setUnit_Conversion.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setUnit_Conversion.def new file mode 100644 index 0000000000..e3eb7babab --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH020/setUnit_Conversion.def @@ -0,0 +1,45 @@ +openDate = 01/01/2014 at 01:42am PST +dueDate = 06/30/2015 at 02:42am PDT +answerDate = 06/30/2015 at 02:42am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH020/MTH20HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH020/UnitConversion.pg +description = convert within English unit system and international unit system +problemList = +BasicMath/UnitConversion/UnitConversionAmerican10.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican30.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican40.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican60.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican70.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican100.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican120.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmerican130.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication10.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication20.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication30.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication40.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication50.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionAmericanApplication60.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric30.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric90.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric100.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric150.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric210.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric250.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric320.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetric350.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication10.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication20.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication30.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication40.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication50.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication60.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionMetricApplication70.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTime20.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTime40.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTime70.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTime100.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTimeApplication10.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTimeApplication20.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTimeApplication30.pg, 1, -1, 0 +BasicMath/UnitConversion/UnitConversionTimeApplication40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAbsolute_Value.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAbsolute_Value.def new file mode 100644 index 0000000000..d24431c409 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAbsolute_Value.def @@ -0,0 +1,12 @@ + +openDate = 12/11/2013 at 12:12am PST +dueDate = 06/30/2014 at 01:06am PDT +answerDate = 06/30/2014 at 01:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AbsoluteValue.pg +description = basic absolute value calculations +problemList = +BasicAlgebra/NumberBasics/AbsoluteValue10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/AbsoluteValue30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAccount_Interest_Word_Problems.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAccount_Interest_Word_Problems.def new file mode 100644 index 0000000000..567cc4e823 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAccount_Interest_Word_Problems.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 01:28am PST +dueDate = 06/30/2014 at 02:38am PDT +answerDate = 06/30/2014 at 02:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AccountInterestWordProblems.pg +description = word problems involving accounts earning a net interest rate +problemList = +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblemWithTable50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/InterestWordProblem60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAdd_Subtract_Fractions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAdd_Subtract_Fractions.def new file mode 100644 index 0000000000..f21431ff96 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setAdd_Subtract_Fractions.def @@ -0,0 +1,42 @@ + +openDate = 12/11/2013 at 12:06am PST +dueDate = 06/30/2014 at 01:03am PDT +answerDate = 06/30/2014 at 01:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/AddSubtractFractions.pg +description = adding and subtracting fractions +problemList = +BasicAlgebra/FractionArithmetic/AddFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions04.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions08.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions09.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions12.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions22.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions24.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions26.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions01.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions02.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions06.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions05.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions90.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/AddFractions90.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions100.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/SubtractFractions110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def new file mode 100644 index 0000000000..479a1ee2ac --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Percentage_Word_Problems.def @@ -0,0 +1,38 @@ + +openDate = 12/11/2013 at 12:42am PST +dueDate = 06/30/2014 at 01:44am PDT +answerDate = 06/30/2014 at 01:44am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicPercentageWordProblems.pg +description = percent and decimal conversion; percent calculations +problemList = +BasicAlgebra/NumberBasics/PercentDecimalConversion10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentDecimalConversion80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber110.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber120.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber90.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/PercentOfNumber100.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentWordProblem90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Word_Problems.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Word_Problems.def new file mode 100644 index 0000000000..2b1d8035de --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setBasic_Word_Problems.def @@ -0,0 +1,35 @@ + +openDate = 12/11/2013 at 12:36am PST +dueDate = 06/30/2014 at 01:40am PDT +answerDate = 06/30/2014 at 01:40am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/BasicWordProblems.pg +description = translating English to math equations; solving some basic word problems +problemList = +BasicAlgebra/EnglishToMath/EnglishToMathEquation10.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation20.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation30.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation40.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation50.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation60.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation70.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation80.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation90.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation100.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation110.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation120.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation130.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation140.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation150.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation160.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation170.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/EnglishToMathEquation180.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ConsecutiveIntegerWordProblem20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation30.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation40.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterEquation50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setCoordinate_System.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setCoordinate_System.def new file mode 100644 index 0000000000..72a8c5a5dd --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setCoordinate_System.def @@ -0,0 +1,14 @@ + +openDate = 12/11/2013 at 01:00am PST +dueDate = 06/30/2014 at 02:10am PDT +answerDate = 06/30/2014 at 02:10am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/CoordinateSystem.pg +description = the basics of the Cartesian coordinate system +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphOrderedPairs40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/Quadrant10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setDistance_Word_Problems.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setDistance_Word_Problems.def new file mode 100644 index 0000000000..28b4367034 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setDistance_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 01:26am PST +dueDate = 06/30/2014 at 02:37am PDT +answerDate = 06/30/2014 at 02:37am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/DistanceWordProblems.pg +description = word problems involving distance traveled +problemList = +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/DistanceWordProblem30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setEvaluating_Expressions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setEvaluating_Expressions.def new file mode 100644 index 0000000000..4dcf1a4cda --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setEvaluating_Expressions.def @@ -0,0 +1,27 @@ + +openDate = 12/11/2013 at 12:02am PST +dueDate = 06/30/2014 at 01:01am PDT +answerDate = 06/30/2014 at 01:01am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/EvaluatingExpressions.pg +description = evaluating symbols in mathematical expressions +problemList = +BasicAlgebra/EvaluateExpressions/evaluate10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate12.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate15.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate18.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate20.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate50.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate60.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate80.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluate90.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar0.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar5.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluateInContext10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/evaluateInContext20.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/FahrenheitCelsius10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormulaAndReadGraph10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula10.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula40.pg, 1, -1, 0 +BasicAlgebra/EvaluateExpressions/EvaluateFormula30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_1.1-2.3.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_1.1-2.3.def new file mode 100644 index 0000000000..c2785b5976 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_1.1-2.3.def @@ -0,0 +1,124 @@ +assignmentType = gateway +openDate = 09/21/2020 at 12:00am PDT +reducedScoringDate =12/31/2025 at 11:59pm PDT +dueDate = 12/31/2025 at 11:59pm PDT +answerDate = 12/31/2025 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_1.1-2.3_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_1.1-2.3_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = This Exam includes questions covered in sections 1.1 through 2.3 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/EvaluateExpressions/evaluate130.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/EvaluateExpressions/FahrenheitCelsius10.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/1-Variables_Expressions_and_Equations/1_3-Comparison_Symbols_and_Notation_for_Intervals/1_3_4_19.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/VerifySolutionsOneVariable/VerifySolutionApplication40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithInequality130.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction200.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv160.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps110.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps50.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses150.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality250.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction300.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/TwoSideVariableWordProblem30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Geometry/RectanglePerimeterArea20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/LinearInequalities/LinearInequalities8.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicMath/Proportion/MTH20Proportion40.pg +value = 4 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_2.4-3.7.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_2.4-3.7.def new file mode 100644 index 0000000000..3a3207f7bb --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExam_ORCCA_ed2_2.4-3.7.def @@ -0,0 +1,124 @@ +assignmentType = gateway +openDate = 09/21/2020 at 12:00am PDT +reducedScoringDate =12/31/2025 at 11:59pm PDT +dueDate = 12/31/2025 at 11:59pm PDT +answerDate = 12/31/2025 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_2.4-3.7_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Exam_ORCCA_ed2_2.4-3.7_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = This Exam includes questions covered in sections 2.4 through 3.7 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation80.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation170.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation200.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_1-Cartesian_Coordinates/3_1_2.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot140.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine60.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_3-Exploring_TwoVariable_Data_and_Rate_of_Change/3_3_5_1.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_3-Exploring_TwoVariable_Data_and_Rate_of_Change/3_3_5_15.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/PointSlopeForm/FindLineEquationORCCA50.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/PointSlopeForm/PointSlopeToSlopeInterceptORCCA20.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_6-PointSlope_Form/3_6_5_44.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_7-Standard_Form/3_7_5_4.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept140.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts80.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication50.pg +value = 4 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Basics.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Basics.def new file mode 100644 index 0000000000..1451106031 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Basics.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 12:18am PST +dueDate = 06/30/2014 at 01:14am PDT +answerDate = 06/30/2014 at 01:14am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentBasics.pg +description = the basics of exponents +problemList = +BasicAlgebra/Exponents/ExponentDefinition10.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition20.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Rules.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Rules.def new file mode 100644 index 0000000000..10b72c3844 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setExponent_Rules.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:20am PST +dueDate = 06/30/2014 at 01:16am PDT +answerDate = 06/30/2014 at 01:16am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ExponentRules.pg +description = the rules of working with exponents +problemList = +BasicAlgebra/Exponents/exponentsMultiplication10.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication09.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication0.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication15.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication20.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication23.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication24.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFinal_Exam_202003_30022.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFinal_Exam_202003_30022.def new file mode 100644 index 0000000000..446436bac6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFinal_Exam_202003_30022.def @@ -0,0 +1,144 @@ +assignmentType = gateway +openDate = 09/21/2020 at 12:00am PDT +reducedScoringDate =12/31/2025 at 11:59pm PDT +dueDate = 12/31/2025 at 11:59pm PDT +answerDate = 12/31/2025 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Final_Exam_202003_30022_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH060/Final_Exam_202003_30022_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = A Final Exam with questions from chapters 1 through 4 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/EvaluateExpressions/evaluate130.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/EvaluateExpressions/evaluateInContext20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/InequalitySolutionOrNot20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveProportion10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/AlgebraicProperties/DistributiveProperty70.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/ModelingWithEquation70.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps130.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses90.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation50.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearInequalities/SolveInequality270.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem50.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction290.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation120.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SolveLinearEquations/LiteralEquation210.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_1-Cartesian_Coordinates/3_1_1.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_3-Exploring_TwoVariable_Data_and_Rate_of_Change/3_3_5_1.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine60.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/I-Linear_Equations_and_Lines/3-Graphing_Lines/3_6-PointSlope_Form/3_6_5_40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts90.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/InterceptsApplication30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/PointSlopeForm/ParallelPerpendicularORCCA150.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations16.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearEquationApplications/InterestWordProblem10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication90.pg +value = 4 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Graph.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Graph.def new file mode 100644 index 0000000000..8e8987a989 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Graph.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 01:12am PST +dueDate = 06/30/2014 at 02:22am PDT +answerDate = 06/30/2014 at 02:22am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByGraph.pg +description = using a grpah to identify the equation of a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/WriteEquationByGraph60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def new file mode 100644 index 0000000000..a17e032d8a --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Point_Slope.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 01:14am PST +dueDate = 06/30/2014 at 02:24am PDT +answerDate = 06/30/2014 at 02:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByPointSlope.pg +description = use information about a point and slope to find an equation of a line +problemList = +BasicAlgebra/PointSlopeForm/PointSlopeBasics10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeBasics20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeBasics30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/PointSlopeToSlopeIntercept40.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation40.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation50.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/FindLineEquation60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Two_Points.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Two_Points.def new file mode 100644 index 0000000000..d706a91dc2 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFind_Equation_by_Two_Points.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 01:16am PST +dueDate = 06/30/2014 at 02:26am PDT +answerDate = 06/30/2014 at 02:26am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FindEquationByTwoPoints.pg +description = use information about two points to find an equation for a line +problemList = +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation10.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation20.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/TwoPointsFindPointSlopeEquation30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation35.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindSlopeInterceptEquation50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/TwoPointsFindEquationSpecial20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFunctions_Intro.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFunctions_Intro.def new file mode 100644 index 0000000000..15afffba4f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setFunctions_Intro.def @@ -0,0 +1,28 @@ +openDate = 12/11/2013 at 01:24am PST +dueDate = 06/30/2014 at 02:36am PDT +answerDate = 06/30/2014 at 02:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/FunctionsIntro.pg +description = an introduction to functions +problemList = +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Lines_by_Table.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Lines_by_Table.def new file mode 100644 index 0000000000..cec8e9661b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Lines_by_Table.def @@ -0,0 +1,29 @@ + +openDate = 12/11/2013 at 01:02am PST +dueDate = 06/30/2014 at 02:12am PDT +answerDate = 06/30/2014 at 02:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphLineByTable.pg +description = graphing lines by making a table of values; checking if a point is on a line +problemList = +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/XYTable20.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine110.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/TableForLine80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot30.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot150.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/PointOnLineOrNot90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def new file mode 100644 index 0000000000..45c26f1206 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraph_Two-Variable_Inequalities.def @@ -0,0 +1,26 @@ + +openDate = 12/11/2013 at 01:22am PST +dueDate = 06/30/2014 at 02:34am PDT +answerDate = 06/30/2014 at 02:34am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphTwoVariableInequalities.pg +description = inequalities in two variables +problemList = +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot70.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/InequalitySolutionOrNot90.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality100.pg, 1, -1, 0 +BasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraphing_Line_Summary.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraphing_Line_Summary.def new file mode 100644 index 0000000000..540c4ec403 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setGraphing_Line_Summary.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 01:10am PST +dueDate = 06/30/2014 at 02:20am PDT +answerDate = 06/30/2014 at 02:20am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/GraphingLineSummary.pg +description = a summary of techniques that can be used to graph a line from its equation +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInequality_Applications.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInequality_Applications.def new file mode 100644 index 0000000000..eee2160463 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInequality_Applications.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 12:58am PST +dueDate = 06/30/2014 at 01:52am PDT +answerDate = 06/30/2014 at 01:52am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/InequalityApplications.pg +description = applications of inequalities +problemList = +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInteger_Operations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInteger_Operations.def new file mode 100644 index 0000000000..2ec3e34279 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setInteger_Operations.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 12:16am PST +dueDate = 06/30/2014 at 01:08am PDT +answerDate = 06/30/2014 at 01:08am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/IntegerOperations.pg +description = multiplying, dividing, adding, and subtracting with both positive and negative integers +problemList = +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/MultiplyWithNegativeIntegers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/DivideWithNegativeIntegers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AdditionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/SubtractionWithNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers10.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers20.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers30.pg, 1, -1, 0 +BasicAlgebra/SignedNumbersArithemtic/AddSubtractNegativeNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/SignedNumberInterpretations10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setLinear_Equation_Applications.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setLinear_Equation_Applications.def new file mode 100644 index 0000000000..b378ac9e07 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setLinear_Equation_Applications.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 01:18am PST +dueDate = 06/30/2014 at 02:30am PDT +answerDate = 06/30/2014 at 02:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/LinearEquationApplications.pg +description = applications of finding equations of lines +problemList = +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/FindLineEquationApplication80.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def new file mode 100644 index 0000000000..e928bef3ed --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixed_Numbers_Equivalent_Fractions.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 12:04am PST +dueDate = 06/30/2014 at 01:02am PDT +answerDate = 06/30/2014 at 01:02am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixedNumbersEquivalentFractions.pg +description = translating between mixed numbers and improper fractions; reducing fractions +problemList = +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ImproperFractionToMixedNumber20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/MixedNumberToImproperFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction05.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction10.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction20.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction30.pg, 1, -1, 0 +BasicAlgebra/FractionMixedNumbersBasics/ReduceFraction40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixture_Word_Problems.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixture_Word_Problems.def new file mode 100644 index 0000000000..dbda55cc4f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMixture_Word_Problems.def @@ -0,0 +1,19 @@ + +openDate = 12/11/2013 at 01:30am PST +dueDate = 06/30/2014 at 02:39am PDT +answerDate = 06/30/2014 at 02:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MixtureWordProblems.pg +description = word problems involving mixtures of solutions or populations +problemList = +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblemWithTable50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedSolutionWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MixedPopulationWordProblem20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMultiply_Divide_Fractions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMultiply_Divide_Fractions.def new file mode 100644 index 0000000000..984edc6dbb --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setMultiply_Divide_Fractions.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:08am PST +dueDate = 06/30/2014 at 01:04am PDT +answerDate = 06/30/2014 at 01:04am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/MultiplyDivideFractions.pg +description = multiplying and dividing with fractions +problemList = +BasicAlgebra/FractionArithmetic/MultiplyFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions60.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions70.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions50.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/MultiplyFractions80.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions10.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions20.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions30.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions40.pg, 1, -1, 0 +BasicAlgebra/FractionArithmetic/DivideFractions50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setNumber_Sets.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setNumber_Sets.def new file mode 100644 index 0000000000..076f2c2bec --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setNumber_Sets.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 12:10am PST +dueDate = 06/30/2014 at 01:05am PDT +answerDate = 06/30/2014 at 01:05am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/NumberSets.pg +description = identifying types of numbers; using number lines +problemList = +BasicAlgebra/NumberBasics/TypesOfNumbers10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/TypesOfNumbers60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/NumberLine60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setOrder_of_Operations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setOrder_of_Operations.def new file mode 100644 index 0000000000..e4ac385610 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setOrder_of_Operations.def @@ -0,0 +1,39 @@ + +openDate = 12/11/2013 at 12:22am PST +dueDate = 06/30/2014 at 01:18am PDT +answerDate = 06/30/2014 at 01:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/OrderOfOperations.pg +description = using the order of operations +problemList = +BasicAlgebra/OrderOfOperations/orderOfOperations10.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations20.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations30.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations40.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations50.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations60.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations70.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations80.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations90.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations100.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations110.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations120.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations140.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations130.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations150.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations160.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations170.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations180.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations190.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations230.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations200.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations210.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations220.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations240.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations250.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/OOOFractions10.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations260.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations270.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations280.pg, 1, -1, 0 +BasicAlgebra/OrderOfOperations/orderOfOperations290.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setParallel_Perpendicular_Lines.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setParallel_Perpendicular_Lines.def new file mode 100644 index 0000000000..6716f9f757 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setParallel_Perpendicular_Lines.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 01:20am PST +dueDate = 06/30/2014 at 02:32am PDT +answerDate = 06/30/2014 at 02:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ParallelPerpendicularLines.pg +description = questions regarding parallel or perpendicular pairs of lines and their slopes +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular90.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular100.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular110.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular120.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular130.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/ParallelPerpendicular140.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular150.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular160.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular170.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular180.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular190.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular200.pg, 1, -1, 0 +BasicAlgebra/PointSlopeForm/ParallelPerpendicular210.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPercent_of_Increase_Decrease.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPercent_of_Increase_Decrease.def new file mode 100644 index 0000000000..1ea63d363f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPercent_of_Increase_Decrease.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 12:44am PST +dueDate = 06/30/2014 at 01:45am PDT +answerDate = 06/30/2014 at 01:45am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/PercentOfIncreaseDecrease.pg +description = calculating the percent increase or decrease of a change +problemList = +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/PercentIncreaseDecrease90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPerimeter_and_Area.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPerimeter_and_Area.def new file mode 100644 index 0000000000..e2233ccacf --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setPerimeter_and_Area.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 12:46am PST +dueDate = 06/30/2014 at 01:46am PDT +answerDate = 06/30/2014 at 01:46am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/PerimeterArea.pg +description = questions about the areas and perimeters of basic two-dimensional shapes +problemList = +BasicAlgebra/Geometry/RectanglePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectanglePerimeterArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/TrianglePerimeterArea40.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea10.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea20.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea40.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea50.pg, 1, -1, 0 +BasicAlgebra/Geometry/CircleCircumferenceArea60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setProportion_Word_Problems.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setProportion_Word_Problems.def new file mode 100644 index 0000000000..7082c491b0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setProportion_Word_Problems.def @@ -0,0 +1,21 @@ + +openDate = 12/11/2013 at 12:52am PST +dueDate = 06/30/2014 at 01:49am PDT +answerDate = 06/30/2014 at 01:49am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/ProportionWordProblems.pg +description = word problems that involve a proportional equation +problemList = +BasicAlgebra/LinearEquationApplications/ProportionWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem60.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem70.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem80.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem90.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem100.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem110.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/ProportionWordProblem120.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def new file mode 100644 index 0000000000..6e10a82e6e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setRate_and_Start_Value_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 12:40am PST +dueDate = 06/30/2014 at 01:43am PDT +answerDate = 06/30/2014 at 01:43am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/RateAndStartValueWordProblem.pg +description = word problems involving an initial value that cahnges with a fixed rate +problemList = +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/MXPlusBWordProblem60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSimplify_Expressions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSimplify_Expressions.def new file mode 100644 index 0000000000..8cee679e94 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSimplify_Expressions.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 12:14am PST +dueDate = 06/30/2014 at 01:07am PDT +answerDate = 06/30/2014 at 01:07am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SimplifyExpressions.pg +description = simplifying expressions +problemList = +BasicAlgebra/PolynomialBasics/SimplifyExpression10.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression30.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty10.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty20.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty30.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty40.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty50.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty60.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty70.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty80.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/DistributiveProperty90.pg, 1, -1, 0 +BasicAlgebra/AlgebraicProperties/SimplifyInContext10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope.def new file mode 100644 index 0000000000..5af94ddb27 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 01:04am PST +dueDate = 06/30/2014 at 02:14am PDT +answerDate = 06/30/2014 at 02:14am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Slope.pg +description = using a graph to compute slope; using the slope formula to compute slope +problemList = +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindSlopeByGraph60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/SlopeFormula90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope_Intercept_Equations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope_Intercept_Equations.def new file mode 100644 index 0000000000..03f0a00beb --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSlope_Intercept_Equations.def @@ -0,0 +1,27 @@ + +openDate = 12/11/2013 at 01:06am PST +dueDate = 06/30/2014 at 02:16am PDT +answerDate = 06/30/2014 at 02:16am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SlopeInterceptEquation.pg +description = find the slope and y-intercept of a line; use the point-slope form to garph a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept10.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept20.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept30.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept40.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept50.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept60.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept70.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept80.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept90.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Equations_with_Fractions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Equations_with_Fractions.def new file mode 100644 index 0000000000..dc490db970 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Equations_with_Fractions.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 12:32am PST +dueDate = 06/30/2014 at 01:36am PDT +answerDate = 06/30/2014 at 01:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveEquationsWithFractions.pg +description = solving linear equations that involve fractions +problemList = +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction05.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction290.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction300.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction310.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction210.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction220.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction240.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction260.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationFraction270.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Inequalities.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Inequalities.def new file mode 100644 index 0000000000..296618b649 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Inequalities.def @@ -0,0 +1,45 @@ + +openDate = 12/11/2013 at 12:54am PST +dueDate = 06/30/2014 at 01:50am PDT +answerDate = 06/30/2014 at 01:50am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveInequalities.pg +description = set-builder and interval notation; solving linear inequalities +problemList = +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation110.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality150.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality180.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality200.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality220.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality260.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality280.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality320.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Multi_Step_Equations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Multi_Step_Equations.def new file mode 100644 index 0000000000..c8d08d623e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Multi_Step_Equations.def @@ -0,0 +1,35 @@ + +openDate = 12/11/2013 at 12:28am PST +dueDate = 06/30/2014 at 01:32am PDT +answerDate = 06/30/2014 at 01:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveMultiStepEquations.pg +description = solving linear equations that may require multiple steps +problemList = +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveLinearEquationParentheses200.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_One_Step_Equations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_One_Step_Equations.def new file mode 100644 index 0000000000..054ba50db2 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_One_Step_Equations.def @@ -0,0 +1,52 @@ + +openDate = 12/11/2013 at 12:24am PST +dueDate = 06/30/2014 at 01:26am PDT +answerDate = 06/30/2014 at 01:26am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveOneStepEquation.pg +description = solving equations that only require one step to solve +problemList = +BasicAlgebra/VerifySolutionsOneVariable/solutionQ10.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ20.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ30.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ40.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ50.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ60.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ70.pg, 1, -1, 0 +BasicAlgebra/VerifySolutionsOneVariable/solutionQ80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepAddSubtract160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepCompare20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv190.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Proportions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Proportions.def new file mode 100644 index 0000000000..e10430de0d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Proportions.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:50am PST +dueDate = 06/30/2014 at 01:48am PDT +answerDate = 06/30/2014 at 01:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveProportions.pg +description = solving proporiton equations +problemList = +BasicAlgebra/SolveLinearEquations/SolveProportion10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveProportion40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Two-Step_Equations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Two-Step_Equations.def new file mode 100644 index 0000000000..d261d00360 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_Two-Step_Equations.def @@ -0,0 +1,19 @@ + +openDate = 12/11/2013 at 12:26am PST +dueDate = 06/30/2014 at 01:30am PDT +answerDate = 06/30/2014 at 01:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveTwoStepEquations.pg +description = solving equations that require two steps to solve +problemList = +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnOneStepMultiDiv170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/solveLinearEqnMultiSteps130.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_for_Variable.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_for_Variable.def new file mode 100644 index 0000000000..eccdea6c6b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSolve_for_Variable.def @@ -0,0 +1,30 @@ + +openDate = 12/11/2013 at 12:34am PST +dueDate = 06/30/2014 at 01:38am PDT +answerDate = 06/30/2014 at 01:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SolveForVariable.pg +description = symbolically solving a linear equation to isolate a variable +problemList = +BasicAlgebra/SolveLinearEquations/LiteralEquation10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation70.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation90.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation100.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation110.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation120.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation130.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation140.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation150.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation160.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation170.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation180.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation190.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation200.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/LiteralEquation210.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Case_Inequalities.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Case_Inequalities.def new file mode 100644 index 0000000000..75f08f8146 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Case_Inequalities.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:56am PST +dueDate = 06/30/2014 at 01:51am PDT +answerDate = 06/30/2014 at 01:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialCaseInequalities.pg +description = linear inequalities that may have something special about them +problemList = +BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Solutions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Solutions.def new file mode 100644 index 0000000000..0ed77f524d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSpecial_Solutions.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 12:30am PST +dueDate = 06/30/2014 at 01:34am PDT +answerDate = 06/30/2014 at 01:34am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SpecialSolutions.pg +description = linear equations that may have something special about them +problemList = +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation50.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation10.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation20.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation30.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation40.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation80.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation60.pg, 1, -1, 0 +BasicAlgebra/SolveLinearEquations/SolveSpecialLinearEquation70.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setStandard_Form_Equations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setStandard_Form_Equations.def new file mode 100644 index 0000000000..de8c027e91 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setStandard_Form_Equations.def @@ -0,0 +1,47 @@ + +openDate = 12/11/2013 at 01:08am PST +dueDate = 06/30/2014 at 02:18am PDT +answerDate = 06/30/2014 at 02:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/StandardFormEquations.pg +description = find the slope and y-intercept of a line; find a line's x- and y-intercepts; use intercepts to graph a line +problemList = +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept110.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept120.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept130.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept140.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept150.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept160.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept170.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept180.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept190.pg, 1, -1, 0 +BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept200.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts150.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts130.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/FindXYIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph10.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph20.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph40.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSum_and_Part_Word_Problems.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSum_and_Part_Word_Problems.def new file mode 100644 index 0000000000..b8d9aae6bc --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setSum_and_Part_Word_Problems.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 12:38am PST +dueDate = 06/30/2014 at 01:42am PDT +answerDate = 06/30/2014 at 01:42am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/SumAndPartWordProblems.pg +description = solving word problems involving two numbers that combine in some way +problemList = +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem20.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem30.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem40.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem50.pg, 1, -1, 0 +BasicAlgebra/LinearEquationApplications/TwoPartsWordProblem60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTranslating_Words_into_Algebra.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTranslating_Words_into_Algebra.def new file mode 100644 index 0000000000..1dc609ee0c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTranslating_Words_into_Algebra.def @@ -0,0 +1,31 @@ +openDate = 12/11/2013 at 12:00am PST +dueDate = 06/30/2014 at 01:00am PDT +answerDate = 06/30/2014 at 01:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/TranslatingWordsIntoAlgebra.pg +description = translating English into algebra +problemList = +BasicAlgebra/EnglishToMath/englishToMath10.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath20.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath25.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath30.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath40.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath45.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath50.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath55.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath60.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath70.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath140.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath150.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath160.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath170.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath80.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath82.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath84.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath90.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath100.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath110.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath120.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath130.pg, 1, -1, 0 +BasicAlgebra/EnglishToMath/englishToMath180.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTrigonometry.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTrigonometry.def new file mode 100644 index 0000000000..ded9435294 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setTrigonometry.def @@ -0,0 +1,13 @@ +openDate = 12/11/2013 at 12:48am PST +dueDate = 06/30/2014 at 02:38am PDT +answerDate = 06/30/2014 at 02:38am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Trigonometry.pg +description = questions about the definition of trigonometry ratios (sine, cosine and tangent) +problemList = +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg, 1, -1, 0 +BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setVolume.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setVolume.def new file mode 100644 index 0000000000..a35af66f6f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH060/setVolume.def @@ -0,0 +1,16 @@ + +openDate = 12/11/2013 at 12:48am PST +dueDate = 06/30/2014 at 01:47am PDT +answerDate = 06/30/2014 at 01:47am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH060/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH060/Volume.pg +description = questions about the volumes of prisms and cylinders +problemList = +BasicAlgebra/Geometry/RectangularPrismVolume10.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectangularPrismVolume20.pg, 1, -1, 0 +BasicAlgebra/Geometry/RectangularPrismVolume30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume10.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume20.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume30.pg, 1, -1, 0 +BasicAlgebra/Geometry/CylinderVolume40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setAdd_Subtract_Polynomials.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setAdd_Subtract_Polynomials.def new file mode 100644 index 0000000000..445d55a7e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setAdd_Subtract_Polynomials.def @@ -0,0 +1,26 @@ + +openDate = 12/11/2013 at 02:44am PST +dueDate = 06/30/2014 at 03:21am PDT +answerDate = 06/30/2014 at 03:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/AddSubtractPolynomials.pg +description = adding and subtracting polynomial expressions +problemList = +BasicAlgebra/PolynomialBasics/PolyAddSubtract0.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract5.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract10.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract15.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression30.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/SimplifyExpression40.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract20.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract25.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract35.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract80.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract85.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract90.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract95.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/PolyAddSubtract100.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar25.pg, 1, -1, 0 +BasicAlgebra/PolynomialBasics/polyMultVar30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setDivide_Polynomials.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setDivide_Polynomials.def new file mode 100644 index 0000000000..11c2f3a665 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setDivide_Polynomials.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 02:48am PST +dueDate = 06/30/2014 at 03:30am PDT +answerDate = 06/30/2014 at 03:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/DividePolynomials.pg +description = division of polynomials by a monomial +problemList = +BasicAlgebra/Exponents/exponentDivision105.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision100.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision115.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision125.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision120.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision130.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision135.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision140.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision150.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setExponent_Review.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setExponent_Review.def new file mode 100644 index 0000000000..93c938dfcd --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setExponent_Review.def @@ -0,0 +1,31 @@ +openDate = 12/11/2013 at 02:42am PST +dueDate = 06/30/2014 at 03:15am PDT +answerDate = 06/30/2014 at 03:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ExponentReview.pg +description = rules of working with exponents +problemList = +BasicAlgebra/Exponents/ExponentDefinition30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication20.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication50.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision75.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision70.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision60.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision105.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision100.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision45.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision50.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision80.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision10.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision5.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision0.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision15.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision30.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision25.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentDivision40.pg, 1, -1, 0 +BasicAlgebra/Exponents/exponentsMultiplication35.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Special_Polynomials.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Special_Polynomials.def new file mode 100644 index 0000000000..18ace46835 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Special_Polynomials.def @@ -0,0 +1,33 @@ + +openDate = 12/11/2013 at 03:02am PST +dueDate = 06/30/2014 at 03:45am PDT +answerDate = 06/30/2014 at 03:45am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorSpecialPolynomials.pg +description = factoring special polynomials where a special form can be applied +problemList = +BasicAlgebra/Factoring/factoring445.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring450.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring455.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring460.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring465.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring470.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring475.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring480.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring485.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring490.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring495.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring500.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring505.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring520.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring525.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring530.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring535.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring540.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring555.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring560.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring590.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring595.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring600.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring615.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def new file mode 100644 index 0000000000..a00b17d07f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomial_when_a_is_1.def @@ -0,0 +1,29 @@ +openDate = 12/11/2013 at 02:58am PST +dueDate = 06/30/2014 at 03:39am PDT +answerDate = 06/30/2014 at 03:39am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialWhenAIs1.pg +description = factoring trinomials with a leading coefficient of 1 +problemList = +BasicAlgebra/Factoring/factoring170.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring175.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring180.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring170.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring175.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring180.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring355.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring360.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring365.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring370.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring360.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring365.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring370.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring375.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring385.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring390.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring400.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring405.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring410.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring415.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring420.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def new file mode 100644 index 0000000000..6a96d03b04 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_Trinomials_when_a_is_Not_1.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:00am PST +dueDate = 06/30/2014 at 03:42am PDT +answerDate = 06/30/2014 at 03:42am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorTrinomialsWhenAIsNot1.pg +description = factoring trinomials whose leading coefficient is not 1 +problemList = +BasicAlgebra/Factoring/factoring185.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring190.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring195.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring200.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring205.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring210.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring235.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring240.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring245.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring280.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring285.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring295.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring325.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_by_Grouping.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_by_Grouping.def new file mode 100644 index 0000000000..a5d05392d2 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_by_Grouping.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 02:56am PST +dueDate = 06/30/2014 at 03:36am PDT +answerDate = 06/30/2014 at 03:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorByGrouping.pg +description = factoring polynomials using the grouping technique +problemList = +BasicAlgebra/Factoring/factoring105.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring110.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring115.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring120.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring125.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring130.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring135.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring140.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring150.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring120.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring125.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring135.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring140.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring150.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_out_Common_Factors.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_out_Common_Factors.def new file mode 100644 index 0000000000..adcd221338 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFactor_out_Common_Factors.def @@ -0,0 +1,28 @@ + +openDate = 12/11/2013 at 02:54am PST +dueDate = 06/30/2014 at 03:33am PDT +answerDate = 06/30/2014 at 03:33am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FactorOutCommonFactors.pg +description = factoring out the greatest common factor +problemList = +BasicAlgebra/Factoring/factoring5.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring10.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring15.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring20.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring25.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring30.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring36.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring37.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring38.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring41.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring56.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring71.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring76.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring77.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring80.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring85.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring90.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring95.pg, 1, -1, 0 +BasicAlgebra/Factoring/factoring100.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFalling_Object_Applications.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFalling_Object_Applications.def new file mode 100644 index 0000000000..5136393b3d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFalling_Object_Applications.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:36am PST +dueDate = 06/30/2014 at 04:36am PDT +answerDate = 06/30/2014 at 04:36am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/FallingObjectApplications.pg +description = applications of quadratic expressions to falling objects +problemList = +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFunctions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFunctions.def new file mode 100644 index 0000000000..4c3b2a8714 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setFunctions.def @@ -0,0 +1,29 @@ + +openDate = 12/11/2013 at 03:38am PST +dueDate = 06/30/2014 at 04:37am PDT +answerDate = 06/30/2014 at 04:37am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH60HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/Functions.pg +description = introduction to functions +problemList = +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setIntroduction_to_Square_Root.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setIntroduction_to_Square_Root.def new file mode 100644 index 0000000000..7f12438bf9 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setIntroduction_to_Square_Root.def @@ -0,0 +1,16 @@ + +openDate = 12/11/2013 at 03:04am PST +dueDate = 06/30/2014 at 03:48am PDT +answerDate = 06/30/2014 at 03:48am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/IntroductionToSquareRoot.pg +description = evaluating square roots +problemList = +BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMaximum_Minimum_Applications.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMaximum_Minimum_Applications.def new file mode 100644 index 0000000000..cb7a7aa3c0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMaximum_Minimum_Applications.def @@ -0,0 +1,14 @@ + +openDate = 12/11/2013 at 03:34am PST +dueDate = 06/30/2014 at 04:33am PDT +answerDate = 06/30/2014 at 04:33am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MaximumMinimumApplications.pg +description = applications of quadratic expressions to finding a maximal or minimal value +problemList = +BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMoving_Parabola_Up_Down.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMoving_Parabola_Up_Down.def new file mode 100644 index 0000000000..bf99a3b23e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMoving_Parabola_Up_Down.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 03:20am PST +dueDate = 06/30/2014 at 04:12am PDT +answerDate = 06/30/2014 at 04:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MovingParabolaUpDown.pg +description = shifting a parabola up and down +problemList = +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMultiplying_Polynomials.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMultiplying_Polynomials.def new file mode 100644 index 0000000000..2bbc293875 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setMultiplying_Polynomials.def @@ -0,0 +1,41 @@ + +openDate = 12/11/2013 at 02:46am PST +dueDate = 06/30/2014 at 03:24am PDT +answerDate = 06/30/2014 at 03:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/MultiplyingPolynomials.pg +description = multiplication of polynomial expressions +problemList = +BasicAlgebra/PolynomialMultiplication/polyMultVar60.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication0.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication5.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication10.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication15.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication20.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication25.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication30.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication35.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication40.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication45.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication50.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication55.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication60.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication65.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication70.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication75.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication80.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication160.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication165.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication170.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication175.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication185.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication190.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication195.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication200.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication205.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication210.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/PolynomialMultiplication225.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar100.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar135.pg, 1, -1, 0 +BasicAlgebra/PolynomialMultiplication/polyMultVar160.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setNegative_Exponents.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setNegative_Exponents.def new file mode 100644 index 0000000000..637b215a32 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setNegative_Exponents.def @@ -0,0 +1,32 @@ + +openDate = 12/11/2013 at 02:50am PST +dueDate = 06/30/2014 at 03:31am PDT +answerDate = 06/30/2014 at 03:31am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/NegativeExponents.pg +description = practice working with negative exponents +problemList = +BasicAlgebra/Exponents/negExp75.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp90.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp60.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp85.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp65.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp70.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp10.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp45.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp50.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp20.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp25.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp5.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp0.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp55.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp41.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp100.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp105.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp110.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp115.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp120.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp135.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp150.pg, 1, -1, 0 +BasicAlgebra/Exponents/negExp155.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Axis_and_Vertex.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Axis_and_Vertex.def new file mode 100644 index 0000000000..53c889ea00 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Axis_and_Vertex.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 03:28am PST +dueDate = 06/30/2014 at 04:24am PDT +answerDate = 06/30/2014 at 04:24am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaAxisAndVertex.pg +description = identifying the vertex and axis of symmetry of a parabola +problemList = +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Intercepts.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Intercepts.def new file mode 100644 index 0000000000..0a96aa5d43 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Intercepts.def @@ -0,0 +1,33 @@ + +openDate = 12/11/2013 at 03:30am PST +dueDate = 06/30/2014 at 04:27am PDT +answerDate = 06/30/2014 at 04:27am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaIntercepts.pg +description = identifying the intercepts of a parabola +problemList = +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts115.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts150.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts170.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts180.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts190.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts210.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts220.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts230.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Movement_Summary.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Movement_Summary.def new file mode 100644 index 0000000000..ce70d11632 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Movement_Summary.def @@ -0,0 +1,17 @@ + +openDate = 12/11/2013 at 03:26am PST +dueDate = 06/30/2014 at 04:21am PDT +answerDate = 06/30/2014 at 04:21am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaMovementSummary.pg +description = summary of graph transformations to a parabola +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Shifting_Left_Right.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Shifting_Left_Right.def new file mode 100644 index 0000000000..682473e4e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Shifting_Left_Right.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:24am PST +dueDate = 06/30/2014 at 04:18am PDT +answerDate = 06/30/2014 at 04:18am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaShiftingLeftRight.pg +description = shifting a parabola left or right +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Thinner_Wider.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Thinner_Wider.def new file mode 100644 index 0000000000..d3d29c9400 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setParabola_Thinner_Wider.def @@ -0,0 +1,13 @@ + +openDate = 12/11/2013 at 03:22am PST +dueDate = 06/30/2014 at 04:15am PDT +answerDate = 06/30/2014 at 04:15am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ParabolaThinnerWider.pg +description = stretching a parabola vertically to make it appear thinner +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setQuadratic_Equation_Applications.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setQuadratic_Equation_Applications.def new file mode 100644 index 0000000000..0f58ce13dc --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setQuadratic_Equation_Applications.def @@ -0,0 +1,15 @@ + +openDate = 12/11/2013 at 03:18am PST +dueDate = 06/30/2014 at 04:09am PDT +answerDate = 06/30/2014 at 04:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/QuadraticEquationApplications.pg +description = applications of quadratic equations +problemList = +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setRationalize_Denominator.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setRationalize_Denominator.def new file mode 100644 index 0000000000..c005bd45ce --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setRationalize_Denominator.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:10am PST +dueDate = 06/30/2014 at 03:57am PDT +answerDate = 06/30/2014 at 03:57am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/RationalizeDenominator.pg +description = rationalizing the denominator of a radical expression +problemList = +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator110.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setReview_Graphing_Lines.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setReview_Graphing_Lines.def new file mode 100644 index 0000000000..aee0c2126d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setReview_Graphing_Lines.def @@ -0,0 +1,22 @@ +openDate = 12/11/2013 at 02:32am PST +dueDate = 06/30/2014 at 03:00am PDT +answerDate = 06/30/2014 at 03:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ReviewGraphingLines.pg +description = review of graphing lines +problemList = +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints60.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByPointSlope80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph30.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph50.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph70.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph80.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph110.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/StandardToSlopeInterceptAndGraph120.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints90.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints95.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints100.pg, 1, -1, 0 +BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setScientific_Notation.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setScientific_Notation.def new file mode 100644 index 0000000000..bfbf62dabc --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setScientific_Notation.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 02:52am PST +dueDate = 06/30/2014 at 03:32am PDT +answerDate = 06/30/2014 at 03:32am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/ScientificNotation.pg +description = practice using scientific notation +problemList = +BasicAlgebra/NumberBasics/ScientificNotation10.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation20.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation30.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation40.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation50.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation60.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation70.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation80.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation90.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation100.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation110.pg, 1, -1, 0 +BasicAlgebra/NumberBasics/ScientificNotation120.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSimplify_Square_Roots.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSimplify_Square_Roots.def new file mode 100644 index 0000000000..74d5cfc36c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSimplify_Square_Roots.def @@ -0,0 +1,23 @@ + +openDate = 12/11/2013 at 03:06am PST +dueDate = 06/30/2014 at 03:51am PDT +answerDate = 06/30/2014 at 03:51am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SimplifySquareRoots.pg +description = simplifying expressions with square roots +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSketching_Parabolas.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSketching_Parabolas.def new file mode 100644 index 0000000000..27bd59b81c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSketching_Parabolas.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 03:32am PST +dueDate = 06/30/2014 at 04:30am PDT +answerDate = 06/30/2014 at 04:30am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SketchingParabolas.pg +description = sketching the graph of a quadratic expression +problemList = +BasicAlgebra/GraphingQuadratics/SketchParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def new file mode 100644 index 0000000000..c1019c39e7 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Factoring.def @@ -0,0 +1,34 @@ + +openDate = 12/11/2013 at 03:14am PST +dueDate = 06/30/2014 at 04:03am PDT +answerDate = 06/30/2014 at 04:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByFactoring.pg +description = solve a quadratic equation by factoring +problemList = +BasicAlgebra/QuadraticEquations/solveQuad95.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad230.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad220.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad235.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad240.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad250.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad255.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad265.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad210.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad215.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad270.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad280.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad285.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad290.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad295.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad105.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad200.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad300.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad305.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad325.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad330.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad335.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad340.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def new file mode 100644 index 0000000000..bfe9283033 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Quadratic_Formula.def @@ -0,0 +1,18 @@ + +openDate = 12/11/2013 at 03:16am PST +dueDate = 06/30/2014 at 04:06am PDT +answerDate = 06/30/2014 at 04:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationByQuadraticFormula.pg +description = solve a quadratic equation using the quadratic formula +problemList = +BasicAlgebra/QuadraticEquations/solveQuad145.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad150.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad155.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad185.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad375.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad380.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad385.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def new file mode 100644 index 0000000000..4e04c67950 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_Quadratic_Equation_by_Square_Root_Property.def @@ -0,0 +1,22 @@ + +openDate = 12/11/2013 at 03:12am PST +dueDate = 06/30/2014 at 04:00am PDT +answerDate = 06/30/2014 at 04:00am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveQuadraticEquationBySquareRootProperty.pg +description = solve a quadratic equation by using the square root +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad35.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad40.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad45.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad50.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad55.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad65.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad70.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad75.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad80.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad85.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Elimination.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Elimination.def new file mode 100644 index 0000000000..d204b7d870 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Elimination.def @@ -0,0 +1,20 @@ +openDate = 12/11/2013 at 02:38am PST +dueDate = 06/30/2014 at 03:09am PDT +answerDate = 06/30/2014 at 03:09am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByElimination.pg +description = solve a systme of linear equations using the elimination (aka addition) method +problemList = +BasicAlgebra/SystemsOfLinearEquations/SystemEquation10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemEquation20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations55.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Graphing.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Graphing.def new file mode 100644 index 0000000000..af48e49847 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Graphing.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 02:34am PST +dueDate = 06/30/2014 at 03:03am PDT +answerDate = 06/30/2014 at 03:03am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemByGraphing.pg +description = solve a system of linear equations by graphing the lines +problemList = +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing40.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing50.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing60.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing70.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolveSystemByGraphing80.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem30.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/NumberOfSolutionsOfSystem40.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem10.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem20.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SolutionOfSystem30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Substitution.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Substitution.def new file mode 100644 index 0000000000..94f347423e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSolve_System_by_Substitution.def @@ -0,0 +1,14 @@ +openDate = 12/11/2013 at 02:36am PST +dueDate = 06/30/2014 at 03:06am PDT +answerDate = 06/30/2014 at 03:06am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SolveSystemBySubstitution.pg +description = solve a system of linear equations by isolating one variable and using substitution +problemList = +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations11.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations12.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations13.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations14.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations16.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations25.pg, 1, -1, 0 +BasicAlgebra/SystemsOfLinearEquations/SystemOfEquations30.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSquare_Root_Operations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSquare_Root_Operations.def new file mode 100644 index 0000000000..4b4ff93965 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSquare_Root_Operations.def @@ -0,0 +1,24 @@ + +openDate = 12/11/2013 at 03:08am PST +dueDate = 06/30/2014 at 03:54am PDT +answerDate = 06/30/2014 at 03:54am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SquareRootOperations.pg +description = simplifying radical expressions +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical1.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSystem_Equation_Applications.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSystem_Equation_Applications.def new file mode 100644 index 0000000000..8e99e61a60 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setSystem_Equation_Applications.def @@ -0,0 +1,20 @@ + +openDate = 12/11/2013 at 02:40am PST +dueDate = 06/30/2014 at 03:12am PDT +answerDate = 06/30/2014 at 03:12am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeader_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/SystemEquationApplications.pg +description = applications of solving systems of linear equations +problemList = +BasicAlgebra/SystemOfLinearEquationsApplications/systemsWord5.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication70.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication80.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication90.pg, 1, -1, 0 +BasicAlgebra/SystemOfLinearEquationsApplications/SystemEquationApplication100.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setTrigonometryRatios.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setTrigonometryRatios.def new file mode 100644 index 0000000000..27f4a3ce63 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH065/setTrigonometryRatios.def @@ -0,0 +1,92 @@ +assignmentType = default +openDate = 12/11/2013 at 03:10am PST +dueDate = 06/30/2014 at 03:58am PDT +answerDate = 06/30/2014 at 03:58am PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH065/MTH65HardCopyHeaders_Yao.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH065/TrigonometryRatios.pg +description = +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition10.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition20.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 2 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition30.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 3 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition40.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 4 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition50.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 5 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition60.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 6 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition70.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 7 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition80.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 8 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +source_file = BasicAlgebra/Trigonometry/RightTriangleTrigDefinition90.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +problem_id = 9 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/Exam_ORCCA_ed2_10.1-11.2.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/Exam_ORCCA_ed2_10.1-11.2.pg new file mode 100644 index 0000000000..ff3e897005 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/Exam_ORCCA_ed2_10.1-11.2.pg @@ -0,0 +1,161 @@ +##DESCRIPTION +## Algebra problem: true or false for inequality +##ENDDESCRIPTION + +##KEYWORDS('algebra', 'inequality', 'fraction') + +## DBsubject('Algebra') +## DBchapter('Fundamentals') +## DBsection('Real Numbers') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Precalculus') +## EditionText1('3') +## AuthorText1('Stewart, Redlin, Watson') +## Section1('1.1') +## Problem1('22') + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", + #"source.pl", # allows code to be displayed on certain sites. + #"PGcourse.pl", # Customization file for the course + "PGML.pl", + "PCCmacros.pl", +"contextLimitedFactor.pl", +); + +# Print problem number and point value (weight) for the problem +TEXT(beginproblem()); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# +# Setup +# +# +Context("Numeric"); +Context("LimitedFactor"); +Context()->noreduce('(-x)-y','(-x)+y'); +$var = RandomVariableName(type=>'variable'); +Context()->variables->are($var=>'Real'); + +Context()->strings->add("cannot be factored"=>{}, + "cannot be factored."=>{alias=>"cannot be factored"}); +Context()->strings->add('prime'=>{}, 'it is prime'=>{alias=>'prime'}); +Context()->noreduce('(-x)-y', '(-x)+y'); + + +$pi = Real("pi"); +# the common term +$a = 1; +$b = 100; +$c = 1; +$d = 1; +# this next condition ensures the numbers don't get too big +while(abs($d*$b+$d*$a*$c)+abs($d*$b*$c)>50) +{ + $a = 1; + $b = random(1,10,1)*random(-1,1,2); + $c = random(1,10,1)*abs($b)/$b*-1; + $d = random(2,10,1); +} + +$n = random(2,8,1); +$leading = $a; +$middle = $b+$a*$c; +$end = $b*$c; +$question = Formula("$d*$leading*$var^(2+$n)+$d*$middle*$var^($n+1)+$d*$end$var^$n")->reduce; +$RonStep1= +Formula("$d($leading*$var^(2+$n)+$middle*$var^($n+1)+$end$var^$n)")->reduce; +$RonStep2= +Formula("$d($leading*$var^($n+1)+$b$var^$n)($var+$c)")->reduce; +$DracoStep1= +Formula("$var^($n)($d*$leading*$var^(2)+$d*$middle*$var+$d*$end)")->reduce; +$DracoStep2= +Formula("$var^($n)($d*$leading*$var+$d*$b)($var+$c)")->reduce; +$ans = Formula("$d*$var^$n($a*$var+$b)*($var+$c)")->reduce; +$FillInBlankFirst= +Formula("$var^(2)")->reduce; +$FillInBlankLast= +Formula("abs($d*$end*2)")->reduce; +############################################## +############################################################## +# +# Text +# +# + +Context()->texStrings; +BEGIN_TEXT +Unless you have been instructed otherwise, complete the following problems outside of WeBWorK (on paper, using MS Word, using a Google Doc, etc.) and upload your answers as a PDF file in D2L under the Assignments tab. + +If you understand these directions, enter the value of \(\pi\) accurate to two decimal places. + + + +\{$pi->ans_rule\} + +END_TEXT +BEGIN_PGML +1. On a quiz is the following Question: + + Factor the given polynomial. + + [`[$question]`] + + Ron answered it like this: + + [`=[$RonStep1]`] + + [`=[$RonStep2]`] + + Draco answered it like this: + + [`=[$DracoStep1]`] + + [`=[$DracoStep2]`] + + + Who is correct? Ron? Draco? Both? Neither? + Are there any errors in the student work? + Give a full explanation of your judgement of the students' work. + +1. Fill in the blank with whole numbers so that the trinomial factors. Please create two different trinomials that factor. After creating each trinomial, show how it factors. + + [`[$FillInBlankFirst]+\underline{\phantom{12345}}{}-[$FillInBlankLast]`] + +1. Here is a graph describing a function of gas prices. + + [@ image( "chgaschart.png", width=>600, +tex_size=>1000, extra_html_tags=>'alt="Plot showing average retail price for one gallon of gasoline from October 2018 through April 2020"' ) @]* + + a. State the units of the input and the units of the output. + + a. Using a complete sentence in context, describe the domain. + + a. Using interval notation, state the range. + +END_PGML + +Context()->normalStrings; + +############################################################## +# +# Answers +# +# + +ANS($pi->with(tolerance=>.01)->cmp); +# relative tolerance --3.1412 is incorrect but 3.1413 is correct +# default tolerance is .01 or one percent. + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/chgaschart.png b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/chgaschart.png new file mode 100644 index 0000000000..58d9cfa7ac Binary files /dev/null and b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/chgaschart.png differ diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def new file mode 100644 index 0000000000..38c093ce74 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setAdd_Subtract_Rational_Expressions.def @@ -0,0 +1,24 @@ +openDate = 12/01/2015 at 12:26am PST +dueDate = 03/01/2016 at 12:26am PST +answerDate = 03/01/2016 at 12:26am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Add_Subtract_Rational_Expressions.pg +description = subtract rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions110.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions120.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions130.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions140.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions150.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setCalculator_Basics.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setCalculator_Basics.def new file mode 100644 index 0000000000..9fdb03ef6f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setCalculator_Basics.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:00am PST +dueDate = 03/01/2016 at 12:00am PST +answerDate = 03/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Calculator_Basics.pg +description = learning the basics about using graphing calculators +problemList = +BasicAlgebra/Calculator/CalculatorBasics10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics20.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics30.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics40.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics50.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics60.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics70.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics80.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorBasics90.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorIntersection10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorIntersection20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setComplex_Number_Operations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setComplex_Number_Operations.def new file mode 100644 index 0000000000..340fac9eed --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setComplex_Number_Operations.def @@ -0,0 +1,23 @@ +openDate = 12/01/2015 at 12:44am PST +dueDate = 03/01/2016 at 12:44am PST +answerDate = 03/01/2016 at 12:44am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Complex_Number_Operations.pg +description = add, subtract, multiply complex numbers +problemList = +BasicAlgebra/ComplexNumber/complexNumberBasics10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberBasics20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberBasics30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations40.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations50.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations60.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations70.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations80.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setDivide_Rational_Expressions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setDivide_Rational_Expressions.def new file mode 100644 index 0000000000..598d861b47 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setDivide_Rational_Expressions.def @@ -0,0 +1,17 @@ +openDate = 12/01/2015 at 12:22am PST +dueDate = 03/01/2016 at 12:22am PST +answerDate = 03/01/2016 at 12:22am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Divide_Rational_Expressions.pg +description = divide rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions25.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions45.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/divideRationalExpressions60.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setExam_ORCCA_ed2_10.1-11.2.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setExam_ORCCA_ed2_10.1-11.2.def new file mode 100644 index 0000000000..c0a3192045 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setExam_ORCCA_ed2_10.1-11.2.def @@ -0,0 +1,96 @@ +assignmentType = gateway +openDate = 04/22/2020 at 07:00am PDT +reducedScoringDate =04/28/2020 at 11:59pm PDT +dueDate = 04/28/2020 at 11:59pm PDT +answerDate = 05/01/2020 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Exam_ORCCA_ed2_10.1-11.2_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Exam_ORCCA_ed2_10.1-11.2_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = This Exam includes questions covered in sections 10.1 through 11.2 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring71.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring100.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring125.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring135.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring175.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring390.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring470.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring560.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad95.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad235.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad340.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve10.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/Functions211.pg +value = 5 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext20.pg +value = 5 +problem_end +problem_start +source_file = PCCSetDefinitions/MTH095/Exam_ORCCA_ed2_10.1-11.2.pg +value = 1 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFinal_Exam_202004_40038.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFinal_Exam_202004_40038.def new file mode 100644 index 0000000000..29501fcb8a --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFinal_Exam_202004_40038.def @@ -0,0 +1,144 @@ +assignmentType = gateway +openDate = 04/22/2020 at 07:00am PDT +reducedScoringDate =04/28/2020 at 11:59pm PDT +dueDate = 04/28/2020 at 11:59pm PDT +answerDate = 05/01/2020 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Final_Exam_202004_40038_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Final_Exam_202004_40038_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = A Final Exam with questions from chapters 10 through 13 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/Functions213.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/Functions225.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/11-Functions/11_4-Simplifying_Expressions_with_Function_Notation/11_4_4_21.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/11-Functions/11_4-Simplifying_Expressions_with_Function_Notation/11_4_4_9.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/MultiplyingRationals/MultiplyingRationals2.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/addSubtractRationalExpressions100.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions70.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalLiteralEquations/LiteralEquation290.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalEquations/solveRationalEquations60.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad260.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_3-Completing_the_Square/13_3_6_23.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/AbsValueEquations/lh1-6_66.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/AbsValueEquations/s5p6.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities3.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/Math95/CompoundLinearInequalities/CompoundLinearInequalities12.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/SlopeAndY-InterceptCalculations/FindSlopeYIntercept55.pg +value = 4 +problem_end +problem_start +source_file = Library/PCC/BasicAlgebra/GraphingPointsAndLines/GraphLinearEquationByTwoPoints80.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_3-Completing_the_Square/13_3_6_29.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticFunctions/QuadraticDomainRange10.pg +value = 8 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_2-Quadratic_Graphs_and_Vertex_Form/13_2_6_85.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_7-Solving_Inequalities_Graphically/13_7_5_17.pg +value = 8 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_2-Quadratic_Graphs_and_Vertex_Form/13_2_6_29.pg +value = 16 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/12-Rational_Functions_and_Equations/12_1-Introduction_to_Rational_Functions/12_1_3_29.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/RationalEquations/rationalEquationApplication44.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_2-Quadratic_Graphs_and_Vertex_Form/13_2_6_35.pg +value = 4 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/13-Graphs_and_Equations/13_2-Quadratic_Graphs_and_Vertex_Form/13_2_6_39.pg +value = 4 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Domain_Range.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Domain_Range.def new file mode 100644 index 0000000000..aa4e0dd9e3 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Domain_Range.def @@ -0,0 +1,31 @@ +openDate = 12/01/2015 at 12:04am PST +dueDate = 03/01/2016 at 12:04am PST +answerDate = 03/01/2016 at 12:04am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Domain_Range.pg +description = finding the domain and range functions +problemList = +FunctionBasics/Functions90.pg, 1, -1, 0 +FunctionBasics/Functions100.pg, 1, -1, 0 +FunctionBasics/Functions110.pg, 1, -1, 0 +FunctionBasics/Functions120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg, 1, -1, 0 +FunctionBasics/Functions170.pg, 1, -1, 0 +FunctionBasics/Functions180.pg, 1, -1, 0 +FunctionBasics/Functions200.pg, 1, -1, 0 +FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg, 1, -1, 0 +FunctionBasics/Functions225.pg, 1, -1, 0 +FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext60.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Notation.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Notation.def new file mode 100644 index 0000000000..b00d94b3b3 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setFunction_Notation.def @@ -0,0 +1,32 @@ +openDate = 12/01/2015 at 12:02am PST +dueDate = 03/01/2016 at 12:02am PST +answerDate = 03/01/2016 at 12:02am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Function_Notation.pg +description = learning and applying function notation +problemList = +BasicAlgebra/FunctionBasics/FunctionInContext10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionInContext40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction85.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition65.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition65.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition66.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionComposition66.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools20.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorTable10.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setLinear_Functions_From_Data.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setLinear_Functions_From_Data.def new file mode 100644 index 0000000000..4eefb462e5 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setLinear_Functions_From_Data.def @@ -0,0 +1,52 @@ +openDate = 09/23/2019 at 12:00am +reducedScoringDate = 06/15/2029 at 10:00pm +dueDate = 08/17/2029 at 10:00pm +answerDate = 08/17/2029 at 10:00pm +enableReducedScoring = Y +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = find the formula for a linear function given two data points +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints10.pg +problem_id = 1 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints20.pg +problem_id = 2 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints30.pg +problem_id = 3 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints40.pg +problem_id = 4 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints50.pg +problem_id = 5 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/LinearFunctionsFromPoints/LinearFunctionsFromPoints60.pg +problem_id = 6 +value = 1 +max_attempts = -1 +showMeAnother = -2 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMidterm_Exam_202004_40038.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMidterm_Exam_202004_40038.def new file mode 100644 index 0000000000..48b82bee7b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMidterm_Exam_202004_40038.def @@ -0,0 +1,156 @@ +assignmentType = gateway +openDate = 04/22/2020 at 07:00am PDT +reducedScoringDate =04/28/2020 at 11:59pm PDT +dueDate = 04/28/2020 at 11:59pm PDT +answerDate = 05/01/2020 at 11:59pm PDT +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Midterm_Exam_202004_40038_header.pg +screenHeaderFile = PCCDefaultProblemSets/CombinedHeaders/MTH095/Midterm_Exam_202004_30038_header.pg +attemptsPerVersion = 0 +timeInterval = 0 +versionsPerInterval = 1 +versionTimeLimit = 7200 +problemRandOrder = 0 +problemsPerPage = 0 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = A Midterm Exam with questions from chapters 10 and 11 of ORCCA, 2nd edition. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring100.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring130.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring345.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring525.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring85.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring380.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring395.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring210.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring200.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring550.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring505.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/Factoring/factoring280.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad265.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad295.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad305.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticEquations/solveQuad275.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionInContext10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/CollegeAlgebra/FunctionBasics/FunctionRelations10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction100.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction80.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/EvaluateFunction120.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/CollegeAlgebra/FunctionBasics/EvaluateAndSolve30.pg +value = 8 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg +value = 8 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionValuesByGraph45.pg +value = 16 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/Functions200.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/Functions225.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionDomainRangeInContext10.pg +value = 4 +problem_end +problem_start +source_file = Contrib/PCC/BasicAlgebra/FunctionBasics/FunctionComposition66.pg +value = 16 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/11-Functions/11_3-Using_Technology_to_Explore_Functions/11_3_5_31.pg +value = 8 +problem_end +problem_start +source_file = ORCCA/ed2/III-Preparation_for_College_Algebra/11-Functions/11_3-Using_Technology_to_Explore_Functions/11_3_5_25.pg +value = 8 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMultiply_Rational_Expressions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMultiply_Rational_Expressions.def new file mode 100644 index 0000000000..7236470059 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setMultiply_Rational_Expressions.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:20am PST +dueDate = 03/01/2016 at 12:20am PST +answerDate = 03/01/2016 at 12:20am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Multiply_Rational_Expressions.pg +description = multiply rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/multiplyRationalExpressions100.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setOperations_with_Radicals.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setOperations_with_Radicals.def new file mode 100644 index 0000000000..2d26974f77 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setOperations_with_Radicals.def @@ -0,0 +1,43 @@ +openDate = 12/01/2015 at 12:37am PST +dueDate = 03/01/2016 at 12:37am PST +answerDate = 03/01/2016 at 12:37am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Operations_with_Radicals.pg +description = operations that include radicals +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals13.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals14.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals15.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals51.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals52.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals55.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals56.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals57.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals58.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals91.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals92.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals93.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals94.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals95.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals44.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals55.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals65.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty11.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty12.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty41.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty43.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty60.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def new file mode 100644 index 0000000000..83ee97340c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Equations_with_Complex_Solutions.def @@ -0,0 +1,14 @@ +openDate = 12/01/2015 at 12:58am PST +dueDate = 03/01/2016 at 12:58am PST +answerDate = 03/01/2016 at 12:58am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Equations_with_Complex_Solutions.pg +description = find, understand, and interpret complex solutions of quadratic equations +problemList = +BasicAlgebra/ComplexNumber/complexSolutions10.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions20.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions30.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions40.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexSolutions50.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Formula.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Formula.def new file mode 100644 index 0000000000..0f5d59d87d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Formula.def @@ -0,0 +1,19 @@ +openDate = 12/01/2015 at 12:56am PST +dueDate = 03/01/2016 at 12:56am PST +answerDate = 03/01/2016 at 12:56am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Formula.pg +description = solve a quadratic equation using the quadratic formula +problemList = +BasicAlgebra/QuadraticEquations/solveQuad375.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad380.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad385.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad185.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools30.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools40.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorGraphingTools50.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorQuadraticFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions.def new file mode 100644 index 0000000000..2e43c931df --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:50am PST +dueDate = 03/01/2016 at 12:50am PST +answerDate = 03/01/2016 at 12:50am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions.pg +description = quadratic functions their graphs +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def new file mode 100644 index 0000000000..a88a2e2d3f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setQuadratic_Functions_Vertex_Form.def @@ -0,0 +1,24 @@ +openDate = 12/01/2015 at 12:52am PST +dueDate = 03/01/2016 at 12:52am PST +answerDate = 03/01/2016 at 12:52am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Quadratic_Functions_Vertex_Form.pg +description = quadratic functions in vertex form and their graphs +problemList = +BasicAlgebra/QuadraticFunctions/CompleteSquare10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare40.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare50.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare60.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare70.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm15.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticVertexForm40.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRadical_Functions_Domain_Range.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRadical_Functions_Domain_Range.def new file mode 100644 index 0000000000..abf0dc5bae --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRadical_Functions_Domain_Range.def @@ -0,0 +1,23 @@ +openDate = 12/01/2015 at 12:34am PST +dueDate = 03/01/2016 at 12:34am PST +answerDate = 03/01/2016 at 12:34am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Radical_Functions_Domain_Range.pg +description = determine the domain and range of radical functions +problemList = +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions2.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions3.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions4.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions5.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions6.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions7.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions8.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically90.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically100.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically110.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically120.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically130.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically140.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctionsGraphically150.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Exponents.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Exponents.def new file mode 100644 index 0000000000..eb4b66091b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Exponents.def @@ -0,0 +1,50 @@ +openDate = 12/01/2015 at 12:35am PST +dueDate = 03/01/2016 at 12:35am PST +answerDate = 03/01/2016 at 12:35am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Exponents.pg +description = using rational exponents to simplify radical expressions +problemList = +Math95/RadicalsRationalExponents/RadicalsRationalExponents7.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents8.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FractionalExponentToRadical30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent26.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateFractionalExponent40.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots35.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateOtherRoots40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalToRationalExponent30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents9.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents14.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents15.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents16.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents17.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents18.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents19.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents21.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents24.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents27.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents28.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents29.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents31.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Functions_Domain.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Functions_Domain.def new file mode 100644 index 0000000000..bb6730e752 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRational_Functions_Domain.def @@ -0,0 +1,29 @@ +openDate = 12/01/2015 at 12:16am PST +dueDate = 03/01/2016 at 12:16am PST +answerDate = 03/01/2016 at 12:16am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rational_Functions_Domain.pg +description = determine the domain and range of rational functions +problemList = +BasicAlgebra/RationalFunctions/rationalFunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions211.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions212.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions213.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions214.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions215.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions216.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions217.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain40.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionDomain50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote20.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote30.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionAsymptote40.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/RationalFunctions/rationalFunctionApplication20.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def new file mode 100644 index 0000000000..7947d00d13 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Complex_Number_Denominators.def @@ -0,0 +1,15 @@ +openDate = 12/01/2015 at 12:46am PST +dueDate = 03/01/2016 at 12:46am PST +answerDate = 03/01/2016 at 12:46am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Complex_Number_Denominators.pg +description = rationalize denominators that include complex numbers +problemList = +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations90.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations100.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 +BasicAlgebra/ComplexNumber/complexNumberOperations110.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Radical_Denominators.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Radical_Denominators.def new file mode 100644 index 0000000000..7ea176a347 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setRationalize_Radical_Denominators.def @@ -0,0 +1,35 @@ +openDate = 12/01/2015 at 12:38am PST +dueDate = 03/01/2016 at 12:38am PST +answerDate = 03/01/2016 at 12:38am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Rationalize_Radical_Denominators.pg +description = rationalize denominators that include radicals +problemList = +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator35.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator36.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator37.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator81.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator82.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator83.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator84.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator85.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator86.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator87.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator110.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator140.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator150.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication10.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication20.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicalsApplication30.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals24.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals25.pg, 1, -1, 0 +Math95/SimplifyRadicals/SimplifyRadicals26.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator160.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator165.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator170.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator180.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator190.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator200.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator210.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_1-1.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_1-1.def new file mode 100644 index 0000000000..3cf3e98ca6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_1-1.def @@ -0,0 +1,54 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:00am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = evaluating formulaic functions; domain and range; graphs of functions +problemList = +BasicAlgebra/FunctionBasics/EvaluateFunction10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction50.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction70.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction110.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction140.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions110.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions150.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions160.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions170.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions200.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions225.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/Functions/Functions10.pg, 1, -1, 0 +Math95/Functions/Functions11.pg, 1, -1, 0 +Math95/Functions/Functions12.pg, 1, -1, 0 +Math95/Functions/Functions13.pg, 1, -1, 0 +Math95/Functions/Functions14.pg, 1, -1, 0 +Math95/Functions/Functions15.pg, 1, -1, 0 +Math95/Functions/Functions16.pg, 1, -1, 0 +Math95/Functions/Functions17.pg, 1, -1, 0 +Math95/Functions/Functions18.pg, 1, -1, 0 +Math95/Functions/Functions19.pg, 1, -1, 0 +Math95/Functions/Functions20.pg, 1, -1, 0 +Math95/Functions/Functions22.pg, 1, -1, 0 +Math95/Functions/Functions21.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-3.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-3.def new file mode 100644 index 0000000000..8f7407ea3e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-3.def @@ -0,0 +1,60 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:01am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = inequalities with number lines, interval notation, and set-builder notation; solving linear inequalities; applications +problemList = +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/IntervalNotation120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SetNotationToGraph40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality120.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality130.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality170.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality190.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality210.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality230.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality240.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality260.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality280.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality290.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality310.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality70.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveSpecialInequality80.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalityWordProblem20.pg, 1, -1, 0 +Math95/LinearInequalities/LinearInequalities8.pg, 1, -1, 0 +Math95/LinearInequalities/LinearInequalities9.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-4.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-4.def new file mode 100644 index 0000000000..b3ced9082e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-4.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:02am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = compound inequalities +problemList = +Math95/CompoundLinearInequalities/CompoundLinearInequalities1.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities2.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities3.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities4.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities5.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities6.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities11.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities10.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities7.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities8.pg, 1, -1, 0 +Math95/CompoundLinearInequalities/CompoundLinearInequalities9.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-5.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-5.def new file mode 100644 index 0000000000..fc9073ba2c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_2-5.def @@ -0,0 +1,17 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:03am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = absolute value inequalities +problemList = +Math95/AbsValueInequalities/AbsValueInequalities1.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities4.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities6.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities7.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities2.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities3.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities5.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities9.pg, 1, -1, 0 +Math95/AbsValueInequalities/AbsValueInequalities8.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-1.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-1.def new file mode 100644 index 0000000000..3856fa3c8f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-1.def @@ -0,0 +1,19 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:04am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = rational functions; easier rational equations +problemList = +Math95/Functions/Functions19.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions200.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations1.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations2.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations4.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations5.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations6.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations7.pg, 1, -1, 0 +Math95/RationalEquations/RationalEquations3.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-2.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-2.def new file mode 100644 index 0000000000..e09e4fd088 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-2.def @@ -0,0 +1,21 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:05am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = multiplication and division of rational expressions +problemList = +Math95/MultiplyingRationals/MultiplyingRationals1.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_15_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_18_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_22_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_20_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_19_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_16_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_23_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_24_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_25_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_27_MultDivRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_01_MultDivRationalExpressions/61IntAlg_26_MultDivRatExp.pg, 1, -1, 0 +Math95/MultiplyingRationals/MultiplyingRationals2.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-3.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-3.def new file mode 100644 index 0000000000..95dc9b7346 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-3.def @@ -0,0 +1,24 @@ + +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:06am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = addition and subtraction of rational expressions +problemList = +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_01_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_06_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_07_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_05_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_02_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_03_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_04_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_20_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_17_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_24_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_25_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_21_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_27_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_19_AddSubRatExp.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_06_02_AddSubRationalExpressions/62IntAlg_18_AddSubRatExp.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-4.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-4.def new file mode 100644 index 0000000000..92902cdd2a --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-4.def @@ -0,0 +1,32 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:07am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = more rational equations; applications +problemList = +Math95/MoreRationalEquations/MoreRationalEquations1.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations2.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations3.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations4.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations5.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations6.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations7.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations8.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations9.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations10.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations11.pg, 1, -1, 0 +Math95/MoreRationalEquations/MoreRationalEquations12.pg, 1, -1, 0 +Math95/Proportions/Proportions1.pg, 1, -1, 0 +Math95/Proportions/Proportions2.pg, 1, -1, 0 +Math95/Proportions/Proportions3.pg, 1, -1, 0 +Math95/Proportions/Proportions4.pg, 1, -1, 0 +Math95/Proportions/Proportions5.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications1.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications2.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications3.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications4.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications5.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications6.pg, 1, -1, 0 +Math95/RatEqApplications/RatEqApplications7.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-5.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-5.def new file mode 100644 index 0000000000..364f7293ed --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_4-5.def @@ -0,0 +1,18 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:08am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = "complex" fractions (rational expressions with more than two "levels") +problemList = +Math95/ComplexFractions/ComplexFractions1.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions2.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions3.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions4.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions5.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions6.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions7.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions8.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions9.pg, 1, -1, 0 +Math95/ComplexFractions/ComplexFractions10.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-1_5-2.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-1_5-2.def new file mode 100644 index 0000000000..7ecbfb27e8 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-1_5-2.def @@ -0,0 +1,40 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:09am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = square roots and radicals; rational exponents +problemList = +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot25.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EvaluateSquareRoot60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents6.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents5.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/EstimateRadical10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents3.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents4.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents9.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents27.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents28.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents29.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents31.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents30.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents11.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents12.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents7.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents8.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents10.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents18.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p13.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p16.pg, 1, -1, 0 +Library/Utah/Intermediate_Algebra/set7_Exponential_and_Logarithmic_Functions/s7p12.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-3.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-3.def new file mode 100644 index 0000000000..111ce86936 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-3.def @@ -0,0 +1,31 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:10am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = multiplying radical and rational exponent expressions +problemList = +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/MultiplyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalDivisionProperty40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals04.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals06.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents13.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents14.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents15.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents16.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents17.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents20.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents21.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents22.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents23.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents24.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-4.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-4.def new file mode 100644 index 0000000000..bdde53a100 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-4.def @@ -0,0 +1,34 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:11am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = adding like radicals; reducing radicals; rationalizing denominators; binomial multiplication with radicals and rational exponents +problemList = +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals20.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals40.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals02.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals60.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator30.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator45.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator70.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator50.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator90.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RationalizeDenominator80.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical1.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical2.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/FOILradical3.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals100.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals120.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals130.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals140.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents25.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents26.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-5.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-5.def new file mode 100644 index 0000000000..f581cb19fe --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-5.def @@ -0,0 +1,20 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:12am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = radical functions +problemList = +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions225.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions235.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions1.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions2.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions3.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions4.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions5.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions6.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions7.pg, 1, -1, 0 +Math95/RadicalFunctions/RadicalFunctions8.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-6.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-6.def new file mode 100644 index 0000000000..f9bd162940 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-6.def @@ -0,0 +1,33 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:13am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = equations that radicals help solve; Pythagorean Theorem; equations with radicals in them +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad35.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad40.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad50.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad70.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad75.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad85.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad115.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad110.pg, 1, -1, 0 +Math95/EquationsNeedingRadicals/EquationsNeedingRadicals3.pg, 1, -1, 0 +Math95/EquationsNeedingRadicals/EquationsNeedingRadicals4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations1.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations5.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations8.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations9.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations10.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad135.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad140.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-7.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-7.def new file mode 100644 index 0000000000..c183d725ec --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_5-7.def @@ -0,0 +1,20 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:14am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = arithmetic with complex numbers; counting real and nonreal roots of quadratic polynomials +problemList = +Math95/ComplexNumbers/ComplexNumbers1.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers2.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers3.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers4.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers5.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers6.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers7.pg, 1, -1, 0 +Math95/ComplexNumbers/ComplexNumbers8.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 +Math95/ComplexRoots/ComplexRoots1.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-1.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-1.def new file mode 100644 index 0000000000..6d8014412d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-1.def @@ -0,0 +1,24 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:15am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = graph quadratic functions; parabola axis of symmetry and vertex +problemList = +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/GraphParabolaByTable50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/IdentifyAxisVertex110.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-2.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-2.def new file mode 100644 index 0000000000..256be791df --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-2.def @@ -0,0 +1,25 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:16am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = transformations of y=x^2; quadratic data +problemList = +BasicAlgebra/GraphingQuadratics/ShiftParabola10.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola60.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola80.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola100.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola110.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ShiftParabola130.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/QuadraticFunctionForms10.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData1.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData2.pg, 1, -1, 0 +Math95/QuadraticData/QuadraticData3.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-3.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-3.def new file mode 100644 index 0000000000..11f4905628 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-3.def @@ -0,0 +1,46 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:17am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = solve quadratic equations using factoring, square root, and completing the square; find x-intercepts of parabolas; applications +problemList = +BasicAlgebra/QuadraticEquations/solveQuad95.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad230.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad220.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad235.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad240.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad120.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad180.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad265.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad270.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad280.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad285.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad295.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad335.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad330.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad325.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts50.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts120.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts140.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts160.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts200.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts220.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts230.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola20.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola30.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola70.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola100.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication30.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/MaxMinApplication50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication30.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-4.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-4.def new file mode 100644 index 0000000000..8b77a87ae4 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSection_6-4.def @@ -0,0 +1,21 @@ +openDate = 01/01/2014 at 12:00am PST +dueDate = 01/01/2015 at 12:18am PST +answerDate = 01/01/2016 at 12:00am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/GenericMTH95Header.pg +description = the quadratic formula; applications +problemList = +BasicAlgebra/QuadraticEquations/solveQuad145.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad150.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad160.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad170.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad176.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/ParabolaIntercepts90.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola40.pg, 1, -1, 0 +BasicAlgebra/GraphingQuadratics/SketchParabola50.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp10.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/FlyingObjectApp20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/QuadraticApplications/QuadraticEquationApplication50.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def new file mode 100644 index 0000000000..7c8e046444 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Complex_Rational_Expressions.def @@ -0,0 +1,18 @@ +openDate = 12/01/2015 at 12:28am PST +dueDate = 03/01/2016 at 12:28am PST +answerDate = 03/01/2016 at 12:28am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Complex_Rational_Expressions.pg +description = simplify complex rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions11.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions12.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/complexFractions70.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Radical_Expressions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Radical_Expressions.def new file mode 100644 index 0000000000..207d476ffa --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Radical_Expressions.def @@ -0,0 +1,28 @@ +openDate = 12/01/2015 at 12:36am PST +dueDate = 03/01/2016 at 12:36am PST +answerDate = 03/01/2016 at 12:36am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Radical_Expressions.pg +description = simplify radical expressions +problemList = +Math95/RadicalsRationalExponents/RadicalsRationalExponents1.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents2.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents3.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents4.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents5.pg, 1, -1, 0 +Math95/RadicalsRationalExponents/RadicalsRationalExponents6.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals07.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals09.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals150.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals160.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals170.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals180.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals185.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals190.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals200.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals210.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/SimplifyRadicals220.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEstimateRadical10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorEstimateRadical20.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Rational_Expressions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Rational_Expressions.def new file mode 100644 index 0000000000..722ea2a715 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSimplify_Rational_Expressions.def @@ -0,0 +1,27 @@ +openDate = 12/01/2015 at 12:18am PST +dueDate = 03/01/2016 at 12:18am PST +answerDate = 03/01/2016 at 12:18am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Simplify_Rational_Expressions.pg +description = simplify rational expressions +problemList = +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions10.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions20.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions30.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions40.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions50.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions60.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions70.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions80.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions90.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions100.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions110.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions120.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions130.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions140.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions150.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions160.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions170.pg, 1, -1, 0 +BasicAlgebra/RationalExpressionAlgebraSkills/simplifyRationalExpressions180.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def new file mode 100644 index 0000000000..20167defb9 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Equations.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:12am PST +dueDate = 03/01/2016 at 12:12am PST +answerDate = 03/01/2016 at 12:12am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Equations.pg +description = solve absolute value equations +problemList = +BasicAlgebra/AbsoluteValue/absoluteValueEquation10.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation20.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation30.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation40.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation50.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation60.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation65.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation70.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation80.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation90.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation95.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation100.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation110.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation120.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation130.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation140.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueEquation150.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def new file mode 100644 index 0000000000..2c025f8c71 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Absolute_Value_Inequalities.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:14am PST +dueDate = 03/01/2016 at 12:14am PST +answerDate = 03/01/2016 at 12:14am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Absolute_Value_Inequalities.pg +description = solve absolute value inequalities +problemList = +BasicAlgebra/AbsoluteValue/absoluteValueInequality10.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality20.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality30.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality40.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality50.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality60.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality70.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality80.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality90.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality100.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality110.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality120.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality130.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality140.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequality150.pg, 1, -1, 0 +BasicAlgebra/AbsoluteValue/absoluteValueInequalityApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveInequality10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveInequality20.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Inequalities.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Inequalities.def new file mode 100644 index 0000000000..14a7378064 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Inequalities.def @@ -0,0 +1,34 @@ +openDate = 12/01/2015 at 12:08am PST +dueDate = 03/01/2016 at 12:08am PST +answerDate = 03/01/2016 at 12:08am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Inequalities.pg +description = solve inequalities and compound inequalities +problemList = +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/InequalitySolutionOrNot30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality320.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequality300.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/SolveInequalityWithFraction20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics30.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics40.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics50.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityBasics60.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd90.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd100.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityAnd110.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr10.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr20.pg, 1, -1, 0 +BasicAlgebra/LinearInequalities/CompoundInequalityOr30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph55.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph56.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph57.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph58.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph59.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph61.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph62.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def new file mode 100644 index 0000000000..6baeeeeadd --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Literal_Rational_Equations.def @@ -0,0 +1,17 @@ +openDate = 12/01/2015 at 12:32am PST +dueDate = 03/01/2016 at 12:32am PST +answerDate = 03/01/2016 at 12:32am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Literal_Rational_Equations.pg +description = solve literal rational equations +problemList = +BasicAlgebra/RationalLiteralEquations/LiteralEquation220.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation230.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation240.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation250.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation260.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation270.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation280.pg, 1, -1, 0 +BasicAlgebra/RationalLiteralEquations/LiteralEquation290.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Quadratic_Equations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Quadratic_Equations.def new file mode 100644 index 0000000000..7093359a79 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Quadratic_Equations.def @@ -0,0 +1,21 @@ +openDate = 12/01/2015 at 12:54am PST +dueDate = 03/01/2016 at 12:54am PST +answerDate = 03/01/2016 at 12:54am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Quadratic_Equations.pg +description = learning more advanced skills for graphing calculators +problemList = +BasicAlgebra/QuadraticEquations/solveQuad30.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad60.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad90.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad245.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticEquations/solveQuad100.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare10.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare20.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare30.pg, 1, -1, 0 +BasicAlgebra/QuadraticFunctions/CompleteSquare40.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Radical_Equations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Radical_Equations.def new file mode 100644 index 0000000000..878f61f5f0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Radical_Equations.def @@ -0,0 +1,26 @@ +openDate = 12/01/2015 at 12:40am PST +dueDate = 03/01/2016 at 12:40am PST +answerDate = 03/01/2016 at 12:40am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Radical_Equations.pg +description = solve radical equations +problemList = +Math95/SolvingRadicalEquations/SolvingRadicalEquations1.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations2.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations3.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations4.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations5.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations6.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations7.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquations8.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral90.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral100.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral110.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsLiteral120.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRadicalEquation10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRadicalEquation20.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication92.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication102.pg, 1, -1, 0 +Math95/SolvingRadicalEquations/SolvingRadicalEquationsApplication122.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/RadicalsAndRationalExponents/RadicalFunctionApplication20.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations.def new file mode 100644 index 0000000000..922baf84da --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations.def @@ -0,0 +1,25 @@ +openDate = 12/01/2015 at 12:30am PST +dueDate = 03/01/2016 at 12:30am PST +answerDate = 03/01/2016 at 12:30am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations.pg +description = solve rational equations +problemList = +BasicAlgebra/RationalEquations/solveRationalEquations10.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations20.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations25.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations27.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations28.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations30.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations40.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations50.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations55.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations60.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations61.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations65.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations66.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/solveRationalEquations70.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRationalEquation10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorSolveRationalEquation20.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def new file mode 100644 index 0000000000..a93cb61e19 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH095/setSolve_Rational_Equations_Applications.def @@ -0,0 +1,22 @@ +openDate = 12/01/2015 at 12:31am PST +dueDate = 03/01/2016 at 12:31am PST +answerDate = 03/01/2016 at 12:31am PST +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH095/GenericMTH95HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH095/Solve_Rational_Equations_Applications.pg +description = solve rational equations +problemList = +BasicAlgebra/RationalEquations/rationalEquationApplication10.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication15.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication20.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication25.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication30.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication35.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication40.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication44.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication45.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication50.pg, 1, -1, 0 +BasicAlgebra/RationalEquations/rationalEquationApplication60.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/Calculator/CalculatorRationalFunctionApplication10.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setComposing_Functions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setComposing_Functions.def new file mode 100644 index 0000000000..fc17b4b96a --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setComposing_Functions.def @@ -0,0 +1,24 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/09/2014 at 10:03pm PDT +answerDate = 07/09/2014 at 10:03pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = composition of functions using formulas, tables, graphs, and verbal description +problemList = +CollegeAlgebra/FunctionComposition/FunctionComposition30.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition40.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition50.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition60.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition70.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition80.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition90.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition100.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition110.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition115.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition120.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition130.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition140.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition150.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition160.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition170.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setConcavity.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setConcavity.def new file mode 100644 index 0000000000..f0402d865c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setConcavity.def @@ -0,0 +1,12 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/30/2014 at 10:00pm PDT +answerDate = 07/30/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = concavity +problemList = +CollegeAlgebra/Concavity/ConcavityInContext10.pg, 1, -1, 0 +CollegeAlgebra/Concavity/ConcavityInContext20.pg, 1, -1, 0 +CollegeAlgebra/Concavity/ConcavityFromTable10.pg, 1, -1, 0 +CollegeAlgebra/Concavity/ConcavityFromGraph10.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setContinuous_Relative_Growth_Rate.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setContinuous_Relative_Growth_Rate.def new file mode 100644 index 0000000000..0494d15d98 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setContinuous_Relative_Growth_Rate.def @@ -0,0 +1,16 @@ +openDate = 06/23/2014 at 12:00am PDT +dueDate = 08/13/2014 at 10:01pm PDT +answerDate = 08/13/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = continuous relative growth rate +problemList = +CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates1.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/GrowthRates3.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/eForm1.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/ContPopulation.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/RadioDecay.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/HalvingTime.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/ContinuousDoublingTime.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDifference_Quotients.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDifference_Quotients.def new file mode 100644 index 0000000000..dd28727c21 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDifference_Quotients.def @@ -0,0 +1,15 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/09/2014 at 10:02pm PDT +answerDate = 07/09/2014 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = simplifying the difference quotient; some warm-up questions first +problemList = +CollegeAlgebra/FunctionComposition/FunctionComposition10.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/FunctionComposition20.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient10.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient20.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient40.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient50.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient60.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDomain_and_Range.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDomain_and_Range.def new file mode 100644 index 0000000000..13413b00fd --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setDomain_and_Range.def @@ -0,0 +1,31 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/02/2014 at 10:02pm PDT +answerDate = 07/02/2014 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = domain and range of a function +problemList = +BasicAlgebra/FunctionBasics/FunctionDefinition10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions90.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions170.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions200.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions210.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions225.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions235.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Domain10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Domain20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Domain30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionGraphs30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/graphs_of_functions_12.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Range20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Range30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Range40.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Range50.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/new_problem_337.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/new_problem_142.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setEulers_Constant_and_Natural_Log.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setEulers_Constant_and_Natural_Log.def new file mode 100644 index 0000000000..f2648884e9 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setEulers_Constant_and_Natural_Log.def @@ -0,0 +1,29 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 08/13/2014 at 10:00pm PDT +answerDate = 08/13/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = Euler's constant e; natural logarithm ln +problemList = +CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs3.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/MatchGraphs.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/CalculatorFreeLogs.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/ExponentsToLns.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/ExponentsToLogs2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/LnsToExponents2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/LnsToExponents.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Simplify2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Simplify3.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Simplify.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/SolveUsingLogs7.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/SolveUsingLogs8.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/MatchLogGraphs.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Solve.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/bForm1.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/bForm2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/bForm3.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Domain2.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Domain3.pg, 1, -1, 0 +CollegeAlgebra/EulersConstantAndNaturalLog/Domain.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setExponential_Function_Basics.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setExponential_Function_Basics.def new file mode 100644 index 0000000000..a243d199fe --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setExponential_Function_Basics.def @@ -0,0 +1,32 @@ +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/30/2014 at 10:02pm PDT +answerDate = 07/30/2014 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = exponential functions basics; relative growth rate; growth factor; find a formula given two points +problemList = +CollegeAlgebra/ExponentialFunctions/ExponentialBasics10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/ExponentialBasics20.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/CalculatorExponential10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/Modeling10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/Modeling20.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/Modeling30.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/AverageRateOfChange10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/GrowthFactor2.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/GrowthFactor.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints100.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/CompareGraphs2.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/CompareGraphs3.pg, 1, -1, 0 +Library/NAU/setExpLog/ExpEq2.pg, 1, -1, 0 +Library/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/1_Precalculus_Review/1.6_Exponential_and_Logarithmic_Functions/1.6.7.pg, 1, -1, 0 +Library/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/1_Precalculus_Review/1.6_Exponential_and_Logarithmic_Functions/1.6.31.pg, 1, -1, 0 +Library/NAU/setExpLog/ExpEq4.pg, 1, -1, 0 +Library/NAU/setExpLog/ExpEq1.pg, 1, -1, 0 +Library/ASU-topics/setLogarithmicFunctions/jj7.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/ExponentialTable.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/FitCurveToTwoPoints20.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/FindExponentialFromGraph.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/LinearTable.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/LinearVsExponential.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/FindRate2.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Arithmetic.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Arithmetic.def new file mode 100644 index 0000000000..00d2495df6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Arithmetic.def @@ -0,0 +1,13 @@ +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/09/2014 at 10:00pm PDT +answerDate = 07/09/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = adding, subtracting, multiplying, and dividing functions; the domain of the result +problemList = +CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains10.pg, 1, -1, 0 +CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains20.pg, 1, -1, 0 +CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains30.pg, 1, -1, 0 +CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains40.pg, 1, -1, 0 +Library/CollegeOfIdaho/setAlgebra_03_02_ProblemSolvingBusinessApp/32IntAlg_15_Functions_Review.pg, 1, -1, 0 +Library/UVA-Stew5e/setUVA-Stew5e-C01S03-NewFunctOld/1-3-31.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Basics.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Basics.def new file mode 100644 index 0000000000..a9a8c1e12d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Basics.def @@ -0,0 +1,33 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/02/2014 at 10:00pm PDT +answerDate = 07/02/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = function basics; evaluation +problemList = +CollegeAlgebra/FunctionBasics/FunctionVocabulary10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionRelations10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionRelations20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions160.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionApplication10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions150.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction60.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction80.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction120.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction130.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/EvaluateFunction140.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateFunction23.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve40.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve50.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/EvaluateAndSolve60.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Solve20.pg, 1, -1, 0 +CollegeAlgebra/FunctionComposition/DifferenceQuotient30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/SolveInequality20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/SolveInequality30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Solve60.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/PositionVelocity10.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Transformations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Transformations.def new file mode 100644 index 0000000000..540ffd8961 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setFunction_Transformations.def @@ -0,0 +1,30 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/16/2014 at 10:00pm PDT +answerDate = 07/16/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = function transformations, including shifts, reflections, and scaling; graphical, tabular, formulaic, and verbal examples +problemList = +CollegeAlgebra/Transformations/Shifting10.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Shifting20.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Shifting30.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Shifting40.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Shifting50.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Shifting60.pg, 1, -1, 0 +CollegeAlgebra/Transformations/ScalingAndReflecting10.pg, 1, -1, 0 +CollegeAlgebra/Transformations/GeneralTransformations10.pg, 1, -1, 0 +CollegeAlgebra/Transformations/ScalingAndReflecting20.pg, 1, -1, 0 +CollegeAlgebra/Transformations/ScalingAndReflecting30.pg, 1, -1, 0 +CollegeAlgebra/Transformations/MatchGraphsReflected.pg, 1, -1, 0 +CollegeAlgebra/Transformations/GeneralTransformations20.pg, 1, -1, 0 +CollegeAlgebra/Transformations/GeneralTransformations30.pg, 1, -1, 0 +CollegeAlgebra/Transformations/GeneralTransformations40.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Symmetry10.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Symmetry1.pg, 1, -1, 0 +CollegeAlgebra/Transformations/MatchGraphs2.pg, 1, -1, 0 +CollegeAlgebra/Transformations/General1.pg, 1, -1, 0 +CollegeAlgebra/Transformations/General3.pg, 1, -1, 0 +CollegeAlgebra/Transformations/ChooseGraph2.pg, 1, -1, 0 +CollegeAlgebra/Transformations/MatchGraphs1.pg, 1, -1, 0 +CollegeAlgebra/Transformations/Painting.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInterest.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInterest.def new file mode 100644 index 0000000000..d81bb57576 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInterest.def @@ -0,0 +1,18 @@ +openDate = 06/23/2014 at 12:00am PDT +dueDate = 08/13/2014 at 10:02pm PDT +answerDate = 08/13/2014 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = interest compounded periodically and continuously +problemList = +CollegeAlgebra/Interest/NominalForm.pg, 1, -1, 0 +CollegeAlgebra/Interest/InterestChoice.pg, 1, -1, 0 +CollegeAlgebra/Interest/FindRate.pg, 1, -1, 0 +CollegeAlgebra/Interest/EffectiveRate.pg, 1, -1, 0 +CollegeAlgebra/Interest/ContVersusAnnual.pg, 1, -1, 0 +CollegeAlgebra/Interest/ContInterest.pg, 1, -1, 0 +CollegeAlgebra/Interest/Compounding.pg, 1, -1, 0 +CollegeAlgebra/Interest/Compounding2.pg, 1, -1, 0 +CollegeAlgebra/Interest/NominalForm.pg, 1, -1, 0 +CollegeAlgebra/Interest/Nominal.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInverses_of_Functions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInverses_of_Functions.def new file mode 100644 index 0000000000..2513cde748 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setInverses_of_Functions.def @@ -0,0 +1,31 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/23/2014 at 10:01pm PDT +answerDate = 07/23/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = inverses of functions +problemList = +CollegeAlgebra/FunctionComposition/FunctionComposition180.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions10.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions20.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/OneToOne10.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions30.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions40.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions50.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions60.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions70.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions80.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions90.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions100.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions110.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions120.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions130.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions140.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions150.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions160.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions170.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions180.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/OneToOne20.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions190.pg, 1, -1, 0 +CollegeAlgebra/InversesOfFunctions/InversesOfFunctions200.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setLogarithms.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setLogarithms.def new file mode 100644 index 0000000000..e13ea2d642 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setLogarithms.def @@ -0,0 +1,22 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 08/06/2014 at 10:00pm PDT +answerDate = 08/06/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = logarithms; +problemList = +CollegeAlgebra/Logarithms/TrueFalse.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/ExponentsToLogs.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/LogsToExponents.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs2.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs3.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs4.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs5.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs6.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/SolveUsingLogs.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/Solve2.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/DrugInBody.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/Iodine.pg, 1, -1, 0 +CollegeAlgebra/Logarithms/DoublingTime.pg, 1, -1, 0 + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPercentage_Review.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPercentage_Review.def new file mode 100644 index 0000000000..fcfcc01c4a --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPercentage_Review.def @@ -0,0 +1,11 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/30/2014 at 10:01pm PDT +answerDate = 07/30/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = review of percentages +problemList = +CollegeAlgebra/ExponentialFunctions/Percentage10.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/Percentage20.pg, 1, -1, 0 +CollegeAlgebra/ExponentialFunctions/RelativeGrowthRate10.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPiecewise_Defined_Functions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPiecewise_Defined_Functions.def new file mode 100644 index 0000000000..148c945f23 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPiecewise_Defined_Functions.def @@ -0,0 +1,17 @@ +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/09/2014 at 10:01pm PDT +answerDate = 07/09/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = piecewise-defined functions +problemList = +CollegeAlgebra/FunctionBasics/Piecewise10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Piecewise20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Piecewise30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/Piecewise40.pg, 1, -1, 0 +Library/LoyolaChicago/Precalc/Chap2Sec3/Q04.pg, 1, -1, 0 +Library/Rochester/setAlgebra15Functions/ur_fn_1_6.pg, 1, -1, 0 +Library/Rochester/setAlgebra16FunctionGraphs/ns1_1_45.pg, 1, -1, 0 +Library/UVA-Stew5e/setUVA-Stew5e-C01S03-NewFunctOld/1-3-31.pg, 1, -1, 0 + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPolynomial_Functions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPolynomial_Functions.def new file mode 100644 index 0000000000..20c0cce9e1 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setPolynomial_Functions.def @@ -0,0 +1,30 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/16/2014 at 10:01pm PDT +answerDate = 07/16/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = graphs ond other features of polynomial functions +problemList = +CollegeAlgebra/PolynomialFunctions/Polynomials1.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials6.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials9.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials12.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials13.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials14.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials15.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials16.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials19.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials20.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials21.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials22.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials23.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials24.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials25.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials26.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials27.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials28.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_49.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Sullivan2ed3_1_97.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials29.pg, 1, -1, 0 +CollegeAlgebra/PolynomialFunctions/Polynomials30.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setRational_Functions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setRational_Functions.def new file mode 100644 index 0000000000..aa99e18ce6 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setRational_Functions.def @@ -0,0 +1,23 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/23/2014 at 10:00pm PDT +answerDate = 07/23/2014 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = graphs and other features of rational functions +problemList = +CollegeAlgebra/RationalFunctions/Asymptotes10.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Asymptotes20.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Asymptotes30.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Asymptotes40.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Asymptotes50.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Asymptotes60.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Limits10.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Limits20.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Limits30.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas10.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas20.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas30.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas40.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas50.pg, 1, -1, 0 +CollegeAlgebra/RationalFunctions/Formulas60.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.1.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.1.def new file mode 100644 index 0000000000..d7d646d3fc --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.1.def @@ -0,0 +1,373 @@ +assignmentType = default +openDate = 01/04/2016 at 12:00am PST +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 01/13/2016 at 11:59pm PST +answerDate = 01/14/2016 at 11:59pm PST +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = problems like those in Sullivan and Sullivan's 3rd edition Precalculus, section 1.1 +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +problem_id = 1 +source_file = CollegeAlgebra/FunctionBasics/FunctionVocabulary10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains02.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains50.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = BasicAlgebra/FunctionBasics/FunctionDefinition10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = CollegeAlgebra/FunctionBasics/FunctionRelations10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = CollegeAlgebra/FunctionBasics/FunctionRelations20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = CollegeAlgebra/FunctionBasics/EvaluateFunction23.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction60.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction80.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction120.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction130.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = BasicAlgebra/FunctionBasics/EvaluateFunction140.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = CollegeAlgebra/FunctionComposition/FunctionComposition10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient60.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient50.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = CollegeAlgebra/FunctionComposition/DifferenceQuotient30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 21 +source_file = BasicAlgebra/FunctionBasics/Functions90.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 22 +source_file = BasicAlgebra/FunctionBasics/Functions170.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 23 +source_file = BasicAlgebra/FunctionBasics/Functions200.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 24 +source_file = BasicAlgebra/FunctionBasics/Functions210.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 25 +source_file = CollegeAlgebra/FunctionBasics/Domain10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 26 +source_file = CollegeAlgebra/FunctionBasics/Domain20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 27 +source_file = BasicAlgebra/FunctionBasics/Functions225.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 28 +source_file = BasicAlgebra/FunctionBasics/Functions235.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 29 +source_file = CollegeAlgebra/FunctionBasics/Domain30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 30 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 31 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 32 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 33 +source_file = CollegeAlgebra/FunctionArithmetic/FunctionArithmeticDomains40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 34 +source_file = CollegeAlgebra/FunctionBasics/PositionVelocity10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 35 +source_file = CollegeAlgebra/FunctionBasics/Solve60.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 36 +source_file = BasicAlgebra/FunctionBasics/Functions160.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 37 +source_file = BasicAlgebra/FunctionBasics/Functions150.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 38 +source_file = Library/LoyolaChicago/Precalc/Chap1Sec1/Q19.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 39 +source_file = Library/LoyolaChicago/Precalc/Chap1Review/Q34.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 40 +source_file = Library/FortLewis/Algebra/8-1-Domain-range/MCH1-8-1-14-Domain-range.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.2.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.2.def new file mode 100644 index 0000000000..35d1bea836 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.2.def @@ -0,0 +1,239 @@ +assignmentType = default +openDate = 01/04/2016 at 12:00am PST +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 01/20/2016 at 10:00pm PST +answerDate = 01/20/2016 at 10:00pm PST +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111Header.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = problems like those in Sullivan and Sullivan's 3rd edition Precalculus, section 1.2 +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +problem_id = 1 +source_file = BasicAlgebra/FunctionBasics/Functions100.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = BasicAlgebra/FunctionBasics/Functions110.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = BasicAlgebra/FunctionBasics/Functions120.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = Library/CollegeOfIdaho/setAlgebra_05_03_FactoringByGrouping/53IntAlg_32_Functions_Review.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = CollegeAlgebra/FunctionBasics/FunctionGraphs10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = CollegeAlgebra/FunctionBasics/FunctionGraphs30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = CollegeAlgebra/FunctionBasics/graphs_of_functions_12.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = CollegeAlgebra/FunctionBasics/FunctionGraphs20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = CollegeAlgebra/FunctionBasics/FunctionTables30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = CollegeAlgebra/FunctionBasics/VariousQuestions10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 21 +source_file = CollegeAlgebra/FunctionBasics/FunctionTables10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 22 +source_file = CollegeAlgebra/FunctionBasics/FunctionTables20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 23 +source_file = Library/LoyolaChicago/Precalc/Chap1Review/Q37.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 1 +problem_end +problem_start +problem_id = 24 +source_file = Library/Rochester/setAlgebra16FunctionGraphs/c0s1p4/c0s1p4.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 1 +problem_end +problem_start +problem_id = 25 +source_file = Library/CollegeOfIdaho/setAlgebra_02_01_IntroFunctions/21IntAlg_14_function.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 1 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.3.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.3.def new file mode 100644 index 0000000000..d6b69a986e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.3.def @@ -0,0 +1,285 @@ +assignmentType = default +openDate = 01/04/2016 at 12:00am PST +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 01/20/2016 at 10:00pm PST +answerDate = 01/20/2016 at 10:00pm PST +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111Header.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = problems like those in Sullivan and Sullivan's 3rd edition Precalculus, section 1.3 +restrictProbProgression = 0 +emailInstructor = 0 + + +problemListV2 +problem_start +problem_id = 1 +source_file = CollegeAlgebra/FunctionBasics/FunctionVocabulary20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = CollegeAlgebra/FunctionBasics/new_problem_142.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = CollegeAlgebra/FunctionBasics/new_problem_337.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = Library/Mizzou/Algebra/functions_increasing_decreasing/find_all_info_02.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = Library/Mizzou/College_Algebra/Functions_Increasing_Decreasing/Inc_Dec_Const_Dom_Range_01.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = Library/FortLewis/Algebra/8-1-Domain-range/MCH1-8-1-17-Domain-range.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph50.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph60.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = BasicAlgebra/FunctionBasics/FunctionDomainRangeByGraph70.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = BasicAlgebra/FunctionBasics/FunctionValuesByGraph50.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = Library/ASU-topics/setGraphingCalculator/garcia1.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = Library/ASU-topics/setGraphingCalculator/garcia3.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = Library/ASU-topics/setGraphingCalculator/garcia7.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = CollegeAlgebra/FunctionBasics/DomainRange10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = CollegeAlgebra/FunctionBasics/Range30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = CollegeAlgebra/FunctionBasics/Range40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = CollegeAlgebra/FunctionBasics/VariousQuestions10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = Library/ASU-topics/setFirstDerivative/4-2-61.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = Library/ASU-topics/setFirstDerivative/4-2-65.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = Library/ASU-topics/setFirstDerivative/4-2-63.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 21 +source_file = Library/Mizzou/College_Algebra/Functions_Even_Odd_Symmetry/Graph_Even_Odd_Neither.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 22 +source_file = Library/maCalcDB/setAlgebra15Functions/srw2_2_55.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 23 +source_file = Library/maCalcDB/setAlgebra15Functions/srw2_2_53.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 24 +source_file = Library/LoyolaChicago/Precalc/Chap9Sec4/Q14a.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 25 +source_file = Library/ma117DB/set2/srw1_8_63.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 26 +source_file = Library/LoyolaChicago/Precalc/Chap5Sec2/Q03.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 27 +source_file = CollegeAlgebra/Transformations/Symmetry10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 28 +source_file = Library/LoyolaChicago/Precalc/Chap5Sec2/Q30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 29 +source_file = Library/Utah/AP_Calculus_I/set1_Reviews_of_Fundamentals/1210s2p5.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 30 +source_file = Library/LoyolaChicago/Precalc/Chap1Review/Q37.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.4.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.4.def new file mode 100644 index 0000000000..4cbe843160 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.4.def @@ -0,0 +1,194 @@ +assignmentType = default +openDate = 01/04/2016 at 12:00am PST +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 02/02/2016 at 10:00pm PST +answerDate = 02/02/2016 at 10:00pm PST +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111Header.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = problems like those in Sullivan and Sullivan's 3rd edition Precalculus, section 1.4 +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +problem_id = 1 +source_file = CollegeAlgebra/FunctionBasics/FunctionGraphs05.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = Library/Mizzou/Algebra/functions_piecewise/evaluate_at_a_point_01.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = Library/Rochester/setAlgebra15Functions/lh2-2_36.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = Library/Utah/Business_Algebra/set4_Quadratic_and_Other_Special_Functions/p02.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = CollegeAlgebra/FunctionBasics/Piecewise10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = Library/LoyolaChicago/Precalc/Chap2Sec3/Connally3-2-3-05-Piecewise-functions.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = Library/LoyolaChicago/Precalc/Chap2Sec3/Q06.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = CollegeAlgebra/FunctionBasics/Piecewise20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = CollegeAlgebra/FunctionBasics/Piecewise30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = Library/LoyolaChicago/Precalc/Chap2Sec3/Connally3-2-3-02-Piecewise-functions.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = Library/LoyolaChicago/Precalc/Chap2Sec3/Q01.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = Library/Mizzou/College_Algebra/Functions_Piecewise/MC_Three_Lines_Const_Left.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = Library/LoyolaChicago/Precalc/Chap2Sec3/Q04.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = Library/Mizzou/Algebra/functions_piecewise/determine_formula_from_graph_01.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = Library/Mizzou/Algebra/functions_piecewise/determine_formula_from_graph_02.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = Library/Mizzou/Algebra/functions_piecewise/app_03.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = Library/Mizzou/Algebra/functions_piecewise/app_02.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = Library/Mizzou/Algebra/functions_piecewise/app_01.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = CollegeAlgebra/Transformations/Symmetry10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = CollegeAlgebra/Transformations/Symmetry1.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.5.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.5.def new file mode 100644 index 0000000000..aa03f6c3a2 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setSullivan_3rd_Section_1.5.def @@ -0,0 +1,194 @@ +assignmentType = default +openDate = 01/04/2016 at 12:00am PST +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 02/09/2016 at 10:00pm PST +answerDate = 02/09/2016 at 10:00pm PST +enableReducedScoring = N +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = problems like those in Sullivan and Sullivan's 3rd edition Precalculus, section 1.5 +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +problem_id = 1 +source_file = CollegeAlgebra/Transformations/Shifting10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = CollegeAlgebra/Transformations/Shifting20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = CollegeAlgebra/Transformations/Shifting30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = CollegeAlgebra/Transformations/Shifting40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = CollegeAlgebra/Transformations/Shifting50.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = CollegeAlgebra/Transformations/Shifting60.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = CollegeAlgebra/Transformations/ScalingAndReflecting10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = CollegeAlgebra/Transformations/GeneralTransformations10.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = CollegeAlgebra/Transformations/ScalingAndReflecting20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = CollegeAlgebra/Transformations/ScalingAndReflecting30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = CollegeAlgebra/Transformations/MatchGraphsReflected.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = CollegeAlgebra/Transformations/GeneralTransformations20.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = CollegeAlgebra/Transformations/GeneralTransformations30.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = CollegeAlgebra/Transformations/GeneralTransformations40.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = CollegeAlgebra/Transformations/MatchGraphs2.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = CollegeAlgebra/Transformations/General1.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = CollegeAlgebra/Transformations/General3.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = CollegeAlgebra/Transformations/ChooseGraph2.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = CollegeAlgebra/Transformations/MatchGraphs1.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = CollegeAlgebra/Transformations/Painting.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setTables_and_Graphs.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setTables_and_Graphs.def new file mode 100644 index 0000000000..23138c6dca --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH111/setTables_and_Graphs.def @@ -0,0 +1,21 @@ + +openDate = 06/23/2014 at 12:00am PDT +dueDate = 07/02/2014 at 10:01pm PDT +answerDate = 07/02/2014 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH111/GenericMTH111HardcopyHeader.pg +paperHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH111/GenericMTH111Header.pg +description = tables; graphs +problemList = +CollegeAlgebra/FunctionBasics/FunctionTables30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionOrNotByGraph30.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionGraphs10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph10.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph20.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/FunctionValuesByGraph30.pg, 1, -1, 0 +BasicAlgebra/FunctionBasics/Functions100.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionTables10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionTables20.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/VariousQuestions10.pg, 1, -1, 0 +CollegeAlgebra/FunctionBasics/FunctionGraphs20.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasic_Probability.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasic_Probability.def new file mode 100644 index 0000000000..3397fa3bf8 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasic_Probability.def @@ -0,0 +1,21 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/26/2015 at 10:02pm PDT +answerDate = 04/26/2015 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = basic probability calculations +problemList = +Statistics/BasicProbability/dueck5_1_2.pg, 1, -1, 0 +Statistics/BasicProbability/dueck5_1_5.pg, 1, -1, 0 +Statistics/BasicProbability/kolossa5.pg, 1, -1, 0 +Statistics/BasicProbability/10Stats_01_Probability.pg, 1, -1, 0 +Statistics/BasicProbability/10Stats_02_Probability.pg, 1, -1, 0 +Statistics/BasicProbability/10Stats_04_Probability.pg, 1, -1, 0 +Statistics/BasicProbability/10Stats_12_Probability.pg, 1, -1, 0 +Statistics/BasicProbability/ur_dis_9_17.pg, 1, -1, 0 +Statistics/BasicProbability/ur_dis_9_19.pg, 1, -1, 0 +Statistics/BasicProbability/ur_pb_5_2.pg, 1, -1, 0 +Statistics/BasicProbability/stat212-HW03-17.pg, 1, -1, 0 +Statistics/BasicProbability/stat212-HW03-20.pg, 1, -1, 0 +Statistics/BasicProbability/stat212-HW04-03.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasics_of_Data.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasics_of_Data.def new file mode 100644 index 0000000000..fa3d7cab39 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBasics_of_Data.def @@ -0,0 +1,16 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/08/2015 at 10:00pm PDT +answerDate = 04/08/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = types of data +problemList = +Statistics/TypesOfData/DataTypes1.pg, 1, -1, 0 +Statistics/TypesOfData/DataTypes2.pg, 1, -1, 0 +Statistics/TypesOfData/DataTypes3.pg, 1, -1, 0 +Statistics/TypesOfData/DataTypes4.pg, 1, -1, 0 +Statistics/TypesOfData/DataTypes6.pg, 1, -1, 0 +Statistics/TypesOfData/01Stats_04_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/TypesOfData/stat212-HW01-02.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_02_PictDistnsWGraphs.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBinomial_Distribution.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBinomial_Distribution.def new file mode 100644 index 0000000000..2fe6394e9e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setBinomial_Distribution.def @@ -0,0 +1,22 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/13/2015 at 10:00pm PDT +answerDate = 05/13/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = exponential distribution; geometric distribution; binomial distribution; Normal approximation of the binomial distribution; continuity correction +problemList = +Statistics/BinomialDistribution/ur_pb_8_1.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_8_5.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_8_4.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_12_4.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_8_8.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_8_3.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_8_6.pg, 1, -1, 0 +Statistics/BinomialDistribution/stat212-HW07-16.pg, 1, -1, 0 +Statistics/BinomialDistribution/stat212-HW07-15.pg, 1, -1, 0 +Statistics/BinomialDistribution/stat212-HW07-14.pg, 1, -1, 0 +Statistics/BinomialDistribution/stat212-HW07-13.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_12_3.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_12_2.pg, 1, -1, 0 +Statistics/BinomialDistribution/ur_pb_12_1.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setConditional_Probability.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setConditional_Probability.def new file mode 100644 index 0000000000..aabdb4f3a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setConditional_Probability.def @@ -0,0 +1,30 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/03/2015 at 10:02pm PDT +answerDate = 05/03/2015 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = conditional probability; problems where a tree diagram may help +problemList = +Statistics/ProbabilityRulesAndTools/spinner1.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_3_12.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW04-11.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW04-10.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW04-09.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW04-04.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-12.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-11.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-07.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_4_8.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_4_5.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_4_1.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/comprob10.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/Bayes7.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/Bayes3.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/Bayes2.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/Bayes1.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_4_2.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-13.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-15.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW03-14.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/stat212-HW04-20.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDisplaying_Data.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDisplaying_Data.def new file mode 100644 index 0000000000..ff67863148 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDisplaying_Data.def @@ -0,0 +1,31 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/08/2015 at 10:02pm PDT +answerDate = 04/08/2015 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = graphical displays; tabular displays +problemList = +Statistics/DisplayingData/gust11.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_10_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_11_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/ur_stt_1_5.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_06_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_07_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_08_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_09_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/stat212-HW02-01.pg, 1, -1, 0 +Statistics/DisplayingData/02Stats_01_DescrData.pg, 1, -1, 0 +Statistics/DisplayingData/stat212-HW01-18.pg, 1, -1, 0 +Statistics/DisplayingData/stat212-HW01-17.pg, 1, -1, 0 +Statistics/DisplayingData/histogram1.pg, 1, -1, 0 +Statistics/DisplayingData/easy_histogram.pg, 1, -1, 0 +Statistics/BasicOneVarStats/CenterMeasureFromStemAndLeaf.pg, 1, -1, 0 +Statistics/DisplayingData/gust30.pg, 1, -1, 0 +Statistics/DisplayingData/BoxPlotPercentBetween.pg, 1, -1, 0 +Statistics/DisplayingData/Boxplot.pg, 1, -1, 0 +Statistics/DisplayingData/FiveNumAndPlot.pg, 1, -1, 0 +Statistics/DisplayingData/FiveNumFromPlot.pg, 1, -1, 0 +Statistics/DisplayingData/01Stats_05_PictDistnsWGraphs.pg, 1, -1, 0 +Statistics/DisplayingData/02Stats_08_DescrData.pg, 1, -1, 0 +Statistics/DisplayingData/02Stats_07_DescrData.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDistribution_of_Sample_Mean.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDistribution_of_Sample_Mean.def new file mode 100644 index 0000000000..61403272c1 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setDistribution_of_Sample_Mean.def @@ -0,0 +1,23 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/20/2015 at 10:00pm PDT +answerDate = 05/20/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = distribution of the sample mean +problemList = +Statistics/CentralLimitTheorem/ur_pb_11_1.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/di1.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/di2.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/di3.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/di4.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/dueck7_3_4.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_07_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_10_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_13_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/ur_pb_11_5.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/ur_pb_11_6.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-06.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-08.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-09.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-12.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setEmpirical_Rule.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setEmpirical_Rule.def new file mode 100644 index 0000000000..d8467c22f9 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setEmpirical_Rule.def @@ -0,0 +1,12 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/15/2015 at 10:02pm PDT +answerDate = 04/15/2015 at 10:02pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = using the Empirical Rule to calculate probabilities and other values +problemList = +Statistics/zScoreEmpiricalRule/03Stats_04_NormalDist.pg, 1, -1, 0 +Statistics/DisplayingData/stat212-HW02-03.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/empirical_rule1.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/empirical_rule2.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExpected_Value_and_Variance.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExpected_Value_and_Variance.def new file mode 100644 index 0000000000..46cf390525 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExpected_Value_and_Variance.def @@ -0,0 +1,18 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/06/2015 at 10:00pm PDT +answerDate = 05/06/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = expected value and variance of discrete random variables +problemList = +Statistics/ExpectedValueAndVariance/stat212-HW05-05.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/stat212-HW05-06.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/stat212-HW05-08.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/ur_pb_7_9a.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/ur_pb_7_6.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/ur_pb_7_5.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/exval3.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/expectedvalue1.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/ExpectedValue.pg, 1, -1, 0 +Statistics/ExpectedValueAndVariance/stat212-HW05-12.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExperimental_Design.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExperimental_Design.def new file mode 100644 index 0000000000..61e4f3cc04 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setExperimental_Design.def @@ -0,0 +1,25 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/26/2015 at 10:01pm PDT +answerDate = 04/26/2015 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = experiments and observational studies; factors, levels, and treatments +problemList = +Statistics/ExperimentalDesign/dueck1_5_1.pg, 1, -1, 0 +Statistics/ExperimentalDesign/dueck1_5_2.pg, 1, -1, 0 +Statistics/ExperimentalDesign/dueck1_5_3.pg, 1, -1, 0 +Statistics/ExperimentalDesign/dueck1_5_4.pg, 1, -1, 0 +Statistics/ExperimentalDesign/dueck1_5_5.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_09_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_08_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_07_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_06_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_05_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_04_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_03_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_02_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/09Stats_01_Experiments.pg, 1, -1, 0 +Statistics/ExperimentalDesign/stat_inference4.pg, 1, -1, 0 +Statistics/ExperimentalDesign/stat_inference1.pg, 1, -1, 0 +Statistics/ExperimentalDesign/kolossa59.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setGeneral_Probability.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setGeneral_Probability.def new file mode 100644 index 0000000000..846f543806 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setGeneral_Probability.def @@ -0,0 +1,19 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/03/2015 at 10:00pm PDT +answerDate = 05/03/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = probability calculations; probability formulas; independent events +problemList = +Statistics/ProbabilityRulesAndTools/ur_pb_3_11.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/10Stats_05_Probability.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/10Stats_03_Probability.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/dueck5_2_4.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/10Stats_09_Probability.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/p1.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/dueck5_3_5.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/dueck5_3_6.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/kolossa7.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_4_9.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/kolossa27.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Area_for_Arbitrary_z.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Area_for_Arbitrary_z.def new file mode 100644 index 0000000000..84723c4a16 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Area_for_Arbitrary_z.def @@ -0,0 +1,25 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/15/2015 at 10:03pm PDT +answerDate = 04/15/2015 at 10:03pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = calculating with the Normal distribution when the Empirical Rule does not necessarily apply +problemList = +Statistics/zScoresInGeneral/normprob1.pg, 1, -1, 0 +Statistics/zScoresInGeneral/normal_dist3.pg, 1, -1, 0 +Statistics/zScoresInGeneral/normal_dist2.pg, 1, -1, 0 +Statistics/zScoresInGeneral/empirical_rule5.pg, 1, -1, 0 +Statistics/zScoresInGeneral/gust41.pg, 1, -1, 0 +Statistics/zScoresInGeneral/gust37.pg, 1, -1, 0 +Statistics/zScoresInGeneral/dueck6_3_3.pg, 1, -1, 0 +Statistics/zScoresInGeneral/dueck6_3_1.pg, 1, -1, 0 +Statistics/zScoresInGeneral/03Stats_11_NormalDist.pg, 1, -1, 0 +Statistics/zScoresInGeneral/03Stats_10_NormalDist.pg, 1, -1, 0 +Statistics/zScoresInGeneral/03Stats_09_NormalDist.pg, 1, -1, 0 +Statistics/zScoresInGeneral/03Stats_12_NormalDist.pg, 1, -1, 0 +Statistics/zScoresInGeneral/dueck6_2_5.pg, 1, -1, 0 +Statistics/zScoresInGeneral/empirical_rule3.pg, 1, -1, 0 +Statistics/zScoresInGeneral/normal_quartile1.pg, 1, -1, 0 +Statistics/zScoresInGeneral/normprob2.pg, 1, -1, 0 +Statistics/zScoresInGeneral/normprob3.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Distributions.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Distributions.def new file mode 100644 index 0000000000..42dc527bac --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setNormal_Distributions.def @@ -0,0 +1,15 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/15/2015 at 10:01pm PDT +answerDate = 04/15/2015 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = some facts about a Normal distribution +problemList = +Statistics/zScoreEmpiricalRule/gust36.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/gust34.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/gust33.pg, 1, -1, 0 +Statistics/zScoresInGeneral/gust40.pg, 1, -1, 0 +Statistics/zScoresInGeneral/03Stats_02_NormalDist.pg, 1, -1, 0 +Statistics/zScoresInGeneral/gust39.pg, 1, -1, 0 +Statistics/zScoresInGeneral/gust38.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setOne_Variable_Calculations.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setOne_Variable_Calculations.def new file mode 100644 index 0000000000..7495987eee --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setOne_Variable_Calculations.def @@ -0,0 +1,27 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/08/2015 at 10:01pm PDT +answerDate = 04/08/2015 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = mean, median, mode; range, quartiles, inter-quartile range, standard deviation +problemList = +Statistics/BasicOneVarStats/stat212-HW02-17.pg, 1, -1, 0 +Statistics/BasicOneVarStats/dueck3_1_6.pg, 1, -1, 0 +Statistics/BasicOneVarStats/stat212-HW02-11.pg, 1, -1, 0 +Statistics/BasicOneVarStats/stat212-HW02-10.pg, 1, -1, 0 +Statistics/BasicOneVarStats/stat212-HW02-08.pg, 1, -1, 0 +Statistics/BasicOneVarStats/stat212-HW02-05.pg, 1, -1, 0 +Statistics/BasicOneVarStats/02Stats_02_DescrData.pg, 1, -1, 0 +Statistics/BasicOneVarStats/02Stats_05_DescrData.pg, 1, -1, 0 +Statistics/DisplayingData/02Stats_10_DescrData.pg, 1, -1, 0 +Statistics/DisplayingData/skew_dist1.pg, 1, -1, 0 +Statistics/DisplayingData/03Stats_01_NormalDist.pg, 1, -1, 0 +Statistics/BasicOneVarStats/data2.pg, 1, -1, 0 +Statistics/BasicOneVarStats/MeanStdDev.pg, 1, -1, 0 +Statistics/BasicOneVarStats/FiveNum.pg, 1, -1, 0 +Statistics/BasicOneVarStats/kolossa10.pg, 1, -1, 0 +Statistics/BasicOneVarStats/kolossa8.pg, 1, -1, 0 +Statistics/BasicOneVarStats/dueck3_4_3.pg, 1, -1, 0 +Statistics/BasicOneVarStats/dueck3_2_1.pg, 1, -1, 0 +Statistics/BasicOneVarStats/dueck3_4_4.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setProportion_and_Confidence_Intervals.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setProportion_and_Confidence_Intervals.def new file mode 100644 index 0000000000..23f866c778 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setProportion_and_Confidence_Intervals.def @@ -0,0 +1,27 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/27/2015 at 10:00pm PDT +answerDate = 05/27/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = confidence intervals for population proportion +problemList = +Statistics/BasicOneVarStats/19Stats_01_InferencePropn.pg, 1, -1, 0 +Statistics/BasicOneVarStats/kolossa48.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/central_limit_theorem1.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/central_limit_theorem2.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_14.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/gust50.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/gust51.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_13.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/gust52.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/kolossa49.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/kolossa50.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/kolossa51.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/kolossa55.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/19Stats_04_InferencePropn.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/19Stats_07_InferencePropn.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/19Stats_08_InferencePropn.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_15.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_18.pg, 1, -1, 0 +Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_19.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_Issues.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_Issues.def new file mode 100644 index 0000000000..7a3d29a4c3 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_Issues.def @@ -0,0 +1,25 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/26/2015 at 10:00pm PDT +answerDate = 04/26/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = surveys; population versus sample; sampling methods; sources of bias; parameters versus statistics +problemList = +Statistics/SamplingIssues/08Stats_08_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_07_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_06_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_05_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_03_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_02_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/08Stats_01_Sampling.pg, 1, -1, 0 +Statistics/SamplingIssues/stat212-HW03-02.pg, 1, -1, 0 +Statistics/SamplingIssues/stat212-HW03-01.pg, 1, -1, 0 +Statistics/SamplingIssues/stat_inference2.pg, 1, -1, 0 +Statistics/BasicOneVarStats/kolossa19.pg, 1, -1, 0 +Statistics/SamplingIssues/gust25.pg, 1, -1, 0 +Statistics/SamplingIssues/gust9.pg, 1, -1, 0 +Statistics/SamplingIssues/dueck1_4_1.pg, 1, -1, 0 +Statistics/SamplingIssues/dueck1_4_2.pg, 1, -1, 0 +Statistics/SamplingIssues/dueck1_4_3.pg, 1, -1, 0 +Statistics/SamplingIssues/dueck1_4_5.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_and_Central_Limit_Theorem.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_and_Central_Limit_Theorem.def new file mode 100644 index 0000000000..be0d86254a --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSampling_and_Central_Limit_Theorem.def @@ -0,0 +1,19 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/20/2015 at 10:01pm PDT +answerDate = 05/20/2015 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = parameters versus statistics; the Central Limit Theorem +problemList = +Statistics/BasicOneVarStats/kolossa47.pg, 1, -1, 0 +Statistics/BasicOneVarStats/11Stats_01_SamplingDistns.pg, 1, -1, 0 +Statistics/BasicOneVarStats/11Stats_02_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_03_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_05_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_06_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/11Stats_08_SamplingDistns.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/ur_pb_11_4.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-03.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-04.pg, 1, -1, 0 +Statistics/CentralLimitTheorem/stat212-HW07-05.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setScatterplots_and_Linear_Regression.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setScatterplots_and_Linear_Regression.def new file mode 100644 index 0000000000..590b6a6acc --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setScatterplots_and_Linear_Regression.def @@ -0,0 +1,33 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 06/10/2015 at 10:00pm PDT +answerDate = 06/10/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = scatter plots; correlation; least-squares regression lines +problemList = +Statistics/ScatterplotsAndCorrelation/gust24.pg, 1, -1, 0 +Statistics/ScatterplotsAndCorrelation/Scatterplot.pg, 1, -1, 0 +Statistics/ScatterplotsAndCorrelation/ur_stt_6_2.pg, 1, -1, 0 +Statistics/ScatterplotsAndCorrelation/ur_stt_6_1.pg, 1, -1, 0 +Statistics/LinearRegression/gust16.pg, 1, -1, 0 +Statistics/LinearRegression/lines5.pg, 1, -1, 0 +Statistics/LinearRegression/lines4.pg, 1, -1, 0 +Statistics/LinearRegression/lines3.pg, 1, -1, 0 +Statistics/LinearRegression/lines2.pg, 1, -1, 0 +Statistics/LinearRegression/lines1.pg, 1, -1, 0 +Statistics/LinearRegression/dueck4_2_2.pg, 1, -1, 0 +Statistics/LinearRegression/dueck4_2_4.pg, 1, -1, 0 +Statistics/LinearRegression/gust17.pg, 1, -1, 0 +Statistics/LinearRegression/gust18.pg, 1, -1, 0 +Statistics/LinearRegression/gust19.pg, 1, -1, 0 +Statistics/LinearRegression/gust22.pg, 1, -1, 0 +Statistics/LinearRegression/gust23.pg, 1, -1, 0 +Statistics/LinearRegression/gust32.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_01_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_02_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_03_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_04_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_08_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_09_Regression.pg, 1, -1, 0 +Statistics/LinearRegression/05Stats_12_Regression.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSignificance_Testing.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSignificance_Testing.def new file mode 100644 index 0000000000..767c639002 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setSignificance_Testing.def @@ -0,0 +1,28 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 06/03/2015 at 10:00pm PDT +answerDate = 06/03/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = significance testing for hypotheses about a population proportion; significance levels; type I and type II error +problemList = +Statistics/SignificanceTesting/kolossa54.pg, 1, -1, 0 +Statistics/SignificanceTesting/kolossa56.pg, 1, -1, 0 +Statistics/SignificanceTesting/kolossa57.pg, 1, -1, 0 +Statistics/SignificanceTesting/kolossa58.pg, 1, -1, 0 +Statistics/SignificanceTesting/19Stats_03_InferencePropn.pg, 1, -1, 0 +Statistics/SignificanceTesting/19Stats_05_InferencePropn.pg, 1, -1, 0 +Statistics/SignificanceTesting/19Stats_09_InferencePropn.pg, 1, -1, 0 +Statistics/SignificanceTesting/19Stats_10_InferencePropn.pg, 1, -1, 0 +Statistics/SignificanceTesting/19Stats_12_InferencePropn.pg, 1, -1, 0 +Statistics/SignificanceTesting/ur_stt_4_4.pg, 1, -1, 0 +Statistics/SignificanceTesting/dueck9_3_1.pg, 1, -1, 0 +Statistics/SignificanceTesting/kolossa30.pg, 1, -1, 0 +Statistics/SignificanceTesting/kolossa33.pg, 1, -1, 0 +Statistics/SignificanceTesting/14Stats_07_InferenceIntro.pg, 1, -1, 0 +Statistics/SignificanceTesting/14Stats_08_InferenceIntro.pg, 1, -1, 0 +Statistics/SignificanceTesting/di12.pg, 1, -1, 0 +Statistics/SignificanceTesting/di13.pg, 1, -1, 0 +Statistics/SignificanceTesting/di14.pg, 1, -1, 0 +Statistics/SignificanceTesting/dueck9_2_1.pg, 1, -1, 0 +Statistics/SignificanceTesting/ur_stt_4_10.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setVenn_Diagrams_and_Sample_Spaces.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setVenn_Diagrams_and_Sample_Spaces.def new file mode 100644 index 0000000000..5a131671d1 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setVenn_Diagrams_and_Sample_Spaces.def @@ -0,0 +1,16 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 05/03/2015 at 10:01pm PDT +answerDate = 05/03/2015 at 10:01pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = probability problems where it may help to use a Venn diagram or illustrate the sample space rather than use probability formulas +problemList = +Statistics/ProbabilityRulesAndTools/ur_pb_3_6.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_3_4.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/ur_pb_3_2.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/sspaces1.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/10Stats_12_Probability.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/dueck5_2_2.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/dueck5_2_5.pg, 1, -1, 0 +Statistics/ProbabilityRulesAndTools/compprob4.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setz_Score_Basics.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setz_Score_Basics.def new file mode 100644 index 0000000000..47d04a4e4f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH243/setz_Score_Basics.def @@ -0,0 +1,13 @@ + +openDate = 03/30/2015 at 12:00am PDT +dueDate = 04/15/2015 at 10:00pm PDT +answerDate = 04/15/2015 at 10:00pm PDT +paperHeaderFile = PCCDefaultProblemSets/HardcopyHeaders/MTH243/GenericMTH243HardcopyHeader.pg +screenHeaderFile = PCCDefaultProblemSets/OnscreenHeaders/MTH243/GenericMTH243Header.pg +description = calculating and interpreting z-scores +problemList = +Statistics/zScoreEmpiricalRule/03Stats_05_NormalDist.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/normprob6.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/kolossa20.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/03Stats_07_NormalDist.pg, 1, -1, 0 +Statistics/zScoreEmpiricalRule/03Stats_06_NormalDist.pg, 1, -1, 0 diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz.def new file mode 100644 index 0000000000..bea0af5ad0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz.def @@ -0,0 +1,224 @@ +assignmentType = gateway +openDate = 06/08/2020 at 12:00am PDT +reducedScoringDate = 12/31/1969 at 04:00pm PST +dueDate = 06/11/2020 at 10:00pm PDT +answerDate = 06/11/2020 at 10:00pm PDT +enableReducedScoring = N +paperHeaderFile = defaultHeader +screenHeaderFile = +attemptsPerVersion = 1 +timeInterval = 0 +versionsPerInterval = 0 +versionTimeLimit = 3600 +problemRandOrder = 1 +problemsPerPage = 1 +hideScore = BeforeAnswerDate +hideScoreByProblem = N +hideWork = BeforeAnswerDate +capTimeLimit = 0 +description = A 20-question quiz on the derivative formulas for elementary functions. Does not include sum/difference/product/quotient/chain rules. +restrictProbProgression = 0 +emailInstructor = 0 + +problemListV2 +problem_start +problem_id = 1 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/constant.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 2 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/power_positive_integer.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 3 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/power_negative_integer.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 4 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/power_fraction.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 5 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/power_reciprocal.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 6 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/squareroot.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 7 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/sine.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 8 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/cosine.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 9 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/tangent.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 10 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/secant.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 11 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/cosecant.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 12 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/cotangent.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 13 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/arctangent.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 14 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/arcsine.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 15 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/arcsecant.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 16 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/exp.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 17 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/exp-base-integer.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 18 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/natural-log.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 19 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/absolute-value.pg +value = 1 +max_attempts = -1 +showMeAnother = -1 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 0 +problem_end +problem_start +problem_id = 20 +source_file = PCCSetDefinitions/MTH251/setDerivatives_Quiz/nth-root.pg +value = 1 +max_attempts = -1 +showMeAnother = 0 +prPeriod = -1 +counts_parent_grade = 0 +att_to_open_children = 1 +problem_end + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/absolute-value.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/absolute-value.pg new file mode 100644 index 0000000000..aa616bb848 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/absolute-value.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("abs($x)"); +$df = $f->D($x); +$df->{test_at} = [[random(-5,-1,0.01)],[random(1,5,0.01)]]; + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arccosine.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arccosine.pg new file mode 100644 index 0000000000..c1049278ba --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arccosine.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +Context()->variables->set($x=>{limits=>[-1,1]}); +$f = Formula("cos^-1($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsecant.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsecant.pg new file mode 100644 index 0000000000..c3d1623c15 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsecant.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +Context()->variables->set($x=>{limits=>[1,10]}); +$f = Formula("sec^-1($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsine.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsine.pg new file mode 100644 index 0000000000..87773bc90f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arcsine.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +Context()->variables->set($x=>{limits=>[-1,1]}); +$f = Formula("sin^-1($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arctangent.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arctangent.pg new file mode 100644 index 0000000000..2f0922d51b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/arctangent.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("tan^-1($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/constant.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/constant.pg new file mode 100644 index 0000000000..e3e7a8cc44 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/constant.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula(random(11,99,1)); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosecant.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosecant.pg new file mode 100644 index 0000000000..83bd47284d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosecant.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("csc($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosine.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosine.pg new file mode 100644 index 0000000000..03d03cc001 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cosine.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("cos($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cotangent.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cotangent.pg new file mode 100644 index 0000000000..1ad507b7ab --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/cotangent.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("cot($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp-base-integer.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp-base-integer.pg new file mode 100644 index 0000000000..56ae67d3de --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp-base-integer.pg @@ -0,0 +1,87 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$b = random(2,9,1); +$f = Formula("($b)^($x)"); +Context()->flags->set(reduceConstantFunctions=>0); +$df = Formula("ln($b) ($b)^($x)"); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp.pg new file mode 100644 index 0000000000..773d1c8464 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/exp.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("e^($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/natural-log.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/natural-log.pg new file mode 100644 index 0000000000..079462a3ed --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/natural-log.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("ln($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/nth-root.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/nth-root.pg new file mode 100644 index 0000000000..e067d62509 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/nth-root.pg @@ -0,0 +1,90 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "parserRoot.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Fraction"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$n = random(3,9,1); +Context()->variables->set($x=>{limits=>[0.1,10]}); +parser::Root->Enable; +$f = Formula("root($n,$x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_fraction.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_fraction.pg new file mode 100644 index 0000000000..cb8cb2f916 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_fraction.pg @@ -0,0 +1,89 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PGchoicemacros.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Fraction"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +($m,$n) = num_sort((1..9)[NchooseK(9,2,1)]); +Context()->variables->set($x=>{limits=>[0.1,10]}); +$f = Formula("$x^($m/$n)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_negative_integer.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_negative_integer.pg new file mode 100644 index 0000000000..ac57c4eb3c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_negative_integer.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$n = random(5,20,1); +$f = Formula("$x^(-$n)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_positive_integer.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_positive_integer.pg new file mode 100644 index 0000000000..c484934f5b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_positive_integer.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$n = random(5,20,1); +$f = Formula("$x^$n"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_reciprocal.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_reciprocal.pg new file mode 100644 index 0000000000..ef878f4880 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/power_reciprocal.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$n = random(5,20,1); +$f = Formula("1/$x^$n"); +$df = Formula("-$n/$x^($n+1)"); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/secant.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/secant.pg new file mode 100644 index 0000000000..43fbd63bf0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/secant.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("sec($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/sine.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/sine.pg new file mode 100644 index 0000000000..50ee9983ec --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/sine.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("sin($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/squareroot.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/squareroot.pg new file mode 100644 index 0000000000..224c08e8f3 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/squareroot.pg @@ -0,0 +1,86 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +Context()->variables->set($x=>{limits=>[0.1,10]}); +$f = Formula("sqrt($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/tangent.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/tangent.pg new file mode 100644 index 0000000000..c1005d9cb7 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/MTH251/setDerivatives_Quiz/tangent.pg @@ -0,0 +1,85 @@ +## DBsubject('Calculus - single variable') +## DBchapter('Differentiation') +## DBsection('Derivatives of polynomial and power functions') +## Date('6/7/2020') +## Author('Alex Jordan') +## Institution('Portland Community College') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +############################################################ +# Load Macros +############################################################ +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGcourse.pl", +); + +############################################################ +# Header +############################################################ +TEXT(beginproblem()); + + + +############################################################ +# PG Setup +############################################################ + +Context("Numeric"); +$x = list_random('x','y','z','t','p'); +Context()->variables->are($x=>'Real'); + +$fname = list_random('f','g','h','k','q'); + +$f = Formula("tan($x)"); +$df = $f->D($x); + +Context()->texStrings; + +$dfnotation = list_random( + "$fname'($x)", + "\frac{d$fname}{d$x}", + "\frac{d}{d$x}${fname}($x)", + "\frac{d}{d$x}\left($f\right)", +); + +$question = ($dfnotation eq "\frac{d}{d$x}\left($f\right)") ? + "Find [`$dfnotation`]." : + "If [`$fname`] is defined by [`$fname($x)=$f`], what is [`$dfnotation`]?"; + +Context()->normalStrings; + +############################################################ +# Body +############################################################ + +BEGIN_PGML + +[$question]** + +[_]{$df}{20} + +END_PGML + + +############################################################ +# Solution +############################################################ + +#BEGIN_PGML_SOLUTION + +#END_PGML_SOLUTION + +############################################################ +# End Problem +############################################################ + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation01.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation01.pg new file mode 100644 index 0000000000..0dcdc156d4 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation01.pg @@ -0,0 +1,49 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("LimitedNumeric"); + + + +###################################### + + +BEGIN_PGML +## Entering an Answer and Reading Feedback ## + +Hello and welcome to the WeBWorK orientation. + +Most of the time, you will be using WeBWorK to submit answers to math questions. Answers will typically either be numbers or expressions with variables. + +Let's start off simple. What is the value of [`2+2`] ? Type your answer in the box below, but be patient and keep reading below. + + [_______]{Real(4)} + +Below, you have two buttons available: _Preview Answers_ and _Submit Answers_. +1. Push the _Submit Answers_ button, and see that you have the right answer. +2. Try typing in a number that is wrong and pushing the _Submit Answers_ button. +3. Sometimes you might completely misunderstand a question and your answer is way off base. WeBWorK will try to make you see this. Try typing in the expression [`x`] as the answer and pushing the _Submit Answers_ button. In the box above, _read the feedback message_ that arises. Do you understand what that feedback message is saying and how it applies to your answer? + +As you use WeBWorK and inevitably get some questions wrong on your first attempt, make sure that you read the feedback messages. + +If you are ready, move on to the next problem in this orientation. You my either use the _Next_ button above, or directly click on _Problem 2_ to the left. + + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation02.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation02.pg new file mode 100644 index 0000000000..25b1c089de --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation02.pg @@ -0,0 +1,108 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"contextLimitedRadical.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Fraction"); +$u = random(1,3); +$v = random(4,10); +$w = Fraction($u,$v); + +$a = random(2,8,1); +$b = random(2,8,1); +$c = random(2,8,1); +$d = $a*$b+$c; + +Context("Numeric"); +Context()->flags->set(reduceConstantFunctions=>0); +$e = Compute("$a/x"); +$h = Formula("sqrt(x)"); +$h->{limits} = [2,5]; + +Context("Numeric"); +Context()->variables->are(k=>'Real'); +$f = Compute("k^$a"); + +Context("Numeric"); +Context()->variables->are(K=>'Real'); +$g = Compute("$b^K"); + +Context("LimitedRadical"); +$i = Formula("root(4,11)"); + + +###################################### + + +BEGIN_PGML +## Basic Operations ## + +The four basic arithmetic operations are: + [`+, -, \times, \div`] + +Each of these has a corresponding character on the keyboard. The first two are found in the upper right area of most keyboards. For [`\times`] (which is also often denoted with [`\cdot`] on paper), we use the asterisk character: +: \* +This is the shift-8 key on most keyboards. + +Try literally entering [`[$a]\cdot[$b]+[$c]`] by typing it exactly as: +: [$a]\*[$b]+[$c] + + [_________]{Compute($a*$b+$c)->cmp(formatStudentAnswer=>'parsed')} + +Of course you could also simplify this to [`[$d]`]. + +Division is typed using the slash character: +: / +which is in the lower right of most keyboards. Try entering the following: + + + [::[$w]=::] [____]{$w} + + [::[$e]=::] [_________]{$e} + +Raising to a power is universally denoted with the caret symbol: +: [$CARET] +This is usually shift-6 on a keyboard. Try entering the following: + + [::[$f]=::] [____]{$f} + + [::[$g]=::] [____]{$g} + +This is a good time to point out that _capitalization matters_. In math, [`k\neq K`]. See what happens if you use the wrong capitalization in the above answers. If you are not getting one of these answers correct, is it because of capitalization? + +Another common basic operation is the square root, which is denoted with [`\sqrt{\phantom{x}}`] on paper. There is no square root character on most keyboards, so we do something else with this operation. We use: +: sqrt +and parentheses, as in: +: sqrt(x) +for [`\sqrt{x}`]. + +Try entering the following: + + [::[$h]=::] [_________]{$h} + +[%We also sometimes use radicals of higher order. For example the cube root of [`x`] is denoted [`\sqrt[3]{x}`], and this would be typed as: +: root(3,x) +This will only be an option in problems that are potentially expecting you to use it. Try entering the following:%] + +[% [``[$i]=``] [_________]{$i}%] + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg new file mode 100644 index 0000000000..a849a5f924 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg @@ -0,0 +1,61 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"parserNumberWithUnits.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Numeric"); +Context()->variables->add(t=>'Real'); + +$a = random(2,8,1); +$b = random(2,8,1); +$c = random(2,8,1); + +$f = Compute("sqrt($a x+ $b)"); +$f->{limits} = [-$b/$a + 1, -$b/$a + 10]; + +$g = Compute("(t-$b)/(4t+1)"); + +###################################### + + +BEGIN_PGML +## MathQuill ## + +In answer blanks, as you type, math expressions are built. For example if you type the characters [|5^2t|]* it will create [`5^{2t}`]. That is, it will put [|2t|]* up in the exponent and you don't have to see the [|^|]* character. + +Also when your cursor is in an answer blank, a math palette tool is available off to the side of the screen. This can help you construct math expressions. + +For practice, try typing or using the palette tool to enter these expressions: + + [`5^{2t}=`] [_____]{Compute("5^(2t)")} + + [``\frac{1}{[$a](x+[$c])}=``] [__________]{Compute("1/($a(x+[$c]))")} + + [``\sqrt{[$a] x + [$b]}=``] [__________]{$f} + + [``\frac{t-[$b]}{4t+1}=``] [__________]{$g} + +Sometimes you really want an answer to be exactly the way you typed it and not automatically turned into a nice-looking math expression. If this is the case, use the "Tt" button on the palette tool. Or you can type the " key. Either way, you enter what is called "text mode" and whatever you type in the answer blank will be left as it is. Try: + + [``23\,\text{degC}=``] [__________]{NumberWithUnits("23 degC")} + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg.bak b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg.bak new file mode 100644 index 0000000000..2a93126a7f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation03.pg.bak @@ -0,0 +1,65 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Numeric"); +Context()->variables->add(t=>'Real'); + +$a = random(2,8,1); +$b = random(2,8,1); +$c = random(2,8,1); + +$f = Compute("sqrt($a x+ $b)"); +$f->{limits} = [-$b/$a + 1, -$b/$a + 10]; + +$g = Compute("(t-$b)^(4t+1)"); +$g->{limits} = [$b + 1, $b + 10]; + +###################################### + + +BEGIN_PGML +## Preview Answer and Order of Operations ## + +WeBWorK understands the order of operations very well, and interprets what you type according to them. Sometimes students will intend to enter an expression like [`5^{2t}`], but not use the right order of operations when typing. WeBWorK wants you to confirm that what you intended to enter is what you actually entered, and so it provides an *Answer Preview* column when you submit any answers. For instance, try the following: + + [`5^{2t}=`] [_____]{Compute("5^(2t)")} + +but try entering it as: +: 5^2t +which is incorrect. Go ahead and push the _Submit Answers_ button. Note how the *Answer Preview* column is showing you what WeBWorK thinks you entered. It treats the [$CARET] as higher priority than the multiplication, and computes [`5^2`]. _Then_ it multiplies this by [`t`]. So it sees [`5^2t`]. The correct way to enter [`5^{2t}`] is: +: 5^(2t) +using parentheses to change the priorities according to the order of operations. + +The lesson is that if your answer is marked incorrect, along with looking for any feedback messages, you should also look at the *Answer Preview* column and you may see that you have not used grouping symbols well. + +Try entering the following correctly: + + [``\frac{1}{[$a](x+[$c])}=``] [__________]{Compute("1/($a(x+[$c]))")} + + [``\sqrt{[$a] x + [$b]}=``] [__________]{$f} + + [``(t-[$b])^{4t+1}=``] [__________]{$g} + +When you have an answer typed into an answer blank and you hit the _enter/return_ key on your keboard, the effect is the same as pushing the *Answer Preview* button. It does _not_ actually submit your answer to see if it is right or wrong; it only lets you see how WeBWorK would interpret what you have typed. + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation04.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation04.pg new file mode 100644 index 0000000000..8523ababad --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation04.pg @@ -0,0 +1,69 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("LimitedFraction"); +Context()->flags->set(allowMixedNumbers=>0); + +$a = Fraction(1,3); + +Context("Numeric"); + +$b = Real("$a"); + +Context("LimitedNumeric"); +Context()->constants->remove("pi"); + +$c = Real(1/9); +$d = sqrt(110); +$e = 3.1415926; +$f = Real(5/2); + +###################################### + + +BEGIN_PGML +## Decimal Approximations to Answers ## + +Imagine that the true answer to a problem is [:1/3:]. As you may know, this fraction is equal to the decimal number [`0.3333\ldots`], which is also written as [`0.\overline{3}`]. + +Sometimes, your instructor will require you to enter the answer _exactly_. In that case your only option is to enter [:1/3=:] [_________]{$a}. + +Sometimes, you will be allowed to get away with decimal _approximations_ to the real answer. So for instance, in _this_ answer blank we can get away with typing [`0.3333`] even though that is slightly different from the true value: [:1/3=:] [_________]{$b}. + +Here is what you need to know: _If_ a decimal approximation is acceptable at all, then your answer will be counted correct if you have the first _three_ significant digits correct. + +Take out a calculator and enter decimal approximations for these values. At first, try rounding your calculator's outputs to only two significant digits. Then move up to three. Three significant digits will be required for each and every one of these to count as correct. _These questions are trying to teach you that you should be in the habit of using three significant digits when entering decimal answers._ + + [`1/9 =0.11111111\ldots=`] [_________]{$c} (Try typing [|0.1|]*, [|0.11|]*, [|0.111|]*, etc. What is counted correct?) + + [`\sqrt{110} =10.4880885\ldots=`] [_________]{$d} (Try typing [|10|]*, [|10.4|]*, [|10.5|]*, etc. What is counted correct?) + + [`0.002038 =`] [_________]{0.002038} (Try typing [|0.002|]*, [|0.0020|]*, [|0.00203|]*, [|0.00204|]*, etc. What is counted correct?) + + [`20380.2 =`] [_________]{20380.2} (Try typing [|20000|]*, [|20300|]*, [|20400|]*, etc. What is counted correct?) + +With the third question, students sometimes feel they should be able to get away with [`0.002`], since that is only off by a tiny amount of [`0.000038`]. However, percentage-wise this would be off by over [`1.8%`], which is generally considered unacceptable. By always answering using three significant digits, your percentage error will always be very small. + +With the last question, students mistakenly believe they must enter the entire number. While that's fine, it's OK to round to three significant digits. So you may simply enter [`20400`]. + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation05.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation05.pg new file mode 100644 index 0000000000..1ab8a9ca7c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation05.pg @@ -0,0 +1,70 @@ +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); +$a = random(2,9,1); +$b = random(2,9,1); +$c = Real("$a+$b"); + + +Context("LimitedNumeric"); +$d = random(2,9,1); +$e = random(2,9,1); +$f = Real($d+$e); + +Context("LimitedFraction"); +$g = Fraction(1,3); + +Context("LimitedRadical"); +$h = Formula("2 sqrt(3)"); + + +###################################### + + +BEGIN_PGML +## Simplifying Answers ## + +Your instructor may require you to simplify answers sometimes, and other times simplifying might not be the point of the exercise. For instance, in the following: + [`[$a]+[$b]=`] [_____]{$c} + +You could certainly enter [`[$c]`]. But does it surprise you to learn that you could literally enter [`[$a]+[$b]`] and have it counted correct? In this answer blank, you could enter virtually any expression that would works out to [`[$c]`]. Try finding other creative ways to enter this answer. + +On the other hand, here that ability has been turned off; try entering the answer unsimplified: + [`[$d]+[$e]=`] [_____]{$f} + +Are you paying attention to the feedback messages that WeBWorK gives you? Try entering the following _without_ simplifying: + [``\frac{2}{6}=``] [_____]{$g} +and WeBWorK will tell you that your answer has not yet been simplified. + +You might know that [`\sqrt{12}`] can be simplified to [`2\sqrt{3}`]. (This is considered simpler because what is inside the radical is smaller.) But try entering [`\sqrt{12}`] without any simplification and seeing what the feedback message is: + [`\sqrt{12}=`] [_____]{$h} + + +Of course, there will be plenty of times when your instructor will not require answers like these to be simplified. You should just be aware that it is a possibility, and you should monitor WeBWorK's feedback messages. When you are ready, move on to the next question. + + + + +END_PGML + + +###################################### + + + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation06.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation06.pg new file mode 100644 index 0000000000..b653e0c566 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation06.pg @@ -0,0 +1,84 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); + +$a = random(5,10,1); + + +###################################### + + +BEGIN_PGML +## Navigating WeBWorK ## + +[@ if($envir{QUIZ_PREFIX}) {'*Important:* This page is informational only and features described applies mostly to homework (not used in this course) rather than quizzes.'} @]** + +That's enough for now about how you enter your answers. Let's spend some time learning how to navigate WeBWorK so that you can use it more effectively. + +By now you've had experience with the _Next_ button above. The _Previous_ button takes you to the previous problem, and the _Problem List_ button takes you back to the beginning of this problem set. + +At the bottom of a problem screen, you may see how many times you have attempted a problem, and how many times you have left. Sometimes you also see whether or not partial credit is possible, and if so how much do you have. This particular problem is lying about how many attempts you have used. How many attempts does it _say_ that you have used so far? [______]{Compute($a)} + +On the left of the screen there are three panels. The middle panel is just a quick way for you to jump to other problems in the problem set. The top panel lets you find your way to +* *Homework Sets*: this is the screen you were at when you first logged in. It shows you all of the homework sets that have been assigned to you and when they are due. +* *User Settings*: + * If you would like to change your password, go here. + * You may also change your contact email to something that you find more convenient here. However the law requires that your instructor is only permitted to communicate with you about grades using your official school email address. So we recommend that you leave your email address alone. Check your school email address often. + * There are some other settings that you can save for your account. +* *Grades*: Go here to see how you have performed in your assignments. +* *Achievements*: If your instructor is using Math Achievements, then you can earn badges and level up as you complete homework problems. Go here to view your level and badges. Also, if you have earned any items that can be applied to your homework sets, you will see them here. + +Also in *User Settings*, you may choose either to see or not see your previously entered answers, and choose whether or not to enable the math editing tool (this is only an option if the instructor has turned on that tool in the first place). + +When you are ready, move on to the next problem. + + + +END_PGML + + +###################################### + +install_problem_grader(sub { + my ($result,$state) = std_problem_grader(@_); + my $time = time(); + my $open = $time >= $openDate && $time <= $dueDate; + my $submit = $inputs_ref->{submitAnswers}; + my $attempts = $state->{num_of_correct_ans} + $state->{num_of_incorrect_ans}; + $attempts-- if $attempts && !$submit; + + my @msg = (); + push(@msg,"Your score was ".($open ? "" : "not "). "recorded.") if $submit; + push(@msg,"You have attempted this problem $a time".($a== 1 ? "." : "s.")); + push(@msg,"You have unlimited attempts remaining."); + if ($submit) { + if ($result->{score} == 1) { + push(@msg,"You received a score of 100% for this attempt."); + push(@msg,"Your overall recorded score is 100%."); + } else { + push(@msg,"Your answers are not yet fully correct."); + } + } + unless ($open) { + push(@msg,"The homework set is not yet open.") if $time < $openDate; + push(@msg,"The homework set is closed.") if $time > $dueDate; + } + + $state->{state_summary_msg} = join('
    ',@msg); + return ($result,$state); + }); + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation07.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation07.pg new file mode 100644 index 0000000000..57707ba5e1 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation07.pg @@ -0,0 +1,55 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); + + + +###################################### + + +BEGIN_PGML +## Seeking Help ## + +The primary purpose of WeBWorK is that it allows you to practice some math problems and immediately get feedback about your answers. This is much better than waiting a full week to learn about your answers from written homework. WeBWorK will even often give you _intelligent_ feedback if you are reading the feedback messages. + +If you become stuck on a problem, cannot get the answer correct, do not understand what the problem asks, think there is a bug with the problem, or all of the above, then... +1. Check that you have read any feedback messages WeBWorK is giving, and that you have not rounded your answer too much. +2. Reread the problem carefully to see if there are any instructions that you did not notice. +3. Check your textbook and notes to see if you can learn from them. +4. There is an *Email Instructor* button below: use it. + +When you use this button, you should write a message to your instructor (or TA) explaining what you have tried. It will help a lot if you write down the steps of the math that you have worked out too. You can even attach a file, for example a picture of your hand-written work. Then the instructor gets your message along with a link to the problem from _your perspective_, and they can also see all of your previously attempted answers. This way your instructor can write you back with good help/hints. + +Writing for help is OK! Yes, it is last on this list, but that is just because it is good for you to try to be self sufficient. There is a lot you can gain from WeBWorK's feedback, your textbook, and your notes. If you feel it is appropriate to contact your instructor for help, then do so! + +This answer blank is expecting a certain answer: [___________]{Real(112358)->cmp(tolType=>'absolute',tolerance=>0.1)}. The only way to get the answer is to use the *Email Instructor* button and politely ask for the answer to this Orientation Problem. The instructor will reply to your email as soon as they are able to, which may be the following day. (Instructors: you can check the box to show "Correct Answers" and then use the "Check" button to see the answer and write a response to your student.) + +If you don't get a reply within 12 hours, please check your SPAM folder. Google mail will sometimes direct WeBWorK emails to SPAM. This only happens to about 1 in 30 people, but it does happen. If this happens to you just click the option telling Google mail that email from that sender is not SPAM and you should be good for the rest of the term. If you do not find anything in your SPAM folder either, contact your instructor with email outside of WeBWorK. + + + + + + + +END_PGML + + +###################################### + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation08.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation08.pg new file mode 100644 index 0000000000..bab282a5d9 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation08.pg @@ -0,0 +1,44 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); +$a = random(1000,9999,0.1); + + + +###################################### + + +BEGIN_PGML +## Printing off a Homework Set ## + +For many reasons, you might not be able to work through an entire problem set while sitting online in front of a computer screen. From the *Homework Sets* page, you may push the button to the left of a homework set to download a PDF version of the homework set. + +This file is something that you can read onscreen while you are not online. You can even print it off and take it to a tutoring center or your favorite coffee shop to work on. (Please do not waste paper by actually printing an assignment unless you feel that it is necessary.) + +To make sure that you understand how this works, download the PDF version of this Orientation assignment. At the end of this problem in the PDF, you will find the answer to this answer blank: [___________]{Compute("$a")->cmp(tolType=>'absolute',tolerance=>0.1)} + + +END_PGML + +if ($displayMode eq 'TeX') { +TEXT("The answer is $a."); +} + +###################################### + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation09.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation09.pg new file mode 100644 index 0000000000..1c5915ef55 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation09.pg @@ -0,0 +1,57 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Interval"); +Context()->variables->add(a=>'Real',b=>'Real'); + + + +###################################### + + +BEGIN_PGML +## Miscellaneous ## + +Here are more WeBWorK features. + +* After an assignment is due, you typically will be able to see the answers to all questions. You must go back into the problem set and check the _Show correct answer_ box. This box is not visible before the due date, and quite possibly for just a little while after the due date too. +* Some problems have been coded with walk-through solutions. You will not be able to see these until it's also possible for you to see the answers. +* Some problems have been coded with hints. You will not be able to see these until you've used some number of attempts on the problem. +* Once the due date has passed, you can still enter answers in the answer blanks and WeBWorK will still give you the same feedback; just not for credit. +* Captial letters are different than lowercase letters when it comes to variables. In an answer to a WeBWorK question, [`\pi r^2`] might be correct while [`\pi R^2`] is not. +* When you click on a problem set, there is set-specific information from your instructor in a panel to the right. Always read this before you begin the problems set. It may give you important hints. +* Repeated guessing is not helpful. If you have gotten a problem incorrect several times, you should ask for help. That's what your instructor, TAs, and tutors are here for. +* Have we mentioned enough times that you should read the feedback messages? +* For decimal answers, get in the habit of using three significant digits. +* If you want to enter [`\pi`], you could type [|pi|]*, paste the π character, press [|option-p|]* on a Mac, or use the palette tool. +* If you want to enter [`\infty`], you could type [|inf|]*, type [|infinity|]*, paste the ∞ character, press [|option-%|]* on a Mac, or use the palette tool. +* All of your submissions are permanently recorded. That means you can log off at any time and all of your work will be saved. So you can do assignments in little bits at a time and work out of order if you like. +* WeBWorK can be used on tablets and smartphones. +* Most problems are coded with randomization. This means that while you and your classmate may have the same skeleton of a problem, the numbers invloved are different. This encourages you to teach each other the _process_ of answering a problem without being able to simply share the answers. + +The collection of all of the numbers between [`0`] and [`\pi`] including the endpoints is represented as [`[0,\pi]`] in interval notation. Practice entering [`[0,\pi]`] in the answer blank: [_____]{Compute("[0,pi]")}. + +What is the symbol that is used to represent a quantity that is conceptually larger than any number? [_____]{Compute("inf")} + +The answer to the following is something like [`\pi AB`], but that's not accepted because the actual answer has lowercase variables. Try entering both [`\pi AB`] and [`\pi ab`]: [_____]{Compute("pi a b")} + +END_PGML + + +###################################### + + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation10.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation10.pg new file mode 100644 index 0000000000..6bf90736d3 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation10.pg @@ -0,0 +1,95 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGchoicemacros.pl", +"unionTables.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); +$showPartialCorrectAnswers = 1; + +# +# Create a matching list and use popups +# +$ml = new_match_list(); +$ml->rf_print_q(~~&pop_up_list_print_q); +$ml->ra_pop_up_list([ +"No answer" => "?", +"A" => "A", "B" => "B", "C" => "C", +"D" => "D", "E" => "E", "F" => "F", +"G" => "G", "H" => "H", "I" => "I", +"J" => "J", "K" => "K", "L" => "L", +"M" => "M", "N" => "N", "O" => "O", +"P" => "P", "Q" => "Q", "R" => "R", +]); + +# +# Add correct questions and answers +# +$ml->qa( +"If your answer is marked incorrect, you should read ...", + "the feedback messages, if there are any", +"Raising to a power uses ...", + "the $CARET character", +"To confirm that you typed what you think you typed, look at ...", + "the Answer Preview column", +"If a decimal answer is acceptable, you should use ... significant digits", + "three", +"If you have an answer wrong after several attempts, have read any feedback messages, have not rounded your answer too much, and have tried using your textbook and/or notes, then you should use ...", "the Email Instructor button", +"If you email your instructor for help, you should include ...", + "what work you have tried", +"It's possible to create ... if you do not want to do the entire assignment on-line or on-screen", + "a PDF file", +"After a problem set is due, you can often see ...", + "the answers", +); +$ml->choose(8); + +# +# Add extra incorrect answers +# +$ml->extra( +"two", +"two decimal points", +"a robot", +"the source code", +"your email address", +"the * character", +"more attempts", +"the mood lighting", +"your watch", +); +$ml->choose_extra(9); + +#$ml->makeLast("None of the above"); + + +###################################### + + +BEGIN_PGML +## Quiz ## + +And now, a little check to see if you have learned the more important things from this orientation. + +[@ ColumnMatchTable($ml,valign => TOP) @]* + + + +END_PGML + + +###################################### + +ANS( str_cmp( $ml->ra_correct_ans ) ); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation11.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation11.pg new file mode 100644 index 0000000000..d7c28786f0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation11.pg @@ -0,0 +1,141 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# Orientation problem about how to enter units +# +# +# +# ENDDESCRIPTION + +## DBsubject('Numbers') +## DBchapter('Real numbers') +## DBsection('Misc.') +## KEYWORDS('units') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Alex Jordan, Carl Yao, Chris Hughes') +## Institution('PCC') + + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextCurrency.pl", + "parserNumberWithUnits.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + + +Context("Numeric"); + +$length = random(1,99,1); +$lengthans = NumberWithUnits($length,"ft"); + +$area = $length; +$areaans = NumberWithUnits($area,"m^2"); + +$acceleration = random(5,10,1); + + +Context("Currency")->currency->addSymbol("dollars","dollar"); +Context()->flags->set(trimTrailingZeros=>1); + +$finance1 = random(15,95,5); +$financeans1 = Currency($finance1); + +$finance2_dollar = random(1,99,1); +$finance2_cent = random(1,99,1); +$financeans2 = Currency($finance2_dollar+$finance2_cent/100); + + +############################################## +TEXT(beginproblem()); + +BEGIN_PGML + +The following questions practice how to enter units in WeBWorK. Enter a number with a unit as your answer. Note that if a unit is already shown after the textbox, there is no need to enter the unit again. + +For finance related units, enter the dollar sign, followed by the money amount. + +For non-finance related units, enter the number first, followed by a space, and then followed by the unit. + + *Finance* + [@numberWord($finance1)@] dollars + + [_________]{$financeans1} + + [@numberWord($finance2_dollar)@] dollars and [@numberWord($finance2_cent)@] cents + + [_________]{$financeans2} + + *Length* + A rectangle's base is [@numberWord($length)@] feet long (WeBWorK recognizes *ft* as the unit feet). + + [_________]{$lengthans} + + *Area* + A rectangle's area is [@numberWord($area)@] square meters (WeBWorK recognizes *m^2* as the unit square meter). + + [_________]{$areaans} + + *Physics* + A car is accelerating at [@numberWord($acceleration)@] feet per second squared. + + [_________]{$acceleration} [` \frac{\text{ft}}{\text{s}^2} `] + +END_PGML + + + +############################################## +$showPartialCorrectAnswers=1; + +BEGIN_PGML_SOLUTION + +Here are the solutions: + + *Finance* + [@numberWord($finance1)@] dollars + + [`[$financeans1]`] + + [@numberWord($finance2_dollar)@] dollars and [@numberWord($finance2_cent)@] cents + + [`[$financeans2]`] + + *Length* + A rectangle's base is [@numberWord($length)@] feet long (WeBWorK recognizes *ft* as the unit feet). + + [`[$lengthans]`] + + *Area* + A rectangle's area is [@numberWord($area)@] square meters (WeBWorK recognizes *m^2* as the unit square meter). + + [`[$area] \text{ m^2}`] + + *Physics* + A car is accelerating at [@numberWord($acceleration)@] feet per second squared. + + [`[$acceleration]`] [` \frac{\text{ft}}{\text{s}^2} `] + +Note that there is no need to enter unit for the last problem, as the unit is already there. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation12.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation12.pg new file mode 100644 index 0000000000..f7bd573185 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation12.pg @@ -0,0 +1,89 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Orientation problem on how to enter a mixed number. +# +# Last edited: Carl Yao 1/6/2015 +# +# ENDDESCRIPTION + +## DBsubject('Middle School') +## DBchapter('Fractions') +## DBsection('') +## KEYWORDS('mixed number') +## DBCCSS('6.NS.1') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>0); +Context()->flags->set(showMixedNumbers=>1); + +$int = random(1, 5, 1); +do { + $den = random(4, 9, 1); + $num = random(1, $den-1, 1); +} until (gcd($num,$den)==1); +$frac = Fraction($num,$den); + +$ans = $int + $frac ->reduce; + +if ($den==5) { + $ordinal = "fifth"; +} elsif ($den==8) { + $ordinal = "eighth"; +} elsif ($den==9) { + $ordinal = "ninth"; +} else { + $ordinal = numberWord($den)."th"; +} + +############################################## + +TEXT(beginproblem()); + +BEGIN_PGML + +Enter the following mixed number: [@numberWord($int)@] and [@numberWord($num)@] [$ordinal] + +A space is needed between the integer and the fraction. + + [___________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Here is the way to enter the mixed number: + + [` [$int] \text{ } [$num]/[$den] `] + +Note that a space is needed between the integer and the fraction. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation15.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation15.pg new file mode 100644 index 0000000000..f522bdda28 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation15.pg @@ -0,0 +1,47 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("LimitedNumeric"); + +$a = random(1,5,1); +$ans = 2*$a; + +###################################### + + +BEGIN_PGML +## Learn from solution and try a different version. ## + +What is the value of [`[$a]+[$a]`] ? Let's intentionally type a wrong answer in the box below. + + [_______]{$ans} + +Check the text box _CorrectAnswers_, and then click on _Submit Answers_ button. Now you can see the solution to this problem. + +Once you learned how to do this problem, click on the button _Show Me Another_. Now you can do the same problem with different numbers. You can keep doing this until you feel you have learned the concept. + +Now go to the next problem in the orientation. + +END_PGML + + +###################################### + +BEGIN_PGML_SOLUTION + + [`` [$a]+[$a] = [$ans] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation20.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation20.pg new file mode 100644 index 0000000000..6f258fa2df --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation20.pg @@ -0,0 +1,85 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Fraction"); +$u = random(1,3); +$v = random(4,10); +$w = Fraction($u,$v); + +$a = random(2,8,1); +$b = random(2,8,1); +$c = random(2,8,1); +$d = $a*$b+$c; + +Context("Numeric"); +$e = Compute("(x+$a)/x"); +$h = Compute("sqrt(x+$b)"); + +Context("Numeric"); +Context()->variables->are(k=>'Real'); +$f = Compute("k^$a"); + +Context("Numeric"); +Context()->variables->are(K=>'Real'); +$g = Compute("$b^(K+1)"); + + + +###################################### + + +BEGIN_PGML +## Basic Operations ## + +The four basic arithmetic operations are: + [``+, -, \times, \div``] + +Each of these has a corresponding character on the keyboard. The first two are found in the upper right area of most keyboards. For [`\times`] (which is also often denoted with [`\cdot`] on paper), we use the asterisk character (\*). This is the shift-8 key on most keyboards. + +Try literally entering [`[$a]\cdot[$b]+[$c]`] + + [___________]{Compute($a*$b+$c)->cmp(formatStudentAnswer=>parsed)} + +Of course you could also simplify this to [`[$d]`]. + +Division is typed using the slash character (/), which is in the lower right of most keyboards. Try entering the following: + + + [::[$w]=::] [___________]{$w} + +Raising to a power is universally denoted with the caret symbol ([$CARET]). This is usually shift-6 on a keyboard. Try entering the following: + + [::[$f]=::] [___________]{$f} + + [::[$g]=::] [___________]{$g} + +For [::[$g]::], you need to enter a pair of parenthsis, like [`[$b]\wedge(K+1)`]. If you entered [`[$b]\wedge K+1`], WeBWorK would interpret it as [`[$b]^K+1`], which is incorrect. + +This is a good time to point out that capitalization matters. In math, [`k\neq K`]. See what happens if you use the wrong capitalization in the above answers. + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + +BEGIN_PGML_SOLUTION + +Re-read the instructions! :) + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation25.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation25.pg new file mode 100644 index 0000000000..deb944c512 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation25.pg @@ -0,0 +1,65 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Fraction"); + +$den = random(2,5,1); +$ans = random(1,5,1); +$num = $den*$ans; +$num1 = random(1,$num,1); +$num2 = $num - $num1; + +###################################### + + +BEGIN_PGML +## Using Parentheses ## + +Look at this fraction: + + [`` \frac{1+1}{2} ``] + +The value of this function should be 1. However, if you enter [` 1+1/2 `], the value will be [` 1.5 `]. This is because, by order of operations, the computer does division before doing addition: + + [`` 1+1/2 = 1+0.5 = 1.5 ``] + +This is not what we want the computer to do. So how can we tell the computer to do addition in the numerator first? We must use parentheses: + + [`` (1+1)/2 ``] + +By order of operations, the computer will handle parentheses before doing division. This time, the value is [` (1+1)/2=2/2=1 `]. + +Now, enter the fraction literally, without doing any calculation: + + [`` \frac{[$num1]+[$num2]}{[$den]} ``] = [________________]{$ans} + +If you forget to use parentheses, you will see [` [$num1] + \frac{[$num2]}{[$den]} `] in the Answer Preview field. This is incorrect. + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + +BEGIN_PGML_SOLUTION + +You should enter: _[` ([$num1]+[$num2])/[$den] `]_ + +Did you forget the parentheses? + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation26.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation26.pg new file mode 100644 index 0000000000..3c2e409388 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation26.pg @@ -0,0 +1,69 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"contextFraction.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Fraction"); +Context()->variables->are(a=>'Real',b=>'Real',c=>'Real', d=>'Real'); + +$den1 = random(1,5,1); +$den2 = random(1,5,1); +$ans1 = random(1,5,1); +$num1 = ($den1+$den2)*$ans1; + +$ans2 = Compute("(a+b)/(c-d)")->reduce; +$ans3 = Compute("a/(bc)")->reduce; +###################################### + + +BEGIN_PGML +## More about Using Parentheses ## + +Enter the fractions literally, without doing any calculation: + +1. [` \frac{[$num1]}{[$den1]+[$den2]} `] = [________________]{$ans1} + +2. [` \frac{a+b}{c-d} `] = [________________]{$ans2} + +3. [` \frac{a}{bc} `] = [________________]{$ans3} + +When you are ready, move on to the next question. + +END_PGML + + +###################################### + +BEGIN_PGML_SOLUTION + +###Question 1 + +You should enter: [` [$num1]/([$den1]+[$den2]) `] + +If you forget to use parenthesis and entered [`[$num1]/[$den1]+[$den2]`], WeBWorK would interpret your expression as [` \frac{[$num1]}{[$den1]} + [$den2] `]. This is incorrect. + +###Question 2 + +You should enter: [` (a+b)/(c-d) `] + +If you forget to use parenthesis and entered [`a+b/c-d`], WeBWorK would interpret your expression as [` a+\frac{b}{c}-d `]. This is incorrect. + +###Question 3 + +You should enter: [` a/(bc) `] + +If you forget the parenthesis and entered [`a/bc`], WeBWorK would interpret your expression as [`\frac{a}{b}\cdot c`]. This is incorrect. + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation28.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation28.pg new file mode 100644 index 0000000000..0bd2d61e85 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation28.pg @@ -0,0 +1,48 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", +"PGcourse.pl", +); + +TEXT(beginproblem()); + +###################################### + +Context("Numeric"); +$b = random(1,10,1); +$h = Compute("sqrt(x+$b)"); +$i = Compute("sqrt(x)+$b"); + +###################################### + + +BEGIN_PGML +## square root ## + +Another common basic operation is the square root, which is denoted with [`\sqrt{\phantom{x}}`] on paper. There is no square root character on most keyboards, so we do something else with this operation. We use [|sqrt|] and parentheses, as in [|sqrt(x)|] for [`\sqrt{x}`]. Try entering the following: + +1. [::[$h]=::] [_________]{$h} +2. [::[$i]=::] [_________]{$i} + +END_PGML + + +###################################### + +BEGIN_PGML_SOLUTION + +###Question 1 + +You should enter _[$h]_ + +###Question 2 + +You should enter _[$i]_ + +END_PGML_SOLUTION + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation60.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation60.pg new file mode 100644 index 0000000000..1cd44e24d0 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation60.pg @@ -0,0 +1,52 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", + "parserRadioButtons.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); + +$a = random(5,10,1); + +$radio = RadioButtons( + ["Yes","No"], + "Yes", + last => ["No"], +); + + +###################################### + + +BEGIN_PGML +## Navigating WeBWorK ## + +That's enough for now about how you enter your answers. Let's spend some time learning how to navigate WeBWorK so that you can use it more effectively. + +By now you've had experience with the _Next_ button above. The _Prev_ button takes you to the previous problem, and the _Up_ button takes you back to the beginning of this problem set. + +On the left of the screen there are three panels. The middle panel is just a quick way for you to jump to other problems in the problem set. The top panel lets you find your way to +* *Homework Sets*: this is the screen you were at when you first logged in. It shows you all of the homework sets that have been assigned to you and when they are due. +* *Password/Email*: If you would like to change your password, go here. You may also change your contact email to something that you find more convenient here. However the law requires that your instructor is only permitted to communicate with you about grades using your official school email address. So we recommend that you leave your email address alone. Check your school email address often. + +Do you understand this problem's content? + +[@$radio->buttons()@]* + +END_PGML + +###################################### + +ANS( $radio->cmp() ); + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation80.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation80.pg new file mode 100644 index 0000000000..32dfdd4b2a --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/NewOrientation80.pg @@ -0,0 +1,48 @@ +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGML.pl", + "parserRadioButtons.pl", +); + +TEXT(beginproblem()); + +###################################### + + +Context("Numeric"); + +$radio = RadioButtons( + ["Yes","No"], + "Yes", + last => ["No"], +); + +###################################### + + +BEGIN_PGML +## Printing off a Homework Set ## + +For many reasons, you might not be able to work through an entire problem set while sitting online in front of a computer screen. From the *Homework Sets* page, you may select a problem set and click the _Download PDF or TeX Hardcopy for Selected Sets_ button. + +If you do this, one option is for you to download an Adobe PDF file. This file is something that you can read onscreen while you are not online. You can even print it off and take it to a tutoring center or your favorite coffee shop to work on. (Of course, you will need to eventually log back on to enter your answers.) + +Prove that you understand how this works by opening the PDF file for this Orientation assignment. Please do not waste paper by actually printing this Orientation assignment unless it is necessary. + +Do you understand this problem's content? + +[@$radio->buttons()@]* + +END_PGML + + +###################################### + +ANS( $radio->cmp() ); + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/PCCOrientationHeader.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/PCCOrientationHeader.pg new file mode 100644 index 0000000000..e4f5f67773 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/PCCOrientationHeader.pg @@ -0,0 +1,14 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGML.pl", +); + +BEGIN_PGML +This set of exercises is designed to orient you to WeBWorK. You will learn +how to enter answers to math problems, and you will learn how to use WeBWorK +feedback and tools to help you as you go. +END_PGML + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/parserOrientation.pl b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/parserOrientation.pl new file mode 100644 index 0000000000..5a847a8f08 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/parserOrientation.pl @@ -0,0 +1,626 @@ +#!/usr/local/bin/perl + +###################################################################### +# +# Macros used by the orientation problem set +# +###################################################################### + + +#loadMacros("PGcourse.pl"); + +# +# Special use of CARET to have it work in non-math mode +# +$CARET = MODES( + TeX => '\hbox{\texttt{\char94}}', + Latex2HTML => '^', + HTML => '^' +); + +# +# Functions to display student input and computer output +# (written as functions so that we change the style without +# recoding the problems themselves). +# +sub student { + my $message = shift; + MODES( + TeX => '\leavevmode\hbox{\texttt{'.$message.'}}', + Latex2HTML => + $bHTML.''.$eHTML.$message.$bHTML.''.$eHTML, + HTML => ''.$message.'' + ); +} + +sub computer { + my $message = shift; + MODES( + TeX => '\hbox{\texttt{'.$message.'}}', + Latex2HTML => + $bHTML.''.$eHTML.$message.$bHTML.''.$eHTML, + HTML => ''.$message.'' + ); +} + +# +# This prints things we need to fill in yet in red +# +sub moreWork { + my $message = shift; + MODES( + TeX => '{\sl ' . $message . '}', + Latex2HTML => $bHTML . '' . $eHTML . + $message . $bHTML . '' . $eHTML, + HTML => '' . $message . '' + ); +} + +# +# Temporary macros to mark comments in areas that we are +# working on. +# +$BCOMMENT = MODES( + TeX => '{\footnotesize\it', + Latex2HTML => $bHTML.'
    '.$eHTML, + HTML => '
    ' +); + +$ECOMMENT = MODES( + TeX => '}', + Latex2HTML => $bHTML.'
    '.$eHTML, + HTML => '
    ' +); + +# $BCOMMENT = MODES( +# TeX => '\iffalse', +# Latex2HTML => $bHTML.''.$eHTML, +# HTML => ' -->' +# ); + + +# +# Hack to get better spacing in HTML_tth math mode but without +# messing up the spacing in other modes. +# +$SP = MODES( + TeX => ' ', Latex2HTML => ' ', + HTML => ' ', HTML_tth => '\ ', + HTML_jsMath => ' ', HTML_dpng => ' ', +); + + +# +# Special table macros for questions that have +# displayed math expressions equal to an answer rule, +# with an accompanying explanation on a separate line. +# + +sub BeginExamples { + return "" if ($displayMode eq "TeX"); + BeginTable(@_); +} + +sub EndExamples { + return "" if ($displayMode eq "TeX"); + EndTable(); +} + +@ExampleDefaults = (ans_rule_len => 40, ans_rule_height => 1); + +sub BeginExample { + my $math = shift; + my $ans = shift; + my %options = (@ExampleDefaults, @_); + my ($cols,$rows) = ($options{ans_rule_len},$options{ans_rule_height}); + my $rule; + + if ($rows == 1) {$rule = ans_rule($cols)} + else {$rule = ans_box($rows,$cols)} + ANS($ans); + + # + # HTML_tth puts an unwanted
    at the beginning, + # and uses a centered table. Remove the
    and + # align the table to the right. + # + if ($displayMode eq "HTML_tth") { + $math = trimString(EV2('\['.$math.'\]')); + $math =~ s!
    !!; + $math =~ s!table align="center"!table align="right"!; + } elsif ($displayMode eq "HTML") { + $math = '\('.$math.'\)' + } elsif ($displayMode =~ m/^HTML/) { + $math = '\(\displaystyle '.$math.'\)' + } + + MODES( + TeX => "\n".'\['.$math.'=\hbox to 8em{'.$rule.'}\]', + Latex2HTML => $bHTML.''.$eHTML. + '\(\displaystyle '.$math.'\)'.$bHTML.' =  '. + ''.$eHTML.$rule.$bHTML.''. + ''.$eHTML, + HTML => + ''.$math.' =  '. + ''.$rule.'' + ); +} + +sub EndExample { + MODES( + TeX => "\n", + Latex2HTML => $bHTML.'

    '.$eHTML, + HTML => '

    ' + ); +} + +sub ExampleRule { + MODES( + TeX => '\par', + Latex2HTML => $bHTML.'
    '.$eHTML, + HTML => '
    ' + ); +} + +# +# Produce a TeX version and an answer checker for the formula +# +sub DisplayQA {my $f = shift; return (DMATH($f->TeX),$f->cmp)} +sub QA {my $f = shift; return ($f->TeX,$f->cmp)} + +################################################## +# +# Insert an image of an equation (but use the equation +# in TeX mode). +# + +sub MathIMG { + my ($img,$text,$tex) = @_; + my $useTeX = MODES(TeX => 1, Latex2HTML => 0, HTML => 0, HTML_tth => 0, HTML_dpng => 1); + return '\('.$tex.'\)' if $useTeX; + $img = alias($img); + return qq{$text}; +} + + +################################################## +# +# A simple grader that always returns a score of 1. +# This is used in the tutorial to give students +# credit for reading a problem (even if it doesn't +# ask any questions). +# +sub forgiving_grader { + my $rh_evaluated_answers = shift; + my $rh_problem_state = shift; + my %form_options = @_; + my %evaluated_answers = %{$rh_evaluated_answers}; + my %problem_state = %{$rh_problem_state}; + + my %problem_result = ( + score => 1, # always return 1 + errors => '', + type => 'forgiving_grader', + msg => '', + ); + + return(\%problem_result,\%problem_state) + if (!$form_options{answers_submitted}); + + $problem_state{recorded_score} = $problem_result{score}; + $problem_state{num_of_correct_ans}++; + + (\%problem_result, \%problem_state); +} + +################################################## +# +# Syntactic sugar to avoid ugly ~~& construct in PG. +# +sub install_forgiving_grader {install_problem_grader(\&forgiving_grader)} + +# +# Shorthand for WeBWorK +# +$WW = "WeBWorK"; + + +# +# Shorthands for entering and leaving rawhtml mode in +# LaTeX2HTML (since they are so commonly used). +# +$bHTML = '\begin{rawhtml}'; +$eHTML = '\end{rawhtml}'; + +# +# HTML(htmlcode) +# HTML(htmlcode,texcode) +# +# Insert $html in HTML mode or \begin{rawhtml}$html\end{rawhtml} in +# Latex2HTML mode. In TeX mode, insert nothing for the first form, and +# $tex for the second form. +# +sub HTML { + my ($html,$tex) = @_; + return('') unless (defined($html) && $html ne ''); + $tex = '' unless (defined($tex)); + MODES(TeX => $tex, Latex2HTML => $bHTML.$html.$eHTML, HTML => $html); +} + + +# +# Begin and end indented text +# + +$BBLOCKQUOTE = HTML('
    ','\par\bgroup\advance\leftskip by 2em '); +$EBLOCKQUOTE = HTML('
    ','\par\egroup '); + +# +# Start and stop centering +# +$BCENTER = HTML('
    ','\begin{center}'); +$ECENTER = HTML('
    ','\end{center}'); + + +# +# Begin and end mode +# +$BTT = HTML('','\texttt{'); +$ETT = HTML('','}'); + +# +# Begin and end mode +# +$BSMALL = HTML('','{\small '); +$ESMALL = HTML('','}'); + +# +# Remove extra space in bold in latex2html mode +# +$BBOLD = HTML('','{\bf '); +$EBOLD = HTML('','}'); + +# +# tth doesn't seem to understand \colon +# +$COLON = MODES(TeX=>'\colon ',HTML=>':', HTML_dpng => '\colon '); + +# +# Alternatives to the standard WW versions of these +# +$LT = $LTS; +$GT = $GTS; + +$LE = $LTE; +$GE = $GTE; + +# +# Common math sets +# +$R = MODES(TeX => '{\bf R}', HTML_tth => '{\bf R}', HTML => 'R'); +$Z = MODES(TeX => '{\bf Z}', HTML_tth => '{\bf Z}', HTML => 'Z'); +$N = MODES(TeX => '{\bf N}', HTML_tth => '{\bf N}', HTML => 'N'); +$Q = MODES(TeX => '{\bf Q}', HTML_tth => '{\bf Q}', HTML => 'Q'); +$C = MODES(TeX => '{\bf C}', HTML_tth => '{\bf C}', HTML => 'C'); + +# +# Superscripts and subscript (mostly for if you want answer +# rules in these positions). +# +$BSUP = HTML('','$^{'); +$ESUP = HTML('','}$'); + +$BSUB = HTML('','$_{'); +$ESUB = HTML('','}$'); + +# +# Browser-only BR +# +$BBR = HTML('
    '); + +# +# Broser-only \displaystyle +# +$DISPLAY = MODES(TeX => '', Latex2HTML => '\displaystyle ', + HTML_tth => '\displaystyle ', HTML => ''); + + +# +# Provides a title to the problem +# +sub Title { + my $title = shift; + + TEXT(MODES( + TeX => "\\par\\begin{centering}{\\bf $title}\\par\\end{centering}\\nobreak\n", + Latex2HTML => $bHTML.'

    '.$title.'

    '.$eHTML, + HTML => '

    '.$title.'

    ' + )); +} + + +sub BeginList { + my $LIST = 'OL'; + $LIST = shift if (uc($_[0]) eq "OL" or uc($_[0]) eq "UL"); + my $enum = ($LIST eq 'OL' ? "enumerate" : "itemize"); + my %options = @_; + $LIST .= ' TYPE="'.$options{type}.'"' if defined($options{type}); + $LIST .= ' START="'.$options{value}.'"' if defined($options{value}); + $LIST = "<$LIST>"; + my $tex = ""; my $type = ""; my $top = ""; + $tex .= "\\parindent=0pt \\parskip=.75\\baselineskip\n" if $options{tex_par}; + $tex .= "\\setcounter{enumi}{".($options{value}-1)."}" if defined($options{value}) && $LIST eq 'OL'; + $type = "[\\quad $options{type}.]" if defined($options{type}) && $LIST eq 'OL'; + $top = '\vskip-\parskip\hrule height 0pt' if $options{noTopSkip}; + + MODES( + TeX => "\\par${top}{\\parskip=0pt\\begin{$enum}$type\n$tex", + Latex2HTML => $bHTML.$LIST.$eHTML, + HTML => $LIST."\n" + ); +} + +# +# Usage: EndList(type) +# +# where type is the list type (and must match the BeginList type). +# +sub EndList { + my $LIST = shift; $LIST = 'OL' unless defined $LIST; + my $enum = ($LIST eq 'OL' ? "enumerate" : "itemize"); + $LIST = ""; + MODES( + TeX => "\\end{$enum}}", + Latex2HTML => $bHTML.$LIST.$eHTML, + HTML => $LIST."\n" + ); +} + +# +# Syntactic sugar for making lists of paragraphs +# +sub BeginParList { + my $LIST = 'OL'; + $LIST = shift if (uc($_[0]) eq "OL" or uc($_[0]) eq "UL"); + BeginList($LIST,tex_par=>1,@_); +} + +sub EndParList {EndList(@_)}; + + +# +# Use $ITEM to introduce a new list item +# +$ITEM = MODES( + TeX => '\item\ignorespaces ', + Latex2HTML => $bHTML.'
  • '.$eHTML, + HTML => "
  • " +); + +# +# This is a hack for when you want MSIE to handle +# space between list items properly +# +$ITEMSEP = MODES( + TeX => '\par\vskip-\parskip\vskip\baselineskip ', + Latex2HTML => $bHTML."

    ".$eHTML, + HTML => "

    " +); + + +sub ColumnTable { + my $col1 = shift; my $col2 = shift; + my %options = (indent => 0, separation => 50, valign => "MIDDLE", @_); + my ($ind,$sep) = ($options{"indent"},$options{"separation"}); + my $valign = $options{"valign"}; + + my ($bhtml,$ehtml) = ('\begin{rawhtml}','\end{rawhtml}'); + ($bhtml,$ehtml) = ('','') unless ($displayMode eq "Latex2HTML"); + + my $HTMLtable = qq { + $bhtml +
     $ehtml + $col1 + $bhtml $ehtml + $col2 + $bhtml
    $ehtml + }; + + MODES( + TeX => '\par\medskip\hbox{\qquad\vtop{'. + '\advance\hsize by -3em '.$col1.'}}'. + '\medskip\hbox{\qquad\vtop{'. + '\advance\hsize by -3em '.$col2.'}}\medskip', + Latex2HTML => $HTMLtable, + HTML => $HTMLtable + ); +} + +# +# Use columns for a match-list output +# +# Usage: ColumnMatchTable($ml,options) +# +# where $ml is a math list reference and options are those +# allowed for ColumnTable above. +# +sub ColumnMatchTable { + my $ml = shift; + + ColumnTable($ml->print_q,$ml->print_a,@_); +} + + + +# +# Command for tables with no borders. +# +# Usage: BeginTable(options); +# +# Options are taken from: +# +# border => n value for BORDER attribute (default 0) +# spacing => n value for CELLSPACING attribute (default 0) +# padding => n value for CELLPADDING attribute (default 0) +# tex_spacing => dimen value for spacing between columns in TeX +# (e.g, tex_spacing => 2em) (default 1em) +# tex_border => dimen value for left- and right border in TeX (0pt) +# center => 0 or 1 center table or not (default 1) +# +sub BeginTable { + my %options = (border => 0, padding => 0, spacing => 0, center => 1, + tex_spacing => "1em", tex_border => "0pt", @_); + my ($bd,$pd,$sp) = ($options{border},$options{padding},$options{spacing}); + my ($tsp,$tbd) = ($options{tex_spacing},$options{tex_border}); + my ($center,$tcenter) = (' ALIGN="CENTER"','\centerline'); + ($center,$tcenter) = ('','') if (!$options{center}); + my $table = + qq{}; + + MODES( + TeX => '\par\medskip'.$tcenter.'{\kern '.$tbd. + '\vbox{\halign{#\hfil&&\kern '.$tsp.' #\hfil', + Latex2HTML => $bHTML.$table.$eHTML."\n", + HTML => $table."\n" + ); +} + +# +# Usage: EndTable(options) +# +# where options are taken from: +# +# tex_border => dimen extra vertical space in TeX mode (default 0pt) +# +sub EndTable { + my %options = (tex_border => "0pt", @_); + my $tbd = $options{tex_border}; + MODES( + TeX => '\cr}}\kern '.$tbd.'}\medskip'."\n", + Latex2HTML => $bHTML.'
    '.$eHTML."\n", + HTML => ''."\n" + ); +} + +# +# Creates a row in the table +# +# Usage: Row([item1,item2,...],options); +# +# Each item appears as a separate entry in the table. +# +# Options control how the row is displayed: +# +# indent => num Specifies size of blank column on the left +# (default: indent => 0) +# +# separation => num Specifies separation of columns +# (default: spearation => 30) +# +# tex_vspace => "dimen" Specifies additional vertical spacing for TeX +# +# align => "type" Specifies alignment of initial column +# (default: align => "LEFT") +# +# valign => "type" Specified vertical alignment of row +# (default: valign => "MIDDLE") +# +sub Row { + my $rowref = shift; my @row = @{$rowref}; + my %options = ( + indent => 0, separation => 30, + align => "LEFT", valign => "MIDDLE", + @_ + ); + my ($cind,$csep) = ($options{indent},$options{separation}); + my ($align,$valign) = ($options{align},$options{valign}); + my $sep = ' '; $sep = '' if ($csep < 1); + my $ind = ' '; $ind = '' if ($cind < 1); + my $fill = ''; + $fill = '\hfil' if (uc($align) eq "CENTER"); + $fill = '\hfill' if (uc($align) eq "RIGHT"); + my $vspace = ''; + $vspace = '\noalign{\vskip '.$options{tex_vspace}.'}' if $options{tex_vspace}; + + MODES( + TeX => '\cr'.$vspace."\n". $fill . join('& ',@row), + Latex2HTML => + $bHTML."$ind".$eHTML . + join($bHTML."$sep".$eHTML,@row) . + $bHTML.''.$eHTML."\n", + HTML => "$ind" . + join("$sep",@row) . ''."\n" + ); +} + + +sub TableSpace { + my $rsep = shift; + my $tsep = shift; + $rsep = $tsep if (defined($tsep) && $main::displayMode eq "TeX"); + return "" if ($rsep < 1); + MODES( + TeX => '\vadjust{\kern '.$rsep.'pt}' . "\n", + Latex2HTML => + $bHTML.''.$eHTML."\n", + HTML => ''."\n", + ); +} + + + +# +# A horizontal rule within a table. (Could have been a variable, +# but all the other table commands are subroutines, so kept it +# one to be consistent.) +# +sub TableLine { + MODES( + TeX => '\vadjust{\kern2pt\hrule\kern2pt}', + Latex2HTML => $bHTML. + '
    '. + $eHTML."\n", + HTML =>'
    '."\n" + ); +} + + +sub Image { + my $image = shift; my $ilink; + my %options = ( + size => [150,150], tex_size => 200, + link => 0, align => "BOTTOM", tex_center => 0, @_); + my ($w,$h) = @{$options{size}}; + my ($ratio,$link) = ($options{tex_size}*(.001),$options{link}); + my ($border,$align) = ($options{border},$options{align}); + my ($tcenter) = $options{tex_center}; + my $HTML; my $TeX; + ($image,$ilink) = @{$image} if (ref($image) eq "ARRAY"); + $image = alias(insertGraph($image)) if (ref($image) eq "WWPlot"); + $image = alias($image) unless ($image =~ m!^/!i); + if ($ilink) { + $ilink = alias(insertGraph($ilink)) if (ref($ilink) eq "WWPlot"); + $ilink = alias($ilink) unless ($ilink =~ m!^/!i); + } else {$ilink = $image} + $border = (($link || $ilink ne $image)? 2: 1) unless defined($border); + $HTML = ''; + $HTML = ''.$HTML.'' if $link or $ilink ne $image; + $TeX = '\includegraphics[width='.$ratio.'\linewidth]{'.$image.'}'; + $TeX = '\centerline{'.$TeX.'}' if $tcenter; + MODES( + TeX => $TeX."\n", + Latex2HTML => $bHTML.$HTML.$eHTML, + HTML => $HTML + ); +} + + + +1; diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob01.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob01.pg new file mode 100644 index 0000000000..c1ea0a4ceb --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob01.pg @@ -0,0 +1,67 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", + + +); + + +TEXT(beginproblem); + +Title("Understanding $WW Problem Pages"); + +############################################## +BEGIN_TEXT + +The $WW screen is divided into several areas, each used for a +different purpose. You will need to understand these +in order to use $WW effectively. +$PAR + +At the upper left are the navigation buttons that allow you to move +from problem to problem. The ${LQ}Next$RQ and ${LQ}Previous$RQ +buttons, naturally, send you to the next and previous problems. The +${LQ}Prob. List$RQ button takes you back to the opening +page for the homework set (the one that lists all the problems and +gives the instructions for the homework set). +$PAR + +The area below the navigation buttons is where $WW tells you about +your score for the current problem. (It will be shown on a grey +backgound to help make it stand out; you will see this later.) When you have submitted your answers, this is where you will be given information about what +answers you got right and wrong. This area also shows you how many points a problem is worth. +$PAR + +The main part of the page is the text of the problem you are trying to +answer, including blank boxes for you to enter your answers. $BR For example, 2 + 2 = $SPACE \{ans_rule(2)\} +$PAR + +Below the large white text area that you are reading right now is a message area where you may be informed about how partial credit is handled in multi-part problems. Other information might also appear there, such as a message that the due date is passed or that answers are available. +$PAR + +In the panel at the left, instead of the list of homework sets, you +now have a list of the problems within this assignment. You can go to +any problem just by clicking on it. The checkboxes at the bottom of +the panel are discussed in the next problem. +$PAR + +The buttons at the bottom of the screen, including the ${LQ}Submit +Answers$RQ button, are discussed in the next problem. At this point, +you can get credit for Problem 1 by typing $BBOLD 4$EBOLD into the answer box above, and pressing the ${LQ}Submit Answers$RQ button at the bottom of the page, and then pressing the ${LQ}Next$RQ button at the +top of the screen to go on to the next problem. + +END_TEXT + + +install_forgiving_grader(); +$showPartialCorrectAnswers = 1; + +############################################## +ANS(Compute(4)->cmp()); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob02.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob02.pg new file mode 100644 index 0000000000..0199dcc1b2 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob02.pg @@ -0,0 +1,98 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + + +TEXT(beginproblem); + +Title("Controlling $WW"); + +############################################## + +BEGIN_TEXT + +The buttons at the bottom of the screen are what cause $WW to process +your answers. Nothing that you type will have any effect until you +press one of these buttons. +$PAR + +The ${LQ}Submit Answers$RQ button causes $WW to check your answers and +report your score for the problem. Usually, your instructor will have granted you some number of attempts (maybe even unlimited). Each time you press the ${LQ}Submit Answers$RQ button, you use up one of your attempts. If the due date is passed and the answers are available, you can click the ${LQ}Show +Correct Answers$RQ button before pressing ${LQ}Submit$RQ. If you do, the correct answer(s) will be displayed in the answer area at the top of the screen along with the answers you have provided. +$PAR + +If you have typed in a complicated answer, or are being told your +answer is incorrect when you think it's right, you may want to use the +${LQ}Preview Answer$RQ button. This will make $WW display what $BITALIC it thinks $EITALIC you have entered, without using up an attempt. This can be used to help spot errors in your typing, and verify that $WW understands your answer the way you intend it to. (This is discussed further in a later problem.) +$PAR + +At the bottom panel on the left is a box that allows you to +change how the problem is displayed. The ${LQ}math${RQ} within the problem +can be printed on the screen in many different ways. Here, we'll discuss three of them: + +\{BeginParList("UL")\} + +$ITEM +${LQ}images${RQ} mode is the default choice (what $WW uses unless you tell +it otherwise). It produces the accurate mathematical notation, +with the disadvantages of being slightly slower, and not printing well +if you want to print out a single problem. +$ITEMSEP + +$ITEM +${LQ}formatted-text${RQ} mode produces results quickly, but more +complicated mathematics may be difficult to read in this +mode. For example, some fractions are not easy to read +in formatted-text mode. +$ITEMSEP + +$ITEM +${LQ}jsMath${RQ} mode uses a JavaScript program and Cascading Style +Sheets (CSS) to display the mathematics. This produces the nicest looking results, and is particularly nice if you need to change the size of the fonts +in your browser or wish to print out a single problem. For best +results, however, you should download and install some fonts that +jsMath uses; there is a link to the fonts on the jsMath control panel, +which you can activate using the small jsMath button that will appear +at the lower right of the screen when you activate this mode. The +first problem you view using jsMath may take a little longer to +appear, as the JavaScript program is being loaded into your browser, +but things should run faster after that. + +\{EndParList("UL")\} +$PAR + +Choose whichever mode is most comfortable for you. You can always +select a different mode if a particular problem needs it. Here is a +sample of some simple mathematics, \(x^2 + 3\), and a more complicated +expression, \(\frac{x(1-x)}{2x + 1}\). Try changing the display mode +by clicking the ${LQ}formatted-text$RQ or ${LQ}jsMath${RQ} +button and then pressing the ${LQ}Apply Options${RQ} button to cause +the page to be reformatted. Look how the math expressions change. Then change the display mode to back to +${LQ}images$RQ mode for the rest of the homework set. +$PAR + +The ${LQ}Show saved answers${RQ} checkbox tells whether you +want $WW to fill in the answer blanks with your previous answers or +not. (If you like, you can test this out on the next problem, since +there are no answer blanks in this one.) +$PAR + +You are now ready to learn how to enter answers into $WW. Press the +${LQ}Submit Answers${RQ} button to get credit for this problem, and +then press the ${LQ}Next$RQ button at the top of the page to go on to +the next one. + +END_TEXT + +install_forgiving_grader(); +$showPartialCorrectAnswers = 1; + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob03.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob03.pg new file mode 100644 index 0000000000..9be16d66eb --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob03.pg @@ -0,0 +1,140 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedNumeric.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Typing in Your Answers"); + +############################################## + +BEGIN_TEXT + +Here are the standard symbols that $WW, along with most other +computer software, uses for arithmetic operations: +$PAR + +\{ + BeginTable(). + Row([$BBOLD.'Symbol'.$EBOLD, + $BBOLD.'Meaning'.$EBOLD, + $BBOLD.'Example'.$EBOLD]). + TableLine(). + Row([computer("+"),'Addition',computer("3+4 = 7")],align=>"CENTER"). + Row([computer("-"),'Subtraction',computer("3-4 = -1")],align=>"CENTER"). + Row([computer("*"),'Multiplication',computer("3*4 = 12")],align=>"CENTER"). + Row([computer("/"),'Division',computer("3/4 = .75")],align=>"CENTER"). + Row([computer($CARET)." or ".computer("**"),'Exponentiation', + computer("3${CARET}4 = 81")." or ". + computer("3**4 = 81")],align=>"CENTER"). + TableLine(). + EndTable() +\} +$PAR + +END_TEXT + +################################################## + +$a = non_zero_random(-5,5,1); +$b = non_zero_random(-5,5,1); +$c = non_zero_random(-3,3,1) * 2; +$d = non_zero_random(-5,5,1); + +BEGIN_TEXT + +Sometimes $WW will insist that you calculate the value of an +expression as a single number before you enter it. For example, +calculate the value of \($c($a - $b) - ($c - $d)\) and enter it in +the following blank. +(Here you have to enter a single integer; the question is testing +whether you can do the operations correctly.) + +$PAR +$BBLOCKQUOTE +\($c($a - $b) - ($c - $d)\) = \{ans_rule(10)\} +$EBLOCKQUOTE +$PAR +END_TEXT + +Context("LimitedNumeric"); +$ans = $c*($a - $b) - ($c - $d); +ANS(Real($ans)->cmp); + +################################################## + +BEGIN_TEXT + +Sometimes you will not have to simplify your answer, and can let +$WW do this for you. The following blanks are all expecting +the value 16. Try entering it several different ways, such as +\{student "7+9"\}, \{student "18-2"\}, \{student "8*2"\}, +\{student "32/2"\}, and \{student "4${CARET}2"\}. Note: pressing +the ${LQ}Tab$RQ key on your keyboard will move you from one answer +box to the next. + +$PAR +$BBLOCKQUOTE +16 = \{ans_rule(8)\} or +\{ans_rule(8)\} or +\{ans_rule(8)\} or +\{ans_rule(8)\} or +\{ans_rule(8)\} +$EBLOCKQUOTE +$PAR + +END_TEXT + +Context("Numeric"); + +ANS( + Real(16)->cmp, + Real(16)->cmp, + Real(16)->cmp, + Real(16)->cmp, + Real(16)->cmp, +); + +################################################## + +BEGIN_TEXT + +$WW also understands that quantities written next to each other are +supposed to be multiplied. For example, you can enter \{student +"(9)(7)"\} instead of \{student "63"\}. Most often this is used when +one quantity is a number and the other a variable or function. For +instance, \{computer "2x"\} means \{computer "2*x"\}. The following blank is +expecting the value 100; try entering it as +\{student("4(30-5)")\}. + +$PAR +$BBLOCKQUOTE +100 = \{ans_rule(10)\} +$EBLOCKQUOTE +$PAR +END_TEXT + +ANS(Real(100)->cmp); + +################################################## + +BEGIN_TEXT + +${BITALIC}When you are ready, don't forget to press the ${LQ}Submit Answers${RQ} +button to ask $WW to check your work. Once you get the answers +correct, press ${LQ}Next${RQ} to go on.${EITALIC} + +END_TEXT + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob04.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob04.pg new file mode 100644 index 0000000000..4c369db42e --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob04.pg @@ -0,0 +1,99 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "alignedChoice.pl", + "contextLimitedNumeric.pl", + "parserOrientation.pl", + "PGcourse.pl", + "contextFraction.pl", + +); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Rules of Precedence"); + +############################################## + +BEGIN_TEXT + +The rules of precedence determine the order in which the mathematical +operations are performed by $WW. It is essential for you to understand +these so that you know how $WW interprets what you type in. If there +are no parentheses and no functions (such as \{computer "sin"\} or +\{computer "log"\}), then $WW computes the value of your answer by +dealing with exponents first, followed by multiplication and division +(from left to right), and finally addition and subtraction +(from left to right). +$PAR + +If there are expressions in grouping symbols, those expressions are +simplified first. We'll talk about functions (and give a more +complete list of rules) in a later problem. + +$PAR +Examples: +\{BeginList("UL")\} +$ITEM +\{student "4*3/6 = 12/6 = 2"\} (multiplications and divisions are done +from left to right) +$ITEM +\{student "4*3/6-2*7+10 = 2 - 14 + 10 = -2"\} (multiplications and divisions are done +before additions and subtractions) +$ITEM +\{student "12/3/2 = 4/2 = 2"\} (multiplications and divisions are done +from left to right) +$ITEM +\{student "12/(3/2) = 12/1.5 = 8"\} +(expressions inside parentheses are calculated before anything else) +$ITEM +\{student "2*4${CARET}2 = 2*16 = 32"\} (exponentiation is done before multiplication), +so \{student "2*4${CARET}2 - 3*4 = 2*16 - 3*4 = 32 - 12 = 20"\}. +\{EndList("UL")\} +$PAR + +To practice these rules, completely simplify the following +expressions. Because the point of this problem is for you to do the +numerical calculations correctly, $WW will only accept sufficiently +accurate decimal numbers or fractions as the answers to these problems. +$PAR + +END_TEXT + +$a = random(1,4,1); +$b = random(2,6,1); +$c = random(3,6,1); +$d = random(2,25,1); +$al = new_aligned_list(equals => 1); + +Context("LimitedFraction"); +$al->qa( + computer("$a+$b*$c"), Real($a+($b*$c))->cmp, +# computer("($a+$b)*$c"), Real(($a+$b)*$c)->cmp, +# computer("($a+$b)/$c"), Real(($a+$b)/$c)->cmp, +# computer("$a+$b/$c"), Real($a+($b/$c))->cmp, + computer("$a/$b*$c"), Fraction(($a/$b)*$c)->cmp, +# computer("$a/($b*$c)"), Real($a/($b*$c))->cmp, +# computer("$a/$b/$c"), Real(($a/$b)/$c)->cmp, + computer("3*$b+$d-$a/5"), Fraction((3*$b)-(($a/5))+$d)->cmp, + computer("2${CARET}$b+1"), Real((2**$b)+1)->cmp, + computer("2${CARET}($b+1)"), Real(2**($b+1))->cmp, +); + +BEGIN_TEXT +$BBLOCKQUOTE +\{$al->print_q\} +$EBLOCKQUOTE + +END_TEXT + +ANS($al->correct_ans); + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-a.gif b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-a.gif new file mode 100644 index 0000000000..d32ee11b3b Binary files /dev/null and b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-a.gif differ diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-b.gif b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-b.gif new file mode 100644 index 0000000000..b074b10281 Binary files /dev/null and b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-b.gif differ diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-c.gif b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-c.gif new file mode 100644 index 0000000000..71062c6f06 Binary files /dev/null and b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05-c.gif differ diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05.pg new file mode 100644 index 0000000000..a076b0263f --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob05/prob05.pg @@ -0,0 +1,125 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "alignedChoice.pl", + "../parserOrientation.pl", + "PGcourse.pl", +); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Common Errors to Avoid"); + +############################################## + +BEGIN_TEXT + +Many of the answers you enter into $WW will be expressions +that involve variables. Here are some important things to know. + +$PAR + +\{BeginParList("UL")\} + +$ITEM +It matters what letter you use. For example, if you are asked for a +function using the variable \(x\), then it won't work to enter the +function with the variable \(t\). Also, $WW considers upper- and +lower-case letters to be different, so don't use the capital letter +\(X\) in place of the lower-case letter \( x\). +The following blank is expecting the +expression \(x^3\), which you would enter as \{student "x${CARET}3"\} or +\{student "x**3"\}. Instead, try entering \{student "t${CARET}3"\} or \{student "X${CARET}3"\} and submitting your answer, just to see what happens. + +$PAR +$BBLOCKQUOTE +\{ans_rule(10)\} +$EBLOCKQUOTE +$PAR + +You should get an error message informing you that \{computer "t"\} +is not defined in this context. This tells you that $WW did not receive the +correct variable and doesn't know how to check your answer. Now enter +\{student "x${CARET}3"\} and resubmit to get credit for this part of +the problem. + +END_TEXT + +ANS(Formula("x^3")->cmp); + +################################################## + +$IMGA = MathIMG("prob05-a.gif","1/x+1","1/x+1"); +$IMGB = MathIMG("prob05-b.gif","1/(x+1)","\frac{1}{x+1}"); +$IMGC = MathIMG("prob05-c.gif","(1/x)+1","\frac{1}{x} + 1"); + +BEGIN_TEXT + +$ITEM +$WW requires that you think about how you present your answer. As we just saw, you need to be careful about the variables that you use. You must also be careful about how the order of operations apply to your answers. Often, this involves using parentheses appropriately. + +$PAR + +For example, you might intend to submit $IMGB, and write $IMGA on your paper. But that is actually incorrect. The expression $IMGA means $IMGC, +according to the rules of precedence. $WW will force you to be exact +with how you think and what you write. If you want +to enter something that means $IMGB, you must write \{student +"1/(x+1)"\}. + +$PAR + +This precision is important in your written work too. If the answer was $IMGB and you wrote $IMGA on paper or on a test, it is not correct. So the precision that $WW is demanding of you will help you outside of $WW. + +$PAR +END_TEXT + +################################################## + +BEGIN_TEXT + +\{EndParList("UL")\} + +$PAR +$HR +$PAR + +Now enter the following expressions: +$PAR +END_TEXT + +$al = new_aligned_list( + equals => 1, ans_rule_len => 30, + tex_spacing => "5pt", spacing => 10 +); + +Context("Numeric")->variables->are(t=>'Real'); $t = Formula("t"); +Context("Numeric")->variables->are(y=>'Real'); $y = Formula("y"); +Context("Numeric")->variables->are(x=>'Real'); $x = Formula("x"); + +$al->qa( + DisplayQA($t/(2*$t+6)), +# DisplayQA(2*$y*($y**2-$y+1)), +# DisplayQA(1/$x**2 - 3*(1/$x)), + DisplayQA(1/(2*($x-5))), + DisplayQA((2*$x-3)**4), +); + +BEGIN_TEXT + +$BBLOCKQUOTE +\{$al->print_q\} +$EBLOCKQUOTE + +END_TEXT + +ANS($al->correct_ans); + + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob06.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob06.pg new file mode 100644 index 0000000000..f959ef0a94 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob06.pg @@ -0,0 +1,131 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + +$showPartialCorrectAnswers = 1; + +Context("Numeric")->variables->are(y=>'Real'); $y = Formula('y'); +Context("Numeric")->variables->are(x=>'Real'); $x = Formula('x'); +Context()->flags->set(limits=>[0,2]); + +TEXT(beginproblem); + +Title("Using Parentheses Effectively"); + +############################################## + +BEGIN_TEXT + +${BCENTER} ${BBOLD} If you are in a math course numbered 70 or below, you might not need the information on this page. Feel free to move to the next page.${EBOLD} ${ECENTER} + +$PAR + +One of the hardest parts about using parentheses is making sure that +they match up correctly. Here are a couple of hints to help you with +this: + +$PAR +END_TEXT + +$BRACES = HTML('{}','\char123\char125'); + +BEGIN_TEXT + +\{BeginParList("UL")\} + +$ITEM +Several types of parentheses are allowed: \{student "()"\}, +\{student "[]"\}, and \{student $BRACES\}. When you need to nest +parentheses inside other parentheses, try using a different type for +each to make it easier to see which ones match up. +$ITEMSEP + +$ITEM +When you type a left parenthesis, type the corresponding right +parenthesis at the same time, then position your cursor between them and +type the expression that goes inside. This can save you a +lot of time hunting for mismatched parentheses. +$ITEMSEP + +$ITEM +When you have a complicated answer, type a template for +the structure of your result first. For example, suppose that you are +planning to enter the fraction +\[\frac{2x^2-5}{(x+1)(3x^{3x} - 22)}.\] +A good way to start would be to type in \{student "()/[()*()]"\}. +This shows a template of one number divided by the product of two +other numbers. (Note that \{student "()/()*()"\} would not be a good +way to start; do you see why?) Now when you fill in the expressions, you +will be sure your parentheses balance correctly. +$PAR + +Although $WW understands that numbers written next to each other are +meant to be multiplied (so you do not have to use \{student "*"\} to +indicate multiplication if you don't want to), it is often useful for +you to include the \{student "*"\} anyway, as it helps you keep track +of the structure of your answer. +$PAR + +$ITEM +To see how $WW is interpreting what you type, enter your answer and +then click the ${LQ}Preview Answers$RQ button, which is next to the +${LQ}Submit Answers$RQ button below. $WW will show you what $BITALIC it thinks$EITALIC you entered. (The preview appears in your answer area at the top of the page.) Previewing your answer $BITALIC does not $EITALIC submit it for credit or use up an attempt; that only +happens when you press the ${LQ}Submit Answers$RQ button. +$ITEMSEP + +$ITEM +When division or exponentiation are involved, it is a good idea to +use parentheses even in simple situations, rather than relying on the +order of operations. For example, 1/2x and (1/2)x both mean the same +thing (first divide 1 by 2, then multiply the result by x), but the +second makes it easier to see what is going on. Likewise, use +parentheses to clarify expressions involving exponentiation. Type +\{student "(e${CARET}x)${CARET}2"\} if you mean \((e^x)^2\), and type +\{student "e${CARET}(x${CARET}2)"\} if you mean \(e^{(x^2)}\). + +\{EndParList("UL")\} + +$PAR +$HR +$PAR + +Now enter the following expressions: + +$BBLOCKQUOTE + +\{@ExampleDefaults = (ans_rule_len => 50, ans_rule_height => 1); + BeginExamples\} + +\{BeginExample(QA(($x**(2*$x-1))/(($x**2-$x)*(3*$x+5))))\} +Start with the template \{student "[x${CARET}()]/[()*()]"\}. +\{EndExample\} +\{ExampleRule\} + +\{BeginExample(QA((($y+3)*($y**3+$y+1))/((2*$y**2-2)*(5*$y+4))))\} +Start by putting in an appropriate template. This means that you +should begin by looking at the function and thinking about how many +pieces are used to construct it and how those pieces are related. +Once you have entered your answer, try using the ${LQ}Preview$RQ button +to see how $WW is interpreting your answer. +\{EndExample\} +\{ExampleRule\} + +\{BeginExample(QA((($x+1)/($x-2))**4))\} +Start by putting in an appropriate template. +\{EndExample\} + +\{EndExamples\} + +$EBLOCKQUOTE + +END_TEXT + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob07.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob07.pg new file mode 100644 index 0000000000..fad9fc9b6b --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob07.pg @@ -0,0 +1,135 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "alignedChoice.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Constants and Functions in $WW"); + +############################################## + +BEGIN_TEXT + +$WW knows the value of \(\pi\), which you can enter as \{student +"pi"\}, and the value of \(e\) (the base of the natural logarithm, +\(e\approx 2.71828\)), which you can enter simply as the letter +\{student "e"\}. This answer blank is expecting the area formula for a circle, which is \(\pi r^2\). Try it: $SPACE \(A=\) \{ans_rule(8) \}. +END_TEXT +Context()->variables->add(r=>'Real'); +ANS(Compute("pi r^2")->cmp); +BEGIN_TEXT +$PAR + + +$WW also understands many standard functions, like square root. Here +is a partial list. Notice that function names use lower-case +letters. Capitalizing might lead to an error message. + +\{BeginParList("UL")\} + +$ITEM +The square root \(\sqrt{\ } \) is represented by \{student +"sqrt(x)"\}. Try entering the square root of seven: \{ans_rule(10) \}. +END_TEXT +ANS(Compute("sqrt(7)")->cmp); +BEGIN_TEXT +$ITEMSEP + +${BCENTER} ${BBOLD} If you are in a math course numbered 95 or below, you might not need the information on the rest of this page. Feel free to move on to the next page.${EBOLD} ${ECENTER} +$ITEMSEP + +$ITEM +$WW knows about \{student "sin(x)"\}, \{student "cos(x)"\}, \{student +"tan(x)"\}, \{student "arcsin(x)"\}, \{student "arccos(x)"\}, +\{student "arctan(x)"\} and the other trigonometric functions and their +inverses. $WW ${BITALIC}always$EITALIC uses radian mode for these +functions. $WW will evaluate trigonometric functions for you in many situations. For example, the following blank is expecting the value \(-1\). +Since \(\cos(\pi) = -1\), you can enter \{student "cos(pi)"\}. Try it: \{ans_rule(10)\} \(= -1\) + +$PAR + +END_TEXT + +ANS(Real(-1)->cmp); + +################################################## + +BEGIN_TEXT + + +$ITEM +The function \{student "ln(x)"\} means the natural logarithm of \(x\) (the logarithm with base \(e\)). In $WW, \{student "log(x)"\} $BITALIC also$EITALIC means the natural logarithm. Use \{student "log10(x)"\} for the base 10 +logarithm of \(x\). +$ITEMSEP + +$ITEM +The exponential function with base \(e\) can be entered as +\{student "e${CARET}x"\} or \{student "exp(x)"\}. The second method +is convenient if you have a long, complicated exponent. +$ITEMSEP + +$ITEM +The absolute value function, \(|x|\), should be entered as +\{student "|x|"\} or \{student "abs(x)"\}. +$ITEMSEP + +$ITEM +The inverse sine function, \(\sin${CARET}{-1}(x)\), can be written as +\{student "arcsin(x)"\} or \{student "asin(x)"\} or \{student "sin${CARET}(-1)(x)"\} +in $WW. Note that this is ${BITALIC}not$EITALIC the same as +\{student "(sin(x))${CARET}(-1)"\}, which means \(\frac{1}{\sin(x)}\). +The other inverse functions are handled similarly. + +\{EndParList("UL")\} + +$PAR +$HR +$PAR + +Now enter the following expressions: +$PAR +END_TEXT + +$al = new_aligned_list( + equals => 1, + ans_rule_len => 40, + tex_spacing => "5pt", + spacing => 10, +); + +Context("Numeric")->variables->are(t=>'Real'); $t = Formula('t'); +Context("Numeric")->variables->are(y=>'Real'); $y = Formula('y'); +Context("Numeric")->variables->are(x=>'Real'); $x = Formula('x'); +Context()->flags->set(limits=>[-2,10]); + +$al->qa( +# DisplayQA(sqrt($y**2+1)), +# DisplayQA(sin(3*$x+1)), + DisplayQA(1/tan($x)), + DisplayQA(asin($t+1)->with(limits=>[-2,0])), + DisplayQA((sin($x)-cos($x))/sqrt(2*$x-7)) +); + +BEGIN_TEXT + +$BBLOCKQUOTE +\{$al->print_q\} +$EBLOCKQUOTE + +END_TEXT + +ANS($al->correct_ans); + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob08.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob08.pg new file mode 100644 index 0000000000..5b0d6dbe5c --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob08.pg @@ -0,0 +1,155 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + +Context("Numeric")->variables->are(y=>'Real'); $y = Formula('y'); +Context("Numeric")->variables->are(x=>'Real'); $x = Formula('x'); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Rules of Precedence (Again)"); + +############################################## + +$Explanation = "${BITALIC}Explanation${EITALIC}"; +$Moral = "${BITALIC}Moral${EITALIC}"; + +BEGIN_TEXT +${BCENTER} ${BBOLD} If you are in a math course numbered 95 or below, you might not need the information on this page. Feel free to move on to the next page.${EBOLD} ${ECENTER} +$PAR + +At this point, we can give the complete rules of precedence for +how $WW computes the value of a mathematical formula. The operations +are handled in the following order: +$PAR + +\{BeginList\} +$ITEM Evaluate expressions within parentheses. +$ITEM Evaluate functions such as \{student "sin(x)"\}, +\{student "cos(x)"\}, \{student "log(x)"\}, \{student "sqrt(x)"\}. +$ITEM Perform exponentiation (from right to left). +$ITEM Perform multiplication and division, (from left to right). +$ITEM Perform addition and subtraction, (from left to right). +\{EndList\} +$PAR + +This can get a little subtle, so be careful. The following are some +typical traps for $WW users. +$PAR + +\{BeginParList("UL")\} + +$ITEM +$WW interprets \{student "sin 2x"\} to mean \((\sin${SP}2)*x\) +$PAR + +$Explanation: Rule 2 tells you that $WW does evaluation of functions +(like \{student "sin"\}) before multiplication. Thus $WW first +computes \(\sin${SP}2\), and then multiplies the result by \(x\). +$PAR + +$Moral: You must type \{student "sin(2x)"\} for the sine of \(2x\), +even though we often write it as \(\sin${SP}2x\). +Get in the habit of using parentheses for all your trigonometric +functions. +$PAR + +$PAR +$BBLOCKQUOTE +The cosine of \(5x\) is entered as \{ans_rule(15)\}. +$EBLOCKQUOTE +$PAR + +END_TEXT + +ANS(cos(5*$x)->cmp); + +BEGIN_TEXT + +$ITEM +$WW interprets \{student "cos t${CARET}3"\} to mean \((\cos${SP}t)^3\) +$PAR + +$Explanation: Rule 2 tells you that $WW does evaluation of functions +(like \{student "cos"\}) before exponentiation. Thus $WW first +computes \(\cos${SP}t\) and then raises the result to the power 3. +$PAR + +$Moral: You must type in \{student "cos(t${CARET}3)"\} if you mean the +cosine of \(t^3\), even though we sometimes write it as \(\cos${SP}t^3\). + + +$PAR +$BBLOCKQUOTE +The tangent of \(y^4\) is entered as \{ans_rule(15)\}. +$EBLOCKQUOTE +$PAR + +END_TEXT + +ANS(tan($y**4)->cmp); + +BEGIN_TEXT + +$ITEM +In mathematics, we often write \(\sin^2${SP}x\) to mean \((\sin x)^2\). +$WW will let you write \{student "sin${CARET}2(x)"\} for this, though +it is probably better to type \{student "(sin(x))${CARET}2"\} instead, +as this makes your intention clearer. Note that a power of \(-1\), as +in \{student "sin${CARET}(-1)(x)"\}, is a special case; it indicates the +${BITALIC}inverse${EITALIC} function \{student "arcsin(x)"\} rather +than a power. + + +$PAR +$BBLOCKQUOTE +\(\sin^2${SP}x + \cos^3${SP}x\) = \{ans_rule(30)\} +$EBLOCKQUOTE +$PAR + +END_TEXT + +ANS((sin($x)**2 + cos($x)**3)->cmp); + +BEGIN_TEXT + +$ITEM +\{student "e${CARET}3x"\} means \((e^3) x\) and not \(e^{(3x)}\) $PAR +$PAR + +$Explanation: Rule 3 says that $WW does exponentiation before multiplication. +Thus $WW first computes \{student "e${CARET}3"\}, with the result +\(e^3\), and then multiplies the result by \(x\). +$PAR + +$Moral: Always put parentheses around an exponent. +Type \{student "e${CARET}(3x)"\} if you want \(e^{3x}\). + +$PAR +$BBLOCKQUOTE +\(2^{4x^3}\) = \{ans_rule(30)\} +$EBLOCKQUOTE +$PAR + +END_TEXT + +ANS((2**(4*($x**3)))->cmp); + +BEGIN_TEXT + +\{EndParList("UL")\} + + +END_TEXT + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob09.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob09.pg new file mode 100644 index 0000000000..3c97379dc5 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob09.pg @@ -0,0 +1,112 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Non-Numeric Answers"); + +############################################## + +BEGIN_TEXT + +Sometimes you will be asked to enter answers that are not numbers. +For example, if you are asked to determine what is \(\frac{1}{0}\), the answer is that this $LQ\(\)number$RQ does not exist, so you might have to type \{student "DNE"\} to indicate this (the problem should tell you what words to +use). Note that upper- and lower-case letters are not the same to +$WW, so you might need to enter the answer exactly as indicated in the +problem. (Well-written problems will allow the answer to be +entered either way.) +$PAR + +$BBLOCKQUOTE +Please enter ${LQ}\{student "DNE"\}${RQ} here: \{ans_rule(10)\}. +$EBLOCKQUOTE + +END_TEXT + +ANS(String('DNE')->cmp); + +################################################## + +BEGIN_TEXT + +Other problems may require you to enter \(\infty\), which you do using +the word ${LQ}\{student "INFINITY"\}${RQ} (in upper- or lower-case) or +${LQ}\{student "INF"\}${RQ} for short. The problem should remind you +of how to do this. You can't add or multiply something by infinity. You +can, however, indicate \(-\infty\) by ${LQ}\{student "-INFINITY"\}${RQ}, +or ${LQ}\{student "-INF"\}${RQ}. +$PAR + +$BBLOCKQUOTE +Try entering \(-\infty\) here: \{ans_rule(10)\}. +$EBLOCKQUOTE + +END_TEXT + +ANS((-(Infinity))->cmp); + +################################################## + +Context("Interval"); + +$a = random(-5,5,1); +$I = Compute("(-infinity,$a)"); + +BEGIN_TEXT + +One common place where you use \(\infty\) is as an endpoint of +an interval. $WW allows you to enter intervals using standard +interval notation, including infinite endpoints. For example, +\{student "[-2,5)"\} represents an interval that is closed on the +left and open on the right, while \{student "[2,inf)"\} is an interval +that extends infinitely to the right. +$PAR + +$BBLOCKQUOTE +If you have learned interval notation, write the interval of points that are less than \($a\): \{ans_rule(20)\}. +$EBLOCKQUOTE + +END_TEXT + +ANS($I->cmp); + +################################################## + +Context("Interval"); + +$a = random(-8,-2,1); +$b = random($a+1,$a+5,1); +$c = random($b+1,$b+5,1); +$I = Compute("[$a,$b) U ($b,$c)"); + +BEGIN_TEXT + +${BCENTER} ${BBOLD} If you are in a math course numbered 70 or below, you might not need the information on the rest of this page. Feel free to move on to the next page.${EBOLD} ${ECENTER} +$PAR +Several intervals can be combined into one region using the ${LQ}set +union${RQ} operation, \(\cup\), which is represented as ${LQ}\{student +"U"\}${RQ} in $WW. For example, \{student "[-2,0] U (8,inf)"\} +represents the points from \(-2\) to \(0\) together with everything +bigger than 8. +$PAR + +$BBLOCKQUOTE +Write the set of points from \($a\) to \($c\) but excluding \($b\) and \($c\) +as a union of intervals: \{ans_rule(20)\}. +$EBLOCKQUOTE + +END_TEXT + +ANS($I->cmp); + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob10.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob10.pg new file mode 100644 index 0000000000..fd9237d64d --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob10.pg @@ -0,0 +1,132 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Points and Vectors"); + +############################################## + +Context("Vector"); + +$p0 = non_zero_point2D(); +$p1 = $p0 + 2*non_zero_point2D(2,2,1); + +Context()->texStrings; +BEGIN_TEXT + +Some problems will ask you to enter an answer that is a point (also known as an ordered pair) rather than a number. You enter points in $WW just as you would expect: by separating the coordinates by commas and enclosing them all in +parentheses. So \{student "(2,-3)"\} represents the point in the +plane that has an \(x\)-coordinate of \(2\) and \(y\)-coordinate of +\(-3\). +$PAR + +$BBLOCKQUOTE +What point is halfway between \($p0\) and \($p1\)? \{ans_rule(20)\}. +$EBLOCKQUOTE + +END_TEXT +Context()->normalStrings; + +ANS((($p0+$p1)/2)->cmp); + +################################################## + +$P = non_zero_point3D(); + +$LANGLE = HTML('<',"\char60 "); +$RANGLE = HTML('>',"\char62 "); + +Context()->flags->set(ijk=>1); +Context()->texStrings; +BEGIN_TEXT + + +${BCENTER} ${BBOLD} If you are in a math course numbered 199 or below, you might not need the information on the rest of this page. Feel free to move on to the next page. ${EBOLD} ${ECENTER} + +$PAR +Other problems require you to provide a vector as your answer. $WW +allows you to enter vectors either as a list of coordinates enclosed +in angle braces, \{student $LANGLE\} and \{student $RANGLE\}, or as a +sum of multiples of the coordinate unit vectors, \(\{i\}\), \(\{j\}\) +and \(\{k\}\), which you enter as \{student "i"\}, \{student "j"\} and +\{student "k"\}. For example, \{student "${LANGLE}1,3,-2${RANGLE}"\} +represents the same vector as \{student "i+3j-2k"\}. +$PAR + +$BBLOCKQUOTE +What vector points from the origin to the point \($P\)? \{ans_rule(20)\}. +$EBLOCKQUOTE + +END_TEXT +Context()->normalStrings; +Context()->flags->set(ijk=>0); + +ANS(Vector($P)->cmp); + +################################################## + +$v0 = non_zero_vector3D(); +$v1 = non_zero_vector3D(); + +$SPACING = HTML('  '); +$BNOBR = HTML(''); +$ENOBR = HTML(''); + +Context()->texStrings; +BEGIN_TEXT + +Just as you can enter a number by giving an expression that reduces to it, +$WW allows you to enter points and vectors by giving expressions for the +individual coordinates, or by using a vector-valued expression that +reduces to your answer. For example, +$PAR +$BCENTER +$BNOBR\{student "${LANGLE}1-(-3),2-sqrt(4),6/2${RANGLE}"\}$ENOBR +${SPACING} and ${SPACING} +$BNOBR\{student "[1-(-3)]i + [2-sqrt(4)]j + (6/2)k"\}$ENOBR +$ECENTER +$PAR +both represent the vector \(\{Vector(4,0,3)\}\), while +$BNOBR\{student "${LANGLE}1,0,-1${RANGLE} + ${LANGLE}2,-2,3${RANGLE}"\}$ENOBR +could be used to answer a question that asks for the vector \(\{Vector(3,-2,2)\}\). +$PAR + +$BBLOCKQUOTE +Try writing \(\{$v0+$v1\}\) as a sum of two vectors: \{ans_rule(30)\}. +$EBLOCKQUOTE + +END_TEXT +Context()->normalStrings; + +# +# Check that the result actually IS a sum (or difference). +# +sub checkAdd { + my $ans = shift; + if ($ans->{score} == 1 && !$ans->{isPreview}) { + my $item = $ans->{student_formula}->{tree}; + $ans->{correct_value}->cmp_Error + ($ans,"Your answer is not a sum of vectors") + unless $item->class eq 'BOP' && + ($item->{bop} eq '+' || $item->{bop} eq '-'); + } + return $ans; +} + +my $check = ($v0+$v1)->cmp; +$check->install_post_filter(~~&checkAdd); +ANS($check); + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob11.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob11.pg new file mode 100644 index 0000000000..1f2bafb041 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob11.pg @@ -0,0 +1,64 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + +$showPartialCorrectAnswers = 1; + +TEXT(beginproblem); + +Title("Multiple Answers in One Blank"); + +############################################## + +Context("Numeric"); + + + +Context()->texStrings; +BEGIN_TEXT + +Sometimes you might be asked to provide more than one answer in a single +answer blank. In this case, you should separate your answers by commas. Such an answer is called a ${BITALIC}list${EITALIC} in $WW. Note that you don't $BITALIC have to $EITALIC enter multiple answers for a list; a single number is a legal response (it's a list with only one thing). +$PAR + +$BBLOCKQUOTE +The even integers between 1 and 9 are: \{ans_rule(20)\}. $BR +Try entering the answer in a different order. With lists, order won't matter. +$EBLOCKQUOTE + +END_TEXT +Context()->normalStrings; + +ANS(List(2,4,6,8)->cmp); + +################################################## + +$a = random(1,5,1); +$f = Formula("1/(x^2+$a^2)")->reduce; + +Context()->texStrings; +BEGIN_TEXT + +When you are asked for a list of numbers, another possible answer is +that there are ${BITALIC}no${EITALIC} numbers that satisfy the +requirements. In that case, you should enter ${LQ}\{student +"NONE"\}${RQ} as your answer. +$PAR + +$BBLOCKQUOTE +The expression \($f\) is not defined at these \(x\) values: \{ans_rule(20)\}. +$EBLOCKQUOTE + +END_TEXT +Context()->normalStrings; + +ANS(String('NONE')->cmp); + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob12.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob12.pg new file mode 100644 index 0000000000..def47308b8 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob12.pg @@ -0,0 +1,69 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "choiceUtils.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + +TEXT(beginproblem); + +Title("True/False Questions in $WW"); + +############################################## + +$a = random(1,5,1); +$b = random(6,10,1); +$c = random(-10,-1,1); +$d = random(-10,-1,1); +$e = random(1,10,1); + +$sl = new_select_list(); +$sl->{rf_print_q} = ~~&alt_print_q; +$sl->{separation} = 5; + +$sl->qa( + "\(-$a $LT -$b\)", "F", + "\($c $LE $c\)", "T", + "\($d $LT $d\)", "F", + "\(\pi $GE 3.2\)", "F", + "\($e-1 $LE $e\)", "T" +); + +$sl->choose(4); + +################################################## + +BEGIN_TEXT + +Enter a \{student "T"\} or an \{student "F"\} in each +answer space below to indicate whether the corresponding +statement is true or false. +$PAR + +$BBLOCKQUOTE +\{$sl->print_q\} +$EBLOCKQUOTE +$PAR + +END_TEXT + +ANS(str_cmp($sl->ra_correct_ans)); +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +BEGIN_TEXT + +In most multipart problems, if one or more of your answers is wrong, +then $WW tells you which ones they are. But for True/False or +multiple-choice questions, $WW usually only tells you whether +${BITALIC}all$EITALIC the answers are correct. It won't tell you +which ones are right or wrong. + +END_TEXT + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob13.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob13.pg new file mode 100644 index 0000000000..a4e2fa1cc2 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob13.pg @@ -0,0 +1,67 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "parserOrientation.pl", + "choiceUtils.pl", + "PGcourse.pl", +); + +TEXT(beginproblem); + +Title("Matching Lists in $WW"); + +############################################## + +$a = random(-10,10,1); +$b = random(1,3,1); + +$ml = new_match_list(); +$ml->rf_print_q(~~&alt_print_q); +$ml->rf_print_a(~~&alt_print_a); +$ml->{separation} = 5; + +$ml->qa( + "\(x\) is less than \($a\)", "\(x $LT $a\)", + "\(x\) is any real number", "\(-\infty $LT x $LT \infty\)", + "\(x\) is greater than \($a\)", "\($a $LT x\)", + "\(x\) is less than or equal to \($a\)", "\(x $LE $a\)", + "\(x\) is greater than or equal to \($a\)", "\(x $GE $a\)", + "The distance from \(x\) to \($a\) is at most $b", + "\(|x - $a| $LE $b\)", + "The distance from \(x\) to \($a\) is more than $b", + "\(|x - $a| $GT $b\)" +); + +$ml->choose(5); + +################################################## + +BEGIN_TEXT + +Match the statements defined below with the letters labeling their +equivalent expressions. +$PAR + +\{ColumnMatchTable($ml,indent => 30)\} +$PAR + +END_TEXT + +ANS(str_cmp($ml->ra_correct_ans)); +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +BEGIN_TEXT + +Usually with matching problems, +$WW tells you whether ${BITALIC}all$EITALIC +your answers are correct or not. If they are not all +correct, $WW will not tell you which ones are right +and which are wrong. +$PAR + +END_TEXT + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14-hint.html b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14-hint.html new file mode 100644 index 0000000000..9ad160d2da --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14-hint.html @@ -0,0 +1,35 @@ + +WeBWork Set 0 Problem 11 Hint + + + +
    + + +
    + +
    + +

    Graphs in WeBWorK

    + +Often in WeBWorK, the graphs are displayed as small thumbnail images. +These can be difficult to read, so in these cases, WeBWorK provides +you with a link to a larger copy of the graph. You can click on the +small version of the image to get the larger one. For example, click +on the diagram below to enlarge it. It will be displayed in a +separate window; close that window when you are done looking at the +larger graph. +

    + +

    + +
    +

    + +After you are done, press the "Back" button to go back to the problem page. + +

    +
    + + + diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.gif b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.gif new file mode 100644 index 0000000000..16461e6334 Binary files /dev/null and b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.gif differ diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.pg new file mode 100644 index 0000000000..2d476d0a20 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob14/prob14.pg @@ -0,0 +1,115 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "PGgraphmacros.pl", + "imageChoice.pl", + "../parserOrientation.pl", + "PGcourse.pl" +); + +# +# You need to change this to point to where you have stored the hint +# and graphic files. +# +$htmlWebworkURL = "http://omega.math.union.edu/webwork2_files/local"; +$hintURL = "${htmlWebworkURL}/parserOrientation/prob14-hint.html"; + +TEXT(beginproblem); + +Title("Matching Graphs in $WW"); + +############################################## + +$ml = new_image_match_list(link => 0, border => 0); +$ml->{separation} = 3; + +@Goptions = (-6,-6,6,6, axes => [0,0], grid => [6,6], size => [150,150]); +$G1 = init_graph(@Goptions); +$G2 = init_graph(@Goptions); +$G3 = init_graph(@Goptions); +$G4 = init_graph(@Goptions); + +$a1 = random(-6,2,.1); $b1 = random($a1+1,6,.1); $m1 = ($b1-$a1)/12; +$a2 = random(-2,6,.1); $b2 = random($a2-1,-6,.1); $m2 = ($b2-$a2)/12; +$a3 = non_zero_random(.5,5,.1)*non_zero_random(-1,1,1); +$a4 = non_zero_random(.5,5,.1)*non_zero_random(-1,1,1); + +$plotoptions = "using color:red and weight=2"; +plot_functions($G1,"$m1(x+6)+$a1 for x in <-5.8,5.8> $plotoptions"); +plot_functions($G2,"$m2(x+6)+$a2 for x in <-5.8,5.8> $plotoptions"); +plot_functions($G3,"$a3 for x in <-5.8,5.8> $plotoptions"); +plot_functions($G4,"10000(x-$a4) for x in <-5.8,5.8> $plotoptions"); + +$ml->qa( + "The line is increasing", $G1, + "The line is decreasing", $G2, + "The line is horizontal", $G3, + "The line is verical", $G4 +); + +$ml->choose(4); + +#BEGIN_TEXT +# +#The simplest functions are the ${BITALIC}linear$EITALIC ones --- +#the functions whose graphs are straight lines. They are important +#because many functions locally look like straight lines. (Looking +#like a line ${BITALIC}locally$EITALIC means that if we zoom in on the +#function and look at it at a very powerful magnification, it will look +#like a straight line.) +#$PAR + +BEGIN_TEXT + +Enter the letter of the graph that corresponds to each statement: +$PAR + +$BCENTER +$PAR +\{$ml->print_q\} +$PAR +$ECENTER + +\{$ml->print_a\} +$PAR + +END_TEXT + +ANS(str_cmp($ml->ra_correct_ans)); +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +################################################## + +BEGIN_TEXT + +As with the previous matching problems, you will not be told which of +your answers are correct when you submit your answers to this problem. +$WW will only tell you if ${BITALIC}all${EITALIC} your answers are +correct or not. +$PAR + +Some $WW problems display a link to additional information or a +\{htmlLink($hintURL,"hint")\}. Follow this link for a hint about +graphs in $WW. +$PAR + +END_TEXT + +#Occasionally, a problem includes a hint that will not be available +#immediately. Once you have submitted incorrect answers a certain +#number of times (determined by the problem), you will see a ${LQ}Show +#Hint$RQ button above the submit buttons at the bottom of the screen. +#Check the box and press ${LQ}Submit$RQ in order to get the hint. For +#this problem, the hint will be available after one wrong answer. +# +#END_TEXT +# +#$showHint = 1; +#HINT("$HINT Usually the hints are more helpful than this."); + +################################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob15.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob15.pg new file mode 100644 index 0000000000..e57a9b18fd --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/prob15.pg @@ -0,0 +1,87 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + +TEXT(beginproblem); + +Title("When You're Stuck..."); + +############################################## + +BEGIN_TEXT +The goal of $WW is to help you learn mathematics by giving +you immediate feedback on the correctness of your answer to a problem. +It is not designed to be a tutorial or to replace human teachers. As with any learning tool, it is up to you to make good use of it. + +Here are some things you can try when you are stuck on a problem. +$PAR + +\{BeginParList("UL")\} +$ITEM +Reread the problem carefully to see if there are any instructions +that you did not notice. +$ITEMSEP + +$ITEM +Check carefully for directions on the Problem List page. +You can get to this page by pressing the ${LQ}Prob. List$RQ button at the +top of any problem page. +$ITEMSEP + +$ITEM +Look in the textbook for similar problems or relevant methods. +$ITEMSEP + +$ITEM +Talk to your instructor during office hours. +$ITEMSEP + +$ITEM +Ask a fellow student for help. +$ITEMSEP + +$ITEM +Use the Student Learning Center. (Be sure to take a printout of +the problem with you if you won't be able to log on to $WW. The tutors will need the ${BITALIC}exact$EITALIC +wording of the problem.) +$ITEMSEP + +$ITEM +Use the ${LQ}Email instructor$RQ button at the bottom of the problem page +to send e-mail to your instructor. Include the details of +what you have tried so far. If you are having a software problem, +include details about the error messages you are getting. + +\{EndParList("UL")\} + +$PAR + +When you are truly stuck on a $WW problem, you should turn to other +sources (humans or books) for help, because it is not in your best +interest to guess repeatedly instead of thinking about what you might +be doing wrong. +$PAR + +To get credit for this problem, you must click the ${LQ}Submit +Answers$RQ button. Then you can use the ${LQ}Prob. List$RQ button at +the top of the page to return to the problem list page. You will see +that the problems you have done have been labeled as correct or +incorrect, and you can go back and do problems you skipped or couldn't +get right the first time. Once you have done a problem correctly, it +is ${BITALIC}always$EITALIC listed as correct even if you go back and +do it incorrectly later. This means you can use WeBWorK to review +course material without any danger of changing your grade. $PAR + +END_TEXT + +install_forgiving_grader(); +$showPartialCorrectAnswers = 1; + +############################################## + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setHeader.pg b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setHeader.pg new file mode 100644 index 0000000000..2ff7866c29 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setHeader.pg @@ -0,0 +1,107 @@ +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "parserOrientation.pl", + "PGcourse.pl", +); + + + +if ($displayMode eq 'TeX') { + +TEXT($BEGIN_ONE_COLUMN, + '\noindent{\large\bf '.$studentName.'}\hfill{\large\bf '.$course.'}', + '\par\noindent', +" +This set of $WW problems is designed to orient you to the +$WW system and to help you learn how to communicate with the +software. You will learn how to understand what +you see on the screen and how to enter your answers when you do +the problems. You will practice entering numerical and variable +expressions and look at ways to find and correct errors in your +entries. + +", + "WeBWorK assignment $setNumber is due on $formattedDueDate.", + $END_ONE_COLUMN +); + +} else { + +BEGIN_TEXT + +${BBOLD}Orientation to WeBWorK${EBOLD} +$PAR + +${BCENTER}${BBOLD}READ THIS FIRST${EBOLD}${ECENTER} + + +This set of $WW problems will introduce you to the +$WW system and help you learn how to communicate with the +software. You will learn how to understand what +you see on the screen and how to enter your answers when you do +the problems. You will practice entering numerical and variable +expressions and look at ways to find and correct errors in your +entries. +$PAR + +Start by examining the features of this page you are on right now. The panels at the left and top help you to navigate to the different pages available in +WeBWorK. You have already seen the ${LQ}Homework Sets${RQ} page, +which lists all the homework assignments, and the +${LQ}Password/Email${RQ} page, which lets you change your password or +email address. The ${LQ}Grades${RQ} link takes you to a page that +shows your scores on the various assignments (but there is nothing +much to show at this point). +$PAR + + +The ${LQ}Report Bugs${RQ} button is for reporting bugs in the WeBWorK +System itself to the developers WeBWorK. It is unlikely that +you will need to use that yourself. If you are having difficulty with +WeBWorK, you should contact your professor using the ${LQ}Email +Instructor${RQ} button instead. This should be available on nearly +every page, so you always have a quick way to reach your professor. +$PAR + + +The middle panel is the list of homework sets that have +been assigned to you. These links allow you to go to any assignment +you want to work on. Right now, you might only have the Orientation set assigned to you, but as the term progresses, the list will grow. +$PAR + +The data in the panel at the top of the page tells you where you +are in WeBWorK's hierarchy of pages, but you can ignore that for the +most part. There is an additional logout button at the far right, +however, that you will need to use when you are done using $WW (don't +press it yet). +$PAR + +\{ +#The yellow question mark icon is a ${LQ}Help${RQ} +#button for system documentation, but there is not much of that +#available at the moment. +#$PAR +\} + +The main information on this page is located in the large white area +in the middle. It shows the status of the problems in this assignment, +and your score on the set so far. Since you haven't yet tried any of +the problems, your score is zero, but after you work on some of them, +the number of attempts and the score will reflect the work you have +done. +$PAR + +Each problem number is a link to that problem in the homework set. +You can click on one to get to any specific problem. To begin the +orientation assignment, click on the link for Problem 1. When you are +done working, be sure to dismiss your connection to the server by +clicking on ${LQ}Log Out${RQ}, so that no one else can gain access to +your account. +$PAR + +END_TEXT + +} + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setOrientation.def b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setOrientation.def new file mode 100644 index 0000000000..26eecf74d1 --- /dev/null +++ b/OpenProblemLibrary/PCC/PCCDefaultProblemSets/SetDefinitions/Orientation/setOrientation.def @@ -0,0 +1,19 @@ + +openDate = 03/28/2016 at 12:00am PDT +dueDate = 06/01/2017 at 10:00pm PDT +answerDate = 06/01/2017 at 10:00pm PDT +paperHeaderFile = PCCSetDefinitions/Orientation/PCCOrientationHeader.pg +screenHeaderFile = PCCSetDefinitions/Orientation/PCCOrientationHeader.pg +description = problems to train students on how to use WeBWorK +problemList = +PCCSetDefinitions/Orientation/NewOrientation01.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation02.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation03.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation04.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation05.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation06.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation07.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation08.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation09.pg, 1, -1 +PCCSetDefinitions/Orientation/NewOrientation10.pg, 1, -1 + diff --git a/OpenProblemLibrary/PCC/README b/OpenProblemLibrary/PCC/README new file mode 100644 index 0000000000..c9cdc58f8d --- /dev/null +++ b/OpenProblemLibrary/PCC/README @@ -0,0 +1,7 @@ +This folder contains collections of problems developed at Portland Communit College. PCC maintains a separate repository of these problems on its WeBWorK server. Faculty at PCC work to improve and add to these libraries, and the results are periodically copied from the PCC server to this place within webwork-open-problem-library. + +These problems all have coded walkthrough solutions, use MathObjects where possible, attempt to get the most out of using MathObjects, use randomization, and have accessibility considerations such as alt tags for pictures and appropriate table structures. + +These problems use several custom macros that are kept in OpenProblemLibrary/macros/PCC/. + +Currently the only github user who should be allowed to change files here is Alex-Jordan or cmhughes. diff --git a/OpenProblemLibrary/PCC/README.txt b/OpenProblemLibrary/PCC/README.txt new file mode 100644 index 0000000000..337f4880bf --- /dev/null +++ b/OpenProblemLibrary/PCC/README.txt @@ -0,0 +1,17 @@ +This is a repository of problem libraries developed at Portland Community College. + +The most important copy of this repo lives at webwork.pcc.edu, in opt/webwork/libraries/PCC/. +Subfolders (like BasicMath, BasicAlgebra, etc.) are symlinked from typical courses' templates +folders. + +For problem development, each person working on problem development has their own LibDev course, +for example LibDev-jordan. These courses do *not* have symlinks to BasicMath, etc. Instead, they +have copies of the entire repo, stored in templates/local/PCC/. + +Developers work on problems from the web side of their LibDev course. As needed, development is +committed, and pushed to the repo at opt/webwork/libraries/PCC/, from which it is pushed back down +to all other LibDev courses. + +Lastly, the subfolders in opt/webwork/libraries/PCC/ are periodically *copied* (not using git in +any way) into webwork-open-problem-library/Contrib/PCC/, so that development can be committed to +that repo and shared with the world. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/02Stats_02_DescrData.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/02Stats_02_DescrData.pg new file mode 100644 index 0000000000..9a6b399514 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/02Stats_02_DescrData.pg @@ -0,0 +1,108 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 2: Describing Distributions with Numbers') +## KEYWORDS('statistics', 'mean') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 2: Describing Distributions with Numbers') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"parserNumberWithUnits.pl", +"niceTables.pl", +); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@m = (random(6,7,.1), +random(7,8,.1), +random(8.5,9.5,.1), +random(9.5,10.5,.1), +random(9,10,.1), +random(9,9.7,.1)); + +@mo = (random(7.5,8.5,.1), +random(9,10,.1), +random(10,11,.1), +random(12,13,.1), +random(11.5,12.5,.1), +random(10,11.5,.1)); + +@e = (random(1.10,1.25,.01), +random(1,1.10,.01), +random(1.40,1.50,.01), +random(1.60,1.75,.01), +random(1,1.10,.01), +random(1.13,1.23,.01)); + +@eo = (random(0.9,1,.01), +random(1.30,1.45,.01), +random(1.10,1.20,.01), +random(1.40,1.50,.01), +random(1.20,1.30,.01), +random(1.30,1.38,.01)); + +################################################# +# Main + +BEGIN_TEXT +Animals and people that take in more energy than they expend will get fatter. Here are data on \(12\) rhesus monkeys: \(6\) lean monkeys (\(4$PERCENT\) to \(9$PERCENT\) body fat) and \(6\) obese monkeys (\(13$PERCENT\) to \(14$PERCENT\) body fat). The data report the energy expended in \(24\) hours (kilojoules per minute) and the lean body mass (kilograms, leaving out fat) for each monkey. +$PAR + +\{DataTable( +[ +[['Lean Monkeys Lean Body Mass (kg)', headerrow=>1, midrule=>1], 'Lean Monkeys Energy (kJ/min)', 'Obese Monkeys Lean Body Mass (kg)', 'Obese Monkeys Energy (kJ/min)'], +[' \($m[0]\) ','\($e[0]\)',' \($mo[0]\)','\($eo[0]\)'], +['\($m[1]\)','\($e[1]\)','\($mo[1]\)','\($eo[1]\)'], +['\($m[2]\)','\($e[2]\)','\($mo[2]\)','\($eo[2]\)'], +['\($m[3]\)','\($e[3]\)','\($mo[3]\)','\($eo[3]\)'], +['\($m[4]\)','\($e[4]\)','\($mo[4]\)','\($eo[4]\)'], +['\($m[5]\)','\($e[5]\)','\($mo[5]\)','\($eo[5]\)'], +], +align => 'XXXX', +tablecss => 'width:75%; ', +headercss => 'vertical-align:top; ', +)\} + +$PAR +(a) What is the mean lean body mass of the lean monkeys? $BR $SPACE $SPACE $SPACE \( \overline{LBM}_{\text{Lean}} = \) \{ans_rule(5)\}. + +$PAR +(b) What is the mean lean body mass of the obese monkeys? $BR $SPACE $SPACE $SPACE \( \overline{LBM}_{\text{Obese}} = \) \{ans_rule(5)\}. +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a1 = Compute(($m[0]+$m[1]+$m[2]+$m[3]+$m[4]+$m[5])/6); +ANS(NumberWithUnits("$ans_a1 kg")->cmp); +$ans_a2 = Compute(($mo[0]+$mo[1]+$mo[2]+$mo[3]+$mo[4]+$mo[5])/6); +ANS(NumberWithUnits("$ans_a2 kg")->cmp); + +################################################################# +BEGIN_SOLUTION + +(a) The mean lean body mass of the lean monkeys is, \(\overline{LBM}_{\text{Lean}}=\frac{$m[0]+$m[1]+$m[2]+$m[3]+$m[4]+$m[5]}{6}\approx$ans_a1 kg \). Don't forget units! +$PAR +(b) The mean lean body mass of the obese monkeys is, \(\overline{LBM}_{\text{Obese}}=\frac{$mo[0]+$mo[1]+$mo[2]+$mo[3]+$mo[4]+$mo[5]}{6} \approx $ans_a2 kg\). Don't forget units! + +END_SOLUTION +################################################### +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/02Stats_05_DescrData.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/02Stats_05_DescrData.pg new file mode 100644 index 0000000000..5b2ff28bf9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/02Stats_05_DescrData.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch02DescribingData/02Stats_05_DescrData.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch02DescribingData/02Stats_05_DescrData.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/11Stats_01_SamplingDistns.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/11Stats_01_SamplingDistns.pg new file mode 100644 index 0000000000..2a92202a3c --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/11Stats_01_SamplingDistns.pg @@ -0,0 +1,77 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@TwoProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @TwoProblems[@scramble]; + +$percent = random(55, 80, 1); + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The unknown true percentage of American citizens who enjoy reality TV is a ","parameter."); + $mc[0]->extra("statistic. ", + "sample. ", + "population. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The number \($percent$PERCENT\) is a ","statistic. "); + $mc[1]->extra("sample. ", + "population. ", + "parameter. "); + +###################################### +# Main text + +BEGIN_TEXT +A phone-in poll conducted by a newspaper reported that \($percent$PERCENT\) of those who called in enjoyed reality TV. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); + +################################################### +BEGIN_SOLUTION + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/11Stats_02_SamplingDistns.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/11Stats_02_SamplingDistns.pg new file mode 100644 index 0000000000..f50e690b5e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/11Stats_02_SamplingDistns.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch11SamplingDistributions/11Stats_02_SamplingDistns.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch11SamplingDistributions/11Stats_02_SamplingDistns.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/19Stats_01_InferencePropn.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/19Stats_01_InferencePropn.pg new file mode 100644 index 0000000000..7d59dcc37f --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/19Stats_01_InferencePropn.pg @@ -0,0 +1,75 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", +"contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$n = random(50,90,5); +$x= int($n*random(.2,.7,.1)); +$ansdec = Real($x/$n); + +###################################### +# Main text + +BEGIN_TEXT +An article in the Washington Post on March \(16\), \(1993\) stated that nearly \(45\) +percent of all Americans have brown eyes. A random sample of \(n = $n\) PCC +students found \($x\) with brown eyes. Give the numerical value of the statistic +\( \hat{p} \). + +$BR +\( \hat{p} = \) +\{ ans_rule(5)\} + +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +Context("Percent"); +$ans = Percent($x/$n); +ANS($ans->cmp->withPostFilter(AnswerHints( + Percent(.45) => ["Enter the statistic not the parameter."], + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01 ; + } => ["Close! Use more accuracy in our calculation."] +))); + +################################################### +BEGIN_SOLUTION + +Recall that a statistic \(\hat{p}\) is found using the form \(\hat{p} = \frac{x}{n}\) where \(x\), in this case, is the number of people with a certain quality out \(n\) total people. +$PAR +Thus \(\hat{p} =\frac{$x}{$n} = $ansdec\) or, \($ans\). + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/CenterMeasureFromStemAndLeaf.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/CenterMeasureFromStemAndLeaf.pg new file mode 100644 index 0000000000..cbc93e35a7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/CenterMeasureFromStemAndLeaf.pg @@ -0,0 +1,54 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## KEYWORDS('center measures', 'stem and leaf') +## Author('Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/5/05 +# Location: Northern Arizona University + +DOCUMENT(); + +loadMacros("PGstandard.pl", + "PGnauStats.pl", + "extraAnswerEvaluators.pl", + "MathObjects.pl", + ); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; + +$count = random(20,30,1); +for ($i = 0; $i < $count; $i++){ + push @data, random(50,95,1); +} + +#($html, $tex) = PercentStemAndLeaf('single'=>0,'all'=>0, @data); +($html, $tex) = PercentStemAndLeaf(@data); +($mean, $tmp) = MeanDev(@data); +$median = Median(@data); +@modes = Mode(@data); +###################################### + +BEGIN_TEXT +From the stem plot below, determine the mean, median and mode(s) of the data. Record answers that are not integers to two decimal places. $BR $BR +${BBOLD} NOTES: $EBOLD $BR +(1) If there is more than one mode, list all of them, separated by commas. $BR +(2) If there is no mode, write $BBOLD None$EBOLD. + +$BR +$BR +Mean: \{ans_rule(10)\}, Median: \{ans_rule(10)\}, Mode: \{ans_rule(10)\}$BR$BR +END_TEXT + +TEXT(MODES(TeX => $tex, HTML => $html)); + +ANS(Compute($mean)->cmp); +ANS(Compute($median)->cmp); +ANS(number_list_cmp((join ", ", @modes), strings => ["None"])); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/FiveNum.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/FiveNum.pg new file mode 100644 index 0000000000..b0e04fb2b1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/FiveNum.pg @@ -0,0 +1,77 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## KEYWORDS('five number summary') +## Author('Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/6/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGnauStats.pl", + "MathObjects.pl", + "parserOneOf.pl", +); + +TEXT(&beginproblem) ; +$showPartialCorrectAnswers = 1; + +$n=random(10,30,1); + +for ($i = 0; $i < $n; $i++){ + push @dat, random(25,100,1); +} + +@ans = FiveNum(@dat); +@list = num_sort(@dat); +if ($n/2 - round($n/2) != 0) + {$q1exc = $ans[1]; + $q1inc = $ans[1]; + $q3exc = $ans[3]; + $q3inc = $ans[3];} +elsif ($n/4 - round($n/4) != 0) + {$q1exc = 0.25*$list[($n-2)/4-1]+0.75*$list[($n-2)/4+1-1]; + $q1inc = 0.25*$list[($n-2)/4+1]+0.75*$list[($n-2)/4+1-1]; + $q3exc = 0.25*$list[$n-($n-2)/4]+0.75*$list[$n-($n-2)/4-1]; + $q3inc = 0.25*$list[$n-($n-2)/4-2]+0.75*$list[$n-($n-2)/4-1];} +else + {$q1exc = 0.75*$list[($n)/4-1]+0.25*$list[($n)/4+1-1]; + $q1inc = 0.25*$list[($n)/4-1]+0.75*$list[($n)/4+1-1]; + $q3exc = 0.75*$list[$n-($n)/4]+0.25*$list[$n-($n)/4-1]; + $q3inc = 0.75*$list[$n-($n)/4]+0.25*$list[$n-($n)/4-1];} + + +BEGIN_TEXT +$BR +Consider the following data set. Give the five number summary listing values in numerical order. Different software applications may compute the quartiles differently than the by-hand method. This problem is coded so that any such method is acceptable.$PAR + + Data set: \{join ", ", @dat \} + +$PAR +The five-number summary is: +\{ans_rule(5)\} , \{ans_rule(5)\} , \{ans_rule(5)\} , \{ans_rule(5)\} , \{ans_rule(5)\} . +END_TEXT + +ANS(Compute($ans[0])->cmp); +ANS(Compute(OneOf($ans[1],$q1exc,$q1inc))->cmp); +ANS(Compute($ans[2])->cmp); +ANS(Compute(OneOf($ans[3],$q3exc,$q3inc))->cmp); +ANS(Compute($ans[4])->cmp); + +BEGIN_SOLUTION +Note that we should first sort all of the data from largest to smallest, seen below. +$PAR +\{join ", ", num_sort@dat \} +$PAR +In this data, the minimum is \($ans[0]\) and the maximum is \($ans[4]\). The median is \($ans[2]\). The values for \(Q_{1}\) and \(Q_{3}\) depend on if you include the median when finding the respective values or not. If you do not include the median, you find, \(Q_{1}=$q1exc\) and \(Q_{3}=$q3exc\). If you include the median, you find, \(Q_{1}=$q1inc\) and \(Q_{3}=$q3inc\). +$PAR +This means an acceptable \(5\)-number summary could be; +\($ans[0], $q1exc, $ans[2], $q3exc, $ans[4]\) or, \($ans[0], $q1inc, $ans[2], $q3inc, $ans[4]\) + +END_SOLUTION +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/MeanStdDev.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/MeanStdDev.pg new file mode 100644 index 0000000000..e4ea1c31ba --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/MeanStdDev.pg @@ -0,0 +1,43 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## KEYWORDS('center measures', 'mean', 'standard deviation') +## Author('Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/6/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGnauStats.pl", + "MathObjects.pl" +); + +TEXT(&beginproblem) ; +$showPartialCorrectAnswers = 1; + +$n=random(10,30,1); + +for ($i = 0; $i < $n; $i++){ +push @dat, random(25,100,1); +} + +@ans = MeanDev(@dat); + +BEGIN_TEXT +Consider the following data set. Find the mean and standard deviation.$PAR + Data set: \{join ", ", @dat;\} +$PAR +Mean: \{ans_rule(20) \}$BR +Standard deviation: \{ans_rule(20) \}$BR +END_TEXT + + +ANS(Compute($ans[0])->cmp); +ANS(Compute($ans[1])->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/data2.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/data2.pg new file mode 100644 index 0000000000..3ad8e44abf --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/data2.pg @@ -0,0 +1,98 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## KEYWORDS('') +## Author('Michael Ratliff ') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/3/05 +# from pl/setStatistics2Measures/ur_stt_2_1.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a[0] = random(10,15,1); +$a[1] = random(16,25,1); +$a[2] = $a[1]; +$c1 = $a[2]+1; +$c2 = $a[2]+3; +$a[3] = random($c1,$c2,1); +$d1 = $a[3]+1; +$d2 = $a[3]+3; +$a[4] = random($d1,$d2,1); +$e1 = $a[4]+1; +$e2 = $a[4]+3; +$a[5] = random($e1,$e2,1); +$f1 = $a[5]+3; +$f2 = $a[5]+6; +$a[6] = random($f1,$f2,1); +$g1 = $a[6]+3; +$g2 = $a[6]+6; +$a[7] = random($g1,$g2,1); +$h1 = $a[7]+3; +$h2 = $a[7]+6; +$a[8] = random($h1,$h2,1); +$n1 = $a[8]+5; +$n2 = $a[8]+8; +$a[9] = random($n1,$n2,1); +$m1 = $a[9]+5; +$m2 = $a[9]+8; +$a[10] = random($m1,$m2,1); +$val1 = random(10,15,1); +$mean = int(($a[0]+$a[1]+$a[2]+$a[3]+$a[4]+$a[5]+$a[6]+$a[7]+$a[8]+$a[9]+$a[10]+$val1)/12*1000+.5)/1000; + +@set = ($a[0], $a[1], $a[2], $a[3], $a[4], $a[5], $a[6], $a[7], $a[8], $a[9], $a[10]); +@slice = NchooseK(11,11); +@sset = @set[@slice]; + +$var = 0; +for ($i=0; $i<11; $i+=1) { + $b = ($a[$i] - $mean)**2; + $var = $var+$b; +} + + +$variance = ($var+($val1-$mean)**2)/11; +$sd = int(sqrt($variance)*1000+.5)/1000; + +BEGIN_TEXT +A data set consists of the data given below plus one more data point. When the additional point is included in the data set the sample mean of the resulting data set is \($mean\). What is the value of the additional data point? + $PAR +\[ $sset[0], \ $sset[1], \ $sset[2], \ $sset[3], \ $sset[4], \ $sset[5], \ $sset[6], \ $sset[7], \ $sset[8], \ +$sset[9], \ $sset[10] \]$PAR + +Value of additional data point \(=\) \{ans_rule(20)\}$BR + +END_TEXT +ANS(Compute($val1)->cmp); + +################################################### +BEGIN_SOLUTION + +If there were NO extra data point, to find the mean we would compute \(\overline{x}=\frac{$a[0]+$a[1]+$a[2]+$a[3]+$a[4]+$a[5]+$a[6]+$a[7]+$a[8]+$a[9]+$a[10]}{11}\) +$PAR +But there is an extra data point we do not know, thus there are actually \(12\) pieces of data, which changes our computation of the mean to \(\overline{x}=\frac{$a[0]+$a[1]+$a[2]+$a[3]+$a[4]+$a[5]+$a[6]+$a[7]+$a[8]+$a[9]+$a[10]+x}{12}\) +$PAR +Since is know the mean is \($mean\), we have \($mean=\frac{$a[0]+$a[1]+$a[2]+$a[3]+$a[4]+$a[5]+$a[6]+$a[7]+$a[8]+$a[9]+$a[10]+x}{12}\) +$PAR +This can be solved to find the missing data value to be \(x=$val1\). + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_1_6.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_1_6.pg new file mode 100644 index 0000000000..6a70d67501 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_1_6.pg @@ -0,0 +1,75 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Mode') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Mode') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +@data = ("F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F", + "Th","Th","Th","Th","Th","Th","Th","Th", + "Tu","Tu","Tu","Tu","Tu","Tu", + "W","W","W","W","W","W","W", + "M","M","M","M","M","M","M", + "Sa","Sa","Sa","Sa", + "Su","Su","Su","Su","Su"); + +@slice = NchooseK(60,47); +@sdata = @data[@slice]; + +$popup = PopUp(["?", "Su", "M", "Tu", "W", "Th", "F", "Sa"], "F"); + + +$out = ''; +for $j (@sdata) { + $out .= " $j,"; +} +chop($out); + + +BEGIN_TEXT + +The following data contains days when road rage occured according to a study. The goal of the study is to determine when road rage occurs most often. + +$BR$BR +$out +$BR$BR +Find the mode of the above data. +$BR $BR +The mode is \{ $popup->menu() \}. + +END_TEXT + +ANS( $popup->cmp() ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_2_1.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_2_1.pg new file mode 100644 index 0000000000..6230661489 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_2_1.pg @@ -0,0 +1,78 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Mean') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Sample Mean') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(1,3,.1); +$a2 = $a1+ .2; +$a3 = $a1 - .1; +$a4 = random(2,4,.1); +$b1 = $a1+.1; +$c1 = $a1+.3; +$a5 = random($b1,$c1,1); +$b3 = $a4+.4; +$c3 = $a4- .6; +$a6 = random($b3,$c3,1); + +@data = ($a1, $a2, $a3, $a4, $a5, $a6); +@slice = NchooseK(6,6); +@sdata = @data[@slice]; + +$sum = ($a1 + $a2 + $a3 + $a4 + $a5 + $a6); +$n=6; + +BEGIN_TEXT +For the given data, find \( \Sigma x\) and \(n\): +$PAR + +\[ x_1=$sdata[0], \ x_2=$sdata[1], \ x_3=$sdata[2], \ x_4=$sdata[3], \ x_5=$sdata[4], \ x_6=$sdata[5] \] + +$PAR +\( \Sigma x=\)\{ans_rule(10)\} $BR +\(n =\) \{ans_rule(10)\} + +END_TEXT + +ANS(Compute($sum)->cmp); +ANS(Compute($n)->cmp); + +################################################### +BEGIN_SOLUTION + +(a) Recall that \( \Sigma x\) is shorthand for asking you to add, or sum, all the data value available. Thus we find, +$PAR +\( \Sigma x = $a1 + $a2 + $a3 + $a4 + $a5 + $a6 =$sum\) +$PAR +(b) Recall that \(n\) is the number of pieces of data we have. In this case, \(n=$n\). +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_4_3.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_4_3.pg new file mode 100644 index 0000000000..a26c608a7e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_4_3.pg @@ -0,0 +1,68 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Quartiles') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Quartiles') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + + +@event = ("Q1","Q2","Q3"); +@ans = (49, 73, 86); + +@slice = NchooseK(3,2); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + + +BEGIN_TEXT +Here is a list of \(27\) scores on a Statistics midterm exam: $BR $BR +\(20,\ 30,\ 31,\ 32,\ 46,\ 48,\ 49,\ 52,\ 54,\)$BR +\(59,\ 61,\ 69,\ 71,\ 73,\ 74,\ 79,\ 81,\ 81,\)$BR +\(81,\ 85,\ 86,\ 87,\ 88,\ 91,\ 94,\ 96,\ 97\)$BR $BR + + +Find $sevent[0]: \{ans_rule(10)\} $BR $BR +Find $sevent[1]: \{ans_rule(10)\} + +END_TEXT + +ANS(Compute($sans[0])->cmp); +ANS(Compute($sans[1])->cmp); + +################################################### +BEGIN_SOLUTION + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_4_4.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_4_4.pg new file mode 100644 index 0000000000..6e7d1444a1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/dueck3_4_4.pg @@ -0,0 +1,140 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Quartiles') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Quartiles') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(20,50,1); +$a2 = $a1+1; +$a3 = $a1-2; +$b1 = $a1+5; +$c1 = $a1+3; +$a4 = random($b1,$c1,1); +$b2 = $a1-3; +$c2 = $a1-5; +$a5 = random($b2,$c2,1); +$b3 = $a1+7; +$c3 = $a1+8; +$a6 = random($b3,$c3,1); +$b4 = $a1-7; +$c4 = $a1-8; +$a7 = random($b4,$c4,1); +$b6 = $a1-11; +$c6 = $a1-9; +$a9 = random($b6,$c6,1); +$b5 = $a1+11; +$c5 = $a1+9; +$a8 = random($b5,$c5,1); +$b7 = $a1+15; +$c7 = $a1+19; +$a10 = random($b7,$c7,1); +$b8 = $a1-15; +$c8 = $a1-19; +$a11 = random($b8,$c8,1); +$b9 = $a1+21; +$c9 = $a1+24; +$a12 = random($b9,$c9,1); +$b10 = $a1-21; +$c10 = $a1-24; +$a13 = random($b10,$c10,1); +$b11 = $a1+27; +$c11 = $a1+31; +$a14 = random($b11,$c11,1); +$b12 = $a1-27; +$c12 = $a1-28; +$a15 = random($b12,$c12,1); + + +@data = ($a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8,$a9,$a10,$a11,$a12,$a13,$a14,$a15); +@slice = NchooseK(15,15); +@sdata = @data[@slice]; + +$Q1 = $a9; +$Q2 = $a1; +$Q3 = $a8; +$Min = $a15; +$Max = $a14; +$IQR = $Q3-$Q1; + +$mc = new_multiple_choice(); + +$mc->qa("There is a potential outlier in this data set according to the 1.5IQR rule.", +"False"); +$mc->makeLast("True"); + + +BEGIN_TEXT + + +Calculate the \(5\) number summary and the interquartile range of the following data: + +\[ $sdata[0], \ $sdata[1], \ $sdata[2], \ $sdata[3], \ $sdata[4], \ $sdata[5], \ $sdata[6], \ $sdata[7] ,\ $sdata[8],\ $sdata[9],\ $sdata[10],\ $sdata[11],\ $sdata[12],\ $sdata[13],\ $sdata[14] \] $BR $BR + +Min = \{ans_rule(10)\} $BR + +Q1 = \{ans_rule(10)\} $BR + +Q2 = \{ans_rule(10)\} $BR + +Q3 = \{ans_rule(10)\} $BR + +Max = \{ans_rule(10)\} $BR + +IQR = \{ans_rule(10)\} $BR + +$BR $HR $BR + +\{ $mc->print_q \} +\{ $mc->print_a \} + + +END_TEXT + +ANS(Compute($Min)->cmp); +ANS(Compute($Q1)->cmp); +ANS(Compute($Q2)->cmp); +ANS(Compute($Q3)->cmp); +ANS(Compute($Max)->cmp); +ANS(Compute($IQR)->cmp); + +ANS(radio_cmp($mc->correct_ans)); + +################################################### +BEGIN_SOLUTION + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa10.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa10.pg new file mode 100644 index 0000000000..e7e6256081 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa10.pg @@ -0,0 +1,64 @@ +##DESCRIPTION +## Statistics: basic measurements +##ENDDESCRIPTION + +##KEYWORDS('statistics', 'measures', 'standard deviation') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mc = new_multiple_choice(); + +$mc->qa("The standard deviation is preferable to the range as a measure of variation because it takes into account all the observations, not only the largest and the smallest ones", +"True"); +$mc->makeLast("False"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +$mc = new_multiple_choice(); + +$mc->qa("One major drawback to the standard deviation as a measure of variation is that it is ", +"Not resistant to outliers"); +$mc->extra("Decreasing", "Increasing"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT +$BR$HR$BR +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa19.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa19.pg new file mode 100644 index 0000000000..bb73343ea4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa19.pg @@ -0,0 +1,89 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('statistics', 'introduction') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +@event = (' \(s \)', ' \( \sigma \)', ' \( \overline{x} \)', ' \( \mu \)'); +@ans = ("statistic","parameter","statistic", "parameter"); + +@slice = NchooseK(4,4); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + +for my $i (0..3) { + $popup[$i] = PopUp(["?", "parameter", "statistic"], $sans[$i]); +}; + + +BEGIN_TEXT + +Identify each quantity as a parameter or statistic. +$PAR + +(a) $sevent[0] is a \{$popup[0]->menu\}$PAR +(b) $sevent[1] is a \{$popup[1]->menu\}$PAR +(c) $sevent[2] is a \{$popup[2]->menu\}$PAR +(d) $sevent[3] is a \{$popup[3]->menu\}$PAR + + + +END_TEXT +for my $i (0..3) { + ANS($popup[$i]->cmp); +}; + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# + +ANS(num_cmp($ans1)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa47.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa47.pg new file mode 100644 index 0000000000..c19037e57e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa47.pg @@ -0,0 +1,67 @@ +##DESCRIPTION +## Statistics: proportions +##ENDDESCRIPTION + +##KEYWORDS('percent') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("The population proportion is a", "parameter"); +$mc->extra("statistic"); +$mc->makeLast("statistic", "parameter", "None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +$BR +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +$mc = new_multiple_choice(); + +$mc->qa("The sample proportion is a", "statistic"); +$mc->extra("parameter"); +$mc->makeLast("statistic", "parameter", "None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa48.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa48.pg new file mode 100644 index 0000000000..3d2818ab38 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa48.pg @@ -0,0 +1,94 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('percent') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +# Capitalization changed by Tyler Diggans at NAU 7/2012 + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +$showPartialCorrectAnswers = 0; + + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("identify the population", "all No.1 draftpicks in the NBA since \(1966\)"); +$mc->extra("all NBA players since \(1966\)","all No.1 draftpick centers in the NBA since \(1966\)" ); +$mc->makeLast("None of the above"); + +BEGIN_TEXT +Since \(1966\), \(45$PERCENT\) of the No.1 draftpicks in the NBA have been centers. $BR + + +\{ $mc->print_q \} +\{ $mc->print_a \} +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +$mc = new_multiple_choice(); + +$mc->qa("identify the specified attribute", "being a center"); +$mc->extra("being an NBA player", "being a No.1 draftpicks in the NBA"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +$mc = new_multiple_choice(); + +$mc->qa("is the proportion \(0.45\) \((45$PERCENT)\) a population proportion or a sample proportion?", "population proportion"); +$mc->extra("sample proportion"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +################################################### +BEGIN_SOLUTION + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa8.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa8.pg new file mode 100644 index 0000000000..760be56197 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/kolossa8.pg @@ -0,0 +1,104 @@ +##DESCRIPTION +## Statistics: basic measurements +##ENDDESCRIPTION + +##KEYWORDS('statistics', 'measures') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a[0] = random(10,15,1); +$a[1] = random(16,25,1); +$a[2] = $a[1]; +$c1 = $a[2]+1; +$c2 = $a[2]+3; +$a[3] = random($c1,$c2,1); +$d1 = $a[3]+1; +$d2 = $a[3]+3; +$a[4] = random($d1,$d2,1); +$e1 = $a[4]+1; +$e2 = $a[4]+3; +$a[5] = random($e1,$e2,1); +$f1 = $a[5]+3; +$f2 = $a[5]+6; +$a[6] = random($f1,$f2,1); +$g1 = $a[6]+3; +$g2 = $a[6]+6; +$a[7] = random($g1,$g2,1); +$h1 = $a[7]+3; +$h2 = $a[7]+6; +$a[8] = 299; + + +$mean = ($a[0]+$a[1]+$a[2]+$a[3]+$a[4]+$a[5]+$a[6]+$a[7]+$a[8])/9; + +@set = ($a[0], $a[1], $a[2], $a[3], $a[4], $a[5], $a[6], $a[7], $a[8]); +@slice = NchooseK(9,9); +@sset = @set[@slice]; + +$var = 0; +for ($i=0; $i<9; $i+=1) { + $b = ($a[$i] - $mean)**2; + $var = $var+$b; +} + + +$range =$a[8]-$a[0] ; +$variance = $var/8; +$sd = sqrt($variance); + + +$mc = new_multiple_choice(); + +$mc->qa("The lack of what property of standard deviation accounts for its sensitivity to the one data value that is notably larger than the other ones?", +"Resistance"); +$mc->extra("Decreasing property"); +$mc->makeLast("All of the above"); + +BEGIN_TEXT +The length (in pages) of a sample of math research papers is given below. +Using this data, calculate the range, variance, and standard deviation. $PAR +\[ $sset[0], \ $sset[1], \ $sset[2], \ $sset[3], \ $sset[4], \ $sset[5], \ $sset[6], \ $sset[7], \ $sset[8] \]$PAR + +range \( =\) \{ans_rule(8)\}$BR +variance \( =\) \{ans_rule(8)\}$BR +standard deviation \( =\) \{ans_rule(8)\} + +$BR$HR$BR +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(Compute($range)->cmp); +ANS(Compute($variance)->cmp); +ANS(Compute($sd)->cmp); +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-05.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-05.pg new file mode 100644 index 0000000000..db4d1145da --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-05.pg @@ -0,0 +1,88 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics', 'standard deviation', 'variance') +## naw tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('06/01/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + +DOCUMENT(); +loadMacros("PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl" +); + +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +# True false questions are a special case of a "select list" +# Make a new select list + +$tf = new_select_list(); + +# $tf now "contains" the select list object. +# Insert some questions and whether or not they are true. + +$tf->rf_print_q(~~&pop_up_list_print_q); + +$tf -> ra_pop_up_list( [ No_answer => " ?", T => "True", F => "False"] ); + + +$tf -> qa ( # each entry has to end with a comma +"The difference between the largest and smallest values in an ordered +data set is called the range.", +"T", +"Quartiles divide the values in a data set into four parts of equal size.", +"T", +"The range is considered the weakest measure of variability.", +"T", +"The standard deviation will always be larger than the variance.", +"F", +"The standard deviation is the positive square root of the variance.", +"T", +"The interquartile range is found by taking the difference between the 1st +and 3rd quartiles and dividing that value by 2.", +"F", +"The standard deviation is expressed in terms of the original units of +measurement but the variance is not.", +"T", +"The value of the standard deviation may be either positive or negative, +while the value of the variance will always be positive.", +"F", +); + +# Choose four of the question and answer pairs at random. +$tf ->choose(4); + +# Now print the text using $ml->print_q for the questions +# and $ml->print_a to print the answers. +TEXT(beginproblem()); +BEGIN_TEXT +$PAR + +Select True or False from each pull-down menu, depending on whether +the corresponding statement is true or false. +$BR + +\{ $tf-> print_q \} + +$PAR + +END_TEXT + +# Enter the correct answers to be checked against the answers to the students. + +ANS(str_cmp( $tf->ra_correct_ans ) ) ; + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-08.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-08.pg new file mode 100644 index 0000000000..abcd4f40e9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-08.pg @@ -0,0 +1,68 @@ +## DESCRIPTION +## Statistics: Numerical descriptive techniques +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'numerical', 'descriptive statistics', 'mean') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('6/1/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros("PG.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGauxiliaryFunctions.pl", + "MathObjects.pl"); + + +$numall = random(28,35,1); +do{$nummale = random(15,20,1); +$numfemale = $numall - $nummale;} until ($nummale != $numfemale); +$aveall = random(73,80,1); +$avemale = random(60,72,2); +$avefemale = ($aveall*$numall - $avemale*$nummale)/$numfemale; + +while ($avefemale > 100) { + $numall = random(28,35,1); + $nummale = random(15,20,1); + $numfemale = $numall - $nummale; + $aveall = random(73,80,1); + $avemale = random(60,72,2); + $avefemale = ($aveall*$numall - $avemale*$nummale)/$numfemale; +} + +TEXT(beginproblem()); + +TEXT(EV2(<cmp ); + +################################################### +BEGIN_SOLUTION + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-10.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-10.pg new file mode 100644 index 0000000000..59d2064431 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-10.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## Statistics: Numerical descriptive techniques +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'numerical', 'descriptive statistics', 'mean', 'median', 'mode') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('6/1/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$data[3] = random(200,220,2); +$data[4] = random(230,250,2); +$data[2] = $data[3] - random(2,20,2); +$data[1] = $data[3] - random(22,30,2); +$data[0] = $data[3] - random(32,50,2); +$data[5] = $data[4] + random(2,20,2); +$data[6] = $data[5]; +$data[7] = $data[4] + random(30,75,2); + +$mean = ($data[0]+$data[1]+$data[2]+$data[3]+$data[4]+$data[5]+$data[6]+$data[7])/8; +$median = ($data[3] + $data[4])/2; +$mode = $data[5]; + +@slice = NchooseK(8,8); +@shuffleddata = @data[@slice]; + + +BEGIN_TEXT +$PAR A sample of prices for eight television sets available at a local +electronics store is given below: +$PAR +\[ +$shuffleddata[0] \quad +$shuffleddata[1] \quad +$shuffleddata[2] \quad +$shuffleddata[3] \quad +$shuffleddata[4] \quad +$shuffleddata[5] \quad +$shuffleddata[6] \quad +$shuffleddata[7] +\] +$PAR +Find the mean, median, and mode for this sample. +$PAR +Sample Mean = \{ans_rule(15)\} +$PAR +Sample Median = \{ans_rule(15)\} +$PAR +Sample Mode = \{ans_rule(15)\} +$BR + + +END_TEXT + +ANS(Compute($mean)->cmp ); +ANS(Compute($median)->cmp ); +ANS(Compute($mode)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-11.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-11.pg new file mode 100644 index 0000000000..cd0b5d8143 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-11.pg @@ -0,0 +1,80 @@ +## DESCRIPTION +## Statistics: Numerical descriptive techniques +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'numerical', 'descriptive statistics', 'range', 'variance') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Numerical Methods') +## Date('6/1/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$data[2] = random(200,220,2); +$data[3] = random(230,250,2); +$data[1] = $data[2] - random(2,20,2); +$data[0] = $data[2] - random(20,30,2); +$data[4] = $data[3] + random(2,20,2); +$data[5] = $data[3] + random(30,75,2); + +$mean = ($data[0]+$data[1]+$data[2]+$data[3]+$data[4]+$data[5])/6; +$range = $data[5] - $data[0]; +$variance = (($data[0]-$mean)**2 + ($data[1]-$mean)**2 + ($data[2]-$mean)**2 + + ($data[3]-$mean)**2 + ($data[4]-$mean)**2 + ($data[5]-$mean)**2)/5; + +@slice = NchooseK(6,6); +@shuffleddata = @data[@slice]; + + +BEGIN_TEXT +$PAR A sample of prices for six cordless drills available at a local +home improvement store is given below: +$PAR +\[ +$shuffleddata[0] \quad +$shuffleddata[1] \quad +$shuffleddata[2] \quad +$shuffleddata[3] \quad +$shuffleddata[4] \quad +$shuffleddata[5] +\] +$PAR +Find the range and variance for this sample. +$PAR +Sample Range = \{ans_rule(15)\} +$PAR +Sample Variance = \{ans_rule(15)\} +$BR + + +END_TEXT + +ANS(Compute($range)->cmp ); +ANS(Compute($variance)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-17.pg b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-17.pg new file mode 100644 index 0000000000..747e38dc07 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicOneVarStats/stat212-HW02-17.pg @@ -0,0 +1,120 @@ +## DESCRIPTION +## Statistics: Numerical descriptive techniques +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'numerical', 'descriptive statistics', 'quartile') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Quartiles') +## Date('6/1/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"parserOneOf.pl", +"parserMultiAnswer.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$data[3] = random(580,620,10); +$data[4] = random(630,650,10); +$data[2] = $data[3] - random(0,20,10); +$data[1] = $data[3] - random(30,50,10); +$data[0] = $data[3] - random(60,100,10); +$data[5] = $data[4] + random(0,20,10); +$data[6] = $data[4] + random(30,50,10); +$data[7] = $data[4] + random(60,100,10); + +$q1 = Real(0.5*$data[1] + 0.5*$data[2]); +$q1exc = Real(0.75*$data[1] + 0.25*$data[2]); +$q1inc = Real(0.25*$data[1] + 0.75*$data[2]); +$q3 = Real(0.5*$data[5] + 0.5*$data[6]); +$q3exc = Real(0.25*$data[5] + 0.75*$data[6]); +$q3inc = Real(0.75*$data[5] + 0.25*$data[6]); +$iqr = Real($q3 - $q1); +$with = ($data[5]-$data[3]); + +@slice = NchooseK(8,8); +@shuffleddata = @data[@slice]; + + +$multians = MultiAnswer($q1, $q3, $iqr)->with( + singleResult => 0, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $q1stu, $q3stu, $iqrstu ) = @{$student}; + my ( $q1cor, $q3cor, $iqrcor ) = @{$correct}; + if ( ($q1cor == $q1stu) || ($q1exc == $q1stu) || ($q1inc == $q1stu)) + {$q1OK = 1;} else {$q1OK = 0;}; + if ( ($q3cor == $q3stu) || ($q3exc == $q3stu) || ($q3inc == $q3stu)) + {$q3OK = 1;} else {$q3OK = 0;}; + if ($iqrstu == $q3stu-$q1stu) + {$iqrOK = 1;} else {$iqrOK = 0;}; + return [$q1OK, $q3OK, $iqrOK]; + } +); + +BEGIN_TEXT +$PAR A sample of eight math SAT scores is given below: +$PAR +\[ +$shuffleddata[0] \quad +$shuffleddata[1] \quad +$shuffleddata[2] \quad +$shuffleddata[3] \quad +$shuffleddata[4] \quad +$shuffleddata[5] \quad +$shuffleddata[6] \quad +$shuffleddata[7] +\] +$PAR +Find the first and third quartiles and the interquartile range for this sample. Different software applications may use slightly different formulas for finding quartiles than what a person would use by hand; this problem is coded so that any of the common methods that software or people would use will give correct answers. +$PAR +\(Q_1 ={}\) \{$multians->ans_rule(10)\} +$PAR +\(Q_3 ={}\) \{$multians->ans_rule(10)\} +$PAR +\(IQR ={}\) \{$multians->ans_rule(10)\} + +$BR + + +END_TEXT + +ANS( $multians->cmp() ); + +BEGIN_SOLUTION +Note that we should first organize the data from smallest to largest, as seen below, +$PAR +\($data[0], $data[1], $data[2], $data[3], $data[4], $data[5], $data[6], $data[7]\) +$PAR +(a) If you include the median in finding the lower quartile, we find \(Q_{1} =$data[3]\). If we do not include the median, we find \(Q_{1} =$q1\). +$PAR +(b) If you include the median in finding the upper quartile, we find \(Q_{3} =$data[5]\). If we do not include the median, we find \(Q_{3} =$q3\). +$PAR +The \(IQR\) is found by computing \(Q_{3}- Q_{1}\). Thus if we have included the median in our calculations, we find \(IQR = $iqr\), if we have not included the median, we find \(IQR =$with\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_01_Probability.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_01_Probability.pg new file mode 100644 index 0000000000..c8e5f93c1d --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_01_Probability.pg @@ -0,0 +1,84 @@ +## DESCRIPTION +## DBsubject(Probability) +## DBchapter(Counting and probability) +## DBsection(Probability) +## Institution(The College of Idaho) +## Author(R Cruz, L Danielson, J Guild) +## Level(1) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('10') +## Problem1('') +## KEYWORDS('statistics', 'probability') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$choose = random(0,1,1); #Pick the problem + +$mc = new_multiple_choice(); +if ($choose == 1) { + $mc->qa("A phenomenon is observed many, many times under identical conditions. The + proportion of times a particular event occurs is recorded. This proportion represents" + ,"the probability of the event. "); + $mc->extra("the distribution of the event.", + "the correlation of the event. ", + "the variance of the event. "); +}else{ + $mc->qa("The probability of any outcome of a random phenomenon is ","the proportion of a very long + series of repetitions in which the outcome occurs. "); + $mc->extra("the precise degree of randomness present in the phenomenon. ", + "either 0 or 1, depending on whether or not the phenomenon can actually occur. ", + "any number, as long as it is a value between 0 and 1. "); +} + +$mc1 = new_multiple_choice(); + $mc1->qa("The collection of all possible outcomes of a random phenomenon is called ","the sample space."); + $mc1->extra("the distribution. ", + "the probability.", + "a census. "); + $mc1->makeLast("None of the above."); + +###################################### +# Main text + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc -> print_q() \} +$BR +\{$mc -> print_a() \} + +$PAR +(b) \{ $mc1 -> print_q() \} +$BR +\{$mc1 -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc->correct_ans)); +ANS(radio_cmp($mc1->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_02_Probability.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_02_Probability.pg new file mode 100644 index 0000000000..04a5cde186 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_02_Probability.pg @@ -0,0 +1,66 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('E Cabrera, R Cruz') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$fatchance = random(0.01,0.04,0.01); +$perhaps = random(0.4,0.45,0.01); +$maybe = random(0.55,0.6,0.01); +$probably = random(0.9,0.99,0.01); + +#make a new match list +$ml = new_match_list(); + +$ml -> qa ( + "It is basically not possible for this event to happen.", "0", + "This event is very unlikely to happen, but it will occur once in a while in a long sequence of trials.", "$fatchance", + "This event will occur a little less than half the time over a long sequence of trials.", "$perhaps", + "This event will occur more often than not.", "$maybe", + "This event is very likely to occur.", "$probably", + "This event is basically certain to happen on every trial.", "1" +); + +$ml -> choose(4); + +###################################### +# Main text + +BEGIN_TEXT +Probability is a measure of how likely an event is to occur. +Match one of the probabilities that follow with each statement of likelihood given. Type the correct $BBOLD letter $EBOLD in each box. You must get all of the answers correct to receive full credit. +$PAR + +\{ $ml -> print_q \} +$PAR + +\{$ml -> print_a \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS( str_cmp( $ml->ra_correct_ans ) ) ; + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_04_Probability.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_04_Probability.pg new file mode 100644 index 0000000000..63a41aea98 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_04_Probability.pg @@ -0,0 +1,60 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl",, + "answerHints.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$attempts = random(100, 250, 10); +$baskets = $attempts - random(20,50,5); + +###################################### +# Main text + +BEGIN_TEXT +A basketball player makes $baskets out of $attempts free throws. We would +estimate the probability that the player makes the next free throw to be +\{ans_rule(10)\} . +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +Context("Percent"); +$ans = Percent($baskets / $attempts); +ANS($ans->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_12_Probability.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_12_Probability.pg new file mode 100644 index 0000000000..75bc5176ae --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/10Stats_12_Probability.pg @@ -0,0 +1,101 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'sample space', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz') +## Institution('The College of Idaho') +## Date: 2009/03 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@event = ("\( X = 1\)", "\( X = 2\)"); +$choose = random(0,1,1); + +###################################### +# Main text + +BEGIN_TEXT +Suppose a couple planned to have three children. Let \( X \) be the number +of girls the couple has. + +$PAR +(a) List all possible arrangements of girls and boys. For example, if the + couple had 2 girls and then a boy, then their arrangement is $BBOLD GGB$EBOLD. Separate each + item in your list with a comma: \{ans_rule(60)\}. + +$PAR +(b) List the sample space for \( X \). (i.e. List the possible values that \( X \) + may take separated by commas.): \{ans_rule(20)\}. + +$PAR +(c) What is the probability that $event[$choose]? \{ans_rule(10)\} + +$PAR +(d) What is \(P(\)$event[$choose]\()\)? \{ans_rule(10)\} + +$PAR + +(e) Find the probability that the couple have three boys: \{ans_rule(15)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +Context()->strings->add("GGG"=>{}, + "GGB"=>{}, + "GBG"=>{}, + "BGG"=>{}, + "BBG"=>{}, + "BGB"=>{}, + "GBB"=>{}, + "BBB"=>{}); + +$ans_a = List("GGG", "GGB", "GBG", "BGG", "BBG", "BGB", "GBB", "BBB"); +ANS($ans_a->cmp); + +$ans_b = List(0, 1, 2, 3); +ANS($ans_b->cmp); + +Context("Percent"); +$ans_c = Percent(0.375); +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."]))); + +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."]))); + +$ans_e = Percent(1/8); +ANS($ans_e->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."]))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/dueck5_1_2.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/dueck5_1_2.pg new file mode 100644 index 0000000000..a431cc7eae --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/dueck5_1_2.pg @@ -0,0 +1,57 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@quest1 = ('the DOI is included in the sample', 'the DOI and the CP are included in the sample', 'the DOI and the DOS are included in the sample', 'the DOI, DOS and the CP are included in the sample'); +$tag1 = random(0,1); +$tag2 = random(2,3); +$b = 3/10; +$c = 1/10; +$d= 6/10; +@ans1 = ($d, $b, $b, $c); + + +BEGIN_TEXT + +There are five school officials at PCC who might be able to serve on a committee to investigate improving success in math courses: The Dean of Instruction (DOI), the Dean of Students (DOS), the Vice President of Student and Academic Affairs (VPSAA), the Division Dean overseeing mathematics (DD), and the Campus President (CP). Consider all possible groups of size 3 that can be obtained from this population of five officials. (Note: there are 10 possible samples!) +$BR $BR + +(a) What is the probability that $quest1[$tag1]? \{ans_rule(15)\} +$BR$BR +(b) What is the probability that $quest1[$tag2]? \{ans_rule(15)\} + +END_TEXT + +ANS(num_cmp($ans1[$tag1])); +ANS(num_cmp($ans1[$tag2])); + +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/dueck5_1_5.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/dueck5_1_5.pg new file mode 100644 index 0000000000..02f51b9930 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/dueck5_1_5.pg @@ -0,0 +1,70 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); + +$a1 = random (7,12,1); +$blah1 = $a1-7; +$ans1 = 6-$blah1; +$ans1= $ans1/36; + +$a2 = random(7,12,1); +while($a1==$a2) {$a2 = random(7,12,1);} +$blah2 = $a2-7; +$ans2 = 6-$blah2; +$ans2 = $ans2/36; + +$ans3 = 6/36; + +BEGIN_TEXT +Two six-sided dice are rolled (one red and one green). Some possibilities are (Red=1,Green=5) or (Red=2,Green=2) etc. $PAR +(a) How many total possibilities are there? $BR +\{ ans_rule(10) \} +$PAR +For the rest of the questions, we will assume that the dice are fair and +that all of the possibilities in (a) are equally likely. $PAR +(b) What is the probability that the sum on the two dice comes out +to be $a1?$BR +\{ ans_rule(20) \} +$PAR +(c) What is the probability that the sum on the two dice comes out +to be $a2? $BR +\{ ans_rule(20) \} +$PAR +(d) What is the probability that the numbers on the two dice are equal? +$BR +\{ ans_rule(20) \} +END_TEXT + +ANS(num_cmp( 36 ) ); +ANS(num_cmp( $ans1 ) ); +ANS(num_cmp( $ans2 ) ); +ANS(num_cmp( $ans3 ) ); + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/kolossa5.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/kolossa5.pg new file mode 100644 index 0000000000..7a0aabb716 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/kolossa5.pg @@ -0,0 +1,79 @@ +##DESCRIPTION +##KEYWORDS('statistics', 'introduction', 'concepts') +## +##ENDDESCRIPTION + +## KEYWORDS ('Statistics, 'introduction', 'concepts') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGauxiliaryFunctions.pl", +"PGanswermacros.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(0.1,0.9,.1); +$a2 = random(3,4,.1); +$a3 = random(-3,-2,.1); +$nn = random(2,5); +$den = 6; $g = gcd($nn, $den); +$nn = $nn/$g; +$den = $den/ $g; + + +@event = ($a1, 1, $a2, $a3, 0); +@ans = ("could be a probability", "could be a probability", "could not be a probability", "could not be a probability", "could be a probability"); + +@slice = NchooseK(5,5); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + +for my $i (0..4) { + $popup[$i] = PopUp(["?", "could be a probability", "could not be a probability"],$sans[$i]); +}; + +$popupY = PopUp(["?", "could be a probability", "could not be a probability"],"could be a probability"); + +BEGIN_TEXT + +Determine whether the following number can possibly be probability. $PAR + + +(a) $sevent[0] \{$popup[0]->menu\} $PAR +(b) $sevent[1] \{$popup[1]->menu\} $PAR +(c) $sevent[2] \{$popup[2]->menu\} $PAR +(d) $sevent[3] \{$popup[3]->menu\} $PAR +(e) \(\frac{$nn}{$den}\) \{$popupY->menu\} $PAR +(f) $sevent[4] \{$popup[4]->menu\} + +END_TEXT + +for my $i (0..3) { +ANS($popup[$i]->cmp); +}; +ANS($popupY->cmp); +ANS($popup[4]->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/stat212-HW03-17.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/stat212-HW03-17.pg new file mode 100644 index 0000000000..254a5740a7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/stat212-HW03-17.pg @@ -0,0 +1,69 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('probability') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('6/9/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$a = random(40,55,1); +$b = random(10,15,1); +$c = random(20,25,1); +$d = $a+$b+$c; +$i = 100 - ($d); +$e = 0.01*$a; +$f = 0.01*$b; +$g = 0.01*$c; +$h = 0.01*$i; + + +BEGIN_TEXT +$PAR +A survey asks adults to report their marital status. Suppose that in the city which +the survey is conducted, $a$PERCENT of adults are married, $b$PERCENT are single, $c$PERCENT +are divorced, and $i$PERCENT are widowed. Find the probabilities of each of the following events: +$PAR +The adult is single: \{ans_rule(15)\} +$PAR +The adult is not divorced: \{ans_rule(15)\} +$PAR +The adult is either widowed or divorced: \{ans_rule(15)\} +$BR + +END_TEXT + +Context("Percent"); +ANS(Percent($f)->cmp ); +ANS(Percent(1-$g)->cmp ); +ANS(Percent($g+$h)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/stat212-HW03-20.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/stat212-HW03-20.pg new file mode 100644 index 0000000000..e5d0593744 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/stat212-HW03-20.pg @@ -0,0 +1,72 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('probability') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('6/9/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$a = random(.3,.6,.01); +$b = random(.05,.10,.01); +$c = random(.2,.29,.01); +$d = 1 - ($a+$b+$c); + + +BEGIN_TEXT +$PAR +Four candidates are running for mayor. The four candidates are Adams, Brown, Collins, and Dalton. Employing the subjective approach, a political scientist has assigned the following probabilities: +$PAR +\(P(\)Adams wins\()\) = $a +$PAR +\(P(\)Brown wins\()\) = $b +$PAR +\(P(\)Collins wins\()\) = $c +$PAR +\(P(\)Dalton wins\()\) = $d +$PAR +Determine the following probabilities: +$PAR +\(P(\)Adams loses\()\) = \{ans_rule(15)\} +$PAR +\(P(\)Either Brown or Dalton wins\()\) = \{ans_rule(15)\} +$PAR +\(P(\)Either Adams, Brown, or Collins wins\()\) = \{ans_rule(15)\} +$BR + +END_TEXT + +Context("Percent"); +ANS(Percent(1-$a)->cmp ); +ANS(Percent($b+$d)->cmp ); +ANS(Percent($a+$b+$c)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/stat212-HW04-03.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/stat212-HW04-03.pg new file mode 100644 index 0000000000..3fe326d7d7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/stat212-HW04-03.pg @@ -0,0 +1,66 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/10/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$a = random(5,15,1); +$b = 1 - ($a); +$c = 0.01*$a; +$d = 1 - $c; + + +BEGIN_TEXT +$PAR +Approximately $a$PERCENT of people are left-handed. If two +people are selected at random, what is the probability of the following events? +$PAR +A. P(Both are right-handed) = \{ans_rule(15)\} +$PAR +B. P(Both are left-handed) = \{ans_rule(15)\} +$PAR +C. P(One is right-handed and the other is left-handed) = \{ans_rule(15)\} +$PAR +D. P(At least one is right-handed) = \{ans_rule(15)\} + +$BR + +END_TEXT +Context("Percent"); +ANS(Percent($d*$d)->cmp ); +ANS(Percent($c*$c)->with(decimalPlaces => 2,tolerance => .00005)->cmp); +ANS(Percent(($c*$d)+($c*$d))->cmp ); +ANS(Percent(($c*$d)+($c*$d)+($d*$d))->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/ur_dis_9_17.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/ur_dis_9_17.pg new file mode 100644 index 0000000000..2a4e2bbd31 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/ur_dis_9_17.pg @@ -0,0 +1,54 @@ +## DESCRIPTION +## Card Probability Problem +## ENDDESCRIPTION + +## KEYWORDS('Card', 'Probability') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +#Numerical Answer + +$a =4/52; +$b =13/52; +$c =16/52; + +TEXT(beginproblem()); + +BEGIN_TEXT +A card is selected at random from a standard 52-card deck. +$BR$BR +(a) What is the probability that it is an ace? \{ ans_rule(10) \} +$BR$BR +(b) What is the probability that it is a heart? \{ ans_rule(10) \} +$BR$BR +(c) What is the probability that it is an ace or a heart? \{ ans_rule(20) \} +END_TEXT + +Context("Percent"); +ANS(Percent( $a )->cmp ); +ANS(Percent( $b )->cmp ); +ANS(Percent( $c )->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/ur_dis_9_19.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/ur_dis_9_19.pg new file mode 100644 index 0000000000..8cb4cb2b56 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/ur_dis_9_19.pg @@ -0,0 +1,46 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl" +); + +$a = random(3,9,1); +$b = floor(100/$a); +$c = $b/100; + +TEXT(beginproblem()); + +BEGIN_TEXT +What is the probability that a randomly chosen (uniformly random) positive integer \( m \) in the range +\( 1 \leq m \leq 100 \) is divisible by $a? +$BR +\{ ans_rule(10) \} +$PAR +END_TEXT + +ANS(num_cmp( $c ) ); + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Statistics/BasicProbability/ur_pb_5_2.pg b/OpenProblemLibrary/PCC/Statistics/BasicProbability/ur_pb_5_2.pg new file mode 100644 index 0000000000..dd880e82ac --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BasicProbability/ur_pb_5_2.pg @@ -0,0 +1,59 @@ +## DESCRIPTION +## Basic Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + + +$p = random(1000,4000,1); +$q = random(6000,7000,1); + +Context("Percent"); +Context()->flags->set( + decimalPlaces => 3, + tolerance => .000005, + ); + +$ans1 = Percent(1/$q); + + +BEGIN_TEXT +A financial firm is performing an assessment test and relies on a random +sampling of their accounts. Suppose this firm has \($q\) customer accounts numbered from +\(0001\) to \($q\).$PAR +One account is to be chosen at random. What is the probability that the +selected account number is \($p\)? \{ans_rule(10) \} + +END_TEXT + +ANS($ans1->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-13.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-13.pg new file mode 100644 index 0000000000..d713b29f6a --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-13.pg @@ -0,0 +1,105 @@ +## DESCRIPTION +## Statistics: Probability +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'probability') +## naw tagged this problem. + +## DBchapter('Continuous Probability Distributions') +## DBsection() +## Date('6/30/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"PGnauStats.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserOneOf.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a = random(52,54,0.1); +$b = random(400,600,10); +$c = random(48,50,0.1); +$sigma = Real(sqrt($a/100*(1-$a/100)*$b)); +$mu = $a/100*$b; + +$sucdec = ($a/100); +$faildec = (1-$sucdec); + +$c1 = $c/100*$b; +$z = ($c1 - $mu)/$sigma; +$z2 = ($c1 - 0.5- $mu)/$sigma; + +$d = ceil($b*$c/100); +$exact = 0; +for my $i (0..($d-1)){ +$multiplier = 1; +for my $j (1..$i) { + $multiplier = $multiplier * ($b-$i+$j)/$j; +} + $exact= $exact+ $multiplier*(($a/100)**$i)*((1-$a/100)**($b-$i)); +} + +$diagram = DrawNormalDist($z, -99, $z, "", outside=>1); + +$ans1 = normal_prob('-infty', $z, mean=>0, deviation=>1); +$ans2 = normal_prob('-infty', $z2, mean=>0, deviation=>1); + +Context("Percent"); +$ans = OneOf(Percent($exact),Percent($ans1),Percent($ans2)); + + +BEGIN_TEXT +$PAR +The proportion of eligible voters in the next election who +will vote for the incumbent is assumed to be \($a$PERCENT\). +What is the probability that in a random sample of \($b\) voters, +less that \($c$PERCENT\) say they will vote for the incumbent? +$PAR +\{ans_rule(15)\} +$PAR + + +END_TEXT + +ANS($ans -> cmp()); + +################################################### +BEGIN_SOLUTION + +As we have large sample size, it would make sense to use the normal approximation of the binomial model if our "pass / fail" condition hold. Since \($b\cdot$sucdec >10\) and \($b\cdot$faildec >10\) we can can use our normal model approximation. +$PAR +With our normal model we have mean \(\mu=np\) and \(\sigma = \sqrt{npq}\). Thus, \(\mu=$mu\) and \(\sigma = $sigma\). +$PAR +The probability that less than \($c$PERCENT\) of people will vote for the incumbent, in a sample of \($b\), is the same saying less than \($c1\) people will vote for the incumbent. This allows us to find \(z=\frac{$c1-$mu}{$sigma} = $z\). +$PAR +Using our normal curve, seen below, with \(z<$z\). +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +We find that the probability is \($ans1\) + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-14.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-14.pg new file mode 100644 index 0000000000..a8f245d932 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-14.pg @@ -0,0 +1,105 @@ +## DESCRIPTION +## Statistics: Probability +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'probability') +## naw tagged this problem. + +## DBchapter('Continuous Probability Distributions') +## DBsection() +## Date('6/30/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"PGnauStats.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserOneOf.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a = random(62,64,0.1); +$b = random(400,600,10); +$c = random(58,60,0.1); + +$sucdec = ($a/100); +$faildec = (1-$sucdec); + +$sigma = Real(sqrt($a/100*(1-$a/100)*$b)); +$mu = $a/100*$b; + +$c1 = $c/100*$b; +$z = ($c1 - $mu)/$sigma; +$z2 = ($c1 - 0.5- $mu)/$sigma; + +$d = ceil($b*$c/100); +$exact = 0; +for my $i (0..($d-1)){ +$multiplier = 1; +for my $j (1..$i) { + $multiplier = $multiplier * ($b-$i+$j)/$j; +} + $exact= $exact+ $multiplier*(($a/100)**$i)*((1-$a/100)**($b-$i)); +} + + +$diagram = DrawNormalDist($z, -99, $z, "", outside=>1); + +$ans1 = normal_prob('-infty', $z, mean=>0, deviation=>1); +$ans2 = normal_prob('-infty', $z2, mean=>0, deviation=>1); + +Context("Percent"); +$ans = OneOf(Percent($exact),Percent($ans1),Percent($ans2)); + +BEGIN_TEXT +$PAR +A manufacturer of aspirin claims that the proportion of +headache sufferers who get relief with just two aspirins +is \($a$PERCENT\). What is the probability that in a random +sample of \($b\) headache sufferers, less than \($c$PERCENT\) obtain relief? +$PAR +\{ans_rule(15)\} +$PAR + +END_TEXT + +ANS($ans->cmp()); + +################################################### +BEGIN_SOLUTION + +As we have large sample size, it would make sense to use the normal approximation of the binomial model if our "pass / fail" condition hold. Since \($b\cdot$sucdec >10\) and \($b\cdot$faildec >10\) we can can use our normal model approximation. +$PAR +With our normal model we have mean \(\mu=np\) and \(\sigma = \sqrt{npq}\). Thus, \(\mu=$mu\) and \(\sigma = $sigma\). +$PAR +The probability that less than \($c$PERCENT\) of surfers will have relief, in a sample of \($b\), is the same saying less than \($c1\) people will receive relief. This allows us to find \(z=\frac{$c1-$mu}{$sigma} = $z\). +$PAR +Using our normal curve, seen below, with \(z<$z\). +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +We find that the probability is \($ans1\) + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-15.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-15.pg new file mode 100644 index 0000000000..249c1e3218 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-15.pg @@ -0,0 +1,91 @@ +## DESCRIPTION +## Statistics: Probability +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'probability') +## naw tagged this problem. + +## DBchapter('Continuous Probability Distributions') +## DBsection() +## Date('6/30/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a = random(76,81,1); +$b = random(30,40,2); +$c = random(70,73,1); +$a1 = .01*$a; +$c1 = .01*$c; +$a2 = 1-$a1; +$p = ((($a1*$a2)/$b))**(0.5); +$z = ($c1-$a1)/$p; + + +$d = ceil($b*$c/100); +$lessthan = ($d-1); +$exact = 0; +for my $i (0..($d-1)){ +$multiplier = 1; +for my $j (1..$i) { + $multiplier = $multiplier * ($b-$i+$j)/$j; +} + $exact= $exact+ $multiplier*(($a/100)**$i)*((1-$a/100)**($b-$i)); +} + +$exactreal = Real($exact); + +BEGIN_TEXT +$PAR +A psychologist believes that \($a$PERCENT\) of male drivers +when lost continue to drive, hoping to find the location +they seek rather than ask directions. To examine this +belief, he took a random sample of \($b\) male drivers and +asked each what they did when lost. If the belief is +true, determine the probability that less than \($c$PERCENT\) +said they continue driving. +$PAR +\{ans_rule(15)\} +$PAR + +END_TEXT + +Context("Percent"); +ANS(Percent($exact)->cmp); + +################################################### +BEGIN_SOLUTION + +The normal model is likely not appropriate here as the sample is only \($b\). Since we want to determine the probability that less than \($c$PERCENT\) continue to drive, this is the same as less than \($c1 \cdot $b=$d\) people continue to drive. As we are interested in the situation "less than," we will not include \($d\) in our calculation. +$PAR +In effect, this means we need to compute \(\text{P}(X\leq $lessthan) = \text{P}(X=0)+\text{P}(X=1)+...+...+\text{P}(X=$lessthan)=$exactreal\) + + + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-16.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-16.pg new file mode 100644 index 0000000000..a923bfa155 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/stat212-HW07-16.pg @@ -0,0 +1,97 @@ +## DESCRIPTION +## Statistics: Probability +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'probability') +## naw tagged this problem. + +## DBchapter('Continuous Probability Distributions') +## DBsection() +## Date('6/30/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"MathObjects.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"PGnauStats.pl", +"contextPercent.pl", +"parserOneOf.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$n = random(600,800,10); +$mu = ($n*0.25); +$sigma = Real(sqrt(0.1875*$n)); +$c = floor(0.25*$n + non_zero_random(-2,2,0.1)*$sigma); +$z = Real(($c-.5-$n/4)/$sigma); +$z2 = ($c-$n/4)/$sigma; + + +$exact = 0; +for my $i (0..($c-1)){ +$multiplier = 1; +for my $j (1..$i) { + $multiplier = $multiplier * ($n-$i+$j)/$j; +} + $exact= $exact+ $multiplier*((1/4)**$i)*((3/4)**($n-$i)); +} +$exact = 1- $exact; + +$diagram = DrawNormalDist(99, $z2, "", $z2, outside=>1); + +BEGIN_TEXT +$PAR +An accounting professor claims that no more than one +quarter of undergraduate business students will major +in accounting. What is the probability that in a random +sample of \($n\) undergraduate business students, \($c\) or more +will major in accounting? +$PAR +\{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +$ans1 = Percent(normal_prob($z, 'infty', mean=>0, deviation=>1)); +$ans2 = Percent($exact); +$ans3 = Percent(normal_prob($z2, 'infty', mean=>0, deviation=>1)); +$ans = OneOf($ans1,$ans2,$ans3); +ANS($ans->cmp()); + +################################################### +BEGIN_SOLUTION + +An accounting professor claims that no more than one quarter, which is \(25$PERCENT\), of undergraduate business students will major in accounting. This means we can use \(p=0.25\) and \(q=0.75\). As we have a large sample size, it would make sense to use the normal approximation of the binomial model if our "pass / fail" condition holds. Since \($n\cdot 0.25 >10\) and \($n\cdot 0.75 >10\) we can use our normal model approximation. +$PAR +We have mean \(\mu=np\) and \(\sigma = \sqrt{npq}\). Thus, \(\mu=$mu\) and \(\sigma = $sigma\). +$PAR +We wish to find the probability of more than \($c\) students majoring in accounting. This allows us to \(z=\frac{$c-$mu}{$sigma} = $z2\). +$PAR +Using our normal curve, seen below, with \(z>$z2\). +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +We find that the probability is \($ans3\) + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_1.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_1.pg new file mode 100644 index 0000000000..14836637bb --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_1.pg @@ -0,0 +1,69 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem', 'Normal', 'Approximate') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(45,55,1); +@quest = ("at least", "exactly", "at most", "more than", "less than"); +$tag = random(0,4,1); + +$n1 = $n-0.5; +$n2 = $n+0.5; + +$ans[0] = normal_prob($n1, 'infty', mean=>50, deviation=>5); +$ans[1] = normal_prob($n1, $n2, mean=>50, deviation=>5); +$ans[2] = normal_prob('-infty', $n2, mean=>50, deviation=>5); +$ans[3] = normal_prob($n2, 'infty', mean=>50, deviation=>5); +$ans[4] = normal_prob('-infty', $n1, mean=>50, deviation=>5); + +BEGIN_TEXT + +Use normal approximation with the continuity correction to estimate the probability of getting $quest[$tag] \($n\) +girls in \(100\) births. +Assume that boys and girls are equally likely. $BR + +\{ans_rule(10)\} + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3,tolType=>relative,tolerance=>0.001,trimTrailingZeros=>1); +ANS(Percent($ans[$tag])->cmp); + +################################################### +BEGIN_SOLUTION + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_2.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_2.pg new file mode 100644 index 0000000000..1523f3b413 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_2.pg @@ -0,0 +1,65 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem', 'Normal', 'Approximate') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +"PGauxiliaryFunctions.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(50,80,2); +$p = random(55,65,5); + +$mean = $n/2; +$dev = sqrt($n)/2; +$a = ceil($n * $p / 100) -0.5; + +$ans = normal_prob($a,'infty', mean=>$mean, deviation=>$dev); + +BEGIN_TEXT + +Use normal approximation with the continuity correction to estimate the probability of passing a true/false test of \($n\) +questions if the minimum passing grade is \($p$PERCENT\) and all responses are random guesses. $BR + +\{ans_rule(10)\} + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3,tolType=>relative,tolerance=>0.001,trimTrailingZeros=>1); +ANS(Percent($ans)->cmp); + +################################################### +BEGIN_SOLUTION + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_3.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_3.pg new file mode 100644 index 0000000000..5a52cab9b5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_3.pg @@ -0,0 +1,68 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +do { +$b = random(150,400,1); +$p = random(80,90,1); +$mean = $b * $p / 100; +$dev = sqrt ($b * $p / 100 * (100 - $p) / 100); +$z = random(1.7, 3.1, 0.01); +$s = 10*int(($z * $dev + $mean)/10+1); } until ($b - $s >= 8); + +$ans = normal_prob($s+0.5, 'infty', mean=>$mean, deviation=>$dev); + +BEGIN_TEXT + +An airline company is considering a new policy of booking as many as \($b\) persons on an +airplane that can seat only \($s\). +(Past studies have revealed that only \($p$PERCENT\) of the booked passengers actually arrive for the flight.) +Estimate the probability that if the company books \($b\) persons, not enough seats will be available. Use the Normal approximation to the binomial distribution with the continuity correction, even if you know how to find the exact answer.$BR + +\{ans_rule(10)\} + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>8,tolType=>relative,tolerance=>0.001,trimTrailingZeros=>1); +ANS(Percent($ans)->cmp); + + +################################################### +BEGIN_SOLUTION + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_4.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_4.pg new file mode 100644 index 0000000000..30d46fc9c8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_12_4.pg @@ -0,0 +1,76 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(20,30,1); +@answers = ('a, b, c, and d', 'a, b, c, d, and e', 'a, b, c, d, e, and f'); +$tag = random(0,2,1); +$mean = $n/(4+$tag); +$low = int($mean + 4); +$high = int($mean + 8); +$corr = random($low, $high, 1); +$corr1 = $corr -0.5; + +$dev = sqrt( $n / (4+$tag) * (3+$tag) / (4+$tag)); + + +$prob = 0; +for my $i ($corr..$n) { + $prob = $prob + fact($n)/fact($i)/fact($n-$i)*(1/(4+$tag)**$i)*((3+$tag)/(4+$tag))**($n-$i); +} + +BEGIN_TEXT + +A multiple-choice test consists of \($n\) questions with possible answers of $answers[$tag]. +Estimate the probability that with random guessing, the number of correct answers +is at least \($corr\).$BR + +\{ans_rule(10)\} + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3, +tolType=>relative, +tolerance=>0.001, +trimTrailingZeros=>1); + +ANS(Percent($prob)->cmp); + +################################################### +BEGIN_SOLUTION + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_1.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_1.pg new file mode 100644 index 0000000000..da268d7c38 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_1.pg @@ -0,0 +1,106 @@ +##DESCRIPTION +##KEYWORDS('probability','binomial random variable', 'probability dist') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('3.4') +## Problem1('28') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +for ($i=0; $i<4; $i++) { + $n[$i] = random(3,6,1); +} + +for ($i=0; $i<4; $i++) { + $x[$i] = random(0,$n[$i],1); +} + +for ($i=0; $i<4; $i++) { + $p[$i] = random(.1,.9,.1); +} + +for ($i=0; $i<4; $i++){ + $comb[$i] = fact ($n[$i])/(fact ($x[$i])*fact ($n[$i]-$x[$i])); + $other[$i] = $p[$i]**($x[$i])*(1-$p[$i])**($n[$i]-$x[$i]); + $prob[$i] = $comb[$i]*$other[$i]; + $fail[$i] = $n[$i]-$x[$i]; + $q[$i] = (1-$p[$i]); +} + + +BEGIN_TEXT +If \(X\) is a binomial random variable, compute \(P(X=k)\) for each of the following cases: $PAR +(a) \( \) \( n = $n[0], k = $x[0], p = $p[0]\) +$BR +\(P(X=k) =\) \{ans_rule(10)\} $PAR + +(b) \( \) \( n = $n[1], k = $x[1], p = $p[1]\) +$BR +\(P(X=k) =\) \{ans_rule(10)\} $PAR + +(c) \( \) \( n = $n[2], k = $x[2], p = $p[2]\) +$BR +\(P(X=k) =\) \{ans_rule(10)\} $PAR + +(d) \( \) \( n = $n[3], k = $x[3], p = $p[3]\) +$BR +\(P(X=k) =\) \{ans_rule(10)\} +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3,tolerance=>0.00005,trimTrailingZeros=>1); +ANS(Percent($prob[0])->cmp); +ANS(Percent($prob[1])->cmp); +ANS(Percent($prob[2])->cmp); +ANS(Percent($prob[3])->cmp); + +################################################### +BEGIN_SOLUTION +Note that \(C_{n,k}\) stands for N choose K. +$PAR +(a) With \(n = $n[0], k = $x[0], p = $p[0]\), we find, +$PAR +\(\text{P}(X=$x[0])=C_{$n[0],$x[0]} \cdot ($p[0])^$x[0] \cdot ($q[0])^$fail[0] = $prob[0]\) +$PAR +(b) With \(n = $n[1], k = $x[1], p = $p[1]\), we find, +$PAR +\(\text{P}(X=$x[1])=C_{$n[1],$x[1]} \cdot ($p[1])^$x[1] \cdot ($q[1])^$fail[1] = $prob[1]\) +$PAR +(c) With \(n = $n[2], k = $x[2], p = $p[2]\), we find, +$PAR +\(\text{P}(X=$x[2])=C_{$n[2],$x[2]} \cdot ($p[2])^$x[2] \cdot ($q[2])^$fail[2] = $prob[2]\) +$PAR +(d) With \(n = $n[3], k = $x[3], p = $p[3]\), we find, +$PAR +\(\text{P}(X=$x[3])=C_{$n[3],$x[3]} \cdot ($p[3])^$x[3] \cdot ($q[3])^$fail[3] = $prob[3]\) +$PAR + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_3.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_3.pg new file mode 100644 index 0000000000..39f5f87e29 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_3.pg @@ -0,0 +1,134 @@ +##DESCRIPTION +##KEYWORDS('probability','binomial random variable', 'probability dist', 'mean', 'standard +##deviation') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('3.4') +## Problem1('26') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +for ($i=0; $i<4; $i++) { + $n[$i] = random(3,6,1); +} + +for ($i=0; $i<4; $i++) { + $p[$i] = random(.1,.9,.1); +} + +$mean0 = $n[0]*$p[0]; +$mean1 = $n[1]*$p[1]; +$mean2 = $n[2]*$p[2]; +$mean3 = $n[3]*$p[3]; + +$var0 = Real($n[0]*$p[0]*(1-$p[0])); +$var1 = Real($n[1]*$p[1]*(1-$p[1])); +$var2 = Real($n[2]*$p[2]*(1-$p[2])); +$var3 = Real($n[3]*$p[3]*(1-$p[3])); + +$sd0 = Real(sqrt($var0)); +$sd1 = Real(sqrt($var1)); +$sd2 = Real(sqrt($var2)); +$sd3 = Real(sqrt($var3)); + +BEGIN_TEXT +If \(X\) is a binomial random variable, compute the mean, the standard deviation, and the +variance for each of the following cases: $PAR +(a) \( n = $n[0], p = $p[0]\) +$BR +\(\mu_X = \) \{ans_rule(10)\} $BR +\(\sigma_X^2 = \) \{ans_rule(10)\} $BR +\(\sigma_X =\) \{ans_rule(10)\}$PAR +(b) \( n = $n[1], p = $p[1]\) +$BR +\(\mu_X = \) \{ans_rule(10)\} $BR +\(\sigma_X^2 = \) \{ans_rule(10)\} $BR +\(\sigma_X = \) \{ans_rule(10)\} $PAR +(c) \( n = $n[2], p = $p[2]\) +$BR +\(\mu_X = \) \{ans_rule(10)\} $BR +\(\sigma_X^2 = \) \{ans_rule(10)\} $BR +\(\sigma_X = \) \{ans_rule(10)\} $PAR +(d) \( n = $n[3], p = $p[3]\) +$BR +\(\mu_X = \) \{ans_rule(10)\} $BR +\(\sigma_X^2 = \) \{ans_rule(10)\} $BR +\(\sigma_X = \) \{ans_rule(10)\} +END_TEXT +Context("Numeric"); + +ANS(Real($mean0)->cmp); +ANS(Real($var0)->cmp); +ANS(Real($sd0)->cmp); + +ANS(Real($mean1)->cmp); +ANS(Real($var1)->cmp); +ANS(Real($sd1)->cmp); + +ANS(Real($mean2)->cmp); +ANS(Real($var2)->cmp); +ANS(Real($sd2)->cmp); + +ANS(Real($mean3)->cmp); +ANS(Real($var3)->cmp); +ANS(Real($sd3)->cmp); + +################################################### +BEGIN_SOLUTION +Note that for all questions, we can apply \(\mu_X=np\) and \(\sigma_X = \sqrt{npq}\). Additionally, \(\operatorname{VAR}(X) = (\sigma_X)^2\). +$PAR +(a) \(\mu_X = $n[0]\cdot $p[0]=$mean0\) +$PAR +\(\sigma_X = \sqrt{$n[0]*$p[0]*(1-$p[0])} = $sd0\) +$PAR +\((\sigma_X)^2 = ($sd0)^2 = $var0\) +$PAR +(b) \(\mu_X = $n[1]\cdot $p[1]=$mean1\) +$PAR +\(\sigma_X = \sqrt{$n[1]*$p[1]*(1-$p[1])} = $sd1\) +$PAR +\((\sigma_X)^2 = ($sd1)^2 = $var1\) +$PAR +(c) \(\mu_X = $n[2]\cdot $p[2]=$mean2\) +$PAR +\(\sigma_X = \sqrt{$n[2]*$p[2]*(1-$p[2])} = $sd2\) +$PAR +\((\sigma_X)^2 = ($sd2)^2 = $var2\) +$PAR$PAR +(d) \(\mu_X = $n[3]\cdot $p[3]=$mean3\) +$PAR +\(\sigma_X = \sqrt{$n[3]*$p[3]*(1-$p[3])} = $sd3\) +$PAR +\((\sigma_X)^2 = ($sd3)^2 = $var3\) +$PAR +END_SOLUTION +################################################### + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_4.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_4.pg new file mode 100644 index 0000000000..b145298cf7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_4.pg @@ -0,0 +1,76 @@ +## DESCRIPTION +## Apply the Binomial Distribution +## ENDDESCRIPTION + +## KEYWORDS('Binomial Distribution') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl" + +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(10,20,10); +$a = random(4,6,1); +$p = random(5*floor(100/$a/5)+15,5*floor(100/$a/5)+20,5); +$pperc = ($p/100); +$suc = (1/$a); + +$must_guess = ceil($n * $p / 100); +$prob = 0; +for ($i=$must_guess; $i<$n+1; $i++) { + $prob = $prob + fact($n)/fact($i)/fact($n-$i)/($a**$i)*((($a-1)/$a)**($n-$i)); +} +$mgplus = ($must_guess+1); +$result = Real($prob); + +BEGIN_TEXT + +A quiz consists of \($n\) multiple-choice questions, each with \($a\) possible answers. +For someone who makes random guesses for all of the answers, find the probability of passing +if the minimum passing grade is \($p$PERCENT\). $BR +\{ans_rule(15)\}$BR + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3,tolType=>relative,tolerance=>0.001,trimTrailingZeros=>1); + +ANS(Percent($prob)->cmp); + +################################################### +BEGIN_SOLUTION + +Our sample size is too small to use the normal approximation. If the minimum passing grade is \($p$PERCENT\), then one must have at least \($p\cdot$pperc=$must_guess\) answers correct out of \($n\) questions. With \($a\) choices per question, the probability of success is \($suc\). +$PAR +This leaves us to find \(\text{P}(X\geq$must_guess)\). +$PAR +\(\text{P}(X\geq$must_guess) = \text{P}(X=$must_guess) + \text{P}(X=$mgplus)+...+...+\text{P}(X=$n)=$result\). + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_5.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_5.pg new file mode 100644 index 0000000000..9798289715 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_5.pg @@ -0,0 +1,113 @@ +##DESCRIPTION +##KEYWORDS('probability','binomial random variable', 'probability dist') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('3.4') +## Problem1('32') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +for ($i=0; $i<4; $i++) { + $n[$i] = random(3,9,1); + $p = $n[$i]-1; + $x[$i] = random(1,$p,1); + $p[$i] = random(.1,.9,.1); +} + +for ($i=0; $i<4; $i++){ + for ($j=0; $j<($n[$i]+1); $j++) { + $comb[$i][$j] = fact ($n[$i])/(fact ($j)*fact ($n[$i]-$j)); + $other[$i][$j] = $p[$i]**($j)*(1-$p[$i])**($n[$i]-$j); + $prob[$i][$j] = $comb[$i][$j]*$other[$i][$j]; +} +} + +$sum0 = 0; +for ($j=0; $j<($x[0]+1); $j+=1){ + $sum0 = $sum0+$prob[0][$j]; +} + +$sum1 = 0; +for ($j=($x[1]+1); $j<($n[1]+1); $j+=1){ + $sum1 = $sum1+$prob[1][$j]; +} + +$sum2 = 0; +for ($j=0; $j<$x[2]; $j+=1){ + $sum2 = $sum2+$prob[2][$j]; +} + +$sum3 = 0; +for ($j=$x[3]; $j<($n[3]+1); $j+=1){ + $sum3 = $sum3+$prob[3][$j]; +} + + +BEGIN_TEXT +If \(X\) is a binomial random variable, compute each of the following: $PAR +(a) \( n = $n[0] , p = $p[0] \) $BR +$BR +\( P(X\leq $x[0]) = \) \{ans_rule(10)\} $PAR +(b) \( n = $n[1] , p = $p[1] \) $BR +$BR +\( P(X> $x[1]) = \) \{ans_rule(10)\} $PAR +(c) \( n = $n[2] , p = $p[2] \) $BR +$BR +\( P(X< $x[2]) = \) \{ans_rule(10)\} $PAR +(d) \( n = $n[3] , p = $p[3] \) $BR +$BR + \( P(X\geq $x[3]) = \) \{ans_rule(10)\} +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3,tolType=>relative,tolerance=>0.001,trimTrailingZeros=>1); +ANS(Percent($sum0)->cmp); +ANS(Percent($sum1)->cmp); +ANS(Percent($sum2)->cmp); +ANS(Percent($sum3)->cmp); + +################################################### +BEGIN_SOLUTION +All probabilities can be found using Technology. Note that with MS Excel or a TI calculator, +$PAR + 1. Any question of the form, \(\text{P}(Xk)\) or \(\text{P}(X\geq k)\) will use \(n\) as the ''upper'' value. +$PAR +(a) \( P(X\leq $x[0]) = $sum0\) +$PAR +(b) \( P(X > $x[1]) = $sum1\) +$PAR +(c) \( P(X < $x[2]) = $sum2\) +$PAR +(d) \( P(X\geq $x[3]) = $sum3\) +$PAR +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_6.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_6.pg new file mode 100644 index 0000000000..8347ce1a48 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_6.pg @@ -0,0 +1,85 @@ +## DESCRIPTION +## Apply the Binomial Distribution +## ENDDESCRIPTION + +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/3/2002') +## TitleText1('Mathematical Statistics') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## EditionText1('6') +## Section1('3.4') +## Problem1('40') +## KEYWORDS('Binomial Distribution', 'Mean', 'Standard Deviation','probability','statistics','binomial') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(1100,1400,10); +$mean = $n * 0.82; +$dev = Real(sqrt($n*0.82*0.18)); +$low = int($mean - 4*$dev); +$high = int($mean + 4*$dev); +$s = random($low,$high,1); +$z = Real(($s-$mean)/$dev); + +if ($s < $mean - 2*$dev ) { $ans = 'low';} +elsif ($s > $mean + 2*$dev ) { $ans = 'high';} +else { $ans = 'neither'; } + +$popup = PopUp(['?','low','high','neither'],$ans); + +BEGIN_TEXT +The Census Bureau reports that \(82$PERCENT\) of Americans over the age of \(25\) are high school graduates. +A survey of randomly selected residents of certain county included \($n\) who were over the age of \(25\), +and \($s\) of them were high school graduates. $BR + +(a) Find the mean and standard deviation for the total number of high school graduates in random groups of \($n\) Americans who are over the age of \(25\). $BR + +Mean = \{ans_rule(15)\} $BR + +Standard deviation = \{ans_rule(15)\} $BR + +(b) Is that county result of \($s\) unusually high, or low, or neither? \{$popup->menu\} + + +END_TEXT + +ANS(Real($mean)->cmp); +ANS(Real($dev)->cmp); +ANS($popup->cmp); + +################################################### +BEGIN_SOLUTION + +For the binomial model we have mean \(\mu=np\) and standard deviation \(\sigma = \sqrt{npq}\). Thus, +$PAR +(a) \(\mu=$mean\) +$PAR +(b) \(\sigma = $dev\) +$PAR +(c) To decide if the county result of \($s\) is unusually high, low, or neither, we need to find a \(z\)-score. This assumes we should be able to use a normal model. Thus \(z=\frac{$s-$mean}{$dev}=$z\) +$PAR +Generally we think of any \(z<-3\) to be unusually low and \(z>3\) to be unusually high. In this case the result is "$ans." + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_8.pg b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_8.pg new file mode 100644 index 0000000000..a14e8b6c3f --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/BinomialDistribution/ur_pb_8_8.pg @@ -0,0 +1,74 @@ +##DESCRIPTION +##KEYWORDS('probability', 'binomial distribution') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('3.4') +## Problem1('27') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(20,30,1); +$k = random(int(.7*$n), int(.9*$n),1); +$kplus = ($k+1); + +$ans = 0; +for ($i = $k; $i<($n+1); $i++){ + $ans = $ans + fact($n)/fact($i)/fact($n - $i)/2**$n; +} + +$ansdec = Real($ans/100); +BEGIN_TEXT + +A man claims to have extrasensory perception. As a test, a fair coin is flipped \($n\) times, and the man is asked to predict the outcome in +advance. He gets \($k\) out of \($n\) correct. What is the probability that he would have done at least this well if he had no ESP? Do not try to use Normal approximation.$BR + +\{ans_rule(20)\} + +END_TEXT +Context("Percent")->flags->set(decimalPlaces=>3, +tolType=>relative, +tolerance=>0.001, +trimTrailingZeros=>1); + +ANS(Percent($ans)->cmp); + +################################################### +BEGIN_SOLUTION + +We cannot use the normal approximation and need to find the probability this person will predict the coin toss correctly at least \($k\) out of \($n\) times. Thus, we need to find, +$PAR +\(\text{P}(X\geq$k) = \text{P}(X=$k)+\text{P}(X=$kplus)+...+...+\text{P}(X=$n)=$ansdec\) + +END_SOLUTION +################################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_03_SamplingDistns.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_03_SamplingDistns.pg new file mode 100644 index 0000000000..f5c0691c63 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_03_SamplingDistns.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, E Cabrera') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The Bureau of Labor Statistics announces that last month it interviewed all members of the labor force in a sample of 60000 households; $BBOLD 4.9$PERCENT $EBOLD of the people interviewed were unemployed. The boldface number is a ", + "statistic. "); + $mc[0]->extra("parameter.", + "sampling distribution. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A study of voting chose 663 registered voters at random shortly after an election. Of these, 72$PERCENT said they had voted in the election. Election records show that only $BBOLD 56$PERCENT $EBOLD of registered voters voted in the election. The boldface number is a ", + "parameter. "); + $mc[1]->extra("statistic. ", + "sampling distribution." ); + $mc[1]->makeLast("None of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Annual returns on the more than 5000 common stocks available to investors vary a lot. In a recent year, the mean return was 8.3$PERCENT and the standard deviation of return was 28.5$PERCENT. The $BITALIC law of large numbers $EITALIC says that ", + "as you invest in more and more stocks chosen at random that year, your average return on these stocks gets ever closer to 8.3$PERCENT. "); + $mc[2]->extra("you can get an average return higher than the mean 8.3$PERCENT by investing in a large number of stocks. ", + "if you invest in a large number of stocks chosen at random, your average return will have approximately a Normal distribution. "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("The number of hours a light bulb burns before failing varies from bulb to bulb. The distribution of burnout times is skewed to the right. The $BITALIC central limit theorem $EITALIC says that ", + "the average burnout time of a large number of bulbs has a distribution that is close to Normal. "); + $mc[3]->extra("the average burnout time of a large number of bulbs has a distribution of the same shape (strongly skewed) as the distribution for individual bulbs. ", + "as we look at more and more bulbs, their average burnout time gets ever closer to the mean for all bulbs of this type. " ); + $mc[3]->makeLast("None of the above. "); + +################################################# +# Main + +BEGIN_TEXT +For the following problems, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_05_SamplingDistns.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_05_SamplingDistns.pg new file mode 100644 index 0000000000..affd2c6490 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_05_SamplingDistns.pg @@ -0,0 +1,81 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The sampling distribution of a statistic is ", + "the distribution of values taken by a statistic in all possible samples of the same size from the same population. "); + $mc[0]->extra("the probability that we obtain the statistic in repeated random samples. ", + "the mechanism that determines whether or not randomization was effective. ", + "the extent to which the sample results differ systematically from the truth. "); +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A statistic is said to be unbiased if ","the mean of its sampling distribution is equal to the true + value of the parameter being estimated. "); + $mc[1]->extra("the survey used to obtain the statistic was designed so as to avoid even the hint of racial or sexual prejudice. ", + "both the person who calculated the statistic and the subjects whose responses make up the statistic were truthful. ", + "it is used for only honest purposes. "); +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Sampling variation is caused by ","random selection of a sample. "); + $mc[2]->extra("changes in a population parameter from sample to sample. ", + "systematic errors in our procedure. ", + "changes in a population parameter that cannot be predicted. "); + +###################################### +# Main text + +BEGIN_TEXT +For the following problems, select the best response: + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_06_SamplingDistns.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_06_SamplingDistns.pg new file mode 100644 index 0000000000..67a101ebe4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_06_SamplingDistns.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch11SamplingDistributions/11Stats_06_SamplingDistns.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch11SamplingDistributions/11Stats_06_SamplingDistns.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_07_SamplingDistns.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_07_SamplingDistns.pg new file mode 100644 index 0000000000..dd2738050d --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_07_SamplingDistns.pg @@ -0,0 +1,89 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$mu = random(0.7, 0.9, 0.1); +$sigma = random(0.15,0.2,0.01); + +$n = ($sigma / 0.01) ** 2; + +@a = ("larger", "smaller"); +@answer = ("smaller", "larger"); +$choose = random(0,1,1); +$ans2 = $answer[$choose]; + +$popup = PopUp([ "?", "smaller", "larger", "the same"], $ans2); + +###################################### +# Main text + +BEGIN_TEXT +The level of nitrogen oxides (NOX) in the exhaust of a particular car model varies with mean $mu +grams per mile and standard deviation $sigma grams per mile . + +$PAR +(a) What sample size is needed so that the standard deviation of the sampling +distribution is 0.01 grams per mile ? +$BR +\{ans_rule(10)\} + +$PAR +(b) If a $a[$choose] sample is considered, the standard deviation for \( \bar x\) +would be \{$popup->menu\} +$BR +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + + +$ans_a = Compute($n)->with(tolType=>'absolute', tolerance=>'0.001'); +ANS($ans_a->cmp(showTypeWarnings=>0)->withPostFilter(AnswerHints( +# sub { +# my ($correct,$student,$anshash) = @_; +# return abs($student-$correct) < .4; +# } => ["Your answer should be a number."], + sub { + my ($correct,$student,$anshash) = @_; + return if ($student =~ /a..z,A..Z/); + return abs($student-$correct) < .4; + } => ["Your answer is close. Use more accuracy in your calculation."]))); + +ANS($popup->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_08_SamplingDistns.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_08_SamplingDistns.pg new file mode 100644 index 0000000000..e995d081cf --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_08_SamplingDistns.pg @@ -0,0 +1,88 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, E Cabrera') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mean = random(450,600,1); +$sdev = random(100,120,1); + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("Scores on the mathematics part of the SAT exam in a recent year were roughly Normal with mean $mean and standard deviation $sdev. You choose an SRS of 100 students and average their SAT math scores. If you do this many times, with a sample of size 100 each time, the mean of the average scores will get close to ", + $mean); + $mc[0]->extra($mean/100, + $mean/sqrt(100)); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("Scores on the mathematics part of the SAT exam in a recent year were roughly Normal with mean $mean and standard deviation $sdev. You choose an SRS of 100 students and average their SAT math scores. If you do this many times, with a sample of size 100 each time, the standard deviation of the average scores will get close to ", + $sdev/sqrt(100)); + $mc[1]->extra($sdev, + $sdev/100); + $mc[1]->makeLast("None of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("A newborn baby has extremely low birth weight (ELBW) if it weighs less than 1000 grams. A study of the health of such children in later years examined a random sample of 219 children. Their mean weight at birth was \( \bar {x} = \) 810 grams. This sample mean is an unbiased estimator of the mean weight \( \mu \) in the population of all ELBW babies. This means that ", "the average sample mean \( \bar {x} \), over all possible samples, is equal to \( \mu \)." ); + $mc[2]->extra("the sample mean \( \bar {x} \) is always equal to \( \mu \). ", + "the sample mean \( \bar {x} \) will have a distribution that is close to Normal. "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("The length of human pregnancies from conception to birth varies according to a distribution that is approximately Normal with mean 266 days and standard deviation 16 days. The probability that the average pregnancy length for 6 randomly chosen women exceeds 270 days is about ", + 0.27); + $mc[3]->extra(0.40, + 0.07 ); + $mc[3]->makeLast("None of the above. "); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_10_SamplingDistns.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_10_SamplingDistns.pg new file mode 100644 index 0000000000..05cfbadef1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_10_SamplingDistns.pg @@ -0,0 +1,131 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGstatisticsmacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$mu = random(530, 560, 0.1); +$sigma = random(25,30,0.1); +$n = random(25,35,5); +$sigmaSD = $sigma / sqrt($n); +$x = int($mu) + random(4,7,1); + +$zscore1 = ($x - $mu) / $sigma; +$pval1 = uprob(abs($zscore1)); + +$zscore2 = ($x - $mu) / $sigmaSD; +$pval2 = uprob(abs($zscore2)); + +###################################### +# Main text + +BEGIN_TEXT +The scores of students on the SAT college entrance examinations at a certain high school had +a normal distribution with mean \( \mu = $mu \) and standard deviation \( \sigma = $sigma \). + +$PAR +(a) What is the probability that a single student randomly chosen from all those taking +the test scores $x or higher? +$BR +\{ans_rule(10)\} + +$BR $BR +For parts (b) through (d), consider a simple random sample (SRS) of $n students who took the test. + +$PAR +(b) What are the mean and standard deviation of the sample mean score \( \bar x\), +of $n students? +$BR + The mean of the sampling distribution of \( \bar x \) is: \{ans_rule(10)\} +$BR + The standard deviation of the sampling distribution of \( \bar x \) is: \{ans_rule(10)\} + +$PAR +(c) What z-score corresponds to the mean score \( \bar x\) of $x? +$BR +\{ans_rule(10)\} + +$PAR +(d) What is the probability that the mean score \( \bar x\) of these students is $x or higher? +\{ans_rule(10)\} +$BR +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; +Context("Percent"); +$ans_a = Compute($pval1)->with(tolerance=>0.0005, tolType=> 'absolute'); +ANS(Percent($ans_a)->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .002; + } => ["Your answer is close. Try more accuracy in your calculation."] +))); + +$ans_b1 = Compute($mu)->with(tolerance=>0.001, tolType=> 'absolute'); +ANS($ans_b1->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) > .000001; + } => ["Consider the Central Limit Theorem."] +))); + +$ans_b2 = Compute($sigmaSD)->with(tolerance=>0.001, tolType=> 'absolute'); +ANS($ans_b2->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .005; + } => ["Your answer is close. Try more accuracy in your calculation."] +))); + +$ans_c = Compute($zscore2)->with(tolerance=>0.01, tolType=> 'absolute'); +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .04; + } => ["Your answer is close. Try more accuracy in your calculation."] +))); + +Context("Percent"); +$ans_d = Percent($pval2); +ANS($ans_d->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .002; + } => ["Your answer is close. Try more accuracy in your calculation."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_13_SamplingDistns.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_13_SamplingDistns.pg new file mode 100644 index 0000000000..ed7731c58f --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/11Stats_13_SamplingDistns.pg @@ -0,0 +1,111 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 11: Sampling Distributions') +## KEYWORDS('statistic', 'parameter', 'sampling distribution', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 11: Sampling Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGstatisticsmacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$mu = random(7.7, 8.3, 0.1); +$sigma = random(0.1,0.2,0.01); +@n = ("three", "four", "five"); +$sampleSize = random(3,5,1); +$sigmaSD = $sigma / sqrt($sampleSize); + +#-----Part a-------------------- +$x1 = $mu - random(0.1,0.2,0.01); +$zscore1 = ($x1 - $mu) / $sigmaSD; +$pval1 = uprob(abs($zscore1)); #NOTE: The area is above the zscore +$x2 = $mu + random(0.1,0.2,0.01); +$zscore2 = ($x2 - $mu) / $sigmaSD; +$pval2 = 1 - uprob(abs($zscore2)); +$pval = $pval2 - $pval1; + +#-----Part b-------------------- +$p = random(1,5,1); +$zscore = -1*udistr($p / 100); +$xscore = $mu + $zscore * $sigmaSD; + +###################################### +# Main text + +BEGIN_TEXT +The distribution of actual weights of 8-oz chocolate bars produced by a certain machine is normal +with mean $mu ounces and standard deviation $sigma ounces. + +$PAR +(a) What is the probability that the average weight of an SRS of $n[$sampleSize-3] of these chocolate bars is +between $x1 and $x2 ounces? +$BR +\{ans_rule(10)\} + +$PAR +(b) For a SRS of $n[$sampleSize-3] of these chocolate bars, what is the weight \( L \) such that there is +a $p$PERCENT chance that the average weight is less than \( L \) ounces per bar? +$BR +\{ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; +Context("Percent")->flags->set(tolerance=>0.0011); +$ans_a = Percent($pval); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .005; + } => ["Close!"], + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct*100) < .2; + } => ["Enter the probability, but not in percent form."]))); + +$ans_b = Compute($xscore)->with(tolerance=>0.01, tolType=> 'absolute'); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .03; + } => ["Your answer is close. Try more accuracy in your calculation."], + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$zscore) < .03; + } => ["Enter the cutoff for the average weight of the sample not the z score."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/central_limit_theorem1.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/central_limit_theorem1.pg new file mode 100644 index 0000000000..4cbf6737e3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/central_limit_theorem1.pg @@ -0,0 +1,43 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Central Limit Theorem') +## KEYWORDS('central limit') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 06/20/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl" + +); + +TEXT(&beginproblem); +$n = random( 50, 100, 1); +$per1 = random( 20, 50, 1 ); +$job = list_random ( 'pave new parking lots', 'build a new math building', ' build a new recreation center', +'build a new football stadium'); + +do{$per2 = random( 4, 100*0.5/sqrt($n)-0.1, .1 ); + $per3 = random(2, 7, .1 ); +} until( $per2 > $per3 ); + +$sd = ( $per2 / 100 ) * ( sqrt( $n ) ); +$ans = ceil( ( ( $sd * 100 ) / $per3 ) ** 2 ) ; + +BEGIN_TEXT + +A survey of $n students found that $per1$PERCENT were in favor of raising tution to $job. +The standard deviation of the sample proprortion is $per2$PERCENT. How large a sample (to the nearest person) would be required to reduce +this standard deviation to $per3$PERCENT? $PAR +\{ans_rule( 15 ) \} +END_TEXT + +ANS( num_cmp( $ans ) ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/central_limit_theorem2.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/central_limit_theorem2.pg new file mode 100644 index 0000000000..4505f6fb65 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/central_limit_theorem2.pg @@ -0,0 +1,45 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Central Limit Theorem') +## KEYWORDS('central limit') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 06/20/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", + +); + +TEXT(&beginproblem); + +$n = random( 50, 100, 1); +$newn = random(2* $n, 300, 1 ); +$per = random( 20, 50, 1 ); +$p1 = $per +non_zero_random(-10,30,5); +$psd = floor(100*sqrt($p1/100*(1-$p1/100)/$n)); +$job = list_random ( 'pave new parking lots', 'build a new math building', ' build a new recreation center', +'build a new football stadium'); + +$ans = $psd * sqrt($n/$newn ); + +BEGIN_TEXT + +A poll of $n students found that $per$PERCENT were in favor of raising tuition to $job. +The standard deviation of this poll is $psd$PERCENT. What would be the standard deviation +if the sample size were increased from $n to $newn? $PAR + \{ans_rule( 15 ) \} + +END_TEXT +Context("Percent"); +ANS( Percent( $ans/100)->cmp ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di1.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di1.pg new file mode 100644 index 0000000000..8ba0a0d498 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di1.pg @@ -0,0 +1,76 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sample Mean') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Sample Mean') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# +$a = random(1,9); +$b = random(3,20); +$s = $a+$b; + +$m = new_multiple_choice(); + +#$m->qa("This is the question - what is $a+$b", "This is the right answer: $s"); +#$m->extra("Wrong 1", "Wrong 2", "Wrong 3"); +#$m->makeLast("Second to last answer", "Last Answer"); +$m ->qa("Although in general you cannot know the sampling distribution of the sample mean exactly, by what distribution can you often approximate it?", +"Normal"); +$m -> extra("Uniform", "J-shaped", "Reverse J-shaped"); + + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +\{ $m->print_q \} +$BR +\{ $m->print_a \} +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# + +ANS(radio_cmp($m->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di2.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di2.pg new file mode 100644 index 0000000000..050bda43a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di2.pg @@ -0,0 +1,70 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sample Mean') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Sample Mean') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# +$a = random(1,9); +$b = random(3,20); +$s = $a+$b; + +$m = new_multiple_choice(); + +#$m->qa("This is the question - what is $a+$b", "This is the right answer: $s"); +#$m->extra("Wrong 1", "Wrong 2", "Wrong 3"); +#$m->makeLast("Second to last answer", "Last Answer"); +$m ->qa("What effect does the sample size have on the standard deviation of all possible sample means?", +"The standard deviation gets smaller as the sample size grows."); +$m -> extra("The standard deviation gets larger as the sample size grows.", +"The sample size has no effect on the standard deviation."); + +BEGIN_TEXT +\{ $m->print_q \} +$BR +\{ $m->print_a \} +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# + +ANS(radio_cmp($m->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di3.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di3.pg new file mode 100644 index 0000000000..17d119efad --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di3.pg @@ -0,0 +1,77 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sample Mean') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Sample Mean') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# +$a = random(1,9); +$b = random(3,20); +$s = $a+$b; + +$m = new_multiple_choice(); + +#$m->qa("This is the question - what is $a+$b", "This is the right answer: $s"); +#$m->extra("Wrong 1", "Wrong 2", "Wrong 3"); +#$m->makeLast("Second to last answer", "Last Answer"); +$m ->qa("Explain why increasing the sample size tends to result in a smaller sampling error when a sample mean is used to estimate a population mean.", +"The larger the sample size, the more closely the possible values of \(\bar{x}\) cluster around the mean of \(\bar{x}\)"); +$m -> extra("If the sample size is larger, the possible values of \(\bar{x}\) are farther from the mean of \(\bar{x}\)", +"The above statement is incorrect, the sample size has no effect on the sampling error."); + + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +\{ $m->print_q \} +$BR +\{ $m->print_a \} +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# + +ANS(radio_cmp($m->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di4.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di4.pg new file mode 100644 index 0000000000..f892b4b0e5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/di4.pg @@ -0,0 +1,99 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sample Mean') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Sampling Distributions and the Central Limit Theorem') +## DBsection('Sample Mean') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# +$mu = random(100, 300, 50); +$sigma = random(21, 49, 7); +$stdev = $sigma / 7; + +#$m->qa("This is the question - what is $a+$b", "This is the right answer: $s"); +#$m->extra("Wrong 1", "Wrong 2", "Wrong 3"); +#$m->makeLast("Second to last answer", "Last Answer"); + +$m = new_multiple_choice(); +$m->qa("For part (a) to be true, what assumption did you make about the distribution of the variable under consideration?", +"No assumption was made."); +$m->extra("Normal distribution.", "Uniform distribution."); + +$m1 = new_multiple_choice(); +$m1->qa("Is the statement in part (a) still true if the sample size is 16 instead of 49? Why or why not?", +"No. Because the distribution of the variable under consideration is not specified, a sample size of at least 30 is needed for part (a) to be true." +); +$m1->extra("Yes, the sampling distribution of the sample mean is always normal.", +"No, the sampling distribution of the sample mean is never normal for sample size less than 30."); + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +A variable of a population has a mean of \(\mu = $mu \) and a standard deviation of \(\sigma= $sigma \). +$PAR +a. The sampling distribution of the sample mean for samples of size 49 is approximately normally distributed with mean \{ans_rule(10)\} and standard deviation \{ans_rule(10)\}. + +$PAR +b. +\{ $m->print_q \} +$BR +\{ $m->print_a \} + +$PAR +c. +\{ $m1->print_q \} +$BR +\{ $m1->print_a \} + +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# +Context("Numeric"); +ANS(Real($mu)->cmp); +ANS(Real($stdev)->cmp); +ANS(radio_cmp($m->correct_ans)); +ANS(radio_cmp($m1->correct_ans)); +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/dueck7_3_4.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/dueck7_3_4.pg new file mode 100644 index 0000000000..a4c56a5862 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/dueck7_3_4.pg @@ -0,0 +1,54 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Institution('Rochester') +## KEYWORDS('Probability','Normal Distribution', 'Central Limit Theorem', 'Normal', 'Mean', 'Standard Deviation') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(5,10,1); +$mean = random(12.09,12.15,0.01); +$dev = random(0.09,0.13,0.01); +$newdev = $dev/sqrt($n); +$ans = normal_prob($mean, 'infty', mean=>12, deviation=>$newdev); + +BEGIN_TEXT + +Cans of regular Coke are labeled as containing \(12 \mbox{ oz}\). $BR +Statistics students weighted the content of \($n\) randomly chosen cans, and found the mean +weight to be \($mean \mbox{ oz}\). $BR + +Assume that cans of Coke are filled so that the actual amounts are normally distributed with a mean of \(12.00 \mbox{ oz}\) +and a standard deviation of \($dev \mbox{ oz}\). Find the probability that a sample of \($n\) cans will +have a mean amount of at least \($mean \mbox{ oz}\). $BR + +\{ans_rule(10)\} + +END_TEXT + +Context("Percent")->flags->set(decimalPlaces=>2,tolerance=>0.00005); +ANS(Percent($ans)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-03.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-03.pg new file mode 100644 index 0000000000..b285cd2626 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-03.pg @@ -0,0 +1,128 @@ +## DESCRIPTION +## Binomial Distribution +## ENDDESCRIPTION + +## KEYWORDS('probability', 'binomial distribution') +## CMMK tagged this problem. + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/17/2005') +## Author('Cristina Murray-Krezan') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('If two random samples of sizes \(n_1\) +and \(n_2\) are selected independently from two non-normally +distributed populations, then the sampling distribution +of the sample mean difference \(\bar{X_1} - \bar{X_2}\), +is', + 'approximately normal only if \(n_1\) and \(n_2\) are both larger than 30' +); +$mc[1]->extra( + 'always non-normal', + 'always normal', + 'approximately normal regardless of \(n_1\) and \(n_2\)' +); + + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('Given that \(X\) is a binomial random variable, +the binomial probability \(P(X=x)\) is approximated by +the area under a normal curve between', + '\(x-0.5\) and \(x+0.5\)' +); +$mc[2]->extra( + '\(x-0.5\) and \(0.0\)', + '\(0.0\) and \(x+0.5\)', + '\(1-x\) and \(1+x\)' +); + + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('The central limit theorem states that, if a random +sample of size \(n\) is drawn from a population, then +the sampling distribution of the sample mean \(\bar{X}\):', + 'is approximately normal if \(n > 30\)' +); +$mc[3]->extra( + 'is approximately normal if \(n < 30\)', + 'is approximately normal if the underlying population is normal', + 'has the same variance as the population' +); + + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('The expected value of the sampling distribution of the +sample mean \(\bar{X}\) equals the population +mean \(\mu\): ', + 'for all populations' +); +$mc[4]->extra( + 'when the population is normally distributed', + 'when the population is symmetric', + 'when the population size \(N > 30\)' +); + + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('If all possible samples of size \(n\) are drawn +from an infinite population with a mean of \(\mu\) and a +standard deviation of \(\sigma\), then the standard error of +the sample mean is inversely proportional to', + '\(\sqrt{n}\)' +); +$mc[5]->extra( + '\(n\)', + '\(\sigma\)', + '\(\mu\)' +); + + +$a = random(1,5,1); +$b = random(1,5,1); +while ($a==$b){ + $b=random(1,5,1); +} + + +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-04.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-04.pg new file mode 100644 index 0000000000..61883bb237 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-04.pg @@ -0,0 +1,123 @@ +## DESCRIPTION +## Binomial Distribution +## ENDDESCRIPTION + +## KEYWORDS('probability', 'binomial distribution') +## CMMK tagged this problem. + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('6/17/2005') +## Author('Cristina Murray-Krezan') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('Given that \(X\) is a binomial random variable, +the binomial probability \(P(X \leq x)\) is approximated +by the area under a normal curve to the left of', + '\(x+0.5\)' +); +$mc[1]->extra( + '\(x\)', + '\(-x\)', + '\(x-5\)' +); + + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('The standard deviation of the sampling distribution +of the sample mean is also called the:', + 'standard error of the mean' +); +$mc[2]->extra( + 'central limit theorem', + 'finite population correction factor', + 'population standard deviation' +); + + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('If a random sample of size \(n\) is drawn from a +normal population, then the sampling distribution of +the sample mean \(\bar{X}\) will be:', + 'normal for all values of \(n\)' +); +$mc[3]->extra( + 'normal only for \(n > 30\)', + 'approximately normal for all values of \(n\)', + 'approximately normal only for \(n > 30\)' +); + + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('If all possible samples of size \(n\) are drawn +from a population, the probability distribution of the +sample mean \(\bar{X}\) is called the: ', + 'sampling distribution of \(\bar{X}\)' +); +$mc[4]->extra( + 'standard error of \(\bar{X}\)', + 'expected value of \(\bar{X}\)', + 'normal distribution' +); + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('Suppose that \(X\) is a binomial random variable with +n = 20 and p = 0.55. Using normal approximation with the continuity +correction, what is (approximately) \(P(X \geq 12)\)?', + '0.4111' +); +$mc[5]->extra( + '0.4143', + '0.3265', + '0.5000' +); + + +$a = random(1,5,1); +$b = random(1,5,1); +while ($a==$b){ + $b=random(1,5,1); +} + + +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-05.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-05.pg new file mode 100644 index 0000000000..18c92293cf --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-05.pg @@ -0,0 +1,112 @@ +## DESCRIPTION +## Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('probability', 'central limit theorem', 'normal', 'sample size', 'deviation') +## CMMK tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('6/17/2005') +## Author('Cristina Murray-Krezan') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +); + + +$shoPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +#True false questions are a special case of a "Select List" +#Make a new select list + +$tf = new_select_list(); + +#$tf now "contains" the select list object. +#Insert some questions and whether or not they are true. + +$tf->rf_print_q(~~&pop_up_list_print_q); + +$tf-> ra_pop_up_list( [No_answer => "?", T=> "True", F => "False"] ); + +$tf -> qa ( # each entry has to end with a comma +"In an effort to identify the true proportion of college freshmen +who are under 18 years of age, a random sample of +500 freshmen was taken. Only fifty of them were under the +age of 18. The value 0.10 would be used as a point +estimate to the true proportion of freshmen under the age of 18.", +"T", + +"The central limit theorem is basic to the concept of +statistical inference because it permits us to draw +conclusions about the population based strictly on sample data, +and without having any knowledge about the +distribution of the underlying population.", +"T", + +"When a great many simple random samples of size \(n\) +are drawn from a population that is normally distributed, the +sampling distribution of the sample means will be normal +regardless of the sample size \(n\).", +"T", + +"Recall the rule of thumb used to indicate when the +normal distribution is a good approximation of the sampling +distribution for the sample proportion \(\hat{p}\). +For the combination \(n=50; p=0.05\), the rule is satisfied.", +"F", + + +"The standard deviation of the sampling distribution of the +sample mean is also called the central limit theorem.", +"F", + +"If all possible samples of size \(n\) are drawn from a +population, the probability distribution of the sample mean +\(\bar{X}\) is referred to as the normal distribution.", +"F", + +"As a general rule, the normal distribution is used to +approximate the sampling distribution of the sample +proportion only if the sample size \(n\) is greater than or equal to 30.", +"F", +); + +#Choose four of the question/answer pairs at random. +$tf ->choose(4); + +#Now print the text using $ml->print_q for the questions and $ml->print_a +#to print the answers. + +BEGIN_TEXT +$PAR + +Select True or False from each pull-down menu, depending on whether +the corresponding statement is true or false. +$BR + +\{ $tf->print_q\} + +$PAR + +END_TEXT + +#Enter the correct answer to be checked against the answers of the students. + +ANS(str_cmp( $tf->ra_correct_ans ) ) ; + +ENDDOCUMENT(); #This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-06.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-06.pg new file mode 100644 index 0000000000..853cb9bb49 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-06.pg @@ -0,0 +1,78 @@ +## DESCRIPTION +## Statistics: Sampling Distributions +## ENDDESCRIPTION + +## CMMK tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Random Variables') +## Date('6/29/2005') +## Institution('UVA') +## Author('Cristina Murray-Krezan') +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('') +## Problem1('') +## KEYWORDS('statistics', 'sampling distributions','normal sampling distributions') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$n = random(10,25,1); +$mu = random(900,1100,10); +$sigma = random(150,250,10); +$a = floor($mu + ($sigma/sqrt($n))*random(1.5,2.3,0.1)); +$b = floor($mu - ($sigma/sqrt($n))*random(1.5,2.3,0.1)); +$c = floor($mu - ($sigma/sqrt($n))*random(0.1,1.4,0.1)); + +BEGIN_TEXT +$PAR +A sample of \(n= $n\) observations is drawn from a normal +population with \(\mu = $mu\) and \(\sigma = $sigma\). Find each of the following: +$PAR +A. \(P(\bar{X} > $a)\) +$PAR +Probability = \{ans_rule(15)\} +$PAR +B. \(P(\bar{X} < $b)\) +$PAR +Probability = \{ans_rule(15)\} +$PAR +C. \(P(\bar{X} > $c)\) +$PAR +Probability = \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +#A. +$ans1 = normal_prob($a,'infty',mean=>$mu, deviation =>$sigma/sqrt($n)); +ANS(Percent($ans1)->cmp); + +#B. +$ans2 = normal_prob('-infty',$b,mean=>$mu, deviation =>$sigma/sqrt($n)); +ANS(Percent($ans2)->cmp); + +#C. +$ans3 = normal_prob($c,'infty',mean=>$mu,deviation=>$sigma/sqrt($n)); +ANS(Percent($ans3)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-08.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-08.pg new file mode 100644 index 0000000000..efc467c8e0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-08.pg @@ -0,0 +1,80 @@ +## DESCRIPTION +## Statistics: Sampling Distributions +## ENDDESCRIPTION + +## CMMK tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Random Variables') +## Date('6/29/2005') +## Institution('UVA') +## Author('Cristina Murray-Krezan') +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('') +## Problem1('') +## KEYWORDS('statistics', 'sampling distributions','normal sampling distributions') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$mu = random(110,120,1); +$sd = random(4.7,5.7,0.1); +$subnum = random(3,4,1); +$a = $mu + 2; + +BEGIN_TEXT +$PAR +An automatic machine in a manufacturing process is +operating properly if the lengths of an important +subcomponent are normally distributed with a mean +of $mu cm and a standard deviation of $sd cm. +$PAR +A. Find the probability that one selected subcomponent is longer than $a cm. +$PAR +Probability = \{ans_rule(15)\} +$PAR +B. Find the probability that if $subnum subcomponents are +randomly selected, their mean length exceeds $a cm. +$PAR +Probability = \{ans_rule(15)\} +$PAR +C. Find the probability that if $subnum are randomly selected, +all $subnum have lengths that exceed $a cm. +$PAR +Probability = \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +#A. +$ans1 = normal_prob($a,'infty',mean=>$mu, deviation =>$sd); +ANS(Percent($ans1)->cmp); + +#B. +$ans2 = normal_prob($a,'infty',mean=>$mu, deviation =>$sd/sqrt($subnum)); +ANS(Percent($ans2)->cmp); + +#C. +$ans3 = (normal_prob($a,'infty',mean=>$mu, deviation =>$sd))**$subnum; +ANS(Percent($ans3)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-09.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-09.pg new file mode 100644 index 0000000000..7d610bbe2c --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-09.pg @@ -0,0 +1,73 @@ +## DESCRIPTION +## Statistics: Sampling Distributions +## ENDDESCRIPTION + +## CMMK tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Random Variables') +## Date('6/29/2005') +## Institution('UVA') +## Author('Cristina Murray-Krezan') +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('') +## Problem1('') +## KEYWORDS('statistics', 'sampling distributions','normal sampling distributions') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$mu = random(6,14,1); +$sd = random(2,5,1); +$stunum = random(8,12,1); +$a = $mu + random(1,3,1); +$b = ($mu + non_zero_random(-2,2,1))*$stunum; + +BEGIN_TEXT +$PAR +The number of pizzas consumed per month by university +students is normally distributed with a mean of $mu +and a standard deviation of $sd. +$PAR +A. What proportion of students consume more than $a pizzas per month? +$PAR +Proportion= \{ans_rule(15)\} +$PAR +B. What is the probability that in a random sample of size +$stunum, a total of more than $b pizzas are consumed? (Hint: What +is the mean number of pizzas consumed by the sample of $stunum students?) +$PAR +Probability = \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +#A. +$ans1 = normal_prob($a,infty,mean=>$mu, deviation =>$sd); +ANS(Percent($ans1)->cmp); + +#B. +$ans2 = normal_prob(($b/$stunum),infty,mean=>$mu, deviation =>$sd/sqrt($stunum)); +ANS(Percent($ans2)->cmp); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-12.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-12.pg new file mode 100644 index 0000000000..46cc8c525a --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/stat212-HW07-12.pg @@ -0,0 +1,60 @@ +## DESCRIPTION +## Statistics: Sampling Distributions +## ENDDESCRIPTION + +## CMMK tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Random Variables') +## Date('07/01/2005') +## Institution('UVA') +## Author('Cristina Murray-Krezan') +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('') +## Problem1('') +## KEYWORDS('statistics', 'sampling distributions','normal sampling distributions') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$mu = random(4.6,5.0,0.1); +$sigma = random(1.7,2.5,0.2); +$stunum = random(55,65,1); + + +BEGIN_TEXT +$PAR +The time it takes for a statistics professor to mark +a single midterm test is normally distributed with a mean +of $mu minutes and a standard deviation of $sigma +minutes. There are $stunum students in the professor's +class. What is the probability that he needs more than +5 hours to mark all of the midterm tests? +$PAR +Probability = \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +$ans1 = normal_prob(300/$stunum,infty,mean=>$mu, deviation =>$sigma/sqrt($stunum)); +ANS(Percent($ans1)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_1.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_1.pg new file mode 100644 index 0000000000..9a0e3b5345 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_1.pg @@ -0,0 +1,92 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem', 'Normal', 'Mean', 'Standard Deviation') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n = random(3,6,1); +$m = random(50,100,1); +$a = random(108,114,5); +$b = random(172,179,1); + +@quest = ("between \( $a \) lb and \( $b \) lb", + "above \( $b \)", + "below \( $a \)"); + + +$ans1[0] = normal_prob($a, $b, mean=>143, deviation=>29); +$ans1[1] = normal_prob($b, 'infty', mean=>143, deviation=>29); +$ans1[2] = normal_prob('-infty', $a, mean=>143, deviation=>29); + +$ndev = 29/sqrt($n); + +$ans2[0] = normal_prob($a, $b, mean=>143, deviation=>$ndev); +$ans2[1] = normal_prob($b, 'infty', mean=>143, deviation=>$ndev); +$ans2[2] = normal_prob('-infty', $a, mean=>143, deviation=>$ndev); + +$mdev = 29/sqrt($m); + +$ans3[0] = normal_prob($a, $b, mean=>143, deviation=>$mdev); +$ans3[1] = normal_prob($b, 'infty', mean=>143, deviation=>$mdev); +$ans3[2] = normal_prob('-infty', $a, mean=>143, deviation=>$mdev); + +$tag = random(0,2,1); + +BEGIN_TEXT + +Assume that women's weights are normally distributed with a mean given by \(\mu=143 \) lb +and a standard deviation given by \(\sigma=29 \) lb. $BR + +(a) If 1 woman is randomly selected, find the probability that her weight is $quest[$tag] $BR + +\{ans_rule(10)\}$BR + +(b) If \( $n \) women are randomly selected, find the probability that they have a mean weight $quest[$tag] $BR + +\{ans_rule(10)\}$BR + +(c) If \( $m \) women are randomly selected, find the probability that they have a mean weight $quest[$tag] $BR + +\{ans_rule(10)\}$BR + + + +END_TEXT +if ($ans3[$tag]<0.00005) {$ans3[$tag] == 0}; +Context("Percent")->flags->set(decimalPlaces=>2,tolerance=>0.00005); +ANS(Percent($ans1[$tag])->cmp); +ANS(Percent($ans2[$tag])->cmp); +ANS(Percent($ans3[$tag])->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_4.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_4.pg new file mode 100644 index 0000000000..f392541a47 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_4.pg @@ -0,0 +1,57 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$mc = new_multiple_choice(); + +$mc -> qa( "The Central Limit Theorem says", "When \(n>30\), the sampling distribution of + \(\overline{x}\) will be approximately normal."); +$mc -> extra("When \(n<30\), the sampling distribution of \(\overline{x}\) will be approximately normal.", + "When \(n>30\), the original population will have an approximately normal distribution.", + "When \(n<30\), the original population will have an approximately normal distribution."); + +$mc -> makeLast("None of the above"); + + +BEGIN_TEXT + +$PAR +\{ $mc->print_q() \} +\{ $mc->print_a() \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_5.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_5.pg new file mode 100644 index 0000000000..9eb90450f9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_5.pg @@ -0,0 +1,72 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem', 'Mean', 'Standard Deviation') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$n = random(40,70,10); +$a = random(.1,1,.1); +$x = 157-$a; +$mean1 = random(157+$a,157+5*$a,$a); +$sd = random(1,4,.1); + +$sigma = 3/sqrt($n); +$sigma1 = $sd/sqrt($n); + +$ans1 = normal_prob(-infty, $x, mean=>157, deviation=>$sigma); +$ans2 = normal_prob(-infty, $x, mean=>$mean1, deviation=>$sigma); +$ans3 = normal_prob(-infty, $x, mean=>157, deviation=>$sigma1); + +BEGIN_TEXT +A soft drink bottler purchases glass bottles from a vendor. The bottles are required to have an internal pressure of at least \(150\) pounds per square inch (psi). A prospective bottle vendor claims that its production process yields bottles with a mean internal pressure of \(157\) psi and a standard deviation of \(3\) psi. The bottler strikes an agreement with the vendor that permits the bottler to sample from the production process to verify the claim. The bottler randomly selects \($n\) bottles from the last +\(10000\) produced, measures the internal pressure of each, and finds the mean pressure for the sample to be \($a\) psi below the process mean cited by the vendor. $PAR +(a) Assuming that the vendor is correct in his claim, what is the probability of obtaining a sample mean +this far or farther below the process mean? $BR +\{ans_rule(20)\} $PAR +(b) If the standard deviation were \(3\) psi as claimed, but the mean was \($mean1 \) psi, what is the +probability of obtaining a sample mean of \($x\) psi or below?$BR +\{ans_rule(20)\} $PAR +(c) If the process mean were \(157\) psi as claimed, but the standard deviation was \($sd\) psi, what is +the probability of obtaining a sample mean of \($x\) psi or below? $BR +\{ans_rule(20)\} + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Percent($ans3)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_6.pg b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_6.pg new file mode 100644 index 0000000000..dcce417399 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/CentralLimitTheorem/ur_pb_11_6.pg @@ -0,0 +1,56 @@ +## DESCRIPTION +## Apply the Central Limit Theorem +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Central Limit Theorem', 'Mean', 'Standard Deviation') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('The Central Limit Theorem') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mean = random(60,75,1); +$dev = random(8, 11, .5); +$p = random(.94, .96, .05); +$a = random(1.5, 3, .5); + +$distr = udistr((1-$p)/2); +$n = int(($dev * $distr / $a)**2 + 1); + +BEGIN_TEXT + +Suppose that from the past experience a professor knows that the test score of a student taking his final examination is a random variable +with mean \($mean\) and standard deviation \($dev.\) How many students would have to take the examination to ensure, with probability at +least \($p\), that the class average would be within \($a\) of \($mean\)? $BR + +\{ans_rule(30)\} + +END_TEXT + +ANS(num_cmp($n, tol=>3)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_04_InferencePropn.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_04_InferencePropn.pg new file mode 100644 index 0000000000..4a0bba497e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_04_InferencePropn.pg @@ -0,0 +1,76 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject(Statistics) +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); +@n = (650,675,700,725,775,800,850); +@x = (142, 138, 151, 139, 162, 175, 183); +$choose = random(0,6,1); +$y = $n[$choose]-$x[$choose]; +$phat = Real($x[$choose]/$n[$choose]); +$qhat = 1-$phat; +$C = Percent(.95); +$zstar = Real(1.959963985); +$moe = $zstar*sqrt($phat*(1-$phat)/$n[$choose]); +$upper = Percent($phat + $moe); +$lower = Percent($phat - $moe); + + +###################################### +# Main text + +BEGIN_TEXT +A recent survey showed that among \($n[$choose]\) randomly selected subjects who +completed \(4\) years of college, \($x[$choose]\) smoke and \($y\) do not smoke. +Determine a \($C\) confidence interval for the true proportion of the +given population that smokes. + +$PAR +\($C\) CI: $SPACE \{ ans_rule(10)\} to \{ ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans1 = Percent($lower); +ANS($ans1->cmp); + +$ans2 = Percent($upper); +ANS($ans2->cmp); + +###################################### + +BEGIN_SOLUTION + +We know that \( \hat{p} = $phat\), thus \( \hat{q} = $qhat\). For \($C\) confidence we have \(z^{*}=$zstar\). We also know that \(\text{MOE} = \operatorname{SE}(\hat{p})\cdot z^{*}\). Now we can find \(\text{MOE} = \sqrt{\frac{$phat\cdot$qhat}{$n[$choose]}}\cdot $zstar=$moe\). This makes our interval, as a percent, from \($lower\) to \($upper\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_07_InferencePropn.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_07_InferencePropn.pg new file mode 100644 index 0000000000..f128151907 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_07_InferencePropn.pg @@ -0,0 +1,83 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextPercent.pl", + "answerHints.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); +@name = ("Beth", "Dylan", "Cora", "Kim"); +$person = random(0,3,1); +$pronoun = "she"; +if ($person==1) {$pronoun = "he";} +$m = random(0.02, 0.04,0.01); +@level = (.80,.90,.95,.99); +@z = (1.281551566, 1.644853627, 1.959963985, 2.575829304); +$choose = random(0,3,1); +$C= Percent($level[$choose]); +$zr = Real($z[0]); +$n = 0.25 * ($z[$choose] / $m) ** 2; +$nactual =Real(0.25 * ($z[$choose] / $m) ** 2); +$trunc = int($n); +if ($n > $trunc) {$n = $trunc + 1}; + +###################################### +# Main text + +BEGIN_TEXT +$name[$person] wants to determine a \($C\) confidence interval +for the true proportion of high school students in the area who attend +their home basketball games. How large of a sample must $pronoun have +to get a margin of error less than \($m\)? + +$PAR +\(n ={}\) \{ ans_rule(15)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans = Compute("$n")->with(tolType=>'absolute', tolerance=>'0.00000001'); +ANS($ans->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return int($student)-$student != 0 ; + } => ["n must be a whole number."], + $ans-1 => ["You must round up to make sure the margin of error is no more than 0.05."] +))); + +BEGIN_SOLUTION + +If $name[$person] wants an \($C\) confidence level, this will correspond to \(z^{*}=$zr\). We also know $pronoun wants a margin of error of less than \($m\). This means we can fill in the formula \(\text{MOE} = \sqrt{\frac{\hat{p}\hat{q}}{n}}\cdot z^{*}\) to obtain \($m = \sqrt{\frac{0.5\cdot 0.5}{n}}\cdot $zr\). Recall that when we do not know \(\hat{p}\) or \(\hat{q}\) we use the "worst case scenario" with \(\hat{p}=0.5\) and \(\hat{q}=0.5\). The previous equation is solved and and we find \(n=$nactual\). Note that our answer must be a whole number since it is sample size and that \(n=$nactual\) would give us a margin of error of exactly \($m\). But as we want the Margin of Error less than \($m\) we need to round up to \(n=$n\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_08_InferencePropn.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_08_InferencePropn.pg new file mode 100644 index 0000000000..7be35bcb6a --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/19Stats_08_InferencePropn.pg @@ -0,0 +1,137 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject(Statistics) +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "contextPercent.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); +$z= Real(1.644853627); +$z95 = Real(1.959963985); + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("A radio talk show host with a large audience is interested in +the proportion \(p\) of adults in his listening area who think the drinking +age should be lowered to \(18\). He asks, 'Do you think the drinking age should +be reduced to \(18\) in light of the fact that \(18\) year olds are eligible for +military service?' He asks listeners to phone in and vote 'yes' if they agree +the drinking age should be lowered to \(18\), and 'no' if not. Of the \(100\) people +who phoned in, \(70\) answered 'yes.' Which of the following assumptions for +inference about a proportion using a confidence interval are violated?","The +data are an SRS from the population of interest."); + $mc[0]->extra("The population is at least ten times as large as the +sample.", + "The sample size is large enough so that the count of successes \( n\hat{p}\) +is \(10\) or more.", + "The sample size is large enough so that the count of failures \( +n(1-\hat{p})\) is \(10\) or more."); +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A newspaper conducted a statewide survey concerning the \(1998\) +race for state senator. The newspaper took a SRS of \(1200\) registered voters +and found that \(620\) would vote for the Republican candidate. Let \(p\) +represent the proportion of registered voters in the state who would vote for +the Republican candidate. A \(90$PERCENT\) confidence interval for \(p\) +is:","\(0.517 \pm 0.024\)"); + $mc[1]->extra("\(0.517 \pm 0.014\)", + "\(0.517 \pm 0.028\)", + "\(0.517 \pm 0.249\)"); +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("A newspaper conducted a statewide survey concerning the \(1998\) +race for state senator. The newspaper took a SRS of \(1200\) registered voters +and found that \(620\) would vote for the Republican candidate. Let \(p\) +represent the proportion of registered voters in the state who would vote for +the Republican candidate. How large a sample \(n\) would you need to estimate +\(p\) with a margin of error \(0.01\) with \(95$PERCENT\) confidence? Use the guess +\(\hat{p} = .5\) as the value of \(\hat{p}\).","\(9604\)"); + $mc[2]->extra("\(49\)", + "\(1500\)", + "\(4800\)"); + +@solutions = ("\(D.\) As this sample is comprised of people who both had to be listening to the radio AND had to call in to have their opinion counted, the data is not from an SRS.", + +"\(C.\) Since \(\hat{p}=\frac{620}{1200}=0.517\) and for \(90$PERCENT\) confidence we know that \(z^{*}\approx $z\). From there we can find that \(\text{MOE} = \sqrt{\frac{(0.517)(0.483)}{1200}}*$z \approx 0.0240\)", + +"\(D.\) As we are told that \(\hat{p}=0.5\), meaning that \(\hat{q}=0.5\), and \(\text{MOE} = 0.01\) and \(z^{*}\approx $z95\) for \(95$PERCENT\) confidence, this leaves us to solve the equation \(0.01 = \sqrt{\frac{(0.5)(0.5)}{n}}\) which gives \(n \approx 9604\)", +); + +@ssols = (@solutions[@order]); +###################################### +# Main text + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +###################################### + +BEGIN_SOLUTION + +(a) Option $ssols[0] + +$PAR + +(b) Option $ssols[1] + +$PAR + +(c) Option $ssols[2] + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust50.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust50.pg new file mode 100644 index 0000000000..f65cb9ef1c --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust50.pg @@ -0,0 +1,79 @@ +##DESCRIPTION +## Statistics: Confidence Intervals +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Estimation') +##DBsection('Small-Sample Confidence Intervals for u and u1-u2') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); + + +Context("Percent"); +$z= Real(1.644853627); +$z95 = Real(1.959963985); + +$mc = new_multiple_choice(); + +$mc->qa("What is the relationship between confidence level and precision of a confidence interval?", +"For a fixed sample size, decreasing the confidence level increases the precision"); +$mc->extra("For a fixed sample size, decreasing the confidence level decreases the precision", "For a fixed sample size, decreasing the confidence level has no effect on the precision"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); +################################################# +# Answers + +###################################### + +BEGIN_SOLUTION + +Option \(C\). Consider a sample of size \(n=100\), with \(\hat{p}=0.5\) and \(\hat{q}=0.5\) and \(z^{*} =$z95\), for \(95$PERCENT\) confidence. This gives us, +$PAR +\(\text{MOE}= $z95\sqrt{\frac{(0.5)(0.5)}{100}} \approx 0.098\) or \(9.8$PERCENT\). +$PAR +If we lower our confidence level to \(90$PERCENT\), or, \(z^{*}\approx$z\), we find, +$PAR +\(\text{MOE}= $z\sqrt{\frac{(0.5)(0.5)}{100}} \approx 0.082\) or, \(8.2$PERCENT\). +$PAR +This immediately rules out option \(B\). A lower level of confidence gives us a smaller margin of error and thus a smaller interval which \(p\) could be in. Therefore our precision is increased. + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust51.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust51.pg new file mode 100644 index 0000000000..b86fabf5e6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust51.pg @@ -0,0 +1,77 @@ +##DESCRIPTION +## Statistics: Confidence Intervals +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Estimation') +##DBsection('Confidence Intervals') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); + +Context("Percent"); +$z= Real(1.644853627); +$z95 = Real(1.959963985); + +$mc = new_multiple_choice(); + +$mc->qa("Increasing the confidence level while keeping the same sample size has what effect on the margin of error?", +"Increases the margin of error and hence decreases the precision"); +$mc->extra("Increases the margin of error and hence increases the precision", "Decreases the margin of error and hence increases the precision", "Decreases the margin of error and hence decreases the precision"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); +################################################# +# Answers + +###################################### + +BEGIN_SOLUTION + +Option \(D\). Consider a sample of size \(n=100\), with \(\hat{p}=0.5\) and \(\hat{q}=0.5\) and \(z^{*} =$z\), for \(90$PERCENT\) confidence. This gives us, +$PAR +\(\text{MOE}= $z\sqrt{\frac{(0.5)(0.5)}{100}} \approx 0.082\) or \(8.2$PERCENT\). +$PAR +If we raise our confidence level to \(95$PERCENT\), or, \(z^{*}=$z95\), we find, +$PAR +\(\text{MOE}= $z95\sqrt{\frac{(0.5)(0.5)}{100}} \approx 0.098\) or, \(9.8$PERCENT\). +$PAR +Increasing the confidence level increases the margin of error, therefore options \(A\) and \(B\) are not true. Also, since are a larger confidence level has a larger margin of error, we also have a larger interval which \(p\) could be in. This means we have less precision. + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust52.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust52.pg new file mode 100644 index 0000000000..ce82729251 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/gust52.pg @@ -0,0 +1,71 @@ +##DESCRIPTION +## Statistics: Confidence Intervals +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Estimation') +##DBsection('Confidence Intervals') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Increasing the sample size while keeping the same confidence level has what effect on the margin of error?", +"Decreases the margin of error and hence increases the precision "); +$mc->extra("Increases the margin of error and hence increases the precision", "Increases the margin of error and hence decreases the precision", "Decreases the margin of error and hence decreases the precision"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +Option \(D\). Consider a sample of size \(n=100\), with \(\hat{p}=0.5\) and \(\hat{q}=0.5\) and for simplicity a confidence level corresponding to \(z^{*} =2\). This gives us, +$PAR +\(\text{MOE}= 2\sqrt{\frac{(0.5)(0.5)}{100}} = 0.10\) or 10$PERCENT. +$PAR +If we keep the same confidence level corresponding to \(z^{*} =2\) but increase the sample size to \(n=200\), we find, +$PAR +\(\text{MOE}= 2\sqrt{\frac{(0.5)(0.5)}{200}} \approx 0.071\) or, 7.1$PERCENT. +$PAR +This immediately rules out option \(A\) and \(C\). Increasing the sample size gives us a smaller margin of error. A smaller margin of error means we have a smaller interval which \(p\) could be in. Therefore, our precision is increased. + +END_SOLUTION +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa49.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa49.pg new file mode 100644 index 0000000000..168c5479c5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa49.pg @@ -0,0 +1,121 @@ +##DESCRIPTION +## Statistics: Confidence intervals +##ENDDESCRIPTION + +##KEYWORDS('large sample','confidence interval','statistics', 'population proportion') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Large-Sample Confidence Intervals') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$a = random(300,400,1); +$b = random(500,600,25); + +@conf = ("\(99$PERCENT\)", + "\(90$PERCENT\)", + "\(95$PERCENT\)", + "\(98$PERCENT\)", + "\(99$PERCENT\)"); +@slice = NchooseK(5,1); +@sconf = @conf[@slice]; + +$z1 = normal_distr(.495); +$z2 = normal_distr(.45); +$z3 = normal_distr(.475); +$z4 = normal_distr(.49); +$z5 = normal_distr(.495); + +@z = ($z1, $z2, $z3, $z4, $z5); +@sz = Real(@z[@slice]); +$p = Real($a/$b); +$q = (1-($a/$b)); +$moe = (sqrt($p*(1-$p)/$b)*$sz[0]); +$moeper = Percent(sqrt($p*(1-$p)/$b)*$sz[0]); +$lower = Percent($p - $moe); +$upper = Percent($p + $moe); + +$ans1 = ($p)-$sz[0]*sqrt($p*(1-$p)/$b); +$ans2 = ($p)+$sz[0]*sqrt($p*(1-$p)/$b); +$ans3 = $sz[0]*sqrt($p*(1-$p)/$b); + + +BEGIN_TEXT +A poll is taken in which \($a\) out of \($b\) randomly selected voters indicated their preference for a certain +candidate. $BR $BR (a) Find a $sconf[0] confidence interval for \(p\). $BR $BR +\{ans_rule(20)\} \(\leq p \leq\) \{ans_rule(20)\} +$BR $BR +(b) Find the margin of error for this $sconf[0] confidence interval for \(p\). $BR $BR +\{ans_rule(20)\} $BR $BR + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Percent($ans3)->cmp); + + +$mc = new_multiple_choice(); + +$mc->qa("(c) Without doing any calculations, indicate whether the margin of error is larger or smaller or the same for an 80$PERCENT confidence interval.", "smaller"); +$mc->extra("larger"); +$mc->makeLast("same"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +$BR $BR +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) We know that \(\hat{p}=$p\) and for $sconf[0] confidence we have \(z^{*}\approx $sz[0]\). +$PAR +To create a confidence interval for \(p\) we need the margin of error, which is \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). Using this, we obtain, +$PAR +\(\text{MOE} = $sz[0]\sqrt{\frac{($p)($q)}{$b}} \approx $moe\). +$PAR +Therefore, our interval is \($lower \leq p \leq $upper\). +$PAR +(b) Using our work from the previous question we know that \(\text{MOE} \approx $moeper\). +$PAR +(c) Option \(A\). Without doing work, we know that a smaller level of confidence, assuming all other variables stay the same, will result in a smaller confidence interval. A smaller confidence interval means we have a smaller margin of error. + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa50.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa50.pg new file mode 100644 index 0000000000..3f7e513921 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa50.pg @@ -0,0 +1,107 @@ +##DESCRIPTION +## Statistics: Confidence intervals +##ENDDESCRIPTION + +##KEYWORDS('statistics','estimates','population','samples') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Large-Sample Confidence Intervals') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$perc = 99; + +$n = random(100,1000,100); +$x = random(50,(4*$n/5)); + +$p = Real($x/$n); +$q = 1- $p; +$z = Real(normal_distr($perc/200)); +$e = $z*sqrt($p*$q/$n); +$lower = Percent($p - $e); +$upper = Percent($p + $e); +$ans1 = $p-$e; +$ans2 = $p+$e; + +BEGIN_TEXT + +Construct the \( $perc$PERCENT\) confidence interval estimate of the population proportion +\( p \) if the sample size is \( n = $n \) and the number of successes in the sample is +\( x = $x. \) $PAR +$BCENTER +\{ans_rule(25)\} \( < p < \) \{ans_rule(25)\} +$ECENTER +$BR + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); + +$mc = new_multiple_choice(); + +$mc->qa("Which of the following is the correct interpretation for your answer in part (a)?", +"We can be \(99$PERCENT\) confident that the percentage of successes in the population lies in the interval"); +$mc->extra("There is a \(99$PERCENT\) chance that the percentage of successes in the population lies in the interval", "We can be \(99$PERCENT\) confident that the percentage of successes in the sample lies in the interval"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) We know that \(\hat{p}=$p\), therefore \(\hat{q}=$q\) and for \( $perc\)$PERCENT we have \(z^{*}\approx $z\). +$PAR +To create a confidence interval for \(p\) we need the margin of error, which is \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). Using this, we obtain, +$PAR +\(\text{MOE} = $z\sqrt{\frac{($p)($q)}{$n}} \approx $e\). +$PAR +Therefore, our interval is \($lower < p < $upper\). +$PAR +(b) Option \(C\). This interval was meant to estimate a population proportion, \(p\), this rules out Option \(A\) which is about a sample. We can also rule out Option \(B\) since we have no ability or right to make a statement about the specific percent chance that \(p\) is in our interval. However, we are allowed to say we are \(99$PERCENT\) confident the value of \(p\) is in our interval. + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa51.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa51.pg new file mode 100644 index 0000000000..bca03a6ead --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa51.pg @@ -0,0 +1,104 @@ +##DESCRIPTION +## Statistics: Confidence intervals +##ENDDESCRIPTION + +##KEYWORDS('statistics','estimates','population','samples') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Large-Sample Confidence Intervals') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$perc = 95; + +$n = random(400,1000,100); +$b = random (.78, .82, .01); +$x =$b*$n; + +$p = Real($x/$n); +$q = 1- $p; +$z = Real(normal_distr($perc/200)); +$e = $z * sqrt($p*$q/$n); +$lower = Percent($p - $e); +$upper = Percent($p + $e); +$ans1 = $p-$e; +$ans2 = $p+$e; + + +BEGIN_TEXT +(a) A random sample of elementary school children in New York state is to be +selected to estimate the proportion \(p\) who have received a medical +examination during the past year. The survey found that \( x = $x \) children were examined during the past year. Construct the \( $perc\)$PERCENT confidence interval estimate of the population proportion +\( p \) if the sample size was \( n = $n \) . + $PAR $PAR +$BCENTER +\{ans_rule(25)\} \( < p < \) \{ans_rule(25)\} +$ECENTER +$BR + +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); + +$mc = new_multiple_choice(); + +$mc->qa("(b) Which of the following is the correct interpretation for your answer in part (a)?", +"We can be \(95$PERCENT\) confident that the percentage of all elementary school children in NY who have received medical examination during the past year lies in the interval"); +$mc->extra("There is a \(95$PERCENT\) chance that the percentage of all elementary school children in NY who have received medical examination during the past year lies in the interval", "We can be \(95$PERCENT\) confident that the percentage of elementary school children in the sample who have received medical examination during the last year lies in the interval"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) We know that \(\hat{p}=$p\) and for \($perc\)$PERCENT we have \(z^{*}\approx$z\). +$PAR +To create a confidence interval for \(p\) we need the margin of error, which is \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). Using this, we obtain, +$PAR +\(\text{MOE} = $z\sqrt{\frac{($p)($q)}{$n}} \approx $e\). +$PAR +Therefore, our interval is \($lower < p < $upper\). +$PAR +(b) Option \(C\). This interval was meant to estimate the percent, \(p\), of all elementary school children, this rules out Option \(A\) which is about a sample. We can also rule out Option \(B\) since we have no ability or right to make a statement about the specific percent chance that \(p\) is in our interval. However, we are allowed to say we are \(95$PERCENT\) confident the value of \(p\) is in our interval. + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa55.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa55.pg new file mode 100644 index 0000000000..a54965d879 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/kolossa55.pg @@ -0,0 +1,99 @@ +##DESCRIPTION +## Statistics: Sample sizes +##ENDDESCRIPTION + +## Tagged by sawblade + +## DBsubject(Statistics) +## DBchapter(Confidence intervals) +## DBsection(One sample proportion) +## Date(6/3/2002) +## Institution(ASU) +## MLT(CI_1p_01) +## Level(2) +## TitleText1('Mathematical Statistics') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## EditionText1('6') +## Section1('8.7') +## Problem1('58') +## KEYWORDS('statistics','estimation','samples') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"contextPercent.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); + +Context("Percent"); +$showPartialCorrectAnswers = 1; + +$b = random(.01,.09,.005); +$p = random(.7,.9,.1); +$q = 1-$p; + +@conf = ("\(95$PERCENT\)", + "\(90$PERCENT\)", + "\(95$PERCENT\)", + "\(98$PERCENT\)", + "\(99$PERCENT\)"); +@slice = NchooseK(5,1); +@sconf = @conf[@slice]; + +$z1 = normal_distr(.475); +$z2 = normal_distr(.45); +$z3 = normal_distr(.475); +$z4 = normal_distr(.49); +$z5 = normal_distr(.495); + +@z = ($z1, $z2, $z3, $z4, $z5); +@sz = Real(@z[@slice]); + +$ans1 = ceil(($sz[0]**2*.25)/$b**2); +$ans2 = ceil(($sz[0]**2*$p*$q)/$b**2); + +BEGIN_TEXT +A random sample of elementary school children in New York state is to be +selected to estimate the proportion \(p\) who have received a medical +examination during the past year. An interval estimate of the proportion \(p\) +with a margin of error of \($b\) and $sconf[0] confidence is required. $PAR +(a) \( \ \) Assuming no prior information about \(\hat{p}\) is available, +approximately how large of a sample size is needed? $BR +\( n = \) \{ans_rule(10)\} $PAR +(b) \( \ \) If a planning study indicates that \(\hat{p}\) is around \($p\), +approximately how large of a sample size is needed? $BR +\( n = \) \{ans_rule(10)\} +END_TEXT +ANS(num_cmp($ans1, tol=>3)); +ANS(num_cmp($ans2, tol=>3)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) Assuming no prior information is known about \(\hat{p}\), we should assume the "worst case" scenario with \(\hat{p}=0.5\) and thus \(\hat{q}=0.5\). Since we wish to have margin of error \($b\) and $sconf[0] confidence, which corresponds to \(z^{*}\approx$sz[0]\), we can find the needed sample size using the formula, \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). +$PAR +Using this we obtain, +$PAR +\($b = $sz[0]\sqrt{\frac{(0.5)(0.5)}{n}}\). Solving for \(n\), we find \(n=$ans1\). +$PAR +(b) Assuming our margin of error and confidence level have not changed, we now also know that \(\hat{p}=$p\) and therefore \(\hat{q}=$q\). Thus we can use the margin of error formula again to obtain, +$PAR +\($b = $sz[0]\sqrt{\frac{($p)($q)}{n}}\). Solving for \(n\), we find \(n=$ans2\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_13.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_13.pg new file mode 100644 index 0000000000..e5caf90c04 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_13.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## Confidence Intervals +## ENDDESCRIPTION + +## KEYWORDS('Confidence Interval') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Large-Sample Confidence Intervals') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$a = random(300,400,1); +$b = random(500,600,25); + +@conf = ("\(80$PERCENT\)", + "\(90$PERCENT\)", + "\(95$PERCENT\)", + "\(98$PERCENT\)", + "\(99$PERCENT\)"); +@slice = NchooseK(5,1); +@sconf = @conf[@slice]; + +$z1 = normal_distr(.4); +$z2 = normal_distr(.45); +$z3 = normal_distr(.475); +$z4 = normal_distr(.49); +$z5 = normal_distr(.495); + +@z = ($z1, $z2, $z3, $z4, $z5); +@sz = Real(@z[@slice]); +$p = Real($a/$b); +$q = (1-$p); +$moe = ($sz[0]*sqrt($p*(1-$p)/$b)); + +$ans1 = Percent(($p)-$sz[0]*sqrt($p*(1-$p)/$b)); +$ans2 = Percent(($p)+$sz[0]*sqrt($p*(1-$p)/$b)); + +BEGIN_TEXT +A poll is taken in which \($a\) out of \($b\) randomly selected voters indicated their preference for a certain +candidate. Find a $sconf[0] confidence interval for \(p\). $BR +$BCENTER +\{ans_rule(20)\} \(\leq p \leq\) \{ans_rule(20)\} +$ECENTER +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) Since we know \($a\) out of \($b\) randomly selected voters indicated their preference for a certain candidate, we know that \(\hat{p}=$p\) and \(\hat{q}=$q\). We desire a $sconf[0] confidence interval, which corresponds to \(z^{*}\approx$sz[0]\). +$PAR +To create a confidence interval for \(p\), we need the margin of error, which is found with the formula \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). Using this, we obtain, +$PAR +\(\text{MOE} = $sz[0]\sqrt{\frac{($p)($q)}{$b}} \approx $moe\). +$PAR +Therefore, our interval is \($ans1 \leq p \leq $ans2\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_14.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_14.pg new file mode 100644 index 0000000000..720520a590 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_14.pg @@ -0,0 +1,75 @@ +## DESCRIPTION +## Confidence Intervals +## ENDDESCRIPTION + +## KEYWORDS('Confidence Interval', 'Point Estimate', 'Margin of Error') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Large-Sample Confidence Intervals') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$p = random(0.100, 0.900, 0.010); +$e = random(0.01, 0.09, 0.01); +$min = $p - $e; +$max = $p + $e; + +BEGIN_TEXT + +A confidence interval for a population proportion \(p\) has been given. What was the sample proportion and what is the margin of error? $PAR + +\[ $min < p < $max \] $PAR + +\( \hat{p} = \) \{ans_rule(5)\} \( \ \ \ \ \) +$PAR +margin of error\(= \) \{ans_rule(5)\} + + +END_TEXT + +Context("Percent"); + +ANS(Percent($p)->cmp); +ANS(Percent($e)->cmp); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) As we know our interval in question is \($min < p < $max\), we can find \(\hat{p}\) using symmetry. A confidence interval is centered at \(\hat{p}\) and then created by finding a margin of error and going the same distance on either side of \(\hat{p}\). This means that the interval is centered exactly halfway between the lower and upper bounds of the interval. In our case, this would be \(\hat{p}=\frac{$min+$max}{2} = $p\) +$PAR +(b) Since we know the center of the our interval is \($p\), this means \(\hat{p}=$p\). We know that the lower bound of our interval is \(\text{Lower} = \hat{p} -\text{MOE}\). Using this we obtain, +$PAR +\($min = $p - \text{MOE}\), which can be solved to find \(\text{MOE} = $e\). Therefore our margin of error is \($e\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_15.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_15.pg new file mode 100644 index 0000000000..d6e27e4b1c --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_15.pg @@ -0,0 +1,97 @@ +##DESCRIPTION +##KEYWORDS('large sample', 'population proportion', estimates','confidence intervals') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Evaluating the Goodness of a Point Estimator') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('8.4') +## Problem1('24') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$n = random(60,90,5); +$a = random(40,$n-10,1,); +$p = Real($a/$n); +$q = 1-$p; + +@conf = ("\(80$PERCENT\)", + "\(90$PERCENT\)", + "\(95$PERCENT\)", + "\(98$PERCENT\)", + "\(99$PERCENT\)"); +@slice = NchooseK(5,1); +@sconf = @conf[@slice]; + +$z1 = normal_distr(.4); +$z2 = normal_distr(.45); +$z3 = normal_distr(.475); +$z4 = normal_distr(.49); +$z5 = normal_distr(.495); + +@z = ($z1, $z2, $z3, $z4, $z5); +@sz = Real(@z[@slice]); + +$moe = ($sz[0]*sqrt($p*$q/$n)); + +$ans1 = Percent($p-$sz[0]*sqrt($p*$q/$n)); +$ans2 = Percent($p+$sz[0]*sqrt($p*$q/$n)); + +BEGIN_TEXT +Astronauts often report that there are times when they become disoriented as they move around in zero-gravity. Therefore, they usually rely on bright colors and other visual information to help them establish a top-down orientation. A study was conducted to assess the potential of using color for body orienting. \($n\) college students, reclining on their backs in the dark, found it difficult to +establish orientation when positioned on under a rotating disk. This rotating disk was painted half black and half white. Out of the \($n\) students, \($a\) believed they were right side up when the white was on top. $PAR +Use this information to estimate the true proportion of subjects who use the white color as a cue for right-side-up orientation. That is, construct a $sconf[0] confidence interval for the true proportion. $BR +$BCENTER +\{ans_rule(20)\} \( \leq p \leq \) \{ans_rule(20)\} +$ECENTER +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); + + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) Based on the study we know that of \($n\) students, \($a\) believed they were right side up when the white was on top, meaning \(\hat{p}=$p\) and \(\hat{q}=$q\). We desire a $sconf[0] confidence interval, which corresponds to \(z^{*}\approx$sz[0]\). +$PAR +To create a confidence interval for \(p\) we need the margin of error, which is found with the formula \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). Using this, we obtain, +$PAR +\(\text{MOE} = $sz[0]\sqrt{\frac{($p)($q)}{$n}} \approx $moe\). +$PAR +Therefore, our interval is \($ans1 \leq p \leq $ans2\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_18.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_18.pg new file mode 100644 index 0000000000..bdca84e937 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_18.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## Selecting Sample Size +## ENDDESCRIPTION + +## KEYWORDS('Sample Size', 'Confidence', 'Margin of Error') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Selecting Sample Size') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$perc = random(90,99,1); + +$a = random(4,7,1); +$p = Real($a/100); +$q = 1-$p; +$e = random(1.5,2,0.5); +$edec = ($e/100); + +$z = Real(normal_distr($perc/200)); +$n1 = $z**2*10000/4/$e**2; +$n2 = $z**2*10000*$p*$q/$e**2; +$ans1 = 5000 - int(5000 - $n1); +$ans2 = 5000 - int(5000 - $n2); + +BEGIN_TEXT + +College officials want to estimate the percentage of students who carry a gun, knife, or +other such weapon. How many randomly selected students must be surveyed in order to be +\( $perc$PERCENT\) confident that the sample percentage has a margin of error of +\( $e \) percentage points? $PAR + +(a) \( \ \) Assume that there is no available information that could be used as an estimate +of \( \hat{p} \). $PAR + +\(n=\) \{ ans_rule(15) \} $PAR + +(b) \( \ \) Assume that another study indicated that \( $a$PERCENT\) of college +students carry weapons.$PAR + +\(n=\) \{ ans_rule(15) \} $PAR + +END_TEXT +Context("Numeric"); + +ANS(Real($ans1)->cmp(tolType=>absolute,tolerance=>2)); +ANS(Real($ans2)->cmp(tolType=>absolute,tolerance=>2)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) Assuming no prior information is known about \(\hat{p}\), we should assume the "worst case" scenario with \(\hat{p}=0.5\) and thus \(\hat{q}=0.5\). Since we wish to have margin of error \($e\) percentage points, or \($edec\) as a decimal, and \( $perc$PERCENT\) confidence, which corresponds to \(z^{*}\approx$z\), we can find the needed sample size using the formula, \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). +$PAR +Using this we obtain, +$PAR +\($edec = $z\sqrt{\frac{(0.5)(0.5)}{n}}\). Solving for \(n\), we find \(n=$ans1\). +$PAR +(b) Assuming our margin of error and confidence level have not changed, we now also know that another study indicated that \($a$PERCENT\) of college students carry weapons, meaning \(\hat{p}=$p\) and therefore \(\hat{q}=$q\). Thus we can use the margin of error formula again to obtain, +$PAR +\($edec = $z\sqrt{\frac{($p)($q)}{n}}\). Solving for \(n\), we find \(n=$ans2\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_19.pg b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_19.pg new file mode 100644 index 0000000000..77375d4eca --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ConfidenceIntervalsSingleProportion/ur_stt_3_19.pg @@ -0,0 +1,100 @@ +##DESCRIPTION +##KEYWORDS('') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Selecting Sample Size') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('8.7') +## Problem1('58') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +"MathObjects.pl" +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 1; + +$b = random(.01,.09,.005); +$p = random(.1,.9,.1); +$q = 1-$p; + +@conf = ("\(80$PERCENT\)", + "\(90$PERCENT\)", + "\(95$PERCENT\)", + "\(98$PERCENT\)", + "\(99$PERCENT\)"); +@slice = NchooseK(5,1); +@sconf = (@conf[@slice]); + +$z1 = normal_distr(.4); +$z2 = normal_distr(.45); +$z3 = normal_distr(.475); +$z4 = normal_distr(.49); +$z5 = normal_distr(.495); + +@z = ($z1, $z2, $z3, $z4, $z5); +@sz = Real(@z[@slice]); + +$ans1 = ceil(($sz[0]**2*.25)/$b**2); +$ans2 = ceil(($sz[0]**2*$p*$q)/$b**2); + +BEGIN_TEXT +A random sample of elementary school children in New York state is to be +selected to estimate the proportion \(p\) who have received a medical +examination during the past year. An interval estimate of the proportion \(p\) +with a bound of \($b\) and $sconf[0] confidence is required. $PAR +(a) Assuming no prior information about \(p\) is available, +approximately how large of a sample size is needed? $BR +\( n = \) \{ans_rule(10)\} $PAR +(b) If a planning study indicates that \(p\) is around \($p\), +approximately how large of a sample size is needed? $BR +\( n = \) \{ans_rule(10)\} +END_TEXT +Context("Numeric"); +ANS(Real($ans1)->cmp(tolType=>absolute,tolerance=>2)); +ANS(Real($ans2)->cmp(tolType=>absolute,tolerance=>2)); + +################################################# +# Answers +################################################# + +BEGIN_SOLUTION + +(a) Assuming no prior information is known about \(\hat{p}\), we should assume the "worst case" scenario with \(\hat{p}=0.5\) and thus \(\hat{q}=0.5\). Since we wish to have margin of error \($b\) and $sconf[0] confidence, which corresponds to \(z^{*}\approx$sz[0]\), we can find the needed sample size using the formula, \(\text{MOE} = z^{*}\sqrt{\frac{\hat{p}\hat{q}}{n}}\). +$PAR +Using this we obtain, +$PAR +\($b = $sz[0]\sqrt{\frac{(0.5)(0.5)}{n}}\). Solving for \(n\), we find \(n=$ans1\). +$PAR +(b) Assuming our margin of error and confidence level have not changed, we now also know that \(\hat{p}=$p\) and therefore \(\hat{q}=$q\). Thus we can use the margin of error formula again to obtain, +$PAR +\($b = $sz[0]\sqrt{\frac{($p)($q)}{n}}\). Solving for \(n\), we find \(n=$ans2\). +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_02_PictDistnsWGraphs.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_02_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..57a08997bb --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_02_PictDistnsWGraphs.pg @@ -0,0 +1,130 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("To display the distribution of grades (A, B, C, D, F) in a course, it would be correct to use ", + "either a pie chart or a bar graph. "); + $mc[0]->extra("a pie chart but not a bar graph. ", + "a bar graph but not a pie chart. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A study of recent college graduates records the sex and total college debt in dollars for \(10,000\) people a year after they graduate from college. Which of the following is a true statement? ", + "Sex is a categorical variable and college debt is a quantitative variable. "); + $mc[1]->extra("Sex and college debt are both categorical variables. ", + "Sex and college debt are both quantitative variables. ", + "Sex is a quantitative variable and college debt is a categorical variable. "); + $mc[1]->makeLast("All of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("A political party's data bank includes the zip codes of past donors, such as +$BR +\[ \begin{array}{cccccccc} +\mbox{47906} & \mbox{34236} & \mbox{53075} & \mbox{10010} & \mbox{90210} & \mbox{75204} & \mbox{30304} & \mbox{99709} +\end{array} \] +$PAR $SPACE $SPACE $SPACE Zip code is a", + "Categorical variable. "); + $mc[2]->extra("Quantitative variable. ", + "Unit of Measurement. "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("Here are the amounts of money (cents) in coins carried by 10 students in a statistics class: +\[ \begin{array}{ccccccccccc} +\mbox{50} & \mbox{35} & \mbox{0} & \mbox{97} & \mbox{76} & \mbox{0} & \mbox{0} & \mbox{87} & \mbox{23} & \mbox{65} +\end{array} \] +$BR +To make a stemplot of these data, you would use stems ", + "0, 1, 2, 3, 4, 5, 6, 7, 8, 9. "); + $mc[3]->extra("0, 2, 3, 5, 6, 7, 8, 9. ", + "00, 10, 20, 30, 40, 50, 60, 70, 80, 90. "); + $mc[3]->makeLast("None of the above. "); + +@solutions = ("Since the grades are letters, this makes the data is qualitative. Thus a pie chart or a bar graph would suffice in this situation.", + +" ''Sex'' is male, female, or other. Thus it is qualitative data. Amount of debt in dollars is quantitative data.", + +"Although zip codes are numbers, they are not a quantity, that is, we cannot associate a unit with zip codes. Furthermore, a zip codes of \(95817\) does not mean there are \(95817\) of anything. Rather, zip codes are a quality, a certain number means you live in a certain area. Thus zip codes are categorical or qualitative data.", + +"The option with \(0, 2, 3, 5, 6, 7, 8, 9\) is tempting but it leaves out the \(1\), which would mean a gap in our data so to speak. This would misrepresent our data. We cannot use option with \(00\), etc, since it would actually represent three digit numbers since each of the ''stems'' is already two digits. Option \(\{$mc[$order[1]] -> correct_ans\}\) covers all our data with the given ''stems'' being the ten's place", +); + +@ssols = (@solutions[@order]); + +################################################# +# Main + +BEGIN_TEXT +Select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + + +###################################### + + +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +$PAR + +(c) Option \(\{$mc[$order[2]] -> correct_ans\}\). $ssols[2] + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_05_PictDistnsWGraphs.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_05_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..af2a28e566 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_05_PictDistnsWGraphs.pg @@ -0,0 +1,136 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'time plot') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The maximum price per share for this time period was about "," \(41\) dollars. "); + $mc[0]->extra("\(45\) dollars. ", + "\(25\) dollars. ", + "\(20\) dollars. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("Which of the following is a true statement? ", + "There has been a general downward trend in the stock price over this time period."); + $mc[1]->extra("The price of General Electric stock has been stable for this year. ", + "The price should return to \(40\) dollars within six months because of the cycle. ", + "There has been a general upward trend in the stock price over this time period. "); + $mc[1]->makeLast("None of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("If you bought a single share of stock at the maximum price and sold it at the + minimum price during this one-year period, you would have lost about", + "\(15\) dollars."); + $mc[2]->extra("\(25\) dollars.", + "\(35\) dollars.", + "\(45\) dollars."); + $mc[2]->makeLast("Cannot be determined from the graph. "); + +@solutions = ("The value of the stock goes above \(40\) dollars but not close enough to \(45\) dollars to consider it the correct result.", + +"Overall the value of the stock has been going down. The data does not appear to be following a cycle and the value is not going up over time.", + +"The maximum value of the stock was about \(41\) dollars and the minimum value was about \(25\) dollars . Buying a single stock, at the end of one year, you would have lost about \(15\) dollars .", +); + +@ssols = (@solutions[@scramble]); + +###################################### +# Main text + +BEGIN_TEXT +The timeplot below gives the share price in dollars of General Electric stock, +with the bar chart giving the volume of trade in millions of shares. The plots are +for the one-year period of September \(2001\) through September \(2002\). +$PAR +$BCENTER +\{ image("Ref_1_1.gif", height=>300, width=>400, tex_size => 900) \} +$ECENTER +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +###################################### + +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +$PAR + +(c) Option \(\{$mc[$order[2]] -> correct_ans\}\). $ssols[2] + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_06_PictDistnsWGraphs.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_06_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..00be485dba --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_06_PictDistnsWGraphs.pg @@ -0,0 +1,88 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'histogram') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@TwoProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @TwoProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("When drawing a histogram it is important to ", + "label the vertical axis so the reader can determine the counts or percent in each bin. "); + $mc[0]->extra("have a separate bin for each observation to get the most informative plot. ", + "make sure the heights of the bars exceed the widths of the bins so that the bars are true rectangles. ", + "make certain the mean and median are contained in the same bin, so that the correct type of skewness can be identified. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("In drawing a histogram, which of the following suggestions should be followed? ", + "The heights of bars should equal the bin frequency or relative frequency."); + $mc[1]->extra("Leave large gaps between bars. This allows room for comments. ", + "Generally, bars should be square so that both the height and width equal the bin frequency. ", + "The scale of the vertical axis should be that of the variable whose distribution you are displaying. "); + +@solutions = ("The vertical axis should be labeled or else we would not know if we are dealing with count or percent.", + +"The heights of bars should equal the bin frequency or relative frequency, otherwise we would be leaving data out. Gaps are only included or seen if there is no data in that specific bin.", +); + +@ssols = (@solutions[@scramble]); +###################################### +# Main text + +BEGIN_TEXT +Select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); + +###################################### + +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_07_PictDistnsWGraphs.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_07_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..f2dacdc0a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_07_PictDistnsWGraphs.pg @@ -0,0 +1,97 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data', 'histogram') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The interval that contains closest to \(10\) students is ","\(68-71\) inches. "); + $mc[0]->extra("\(59-65\) inches. ", + "\(56-68\) inches. ", + "\(74-80\) inches. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("Which of the following is a correct statement? ", + "None of the above are correct."); + $mc[1]->extra("The tallest person must have a height of at least \(79\) inches. ", + "The histogram is symmetric. ", + "Approximately half the students have heights between \(65\) and \(71\) inches. "); + $mc[1]->makeLast("None of the above are correct."); + +@solutions = ("\(68-71\) inches seems to have just about \(10\) students. The other ranges have too many students or include a height which is not in our graph.", + +"None! The tallest person is at least \(77\) inches tall but that is all we know. We cannot argue the histogram is symmetric due to the middle. Finally, only about \(20\) seem to be between heights of \(65\) and \(71\) and their are roughly \(60\) in total.", +); + +@ssols = (@solutions[@scramble]); + +###################################### +# Main text + +BEGIN_TEXT +Consider the histogram given below: +$PAR +$BCENTER +\{ image("Ref_1_2.gif", height=>300, width=>400, tex_size => 600) \} +$ECENTER +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); + +###################################### + +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_08_PictDistnsWGraphs.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_08_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..aeea20d797 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_08_PictDistnsWGraphs.pg @@ -0,0 +1,111 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data', 'histogram') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The number of students with under \(10\) dollars in their possession is closest to ","\(60\) "); + $mc[0]->extra("\(50\) ", + "\(40\) ", + "\(70\) "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The histogram ","all of the above."); + $mc[1]->extra("is skewed right. ", + "has an outlier. ", + "is asymmetric. "); + $mc[1]->makeLast("all of the above."); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("The percentage of students with over \(10\) dollars in their possession is", + "over \(50$PERCENT\)."); + $mc[2]->extra("about \(10$PERCENT\).", + "about \(30$PERCENT\). ", + "about \(40$PERCENT\)."); + +@solutions = ("The first bin is the \(0-10\) dollar range (thus less than \(10\)) dollars. About \(60\) students are in the bin.", + +"All of the above! There is an outlier far on the right. We would say the graph is right skewed since if we were to draw a smooth curve over it the tail would go to the right. As such, the graph is also asymmetrical, which simply means not symmetrical.", + +"There are \(136\) students total, with about \(60\) of them having under \(10\) dollars. This means about half, or \(50$PERCENT\), of the students have more than \(10\) dollars.", +); + +@ssols = (@solutions[@scramble]); + +###################################### +# Main text + +BEGIN_TEXT +In a statistics class with \(136\) students, the professor records how much money +each student has in their possession during the first class of the semester. +The histogram below is of the data collected. +$PAR +$BCENTER +\{ image("Ref_1_4.gif", height=>320, width=>430, tex_size => 6) \} +$ECENTER +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +$PAR + +(c) Option \(\{$mc[$order[2]] -> correct_ans\}\). $ssols[2] + +END_SOLUTION +####################################### +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_09_PictDistnsWGraphs.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_09_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..46a0a26348 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_09_PictDistnsWGraphs.pg @@ -0,0 +1,109 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data', 'histogram') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("This stemplot is most similar to", + "a histogram with class intervals between \(110\) and \(120\), between \(120\) and \(130\), etc. "); + $mc[0]->extra("a time plot of the data with the observations taken in increasing order. ", + "a boxplot of the data. ", + "reporting the \(5\)-point summary for the data, with the mean. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("To which of the following data sets does this stemplot correspond? ", + "\(116, 118, 121, 124, 128, 133, 137, 142, 146, 179\) "); + $mc[1]->extra("\(16, 18, 21, 24, 28, 33, 37, 42, 46, 79\) ", + "\(1, 2, 3, 4, 6, 6, 7, 8, 8, 9\) ", + "all integers between \(116\) and \(179\) "); + +@solutions = ("A stemplot is almost like an upright histogram. If we take our current stemplot and lay it down on the left side it will resemble a histogram with class intervals between \(110\) and \(120\), between \(120\) and \(130\), etc.", + +"Since the ''stem'' of data table is \(11\), etc, this means \(1\) in the hundred's and \(1\) in the ten's. The number after the bar is the one's place. However, we cannot say it is all integers between \(116\) and \(179\) since we only have \(10\) students.", +); + +@ssols = (@solutions[@scramble]); + +###################################### +# Main text + +BEGIN_TEXT +For a Physics course containing \(10\) students, +the maximum point total for the quarter was \(200\). +The point totals for the \(10\) students are given in the stemplot below. +$PAR +$BCENTER +\{ image("Ref_1_5.gif", height=>150, width=>100, tex_size => 200) \} +$ECENTER +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) The lowest score in the class as a percentage of the total + possible points is \{ans_rule(10)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +$ans_c = Real('.58'); +Context("Percent"); +ANS(Percent($ans_c)->cmp); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +$PAR + +(c) As the total points possible is \(200\) and the lowest number of points scored was \(116\), the lowest scores as a percentage is \(\frac{116}{200}\) or \($ans_c\) + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_10_PictDistnsWGraphs.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_10_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..8ce951d299 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_10_PictDistnsWGraphs.pg @@ -0,0 +1,101 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data', 'histogram') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("Based on this pie chart, we may conclude that ", + "more than half of the cars in the study were from the United States. "); + $mc[0]->extra("Japanese cars get lower gas mileage than cars + of other countries. This is because their slice of the pie is at the + bottom of the chart. ", + "Italian and French cars get lower gas mileage than cars of other countries. This is because their slice of the pie is so thin.", + "Swedish cars get gas mileages that are between those of Japanese and American cars. ", + "Mercedes Benz, Audi, Porsche, and BMW represent approximately one quarter of the + cars tested. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A pie chart is equivalent to a ","bar chart."); + $mc[1]->extra("histogram. ", + "scatter plot. ", + "timeplot "); + $mc[1]->makeLast("None of the above. "); + +@solutions = ("Looking at the portion of the circle the U.S. has, we should conclude more than half of the cars in teh study were from the U.S.. Although this study is about the gas mileage of cars, the circle graph does not report gas mileage nor style of car, it only reports the country of manufacture.", + +"Since a pie chart is uses qualitative data, it is equivalent to a bar chart.", +); + +@ssols = (@solutions[@scramble]); + +###################################### +# Main text + +BEGIN_TEXT +Consumers Union measured the gas mileage in miles per gallon of \(38\) +\(1978-79\) model automobiles on a special test track. The pie chart +below provides information about the country-of-manufacture of the +models teseted by CU. +$PAR +$BCENTER +\{ image("Ref_1_6.gif", height=>270, width=>310, tex_size => 600) \} +$ECENTER + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_11_PictDistnsWGraphs.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_11_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..abf81a2b62 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/01Stats_11_PictDistnsWGraphs.pg @@ -0,0 +1,72 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data', 'bar graphs') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + + +###################################### +# Main text + +BEGIN_TEXT +Below is a bar graph of class standing for a Finance seminar +containing five students who are either freshman, sophomores, +juniors, or seniors. In the bar graph, the bar for the juniors +$BITALIC has been omitted$EITALIC. +$PAR +$BCENTER +\{ image("Ref_1_7.gif", height=>300, width=>350, tex_size => 600) \} +$ECENTER +$PAR +(a) The percentage of students in the seminar who are not juniors is \{ans_rule(10)\}. + +$PAR +(b) The number of students in the seminar who are juniors is \{ans_rule(10)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; +Context("Percent"); +ANS(Percent(0.8)->cmp); + +$ans_b = Real("1"); +ANS($ans_b->cmp); + + +###################################### +BEGIN_SOLUTION + +(a) Note that this question deals with $BITALIC percent $EITALIC of students. The question mentions five students total, with four students total who are not juniors. Since this is percent, it is \(\frac{4}{5}\) or \(80$PERCENT\). + +$PAR + +(b) Note that this question deals with $BITALIC number $EITALIC of students. The question mentions five students total, with four students total who are not juniors. This means that \($ans_b\) student is a junior. + + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_01_DescrData.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_01_DescrData.pg new file mode 100644 index 0000000000..84d0ddd7a6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_01_DescrData.pg @@ -0,0 +1,95 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 2: Describing Distributions with Numbers') +## KEYWORDS('statistics', 'skewed', 'mean', 'median') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 2: Describing Distributions with Numbers') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@pic= ("3-413210.gif", "3-118225.gif"); +@ANSWER1=("Skewed right", "Skewed left"); +@ANSWER2=("Mean", "Median"); +$choose = random(0,1,1); + +$popup1 = PopUp(["?", "Skewed right", "Skewed left", "Symmetric"], $ANSWER1[$choose]); + +$popup2 = PopUp(["?", "Mean", "Median", "They are about equal"], $ANSWER2[$choose]); + +###################################### +# Main text + +BEGIN_TEXT +Consider the histogram shown below. +$BR +$BCENTER +\{ image($pic[$choose], height=>300, width=>400, tex_size => 600) \} +$ECENTER +$PAR +(a) Is this data skewed to the right, symmetric, or skewed to the left? \{ $popup1->menu() \} +$BR + +$PAR +(b) Which is bigger for this data set, the mean or the median, or are they about equal? \{ $popup2->menu() \} +$BR + + +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + + +ANS( $popup1->cmp() ); +ANS( $popup2->cmp() ); + + +###################################### +BEGIN_SOLUTION + +(a) $popup1. If we were to draw a smooth curve over the histogram, the tail of that curve would go stretch further out to the left hand side than the right side. + +$PAR + +(b) $popup2. The small values, potentially outliers, would affect the mean and make it smaller, or drag it to the left graphically. The median would not be affected and would stay in the middle, making it larger than the mean. + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_07_DescrData.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_07_DescrData.pg new file mode 100644 index 0000000000..8120907ece --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_07_DescrData.pg @@ -0,0 +1,102 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 2: Describing Distributions with Numbers') +## KEYWORDS('statistics', 'quartiles', 'five number summary', 'median') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 2: Describing Distributions with Numbers') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@pic = ("8-714214.gif","8-317222.gif"); +@min=(5,2); +@Q1=(6,3); +@median=(7,6); +@Q3=(10.5,14); +@max=(13,16); + +$choose = random(0,1,1); + +################################################# +# Main + +BEGIN_TEXT +A boxplot for a set of data is given below. Find the five-number summary +$PAR +$BCENTER +\{ image($pic[$choose], height=>250, width=>350, tex_size => 600) \} +$ECENTER +$PAR +Find the minimum: \{ans_rule(5)\} +$PAR +Find \(Q_{1}\): \{ans_rule(5)\} +$PAR +Find the median: \{ans_rule(5)\} +$PAR +Find \(Q_{3}\): \{ans_rule(5)\} +$PAR +Find the maximum: \{ans_rule(5)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +ANS(Compute($min[$choose])->cmp); +ANS(Compute($Q1[$choose])->cmp); +ANS(Compute($median[$choose])->cmp); +ANS(Compute($Q3[$choose])->cmp); +ANS(Compute($max[$choose])->cmp); + +###################################### +BEGIN_SOLUTION + +(a) The minimum is the leftmost point of the boxplot, \($min[$choose]\) +$PAR +(b) \(Q_{1}\) is the first ''bar'' from left to right, \($Q1[$choose]\) +$PAR +(c) The median is the second ''bar'' from left to right, \($median[$choose]\) +$PAR +(d) \(Q_{3}\) is the third ''bar'' from left to right, \($Q3[$choose]\) +$PAR +(e) The maximum is the rightmost point of the boxplot, \($max[$choose]\) + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_08_DescrData.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_08_DescrData.pg new file mode 100644 index 0000000000..c30b476d05 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_08_DescrData.pg @@ -0,0 +1,73 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 2: Describing Distributions with Numbers') +## KEYWORDS('statistics', 'boxplot') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 2: Describing Distributions with Numbers') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + + +$n = random(6,24,1); +$number = 4 * $n; +@pic = ("9-213218.gif","9-312221.gif","9-613231.gif","9-511242.gif"); +$choose = random(0,3,1); +$perc = 25; +if ($choose == 3) { $perc = 50;} + +################################################# +# Main + +BEGIN_TEXT +A boxplot for a set of \($number\) scores is given below. +$PAR +$BCENTER +\{ image($pic[$choose], height=>250, width=>350, tex_size => 600) \} +$ECENTER +$PAR +How many scores are represented in the blue section of the boxplot? +$BR +Answer: \{ ans_rule(15)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans = $n; #The correct answer depends on the graph chosen. +if ($choose == 3) { $ans = 2 * $n;} + +ANS(Real($ans)->cmp->withPostFilter(AnswerHints( + Real(25) => ["Give the number of scores not the percent."], + Real(.25) => ["Give the number of scores not the fraction of scores."], + Real(50) => ["Give the number of scores not the percent."], + Real(.50) => ["Give the number of scores not the fraction of scores."] +))); + +###################################### +BEGIN_SOLUTION + +Recall that we want the number of test scores. Note that \($perc$PERCENT\) percent of the graph is blue. This means the portion in blue is \($perc$PERCENT\) percent of all \($number\) test scores. The blue portion is \($ans\) test scores. + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_10_DescrData.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_10_DescrData.pg new file mode 100644 index 0000000000..54ddde4129 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/02Stats_10_DescrData.pg @@ -0,0 +1,127 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Exploratory data analysis/descriptive statistics) +## DBsection(Summary statistics) +## Institution(The College of Idaho) +## Author(R Cruz, L Danielson, J Guild) +## MLT(stat-des-concepts) +## MLTleader(1) +## Level(2) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('2') +## Problem1('') +## KEYWORDS('statistics', 'skewed', 'five number summary', 'median', 'boxplot') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("If a distribution is skewed to the right, ", + "the mean is greater than the median."); + $mc[0]->extra("the mean is less than the median. ", + "the mean and median are equal. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("What percent of the observations in a distribution lie between the first quartile and the third quartile? ", + "\(50$PERCENT\). "); + $mc[1]->extra("\(25$PERCENT\). ", + "\(75$PERCENT\). "); + $mc[1]->makeLast("None of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("To make a boxplot of a distribution, you must know ","the five-number summary. "); + $mc[2]->extra("all of the individual observations. ", + "the mean and the standard deviation. "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("Which of the following is least affected if an extreme high outlier is added to your data? ", + "The median. "); + $mc[3]->extra("The mean. ", + "The standard deviation. "); + $mc[3]->makeLast("None of the above. "); + +@solutions = ("When a distribution is skewed the right, it normally means there is some extreme data on the right hand side, or at least enough data on the right hand side that makes the distribution not symmetric. This data on the right hand side will draw the mean (which is not resistant to outlier and large values) higher, and make it greater than the median.", + +"Since quartiles are broken up into quarters, \(50$PERCENT\) of the observations in a distribution lie between the first quartile and the third quartile, \(25$PERCENT\) from quartile one to the median and \(25$PERCENT\) from the median to quatile three.", + +"While havng all of the indivuadual observations is good, it is not necessary to construct a boxplot. As long as we have the \(5\)-number summary, we have all the needed information.", + +"The medain is least affected by adding large outlier. While its value will certainly change by adding new data, it will still be ''in the middle''.", +); + +@ssols = (@solutions[@scramble]); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +COMMENT('Questions selected randomly from a larger set. See source for full question list.'); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$order[0]] -> correct_ans\}\). $ssols[0] + +$PAR + +(b) Option \(\{$mc[$order[1]] -> correct_ans\}\). $ssols[1] + +$PAR + +(c) Option \(\{$mc[$order[2]] -> correct_ans\}\). $ssols[2] + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/03Stats_01_NormalDist.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/03Stats_01_NormalDist.pg new file mode 100644 index 0000000000..b857e63517 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/03Stats_01_NormalDist.pg @@ -0,0 +1,151 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@pic= ("1-815316.gif", "1-318321.gif", "1-712333.gif"); +@SHAPE=("Skewed right", "Skewed left", "Symmetric"); +@MEAN=("C", "A", "B"); +@MEDIAN=("B", "B", "B"); +$choose1 = random(0,2,1); +$choose2 = 2; +if ($choose1 == 2) {$choose2 = random(0,1,1);} + +$popup1 = PopUp(["?", "A", "B", "C"], $MEAN[$choose1]); +$popup2 = PopUp(["?", "A", "B", "C"], $MEDIAN[$choose1]); +$popup3 = PopUp(["?", "Skewed right", "Symmetric", "Skewed left"], $SHAPE[$choose1]); +$popup4 = PopUp(["?", "A", "B", "C"], $MEAN[$choose2]); +$popup5 = PopUp(["?", "A", "B", "C"], $MEDIAN[$choose2]); +$popup6 = PopUp(["?", "Skewed right", "Symmetric", "Skewed left"], $SHAPE[$choose2]); + +###################################### +# Main text 1 + +BEGIN_TEXT +For the distributions shown below, indicate which value is closest to the mean and +which value is closest to the median. State whether the distribution is skewed left, +skewed right or symmetric. +$BR +$BR +Graph \(1\). +$BR +\{ image($pic[$choose1], height=>250, width=>350, tex_size => 700) \} + +$PAR + (a) The mean is closest to: \{ $popup1->menu() \} +$PAR + (b) The median is closest to: \{ $popup2->menu() \} +$PAR + (c) Is this data skewed to the right, symmetric, or skewed to the left? \{ $popup3->menu() \} +$PAR +END_TEXT + +###################################### +# Answers 1 + +$showPartialCorrectAnswers = 1; + +ANS( $popup1->cmp() ); +ANS( $popup2->cmp() ); +ANS( $popup3->cmp() ); + +###################################### +# Main text 2 + +BEGIN_TEXT +$BR +Graph \(2\). +$BR +\{ image($pic[$choose2], height=>250, width=>350, tex_size => 700) \} + +$PAR + (a) The mean is closest to: \{ $popup4->menu() \} +$PAR + (b) The median is closest to: \{ $popup5->menu() \} +$PAR + + (c) Is this data skewed to the right, symmetric, or skewed to the left? \{ $popup6->menu() \} +$BR + +END_TEXT + +###################################### +# Answers 2 + +ANS( $popup4->cmp() ); +ANS( $popup5->cmp() ); +ANS( $popup6->cmp() ); + +###################################### +BEGIN_SOLUTION + +Graph \(1\) +$PAR +(a) Option \($popup1\). Recall that in general, for a symmetric graph, the mean is near the middle, for a left skewed graph the mean is further to the left and for a right skewed graph the mean is further to the right. + +$PAR + +(b) Option \($popup2\). Recall that for a symmetric graph, the median is near the middle, for a left skewed graph the median is still in the ''middle,'' which may be hard to see, but it will be higher, or larger than the mean. For a right skewed graph the median is still in the ''middle,'' which may be hard to see, but it will be lower, or smaller than the mean. + +$PAR + +(c) The data is \($popup3\). When skewed left, the tail of the curve extends futher on the left side. For skewed right, the tail extends further on the right side. For symmetric, the tail extends about the same amount on both sides. +$PAR +Graph \(2\) +$PAR +(a) Option \($popup4\) + +$PAR + +(b) Option \($popup5\) + +$PAR + +(c) The data is \($popup6\) + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + + + + + + + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/1-318321.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/1-318321.gif new file mode 100644 index 0000000000..386193c451 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/1-318321.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/1-712333.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/1-712333.gif new file mode 100644 index 0000000000..15b4c8cf7d Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/1-712333.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/1-815316.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/1-815316.gif new file mode 100644 index 0000000000..5e6f785521 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/1-815316.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/3-118225.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/3-118225.gif new file mode 100644 index 0000000000..d85ee1df55 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/3-118225.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/3-413210.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/3-413210.gif new file mode 100644 index 0000000000..45e3479d74 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/3-413210.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/8-317222.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/8-317222.gif new file mode 100644 index 0000000000..8b57e1e8ad Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/8-317222.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/8-714214.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/8-714214.gif new file mode 100644 index 0000000000..7733ca9770 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/8-714214.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-213218.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-213218.gif new file mode 100644 index 0000000000..2700357451 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-213218.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-312221.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-312221.gif new file mode 100644 index 0000000000..c831cc9436 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-312221.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-511242.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-511242.gif new file mode 100644 index 0000000000..45f709d7f9 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-511242.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-613231.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-613231.gif new file mode 100644 index 0000000000..a08f027a9c Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/9-613231.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/BoxPlotPercentBetween.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/BoxPlotPercentBetween.pg new file mode 100644 index 0000000000..af4d71ca3b --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/BoxPlotPercentBetween.pg @@ -0,0 +1,85 @@ +##DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Exploratory data analysis/descriptive statistics) +## DBsection(Graphical representations) +## Institution(NAU) +## Author(Edgar Fisher) +## Level(2) +## KEYWORDS('boxplot') +##ENDDESCRIPTION + +# File Created: 6/14/05 +# Location: Northern Arizona University + +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 annual salaries of attorneys in +thousands of dollars in Los Angeles. About what percentage +of the attorneys have salaries 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)); + +###################################### +BEGIN_SOLUTION + +Notice that both $from and $to are both either the minimum, \(Q_{1}\), the median, \(Q_{3}\), or the maximum. This means \(25$PERCENT\) of the observations are between the minimum and \(Q_{1}\), \(Q_{1}\) and the median, etc. Based on this we can conclude \($ans$PERCENT\) of salaries are between $from and $to. + + +END_SOLUTION +####################################### + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/Boxplot.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Boxplot.pg new file mode 100644 index 0000000000..6841982298 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Boxplot.pg @@ -0,0 +1,186 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## KEYWORDS('boxplot') +## Author('Ty Thompson/Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/02/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGgraphmacros.pl", + "PGnauStats.pl" +); + +TEXT(beginproblem()); + +{ +@low=(); +@high=(); +@Q1=(); +@Q3=(); +@mean=(); +@medn=(); +@corr=(); +@incorr=(); + +#randomly setup the data range +@datasets = ("D1", "D2", "D3"); + +for ($i=0; $i<3; $i++){ + $val = random(-100,100,1); + push @low, $val; + push @high, random($val + 10, $val + 110, 1); + + $val = ($high[$i] - $low[$i])/3; + push @mean, int random($low[$i] + $val, $high[$i] - $val, 1); + + push @Q1, int random($low[$i] + 2,$mean[$i] - 1, 1); + + push @Q3, int random($mean[$i] + 1,$high[$i] - 2,1); + + if ($Q3[$i] - $Q1[$i] == 2){ + push @medn, $Q3[$i] - 1; + } else { + do{ + $val = int random($Q1[$i] + 1,$Q3[$i] - 1, 0.1); + } while ($val == $mean[$i]); + push @medn, $val; + } + } + +if (random(1,2,1)>1){ + $medn[1] = ($Q3[1]+$Q1[1])/2; + } + +##### Answers. There are six possible answers, each might either be correct or incorrect. + +push @corr, "Which of the following are true?"; + +#The first answer +if ($low[0] > $medn[1]){ + push @corr, (join " ", "All the data values for set ", $datasets[0], " are greater than the median value for ", $datasets[1], "."); +} +else{ + push @incorr, (join " ", "All the data values for set ", $datasets[0], " are greater than the median value for ", $datasets[1], "."); +} + +#The second answer +if ($Q1[2] < $medn[1]){ + push @corr, (join " ", "At least one quarter of the data values for ", $datasets[2], " are less than the median value for ", $datasets[1]); +} +else{ + push @incorr, (join " ", "At least one quarter of the data values for ", $datasets[2], " are less than the median value for ", $datasets[1]); +} + +#The third answer +if ($medn[0] > $medn[2]){ + push @corr, ("The data for ". join " ", $datasets[0], " has a greater median value than the data for ", $datasets[2], "."); +} +else{ + push @incorr, ("The data for ". join " ", $datasets[0], " has a greater median value than the data for ", $datasets[2], "."); +} + + +#The fourth answer. +if ((abs(ln(($Q3[1] - $medn[1]) / ($medn[1] - $Q1[1]))) <= .2) +&& (abs(ln(($high[1] - $Q3[1]) / ($Q1[1] - $low[1]))) <= .3)){ + push @corr, ("The data represented in $datasets[1] is roughly symmetric."); +}else{ + push @incorr, ("The data represented in $datasets[1] is roughly symmetric."); +} + +#The fifth answer +# skew is not decidable from box plot Nandor +# if ($medn[2] < ($Q3[2]+$Q1[2])/2){ +# push @corr, ("The data represented in ". join " ", "boxplot ", $datasets[2], " is skewed to the right."); +# }else{ +# push @incorr, ("The data represented in ". join " ", "boxplot ", $datasets[2], " is skewed to the right."); +# } + +#The sixth answer +if ($Q1[0] > $medn[2]){ + push @corr, (join " ", "At least three quarters of the data values represented in ", $datasets[0], " are greater than the median value of ", $datasets[2], "."); +}else{ + push @incorr, (join " ", "At least three quarters of the data values represented in ", $datasets[0], " are greater than the median value of ", $datasets[2], "."); +} + +redo if (1==(scalar @corr)); # all the answers are false +} + +# find the minimum data value +$datamin = $low[0]; +for ($i = 1; $i < 3; $i++){ + if ($low[$i] < $datamin){$datamin = $low[$i];} + } + +# find the maximum data value +$datamax = $high[0]; +for ($i = 1; $i < 3; $i++){ + if ($high[$i] > $datamax){$datamax = $high[$i];} + } + +# adjust +$adjusted_datamin = $datamin - ($datamax-$datamin)/2 * 0.1; +$adjusted_datamax = $datamax + ($datamax-$datamin)/2 * 0.1; + +$graph1 = BoxPlot($low[0], $Q1[0], $medn[0], $Q3[0], $high[0], + winmin=>$adjusted_datamin, winmax=>$adjusted_datamax, + $low[0], $high[0], axis=>0, 'min', '', '', '', 'max'); + +$datalabel = new Label(110, 17, $datasets[0], 'black','center','center'); +$graph1->lb($datalabel); + +$graph2 = BoxPlot($low[1], $Q1[1], $medn[1], $Q3[1], $high[1], + winmin=>$adjusted_datamin, winmax=>$adjusted_datamax, + $low[1], $high[1], axis=>0, 'min', '', '', '', 'max'); + +$datalabel = new Label(110, 17, $datasets[1], 'black','center','center'); +$graph2->lb($datalabel); + +$graph3 = BoxPlot($low[2], $Q1[2], $medn[2], $Q3[2], $high[2], + winmin=>$adjusted_datamin, winmax=>$adjusted_datamax, + $low[2], $high[2], 'min', '', '', '', 'max'); + +$datalabel = new Label(110, 17, $datasets[2], 'black','center','center'); +$graph3->lb($datalabel); + +#The answer box +$cmc = new_checkbox_multiple_choice(); +$cmc -> qa (@corr); +$cmc -> extra (@incorr); + +BEGIN_TEXT +Data from three data sets are plotted in box plots for comparison. $PAR +$BCENTER +\{ Plot($graph1, tex_size=>900); \} +\{ Plot($graph2, tex_size=>900); \} +\{ Plot($graph3, tex_size=>900); \} +$ECENTER +$PAR +$BR +\{$cmc -> print_q \} +\{$cmc -> print_a \} +$BR + +END_TEXT + +ANS( checkbox_cmp( $cmc->correct_ans )); + + + +###################################### +BEGIN_SOLUTION + +Option \{$cmc->correct_ans\}. + +END_SOLUTION +####################################### + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/FiveNumAndPlot.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/FiveNumAndPlot.pg new file mode 100644 index 0000000000..5323258ac7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/FiveNumAndPlot.pg @@ -0,0 +1,80 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## KEYWORDS('boxplot', 'five number summary') +## Author('Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/6/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PG.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGgraphmacros.pl", + "extraAnswerEvaluators.pl", + "PGnauStats.pl", + "parserPopUp.pl", +); + +TEXT(&beginproblem) ; +$showPartialCorrectAnswers = 1; + +push @dat, random(15, 30,1); +push @dat, random(35, 43,1); +push @dat, random(45, 70,1); +push @dat, random(72, 85,1); +push @dat, random(89, 100,1); + + +@names = ('Min', 'Q_{1}', 'Median', 'Q_{3}', 'Max'); +@labels = ('', '', '', '', ''); +@slice = NchooseK(5,3); + +$labels[$slice[0]] = 'Z'; +$labels[$slice[1]] = 'Y'; +$labels[$slice[2]] = 'X'; + +$popup0 = PopUp(["?", @names, "Mean", "Left Pivot", "Right Pivot"], $names[$slice[0]]); +$popup1 = PopUp(["?", @names, "Mean", "Left Pivot", "Right Pivot"], $names[$slice[1]]); +$popup2 = PopUp(["?", @names, "Mean", "Left Pivot", "Right Pivot"], $names[$slice[2]]); + + +$graph = BoxPlot(@dat, @labels); + +BEGIN_TEXT +Consider the following box and whisker plot. +$PAR +$BCENTER +\{Plot($graph);\} +$ECENTER +$labels[$slice[0]] is the \{ $popup0->menu() \} +$PAR +$labels[$slice[1]] is the \{ $popup1->menu() \} +$PAR +$labels[$slice[2]] is the \{ $popup2->menu() \} +$PAR +END_TEXT + +ANS( $popup0->cmp() ); +ANS( $popup1->cmp() ); +ANS( $popup2->cmp() ); + +###################################### +BEGIN_SOLUTION + +The markers from left to right on a boxplot are the minimum, \(Q_{1}\), the median, \(Q_{3}\) and the maximum. The mean can be estimated but we cannot find it explicitely based on just a boxplot. As such, we have the following, +$PAR +(a) $labels[$slice[0]] is the $popup0 +$PAR +(b) $labels[$slice[1]] is the $popup1 +$PAR +(c) $labels[$slice[2]] is the $popup2 + +END_SOLUTION +####################################### +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/FiveNumFromPlot.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/FiveNumFromPlot.pg new file mode 100644 index 0000000000..e14a4da465 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/FiveNumFromPlot.pg @@ -0,0 +1,61 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## KEYWORDS('boxplot', 'five number summary') +## Author('Edgar Fisher') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/6/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGnauStats.pl", + "MathObjects.pl", +); + +TEXT(&beginproblem) ; +$showPartialCorrectAnswers = 1; + +push @dat, random(15, 30,1); +push @dat, random(35, 43,1); +push @dat, random(45, 70,1); +push @dat, random(72, 85,1); +push @dat, random(89, 100,1); + +$graph = BoxPlot(@dat, @dat); + +@slice = num_sort(NchooseK(5,2)); + +@labels = ("Minimum", "First quartile", "Median", "Third quartile", "Maximum"); +@questions = @labels[@slice]; + +BEGIN_TEXT +Consider the following box and whisker plot. Find the indicated values of the represented data.$PAR +$BCENTER +\{Plot($graph);\} +$ECENTER +$PAR +$questions[0]: \{ans_rule(5) \}$BR +$questions[1]: \{ans_rule(5) \}$BR + +END_TEXT + +ANS(Compute($dat[$slice[0]])->cmp); +ANS(Compute($dat[$slice[1]])->cmp); + + +############################# +BEGIN_SOLUTION + +The markers from left to right on a boxplot are the minimum, quartile \(1\), the median, quartile \(3\) and the maximum. As such, we have the following, +$PAR +(a) The $questions[0] is \($dat[$slice[0]]\) +$PAR +(b) The $questions[1] is \($dat[$slice[1]]\) +END_SOLUTION +############################# +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_1.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_1.gif new file mode 100644 index 0000000000..eb14d322f7 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_1.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_2.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_2.gif new file mode 100644 index 0000000000..5aa5baf094 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_2.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_4.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_4.gif new file mode 100644 index 0000000000..197e2c952b Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_4.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_5.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_5.gif new file mode 100644 index 0000000000..1151518cb0 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_5.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_6.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_6.gif new file mode 100644 index 0000000000..2452fad412 Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_6.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_7.gif b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_7.gif new file mode 100644 index 0000000000..9234adbe0b Binary files /dev/null and b/OpenProblemLibrary/PCC/Statistics/DisplayingData/Ref_1_7.gif differ diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/easy_histogram.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/easy_histogram.pg new file mode 100644 index 0000000000..be79af6ed7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/easy_histogram.pg @@ -0,0 +1,75 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## KEYWORDS('histogram') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/11/05 +# Problem Author: +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGnauStats.pl", + "PGstatisticsmacros.pl", + "PGnumericalmacros.pl", + "MathObjects.pl", + "contextPercent.pl", +); +TEXT(&beginproblem); + +$n = 50; +$max = random( 29, 44, 5 ); +for( $i = 0; $i < $n; $i++ ){ $val = random( 0, $max, 1 ); + push @list, $val; +} +$name = list_random( 'Mathematics and Statistics', 'Chemistry', 'Biology', 'English' ); +$num = random( 5, $max - 10, 5 ); +@dir = ( $num.' or more ', ' less than '.$num ); +$ind = random( 0, 1 ); +foreach $val(@list){ + if( $val < $num ){ push @newlist1, $val + }else{ push @newlist2, $val } +} +if( $ind == 0 ){ $ans1 = ( 100 * scalar( @newlist2 ) ) / $n; +}else{ $ans1 = ( 100 * scalar( @newlist1 ) ) / $n;} + +if( $ind == 0 ){ $tot = ( scalar( @newlist2 ) ); +}else{ $tot = ( scalar( @newlist1 ) );} + + +BEGIN_TEXT + +The histogram below gives the length of service of members of the Department of $name at a particular +university. The classes, in years of service, are \(0-5\), \(5-10\), etc., and the vertical axis represents the +number of faculty in each bin. +$PAR + +What percent of the department faculty have $dir[$ind] years of service?$BR + +$PAR +$BCENTER +\{ Plot( Histogram( @list, bins => ( $max + 1 ) / 5, axislabel => 'Years of Service', + labelcount => $n, title => $name.' Faculty' ) ) \} +$ECENTER +$PAR + +\{ans_rule( 15 )\} of the department faculty have $dir[$ind] years of service. + +END_TEXT + +Context("Percent"); +ANS( Percent( $ans1/100 )->cmp ); + +############################# +BEGIN_SOLUTION + +We first need to find the total number of faculty, which \($n\). Then, we need to how many of those \($n\) have $dir[$ind] years of service. In this case, \($tot\) faculty have $dir[$ind] years of service, meaning \($ans1$PERCENT\) have $dir[$ind] years of service. +END_SOLUTION +############################# + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/gust11.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/gust11.pg new file mode 100644 index 0000000000..b8f06d6a1b --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/gust11.pg @@ -0,0 +1,137 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('What is Statistics?') +##DBsection('Characterizing a Set of Measurements: Numerical Methods') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +$r[0]=[random(1,6,1), random(1,7,1), random(1,6,1), random(1,7,1), random(1,7,1), random(1,1,1), random(1,6,1), random(2,6,1)]; +$r[1]=[random(1,5,1), random(2,6,1), random(3,5,1), random(1,7,1), random(1,7,1), random(1,7,1), random(1,7,1), random(1,7,1)]; +$r[2]=[random(3,5,1), random(1,4,1), random(1,7,1), random(1,4,1), random(1,7,1), random(3,5,1), random(1,5,1), random(2,6,1)]; +$r[3]=[random(1,5,1), random(1,5,1), random(1,7,1), random(1,7,1), random(1,7,1), random(2,6,1), random(1,7,1), random(2,6,1)]; +$r[4]=[random(1,7,1), random(1,5,1), random(1,4,1), random(3,5,1), random(1,7,1), random(1,7,1), random(3,5,1), random(2,6,1)]; + +@cnts=(0,0,0,0,0,0,0,0,0); +for $j (0..4) { + for $k (0..7) { + $cnts[$r[$j][$k]] += 1; + } +} + +$a = $cnts[1]; +$b = $cnts[2]; +$c = $cnts[3]; +$d = $cnts[4]; +$e = $cnts[5]; +$f = $cnts[6]; +$g = $cnts[7]; +$total = 40; + +$ans1= $a/$total; +$ans2= $b/$total; +$ans3= $c/$total; +$ans4= $d/$total; +$ans5= $e/$total; +$ans6= $f/$total; +$ans7= $g/$total; + +BEGIN_TEXT + +The U.S. Bureau of the Census conducts nationwide sureys on characteristics of U.S. households. The following are data on the number of people per household for a sample of \(40\) households. Construct a frequency and relative frequency table for these household sizes. (Relative frequencies may be entered as decimals, as with \(0.5\), or as percentages, as with \(50$PERCENT\).) +$PAR +$BCENTER +\{begintable(8)\} +\{row(@{$r[0]})\} +\{row(@{$r[1]})\} +\{row(@{$r[2]})\} +\{row(@{$r[3]})\} +\{row(@{$r[4]})\} +\{endtable()\} +$ECENTER + +$PAR +$BCENTER +\{begintable(3)\} +\{row("Household size", "Frequency", "Relative Frequency")\} +\{row("\(1\)", ans_rule(10), ans_rule(10))\} +\{row("\(2\)", ans_rule(10), ans_rule(10))\} +\{row("\(3\)", ans_rule(10), ans_rule(10))\} +\{row("\(4\)", ans_rule(10), ans_rule(10))\} +\{row("\(5\)", ans_rule(10), ans_rule(10))\} +\{row("\(6\)", ans_rule(10), ans_rule(10))\} +\{row("\(7\)", ans_rule(10), ans_rule(10))\} +\{row("${BBOLD}Total${EBOLD}", "\($total\)", "\(1\)")\} +\{endtable()\} +$ECENTER +END_TEXT + +Context("Percent"); + +ANS(Compute($a)->cmp); +ANS(Percent($ans1)->cmp); +ANS(Compute($b)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Compute($c)->cmp); +ANS(Percent($ans3)->cmp); +ANS(Compute($d)->cmp); +ANS(Percent($ans4)->cmp); +ANS(Compute($e)->cmp); +ANS(Percent($ans5)->cmp); +ANS(Compute($f)->cmp); +ANS(Percent($ans6)->cmp); +ANS(Compute($g)->cmp); +ANS(Percent($ans7)->cmp); + + +############################# +BEGIN_SOLUTION + +$BCENTER +\{begintable(3)\} +\{row("Household size", "Frequency", "Relative Frequency")\} +\{row("\(1\)", "\($a\)", "\($ans1\)")\} +\{row("\(2\)", "\($b\)", "\($ans2\)")\} +\{row("\(3\)", "\($c\)", "\($ans3\)")\} +\{row("\(4\)", "\($d\)", "\($ans4\)")\} +\{row("\(5\)", "\($e\)", "\($ans5\)")\} +\{row("\(6\)", "\($f\)", "\($ans6\)")\} +\{row("\(7\)", "\($g\)", "\($ans7\)")\} +\{row("${BBOLD}Total${EBOLD}", "\($total\)", "\(1\)")\} +\{endtable()\} +$ECENTER +END_SOLUTION +############################# + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/gust30.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/gust30.pg new file mode 100644 index 0000000000..ebdedb3513 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/gust30.pg @@ -0,0 +1,59 @@ +##DESCRIPTION +## Statistics: Characterizing a Set of Measurements +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('What is Statistics?') +##DBsection('Characterizing a Set of Measurements: Graphical Methods') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Which of the following is useful for qualitative data?", "Bar graph"); +$mc->extra("Histogram", "Dot plot"); +$mc->makeLast("All of the above", "None of the above"); + +BEGIN_TEXT +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + +############################# +BEGIN_SOLUTION + +Option \(\{ $mc->correct_ans \}\). Qualitative data should only be used with bar graph and circle graphs. + +END_SOLUTION +############################# + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/histogram1.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/histogram1.pg new file mode 100644 index 0000000000..b445d1a409 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/histogram1.pg @@ -0,0 +1,76 @@ +##DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Exploratory data analysis/descriptive statistics) +## DBsection(Description of distributions) +## Institution(NAU) +## Author(N.Spencer Sitton) +## Level(3) +## KEYWORDS('histogram') +##ENDDESCRIPTION + +# File Created: 07/12/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGnauStats.pl", + "PGstatisticsmacros.pl", + "PGnumericalmacros.pl" +); + + +TEXT(&beginproblem); + +@data = ( 'mean daily temperature in June for a particular city', 'mean daily temperature in November + for a particular city', 'age of incoming freshmen students at a particular high school', + 'age of graduating high school seniors at a particular high school' ); +$ind = random( 0, 3, 1 ); +@list2 = ( 'mean', 'median' ); +@slice = NchooseK( 2, 2); + +if( $ind == 0 ){ @list1 = SpecialData( 'left', count => 30, min => random(86,91,1), max => random(100,105,1) ); + $Hist = Histogram( @list1, bins => 10, axislabel => 'Temperature(F)', title =>'Mean Daily Temperature in June' ); +} +elsif( $ind == 1 ){ @list1 = SpecialData( 'right', count => 30, min => random(36,41,1), max =>random(50,55,1) ); + $Hist = Histogram( @list1, bins => 10, axislabel => 'Temperature(F)', title =>'Mean Daily Temperature in November' ); +} +elsif( $ind == 2 ){ @list1 = SpecialData( 'right', count => 500, min => 14.5, max => 17.5 ); + $Hist = Histogram( @list1, axislabel => 'Age(years)', title =>'Age of Incoming High school Freshmen' ); +} +elsif( $ind == 3 ){ @list1 = SpecialData( 'left', count => 500, min => 16, max => 19 ); + $Hist = Histogram( @list1, axislabel => 'Age(years)', title =>'Age of High School Seniors at Graduation' ); +} +if( $slice[0] == 0 ){ + if( $ind == 0 || $ind == 3 ){ $ans = 'less than the median'; + } else{ $ans = 'greater than the median'; + } +}else{if( $ind == 0 || $ind == 3 ){ $ans = 'greater than the mean'; + } else{ $ans = 'less than the mean'; + } +} +BEGIN_TEXT + +The Histogram below gives the $data[$ind].$BR +Based on the given distribution the $list2[$slice[0]] is +\{ pop_up_list(''=>'', 'less than the '.$list2[$slice[1]] => 'less than the '.$list2[$slice[1]], +'equal to the '.$list2[$slice[1]] => 'equal to the '.$list2[$slice[1]], +'greater than the '.$list2[$slice[1]] => 'greater than the '.$list2[$slice[1]], +'may fall anywhere relative to the '.$list2[$slice[1]] => 'may fall anywhere relative to the '.$list2[$slice[1]] ) \} +$PAR +$PAR \{ Plot( $Hist, tex_size=>900) \} + +END_TEXT + +ANS( str_cmp( $ans ) ); + +###################################### +BEGIN_SOLUTION + +Based on the given distribution the $list2[$slice[0]] is $ans. Recall that anytime our distribution is skewed right we would expect the mean to be larger than the median and anytime the distribution is skewed left we expect the mean to be smaller than the median. + +END_SOLUTION +####################################### + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/skew_dist1.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/skew_dist1.pg new file mode 100644 index 0000000000..f0ac68cf84 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/skew_dist1.pg @@ -0,0 +1,73 @@ +##DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Exploratory data analysis/descriptive statistics) +## DBsection(Description of distributions) +## Institution(NAU) +## Author(N.Spencer Sitton) +## Level(2) +## KEYWORDS('skew') +##ENDDESCRIPTION + +# File Created: 06/20/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGchoicemacros.pl" +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 0; +$mc = new_multiple_choice(); + +$city = list_random( 'Tucson', 'Phoenix', 'Flagstaff', 'Salt Lake City', 'Pleasent Grove' ); +@dir = ( 'left', 'right'); +$ind = random( 0, 1, 1 ); +$median = random( 150000, 350000, 10000 ); + +$th = int( $median / 1000 ); +$h = int( ( $median - ($th * 1000) ) / 100 ); +$t = int ( ( $median - ( $th * 1000 ) - ( $h * 100) ) / 10 ); +$o = int ( $median - ( $th * 1000 ) - ( $h * 100) - ( $t * 10 ) ); +$nmedian = $DOLLAR.$th.','.$h.$t.$o; + +if( $ind == 0 ){ + $mc -> qa( 'Specify the general location of the mean.', + 'lower than $nmedian' + ); + $mc -> extra( 'higher than $nmedian', + 'equal to $nmedian', + 'it may fall anywhere to $nmedian' + ); +}else{ + $mc -> qa( 'Specify the general location of the mean.', + 'higher than $nmedian' + ); + $mc -> extra( 'lower than $nmedian', + 'equal to $nmedian', + 'it may fall anywhere relative to $nmedian' + ); +} + +BEGIN_TEXT + +The distribution of home prices in $city is skewed to the $dir[$ind]. The median price is $nmedian. +\{ $mc -> print_q \} +$BR +\{ $mc -> print_a \} + +END_TEXT + +ANS( str_cmp( $mc -> correct_ans ) ); + +############################# +BEGIN_SOLUTION + +Option \(\{ $mc->correct_ans \}\). Recall that anytime a distribution is skewed to the left the mean is generally less, or smaller, than the median and anytime a distribution is skewed to the right the mean is generally more, or greater, than the median. + +END_SOLUTION +############################# + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW01-17.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW01-17.pg new file mode 100644 index 0000000000..27b8e8f939 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW01-17.pg @@ -0,0 +1,157 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics', 'stem and leaf') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## Date('5/25/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$b1 = random(1,4,1); +$b = 10*$b1; +$b2 = $b1 + 2; + +$c[0] = random(0,2,1); +$data[0] = $b + $c[0]; +$c[1] = $c[0]; +$data[1] = $data[0]; +$t = random(1,3,1); +$data[2] = $data[1] + $t; +$c[2] = $t + $c[1]; +$t = random(1,3,1); +$data[3] = $data[2] + $t; +$c[3] = $t + $c[2]; +$ans[1] = "$c[0]"."$c[1]"."$c[2]"."$c[3]"; + +$c[4] = 0; +$data[4] = $b + 10; +$c[5] = random(2,7,1); +$data[5] = $data[4] + $c[5]; +$c[6] = $c[5]; +$data[6] = $data[5]; +$c[7] = $c[6]; +$data[7] = $data[6]; +$t = random(1,2,1); +$data[8] = $data[7] + $t; +$c[8] = $t + $c[7]; +$ans[2] = "$c[4]"."$c[5]"."$c[6]"."$c[7]"."$c[8]"; + +$c[9] = random(3,6,1); +$data[9] = $b + 20 + $c[9]; +$t = random(0,2,1); +$data[10] = $data[9] + $t; +$c[10] = $t + $c[9]; +$c[11] = 9; +$data[11] = $b + 20 + $c[11]; +$c[12] = $c[11]; +$data[12] = $data[11]; +$ans[3] = "$c[9]"."$c[10]"."$c[11]"."$c[12]"; + +$c[13] = random(0,4,1); +$data[13] = $b + 30 + $c[13]; +$c[14] = random(8,9,1); +$data[14] = $b + 30 + $c[14]; +$ans[4] = "$c[13]"."$c[14]"; + +$c[15] = random(0,3,1); +$data[15] = $b + 40 + $c[15]; +$t = random(0,3,1); +$data[16] = $data[15] + $t; +$c[16] = $t + $c[15]; +$t = random(0,3,1); +$data[17] = $data[16] + $t; +$c[17] = $t + $c[16]; +$ans[5] = "$c[15]"."$c[16]"."$c[17]"; + +@slice = NchooseK(18,18); +@a = @data[@slice]; + +$b1is=$b1+1; +$b2is=$b2+1; +$b2iss=$b2+2; + +BEGIN_TEXT +$PAR Consider the following data set: +$PAR +\[ +\begin{array}{ccccccccc} +$a[0] & $a[1] & $a[2] & $a[3] & $a[4] & $a[5] & $a[6] & $a[7] & $a[8]\\ +$a[9] & $a[10] & $a[11] & $a[12] & $a[13] & $a[14] & $a[15] & $a[16] & $a[17] +\end{array} +\] +$BR +Below is a partially completed stem plot for this data set: + +$PAR +$BCENTER +\{begintable(2)\} +\{row("\($b1\)", ans_rule(20))\} +\{row(ans_rule(3), ans_rule(20))\} +\{row("\($b2\)", ans_rule(20))\} +\{row(ans_rule(3), "\($ans[4]\)")\} +\{row(ans_rule(3), ans_rule(20))\} +\{endtable()\} +$ECENTER +$PAR + +Determine the correct values for the missing entries, and fill them in. Do not use any commas; spaces are OK if you'd like to use them though. + + + +$PAR + +END_TEXT + +ANS(str_cmp($ans[1],'remove_whitespace')); +ANS(num_cmp($b1 + 1)); +ANS(str_cmp($ans[2],'remove_whitespace')); +ANS(str_cmp($ans[3],'remove_whitespace')); +ANS(num_cmp($b2 + 1)); +ANS(num_cmp($b2 + 2)); +ANS(str_cmp($ans[5],'remove_whitespace')); + +################################ +BEGIN_SOLUTION + +$PAR +$BCENTER +\{begintable(2)\} +\{row("\($b1\)", "\($ans[1]\)")\} +\{row("\($b1is\)", "\($ans[2]\)")\} +\{row("\($b2\)", "\($ans[3]\)")\} +\{row("\($b2is\)", "\($ans[4]\)")\} +\{row("\($b2iss\)", "\($ans[2]\)")\} +\{endtable()\} +$ECENTER +$PAR +END_SOLUTION +################################ + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW01-18.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW01-18.pg new file mode 100644 index 0000000000..bcee0d3b99 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW01-18.pg @@ -0,0 +1,176 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics', 'stem and leaf') +## JJH tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## Date('5/25/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$b1 = random(15,19,1); +$b = 10*$b1; +$b2 = $b1 + 1; + +$c[0] = random(0,1,1); +$data[0] = $b + $c[0]; +$t = $c[0] + 1; +$data[1] = $data[0] + $t; +$c[1] = $c[0] + $t; +$data[2] = $data[1]; +$c[2] = $c[1]; +$t = random(1,2,1); +$data[3] = $data[2] + $t; +$c[3] = $t + $c[2]; +$data[4] = $data[3]; +$c[4] = $c[3]; +if ($c[3] == 5) { + $ans[1] = "$c[0]"."$c[1]"."$c[2]"; +} +else { + $ans[1] = "$c[0]"."$c[1]"."$c[2]"."$c[3]"."$c[4]"; +} + +$c[5] = 5; +$data[5] = $b + 5; +$t = 5 + random(1,2,1); +$data[6] = $b + $t; +$c[6] = $t; +$data[7] = $data[6]; +$c[7] = $c[6]; +$t = 5 + random(3,4,1); +$data[8] = $b + $t; +$c[8] = $t; +$data[9] = $data[8]; +$c[9] = $c[8]; +if ($c[3] == 5) { + $ans[2] = "$c[3]"."$c[4]"."$c[5]"."$c[6]"."$c[7]"."$c[8]"."$c[9]"; +} +else { + $ans[2] = "$c[5]"."$c[6]"."$c[7]"."$c[8]"."$c[9]"; +} + +$ans[3] = ""; + +$c[10] = random(5,7,1); +$data[10] = $b + 10 + $c[10]; +$data[11] = $data[10]; +$c[11] = $c[10]; +$data[12] = $data[11]; +$c[12] = $c[11]; +$t = random(7,9,1); +$data[13] = $b + 10 + $t; +$c[13] = $t; +$data[14] = $data[13]; +$c[14] = $c[13]; +$ans[4] = "$c[10]"."$c[11]"."$c[12]"."$c[13]"."$c[14]"; + +$c[15] = random(0,2,1); +$data[15] = $b + 20 + $c[15]; +$c[16] = random(2,3,1); +$data[16] = $b + 20 + $c[16]; +$c[17] = $c[16]; +$data[17] = $data[16]; +$c[18] = $c[17]; +$data[18] = $data[17]; +$c[19] = $c[18]+1; +$data[19] = $b + 20 + $c[19]; +$ans[5] = "$c[15]"."$c[16]"."$c[17]"."$c[18]"."$c[19]"; + +$c[20] = random(5,7,1); +$data[20] = $b + 20 + $c[20]; +$c[21] = random(7,9,1); +$data[21] = $b + 20 + $c[21]; +$ans[6] = "$c[20]"."$c[21]"; + +@slice = NchooseK(22,22); +@a = @data[@slice]; + +$b2is=$b2+1; + +BEGIN_TEXT +$PAR Consider the following data set: +$PAR +\[ +\begin{array}{ccccccccccc} +$a[0] & $a[1] & $a[2] & $a[3] & $a[4] & $a[5] & $a[6] & $a[7] & $a[8]& $a[9] & $a[10] \\ +$a[11] & $a[12] & $a[13] & $a[14] & $a[15] & $a[16] & $a[17] & $a[18] & $a[19] & $a[20] & $a[21] +\end{array} +\] +$BR +Below is a partially completed split stem plot for this data set: + +$PAR +$BCENTER +\{begintable(2)\} +\{row("\($b1\)", ans_rule(20))\} +\{row("\($b1\)", ans_rule(20))\} +\{row(ans_rule(3), ans_rule(20))\} +\{row("\($b2\)", ans_rule(20))\} +\{row(ans_rule(3), ans_rule(20))\} +\{row(ans_rule(3), ans_rule(20))\} +\{endtable()\} +$ECENTER +$PAR + +Determine the correct values for the missing entries, and fill them in. Do not use any commas; spaces are OK if you'd like to use them though. + + +END_TEXT + +ANS(str_cmp($ans[1],'remove_whitespace')); +ANS(str_cmp($ans[2],'remove_whitespace')); +ANS(num_cmp($b2)); +ANS(str_cmp($ans[3],'remove_whitespace')); +ANS(str_cmp($ans[4],'remove_whitespace')); +ANS(num_cmp($b2+1)); +ANS(str_cmp($ans[5],'remove_whitespace')); +ANS(num_cmp($b2+1)); +ANS(str_cmp($ans[6],'remove_whitespace')); + +################################ +BEGIN_SOLUTION + +$PAR +$BCENTER +\{begintable(2)\} +\{row("\($b1\)", "\($ans[1]\)")\} +\{row("\($b1\)", "\($ans[2]\)")\} +\{row("\($b2\)", "\($ans[3]\)")\} +\{row("\($b2\)", "\($ans[4]\)")\} +\{row("\($b2is\)", "\($ans[5]\)")\} +\{row("\($b2is\)", "\($ans[6]\)")\} +\{endtable()\} +$ECENTER +$PAR + +END_SOLUTION +################################ + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW02-01.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW02-01.pg new file mode 100644 index 0000000000..e48aae7a13 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW02-01.pg @@ -0,0 +1,141 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics', 'mean', 'median') +## naw tagged this problem. + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Characterizing a Set of Measurements: Graphical Methods') +## Date('06/01/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('Which of the following statements about the mean is $BITALIC not$EITALIC always correct?', + 'Half of the observations are on either side of the mean' +); +$mc[1]->extra( + 'The sum of the deviations from the mean is zero', + 'The mean is a measure of the middle (center) of a distribution', + 'The value of the mean times the number of observations equals the sum of all of the observations' +); + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('In a histogram, the proportion of the total area which must be to the left +of the median is: ', + 'exactly \(0.50\)' +); +$mc[2]->extra( + 'less than \(0.50\) if the distribution is skewed to the left', + 'more than \(0.50\) if the distribution is skewed to the right', + 'between \(0.25\) and \(0.60\) if the distribution is symmetric and unimodal' +); + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('Which of the following statements is true?', + 'The sum of the deviations from the mean is always zero' +); +$mc[3]->extra( + 'The sum of the squared deviations from the mean is always zero', + 'The mean is always less than the geometric mean', + 'The standard deviation is always less than the variance', + 'The distance between the first and third quartiles is twice the distance between + the first quartile and the median' +); + + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('If two data sets have the same range:', + 'the distances from the smallest to largest observations in both sets will be the same' +); +$mc[4]->extra( + 'the smallest and the largest observations are the same in both sets', + 'both sets will have the same mean', + 'both sets will have the same interquartile range' +); + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('Which of the following statements is true?', + 'When the distribution is symmetric and unimodal, mean \(=\) median \(=\) mode' +); +$mc[5]->extra( + 'When the distribution is skewed to the left, mean \(>\) median \(>\) mode', + 'When the distribution is skewed to the right, mean \(<\) median \(<\) mode', + 'When the distribution is symmetric and bimodal, mean \(=\) median \(=\) mode' +); + +$a = random(1,5,1); +$b = random(1,5,1); +while ($a == $b) { + $b = random(1,5,1); +} + +@solutions = ("$BITALIC If $EITALIC we have a symmetric distribution, we could assume that half of the observations are on either side of the mean. Since it depends on the distribution, this statement is not always true. The mean $BITALIC is always $EITALIC a measure of the middle (center) of a distribution, but it might not be a good one!", + +"Since the median is $BITALIC always $EITALIC the middle, no matter the distribution, the proportion of the total area to the left if the median is \(0.50\).", + +"The sum of the deviations from the mean is always zero. No matter what the set of data, if we sum up the difference between the mean and every piece of data it will always be \(0\). It is tempting to say the standard deviation is always less than the variance, but we could have the variance be \(1\) and thus the standard deviation would also be \(1\), or any variance that is less than \(1\) would have a standard deviation greater than it. We cannot say the distance between the first and third quartiles is twice the distance between the first quartile and the median since quartiles deal in percent and thus we cannot comment on the distance in the numeric sense.", + +"The distances from the smallest to largest observations in both sets will be the same. We cannot say the mean and IQR will be the same since we don't know the data. We cannot say the smallest and the largest observations are the same in both sets, since we could have, \(120-20=100\) and \(200-100=100\).", + +"When the distribution is symmetric and unimodal, mean \(=\) median \(=\) mode. Unimodal means one peak or high point, thus the same does not hold for a bimodal graph, which would have two peaks or high points. When the distribution is skewed to the left, we should actually expect mean \(<\) median and when the distribution is skewed to the right, we should expect mean \(>\) median.", + +); + +$ssols1 = (@solutions[$a-1]); +$ssols2 = (@solutions[$b-1]); + +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$a] -> correct_ans\}\). $ssols1 + +$PAR + +(b) Option \(\{$mc[$b] -> correct_ans\}\). $ssols2 + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW02-03.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW02-03.pg new file mode 100644 index 0000000000..682e2f6463 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/stat212-HW02-03.pg @@ -0,0 +1,148 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics') +## naw tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Chebyshevs Theorem') +## Date('06/01/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('Chebyshevs Theorem states that the percentage of measurements +in a data set that fall within three standard deviations of their mean is: ', + 'at least 89$PERCENT' +); +$mc[1]->extra( + '75$PERCENT', + 'at least 75$PERCENT', + '89$PERCENT' +); + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('The Empirical Rule states that the approximate percentage of +measurements in a data set (providing that the data set has a bell-shaped distribution) +that fall within two standard deviations of their mean is approximately:', + '\(95$PERCENT\)' +); +$mc[2]->extra( + '\(68$PERCENT\)', + '\(75$PERCENT\)', + '\(99$PERCENT\)' +); + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('Which of the following summary measures is affected most by outliers?', + 'The range' +); +$mc[3]->extra( + 'The median', + 'The geometric mean', + 'The interquartile range' +); + +$mc[3]->makeLast( + 'All of the above' +); + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('Since the population is always larger than the sample, the population mean:', + 'can be smaller than, larger than, or equal to the sample mean' +); +$mc[4]->extra( + 'is always larger than the sample mean', + 'is always larger than or equal to the sample mean', + 'is always smaller than the sample mean', + 'is always smaller than or equal to the sample mean' +); + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('Which of the following summary measures cannot be easily +approximated from a box-and-whisker plot?', + 'The standard deviation' +); +$mc[5]->extra( + 'The range', + 'The interquartile range', + 'The second quartile' +); + +$mc[5]->makeLast( + 'All of the above' +); + +$a = random(2,5,1);#rule out Chebyshev question +$b = random(2,5,1); +while ($a == $b) { + $b = random(2,5,1); +} + +@solutions = ("The Empirical Rule states that the \(95$PERCENT\) of observations in a data set (providing that the data set has a bell-shaped distribution) fall within two standard deviations of the mean.", + +"While the mean is naturally the most affected by outliers, the range is also affected greatly by outliers. The range is the differenence between the maximum and minimum. An outlier will greatly increase that difference.", + +"We know our population means is a ''fixed value'' single value. As such, it could be anything, and therefore when we take a sample, we could have the population mean be smaller than, larger than, or equal to the sample mean. We include the ''equal to'' in case of the scenario where the sample $BITAL is $EITAL the population.", + +"A box and whisker plot does not help us estimate the standard deviation since it shows our data in quartiles. Outlier may greatly affect the standard deviation and although we can see skew in a box and whisker plot it does not help us estiamte the standard deviation.", +); + +$ssols1 = (@solutions[$a-2]); +$ssols2 = (@solutions[$b-2]); + +##################################### +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +###################################### +BEGIN_SOLUTION + +(a) Option \(\{$mc[$a] -> correct_ans\}\). $ssols1 + +$PAR + +(b) Option \(\{$mc[$b] -> correct_ans\}\). $ssols2 + +END_SOLUTION +####################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/DisplayingData/ur_stt_1_5.pg b/OpenProblemLibrary/PCC/Statistics/DisplayingData/ur_stt_1_5.pg new file mode 100644 index 0000000000..7f1754b4c9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/DisplayingData/ur_stt_1_5.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## Frequency and Relative Frequency +## ENDDESCRIPTION + +## KEYWORDS('Frequency, 'Relative') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(1,10,1); +$b = random(1,20,1); +$c = random(1,20,1); +$d = random(10,15,1); +$e = random(10,15,1); +$f = random(1,10,1); +$total = $a+$b+$c+$d+$e+$f; + +Context("Percent"); +$ans1= Percent($a/$total); +$ans2= Percent($b/$total); +$ans3= Percent($c/$total); +$ans4= Percent($d/$total); +$ans5= Percent($e/$total); +$ans6= Percent($f/$total); + +BEGIN_TEXT + +Complete the table below. +\{begintable(3)\} +\{row("Books read within the past year", "Frequency", "Relative Frequency")\} +\{row("none", "\($a \)", ans_rule(10))\} +\{row("\(0-4\)", "\($b \)", ans_rule(10))\} +\{row("\(5-9\)", "\($c \)", ans_rule(10))\} +\{row("\(10-14\)", ans_rule(10), "\($ans4\)")\} +\{row("\(15-19\)", "\($e \)", ans_rule(10))\} +\{row("\(20-25\)", "\($f \)", ans_rule(10))\} +\{row("total", "\($total\)", "\(1\)")\} +\{endtable()\} + +END_TEXT +ANS(Compute($ans1)->cmp); +ANS(Compute($ans2)->cmp); +ANS(Compute($ans3)->cmp); +ANS(Compute($d)->cmp); +ANS(Compute($ans5)->cmp); +ANS(Compute($ans6)->cmp); + +################################ +BEGIN_SOLUTION + +$PAR +$BCENTER +\{begintable(3)\} +\{row("Books read within the past year", "Frequency", "Relative Frequency")\} +\{row("none", "\($a \)", "\($ans1 \)")\} +\{row("\(0-4\)", "\($b \)", "\($ans2 \)")\} +\{row("\(5-9\)", "\($c \)", "\($ans3 \)")\} +\{row("\(10-14\)", "\($d \)", "\($ans4\)")\} +\{row("\(15-19\)", "\($e \)", "\($ans5 \)")\} +\{row("\(20-25\)", "\($f \)", "\($ans6 \)")\} +\{row("total", "\($total\)", "\(1\)")\} +\{endtable()\} +$ECENTER +$PAR + +END_SOLUTION +################################ + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ExpectedValue.pg b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ExpectedValue.pg new file mode 100644 index 0000000000..95f1276964 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ExpectedValue.pg @@ -0,0 +1,64 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Expected Value') +## KEYWORDS('probability', 'Expected Value') +## Author('C. Tyler Diggans') +## Institution('NAU') +##ENDDESCRIPTION + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"contextCurrency.pl", +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); + +$a=Currency(random(45000,65000,5000)); +$b=Currency(random(8000,15000,1000)); +$c=Currency(random(20,50,5)); +$d=random(8000,12000,200); +$e=random(2,6,1); +$prob0 = ($d-1-$e); + +@gprize=('Mercedes Benz E350','BMW M3','Lexus GS'); +@sprize=('Ducati','Kawasaki','Honda'); +$prize1=list_random(@gprize); +$prize2=list_random(@sprize); + +$ans= ($a-$c)*(1/$d)+($b-$c)*($e/$d)-$c*($d-1-$e)/$d; +$ans = Currency(Round($ans->value,2)); + +BEGIN_TEXT +A charity holds a raffle in which each ticket is sold for \($c\). A total of \($d\) tickets are sold. They raffle one grand prize which is a $prize1 valued at \($a\) along with \($e\) second prizes of $prize2 motorcycles valued at \($b\) each. What are the expected winnings for a single ticket buyer? \{ans_rule(20)\} + +END_TEXT +ANS($ans->cmp); + +BEGIN_SOLUTION +Using the above situation, we can create a probability model as seen below, +$PAR +$BCENTER +\{begintable(4)\} +\{row("Outcome", "Nothing", "$prize2", "$prize1")\} +\{row("\(X\)", "-$c", "$b", "$a")\} +\{row("\(P(X)\)", "\(\frac{$prob0}{$d}\)", "\(\frac{$e}{$d}\)", "\(\frac{1}{$d}\)")\} +\{endtable()\} +$ECENTER +$PAR +Using this table we can find \(\text{E}(X)=\mu = (-$c \cdot \frac{$prob0}{$d}) + ($b \cdot \frac{1}{$d}) + ($a \cdot \frac{$e}{$d}) = $ans\). +END_SOLUTION +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/expectedvalue1.pg b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/expectedvalue1.pg new file mode 100644 index 0000000000..c4032f2581 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/expectedvalue1.pg @@ -0,0 +1,62 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Expected Value') +## KEYWORDS('probability') +## Author('') +## Institution('NAU') +##ENDDESCRIPTION + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); + +$a=Currency(random(5000,15000,500)); +$b=Currency(random(500,1500,100)); +$c=Currency(random(2,5,1)); +$d=random(8000,12000,200); +$prob0 = ($d-2); + +@gprize=('a Caribbean cruise','An Alaskan cruise','a European cruise'); +@sprize=('Las Vegas getaway','Rocky Point vacation','Weekend in San Diego'); +$prize1=list_random(@gprize); +$prize2=list_random(@sprize); + +$ans=($a-$c)*(1/$d)+($b-$c)*(1/$d)-$c*($d-2)/$d; +BEGIN_TEXT +A raffle has a grand prize of $prize1 valued at \($a\) with a second prize of a $prize2 valued at \($b\). If each ticket costs \($c\) and \($d\) tickets are sold, what are the expected winnings far a ticket buyer? Round to the nearest penny. \{ans_rule(20)\} + + +END_TEXT + +BEGIN_SOLUTION +Using the above situation, we can create a probability model as seen below, +$PAR +$BCENTER +\{begintable(4)\} +\{row("Outcome", "Nothing", "$prize2", "$prize1")\} +\{row("\(X\)", "-$c", "$b", "$a")\} +\{row("\(P(X)\)", "\(\frac{$prob0}{$d}\)", "\(\frac{1}{$d}\)", "\(\frac{1}{$d}\)")\} +\{endtable()\} +$ECENTER +$PAR +Using this table we can find \(\text{E}(X)=\mu = (-$c \cdot \frac{$prob0}{$d}) + ($b \cdot \frac{1}{$d}) + ($a \cdot \frac{1}{$d}) = $ans\). +END_SOLUTION + +ANS($ans->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/exval3.pg b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/exval3.pg new file mode 100644 index 0000000000..c3a9537a2b --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/exval3.pg @@ -0,0 +1,84 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Expected Value') +## KEYWORDS('probability') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/27/05 +# from pl/setProbability17Expectation/p1.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); + +$a = Currency(random(30,50,5)/100); +$b = Currency(random(55,70,5)/100); +$c = Currency(random(75,95,5)/100); +$z = Currency(0); + +@s = ("spade","diamond","heart","club"); +@ss = ("spades","diamonds","hearts","clubs"); +@f = ("ace","jack","queen","king"); +@art = ("an","a","a","a"); + +$ind1 = random(0,3,1); +$res = $s[$ind1]; +$ress = $ss[$ind1]; +$ind2 = random(0,3,1); +$ref = $f[$ind2]; +$reart = $art[$ind2]; + +BEGIN_TEXT +Mark draws one card from a standard deck of \(52\). He receives \($a\) for a $res and +\($b\) for $reart $ref, but \($c\) for the $ref of $ress. How much could he pay to play this game per draw if he expects to break even in the long run? \{ans_rule(30)\} + +END_TEXT + +$ans = $a*(12/52)+$b*(3/52)+$c/52; + + +ANS(Currency($ans)->cmp); + +BEGIN_SOLUTION +Using the above situation, we can create a probability model as seen below, +$PAR +$BCENTER +\{begintable(5)\} +\{row("Outcome", "Nothing", "$res", "$reart $ref" , "$ref of $ress")\} +\{row("\(X\)", "$z", "$a", "$b" , "$c")\} +\{row("\(P(X)\)", "\(\frac{36}{52}\)", "\(\frac{12}{52}\)" , "\(\frac{3}{52}\)", "\(\frac{1}{52}\)")\} +\{endtable()\} +$ECENTER +$PAR +Note there are \(13\) $ref\(\)s in a deck, where you win \($a\), but if you pick the $ref of $ress, you win \($c\), thus there are only \(12\) ways to win \($a\). Similarly, there are \(4\) $reart $ref\(\)s, but if you pick the $ref of $ress, you win \($c\) thus there are only \(3\) ways to win \($b\). +$PAR +Since we want to break even in the long run, whatever the expected value is of winning, we should be willing to pay that much to break even in the long run. Thus we can find, +$PAR +\(\text{E}(X)=\mu = ($z \cdot \frac{36}{52}) + ($a \cdot \frac{12}{52}) + ($b \cdot \frac{3}{52}) + ($c \cdot \frac{1}{52})=$ans\). Thus we should be willing to spend \($ans\). +END_SOLUTION +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-05.pg b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-05.pg new file mode 100644 index 0000000000..decf92d691 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-05.pg @@ -0,0 +1,97 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'mean', 'variance', 'standard deviation') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('6/15/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a1 = random(.55,.60,.001); +$a2 = random(.10,.15,.001); +$a3 = random(.2,.225,.001); +$a4 = 0.001*floor(1000*(1-($a1+$a2+$a3))+.5); + +$b1 = random(-5,0,1); +$b2 = random(2,7,1); +$b3 = random(8,12,1); +$b4 = $b3; +while ($b4 == $b3) { + $b4 = random(8,12,1); +} +$c4 = (($b1*$a1)+($b2*$a2)+($b3*$a3)+($b4*$a4)); +$c5 = Real(((($b1-$c4)**2)*$a1)+((($b2-$c4)**2)*$a2)+((($b3-$c4)**2)*$a3)+((($b4-$c4)**2)*$a4)); +$c6 = Real($c5)**(0.5); + +BEGIN_TEXT +$PAR +Find the mean, variance and standard deviation for the probability distribution given below: + +$PAR +$BCENTER +\{begintable(5)\} +\{row("\(X\)", "\($b1\)", "\($b2\)", "\($b3\)", "\($b4\)")\} +\{row("\(P(X)\)", "\($a1\)", "\($a2\)", "\($a3\)", "\($a4\)")\} +\{endtable()\} +$ECENTER +$PAR +A. Mean = \{ans_rule(15)\} +$PAR +B. Variance = \{ans_rule(15)\} +$PAR +C. Standard Deviation = \{ans_rule(15)\} +$PAR + + + + +END_TEXT + + +ANS(Compute($c4)->cmp); +ANS(Compute($c5)->cmp); +ANS(Compute($c6)->cmp); + +BEGIN_SOLUTION +For a smaller model like this, we can find all values in question by hand. +$PAR +(a) \(\text{E}(X)=\mu = ($b1 \cdot $a1 ) +($b2 \cdot $a2 ) + ($b3 \cdot $a3 ) + ($b4 \cdot $a4 ) = $c4\) +$PAR +(b) If desired, we can find the variance by hand, +$PAR +\(\text{VAR}(X) = $a1($b1-$c4)^2 + $a2($b2-$c4)^2 + $a3($b3-$c4)^2 + $a4($b4-$c4)^2 \approx $c5\) +$PAR +(c) Since standard deviation is the square root of the variance, +$PAR +\(\sigma_{x} = \sqrt{$c5} \approx $c6\) +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-06.pg b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-06.pg new file mode 100644 index 0000000000..37f1e78003 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-06.pg @@ -0,0 +1,111 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'mean', 'standard deviation') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('6/15/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); +Context("Currency"); + +$a1 = random(.20,.24,.001); +$a2 = random(.10,.15,.001); +$a3 = random(.10,.13,.001); +$a4 = random(.075,.10,.001); +$a5 = random(.05,.07,.001); +$a6 = random(.02,.04,.001); +$a7 = random(.02,.04,.001); +$a8 = 0.001*floor(1000*(1-($a1+$a2+$a3+$a4+$a5+$a6+$a7))+.5); + +$c4 = Real((1*$a1)+(2*$a2)+(3*$a3)+(4*$a4)+(5*$a5)+(6*$a6)+(7*$a7)+(8*$a8)); +$c5 = ((((1-$c4)**2)*$a1)+(((2-$c4)**2)*$a2)+(((3-$c4)**2)*$a3)+(((4-$c4)**2)*$a4)+(((5-$c4)**2)*$a5)+(((6-$c4)**2)*$a6)+(((7-$c4)**2)*$a7)+(((8-$c4)**2)*$a8)); +$c6 = ($c5)**(0.5); +$c7 = random(2.00,5.00,.25); +$c8 = $c7**(2); + +$new = Currency($c7*$c4); +$new2 = Currency($c7*$c6); +BEGIN_TEXT +$PAR +When parking a car in a downtown parking lot, drivers +pay according to the number of hours or fraction thereof. +The probability distribution of the number of hours cars +are parked has been estimated as follows: + +$PAR +$BCENTER +\{begintable(9)\} +\{row("\(X\)", "\(1\)", "\(2\)", "\(3\)", "\(4\)", "\(5\)", "\(6\)", "\(7\)", "\(8\)")\} +\{row("\(P(X)\)", "\($a1\)", "\($a2\)", "\($a3\)", "\($a4\)", "\($a5\)", "\($a6\)", "\($a7\)", "\($a8\)")\} +\{endtable()\} +$ECENTER +$PAR +A. Mean = \{ans_rule(15)\} +$PAR +B. Standard Deviation = \{ans_rule(15)\} +$PAR +The cost of parking is \($c7\) dollars per hour. Calculate the mean and standard deviation of the amount of revenue each car generates. +$PAR +A. Mean = \{ans_rule(15)\} +$PAR +B. Standard Deviation = \{ans_rule(15)\} +$PAR + + + +END_TEXT + + +ANS(Compute($c4)->cmp); +ANS(Compute($c6)->cmp); + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); +ANS(Currency($c7*$c4)->cmp); +ANS(Currency(($c8*$c5)**(0.5))->cmp); + +BEGIN_SOLUTION +For a larger model like this, it makes more sense to do find the values in questions with technology. Both a calculator or MS Excel will suffice to find that, +$PAR +(a) \(\mu = $c4\) +$PAR +Still by hand, it can be found, \(\mu = (1*$a1)+(2*$a2)+(3*$a3)+(4*$a4)+(5*$a5)+(6*$a6)+(7*$a7)+(8*$a8)= $c4\) +$PAR +(b) Using technology we will find the standard deviation to be, \(\sigma_{x} \approx $c6\) +$PAR +(c) Note: Answers to parts (c) and (d) should be in $DOLLAR\(\)'s, rounded to the nearest penny. As the cost of parking is \($c7\) dollars per hour, we could now think of our model \(X\) above, as \($c7 X\). This means to find the average cost we have, \(\text{E}($c7 X)=$c7 \cdot \text{E}(X) = $c7 \cdot $c4 = $new\) +$PAR +(d) For standard deviation, we also find it is increased by a multiple of \($c7\). Therefore our new standard deviation is \(\sigma_{x} = $c7 \cdot $c6 = $new2\) +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-08.pg b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-08.pg new file mode 100644 index 0000000000..052582560d --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-08.pg @@ -0,0 +1,87 @@ +## DESCRIPTION +## Expected Value +## ENDDESCRIPTION + +## KEYWORDS('probability', 'expected value') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Expected Value') +## Date('6/15/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); +Context("Currency"); + +$a1 = random(1,3,1); +$a2 = random(4,6,1); +$a3 = random(10,15,1); +$b1 = 0.01*$a1; +$b2 = 0.01*$a2; +$b3 = 0.01*$a3; +$c1 = random(300,600,50); +$c2 = random(100,300,50); +$c3 = random(50,200,25); + +$left = (1-$b1-$b2-$b3); +$ans = Currency($b1*$c1)+($b2*$c2)+($b3*$c3); + +BEGIN_TEXT +$PAR +The owner of a small firm has just purchased a personal computer, which she expects will serve her for the next two years. The owner has been +told that she "must" buy a surge suppressor to provide protection for her new hardware against possible surges or variations in the electrical current, which have the capacity to damage the computer. The amount of damage to the computer +depends on the strength of the surge. It has been estimated that there is a \($a1$PERCENT\) chance of incurring \($c1\) dollar damage, \($a2$PERCENT\) chance of incurring \($c2\) dollar damage, and \($a3$PERCENT\) chance of \($c3\) dollar damage. An inexpensive suppressor, which would provide protection for only one surge, can be purchased. How much should the owner be willing to pay if she makes decisions on the basis of expected value? +$PAR +The expected cost due to surge damage is \{ans_rule(15)\}. +$PAR + + + + +END_TEXT + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); +ANS(Currency(($b1*$c1)+($b2*$c2)+($b3*$c3))->cmp); + +BEGIN_SOLUTION +We will need a model if we are to find the expected cost due to surge damage. Don't forget to include the probability that there is $BBOLD NO $EBOLD damage. +$PAR +$BCENTER +\{begintable(5)\} +\{row("\(X\)", "\($c1\)", "\($c2\)", "\($c3\)", "\(0\)")\} +\{row("\(P(X)\)", "\($b1\)", "\($b2\)", "\($b3\)", "\($left\)")\} +\{endtable()\} +$ECENTER +$PAR +Our answer should be in $DOLLAR\(\)'s. Using technology we find, +$PAR +\(\text{E}(X)=\mu = (0*$left)+($b1*$c1)+($b2*$c2)+($b3*$c3) \approx $ans\) +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-12.pg b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-12.pg new file mode 100644 index 0000000000..468adc4df4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/stat212-HW05-12.pg @@ -0,0 +1,80 @@ +## DESCRIPTION +## Statistics: Probability +## ENDDESCRIPTION + +## CMMK tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Probability') +## Date('6/27/2005') +## Institution('UVA') +## Author('Cristina Murray-Krezan') +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('') +## Problem1('') +## KEYWORDS('statistics', 'probability', 'bivariate random variable') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$exp1 = random(16,18,1); +$var1 = random(6,8,1); +$exp2 = random(10,12,1); +$var2 = random(3,5,1); +$exp3 = random(24,27,1); +$var3 = random(4,6,1); +$exp4 = random(5,8,1); +$var4 = random(1,2,1); + +$etot = ($exp1+$exp2+$exp3+$exp4); +$vartot = ($var1+$var2+$var3+$var4); + +BEGIN_TEXT +There are four stages along the critical path for a construction project. The expected values and variances of the completion times of the stages are listed below. Determine the expected value and variance of the completion time of the project. +$PAR +$BCENTER +\[ +\begin{array}{c|c|c} +\mbox{Activity} & \mbox{Expected Completion Time (Days)} & \mbox{Variance} \\ \hline\hline +1 & $exp1 & $var1 \\ \hline +2 & $exp2 & $var2 \\ \hline +3 & $exp3 & $var3 \\ \hline +4 & $exp4 & $var4 \\ \hline +\end{array} +\] +$ECENTER +$PAR + +$PAR + Expected value of completion time of project = \{ans_rule(15)\} days +$PAR + Variance of completion time of project = \{ans_rule(15)\} days\(^2\) +END_TEXT + +BEGIN_SOLUTION +(a) Expected values, or averages, for random variables can be added. Meaning, \(\text{E}(X_{1}+X_{2}) = \text{E}(X_{1}) + \text{E}(X{2})\). Therefore, we can simply add all the expected times and find the total expected time to be \($exp1+$exp2+$exp3+$exp4 = $etot\). +$PAR +(b) Assuming our random variables are independent, we can also add variances. That is, \(\text{VAR}(X_{1}+X_{2}) = \text{VAR}(X_{1}) + \text{VAR}(X{2})\). Therefore, we can simply add the variances to find the total variance to be \($var1+$var2+$var3+$var4 = $vartot\). +END_SOLUTION + +ANS(num_cmp($exp1+$exp2+$exp3+$exp4)); #expected value +ANS(num_cmp($var1+$var2+$var3+$var4)); #variance + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_5.pg b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_5.pg new file mode 100644 index 0000000000..409cc2c100 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_5.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## Expected Value +## ENDDESCRIPTION + +## KEYWORDS('Random Variable') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(3000,6000,1000); +$a2 = random(15000,30000,5000); +$a3 = random(15000,30000,5000); +while($a2==$a3) {$a3 = random(15000,30000,5000);} +$a4 = random(40000,60000,5000); + +$p1 = random(.1,.3,.1); +$p2 = random(.1,.3,.1); +$p3 = random(.1,.3,.1); +$p4 = int(100*(1-$p1-$p2-$p3)+.5)/100; + + +$a = random(10,30,5); +$b = random(150000,300000, 50000); +$c = random(40000,60000,5000); + +$ex = $p1*$a1+$p2*$a2+$p3*$a3+$p4*$a4; +$profit = ($ex*$a)-$b-$c; +$profitbef = ($ex*$a); + +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); + +$a = Currency("$a"); +$b = Currency("$b"); +$c = Currency("$c"); +$profitbef = Currency("$profitbef"); +$profit = Currency("$profit"); + +BEGIN_TEXT +A concert producer has scheduled an outdoor concert. The producer estimates the attendance will depend on the weather according to the following table. +$PAR +$BCENTER +\{begintable(3)\} +\{row("Weather", "Attendance", "Probability")\} +\{row("wet, cold", "\($a1\)", "\($p1\)")\} +\{row("wet, warm", "\($a2\)", "\($p2\)")\} +\{row("dry, cold", "\($a3\)", "\($p3\)")\} +\{row("dry, warm", "\($a4\)", "\($p4\)")\} +\{endtable()\} +$ECENTER +$PAR +$PAR +(a) What is the expected attendance? \{ans_rule(10)\} $PAR +(b) If tickets cost \($a\) each, the band will cost \($b\), plus \($c\) for administration. What is the expected profit? \{ans_rule(10)\} + +END_TEXT + +ANS(Compute($ex)->cmp); +ANS(Currency($profit)->cmp); + +BEGIN_SOLUTION +(a) As we already have our probability model, we can proceed to finding the expected value immediately, +$PAR +\(\text{E}(X)=\mu = ($p1\cdot$a1)+($p2\cdot$a2)+($p3\cdot$a3)+($p4\cdot$a4) = $ex\) +$PAR +(b) Our solution in part (a) was the expected attendance. If each ticket costs \($a\), then the expected profit with $BBOLD no other $EBOLD expenses would be \($profitbef\). However, is since the band will cost \($b\), plus \($c\) for administration, the total profit will be \($profitbef-$b-$c=$profit\) +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_6.pg b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_6.pg new file mode 100644 index 0000000000..093fcf2ebb --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_6.pg @@ -0,0 +1,116 @@ +## DESCRIPTION +## Expected Value +## ENDDESCRIPTION + +## KEYWORDS('Random Variable') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextCurrency.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +Context("Currency"); + +$p1 = random(10,25,5); +$c1 = random(200,400,100); +$p2 = random(150,550,100); +$c2 = random(100,200,50); +$p3 = random(25,75,25); +$c3 = random(10,90,10); +$p4 = random(5,20,5); +$c4 = random(1,5,1); +$p5 = random(200,900,100); +$c5 = random(100,900,100); +$p6 = random(45,95,5); +$c6 = random(3,9,1); + +$missingp = Real(1-(1/($c1*1000000))-(1/($c2*1000000))-(1/($c3*1000000))-(1/($c4*1000000)) -(1/($c5*1000))-(1/($c6*1000))); + +$cost_of_stamp = random(30,50,1); +$costC = Currency($cost_of_stamp/100); + +$ans1 = Currency($p1/$c1 + $p2/$c2/1000 + $p3/$c3/1000 + $p4/$c4/1000 + $p5/$c5/1000 + $p6/$c6/1000); +$ans2 = Currency($ans1 - $cost_of_stamp/100); + + +BEGIN_TEXT + +Prizes and the chances of winning in a lottery are given in the table below. +$PAR +$BCENTER +\{begintable(2)\} +\{row('Prize', 'Chances')\} +\{row( '$DOLLAR$p1,000,000 ', '1 chance in $c1,000,000 ' ) \} +\{row( '$DOLLAR$p2,000 ', '1 chance in $c2,000,000 ' ) \} +\{row( '$DOLLAR$p3,000 ', '1 chance in $c3,000,000 ' ) \} +\{row( '$DOLLAR$p4,000 ', '1 chance in $c4,000,000 ' ) \} +\{row( '$DOLLAR$p5 ', '1 chance in $c5,000 ' ) \} +\{row( 'A watch valued at $DOLLAR$p6 ', '1 chance in $c6,000 ' ) \} +\{endtable()\} +$ECENTER +$PAR +(a) \( \) Find the expected value of the amount won by one entry. $BR +\{ans_rule\} $PAR +(b) \( \) Find the expected value if the cost of playing this lottery is \($cost_of_stamp\) cents for postage. $BR +\{ans_rule\} $BR + +END_TEXT +Context("Currency"); +Context()->flags->set(trimTrailingZeros=>1); +Context()->currency->addSymbol("dollars","dollar"); +ANS(Currency($ans1)->cmp); +ANS(Currency($ans2)->cmp); + +BEGIN_SOLUTION +Note that both answers should be in $DOLLAR\(\)'s, rounded to the nearest penny. +$PAR +(a) The given probability model does not include the chances that you win nothing. To find this we will need to subtract all chances in our probability model from 1. +$PAR +Therefore, \(\text{P}(\text{nothing})= 1 - \frac{1}{$c1,000,000} - \frac{1}{$c2,000,000} -\frac{1}{$c3,000,000} -\frac{1}{$c4,000,000} -\frac{1}{$c5,000} -\frac{1}{$c6,000} = $missingp\) +$PAR +From here, we can complete our probability model. +$PAR + +$BCENTER +\{begintable(2)\} +\{row("Prize", "Chances")\} +\{row( "$DOLLAR$p1,000,000 ", "\(\frac{1}{$c1,000,000}\)" ) \} +\{row( "$DOLLAR$p2,000 ", "\(\frac{1}{$c2,000,000}\)" ) \} +\{row( "$DOLLAR$p3,000 ", "\(\frac{1}{$c3,000,000}\)" ) \} +\{row( "$DOLLAR$p4,000 ", "\(\frac{1}{$c4,000,000}\)" ) \} +\{row( "$DOLLAR$p5 ", "\(\frac{1}{$c5,000}\)" ) \} +\{row( "$DOLLAR$p6 ", "\(\frac{1}{$c6,000}\)" ) \} +\{row( "$DOLLAR 0 ", "$missingp" ) \} +\{endtable()\} +$ECENTER +$PAR +Using technology, we find the expected value to be \(\text{E}(X)=\mu=$ans1\) +$PAR +(b) Since each stamp is \($costC\) cents, we would have to subtract this from our expected value since we would have to pay it each time. Thus the new expected value is \($ans1-$costC=$ans2\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_9a.pg b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_9a.pg new file mode 100644 index 0000000000..6422a66817 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExpectedValueAndVariance/ur_pb_7_9a.pg @@ -0,0 +1,112 @@ +## DESCRIPTION +## Expected Value and Variance +## ENDDESCRIPTION + +## KEYWORDS('Random Variable', 'Expected Value', 'Variance') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(30,40,1); +$b = random(41,50,1); +$c = random(25,35,1); +while($c == $a) { $c = random(25,35,1); } +$d = random(36,50,1); +while(($d == $a) or ($d == $b)) { $d = random(36,50,1); } + +$total = $a + $b + $c + $d; + +$ex = Real(($a**2 + $b**2 + $c**2 + $d**2)/$total); + +$ey = Real($total/4); + +$vx = ($a*($a - $ex)**2 + $b*($b - $ex)**2 + $c*($c - $ex)**2 + $d*($d - $ex)**2 )/$total; + +$varx = Real(($vx)**(1/2)); + +$vy = (($a - $ey)**2 + ($b - $ey)**2 + ($c - $ey)**2 + ($d - $ey)**2)/4; + +$vary = Real(($vy)**(1/2)); + +BEGIN_TEXT + +Four buses carrying \($total\) high school students arrive to Montreal. The buses carry, respectively, \($a\), \($b\), \($c\), and \($d\) students. One of the \($total\) students is randomly selected. Let \(X\) denote the number of students that were on the bus carrying this randomly selected student. One of the four bus drivers is also randomly selected. Let \(Y\) denote the number of students on his bus. Compute the expectations and variances of \(X\) and \(Y\): +$PAR +$PAR + +\(\operatorname{E}(X)=\)\{ans_rule(30)\} $BR + +\(\operatorname{Var}(X)=\)\{ans_rule(30)\} $PAR +$PAR + +\(\operatorname{E}(Y)=\)\{ans_rule(30)\} $BR + +\(\operatorname{Var}(Y)=\)\{ans_rule(30)\} + +END_TEXT + +ANS(Compute($ex)->cmp); +ANS(Compute($vx)->cmp); +ANS(Compute($ey)->cmp); +ANS(Compute($vy)->cmp); + +BEGIN_SOLUTION +First we need a probability model, \(X\), for the number of students that were on the bus carrying this randomly selected student. +$PAR +$BCENTER +\{begintable(2)\} +\{row("\(X\)", "\($a\)", "\($b\)", "\($c\)", "\($d\)")\} +\{row("\(\text{P}(X)\)", "\(\frac{$a}{$total}\)", "\(\frac{$b}{$total}\)", "\(\frac{$c}{$total}\)", "\(\frac{$d}{$total}\)")\} +\{endtable()\} +$ECENTER +(a) Now with technology we can compute the expected value, or, +$PAR +\(\text{E}(X)=\mu = ($a \cdot \frac{$a}{$total})+ ($b \cdot \frac{$b}{$total}) +($c \cdot \frac{$c}{$total}) + ($d \cdot \frac{$d}{$total}) \approx $ex\) +$PAR +(b) Using technology we find \(\sigma_{x}\approx $varx\), thus, \(\text{VAR}(X) \approx ($varx)^2 \approx $vx\) +$PAR +Again, we need a probability model, \(Y\), for the number of students that were on the bus carrying this randomly selected driver. This is made easier since there are only \(4\) drivers, one on each bus, and thus each driver has the same chance of being selected. +$PAR +$BCENTER +\{begintable(2)\} +\{row("\(Y\)", "\($a\)", "\($b\)", "\($c\)", "\($d\)")\} +\{row("\(\text{P}(Y)\)", "\(\frac{1}{4}\)", "\(\frac{1}{4}\)", "\(\frac{1}{4}\)", "\(\frac{1}{4}\)")\} +\{endtable()\} +$ECENTER +$PAR +(c) Now with technology we can compute the expected value, or, +$PAR +\(\text{E}(Y)=\mu = ($a \cdot \frac{1}{4})+ ($b \cdot \frac{1}{4}) +($c \cdot \frac{1}{4}) + ($d \cdot \frac{1}{4}) \approx $ey\) +$PAR +(d) Using technology we find \(\sigma_{x}\approx $vary\), thus, \(\text{VAR}(Y) \approx ($vary)^2 \approx $vy\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_01_Experiments.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_01_Experiments.pg new file mode 100644 index 0000000000..17f84f6e57 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_01_Experiments.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_01_Experiments.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_01_Experiments.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_02_Experiments.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_02_Experiments.pg new file mode 100644 index 0000000000..5c604cdb78 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_02_Experiments.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_02_Experiments.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_02_Experiments.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_03_Experiments.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_03_Experiments.pg new file mode 100644 index 0000000000..174f52cb64 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_03_Experiments.pg @@ -0,0 +1,92 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 9: Producing Data: Experiments') +## KEYWORDS('statistic', 'producing data', 'experiments') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 9: Producing Data: Experiments') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The factor in this study is ","which medication the volunteers receive. "); + $mc[0]->extra("the extent to which the depression was reduced. ", + "the use of randomization and the fact that this was a comparative study. ", + "the use of a psychiatrist to evaluate the severity of depression. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The study would be double blind if ","neither the volunteers nor the psychiatrist knew which + treatment any person had received. "); + $mc[1]->extra("neither drug had any identifying marks on it. ", + "all volunteers were not allowed to see the psychiatrist nor the psychiatrist allowed to see the volunteers + during the session in which the psychiatrist evaluated the severity of the depression. "); + $mc[1]->makeLast("All of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Suppose the volunteers were first divided into men and women, and then half of the men + were randomly assigned to the new drug and half of the women were assigned to the + new drug. The remaining volunteers received the other drug. This would be an example of ","a block design. "); + $mc[2]->extra("a matched pairs design. ", + "confounding. The effects of gender will be mixed up with the effects of the drugs. ", + "replication. "); + +################################################# +# Main + +BEGIN_TEXT +One hundred volunteers who suffer from severe depression are available for a study. Fifty are selected at random +and are given a new drug that is thought to be particularly effective in treating severe depression. The other fifty +are given an existing drug for treating severe depression. A psychiatrist evaluates the symptoms of all volunteers +after four weeks in order to determine if there has been substantial improvement in the severity of the depression. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_04_Experiments.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_04_Experiments.pg new file mode 100644 index 0000000000..4a1039901e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_04_Experiments.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_04_Experiments.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_04_Experiments.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_05_Experiments.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_05_Experiments.pg new file mode 100644 index 0000000000..830e54c63d --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_05_Experiments.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_05_Experiments.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_05_Experiments.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_06_Experiments.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_06_Experiments.pg new file mode 100644 index 0000000000..b1868926d1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_06_Experiments.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_06_Experiments.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch09Experiments/09Stats_06_Experiments.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_07_Experiments.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_07_Experiments.pg new file mode 100644 index 0000000000..adc07490b3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_07_Experiments.pg @@ -0,0 +1,56 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 9: Producing Data: Experiments') +## KEYWORDS('statistic', 'producing data', 'experiments') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 9: Producing Data: Experiments') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@numbers=("five", "four", "three"); +$choose = random(0,1,1); +$customers = random(35,50,5); +$high = random(4,8,1); + +################################################# +# Main + +BEGIN_TEXT +A marketing experiment compares $numbers[$choose] different types of packaging for +blank computer CDs. Each type of packaging can be presented in $numbers[$choose + 1] +different colors. Each combination of package type with a particular +color is shown to $customers potential customers, who rate the overall attractiveness +on a scale of 1 to $high. How many treatments are there? +$BR + \{ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +if ($choose == 1) { + $answer = 12; + } else { $answer = 20; + } + +ANS(Real($answer)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_08_Experiments.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_08_Experiments.pg new file mode 100644 index 0000000000..0a00b9e7f8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_08_Experiments.pg @@ -0,0 +1,78 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 9: Producing Data: Experiments') +## KEYWORDS('statistic', 'producing data', 'experiments') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 9: Producing Data: Experiments') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1); #Order the problems +@scramble = NchooseK(2,2); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("A study of the effects of running on personality involved 231 male +runners who each ran about 20 miles a week. The runners were given +the Cattell Sixteen Personality Factors Questionnaire, a 187-item +multiple-choice test often used by psychologists. A news report +(The New York Times, Feb. 15, 1988) stated that the researchers found +statistically significant personality differences between the runners +and the 30-year-old male population as a whole. A headline on the article +said that research has shown that running can alter one's moods. This study was ", "an observational study, but not an experiment."); + $mc[0]->extra("an experiment, but not a double-blind experiment.", + "a double-blind experiment, but not a randomized experiment.", + "a randomized, double-blind experiment."); + +$mc[1] = new_multiple_choice(); + $mc[1]->qa("Can pleasant aromas help a student learn better? Two researchers believed that the presence of a floral scent could improve a person's learning ability in certain situations. They had twenty-two people work through a pencil and paper maze six times, three times while wearing a floral-scented mask and three times while wearing an unscented mask. The three trials for each mask closely followed one another. Testers measured the length of time it took the subjects to complete each of the six trials. They reported that, on average, the subjects wearing the floral-scented mask completed the maze more quickly than those wearing the unscented mask, though the difference was not statistically significant. This study is ", "an experiment, but not a double-blind experiment."); + $mc[1]->extra("a convenience sample.", + "an observational study, but not an experiment.", + "a double-blind experiment."); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_09_Experiments.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_09_Experiments.pg new file mode 100644 index 0000000000..ce94e0717b --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/09Stats_09_Experiments.pg @@ -0,0 +1,97 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 9: Producing Data: Experiments') +## KEYWORDS('statistic', 'producing data', 'experiments') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 9: Producing Data: Experiments') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The Nurses' Health Study has interviewed a sample of more than 100,000 female registered nurses every two years since 1976. The study finds that $LQ light-to-moderate drinkers had a significantly lower risk of death$RQ than either nondrinkers or heavy drinkers. The Nursers' Health Study is ", + "an observational study. "); + $mc[0]->extra("an experiment. "); + + $mc[0]->makeLast("Can't tell without more information. "); + + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("What electrical changes occur in muscles as they get tired? Student subjects hold their arms above their shoulders until they have to drop them. Meanwhile, the electrical activity in their arm muscles is measured. This is ", + "an experiment with no control group. "); + $mc[1]->extra("an observational study. ", + "a randomized comparative experiment. "); + + $mc[1]->makeLast("None of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Can changing diet reduce high blood pressure? Vegetarian diets and low-salt diets are both promising. Men with high blood pressure are assigned at random to one of four diets: (1) normal diet with unrestricted salt; (2) vegetarian with unrestricted salt; (3) normal with restricted salt; and (4) vegetarian with restricted salt. This experiment has ", + "two factors: normal/vegetarian diet and unrestricted/restricted salt. "); + $mc[2]->extra("one factor: the choice of diet. ", + "four factors: the four diets being compared. "); + + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("A marketing class designs two videos advertising an expensive Mercedes sports car. They test the videos by asking fellow students to view both (in random order) and say which makes them more likely to buy the car. Mercedes should be reluctant to agree that the video favored in this study will sell more cars because ", + "results from students may not generalize to the older and richer customers who might buy a Mercedes. "); + $mc[3]->extra("the study used matched pairs design instead of a completely randomized design. ", + "this is an observational study, not an experiment. "); + + $mc[3]->makeLast("None of the above. "); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_1.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_1.pg new file mode 100644 index 0000000000..19b56817f0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_1.pg @@ -0,0 +1,53 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("An experiment investigated the effect of length and repetition of TV ads on students choosing to eat at Del Taco. All 60 students watched a 40-minute television program that included ads for Del Taco. Some students saw a 30-second commerical; others a 90-second commerical. The same commerical was shown either 1, 3, or 5 times during the program. After the viewing, each student was asked to rate their craving for Del Taco on a scale of 0 to 10. What are the subjects of this experiment?", "60 students"); +$mc->extra("effect of length and repetion of TV ads", "40-minute television program", "craving for Del Taco on a scale of 0 to 10", "1, 3, or 5 commercials during the 40-minute television program"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_2.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_2.pg new file mode 100644 index 0000000000..eb295daba7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_2.pg @@ -0,0 +1,53 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("For the Del Taco experiment, what are the factors?", "length and repetition of TV ads"); +$mc->extra("60 students", "40-minute television program", "craving for Del Taco on a scale of 0 to 10", "1, 3, or 5 commercials during the 40-minute television program"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_3.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_3.pg new file mode 100644 index 0000000000..96020217ed --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_3.pg @@ -0,0 +1,54 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("For the Del Taco experiment, what are the levels of the length factor?", "30-second and 90-second commericals"); +$mc->extra("60 students", "40-minute television program", "craving for Del Taco on a scale of 0 to 10", "1, 3, or 5 commercials during the 40-minute television program"); + +BEGIN_TEXT + + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_4.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_4.pg new file mode 100644 index 0000000000..94b47079f5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_4.pg @@ -0,0 +1,53 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("For the Del Taco experiment, what is the response variable?", "craving for Del Taco on a scale of 0 to 10"); +$mc->extra("60 students", "40-minute television program", "30-second and 90-second commericials", "1, 3, or 5 commercials during the 40-minute television program"); + +BEGIN_TEXT + + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_5.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_5.pg new file mode 100644 index 0000000000..ca6b63e9da --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/dueck1_5_5.pg @@ -0,0 +1,51 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$ans1 = 6; + +BEGIN_TEXT +In the Del Taco experiment, how many treatments are there?$PAR +\{ans_rule(10) \} $PAR + + +END_TEXT + +ANS(num_cmp($ans1)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/kolossa59.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/kolossa59.pg new file mode 100644 index 0000000000..79f12c14fc --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/kolossa59.pg @@ -0,0 +1,89 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('percent') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +$showPartialCorrectAnswers = 0; + +$a = random(40,50,1); +$b = random(30,39,1); + + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Identify the two populations:", "teenage girls and teenage boys"); +$mc->extra("all teenagers","teenage girls and teenage boys who use sunscreen regularly" ); +$mc->makeLast("None of the above"); + +BEGIN_TEXT +Industry Research polled teenagers on sunscreen use. The survey revealed that $a$PERCENT of teenage girls and $b$PERCENT of teenage boys regularly use sunscreen before going out in the sun. $BR $BR + + +\{ $mc->print_q \} +\{ $mc->print_a \} +$BR $BR +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +$mc = new_multiple_choice(); + +$mc->qa("Identify the specified attribute:", "uses sunscreen before going out in the sun"); +$mc->extra("being a teenager", "being a teenage girl or a teenage boy"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +$BR $BR +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +$mc = new_multiple_choice(); + +$mc->qa("Are the proportions 0.$a ($a$PERCENT) and 0.$b ($b$PERCENT) population proportions or a sample proportions?", "sample proportions"); +$mc->extra("population proportions"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/stat_inference1.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/stat_inference1.pg new file mode 100644 index 0000000000..8760696670 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/stat_inference1.pg @@ -0,0 +1,50 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Inference Samples') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/10/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGchoicemacros.pl" +); + +TEXT(&beginproblem); +$mc = new_multiple_choice(); +$meas = list_random( 'Cholesterol levels', 'Heart rates', 'Blood pressures' ); +$gend = list_random( 'adult men', 'adult women'); +$age = random( 28, 65, 1 ); +$num1 = list_random( 3, 4, 5 ); +$num2 = list_random( 'once', 'twice' ); + +$mc -> qa( "This an example of ", + " an observational study ", +); +$mc -> extra( " a case- controlled study", + " a comparative experiment", + " an uncontrolled experiment" +); + + +BEGIN_TEXT + +$meas of $age-year-old $gend who exercised $num1 or more times per week are compared to those of $age-year-old $gend who exercised no more than $num2 a week. +\{ $mc -> print_q \} +$BR + +\{ $mc -> print_a \} + + +END_TEXT + +ANS( str_cmp( $mc -> correct_ans ) ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/stat_inference4.pg b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/stat_inference4.pg new file mode 100644 index 0000000000..ec196e4d7e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ExperimentalDesign/stat_inference4.pg @@ -0,0 +1,49 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Inference Samples') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/15/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGchoicemacros.pl" +); + +TEXT(&beginproblem); +$mc = new_multiple_choice(); +$name = list_random( 'medical study', 'medical experiment', 'psychology study', 'psychology experiment'); +@list = ( 'treatment', 'control' ); +@slice = NchooseK( 2, 2 ); + +$mc -> qa( "to reduce", + " confounding ", +); +$mc -> extra( " the placebo effect", + " variability", + " bias", + " the sample size" +); + + +BEGIN_TEXT + +In a $name, a $list[$slice[0]] group is compared to a $list[$slice[1]] group + +\{ $mc -> print_q \} +$BR + +\{ $mc -> print_a \} + +END_TEXT + +ANS( str_cmp( $mc -> correct_ans ) ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_01_Regression.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_01_Regression.pg new file mode 100644 index 0000000000..cf68a9ac2a --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_01_Regression.pg @@ -0,0 +1,105 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Regression) +## Institution(The College of Idaho) +## Author(R Cruz, L Danielson, J Guild) +## MLT(InterpretLine) +## Level(2) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('5') +## Problem1('') +## KEYWORDS('statistic', 'regression') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$m1 = random(1,9,1); +$b1 = random(1,9,1); +$r1 = random(400,700,50); +$r2 = random(50,200,25); + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The points on a scatterplot lie close to the line whose equation is \(y = $m1 x - $b1 \). The slope of the line is ", + $m1); + $mc[0]->extra(-$m1, + $b1, + $m1 + $b1); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("Smokers don't live as long (on the average) as nonsmokers, and heavy smokers don't live as long as light smokers. You regress the age at death of a group of male smokers on the number of packs per day they smoked. The slope of your regression line ", + "will be less than zero. "); + $mc[1]->extra("will be greater than zero. ", + "must be between -1 and 1. "); + $mc[1]->makeLast("can't tell without seeing the data. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Fred keeps his savings in his mattress. He began with $DOLLAR$r1 from his mother and adds $DOLLAR$r2 each year. His total savings \( y \) after \( x \) years are given by the equation ", + "\( y = $r1 + $r2 x \)"); + $mc[2]->extra("\( y = $r2 + $r1 x \)", + "\( y = $r2 + x \) ", + "\( y = $r1 - $r2 x \) "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("Measurements on young children in Mumbai, India, found this least-squares line for predicting height \( y \) from armspan \( x \): +$PAR +$BCENTER +\( \hat{y} = 6.4 + 0.93 x \) +$ECENTER +$PAR +$SPACE $SPACE All measurements are in centimeters (cm). How much on the average does height increase for each additional centimeter of armspan?", + "0.93 cm "); + $mc[3]->extra("6.4 cm ", + "7.33 cm ", + "0.64 cm "); + $mc[3]->makeLast("None of the above. "); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_02_Regression.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_02_Regression.pg new file mode 100644 index 0000000000..bb93d84433 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_02_Regression.pg @@ -0,0 +1,61 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 5: Regression') +## KEYWORDS('statistic', 'regression') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 5: Regression') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +$b = random(2,3,.01); +$m = random(0,.0150,.0001); +$d = random(100,400,25); +$a = $d*$m + $b; + +################################################# +# Main + +BEGIN_TEXT +A study of king penguins looked for a relationship between how deep the penguins dive to seek food and how long they stay underwater. For all but the shallowest dives, there is a linear relationship that is different for different penguins. The study report gives a scatterplot for one penguin titled $LQ The relation of dive duration (DD) to depth (D).$RQ Dive duration DD is measured in minutes and depth D is in meters. The report then says, $LQ The regression equation for this bird is: DD = $b + $m D. + +$PAR +(a) What is the slope of the regression line?. +$BR \{ans_rule(5)\} minutes per meter. + +$PAR +(b) According to the regression line, how long does a typical dive to a depth of $d meters last? +$BR \{ans_rule(5)\} minutes. +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = Real($m); +ANS($ans_a->cmp); + +$ans_b = Real($a); +ANS($ans_b->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_03_Regression.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_03_Regression.pg new file mode 100644 index 0000000000..b458b693ba --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_03_Regression.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 5: Regression') +## KEYWORDS('statistic', 'regression') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 5: Regression') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + + +for($i=0;$i<12;$i++) { +$x[$i] = random(36,55,0.1); +$y[$i] = random(900,1600,10); +} + +for($i=0;$i<12;$i++) { +$sum_x += $x[$i]; +$sum_y += $y[$i]; +} + +$mean_x = $sum_x/12; +$mean_y = $sum_y/12; + +for ($i=0; $i<12; $i++) { +$sx_squared += ($x[$i] - $mean_x)*($x[$i] - $mean_x);} + +$sx = sqrt($sx_squared/11); + +for ($i=0; $i<12; $i++) { +$sy_squared += ($y[$i] - $mean_y)*($y[$i] - $mean_y);} + +$sy = sqrt($sy_squared/11); + +for ($i=0; $i<12; $i++) { +$sum_r += (($x[$i] - $mean_x)/$sx)*(($y[$i] - $mean_y)/$sy);} + +$r = $sum_r/11; + +$b1 = $r*($sy/$sx); +$a = $mean_y - ($b1*$mean_x); +#$b1 = .1*int(10*($b1+0.05)); +#$a = .1*int(10*($a+0.05)); +#$r = .001*int(1000*($r+0.0005)); + +###################################### +# Main text + +BEGIN_TEXT +We have data on the lean body mass and resting metabolic rate for 12 women who are subjects in a study of dieting. Lean body mass, given in kilograms, is a person's weight leaving out all fat. Metabolic rate, in calories burned per 24 hours, is the rate at which the body consumes energy. +$PAR +$BCENTER +\{begintable(13)\} +\{row('$BBOLD Mass $EBOLD $SPACE ',$x[0],$x[1],$x[2],$x[3],$x[4],$x[5],$x[6],$x[7],$x[8],$x[9],$x[10],$x[11])\} +\{row('$BBOLD Rate $EBOLD $SPACE ',$y[0],$y[1],$y[2],$y[3],$y[4],$y[5],$y[6],$y[7],$y[8],$y[9],$y[10],$y[11])\} +\{endtable()\} +$ECENTER +$BR +Find the least-squares regression line for predicting metabolic rate from body mass. +$BR + \( \hat{y} = \) \{ans_rule(40)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +Context()->flags->set( + tolerance=>0.5, + tolType=> 'absolute' + ); + +$ans_a = Formula("$a + $b1 x"); +ANS($ans_a->cmp); + +###################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_04_Regression.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_04_Regression.pg new file mode 100644 index 0000000000..47442c7ccc --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_04_Regression.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 5: Regression') +## KEYWORDS('statistic', 'regression') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 5: Regression') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@x = (random(56.1,57.8,.1), + random(43.2,47.9,.1), + random(40.3,43.8,.1), + random(43.2,48.9,.1), + random(52.1,58.7,.1)); + +@y = (random(189.4,193.3,.1), + random(150.5,155.7,.1), + random(143.1,149.8,.1), + random(161.1,166.9,.1), + random(168.0,175.7,.1)); + +$mean_x = ($x[0] + $x[1] + $x[2] + $x[3] + $x[4])/5; +$mean_y = ($y[0] + $y[1] + $y[2] + $y[3] + $y[4])/5; + +for ($i=0; $i<5; $i++) { +$sx_squared += ($x[$i] - $mean_x)*($x[$i] - $mean_x);} + +$sx = sqrt($sx_squared/4); + +for ($i=0; $i<5; $i++) { +$sy_squared += ($y[$i] - $mean_y)*($y[$i] - $mean_y);} + +$sy = sqrt($sy_squared/4); + +for ($i=0; $i<5; $i++) { +$sum_r += (($x[$i] - $mean_x)/$sx)*(($y[$i] - $mean_y)/$sy);} + +$r = $sum_r/4; + +$b = $r*($sy/$sx); +$a = $mean_y - ($b*$mean_x); + +###################################### +# Main text + +BEGIN_TEXT +Because elderly people may have difficulty standing to have their height measured, a study looked at the relationship between overall height and height to the knee. Here are data (in centimeters) for five elderly men: +$PAR +$BCENTER +\{begintable(6)\} +\{row('$BBOLD Knee Height $EBOLD $SPACE \( x \) $SPACE ',$x[0],$x[1],$x[2],$x[3],$x[4])\} +\{row('$BBOLD Height $EBOLD $SPACE \( y \) $SPACE',$y[0],$y[1],$y[2],$y[3],$y[4])\} +\{endtable()\} +$ECENTER +$BR + +What is the equation of the least-squares regression line for predicting height from knee height? +$PAR +\( \hat{y} = \) \{ ans_rule(15) \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = Formula("$a + $b x"); +ANS($ans_a->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_08_Regression.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_08_Regression.pg new file mode 100644 index 0000000000..20ef207a1f --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_08_Regression.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 5: Regression') +## KEYWORDS('statistic', 'regression','correlation') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 5: Regression') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +#Keep the values "nice". +@possible_x=(1, 1, 2, 2, 3, 3, 5, 5, 5, 6, 6, 7, 7, 8, 8); +@possible_y=(9, 10, 9, 8, 8, 7, 7, 6, 5, 6, 4, 4, 3, 3, 2); + +@slice = NchooseK(15,7); +@x=@possible_x[@slice]; +@y=@possible_y[@slice]; + +$sx = 0; +$sy = 0; +$sxy = 0; +$sx2 = 0; +$sy2 = 0; +for($i=0; $i<7; $i++) { + $sx = $sx + $x[$i]; + $sy = $sy + $y[$i]; + $sxy = $sxy + ($x[$i]*$y[$i]); + $sx2 = $sx2 + ($x[$i]**2); + $sy2 = $sy2 + ($y[$i]**2); +} + +$ssxy = $sxy-(($sx*$sy)/7); +$ssx = $sx2-(($sx**2)/7); +$ssy = $sy2-(($sy**2)/7); + +$r = $ssxy/sqrt($ssx*$ssy); +$r_sq = 100 * $r ** 2; + +################################################# +# Main + +BEGIN_TEXT +Given the following data set, let \( x \) be the explanatory variable and \( y \) be the +response variable. +$BCENTER +\{begintable(8)\} +\{row("\( x \)", "$x[0]", "$x[1]", "$x[2]", "$x[3]", "$x[4]", "$x[5]", "$x[6]")\} +\{row("\(y\)", "$y[0]", " $y[1] ", "$y[2]", "$y[3]", "$y[4]", "$y[5]", "$y[6]")\} +\{endtable()\} +$ECENTER +$PAR +(a) If a least squares line was fitted to this data, what percentage of the variation in the \( y \)would be explained by the regression line? $BR + \{ans_rule(15)\} + +$PAR +(b) Compute the correlation coefficient: \(r = \) \{ans_rule(15)\} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 1; +Context("Percent"); +$ans_a = Percent($r_sq/100); + ANS($ans_a->cmp); + +$ans_b = Compute($r)->with(tolType=>'absolute', tolerance=>'0.005'); + ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01; + } => ["Your answer is close. Try the calculation using more accuracy."]))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_09_Regression.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_09_Regression.pg new file mode 100644 index 0000000000..686d427c4f --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_09_Regression.pg @@ -0,0 +1,140 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 5: Regression') +## KEYWORDS('statistic', 'regression','residuals') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 5: Regression') +## Problem1('') +## Author('E Cabrera') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGchoicemacros.pl", + "PGgraphmacros.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@e = (random(35,45,1),random(45,55,1),random(35,45,1),random(50,65,1),random(52,65,1),random(56,67,1),random(58,68,1),random(45,55,1),random(40,49,1),random(42,54,1),random(52,70,1),random(60,80,1),random(10,28,1),random(58,72,1),random(25,37,1),random(100,120,1)); + +@brain = (random(-.130,-.100,.001),random(.380,.398,.001),random(.005,.020,.001),random(.360,.380,.001),random(.005,.035,.001),random(.400,.425,.001),random(.090,.115,.001),random(.506,.520,.001),random(.140,.160,.001),random(.735,.750,.001),random(.245,.260,.001),random(.560,.580,.001),random(.205,.225,.001),random(.712,.730,.001),random(.350,.371,.001),random(.760,.790,.001)); + + +for ($i=0; $i<16; $i++) { +$sum_x += $e[$i]; +$sum_y += $brain[$i]; +$j = $i + 1; +$subject[$i] = "subject $j"; +} + +$mean_x = $sum_x/16; +$mean_y = $sum_y/16; + +for ($i=0; $i<16; $i++) { +$sx_squared += ($e[$i] - $mean_x)*($e[$i] - $mean_x);} + +$sx = sqrt($sx_squared/15); + +for ($i=0; $i<16; $i++) { +$sy_squared += ($brain[$i] - $mean_y)*($brain[$i] - $mean_y);} + +$sy = sqrt($sy_squared/15); + +for ($i=0; $i<16; $i++) { +$sum_r += (($e[$i] - $mean_x)/$sx)*(($brain[$i] - $mean_y)/$sy);} + +$r = $sum_r/15; + +# Regression Line = y = a + bx +#---------------- +$b = $r*($sy/$sx); +$a = $mean_y - ($b*$mean_x); +$intb = .00001*int(100000*($b+.000005)); +if ($a<0) { +$inta = .00001*int(100000*($a-.000005)); +} +else { +$inta = $inta = .00001*int(100000*($a+.000005)); +} + +$f1 = Formula("$a + $b * x"); + +# Residuals +#--------------- +for($i=0;$i<16;$i++) { +$res[$i] = $brain[$i]-($e[$i]*$intb + $inta); +} + +$choose = list_random(0,1,2,4,6,7,8,9,10,11,12,13,14,15); #Pick the residual to calculate. + +# Grid +#--------------- + +$graph = +init_graph(-20,-.4,120,1.2,'grid'=>[14,16],'axes'=>[0,0],'size'=>[700,400]); + +# Draw circles +#--------------- +for($i=0;$i<16;$i++){ +$circle[$i] = closed_circle($e[$i],$brain[$i]); +$graph -> stamps($circle[$i]); +} +$circle[$choose]= closed_circle($e[$choose],$brain[$choose],'red'); +$graph -> stamps($circle[$choose]); + +add_functions($graph,"$f1 for x in [-30,130] using color=blue and weight=2"); + +$label1 = new Label($e[$choose]-8,$brain[$choose]+.03, "$subject[$choose]",'red','center'); +$graph->lb($label1); + +################################################# +# Main + +BEGIN_TEXT +Empathy means being able to understand what others feel. To see how the brain expresses empathy, researchers recruited 16 couples in their mid-twenties who were married or had been dating for at least two years. They zapped the man's hand with an electrode while the woman watched, and measured the activity in several parts of the woman's brain that would respond to her own pain. Brain activity was recorded as a fraction of the activity observed when the woman herself was zapped with the electrode. The women also completed a psychological test that measures empathy. +$BCENTER +\{ begintable(17)\} +\{row('$BBOLD Subject $EBOLD','$BBOLD 1 $EBOLD','$BBOLD 2 $EBOLD','$BBOLD 3 $EBOLD','$BBOLD 4 $EBOLD','$BBOLD 5 $EBOLD','$BBOLD 6 $EBOLD','$BBOLD 7 $EBOLD','$BBOLD 8 $EBOLD','$BBOLD 9 $EBOLD','$BBOLD 10 $EBOLD','$BBOLD 11 $EBOLD','$BBOLD 12 $EBOLD','$BBOLD 13 $EBOLD','$BBOLD 14 $EBOLD','$BBOLD 15 $EBOLD','$BBOLD 16 $EBOLD')\} +\{row('$BBOLD Empathy Score $EBOLD $SPACE $SPACE',$e[0],$e[1],$e[2],$e[3],$e[4],$e[5],$e[6],$e[7],$e[8],$e[9],$e[10],$e[11],$e[12],$e[13],$e[14],$e[15])\} +\{row('$BBOLD Brain Activity $EBOLD',$brain[0],$brain[1],$brain[2],$brain[3],$brain[4],$brain[5],$brain[6],$brain[7],$brain[8],$brain[9],$brain[10],$brain[11],$brain[12],$brain[13],$brain[14],$brain[15])\} +\{endtable()\} + +$BR +\{ image( insertGraph($graph), tex_size => 500, width=>625, height=>375) \} +$ECENTER +$BR +Given that the equation for the regression line is \( \hat{y} = $intb x + $inta \), what is the residual for $subject[$choose]? +$BR +\{ ans_rule(8) \} +END_TEXT + +###################################### +# Answer + +$showPartialCorrectAnswers = 1; + +$ans_a1 = Real($res[$choose])->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_a1->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$ansHash) = @_; + return abs(-1*$correct-$student) <= .02; + } => ["Remember that the formula is Observed - Expected, order matters in subtraction", score => 0], + sub { + my ($correct,$student,$ansHash) = @_; + return abs($correct-$student) <= .02; + } => ["Close! Try keeping more accuracy in your calculation.", score => 0] + +))); + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_12_Regression.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_12_Regression.pg new file mode 100644 index 0000000000..7a287a7395 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/05Stats_12_Regression.pg @@ -0,0 +1,100 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Correlation) +## Institution(The College of Idaho) +## Author(R Cruz, L Danielson, J Guild) +## Level(1) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('5') +## Problem1('') +## KEYWORDS('statistic', 'regression','correlation') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The owner of a chain of supermarkets notices that there is a positive correlation between the sales of beer + and the sales of ice cream over the course of the previous year. Seasons when sales of beer were above average, + sales of ice cream also tended to be above average. Likewise, during seasons when sales of beer were below + average, sales of ice cream also tended to be below average. Which of the following would be a valid conclusion + from these facts? ","The sale of beer and ice cream may both be affected by another variable such as the outside temperature."); + $mc[0]->extra("Sales records must be in error. There should be no association between beer and ice cream sales. ", + "Evidently, for a significant proportion of customers of these supermarkets, drinking beer causes a desire for + ice cream or eating ice cream causes a thirst for beer. ", + "A scatterplot of monthly ice cream sales versus monthly beer sales would show that a straight line describes the + pattern in the plot, but it would have to be a horizontal line. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A researcher observes that, on average, the number of divorces in cities with major league baseball + teams is larger than in cities without major league baseball teams. The most plausible explanation for + this observed association is ","the association is due to the presence of a lurking variable (major league + teams tend to be in large cities with more people, hence a greater number of divorces). "); + $mc[1]->extra("the observed association is purely coincidental. It is implausible to believe the observed association + could be anything other than accidental. ", + "the high number of divorces is responsible for the presence of a major league baseball teams (more + single men means potentially more fans at the ballpark, making it attractive for an owner to relocate to such cities). ", + "the presence of a major league baseball team causes the number of divorces to rise (perhaps husbands are + spending too much time at the ballpark). "); + $mc[1]->makeLast("None of the above."); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("When possible, the best way to establish that an observed association is the + result of a cause-and-effect relation is by means of ","a well designed experiment."); +$mc[2]->extra("the least squares regression line.", + "the correlation coefficient.", + "the square of the correlation coefficient."); +$mc[2]->makeLast("None of the above."); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/dueck4_2_2.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/dueck4_2_2.pg new file mode 100644 index 0000000000..281cc45866 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/dueck4_2_2.pg @@ -0,0 +1,19 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch05Regression/05Stats_06_Regression.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch05Regression/05Stats_06_Regression.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject(ZZZ-Inserted Text) +## DBchapter(ZZZ-Inserted Text) +## DBsection(ZZZ-Inserted Text) +## MLT(LineFromData) + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/dueck4_2_4.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/dueck4_2_4.pg new file mode 100644 index 0000000000..b0a70fd653 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/dueck4_2_4.pg @@ -0,0 +1,104 @@ +##DESCRIPTION +## Statistics: Simple Linear Regression +##ENDDESCRIPTION + +##KEYWORDS('Statistics','Regression Equation') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Simple Linear Regression') +##DBsection('Regression Equation') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +for($i=0; $i<10; $i++){ + $x[$i] = random(25,80,1); + $y[$i] = int(1.2*$x[$i] + random(-4,4)); +} + +$sx =0; +$sy =0; +$sxy =0; +$sx2 =0; +$sy2 =0; +$meanx =0; +$meany =0; + +for($i=0; $i<10; $i++) { + $sx = $sx + $x[$i]; + $sy = $sy + $y[$i]; + $sxy = $sxy + ($x[$i]*$y[$i]); + $sx2 = $sx2 + ($x[$i]**2); + $sy2 = $sy2 + ($y[$i]**2); + $meanx = $meanx+$x[$i]; + $meany = $meany+$y[$i]; + +} +$meanx = $meanx/10; +$meany = $meany/10; +$ssxy = $sxy-(($sx*$sy)/10); +$ssx = $sx2-(($sx**2)/10); +$ssy = $sy2-(($sy**2)/10); + +$r = $ssxy/sqrt($ssx*$ssy); +$b1 = $ssxy/$ssx; +$b0 = $meany-$b1*$meanx; + +$popup = PopUp(["?", "yes", "no"], "no" ); + +BEGIN_TEXT +A study was conducted to detemine whether a the final grade of a student in an introductory psychology +course is linearly related to his or her performance on the verbal ability test administered before +college entrance. The verbal scores and final grades for \( 10\) students are shown in the table below. +$BR +\{begintable(3)\} +\{row("Student", "Verbal Score \(x\)", "Final Grade \(y\)")\} +\{row("\(1\)", "\($x[0]\)", "\($y[0]\)")\} +\{row("\(2\)", "\($x[1]\)", "\($y[1]\)")\} +\{row("\(3\)", "\($x[2]\)", "\($y[2]\)")\} +\{row("\(4\)", "\($x[3]\)", "\($y[3]\)")\} +\{row("\(5\)", "\($x[4]\)", "\($y[4]\)")\} +\{row("\(6\)", "\($x[5]\)", "\($y[5]\)")\} +\{row("\(7\)", "\($x[6]\)", "\($y[6]\)")\} +\{row("\(8\)", "\($x[7]\)", "\($y[7]\)")\} +\{row("\(9\)", "\($x[8]\)", "\($y[8]\)")\} +\{row("\(10\)", "\($x[9]\)", "\($y[9]\)")\} +\{endtable()\} +$BR +Find the least squares line. $PAR +\(\hat{y} = \) \{ans_rule(10)\} \(+\) \{ans_rule(10)\} \(x \) $PAR + +Should the regression be used to predict the final grade of a student with a verbal score of 100? $BR +\{$popup->menu\} + +END_TEXT +ANS(num_cmp($b0)); +ANS(num_cmp($b1)); +ANS($popup->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust16.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust16.pg new file mode 100644 index 0000000000..8774e416c6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust16.pg @@ -0,0 +1,54 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('What is Statistics?') +##DBsection('Introduction') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("The coefficient of determination falls between", "0 and 1."); +$mc->extra("-1 and 0 ", "-1 and 1", "negative infinity to positive infinity"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust17.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust17.pg new file mode 100644 index 0000000000..9a337eddd3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust17.pg @@ -0,0 +1,54 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +##DBsection('Linear regression') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("The regression line is the straight line that bests fits a set of data points according to what?", "Least sum of squares of vertical distances between data and the line."); +$mc->extra("Least sum of squares of horizontal distances between data and the line.", "Least sum of squares of distances between data and the line.", "Greatest sum of squares of vertical distances between data and the line.", "Greatest sum of squares of horizontal distances between data and the line.", "Greatest sum of squares of distances between data and the line."); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust18.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust18.pg new file mode 100644 index 0000000000..77cbef3506 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust18.pg @@ -0,0 +1,50 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##Tagged by up2p + +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Prediction) +## Institution(ASU) +## Level(1) +## KEYWORDS('Statistics') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Using the regression equation to make predictions for values of the predictor variable outside the range of the observed values of the predictor variable is called", "Extrapolation."); +$mc->extra("Interpolation", "Generalization", "Explaination"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust19.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust19.pg new file mode 100644 index 0000000000..284985c753 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust19.pg @@ -0,0 +1,47 @@ +##DESCRIPTION +## Statistics: Regression +##ENDDESCRIPTION + +##Tagged by up2p + +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Regression) +## Institution(ASU) +## Level(2) +## KEYWORDS('Statistics') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Before determining a regression line, it is important to do what?", "Plot the data to make sure it appears somewhat linear."); +$mc->extra("Make sure that every x value has exactly one corresponding y value", "Plot the data to make sure it does not appear linear."); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust22.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust22.pg new file mode 100644 index 0000000000..c49ac61a8c --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust22.pg @@ -0,0 +1,58 @@ +##DESCRIPTION +## Statistics: Regression +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +##DBsection('Linear regression') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); + +$pick = random(-.975,-.75,.025); +$ans = $pick**2; +$popup = PopUp(["?", "positive", "negative", "not enough information to tell"], "negative"); + +BEGIN_TEXT + +The linear correlation coefficient of a set of data points is \($pick\). $PAR +a) Is the slope of the regression line positive or negative? $BR +\{$popup->menu\}$PAR +b) Determine the coefficient of determination. $BR +\{ans_rule(20)\}$PAR + +END_TEXT +Context("Percent"); +ANS($popup->cmp); +ANS(Percent($ans)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust23.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust23.pg new file mode 100644 index 0000000000..12d8b7a3e1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust23.pg @@ -0,0 +1,52 @@ +##DESCRIPTION +## Statistics: Regression +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +##DBsection('Linear regression') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$pick = random(.75,.99,.01); +$pick2 = random(-10, -1, .02); +$ans = -1*($pick**.5); + +BEGIN_TEXT + +The coefficient of determination of a set of data points is \($pick\) and the slope of the regression line is \($pick2\). Determine the linear correlation coefficient of the data. $BR +\{ans_rule(20)\}$PAR + +END_TEXT + +ANS(num_cmp($ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust32.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust32.pg new file mode 100644 index 0000000000..0c2c9e30c7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/gust32.pg @@ -0,0 +1,98 @@ +##DESCRIPTION +## Statistics: Linear regression +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +##DBsection('Linear regression') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextCurrency.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@b = (32.98, 49.72, 88.01, 97.34, 64.30, 106.27, 52.44, 70.29, 43.58); +@ab=('32.98', '49.72', '88.01', '97.34', '64.30', '106.27', '52.44', '70.29', '43.58'); +@t = ( 4.50, 5.28, 10.00, 16.00, 7.70, 16.00, 7.00, 10.00, 5.50); +@at =('4.50', '5.28', '10.00', '16.00', '7.70', '16.00', '7.00', '10.00', '5.50'); + +@slice = NchooseK(9,6); + +@sb = @b[@slice]; +@sab = @ab[@slice]; +@st = @t[@slice]; +@sat = @at[@slice]; + +$sx = 0; +$sy = 0; +$sxy = 0; +$sx2 = 0; +$sy2 = 0; + +for($i=0;$i<6;$i++){ + $sx = $sx + $sb[$i]; + $sy = $sy + $st[$i]; + $sxy = $sxy + $sb[$i] * $st[$i]; + $sx2 = $sx2 + ($sb[$i])**2; + $sy2 = $sy2 + ($st[$i])**2; +} + +$b0 = ($sy * $sx2 - $sx * $sxy)/(6 * $sx2 - ($sx)**2); + +$b1 = (6 * $sxy - $sx * $sy)/(6 * $sx2 - ($sx)**2); + +$bill = random(40,100,5); + +$tip = $b0 + $b1*$bill; + +BEGIN_TEXT + +The amounts of 6 restaurant bills and the corresponding amounts of the tips are given in +the table below. + +\[ \begin{array}{c|cccccc} +\mbox{Bill} & $sab[0] & $sab[1] & $sab[2] & $sab[3] & $sab[4] & $sab[5] \cr +\hline +\mbox{Tip} & $sat[0] & $sat[1] & $sat[2] & $sat[3] & $sat[4] & $sat[5] \cr +\end{array} \] + +Find the following: $PAR +The regression equation for predicting tip from bill is \(\hat{y}=\) \{ans_rule(10)\} \(+\) \{ans_rule(10)\} \(x.\) $BR + +If the amount of the bill is $DOLLAR\($bill,\) the best prediction for the amount of the tip is +\{ans_rule(20)\} $BR + +END_TEXT + +Context("Currency")->flags->set("trimTrailingZeros=>1"); +Context()->currency->addSymbol("dollars","dollar"); +Context()->flags->set(tolerance=>0.05); +ANS(num_cmp($b0)); +ANS(num_cmp($b1)); +ANS(Currency($tip)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines1.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines1.pg new file mode 100644 index 0000000000..f3e50d3166 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines1.pg @@ -0,0 +1,108 @@ +##DESCRIPTION +## Statistics: Descriptive Methods in Regression and Correlation +##ENDDESCRIPTION + +##KEYWORDS('linear equation', 'slope', 'intercept') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +## DBsection('Linear regression') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +$mc1 = new_multiple_choice(); +$mc1->qa("Which is the general form of such an equation:", +"\( y = b_0 + b_1 x \)"); +$mc1->extra("\(y = b_0 + b_1 x^2 \)", "\(y = b_0 x^{b_1}\)", +"\(y = b_0 x + b_1 z\)", "\(y = \frac{b_0}{x} + b_1 \)"); + +$mc2 = new_multiple_choice(); +$mc2->qa(" ", "a constant"); +$mc2->extra("the independent variable", "the dependent variable"); +$mc2->makeLast("a constant", "the independent variable", "the dependent variable", "none of the above"); + +$mc22 = new_multiple_choice(); +$mc22->qa(" ", "a constant"); +$mc22->extra("the independent variable", "the dependent variable"); +$mc22->makeLast("a constant", "the independent variable", "the dependent variable", "none of the above"); + +$mc3 = new_multiple_choice(); +$mc3->qa(" ", "the independent variable"); +$mc3->extra("a constant", "the dependent variable"); +$mc3->makeLast("a constant", "the independent variable", "the dependent variable", "none of the above"); + +$mc4 = new_multiple_choice(); +$mc4->qa(" ", "the dependent variable"); +$mc4->extra("the independent variable", "a constant"); +$mc4->makeLast("a constant", "the independent variable", "the dependent variable", "none of the above"); + +BEGIN_TEXT +Regarding linear equations with one independent variable: +$PAR +\{$mc1->print_q()\} +$BR +\{$mc1->print_a()\} +$PAR +The rest of the problem refers to the expression you selected above. +$BR$BR +The letter \(b_0\) is +\{$mc2->print_q()\} +$BR +\{$mc2->print_a()\} +$PAR +The letter \(b_1\) is +\{$mc22->print_q()\} +$BR +\{$mc22->print_a()\} +$PAR +The letter \(x\) is +\{$mc3->print_q()\} +$BR +\{$mc3->print_a()\} +$PAR +The letter \(y\) is +\{$mc4->print_q()\} +$BR +\{$mc4->print_a()\} +END_TEXT +ANS(radio_cmp($mc1->correct_ans)); +ANS(radio_cmp($mc2->correct_ans)); +ANS(radio_cmp($mc22->correct_ans)); +ANS(radio_cmp($mc3->correct_ans)); +ANS(radio_cmp($mc4->correct_ans)); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines2.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines2.pg new file mode 100644 index 0000000000..b2cf7c5f4b --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines2.pg @@ -0,0 +1,94 @@ +##DESCRIPTION +## Statistics: Descriptive Methods in Regression and Correlation +##ENDDESCRIPTION + +## Tagged by sawblade + +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Regression) +## Institution(ASU) +## Level(2) +## KEYWORDS('linear equation', 'slope', 'intercept') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +$mc1 = new_multiple_choice(); +$mc1->qa("\(b_0\) is", "the \(y\)-intercept"); +$mc1->extra("the slope", "the independent variable", "the dependent variable"); + +$mc2 = new_multiple_choice(); +$mc2->qa("\(b_1\) is", "the slope"); +$mc2->extra("the \(y\)-intercept", "the independent variable", "the dependent variable"); + +$mc3 = new_multiple_choice(); +$mc3->qa("Give the geometric interpretation of \(b_0\). It indicates", +"the \(y\)-value where the straight-line graph of the linear equation intersects the \(y\)-axis"); +$mc3->extra( +"the \(x\)-value where the straight-line graph of the linear equation intersects the \(x\)-axis", "how much the \(y\)-value on the straight line changes when the \(x\)-value increases by unit", +"how much the \(x\)-value on the straight line changes when the \(y\)-value increases by unit", +); + +$mc4 = new_multiple_choice(); +$mc4->qa("Give the geometric interpretation of \(b_1\). It indicates", +"how much the \(y\)-value on the straight line changes when the \(x\)-value increases by unit"); +$mc4->extra( +"the \(x\)-value where the straight-line graph of the linear equation intersects the \(x\)-axis", +"the \(y\)-value where the straight-line graph of the linear equation intersects the \(y\)-axis", +"how much the \(x\)-value on the straight line changes when the \(y\)-value increases by unit", +); + +BEGIN_TEXT +Consider the linear equation \(y = b_0 + b_1 x\). +$PAR +a. In the equation, +\{$mc1->print_q()\} +$BR +\{$mc1->print_a()\} +$PAR +b. In the equation, +\{$mc2->print_q()\} +$BR +\{$mc2->print_a()\} +$PAR +c. +\{$mc3->print_q()\} +$BR +\{$mc3->print_a()\} +$PAR +d. +\{$mc4->print_q()\} +$BR +\{$mc4->print_a()\} +END_TEXT +ANS(radio_cmp($mc1->correct_ans)); +ANS(radio_cmp($mc2->correct_ans)); +ANS(radio_cmp($mc3->correct_ans)); +ANS(radio_cmp($mc4->correct_ans)); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines3.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines3.pg new file mode 100644 index 0000000000..07b9bf50ae --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines3.pg @@ -0,0 +1,100 @@ +##DESCRIPTION +## Statistics: Descriptive Methods in Regression and Correlation +##ENDDESCRIPTION + +##KEYWORDS('linear equation', 'slope', 'intercept') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +## DBsection('Linear regression') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Randomization of variables +# +$c1 = - random(10, 50, 1); +$c2 = random(10, 50, 1); +$c3 = random(20, 40, 1); + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +Measuring Temperature. The two most commonly used scales for measuring temperature are the Fahrenheit and Celsius scales. If you let \(y\) denote the Fahrenheit temperature and \(x\) denote Celsius temperature, you can express the relationship between those two scales with the linear equation \( y = 32 + 1.8 x \). +$PAR +a. Determine the \(y\)-intercept \(b_0\) and the slope \(b_1\). +$BR$BR +\(b_0\) = \{ans_rule(40)\} +$BR$BR +\(b_1\) = \{ans_rule(40)\} +$PAR +b. Find the Fahrenheit temperature corresponding to the Celsius temperature \($c1^{\circ}\). +$BR +\{ans_rule(40)\} degrees +$PAR +c. Find the Fahrenheit temperature corresponding to the Celsius temperature \(0^{\circ}\). +$BR +\{ans_rule(40)\} degrees +$PAR +d. Find the Fahrenheit temperature corresponding to the Celsius temperature \($c2^{\circ}\) . +$BR +\{ans_rule(40)\} degrees +$PAR +e. Find the Fahrenheit temperature corresponding to the Celsius temperature \(100^{\circ}\). +$BR +\{ans_rule(40)\} degrees +$PAR +f. Graph the linear equation \( y = 32 + 1.8 x \), using the four points found in (b), (c), (d) and (e). This is only for your own sake and cannot currently be assessed through WeBWorK. +$PAR +g. Apply the graph obtained in part (f) to estimate visually the Fahrenheit temperature corresponding to a Celsius temperature of \($c3^{\circ}\). Then calculate that temperature exactly by using the linear equation \( y = 32 + 1.8 x \). The exact Fahrenheit temperature corresponding to the Celsius temperature of \($c3^{\circ}\) is +$BR +\{ans_rule(40)\} degrees + +END_TEXT + +$ans_a1 = 32; +$ans_a2 = 1.8; +$ans_b = 32 + 1.8 * $c1; +$ans_c = 32 + 1.8 * 0; +$ans_d = 32 + 1.8 * $c2; +$ans_e = 32 + 1.8 * 100; +$ans_g = 32 + 1.8 * $c3; +ANS(num_cmp($ans_a1)); +ANS(num_cmp($ans_a2)); +ANS(num_cmp($ans_b)); +ANS(num_cmp($ans_c)); +ANS(num_cmp($ans_d)); +ANS(num_cmp($ans_e)); +ANS(num_cmp($ans_g)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines4.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines4.pg new file mode 100644 index 0000000000..708c1eae1d --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines4.pg @@ -0,0 +1,83 @@ +##DESCRIPTION +## Statistics: Descriptive Methods in Regression and Correlation +##ENDDESCRIPTION + +##KEYWORDS('linear equation', 'slope', 'intercept') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +## DBsection('Linear regression') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# + +$b_0 = random(1,9); +$b_1 = random(2,9); + +$mc=new_multiple_choice(); +$mc->qa("The line", "slopes upward"); +$mc->extra("slopes downward", "is horizontal"); +$mc->makeLast("none of the above"); + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +$PAR +For the equation \(y = $b_0 + $b_1 x\), +$PAR +a. The \(y\)-intercept is \{ans_rule(20)\}, and the slope is \{ans_rule(20)\}. +$PAR +b. +\{ $mc->print_q() \} +$BR +\{ $mc->print_a() \} + +$PAR +c. Use two points to graph the equation. This is only for your own sake and cannot currently be assessed through WeBWorK. + +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# +$ans_a1 = $b_0; +$ans_a2 = $b_1; +ANS(num_cmp($ans_a1)); +ANS(num_cmp($ans_a2)); +ANS(radio_cmp($mc->correct_ans)); +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines5.pg b/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines5.pg new file mode 100644 index 0000000000..062950d2e8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/LinearRegression/lines5.pg @@ -0,0 +1,82 @@ +##DESCRIPTION +## Statistics: Descriptive Methods in Regression and Correlation +##ENDDESCRIPTION + +##KEYWORDS('linear equation', 'slope', 'intercept') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +## DBsection('Linear regression') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +# +# Now we do the randomization of variables, and other computations +# as needed for this problem. Sometimes we compute the answers here. +# + +$b_1 = random(1,9) - 0.5; +$b_0 = random(1,9); +$mc=new_multiple_choice(); +$mc->qa("The line", "slopes upward"); +$mc->extra("slopes downward", "is horizontal"); +$mc->makeLast("none of the above"); + +# +# Now the problem text itself, with ans_rule's to indicate where the +# answers go. You can stop entering text, do more computations, and then +# start up again if you want. +# + +BEGIN_TEXT +$PAR +For the equation \(y = $b_1 x - $b_0\), +$PAR +a. The \(y\)-intercept is \{ans_rule(20)\}, and the slope is \{ans_rule(20)\}. +$PAR +b. +\{ $mc->print_q() \} +$BR +\{ $mc->print_a() \} +$PAR +c. Use two points to graph the equation on paper. This is only for your own sake and cannot currently be assessed through WeBWorK. + +END_TEXT + +# +# Tell WeBWork how to test if answers are right. These should come in the +# same order as the answer blanks above. You tell WeBWork both the type of +# "answer evaluator" to use, and the correct answer. +# +$ans_a1 = - $b_0; +$ans_a2 = $b_1; +ANS(num_cmp($ans_a1)); +ANS(num_cmp($ans_a2)); +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_03_Probability.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_03_Probability.pg new file mode 100644 index 0000000000..ffd616f0b2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_03_Probability.pg @@ -0,0 +1,76 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl",, + "answerHints.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(0.1, 0.5, 0.1); +$b = random(0.1, 0.4, 0.1); + +$mc = new_multiple_choice(); + $mc->qa("If the knowledge that an event A has occurred implies that a second event B cannot occur, + then the events A and B are said to be ","disjoint. "); + $mc->extra("independent. ", + "collectively exhaustive. ", + "the sample space. "); + +###################################### +# Main text + +BEGIN_TEXT +$PAR +(a) \{ $mc -> print_q() \} +$BR +\{$mc -> print_a() \} + +$PAR +(b) If event A and event B are as above and event A has probability $a and event B has probability $b, +then the probability that A or B occurs is \{ans_rule(15)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc->correct_ans)); + +Context("Percent"); +$ans_b = $a + $b; +ANS(Percent($ans_b)->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_05_Probability.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_05_Probability.pg new file mode 100644 index 0000000000..f50ae02a5a --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_05_Probability.pg @@ -0,0 +1,78 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl",, + "answerHints.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$a = random(0.3, 0.4, 0.01); +$b = random(0.15, 0.35, 0.1); + +###################################### +# Main text + +BEGIN_TEXT +Government data assign a single cause for each death that occurs in the United States. +In a certain city, the data show that the probability is $a that a randomly chosen death +was due to cardiovascular (mainly heart) disease, and $b that it was due to cancer. + +$PAR +(a) The probability that a death was due either to cardiovascular disease +or to cancer is \{ans_rule(15)\}. + +$PAR +(b) The probability that the death was due to some other cause is \{ans_rule(15)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = $a + $b; +Context("Percent"); +ANS(Percent($ans_a)->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +$ans_b = 1 - $ans_a; +ANS(Percent($ans_b)->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_09_Probability.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_09_Probability.pg new file mode 100644 index 0000000000..4942d2bea6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_09_Probability.pg @@ -0,0 +1,139 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz, E Cabrera') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +$p3 = random(.05,.1,.01); +$p4 = random(.2,.3,.01); +$p6 = random(.15,.2,.01); +$p7 = random(.03,.05,.01); +$p8 = random(.03,.05,.01); +$p9 = $p8 - random(.01,.02,.01); +$p10 = random(.01,.03,.01); +$p5 = 1 - $p3 - $p4 - $p6 - $p7 - $p8 - $p9 - $p10; + +@event = ("What is the probability that a unit chosen at random has three rooms? + \(P(X=3)=\)", + "What is the probability that a unit chosen at random has less than five + rooms? \(P(X<5)=\)", + "What is the probability that a unit chosen at random is not a 10-room unit? + \(P(X \neq 10)=\)", + "What is the probability that a unit chosen at random has more than 5 rooms? + \(P(X > 5)=\)", + "What is the probability that a unit chosen at random has between four and + six rooms? \(P(4 \leq X \leq 6)=\)"); + +@ans = ($p3, ($p3+$p4), ($p3+$p4+$p5+$p6+$p7+$p8+$p9), ($p6+$p7+$p8+$p9+$p10), + ($p4+$p5+$p6)); + +@slice = NchooseK(5,3); +@sevent = @event[@slice]; +@sans = @ans[@slice]; + +$popup = PopUp(["?","discrete","continuous"],"discrete"); + +###################################### +# Main text + +BEGIN_TEXT +Let the random variable \( X \) be the number of rooms in a randomly chosen owner-occupied housing unit in a certain city. The distribution for the units is given +below. +$PAR +$BCENTER +\{begintable(9)\} +\{row("\(X\)", "3", "4", "5", "6", "7", "8", "9", " 10 ")\} +\{row("\( P(X) \)", "\($p3\)", "\($p4\)", "\($p5\)", "\($p6\)", "\($p7\)", "\($p8\)", "\($p9\)", " ? " )\} +\{endtable()\} +$ECENTER +$PAR +(a) Is \(X\) a discrete or continuous random variable? \{$popup->menu\} + +$PAR +(b) What must be the probability of choosing a unit with 10 rooms? + \(P(X = 10) =\) \{ans_rule(10)\} + +$PAR +(c) $sevent[0] \{ans_rule(10)\} + +$PAR +(d) $sevent[1] \{ans_rule(10)\} + +$PAR +(e) $sevent[2] \{ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + + + +ANS($popup->cmp); + +Context("Percent"); +$ans_b = Percent($p10); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +$ans_c = Percent($sans[0]); +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +$ans_d = Percent($sans[1]); +ANS($ans_d->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +$ans_e = Percent($sans[2]); +ANS($ans_e->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."] +))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_12_Probability.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_12_Probability.pg new file mode 100644 index 0000000000..0dcc3831e7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/10Stats_12_Probability.pg @@ -0,0 +1,91 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II From Exploration to Inference') +## DBsection('Chapter 10: Introducing Probability') +## KEYWORDS('statistics', 'sample space', 'probability') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 10: Introducing Probability') +## Problem1('') +## Author('R Cruz') +## Institution('The College of Idaho') +## Date: 2009/03 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@event = ("\( X = 1\)", "\( X = 2\)"); +$choose = random(0,1,1); + +###################################### +# Main text + +BEGIN_TEXT +Suppose a couple planned to have three children. Let \( X \) be the number +of girls the couple has.$PAR + +$PAR +(a) List all possible arrangements of girls and boys. For example, one possible arrangement is 2 girls and then a boy, which you would represent as $BBOLD GGB$EBOLD. (Separate each + item in your list with a comma.): \{ans_rule(60)\}. + +$PAR +(b) List the sample space for \( X \). (i.e. List the possible values that \( X \) + may take, separated by commas.): \{ans_rule(20)\}. + +$PAR +(c) What is the probability that $event[$choose]? \{ans_rule(10)\} $PAR + +$PAR +(d) Find the probability that the couple have three boys: \{ans_rule(15)\}. +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; +Context("Numeric"); +Context()->strings->add("GGG"=>{}, + "GGB"=>{}, + "GBG"=>{}, + "BGG"=>{}, + "BBG"=>{}, + "BGB"=>{}, + "GBB"=>{}, + "BBB"=>{}); + + +$ans_a = List("GGG", "GGB", "GBG", "BGG", "BBG", "BGB", "GBB", "BBB"); +ANS($ans_a->cmp); + +$ans_b = List(0, 1, 2, 3); +ANS($ans_b->cmp); + +Context("Percent"); +$ans_c = Percent(0.375); +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."]))); + +$ans_d = Percent("1/8"); +ANS($ans_d->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return $student < 0 || $student > 1; + } => ["Probabilities must be between 0 and 1."]))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes1.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes1.pg new file mode 100644 index 0000000000..b0045f9ab7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes1.pg @@ -0,0 +1,66 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Conditional Probability') +## KEYWORDS('Bayes' , 'probability', 'conditional') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/28/05 +# from pl/setProbability4Conditional/p3.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$pd = random(7,9,.5)/10; +$pdw = random(4,6,.5)/10; +$w = random(8,9,.1)/10; +$ww = $w*100; + +$ans1 = $w*$pdw + (1-$w)*$pd; +$ans2 = ((1-$w)*$pd)/($w * $pdw + (1-$w)*$pd); + +BEGIN_TEXT + +You ask a neighbor to water a sickly plant while you are on vacation. +Without water the plant will die with probability $pd. With water it will die +with probability $pdw. You are $ww$PERCENT certain the neighbor will remember +to water the plant. +$BR +When you are on vacation, find the probability that the plant will die. +$BR +\{ ans_rule(10) \} +$BR +$BR +You come back from the vacation and the plant is dead. What is the probability +the neighbor forgot to water it? +$BR +\{ ans_rule(10) \} +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); + +ANS(Percent($ans2)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes2.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes2.pg new file mode 100644 index 0000000000..c0041fdb73 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes2.pg @@ -0,0 +1,65 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Conditional Probability') +## KEYWORDS('Bayes' , 'probability', 'conditional') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/28/05 +# from pl/setProbability4Conditional/p2.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$n1 = random(2,4,1); +$n2 = random(5,7,1); +$pda = random(10,40)/1000; +$pdb = random(20,50)/1000; +$pdc = random(30,60)/1000; + +@fac = ("A","B","C"); +$ind = random(0,2,1); +$refac = $fac[$ind]; + + +@num = ($n1*$pda,$n2*$pdb,$pdc); +$renum = $num[$ind]; +$denom = $n1*$pda+$n2*$pdb+$pdc; +$ans = $renum/$denom; + +BEGIN_TEXT +Factories A, B and C produce computers. Factory A produces $n1 times as many computers as factory C. And factory B produces $n2 times as many computers +as factory C. The probability that a computer produced by factory A is defective is $pda, the probability that a computer produced by factory B is defective is $pdb, and the probability that a computer produced by factory C is defective is $pdc. + +$BR +A computer is selected at random and it is found to be defective. What is the +probability it came from factory $refac? +$BR +\{ans_rule(20)\} $BR + +END_TEXT +Context("Percent"); + +ANS(Percent($ans)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes3.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes3.pg new file mode 100644 index 0000000000..388782fb4b --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes3.pg @@ -0,0 +1,102 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Conditional Probability') +## KEYWORDS('Bayes' , 'probability', 'conditional') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/28/05 +# from pl/setProbability4Conditional/p12.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PGasu.pl", +"PGauxiliaryFunctions.pl", +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserPopUp.pl", +); + +TEXT($BEGIN_ONE_COLUMN); +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(50,100); +$b = random(20,80); +$c = random(10,40); +$d = random(10,100); +$e = random(20,80); +$f = random(10,20); + +$total = $a + $b + $c + $d + $e + $f; +$Mtotal = $a + $b +$c; +$Ftotal = $d+ $e +$f; +$Rtotal = $a+$d; +$Dtotal = $b+ $e; +$Itotal = $c+$f; + +@event1 = ("Male","Female"); +@event2 = ("Republican","Democrat","Independent"); +@mrow = ($a,$b,$c); +@frow = ($d,$e,$f); +$ind1 = random(0,1,1); +$ind2 = random(0,2,1); +$reevent1 = $event1[$ind1]; +$reevent2 = $event2[$ind2]; + +if ($ind1 == 0) {@xrow = @mrow;} else {@xrow = @frow;} + +if ($xrow[$ind2]*$total == ($mrow[$ind2]+$frow[$ind2])*($xrow[0]+$xrow[1]+$xrow[2])) {$ans="Yes";} else {$ans="No";} + +$popup = PopUp(["?","Yes","No"],$ans); + +BEGIN_TEXT +In a survey of $total people, the following data were obtained relating +gender to political orientation: +$BCENTER +\{begintable(5)\} +\{row(" ", "Republican (R)", "Democrat (D)","Independent (I)", "Total" )\} +\{row("Male (M)", "$a", "$b", "$c","$Mtotal ") \} +\{row("Female (F)", "$d", "$e",,"$f"," $Ftotal ") \} +\{row("Total", "$Rtotal", "$Dtotal","$Itotal","$total")\} +\{endtable()\} +$ECENTER +$PAR +A person is randomly selected. What is the probability that the person is: +$BR +a) Male? \{ ans_rule(20) \} +$BR +b) Male and a Democrat? \{ ans_rule(20) \} +$BR +c) Male given that the person is a Democrat? \{ ans_rule(20) \} +$BR +d) Republican given that the person is Male? \{ ans_rule(20) \} +$BR +e) Female given that the person is an Independent? \{ ans_rule(20) \} +$BR +f) Are the events $reevent1 and $reevent2 independent? \{ $popup->menu \} + +END_TEXT +Context("Percent"); +ANS(Percent($Mtotal/$total)->cmp); +ANS(Percent($b/$total)->cmp); +ANS(Percent($b/$Dtotal)->cmp); +ANS(Percent($a/$Mtotal)->cmp); +ANS(Percent($f/$Itotal)->cmp); + +ANS($popup->cmp); +TEXT($END_ONE_COLUMN); +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes7.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes7.pg new file mode 100644 index 0000000000..f48a963aef --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/Bayes7.pg @@ -0,0 +1,96 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Conditional Probability') +## KEYWORDS('Bayes' , 'probability', 'conditional') +## Author('Monika Keindl') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/13/10 +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGgraphmacros.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "MathObjects.pl", + "contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$i = random(55,70,5)/100; #work values +$ni = 1-$i; + +$u = random(10,15,1)/100; +$n= random(21,25,1)/100; +$f=1-$u-$n; + +$nu=random(35,40,1)/100; +$nn=random(13,18,1)/100; +$nf=1-$nu-$nn; + +$di=$i*100; #display values +$dni=$ni*100; +$du=$u*100; +$dn=$n*100; +$df=$f*100; +$dnu=$nu*100; +$dnn=$nn*100; +$dnf=$nf*100; + + +$ans1 =$i*$f+$ni*$nf; +$ans2 =$i*$f/$ans1; +$ans3 =($ni*$nu)/($i*$u+$ni*$nu); + + +BEGIN_TEXT + +Scientific research on popular beverages consisted of +$di studies that were fully sponsored by the food industry, and $dni studies +that were conducted with no corporate ties. Of those that were fully +sponsored by the food industry, $du$PERCENT of the participants found +the products unfavorable, $dn$PERCENT were neutral, and $df$PERCENT +found the products favorable. Of those that had no industry funding, +$dnu$PERCENT found the products unfavorable, $dnn$PERCENT were neutral, and $dnf$PERCENT found the products favorable. +$BR +What is the probability that a participant selected at random found the +products favorable? +$BR + +\{ ans_rule(10) \} + +$BR +If a randomly selected participant found the product favorable, what is +the probability that the study was sponsored by the food industry? +$BR +\{ ans_rule(10) \} +$BR +If a randomly selected participant found the product unfavorable, what +is the probability that the study had no industry funding? +$BR +\{ ans_rule(10) \} + + +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp); + +ANS(Percent($ans2)->cmp); + +ANS(Percent($ans3)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/compprob4.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/compprob4.pg new file mode 100644 index 0000000000..77b3a415ed --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/compprob4.pg @@ -0,0 +1,71 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## KEYWORDS('probability') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/20/05 +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$marfrac = random(50,60,1); +$cgfrac = random(15,45,1); +@frac = ("1/6","1/5","1/4","1/3","1/2"); +@numfrac = (1/6,1/5,1/4,1/3,1/2); +$ind = random(0,4,1); +$refrac = $frac[$ind]; +$renumfrac = $numfrac[$ind]; + +$ansb = $marfrac - $cgfrac*$renumfrac; +$ansc = $marfrac + $cgfrac*(1-$renumfrac); +$ansa = 100-$ansc; + +BEGIN_TEXT +Employment data at a large company reveal that $marfrac$PERCENT of the workers are married, that $cgfrac$PERCENT are college graduates, and that $refrac of the college graduates are married. +$PAR +$PAR +What is the probability that a randomly chosen worker is: +$BR +a) neither married nor a college graduate? +$BR + \{ans_rule(10)\} +$BR +b) married but not a college graduate? +$BR + \{ans_rule(10)\} +$BR +c) married or a college graduate? +$BR + \{ans_rule(10)\} + +END_TEXT +Context("Percent"); +ANS(Percent($ansa/100)->cmp); +ANS(Percent($ansb/100)->cmp); +ANS(Percent($ansc/100)->cmp); + + + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/comprob10.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/comprob10.pg new file mode 100644 index 0000000000..949576add0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/comprob10.pg @@ -0,0 +1,72 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Conditional Probability') +## KEYWORDS('probability') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/1/05 +# from pl/setProbability4Conditional/p11.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserPopUp.pl" +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; + +$r =random(0.1,0.9,0.1); +$d = random(0.1,0.9,0.1); +$b = random(0.1,1/(1+$r*(1-$d)),0.05); + + +$a = $r*$b; +$c = $r*$d; + +$pef = $c*$b; + +$ans1 = $a; +$ans2 = $b; +$ans3 = $a+$b - $pef; + +if ($a*$b == $pef ) {$ans="Yes";} else {$ans="No";} +$popup = PopUp(["?","Yes","No"],$ans); + +BEGIN_TEXT +$BR +If \( P(E \text{ and } F) = $pef \), \( P(E \mid F) = $c \), and \( P(F \mid E) = $d \), then $BR +(a) $SPACE \( P(E) = \)\{ans_rule(20)\} $BR +(b) $SPACE \( P(F) = \)\{ans_rule(20)\} $BR +(c) $SPACE \( P(E \text{ or } F) = \)\{ans_rule(20)\} $BR +(d) Are the events \( E \) and \( F \) independent? \{$popup->menu\} + + +END_TEXT + +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Percent($ans3)->cmp); + +ANS($popup->cmp); + + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_2.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_2.pg new file mode 100644 index 0000000000..38d06a37c1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_2.pg @@ -0,0 +1,71 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGauxiliaryFunctions.pl", +"PGanswermacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(0.1,0.9,.1); +$a2 = random(3,4,.1); +$a3 = random(-3,-2,.1); +$nn = random(2,5); +$den = 6; $g = gcd($nn, $den); +$nn = $nn/$g; +$den = $den/ $g; + + +@event = ('event the die comes up even', 'event the die comes up odd', 'event the die comes up with a value of 4 or more', 'event the die comes up with a value at most 2' , 'event the die comes up with a value of 3'); +@ans = ("{2,4,6}", "{1,3,5}", "{4,5,6}", "{1,2}", "{3}"); + +@slice = NchooseK(5,3); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + +BEGIN_TEXT + +One die is rolled. List the outcomes comprising the following events: (use a comma between each outcome): +$PAR + +(a) $sevent[0] $BR +\{ans_rule(20)\} $PAR +(b) $sevent[1] $BR +\{ans_rule(20)\} $PAR +(c) $sevent[2] $BR +\{ans_rule(20)\} $PAR + +END_TEXT +Context("Numeric"); +ANS(Compute($sans[0])->cmp); +ANS(Compute($sans[1])->cmp); +ANS(Compute($sans[2])->cmp); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_4.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_4.pg new file mode 100644 index 0000000000..00f21eae50 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_4.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Mutual Exclusivity') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGauxiliaryFunctions.pl", +"PGanswermacros.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@event = ( +'Are events A and B disjoint?' , +'Are events A and C disjoint?', +'Are events B and C disjoint?', +'Are events A and D disjoint?' , +'Are events A and E disjoint?', +'Are events C and D disjoint?', +'Are events C and E disjoint?', +'Are events A , B and C disjoint?', +'Are events A , B and D disjoint?', +'Are events C, D and E disjoint?'); +@ans = ("Yes", "No", "No", "No", "Yes", "Yes", "Yes", "No", "No", "Yes"); + +@slice = NchooseK(10,5); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + +for my $i (0..4) {$popup[$i] = PopUp(["?","Yes","No"],$sans[$i]);}; + +BEGIN_TEXT + +One die is rolled. Let: $BR $BR + +A = event the die comes up even $BR +B = event the die comes up odd $BR +C = event the die comes up with a value of 4 or more $BR +D = event the die comes up with a value of at most 2 $BR +E = event the die comes up with a value of 3 $BR $BR + +$PAR + +(a) \( \) $sevent[0] +\{$popup[0]->menu\} $PAR +(b) \( \) $sevent[1] +\{$popup[1]->menu\} $PAR +(c) \( \) $sevent[2] +\{$popup[2]->menu\} $PAR +(d) \( \) $sevent[3] +\{$popup[3]->menu\} $PAR +(e) \( \) $sevent[4] +\{$popup[4]->menu\} $PAR + + +END_TEXT + +ANS($popup[0]->cmp); +ANS($popup[1]->cmp); +ANS($popup[2]->cmp); +ANS($popup[3]->cmp); +ANS($popup[4]->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_5.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_5.pg new file mode 100644 index 0000000000..6cebc4172e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_2_5.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@quest1 = ('\( P(A) \)', '\( P(B) \)', '\( P(C) \)', + '\( P(\textrm{not }A) \)', '\( P(\textrm{not }B) \)', '\( P(\textrm{not }C) \)'); +@quest2 = ('\( P(A \textrm{ or } B) \)', '\( P(A \textrm{ and } B) \)', + '\( P(A \textrm{ or } C) \)', '\( P(A \textrm{ and } C) \)', + '\( P(B \textrm{ or } C) \)', '\( P(B \textrm{ and } C) \)', + '\( P(A \textrm{ or } (\textrm{not }B)) \)', '\( P((\textrm{not }A) \textrm{ and } B) \)', + '\( P((\textrm{not }A) \textrm{ or } C) \)', '\( P(A \textrm{ and } (\textrm{not }C)) \)', + '\( P(B \textrm{ or } (\textrm{not }C)) \)', '\( P((\textrm{not }B) \textrm{ and } C) \)',); +@quest3 = ('\( P(A \textrm{ or } B \textrm{ or } C) \)', '\( P(A \textrm{ and } B \textrm{ and } C) \)', + '\( P((\textrm{not }A) \textrm{ or } B \textrm{ or } C) \)', '\( P((\textrm{not }A) \textrm{ or } (\textrm{not }B) \textrm{ or } C) \)', + '\( P((\textrm{not }A) \textrm{ or } B \textrm{ or } (\textrm{not }C)) \)'); + +@ans1 = (7/8, 1/2, 1/2, 1/8, 1/2, 1/2); +@ans2 = (7/8, 1/2, 7/8, 1/2, 7/8, 1/8, 1, 0, 5/8, 3/8, 5/8, 3/8); +@ans3 = (7/8, 1/8, 1, 5/8, 5/8); + +$tag1 = random(0,5,1); +$tag2 = random(0,11,1); +$tag3 = random(0,4,1); + +$LEFT_BRACE = '\{'; +$RIGHT_BRACE = '\}'; + + +BEGIN_TEXT +$PAR +A fair coin is tossed three times and the events \(A\), \(B\), and \(C\) are defined as follows: +$PAR +\( A: $LEFT_BRACE \) At least one head is observed \( $RIGHT_BRACE \) $BR + +\( B: $LEFT_BRACE \) At least two heads are observed \( $RIGHT_BRACE \) $BR + +\( C: $LEFT_BRACE \) The number of heads observed is odd \( $RIGHT_BRACE \) $PAR + +Find the following probabilities by summing the probabilities of the appropriate outcomes: +$PAR +(a) $quest1[$tag1] \( = \) \{ans_rule(5)\} $BR + +(b) $quest2[$tag2] \( = \) \{ans_rule(5)\} $BR + +(c) $quest3[$tag3] \( = \) \{ans_rule(5)\} + +END_TEXT + +Context("Percent"); +ANS(Percent($ans1[$tag1])->cmp); +ANS(Percent($ans2[$tag2])->cmp); +ANS(Percent($ans3[$tag3])->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_5.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_5.pg new file mode 100644 index 0000000000..e340ccff73 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_5.pg @@ -0,0 +1,80 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$a = random(15,60,5)/100; +$b = 1-$a-.1; + + +BEGIN_TEXT +If \(A\) and \(B\) are two disjoint events with +\( P(A)= $a \) and \( P(B)=$b \), find the following probabilities: +$BR +a) $SPACE \(P(A \textrm{ and } B) = \) +\{ ans_rule(10) \} +$BR +b) $SPACE \(P(A \textrm{ or } B) = \) +\{ ans_rule(10) \} +$BR +c) $SPACE \(P( \textrm{not }A ) = \) +\{ ans_rule(10) \} +$BR +d) $SPACE \(P( \textrm{not }B ) = \) +\{ ans_rule(10) \} +$BR +e) $SPACE \(P( \textrm{not }(A \textrm{ or } B)) = \) +\{ ans_rule(10) \} +$BR +f) $SPACE \(P( A \textrm{ and } (\textrm{not }B) ) = \) +\{ ans_rule(10) \} +END_TEXT + +$ans2 = $a +$b; +$ans3 = 1-$a; +$ans4 = 1-$b; +$ans5 = 1-$ans2; +$ans6= $a; + +Context("Percent"); +ANS(Percent( 0 )->cmp ); +ANS(Percent( $ans2 )->cmp ); +ANS(Percent( $ans3 )->cmp ); +ANS(Percent( $ans4 )->cmp ); +ANS(Percent( $ans5 )->cmp ); +ANS(Percent( $ans6 )->cmp ); + + + +ENDDOCUMENT(); # This should be the last executable line in the problem.; diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_6.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_6.pg new file mode 100644 index 0000000000..49c4154560 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/dueck5_3_6.pg @@ -0,0 +1,77 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl" +); + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + + +$a = random(35,50,5)/100; +$c = random(5,20,5)/100; +$b = 1-$a -$c-.05; +$A = $a +$c; +$B = $b +$c; + +BEGIN_TEXT +If \(P(A)=$A, \) \(P(B)=$B \) and +\( P(A \textrm{ and } B)= $c, \) find the following probabilities: +$PAR +a) $SPACE \(P(A \textrm{ or } B) = \) +\{ ans_rule(10) \} +$BR +b) $SPACE \(P( \textrm{not }A ) = \) +\{ ans_rule(10) \} +$BR +c) $SPACE \(P( \textrm{not }B ) = \) +\{ ans_rule(10) \} +$BR +d) $SPACE \(P( A \textrm{ and } (\textrm{not }B) ) = \) +\{ ans_rule(10) \} +$BR +e) $SPACE \(P( \textrm{not }(A \textrm{ and } B)) = \) +\{ ans_rule(10) \} +END_TEXT + +$ans1 = $a+$b+$c; +$ans2 = 1-$A; +$ans3 = 1-$B; +$ans4 = $a; +$ans5 = 1-$c; + +Context("Percent"); +ANS(Percent( $ans1 )->cmp ); +ANS(Percent( $ans2 )->cmp ); +ANS(Percent( $ans3 )->cmp ); +ANS(Percent( $ans4 )->cmp ); +ANS(Percent( $ans5 )->cmp ); + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/kolossa27.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/kolossa27.pg new file mode 100644 index 0000000000..8515e17e74 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/kolossa27.pg @@ -0,0 +1,97 @@ +##DESCRIPTION +## Statistics: Random sampling +##ENDDESCRIPTION + +##KEYWORDS('probability','random sampling', 'probability distributions') +## Tagged by sawblade + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@event = ('\(A\)','\(B\)', '\(C\)','\(D\)', + 'not \(B\)', 'not \(D\)', 'not \(A\)', + '\(C\) and \(D\)', '\(B\) and \(D\)', + '\(A\) and \(D\)', 'not \(C\)', + '\(A\) or \(D\)', '\(A\) or \(C\)'); + +$a = .01; +$b = .41; +$c = .99; +$d = .56; +$e = .59; +$f = .44; +$g = .55; +$h = .42; +$k = 1; + +@ans = ($a, $b, $c, $d, $e, $f, $c, $g, $b,$a,$a, $d,$k); + +@slice = NchooseK(13,5); +@sevent = @event[@slice]; +@sans = @ans[@slice]; + +BEGIN_TEXT + +The age distribution for senators in the 104th U.S. Congress was as follows: $PAR +$BCENTER +\{begintable(6)\} +\{row("age", "under 40", "40-49", "50-59", "60-69", "70 and over")\} +\{row("no. of senators", "1", "14", "41", "27", "17")\} +\{endtable()\} +$ECENTER +$PAR +A senator from the 104th Congress is chosen at random. Consider the following four events: $PAR + +\(A\) = the senator is under 40 $BR +\(B\) = the senator is in his or her 50s $BR +\(C\) = the senator is 40 or older $BR +\(D\) = the senator is under 60 $BR + +$PAR + +Find each probability expressed below: $PAR $BR + +(a) \(P(\)$sevent[0]\() =\) \{ans_rule(10)\} $PAR +(b) \(P(\)$sevent[1]\() =\) \{ans_rule(10)\} $PAR +(c) \(P(\)$sevent[2]\() =\) \{ans_rule(10)\} $PAR +(d) \(P(\)$sevent[3]\() =\) \{ans_rule(10)\} $PAR +(e) \(P(\)$sevent[4]\() =\) \{ans_rule(10)\} + +END_TEXT + +Context("Percent"); +ANS(Percent($sans[0])->cmp); +ANS(Percent($sans[1])->cmp); +ANS(Percent($sans[2])->cmp); +ANS(Percent($sans[3])->cmp); +ANS(Percent($sans[4])->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/kolossa7.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/kolossa7.pg new file mode 100644 index 0000000000..93a77cfb4c --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/kolossa7.pg @@ -0,0 +1,90 @@ +##DESCRIPTION +##KEYWORDS('probability','random sampling', 'probability distributions') +## +##ENDDESCRIPTION + +## Tagged by sawblade + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Binomial Distribution') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(18,20,1); +$a2 = $a1+1; +$a3 = $a2+1; +$a4 = $a3+1; +$a5 = $a4+1; + +$f2 = random(1,10,1); +$f1 = random(5,25,1); +$f3 = random(4,14,1); +$f4 = random(2,8,1); +$f5 = random(1,5,1); + +$n = $f1+$f2+$f3+$f4+$f5; + +@event = ("P(x=$a3)", + "P(x>$a2)", + "P(x\ge $a2)", + "P(x\le $a4)", + "P(x\ge $a4 \mbox{ or } x<$a2)", + "P(x<$a5)", + "P(x=$a1)", + "P($a1\le x <$a3)"); + +@ans = ("$f3/$n", "($f3+$f4+$f5)/$n", "($f2+$f3+$f4+$f5)/$n", "($f1+$f2+$f3+$f4)/$n", "($f4+$f5+$f1)/$n", "($f1+$f2+$f3+$f4)/$n", "$f1/$n", +"($f1+$f2)/$n"); + +@slice = NchooseK(8,3); +@sevent = @event[@slice]; +@sans = @ans[@slice]; + +BEGIN_TEXT +Let \( x \) be the ages of students in a MTH 111 class. Given the frequency distribution \( F(x) \) below, determine the following probabilities: +$PAR +$BCENTER +\{begintable(6)\} +\{row("\(x\)", "\($a1\)", "\($a2\)", "\($a3\)", "\($a4\)", "\($a5\)")\} +\{row("\(F(x)\)", "\($f1\)", "\($f2\)", "\($f3\)", "\($f4\)", "\($f5\)")\} +\{endtable()\} +$ECENTER +$PAR +(a) \( $sevent[0] =\) \{ans_rule(10)\} $PAR +(b) \( $sevent[1] =\) \{ans_rule(10)\} $PAR +(c) \( $sevent[2]=\) \{ans_rule(10)\} + + +END_TEXT +Context("Percent"); + +ANS(Percent($sans[0])->cmp); +ANS(Percent($sans[1])->cmp); +ANS(Percent($sans[2])->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/p1.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/p1.pg new file mode 100644 index 0000000000..7c8131d98f --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/p1.pg @@ -0,0 +1,82 @@ +##DESCRIPTION +## Probability distributions +##ENDDESCRIPTION + +## KEYWORDS('Random Variable', 'Probability Density Function', 'PDF', 'Probability Distribution') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Random Variables') +## Date('') +## Author('') +## Institution('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + + +$b[0] = random(0,.3,.1); +$b[1] = random(.1,.3,.1); +$b[2] = random(.1,.3,.1); +$b[3] = 1-$b[0]-$b[1]-$b[2]; + +$b1 = random(0,.3,.1); +$b2 = random(.1,.3,.1); +$b3 = random(-.3,-.1,.1); +$b4 = 1-$b1-$b2-$b3; + +$a = random(2,5,1); + + +@second_row = ($b[0], $b[1], $b[2], $b[3]); +@slice = NchooseK(4,4); +@ssecond_row = @second_row[@slice]; + +$popup1 = PopUp(["?","This is a valid probability model","This is not a valid probability model"],"This is a valid probability model"); +$popup2 = PopUp(["?","This is a valid probability model","This is not a valid probability model"],"This is not a valid probability model"); + +BEGIN_TEXT + +Determine whether the following are valid probability models or not. $PAR +(a) +\{begintable(5)\} +\{row("Event", "\( e_1\)", "\( e_2\)", "\(e_3\)", "\( e_4\)")\} +\{row(" Probability", "\($ssecond_row[0]\)", "\($ssecond_row[1]\)", "\($ssecond_row[2]\)", "\($ssecond_row[3]\)" )\} +\{endtable()\} + + \{$popup1->menu\}$PAR + +(b) +\{begintable(5)\} +\{row("Event", "\( e_1\)", "\( e_2\)", "\( e_3\)", "\( e_4\)")\} +\{row(" Probability ", "\($b1\)", "\($b2\)", "\($b3\)", "\($b4\)" )\} +\{endtable()\} + + \{$popup2->menu\} + +END_TEXT +ANS($popup1->cmp); +ANS($popup2->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/spinner1.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/spinner1.pg new file mode 100644 index 0000000000..6459cddfac --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/spinner1.pg @@ -0,0 +1,60 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## KEYWORDS('probability') +## Author('N. Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/15/05 +# Location: Northern Arizona University + +DOCUMENT(); + +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGnauStats.pl", + "MathObjects.pl", + "contextPercent.pl", +); + +TEXT(&beginproblem); +$n = random(3 ,4, 1 ); +for( $i = 0; $i < $n; $i++ ){ $val = random( 1, 4, 1 ); +push @list, $val; +} +$total = 0; +foreach $val(@list){$sum = $total + $val; + $total = $sum; +} +$pic = PieChart( @list ); +@letter = ( 'an A', 'a B', 'a C', 'a D' ); +$ind1 = random( 0, $n - 1, 1 ); +$ind2 = random( 0, $n - 1, 1 ); +@slice = NchooseK( $n, 2 ); +$ans1 = ( $list[$ind1] * $list[$ind2] ) / $sum ** 2; +$nss = $sum - $list[$slice[1]]; +$ans2 = $list[$slice[0]] / $nss; + +BEGIN_TEXT + +Based on the spinner below answer the following:$PAR +(a) In two consecutive spins what, is the probability of $letter[$ind1] followed by $letter[$ind2]? +$BR \{ ans_rule( 15 ) \} $PAR +(b) In a single spin, what is the probability of obtaining $letter[$slice[0]] given the spinner did not land on +$letter[$slice[1]]? +$BR \{ ans_rule( 15 ) \} $PAR +$PAR +$BCENTER +\{ Plot($pic) \} +$ECENTER +END_TEXT +Context("Percent"); + +ANS( Percent( $ans1 )->cmp ); +ANS( Percent( $ans2 )->cmp ); + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/sspaces1.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/sspaces1.pg new file mode 100644 index 0000000000..45c1d565da --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/sspaces1.pg @@ -0,0 +1,53 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Discrete Probability') +## DBsection('Events/Probability Calculation') +## KEYWORDS('probability') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 6/17/05 +# from setProbability1Combinations/ur_pb_1_5.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,4,1); +$b = random(($a+1),9,1); + +$ans1 = 2**$a; +$ans2 = 2**$b; +$ans3 = "2^n"; + +BEGIN_TEXT + +Determine the size of the sample space that corresponds to the experiment of +tossing a coin the following number of times:$PAR +(a) $SPACE \($a\) times $PAR + \{ans_rule(10)\} $PAR +(b) $SPACE \($b\) times $PAR + \{ans_rule(10)\} $PAR +(c) $SPACE \(n\) times (the answer to this part is not a number; it is a formula with \(n\) in it)$PAR + \{ans_rule(10)\} + +END_TEXT +ANS(num_cmp($ans1)); +ANS(num_cmp($ans2)); +ANS(function_cmp($ans3, "n")); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-07.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-07.pg new file mode 100644 index 0000000000..434ddd9456 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-07.pg @@ -0,0 +1,57 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('conditional', 'probability') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/7/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +do {$a = random(.15,.35,.01); +$b = random(.59,.89,.01); +$banda = random(.26,.44,.01);} until (($banda < $a) and ($banda < $b) and ($a + $b - $banda) < 1); +# edited this way to preserve existing, unbroken versions + +BEGIN_TEXT +Suppose that \(A\) and \(B\) are two events for which +\(P(A) = $a\), \(P(B) = $b\), and \(P(A\;\mathrm{and}\;B) = $banda\) Find +\(P(A\mid B)\). +$PAR +\(P(A\mid B) = \) \{ans_rule(15)\} +$BR + + +END_TEXT +Context("Percent"); +ANS(Percent($banda/$b)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-11.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-11.pg new file mode 100644 index 0000000000..1b95785ca3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-11.pg @@ -0,0 +1,62 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/7/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$a = random(.15,.35,.01); +$b = random(.55,.85,.01); + +BEGIN_TEXT +$PAR +Suppose that \(A\) and \(B\) are two independent events for which \(P(A) = $a\) and \(P(B) = $b\). Find each of the following: +$PAR +A. \(P(A\mid B) = \) \{ans_rule(15)\} +$PAR +B. \(P(B\mid A) = \) \{ans_rule(15)\} +$PAR +C. \(P(A\;\mathrm{and}\;B) = \) \{ans_rule(15)\} +$PAR +D. \(P(A\;\mathrm{or}\;B) = \) \{ans_rule(15)\} + + +END_TEXT +Context("Percent"); +ANS(Percent($a)->cmp); +ANS(Percent($b)->cmp); +ANS(Percent($a*$b)->cmp); +ANS(Percent($a+$b-$a*$b)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-12.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-12.pg new file mode 100644 index 0000000000..3a4d1d4b41 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-12.pg @@ -0,0 +1,60 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/7/2005') +## Author('Jeff Holt') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + +$a = random(.15,.35,.01); +$b = random(.55,.65,.01); +$bga = random(.36,.54,.01); + +BEGIN_TEXT +Suppose that \(A\) and \(B\) are two events for which \(P(A) = $a\), \(P(B) = $b\), and \(P(B\mid A) = $bga\) Find each of the following: +$PAR +A. \(P(A\;\mathrm{and}\;B) = \) \{ans_rule(15)\} +$PAR +B. \(P(A\;\mathrm{or}\;B) = \) \{ans_rule(15)\} +$PAR +C. \(P(A\mid B) = \) \{ans_rule(15)\} + + +END_TEXT +Context("Percent"); + +ANS(Percent($a*$bga)->cmp); +ANS(Percent($a+$b-$a*$bga)->cmp); +ANS(Percent($a*$bga/$b)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-13.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-13.pg new file mode 100644 index 0000000000..87ceed7582 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-13.pg @@ -0,0 +1,72 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/9/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a1 = random(.02,.08,.01); +$a2 = random(.48,.55,.01); +$c1 = random(.10,.16,.01); +$c2 = 0.01*floor(100*(1-($a1+$a2+$c1))+.5); + +BEGIN_TEXT +$PAR +A telephone company has classified its customers in two ways: according to whether their account is overdue and whether the account is new (less than 12 months) or old. An analysis of the company's records provided the input for the following table of joint probabilities: + +$PAR +$BCENTER +\{begintable(4)\} +\{row(" ", "Overdue", "Not overdue")\} +\{row("New", "$a1", "$c1")\} +\{row("Old", $a2, $c2)\} +\{endtable()\} +$ECENTER +$PAR +One account is selected at random. + + +$PAR +A. If the account is overdue, what is the probability that it is new? \{ans_rule(15)\} +$PAR +B. If the account is new, what is the probability that it is overdue? \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +ANS(Percent($a1/($a1+$a2))->cmp); +ANS(Percent($a1/($a1+$c1))->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-14.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-14.pg new file mode 100644 index 0000000000..e8f96c2984 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-14.pg @@ -0,0 +1,76 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/9/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a1 = random(.28,.34,.01); +$a2 = random(.20,.26,.01); +$c1 = random(.22,.27,.01); +$c2 = 0.01*floor(100*(1-($a1+$a2+$c1))+.5); + +#\multicolumn{1}{c}{} & \multicolumn{2}{c}{\mbox{Computer Usage}} \\ +BEGIN_TEXT +According to the U.S. National Center for Education Statistics, there are more +than 63 million American workers 18 years old and over who use computers at work. +From this study, which was conducted in 1994 and 1998 (Source: Statistical Abstract of the United States, 2000, Table 690), the following table of joint probabilities was developed. + +$PAR +$PAR + +\[ +\begin{array}{c||c|c} +& \mbox{Uses Spreadsheet Software} & \mbox{No Spreadsheet Use} \\ \hline +\mbox{Female} & $a1 & $c1 \\ \hline +\mbox{Male} & $a2 & $c2 +\end{array} +\] + +$PAR +A. What proportion of workers use spreadsheet software? \{ans_rule(15)\} +$PAR +B. What proportion of male workers use spreadsheet software? \{ans_rule(15)\} +$PAR +C. What proportion of spreadsheet users are female? \{ans_rule(15)\} +$PAR + +END_TEXT +Context("Percent"); +ANS(Percent($a1+$a2)->cmp); +ANS(Percent($a2/($a2+$c2))->cmp); +ANS(Percent($a1/($a1+$a2))->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-15.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-15.pg new file mode 100644 index 0000000000..0aab2895b4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW03-15.pg @@ -0,0 +1,81 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/9/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a1 = random(.08,.12,.01); +$a2 = random(.14,.20,.01); +$c1 = random(.03,.05,.01); +$c2 = 0.01*floor(100*(1-($a1+$a2+$c1))+.5); + +BEGIN_TEXT +$PAR +The following table lists the joint probabilities associated with smoking and +lung disease among 60-to-65 year-old men. + +$PAR +$PAR + +\[ +\begin{array}{c|c|c} +& \mbox{Smoker} & \mbox{Nonsmoker} \\ \hline +\mbox{Has Lung Disease} & $a1 & $c1 \\ \hline +\mbox{No Lung Disease} & $a2 & $c2 +\end{array} +\] + +$PAR +One 60-to-65 year old man is selected at random. What is the probability of the following events? + +$PAR +A. He is a smoker: \{ans_rule(15)\} +$PAR +B. He does not have lung disease: \{ans_rule(15)\} +$PAR +C. He has lung disease given that he is a smoker: \{ans_rule(15)\} +$PAR +D. He has lung disease given that he does not smoke: \{ans_rule(15)\} + +END_TEXT +Context("Percent"); + +ANS(Percent($a1+$a2)->cmp); +ANS(Percent($a2+$c2)->cmp); +ANS(Percent($a1/($a1+$a2))->cmp); +ANS(Percent($c1/($c1+$c2))->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-04.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-04.pg new file mode 100644 index 0000000000..d396399e53 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-04.pg @@ -0,0 +1,74 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/10/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + + + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + + +$a = random(35,45,1); +$b = random(65,75,1); +$c = random(45,55,1); +$d = .01*$a; +$e = .01*$b; +$f = .01*$c; + +BEGIN_TEXT +$PAR +An aerospace company has submitted bids on two separate federal government defense contracts. The company president believes that there is a $a$PERCENT +probability of winning the first contract. If they win the first contract, the probability of winning the second is $b$PERCENT. However, if they lose the first contract, the president thinks that the probability of winning the second contract decreases to $c$PERCENT. +$PAR +A. What is the probability that they win both contracts? +\{ans_rule(15)\} +$PAR +B. What is the probability that they lose both contracts? +\{ans_rule(15)\} +$PAR +C. What is the probability that they win only one contract? +\{ans_rule(15)\} + +$BR + +END_TEXT + +Context("Percent"); +ANS(Percent($d*$e)->cmp ); +ANS(Percent((1-$d)*(1-$f))->cmp); +ANS(Percent($d*(1-$e)+(1-$d)*$f)->cmp ); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-09.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-09.pg new file mode 100644 index 0000000000..b405b5e2af --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-09.pg @@ -0,0 +1,63 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/10/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + + + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + + +$a = random(10,55,1); +$b = random(2,5,1); +$c = random(15,25,1); +$d = .01*$a; +$e = .01*$b; +$f = .01*$c; +$g = 1 - $d; + +BEGIN_TEXT +$PAR +A foreman for an injection-molding firm admits that on $a$PERCENT of his shifts, he forgets to shut off the injection machine on his line. This causes the machine to overheat, increasing the probability that a defective molding will be produced during the early morning run from $b$PERCENT to $c$PERCENT. If a molding is randomly selected from the early morning run of a random day, what is the probability that it is defective? +$PAR +The probability is \{ans_rule(15)\}. + +$BR + +END_TEXT +Context("Percent"); +ANS(Percent($d*$f+$g*$e)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-10.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-10.pg new file mode 100644 index 0000000000..3eb352e3a1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-10.pg @@ -0,0 +1,63 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/10/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + + + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + + +$a = random(30,40,1); +$b = random(20,30,1); +$c = random(20,30,1); +$d = .01*$a; +$e = .01*$b; +$f = .01*$c; +$g = 1-$f; + +BEGIN_TEXT +$PAR +Researchers at the University of Pennsylvania School of Medicine have determined that children under 2 years old who sleep with the lights on have a $a$PERCENT chance of becoming myopic before they are 16. Children who sleep in darkness have a $b$PERCENT probability of becoming myopic. A survey indicates that $c$PERCENT of children under 2 sleep with some light on. Find the probability that a random child under 2 will become myopic before reaching 16 years old. +$PAR +The probability is \{ans_rule(15)\}. + +$BR + +END_TEXT +Context("Percent"); +ANS(Percent($d*$f+$g*$e)->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-11.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-11.pg new file mode 100644 index 0000000000..d9d44feb1c --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-11.pg @@ -0,0 +1,64 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/13/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + + + + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; # Change to 0 to shut off separate answer display. +## install_problem_grader(~~&std_problem_grader); # Uncomment to turn off partial credit. + + +$a = random(10,55,1); +$b = random(2,5,1); +$c = random(15,25,1); +$d = .01*$a; +$e = .01*$b; +$f = .01*$c; +$g = 1 - $d; + +BEGIN_TEXT +$PAR +A foreman for an injection-molding firm admits that on $a$PERCENT of his shifts, he forgets to shut off the injection machine on his line. This causes the machine to overheat, increasing the probability that a defective molding will be produced during the early morning run from $b$PERCENT to $c$PERCENT. The plant manager randomly selects a molding from the early morning run and discovers it is defective. What is the probability that the foreman +forgot to shut off the machine the previous night? +$PAR +The probability is \{ans_rule(15)\}. + +$BR + +END_TEXT +Context("Percent"); +ANS(Percent($d*$f/(($d*$f)+($g*$e)))->cmp ); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-20.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-20.pg new file mode 100644 index 0000000000..cdb961282e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/stat212-HW04-20.pg @@ -0,0 +1,74 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('probability', 'conditional') +## naw tagged this problem. + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('6/14/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; +## install_problem_grader(~~&std_problem_grader); + +$a1 = random(.20,.25,.01); +$a2 = random(.10,.15,.01); +$a3 = random(.50,.60,.01); +$a4 = 1-($a1+$a2+$a3); + +BEGIN_TEXT +$PAR +The owner of an appliance store is interested in the relationship between the price at which an item is sold (regular or sale price) and the customer's decision on whether to purchase and extended warranty. After analyzing her records, she produced the following joint probabilities: + +\[ +\begin{array}{c|c|c} + & \mbox{Purchased} & \mbox{Did not purchase} \\ + & \mbox{extended warranty} & \mbox{extended warranty} \\ \hline +\mbox{Regular Price} & $a1 & $a3 \\ \hline +\mbox{Sale Price} & $a2 & $a4 \\ +\end{array} +\] + + +$PAR +A. What is the probability that a customer who bought an item at the regular price purchased the extended warranty? +\{ans_rule(15)\} +$PAR +B. What is the probability that a customer buys an extended warranty? +\{ans_rule(15)\} + +$PAR + +END_TEXT +Context("Percent"); + +ANS(Percent($a1/($a1+$a3))->cmp); +ANS(Percent($a1+$a2)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_11.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_11.pg new file mode 100644 index 0000000000..b5fb1109b4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_11.pg @@ -0,0 +1,66 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@a = (3,4,5); +@b = (4,5,6); + +@slice1 = NchooseK(3,1); +@slice2 = NchooseK(3,1); + +@sa = @a[@slice1]; +@sb = @b[@slice2]; + +$ans1 = (($sb[0]-1)/$sb[0])**($sa[0]); +$ans2 = (1/$sb[0])**($sa[0]); + +BEGIN_TEXT +A quick quiz consists of \($sa[0]\) multiple choice problems, each of which has \($sb[0]\) answers, only one of +which is correct. If you make random guesses on all \($sa[0]\) problems, +$PAR +(a) What is the probability that all \($sa[0]\) of your answers are incorrect? $PAR +\{ans_rule(10)\} $PAR +(b) What is the probability that all \($sa[0]\) of your answers are correct?$PAR +\{ans_rule(10)\} + +END_TEXT + +Context("Percent"); +ANS(Percent($ans1)->cmp); +Context("Percent")->flags->set( + decimalPlaces => 2, + tolerance => .00005, + ); +ANS(Percent($ans2)->cmp()); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_12.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_12.pg new file mode 100644 index 0000000000..b7b2f453c2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_12.pg @@ -0,0 +1,90 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(2,4,1); +$b = random(8,13,1); +$c = random(2,4,1); +$d = random(3,6,1); +$e = random(15,25,1); +$f = random(10,20,1); +$g = random(6,15,1); + +$span = $e + $b + $a + $c; +$fren = $f + $b + $a + $d; +$ger = $c + $a + $d + $g; + +$sp_fr = $a + $b; +$sp_ger = $a + $c; +$fr_ger = $a + $d; + +$some = $a + $b + $c + $d + $e + $f + $g; + +$none = random(20,40,1); + +$total = $some + $none; + +@quest1 = ("not in any of these classes?", "taking exactly one language class?", "taking at least one language class?", + "taking exactly two language classes?", "taking at least two language classes?"); +@ans1 = ($none/$total, ($e + $f + $g)/$total, $some/$total, ($b + $c + $d)/$total, ($a + $b + $c + $d)/$total); + +$tag1 = random(0,4,1); + +@quest2 = ("at least one of them is taking a language class?", "neither of them is taking a language class?", + "both of them are taking French?", "neither of them is taking Spanish?", + "at least one of them is taking German?"); + +@ans2 = ( (1 - $none*($none - 1)/$total/($total - 1)), $none*($none - 1)/$total/($total - 1), + $fren/$total*($fren - 1)/($total - 1), ($total - $span)/$total*($total - $span - 1)/($total - 1), + (1 - ($total - $ger)/$total*($total - $ger - 1)/($total - 1))); + +$tag2 = random(0,4,1); + +BEGIN_TEXT + +An elementary school is offering 3 language classes: one in Spanish, one in French, and one in German. These classes are open to any of the $total students in the school. There are $span in the Spanish class, $fren in the French class, and $ger in the German class. There are $sp_fr students that in both Spanish and French, $sp_ger are in both Spanish and German, and $fr_ger are in both French and German. In addition, there are $a students taking all 3 classes. $BR + +If one student is chosen randomly, what is the probability that he or she is $quest1[$tag1] \{ans_rule(20)\} $BR + +If two students are chosen randomly, what is the probability that $quest2[$tag2] \{ans_rule(20)\} $BR + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1[$tag1])->cmp); +ANS(Percent($ans2[$tag2])->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_2.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_2.pg new file mode 100644 index 0000000000..e515eb7beb --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_2.pg @@ -0,0 +1,102 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(1,6,1); +$b = random(1,7,1); +$c = $b - 1; +$d = random(7,12,1); +$e = 13 - $d; + +@quest1 = ("A $a appears on each of the two dice", + "A $a appears on at least one of the dice", + "A $a appears on exactly one of the dice", + "A $a does not appear on either die"); + +@quest2 = ("The sum of the numbers is even", + "The sum of the numbers is odd"); + +@quest3 = ("The sum of the numbers is equal to $b", + "The sum of the numbers is equal to $d", + "The sum of the numbers is 10 or more", + "The sum of the numbers is 5 or less"); + +@quest4 = ("The difference of the numbers is 1", + "The difference of the numbers is 2", + "The difference of the numbers is 2 or less", + "The difference of the numbers is 3"); + +@ans1 = (1/36, 11/36, 5/18, 25/36); +@ans2 = (1/2, 1/2); +@ans3 = ($c/36, $e/36, 1/6, 5/18); +@ans4 = (5/18, 2/9, 2/3, 1/6); + +$tag1 = random(0,3,1); +$tag2 = random(0,1,1); +$tag3 = random(0,2,1); +$tag4 = random(0,3,1); + +@quest = ($quest1[$tag1],$quest2[$tag2],$quest3[$tag3],$quest4[$tag4]); +@ans = ($ans1[$tag1],$ans2[$tag2],$ans3[$tag3],$ans4[$tag4]); + +@slice = NchooseK(4,3); +@squest = @quest[@slice]; +@sans = @ans[@slice]; + +$LEFT_BRACE='\{'; +$RIGHT_BRACE='\}'; + +BEGIN_TEXT +$PAR + +Two fair dice are tossed, and the up face on each die is recorded. +Find the probability of observing each of the following events: $PAR + +\(A: $LEFT_BRACE \) $squest[0] \( $RIGHT_BRACE \) $BR + +\(B: $LEFT_BRACE \) $squest[1] \( $RIGHT_BRACE \) $BR + +\(C: $LEFT_BRACE \) $squest[2] \( $RIGHT_BRACE \) $PAR + +\(P(A)= \) \{ans_rule(5)\} $BR +\( P(B)= \) \{ans_rule(5)\} $BR +\( P(C)= \) \{ans_rule(5)\} $BR + +END_TEXT +Context("Percent"); +ANS(Percent($sans[0])->cmp); +ANS(Percent($sans[1])->cmp); +ANS(Percent($sans[2])->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_4.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_4.pg new file mode 100644 index 0000000000..5f35b6cebb --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_4.pg @@ -0,0 +1,86 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@quest1 = ('\( P(A) \)', '\( P(B) \)', '\( P(C) \)', + '\( P(A^c) \)', '\( P(B^c) \)', '\( P(C^c) \)'); +@quest2 = ('\( P(A \cup B) \)', '\( P(A \cap B) \)', + '\( P(A \cup C) \)', '\( P(A \cap C) \)', + '\( P(B \cup C) \)', '\( P(B \cap C) \)', + '\( P(A \cup B^c) \)', '\( P(A^c \cap B) \)', + '\( P(A^c \cup C) \)', '\( P(A \cap C^c) \)', + '\( P(B \cup C^c) \)', '\( P(B^c \cap C) \)',); +@quest3 = ('\( P(A \cup B \cup C) \)', '\( P(A \cap B \cap C) \)', + '\( P(A^c \cup B \cup C) \)', '\( P(A^c \cup B^c \cup C) \)', + '\( P(A^c \cup B \cup C^c) \)'); + +@ans1 = (7/8, 1/2, 1/2, 1/8, 1/2, 1/2); +@ans2 = (7/8, 1/2, 7/8, 1/2, 7/8, 1/8, 1, 0, 5/8, 3/8, 5/8, 3/8); +@ans3 = (7/8, 1/8, 1, 5/8, 5/8); + +$tag1 = random(0,5,1); +$tag2 = random(0,11,1); +$tag3 = random(0,4,1); + +$LEFT_BRACE = '\{'; +$RIGHT_BRACE = '\}'; + + +BEGIN_TEXT +$PAR +A fair coin is tossed three times and the events \(A\), \(B\), and \(C\) are defined as +follows: +$PAR +\( A: $LEFT_BRACE \) At least one head is observed \( $RIGHT_BRACE \) $BR + +\( B: $LEFT_BRACE \) At least two heads are observed \( $RIGHT_BRACE \) $BR + +\( C: $LEFT_BRACE \) The number of heads observed is odd \( $RIGHT_BRACE \) $PAR + +Find the following probabilities by summing the probabilities of the appropriate outcomes: +$PAR +(a) $quest1[$tag1] \( = \) \{ans_rule(5)\} $BR + +(b) $quest2[$tag2] \( = \) \{ans_rule(5)\} $BR + +(c) $quest3[$tag3] \( = \) \{ans_rule(5)\} + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1[$tag1])->cmp); +ANS(Percent($ans2[$tag2])->cmp); +ANS(Percent($ans3[$tag3])->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_6.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_6.pg new file mode 100644 index 0000000000..dd51314d63 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_3_6.pg @@ -0,0 +1,129 @@ +## DESCRIPTION +## Compute Discrete Probabilities +## ENDDESCRIPTION + +## KEYWORDS('Probability', 'Discrete') +## Tagged by nhamblet + +## DBsubject('Algebra') +## DBchapter('Counting and Probability') +## DBsection('Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +#define the graph +$graph_object = init_graph(-10,-10,10,10); +$f1 = FEQ ("sqrt(25-(x-3)**2) for x in <-2, 8> using color=blue and weight=2"); +$f2 = FEQ ("-sqrt(25-(x-3)**2) for x in <-2, 8> using color=blue and weight=2"); +$f3 = FEQ ("sqrt(25-(x+3)**2) for x in <-8, 2> using color=blue and weight=2"); +$f4 = FEQ ("-sqrt(25-(x+3)**2) for x in <-8, 2> using color=blue and weight=2"); +($f1Ref, $f2Ref, $f3Ref, $f4Ref) = plot_functions($graph_object, $f1, $f2, $f3, $f4); + +#add labels to the graph +$label_point1= new Label (-4, 3, '1','black', ('center', 'middle')); +$label_point2= new Label (0, 2, '2','black', ('center', 'middle')); +$label_point3= new Label (0, -1, '3', 'black',('center', 'middle')); +$label_point4= new Label (4, 2.5, '4', 'black',('center', 'middle')); +$label_point5= new Label (-5, 0, '5', 'black',('center', 'middle')); +$label_point6= new Label (-4, -3, '6','black', ('center', 'middle')); +$label_point7= new Label (4, -2.5, '7', 'black',('center', 'middle')); +$label_point8= new Label (-3, 6.5, 'A', 'red',('center', 'middle')); +$label_point9= new Label (3, 6.5, 'B', 'red',('center', 'middle')); + +#insert labels into the graph +$graph_object->lb($label_point1, $label_point2, $label_point3, $label_point4, +$label_point5, $label_point6, $label_point7, $label_point8, $label_point9); + +#define the variables +$a = random(0.05,0.15,0.05); +$b = random(0.05,0.15,0.05); +while ($b == $a) {$b = random(0.05,0.1,0.05);} +$c = 1-4*$a-2*$b; + +#define the events +$event1 = '\( P(A) \)'; +$event2 = '\( P(B) \)'; +$event3 = '\( P(A \cup B) \)'; +$event4 = '\( P(A \cap B) \)'; +$event5 = '\( P(A^c) \)'; +$event6 = '\( P(B^c) \)'; +$event7 = '\( P(A \cup A^c) \)'; +$event8 = '\( P(A^c \cap B) \)'; + +#give the answers +$ans1 = (3*$a)+ $b+$c; +$ans2 = (3*$a)+ $b; +$ans3 = 1; +$ans4 = 2*$a; +$ans5 = 1- ((3*$a)+$b+$c); +$ans6 = 1- ((3*$a)+$b); +$ans7 = 1; +$ans8 = $a+$b; + +@events = ($event1, $event2, $event3, $event4, $event5, $event6, $event7, $event8); +@ans = ($ans1, $ans2, $ans3, $ans4, $ans5, $ans6, $ans7, $ans8); + +@slice = NchooseK(8,4); +@sevents = @events[@slice]; +@sans = @ans[@slice]; + + +BEGIN_TEXT + +A sample space contains 7 outcomes and events \(A\) and \(B\) as seen in +the Venn diagram. $PAR +Let: +$BR +\( P(1)=P(2)=P(3)=P(7)=$a \) $BR +\( P(4)=P(5)=$b \) $BR +and \( P(6)=$c \).$PAR + +$BCENTER +\{ image(insertGraph($graph_object), height=>400, width=>400) \} +$ECENTER + +$BR + +Use the Venn diagram and the probabilities of the outcomes to find: $PAR +(a) \( \) $sevents[0] \(=\) \{ans_rule(5)\} $BR + +(b) \( \) $sevents[1] \(=\) \{ans_rule(5)\} $BR + +(c) \( \) $sevents[2] \(=\) \{ans_rule(5)\} $BR + +(d) \( \) $sevents[3] \(=\) \{ans_rule(5)\}$PAR + + +END_TEXT +Context("Percent"); +Context()->flags->set( + decimalPlaces => 2, + tolerance => .00005, + ); +ANS(Percent($sans[0])->cmp); +ANS(Percent($sans[1])->cmp); +ANS(Percent($sans[2])->cmp); +ANS(Percent($sans[3])->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_1.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_1.pg new file mode 100644 index 0000000000..8143c9192d --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_1.pg @@ -0,0 +1,56 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('Conditional', 'Probability') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(0.2,0.5,0.1); +$b = random(0.6,0.9,0.1); +$d = 0; +if ($a + $b > 1 ) {$d = $a + $b -1;} +$c = random($d,$a,0.05); +$ans1 = $c / $b; +$ans2 = $c / $a; + +BEGIN_TEXT +If \( P(A) = $a \), \( \ P(B) = $b \), and \( \ P(A \cap B) = $c \), then $BR +(a) \( P(A\mid B) = \)\{ans_rule(10)\} and $BR +(b) \( P(B\mid A) = \)\{ans_rule(10)\} + +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_2.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_2.pg new file mode 100644 index 0000000000..b11afc0e00 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_2.pg @@ -0,0 +1,110 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('Conditional', 'Probability') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = Real(random(0.05,0.25,0.05)); +$ra = 1-$a; +$rra = $ra - 0.25; +$b = Real(random(0.05,$rra,0.05)); +$rb = $ra - $b; +$rrb = $rb - 0.2; +$c = Real(random(0.05,$rrb,0.05)); +$rc = $rb - $c; +$rrc = $rc-0.15; +$d = Real(random(0.05,$rrc,0.05)); +$rd = $rc - $d; +$rrd = $rd-0.05; +$e = Real(random(0.05,$rrd,0.05)); +$f = $rd - $e; + +$graph = init_graph(-12,-8,12,8); +$f1 = FEQ("sqrt(25-x^2) for x in <-5,5> using color:blue and weight:2"); +$f2 = FEQ("-sqrt(25-x^2) for x in <-5,5> using color:blue and weight:2"); +$f3 = FEQ("sqrt(25-(x-6)^2) for x in <1,11> using color:green and weight:2"); +$f4 = FEQ("-sqrt(25-(x-6)^2) for x in <1,11> using color:green and weight:2"); +$f5 = FEQ("sqrt(25-(x+6)^2) for x in <-11,-1> using color:red and weight:2"); +$f6 = FEQ("-sqrt(25-(x+6)^2) for x in <-11,-1> using color:red and weight:2"); + +($f1Ref,$f2Ref,$f3Ref,$f4Ref,$f5Ref,$f6Ref) = plot_functions($graph,$f1,$f2,$f3,$f4,$f5,$f6); + +$label_a = new Label (-0, 5, 'B', 'blue', 'center', 'bottom'); +$label_b = new Label (-6, 5, 'A', 'red', 'center', 'bottom'); +$label_c = new Label (6, 5, 'C', 'green', 'center', 'bottom'); + +$label_1 = new Label (-8, 2, '1', 'black', 'center', 'middle'); +$label_2 = new Label (-8, -2, '2', 'black', 'center', 'middle'); +$label_3 = new Label (-3, 0, '3', 'black', 'center', 'middle'); +$label_4 = new Label (0, 3, '4', 'black', 'center', 'middle'); +$label_5 = new Label (3, 0, '5', 'black', 'center', 'middle'); +$label_6 = new Label (7, 0, '6', 'black', 'center', 'middle'); + +$graph->lb($label_a,$label_b,$label_c,$label_1,$label_2,$label_3,$label_4,$label_5,$label_6); + +@quest1 = ('\( P(A) \)', '\( P(B) \)', '\( P(C) \)', + '\( P(A^c) \)', '\( P(B^c) \)', '\( P(C^c) \)'); +@ans1 = ($a+$b+$c, $c+$d+$e, $e+$f, $d+$e+$f, $a+$b+$f, $a+$b+$c+$d); +$tag1 = random(0,5,1); + +@quest2 = ('\( P(A\mid B) \)', '\( P(B\mid A) \)', '\( P(A\mid C) \)', '\( P(B\mid C) \)', '\( P(C\mid B) \)'); +@ans2 = ($c/($c+$d+$e), $c/($a+$b+$c), 0, $e/($e+$f), $e/($c+$d+$e)); +$tag2 = random(0,4,1); + +@quest3 = ('\( P(A^c\mid B) \)', '\( P(B^c\mid A) \)', ' \( P(C^c\mid A) \)', '\( P(C\mid A^c) \)', + '\( P(B^c|C^c) \)'); +@ans3 = (($d+$e)/($c+$d+$e), ($a+$b)/($a+$b+$c), 1, ($e+$f)/($d+$e+$f), + ($a+$b)/($a+$b+$c+$d)); +$tag3 = random(0,4,1); +while ($tag3 == $tag2) { $tag3 = random(0,4,1); }; + + +BEGIN_TEXT +$BCENTER +\{ image(insertGraph($graph),height=>400,width=>400) \} $ECENTER$PAR +A sample space contains six outcomes and events \( A \), \( B \), and \( C \) as shown in the Venn diagram. The probabilities of the outcomes are \( P(1)=$a, \) +\( P(2)=$b, \) \( P(3)=$c, \) \( P(4)=$d, \) \( P(5)=$e, \) \( P(6)=$f.\) $PAR +Use the Venn diagram and the probabilities of the outcomes to find: $BR + +(a) $quest1[$tag1] \(=\) \{ans_rule(15)\} $BR + +(b) $quest2[$tag2] \(=\) \{ans_rule(15)\} $BR + +(c) $quest3[$tag3] \(=\) \{ans_rule(15)\} + +END_TEXT +Context("Percent"); +ANS(Percent($ans1[$tag1])->cmp); +ANS(Percent($ans2[$tag2])->cmp); +ANS(Percent($ans3[$tag3])->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_5.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_5.pg new file mode 100644 index 0000000000..9006eb820c --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_5.pg @@ -0,0 +1,157 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('Conditional', 'Probability', 'Independant') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +@b = (1,6); +$taga = random(0,1,1); +$a = $b[$taga]; + +@event = ("The numbers are equal", "A $a on the blue die", "The sum of the numbers is even", + "The difference of the numbers is 3 or more"); +$tag1 = random(0,3,1); +$tag2 = random(0,3,1); +while ( $tag2 == $tag1 ) {$tag2 = random(0,3,1);} + +@prob = (1/6, 1/6, 1/2, 1/3); +$ans1 = $prob[$tag1]; +$ans2 = $prob[$tag2]; + +@ans5 = ('yes','no','yes'); + +if ($tag1 == 0) { + if ($tag2 == 1) { + $ans3 = 1/36; + $tag5 = 0; + } + if ($tag2 == 2) { + $ans3 = 1/6; + $tag5 = 1; + } + if ($tag2 == 3) { + $ans3 = 0; + $tag5 = 1; + } +} + +if ($tag1 == 1) { + if ($tag2 == 0) { + $ans3 = 1/36; + $tag5 = 0; + } + if ($tag2 == 2) { + $ans3 = 1/12; + $tag5 = 0; + } + if ($tag2 == 3) { + $ans3 = 1/12; + $tag5 = 1; + } +} + + +if ($tag1 == 2) { + if ($tag2 == 0) { + $ans3 = 1/6; + $tag5 = 1; + } + if ($tag2 == 1) { + $ans3 = 1/12; + $tag5 = 0; + } + if ($tag2 == 3) { + $ans3 = 1/9; + $tag5 = 1; + } +} + +if ($tag1 == 3) { + if ($tag2 == 0) { + $ans3 = 0; + $tag5 = 1; + } + if ($tag2 == 1) { + $ans3 = 1/12; + $tag5 = 1; + } + if ($tag2 == 2) { + $ans3 = 1/9; + $tag5 = 1; + } +} + +$ans4 = $ans3 / $ans2; +$ans5 = $ans3 / $ans1; + +$mc = new_multiple_choice(); + +$mc->qa('Are events E and F independent?',$ans5[$tag5]); + +$tag6 = $tag5+1; + +$mc->extra($ans5[$tag6]); + +BEGIN_TEXT +Two fair dice, one blue and one red, are tossed, and the up face on each die is recorded. Define the following events: $PAR + +\(E: $LB \) $event[$tag1] \( $RB \) $BR + +\(F: $LB \) $event[$tag2] \( $RB \) $PAR + +Find the following probabilities: $BR + +(a) \( P(E) = \) \{ans_rule(10)\} $BR + +(b) \( P(F) = \) \{ans_rule(10)\} $BR + +(c) \( P(E \cap F) = \) \{ans_rule(10)\} $BR + +(d) \( P(E\mid F) = \) \{ans_rule(10)\} $BR + +(e) \( P(F\mid E) = \) \{ans_rule(10)\} $PAR + +\{ $mc->print_q() \} +\{ $mc->print_a() \} + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Percent($ans3)->cmp); +ANS(Percent($ans4)->cmp); +ANS(Percent($ans5)->cmp); + +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_8.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_8.pg new file mode 100644 index 0000000000..a03ea4efe5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_8.pg @@ -0,0 +1,85 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('Conditional', 'Probability', 'Independant', 'Dependant') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(0.2,0.8,0.1); +$b = random(0.1,0.4,0.1); +while ($b==$a) {$b = random(0.1,0.8,0.1);} + +$low = max(0.1,-int(-10*($a+$b-1)/$b)/10); +$high = min(0.9,int(10*$a/$b)/10); + +$c = random($low,$high,0.1); +if ($c == $a) { $c = $c - .05; } + +$ans11 = $a*$b; +$ans12 = $a; +$ans13 = $a+$b-$ans11; + +$ans21 = $c*$b; +$ans22 = ($c*$b)/$a; + +@event1 = ('\(P(A \cap B) \)', '\(P(A\mid B)\)', '\(P(A \cup B)\)'); +@event2 = ('\(P(A \cap B) \)', '\(P(B\mid A)\)'); +@ans1 = ($ans11, $ans12, $ans13); +@ans2 = ($ans21, $ans22); + +@slice1 = NchooseK(3,3); +@slice2 = NchooseK(2,2); + +@sevent1 = (@event1[@slice1]); +@sevent2 = (@event2[@slice2]); +@sans1 = (@ans1[@slice1]); +@sans2 = (@ans2[@slice2]); + + +BEGIN_TEXT +For two events \(A \) and \(B \), \(P(A) = $a\) and \(P(B) = $b\). $PAR +(a) If \(A\) and \(B\) are independent, then$PAR +$sevent1[0] \(=\) \{ans_rule(10)\}$PAR +$sevent1[1] \(=\) \{ans_rule(10)\}$PAR +$sevent1[2] \(=\) \{ans_rule(10)\}$PAR +(b) If \(A\) and \(B\) are dependent and \(P(A\mid B) = $c\), then $PAR +$sevent2[0] \(=\) \{ans_rule(10)\}$PAR +$sevent2[1] \(=\) \{ans_rule(10)\}$PAR + +END_TEXT +Context("Percent"); + +ANS(Percent($sans1[0])->cmp); +ANS(Percent($sans1[1])->cmp); +ANS(Percent($sans1[2])->cmp); +ANS(Percent($sans2[0])->cmp); +ANS(Percent($sans2[1])->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_9.pg b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_9.pg new file mode 100644 index 0000000000..92af17e11c --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ProbabilityRulesAndTools/ur_pb_4_9.pg @@ -0,0 +1,77 @@ +## DESCRIPTION +## Conditional Probability +## ENDDESCRIPTION + +## KEYWORDS('Conditional', 'Probability', 'Independant', 'Mutually Exclusive') +## Tagged by nhamblet + +## DBsubject('Probability') +## DBchapter('Theory') +## DBsection('Conditional Probability') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$a = random(0.1,0.5,0.1); +$b = random(0.1,0.5,0.1); +$a1 = random(0,$a,0.1); +$b1 = random(0,$b,0.1); +$ans1 = $a1 * $b1; +$c = $a + $b - $ans1; + +if ( $ans1 == $a * $b ) { + $ans2 = 'Yes'; +} else { + $ans2 = 'No'; +} + +if ( $ans1 == 0 ) { + $ans3 = 'Yes'; +} else { + $ans3 = 'No'; +} + +$popup2 = PopUp(["?","Yes","No"],$ans2); +$popup3 = PopUp(["?","Yes","No"],$ans3); + +BEGIN_TEXT + +If \( P(A) = $a \), \( P(B) = $b \), and \( P(A \cup B) = $c \), then $BR + +\( P(A \cap B) = \) \{ans_rule(10)\}.$BR + +(a) Are events \( A \) and \( B \) independent? \{$popup2->menu\}$PAR + +(b) Are \( A \) and \( B \) mutually exclusive? \{$popup3->menu\}$PAR + +END_TEXT +Context("Percent"); + +ANS(Percent($ans1)->cmp); +ANS($popup2->cmp); +ANS($popup3->cmp); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_01_Sampling.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_01_Sampling.pg new file mode 100644 index 0000000000..2ea1814e75 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_01_Sampling.pg @@ -0,0 +1,87 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II: From Exploring to Inference') +## DBsection('Chapter 8: Producing Data: Sampling') +## KEYWORDS('statistic', 'producing data', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 8: Producing Data: Sampling') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The population of interest is","all people who will vote on the sales tax increase on the date of the vote."); + $mc[0]->extra("the 2633 viewers who phoned in.", + "all regular viewers of the television station who own a phone and have participated + in similar phone surveys in the past.", + "the 1474 viewers who were opposed."); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The sample is","the 2633 viewers who phoned in."); + $mc[1]->extra("the 1474 viewers were opposed to the increase.", + "all regular viewers of the television station who own a phone and have participated in similar phone surveys in the past. ", + "all people who will vote on the sales tax increase on the data of the vote."); + +$mc[2] = new_multiple_choice(); + $mc[2]->qa("In this case, the sample obtained is ","a voluntary response sample. "); + $mc[2]->extra("a stratified random sample. ", + "a probability sample in which each person in the population has the same chance of being in the sample. ", + "a simple random sample. "); + +###################################### +# Main text + +BEGIN_TEXT +A television station is interested in predicting whether or not voters are in favor of an increase in the state sales tax. +It asks its viewers to phone in and indicate whether they support or are opposed to an increase in the state sales tax +in order to generate additional revenue for education. Of the 2633 viewers who phone in, 1474 (55.98$PERCENT) are opposed +to the increase. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_02_Sampling.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_02_Sampling.pg new file mode 100644 index 0000000000..03f4bb2736 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_02_Sampling.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_02_Sampling.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_02_Sampling.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_03_Sampling.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_03_Sampling.pg new file mode 100644 index 0000000000..b1baff54b7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_03_Sampling.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_03_Sampling.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_03_Sampling.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_05_Sampling.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_05_Sampling.pg new file mode 100644 index 0000000000..9de71ad36e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_05_Sampling.pg @@ -0,0 +1,85 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II: From Exploring to Inference') +## DBsection('Chapter 8: Producing Data: Sampling') +## KEYWORDS('statistic', 'producing data', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 8: Producing Data: Sampling') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("The sample is","the 15 students interviewed."); + $mc[0]->extra("all students approached by the reporter.", + "all students at universities with safety issues.", + "all those students walking on campus late at night."); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The method of sampling used is","convenience sampling."); + $mc[1]->extra("a census.", + "voluntary response.", + "simple random sampling."); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("The sample obtained is","probably biased."); + $mc[2]->extra("a probability sample of students with night classes.", + "a stratified random sample of students feeling safe.", + "a simple random sample of students feeling safe."); + +################################################# +# Main + +BEGIN_TEXT +In order to assess the opinion of students at the Ohio State University on +campus safety, a reporter for the student newspaper interviews 15 students +he meets walking on the campus late at night who are willing to give their opinion. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_06_Sampling.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_06_Sampling.pg new file mode 100644 index 0000000000..c320feee56 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_06_Sampling.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_06_Sampling.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_06_Sampling.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_07_Sampling.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_07_Sampling.pg new file mode 100644 index 0000000000..6c9bae7f12 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_07_Sampling.pg @@ -0,0 +1,18 @@ +# This file is just a pointer to the file +# +# "Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_07_Sampling.pg" +# +# You may want to change your problem set to use that problem +# directly, especially if you want to make a copy of the problem +# for modification. + +DOCUMENT(); +includePGproblem("Library/CollegeOfIdaho/setStatistics_Ch08Sampling/08Stats_07_Sampling.pg"); +ENDDOCUMENT(); + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_08_Sampling.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_08_Sampling.pg new file mode 100644 index 0000000000..c243deb1d8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/08Stats_08_Sampling.pg @@ -0,0 +1,105 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part II: From Exploring to Inference') +## DBsection('Chapter 8: Producing Data: Sampling') +## KEYWORDS('statistic', 'producing data', 'sample') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 8: Producing Data: Sampling') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$m1 = random(1000,2000,1); +$m2 = random(500,700,1); + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("An opinion poll contacts $m1 adults and asks them, $LQ Which political party do you think has better ideas for leading the country in the 21st century?$RQ In all, $m2 of the $m1 say, $LQ The Democrats.$RQ The sample in this setting is ", + "the $m1 people interviewed. "); + $mc[0]->extra("all 235 million adults in the United States. ", + "the $m2 people who chose the Democrats. "); + + $mc[0]->makeLast("None of the above. "); + +$n1 = random(150,300,1); +$n2 = random(50,100,1); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("A committee on community relations in a college town plans to survey local businesses about the importance of students as customers. From telephone book listings, the committee chooses $n1 businesses at random. Of these, $n2 return the questionnaire mailed by the committee. The population for this study is ", + "all businesses in the college town. "); + $mc[1]->extra("the $n1 businesses chosen. ", + "the $n2 businesses that returned the questionnaire. "); + $mc[1]->makeLast("None of the above. "); + +$o = random(2,5,1); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("Archaeologists plan to examine a sample of $o-meter-square plots near an ancient Greek city for artifacts visible in the ground. They choose separate samples of plots from floodplain, coast, foothills, and high hills. What kind of sample is this? ", + "A stratified random sample. "); + $mc[2]->extra("A simple random sample. ", + "A voluntary response sample. "); + $mc[2]->makeLast("None of the above. "); + +$p = random(2,7,1); +$p1 = random(10,18,1); +$p2 = random(23,30,1); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("A sample of households in a community is selected at random from the telephone directory. In this community, $p% of households have no telephone, $p1% have only cell phones, and another $p2% have unlisted telephone numbers. The sample will certainly suffer from ", + "undercoverage. "); + $mc[3]->extra("nonresponse. ", + "false responses. "); + $mc[3]->makeLast("None of the above. "); + +################################################# +# Main + +BEGIN_TEXT +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR + +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_1.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_1.pg new file mode 100644 index 0000000000..b0af6c3b81 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_1.pg @@ -0,0 +1,112 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 0; + + +@event = ("A public opinion poll in Ohio wants to determine whether registered voters in the state approve of a measure to ban smoking in all public areas. They randomly select 50 voters in the state and ask whether they approve or disapprove of the measure.", + "A public opinion poll in Ohio wants to determine whether registered voters in the state approve of a measure to ban smoking in all public areas. They randomly select 50 voters from each county in the state and ask whether they approve or disapprove of the measure."); +$pick = random(0,1); +@ans = ("Simple random sample", "Stratified random sample"); + +$mc = new_multiple_choice(); + +$mc->qa("This is an example of a", $ans[$pick]); +$mc->extra($ans[1-$pick]); +$mc->makeLast($ans[1]); + +BEGIN_TEXT + +$event[$pick] + +$BR +\{ $mc->print_q \} +\{ $mc->print_a \} +$PAR + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +@event = ("At a party there are 30 students over age 21 and 20 students under age 21. You randomly select 5 students to interview about attitudes toward alcohol.", + "At a party there are 30 students over age 21 and 20 students under age 21. You randomly select 3 of those over 21 and 2 of those under 21 to interview about attitudes toward alcohol."); +$pick = random(0,1); +@ans = ("Simple random sample", "Stratified random sample"); + +$mc = new_multiple_choice(); + +$mc->qa("This is an example of a", $ans[$pick]); +$mc->extra($ans[1-$pick]); +$mc->makeLast($ans[0]); + +BEGIN_TEXT + +$event[$pick] + +$BR +\{ $mc->print_q \} +\{ $mc->print_a \} +$PAR + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + +@event = ("The Ministry of Health in the Canadian Province of Ontario conducted the Ontario Health Survey by conducting interviews with 30,000 randomly selected men and 35,000 randomly selected women who reside in Ontario.", + "The Ministry of Health in the Canadian Province of Ontario conducted the Ontario Health Survey by conducting interviews with 65,000 randomly selected residents of Ontario."); +$pick = random(0,1); +@ans = ("Stratified random sample","Simple random sample"); + +$mc = new_multiple_choice(); + +$mc->qa("This is an example of a", $ans[$pick]); +$mc->extra($ans[1-$pick]); +$mc->makeLast($ans[0]); + +BEGIN_TEXT + +$event[$pick] + +$BR +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_2.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_2.pg new file mode 100644 index 0000000000..436a237fa5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_2.pg @@ -0,0 +1,52 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("To select 10 students out of the class of 40 students, I select every 4th name from the roster beginning with the 2nd student. What type of sample is this?", "Systematic Random Sample"); +$mc->extra("Stratified Random Sample", "Simple Random Sample", "Cluster Sample", "Multistage Sample"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_3.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_3.pg new file mode 100644 index 0000000000..c3c2e3d92f --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_3.pg @@ -0,0 +1,54 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("To select 10 students out of the class of 40 students, 40 names are placed in a hat and 10 names are drawn out of the hat. What type of sample is this?", "Simple Random Sample"); +$mc->extra("Stratified Random Sample", "Systematic Random Sample", "Cluster Sample", "Multistage Sample"); + +BEGIN_TEXT + + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_5.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_5.pg new file mode 100644 index 0000000000..4632069180 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/dueck1_4_5.pg @@ -0,0 +1,53 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Sampling') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("To conduct a door-to-door survey about crime victimization, a city official randomly selects 5 city blocks and surveys all the residents of these 5 city blocks. What type of sample is this?", "Cluster Sample"); +$mc->extra("Stratified Random Sample", "Systematic Random Sample", "Multistage Sample", "Simple Random Sample"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/gust25.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/gust25.pg new file mode 100644 index 0000000000..4e73ee12ce --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/gust25.pg @@ -0,0 +1,54 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('What is Statistics?') +##DBsection('Introduction') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Why is a sample often a better way to obtain information about a population than a census?", "All of the above"); +$mc->extra("A census is too time consuming", "A census is more costly than taking a sample", "A census is frequently impractical"); +$mc->makeLast("All of the above", "None of the above"); + +BEGIN_TEXT + + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/gust9.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/gust9.pg new file mode 100644 index 0000000000..86826aab97 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/gust9.pg @@ -0,0 +1,53 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('What is Statistics?') +##DBsection('Introduction') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("In sampling, why is obtaining a representative sample important?", +"Because we are using the sample to draw conclusions about the entire population"); +$mc->extra("Because representative samples guarantee that our results are reliable"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/stat212-HW03-01.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/stat212-HW03-01.pg new file mode 100644 index 0000000000..325a06030d --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/stat212-HW03-01.pg @@ -0,0 +1,125 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## NAW tagged this problem. + +## DBsubject(Statistics) +## DBchapter(Sample survey methods) +## DBsection(Concepts) +## Date(6/7/2005) +## Institution(UVA) +## Author(Nolan A. Wages) +## Level(2) +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('.') +## Problem1('') +## KEYWORDS('statistics', 'descriptive statistics', 'experiment') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('The difference between a sample mean and the population mean is called: ', + 'sampling error' +); +$mc[1]->extra( + 'nonresponse error', + 'selection bias', + 'nonsampling error' +); + + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('Which of the following sampling plans uses random methods of selections? ', + 'All of the above' +); +$mc[2]->extra( + 'Simple random sampling', + 'Stratified random sampling', + 'Cluster sampling' +); + +$mc[2]->makeLast( + 'All of the above' +); + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('A pharmaceutical company, interested in measuring +how often physicians prescribe a certain drug, + has selected a simple random sample from each of two groups: + M.D. (medical doctors) and D.O. (doctors of Osteopathic). What type of sampling is this?', + 'Stratified random sampling' +); +$mc[3]->extra( + 'Simple random sampling', + 'Cluster sampling', +); + +$mc[3]->makeLast( + 'None of the above' +); + + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('Which of the following does not characterize stratified random sampling? ', + 'Nonrandom sampling is used' +); +$mc[4]->extra( + 'The population is divided into strata that are distinct', + 'The population is divided into strata that are mutually exclusive and exhaustive', + 'The population is divided into strata that are homogenous' +); + + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('When every possible sample with the same number of observations is equally likely to be chosen, the selected sample is called: ', + 'simple random sample' +); +$mc[5]->extra( + 'stratified sample', + 'cluster sample', + 'biased sample' +); + + +$a = random(1,5,1); +$b = random(1,5,1); +while ($a == $b) { + $b = random(1,5,1); +} + + +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/stat212-HW03-02.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/stat212-HW03-02.pg new file mode 100644 index 0000000000..e1abddd946 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/stat212-HW03-02.pg @@ -0,0 +1,112 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## KEYWORDS('statistics', 'descriptive statistics', 'experiment') +## NAW tagged this problem. + +## DBsubject('Statistics') +## DBchapter('Experiment Design') +## DBsection('Sampling') +## Date('6/7/2005') +## Author('Nolan A. Wages') +## Institution('UVA') +## TitleText1('Statistics for Management and Economics') +## EditionText1('6') +## AuthorText1('Keller, Warrack') +## Section1() +## Problem1() + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('Which of the following is an example of primary data? ', + 'Financial data tapes that contain data compiled from the New York Stock Exchange' +); +$mc[1]->extra( + 'Data published by the U.S. Census Bureau', + 'Data published by Statistics Canada', + 'Data published by the New York Stock Exchange' +); + + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('Which of the following must be avoided in designing a questionnaire? ', + 'Leading questions' +); +$mc[2]->extra( + 'Dichotomous questions', + 'Open-ended questions', + 'Demographic questions' +); + + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('When the population is divided into mutually exclusive sets, +and then a simple random sample is drawn from each set, this is called:', + 'Stratified random sampling' +); +$mc[3]->extra( + 'Simple random sampling', + 'Cluster sampling', + 'Slection Bias' +); + + + + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('Which of the following statements is correct in questionnaire design? ', + 'All of the above are correct statements' +); +$mc[5]->extra( + 'The questionnaire should be kept as short as possible, and the questions + themselves should also be kept short', + 'A mixture of dichotomous, multiple-choice, and open-ended questions may be used', + 'Leading questions must be avoided' +); + +$mc[5]->makeLast( + 'All of the above are correct statements' +); + +do{ +$a = random(1,5,1); +$b = random(1,5,1); +while ($a == $b) { + $b = random(1,5,1); +}} until ($a != 4 and $b != 4); + + +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/SamplingIssues/stat_inference2.pg b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/stat_inference2.pg new file mode 100644 index 0000000000..f6494cf689 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SamplingIssues/stat_inference2.pg @@ -0,0 +1,51 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Inference Samples') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 06/20/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGchoicemacros.pl" +); + +TEXT(&beginproblem); +$mc = new_multiple_choice(); + +$name1 = list_random( 'survey', 'poll' ); +$num = random( 100, 200, 10 ); +@name2 = ( 'employees', 'students'); +$ind1 = random( 0 ,1 ); +@name3 = ( ' hostpital', 'medical clinic', 'university', 'high school'); +if( $ind1 == 0 ){ $ind2 = random( 0, 1 ); +} else{ $ind2 = random( 2, 3 ); } +$per = random( 15, 40, 1); +$mc->qa( 'This an example of', + 'nonresponse bias' +); +$mc->extra( 'undercoverage', + 'an insufficient sample size', + 'the placebo effect', + 'voluntary response bias' +); + +BEGIN_TEXT + +A $name1 is sent out to $num $name2[$ind1] at a $name3[$ind2]. Only $per$PERCENT bother to fill +them out and return them. +\{ $mc->print_q \} +$BR +\{ $mc->print_a \} + +END_TEXT + +ANS( str_cmp( $mc->correct_ans ) ); +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/Scatterplot.pg b/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/Scatterplot.pg new file mode 100644 index 0000000000..f458d67a00 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/Scatterplot.pg @@ -0,0 +1,82 @@ +##DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Simple linear regression) +## DBsection(Correlation) +## Institution(NAU) +## Author(Edgar Fisher) +## MLT(EstimateRFromPlot) +## Level(3) +## KEYWORDS('scatterplot') +##ENDDESCRIPTION + +# File Created: 7/06/05 +# Location: Northern Arizona University + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGnauStats.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", +# "extraAnswerEvaluators.pl", +); + +TEXT($BEGIN_ONE_COLUMN); +TEXT(beginproblem()); + +################################################# + +push @corr, random (-.95, -.6, .01); +push @corr, random (-.45, -.25, .01); +push @corr, random (.6, .95, .01); +push @corr, random (.25, .45, .01); + +for ($i = 0; $i < 4; $i++){ + $scatter[$i]=Scatterplot($corr[$i]); +# push @scatter, $sp[$i]; +} + +$matching = new_match_list(); +for ($i = 0; $i < 4; $i++){ + push @match, "r = $corr[$i]", $i; #Plot($scatter[$i]); +} +$matching->qa(@match); +$matching->choose(4); +@list= split "\n", $matching->print_a; + +for ($i = 0; $i < 4; $i++){ + @tmp = split '', $list[$i + 1]; + push @order, $tmp[17]; # 5/6/09 format changed. This was 5 before. +} + +#@scatt = @scatter[@order]; +$scatt[0]=$scatter[$order[0]]; +$scatt[1]=$scatter[$order[1]]; +$scatt[2]=$scatter[$order[2]]; +$scatt[3]=$scatter[$order[3]]; + +$tex = "Images are not available for print out. Sorry for the inconvenience."; + +$html = begintable(2); +$html .= row(Plot($scatt[0]),Plot($scatt[1])); +$html .= row('A', 'B'); +$html .= row(Plot($scatt[2]),Plot($scatt[3])); +$html .= row('C', 'D'); +$html .= endtable(); +############################################## + +BEGIN_TEXT +Match the scatterplot to its corresponding correlation coefficient r. +$PAR +\{$matching->print_q\} +$BR + +END_TEXT + +TEXT(MODES(TeX =>$tex, HTML => $html)); + + +TEXT($END_ONE_COLUMN); + +ANS(str_cmp($matching->ra_correct_ans())); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/gust24.pg b/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/gust24.pg new file mode 100644 index 0000000000..1dadf9a27c --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/gust24.pg @@ -0,0 +1,91 @@ +##DESCRIPTION +## Statistics: Regression +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +## DBsubject('Statistics') +## DBchapter('Correlation/Regression') +##DBsection('Linear regression') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; + +for($i=0; $i<5; $i++){ + $x[$i] = random(3,17,1); + $y[$i] = random(15,31,1); +} + +$sx =0; +$sy =0; +$sxy =0; +$sx2 =0; +$sy2 =0; +$meanx =0; +$meany =0; + +for($i=0; $i<5; $i++) { + $sx = $sx + $x[$i]; + $sy = $sy + $y[$i]; + $sxy = $sxy + ($x[$i]*$y[$i]); + $sx2 = $sx2 + ($x[$i]**2); + $sy2 = $sy2 + ($y[$i]**2); + $meanx = $meanx+$x[$i]; + $meany = $meany+$y[$i]; + +} +$meanx = $meanx/5; +$meany = $meany/5; +$ssxy = $sxy-(($sx*$sy)/5); +$ssx = $sx2-(($sx**2)/5); +$ssy = $sy2-(($sy**2)/5); + +$r = $ssxy/sqrt($ssx*$ssy); +$b1 = $ssxy/$ssx; +$b0 = $meany-$b1*$meanx; + +BEGIN_TEXT +Consider the following small data set.$BR +\{begintable(3)\} +\{row("Subject", "\(x\)", "\(y\)")\} +\{row("\(1\)", "\($x[0]\)", "\($y[0]\)")\} +\{row("\(2\)", "\($x[1]\)", "\($y[1]\)")\} +\{row("\(3\)", "\($x[2]\)", "\($y[2]\)")\} +\{row("\(4\)", "\($x[3]\)", "\($y[3]\)")\} +\{row("\(5\)", "\($x[4]\)", "\($y[4]\)")\} +\{endtable()\} +$BR +Find the correlation between \(x\) and \(y\). $PAR +\(r = \) \{ans_rule(10)\} $BR + +END_TEXT +ANS(num_cmp($r)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_1.pg b/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_1.pg new file mode 100644 index 0000000000..4d27d30da7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_1.pg @@ -0,0 +1,68 @@ +## DESCRIPTION +## Correlation Coefficients +## ENDDESCRIPTION + +## KEYWORDS('Correlation', 'Coefficient') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Correlation and Regression') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +#make a new match list +$ml = new_match_list(); +$ml -> qa ( + "\(r = 1\)", + "a perfect positive relationship between \(x\) and \(y\)", + "\(r = -1\)", + "a perfect negative relationship between \(x\) and \(y\)", + "\(r = 0\)", + "no relationship between \(x\) and \(y\)", + "\(r = .92\)", + "a strong positive relationship between \(x\) and \(y\)", + "\(r = -.97\)", + "a strong negative relationship between \(x\) and \(y\)", + "\(r = .1\)", + "a weak positive relationship between \(x\) and \(y\)", + "\(r= -.15\)", + "a weak negative relationship between \(x\) and \(y\)" +); + +$ml -> choose(4); + +BEGIN_TEXT +Match the following sample correlation coefficients with the explaination of what that correlation +coeffiecient means. $PAR +\{ $ml -> print_q \} +$PAR +\{$ml -> print_a \} + +END_TEXT +ANS(str_cmp($ml->ra_correct_ans )) ; + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_2.pg b/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_2.pg new file mode 100644 index 0000000000..790eff46b9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/ScatterplotsAndCorrelation/ur_stt_6_2.pg @@ -0,0 +1,120 @@ +## DESCRIPTION +## Correlation Coefficient +## ENDDESCRIPTION + +## KEYWORDS('Correlation', 'Coefficient') +## Tagged by nhamblet + +## DBsubject('Statistics') +## DBchapter('Estimation') +## DBsection('Correlation and Regression') +## Date('') +## Author('') +## Institution('Rochester') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$gen = random(0,5,1); + +@ans = ("a positive correlation between \(x\) and \(y\)", + "a perfect positive correlation between \(x\) and \(y\)", + "a negative correlation between \(x\) and \(y\)", + "a perfect negative correlation between \(x\) and \(y\)", + "no correlation between \(x\) and \(y\)", + "a nonlinear correlation between \(x\) and \(y\)", + "a positive correlation between \(x\) and \(y\)", + "a perfect positive correlation between \(x\) and \(y\)", + "a negative correlation between \(x\) and \(y\)", + "a perfect negative correlation between \(x\) and \(y\)", + "no correlation between \(x\) and \(y\)"); + +$sx = 0; +$sy = 0; +$sxy = 0; +$sx2 = 0; +$sy2 = 0; + +for($i=0;$i<15;$i++){ + $x[$i]=random($i,$i+0.9,0.1); + if ($gen==0) { + $y[$i] = $x[$i] + 2*sin(20*$x[$i]); + } + if ($gen==1) { + $y[$i] = $x[$i]; + } + if ($gen==2) { + $y[$i] = 15 - $x[$i] - 2*sin(20*$x[$i]); + } + if ($gen==3) { + $y[$i] = 15 - $x[$i]; + } + if ($gen==4) { + $y[$i] = random(0,15,0.1); + } + if ($gen==5) { + $y[$i] = 15/7.5**2*($x[$i]-7.5)**2; + } + $y[$i] = int($y[$i]*10+0.5)/10; + + $sx = $sx + $x[$i]; + $sy = $sy + $y[$i]; + $sxy = $sxy + $x[$i] * $y[$i]; + $sx2 = $sx2 + ($x[$i])**2; + $sy2 = $sy2 + ($y[$i])**2; +} + +$r = (15*$sxy - $sx * $sy)/sqrt(15*$sx2 - ($sx)**2)/sqrt(15*$sy2 - ($sy)**2); + +$mc = new_multiple_choice(); +$mc -> qa('There is ',$ans[$gen]); +$mc -> extra($ans[$gen+1], $ans[$gen+2],$ans[$gen+3],$ans[$gen+4],$ans[$gen+5]); + + +BEGIN_TEXT + +$BEGIN_ONE_COLUMN + +Use a scatterplot and the linear correlation coefficient \( r \) to determine what kind of correlation there is between the two variables. + + + +\[ \begin{array}{c|ccccccccccccccc} +x & $x[0] & $x[1] & $x[2] & $x[3] & $x[4] & $x[5] & $x[6] & $x[7] & $x[8] & $x[9] & $x[10] & $x[11] & $x[12] & $x[13] & $x[14] \cr +\hline +y & $y[0] & $y[1] & $y[2] & $y[3] & $y[4] & $y[5] & $y[6] & $y[7] & $y[8] & $y[9] & $y[10] & $y[11] & $y[12] & $y[13] & $y[14] \cr +\end{array} \] + + + +\( r= \) \{ans_rule(25)\} $BR + +\{$mc->print_q()\} +\{$mc->print_a()\} + +$END_ONE_COLUMN + +END_TEXT + +ANS(num_cmp($r)); +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/14Stats_07_InferenceIntro.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/14Stats_07_InferenceIntro.pg new file mode 100644 index 0000000000..9bd556628e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/14Stats_07_InferenceIntro.pg @@ -0,0 +1,110 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Hypothesis tests) +## DBsection(Concepts) +## Institution(The College of Idaho) +## Author(R Cruz, L Danielson, J Guild) +## Level(2) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('14') +## Problem1('') +## KEYWORDS('statistics', 'inference', 'confidence interval') +## Updated: 2010/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("In formulating hypotheses for a statistical test of significance, the null hypothesis is + often","a statement of ''no effect'' or ''no difference''."); + $mc[0]->extra("the probability of observing the data you actually obtained", + "a statement that the data are all \(0\).", + "\(0.05\)"); +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The \(P\)-value of a test of a null hypothesis is","the probability, assuming + the null hypothesis is true, that the test statistic will take a value at least as extreme as that actually observed."); + $mc[1]->extra("the probability, assuming the null hypothesis is false, that the test statistic will take a value at + least as extreme as that actually observed.", + "the probability the null hypothesis is true.", + "the probability the null hypothesis is false."); +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("In testing hypotheses, which of the following would be strong evidence against the null hypothesis?", + "Obtaining data with a small \(P\)-value."); + $mc[2]->extra("Obtaining data with a large \(P\)-value.", + "Using a small level of significance.", + "Using a large level of significance."); + +@solution= ("Option \(D\). Our null hypothesis is what we assume to be true. Using collected data, we can then decide if there is significant difference between our data and the hypothesis. If there is not, we often say ''no effect'' or ''no difference'' from what was expected or assumed to be true, which was our null hypothesis.", + +" Option \(C\). The definition of the \(P\)-value is the probability, assuming the null hypothesis is true, that the test statistic will take a value at least as extreme as that actually observed.", + +"Option \(D\). The smaller the \(P\)-value, the more rare our data set is. The rarer a data set is, the more evidence we have against null hypothesis.",) +; + +@ssols = (@solution[@order]); + +###################################### +# Main text + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +####################################### +BEGIN_SOLUTION + +(a) $ssols[0] +$PAR +(b) $ssols[1] +$PAR +(c) $ssols[2] + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + + diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/14Stats_08_InferenceIntro.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/14Stats_08_InferenceIntro.pg new file mode 100644 index 0000000000..f0fe8e7cee --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/14Stats_08_InferenceIntro.pg @@ -0,0 +1,108 @@ +## DESCRIPTION +## DBsubject(Statistics) +## DBchapter(Hypothesis tests) +## DBsection(Concepts) +## Institution(The College of Idaho) +## Author(J Guild) +## MLT(statethetest) +## MLTleader(1) +## Level(2) +## TitleText1('The Basic Practice of Statistics') +## AuthorText1('David Moore') +## EditionText1('5e') +## Section1('14') +## Problem1('') +## KEYWORDS('statistics', 'inference', 'confidence interval') +## Updated: 2011/10 + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@ThreeProblems = (0,1,2); #Order the problems +@scramble = NchooseK(3,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("A certain type of hummingbird is known to have an average weight of \(4.55\) grams. A researcher wonders if hummingbirds (of this same type) living in the Grand Canyon differ in weight from the population as a whole. The researcher finds a sample of \(30\) such hummingbirds from the Grand Canyon and calculates their average weight to be \(3.75\) grams.","\(H_0: \mu = 4.55\), \(\ \ H_a: \mu \neq 4.55\)"); + $mc[0]->extra("\(H_0: \mu = 4.55\), \(\ \ H_a: \mu < 4.55\)", + "\(H_0: \mu = 3.75\), \(\ \ H_a: \mu \neq 3.75\)", + "\(H_0: \mu < 4.55\), \(\ \ H_a: \mu = 4.55\)", + "\(H_0: {\bar x} = 3.75\), \(\ \ H_a: {\bar x} > 3.75\)", + "\(H_0: {\bar x} = 4.55\), \(\ \ H_a: {\bar x} < 4.55 \)"); +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("The mean height of $BITALIC all$EITALIC adult American males is \(69\) inches (5ft 9in). A researcher wonders if $BITALIC young $EITALIC American males between the ages of \(18\) and \(21\) tend to be taller than \(69\) inches. A random sample of \(100\) young American males ages \(18\) to \(21\) yielded a sample mean of \(71\) inches.","\(H_0: \mu = 69 \) , \(\ \ H_a: \mu > 69 \)"); + $mc[1]->extra("\(H_0: \mu = 69 \), \(\ \ H_a: \mu \neq 69 \)", + "\(H_0: \mu = 71 \), \(\ \ H_a: \mu < 71 \)", + "\(H_0: \mu > 69 \), \(\ \ H_a: \mu < 69 \)", + "\(H_0: {\bar x} = 69 \), \(\ \ H_a: {\bar x} > 69 \)", + "\(H_0: {\bar x} = 71 \), \(\ \ H_a: {\bar x} < 71\)"); +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("According to the Merck Veterinary Manual, the average resting heart rate for a certain type of sheep dog is \(115\) beats per minute (bpm). A Montana farmer notices his aging sheep dog has been acting more lethargic than usual and wonders if her heart rate is slowing. He measures her heart rate on \(15\) occasions and finds a sample mean heart rate of \(118.2\) bpm. ", + "\(H_0: \mu = 115\), \(\ \ H_a: \mu < 115\)"); + $mc[2]->extra("\(H_0: \mu = 115\), \(\ \ H_a: \mu > 115\)", + "\(H_0: \mu = 115\), \(\ \ H_a: \mu \neq 115\)", + "\(H_0: \mu = 118.2\), \(\ \ H_a: \mu < 118.2\)", + "\(H_0: {\bar x} = 118.2\), \(\ \ H_a: {\bar x} \neq 118.2\)", + "\(H_0: {\bar x} = 115\), \(\ \ H_a: {\bar x} > 115\)"); + +@solution= ("Option \(E\). We do not base our null hypothesis on sample data, so Option \(D\) and \(F\) are ruled out. Our null hypothesis always uses \(H_0: \mu =\), so Option \(A\) is out. The researcher wonders if the weights differ from the population. Since this makes no mention of greater or less than we will use a two sided test, which uses \(H_a: \mu \neq\).", + +"Option \(A\). We do not base our null hypothesis on sample data, so Option \(B\) and \(E\) are ruled out. Our null hypothesis always uses \(H_0: \mu =\), so Option \(C\) is out. The researcher wonders if the heights are taller than \(69\) inches. We are therefore interested in a one sided test, using greater than, which uses \(H_a: \mu >\).", + +"Option \(C\). We do not base our null hypothesis on sample data, so Option \(A\) and \(B\) are ruled out. Our null hypothesis always uses \(H_0: \mu =\), so Option \(F\) is out. The farmer wonders if heart rates are slowing, meaning the values are becoming lower. We are therefore interested in a one sided test, using less than, which uses \(H_a: \mu <\).",) +; + +@ssols = (@solution[@order]); +###################################### +# Main text + +BEGIN_TEXT +For each statement, select the correct null hypothesis, \( H_0 \), and +alternative hypothesis, \( H_a \), in symbolic form. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +####################################### +BEGIN_SOLUTION + +(a) $ssols[0] +$PAR +(b) $ssols[1] +$PAR +(c) $ssols[2] + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_03_InferencePropn.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_03_InferencePropn.pg new file mode 100644 index 0000000000..a7a4f8c7a0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_03_InferencePropn.pg @@ -0,0 +1,123 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +@n = (76,78,80,82,84); +@x = (28,30,30,30,31); + +@p = (0.15284816, 0.245747299, 0.177529852, 0.125613157, 0.135867745); +$p = Real(@p[0]); +$choose = random(0,4,1); +$phat = Real($x[$choose]/$n[$choose]); +$sigma = Real(sqrt(0.45*0.55/$n[$choose])); +$z = ($x[$choose]/$n[$choose] - 0.45)/$sigma; +$zneg = -(($x[$choose]/$n[$choose] - 0.45)/$sigma); +$pval = Percent(normal_prob(-infty, $z)); +$pvaltwo = 2*$pval; + + +$diagram = DrawNormalDist($z, $zneg, $z, $zneg, outside=>1); + +###################################### +# Main text + +BEGIN_TEXT +An article in the Washington Post on March \(16\), \(1993\) stated that nearly \(45$PERCENT\) of all Americans have brown eyes. A random sample of \( n = +$n[$choose] \) PCC +students found \($x[$choose]\) with brown eyes. + +$BR +We test +$BCENTER +\( H_0: p = .45 \) +$BR +\( H_a: p \neq .45 \) +$ECENTER + +$PAR +(a) What is the \(z\)-statistic for this test? \( \) +\{ ans_rule(10)\} + +$PAR +(b) What is the \(P\)-value of the test? \( \) +\{ ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = Compute($z)->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01 ; + } => ["Close! Use more accuracy in our calculation."] +))); + +Context("Percent"); +$ans_b = Percent($p[$choose]); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student) > 1 ; + } => ["Enter your answer in decimal form. It looks like you entered a percent."] +))); + + +############################################################# +BEGIN_SOLUTION +(a) In our random sample of \($n[$choose]\) PCC students, \($x[$choose]\) had brown eyes. This means \(\hat{p}\approx$phat\). Since we know \(p=0.45 \), this means \(q=0.55 \). Using our formula for \(\operatorname{SD}(\hat{p})=\sqrt{\frac{pq}{n}}\), we find that, +$PAR +\(\text{SD}(\hat{p})=\sqrt{\frac{(0.45)(0.55)}{$n[$choose]}} \approx $sigma\) +$PAR +This will allow to us to find our \(z\)-score using \(z=\frac{\hat{p}-p}{\operatorname{SD}(\hat{p})}\) +$PAR +\(z=\frac{$phat-0.45}{$sigma} \approx $z\). Therefore our \(z\)-statistic is \($z\). +$PAR +(b) For our \(P\)-value, we will need to use technology. When used as a one-sided test, we obtain \(P\)-value of \($pval\). However, since \( H_a: p \neq .45 \), we need a two-sided test. Therefore, we need to double our \(P\)-value to obtain a \(P\)-value of \($pvaltwo\). The two sided test shading is shown below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR + + + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_05_InferencePropn.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_05_InferencePropn.pg new file mode 100644 index 0000000000..501072d37e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_05_InferencePropn.pg @@ -0,0 +1,128 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@name = ("Pedro", "Julia", "Matt", "Albert"); +$m= random(0,3,1); +$pronoun = "he"; +if ($m==1) {$pronoun = "she";} +$s = random(1,6,1); +@n = (30,34,38,42,46,50); +@x = (6,7,8,9,10,11); +@p = (.383553, .334795, .293451, .258108,.227693,.20137); +$pval = 100*($p[$choose]); +@normalbased = (0.312103057, 0.269749098, 0.234079955, 0.203812974, 0.177969037, 0.155786037); +$null = Real(1/6); +$null2 = Real(5/6); +$phat = Real($x[$choose]/$n[$choose]); +$sigma = Real(sqrt($null*$null2)/$n[$choose]); +$z = ($x[$choose]/$n[$choose] - (1/6))/$sigma; + +$choose = random(0,5,1); + +$popup = PopUp(["?", "Yes", "No"], "No"); + +###################################### +# Main text + +BEGIN_TEXT + $name[$m] thinks that $pronoun has a special relationship with the number \($s\). +In particular, $name[$m] thinks that $pronoun would roll a \($s\) with a fair +\(6\)-sided die more often than you'd expect by chance alone. Suppose \(p\) is +the true proportion of the time $name[$m] will roll a \($s\). + +$PAR +(a) State the null and alternative hypotheses for testing $name[$m]'s claim. +(Type the symbol "p" for the population proportion, whichever symbols you need +of "<", ">", "=", "not =" and express any values as a fraction e.g. $BBOLD p = +1/3$EBOLD) +$BR + \( H_0:\) \{ ans_rule(15)\} +$BR + \( H_a:\) \{ ans_rule(15)\} +END_TEXT + +BEGIN_TEXT +$PAR +(b) Now suppose $name[$m] makes \($n[$choose]\) rolls, and a \($s\) comes up +\($x[$choose]\) times out of the \($n[$choose]\) rolls. Determine the \(P\)-value of the +test: +$BR +\(P\)-value = \{ ans_rule(10) \} + +$PAR +(c) Answer the question: Does this sample provide evidence at the \(5$PERCENT\) level +that $name[$m] rolls a \($s\) more often than you'd expect? +$BR + \{$popup->menu \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a1 = "p=1/6"; +ANS(ordered_str_cmp($ans_a1)); + +$ans_a2 = "p > 1/6"; +ANS(ordered_str_cmp($ans_a2)); + +Context("Percent"); +$ans_b = Percent("$p[$choose]"); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + Percent($normalbased[$choose]) => ["It looks like you computed using a Normal approximation, but what are the conditions for using a Normal approximation? They are not met here. You must work more directly with the binomial distribution."] +))); + + + +ANS($popup->cmp); + + +############################################################# + +BEGIN_SOLUTION +(a) As \(p\) is the true proportion of the time $name[$m] will roll a \($s\) and we know the die is fair, we have \(p=\frac{1}{6}\). This means we have \( H_0: p=\frac{1}{6}\). As $name[$m] claims they will roll \($s\)'s more than you would expect them to we, have \( H_A: p>\frac{1}{6}\) +$PAR +(b) Wait! Don't use the normal approximation! Check the conditions. We need to be able to have at least \(10\) successes, \(np>10\) and \(10\) failures, \(nq>10\). But since are only rolling \($n[$choose]\) times and the die is fair, this means we will have \($n[$choose]\cdot\frac{5}{6} > 10\) failures, but \($n[$choose]\cdot\frac{1}{6} < 10\) successes. This means we need to use the binomial model still. +$PAR +How likely is it that $name[$m] rolled a \($s\), \($x[$choose]\) times out of the \($n[$choose]\), or something more extreme? This is asking for a \(P\)-value. Since we cannot use the normal approximation, we will find the \(P\)-value using the binomial distribution. This amounts to finding, \(\text{P}(X \geq 7)\), +$PAR +\(\text{P}(X \geq 7) =\text{P}(X=7) +\text{P}(X=8) +...+... + \text{P}(X=$n[$choose])\) +$PAR +Via technology we find that \(\text{P}(X \geq 7)\approx $p[$choose]...\), or, a \(P\)-value of \($pval$PERCENT\) +$PAR +(c) Using the \(5$PERCENT\) level, if $name[$m] rolls a \($s\) more often than we would expect, then \(P\)-value \(< 5$PERCENT\). Otherwise, if a \($s\) is $BBOLD not $EBOLD rolled more often than we would expect, then \(P\)-value \(> 5$PERCENT\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_09_InferencePropn.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_09_InferencePropn.pg new file mode 100644 index 0000000000..c29c210aba --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_09_InferencePropn.pg @@ -0,0 +1,115 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +@n = (1000, 1100, 1200, 1300, 1400); +@x = (520, 570, 620, 670, 720); +@z = (1.264911064, 1.206045378, 1.154700538, 1.109400392, 1.069044968); +@p = (0.102951605, 0.113899997, 0.124106539, 0.133628747, 0.142524704); +$choose = random(0,4,1); +$phat = Real($x[$choose]/$n[$choose]); +$sigma = Real(sqrt(0.50*0.50/$n[$choose])); +$z = ($x[$choose]/$n[$choose] - 0.50)/$sigma; +$zneg = -(($x[$choose]/$n[$choose] - 0.50)/$sigma); +$pval = Percent(normal_prob($z,infty)); + +$diagram = DrawNormalDist(99, $z, "", $z, outside=>1); +###################################### +# Main text + +BEGIN_TEXT +A newspaper conducted a statewide survey concerning the \(2014\) race for state senator. The newspaper took a SRS of \( n = $n[$choose] \) registered voters and found that \($x[$choose]\) would vote for the Republican candidate. Let \(p\) represent the proportion of registered voters in the state who would vote for +the Republican candidate. + +$BR +We test + +$BCENTER +\( H_0: p = 0.50 \) +$BR +\( H_a: p > 0.50\) +$ECENTER + +$PAR +(a) What is the \(z\)-statistic for this test? \( \) +\{ ans_rule(10)\} + +$PAR +(b) What is the \(P\)-value of the test? \( \) +\{ ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = Compute("$z[$choose]")->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01 ; + } => ["Close! Use more accuracy in our calculation."] +))); + +Context("Percent"); +$ans_b = Percent("$p[$choose]"); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student) > 1 ; + } => ["Enter your answer in decimal form. It looks like you entered a percent."] +))); + +############################################################# +BEGIN_SOLUTION +(a) In the SRS done by the newspaper it was found that out of \($n[$choose] \) registered voters, \($x[$choose]\) would vote for the Republican candidate. This means \(\hat{p}\approx$phat\). Since we know \(p=0.50 \), this means \(q=0.50 \). Using our formula for \(\operatorname{SD}(\hat{p})=\sqrt{\frac{pq}{n}}\), we find that, +$PAR +\(\text{SD}(\hat{p})=\sqrt{\frac{(0.50)(0.50)}{$n[$choose]}} \approx $sigma\) +$PAR +This will allow to us to find our \(z\)-score using \(z=\frac{\hat{p}-p}{\operatorname{SD}(\hat{p})}\) +$PAR +\(z=\frac{$phat-0.50}{$sigma} \approx $z\). Therefore our \(z\)-statistic is \($z\). +$PAR +(b) For our \(P\)-value, we will need to use technology. Since we have \( H_a: p > .50\), we will use one-sided test shaded to the right. With technology, we obtain \(P\)-value of \($pval\). The one sided test shading is shown below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_10_InferencePropn.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_10_InferencePropn.pg new file mode 100644 index 0000000000..4d94ea0a88 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_10_InferencePropn.pg @@ -0,0 +1,120 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +@n = (180,200,220,240,260); +@x = (43,49,52,65,70); +@z = (1.304372987, 1.590990258, 1.348399725, 2.743363204, 2.790781528); +@p = (0.09605322, 0.055805884, 0.088764926, 0.003040669, 0.002629048); +$choose = random(0,4,1); +$phat = Real($x[$choose]/$n[$choose]); +$sigma = Real(sqrt(0.20*0.80/$n[$choose])); +$z = Real(($phat - 0.20)/$sigma); +$pval = Percent(normal_prob($z,infty)); + + +$diagram = DrawNormalDist(99,$z,"", $z, outside=>1); + +###################################### +# Main text + +BEGIN_TEXT +A noted psychic was tested for ESP. The psychic was presented with +\($n[$choose]\) cards face down and was asked to determine if the card was one of +\(5\) symbols: a star, cross, circle, square, or three wavy lines. The psychic +was correct in \($x[$choose]\) cases. Let \(p\) represent the probability that +the psychic correctly identifies the symbol on the card in a random trial. +Assume the \($n[$choose]\) trials can be treated as an SRS from the population of +all guesses. + +$BR +To see if there is evidence that the psychic is doing better than just +guessing, we test +$BCENTER +\( H_0: p = 0.20 \) +$BR +\( H_a: p > 0.20 \) +$ECENTER + +$PAR +(a) What is the \(z\)-statistic for this test? \( \) +\{ ans_rule(10)\} + +$PAR +(b) What is the \(P\)-value of the test? \( \) +\{ ans_rule(10)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +$ans_a = Compute("$z[$choose]")->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01 ; + } => ["Close! Use more accuracy in our calculation."] +))); + +Context("Percent"); +$ans_b = Percent($p[$choose]); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student) > 1 ; + } => ["Enter your answer in decimal form. It looks like you entered a percent."] +))); + +############################################################# +BEGIN_SOLUTION +(a) The psychic was presented with \($n[$choose]\) cards and they guessed the symbol correctly \($x[$choose]\) times. This means \(\hat{p}\approx$phat\). Since we know \(p=0.20 \), this means \(q=0.80 \). Using our formula for \(\operatorname{SD}(\hat{p})=\sqrt{\frac{pq}{n}}\), we find that, +$PAR +\(\text{SD}(\hat{p})=\sqrt{\frac{(0.20)(0.80)}{$n[$choose]}} \approx $sigma\) +$PAR +This will allow to us to find our \(z\)-score using \(z=\frac{\hat{p}-p}{\operatorname{SD}(\hat{p})}\) +$PAR +\(z=\frac{$phat-0.20}{$sigma} \approx $z\). Therefore our \(z\)-statistic is \($z\). +$PAR +(b) For our \(P\)-value, we will need to use technology. Since we have \( H_a: p > .20\), we will use one-sided test shaded to the right. With technology, we obtain \(P\)-value of \($pval\). The one sided test shading is shown below. +$PAR +\{Plot($diagram, tex_size=>900)\} + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_12_InferencePropn.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_12_InferencePropn.pg new file mode 100644 index 0000000000..2daa9573c9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/19Stats_12_InferencePropn.pg @@ -0,0 +1,138 @@ +##DESCRIPTION +## Hypothesis testing: One proportion +##ENDDESRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part III: Inference About Variables') +## DBsection('Chapter 19: Inference About a Population Proportion') +## KEYWORDS('statistics', 'Inference', 'one proportion') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 19: Inference About a Population Proportion') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +$n = random(40,70,1); +$x = random(30,($n-5),1); +$p = Real($x/$n); +$q0 = (1-$p0); +$p0 = random(.4,.7,.1); +$perc = 100*$p0; +$sd = Real(sqrt(($p0*(1-$p0))/$n)); + +$alpha = random(.01,.05,.04); +$alphap = (100*$alpha); +$tot = (1-$alpha); +$totp = (100*$tot); + +$z = ($p-$p0)/$sd; + +$crit = udistr($alpha); + +$pval = Percent(normal_prob($z,infty)); + +$diagram = DrawNormalDist(99, $z, "", $z, outside=>1); + +@ans = ("We can reject the null hypothesis that \(p = $p0\) and accept that \(p > $p0 \). That is, the cream can improve the skin of more than \($perc$PERCENT\) of women over \(50\).", +"There is not sufficient evidence to reject the null hypothesis that \( p = $p0\). That is, +there is not sufficient evidence to reject that the cream can improve the skin of more than \($perc$PERCENT\) of women over \(50\)."); + +if ( $z > $crit) {$tag = 0;} else {$tag = 1;} + +$mc = new_multiple_choice(); +$mc -> qa('The final conclusion is', $ans[$tag]); +$mc -> extra($ans[1-$tag]); + + +###################################### +# Main text + +BEGIN_TEXT +A new cream that advertises that it can reduce wrinkles and improve skin was subject to a recent +study. A sample of \($n\) women over the age of \(50\) used the new cream for \(6\) months. Of those \($n\) +women, \($x\) of them reported skin improvement (as judged by a dermatologist). Is this evidence that +the cream will improve the skin of more than \($perc$PERCENT\) of women over the age of \(50\)? Test +using \(\alpha = $alpha\). +END_TEXT + +BEGIN_TEXT +$PAR +(a) Test statistic: \( z = \) \{ans_rule(20)\} + +$PAR +(b) Critical \(z\)-score for determining significance: \(z^* = \) \{ans_rule(20)\} + +$PAR +(c) \{ $mc->print_q() \} +$BR +\{ $mc->print_a() \} + +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +#ANS(num_cmp($rej, tol=>.005)); + +$ans_a = Compute("$z")->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01 ; + } => ["Close! Use more accuracy in our calculation."] +))); + +$ans_b = Compute("$crit")->with(tolType=>'absolute', tolerance=>'0.005'); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + $alpha => ["Enter the critical value not the significance level."] +))); + +ANS(radio_cmp($mc->correct_ans)); + +################################################# +BEGIN_SOLUTION +(a) Does the cream improve skin? This tells us we will have a one sided hypothesis test using the \(>\) sign in our alternative hypothesis. Since \($x\) out of \($n\) women reported improvement in skin we know that \(\hat{p} \approx $p\). We want to test if this is evidence that the cream will improve the skin of more than \($perc$PERCENT\) of women, which means \(p=$p0\). Thus we can find, \(\operatorname{SD}(\hat{p})=\sqrt{\frac{$p0\cdot$q0}{$n}}\approx$sd\). +$PAR +Therefore our test statistic is \(z=\frac{$p-$p0}{$sd}\approx$z\). +$PAR +(b) If our significance level is \(\alpha = $alpha\), since the question was if the cream improved skin, this means we want a right-tailed critical \(z^{*}\). This mean only \($alpha\), or, \($alphap$PERCENT\) is above the needed \(z^{*}\). Therefore, we can use the inverse technology command using an area of \($tot\). Recall we do this since our technology only can shade in left and if \($totp$PERCENT\) is below the \(z^{*}\) value in question, only \($alphap$PERCENT\) is above it . Thus, we find \(z^{*}\approx$crit\). +$PAR +(c) The final conclusion requires a \(P\)-value. Using technology and our test statistic of \(z\approx$z\), we find a \(P\)-value of \($pval\), also seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +The final conclusion is that: $ans[$tag] +$PAR +This conclusion is always based on the fact that if our \(p\)-value is less than \(\alpha\) we reject the null hypothesis and if our \(P\)-value is great than \(\alpha\) we do not reject the null hypothesis. +END_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/di12.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/di12.pg new file mode 100644 index 0000000000..fbb7d46f2d --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/di12.pg @@ -0,0 +1,99 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## Tagged by dgt5v + +## DBsubject(Statistics) +## DBchapter(Hypothesis tests) +## DBsection(Type I/type II errors and power) +## Institution(ASU) +## Level(1) +## KEYWORDS('Statistics','Hypothesis Testing') +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc[0] = new_multiple_choice(); +$mc[0] -> qa('"The mean body temperature for humans in fact is \(98.6\) degrees Farenheit and the result of the sampling do not lead to the rejection of the fact that the mean body temperature is \(98.6\) degrees Farenheit" is a', "correct decision"); +$mc[0] -> extra("Type II error", "Type I error"); + +$mc[1] = new_multiple_choice(); +$mc[1] -> qa('"The mean body temperature for humans in fact is \(98.6\) degrees Farenheit but the result of the sampling lead to the conclusion that the mean body temprature for humans differ from \(98.6\) degrees Farenheit" is a', "Type I error"); +$mc[1] -> extra("Type II error", "correct decision"); + +$mc[2] = new_multiple_choice(); +$mc[2] -> qa('"The mean body temperature for humans in fact differs from \(98.6\) degrees Farenheit but the result of the sampling fail to lead that conclusion" is a', "Type II error"); +$mc[2] -> extra("Type I error", "correct decision"); + +$mc[3] = new_multiple_choice(); +$mc[3] -> qa('"The mean body temperature for humans in fact differs from \(98.6\) degrees Farenheit and the result of the sampling lead to that conclusion" is a', "correct decision"); +$mc[3] -> extra("Type II error", "Type I error"); + +@slice = NchooseK(4,4); +@smc = @mc[@slice]; + +@solutions= ("Option \(C\). The mean body temperature for humans in fact is \(98.6\) degrees Farenheit and our data supported that by not rejecting the null hypothesis. This confirms that we should not have rejected the null hypothesis and we didn't! Thus, we have made the correct decision.", + +"Option \(A\). The mean body temperature for humans in fact is \(98.6\) degrees Farenheit but our data did not support that. This resulted in us rejecting the null hypothesis when we should not have! This means we made a Type I error.", + +"Option \(C\). The mean body temperature for humans in fact differs from \(98.6\) degrees but our data did not lead us to that conclusion. This results in us not rejecting the null hypothesis when we should have! This means we made a Type II error.", + +"Option \(A\). The mean body temperature for humans in fact differs from \(98.6\) degrees Farenheit but our data did not support that conclusion. This means we should have rejected the null hypothesis but didn't! Therefore we made a Type II error.",) +; + +@ssols = @solutions[@slice]; + +BEGIN_TEXT +Consider the following hypothesis test. The null hypothesis is "The mean body temperature for humans is \(98.6\) degrees Farenheit." and the alternative hypothesis is "The mean body temperature for humans differs from \(98.6\) degrees Farenheit." Answer the following questions. +$PAR +a. +\{ $smc[0]-> print_q() \} $BR +\{ $smc[0]-> print_a() \} +$PAR +b. +\{ $smc[1]-> print_q() \} $BR +\{ $smc[1]-> print_a() \} +$PAR +c. +\{ $smc[2]-> print_q() \} $BR +\{ $smc[2]-> print_a() \} +$PAR +d. +\{ $smc[3]-> print_q() \} $BR +\{ $smc[3]-> print_a() \} +$PAR +END_TEXT + +ANS(radio_cmp($smc[0]->correct_ans)); +ANS(radio_cmp($smc[1]->correct_ans)); +ANS(radio_cmp($smc[2]->correct_ans)); +ANS(radio_cmp($smc[3]->correct_ans)); + +############################################## +BEGIN_SOLUTION +(a) $ssols[0] +$PAR +(b) $ssols[1] +$PAR +(c) $ssols[2] +$PAR +(d) $ssols[3] +END_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/di13.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/di13.pg new file mode 100644 index 0000000000..a7cffac176 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/di13.pg @@ -0,0 +1,110 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Hypothesis Testing') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Type I/Type II Errors') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +$a='"'; +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mc[0] = new_multiple_choice(); +$mc[0] -> qa("${a}The mean annual consumption of beer in the nation's captial is not less than the national mean and the result of the sampling does not lead to the conclusion that the mean annual consumption of beer in the nation's capital is less than the national mean$a is a", "Correct decision"); +$mc[0] -> extra("Type II error", "Type I error"); + +$mc[1] = new_multiple_choice(); +$mc[1] -> qa("${a}The mean annual consumption of beer in the nation's captial is not less than the national mean but the result of the sampling leads to the conclusion that the mean annual consumption of beer in the nation's capital is less than the national mean$a is a", "Type I error"); +$mc[1] -> extra("Type II error", "Correct decision"); + +$mc[2] = new_multiple_choice(); +$mc[2] -> qa("${a}The mean annual consumption of beer in the nation's captial is less than the national mean but the result of the sampling does not lead to the conclusion that the mean annual consumption of beer in the nation's capital is less than the national mean$a is a", "Type II error"); +$mc[2] -> extra("Type I error", "Correct decision"); + +$mc[3] = new_multiple_choice(); +$mc[3] -> qa("${a}The mean annual consumption of beer in the nation's captial is less than the national mean and the result of the sampling leads to the conclusion that the mean annul consumption of beer in the nation's capital is less than the national mean$a is a", "Correct decision"); +$mc[3] -> extra("Type II error", "Type I error"); + +@slice = NchooseK(4,4); +@smc = @mc[@slice]; + +@solutions= ("Option \(C\). The mean annual consumption of beer in the nation's captial is not less than the national mean and our data supported that by not rejecting the null hypothesis. This confirms that we should not have rejected the null hypothesis and we didn't! Thus, we have made the correct decision.", + +"Option \(A\). The mean annual consumption of beer in the nation's captial is not less than the national mean but our data makes us think it is. This resulted in us rejecting the null hypothesis when we should not have! This means we made a Type I error.", + +"Option \(C\). The mean annual consumption of beer in the nation's captial is less than the national mean but our data did not lead us to that conclusion. This results in us not rejecting the null hypothesis when we should have! This means we made a Type II error.", + +"Option \(A\). The mean annual consumption of beer in the nation's captial is less than the national mean and our data supported that conclusion. This means we made the correct decision.",) +; + +@ssols = @solutions[@slice]; + +BEGIN_TEXT +Consider a hypothesis test to decide whether the mean annual consumption of beer in the nation's capital is less than the national mean. Answer the following questions. +$PAR +a. +\{ $smc[0]-> print_q() \} $BR +\{ $smc[0]-> print_a() \} +$PAR +b. +\{ $smc[1]-> print_q() \} $BR +\{ $smc[1]-> print_a() \} +$PAR +c. +\{ $smc[2]-> print_q() \} $BR +\{ $smc[2]-> print_a() \} +$PAR +d. +\{ $smc[3]-> print_q() \} $BR +\{ $smc[3]-> print_a() \} +$PAR +END_TEXT + +ANS(radio_cmp($smc[0]->correct_ans)); +ANS(radio_cmp($smc[1]->correct_ans)); +ANS(radio_cmp($smc[2]->correct_ans)); +ANS(radio_cmp($smc[3]->correct_ans)); + +############################################## +BEGIN_SOLUTION +(a) $ssols[0] +$PAR +(b) $ssols[1] +$PAR +(c) $ssols[2] +$PAR +(d) $ssols[3] +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + +## These tags keep this problem from being added to the NPL database +## +## DBsubject('ZZZ-Inserted Text') +## DBchapter('ZZZ-Inserted Text') +## DBsection('ZZZ-Inserted Text') + diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/di14.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/di14.pg new file mode 100644 index 0000000000..26dd13c9d8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/di14.pg @@ -0,0 +1,105 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Hypothesis Testing') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Type I/Type II Errors') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +$a='"'; +TEXT(beginproblem()); +$mc[0] = new_multiple_choice(); +$mc[0] -> qa("$a The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean and the result of the sampling does not lead to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean $a is a", "correct decision"); +$mc[0] -> extra("Type II error", "Type I error"); + +$mc[1] = new_multiple_choice(); +$mc[1] -> qa("$a The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean but the result of the sampling leads to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean $a is a", "Type I error"); +$mc[1] -> extra("Type II error", "correct decision"); + +$mc[2] = new_multiple_choice(); +$mc[2] -> qa("$a The mean cost to community hospitals per patient per day in Ohio exceeds the national mean but the result of the sampling does not lead to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean $a is a", "Type II error"); +$mc[2] -> extra("Type I error", "correct decision"); + +$mc[3] = new_multiple_choice(); +$mc[3] -> qa("$a The mean cost to community hospitals per patient per day in Ohio exceeds the national mean and the result of the sampling leads to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean $a is a", "correct decision"); +$mc[3] -> extra("Type II error", "Type I error"); + +@slice = NchooseK(4,4); +@smc = @mc[@slice]; + +@solutions= ("Option \(C\). The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean and our data supported that by not rejecting the null hypothesis. This confirms that we should not have rejected the null hypothesis and we didn't! Thus, we have made the correct decision.", + +"Option \(A\). The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean but our data did not support that. This resulted in us rejecting the null hypothesis when we should not have! This means we made a Type I error.", + +"Option \(C\). The mean cost to community hospitals per patient per day in Ohio exceeds the national mean but our data did not lead us to that conclusion. This results in us not rejecting the null hypothesis when we should have! This means we made a Type II error.", + +"Option \(A\). The mean cost to community hospitals per patient per day in Ohio exceeds the national mean and our data supported that conclusion. This means we made the correct decision.",) +; + +@ssols = @solutions[@slice]; + +BEGIN_TEXT +Consider a hypothesis test to decide whether the mean cost to community hospitals per patient per day in Ohio exceed the national mean. Answer the following questions. +$PAR +a. +\{ $smc[0]-> print_q() \} $BR +\{ $smc[0]-> print_a() \} +$PAR +b. +\{ $smc[1]-> print_q() \} $BR +\{ $smc[1]-> print_a() \} +$PAR +c. +\{ $smc[2]-> print_q() \} $BR +\{ $smc[2]-> print_a() \} +$PAR +d. +\{ $smc[3]-> print_q() \} $BR +\{ $smc[3]-> print_a() \} +$PAR +END_TEXT + +ANS(radio_cmp($smc[0]->correct_ans)); +ANS(radio_cmp($smc[1]->correct_ans)); +ANS(radio_cmp($smc[2]->correct_ans)); +ANS(radio_cmp($smc[3]->correct_ans)); + +############################################## +BEGIN_SOLUTION +(a) $ssols[0] +$PAR +(b) $ssols[1] +$PAR +(c) $ssols[2] +$PAR +(d) $ssols[3] +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/dueck9_2_1.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/dueck9_2_1.pg new file mode 100644 index 0000000000..6d41b2038b --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/dueck9_2_1.pg @@ -0,0 +1,75 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Hypothesis Testing') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Type I/Type II Errors') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mc1 = new_multiple_choice(); +$mc1->qa('Type I error is:', + 'Deciding null hypothesis is false when it is true' +); +$mc1->extra( + 'Deciding null hypothesis is true when it is false', + 'Deciding alternative hypothesis is true when it is true' +); +$mc1->makeLast( + 'All of the above', + 'None of the above' +); + + +$mc2 = new_multiple_choice(); +$mc2->qa('Type II error is:', + 'None of the above' +); +$mc2->extra( + 'Deciding null hypothesis is false when it is true', + 'Deciding alternative hypothesis is false when it is true', + 'Deciding alternative hypothesis is true when it is true' +); +$mc2->makeLast( + 'All of the above', + 'None of the above' +); + + +BEGIN_TEXT +$PAR +\{ $mc1->print_q() \} +\{ $mc1->print_a() \} +$PAR +\{ $mc2->print_q() \} +\{ $mc2->print_a() \} +END_TEXT +ANS(radio_cmp($mc1->correct_ans)); +ANS(radio_cmp($mc2->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/dueck9_3_1.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/dueck9_3_1.pg new file mode 100644 index 0000000000..f12349a09f --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/dueck9_3_1.pg @@ -0,0 +1,68 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Hypothesis Testing') +## Tagged by dgt5v + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Significance Levels') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = 0.01; +$z1 = -1*udistr($a); +$z2 = udistr($a); +$z3 = udistr($a/2); +$tot1 = ($a); + + +BEGIN_TEXT +Given the significance level \(\alpha = $a\) find the following: $PAR +(a) \( \ \) left-tailed critical \(z^{*}\) value $BR +\(z^{*} = \) \{ans_rule(10)\} $PAR +(b) \( \ \) right-tailed critical \(z^{*}\) value $BR +\(z^{*} = \) \{ans_rule(10)\} $PAR +(c) \( \ \) two-tailed critical \(z^{*}\) value $BR +\(|z^{*}| = \) \{ans_rule(10)\} +END_TEXT +ANS(num_cmp($z1, tol=>.01)); +ANS(num_cmp($z2, tol=>.01)); +ANS(num_cmp($z3, tol=>.01)); + +############################################### +BEGIN_SOLUTION + +(a) If our significance level is \(\alpha = $a\) and we want a left-tailed critical \(z^{*}\) value, this means there is only \($a\), or, \(1$PERCENT\) below the needed \(z^{*}\). Therefore, we can use the inverse technology command, using an area of \(0.01\), to find \(z^{*}\approx$z1\). +$PAR +(b) If our significance level is \(\alpha = $a\) and we want a right-tailed critical \(z^{*}\) value, this means there is only \($a\), or, \(1$PERCENT\) above the needed \(z^{*}\). Therefore, we can use the inverse technology command using an area of \(0.99\). Recall we do this since our technology only can shade in left and if \(0.99\) is below the \(z^{*}\) value in question, only \(0.01\) is above it . Thus, we find \(z^{*}\approx$z2\). +$PAR +A shortcut is to use the fact that the normal curve is symmetrical and thus, assuming the same \(\alpha\) level, the only difference between a left-tailed critical \(z^{*}\) value and a right-tailed critical \(z^{*}\) value is the sign of \(z^{*}\). +$PAR +(c) If our significance level is \(\alpha = $a\) and we want a two-tailed critical \(z^{*}\) value, this means there is only \(0.005\), or, \(0.5$PERCENT\) on each side. \(0.005\), or, \(0.5$PERCENT\) above the positive \(z^{*}\) value and \(0.005\) below the negative \(z^{*}\) value. We can thus use the inverse technology command, using an area of \(0.005\) OR an area of \(0.995\), to find \(|z^{*}|\approx$z3\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa30.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa30.pg new file mode 100644 index 0000000000..0a9e5f02ae --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa30.pg @@ -0,0 +1,76 @@ +##DESCRIPTION +## Statistics: hypothesis test critical regions +##ENDDESCRIPTION + +## KEYWORDS('alpha values') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Elements of a Statistical Test') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"contextPercent.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +$a = random(.01,.1,.01); +$z1 = -1*udistr($a); +$z2 = udistr($a); +$z3 = udistr($a/2); +$tot = (1-$a); +$aperc = Percent($a); +$totperc = Percent($tot); +$atwoside = ($a/2); +$atwosidex = (1-$atwoside); +$atwosideperc = Percent($atwoside); + + +BEGIN_TEXT +Given the significance level \(\alpha = $a\) find the following: $PAR +(a) \( \ \) left-tailed critical \(z^{*}\) value $BR +\(z^{*} = \) \{ans_rule(10)\} $PAR +(b) \( \ \) right-tailed critical \(z^{*}\) value $BR +\(z^{*} = \) \{ans_rule(10)\} $PAR +(c) \( \ \) two-tailed critical \(z^{*}\) value $BR +\(|z^{*}| = \) \{ans_rule(10)\} +END_TEXT +ANS(num_cmp($z1, tol=>.01)); +ANS(num_cmp($z2, tol=>.01)); +ANS(num_cmp($z3, tol=>.01)); + +################################################### +BEGIN_SOLUTION + +(a) If our significance level is \(\alpha = $a\) and we want a left-tailed critical \(z^{*}\) value, this means there is only \($a\), or, \($aperc\) below the needed \(z^{*}\). Therefore, we can use the inverse technology command, using an area of \($a\), to find \(z^{*}=$z1\) +$PAR +(b) If our significance level is \(\alpha = $a\) and we want a right-tailed critical \(z^{*}\) value, this means there is only \($a\), or, \($aperc\) above the needed \(z^{*}\). Therefore, we can use the inverse technology command using an area of \($tot\). Recall we do this since our technology only can shade in left and if \($totperc\) is below the \(z^{*}\) value in question, only \($a\) is above it . Thus, we find \(z^{*}=$z2\) +$PAR +A shortcut is to use the fact that the normal curve is symmetrical and thus, assuming the same \(\alpha\) level, the only difference between a left-tailed critical \(z^{*}\) value and a right-tailed critical \(z^{*}\) value is the sign of \(z^{*}\). +$PAR +(c) If our significance level is \(\alpha = $a\) and we want a two-tailed critical \(z^{*}\) value, this means there is only \($atwoside\), or, \($atwosideperc\) on each side. \($atwoside\), or, \($atwosideperc\) is above the positive \(z^{*}\) value and \($atwoside\) below the negative \(z^{*}\) value. We can thus use the inverse technology command, using an area of \($atwoside\) OR an area of \($atwosidex\), to find \(|z^{*}|=$z3\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa33.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa33.pg new file mode 100644 index 0000000000..7abaa79f3c --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa33.pg @@ -0,0 +1,76 @@ +##DESCRIPTION +## Statistics: hypothesis tests +##ENDDESCRIPTION + +##KEYWORDS('statistics','hypothesis testing') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Elements of a Statistical Test') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGauxiliaryFunctions.pl", +"PGanswermacros.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a1 = random(0.07,0.10,.1); +$a2 = random(.01,.05,.1); + + +@event = (' \(\alpha = '."$a1".',\ P\)-value \(= 0.06\)', ' \(\alpha = '."$a2".',\ P\)-value \(= 0.06\)'); +@ans = ("reject null hypothesis", "do not reject null hypothesis"); + +@slice = NchooseK(2,2); +@sevent = @event[@slice]; +@sans = @ans[@slice]; + +$popup0 = PopUp(["?","reject null hypothesis","do not reject null hypothesis"],$sans[0]); + +$popup1 = PopUp(["?","reject null hypothesis","do not reject null hypothesis"],$sans[1]); + +BEGIN_TEXT + +In each part, we have given the significance level and the \(P\)-value for a hypothesis test. For each case determine if the null hypothesis should be rejected. + $PAR + +(a) \( \) $sevent[0] $BR +\{$popup0->menu\} $PAR +(b) \( \) $sevent[1] $BR +\{$popup1->menu\} + + +END_TEXT +ANS($popup0->cmp); +ANS($popup1->cmp); + +########################################### +BEGIN_SOLUTION +Recall that for hypothesis testing, when our \(P\)-value \(<\alpha\) we reject the null hypothesis in favor of the alternative. When our \(P\)-value \(>\alpha\), we do not reject the null hypothesis. +$PAR +(a) Therefore according to the above convention: $sans[0]. +$PAR +(b) Therefore according to the above convention: $sans[1]. + +END_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa54.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa54.pg new file mode 100644 index 0000000000..a7d7bc53df --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa54.pg @@ -0,0 +1,109 @@ +##DESCRIPTION +## Statistics: Hypothesis testing +##ENDDESCRIPTION + +##KEYWORDS('statistics','hypothesis testing','samples') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Common Large-Sample Tests') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +$n = random(90,130,10); +$n1 = random($n/2+3,$n/2+7,1); +$p = Real($n1/$n); +$q = (1-$p); +$a = random(.01,.05,.04); +$ap = (100*$a); +$tot = (1-$a); +$totp = (100*$tot); +$sd = Real(sqrt(0.25/$n)); +$test = ($p-.5)/(sqrt (.25/$n)); +$z = udistr($a); +$pval = Percent(normal_prob($test,infty)); + +$diagram = DrawNormalDist(99, $test, "", $test, outside=>1); + + +$mc = new_multiple_choice(); + +@ans = ("there is sufficient evidence to conclude that more than half of the surveyed preferred Diet Pepsi over Diet Coke. ", + "There is not sufficient evidence to conclude that more than half of the surveyed preferred Diet Pepsi over Diet Coke. "); + +if ($test > $z ) {$tag = 0;} else {$tag = 1;} + +$mc -> qa('The final conclusion is that', $ans[$tag]); + +$mc -> extra($ans[1-$tag]); + + +BEGIN_TEXT +According to a recent marketing campaign, \($n\) drinkers of either Diet Coke or Diet Pepsi participated in a +blind taste test to see which of the drinks was their favorite. In one Pepsi television commercial, an +announcer states that "in recent blind taste tests, more than one half +of the surveyed preferred Diet Pepsi over Diet Coke." Suppose that out of those \($n\), \($n1\) +preferred Diet Pepsi. Using \(\alpha = $a\) as your benchmark for declaring significance, test the hypothesis that more than half of all participants will select Diet Pepsi in a blind taste test by giving the following: $BR +(a) the \(z\)-score for the sample is \{ans_rule(10)\} $BR +(b) the critical \(z\) score for declaring significant evidence is \{ans_rule(10)\} +$PAR +\{ $mc->print_q() \} +\{ $mc->print_a() \} + +END_TEXT + +ANS(num_cmp($test, tolType=>'absolute', tol=>0.01)); +ANS(num_cmp($z, tolType=>'absolute', tol=>0.01)); +ANS(radio_cmp($mc->correct_ans)); + +################################################# +BEGIN_SOLUTION +(a) Will more than half of all participants select Diet Pepsi as their preference? This tells us we will have a one sided hypothesis test using the \(>\) sign in our alternative hypothesis. Since \($n1\) out of \($n\) people selected Diet Pepsi we know that \(\hat{p} \approx $p\). We want to test if this is evidence that more than half of all participants select Diet Pepsi, which means we will use \(p=0.5\). Thus we can find, \(\operatorname{SD}(\hat{p})=\sqrt{\frac{0.5\cdot 0.5}{$n}} \approx $sd\). +$PAR +Therefore our test statistic is \(z=\frac{$p-0.5}{$sd}\approx$test\). +$PAR +(b) The critical \(z\)-score for declaring significant evidence is the same as saying ''beyond what \(z\)-score do we start rejecting the null hypothesis?'' Since our significance level is \(\alpha = $a\), and the question was if more than half of participants selected Diet Pepsi, this means we want a right-tailed critical \(z\)-score. This mean only \($a\), or, \($ap$PERCENT\) is above the needed critical \(z\)-score. Therefore, we can use the inverse technology command using an area of \($tot\). Recall we do this since our technology only can shade in left and if \($totp$PERCENT\) is below the critical \(z\)-score value in question, only \($ap$PERCENT\) is above it . Thus, we find a critical \(z\)-score of \(z\approx$z\). +$PAR +(c) The final conclusion requires a \(P\)-value. Using technology and our test statistic of \(z\approx$test\), we find a \(P\)-value of \($pval\), also seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +The final conclusion is that: $ans[$tag] +$PAR +This conclusion is always based on the fact that if our \(P\)-value is less than \(\alpha\) we reject the null hypothesis and if our \(P\)-value is great than \(\alpha\) we do not reject the null hypothesis. +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa56.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa56.pg new file mode 100644 index 0000000000..ac998114f7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa56.pg @@ -0,0 +1,112 @@ +##DESCRIPTION +## Statistics: Hypothesis testing +##ENDDESCRIPTION + +##KEYWORDS('statistics','hypothesis testing') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Common Large-Sample Tests') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); + +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +$n = random(1000, 2000, 5); +$p = random(8,12,1); +$pdec = ($p/100); +$qdec = (1-$pdec); +$sd = Real(sqrt($pdec*$qdec/$n)); +$x = random(int($n*$p/100)-25, int($n*$p/100)-5, 1); +$po = Real($x/$n); +$test = (($po-$pdec)/($sd)); +$alpha = random(0.01, 0.05, 0.04); +$alphap = Percent($alpha); + +$stat = ($x/$n - $p/100)*sqrt($n)/sqrt($p/100*(100-$p)/100); +$crit = udistr(1-$alpha); +$pvalue = 1-uprob($stat); +$pval = Percent(normal_prob(-infty,$test)); + +$diagram = DrawNormalDist($test,-99,$test,"", outside=>1); + +if ( $stat < $crit ) { $tag = 0; } else { $tag = 1; } + +@ans = ("There is sufficient evidence to support the claim that less than \($p$PERCENT\) + of vacations include a theme park visit.", + "There is not sufficient evidence to support the claim that less than \($p$PERCENT\) + of vacations include a theme park visit."); + +$mc = new_multiple_choice(); + +$mc -> qa ( "The conclusion is ", $ans[$tag]); + +$mc -> extra ($ans[1-$tag]); + +BEGIN_TEXT + +A survey of \($n\) people who took vacations revealed that \($x\) of them included +a visit to a theme park. Based on those survey results, a management consultant claims +that less than \($p$PERCENT\) of vacations include a theme park visit. +Test this claim using the \( \alpha = $alpha \) significance level. $BR$BR + +Assuming \(H_0\), the \(z\)-score of the sample is \{ans_rule(30)\} $BR$BR + +The critical \(z\)-score for declaring significant evidence is \{ans_rule(30)\} $BR$BR + +The \(P\)-value of the hypothesis test is \{ans_rule(30)\} $BR$BR + +\{ $mc -> print_q() \} $BR + +\{ $mc -> print_a() \} $BR + +END_TEXT +Context("Percent"); +ANS(Real($stat)->cmp); +ANS(Real($crit)->cmp); +ANS(Percent($pvalue)->cmp); +ANS(radio_cmp($mc->correct_ans)); + +################################################# +BEGIN_SOLUTION +(a) A management consultant claims that less than \($p$PERCENT\) of vacations include a theme park. This means we will have a one sided test with \(<\) in our alternative hypothesis. This also means we know that \(p=$pdec\) and since \($x\) out \($n\) vacations did visit a theme park, \(\hat{p}=$po\). Thus we can find, \(\operatorname{SD}(\hat{p})=\sqrt{\frac{$pdec\cdot $qdec}{$n}} \approx $sd\). +$PAR +Therefore our \(z\)-score is \(z=\frac{$po-$pdec}{$sd}\approx$test\). +$PAR +(b) The critical \(z\)-score for declaring significant evidence is the same as saying ''beyond what \(z\)-score do we start rejecting the null hypothesis?'' Since our significance level is \(\alpha = $alpha\), and the claims was that less than \($p$PERCENT\) of vacations include a theme park, this means we want a left-tailed critical \(z\)-score. This means only \($alpha\), or, \($alphap\) is below the needed critical \(z\)-score. Therefore, we can use the inverse technology command using an area of \($alpha\). Thus, we find \(z\approx$crit\). +$PAR +(c) We require technology to find our \(P\)-value. Using technology and our test statistic of \(z\approx$test\), we find a \(P\)-value of \($pval\), also seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +(d) The final conclusion is that: $ans[$tag] This conclusion is always based on the fact that if our \(P\)-value is less than \(\alpha\) we reject the null hypothesis and if our \(P\)-value is great than \(\alpha\) we do not reject the null hypothesis. +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa57.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa57.pg new file mode 100644 index 0000000000..94c6d26bdc --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa57.pg @@ -0,0 +1,93 @@ +##DESCRIPTION +## Statistics: Hypothesis testing +##ENDDESCRIPTION + +##KEYWORDS('statistics','hypothesis testing') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Common Large-Sample Tests') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + "PGanswermacros.pl", + "contextPercent.pl", + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGauxiliaryFunctions.pl", + "PGstatisticsmacros.pl", + "PGnumericalmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Percent"); +$n = random(800,1000,10); +$p1 = random(.5,.6,.01); +$a = (100*$p1); +$adec = ($a/100); +$m1 = $p1-.05; +$m2 = $p1-.01; +$p = random($m1,$m2,.01); +$q = (1-$p); +$sd = Real(sqrt(($p*$q)/$n)); +$z = Real(($p1-$p)/$sd); +$pvalue = uprob($z); + +$pvalperc = Percent($pvalue); + +$diagram = DrawNormalDist(99, $z,"",$z, outside=>1); + +BEGIN_TEXT +Physicians at a clinic gave what they thought were drugs to \($n\) patients. Although the doctors later learned that the drugs +were really placebos, \($a$PERCENT\) of the patients reported an improved +condition. Assume that if the placebo is ineffective, the probability of a +patient's condition improving is \($p\). Test the hypothesis that the proportion +of patients improving is greater than \($p\). $BR $BR + +Find the test statistic for the sample: $BR $BR + +\( z =\) \{ans_rule(10)\} $BR $BR + +Find the \(P\)-value of the hypothesis test.$PAR + +\( P =\) \{ans_rule(10)\} +END_TEXT +Context("Percent"); +ANS(Real($z)->cmp); +ANS(Percent($pvalue)->cmp); + +################################################# +BEGIN_SOLUTION +(a) We want to test the hypothesis that the proportion of patients improving is greater \($p\), this also means \(p=$p\). This mean we will use a one sided test with the \(>\) sign in our alternative hypothesis. Of the \($n\) patients, \($a$PERCENT\) reported improvement, this means \(\hat{p}= $adec\). Thus we can find, \(\operatorname{SD}(\hat{p})=\sqrt{\frac{($p)($q)}{$n}} \approx $sd\). +$PAR +Therefore our test statistic is \(z=\frac{$adec-$p}{$sd}\approx$z\). +$PAR +(b) We require technology to find a \(P\)-value. Using technology and our test statistic of \(z\approx$z\), we find a \(P\)-value of \($pvalue\), or, \($pvalperc\), also seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa58.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa58.pg new file mode 100644 index 0000000000..cf6602fade --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/kolossa58.pg @@ -0,0 +1,120 @@ +##DESCRIPTION +## Statistics: Hypothesis testing +##ENDDESCRIPTION + +##KEYWORDS('hypothesis testing','population proportion','statistics') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Common Large-Sample Tests') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PG.pl", + "PGbasicmacros.pl", + "PGanswermacros.pl", + "contextPercent.pl", + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "contextPercent.pl", + "PGnumericalmacros.pl", + "PGauxiliaryFunctions.pl", + "PGstatisticsmacros.pl", + "PGnumericalmacros.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "parserOneOf.pl", + ); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +$n = random(1900,2500,100); +$a = random (.01, .05, .04); +$a2 = ($a/2); +$alower = (1-$a); +$alower2 = (1-$a2); +$phat = random(12.5,12.8,.1); +$x = int($n*.116); + +$p = Real($x/$n); +$ph = $phat/100; +$q = 1-$ph; +$sd = Real(sqrt ($ph*$q/$n)); +$z = Real(($p-$ph)/$sd); +$zneg = -$z; +$crit = udistr($a/2); + +$pval = (normal_prob(-infty,$z)); +$pvaltwo = (2*$pval); +$pper = ($pvaltwo*100); + +$diagram = DrawNormalDist($z, $zneg, $z, $zneg, outside=>1); + +if ( $pvaltwo > $a ) { $tag = 0; } else { $tag = 1; } + +@ans = ("There is not sufficient evidence to conclude that the percentage of \(18\text{-}25\)-year-olds who currently use marijuana or hashish has changed from the \(1997\) percentage of \($phat$PERCENT\).", + "There is sufficient evidence to conclude that the percentage of \(18\text{-}25\)-year-olds who currently use marijuana or hashish has changed from the \(1997\) percentage of \($phat$PERCENT\)."); + +$mc3 = new_multiple_choice(); + +$mc3 -> qa ("The conclusion is", $ans[$tag]); + +$mc3 -> extra ($ans[1-$tag]); + +BEGIN_TEXT +A recent poll of \($n\) randomly selected \(18\text{-}25\)-year-olds revealed that \($x\) currently use marijuana or hashish. According to a publication, \($phat$PERCENT\) of \(18\text{-}25\)-year-olds were current users of marijuana or hashish in \(1997\). Do the data provide sufficient evidence to conclude that the percentage of \(18\text{-}25\)-year-olds who currently use marijuana or hashish has changed from the \(1997\) percentage of \($phat$PERCENT\)? Use \(\alpha = $a\) as the level for declaring significance. $PAR + +the sample's test statistic \(z\) is \{ans_rule(10)\} $PAR +the positive critical \(z\) score for declaring significance is \( \ \) \{ans_rule(10)\} $PAR +the negative critical \(z\) score for declaring significance is \( \ \) \{ans_rule(10)\} $BR$BR +\{ $mc3->print_q() \} +$BR +\{ $mc3->print_a() \} + +END_TEXT + +ANS(num_cmp($z, tolType=>'absolute', tol=>0.01)); +ANS(num_cmp($crit, tolType=>'absolute', tol=>.01)); +ANS(num_cmp(-$crit, tolType=>'absolute', tol=>.01)); +ANS(radio_cmp($mc3->correct_ans)); + + +################################################# +BEGIN_SOLUTION +(a) We want to know if the data provides sufficient evidence to conclude that the percentage of \(18\text{-}25\)-year-olds who currently use marijuana or hashish has changed. As there is no mention of greater than or less than, this means we will have a two sided test with \(\neq\) in our alternative hypothesis. As the publication claimed \($phat$PERCENT\) of \(18\text{-}25\)-year-old are current users, we can say \(p=$ph\). Using the recent poll data, we also know \(\hat{p}=$p\). +Thus we can find, \(\operatorname{SD}(\hat{p})=\sqrt{\frac{($ph)($q)}{$n}} \approx $sd\). +$PAR +Therefore our \(z\)-score is \(z=\frac{$p-$ph}{$sd}\approx$z\). +$PAR +(b) The positive critical \(z\)-score for declaring significant evidence is the same as saying ''beyond what \(z\)-score do we start rejecting the null hypothesis?'' Since our significance level is \(\alpha = $a\), we might assume to use the inverse technology command with area \($alower\). But since we have two sided test, half of the \(\alpha\) value is on each side. So, this means we will use area \($alower2\). Thus we find a positive critical \(z\)-score of \($crit\). +$PAR +(c) For the negative critical \(z\)-score, we can use the symmetry of the normal curve to know that it will be the same value from part (b), but negative. Thus, it is \(-$crit\). +$PAR +(d) To conclude we need technology to find our \(p\)-value. Using our test statistic of \(z\approx$z\), we find a \(P\)-value of \($pval\). But we need a two-sided test. Therefore, we need to double our \(P\)-value to obtain a \(p\)-value of \($pvaltwo\), or, \($pper$PERCENT\). The two sided test shading is shown below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +The final conclusion is that: $ans[$tag] +$PAR +This conclusion is always based on the fact that if our \(P\)-value is less than \(\alpha\) we reject the null hypothesis and if our \(P\)-value is great than \(\alpha\) we do not reject the null hypothesis. +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/ur_stt_4_10.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/ur_stt_4_10.pg new file mode 100644 index 0000000000..dbcf24532e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/ur_stt_4_10.pg @@ -0,0 +1,65 @@ +##DESCRIPTION +##KEYWORDS('statistics','hypothesis testing') +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Elements of a Statistical Test') +## Date('6/3/2002') +## Author('') +## Institution('') +## TitleText1('Mathematical Statistics') +## EditionText1('6') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## Section1('10.2') +## Problem1('2') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$truep = random(.41, .7, .01); +$n = random(31,50,1); +$p = $truep+random(.05, .1, .01); +$sigma = sqrt($p*(1-$p)/$n); + +$pcrit = $p-1.6448536*$sigma; + +$sigma1 = sqrt($truep*(1-$truep)/$n); + + +$z = ($pcrit - $truep)/$sigma1; +$ans = uprob($z); + +BEGIN_TEXT + +Assume you are using a significance level of \( \alpha = 0.05 \) to test the claim that +\(p < $p \) and that your sample is a random sample of \( $n \) values. +Find \( \beta \), the probability of making a type II error (failing to reject +a false null hypothesis), given that the population actually has \( p = $truep\).$BR + +\( \beta =\)\{ans_rule(20)\} + + +END_TEXT +Context("Percent"); +ANS(Percent($ans)->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/ur_stt_4_4.pg b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/ur_stt_4_4.pg new file mode 100644 index 0000000000..2b9c5e655b --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/SignificanceTesting/ur_stt_4_4.pg @@ -0,0 +1,67 @@ +##DESCRIPTION +## +## tsch tagged and PAID on 3-22-2004 + +## DBsubject(Statistics) +## DBchapter(Hypothesis tests) +## DBsection(Concepts) +## Date(6/3/2002) +## MLT(sigvalues) +## Level(1) +## TitleText1('Mathematical Statistics') +## AuthorText1('Wackerly, Mendenhall, Scheaffer') +## EditionText1('6') +## Section1('10.3') +## Problem1('14') +## KEYWORDS('statistics','hypothesis testing') + + +##ENDDESCRIPTION + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +@quest = ('right-tailed','left-tailed'); +$tag = random(0,1,1); +$a = random(0.01,0.10,0.01); +$tot = (1-$a); + +$ans = udistr($a) * (-1)**$tag; + +BEGIN_TEXT + +Find the critical \( z \) value for a $quest[$tag] test using a significance level of +\(\alpha = $a. \) + +\{ans_rule(5)\} + +END_TEXT + +ANS(num_cmp($ans,tol=>0.007)); + +########################################## +BEGIN_SOLUTION +Recall that the critical \(z\)-value for declaring significant evidence is the same as saying ''beyond what \(z\)-score do we start rejecting the null hypothesis?'' For a left side test we use the inverse technology command with the area \($a\). +$PAR +For a right sided test, our technology cannot shade in to the right when finding an inverse, therefore we need to have it shade in \(1-\alpha\), or, in this case, with the area \(1-\alpha=$tot\). +$PAR +Thus, in this situation we have a $quest[$tag] test. With technology, we find a critical \(z\)-value of \($ans\). +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/TypeITypeIIError/ErrorTypes10.pg b/OpenProblemLibrary/PCC/Statistics/TypeITypeIIError/ErrorTypes10.pg new file mode 100644 index 0000000000..146c0feea8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/TypeITypeIIError/ErrorTypes10.pg @@ -0,0 +1,84 @@ +## DESCRIPTION +## Statistics +## ENDDESCRIPTION + +## KEYWORDS('Statistics','Hypothesis Testing') + +## DBsubject('Statistics') +## DBchapter('Hypothesis Testing') +## DBsection('Type I/Type II Errors') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + + +#################################################### +DOCUMENT(); + +#################################################### + +loadMacros( +"PGstandard.pl", +"PGchoicemacros.pl", +"PGasu.pl", +"PGML.pl", +"PGcourse.pl", +); + +#################################################### + +TEXT(beginproblem()); + +$mc[0] = new_multiple_choice(); +$mc[0] -> qa('"'."The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean, and the result of the sampling does not lead to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean".'"'." is a", "correct decision"); +$mc[0] -> makeLast("correct decision","Type I error", "Type II error"); + +$mc[1] = new_multiple_choice(); +$mc[1] -> qa('"'."The mean cost to community hospitals per patient per day in Ohio does not exceed the national mean but the result of the sampling leads to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean".'"'." is a", "Type I error"); +$mc[1] -> makeLast("correct decision","Type I error", "Type II error"); + +$mc[2] = new_multiple_choice(); +$mc[2] -> qa('"'."The mean cost to community hospitals per patient per day in Ohio exceeds the national mean but the result of the sampling does not lead to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean".'"'." is a", "Type II error"); +$mc[2] -> makeLast("correct decision","Type I error", "Type II error"); + +$mc[3] = new_multiple_choice(); +$mc[3] -> qa('"'."The mean cost to community hospitals per patient per day in Ohio exceeds the national mean and the result of the sampling leads to the conclusion that the mean cost to community hospitals per patient per day in Ohio exceeds the national mean".'"'." is a", "correct decision"); +$mc[3] -> makeLast("correct decision","Type I error", "Type II error"); + +@slice = NchooseK(4,4); +@smc = @mc[@slice]; + +#################################################### + +BEGIN_PGML +Consider a hypothesis test to decide whether the mean cost to community hospitals per patient per day in Ohio exceeds the national mean. Answer the following questions. + +a) [@$smc[0]-> print_q() @]* +[@ $smc[0]-> print_a() @]* + +a) [@$smc[1]-> print_q() @]* +[@ $smc[1]-> print_a() @]* + +a) [@$smc[2]-> print_q() @]* +[@ $smc[2]-> print_a() @]* + +a) [@$smc[3]-> print_q() @]* +[@ $smc[3]-> print_a() @]* + +END_PGML + +#################################################### + +ANS(radio_cmp($smc[0]->correct_ans)); +ANS(radio_cmp($smc[1]->correct_ans)); +ANS(radio_cmp($smc[2]->correct_ans)); +ANS(radio_cmp($smc[3]->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/TypesOfData/01Stats_04_PictDistnsWGraphs.pg b/OpenProblemLibrary/PCC/Statistics/TypesOfData/01Stats_04_PictDistnsWGraphs.pg new file mode 100644 index 0000000000..d8d36fbc4d --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/TypesOfData/01Stats_04_PictDistnsWGraphs.pg @@ -0,0 +1,111 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 1: Picturing Distributions with Graphs') +## KEYWORDS('statistics', 'quantitative data', 'categorical data') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 1: Picturing Distributions with Graphs') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@event = ("The amount of bacteria on a piece of moldy bread.", + "The marital status of your coworkers.", + "The occupation of your neighbors.", + "The time it takes for your car to get an oil change.", + "How long it takes you to run a mile.", + "The condition of a used car you're thinking about purchasing."); +@ans = ("Quantitative", "Categorical", "Categorical", "Quantitative", "Quantitative", "Categorical"); + +@slice = NchooseK(4,4); +@sevent = (@event[@slice]); +@sans = (@ans[@slice]); + +for my $i (0..3) +{$popup[$i] = PopUp(["?", "Quantitative", "Categorical"], $sans[$i]);}; + +@solutions = ("The amount of bacteria is a quantity, thus we have quantitative data.", + +"A marital status is really a yes or no question, you are married or you are not. So, with no quantity involved, it is categorical data.", + +"Your neighbors occupation could be anything, a janitor, a mechanic, a banker, etc. Each of these does not involve units or quantities, thus it is categorical.", + +"The number of minutes it takes for something to occur is a quantity. Therefore, it is quantitative data.", + +"The amount of time it takes to run a mile is a quantity, thus it is quantitative.", + +"When buying a car, the we mostly say the condition is poor, normal or good. Each of these are qualities and thus categorical data.", + +); + +@ssols = (@solutions[@slice]); + +###################################### +# Main text + +BEGIN_TEXT +Determine whether the following examples of data are quantitative or categorical. + +$PAR +(a) \( \) $sevent[0] +$BR +\{ $popup[0]->menu() \} + +$PAR +(b) \( \) $sevent[1] +$BR +\{ $popup[1]->menu() \} + +$PAR +(c) \( \) $sevent[2] +$BR +\{ $popup[2]->menu() \} + +$PAR +(d) \( \) $sevent[3] +$BR +\{ $popup[3]->menu() \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +for my $i (0..3) +{ANS( $popup[$i]->cmp() );}; + + +#################################### +BEGIN_SOLUTION + +(a) $sans[0] data. $ssols[0] +$PAR +(b) $sans[1] data. $ssols[1] +$PAR +(c) $sans[2] data. $ssols[2] +$PAR +(d) $sans[3] data. $ssols[3] + +END_SOLUTION + +#################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes1.pg b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes1.pg new file mode 100644 index 0000000000..4b6afed011 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes1.pg @@ -0,0 +1,107 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variable is being studied? Check $BITALIC all$EITALIC that apply.", +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +); + +$mc -> extra( +"Quantitative (aka Interval) $BR", +"Rank (aka Ordinal) $BR", +"Discrete $BR", +"Continuous $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +A polling organization in the state of Oregon asked voters if they considered themselves members of the following political parties: "Democrat", "Republican", "Independent", "Libertarian", "Green", "Constitution", "Working Families", "Peace", or "none of the above". + +$PAR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +Will respondents be giving the pollsters numerical responses? Or will they be responding with a category? +END_HINT + + +Context()->normalStrings; + +############################################## + +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +The correct answer is \{ $mc->correct_ans() \}. Each possible response from an individual is not a number, so this data is not Quantitative or Rank. Discrete data and Continuous data are special cases of Quantitative data, so these are not correct answers either. Categorical and Qualitative mean exactly the same thing, and this data is of those types, since it effectively categorizes each respondent. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes2.pg b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes2.pg new file mode 100644 index 0000000000..c8650f5a60 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes2.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variable is being studied? Check $BITALIC all$EITALIC that apply.", +"Quantitative (aka Interval) $BR", +"Continuous $BR", +); + +$mc -> extra( +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +"Rank (aka Ordinal) $BR", +"Discrete $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +An agricultural research team is administering a fertilizer additive to corn plants in a particular field and later recording how heavy the ears of corn are. + +$PAR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +Is the recorded information for each individual a number or a category? For any given individual, what are the possibilities for a recorded datum? +END_HINT + + +Context()->normalStrings; + +############################################## + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +The correct answer is \{ $mc->correct_ans() \}. Each individual ear of corn will provide a numerical piece of information; its weight. So we have Quantitative data. More specifically, since the possible weights can take values with any number of decimal point precision, we have Continuous quantitative data. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes3.pg b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes3.pg new file mode 100644 index 0000000000..eb4726084d --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes3.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variable is being studied? Check $BITALIC all$EITALIC that apply.", +"Rank (aka Ordinal) $BR", +); + +$mc -> extra( +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +"Continuous $BR", +"Quantitative (aka Interval) $BR", +"Discrete $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Patients in an intensive care unit in a hospital are asked to rate the pain that they are feeling on a scale of 1 to 10. + +$PAR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +Is the datum from each individual a number, a category, or somehow both? If it's a number, does arithmetic on data make much sense? +END_HINT + + +Context()->normalStrings; + +############################################## + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +The correct answer is \{ $mc->correct_ans() \}. Each individual is basically declaring themselves to be in one of ten possible categories, but the categories have a natural order: a pain assessment of 2 is more painful than a pain assessment of 1, etc. This means that we might have Quantitative Discrete data, or we might have Rank data. But arithmetic on the data doesn't make much sense. For example, is the difference in pain between a level-9 and level-10 the same as the difference in pain between a level-3 and level-4? Is the pain felt by a level-6 "twice as much" as the pain felt by a level-3? We cannot clearly answer yes to these questions. With arithmetic not really correlating to the values on the pain scale, we do not really have Quantitative data. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes4.pg b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes4.pg new file mode 100644 index 0000000000..3de0be3c85 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes4.pg @@ -0,0 +1,105 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variable is being studied? Check $BITALIC all$EITALIC that apply.", +"Quantitative (aka Interval) $BR", +"Discrete $BR", +); + +$mc -> extra( +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +"Continuous $BR", +"Rank (aka Ordinal) $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +All of the students at Portland Community College are asked to provide their age, in years. + +$PAR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +Is the datum from each individual a number, a category, or somehow both? If it's a number, does arithmetic on data make much sense? +END_HINT + + +Context()->normalStrings; + +############################################## + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +The correct answer is \{ $mc->correct_ans() \}. Each individual is providing a number, so we do not have Qualitative (aka Categorical) data. The values of the data are whole numbers, so the data is not Continuous. And the values of the data really do correlate well to what is being measured: a 50-year-old really does have twice the age of a 25-year-old; the difference in age between a 28-year-old and a 32-year-old is the same as between a 38-year-old and a 42-year-old. So we do not have Rank data. We have Quantitative Discrete data. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes5.pg b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes5.pg new file mode 100644 index 0000000000..8262b8d43e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes5.pg @@ -0,0 +1,128 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mcIndividuals = new_checkbox_multiple_choice(); + +$mcIndividuals -> qa ( +"What or who are the individuals being studied in this situation?", +"Periods of time between fillings at the gas station$BR", +); + +$mcIndividuals -> extra( +"Alex and the attendants who work at the gas station$BR", +"Cars that Alex owns/drives$BR", +"Readings from the gas pump and the car's trip meter$BR", +"Gas mileages, as computed by finding \(\frac{\mbox{miles traveled}}{\mbox{gallons used}}\)$BR", +); + +$mcIndividuals -> makeLast("None of the above"); + + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variables are being studied? Check all that apply.", +"Quantitative (aka Interval) $BR", +"Continuous $BR", +); + +$mc -> extra( +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +"Discrete $BR", +"Rank (aka Ordinal) $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT + +Alex has been wondering how good the gas mileage is for his car. When he goes to the gas station, he writes down the number of miles in his trip meter, fills the tank, and writes down the number of gallons of gas to fill the tank. Then he resets the trip meter. + +$PAR +\{ $mcIndividuals -> print_q() \} +$BBLOCKQUOTE +\{ $mcIndividuals -> print_a() \} +$EBLOCKQUOTE + +$BR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +First ask what is being recorded: a number of miles driven, and a number of gallons of gas used. Each time those things are recorded, who or what are they describing? For example, would \(315\) miles and \(15\) gallons describe Alex or one of the attendants? Clearly not. +END_HINT + + +Context()->normalStrings; + +############################################## + +ANS( checkbox_cmp( $mcIndividuals->correct_ans() ) ); +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +Each time data is recorded here, it is a number that could take high decimal precision. So we have Continuous Quantitative data. And each time we record this data, we are describing a period of time between trips to the gas station. So the answer to the first question is \{ $mcIndividuals->correct_ans() \}, and to the second is \{ $mc->correct_ans() \}. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes6.pg b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes6.pg new file mode 100644 index 0000000000..e73e6728f4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/TypesOfData/DataTypes6.pg @@ -0,0 +1,127 @@ +# WeBWorK problem written by Alex Jordan +# Portland Community College +# ENDDESCRIPTION + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## KEYWORDS() +## TitleText1() +## EditionText1() +## AuthorText1() +## Section1() +## Problem1() +## Author('Alex Jordan') +## Institution('PCC') + + + +############################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGunion.pl", + "PGchoicemacros.pl", + +); + + +TEXT(beginproblem()); + +############################################## + +Context("Numeric"); + +$mcIndividuals = new_checkbox_multiple_choice(); + +$mcIndividuals -> qa ( +"What or who are the individuals being studied in this situation?", +"US households$BR", +); + +$mcIndividuals -> extra( +"People living in the US$BR", +"Three individuals: Houses as a group; apartments as a group; mobiles homes as a group$BR", +"Four individuals: Homes owned with a mortgage; homes owned without a mortgage; homes rented; homes occupied with no rent$BR", +"The US Census Bureau$BR", +); + +$mcIndividuals -> makeLast("None of the above"); + + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"What kind of variables are being studied? Check $BITALIC all$EITALIC that apply.", +"Categorical (aka Nominal) $BR", +"Qualitative $BR", +); + +$mc -> extra( +"Quantitative (aka Interval)$BR", +"Continuous $BR", +"Discrete $BR", +"Rank (aka Ordinal) $BR", +); + +$mc -> makeLast("None of the above"); + + + +############################################## + +Context()->texStrings; + +BEGIN_TEXT +The US Census Bureau conducted its 2010 survey and among the questions that were sent to US households was "Is this house, apartment, or mobile home: owned with mortgage, owned without mortgage, rented, or occupied without rent?" + +$PAR +\{ $mcIndividuals -> print_q() \} +$BBLOCKQUOTE +\{ $mcIndividuals -> print_a() \} +$EBLOCKQUOTE + +$BR +\{ $mc -> print_q() \} +$BBLOCKQUOTE +\{ $mc -> print_a() \} +$EBLOCKQUOTE + +END_TEXT + + +$showHint = 3; +BEGIN_TEXT +$PAR +If you don't get this in $showHint tries, you can get a hint. +END_TEXT +BEGIN_HINT +First ask what is being recorded: a home ownership/rentership status. Each time this thing is recorded, who or what is it describing? +END_HINT + + +Context()->normalStrings; + +############################################## + +ANS( checkbox_cmp( $mcIndividuals->correct_ans() ) ); +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +Context()->texStrings; +BEGIN_SOLUTION +Each time data is recorded here, it is a ownership/rentership status, and not numerical at all. So we have Categorical data, aka Qualitative data. And each time we record this data, we are describing a household, not the individuals in that household or any of the other options presented. So the answer to the first question is \{ $mcIndividuals->correct_ans() \}, and to the second is \{ $mc->correct_ans() \}. + +END_SOLUTION +Context()->normalStrings; + +COMMENT('Fixed multiple choice with random ordering.'); + + + +ENDDOCUMENT(); + diff --git a/OpenProblemLibrary/PCC/Statistics/TypesOfData/stat212-HW01-02.pg b/OpenProblemLibrary/PCC/Statistics/TypesOfData/stat212-HW01-02.pg new file mode 100644 index 0000000000..9d83950971 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/TypesOfData/stat212-HW01-02.pg @@ -0,0 +1,149 @@ +## DESCRIPTION +## Statistics: Descriptive statistics +## ENDDESCRIPTION + +## NAW tagged this problem. + +## DBsubject(Statistics) +## DBchapter(Exploratory data analysis/descriptive statistics) +## DBsection(Classifying data) +## Date(5/26/2005) +## Institution(UVA) +## Author(Nolan A. Wages) +## Level(3) +## TitleText1('Statistics for Management and Economics') +## AuthorText1('Keller, Warrack') +## EditionText1('6') +## Section1('.') +## Problem1('') +## KEYWORDS('statistics', 'descriptive statistics', 'variable', 'quantitative') + + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; +install_problem_grader(~~&std_problem_grader); + +$mc[1] = new_multiple_choice(); +$mc[1]->qa('Quantitative Data: ', + 'are always numeric' +); +$mc[1]->extra( + 'are always nonnumeric', + 'may be either numeric or nonnumeric' +); +$mc[1]->makeLast( + 'None of the above answers is correct' +); + + +$mc[2] = new_multiple_choice(); +$mc[2]->qa('In a questionnaire, respondents are asked to mark their gender as male or female. +Gender is an example of a: ', + 'qualitative variable' +); +$mc[2]->extra( + 'quantitative variable', + 'qualitative or quantitative variable, depending on how the respondents answered the question' + ); +$mc[2]->makeLast( + 'None of the above answers is correct' +); + +$mc[3] = new_multiple_choice(); +$mc[3]->qa('Qualitative data: ', + 'are labels used to identify attributes of elements' +); +$mc[3]->extra( + 'indicate either how much or how many', + 'cannot be numeric', + 'must be nonnumeric' +); + + +$mc[4] = new_multiple_choice(); +$mc[4]->qa('Qualitative data: ', + 'may be either numeric or nonnumeric' +); +$mc[4]->extra( + 'must be numeric', + 'must be nonnumeric', + 'cannot be numeric' +); + + +$mc[5] = new_multiple_choice(); +$mc[5]->qa('Ordinary arithmetic operations are meaningful: ', + 'only with quantitative data' +); +$mc[5]->extra( + 'only with qualitative data', + 'either with quantitative or qualitative data' +); +$mc[5]->makeLast( + 'None of the above answers is correct' +); + + +$a = random(1,5,1); +$b = random(1,5,1); +while ($a == $b) { + $b = random(1,5,1); +} + +@solutions = ("Quantitative data is always numeric, since it always refers to a quantity with units, it must be numeric..", + +"Gender is an example of categorical data. Gender does not have a unit or quantity associated with it, only a ''type,'' thus it is categorical data.", + +"Qualitative data identifies attributes, such as hair color, method of transportation, etc.", + +"Qualitative data can be numeric or non-numeric. Your relationship status, single, married, dating, etc, is non-numeric. The area code of your cellular phone or home phone is numeric, but still qualitative. It does not measure anything, it is simply a code for where you live, which is an attribute, not a quantity.", + +"Arithmetic operations, such as addition, subtraction, etc, are only meaningful for quantitative data. For example, \(10$DOLLARS + 15$DOLLARS = 25$DOLLARS\). Blue eyes plus brown eyes is meaningless.", + +); + +$ssols1 = (@solutions[$a-1]); +$ssols2 = (@solutions[$b-1]); + +################################## +BEGIN_TEXT +$PAR +\{ $mc[$a]->print_q() \} + +\{ $mc[$a]->print_a() \} +$PAR +\{ $mc[$b]->print_q() \} + +\{ $mc[$b]->print_a() \} +$PAR + +END_TEXT + +ANS(radio_cmp($mc[$a]->correct_ans)); +ANS(radio_cmp($mc[$b]->correct_ans)); + +#################################### +BEGIN_SOLUTION + +(a) Option \{$mc[$a]->correct_ans\}. $ssols1 +$PAR +(b) Option \{$mc[$b]->correct_ans\}. $ssols2 +$PAR + +END_SOLUTION + +#################################### + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_04_NormalDist.pg b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_04_NormalDist.pg new file mode 100644 index 0000000000..1ac93ce53d --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_04_NormalDist.pg @@ -0,0 +1,110 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextPercent.pl", + "parserNumberWithUnits.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@question = ("About what percent of men are taller than \(74\) inches?", + "About what percent of men are shorter than \(66.5\) inches?", + "About what percent of men are taller than \(69\) inches?", + "About what percent of men are between \(69\) and \(74\) inches?", + "About what percent of men are between \(64\) and \(66.5\) inches?", + "Fill in the blank: About \(2.5\) percent of all men are shorter than $US$US$US$US$US$US$US."); + +Context("Percent"); +@percents = (Percent("2.5 %"), Percent("16 %"), Percent("50 %"), Percent("47.5 %"), Percent("13.5 %")); + +Context("Numeric"); +@inches = NumberWithUnits("64 in"); + +@ans = (@percents, @inches); + +@solutions = ("A height of \(74\) inches corresponds to a \(z\)-score of \(z=\frac{74 - 69}{2.5} = 2\). According to the Empirical Rule, \(95$PERCENT\) of individuals fall within \(2\) standard deviations of the mean. So \(2.5$PERCENT\) of individuals fall above a \(z\)-score of \(2\). So \(2.5$PERCENT\) of men are taller than \(74\) inches", + +"A height of \(66.5\) inches corresponds to a \(z\)-score of \(z=\frac{66.5 - 69}{2.5} = -1\). According to the Empirical Rule, \(68$PERCENT\) of individuals fall within \(1\) standard deviation of the mean. So \(16$PERCENT\) of individuals fall below a \(z\)-score of \(-1\). So \(16$PERCENT\) of men are taller than \(66.5\) inches", + +"A height of \(69\) inches corresponds to a \(z\)-score of \(z=\frac{69 - 69}{2.5} = 0\). The center of the normal curve has a \(z\)-score of \(0\) with half of all individuals above and the other half below the center. So, \(50$PERCENT\) of individuals fall above a \(z\)-score of \(0\). So \(50$PERCENT\) of men are taller than \(69\) inches", + +"A height of \(69\) inches corresponds to a \(z\)-score of \(z=\frac{69 - 69}{2.5} = 0\) and \(74\) inches corresponds to a \(z\)-score of \(\frac{74 - 69}{2.5} = 2\). According to the Empirical Rule, \(95$PERCENT\) of individuals fall within \(2\) standard deviations of the mean. So half of this falls between a \(z\)-score of \(0\) and a \(z\)-score of \(2\). So, \(42.5$PERCENT\) of men are between \(69\) inches and \(74\) inches.", + +"A height of \(64\) inches corresponds to a \(z\)-score \(z=\frac{64 - 69}{2.5} = -2\) of and \(74\) inches corresponds to a \(z\)-score of \(\frac{66.5 - 69}{2.5} = -1\). According to the Empirical Rule, \(68$PERCENT\) of individuals fall within \(1\) standard deviation of the mean and \(95$PERCENT\) of individuals fall within \(2\) standard deviations from the mean. As such, to find the total percentage between \(-1\) and \(-2\) standard deviations from we the mean, we take \(95$PERCENT - 68$PERCENT = 27$PERCENT\), but this also counts the individuals between \(z=1\) and \(z=2\). So half of \(27$PERCENT\), or \(13.5$PERCENT\) of men are between \(64\) inches and \(66.5\) inches.", + +"This question will require we find a height, in inches. We know \(2.5$PERCENT\) of men are shorter than a particular height. Each height has a \(z\)-score, therefore we can find a \(z\)-score for this height. According to the Empirical Rule, a \(z\)-score of of \(-2\) corresponds to a value such that \(2.5$PERCENT\) of all individuals are shorter than this height. Thus, \(-2 = \frac{x-69}{2.5}\), which can be solved to reveal that \(x = 64\). Therefore \(2.5$PERCENT\) of men are shorter than \(64\) inches.", +); + +@slice = NchooseK(6,3); +@squestion = (@question[@slice]); +@sans = (@ans[@slice]); +@ssols = (@solutions[@slice]); +################################################# +# Main + +BEGIN_TEXT +The distribution of heights of adult men in the U.S. is approximately Normal with mean \(69\) inches and standard deviation \(2.5\) inches. Use what you know about a Normal distribution and the $BITALIC \(68\)-\(95\)-\(99.7\) rule$EITALIC to answer the following. +$PAR + +(a) $squestion[0] +$BR + \{ans_rule(20)\} + +$PAR +(b) $squestion[1] +$BR + \{ans_rule(20)\} + +$PAR +(c) $squestion[2] +$BR + \{ans_rule(20)\} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +ANS($sans[0]->cmp); +ANS($sans[1]->cmp); +ANS($sans[2]->cmp); + +###################################### + +BEGIN_SOLUTION + +(a) $ssols[0] + +$PAR +(b) $ssols[1] + +$PAR +(c) $ssols[2] + + + +END_SOLUTION + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_05_NormalDist.pg b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_05_NormalDist.pg new file mode 100644 index 0000000000..73c20f60d7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_05_NormalDist.pg @@ -0,0 +1,81 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGstatisticsmacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + + +@Name = (Mary, Ted, Mike, Nick, Pam, Sam, Kate, John, Greg, Joe); +$tag = random(0,9,1); +$score = 100 + 3* ($tag + 1); + +$diff = Compute($score - 100); +$zscore = Compute($diff / 15); + +@solutions = ("The difference between $Name[$tag]'s IQ and the mean is \(121 - 100 = 21\)", + +"The \(z\)-score for $Name[$tag]'s IQ is \(z = \frac{121 - 100}{15} = 1.4\)",) +; + +@ssols = (@solutions); + +################################################# +# Main + +BEGIN_TEXT +IQ scores have a mean of \(100\) and a standard deviation of \(15\). $Name[$tag] has an IQ of \($score\). + +$PAR +(a) What is the difference between $Name[$tag]'s IQ and the mean? +$BR +\{ ans_rule(10) \} + +$PAR +(b) Convert $Name[$tag]'s IQ score to a \(z\)-score. +$BR +\{ ans_rule(10) \} +END_TEXT + +###################################### + +BEGIN_SOLUTION + +(a) $ssols[0] + +$PAR + +(b) $ssols[1] + +$PAR + +END_SOLUTION + +# Answers + +$showPartialCorrectAnswers = 1; + +ANS($diff->cmp); +ANS($zscore->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_06_NormalDist.pg b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_06_NormalDist.pg new file mode 100644 index 0000000000..d92ed75c97 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_06_NormalDist.pg @@ -0,0 +1,92 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +$w = random(56,77,1); +$m = random(60,84,1); +$zw = ($w - 64) / 2.7; +$zm = ($m - 69.3) / 2.8; +$zm = Real($zm); +$zw = Real($zw); +@solutions = ("Using the \(z\)-score formula with regards to the data for women, we find, \(z_{$w} = \frac{$w - 64}{2.7} = $zw\).", + +"Again using the \(z\)-score formula with regards to the data for men, we find, \(z_{$m} = \frac{$m - 69.3}{2.8} = $zm\)",) +; + +@ssols = (@solutions); + +################################################# +# Main + +BEGIN_TEXT +The heights of women aged \(20\) to \(29\) are approximately Normal with mean \(64\) inches and standard deviation \(2.7\) inches. Men the same age have mean height \(69.3\) inches with standard deviation \(2.8\) inches. +$PAR +(a) What is the \(z\)-score for a woman \($w\) inches tall? +$BR \(z_{$w}\) = \{ans_rule(4)\} +$PAR +(b) What is the \(z\)-score for a man \($m\) inches tall? +$BR \(z_{$m}\) = \{ans_rule(4)\} + +END_TEXT + +################################################# + +###################################### + +BEGIN_SOLUTION + +(a) $ssols[0] + +$PAR + +(b) $ssols[1] + +$PAR + +END_SOLUTION + + +# Answers + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(tolerance=>0.005, tolType=>'absolute'); + +$ans_a = Compute(($w-64)/2.7); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01; + } => ["Your answer is close. Try the calculation using more accuracy."]))); + +$ans_b = Compute(($m-69.30)/2.8); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .01; + } => ["Close! Try redoing the calculation using more accuracy."]))); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_07_NormalDist.pg b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_07_NormalDist.pg new file mode 100644 index 0000000000..35c5f7b9ad --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/03Stats_07_NormalDist.pg @@ -0,0 +1,132 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "parserPopUp.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@Name = ('Ted', 'Nick', 'Mike', 'Kary', 'Mary', 'Fred', 'Sam', 'Pam', 'Joe', 'John', + 'Joan', 'Lisa', 'Kate'); +$tag = random(0,12,1); + +@sub = ('Calculus', 'Biology', 'Spanish', 'History', 'Physics'); +@slice = NchooseK(5,5); +@ssub = @sub[@slice]; + +@mean = (70, 77, 44, 53, 60, 69); +@smean = @mean[@slice]; + +@dev = (12, 10, 12, 16, 14, 8); +@sdev = @dev[@slice]; + +@z = (-1, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2); +@zslice = NchooseK(13,13); +@sz = @z[@zslice]; + +$grade1 = $smean[1] + $sdev[1] * $sz[1]; +$grade2 = $smean[2] + $sdev[2] * $sz[2]; +$grade3 = $smean[3] + $sdev[3] * $sz[3]; +$grade4 = $smean[4] + $sdev[4] * $sz[4]; + +$best = 1; +if ($sz[2] > $sz[1]) { $best = 2;} +if ($sz[3] > $sz[$best]) { $best = 3;} +if ($sz[4] > $sz[$best]) { $best = 4;} + +$popup = PopUp(["?", @ssub], $ssub[$best]); + + +@solutions = ("Using the \(z\)-score formula with regards to the data for $ssub[1], we find, \(z_{$ssub[1]} = \frac{$grade1 - $smean[1]}{$sdev[1]} = $sz[1]\).", + +"Using the \(z\)-score formula with regards to the data for $ssub[2], we find, \(z_{$ssub[2]} = \frac{$grade2 - $smean[2]}{$sdev[2]} = $sz[2]\).", + +"Using the \(z\)-score formula with regards to the data for $ssub[3], we find, \(z_{$ssub[3]} = \frac{$grade3 - $smean[3]}{$sdev[3]} = $sz[3]\).", + +"Using the \(z\)-score formula with regards to the data for $ssub[4], we find, \(z_{$ssub[4]} = \frac{$grade4 - $smean[4]}{$sdev[4]} = $sz[4]\).",) +; + +@ssols = (@solutions); + +################################################# +# Main + +BEGIN_TEXT +$Name[$tag] took \(4\) courses last semester: $ssub[1], $ssub[2], $ssub[3], and $ssub[4]. +The means and standard deviations for the final exams, and $Name[$tag]'s scores are given +in the table below. Convert $Name[$tag]'s scores into \(z\)-scores. +$PAR + +\{begintable(5)\} +\{row('Subject','Mean','Stand. dev.',"$Name[$tag]'s score", "$Name[$tag]'s \(z\)-score")\} +\{row($ssub[1], $smean[1], $sdev[1], $grade1, ans_rule(10))\} +\{row($ssub[2], $smean[2], $sdev[2], $grade2, ans_rule(10))\} +\{row($ssub[3], $smean[3], $sdev[3], $grade3, ans_rule(10))\} +\{row($ssub[4], $smean[4], $sdev[4], $grade4, ans_rule(10))\} +\{endtable()\} + +$BR +On what exam did $Name[$tag] have the highest score relative to other exam takers? \{ $popup->menu() \} +END_TEXT + +###################################### +BEGIN_SOLUTION + +Recall that all classes in which Joe has taken an exam will have their own \(z\)-score. As such, we will find \(z_{$ssub[1]}\), \(z_{$ssub[2]}\), \(z_{$ssub[3]}\), \(z_{$ssub[4]}\) + +$PAR + +(a) $ssols[0] + +$PAR + +(b) $ssols[1] + +$PAR + +(c) $ssols[2] + +$PAR + +(d) $ssols[3] + +$PAR + +(e) Knowing the highest score relative to other exam takers would entail finding the highest positive \(z\)-score. In this case, it $sz[$best], which is his $ssub[$best] class. + +END_SOLUTION + +# +# Answers + +$showPartialCorrectAnswers = 1; + +Context()->strings->add("Calculus"=>{}, "Biology"=>{}, "Spanish"=>{}, "History"=>{}, "Physics"=>{}); + +ANS(Real($sz[1])->cmp); +ANS(Real($sz[2])->cmp); +ANS(Real($sz[3])->cmp); +ANS(Real($sz[4])->cmp); +ANS($popup->cmp); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/empirical_rule1.pg b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/empirical_rule1.pg new file mode 100644 index 0000000000..28222734dc --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/empirical_rule1.pg @@ -0,0 +1,67 @@ +##DESCRIPTION +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('empirical rule') +## Author('N.Spencer Sitton; Modified slightly by John Hagood') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/05/05; 07/28/10 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "MathObjects.pl", +); + + +TEXT( &beginproblem ); + +do{$mean = random(150, 600, 1); + $sd = random( 30, 100, 1); +} until( $mean - 3 * $sd > 0); +@per = ( 68, 95, 99.7 ); +$ind = random( 0, 2, 1 ); +$ans1 = $mean - ( $ind + 1 ) * $sd; +$ans2 = $mean + ( $ind + 1 ) * $sd; + +$realind1 = $ind +1; +$realind2 = $ind -1; +@solutions = ("The Empirical Rule tells us that \($per[$ind]$PERCENT\) of all observations fall between \($realind1\) and \($realind2\) standard deviations from the mean. As such, the integer value for \(z = $realind1\) is \($realind1 = \frac{x-$mean}{$sd}\). This can be solved to find \(x = $ans2\). Similarly, the integer value for \(z = $realind2\) is \($realind2 = \frac{x-$mean}{$sd}\). This can be solved to find \(x = $ans1\).", + +"Therefore, \($per[$ind]$PERCENT\) of the exam scores lie between \($ans1\) and \($ans2\).",) + +; + +@ssols = (@solutions); + +BEGIN_TEXT + +Suppose the scores of students on an exam are normally distributed with a mean of \($mean\) and a standard +deviation of \($sd\). Then approximately \($per[$ind]$PERCENT\) of the exam scores lie between the integers +\{ ans_rule( 15 ) \} and \{ ans_rule( 15 ) \} such that the mean is halfway between these two integers. + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +$ssols[0] + +$PAR + +$ssols[1] + +END_SOLUTION + +###################################### + +ANS(Compute( $ans1 )->cmp ); +ANS(Compute( $ans2 )->cmp ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/empirical_rule2.pg b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/empirical_rule2.pg new file mode 100644 index 0000000000..46d1216e72 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/empirical_rule2.pg @@ -0,0 +1,66 @@ +##DESCRIPTION +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('empirical rule') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/05/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "MathObjects.pl", + "contextPercent.pl", + +); + +TEXT( &beginproblem ); + +do{$mean = random(150, 600, 1); + $sd = random( 30, 100, 1); + } until( $mean - 3 * $sd > 0 ); + +$ind = random( 0, 2, 1 ); +$indsol = ( $ind +1 ); +$lscore = $mean - ( $ind + 1 ) * $sd; +$hscore = $mean + ( $ind + 1 ) * $sd; +@ans = ( 68, 95, 99.7 ); +Context("Percent"); +$ans1 = Percent("$ans[$ind] %"); +$lz = ($lscore - $mean) / $sd; +$hz = ($hscore - $mean) / $sd; + +@solutions = ("Using the \(z\)-score formula, we can find \(z_{low score} = \frac{$lscore - $mean}{$sd} = $lz\) and \(z_{high score} = \frac{$hscore - $mean}{$sd} = $hz\). As both \(z\)-scores are \($indsol\) from the mean, we know that \($ans1\) of students scored between \($lscore\) and \($hscore\) points.",) +; + +@ssols = (@solutions); + +BEGIN_TEXT + +Suppose the scores of students on an exam are Normally distributed with a mean +of \($mean\) and a standard deviation of \($sd\). According to the empirical rule, what percentage of students scored between \($lscore\) and \($hscore\) on the exam? $PAR + \{ ans_rule( 15 ) \} of students scored between \($lscore\) and \($hscore\) on the exam. + +END_TEXT + +###################################### +BEGIN_SOLUTION + +Recall that according to Empirical Rule, approximately \(68%\) of observations fall within \(1\) deviation from the mean, \(95%\) of observations fall within \(2\) deviation from the mean and \(99.7%\) of observations fall within \(3\) deviation from the mean. + +$PAR + +$ssols[0] + + +END_SOLUTION + +ANS( $ans1->cmp ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/gust33.pg b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/gust33.pg new file mode 100644 index 0000000000..3796f9aa4a --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/gust33.pg @@ -0,0 +1,61 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("Which of the following Normal distributions has the widest spread?", +"A Normal distribution with mean \(1\) and standard deviation \(3\)"); +$mc->extra("A Normal distribution with mean \(0\) and standard deviation \(2\)", "A Normal distribution with mean \(2\) and standard deviation \(1\)", "A Normal distribution with mean \(3\) and standard deviation \(2\)"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +Recall that spread helps us think about how far each data value is from the mean. As we are working with Normal distributions, the widest spread will have the largest standard deviation. Therefore, the distribution with standard deviation \(3\) has the widest spread. + +END_SOLUTION + +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/gust34.pg b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/gust34.pg new file mode 100644 index 0000000000..eea3a648c6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/gust34.pg @@ -0,0 +1,95 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$mu1 = random(-5,5,1); +$mu2 = $mu1 + non_zero_random(-3,3,1); + +$sigma1 = random(2,5,1); +$sigma2 = $sigma1+list_random(0,0,-1,1); + +$ans1 = ($mu1 == $mu2) ? "True" : "False"; +$ans2 = ($sigma1 == $sigma2) ? "True" : "False"; + +$sol1 = ($sigma1 == $sigma2) ? "True, since the standard deviations are equal, the spreads are the same." : "False, since the standard deviations are not equal, the spreads are not the same."; +$sol2 = ($mu1 == $mu2) ? "True, since the means are equal, the distributions are centered at the same place." : "False, since the means are not equal, the distributions are not centered at the same place."; +$sol3 = "True, all Normal distributions have the same shape. They be centered at different places and have different spreads but the shape is the same."; + +$popup1 = PopUp(["?", "True", "False"], $ans1); +$popup2 = PopUp(["?", "True", "False"], $ans2); +$popup3 = PopUp(["?", "True", "False"], "True"); + +BEGIN_TEXT + +Consider two Normal distributions, one with mean \($mu1\) and standard deviation \($sigma1\), the other with mean \($mu2\) and standard deviation \($sigma2\). + +$PAR +a) The two distributions have the same spread. $BR +True or False? \{ $popup2->menu() \} $PAR + +b) The two distributions are centered at the same place. $BR +True or False? \{ $popup1->menu() \} $PAR + +c) The two distributions have the same shape. $BR +True or False? \{ $popup3->menu() \} $PAR + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +(a) $sol1 + +$PAR + +(b) $sol2 + +$PAR + +(c) $sol3 + +END_SOLUTION + + +ANS( $popup2->cmp() ); +ANS( $popup1->cmp() ); +ANS( $popup3->cmp() ); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/gust36.pg b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/gust36.pg new file mode 100644 index 0000000000..dc23479b08 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/gust36.pg @@ -0,0 +1,62 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl" +); + +TEXT(beginproblem()); + +$mc = new_multiple_choice(); + +$mc->qa("What are the parameters for a Normal curve?", "the population mean and population standard deviation"); +$mc->extra("the sample mean and sample standard deviation", "the population mean and population variance", "the population median and population standard deviation"); +$mc->makeLast("None of the above"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +D. Parameters for the normal curve correspond to the population mean and population standard deviation. + +END_SOLUTION + +ANS(radio_cmp($mc->correct_ans)); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/kolossa20.pg b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/kolossa20.pg new file mode 100644 index 0000000000..e7b44b21d3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/kolossa20.pg @@ -0,0 +1,98 @@ +##DESCRIPTION +## Statistics: Introduction +##ENDDESCRIPTION + +##KEYWORDS('statistics', 'introduction','normal distribution') +## Tagged by sawblade + +## DBsubject('Statistics') +## DBchapter('What is Statistics?') +## DBsection('Introduction') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mc = new_multiple_choice(); + +$mc->qa("A standardized variable always has", +"mean \(0\) and standard deviation \(1\)"); +$mc->extra(" changing mean and standard deviation \(1\)", "mean \(0\) and changing standard deviation"); +$mc->makeLast(" changing mean and changing standard deviation"); + +BEGIN_TEXT + +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + +$mc = new_multiple_choice(); + +$mc->qa("The \(z\)-score corresponding to an observed value of a variable tells you the number of standard deviations that the observation is from the mean", +"True"); +$mc->makeLast("False"); + +BEGIN_TEXT +$BR$HR$BR +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +ANS(radio_cmp($mc->correct_ans)); + + +$mc = new_multiple_choice(); + +$mc->qa("A positive \(z\)-score indicates that the observation is", +"above the mean"); +$mc->makeLast("below the mean"); + +BEGIN_TEXT +$BR$HR$BR +\{ $mc->print_q \} +\{ $mc->print_a \} + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +(a) Option \(C\). When not standardized, values for mean and standard deviation can always vary. However, when working with a Normal distribution, all standardized variables have a mean of \(0\) and a standard deviation of \(1\). + +$PAR + +(b) Option \(A\). The definition of a \(z\)-score is the number of standard deviations that the observation is from the mean. + +$PAR + +(c) Option \(A\). When working with Normal distributions and \(z\)-scores, any observation above the mean will be seen as a "positive" deviation and thus have a positive \(z\)-score. + +END_SOLUTION + + +ANS(radio_cmp($mc->correct_ans)); + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/normprob6.pg b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/normprob6.pg new file mode 100644 index 0000000000..3d808aef64 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoreEmpiricalRule/normprob6.pg @@ -0,0 +1,109 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/5/05 +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"PGcommonFunctions.pl", +"PGstandard.pl", +"PGnauBinpacking.pl", +"unionMacros.pl", +"unionTables.pl", +"parserPopUp.pl", +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; + +$z1 = 0; +$z2 = 0; +$z3 = 0; +while (($z1-$z2)*($z2-z3)*($z3-$z1) == 0) +{$mu1 = random(50,100,1); +$mu2 = random(50,100,1); +$mu3 = random(50,100,1); + +$sig1 = random(5,20,1); +$sig2 = random(5,20,1); +$sig3 = random(5,20,1); + +$score1 = random(50,100,1); +$score2 = random(50,100,1); +$score3 = random(50,100,1); + +$z1 = ($score1-$mu1)/$sig1; +$z2 = ($score2-$mu2)/$sig2; +$z3 = ($score3-$mu3)/$sig3; +$realz1 = Real($z1); +$realz2 = Real($z2); +$realz3 = Real($z3); +@scores = ($z1,$z2,$z3);} + +$best = max(@scores); +if ($z1 == $best) {$ind = 0;} +if ($z2 == $best) {$ind = 1;} +if ($z3 == $best) {$ind = 2;} + +@names =("Colleen","Terresa","Mary"); +$ans = $names[$ind]; + +$popup = PopUp(["?", @names], $ans); + +BEGIN_TEXT +Colleen, Teresa, and Mary are vying for a position as an administrator. Applicants must take an exam for this position. For the sake of the integrity of the exam, it is altered after each time it is given. Colleen, who is tested with group I, gets a score of \($score1\) on her test; Teresa, who is tested with group II, gets a score of \($score2\); and Mary, who is tested with group III, +gets a score of \($score3\). If the average score for group I is \($mu1\), for group II is \($mu2\), and for group III is \($mu3\), and if the standard deviations for each of the groups are \($sig1\), \($sig2\), and \($sig3\) respectively, which person has the highest relative standing? + +$PAR +\{ $popup->menu() \} has the highest relative standing. + +END_TEXT + +###################################### + +BEGIN_SOLUTION + +As we are interested in the highest relative standing in terms of test scores, we need to find the \(z\)-score for all three candidates and see who has the highest. + +$PAR + +\(z_{Colleen} = \frac{$score1 - $mu1}{$sig1} = $realz1\) + +$PAR + +\(z_{Teresa} = \frac{$score2 - $mu2}{$sig2} = $realz2\) + +$PAR + +\(z_{Mary} = \frac{$score3 - $mu3}{$sig3} = $realz3\) + +$PAR + +As the \(z\)-score of \($best\) belongs $ans, $ans has the highest relative standing for all the test takers. + +END_SOLUTION + + +ANS($popup->cmp()); + + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_02_NormalDist.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_02_NormalDist.pg new file mode 100644 index 0000000000..f347bd9410 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_02_NormalDist.pg @@ -0,0 +1,123 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl" + ); + +TEXT(beginproblem()); + +################################################# +# Set-up + +@ThreeProblems = (0,1,2,3); #Order the problems +@scramble = NchooseK(4,3); +@order = @ThreeProblems[@scramble]; + +$mc[0] = new_multiple_choice(); + $mc[0]->qa("Which of these variables is least likely to have a Normal distribution? ", + "Income per person for \(150\) different countries. "); + $mc[0]->extra("Lengths of \(50\) newly hatched pythons. ", + "Heights of \(100\) white pine trees in a forest. "); + $mc[0]->makeLast("None of the above. "); + +$mc[1] = new_multiple_choice(); + $mc[1] ->qa("To completely specify the shape of a Normal distribution, you usually give ", + "the mean and the standard deviation. "); + $mc[1]->extra("the five-number summary. ", + "the mean and the median. ", + "the median and the standard deviation. "); + $mc[1]->makeLast("All of the above. "); + +$mc[2] = new_multiple_choice(); + $mc[2] ->qa("The length of human pregnancies from conception to birth varies according to a distribution that is approximately Normal with mean \(266\) days and standard deviation \(16\) days. About \(95$PERCENT\) of all pregnancies last between ", + " \(234\) and \(298\) days. "); + $mc[2]->extra(" \(250\) and \(282\) days. ", + " \(218\) and \(314\) days. ", + " \(260\) and \(320\) days. "); + $mc[2]->makeLast("None of the above. "); + +$mc[3] = new_multiple_choice(); + $mc[3] ->qa("The scores of adults on an IQ test is approximately Normal with mean \(100\) and standard deviation \(15\). Corinne scores \(118\) on such test. Her \(z\)-score is about ", + " \(1.2\)"); + $mc[3]->extra(" \(7.87\) ", + " \(18\)", + " \(0.67\) "); + $mc[3]->makeLast("None of the above. "); + +@solutions = ("Distributions of income are generally skewed, making it the least likely to have a Normal distribution.", + +"To completely specify the shape of a Normal distribution, you usually give the mean and the standard deviation.", + +"We know \(95$PERCENT\) of observations are within \(2\) standard deviation of the mean. This would correspond to \(32\) days above and below the mean, or, between \(234\) and \(298\) days.", + +"Her \(z\)-score would be \(z = \frac{118-100}{15} = 1.2\).",) +; +@ssols = (@solutions[@order]); + +################################################# +# Main + +BEGIN_TEXT +For each problem, select the best response. + +$PAR +(a) \{ $mc[$order[0]] -> print_q() \} +$BR +\{$mc[$order[0]] -> print_a() \} + +$PAR +(b) \{ $mc[$order[1]] -> print_q() \} +$BR +\{$mc[$order[1]] -> print_a() \} + +$PAR +(c) \{ $mc[$order[2]] -> print_q() \} +$BR +\{$mc[$order[2]] -> print_a() \} +END_TEXT + +$showPartialCorrectAnswers = 0; + +ANS(radio_cmp($mc[$order[0]]->correct_ans)); +ANS(radio_cmp($mc[$order[1]]->correct_ans)); +ANS(radio_cmp($mc[$order[2]]->correct_ans)); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) $ssols[0] + +$PAR + +(b) $ssols[1] + + +$PAR + +(c) $ssols[2] + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_09_NormalDist.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_09_NormalDist.pg new file mode 100644 index 0000000000..9ed98013bd --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_09_NormalDist.pg @@ -0,0 +1,96 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGnumericalmacros.pl", #NOTE: Needed for normal_distr() function + "PGstatisticsmacros.pl" + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +@p=(.0125, .0505, .0901, .1151, .1515, .1401, .1841, .0209, .0281, .0409) ; +$choose = random(0,9,1); + +$pval1 = $p[$choose]; +$pval2 = random(0.0019,0.4602,0.0001); +$showpval1 = $pval1 * 100; +$showpval2 = $pval2 * 100; +$belowpval2 = (1-$pval2); + +$zscore1 = Real(-1 * normal_distr(.5-$pval1)); +$zscore2 = Real(normal_distr(.5-$pval2)); + +################################################# +# Main + +BEGIN_TEXT +Find the \(z\)-score from a standard Normal distribution that +satisfies each of the following statements. + +$PAR +(a) The point \(z\) with \($showpval1$PERCENT\) of the observations falling below it. +$BR +\(z=\) \{ ans_rule(10) \} + +$PAR +(b) The point \(z\) with \($showpval2$PERCENT\) of the observations falling above it. +$BR +\(z=\) \{ ans_rule(10) \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; + +Context()->flags->set(tolerance=>0.007, tolType=> 'absolute'); + +$ans_a = Compute($zscore1); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .007; + } => ["Close!"], + -1*$ans_a => ["It might help to sketch the Normal curve and mark the area representing the proportion less than the z score."]))); + +$ans_b = Compute($zscore2); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .007; + } => ["You are close."], + -1*$ans_b => ["It might help to sketch the Normal curve and mark the area representing the proportion greater than the z score."]))); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) Our goal is to find a \(z\)-score such that \($showpval1$PERCENT\) of observations are $BBOLD below $EBOLD it. This means the area below the \(z\)-score in question is \($pval1\). Using inverse technology commands with an area of \($pval1\), we find \(z\approx$zscore1...\) +$PAR +(b) Our goal is to find a \(z\)-score such that \($showpval2$PERCENT\) of observations are $BBOLD above $EBOLD it. Since our inverse technology can only "look left," we need to look up the \(z\)-score that has an area of \(1-$pval2=$belowpval2\). Using inverse technology commands with an area of \($belowpval2\), we find \(z\approx$zscore2...\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_10_NormalDist.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_10_NormalDist.pg new file mode 100644 index 0000000000..57321e8cb3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_10_NormalDist.pg @@ -0,0 +1,106 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('E Cabrera, R Cruz') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGstatisticsmacros.pl", + "contextPercent.pl", + "PGnauStats.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +do { +$mean_all = random(8.9,9.9,0.1); +$sd_all = random(2.0,2.6,0.1); + +$mean_med = random(10.1,10.9,0.1); +$sd_med = random(1.4,1.8,0.1); + +$cutoff_b1 = random(8,10,1); +$cutoff_b2 = random(11,12,1); +$cutoff_a = random(11,13,1); +if ($cutoff_a==$cutoff_b2) {$cutoff_a=1+$cutoff_b2}; + +$pval_a = uprob(($cutoff_a - $mean_all)/$sd_all); +$p_b1 = 1-uprob(abs(($cutoff_b1 - $mean_med)/$sd_med)); +$p_b2 = uprob(($cutoff_b2 - $mean_med)/$sd_med); +$pval_b = $p_b1 - $p_b2; + +$z1 = Real(($cutoff_a - $mean_all)/$sd_all); +$z2 = Real(($cutoff_b1 - $mean_med)/$sd_med); +$z3 = Real(($cutoff_b2 - $mean_med)/$sd_med); + +$diagrama = DrawNormalDist(99, $z1, "", $z1, outside=>1); +$diagramb = DrawNormalDist($z2, $z3, $z2, $z3, outside=>0); +} until ($z1 != int($z1) && $z2 != int($z2) && $z3 != int($z3)); + +################################################# +# Main + +BEGIN_TEXT +Almost all medical schools in the United States require applicants to take the Medical College Admission Test (MCAT). On one exam, the scores of all applicants on the biological sciences part of the MCAT were approximately Normal with mean \($mean_all\) and standard deviation \($sd_all\). For applicants who actually entered medical school, the mean score was \($mean_med\) and the standard deviation was \($sd_med\). + +$PAR +(a) What percent of all applicants had scores higher than \($cutoff_a\)? +$BR $SPACE $SPACE $SPACE \{ans_rule(5)\} + +$PAR +(b) What percent of those who entered medical school had scores between \($cutoff_b1\) and \($cutoff_b2\)? +$BR $SPACE $SPACE $SPACE \{ans_rule(5)\} +END_TEXT + +################################################# +# Answers + +$showPartialCorrectAnswers = 1; + +Context("Percent"); + +$ans_a = Percent($pval_a+.00005); +ANS($ans_a->cmp); + +$ans_b = Percent($pval_b+.00005); +ANS($ans_b->cmp); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) In regards to "all applicants" there is a mean of \($mean_all\) and standard deviation \($sd_all\). To find the percent of applicants who score higher than \($cutoff_a\), we need a \(z\)-score. We find, \(z=\frac{$cutoff_a-$mean_all}{$sd_all}=$z1\). +$PAR +Using technology, we find \(\text{P}(z>$z1)\approx$pval_a\), which can also be seen in the graph below. +$PAR +\{Plot($diagrama, tex_size=>900)\} +$PAR +(b) In regards to those who "entered medical school," we have a mean of \($mean_med\) and standard deviation \($sd_med\). To find the percent of students who scored between \($cutoff_b1\) and \($cutoff_b2\) we will need two \(z\)-scores. Thus we find \(z_{$cutoff_b1} = \frac{$cutoff_b1-$mean_med}{$sd_med}=$z2\) and \(z_{$cutoff_b2} = \frac{$cutoff_b2-$mean_med}{$sd_med}=$z3\). +$PAR +Using technology, we find \(\text{P}($z2900)\} + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_11_NormalDist.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_11_NormalDist.pg new file mode 100644 index 0000000000..d4ffaa5759 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_11_NormalDist.pg @@ -0,0 +1,83 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGstatisticsmacros.pl", + "contextPercent.pl", + "PGnauStats.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +$meanF = random(900,1050,25); +$sigmaF = random(40,60,10); + +$temp1 = random(1090,1150,5); +$zscore4 = ($temp1 - $meanF) / $sigmaF; +$pval2 =(.0001*int(10000*(uprob(abs($zscore4))+.00005))); +$percp = Percent($pval2); + +$diagram = DrawNormalDist(99, $zscore4, "", $zscore4, outside=>1); + +################################################# +# Main + +BEGIN_TEXT +The temperature at any random location in a kiln used in the manufacture of bricks +is Normally distributed with a mean of \($meanF\) and a standard deviation of \($sigmaF\) degrees. +$PAR +If bricks are fired at a temperature above \($temp1\), they will crack and must +be disposed of. If the bricks are placed randomly throughout the kiln, the +proportion of bricks that crack during the firing process is closest to +\{ ans_rule(10) \}. +$PAR +(Note: The answer can be entered in percentage or decimal form. For example, \(5.02$PERCENT\) or \(0.0502)\). +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; +Context("Percent"); +$ans = Percent($pval2)->with(tolerance=>0.005, tolType=> 'absolute'); +ANS($ans->cmp); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +It is given that we have a normal distribution with mean \($meanF\) and standard deviation of \($sigmaF\) degrees. Since anything above \($temp1\) will crack, this is similar to saying any temperature above a \(z\)-score of \(z=\frac{$temp1-$meanF}{$sigmaF}=$zscore4\) will crack. Using the normal model we find \(\text{P}(z>$zscore4)\approx $pval2\), or, \(\approx$percp\) +$PAR +This can also be seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_12_NormalDist.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_12_NormalDist.pg new file mode 100644 index 0000000000..b8fe338b1e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/03Stats_12_NormalDist.pg @@ -0,0 +1,145 @@ +## DESCRIPTION +## DBsubject('Introduction to Statistics') +## DBchapter('Part 1: Exploring Data') +## DBsection('Chapter 3: The Normal Distributions') +## KEYWORDS('statistic', 'normal distribution', 'z score') +## TitleText1('The Basic Practice of Statistics') +## EditionText1('5e') +## AuthorText1('David Moore') +## Section1('Chapter 3: The Normal Distributions') +## Problem1('') +## Author('R Cruz, L Danielson, J Guild') +## Institution('The College of Idaho') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "MathObjects.pl",, + "answerHints.pl", + "PGnumericalmacros.pl", #NOTE: Needed for normal_distr() function + "PGstatisticsmacros.pl", + "contextPercent.pl",, + "contextPercent.pl", + "PGnauStats.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGnauGraphics.pl", + ); + +TEXT(beginproblem()); + +###################################### +# Setup + +Context("Percent"); + +$mu = random(96,115,5); +$sigma = random(15,28,3); + +# Values for the 1st problem +$num1 = $mu - random(10,18,4); +$zscore1 = Real(($num1 - $mu) / $sigma); +$pval1 = 1-uprob(abs($zscore1)); +$pvalperc = Percent($pval1); + +# Values for the 2nd problem +$percent2 = random(20,30,5); +$perc2dec = ($percent2/100); +$zscore2 = Real(-1 * normal_distr(0.5 - $percent2/100)); +$xscore2 = $zscore2 * $sigma + $mu; + +# Values for the 3rd problem +$percent3 = random(5,15,5); +$dec3 = ($percent3/100); +$leftside = (1-$dec3); +$perc3dec = ($percent3/100); +$zscore3 = Real(normal_distr(0.5 - $percent3/100)); +$xscore3 = $zscore3 * $sigma + $mu; + + +$diagram = DrawNormalDist(99, $zscore1, "", $zscore1, outside=>1); +################################################# +# Main + +BEGIN_TEXT +Scores on a certain intelligence test for children between ages \(13\) and \(15\) years are approximately Normally distributed with \( \mu = $mu \) and \( \sigma = $sigma \). + +$PAR +(a) What proportion of children aged \(13\) to \(15\) years old have scores on this test above \($num1\)? $PAR + (NOTE: You may enter your answer in percentage or decimal form. For example, \(45.23$PERCENT\) or \(0.4523)\). +$PAR +\{ ans_rule(10) \} +$HR +$PAR +(b) Enter the score which marks the lowest \($percent2\) percent of the distribution. +$PAR +\{ ans_rule(10) \} +$HR +$PAR +(c) Enter the score which marks the highest \($percent3\) percent of the distribution. +$PAR +\{ ans_rule(10) \} +END_TEXT + +###################################### +# Answers + +$showPartialCorrectAnswers = 1; +Context("Percent"); +$ans_a = Percent("$pval1"); +#ANS($ans_a->cmp); +ANS($ans_a->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .02; + } => ["You are close. Use more accuracy in your calculation."], + $zscore1 => ["Enter the proportion not the z score."]))); + +Context("Numeric"); +$ans_b = Compute("$xscore2")->with(tolType=>'absolute', tolerance=>'0.2'); +#ANS($ans_b->cmp); +ANS($ans_b->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .5; + } => ["Close!"], + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$zscore2) < .02; + } => ["Enter the test score not the z score."]))); + +$ans_c = Compute("$xscore3")->with(tolType=>'absolute', tolerance=>'0.2'); +#ANS($ans_c->cmp); +ANS($ans_c->cmp->withPostFilter(AnswerHints( + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$correct) < .5; + } => ["You are close. Use more accuracy in your calculation."], + sub { + my ($correct,$student,$anshash) = @_; + return abs($student-$zscore3) < .02; + } => ["Enter the test score not the z score."]))); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION +(a) It is given that we have a normal distribution with mean \($mu\) and standard deviation of \($sigma\) degrees. Since anything above \($num1\) will crack, this is similar to saying any score above a \(z\)-score of \(z=\frac{$num1-$mu}{$sigma}=$zscore1\). Using the normal model we find \(\text{P}(z>$zscore1)\approx $pval1\), or, \(\approx$pvalperc\) +$PAR +This can also be seen in the graph below. +$PAR +\{Plot($diagram, tex_size=>900)\} +$PAR +(b) Our goal is to find a \(z\)-score such that \($percent2$PERCENT\) of scores are $BBOLD below $EBOLD it. This means the area below the \(z\)-score in question is \($perc3dec\). Using inverse technology commands with an area of \($perc3dec\), we find \(z\approx$zscore2\). Using the \(z\)-score formula, we find \($zscore2=\frac{x-$mu}{$sigma}\). This can be solved to find \(x\approx$xscore2\). +$PAR +(c) Our goal is to find a \(z\)-score such that \($percent3$PERCENT\) of scores are $BBOLD above $EBOLD it. Since our technology can only "look left," this means the area below the \(z\)-score in question is \(1-$dec3=$leftside\). Using inverse technology commands with an area of \($leftside\), we find \(z\approx$zscore3\). Using the \(z\)-score formula, we find \($zscore3=\frac{x-$mu}{$sigma}\). This can be solved to find \(x\approx$xscore3\). +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + + + + + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/dueck6_2_5.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/dueck6_2_5.pg new file mode 100644 index 0000000000..9f914dc305 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/dueck6_2_5.pg @@ -0,0 +1,106 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability','Normal Distribution') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$p[0] = .5; +$p[1] = random(.9826,.8212,.9854); +$p[2] = random(.1423,.0078,.0749); +$p[3] = random(.9394,.9987,.9952); + +$a = normal_distr($p[0]-0.5); +$b = Real(normal_distr($p[1]-0.5)); +$c = Real(normal_distr(0.5-$p[2])); +$d = Real(-1*normal_distr($p[3]-0.5)); + +$aa = $p[0]; +$bb = $p[1]; +$cc = $p[2]; +$dd = $p[3]; +$ccleft = (1-$cc); +$ddleft = (1-$dd); + +#$aa = .5+$p[0]; +#$bb = .5+$p[1]; +#$cc = .5-$p[2]; +#$dd = .5-$p[3]; + +$aap = 100*$aa; +$ccp = 100*$cc; + +BEGIN_TEXT +Find the \(z\)-score such that: $PAR +(a) The area under the standard Normal curve to its left is \($aap$PERCENT\) $BR +$SPACE $SPACE $SPACE\(z =\) \{ans_rule(10)\} $PAR + +(b) The area under the standard Normal curve to its left is \($bb\) $BR +$SPACE $SPACE $SPACE\(z =\) \{ans_rule(10)\} $PAR + +(c) The area under the standard Normal curve to its right is \($ccp$PERCENT\) $BR +$SPACE $SPACE $SPACE\(z =\) \{ans_rule(10)\} $PAR + +(d) The area under the standard Normal curve to its right is \($dd\) $BR +$SPACE $SPACE $SPACE\(z =\) \{ans_rule(10)\} $PAR + + + +END_TEXT + +ANS(Compute($a)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute($b)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute($c)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute($d)->cmp(tolType=>relative,tolerance=>.01)); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) Our goal is to find a \(z\)-score such that \($aap$PERCENT\) is to the left of it, or, an area of \($aa\) is $BBOLD below $EBOLD it. Using inverse technology commands with an area of \($aa\), we find \(z=$a\). +$PAR +(b) Our goal is to find a \(z\)-score such that an area of \($bb\) is to the left of it, or, $BBOLD below $EBOLD it. Using inverse technology commands with an area of \($bb\), we find \(z\approx$b\). +$PAR +(c) Our goal is to find a \(z\)-score such that \($ccp$PERCENT\) is to the right of it, or, an area of \($cc\) is $BBOLD above $EBOLD it. Since our technology can only "look left," this means the area below the \(z\)-score in question is \(1-$cc=$ccleft\). Using inverse technology commands with an area of \($ccleft\), we find \(z\approx$c\). +$PAR +(d) Our goal is to find a \(z\)-score such that an area of \($dd\) is to the right of it, or, $BBOLD above $EBOLD it. Since our technology can only "look left," this means the area below the \(z\)-score in question is \(1-$dd=$ddleft\). Using inverse technology commands with an area of \($ddleft\), we find \(z\approx$d\). + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/dueck6_3_1.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/dueck6_3_1.pg new file mode 100644 index 0000000000..8168f5d95e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/dueck6_3_1.pg @@ -0,0 +1,102 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability','Normal Distribution') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$exp = 2.718281828; + +$a = random(0.10,3.00,0.01); +$b = random(-3.00, -0.10, 0.01); +$c = random(-3.00, -0.01, 0.01); +$d = random(0.01, 3.00, 0.01); +$e = random(-3.00, 3.00, 0.01); +$f = random(-3.00, 3.00, 0.01); + +$ans_a = normal_prob(0, $a); +$ans_b = normal_prob($b, 0); +$ans_c = normal_prob($c, $d); +$ans_d = normal_prob('-infty', $e); +$ans_e = normal_prob($f, 'infty'); + +$deca = Real($ans_a); +$decb = Real($ans_b); +$decc = Real($ans_c); +$decd = Real($ans_d); +$dece = Real($ans_e); +BEGIN_TEXT + +Assume that the readings on the thermometers are Normally distributed with a mean of +\( 0^{\circ} \mbox{C}\) and a standard deviation of \( 1^{\circ} \mbox{C} \). A thermometer is randomly selected and tested. +Find the probability of each reading.$PAR + +(a) \( \ \) Between \( 0^{\circ} \mbox{C} \) and \( $a^{\circ} \mbox{C} \): \( \ \) \{ans_rule(10)\}$PAR + +(b) \( \ \) Between \( $b^{\circ} \mbox{C} \) and \( 0^{\circ} \mbox{C} \): \( \ \) \{ans_rule(10)\}$PAR + +(c) \( \ \) Between \( $c^{\circ} \mbox{C} \) and \( $d^{\circ} \mbox{C} \): \( \ \) \{ans_rule(10)\}$PAR + +(d) \( \ \) Less than \( $e^{\circ} \mbox{C} \): \( \ \) \{ans_rule(10)\}$PAR + +(e) \( \ \) Greater than \( $f^{\circ} \mbox{C} \): \( \ \) \{ans_rule(10)\} + + +END_TEXT +Context("Percent"); +ANS(Percent($ans_a)->cmp); +ANS(Percent($ans_b)->cmp); +ANS(Percent($ans_c)->cmp); +ANS(Percent($ans_d)->cmp); +ANS(Percent($ans_e)->cmp); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION +For all solutions below we will rely on the a mean of \(0^{\circ} \mbox{C}\) and a standard deviation of \(1^{\circ} \mbox{C}\) as given in the problem situation above. This means \(0^{\circ} \mbox{C}\) is a \(z\)-score of \(0\). Additionally, since we have standard deviation on \(1^{\circ} \mbox{C}\), this means \(1^{\circ} \mbox{C}\) is a \(z\)-score of \(1\), \(2^{\circ} \mbox{C}\) is a \(z\)-score of \(2\), etc. +$PAR +(a) We have \(z=0\) and \(z=$a\) and we need to find \(\text{P}(0$f)\). Using technology, we find that \(\text{P}(z>$f)\approx$dece\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/dueck6_3_3.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/dueck6_3_3.pg new file mode 100644 index 0000000000..82126052fa --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/dueck6_3_3.pg @@ -0,0 +1,209 @@ +## DESCRIPTION +## Probability +## ENDDESCRIPTION + +## KEYWORDS('Probability','Normal Distribution') +## Tagged by dgt5v + +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## Date('') +## Author('') +## Institution('ASU') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGstatisticsmacros.pl", +"PGnumericalmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +"parserOneOf.pl", +"PGnauGraphics.pl", +"PGnauStats.pl" +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$mu = random(60,80,1); +$sigma = random(5,10,.1); + +$a = random(60,($mu-1),1); +$b = random(70,90,1); +while($a==$b) {$b = random(70,90,1);} +$c = random(1,3,1); + + +$xa = Real(($a-$mu)/$sigma); +$xb = Real(($b-$mu)/$sigma); + + +$ans1 = normal_prob($xa, "infty"); +$ans2 = normal_prob(-"infty", $xb); +$ans3 = Real(100*normal_prob(-$c, $c)); + +$diagrama = DrawNormalDist(99, $xa, "", $xa, outside=>1); + +$diagramb = DrawNormalDist($xb, -99, $xb, "", outside=>1); + +BEGIN_TEXT +The extract of a plant native to Taiwan has been tested as a possible treatment for Leukemia. One of the chemical compounds produced from the plant was analyzed for a particular collagen. The collagen amount was found to be Normally distributed with a mean of \($mu\) and standard deviation of +\($sigma\) grams per mililiter. $PAR +(a) \( \) What is the probability that the amount of collagen is greater than \($a\) grams per mililiter? $PAR + \{ans_rule(10)\} $PAR +(b) \( \) What is the probability that the amount of collagen is less than \($b\) grams per mililiter? $PAR + \{ans_rule(10)\} $PAR +(c) \( \) What percentage of compounds formed from the extract of this plant fall within \($c\) standard +deviations of the mean? $PAR + \{ans_rule(10)\} +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp()); +ANS(Percent($ans2)->cmp()); + +Context("Numeric"); + +Context()->flags->set(tolerance=>0.00001); + + + +if (Compute($ans3) == 0.15) +{$ans3 = OneOf($ans3,0.1349898);} +elsif (Compute($ans3) == 0.3) +{$ans3 = OneOf($ans3,0.2699796);} +elsif (Compute($ans3) == 2.35) +{$ans3 = OneOf($ans3,2.1400234);} +elsif (Compute($ans3) == 2.5) +{$ans3 = OneOf($ans3,2.2750132);} +elsif (Compute($ans3) == 2.65) +{$ans3 = OneOf($ans3,2.4100030);} +elsif (Compute($ans3) == 5) +{$ans3 = OneOf($ans3,4.5500264);} +elsif (Compute($ans3) == 9) +{$ans3 = OneOf($ans3,9.2773641);} +elsif (Compute($ans3) == 13.5) +{$ans3 = OneOf($ans3,13.5905122);} +elsif (Compute($ans3) == 15.85) +{$ans3 = OneOf($ans3,15.7305356);} +elsif (Compute($ans3) == 16) +{$ans3 = OneOf($ans3,15.8655254);} +elsif (Compute($ans3) == 16.15) +{$ans3 = OneOf($ans3,16.0005152);} +elsif (Compute($ans3) == 18.5) +{$ans3 = OneOf($ans3,18.1405386);} +elsif (Compute($ans3) == 22.5) +{$ans3 = OneOf($ans3,22.8678763);} +elsif (Compute($ans3) == 24.85) +{$ans3 = OneOf($ans3,25.0078997);} +elsif (Compute($ans3) == 25) +{$ans3 = OneOf($ans3,24.8571105,25.1428895);} +elsif (Compute($ans3) == 25.15) +{$ans3 = OneOf($ans3,25.2778793);} +elsif (Compute($ans3) == 27.5) +{$ans3 = OneOf($ans3,27.4179027);} +elsif (Compute($ans3) == 32) +{$ans3 = OneOf($ans3,31.7310508);} +elsif (Compute($ans3) == 34) +{$ans3 = OneOf($ans3,34.1344746);} +elsif (Compute($ans3) == 41) +{$ans3 = OneOf($ans3,41.0084149);} +elsif (Compute($ans3) == 47.5) +{$ans3 = OneOf($ans3,47.7249868);} +elsif (Compute($ans3) == 49.85) +{$ans3 = OneOf($ans3,49.8650102);} +elsif (Compute($ans3) == 5) +{$ans3 = OneOf($ans3,49.7142210,50.2857790);} +elsif (Compute($ans3) == 50.15) +{$ans3 = OneOf($ans3,50.1349898);} +elsif (Compute($ans3) == 52.5) +{$ans3 = OneOf($ans3,52.2750132);} +elsif (Compute($ans3) == 59) +{$ans3 = OneOf($ans3,58.9915851);} +elsif (Compute($ans3) == 66) +{$ans3 = OneOf($ans3,65.8655254);} +elsif (Compute($ans3) == 68.2689) +{$ans3 = OneOf($ans3,68);} +elsif (Compute($ans3) == 72.5) +{$ans3 = OneOf($ans3,72.5820973);} +elsif (Compute($ans3) == 74.85) +{$ans3 = OneOf($ans3,74.7221207);} +elsif (Compute($ans3) == 75) +{$ans3 = OneOf($ans3,74.8571105,75.1428895);} +elsif (Compute($ans3) == 75.15) +{$ans3 = OneOf($ans3,74.9921003);} +elsif (Compute($ans3) == 77.5) +{$ans3 = OneOf($ans3,77.1321237);} +elsif (Compute($ans3) == 81.5) +{$ans3 = OneOf($ans3,81.8594614);} +elsif (Compute($ans3) == 83.85) +{$ans3 = OneOf($ans3,83.9994848);} +elsif (Compute($ans3) == 84) +{$ans3 = OneOf($ans3,84.1344746);} +elsif (Compute($ans3) == 84.15) +{$ans3 = OneOf($ans3,84.2694644);} +elsif (Compute($ans3) == 86.5) +{$ans3 = OneOf($ans3,86.4094878);} +elsif (Compute($ans3) == 91) +{$ans3 = OneOf($ans3,90.7226359);} +elsif (Compute($ans3) == 95) +{$ans3 = OneOf($ans3,95.4499736);} +elsif (Compute($ans3) == 95.4499736) +{$ans3 = OneOf($ans3,95);} +elsif (Compute($ans3) == 96.75) +{$ans3 = OneOf($ans3 , 97.8599766);} +elsif (Compute($ans3) == 97.35) +{$ans3 = OneOf($ans3,97.5899970);} +elsif (Compute($ans3) == 97.5) +{$ans3 = OneOf($ans3,97.7249868);} +elsif (Compute($ans3) == 99.7) +{$ans3 = OneOf($ans3,99.7300204);} +elsif (Compute($ans3) == 99.7300204) +{$ans3 = OneOf($ans3,99.7);} +elsif (Compute($ans3) == 99.85) +{$ans3 = OneOf($ans3,99.8650102);} + +Context("Percent"); +@reals = $ans3->value; +@percents = (); +for my $i (@reals) {push(@percents, Percent($i/100));}; +$ans3 = OneOf(@percents); + + + +ANS(Compute($ans3)->cmp()); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) As our sample data is \($a\) and we have a mean of \($mu\) and standard deviation of \($sigma\), we can find \(z=\frac{$a-$mu}{$sigma}=$xa\). As we want to know the probability of being more than \($a\), we find \(\text{P}(z>$a)\approx$ans1\). This can also be seen in the graph below. +$PAR +\{Plot($diagrama, tex_size=>900)\} +$PAR +(b) As our sample data is \($b\) and we have a mean of \($mu\) and standard deviation of \($sigma\), we can find \(z=\frac{$b-$mu}{$sigma}=$xb\). As we want to know the probability of being less than \($b\), we find \(\text{P}(z>$b) \approx $ans2\). This can also be seen in the graph below. +$PAR +\{Plot($diagramb, tex_size=>900)\} +$PAR +(c) We know that \(\approx 68$PERCENT\) of all observations fall within \(1\) deviation from the mean, \(\approx 95$PERCENT\) fall \(2\) deviations from the mean and \(\approx 99.7$PERCENT\) fall \(3\) deviations from the mean. +$PAR +For the current questions, this means \($ans3\) fall within \($c\) deviations of the mean. + + +END_SOLUTION + + + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/empirical_rule3.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/empirical_rule3.pg new file mode 100644 index 0000000000..9efa9d1cd9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/empirical_rule3.pg @@ -0,0 +1,75 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('empirical rule') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 06/20/05; 07/28/10 +# modified by John Hagood +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "MathObjects.pl", + +); + +TEXT(&beginproblem); + +do{$mean = random( 59, 80, 1); + $sd = random( 4, 20, 1 ); +} until( 3 * $sd + $mean < 100 ); + +@per1 = ( 25, 75 ); +$ind1 = random( 0, 1, 1 ); + +if( $ind1 == 0 ){ $fact = -1; +} else { $fact = 1;} + +$ans1 = $mean + (.67 * $fact) * $sd; +$zscore1 = (.67 * $fact); +@per2 = ( 16, 2.5, 0.15 ); +@dev = ( 1, 2, 3 ); +$ind2 = random( 0, 2, 1); +$ans2 = $mean + ( $ind2 + 1 ) * $sd; +$zscore2 = ($ind2+1); + +$area1 = ($per1[$ind1]/100); +$area2 = (100-($per2[$ind2])); +$area2dec = ($area2/100); + +BEGIN_TEXT + +A math professor notices that scores from a recent exam are Normally distributed with a mean of \($mean\) and +a standard deviation of \($sd\). $PAR +(a) What score do \($per1[$ind1]$PERCENT\) of the students exam scores fall below?$BR +$SPACE $SPACE $SPACE \{ ans_rule( 15 ) \} $PAR +(b) Suppose the professor decides to grade on a curve. If the professor wants \($per2[$ind2]$PERCENT\) of the students + to get an A, what is the minimum score for an A? $BR +$SPACE $SPACE $SPACE\{ ans_rule( 15 ) \} + +END_TEXT + +ANS( Compute( $ans1)->cmp(tolType=>absolute,tolerance=>0.5) ); +ANS( Compute( $ans2)->cmp(tolType=>absolute,tolerance=>0.5) ); + + +#################################################### +## Solutions +#################################################### + +BEGIN_SOLUTION + +(a) \($per1[$ind1]$PERCENT\) of students fall below a certain score. To find this score we will need its \(z\)-score representation. This is found with technology using an area of \($area1\) since we want the score that students are below, and our technology can only "look left." Thus we find \(z\approx $zscore1\). We can now solve \(z=\frac{x-\bar{x}}{s_{x}}\) for \(x\). Using \($zscore1=\frac{x-$mean}{$sd}\) we find \(x=$ans1\). +$PAR +(b) If we only want \($per2[$ind2]$PERCENT\) to score an A, that means \(100$PERCENT-$per2[$ind2]$PERCENT=$area2$PERCENT\) do not score an A. To find this cutoff score we will need its \(z\)-score representation. This is found with technology using an area of \($area2dec\), even though we want the highest \($per2[$ind2]$PERCENT\), our technology can only "look left." Thus we find \(z\approx $zscore2\). We can now solve \(z=\frac{x-\bar{x}}{s_{x}}\) for \(x\). Using \($zscore2=\frac{x-$mean}{$sd}\) we find \(x=$ans2\). + + +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/empirical_rule5.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/empirical_rule5.pg new file mode 100644 index 0000000000..53d87570a6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/empirical_rule5.pg @@ -0,0 +1,241 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('empirical rule') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/07/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "PGchoicemacros.pl", + "MathObjects.pl", + "parserOneOf.pl", + "contextPercent.pl", +); + +TEXT(&beginproblem); +$country = list_random( 'American', 'Canadian', 'English', 'French', 'German', 'Russian' ); +$mean = random( 65, 72, .1 ); +$sd = random( 2, 6, .1 ); + +@val = ( .67 * $sd, $sd, 2 * $sd, 3 * $sd ); +@slice1 = NchooseK( 4, 3 ); + +$a = $mean - $val[$slice1[0]]; +$b = $mean + $val[$slice1[0]]; +$fact1 = list_random( -1, 1 ); +$c = $mean + ( $val[$slice1[1]] * $fact1 ); +$fact2 = list_random( -1, 1 ); +$d = $mean + ( $val[$slice1[2]] * $fact2 ); + +@quest = ('Between \('.$a.'\) and \('.$b.'\) inches tall?', + ' Under \('.$c.'\) inches tall?', + 'Over \('.$d.'\) inches tall?' ); + +if( $slice1[0] == 0 ){ + $ans1 = 50; +} +elsif( $slice1[0] == 1 ){ + $ans1 = 68; +} +elsif( $slice1[0] == 2 ) { + $ans1 = 95; +} +elsif( $slice1[0] == 3 ) { + $ans1 = 99.7; +} + +if( $slice1[1] == 0 ){ + if( $fact1 == 1 ){ + $ans2 = 75; + } else{ + $ans2 = 25; + } +} elsif( $slice1[1] == 1 ){ + if( $fact1 == 1 ){ + $ans2 = 84; + } else{ + $ans2 = 16; # this was 14 Nandor + } +} elsif( $slice1[1] == 2 ){ + if( $fact1 == 1 ){ + $ans2 = 97.5; + } else{ + $ans2 = 2.5; + } +} elsif( $slice1[1] == 3 ){ + if( $fact1 == 1 ){ + $ans2 = 99.85; + }else{ + $ans2 = .15; + } +} + +if( $slice1[2] == 0 ){ + if( $fact2 == -1 ){ + $ans3 = 75; + } else{ + $ans3 = 25; + } +} elsif( $slice1[2] == 1 ){ + if( $fact2 == -1 ){ + $ans3 = 84; + } else{ + $ans3 = 16; # 14; Nandor for Terry + } +} elsif( $slice1[2] == 2 ) { + if( $fact2 == -1 ){ + $ans3 = 97.5; + } else{ + $ans3 = 2.5; + } +} elsif( $slice1[2] == 3 ) { + if( $fact2 == -1 ){ + $ans3 = 99.85; + }else{ + $ans3 = 0.15; + } +} + +@ans = ( $ans1, $ans2, $ans3 ); +@slice2 = NchooseK( 3, 3 ); + +BEGIN_TEXT + +The heights of $country men are Normally distributed with a mean of \($mean\) inches and a standard deviation of \($sd\) +inches. What percentage of $country men are:$PAR +(a) $quest[$slice2[0]] $BR + \{ans_rule( 15 ) \} $PAR +(b) $quest[$slice2[1]] $BR + \{ans_rule( 15 ) \} $PAR +(c) $quest[$slice2[2]] $BR + \{ans_rule( 15 ) \} + +END_TEXT + + +Context("Numeric"); + +Context()->flags->set(tolerance=>0.00001); + +for my $i (0..2) +{ +$ans[$i] = Real("$ans[$i]"); + +if (Compute($ans[$i]) == 0.15) +{$ans[$i] = OneOf($ans[$i],0.1349898);} +elsif (Compute($ans[$i]) == 0.3) +{$ans[$i] = OneOf($ans[$i],0.2699796);} +elsif (Compute($ans[$i]) == 2.35) +{$ans[$i] = OneOf($ans[$i],2.1400234);} +elsif (Compute($ans[$i]) == 2.5) +{$ans[$i] = OneOf($ans[$i],2.2750132);} +elsif (Compute($ans[$i]) == 2.65) +{$ans[$i] = OneOf($ans[$i],2.4100030);} +elsif (Compute($ans[$i]) == 5) +{$ans[$i] = OneOf($ans[$i],4.5500264);} +elsif (Compute($ans[$i]) == 9) +{$ans[$i] = OneOf($ans[$i],9.2773641);} +elsif (Compute($ans[$i]) == 13.5) +{$ans[$i] = OneOf($ans[$i],13.5905122);} +elsif (Compute($ans[$i]) == 15.85) +{$ans[$i] = OneOf($ans[$i],15.7305356);} +elsif (Compute($ans[$i]) == 16) +{$ans[$i] = OneOf($ans[$i],15.8655254);} +elsif (Compute($ans[$i]) == 16.15) +{$ans[$i] = OneOf($ans[$i],16.0005152);} +elsif (Compute($ans[$i]) == 18.5) +{$ans[$i] = OneOf($ans[$i],18.1405386);} +elsif (Compute($ans[$i]) == 22.5) +{$ans[$i] = OneOf($ans[$i],22.8678763);} +elsif (Compute($ans[$i]) == 24.85) +{$ans[$i] = OneOf($ans[$i],25.0078997);} +elsif (Compute($ans[$i]) == 25) +{$ans[$i] = OneOf($ans[$i],24.8571105,25.1428895);} +elsif (Compute($ans[$i]) == 25.15) +{$ans[$i] = OneOf($ans[$i],25.2778793);} +elsif (Compute($ans[$i]) == 27.5) +{$ans[$i] = OneOf($ans[$i],27.4179027);} +elsif (Compute($ans[$i]) == 32) +{$ans[$i] = OneOf($ans[$i],31.7310508);} +elsif (Compute($ans[$i]) == 34) +{$ans[$i] = OneOf($ans[$i],34.1344746);} +elsif (Compute($ans[$i]) == 41) +{$ans[$i] = OneOf($ans[$i],41.0084149);} +elsif (Compute($ans[$i]) == 47.5) +{$ans[$i] = OneOf($ans[$i],47.7249868);} +elsif (Compute($ans[$i]) == 49.85) +{$ans[$i] = OneOf($ans[$i],49.8650102);} +elsif (Compute($ans[$i]) == 50) +{$ans[$i] = OneOf($ans[$i],49.7142210,50.2857790);} +elsif (Compute($ans[$i]) == 50.15) +{$ans[$i] = OneOf($ans[$i],50.1349898);} +elsif (Compute($ans[$i]) == 52.5) +{$ans[$i] = OneOf($ans[$i],52.2750132);} +elsif (Compute($ans[$i]) == 59) +{$ans[$i] = OneOf($ans[$i],58.9915851);} +elsif (Compute($ans[$i]) == 66) +{$ans[$i] = OneOf($ans[$i],65.8655254);} +elsif (Compute($ans[$i]) == 68) +{$ans[$i] = OneOf($ans[$i],68.2689492);} +elsif (Compute($ans[$i]) == 72.5) +{$ans[$i] = OneOf($ans[$i],72.5820973);} +elsif (Compute($ans[$i]) == 74.85) +{$ans[$i] = OneOf($ans[$i],74.7221207);} +elsif (Compute($ans[$i]) == 75) +{$ans[$i] = OneOf($ans[$i],74.8571105,75.1428895);} +elsif (Compute($ans[$i]) == 75.15) +{$ans[$i] = OneOf($ans[$i],74.9921003);} +elsif (Compute($ans[$i]) == 77.5) +{$ans[$i] = OneOf($ans[$i],77.1321237);} +elsif (Compute($ans[$i]) == 81.5) +{$ans[$i] = OneOf($ans[$i],81.8594614);} +elsif (Compute($ans[$i]) == 83.85) +{$ans[$i] = OneOf($ans[$i],83.9994848);} +elsif (Compute($ans[$i]) == 84) +{$ans[$i] = OneOf($ans[$i],84.1344746);} +elsif (Compute($ans[$i]) == 84.15) +{$ans[$i] = OneOf($ans[$i],84.2694644);} +elsif (Compute($ans[$i]) == 86.5) +{$ans[$i] = OneOf($ans[$i],86.4094878);} +elsif (Compute($ans[$i]) == 91) +{$ans[$i] = OneOf($ans[$i],90.7226359);} +elsif (Compute($ans[$i]) == 95) +{$ans[$i] = OneOf($ans[$i],95.4499736);} +elsif (Compute($ans[$i]) == 96.75) +{$ans[$i] = OneOf($ans[$i] , 97.8599766);} +elsif (Compute($ans[$i]) == 97.35) +{$ans[$i] = OneOf($ans[$i],97.5899970);} +elsif (Compute($ans[$i]) == 97.5) +{$ans[$i] = OneOf($ans[$i],97.7249868);} +elsif (Compute($ans[$i]) == 99.7) +{$ans[$i] = OneOf($ans[$i],99.7300204);} +elsif (Compute($ans[$i]) == 99.85) +{$ans[$i] = OneOf($ans[$i],99.8650102);} +} + +Context()->flags->set(tolerance=>0.01); + +Context("Percent"); +for my $j (0..2) { +@reals = $ans[$slice2[$j]]->value; +@percents = (); +for my $i (@reals) {push(@percents,Percent($i/100));}; +$ans[$slice2[$j]] = OneOf(@percents); +}; + +ANS( +Compute( $ans[$slice2[0]])->cmp() ); +ANS( +Compute( $ans[$slice2[1]])->cmp() ); +ANS( +Compute( $ans[$slice2[2]])->cmp() ); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust37.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust37.pg new file mode 100644 index 0000000000..648e6a4b00 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust37.pg @@ -0,0 +1,101 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"MathObjects.pl", +"parserNumberWithUnits.pl", +"parserPopUp.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$mean = random(59,64,1); +$stddev = random(8,10,1); + +$time1=random(35,60,5); +$time2=random(65,90,5); +$time3=random(65,90,1); + +$z1= ($time1-$mean)/$stddev; +$z2= ($time2-$mean)/$stddev; +$z3= ($time3-$mean)/$stddev; + +$popup = PopUp(["?", "to the left", "to the right", "within one standard deviation"], "to the right"); + +BEGIN_TEXT + +As reported in "Runner's World" magazine, the finishing times of the runners in the New York City \(10\) km run are Normally distributed with a mean of \($mean\) minutes and a standard deviation of \($stddev\) minutes. Let \(x\) denote finishing time for a runner. Type $BBOLD min$EBOLD for minutes. $BR + +$PAR +a) The distribution of the variable \(x\) has mean \{ans_rule(10)\} and standard deviation \{ans_rule(10)\}. $BR + +$PAR +b) The distribution of the standardized variable \(z\) has mean \{ans_rule(10)\} and standard deviation \{ans_rule(10)\}. $BR + +$PAR +c) The percentage of finishers with times between \($time1\) and \($time2\) minutes is equal to the area under the standard Normal curve between the \(z\)-scores\{ans_rule(10)\} and \{ans_rule(10)\}. $BR + +$PAR +d) The percentage of finishers with times exceeding \($time3\) minutes is equal to the area under the standard Normal curve that lies \{ $popup->menu() \} of \{ans_rule(10)\}. + +END_TEXT + +ANS(NumberWithUnits($mean,'min')->cmp(tolType=>relative,tolerance=>.01)); +ANS(NumberWithUnits($stddev, 'min')->cmp(tolType=>relative,tolerance=>.01)); + +ANS(Compute(0)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute(1)->cmp(tolType=>relative,tolerance=>.01)); + +ANS(Compute($z1)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute($z2)->cmp(tolType=>relative,tolerance=>.01)); + +ANS( $popup->cmp() ); +ANS(Compute($z3)->cmp(tolType=>relative,tolerance=>.01)); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) Based on the question, we know that the variable \(x\) has mean \($mean\)min and standard deviation \($stddev\)min. +$PAR +(b) Anytime we standardize a variable we have the mean as \(0\) and standard deviation \(1\). +$PAR +(c) The percentage of finishers with times between \($time1\) and \($time2\) minutes correspond to \(z\)-scores of \(z_{$time1}=\frac{$time1-$mean}{$stddev}=$z1\) and \(z_{$time2}=\frac{$time2-$mean}{$stddev}=$z2\). +$PAR +(d) The percentage of finishers with times exceeding \($time3\) minutes corresponds to a \(z\)-score of \(z_{$time3}=\frac{$time3-$mean}{$stddev}=$z3\). As we want to know the percentage of finishers with times exceeding \($time3\) minutes, this means we want the area to the right of \(z=$z3\) + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust38.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust38.pg new file mode 100644 index 0000000000..4d4417e76e --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust38.pg @@ -0,0 +1,81 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$mc = new_multiple_choice(); + +$mc->qa("Which property of the standard Normal curve allowed you to answer part a)?", +"The standard Normal curve is symmetric about \(0\)"); +$mc->extra("The total area under the curve is \(1\)", "The standard Normal curve extends indefinitely in both directions", "Almost all the area under the standard Normal curve lies between \(-3\) and \(3\)"); +$mc->makeLast("None of the above"); + +$z1=random(-2,-1,.01); +$area1 = normal_prob(-"infty", $z1); +$area1string = sprintf("%.4f", $area1); +$opp= -1*$z1; + +BEGIN_TEXT + +a) The area under the standard Normal curve that lies to the left of \(z=$z1\) is \($area1string\). Without consulting a the table giving areas under the standard Normal curve, determine the area under the standard Normal curve that lies to the right of \(z=$opp\). $BR answer: \{ans_rule(20)\} $BR + +$PAR +b) +\{ $mc->print_q \} +\{ $mc->print_a \} + + +END_TEXT +ANS(Compute($area1string) +->cmp(tolType=>relative,tolerance=>.01)); +ANS(radio_cmp($mc->correct_ans)); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) Since the normal curve is symmetrical about the mean of \(0\), the area found to the left of any \(z\)-score, for example \(z=-1\), will be the same as the area found to the right of the \(z\)-score of opposite sign, in this case \(z=1\). Since the area to the left of \(z=$z1\) is \($area1string\), by symmetry, the area to the right of \(z=$opp\) is \($area1string\) +$PAR +(b) Option \(D\). We answered the above question using symmetry about the mean of \(0\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust39.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust39.pg new file mode 100644 index 0000000000..662114dbc8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust39.pg @@ -0,0 +1,84 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); + +Context("Percent"); + +$showPartialCorrectAnswers = 0; + +$mc = new_multiple_choice(); + +$mc->qa("Which property of the standard Normal curve allowed you to answer part a)?", +"The total area under the curve is \(1\)"); +$mc->extra("The standard Normal curve extends indefinitely in both directions", "The standard Normal curve is symmetric about \(0\)", "Almost all the area under the standard Normal curve lies between \(-3\) and \(3\)"); +$mc->makeLast("None of the above"); + +$z1=random(1,2,.01); +$area1 = normal_prob(-infty, $z1); +$area1string = sprintf("%.4f", $area1); +$ans=Percent(1-$area1); +$leftover = Real(1-$area1); + +BEGIN_TEXT + +a) The area under the standard Normal curve that lies to the left of \(z=$z1\) is \($area1string\). Without consulting a the table giving areas under the standard Normal curve, determine the area under the standard Normal curve that lies to the right of \(z=$z1\). $BR answer: \{ans_rule(20)\} $BR + +$PAR +b) +\{ $mc->print_q \} +\{ $mc->print_a \} + + +END_TEXT +ANS($ans->cmp(tolType=>relative,tolerance=>.01)); +ANS(radio_cmp($mc->correct_ans)); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +(a) The standard Normal curve has a total area of \(1\). Since the area to the left of \(z=$z1\) is \($area1string\), there is an area of \(1-$area1string=$leftover\), or, \(\approx$ans\) on the right side. +$PAR +(b) Option \(D\). We needed to use the fact that the standard Normal curve has a total area of \(1\) to find the area on the right side. + +END_SOLUTION +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust40.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust40.pg new file mode 100644 index 0000000000..e362eda9e3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust40.pg @@ -0,0 +1,63 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +BEGIN_TEXT + +The area under the standard Normal curve that lies to the left of a \(z\)-score is always strictly larger than \{ans_rule(10)\} and strictly smaller than \{ans_rule(10)\}. +END_TEXT + +Context("Percent"); +ANS(Percent(0)->cmp); +ANS(Percent(1)->cmp); + +################################################################## +# Solutions +################################################################## + +BEGIN_SOLUTION + +The total area of the standard Normal curve is always \(1\). As the curve stretches infinitely in both directions, for any positive \(z\)-score you find, there is always a larger one. As such, you will never find a \(z\)-score that corresponds to an area of \(1\), it will always be under \(1\). +$PAR +Similarly, for any negative \(z\)-score you find, there is always a larger one. As such, you will never find a \(z\)-score that corresponds to an area of \(0\), it will always be greater than \(0\). +$PAR +The area under the standard Normal curve that lies to the left of a \(z\)-score is always strictly larger than \(0\) and strictly smaller than \(1\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust41.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust41.pg new file mode 100644 index 0000000000..bd2a8f9648 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/gust41.pg @@ -0,0 +1,101 @@ +##DESCRIPTION +## Statistics: Normal Distribution +##ENDDESCRIPTION + +##KEYWORDS('Statistics') +##Tagged by up2p + +##DBsubject('Statistics') +##DBchapter('Continuous Random Variables and Their Probability Distributions') +##DBsection('The Normal Probability Distribution') +##Date('') +##Author('') +##Institution('ASU') +##TitleText1('') +##EditionText1('') +##AuthorText1('') +##Section1('') +##Problem1('') + +# +# First comes some stuff that appears at the beginning of every problem +# + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$a = random(-2.3,-.01,.01); +$b = random(0,2.3,.01); +$c = random(-2.3,-.01,.01); +$d = random(0,2.3,.01); +$e = random(0,2.3,.01); +$f = random(-2.3,-.01,.01); +$g = random(-2.3,-.01,.01); +$h = random(0,2.3,.01); + +$ans1 = Real(normal_prob($a, $b)); +$ans2 = Real(normal_prob($c, $d)); +$ans3 = Real(normal_prob(-"infty", $e)); +$ans4 = Real(normal_prob(-"infty", $f)); +$ans5 = Real(normal_prob($g, "infty")); +$ans6 = Real(normal_prob($h, "infty")); + +BEGIN_TEXT + +(a) Find the area under the standard Normal curve between \($a\) and \($b\). $BR \{ans_rule(10)\} $PAR +(b) Find the area under the standard Normal curve between \($c\) and \($d\). $BR \{ans_rule(10)\} $PAR +(c) Find the area under the standard Normal curve that lies to the left of \($e\). $BR +\{ans_rule(10)\} $PAR +(d) Find the area under the standard Normal curve that lies to the left of \($f\). $BR +\{ans_rule(10)\} $PAR +(e) Find the area under the standard Normal curve that lies to the right of \($g\). $BR +\{ans_rule(10)\} $PAR +(f) Find the area under the standard Normal curve that lies to the right of \($h\). $BR +\{ans_rule(10)\} + + +END_TEXT +Context("Percent"); +ANS(Percent($ans1)->cmp); +ANS(Percent($ans2)->cmp); +ANS(Percent($ans3)->cmp); +ANS(Percent($ans4)->cmp); +ANS(Percent($ans5)->cmp); +ANS(Percent($ans6)->cmp); + +#################################################### +# Solutions +#################################################### + +BEGIN_SOLUTION +There are various methods of technology to find the appropriate area. Using your preference, we find the following, +$PAR +(a) \(\text{P}($a$g)\approx$ans5\) +$PAR +(f) \(\text{P}(z>$h)\approx$ans6\) +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normal_dist2.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normal_dist2.pg new file mode 100644 index 0000000000..feef5eaa05 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normal_dist2.pg @@ -0,0 +1,222 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Continuous Random Variables and Their Probability Distributions') +## DBsection('The Normal Probability Distribution') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/14/05; Modified 08/18/10 +# modified by J Hagood +# Location: Northern Arizona University + +DOCUMENT(); + +loadMacros("PGstandard.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "MathObjects.pl", + "parserOneOf.pl", + "contextPercent.pl", + "PGstatisticsmacros.pl", + "PGauxiliaryFunctions.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGgraphmacros.pl", + "PGnumericalmacros.pl", + "PGasu.pl", +); + +TEXT(&beginproblem); + +@list = ( 'Length of skateboards in a skateshop', 'The shelf life of a batteries produced by one major company', + 'Fluorescent lighbulbs have lifetimes that ', 'Scores on a standardized exam', + 'Length of snowboards in a boardshop' ); +@list2 = ('the length of skateboards in a skateshop', 'shelf lives of batteries produced by one major company', + 'lifetimes of fluorescent lightbulbs', 'the scores on a standardized exam', + 'the length of snowboards in a boardshop' ); +@mean = ( random( 30, 32, .1 ), random( 3, 5, .1 ), random( 5, 7, .1 ), + random( 500, 550, 1), random( 150, 153, .1 ) ); +@sd = ( random( .1, 1, .1 ), random(.1, 1, .1 ), random(1, 1.6, .1 ), + random( 50, 100, 1 ), random( .1, 1, .1 ) ); +@unit = ( 'in', 'years', 'years', '', 'cm' ); +$ind = random( 0, 4, 1 ); + +@val = ( .67 * $sd[$ind], $sd[$ind], 2 * $sd[$ind] ); +@zscore = ( .67, 1, 2 ); +@slice = NchooseK( 3, 2 ); +$a = $mean[$ind] - $val[$slice[0]]; +$b = $mean[$ind] + $val[$slice[1]]; + +@tmp = split ' ', $list2[$ind]; +$tmp[0] = ucfirst $tmp[0]; +for($i = 1; $i < scalar @tmp; $i++){ + $val = $tmp[$i]; + if (length $val > 2 && $val ne 'the'){ + $val = ucfirst ($val); + $tmp[$i] = $val; + } +} + +$title = join ' ', @tmp; + +$diagram = DrawNormalDist( -$zscore[$slice[0]], $zscore[$slice[1]], $a, $b, outside => $shade, title => $title ); +$diagram1 = DrawNormalDist( $zscore[$slice[1]], -99, $zscore[$slice[1]], "", outside => 1, title => $title ); +$diagram2 = DrawNormalDist( -$zscore[$slice[0]], -99, $zscore[$slice[0]], "", outside => 1, title => $title ); + +$newz1prob = Real(normal_prob(-99, $zscore[$slice[1]])); +$newz0prob = Real(normal_prob(-99, -$zscore[$slice[0]])); +$totalprob = ($newz1prob-$newz0prob); + + +if( $shade == 0 ){ @prop = ( .25, .34, .475 ); + $l = $prop[$slice[0]]; + $r = $prop[$slice[1]]; + $ans = $l + $r; +}else{ @prop = ( .25, .16, .025 ); + $l = $prop[$slice[0]]; + $r = $prop[$slice[1]]; + $ans = $l + $r; +} +BEGIN_TEXT + +$list[$ind] are Normally distributed with a mean of \($mean[$ind]\) $unit[$ind] and a standard deviation of +\($sd[$ind]\) $unit[$ind]. The figure below shows the distribution of $list2[$ind]. +Calculate the shaded area under the curve. $PAR + \{ans_rule( 15 )\} +$PAR +$BCENTER +\{Plot($diagram, tex_size=>900);\} +$ECENTER + +END_TEXT +Context("Numeric"); + +Context()->flags->set(tolerance=>0.00001); + +$ans = Real("$ans"); + +if (Compute($ans) == 0.0015) +{$ans = OneOf($ans,0.001349898);} +elsif (Compute($ans) == 0.003) +{$ans = OneOf($ans,0.002699796);} +elsif (Compute($ans) == 0.0235) +{$ans = OneOf($ans,0.021400234);} +elsif (Compute($ans) == 0.025) +{$ans = OneOf($ans,0.022750132);} +elsif (Compute($ans) == 0.0265) +{$ans = OneOf($ans,0.024100030);} +elsif (Compute($ans) == 0.05) +{$ans = OneOf($ans,0.045500264);} +elsif (Compute($ans) == 0.09) +{$ans = OneOf($ans,0.092773641);} +elsif (Compute($ans) == 0.135) +{$ans = OneOf($ans,0.135905122);} +elsif (Compute($ans) == 0.1585) +{$ans = OneOf($ans,0.157305356);} +elsif (Compute($ans) == 0.16) +{$ans = OneOf($ans,0.158655254);} +elsif (Compute($ans) == 0.1615) +{$ans = OneOf($ans,0.160005152);} +elsif (Compute($ans) == 0.185) +{$ans = OneOf($ans,0.181405386);} +elsif (Compute($ans) == 0.225) +{$ans = OneOf($ans,0.228678763);} +elsif (Compute($ans) == 0.2485) +{$ans = OneOf($ans,0.250078997);} +elsif (Compute($ans) == 0.25) +{$ans = OneOf($ans,0.248571105,0.251428895);} +elsif (Compute($ans) == 0.2515) +{$ans = OneOf($ans,0.252778793);} +elsif (Compute($ans) == 0.275) +{$ans = OneOf($ans,0.274179027);} +elsif (Compute($ans) == 0.32) +{$ans = OneOf($ans,0.317310508);} +elsif (Compute($ans) == 0.34) +{$ans = OneOf($ans,0.341344746);} +elsif (Compute($ans) == 0.41) +{$ans = OneOf($ans,0.410084149);} +elsif (Compute($ans) == 0.475) +{$ans = OneOf($ans,0.477249868);} +elsif (Compute($ans) == 0.4985) +{$ans = OneOf($ans,0.498650102);} +elsif (Compute($ans) == 0.5) +{$ans = OneOf($ans,0.497142210,0.502857790);} +elsif (Compute($ans) == 0.5015) +{$ans = OneOf($ans,0.501349898);} +elsif (Compute($ans) == 0.525) +{$ans = OneOf($ans,0.522750132);} +elsif (Compute($ans) == 0.59) +{$ans = OneOf($ans,0.589915851);} +elsif (Compute($ans) == 0.66) +{$ans = OneOf($ans,0.658655254);} +elsif (Compute($ans) == 0.725) +{$ans = OneOf($ans,0.725820973);} +elsif (Compute($ans) == 0.7485) +{$ans = OneOf($ans,0.747221207);} +elsif (Compute($ans) == 0.75) +{$ans = OneOf($ans,0.748571105,0.751428895);} +elsif (Compute($ans) == 0.7515) +{$ans = OneOf($ans,0.749921003);} +elsif (Compute($ans) == 0.775) +{$ans = OneOf($ans,0.771321237);} +elsif (Compute($ans) == 0.815) +{$ans = OneOf($ans,0.818594614);} +elsif (Compute($ans) == 0.8385) +{$ans = OneOf($ans,0.839994848);} +elsif (Compute($ans) == 0.84) +{$ans = OneOf($ans,0.841344746);} +elsif (Compute($ans) == 0.8415) +{$ans = OneOf($ans,0.842694644);} +elsif (Compute($ans) == 0.865) +{$ans = OneOf($ans,0.864094878);} +elsif (Compute($ans) == 0.91) +{$ans = OneOf($ans,0.907226359);} +elsif (Compute($ans) == 0.95) +{$ans = OneOf($ans,0.954499736);} +elsif (Compute($ans) == 0.9675) +{$ans = OneOf($ans , 0.978599766);} +elsif (Compute($ans) == 0.9735) +{$ans = OneOf($ans,0.975899970);} +elsif (Compute($ans) == 0.975) +{$ans = OneOf($ans,0.977249868);} +elsif (Compute($ans) == 0.997) +{$ans = OneOf($ans,0.997300204);} +elsif (Compute($ans) == 0.9985) +{$ans = OneOf($ans,0.998650102);} + +Context("Percent"); +@possibilities = $ans->value; +@newpos = (); +for my $i (@possibilities) {push(@newpos,Percent($i))}; +$ans = OneOf(@newpos); + +Context()->flags->set(tolerance=>0.01); + +ANS( $ans->cmp ); + +#################################################### +##Solution +#################################################### + +BEGIN_SOLUTION + +The area between two specific \(z\)-scores cannot be calculated directly with many forms of technology. It is easier to find the area to the left of the larger \(z\)-score and then the areal to the left of the smaller \(z\)-score and find the difference between them. +$PAR +In this question we have a mean of \($mean[$ind]\) $unit[$ind] and standard deviation \($sd[$ind]\) $unit[$ind]. For the larger data of \($b\) $unit[$ind], we find a \(z\)-score of \(z=\frac{$b-$mean[$ind]}{$sd[$ind]}=$zscore[$slice[1]]\). For this \(z\)-score, we find the area below it to be \(\approx $newz1prob\), which can be seen in the diagram below. +$PAR +\{Plot($diagram1, tex_size=>900);\} +$PAR +For the smaller data \($a\) $unit[$ind], we find a \(z\)-score of \(z=\frac{$a-$mean[$ind]}{$sd[$ind]}=-$zscore[$slice[0]]\). For this \(z\)-score, we find the area below it to be \(\approx $newz0prob\), which can be seen in the diagram below. +$PAR +\{Plot($diagram2, tex_size=>900);\} +$PAR +Subtracting the smaller area from the larger, we find the area in between to be \($newz1prob-$newz0prob =$totalprob\) + +END_SOLUTION + +ENDDOCUMENT(); + + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normal_dist3.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normal_dist3.pg new file mode 100644 index 0000000000..31c4203ccc --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normal_dist3.pg @@ -0,0 +1,231 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Continuous Random Variables and Their Probability Distributions') +## DBsection('The Normal Probability Distribution') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/15/05; Modified 08/18.10 +# modified by J. Hagood +# Location: Northern Arizona University + +DOCUMENT(); + +loadMacros("PGstandard.pl", + "PGnauGraphics.pl", + "PGnauStats.pl", + "MathObjects.pl", + "parserOneOf.pl", + "contextPercent.pl", + "PGauxiliaryFunctions.pl", + "PGasu.pl", + "PGnumericalmacros.pl", + "PGstatisticsmacros.pl", +); + +TEXT(&beginproblem); + +@list = ( 'Length of skateboards in a skateshop', 'The shelf life of a batteries produced by one major company', + 'Fluorescent lighbulbs have lifetimes that ', 'Scores on a standardized exam', + 'Length of snowboards in a boardshop' ); +@list2 = ('the length of skateboards in a skateshop', 'shelf lives of batteries produced by one major company', + 'lifetimes of fluorescent lightbulbs', 'the scores on a standardized exam', + 'the length of snowboards in a boardshop' ); +@mean = ( random( 30, 32, .1 ), random( 3, 5, .1 ), random( 5, 7, .1 ), + random( 500, 550, 1), random( 150, 153, .1 ) ); +@sd = ( random( .1, 1, .1 ), random(.1, 1, .1 ), random(1, 1.6, .1 ), + random( 50, 100, 1 ), random( .1, 1, .1 ) ); +$ind = random( 0, 4, 1 ); +@unit = ( 'in', 'years', 'years', '', 'cm' ); +$shade = list_random( 0, 1 ); +$fact = list_random( -1, 1 ); +@val = ( .67 * $sd[$ind], $sd[$ind], 2 * $sd[$ind] ); +@zscore = ( .67, 1, 2 ); +@prop = ( .25, .34, .475 ); +$s1 = list_random( 0, 1 ); +push @slice, $s1, 2; +$a1 = $prop[$slice[1]]; +$a2 = $prop[$slice[0]]; +$z = $val[$slice[1]]; +$y = $val[$slice[0]]; +$z1 = $zscore[$slice[1]]; +$z2 = $zscore[$slice[0]]; + +if( $fact == -1 ){$a = $mean[$ind] - $z; + $b = $mean[$ind] - $y; + $newz1 = -$z1; + $newz2 = -$z2; + if( $shade == 0 ){ + $ans = $a1 - $a2; + }else{$ans = 1 - ( $a1 - $a2 ); + } +}else{ $a = $mean[$ind] + $y; + $b = $mean[$ind] + $z; + $newz1 = $z2; + $newz2 = $z1; + if( $shade == 0 ){ + $ans = $a1 - $a2; + }else{$ans = 1 - ( $a1 - $a2 ); + } +} + +@tmp = split ' ', $list2[$ind]; +$tmp[0] = ucfirst $tmp[0]; +for($i = 1; $i < scalar @tmp; $i++){ + $val = $tmp[$i]; + if (length $val > 2 && $val ne 'the'){ + $val = ucfirst ($val); + $tmp[$i] = $val; + } +} + +$title = join ' ', @tmp; + +$diagram = DrawNormalDist( $newz1, $newz2, $a, $b, outside => $shade, title => $title ); +$diagram1 = DrawNormalDist( $newz1, -99, $newz1, "", outside => 1, title => $title ); +$diagram2 = DrawNormalDist( $newz2, -99, $newz2, "", outside => 1, title => $title ); +$newz1prob = Real(normal_prob(-99, $newz1)); +$newz2prob = Real(normal_prob(-99, $newz2)); +$totalprob = ($newz2prob-$newz1prob); +; +BEGIN_TEXT + +$list[$ind] are normally distributed with a mean of \($mean[$ind]\) $unit[$ind] and a standard deviation of +\($sd[$ind]\) $unit[$ind]. The figure below shows the distribution of $list2[$ind]. +Calculate the shaded area under the curve. $PAR +\{ans_rule( 15 )\} +$PAR +$BCENTER +\{Plot($diagram, tex_size=>900)\} +$ECENTER +END_TEXT + + +Context("Numeric"); + +Context()->flags->set(tolerance=>0.00001); + +$ans = Real("$ans"); + +if (Compute($ans) == 0.0015) +{$ans = OneOf($ans,0.001349898);} +elsif (Compute($ans) == 0.003) +{$ans = OneOf($ans,0.002699796);} +elsif (Compute($ans) == 0.0235) +{$ans = OneOf($ans,0.021400234);} +elsif (Compute($ans) == 0.025) +{$ans = OneOf($ans,0.022750132);} +elsif (Compute($ans) == 0.0265) +{$ans = OneOf($ans,0.024100030);} +elsif (Compute($ans) == 0.05) +{$ans = OneOf($ans,0.045500264);} +elsif (Compute($ans) == 0.09) +{$ans = OneOf($ans,0.092773641);} +elsif (Compute($ans) == 0.135) +{$ans = OneOf($ans,0.135905122);} +elsif (Compute($ans) == 0.1585) +{$ans = OneOf($ans,0.157305356);} +elsif (Compute($ans) == 0.16) +{$ans = OneOf($ans,0.158655254);} +elsif (Compute($ans) == 0.1615) +{$ans = OneOf($ans,0.160005152);} +elsif (Compute($ans) == 0.185) +{$ans = OneOf($ans,0.181405386);} +elsif (Compute($ans) == 0.225) +{$ans = OneOf($ans,0.228678763);} +elsif (Compute($ans) == 0.2485) +{$ans = OneOf($ans,0.250078997);} +elsif (Compute($ans) == 0.25) +{$ans = OneOf($ans,0.248571105,0.251428895);} +elsif (Compute($ans) == 0.2515) +{$ans = OneOf($ans,0.252778793);} +elsif (Compute($ans) == 0.275) +{$ans = OneOf($ans,0.274179027);} +elsif (Compute($ans) == 0.32) +{$ans = OneOf($ans,0.317310508);} +elsif (Compute($ans) == 0.34) +{$ans = OneOf($ans,0.341344746);} +elsif (Compute($ans) == 0.41) +{$ans = OneOf($ans,0.410084149);} +elsif (Compute($ans) == 0.475) +{$ans = OneOf($ans,0.477249868);} +elsif (Compute($ans) == 0.4985) +{$ans = OneOf($ans,0.498650102);} +elsif (Compute($ans) == 0.5) +{$ans = OneOf($ans,0.497142210,0.502857790);} +elsif (Compute($ans) == 0.5015) +{$ans = OneOf($ans,0.501349898);} +elsif (Compute($ans) == 0.525) +{$ans = OneOf($ans,0.522750132);} +elsif (Compute($ans) == 0.59) +{$ans = OneOf($ans,0.589915851);} +elsif (Compute($ans) == 0.66) +{$ans = OneOf($ans,0.658655254);} +elsif (Compute($ans) == 0.725) +{$ans = OneOf($ans,0.725820973);} +elsif (Compute($ans) == 0.7485) +{$ans = OneOf($ans,0.747221207);} +elsif (Compute($ans) == 0.75) +{$ans = OneOf($ans,0.748571105,0.751428895);} +elsif (Compute($ans) == 0.7515) +{$ans = OneOf($ans,0.749921003);} +elsif (Compute($ans) == 0.775) +{$ans = OneOf($ans,0.771321237);} +elsif (Compute($ans) == 0.815) +{$ans = OneOf($ans,0.818594614);} +elsif (Compute($ans) == 0.8385) +{$ans = OneOf($ans,0.839994848);} +elsif (Compute($ans) == 0.84) +{$ans = OneOf($ans,0.841344746);} +elsif (Compute($ans) == 0.8415) +{$ans = OneOf($ans,0.842694644);} +elsif (Compute($ans) == 0.865) +{$ans = OneOf($ans,0.864094878);} +elsif (Compute($ans) == 0.91) +{$ans = OneOf($ans,0.907226359);} +elsif (Compute($ans) == 0.95) +{$ans = OneOf($ans,0.954499736);} +elsif (Compute($ans) == 0.9675) +{$ans = OneOf($ans , 0.978599766);} +elsif (Compute($ans) == 0.9735) +{$ans = OneOf($ans,0.975899970);} +elsif (Compute($ans) == 0.975) +{$ans = OneOf($ans,0.977249868);} +elsif (Compute($ans) == 0.997) +{$ans = OneOf($ans,0.997300204);} +elsif (Compute($ans) == 0.9985) +{$ans = OneOf($ans,0.998650102);} + +Context("Percent"); +@possibilities = $ans->value; +@newpos = (); +for my $i (@possibilities) {push(@newpos,Percent($i))}; +$ans = OneOf(@newpos); + +Context()->flags->set(tolerance=>0.01); + +ANS( $ans->cmp ); + +#################################################### +##Solution +#################################################### + +BEGIN_SOLUTION + +The area between two specific \(z\)-scores cannot be calculated directly with many forms of technology. It is easier to find the area to the left of the larger \(z\)-score and then the areal to the left of the smaller \(z\)-score and find the difference between them. +$PAR +In this question we have a mean of \($mean[$ind]\) $unit[$ind] and standard deviation \($sd[$ind]\) $unit[$ind]. For the larger data of \($b\) $unit[$ind], we find a \(z\)-score of \(z=\frac{$b-$mean[$ind]}{$sd[$ind]}=$newz2\). For this \(z\)-score, we find the area below it to be \(\approx $newz2prob\), which can be seen in the diagram below. +$PAR +\{Plot($diagram2, tex_size=>900);\} +$PAR +For the smaller data \($a\) $unit[$ind], we find a \(z\)-score of \(z=\frac{$a-$mean[$ind]}{$sd[$ind]}=$newz1\). For this \(z\)-score, we find the area below it to be \(\approx $newz1prob\), which can be seen in the diagram below. +$PAR +\{Plot($diagram1, tex_size=>900);\} +$PAR +Subtracting the smaller area from the larger, we find the area in between to be \($newz2prob-$newz1prob = $totalprob\) + +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normal_quartile1.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normal_quartile1.pg new file mode 100644 index 0000000000..3d532ed22f --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normal_quartile1.pg @@ -0,0 +1,64 @@ +##DESCRIPTION +## DBsubject('Statistics') +## DBchapter('Descriptive Statistics') +## DBsection('Quartiles') +## KEYWORDS('') +## Author('N.Spencer Sitton') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 07/05/05 +# Location: Northern Arizona University +# Course: Qauntitative Reasoning + +DOCUMENT(); +loadMacros("PGstandard.pl", + "PGauxiliaryFunctions.pl", + "MathObjects.pl", + +); + +TEXT( &beginproblem ); +@list1 = ( 'lower', 'first' ); +@list2 = ( 'upper', 'third' ); +$ind = random( 0, 1, 1); + +do{ $mean = random(150, 600, 1); + $sd = random( 30, 100, 1); +} until( $mean - 3 * $sd > 0 ); +$ans1 = $mean - .6745 * $sd; +$ans2 = $mean + .6745 * $sd; + + +BEGIN_TEXT + +The scores of students on an exam are Normally distributed with a mean of \($mean\) and a standard +deviation of \($sd\). +$PAR +(a) What is the $list1[$ind] quartile score for this exam? $BR +$SPACE $SPACE $SPACE\{ ans_rule ( 15 ) \} +$PAR +(b) What is the $list2[$ind] quartile score for this exam? $BR +$SPACE $SPACE $SPACE\{ ans_rule ( 15 ) \} + +END_TEXT + +ANS( Compute( $ans1)->cmp(tolType=>relative,tolerance=>.01)); +ANS( Compute( $ans2 )->cmp(tolType=>relative,tolerance=>.01) ); + +#################################################### +##Solution +#################################################### + +BEGIN_SOLUTION +(a) The $list1[$ind] quartile means that \(25$PERCENT\) of scores fall below the score in question. To find the score in question, we will need a \(z\)-score. Using inverse technology with an area of \(0.25\), we find \(z\approx \). This allows us to set up and solve a \(z\)-score equation. +$PAR +\(z=\frac{x-\bar{x}}{s_{x}}\). Using this we find, \(z=\frac{x-$mean}{$sd}\), which can be solved to find \(x\approx$ans1\). +$PAR +(b) The $list2[$ind] quartile means that \(75$PERCENT\) of sores fall below the score in question. To find the score in question, we will need a \(z\)-score. Using inverse technology with an area of \(0.75\), we find \(z\approx \). This allows us to set up and solve a \(z\)-score equation. +$PAR +\(z=\frac{x-\bar{x}}{s_{x}}\). Using this, we find, \(z=\frac{x-$mean}{$sd}\), which can be solved to find \(x\approx$ans2\). + +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normprob1.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normprob1.pg new file mode 100644 index 0000000000..16efd9a0e4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normprob1.pg @@ -0,0 +1,63 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('probability','statistics','normal','normal distribution') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/1/05 +# from pl/setProbability10NormalDist/ur_pb_10_10.pg +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"contextPercent.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$s = random(800,1100,25); +do {$mu = random(500,1.1*$s,10);} until (abs($mu-$s)>10); +$sig = random(150,300,10); + +$z = Real(($s-$mu)/$sig); +$ans = Real(100*normal_prob('-infty', $s, mean=>$mu, deviation=>$sig)); + +BEGIN_TEXT + +The combined math and verbal scores for students taking a national standardized examination for college admission, is Normally distributed with a mean of \($mu\) and a standard deviation of \($sig\). If a college requires a minimum score of \($s\) +for admission, what percentage of students do not satisfy that requirement? $PAR + +\{ans_rule(10)\} of students do not satisfy that requirement. + +END_TEXT + +Context("Percent"); +ANS(Percent("$ans %")->cmp()); + +######################################################Solution +#################################################### + +BEGIN_SOLUTION + +To find what percentage of students do not satisfy that requirement, we will need to find a \(z\)-score for a test score of \($s\). +$PAR +Thus, we find \(z=\frac{$s-$mu}{$sig}=$z\). Using technology we find that \(\text{P}(z<$z)\approx $ans$PERCENT\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normprob2.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normprob2.pg new file mode 100644 index 0000000000..4298179742 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normprob2.pg @@ -0,0 +1,71 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('probability','statistics','normal','normal distribution') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/1/05 +# from pl/setProbability10NormalDist/ur_pb_10_10.pg) +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGgraphmacros.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl", +"PGauxiliaryFunctions.pl", +); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 1; + +$p = random(10,40,5); +$mu = random(500,900,10); +$sig = random(150,300,10); +$q = 50-$p; +$leftp = (100-$p); +$leftarea = ($leftp/100); +$ans = Real(normal_distr($q/100, mean=>$mu, deviation=>$sig)); +$z = Real(($ans-$mu)/$sig); +$ansround = ceil($ans); + +BEGIN_TEXT + +The combined math and verbal scores for +students taking a national standardized examination for college admission is +Normally distributed with a mean of \($mu\) and a standard deviation of \($sig\). +If a college requires a student to be in the top \($p$PERCENT\) of students taking this test, +what is the minimum score that such a student can obtain and still qualify for admission at +the college? Remember that scores on this test are whole numbers. +$PAR +\{ans_rule(10)\} + +END_TEXT + +ANS(Compute(ceil($ans))->cmp(tolType=>absolute,tolerance=>0.5)); + +######################################################Solution +#################################################### + +BEGIN_SOLUTION + +To reach the top \($p$PERCENT\) of scores, means you have done better than \($leftp$PERCENT\) of all other people who take the test. To find the \(z\)-score that corresponds to the score that puts you in the top \($p$PERCENT\), we need to use the area corresponding to \($leftp$PERCENT\) since our technology can only "look left." +$PAR +Using inverse technology with an area of \($leftarea\), we find \(z=$z\). +$PAR +This allows us to find the score in question by using the \(z\)-score formula. Thus, we find \($z=\frac{x-$mu}{$sig}\) which can be solved to find \(x\approx $ans\). Since test scores must be a whole number and we want to be in the top \($p$PERCENT\), we will round our score up to \(x=$ansround\). + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normprob3.pg b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normprob3.pg new file mode 100644 index 0000000000..e1ff5bdb06 --- /dev/null +++ b/OpenProblemLibrary/PCC/Statistics/zScoresInGeneral/normprob3.pg @@ -0,0 +1,85 @@ +##DESCRIPTION +## DBsubject('Probability') +## DBchapter('Distributions') +## DBsection('Normal Distribution') +## KEYWORDS('') +## Author('Michael Ratliff') +## Institution('NAU') +##ENDDESCRIPTION + +# File Created: 7/2/05 +# Location: Northern Arizona University +# Course: MAT 119 - Finite Mathematics + +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( +"PG.pl", +"PGbasicmacros.pl", +"PGchoicemacros.pl", +"PGanswermacros.pl", +"PGauxiliaryFunctions.pl", +"PGasu.pl", +"PGnumericalmacros.pl", +"PGstatisticsmacros.pl", +"MathObjects.pl" +); + +TEXT(&beginproblem); +$showPartialCorrectAnswers = 1; + +$p1 = random(5,45,5); +$x1 = random(1,10,1); +$p2 = random(55,95,5); +$x2 = random(11,20,1); +$prop1 = ($p1/100); +$prop2 = ($p2/100); + +$z1 = Real(-normal_distr(.5-$p1/100, mean=>0, deviation=>1)); +$z2 = Real(normal_distr($p2/100-.5, mean=>0, deviation=>1)); +$sig = ($x2-$x1)/($z2-$z1); +$mu = $x1-$sig*$z1; + +BEGIN_TEXT +Consider a Normal distribution curve where \($p2\)-th percentile is at \($x2\) and the \($p1\)-th percentile is at \($x1\). +Use this information to find the mean, \(\mu\) , and the standard deviation, \(\sigma \), of the distribution. This is basically an algebra problem where you have two equations in two unknowns, and you must solve for the two unknowns. +$PAR +a) $SPACE\(\mu =\) \{ans_rule(20)\}$BR$BR +b) $SPACE\(\sigma =\) \{ans_rule(20)\}$BR + + + +END_TEXT + +ANS(Compute($mu)->cmp(tolType=>relative,tolerance=>.01)); +ANS(Compute($sig)->cmp(tolType=>relative,tolerance=>.01)); + +#################################################### +## Solutions +#################################################### + +BEGIN_SOLUTION + +First we will find the \(z\)-scores that correspond to the \($p2\)-th and \($p1\)-th percentile. Using inverse technology with area \($prop2\) and \($prop1\) we find \(z=$z2\) and \(z=$z1\) respectively. +$PAR +This allows us to build two equations involving \(z\)-scores, +$PAR +\($z2=\frac{$x2-\mu}{\sigma}\) and \($z1=\frac{$x1-\mu}{\sigma}\) +$PAR +Solving each for \(\mu\), we find, +$PAR +\(\mu = $x2-(\sigma\cdot$z2)\) and \(\mu = $x1-(\sigma\cdot$z1)\) respectively. +$PAR +Setting the two equations equal to each other we have, +$PAR +\($x2-(\sigma\cdot$z2)=$x1-(\sigma\cdot$z1)\) +$PAR +This can solved to find \(\sigma = $sig\). +$PAR +The value \(\sigma=$sig\) can then be used in the either equation of \($z2=\frac{$x2-\mu}{\sigma}\) or \($z2=\frac{$x2-\mu}{\sigma}\) to find \(\mu\). Either equation can be solved to find \(\mu=$mu\) + + +END_SOLUTION + +ENDDOCUMENT(); # This should be the last executable line in the problem. + diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength10.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength10.pg new file mode 100644 index 0000000000..4ca7f57cc1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength10.pg @@ -0,0 +1,80 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$radius = random(2,9,1); + +$angle = random(5,355,5); +$answer = $radius*$angle*pi/180; + +#################################### + +BEGIN_PGML +Find the length of an arc on a circle of radius [`[$radius]`] units corresponding to an angle of [`[$angle]^{\circ}`]. + + Arc length = [____________]{$answer} units + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. + +In order to change from degrees to radians, we multiply the +angle's measure by [` \frac{\pi}{180^{\circ}} `], so we have [` [$angle]^{\circ} \cdot \frac{\pi}{180^{\circ}} `] radians. + +The full solution is: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + &= [$radius] \cdot [$angle]^{\circ} \cdot \frac{\pi}{180^{\circ}} \\ + &\approx [$answer] +\end{aligned} + ``] + +Thus our arc length is [` [$answer] `] units. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength20.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength20.pg new file mode 100644 index 0000000000..37f2795b5b --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength20.pg @@ -0,0 +1,82 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$radius = random(2,9,1); +$diameter = 2*$radius; + +$angle = random(0.5,6,0.5); +$answer = $radius*$angle; + +Context()->operators->undefine("+","-","*","/","^","**"); + +#################################### + +BEGIN_PGML +Find the length of an arc on a circle of diameter [`[$diameter]`] units corresponding to an angle of [`[$angle]`] radians. + + Arc length = [____________]{$answer} units + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. + +In this problem, diameter is given. Don't forget to calculate the radius length by [` \text{diameter =} 2\cdot \text{radius}`]. + +The full solution is: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + &= \frac{[$diameter]}{2} \cdot [$angle] \\ + &= [$answer] +\end{aligned} + ``] + +Thus the arc length is [` [$answer] `] units. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength30.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength30.pg new file mode 100644 index 0000000000..121c5717d0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength30.pg @@ -0,0 +1,87 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$radius = random(2,9,1); +$degree = random(5,355,5); +$arc = Compute("$radius*$degree*pi/180"); + +$arc = int($arc); +$radian = $arc/$radius; +$degree = $radian*180/pi; + + +#################################### + +BEGIN_PGML + +If the arc length on a circle of radius [`[$radius]`] units is [`[$arc]`] units. Find the corresponding central angle's measure in both radian and degrees. + + Angle (in radian) = [____________]{$radian} radians + + Angle (in degree) = [____________]{$degree} degrees + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. + +Here is how to calculate the angle: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + \theta &= \frac{s}{r} \\ + &= \frac{[$arc]}{[$radius]} \\ + &\approx [$radian] \text{ radians} \\ + &= [$radian] \cdot \frac{180^{\circ}}{\pi} \\ + &\approx [$degree]^{\circ} +\end{aligned} + ``] + +Thus the angle's measure is [` [$radian] `] radians, or [`[$degree]^{\circ}`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength40.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength40.pg new file mode 100644 index 0000000000..197640631b --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength40.pg @@ -0,0 +1,117 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$unit = list_random("in","cm"); + +$short = random(2,9,1); +$shortU = NumberWithUnits("$short $unit"); +$long = $short + random(1,3,1); +$longU = NumberWithUnits("$long $unit"); + +$hour = random(2,11,0.25); +$hourU = NumberWithUnits("$hour hr"); + +$arcLong = $long*$hour*360*pi/180; +$arcLongU = NumberWithUnits("$arcLong $unit"); +$arcShort = $short*$hour*30*pi/180; +$arcShortU = NumberWithUnits("$arcShort $unit"); + +Context()->operators->undefine("+","-","*","/","^","**"); + +#################################### + +BEGIN_PGML + +A clock's minute hand is [`[$longU]`] in length, and its hour hand is [`[$shortU]`] in length. If the clock ran [`[$hourU]`], how far did the tip of the hour hand travel? How far did the tip of the minute hand travel? + +[@KeyboardInstructions( +"\n" +.'* Please include units in your answers.' +)@]** + +The tip of the hour hand travelled [____________]{$arcShortU}. + +The tip of the minute hand travelled [____________]{$arcLongU}. + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +Each time the clock runs a hour, the hour hand travels [`30^{\circ}`], and the minute hand travels [`360^{\circ}`]. + +When the clock ran [`[$hourU]`], the hour hand travels [`[$hour]\cdot30^{\circ}`], and the minute hand travels [`[$hour]\cdot360^{\circ}`]. + +To calculate how far the tip of hour hand and minute hand travelled, we need to use the arc length formula: + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. Note that you need to change the angle to radian if it's given in degrees. + +To calculate how far the tip of the hour hand travelled, we have: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + &= [$shortU] \cdot [$hour]\cdot30^{\circ} \cdot \frac{\pi}{180^{\circ}} \\ + &\approx [$arcShortU] +\end{aligned} + ``] + +The tip of the hour hand travelled [`[$arcShortU]`]. + +To calculate how far the tip of the minute hand travelled, we have: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + &= [$longU] \cdot [$hour]\cdot360^{\circ} \cdot \frac{\pi}{180^{\circ}} \\ + &\approx [$arcLongU] +\end{aligned} + ``] + +The tip of the minute hand travelled [`[$arcLongU]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength50.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength50.pg new file mode 100644 index 0000000000..78251098b2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength50.pg @@ -0,0 +1,95 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$unit = "mi"; + +$degreeA = random(5,15,0.1); +$degreeDif = random(1,10,0.1); +$degreeB = $degreeA + $degreeDif; + +$arc = $degreeDif*3960*pi/180; +$arcU = NumberWithUnits("$arc $unit"); + +Context()->operators->undefine("+","-","*","/","^","**"); + +#################################### + +BEGIN_PGML + +Two cities have the same longitude. The latitude of city A is [`[$degreeA]^{\circ}`] north and the latitude of city B is [`[$degreeB]^{\circ}`] north. Assume the radius of the earth is [`3960`] miles. Find the distance between the two cities. + +[@KeyboardInstructions( +"\n" +.'* Please include units in your answers.' +)@]** + +The distance between those two cities is [____________]{$arcU}. + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +Those difference between those two cities's latitude is [`[$degreeB]^{\circ}-[$degreeA]^{\circ}=[$degreeDif]^{\circ}`]. + +To calculate the length of the arc between those two cities along the longtitude, we need to use the arc length formula: + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. Note that you need to change the angle to radian if it's given in degrees. + +To calculate the arc length, we have: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + &= 3960 \text{ mi} \cdot [$degreeDif]^{\circ}\cdot \frac{\pi}{180^{\circ}} \\ + &\approx [$arcU] +\end{aligned} + ``] + +The distance between those two cities is [`[$arcU]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength60.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength60.pg new file mode 100644 index 0000000000..49de28be84 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/ArcLength60.pg @@ -0,0 +1,88 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "AnswerFormatHelp.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$radius = random(2,5,0.1); +$degree = random(15,300,5); +$arc = Compute("$radius*$degree*pi/180"); + +$arc = int($arc); +$radian = Compute("$arc/$radius"); +$degree = $radian*180/pi; + +Context()->operators->undefine("+","-","*","/","^","**"); + +#################################### + +BEGIN_PGML + +A person walked [`[$arc]`] miles along the bank of a circular lake. If the radius of the lake is [`[$radius]`] miles, what's the angle, in degrees, of the person's final position relative to his starting position? + + Angle (in degree) = [____________]{$degree} degrees + +END_PGML + +##################################### + +$showPartialCorrectAnswers = 1; + + +BEGIN_PGML_SOLUTION + +The person walked [`[$arc]`] miles along the circular bank. This is the arc length of the arc of the circle. The lake's radius is also given as [`[$raidus]`] miles. + +The arc length, [`s`], corresponding to an angle of [`\theta`] radians in a circle of radius [`r`] is [`s = r \cdot \theta `]. Note that we have to change radian to degree by multiplying [`\frac{180^{\circ}}{\pi}`]. + +Here is how to calculate the angle: + + [`` +\begin{aligned} + s &= r \cdot \theta \\ + \theta &= \frac{s}{r} \\ + &= \frac{[$arc]}{[$radius]} \\ + &\approx [$radian] \text{ radians} \\ + &= [$radian] \cdot \frac{180^{\circ}}{\pi} \\ + &\approx [$degree]^{\circ} +\end{aligned} + ``] + +Thus the angle's measure is [`[$degree]^{\circ}`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian10.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian10.pg new file mode 100644 index 0000000000..eee6209b60 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian10.pg @@ -0,0 +1,89 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +do {$a = 15*random(1,29,1);} until ($a != 180); +$frac = Fraction($a,180)->reduce; +($num,$den) = $frac->value; + +Context("LimitedRadical"); +$ans1 = $num==1 ? Formula("pi/$den") : Formula("$num*pi/$den"); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$dec = Real("$a*pi/180"); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +What is the exact radian angle measure for [` [$a]^{\circ} `] as a fraction of [` \pi `]? + +[@KeyboardInstructions( +"\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use fraction in your answer.' +)@]** + + [`` [$a]^{\circ} =``][__________]{$ans1}[`\text{ radians}`] + +What is a decimal approximation for the radian angle measure for [` [$a]^{\circ} `] accurate to at least two decimal places? + + [`` [$a]^{\circ} \approx ``][__________]{$dec}[`\text{ radians}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$a]^{\circ} `] to radians, multiply by [` \frac{\pi}{180^{\circ}} `]: + + [`` [$a]^{\circ} \cdot \left( \frac{\pi}{180^{\circ}} \right) = [$frac]\pi \text{ radians}``] + +A calculator can convert [`[$frac]\pi`] to [`[$dec]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian20.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian20.pg new file mode 100644 index 0000000000..8f20802b40 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian20.pg @@ -0,0 +1,87 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +do {$a = -15*random(1,29,1);} until ($a != -180); +$frac = Fraction($a,180)->reduce; +($num,$den) = $frac->value; + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$ans1 = specialAngle($num*pi/$den, (2,3,4,5,6,8,10,12,15,18)); +$dec = Real("$a*pi/180"); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +What is the exact radian angle measure for [` [$a]^{\circ} `] as a fraction of [` \pi `]? + +[@KeyboardInstructions( +"\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use fraction in your answer.' +)@]** + + [`` [$a]^{\circ} =``][__________]{$ans1}[` \text{ radians}`] + +What is a decimal approximation for the radian angle measure for [` [$a]^{\circ} `] accurate to at least two decimal places? + + [`` [$a]^{\circ} \approx ``][__________]{$dec}[`\text{ radians}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$a]^{\circ} `] to radians, multiply by [` \frac{\pi}{180^{\circ}} `]: + + [`` [$a]^{\circ} \cdot \left( \frac{\pi}{180^{\circ}} \right) = [$ans1] \text{ radians}``] + +A calculator can convert [`[$ans1]`] to [`[$dec]`]. + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian30.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian30.pg new file mode 100644 index 0000000000..9ad82850d0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian30.pg @@ -0,0 +1,65 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +do {$a = 15*random(1,29,1);} until ($a != 180); +$frac = Fraction($a,180)->reduce; + +Context("Numeric"); + +$dec = Real("$a*pi/180"); + +Context()->operators->undefine("+","-","*","/","^","**"); + +############################################## + +BEGIN_PGML + +What is the degree angle measure for [` [$frac]\pi `]? + + [`` [$frac]\pi =``][__________]{$a}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$frac]\pi `] to degrees, multiply by [` \frac{180^{\circ}}{\pi} `]: + + [`` [$frac]\pi \cdot \left( \frac{180^{\circ}}{\pi} \right) = [$a]^{\circ}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian35.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian35.pg new file mode 100644 index 0000000000..e4ea756b80 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian35.pg @@ -0,0 +1,63 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$a = random(1,10,0.1)*random(-1,1,2); +$d = Real("$a*180/pi"); + +Context()->operators->undefine("+","-","*","/","^","**"); + +############################################## + +BEGIN_PGML + +What is the degree angle measure for [` [$a] \text{ radians}`]? Round your answers to at least 2 decimal places. + + [`` [$a] \text{ radians} =``][__________]{$d}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$a] \text{ radians} `] to degrees, multiply by [` \frac{180^{\circ}}{\pi} `]: + + [`` [$a] \cdot \left( \frac{180^{\circ}}{\pi} \right) = [$d]^{\circ}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian40.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian40.pg new file mode 100644 index 0000000000..58c64af3f5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian40.pg @@ -0,0 +1,65 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +do {$a = -15*random(1,29,1);} until ($a != -180); +$frac = Fraction($a,180)->reduce; + +Context("Numeric"); + +$dec = Real("$a*pi/180"); + +Context()->operators->undefine("+","-","*","/","^","**"); + +############################################## + +BEGIN_PGML + +What is the degree angle measure for [` [$frac]\pi `]? + + [`` [$frac]\pi =``][__________]{$a}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` [$frac]\pi `] to degrees, multiply by [` \frac{180^{\circ}}{\pi} `]: + + [`` [$frac]\pi \cdot \left( \frac{180^{\circ}}{\pi} \right) = [$a]^{\circ}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian50.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian50.pg new file mode 100644 index 0000000000..940df391f3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian50.pg @@ -0,0 +1,154 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +@d = ( + 30, 45, 60, 90, 120, 135, 150, 180, + 210, 225, 240, 270, 300, 315, 330, 360 +); +@r = ( + Formula("pi/6"), Formula("pi/4"), Formula("pi/3"), Formula("pi/2"), + Formula("2*pi/3"), Formula("3*pi/4"), Formula("5*pi/6"), Formula("pi"), + Formula("7*pi/6"), Formula("5*pi/4"), Formula("4*pi/3"), + Formula("3*pi/2"), Formula("5*pi/3"), Formula("7*pi/4"), + Formula("11*pi/6"), Formula("2*pi") +); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +You should be able to do the following frequently-used degree-radian conversions fluently. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + [`` [$d[0]]^{\circ} =``][__________]{$r[0]}[`\text{ radians}`] + + [`` [$d[1]]^{\circ} =``][__________]{$r[1]}[`\text{ radians}`] + + [`` [$d[2]]^{\circ} =``][__________]{$r[2]}[`\text{ radians}`] + + [`` [$d[3]]^{\circ} =``][__________]{$r[3]}[`\text{ radians}`] + + [`` [$d[4]]^{\circ} =``][__________]{$r[4]}[`\text{ radians}`] + + [`` [$d[5]]^{\circ} =``][__________]{$r[5]}[`\text{ radians}`] + + [`` [$d[6]]^{\circ} =``][__________]{$r[6]}[`\text{ radians}`] + + [`` [$d[7]]^{\circ} =``][__________]{$r[7]}[`\text{ radians}`] + + [`` [$d[8]]^{\circ} =``][__________]{$r[8]}[`\text{ radians}`] + + [`` [$d[9]]^{\circ} =``][__________]{$r[9]}[`\text{ radians}`] + + [`` [$d[10]]^{\circ} =``][__________]{$r[10]}[`\text{ radians}`] + + [`` [$d[11]]^{\circ} =``][__________]{$r[11]}[`\text{ radians}`] + + [`` [$d[12]]^{\circ} =``][__________]{$r[12]}[`\text{ radians}`] + + [`` [$d[13]]^{\circ} =``][__________]{$r[13]}[`\text{ radians}`] + + [`` [$d[14]]^{\circ} =``][__________]{$r[14]}[`\text{ radians}`] + + [`` [$d[15]]^{\circ} =``][__________]{$r[15]}[`\text{ radians}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` 30^{\circ} `] to radians, multiply by [` \frac{\pi}{180^{\circ}} `]: + + [`` 30^{\circ} \cdot \left( \frac{\pi}{180^{\circ}} \right) = [$r[0]] \text{ radians}``] + +Starting [` 30^{\circ} = [$r[0]] `], list multiples of [` 30^{\circ} `]: + + [`` 30^{\circ} = [$r[0]] ``] + + [`` 60^{\circ} = 2\cdot[$r[0]] = [$r[2]]``] + + [`` 90^{\circ} = 3\cdot[$r[0]] = [$r[3]]``] + + [`` 120^{\circ} = 4\cdot[$r[0]] = [$r[4]]``] + + [`` 150^{\circ} = 5\cdot[$r[0]] = [$r[6]]``] + + [`` 180^{\circ} = 6\cdot[$r[0]] = [$r[7]]``] + + [`` 210^{\circ} = 7\cdot[$r[0]] = [$r[8]]``] + + [`` 240^{\circ} = 8\cdot[$r[0]] = [$r[10]]``] + + [`` 270^{\circ} = 9\cdot[$r[0]] = [$r[11]]``] + + [`` 300^{\circ} = 10\cdot[$r[0]] = [$r[12]]``] + + [`` 330^{\circ} = 11\cdot[$r[0]] = [$r[14]]``] + + [`` 360^{\circ} = 12\cdot[$r[0]] = [$r[15]]``] + +---- + +To convert [` 45^{\circ} `] to radians, multiply by [` \frac{\pi}{180^{\circ}} `]: + + [`` 45^{\circ} \cdot \left( \frac{\pi}{180^{\circ}} \right) = [$r[1]] \text{ radians}``] + +Starting [` 45^{\circ} = [$r[1]] `], list multiples of [` 45^{\circ} `]: + + [`` 90^{\circ} = 2\cdot[$r[1]] = [$r[3]] ``] + + [`` 135^{\circ} = 3\cdot[$r[1]] = [$r[5]] ``] + + [`` 180^{\circ} = 4\cdot[$r[1]] = [$r[7]] ``] + + [`` 225^{\circ} = 5\cdot[$r[1]] = [$r[9]]``] + + [`` 270^{\circ} = 6\cdot[$r[1]] = [$r[11]] ``] + + [`` 315^{\circ} = 7\cdot[$r[1]] = [$r[13]] ``] + + [`` 360^{\circ} = 8\cdot[$r[1]] = [$r[15]] ``] +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian60.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian60.pg new file mode 100644 index 0000000000..1671203776 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/DegreeAndRadian60.pg @@ -0,0 +1,132 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@d = ( + 30, 45, 60, 90, 120, 135, 150, 180, + 210, 225, 240, 270, 300, 315, 330, 360 +); +@r = ( + Formula("pi/6"), Formula("pi/4"), Formula("pi/3"), Formula("pi/2"), + Formula("(2pi)/3"), Formula("(3pi)/4"), Formula("(5pi)/6"), 1, + Formula("(7pi)/6"), Formula("(5pi)/4"), Formula("(4pi)/3"), + Formula("(3pi)/2"), Formula("(5pi)/3"), Formula("(7pi)/4"), + Formula("(11pi)/6"), Formula("2pi") +); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +You should be able to do the following frequently-used radian-degree conversions fluently. + + [`` [$r[0]] =``][__________]{$d[0]}[`^{\circ}`] + + [`` [$r[1]] =``][__________]{$d[1]}[`^{\circ}`] + + [`` [$r[2]] =``][__________]{$d[2]}[`^{\circ}`] + + [`` [$r[3]] =``][__________]{$d[3]}[`^{\circ}`] + + [`` [$r[4]] =``][__________]{$d[4]}[`^{\circ}`] + + [`` [$r[5]] =``][__________]{$d[5]}[`^{\circ}`] + + [`` [$r[6]] =``][__________]{$d[6]}[`^{\circ}`] + + [`` \pi =``][__________]{$d[7]}[`^{\circ}`] + + [`` [$r[8]] =``][__________]{$d[8]}[`^{\circ}`] + + [`` [$r[9]] =``][__________]{$d[9]}[`^{\circ}`] + + [`` [$r[10]] =``][__________]{$d[10]}[`^{\circ}`] + + [`` [$r[11]] =``][__________]{$d[11]}[`^{\circ}`] + + [`` [$r[12]] =``][__________]{$d[12]}[`^{\circ}`] + + [`` [$r[13]] =``][__________]{$d[13]}[`^{\circ}`] + + [`` [$r[14]] =``][__________]{$d[14]}[`^{\circ}`] + + [`` [$r[15]] =``][__________]{$d[15]}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert [` \frac{\pi}{6} `] to degrees, simply substitute [`\pi`] with [`180^{\circ}`]: + + [`` \frac{\pi}{6} = \frac{180^{\circ}}{6} = 180^{\circ}\div6 = 30^{\circ} ``] + +Similarly: + + [`` \frac{\pi}{4} = \frac{180^{\circ}}{4} = 180^{\circ}\div4 = 45^{\circ} ``] + + [`` \frac{\pi}{3} = \frac{180^{\circ}}{3} = 180^{\circ}\div3\cdot2 = 60^{\circ} ``] + + [`` \frac{\pi}{2} = \frac{180^{\circ}}{2} = 180^{\circ}\div2 = 90^{\circ} ``] + + [`` \frac{2\pi}{3} = \frac{2(180^{\circ})}{3} = 180^{\circ}\div3\cdot2 = 120^{\circ} ``] + + [`` \frac{3\pi}{4} = \frac{3(180^{\circ})}{4} = 180^{\circ}\div4\cdot3 = 135^{\circ} ``] + + [`` \frac{5\pi}{6} = \frac{5(180^{\circ})}{6} = 180^{\circ}\div6\cdot5 = 150^{\circ} ``] + + [`` \pi = 180^{\circ} ``] + + [`` \frac{7\pi}{6} = \frac{7(180^{\circ})}{6} = 180^{\circ}\div6\cdot7 = 210^{\circ} ``] + + [`` \frac{5\pi}{4} = \frac{5(180^{\circ})}{4} = 180^{\circ}\div4\cdot5 = 225^{\circ} ``] + + [`` \frac{4\pi}{3} = \frac{4(180^{\circ})}{3} = 180^{\circ}\div3\cdot4 = 240^{\circ}``] + + [`` \frac{3\pi}{2} = \frac{3(180^{\circ})}{2} = 180^{\circ}\div2\cdot3 = 270^{\circ} ``] + + [`` \frac{5\pi}{3} = \frac{5(180^{\circ})}{3} = 180^{\circ}\div3\cdot5 = 300^{\circ} ``] + + [`` \frac{7\pi}{4} = \frac{7(180^{\circ})}{4} = 180^{\circ}\div7\cdot4 = 315^{\circ} ``] + + [`` \frac{11\pi}{6} = \frac{11(180^{\circ})}{6} = 180^{\circ}\div6\cdot11 = 330^{\circ} ``] + + [`` 2\pi = 2\cdot180^{\circ} = 360^{\circ} ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation10.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation10.pg new file mode 100644 index 0000000000..75403c4402 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation10.pg @@ -0,0 +1,164 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$P_x = 5*cos(pi/3); +$P_y = 5*sin(pi/3); +$small_x = cos(pi/3); +$alt_x = 5*cos(pi/2 - $theta); +$alt_y = 5*sin(pi/2 - $theta); + +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); +$graph[0]->lb(new Label(1,.3,"theta",'blue','left','bottom',large)); +$graph[0]->lb(new Label($P_x+.1,$P_y+.1,"P",'black','left','bottom',large)); +$graph[0]->lb(new Label($alt_x+.1,$alt_y+.1,"A",'red','left','bottom',large)); +$graph[0]->lb(new Label($alt_x+.2,-$alt_y-.2,"B",'red','left','bottom',large)); +$graph[0]->lb(new Label($P_x,-$P_y-.5,"C",'red','left','bottom',large)); +$graph[0]->lb(new Label(-$P_x-.1,-$P_y-.5,"D",'red','left','bottom',large)); +$graph[0]->lb(new Label(-$alt_x-.4,-$alt_y-.2,"E",'red','left','bottom',large)); +$graph[0]->lb(new Label(-$alt_x-.3,$alt_y,"F",'red','left','bottom',large)); +$graph[0]->lb(new Label(-$P_x-.1,$P_y+.1,"G",'red','left','bottom',large)); + + +$f0[0] = "($P_y*x)/$P_x for x in <0,$P_x> using color:blue and #weight:2"; +$f1[0] = "(1-x^2)^(1/2) for x in <$small_x,1> using color:blue and weight:2"; +plot_functions( $graph[0], $f0[0], $f1[0]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$point = closed_circle( $P_x, $P_y, black ); +$A_pt = closed_circle( $alt_x, $alt_y, red ); +$B_pt = closed_circle( $alt_x, -$alt_y, red ); +$C_pt = closed_circle( $P_x, -$P_y, red ); +$D_pt = closed_circle( -$P_x, -$P_y, red ); +$E_pt = closed_circle( -$alt_x, -$alt_y, red ); +$F_pt = closed_circle( -$alt_x, $alt_y, red ); +$G_pt = closed_circle( -$P_x, $P_y, red ); + +$graph[0] -> stamps($point, $A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt); + +$angle[0] = "\displaystyle \frac{ \pi}{2} - \theta"; +$angle[1] = "\displaystyle \theta - \frac{ \pi}{2}"; +$angle[2] = "\displaystyle 2 \pi - \theta"; +$angle[3] = "\displaystyle \pi + \theta"; +$angle[4] = "\displaystyle \frac{3 \pi}{2} - \theta"; +$angle[5] = "\displaystyle \frac{ \pi}{2} + \theta"; +$angle[6] = "\displaystyle \pi - \theta"; + +@letters = ("A","B","C","D","E","F","G"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +@exp = (); +$exp[0] = "\displaystyle \text{because starting at } 90^{\circ}\text{, going backward by }\theta \text{ degrees, we would land at point }$letters[0]"; +$exp[1] = "\displaystyle \text{because starting at } \text{P, going backward by }90^{\circ} \text{ we would land at point }$letters[1]"; +$exp[2] = "\displaystyle \text{because starting at } 360^{\circ}\text{, going backward by }\theta \text{ degrees, we would land at point }$letters[2]"; +$exp[3] = "\displaystyle \text{because starting at } 180^{\circ}\text{, going forward by }\theta \text{ degrees, we would land at point }$letters[3]"; +$exp[4] = "\displaystyle \text{because starting at } 270^{\circ}\text{, going backward by }\theta \text{ degrees, we would land at point }$letters[4]"; +$exp[5] = "\displaystyle \text{because starting at } 90^{\circ}\text{, going forward by }\theta \text{ degrees, we would land at point }$letters[5]"; +$exp[6] = "\displaystyle \text{because starting at } 180^{\circ}\text{, going backward by }\theta \text{ degrees, we would land at point }$letters[6]"; + +$alt = "This is the graph of a unit circle, with Point A on the circle at a position close to 30 degrees, Point B close to -30 degrees, Point C close to -60 degrees, Point D close to -120 degrees, Point E close to -150 degrees, Point F close to 150 degrees, Point G close to 120 degrees, Point P close to 60 degrees. Point P corresponds to angle theta."; + +$fig = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Consider the angle \( \theta \), which is labeled as theta in blue on the graph, with corresponding point \(P\) on the circle. ". +$BR. +$BR. +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","P"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","P"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","P"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","P"]) ). +endtable(), +$fig. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 0; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + + + +(a) [$ans[0]] [`[$exp[$perm[0]]]`] + +(b) [$ans[1]] [`[$exp[$perm[1]]]`] + +(c) [$ans[2]] [`[$exp[$perm[2]]]`] + +(d) [$ans[3]] [`[$exp[$perm[3]]]`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation20.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation20.pg new file mode 100644 index 0000000000..4c9f929251 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation20.pg @@ -0,0 +1,172 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$P_x = 5*cos(pi/3); +$P_y = 5*sin(pi/3); +$small_x = cos(pi/3); +$alt_x = 5*cos(pi/2 - $theta); +$alt_y = 5*sin(pi/2 - $theta); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + + +$A_pt = closed_circle( $alt_x, $alt_y, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( -$P_x ,$P_y, red ); +$D_pt = closed_circle( -$alt_x, $alt_y, red ); +$E_pt = closed_circle( -$alt_x ,-$alt_y, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( $P_x, -$P_y, red ); +$H_pt = closed_circle( $alt_x, -$alt_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +$angle[0] = "\displaystyle \frac{\pi}{6}"; +$angle[1] = "\displaystyle \frac{\pi}{3}"; +$angle[2] = "\displaystyle \frac{2\pi}{3}"; +$angle[3] = "\displaystyle \frac{5\pi}{6}"; +$angle[4] = "\displaystyle \frac{7\pi}{6}"; +$angle[5] = "\displaystyle \frac{4\pi}{3}"; +$angle[6] = "\displaystyle \frac{5\pi}{3}"; +$angle[7] = "\displaystyle \frac{11\pi}{6}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($alt_x+.1,$alt_y+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1,$P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,$P_y+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.3,$alt_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.4,-$alt_y-.2,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x,-$P_y-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($alt_x+.2,-$alt_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($alt_x-.1,$alt_y-.1,"pi/6",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1,$P_y-.1,"pi/3",'red','right','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,$P_y-.1,"2pi/3",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.3,$alt_y,"5pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.4,-$alt_y+.2,"7pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"4pi/3",'red','left','top',large)); +$graph[1]->lb(new Label($P_x,-$P_y+.5,"5pi/3",'red','right','top',large)); +$graph[1]->lb(new Label($alt_x-.2,-$alt_y+.2,"11pi/6",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 30 degrees, Point B close to 60 degrees, Point C close to 120 degrees, Point D close to 150 degrees, Point E close to 210 degrees, Point F close to 240 degrees, Point G close to 300 degrees, Point H close to 330 degrees."; +$alt[1] = "This is the graph of a unit circle, with A and pi/6 marked at 30 degrees, B and pi/3 at 60 degrees, C and 2pi/3 at 120 degrees, D and 5pi/6 at 150 degrees, E and 7pi/6 at 210 degrees, F and 4pi/3 at 240 degrees, G and 5pi/3 at 300 degrees, H and 11pi/6 at 330 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +(a) [`[$pick[0]]`] at [$ans[0]] + +(b) [`[$pick[1]]`] at [$ans[1]] + +(c) [`[$pick[2]]`] at [$ans[2]] + +(d) [`[$pick[3]]`] at [$ans[3]] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation30.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation30.pg new file mode 100644 index 0000000000..9d703567fc --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation30.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$r = 5; +$P_x = $r*cos(pi/4); +$P_y = $r*sin(pi/4); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + + +$A_pt = closed_circle( $r, 0, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( 0 ,$r, red ); +$D_pt = closed_circle( -$P_x, $P_y, red ); +$E_pt = closed_circle( -$r, 0, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( 0, -$r, red ); +$H_pt = closed_circle( $P_x, -$P_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +$angle[0] = "\displaystyle 0"; +$angle[1] = "\displaystyle \frac{\pi}{4}"; +$angle[2] = "\displaystyle \frac{\pi}{2}"; +$angle[3] = "\displaystyle \frac{3\pi}{4}"; +$angle[4] = "\displaystyle \pi"; +$angle[5] = "\displaystyle \frac{5\pi}{4}"; +$angle[6] = "\displaystyle \frac{3\pi}{2}"; +$angle[7] = "\displaystyle \frac{7\pi}{4}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r+.1, 0+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1, $P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0-.3, $r+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.3, $P_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$r-.4, 0-.4,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0+0.1,-$r-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.2,-$P_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($r-.2, 0-.1,"0",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1, $P_y-.1,"pi/4",'red','right','top',large)); +$graph[1]->lb(new Label(0+.3, $r-.2,"pi/2",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.3, $P_y,"3pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(-$r+.4, 0+.4,"pi",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"5pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(0-0.1,-$r+.2,"3pi/2",'red','right','bottom',large)); +$graph[1]->lb(new Label($P_x-.2,-$P_y+.1,"7pi/4",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 0 degree, Point B close to 45 degrees, Point C close to 90 degrees, Point D close to 135 degrees, Point E close to 180 degrees, Point F close to 225 degrees, Point G close to 270 degrees, Point H close to 315 degrees."; +$alt[1] = "This is the graph of a unit circle, with Point A and 0 marked at 0 degrees, B and pi/4 at 45 degrees, C and pi/2 at 90 degrees, D and 3pi/4 at 135 degrees, E and pi at 180 degrees, F and 5pi/4 at 225 degrees, G and 3pi/2 at 270 degrees, H and 7pi/4 at 315 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +(a) [`[$pick[0]]`] at [$ans[0]] + +(b) [`[$pick[1]]`] at [$ans[1]] + +(c) [`[$pick[2]]`] at [$ans[2]] + +(d) [`[$pick[3]]`] at [$ans[3]] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation40.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation40.pg new file mode 100644 index 0000000000..9036179e49 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation40.pg @@ -0,0 +1,172 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$P_x = 5*cos(pi/3); +$P_y = 5*sin(pi/3); +$small_x = cos(pi/3); +$alt_x = 5*cos(pi/2 - $theta); +$alt_y = 5*sin(pi/2 - $theta); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + + +$A_pt = closed_circle( $alt_x, $alt_y, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( -$P_x ,$P_y, red ); +$D_pt = closed_circle( -$alt_x, $alt_y, red ); +$E_pt = closed_circle( -$alt_x ,-$alt_y, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( $P_x, -$P_y, red ); +$H_pt = closed_circle( $alt_x, -$alt_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +$angle[0] = "\displaystyle -\frac{11\pi}{6}"; +$angle[1] = "\displaystyle -\frac{5\pi}{3}"; +$angle[2] = "\displaystyle -\frac{4\pi}{3}"; +$angle[3] = "\displaystyle -\frac{7\pi}{6}"; +$angle[4] = "\displaystyle -\frac{5\pi}{6}"; +$angle[5] = "\displaystyle -\frac{2\pi}{3}"; +$angle[6] = "\displaystyle -\frac{\pi}{3}"; +$angle[7] = "\displaystyle -\frac{\pi}{6}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($alt_x+.1,$alt_y+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1,$P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,$P_y+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.3,$alt_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.4,-$alt_y-.2,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x,-$P_y-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($alt_x+.2,-$alt_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($alt_x-.1,$alt_y-.1,"-11pi/6",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1,$P_y-.1,"-5pi/3",'red','right','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,$P_y-.1,"-4pi/3",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.3,$alt_y,"-7pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.4,-$alt_y+.2,"-5pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"-2pi/3",'red','left','top',large)); +$graph[1]->lb(new Label($P_x,-$P_y+.5,"-pi/3",'red','right','top',large)); +$graph[1]->lb(new Label($alt_x-.2,-$alt_y+.2,"-pi/6",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 30 degrees, Point B close to 60 degrees, Point C close to 120 degrees, Point D close to 150 degrees, Point E close to 210 degrees, Point F close to 240 degrees, Point G close to 300 degrees, Point H close to 330 degrees."; +$alt[1] = "This is the graph of a unit circle, with A and -11pi/6 marked at 30 degrees, B and -5pi/3 at 60 degrees, C and -4pi/3 at 120 degrees, D and -7pi/6 at 150 degrees, E and -5pi/6 at 210 degrees, F and -2pi/3 at 240 degrees, G and -pi/3 at 300 degrees, H and -pi/6 at 330 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +(a) [`[$pick[0]]`] at [$ans[0]] + +(b) [`[$pick[1]]`] at [$ans[1]] + +(c) [`[$pick[2]]`] at [$ans[2]] + +(d) [`[$pick[3]]`] at [$ans[3]] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation50.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation50.pg new file mode 100644 index 0000000000..cae0140a13 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation50.pg @@ -0,0 +1,170 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$r = 5; +$P_x = $r*cos(pi/4); +$P_y = $r*sin(pi/4); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + + +$A_pt = closed_circle( $r, 0, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( 0 ,$r, red ); +$D_pt = closed_circle( -$P_x, $P_y, red ); +$E_pt = closed_circle( -$r, 0, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( 0, -$r, red ); +$H_pt = closed_circle( $P_x, -$P_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +$angle[0] = "\displaystyle -2\pi"; +$angle[1] = "\displaystyle -\frac{7\pi}{4}"; +$angle[2] = "\displaystyle -\frac{3\pi}{2}"; +$angle[3] = "\displaystyle -\frac{5\pi}{4}"; +$angle[4] = "\displaystyle -\pi"; +$angle[5] = "\displaystyle -\frac{3\pi}{4}"; +$angle[6] = "\displaystyle -\frac{\pi}{2}"; +$angle[7] = "\displaystyle -\frac{\pi}{4}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r+.1, 0+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1, $P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0-.3, $r+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.3, $P_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$r-.4, 0-.4,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0+0.1,-$r-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.2,-$P_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($r-.2, 0-.1,"-2pi",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1, $P_y-.1,"-7pi/4",'red','right','top',large)); +$graph[1]->lb(new Label(0+.3, $r-.2,"-3pi/2",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.3, $P_y,"-5pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(-$r+.4, 0+.4,"-pi",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"-3pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(0-0.1,-$r+.2,"-pi/2",'red','right','bottom',large)); +$graph[1]->lb(new Label($P_x-.2,-$P_y+.1,"-pi/4",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 0 degree, Point B close to 45 degrees, Point C close to 90 degrees, Point D close to 135 degrees, Point E close to 180 degrees, Point F close to 225 degrees, Point G close to 270 degrees, Point H close to 315 degrees."; +$alt[1] = "This is the graph of a unit circle, with Point A and -2pi marked at 0 degrees, B and -7pi/4 at 45 degrees, C and -3pi/2 at 90 degrees, D and -5pi/4 at 135 degrees, E and -pi at 180 degrees, F and -3pi/4 at 225 degrees, G and -pi/2 at 270 degrees, H and -pi/4 at 315 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +(a) [`[$pick[0]]`] at [$ans[0]] + +(b) [`[$pick[1]]`] at [$ans[1]] + +(c) [`[$pick[2]]`] at [$ans[2]] + +(d) [`[$pick[3]]`] at [$ans[3]] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation60.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation60.pg new file mode 100644 index 0000000000..4287f6b13b --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation60.pg @@ -0,0 +1,202 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$P_x = 5*cos(pi/3); +$P_y = 5*sin(pi/3); +$small_x = cos(pi/3); +$alt_x = 5*cos(pi/2 - $theta); +$alt_y = 5*sin(pi/2 - $theta); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + + +$A_pt = closed_circle( $alt_x, $alt_y, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( -$P_x ,$P_y, red ); +$D_pt = closed_circle( -$alt_x, $alt_y, red ); +$E_pt = closed_circle( -$alt_x ,-$alt_y, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( $P_x, -$P_y, red ); +$H_pt = closed_circle( $alt_x, -$alt_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +@refAngles = ( + "\frac{\pi}{6}", + "\frac{\pi}{3}", + "\frac{2\pi}{3}", + "\frac{5\pi}{6}", + "\frac{7\pi}{6}", + "\frac{4\pi}{3}", + "\frac{5\pi}{3}", + "\frac{11\pi}{6}", +); + +@round = (); +@numerator = (); + +@in = (-5,-4,-3,-2,-1,1,2,3,4,5); +for my $i (0..7) { + $round[$i] = splice(@in, random(0,$#in,1), 1); +} + +$numerator[0] = 1+6*2*$round[0]; +$numerator[1] = 1+3*2*$round[1]; +$numerator[2] = 2+3*2*$round[2]; +$numerator[3] = 5+6*2*$round[3]; +$numerator[4] = 7+6*2*$round[4]; +$numerator[5] = 4+3*2*$round[5]; +$numerator[6] = 5+3*2*$round[6]; +$numerator[7] = 11+6*2*$round[7]; + +$angle[0] = "\displaystyle \frac{$numerator[0]\pi}{6}"; +$angle[1] = "\displaystyle \frac{$numerator[1]\pi}{3}"; +$angle[2] = "\displaystyle \frac{$numerator[2]\pi}{3}"; +$angle[3] = "\displaystyle \frac{$numerator[3]\pi}{6}"; +$angle[4] = "\displaystyle \frac{$numerator[4]\pi}{6}"; +$angle[5] = "\displaystyle \frac{$numerator[5]\pi}{3}"; +$angle[6] = "\displaystyle \frac{$numerator[6]\pi}{3}"; +$angle[7] = "\displaystyle \frac{$numerator[7]\pi}{6}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for my $i (0..3) { $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($alt_x+.1,$alt_y+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1,$P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,$P_y+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.3,$alt_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$alt_x-.4,-$alt_y-.2,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x,-$P_y-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($alt_x+.2,-$alt_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($alt_x-.1,$alt_y-.1,"pi/6",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1,$P_y-.1,"pi/3",'red','right','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,$P_y-.1,"2pi/3",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.3,$alt_y,"5pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$alt_x+.4,-$alt_y+.2,"7pi/6",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"4pi/3",'red','left','top',large)); +$graph[1]->lb(new Label($P_x,-$P_y+.5,"5pi/3",'red','right','top',large)); +$graph[1]->lb(new Label($alt_x-.2,-$alt_y+.2,"11pi/6",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 30 degrees, Point B close to 60 degrees, Point C close to 120 degrees, Point D close to 150 degrees, Point E close to 210 degrees, Point F close to 240 degrees, Point G close to 300 degrees, Point H close to 330 degrees."; +$alt[1] = "This is the graph of a unit circle, with A and pi/6 marked at 30 degrees, B and pi/3 at 60 degrees, C and 2pi/3 at 120 degrees, D and 5pi/6 at 150 degrees, E and 7pi/6 at 210 degrees, F and 4pi/3 at 240 degrees, G and 5pi/3 at 300 degrees, H and 11pi/6 at 330 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +If an angle increases or decreases by a multiple of [`2\pi`], the angle's location on the unit circle does not change. + +(a) [`[$pick[0]]`] at [$ans[0]] because [`[$pick[0]]-[$round[$perm[0]]]\cdot2\pi = [$refAngles[$perm[0]]] `] + +(b) [`[$pick[1]]`] at [$ans[1]] because [`[$pick[1]]-[$round[$perm[1]]]\cdot2\pi = [$refAngles[$perm[1]]] `] + +(c) [`[$pick[2]]`] at [$ans[2]] because [`[$pick[2]]-[$round[$perm[2]]]\cdot2\pi = [$refAngles[$perm[2]]] `] + +(d) [`[$pick[3]]`] at [$ans[3]] because [`[$pick[3]]-[$round[$perm[3]]]\cdot2\pi = [$refAngles[$perm[3]]] `] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation70.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation70.pg new file mode 100644 index 0000000000..f631d75f01 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation70.pg @@ -0,0 +1,199 @@ +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Angle Values +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +# we graph the function x^2 + y^2 = 5^2 and plot P at (3,4) +$theta = pi/3; +$r = 5; +$P_x = $r*cos(pi/4); +$P_y = $r*sin(pi/4); + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return 5*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return 5*sin($t); }; +for my $i (0..1) { + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); +} + +$A_pt = closed_circle( $r, 0, red ); +$B_pt = closed_circle( $P_x, $P_y, red ); +$C_pt = closed_circle( 0 ,$r, red ); +$D_pt = closed_circle( -$P_x, $P_y, red ); +$E_pt = closed_circle( -$r, 0, red ); +$F_pt = closed_circle( -$P_x, -$P_y, red ); +$G_pt = closed_circle( 0, -$r, red ); +$H_pt = closed_circle( $P_x, -$P_y, red ); + +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); +$graph[1] -> stamps($A_pt, $B_pt, $C_pt, $D_pt, $E_pt, $F_pt, $G_pt, $H_pt); + +@refAngles = ( + "0", + "\frac{\pi}{4}", + "\frac{\pi}{2}", + "\frac{3\pi}{4}", + "\pi", + "\frac{5\pi}{4}", + "\frac{3\pi}{2}", + "\frac{7\pi}{4}", +); + +@round = (); +@numerator = (); + +@in = (-5,-4,-3,-2,-1,1,2,3,4,5); +for my $i (0..7) { + $round[$i] = splice(@in, random(0,$#in,1), 1); +} + +$numerator[0] = 0+1*2*$round[0]; +$numerator[1] = 1+4*2*$round[1]; +$numerator[2] = 1+2*2*$round[2]; +$numerator[3] = 3+4*2*$round[3]; +$numerator[4] = 1+1*2*$round[4]; +$numerator[5] = 5+4*2*$round[5]; +$numerator[6] = 3+2*2*$round[6]; +$numerator[7] = 7+4*2*$round[7]; + +$angle[0] = "\displaystyle $numerator[0]\pi"; +$angle[1] = "\displaystyle \frac{$numerator[1]\pi}{4}"; +$angle[2] = "\displaystyle \frac{$numerator[2]\pi}{2}"; +$angle[3] = "\displaystyle \frac{$numerator[3]\pi}{4}"; +$angle[4] = "\displaystyle $numerator[4]\pi"; +$angle[5] = "\displaystyle \frac{$numerator[5]\pi}{4}"; +$angle[6] = "\displaystyle \frac{$numerator[6]\pi}{2}"; +$angle[7] = "\displaystyle \frac{$numerator[7]\pi}{4}"; + +@letters = ("A","B","C","D","E","F","G","H"); +@perm = NchooseK(7,4); +@pick = @angle[@perm]; +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $letters[$perm[$i]] }; + +for my $i (0..1) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r+.1, 0+.1,"A",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.1, $P_y+.1,"B",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0-.3, $r+.1,"C",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.3, $P_y,"D",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$r-.4, 0-.4,"E",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$P_x-.1,-$P_y-.5,"F",'red','left','bottom',large)); + $graph[$i]->lb(new Label(0+0.1,-$r-.5,"G",'red','left','bottom',large)); + $graph[$i]->lb(new Label($P_x+.2,-$P_y-.2,"H",'red','left','bottom',large)); +} + +$graph[1]->lb(new Label($r-.2, 0-.1,"0",'red','right','top',large)); +$graph[1]->lb(new Label($P_x-.1, $P_y-.1,"pi/4",'red','right','top',large)); +$graph[1]->lb(new Label(0+.3, $r-.2,"pi/2",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.3, $P_y,"3pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(-$r+.4, 0+.4,"pi",'red','left','top',large)); +$graph[1]->lb(new Label(-$P_x+.1,-$P_y+.5,"5pi/4",'red','left','top',large)); +$graph[1]->lb(new Label(0-0.1,-$r+.2,"3pi/2",'red','right','bottom',large)); +$graph[1]->lb(new Label($P_x-.2,-$P_y+.1,"7pi/4",'red','right','bottom',large)); + +$alt[0] = "This is the graph of a unit circle, with Point A on the circle at a position close to 0 degree, Point B close to 45 degrees, Point C close to 90 degrees, Point D close to 135 degrees, Point E close to 180 degrees, Point F close to 225 degrees, Point G close to 270 degrees, Point H close to 315 degrees."; +$alt[1] = "This is the graph of a unit circle, with Point A and 0 marked at 0 degrees, B and pi/4 at 45 degrees, C and pi/2 at 90 degrees, D and 3pi/4 at 135 degrees, E and pi at 180 degrees, F and 5pi/4 at 225 degrees, G and 3pi/2 at 270 degrees, H and 7pi/4 at 315 degrees."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +Context()->texStrings; +BEGIN_TEXT +\{ +ColumnTable( +"Sketch each of the angles given below, then select the point on the circle that best corresponds to the angle.". +$BR. +$BR. +begintable(2). +row( "Angle", "Point" ). +row( "\( $pick[0] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[1] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[2] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +row( "\( $pick[3] \)" , pop_up_list(["Choose","A","B","C","D","E","F","G","H"]) ). +endtable(), +$fig0. +$BR.$BCENTER."To enlarge, click on graph, then press Ctrl+ or Command+".$ECENTER, +indent => 0, separation => 30, valign => "TOP" +) +\} +END_TEXT +Context()->normalStrings; + +############################################################## + +$showPartialCorrectAnswers = 1; + +install_problem_grader(~~&std_problem_grader); + +ANS(str_cmp( $ans[0] ) ); +ANS(str_cmp( $ans[1] ) ); +ANS(str_cmp( $ans[2] ) ); +ANS(str_cmp( $ans[3] ) ); + +############################################################## + +BEGIN_PGML_SOLUTION + +If an angle increases or decreases by a multiple of [`2\pi`], the angle's location on the unit circle does not change. + +(a) [`[$pick[0]]`] at [$ans[0]] because [`[$pick[0]]-[$round[$perm[0]]]\cdot2\pi = [$refAngles[$perm[0]]] `] + +(b) [`[$pick[1]]`] at [$ans[1]] because [`[$pick[1]]-[$round[$perm[1]]]\cdot2\pi = [$refAngles[$perm[1]]] `] + +(c) [`[$pick[2]]`] at [$ans[2]] because [`[$pick[2]]-[$round[$perm[2]]]\cdot2\pi = [$refAngles[$perm[2]]] `] + +(d) [`[$pick[3]]`] at [$ans[3]] because [`[$pick[3]]-[$round[$perm[3]]]\cdot2\pi = [$refAngles[$perm[3]]] `] + +You should be very familiar with the locations of the following frequently-used values. + +>>[@ $fig1 @]*<< + +>> (Click on graph to enlarge) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation80.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation80.pg new file mode 100644 index 0000000000..86a7a9064a --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation80.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by by John Travis, Mississippi College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserMultiAnswer.pl", + "PGML.pl", + "PGcourse.pl" +); + +# Print problem number and point value (weight) for the problem +TEXT(beginproblem()); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# +# Setup +# +# +Context("Numeric"); + +$angle = random(95,335,10); + +############################################################## +# +# Text +# +# + +$multians = MultiAnswer($angle, $angle,$angle)->with( + singleResult => 0, + allowBlankAnswers=>1, + # checkTypes => 0, + checker => sub { + my ( $correct, $student, $self ) = @_; + my @s = @{$student}; + my @c = @{$correct}; + @history = (); + @ret = (); + foreach (0..$#c){@ret = (@ret,0);} + foreach $i (0..$#c){ + if ( ref($c[$j]) eq ref($s[$i]) && $s[$i] %360 == $c[$i] && $s[$i] != $angle) { + $ret[$i] = 1; + foreach $h (0 .. $#history){ + if(ref($history[$h]) eq ref($s[$i]) && $s[$i] == $history[$h]){ $ret[$i] = 0}; + } + @history = ($s[$i], @history); + } + } + return [@ret]; + } +); + +Context()->operators->undefine("+","-","*","/","^","**"); + +############################################################## + +BEGIN_PGML +Determine three *different* angles which are coterminal with [`[$angle]^{\circ}`]: + +>> +[________]{$multians} = [________]{$multians} = [________]{$multians} +<< + +END_PGML + + +############################################################## + +$angle1 = $angle+360; +$angle2 = $angle-360; +$angle3 = $angle+720; + +BEGIN_PGML_SOLUTION + +Two angles are coterminal if their difference is a multiple of [`360^{\circ}`]. + +A few examples of angles coterminal with [`[$angle]^{\circ}`] are: + + [`` +\begin{aligned} + [$angle]^{\circ}+360^{\circ} &= [$angle1]^{\circ} \\ + [$angle]^{\circ}-360^{\circ} &= [$angle2]^{\circ} \\ + [$angle]^{\circ}+2\cdot360^{\circ} &= [$angle3]^{\circ} \\ +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation90.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation90.pg new file mode 100644 index 0000000000..b1f68c3540 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleBasics/UnitCircleLocation90.pg @@ -0,0 +1,108 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by by John Travis, Mississippi College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +do { + $den0 = list_random(2,3,4,6); + $num0 = random(1,2*$den0-1,1); +} until (gcd($den0,$num0)==1); +$ans0 = Fraction($num0,$den0); +$ans1 = ($ans0-2)->reduce; + +$off = random(2,10,1)*random(-1,1,2); +$frac = ($ans0+2*$off)->reduce; + +$showPartialCorrectAnswers = 1; + +($num0,$den0) = $ans0->value; +($num1,$den1) = $ans1->value; +Context("LimitedRadical"); + +if ($num0==1) { + $ans0 = Formula("pi/$den0"); +} elsif ($num0==-1) { + $ans0 = Formula("-pi/$den0"); +} else { + $ans0 = Formula("$num0*pi/$den0"); +} +if ($num1==1) { + $ans1 = Formula("pi/$den1"); +} elsif ($num1==-1) { + $ans1 = Formula("-pi/$den1"); +} else { + $ans1 = Formula("$num1*pi/$den1"); +} + +############################################## + +BEGIN_PGML + +Find a coterminal angle of [`[$frac]\pi`] in the range of [`[0,2\pi]`]. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + [__________]{$ans0}[`\text{ radians}`] + +Find a coterminal angle of [`[$frac]\pi`] in the range of [`[-2\pi,0]`]. + + [__________]{$ans1}[`\text{ radians}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The difference between coterminal angles must be a multiple of [`2\pi`]. + +We can calculate the coterminal angle of [`[$frac]\pi`] in the range of [`[0,2\pi]`] by: + + [``[$frac]\pi-[$off]\cdot2\pi = [$ans0]``] + +The coterminal angle of [`[$frac]\pi`] in the range of [`[-2\pi,0]`] is: + + [``[$ans0]-2\pi = [$ans1]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas10.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas10.pg new file mode 100644 index 0000000000..d8a74f2048 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas10.pg @@ -0,0 +1,245 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); +do {$in[1] = random(0,3,1);} until ($in[0] != $in[1]); + +@quadrant = (); +$quadrant[0] = random(2,4,1); +do {$quadrant[1] = random(2,4,1);} until ($quadrant[0] != $quadrant[1]); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@Q = (); + +for my $k (0..0) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $Q[$k] = "II"; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..0) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +$sinAns = (2*$trigs[0][0]*$trigs[0][1])->reduce; +$cosAns = (1-2*($trigs[0][0])**2)->reduce; +$tanAns = (2*$trigs[0][2]/(1-($trigs[0][2])**2))->reduce; + + +############################################################## + +BEGIN_PGML + +If it's given that + + [``\tan(\theta)=[$trigs[0][2]]``] and [`\theta\in[$int[0]]`], + +evaluate the following. + +a) [`\sin(2\theta)=`][_____________]{$sinAns} + +a) [`\cos(2\theta)=`][_____________]{$cosAns} + +a) [`\tan(2\theta)=`][_____________]{$tanAns} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = (2*$trigs[0][2])->reduce; +$s2 = (1-($trigs[0][2])**2)->reduce; + +############################################################## + +BEGIN_PGML_SOLUTION + +###Calculating [`\sin(2\theta)`] + +To calculate [`\sin(2\theta)`], we will use the formula + + [`` \sin(2\theta) = 2\sin(\theta)\cos(\theta) ``] + +[`\tan(\theta)`] is given. We need to find the value of [`\sin(\theta)`] and [`\cos(\theta)`]. + +It's given that [`\tan(\theta)=[$trigs[0][2]]`] and [`\theta\in[$int[0]]`]. We can sketch [`\theta`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{\left([$base[0]]\right)^2+\left([$height[0]]\right)^2}=[$hypotenuse[0]]`]. + +We can see [`\sin(\theta)=[$trigs[0][0]]`] and [`\cos(\theta)=[$trigs[0][1]]`]. + +Now we can calculate the value of [`\sin(2\theta)`]: + + [``\begin{aligned} + \sin(2\theta) &= 2\sin(\theta)\cos(\theta) \\ + &= 2\left( [$trigs[0][0]] \right) \left( [$trigs[0][1]] \right) \\ + &= [$sinAns] + \end{aligned}``] + +###Calculating [` \cos(2\theta) `] + +Cosine's double angle formula are 3 forms: + + [``\begin{aligned} + \cos(2\theta) + &= \cos^2(\theta)-\sin^2(\theta) \\ + &= 2\cos^2(\theta) -1 \\ + &= 1- 2\sin^2(\theta) + \end{aligned}``] + +We could use any form since we already know the values of both [`\sin(\theta)`] and [`\cos(\theta)`]. We will choose to use the first form: + + [``\begin{aligned} + \cos(2\theta) &= \cos^2(\theta)-\sin^2(\theta) \\ + &= \left( [$trigs[0][1]] \right)^2 - \left( [$trigs[0][0]] \right)^2 \\ + &= [$cosAns] + \end{aligned}``] + +###Calculating [` \tan(2\theta) `] + +We will use the tangent double-angle formula: + + [``\begin{aligned} + \tan(2\theta) &= \frac{2\tan(\theta)}{1-\tan^2(\theta)} \\ + &= \frac{2\left([$trigs[0][2]]\right)}{1-\left([$trigs[0][2]]\right)^2} \\ + &= \frac{[$s1]}{[$s2]} \\ + &= [$tanAns] + \end{aligned}``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas20.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas20.pg new file mode 100644 index 0000000000..cefdf50241 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas20.pg @@ -0,0 +1,344 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + + + do { + do { + $height0Out = -random(1,3,1); + $height0In = list_random(1,2,3); + $hypotenuse0Out = random(int(abs($height0Out)*$height0In**2)+2,int(abs($height0Out)*$height0In**2)+10,1); + } until (gcd($height0Out,$hypotenuse0Out)==1); + $hypotenuse0In = 1; + ($base0Out,$base0In) = &radSimplify($hypotenuse0Out**2-$height0Out**2*$height0In); + } until (!($base0In==1 && $height0In==1 && $hypotenuse0In==1)) && !(($base0Out>0) && ($height0Out>0)) && ($base0In<=20); + + $base0Out = $base0Out*random(-1,1,2); + if ($base0Out*$height0Out>0) { + $Q0 = ($base0Out>0) ? "I" : "III"; + $int0 = ($base0Out>0) ? "\left(0,\frac{\pi}{2}\right)" : "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + $Q0 = ($base0Out>0) ? "IV" : "II"; + $int0 = ($base0Out>0) ? "\left(\frac{3\pi}{2},2\pi\right)" : "\left(\frac{\pi}{2},\pi\right)"; + } + +Context("LimitedRadical"); + if ($base0In==1) { + $base0 = $base0Out; + $absBase = abs($base0Out); + } elsif (abs($base0Out)==1) { + $base0 = ($base0Out>0) ? Formula("sqrt($base0In)") : Formula("-sqrt($base0In)"); + $absBase = Formula("sqrt($base0In)"); + } else { + $base0 = Formula("$base0Out*sqrt($base0In)"); + $absBase0Out = abs($base0Out); + $absBase0 = Formula("$absBase0Out*sqrt($base0In)"); + } + + if ($height0In==1) { + $height0 = $height0Out; + $absHeight0 = abs($height0Out); + } elsif (abs($height0Out)==1) { + $height0 = ($height0Out>0) ? Formula("sqrt($height0In)") : Formula("-sqrt($height0In)"); + $absHeight0 = Formula("sqrt($height0In)"); + } else { + $height0 = Formula("$height0Out*sqrt($height0In)"); + $absHeight0Out = abs($height0Out); + $absHeight0 = Formula("$absHeight0Out*sqrt($height0In)"); + } + + $hypotenuse0 = $hypotenuse0Out; + + $sine0 = &rationalize($height0Out,$height0In,$hypotenuse0Out,$hypotenuse0In); + $cosine0 = &rationalize($base0Out,$base0In,$hypotenuse0Out,$hypotenuse0In); + $tangent0 = &rationalize($height0Out,$height0In,$base0Out,$base0In); + + @trigs0 = ($sine0,$cosine0,$tangent0); + +Context("Numeric"); + +$r = 5; +$P0x = $r*$base0Out*sqrt($base0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); +$P0y = $r*$height0Out*sqrt($height0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); + +@graph = (); +$graph[0] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $P0x, $P0y, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($P0x,$P0y,red,2); +$graph[0]->lineTo($P0x,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($P0x>0) ? -0.2 : 0.2; +$yShift = ($P0y>0) ? 0.2 : -0.42; +$graph[0]->moveTo($P0x,$yShift); +$graph[0]->lineTo($P0x+$xShift,$yShift,red,2); +$graph[0]->lineTo($P0x+$xShift,0,red,2); + +$LORHeight = ($P0x>0) ? "left" : "right"; +$TOBBase = ($P0y>0) ? "top" : "bottom"; +$LORHyp = ($P0x>0) ? "right" : "left"; +$TOBHyp = ($P0y>0) ? "bottom" : "top"; +$LORShift = ($P0x>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($P0x+$LORShift,$P0y/2,"$height0",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($P0x/2,0,"$base0",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($P0x/2,$P0y/2,"$hypotenuse0",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($P0x,$P0y,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base0,$height0) and ($base0,0). The base is marked as $base0, height marked as $height0 and hypotenuse marked as $hypotenuse0."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + Context("LimitedFraction"); + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + Context("LimitedRadical"); + if (($numIn==0)||($numOut==0)) {return Formula("0");} + if ($d0==1) { + if ($numIn==1) {return Formula("$n0");} + elsif ($n0==1) {return Formula("sqrt($numIn)");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)");} + else {return Formula("$n0*sqrt($numIn)");} + } else { + if ($numIn==1) {return Formula("$n0/$d0");} + elsif ($n0==1) {return Formula("sqrt($numIn)/$d0");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)/$d0");} + else { + $n0N = -$n0; + return ($n0>0) ? Formula("$n0*sqrt($numIn)/$d0") : Formula("-$n0N*sqrt($numIn)/$d0"); + } + } +} + +Context("LimitedRadical"); + +($out1,$in1) = radSimplify($height0In*$base0In); +$n1 = 2*$height0Out*$base0Out*$out1; +$sinAns = createRadical($n1,$in1,$hypotenuse0Out**2); + +$n2 = ($base0Out)**2*$base0In-($height0Out)**2*$height0In; +$d2 = $hypotenuse0Out**2; +Context("LimitedFraction"); +$cosAns = Fraction($n2,$d2)->reduce; + +Context("LimitedRadical"); +$tanAns = createRadical($n1,$in1,$n2); + + +############################################################## + +BEGIN_PGML + +If it's given that + + [``\cos(\theta)=[$trigs0[1]]``] and [`\theta\in[$int0]`], + +evaluate the following. + +[@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** + +a) [`\sin(2\theta)=`][_____________]{$sinAns} + +a) [`\cos(2\theta)=`][_____________]{$cosAns} + +a) [`\tan(2\theta)=`][_____________]{$tanAns} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = rationalize(2*$height0Out,$height0In,$base0Out,$base0In); +Context("Fraction"); +$s2 = (1-Fraction(($height0Out)**2*$height0In,($base0Out)**2*$base0In))->reduce; + +############################################################## + +BEGIN_PGML_SOLUTION + +###Calculating [`\sin(2\theta)`] + +To calculate [`\sin(2\theta)`], we will use the formula + + [`` \sin(2\theta) = 2\sin(\theta)\cos(\theta) ``] + +[`\cos(\theta)`] is given. We need to find the value of [`\sin(\theta)`]. + +It's given that [`\cos(\theta)=[$trigs0[1]]`] and [`\theta\in[$int0]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse0])^2-\left([$base0]\right)^2}=[$absHeight0]`]. + +We can see [`\sin(\theta)=[$trigs0[0]]`] and [`\tan(\theta)=\frac{[$height0]}{[$base0]}=[$trigs0[2]]`]. + +Now we can calculate the value of [`\sin(2\theta)`]: + + [``\begin{aligned} + \sin(2\theta) &= 2\sin(\theta)\cos(\theta) \\ + &= 2\left( [$trigs0[0]] \right) \left( [$trigs0[1]] \right) \\ + &= [$sinAns] + \end{aligned}``] + +###Calculating [` \cos(2\theta) `] + +Cosine's double angle formula are 3 forms: + + [``\begin{aligned} + \cos(2\theta) + &= \cos^2(\theta)-\sin^2(\theta) \\ + &= 2\cos^2(\theta) -1 \\ + &= 1- 2\sin^2(\theta) + \end{aligned}``] + +We could use any form since we already know the values of both [`\sin(\theta)`] and [`\cos(\theta)`]. We will choose to use the first form: + + [``\begin{aligned} + \cos(2\theta) &= \cos^2(\theta)-\sin^2(\theta) \\ + &= \left( [$trigs0[1]] \right)^2 - \left( [$trigs0[0]] \right)^2 \\ + &= [$cosAns] + \end{aligned}``] + +###Calculating [` \tan(2\theta) `] + +We will use the tangent double-angle formula: + + [``\begin{aligned} + \tan(2\theta) &= \frac{2\tan(\theta)}{1-\tan^2(\theta)} \\ + &= \frac{2\left([$trigs0[2]]\right)}{1-\left([$trigs0[2]]\right)^2} \\ + &= \frac{[$s1]}{[$s2]} \\ + &= [$tanAns] + \end{aligned}``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas30.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas30.pg new file mode 100644 index 0000000000..9690f1f7b8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleFormulas30.pg @@ -0,0 +1,216 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); +do {$in[1] = random(0,3,1);} until ($in[0] != $in[1]); + +@quadrant = (); +$quadrant[0] = random(2,4,1); +do {$quadrant[1] = random(2,4,1);} until ($quadrant[0] != $quadrant[1]); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@Q = (); + +for my $k (0..0) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $Q[$k] = "II"; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], +); + +$sinAns = (2*$trigs[0][0]*$trigs[0][1])->reduce; +$cosAns = (1-2*($trigs[0][0])**2)->reduce; +$tanAns = (2*$trigs[0][2]/(1-($trigs[0][2])**2))->reduce; + +############################################################## + +BEGIN_PGML + +If it's given that + + [``\cos(2\theta)=[$cosAns]``] and [`\theta\in[$int[0]]`], + +evaluate the following. + +a) [`\sin(\theta)=`][_____________]{$trigs[0][0]} + +a) [`\cos(\theta)=`][_____________]{$trigs[0][1]} + +a) [`\tan(\theta)=`][_____________]{$trigs[0][2]} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$absSin = abs($trigs[0][0]); +$absCos = abs($trigs[0][1]); +$absCos2 = abs($cosAns); + +($n0,$d0) = $cosAns->value; +($n1,$d1) = $absCos2->value; + +if ($cosAns>0) { + $s1 = "1-\frac{$n0}{$d0}"; + $s2 = "$d0-$n0"; +} else { + $s1 = "1+\frac{$n1}{$d1}"; + $n0N = -$n0; + $s2 = "$d0+$n0N"; +} +$s3 = $d0-$n0; +$s4 = Fraction($d0-$n0,2*$d0)->reduce; +$pnSin = ($trigs[0][0]>0) ? 'positive' : 'negative'; + +$s5 = Fraction($d0+$n0,2*$d0)->reduce; +$pnCos = ($trigs[0][1]>0) ? 'positive' : 'negative'; + + +############################################################## + +BEGIN_PGML_SOLUTION + +###Calculating [`\sin(\theta)`] + +To calculate [`\sin(\theta)`], we will use the formula + + [`` \cos(2\theta) = 1-2\sin^2(\theta) ``] + +We have: + + [``\begin{aligned} + \cos(2\theta) &= 1-2\sin^2(\theta) \\ + \cos(2\theta) &= 1-2\sin^2(\theta) \\ + \cos(2\theta) -1 &= -2\sin^2(\theta) \\ + 1-\cos(2\theta) &= 2\sin^2(\theta) \\ + \frac{1-\cos(2\theta)}{2} &= \sin^2(\theta) \\ + \sin(\theta) &= \pm\sqrt{ \frac{1-\cos(2\theta)}{2} } \\ + \sin(\theta) &= \pm\sqrt{ \frac{1-\left([$cosAns]\right)}{2} } \\ + \sin(\theta) &= \pm\sqrt{ \frac{\left([$s1]\right)\cdot[$d0]}{2\cdot[$d0]} } \\ + \sin(\theta) &= \pm\sqrt{ \frac{[$s2]}{[$d0*2]} } \\ + \sin(\theta) &= \pm\sqrt{ \frac{[$s3]}{[$d0*2]} } \\ + \sin(\theta) &= \pm\sqrt{ [$s4] } \\ + \sin(\theta) &= \pm[$absSin] + \end{aligned}``] + +It's given that [`\theta\in[$int[0]]`], so [`\sin(\theta)`] is [$pnSin], implying [`\sin(\theta)=[$trigs[0][0]]`]. + +###Calculating [` \cos(\theta) `] + +To calculate [`\cos(\theta)`], we will use the formula + + [`` \cos(2\theta) = 2\cos^2(\theta)-1 ``] + +We have: + + [``\begin{aligned} + \cos(2\theta) &= 2\cos^2(\theta)-1 \\ + \cos(2\theta) +1 &= 2\cos^2(\theta) \\ + \frac{\cos(2\theta)+1}{2} &= \cos^2(\theta) \\ + \cos(\theta) &= \pm\sqrt{ \frac{\cos(2\theta)+1}{2} } \\ + \cos(\theta) &= \pm\sqrt{ \frac{[$cosAns]+1}{2} } \\ + \cos(\theta) &= \pm\sqrt{ \frac{\left([$cosAns]+1\right)\cdot[$d0]}{2\cdot[$d0]} } \\ + \cos(\theta) &= \pm\sqrt{ \frac{[$n0]+[$d0]}{[$d0*2]} } \\ + \cos(\theta) &= \pm\sqrt{ \frac{[$n0+$d0]}{[$d0*2]} } \\ + \cos(\theta) &= \pm\sqrt{ [$s5] } \\ + \cos(\theta) &= \pm[$absCos] + \end{aligned}``] + +It's given that [`\theta\in[$int[0]]`], so [`\cos(\theta)`] is [$pnCos], implying [`\cos(\theta)=[$trigs[0][1]]`]. + +###Calculating [` \tan(\theta) `] + +To calculate [`\tan(\theta)`], we will use the formula + + [`` \tan(\theta) = \frac{\sin(\theta)}{\cos(\theta)} ``] + +We have: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} \\ + \tan(\theta) &= \frac{[$trigs[0][0]]}{[$trigs[0][1]]} \\ + \tan(\theta) &= \frac{[$trigs[0][0]]\cdot[$hypotenuse[0]]}{[$trigs[0][1]]\cdot[$hypotenuse[0]]} \\ + \tan(\theta) &= [$trigs[0][2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity10.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity10.pg new file mode 100644 index 0000000000..3fcd995079 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity10.pg @@ -0,0 +1,170 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{1-\cos(\theta)}{2} "; +$right = "\displaystyle \sin^2\left(\frac{\theta}{2}\right)"; + +@steps = ( + "\displaystyle \frac{1-\left(1-2\sin^2\left(\frac{\theta}{2}\right)\right)}{2}", + "\displaystyle \frac{1-1+2\sin^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{2\sin^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{1-\left(\cos^2\left(\frac{\theta}{2}\right)-\sin^2\left(\frac{\theta}{2}\right)\right)}{2}", + "\displaystyle \frac{1-\left(2\cos^2\left(\frac{\theta}{2}\right)-1\right)}{2}", + "\displaystyle \frac{2\cos^2\left(\frac{\theta}{2}\right)}{2}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +To relate [`\cos(\theta)`] with [`\sin\left(\frac{\theta}{2}\right)`], we should use cosine's double angle formula: + + [``\begin{aligned} + \cos(2\theta) &= 1-2\sin^2(\theta) \\ + \cos(\theta) &= 1-2\sin^2\left(\frac{\theta}{2}\right) + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$right] + \end{aligned}``] + +One more step, and we will prove sine's half-angle formula: + + [``\begin{aligned} + [$right] &= [$left] \\ + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity20.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity20.pg new file mode 100644 index 0000000000..2e1ea0dfee --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity20.pg @@ -0,0 +1,169 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{1+\cos(\theta)}{2} "; +$right = "\displaystyle \cos^2\left(\frac{\theta}{2}\right)"; + +@steps = ( + "\displaystyle \frac{1+2\cos^2\left(\frac{\theta}{2}\right)-1}{2}", + "\displaystyle \frac{2\cos^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{1+\cos^2\left(\frac{\theta}{2}\right)-\sin^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{1+1-2\sin^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{2\sin^2\left(\frac{\theta}{2}\right)}{2}", + "\displaystyle \frac{1+2\sin^2\left(\frac{\theta}{2}\right)-1}{2}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +To relate [`\cos(\theta)`] with [`\cos\left(\frac{\theta}{2}\right)`], we should use cosine's double angle formula: + + [``\begin{aligned} + \cos(2\theta) &= 2\sin^2(\theta)-1 \\ + \cos(\theta) &= 2\sin^2\left(\frac{\theta}{2}\right) -1 + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$right] + \end{aligned}``] + +One more step, and we will prove sine's half-angle formula: + + [``\begin{aligned} + [$right] &= [$left] \\ + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity30.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity30.pg new file mode 100644 index 0000000000..1e9f2f6966 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/DoubleAngleIdentity30.pg @@ -0,0 +1,175 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{1-\cos(\theta)}{1+\cos(\theta)} "; +$right = "\displaystyle \tan^2\left(\frac{\theta}{2}\right)"; + +@steps = ( + "\displaystyle \frac{1-\left(1-2\sin^2\left(\frac{\theta}{2}\right)\right)}{1+\left(2\cos^2\left(\frac{\theta}{2}\right)-1\right)}", + "\displaystyle \frac{1-1+2\sin^2\left(\frac{\theta}{2}\right)}{1+2\cos^2\left(\frac{\theta}{2}\right)-1}", + "\displaystyle \frac{2\sin^2\left(\frac{\theta}{2}\right)}{2\cos^2\left(\frac{\theta}{2}\right)}", + "\displaystyle \frac{\sin^2\left(\frac{\theta}{2}\right)}{\cos^2\left(\frac{\theta}{2}\right)}", + "\displaystyle \frac{1-\left(2\sin^2\left(\frac{\theta}{2}\right)-1\right)}{1+\left(1-2\cos^2\left(\frac{\theta}{2}\right)\right)}", + "\displaystyle \frac{2\cos^2\left(\frac{\theta}{2}\right)}{2\sin^2\left(\frac{\theta}{2}\right)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Recognize that: + + [``\tan\left(\frac{\theta}{2}\right)=\frac{\sin\left(\frac{\theta}{2}\right)}{\cos\left(\frac{\theta}{2}\right)}``] + +To relate [`\cos(\theta)`] with [`\sin\left(\frac{\theta}{2}\right)`] and [`\cos\left(\frac{\theta}{2}\right)`], we should use cosine's double angle formula: + + [``\begin{aligned} + \sin(\theta) &= 1-2\sin^2\left(\frac{\theta}{2}\right) \\ + \cos(\theta) &= 2\cos^2\left(\frac{\theta}{2}-1\right) + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$right] + \end{aligned}``] + +One more step, and we will prove sine's half-angle formula: + + [``\begin{aligned} + [$right] &= [$left] \\ + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas10.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas10.pg new file mode 100644 index 0000000000..cad7165df8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas10.pg @@ -0,0 +1,338 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + $a = 2*$a; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,360)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +Context("LimitedRadical"); +%a2 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 30 => [ + ["\frac{1}{2}", 1, 1, 2], + ["\frac{\sqrt{3}}{2}", 1, 3, 2], + ["\frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 150 => [ + ["\frac{1}{2}", 1, 1, 2], + ["-\frac{\sqrt{3}}{2}", -1, 3, 2], + ["-\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 210 => [ + ["-\frac{1}{2}", -1, 1, 2], + ["-\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 330 => [ + ["-\frac{1}{2}", -1, 1, 2], + ["\frac{\sqrt{3}}{2}", 1, 3, 2], + ["-\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 45 => [ + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["1", 1, 1, 1], + ], + 135 => [ + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["-1", -1, 1, 1], + ], + 225 => [ + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["1", 1, 1, 1], + ], + 315 => [ + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["-1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%aShow = ( + 15 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(7-4*sqrt(3))")], + 75 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(7+4*sqrt(3))")], + 105 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("-sqrt(2-sqrt(3))/2"), + Formula("-sqrt(7+4*sqrt(3))")], + 165 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("-sqrt(2+sqrt(3))/2"), + Formula("-sqrt(7-4*sqrt(3))")], + 22.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("(sqrt{2+sqrt(2)})/2"), + Formula("sqrt(3-2*sqrt(2))")], + 67.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("(sqrt{2-sqrt(2)})/2"), + Formula("sqrt(3+2*sqrt(2))")], + 112.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("-(sqrt{2-sqrt(2)})/2"), + Formula("-sqrt(3+2*sqrt(2))")], + 157.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("-(sqrt{2+sqrt(2)})/2"), + Formula("-sqrt(3-2*sqrt(2))")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%a = ( + 15 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(7-4*sqrt(3))")], + 75 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(7+4*sqrt(3))")], + 105 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("-sqrt(2-sqrt(3))/2"), + Formula("-sqrt(7+4*sqrt(3))")], + 165 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("-sqrt(2+sqrt(3))/2"), + Formula("-sqrt(7-4*sqrt(3))")], + 22.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("(sqrt{2+sqrt(2)})/2"), + Formula("sqrt(3-2*sqrt(2))")], + 67.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("(sqrt{2-sqrt(2)})/2"), + Formula("sqrt(3+2*sqrt(2))")], + 112.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("-(sqrt{2-sqrt(2)})/2"), + Formula("-sqrt(3+2*sqrt(2))")], + 157.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("-(sqrt{2+sqrt(2)})/2"), + Formula("-sqrt(3-2*sqrt(2))")], +); + + +$angle = list_random(15, 75, 105, 165, 22.5, 67.5, 112.5, 157.5); +$angle2 = 2*$angle; +$angleR = &angleToRadian($angle); +$angle2R = &angleToRadian($angle2); + +sub quadrant { + my $a = shift; + if ($a<90) {return "I";} + elsif ($a<180) {return "II";} + elsif ($a<270) {return "III";} + else {return "IV";} +} +$Q = quadrant($angle); +$pnSine = ($a{$angle}[0]>0) ? "positive" : "negative"; +$pnCosine = ($a{$angle}[1]>0) ? "positive" : "negative"; +$pnTangent = ($a{$angle}[2]>0) ? "positive" : "negative"; + +############################################## + +BEGIN_PGML + +Without using a calculator, use half-angle formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$angleR]\right) = ``][_________]{$a{$angle}[0]->cmp(correct_ans_latex_string=>($aShow{$angle}[0]->TeX))} + + [`` \cos\left([$angleR]\right) = ``][_________]{$a{$angle}[1]->cmp(correct_ans_latex_string=>($aShow{$angle}[1]->TeX))} + + [`` \tan\left([$angleR]\right) = ``][_________]{$a{$angle}[2]->cmp(correct_ans_latex_string=>($aShow{$angle}[2]->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("LimitedRadical"); +if ($a2{$angle2}[1][1]>0) { + $s1 = "1-$a2{$angle2}[1][0]"; + $s2 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; +} else { + my $z0 = &createRadical(-$a2{$angle2}[1][1],$a2{$angle2}[1][2],$a2{$angle2}[1][3]); + $s1 = "1+$z0"; + $s2 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; +} + +$den = ($a2{$angle2}[1][3])**2-$a2{$angle2}[1][2]; +$z1 = ($a2{$angle2}[1][3])**2+$a2{$angle2}[1][2]; +$z2 = 2*$a2{$angle2}[1][3]; +$z3 = $z1/$den; +$z4 = $z2/$den; +if ($a2{$angle2}[1][1]>0) { + $s3 = "1+$a2{$angle2}[1][0]"; + $s4 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; + $s5 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; + $s6 = "$z1-$z2\sqrt{$a2{$angle2}[1][2]}"; + $s7 = "$z3-$z4\sqrt{$a2{$angle2}[1][2]}"; +} else { + $s3 = "1$a2{$angle2}[1][0]"; + $s4 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; + $s5 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; + $s6 = "$z1+$z2\sqrt{$a2{$angle2}[1][2]}"; + $s7 = "$z3+$z4\sqrt{$a2{$angle2}[1][2]}"; +} + + + +############################################## + +BEGIN_PGML_SOLUTION + +Recognize that: + + [`` [$angleR] \text{ radians}= [$angle]^{\circ} = \frac{[$angle2]^{\circ}}{2} ``], + +and [`[$angle2]^{\circ}`] is a special angle on the Unit Circle. We have: + + [`` [$angle2R] = 2\cdot[$angleR] ``]. + +We will use half-angle formulas: + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \sin\left([$angleR]\right) + &= \pm\sqrt{\frac{1-\cos\left([$angle2R]\right)}{2}} \\ + &= \pm\sqrt{\frac{1-\left([$a2{$angle2}[1][0]]\right)}{2}} \\ + &= \pm\sqrt{\frac{\left([$s1]\right)\cdot[$a2{$angle2}[1][3]]}{2\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\frac{\sqrt{[$s2]}}{2} \\ + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\sin\left([$angleR]\right)`] is [$pnSine], so [`\sin\left([$angleR]\right)=[$aShow{$angle}[0]] `]. + +###Problem 2 + + [``\begin{aligned} + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \cos\left([$angleR]\right) + &= \pm\sqrt{\frac{1+\cos\left([$angle2R]\right)}{2}} \\ + &= \pm\sqrt{\frac{1+\left([$a2{$angle2}[1][0]]\right)}{2}} \\ + &= \pm\sqrt{\frac{\left([$s3]\right)\cdot[$a2{$angle2}[1][3]]}{2\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\frac{\sqrt{[$s4]}}{2} \\ + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\cos\left([$angleR]\right)`] is [$pnCosine], so [`\cos\left([$angleR]\right)=[$aShow{$angle}[1]] `]. + +###Problem 3 + + [``\begin{aligned} + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \tan\left([$angleR]\right) + &= \pm\sqrt{\frac{1-\cos\left([$angle2R]\right)}{1+\cos\left([$angle2R]\right)}} \\ + &= \pm\sqrt{\frac{1-\left([$a2{$angle2}[1][0]]\right)}{1+\left([$a2{$angle2}[1][0]]\right)}} \\ + &= \pm\sqrt{\frac{\left([$s1]\right)\cdot[$a2{$angle2}[1][3]]}{\left([$s3]\right)\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\sqrt{\frac{[$s2]}{[$s4]}} \\ + &= \pm\sqrt{\frac{\left([$s2]\right)\cdot\left([$s5]\right)}{\left([$s4]\right)\cdot\left([$s5]\right)}} \\ + &= \pm\sqrt{\frac{[$s6]}{[$den]}} \\ + &= \pm\sqrt{[$s7]} + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\tan\left([$angleR]\right)`] is [$pnTangent], so [`\tan\left([$angleR]\right)=[$aShow{$angle}[2]] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas20.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas20.pg new file mode 100644 index 0000000000..c4028a9072 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas20.pg @@ -0,0 +1,391 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + $a = 2*$a; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,360)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +Context("LimitedRadical"); +%a2 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 30 => [ + ["\frac{1}{2}", 1, 1, 2], + ["\frac{\sqrt{3}}{2}", 1, 3, 2], + ["\frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 150 => [ + ["\frac{1}{2}", 1, 1, 2], + ["-\frac{\sqrt{3}}{2}", -1, 3, 2], + ["-\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 210 => [ + ["-\frac{1}{2}", -1, 1, 2], + ["-\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 330 => [ + ["-\frac{1}{2}", -1, 1, 2], + ["\frac{\sqrt{3}}{2}", 1, 3, 2], + ["-\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 45 => [ + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["1", 1, 1, 1], + ], + 135 => [ + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["-1", -1, 1, 1], + ], + 225 => [ + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["1", 1, 1, 1], + ], + 315 => [ + ["-\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\frac{\sqrt{2}}{2}", 1, 2, 2], + ["-1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%aShow = ( + 15 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(7-4*sqrt(3))")], + 75 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(7+4*sqrt(3))")], + 105 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("-sqrt(2-sqrt(3))/2"), + Formula("-sqrt(7+4*sqrt(3))")], + 165 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("-sqrt(2+sqrt(3))/2"), + Formula("-sqrt(7-4*sqrt(3))")], + 22.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("(sqrt{2+sqrt(2)})/2"), + Formula("sqrt(3-2*sqrt(2))")], + 67.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("(sqrt{2-sqrt(2)})/2"), + Formula("sqrt(3+2*sqrt(2))")], + 112.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("-(sqrt{2-sqrt(2)})/2"), + Formula("-sqrt(3+2*sqrt(2))")], + 157.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("-(sqrt{2+sqrt(2)})/2"), + Formula("-sqrt(3-2*sqrt(2))")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%a = ( + 15 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(7-4*sqrt(3))")], + 75 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("sqrt(2-sqrt(3))/2"), + Formula("sqrt(7+4*sqrt(3))")], + 105 => [Formula("sqrt(2+sqrt(3))/2"), + Formula("-sqrt(2-sqrt(3))/2"), + Formula("-sqrt(7+4*sqrt(3))")], + 165 => [Formula("sqrt(2-sqrt(3))/2"), + Formula("-sqrt(2+sqrt(3))/2"), + Formula("-sqrt(7-4*sqrt(3))")], + 22.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("(sqrt{2+sqrt(2)})/2"), + Formula("sqrt(3-2*sqrt(2))")], + 67.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("(sqrt{2-sqrt(2)})/2"), + Formula("sqrt(3+2*sqrt(2))")], + 112.5 => [Formula("(sqrt{2+sqrt(2)})/2"), + Formula("-(sqrt{2-sqrt(2)})/2"), + Formula("-sqrt(3+2*sqrt(2))")], + 157.5 => [Formula("(sqrt{2-sqrt(2)})/2"), + Formula("-(sqrt{2+sqrt(2)})/2"), + Formula("-sqrt(3-2*sqrt(2))")], +); + + +$angle = list_random(15, 75, 105, 165, 22.5, 67.5, 112.5, 157.5); +$angle2 = 2*$angle; +$angleR = &angleToRadian($angle); +$angle2R = &angleToRadian($angle2); + +sub quadrant { + my $a = shift; + if ($a<90) {return "I";} + elsif ($a<180) {return "II";} + elsif ($a<270) {return "III";} + else {return "IV";} +} +$Q = quadrant($angle); +$pnSine = ($a{$angle}[0]>0) ? "positive" : "negative"; +$pnCosine = ($a{$angle}[1]>0) ? "positive" : "negative"; +$pnTangent = ($a{$angle}[2]>0) ? "positive" : "negative"; + +$angleN = -$angle; +$angleRN = &angleToRadian($angleN); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +$ans0 = -$a{$angle}[0]; +$ans1 = $a{$angle}[1]; +$ans2 = -$a{$angle}[2]; + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub makeNeg { + Context("LimitedRadical"); + Context()->noreduce('(-x)-y'); + Context()->noreduce('(-x)-y','(-x)+y'); + + my $st = shift->{string}; + if (substr($st,0,1) eq '-') { + my $r = substr($st,1); + return Formula("$r"); + } else { + return Formula("-$st"); + } +} + +$ans0Show = makeNeg($aShow{$angle}[0]); +$ans1Show = $aShow{$angle}[1]; +$ans2Show = makeNeg($aShow{$angle}[2]); + + +############################################## + +BEGIN_PGML + +Without using a calculator, use half-angle formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$angleRN]\right) = ``][_________]{$ans0->cmp(correct_ans_latex_string=>($ans0Show->TeX))} + + [`` \cos\left([$angleRN]\right) = ``][_________]{$ans1->cmp(correct_ans_latex_string=>($ans1Show->TeX))} + + [`` \tan\left([$angleRN]\right) = ``][_________]{$ans2->cmp(correct_ans_latex_string=>($ans2Show->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +Context("LimitedRadical"); +if ($a2{$angle2}[1][1]>0) { + $s1 = "1-$a2{$angle2}[1][0]"; + $s2 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; +} else { + my $z0 = &createRadical(-$a2{$angle2}[1][1],$a2{$angle2}[1][2],$a2{$angle2}[1][3]); + $s1 = "1+$z0"; + $s2 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; +} + +$den = ($a2{$angle2}[1][3])**2-$a2{$angle2}[1][2]; +$z1 = ($a2{$angle2}[1][3])**2+$a2{$angle2}[1][2]; +$z2 = 2*$a2{$angle2}[1][3]; +$z3 = $z1/$den; +$z4 = $z2/$den; +if ($a2{$angle2}[1][1]>0) { + $s3 = "1+$a2{$angle2}[1][0]"; + $s4 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; + $s5 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; + $s6 = "$z1-$z2\sqrt{$a2{$angle2}[1][2]}"; + $s7 = "$z3-$z4\sqrt{$a2{$angle2}[1][2]}"; +} else { + $s3 = "1$a2{$angle2}[1][0]"; + $s4 = "$a2{$angle2}[1][3]-\sqrt{$a2{$angle2}[1][2]}"; + $s5 = "$a2{$angle2}[1][3]+\sqrt{$a2{$angle2}[1][2]}"; + $s6 = "$z1+$z2\sqrt{$a2{$angle2}[1][2]}"; + $s7 = "$z3+$z4\sqrt{$a2{$angle2}[1][2]}"; +} + + + +############################################## + +BEGIN_PGML_SOLUTION + +When we evaluate the trigonometry value of a negative angle, we can evaluate the value of the corresponding positive angle, and then use the following properties: + + [``\begin{aligned} + \sin(-\theta) &= -\sin(\theta) \\ + \cos(-\theta) &= \cos(\theta) \\ + \tan(-\theta) &= -\tan(\theta) \\ + \end{aligned}``] + +Recognize that: + + [`` [$angleR] \text{ radians}= [$angle]^{\circ} = \frac{[$angle2]^{\circ}}{2} ``], + +and [`[$angle2]^{\circ}`] is a special angle on the Unit Circle. We have: + + [`` [$angle2R] = 2\cdot[$angleR] ``]. + +We will use half-angle formulas: + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{2}} \\ + \sin\left([$angleR]\right) + &= \pm\sqrt{\frac{1-\cos\left([$angle2R]\right)}{2}} \\ + &= \pm\sqrt{\frac{1-\left([$a2{$angle2}[1][0]]\right)}{2}} \\ + &= \pm\sqrt{\frac{\left([$s1]\right)\cdot[$a2{$angle2}[1][3]]}{2\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\frac{\sqrt{[$s2]}}{2} \\ + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\sin\left([$angleR]\right)`] is [$pnSine], so [`\sin\left([$angleR]\right)=[$aShow{$angle}[0]] `]. + +Finally, since [`\sin(-\theta) = -\sin(\theta)`], we have: + + [``\sin\left([$angleRN]\right)=[$ans0Show] ``] + +###Problem 2 + + [``\begin{aligned} + \cos\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1+\cos(\theta)}{2}} \\ + \cos\left([$angleR]\right) + &= \pm\sqrt{\frac{1+\cos\left([$angle2R]\right)}{2}} \\ + &= \pm\sqrt{\frac{1+\left([$a2{$angle2}[1][0]]\right)}{2}} \\ + &= \pm\sqrt{\frac{\left([$s3]\right)\cdot[$a2{$angle2}[1][3]]}{2\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\frac{\sqrt{[$s4]}}{2} \\ + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\cos\left([$angleR]\right)`] is [$pnCosine], so [`\cos\left([$angleR]\right)=[$aShow{$angle}[1]] `]. + +Finally, since [`\cos(-\theta) = \cos(\theta)`], we have: + + [``\cos\left([$angleRN]\right)=[$ans1Show] ``] + +###Problem 3 + + [``\begin{aligned} + \tan\left(\frac{\theta}{2}\right) &= \pm\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + \tan\left([$angleR]\right) + &= \pm\sqrt{\frac{1-\cos\left([$angle2R]\right)}{1+\cos\left([$angle2R]\right)}} \\ + &= \pm\sqrt{\frac{1-\left([$a2{$angle2}[1][0]]\right)}{1+\left([$a2{$angle2}[1][0]]\right)}} \\ + &= \pm\sqrt{\frac{\left([$s1]\right)\cdot[$a2{$angle2}[1][3]]}{\left([$s3]\right)\cdot[$a2{$angle2}[1][3]]}} \\ + &= \pm\sqrt{\frac{[$s2]}{[$s4]}} \\ + &= \pm\sqrt{\frac{\left([$s2]\right)\cdot\left([$s5]\right)}{\left([$s4]\right)\cdot\left([$s5]\right)}} \\ + &= \pm\sqrt{\frac{[$s6]}{[$den]}} \\ + &= \pm\sqrt{[$s7]} + \end{aligned}``] + +Since [`[$angleR]`] is in Quadrant [$Q], [`\tan\left([$angleR]\right)`] is [$pnTangent], so [`\tan\left([$angleR]\right)=[$aShow{$angle}[2]] `]. + +Finally, since [`\tan(-\theta) = -\tan(\theta)`], we have: + + [``\tan\left([$angleRN]\right)=[$ans2Show] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas30.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas30.pg new file mode 100644 index 0000000000..cf08a05e9d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas30.pg @@ -0,0 +1,345 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is sqrt($num,$den) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($inT,$inB) = shift->value; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($out1,$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? 1 : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? -1 : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); + +@quadrant = (); +$quadrant[0] = random(2,4,1); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@int2 = (); +@Q = (); +@pn = (); +@pns = (); + +for my $k (0..0) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $int2[$k] = "\left(\frac{\pi}{4},\frac{\pi}{2}\right)"; + $Q[$k] = "II"; + $pn[0] = "positive"; $pn[1] = "positive"; $pn[2] = "positive"; + $pns[0] = ''; $pns[1] = ''; $pns[2] = ''; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + $int2[$k] = "\left(\frac{\pi}{2},\frac{3\pi}{4}\right)"; + $pn[0] = "positive"; $pn[1] = "negative"; $pn[2] = "negative"; + $pns[0] = ''; $pns[1] = '-'; $pns[2] = '-'; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + $int2[$k] = "\left(\frac{3\pi}{4},\pi\right)"; + $pn[0] = "positive"; $pn[1] = "negative"; $pn[2] = "negative"; + $pns[0] = ''; $pns[1] = '-'; $pns[2] = '-'; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..0) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +@s1 = (); +@s2 = (); +@ans = (); + +for my $i (0..1) { + Context("Fraction"); + Context()->flags->set(requirePureFractions=>1); + Context()->flags->set(showMixedNumbers=>0); + $s1[$i] = (1-$trigs[0][1]*(-1)**$i)->reduce; + $s2[$i] = ($s1[$i]/2)->reduce; + $ans[$i] = rationalize($s2[$i]); + if ($pns[$i] eq '-') { + my $a = $ans[$i]->string; + Context("LimitedRadical"); + $ans[$i] = Formula("-$a"); + } +} + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +$s3 = ($s1[0]/$s1[1])->reduce; +$ans[2] = rationalize($s3); +if ($pns[2] eq '-') { + my $a = $ans[2]->string; + Context("LimitedRadical"); + $ans[2] = Formula("-$a"); +} + + +############################################################## + +BEGIN_PGML + +If it's given that + + [`\tan(\theta)=[$trigs[0][2]]`] and [`\theta\in[$int[0]]`], + +evaluate the following. + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + +a) [`\sin\left(\frac{\theta}{2}\right)=`][_____________]{$ans[0]} + +a) [`\cos\left(\frac{\theta}{2}\right)=`][_____________]{$ans[1]} + +a) [`\tan\left(\frac{\theta}{2}\right)=`][_____________]{$ans[2]} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin\left(\frac{\theta}{2}\right)`], we will use the formula + + [`` \sin\left(\frac{\theta}{2}\right) = \pm\sqrt{\frac{1-\cos(\theta)}{2}} ``] + +We need to find the values of [`\cos(\theta)`]. + +###Calculating [`\cos(\theta)`] + +It's given that [`\tan(\theta)=[$trigs[0][2]]`] and [`\theta\in[$int[0]]`]. We can sketch [`\theta`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{([$absBase[0]])^2+\left([$absHeight[0]]\right)^2}=[$hypotenuse[0]]`]. + +We can see [`\cos(\theta)=[$trigs[0][1]]`]. + +###Calculating [` \sin\left(\frac{\theta}{2}\right) `] + +Since [`\theta\in[$int[0]]`], we have [`\frac{\theta}{2}\in[$int2[0]]`], so the value of [` \sin\left(\frac{\theta}{2}\right) `] is [$pn[0]]. + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) + &= [$pns[0]]\sqrt{\frac{1-\cos(\theta)}{2}} \\ + &= [$pns[0]]\sqrt{\frac{1-\left([$trigs[0][1]]\right)}{2}} \\ + &= [$pns[0]]\sqrt{\frac{[$s1[0]]}{2}} \\ + &= [$pns[0]]\sqrt{[$s2[0]]} \\ + &= [$ans[0]] + \end{aligned}``] + +###Calculating [` \cos\left(\frac{\theta}{2}\right) `] + +Since [`\frac{\theta}{2}\in[$int2[0]]`], the value of [` \cos\left(\frac{\theta}{2}\right) `] is [$pn[1]]. + + [``\begin{aligned} + \cos\left(\frac{\theta}{2}\right) + &= [$pns[1]]\sqrt{\frac{1+\cos(\theta)}{2}} \\ + &= [$pns[1]]\sqrt{\frac{1+\left([$trigs[0][1]]\right)}{2}} \\ + &= [$pns[1]]\sqrt{\frac{[$s1[1]]}{2}} \\ + &= [$pns[1]]\sqrt{[$s2[1]]} \\ + &= [$ans[1]] + \end{aligned}``] + +###Calculating [` \tan\left(\frac{\theta}{2}\right) `] + +Although there are other methods to calculate [` \tan\left(\frac{\theta}{2}\right) `], we will use the half-angle formula to practice it. + +Since [`\frac{\theta}{2}\in[$int2[0]]`], the value of [` \tan\left(\frac{\theta}{2}\right) `] is [$pn[2]]. + + [``\begin{aligned} + \tan\left(\frac{\theta}{2}\right) + &= [$pns[2]]\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + &= [$pns[2]]\sqrt{\frac{1-\left([$trigs[0][1]]\right)}{1+\left([$trigs[0][1]]\right)}} \\ + &= [$pns[2]]\sqrt{\frac{[$s1[0]]}{[$s1[1]]}} \\ + &= [$pns[2]]\sqrt{[$s3]} \\ + &= [$ans[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas40.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas40.pg new file mode 100644 index 0000000000..b9fb59739b --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/HalfAngleFormulas40.pg @@ -0,0 +1,345 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is sqrt($num,$den) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($inT,$inB) = shift->value; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($out1,$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); + +@quadrant = (); +$quadrant[0] = random(2,4,1); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@int2 = (); +@Q = (); +@pn = (); +@pns = (); + +for my $k (0..0) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $int2[$k] = "\left(\frac{\pi}{4},\frac{\pi}{2}\right)"; + $Q[$k] = "II"; + $pn[0] = "positive"; $pn[1] = "positive"; $pn[2] = "positive"; + $pns[0] = ''; $pns[1] = ''; $pns[2] = ''; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + $int2[$k] = "\left(\frac{\pi}{2},\frac{3\pi}{4}\right)"; + $pn[0] = "positive"; $pn[1] = "negative"; $pn[2] = "negative"; + $pns[0] = ''; $pns[1] = '-'; $pns[2] = '-'; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + $int2[$k] = "\left(\frac{3\pi}{4},\pi\right)"; + $pn[0] = "positive"; $pn[1] = "negative"; $pn[2] = "negative"; + $pns[0] = ''; $pns[1] = '-'; $pns[2] = '-'; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..0) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +@s1 = (); +@s2 = (); +@ans = (); + +for my $i (0..1) { + Context("Fraction"); + Context()->flags->set(requirePureFractions=>1); + Context()->flags->set(showMixedNumbers=>0); + $s1[$i] = (1-$trigs[0][1]*(-1)**$i)->reduce; + $s2[$i] = ($s1[$i]/2)->reduce; + $ans[$i] = rationalize($s2[$i]); + if ($pns[$i] eq '-') { + my $a = $ans[$i]->string; + Context("LimitedRadical"); + $ans[$i] = Formula("-$a"); + } +} + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +$s3 = ($s1[0]/$s1[1])->reduce; +$ans[2] = rationalize($s3); +if ($pns[2] eq '-') { + my $a = $ans[2]->string; + Context("LimitedRadical"); + $ans[2] = Formula("-$a"); +} + + +############################################################## + +BEGIN_PGML + +If it's given that + + [`\sin(\theta)=[$trigs[0][0]]`] and [`\theta\in[$int[0]]`], + +evaluate the following. + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + +a) [`\sin\left(\frac{\theta}{2}\right)=`][_____________]{$ans[0]} + +a) [`\cos\left(\frac{\theta}{2}\right)=`][_____________]{$ans[1]} + +a) [`\tan\left(\frac{\theta}{2}\right)=`][_____________]{$ans[2]} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin\left(\frac{\theta}{2}\right)`], we will use the formula + + [`` \sin\left(\frac{\theta}{2}\right) = \pm\sqrt{\frac{1-\cos(\theta)}{2}} ``] + +We need to find the values of [`\cos(\theta)`]. + +###Calculating [`\cos(\theta)`] + +It's given that [`\sin(\theta)=[$trigs[0][2]]`] and [`\theta\in[$int[0]]`]. We can sketch [`\theta`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse[0]])^2-\left([$height[0]]\right)^2}=[$absBase[0]]`]. + +We can see [`\cos(\theta)=[$trigs[0][1]]`]. + +###Calculating [` \sin\left(\frac{\theta}{2}\right) `] + +Since [`\theta\in[$int[0]]`], we have [`\frac{\theta}{2}\in[$int2[0]]`], so the value of [` \sin\left(\frac{\theta}{2}\right) `] is [$pn[0]]. + + [``\begin{aligned} + \sin\left(\frac{\theta}{2}\right) + &= [$pns[0]]\sqrt{\frac{1-\cos(\theta)}{2}} \\ + &= [$pns[0]]\sqrt{\frac{1-\left([$trigs[0][1]]\right)}{2}} \\ + &= [$pns[0]]\sqrt{\frac{[$s1[0]]}{2}} \\ + &= [$pns[0]]\sqrt{[$s2[0]]} \\ + &= [$ans[0]] + \end{aligned}``] + +###Calculating [` \cos\left(\frac{\theta}{2}\right) `] + +Since [`\frac{\theta}{2}\in[$int2[0]]`], the value of [` \cos\left(\frac{\theta}{2}\right) `] is [$pn[1]]. + + [``\begin{aligned} + \cos\left(\frac{\theta}{2}\right) + &= [$pns[1]]\sqrt{\frac{1+\cos(\theta)}{2}} \\ + &= [$pns[1]]\sqrt{\frac{1+\left([$trigs[0][1]]\right)}{2}} \\ + &= [$pns[1]]\sqrt{\frac{[$s1[1]]}{2}} \\ + &= [$pns[1]]\sqrt{[$s2[1]]} \\ + &= [$ans[1]] + \end{aligned}``] + +###Calculating [` \tan\left(\frac{\theta}{2}\right) `] + +Although there are other methods to calculate [` \tan\left(\frac{\theta}{2}\right) `], we will use the half-angle formula to practice it. + +Since [`\frac{\theta}{2}\in[$int2[0]]`], the value of [` \tan\left(\frac{\theta}{2}\right) `] is [$pn[2]]. + + [``\begin{aligned} + \tan\left(\frac{\theta}{2}\right) + &= [$pns[2]]\sqrt{\frac{1-\cos(\theta)}{1+\cos(\theta)}} \\ + &= [$pns[2]]\sqrt{\frac{1-\left([$trigs[0][1]]\right)}{1+\left([$trigs[0][1]]\right)}} \\ + &= [$pns[2]]\sqrt{\frac{[$s1[0]]}{[$s1[1]]}} \\ + &= [$pns[2]]\sqrt{[$s3]} \\ + &= [$ans[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas10.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas10.pg new file mode 100644 index 0000000000..ae54fb2536 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas10.pg @@ -0,0 +1,408 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,180)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +@a30 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + 30, + "\displaystyle \frac{\pi}{6}", + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + [ + 60, + "\displaystyle \frac{\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + [ + 120, + "\displaystyle \frac{2\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + [ + 150, + "\displaystyle \frac{5\pi}{6}", + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + [ + 210, + "\displaystyle \frac{7\pi}{6}", + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + [ + 240, + "\displaystyle \frac{4\pi}{3}", + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + [ + 300, + "\displaystyle \frac{5\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + [ + 330, + "\displaystyle \frac{11\pi}{6}", + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], +); + +@a45 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + 45, + "\displaystyle \frac{\pi}{4}", + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + [ + 135, + "\displaystyle \frac{3\pi}{4}", + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], + [ + 225, + "\displaystyle \frac{5\pi}{4}", + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + [ + 315, + "\displaystyle \frac{7\pi}{4}", + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ansShow = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ans = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +do { + $i30 = random(0,7,1); + $i45 = random(0,3,1); + $aSum = $a30[$i30][0]+$a45[$i45][0]; +} until ($aSum<360); + +$aSumR = &angleToRadian($aSum); + +Context("LimitedRadical"); + +#sin(30)*cos(45) +$product0 = &multiplyRadicals( + $a30[$i30][2][1]*$a45[$i45][3][1], + $a30[$i30][2][2]*$a45[$i45][3][2], + $a30[$i30][2][3]*$a45[$i45][3][3] +); + +#sin(45)*cos(30) +$product1 = &multiplyRadicals( + $a30[$i30][3][1]*$a45[$i45][2][1], + $a30[$i30][3][2]*$a45[$i45][2][2], + $a30[$i30][3][3]*$a45[$i45][2][3] +); + +#cos(30)*cos(45) +$product2 = &multiplyRadicals( + $a30[$i30][3][1]*$a45[$i45][3][1], + $a30[$i30][3][2]*$a45[$i45][3][2], + $a30[$i30][3][3]*$a45[$i45][3][3] +); + +#sin(30)*sin(45) +$product3 = &multiplyRadicals( + $a30[$i30][2][1]*$a45[$i45][2][1], + $a30[$i30][2][2]*$a45[$i45][2][2], + $a30[$i30][2][3]*$a45[$i45][2][3] +); + +#tan(30)*tan(45) +$product4 = &multiplyRadicals( + $a30[$i30][4][1]*$a45[$i45][4][1], + $a30[$i30][4][2]*$a45[$i45][4][2], + $a30[$i30][4][3]*$a45[$i45][4][3] +); + + +$output = ""; +($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a30[$i30][4][1],$a30[$i30][4][2],$a30[$i30][4][3], + $a45[$i45][4][1],$a45[$i45][4][2],$a45[$i45][4][3] +); +$a12 = $a1*$a2; +$b12 = $b1*$b2; +$c12 = $c1*$c2; + +$n1 = &createRadical($a1,$b1,$c1); +$n2 = &createRadical($a2,$b2,$c2); +$top = ($a2>0) ? "$n1+$n2" : "$n1$n2"; +$bottom = "1-$product4"; +$output .= "&=\frac{$top}{$bottom}\\"; + +if ($c12!=1) { + $top = ($a2>0) ? "($n1+$n2)\cdot$c12" : "($n1$n2)\cdot$c12"; + $bottom = "($bottom)\cdot$c12"; + $output .= "&=\frac{$top}{$bottom}\\"; + $n3 = &createRadical($a1*$c2,$b1,1); + $n4 = &createRadical($a2*$c1,$b2,1); + $top = ($a2*$c1>0) ? "$n3+$n4" : "$n3$n4"; + $n5 = &createRadical($a1*$a2,$b1*$b2,1); + $bottom = "$c12-$n5"; + $output .= "&=\frac{$top}{$bottom}\\"; + $output .= "&=\frac{($top)\cdot($c12+$n5)}{($bottom)\cdot($c12+$n5)}\\"; +} else { + $output .= "&=\frac{($top)\cdot(1+$product4)}{($bottom)\cdot(1+$product4)}\\"; +} +$bottom = ($c1*$c2)**2-($a1*$a2)**2*$b1*$b2; +$n1 = $c1*$a1*($c2)**2+$a1*($a2)**2*$c1*$b2; +$n2 = &createRadical($n1,$b1,1); +$n3 = ($a1)**2*$a2*$c2*$b1+$a2*($c1)**2*$c2; +$n4 = &createRadical($n3,$b2,1); +$output .= "&=\frac{$n2+$n4}{$bottom}\\"; + + +############################################## + +BEGIN_PGML + +Without using a calculator, use the following formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$aSumR]\right) = ``][_________]{$ans{$aSum}[0]->cmp(correct_ans_latex_string=>($ansShow{$aSum}[0]->TeX))} + + [`` \cos\left([$aSumR]\right) = ``][_________]{$ans{$aSum}[1]->cmp(correct_ans_latex_string=>($ansShow{$aSum}[1]->TeX))} + + [`` \tan\left([$aSumR]\right) = ``][_________]{$ans{$aSum}[2]->cmp(correct_ans_latex_string=>($ansShow{$aSum}[2]->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Recognize that: + + [`` [$aSumR] \text{ radians}= [$aSum]^{\circ} = [$a30[$i30][0]]^{\circ} + [$a45[$i45][0]]^{\circ} ``], + +so: + + [`` [$aSumR] = [$a30[$i30][1]] + [$a45[$i45][1]] ``]. + +We will use the following formulas: + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left([$aSumR]\right) + &= \sin\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \sin\left([$a30[$i30][1]]\right)\cos\left([$a45[$i45][1]]\right) + \cos\left([$a30[$i30][1]]\right)\sin\left([$a45[$i45][1]]\right) \\ + &= \left([$a30[$i30][2][0]]\right)\left([$a45[$i45][3][0]]\right) + \left([$a30[$i30][3][0]]\right)\left([$a45[$i45][2][0]]\right) \\ + &= [$product0] + [$product1] \\ + &= [$ansShow{$aSum}[0]] + \end{aligned}``] + +###Problem 2 + + [``\begin{aligned} + \cos\left([$aSumR]\right) + &= \cos\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \cos\left([$a30[$i30][1]]\right)\cos\left([$a45[$i45][1]]\right) - \sin\left([$a45[$i45][1]]\right)\sin\left([$a30[$i30][1]]\right) \\ + &= \left([$a30[$i30][3][0]]\right)\left([$a45[$i45][3][0]]\right) - \left([$a45[$i45][2][0]]\right)\left([$a30[$i30][2][0]]\right) \\ + &= [$product2] - [$product3] \\ + &= [$ansShow{$aSum}[1]] + \end{aligned}``] + +###Problem 3 + + [``\begin{aligned} + \tan\left([$aSumR]\right) + &= \tan\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \frac{\tan\left([$a30[$i30][1]]\right)+\tan\left([$a45[$i45][1]]\right)}{1-\tan\left([$a30[$i30][1]]\right)\tan\left([$a45[$i45][1]]\right)} \\ + &= \frac{\left([$a30[$i30][4][0]]\right)+\left([$a45[$i45][4][0]]\right)}{1 - \left([$a30[$i30][4][0]]\right)\left([$a45[$i45][4][0]]\right)} \\ + [$output] + &= [$ansShow{$aSum}[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas11.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas11.pg new file mode 100644 index 0000000000..cf289ba0dd --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas11.pg @@ -0,0 +1,445 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,180)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +@a30 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + 30, + "\displaystyle \frac{\pi}{6}", + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + [ + 60, + "\displaystyle \frac{\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + [ + 120, + "\displaystyle \frac{2\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + [ + 150, + "\displaystyle \frac{5\pi}{6}", + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + [ + 210, + "\displaystyle \frac{7\pi}{6}", + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + [ + 240, + "\displaystyle \frac{4\pi}{3}", + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + [ + 300, + "\displaystyle \frac{5\pi}{3}", + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + [ + 330, + "\displaystyle \frac{11\pi}{6}", + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], +); + +@a45 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + 45, + "\displaystyle \frac{\pi}{4}", + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + [ + 135, + "\displaystyle \frac{3\pi}{4}", + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], + [ + 225, + "\displaystyle \frac{5\pi}{4}", + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + [ + 315, + "\displaystyle \frac{7\pi}{4}", + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ansShow = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ans = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +do { + $i30 = random(0,7,1); + $i45 = random(0,3,1); + $aSum = $a30[$i30][0]+$a45[$i45][0]; +} until ($aSum<360); + +$aSumR = &angleToRadian($aSum); + +Context("LimitedRadical"); + +#sin(30)*cos(45) +$product0 = &multiplyRadicals( + $a30[$i30][2][1]*$a45[$i45][3][1], + $a30[$i30][2][2]*$a45[$i45][3][2], + $a30[$i30][2][3]*$a45[$i45][3][3] +); + +#sin(45)*cos(30) +$product1 = &multiplyRadicals( + $a30[$i30][3][1]*$a45[$i45][2][1], + $a30[$i30][3][2]*$a45[$i45][2][2], + $a30[$i30][3][3]*$a45[$i45][2][3] +); + +#cos(30)*cos(45) +$product2 = &multiplyRadicals( + $a30[$i30][3][1]*$a45[$i45][3][1], + $a30[$i30][3][2]*$a45[$i45][3][2], + $a30[$i30][3][3]*$a45[$i45][3][3] +); + +#sin(30)*sin(45) +$product3 = &multiplyRadicals( + $a30[$i30][2][1]*$a45[$i45][2][1], + $a30[$i30][2][2]*$a45[$i45][2][2], + $a30[$i30][2][3]*$a45[$i45][2][3] +); + +#tan(30)*tan(45) +$product4 = &multiplyRadicals( + $a30[$i30][4][1]*$a45[$i45][4][1], + $a30[$i30][4][2]*$a45[$i45][4][2], + $a30[$i30][4][3]*$a45[$i45][4][3] +); + + +$output = ""; +($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a30[$i30][4][1],$a30[$i30][4][2],$a30[$i30][4][3], + $a45[$i45][4][1],$a45[$i45][4][2],$a45[$i45][4][3] +); +$a12 = $a1*$a2; +$b12 = $b1*$b2; +$c12 = $c1*$c2; + +$n1 = &createRadical($a1,$b1,$c1); +$n2 = &createRadical($a2,$b2,$c2); +$top = ($a2>0) ? "$n1+$n2" : "$n1$n2"; +$bottom = "1-$product4"; +$output .= "&=\frac{$top}{$bottom}\\"; + +if ($c12!=1) { + $top = ($a2>0) ? "($n1+$n2)\cdot$c12" : "($n1$n2)\cdot$c12"; + $bottom = "($bottom)\cdot$c12"; + $output .= "&=\frac{$top}{$bottom}\\"; + $n3 = &createRadical($a1*$c2,$b1,1); + $n4 = &createRadical($a2*$c1,$b2,1); + $top = ($a2*$c1>0) ? "$n3+$n4" : "$n3$n4"; + $n5 = &createRadical($a1*$a2,$b1*$b2,1); + $bottom = "$c12-$n5"; + $output .= "&=\frac{$top}{$bottom}\\"; + $output .= "&=\frac{($top)\cdot($c12+$n5)}{($bottom)\cdot($c12+$n5)}\\"; +} else { + $output .= "&=\frac{($top)\cdot(1+$product4)}{($bottom)\cdot(1+$product4)}\\"; +} +$bottom = ($c1*$c2)**2-($a1*$a2)**2*$b1*$b2; +$n1 = $c1*$a1*($c2)**2+$a1*($a2)**2*$c1*$b2; +$n2 = &createRadical($n1,$b1,1); +$n3 = ($a1)**2*$a2*$c2*$b1+$a2*($c1)**2*$c2; +$n4 = &createRadical($n3,$b2,1); +$output .= "&=\frac{$n2+$n4}{$bottom}\\"; + +$aSumN = -$aSum; +$aSumRN = &angleToRadian($aSumN); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +$ans0 = Compute("-$ans{$aSum}[0]"); +$ans1 = Compute("$ans{$aSum}[1]"); +$ans2 = Compute("-$ans{$aSum}[2]"); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$ans0Show = $ansShow{360-$aSum}[0]; +$ans1Show = $ansShow{$aSum}[1]; +$ans2Show = $ansShow{360-$aSum}[2]; + +############################################## + +BEGIN_PGML + +Without using a calculator, use the following formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$aSumRN]\right) = ``][_________]{$ans0->cmp(correct_ans_latex_string=>($ans0Show->TeX))} + + [`` \cos\left([$aSumRN]\right) = ``][_________]{$ans1->cmp(correct_ans_latex_string=>($ans1Show->TeX))} + + [`` \tan\left([$aSumRN]\right) = ``][_________]{$ans2->cmp(correct_ans_latex_string=>($ans2Show->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +When we evaluate the trigonometry value of a negative angle, we can evaluate the value of the corresponding positive angle, and then use the following properties: + + [``\begin{aligned} + \sin(-\theta) &= -\sin(\theta) \\ + \cos(-\theta) &= \cos(\theta) \\ + \tan(-\theta) &= -\tan(\theta) \\ + \end{aligned}``] + +Recognize that: + + [`` [$aSumR] \text{ radians}= [$aSum]^{\circ} = [$a30[$i30][0]]^{\circ} + [$a45[$i45][0]]^{\circ} ``], + +so: + + [`` [$aSumR] = [$a30[$i30][1]] + [$a45[$i45][1]] ``]. + +We will use the following formulas: + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left([$aSumR]\right) + &= \sin\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \sin\left([$a30[$i30][1]]\right)\cos\left([$a45[$i45][1]]\right) + \cos\left([$a30[$i30][1]]\right)\sin\left([$a45[$i45][1]]\right) \\ + &= \left([$a30[$i30][2][0]]\right)\left([$a45[$i45][3][0]]\right) + \left([$a30[$i30][3][0]]\right)\left([$a45[$i45][2][0]]\right) \\ + &= [$product0] + [$product1] \\ + &= [$ansShow{$aSum}[0]] + \end{aligned}``] + +Finally, since [`\sin(-\theta) = -\sin(\theta)`], we have: + + [``\sin\left([$aSumRN]\right)=-\left([$ansShow{$aSum}[0]]\right)=[$ans0Show] ``] + +###Problem 2 + + [``\begin{aligned} + \cos\left([$aSumR]\right) + &= \cos\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \cos\left([$a30[$i30][1]]\right)\cos\left([$a45[$i45][1]]\right) - \sin\left([$a45[$i45][1]]\right)\sin\left([$a30[$i30][1]]\right) \\ + &= \left([$a30[$i30][3][0]]\right)\left([$a45[$i45][3][0]]\right) - \left([$a45[$i45][2][0]]\right)\left([$a30[$i30][2][0]]\right) \\ + &= [$product2] - [$product3] \\ + &= [$ansShow{$aSum}[1]] + \end{aligned}``] + +Finally, since [`\cos(-\theta) = \cos(\theta)`], we have: + + [``\cos\left([$aSumRN]\right)=[$ans1Show] ``] + +###Problem 3 + + [``\begin{aligned} + \tan\left([$aSumR]\right) + &= \tan\left([$a30[$i30][1]]+[$a45[$i45][1]]\right) \\ + &= \frac{\tan\left([$a30[$i30][1]]\right)+\tan\left([$a45[$i45][1]]\right)}{1-\tan\left([$a30[$i30][1]]\right)\tan\left([$a45[$i45][1]]\right)} \\ + &= \frac{\left([$a30[$i30][4][0]]\right)+\left([$a45[$i45][4][0]]\right)}{1 - \left([$a30[$i30][4][0]]\right)\left([$a45[$i45][4][0]]\right)} \\ + [$output] + &= [$ansShow{$aSum}[2]] + \end{aligned}``] + +Finally, since [`\tan(-\theta) = -\tan(\theta)`], we have: + + [``\tan\left([$aSumRN]\right)=-\left([$ansShow{$aSum}[2]]\right)=[$ans2Show] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas20.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas20.pg new file mode 100644 index 0000000000..a00eae9bb5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas20.pg @@ -0,0 +1,419 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,180)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +%a30 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 30 => [ + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 60 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + 120 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + 150 => [ + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 210 => [ + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 240 => [ + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + 300 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + 330 => [ + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], +); + +%a45 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 45 => [ + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + 135 => [ + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], + 225 => [ + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + 315 => [ + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ansShow = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ans = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +do { + $i30 = list_random(30,60,120,150,210,240,300,330); + $i45 = list_random(45,135,225,315); + $aDif = $i30-$i45; + $flag = 0; + if (random(0,1,1)==0) { + $aDif = $i45-$i30; + $flag = 1; + } +} until ($aDif>0); + +$aDifR = &angleToRadian($aDif); + +Context("LimitedRadical"); + +#sin(30)*cos(45) +$product0 = &multiplyRadicals( + $a30{$i30}[$flag][1]*$a45{$i45}[($flag+1)%2][1], + $a30{$i30}[$flag][2]*$a45{$i45}[($flag+1)%2][2], + $a30{$i30}[$flag][3]*$a45{$i45}[($flag+1)%2][3] +); + +#sin(45)*cos(30) +$product1 = &multiplyRadicals( + $a30{$i30}[($flag+1)%2][1]*$a45{$i45}[$flag][1], + $a30{$i30}[($flag+1)%2][2]*$a45{$i45}[$flag][2], + $a30{$i30}[($flag+1)%2][3]*$a45{$i45}[$flag][3] +); + +#cos(30)*cos(45) +$product2 = &multiplyRadicals( + $a30{$i30}[1][1]*$a45{$i45}[1][1], + $a30{$i30}[1][2]*$a45{$i45}[1][2], + $a30{$i30}[1][3]*$a45{$i45}[1][3] +); + +#sin(30)*sin(45) +$product3 = &multiplyRadicals( + $a30{$i30}[0][1]*$a45{$i45}[0][1], + $a30{$i30}[0][2]*$a45{$i45}[0][2], + $a30{$i30}[0][3]*$a45{$i45}[0][3] +); + +#tan(30)*tan(45) +$product4 = &multiplyRadicals( + $a30{$i30}[2][1]*$a45{$i45}[2][1], + $a30{$i30}[2][2]*$a45{$i45}[2][2], + $a30{$i30}[2][3]*$a45{$i45}[2][3] +); + +$output = ""; +if ($flag==0) { + ($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a30{$i30}[2][1],$a30{$i30}[2][2],$a30{$i30}[2][3], + $a45{$i45}[2][1],$a45{$i45}[2][2],$a45{$i45}[2][3] + ); +} else { + ($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a45{$i45}[2][1],$a45{$i45}[2][2],$a45{$i45}[2][3], + $a30{$i30}[2][1],$a30{$i30}[2][2],$a30{$i30}[2][3], + ); +} +$a12 = $a1*$a2; +$b12 = $b1*$b2; +$c12 = $c1*$c2; + +$n1 = &createRadical($a1,$b1,$c1); +$n2 = &createRadical($a2,$b2,$c2); +$top = "$n1-$n2"; +$bottom = "1+$product4"; +$output .= "&=\frac{$top}{$bottom}\\"; + +if ($c12!=1) { + $top = "($n1-$n2)\cdot$c12"; + $bottom = "($bottom)\cdot$c12"; + $output .= "&=\frac{$top}{$bottom}\\"; + $n3 = &createRadical($a1*$c2,$b1,1); + $n4 = &createRadical($a2*$c1,$b2,1); + $top = "$n3-$n4"; + $n5 = &createRadical($a1*$a2,$b1*$b2,1); + $bottom = "$c12+$n5"; + $output .= "&=\frac{$top}{$bottom}\\"; + $output .= "&=\frac{($top)\cdot($c12-$n5)}{($bottom)\cdot($c12-$n5)}\\"; +} else { + $output .= "&=\frac{($top)\cdot(1-$product4)}{($bottom)\cdot(1-$product4)}\\"; +} +$bottom = ($c1*$c2)**2-($a1*$a2)**2*$b1*$b2; +$n1 = $c1*$a1*($c2)**2+$a1*($a2)**2*$c1*$b2; +$n2 = &createRadical($n1,$b1,1); +$n3 = -($a1)**2*$a2*$c2*$b1-$a2*($c1)**2*$c2; +$n4 = &createRadical($n3,$b2,1); +$output .= "&=\frac{$n2+$n4}{$bottom}\\"; + + +############################################## + +BEGIN_PGML + +Without using a calculator, use the following formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$aDifR]\right) = ``][_________]{$ans{$aDif}[0]->cmp(correct_ans_latex_string=>($ansShow{$aDif}[0]->TeX))} + + [`` \cos\left([$aDifR]\right) = ``][_________]{$ans{$aDif}[1]->cmp(correct_ans_latex_string=>($ansShow{$aDif}[1]->TeX))} + + [`` \tan\left([$aDifR]\right) = ``][_________]{$ans{$aDif}[2]->cmp(correct_ans_latex_string=>($ansShow{$aDif}[2]->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +if ($flag==0) { + $an0 = $i30; + $an1 = $i45; + $a0r = angleToRadian($i30); + $a1r = angleToRadian($i45); + $s0 = $a30{$i30}[0][0]; + $c1 = $a45{$i45}[1][0]; + $s1 = $a45{$i45}[0][0]; + $c0 = $a30{$i30}[1][0]; + $s2 = $a30{$i30}[2][0]; + $s3 = $a45{$i45}[2][0]; +} else { + $an1 = $i30; + $an0 = $i45; + $a1r = angleToRadian($i30); + $a0r = angleToRadian($i45); + $s1 = $a30{$i30}[0][0]; + $c0 = $a45{$i45}[1][0]; + $s0 = $a45{$i45}[0][0]; + $c1 = $a30{$i30}[1][0]; + $s3 = $a30{$i30}[2][0]; + $s2 = $a45{$i45}[2][0]; +} + +BEGIN_PGML_SOLUTION + +Recognize that: + + [`` [$aDifR] \text{ radians}= [$aDif]^{\circ} = [$an0]^{\circ} - [$an1]^{\circ} ``], + +so: + + [`` [$aDifR] = [$a0r] - [$a1r] ``]. + +We will use the following formulas: + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left([$aDifR]\right) + &= \sin\left([$a0r]-[$a1r]\right) \\ + &= \sin\left([$a0r]\right)\cos\left([$a1r]\right) - \cos\left([$a0r]\right)\sin\left([$a1r]\right) \\ + &= \left([$s0]\right)\left([$c1]\right) - \left([$c0]\right)\left([$s1]\right) \\ + &= [$product0] - [$product1] \\ + &= [$ansShow{$aDif}[0]] + \end{aligned}``] + +###Problem 2 + + [``\begin{aligned} + \cos\left([$aDifR]\right) + &= \cos\left([$a0r]-[$a1r]\right) \\ + &= \cos\left([$a0r]\right)\cos\left([$a1r]\right) + \sin\left([$a0r]\right)\sin\left([$a1r]\right) \\ + &= \left([$c0]\right)\left([$c1]\right) + \left([$s0]\right)\left([$s1]\right) \\ + &= [$product2] + [$product3] \\ + &= [$ansShow{$aDif}[1]] + \end{aligned}``] + +###Problem 3 + + [``\begin{aligned} + \tan\left([$aDifR]\right) + &= \tan\left([$a0r]-[$a1r]\right) \\ + &= \frac{\tan\left([$a0r]\right)-\tan\left([$a1r]\right)}{1+\tan\left([$a0r]\right)\tan\left([$a1r]\right)} \\ + &= \frac{\left([$s2]\right)-\left([$s3]\right)}{1 + \left([$s2]\right)\left([$s3]\right)} \\ + [$output] + &= [$ansShow{$aDif}[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas21.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas21.pg new file mode 100644 index 0000000000..970c1cd36f --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas21.pg @@ -0,0 +1,456 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub angleToRadian { + my $a = shift; + Context("LimitedFraction"); + my ($n,$d) = Fraction($a,180)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + if (($numIn==0)||($numOut==0)) {return 0;} + if ($d0==1) { + if ($numIn==1) {return "$n0";} + elsif ($n0==1) {return "\sqrt{$numIn}";} + elsif ($n0==-1) {return "-\sqrt{$numIn}";} + else {return "$n0\sqrt{$numIn}";} + } else { + if ($numIn==1) {return "\frac{$n0}{$d0}";} + elsif ($n0==1) {return "\frac{\sqrt{$numIn}}{$d0}";} + elsif ($n0==-1) {return "-\frac{\sqrt{$numIn}}{$d0}";} + else { + $n0N = -$n0; + return ($n0>0) ? "\frac{$n0\sqrt{$numIn}}{$d0}" : "-\frac{$n0N\sqrt{$numIn}}{$d0}"; + } + } +} + +sub multiplyRadicals { + my ($numOut0, $numIn0, $den0) = @_; + if (sqrt($numIn0)==int(sqrt($numIn0))) { + $numOut0 *= sqrt($numIn0); + $numIn0 = 1; + } + return &createRadical($numOut0, $numIn0, $den0); +} + +%a30 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 30 => [ + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 60 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + 120 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + 150 => [ + ["\displaystyle \frac{1}{2}", 1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], + 210 => [ + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle \frac{\sqrt{3}}{3}", 1, 3, 3], + ], + 240 => [ + ["\displaystyle -\frac{\sqrt{3}}{2}", -1, 3, 2], + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \sqrt{3}", 1, 3, 1], + ], + 300 => [ + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle \frac{1}{2}", -1, 1, 2], + ["\displaystyle -\sqrt{3}", -1, 3, 1], + ], + 330 => [ + ["\displaystyle -\frac{1}{2}", -1, 1, 2], + ["\displaystyle \frac{\sqrt{3}}{2}", 1, 3, 2], + ["\displaystyle -\frac{\sqrt{3}}{3}", -1, 3, 3], + ], +); + +%a45 = ( + #[angle value, radian value, sin, cos, tan] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + 45 => [ + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + 135 => [ + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], + 225 => [ + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle 1", 1, 1, 1], + ], + 315 => [ + ["\displaystyle -\frac{\sqrt{2}}{2}", -1, 2, 2], + ["\displaystyle \frac{\sqrt{2}}{2}", 1, 2, 2], + ["\displaystyle -1", -1, 1, 1], + ], +); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ansShow = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("(-sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +%ans = ( + 15 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 75 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("2+sqrt(3)")], + 105 => [Formula("(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-2-sqrt(3)")], + 165 => [Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], + 195 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("2-sqrt(3)")], + 255 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{2}-sqrt{6})/4"), + Formula("2+sqrt(3)")], + 285 => [Formula("-(sqrt{6}+sqrt{2})/4"), + Formula("(sqrt{6}-sqrt{2})/4"), + Formula("-2-sqrt(3)")], + 345 => [Formula("(sqrt{2}-sqrt{6})/4"), + Formula("(sqrt{6}+sqrt{2})/4"), + Formula("sqrt(3)-2")], +); + +do { + $i30 = list_random(30,60,120,150,210,240,300,330); + $i45 = list_random(45,135,225,315); + $aDif = $i30-$i45; + $flag = 0; + if (random(0,1,1)==0) { + $aDif = $i45-$i30; + $flag = 1; + } +} until ($aDif>0); + +$aDifR = &angleToRadian($aDif); + +Context("LimitedRadical"); + +#sin(30)*cos(45) +$product0 = &multiplyRadicals( + $a30{$i30}[$flag][1]*$a45{$i45}[($flag+1)%2][1], + $a30{$i30}[$flag][2]*$a45{$i45}[($flag+1)%2][2], + $a30{$i30}[$flag][3]*$a45{$i45}[($flag+1)%2][3] +); + +#sin(45)*cos(30) +$product1 = &multiplyRadicals( + $a30{$i30}[($flag+1)%2][1]*$a45{$i45}[$flag][1], + $a30{$i30}[($flag+1)%2][2]*$a45{$i45}[$flag][2], + $a30{$i30}[($flag+1)%2][3]*$a45{$i45}[$flag][3] +); + +#cos(30)*cos(45) +$product2 = &multiplyRadicals( + $a30{$i30}[1][1]*$a45{$i45}[1][1], + $a30{$i30}[1][2]*$a45{$i45}[1][2], + $a30{$i30}[1][3]*$a45{$i45}[1][3] +); + +#sin(30)*sin(45) +$product3 = &multiplyRadicals( + $a30{$i30}[0][1]*$a45{$i45}[0][1], + $a30{$i30}[0][2]*$a45{$i45}[0][2], + $a30{$i30}[0][3]*$a45{$i45}[0][3] +); + +#tan(30)*tan(45) +$product4 = &multiplyRadicals( + $a30{$i30}[2][1]*$a45{$i45}[2][1], + $a30{$i30}[2][2]*$a45{$i45}[2][2], + $a30{$i30}[2][3]*$a45{$i45}[2][3] +); + +$output = ""; +if ($flag==0) { + ($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a30{$i30}[2][1],$a30{$i30}[2][2],$a30{$i30}[2][3], + $a45{$i45}[2][1],$a45{$i45}[2][2],$a45{$i45}[2][3] + ); +} else { + ($a1,$b1,$c1,$a2,$b2,$c2) = ( + $a45{$i45}[2][1],$a45{$i45}[2][2],$a45{$i45}[2][3], + $a30{$i30}[2][1],$a30{$i30}[2][2],$a30{$i30}[2][3], + ); +} +$a12 = $a1*$a2; +$b12 = $b1*$b2; +$c12 = $c1*$c2; + +$n1 = &createRadical($a1,$b1,$c1); +$n2 = &createRadical($a2,$b2,$c2); +$top = "$n1-$n2"; +$bottom = "1+$product4"; +$output .= "&=\frac{$top}{$bottom}\\"; + +if ($c12!=1) { + $top = "($n1-$n2)\cdot$c12"; + $bottom = "($bottom)\cdot$c12"; + $output .= "&=\frac{$top}{$bottom}\\"; + $n3 = &createRadical($a1*$c2,$b1,1); + $n4 = &createRadical($a2*$c1,$b2,1); + $top = "$n3-$n4"; + $n5 = &createRadical($a1*$a2,$b1*$b2,1); + $bottom = "$c12+$n5"; + $output .= "&=\frac{$top}{$bottom}\\"; + $output .= "&=\frac{($top)\cdot($c12-$n5)}{($bottom)\cdot($c12-$n5)}\\"; +} else { + $output .= "&=\frac{($top)\cdot(1-$product4)}{($bottom)\cdot(1-$product4)}\\"; +} +$bottom = ($c1*$c2)**2-($a1*$a2)**2*$b1*$b2; +$n1 = $c1*$a1*($c2)**2+$a1*($a2)**2*$c1*$b2; +$n2 = &createRadical($n1,$b1,1); +$n3 = -($a1)**2*$a2*$c2*$b1-$a2*($c1)**2*$c2; +$n4 = &createRadical($n3,$b2,1); +$output .= "&=\frac{$n2+$n4}{$bottom}\\"; + +$aDifN = -$aDif; +$aDifRN = &angleToRadian($aDifN); + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +$ans0 = Compute("-$ans{$aDif}[0]"); +$ans1 = Compute("$ans{$aDif}[1]"); +$ans2 = Compute("-$ans{$aDif}[2]"); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +$ans0Show = $ansShow{360-$aDif}[0]; +$ans1Show = $ansShow{$aDif}[1]; +$ans2Show = $ansShow{360-$aDif}[2]; + +############################################## + +BEGIN_PGML + +Without using a calculator, use the following formulas and your knowledge of the Unit Circle to find the *exact* value of the following expressions. + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +* [@KeyboardInstructions("Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.")@]** +* [@KeyboardInstructions("Rationalize the denominator if needed.")@]** + + [`` \sin\left([$aDifRN]\right) = ``][_________]{$ans0->cmp(correct_ans_latex_string=>($ans0Show->TeX))} + + [`` \cos\left([$aDifRN]\right) = ``][_________]{$ans1->cmp(correct_ans_latex_string=>($ans1Show->TeX))} + + [`` \tan\left([$aDifRN]\right) = ``][_________]{$ans2->cmp(correct_ans_latex_string=>($ans2Show->TeX))} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +if ($flag==0) { + $an0 = $i30; + $an1 = $i45; + $a0r = angleToRadian($i30); + $a1r = angleToRadian($i45); + $s0 = $a30{$i30}[0][0]; + $c1 = $a45{$i45}[1][0]; + $s1 = $a45{$i45}[0][0]; + $c0 = $a30{$i30}[1][0]; + $s2 = $a30{$i30}[2][0]; + $s3 = $a45{$i45}[2][0]; +} else { + $an1 = $i30; + $an0 = $i45; + $a1r = angleToRadian($i30); + $a0r = angleToRadian($i45); + $s1 = $a30{$i30}[0][0]; + $c0 = $a45{$i45}[1][0]; + $s0 = $a45{$i45}[0][0]; + $c1 = $a30{$i30}[1][0]; + $s3 = $a30{$i30}[2][0]; + $s2 = $a45{$i45}[2][0]; +} + +BEGIN_PGML_SOLUTION + +When we evaluate the trigonometry value of a negative angle, we can evaluate the value of the corresponding positive angle, and then use the following properties: + + [``\begin{aligned} + \sin(-\theta) &= -\sin(\theta) \\ + \cos(-\theta) &= \cos(\theta) \\ + \tan(-\theta) &= -\tan(\theta) \\ + \end{aligned}``] + +Recognize that: + + [`` [$aDifR] \text{ radians}= [$aDif]^{\circ} = [$an0]^{\circ} - [$an1]^{\circ} ``], + +so: + + [`` [$aDifR] = [$a0r] - [$a1r] ``]. + +We will use the following formulas: + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\beta)} + \end{aligned}``] + +###Problem 1 + + [``\begin{aligned} + \sin\left([$aDifR]\right) + &= \sin\left([$a0r]-[$a1r]\right) \\ + &= \sin\left([$a0r]\right)\cos\left([$a1r]\right) - \cos\left([$a0r]\right)\sin\left([$a1r]\right) \\ + &= \left([$s0]\right)\left([$c1]\right) - \left([$c0]\right)\left([$s1]\right) \\ + &= [$product0] - [$product1] \\ + &= [$ansShow{$aDif}[0]] + \end{aligned}``] + +Finally, since [`\sin(-\theta) = -\sin(\theta)`], we have: + + [``\sin\left([$aDifRN]\right)=-\left([$ansShow{$aDif}[0]]\right)=[$ans0Show] ``] + +###Problem 2 + + [``\begin{aligned} + \cos\left([$aDifR]\right) + &= \cos\left([$a0r]-[$a1r]\right) \\ + &= \cos\left([$a0r]\right)\cos\left([$a1r]\right) + \sin\left([$a0r]\right)\sin\left([$a1r]\right) \\ + &= \left([$c0]\right)\left([$c1]\right) + \left([$s0]\right)\left([$s1]\right) \\ + &= [$product2] + [$product3] \\ + &= [$ansShow{$aDif}[1]] + \end{aligned}``] + +Finally, since [`\cos(-\theta) = \cos(\theta)`], we have: + + [``\cos\left([$aDifRN]\right)=[$ans1Show] ``] + +###Problem 3 + + [``\begin{aligned} + \tan\left([$aDifR]\right) + &= \tan\left([$a0r]-[$a1r]\right) \\ + &= \frac{\tan\left([$a0r]\right)-\tan\left([$a1r]\right)}{1+\tan\left([$a0r]\right)\tan\left([$a1r]\right)} \\ + &= \frac{\left([$s2]\right)-\left([$s3]\right)}{1 + \left([$s2]\right)\left([$s3]\right)} \\ + [$output] + &= [$ansShow{$aDif}[2]] + \end{aligned}``] + +Finally, since [`\tan(-\theta) = -\tan(\theta)`], we have: + + [``\tan\left([$aDifRN]\right)=-\left([$ansShow{$aDif}[2]]\right)=[$ans2Show] ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas30.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas30.pg new file mode 100644 index 0000000000..2da0b90d8b --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas30.pg @@ -0,0 +1,241 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); +do {$in[1] = random(0,3,1);} until ($in[0] != $in[1]); + +@quadrant = (); +$quadrant[0] = random(2,4,1); +do {$quadrant[1] = random(2,4,1);} until ($quadrant[0] != $quadrant[1]); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@Q = (); + +for my $k (0..1) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $Q[$k] = "II"; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], + [Fraction($height[1],$hypotenuse[1]), + Fraction($base[1],$hypotenuse[1]), + Fraction($height[1],$base[1]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..1) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +$sinSum = ($trigs[0][0]*$trigs[1][1]+$trigs[0][1]*$trigs[1][0])->reduce; +$cosSum = ($trigs[0][1]*$trigs[1][1]-$trigs[0][0]*$trigs[1][0])->reduce; + + + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\cos(\alpha)=[$trigs[0][1]]`] and [`\alpha\in[$int[0]]`], +* [`\sin(\beta)=[$trigs[1][0]]`] and [`\beta\in[$int[1]]`], + +evaluate the following. + +a) [`\sin(\alpha+\beta)=`][_____________]{$sinSum} + +a) [`\cos(\alpha+\beta)=`][_____________]{$cosSum} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = ($trigs[0][0]*$trigs[1][1])->reduce; +$s2 = ($trigs[0][1]*$trigs[1][0])->reduce; +$s3 = ($trigs[0][1]*$trigs[1][1])->reduce; +$s4 = ($trigs[0][0]*$trigs[1][0])->reduce; + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin(\alpha+\beta)`], we will use the formula + + [`` \sin(\alpha+\beta) = \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) ``] + +[`\cos(\alpha)`] and [`\sin(\beta)`] are given. We need to find the values of [`\sin(\alpha)`] and [`\cos(\beta)`]. + +###Calculating [`\sin(\alpha)`] + +It's given that [`\cos(\alpha)=[$trigs[0][1]]`] and [`\alpha\in[$int[0]]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse[0]])^2-\left([$base[0]]\right)^2}=[$absHeight[0]]`]. + +We can see [`\sin(\alpha)=[$trigs[0][0]]`]. + +###Calculating [`\cos(\beta)`] + +It's given that [`\sin(\beta)=[$trigs[1][0]]`] and [`\beta\in[$int[1]]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig[1] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse[1]])^2-\left([$height[1]]\right)^2}=[$absBase[1]]`]. + +We can see [`\cos(\beta)=[$trigs[1][1]]`]. + +###Calculating [` \sin(\alpha+\beta) `] + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + &= \left( [$trigs[0][0]] \right) \left( [$trigs[1][1]] \right) + \left( [$trigs[0][1]] \right) \left( [$trigs[1][0]] \right) \\ + &= \left( [$s1] \right) + \left( [$s2] \right) \\ + &= [$sinSum] + \end{aligned}``] + +###Calculating [` \cos(\alpha+\beta) `] + + [``\begin{aligned} + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + &= \left( [$trigs[0][1]] \right) \left( [$trigs[1][1]] \right) - \left( [$trigs[0][0]] \right) \left( [$trigs[1][0]] \right) \\ + &= \left( [$s3] \right) - \left( [$s4] \right) \\ + &= [$cosSum] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas31.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas31.pg new file mode 100644 index 0000000000..1cd7452b3e --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas31.pg @@ -0,0 +1,484 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + + + do { + do { + $height0Out = -random(1,3,1); + $height0In = list_random(1,2,3); + $hypotenuse0Out = random(int(abs($height0Out)*$height0In**2)+2,int(abs($height0Out)*$height0In**2)+10,1); + } until (gcd($height0Out,$hypotenuse0Out)==1); + $hypotenuse0In = 1; + ($base0Out,$base0In) = &radSimplify($hypotenuse0Out**2-$height0Out**2*$height0In); + } until (!($base0In==1 && $height0In==1 && $hypotenuse0In==1)) && !(($base0Out>0) && ($height0Out>0)) && ($base0In<=20); + + $base0Out = $base0Out*random(-1,1,2); + if ($base0Out*$height0Out>0) { + $Q0 = ($base0Out>0) ? "I" : "III"; + $int0 = ($base0Out>0) ? "\left(0,\frac{\pi}{2}\right)" : "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + $Q0 = ($base0Out>0) ? "IV" : "II"; + $int0 = ($base0Out>0) ? "\left(\frac{3\pi}{2},2\pi\right)" : "\left(\frac{\pi}{2},\pi\right)"; + } + +Context("LimitedRadical"); + if ($base0In==1) { + $base0 = $base0Out; + $absBase = abs($base0Out); + } elsif (abs($base0Out)==1) { + $base0 = ($base0Out>0) ? Formula("sqrt($base0In)") : Formula("-sqrt($base0In)"); + $absBase = Formula("sqrt($base0In)"); + } else { + $base0 = Formula("$base0Out*sqrt($base0In)"); + $absBase0Out = abs($base0Out); + $absBase0 = Formula("$absBase0Out*sqrt($base0In)"); + } + + if ($height0In==1) { + $height0 = $height0Out; + $absHeight0 = abs($height0Out); + } elsif (abs($height0Out)==1) { + $height0 = ($height0Out>0) ? Formula("sqrt($height0In)") : Formula("-sqrt($height0In)"); + $absHeight0 = Formula("sqrt($height0In)"); + } else { + $height0 = Formula("$height0Out*sqrt($height0In)"); + $absHeight0Out = abs($height0Out); + $absHeight0 = Formula("$absHeight0Out*sqrt($height0In)"); + } + + $hypotenuse0 = $hypotenuse0Out; + + $sine0 = &rationalize($height0Out,$height0In,$hypotenuse0Out,$hypotenuse0In); + $cosine0 = &rationalize($base0Out,$base0In,$hypotenuse0Out,$hypotenuse0In); + $tangent0 = &rationalize($height0Out,$height0In,$base0Out,$base0In); + + @trigs0 = ($sine0,$cosine0,$tangent0); + +Context("Numeric"); + +$r = 5; +$P0x = $r*$base0Out*sqrt($base0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); +$P0y = $r*$height0Out*sqrt($height0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); + +@graph = (); +$graph[0] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $P0x, $P0y, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($P0x,$P0y,red,2); +$graph[0]->lineTo($P0x,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($P0x>0) ? -0.2 : 0.2; +$yShift = ($P0y>0) ? 0.2 : -0.42; +$graph[0]->moveTo($P0x,$yShift); +$graph[0]->lineTo($P0x+$xShift,$yShift,red,2); +$graph[0]->lineTo($P0x+$xShift,0,red,2); + +$LORHeight = ($P0x>0) ? "left" : "right"; +$TOBBase = ($P0y>0) ? "top" : "bottom"; +$LORHyp = ($P0x>0) ? "right" : "left"; +$TOBHyp = ($P0y>0) ? "bottom" : "top"; +$LORShift = ($P0x>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($P0x+$LORShift,$P0y/2,"$height0",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($P0x/2,0,"$base0",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($P0x/2,$P0y/2,"$hypotenuse0",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($P0x,$P0y,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base0,$height0) and ($base0,0). The base is marked as $base0, height marked as $height0 and hypotenuse marked as $hypotenuse0."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = $triples[$in][$j]; + $int1 = "\left(\frac{\pi}{2},\pi\right)"; + $Q1 = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "III"; + $int1 = "\left(\pi,\frac{3\pi}{2}\right)"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = $triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "IV"; + $int1 = "\left(\frac{3\pi}{2},2\pi\right)"; +} +$hypotenuse1 = $triples[$in][2]; +$absBase1 = abs($base1); +$absHeight1 = abs($height1); + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs1 = ( + Fraction($height1,$hypotenuse1), + Fraction($base1,$hypotenuse1), + Fraction($height1,$base1), +); + +$r = 5; +$P1x = Fraction($r*$base1,$hypotenuse1)->reduce; +$P1y = Fraction($r*$height1,$hypotenuse1)->reduce; + +$graph[1] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +$graph[1]->stamps(closed_circle( Real($P1x), Real($P1y), red )); +$graph[1]->moveTo(0,0); +$graph[1]->lineTo(Real($P1x),Real($P1y),red,2); +$graph[1]->lineTo(Real($P1x),0,red,2); +$graph[1]->lineTo(0,0,red,2); + +$xShift = ($P1x>0) ? -0.4 : 0.4; +$yShift = ($P1y>0) ? 0.4 : -0.4; +$graph[1]->moveTo(Real($P1x),$yShift); +$graph[1]->lineTo(Real($P1x)+$xShift,$yShift,red,2); +$graph[1]->lineTo(Real($P1x)+$xShift,0,red,2); + +$LORHeight = ($P1x>0) ? "left" : "right"; +$TOBBase = ($P1y>0) ? "top" : "bottom"; +$LORHyp = ($P1x>0) ? "right" : "left"; +$TOBHyp = ($P1y>0) ? "bottom" : "top"; +$graph[1]->lb(new Label(Real($P1x),Real($P1y)/2,"$height1",'red',$LORHeight,'middle',large)); +$graph[1]->lb(new Label(Real($P1x)/2,0,"$base1",'red','center',$TOBBase,large)); +$graph[1]->lb(new Label(Real($P1x)/2,Real($P1y)/2,"$hypotenuse1",'red',$LORHyp,$TOBHyp,large)); +$graph[1]->lb(new Label(Real($P1x),Real($P1y),"P($base1,$height1)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[1] = "This is the graph of a circle with point P($base1,$height1) on the circle. A right triangle is formed at vertices (0,0), ($base1,$height1) and ($base1,0). The base is marked as $base1, height marked as $height1 and hypotenuse marked as $hypotenuse1."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + Context("LimitedFraction"); + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + Context("LimitedRadical"); + if (($numIn==0)||($numOut==0)) {return Formula("0");} + if ($d0==1) { + if ($numIn==1) {return Formula("$n0");} + elsif ($n0==1) {return Formula("sqrt($numIn)");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)");} + else {return Formula("$n0*sqrt($numIn)");} + } else { + if ($numIn==1) {return Formula("$n0/$d0");} + elsif ($n0==1) {return Formula("sqrt($numIn)/$d0");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)/$d0");} + else { + $n0N = -$n0; + return ($n0>0) ? Formula("$n0*sqrt($numIn)/$d0") : Formula("-$n0N*sqrt($numIn)/$d0"); + } + } +} + +sub calSum { + my @p = @_; + my @a = ($p[0],$p[1],$p[2]); + my @b = ($p[3],$p[4],$p[5]); + my $s = $p[6]; + my @c = ($p[7],$p[8],$p[9]); + my @d = ($p[10],$p[11],$p[12]); + + my $frac0 = Fraction($a[0]*$b[0],$a[2]*$b[2])->reduce; + my $frac1 = Fraction($c[0]*$d[0],$c[2]*$d[2])->reduce; + my $frac2 = ($s eq "+") ? ($frac0+$frac1)->reduce : ($frac0-$frac1)->reduce; + if ($a[1]==$c[1]) { + my ($n2,$d2) = $frac2->value; + + return ($a[1]==1) + ? ( Compute("$frac2"), Compute("$frac2") ) + : ( Compute("$frac2*sqrt($a[1])"), createRadical($n2,$a[1],$d2) ); + } else { + my ($n0,$d0) = $frac0->value; + my ($n1,$d1) = $frac1->value; + my $com = lcm($d0,$d1); + my $e = $n0*$com/$d0; + my $f = $n1*$com/$d1; + my $output = "("; + if ($e==1) {$output .= ($a[1]==1) ? "1" : "sqrt($a[1])";} + elsif ($e==-1) {$output .= ($a[1]==1) ? "-1" : "-\sqrt($a[1])";} + else {$output .= ($a[1]==1) ? "$e" : "$e*sqrt($a[1])";} + $fN = $f; + if ($s eq "-") { + if ($f>0) { + $output .= "-"; + } else { + $output .= "+"; + $fN = -$f; + } + } elsif ($f<0) { + $output .= "-"; + $fN = -$f; + } else { + $output .= "+"; + } + if (abs($f)==1) {$output .= ($c[1]==1) ? "1" : "sqrt($c[1])";} + else {$output .= ($c[1]==1) ? "$fN" : "$fN*sqrt($c[1])";} + $output .= ")/$com"; + my $r = ($s eq "+") ? Compute("$frac0*sqrt($a[1])+$frac1*sqrt($c[1])") : Compute("$frac0*sqrt($a[1])-$frac1*sqrt($c[1])"); + Context("LimitedRadical"); + $output = Formula("$output"); + return ( $r, $output ); + } +} + + +Context("Fraction"); + +($sineSum, $sineSumShow) = calSum( + $height0Out, $height0In, $hypotenuse0Out, #sin(\alpha) + $base1,1,$hypotenuse1, #cos(\beta) + "+", + $base0Out,$base0In,$hypotenuse0Out, #cos(alpha) + $height1,1,$hypotenuse1 #sin(beta) +); + +Context("Fraction"); + +($cosineSum, $cosineSumShow) = calSum( + $base0Out,$base0In,$hypotenuse0Out, #cos(alpha) + $base1,1,$hypotenuse1, #cos(\beta) + "-", + $height0Out, $height0In, $hypotenuse0Out, #sin(\alpha) + $height1,1,$hypotenuse1 #sin(beta) +); + + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\cos(\alpha)=[$trigs0[1]]`] and [`\alpha\in[$int0]`], +* [`\sin(\beta)=[$trigs1[0]]`] and [`\beta\in[$int1]`], + +evaluate the following. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +a) [`\sin(\alpha+\beta)=`][_____________]{$sineSum->cmp(correct_ans_latex_string=>($sineSumShow->TeX))} + +a) [`\cos(\alpha+\beta)=`][_____________]{$cosineSum->cmp(correct_ans_latex_string=>($cosineSumShow->TeX))} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = createRadical($height0Out*$base1,$height0In,$hypotenuse0*$hypotenuse1); +$s2 = createRadical($base0Out*$height1,$base0In,$hypotenuse0*$hypotenuse1); + +$s3 = createRadical($base0Out*$base1,$base0In,$hypotenuse0*$hypotenuse1); +$s4 = createRadical($height0Out*$height1,$height0In,$hypotenuse0*$hypotenuse1); + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin(\alpha+\beta)`], we will use the formula + + [`` \sin(\alpha+\beta) = \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) ``] + +[`\cos(\alpha)`] and [`\sin(\beta)`] are given. We need to find the values of [`\sin(\alpha)`] and [`\cos(\beta)`]. + +###Calculating [`\sin(\alpha)`] + +It's given that [`\cos(\alpha)=[$trigs0[1]]`] and [`\alpha\in[$int0]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse0])^2-\left([$base0]\right)^2}=[$absHeight0]`]. + +We can see [`\sin(\alpha)=[$trigs0[0]]`]. + +###Calculating [`\cos(\beta)`] + +It's given that [`\sin(\beta)=[$trigs1[0]]`] and [`\beta\in[$int1]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse1])^2-\left([$height1]\right)^2}=[$absBase1]`]. + +We can see [`\cos(\beta)=[$trigs1[1]]`]. + +###Calculating [` \sin(\alpha+\beta) `] + + [``\begin{aligned} + \sin(\alpha+\beta) &= \sin(\alpha)\cos(\beta)+\cos(\alpha)\sin(\beta) \\ + &= \left( [$trigs0[0]] \right) \left( [$trigs1[1]] \right) + \left( [$trigs0[1]] \right) \left( [$trigs1[0]] \right) \\ + &= \left( [$s1] \right) + \left( [$s2] \right) \\ + &= [$sineSumShow] + \end{aligned}``] + +###Calculating [` \cos(\alpha+\beta) `] + + [``\begin{aligned} + \cos(\alpha+\beta) &= \cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta) \\ + &= \left( [$trigs0[1]] \right) \left( [$trigs1[1]] \right) - \left( [$trigs0[0]] \right) \left( [$trigs1[0]] \right) \\ + &= \left( [$s3] \right) - \left( [$s4] \right) \\ + &= [$cosineSumShow] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas40.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas40.pg new file mode 100644 index 0000000000..d2dcaaf559 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas40.pg @@ -0,0 +1,241 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); +do {$in[1] = random(0,3,1);} until ($in[0] != $in[1]); + +@quadrant = (); +$quadrant[0] = random(2,4,1); +do {$quadrant[1] = random(2,4,1);} until ($quadrant[0] != $quadrant[1]); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@Q = (); + +for my $k (0..1) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $Q[$k] = "II"; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], + [Fraction($height[1],$hypotenuse[1]), + Fraction($base[1],$hypotenuse[1]), + Fraction($height[1],$base[1]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..1) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +$sinSum = ($trigs[0][0]*$trigs[1][1]-$trigs[0][1]*$trigs[1][0])->reduce; +$cosSum = ($trigs[0][1]*$trigs[1][1]+$trigs[0][0]*$trigs[1][0])->reduce; + + + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\sin(\alpha)=[$trigs[0][0]]`] and [`\alpha\in[$int[0]]`], +* [`\cos(\beta)=[$trigs[1][1]]`] and [`\beta\in[$int[1]]`], + +evaluate the following. + +a) [`\sin(\alpha-\beta)=`][_____________]{$sinSum} + +a) [`\cos(\alpha-\beta)=`][_____________]{$cosSum} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = ($trigs[0][0]*$trigs[1][1])->reduce; +$s2 = ($trigs[0][1]*$trigs[1][0])->reduce; +$s3 = ($trigs[0][1]*$trigs[1][1])->reduce; +$s4 = ($trigs[0][0]*$trigs[1][0])->reduce; + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin(\alpha-\beta)`], we will use the formula + + [`` \sin(\alpha-\beta) = \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) ``] + +[`\sin(\alpha)`] and [`\cos(\beta)`] are given. We need to find the values of [`\cos(\alpha)`] and [`\sin(\beta)`]. + +###Calculating [`\cos(\alpha)`] + +It's given that [`\sin(\alpha)=[$trigs[0][0]]`] and [`\alpha\in[$int[0]]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse[0]])^2-\left([$height[0]]\right)^2}=[$absBase[0]]`]. + +We can see [`\cos(\alpha)=[$trigs[0][1]]`]. + +###Calculating [`\sin(\beta)`] + +It's given that [`\cos(\beta)=[$trigs[1][1]]`] and [`\beta\in[$int[1]]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig[1] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse[1]])^2-\left([$base[1]]\right)^2}=[$absHeight[1]]`]. + +We can see [`\sin(\beta)=[$trigs[1][0]]`]. + +###Calculating [` \sin(\alpha-\beta) `] + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + &= \left( [$trigs[0][0]] \right) \left( [$trigs[1][1]] \right) - \left( [$trigs[0][1]] \right) \left( [$trigs[1][0]] \right) \\ + &= \left( [$s1] \right) - \left( [$s2] \right) \\ + &= [$sinSum] + \end{aligned}``] + +###Calculating [` \cos(\alpha-\beta) `] + + [``\begin{aligned} + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + &= \left( [$trigs[0][1]] \right) \left( [$trigs[1][1]] \right) + \left( [$trigs[0][0]] \right) \left( [$trigs[1][0]] \right) \\ + &= \left( [$s3] \right) + \left( [$s4] \right) \\ + &= [$cosSum] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas41.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas41.pg new file mode 100644 index 0000000000..09922ee69d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas41.pg @@ -0,0 +1,484 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + + + do { + do { + $height0Out = -random(1,3,1); + $height0In = list_random(1,2,3); + $hypotenuse0Out = random(int(abs($height0Out)*$height0In**2)+2,int(abs($height0Out)*$height0In**2)+10,1); + } until (gcd($height0Out,$hypotenuse0Out)==1); + $hypotenuse0In = 1; + ($base0Out,$base0In) = &radSimplify($hypotenuse0Out**2-$height0Out**2*$height0In); + } until (!($base0In==1 && $height0In==1 && $hypotenuse0In==1)) && !(($base0Out>0) && ($height0Out>0)) && ($base0In<=20); + + $base0Out = $base0Out*random(-1,1,2); + if ($base0Out*$height0Out>0) { + $Q0 = ($base0Out>0) ? "I" : "III"; + $int0 = ($base0Out>0) ? "\left(0,\frac{\pi}{2}\right)" : "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + $Q0 = ($base0Out>0) ? "IV" : "II"; + $int0 = ($base0Out>0) ? "\left(\frac{3\pi}{2},2\pi\right)" : "\left(\frac{\pi}{2},\pi\right)"; + } + +Context("LimitedRadical"); + if ($base0In==1) { + $base0 = $base0Out; + $absBase = abs($base0Out); + } elsif (abs($base0Out)==1) { + $base0 = ($base0Out>0) ? Formula("sqrt($base0In)") : Formula("-sqrt($base0In)"); + $absBase = Formula("sqrt($base0In)"); + } else { + $base0 = Formula("$base0Out*sqrt($base0In)"); + $absBase0Out = abs($base0Out); + $absBase0 = Formula("$absBase0Out*sqrt($base0In)"); + } + + if ($height0In==1) { + $height0 = $height0Out; + $absHeight0 = abs($height0Out); + } elsif (abs($height0Out)==1) { + $height0 = ($height0Out>0) ? Formula("sqrt($height0In)") : Formula("-sqrt($height0In)"); + $absHeight0 = Formula("sqrt($height0In)"); + } else { + $height0 = Formula("$height0Out*sqrt($height0In)"); + $absHeight0Out = abs($height0Out); + $absHeight0 = Formula("$absHeight0Out*sqrt($height0In)"); + } + + $hypotenuse0 = $hypotenuse0Out; + + $sine0 = &rationalize($height0Out,$height0In,$hypotenuse0Out,$hypotenuse0In); + $cosine0 = &rationalize($base0Out,$base0In,$hypotenuse0Out,$hypotenuse0In); + $tangent0 = &rationalize($height0Out,$height0In,$base0Out,$base0In); + + @trigs0 = ($sine0,$cosine0,$tangent0); + +Context("Numeric"); + +$r = 5; +$P0x = $r*$base0Out*sqrt($base0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); +$P0y = $r*$height0Out*sqrt($height0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); + +@graph = (); +$graph[0] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $P0x, $P0y, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($P0x,$P0y,red,2); +$graph[0]->lineTo($P0x,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($P0x>0) ? -0.2 : 0.2; +$yShift = ($P0y>0) ? 0.2 : -0.42; +$graph[0]->moveTo($P0x,$yShift); +$graph[0]->lineTo($P0x+$xShift,$yShift,red,2); +$graph[0]->lineTo($P0x+$xShift,0,red,2); + +$LORHeight = ($P0x>0) ? "left" : "right"; +$TOBBase = ($P0y>0) ? "top" : "bottom"; +$LORHyp = ($P0x>0) ? "right" : "left"; +$TOBHyp = ($P0y>0) ? "bottom" : "top"; +$LORShift = ($P0x>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($P0x+$LORShift,$P0y/2,"$height0",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($P0x/2,0,"$base0",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($P0x/2,$P0y/2,"$hypotenuse0",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($P0x,$P0y,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base0,$height0) and ($base0,0). The base is marked as $base0, height marked as $height0 and hypotenuse marked as $hypotenuse0."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = $triples[$in][$j]; + $int1 = "\left(\frac{\pi}{2},\pi\right)"; + $Q1 = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "III"; + $int1 = "\left(\pi,\frac{3\pi}{2}\right)"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = $triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "IV"; + $int1 = "\left(\frac{3\pi}{2},2\pi\right)"; +} +$hypotenuse1 = $triples[$in][2]; +$absBase1 = abs($base1); +$absHeight1 = abs($height1); + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs1 = ( + Fraction($height1,$hypotenuse1), + Fraction($base1,$hypotenuse1), + Fraction($height1,$base1), +); + +$r = 5; +$P1x = Fraction($r*$base1,$hypotenuse1)->reduce; +$P1y = Fraction($r*$height1,$hypotenuse1)->reduce; + +$graph[1] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +$graph[1]->stamps(closed_circle( Real($P1x), Real($P1y), red )); +$graph[1]->moveTo(0,0); +$graph[1]->lineTo(Real($P1x),Real($P1y),red,2); +$graph[1]->lineTo(Real($P1x),0,red,2); +$graph[1]->lineTo(0,0,red,2); + +$xShift = ($P1x>0) ? -0.4 : 0.4; +$yShift = ($P1y>0) ? 0.4 : -0.4; +$graph[1]->moveTo(Real($P1x),$yShift); +$graph[1]->lineTo(Real($P1x)+$xShift,$yShift,red,2); +$graph[1]->lineTo(Real($P1x)+$xShift,0,red,2); + +$LORHeight = ($P1x>0) ? "left" : "right"; +$TOBBase = ($P1y>0) ? "top" : "bottom"; +$LORHyp = ($P1x>0) ? "right" : "left"; +$TOBHyp = ($P1y>0) ? "bottom" : "top"; +$graph[1]->lb(new Label(Real($P1x),Real($P1y)/2,"$height1",'red',$LORHeight,'middle',large)); +$graph[1]->lb(new Label(Real($P1x)/2,0,"$base1",'red','center',$TOBBase,large)); +$graph[1]->lb(new Label(Real($P1x)/2,Real($P1y)/2,"$hypotenuse1",'red',$LORHyp,$TOBHyp,large)); +$graph[1]->lb(new Label(Real($P1x),Real($P1y),"P($base1,$height1)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[1] = "This is the graph of a circle with point P($base1,$height1) on the circle. A right triangle is formed at vertices (0,0), ($base1,$height1) and ($base1,0). The base is marked as $base1, height marked as $height1 and hypotenuse marked as $hypotenuse1."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + + if (sqrt($numIn)==int(sqrt($numIn))) { + $numOut = $numOut*sqrt($numIn); + $numIn = 1; + } + Context("LimitedFraction"); + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + Context("LimitedRadical"); + if (($numIn==0)||($numOut==0)) {return Formula("0");} + if ($d0==1) { + if ($numIn==1) {return Formula("$n0");} + elsif ($n0==1) {return Formula("sqrt($numIn)");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)");} + else {return Formula("$n0*sqrt($numIn)");} + } else { + if ($numIn==1) {return Formula("$n0/$d0");} + elsif ($n0==1) {return Formula("sqrt($numIn)/$d0");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)/$d0");} + else { + $n0N = -$n0; + return ($n0>0) ? Formula("$n0*sqrt($numIn)/$d0") : Formula("-$n0N*sqrt($numIn)/$d0"); + } + } +} + +sub calSum { + my @p = @_; + my @a = ($p[0],$p[1],$p[2]); + my @b = ($p[3],$p[4],$p[5]); + my $s = $p[6]; + my @c = ($p[7],$p[8],$p[9]); + my @d = ($p[10],$p[11],$p[12]); + + my $frac0 = Fraction($a[0]*$b[0],$a[2]*$b[2])->reduce; + my $frac1 = Fraction($c[0]*$d[0],$c[2]*$d[2])->reduce; + my $frac2 = ($s eq "+") ? ($frac0+$frac1)->reduce : ($frac0-$frac1)->reduce; + if ($a[1]==$c[1]) { + my ($n2,$d2) = $frac2->value; + + return ($a[1]==1) + ? ( Compute("$frac2"), Compute("$frac2") ) + : ( Compute("$frac2*sqrt($a[1])"), createRadical($n2,$a[1],$d2) ); + } else { + my ($n0,$d0) = $frac0->value; + my ($n1,$d1) = $frac1->value; + my $com = lcm($d0,$d1); + my $e = $n0*$com/$d0; + my $f = $n1*$com/$d1; + my $output = "("; + if ($e==1) {$output .= ($a[1]==1) ? "1" : "sqrt($a[1])";} + elsif ($e==-1) {$output .= ($a[1]==1) ? "-1" : "-\sqrt($a[1])";} + else {$output .= ($a[1]==1) ? "$e" : "$e*sqrt($a[1])";} + $fN = $f; + if ($s eq "-") { + if ($f>0) { + $output .= "-"; + } else { + $output .= "+"; + $fN = -$f; + } + } elsif ($f<0) { + $output .= "-"; + $fN = -$f; + } else { + $output .= "+"; + } + if (abs($f)==1) {$output .= ($c[1]==1) ? "1" : "sqrt($c[1])";} + else {$output .= ($c[1]==1) ? "$fN" : "$fN*sqrt($c[1])";} + $output .= ")/$com"; + my $r = ($s eq "+") ? Compute("$frac0*sqrt($a[1])+$frac1*sqrt($c[1])") : Compute("$frac0*sqrt($a[1])-$frac1*sqrt($c[1])"); + Context("LimitedRadical"); + $output = Formula("$output"); + return ( $r, $output ); + } +} + + +Context("Fraction"); + +($sineSum, $sineSumShow) = calSum( + $height0Out, $height0In, $hypotenuse0Out, #sin(\alpha) + $base1,1,$hypotenuse1, #cos(\beta) + "-", + $base0Out,$base0In,$hypotenuse0Out, #cos(alpha) + $height1,1,$hypotenuse1 #sin(beta) +); + +Context("Fraction"); + +($cosineSum, $cosineSumShow) = calSum( + $base0Out,$base0In,$hypotenuse0Out, #cos(alpha) + $base1,1,$hypotenuse1, #cos(\beta) + "+", + $height0Out, $height0In, $hypotenuse0Out, #sin(\alpha) + $height1,1,$hypotenuse1 #sin(beta) +); + + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\cos(\alpha)=[$trigs0[1]]`] and [`\alpha\in[$int0]`], +* [`\sin(\beta)=[$trigs1[0]]`] and [`\beta\in[$int1]`], + +evaluate the following. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +a) [`\sin(\alpha-\beta)=`][_____________]{$sineSum->cmp(correct_ans_latex_string=>($sineSumShow->TeX))} + +a) [`\cos(\alpha-\beta)=`][_____________]{$cosineSum->cmp(correct_ans_latex_string=>($cosineSumShow->TeX))} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = createRadical($height0Out*$base1,$height0In,$hypotenuse0*$hypotenuse1); +$s2 = createRadical($base0Out*$height1,$base0In,$hypotenuse0*$hypotenuse1); + +$s3 = createRadical($base0Out*$base1,$base0In,$hypotenuse0*$hypotenuse1); +$s4 = createRadical($height0Out*$height1,$height0In,$hypotenuse0*$hypotenuse1); + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\sin(\alpha-\beta)`], we will use the formula + + [`` \sin(\alpha-\beta) = \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) ``] + +[`\cos(\alpha)`] and [`\sin(\beta)`] are given. We need to find the values of [`\sin(\alpha)`] and [`\cos(\beta)`]. + +###Calculating [`\sin(\alpha)`] + +It's given that [`\cos(\alpha)=[$trigs0[1]]`] and [`\alpha\in[$int0]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse0])^2-\left([$base0]\right)^2}=[$absHeight0]`]. + +We can see [`\sin(\alpha)=[$trigs0[0]]`]. + +###Calculating [`\cos(\beta)`] + +It's given that [`\sin(\beta)=[$trigs1[0]]`] and [`\beta\in[$int1]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse1])^2-\left([$height1]\right)^2}=[$absBase1]`]. + +We can see [`\cos(\beta)=[$trigs1[1]]`]. + +###Calculating [` \sin(\alpha-\beta) `] + + [``\begin{aligned} + \sin(\alpha-\beta) &= \sin(\alpha)\cos(\beta)-\cos(\alpha)\sin(\beta) \\ + &= \left( [$trigs0[0]] \right) \left( [$trigs1[1]] \right) - \left( [$trigs0[1]] \right) \left( [$trigs1[0]] \right) \\ + &= \left( [$s1] \right) - \left( [$s2] \right) \\ + &= [$sineSumShow] + \end{aligned}``] + +###Calculating [` \cos(\alpha-\beta) `] + + [``\begin{aligned} + \cos(\alpha-\beta) &= \cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta) \\ + &= \left( [$trigs0[1]] \right) \left( [$trigs1[1]] \right) + \left( [$trigs0[0]] \right) \left( [$trigs1[0]] \right) \\ + &= \left( [$s3] \right) + \left( [$s4] \right) \\ + &= [$cosineSumShow] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas50.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas50.pg new file mode 100644 index 0000000000..dedc3faa81 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas50.pg @@ -0,0 +1,241 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +@in = (); +$in[0] = random(0,3,1); +do {$in[1] = random(0,3,1);} until ($in[0] != $in[1]); + +@quadrant = (); +$quadrant[0] = random(2,4,1); +do {$quadrant[1] = random(2,4,1);} until ($quadrant[0] != $quadrant[1]); + +@base = (); +@absBase = (); +@height = (); +@absHeight = (); +@hypotenuse = (); +@int = (); +@Q = (); + +for my $k (0..1) { + if ($quadrant[$k]==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = $triples[$in[$k]][$j]; + $int[$k] = "\left(\frac{\pi}{2},\pi\right)"; + $Q[$k] = "II"; + } elsif ($quadrant[$k]==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = -$triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "III"; + $int[$k] = "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base[$k] = $triples[$in[$k]][$i]; + $height[$k] = -$triples[$in[$k]][$j]; + $Q[$k] = "IV"; + $int[$k] = "\left(\frac{3\pi}{2},2\pi\right)"; + } + $hypotenuse[$k] = $triples[$in[$k]][2]; + $absBase[$k] = abs($base[$k]); + $absHeight[$k] = abs($height[$k]); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs = ( + [Fraction($height[0],$hypotenuse[0]), + Fraction($base[0],$hypotenuse[0]), + Fraction($height[0],$base[0]) + ], + [Fraction($height[1],$hypotenuse[1]), + Fraction($base[1],$hypotenuse[1]), + Fraction($height[1],$base[1]) + ], +); + +$r = 5; +@Px = (); +@Py = (); +@graph = (); +@fig = (); + +for my $i (0..1) { + $Px[$i] = Fraction($r*$base[$i],$hypotenuse[$i])->reduce; + $Py[$i] = Fraction($r*$height[$i],$hypotenuse[$i])->reduce; + + $graph[$i] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i]->stamps(closed_circle( Real($Px[$i]), Real($Py[$i]), red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo(Real($Px[$i]),Real($Py[$i]),red,2); + $graph[$i]->lineTo(Real($Px[$i]),0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo(Real($Px[$i]),$yShift); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,$yShift,red,2); + $graph[$i]->lineTo(Real($Px[$i])+$xShift,0,red,2); + + $LORHeight = ($Px[$i]>0) ? "left" : "right"; + $TOBBase = ($Py[$i]>0) ? "top" : "bottom"; + $LORHyp = ($Px[$i]>0) ? "right" : "left"; + $TOBHyp = ($Py[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i])/2,"$height[$i]",'red',$LORHeight,'middle',large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,0,"$base[$i]",'red','center',$TOBBase,large)); + $graph[$i]->lb(new Label(Real($Px[$i])/2,Real($Py[$i])/2,"$hypotenuse[$i]",'red',$LORHyp,$TOBHyp,large)); + $graph[$i]->lb(new Label(Real($Px[$i]),Real($Py[$i]),"P($base[$i],$height[$i])",'red',$LORHeight,$TOBHyp,large)); + + $alt[$i] = "This is the graph of a circle with point P($base[$i],$height[$i]) on the circle. A right triangle is formed at vertices (0,0), ($base[$i],$height[$i]) and ($base[$i],0). The base is marked as $base[$i], height marked as $height[$i] and hypotenuse marked as $hypotenuse[$i]."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); + +} + +$tanSum = (($trigs[0][2]+$trigs[1][2])/(1-$trigs[0][2]*$trigs[1][2]))->reduce; +$tanDif = (($trigs[0][2]-$trigs[1][2])/(1+$trigs[0][2]*$trigs[1][2]))->reduce; + + + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\cos(\alpha)=[$trigs[0][1]]`] and [`\alpha\in[$int[0]]`], +* [`\sin(\beta)=[$trigs[1][0]]`] and [`\beta\in[$int[1]]`], + +evaluate the following. + +a) [`\tan(\alpha+\beta)=`][_____________]{$tanSum} + +a) [`\tan(\alpha-\beta)=`][_____________]{$tanDif} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + +$s1 = ($trigs[0][2]+$trigs[1][2])->reduce; +$s2 = (1-$trigs[0][2]*$trigs[1][2])->reduce; +$s3 = ($trigs[0][2]-$trigs[1][2])->reduce; +$s4 = (1+$trigs[0][2]*$trigs[1][2])->reduce; + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\tan(\alpha+\beta)`], we will use the formula + + [`` \tan(\alpha+\beta) = \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\alpha)} ``] + +[`\sin(\alpha)`] and [`\cos(\beta)`] are given. We need to find the values of [`\tan(\alpha)`] and [`\tan(\beta)`]. + +###Calculating [`\tan(\alpha)`] + +It's given that [`\cos(\alpha)=[$trigs[0][1]]`] and [`\alpha\in[$int[0]]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse[0]])^2-\left([$base[0]]\right)^2}=[$absHeight[0]]`]. + +We can see [`\tan(\alpha)=[$trigs[0][2]]`]. + +###Calculating [`\tan(\beta)`] + +It's given that [`\sin(\beta)=[$trigs[1][0]]`] and [`\beta\in[$int[1]]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig[1] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse[1]])^2-\left([$height[1]]\right)^2}=[$absBase[1]]`]. + +We can see [`\tan(\beta)=[$trigs[1][2]]`]. + +###Calculating [` \tan(\alpha+\beta) `] + + [``\begin{aligned} + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\alpha)} \\ + &= \frac{([$trigs[0][2]])+([$trigs[1][2]])}{1-\left([$trigs[0][2]]\right)\cdot\left([$trigs[1][2]]\right)} \\ + &= \frac{[$s1]}{[$s2]} \\ + &= [$tanSum] + \end{aligned}``] + +###Calculating [` \tan(\alpha-\beta) `] + + [``\begin{aligned} + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\alpha)} \\ + &= \frac{([$trigs[0][2]])-([$trigs[1][2]])}{1+\left([$trigs[0][2]]\right)\cdot\left([$trigs[1][2]]\right)} \\ + &= \frac{[$s3]}{[$s4]} \\ + &= [$tanDif] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas51.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas51.pg new file mode 100644 index 0000000000..5d77b60d67 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas51.pg @@ -0,0 +1,540 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + + + do { + do { + $height0Out = -random(1,3,1); + $height0In = list_random(1,2,3); + $hypotenuse0Out = random(int(abs($height0Out)*$height0In**2)+2,int(abs($height0Out)*$height0In**2)+10,1); + } until (gcd($height0Out,$hypotenuse0Out)==1); + $hypotenuse0In = 1; + ($base0Out,$base0In) = &radSimplify($hypotenuse0Out**2-$height0Out**2*$height0In); + ($out,$in) = &radSimplify(abs($height0In*$base0In)); + } until + (!($base0In==1 && $height0In==1 && $hypotenuse0In==1)) + && !(($base0Out>0) + && ($height0Out>0)) + && ($in<=5) + && (sqrt($height0In*$base0In) != int(sqrt($height0In*$base0In))); + + $base0Out = $base0Out*random(-1,1,2); + if ($base0Out*$height0Out>0) { + $Q0 = ($base0Out>0) ? "I" : "III"; + $int0 = ($base0Out>0) ? "\left(0,\frac{\pi}{2}\right)" : "\left(\pi,\frac{3\pi}{2}\right)"; + } else { + $Q0 = ($base0Out>0) ? "IV" : "II"; + $int0 = ($base0Out>0) ? "\left(\frac{3\pi}{2},2\pi\right)" : "\left(\frac{\pi}{2},\pi\right)"; + } + +Context("LimitedRadical"); + if ($base0In==1) { + $base0 = $base0Out; + $absBase = abs($base0Out); + } elsif (abs($base0Out)==1) { + $base0 = ($base0Out>0) ? Formula("sqrt($base0In)") : Formula("-sqrt($base0In)"); + $absBase = Formula("sqrt($base0In)"); + } else { + $base0 = Formula("$base0Out*sqrt($base0In)"); + $absBase0Out = abs($base0Out); + $absBase0 = Formula("$absBase0Out*sqrt($base0In)"); + } + + if ($height0In==1) { + $height0 = $height0Out; + $absHeight0 = abs($height0Out); + } elsif (abs($height0Out)==1) { + $height0 = ($height0Out>0) ? Formula("sqrt($height0In)") : Formula("-sqrt($height0In)"); + $absHeight0 = Formula("sqrt($height0In)"); + } else { + $height0 = Formula("$height0Out*sqrt($height0In)"); + $absHeight0Out = abs($height0Out); + $absHeight0 = Formula("$absHeight0Out*sqrt($height0In)"); + } + + $hypotenuse0 = $hypotenuse0Out; + + $sine0 = &rationalize($height0Out,$height0In,$hypotenuse0Out,$hypotenuse0In); + $cosine0 = &rationalize($base0Out,$base0In,$hypotenuse0Out,$hypotenuse0In); + $tangent0 = &rationalize($height0Out,$height0In,$base0Out,$base0In); + + @trigs0 = ($sine0,$cosine0,$tangent0); + +Context("Numeric"); + +$r = 5; +$P0x = $r*$base0Out*sqrt($base0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); +$P0y = $r*$height0Out*sqrt($height0In)/($hypotenuse0Out*sqrt($hypotenuse0In)); + +@graph = (); +$graph[0] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $P0x, $P0y, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($P0x,$P0y,red,2); +$graph[0]->lineTo($P0x,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($P0x>0) ? -0.2 : 0.2; +$yShift = ($P0y>0) ? 0.2 : -0.42; +$graph[0]->moveTo($P0x,$yShift); +$graph[0]->lineTo($P0x+$xShift,$yShift,red,2); +$graph[0]->lineTo($P0x+$xShift,0,red,2); + +$LORHeight = ($P0x>0) ? "left" : "right"; +$TOBBase = ($P0y>0) ? "top" : "bottom"; +$LORHyp = ($P0x>0) ? "right" : "left"; +$TOBHyp = ($P0y>0) ? "bottom" : "top"; +$LORShift = ($P0x>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($P0x+$LORShift,$P0y/2,"$height0",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($P0x/2,0,"$base0",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($P0x/2,$P0y/2,"$hypotenuse0",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($P0x,$P0y,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base0,$height0) and ($base0,0). The base is marked as $base0, height marked as $height0 and hypotenuse marked as $hypotenuse0."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], +); +$in = 0; + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = $triples[$in][$j]; + $int1 = "\left(\frac{\pi}{2},\pi\right)"; + $Q1 = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = -$triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "III"; + $int1 = "\left(\pi,\frac{3\pi}{2}\right)"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base1 = $triples[$in][$i]; + $height1 = -$triples[$in][$j]; + $Q1 = "IV"; + $int1 = "\left(\frac{3\pi}{2},2\pi\right)"; +} +$hypotenuse1 = $triples[$in][2]; +$absBase1 = abs($base1); +$absHeight1 = abs($height1); + +#sine, cosine, tangent, cosecant, secant cotangent +@trigs1 = ( + Fraction($height1,$hypotenuse1), + Fraction($base1,$hypotenuse1), + Fraction($height1,$base1), +); + +$r = 5; +$P1x = Fraction($r*$base1,$hypotenuse1)->reduce; +$P1y = Fraction($r*$height1,$hypotenuse1)->reduce; + +$graph[1] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +$graph[1]->stamps(closed_circle( Real($P1x), Real($P1y), red )); +$graph[1]->moveTo(0,0); +$graph[1]->lineTo(Real($P1x),Real($P1y),red,2); +$graph[1]->lineTo(Real($P1x),0,red,2); +$graph[1]->lineTo(0,0,red,2); + +$xShift = ($P1x>0) ? -0.4 : 0.4; +$yShift = ($P1y>0) ? 0.4 : -0.4; +$graph[1]->moveTo(Real($P1x),$yShift); +$graph[1]->lineTo(Real($P1x)+$xShift,$yShift,red,2); +$graph[1]->lineTo(Real($P1x)+$xShift,0,red,2); + +$LORHeight = ($P1x>0) ? "left" : "right"; +$TOBBase = ($P1y>0) ? "top" : "bottom"; +$LORHyp = ($P1x>0) ? "right" : "left"; +$TOBHyp = ($P1y>0) ? "bottom" : "top"; +$graph[1]->lb(new Label(Real($P1x),Real($P1y)/2,"$height1",'red',$LORHeight,'middle',large)); +$graph[1]->lb(new Label(Real($P1x)/2,0,"$base1",'red','center',$TOBBase,large)); +$graph[1]->lb(new Label(Real($P1x)/2,Real($P1y)/2,"$hypotenuse1",'red',$LORHyp,$TOBHyp,large)); +$graph[1]->lb(new Label(Real($P1x),Real($P1y),"P($base1,$height1)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[1] = "This is the graph of a circle with point P($base1,$height1) on the circle. A right triangle is formed at vertices (0,0), ($base1,$height1) and ($base1,0). The base is marked as $base1, height marked as $height1 and hypotenuse marked as $hypotenuse1."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is ($num,$in1,$den) in $num*sqrt($in1)/$den +sub tanNums { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + return ($num,$in1,$den); +} + +sub produceLine0 { + my $s = shift; + my $line0Num = $trigs0[2]->TeX; + my ($tan0Out,$tan0In,$tan0Den) = &tanNums($height0Out,$height0In,$base0Out,$base0In); + + my $numS0 = ""; + my $tN = (-$trigs1[2])->reduce; + if ($s eq "+") { + $numS0 = ($trigs1[2]>0) ? "+".$trigs1[2]->TeX : "-".$tN->TeX; + } else { + $numS0 = ($trigs1[2]>0) ? "-".$trigs1[2]->TeX : "+".$tN->TeX; + } + $line0Num .= $numS0; + + $line0Den = ""; + Context("Fraction"); + my ($num1,$den1) = Fraction($tan0Out*$height1,$tan0Den*$base1)->reduce->value; + $line0Den .= "1"; + $s1 = ($s eq "+") ? "-" : "+"; + if ($num1>0) { + if ($num1==1) {$line0Den .= "$s1\frac{\sqrt{$tan0In}}";} + else {$line0Den .= "$s1\frac{$num1\sqrt{$tan0In}}";} + } else { + if ($num1==-1) {$line0Den .= "$s\frac{\sqrt{$tan0In}}";} + else { + $num1N = -$num1; + $line0Den .= "$s\frac{$num1N\sqrt{$tan0In}}"; + } + } + $line0Den .= "{$den1}"; + return ( + $line0Num, + $line0Den, + $tan0In, + Fraction($tan0Out,$tan0Den), + Fraction($height1,$base1), + Fraction($num1,$den1) + ); +} + +sub produceLine1 { + my ($lineNum,$lineDen,$f1,$f2,$f3) = @_; + my ($f1n,$f1d) = $f1->value; + my ($f2n,$f2d) = $f2->value; + my ($f3n,$f3d) = $f3->value; + + my $com = lcm(lcm($f1d,$f2d),$f3d); + $r = "\frac{\left(".$lineNum."\right)\cdot$com}{\left(".$lineDen."\right)\cdot$com}"; + return ($r,$com); +} + +sub produceLine2 { + my ($f1,$f2,$f3,$sq,$com,$s) = @_; + my ($f1n,$f1d) = $f1->value; + my ($f2n,$f2d) = $f2->value; + my ($f3n,$f3d) = $f3->value; + + my $lineNum = ""; + my $a = $com/$f1d*$f1n; + my $b = $com/$f2d*$f2n; + my $sN = ($s eq "+") ? "-" : "+"; + my $bN = -$b; + if (abs($a)!=1) { + $lineNum .= ($b>0) ? "$a\sqrt{$sq}$s$b" : "$a\sqrt{$sq}$sN$bN"; + } else { + $lineNum .= ($a==1) ? "\sqrt{$sq}$s$b" : "-\sqrt{$sq}$sN$bN"; + } + my $lineDen = ""; + my $c = $com/$f3d*$f3n; + my $cN = -$c; + if (abs($c)!=1) { + $lineDen .= ($c>0) ? "$com$sN$c\sqrt{$sq}" : "$com$s$cN\sqrt{$sq}"; + } else { + $lineDen .= ($c==1) ? "$com$sN\sqrt{$sq}" : "$com$s\sqrt{$sq}"; + } + return ($lineNum,$lineDen,$a,$b,$com,$c); +} + +sub produceLine3 { + my ($num,$den,$c,$d,$sq,$s) = @_; + my $sN = ($s eq "+") ? "-" : "+"; + my $conj = ""; + + if (abs($d)==1) { + $conj = ($d>0) ? "\left($c$s\sqrt{$sq}\right)" : "\left($c$sN\sqrt{$sq}\right)"; + } else { + $dN = -$d; + $conj = ($d>0) ? "\left($c$s$d\sqrt{$sq}\right)" : "\left($c$sN$dN\sqrt{$sq}\right)"; + } + return "\frac{\left($num\right)\cdot$conj}{\left($den\right)\cdot$conj}"; +} + +sub produceLine4 { + my ($a,$b,$c,$d,$sq,$s) = @_; + my $g = ($c)**2-($d)**2*$sq; + my $e = $a*$d*$sq+$b*$c; + my $f = $a*$c+$b*$d; + if ($s ne "+") {$e=-$e;} + my $r = "\frac{$e+$f\sqrt{$sq}}{$g}"; + if ($g<0) { + $gN = -$g; $eN = -$e; $fN = -$fN; + $r .= "\\ &= \frac{$e+$f\sqrt{$sq}}{$g}"; + } + my $com = gcd($g,gcd($e,$f)); + my $h = $e/$com; + my $i = $f/$com; + my $j = $g/$com; + my $reducedNum = ""; + if ($com!=1) { + if (abs($i)==1) { + $reducedNum = ($i>0) ? "$h+\sqrt{$sq}" : "$h-\sqrt{$sq}"; + $r .= "\\ &= \frac{$com\left($reducedNum\right)}{$g}"; + } else { + $reducedNum = ($i>0) ? "$h+$i\sqrt{$sq}" : "$h$i\sqrt{$sq}"; + $r .= "\\ &= \frac{$com\left($reducedNum\right)}{$g}"; + } + $r .= "\\ &= \frac{$reducedNum}{$j}"; + } + Context("Numeric"); + my $ans = Compute("($h+$i*sqrt($sq))/$j"); + Context("LimitedRadical"); + my $ansShow = Formula("($h+$i*sqrt($sq))/$j"); + return ($r,$ans,$ansShow); +} + +($line0Num,$line0Den,$sq,$frac1,$frac2,$frac3) = produceLine0("+"); +$line0 = "\frac{".$line0Num."}{".$line0Den."}"; +($line1,$com) = produceLine1($line0Num,$line0Den,$frac1,$frac2,$frac3); +($line2Num,$line2Den,$a,$b,$c,$d) = produceLine2($frac1,$frac2,$frac3,$sq,$com,"+"); +$line2 = "\frac{".$line2Num."}{".$line2Den."}"; +$line3 = produceLine3($line2Num,$line2Den,$c,$d,$sq,"+"); +($line4,$tanSum,$tanSumShow) = produceLine4($a,$b,$c,$d,$sq,"+"); + +($line10Num,$line10Den,$sq,$frac1,$frac2,$frac3) = produceLine0("-"); +$line10 = "\frac{".$line10Num."}{".$line10Den."}"; +($line11,$com) = produceLine1($line10Num,$line10Den,$frac1,$frac2,$frac3); +($line12Num,$line12Den,$a,$b,$c,$d) = produceLine2($frac1,$frac2,$frac3,$sq,$com,"-"); +$line12 = "\frac{".$line12Num."}{".$line12Den."}"; +$line13 = produceLine3($line12Num,$line12Den,$c,$d,$sq,"-"); +($line14,$tanDif,$tanDifShow) = produceLine4($a,$b,$c,$d,$sq,"-"); + +############################################################## + +BEGIN_PGML + +If it's given that + +* [`\sin(\alpha)=[$trigs0[0]]`] and [`\alpha\in[$int0]`], +* [`\cos(\beta)=[$trigs1[1]]`] and [`\beta\in[$int1]`], + +evaluate the following. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +a) [`\tan(\alpha+\beta)=`][_____________]{$tanSum->cmp(correct_ans_latex_string=>($tanSumShow->TeX))} + +a) [`\tan(\alpha-\beta)=`][_____________]{$tanDif->cmp(correct_ans_latex_string=>($tanDifShow->TeX))} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + + +############################################################## + +BEGIN_PGML_SOLUTION + +To calculate [`\tan(\alpha+\beta)`], we will use the formula + + [`` \tan(\alpha+\beta) = \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\alpha)} ``] + +[`\sin(\alpha)`] and [`\cos(\beta)`] are given. We need to find the values of [`\tan(\alpha)`] and [`\tan(\beta)`]. + +###Calculating [`\tan(\alpha)`] + +It's given that [`\sin(\alpha)=[$trigs0[0]]`] and [`\alpha\in[$int0]`]. We can sketch [`\alpha`] in a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse0])^2-\left([$height0]\right)^2}=[$absBase0]`]. + +We can see [`\tan(\alpha)=\frac{[$height0]}{[$base0]}=[$trigs0[2]]`]. + +###Calculating [`\tan(\beta)`] + +It's given that [`\cos(\beta)=[$trigs1[1]]`] and [`\beta\in[$int1]`]. We can sketch [`\beta`] in a non-Unit Circle: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse1])^2-\left([$base1]\right)^2}=[$absHeight1]`]. + +We can see [`\tan(\beta)=[$trigs1[2]]`]. + +###Calculating [` \tan(\alpha+\beta) `] + + [``\begin{aligned} + \tan(\alpha+\beta) &= \frac{\tan(\alpha)+\tan(\beta)}{1-\tan(\alpha)\tan(\alpha)} \\ + &= \frac{\left([$trigs0[2]]\right)+\left([$trigs1[2]]\right)}{1-\left([$trigs0[2]]\right)\left([$trigs1[2]]\right)} \\ + &= [$line0] \\ + &= [$line1] \\ + &= [$line2] \\ + &= [$line3] \\ + &= [$line4] + \end{aligned}``] + +###Calculating [` \tan(\alpha-\beta) `] + + [``\begin{aligned} + \tan(\alpha-\beta) &= \frac{\tan(\alpha)-\tan(\beta)}{1+\tan(\alpha)\tan(\alpha)} \\ + &= \frac{\left([$trigs0[2]]\right)-\left([$trigs1[2]]\right)}{1+\left([$trigs0[2]]\right)\left([$trigs1[2]]\right)} \\ + &= [$line10] \\ + &= [$line11] \\ + &= [$line12] \\ + &= [$line13] \\ + &= [$line14] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas60.pg b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas60.pg new file mode 100644 index 0000000000..e956866f20 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/AngleFormulas/SumDifferenceFormulas60.pg @@ -0,0 +1,116 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +@a = (pi/2,pi,3*pi/2,2*pi); +@aD = (Formula("pi/2"),Formula("pi"),Formula("3*pi/2"),Formula("2*pi")); + +$in = random(0,3,1); + +if (random(0,1,1)==0) { + $e00 = Compute("x"); + $e01 = list_random("+","-"); + $e02 = $aD[$in]; +} else { + $e00 = $aD[$in]; + $e01 = list_random("+","-"); + $e02 = Compute("x"); +} + +$e10 = $e02; +$e11 = ($e01 eq "+") ? "-" : "+"; +$e12 = $e00; + +$s00 = Compute("sin($e00)")->reduce; +$s01 = Compute("cos($e02)")->reduce; +$s02 = Compute("cos($e00)")->reduce; +$s03 = Compute("sin($e02)")->reduce; + +if ($e01 eq "+") { + $line00 = Compute("sin($e00)*cos($e02)+cos($e00)*sin($e02)"); + $line01 = Formula("($s00)*($s01)+($s02)*($s03)"); + $ans0 = Compute("$s00*$s01+$s02*$s03")->reduce; + + $line10 = Compute("cos($e00)*cos($e02)+sin($e00)*sin($e02)"); + $line11 = Formula("($s02)*($s01)+($s00)*($s03)"); + $ans1 = Compute("$s02*$s01+$s00*$s03")->reduce; +} else { + $line00 = Compute("sin($e00)*cos($e02)-cos($e00)*sin($e02)"); + $line01 = Formula("($s00)*($s01)-($s02)*($s03)"); + $ans0 = Compute("$s00*$s01-$s02*$s03")->reduce; + + $line10 = Compute("cos($e00)*cos($e02)-sin($e00)*sin($e02)"); + $line11 = Formula("($s02)*($s01)-($s00)*($s03)"); + $ans1 = Compute("$s02*$s01-$s00*$s03")->reduce; +} + + + +############################################## + +BEGIN_PGML + +Without using a calculator, use sum and difference formulas to simplify the following expression. + +a) [`` \sin\left([$e00][$e01][$e02]\right) = ``][_________]{$ans0} + +a) [`` \cos\left([$e10][$e11][$e12]\right) = ``][_________]{$ans1} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +###Part a + + [``\begin{aligned} + \sin\left([$e00][$e01][$e02]\right) + &= [$line00] \\ + &= [$line01] \\ + &= [$ans0] + \end{aligned}``] + +###Part b + + [``\begin{aligned} + \cos\left([$e10][$e11][$e12]\right) + &= [$line10] \\ + &= [$line11] \\ + &= [$ans1] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse10.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse10.pg new file mode 100644 index 0000000000..76b39835f0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse10.pg @@ -0,0 +1,214 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +do { + $hypotenuse = random(10,25,1); + $alpha = random(20,70,1); + $alphaRadian = $alpha*pi/180; + $base = sin($alphaRadian)*$hypotenuse; + $height = cos($alphaRadian)*$hypotenuse; +} until ( ($height<17) && ($base<17) ); +$base = int($base); +$alpha = Compute(arcsin($base/$hypotenuse)*180/pi); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = list_random(0..3); + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$base,'black','center','middle')); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuse,'black','center','middle')); + +$picture->lb( new Label($labelAx[$corner]+2*cos($theta), $labelAy[$corner]+2*sin($theta),"x",'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = 0.5; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x. The length of the side opposite to the given acute angle is marked as $base; the length of the side opposite to the right angle is marked as $hypotenuse."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Find the value of [`x`] in degrees. Round your answer to at least two decimal places. + + [`x=`][___________]{$alpha}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the side marked as [`[$hypotenuse]`] is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$base]`] is the "opposite leg" of the unknown angle, because it is opposite to the angle. + +Since we need to relate the hypotenuse and the angle's opposite leg, we choose to use the sine function. + +To find the unknown angle's measure, we need to use the inverse sine function. Don't forget to change your calculator's mode to "degree". + +The solution is: + + [`` +\begin{aligned} + \sin{x} &= \frac{[$base]}{[$hypotenuse]} \\ + x &= \sin^{-1}\left(\frac{[$base]}{[$hypotenuse]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse20.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse20.pg new file mode 100644 index 0000000000..6d8f64aa8c --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse20.pg @@ -0,0 +1,213 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +do { + $hypotenuse = random(10,25,1); + $alpha = random(20,70,1); + $alphaRadian = $alpha*pi/180; + $base = sin($alphaRadian)*$hypotenuse; + $height = cos($alphaRadian)*$hypotenuse; +} until ( ($height<17) && ($base<17) ); +$height = int($height); +$alpha = Compute(arccos($height/$hypotenuse)*180/pi); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = list_random(0..3); + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + +$picture->lb( new Label($labelAx[$corner]+2*cos($theta), $labelAy[$corner]+2*sin($theta),"x",'black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$height,'black','center','middle')); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuse,'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = 0.5; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x. The length of the side adjacent to the given acute angle is marked as $height; the length of the side opposite to the right angle is marked as $hypotenuse."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Find the value of [`x`] in degrees. Round your answer to at least two decimal places. + + [`x=`][___________]{$alpha}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the side marked as [`[$hypotenuse]`] is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$height]`] is the "adjacent leg" of angle [`x`], because it is *not* opposite to the angle. + +Since we need to relate the hypotenuse and the angle's adjacent leg, we choose to use the cosine function. + +To find the unknown angle's measure, we need to use the inverse cosine function. Don't forget to change your calculator's mode to "degree". + +The solution is: + + [`` +\begin{aligned} + \cos(x) &= \frac{[$height]}{[$hypotenuse]} \\ + x &= \cos^{-1}\left(\frac{[$height]}{[$hypotenuse]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse30.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse30.pg new file mode 100644 index 0000000000..2e98bbbbab --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse30.pg @@ -0,0 +1,215 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$xmin = 0; #The viewing window +$xmax = 20; +$ymin = 0; +$ymax = 20; + +do { + $height = random(5,17,1); + $alpha = random(20,70,1); + $alphaRadian = $alpha*pi/180; + $base = tan($alphaRadian)*$height; + $hypotenuse = $height/cos($alphaRadian); +} until ($base<17); +$base = int($base); +$alpha = Compute(arctan($base/$height)*180/pi); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = list_random(0..3); + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + +$picture->lb( new Label($labelAx[$corner]+2*cos($theta), $labelAy[$corner]+2*sin($theta),"x",'black','center','middle')); + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$base,'black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$height,'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = 0.5; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x. The length of the side opposite to the given acute angle is marked as $base; the length of the side adjacent to the given acute angle is marked as $height."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Find the value of [`x`] in degrees. Round your answer to at least two decimal places. + + [`x=`][___________]{$alpha}[`^{\circ}`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the unmarked side is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$base]`] is the "opposite leg" of the angle marked as x, because it is opposite to the angle. + +The side marked as [`[$height]`] is the "adjacent leg" of the angle marked as x, because it is *not* opposite to the angle. + +Since we need to relate the angle's opposite and adjacent legs, we choose to use the tangent function. + +To find the unknown angle's measure, we need to use the inverse tangent function. Don't forget to change your calculator's mode to "degree". + +The solution is: + + [`` +\begin{aligned} + \tan{x} &= \frac{[$base]}{[$height]} \\ + x &= \tan^{-1}\left(\frac{[$base]}{[$height]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse40.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse40.pg new file mode 100644 index 0000000000..43a9028af7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse40.pg @@ -0,0 +1,231 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$xmin = 0; #The viewing window +$xmax = 10; +$ymin = 0; +$ymax = 10; + +do { + $hypotenuse = random(6,15,0.1); + $alpha = random(10,25,1); + $alphaRadian = $alpha*pi/180; + $base = sin($alphaRadian)*$hypotenuse; + $height = cos($alphaRadian)*$hypotenuse; +} until ( ($height<8) ); +$base = int($base); +$alpha = Compute(arcsin($base/$hypotenuse)*180/pi); + +$hypotenuseU = NumberWithUnits("$hypotenuse km"); +$baseU = NumberWithUnits("$base km"); +$heightU = NumberWithUnits("$height km"); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = 3; + +if (($corner==0)||($corner==2)) { + @x = (($xmax-$base)/2,($xmax+$base)/2); + @y = (($ymax-$height)/2,($ymax+$height)/2); +} else { + @y = (($xmax-$base)/2,($xmax+$base)/2); + @x = (($ymax-$height)/2,($ymax+$height)/2); +} + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = 0.5; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; + + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + + +$picture->lb( new Label($labelAx[$corner]+1.5*cos($theta), $labelAy[$corner]+1.5*sin($theta),"x",'black','center','middle')); + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner], $baseU,'black','center','middle')); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuseU,'black','center','middle')); + +$picture->stamps( closed_circle($x[0],$y[0],'red') ); +$picture->lb( new Label($x[0]-0.5*$labelAdjust,$y[0]-0.5*$labelAdjust,'Town A','red','center','middle')); +$picture->stamps( closed_circle($x[1],$y[1],'red') ); +$picture->lb( new Label($x[1]+0.5*$labelAdjust,$y[1]+0.5*$labelAdjust,'Town B','red','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = 0.25; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "This is a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x, and the vertex of this angle is labeled as Town A. The vertex of the acute angle at the $bPosition is labeled as Town B. The length of the side opposite to the given acute angle is marked as $baseU; the length of the side opposite to the right angle is marked as $hypotenuseU."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A straight road connects two towns, which are built on a slope. The road's distance is [`[$hypotenuseU]`]. The difference in those two towns' elevation (vertical distance) is [`[$baseU]`]. + +The slope's elevation is [___________]{$alpha} degrees. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the slope's elevation is [`x`] degrees. The following graph can represent this situation: + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +This has become a right triangle trigonometry problem. + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the side marked as [`[$hypotenuseU]`] is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$baseU]`] is the "opposite leg" of the angle marked as x, because it is opposite to the angle. + +Since we need to relate the hypotenuse and the angle's opposite leg, we choose to use the sine function. + +To find the unknown angle's measure, we need to use the inverse sine function. Don't forget to change your calculator's mode to "degree". + +The solution is: + + [`` +\begin{aligned} + \sin{x} &= \frac{[$base]}{[$hypotenuse]} \\ + x &= \sin^{-1}\left(\frac{[$base]}{[$hypotenuse]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +The slope's elevation is [`[$alpha]`] degrees. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse50.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse50.pg new file mode 100644 index 0000000000..4020355b5a --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse50.pg @@ -0,0 +1,256 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $height = random(100,200,1); + $alpha = random(10,60,1); + $alphaRadian = $alpha*pi/180; + $base = tan($alphaRadian)*$height; + $hypotenuse = $height/cos($alphaRadian); +} until ($base<170); +$base = int($base); +$alpha = Compute(arctan($base/$height)*180/pi); +$heightPerson = random(5,6,0.5); + +$heightTotal = $heightPerson+$base; +$heightTotalU = NumberWithUnits("$heightTotal ft"); + +$hypotenuseU = NumberWithUnits("$hypotenuse ft"); +$baseU = NumberWithUnits("$base ft"); +$heightU = NumberWithUnits("$height ft"); +$heightPersonU = NumberWithUnits("$heightPerson ft"); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +$longer = max($base,$height); + +$xmin = 0; #The viewing window +$xmax = 1.5*$longer; +$ymin = 0; +$ymax = 1.5*$longer; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = 3; + + @x = (($xmax-$height)/2,($xmax+$height)/2); + @y = (($ymax-$base)/2,($ymax+$base)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = $longer/10; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$curveAdjust = $longer/10; +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+$curveAdjust*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+$curveAdjust*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; +$picture->lb( new Label($labelAx[$corner]+2*$curveAdjust*cos($theta), $labelAy[$corner]+2*$curveAdjust*sin($theta),"x",'black','center','middle')); + + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + +#head +$picture->stamps( open_circle($x[0]-$labelAdjust/7,$y[0]-$labelAdjust/7,'blue') ); +#body +$picture->moveTo($x[0]-$labelAdjust/7,$y[0]-$labelAdjust/6); +$picture->lineTo($x[0]-$labelAdjust/7,$y[0]-$labelAdjust,'blue'); +#person's height +$picture->lb( new Label($x[0]-$labelAdjust,$y[0]-$labelAdjust/2,$heightPersonU,'black','center','middle')); +#left leg +$picture->moveTo($x[0]-$labelAdjust/7,$y[0]-$labelAdjust); +$picture->lineTo($x[0]-$labelAdjust/3,$y[0]-1.5*$labelAdjust,'blue'); +#right leg +$picture->moveTo($x[0]-$labelAdjust/7,$y[0]-$labelAdjust); +$picture->lineTo($x[0]+$labelAdjust/8,$y[0]-1.5*$labelAdjust,'blue'); +#left arm +$picture->moveTo($x[0]-$labelAdjust/7,$y[0]-0.5*$labelAdjust); +$picture->lineTo($x[0]-$labelAdjust/3,$y[0]-$labelAdjust,'blue'); +#right arm +$picture->moveTo($x[0]-$labelAdjust/7,$y[0]-0.5*$labelAdjust); +$picture->lineTo($x[0]+$labelAdjust/8,$y[0]-$labelAdjust,'blue'); +#ground +$picture->moveTo($x[0]-$labelAdjust,$y[0]-1.5*$labelAdjust); +$picture->lineTo($x[1]+$labelAdjust,$y[0]-1.5*$labelAdjust,'blue'); +#plane +$picture->stamps( closed_circle($x[1],$y[1],'blue') ); +$picture->lb( new Label($x[1]+$labelAdjust/7,$y[1]+$labelAdjust/2,'object','black','center','middle')); + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$baseU,'black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner]-3*$labelAdjust,$y[0]-2*$labelAdjust,'ground','black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner]+$labelAdjust/2,$heightU,'black','center','middle')); + + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = $labelAdjust/3; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "The graph shows a $heightPersonU person on the ground, looking up at a flying object. A horizontal line is drawn from his eyes toward the object, and a vertical line is drawn from the object downward. Another line is connected from his eyes to the object. These three lines form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle measures x degrees. The length of the side opposite to the given acute angle is marked as $baseU; the side adjacent to the given acute angle is marked $heightU."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A person is standing straight on the ground, looking up at an object in the air. His eyes is [`[$heightPersonU]`] from the ground. Horizontally, the person is [`[$heightU]`] away from the object. The height of the object is [`[$heightTotalU]`]. Find the angle of elevation from his eyes to the object. + +The angle of elevation from his eyes to the object is [______________]{$alpha} degrees. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the vertical distance from the angle of elevation is [`x`] degrees. The following graph can represent this situation: + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Note that the height of the triangle is [`[$heightTotalU]-[$heightPersonU]=[$baseU]`], because we have to subtract the distance between the person's eyes to the ground from the object's height. + +This has become a right triangle trigonometry problem. + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the unmarked side is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$baseU]`] is the "opposite leg" of angle x, because it is opposite to the angle. + +The side marked as [`[$heightU]`] is the "adjacent leg" of angle x, because it is *not* opposite to the angle. + +Since we need to relate the angle's opposite and adjacent legs, we choose to use the tangent function. The solution is: + + [`` +\begin{aligned} + \tan{x} &= \frac{[$base]}{[$height]} \\ + x &= \tan^{-1}\left(\frac{[$base]}{[$height]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +The angle of elevation from his eyes to the object is [`[$alpha]`] degrees. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse60.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse60.pg new file mode 100644 index 0000000000..592b3287e6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse60.pg @@ -0,0 +1,249 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $base = random(50,200,1); + $alpha = random(20,70,1); + $alphaRadian = $alpha*pi/180; + $height = $base/tan($alphaRadian); + $hypotenuse = $height/cos($alphaRadian); +} until ($height<1000); +$height = int($height); +$alpha = Compute(arctan($base/$height)*180/pi); + +$hypotenuseU = NumberWithUnits("$hypotenuse ft"); +$baseU = NumberWithUnits("$base ft"); +$heightU = NumberWithUnits("$height ft"); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +$longer = max($base,$height); + +$xmin = 0; #The viewing window +$xmax = 1.5*$longer; +$ymin = 0; +$ymax = 1.5*$longer; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = 3; + + @x = (($xmax-$height)/2,($xmax+$height)/2); + @y = (($ymax-$base)/2,($ymax+$base)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = $longer/10; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$curveAdjust = $longer/10; +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+$curveAdjust*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+$curveAdjust*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; +$picture->lb( new Label($labelAx[$corner]+2*$curveAdjust*cos($theta), $labelAy[$corner]+2*$curveAdjust*sin($theta),"x",'black','center','middle')); + +$curveAdjust = $longer/10; +$xfuncAlpha1 = sub { my $t = shift(); + return $x[1]+$curveAdjust*cos($t); }; +$yfuncAlpha1 = sub { my $t = shift(); + return $y[1]+$curveAdjust*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha1, $yfuncAlpha1, $picture ); +$fnAlpha->domain(pi,pi+$alphaRadian); +$theta = pi+$alphaRadian/2; +$picture->lb( new Label($x[1]+2*$curveAdjust*cos($theta), $y[1]+2*$curveAdjust*sin($theta),'x','black','center','middle')); + + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + + +#horizontal line +$picture->moveTo($x[1],$y[1]); +$picture->lineTo($x[0],$y[1],'blue',1,'dashed'); +#spotlight +$picture->stamps( closed_circle($x[1],$y[1],'blue') ); +$picture->lb( new Label($x[1]+$labelAdjust/7,$y[1]+$labelAdjust/2,'spotlight','black','center','middle')); +#boat +$picture->stamps( closed_circle($x[0],$y[0],'blue') ); +$picture->lb( new Label($x[0]-$labelAdjust/7,$y[0]-$labelAdjust/2,'boat','black','center','middle')); + +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner],$baseU,'black','center','middle')); +$picture->lb( new Label($labelBaseX[$corner], $labelBaseY[$corner]+$curveAdjust,'lighthouse','black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner]+3*$labelAdjust,$labelHeightY[$corner]+$labelAdjust/2,'sea','black','center','middle')); +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner]+$labelAdjust/2,$heightU,'black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = $labelAdjust/3; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "The graph shows a lighthouse with a spotlight on its top, shining light at a boat on the sea. The lighthouse, the line connecting the boat to the lighthouse, and a line connecting the boat to the spotlight form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x. The length of the side opposite to the given acute angle is marked as $baseU (height of the lighthouse); the side adjacent to the given acute angle is marked as $heightU (distance from boat to lighthouse). A dashed horizontal line is drawn from the spotlight toward the boat; this line forms an angle with the hypotenuse of the right triangle, marked as x."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A lighthouse has a spotlight on its top, and the spotlight is shining light on a boat on the sea. The lighthouse is [`[$baseU]`] high, and the horizontal distance from the boat to the lighthouse is [`[$heightU]`]. Find the angle of depression from the spotlight toward the boat. + +Solution: The angle of depression from the spotlight toward the boat is [___________]{$alpha} degrees. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the angle of depression from the spotlight toward the boat is [`x`] degrees. The following graph can represent this situation: + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +Note that the horizontal line must be drawn, because the angle of depression is defined as the degree between a direction and the horizontal line. By the property of parallel lines, the acute angle at the boat end of the right triangle has the same measure as the angle of depression. + +This has become a right triangle trigonometry problem. + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the unmarked side is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as [`[$baseU]`] is the "opposite leg" of the angle marked as x, because it is opposite to the angle. + +The side marked as [`[$heightU]`] is the "adjacent leg" of the angle marked as x, because it is *not* opposite to the angle. + +Since we need to relate the angle's opposite and adjacent legs, we choose to use the tangent function. + +To find the unknown angle's measure, we need to use the inverse tangent function. Don't forget to change your calculator's mode to "degree". + +The solution is: + + [`` +\begin{aligned} + \tan{x} &= \frac{[$base]}{[$height]} \\ + x &= \tan^{-1}\left(\frac{[$base]}{[$height]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +Solution: The angle of depression from the spotlight toward the boat is [`[$alpha]`] degrees. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse70.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse70.pg new file mode 100644 index 0000000000..4413e7156d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseRightTriangleTrig/RightTriangleInverse70.pg @@ -0,0 +1,228 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserNumberWithUnits.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $base = random(2,5,0.1); + $alpha = random(10,20,1); + $alphaRadian = $alpha*pi/180; + $height = $base/tan($alphaRadian); + $hypotenuse = $height/cos($alphaRadian); +} until ($hypotenuse<30); +$height = int($height*10)/10; +$hypotenuse = int($hypotenuse*10)/10; +$base = sqrt($hypotenuse**2-$height**2); +$base = int($base*10)/10; +$alpha = Compute(arccos($height/$hypotenuse)*180/pi); + +$hypotenuseU = NumberWithUnits("$hypotenuse ft"); +$baseU = NumberWithUnits("$base ft"); +$heightU = NumberWithUnits("$height ft"); + +$beta = 90-$alpha; +$betaRadian = pi/2-$alphaRadian; + +$longer = max($base,$height); + +$xmin = 0; #The viewing window +$xmax = 1.5*$longer; +$ymin = 0; +$ymax = 1.5*$longer; + +#$corner's value decides the location of the right angle. +#(0,1,2,3) implies (bottom left,top left,top right,bottom right). +$corner = 3; + + @x = (($xmax-$height)/2,($xmax+$height)/2); + @y = (($ymax-$base)/2,($ymax+$base)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[400,400]); + +$labelAdjust = $longer/20; + +@labelAx = ($x[0],$x[1],$x[1],$x[0]); +@labelAy = ($y[1],$y[1],$y[0],$y[0]); +@alphaCurveStart = (3*pi/2,pi,pi/2,0); +@alphaCurveEnd = (3*pi/2+$alphaRadian,pi+$alphaRadian,pi/2+$alphaRadian,$alphaRadian); + +@labelBx = ($x[1],$x[0],$x[0],$x[1]); +@labelBy = ($y[0],$y[0],$y[1],$y[1]); +@betaCurveStart = (pi-$betaRadian,pi/2-$betaRadian,2*pi-$betaRadian,3*pi/2-$betaRadian); +@betaCurveEnd = (pi,pi/2,2*pi,3*pi/2); + +@labelCx = ($x[0],$x[0],$x[1],$x[1]); +@labelCy = ($y[0],$y[1],$y[1],$y[0]); + +$curveAdjust = $longer/10; +$xfuncAlpha = sub { my $t = shift(); + return $labelAx[$corner]+$curveAdjust*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $labelAy[$corner]+$curveAdjust*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture ); +$fnAlpha->domain($alphaCurveStart[$corner],$alphaCurveEnd[$corner]); +$theta = ($alphaCurveStart[$corner]+$alphaCurveEnd[$corner])/2; +$picture->lb( new Label($labelAx[$corner]+2*$curveAdjust*cos($theta), $labelAy[$corner]+2*$curveAdjust*sin($theta),"x",'black','center','middle')); + + +@labelBaseX=(($x[0]+$x[1])/2,$x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust); +@labelBaseY=($y[0]-$labelAdjust,($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2); +@labelHeightX=($x[0]-$labelAdjust,($x[0]+$x[1])/2,$x[1]+$labelAdjust,($x[0]+$x[1])/2); +@labelHeightY=(($y[0]+$y[1])/2,$y[1]+$labelAdjust,($y[0]+$y[1])/2,$y[0]-$labelAdjust); +@labelHypotenuseX=(($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2+$labelAdjust,($x[0]+$x[1])/2-$labelAdjust,($x[0]+$x[1])/2-$labelAdjust); +@labelHypotenuseY=(($y[0]+$y[1])/2+$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2-$labelAdjust,($y[0]+$y[1])/2+$labelAdjust); + + +#trunk +$picture->stamps( closed_circle($x[1],$y[1],'blue') ); +$picture->lb( new Label($x[1]+$labelAdjust,$y[1]+$labelAdjust,'trunk','black','center','middle')); + +$picture->lb( new Label($labelHeightX[$corner],$labelHeightY[$corner],$heightU,'black','center','middle')); +$picture->lb( new Label($labelHeightX[$corner]+5,$labelHeightY[$corner],'ground','black','center','middle')); + +$picture->lb( new Label($labelHypotenuseX[$corner],$labelHypotenuseY[$corner],$hypotenuseU,'black','center','middle')); +$picture->lb( new Label($labelHypotenuseX[$corner]+3*$labelAdjust,$labelHypotenuseY[$corner]+$labelAdjust,'ramp','black','center','middle')); + +$picture->new_color("lightblue", 200,200,255); # RGB +$picture->new_color("darkblue", 100,100,255); + +@ax=(0,1,1,0); +@ay=(1,1,0,0); +@bx=(1,0,0,1); +@by=(0,0,1,1); +@cx=(0,0,1,1); +@cy=(0,1,1,0); + + +$picture->moveTo($x[$ax[$corner]],$y[$ay[$corner]]); +$picture->lineTo($x[$bx[$corner]],$y[$by[$corner]], darkblue,3); +$picture->lineTo($x[$cx[$corner]],$y[$cy[$corner]], darkblue,3); +$picture->lineTo($x[$ax[$corner]],$y[$ay[$corner]], darkblue,3); + + +$cornersize = $labelAdjust/2; + +@rightSymbol1x=($x[0],$x[0]+$cornersize,$x[1]-$cornersize,$x[1]); +@rightSymbol1y=($y[0]+$cornersize,$y[1],$y[1],$y[0]+$cornersize); +@rightSymbol2x=($x[0]+$cornersize,$x[0]+$cornersize,$x[1]-$cornersize,$x[1]-$cornersize); +@rightSymbol2y=($y[0]+$cornersize,$y[1]-$cornersize,$y[1]-$cornersize,$y[0]+$cornersize); +@rightSymbol3x=($x[0]+$cornersize,$x[0],$x[1],$x[1]-$cornersize); +@rightSymbol3y=($y[0],$y[1]-$cornersize,$y[1]-$cornersize,$y[0]); + +$picture->moveTo($rightSymbol1x[$corner],$rightSymbol1y[$corner]); +$picture->lineTo($rightSymbol2x[$corner],$rightSymbol2y[$corner], darkblue,3); +$picture->lineTo($rightSymbol3x[$corner],$rightSymbol3y[$corner], darkblue,3); + + +@positions=('bottom left','top left','top right','bottom right'); +if ($corner==0) { + $aPosition = $positions[1]; + $bPosition = $positions[3]; + $cPosition = $positions[0]; +} elsif ($corner==1) { + $aPosition = $positions[2]; + $bPosition = $positions[0]; + $cPosition = $positions[1]; +} elsif ($corner==2) { + $aPosition = $positions[3]; + $bPosition = $positions[1]; + $cPosition = $positions[2]; +} else { + $aPosition = $positions[0]; + $bPosition = $positions[2]; + $cPosition = $positions[3]; +} + +$text = "The graph shows a ramp set up from a trunk to the ground. A vertical line is drawn from upper end of the ramp (touching the trunk) straight down to the ground. A horizontal line is drawn from where the ramp touches the ground toward the trunk. The ramp, the vertical line and the horizontal line form a right triangle. The right angle is at the $cPosition corner of the picture. At the $aPosition, the acute angle is marked as x. The side adjacent to the given acute angle is labeled as the ground, and $heightU; and the side opposite to the right angle is labeled as the ramp, and also labeled as $hypotenuseU."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A ramp is set up from a truck's trunk to the ground. From the ramp's end touching the ground to the trunk's horizontal distance is [`[$heightU]`]. If the length of the ramp is [`[$hypotenuseU]`], find the angle between the ramp and the ground. + +Solution: The angle between the ramp and the ground is [___________]{$alpha} degrees. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the angle between the ramp and the ground is [`x`] degrees. The following graph can represent this situation: + +[@EnlargeImageStatementPGML()@]** + +>>[@image(insertGraph($picture), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>"alt = '$text' title = '$text'") @]*<< + +This has become a right triangle trigonometry problem. + +By definition: + + [`` \sin \theta = \frac{\text{opposite leg}}{\text{hypotenuse}} ``] + + [`` \cos \theta = \frac{\text{adjacent leg}}{\text{hypotenuse}} ``] + + [`` \tan \theta = \frac{\text{opposite leg}}{\text{adjacent leg}} ``] + +An acronym to help you memorize those 3 definitions is: *SOH CAH TOA*. + +For this problem, the side marked as "ramp", or [`[$hypotenuseU]`], is the hypotenuse, because it's opposite to the right angle, and because it's the longest side in the triangle. + +The side marked as "ground", or [`[$heightU]`], is the "adjacent leg" of the angle marked as [`x`], because it is not opposite to the angle. + +Since we need to relate the hypotenuse and the angle's adjacent leg, we choose to use the cosine function. The solution is: + + [`` +\begin{aligned} + \cos{x} &= \frac{[$height]}{[$hypotenuse]} \\ + x &= \cos^{-1}\left(\frac{[$height]}{[$hypotenuse]}\right) \\ + x &\approx [$alpha]^{\circ} +\end{aligned} + ``] + +Solution: The angle between the ramp and the ground is approximately [`[$alpha]`] degrees. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange10.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange10.pg new file mode 100644 index 0000000000..c65a5ecec9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange10.pg @@ -0,0 +1,105 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("Numeric"); + +$popupSine0 = PopUp(["?", "defined", "undefined"], "defined"); +$popupSine1 = PopUp(["?", "defined", "undefined"], "undefined"); +$popupCosine0 = PopUp(["?", "defined", "undefined"], "defined"); +$popupCosine1 = PopUp(["?", "defined", "undefined"], "undefined"); +$popupTangent0 = PopUp(["?", "defined", "undefined"], "defined"); +$popupTangent1 = PopUp(["?", "defined", "undefined"], "undefined"); + +@prob = ( + [random(0.1,0.9,0.1), $popupSine0, $popupCosine0, $popupTangent0], + [random(-0.9,-0.1,0.1), $popupSine0, $popupCosine0, $popupTangent0], + [list_random(-1,0,1), $popupSine0, $popupCosine0, $popupTangent0], + [random(1.1,2.9,0.1), $popupSine1, $popupCosine1, $popupTangent0], + [random(-2.9,-1.1,0.1), $popupSine1, $popupCosine1, $popupTangent0], +); + +@perm = NchooseK(6,3); + + +########################################################## + +BEGIN_PGML + +Decide whether each value is defined or undefined. + +a) [`` \sin^{-1}\left( [$prob[$perm[0]][0]] \right) \text{ is}``] [_____________]{$prob[$perm[0]][1]} + +b) [`` \cos^{-1}\left( [$prob[$perm[1]][0]] \right) \text{ is}``] [_____________]{$prob[$perm[1]][2]} + +c) [`` \tan^{-1}\left( [$prob[$perm[2]][0]] \right) \text{ is}``] [_____________]{$prob[$perm[2]][3]} + + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +###Part a + +The range of [`y=\sin(x)`] and the domain of [`y=\sin^{-1}(x)`] are both [` [-1,1] `]. + +So [` \sin^{-1}\left( [$prob[$perm[0]][0]] \right)`] is [$prob[$perm[0]][1]->correct_ans()]. + +###Part b + +The range of [`y=\cos(x)`] and the domain of [`y=\cos^{-1}(x)`] are both [` [-1,1] `]. + +So [` \cos^{-1}\left( [$prob[$perm[1]][0]] \right)`] is [$prob[$perm[1]][2]->correct_ans()]. + +###Part c + +The range of [`y=\tan(x)`] and the domain of [`y=\tan^{-1}(x)`] are both [` (-\infty,\infty) `]. + +So [` \tan^{-1}\left( [$prob[$perm[2]][0]] \right)`] is [$prob[$perm[2]][3]->correct_ans()]. + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange20.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange20.pg new file mode 100644 index 0000000000..6d89b799c3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange20.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); + +###################################### + +sub output { + my ($n,$d) = shift->value; + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +TEXT(beginproblem()); + +Context("Fraction"); + +$popupSine0 = PopUp(["?", "possible", "impossible"], "possible"); +$popupSine1 = PopUp(["?", "possible", "impossible"], "impossible"); +$popupCosine0 = PopUp(["?", "possible", "impossible"], "possible"); +$popupCosine1 = PopUp(["?", "possible", "impossible"], "impossible"); +$popupTangent0 = PopUp(["?", "possible", "impossible"], "possible"); +$popupTangent1 = PopUp(["?", "possible", "impossible"], "impossible"); + +do { + $den = random(3,9,1); + $num = random(1,int($den/2),1); +} until gcd($num,$den)==1 && $num/$den<0.5; +$frac0 = Fraction($num,$den); + +do { + $den = random(3,9,1); + $num = random(int($den/2)+1,$den-1,1); +} until gcd($num,$den)==1 && $num/$den>0.5; +$frac1 = Fraction($num,$den); +$frac4 = -$frac1; + +do { + $den = random(3,9,1); + $num = random(1,int($den/2),1); +} until gcd($num,$den)==1 && $num/$den<0.5; +$frac2 = -Fraction($num,$den); + +do { + $den = random(3,9,1); + $num = random($den+1,2*$den-1,1); +} until gcd($num,$den)==1; +$frac3 = Fraction($num,$den); + +@prob = ( + [&output($frac0), $popupSine0, $popupCosine0, $popupTangent0], + [&output($frac1), $popupSine1, $popupCosine0, $popupTangent1], + [&output($frac2), $popupSine0, $popupCosine1, $popupTangent0], + [&output(Fraction(1,2)), $popupSine0, $popupCosine0, $popupTangent1], + [&output(Fraction(-1,2)), $popupSine0, $popupCosine1, $popupTangent1], + [&output($frac3), $popupSine1, $popupCosine1, $popupTangent1], + [&output($frac4), $popupSine1, $popupCosine1, $popupTangent1], +); + +@perm = NchooseK(7,3); + + +########################################################## + +BEGIN_PGML + +Decide whether each equation is possible or impoosible. + +a) [`` \sin^{-1}(\alpha)= [$prob[$perm[0]][0]] \text{ is}``] [_____________]{$prob[$perm[0]][1]} + +b) [`` \cos^{-1}(\beta)= [$prob[$perm[1]][0]] \text{ is}``] [_____________]{$prob[$perm[1]][2]} + +c) [`` \tan^{-1}(\gamma)= [$prob[$perm[2]][0]] \text{ is}``] [_____________]{$prob[$perm[2]][3]} + + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +###Part a + +The range of [`y=\sin^{-1}(x)`] is [` \left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. + +So [` \sin^{-1}(\alpha)= [$prob[$perm[0]][0]] `] is [$prob[$perm[0]][1]->correct_ans()]. + +###Part b + +The range of [`y=\cos^{-1}(x)`] is [` \left[ 0,\pi \right] `]. + +So [` \cos^{-1}(\beta)= [$prob[$perm[1]][0]] `] is [$prob[$perm[1]][2]->correct_ans()]. + +###Part c + +The range of [`y=\tan^{-1}(x)`] is [` \left( -\frac{\pi}{2},\frac{\pi}{2} \right) `]. + +So [` \tan^{-1}(\gamma)= [$prob[$perm[2]][0]] `] is [$prob[$perm[2]][3]->correct_ans()]. + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange30.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange30.pg new file mode 100644 index 0000000000..ab7df63b2f --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/InverseTrigDomainRange30.pg @@ -0,0 +1,173 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +@intervals = ( + "\displaystyle [-1,1]", + "\displaystyle \left[ -\frac{\pi}{2},\frac{\pi}{2} \right]", + "\displaystyle [0,\pi]", + "\displaystyle (-\infty,\infty)", + "\displaystyle \left( -\frac{\pi}{2},\frac{\pi}{2} \right)", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..4) { + do {$temp = list_random(0..4)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$popupSineDomain = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{0}]); + +$popupSineRange = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{1}]); + +$popupCosineDomain = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{0}]); + +$popupCosineRange = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{2}]); + +$popupTangentDomain = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{3}]); + +$popupTangentRange = PopUp(["?", 'A', 'B', 'C', 'D', 'E'], $ALPHABET[$inverse{4}]); + +########################################################## + +BEGIN_PGML + +Choose the correct interval for each problem. + +[@DataTable( + [ + [ + [PF('[`` \text{Domain of }y=\sin^{-1}(x)\text{ is }``] [_____________]{$popupSineDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{A: }[$intervals[$scramble{0}]]``]')], + ], + [ + [PF('[`` \text{Range of }y=\sin^{-1}(x)\text{ is }``] [_____________]{$popupSineRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{B: }[$intervals[$scramble{1}]]``]')], + ], + [ + [PF('[`` \text{Domain of }y=\cos^{-1}(x)\text{ is }``] [_____________]{$popupCosineDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{C: }[$intervals[$scramble{2}]]``]')], + ], + [ + [PF('[`` \text{Range of }y=\cos^{-1}(x)\text{ is }``] [_____________]{$popupCosineRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{D: }[$intervals[$scramble{3}]]``]')], + ], + [ + [PF('[`` \text{Domain of }y=\tan^{-1}(x)\text{ is }``] [_____________]{$popupTangentDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{E: }[$intervals[$scramble{4}]]``]')], + ], + [ + [PF('[`` \text{Range of }y=\tan^{-1}(x)\text{ is }``] [_____________]{$popupTangentRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('')], + ], + ], + align => 'l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +It is very important to know the domain and range of the following functions. + +[@DataTable( + [ + [ + [PF('Functions'), + cellcss => 'border-right: 1px solid;', + rowcss => 'border-bottom: 1px solid;'], + [PF('Domain'), + cellcss => 'border-right: 1px solid; '], + [PF('Range')], + ], + [ + [PF('[``y=\sin^{-1}(x)``]'), + rowcss => 'border-bottom: 1px solid;height:60px;', + cellcss => 'border-right: 1px solid;',], + [PF('[`\left[ -1,1 \right]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[``\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]``]')], + ], + [ + [PF('[``y=\cos^{-1}(x)``]'), + rowcss => 'height:60px;border-bottom: 1px solid;', + cellcss => 'border-right: 1px solid; '], + [PF('[`\left[ -1,1 \right]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[``\left[ 0,\pi \right]``]')], + ], + [ + [PF('[``y=\tan^{-1}(x)``]'), + rowcss => 'height:60px;', + cellcss => 'border-right: 1px solid; '], + [PF('[`\left( -\infty,\infty \right)`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[``\left( -\frac{\pi}{2},\frac{\pi}{2} \right)``]')], + ], + ], + align => 'c c c', +);@]* + + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/SpecialAngleInverse10.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/SpecialAngleInverse10.pg new file mode 100644 index 0000000000..0b11c85ef9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/SpecialAngleInverse10.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$a = random(1.1,10,0.1); +$b = random(-10,-1.1,0.1); + +@prob = ( + ["\displaystyle \sin^{-1}\left(-1\right)",Formula("-pi/2")], + ["\displaystyle \sin^{-1}\left(-\frac{\sqrt{3}}{2}\right)",Formula("-pi/3")], + ["\displaystyle \sin^{-1}\left(-\frac{\sqrt{2}}{2}\right)",Formula("-pi/4")], + ["\displaystyle \sin^{-1}\left(-\frac{1}{2}\right)",Formula("-pi/6")], + ["\displaystyle \sin^{-1}\left(0\right)",Formula("0")], + ["\displaystyle \sin^{-1}\left(\frac{1}{2}\right)",Formula("pi/6")], + ["\displaystyle \sin^{-1}\left(\frac{\sqrt{2}}{2}\right)",Formula("pi/4")], + ["\displaystyle \sin^{-1}\left(\frac{\sqrt{3}}{2}\right)",Formula("pi/3")], + ["\displaystyle \sin^{-1}\left(1\right)",Formula("pi/2")], + ["\displaystyle \sin^{-1}\left($a\right)",Compute("DNE")], + ["\displaystyle \sin^{-1}\left($b\right)",Compute("DNE")], +); + +@perm = NchooseK(11,4); + + +########################################################## + +BEGIN_PGML + +Fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* Type *DNE* (does not exist) for undefined values.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + + [`` [$prob[$perm[2]][0]] =``] [_____________]{$prob[$perm[2]][1]} + + [`` [$prob[$perm[3]][0]] =``] [_____________]{$prob[$perm[3]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Use a Unit Circle for help if needed, but it would be great if you can come up with the following values without looking at a Unit Circle. Use your knowledge of 30-60-90 and 45-45-90 special right triangles. + +Note that the range of [`y=\sin^{-1}(x)`] is [`[-\frac{\pi}{2},\frac{\pi}{2}]`]. + + [`` \begin{aligned} + \sin^{-1}\left(-1\right) &= -\frac{\pi}{2} \\ + \sin^{-1}\left(-\frac{\sqrt{3}}{2}\right) &= -\frac{\pi}{3} \\ + \sin^{-1}\left(-\frac{\sqrt{2}}{2}\right) &= -\frac{\pi}{4} \\ + \sin^{-1}\left(-\frac{1}{2}\right) &= -\frac{\pi}{6} \\ + \sin^{-1}\left(0\right) &= 0 \\ + \sin^{-1}\left(\frac{1}{2}\right) &= \frac{\pi}{6} \\ + \sin^{-1}\left(\frac{\sqrt{2}}{2}\right) &= \frac{\pi}{4} \\ + \sin^{-1}\left(\frac{\sqrt{3}}{2}\right) &= \frac{\pi}{3} \\ + \sin^{-1}\left(1\right) &= \frac{\pi}{2} \\ + \end{aligned} ``] + +Note that expressions like [`\sin^{-1}([$a])`] and [`\sin^{-1}([$b])`] are undefined because the domain of [`y=\sin^{-1}(x)`] is [`[-1,1]`]. + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/SpecialAngleInverse20.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/SpecialAngleInverse20.pg new file mode 100644 index 0000000000..68bd32bc28 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/SpecialAngleInverse20.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$a = random(1.1,10,0.1); +$b = random(-10,-1.1,0.1); + +@prob = ( + ["\displaystyle \cos^{-1}\left(-1\right)",Formula("pi")], + ["\displaystyle \cos^{-1}\left(-\frac{1}{2}\right)",Formula("2pi/3")], + ["\displaystyle \cos^{-1}\left(-\frac{\sqrt{2}}{2}\right)",Formula("3pi/4")], + ["\displaystyle \cos^{-1}\left(-\frac{\sqrt{3}}{2}\right)",Formula("5pi/6")], + ["\displaystyle \cos^{-1}\left(0\right)",Formula("pi/2")], + ["\displaystyle \cos^{-1}\left(\frac{1}{2}\right)",Formula("pi/3")], + ["\displaystyle \cos^{-1}\left(\frac{\sqrt{2}}{2}\right)",Formula("pi/4")], + ["\displaystyle \cos^{-1}\left(\frac{\sqrt{3}}{2}\right)",Formula("pi/6")], + ["\displaystyle \cos^{-1}\left(1\right)",Formula("0")], + ["\displaystyle \cos^{-1}\left($a\right)",Compute("DNE")], + ["\displaystyle \cos^{-1}\left($b\right)",Compute("DNE")], +); + +@perm = NchooseK(11,4); + + +########################################################## + +BEGIN_PGML + +Fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* Type *DNE* (does not exist) for undefined values.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + + [`` [$prob[$perm[2]][0]] =``] [_____________]{$prob[$perm[2]][1]} + + [`` [$prob[$perm[3]][0]] =``] [_____________]{$prob[$perm[3]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Use a Unit Circle for help if needed, but it would be great if you can come up with the following values without looking at a Unit Circle. Use your knowledge of 30-60-90 and 45-45-90 special right triangles. + +Note that the range of [`y=\cos^{-1}(x)`] is [`[0,\pi]`]. + + [`` \begin{aligned} + \cos^{-1}\left(-1\right) &= \pi \\ + \cos^{-1}\left(-\frac{\sqrt{3}}{2}\right) &= \frac{5\pi}{6} \\ + \cos^{-1}\left(-\frac{\sqrt{2}}{2}\right) &= \frac{3\pi}{4} \\ + \cos^{-1}\left(-\frac{1}{2}\right) &= \frac{2\pi}{3} \\ + \cos^{-1}\left(0\right) &= \frac{\pi}{2} \\ + \cos^{-1}\left(\frac{1}{2}\right) &= \frac{\pi}{3} \\ + \cos^{-1}\left(\frac{\sqrt{2}}{2}\right) &= \frac{\pi}{4} \\ + \cos^{-1}\left(\frac{\sqrt{3}}{2}\right) &= \frac{\pi}{6} \\ + \cos^{-1}\left(1\right) &= 0 \\ + \end{aligned} ``] + +Note that expressions like [`\cos^{-1}([$a])`] and [`\cos^{-1}([$b])`] are undefined because the domain of [`y=\cos^{-1}(x)`] is [`[-1,1]`]. + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/SpecialAngleInverse30.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/SpecialAngleInverse30.pg new file mode 100644 index 0000000000..1d4e7bf251 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/SpecialAngleInverse30.pg @@ -0,0 +1,103 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + + +@prob = ( + ["\displaystyle \tan^{-1}\left(-\sqrt{3}\right)",Formula("-pi/3")], + ["\displaystyle \tan^{-1}\left(-1\right)",Formula("-pi/4")], + ["\displaystyle \tan^{-1}\left(-\frac{\sqrt{3}}{3}\right)",Formula("-pi/6")], + ["\displaystyle \tan^{-1}\left(0\right)",Formula("0")], + ["\displaystyle \tan^{-1}\left(\frac{\sqrt{3}}{3}\right)",Formula("pi/6")], + ["\displaystyle \tan^{-1}\left(1\right)",Formula("pi/4")], + ["\displaystyle \tan^{-1}\left(\sqrt{3}\right)",Formula("pi/3")], +); + +@perm = NchooseK(7,4); + + +########################################################## + +BEGIN_PGML + +[@KeyboardInstructions( +"\n" +.'* Type *DNE* (does not exist) for undefined values.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + + [`` [$prob[$perm[2]][0]] =``] [_____________]{$prob[$perm[2]][1]} + + [`` [$prob[$perm[3]][0]] =``] [_____________]{$prob[$perm[3]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Use a Unit Circle for help if needed, but it would be great if you can come up with the following values without looking at a Unit Circle. Use your knowledge of 30-60-90 and 45-45-90 special right triangles. + +Note that the range of [`y=\tan^{-1}(x)`] is [`\left(-\frac{\pi}{2},\frac{\pi}{2}\right)`]. + + [`` \begin{aligned} + \tan^{-1}\left(-\sqrt{3}\right) &= -\frac{\pi}{3} \\ + \tan^{-1}\left(-1\right) &= -\frac{\pi}{4} \\ + \tan^{-1}\left(-\frac{\sqrt{3}}{3}\right) &= -\frac{\pi}{6} \\ + \tan^{-1}\left(0\right) &= 0 \\ + \tan^{-1}\left(\frac{\sqrt{3}}{3}\right) &= \frac{\pi}{6} \\ + \tan^{-1}\left(1\right) &= \frac{\pi}{4} \\ + \tan^{-1}\left(\sqrt{3}\right) &= \frac{\pi}{3} \\ + \end{aligned} ``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination10.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination10.pg new file mode 100644 index 0000000000..2ebf6a75b2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination10.pg @@ -0,0 +1,99 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$multiple = 1; +$base = $multiple*$triples[$in][0]; +$height = $multiple*$triples[$in][1]; +$hypotenuse = $multiple*$triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse)*random(-1,1,2), + Fraction($base,$hypotenuse)*random(-1,1,2), + Fraction($height,$base)*random(-1,1,2), +); + +$frac0 = $ans[0]; +$frac1 = $ans[1]; +$frac2 = $ans[2]; + +############################################################## + +BEGIN_PGML + +Evaluate the following without using a calculator. + + [``\sin\left( \sin^{-1}\left( [$frac0] \right) \right) =``][_____________]{$frac0} + + [``\cos\left( \cos^{-1}\left( [$frac1] \right) \right) =``][_____________]{$frac1} + + [``\tan\left( \tan^{-1}\left( [$frac2] \right) \right) =``][_____________]{$frac2} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Assume [`\alpha = \sin^{-1}\left( [$frac0] \right)`], then [`\sin (\alpha) = [$frac0] `]. This implies + + [``\begin{aligned} + \sin\left( \sin^{-1}\left( [$frac0] \right) \right) &= \sin(\alpha) \\ + &= [$frac0] + \end{aligned}``] + +Similarly, assume [` \beta = \cos^{-1}\left( [$frac1] \right) `] and [` \gamma = \tan^{-1}\left( [$frac2] \right) `], we have: + + [``\begin{aligned} + \cos\left( \cos^{-1}\left( [$frac1] \right) \right) &= \cos(\beta) = [$frac1] \\ + \tan\left( \tan^{-1}\left( [$frac2] \right) \right) &= \tan(\gamma) = [$frac2] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination100.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination100.pg new file mode 100644 index 0000000000..1b7ed70bec --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination100.pg @@ -0,0 +1,192 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 4; + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_____]{$ans[4]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +$absBase = abs($base); +$absHeight = abs($height); + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right) `], either in Quadrant I or Quadrant IV. + +Since [`[$ans[2]]<0`], the angle [`\tan^{-1}\left( [$ans[2]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its height [`[$height]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination101.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination101.pg new file mode 100644 index 0000000000..02151b34c5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination101.pg @@ -0,0 +1,273 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $baseOut = random(1,5,1); + $heightIn = list_random(1,2,3,5); + $heightOut = -random(1,5,1); + } until (gcd(abs($heightOut),abs($baseOut))==1); + $baseIn = 1; + ($hypotenuseOut,$hypotenuseIn) = &radSimplify($baseOut**2*$baseIn+$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && !(($baseOut>0) && ($heightOut>0)) && ($hypotenuseIn<30); + + $heightOut = $heightOut*random(-1,1,2); + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + + $base = $baseOut; + $absBase = abs($baseOut); + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + if ($hypotenuseIn==1) { + $hypotenuse = $hypotenuseOut; + } elsif (abs($hypotenuseOut)==1) { + $hypotenuse = Formula("sqrt($hypotenuseIn)"); + } else { + $hypotenuse = Formula("$hypotenuseOut*sqrt($hypotenuseIn)"); + } + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin \left( \tan^{-1}\left( [$ans[2]] \right) \right)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc \left( \tan^{-1}\left( [$ans[2]] \right) \right)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos \left( \tan^{-1}\left( [$ans[2]] \right) \right)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec \left( \tan^{-1}\left( [$ans[2]] \right) \right)=`][_____]{$ans[4]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right) `], either in Quadrant I or Quadrant IV. + +Since [`[$ans[2]]<0`], the angle [`\tan^{-1}\left( [$ans[2]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its height [`[$height]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination110.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination110.pg new file mode 100644 index 0000000000..273ef3438d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination110.pg @@ -0,0 +1,228 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "PCCmacros.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +do { + do { + $a = random(1,3,1); + $b = random(-5,5,1); + } until gcd(abs($a),abs($b))==1; + + $in = random(0,3,1); + if ($in==0) { + $base = Compute("$a*x")->reduce; + $c = 2*$a*$b; + $height = Compute("sqrt($c*x+($b)**2)")->reduce; + $hypotenuse = Compute("$a*x+$b")->reduce; + $space = 0; #bottom need space + } elsif ($in==1) { + $base = Compute("$a")->reduce; + $height = Compute("x")->reduce; + $hypotenuse = Compute("sqrt(x**2+($a)**2)")->reduce; + $space = 1; #left need space + } elsif ($in==2) { + $base = Compute("x")->reduce; + $height = Compute("sqrt(($a)**2-x**2)")->reduce; + $hypotenuse = Compute("$a")->reduce; + $space = 0; #bottom need space + } else { + Context()->flags->set(limits=>[$a+1,$a+2]); + $base = Compute("$a")->reduce; + $height = Compute("sqrt((x)**2-($a)**2)")->reduce; + $hypotenuse = Compute("x")->reduce; + $space = 0; #bottom need space + } +} until $base != 0 && $height!=0 && $hypotenuse!=0; + +if (random(0,1,1)==0) { + $temp = $base; + $base = $height; + $height = $temp; + if ($space!=1) {$space = 2;} #right need space +} + +Context("LimitedRadical"); + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + ($hypotenuse==1) ? Formula("$base") : Formula("$base/$hypotenuse"), + ($hypotenuse==1) ? Formula("$height") : Formula("$height/$hypotenuse"), + ($height==1) ? Formula("$base") : Formula("$base/$height"), + ($base==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$base"), + ($height==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$height"), + ($base==1) ? Formula("$height") : Formula("$height/$base"), +); + +for my $i (0..5) { + if ($in==0) { + if ($c>0) { + $left = max(-($b)**2/$c,-$b/$a); + $right = $left+1; + } else { + $right = min(-($b)**2/$c,-$b/$a); + $left = -$right; + } + $ans[$i]->{limits} = [$left,$right]; + } + if ($in==2) {$ans[$i]->{limits} = [0,$a];} + if ($in==3) {$ans[$i]->{limits} = [$a+1,$a+2];} +} + +$Ax = 0; +$Ay = 0; +$Cx = sqrt(3); +$Cy = 0; +$Bx = $Cx; +$By = 1; +$cushion = 2; + +if ($space==1) { + $xmin = -$cushion; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} elsif ($space==2) { + $xmin = -0.5; + $xmax = $Cx+$cushion; + $ymin = -0.2; + $ymax = $By+0.2; +} else { + $xmin = -0.5; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$xShift = $xmax/20; +$yShift = $xShift/$xmax*$ymax; +$picture[0]->moveTo($Cx,$Cy+$yShift); +$picture[0]->lineTo($Cx-$xShift,$Cy+$yShift,blue,3); +$picture[0]->lineTo($Cx-$xShift,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','bottom','large')); +$picture[0]->lb( new Label($Cx+0.1,$Cy,"C",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx+0.1,($By+$Cy)/2,"$base",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay-0.02,"$height",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"$hypotenuse",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is $height. Angle C is a right angle. Side CB goes up, and the length is $base. The length of AB is $hypotenuse."; + + + +############################################################## + +BEGIN_PGML + +Find the following values. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Do not rationalize the denominator.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\cos\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_______________]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_______________]{$ans[4]}')], + ], + [ + [PF('[`\tan\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_______________]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_______________]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + + +BEGIN_PGML_SOLUTION + +Assume [`\angle A = \sin^{-1}\left( [$ans[0]] \right) `], then [`\sin(A) = [$ans[0]]`]. If we sketch a right triangle with [`\angle A`], we can make its opposite side [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$height]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(A) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(A) &= \frac{\text{adjacent}}{\text{hypotenuse}} = [$ans[1]] \\ + \tan(A) &= \frac{\sin(A)}{\cos(A)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \sec(A) &= \frac{1}{\cos(A)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(A) &= \frac{\cos(A)}{\sin(A)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination120.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination120.pg new file mode 100644 index 0000000000..a436e7666d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination120.pg @@ -0,0 +1,231 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "PCCmacros.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +do { + do { + $a = random(1,3,1); + $b = random(-5,5,1); + $c = 2*$a*$b; + } until gcd(abs($a),abs($b))==1 && +!(abs($c)%4==0 && ($b)**2%4==0) && +!(abs($c)%9==0 && ($b)**2%9==0); + + $in = random(0,3,1); + if ($in==0) { + $base = Compute("$a*x")->reduce; + $height = Compute("sqrt($c*x+($b)**2)")->reduce; + $hypotenuse = Compute("$a*x+$b")->reduce; + $space = 0; #bottom need space + } elsif ($in==1) { + $base = Compute("$a")->reduce; + $height = Compute("x")->reduce; + $hypotenuse = Compute("sqrt(x**2+($a)**2)")->reduce; + $space = 1; #left need space + } elsif ($in==2) { + $base = Compute("x")->reduce; + $height = Compute("sqrt(($a)**2-x**2)")->reduce; + $hypotenuse = Compute("$a")->reduce; + $space = 0; #bottom need space + } else { + Context()->flags->set(limits=>[$a+1,$a+2]); + $base = Compute("$a")->reduce; + $height = Compute("sqrt((x)**2-($a)**2)")->reduce; + $hypotenuse = Compute("x")->reduce; + $space = 0; #bottom need space + } +} until $base != 0 && $height!=0 && $hypotenuse!=0; + +if (random(0,1,1)==0) { + $temp = $base; + $base = $height; + $height = $temp; + if ($space!=1) {$space = 2;} #right need space +} + +Context("LimitedRadical"); + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + ($hypotenuse==1) ? Formula("$base") : Formula("$base/$hypotenuse"), + ($hypotenuse==1) ? Formula("$height") : Formula("$height/$hypotenuse"), + ($height==1) ? Formula("$base") : Formula("$base/$height"), + ($base==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$base"), + ($height==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$height"), + ($base==1) ? Formula("$height") : Formula("$height/$base"), +); + +for my $i (0..5) { + if ($in==0) { + if ($c>0) { + $left = max(-($b)**2/$c,-$b/$a); + $right = $left+1; + } else { + $right = min(-($b)**2/$c,-$b/$a); + $left = -$right; + } + $ans[$i]->{limits} = [$left,$right]; + } + if ($in==2) {$ans[$i]->{limits} = [0,$a];} + if ($in==3) {$ans[$i]->{limits} = [$a+1,$a+2];} +} + +$Ax = 0; +$Ay = 0; +$Cx = sqrt(3); +$Cy = 0; +$Bx = $Cx; +$By = 1; +$cushion = 2; + +if ($space==1) { + $xmin = -$cushion; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} elsif ($space==2) { + $xmin = -0.5; + $xmax = $Cx+$cushion; + $ymin = -0.2; + $ymax = $By+0.2; +} else { + $xmin = -0.5; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$xShift = $xmax/20; +$yShift = $xShift/$xmax*$ymax; +$picture[0]->moveTo($Cx,$Cy+$yShift); +$picture[0]->lineTo($Cx-$xShift,$Cy+$yShift,blue,3); +$picture[0]->lineTo($Cx-$xShift,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','bottom','large')); +$picture[0]->lb( new Label($Cx+0.1,$Cy,"C",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx+0.1,($By+$Cy)/2,"$base",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay-0.02,"$height",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"$hypotenuse",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is $height. Angle C is a right angle. Side CB goes up, and the length is $base. The length of AB is $hypotenuse."; + + + +############################################################## + +BEGIN_PGML + +Find the following values. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Do not rationalize the denominator.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_______________]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_______________]{$ans[3]}')], + ], + [ + [PF('[`\tan\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_______________]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_______________]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + + +BEGIN_PGML_SOLUTION + +Assume [`\angle A = \cos^{-1}\left( [$ans[1]] \right) `], then [`\cos(A) = [$ans[1]]`]. If we sketch a right triangle with [`\angle A`], we can make its adjacent side [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$base]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(A) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(A) &= \frac{\text{adjacent}}{\text{hypotenuse}} = [$ans[1]] \\ + \tan(A) &= \frac{\sin(A)}{\cos(A)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(A) &= \frac{1}{\sin(A)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \cot(A) &= \frac{\cos(A)}{\sin(A)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination130.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination130.pg new file mode 100644 index 0000000000..5e6108a3c6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination130.pg @@ -0,0 +1,227 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +do { + do { + $a = random(1,3,1); + $b = random(-5,5,1); + } until gcd(abs($a),abs($b))==1; + + $in = random(0,3,1); + if ($in==0) { + $base = Compute("$a*x")->reduce; + $c = 2*$a*$b; + $height = Compute("sqrt($c*x+($b)**2)")->reduce; + $hypotenuse = Compute("$a*x+$b")->reduce; + $space = 0; #bottom need space + } elsif ($in==1) { + $base = Compute("$a")->reduce; + $height = Compute("x")->reduce; + $hypotenuse = Compute("sqrt(x**2+($a)**2)")->reduce; + $space = 1; #left need space + } elsif ($in==2) { + $base = Compute("x")->reduce; + $height = Compute("sqrt(($a)**2-x**2)")->reduce; + $hypotenuse = Compute("$a")->reduce; + $space = 0; #bottom need space + } else { + Context()->flags->set(limits=>[$a+1,$a+2]); + $base = Compute("$a")->reduce; + $height = Compute("sqrt((x)**2-($a)**2)")->reduce; + $hypotenuse = Compute("x")->reduce; + $space = 0; #bottom need space + } +} until $base != 0 && $height!=0 && $hypotenuse!=0; + +if (random(0,1,1)==0) { + $temp = $base; + $base = $height; + $height = $temp; + if ($space!=1) {$space = 2;} #right need space +} + +Context("LimitedRadical"); + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + ($hypotenuse==1) ? Formula("$base") : Formula("$base/$hypotenuse"), + ($hypotenuse==1) ? Formula("$height") : Formula("$height/$hypotenuse"), + ($height==1) ? Formula("$base") : Formula("$base/$height"), + ($base==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$base"), + ($height==1) ? Formula("$hypotenuse") : Formula("$hypotenuse/$height"), + ($base==1) ? Formula("$height") : Formula("$height/$base"), +); + +for my $i (0..5) { + if ($in==0) { + if ($c>0) { + $left = max(-($b)**2/$c,-$b/$a); + $right = $left+1; + } else { + $right = min(-($b)**2/$c,-$b/$a); + $left = -$right; + } + $ans[$i]->{limits} = [$left,$right]; + } + if ($in==2) {$ans[$i]->{limits} = [0,$a];} + if ($in==3) {$ans[$i]->{limits} = [$a+1,$a+2];} +} + +$Ax = 0; +$Ay = 0; +$Cx = sqrt(3); +$Cy = 0; +$Bx = $Cx; +$By = 1; +$cushion = 2; + +if ($space==1) { + $xmin = -$cushion; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} elsif ($space==2) { + $xmin = -0.5; + $xmax = $Cx+$cushion; + $ymin = -0.2; + $ymax = $By+0.2; +} else { + $xmin = -0.5; + $xmax = $Cx+0.5; + $ymin = -0.2; + $ymax = $By+0.2; +} + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$xShift = $xmax/20; +$yShift = $xShift/$xmax*$ymax; +$picture[0]->moveTo($Cx,$Cy+$yShift); +$picture[0]->lineTo($Cx-$xShift,$Cy+$yShift,blue,3); +$picture[0]->lineTo($Cx-$xShift,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','bottom','large')); +$picture[0]->lb( new Label($Cx+0.1,$Cy,"C",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx+0.1,($By+$Cy)/2,"$base",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay-0.02,"$height",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"$hypotenuse",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is $height. Angle C is a right angle. Side CB goes up, and the length is $base. The length of AB is $hypotenuse."; + + + +############################################################## + +BEGIN_PGML + +Find the following values. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Do not rationalize the denominator.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_______________]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_______________]{$ans[3]}')], + ], + [ + [PF('[`\cos\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_______________]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec\left(\tan^{-1}\left( [$ans[2]] \right)\right)=`][_______________]{$ans[4]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + + +BEGIN_PGML_SOLUTION + +Assume [`\angle A = \tan^{-1}\left( [$ans[2]] \right) `], then [`\tan(A) = [$ans[2]]`]. If we sketch a right triangle with [`\angle A`], we can make its opposite side [`[$base]`] and its adjacent [`[$height]`]: + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(A) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \csc(A) &= \frac{1}{\sin(A)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \cos(A) &= \frac{\text{adjacent}}{\text{hypotenuse}} = [$ans[1]] \\ + \sec(A) &= \frac{1}{\cos(A)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination20.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination20.pg new file mode 100644 index 0000000000..b1a7644d6d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination20.pg @@ -0,0 +1,264 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = random(1,int($den/2),1); +} until gcd($num[0],$den)==1 && $num[0]/$den<0.5; + +$num[1] = $den-$num[0]; +$num[2] = $num[0]+$den; +$num[3] = 2*$den-$num[0]; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} +$valuesShow[3] = &input(Fraction(-$num[0],$den)); +$ans3Show = &output(Fraction(-$num[0],$den)); + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$valuesShow[0]"); +$ans[1] = Compute("$valuesShow[0]"); +$ans[2] = Compute("$valuesShow[3]"); +$ans[3] = Compute("$valuesShow[3]"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'bottom',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $valuesShow[3]",'red',$Alor,'top',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'bottom',large)); +$graph->lb(new Label($Bx,-$By,"C: $valuesShow[2]",'red',$Blor,'top',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $valuesShow[2] and D: $valuesShow[3] are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \sin^{-1} \left( \sin \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle, the [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOE`], or the length of [`AE`]) is simply [`\sin \left( [$values[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[0]] \right) \right) + &= \sin^{-1} \left( \text{length of }AE \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part b + + [`` \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) = \sin^{-1} \left( \text{length of }BF \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`BF`] and [`AE`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) + &= \sin^{-1} \left( \text{length of }BF \right) \\ + &= \sin^{-1} \left( \text{length of }AE \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part c + + [`` \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) = \sin^{-1} \left( \text{length of }CF \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`CF`] and [`DE`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) + &= \sin^{-1} \left( \text{length of }CF \right) \\ + &= \sin^{-1} \left( \text{length of }DE \right) \\ + &= [$ans3Show] + \end{aligned}``] + +###Part d + +First, recognize that [` [$values[3]] `] and [` [$ans3Show] `] are located on the same point on the Unit Circle, Point [`D`] in the figure above. + + [`` \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) = \sin^{-1} \left( \text{length of }DE \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) + &= \sin^{-1} \left( \text{length of }DE \right) \\ + &= [$ans3Show] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination30.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination30.pg new file mode 100644 index 0000000000..697b1de902 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination30.pg @@ -0,0 +1,264 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = -random(1,int($den/2),1); +} until gcd(abs($num[0]),$den)==1 && abs($num[0])/$den<0.5; + +$num[1] = -($den-abs($num[0])); +$num[2] = -(abs($num[0])+$den); +$num[3] = -(2*$den-abs($num[0])); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} +$valuesShow[3] = &input(Fraction(-$num[0],$den)); +$ans3Show = &output(Fraction(-$num[0],$den)); + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$valuesShow[0]"); +$ans[1] = Compute("$valuesShow[0]"); +$ans[2] = Compute("$valuesShow[3]"); +$ans[3] = Compute("$valuesShow[3]"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'top',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $valuesShow[3]",'red',$Alor,'bottom',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'top',large)); +$graph->lb(new Label($Bx,-$By,"C: $valuesShow[2]",'red',$Blor,'bottom',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $valuesShow[2] and D: $valuesShow[3] are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \sin^{-1} \left( \sin \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle, the [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOE`], or the length of [`AE`]) is simply [`\sin \left( [$values[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[0]] \right) \right) + &= \sin^{-1} \left( \text{length of }AE \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part b + + [`` \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) = \sin^{-1} \left( \text{length of }BF \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`BF`] and [`AE`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[1]] \right) \right) + &= \sin^{-1} \left( \text{length of }BF \right) \\ + &= \sin^{-1} \left( \text{length of }AE \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part c + + [`` \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) = \sin^{-1} \left( \text{length of }CF \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`CF`] and [`DE`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[2]] \right) \right) + &= \sin^{-1} \left( \text{length of }CF \right) \\ + &= \sin^{-1} \left( \text{length of }DE \right) \\ + &= [$ans3Show] + \end{aligned}``] + +###Part d + +First, recognize that [` [$values[3]] `] and [` [$ans3Show] `] are located on the same point on the Unit Circle, Point [`D`] in the figure above. + + [`` \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) = \sin^{-1} \left( \text{length of }DE \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$values[3]] \right) \right) + &= \sin^{-1} \left( \text{length of }DE \right) \\ + &= [$ans3Show] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination35.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination35.pg new file mode 100644 index 0000000000..d1af850e36 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination35.pg @@ -0,0 +1,235 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@num = (); +for my $i (0..3) { + $num[$i] = random(int(10*(3*$i+1)*pi/6+0.5)/10, int(10*(3*$i+2)*pi/6+0.5)/10, 0.1); +} + +@ans = (); +$ans[0] = Compute("$num[0]"); +$ans[1] = Compute("pi-$num[1]"); +$ans[2] = Compute("pi-$num[2]"); +$ans[3] = Compute("$num[3]-2*pi"); + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]); + $Ay[$i] = $r*sin($num[$i]); + $Bx[$i] = $r*cos($ans[$i]); + $By[$i] = $r*sin($ans[$i]); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $num[$i]",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + if ( ($i==1) || ($i==2) ) { + $graph[$i] -> stamps( closed_circle( $Bx[$i], $By[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Bx[$i], 0, red ) ); + $Blor = ($Bx[$i]>0) ? "left" : "center"; + $Buod = ($By[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Bx[$i],$By[$i],"B",'red',$Blor,$Buod,large)); + $Dlor = ($Bx[$i]>0) ? "left" : "right"; + $Duod = ($By[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Bx[$i],0,"D",'red',$Dlor,$Duod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Bx[$i], $By[$i], red, 2); + $graph[$i]->lineTo($Bx[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Bx[$i]>0) ? -0.4 : 0.4; + $yShift = ($By[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Bx[$i], $yShift); + $graph[$i]->lineTo($Bx[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Bx[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] and point B (a refleciton of A by the y-axis) are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at D. BOD is a right triangle, with angle D being the right angle."; + } + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +############################################## + +BEGIN_PGML + +Evalute the following with your knowledge about the Unit Circle. All numbers are in radians. + +a) [`` \sin^{-1} \left( \sin \left( [$num[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \sin^{-1} \left( \sin \left( [$num[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \sin^{-1} \left( \sin \left( [$num[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \sin^{-1} \left( \sin \left( [$num[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +$ans2N = -$ans[2]; + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$num[0]]`] radians corresponds to point [`A`] on the Unit Circle, the [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOC`], or the length of [`AC`]) is simply [`\sin \left( [$num[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$num[0]] \right) \right) + &= \sin^{-1} \left( \text{length of }AC \right) \\ + &= [$num[0]] + \end{aligned}``] + +###Part b + +>>[@ $fig[1] @]*<< + + [`` \sin^{-1} \left( \sin \left( [$num[1]] \right) \right) = \sin^{-1} \left( \text{length of }AC \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`AC`] and [`BD`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$num[1]] \right) \right) + &= \sin^{-1} \left( \text{length of }AC \right) \\ + &= \sin^{-1} \left( \text{length of }BD \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }AF \\ + &= \text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA \\ + &= \pi - [$num[1]] + \end{aligned}``] + +###Part c + +>>[@ $fig[2] @]*<< + + [`` \sin^{-1} \left( \sin \left( [$num[2]] \right) \right) = \sin^{-1} \left( \text{length of }AC \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], and because the length of [`AC`] and [`BD`] are equal, measure of arc [`EB`] is the answer to this part. We have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$num[2]] \right) \right) + &= \sin^{-1} \left( \text{length of }AC \right) \\ + &= \sin^{-1} \left( \text{length of }BD \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }FA \\ + &= \text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}\\ + &= [$num[2]] - \pi\\ + \end{aligned}``] + +Since Point B corresponds to a negative angle, the answer to this part is [`-([$num[2]] - \pi)=\pi-[$num[2]]`] radians. + +###Part d + +>>[@ $fig[3] @]*<< + + [`` \sin^{-1} \left( \sin \left( [$num[3]] \right) \right) = \sin^{-1} \left( \text{length of }AC \right)``] + +Because the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right]`], but [`[$num[3]]`] is not in this range, we have to go backward one round starting at Point A: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$num[3]] \right) \right) + &= \sin^{-1} \left( \text{length of }AC \right) \\ + &= [$num[3]]-2\pi + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination40.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination40.pg new file mode 100644 index 0000000000..3c582595c3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination40.pg @@ -0,0 +1,254 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = random(1,int($den/2),1); +} until gcd($num[0],$den)==1 && $num[0]/$den<0.5; + +$num[1] = $den-$num[0]; +$num[2] = $num[0]+$den; +$num[3] = 2*$den-$num[0]; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$valuesShow[0]"); +$ans[1] = Compute("$valuesShow[1]"); +$ans[2] = Compute("$valuesShow[1]"); +$ans[3] = Compute("$valuesShow[0]"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'bottom',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $valuesShow[3]",'red',$Alor,'top',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'bottom',large)); +$graph->lb(new Label($Bx,-$By,"C: $valuesShow[2]",'red',$Blor,'top',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $valuesShow[2] and D: $valuesShow[3] are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \cos^{-1} \left( \cos \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \cos^{-1} \left( \cos \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle, the [`y`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOE`], or the length of [`OE`]) is simply [`\cos \left( [$values[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[0]] \right) \right) + &= \cos^{-1} \left( \text{length of }OE \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part b + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[1]] \right) \right) + &= \cos^{-1} \left( \text{length of }OF \right) \\ + &= [$values[1]] + \end{aligned}``] + +###Part c + + [`` \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) = \cos^{-1} \left( \text{length of }OF \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) + &= \cos^{-1} \left( \text{length of }OF \right) \\ + &= [$values[1]] + \end{aligned}``] + +###Part d + + [`` \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) = \cos^{-1} \left( \text{length of }OE \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) + &= \cos^{-1} \left( \text{length of }OE \right) \\ + &= [$values[0]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination50.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination50.pg new file mode 100644 index 0000000000..cf0a3474f7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination50.pg @@ -0,0 +1,277 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = -random(1,int($den/2),1); +} until gcd(abs($num[0]),$den)==1 && abs($num[0])/$den<0.5; + +$num[1] = -($den-abs($num[0])); +$num[2] = -(abs($num[0])+$den); +$num[3] = -(2*$den-abs($num[0])); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} + +$ans0In = &input(Fraction(-$num[0],$den)); +$ans1In = &input(Fraction($den+$num[0],$den)); +$ans0Show = &output(Fraction(-$num[0],$den)); +$ans1Show = &output(Fraction($den+$num[0],$den)); + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$ans0In"); +$ans[1] = Compute("$ans1In"); +$ans[2] = Compute("$ans1In"); +$ans[3] = Compute("$ans0In"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'top',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $ans0In",'red',$Alor,'bottom',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'top',large)); +$graph->lb(new Label($Bx,-$By,"C: $ans1In",'red',$Blor,'bottom',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $ans1In and D: $ans0In are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \cos^{-1} \left( \cos \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \cos^{-1} \left( \cos \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle, the [`y`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOE`], or the length of [`OE`]) is simply [`\cos \left( [$values[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[0]] \right) \right) + &= \cos^{-1} \left( \text{length of }OE \right) \\ + \end{aligned}``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[0]] \right) \right) + &= \cos^{-1} \left( \text{length of }OE \right) \\ + &= [$ans0Show] + \end{aligned}``] + +###Part b + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[1]] \right) \right) + &= \cos^{-1} \left( \text{length of }OF \right) \\ + \end{aligned}``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[1]] \right) \right) + &= \cos^{-1} \left( \text{length of }OF \right) \\ + &= [$ans1Show] + \end{aligned}``] + +###Part c + +Recognize that [`[$values[2]]`] and [`[$ans1Show]`] are located at the same point, Point [`C`], on the Unit Circle. + + [`` \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) = \cos^{-1} \left( \text{length of }OF \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[2]] \right) \right) + &= \cos^{-1} \left( \text{length of }OF \right) \\ + &= [$ans1Show] + \end{aligned}``] + +###Part d + +Recognize that [`[$values[3]]`] and [`[$ans0Show]`] are located at the same point, Point [`D`], on the Unit Circle. + + [`` \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) = \cos^{-1} \left( \text{length of }OE \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], we have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$values[3]] \right) \right) + &= \cos^{-1} \left( \text{length of }OE \right) \\ + &= [$ans0Show] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination55.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination55.pg new file mode 100644 index 0000000000..7061e9c80a --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination55.pg @@ -0,0 +1,223 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@num = (); +for my $i (0..3) { + $num[$i] = random(int(10*(3*$i+1)*pi/6+0.5)/10, int(10*(3*$i+2)*pi/6+0.5)/10, 0.1); +} + +@ans = (); +$ans[0] = Compute("$num[0]"); +$ans[1] = Compute("$num[1]"); +$ans[2] = Compute("2*pi-$num[2]"); +$ans[3] = Compute("2*pi-$num[3]"); + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]); + $Ay[$i] = $r*sin($num[$i]); + $Bx[$i] = $r*cos($ans[$i]); + $By[$i] = $r*sin($ans[$i]); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $num[$i]",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Olor = ($Ax[$i]>0) ? 'right' : 'left'; + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + if ( ($i==2) || ($i==3) ) { + $graph[$i] -> stamps( closed_circle( $Bx[$i], $By[$i], red ) ); + $Blor = ($Bx[$i]>0) ? "left" : "center"; + $Buod = ($By[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Bx[$i],$By[$i],"B",'red',$Blor,$Buod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Bx[$i], $By[$i], red, 2); + $graph[$i]->lineTo($Bx[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Bx[$i]>0) ? -0.4 : 0.4; + $yShift = ($By[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Bx[$i], $yShift); + $graph[$i]->lineTo($Bx[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Bx[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] and point B (a refleciton of A by the x-axis) are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, also crossing the x-axis at C. BOC is a right triangle, with angle C being the right angle."; + } + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +############################################## + +BEGIN_PGML + +Evalute the following with your knowledge about the Unit Circle. All numbers are in radians. + +a) [`` \cos^{-1} \left( \cos \left( [$num[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \cos^{-1} \left( \cos \left( [$num[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \cos^{-1} \left( \cos \left( [$num[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \cos^{-1} \left( \cos \left( [$num[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$num[0]]`] radians corresponds to point [`A`] on the Unit Circle, the [`x`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOC`], or the length of [`AC`]) is simply [`\cos \left( [$num[0]] \right)`]. + +###Part a + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$num[0]] \right) \right) + &= \cos^{-1} \left( \text{length of }OC \right) \\ + &= [$num[0]] + \end{aligned}``] + +###Part b + +>>[@ $fig[1] @]*<< + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$num[1]] \right) \right) + &= \cos^{-1} \left( \text{length of }OC \right) \\ + &= [$num[1]] + \end{aligned}``] + +###Part c + +>>[@ $fig[2] @]*<< + + [`` \cos^{-1} \left( \cos \left( [$num[2]] \right) \right) = \cos^{-1} \left( \text{length of }OC \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], measure of minor arc [`EB`] is the answer to this part. We have: + + [``\begin{aligned} + \cos^{-1} \left( \cos \left( [$num[2]] \right) \right) + &= \cos^{-1} \left( \text{length of }OC \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }EA \\ + &= \text{measure of major arc }EFE \text{ (one round)} - \text{measure of major arc }EFA \\ + &= 2\pi - [$num[2]] \\ + \end{aligned}``] + +###Part d + +>>[@ $fig[3] @]*<< + + [`` \cos^{-1} \left( \cos \left( [$num[3]] \right) \right) = \cos^{-1} \left( \text{length of }OC \right)``] + +Because the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right]`], measure of minor arc EB is the answer to this part. We have: + + [``\begin{aligned} + \cos^{-1} \left( \sin \left( \cos( [$num[3]] ) \right) \right) + &= \cos^{-1} \left( \text{length of }OC \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }EA \\ + &= \text{measure of major arc }EFE \text{ (one round)} - \text{measure of major arc }EFA \\ + &= 2\pi - [$num[3]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination60.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination60.pg new file mode 100644 index 0000000000..4d815de244 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination60.pg @@ -0,0 +1,269 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = random(1,int($den/2),1); +} until gcd($num[0],$den)==1 && $num[0]/$den<0.5; + +$num[1] = $den-$num[0]; +$num[2] = $num[0]+$den; +$num[3] = 2*$den-$num[0]; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} +$valuesShow[3] = &input(Fraction(-$num[0],$den)); +$ans2Show = &output(Fraction(-$num[0],$den)); + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$valuesShow[0]"); +$ans[1] = Compute("$valuesShow[3]"); +$ans[2] = Compute("$valuesShow[0]"); +$ans[3] = Compute("$valuesShow[3]"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'bottom',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $valuesShow[3]",'red',$Alor,'top',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'bottom',large)); +$graph->lb(new Label($Bx,-$By,"C: $valuesShow[2]",'red',$Blor,'top',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $valuesShow[2] and D: $valuesShow[3] are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \tan^{-1} \left( \tan \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle: + +* The [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOE`], or the length of [`AE`]) is simply [`\sin \left( [$values[0]] \right)`]. +* The [`x`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOE`], or the length of [`OE`]) is simply [`\cos \left( [$values[0]] \right)`]. +* [`\tan \left( [$values[0]] \right) = \frac{\sin \left( [$values[0]] \right)}{\cos \left( [$values[0]] \right)} = \frac{AE}{OE}`] + +###Part a + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[0]] \right) \right) + &= \tan^{-1} \left( \frac{AE}{OE} \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part b + + [`` \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) = \tan^{-1} \left( \frac{BF}{OF} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{BF}{OF}`] and [`\frac{DE}{OE}`] are equal, we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) + &= \tan^{-1} \left( \frac{BF}{OF} \right) \\ + &= \tan^{-1} \left( \frac{DE}{OE} \right) \\ + &= [$ans2Show] + \end{aligned}``] + +###Part c + + [`` \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) = \tan^{-1} \left( \frac{CF}{OF} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{CF}{OF}`] and [`\frac{AE}{OE}`] are equal, we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) + &= \tan^{-1} \left( \frac{CF}{OF} \right) \\ + &= \tan^{-1} \left( \frac{AE}{OE} \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part d + +First, recognize that [` [$values[3]] `] and [` [$ans2Show] `] are located on the same point on the Unit Circle, Point [`D`] in the figure above. + + [`` \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) = \tan^{-1} \left( \frac{DE}{OE} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) + &= \tan^{-1} \left( \frac{DE}{OE} \right) \\ + &= [$ans2Show] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination70.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination70.pg new file mode 100644 index 0000000000..9a55569ebd --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination70.pg @@ -0,0 +1,268 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +@num = (); +do { + $den = random(3,9,1); + $num[0] = -random(1,int($den/2),1); +} until gcd(abs($num[0]),$den)==1 && abs($num[0])/$den<0.5; + +$num[1] = -($den-abs($num[0])); +$num[2] = -(abs($num[0])+$den); +$num[3] = -(2*$den-abs($num[0])); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@frac = (); +@values = (); +@valuesShow = (); +for my $i (0..3) { + $frac[$i] = Fraction($num[$i],$den); + $values[$i] = &output($frac[$i]); + $valuesShow[$i] = &input($frac[$i]); +} +$valuesShow[3] = &input(Fraction(-$num[0],$den)); +$ans3Show = &output(Fraction(-$num[0],$den)); + +Context("LimitedRadical"); + +@ans = (); +$ans[0] = Compute("$valuesShow[0]"); +$ans[1] = Compute("$valuesShow[3]"); +$ans[2] = Compute("$valuesShow[0]"); +$ans[3] = Compute("$valuesShow[3]"); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$r = 5; +$Ax = $r*cos(Real($frac[0])*pi); +$Ay = $r*sin(Real($frac[0])*pi); +$Bx = $r*cos(Real($frac[1])*pi); +$By = $r*sin(Real($frac[1])*pi); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Ax, 0, red ) ); +$graph -> stamps( closed_circle( $Bx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Ax>0) { + $Alor = ($Ax<$r/2) ? "left" : "center"; +} else { + $Alor = (-$Ax>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Ax,$Ay,"A: $valuesShow[0]",'red',$Alor,'top',large)); +$graph->lb(new Label($Ax,-$Ay,"D: $valuesShow[3]",'red',$Alor,'bottom',large)); + +if ($Bx>0) { + $Blor = ($Bx<$r/2) ? "left" : "center"; +} else { + $Blor = (-$Bx>$r/2) ? "center" : "right"; +} +$graph->lb(new Label($Bx,$By,"B: $valuesShow[1]",'red',$Blor,'top',large)); +$graph->lb(new Label($Bx,-$By,"C: $valuesShow[2]",'red',$Blor,'bottom',large)); + +$Olor = ($frac[0]<0.5) ? 'center' : 'left'; +$Ouod = ($frac[0]<0.5) ? 'bottom' : 'middle'; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph->lb(new Label($Ax,0,"E",'red','left','top',large)); +$graph->lb(new Label($Bx,0,"F",'red','right','top',large)); + +for my $i (0..3) { + $graph->moveTo(0,0); + $graph->lineTo($r*cos(Real($frac[$i])*pi), $r*sin(Real($frac[$i])*pi), red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi), 0, red, 2); + $graph->lineTo(0, 0, red, 2); + + $xShift = (cos(Real($frac[$i])*pi)>0) ? -0.4 : 0.4; + $yShift = (sin(Real($frac[$i])*pi)>0) ? 0.4 : -0.4; + $graph->moveTo($r*cos(Real($frac[$i])*pi), $yShift); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, $yShift, red, 2); + $graph->lineTo($r*cos(Real($frac[$i])*pi)+$xShift, 0, red, 2); +} + +$alt = "A unit circle has O as its center. On the unit circle, point A: $valuesShow[0], B: $valuesShow[1], C: $valuesShow[2] and D: $valuesShow[3] are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at E. AOE is a right triangle, with angle E being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at F. BOF is a right triangle, with angle F being the right angle. CF is connected, forming a right triangle COF. DE is connected, forming a right triangle DOE."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +When you do the following problems, don't use a calculator. Use your knowledge about the Unit Circle instead. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) [`` \tan^{-1} \left( \tan \left( [$values[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle: + +* The [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOE`], or the length of [`AE`]) is simply [`\sin \left( [$values[0]] \right)`]. +* The [`x`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOE`], or the length of [`OE`]) is simply [`\cos \left( [$values[0]] \right)`]. +* [`\tan \left( [$values[0]] \right) = \frac{\sin \left( [$values[0]] \right)}{\cos \left( [$values[0]] \right)} = \frac{AE}{OE}`] + +###Part a + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[0]] \right) \right) + &= \tan^{-1} \left( \frac{AE}{OE} \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part b + + [`` \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) = \tan^{-1} \left( \frac{BF}{OF} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{BF}{OF}`] and [`\frac{DE}{OE}`] are equal, we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[1]] \right) \right) + &= \tan^{-1} \left( \frac{BF}{OF} \right) \\ + &= \tan^{-1} \left( \frac{DE}{OE} \right) \\ + &= [$ans3Show] + \end{aligned}``] + +###Part c + + [`` \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) = \tan^{-1} \left( \frac{CF}{OF} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{CF}{OF}`] and [`\frac{AE}{OE}`] are equal, we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[2]] \right) \right) + &= \tan^{-1} \left( \frac{CF}{OF} \right) \\ + &= \tan^{-1} \left( \frac{AE}{OE} \right) \\ + &= [$values[0]] + \end{aligned}``] + +###Part d + +First, recognize that [` [$values[3]] `] and [` [$ans3Show] `] are located on the same point on the Unit Circle, Point [`D`] in the figure above. + + [`` \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) = \tan^{-1} \left( \frac{DE}{OE} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$values[3]] \right) \right) + &= \tan^{-1} \left( \frac{DE}{OE} \right) \\ + &= [$ans3Show] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination75.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination75.pg new file mode 100644 index 0000000000..3315161cf5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination75.pg @@ -0,0 +1,240 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@num = (); +for my $i (0..3) { + $num[$i] = random(int(10*(3*$i+1)*pi/6+0.5)/10, int(10*(3*$i+2)*pi/6+0.5)/10, 0.1); +} + +@ans = (); +$ans[0] = Compute("$num[0]"); +$ans[1] = Compute("$num[1]-pi"); +$ans[2] = Compute("$num[2]-pi"); +$ans[3] = Compute("$num[3]-2*pi"); + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]); + $Ay[$i] = $r*sin($num[$i]); + $Bx[$i] = $r*cos($ans[$i]); + $By[$i] = $r*sin($ans[$i]); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $num[$i]",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Olor = ($Ax[$i]>0) ? 'left' : 'right'; + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + if ( ($i==1) || ($i==2) ) { + $graph[$i] -> stamps( closed_circle( $Bx[$i], $By[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Bx[$i], 0, red ) ); + $Blor = ($Bx[$i]>0) ? "left" : "center"; + $Buod = ($By[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Bx[$i],$By[$i],"B",'red',$Blor,$Buod,large)); + $Dlor = ($Bx[$i]>0) ? "left" : "right"; + $Duod = ($By[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Bx[$i],0,"D",'red',$Dlor,$Duod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Bx[$i], $By[$i], red, 2); + $graph[$i]->lineTo($Bx[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Bx[$i]>0) ? -0.4 : 0.4; + $yShift = ($By[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Bx[$i], $yShift); + $graph[$i]->lineTo($Bx[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Bx[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] and point B (a refleciton of A by the y-axis) are marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle. Similarly, from B, a vertical line is drawn toward the x-axis, crossing the x-axis at D. BOD is a right triangle, with angle D being the right angle."; + } + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +############################################## + +BEGIN_PGML + +Evalute the following with your knowledge about the Unit Circle. All numbers are in radians. + +a) [`` \tan^{-1} \left( \tan \left( [$num[0]] \right) \right) = ``][____________]{$ans[0]} + +b) [`` \tan^{-1} \left( \tan \left( [$num[1]] \right) \right) = ``][____________]{$ans[1]} + +c) [`` \tan^{-1} \left( \tan \left( [$num[2]] \right) \right) = ``][____________]{$ans[2]} + +d) [`` \tan^{-1} \left( \tan \left( [$num[3]] \right) \right) = ``][____________]{$ans[3]} + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +$ans2N = -$ans[2]; + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[0]]`] corresponds to point [`A`] on the Unit Circle: + +* The [`y`]-value of [`A`]'s coordinates (height of the right triangle [`\Delta AOC`], or the length of [`AC`]) is simply [`\sin \left( [$num[0]] \right)`]. +* The [`x`]-value of [`A`]'s coordinates (base of the right triangle [`\Delta AOC`], or the length of [`OC`]) is simply [`\cos \left( [$num[0]] \right)`]. +* [`\tan \left( [$num[0]] \right) = \frac{\sin \left( [$num[0]] \right)}{\cos \left( [$num[0]] \right)} = \frac{AC}{OC}`] + +###Part a + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$num[0]] \right) \right) + &= \tan^{-1} \left( \frac{CA}{CO} \right) \\ + &= [$num[0]] + \end{aligned}``] + +###Part b + +>>[@ $fig[1] @]*<< + + [`` \tan^{-1} \left( \tan \left( [$num[1]] \right) \right) = \tan^{-1} \left( \frac{CA}{CO} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{CA}{CO}`] and [`\frac{DB}{DB}`] are equal, we have: + + [``\begin{aligned} + \sin^{-1} \left( \sin \left( [$num[1]] \right) \right) + &= \sin^{-1} \left( \frac{CA}{CO} \right) \\ + &= \sin^{-1} \left( \frac{DB}{DB} \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }AF \\ + &= \text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA \\ + &= \pi - [$num[1]] + \end{aligned}``] + +Since Point B corresponds to a negative angle, the answer to this part is [`-(\pi - [$num[1]])=[$num[1]]-\pi`] radians. + +###Part c + +>>[@ $fig[2] @]*<< + + [`` \tan^{-1} \left( \tan \left( [$num[2]] \right) \right) = \tan^{-1} \left( \frac{CA}{CO} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], and because the ratio of [`\frac{CA}{CO}`] and [`\frac{DB}{DB}`] are equal, we have: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$num[2]] \right) \right) + &= \tan^{-1} \left( \frac{CA}{CO} \right) \\ + &= \tan^{-1} \left( \frac{DB}{DB} \right) \\ + &= \text{measure of minor arc }EB \\ + &= \text{measure of minor arc }FA \\ + &= \text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}\\ + &= [$num[2]] - \pi\\ + \end{aligned}``] + +###Part d + +>>[@ $fig[3] @]*<< + + [`` \tan^{-1} \left( \tan \left( [$num[3]] \right) \right) = \tan^{-1} \left( \frac{CA}{CO} \right)``] + +Because the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], but [`[$num[3]]`] is not in this range, we have to go backward one round starting at Point A: + + [``\begin{aligned} + \tan^{-1} \left( \tan \left( [$num[3]] \right) \right) + &= \tan^{-1} \left( \frac{CA}{CO} \right) \\ + &= [$num[3]]-2\pi + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination80.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination80.pg new file mode 100644 index 0000000000..e865a72ecd --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination80.pg @@ -0,0 +1,193 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 4; + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@DataTable( + [ + [ + [PF('[`\cos\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +$absBase = abs($base); +$absHeight = abs($height); + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `], either in Quadrant I or Quadrant IV. + +Since [`[$ans[0]]<0`], the angle [`\sin^{-1}\left( [$ans[0]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$absBase]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination81.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination81.pg new file mode 100644 index 0000000000..9ad2c74b79 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination81.pg @@ -0,0 +1,276 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $heightOut = -random(1,5,1); + $heightIn = list_random(1,2,3,5); + $hypotenuseOut = random(int(abs($heightOut)*$heightIn**2)+2,int(abs($heightOut)*$heightIn**2)+10,1); + } until (gcd($heightOut,$hypotenuseOut)==1); + $hypotenuseIn = 1; + ($baseOut,$baseIn) = &radSimplify($hypotenuseOut**2-$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && !(($baseOut>0) && ($heightOut>0)) && ($baseIn<=30); + + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + if ($baseIn==1) { + $base = $baseOut; + $absBase = abs($baseOut); + } elsif (abs($baseOut)==1) { + $base = ($baseOut>0) ? Formula("sqrt($baseIn)") : Formula("-sqrt($baseIn)"); + $absBase = Formula("sqrt($baseIn)"); + } else { + $base = Formula("$baseOut*sqrt($baseIn)"); + $absBaseOut = abs($baseOut); + $absBase = Formula("$absBaseOut*sqrt($baseIn)"); + } + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + $hypotenuse = $hypotenuseOut; + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\cos\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot\left(\sin^{-1}\left( [$ans[0]] \right)\right)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `], either in Quadrant I or Quadrant IV. + +Since [`[$ans[0]]<0`], the angle [`\sin^{-1}\left( [$ans[0]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$base]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination90.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination90.pg new file mode 100644 index 0000000000..c3c76e0dd2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination90.pg @@ -0,0 +1,193 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 2; + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\tan\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot\left(\cos^{-1}\left( [$ans[1]] \right)\right)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +$absBase = abs($base); +$absHeight = abs($height); + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `], either in Quadrant I or Quadrant II. + +Since [`[$ans[1]]<0`], the angle [`\cos^{-1}\left( [$ans[1]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$absHeight]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination91.pg b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination91.pg new file mode 100644 index 0000000000..ad46ab396c --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/InverseTrig/TrigInverseCombination91.pg @@ -0,0 +1,278 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "PCCmacros.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $heightOut = random(1,5,1); + $heightIn = list_random(1,2,3,5); + $hypotenuseOut = random(int(abs($heightOut)*$heightIn**2)+2,int(abs($heightOut)*$heightIn**2)+10,1); + } until (gcd($heightOut,$hypotenuseOut)==1); + $hypotenuseIn = 1; + ($baseOut,$baseIn) = &radSimplify($hypotenuseOut**2-$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && ($baseIn<=30); + + $baseOut = -$baseOut; + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + if ($baseIn==1) { + $base = $baseOut; + $absBase = abs($baseOut); + } elsif (abs($baseOut)==1) { + $base = ($baseOut>0) ? Formula("sqrt($baseIn)") : Formula("-sqrt($baseIn)"); + $absBase = Formula("sqrt($baseIn)"); + } else { + $base = Formula("$baseOut*sqrt($baseIn)"); + $absBaseOut = abs($baseOut); + $absBase = Formula("$absBaseOut*sqrt($baseIn)"); + } + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + $hypotenuse = $hypotenuseOut; + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +Find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin \left( \cos^{-1}\left( [$ans[1]] \right) \right)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc \left( \cos^{-1}\left( [$ans[1]] \right) \right)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\tan \left( \cos^{-1}\left( [$ans[1]] \right) \right)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot \left( \cos^{-1}\left( [$ans[1]] \right) \right)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Recall that the range of [`y=\cos^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `], either in Quadrant I or Quadrant II. + +Since [`[$ans[1]]<0`], the angle [`\cos^{-1}\left( [$ans[1]] \right)`] must be in Quadrant [$Q]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$absHeight]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosines10.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosines10.pg new file mode 100644 index 0000000000..7831ac00a6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosines10.pg @@ -0,0 +1,145 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(31, 50, 1); +$c = random(10, 30 ,1); +$a = random(40, 50, 1); +$b2 = $a**2+$c**2-2*$a*$c*cos($B*pi/180); +$b = sqrt($b2); +$cosA = ($b**2+$c**2-$a**2)/(2*$b*$c); +$A = arccos( $cosA )*180/pi; +$C = 180-$A-$B; +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0],"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as b; the right side is marked as c; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +In this triangle, if [`m\angle B=[$B]^{\circ}`], [`c=[$c]`] units and [`a=[$a]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`b = `][____________]{$b} units + + [`m\angle A= `][____________]{$A} degrees + + [`m\angle C= `][____________]{$C} degrees + + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +First, use Law of Cosines to calculate the length of [`b`]: + + [``\begin{aligned}[t] + b^2 &= a^2+c^2-2ac\cos(B) \\ + b &= \sqrt{a^2+c^2-2ac\cos(B)} \\ + b &= \sqrt{[$a]^2+[$c]^2-2([$a])([$c])\cos([$B]^{\circ})} \\ + b &\approx [$b] + \end{aligned}``] + +Next, we could use Law of Cosines or Law of Sines to calculate the measure of [`\angle A`]. To avoid considering two possible solutions when we use [`\sin^{-1}(x)`], it's always better to use Law of Cosines when we have a choice. + +So, we will use Law of Cosines again to calculate the measure of [`\angle A`]: + + [``\begin{aligned}[t] + a^2 &= b^2+c^2-2bc\cos(A) \\ + \cos(A) &= \frac{b^2+c^2-a^2}{2bc} \\ + m\angle A &= \cos^{-1}\left( \frac{b^2+c^2-a^2}{2bc} \right) \\ + m\angle A &= \cos^{-1}\left( \frac{[$b]^2+[$c]^2-[$a]^2}{2([$b])([$c])} \right)\\ + m\angle A &\approx [$A]^{\circ} \\ + \end{aligned}``] + +Finally, calculate [`m\angle C`]: + + [``\begin{aligned}[t] + m\angle C &= 180^{\circ} - m\angle A - m\angle B \\ + &= 180^{\circ} - [$A]^{\circ} - [$B]^{\circ} \\ + & =[$C]^{\circ} + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosines20.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosines20.pg new file mode 100644 index 0000000000..28deaa9551 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosines20.pg @@ -0,0 +1,146 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(31, 50, 1); +$c = random(10, 30 ,1); +$a = random(40, 50, 1); +$b2 = $a**2+$c**2-2*$a*$c*cos($B*pi/180); +$b = int(sqrt($b2)); +$A = arccos( ($b**2+$c**2-$a**2)/(2*$b*$c) )*180/pi; +$B = arccos( ($a**2+$c**2-$b**2)/(2*$a*$c) )*180/pi; +$C = 180-$A-$B; +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0],"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as b; the right side is marked as c; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +In this triangle, if [`a=[$a]`], [`b=[$b]`] and [`c=[$c]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A = `][____________]{$A} degrees + + [`m\angle B= `][____________]{$B} degrees + + [`m\angle C= `][____________]{$C} degrees + + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +First, we will use Law of Cosines again to calculate the measure of [`\angle B`]: + + [``\begin{aligned}[t] + b^2 &= a^2+c^2-2ac\cos(B) \\ + \cos(B) &= \frac{a^2+c^2-b^2}{2ac} \\ + m\angle B &= \cos^{-1}\left( \frac{a^2+c^2-b^2}{2ac} \right) \\ + m\angle B &= \cos^{-1}\left( \frac{[$a]^2+[$c]^2-[$b]^2}{2([$a])([$c])} \right)\\ + m\angle B &\approx [$B]^{\circ} \\ + \end{aligned}``] + +Next, we could use Law of Cosines or Law of Sines to calculate the measure of [`\angle A`]. To avoid considering two possible solutions when we use [`\sin^{-1}(x)`], it's always better to use Law of Cosines when we have a choice. + +So, we will use Law of Cosines again to calculate the measure of [`\angle A`]: + + [``\begin{aligned}[t] + a^2 &= b^2+c^2-2bc\cos(A) \\ + \cos(A) &= \frac{b^2+c^2-a^2}{2bc} \\ + m\angle A &= \cos^{-1}\left( \frac{b^2+c^2-a^2}{2bc} \right) \\ + m\angle A &= \cos^{-1}\left( \frac{[$b]^2+[$c]^2-[$a]^2}{2([$b])([$c])} \right)\\ + m\angle A &\approx [$A]^{\circ} \\ + \end{aligned}``] + +Finally, we can calculate [`m\angle C`]: + + [``\begin{aligned}[t] + m\angle C &= 180^{\circ} - m\angle A - m\angle B \\ + &= 180^{\circ} - [$A]^{\circ} - [$B]^{\circ} \\ + & =[$C]^{\circ} + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosines30.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosines30.pg new file mode 100644 index 0000000000..8d638ab12c --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosines30.pg @@ -0,0 +1,134 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(31, 50, 1); +$c = random(10, 30 ,1); +$a = random(40, 50, 1); +$b2 = $a**2+$c**2-2*$a*$c*cos($B*pi/180); +$b = int(sqrt($b2)); +$A = arccos( ($b**2+$c**2-$a**2)/(2*$b*$c) )*180/pi; +$B = arccos( ($a**2+$c**2-$b**2)/(2*$a*$c) )*180/pi; +$C = 180-$A-$B; +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0],"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as b; the right side is marked as c; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C."; + +$ans = Compute("DNE"); +$c = random(10,30,1); +$b = random(10,30,1); +$a = random($c+$b+1,$c+$b+10,1); + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +In this triangle, if [`a=[$a]`], [`b=[$b]`] and [`c=[$c]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A = `][____________]{$ans} degrees + + [`m\angle B= `][____________]{$ans} degrees + + [`m\angle C= `][____________]{$ans} degrees + + +END_PGML + +############################################## + +$s1 = ($a**2+$c**2-$b**2)/(2*$a*$c); + +BEGIN_PGML_SOLUTION + +We will use Law of Cosines again to calculate the measure of [`\angle B`]: + + [``\begin{aligned}[t] + b^2 &= a^2+c^2-2ac\cos(B) \\ + \cos(B) &= \frac{a^2+c^2-b^2}{2ac} \\ + m\angle B &= \cos^{-1}\left( \frac{a^2+c^2-b^2}{2ac} \right) \\ + m\angle B &= \cos^{-1}\left( \frac{[$a]^2+[$c]^2-[$b]^2}{2([$a])([$c])} \right)\\ + m\angle B &= \cos^{-1}([$s1]) + \end{aligned}``] + +Since [`[$s1]`] is not in the domain of [`y=\cos^{-1}(x)`], there is no solution for [`m\angle B`]. This triangle has no solution. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication10.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication10.pg new file mode 100644 index 0000000000..6a99ff58a1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication10.pg @@ -0,0 +1,140 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(30, 40, 1); +$c = random(10, 30 ,1); +$a = random(40, 50, 1); +$b2 = $a**2+$c**2-2*$a*$c*cos($B*pi/180); +$b = int(sqrt($b2)); +$A = arccos( ($b**2+$c**2-$a**2)/(2*$b*$c) )*180/pi; +$B = arccos( ($a**2+$c**2-$b**2)/(2*$a*$c) )*180/pi; +$C = 180-$A-$B; +$h = $c*sin($B*pi/180); + +$be = sqrt( $a**2+($b/2)**2-$a*$b*cos($C*pi/180) ); +$bd = 2*$be; + +$long = $a + $c*cos($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $long*240/210; +$ymin = 0; +$ymax = (210*$h/$long+30)*$h/(210*$h/$long); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx, Dx +@x = (($xmax-$long)/2+$c*cos($B*pi/180), ($xmax-$long)/2, ($xmax-$long)/2+$a, ($xmax+$long)/2); +# Ay, By, Cy, Dy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2, ($ymax+$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( $x[0], $y[0],"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1], $y[1],"B",'black','right','top','large')); +$picture->lb( new Label( $x[2], $y[2],"C",'black','left','top','large')); +$picture->lb( new Label( $x[3], $y[3],"D",'black','left','bottom','large')); +$picture->lb( new Label( ($x[0]+$x[2])/2, ($y[0]+$y[2])/2,"E",'black','center','bottom','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[3],$y[3], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); + +$picture->moveTo($x[1],$y[1]); +$picture->lineTo($x[3],$y[3], darkblue,3); + +$text = "This is a parallelogram ABCD, with A on top left, B on bottom left, C on bottom right, and D on top right. A is to the right of B, and D is to the right of C. Diagonals AC and BD intersects at E."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A parallelogram has sides of length [`[$a]`] units and [`[$c]`] units. The shorter diagonal is [`[$b]`] units. Find the measure of the longer diagonal. + +The longer diagonal's length is [____________]{$bd} units. + +END_PGML + +############################################## + +$ce = 0.5*$b; + +BEGIN_PGML_SOLUTION + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +By the given conditions, [`AB=[$c], BC=[$a], AC=[$b]`]. + +In [`\Delta ABC`], we can use Law of Cosines to calculate the measure of [`\angle ACB`]: + + [``\begin{aligned}[t] + AB^2 &= AC^2+BC^2-2\cdot AC \cdot BC \cdot \cos(\angle ACB) \\ + \cos(\angle ACB) &= \frac{AC^2+BC^2-AB^2}{2\cdot AC \cdot BC} \\ + m\angle ACB &= \cos^{-1}\left( \frac{AC^2+BC^2-AB^2}{2\cdot AC \cdot BC} \right) \\ + m\angle ACB &= \cos^{-1}\left( \frac{[$b]^2+[$a]^2-[$c]^2}{2([$b])([$a])} \right)\\ + m\angle ACB &\approx [$C]^{\circ} \\ + \end{aligned}``] + +In a parallelogram, its diagonals bisect each other. This implies [`CE=\frac{1}{2}CA=\frac{1}{2}([$b])=[$ce]`]. + +Next, in [`\Delta CEB`], we will use Law of Cosines again to calculate the length of [`BE`]: + + [``\begin{aligned}[t] + BE^2 &= BC^2+CE^2-2\cdot BC\cdot CE\cdot \cos(\angle ACB) \\ + BE &= \sqrt{ BC^2+CE^2-2\cdot BC\cdot CE\cdot \cos(\angle ACB) } \\ + BE &= \sqrt{ [$a]^2+[$ce]^2-2\cdot [$a]\cdot [$ce]\cdot \cos([$C]^{\circ}) } \\ + BE &\approx [$be] + \end{aligned}``] + +Finally, [`BD = 2BE = 2([$be]) = [$bd]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication20.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication20.pg new file mode 100644 index 0000000000..874a973561 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication20.pg @@ -0,0 +1,129 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@x = (); @y = (); +$n = list_random(3,4,5,6,8,9,10); +$r = 1; +$shift = $r/20; + +for my $i (0..1) { + $picture[$i] = init_graph(-$r*1.2,-$r*1.2,$r*1.2,$r*1.2,pixels=>[300,300]); + $picture[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $picture[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..$n-1) { + $x[$j] = $r*cos($j*2*pi/$n); + $y[$j] = $r*sin($j*2*pi/$n); + $picture[$i]->stamps( closed_circle($x[$j],$y[$j],blue) ); + } + $picture[$i]->moveTo($x[0],$y[0]); + for my $j (1..$n-1) { + $picture[$i]->lineTo($x[$j],$y[$j], blue,3); + } + $picture[$i]->lineTo($x[0],$y[0], blue,3); +} + +$picture[1]->moveTo($x[0],$y[0]); +$picture[1]->lineTo(0,0, blue,3); +$picture[1]->lineTo($x[1],$y[1], blue,3); +$picture[1]->lineTo($x[0],$y[0], blue,3); + +$picture[1]->lb( new Label(0-$shift,0,"O",'blue','right','middle','large')); +$picture[1]->lb( new Label($x[0]+$shift,$y[0],"A",'blue','left','middle','large')); +if ($n==3) { + $picture[1]->lb( new Label($x[1]-$shift,$y[1]+$shift,"B",'blue','left','middle','large')); +} else { + $picture[1]->lb( new Label($x[1]+$shift,$y[1]+$shift,"B",'blue','left','middle','large')); +} + +$text[0] = "This is a circle with an inscribed regular polygon ($n sides)."; +$text[1] = "This is a circle with an inscribed regular polygon ($n sides). A triangle is formed by two adjacent vertices (A and B) and the center of the circle (O)."; + +$theta = 360/$n; +$radius = random(2,10,1); +$side = sqrt(2*$radius**2-2*$radius**2*cos($theta*pi/180)); +$perimeter = $side*$n; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +If the radius of this circle is [`[$radius]`] units, find the perimeter of the regular polygon ([`[$n]`] sides) inscribed inside the circle. + +Perimeter = [_____________]{$perimeter} units + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +Connect two adjacent vertices and the circle's center, forming a triangle. + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +By the given conditions, [`OA=OB=[$radius], m\angle O=\frac{360^{\circ}}{[$n]}=[$theta]^{\circ}`]. + +In [`\Delta OAB`], we can use Law of Cosines to calculate the length of [`AB`]: + + [``\begin{aligned}[t] + AB^2 &= OA^2+OB^2-2\cdot OA\cdot OB\cdot \cos(\angle O) \\ + AB &= \sqrt{ OA^2+OB^2-2\cdot OA\cdot OB\cdot \cos(\angle O) } \\ + AB &= \sqrt{ [$radius]^2+[$radius]^2-2\cdot [$radius]\cdot [$radius]\cdot \cos([$theta]^{\circ}) } \\ + AB &\approx [$side] + \end{aligned}``] + +Finally, the perimeter of the polygon is [`[$n]([$side]) = [$perimeter]`] units. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication30.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication30.pg new file mode 100644 index 0000000000..b46f012665 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication30.pg @@ -0,0 +1,127 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + +do { + $A = random(50, 130, 1); +} until $A!=90; +do { + $c = random(100, 300, 1); + $b = random(100, 300, 1); +} until abs($b-$c)>20; + +$a = sqrt($b**2+$c**2-2*$b*$c*cos($A*pi/180)); +$B = arccos( ($a**2+$c**2-$b**2)/(2*$a*$c) )*180/pi; +$C = 180-$A-$B; +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +} until ( abs($x[0]-$x[1])>$xmax/10 && abs($x[0]-$x[2])>$xmax/10 ); + +for my $i (0..0) { +$picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"---- lake ----",'black','center','top','large')); +$picture[$i]->lb( new Label(($x[0]+$x[2])/2, ($y[0]+$y[1])/2,"$b m",'black','left','bottom','large')); +$picture[$i]->lb( new Label(($x[0]+$x[1])/2,($y[0]+$y[1])/2,"$c m",'black','right','bottom','large')); + +$picture[$i]->lb( new Label( $x[0], $y[0],"A",'black','center','bottom','large')); +$picture[$i]->lb( new Label( $x[0], $y[0]-4*$yLabelShift,"$A",'black','center','top','large')); +$picture[$i]->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture[$i]->new_color("darkblue", 100,100,255); + +$picture[$i]->moveTo($x[1],$y[1]); +$picture[$i]->lineTo($x[0],$y[0], darkblue,3); +$picture[$i]->lineTo($x[2],$y[2], darkblue,3); + +} + +$text[0] = "This is a triangle with one side parallel to the ground; this side is marked as the lake; the left side is marked as $b m; the right side is marked as $c m; the top angle is marked as A, which is $A degrees; the left side angle is marked as B; the right side angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +A surveyor stands at Point A, and is trying to measure of width of a lake. Point B and Point C are two ends of the lake. The distance from the surveyor to B is [`[$c]`] meters, and from the surveyor to C is [`[$b]`] meters. The measure of [`\angle A`] is [`[$A]^{\circ}`]. Calculate the width of the lake. + +The width of the lake is [____________]{$a} meters. + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +We will use Law of Cosines to calculate the length of [`BC`]: + + [``\begin{aligned}[t] + BC^2 &= AB^2+AC^2-2(AB)(AC)\cos(A) \\ + BC &= \sqrt{AB^2+AC^2-2(AB)(AC)\cos(A)} \\ + BC &= \sqrt{[$c]^2+[$b]^2-2([$c])([$b])\cos([$A]^{\circ})} \\ + BC &\approx [$a] + \end{aligned}``] + +The width of the lake is [`[$a]`] meters. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication40.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication40.pg new file mode 100644 index 0000000000..e6a7d608cc --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication40.pg @@ -0,0 +1,151 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$A2 = random(30,70,1); +$D = random(100,170,1); +$B = $A2 + 180 - $D; +$c = random(30,100,1); +$a = random(30,100,1); +$b = sqrt( $a**2+$c**2-2*$a*$c*cos($B*pi/180) ); +$A = arccos( ($b**2+$c**2-$a**2)/(2*$b*$c) )*180/pi; +$direction = $A+$A2; + +$Ax = 0; +$Ay = 0; +$Bx = $c*cos($A2*pi/180); +$By = $c*sin($A2*pi/180); +$Cx = $Bx - $a*cos( (180-$D)*pi/180 ); +$Cy = $By + $a*sin( (180-$D)*pi/180 ); + +$cushion = 10; + +$xmin = min($Cx, $Ax)-$cushion; #The viewing window +$xmax = $Bx+$cushion; +$ymin = -$cushion; +$ymax = $Cy+$cushion; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240],axes=>[0,0]); + $picture[$i]->lb('reset'); + + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->arrowTo($Bx,$By,blue,2); + $picture[$i]->arrowTo($Cx,$Cy,blue,2); + $picture[$i]->lineTo($Ax,$Ay,blue,1,dashed); + + $picture[$i]->moveTo(0.5*$Bx,$By); + $picture[$i]->lineTo(1.5*$Bx,$By,blue,1,dashed); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','top','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','right','bottom','large')); + $picture[$i]->lb( new Label(0.5*$Bx,$By,"D",'blue','right','middle','large')); + $picture[$i]->lb( new Label($Bx,$Ay,"E",'blue','center','top','large')); + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"$A2",'blue','left','bottom','large')); + $picture[$i]->lb( new Label($Bx,$By,"$D",'blue','left','bottom','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"$c mi",'blue','left','top','large')); + $picture[$i]->lb( new Label(($Bx+$Cx)/2,($By+$Cy)/2,"$a mi",'blue','left','bottom','large')); +} + + +$text[0] = "A coordinate system is centered at A. A ray goes from A to B (to the right of A), where the angle between AB and the x-axis is $A degrees. The length of AB is $c miles. There is a ray from B to C, where BC and the positive horizontal direction forms an angle of $D degrees. The length of BC is $a miles. A and C are also connected."; + + + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +An airplane flies [`[$c]`] miles with a heading of [`[$A2]^{\circ}`], and then flies [`[$a]`] miles with a heading of [`[$D]^{\circ}`]. How far is the plane from its starting point, and at what heading? + +Hint: For a heading degree, the east (positive x-axis direction) is considered 0 degree. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +The plane is [______________]{$b} miles from the starting point. + +The plane's heading in terms of its starting point is [___________]{$direction} degrees. + +END_PGML + +############################################## + +$B2 = 180-$D; + +BEGIN_PGML_SOLUTION + +In the figure, by Alternative Interior Angle Theorem, [`m\angle DBA = m\angle BAE = [$A2]^{\circ}`]. + +From B to C, the heading is [`[$D]^{\circ}`], so [` m\angle DBC = 180^{\circ} - [$D]^{\circ} = [$B2]^{\circ} `]. + +In [`\Delta ABC`], [` m\angle CBA = m\angle DBC + m\angle DBA = [$A2]^{\circ}+[$B2]^{\circ} = [$B]^{\circ} `]. + +In [`\Delta OAB`], we can use Law of Cosines to calculate the length of [`AC`]: + + [``\begin{aligned}[t] + AC^2 &= BA^2+BC^2-2\cdot BA\cdot BC\cdot \cos(\angle CBA) \\ + AC &= \sqrt{ BA^2+BC^2-2\cdot BA\cdot BC\cdot \cos(\angle CBA) } \\ + AC &= \sqrt{ [$c]^2+[$a]^2-2\cdot [$c]\cdot [$a]\cdot \cos([$B]^{\circ}) } \\ + AC &\approx [$b] + \end{aligned}``] + +The plane is [`[$b]`] miles from the starting point. + +Next, in [`\Delta ABC`], we use Law of Cosines again to calculate the measure of [`\angle CAB`]: + + [``\begin{aligned}[t] + BC^2 &= AB^2+AC^2-2\cdot AB \cdot AC \cdot \cos(\angle CAB) \\ + \cos(\angle CAB) &= \frac{AB^2+AC^2-BC^2}{2\cdot AB \cdot AC} \\ + m\angle CAB &= \cos^{-1}\left( \frac{AB^2+AC^2-BC^2}{2\cdot AB \cdot AC} \right) \\ + m\angle CAB &= \cos^{-1}\left( \frac{[$c]^2+[$b]^2-[$a]^2}{2([$c])([$b])} \right)\\ + m\angle CAB &\approx [$A]^{\circ} \\ + \end{aligned}``] + +The plane's heading in terms of its starting point is [` m\angle CAB + m\angle BAE = [$A]^{\circ}+[$A2]^{\circ} = [$direction]^{\circ} `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication50.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication50.pg new file mode 100644 index 0000000000..882e2c5cb9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfCosines/LawOfCosinesApplication50.pg @@ -0,0 +1,148 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$cushion = 20; +$DAx = 100; + +$c = random(100,300,5); +$D = random(15,35,1); +$A = 90-$D; +$b = random(100,300,5); +$a = sqrt( $b**2+$c**2-2*$b*$c*cos($A*pi/180) ); + +$Dx = 0; +$Dy = 0; +$Ax = $DAx; +$Ay = $DAx*tan($D*pi/180); +$Bx = $Ax; +$By = $Ay+$c; +$Cx = $Ax + $b*cos($D*pi/180); +$Cy = $Ay + $b*sin($D*pi/180); +$Fx = $Cx+$DAx; +$Fy = $Cy+$DAx*tan($D*pi/180); + + +$xmin = -$cushion; #The viewing window +$xmax = $Fx+$cushion; +$ymin = -$cushion; +$ymax = $By+$cushion; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + + $picture[$i]->moveTo($Dx,$Dy); + $picture[$i]->lineTo($Fx,$Fy,blue,2); + $picture[$i]->lineTo($Fx,$Dy,blue,2); + $picture[$i]->lineTo($Dx,$Dy,blue,2); + + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,2); + $picture[$i]->lineTo($Cx,$Cy,blue,2); + + $picture[$i]->lb( new Label(($Cx+$Bx)/2,($By+$Cy)/2,"guy wire",'blue','left','bottom','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"$c ft",'blue','right','top','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,($Ay+$Cy)/2,"$b ft",'blue','center','bottom','large')); + $picture[$i]->lb( new Label($Dx+$xShift,$Dy,"$D",'blue','left','bottom','large')); +} + +$picture[1]->lb( new Label($Ax,$Ay,"A",'blue','left','top','large')); +$picture[1]->lb( new Label($Bx,$By,"B",'blue','right','middle','large')); +$picture[1]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); +$picture[1]->lb( new Label($Dx,$Dy,"D",'blue','right','middle','large')); + +$picture[1]->moveTo($Ax,$Ay); +$picture[1]->lineTo($Ax,$Dy,blue,1,dashed); +$picture[1]->lb( new Label($Ax,$Dy,"E",'blue','center','top','large')); +$xShift = $DAx/10; +$yShift = $xShift/$xmax*$ymax; +$picture[1]->moveTo($Ax,$Dy+$yShift); +$picture[1]->lineTo($Ax-$xShift,$Dy+$yShift,blue,3); +$picture[1]->lineTo($Ax-$xShift,$Dy,blue,3); + +$text[0] = "A line segment, representing the hill, is inclined $D degrees to the horizontal. A vertical segment, representing the tower, is on the hill, marked as $c ft. The tip of the segment is connected to a point on the hill, marked as guy wire. The distance from the bottom of the segment to the guy wire is marked as $b ft."; + +$text[1] = "A line segment, representing the hill, is inclined $D degrees to the horizontal. The line segment starts at D. A vertical segment AB, representing the tower, is on the hill, marked as $c ft. Point A is the lower end of the segment. The tip of the segment, B, is connected to a point on the hill, C. This segment is marked as guy wire. The distance from the bottom of the segment to the guy wire, segment AC, is marked as $b ft. The tower BA is extended by a dotted segment downward until it reaches the horizontal of Point D. This extension ends at Point E."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +A [`[$c]`]-foot tower, pointing straight up, is located on a hill that is inclined [`[$D]^{\circ}`] to the horizontal, as shown in the figure. A guywire is to be attached to the top of the tower and anchored at a point [`[$b]`] feet uphill from the base of the tower. Find the length of wire needed. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +The length of the wire is [______________]{$a} feet. + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +Add in variables to the figure, and extend BA to E. + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +In [`\Delta ADE`], we can see [` m\angle DAE = 90^{\circ} - [$D]^{\circ} = [$A]^{\circ} `]. + +By Vertical Angle Theorem, [`m\angle BAC = m\angle DAE = [$A]^{\circ}`]. + +In [`\Delta ABC`], we can use Law of Cosines to calculate the length of [`BC`]: + + [``\begin{aligned}[t] + BC^2 &= AC^2+AB^2-2\cdot AC\cdot AB\cdot \cos(\angle BAC) \\ + BC &= \sqrt{ AC^2+AB^2-2\cdot AC\cdot AB\cdot \cos(\angle BAC) } \\ + BC &= \sqrt{ [$b]^2+[$c]^2-2\cdot [$b]\cdot [$c]\cdot \cos([$A]^{\circ}) } \\ + BC &\approx [$a] + \end{aligned}``] + +The length of the wire is [`[$a]`] feet. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines10.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines10.pg new file mode 100644 index 0000000000..a3530b2d0e --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines10.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(31, 50, 1); +$C = random(10, 30, 1); +$A = 180-$B-$C; +$a = random(10, 30, 1); +$b = $a*sin($B*pi/180)/sin($A*pi/180); +$c = $a*sin($C*pi/180)/sin($A*pi/180); +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as b; the right side is marked as c; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +In this triangle, if [`m\angle B=[$B]^{\circ}`], [`m\angle C=[$C]^{\circ}`] and [`a=[$a]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A= `][____________]{$A} degrees + + [`b = `][____________]{$b} units + + [`c = `][____________]{$c} units + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +First, calculate [`m\angle A`]: + + [``\begin{aligned}[t] + m\angle A &= 180^{\circ} - m\angle B - m\angle C \\ + &= 180^{\circ} - [$B]^{\circ} - [$C]^{\circ} \\ + & =[$A]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`b`]: + + [``\begin{aligned}[t] + \frac{\sin(A)}{a} &= \frac{\sin(B)}{b} \\ + b\sin(A) &= a\sin(B) \\ + b &= \frac{a\sin(B)}{\sin(A)} \\ + b &= \frac{[$a]\sin([$B]^{\circ})}{\sin([$A]^{\circ})} \\ + b &= [$b] + \end{aligned}``] + +And, use Law of Sines to calculate the length of [`c`]: + + [``\begin{aligned}[t] + \frac{\sin(A)}{a} &= \frac{\sin(C)}{c} \\ + c\sin(A) &= a\sin(C) \\ + c &= \frac{a\sin(C)}{\sin(A)} \\ + c &= \frac{[$a]\sin([$C]^{\circ})}{\sin([$A]^{\circ})} \\ + c &= [$c] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines20.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines20.pg new file mode 100644 index 0000000000..572a1e881a --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines20.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$b = random(10, 30, 1); +$B = random(10, 30, 1); +$A = random(100, 140, 1); +$C = 180-$B-$A; +$a = $b*sin($A*pi/180)/sin($B*pi/180); +$c = $b*sin($C*pi/180)/sin($B*pi/180); +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as b; the right side is marked as c; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +In this triangle, if [`m\angle A=[$A]^{\circ}`], [`m\angle B=[$B]^{\circ}`] and [`b=[$b]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle C= `][____________]{$C} degrees + + [`a = `][____________]{$a} units + + [`c = `][____________]{$c} units + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +First, calculate [`m\angle C`]: + + [``\begin{aligned}[t] + m\angle C &= 180^{\circ} - m\angle A - m\angle B \\ + &= 180^{\circ} - [$A]^{\circ} - [$B]^{\circ} \\ + & =[$C]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`a`]: + + [``\begin{aligned}[t] + \frac{\sin(A)}{a} &= \frac{\sin(B)}{b} \\ + a\sin(B) &= b\sin(A) \\ + a &= \frac{b\sin(A)}{\sin(B)} \\ + a &= \frac{[$b]\sin([$A]^{\circ})}{\sin([$B]^{\circ})} \\ + a &= [$a] + \end{aligned}``] + +And, use Law of Sines to calculate the length of [`c`]: + + [``\begin{aligned}[t] + \frac{\sin(B)}{b} &= \frac{\sin(C)}{c} \\ + c\sin(B) &= b\sin(C) \\ + c &= \frac{b\sin(C)}{\sin(B)} \\ + c &= \frac{[$b]\sin([$C]^{\circ})}{\sin([$B]^{\circ})} \\ + c &= [$c] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines30.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines30.pg new file mode 100644 index 0000000000..f219a6407e --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines30.pg @@ -0,0 +1,243 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@A = (); @B = (); @C = (); +@a = (); @b = (); @c = (); @h = (); + +$c[0] = random(10, 30, 1); +$B[0] = random(20, 50, 1); +$h[0] = $c[0]*sin($B[0]*pi/180); + +for my $i (1..3) { + $c[$i] = $c[0]; + $B[$i] = $B[0]; + $h[$i] = $h[0]; +} + +#right triangle +$b[0] = "$c[0]\cdot \sin($B[0])"; +$a[0] = $c[0]*cos($B[0]*pi/180); +$C[0] = 90; +$A[0] = 90-$B[0]; + +#2 triangles +do { + $b[2] = random(int(($h[2]+$c[2])/2)-2, int(($h[2]+$c[2])/2)+2, 1); +} until $b[2]<$c[2] && $b[2]>$h[2]; +$C[2] = arcsin($c[2]*sin($B[2]*pi/180)/$b[2])*180/pi; +$A[2] = 180 - $B[2] - $C[2]; +$a[2] = $b[2]*sin($A[2]*pi/180)/sin($B[2]*pi/180); + +#1 triangle +$b[3] = random($c[3]+5, $c[3]+10, 1); +$C[3] = arcsin($c[3]*sin($B[3]*pi/180)/$b[3])*180/pi; +$A[3] = 180 - $B[3] - $C[3]; +$a[3] = $b[3]*sin($A[3]*pi/180)/sin($B[3]*pi/180); + +#no triangle +$b[1] = random(int($h[1]/2), int($h[1])-1, 1); +$a[1] = $a[3]; +$C[1] = $C[3]; +$A[1] = $A[3]; + +@xmin = ();@xmax = (); @ymin = (); @ymax = (); + +for my $i (0..3) { + $xmin[$i] = 0; #The viewing window + $xmax[$i] = $a[$i]*240/210; + $ymin[$i] = 0; + $ymax[$i] = (210*$h[$i]/$a[$i]+30)*$h[$i]/(210*$h[$i]/$a[$i]); +} + +$xLabelShift = $xmax[0]/240*5; +$yLabelShift = $ymax[0]/210*5; + +# Ax, Bx, Cx +@x = ( +[($xmax[0]-$a[0])/2+$c[3]*cos($B[0]*pi/180), ($xmax[0]-$a[0])/2, ($xmax[0]+$a[0])/2], +[($xmax[1]-$a[1])/2+$c[3]*cos($B[1]*pi/180), ($xmax[1]-$a[1])/2, ($xmax[1]+$a[1])/2], +[($xmax[2]-$a[2])/2+$c[3]*cos($B[2]*pi/180), ($xmax[2]-$a[2])/2, ($xmax[2]+$a[2])/2], +[($xmax[3]-$a[3])/2+$c[3]*cos($B[3]*pi/180), ($xmax[3]-$a[3])/2, ($xmax[3]+$a[3])/2], +); +# Ay, By, Cy +@y = ( +[($ymax[0]+$h[0])/2, ($ymax[0]-$h[0])/2, ($ymax[0]-$h[0])/2], +[($ymax[1]+$h[1])/2, ($ymax[1]-$h[1])/2, ($ymax[1]-$h[1])/2], +[($ymax[2]+$h[2])/2, ($ymax[2]-$h[2])/2, ($ymax[2]-$h[2])/2], +[($ymax[3]+$h[3])/2, ($ymax[3]-$h[3])/2, ($ymax[3]-$h[3])/2], +); + +@picture = (); + +for my $i (0..3) { + $picture[$i] = init_graph($xmin[$i],$ymin[$i],$xmax[$i],$ymax[$i], + pixels=>[240,240*$ymax[$i]/$xmax[$i]]); + + $picture[$i]->new_color("darkblue", 100,100,255); + + $picture[$i]->lb( new Label( $x[$i][0], $y[$i][0],"A",'black','center','bottom','large')); + $picture[$i]->lb( new Label( $x[$i][1]-$xLabelShift, $y[$i][1],"B",'black','right','middle','large')); + $picture[$i]->lb( new Label(($x[$i][0]+$x[$i][1])/2-$xLabelShift,($y[$i][0]+$y[$i][1])/2,"c",'black','right','bottom','large')); + + $picture[$i]->moveTo($x[$i][0],$y[$i][0]); + $picture[$i]->lineTo($x[$i][1],$y[$i][1], darkblue,3); + if ($i==0) { + $picture[$i]->lineTo($x[$i][0],$y[$i][1], darkblue,3); + } else { + $picture[$i]->lineTo($x[$i][2],$y[$i][2], darkblue,3); + } + if ($i!=1) { + $picture[$i]->lineTo($x[$i][0],$y[$i][0], darkblue,3); + } else { + $picture[$i]->moveTo($x[$i][0],$y[$i][0]); + $picture[$i]->lineTo($x[$i][0],$y[$i][0]-$b[$i], darkblue,3); + } + + if ($i==0) { + $picture[$i]->lb( new Label($x[$i][0]+$xLabelShift, ($y[$i][0]+$y[$i][1])/2,"h",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[$i][0]+$xLabelShift, $y[$i][2],"C",'black','left','top','large')); + $picture[$i]->lb( new Label( ($x[$i][1]+$x[$i][2])/2, $y[$i][1],"a",'black','center','top','large')); + } elsif ($i==1) { + $picture[$i]->lb( new Label( ($x[$i][1]+$x[$i][2])/2, $y[$i][1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label( $x[$i][0]+$xLabelShift, $y[$i][0]-0.5*$b[$i],"b",'black','left','middle','large')); + } else { + $picture[$i]->lb( new Label( ($x[$i][1]+$x[$i][2])/2, $y[$i][1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label(($x[$i][0]+$x[$i][2])/2+$xLabelShift, ($y[$i][0]+$y[$i][1])/2,"b",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[$i][2]+$xLabelShift, $y[$i][2],"C",'black','left','middle','large')); + } +} + +$picture[2]->moveTo($x[2][0],$y[2][0]); +$picture[2]->lineTo($x[2][2]-2*$b[2]*cos($C[2]*pi/180),$y[2][2], darkblue,3,'dashed'); +$picture[2]->lb( new Label($x[2][0]-0.5*$b[2]*cos($C[2]*pi/180)+5*$xLabelShift, ($y[2][0]+$y[2][1])/2,"b",'black','left','bottom','large')); + +$xShift = $xmax[$i]/100; +$yShift = $xShift*210/240; +$picture[0]->moveTo($x[0][0],$y[0][2]+5*$yShift); +$picture[0]->lineTo($x[0][0]-3*$xShift,$y[0][2]+5*$yShift, darkblue,3); +$picture[0]->lineTo($x[0][0]-3*$xShift,$y[0][2], darkblue,3); + +@text = (); + +$text[3] = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c; the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C. Angle B and Angle C are acute angles, and Angle A is an obtuse angle."; + +$text[2] = $text[3]." A dotted line starts at A and ends at a point on side a. This dashed line is also marked as b, and its length is equal to length of b."; + +$text[0] = "This is a right triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as h; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C (the right angle). Angle A and Angle B are acute angles, and Angle C is a right angle."; + +$test[1] = "This is an open shape very close to a triangle. One side is parallel to the ground, this side is marked as a. A point on top is marked as A. Point A is connected to the left end of side a, where the point is marked as B. Angle B is acute. Opposite to B is a side b, not long enough to touch side a."; + +@solutions = (1,0,2,1); +@perm = NchooseK(4,4); +for ($i = 0; $i <= 3; $i++){ $ans[$i] = $solutions[$perm[$i]] }; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +In this triangle, [`m\angle B=[$B[0]]^{\circ}`] and [`c=[$c[0]]`] units. Match up each given value of [`b`] with the number of possible triangles. + +If [`b=[$b[$perm[0]]]`], there is/are [_____]{$ans[0]} possible triangle(s). + +If [`b=[$b[$perm[1]]]`], there is/are [_____]{$ans[1]} possible triangle(s). + +If [`b=[$b[$perm[2]]]`], there is/are [_____]{$ans[2]} possible triangle(s). + +If [`b=[$b[$perm[3]]]`], there is/are [_____]{$ans[3]} possible triangle(s). + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +###Determining the number of possible triangles + +To determine how many possible triangles would satisfy the given conditions, we sketch a right triangle and calculate the height [`h`]: + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + + [``\begin{aligned}[t] + \sin(B) &= \frac{h}{c} \\ + h &= c\cdot\sin(B) \\ + h &= [$c[0]]\cdot\sin([$B[0]]^{\circ}) \\ + h &\approx [$h[0]] + \end{aligned}``] + +Depending on the value of [`b`], there are 4 possible situations. + +###Situation 1: [`b=h`] + +If [`b=h`], side [`b`] can barely touch side [`a`]. In this situation, there is one possible right triangle solution, as shown in the graph above. + +If [`b=h=[$b[0]]`], there is [`1`] possible triangle. + +###Situation 2: [`b>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +If [`b=[$b[1]]`], there is [`0`] possible triangle. + +###Situation 3: [`h>[@ image(insertGraph( $picture[2] ), width=>240, extra_html_tags => "alt = '$text[2]' title = '$text[2]' ") @]*<< + +If [`b=[$b[2]]`], there are [`2`] possible triangles. + +###Situation 4: [`b \ge c`] + +If [`b \ge c`], side [`b`] can touch side [`a`] at onely one place. In this situation, there is one possible triangle solution, as shown in the following graph: + +>>[@ image(insertGraph( $picture[3] ), width=>240, extra_html_tags => "alt = '$text[3]' title = '$text[3]' ") @]*<< + +If [`b=[$b[3]]`], there is [`1`] possible triangle. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines40.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines40.pg new file mode 100644 index 0000000000..c55a3a6372 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines40.pg @@ -0,0 +1,138 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $B = random(20,70,1); + $c = random(20,40,1); + $h = $c*sin($B*pi/180); +} until ($h>10); +$b = random(5,int($h)-1,1); +$a = $c*cos($B*pi/180); +$A = 90-$B; +$C = 90; + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/200; +$yLabelShift = $ymax/200; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$a, ($xmax-$a)/2, ($xmax-$a)/2+$a); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+2*$xLabelShift, ($y[0]+$y[1])/2,"h",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$xShift = $xmax/200; +$yShift = $xShift*210/240; +$picture->moveTo($x[0],$y[2]+10*$yShift); +$picture->lineTo($x[0]-10*$xShift,$y[2]+10*$yShift, darkblue,3); +$picture->lineTo($x[0]-10*$xShift,$y[2], darkblue,3); + +$text = "This is a right triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C (the right angle). Angle A and Angle B are acute angles, and Angle C is a right angle."; + +$A = Compute("DNE"); +$C = Compute("DNE"); +$a = Compute("DNE"); + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +In this triangle, if [`m\angle B=[$B]^{\circ}`], [`c=[$c]`] units and [`b=[$b]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A= `][____________]{$A} degrees + + [`m\angle C= `][____________]{$C} degrees + + [`a = `][____________]{$a} units + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To determine how many possible triangles would satisfy the given conditions, we sketch a right triangle and calculate the height [`h`]: + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + + [``\begin{aligned}[t] + \sin(B) &= \frac{h}{c} \\ + h &= c\cdot\sin(B) \\ + h &= [$c]\cdot\sin([$B]^{\circ}) \\ + h &= [$h] + \end{aligned}``] + +Since [`h>b`] [`([$h]>[$b])`], there is no triangle which can satisfy the given conditions. In other words, the length of [`b`] is not long enough to reach side [`a`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines50.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines50.pg new file mode 100644 index 0000000000..866f8f2549 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines50.pg @@ -0,0 +1,152 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(20,70,1); +$c = random(20,40,1); +$h = $c*sin($B*pi/180); +$b = $h; +$a = $c*cos($B*pi/180); +$A = 90-$B; +$C = 90; + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/200; +$yLabelShift = $ymax/200; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$a, ($xmax-$a)/2, ($xmax-$a)/2+$a); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+2*$xLabelShift, ($y[0]+$y[1])/2,"h",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + +$xShift = $xmax/200; +$yShift = $xShift*210/240; +$picture->moveTo($x[0],$y[2]+10*$yShift); +$picture->lineTo($x[0]-10*$xShift,$y[2]+10*$yShift, darkblue,3); +$picture->lineTo($x[0]-10*$xShift,$y[2], darkblue,3); + +$text = "This is a right triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C (the right angle). Angle A and Angle B are acute angles, and Angle C is a right angle."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +In this triangle, if [`m\angle B=[$B]^{\circ}`], [`c=[$c]`] units and [`b=[$c]\cdot \sin{[$B]^{\circ}}`] units, solve for this triangle. + +Note that the length of [`b`] was not changed to decimals to keep the value more accurate. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A= `][____________]{$A} degrees + + [`m\angle C= `][____________]{$C} degrees + + [`a = `][____________]{$a} units + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To determine how many possible triangles would satisfy the given conditions, we sketch a right triangle and calculate the height [`h`]: + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + + [``\begin{aligned}[t] + \sin(B) &= \frac{h}{c} \\ + h &= c\cdot\sin(B) \\ + h &= [$c]\cdot\sin([$B]^{\circ}) + \end{aligned}``] + +Since [`h=b`], there is one triangle which can satisfy the given conditions. In other words, the length of [`b`] barely touches side [`a`], creating a right triangle. + +Since [`m\angle C = 90^{\circ}`], we can calculate the measure of [`\angle A`] by: + + [``\begin{aligned}[t] + m\angle A &= 180^{\circ} - m\angle C - m\angle B \\ + m\angle A &= 180^{\circ} - 90^{\circ} - [$B]^{\circ} \\ + m\angle A &= [$A]^{\circ} \\ + \end{aligned}``] + +Next, we can calculate the side [`a`] by: + + [``\begin{aligned}[t] + \cos(B) &= \frac{a}{c} \\ + a &= c\cdot\cos(B) \\ + a &= [$c]\cdot\cos([$B]^{\circ}) \\ + a &= [$a] \\ + \end{aligned}``] + +To summarize: [` m\angle A = [$A]^{\circ}, m\angle C = 90^{\circ}, a=[$a] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines60.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines60.pg new file mode 100644 index 0000000000..8820861841 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines60.pg @@ -0,0 +1,149 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$B = random(20,70,1); +$c = random(20,40,1); +$h = $c*sin($B*pi/180); +$b = random($c+5,$c+20,1); +$C = arcsin($c*sin($B*pi/180)/$b)*180/pi; +$A = 180-$B-$C; +$a = $b*sin($A*pi/180)/sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/200; +$yLabelShift = $ymax/200; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +$picture = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); +$picture->lb( new Label(($x[0]+$x[2])/2+2*$xLabelShift, ($y[0]+$y[1])/2,"h",'black','left','bottom','large')); +$picture->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + +$picture->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); +$picture->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); +$picture->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + +$picture->new_color("darkblue", 100,100,255); + +$picture->moveTo($x[0],$y[0]); +$picture->lineTo($x[1],$y[1], darkblue,3); +$picture->lineTo($x[2],$y[2], darkblue,3); +$picture->lineTo($x[0],$y[0], darkblue,3); + + +$text = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as b; the top obtuse angle is marked as A; the left side acute angle is marked as B; the right side acute angle is marked as C."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +In this triangle, if [`m\angle B=[$B]^{\circ}`], [`c=[$c]`] units and [`b=[$b]`] units, solve for this triangle. + +[@KeyboardInstructions( +"\n" +.'* If this triangle does not exist, type DNE in all blanks.' +)@]** + + [`m\angle A= `][____________]{$A} degrees + + [`m\angle C= `][____________]{$C} degrees + + [`a = `][____________]{$a} units + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Since [`b>c`], there is one possible triangle satisfying the given conditions. + +>>[@ image(insertGraph( $picture ), width=>240, extra_html_tags => "alt = '$text' title = '$text' ") @]*<< + +First, calculate [`m\angle C`]: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(B)}{b} \\ + b\sin(C) &= c\sin(B) \\ + \sin(C) &= \frac{c\sin(B)}{b} \\ + C &= \sin^{-1}\left( \frac{c\sin(B)}{b} \right) \\ + C &= \sin^{-1}\left( \frac{[$c]\sin([$B]^{\circ})}{[$b]} \right) \\ + C &= [$C]^{\circ} + \end{aligned}``] + +Next, we can calculate [`m\angle A`]: + + [``\begin{aligned}[t] + m\angle A &= 180^{\circ} - m\angle B - m\angle C \\ + &= 180^{\circ} - [$B]^{\circ} - [$C]^{\circ} \\ + & =[$A]^{\circ} + \end{aligned}``] + +Finally, we can calculate the side [`a`] by: + + [``\begin{aligned}[t] + \frac{\sin(A)}{a} &= \frac{\sin(B)}{b} \\ + a\sin(B) &= b\sin(A) \\ + a &= \frac{b\sin(A)}{\sin(B)} \\ + a &= \frac{[$b]\sin([$A]^{\circ})}{\sin([$B]^{\circ})} \\ + a &= [$a] + \end{aligned}``] + +To summarize: [` m\angle A = [$A]^{\circ}, m\angle C = [$C]^{\circ}, a=[$a] `]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines70.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines70.pg new file mode 100644 index 0000000000..9601b109e2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines70.pg @@ -0,0 +1,310 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@A = (); @B = (); @C = (); +@a = (); @b = (); @c = (); + +do { + do { + $c[0] = random(10, 30, 1); + $c[1] = $c[0]; + $B[0] = random(20, 40, 1); + $B[1] = $B[0]; + $h[0] = $c[0]*sin($B[0]*pi/180); + $h[1] = $h[0]; + $b[0] = random( ($h[0]+$c[0])/2-5, ($h[0]+$c[0])/2+5, 1); + $b[1] = $b[0]; + } until ($c[0]*sin($B[0]*pi/180)/$b[0] < 1); + + $C[0] = arcsin($c[0]*sin($B[0]*pi/180)/$b[0])*180/pi; + $C[1] = 180-$C[0]; + $A[0] = 180-$B[0]-$C[0]; + $A[1] = 180-$B[1]-$C[1]; + $a[0] = $b[0]*sin($A[0]*pi/180)/sin($B[0]*pi/180); + $a[1] = $b[1]*sin($A[1]*pi/180)/sin($B[1]*pi/180); +} until ($a[1]>5); + +$xmin = 0; #The viewing window +$xmax = $a[0]*240/210; +$ymin = 0; +$ymax = (210*$h[0]/$a[0]+30)*$h[0]/(210*$h[0]/$a[0]); + +$xLabelShift = $xmax/240*3; +$yLabelShift = $ymax/210*3; + +# Ax, Bx, Cx +@x = (($xmax-$a[0])/2+$c[0]*cos($B[0]*pi/180), ($xmax-$a[0])/2, ($xmax+$a[0])/2); +# Ay, By, Cy +@y = (($ymax+$h[0])/2, ($ymax-$h[0])/2, ($ymax-$h[0])/2); + +@picture = (); + +for my $i (0..2) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + + $picture[$i]->new_color("darkblue", 100,100,255); + + $picture[$i]->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); + $picture[$i]->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + + $picture[$i]->moveTo($x[0],$y[0]); + $picture[$i]->lineTo($x[1],$y[1], darkblue,3); + if ($i==0) { + $picture[$i]->lineTo($x[2],$y[2], darkblue,3); + } elsif ($i==1) { + $picture[$i]->lineTo($x[2]-2*$b[0]*cos($C[0]*pi/180),$y[2], darkblue,3); + } else { + $picture[$i]->lineTo($x[1]+$c[0]*cos($B[0]*pi/180),$y[2], darkblue,3); + } + $picture[$i]->lineTo($x[0],$y[0], darkblue,3); + + if ($i==0) { + $picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + } elsif ($i==1) { + $picture[$i]->lb( new Label( ($x[1]+$x[2]-2*$b[0]*cos($C[0]*pi/180))/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label(($x[0]+$x[2]-2*$b[0]*cos($C[0]*pi/180))/2+3*$xLabelShift, ($y[0]+$y[1])/2-5*$yLabelShift,"b",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[2]-2*$b[0]*cos($C[0]*pi/180)+$xLabelShift, $y[2],"C",'black','left','top','large')); + } else { + $picture[$i]->lb( new Label( ($x[1]+$x[2]-$b[0]*cos($C[0]*pi/180))/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label($x[0]+$xLabelShift, ($y[0]+$y[1])/2,"h",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[0]+$xLabelShift, $y[2],"C",'black','left','top','large')); + } +} + +$xShift = $xmax/100; +$yShift = $xShift*210/240; +$picture[2]->moveTo($x[0],$y[2]+5*$yShift); +$picture[2]->lineTo($x[0]-3*$xShift,$y[2]+5*$yShift, darkblue,3); +$picture[2]->lineTo($x[0]-3*$xShift,$y[2], darkblue,3); + +@text = (); + +$text[0] = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c; the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C. Angle B and Angle C are acute angles, and Angle A is an obtuse angle."; + +$text[1] = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c; the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C. Angle A and Angle B are acute angles, and Angle C is an obtuse angle."; + +$text[2] = "This is a right triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as h; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C (the right angle). Angle A and Angle B are acute angles, and Angle C is a right angle."; + + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +In this triangle, if [`m\angle B=[$B[0]]^{\circ}`], [`c=[$c[0]]`] units and [`b=[$b[0]]`] units, solve for this triangle. + +There are two possible triangles. + +[@DataTable( + [ + [[PF('if [`\angle C`] is acute'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 1px solid; ',], + [PF('if [`\angle C`] is obtuse'),], + ], + [[PF('[`m\angle C_1= `][____________]{$C[0]} degrees'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ',], + [PF('[`m\angle C_2= `][____________]{$C[1]} degrees'),], + ], + [[PF('[`m\angle A_1= `][____________]{$A[0]} degrees'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ',], + [PF('[`m\angle A_2= `][____________]{$A[1]} degrees'),], + ], + [[PF('[`a_1=`][____________]{$a[0]} units'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ',], + [PF('[`a_2=`][____________]{$a[1]} units'),], + ], + ], + align => 'c|c', + columnscss => + [' ', + ' ',], +);@]* + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +###Determining the number of possible triangles + +To determine how many possible triangles would satisfy the given conditions, we sketch a right triangle and calculate the height [`h`]: + +>>[@ image(insertGraph( $picture[2] ), width=>240, extra_html_tags => "alt = '$text[2]' title = '$text[2]' ") @]*<< + + [``\begin{aligned}[t] + \sin(B) &= \frac{h}{c} \\ + h &= c\cdot\sin(B) \\ + h &= [$c[0]]\cdot\sin([$B[0]]^{\circ}) \\ + h &= [$h[0]] + \end{aligned}``] + +Since [`h>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +We can calculate [`m\angle A_1`]: + + [``\begin{aligned}[t] + m\angle A_1 &= 180^{\circ} - m\angle B - m\angle C_1 \\ + &= 180^{\circ} - [$B[0]]^{\circ} - [$C[0]]^{\circ} \\ + & =[$A[0]]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`a`]: + + [``\begin{aligned}[t] + \frac{\sin(A_1)}{a_1} &= \frac{\sin(B)}{b} \\ + a_1\sin(B) &= b\sin(A_1) \\ + a_1 &= \frac{b\sin(A_1)}{\sin(B)} \\ + a_1 &= \frac{[$b[0]]\sin([$A[0]]^{\circ})}{\sin([$B[0]]^{\circ})} \\ + a_1 &= [$a[0]] + \end{aligned}``] + +In this triangle, + +[@DataTable( + [ + [[PF('[`a_1=[$a[0]]`]'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 1px solid; ',], + [PF('[`m\angle A_1= [$A[0]]^{\circ}`]'),], + ], + [[PF('[`b=[$b[0]]`]'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ',], + [PF('[`m\angle B= [$B[0]]^{\circ}`]'),], + ], + [[PF('[`c=[$c[0]]`]'),], + [PF('[`m\angle C_1= [$C[0]]^{\circ}`]'),], + ], + ], + align => 'c|c', + columnscss => + [' ', + ' ',], +);@]* + +###Solution 2: + +Assume [`C_2 = [$C[1]]^{\circ}`] (obtuse angle), the triangle looks like this: + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +We can calculate [`m\angle A_2`]: + + [``\begin{aligned}[t] + m\angle A_2 &= 180^{\circ} - m\angle B - m\angle C_2 \\ + &= 180^{\circ} - [$B[1]]^{\circ} - [$C[1]]^{\circ} \\ + & =[$A[1]]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`a`]: + + [``\begin{aligned}[t] + \frac{\sin(A_2)}{a_2} &= \frac{\sin(B)}{b} \\ + a_2\sin(B) &= b\sin(A_2) \\ + a_2 &= \frac{b\sin(A_2)}{\sin(B)} \\ + a_2 &= \frac{[$b[1]]\sin([$A[1]]^{\circ})}{\sin([$B[1]]^{\circ})} \\ + a_2 &= [$a[1]] + \end{aligned}``] + +In this triangle, + +[@DataTable( + [ + [[PF('[`a_2=[$a[1]]`]'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 1px solid; ',], + [PF('[`m\angle A_2= [$A[1]]^{\circ}`]'),], + ], + [[PF('[`b=[$b[1]]`]'), + midrule => '1', + rowcss => 'border-bottom: 1px solid; ',], + [PF('[`m\angle B= [$B[1]]^{\circ}`]'),], + ], + [[PF('[`c=[$c[1]]`]'),], + [PF('[`m\angle C_2= [$C[1]]^{\circ}`]'),], + ], + ], + align => 'c|c', + columnscss => + [' ', + ' ',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines80.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines80.pg new file mode 100644 index 0000000000..114a55c83a --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSines80.pg @@ -0,0 +1,198 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@A = (); @B = (); @C = (); +@a = (); @b = (); @c = (); + +do { + do { + $c[0] = random(10, 30, 1); + $c[1] = $c[0]; + $B[0] = random(20, 40, 1); + $B[1] = $B[0]; + $h[0] = $c[0]*sin($B[0]*pi/180); + $h[1] = $h[0]; + $b[0] = random( ($h[0]+$c[0])/2-5, ($h[0]+$c[0])/2+5, 1); + $b[1] = $b[0]; + } until ($c[0]*sin($B[0]*pi/180)/$b[0] < 1); + + $C[0] = arcsin($c[0]*sin($B[0]*pi/180)/$b[0])*180/pi; + $C[1] = 180-$C[0]; + $A[0] = 180-$B[0]-$C[0]; + $A[1] = 180-$B[1]-$C[1]; + $a[0] = $b[0]*sin($A[0]*pi/180)/sin($B[0]*pi/180); + $a[1] = $b[1]*sin($A[1]*pi/180)/sin($B[1]*pi/180); +} until ($a[1]>5); + + +$xmin = 0; #The viewing window +$xmax = $a[0]*240/210; +$ymin = 0; +$ymax = (210*$h[0]/$a[0]+30)*$h[0]/(210*$h[0]/$a[0]); + +$xLabelShift = $xmax/240*3; +$yLabelShift = $ymax/210*3; + +# Ax, Bx, Cx +@x = (($xmax-$a[0])/2+$c[0]*cos($B[0]*pi/180), ($xmax-$a[0])/2, ($xmax+$a[0])/2); +# Ay, By, Cy +@y = (($ymax+$h[0])/2, ($ymax-$h[0])/2, ($ymax-$h[0])/2); + +@picture = (); + +for my $i (0..2) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + + $picture[$i]->new_color("darkblue", 100,100,255); + + $picture[$i]->lb( new Label( $x[0], $y[0]+$yLabelShift,"A",'black','center','bottom','large')); + $picture[$i]->lb( new Label( $x[1]-$xLabelShift, $y[1],"B",'black','right','middle','large')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"c",'black','right','bottom','large')); + + $picture[$i]->moveTo($x[0],$y[0]); + $picture[$i]->lineTo($x[1],$y[1], darkblue,3); + if ($i==0) { + $picture[$i]->lineTo($x[2],$y[2], darkblue,3); + } elsif ($i==1) { + $picture[$i]->lineTo($x[2]-2*$b[0]*cos($C[0]*pi/180),$y[2], darkblue,3); + } else { + $picture[$i]->lineTo($x[1]+$c[0]*cos($B[0]*pi/180),$y[2], darkblue,3); + } + $picture[$i]->lineTo($x[0],$y[0], darkblue,3); + + if ($i==0) { + $picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"b",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2],"C",'black','left','middle','large')); + } elsif ($i==1) { + $picture[$i]->lb( new Label( ($x[1]+$x[2]-2*$b[0]*cos($C[0]*pi/180))/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label(($x[0]+$x[2]-2*$b[0]*cos($C[0]*pi/180))/2+3*$xLabelShift, ($y[0]+$y[1])/2-5*$yLabelShift,"b",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[2]-2*$b[0]*cos($C[0]*pi/180)+$xLabelShift, $y[2],"C",'black','left','top','large')); + } else { + $picture[$i]->lb( new Label( ($x[1]+$x[2]-$b[0]*cos($C[0]*pi/180))/2, $y[1],"a",'black','center','top','large')); + $picture[$i]->lb( new Label($x[0]+$xLabelShift, ($y[0]+$y[1])/2,"h",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $x[0]+$xLabelShift, $y[2],"C",'black','left','top','large')); + } +} + +$xShift = $xmax/100; +$yShift = $xShift*210/240; +$picture[2]->moveTo($x[0],$y[2]+5*$yShift); +$picture[2]->lineTo($x[0]-3*$xShift,$y[2]+5*$yShift, darkblue,3); +$picture[2]->lineTo($x[0]-3*$xShift,$y[2], darkblue,3); + +@text = (); + +$text[0] = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c; the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C. Angle B and Angle C are acute angles, and Angle A is an obtuse angle."; + +$text[1] = "This is a triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c; the right side is marked as b; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C. Angle A and Angle B are acute angles, and Angle C is an obtuse angle."; + +$text[2] = "This is a right triangle with one side parallel to the ground; this side is marked as a; the left side is marked as c (the hypotenuse); the right side is marked as h; the top angle is marked as A; the left side angle is marked as B; the right side angle is marked as C (the right angle). Angle A and Angle B are acute angles, and Angle C is a right angle."; + + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In a triangle [`\Delta ABC`], [`\angle A`] faces side [`a`], [`\angle B`] faces side [`b`], and [`\angle C`] faces side [`c`]. + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +In this triangle, if [`m\angle B=[$B[0]]^{\circ}`], [`c=[$c[0]]`] units, [`b=[$b[0]]`] units, and [`\angle C`] is an *obtuse* triangle, solve for this triangle. + +[`m\angle C= `][____________]{$C[1]} degrees + +[`m\angle A= `][____________]{$A[1]} degrees + +[`a=`][____________]{$a[1]} units + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +First, calculate [`m\angle C`] with Law of Sines: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(B)}{b} \\ + b\sin(C) &= c\sin(B) \\ + \sin(C) &= \frac{c\sin(B)}{b} \\ + C &= \sin^{-1}\left( \frac{c\sin(B)}{b} \right) \\ + C &= \sin^{-1}\left( \frac{[$c[0]]\sin([$B[0]]^{\circ})}{[$b[0]]} \right) \\ + C &= [$C[0]]^{\circ} + \end{aligned}``] + +Each time we use the function [`\sin^{-1}(x)`], we must assume there is a second possible solution equal to [`180-\sin^{-1}(x)`]. In this problem, [`C_1 = [$C[0]]`] is the first possible solution, and [`C_2 = 180-[$C[0]]^{\circ} = [$C[1]]^{\circ}`] is the second possible solution. + +Since it's given that [`\angle C`] is an obtuse triangle, we choose [`C = [$C[1]]^{\circ}`]. + +Next, we calculate [`m\angle A`]: + + [``\begin{aligned}[t] + m\angle A &= 180^{\circ} - m\angle B - m\angle C \\ + &= 180^{\circ} - [$B[1]]^{\circ} - [$C[1]]^{\circ} \\ + & =[$A[1]]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`a`]: + + [``\begin{aligned}[t] + \frac{\sin(A)}{a} &= \frac{\sin(B)}{b} \\ + a\sin(B) &= b\sin(A) \\ + a &= \frac{b\sin(A)}{\sin(B)} \\ + a &= \frac{[$b[1]]\sin([$A[1]]^{\circ})}{\sin([$B[1]]^{\circ})} \\ + a &= [$a[1]] + \end{aligned}``] + +In this triangle, + +[`m\angle C= [$C[1]]^{\circ}`] + +[`m\angle A= [$A[1]]^{\circ}`] + +[`a=[$a[1]]`] units + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication10.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication10.pg new file mode 100644 index 0000000000..8c678017c6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication10.pg @@ -0,0 +1,155 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $B = random(31, 70, 1); + $C = random(31, 70, 1); +} until abs($B-$C)>10; +$A = 180-$B-$C; +$a = random(50, 100, 1); +$b = $a*sin($B*pi/180)/sin($A*pi/180); +$c = $a*sin($C*pi/180)/sin($A*pi/180); +$h = $c*sin($B*pi/180); + +$xmin = 0; #The viewing window +$xmax = $a*240/210; +$ymin = 0; +$ymax = (210*$h/$a+30)*$h/(210*$h/$a); + +$xLabelShift = $xmax/40; +$yLabelShift = $ymax/40; + +# Ax, Bx, Cx +@x = (($xmax-$a)/2+$c*cos($B*pi/180), ($xmax-$a)/2, ($xmax+$a)/2); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +for my $i (0..1) { +$picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"$a miles",'black','center','top','large')); +if ($i==1) { + $picture[$i]->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"y",'black','left','bottom','large')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"x",'black','right','bottom','large')); + $picture[$i]->lb( new Label( $x[0], $y[0],"C (boat)",'black','center','bottom','large')); +} else { + $picture[$i]->lb( new Label( $x[0], $y[0],"boat",'black','center','bottom','large')); +} + +$picture[$i]->lb( new Label( $x[1]-$xLabelShift, $y[1],"A",'black','right','middle','large')); +$picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2],"B",'black','left','middle','large')); + +$picture[$i]->new_color("darkblue", 100,100,255); + +$picture[$i]->moveTo($x[0],$y[0]); +$picture[$i]->lineTo($x[1],$y[1], darkblue,3); +$picture[$i]->lineTo($x[2],$y[2], darkblue,3); +$picture[$i]->lineTo($x[0],$y[0], darkblue,3); + +} + +$text[0] = "This is a triangle with one side parallel to the ground; this side is marked as $a miles; the top point is marked as boat. The left endpoint is marked as A, and right endpoint is marked as B."; + +$text[1] = "This is a triangle with one side parallel to the ground; this side is marked as $a miles; the top point is marked as C (boat); The left endpoint is marked as A, and right endpoint is marked as B. The left side is marked as x; the right side is marked as y."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +To determine how far a boat is from shore, two radar stations [`[$a]`] miles apart find the angles out to the boat, as shown in the figure. Determine the distance of the boat from Station A and Station B. + +In this triangle, [`m\angle A=[$B]^{\circ}`] and [`m\angle B=[$C]^{\circ}`]. + +The distance from the boat to Station A is [____________]{$c} miles. + +The distance from the boat to Station B is [____________]{$b} miles. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the boat is at Point C. Assume the distance from the boat to Station A is [`x`] miles, and to Station B is [`y`] miles. + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +First, calculate [`m\angle C`]: + + [``\begin{aligned}[t] + m\angle C &= 180^{\circ} - m\angle A - m\angle B \\ + &= 180^{\circ} - [$B]^{\circ} - [$C]^{\circ} \\ + & =[$A]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`x`]: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(B)}{x} \\ + x\sin(C) &= c\sin(B) \\ + x &= \frac{c\sin(B)}{\sin(C)} \\ + x &= \frac{[$a]\sin([$C]^{\circ})}{\sin([$A]^{\circ})} \\ + x &= [$c] + \end{aligned}``] + +The distance from the boat to Station A is [`[$c]`] miles. + +And, use Law of Sines to calculate the length of [`y`]: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(A)}{y} \\ + y\sin(C) &= c\sin(A) \\ + y &= \frac{c\sin(A)}{\sin(C)} \\ + y &= \frac{[$a]\sin([$B]^{\circ})}{\sin([$A]^{\circ})} \\ + y &= [$b] + \end{aligned}``] + +The distance from the boat to Station B is [`[$b]`] miles. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication20.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication20.pg new file mode 100644 index 0000000000..369dfef426 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication20.pg @@ -0,0 +1,165 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + + +$B = random(31, 70, 1); +$C = random(100, 180-$B-20, 1); +$A = 180-$B-$C; +$a = random(50, 100, 1); +$b = $a*sin($B*pi/180)/sin($A*pi/180); +$c = $a*sin($C*pi/180)/sin($A*pi/180); +$h = $c*sin($B*pi/180); +$C2 = 180-$C; + +$xmin = 0; #The viewing window +$base = ($c*cos($B*pi/180)); +$xmax = ($base)*240/210; +$ymin = 0; +$ymax = (210*$h/$base+30)*$h/(210*$h/$base); + +$xLabelShift = $xmax/20; +$yLabelShift = $ymax/80; + +# Ax, Bx, Cx +@x = (($xmax+$base)/2, ($xmax-$base)/2, ($xmax-$base)/2+$a); +# Ay, By, Cy +@y = (($ymax+$h)/2, ($ymax-$h)/2, ($ymax-$h)/2); + +for my $i (0..1) { +$picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + +$picture[$i]->lb( new Label( ($x[1]+$x[2])/2, $y[1],"$a miles",'black','center','top','large')); +if ($i==1) { + $picture[$i]->lb( new Label(($x[0]+$x[2])/2+$xLabelShift, ($y[0]+$y[1])/2,"y",'black','left','bottom','large')); + $picture[$i]->lb( new Label(($x[0]+$x[1])/2-$xLabelShift,($y[0]+$y[1])/2,"x",'black','right','bottom','large')); + $picture[$i]->lb( new Label( $x[0], $y[0],"C (boat)",'black','right','bottom','large')); +} else { + $picture[$i]->lb( new Label( $x[0], $y[0],"boat",'black','center','bottom','large')); +} + +$picture[$i]->lb( new Label( $x[1], $y[1],"A",'black','right','top','large')); +$picture[$i]->lb( new Label( $x[1]+2*$xLabelShift, $y[1]+$yLabelShift,$B,'black','left','bottom','large')); +$picture[$i]->lb( new Label( $x[2], $y[2],"B",'black','left','top','large')); +$picture[$i]->lb( new Label( $x[2]+$xLabelShift, $y[2]+$yLabelShift,$C2,'black','left','bottom','large')); + +$picture[$i]->new_color("darkblue", 100,100,255); + +$picture[$i]->moveTo($x[0],$y[0]); +$picture[$i]->lineTo($x[1],$y[1], darkblue,3); +$picture[$i]->lineTo($x[2],$y[2], darkblue,3); +$picture[$i]->lineTo($x[0],$y[0], darkblue,3); + +$picture[$i]->moveTo($x[2],$y[2]); +$picture[$i]->lineTo($x[0],$y[2], darkblue,1,dashed); + +} + +$picture[1]->lb( new Label( $x[2]-$xLabelShift, $y[2]+$yLabelShift,$C,'black','right','bottom','large')); + +$text[0] = "This is a triangle with one side parallel to the ground; this side is marked as $a miles; the top point is marked as boat. The left endpoint is marked as A, and right endpoint is marked as B. The angle of elevation from A to the boat is $B degrees, and the angle of elevation from B to the boat is $C2 degrees. The boat is to the right of Point B, making Angle B inside the triangle an obtuse angle."; + +$text[1] = "This is a triangle with one side parallel to the ground; this side is marked as $a miles; the top point is marked as C (boat). The left endpoint is marked as A, and right endpoint is marked as B. The angle of elevation from A to the boat is $B degrees, and the angle of elevation from B to the boat is $C2 degrees. The boat is to the right of Point B, making Angle B inside the triangle an obtuse angle. The side from the boat to A is marked as x, and the side from the boat to B is marked as y."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +To determine how far a boat is from shore, two radar stations [`[$a]`] miles apart find the angles out to the boat, as shown in the figure. The angle of elevation from Station A to the boat is [`[$B]^{\circ}`], and angle of elevation from Station B to the boat is [`[$C2]^{\circ}`]. + +Determine the distance of the boat from Station A and Station B. + +The distance from the boat to Station A is [____________]{$c} miles. + +The distance from the boat to Station B is [____________]{$b} miles. + + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assume the boat is at Point C. Assume the distance from the boat to Station A is [`x`] miles, and to Station B is [`y`] miles. + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Since the angle of elevation from Station B to the boat is [`[$C2]^{\circ}`], the measure of [`\angle CBA `] inside the triangle is [`m\angle CBA = 180^{\circ} - [$C2]^{\circ} = [$C]^{\circ}`]. + +Next, calculate [`m\angle C`]: + + [``\begin{aligned}[t] + m\angle C &= 180^{\circ} - m\angle A - m\angle B \\ + &= 180^{\circ} - [$B]^{\circ} - [$C]^{\circ} \\ + & =[$A]^{\circ} + \end{aligned}``] + +Next, use Law of Sines to calculate the length of [`x`]: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(B)}{x} \\ + x\sin(C) &= c\sin(B) \\ + x &= \frac{c\sin(B)}{\sin(C)} \\ + x &= \frac{[$a]\sin([$C]^{\circ})}{\sin([$A]^{\circ})} \\ + x &= [$c] + \end{aligned}``] + +The distance from the boat to Station A is [`[$c]`] miles. + +And, use Law of Sines to calculate the length of [`y`]: + + [``\begin{aligned}[t] + \frac{\sin(C)}{c} &= \frac{\sin(A)}{y} \\ + y\sin(C) &= c\sin(A) \\ + y &= \frac{c\sin(A)}{\sin(C)} \\ + y &= \frac{[$a]\sin([$B]^{\circ})}{\sin([$A]^{\circ})} \\ + y &= [$b] + \end{aligned}``] + +The distance from the boat to Station B is [`[$b]`] miles. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication30.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication30.pg new file mode 100644 index 0000000000..2b78df9264 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication30.pg @@ -0,0 +1,176 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$cushion = 2; +$ADx = 3; + +$D = random(20,30,1); +$Dx = $cushion; +$Dy = $cushion; + +$A = random(20,30,1); +$Ax = $Dx+$ADx; +$Ay = $Dy+$ADx*tan($D*pi/180); + +$AD = $A+$D; + +$c = random(5,15,1); +$a = $c*sin($A*pi/180)/sin( (90+$D)*pi/180 ); +$aU = NumberWithUnits("$a ft"); + +$B = 90-$A-$D; +$Bx = $cushion+$ADx+$c*cos( ($AD)*pi/180 ); +$By = $cushion+$ADx*tan($D*pi/180)+$c*sin( ($AD)*pi/180 ); + +$C = 90+$D; +$Cx = $cushion+$ADx+$c*cos( ($AD)*pi/180 ); +$Cy = $By - $a; + +$xmin = 0; #The viewing window +$xmax = $Bx*240/210; +$ymin = 0; +$ymax = (210*$By/$Bx+30)*$By/(210*$By/$Bx); + +$Fx = $xmax; +$Fy = $cushion+($xmax-$cushion)*tan($D*pi/180); + +$xLabelShift = $xmax/10; +$yLabelShift = $ymax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + + $picture[$i]->new_color("darkblue", 100,100,255); + $picture[$i]->moveTo($Fx,$Fy); + $picture[$i]->lineTo($Dx,$Dy, darkblue,3); + $picture[$i]->lineTo($Bx,$Dy, darkblue,1,dashed); + + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By, darkblue,3); + $picture[$i]->lineTo($Cx,$Cy, darkblue,3); + + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$Ay, darkblue,1,dashed); + + $picture[$i]->lb( new Label(($Ax+$Bx)/2, ($Ay+$By)/2,"$c feet",'black','right','bottom','large')); + $picture[$i]->lb( new Label($Dx+$xLabelShift, $Dy,"$D",'black','left','bottom','large')); + $picture[$i]->lb( new Label($Ax+0.5*$xLabelShift, $Ay,"$AD",'black','left','bottom','large')); + $picture[$i]->lb( new Label( $Bx, ($By+$Cy)/2,"support",'black','middle','center','large')); +} + +$picture[1]->moveTo($Bx,$Ay); +$picture[1]->lineTo($Bx,$Cy, darkblue,1,dashed); + +$xShift = $xmax/100; +$yShift = $xShift*210/240; +$picture[1]->moveTo($Bx,$Ay+5*$yShift); +$picture[1]->lineTo($Bx-3*$xShift,$Ay+5*$yShift, darkblue,3); +$picture[1]->lineTo($Bx-3*$xShift,$Ay, darkblue,3); + +$picture[1]->lb( new Label($Dx, $Dy,"D",'black','right','top','large')); +$picture[1]->lb( new Label($Ax, $Ay,"A",'black','right','bottom','large')); +$picture[1]->lb( new Label($Bx, $By,"B",'black','center','bottom','large')); +$picture[1]->lb( new Label($Cx+0.2*$xLabelShift, $Cy,"C",'black','left','middle','large')); +$picture[1]->lb( new Label($Bx+0.2*$xLabelShift, $Ay,"E",'black','left','middle','large')); + +$text[0] = "A roof goes up from left to right, forming a $D-degree angle with the horizontal direction. On the roof, a solar panel forms a $AD-degree angle with the horizontal direction. The panel has a length of $c feet. A vertical segment, marked as support, connects the tip of the panel to the roof."; + +$text[1] = "A roof goes up from left to right, forming a $D-degree angle with the horizontal direction. On the roof, a solar panel forms a $AD-degree angle with the horizontal direction. The panel has a length of $c feet. A vertical segment, marked as support, connects the tip of the panel to the roof. Left end of the roof is marked as D. Left end of the panel is marked as A. Right end of the panel is marked as B. The intersection of the support and the roof is marked as C. The vertical support, BC, is extended downward, intersecting with the horizontal line at the level of A at Point E. Angle E is marked as 90 degrees."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +The roof of a house is at a [`[$D]^{\circ}`] angle. An [`[$c]`]-foot solar panel is to be mounted on the roof and should be angled [`[$AD]^{\circ}`] relative to the horizontal for optimal results. How long does the vertical support holding up the back of the panel need to be? + +[@KeyboardInstructions( +"\n" +.'* Please include units in your answer. Use *ft* to represent "feet".' +)@]** + +The vertical support holding up the back of the panel need to be [_______________]{$aU}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assign letters to the diagram as below: + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Due to parallel line theorems, [`m\angle CAE = m\angle D = [$D]^{\circ}`]. This implies: + + [``\begin{aligned}[t] + m\angle BAC &= m\angle BAE - m\angle CAE \\ + &= [$AD]^{\circ} - [$D]^{\circ} \\ + & =[$A]^{\circ} + \end{aligned}``] + +By External Angle Theorem (Google it if needed), in [`\Delta CAE`], we have: + + [``\begin{aligned}[t] + m\angle BCA &= m\angle CAE + m\angle E \\ + &= [$D]^{\circ} + 90^{\circ} \\ + & =[$C]^{\circ} + \end{aligned}``] + +Now we can use Law of Sines to calculate the length of segment [`BC`]: + + [``\begin{aligned}[t] + \frac{\sin(\angle BCA)}{AB} &= \frac{\sin(\angle BAC)}{BC} \\ + BC\cdot \sin(\angle BCA) &= AB\cdot \sin(\angle BAC) \\ + BC &= \frac{AB\cdot \sin(\angle BAC))}{\sin(\angle BCA)} \\ + BC &= \frac{[$c]\sin([$A]^{\circ})}{\sin([$C]^{\circ})} \\ + BC &= [$a] + \end{aligned}``] + +The vertical support holding up the back of the panel need to be [`[$aU]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication40.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication40.pg new file mode 100644 index 0000000000..34b26fdcda --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication40.pg @@ -0,0 +1,178 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$c = random(100,200,10); +$cushion = $c/5; + +$Ex = $cushion; +$Ey = $cushion; + +$B = random(20,30,1); +$C = random(30,40,1); +$BC = $B+$C; +$b = $c*sin($B*pi/180)/sin($C*pi/180); +$bU = NumberWithUnits("$b km"); +$h = $b*sin($BC*pi/180); +$hU = NumberWithUnits("$h km"); + +$Ax = $Ex + $h*cos($BC*pi/180); +$Ay = $Ey; +$Bx = $Ax + $c; +$By = $Ey; +$Cx = $Ex; +$Cy = $Ey+$h; + +$xmin = 0; #The viewing window +$xmax = $Bx*240/210; +$ymin = 0; +$ymax = (210*$Cy/$Bx+30)*$Cy/(210*$Cy/$Bx); + +$xLabelShift = $xmax/10; +$yLabelShift = $ymax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + + $picture[$i]->new_color("darkblue", 100,100,255); + $picture[$i]->moveTo($Cx,$Cy); + $picture[$i]->lineTo($Bx,$By, darkblue,3); + $picture[$i]->lineTo($Ax,$Ay, darkblue,3); + $picture[$i]->lineTo($Cx,$Cy, darkblue,3); + $picture[$i]->lineTo($Bx,$Cy, darkblue,3,dashed); + + $picture[$i]->lb( new Label($Bx, $Cy,"D",'black','left','middle','large')); + $picture[$i]->lb( new Label($Ax, $Ay,"A",'black','center','top','large')); + $picture[$i]->lb( new Label($Bx, $By,"B",'black','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2, $Ay,"$c km",'black','center','top','large')); +} + +$picture[0]->lb( new Label($Cx, $Cy,"plane",'black','left','bottom','large')); +$picture[1]->lb( new Label($Cx, $Cy,"C (plane)",'black','left','bottom','large')); +$picture[1]->lb( new Label($Ex, $Ey,"E",'black','right','top','large')); + +$picture[1]->moveTo($Cx,$Cy); +$picture[1]->lineTo($Cx,$Ay, darkblue,1,dashed); +$picture[1]->lineTo($Ax,$Ay, darkblue,1,dashed); + +$xShift = $xmax/100; +$yShift = $xShift*210/240; +$picture[1]->moveTo($Cx,$Ay+5*$yShift); +$picture[1]->lineTo($Cx+3*$xShift,$Ay+5*$yShift, darkblue,3); +$picture[1]->lineTo($Cx+3*$xShift,$Ay, darkblue,3); + +$text[0] = "A horizontal line has Point A (on the left) and B (on the right), with their distance marked as $c km. A plane is in the air to the left of Point A, connected to A and B. From the plane, a dotted horizontal line extends to the right to Point D."; + +$text[1] = "A horizontal line has Point A (on the left) and B (on the right), with their distance marked as $c km. A plane is in the air, marked as C, to the left of Point A, connected to A and B. From the plane, a dotted horizontal line extends to the right to Point D. From the plane, a dotted vertical line is drawn to the ground, intersecting the line AB at Point E, to the left of Point A. A dotted line connects E to A."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +A pilot is flying over two cities. He determines the angles of depression to City A and City B, [`[$c]`] km apart, to be [`[$BC]^{\circ}`] and [`[$B]^{\circ}`]. Find the distance from the plane to City A, and find the plane's height. + +[@KeyboardInstructions( +"\n" +.'* Please include units in your answer. Use *km* to represent "kilometers".' +)@]** + +The plane's distance to City A is [_________]{$bU}. + +The plane's height is [_________]{$hU}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assign variables to the diagram as shown, and sketch the plane's height. + +>>[@ image(insertGraph( $picture[1] ), width=>240, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +The angle of depression to City B is [`[$B]^{\circ}`], implying [`m\angle DCB = [$B]^{\circ}`]. By Alternate Interior Angle Theorem (Google if needed), [`m\angle B = [$B]^{\circ}`]. + +The angle of depression to City A is [`[$BC]^{\circ}`], implying [`m\angle DCA = [$BC]^{\circ}`]. This implies: + + [``\begin{aligned}[t] + m\angle BCA &= m\angle DCA - m\angle DCB \\ + &= [$BC]^{\circ} - [$B]^{\circ} \\ + & =[$C]^{\circ} + \end{aligned}``] + +Now we can use Law of Sines in [`\Delta ABC`] to calculate the length of segment [`AC`]: + + [``\begin{aligned}[t] + \frac{\sin(\angle B)}{AC} &= \frac{\sin(\angle BCA)}{AB} \\ + AC\cdot \sin(\angle BCA) &= AB\cdot \sin(\angle B) \\ + AC &= \frac{AB\cdot \sin(\angle B))}{\sin(\angle BCA)} \\ + AC &= \frac{[$c]\sin([$B]^{\circ})}{\sin([$C]^{\circ})} \\ + AC &= [$b] + \end{aligned}``] + +The plane's distance to City A is [`[$bU]`]. + +By Exterior Angle Theorem (Google if needed), + + [``\begin{aligned}[t] + m\angle EAC &= m\angle BCA + m\angle B \\ + &= [$C]^{\circ} + [$B]^{\circ} \\ + & =[$BC]^{\circ} + \end{aligned}``] + +Next, in [`\Delta ACE`], we will use trigonometry to find the length of [`CE`]: + + [``\begin{aligned}[t] + \sin(\angle EAC) &= \frac{EC}{AC} \\ + EC &= AC\cdot \sin(\angle EAC) \\ + EC &= [$b] \cdot \sin([$BC]^{\circ}) \\ + EC &= [$h] + \end{aligned}``] + +The plane's height is [`[$hU]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication50.pg b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication50.pg new file mode 100644 index 0000000000..978e7e7db6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/LawOfSines/LawOfSinesApplication50.pg @@ -0,0 +1,161 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserNumberWithUnits.pl", + "PCCmacros.pl", + "PGcourse.pl", +); + +############################################## + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$c = random(100,200,10); +$cushion = $c/5; + +$B = random(50,70,1); +$B2 = 180-$B; +$A = random(20,40,1); +$C = $B-$A; +$b = $c*sin($B*pi/180)/sin($C*pi/180); +$a = $c*sin($A*pi/180)/sin($C*pi/180); +$h = $b*sin($A*pi/180); +$hU = NumberWithUnits("$h m"); + +$Ax = $cushion; +$Ay = $cushion; +$Bx = $Ax + $c; +$By = $Ay; +$Cx = $Ax+$b*cos($A*pi/180); +$Cy = $Ay+$h; +$Dx = $Cx; +$Dy = $Ay; + +$xmin = 0; #The viewing window +$xmax = $Cx*240/210; +$ymin = 0; +$ymax = (210*$Cy/$Cx+30)*$Cy/(210*$Cy/$Cx); + +$xLabelShift = $xmax/20; +$yLabelShift = $ymax/100; + +for my $i (0..0) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240*$ymax/$xmax]); + + $picture[$i]->new_color("darkblue", 100,100,255); + $picture[$i]->moveTo($Bx,$By); + $picture[$i]->lineTo($Ax,$Ay, darkblue,3); + $picture[$i]->lineTo($Cx,$Cy, darkblue,3); + $picture[$i]->lineTo($Bx,$By, darkblue,3); + $picture[$i]->lineTo($Dx,$Dy, darkblue,3); + $picture[$i]->lineTo($Cx,$Cy, darkblue,3); + + $picture[$i]->lb( new Label($Ax, $Ay,"A",'black','right','top','large')); + $picture[$i]->lb( new Label($Bx, $By,"B",'black','center','top','large')); + $picture[$i]->lb( new Label($Cx, $Cy,"C",'black','center','bottom','large')); + $picture[$i]->lb( new Label($Dx, $Dy,"D",'black','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2, $Ay,"$c m",'black','center','top','large')); + +} + +$picture[0]->lb( new Label($Bx+$xLabelShift, $By+$yLabelShift,"$B",'black','left','bottom','large')); +$picture[0]->lb( new Label($Ax+2*$xLabelShift, $Ay+$yLabelShift,"$A",'black','left','bottom','large')); + +$xShift = $xmax/100; +$yShift = $xShift*210/240; +$picture[0]->moveTo($Cx,$Dy+5*$yShift); +$picture[0]->lineTo($Cx-3*$xShift,$Dy+5*$yShift, darkblue,3); +$picture[0]->lineTo($Cx-3*$xShift,$Dy, darkblue,3); + +$text[0] = "Segment CD vertical to the ground represents the building. Point A on the ground has a $A-degree angle of elevation to Point C, top of the building. Point B, closer to the building on the ground, has a $B-degree angle of elevation to Point C. The distance between A and B is marked as $c meters. AB is extended toward the building, intersecting with CD at D. Angle D is marked as a right angle."; + +############################################## +$refreshCachedImages = 1; +TEXT(beginproblem()); + +BEGIN_PGML + +In order to estimate the height of a building, two students stand at a certain distance from the building at street level. From this point, they find the angle of elevation from the street to the top of the building to be [`[$A]^{\circ}`]. They then move [`[$c]`] meters closer to the building and find the angle of elevation to be [`[$B]^{\circ}`]. Assuming that the street is level, estimate the height of the building. + +[@KeyboardInstructions( +"\n" +.'* Please include units in your answer. Use *m* to represent "meters".' +)@]** + +The building's height is [_________]{$hU}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Assign variables to the diagram as shown: + +>>[@ image(insertGraph( $picture[0] ), width=>240, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +CD represents the building. Point A and Point B are those two observation spots. + +In [`\Delta ABC`], by Exterior Angle Theorem (Google if needed), [`m\angle CBD = m\angle A + m\angle ACB`]. So we have: + + [``\begin{aligned}[t] + m\angle CBD &= m\angle A + m\angle ACB \\ + m\angle ACB &= m\angle CBD - m\angle A \\ + m\angle ACB &= [$B]^{\circ} - [$A]^{\circ} \\ + m\angle ACB & =[$C]^{\circ} + \end{aligned}``] + +Now we can use Law of Sines in [`\Delta ABC`] to calculate the length of segment [`AC`]: + + [``\begin{aligned}[t] + \frac{\sin(\angle A)}{BC} &= \frac{\sin(\angle ACB)}{AB} \\ + BC\cdot \sin(\angle ACB) &= AB\cdot \sin(\angle A) \\ + BC &= \frac{AB\cdot \sin(\angle A))}{\sin(\angle ACB)} \\ + BC &= \frac{[$c]\sin([$A]^{\circ})}{\sin([$C]^{\circ})} \\ + BC &= [$a] + \end{aligned}``] + +Next, we use trigonometry in [`\Delta BCD`] to calculate the length of [`CD`]: + + [``\begin{aligned}[t] + \sin(\angle CBD) &= \frac{CD}{BC} \\ + CD &= BC\cdot \sin(\angle CBD) \\ + CD &= [$a] \cdot \sin([$B]^{\circ}) \\ + CD &= [$h] + \end{aligned}``] + +The building's height is [`[$hU]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates10.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates10.pg new file mode 100644 index 0000000000..8864df9d3e --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates10.pg @@ -0,0 +1,151 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = @_; + if ($n==0) {return "0";} + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +Context("Fraction"); + +@num = (); +do { + $den = list_random(3,4,6); + $num[0] = random(1,2*$den-1,1); + ($num[0],$den) = Fraction($num[0],$den)->reduce->value; +} until ($den != 1); + +$r = random(1,5,1); + +$num[1] = ($num[0]>$den) ? $num[0]-$den : $num[0]+$den; +$num[2] = $num[0]-2*$den; +$num[3] = $num[1]-2*$den; + +@frac = (); +$frac[0] = output($num[0],$den); +$frac[1] = output($num[1],$den); +$frac[2] = output($num[2],$den); +$frac[3] = output($num[3],$den); +$frac[4] = output($num[0],$den); +$frac[5] = output($num[1],$den); +$frac[6] = output(-$num[2],$den); +$frac[7] = output(-$num[3],$den); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Choose all polar coordinates which represents Point A in the graph. There may be more than one correct answer.", + "\( \left( $r, $frac[0] \right)_p \) $BR", + "\( \left( -$r, $frac[1] \right)_p \) $BR", + "\( \left( $r, $frac[2] \right)_p \) $BR", + "\( \left( -$r, $frac[3] \right)_p \) $BR", +); + +$mc -> extra( + "\( \left( -$r, $frac[4] \right)_p \) $BR", + "\( \left( $r, $frac[5] \right)_p \) $BR", + "\( \left( $r, $frac[6] \right)_p \) $BR", + "\( \left( -$r, $frac[7] \right)_p \) $BR", +); + + +$r0 = 5; +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +for my $i (0..$r0) { + $xfuncAlpha = sub { my $t = shift(); + return $i*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $i*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); + $fnAlpha->domain(0,2*pi); +} + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r0*cos($i*pi/$den), $r0*sin($i*pi/$den), 'blue' ) ); +} + +$graph -> stamps( closed_circle( $r*cos($num[0]*pi/$den), $r*sin($num[0]*pi/$den), 'red' ) ); +$graph->lb(new Label($r*cos($num[0]*pi/$den), $r*sin($num[0]*pi/$den),"A",'red','center','bottom',large)); +$graph->lb(new Label($r0*cos(pi/$den), $r0*sin(pi/$den), "pi/$den",'blue','left','bottom',large)); + +$alt = "This is a polar system with 5 circles with radius being 1, 2, 3, 4 and 5. Point A with radius $r and at the direction of $num[0] pi/$den is marked."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + + +BEGIN_PGML_SOLUTION + +For a polar coordinate [`(r,\theta)_p`], [`r`] could be negative, which implies going in the opposite direction of [`\theta`]. + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates20.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates20.pg new file mode 100644 index 0000000000..e07d686074 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates20.pg @@ -0,0 +1,160 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + Context("Fraction"); + Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, + ); + + my ($n,$d) = @_; + ($n,$d) = Fraction($n,$d)->reduce->value; + if ($n==0) {return "0";} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n \pi";} + } + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$den = list_random(3,4,6); +$num = random(1,2*$den-1,1); +($num,$den) = Fraction($num,$den)->reduce->value; + +$num = random(-1,1,2)*$num; +$fracShow0 = output($num,$den); +$frac0 = $den==1 ? Formula("$num*pi") : Formula("($num*pi)/$den"); +$r0 = random(2,10,1); + +if ($den==3) { + $cos0 = Fraction(cos(Compute($frac0))); + $x0 = Fraction($r0*cos(Compute($frac0))); + $x1 = Fraction(-$r0*cos(Compute($frac0))); +} else { + $cos0 = specialRadical(cos(Compute($frac0))); + $x0 = specialRadical($r0*cos(Compute($frac0))); + $x1 = specialRadical(-$r0*cos(Compute($frac0))); +} +if ($den==6) { + $sin0 = Fraction(sin(Compute($frac0))); + $y0 = Fraction($r0*sin(Compute($frac0))); + $y1 = Fraction(-$r0*sin(Compute($frac0))); +} else { + $sin0 = specialRadical(sin(Compute($frac0))); + $y0 = specialRadical($r0*sin(Compute($frac0))); + $y1 = specialRadical(-$r0*sin(Compute($frac0))); +} + + +############################################## + +BEGIN_PGML + +Convert polar coordinates to rectangular coordinates. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +)@]** + +###Part a + + [`` \left([$r0],[$fracShow0]\right)_p=(``][__________]{$x0},[__________]{$y0}[`)_r`] + +###Part b + + [`` \left(-[$r0],[$fracShow0]\right)_p=(``][__________]{$x1},[__________]{$y1}[`)_r`] + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To change polar coordinates [`(r,\theta)_p`] to rectangular coordinates, use the formula: + + [``x=r\cos(\theta)\text{ and }y=r\sin(\theta)``] + +###Part a: + + [``\begin{aligned} + x &= r\cos(\theta) \\ + &= [$r0]\cos\left([$fracShow0]\right) \\ + &= [$r0]\left([$cos0]\right) \\ + &= [$x0] + \end{aligned}``] + +and: + + [``\begin{aligned} + xy &= r\sin(\theta) \\ + &= [$r0]\sin\left([$fracShow0]\right) \\ + &= [$r0]\left([$sin0]\right) \\ + &= [$y0] + \end{aligned}``] + +We have: + + [`` \left([$r0],[$fracShow0]\right)_p=\left([$x0],[$y0]\right)_r``] + +###Part b: + +When radius is negative in [`(r,\theta)_p`], in the direction of [`\theta`], we go to the negative direction. If [`(r,\theta)_p`] corresponds to [`(x,y)_r`], then [`(-r,\theta)_p`] corresponds to [`(-x,-y)_r`]. + +We have: + + [`` \left(-[$r0],[$fracShow0]\right)_p=\left([$x1],[$y1]\right)_r``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates30.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates30.pg new file mode 100644 index 0000000000..bd8f6ecdee --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates30.pg @@ -0,0 +1,140 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +do { + $den = list_random(3,4,6); + $num = random(1,2*$den-1,1); + ($num,$den) = Fraction($num,$den)->reduce->value; +} until $den!=2 && $den!=1; + +$tanV = ($den==4) ? tan($num*pi/$den) : specialRadical(tan($num*pi/$den)); +$s1 = specialAngle(arctan(Compute($tanV))); +$s2 = specialAngle(Compute($s1)+pi); + +if ($tanV>0) { + $Q = ($num<$den) ? "I" : "III"; + $s3 = ($num<$den) ? $s1 : $s2; +} else { + $Q = ($num<$den) ? "II" : "IV"; + $s3 = ($num<$den) ? $s2 : $s1; +} + +$frac0 = specialAngle($num*pi/$den); +$r0 = random(2,10,1); + +if ($den==3) { + $cos0 = Fraction(cos(Compute($frac0))); + $x0 = Fraction($r0*cos(Compute($frac0))); +} else { + $cos0 = specialRadical(cos(Compute($frac0))); + $x0 = specialRadical($r0*cos(Compute($frac0))); +} +if ($den==6) { + $sin0 = Fraction(sin(Compute($frac0))); + $y0 = Fraction($r0*sin(Compute($frac0))); +} else { + $sin0 = specialRadical(sin(Compute($frac0))); + $y0 = specialRadical($r0*sin(Compute($frac0))); +} + + +############################################## + +BEGIN_PGML + +Convert rectangular coordinates to polar coordinates. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use positive [|r|]* value.' +."\n" +.'* Use angle values in the range of [`[0,2\pi)`].' +)@]** + + [`` \left([$x0],[$y0]\right)_r=(``][__________]{$r0},[__________]{$frac0}[`)_p`] + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +To change rectangular coordinates [`(x,y)_r`] to polar coordinates [`(r,\theta)_p`], use the following formulas: + + [``r=\sqrt{x^2+y^2}\text{ and }\tan(\theta)=\frac{y}{x}``] + +###Calculating [`r`] + + [``\begin{aligned} + r &= \sqrt{x^2+y^2} \\ + &= \sqrt{\left([$x0]\right)^2+\left([$y0]\right)^2} \\ + &= [$r0] + \end{aligned}``] + +###Calculating [`\theta`] + + [``\begin{aligned} + \tan(\theta) &= \frac{y}{x} \\ + &= \frac{[$y0]}{[$x0]} \\ + &= [$tanV] + \end{aligned}``] + +On the Unit Circle, two values makes [`\tan(\theta)=[$tanV]`] true: + + [`` \tan\left([$s1]\right) = [$tanV]\text{ and }\tan\left([$s2]\right) = [$tanV] ``] + +By [`([$x0],[$y0])_r`], the angle is in Quadrant [$Q]. So we should choose + + [`` \theta=[$s3] ``] + +Since the range of [`\theta`] is [`[0,2\pi)`], the correct solution is + + [`` \left([$r0],[$frac0]\right)_p ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates40.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates40.pg new file mode 100644 index 0000000000..22736bf0ca --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarCoordinates40.pg @@ -0,0 +1,100 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$r = random(1,5,1); +$n = random(0,3,1); +$d = 2; + +if ($n==0) { + $frac = Formula("0"); + $s1 = "positive x-axis"; +} elsif ($n==1) { + $frac = Formula("pi/$d"); + $s1 = "positive y-axis"; +} elsif ($n==2) { + $frac = Formula("pi"); + $s1 = "negative x-axis"; +} else { + $frac = Formula("($n*pi)/$d"); + $s1 = "negative y-axis"; +} + +$x = $r*cos(Compute($frac)); +$y = $r*sin(Compute($frac)); + + + +############################################## + +BEGIN_PGML + +Convert rectangular coordinates to polar coordinates. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use positive [|r|]* value.' +."\n" +.'* Use angle values in the range of [`[0,2\pi)`].' +)@]** + + [`` \left([$x],[$y]\right)_r=(``][__________]{$r},[__________]{$frac}[`)_p`] + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +The given coordinates [`\left([$x],[$y]\right)_r`] is on the [$s1]. + +The correct solution is + + [`` \left([$r],[$frac]\right)_p ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation10.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation10.pg new file mode 100644 index 0000000000..375edbed7a --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation10.pg @@ -0,0 +1,90 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(r=>"Real",y=>"Real"); #t=>"Real", +Context()->variables->add(t=>['Real',TeX=>'\theta']); +parser::Assignment->Allow; + +$left = Compute("x**2+y**2"); +$rad = non_zero_random(-5,5,1); +$right = ($rad)**2; +$ans = OneOf(Compute("r=$rad"),Compute("r=-$rad")); + + +############################################## + +BEGIN_PGML + +Convert Cartesian equation [`[$left]=[$right]`] to polar equation. + +[@KeyboardInstructions( +"\n" +.'* Use the variable [|t|]* to represent [`\theta`] in your polar equation.' +."\n" +.'* Type your answer in the form [|r=...|]*.' +."\n" +.'* Don\'t forget [|( )|]* when you use [`\sin()`] and [`\cos()`].' +)@]** + + Polar equation: [______________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + r^2 &= [$right] \\ + r &= \pm\sqrt{[$right]} \\ + r &= [$rad] \text{ or }r=-[$rad] + \end{aligned}``] + +Either [`r=[$rad]`] or [`r=-[$rad]`] represents the same circle with a radius of [`[$rad]`] and centered at the origin. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation20.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation20.pg new file mode 100644 index 0000000000..dfdd382a01 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation20.pg @@ -0,0 +1,95 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(r=>"Real",y=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +parser::Assignment->Allow; + +$v = random(0,1,1)==0 ? "x" : "y"; +$right = non_zero_random(-10,10,1); + +if ($v eq "x") { + $left = Compute("x"); + $s1 = Compute("r*cos(t)"); + $s2 = Compute("$right/cos(t)"); + $ans = Formula("r = $right/cos(t)")->reduce; +} else { + $left = Compute("y"); + $s1 = Compute("r*sin(t)"); + $s2 = Compute("$right/sin(t)"); + $ans = Formula("r = $right/sin(t)")->reduce; +} + +############################################## + +BEGIN_PGML + +Convert Cartesian equation [`[$left]=[$right]`] to polar equation. + +[@KeyboardInstructions( +"\n" +.'* Use the variable [|t|]* to represent [`\theta`] in your polar equation.' +."\n" +.'* Type your answer in the form [|r=...|]*.' +."\n" +.'* Don\'t forget [|( )|]* when you use [`\sin()`] and [`\cos()`].' +)@]** + + Polar equation: [______________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + [$s1] &= [$right] \\ + r &= [$s2] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation30.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation30.pg new file mode 100644 index 0000000000..bdf5646657 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation30.pg @@ -0,0 +1,94 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(r=>"Real",y=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +parser::Assignment->Allow; + +$m = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$left = Compute("y"); +$right = Compute("$m*x+$b")->reduce; + +$ans = Formula("r = $b/(sin(t)-$m*cos(t))")->reduce; + +############################################## + +BEGIN_PGML + +Convert Cartesian equation [`[$left]=[$right]`] to polar equation. + +[@KeyboardInstructions( +"\n" +.'* Use the variable [|t|]* to represent [`\theta`] in your polar equation.' +."\n" +.'* Type your answer in the form [|r=...|]*.' +."\n" +.'* Don\'t forget [|( )|]* when you use [`\sin()`] and [`\cos()`].' +)@]** + + Polar equation: [______________________]{$ans} + +END_PGML + +############################################## + +$s1 = Compute("$m*(r*cos(t))+$b")->reduce; +$s2 = Compute("r*sin(t)-r*$m*cos(t)")->reduce; +$s3 = Compute("r*(sin(t)-$m*cos(t))")->reduce; +$ansR = Compute("$b/(sin(t)-$m*cos(t))")->reduce; + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + r\sin(\theta) &= [$s1] \\ + [$s2] &= [$b] \\ + [$s3] &= [$b] \\ + r &= [$ansR] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation40.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation40.pg new file mode 100644 index 0000000000..55d7614fcf --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation40.pg @@ -0,0 +1,113 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->are(x=>"Real",y=>"Real"); +Context()->noreduce("(-x)-y","(-x)+y"); +$a = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); +$left = Compute("x**2+$a*x+y**2+$b*y")->reduce; +$right = "0"; + +parser::Assignment->Allow; +Context()->variables->are( + r => "Real", + t => ['Real',TeX=>'\theta'], + theta => ['Real',TeX=>'\theta'], +); +$answer = Formula("r = -$a*cos(t)-$b*sin(t)")->reduce; + +# Get the test points for the function to use the same values for t and theta +$test_points = []; +for my $i (0..9) { + my $r = random(0,10,0.001); + my $t = random(0,2*pi,0.001); + push @$test_points, [$r,$t,$t]; +} +$answer->{test_points} = $test_points; + + +############################################## + +BEGIN_PGML + +Convert the Cartesian equation [`[$left]=[$right]`] to a polar equation. + +[@KeyboardInstructions( +"\n" +.'* Use the variable [|t|]* to represent [`\theta`] in your polar equation.' +."\n" +.'* Type your answer in the form [|r=...|]*.' +."\n" +.'* Don\'t forget [|( )|]* when you use [`\sin()`] and [`\cos()`].' +)@]** + + Polar equation: [______________________]{$answer} + +END_PGML + +############################################## + +$s1 = Compute("r**2+$a*(r*cos(t))+$b*(r*sin(t))")->reduce; +$s2 = Compute("r+$a*cos(t)+$b*sin(t)")->reduce; +$s3 = Compute("-$a*cos(t)-$b*sin(t)")->reduce; + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + [$s1] &= 0 \\ + r([$s2]) &= 0 \\ + r &= 0 \text{ or }[$s2]=0 \\ + r &= 0 \text{ or }r=[$s3] + \end{aligned}``] + +[`r=0`] is not a true solution, so the polar equation form of [`[$left]=[$right]`] is + + [``[$answer]``] + +When you enter the answer, you can use *t* to represent [`\theta`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation50.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation50.pg new file mode 100644 index 0000000000..5252efc2fb --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation50.pg @@ -0,0 +1,81 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserImplicitEquation.pl", + "PGML.pl", + "parserOneOf.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("ImplicitEquation"); +Context()->variables->add(r=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); + +$rad = non_zero_random(-5,5,1); +$rad2 = ($rad)**2; +$ans = ImplicitEquation("x^2 + y^2 = $rad2", + limits=>[[-abs($rad)-1,abs($rad)+1],[-abs($rad)-1,abs($rad)+1]], + tolerance => .001 +); + +$left = Compute("r"); +$right = Compute("$rad"); + +############################################## + +BEGIN_PGML + +Convert polar equation [`[$left]=[$right]`] to Cartesian equation. + + Cartesian equation: [______________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + r^2 &= [$rad2] \\ + x^2+y^2 &= [$rad2] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation55.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation55.pg new file mode 100644 index 0000000000..a200fc7a16 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation55.pg @@ -0,0 +1,155 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->variables->add(r=>"Real",y=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +parser::Assignment->Allow; + +$den = list_random(3,4,6); +do {$num = random(1,2*$den-1,1);} until gcd($num,$den)==1; +$num = $num*random(-1,1,2); +if ($num==1) {$angle = Formula("pi/$den");} + elsif ($num==-1) {$angle = -Formula("pi/$den");} +else { + $numN = -$num; + $angle = ($num>0) ? Formula("$num*pi/$den") : -Formula("$numN*pi/$den"); +} + +$mV = tan(Compute($angle)); +$m = $mV; +if ($den != 4) { + $m = specialRadical($mV); +} + +$left = Compute("t"); +$right = $angle; +if ($m==1) {$ans = Formula("y=x");} + elsif ($m==-1) {$ans = Formula("y=-x");} + else {$ans = Formula("y=$m*x");} + + +$r0 = 5; +($xmin,$xmax) = (-8,8); +($ymin,$ymax) = (-8,8); +$graph = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r0*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r0*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +add_functions($graph, "$mV*x for x in <$xmin,$xmax> using color:blue and weight:2"); + +$Px = cos($num*pi/$den); +$Py = sin($num*pi/$den); +$PxShow = ($den==3) ? Fraction($Px) : specialRadical($Px); +$PyShow = ($den==6) ? Fraction($Py) : specialRadical($Py); + +$graph -> stamps( closed_circle( $r0*$Px, $r0*$Py, 'red' ) ); +$ud = $Py>0 ? 'bottom' : 'top'; +$graph->lb(new Label($r0*$Px, $r0*$Py,"$angle",'red','center',$ud,large)); +$lr = $Px>0 ? 'left' : 'right'; +$graph->lb(new Label($r0*$Px, $r0*$Py/2, "$PyShow",'red',$lr,'middle',large)); +$ud = $Py>0 ? 'top' : 'bottom'; +$graph->lb(new Label($r0*$Px/2, 0, "$PxShow",'red','center',$ud,large)); + +$graph->moveTo(0,0); +$graph->lineTo($r0*$Px, $r0*$Py, red, 2); +$graph->lineTo($r0*$Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($r0*$Px, $yShift); +$graph->lineTo($r0*$Px+$xShift, $yShift, red, 2); +$graph->lineTo($r0*$Px+$xShift, 0, red, 2); + +$alt = "This is a unit circle with a line corssing the origin. The line intersects with the circle at a point marked as $angle. From this point, a vertical line is drawn toward the x-axis. The intersection, the point and the origin form a right triangle. Its base is marked as $PxShow, and its height is marked as $PyShow."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +############################################## + +BEGIN_PGML + +Convert polar equation [`[$left]=[$right]`] to Cartesian equation. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt( )|]* to input square root if needed. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +)@]** + + Cartesian equation: [______________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +The polar equation [`[$left]=[$right]`] has all points on the line which creates the angle [`[$right]`] with the x-axis. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[`[$angle]`] is a speical angle with known trig values: + + [``\sin\left([$angle]\right) = [$PyShow]\text{ and }\cos\left([$angle]\right) = [$PxShow] ``] + +Those values can be marked as the base and height of the right triangle in the graph. + +The line's slope can be calculated by + + [``\begin{aligned} + \text{slope} &= \frac{\text{change in y}}{\text{change in x}} \\ + &= \frac{[$PyShow]}{[$PxShow]} \\ + &= [$m] + \end{aligned}``] + +The line's Cartesian equation is [`[$ans]`]. +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation60.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation60.pg new file mode 100644 index 0000000000..078f3f32dc --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation60.pg @@ -0,0 +1,88 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserOneOf.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->variables->add(r=>"Real",y=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +parser::Assignment->Allow; + +$v = random(0,1,1)==0 ? "x" : "y"; +$a = non_zero_random(-10,10,1); +$left = Compute("r"); + +if ($v eq "x") { + $right = Compute("$a*sec(t)"); + $s1 = Compute("$a/cos(t)"); + $s2 = Compute("r*cos(t)"); + $ans = Formula("x = $a")->reduce; +} else { + $right = Compute("$a*csc(t)"); + $s1 = Compute("$a/sin(t)"); + $s2 = Compute("r*sin(t)"); + $ans = Formula("y = $a")->reduce; +} + +############################################## + +BEGIN_PGML + +Convert polar equation [`[$left]=[$right]`] to Cartesian equation. + + Cartesian equation: [______________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + r &= [$s1] \\ + [$s2] &= [$a] \\ + [$v] &= [$a] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation70.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation70.pg new file mode 100644 index 0000000000..e5076a27a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation70.pg @@ -0,0 +1,91 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PCCmacros.pl", + "PGML.pl", + "parserAssignment.pl", + "parserImplicitPlane.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +$m = non_zero_random(-10,10,1); +$b = non_zero_random(-10,10,1); + +Context("Numeric"); +Context()->variables->add(y=>"Real"); +parser::Assignment->Allow; +$ansShow = Compute("y=$m*x+$b")->reduce; + +Context("ImplicitPlane"); +Context()->variables->add(r=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +Context()->noreduce("(-x)-y","(-x)+y"); +$left = Compute("r"); +$right = Compute("$b/(sin(t)-$m*cos(t))")->reduce; + +$ans = ImplicitPlane("y=$m*x+$b")->reduce; + +############################################## + +BEGIN_PGML + +Convert polar equation [`[$left]=[$right]`] to Cartesian equation. + + Cartesian equation: [______________________]{$ans->cmp(correct_ans_latex_string=> $ansShow->TeX)} + +END_PGML + +############################################## + +$s1 = Compute("y-$m*x")->reduce; +$s2 = Compute("r*sin(t)-$m*r*cos(t)")->reduce; +$s3 = Compute("r*(sin(t)-$m*cos(t))")->reduce; +$s4 = Compute("$m*x+$b")->reduce; + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + [$s3] &= [$b] \\ + [$s2] &= [$b] \\ + [$s1] &= [$b] \\ + y &= [$s4] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation80.pg b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation80.pg new file mode 100644 index 0000000000..71ece5b650 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Polar/PolarEquation80.pg @@ -0,0 +1,94 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserAssignment.pl", + "parserImplicitEquation.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("ImplicitEquation"); +Context()->variables->add(r=>"Real"); +Context()->variables->add(t=>['Real',TeX=>'\theta']); +Context()->noreduce("(-x)-y","(-x)+y"); + +do { + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); + $rad = sqrt(($a)**2/4+($b)**2/4); +} until ($rad>abs($b/2)); +$left = Compute("r"); +$right = Compute("-$a*sin(t)-$b*cos(t)")->reduce; + +$ans = ImplicitEquation("x**2+$b*x+y**2+$a*y=0", + limits=>[[-$b/2-$rad,-$b/2+$rad],[-2*$rad,2*$rad]], + tolerance => .001 +); + +$ansL = Compute("x**2+$b*x+y**2+$a*y")->reduce; + +############################################## + +BEGIN_PGML + +Convert the polar equation [`[$left]=[$right]`] to a Cartesian equation. + + Cartesian equation: [______________________]{$ans->cmp(correct_ans_latex_string=>($ansL->TeX))} + +END_PGML + +############################################## + + +$s1 = Compute("-$a*r*sin(t)-$b*r*cos(t)")->reduce; +$s2 = Compute("-$a*y-$b*x")->reduce; + +BEGIN_PGML_SOLUTION + +To convert between Cartesian equation and polar equation, use the following formulas: + + [``\begin{aligned} + r^2 &= x^2+y^2 \\ + x &= r\cos(\theta) \\ + y &= r\sin(\theta) + \end{aligned}``] + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + r\cdot\left([$left]\right) &= r\cdot\left([$right]\right) \\ + r^2 &= [$s1] \\ + x^2+y^2 &= [$s2] \\ + [$ansL] &= 0 + \end{aligned}``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations10.pg b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations10.pg new file mode 100644 index 0000000000..d6e67f548b --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations10.pg @@ -0,0 +1,125 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "parserFunction.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@num = (); +@den = (); +@angle = (); + + for my $i (0..1) { + do { + $den[$i] = list_random(3,4,6); + $num[$i] = random(1,2*$den[$i]-1,1); + } until gcd($num[$i],$den[$i])==1; + $angle[$i] = specialAngle($num[$i]*pi/$den[$i]); + } + $angle[2] = specialAngle(Compute($angle[0])+Compute($angle[1]),(1,2,3,4,6,12)); + +if ($angle[2]>=Compute("2*pi")) { + $angle[3] = specialAngle(Compute($angle[2])-2*pi,(1,2,3,4,6,12)); +} else { + $angle[3] = $angle[2]; +} + +@r = (); @com = (); +Context()->variables->add(i=>"Real"); +for my $j (0..1) { + $r[$j] = random(2,10,1); + $com[$j] = Formula("$r[$j]*(cos($angle[$j])+i*sin($angle[$j]))"); +} +$r[2] = $r[0]*$r[1]; +$com[2] = Formula("$r[2]*(cos($angle[3])+i*sin($angle[3]))"); + +Context("Complex"); +parserFunction("cis(z)" => "cos(z) + i*sin(z)"); +Context()->flags->set(reduceConstantFunctions => 0); + +for my $j (0..1) { + $c[$j] = Formula("$r[$j]*cis($angle[$j])"); +} +$ans = Formula("$r[2]*cis($angle[3])"); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Do the following calculation. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + +If [` z_1=[$c[0]]`] and [`z_2=[$c[1]]`], then + + [``z_1z_2=``][________________________]{$ans} + +END_PGML + +############################################## + +Context("Fraction"); +$s2 = ""; +if ( Compute($angle[3]) != Compute($angle[2]) ) { + $s2 = "&= $r[2] \left( \cos\left(".$angle[3]->TeX."\right)+i\sin\left(".$angle[3]->TeX."\right) \right) \\"; +} + +BEGIN_PGML_SOLUTION + +If [`z_1=r_1\left(\cos(\theta_1)+i\sin(\theta_1)\right)`] and [`z_2=r_2\left(\cos(\theta_2)+i\sin(\theta_2)\right)`], then + + [`` z_1z_2=r_1r_2\left(\cos(\theta_1+\theta_2)+i\sin(\theta_1+\theta_2)\right) ``] + +We have: + + [``\begin{aligned} + z_1z_2 &= \left([$c[0]]\right)\cdot\left([$c[1]]\right) \\ + &= \left([$com[0]]\right)\cdot\left([$com[1]]\right) \\ + &= [$r[0]]\cdot[$r[1]]\left( \cos\left([$angle[0]]+[$angle[1]]\right)+i\sin\left([$angle[0]]+[$angle[1]]\right) \right) \\ + &= [$r[2]]\left( \cos\left([$angle[2]]\right)+i\sin\left([$angle[2]]\right) \right) \\ + [$s2] &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations20.pg b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations20.pg new file mode 100644 index 0000000000..c33395a9c3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations20.pg @@ -0,0 +1,126 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserFunction.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "parserOneOf.pl", + "PGcourse.pl", +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@num = (); +@den = (); +@angle = (); + + for my $i (0..1) { + do { + $den[$i] = list_random(3,4,6); + $num[$i] = random(1,2*$den[$i]-1,1); + } until gcd($num[$i],$den[$i])==1; + $angle[$i] = specialAngle($num[$i]*pi/$den[$i]); + } + $angle[2] = specialAngle(Compute($angle[0])-Compute($angle[1]),(1,2,3,4,6,12)); + +if ($angle[2]variables->add(i=>"Real"); +for my $j (0..1) { + $com[$j] = Formula("$r[$j]*(cos($angle[$j])+i*sin($angle[$j]))"); +} +$com[2] = Formula("$r[2]*(cos($angle[3])+i*sin($angle[3]))"); + +Context("Complex"); +parserFunction("cis(z)" => "cos(z) + i*sin(z)"); +Context()->flags->set(reduceConstantFunctions => 0); + +for my $j (0..1) { + $c[$j] = Formula("$r[$j]*cis($angle[$j])"); +} + +@ans = (); +$ans[0] = Formula("$r[2]*cis($angle[2])"); +$ans[1] = Formula("$r[2]*cis($angle[3])"); +$ans = OneOf($ans[0],$ans[1]); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Do the following calculation. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + +If [` z_1=[$c[0]]`] and [`z_2=[$c[1]]`], then + + [`` \frac{z_1}{z_2}=``][________________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +If [`z_1=r_1\left(\cos(\theta_1)+i\sin(\theta_1)\right)`] and [`z_2=r_2\left(\cos(\theta_2)+i\sin(\theta_2)\right)`], then + + [`` \frac{z_1}{z_2}=\frac{r_1}{r_2}\left(\cos(\theta_1-\theta_2)+i\sin(\theta_1-\theta_2)\right) ``] + +We have: + + [``\begin{aligned} + \frac{z_1}{z_2} &= \frac{[$c[0]]}{[$c[1]]} \\ + &= \frac{[$com[0]]}{[$com[1]]} \\ + &= [$r[2]]\left( \cos\left([$angle[0]]-[$angle[1]]\right)+i\sin\left([$angle[0]]-[$angle[1]]\right) \right) \\ + &= [$r[2]]\left( \cos\left([$angle[2]]\right)+i\sin\left([$angle[2]]\right) \right) \\ + &= [$ans[0]] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations30.pg b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations30.pg new file mode 100644 index 0000000000..bdf0d9945c --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations30.pg @@ -0,0 +1,120 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserFunction.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@angle = (); + + do { + $den = list_random(3,4,6); + $num = random(1,2*$den-1,1); + } until gcd($num,$den)==1; + $angle[0] = specialAngle($num*pi/$den); + + do { + $n = random(2,5,1); + $r = random(2,5,1); + $rn = $r**$n; + } until $rn<=125; + $angle[1] = specialAngle($n*Compute($angle[0])); + +$angle[2] = $angle[1]; +while ($angle[2]>=Compute("2*pi")) { + $angle[2] = Compute($angle[2]-2*pi); +} +$angle[2] = specialAngle(Compute($angle[2])); + +Context()->variables->add(i=>"Real"); +@com = (); +$com[0] = Formula("$r*(cos($angle[0])+i*sin($angle[0]))"); +$com[1] = Formula("$rn*(cos($angle[2])+i*sin($angle[2]))"); + +Context("Complex"); +parserFunction("cis(z)" => "cos(z) + i*sin(z)"); +Context()->flags->set(reduceConstantFunctions => 0); + +$c = Formula("$r*cis($angle[0])"); +$ans = Formula("$rn*cis($angle[2])"); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Do the following calculation. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + +If [` z=[$c]`], then + + [`` z^{[$n]}=``][________________________]{$ans} + +END_PGML + +############################################## + +Context("Fraction"); +$s2 = ""; +if ( Compute($angle[2]) != Compute($angle[1]) ) { + $s2 = "&= $rn \left( \cos\left(".$angle[2]->TeX."\right)+i\sin\left(".$angle[2]->TeX."\right) \right) \\"; +} + +BEGIN_PGML_SOLUTION + +If [`z=r\left(\cos(\theta)+i\sin(\theta)\right)`], then + + [`` z^n=r^n\left(\cos(n\theta)+i\sin(n\theta)\right) ``] + +We have: + + [``\begin{aligned} + z^{[$n]} &= \left([$c]\right)^{[$n]} \\ + &= \left([$com[0]]\right)^{[$n]} \\ + &= [$r]^{[$n]}\left( \cos\left([$n]\cdot[$angle[0]]\right)+i\sin\left([$n]\cdot[$angle[0]]\right) \right) \\ + &= [$rn]\left( \cos\left([$angle[1]]\right)+i\sin\left([$angle[1]]\right) \right) \\ + [$s2] &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations35.pg b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations35.pg new file mode 100644 index 0000000000..761b586483 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations35.pg @@ -0,0 +1,200 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@angle = (); +do { + $den = list_random(3,4,6); + $num = random(1,2*$den-1,1); +} until gcd($num,$den)==1; +$angle[0] = specialAngle($num*pi/$den); + +@r = (); +do { + $n = random(3,5,1); + $r[0] = random(2,5,1); + $r[1] = $r[0]**$n; +} until $r[1]<=125; + +$angle[1] = specialAngle($n*Compute($angle[0])); +$angle[2] = $angle[1]; +while ($angle[2]>=Compute("2*pi")) { + $angle[2] = Compute($angle[2]-2*pi); +} +$angle[2] = specialAngle(Compute($angle[2])); + +@cosV = (); @sinV = (); +@xr = (); @yr = (); @yrAbs = (); +for my $i (0..1) { + $cosV[$i] = specialRadical(cos(Compute($angle[$i]))); + $sinV[$i] = specialRadical(sin(Compute($angle[$i]))); + $xr[$i] = specialRadical(Compute($cosV[$i]*$r[$i])); + $yr[$i] = specialRadical(Compute($sinV[$i]*$r[$i])); + $yrAbs[$i] = specialRadical(abs(Compute($sinV[$i]*$r[$i]))); +} + +if ($cosV[0]>0) { + $Q = ($sinV[0]>0) ? "I" : "IV"; +} else { + $Q = ($sinV[0]>0) ? "II" : "III"; +} + +Context()->variables->add(i=>"Real"); +@p = (); +$p[0] = ($yr[0]>0) ? Formula("$xr[0]+$yr[0]*i") : Formula("$xr[0]-$yrAbs[0]*i"); +if ($yr[1]==0) { + $p[1] = $xr[1]; +} else { + $p[1] = ($yr[1]>0) ? Formula("$xr[1]+$yr[1]*i") : Formula("$xr[1]-$yrAbs[1]*i"); +} + +@com = (); +$com[0] = Formula("$r[0]*(cos($angle[0])+i*sin($angle[0]))"); +$com[1] = Formula("$r[1]*(cos($angle[2])+i*sin($angle[2]))"); + +$s1 = specialAngle(arccos(Compute($cosV[0]))); + + + +package my::Complex; +our @ISA = ('Value::Complex'); + +sub cis { + my $z = shift; + return cos($z) + main::i * sin($z); +} + +package main; + +Context("Complex"); + +Context()->{value}{Complex} = 'my::Complex'; +Context()->constants->set(i => {value => my::Complex->new(0,1)}); +Context()->functions->add(cis => { + class => 'Parser::Function::complex', TeX => '\operatorname{cis}', + complex => 1, isCommand => 1 +}); + +sub cis {Parser::Function->call("cis", my::Complex->new(@_))} + +Context()->flags->set(reduceConstantFunctions => 0); + +@c = (); +$c[0] = Formula("$r[0]*cis($angle[0])"); +$c[1] = Formula("$r[1]*cis($angle[2])"); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Do the calculation. Write your answer in the form of [`a+b\operatorname{i}`]. + + [`` \left([$p[0]]\right)^{[$n]}= ``][________________________]{$p[1]} + +END_PGML + +############################################## + +Context("Fraction"); +$s2 = ""; +if ( Compute($angle[2]) != Compute($angle[1]) ) { + $s2 = "&= $r[1] \left( \cos\left(".$angle[2]->TeX."\right)+i\sin\left(".$angle[2]->TeX."\right) \right) \\"; +} + +BEGIN_PGML_SOLUTION + +If [`z=r\left(\cos(\theta)+i\sin(\theta)\right)`], then + + [`` z^n=r^n\left(\cos(n\theta)+i\sin(n\theta)\right) ``]. + +To use this formula, first, we have to convert [`[$p[0]]`] to polar form. + +###Converting [`[$p[0]]`] to polar form + +For [`z=x+yi`], [`r=\sqrt{x^2+y^2}`]. + +For [`[$p[0]]`], we have: + + [``\begin{aligned} + r &= \sqrt{\left([$xr[0]]\right)^2+\left([$yr[0]]\right)^2} \\ + &= [$r[0]] + \end{aligned}``] + +Now we can re-write [`[$p[0]]`] as [`[$r[0]]\left([$cosV[0]]+\left([$sinV[0]]\right)i\right)`]. + +To change [`[$r[0]]\left([$cosV[0]]+\left([$sinV[0]]\right)i\right)`] to the format of [`r(\cos(\theta)+i\sin(\theta))`], we need to find an angle which makes [`\cos(\theta)=[$cosV[0]]`] true. We have: + + [`` \theta = \cos^{-1}\left([$cosV[0]]\right) = [$s1] ``] + +Since [`[$p[0]]`] is in Quadrant [$Q], we can determine that [`\theta=[$angle[0]]`]. + +We have done the following conversion: + + [`` [$p[0]]=[$com[0]]=[$c[0]] ``] + +###Calculating n^{th} power + + [``\begin{aligned} + z^{[$n]} &= \left([$c[0]]\right)^{[$n]} \\ + &= \left([$com[0]]\right)^{[$n]} \\ + &= [$r[0]]^{[$n]}\left( \cos\left([$n]\cdot[$angle[0]]\right)+i\sin\left([$n]\cdot[$angle[0]]\right) \right) \\ + &= [$r[1]]\left( \cos\left([$angle[1]]\right)+i\sin\left([$angle[1]]\right) \right) \\ + [$s2] &= [$c[1]] + \end{aligned}``] + +###Converting to [`a+bi`] form + + [``\begin{aligned} + [$c[1]] + &= [$r[1]]\left( \cos\left([$angle[2]]\right)+i\sin\left([$angle[2]]\right) \right) \\ + &= [$r[1]]\cdot \cos\left([$angle[2]]\right) + i\cdot[$r[1]]\cdot\sin\left([$angle[2]]\right) \\ + &= [$p[1]] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations40.pg b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations40.pg new file mode 100644 index 0000000000..b089e3e274 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/CisOperations40.pg @@ -0,0 +1,163 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +do { + $denO = list_random(3,4,6); + $numO = random(1,2*$denO-1,1); +} until gcd($numO,$denO)==1; +$angleO = specialAngle($numO*pi/$denO); + +@num = (); +@den = (); +@angle = (); +@com = (); +$n = random(2,4,1); +$rn = random(2,5,1); +$r = $rn**$n; + +Context()->variables->add(i=>"Real"); +for my $k (0..$n-1) { + $angle[$k] = specialAngle(Compute($angleO/$n+2*$k*pi/$n),(1..24)); + $com[$k] = Formula("$rn*(cos($angle[$k])+i*sin($angle[$k]))"); +} + +package my::Complex; +our @ISA = ('Value::Complex'); + +sub cis { + my $z = shift; + return cos($z) + main::i * sin($z); +} + +package main; + +Context("Complex"); + +Context()->{value}{Complex} = 'my::Complex'; +Context()->constants->set(i => {value => my::Complex->new(0,1)}); +Context()->functions->add(cis => { + class => 'Parser::Function::complex', TeX => '\operatorname{cis}', + complex => 1, isCommand => 1 +}); + +sub cis {Parser::Function->call("cis", my::Complex->new(@_))} + +Context()->flags->set(reduceConstantFunctions => 0); + +$comO = Formula("$r*cis($angleO)"); + +@ans = (); +for my $k (0..$n-1) { + $ans[$k] = Formula("$rn*cis($angle[$k])"); +} +$ansL = List(@ans); + +if ($n==2) { + $th = "square roots"; +} elsif ($n==3) { + $th = "cube roots"; +} else { + $th = "4th roots"; +} + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Do the following calculation. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + +Find all [$th] of [` z=[$comO]`]. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use commas to separate your answers.' +)@]** + + roots: [___________________________________]{$ansL} + +END_PGML + +############################################## + +Context("Fraction"); +$s1 = specialAngle(Compute($angleO/$n),(1..24)); +($n0,$d0) = Fraction(2,$n)->reduce->value; +if ($d0==1) { + $s2 = ($n0==1) ? "k\pi" : "$n0 k\pi"; +} else { + $s2 = ($n0==1) ? "\frac{k\pi}{$d0}" : "\frac{$n0 k\pi}{$d0}"; +} +$s3 = "0, "; +for my $i (1..$n-1) { + $s3 .= "$i, "; +} +$s3 = substr($s3,0,length($s3)-2); + +BEGIN_PGML_SOLUTION + +For [`z=r\left(\cos(\theta)+i\sin(\theta)\right)`], its [$th] are + + [`` z^{\frac{1}{n}}=r^{\frac{1}{n}}\left( \cos\left(\frac{\theta}{n}+\frac{2k\pi}{n}\right)+i\sin\left(\frac{\theta}{n}+\frac{2k\pi}{n}\right) \right) ``], + +where [`k=0,1,...,n-1`]. + +We have: + + [``\begin{aligned} + z^{\frac{1}{[$n]}} &=[$r]^{\frac{1}{[$n]}}\left( \cos\left(\frac{[$angleO]}{[$n]}+\frac{2k\pi}{[$n]}\right)+i\sin\left(\frac{[$angleO]}{[$n]}+\frac{2k\pi}{[$n]}\right) \right) \\ + &= [$rn]\left( \cos\left([$s1]+[$s2]\right) + i\sin\left([$s1]+[$s2]\right) \right) \\ + \end{aligned}``] + +Substitute in [`k=[$s3]`], the roots of [`z`] are + + [``[$ansL]``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/ComplexAbsoluteValue10.pg b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/ComplexAbsoluteValue10.pg new file mode 100644 index 0000000000..42cfc9a5c5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/ComplexAbsoluteValue10.pg @@ -0,0 +1,80 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "answerHints.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Complex"); +Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0, formatStudentAnswer=>parsed); +Context()->noreduce('(-x)-y','(-x)+y'); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$multiple = 1; +$a = random(-1,1,2)*$multiple*$triples[$in][0]; +$b = random(-1,1,2)*$multiple*$triples[$in][1]; +$c = $multiple*$triples[$in][2]; + +$num = Compute("$a+$b*i")->reduce; + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Calculate the absolute value of [`[$num]`]: + + [`` \left|[$num]\right|= ``][___________]{$c} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + + [`` +\begin{aligned} + \left|[$num]\left| &= \sqrt{([$a])^2+([$b])^2} \\ + &= [$c] +\end{aligned} + ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/PolarToRectangular10.pg b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/PolarToRectangular10.pg new file mode 100644 index 0000000000..ddb26a877c --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/PolarToRectangular10.pg @@ -0,0 +1,89 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$den = 2; +$num = random(-10,10,1); +$angle = specialAngle($num*pi/$den); +$a = cos(Compute($angle)); +$b = sin(Compute($angle)); +$r = random(2,10,1); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->are(i=>"Real"); + +if ($a==0) { + $br = $b*$r; + $ans = Formula("$br*i"); +} elsif ($b==0) { + $ar = $a*$r; + $ans = Formula("$ar"); +} + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Convert from polar form to rectangular form: + + [`` [$r] \left( \cos\left([$angle]\right) +i\sin\left([$angle]\right) \right)= ``][___________________]{$ans} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$r] \left( \cos\left([$angle]\right) +i\sin\left([$angle]\right) \right) + &= [$r] ([$a]+([$b])i) \\ + &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/PolarToRectangular20.pg b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/PolarToRectangular20.pg new file mode 100644 index 0000000000..3a5d724c3c --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/PolarToRectangular20.pg @@ -0,0 +1,86 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +############################################## + +Context("Complex"); + +do { + $den = list_random(3,4,6); + $num = non_zero_random(-(2*$den-1),(2*$den-1)); +} until gcd($den,$num)==1; +$angle = specialAngle($num*pi/$den); + +$r = random(2,10,1); + +$ans = Formula(specialRadical("$r*cos($angle)+$r*i sin($angle)")); + +Context("LimitedRadical"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->are(i=>"Real"); + +$ans = Formula("$ans"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Convert from polar form to rectangular form. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|sqrt( )|]* for "square root". For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +)@]** + + [`` [$r] \left( \cos\left([$angle]\right) +i\sin\left([$angle]\right) \right)= ``][_______________________]{$ans} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$r] \left( \cos\left([$angle]\right) +i\sin\left([$angle]\right) \right) + &= [$r] \left([$a]+i\left([$b]\right)\right) \\ + &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/RectangularToPolar10.pg b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/RectangularToPolar10.pg new file mode 100644 index 0000000000..408fc4c6a9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/RectangularToPolar10.pg @@ -0,0 +1,123 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$den = 2; +$num = random(0,3,1); +$angle = specialAngle($num*pi/$den); +$x = cos(Compute($angle)); +$y = sin(Compute($angle)); +$r = random(2,10,1); + +$xr = $x*$r; +$yr = $y*$r; + +Context()->variables->add(i=>"Real"); +if ($x==0) { + $p = Formula("$yr*i"); +} elsif ($y==0) { + $p = Formula("$xr"); +} + +$com = Formula("$r*(cos($angle)+i*sin($angle))"); + +package my::Complex; +our @ISA = ('Value::Complex'); + +sub cis { + my $z = shift; + return cos($z) + main::i * sin($z); +} + +package main; + +Context("Complex"); + +Context()->{value}{Complex} = 'my::Complex'; +Context()->constants->set(i => {value => my::Complex->new(0,1)}); +Context()->functions->add(cis => { + class => 'Parser::Function::complex', TeX => '\operatorname{cis}', + complex => 1, isCommand => 1 +}); + +sub cis {Parser::Function->call("cis", my::Complex->new(@_))} + +$ans = Formula("$r*cis($angle)"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Convert the complex number to polar complex form. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + + [`` [$p]= ``][________________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +For [`z=x+yi`], [`r=\sqrt{x^2+y^2}`]. + +For [`[$p]`], we have: + + [``\begin{aligned} + r &= \sqrt{\left([$xr]\right)^2+\left([$yr]\right)^2} \\ + &= [$r] + \end{aligned}``] + +Now we can re-write [`[$p]`] as [`[$r]([$x]+([$y])i)`]. + +To change [`[$r]([$x]+([$y])i)`] to the format of [`r(\cos(\theta)+i\sin(\theta))`], we need to find an angle which makes [`\cos(\theta)=[$x]`] and [`\sin(\theta)=[$y]`] true. By the knowledge of Unit Circle, we can see [`\theta=[$angle]`]. + +Solution is: + + [`` [$p]=[$com]=[$ans] ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/RectangularToPolar20.pg b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/RectangularToPolar20.pg new file mode 100644 index 0000000000..7ab7ef7f2d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/PolarComplex/RectangularToPolar20.pg @@ -0,0 +1,135 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl",, +); + +############################################## + +Context("Fraction"); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +do { + $den = list_random(3,4,6); + $num = random(1,2*$den-1,1); +} until gcd($num,$den)==1; +$angle = specialAngle($num*pi/$den); +$cosV = specialRadical(cos(Compute($angle))); +$sinV = specialRadical(sin(Compute($angle))); +$r = Formula(random(2,10,1)); + +$xr = specialRadical(Compute($cosV*$r)); +$yr = specialRadical(Compute($sinV*$r)); +$yrAbs = specialRadical(abs(Compute($sinV*$r))); + +if ($cosV>0) { + $Q = ($sinV>0) ? "I" : "IV"; +} else { + $Q = ($sinV>0) ? "II" : "III"; +} + + +Context()->variables->add(i=>"Real"); +$p = ($yr>0) ? Formula("$xr+$yr*i") : Formula("$xr-$yrAbs*i"); +$com = Formula("$r*(cos($angle)+i*sin($angle))"); + +$s1 = specialAngle(arccos(Compute($cosV))); + +package my::Complex; +our @ISA = ('Value::Complex'); + +sub cis { + my $z = shift; + return cos($z) + main::i * sin($z); +} + +package main; + +Context("Complex"); + +Context()->{value}{Complex} = 'my::Complex'; +Context()->constants->set(i => {value => my::Complex->new(0,1)}); +Context()->functions->add(cis => { + class => 'Parser::Function::complex', TeX => '\operatorname{cis}', + complex => 1, isCommand => 1 +}); + +sub cis {Parser::Function->call("cis", my::Complex->new(@_))} + +$ans = Formula("$r*cis($angle)"); + + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML + +Convert the complex number to polar complex form. Use [`r\operatorname{cis}(\theta)`] to represent [`r(\cos(\theta)+i\sin(\theta))`]. + + [`` [$p]= ``][________________________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +For [`z=x+yi`], [`r=\sqrt{x^2+y^2}`]. + +For [`[$p]`], we have: + + [``\begin{aligned} + r &= \sqrt{\left([$xr]\right)^2+\left([$yr]\right)^2} \\ + &= [$r] + \end{aligned}``] + +Now we can re-write [`[$p]`] as [`[$r]\left([$cosV]+\left([$sinV]\right)i\right)`]. + +To change [`[$r]\left([$cosV]+\left([$sinV]\right)i\right)`] to the format of [`r(\cos(\theta)+i\sin(\theta))`], we need to find an angle which makes [`\cos(\theta)=[$cosV]`] true. We have: + + [`` \theta = \cos^{-1}\left([$cosV]\right) = [$s1] ``] + +Since [`[$p]`] is in Quadrant [$Q], we can determine that [`\theta=[$angle]`]. + +Solution is: + + [`` [$p]=[$com]=[$ans] ``] + +END_PGML_SOLUTION + +############################################## + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength10.pg b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength10.pg new file mode 100644 index 0000000000..02dfa5764e --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength10.pg @@ -0,0 +1,172 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$a = random(2,10,1); +$b = Formula("$a*sqrt(3)"); +$c = 2*$a; + +$Ax = 0; +$Ay = 0; +$Bx = sqrt(3); +$By = 1; +$Cx = $Bx; +$Cy = 0; + +$cushion = 0.2; + +$Dx = $Ax; +$Dy = $By+$cushion; +$Ex = $Bx; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$xmin = -$cushion; #The viewing window +$xmax = $Ey+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','middle','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+0.1); + $picture[$i]->lineTo($Cx-0.1,$Cy+0.1,blue,3); + $picture[$i]->lineTo($Cx-0.1,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"30",'blue','left','bottom','large')); + + $picture[$i]->lb( new Label($Bx+$xShift/5,($By+$Cy)/2,"$a",'blue','left','middle','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"x",'blue','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"y",'blue','right','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+0.1); +$picture[1]->lineTo($Fx-0.1,$Fy+0.1,blue,3); +$picture[1]->lineTo($Fx-0.1,$Fy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"30",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->lb( new Label($Ex+$xShift/5,($Ey+$Fy)/2,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a sqrt(3)",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"2a",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is $a. The length of AB is y. Angle A is 30 degrees."; + +$text[1] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is $a. The length of AB is y. Angle A is 30 degrees. Angle B is 60 degrees. There is a 30-60-90 right triangle, where the side opposite to 30 degrees is marked as a, the side opposite to 60 degrees is marked as a*sqrt(3), the hypotenuse is marked as 2a."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`30-60-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` x =``] [_____________]{$b} + + [`` y =``] [_____________]{$c} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +In the given 30-60-90 right triangle, its sides have the following relationship: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Note that: + + [``\begin{aligned} + a &= [$a] \\ + a \sqrt{3} &= x \\ + 2a &= y + \end{aligned}``] + +Now we can solve for [`x`] and [`y`] by proportion: + + [``\begin{aligned} + a &= [$a] \\ + x &= a\sqrt{3}=[$b] \\ + y &=2a=2([$a])=[$c] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength20.pg b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength20.pg new file mode 100644 index 0000000000..3f85fd399d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength20.pg @@ -0,0 +1,173 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$a = random(2,10,1); +$b = Formula("$a*sqrt(3)"); +$c = 2*$a; + +$Ax = 0; +$Ay = 0; +$Bx = sqrt(3); +$By = 1; +$Cx = $Bx; +$Cy = 0; + +$cushion = 0.2; + +$Dx = $Ax; +$Dy = $By+$cushion; +$Ex = $Bx; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$xmin = -$cushion; #The viewing window +$xmax = $Ey+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','middle','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+0.1); + $picture[$i]->lineTo($Cx-0.1,$Cy+0.1,blue,3); + $picture[$i]->lineTo($Cx-0.1,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"30",'blue','left','bottom','large')); + + $picture[$i]->lb( new Label($Bx+$xShift/5,($By+$Cy)/2,"y",'blue','left','middle','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"x",'blue','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"$c",'blue','right','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+0.1); +$picture[1]->lineTo($Fx-0.1,$Fy+0.1,blue,3); +$picture[1]->lineTo($Fx-0.1,$Fy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"30",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->lb( new Label($Ex+$xShift/5,($Ey+$Fy)/2,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a sqrt(3)",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"2a",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is y. The length of AB is $c. Angle A is 30 degrees."; + +$text[1] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is y. The length of AB is $c. Angle A is 30 degrees. Angle B is 60 degrees. There is a 30-60-90 right triangle, where the side opposite to 30 degrees is marked as a, the side opposite to 60 degrees is marked as a*sqrt(3), the hypotenuse is marked as 2a."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`30-60-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` x =``] [_____________]{$b} + + [`` y =``] [_____________]{$a} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +In the given 30-60-90 right triangle, its sides have the following relationship: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Note that: + + [``\begin{aligned} + 2a &= [$c] \\ + a &= y \\ + a \sqrt{3} &= x + \end{aligned}``] + +Since [`2a=[$c]`], [`a=\frac{[$c]}{2}=[$a]`] + +Now we can solve for [`x`] and [`y`]: + + [``\begin{aligned} + y &= a= [$a] \\ + x &= a\sqrt{3}=[$b] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength30.pg b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength30.pg new file mode 100644 index 0000000000..901e3901a3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength30.pg @@ -0,0 +1,183 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$k = random(2,10,1); +$k2 = 2*$k; +$b = 3*$k; +$a = Formula("$k*sqrt(3)"); +$c = Formula("$k2*sqrt(3)"); + +$Ax = 0; +$Ay = 0; +$Bx = sqrt(3); +$By = 1; +$Cx = $Bx; +$Cy = 0; + +$cushion = 0.2; + +$Dx = $Ax; +$Dy = $By+$cushion; +$Ex = $Bx; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$xmin = -$cushion; #The viewing window +$xmax = $Ey+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','middle','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+0.1); + $picture[$i]->lineTo($Cx-0.1,$Cy+0.1,blue,3); + $picture[$i]->lineTo($Cx-0.1,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"30",'blue','left','bottom','large')); + + $picture[$i]->lb( new Label($Bx+$xShift/5,($By+$Cy)/2,"y",'blue','left','middle','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"$b",'blue','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"x",'blue','right','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+0.1); +$picture[1]->lineTo($Fx-0.1,$Fy+0.1,blue,3); +$picture[1]->lineTo($Fx-0.1,$Fy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"30",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift/2,"60",'blue','right','top','large')); + +$picture[1]->lb( new Label($Ex+$xShift/5,($Ey+$Fy)/2,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a sqrt(3)",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"2a",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is $b. Angle C is a right angle. Side CB goes up, and the length is x. The length of AB is y. Angle A is 30 degrees."; + +$text[1] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is $b. Angle C is a right angle. Side CB goes up, and the length is x. The length of AB is y. Angle A is 30 degrees. Angle B is 60 degrees. There is a 30-60-90 right triangle, where the side opposite to 30 degrees is marked as a, the side opposite to 60 degrees is marked as a*sqrt(3), the hypotenuse is marked as 2a."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`30-60-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` x =``] [_____________]{$c} + + [`` y =``] [_____________]{$a} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +In the given 30-60-90 right triangle, its sides have the following relationship: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Note that: + + [``\begin{aligned} + a \sqrt{3} &= [$b] \\ + a \sqrt{3} &= y \\ + 2a &= x + \end{aligned}``] + +By [`a \sqrt{3} &= [$b]`], we can solve for [`a`]: + + [``\begin{aligned} + a\sqrt{3} &= [$b] \\ + a &= \frac{[$b]}{\sqrt{3}} \\ + a &= \frac{[$b]\cdot \sqrt{3}}{\sqrt{3}\cdot \sqrt{3}} \\ + a &= \frac{[$b]\cdot \sqrt{3}}{3} \\ + a &= [$a] + \end{aligned}``] + +Next, we can solve for [`x`] and [`y`]: + + [``\begin{aligned} + y &=a=[$a] \\ + x &= 2a = 2\cdot[$a]=[$c] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength40.pg b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength40.pg new file mode 100644 index 0000000000..5052183295 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength40.pg @@ -0,0 +1,172 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$a = random(2,10,1); +$b = $a; +$c = Formula("$a*sqrt(2)"); + +$Ax = 0; +$Ay = 0; +$Bx = 1; +$By = 1; +$Cx = 1; +$Cy = 0; + +$cushion = 0.2; + +$Dx = $Ax+$cushion; +$Dy = $By+$cushion; +$Ex = $Bx+$cushion; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$xmin = -$cushion; #The viewing window +$xmax = $Ey+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/20; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','middle','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+0.1); + $picture[$i]->lineTo($Cx-0.1,$Cy+0.1,blue,3); + $picture[$i]->lineTo($Cx-0.1,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"45",'blue','left','bottom','large')); + + $picture[$i]->lb( new Label($Bx+$xShift/5,($By+$Cy)/2,"$a",'blue','left','middle','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"x",'blue','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"y",'blue','right','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift,"45",'blue','right','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+0.1); +$picture[1]->lineTo($Fx-0.1,$Fy+0.1,blue,3); +$picture[1]->lineTo($Fx-0.1,$Fy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"45",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift,"45",'blue','right','top','large')); + +$picture[1]->lb( new Label($Ex+$xShift/5,($Ey+$Fy)/2,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"a sqrt(2)",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is $a. The length of AB is y. Angle A is 45 degrees."; + +$text[1] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is x. Angle C is a right angle. Side CB goes up, and the length is $a. The length of AB is y. Both Angle A and Angle B are 45 degrees. There is a 45-45-90 right triangle, where the legs are marked as a, the hypotenuse is marked as a sqrt(2)."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`45-45-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` x =``] [_____________]{$b} + + [`` y =``] [_____________]{$c} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +In the given 45-45-90 right triangle, its sides have the following relationship: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Note that: + + [``\begin{aligned} + a &= [$a] \\ + a &= x \\ + a \sqrt{2} &= y + \end{aligned}``] + +Now we can solve for [`x`] and [`y`] by proportion: + + [``\begin{aligned} + a &= [$a] \\ + x &= a =[$b] \\ + y &=a \sqrt{2}=[$c] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength50.pg b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength50.pg new file mode 100644 index 0000000000..2d5663fd21 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength50.pg @@ -0,0 +1,177 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$k = random(2,10,1); +$c = 2*$k; +$a = Formula("$k*sqrt(2)"); +$b = $a; + +$Ax = 0; +$Ay = 0; +$Bx = 1; +$By = 1; +$Cx = 1; +$Cy = 0; + +$cushion = 0.2; + +$Dx = $Ax+$cushion; +$Dy = $By+$cushion; +$Ex = $Bx+$cushion; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$xmin = -$cushion; #The viewing window +$xmax = $Ey+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/20; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Ax,$Ay); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','left','middle','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+0.1); + $picture[$i]->lineTo($Cx-0.1,$Cy+0.1,blue,3); + $picture[$i]->lineTo($Cx-0.1,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"45",'blue','left','bottom','large')); + + $picture[$i]->lb( new Label($Bx+$xShift/5,($By+$Cy)/2,"x",'blue','left','middle','large')); + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"y",'blue','center','top','large')); + $picture[$i]->lb( new Label(($Ax+$Bx)/2,($Ay+$By)/2,"$c",'blue','right','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift,"45",'blue','right','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+0.1); +$picture[1]->lineTo($Fx-0.1,$Fy+0.1,blue,3); +$picture[1]->lineTo($Fx-0.1,$Fy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"45",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift,"45",'blue','right','top','large')); + +$picture[1]->lb( new Label($Ex+$xShift/5,($Ey+$Fy)/2,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"a sqrt(2)",'blue','right','bottom','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is y. Angle C is a right angle. Side CB goes up, and the length is y. The length of AB is $c. Angle A is 45 degrees."; + +$text[1] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is y. Angle C is a right angle. Side CB goes up, and the length is y. The length of AB is $c. Both Angle A and Angle B are 45 degrees. There is a 45-45-90 right triangle, where the legs are marked as a, the hypotenuse is marked as a sqrt(2)."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`45-45-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` x =``] [_____________]{$b} + + [`` y =``] [_____________]{$a} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +In the given 45-45-90 right triangle, its sides have the following relationship: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +Note that: + + [``\begin{aligned} + a &= x \\ + a &= y \\ + a \sqrt{2} &= [$c] + \end{aligned}``] + +By [`a \sqrt{2} &= [$c]`], we can solve for [`a`]: + + [``\begin{aligned} + a\sqrt{2} &= [$c] \\ + a &= \frac{[$c]}{\sqrt{2}} \\ + a &= \frac{[$c]\cdot \sqrt{2}}{\sqrt{2}\cdot \sqrt{2}} \\ + a &= \frac{[$c]\cdot \sqrt{2}}{2} \\ + a &= [$a] + \end{aligned}``] + +Since [`x=a`] and [`y=a`], [`x=y=[$a]`]. + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength60.pg b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength60.pg new file mode 100644 index 0000000000..db3e5099f2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength60.pg @@ -0,0 +1,220 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$k = random(2,10,1); +$k2 = 2*$k; +$b = 3*$k; +$a = Formula("$k*sqrt(3)"); +$c = Formula("$k2*sqrt(3)"); +$cj = $a; +$bj = Formula("$k*sqrt(6)"); + +$Ax = 0; +$Ay = 0; +$Bx = sqrt(3); +$By = 1; +$Cx = $Bx; +$Cy = 0; +$Jx = $Cx + $By; +$Jy = $Cy; + +$cushion = 0.3; + +$Dx = $Ax; +$Dy = $By+2*$cushion; +$Ex = $Bx; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$Hx = $Fx+$cushion; +$Hy = $Fy; +$Gx = $Hx; +$Gy = $Hy+1; +$Ix = $Hx+1; +$Iy = $Hy; + + +$xmin = -$cushion; #The viewing window +$xmax = $Ix+3*$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Cx,$Cy); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Jx,$Jy,blue,3); + $picture[$i]->lineTo($Bx,$By,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','center','top','large')); + $picture[$i]->lb( new Label($Jx,$Jy,"D",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+$xShift/2); + $picture[$i]->lineTo($Cx-$xShift/2,$Cy+$xShift/2,blue,3); + $picture[$i]->lineTo($Cx-$xShift/2,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"30",'blue','left','bottom','large')); + $picture[$i]->lb( new Label($Jx-$xShift/2,$Jy,"45",'blue','right','bottom','large')); + + $picture[$i]->lb( new Label(($Ax+$Cx)/2,$Ay,"$b",'blue','center','top','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"60",'blue','right','top','large')); +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"45",'blue','left','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+$xShift/2); +$picture[1]->lineTo($Fx-$xShift/2,$Fy+$xShift/2,blue,3); +$picture[1]->lineTo($Fx-$xShift/2,$Fy,blue,3); + +$picture[1]->moveTo($Gx,$Gy); +$picture[1]->lineTo($Hx,$Hy,blue,3); +$picture[1]->lineTo($Ix,$Iy,blue,3); +$picture[1]->lineTo($Gx,$Gy,blue,3); + +$picture[1]->moveTo($Hx,$Hy+$xShift/2); +$picture[1]->lineTo($Hx+$xShift/2,$Hy+$xShift/2,blue,3); +$picture[1]->lineTo($Hx+$xShift/2,$Hy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"30",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift/2,"60",'blue','right','top','large')); +$picture[1]->lb( new Label($Gx,$Gy-$xShift/3*2,"45",'blue','left','top','large')); +$picture[1]->lb( new Label($Ix-$xShift/2,$Iy,"45",'blue','right','bottom','large')); + +$picture[1]->lb( new Label($Ex-$xShift/5,$Fy+($Ey-$Fy)/3,"a",'blue','right','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a sqrt(3)",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"2a",'blue','right','bottom','large')); + +$picture[1]->lb( new Label($Hx+$xShift/5,$Hy+($Gy-$Hy)/3,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Gx+$Ix)/2,($Gy+$Iy)/2,"a sqrt(2)",'blue','left','bottom','large')); +$picture[1]->lb( new Label(($Hx+$Ix)/2,$Hy,"a",'blue','center','top','large')); + +$text[0] = "Two right triangles share a side. In triangle ABC, AC is horizontal (A to the left and C to the right), BC is vertical, and AB is the hypotenuse. Angle A is 30 degrees. Angle BCA is 90 degrees. Triangle BCD is to the right of triangle ABC, sharing the side BC. Angle BCD is 90 degrees. Point D is to the right of C. Angle D is 45 degrees. Side AC is marked as $b units."; + +$text[1] = "Two right triangles share a side. In triangle ABC, AC is horizontal (A to the left and C to the right), BC is vertical, and AB is the hypotenuse. Angle A is 30 degrees. Angle BCA is 90 degrees. Triangle BCD is to the right of triangle ABC, sharing the side BC. Angle BCD is 90 degrees. Point D is to the right of C. Angle D is 45 degrees. Side AC is marked as $b units. Above those two triangles, there is a 30-60-90 right triangle, with sides marked as a, a sqrt(3) and 2a. There is a 45-45-90 right triangle, with sides marked as a, a, a sqrt(2)."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`30-60-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` BD =``] [_____________]{$bj} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Those two given triangles can be broken into a 30-60-90 right triangle and a 45-45-90 right triangle: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +In the 30-60-90 right triangle, note that + + [``\begin{aligned} + a \sqrt{3} &= [$b] \\ + a &= BC + \end{aligned}``] + +With [`a \sqrt{3} = [$b]`], we can solve for [`a`]: + + [``\begin{aligned} + a\sqrt{3} &= [$b] \\ + a &= \frac{[$b]}{\sqrt{3}} \\ + a &= \frac{[$b]\cdot \sqrt{3}}{\sqrt{3}\cdot \sqrt{3}} \\ + a &= \frac{[$b]\cdot \sqrt{3}}{3} \\ + a &= [$a] + \end{aligned}``] + +So, [`BC = a = [$a]`]. + +In the 45-45-90 right triangle, note that: + + [``\begin{aligned} + a &= BC \\ + a \sqrt{2} &= BD + \end{aligned}``] + +Since [`BC=a=[$a]`], we have: + + [``\begin{aligned} + BD &= a \sqrt{2} \\ + &= [$a] \cdot \sqrt{2} \\ + &= [$bj] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength70.pg b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength70.pg new file mode 100644 index 0000000000..7863d40918 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleLength70.pg @@ -0,0 +1,217 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$k = random(2,10,1); +$bj = 2*$k; +$a = Formula("$k*sqrt(2)"); +$b = Formula("$k*sqrt(6)"); + +$Ax = 0; +$Ay = 0; +$Bx = sqrt(3); +$By = 1; +$Cx = $Bx; +$Cy = 0; +$Jx = $Cx + $By; +$Jy = $Cy; + +$cushion = 0.3; + +$Dx = $Ax; +$Dy = $By+2*$cushion; +$Ex = $Bx; +$Ey = $Dy+1; +$Fx = $Ex; +$Fy = $Dy; + +$Hx = $Fx+$cushion; +$Hy = $Fy; +$Gx = $Hx; +$Gy = $Hy+1; +$Ix = $Hx+1; +$Iy = $Hy; + + +$xmin = -$cushion; #The viewing window +$xmax = $Ix+3*$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$xShift = $xmax/10; + +for my $i (0..1) { + $picture[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); + $picture[$i]->lb('reset'); + $picture[$i]->moveTo($Cx,$Cy); + $picture[$i]->lineTo($Ax,$Ay,blue,3); + $picture[$i]->lineTo($Bx,$By,blue,3); + $picture[$i]->lineTo($Cx,$Cy,blue,3); + $picture[$i]->lineTo($Jx,$Jy,blue,3); + $picture[$i]->lineTo($Bx,$By,blue,3); + + $picture[$i]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); + $picture[$i]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + $picture[$i]->lb( new Label($Cx,$Cy,"C",'blue','center','top','large')); + $picture[$i]->lb( new Label($Jx,$Jy,"D",'blue','left','top','large')); + + $picture[$i]->moveTo($Cx,$Cy+$xShift/2); + $picture[$i]->lineTo($Cx-$xShift/2,$Cy+$xShift/2,blue,3); + $picture[$i]->lineTo($Cx-$xShift/2,$Cy,blue,3); + + $picture[$i]->lb( new Label($Ax+$xShift,$Ay,"30",'blue','left','bottom','large')); + $picture[$i]->lb( new Label($Jx-$xShift/2,$Jy,"45",'blue','right','bottom','large')); + + $picture[$i]->lb( new Label(($Bx+$Jx)/2,($By+$Jy)/2,"$bj",'blue','left','bottom','large')); +} + +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"60",'blue','right','top','large')); +$picture[1]->lb( new Label($Bx,$By-$xShift/2,"45",'blue','left','top','large')); + +$picture[1]->moveTo($Dx,$Dy); +$picture[1]->lineTo($Ex,$Ey,blue,3); +$picture[1]->lineTo($Fx,$Fy,blue,3); +$picture[1]->lineTo($Dx,$Dy,blue,3); + +$picture[1]->moveTo($Fx,$Fy+$xShift/2); +$picture[1]->lineTo($Fx-$xShift/2,$Fy+$xShift/2,blue,3); +$picture[1]->lineTo($Fx-$xShift/2,$Fy,blue,3); + +$picture[1]->moveTo($Gx,$Gy); +$picture[1]->lineTo($Hx,$Hy,blue,3); +$picture[1]->lineTo($Ix,$Iy,blue,3); +$picture[1]->lineTo($Gx,$Gy,blue,3); + +$picture[1]->moveTo($Hx,$Hy+$xShift/2); +$picture[1]->lineTo($Hx+$xShift/2,$Hy+$xShift/2,blue,3); +$picture[1]->lineTo($Hx+$xShift/2,$Hy,blue,3); + +$picture[1]->lb( new Label($Dx+$xShift,$Dy,"30",'blue','left','bottom','large')); +$picture[1]->lb( new Label($Ex,$Ey-$xShift/2,"60",'blue','right','top','large')); +$picture[1]->lb( new Label($Gx,$Gy-$xShift/3*2,"45",'blue','left','top','large')); +$picture[1]->lb( new Label($Ix-$xShift/2,$Iy,"45",'blue','right','bottom','large')); + +$picture[1]->lb( new Label($Ex-$xShift/5,$Fy+($Ey-$Fy)/3,"a",'blue','right','middle','large')); +$picture[1]->lb( new Label(($Dx+$Fx)/2,$Dy,"a sqrt(3)",'blue','center','top','large')); +$picture[1]->lb( new Label(($Dx+$Ex)/2,($Dy+$Ey)/2,"2a",'blue','right','bottom','large')); + +$picture[1]->lb( new Label($Hx+$xShift/5,$Hy+($Gy-$Hy)/3,"a",'blue','left','middle','large')); +$picture[1]->lb( new Label(($Gx+$Ix)/2,($Gy+$Iy)/2,"a sqrt(2)",'blue','left','bottom','large')); +$picture[1]->lb( new Label(($Hx+$Ix)/2,$Hy,"a",'blue','center','top','large')); + +$text[0] = "Two right triangles share a side. In triangle ABC, AC is horizontal (A to the left and C to the right), BC is vertical, and AB is the hypotenuse. Angle A is 30 degrees. Angle BCA is 90 degrees. Triangle BCD is to the right of triangle ABC, sharing the side BC. Angle BCD is 90 degrees. Point D is to the right of C. Angle D is 45 degrees. Side BD is marked as $bj units."; + +$text[1] = "Two right triangles share a side. In triangle ABC, AC is horizontal (A to the left and C to the right), BC is vertical, and AB is the hypotenuse. Angle A is 30 degrees. Angle BCA is 90 degrees. Triangle BCD is to the right of triangle ABC, sharing the side BC. Angle BCD is 90 degrees. Point D is to the right of C. Angle D is 45 degrees. Side BD is marked as $bj units. Above those two triangles, there is a 30-60-90 right triangle, with sides marked as a, a sqrt(3) and 2a. There is a 45-45-90 right triangle, with sides marked as a, a, a sqrt(2)."; + + +########################################################## + +BEGIN_PGML + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Using your knowledge of [`30-60-90`] right triangle, find missing values. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` AC =``] [_____________]{$b} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +Those two given triangles can be broken into a 30-60-90 right triangle and a 45-45-90 right triangle: + +>>[@ image(insertGraph( $picture[1] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[1]' title = '$text[1]' ") @]*<< + +In the 45-45-90 right triangle, note that + + [``\begin{aligned} + a \sqrt{2} &= [$bj] \\ + a &= BC + \end{aligned}``] + +With [`a \sqrt{2} = [$bj]`], we can solve for [`a`]: + + [``\begin{aligned} + a\sqrt{2} &= [$bj] \\ + a &= \frac{[$bj]}{\sqrt{2}} \\ + a &= \frac{[$bj]\cdot \sqrt{2}}{\sqrt{2}\cdot \sqrt{2}} \\ + a &= \frac{[$bj]\cdot \sqrt{2}}{2} \\ + a &= [$a] + \end{aligned}``] + +So, [`BC = a = [$a]`]. + +In the 30-60-90 right triangle, note that: + + [``\begin{aligned} + a &= BC \\ + a \sqrt{3} &= AC + \end{aligned}``] + +Since [`BC=a=[$a]`], we have: + + [``\begin{aligned} + AC &= a \sqrt{3} \\ + &= [$a] \cdot \sqrt{3} \\ + &= [$b] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio10.pg b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio10.pg new file mode 100644 index 0000000000..fe9513622d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio10.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +$Ax = 0; +$Ay = 0; +$Cx = sqrt(3); +$Cy = 0; +$Bx = $Cx; +$By = 1; + +$cushion = 0.2; + +$xmin = -$cushion; #The viewing window +$xmax = $Cx+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$picture[0]->moveTo($Cx,$Cy+0.1); +$picture[0]->lineTo($Cx-0.1,$Cy+0.1,blue,3); +$picture[0]->lineTo($Cx-0.1,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); +$picture[0]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx,($By+$Cy)/2,"1",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay,"sqrt(3)",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"2",'blue','right','bottom','large')); + +$picture[0]->lb( new Label($Ax+0.2,$Ay,"30",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By-0.1,"60",'blue','right','top','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is sqrt(3). Angle C is a right angle. Side CB goes up, and the length is 1. The length of AB is 2. Angle A is 30 degrees. Angle B is 60 degrees."; + +Context("LimitedRadical"); + +@prob = ( + ["\displaystyle \sin(30^{\circ})",Formula("1/2")], + ["\displaystyle \sin(60^{\circ})",Formula("sqrt(3)/2")], + ["\displaystyle \cos(30^{\circ})",Formula("sqrt(3)/2")], + ["\displaystyle \cos(60^{\circ})",Formula("1/2")], + ["\displaystyle \tan(30^{\circ})",Formula("sqrt(3)/3")], + ["\displaystyle \tan(60^{\circ})",Formula("sqrt(3)")], +); + +@perm = NchooseK(6,4); + + +########################################################## + +BEGIN_PGML + +Using your knowledge of [`30-60-90`] and [`45-45-90`] right triangles, write each trigonometry expression's exact value. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + + [`` [$prob[$perm[2]][0]] =``] [_____________]{$prob[$perm[2]][1]} + + [`` [$prob[$perm[3]][0]] =``] [_____________]{$prob[$perm[3]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +You should memorize the following right triangle with all angle measures and all side lengths. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Now we can tell all related trigonometry values in this right triangle: + + [`` \begin{aligned} + \sin(30^{\circ}) &= \frac{1}{2} &&\cos(30^{\circ}) = \frac{\sqrt{3}}{2} &&\tan(30^{\circ}) = \frac{1}{\sqrt{3}} = \frac{\sqrt{3}}{3} \\ + \sin(60^{\circ}) &= \frac{\sqrt{3}}{2} &&\cos(60^{\circ}) = \frac{1}{2} &&\tan(60^{\circ}) = \sqrt{3} + \end{aligned} ``] +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio20.pg b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio20.pg new file mode 100644 index 0000000000..870e175c0d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio20.pg @@ -0,0 +1,148 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +$Ax = 0; +$Ay = 0; +$Cx = sqrt(3); +$Cy = 0; +$Bx = $Cx; +$By = 1; + +$cushion = 0.2; + +$xmin = -$cushion; #The viewing window +$xmax = $Cx+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$picture[0]->moveTo($Cx,$Cy+0.1); +$picture[0]->lineTo($Cx-0.1,$Cy+0.1,blue,3); +$picture[0]->lineTo($Cx-0.1,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); +$picture[0]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx,($By+$Cy)/2,"1",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay,"sqrt(3)",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"2",'blue','right','bottom','large')); + +$picture[0]->lb( new Label($Ax+0.2,$Ay,"30",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By-0.1,"60",'blue','right','top','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is sqrt(3). Angle C is a right angle. Side CB goes up, and the length is 1. The length of AB is 2. Angle A is 30 degrees. Angle B is 60 degrees."; + +Context("LimitedRadical"); + +@prob = ( + ["\displaystyle \sin\left(\frac{\pi}{6}\right)",Formula("1/2")], + ["\displaystyle \sin\left(\frac{\pi}{3}\right)",Formula("sqrt(3)/2")], + ["\displaystyle \cos\left(\frac{\pi}{6}\right)",Formula("sqrt(3)/2")], + ["\displaystyle \cos\left(\frac{\pi}{3}\right)",Formula("1/2")], + ["\displaystyle \tan\left(\frac{\pi}{6}\right)",Formula("sqrt(3)/3")], + ["\displaystyle \tan\left(\frac{\pi}{3}\right)",Formula("sqrt(3)")], +); + +@perm = NchooseK(6,4); + + +########################################################## + +BEGIN_PGML + +Using your knowledge of [`30-60-90`] and [`45-45-90`] right triangles, write each trigonometry expression's exact value. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + + [`` [$prob[$perm[2]][0]] =``] [_____________]{$prob[$perm[2]][1]} + + [`` [$prob[$perm[3]][0]] =``] [_____________]{$prob[$perm[3]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +You should memorize the following right triangle with all angle measures and all side lengths. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Also: + + [`` \begin{aligned} + \frac{\pi}{6} &= 30^{\circ}\\ + \frac{\pi}{3} &= 60^{\circ}\\ + \end{aligned} ``] + +Now we can tell all related trigonometry values in this right triangle: + + [`` \begin{aligned} + \sin\left(\frac{\pi}{6}\right) &= \frac{1}{2} &&\cos\left(\frac{\pi}{6}\right) = \frac{\sqrt{3}}{2} &&\tan\left(\frac{\pi}{6}\right) = \frac{1}{\sqrt{3}} = \frac{\sqrt{3}}{3} \\ + \sin\left(\frac{\pi}{3}\right) &= \frac{\sqrt{3}}{2} &&\cos\left(\frac{\pi}{3}\right) = \frac{1}{2} &&\tan\left(\frac{\pi}{3}\right) = \sqrt{3} + \end{aligned} ``] +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio30.pg b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio30.pg new file mode 100644 index 0000000000..3270349246 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio30.pg @@ -0,0 +1,135 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +$Ax = 0; +$Ay = 0; +$Cx = 1; +$Cy = 0; +$Bx = $Cx; +$By = 1; + +$cushion = 0.2; + +$xmin = -$cushion; #The viewing window +$xmax = $Cx+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$picture[0]->moveTo($Cx,$Cy+0.05); +$picture[0]->lineTo($Cx-0.05,$Cy+0.05,blue,3); +$picture[0]->lineTo($Cx-0.05,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); +$picture[0]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx,($By+$Cy)/2,"1",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay,"1",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"sqrt(2)",'blue','right','bottom','large')); + +$picture[0]->lb( new Label($Ax+0.1,$Ay,"45",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By-0.1,"45",'blue','right','top','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is 1. Angle C is a right angle. Side CB goes up, and the length is 1. The length of AB is sqrt(2). Both Angle A and Angle B are 45 degrees."; + +Context("LimitedRadical"); + +@prob = ( + ["\displaystyle \sin(45^{\circ})",Formula("sqrt(2)/2")], + ["\displaystyle \cos(45^{\circ})",Formula("sqrt(2)/2")], + ["\displaystyle \tan(45^{\circ})",Formula("1")], +); + +@perm = NchooseK(3,2); + + +########################################################## + +BEGIN_PGML + +Using your knowledge of [`30-60-90`] and [`45-45-90`] right triangles, write each trigonometry expression's exact value. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +You should memorize the following right triangle with all angle measures and all side lengths. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Now we can tell all related trigonometry values in this right triangle: + + [`` \begin{aligned} + \sin(45^{\circ}) &= \frac{1}{\sqrt{2}}=\frac{\sqrt{2}}{2} \\ + \cos(45^{\circ}) &= \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2} \\ + \tan(45^{\circ}) &= 1 + \end{aligned} ``] +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio40.pg b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio40.pg new file mode 100644 index 0000000000..bd8a3f696e --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/SpecialRightTriangle/SpecialRightTriangleTrigRatio40.pg @@ -0,0 +1,137 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "PGcourse.pl", +); + +###################################### + + + +TEXT(beginproblem()); + +$Ax = 0; +$Ay = 0; +$Cx = 1; +$Cy = 0; +$Bx = $Cx; +$By = 1; + +$cushion = 0.2; + +$xmin = -$cushion; #The viewing window +$xmax = $Cx+$cushion; +$ymin = -$cushion; +$ymax = $xmax; + +$picture[0] = init_graph($xmin,$ymin,$xmax,$ymax, + pixels=>[240,240]); +$picture[0]->lb('reset'); +$picture[0]->moveTo($Ax,$Ay); +$picture[0]->lineTo($Bx,$By,blue,3); +$picture[0]->lineTo($Cx,$Cy,blue,3); +$picture[0]->lineTo($Ax,$Ay,blue,3); + +$picture[0]->moveTo($Cx,$Cy+0.05); +$picture[0]->lineTo($Cx-0.05,$Cy+0.05,blue,3); +$picture[0]->lineTo($Cx-0.05,$Cy,blue,3); + +$picture[0]->lb( new Label($Ax,$Ay,"A",'blue','right','top','large')); +$picture[0]->lb( new Label($Cx,$Cy,"C",'blue','left','top','large')); +$picture[0]->lb( new Label($Bx,$By,"B",'blue','center','bottom','large')); + +$picture[0]->lb( new Label($Cx,($By+$Cy)/2,"1",'blue','left','middle','large')); +$picture[0]->lb( new Label(($Ax+$Cx)/2,$Ay,"1",'blue','center','top','large')); +$picture[0]->lb( new Label(($Ax+$Bx)/2,($Ax+$By)/2,"sqrt(2)",'blue','right','bottom','large')); + +$picture[0]->lb( new Label($Ax+0.1,$Ay,"45",'blue','left','bottom','large')); +$picture[0]->lb( new Label($Bx,$By-0.1,"45",'blue','right','top','large')); + +$text[0] = "This is a right triangle. The bottom side is parallel to the horizontal direction. Its leftend is A, rightend is C. The length of this side is 1. Angle C is a right angle. Side CB goes up, and the length is 1. The length of AB is sqrt(2). Both Angle A and Angle B are 45 degrees."; + +Context("LimitedRadical"); + +@prob = ( + ["\displaystyle \sin\left(\frac{\pi}{4}\right)",Formula("sqrt(2)/2")], + ["\displaystyle \cos\left(\frac{\pi}{4}\right)",Formula("sqrt(2)/2")], + ["\displaystyle \tan\left(\frac{\pi}{4}\right)",Formula("1")], +); + +@perm = NchooseK(3,2); + + +########################################################## + +BEGIN_PGML + +Using your knowledge of [`30-60-90`] and [`45-45-90`] right triangles, write each trigonometry expression's exact value. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Use [|sqrt()|]* to represent square root. For example, [|sqrt(2)|]* represents [`\sqrt{2}`].' +."\n" +."* Rationalize denominator if needed." +)@]** + + [`` [$prob[$perm[0]][0]] =``] [_____________]{$prob[$perm[0]][1]} + + [`` [$prob[$perm[1]][0]] =``] [_____________]{$prob[$perm[1]][1]} + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +You should memorize the following right triangle with all angle measures and all side lengths. + +>>[@ image(insertGraph( $picture[0] ), 'width'=>300,'height'=>300,'tex_size'=>300, extra_html_tags => "alt = '$text[0]' title = '$text[0]' ") @]*<< + +Also, [`\frac{\pi}{4} = 45^{\circ}`]. + +Now we can tell all related trigonometry values in this right triangle: + + [`` \begin{aligned} + \sin\left(\frac{\pi}{4}\right) &= \frac{1}{\sqrt{2}}=\frac{\sqrt{2}}{2} \\ + \cos\left(\frac{\pi}{4}\right) &= \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2} \\ + \tan\left(\frac{\pi}{4}\right) &= 1 + \end{aligned} ``] +END_PGML_SOLUTION + +###################################### + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication10.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication10.pg new file mode 100644 index 0000000000..fde23626d1 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication10.pg @@ -0,0 +1,290 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +sub addPIFraction { + my ($n,$d) = @_; + ($n,$d) = Fraction($n,$d)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return Formula("pi");} + elsif ($n==-1) {return Formula("-pi");} + else {return Formula("$n*pi");} + } else { + if ($n==1) {return Formula("pi/$d");} + elsif ($n==-1) {return -Formula("pi/$d");} + elsif ($n>0) {return Formula("($n*pi)/$d");} + else { + $Nn = -$n; + return -Formula("($Nn*pi)/$d"); + } + } +} + +@t = (); @h = (); @tShow = (); + +do { + do { + $a = random(15,35,1); + $p = random(5,15,1); + $b = addPIFraction(2,$p); + $base = random(5,15,1); + $d = $base+$a; + + $func = Formula("-$a*cos($b*t)+$d"); + + do { + $t[0] = random(2,$p,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h[1] = random($base+5,$base+2*$a-5,1); + } until abs($h[0]-$h[1])>10 && $t[0]!=$p && $t[0]!=$p/2; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad = arccos(($d-$h[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b); +$t[2] = $p-$t[1]; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],2); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p/2,1.5*$p); +($ymin, $ymax) = (-$a/2,3*$a); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-5; $i<$xmax; $i=$i+5) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"height (m)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[0],$h[0],red)); +$graph[0]->lb(new Label($t[0],$h[0],"($tShow[0],$h[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red','left','bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func]. Points ($tShow[0],$h[0]), ($tShow[1],$h[1]) and ($tShow[2],$h[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad); +$Py[0] = $r*sin($rad); +$Px[1] = $r*cos(-$rad); +$Py[1] = $r*sin(-$rad); + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"-$radShow radians",'red','center',$TOBHyp,large)); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$alt[1] = "This is the graph of a circle with points marked as $radShow radians and -$radShow radians on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +BEGIN_PGML + +A Ferris wheel is [`[$a]`] meters in radius and boarded from a platform that is [`[$base]`] meter above the ground. The six o’clock position on the Ferris wheel is level with the loading platform. The wheel completes 1 full revolution in [`[$p]`] minutes. The function [`h(t)`] gives a person’s height in meters above the ground [`t`] minutes after the wheel begins to turn. + +Answer the following questions about the function [`h(t)`]. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`h(t)=`][________________________]{$func}. + +Part b: Assume a person entered a cabin on the Ferris wheel at [`t=0`]. After [`[$t[0]]`] minutes, the person was [_______________]{$h[0]} meters high in the air. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [________________]{$ans} minutes. + +END_PGML + +############################################################## + +$maxHeight = $base+2*$a; +$s1 = Fraction($h[1]-$d,-$a)->reduce; +$p2 = $p/2; +$bR = ($p%2==0) ? "\frac{$p2}{\pi}" : "\frac{$p}{2\pi}"; +$s2 = arccos(($d-$h[1])/$a); +$radShow = Round($rad,4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the person's height, [`(0,[$base])`] is at the minimum of the function. This matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], so we should choose to use the following function to model the person's height: + + [``h(t)=-a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its minimum value when [`t=0`], just like [`y=-\cos(x)`]. + +The person's minimum height is simply the height of the platform, [`[$base]`] meters. The person's maximum height is the height of the platform plus twice the wheel's radius: [`[$base]+2([$a])=[$maxHeight]`] meters. The function's midline is the average values of the person's maximum and minimum height: + + [``d=\frac{[$base]+[$maxHeight]}{2}=[$d]``] + +Next, the function's amplitude is simply the Ferris Wheel's radius: [`a=[$a]`]. + +For the function [`h(t)=-a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} = [$b]``] + +The function's formula is + + [``h(t) = [$func] ``] + +###Part b + +To find the person's height after [`[$t[0]]`] minutes, substitute [`t=[$t[0]]`] into [`h(t)`], we have: + + [``\begin{aligned} + h(t) &= [$func] \\ + &= -[$a]\cos\left([$b]([$t[0]])\right)+[$d] \\ + &= [$h[0]] + \end{aligned}``] + +After [`[$t[0]]`] minutes, the person was [`[$h[0]]`] meters high in the air. + +###Part c + +To find when the person's height was [`[$h[1]]`] meters, substitute [`h(t)=[$h[1]]`] into the function, and solve for [`t`]. We have: + + [``\begin{aligned} + h(t) &= [$func] \\ + [$h[1]] &= [$func] \\ + [$h[1]]-[$d] &= -[$a]\cos\left([$b]t\right) \\ + -\frac{[$h[1]-$d]}{[$a]} &= \cos\left([$b]t\right) \\ + [$s1] &= \cos\left([$b]t\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b]t \\ + [$radShow] &= [$b]t + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$s1] = \cos\left([$b]t\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + [$s1] &= \cos\left([$b]t\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b]t \\ + [$b]t &= [$radShow] +2k\pi \text{ or } -[$radShow] +2k\pi \\ + t &= [$bR] \left( [$radShow]+2k\pi \right) \text{ or } [$bR] \left( -[$radShow] +2k\pi \right) \\ + t &= [$t[1]] + [$p]k \text{ or } -[$t[1]] + [$p]k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in one period: [`[0,[$p]]`]: + + [``\begin{aligned} + t &= [$t[1]] + [$p](0) = [$t[1]] \\ + t &= -[$t[1]] + [$p](1) = [$t[2]] + \end{aligned}``] + +The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [`[$ans]`] minutes. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication20.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication20.pg new file mode 100644 index 0000000000..b101bfa894 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication20.pg @@ -0,0 +1,311 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +sub addPIFraction { + my ($n,$d) = @_; + ($n,$d) = Fraction($n,$d)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return Formula("pi");} + elsif ($n==-1) {return Formula("-pi");} + else {return Formula("$n*pi");} + } else { + if ($n==1) {return Formula("pi/$d");} + elsif ($n==-1) {return -Formula("pi/$d");} + elsif ($n>0) {return Formula("($n*pi)/$d");} + else { + $Nn = -$n; + return -Formula("($Nn*pi)/$d"); + } + } +} + +@t = (); @h = (); @tShow = (); + +do { + do { + $a = random(15,35,1); + $p = random(6,16,2); + $pH = $p/2; + $b = addPIFraction(2,$p); + $base = random(5,15,1); + $d = $base+$a; + $top = $base+2*$a; + + $func = Formula("-$a*cos($b*t)+$d"); + + do { + $t[0] = random(2,$p,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h[1] = random($base+5,$base+2*$a-5,1); + } until abs($h[0]-$h[1])>10 && $t[0]!=$p && $t[0]!=$p/2; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad = arccos(($d-$h[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b); +$t[2] = $p-$t[1]; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],2); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p/2,1.5*$p); +($ymin, $ymax) = (-$a/2,3*$a); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-5; $i<$xmax; $i=$i+5) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"height (m)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($pH,$top,red)); +$graph[0]->lb(new Label($pH,$top,"($pH,$top)",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($p,$base,red)); +$graph[0]->lb(new Label($p,$base,"($p,$base)",'red','center','top',large)); +$graph[0]->stamps(closed_circle($t[0],$h[0],red)); +$graph[0]->lb(new Label($t[0],$h[0],"($tShow[0],$h[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red','left','bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func]. Points ($tShow[0],$h[0]), ($tShow[1],$h[1]) and ($tShow[2],$h[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad); +$Py[0] = $r*sin($rad); +$Px[1] = $r*cos(-$rad); +$Py[1] = $r*sin(-$rad); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"-$radShow radians",'red','center',$TOBHyp,large)); + +$alt[1] = "This is the graph of a unit circle with points marked as $radShow radians and -$radShow radians on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +BEGIN_PGML + +A person got into a cabin on a Ferris wheel for a ride. [`[$pH]`] minutes into the ride, she was on top of the wheel at the height of [`[$top]`] meters; [`[$p]`] minutes into the ride, she was back to the base at the height of [`[$base]`] meters. A function [`h(t)`] models the person's height during this ride. + +Answer the following questions about the function [`h(t)`]. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`h(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] minutes (since the person entered the cabin), the person was [_______________]{$h[0]} meters high in the air. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [________________]{$ans} minutes. + +END_PGML + +############################################################## + +$maxHeight = $base+2*$a; +$s1 = Fraction($h[1]-$d,-$a)->reduce; +$p2 = $p/2; +$bR = ($p%2==0) ? "\frac{$p2}{\pi}" : "\frac{$p}{2\pi}"; +$radShow = Round($rad,4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the person's height, [`(0,[$base])`] is at the minimum of the function. This matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], so we should choose to use the following function to model the person's height: + + [``h(t)=-a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its minimum value when [`t=0`], just like [`y=-\cos(x)`]. + +By given conditions, [`([$pH],[$top])`] represents the function's maximum value, and [`([$p],[$base])`] represents the function's minimum value. + +The function's [`d`] value (midline) is: + + [``\begin{aligned} + d &= \frac{\text{maximum height}+\text{minimum height}}{2} \\ + &= \frac{[$top]+[$base]}{2} \\ + &= [$d]\text{ meters} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum height}-\text{minimum height}}{2} \\ + &= \frac{[$top]-[$base]}{2} \\ + &= [$a]\text{ meters} + \end{aligned}``] + +To travel from the top point to the bottom point, it takes half a period, so the height's period is: + + [`` 2([$p]-[$pH]) = [$p]\text{ minutes}``] + +For the function [`h(t)=-a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} = [$b]``] + +The function's formula is + + [``h(t) = [$func] ``] + +###Part b + +To find the person's height after [`[$t[0]]`] minutes, substitute [`t=[$t[0]]`] into [`h(t)`], we have: + + [``\begin{aligned} + h(t) &= [$func] \\ + &= -[$a]\cos\left([$b]([$t[0]])\right)+[$d] \\ + &= [$h[0]] + \end{aligned}``] + +After [`[$t[0]]`] minutes, the person was [`[$h[0]]`] meters high in the air. + +###Part c + +To find when the person's height was [`[$h[1]]`] meters, substitute [`h(t)=[$h[1]]`] into the function, and solve for [`t`]. We have: + + [``\begin{aligned} + h(t) &= [$func] \\ + [$h[1]] &= [$func] \\ + [$h[1]]-[$d] &= -[$a]\cos\left([$b]t\right) \\ + -\frac{[$h[1]-$d]}{[$a]} &= \cos\left([$b]t\right) \\ + [$s1] &= \cos\left([$b]t\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b]t \\ + [$radShow] &= [$b]t + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$s1] = \cos\left([$b]t\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + [$s1] &= \cos\left([$b]t\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b]t \\ + [$b]t &= [$radShow] +2k\pi \text{ or } -[$radShow] +2k\pi \\ + t &= [$bR] \left( [$radShow] +2k\pi \right) \text{ or } [$bR] \left( -[$radShow] +2k\pi \right) \\ + t &= [$t[1]] + [$p]k \text{ or } -[$t[1]] + [$p]k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in one period: [`[0,[$p]]`]: + + [``\begin{aligned} + t &= [$t[1]] + [$p](0) = [$t[1]] \\ + t &= -[$t[1]] + [$p](1) = [$t[2]] + \end{aligned}``] + +The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [`[$ans]`] minutes. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication30.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication30.pg new file mode 100644 index 0000000000..564a83e6cf --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication30.pg @@ -0,0 +1,294 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(d => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@t = (); @h = (); @tShow = (); +do { + do { + $high = random(30,40,1); + $low = random(-10,-5,1); + $a = ($high-$low)/2; + $b = Formula("(2*pi)/365"); + $c = random(5,30,1); + $e = ($high+$low)/2; + $func = Formula("-$a*cos($b*(d-$c))+$e"); + $p = 365; + $xHigh = $c+365/2; + + do { + $t[0] = random($c+5,300,1); + $T[0] = $func->eval(d=>$t[0]); + $T[1] = random($low+5,$high-5,1); + } until abs($T[0]-$T[1])>10; + $T[2] = $T[1]; + } until abs(($e-$T[1])/$a)<1; + $rad = arccos(($e-$T[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b)+$c; +$t[2] = -$rad/Compute($b)+$p+$c; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],2); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-10,400); +($ymin, $ymax) = ($low-10,$high+10); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-50; $i<$xmax; $i=$i+50) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"Celcius Degrees",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"days",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for d in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($xHigh,$high,red)); +$graph[0]->lb(new Label($xHigh,$high,"($xHigh,$high)",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($c,$low,red)); +$graph[0]->lb(new Label($c,$low,"($c,$low)",'red','left','top',large)); +$graph[0]->stamps(closed_circle($t[0],$T[0],red)); +$graph[0]->lb(new Label($t[0],$T[0],"($tShow[0],$T[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$T[1],red)); +$graph[0]->lb(new Label($t[1],$T[1],"($tShow[1],$T[1])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$T[2],red)); +$graph[0]->lb(new Label($t[2],$T[2],"($tShow[2],$T[2])",'red','center','bottom',large)); + +$alt[0] = "This is the graph of T(d)=[$func]. Points ($xHigh,$high), ($c,$low), ($tShow[0],$T[0]), ($tShow[1],$T[1]) and ($tShow[2],$T[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad); +$Py[0] = $r*sin($rad); +$Px[1] = $r*cos(-$rad); +$Py[1] = $r*sin(-$rad); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"-$radShow radians",'red','center',$TOBHyp,large)); + +$alt[1] = "This is the graph of a circle with points marked as $radShow radians at ($Px[0],$Py[0]) and -$radShow radians at ($Px[1],$Py[1]) on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +$ld = $t[0]-int($t[0]/10)*10; +if ($ld==1) {$th = "st";} + elsif ($ld==2) {$th = "nd";} + else {$th = "th";} + +BEGIN_PGML + +Assume a year has 365 days, and [`d=1`] represents Jan. 1. A city's daily maximum temperature over the year, [`T(d)`], follows the pattern of a periodic function. The city's lowest daily maximum temperature, [`[$low]^{\circ} C`], happens on Jan. [`[$c]`]; its highest daily maximum temperature, [`[$high]^\circ C`], happens in July. + +Answer the following questions. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`T(d)=`][________________________]{$func}. + +Part b: On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [_______________]{$T[0]} [`^{\circ} C`]. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [________________]{$ans}. + +END_PGML + +############################################################## + +$a1 = $e-$T[1]; +$s1 = "\frac{$a1}{$a}"; +$bR = "\frac{365}{2\pi}"; +$s2 = $rad*365/(2*pi); +$s3 = -$s2+$c; +$radShow = Round($rad,4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`d=[$c]`], the function has it's minimum value at [`([$c],[$low])`]. Then the function increases. This change matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], and then increases. So we should choose to use the following function to model the daily maximum temperature: + + [``T(d)=-a\cos\left(b(d-c)\right)+e``] + +By given conditions, the function's maximum value is [`[$high]`], and its minimum value is [`[$low]`]. + +The function's [`e`] value (midline) is: + + [``\begin{aligned} + e &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+([$low])}{2} \\ + &= [$e]^{\circ} C + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-([$low])}{2} \\ + &= [$a]^{\circ} C + \end{aligned}``] + +The function's period is [`365`] days. By the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +Finally, the function's minimum value is at [`([$c],[$low])`], which matches [`(0,-1)`] on [`y=-\cos(x)`]. The graph of [`y=-\cos(x)`] needs to shift to the right by [`[$c]`] units to match the graph of [`T(d)`], implying [`c=[$c]`] in [`T(d)=-a\cos\left(b(d-c)\right)+e`]. + +The function's formula is + + [``T(d) = [$func] ``] + +###Part b + +To find the daily maximum temperature on the [`[$t[0]]`][$th] day, substitute [`d=[$t[0]]`] into [`T(d)`], we have: + + [``\begin{aligned} + T(d) &= [$func] \\ + &= -[$a]\cos\left([$b]([$t[0]]-[$c])\right)+[$e] \\ + &= [$T[0]]^{\circ} C + \end{aligned}``] + +On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [`[$T[0]] ^{\circ} C`]. + +###Part c + +To find when the daily maximum temperature was [`[$T[1]]^{\circ} C`], substitute [`T(d)=[$T[1]]`] into the function, and solve for [`d`]. We have: + + [``\begin{aligned} + T(d) &= [$func] \\ + [$T[1]] &= [$func] \\ + [$T[1]]-[$e] &= -[$a]\cos\left([$b](t-[$c])\right) \\ + -\frac{[$T[1]-$e]}{[$a]} &= \cos\left([$b](t-[$c])\right) \\ + [$s1] &= \cos\left([$b](t-[$c])\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b](t-[$c]) \\ + [$radShow] &= [$b](t-[$c]) + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$s1] = \cos\left([$b](t-[$c])\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + [$s1] &= \cos\left([$b](d-[$c])\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b](d-[$c]) \\ + [$b](d-[$c]) &= [$radShow] +2k\pi \text{ or } -[$radShow] +2k\pi \\ + d-[$c] &= [$bR] \left( [$radShow] +2k\pi \right) \text{ or } [$bR] \left( -[$radShow] +2k\pi \right) \\ + d-[$c] &= [$s2] + 365k \text{ or } -[$s2] + 365k \\ + d &= [$t[1]] + 365k \text{ or } [$s3] + 365k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in one period: [`[0,[$p]]`]: + + [``\begin{aligned} + d &= [$t[1]] + 365(0) = [$t[1]] \\ + d &= [$s3] + 365(1) = [$t[2]] + \end{aligned}``] + +During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [`[$ans]`]. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication40.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication40.pg new file mode 100644 index 0000000000..ec282b1823 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication40.pg @@ -0,0 +1,294 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(d => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@t = (); @h = (); @tShow = (); +do { + do { + $high = random(30,40,1); + $low = random(-10,-5,1); + $a = ($high-$low)/2; + $b = Formula("(2*pi)/365"); + $c = random(5,30,1); + $e = ($high+$low)/2; + $func = Formula("$a*cos($b*(d-$c))+$e"); + $p = 365; + $xLow = $c+365/2; + + do { + $t[0] = random($c+5,300,1); + $T[0] = $func->eval(d=>$t[0]); + $T[1] = random($low+5,$high-5,1); + } until abs($T[0]-$T[1])>10; + $T[2] = $T[1]; + } until abs(($T[1]-$e)/$a)<1; + $rad = arccos(($T[1]-$e)/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b)+$c; +$t[2] = -$rad/Compute($b)+$p+$c; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],2); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-10,400); +($ymin, $ymax) = ($low-10,$high+10); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-50; $i<$xmax; $i=$i+50) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"Celcius Degrees",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"days",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for d in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($xLow,$low,red)); +$graph[0]->lb(new Label($xLow,$low,"($xLow,$low)",'red','center','top',large)); +$graph[0]->stamps(closed_circle($c,$high,red)); +$graph[0]->lb(new Label($c,$high,"($c,$high)",'red','left','bottom',large)); +$graph[0]->stamps(closed_circle($t[0],$T[0],red)); +$graph[0]->lb(new Label($t[0],$T[0],"($tShow[0],$T[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$T[1],red)); +$graph[0]->lb(new Label($t[1],$T[1],"($tShow[1],$T[1])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$T[2],red)); +$graph[0]->lb(new Label($t[2],$T[2],"($tShow[2],$T[2])",'red','center','bottom',large)); + +$alt[0] = "This is the graph of T(d)=[$func]. Points ($xHigh,$high), ($c,$low), ($tShow[0],$T[0]), ($tShow[1],$T[1]) and ($tShow[2],$T[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad); +$Py[0] = $r*sin($rad); +$Px[1] = $r*cos(-$rad); +$Py[1] = $r*sin(-$rad); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"-$radShow radians",'red','center',$TOBHyp,large)); + +$alt[1] = "This is the graph of a circle with points marked as $radShow radians and -$radShow radians on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +$ld = $t[0]-int($t[0]/10)*10; +if ($ld==1) {$th = "st";} + elsif ($ld==2) {$th = "nd";} + else {$th = "th";} + +BEGIN_PGML + +Assume a year has 365 days, and [`d=1`] represents Jan. 1. A city's daily maximum temperature over the year, [`T(d)`], follows the pattern of a periodic function. The city's highest daily maximum temperature, [`[$high]^{\circ} C`], happens on Jan. [`[$c]`]; its lowest daily maximum temperature, [`[$low]^\circ C`], happens in July. + +Answer the following questions. + +Part a: The function, as a transformation of [`y=\cos(x)`], is [`T(d)=`][________________________]{$func}. + +Part b: On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [_______________]{$T[0]} [`^{\circ} C`]. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [________________]{$ans}. + +END_PGML + +############################################################## + +$a1 = $T[1]-$e; +$s1 = "\frac{$a1}{$a}"; +$bR = "\frac{365}{2\pi}"; +$s2 = $rad*365/(2*pi); +$s3 = -$s2+$c; +$radShow = Round($rad,4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`d=[$c]`], the function has it's maximum value at [`([$c],[$high])`]. Then the function decreases. This change matches the graph of [`y=\cos(x)`], which is at its maximum value when [`x=0`], and then decreases. So we should choose to use the following function to model the daily maximum temperature: + + [``T(d)=a\cos\left(b(d-c)\right)+e``] + +By given conditions, the function's maximum value is [`[$high]`], and its minimum value is [`[$low]`]. + +The function's [`e`] value (midline) is: + + [``\begin{aligned} + e &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+([$low])}{2} \\ + &= [$e]^{\circ} C + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-([$low])}{2} \\ + &= [$a]^{\circ} C + \end{aligned}``] + +The function's period is [`365`] days. By the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +Finally, the function's minimum value is at [`([$c],[$high])`], which matches [`(0,1)`] on [`y=\cos(x)`]. The graph of [`y=-cos(x)`] needs to shift to the right by [`[$c]`] units to match the graph of [`T(d)`], implying [`c=[$c]`] in [`T(d)=a\cos\left(b(d-c)\right)+e`]. + +The function's formula is + + [``T(d) = [$func] ``] + +###Part b + +To find the daily maximum temperature on the [`[$t[0]]`][$th] day, substitute [`d=[$t[0]]`] into [`T(d)`], we have: + + [``\begin{aligned} + T(d) &= [$func] \\ + &= [$a]\cos\left([$b]([$t[0]]-[$c])\right)+[$e] \\ + &= [$T[0]]^{\circ} C + \end{aligned}``] + +On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [`[$T[0]] ^{\circ} C`]. + +###Part c + +To find when the daily maximum temperature was [`[$T[1]]^{\circ} C`], substitute [`T(d)=[$T[1]]`] into the function, and solve for [`d`]. We have: + + [``\begin{aligned} + T(d) &= [$func] \\ + [$T[1]] &= [$func] \\ + [$T[1]]-[$e] &= [$a]\cos\left([$b](t-[$c])\right) \\ + \frac{[$a1]}{[$a]} &= \cos\left([$b](t-[$c])\right) \\ + [$s1] &= \cos\left([$b](t-[$c])\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b](t-[$c]) \\ + [$radShow] &= [$b](t-[$c]) + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$s1] = \cos\left([$b](t-[$c])\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + [$s1] &= \cos\left([$b](d-[$c])\right) \\ + \cos^{-1}\left([$s1]\right) &= [$b](d-[$c]) \\ + [$b](d-[$c]) &= [$radShow] +2k\pi \text{ or } -[$radShow] +2k\pi \\ + d-[$c] &= [$bR] \left( [$radShow] +2k\pi \right) \text{ or } [$bR] \left( -[$radShow] +2k\pi \right) \\ + d-[$c] &= [$s2] + 365k \text{ or } -[$s2] + 365k \\ + d &= [$t[1]] + 365k \text{ or } [$s3] + 365k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in one period: [`[0,[$p]]`]: + + [``\begin{aligned} + d &= [$t[1]] + 365(0) = [$t[1]] \\ + d &= [$s3] + 365(1) = [$t[2]] + \end{aligned}``] + +During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [`[$ans]`]. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication50.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication50.pg new file mode 100644 index 0000000000..8e08729566 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication50.pg @@ -0,0 +1,297 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@rad = (); +@t = (); @h = (); @tShow = (); +do { + do { + $a = random(10,30,0.1); + $p = random(1,5,0.1); + $b = 2*pi/$p; + $bTex = "\frac{2\pi}{$p}"; + $d = random($a+10,$a+20,0.1); + $func = Formula("$a*sin(((2*pi)/$p)*t)+$d"); + $high = $d+$a; + $low = $d-$a; + do { + $t[0] = random(1,3*$p-1,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h0Show = Round($h[0],3); + $h[1] = random($d-$a+1,$d+$a-1,0.1); + } until abs($h[0]-$h[1])>10; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad[1] = arcsin(($h[1]-$d)/$a); + $rad[2] = ($rad[1]>0) ? pi-$rad[1] : -pi-$rad[1]; +} until (abs($rad[1]*180/pi)>20) && (abs($rad[1]*180/pi)<75) && ($t[0]/($p/2) != int($t[0]/($p/2)) ); + +$p2 = $p/2; +$p4 = $p/4; +$p34 = $p*3/4; + +$k = random(2,3,1); +$t[1] = $rad[1]/Compute($b)+$k*$p; +$t[2] = $rad[2]/Compute($b)+$k*$p; +$iL = $k*$p; +$iR = ($k+1)*$p; +if ( ($iL > $t[1]) || ($iL > $t[2]) ) { + $iL = ($k-1)*$p; + $iR = $k*$p; +} + +@radShow = ();@tShow = (); +$rad[0] = 0; +for my $i (0..2) { + $radShow[$i] = Round($rad[$i],3); + $tShow[$i] = Round($t[$i],3); +} + +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p,($k+2)*$p); +($ymin, $ymax) = (-5,$high+5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-2; $i<$xmax; $i=$i+2) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"distance (cm)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[0],$h[0],red)); +$graph[0]->lb(new Label($t[0],$h[0],"($tShow[0],$h[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$lr = ($t[1]<$t[2]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red',$lr,'bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$lr = ($t[2]<$t[1]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red',$lr,'bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func]. Points ($tShow[0],$h[0]), ($tShow[1],$h[1]) and ($tShow[2],$h[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad[1]); +$Py[0] = $r*sin($rad[1]); +$Px[1] = $r*cos($rad[2]); +$Py[1] = $r*sin($rad[2]); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow[1] radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"$radShow[2] radians",'red','center',$TOBHyp,large)); + +$alt[1] = "This is the graph of a unit circle with points marked as $radShow[1] radians and $radShow[2] radians on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +BEGIN_PGML + +A piston moves forward and backward when it runs. At the beginning [`(t=0)`], the piston was at its nutural position, [`[$d]`] inches from its base. The piston moved away from its base. [`[$p4]`] seconds since [`t=0`], the piston was at its farthest distance from its base, [`[$high]`] cm. Then, the piston moved back toward its base. [`[$p34]`] seconds since [`t=0`], the piston was at its closest distance from its base, [`[$low]`] cm. Then, it switched direction and moved toward its nutural position again. + +The function [`p(t)`] models the piston's distance from its base since it started to move at [`t=0`]. Answer the following questions. + +Part a: The function, as a transformation of [`y=\sin(x)`], is [`p(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] seconds, the piston was [_______________]{$h[0]} cm away from its base. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [______________________]{$ans} seconds. + +END_PGML + +############################################################## + +$s1 = Real($h[1]-$d); +$bR = "\frac{$p}{2\pi}"; +$s2 = $rad[1]/Compute($b); +$s3 = $rad[2]/Compute($b); +$radShow[1] = Round($rad[1],4); +$radShow[2] = Round($rad[2],4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the piston is at its neutral position, or the middle of maximum and minimum values. This matches the graph of [`y=\sin(x)`], which is in the middle of maximum and minimum values when [`x=0`], so we should choose to use the following function to model the piston's position: + + [``p(t)=a\sin\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is in the middle of its maximum and minimum values when [`t=0`], just like [`y=\sin(x)`]. + +The function's midline is the average values of the function's maximum and minimum values: + + [``\begin{aligned} + d &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+[$low]}{2} \\ + &= [$d]\text{ cm} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-[$low]}{2} \\ + &= [$a]\text{ cm} + \end{aligned}``] + +The piston was at its maximum value at [`([$p4],[$high])`], and at its minimum value at [`([$p34],[$low])`]. The time in between is half of the period, so: + + [``\text{period}=2([$p34]-[$p4])=[$p]``] + +For the function [`p(t)=a\sin\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +The function's formula is + + [``p(t) = [$func] ``] + +###Part b + +To find the piston's position after [`[$t[0]]`] seconds, substitute [`t=[$t[0]]`] into [`p(t)`], we have: + + [``\begin{aligned} + p(t) &= [$func] \\ + &= [$a]\sin\left([$bTex]([$t[0]])\right)+[$d] \\ + &= [$h[0]]\text{ cm} + \end{aligned}``] + +After [`[$t[0]]`] seconds, the piston was [`[$h[0]]`] cm away from the base. + +###Part c + +To find when the piston was [`[$h[1]]`] cm away from its base, substitute [`p(t)=[$h[1]]`] into the function, and solve for [`t`]. We have: + + [``\begin{aligned} + p(t) &= [$func] \\ + [$h[1]] &= [$func] \\ + [$h[1]]-[$d] &= [$a]\sin\left([$bTex]t\right) \\ + \frac{[$s1]}{[$a]} &= \sin\left([$bTex]t\right) \\ + \sin^{-1}\left(\frac{[$s1]}{[$a]}\right) &= [$bTex]t \\ + [$radShow[1]] &= [$bTex]t + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. On the Unit Circle, we have to check whether another angle also makes [`\frac{[$s1]}{[$a]} = \sin\left([$bTex]t\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + \frac{[$s1]}{[$a]} &= \sin\left([$bTex]t\right) \\ + \sin^{-1}\left(\frac{[$s1]}{[$a]}\right) &= [$bTex]t \\ + [$bTex]t &= [$radShow[1]] +2k\pi \text{ or } [$radShow[2]] +2k\pi \\ + t &= [$bR] \left( [$radShow[1]] +2k\pi \right) \text{ or } [$bR] \left( [$radShow[2]] +2k\pi \right) \\ + t &= [$s2] + [$p]k \text{ or } [$s3] + [$p]k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in [`t\in([$iL],[$iR])`]: + + [``\begin{aligned} + t &= [$s2] + [$p]([$k]) = [$t[1]] \\ + t &= [$s3] + [$p]([$k]) = [$t[2]] + \end{aligned}``] + +During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [`[$ans]`] seconds. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication60.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication60.pg new file mode 100644 index 0000000000..0a3b5bc9ae --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplication60.pg @@ -0,0 +1,294 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@rad = (); +@t = (); @h = (); @tShow = (); +do { + do { + $a = random(10,30,0.1); + $p = random(1,5,0.1); + $b = 2*pi/$p; + $bTex = "\frac{2\pi}{$p}"; + $d = random($a+10,$a+20,0.1); + $func = Formula("$a*cos(((2*pi)/$p)*t)+$d"); + $high = $d+$a; + $low = $d-$a; + do { + $t[0] = random(1,3*$p-1,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h[1] = random($d-$a+1,$d+$a-1,0.1); + } until abs($h[0]-$h[1])>10; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad[1] = arccos(($h[1]-$d)/$a); + $rad[2] = -$rad[1]; +} until (abs($rad[1]*180/pi)>20) && (abs($rad[1]*180/pi)<75); + +$p2 = $p/2; + +$k = random(2,3,1); +$t[1] = $rad[1]/Compute($b)+$k*$p; +$t[2] = $rad[2]/Compute($b)+$k*$p; +$iL = $k*$p+$p2; +$iR = ($k+1)*$p+$p2; +if ( ($iL > $t[1]) || ($iL > $t[2]) ) { + $iL = ($k-1)*$p+$p2; + $iR = $k*$p+$p2; +} + +@radShow = ();@tShow = (); +$rad[0] = 0; +for my $i (0..2) { + $radShow[$i] = Round($rad[$i],2); + $tShow[$i] = Round($t[$i],2); +} + +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p,($k+2)*$p); +($ymin, $ymax) = (-5,$high+5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-2; $i<$xmax; $i=$i+2) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"distance (cm)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[0],$h[0],red)); +$graph[0]->lb(new Label($t[0],$h[0],"($tShow[0],$h[0])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$lr = ($t[1]<$t[2]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red',$lr,'bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$lr = ($t[2]<$t[1]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red',$lr,'bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func]. Points ($tShow[0],$h[0]), ($tShow[1],$h[1]) and ($tShow[2],$h[2]) on the function are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +$r = 5; + +$graph[1] = init_graph(-8,-8,8,8,'axes'=>[0,0]); +$graph[1]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[1] ); +$fnAlpha->domain(0,2*pi); + +@Px = (); +@Py = (); +$Px[0] = $r*cos($rad[1]); +$Py[0] = $r*sin($rad[1]); +$Px[1] = $r*cos($rad[2]); +$Py[1] = $r*sin($rad[2]); + +for my $i (0..1) { + $graph[1]->moveTo(0,0); + $graph[1]->lineTo($Px[$i], $Py[$i], red, 2); + $graph[1]->lineTo($Px[$i], 0, red, 2); + $graph[1]->lineTo(0, 0, red, 2); + + $xShift = ($Px[$i]>0) ? -0.4 : 0.4; + $yShift = ($Py[$i]>0) ? 0.4 : -0.4; + $graph[1]->moveTo($Px[$i], $yShift); + $graph[1]->lineTo($Px[$i]+$xShift, $yShift, red, 2); + $graph[1]->lineTo($Px[$i]+$xShift, 0, red, 2); +} + +$graph[1]->stamps(closed_circle($Px[0],$Py[0],red)); +$TOBHyp = ($Py[0]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[0],$Py[0],"$radShow[1] radians",'red','center',$TOBHyp,large)); + +$graph[1]->stamps(closed_circle($Px[1],$Py[1],red)); +$TOBHyp = ($Py[1]>0) ? "bottom" : "top"; +$graph[1]->lb(new Label($Px[1],$Py[1],"$radShow[2] radians",'red','center',$TOBHyp,large)); + +$alt[1] = "This is the graph of a unit circle with points marked as $radShow[1] radians and $radShow[2] radians on the circle."; + +$fig1 = image(insertGraph($graph[1]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[1]' title = '$alt[1]' "); + +############################################################## + +BEGIN_PGML + +A piston moves forward and backward when it runs. At the beginning [`(t=0)`], the piston was at its farthest distance from its base, [`[$high]`] cm. Then, the piston moved back toward its base. [`[$p2]`] seconds later, the piston was at its closest distance from its base, [`[$low]`] cm. Then, it switched direction and moved away from its base. + +The function [`p(t)`] models the piston's distance from its base since it started to move at [`t=0`]. Answer the following questions. + +Part a: The function, as a transformation of [`y=\cos(x)`], is [`p(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] seconds, the piston was [_______________]{$h[0]} cm away from its base. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [______________________]{$ans} seconds. + +END_PGML + +############################################################## + +$s1 = Real($h[1]-$d); +$bR = "\frac{$p}{2\pi}"; +$s2 = $rad[1]/Compute($b); +$s3 = $rad[2]/Compute($b); +$radShow[1] = Round($rad[1],4); +$radShow[2] = Round($rad[2],4); + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the piston is at its farthest position, or maximum value. This matches the graph of [`y=\cos(x)`], which is at its maximum value when [`x=0`], so we should choose to use the following function to model the piston's position: + + [``p(t)=a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its maximum value when [`t=0`], just like [`y=\cos(x)`]. + +The function's midline is the average values of the function's maximum and minimum values: + + [``\begin{aligned} + d &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+[$low]}{2} \\ + &= [$d]\text{ cm} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-[$low]}{2} \\ + &= [$a]\text{ cm} + \end{aligned}``] + +The piston was at its maximum value at [`(0,[$high])`], and at its minimum value at [`([$p2],[$low])`]. The time in between is half of the period, so: + + [``\text{period}=2([$p2]-0)=[$p]``] + +For the function [`p(t)=a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +The function's formula is + + [``p(t) = [$func] ``] + +###Part b + +To find the piston's position after [`[$t[0]]`] seconds, substitute [`t=[$t[0]]`] into [`p(t)`], we have: + + [``\begin{aligned} + p(t) &= [$func] \\ + &= [$a]\cos\left([$bTex]([$t[0]])\right)+[$d] \\ + &= [$h[0]]\text{ cm} + \end{aligned}``] + +After [`[$t[0]]`] seconds, the piston was [`[$h[0]]`] cm away from the base. + +###Part c + +To find when the piston was [`[$h[1]]`] cm away from its base, substitute [`p(t)=[$h[1]]`] into the function, and solve for [`t`]. We have: + + [``\begin{aligned} + p(t) &= [$func] \\ + [$h[1]] &= [$func] \\ + [$h[1]]-[$d] &= [$a]\cos\left([$bTex]t\right) \\ + \frac{[$s1]}{[$a]} &= \cos\left([$bTex]t\right) \\ + \cos^{-1}\left(\frac{[$s1]}{[$a]}\right) &= [$bTex]t \\ + [$radShow[1]] &= [$bTex]t + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`\frac{[$s1]}{[$a]} = \cos\left([$bTex]t\right)`] true: + +>>[@ $fig1 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Now we have: + + [``\begin{aligned} + \frac{[$s1]}{[$a]} &= \cos\left([$bTex]t\right) \\ + \cos^{-1}\left(\frac{[$s1]}{[$a]}\right) &= [$bTex]t \\ + [$bTex]t &= [$radShow[1]] +2k\pi \text{ or } [$radShow[2]] +2k\pi \\ + t &= [$bR] \left( [$radShow[1]] +2k\pi \right) \text{ or } [$bR] \left( [$radShow[2]] +2k\pi \right) \\ + t &= [$s2] + [$p]k \text{ or } [$s3] + [$p]k + \end{aligned}``] + +We need to substitute in various [`k`] values and find all [`t`] values in [`t\in([$iL],[$iR])`]: + + [``\begin{aligned} + t &= [$s2] + [$p]([$k]) = [$t[1]] \\ + t &= [$s3] + [$p]([$k]) = [$t[2]] + \end{aligned}``] + +During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [`[$ans]`] seconds. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos10.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos10.pg new file mode 100644 index 0000000000..4db7c38d04 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos10.pg @@ -0,0 +1,215 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +sub addPIFraction { + my ($n,$d) = @_; + ($n,$d) = Fraction($n,$d)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return Formula("pi");} + elsif ($n==-1) {return Formula("-pi");} + else {return Formula("$n*pi");} + } else { + if ($n==1) {return Formula("pi/$d");} + elsif ($n==-1) {return -Formula("pi/$d");} + elsif ($n>0) {return Formula("($n*pi)/$d");} + else { + $Nn = -$n; + return -Formula("($Nn*pi)/$d"); + } + } +} + +@t = (); @h = (); @tShow = (); + +do { + do { + $a = random(15,35,1); + $p = random(5,15,1); + $b = addPIFraction(2,$p); + $base = random(5,15,1); + $d = $base+$a; + + $func = Formula("-$a*cos($b*t)+$d"); + + do { + $t[0] = random(2,$p,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h0Show = Round($h[0],3); + $h[1] = random($base+5,$base+2*$a-5,1); + } until abs($h[0]-$h[1])>10 && $t[0]!=$p && $t[0]!=$p/2; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad = arccos(($d-$h[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,3); +$t[1] = $rad/Compute($b); +$t[2] = $p-$t[1]; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],3); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p/2,1.5*$p); +($ymin, $ymax) = (-$a/2,3*$a); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-5; $i<$xmax; $i=$i+5) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"height (m)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$h[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red','left','bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func] and y=[$h[1]]. Their intersections ($tShow[1],$h[1]) and ($tShow[2],$h[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +A Ferris wheel is [`[$a]`] meters in radius and boarded from a platform that is [`[$base]`] meter above the ground. The six o’clock position on the Ferris wheel is level with the loading platform. The wheel completes 1 full revolution in [`[$p]`] minutes. The function [`h(t)`] gives a person’s height in meters above the ground [`t`] minutes after the wheel begins to turn. + +*Use graphing technology* to answer the following questions about the function [`h(t)`]. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`h(t)=`][________________________]{$func}. + +Part b: Assume a person entered a cabin on the Ferris wheel at [`t=0`]. After [`[$t[0]]`] minutes, the person was [_______________]{$h[0]} meters high in the air. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [________________]{$ans} minutes. + +END_PGML + +############################################################## + +$maxHeight = $base+2*$a; + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the person's height, [`(0,[$base])`] is at the minimum of the function. This matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], so we should choose to use the following function to model the person's height: + + [``h(t)=-a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its minimum value when [`t=0`], just like [`y=-\cos(x)`]. + +The person's minimum height is simply the height of the platform, [`[$base]`] meters. The person's maximum height is the height of the platform plus twice the wheel's radius: [`[$base]+2([$a])=[$maxHeight]`] meters. The function's midline is the average values of the person's maximum and minimum height: + + [``d=\frac{[$base]+[$maxHeight]}{2}=[$d]``] + +Next, the function's amplitude is simply the Ferris Wheel's radius: [`a=[$a]`]. + +For the function [`h(t)=-a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} = [$b]``] + +The function's formula is + + [``h(t) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` h(t) = [$func] `]. + +###Part b + +To find the person's height after [`[$t[0]]`] minutes, we need to substitute the function's [`t`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` h([$t[0]]) `]. Desmos shows [`[$h0Show]`]. + +After [`[$t[0]]`] minutes, the person was [`[$h0Show]`] meters high in the air. + +###Part c + +To find when the person's height was [`[$h[1]]`] meters, we need to create a second function [`y=[$h[1]]`], and then let desmos find the intersection between [`h(t)`] and [`y=[$h[1]]`]. + +Step 3: In the second textbox, enter [`y=[$h[1]]`]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`h(t)`] and [`y=[$h[1]]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection of [`h(t)`] and [`y=[$h[1]]`] in the first period. Desmos shows [`([$tShow[1]],[$h[1]])`] and [`([$tShow[2]],[$h[1]])`]. + +The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [`[$tShow[1]], [$tShow[2]]`] minutes. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos20.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos20.pg new file mode 100644 index 0000000000..ef17586e33 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos20.pg @@ -0,0 +1,233 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +sub addPIFraction { + my ($n,$d) = @_; + ($n,$d) = Fraction($n,$d)->reduce->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return Formula("pi");} + elsif ($n==-1) {return Formula("-pi");} + else {return Formula("$n*pi");} + } else { + if ($n==1) {return Formula("pi/$d");} + elsif ($n==-1) {return -Formula("pi/$d");} + elsif ($n>0) {return Formula("($n*pi)/$d");} + else { + $Nn = -$n; + return -Formula("($Nn*pi)/$d"); + } + } +} + +@t = (); @h = (); @tShow = (); + +do { + do { + $a = random(15,35,1); + $p = random(6,16,2); + $pH = $p/2; + $b = addPIFraction(2,$p); + $base = random(5,15,1); + $d = $base+$a; + $top = $base+2*$a; + + $func = Formula("-$a*cos($b*t)+$d"); + + do { + $t[0] = random(2,$p,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h0Show = Round($h[0],3); + $h[1] = random($base+5,$base+2*$a-5,1); + } until abs($h[0]-$h[1])>10 && $t[0]!=$p && $t[0]!=$p/2; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad = arccos(($d-$h[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b); +$t[2] = $p-$t[1]; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],3); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-$p/2,1.5*$p); +($ymin, $ymax) = (-$a/2,3*$a); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-5; $i<$xmax; $i=$i+5) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"height (m)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$h[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red','left','bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func] and y=[$h[1]]. Their intersections ($tShow[1],$h[1]) and ($tShow[2],$h[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +A person got into a cabin on a Ferris wheel for a ride. [`[$pH]`] minutes into the ride, she was on top of the wheel at the height of [`[$top]`] meters; [`[$p]`] minutes into the ride, she was back to the base at the height of [`[$base]`] meters. A function [`h(t)`] models the person's height during this ride. + +*Use graphing technology* to answer the following questions about the function [`h(t)`]. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`h(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] minutes (since the person entered the cabin), the person was [_______________]{$h[0]} meters high in the air. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [________________]{$ans} minutes. + +END_PGML + +############################################################## + +$maxHeight = $base+2*$a; + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the person's height, [`(0,[$base])`] is at the minimum of the function. This matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], so we should choose to use the following function to model the person's height: + + [``h(t)=-a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its minimum value when [`t=0`], just like [`y=-\cos(x)`]. + +By given conditions, [`([$pH],[$top])`] represents the function's maximum value, and [`([$p],[$base])`] represents the function's minimum value. + +The function's [`d`] value (midline) is: + + [``\begin{aligned} + d &= \frac{\text{maximum height}+\text{minimum height}}{2} \\ + &= \frac{[$top]+[$base]}{2} \\ + &= [$d]\text{ meters} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum height}-\text{minimum height}}{2} \\ + &= \frac{[$top]-[$base]}{2} \\ + &= [$a]\text{ meters} + \end{aligned}``] + +To travel from the top point to the bottom point, it takes half a period, so the height's period is: + + [`` 2([$p]-[$pH]) = [$p]\text{ minutes}``] + +For the function [`h(t)=-a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} = [$b]``] + +The function's formula is + + [``h(t) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` h(t) = [$func] `]. + +###Part b + +To find the person's height after [`[$t[0]]`] minutes, we need to substitute the function's [`t`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` h([$t[0]]) `]. Desmos shows [`[$h0Show]`]. + +After [`[$t[0]]`] minutes, the person was [`[$h0Show]`] meters high in the air. + +###Part c + +To find when the person's height was [`[$h[1]]`] meters, we need to create a second function [`y=[$h[1]]`], and then let desmos find the intersection between [`h(t)`] and [`y=[$h[1]]`]. + +Step 3: In the second textbox, enter [`y=[$h[1]]`]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`h(t)`] and [`y=[$h[1]]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection of [`h(t)`] and [`y=[$h[1]]`] in the first period. Desmos shows [`([$tShow[1]],[$h[1]])`] and [`([$tShow[2]],[$h[1]])`]. + +The person exited the cabin after one round. During this time, the person was [`[$h[1]]`] meters in the air twice: [`[$tShow[1]], [$tShow[2]]`] minutes. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos30.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos30.pg new file mode 100644 index 0000000000..d5ba2c990f --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos30.pg @@ -0,0 +1,213 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(d => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@t = (); @h = (); @tShow = (); +do { + do { + $high = random(30,40,1); + $low = random(-10,-5,1); + $a = ($high-$low)/2; + $b = Formula("(2*pi)/365"); + $c = random(5,30,1); + $e = ($high+$low)/2; + $func = Formula("-$a*cos($b*(d-$c))+$e"); + $p = 365; + $xHigh = $c+365/2; + + do { + $t[0] = random($c+5,300,1); + $T[0] = $func->eval(d=>$t[0]); + $T0Show = Round($T[0],3); + $T[1] = random($low+5,$high-5,1); + } until abs($T[0]-$T[1])>10; + $T[2] = $T[1]; + } until abs(($e-$T[1])/$a)<1; + $rad = arccos(($e-$T[1])/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b)+$c; +$t[2] = -$rad/Compute($b)+$p+$c; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],3); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-10,400); +($ymin, $ymax) = ($low-10,$high+10); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-50; $i<$xmax; $i=$i+50) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"Celcius Degrees",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"days",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for d in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$T[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$T[1],red)); +$graph[0]->lb(new Label($t[1],$T[1],"($tShow[1],$T[1])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$T[2],red)); +$graph[0]->lb(new Label($t[2],$T[2],"($tShow[2],$T[2])",'red','center','bottom',large)); + +$alt[0] = "This is the graph of T(d)=[$func] and y=[$T[1]]. Their intersections ($tShow[1],$T[1]) and ($tShow[2],$T[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +$ld = $t[0]-int($t[0]/10)*10; +if ($ld==1) {$th = "st";} + elsif ($ld==2) {$th = "nd";} + else {$th = "th";} + +BEGIN_PGML + +Assume a year has 365 days, and [`d=1`] represents Jan. 1. A city's daily maximum temperature over the year, [`T(d)`], follows the pattern of a periodic function. The city's lowest daily maximum temperature, [`[$low]^{\circ} C`], happens on Jan. [`[$c]`]; its highest daily maximum temperature, [`[$high]^\circ C`], happens in July. + +*Use graphing technology* to answer the following questions. + +Part a: The function, as a transformation of [`y=-\cos(x)`], is [`T(d)=`][________________________]{$func}. + +Part b: On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [_______________]{$T[0]} [`^{\circ} C`]. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [________________]{$ans}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`d=[$c]`], the function has it's minimum value at [`([$c],[$low])`]. Then the function increases. This change matches the graph of [`y=-\cos(x)`], which is at its minimum value when [`x=0`], and then increases. So we should choose to use the following function to model the daily maximum temperature: + + [``T(d)=-a\cos\left(b(d-c)\right)+e``] + +By given conditions, the function's maximum value is [`[$high]`], and its minimum value is [`[$low]`]. + +The function's [`e`] value (midline) is: + + [``\begin{aligned} + e &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+([$low])}{2} \\ + &= [$e]^{\circ} C + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-([$low])}{2} \\ + &= [$a]^{\circ} C + \end{aligned}``] + +The function's period is [`365`] days. By the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +Finally, the function's minimum value is at [`([$c],[$low])`], which matches [`(0,-1)`] on [`y=-\cos(x)`]. The graph of [`y=-\cos(x)`] needs to shift to the right by [`[$c]`] units to match the graph of [`T(d)`], implying [`c=[$c]`] in [`T(d)=-a\cos\left(b(d-c)\right)+e`]. + +The function's formula is + + [``T(d) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` T(d) = [$func] `]. + +###Part b + +To find the daily maximum temperature on the [`[$t[0]]`][$th] day, we need to substitute the function's [`d`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` T([$t[0]]) `]. Desmos shows [`[$T0Show]`]. + +On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [`[$T0Show] ^{\circ} C`]. + +###Part c + +To find when the daily maximum temperature was [`[$T[1]]^{\circ} C`], we need to create a second function [`y=[$T[1]]`], and then let desmos find the intersection between [`T(d)`] and [`y=[$T[1]]`]. + +Step 3: In the second textbox, enter [`y=[$T[1]]`]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`T(d)`] and [`y=[$T[1]]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection of [`T(d)`] and [`y=[$T[1]]`] in the first period. Desmos shows [`([$tShow[1]],[$T[1]])`] and [`([$tShow[2]],[$T[1]])`]. + +During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [`[$tShow[1]], [$tShow[2]]`]. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos40.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos40.pg new file mode 100644 index 0000000000..1a7e490fe8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos40.pg @@ -0,0 +1,212 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(d => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@t = (); @h = (); @tShow = (); +do { + do { + $high = random(30,40,1); + $low = random(-10,-5,1); + $a = ($high-$low)/2; + $b = Formula("(2*pi)/365"); + $c = random(5,30,1); + $e = ($high+$low)/2; + $func = Formula("$a*cos($b*(d-$c))+$e"); + $p = 365; + $xLow = $c+365/2; + + do { + $t[0] = random($c+5,300,1); + $T[0] = $func->eval(d=>$t[0]); + $T0Show = Round($T[0],3); + $T[1] = random($low+5,$high-5,1); + } until abs($T[0]-$T[1])>10; + $T[2] = $T[1]; + } until abs(($T[1]-$e)/$a)<1; + $rad = arccos(($T[1]-$e)/$a); +} until $rad*180/pi>20 && $rad*180/pi<160 && abs($rad*180/pi-90)>20; + +$radShow = Round($rad,2); +$t[1] = $rad/Compute($b)+$c; +$t[2] = -$rad/Compute($b)+$p+$c; +for my $i (0..2) { + $tShow[$i] = Round($t[$i],3); +} +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = (-10,400); +($ymin, $ymax) = ($low-10,$high+10); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-50; $i<$xmax; $i=$i+50) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"Celcius Degrees",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"days",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for d in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$T[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$T[1],red)); +$graph[0]->lb(new Label($t[1],$T[1],"($tShow[1],$T[1])",'red','center','bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$T[2],red)); +$graph[0]->lb(new Label($t[2],$T[2],"($tShow[2],$T[2])",'red','center','bottom',large)); + +$alt[0] = "This is the graph of T(d)=[$func] and y=[$T[1]]. Their intersections ($tShow[1],$T[1]) and ($tShow[2],$T[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +$ld = $t[0]-int($t[0]/10)*10; +if ($ld==1) {$th = "st";} + elsif ($ld==2) {$th = "nd";} + else {$th = "th";} + +BEGIN_PGML + +Assume a year has 365 days, and [`d=1`] represents Jan. 1. A city's daily maximum temperature over the year, [`T(d)`], follows the pattern of a periodic function. The city's highest daily maximum temperature, [`[$high]^{\circ} C`], happens on Jan. [`[$c]`]; its lowest daily maximum temperature, [`[$low]^\circ C`], happens in July. + +*Use graphing technology* to answer the following questions. + +Part a: The function, as a transformation of [`y=\cos(x)`], is [`T(d)=`][________________________]{$func}. + +Part b: On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [_______________]{$T[0]} [`^{\circ} C`]. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [________________]{$ans}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`d=[$c]`], the function has it's maximum value at [`([$c],[$high])`]. Then the function decreases. This change matches the graph of [`y=\cos(x)`], which is at its maximum value when [`x=0`], and then decreases. So we should choose to use the following function to model the daily maximum temperature: + + [``T(d)=a\cos\left(b(d-c)\right)+e``] + +By given conditions, the function's maximum value is [`[$high]`], and its minimum value is [`[$low]`]. + +The function's [`e`] value (midline) is: + + [``\begin{aligned} + e &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+([$low])}{2} \\ + &= [$e]^{\circ} C + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-([$low])}{2} \\ + &= [$a]^{\circ} C + \end{aligned}``] + +The function's period is [`365`] days. By the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +Finally, the function's maximum value is at [`([$c],[$high])`], which matches [`(0,1)`] on [`y=\cos(x)`]. The graph of [`y=-cos(x)`] needs to shift to the right by [`[$c]`] units to match the graph of [`T(d)`], implying [`c=[$c]`] in [`T(d)=a\cos\left(b(d-c)\right)+e`]. + +The function's formula is + + [``T(d) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` T(d) = [$func] `]. + +###Part b + +To find the daily maximum temperature on the [`[$t[0]]`][$th] day, we need to substitute the function's [`d`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` T([$t[0]]) `]. Desmos shows [`[$T0Show]`]. + +On the [`[$t[0]]`][$th] day of the year, the daily maximum temperature was [`[$T0Show] ^{\circ} C`]. + +###Part c + +To find when the daily maximum temperature was [`[$T[1]]^{\circ} C`], we need to create a second function [`y=[$T[1]]`], and then let desmos find the intersection between [`T(d)`] and [`y=[$T[1]]`]. + +Step 3: In the second textbox, enter [`y=[$T[1]]`]. + +Step 4: Zoom out on the window, if needed, until you can see the intersection of [`T(d)`] and [`y=[$T[1]]`]. Alternatively, click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis and [`y`]-axis. + +Step 5: Click on the intersection of [`T(d)`] and [`y=[$T[1]]`] in the first period. Desmos shows [`([$tShow[1]],[$T[1]])`] and [`([$tShow[2]],[$T[1]])`]. + +During this year, the city's daily maximum temperature was [`[$T[1]]^{\circ} C`] twice, on days [`[$tShow[1]], [$tShow[2]]`]. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos50.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos50.pg new file mode 100644 index 0000000000..d378a2c732 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos50.pg @@ -0,0 +1,220 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@rad = (); +@t = (); @h = (); @tShow = (); +do { + do { + $a = random(10,30,0.1); + $p = random(1,5,0.1); + $b = 2*pi/$p; + $bTex = "\frac{2\pi}{$p}"; + $d = random($a+10,$a+20,0.1); + $func = Formula("$a*sin(((2*pi)/$p)*t)+$d"); + $high = $d+$a; + $low = $d-$a; + do { + $t[0] = random(1,3*$p-1,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h0Show = Round($h[0],3); + $h[1] = random($d-$a+1,$d+$a-1,0.1); + } until abs($h[0]-$h[1])>10; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad[1] = arcsin(($h[1]-$d)/$a); + $rad[2] = ($rad[1]>0) ? pi-$rad[1] : -pi-$rad[1]; +} until (abs($rad[1]*180/pi)>20) && (abs($rad[1]*180/pi)<75); + +$p2 = $p/2; +$p4 = $p/4; +$p34 = $p*3/4; + +$k = random(2,3,1); +$t[1] = $rad[1]/Compute($b)+$k*$p; +$t[2] = $rad[2]/Compute($b)+$k*$p; +$iL = $k*$p; +$iR = ($k+1)*$p; +if ( ($iL > $t[1]) || ($iL > $t[2]) ) { + $iL = ($k-1)*$p; + $iR = $k*$p; +} + +@radShow = ();@tShow = (); +$rad[0] = 0; +for my $i (0..2) { + $radShow[$i] = Round($rad[$i],3); + $tShow[$i] = Round($t[$i],3); +} + +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = ($iL-$p/2,$iR+$p/2); +($ymin, $ymax) = (-5,$high+5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-2; $i<$xmax; $i=$i+2) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"distance (cm)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$h[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$lr = ($t[1]<$t[2]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red',$lr,'bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$lr = ($t[2]<$t[1]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red',$lr,'bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func] and y=[$h[1]]. Their intersections ($tShow[1],$h[1]) and ($tShow[2],$h[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +A piston moves forward and backward when it runs. At the beginning [`(t=0)`], the piston was at its nutural position, [`[$d]`] inches from its base. The piston moved away from its base. [`[$p4]`] seconds since [`t=0`], the piston was at its farthest distance from its base, [`[$high]`] cm. Then, the piston moved back toward its base. [`[$p34]`] seconds since [`t=0`], the piston was at its closest distance from its base, [`[$low]`] cm. Then, it switched direction and moved toward its nutural position again. + +The function [`p(t)`] models the piston's distance from its base since it started to move at [`t=0`]. *Use graphing technology* to answer the following questions. + +Part a: The function, as a transformation of [`y=\sin(x)`], is [`p(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] seconds, the piston was [_______________]{$h[0]} cm away from its base. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [______________________]{$ans} seconds. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the piston is at its neutral position, or the middle of maximum and minimum values. This matches the graph of [`y=\sin(x)`], which is in the middle of maximum and minimum values when [`x=0`], so we should choose to use the following function to model the piston's position: + + [``p(t)=a\sin\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is in the middle of its maximum and minimum values when [`t=0`], just like [`y=\sin(x)`]. + +The function's midline is the average values of the function's maximum and minimum values: + + [``\begin{aligned} + d &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+[$low]}{2} \\ + &= [$d]\text{ cm} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-[$low]}{2} \\ + &= [$a]\text{ cm} + \end{aligned}``] + +The piston was at its maximum value at [`([$p4],[$high])`], and at its minimum value at [`([$p34],[$low])`]. The time in between is half of the period, so: + + [``\text{period}=2([$p34]-[$p4])=[$p]``] + +For the function [`p(t)=a\sin\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +The function's formula is + + [``p(t) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` h(t) = [$func] `]. + +###Part b + +To find the piston's position after [`[$t[0]]`] seconds, we need to substitute the function's [`t`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` p([$t[0]]) `]. Desmos shows [`[$h0Show]`]. + +After [`[$t[0]]`] seconds, the piston was [`[$h0Show]`] cm away from the base. + +###Part c + +To find when the piston was [`[$h[1]]`] cm away from its base, we need to create a second function [`y=[$h[1]]`], and then let desmos find the intersection between [`p(t)`] and [`y=[$h[1]]`]. + +Step 3: In the second textbox, enter [`y=[$h[1]]`]. + +Step 4: Since we only want to find intersections in [`t\in([$iL],[$iR])`], click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis to that interval. Now you can see the intersection of [`p(t)`] and [`y=[$h[1]]`]. + +Step 5: Click on the intersection of [`p(t)`] and [`y=[$h[1]]`]. Desmos shows [`([$tShow[1]],[$h[1]])`] and [`([$tShow[2]],[$h[1]])`]. + +During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [`[$tShow[1]], [$tShow[2]]`] seconds. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos60.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos60.pg new file mode 100644 index 0000000000..090bec6774 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigApplication/TrigApplicationDesmos60.pg @@ -0,0 +1,218 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->variables->add(t => "Real"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@rad = (); +@t = (); @h = (); @tShow = (); +do { + do { + $a = random(10,30,0.1); + $p = random(1,5,0.1); + $b = 2*pi/$p; + $bTex = "\frac{2\pi}{$p}"; + $d = random($a+10,$a+20,0.1); + $func = Formula("$a*cos(((2*pi)/$p)*t)+$d"); + $high = $d+$a; + $low = $d-$a; + do { + $t[0] = random(1,3*$p-1,0.1); + $h[0] = $func->eval(t=>$t[0]); + $h0Show = Round($h[0],3); + $h[1] = random($d-$a+1,$d+$a-1,0.1); + } until abs($h[0]-$h[1])>10; + $h[2] = $h[1]; + } until abs(($d-$h[1])/$a)<1; + $rad[1] = arccos(($h[1]-$d)/$a); + $rad[2] = -$rad[1]; +} until (abs($rad[1]*180/pi)>20) && (abs($rad[1]*180/pi)<75); + +$p2 = $p/2; + +$k = random(2,3,1); +$t[1] = $rad[1]/Compute($b)+$k*$p; +$t[2] = $rad[2]/Compute($b)+$k*$p; +$iL = $k*$p+$p2; +$iR = ($k+1)*$p+$p2; +if ( ($iL > $t[1]) || ($iL > $t[2]) ) { + $iL = ($k-1)*$p+$p2; + $iR = $k*$p+$p2; +} + +@radShow = ();@tShow = (); +$rad[0] = 0; +for my $i (0..2) { + $radShow[$i] = Round($rad[$i],23); + $tShow[$i] = Round($t[$i],3); +} + +$ans = List($t[1],$t[2]); + +@graph = (); +($xmin, $xmax) = ($iL-$p,$iR+$p); +($ymin, $ymax) = (-5,$high+5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0]); +$graph[0]->lb('reset'); + +for (my $i=-2; $i<$xmax; $i=$i+2) { + $graph[0]->moveTo($i,$ymin); + $graph[0]->lineTo($i,$ymax,gray,1,dashed); + $graph[0]->lb(new Label($i,0,$i,'black','right','top',large)); +} +for (my $i=-10; $i<$ymax; $i=$i+10) { + $graph[0]->moveTo($xmin,$i); + $graph[0]->lineTo($xmax,$i,gray,1,dashed); + $graph[0]->lb(new Label(0,$i,$i,'black','right','middle',large)) unless $i==0; +} + +$graph[0]->lb(new Label(0,0.97*$ymax,"distance (cm)",'blue','left','middle',large)); +$graph[0]->lb(new Label(0.98*$xmax,0,"time (s)",'blue','right','bottom',large)); + +add_functions($graph[0], "$func for t in <$xmin,$xmax> using color:blue and weight:2"); +add_functions($graph[0], "$h[1] for t in <$xmin,$xmax> using color:black and weight:2"); +($graph[0]->fn)[0]->steps(300); + +$graph[0]->stamps(closed_circle($t[1],$h[1],red)); +$lr = ($t[1]<$t[2]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[1],$h[1],"($tShow[1],$h[1])",'red',$lr,'bottom',large)); +$graph[0]->stamps(closed_circle($t[2],$h[2],red)); +$lr = ($t[2]<$t[1]) ? 'right' : 'left'; +$graph[0]->lb(new Label($t[2],$h[2],"($tShow[2],$h[2])",'red',$lr,'bottom',large)); + +$alt[0] = "This is the graph of h(t)=[$func] and y=[$h[1]]. Their intersections ($tShow[1],$h[1]) and ($tShow[2],$h[2]) are highlighted."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +A piston moves forward and backward when it runs. At the beginning [`(t=0)`], the piston was at its farthest distance from its base, [`[$high]`] cm. Then, the piston moved back toward its base. [`[$p2]`] seconds later, the piston was at its closest distance from its base, [`[$low]`] cm. Then, it switched direction and moved away from its base. + +The function [`p(t)`] models the piston's distance from its base since it started to move at [`t=0`]. *Use graphing technology* to answer the following questions. + +Part a: The function, as a transformation of [`y=\cos(x)`], is [`p(t)=`][________________________]{$func}. + +Part b: After [`[$t[0]]`] seconds, the piston was [_______________]{$h[0]} cm away from its base. + +[@KeyboardInstructions( +"\n" +."* In the next part, use a comma to separate your answers." +)@]** + +Part c: During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [______________________]{$ans} seconds. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +We could use [`y=\sin(x), y=\cos(x)`] and [`y=-\cos(x)`] to model periodic data. In this situation, when [`t=0`], the piston is at its farthest position, or maximum value. This matches the graph of [`y=\cos(x)`], which is at its maximum value when [`x=0`], so we should choose to use the following function to model the piston's position: + + [``p(t)=a\cos\left(bt\right)+d``] + +Note that there is no horizontal translation, because the function is at its maximum value when [`t=0`], just like [`y=\cos(x)`]. + +The function's midline is the average values of the function's maximum and minimum values: + + [``\begin{aligned} + d &= \frac{\text{maximum value}+\text{minimum value}}{2} \\ + &= \frac{[$high]+[$low]}{2} \\ + &= [$d]\text{ cm} + \end{aligned}``] + +The function's amplitude can be calculated by: + + [``\begin{aligned} + a &= \frac{\text{maximum value}-\text{minimum value}}{2} \\ + &= \frac{[$high]-[$low]}{2} \\ + &= [$a]\text{ cm} + \end{aligned}``] + +The piston was at its maximum value at [`(0,[$high])`], and at its minimum value at [`([$p2],[$low])`]. The time in between is half of the period, so: + + [``\text{period}=2([$p2]-0)=[$p]``] + +For the function [`p(t)=a\cos\left(bt\right)+d`], by the period formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$p]} ``] + +The function's formula is + + [``p(t) = [$func] ``] + +We will use desmos.com to answer the question. + +Step 1: Go to desmos.com, click on Start Graphing. + +Step 2: In the first textbox, enter [` h(t) = [$func] `]. + +###Part b + +To find the piston's position after [`[$t[0]]`] seconds, we need to substitute the function's [`t`] value with [`[$t[0]]`] to get the corresponding [`y`] value. + +Step 3: In the second textbox, enter [` p([$t[0]]) `]. Desmos shows [`[$h0Show]`]. + +After [`[$t[0]]`] seconds, the piston was [`[$h0Show]`] cm away from the base. + +###Part c + +To find when the piston was [`[$h[1]]`] cm away from its base, we need to create a second function [`y=[$h[1]]`], and then let desmos find the intersection between [`p(t)`] and [`y=[$h[1]]`]. + +Step 3: In the second textbox, enter [`y=[$h[1]]`]. + +Step 4: Since we only want to find intersections in [`t\in([$iL],[$iR])`], click on the Graph Settings icon (looking like a tool) and define the ranges of [`x`]-axis to that interval. Now you can see the intersection of [`p(t)`] and [`y=[$h[1]]`]. + +Step 5: Click on the intersection of [`p(t)`] and [`y=[$h[1]]`]. Desmos shows [`([$tShow[1]],[$h[1]])`] and [`([$tShow[2]],[$h[1]])`]. + +During the time interval [`t\in([$iL],[$iR])`], the piston was [`[$h[1]]`] cm from its base at the following moments: [`[$tShow[1]], [$tShow[2]]`] seconds. + +Below is the function's graph with solutions of this problem: + +>>[@ $fig0 @]*<< + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation10.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation10.pg new file mode 100644 index 0000000000..1da0e37e81 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation10.pg @@ -0,0 +1,301 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("LimitedRadical"); + + +%values = ( +#[sin^-1(x), sin^-1(x) in [0,2pi], +#value opposite to sin^-1(x), value opposite to sin^-1(x) in [0,2pi] + "0" => [ + ["0","0","pi","pi"], + ["pi/2","pi/2","-pi/2","(3pi)/2"], + ["0","0","pi","pi"], + ], + "1/2" => [ + ["pi/6","pi/6","(5pi)/6","(5pi)/6"], + ["pi/3","pi/3","-pi/3","(5pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "-1/2" => [ + ["-pi/6","(11pi)/6","-(5pi)/6","(7pi)/6"], + ["(2pi)/3","(2pi)/3","-(2pi)/3","(4pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(2)/2" => [ + ["pi/4","pi/4","(3pi)/4","(3pi)/4"], + ["pi/4","pi/4","-pi/4","(7pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(2)/2" => [ + ["-pi/4","(7pi)/4","-(3pi)/4","(5pi)/4"], + ["(3pi)/4","(3pi)/4","-(3pi)/4","(5pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(3)/2" => [ + ["pi/3","pi/3","(2pi)/3","(2pi)/3"], + ["pi/6","pi/6","-pi/6","(11pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(3)/2" => [ + ["-pi/3","(5pi)/3","-(2pi)/3","(4pi)/3"], + ["(5pi)/6","(5pi)/6","-(5pi)/6","(7pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "1" => [ + ["pi/2","pi/2","DNE","DNE"], + ["0","0","DNE","DNE"], + ["pi/4","pi/4","(5pi)/4","(5pi)/4"], + ], + "-1" => [ + ["-pi/2","(3pi)/2","DNE","DNE"], + ["pi","pi","DNE","DNE"], + ["-pi/4","(7pi)/4","(3pi)/4","(3pi)/4"], + ], + "sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/6","pi/6","-(5pi)/6","(7pi)/6"], + ], + "-sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/6","(11pi)/6","(5pi)/6","(5pi)/6"], + ], + "sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/3","pi/3","-(2pi)/3","(4pi)/3"], + ], + "-sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/3","(5pi)/3","(2pi)/3","(2pi)/3"], + ], +); + +@hashKeys = lex_sort(keys %values); +do { + $sinValue = $hashKeys[random(0,$#hashKeys,1)]; +} until ($values{$sinValue}[0][0] ne "DNE"); + +$left = "\sin(x)"; +$right = Formula("$sinValue")->TeX; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +Context()->variables->add(k => "Real"); +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +$ans0 = $values{$sinValue}[0][0]; +$ans0alt = $values{$sinValue}[0][1]; +$ans0k = Formula("$ans0+2*k*pi"); +$ans0altk = Formula("$ans0alt+2*k*pi"); + +$ans1 = $values{$sinValue}[0][2]; +if ($ans1 eq "DNE") { + $ans = OneOf( $ans0k,$ans0altk ); + $ansShow = List(Formula("$ans0+2*k*pi")); +} else { + $ans1alt = $values{$sinValue}[0][3]; + $ans1k = Formula("$ans1+2*k*pi"); + $ans1altk = Formula("$ans1alt+2*k*pi"); + $ans = OneOf( + List($ans0k,$ans1k), + List($ans0altk,$ans1k), + List($ans0k,$ans1altk), + List($ans0altk,$ans1altk) + ); + $ansShow = List(Formula("$ans0+2*k*pi"),Formula("$ans1+2*k*pi")); + if ($ans0 eq "0") { + $ans = OneOf( + List(Formula("2*k*pi"),Formula("$ans1+2*k*pi")), + Formula("k*pi") + ); + $ansShow = List(Formula("2*k*pi"),Formula("$ans1+2*k*pi")); + } +} + +$r = 5; +$Pr = Compute($ans0); +$Px = $r*cos($Pr); +$Py = $r*sin($Pr); + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph->stamps(closed_circle($Px,$Py,red)); +$graph->moveTo(0,0); +$graph->lineTo($Px,$Py,red,2); +$graph->lineTo($Px,0,red,2); +$graph->lineTo(0,0,red,2); + +if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); +} + +$td = $Py>=0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px,$Py,"P: $ans0",'red','center',$td,large)); + +$alt = "This is the graph of a circle with point P: $ans0 on the circle."; + +if ($ans1 ne "DNE") { + $Qr = Compute($ans1); + $Qx = $r*cos($Qr); + $Qy = $r*sin($Qr); + + $graph->stamps(closed_circle($Qx,$Qy,red)); + $graph->moveTo(0,0); + $graph->lineTo($Qx,$Qy,red,2); + $graph->lineTo($Qx,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Qx!=0) && ($Qy!=0) ) { + $xShift = ($Qx>0) ? -0.4 : 0.4; + $yShift = ($Qy>0) ? 0.4 : -0.4; + $graph->moveTo($Qx,$yShift); + $graph->lineTo($Qx+$xShift,$yShift,red,2); + $graph->lineTo($Qx+$xShift,0,red,2); + } + + $td = $Qy>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Qx,$Qy,"Q: $ans1",'red','center',$td,large)); + + $alt = "This is the graph of a circle with point P: $ans0 and Q: $ans1 on the circle. From each point, a vertical line is drawn until it reaches the x-axis, showing they have the same distance to the x-axis."; +} + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right]``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use [|k*pi|]* to represent multiples of [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +."\n" +.'* Example: type [|3pi/4+2k*pi|]* to represent [`\frac{3\pi}{4}+2k\pi`].' +)@]** + + [`x=`][________________________________________]{$ans->cmp(correct_ans_latex_string=>$ansShow->TeX)} + + +END_PGML + +############################################################## + +Context("LimitedRadical"); +Context()->variables->add(k => "Real"); + +$s1 = Formula("$ans0"); + +if ($values{$sinValue}[0][2] eq "DNE") { + $output0 = "Only one point "; +} else { + $output0 = "Two points "; +} + +$output1 = ""; +if ($values{$sinValue}[0][0] ne $values{$sinValue}[0][1]) { + $output1 = "\text{Note that }".$ans0k->TeX."\text{ and }".$ans0altk->TeX."\text{ are equivalent. }\\"; +} +if ($values{$sinValue}[0][2] ne $values{$sinValue}[0][3]) { + if ($output1 ne "") { + $output1 .= "\text{Also, }"; + } else { + $output1 .= "\text{Note that }"; + } + $output1 .= $ans1k->TeX."\text{ and }".$ans1altk->TeX."\text{ are equivalent.}"; +} + +if ($ans0 eq "0") { + $output1 = "\text{Note that }x=".$ansShow->TeX."\text{ and }x=".Formula("k*pi")->TeX."\text{ are equivalent.}"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + x &= \sin^{-1}\left([$right]\right) \\ + x &= [$s1] + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$left]=[$right]`] true: + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[$output0] on the Unit Circle can make the equation true. The equation's solution is: + + [``x=[$ansShow]\text{, where }k\text{ is any integer.}``] + +[`[$output1]`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation100.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation100.pg new file mode 100644 index 0000000000..b1c1ba03cd --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation100.pg @@ -0,0 +1,203 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@values = ( + Formula("1"),-Formula("1"), + Formula("sqrt(3)"),-Formula("sqrt(3)"), + Formula("sqrt(3)/3"),-Formula("sqrt(3)/3"), +); + +%ab = ( + Formula("1") => [Formula("1"),-Formula("1")], + -Formula("1") => [Formula("1"),Formula("1")], + Formula("sqrt(3)") => [Formula("1"),-Formula("sqrt(3)")], + -Formula("sqrt(3)") => [Formula("1"),Formula("sqrt(3)")], + Formula("sqrt(3)/3") => [Formula("3"),-Formula("sqrt(3)")], + -Formula("sqrt(3)/3") => [Formula("3"),Formula("sqrt(3)")], +); + +@start = (); +$start[0] = Formula("0"); +$tanV = $values[random(0,$#values,1)]; +$start[1] = specialAngle(arctan(Compute($tanV))); + +$a1 = $ab{$tanV}->[0]; +$b1 = $ab{$tanV}->[1]; + +$left = ($a1 == 1) ? "\tan^2(x)" : $a1->TeX."\tan^2(x)"; +$b1N = $b1>0 ? -$b1 : Formula(substr($b1,1)); +if (abs($b1)==1) { + $right = ($b1 == 1) ? "-\tan(x)" : "\tan(x)"; +} else { + $right = ($b1N == 1) ? "\tan(x)" : $b1N->TeX."\tan(x)"; +} + +@k = (); +$k[0] = 1; +$points = "0, pi, "; +@ansL = (Formula("0"),Formula("pi")); +for my $i (-2..2) { + my $c = Compute($start[1]->string)+$i*pi; + if ( ($c>=0) && ($c<2*pi) ) { + $ansL[scalar(@ansL)] = specialAngle($c); + $k[scalar(@k)] = $i; + $points .= $ansL[scalar(@ansL)-1]->string.", "; + } +} +$points = substr($points,0,length($points)-2); +$ans = List(@ansL); + +$r = 5; +for my $i (0..0) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@ansL)-1) { + $Px = Compute("$r*cos($ansL[$j])")->reduce; + $Py = Compute("$r*sin($ansL[$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$ansL[$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + + +if ( (abs($a1)==1) && (abs($b1)==1) ) { + $s1 = ($b1>0) ? "\tan^2(x)+\tan(x)" : "\tan^2(x)-\tan(x)"; + $s2 = ($b1>0) ? "\tan(x)\left(\tan(x)+1\right)" : "\tan(x)\left(\tan(x)-1\right)"; + $s3 = ($b1>0) ? "\tan(x)+1" : "\tan(x)-1"; +} elsif (abs($a1)==1) { + $s1 = ($b1>0) ? "\tan^2(x)+".$b1->TeX."\tan(x)" : "\tan^2(x)".$b1->TeX."\tan(x)"; + $s2 = ($b1>0) ? "\tan(x)\left(\tan(x)+".$b1->TeX."\right)" : "\tan(x)\left(\tan(x)".$b1->TeX."\right)"; + $s3 = ($b1>0) ? "\tan(x)+".$b1->TeX : "\tan(x)".$b1->TeX; +} elsif (abs($b1)==1) { + $s1 = ($b1>0) ? $a1->TeX."\cdot\tan^2(x)+\tan(x)" : $a1->TeX."\cdot\tan^2(x)-\tan(x)"; + $s2 = ($b1>0) ? "\tan(x)\left(".$a1->TeX."\cdot\tan(x)+1\right)" : "\tan(x)\left(".$a1->TeX."\cdot\tan(x)-1\right)"; + $s3 = ($b1>0) ? $a1->TeX."\cdot\tan(x)+1" : $a1->TeX."\cdot\tan(x)-1"; +} else { + $s1 = ($b1>0) ? $a1->TeX."\cdot\tan^2(x)+".$b1->TeX."\tan(x)" : $a1->TeX."\cdot\tan^2(x)".$b1->TeX."\tan(x)"; + $s2 = ($b1>0) ? "\tan(x)\left(".$a1->TeX."\cdot\tan(x)+".$b1->TeX."\right)" : "\tan(x)\left(".$a1->TeX."\cdot\tan(x)".$b1->TeX."\right)"; + $s3 = ($b1>0) ? $a1->TeX."\cdot\tan(x)+".$b1->TeX : $a1->TeX."\cdot\tan(x)".$b1->TeX; +} + + + + +############################################################## + +BEGIN_PGML_SOLUTION +[`[$t1]`] + [``\begin{aligned} + [$left] &= [$right] \\ + [$s1] &= 0 \\ + [$s2] &= 0 \\ + \tan(x) &= 0\text{ or }[$s3]=0 \\ + \tan(x) &= 0\text{ or }\tan(x)=[$tanV] \\ + x &= \tan^{-1}(0) \text{ or } \tan^{-1}\left([$tanV]\right) \\ + x &= 0 \text{ or } [$start[1]] + \end{aligned}``] + +Recall that the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right) `]. On the Unit Circle, we need to identify all values, in [`[0,2\pi)`], which make [`\tan(x) = 0\text{ or }[$s3]=0`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation110.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation110.pg new file mode 100644 index 0000000000..d4e2f8c72c --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation110.pg @@ -0,0 +1,226 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +%ab = ( + Formula("1/2") => [Formula("2"),-Formula("1")], + -Formula("1/2") => [Formula("2"),Formula("1")], + Formula("1") => [Formula("1"),-Formula("1")], + -Formula("1") => [Formula("1"),Formula("1")], +); + +@sinV = (); +$sinV[0] = list_random(Formula("1"),-Formula("1"),"DNE"); +if ($sinV[0] eq "DNE") { + $sinV[0] = random(2,5,1)*random(-1,1,2); + $ab{Formula($sinV[0])} = [Formula("1"),-Formula("$sinV[0]")]; +} +$sinV[1] = list_random(Formula("1/2"),-Formula("1/2")); + +#$start[0][#] are points in first graph with inverse trig values +#$start[1][#] are points in second graph with solutions +@start = (); +if (abs($sinV[0])==1) + {$start[0][0]=specialAngle(arcsin(Compute($sinV[0])));} +$start[0][scalar(@{$start[0]})] = specialAngle(arcsin(Compute($sinV[1]))); +if ($start[0][scalar(@{$start[0]})-1]>0) { + $start[0][scalar(@{$start[0]})]=specialAngle(pi-Compute($start[0][scalar(@{$start[0]})-1])); + } else { + $start[0][scalar(@{$start[0]})]=specialAngle(-pi-Compute($start[0][scalar(@{$start[0]})-1])); + } + + +$a0 = Compute($ab{$sinV[0]}->[0]); +$b0 = Compute($ab{$sinV[0]}->[1]); +$a1 = Compute($ab{$sinV[1]}->[0]); +$b1 = Compute($ab{$sinV[1]}->[1]); +$b0N = Compute(-$b0); +$b1N = Compute(-$b1); + +$factor0 = ($b0>0) ? "\sin(x)+$b0" : "\sin(x)$b0"; +$factor1 = ($b1>0) ? "2\sin(x)+1" : "2\sin(x)-1"; + +$c = Compute($a0*$b1+$a1*$b0); +$d = Compute($b0*$b1); +if (abs($c)==1) { + $quadEquation = ($c>0) ? "2\sin^2(x)+\sin(x)+$d" : "2\sin^2(x)-\sin(x)+$d"; + $left = ($c>0) ? "\sin(x)+2" : "-\sin(x)+2"; +} else { + $quadEquation = "2\sin^2(x)+$c\sin(x)+$d"; + $left = "$c\sin(x)+2"; +} +$right = "2\cos^2(x)-$d"; + +@points = ""; +if ($sinV[0]==1) { + $points[0] .= "pi/2, $start[0][1] and $start[0][2]"; +} elsif ($sinV[0]==-1) { + $points[0] .= "-pi/2, $start[0][1] and $start[0][2]"; +} else { + $points[0] .= "$start[0][0] and $start[0][1]"; +} + +for my $j (0..scalar(@{$start[0]})-1) { + for my $i (-2..2) { + my $c = Compute($start[0][$j]->string)+2*$i*pi; + if ( ($c>=0) && ($c<2*pi) ) { + $start[1][scalar(@{$start[1]})] = specialAngle($c); + $points[1] .= $start[1][scalar(@{$start[1]})-1]->string.", "; + } + } +} +$points[1] = substr($points[1],0,length($points[1])-2); +$ans = List(@{$start[1]}); + +$r = 5; +for my $i (0..1) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$start[$i]})-1) { + $Px = Compute("$r*cos($start[$i][$j])")->reduce; + $Py = Compute("$r*sin($start[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$start[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +$right1 = "2\left(1-\sin^2(x)\right)-$d"; +$right2 = "2-2\sin^2(x)-$d"; + +$s1 = ""; +if (abs($b0N)>1) { + $s1 = "\sin^{-1}($b0N) \text{ has no solution.}"; + $s2 = "x=\sin^{-1}\left(".$sinV[1]->TeX."\right)"; +} else { + $s2 = "x=\sin^{-1}\left(".$sinV[1]->TeX."\right) \text{ or } x=\sin^{-1}($b0N)"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + +When there are [`\sin(x)`] and [`\cos(x)`] in the same equation, we should try to use the formula [`\sin^2(x)+\cos^2(x)=1`] to remove one of them. + + [``\begin{aligned} + [$left] &= [$right] \\ + [$left] &= [$right1] \\ + [$left] &= [$right2] \\ + [$quadEquation] &= 0 \\ + ([$factor1])([$factor0]) &= 0 \\ + [$factor1] &=0 \text{ or } [$factor0]=0 \\ + \sin(x) &= [$sinV[1]] \text{ or } \sin(x) = [$b0N] \\ + x &= \sin^{-1}\left([$sinV[1]]\right) \text{ or } x=\sin^{-1}([$b0N]) \\ + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. [`[$s1]`] + +On the Unit Circle, we need to identify all values which make [`[$s2]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We need to find corresponding values in the range of [`[0,2\pi)`]: + +>>[@ $fig[1] @]*<< + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation120.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation120.pg new file mode 100644 index 0000000000..86a05756a4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation120.pg @@ -0,0 +1,235 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + do { + $a = non_zero_random(-5,5,1); + $b = non_zero_random(-5,5,1); + $c = non_zero_random(-5,5,1); + $d = ($b)**2-4*$a*$c; + } until $d > 0 && gcd($a,gcd($b,$c))==1; + $x0 = (-$b-sqrt($d))/(2*$a); + $x1 = (-$b+sqrt($d))/(2*$a); +} until abs($x0)<=1 || abs($x1)<=1; +$x0Show = Round($x0,2); +$x1Show = Round($x1,2); + +$left = ""; +if (abs($a)==1) { + $left .= $a>0 ? "\cos^2(x)" : "-\cos^2(x)"; +} else { + $left .= "$a\cos^2(x)"; +} + +if (abs($b)==1) { + $left .= $b>0 ? "+\cos(x)" : "-\cos(x)"; +} else { + $left .= $b>0 ? "+$b\cos(x)" : "$b\cos(x)"; +} +$left .= "+$c"; +$right = "0"; + +@cosV = (); @cosVShow = (); +if (abs($x0)<=1) { + $cosV[scalar(@cosV)] = $x0; + $cosVShow[scalar(@cosVShow)] = Round($x0,2); +} +if (abs($x1)<=1) { + $cosV[scalar(@cosV)] = $x1; + $cosVShow[scalar(@cosVShow)] = Round($x1,2); +} + +#$start[0][#] are points in first graph with inverse trig values +#$start[1][#] are points in second graph with solutions +@start = (); @points = ""; +for my $i (0..scalar(@cosV)-1) { + $start[0][scalar(@{$start[0]})] = arccos($cosV[$i]); + $points[0] .= Round(arccos($cosV[$i]),2).", "; + $start[0][scalar(@{$start[0]})] = -arccos($cosV[$i]); + $points[0] .= Round(-arccos($cosV[$i]),2).", "; +} +$points[0] = substr($points[0],0,length($points[0])-2); + +for my $j (0..scalar(@{$start[0]})-1) { + for my $i (-2..2) { + my $c = $start[0][$j]+2*$i*pi; + if ( ($c>=0) && ($c<2*pi) ) { + $start[1][scalar(@{$start[1]})] = $c; + $points[1] .= Round($c,2).", "; + } + } +} +$points[1] = substr($points[1],0,length($points)-2); +$ans = List(@{$start[1]}); + +@startShow = (); +for my $i (0..scalar(@start)-1) { + for my $j (0..scalar(@{$start[$i]})-1) { + $startShow[$i][$j] = Round($start[$i][$j],2); + } +} + +$r = 5; +for my $i (0..1) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$start[$i]})-1) { + $Px = Compute("$r*cos($start[$i][$j])")->reduce; + $Py = Compute("$r*sin($start[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$startShow[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|1.12, 3.24|]*.' +."\n" +.'* Use a calculator to calculate inverse trigonometry values.' +."\n" +.'* Type radian answers. There is no need to use [`\pi`] in your answers.' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +$right1 = "2\left(1-\sin^2(x)\right)-$d"; +$right2 = "2-2\sin^2(x)-$d"; + +$s1 = ""; +if (abs($x0)>1) { + $s1 = "\cos^{-1}($x0Show) \text{ has no solution.}"; + $s2 = "\cos(x)=$x1Show"; +} elsif (abs($x1)>1) { + $s1 = "\cos^{-1}($x1Show) \text{ has no solution.}"; + $s2 = "\cos(x)=$x0Show"; +} else { + $s2 = "\cos(x)=$x0Show \text{ and } \cos(x)=$x1Show"; +} + +$s3 = ""; +for my $i (0..scalar(@{$start[0]})-1) { + if ($start[0][$i]<0) { + $s3 .= "$startShow[0][$i]+2\pi&=$startShow[1][$i]\\"; + } +} + +############################################################## + +BEGIN_PGML_SOLUTION + +We will use the quadratic formula [` x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} `] to solve this equation: + + [``\begin{aligned} + [$left] &= [$right] \\ + \cos(x) &= \frac{-([$b])\pm\sqrt{([$b])^2-4([$a])([$c])}}{2([$a])} \\ + \cos(x) &\approx [$x0Show] \text{ or } \cos(x) \approx [$x1Show] \\ + x &\approx \cos^{-1}\left([$x0Show]\right) \text{ or } x\approx\cos^{-1}([$x1Show]) \\ + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. [`[$s1]`] + +On the Unit Circle, we need to identify all values which make [`[$s2]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We need to find corresponding values in the range of [`[0,2\pi)`]: + +>>[@ $fig[1] @]*<< + +We did: + + [``\begin{aligned} + [$s3] + \end{aligned}``] + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation130.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation130.pg new file mode 100644 index 0000000000..389293bc5d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation130.pg @@ -0,0 +1,195 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +%ab = ( + "1/2" => -Formula("1"), + "-1/2" => Formula("1"), + "sqrt(2)/2" => -Formula("sqrt(2)"), + "-sqrt(2)/2" => Formula("sqrt(2)"), + "sqrt(3)/2" => -Formula("sqrt(3)"), + "-sqrt(3)/2" => Formula("sqrt(3)"), +); + +$cosV = list_random("1/2","sqrt(2)/2","sqrt(3)/2","-1/2","-sqrt(2)/2","-sqrt(3)/2"); + +#$start[0][#] are points in first graph with inverse trig values +#$start[1][#] are points in second graph with solutions +@start = (); +$start[0][0] = Formula("0"); +$start[0][1] = Formula("pi"); +$start[0][2] = specialAngle(arccos(Compute($cosV))); +$start[0][3] = -specialAngle(arccos(Compute($cosV))); + +$start[1][0] = Formula("0"); +$start[1][1] = Formula("pi"); +$start[1][2] = $start[0][2]; +$start[1][3] = specialAngle(2*pi+Compute($start[0][3])); + +$a1 = 2; +$b1 = $ab{$cosV}; +$b1N = ($b1>0) ? -Formula($b1) : Formula(substr($b1,1)); + +$factor0 = "\sin(x)"; +$factor1 = ($b1>0) ? "2\cos(x)+".$b1->TeX : "2\cos(x)".$b1->TeX; + +$left = "\sin(2x)"; +$left1 = "2\sin(x)\cos(x)"; +if (abs($b1) == 1) { + $left1 .= ($b1>0) ? "+" : "-"; +} else { + $left1 .= ($b1>0) ? "+".$b1->TeX : $b1->TeX; +} +$left1 .= "\sin(x)"; + +$right = ""; +if (abs($b1N) == 1) { + $right .= ($b1N>0) ? "\sin(x)" : "-\sin(x)"; +} else { + $right .= $b1N->TeX."\sin(x)"; +} + +@points = (); +$points[0] .= "0, pi, $start[0][2] and $start[0][3]"; +$points[1] .= "0, pi, $start[0][2] and $start[1][3]"; +$ans = List(@{$start[1]}); + +$r = 5; +for my $i (0..1) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$start[$i]})-1) { + $Px = Compute("$r*cos($start[$i][$j])")->reduce; + $Py = Compute("$r*sin($start[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$start[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +$s1 = Formula($cosV); + +############################################################## + +BEGIN_PGML_SOLUTION + +To solve the equation, we need to use the formula [`\sin(2x)=2\sin(x)\cos(x)`]: + + [``\begin{aligned} + [$left] &= [$right] \\ + 2\sin(x)\cos(x) &= [$right] \\ + [$left1] &= 0 \\ + [$factor0]\left([$factor1]\right) &= 0 \\ + [$factor0] &=0 \text{ or } [$factor1]=0 \\ + \sin(x) &= 0 \text{ or } \cos(x) = [$s1] \\ + x &= \sin^{-1}\left(0\right) \text{ or } x=\cos^{-1}([$s1]) \\ + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] and [`\cos^{-1}(x)`] are both [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. On the Unit Circle, we need to identify all values which make [`\sin(x) = 0 \text{ or } \cos(x) = [$s1]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We need to find corresponding values in the range of [`[0,2\pi)`]: + +>>[@ $fig[1] @]*<< + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation140.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation140.pg new file mode 100644 index 0000000000..32581de705 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation140.pg @@ -0,0 +1,235 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +%ab = ( + Formula("1/2") => [Formula("2"),-Formula("1")], + -Formula("1/2") => [Formula("2"),Formula("1")], + Formula("1") => [Formula("1"),-Formula("1")], + -Formula("1") => [Formula("1"),Formula("1")], +); + +@sinV = (); +$sinV[0] = list_random(Formula("1"),-Formula("1"),"DNE"); +if ($sinV[0] eq "DNE") { + $sinV[0] = random(2,5,1)*random(-1,1,2); + $ab{Formula($sinV[0])} = [Formula("1"),-Formula("$sinV[0]")]; +} +$sinV[1] = list_random(Formula("1/2"),-Formula("1/2")); + +#$start[0][#] are points in first graph with inverse trig values +#$start[1][#] are points in second graph with solutions +@start = (); +if (abs($sinV[0])==1) + {$start[0][0]=specialAngle(arcsin(Compute($sinV[0])));} +$start[0][scalar(@{$start[0]})] = specialAngle(arcsin(Compute($sinV[1]))); +if ($start[0][scalar(@{$start[0]})-1]>0) { + $start[0][scalar(@{$start[0]})]=specialAngle(pi-Compute($start[0][scalar(@{$start[0]})-1])); + } else { + $start[0][scalar(@{$start[0]})]=specialAngle(-pi-Compute($start[0][scalar(@{$start[0]})-1])); + } + + +$a0 = Compute($ab{$sinV[0]}->[0]); +$b0 = Compute($ab{$sinV[0]}->[1]); +$a1 = Compute($ab{$sinV[1]}->[0]); +$b1 = Compute($ab{$sinV[1]}->[1]); +$b0N = Compute(-$b0); +$b1N = Compute(-$b1); + +$factor0 = ($b0>0) ? "\sin(x)+$b0" : "\sin(x)$b0"; +$factor1 = ($b1>0) ? "2\sin(x)+1" : "2\sin(x)-1"; + +$c = Compute($a0*$b1+$a1*$b0); +$d = Compute($b0*$b1); +if (abs($c)==1) { + $quadEquation = ($c>0) ? "2\sin^2(x)+\sin(x)+$d" : "2\sin^2(x)-\sin(x)+$d"; + $left = ($c>0) ? "\sin(x)+2" : "-\sin(x)+2"; +} else { + $quadEquation = "2\sin^2(x)+$c\sin(x)+$d"; + $left = "$c\sin(x)+2"; +} +$right = "2\cos^2(x)-$d"; +$e = 1-$d; +$right0 = $e==0 ? "\cos(2x)" : "\cos(2x)+$e"; +$right01 = $e==0 ? "1-2\sin^2(x)" : "1-2\sin^2(x)+$e"; + +@points = ""; +if ($sinV[0]==1) { + $points[0] .= "pi/2, $start[0][1] and $start[0][2]"; +} elsif ($sinV[0]==-1) { + $points[0] .= "-pi/2, $start[0][1] and $start[0][2]"; +} else { + $points[0] .= "$start[0][0] and $start[0][1]"; +} + +for my $j (0..scalar(@{$start[0]})-1) { + for my $i (-2..2) { + my $c = Compute($start[0][$j]->string)+2*$i*pi; + if ( ($c>=0) && ($c<2*pi) ) { + $start[1][scalar(@{$start[1]})] = specialAngle($c); + $points[1] .= $start[1][scalar(@{$start[1]})-1]->string.", "; + } + } +} +$points[1] = substr($points[1],0,length($points[1])-2); +$ans = List(@{$start[1]}); + +$r = 5; +for my $i (0..1) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$start[$i]})-1) { + $Px = Compute("$r*cos($start[$i][$j])")->reduce; + $Py = Compute("$r*sin($start[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$start[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right0] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +$right1 = "2\left(1-\sin^2(x)\right)-$d"; +$right2 = "2-2\sin^2(x)-$d"; + +$s1 = ""; +if (abs($b0N)>1) { + $s1 = "\sin^{-1}($b0N) \text{ has no solution.}"; + $s2 = "x=\sin^{-1}\left(".$sinV[1]->TeX."\right)"; +} else { + $s2 = "x=\sin^{-1}\left(".$sinV[1]->TeX."\right) \text{ or } x=\sin^{-1}($b0N)"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + +There are 3 ways to convert [`\cos(2x)`]: + + [``\begin{aligned} + \cos(2x) &= \cos^2(x)-\sin^2(x) \\ + \cos(2x) &= 2\cos^2(x)-1 \\ + \cos(2x) &= 1-2\sin^2(x) \\ + \end{aligned}``] + +Since the equation has [`\sin(x)`], we should choose [`\cos(2x) = 1-2\sin^2(x)`]. The solution is: + + [``\begin{aligned} + [$left] &= [$right0] \\ + [$left] &= [$right01] \\ + [$quadEquation] &= 0 \\ + ([$factor1])([$factor0]) &= 0 \\ + [$factor1] &=0 \text{ or } [$factor0]=0 \\ + \sin(x) &= [$sinV[1]] \text{ or } \sin(x) = [$b0N] \\ + x &= \sin^{-1}\left([$sinV[1]]\right) \text{ or } x=\sin^{-1}([$b0N]) \\ + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. [`[$s1]`] + +On the Unit Circle, we need to identify all values which make [`[$s2]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We need to find corresponding values in the range of [`[0,2\pi)`]: + +>>[@ $fig[1] @]*<< + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation20.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation20.pg new file mode 100644 index 0000000000..236581099d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation20.pg @@ -0,0 +1,300 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("LimitedRadical"); + + +%values = ( +#[sin^-1(x), sin^-1(x) in [0,2pi], +#value opposite to sin^-1(x), value opposite to sin^-1(x) in [0,2pi] + "0" => [ + ["0","0","pi","pi"], + ["pi/2","pi/2","-pi/2","(3pi)/2"], + ["0","0","pi","pi"], + ], + "1/2" => [ + ["pi/6","pi/6","(5pi)/6","(5pi)/6"], + ["pi/3","pi/3","-pi/3","(5pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "-1/2" => [ + ["-pi/6","(11pi)/6","-(5pi)/6","(7pi)/6"], + ["(2pi)/3","(2pi)/3","-(2pi)/3","(4pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(2)/2" => [ + ["pi/4","pi/4","(3pi)/4","(3pi)/4"], + ["pi/4","pi/4","-pi/4","(7pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(2)/2" => [ + ["-pi/4","(7pi)/4","-(3pi)/4","(5pi)/4"], + ["(3pi)/4","(3pi)/4","-(3pi)/4","(5pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(3)/2" => [ + ["pi/3","pi/3","(2pi)/3","(2pi)/3"], + ["pi/6","pi/6","-pi/6","(11pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(3)/2" => [ + ["-pi/3","(5pi)/3","-(2pi)/3","(4pi)/3"], + ["(5pi)/6","(5pi)/6","-(5pi)/6","(7pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "1" => [ + ["pi/2","pi/2","DNE","DNE"], + ["0","0","DNE","DNE"], + ["pi/4","pi/4","(5pi)/4","(5pi)/4"], + ], + "-1" => [ + ["-pi/2","(3pi)/2","DNE","DNE"], + ["pi","pi","DNE","DNE"], + ["-pi/4","(7pi)/4","(3pi)/4","(3pi)/4"], + ], + "sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/6","pi/6","-(5pi)/6","(7pi)/6"], + ], + "-sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/6","(11pi)/6","(5pi)/6","(5pi)/6"], + ], + "sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/3","pi/3","-(2pi)/3","(4pi)/3"], + ], + "-sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/3","(5pi)/3","(2pi)/3","(2pi)/3"], + ], +); + +@hashKeys = lex_sort(keys %values); +do { + $cosValue = $hashKeys[random(0,$#hashKeys,1)]; +} until ($values{$cosValue}[1][0] ne "DNE"); + +$left = "\cos(x)"; +$right = Formula("$cosValue")->TeX; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +Context()->variables->add(k => "Real"); +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +$ans0 = $values{$cosValue}[1][0]; +$ans0alt = $values{$cosValue}[1][1]; +$ans0k = Formula("$ans0+2*k*pi"); +$ans0altk = Formula("$ans0alt+2*k*pi"); + +$ans1 = $values{$cosValue}[1][2]; +if ($cosValue eq "-1") { + $ans = $ans0k; + $ansShow = $ans; +} elsif ($cosValue eq "1") { + $ans = Formula("2*k*pi"); + $ansShow = $ans; +} else { + $ans1alt = $values{$cosValue}[1][3]; + $ans1k = Formula("$ans1+2*k*pi"); + $ans1altk = Formula("$ans1alt+2*k*pi"); + $ans = OneOf( + List($ans0k,$ans1k), + List($ans0altk,$ans1k), + List($ans0k,$ans1altk), + List($ans0altk,$ans1altk) + ); + $ansShow = List(Formula("$ans0+2*k*pi"),Formula("$ans1+2*k*pi")); + if ($cosValue eq "0") { + $ans = OneOf($ans,Formula("pi/2+k*pi")); + } +} + +$r = 5; +$Pr = Compute($ans0); +$Px = $r*cos($Pr); +$Py = $r*sin($Pr); + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph->stamps(closed_circle($Px,$Py,red)); +$graph->moveTo(0,0); +$graph->lineTo($Px,$Py,red,2); +$graph->lineTo($Px,0,red,2); +$graph->lineTo(0,0,red,2); + +if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); +} + +$td = $Py>=0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px,$Py,"P: $ans0",'red','center',$td,large)); + +$alt = "This is the graph of a circle with point P: $ans0 on the circle."; + +if ($ans1 ne "DNE") { + $Qr = Compute($ans1); + $Qx = $r*cos($Qr); + $Qy = $r*sin($Qr); + + $graph->stamps(closed_circle($Qx,$Qy,red)); + $graph->moveTo(0,0); + $graph->lineTo($Qx,$Qy,red,2); + $graph->lineTo($Qx,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Qx!=0) && ($Qy!=0) ) { + $xShift = ($Qx>0) ? -0.4 : 0.4; + $yShift = ($Qy>0) ? 0.4 : -0.4; + $graph->moveTo($Qx,$yShift); + $graph->lineTo($Qx+$xShift,$yShift,red,2); + $graph->lineTo($Qx+$xShift,0,red,2); + } + + $td = $Qy>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Qx,$Qy,"Q: $ans1",'red','center',$td,large)); + + $alt = "This is the graph of a circle with point P: $ans0 and Q: $ans1 on the circle. From each point, a vertical line is drawn until it reaches the x-axis, showing they have the same distance to the x-axis."; +} + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right]``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use [|k*pi|]* to represent multiples of [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +."\n" +.'* Example: type [|3pi/4+2k*pi|]* to represent [`\frac{3\pi}{4}+2k\pi`].' +)@]** + + [`x=`][________________________________________]{$ans->cmp(correct_ans_latex_string=>$ansShow->TeX)} + + +END_PGML + +############################################################## + +Context("LimitedRadical"); +Context()->variables->add(k => "Real"); + +$s1 = Formula("$ans0"); + +if ($values{$cosValue}[0][2] eq "DNE") { + $output0 = "Only one point "; +} else { + $output0 = "Two points "; +} + +$output1 = ""; +if ($values{$cosValue}[1][0] ne $values{$cosValue}[1][1]) { + $output1 = "\text{Note that }".$ans0k->TeX."\text{ and }".$ans0altk->TeX."\text{ are equivalent. }\\"; +} +if ($values{$cosValue}[1][2] ne $values{$cosValue}[1][3]) { + if ($output1 ne "") { + $output1 .= "\text{Also, }"; + } else { + $output1 .= "\text{Note that }"; + } + $output1 .= $ans1k->TeX."\text{ and }".$ans1altk->TeX."\text{ are equivalent.}"; +} + +if ($cosValue eq "0") { + $output1 .= "\\ \text{Also, }x=".$ansShow->TeX."\text{ and }x=".Formula("$ans0+k*pi")->TeX."\text{ are equivalent.}"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + x &= \cos^{-1}\left([$right]\right) \\ + x &= [$s1] + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ 0,\pi \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$left]=[$right]`] true: + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[$output0] on the Unit Circle can make the equation true. The equation's solution is: + + [``x=[$ansShow]\text{, where }k\text{ is any integer.}``] + +[`[$output1]`] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation30.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation30.pg new file mode 100644 index 0000000000..d3acee5bc8 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation30.pg @@ -0,0 +1,293 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + + +Context("LimitedRadical"); + + +%values = ( +#[sin^-1(x), sin^-1(x) in [0,2pi], +#value opposite to sin^-1(x), value opposite to sin^-1(x) in [0,2pi] + "0" => [ + ["0","0","pi","pi"], + ["pi/2","pi/2","-pi/2","(3pi)/2"], + ["0","0","pi","pi"], + ], + "1/2" => [ + ["pi/6","pi/6","(5pi)/6","(5pi)/6"], + ["pi/3","pi/3","-pi/3","(5pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "-1/2" => [ + ["-pi/6","(11pi)/6","-(5pi)/6","(7pi)/6"], + ["(2pi)/3","(2pi)/3","-(2pi)/3","(4pi)/3"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(2)/2" => [ + ["pi/4","pi/4","(3pi)/4","(3pi)/4"], + ["pi/4","pi/4","-pi/4","(7pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(2)/2" => [ + ["-pi/4","(7pi)/4","-(3pi)/4","(5pi)/4"], + ["(3pi)/4","(3pi)/4","-(3pi)/4","(5pi)/4"], + ["DNE","DNE","DNE","DNE"], + ], + "sqrt(3)/2" => [ + ["pi/3","pi/3","(2pi)/3","(2pi)/3"], + ["pi/6","pi/6","-pi/6","(11pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "-sqrt(3)/2" => [ + ["-pi/3","(5pi)/3","-(2pi)/3","(4pi)/3"], + ["(5pi)/6","(5pi)/6","-(5pi)/6","(7pi)/6"], + ["DNE","DNE","DNE","DNE"], + ], + "1" => [ + ["pi/2","pi/2","DNE","DNE"], + ["0","0","DNE","DNE"], + ["pi/4","pi/4","(5pi)/4","(5pi)/4"], + ], + "-1" => [ + ["-pi/2","(3pi)/2","DNE","DNE"], + ["pi","pi","DNE","DNE"], + ["-pi/4","(7pi)/4","(3pi)/4","(3pi)/4"], + ], + "sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/6","pi/6","-(5pi)/6","(7pi)/6"], + ], + "-sqrt(3)/3" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/6","(11pi)/6","(5pi)/6","(5pi)/6"], + ], + "sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["pi/3","pi/3","-(2pi)/3","(4pi)/3"], + ], + "-sqrt(3)" => [ + ["DNE","DNE","DNE","DNE"], + ["DNE","DNE","DNE","DNE"], + ["-pi/3","(5pi)/3","(2pi)/3","(2pi)/3"], + ], +); + +@hashKeys = lex_sort(keys %values); +do { + $tanValue = $hashKeys[random(0,$#hashKeys,1)]; +} until ($values{$tanValue}[2][0] ne "DNE"); + +$left = "\tan(x)"; +$right = Formula("$tanValue")->TeX; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +Context()->variables->add(k => "Real"); +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +$ans0 = $values{$tanValue}[2][0]; +$ans0alt = $values{$tanValue}[2][1]; +$ans0k = Formula("$ans0+k*pi"); +$ans0altk = Formula("$ans0alt+k*pi"); + +$ans = OneOf( $ans0k,$ans0altk ); +$ansShow = List(Formula("$ans0+k*pi")); + +if ($ans0 eq "0") { + $ans = Formula("k*pi"); + $ansShow = $ans; +} + +$r = 5; +$Pr = Compute($ans0); +$Px = $r*cos($Pr); +$Py = $r*sin($Pr); + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph->stamps(closed_circle($Px,$Py,red)); +$graph->moveTo(0,0); +$graph->lineTo($Px,$Py,red,2); +$graph->lineTo($Px,0,red,2); +$graph->lineTo(0,0,red,2); + +if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); +} + +$td = $Py>=0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px,$Py,"P: $ans0",'red','center',$td,large)); + +$alt = "This is the graph of a circle with point P: $ans0 on the circle."; + +$ans1 = $values{$tanValue}[2][2]; +$ans1alt = $values{$tanValue}[2][3]; +$ans1k = Formula("$ans1+k*pi"); +$ans1altk = Formula("$ans1alt+k*pi"); +if ($ans1 ne "DNE") { + $Qr = Compute("$ans1"); + $Qx = $r*cos($Qr); + $Qy = $r*sin($Qr); + + $graph->stamps(closed_circle($Qx,$Qy,red)); + $graph->moveTo(0,0); + $graph->lineTo($Qx,$Qy,red,2); + $graph->lineTo($Qx,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Qx!=0) && ($Qy!=0) ) { + $xShift = ($Qx>0) ? -0.4 : 0.4; + $yShift = ($Qy>0) ? 0.4 : -0.4; + $graph->moveTo($Qx,$yShift); + $graph->lineTo($Qx+$xShift,$yShift,red,2); + $graph->lineTo($Qx+$xShift,0,red,2); + } + + $td = $Qy>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Qx,$Qy,"Q: $ans1",'red','center',$td,large)); + + $alt = "This is the graph of a circle with point P: $ans0 and Q: $ans1 on the circle. From each point, a vertical line is drawn until it reaches the x-axis, showing they have the same distance to the x-axis."; +} + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right]``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Use [|k*pi|]* to represent multiples of [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +."\n" +.'* Example: type [|3pi/4+2k*pi|]* to represent [`\frac{3\pi}{4}+2k\pi`].' +)@]** + + [`x=`][________________________________________]{$ans->cmp(correct_ans_latex_string=>$ansShow->TeX)} + + +END_PGML + +############################################################## + +Context("LimitedRadical"); +Context()->variables->add(k => "Real"); + +$s1 = Formula("$ans0"); +$s2 = Formula("$ans1"); +$s3 = ($tanValue eq "0") ? "" : Formula("$ans0")->TeX."+"; + +if ($values{$tanValue}[2][2] eq "DNE") { + $output0 = "Only one point on the Unit Circle can make the equation true. The equation's solution is:"; +} else { + $output0 = "Although two points on the Unit Circle can make the equation true, the following solution can cover both points:"; +} + +$output1 = ""; +if ($values{$tanValue}[2][0] ne $values{$tanValue}[2][1]) { + $output1 = "\text{Note that }".$ans0k->TeX."\text{ and }".$ans0altk->TeX."\text{ are equivalent. }\\"; +} +if ($values{$tanValue}[2][2] ne $values{$tanValue}[2][3]) { + if ($output1 ne "") { + $output1 .= "\text{Also, }"; + } else { + $output1 .= "\text{Note that }"; + } + $output1 .= $ans1k->TeX."\text{ and }".$ans1altk->TeX."\text{ are equivalent.}"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + x &= \tan^{-1}\left([$right]\right) \\ + x &= [$s1] + \end{aligned}``] + +Recall that the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right) `]. On the Unit Circle, we have to check whether another angle also makes [`[$left]=[$right]`] true: + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[$output0] + + [``x=[$ansShow]\text{, where }k\text{ is any integer.}``] + +[`[$output1]`] + +Unlike solving equations for [`\sin(x)`] and [`\cos(x)`], there is no need to write something like: + + [``x=[$s3]2k\pi, [$s2]+2k\pi``] + +The set above is the same as [``x=[$ansShow]``], because the period of [`f(x)=\tan(x)`] is [`\pi`], while the period of [`\sin(x)`] and [`\cos(x)`] is [`2\pi`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation40.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation40.pg new file mode 100644 index 0000000000..77241d4c5b --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation40.pg @@ -0,0 +1,290 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +%values = ( +#key is trig value +#first array: [num string, den string, num value, den value +#second array: [TeX sin^-1, string sin^-1, 1st solution, 2nd solution] +#third array: [TeX cos^-1, string cos^-1, 1st solution, 2nd solution] +#fourth array: [TeX tan^-1, string tan^-1, 1st solution, 2nd solution] + "1/2" => [ + ["1","2",Formula("1"),Formula("2")], + ["\frac{\pi}{6}","pi/6","pi/6","(5pi)/6"], + ["\frac{\pi}{3}","pi/3","pi/3","(5pi)/3"], + ["DNE"], + ], + "-1/2" => [ + ["-1","2",Formula("-1"),Formula("2")], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6","(7pi)/6"], + ["\frac{2\pi}{3}","(2pi)/3","(2pi)/3","(4pi)/3"], + ["DNE"], + ], + "sqrt(2)/2" => [ + ["\sqrt{2}","2",Formula("sqrt(2)"),Formula("2")], + ["\frac{\pi}{4}","pi/4","pi/4","(3pi)/4"], + ["\frac{\pi}{4}","pi/4","pi/4","(7pi)/4"], + ["DNE"], + ], + "-sqrt(2)/2" => [ + ["-\sqrt{2}","2",Formula("-sqrt(2)"),Formula("2")], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4","(5pi)/4"], + ["\frac{3\pi}{4}","(3pi)/4","(3pi)/4","(5pi)/4"], + ["DNE"], + ], + "sqrt(3)/2" => [ + ["\sqrt{3}","2",Formula("sqrt(3)"),Formula("2")], + ["\frac{\pi}{3}","pi/3","pi/3","(2pi)/3"], + ["\frac{\pi}{6}","pi/6","pi/6","(11pi)/6"], + ["DNE"], + ], + "-sqrt(3)/2" => [ + ["-\sqrt{3}","2",Formula("-sqrt(3)"),Formula("2")], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3","(4pi)/3"], + ["\frac{5\pi}{6}","(5pi)/6","(5pi)/6","(7pi)/6"], + ["DNE"], + ], + "1" => [ + ["1","1",Formula("1"),Formula("1")], + ["\frac{\pi}{2}","pi/2","pi/2","DNE"], + ["0","0","0","DNE"], + ["\frac{\pi}{4}","pi/4","pi/4","(5pi)/4"], + ], + "-1" => [ + ["-1","1",Formula("-1"),Formula("1")], + ["-\frac{\pi}{2}","-pi/2","(3pi)/2","DNE"], + ["\pi","pi","pi","DNE"], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4","(3pi)/4"], + ], + "sqrt(3)/3" => [ + ["\sqrt{3}","3",Formula("sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{6}","pi/6","pi/6","(7pi)/6"], + ], + "-sqrt(3)/3" => [ + ["-\sqrt{3}","3",Formula("-sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6","(5pi)/6"], + ], + "sqrt(3)" => [ + ["\sqrt{3}","1",Formula("sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{3}","pi/3","pi/3","(4pi)/3"], + ], + "-sqrt(3)" => [ + ["-\sqrt{3}","1",Formula("-sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3","(2pi)/3"], + ], +); + +@hashKeys = lex_sort(keys %values); +do { + $sinValue = $hashKeys[random(0,$#hashKeys,1)]; +} until ($values{$sinValue}[1][0] ne "DNE"); + +($aT,$bT) = ($values{$sinValue}[0][0],$values{$sinValue}[0][1]); +($a,$b) = ($values{$sinValue}[0][2],$values{$sinValue}[0][3]); + +if ($a==1) { + $left = "\csc(x)-$bT"; +} elsif ($a==-1) { + $left = "-\csc(x)-$bT"; +} else { + $left = "$aT\cdot\csc(x)-$bT"; +} +$right = 0; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +@ans = (); +$ans[0] = $values{$sinValue}[1][2]; +$ans[1] = $values{$sinValue}[1][3]; + +$points = ""; +if ($ans[1] eq "DNE") { + $ans = Formula($ans[0]); + $points = "point $ans[0]"; +} else { + $ans = List(Formula($ans[0]),Formula($ans[1])); + $points = "points $ans[0], $ans[1]"; +} + +$r = 5; +$Pr = Formula($ans[0]); +$Px = Compute("$r*cos($Pr)")->reduce; +$Py = Compute("$r*sin($Pr)")->reduce; + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..1) { + if ($ans[$i] eq 'DNE') {next;} + $Pr = Formula($ans[$i]); + $Px = Compute("$r*cos($Pr)")->reduce; + $Py = Compute("$r*sin($Pr)")->reduce; + $graph->stamps(closed_circle($Px,$Py,red)); + $graph->moveTo(0,0); + $graph->lineTo($Px,$Py,red,2); + $graph->lineTo($Px,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Px,$Py,"$ans[$i]",'red','center',$td,large)); +} + +$alt = "This is the graph of a circle with $points on the circle."; + +if ( ($sinValue ne "1") && ($sinValue ne "-1") ) { + $alt .= " From each point, a vertical line is drawn until it reaches the x-axis, showing they have the same distance to the x-axis."; +} + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right]\text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +sub fracDisplay { + my ($m, $n) = @_; + if ($n eq "1") { + return $m; + } + if ($n eq "-1") { + if (substr($m,0,1) eq '-') { + return substr($m,1); + } else { + return "-$m"; + } + } + if ( (substr($m,0,1) ne '-') && (substr($n,0,1) ne '-') ) { + return "\frac{$m}{$n}"; + } + if (substr($m,0,1) eq '-') { + return "-\frac{".substr($m,1)."}{$n}"; + } + if (substr($n,0,1) eq '-') { + return "-\frac{$m}{".substr($n,1)."}"; + } + +} + +$s1 = fracDisplay($bT,$aT); +$s2 = fracDisplay($aT,$bT); + +$output1 = ""; +if (substr($values{$sinValue}[1][0],0,1) eq '-') { + my $a = Formula($ans[0]); + $output1 .= "\text{But }x\in[0,2\pi),\text{ so we have to change }".$values{$sinValue}[1][0]."\text{ into that range by }\\".$values{$sinValue}[1][0]."+2\pi=".$a->TeX; +} + + + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + \csc(x) &= [$s1] \\ + \frac{1}{\sin(x)} &= [$s1] \\ + \sin(x) &= [$s2] \\ + x &= \sin^{-1}\left([$s2]\right) \\ + x &= [$values{$sinValue}[1][0]] + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. [`[$output1]`] + +On the Unit Circle, we have to check whether another angle in [`x\in[0,2\pi)`] also makes [`[$left]=[$right]`] true: + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The solution of the equation [`[$left]=[$right]`], where [`x\in[0,2\pi)`], is: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation50.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation50.pg new file mode 100644 index 0000000000..5fea0d1d7f --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation50.pg @@ -0,0 +1,312 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +%values = ( +#key is trig value +#first array: [num string, den string, num value, den value +#second array: [TeX sin^-1, string sin^-1, 1st solution, 2nd solution] +#third array: [TeX cos^-1, string cos^-1, 1st solution, 2nd solution] +#fourth array: [TeX tan^-1, string tan^-1, 1st solution, 2nd solution] + "1/2" => [ + ["1","2",Formula("1"),Formula("2")], + ["\frac{\pi}{6}","pi/6","pi/6","(5pi)/6"], + ["\frac{\pi}{3}","pi/3","pi/3","(5pi)/3"], + ["DNE"], + ], + "-1/2" => [ + ["-1","2",Formula("-1"),Formula("2")], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6","(7pi)/6"], + ["\frac{2\pi}{3}","(2pi)/3","(2pi)/3","(4pi)/3"], + ["DNE"], + ], + "sqrt(2)/2" => [ + ["\sqrt{2}","2",Formula("sqrt(2)"),Formula("2")], + ["\frac{\pi}{4}","pi/4","pi/4","(3pi)/4"], + ["\frac{\pi}{4}","pi/4","pi/4","(7pi)/4"], + ["DNE"], + ], + "-sqrt(2)/2" => [ + ["-\sqrt{2}","2",Formula("-sqrt(2)"),Formula("2")], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4","(5pi)/4"], + ["\frac{3\pi}{4}","(3pi)/4","(3pi)/4","(5pi)/4"], + ["DNE"], + ], + "sqrt(3)/2" => [ + ["\sqrt{3}","2",Formula("sqrt(3)"),Formula("2")], + ["\frac{\pi}{3}","pi/3","pi/3","(2pi)/3"], + ["\frac{\pi}{6}","pi/6","pi/6","(11pi)/6"], + ["DNE"], + ], + "-sqrt(3)/2" => [ + ["-\sqrt{3}","2",Formula("-sqrt(3)"),Formula("2")], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3","(4pi)/3"], + ["\frac{5\pi}{6}","(5pi)/6","(5pi)/6","(7pi)/6"], + ["DNE"], + ], + "1" => [ + ["1","1",Formula("1"),Formula("1")], + ["\frac{\pi}{2}","pi/2","pi/2","DNE"], + ["0","0","0","DNE"], + ["\frac{\pi}{4}","pi/4","pi/4","(5pi)/4"], + ], + "-1" => [ + ["-1","1",Formula("-1"),Formula("1")], + ["-\frac{\pi}{2}","-pi/2","(3pi)/2","DNE"], + ["\pi","pi","pi","DNE"], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4","(3pi)/4"], + ], + "sqrt(3)/3" => [ + ["\sqrt{3}","3",Formula("sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{6}","pi/6","pi/6","(7pi)/6"], + ], + "-sqrt(3)/3" => [ + ["-\sqrt{3}","3",Formula("-sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6","(5pi)/6"], + ], + "sqrt(3)" => [ + ["\sqrt{3}","1",Formula("sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{3}","pi/3","pi/3","(4pi)/3"], + ], + "-sqrt(3)" => [ + ["-\sqrt{3}","1",Formula("-sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3","(2pi)/3"], + ], +); + +@cosValue = (); + +@hashKeys = lex_sort(keys %values); +do { + $cosValue[0] = $hashKeys[random(0,$#hashKeys,1)]; +} until ( + (substr($cosValue[0],0,1) ne '-') + && ($values{$cosValue[0]}[2][0] ne "DNE") +); +$cosValue[1] = '-'.$cosValue[0]; + +@a = (); +@b = (); +@aT = (); +@bT = (); + +for my $i (0..1) { + ($aT[$i],$bT[$i]) = ($values{$cosValue[$i]}[0][0],$values{$cosValue[$i]}[0][1]); + ($a[$i],$b[$i]) = ($values{$cosValue[$i]}[0][2],$values{$cosValue[$i]}[0][3]); +} + + +$a2 = Compute("($a[0])**2"); +$b2 = Compute("($b[0])**2"); + +if ($a2==1) { + $left = "\sec^2(x)-$b2"; +} elsif ($a2==-1) { + $left = "-\sec^2(x)-$b2"; +} else { + $left = "$a2\cdot\sec^2(x)-$b2"; +} +$right = 0; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +@ans = (); +$ans[0] = $values{$cosValue[0]}[2][2]; +$ans[1] = $values{$cosValue[0]}[2][3]; +$ans[2] = $values{$cosValue[1]}[2][2]; +$ans[3] = $values{$cosValue[1]}[2][3]; + +@ansT = (); +for my $i (0..3) { + if ($ans[$i] eq "DNE") {next;} + $ansT[$i] = Formula($ans[$i]); +} + +$points = ""; +if ($ans[1] eq "DNE") { + $ansF = List($ansT[0],$ansT[2]); + $points = "$ans[0], $ans[2]"; +} else { + $ansF = List($ansT[0],$ansT[1],$ansT[2],$ansT[3]); + $points = "$ans[0], $ans[1], $ans[2] and $ans[3]"; +} + +$r = 5; + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..3) { + if ($ans[$i] eq 'DNE') {next;} + $Pr = Formula($ans[$i]); + $Px = Compute("$r*cos($Pr)")->reduce; + $Py = Compute("$r*sin($Pr)")->reduce; + $graph->stamps(closed_circle($Px,$Py,red)); + $graph->moveTo(0,0); + $graph->lineTo($Px,$Py,red,2); + $graph->lineTo($Px,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Px,$Py,"$ans[$i]",'red','center',$td,large)); +} + +$alt = "This is the graph of a circle with points $points on the circle."; + +if ($cosValue[0] ne "1") { + $alt .= " From each point, a vertical line is drawn until it reaches the x-axis, showing they have the same distance to the x-axis."; +} + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +$test = $values{"1"}[2][3] eq "DNE"; + +############################################################## + +BEGIN_PGML + + + +Solve the equation + + [``[$left]=[$right]\text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ansF} + + +END_PGML + +############################################################## + +sub fracDisplay { + my ($m, $n) = @_; + if ($n eq "1") { + return $m; + } + if ($n eq "-1") { + if (substr($m,0,1) eq '-') { + return substr($m,1); + } else { + return "-$m"; + } + } + if ( (substr($m,0,1) ne '-') && (substr($n,0,1) ne '-') ) { + return "\frac{$m}{$n}"; + } + if (substr($m,0,1) eq '-') { + return "-\frac{".substr($m,1)."}{$n}"; + } + if (substr($n,0,1) eq '-') { + return "-\frac{$m}{".substr($n,1)."}"; + } + +} + +$s1 = fracDisplay($b2,$a2); +$s2 = fracDisplay($a2,$b2); +$s3 = fracDisplay($aT[0],$bT[0]); +$s4 = fracDisplay($aT[1],$bT[1]); + + + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + \sec^2(x) &= [$s1] \\ + \frac{1}{\cos^2(x)} &= [$s1] \\ + \cos^2(x) &= [$s2] \\ + \cos(x) &= [$s3]\text{ or }\cos(x)=[$s4] \\ + x &= \cos^{-1}\left([$s3]\right) \text{ or }x=\cos^{-1}\left([$s4]\right)\\ + x &= [$ansT[0]] \text{ or } [$ansT[2]] + \end{aligned}``] + +Recall that the range of [`\cos^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. + +On the Unit Circle, we have to check whether other angles in [`x\in[0,2\pi)`] also makes [`[$left]=[$right]`] true: + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The solution of the equation [`[$left]=[$right]`], where [`x\in[0,2\pi)`], is: [`x=[$ansF]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation60.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation60.pg new file mode 100644 index 0000000000..99638fc106 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation60.pg @@ -0,0 +1,268 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); + +%values = ( +#key is trig value +#first array: [num string, den string, num value, den value +#second array: [TeX sin^-1, string sin^-1, 1st solution, 2nd solution] +#third array: [TeX cos^-1, string cos^-1, 1st solution, 2nd solution] +#fourth array: [TeX tan^-1, string tan^-1, solution] + "1/2" => [ + ["1","2",Formula("1"),Formula("2")], + ["\frac{\pi}{6}","pi/6","pi/6","(5pi)/6"], + ["\frac{\pi}{3}","pi/3","pi/3","(5pi)/3"], + ["DNE"], + ], + "-1/2" => [ + ["-1","2",Formula("-1"),Formula("2")], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6","(7pi)/6"], + ["\frac{2\pi}{3}","(2pi)/3","(2pi)/3","(4pi)/3"], + ["DNE"], + ], + "sqrt(2)/2" => [ + ["\sqrt{2}","2",Formula("sqrt(2)"),Formula("2")], + ["\frac{\pi}{4}","pi/4","pi/4","(3pi)/4"], + ["\frac{\pi}{4}","pi/4","pi/4","(7pi)/4"], + ["DNE"], + ], + "-sqrt(2)/2" => [ + ["-\sqrt{2}","2",Formula("-sqrt(2)"),Formula("2")], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4","(5pi)/4"], + ["\frac{3\pi}{4}","(3pi)/4","(3pi)/4","(5pi)/4"], + ["DNE"], + ], + "sqrt(3)/2" => [ + ["\sqrt{3}","2",Formula("sqrt(3)"),Formula("2")], + ["\frac{\pi}{3}","pi/3","pi/3","(2pi)/3"], + ["\frac{\pi}{6}","pi/6","pi/6","(11pi)/6"], + ["DNE"], + ], + "-sqrt(3)/2" => [ + ["-\sqrt{3}","2",Formula("-sqrt(3)"),Formula("2")], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3","(4pi)/3"], + ["\frac{5\pi}{6}","(5pi)/6","(5pi)/6","(7pi)/6"], + ["DNE"], + ], + "1" => [ + ["1","1",Formula("1"),Formula("1")], + ["\frac{\pi}{2}","pi/2","pi/2","DNE"], + ["0","0","0","DNE"], + ["\frac{\pi}{4}","pi/4","pi/4"], + ], + "-1" => [ + ["-1","1",Formula("-1"),Formula("1")], + ["-\frac{\pi}{2}","-pi/2","(3pi)/2","DNE"], + ["\pi","pi","pi","DNE"], + ["-\frac{\pi}{4}","-pi/4","(7pi)/4"], + ], + "sqrt(3)/3" => [ + ["\sqrt{3}","3",Formula("sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{6}","pi/6","pi/6"], + ], + "-sqrt(3)/3" => [ + ["-\sqrt{3}","3",Formula("-sqrt(3)"),Formula("3")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{6}","-pi/6","(11pi)/6"], + ], + "sqrt(3)" => [ + ["\sqrt{3}","1",Formula("sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["\frac{\pi}{3}","pi/3","pi/3"], + ], + "-sqrt(3)" => [ + ["-\sqrt{3}","1",Formula("-sqrt(3)"),Formula("1")], + ["DNE"], + ["DNE"], + ["-\frac{\pi}{3}","-pi/3","(5pi)/3"], + ], +); + +@hashKeys = lex_sort(keys %values); +do { + $tanValue = $hashKeys[random(0,$#hashKeys,1)]; +} until ($values{$tanValue}[3][0] ne "DNE"); + +%flip = ( + "1" => "1", + "-1" => "-1", + "sqrt(3)/3" => "\sqrt{3}", + "-sqrt(3)/3" => "-\sqrt{3}", + "sqrt(3)" => "\frac{1}{\sqrt{3}}", + "-sqrt(3)" => "-\frac{1}{\sqrt{3}}", +); + +$a = 2; + +$left = "\cot($a x)"; +$right = $flip{$tanValue}; + +Context()->strings->add("no solution"=>{}, +"no solutions"=>{alias=>'no solution'}, +"none"=>{alias=>'no solution'}, +); + +#ansax is the solution of the "2x" part of cot(2x)=right +$ansax = Compute("$values{$tanValue}[3][1]"); +#$ansaxd is the first part of the solution after dividing by $a +$ansaxd = specialAngle($ansax/$a,2,3,4,5,6,8,9,10,12,18); + +@k = (); +@ansF = (); +for my $i (-4..4) { + my $f = specialAngle(pi*$i/$a+$ansax/$a,2,3,4,5,6,8,9,10,12,18); + if ( ($f>0) && ($f<2*pi) ) { + $ansF[$#ansF+1]= $f; + $k[scalar(@k)] = $i; + } +} +@ansF = num_sort(@ansF); +@ansF = do { my %seen; grep { !$seen{$_}++ } @ansF }; +$points = ""; +for my $i (0..$#ansF) { + $points .= "$ansF[$i], "; +} +$points = substr($points,0,length($points)-2); +$ans = List(@ansF); + +$r = 5; +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..$#ansF) { + $Px = Compute("$r*cos($ansF[$i])")->reduce; + $Py = Compute("$r*sin($ansF[$i])")->reduce; + $graph->stamps(closed_circle($Px,$Py,red)); + $graph->moveTo(0,0); + $graph->lineTo($Px,$Py,red,2); + $graph->lineTo($Px,0,red,2); + $graph->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph->moveTo($Px,$yShift); + $graph->lineTo($Px+$xShift,$yShift,red,2); + $graph->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph->lb(new Label($Px,$Py,"$ansF[$i]",'red','center',$td,large)); +} + +$alt = "This is the graph of a circle with points $points on the circle."; + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right]\text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|pi/4, 3pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +($n,$d) = ($values{$tanValue}[0][0],$values{$tanValue}[0][1]); +if (substr($n,0,1) eq '-') { + $n = substr($n,1); + $s1 = ($d==1) ? "-$n" : "-\frac{$n}{$d}"; +} else { + $s1 = ($d==1) ? "$n" : "\frac{$n}{$d}"; +} + +$s2 = ""; +for my $i (0..scalar(@k)-1) { + $s2 .= "x &= ".$ansaxd->TeX."+\frac{($k[$i])\pi}{$a} = ".$ansF[$i]->TeX." \\"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + \frac{1}{\tan([$a]x)} &= [$right] \\ + \tan([$a]x) &= [$s1] \\ + [$a]x &= \tan^{-1}\left([$s1]\right) \\ + [$a]x &= [$values{$tanValue}[3][0]]+k\pi \\ + x &= [$ansaxd] +\frac{k\pi}{[$a]} + \end{aligned}``] + +Next, we need to substitute in different [`k`] values to find all solutions in the range [`x\in[0,2\pi)`]: + + [``\begin{aligned} + [$s2] + \end{aligned}``] + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The solution of the equation [`[$left]=[$right]`], where [`x\in[0,2\pi)`], is: [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation70.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation70.pg new file mode 100644 index 0000000000..f387e05251 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation70.pg @@ -0,0 +1,218 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 1, + reduceConstantFunctions => 0, +); + +@values = ( + Compute("1"),-Compute("1"),Compute("0"), + Compute("1/2"),-Compute("1/2"), + Compute("sqrt(2)/2"),-Compute("sqrt(2)/2"), + Compute("sqrt(3)/2"),-Compute("sqrt(3)/2"), +); + +$c = random(-1,1,2)*list_random(2,3,4,6); +$cN = -$c; +$a = $c>0 ? "x+\frac{\pi}{$c}" : "x-\frac{\pi}{$cN}"; + +$left = "\sin($a)"; +$right = specialRadical(list_random(@values)); + +@ansL = (); +@points = (); + +$ansL[0][0] = specialAngle(arcsin(Compute("$right"))); +if ($ansL[0][0]>=0) { + $ansL[0][1] = specialAngle(Compute("pi-$ansL[0][0]")); +} else { + $ansL[0][1] = specialAngle(Compute("-pi-$ansL[0][0]")); +} + +@start = (); +$start[0] = specialAngle(Compute("$ansL[0][0]-pi/$c"),(1..12)); +$start[1] = ""; +if ($ansL[0][0] == $ansL[0][1]) { + $points[0] = "$ansL[0][0]"; +} else { + $points[0] = "$ansL[0][0] and $ansL[0][1]"; + $start[1] = specialAngle(Compute("$ansL[0][1]-pi/$c"),(1..12)); +} + +@k = (); +for my $i (-1..1) { + my $a = Compute("$start[0]")+2*$i*pi; + if ( ($a>=0) && ($a<2*pi) ) { + $ansL[1][scalar(@{$ansL[1]})] = specialAngle($a,(1..12)); + $k[0][scalar(@{$k[0]})] = $i; + } + if ($start[1] ne "") { + my $b = Compute($start[1]->string)+2*$i*pi; + if ( ($b>0) && ($b<2*pi) ) { + $ansL[1][scalar(@{$ansL[1]})] = specialAngle($b,(1..12)); + $k[1][scalar(@{$k[1]})] = $i; + } + } +} +$ans = List(@{$ansL[1]}); + +$r = 5; +for my $i (0..1) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$ansL[$i]})-1) { + $Px = Compute("$r*cos($ansL[$i][$j])")->reduce; + $Py = Compute("$r*sin($ansL[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$ansL[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|-pi/4,pi/4|]*.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +if ($start[1] ne "") { + $o1 = $ansL[0][0]->TeX."+2k\pi \text{ or } ".$ansL[0][1]->TeX." +2k\pi"; + $o2 = $start[0]->TeX."+2k\pi \text{ or } ".$start[1]->TeX." +2k\pi"; + $o3 = "Solutions are "; +} else { + $o1 = $ansL[0][0]->TeX."+2k\pi"; + $o2 = $start[0]->TeX."+2k\pi"; + $o3 = "The solution is "; +} + +$output = ""; +$p = 0; +for my $i (0..scalar(@k)-1) { + for my $j (0..scalar(@{$k[$i]})-1) { + $o4 .= "x &= ".$start[$i]->TeX."+2($k[$i][$j])\pi = ".$ansL[1][$p++]->TeX." \\"; + } +} + + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + [$a] &= \sin^{-1}\left([$right]\right) \\ + [$a] &= [$ansL[0][0]] + \end{aligned}``] + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. On the Unit Circle, we have to check whether another angle also makes [`[$left] = [$right]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + [$a] &= \sin^{-1}\left([$right]\right) \\ + [$a] &= [$o1] \\ + x &= [$o2] + \end{aligned}``] + +Next, substitute in different [`k`] values to locate all solutions in [`[0,2\pi)`]: + + [``\begin{aligned} [$o4] \end{aligned}``] + +>>[@ $fig[1] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[$o3] [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation80.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation80.pg new file mode 100644 index 0000000000..5fbed179b3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation80.pg @@ -0,0 +1,207 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "PCCmacros.pl", + "parserOneOf.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +do { + $a = non_zero_random(-10,10,1); + $b = non_zero_random(-10,10,1); + $c = non_zero_random(-10,10,1); + $d = non_zero_random(-10,10,1); +} until ($d-$b != 0) && ($a-$c != 0); + +$e = "$a\tan(x)"; +if ($a==-1) {$e = "-\tan(x)";} + elsif ($a==1) {$e = "\tan(x)";} +$f = "$c\tan(x)"; +if ($c==-1) {$f = "-\tan(x)";} + elsif ($c==1) {$f = "\tan(x)";} +$left = "$e+$b"; +$right = "$f+$d"; + +@ansL = (); +@ansLShow = (); +@points = (); + +$start = arctan(($d-$b)/($a-$c)); + +$points = ""; +@k = (); +for my $i (-2..2) { + my $a = $start+$i*pi; + if ( ($a>=0) && ($a<2*pi) ) { + $k[scalar(@k)] = $i; + $ansL[scalar(@ansL)] = $a; + $ansLShow[scalar(@ansLShow)] = Round($a,2); + $points .= Round($a,2).", "; + } +} +$points = substr($points,0,length($points)-2); +$points .= " radians"; +$ans = List(@ansL); + +$r = 5; +for my $i (0..0) { + $graph[$i] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@ansL)-1) { + $Px = Compute("$r*cos($ansL[$j])")->reduce; + $Py = Compute("$r*sin($ansL[$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$ansLShow[$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points representing $points on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,2\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|1.12, 3.24|]*.' +."\n" +.'* Use a calculator to calculate inverse trigonometry values.' +."\n" +.'* Type radian answers. There is no need to use [`\pi`] in your answers.' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$o1 = Fraction($d-$b,$a-$c)->reduce; +$o2 = $a-$c; +$o3 = $d-$b; +if ($o3==-1) { + $o4 = "-\tan(x) &= $o3 \\ \tan(x) &= ".$o1->TeX." \\"; +} elsif ($o2==1) { + $o4 = "\tan(x) &= ".$o1->TeX." \\"; +} else { + $o4 = "$o2\tan(x) &= $o3 \\ \tan(x) &= ".$o1->TeX." \\"; +} +$o5 = Round($start,6); +if (scalar(@ansL)==1) { + $o6 = "The solution is "; +} else { + $o6 = "Solutions are "; +} + +$o7 = ""; +for my $i (0..scalar(@k)-1) { + $o7 .= "x &= $o5+($k[$i])\pi = $ansLShow[$i] \\"; +} + +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + [$e]-[$f] &= [$d]-[$b] \\ + [$o4] + x &= \tan^{-1}\left([$o1]\right) \\ + x &= [$o5]+k\pi + \end{aligned}``] + +In the last step, we used a calculator's inverse tangent function to calculate [`\tan^{-1}\left([$o1]\right) = [$o5]`]. + +Recall that the range of [`\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right) `]. We will substitute in different [`k`] values and find all solutions, in [`[0,2\pi)`], which make [`[$left] = [$right]`] true: + + [``\begin{aligned} + [$o7] + \end{aligned}``] + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[$o6] [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation90.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation90.pg new file mode 100644 index 0000000000..7476b7b815 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigEquation/TrigEquation90.pg @@ -0,0 +1,187 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "contextFraction.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$left = "\sin(\pi x)"; +$right = random(-0.9,0.9,0.01); + +@ansL = (); +@ansLShow = (); +@points = (); + +$ansL[0][0] = arcsin($right); +if ($ansL[0][0]>0) {$ansL[0][1] = pi-$ansL[0][0];} + else {$ansL[0][1] = -pi-$ansL[0][0];} +$ansLShow[0][0] = Round($ansL[0][0],2); +$ansLShow[0][1] = Round($ansL[0][1],2); +$points[0] = "$ansLShow[0][0] and $ansLShow[0][1] radians"; + +@start = (); +$start[0] = $ansL[0][0]/pi; +$start[1] = $ansL[0][1]/pi; + +@k = (); +for my $i (0..1) { + for my $j (-3..3) { + my $a = $start[$i]+2*$j; + if ( ($a>=0) && ($a[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + for my $j (0..scalar(@{$ansL[$i]})-1) { + $Px = Compute("$r*cos($ansL[$i][$j])")->reduce; + $Py = Compute("$r*sin($ansL[$i][$j])")->reduce; + $graph[$i]->stamps(closed_circle($Px,$Py,red)); + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Px,$Py,red,2); + $graph[$i]->lineTo($Px,0,red,2); + $graph[$i]->lineTo(0,0,red,2); + + if ( ($Px!=0) && ($Py!=0) ) { + $xShift = ($Px>0) ? -0.4 : 0.4; + $yShift = ($Py>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Px,$yShift); + $graph[$i]->lineTo($Px+$xShift,$yShift,red,2); + $graph[$i]->lineTo($Px+$xShift,0,red,2); + } + + $td = $Py>=0 ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($Px,$Py,"$ansLShow[$i][$j]",'red','center',$td,large)); + } + + $alt[$i] = "This is the graph of a circle with points representing $points[$i] on the circle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + + +############################################################## + +BEGIN_PGML + +Solve the equation + + [``[$left]=[$right] \text{ where }x\in[0,\pi)``] + +[@KeyboardInstructions( +"\n" +.'* Enter multiple answers separated by commas, as in [|1.12, 3.24|]*.' +."\n" +.'* Use a calculator to calculate inverse trigonometry values.' +."\n" +.'* Type radian answers. There is no need to use [`\pi`] in your answers.' +."\n" +.'* Type [|no solution|]* if there is no solution.' +)@]** + + [`x=`][________________________________________]{$ans} + + +END_PGML + +############################################################## + +$output = ""; +$p = 0; +for my $i (0..scalar(@k)-1) { + for my $j (0..scalar(@{$k[$i]})-1) { + $output .= "x &= $start[$i]+2($k[$i][$j]) = $ansLShow[1][$p++] \\"; + } +} +############################################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$left] &= [$right] \\ + \pi x &= \sin^{-1}([$right]) \\ + \pi x &= [$ansL[0][0]] + \end{aligned}``] + +In the last step, we used a calculator's inverse sine function to calculate [`\sin^{-1}\left([$right]\right) = [$ansL[0][0]]`]. + +Recall that the range of [`\sin^{-1}(x)`] is [`\left[ -\frac{\pi}{2},\frac{\pi}{2} \right] `]. We need to find all values on the Unit Circle which makes [`[$left] = [$right]`] true: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +We have: + + [``\begin{aligned} + [$left] &= [$right] \\ + \pi x &= \sin^{-1}([$right]) \\ + \pi x &= [$ansL[0][0]] +2k\pi \text{ or } [$ansL[0][1]] +2k\pi \\ + x &= [$start[0]] + 2k \text{ or } [$start[1]] +2k + \end{aligned}``] + +We will substitute in different [`k`] values and find all solutions, in [`[0,\pi)`], which make [`[$left] = [$right]`] true: + + [``\begin{aligned} + [$output] + \end{aligned}``] + +Solutions are [`[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties10.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties10.pg new file mode 100644 index 0000000000..745112cd8d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties10.pg @@ -0,0 +1,182 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$cfAbs = abs($cf); +do {$d = random(-5,5,1);} until ($a != $d); + +$bcf = $b*$cf; +$bcfIn = &input($bcf); +$func0 = Compute("$a*sin($b*x-$bcfIn)+$d")->reduce; +$cfIn = &input($cf); +$func1 = Compute("$a*sin($b*(x-$cfIn))+$d")->reduce; +$func2 = Compute("$a*sin($b*x)+$d")->reduce; + +if ($pf == 1) { + $pAns = Compute("pi"); +} elsif ($pf == -1) { + $pAns = Compute("-pi"); +} else { + $pAns = Compute("$pf*pi"); +} +$pfShow = &output($pf); + +$lr = ($cf>0) ? "right" : "left"; +$shift = Compute("$cfAbs*pi"); +$shiftShow = &output($cfAbs); + + +############################################################## + +BEGIN_PGML + +Based on the given function + + [`` f(x) = [$func0] ``], + +fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pAns}. + +d) To transform [`g(x)=[$func2]`] to [`f(x)=[$func0]`], we could shift the graph of [`g(x)`] to the [$lr] by [______]{$shift} units. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +We have to factor to change the function to the form of + + [``f(x) = A\sin(B(x-C))+D``] + +In [`f(x)=[$func0]`], factor out [`[$b]`], we have: + + [``f(x)=[$func1]``] + +###Part a + +By [`f(x)=[$func1]`], the function's midline is [`y=[$d]`]. + +###Part b + +By [`f(x)=[$func1]`], the function's amplitude is [`[$a]`]. + +###Part c + +If the function's formula is [`f(x)=A\sin(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{2\pi}{[$b]} = [$pfShow]``] + +###Part d + +Compare + + [`` g(x)=[$func2] ``] + +with + + [`` f(x)=[$func1] ``], + +we could shift the graph of [`g(x)`] to the [$lr] by [`[$shiftShow]`] units. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties20.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties20.pg new file mode 100644 index 0000000000..27a8431910 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties20.pg @@ -0,0 +1,174 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$bShow = &output($b); + +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$cfAbs = abs($cf); +do {$d = random(-5,5,1);} until ($a != $d); + +$bIn = &input($b); +$bcf = $b*$cf; +$bcfIn = &input($bcf); +$func0 = Compute("$a*sin($bIn*x-$bcfIn)+$d")->reduce; +$func1 = Compute("$a*sin($bIn*(x-$cf))+$d")->reduce; +$func2 = Compute("$a*sin($bIn*x)+$d")->reduce; + +$lr = ($cf>0) ? "right" : "left"; +$shift = Compute("$cfAbs"); + + +############################################################## + +BEGIN_PGML + +Based on the given function + + [`` f(x) = [$func0] ``], + +fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pf}. + +d) To transform [`g(x)=[$func2]`] to [`f(x)=[$func0]`], we could shift the graph of [`g(x)`] to the [$lr] by [______]{$shift} units. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +We have to factor to change the function to the form of + + [``f(x) = A\sin(B(x-C))+D``] + +In [`f(x)=[$func0]`], factor out [`[$bShow]`], we have: + + [``f(x)=[$func1]``] + +###Part a + +By [`f(x)=[$func1]`], the function's midline is [`y=[$d]`]. + +###Part b + +By [`f(x)=[$func1]`], the function's amplitude is [`[$a]`]. + +###Part c + +If the function's formula is [`f(x)=A\sin(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{2\pi}{[$bShow]} = [$pf]``] + +###Part d + +Compare + + [`` g(x)=[$func2] ``] + +with + + [`` f(x)=[$func1] ``], + +we could shift the graph of [`g(x)`] to the [$lr] by [`[$shift]`] units. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties30.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties30.pg new file mode 100644 index 0000000000..8ee2ea11b9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties30.pg @@ -0,0 +1,176 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$pf = (1/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$cfAbs = abs($cf); +do {$d = random(-5,5,1);} until ($a != $d); + +$bcf = $b*$cf; +$bcfIn = &input($bcf); +$func0 = Compute("$a*tan($b*x-$bcfIn)+$d")->reduce; +$cfIn = &input($cf); +$func1 = Compute("$a*tan($b*(x-$cfIn))+$d")->reduce; +$func2 = Compute("$a*tan($b*x)+$d")->reduce; + +if ($pf == 1) { + $pAns = Compute("pi"); +} elsif ($pf == -1) { + $pAns = Compute("-pi"); +} else { + $pAns = Compute("$pf*pi"); +} +$pfShow = &output($pf); + +$lr = ($cf>0) ? "right" : "left"; +$shift = Compute("$cfAbs*pi"); +$shiftShow = &output($cfAbs); + + +############################################################## + +BEGIN_PGML + +Based on the given function + + [`` f(x) = [$func0] ``], + +fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's period is [______]{$pAns}. + +c) To transform [`g(x)=[$func2]`] to [`f(x)=[$func0]`], we could shift the graph of [`g(x)`] to the [$lr] by [______]{$shift} units. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +We have to factor to change the function to the form of + + [``f(x) = A\tan(B(x-C))+D``] + +In [`f(x)=[$func0]`], factor out [`[$b]`], we have: + + [``f(x)=[$func1]``] + +###Part a + +By [`f(x)=[$func1]`], the function's midline is [`y=[$d]`]. + +###Part b + +If the function's formula is [`f(x)=A\tan(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{\pi}{[$b]} = [$pfShow]``] + +###Part c + +Compare + + [`` g(x)=[$func2] ``] + +with + + [`` f(x)=[$func1] ``], + +we could shift the graph of [`g(x)`] to the [$lr] by [`[$shiftShow]`] units. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties40.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties40.pg new file mode 100644 index 0000000000..8f1ddb077a --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionProperties40.pg @@ -0,0 +1,168 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$bShow = &output($b); + +$pf = (1/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$cfAbs = abs($cf); +do {$d = random(-5,5,1);} until ($a != $d); + +$bIn = &input($b); +$bcf = $b*$cf; +$bcfIn = &input($bcf); +$func0 = Compute("$a*tan($bIn*x-$bcfIn)+$d")->reduce; +$func1 = Compute("$a*tan($bIn*(x-$cf))+$d")->reduce; +$func2 = Compute("$a*tan($bIn*x)+$d")->reduce; + +$lr = ($cf>0) ? "right" : "left"; +$shift = Compute("$cfAbs"); + + +############################################################## + +BEGIN_PGML + +Based on the given function + + [`` f(x) = [$func0] ``], + +fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's period is [______]{$pf}. + +c) To transform [`g(x)=[$func2]`] to [`f(x)=[$func0]`], we could shift the graph of [`g(x)`] to the [$lr] by [______]{$shift} units. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +We have to factor to change the function to the form of + + [``f(x) = A\tan(B(x-C))+D``] + +In [`f(x)=[$func0]`], factor out [`[$bShow]`], we have: + + [``f(x)=[$func1]``] + +###Part a + +By [`f(x)=[$func1]`], the function's midline is [`y=[$d]`]. + +###Part b + +If the function's formula is [`f(x)=A\sin(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{\pi}{[$bShow]} = [$pf]``] + +###Part c + +Compare + + [`` g(x)=[$func2] ``] + +with + + [`` f(x)=[$func1] ``], + +we could shift the graph of [`g(x)`] to the [$lr] by [`[$shift]`] units. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation10.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation10.pg new file mode 100644 index 0000000000..15ab367f77 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation10.pg @@ -0,0 +1,173 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(2,4,1); + +$func = Formula("sin(x)")->reduce; +$f[0] = Formula("$a*sin(x)")->reduce; +$f[1] = Formula("sin(x)")->reduce; +$f[2] = Formula("sin(x)+$a")->reduce; +$f[3] = Formula("$a*cos(x)")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,1), (pi,0), (3pi/2,-1), (2pi,0)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,$b), (pi,$a), (3pi/2,$c), (2pi,$a)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a vertical stretch by a factor of [`[$a]`]. + +The point [`(\frac{\pi}{2},1)`] on [`y=[$func]`] is stretched to [`(\frac{\pi}{2},[$a])`] on [`f(x)=[$f[0]]`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation100.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation100.pg new file mode 100644 index 0000000000..f87de127c5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation100.pg @@ -0,0 +1,214 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "contextFraction.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,3,1); +@s = (); +@sIn = (); +for my $i (0..3) { + $s[$i] = Fraction(($a+$i)%4,2)->reduce; + $sIn[$i] = &input($s[$i]); +} +$s0Show = &output($s[0]); + +$func = Formula("cos(x)")->reduce; +$f[0] = Formula("cos(x+$sIn[0])")->reduce; +$f[1] = Formula("cos(x+$sIn[1])")->reduce; +$f[2] = Formula("cos(x+$sIn[2])")->reduce; +$f[3] = Formula("cos(x+$sIn[3])")->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=cos(x), where (0,1) is shifted to the left to ($sIn[0],1)"; +$alt[1] = "graph with the shape of y=cos(x), where (0,0) is shifted to the left to ($sIn[1],1)"; +$alt[2] = "graph with the shape of y=cos(x), where (0,0) is shifted to the left to ($sIn[2],1)"; +$alt[3] = "graph with the shape of y=cos(x), where (0,0) is shifted to the left to ($sIn[3],1)"; + +$bound = 2; + +$xmin = int(-3*pi); #The viewing window +$xmax = int(pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=\cos\left(x+[$s0Show]\right)`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +The graph of [`f(x)=\cos\left(x+[$s0Show]\right)`] can be obtained by shifting the graph of [`y=[$func]`] to the left by [`[$s0Show]`] units. + +For example, [`(0,1)`] on [`y=[$func]`] is transformed to [`(-[$s0Show],1)`] on [`f(x)=\cos\left(x+[$s0Show]\right)`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation20.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation20.pg new file mode 100644 index 0000000000..5e504fee17 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation20.pg @@ -0,0 +1,173 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(2,4,1); + +$func = Formula("cos(x)")->reduce; +$f[0] = Formula("$a*cos(x)")->reduce; +$f[1] = Formula("cos(x)")->reduce; +$f[2] = Formula("cos(x)+$a")->reduce; +$f[3] = Formula("$a*sin(x)")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,1), (pi/2,0), (pi,-1), (3pi/2,0), (2pi,1)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$b), (pi/2,$a), (pi,$c), (3pi/2,$a), (2pi,$b)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a vertical stretch by a factor of [`[$a]`]. + +The point [`(0,1)`] on [`y=[$func]`] is stretched to [`(0,[$a])`] on [`f(x)=[$f[0]]`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation30.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation30.pg new file mode 100644 index 0000000000..77f894eecc --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation30.pg @@ -0,0 +1,174 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(1,4,1)*random(-1,1,2); + +$func = Formula("sin(x)")->reduce; +$f[0] = Formula("sin(x)+$a")->reduce; +$f[1] = Formula("$a*sin(x)")->reduce; +$f[2] = Formula("$a*cos(x)")->reduce; +$f[3] = Formula("cos(x)+$a")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,$b), (pi,$a), (3pi/2,$c), (2pi,$a)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$b), (pi/2,$a), (pi,$c), (3pi/2,$a), (2pi,$b)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +$ud = ($a>0) ? "up" : "down"; +$aAbs = abs($a); + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a vertical shift [$ud] by [`[$aAbs]`] units. + +The point [`(0,0)`] on [`y=[$func]`] is shifted to [`(0,[$a])`] on [`f(x)=[$f[0]]`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation40.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation40.pg new file mode 100644 index 0000000000..408c877de2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation40.pg @@ -0,0 +1,174 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = random(1,4,1)*random(-1,1,2); + +$func = Formula("cos(x)")->reduce; +$f[0] = Formula("cos(x)+$a")->reduce; +$f[1] = Formula("$a*cos(x)")->reduce; +$f[2] = Formula("$a*sin(x)")->reduce; +$f[3] = Formula("sin(x)+$a")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$b), (pi/2,$a), (pi,$c), (3pi/2,$a), (2pi,$b)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,$b), (pi,$a), (3pi/2,$c), (2pi,$a)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +$ud = ($a>0) ? "up" : "down"; +$aAbs = abs($a); + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a vertical shift [$ud] by [`[$aAbs]`] units. + +The point [`(0,1)`] on [`y=[$func]`] is shifted to [`(0,[$b])`] on [`f(x)=[$f[0]]`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation50.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation50.pg new file mode 100644 index 0000000000..ef168da4eb --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation50.pg @@ -0,0 +1,171 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = -random(2,4,1); + +$func = Formula("sin(x)")->reduce; +$f[0] = Formula("$a*sin(x)")->reduce; +$f[1] = Formula("sin(x)")->reduce; +$f[2] = Formula("sin(x)+$a")->reduce; +$f[3] = Formula("$a*cos(x)")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,1), (pi,0), (3pi/2,-1), (2pi,0)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,$b), (pi,$a), (3pi/2,$c), (2pi,$a)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a reflection by the [`x`]-axis, and a vertical stretch by a factor of [`[$a]`]. + +The point [`(\frac{\pi}{2},1)`] on [`f(x)=[$f[0]]`] is reflected to [`(\frac{\pi}{2},-1)`], and then stretched to [`(\frac{\pi}{2},[$a])`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation60.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation60.pg new file mode 100644 index 0000000000..5aea247070 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation60.pg @@ -0,0 +1,171 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Numeric"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +$a = -random(2,4,1); + +$func = Formula("cos(x)")->reduce; +$f[0] = Formula("$a*cos(x)")->reduce; +$f[1] = Formula("cos(x)")->reduce; +$f[2] = Formula("cos(x)+$a")->reduce; +$f[3] = Formula("$a*sin(x)")->reduce; + +$b=$a+1; +$c=$a-1; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$a), (pi/2,0), (pi,-$a), (3pi/2,0), (2pi,$a)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,1), (pi/2,0), (pi,-1), (3pi/2,0), (2pi,1)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,$b), (pi/2,$a), (pi,$c), (3pi/2,$a), (2pi,$b)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; + +$bound = 6; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a reflection by the [`x`]-axis, and a vertical stretch by a factor of [`[$a]`]. + +The point [`(0,1)`] on [`f(x)=[$f[0]]`] is reflected to [`(0,-1)`], and then stretched to [`(0,[$a])`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation70.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation70.pg new file mode 100644 index 0000000000..06d9f64650 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation70.pg @@ -0,0 +1,208 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +$a = list_random(Fraction(1,2),Fraction(1,3),Fraction(2,3)); + +$func = Formula("sin(x)")->reduce; +$f[0] = Formula("sin($a*x)")->reduce; +$aR = Real($a); +$f[1] = Formula("sin(x/$aR)")->reduce; +$f[2] = Formula("$a*sin(x)")->reduce; +$f[3] = Formula("cos($a*x)")->reduce; + +$pf = (2/$a)->reduce; +$pf1 = ($pf/4)->reduce; +$pf2 = ($pf/2)->reduce; +$pf3 = ($pf*3/4)->reduce; + +$fpf = (2*$a)->reduce; +$fpf1 = ($fpf/4)->reduce; +$fpf2 = ($fpf/2)->reduce; +$fpf3 = ($fpf*3/4)->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), ($pf1 pi,1), ($pf2 pi,0), ($pf3 pi,-1), ($pf pi,0)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), ($fpf1 pi,1), ($fpf2 pi,0), ($fpf3 pi,-1), ($fpf pi,0)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), (pi/2,$a), (pi,0), (3pi/2,-$a), (2pi,0)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,1), ($pf1 pi,0), ($pf2 pi,-1), ($pf3 pi,0), ($pf pi,1)"; + +$bound = 2; + +$xmin = int(-pi); #The viewing window +$xmax = int(4*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=[$f[0]]`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$pfShow = &output($pf); + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=[$f[0]]`] is a horizontal stretch by a factor of [`[$pf]`]. + +If the function's formula is [`f(x)=A\sin(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{2\pi}{[$a]} = [$pfShow]``] + +At the same time, the graph of [`y=[$func]`] passes [`(0,0)`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation80.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation80.pg new file mode 100644 index 0000000000..5394a74e05 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation80.pg @@ -0,0 +1,226 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "contextFraction.pl", + "parserPopUp.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$af= list_random(Fraction(1,2),Fraction(1,3),Fraction(2,3)); +$afIn = &input($af); +$afShow = &output($af); + +$func = Formula("cos(x)")->reduce; +$f[0] = Formula("cos($afIn*x)")->reduce; +$f[1] = Formula("sin($afIn*x)")->reduce; +$f[2] = Formula("cos(2*$afIn*x)")->reduce; +$f[3] = Formula("sin(2*$afIn*x)")->reduce; + +$pf = (2/$af)->reduce; +$pf1 = ($pf/4)->reduce; +$pf2 = ($pf/2)->reduce; +$pf3 = ($pf*3/4)->reduce; + +$fpf = ($pf/2)->reduce; +$fpf1 = ($fpf/4)->reduce; +$fpf2 = ($fpf/2)->reduce; +$fpf3 = ($fpf*3/4)->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,1), ($pf1,0), ($pf2,-1), ($pf3,0), ($pf,1)"; +$alt[1] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), ($pf1,1), ($pf2,0), ($pf3,-1), ($pf,0)"; +$alt[2] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,1), ($fpf1,0), ($fpf2,-1), ($fpf3,0), ($fpf,1)"; +$alt[3] = "graph with the shape of y=sin(x) or y=cos(x), crossing the following 5 points in a period: (0,0), ($fpf1,1), ($fpf2,0), ($fpf3,-1), ($fpf,0)"; + +$bound = 2; + +$xmin = int(-pi); #The viewing window +$xmax = int(4*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[400,400]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=\cos\left([$afShow]x\right)`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; +$pfShow = &output($pf); + +BEGIN_PGML_SOLUTION + +Compared to the graph of [`y=[$func]`], the graph of [`f(x)=\cos\left([$afShow]x\right)`] is a horizontal stretch. + +If the function's formula is [`f(x)=A\cos(B(x-C))+D`], this formula calculates the function's new period: + + [``\text{new period}=\frac{\text{old period}}{B}``] + +By this formula, we have: + + [`` \text{new period} = \frac{2\pi}{[$afShow]} = [$pf]``] + +At the same time, the graph of [`f(x)=\cos\left([$afShow]x\right)`] crosses [`(0,1)`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation90.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation90.pg new file mode 100644 index 0000000000..be93ad945c --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/TrigFunctionTransformation90.pg @@ -0,0 +1,214 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +############################################## + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PCCgraphMacros.pl", + "parserPopUp.pl", + "contextFraction.pl", + "niceTables.pl", + "PGcourse.pl", +); + +$refreshCachedImages = 1; + +############################################## + +TEXT(beginproblem()); +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->reduction->set('(-x)-y'=>0); +Context()->reduction->set('(-x)+y'=>0); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,3,1); +@s = (); +@sIn = (); +for my $i (0..3) { + $s[$i] = Fraction(($a+$i)%4,2)->reduce; + $sIn[$i] = &input($s[$i]); +} +$s0Show = &output($s[0]); + +$func = Formula("sin(x)")->reduce; +$f[0] = Formula("sin(x-$sIn[0])")->reduce; +$f[1] = Formula("sin(x-$sIn[1])")->reduce; +$f[2] = Formula("sin(x-$sIn[2])")->reduce; +$f[3] = Formula("sin(x-$sIn[3])")->reduce; + +@alt = (); +$alt[0] = "graph with the shape of y=sin(x), where (0,0) is shifted to the right to ($sIn[0],0)"; +$alt[1] = "graph with the shape of y=sin(x), where (0,0) is shifted to the right to ($sIn[1],0)"; +$alt[2] = "graph with the shape of y=sin(x), where (0,0) is shifted to the right to ($sIn[2],0)"; +$alt[3] = "graph with the shape of y=sin(x), where (0,0) is shifted to the right to ($sIn[3],0)"; + +$bound = 2; + +$xmin = int(-pi); #The viewing window +$xmax = int(3*pi); +$ymin = -$bound; +$ymax = $bound; + +@graphs = (); + +for ( my $i=0; $i<5; $i++ ) { + $graphs[$i] = init_graph($xmin,$ymin,$xmax,$ymax, + grid=>[$xmax-$xmin,$ymax-$ymin],axes=>[0,0],pixels=>[300,300]); + + $graphs[$i]->lb('reset'); + foreach my $j (int($xmin)..int($xmax)) { + $graphs[$i]->lb( new Label($xmin+0.3, $j, $j,'black','center','middle')); + $graphs[$i]->lb( new Label($xmin+0.3, -$j,-$j,'black','center','middle')); + $graphs[$i]->lb( new Label($j,$ymin+0.3, $j,'black','center','middle')); + $graphs[$i]->lb( new Label( -$j,$ymin+0.3,-$j,'black','center','middle')); + } + $graphs[$i]->lb( new Label($xmax-0.3,0.2,'x','black','center','middle')); + $graphs[$i]->lb( new Label(0.2,$ymax-0.3,'y','black','center','middle')); + + add_functions($graphs[$i], "$f[$i] for x in <$xmin,$xmax> " . + "using color:blue and weight:2"); +} + +sub shufflemap { + my $n = shift(); + my $m = $n - 1; + my $zeroind; + + my %map = (); + + my @vals = (0..$m); + for ( my $i=0; $i<$m; $i++ ) { + my $j = random(0,$m-$i,1); + $map{$i} = $vals[$j]; + $zeroind = $i if ( $map{$i} == 0 ); + splice(@vals, $j, 1); + } + $map{$m} = $vals[0]; + $zeroind = $m if ( $map{$m} == 0 ); + + return( { %map }, $zeroind ); +} + +($shuffle, $zero) = shufflemap(4); #A random permutation function. + #$zero is $shuffle(0), the index + #of the correct graph + +$pop = PopUp( [qw(? 1 2 3 4)], $zero+1 ); + + + +$size = 180; +$texsize = 100; + +############################################## + +BEGIN_PGML +Choose the graph of the function [`f(x)=\sin\left(x-[$s0Show]\right)`]. + + The correct graph is graph number [@ $pop->menu() @]*. + +[@EnlargeImageStatementPGML()@]** + +END_PGML + +BEGIN_TEXT +$PAR + +\{LayoutTable( +[ +['1.'.image(insertGraph( $graphs[ $shuffle->{0} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{0}]" title = "$alt[$shuffle->{0}]"'), +'2.'.image(insertGraph( $graphs[ $shuffle->{1} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{1}]" title = "$alt[$shuffle->{1}]"'), +'3.'.image(insertGraph( $graphs[ $shuffle->{2} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{2}]" title = "$alt[$shuffle->{2}]"'), +'4.'.image(insertGraph( $graphs[ $shuffle->{3} ] ), tex_size=>$texsize, + height=>$size, width=>$size, extra_html_tags=>'alt="$alt[$shuffle->{3}]" title = "$alt[$shuffle->{3}]"'),] +], +align=>'>{\bfseries}l>{\bfseries}l>{\bfseries}l>{\bfseries}l', +allcellcss=>'padding: 10px;', +); +\} + +END_TEXT + + +############################################## + +ANS( $pop->cmp() ); + +############################################## + +$answer = $zero+1; + +BEGIN_PGML_SOLUTION + +The graph of [`f(x)=\sin\left(x-[$s0Show]\right)`] can be obtained by shifting the graph of [`y=[$func]`] to the right by [`[$s0Show]`] units. + +For example, [`(0,0)`] on [`y=[$func]`] is transformed to [`([$s0Show],0)`] on [`f(x)=\sin\left(x-[$s0Show]\right)`]. + +The correct answer is Graph [`[$answer]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph10.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph10.pg new file mode 100644 index 0000000000..5eb784185d --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph10.pg @@ -0,0 +1,257 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$Axf = $cf; +Context()->functions->disable("cos"); +$func1 = Compute("$a*sin($b*(x-$Axf*pi))+$d")->reduce; +$Ay = $func1->eval(x=>$Axf*pi); + +$Bxf = ($cf+$pf4)->reduce; +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->functions->disable("sin"); +$func2 = Compute("$a*cos($b*(x-$Bxf*pi))+$d")->reduce; +$By = $func1->eval(x=>$Bxf*pi); + +$Dxf = ($Bxf+$pf2)->reduce; +$Dy = $func1->eval(x=>$Dxf*pi); +$func3 = Compute("-$a*cos($b*(x-$Dxf*pi))+$d")->reduce; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +@graph = (); +($xmin, $xmax) = (-1,3*pi+1); +($ymin, $ymax) = (-1.5,1.5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->stamps(closed_circle(pi/2,1,red)); +$graph[0]->stamps(closed_circle(pi,0,red)); +$graph[0]->stamps(closed_circle(3*pi/2,-1,red)); +$graph[0]->stamps(closed_circle(2*pi,0,red)); +$graph[0]->stamps(closed_circle(5*pi/2,1,red)); +$graph[0]->stamps(closed_circle(3*pi,0,red)); + +$graph[0]->lb(new Label(0,0,"A",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi/2,1,"B",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi,0,"C",'red','right','top',large)); +$graph[0]->lb(new Label(3*pi/2,-1,"D",'red','right','top',large)); +$graph[0]->lb(new Label(2*pi,0,"E",'red','right','bottom',large)); +$graph[0]->lb(new Label(5*pi/2,1,"F",'red','right','bottom',large)); +$graph[0]->lb(new Label(3*pi,0,"G",'red','right','top',large)); + +add_functions($graph[0], "sin(x) for x in <$xmin,$xmax> using color:blue and weight:2"); + +$alt[0] = "This is the graph of a periodic function in the shape of sin(x) or cos(x). Point A is in the middle of maximum and minimum of y-values. To the right of Point A, Point B has the maximum y-value of the periodic function. Point C is back to the middle (same height of A). Point D has the minimum y-value of the function. Point E is in the middle (same height of A and C). Point F has maximum y-value (same height of B). Point G is the middle (same height of A, C and E)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$AxShow = &output($Axf); +$AxShowAbs = &output(abs($Axf)); +$BxShow = &output($Bxf); +$BxShowAbs = &output(abs($Bxf)); +$DxShow = &output($Dxf); +$DxShowAbs = &output(abs($Dxf)); +if ($pf == 1) { + $pAns = Compute("pi"); +} elsif ($pf == -1) { + $pAns = Compute("-pi"); +} else { + $pAns = Compute("$pf*pi"); +} +$pfShow = &output($pf); + +$lorSine = ($cf>0) ? "right" : "left"; + +$bxShowAbs = &output(abs($Bxf)); +if ($Bxf==0) { + $lorCosine = "\text{The function does not shift horizontally}"; +} elsif ($Bxf>0) { + $lorCosine = "\text{The function shifts to the right by }$bxShowAbs"; +} else { + $lorCosine = "\text{The function shifts to the left by }$bxShowAbs"; +} + +$dxShowAbs = &output(abs($Dxf)); +if ($Dxf==0) { + $lorCosineN = "\text{The function does not shift horizontally}"; +} elsif ($Dxf>0) { + $lorCosineN = "\text{The function shifts to the right by }$dxShowAbs"; +} else { + $lorCosineN = "\text{The function shifts to the left by }$dxShowAbs"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`A`] and [`B`] are + + [`` A([$AxShow],[$Ay]) \text{ and } B([$BxShow],[$By])``] + +Fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pAns}. + +d) The function, as a transformation of [`y=\sin(x)`], is [`f(x)=`][________________________]{$func1}. + +e) The function, as a transformation of [`y=\cos(x)`], is [`g(x)=`][________________________]{$func2}. + +f) The function, as a transformation of [`y=-\cos(x)`], is [`h(x)=`][________________________]{$func3}. + +END_PGML + +############################################################## + +$pf4Show = &output($pf4); + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`A([$AxShow],[$Ay])`] is on the function's midline, so the [`y`]-value of [`A`] determines the function's midline [`y=[$d]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +The vertical difference between points [`A([$AxShow],[$Ay]) \text{ and } B([$BxShow],[$By])`] is the function's amplitude [`[$By]-([$Ay])=[$a]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`a=[$a]`]. + +###Part c + +In the graph, Point [`A([$AxShow],[$Ay]) \text{ and } B([$BxShow],[$By])`] cover [`\frac{1}{4}`] of the function's period: + + [`` [$BxShow]-([$AxShow]) = [$pf4Show] ``] + +The function's period is 4 times as large: [` 4\cdot[$pf4Show] = [$pfShow] `]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$pfShow]} = [$b]``] + +###Part d + +If the function's "parent function" is [`y=\sin(x)`], its period starts at [`(0,0)`]. Point [`A([$AxShow],[$Ay])`] is the image of [`(0,0)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +The function shifts to the [$lorSine] by [`[$AxShowAbs]`] units. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`c=[$AxShow]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +###Part e + +If the function's "parent function" is [`y=\cos(x)`], its period starts at [`(0,1)`]. Point [`B([$BxShow],[$By])`] is the image of [`(0,1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosine]`]. + +If the function's formula is [`g(x)=a\cos(b(x-c))+d`], we have [`c=[$BxShow]`]. + +Putting together all parts, the function's function is [`g(x)=[$func2]`]. + +###Part f + +If the function's "parent function" is [`y=-\cos(x)`], its period starts at [`(0,-1)`]. Point [`D([$DxShow],[$Dy])`] is the image of [`(0,-1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosineN]`]. + +If the function's formula is [`h(x)=-a\cos(b(x-c))+d`], we have [`c=[$DxShow]`]. + +Putting together all parts, the function's function is [`h(x)=[$func3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph20.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph20.pg new file mode 100644 index 0000000000..2b42183400 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph20.pg @@ -0,0 +1,271 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$Axf = $cf; +Context()->functions->disable("cos"); +$func1 = Compute("$a*sin($b*(x-$Axf*pi))+$d")->reduce; +$Ay = $func1->eval(x=>$Axf*pi); + +$Bxf = ($cf+$pf4)->reduce; +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->functions->disable("sin"); +$By = $func1->eval(x=>$Bxf*pi); + +$func2 = Compute("$a*cos($b*(x-$Bxf*pi))+$d")->reduce; + +$Dxf = ($Bxf+$pf2)->reduce; +$Dy = $func1->eval(x=>$Dxf*pi); +$func3 = Compute("-$a*cos($b*(x-$Dxf*pi))+$d")->reduce; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +@graph = (); +($xmin, $xmax) = (-1,3*pi+1); +($ymin, $ymax) = (-1.5,1.5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->stamps(closed_circle(pi/2,1,red)); +$graph[0]->stamps(closed_circle(pi,0,red)); +$graph[0]->stamps(closed_circle(3*pi/2,-1,red)); +$graph[0]->stamps(closed_circle(2*pi,0,red)); +$graph[0]->stamps(closed_circle(5*pi/2,1,red)); +$graph[0]->stamps(closed_circle(3*pi,0,red)); + +$graph[0]->lb(new Label(0,0,"A",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi/2,1,"B",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi,0,"C",'red','right','top',large)); +$graph[0]->lb(new Label(3*pi/2,-1,"D",'red','right','top',large)); +$graph[0]->lb(new Label(2*pi,0,"E",'red','right','bottom',large)); +$graph[0]->lb(new Label(5*pi/2,1,"F",'red','right','bottom',large)); +$graph[0]->lb(new Label(3*pi,0,"G",'red','right','top',large)); + +add_functions($graph[0], "sin(x) for x in <$xmin,$xmax> using color:blue and weight:2"); + +$alt[0] = "This is the graph of a periodic function in the shape of sin(x) or cos(x). Point A is in the middle of maximum and minimum of y-values. To the right of Point A, Point B has the maximum y-value of the periodic function. Point C is back to the middle (same height of A). Point D has the minimum y-value of the function. Point E is in the middle (same height of A and C). Point F has maximum y-value (same height of B). Point G is the middle (same height of A, C and E)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$AxShow = &output($Axf); +$AxShowAbs = &output(abs($Axf)); +$BxShow = &output($Bxf); +$BxShowAbs = &output(abs($Bxf)); +$DxShow = &output($Dxf); +$DxShowAbs = &output(abs($Dxf)); +if ($pf == 1) { + $pAns = Compute("pi"); +} elsif ($pf == -1) { + $pAns = Compute("-pi"); +} else { + $pAns = Compute("$pf*pi"); +} +$pfShow = &output($pf); + +$lorSine = ($cf>0) ? "right" : "left"; + +$bxShowAbs = &output(abs($Bxf)); +if ($Bxf==0) { + $lorCosine = "\text{The function does not shift horizontally}"; +} elsif ($Bxf>0) { + $lorCosine = "\text{The function shifts to the right by }$bxShowAbs"; +} else { + $lorCosine = "\text{The function shifts to the left by }$bxShowAbs"; +} + +$dxShowAbs = &output(abs($Dxf)); +if ($Dxf==0) { + $lorCosineN = "\text{The function does not shift horizontally}"; +} elsif ($Dxf>0) { + $lorCosineN = "\text{The function shifts to the right by }$dxShowAbs"; +} else { + $lorCosineN = "\text{The function shifts to the left by }$dxShowAbs"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`B`] and [`D`] are + + [`` B([$BxShow],[$By]) \text{ and } D([$DxShow],[$Dy])``] + +Fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pAns}. + +d) The function, as a transformation of [`y=\sin(x)`], is [`f(x)=`][________________________]{$func1}. + +e) The function, as a transformation of [`y=\cos(x)`], is [`g(x)=`][________________________]{$func2}. + +f) The function, as a transformation of [`y=-\cos(x)`], is [`h(x)=`][________________________]{$func3}. + +END_PGML + +############################################################## + +$pf2Show = &output($pf2); + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`C`] is on the function's midline, so the [`y`]-value of [`C`] determines the function's midline. The [`y`]-value of [`C`] is simply the average [`y`]-values of points [`B([$BxShow],[$By]) \text{ and } D([$DxShow],[$Dy])`]: + + [`` y-\text{value of }C = \frac{[$By]+([$Dy])}{2} = [$d]``] + +The function's midline is [`y=[$d]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +The vertical difference between points [`B([$BxShow],[$By]) \text{ and } D([$DxShow],[$Dy])`] is twice the function's amplitude, so we have: + + [``\text{amplitude}=\frac{[$By]-([$Dy])}{2}=[$a]``]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`a=[$a]`]. + +###Part c + +In the graph, Point [`B([$BxShow],[$By]) \text{ and } D([$DxShow],[$Dy])`] cover half of the function's period: + + [`` [$DxShow]-([$BxShow]) = [$pf2Show] ``] + +The function's period is twice as large: [` 2\cdot[$pf2Show] = [$pfShow] `]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$pfShow]} = [$b]``] + +###Part d + +If the function's "parent function" is [`y=\sin(x)`], its period starts at [`(0,0)`]. Point [`A`] is the image of [`(0,0)`] after transformations, so the [`x`]-value of Point [`A`] tells us the horizontal shift. + + [``\begin{aligned} + (x-\text{value of }A) + &= (x-\text{value of }B)-\left(\frac{1}{4}\text{ of period}\right) \\ + &= [$BxShow]-\frac{1}{4}\cdot\left([$pfShow]\right) \\ + &= [$AxShow] + \end{aligned}``] + +The function shifts to the [$lorSine] by [`[$AxShowAbs]`] units. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`C=[$AxShow]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +###Part e + +If the function's "parent function" is [`y=\cos(x)`], its period starts at [`(0,1)`]. Point [`B([$BxShow],[$By])`] is the image of [`(0,1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosine]`]. + +If the function's formula is [`g(x)=a\cos(b(x-c))+d`], we have [`c=[$BxShow]`]. + +Putting together all parts, the function's function is [`g(x)=[$func2]`]. + +###Part f + +If the function's "parent function" is [`y=-\cos(x)`], its period starts at [`(0,-1)`]. Point [`D([$DxShow],[$Dy])`] is the image of [`(0,-1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosineN]`]. + +If the function's formula is [`h(x)=-a\cos(b(x-c))+d`], we have [`c=[$DxShow]`]. + +Putting together all parts, the function's function is [`h(x)=[$func3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph30.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph30.pg new file mode 100644 index 0000000000..11958e4caa --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph30.pg @@ -0,0 +1,265 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$bShow = &output($b); + +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$bIn = &input($b); +$Ax = $cf; +Context()->functions->disable("cos"); +$func1 = Compute("$a*sin($bIn*(x-$Ax))+$d")->reduce; +$Ay = $func1->eval(x=>$Ax); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->functions->disable("sin"); + +$Bx = ($cf+$pf4)->reduce; +$func2 = Compute("$a*cos($bIn*(x-$Bx))+$d")->reduce; +$By = $func1->eval(x=>$Bx); + +$Dx = ($Bx+$pf2)->reduce; +$Dy = $func1->eval(x=>$Dx); +$func3 = Compute("-$a*cos($bIn*(x-$Dx))+$d")->reduce; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +@graph = (); +($xmin, $xmax) = (-1,3*pi+1); +($ymin, $ymax) = (-1.5,1.5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->stamps(closed_circle(pi/2,1,red)); +$graph[0]->stamps(closed_circle(pi,0,red)); +$graph[0]->stamps(closed_circle(3*pi/2,-1,red)); +$graph[0]->stamps(closed_circle(2*pi,0,red)); +$graph[0]->stamps(closed_circle(5*pi/2,1,red)); +$graph[0]->stamps(closed_circle(3*pi,0,red)); + +$graph[0]->lb(new Label(0,0,"A",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi/2,1,"B",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi,0,"C",'red','right','top',large)); +$graph[0]->lb(new Label(3*pi/2,-1,"D",'red','right','top',large)); +$graph[0]->lb(new Label(2*pi,0,"E",'red','right','bottom',large)); +$graph[0]->lb(new Label(5*pi/2,1,"F",'red','right','bottom',large)); +$graph[0]->lb(new Label(3*pi,0,"G",'red','right','top',large)); + +add_functions($graph[0], "sin(x) for x in <$xmin,$xmax> using color:blue and weight:2"); + +$alt[0] = "This is the graph of a periodic function in the shape of sin(x) or cos(x). Point A is in the middle of maximum and minimum of y-values. To the right of Point A, Point B has the maximum y-value of the periodic function. Point C is back to the middle (same height of A). Point D has the minimum y-value of the function. Point E is in the middle (same height of A and C). Point F has maximum y-value (same height of B). Point G is the middle (same height of A, C and E)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$lorSine = ($cf>0) ? "right" : "left"; + +$AxAbs = abs($Ax); +$BxAbs = abs($Bx); +$DxAbs = abs($Dx); + +if ($Bx==0) { + $lorCosine = "\text{The function does not shift horizontally}"; +} elsif ($Bx>0) { + $lorCosine = "\text{The function shifts to the right by }$BxAbs\text{ units}"; +} else { + $lorCosine = "\text{The function shifts to the left by }$BxAbs\text{ units}"; +} + +if ($Dx==0) { + $lorCosineN = "\text{The function does not shift horizontally}"; +} elsif ($Dx>0) { + $lorCosineN = "\text{The function shifts to the right by }$DxAbs\text{ units}"; +} else { + $lorCosineN = "\text{The function shifts to the left by }$DxAbs\text{ units}"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`A`] and [`B`] are + + [`` A([$Ax],[$Ay]) \text{ and } B([$Bx],[$By])``] + +Fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pf}. + +d) The function, as a transformation of [`y=\sin(x)`], is [`f(x)=`][________________________]{$func1}. + +e) The function, as a transformation of [`y=\cos(x)`], is [`g(x)=`][________________________]{$func2}. + +f) The function, as a transformation of [`y=-\cos(x)`], is [`h(x)=`][________________________]{$func3}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`A([$Ax],[$Ay])`] is on the function's midline, so the [`y`]-value of [`A`] determines the function's midline [`y=[$d]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +The vertical difference between points [`A([$Ax],[$Ay]) \text{ and } B([$Bx],[$By])`] is the function's amplitude [`[$By]-([$Ay])=[$a]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`a=[$a]`]. + +###Part c + +In the graph, Point [`A([$Ax],[$Ay]) \text{ and } B([$Bx],[$By])`] cover [`\frac{1}{4}`] of the function's period: + + [`` [$Bx]-([$Ax]) = [$pf4] ``] + +The function's period is 4 times as large: [` 4\cdot[$pf4] = [$pf] `]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$pf]} = [$bShow]``] + +###Part d + +If the function's "parent function" is [`y=\sin(x)`], its period starts at [`(0,0)`]. Point [`A([$Ax],[$Ay])`] is the image of [`(0,0)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +The function shifts to the [$lorSine] by [`[$AxAbs]`] units. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`c=[$Ax]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +###Part e + +If the function's "parent function" is [`y=\cos(x)`], its period starts at [`(0,1)`]. Point [`B([$Bx],[$By])`] is the image of [`(0,1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosine]`]. + +If the function's formula is [`g(x)=a\cos(b(x-c))+d`], we have [`c=[$Bx]`]. + +Putting together all parts, the function's function is [`g(x)=[$func2]`]. + +###Part f + +If the function's "parent function" is [`y=-\cos(x)`], its period starts at [`(0,-1)`]. Point [`D([$Dx],[$Dy])`] is the image of [`(0,-1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosineN]`]. + +If the function's formula is [`h(x)=-a\cos(b(x-c))+d`], we have [`c=[$Dx]`]. + +Putting together all parts, the function's function is [`h(x)=[$func3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph40.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph40.pg new file mode 100644 index 0000000000..cd9028b791 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph40.pg @@ -0,0 +1,278 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$bShow = &output($b); + +$pf = (2/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$bIn = &input($b); +$Ax = $cf; +Context()->functions->disable("cos"); +$func1 = Compute("$a*sin($bIn*(x-$Ax))+$d")->reduce; +$Ay = $func1->eval(x=>$Ax); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); +Context()->functions->disable("sin"); + +$Bx = ($cf+$pf4)->reduce; +$func2 = Compute("$a*cos($bIn*(x-$Bx))+$d")->reduce; +$By = $func1->eval(x=>$Bx); + +$Dx = ($Bx+$pf2)->reduce; +$Dy = $func1->eval(x=>$Dx); +$func3 = Compute("-$a*cos($bIn*(x-$Dx))+$d")->reduce; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +@graph = (); +($xmin, $xmax) = (-1,3*pi+1); +($ymin, $ymax) = (-1.5,1.5); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->stamps(closed_circle(pi/2,1,red)); +$graph[0]->stamps(closed_circle(pi,0,red)); +$graph[0]->stamps(closed_circle(3*pi/2,-1,red)); +$graph[0]->stamps(closed_circle(2*pi,0,red)); +$graph[0]->stamps(closed_circle(5*pi/2,1,red)); +$graph[0]->stamps(closed_circle(3*pi,0,red)); + +$graph[0]->lb(new Label(0,0,"A",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi/2,1,"B",'red','right','bottom',large)); +$graph[0]->lb(new Label(pi,0,"C",'red','right','top',large)); +$graph[0]->lb(new Label(3*pi/2,-1,"D",'red','right','top',large)); +$graph[0]->lb(new Label(2*pi,0,"E",'red','right','bottom',large)); +$graph[0]->lb(new Label(5*pi/2,1,"F",'red','right','bottom',large)); +$graph[0]->lb(new Label(3*pi,0,"G",'red','right','top',large)); + +add_functions($graph[0], "sin(x) for x in <$xmin,$xmax> using color:blue and weight:2"); + +$alt[0] = "This is the graph of a periodic function in the shape of sin(x) or cos(x). Point A is in the middle of maximum and minimum of y-values. To the right of Point A, Point B has the maximum y-value of the periodic function. Point C is back to the middle (same height of A). Point D has the minimum y-value of the function. Point E is in the middle (same height of A and C). Point F has maximum y-value (same height of B). Point G is the middle (same height of A, C and E)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$lorSine = ($cf>0) ? "right" : "left"; + +$AxAbs = abs($Ax); +$BxAbs = abs($Bx); +$DxAbs = abs($Dx); + +if ($Bx==0) { + $lorCosine = "\text{The function does not shift horizontally}"; +} elsif ($Bx>0) { + $lorCosine = "\text{The function shifts to the right by }$BxAbs\text{ units}"; +} else { + $lorCosine = "\text{The function shifts to the left by }$BxAbs\text{ units}"; +} + +if ($Dx==0) { + $lorCosineN = "\text{The function does not shift horizontally}"; +} elsif ($Dx>0) { + $lorCosineN = "\text{The function shifts to the right by }$DxAbs\text{ units}"; +} else { + $lorCosineN = "\text{The function shifts to the left by }$DxAbs\text{ units}"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`B`] and [`D`] are + + [`` B([$Bx],[$By]) \text{ and } D([$Dx],[$Dy])``] + +Fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's amplitude is [______]{$a}. + +c) The function's period is [______]{$pf}. + +d) The function, as a transformation of [`y=\sin(x)`], is [`f(x)=`][________________________]{$func1}. + +e) The function, as a transformation of [`y=\cos(x)`], is [`g(x)=`][________________________]{$func2}. + +f) The function, as a transformation of [`y=-\cos(x)`], is [`h(x)=`][________________________]{$func3}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`C`] is on the function's midline, so the [`y`]-value of [`C`] determines the function's midline. The [`y`]-value of [`C`] is simply the average [`y`]-values of points [`B([$Bx],[$By]) \text{ and } D([$Dx],[$Dy])`]: + + [`` y \text{-value of }C = \frac{[$By]+([$Dy])}{2} = [$d]``] + +The function's midline is [`y=[$d]`]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +The vertical difference between points [`B([$Bx],[$By]) \text{ and } D([$Dx],[$Dy])`] is twice the function's amplitude, so we have: + + [``\text{amplitude}=\frac{[$By]-([$Dy])}{2}=[$a]``] + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`a=[$a]`]. + +###Part c + +In the graph, Point [`B([$Bx],[$By]) \text{ and } D([$Dx],[$Dy])`] cover half of the function's period: + + [`` [$Dx]-([$Bx]) = [$pf2] ``] + +The function's period is twice as large: [` 2\cdot[$pf2] = [$pf] `]. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{2\pi}{[$pf]} = [$bShow]``] + +###Part d + +If the function's "parent function" is [`y=\sin(x)`], its period starts at [`(0,0)`]. Point [`A`] is the image of [`(0,0)`] after transformations, so the [`x`]-value of Point [`A`] tells us the horizontal shift. + + [``\begin{aligned} + (x-\text{value of }A) + &= (x-\text{value of }B)-\left(\frac{1}{4}\text{ of period}\right) \\ + &= [$Bx]-\frac{1}{4}\cdot\left([$pf]\right) \\ + &= [$Ax] + \end{aligned}``] + +The function shifts to the [$lorSine] by [`[$AxAbs]`] units. + +If the function's formula is [`f(x)=a\sin(b(x-c))+d`], we have [`c=[$Ax]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +###Part e + +If the function's "parent function" is [`y=\cos(x)`], its period starts at [`(0,1)`]. Point [`B([$Bx],[$By])`] is the image of [`(0,1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosine]`]. + +If the function's formula is [`g(x)=a\cos(b(x-c))+d`], we have [`c=[$Bx]`]. + +Putting together all parts, the function's function is [`g(x)=[$func2]`]. + +###Part f + +If the function's "parent function" is [`y=-\cos(x)`], its period starts at [`(0,-1)`]. Point [`D([$Dx],[$Dy])`] is the image of [`(0,-1)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +[`[$lorCosineN]`]. + +If the function's formula is [`h(x)=-a\cos(b(x-c))+d`], we have [`c=[$Dx]`]. + +Putting together all parts, the function's function is [`h(x)=[$func3]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph50.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph50.pg new file mode 100644 index 0000000000..d3092a78de --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph50.pg @@ -0,0 +1,222 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$pf = (1/$b)->reduce; +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$cfIn = &input($cf); +$func1 = Compute("$a*tan($b*(x-$cfIn))+$d")->reduce; +$func2 = Compute("$a*tan($b*x)+$d")->reduce; + +$Oxf = $cf; +$Oy = $func1->eval(x=>$Oxf*pi); +$OxShow = &output($Oxf); +$OxShowAbs = &output(abs($Oxf)); + +$asymptoteLf = ($Oxf-$pf2)->reduce; +$asymptoteL = &input($asymptoteLf); +$asymptoteLShow = &output($asymptoteLf); +$asymptoteRf = ($Oxf+$pf2)->reduce; +$asymptoteR = &input($asymptoteRf); +$asymptoteRShow = &output($asymptoteRf); + +$Pxf = ($cf+$asymptoteRf)/2; +$Py = $func1->eval(x=>$Pxf*pi); +$PxShow = &output($Pxf); +$PxShowAbs = &output(abs($Pxf)); + +@graph = (); +($xmin, $xmax) = (-3*pi/4,3*pi/4); +($ymin, $ymax) = (-3,3); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->lb(new Label(0,0,"O",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle(pi/4,1,red)); +$graph[0]->lb(new Label(pi/4,1,"P",'red','right','bottom',large)); + +$graph[0]->moveTo(-pi/2,$ymin); +$graph[0]->lineTo(-pi/2,$ymax,blue,2,dashed); +$graph[0]->moveTo(pi/2,$ymin); +$graph[0]->lineTo(pi/2,$ymax,blue,2,dashed); +$graph[0]->lb(new Label(-pi/2,$ymax-1,"x=$asymptoteL",'blue','left','middle',large)); +$graph[0]->lb(new Label(pi/2,$ymin+1,"x=$asymptoteR",'blue','right','middle',large)); + +$l = -pi/2+0.01; +$r = pi/2-0.01; +add_functions($graph[0], "tan(x) for x in <$l,$r> using color:blue and weight:2"); + +$alt[0] = "This is the graph of one period of the function tan(x). The center is marked as O. Point P is also marked on the function, in the middle of Point O and the asymptote x=$asymptoteR. Two asymptotes are on the left and rigth of the function: x=$asymptoteL and x=$asymptoteR."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +if ($pf == 1) { + $pAns = Compute("pi"); +} elsif ($pf == -1) { + $pAns = Compute("-pi"); +} else { + $pAns = Compute("$pf*pi"); +} +$pfShow = &output($pf); + +$lor = ($cf>0) ? "right" : "left"; + +if ($Oxf==0) { + $lorTangent = "\text{The function does not shift horizontally}"; +} elsif ($Oxf>0) { + $lorTangent = "\text{The function shifts to the right by }$oxShowAbs"; +} else { + $lorTangent = "\text{The function shifts to the left by }$oxShowAbs"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`O`] are [` O([$OxShow],[$Oy])`], the coordinates of Point [`P`] are [` P([$PxShow],[$Py])`], and if the function's two asymptotes are [`x=[$asymptoteLShow]`] and [`x=[$asymptoteRShow]`], fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +Find the function's equation in the form of [`f(x)=a\tan(b(x-c))+d`]. + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's period is [______]{$pAns}. + +c) The value of [`a`] determines the function's vertical stretch/compression: [`a=`][______]{$a}. + +d) The function, as a transformation of [`y=\tan(x)`], is [`f(x)=`][________________________]{$func1}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`O([$OxShow],[$Oy])`] is on the function's midline, so the [`y`]-value of [`O`] determines the function's midline [`y=[$d]`]. + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +In the graph, the difference between the function's two asymptotes determines the function's period: + + [`` [$asymptoteRShow]-([$asymptoteLShow]) = [$pfShow] ``] + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{\pi}{[$pfShow]} = [$b]``] + +###Part c + +In the graph of [`y=\tan{x}`], the vertical distance between [`(0,0)`] and [`\left(\frac{\pi}{4},1\right)`] is [`1`]. In this function's graph, the vertical distance between [` O([$OxShow],[$Oy])`] and [` P([$PxShow],[$Py])`] is [`[$Py]-([$Oy])=[$a]`]. So the value of [`a`] in [`f(x)=a\tan(b(x-c))+d`] is [`a=[$a]`]. + +###Part d + +If the function's "parent function" is [`y=\tan(x)`], its center is at [`(0,0)`]. Point [`O([$OxShow],[$Oy])`] is the image of [`(0,0)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +The function shifts to the [$lor] by [`[$OxShowAbs]`] units. + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], we have [`c=[$OxShow]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph60.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph60.pg new file mode 100644 index 0000000000..44f606933e --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigGraph/WriteFunctionByGraph60.pg @@ -0,0 +1,209 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages=1; + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); +Context()->noreduce('(-x)-y'); +Context()->noreduce('(-x)-y','(-x)+y'); + +sub output { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "\pi";} + elsif ($n==-1) {return "-\pi";} + else {return "$n\pi";} + } else { + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n>0) {return "\frac{$n\pi}{$d}";} + else { + $Nn = -$n; + return "-\frac{$Nn\pi}{$d}"; + } + } +} + +sub input { + my ($n,$d) = shift->value; + if ($n==0) {return 0;} + if ($d==1) { + if ($n==1) {return "pi";} + elsif ($n==-1) {return "-pi";} + else {return "$n*pi";} + } else { + if ($n==1) {return "pi/$d";} + elsif ($n==-1) {return "-pi/$d";} + elsif ($n>0) {return "$n*pi/$d";} + else { + $Nn = -$n; + return "-$Nn*pi/$d"; + } + } +} + +$a = random(1,5,1); +$b = list_random( + Fraction(1,2),Fraction(1,3),Fraction(2,3), + Fraction(1,4),Fraction(1,5),Fraction(2,5), + Fraction(1,1),Fraction(2,1),Fraction(3,1),Fraction(4,1) +); +$bIn = &input($b); +$bShow = &output($b); + +$pf = (1/$b)->reduce; +$pfShow = &output($pf); +$pf2 = ($pf/2)->reduce; +$pf4 = ($pf/4)->reduce; +$cf = list_random($pf2,$pf4)*random(-1,1,2); +$d = random(-5,5,1); + +$func1 = Compute("$a*tan($bIn*(x-$cf))+$d")->reduce; +$func2 = Compute("$a*tan($bIn*x)+$d")->reduce; + +$Ox = $cf; +$Oy = $func1->eval(x=>$Ox); +$OxAbs = abs($Ox); + +$asymptoteL = ($Ox-$pf2)->reduce; +$asymptoteR = ($Ox+$pf2)->reduce; + +$Px = $cf+$pf2/2; +$Py = $func1->eval(x=>$Px); +$PxAbs = abs($Px); + +@graph = (); +($xmin, $xmax) = (-3*pi/4,3*pi/4); +($ymin, $ymax) = (-3,3); +$graph[0] = init_graph($xmin,$ymin,$xmax,$ymax); +$graph[0]->lb('reset'); + +$graph[0]->stamps(closed_circle(0,0,red)); +$graph[0]->lb(new Label(0,0,"O",'red','right','bottom',large)); +$graph[0]->stamps(closed_circle(pi/4,1,red)); +$graph[0]->lb(new Label(pi/4,1,"P",'red','right','bottom',large)); + +$graph[0]->moveTo(-pi/2,$ymin); +$graph[0]->lineTo(-pi/2,$ymax,blue,2,dashed); +$graph[0]->moveTo(pi/2,$ymin); +$graph[0]->lineTo(pi/2,$ymax,blue,2,dashed); +$graph[0]->lb(new Label(-pi/2,$ymax-1,"x=$asymptoteL",'blue','left','middle',large)); +$graph[0]->lb(new Label(pi/2,$ymin+1,"x=$asymptoteR",'blue','right','middle',large)); + +$l = -pi/2+0.01; +$r = pi/2-0.01; +add_functions($graph[0], "tan(x) for x in <$l,$r> using color:blue and weight:2"); + +$alt[0] = "This is the graph of one period of the function tan(x). The center is marked as O. Point P is also marked on the function, in the middle of Point O and the asymptote x=$asymptoteR. Two asymptotes are on the left and rigth of the function: x=$asymptoteL and x=$asymptoteR."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +$lor = ($cf>0) ? "right" : "left"; + +if ($Ox==0) { + $lorTangent = "\text{The function does not shift horizontally}"; +} elsif ($Ox>0) { + $lorTangent = "\text{The function shifts to the right by }$ox"; +} else { + $lorTangent = "\text{The function shifts to the left by }$ox"; +} + +############################################################## + +BEGIN_PGML + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +In this figure, if the coordinates of Point [`O`] are [` O([$Ox],[$Oy])`], the coordinates of Point [`P`] are [` P([$Px],[$Py])`], and if the function's two asymptotes are [`x=[$asymptoteL]`] and [`x=[$asymptoteR]`], fill in the following blanks. + +[@KeyboardInstructions( +"\n" +.'* Use fractions instead of decimals.' +."\n" +.'* Use [|pi|]* to represent [`\pi`].' +)@]** + +Find the function's equation in the form of [`f(x)=a\tan(b(x-c))+d`]. + +a) The function's midline is at [`y=`][______]{$d}. + +b) The function's period is [______]{$pf}. + +c) The value of [`a`] determines the function's vertical stretch/compression: [`a=`][______]{$a}. + +d) The function, as a transformation of [`y=\tan(x)`], is [`f(x)=`][________________________]{$func1}. + +END_PGML + +############################################################## + +BEGIN_PGML_SOLUTION + +###Part a + +Point [`O([$Ox],[$Oy])`] is on the function's midline, so the [`y`]-value of [`O`] determines the function's midline [`y=[$d]`]. + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], we have [`d=[$d]`]. + +###Part b + +In the graph, the difference between the function's two asymptotes determines the function's period: + + [`` [$asymptoteR]-([$asymptoteL]) = [$pf] ``] + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], by the formula [`\text{new period}=\frac{\text{old period}}{b}`], we have: + + [`` b = \frac{\text{old period}}{\text{new period}} = \frac{\pi}{[$pf]} = [$bShow]``] + +###Part c + +In the graph of [`y=\tan{x}`], the vertical distance between [`(0,0)`] and [`\left(\frac{\pi}{4},1\right)`] is [`1`]. In this function's graph, the vertical distance between [` O([$Ox],[$Oy])`] and [` P([$Px],[$Py])`] is [`[$Py]-([$Oy])=[$a]`]. So the value of [`a`] in [`f(x)=a\tan(b(x-c))+d`] is [`a=[$a]`]. + +###Part d + +If the function's "parent function" is [`y=\tan(x)`], its center is at [`(0,0)`]. Point [`O([$Ox],[$Oy])`] is the image of [`(0,0)`] after transformations, so its [`x`]-value tells us the horizontal shift. + +The function shifts to the [$lor] by [`[$OxAbs]`] units. + +If the function's formula is [`f(x)=a\tan(b(x-c))+d`], we have [`c=[$Ox]`]. + +Putting together all parts, the function's function is [`f(x)=[$func1]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity10.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity10.pg new file mode 100644 index 0000000000..0387c41005 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity10.pg @@ -0,0 +1,163 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \left(1+\sin(\theta))(1+\sin(-\theta)\right)"; +$right = "\displaystyle \cos^2(\theta)"; + +@steps = ( + "\displaystyle (1+\sin(\theta))(1-\sin(\theta))", + "\displaystyle 1-\sin^2(\theta)", + "\displaystyle \cos^2(\theta)", + "\displaystyle (1+\sin(\theta))(1+\sin(\theta))", + "\displaystyle 1+2\sin(\theta)+\sin^2(\theta)", + "\displaystyle 1-2\sin(\theta)+\sin^2(\theta)", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Simplify [` [$left] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identity: + + [`` \sin^2(\theta)+\cos^2(\theta) = 1 ``] + +Since [`y=\sin(\theta)`] is an odd function, + + [``\sin(-\theta) = -\sin(\theta) ``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The solution is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity20.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity20.pg new file mode 100644 index 0000000000..bf1ac09e80 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity20.pg @@ -0,0 +1,174 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\cot(\theta)}{\csc(\theta)}"; +$right = "\displaystyle \cos(\theta)"; + +@steps = ( + "\displaystyle \frac{\frac{\cos(\theta)}{\sin(\theta)}}{\frac{1}{\sin(\theta)}}", + "\displaystyle \frac{\frac{\cos(\theta)}{\sin(\theta)}\cdot\sin(\theta)}{\frac{1}{\sin(\theta)}\cdot\sin(\theta)}", + "\displaystyle \frac{\cos(\theta)}{1}", + "\displaystyle \cos(\theta)", + "\displaystyle \frac{\frac{\sin(\theta)}{\cos(\theta)}}{\frac{1}{\cos(\theta)}}", + "\displaystyle \frac{\frac{\sin(\theta)}{\cos(\theta)}\cdot\cos(\theta)}{\frac{1}{\cos(\theta)}\cdot\cos(\theta)}", + "\displaystyle \frac{\sin(\theta)}{1}", + "\displaystyle \sin(\theta)", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Simplify [` [$left] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:80px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:80px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following two identities: + + [`` \cot(\theta) = \frac{\cos(\theta)}{\sin(\theta)} \text{ and } \csc(\theta) = \frac{1}{\sin(\theta)} ``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The solution is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity30.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity30.pg new file mode 100644 index 0000000000..7fe38b8d32 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity30.pg @@ -0,0 +1,181 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle (\sin(-\theta))(\cos(-\theta))(\csc(-\theta))"; +$right = "\displaystyle \cos(\theta)"; + +@steps = ( + "\displaystyle (-\sin(\theta))(\cos(\theta))(-\csc(\theta))", + "\displaystyle \sin(\theta)\cos(\theta)\csc(\theta)", + "\displaystyle \sin(\theta)\cos(\theta)\frac{1}{\sin(\theta)}", + "\displaystyle \cos(\theta)", + "\displaystyle (\sin(\theta))(-\cos(\theta))(\csc(\theta))", + "\displaystyle -\sin(\theta)\cos(\theta)\csc(\theta)", + "\displaystyle -\sin(\theta)\cos(\theta)\frac{1}{\sin(\theta)}", + "\displaystyle \sin(\theta)", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Simplify [` [$left] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:60px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identity: + + [`` \csc(\theta) = \frac{1}{\sin(\theta)} ``] + +We must also know whether a trigonometry function is odd or even: + + [``\begin{aligned} + \sin(-\theta) &= -\sin(\theta) \\ + \cos(-\theta) &= \cos(\theta) \\ + \csc(-\theta) &= -\csc(\theta) \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The solution is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity40.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity40.pg new file mode 100644 index 0000000000..6e4fc146b5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/SimpleTrigIdentity40.pg @@ -0,0 +1,181 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle (\tan(-\theta))(\cot(-\theta))"; +$right = "\displaystyle 1"; + +@steps = ( + "\displaystyle (-\tan(\theta))(-\cot(\theta))", + "\displaystyle \tan(\theta)\cot(\theta)", + "\displaystyle \frac{\sin(\theta)}{\cos(\theta)}\cdot \frac{\cos(\theta)}{\sin(\theta)}", + "\displaystyle 1", + "\displaystyle (-\tan(\theta))(\cot(\theta))", + "\displaystyle -\tan(\theta)\cot(\theta)", + "\displaystyle -\frac{\sin(\theta)}{\cos(\theta)}\cdot \frac{\cos(\theta)}{\sin(\theta)}", + "\displaystyle -1", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Simplify [` [$left] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \tan(\theta) = \frac{\sin(\theta)}{\cos(\theta)} \text( and } \cot(\theta) = \frac{\cos(\theta)}{\sin(\theta)}``] + +We must also know whether a trigonometry function is odd or even: + + [``\begin{aligned} + \tan(-\theta) &= -\tan(\theta) \\ + \cot(-\theta) &= \cot(\theta) \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The solution is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof10.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof10.pg new file mode 100644 index 0000000000..64ab48931c --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof10.pg @@ -0,0 +1,183 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \tan^2(\theta) + 1 "; +$right = "\displaystyle \sec^2(\theta)"; + +@steps = ( + "\displaystyle \left(\frac{\sin(\theta)}{\cos(\theta)}\right)^2+1", + "\displaystyle \frac{\sin^2(\theta)}{\cos^2(\theta)}+1", + "\displaystyle \frac{\sin^2(\theta)}{\cos^2(\theta)}+\frac{\cos^2(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{\sin^2(\theta)+\cos^2(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{1}{\cos^2(\theta)}", + "\displaystyle \frac{\sin^2(\theta)}{\cos^2(\theta)}+\frac{\sin^2(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{\sin^2(\theta)+\sin^2(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{\sin^2(\theta)+1}{\cos^2(\theta)}", + "\displaystyle \frac{1}{\sin^2(\theta)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[4]}'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{I: }[$steps[$scramble{8}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following two identities: + + [`` \tan(\theta) = \frac{\sin(\theta)}{\cos(\theta)} \text{ and } \sin^2(\theta)+\cos^2(\theta) = 1 ``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$steps[4]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof20.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof20.pg new file mode 100644 index 0000000000..ed472c7837 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof20.pg @@ -0,0 +1,175 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\sec^2(\theta) - 1}{\sec^2(\theta)} "; +$right = "\displaystyle \sin^2(\theta)"; + +@steps = ( + "\displaystyle \frac{\frac{1}{\cos^2(\theta)} - 1}{\frac{1}{\cos^2(\theta)}} ", + "\displaystyle \frac{ \left(\frac{1}{\cos^2(\theta)} - 1 \right)\cdot \cos^2(\theta) }{\frac{1}{\cos^2(\theta)}\cdot \cos^2(\theta)} ", + "\displaystyle \frac{1 - \cos^2(\theta)}{1} ", + "\displaystyle \frac{\sin^2(\theta)}{1} ", + "\displaystyle \frac{\frac{1}{\sin^2(\theta)} - 1}{\frac{1}{\sin^2(\theta)}} ", + "\displaystyle \frac{ \left(\frac{1}{\sin^2(\theta)} - 1 \right)\cdot \sin^2(\theta) } {\frac{1}{\sin^2(\theta)}\cdot \sin^2(\theta)} ", + "\displaystyle \frac{\cos^2(\theta)-1}{1} ", + "\displaystyle \frac{\cos^2(\theta)}{1} ", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \sec(\theta) = \frac{1}{\cos(\theta)} \text{ and } \sin^2(\theta)+\cos^2(\theta) = 1 ``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof30.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof30.pg new file mode 100644 index 0000000000..ac9a02d9e6 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof30.pg @@ -0,0 +1,164 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\sin^2(-\theta)-\cos^2(-\theta)}{\sin(-\theta)-\cos(-\theta)} "; +$right = "\displaystyle \cos(\theta)-\sin(\theta)"; + +@steps = ( + "\displaystyle \frac{(-\sin(\theta))^2-\cos^2(\theta)}{-\sin(\theta)-\cos(\theta)} ", + "\displaystyle \frac{\sin^2(\theta)-\cos^2(\theta)}{-\left(\sin(\theta)+\cos(\theta)\right)} ", + "\displaystyle -\frac{(\sin(\theta)+\cos(\theta))(\sin(\theta)-\cos(\theta))}{\sin(\theta)+\cos(\theta)} ", + "\displaystyle -( \sin(\theta)-\cos(\theta) ) ", + "\displaystyle \frac{\sin^2(\theta)-\cos^2(\theta)}{\sin(\theta)+\cos(\theta)} ", + "\displaystyle \frac{(\sin(\theta)+\cos(\theta))(\sin(\theta)-\cos(\theta))}{\sin(\theta)+\cos(\theta)} ", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know whether a trigonometry function is odd or even: + + [``\begin{aligned} + \sin(-\theta) &= -\sin(\theta) \\ + \cos(-\theta) &= \cos(\theta) \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof40.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof40.pg new file mode 100644 index 0000000000..8468c3fd5e --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof40.pg @@ -0,0 +1,178 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle (1-\cos^2(\theta))(1+\cot^2(\theta))"; +$right = "\displaystyle 1"; + +@steps = ( + "\displaystyle \sin^2(\theta)\left(1+\frac{\cos^2(\theta)}{\sin^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{\sin^2(\theta)}{\sin^2(\theta)}+\frac{\cos^2(\theta)}{\sin^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{\sin^2(\theta)+\cos^2(\theta)}{\sin^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{1}{\sin^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(1+\frac{\sin^2(\theta)}{\cos^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{1+\sin^2(\theta)}{\cos^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{1+\cos^2(\theta)}{\sin^2(\theta)}\right)", + "\displaystyle \sin^2(\theta)\left(\frac{\cos^2(\theta)}{\cos^2(\theta)}+\frac{\cos^2(\theta)}{\sin^2(\theta)}\right)", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [``\begin{aligned} + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} \\ + \sin^2(\theta)+\cos^2(\theta) &= 1 \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof50.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof50.pg new file mode 100644 index 0000000000..43df821b28 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof50.pg @@ -0,0 +1,158 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\cos(\theta)}{1+\sin(\theta)}"; +$right = "\displaystyle \frac{1-\sin(\theta)}{\cos(\theta)}"; + +@steps = ( + "\displaystyle \frac{\cos(\theta)\cdot(1-\sin(\theta))}{(1+\sin(\theta))\cdot(1-\sin(\theta))}", + "\displaystyle \frac{\cos(\theta)\cdot(1-\sin(\theta))}{1-\sin^2(\theta)}", + "\displaystyle \frac{\cos(\theta)\cdot(1-\sin(\theta))}{\cos^2(\theta)}", + "\displaystyle \frac{\cos(\theta)\cdot(1+\sin(\theta))}{(1+\sin(\theta))\cdot(1+\sin(\theta))}", + "\displaystyle \frac{\cos(\theta)\cdot(1+\sin(\theta))}{1+\sin^2(\theta)}", + "\displaystyle \frac{\cos(\theta)\cdot\cos(\theta)}{(1+\sin(\theta))\cdot\cos(\theta)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identity: [` \sin^2(\theta)+\cos^2(\theta) = 1 `] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof60.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof60.pg new file mode 100644 index 0000000000..ffb05262ac --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof60.pg @@ -0,0 +1,180 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{1}{\csc(\theta)-\sin(\theta)}"; +$right = "\displaystyle \tan(\theta)\sec(\theta)"; + +@steps = ( + "\displaystyle \frac{1}{\frac{1}{\sin(\theta)}-\sin(\theta)}", + "\displaystyle \frac{1\cdot\sin(\theta)}{\left(\frac{1}{\sin(\theta)}-\sin(\theta)\right)\cdot\sin(\theta)}", + "\displaystyle \frac{\sin(\theta)}{1-\sin^2(\theta)}", + "\displaystyle \frac{\sin(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{\sin(\theta)}{\cos(\theta)}\cdot\frac{1}{\cos(\theta)}", + "\displaystyle \frac{1}{\frac{1-\sin(\theta)}{\sin(\theta)}}", + "\displaystyle \frac{1\cdot\sin(\theta)}{\frac{1-\sin(\theta)}{\sin(\theta)}\cdot\sin(\theta)}", + "\displaystyle \frac{\sin(\theta)}{\cos(\theta)}\cdot\frac{1}{\sin(\theta)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[4]}'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \begin{aligned} + \sin^2(\theta)+\cos^2(\theta) &= 1 \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$steps[4]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof70.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof70.pg new file mode 100644 index 0000000000..a3f3f15de5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof70.pg @@ -0,0 +1,180 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\sec(\theta)+\csc(\theta)}{1+\tan(\theta)}"; +$right = "\displaystyle \csc(\theta)"; + +@steps = ( + "\displaystyle \frac{\frac{1}{\cos(\theta)}+\frac{1}{\sin(\theta)}}{1+\frac{\sin(\theta)}{\cos(\theta)}}", + "\displaystyle \frac{\left(\frac{1}{\cos(\theta)}+\frac{1}{\sin(\theta)}\right)\cdot\sin(\theta)\cos(\theta)}{\left(1+\frac{\sin(\theta)}{\cos(\theta)}\right)\cdot\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{\sin(\theta)+\cos(\theta)}{\sin(\theta)\cos(\theta)+\sin^2(\theta)}", + "\displaystyle \frac{\sin(\theta)+\cos(\theta)}{\sin(\theta)(\cos(\theta)+\sin(\theta))}", + "\displaystyle \frac{1}{\sin(\theta)}", + "\displaystyle \frac{\cos(\theta)+\sin(\theta)}{\frac{1+\sin(\theta)}{\cos(\theta)}}", + "\displaystyle \frac{\sin(\theta)+\cos(\theta)}{\sin(\theta)\cos(\theta)+\cos^2(\theta)}", + "\displaystyle \frac{\sin(\theta)+\cos(\theta)}{\cos(\theta)(\cos(\theta)+\sin(\theta))}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[4]}'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \begin{aligned} + \csc(\theta) &= \frac{1}{\sin(\theta)} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} \\ + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$steps[4]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof80.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof80.pg new file mode 100644 index 0000000000..79ad90cfd3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof80.pg @@ -0,0 +1,183 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \tan(\theta)+\cot(\theta)"; +$right = "\displaystyle \sec(\theta)\csc(\theta)"; + +@steps = ( + "\displaystyle \frac{\sin(\theta)}{\cos(\theta)} + \frac{\cos(\theta)}{\sin(\theta)}", + "\displaystyle \frac{\sin(\theta)\cdot\sin(\theta)}{\cos(\theta)\cdot\sin(\theta)} + \frac{\cos(\theta)\cdot\cos(\theta)}{\sin(\theta)\cdot\cos(\theta)}", + "\displaystyle \frac{\sin^2(\theta)}{\sin(\theta)\cos(\theta)} + \frac{\cos^2(\theta)}{\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{\sin^2(\theta)+\cos^2(\theta)}{\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{1}{\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{1}{\sin(\theta)}\cdot\frac{1}{\cos(\theta)}", + "\displaystyle \frac{\sin(\theta)+\cos(\theta)}{\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{\sin^2(\theta)\cos^2(\theta)}{\sin(\theta)\cos(\theta)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[4]}'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[5]}'),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \begin{aligned} + \csc(\theta) &= \frac{1}{\sin(\theta)} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} \\ + \sin^2(\theta)+\cos^2(\theta) &= 1 + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$steps[4]] \\ + &= [$steps[5]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof90.pg b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof90.pg new file mode 100644 index 0000000000..2fae4dc128 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/TrigIdentity/TrigIdentityProof90.pg @@ -0,0 +1,182 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +$left = "\displaystyle \frac{\sin^2(\theta)-\tan(\theta)}{\cos^2(\theta)-\cot(\theta)}"; +$right = "\displaystyle \tan^2(\theta)"; + +@steps = ( + "\displaystyle \frac{\sin^2(\theta)-\frac{\sin(\theta)}{\cos(\theta)}}{\cos^2(\theta)-\frac{\cos(\theta)}{\sin(\theta)}}", + "\displaystyle \frac{\left(\sin^2(\theta)-\frac{\sin(\theta)}{\cos(\theta)}\right)\cdot\sin(\theta)\cos(\theta)}{\left(\cos^2(\theta)-\frac{\cos(\theta)}{\sin(\theta)}\right)\cdot\sin(\theta)\cos(\theta)}", + "\displaystyle \frac{\sin^3(\theta)\cos(\theta)-\sin^2(\theta)}{\sin(\theta)\cos^3(\theta)-\cos^2(\theta)}", + "\displaystyle \frac{\sin^2(\theta)(\sin(\theta)\cos(\theta)-1)}{\cos^2(\theta)(\sin(\theta)\cos(\theta)-1)}", + "\displaystyle \frac{\sin^2(\theta)}{\cos^2(\theta)}", + "\displaystyle \frac{\frac{\sin^2(\theta)-\sin(\theta)}{\cos(\theta)}}{\frac{\cos^2(\theta)-\cos(\theta)}{\sin(\theta)}}", + "\displaystyle \frac{\left(\sin^2(\theta)-\frac{\sin(\theta)}{\cos(\theta)}\right)\cdot\cos(\theta)}{\left(\cos^2(\theta)-\frac{\cos(\theta)}{\sin(\theta)}\right)\cdot\sin(\theta)}", + "\displaystyle \frac{\sin(\theta)(\sin(\theta)\cos(\theta)-1)}{\cos(\theta)(\sin(\theta)\cos(\theta)-1)}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..$#steps) { + do {$temp = list_random(0..$#steps)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +@popup = (); + +for my $i (0..$#steps) { + $popup[$i] = PopUp(["?", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], $ALPHABET[$inverse{$i}]); +} + +########################################################## + +BEGIN_PGML + +Prove the trigonometry identity [` [$left] = [$right] `]. + +[@DataTable( + [ + [ + [PF('[` [$left] `]'), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[0]}'),], + [PF('[` \phantom{aaaaaaaa}\text{A: }[$steps[$scramble{0}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[1]}'),], + [PF('[` \phantom{aaaaaaaa}\text{B: }[$steps[$scramble{1}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[2]}'),], + [PF('[` \phantom{aaaaaaaa}\text{C: }[$steps[$scramble{2}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[3]}'),], + [PF('[` \phantom{aaaaaaaa}\text{D: }[$steps[$scramble{3}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[`=`][_____________]{$popup[4]}'),], + [PF('[` \phantom{aaaaaaaa}\text{E: }[$steps[$scramble{4}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF('[` =[$right] `]'),], + [PF('[` \phantom{aaaaaaaa}\text{F: }[$steps[$scramble{5}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{G: }[$steps[$scramble{6}]] `]')], + ], + [ + [PF(''), + rowcss => 'height:70px;',], + [PF(''),], + [PF('[` \phantom{aaaaaaaa}\text{H: }[$steps[$scramble{7}]] `]')], + ], + ], + align => 'r l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], + ['border-right: 0px solid;', + 'border-right: 0px solid;', + 'border-right: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +We must know the following identities: + + [`` \begin{aligned} + \csc(\theta) &= \frac{1}{\sin(\theta)} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} \\ + \sin^2(\theta)+\cos^2(\theta) &= 1 + \end{aligned}``] + +To prove a trigonometry identity, we will: + +1. Start from the more complicated side of the identity. +2. Change all functions to [`\sin(\theta)`] and [`\cos(\theta)`]. +3. Use Algebra skills to try to convert the expression to the other side of the identity. +4. If stuck, start from the other side, do the same thing, and try to match where you stopped. + +The proof of [` [$left] = [$right] `] is: + + [``\begin{aligned} + [$left] &= [$steps[0]] \\ + &= [$steps[1]] \\ + &= [$steps[2]] \\ + &= [$steps[3]] \\ + &= [$steps[4]] \\ + &= [$right] + \end{aligned}``] + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues10.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues10.pg new file mode 100644 index 0000000000..29ac13ce97 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues10.pg @@ -0,0 +1,184 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$multiple = random(2,5,1); +$base = $multiple*$triples[$in][0]; +$height = $multiple*$triples[$in][1]; +$hypotenuse = $multiple*$triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If an angle [`\theta`] corresponds to the end point [`P([$base],[$height])`] on a non-unit circle, find the following values: + +[@DataTable( + [ + [ + [PF('[`P([$base],[$height])`]'), + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Graph [`P([$base],[$height])`] on the non-unit circle, we have: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues100.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues100.pg new file mode 100644 index 0000000000..075bcef6f9 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues100.pg @@ -0,0 +1,205 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$base = $triples[$in][0]; +$height = $triples[$in][1]; +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +$qOld = random(0,3,1); +if ($qOld==0) { + $baseP = $base; + $heightP = $height; +} elsif ($qOld==1) { + $baseP = -$base; + $heightP = $height; +} elsif ($qOld==2) { + $baseP = -$base; + $heightP = -$height; +} else { + $baseP = $base; + $heightP = -$height; +} +$old = Fraction($baseP,$hypotenuse); + +$change = random(1,3,1)*random(-1,1,2); +$qNew = ($qOld+$change)%4; + +if (abs($qNew-$qOld)%2==0) { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $base : -$base; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $height : -$height; +} else { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $height : -$height; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $base : -$base; +} +$ans = Fraction($baseQ,$hypotenuse); + +@Q = ('I','II','III','IV'); + +%show = ( + -3 => "-\frac{3\pi}{2}", + -2 => "-\pi", + -1 => "-\frac{\pi}{2}", + 1 => "+\frac{\pi}{2}", + 2 => "+\pi", + 3 => "+\frac{3\pi}{2}", +); + +%showA = ( + -3 => "-3pi/2", + -2 => "-pi", + -1 => "-pi/2", + 1 => "+pi/2", + 2 => "+pi", + 3 => "+3pi/2", +); + +$r = 5; +$Px = Fraction($r*$baseP,$hypotenuse)->reduce; +$Py = Fraction($r*$heightP,$hypotenuse)->reduce; +$Qx = Fraction($r*$baseQ,$hypotenuse)->reduce; +$Qy = Fraction($r*$heightQ,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$graph[0]->stamps(closed_circle( Real($Qx), Real($Qy), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Qx),Real($Qy),red,2); +$graph[0]->lineTo(Real($Qx),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Qx),$yShift); +$graph[0]->lineTo(Real($Qx)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Qx)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "bottom" : "top"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$heightP",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$baseP",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"theta",'red',$LORHeight,$TOBHyp,large)); + +$LORHeight = ($Qx>0) ? "right" : "left"; +$TOBBase = ($Qy>0) ? "bottom" : "top"; +$LORHyp = ($Qx>0) ? "right" : "left"; +$TOBHyp = ($Qy>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Qx),Real($Qy)/2,"$heightQ",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Qx)/2,0,"$baseQ",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Qx)/2,Real($Qy)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Qx),Real($Qy),"theta$showA{$change}",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point ($baseP,$heightP) on the circle. This point is marked as theta. A right triangle is formed at vertices (0,0), ($baseP,$heightP) and ($baseP,0). The base is marked as $baseP, height marked as $heightP and hypotenuse marked as $hypotenuse. Point ($baseQ,$heightQ) is also on the circle. This point is marked as theta$showA{$change} A right triangle is formed at vertices (0,0), ($baseQ,$heightQ) and ($baseQ,0). The base is marked as $baseQ, height marked as $heightQ and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\cos(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], evaluate + + [``\cos\left(\theta[$show{$change}]\right)=``][_________]{$ans} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\cos(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], we can sketch theta on a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The base is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$height]`]. + +Next, we can sketch the location of [`\left(\theta[$show{$change}]\right)`] on the same Unit Circle, and the corresponding right triangle. We can see: + + [``\cos\left(\theta[$show{$change}]\right)=[$ans]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues110.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues110.pg new file mode 100644 index 0000000000..cec68e0a93 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues110.pg @@ -0,0 +1,205 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$base = $triples[$in][0]; +$height = $triples[$in][1]; +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +$qOld = random(0,3,1); +if ($qOld==0) { + $baseP = $base; + $heightP = $height; +} elsif ($qOld==1) { + $baseP = -$base; + $heightP = $height; +} elsif ($qOld==2) { + $baseP = -$base; + $heightP = -$height; +} else { + $baseP = $base; + $heightP = -$height; +} +$old = Fraction($heightP,$baseP); + +$change = random(1,3,1)*random(-1,1,2); +$qNew = ($qOld+$change)%4; + +if (abs($qNew-$qOld)%2==0) { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $base : -$base; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $height : -$height; +} else { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $height : -$height; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $base : -$base; +} +$ans = Fraction($heightQ,$baseQ); + +@Q = ('I','II','III','IV'); + +%show = ( + -3 => "-\frac{3\pi}{2}", + -2 => "-\pi", + -1 => "-\frac{\pi}{2}", + 1 => "+\frac{\pi}{2}", + 2 => "+\pi", + 3 => "+\frac{3\pi}{2}", +); + +%showA = ( + -3 => "-3pi/2", + -2 => "-pi", + -1 => "-pi/2", + 1 => "+pi/2", + 2 => "+pi", + 3 => "+3pi/2", +); + +$r = 5; +$Px = Fraction($r*$baseP,$hypotenuse)->reduce; +$Py = Fraction($r*$heightP,$hypotenuse)->reduce; +$Qx = Fraction($r*$baseQ,$hypotenuse)->reduce; +$Qy = Fraction($r*$heightQ,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$graph[0]->stamps(closed_circle( Real($Qx), Real($Qy), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Qx),Real($Qy),red,2); +$graph[0]->lineTo(Real($Qx),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Qx),$yShift); +$graph[0]->lineTo(Real($Qx)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Qx)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "bottom" : "top"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$heightP",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$baseP",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"theta",'red',$LORHeight,$TOBHyp,large)); + +$LORHeight = ($Qx>0) ? "right" : "left"; +$TOBBase = ($Qy>0) ? "bottom" : "top"; +$LORHyp = ($Qx>0) ? "right" : "left"; +$TOBHyp = ($Qy>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Qx),Real($Qy)/2,"$heightQ",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Qx)/2,0,"$baseQ",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Qx)/2,Real($Qy)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Qx),Real($Qy),"theta$showA{$change}",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point ($baseP,$heightP) on the circle. This point is marked as theta. A right triangle is formed at vertices (0,0), ($baseP,$heightP) and ($baseP,0). The base is marked as $baseP, height marked as $heightP and hypotenuse marked as $hypotenuse. Point ($baseQ,$heightQ) is also on the circle. This point is marked as theta$showA{$change} A right triangle is formed at vertices (0,0), ($baseQ,$heightQ) and ($baseQ,0). The base is marked as $baseQ, height marked as $heightQ and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\tan(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], evaluate + + [``\tan\left(\theta[$show{$change}]\right)=``][_________]{$ans} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\tan(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], we can sketch theta on a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The base is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$height]`]. + +Next, we can sketch the location of [`\left(\theta[$show{$change}]\right)`] on the same Unit Circle, and the corresponding right triangle. We can see: + + [``\tan\left(\theta[$show{$change}]\right)=[$ans]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues20.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues20.pg new file mode 100644 index 0000000000..1c7bd026b3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues20.pg @@ -0,0 +1,187 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$multiple = random(2,5,1); +do { + if (random(0,1,1)==0) { + $base = $multiple*$triples[$in][0]*random(-1,1,2); + $height = $multiple*$triples[$in][1]*random(-1,1,2); + } else { + $base = $multiple*$triples[$in][1]*random(-1,1,2); + $height = $multiple*$triples[$in][0]*random(-1,1,2); + } +} until !($base>0 && $height>0); +$hypotenuse = $multiple*$triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If an angle [`\theta`] corresponds to the end point [`P([$base],[$height])`] on a non-unit circle, find the following values: + +[@DataTable( + [ + [ + [PF('[`P([$base],[$height])`]'), + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Graph [`P([$base],[$height])`] on the non-unit circle, we have: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues21.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues21.pg new file mode 100644 index 0000000000..ae8f44c00b --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues21.pg @@ -0,0 +1,276 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + $baseOut = random(1,5,1)*random(-1,1,2); + $baseIn = list_random(1,2,3,5); + $heightOut = random(1,5,1)*random(-1,1,2); + $heightIn = list_random(1,2,3,5); + ($hypotenuseOut,$hypotenuseIn) = &radSimplify($baseOut**2*$baseIn+$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && (($baseOut==1) || ($heightOut==1)) && ($hypotenuseIn<30) && !($baseOut>0 && $heightOut>0); + + if ($baseIn==1) { + $base = $baseOut; + } elsif (abs($baseOut)==1) { + $base = ($baseOut>0) ? Formula("sqrt($baseIn)") : Formula("-sqrt($baseIn)"); + } else { + $base = Formula("$baseOut*sqrt($baseIn)"); + } + + if ($heightIn==1) { + $height = $heightOut; + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + } + + if ($hypotenuseIn==1) { + $hypotenuse = $hypotenuseOut; + } elsif ($hypotenuseOut==1) { + $hypotenuse = Formula("sqrt($hypotenuseIn)"); + } else { + $hypotenuse = Formula("$hypotenuseOut*sqrt($hypotenuseIn)"); + } + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +If an angle [`\theta`] corresponds to the end point [`P([$base],[$height])`] on a non-unit circle, find the following values. + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`P([$base],[$height])`]'), + rowcss => 'border-bottom: 1px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Graph [`P([$base],[$height])`] on the non-unit circle, we have: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues30.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues30.pg new file mode 100644 index 0000000000..8a43816851 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues30.pg @@ -0,0 +1,185 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 1; +{ + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "I"; +} +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=[$ans[0]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$base]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues40.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues40.pg new file mode 100644 index 0000000000..c4ae95e474 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues40.pg @@ -0,0 +1,196 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=[$ans[0]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +$absBase = abs($base); + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$absBase]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues41.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues41.pg new file mode 100644 index 0000000000..28d10e0ead --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues41.pg @@ -0,0 +1,281 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $heightOut = random(1,5,1)*random(-1,1,2); + $heightIn = list_random(1,2,3,5); + $hypotenuseOut = random(int(abs($heightOut)*$heightIn**2)+2,int(abs($heightOut)*$heightIn**2)+10,1); + } until (gcd($heightOut,$hypotenuseOut)==1); + $hypotenuseIn = 1; + ($baseOut,$baseIn) = &radSimplify($hypotenuseOut**2-$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && !(($baseOut>0) && ($heightOut>0)) && ($baseIn<=30); + + $baseOut = $baseOut*random(-1,1,2); + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + if ($baseIn==1) { + $base = $baseOut; + $absBase = abs($baseOut); + } elsif (abs($baseOut)==1) { + $base = ($baseOut>0) ? Formula("sqrt($baseIn)") : Formula("-sqrt($baseIn)"); + $absBase = Formula("sqrt($baseIn)"); + } else { + $base = Formula("$baseOut*sqrt($baseIn)"); + $absBaseOut = abs($baseOut); + $absBase = Formula("$absBaseOut*sqrt($baseIn)"); + } + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + $hypotenuse = $hypotenuseOut; + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`], find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=[$ans[0]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\sin(\theta)=[$ans[0]]`]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$absBase]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues50.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues50.pg new file mode 100644 index 0000000000..24a52708dc --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues50.pg @@ -0,0 +1,185 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 1; +{ + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "I"; +} +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=[$ans[1]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The height is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$height]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues60.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues60.pg new file mode 100644 index 0000000000..b8ed1acf55 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues60.pg @@ -0,0 +1,196 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=[$ans[1]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +$absHeight = abs($height); + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The height is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$absHeight]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues61.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues61.pg new file mode 100644 index 0000000000..638ed829c5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues61.pg @@ -0,0 +1,281 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $baseOut = random(1,5,1)*random(-1,1,2); + $baseIn = list_random(1,2,3,5); + $hypotenuseOut = random(int(abs($baseOut)*$baseIn**2)+2,int(abs($baseOut)*$baseIn**2)+10,1); + } until (gcd($baseOut,$hypotenuseOut)==1); + $hypotenuseIn = 1; + ($heightOut,$heightIn) = &radSimplify($hypotenuseOut**2-$baseOut**2*$baseIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && !(($baseOut>0) && ($heightOut>0)) && ($heightIn<30); + + $heightOut = $heightOut*random(-1,1,2); + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + if ($baseIn==1) { + $base = $baseOut; + $absBase = abs($baseOut); + } elsif (abs($baseOut)==1) { + $base = ($baseOut>0) ? Formula("sqrt($baseIn)") : Formula("-sqrt($baseIn)"); + $absBase = Formula("sqrt($baseIn)"); + } else { + $base = Formula("$baseOut*sqrt($baseIn)"); + $absBaseOut = abs($baseOut); + $absBase = Formula("$absBaseOut*sqrt($baseIn)"); + } + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + $hypotenuse = $hypotenuseOut; + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`], find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=[$ans[1]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=`][_____]{$ans[2]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\cos(\theta)=[$ans[1]]`]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its hypotenuse [`[$hypotenuse]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's height is calculated by [`\sqrt{([$hypotenuse])^2-([$base])^2}=[$absHeight]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues70.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues70.pg new file mode 100644 index 0000000000..96da0f84c4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues70.pg @@ -0,0 +1,185 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = 1; +{ + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "I"; +} +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=[$ans[2]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$height]`] and its hypotenuse [`[$base]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The height is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues80.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues80.pg new file mode 100644 index 0000000000..0d24bab179 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues80.pg @@ -0,0 +1,194 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); + +$quadrant = random(2,4,1); + +if ($quadrant==2) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = $triples[$in][$j]; + $Q = "II"; +} elsif ($quadrant==3) { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = -$triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "III"; +} else { + my $i = random(0,1,1); + my $j = ($i+1)%2; + $base = $triples[$in][$i]; + $height = -$triples[$in][$j]; + $Q = "IV"; +} +$hypotenuse = $triples[$in][2]; + +#sine, cosine, tangent, cosecant, secant cotangent +@ans = ( + Fraction($height,$hypotenuse), + Fraction($base,$hypotenuse), + Fraction($height,$base), + Fraction($hypotenuse,$height), + Fraction($hypotenuse,$base), + Fraction($base,$height) +); + +$r = 5; +$Px = Fraction($r*$base,$hypotenuse)->reduce; +$Py = Fraction($r*$height,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"P($base,$height)",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P($base,$height) on the circle. A right triangle is formed at vertices (0,0), ($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`], find the following values: + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=[$ans[2]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`]. We can sketch the angle on a non-unit circle, making the right triangle's height [`[$height]`] and its base [`[$base]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues81.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues81.pg new file mode 100644 index 0000000000..8f02d1828b --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues81.pg @@ -0,0 +1,279 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); +$refreshCachedImages=1; + +#Input is a prime. Output is the next prime number. +sub nextPrime { + my $p = shift; + while (1) { + $p++; + if ($p%2==0) {next;} + $isPrime = 1; + for (my $i=3; $i<=sqrt($p); $i=$i+2) { + if ($p%$i==0) { + $isPrime=0; + last; + } + } + if ($isPrime==1) {return $p;} + } +} + +# Input is a number n. Output is ($out, $in) +# in the simplified form of $out*sqrt($in). +sub radSimplify { + my $n = shift; + my $out = 1; + my $in = $n; + my $prime = 2; + my $lastPrime = -1; + while (1) { + while ($n%$prime==0) { + if ($prime == $lastPrime) { + $out *= $prime; + $lastPrime = -1; + $in = $in/$prime**2; + } else { + $lastPrime = $prime; + } + $n=$n/$prime; + } + if ($n==1) {return ($out, $in);} + $prime = &nextPrime($prime); + } +} + +#Input is $outT*sqrt($inT) / $outB*sqrt($inB) +#output is rationalized $num*sqrt($in1)/$den +sub rationalize { + my ($outT, $inT, $outB, $inB) = @_; + my ($out1, $in1) = &radSimplify($inT*$inB); + Context("Fraction"); + my ($num,$den) = Fraction($outT*$out1,$outB*$inB)->reduce->value; + Context("LimitedRadical"); + if ($den==1) { + if ($num==1) { + return ($in1==1) ? Formula("1") : Formula("sqrt($in1)"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1") : Formula("-sqrt($in1)"); + } else { + return ($in1==1) ? Formula("$num") : Formula("$num*sqrt($in1)"); + } + } else { + if ($num==1) { + return ($in1==1) ? Formula("1/$den") : Formula("sqrt($in1)/$den"); + } elsif ($num==-1) { + return ($in1==1) ? Formula("-1/$den") : Formula("-sqrt($in1)/$den"); + } else { + return ($in1==1) ? Formula("$num/$den") : Formula("$num*sqrt($in1)/$den"); + } + } +} + +Context("LimitedRadical"); + + do { + do { + $baseOut = random(1,5,1)*random(-1,1,2); + $heightIn = list_random(1,2,3,5); + $heightOut = random(1,5,1)*random(-1,1,2); + } until (gcd(abs($heightOut),abs($baseOut))==1); + $baseIn = 1; + ($hypotenuseOut,$hypotenuseIn) = &radSimplify($baseOut**2*$baseIn+$heightOut**2*$heightIn); + } until (!($baseIn==1 && $heightIn==1 && $hypotenuseIn==1)) && !(($baseOut>0) && ($heightOut>0)) && ($hypotenuseIn<30); + + $heightOut = $heightOut*random(-1,1,2); + if ($baseOut*$heightOut>0) { + $Q = ($baseOut>0) ? "I" : "III"; + } else { + $Q = ($baseOut>0) ? "IV" : "II"; + } + + + $base = $baseOut; + $absBase = abs($baseOut); + + if ($heightIn==1) { + $height = $heightOut; + $absHeight = abs($heightOut); + } elsif (abs($heightOut)==1) { + $height = ($heightOut>0) ? Formula("sqrt($heightIn)") : Formula("-sqrt($heightIn)"); + $absHeight = Formula("sqrt($heightIn)"); + } else { + $height = Formula("$heightOut*sqrt($heightIn)"); + $absHeightOut = abs($heightOut); + $absHeight = Formula("$absHeightOut*sqrt($heightIn)"); + } + + if ($hypotenuseIn==1) { + $hypotenuse = $hypotenuseOut; + } elsif (abs($hypotenuseOut)==1) { + $hypotenuse = Formula("sqrt($hypotenuseIn)"); + } else { + $hypotenuse = Formula("$hypotenuseOut*sqrt($hypotenuseIn)"); + } + + $sine = &rationalize($heightOut,$heightIn,$hypotenuseOut,$hypotenuseIn); + $cosine = &rationalize($baseOut,$baseIn,$hypotenuseOut,$hypotenuseIn); + $tangent = &rationalize($heightOut,$heightIn,$baseOut,$baseIn); + $cosecant = &rationalize($hypotenuseOut,$hypotenuseIn,$heightOut,$heightIn); + $secant = &rationalize($hypotenuseOut,$hypotenuseIn,$baseOut,$baseIn); + $cotangent = &rationalize($baseOut,$baseIn,$heightOut,$heightIn); + + @ans = ($sine,$cosine,$tangent,$cosecant,$secant,$cotangent); + +Context("Numeric"); + +$r = 5; +$Px = $r*$baseOut*sqrt($baseIn)/($hypotenuseOut*sqrt($hypotenuseIn)); +$Py = $r*$heightOut*sqrt($heightIn)/($hypotenuseOut*sqrt($hypotenuseIn)); + +@graph = (); +$graph[0] = init_graph(-8,-8,8,8,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( $Px, $Py, red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($Px,$Py,red,2); +$graph[0]->lineTo($Px,0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.2 : 0.2; +$yShift = ($Py>0) ? 0.2 : -0.42; +$graph[0]->moveTo($Px,$yShift); +$graph[0]->lineTo($Px+$xShift,$yShift,red,2); +$graph[0]->lineTo($Px+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "top" : "bottom"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$LORShift = ($Px>0) ? 0.2 : -0.2; +$graph[0]->lb(new Label($Px+$LORShift,$Py/2,"$height",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label($Px/2,0,"$base",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label($Px/2,$Py/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label($Px,$Py,"P",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point P on the circle. A right triangle is formed at vertices (0,0), P($base,$height) and ($base,0). The base is marked as $base, height marked as $height and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + + +############################################################## + +BEGIN_PGML + +If [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`], find the following values: + +[@KeyboardInstructions( +"\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\sin(\theta)=`][_____]{$ans[0]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\csc(\theta)=`][_____]{$ans[3]}')], + ], + [ + [PF('[`\cos(\theta)=`][_____]{$ans[1]}'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\sec(\theta)=`][_____]{$ans[4]}')], + ], + [ + [PF('[`\tan(\theta)=[$ans[2]]`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\cot(\theta)=`][_____]{$ans[5]}')], + ], + ], + align => 'c c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\theta`] is in Quadrant [$Q] and [`\tan(\theta)=[$ans[2]]`]. We can sketch the angle on a non-unit circle, making the right triangle's base [`[$base]`] and its height [`[$height]`]: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The triangle's hypotenuse is calculated by [`\sqrt{([$base])^2+([$height])^2}=[$hypotenuse]`]. + +Next, we can write the angle's trigonometry values by definition: + + [``\begin{aligned} + \sin(\theta) &= \frac{\text{opposite}}{\text{hypotenuse}} = \frac{[$height]}{[$hypotenuse]} = [$ans[0]] \\ + \cos(\theta) &= \frac{\text{adjacent}}{\text{hypotenuse}} = \frac{[$base]}{[$hypotenuse]} = [$ans[1]] \\ + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{[$ans[0]]}{[$ans[1]]} = [$ans[2]] \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{[$ans[0]]} = [$ans[3]] \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{[$ans[1]]} = [$ans[4]] \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{[$ans[1]]}{[$ans[0]]} = [$ans[5]] \\ + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues90.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues90.pg new file mode 100644 index 0000000000..c86d4d9428 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/NonUnitCircleValues90.pg @@ -0,0 +1,205 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "contextFraction.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +$refreshCachedImages=1; + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$base = $triples[$in][0]; +$height = $triples[$in][1]; +$hypotenuse = $triples[$in][2]; + +if (random(0,1,1)==1) { + ($base,$height) = ($height,$base); +} + +$qOld = random(0,3,1); +if ($qOld==0) { + $baseP = $base; + $heightP = $height; +} elsif ($qOld==1) { + $baseP = -$base; + $heightP = $height; +} elsif ($qOld==2) { + $baseP = -$base; + $heightP = -$height; +} else { + $baseP = $base; + $heightP = -$height; +} +$old = Fraction($heightP,$hypotenuse); + +$change = random(1,3,1)*random(-1,1,2); +$qNew = ($qOld+$change)%4; + +if (abs($qNew-$qOld)%2==0) { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $base : -$base; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $height : -$height; +} else { + $baseQ = ( ($qNew==0) || ($qNew==3) ) ? $height : -$height; + $heightQ = ( ($qNew==0) || ($qNew==1) ) ? $base : -$base; +} +$ans = Fraction($heightQ,$hypotenuse); + +@Q = ('I','II','III','IV'); + +%show = ( + -3 => "-\frac{3\pi}{2}", + -2 => "-\pi", + -1 => "-\frac{\pi}{2}", + 1 => "+\frac{\pi}{2}", + 2 => "+\pi", + 3 => "+\frac{3\pi}{2}", +); + +%showA = ( + -3 => "-3pi/2", + -2 => "-pi", + -1 => "-pi/2", + 1 => "+pi/2", + 2 => "+pi", + 3 => "+3pi/2", +); + +$r = 5; +$Px = Fraction($r*$baseP,$hypotenuse)->reduce; +$Py = Fraction($r*$heightP,$hypotenuse)->reduce; +$Qx = Fraction($r*$baseQ,$hypotenuse)->reduce; +$Qy = Fraction($r*$heightQ,$hypotenuse)->reduce; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$graph[0]->stamps(closed_circle( Real($Px), Real($Py), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Px),Real($Py),red,2); +$graph[0]->lineTo(Real($Px),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$graph[0]->stamps(closed_circle( Real($Qx), Real($Qy), red )); +$graph[0]->moveTo(0,0); +$graph[0]->lineTo(Real($Qx),Real($Qy),red,2); +$graph[0]->lineTo(Real($Qx),0,red,2); +$graph[0]->lineTo(0,0,red,2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Px),$yShift); +$graph[0]->lineTo(Real($Px)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Px)+$xShift,0,red,2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph[0]->moveTo(Real($Qx),$yShift); +$graph[0]->lineTo(Real($Qx)+$xShift,$yShift,red,2); +$graph[0]->lineTo(Real($Qx)+$xShift,0,red,2); + +$LORHeight = ($Px>0) ? "left" : "right"; +$TOBBase = ($Py>0) ? "bottom" : "top"; +$LORHyp = ($Px>0) ? "right" : "left"; +$TOBHyp = ($Py>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Px),Real($Py)/2,"$heightP",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Px)/2,0,"$baseP",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Px)/2,Real($Py)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Px),Real($Py),"theta",'red',$LORHeight,$TOBHyp,large)); + +$LORHeight = ($Qx>0) ? "right" : "left"; +$TOBBase = ($Qy>0) ? "bottom" : "top"; +$LORHyp = ($Qx>0) ? "right" : "left"; +$TOBHyp = ($Qy>0) ? "bottom" : "top"; +$graph[0]->lb(new Label(Real($Qx),Real($Qy)/2,"$heightQ",'red',$LORHeight,'middle',large)); +$graph[0]->lb(new Label(Real($Qx)/2,0,"$baseQ",'red','center',$TOBBase,large)); +$graph[0]->lb(new Label(Real($Qx)/2,Real($Qy)/2,"$hypotenuse",'red',$LORHyp,$TOBHyp,large)); +$graph[0]->lb(new Label(Real($Qx),Real($Qy),"theta$showA{$change}",'red',$LORHeight,$TOBHyp,large)); + + +$alt[0] = "This is the graph of a circle with point ($baseP,$heightP) on the circle. This point is marked as theta. A right triangle is formed at vertices (0,0), ($baseP,$heightP) and ($baseP,0). The base is marked as $baseP, height marked as $heightP and hypotenuse marked as $hypotenuse. Point ($baseQ,$heightQ) is also on the circle. This point is marked as theta$showA{$change} A right triangle is formed at vertices (0,0), ($baseQ,$heightQ) and ($baseQ,0). The base is marked as $baseQ, height marked as $heightQ and hypotenuse marked as $hypotenuse."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + + +############################################################## + +BEGIN_PGML + +If [`\sin(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], evaluate + + [``\sin\left(\theta[$show{$change}]\right)=``][_________]{$ans} + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +It's given that [`\sin(\theta)=[$old]`] and [`\theta`] is in Quadrant [$Q[$qOld]], we can sketch theta on a non-Unit Circle: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The base is calculated by [`\sqrt{([$hypotenuse])^2-([$height])^2}=[$base]`]. + +Next, we can sketch the location of [`\left(\theta[$show{$change}]\right)`] on the same Unit Circle, and the corresponding right triangle. We can see: + + [``\sin\left(\theta[$show{$change}]\right)=[$ans]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/OddEven10.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/OddEven10.pg new file mode 100644 index 0000000000..bae04373dc --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/OddEven10.pg @@ -0,0 +1,180 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("LimitedFraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +#sin, cos, tan, csc, sec, cot +@values = (); + +@num = (); +@den = (); + +for my $i (0..5) { + if ( ($i==0) || ($i==1) ) { + do { + $den[$i] = random(2,10,1); + $num[$i] = random(1,$den[$i]-1,1); + } until (gcd($den[$i],$num[$i])==1); + $values[$i] = Fraction($num[$i],$den[$i])->reduce; + } elsif ( ($i==2) || ($i==5) ) { + $den[$i] = random(2,10,1); + $num[$i] = random(2,10,1); + $values[$i] = Fraction($num[$i],$den[$i])->reduce; + } else { + do { + $den[$i] = random(2,10,1); + $num[$i] = random(1,$den[$i]-1,1); + } until (gcd($den[$i],$num[$i])==1); + $values[$i] = Fraction($den[$i],$num[$i])->reduce; + } +} + +@ans = ( ); +for my $i (0..5) { + $values[$i] = random(-1,1,2)*$values[$i]; + if ( ($i==0) || ($i==2) || ($i==3) || ($i==5) ) { + $ans[$i] = -$values[$i]; + } else { + $ans[$i] = $values[$i]; + } +} + + +$showPartialCorrectAnswers = 1; + +$r = 5; + +$graph = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$A_pt = closed_circle( $r/sqrt(2), $r/sqrt(2), red ); +$B_pt = closed_circle( $r/sqrt(2), -$r/sqrt(2), red ); +$graph -> stamps($A_pt, $B_pt); + +$graph->lb(new Label(0.4,0,"H",'red','left','bottom',large)); +$graph->lb(new Label(0.4,0,"-H",'red','left','top',large)); +$graph->lb(new Label($r/sqrt(2), $r/sqrt(2),"P(a,b)",'red','left','bottom',large)); +$graph->lb(new Label($r/sqrt(2), -$r/sqrt(2),"Q(a,-b)",'red','left','top',large)); + +$graph->moveTo(0,0); +$graph->lineTo($r/sqrt(2), $r/sqrt(2), red, 2); +$graph->lineTo($r/sqrt(2), -$r/sqrt(2), red, 2); +$graph->lineTo(0, 0, red, 2); +$graph->lineTo($r/sqrt(2), 0, red, 2); + +$graph->lb(new Label($r/(2*sqrt(2)), 0,"a",'red','center','top',large)); +$graph->lb(new Label($r/sqrt(2), $r/(2*sqrt(2)),"b",'red','left','middle',large)); +$graph->lb(new Label($r/sqrt(2), -$r/(2*sqrt(2)),"-b",'red','left','middle',large)); +$graph->lb(new Label($r/(2*sqrt(2)), $r/(2*sqrt(2)),"c",'red','right','bottom',large)); +$graph->lb(new Label($r/(2*sqrt(2)), -$r/(2*sqrt(2)),"c",'red','right','top',large)); + +$graph->moveTo($r/sqrt(2), 0.4); +$graph->lineTo($r/sqrt(2)-0.4, 0.4, red, 2); +$graph->lineTo($r/sqrt(2)-0.4, 0, red, 2); +$graph->moveTo($r/sqrt(2), -0.3); +$graph->lineTo($r/sqrt(2)-0.3, -0.3, red, 2); +$graph->lineTo($r/sqrt(2)-0.3, 0, red, 2); + +$alt = "This is the graph of a unit circle. On the circle, Point P is in the first quadrant at (a, b), and Point Q is in the fourth quadrant at (a, -b). Point P and Q are connected, forming two right triangles with the unit circle center. In the triangle in Quadrant I, the central angle is marked as H. The side opposite to H is marked as b, the side adjacent to H is marked as a, and the hypotenuse is marked as c. In the triangle in Quadrant IV, the central angle is marked as -H. The side opposite to -H is marked as -b, the side adjacent to -H is marked as a, and the hypotenuse is marked as c."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +############################################## + +BEGIN_PGML + +If [`\sin(A)=[$values[0]]`], then [`\sin(-A)=`][_____________]{$ans[0]}. + +If [`\cos(B)=[$values[1]]`], then [`\cos(-B)=`][_____________]{$ans[1]}. + +If [`\tan(C)=[$values[2]]`], then [`\tan(-C)=`][_____________]{$ans[2]}. + +If [`\csc(D)=[$values[3]]`], then [`\csc(-D)=`][_____________]{$ans[3]}. + +If [`\sec(E)=[$values[4]]`], then [`\sec(-E)=`][_____________]{$ans[4]}. + +If [`\cot(F)=[$values[5]]`], then [`\cot(-F)=`][_____________]{$ans[5]}. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +Look at [`\angle H`] and [`\angle -H`] in the Unit Circle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +###Sine function and cosecant function + +Note that [`\sin(H)=\frac{b}{c}`] and [`\sin(-H)=\frac{-b}{c}`]. Since [`\sin(-H)=-\sin(H)`], [`y=\sin(x)`] is an odd function. + +As a result, if [`\sin(A)=[$values[0]]`], then [`\sin(-A)=`][`[$ans[0]]`]. + +Since [`\csc(x)=\frac{1}{\sin(x)}`], [`y=\csc(x)`] is also an odd function. + +If [`\csc(D)=[$values[3]]`], then [`\csc(-D)=`][`[$ans[3]]`]. + +###Cosine function and secant function + +Note that [`\cos(H)=\frac{a}{c}`] and [`\cos(-H)=\frac{a}{c}`]. Since [`\cos(-H)=\cos(H)`], [`y=\cos(x)`] is an even function. + +As a result, if [`\cos(B)=[$values[1]]`], then [`\cos(-B)=`][`[$ans[1]]`]. + +Since [`\sec(x)=\frac{1}{\cos(x)}`], [`y=\sec(x)`] is also an even function. + +If [`\sec(E)=[$values[4]]`], then [`\sec(-E)=`][`[$ans[4]]`]. + +###Tangent function and cotangent function + +Note that [`\tan(H)=\frac{b}{a}`] and [`\tan(-H)=\frac{-b}{a}`]. Since [`\tan(-H)=-\tan(H)`], [`y=\tan(x)`] is an odd function. + +As a result, if [`\tan(C)=[$values[2]]`], then [`\tan(-C)=`][`[$ans[2]]`]. + +Since [`\cot(x)=\frac{1}{\tan(x)}`], [`y=\cot(x)`] is also an odd function. + +If [`\cot(F)=[$values[5]]`], then [`\cot(-F)=`][`[$ans[5]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle10.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle10.pg new file mode 100644 index 0000000000..f645606879 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle10.pg @@ -0,0 +1,171 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); + +@num = (); +do { + $den = random(3,10,1); + $num[0] = random(1, int($den/2), 1); +} until (gcd($den,$num[0])==1); +$num[1] = $den-$num[0]; +$num[2] = $den+$num[0]; +$num[3] = 2*$den-$num[0]; + +@angles = (); +for my $i (0..3) { + $angles[$i] = specialAngle($num[$i]*pi/$den, (3..10)); +} + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]*pi/$den); + $Ay[$i] = $r*sin($num[$i]*pi/$den); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $textA = $num[$i]==1 ? "A: pi/$den" : "A: $num[$i] pi/$den"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],$textA,'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point $textA is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +$id = random(1,3,1); + +############################################## + +BEGIN_PGML + +Find the angle's reference angle. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Enter [|pi|]* to represent [`\pi`].' +)@]** + +Reference angle of [`[$angles[[$id]]]`] is [____________]{$angles[0]}. + +END_PGML + +############################################## + +if ($id==1) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA"; + $s4 = "\pi - ".$angles[1]->TeX; +} elsif ($id==2) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}"; + $s4 = $angles[2]->TeX." - \pi"; +} else { + $s1 = "AOE"; + $s2 = "\text{measure of arc } AE"; + $s3 = "\text{measure of major arc }EFE \text{ (whole circle)} - \text{measure of major arc }EFA"; + $s4 = "2\pi-".$angles[3]->TeX; +} + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle with Point A corresponding to [`[$angles[[$id]]]`] radians: + +>>[@ $fig[[$id]] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The reference angle of [`[$angle[[$id]]]`] radians is the measure of [`\angle [$s1]`]. + + [``\begin{aligned} + m\angle [$s1] &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$angles[0]] + \end{aligned}``] + +Reference angle of [`[$angles[[$id]]]`] is [`[$angles[0]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle20.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle20.pg new file mode 100644 index 0000000000..c3f95f9f13 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle20.pg @@ -0,0 +1,183 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set(requirePureFractions=>1); +Context()->flags->set(showMixedNumbers=>0); + +@num = (); +do { + $den = random(3,10,1); + $num[0] = random(1, int($den/2), 1); +} until (gcd($den,$num[0])==1); +$num[1] = $den-$num[0]; +$num[2] = $den+$num[0]; +$num[3] = 2*$den-$num[0]; + +@angles = (); +for my $i (0..3) { + $angles[$i] = specialAngle($num[$i]*pi/$den, (3..10)); +} + +$id = random(1,3,1); +$off = random(2,5,1)*random(-1,1,2); +$angleShow = specialAngle($num[$i]*pi/$den+$off*2*pi, (3..10)); + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]*pi/$den); + $Ay[$i] = $r*sin($num[$i]*pi/$den); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $textA = $num[$i]==1 ? "A: pi/$den" : "A: $num[$i] pi/$den"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],$textA,'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point $textA is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + + + +############################################## + +BEGIN_PGML + +Find the angle's reference angle. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Enter [|pi|]* to represent [`\pi`].' +)@]** + +Reference angle of [`[$angleShow]`] is [____________]{$angles[0]}. + +END_PGML + +############################################## + +if ($id==1) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA"; + $s4 = "\pi - ".$angles[1]->TeX; +} elsif ($id==2) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}"; + $s4 = $angles[2]->TeX." - \pi"; +} else { + $s1 = "AOE"; + $s2 = "\text{measure of arc } AE"; + $s3 = "\text{measure of major arc }EFE \text{ (whole circle)} - \text{measure of major arc }EFA"; + $s4 = "2\pi-".$angles[3]->TeX; +} + +BEGIN_PGML_SOLUTION + +First, let's convert [`[$angleShow]`] to an angle in the range of [`[0,2\pi)`]: + + [``[$angleShow]-[$off]\cdot2\pi = [$angles[[$id]]]``] + +Since [`[$angleShow]`] and [`[$angles[[$id]]]`] are located on the same spot on the Unit Circle, we can simply find the reference angle of [`[$angles[[$id]]]`]. + +Here is a Unit Circle with Point A corresponding to [`[$angles[[$id]]]`] radians: + +>>[@ $fig[[$id]] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The reference angle of [`[$angle[[$id]]]`] radians is the measure of [`\angle [$s1]`]. + + [``\begin{aligned} + m\angle [$s1] &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$angles[0]] + \end{aligned}``] + +Reference angle of [`[$angleShow]`] is [`[$angles[0]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle30.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle30.pg new file mode 100644 index 0000000000..b674066aa2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle30.pg @@ -0,0 +1,172 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); + +@num = (); +do { + $den = list_random(3,4,5,6,9,10); + $num[0] = random(1, int($den/2), 1); +} until (gcd($den,$num[0])==1); +$num[1] = $den-$num[0]; +$num[2] = $den+$num[0]; +$num[3] = 2*$den-$num[0]; + +@angles = (); +@anglesD = (); +for my $i (0..3) { + $angles[$i] = specialAngle($num[$i]*pi/$den, (3..10)); + $anglesD[$i] = $num[$i]*180/$den; +} + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]*pi/$den); + $Ay[$i] = $r*sin($num[$i]*pi/$den); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $anglesD[$i] degrees",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $anglesD[$i] degree is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +$id = random(1,3,1); + +############################################## + +BEGIN_PGML + +Find the angle's reference angle. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Enter [|pi|]* to represent [`\pi`].' +)@]** + +Reference angle of [`[$anglesD[[$id]]]^{\circ}`] is [____________]{$anglesD[0]} [`^{\circ}`]. + +END_PGML + +############################################## + +if ($id==1) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA"; + $s4 = "180^{\circ} - $anglesD[1]^{\circ}"; +} elsif ($id==2) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}"; + $s4 = "$anglesD[2]^{\circ} - 180^{\circ}"; +} else { + $s1 = "AOE"; + $s2 = "\text{measure of arc } AE"; + $s3 = "\text{measure of major arc }EFE \text{ (whole circle)} - \text{measure of major arc }EFA"; + $s4 = "360^{\circ}-$anglesD[3]^{\circ}"; +} + +BEGIN_PGML_SOLUTION + +Here is a Unit Circle with Point A corresponding to [`[$anglesD[[$id]]]^{\circ}`]: + +>>[@ $fig[[$id]] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The reference angle of [`[$angleD[[$id]]]^{\circ}`] is the measure of [`\angle [$s1]`]. + + [``\begin{aligned} + m\angle [$s1] &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$anglesD[0]]^{\circ} + \end{aligned}``] + +Reference angle of [`[$anglesD[[$id]]]^{\circ}`] is [`[$anglesD[0]]^{\circ}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle40.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle40.pg new file mode 100644 index 0000000000..66bad52dc4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle40.pg @@ -0,0 +1,180 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "contextFraction.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); + +@num = (); +do { + $den = list_random(3,4,5,6,9,10); + $num[0] = random(1, int($den/2), 1); +} until (gcd($den,$num[0])==1); +$num[1] = $den-$num[0]; +$num[2] = $den+$num[0]; +$num[3] = 2*$den-$num[0]; + +@angles = (); +@anglesD = (); +for my $i (0..3) { + $angles[$i] = specialAngle($num[$i]*pi/$den, (3..10)); + $anglesD[$i] = $num[$i]*180/$den; +} + +$id = random(1,3,1); +$off = random(2,5,1)*random(-1,1,2); +$angleShow = $anglesD[$id]+$off*360; + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]*pi/$den); + $Ay[$i] = $r*sin($num[$i]*pi/$den); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $anglesD[$i] degrees",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $anglesD[$i] degree is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +############################################## + +BEGIN_PGML + +Find the angle's reference angle. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer if needed.' +."\n" +.'* Enter [|pi|]* to represent [`\pi`].' +)@]** + +Reference angle of [`[$angleShow]^{\circ}`] is [____________]{$anglesD[0]} [`^{\circ}`]. + +END_PGML + +############################################## + +if ($id==1) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA"; + $s4 = "180^{\circ} - $anglesD[1]^{\circ}"; +} elsif ($id==2) { + $s1 = "AOF"; + $s2 = "\text{measure of arc } AF"; + $s3 = "\text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}"; + $s4 = "$anglesD[2]^{\circ} - 180^{\circ}"; +} else { + $s1 = "AOE"; + $s2 = "\text{measure of arc } AE"; + $s3 = "\text{measure of major arc }EFE \text{ (whole circle)} - \text{measure of major arc }EFA"; + $s4 = "360^{\circ}-$anglesD[3]^{\circ}"; +} + +BEGIN_PGML_SOLUTION + +First, let's convert [`[$angleShow]`] to an angle in the range of [`[0^{\circ},360^{\circ})`]: + + [``[$angleShow]-[$off]\cdot360^{\circ} = [$anglesD[[$id]]]^{\circ}``] + +Since [`[$angleShow]`] and [`[$anglesD[[$id]]]`] are located on the same spot on the Unit Circle, we can simply find the reference angle of [`[$anglesD[[$id]]]^{\circ}`]. + +Here is a Unit Circle with Point A corresponding to [`[$anglesD[[$id]]]^{\circ}`]: + +>>[@ $fig[[$id]] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The reference angle of [`[$angleD[[$id]]]^{\circ}`] is the measure of [`\angle [$s1]`]. + + [``\begin{aligned} + m\angle [$s1] &= [$s2] \\ + &= [$s3] \\ + &= [$s4] \\ + &= [$anglesD[0]]^{\circ} + \end{aligned}``] + +Reference angle of [`[$anglesD[[$id]]]^{\circ}`] is [`[$anglesD[0]]^{\circ}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle50.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle50.pg new file mode 100644 index 0000000000..eaeeba8779 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/ReferenceAngle50.pg @@ -0,0 +1,198 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PCCmacros.pl", + "contextLimitedRadical.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@num = (); +for my $i (0..3) { + $num[$i] = random(int(10*(3*$i+1)*pi/6+0.5)/10, int(10*(3*$i+2)*pi/6+0.5)/10, 0.1); +} + +@ans = (); +$ans[0] = Compute("$num[0]"); +$ans[1] = Compute("pi-$num[1]"); +$ans[2] = Compute("$num[2]-pi"); +$ans[3] = Compute("2*pi-$num[3]"); + +$r = 5; +@Ax = (); @Ay = (); +@Bx = (); @By = (); + +for my $i (0..3) { + $Ax[$i] = $r*cos($num[$i]); + $Ay[$i] = $r*sin($num[$i]); + $Bx[$i] = $r*cos($ans[$i]); + $By[$i] = $r*sin($ans[$i]); +} + +@graph = (); +for my $i (0..3) { + $graph[$i] = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); + $graph[$i]->lb('reset'); + + $xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; + $yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; + $fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[$i] ); + $fnAlpha->domain(0,2*pi); + + $graph[$i] -> stamps( closed_circle( $Ax[$i], $Ay[$i], red ) ); + $graph[$i] -> stamps( closed_circle( $Ax[$i], 0, red ) ); + $graph[$i] -> stamps( closed_circle( 0, 0, red ) ); + $graph[$i] -> stamps( closed_circle( $r, 0, red ) ); + $graph[$i] -> stamps( closed_circle( -$r, 0, red ) ); + + $graph[$i]->lb(new Label($r,0,"E",'red',"left","top",large)); + $graph[$i]->lb(new Label(-$r,0,"F",'red',"right","top",large)); + + if ($Ax[$i]>0) { + $Alor = ($Ax[$i]<$r/2) ? "left" : "center"; + } else { + $Alor = (-$Ax[$i]>$r/2) ? "center" : "right"; + } + $Auod = ($Ay[$i]>0) ? "bottom" : "top"; + $graph[$i]->lb(new Label($Ax[$i],$Ay[$i],"A: $num[$i]",'red',$Alor,$Auod,large)); + $Clor = ($Ax[$i]>0) ? "left" : "right"; + $Cuod = ($Ay[$i]>0) ? "top" : "bottom"; + $graph[$i]->lb(new Label($Ax[$i],0,"C",'red',$Clor,$Cuod,large)); + + $Ouod = ($Ay[$i]>0) ? 'top' : 'bottom'; + $graph[$i]->lb(new Label(0,0,"O",'red','left',$Ouod,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->lineTo($Ax[$i], $Ay[$i], red, 2); + $graph[$i]->lineTo($Ax[$i], 0, red, 2); + $graph[$i]->lineTo(0,0,red,2); + + $xShift = ($Ax[$i]>0) ? -0.4 : 0.4; + $yShift = ($Ay[$i]>0) ? 0.4 : -0.4; + $graph[$i]->moveTo($Ax[$i], $yShift); + $graph[$i]->lineTo($Ax[$i]+$xShift, $yShift, red, 2); + $graph[$i]->lineTo($Ax[$i]+$xShift, 0, red, 2); + + $alt[$i] = "A unit circle has O as its center, E at (1,0) and F at (-1,0). On the unit circle, point A: $num[$i] is marked on the circle. From A, a vertical line is drawn toward the x-axis, crossing the x-axis at C. AOC is a right triangle, with angle C being the right angle."; + + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[$i]' title = '$alt[$i]' "); +} + +############################################## + +BEGIN_PGML + +Find each angle's reference angle in decimals. All numbers are in radians. + +a) Reference angle of [`[$num[0]]`] is [____________]{$ans[0]}. + +b) Reference angle of [`[$num[1]]`] is [____________]{$ans[1]}. + +c) Reference angle of [`[$num[2]]`] is [____________]{$ans[2]}. + +d) Reference angle of [`[$num[3]]`] is [____________]{$ans[3]}. + +END_PGML + +############################################## + +$showPartialCorrectAnswers = 0; + +############################################## + +$ans2N = -$ans[2]; + +BEGIN_PGML_SOLUTION + +###Part a + +Here is a Unit Circle with Point A corresponding to [`[$num[0]]`] radians: + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +The reference angle of [`[$num[0]]`] radians is simply the measure of [`\angle AOE`], which is [`[$num[0]]`] radians. + +Reference angle of [`[$num[0]]`] is [`[$ans[0]]`]. + +###Part b + +>>[@ $fig[1] @]*<< + +The reference angle of [`[$num[1]]`] radians is the measure of [`\angle AOF`]. + + [``\begin{aligned} + m\angle AOF &= \text{measure of minor arc }AF \\ + &= \text{measure of major arc }EAF \text{ (semicircle)} - \text{measure of minor arc }EA \\ + &= \pi - [$num[1]] \\ + &= [$ans[1]] + \end{aligned}``] + +Reference angle of [`[$num[1]]`] is [`[$ans[1]]`]. + +###Part c + +>>[@ $fig[2] @]*<< + +The reference angle of [`[$num[2]]`] radians is the measure of [`\angle AOF`]. + + [``\begin{aligned} + m\angle AOF &= \text{measure of minor arc }AF \\ + &= \text{measure of major arc }EFA - \text{measure of major arc }EF \text{ (semicircle)}\\ + &= [$num[2]] - \pi\\ + &= [$ans[2]] + \end{aligned}``] + +Reference angle of [`[$num[2]]`] is [`[$ans[2]]`]. + +###Part d + +>>[@ $fig[3] @]*<< + +The reference angle of [`[$num[2]]`] radians is the measure of [`\angle AOE`]. + + [``\begin{aligned} + m\angle AOE &= \text{measure of minor arc }AE \\ + &= \text{measure of major arc }EFE \text{ (whole circle)} - \text{measure of major arc }EFA \\ + &= 2\pi-[$num[3]] \\ + &= [$ans[3]] + \end{aligned}``] + +Reference angle of [`[$num[3]]`] is [`[$ans[3]]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/TrigDomainRange10.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/TrigDomainRange10.pg new file mode 100644 index 0000000000..02e264b96c --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/TrigDomainRange10.pg @@ -0,0 +1,171 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +###################################### + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGchoicemacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "niceTables.pl", + "PCCmacros.pl", + "PGcourse.pl", +); +sub PF {PGML::Format(@_)}; + +###################################### + + +TEXT(beginproblem()); + +Context("Numeric"); + +@intervals = ( + "\displaystyle (-\infty,\infty)", + "\displaystyle [-1,1]", + "\displaystyle \{x|x\ne k\pi+\frac{\pi}{2}\}", +); + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..2) { + do {$temp = list_random(0..2)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$popupSineDomain = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{0}]); + +$popupSineRange = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{1}]); + +$popupCosineDomain = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{0}]); + +$popupCosineRange = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{1}]); + +$popupTangentDomain = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{2}]); + +$popupTangentRange = PopUp(["?", 'A', 'B', 'C'], $ALPHABET[$inverse{0}]); + +########################################################## + +BEGIN_PGML + +Choose the correct interval for each problem. + +[@DataTable( + [ + [ + [PF('[`` \text{Domain of }y=\sin(x)\text{ is }``] [_____________]{$popupSineDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{A: }[$intervals[$scramble{0}]]``]')], + ], + [ + [PF('[`` \text{Range of }y=\sin(x)\text{ is }``] [_____________]{$popupSineRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{B: }[$intervals[$scramble{1}]]``]')], + ], + [ + [PF('[`` \text{Domain of }y=\cos(x)\text{ is }``] [_____________]{$popupCosineDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('[`` \phantom{aaaaaaaa}\text{C: }[$intervals[$scramble{2}]]``]')], + ], + [ + [PF('[`` \text{Range of }y=\cos(x)\text{ is }``] [_____________]{$popupCosineRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('')], + ], + [ + [PF('[`` \text{Domain of }y=\tan(x)\text{ is }``] [_____________]{$popupTangentDomain}'), + cellcss => 'border-right: 0px solid; '], + [PF('')], + ], + [ + [PF('[`` \text{Range of }y=\tan(x)\text{ is }``] [_____________]{$popupTangentRange}'), + cellcss => 'border-right: 0px solid; '], + [PF('')], + ], + ], + align => 'l l', + columnscss => + ['border-bottom: 0px solid;', + 'border-bottom: 0px solid;',], +);@]* + +END_PGML + +############################################################ + +$showPartialCorrectAnswers = 1; + +BEGIN_PGML_SOLUTION + +It is very important to know the domain and range of the following functions. + +[@DataTable( + [ + [ + [PF('Functions'), + cellcss => 'border-right: 1px solid;', + rowcss => 'border-bottom: 1px solid;'], + [PF('Domain'), + cellcss => 'border-right: 1px solid; '], + [PF('Range')], + ], + [ + [PF('[``y=\sin(x)``]'), + rowcss => 'border-bottom: 1px solid;height:60px;', + cellcss => 'border-right: 1px solid;',], + [PF('[`\left( -\infty,\infty \right)`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\left[ -1,1 \right]`]')], + ], + [ + [PF('[``y=\cos(x)``]'), + rowcss => 'height:60px;border-bottom: 1px solid;', + cellcss => 'border-right: 1px solid; '], + [PF('[`\left( -\infty,\infty \right)`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\left[ -1,1 \right]`]')], + ], + [ + [PF('[``y=\tan(x)``]'), + rowcss => 'height:60px;', + cellcss => 'border-right: 1px solid; '], + [PF('[`\{x|x\ne k\pi+\frac{\pi}{2}\}`]'), + cellcss => 'border-right: 1px solid; '], + [PF('[`\left( -\infty,\infty \right)`]')], + ], + ], + align => 'c c c', +);@]* + + +END_PGML_SOLUTION + +###################################### + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship10.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship10.pg new file mode 100644 index 0000000000..4b765ed371 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship10.pg @@ -0,0 +1,245 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# +# +# ENDDESCRIPTION + +## DBsubject('Precalculus') +## DBchapter('Trigonometry') +## DBsection('') +## KEYWORDS('trigonometry','sine','cosine','tangent','right triangle') +## DBCCSS('4.MD.3') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = @_; + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +Context("Numeric"); + +#Q1 pos, $Q1 neg, $Q2 pos, $Q2 pos, +#Q3 pos, $Q3 neg, $Q4 pos, $Q4 neg +@num = (); + +do { + $den = random(3,9,1); + $num[0] = random(1,$den-1,1); +} until gcd($num[0],$den)==1; + +$num[2] = $den-$num[0]; +$num[4] = $num[0]+$den; +$num[6] = 2*$den-$num[0]; + +for (my $i=1; $i<=7; $i=$i+2) { + $num[$i] = $num[$i-1]-2*$den; +} + +@numShow = (); +for my $i (0..7) { + if ($num[$i]==1) {$numShow[$i] = "";} + elsif ($num[$i]==-1) {$numShow[$i] = "-";} + else {$numShow[$i] = "$num[$i]";} +} + +@values = ( + [&output($num[0],$den), + &output($num[1],$den), + &output($num[2],$den), + &output($num[3],$den),], + [&output($num[4],$den), + &output($num[5],$den), + &output($num[6],$den), + &output($num[7],$den),] +); + +$in0 = random(0,1,1); +$in1 = random(0,3,1); +$numIn = $in0*4+$in1; +$negNumIn = ($numIn%2 == 0) ? $numIn+1 : $numIn-1; +if ($numIn<=1) { + $numIn1 = 2; + $negNumIn1 = 3; +} elsif ( ($numIn>=2) && ($numIn<=3) ) { + $numIn1 = 0; + $negNumIn1 = 1; +} elsif ( ($numIn>=4) && ($numIn<=5) ) { + $numIn1 = 6; + $negNumIn1 = 7; +} else { + $numIn1 = 4; + $negNumIn1 = 5; +} + +$func = "sin"; + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Use your knowledge of the Unit Circle, find equivalent expressions of \( \$func \left( $values[$in0][$in1] \right) \). There may be more than one correct answer.", + "\( \$func\left( $values[$in0][($in1+1)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+2)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+3)%4] \right) \) $BR", +); + +$mc -> extra( + "\( \$func\left($values[($in0+1)%2][0] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][1] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][2] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][3] \right) \) $BR", +); + + + +$r = 5; +$Px = $r*cos($num[$numIn]*pi/$den); +$Py = $r*sin($num[$numIn]*pi/$den); +$Qx = $r*cos($num[$numIn1]*pi/$den); +$Qy = $r*sin($num[$numIn1]*pi/$den); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( $Qx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $numShow[$numIn] pi/$den",'red',$Plor,$Puod,large)); + +if ($Qx>0) { + $Qlor = ($Qx<$r/2) ? "left" : "center"; +} else { + $Qlor = (-$Qx>$r/2) ? "center" : "right"; +} +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q: $numShow[$numIn1] pi/$den",'red',$Qlor,$Quod,large)); + +$Olor = ($Px*$Qx>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); +$Slor = ($Qx>0) ? "left" : "right"; +$graph->lb(new Label($Qx,0,"S",'red',$Slor,$Ruod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $numShow[$numIn] pi/$den and Q: $numShow[$numIn1] pi/$den are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, crossing the x-axis at S. OSQ is a right triangle, with angle S being the right angle."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +$s0 = &output($num[$numIn],$den); +$s1 = &output($num[$numIn1],$den); +$s2 = &output($num[$negNumIn],$den); +$s3 = &output($num[$negNumIn1],$den); + +BEGIN_PGML_SOLUTION + +Assume [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the unit circle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the Unit Circle, the [`y`]-value of [`P`]'s coordinates (height of the right triangle [`\Delta POR`]) is simply [`\sin \left( [$values[$in0][$in1]] \right)`]. + +By the graph, [`[$values[$in0][$in1]]`] and [`[$s1]`] have the same sine value. + +Since [`[$values[$in0][$in1]]`] and [`[$s2]`] are located on the same point on the unit circle, they have the same trig values. + +Similarly, [`[$s1]`] and [`[$s3]`] are located on the same point on the unit circle, they have the same trig values. + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship20.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship20.pg new file mode 100644 index 0000000000..0b3e307a6e --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship20.pg @@ -0,0 +1,252 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = @_; + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +Context("Numeric"); + +#Q1 pos, $Q1 neg, $Q2 pos, $Q2 pos, +#Q3 pos, $Q3 neg, $Q4 pos, $Q4 neg +@num = (); + +do { + $den = random(3,9,1); + $num[0] = random(1,$den-1,1); +} until gcd($num[0],$den)==1; + +$num[2] = $den-$num[0]; +$num[4] = $num[0]+$den; +$num[6] = 2*$den-$num[0]; + +for (my $i=1; $i<=7; $i=$i+2) { + $num[$i] = $num[$i-1]-2*$den; +} + +@numShow = (); +for my $i (0..7) { + if ($num[$i]==1) {$numShow[$i] = "";} + elsif ($num[$i]==-1) {$numShow[$i] = "-";} + else {$numShow[$i] = "$num[$i]";} +} + +@values = ( + [&output($num[0],$den), + &output($num[1],$den), + &output($num[6],$den), + &output($num[7],$den),], + [&output($num[2],$den), + &output($num[3],$den), + &output($num[4],$den), + &output($num[5],$den),] +); + +$in0 = random(0,1,1); +$in1 = random(0,3,1); + +if ($in0==0) { + if ($in1==0) {$numIn=0;} + elsif ($in1==1) {$numIn=1;} + elsif ($in1==2) {$numIn=6;} + else {$numIn=7;} +} else { + if ($in1==0) {$numIn=2;} + elsif ($in1==1) {$numIn=3;} + elsif ($in1==2) {$numIn=4;} + else {$numIn=5;} +} +$negNumIn = ($numIn%2 == 0) ? $numIn+1 : $numIn-1; + +if ($numIn<=1) { + $numIn1 = 6; + $negNumIn1 = 7; +} elsif ( ($numIn>=2) && ($numIn<=3) ) { + $numIn1 = 4; + $negNumIn1 = 5; +} elsif ( ($numIn>=4) && ($numIn<=5) ) { + $numIn1 = 2; + $negNumIn1 = 3; +} else { + $numIn1 = 0; + $negNumIn1 = 1; +} + +$func = "cos"; + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Use your knowledge of the Unit Circle, find equivalent expressions of \( \$func \left( $values[$in0][$in1] \right) \). There may be more than one correct answer.", + "\( \$func\left( $values[$in0][($in1+1)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+2)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+3)%4] \right) \) $BR", +); + +$mc -> extra( + "\( \$func\left($values[($in0+1)%2][0] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][1] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][2] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][3] \right) \) $BR", +); + + + +$r = 5; +$Px = $r*cos($num[$numIn]*pi/$den); +$Py = $r*sin($num[$numIn]*pi/$den); +$Qx = $r*cos($num[$numIn1]*pi/$den); +$Qy = $r*sin($num[$numIn1]*pi/$den); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $numShow[$numIn] pi/$den",'red',$Plor,$Puod,large)); + +if ($Qx>0) { + $Qlor = ($Qx<$r/2) ? "left" : "center"; +} else { + $Qlor = (-$Qx>$r/2) ? "center" : "right"; +} +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q: $numShow[$numIn1] pi/$den",'red',$Qlor,$Quod,large)); + +$Olor = ($Px>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $numShow[$numIn] pi/$den and Q: $numShow[$numIn1] pi/$den are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, also crossing the x-axis at R. ORQ is a right triangle, with angle R being the right angle."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +$s0 = &output($num[$numIn],$den); +$s1 = &output($num[$numIn1],$den); +$s2 = &output($num[$negNumIn],$den); +$s3 = &output($num[$negNumIn1],$den); + +BEGIN_PGML_SOLUTION + +Assume [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the unit circle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the Unit Circle, the [`x`]-value of [`P`]'s coordinates (base of the right triangle [`\Delta POR`]) is simply [`\cos \left( [$values[$in0][$in1]] \right)`]. + +By the graph, [`[$values[$in0][$in1]]`] and [`[$s1]`] have the same cosine value. + +Since [`[$values[$in0][$in1]]`] and [`[$s2]`] are located on the same point on the unit circle, they have the same trig values. + +Similarly, [`[$s1]`] and [`[$s3]`] are located on the same point on the unit circle, they have the same trig values. + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship30.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship30.pg new file mode 100644 index 0000000000..4836ce5b79 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship30.pg @@ -0,0 +1,261 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +sub output { + my ($n,$d) = @_; + if ($n==1) {return "\frac{\pi}{$d}";} + elsif ($n==-1) {return "-\frac{\pi}{$d}";} + elsif ($n<0) { + $nn = -$n; + return "-\frac{$nn \pi}{$d}"; + } + else {return "\frac{$n\pi}{$d}";} +} + +Context("Numeric"); + +#Q1 pos, $Q1 neg, $Q2 pos, $Q2 pos, +#Q3 pos, $Q3 neg, $Q4 pos, $Q4 neg +@num = (); + +do { + $den = random(3,9,1); + $num[0] = random(1,$den-1,1); +} until gcd($num[0],$den)==1; + +$num[2] = $den-$num[0]; +$num[4] = $num[0]+$den; +$num[6] = 2*$den-$num[0]; + +for (my $i=1; $i<=7; $i=$i+2) { + $num[$i] = $num[$i-1]-2*$den; +} + +@numShow = (); +for my $i (0..7) { + if ($num[$i]==1) {$numShow[$i] = "";} + elsif ($num[$i]==-1) {$numShow[$i] = "-";} + else {$numShow[$i] = "$num[$i]";} +} + +@values = ( + [&output($num[0],$den), + &output($num[1],$den), + &output($num[4],$den), + &output($num[5],$den),], + [&output($num[2],$den), + &output($num[3],$den), + &output($num[6],$den), + &output($num[7],$den),] +); + +$in0 = random(0,1,1); +$in1 = random(0,3,1); + +if ($in0==0) { + if ($in1==0) {$numIn=0;} + elsif ($in1==1) {$numIn=1;} + elsif ($in1==2) {$numIn=4;} + else {$numIn=5;} +} else { + if ($in1==0) {$numIn=2;} + elsif ($in1==1) {$numIn=3;} + elsif ($in1==2) {$numIn=6;} + else {$numIn=7;} +} +$negNumIn = ($numIn%2 == 0) ? $numIn+1 : $numIn-1; + +if ($numIn<=1) { + $numIn1 = 4; + $negNumIn1 = 5; +} elsif ( ($numIn>=2) && ($numIn<=3) ) { + $numIn1 = 6; + $negNumIn1 = 7; +} elsif ( ($numIn>=4) && ($numIn<=5) ) { + $numIn1 = 0; + $negNumIn1 = 1; +} else { + $numIn1 = 2; + $negNumIn1 = 3; +} + +$func = "tan"; + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Use your knowledge of the Unit Circle, find equivalent expressions of \( \$func \left( $values[$in0][$in1] \right) \). There may be more than one correct answer.", + "\( \$func\left( $values[$in0][($in1+1)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+2)%4] \right) \) $BR", + "\( \$func\left( $values[$in0][($in1+3)%4] \right) \) $BR", +); + +$mc -> extra( + "\( \$func\left($values[($in0+1)%2][0] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][1] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][2] \right) \) $BR", + "\( \$func\left($values[($in0+1)%2][3] \right) \) $BR", +); + + + +$r = 5; +$Px = $r*cos($num[$numIn]*pi/$den); +$Py = $r*sin($num[$numIn]*pi/$den); +$Qx = $r*cos($num[$numIn1]*pi/$den); +$Qy = $r*sin($num[$numIn1]*pi/$den); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +for my $i (0..2*$den-1) { + $graph -> stamps( closed_circle( $r*cos($i*pi/$den), $r*sin($i*pi/$den), red ) ); +} +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( $Qx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $numShow[$numIn] pi/$den",'red',$Plor,$Puod,large)); + +if ($Qx>0) { + $Qlor = ($Qx<$r/2) ? "left" : "center"; +} else { + $Qlor = (-$Qx>$r/2) ? "center" : "right"; +} +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q: $numShow[$numIn1] pi/$den",'red',$Qlor,$Quod,large)); + +$Olor = ($Px>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); + +$Slor = ($Qx>0) ? "left" : "right"; +$Suod = ($Qy>0) ? "top" : "bottom"; +$graph->lb(new Label($Qx,0,"S",'red',$Slor,$Suod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $numShow[$numIn] pi/$den and Q: $numShow[$numIn1] pi/$den are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, crossing the x-axis at S. OSQ is a right triangle, with angle S being the right angle."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +############################################## + +$s0 = &output($num[$numIn],$den); +$s1 = &output($num[$numIn1],$den); +$s2 = &output($num[$negNumIn],$den); +$s3 = &output($num[$negNumIn1],$den); + +BEGIN_PGML_SOLUTION + +Assume [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the unit circle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the Unit Circle, + +* The [`y`]-value of [`P`]'s coordinates (height of the right triangle [`\Delta POR`]) is [`\sin \left( [$values[$in0][$in1]] \right)`]. +* The [`x`]-value of [`P`]'s coordinates (base of the right triangle [`\Delta POR`]) is [`\cos \left( [$values[$in0][$in1]] \right)`]. +* [` \tan \left( [$values[$in0][$in1]] \right) = \frac{\sin \left( [$values[$in0][$in1]] \right)}{\cos \left( [$values[$in0][$in1]] \right)}`] + +By the graph, [`[$values[$in0][$in1]]`] and [`[$s1]`] have the same tangent value. + +Since [`[$values[$in0][$in1]]`] and [`[$s2]`] are located on the same point on the unit circle, they have the same trig values. + +Similarly, [`[$s1]`] and [`[$s3]`] are located on the same point on the unit circle, they have the same trig values. + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship40.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship40.pg new file mode 100644 index 0000000000..9f9c49f6af --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship40.pg @@ -0,0 +1,198 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PCCmacros.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$start = 30+random(0,3,1)*90; +$degree = random($start,$start+30,1); +$rad = int(100*$degree*pi/180+0.5)/100; + +$ans = (pi-$rad>0) ? Compute("pi-$rad") : Compute("3*pi-$rad"); +$ansShow = int(100*Real($ans)+0.5)/100; + +$r = 5; +$Px = $r*cos($rad); +$Py = $r*sin($rad); +$Qx = $r*cos($ans); +$Qy = $r*sin($ans); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph -> stamps( closed_circle( $Px, $Py, red ) ); +$graph -> stamps( closed_circle( $Qx, $Qy, red ) ); +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( $Qx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $rad radians",'red',$Plor,$Puod,large)); + +$Qlor = ($Qx>0) ? "left" : "right"; +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q",'red',$Qlor,$Quod,large)); + +$Olor = ($Px*$Qx>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph -> stamps( closed_circle( $r, 0, red ) ); +$graph->lb(new Label($r,0,"A: 0",'red',"left","top",large)); +$graph -> stamps( closed_circle( -$r, 0, red ) ); +$graph->lb(new Label(-$r,0,"B: pi",'red',"right","top",large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); +$Slor = ($Qx>0) ? "left" : "right"; +$graph->lb(new Label($Qx,0,"S",'red',$Slor,$Ruod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $rad radians and Q, reflection of P by the y-axis, are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, crossing the x-axis at S. OSQ is a right triangle, with angle S being the right angle. Point A is at 0 radian, and Point B is at pi radians."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +Use your knowledge of the Unit Circle, find an angle [`\theta`] in the range of [` [0,2\pi) `] where [` \sin([$rad]) = \sin(\theta) `] and [` \theta \ne [$rad]`]. + +[@KeyboardInstructions( +"\n" +.'* Please type a value in radian, not in degrees.' +)@]** + + [`` \sin([$rad]) = \sin``][___________]{$ans} + +END_PGML + +############################################## + + +############################################## + +$deg = int($rad*180/pi+0.5); + +$i = ($rad>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$rad]`] radians corresponds to point [`P`] on the Unit Circle, the [`y`]-value of [`P`]'s coordinates (height of the right triangle [`\Delta POR`]) is simply [`\sin \left( [$rad] \right)`]. + +By the graph, [`P: [$rad]`] radians and [`Q`] have the same sine value. Next, we need to determine the value represented by [`Q`], which is also represented by the minor arc [`AQ`]. + +Note that the measure of arc [`AQ`] is the same as the measure of minor arc [`BP`]. + + [`` [$output1[$i]]=[$output2[$i]] ``] + +[`[$output3]`] + + [``[$output4]``] + +The solution is: + + [`` \sin([$rad]) = \sin([$ans]) ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship50.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship50.pg new file mode 100644 index 0000000000..d76bd14f51 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship50.pg @@ -0,0 +1,173 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$start = 30+random(0,3,1)*90; +$degree = random($start,$start+30,1); +$rad = int(100*$degree*pi/180+0.5)/100; + +$ans = Compute("2*pi-$rad"); +$ansShow = int(100*Real($ans)+0.5)/100; + +$r = 5; +$Px = $r*cos($rad); +$Py = $r*sin($rad); +$Qx = $r*cos($ans); +$Qy = $r*sin($ans); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph -> stamps( closed_circle( $Px, $Py, red ) ); +$graph -> stamps( closed_circle( $Qx, $Qy, red ) ); +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( $Qx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $rad radians",'red',$Plor,$Puod,large)); + +$Qlor = ($Qx>0) ? "left" : "right"; +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q",'red',$Qlor,$Quod,large)); + +$Olor = ($Px>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph -> stamps( closed_circle( $r, 0, red ) ); +$graph->lb(new Label($r,0,"A: 0",'red',"left","top",large)); +$graph -> stamps( closed_circle( -$r, 0, red ) ); +$graph->lb(new Label(-$r,0,"B: pi",'red',"right","top",large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $rad radians and Q, reflection of P by the x-axis, are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, also crossing the x-axis at R. ORQ is a right triangle, with angle R being the right angle. Point A is at 0 radian, and Point B is at pi radians."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +Use your knowledge of the Unit Circle, find an angle [`\theta`] in the range of [` [0,2\pi) `] where [` \cos([$rad]) = \cos(\theta) `] and [` \theta \ne [$rad]`]. + +[@KeyboardInstructions( +"\n" +.'* Please type a value in radian, not in degrees.' +)@]** + + [`` \cos([$rad]) = \cos``][___________]{$ans} + +END_PGML + +############################################## + +$deg = int($rad*180/pi+0.5); + +BEGIN_PGML_SOLUTION + +To convert [`[$rad]`] radians to degrees, we can do: + + [`` [$rad]\text{ radians} = \frac{[$rad]\cdot180^{\circ}}{\pi} \approx [$deg]^{\circ} ``] + +This is how we can determine the approximate location of [`[$rad]`] radians on the Unit Circle. In the following figure, Point [`P`] corresponds to [`[$rad]`] radians. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$rad]`] radians corresponds to point [`P`] on the Unit Circle, the [`x`]-value of [`P`]'s coordinates (base of the right triangle [`\Delta POR`]) is simply [`\cos \left( [$rad] \right)`]. + +By the graph, [`P: [$rad]`] radians and [`Q`] have the same cosine value. Next, we need to determine the value represented by [`Q`], which is also represented by the minor arc [`AQ`]. + +Note that the measure of minor arc [`AQ`] is the same as the measure of minor arc [`AP`], except they have opposite signs. + + [`` \text{minor arc }AQ = -\text{ minor arc }AP = -[$rad]\text{ radians} ``] + +Since [`Q`]'s value must be in the range [`[0,2\pi)`], we have: + + [`` \text{minor arc }AQ = -[$rad]+2\pi =[$ans] \text{ radians}``] + +The solution is: + + [`` \cos([$rad]) = \cos([$ans]) ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship60.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship60.pg new file mode 100644 index 0000000000..78b6f8c225 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleRelationship60.pg @@ -0,0 +1,185 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "PGcourse.pl" +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +$start = 30+random(0,3,1)*90; +$degree = random($start,$start+30,1); +$rad = int(100*$degree*pi/180+0.5)/100; + +$ans = (pi-$rad>0) ? Compute("pi+$rad") : Compute("$rad-pi"); +$ansShow = int(100*Real($ans)+0.5)/100; + +$r = 5; +$Px = $r*cos($rad); +$Py = $r*sin($rad); +$Qx = $r*cos($ans); +$Qy = $r*sin($ans); + +$graph = init_graph(-7,-7,7,7,'axes'=>[0,0],'grid'=>[1,1]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$graph -> stamps( closed_circle( $Px, $Py, red ) ); +$graph -> stamps( closed_circle( $Qx, $Qy, red ) ); +$graph -> stamps( closed_circle( $Px, 0, red ) ); +$graph -> stamps( closed_circle( $Qx, 0, red ) ); +$graph -> stamps( closed_circle( 0, 0, red ) ); + +if ($Px>0) { + $Plor = ($Px<$r/2) ? "left" : "center"; +} else { + $Plor = (-$Px>$r/2) ? "center" : "right"; +} +$Puod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label($Px,$Py,"P: $rad radians",'red',$Plor,$Puod,large)); + +$Quod = ($Qx>0) ? "left" : "right"; +$Quod = ($Qy>0) ? "bottom" : "top"; +$graph->lb(new Label($Qx,$Qy,"Q",'red',$Qlor,$Quod,large)); + +$Olor = ($Px>0) ? "right" : "left"; +$Ouod = ($Py>0) ? "bottom" : "top"; +$graph->lb(new Label(0,0,"O",'red',$Olor,$Ouod,large)); + +$graph -> stamps( closed_circle( $r, 0, red ) ); +$graph->lb(new Label($r,0,"A: 0",'red',"left","top",large)); +$graph -> stamps( closed_circle( -$r, 0, red ) ); +$graph->lb(new Label(-$r,0,"B: pi",'red',"right","top",large)); + +$Rlor = ($Px>0) ? "left" : "right"; +$Ruod = ($Py>0) ? "top" : "bottom"; +$graph->lb(new Label($Px,0,"R",'red',$Rlor,$Ruod,large)); + +$Slor = ($Qx>0) ? "left" : "right"; +$Suod = ($Qy>0) ? "top" : "bottom"; +$graph->lb(new Label($Qx,0,"S",'red',$Slor,$Suod,large)); + +$graph->moveTo(0,0); +$graph->lineTo($Px, $Py, red, 2); +$graph->lineTo($Px, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$graph->moveTo(0,0); +$graph->lineTo($Qx, $Qy, red, 2); +$graph->lineTo($Qx, 0, red, 2); +$graph->lineTo(0, 0, red, 2); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$xShift = ($Qx>0) ? -0.4 : 0.4; +$yShift = ($Qy>0) ? 0.4 : -0.4; +$graph->moveTo($Qx, $yShift); +$graph->lineTo($Qx+$xShift, $yShift, red, 2); +$graph->lineTo($Qx+$xShift, 0, red, 2); + +$alt = "A unit circle has O as its center. On the unit circle, point P: $rad radians and Q, reflection of P by the origin, are marked on the circle. From P, a vertical line is drawn toward the x-axis, crossing the x-axis at R. OPR is a right triangle, with angle R being the right angle. Similarly, from Q, a vertical line is drawn toward the x-axis, crossing the x-axis at S. OSQ is a right triangle, with angle S being the right angle. Point A is at 0 radian, and Point B is at pi radians."; + +$fig0 = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + + + +############################################## + +BEGIN_PGML + +Use your knowledge of the Unit Circle, find an angle [`\theta`] in the range of [` [0,2\pi) `] where [` \tan([$rad]) = \tan(\theta) `] and [` \theta \ne [$rad]`]. + +[@KeyboardInstructions( +"\n" +.'* Please type a value in radian, not in degrees.' +)@]** + + [`` \tan([$rad]) = \tan``][___________]{$ans} + +END_PGML + +############################################## + +$deg = int($rad*180/pi+0.5); + +if ($rad>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Recall that, if the angle [`[$values[$in0][$in1]]`] corresponds to point [`P`] on the Unit Circle, + +* The [`y`]-value of [`P`]'s coordinates (height of the right triangle [`\Delta POR`]) is [`\sin \left( [$rad] \right)`]. +* The [`x`]-value of [`P`]'s coordinates (base of the right triangle [`\Delta POR`]) is [`\cos \left( [$rad] \right)`]. +* [` \tan \left( [$rad] \right) = \frac{\sin \left( [$rad] \right)}{\cos \left( [$rad] \right)}`] + +By the graph, [`P: [$rad]`] radians and [`Q`] have the same tangent value. Next, we need to determine the value represented by [`Q`], which is also represented by the minor arc [`AQ`]. + +Note that the measure of minor arc [`AQ`] is simply [`\pi`] radians [$mol] than the measure of minor arc [`AP`]. + + [`` \text{minor arc }AQ = [$rad] [$aos] \pi \approx [$ans] ``] + +The solution is: + + [`` \tan([$rad]) = \tan([$ans]) ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues10.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues10.pg new file mode 100644 index 0000000000..05c1165da2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues10.pg @@ -0,0 +1,242 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +#[ angle, x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + [0, 1, 0, 0, 1, 0, Compute("DNE"), 1, Compute("DNE")], + ["\displaystyle \frac{\pi}{2}", 0, 1, 1, 0, Compute("DNE"), 1, Compute("DNE"), 0], + ["\displaystyle \pi", -1, 0, 0, -1, 0, Compute("DNE"), -1, Compute("DNE")], + ["\displaystyle \frac{3\pi}{2}", 0, -1, -1, 0, Compute("DNE"), -1, Compute("DNE"), 0], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$A_pt = closed_circle( $r, 0, red ); +$B_pt = closed_circle( 0 ,$r, red ); +$C_pt = closed_circle( -$r, 0, red ); +$D_pt = closed_circle( 0, -$r, red ); +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt); + +for my $i (0..0) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r-0.1, 0,"A(1,0)",'red','right','bottom',large)); + $graph[$i]->lb(new Label(0-0.1, $r,"B(0,1)",'red','right','bottom',large)); + $graph[$i]->lb(new Label(-$r+0.1, 0,"C(-1,0)",'red','left','top',large)); + $graph[$i]->lb(new Label(0.1,-$r,"D(0,-1)",'red','left','top',large)); +} + + +$alt[0] = "This is the graph of a unit circle, with Point A(1,0), B(0,1), C(-1,0) and Point D(0,-1)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +* [@KeyboardInstructions("If a value is undefined, type *DNE* (does not exist).")@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][1]},[_____]{$problems[$perm[0]][2]})')], + [PF('([_____]{$problems[$perm[1]][1]},[_____]{$problems[$perm[1]][2]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][3]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][3]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][4]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +For those points on the Unit Circle, you should come up with the following values fluently: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@DataTable( + [ + [ + [PF('[`A(1,0)`]')], + [PF('[`B(0,1)`]')], + [PF('[`C(-1,0)`]')], + [PF('[`D(0,-1)`]')], + ], + [ + [PF('degree: [`0`]')], + [PF('degree: [`\frac{\pi}{2}`]')], + [PF('degree: [`\pi`]')], + [PF('degree: [`\frac{3\pi}{2}`]')], + ], + [ + [PF('[`\sin(0)=0`]'),], + [PF('[`\sin\left(\frac{\pi}{2}\right)=1`]')], + [PF('[`\sin\left(\pi\right)=0`]')], + [PF('[`\sin\left(\frac{3\pi}{2}\right)=-1`]')], + ], + [ + [PF('[`\cos(0)=1`]'),], + [PF('[`\cos\left(\frac{\pi}{2}\right)=0`]')], + [PF('[`\cos\left(\pi\right)=-1`]')], + [PF('[`\cos\left(\frac{3\pi}{2}\right)=0`]')], + ], + [ + [PF('[`\tan(0)=0`]'),], + [PF('[`\tan\left(\frac{\pi}{2}\right) `] does not exist')], + [PF('[`\tan\left(\pi\right)=0`]')], + [PF('[`\tan\left(\frac{3\pi}{2}\right)`] does not exist')], + ], + [ + [PF('[`\csc(0)`] does not exist'),], + [PF('[`\csc\left(\frac{\pi}{2}\right)=1`]')], + [PF('[`\csc\left(\pi\right)`] does not exist')], + [PF('[`\csc\left(\frac{3\pi}{2}\right)=-1`]')], + ], + [ + [PF('[`\sec(0)=1`]'),], + [PF('[`\sec\left(\frac{\pi}{2}\right)`] does not exist')], + [PF('[`\sec\left(\pi\right)=-1`]')], + [PF('[`\sec\left(\frac{3\pi}{2}\right)`] does not exist')], + ], + [ + [PF('[`\cot(0)`] does not exist'),], + [PF('[`\cot\left(\frac{\pi}{2}\right)=0`]')], + [PF('[`\cot\left(\pi\right)`] does not exist')], + [PF('[`\cot\left(\frac{3\pi}{2}\right)=0`]')], + ], + ], + align => 'c|c|c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues11.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues11.pg new file mode 100644 index 0000000000..1473d2c4cf --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues11.pg @@ -0,0 +1,241 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +#[ angle, x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle 0^{\circ}", 1, 0, 0, 1, 0, Compute("DNE"), 1, Compute("DNE")], + ["\displaystyle 90^{\circ}", 0, 1, 1, 0, Compute("DNE"), 1, Compute("DNE"), 0], + ["\displaystyle 180^{\circ}", -1, 0, 0, -1, 0, Compute("DNE"), -1, Compute("DNE")], + ["\displaystyle 270^{\circ}", 0, -1, -1, 0, Compute("DNE"), -1, Compute("DNE"), 0], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$A_pt = closed_circle( $r, 0, red ); +$B_pt = closed_circle( 0 ,$r, red ); +$C_pt = closed_circle( -$r, 0, red ); +$D_pt = closed_circle( 0, -$r, red ); +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt); + +for my $i (0..0) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r-0.1, 0,"A(1,0)",'red','right','bottom',large)); + $graph[$i]->lb(new Label(0-0.1, $r,"B(0,1)",'red','right','bottom',large)); + $graph[$i]->lb(new Label(-$r+0.1, 0,"C(-1,0)",'red','left','top',large)); + $graph[$i]->lb(new Label(0.1,-$r,"D(0,-1)",'red','left','top',large)); +} + + +$alt[0] = "This is the graph of a unit circle, with Point A(1,0), B(0,1), C(-1,0) and Point D(0,-1)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +* [@KeyboardInstructions("If a value is undefined, type *DNE* (does not exist).")@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][1]},[_____]{$problems[$perm[0]][2]})')], + [PF('([_____]{$problems[$perm[1]][1]},[_____]{$problems[$perm[1]][2]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][3]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][3]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][4]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +For those points on the Unit Circle, you should come up with the following values fluently: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@DataTable( + [ + [ + [PF('[`A(1,0)`]')], + [PF('[`B(0,1)`]')], + [PF('[`C(-1,0)`]')], + [PF('[`D(0,-1)`]')], + ], + [ + [PF('degree: [`0^{\circ}`]')], + [PF('degree: [`90^{\circ}`]')], + [PF('degree: [`180^{\circ}`]')], + [PF('degree: [`270^{\circ}`]')], + ], + [ + [PF('[`\sin(0^{\circ})=0`]'),], + [PF('[`\sin\left(90^{\circ}\right)=1`]')], + [PF('[`\sin\left(180^{\circ}\right)=0`]')], + [PF('[`\sin\left(270^{\circ}\right)=-1`]')], + ], + [ + [PF('[`\cos(0^{\circ})=1`]'),], + [PF('[`\cos\left(90^{\circ}\right)=0`]')], + [PF('[`\cos\left(180^{\circ}\right)=-1`]')], + [PF('[`\cos\left(270^{\circ}\right)=0`]')], + ], + [ + [PF('[`\tan(0^{\circ})=0`]'),], + [PF('[`\tan\left(90^{\circ}\right) `] does not exist')], + [PF('[`\tan\left(180^{\circ}\right)=0`]')], + [PF('[`\tan\left(270^{\circ}\right)`] does not exist')], + ], + [ + [PF('[`\csc(0^{\circ})`] does not exist'),], + [PF('[`\csc\left(90^{\circ}\right)=1`]')], + [PF('[`\csc\left(180^{\circ}\right)`] does not exist')], + [PF('[`\csc\left(270^{\circ}\right)=-1`]')], + ], + [ + [PF('[`\sec(0^{\circ})=1`]'),], + [PF('[`\sec\left(90^{\circ}\right)`] does not exist')], + [PF('[`\sec\left(180^{\circ}\right)=-1`]')], + [PF('[`\sec\left(270^{\circ}\right)`] does not exist')], + ], + [ + [PF('[`\cot(0^{\circ})`] does not exist'),], + [PF('[`\cot\left(90^{\circ}\right)=0`]')], + [PF('[`\cot\left(180^{\circ}\right)`] does not exist')], + [PF('[`\cot\left(270^{\circ}\right)=0`]')], + ], + ], + align => 'c|c|c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues20.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues20.pg new file mode 100644 index 0000000000..26e0bef7cf --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues20.pg @@ -0,0 +1,265 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..3) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + if ($i==0) {$new[$i] = 2*$rounds[$i];} + elsif ($i==1) {$new[$i] = 4*$rounds[$i]+1;} + elsif ($i==2) {$new[$i] = 2*$rounds[$i]+1;} + else {$new[$i] = 4*$rounds[$i]+3;} +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle $new[0]\pi", "\displaystyle 0", 1, 0, 0, 1, 0, Compute("DNE"), 1, Compute("DNE")], + ["\displaystyle \frac{$new[1]\pi}{2}", "\displaystyle \frac{\pi}{2}", 0, 1, 1, 0, Compute("DNE"), 1, Compute("DNE"), 0], + ["\displaystyle $new[2]\pi", "\displaystyle \pi", -1, 0, 0, -1, 0, Compute("DNE"), -1, Compute("DNE")], + ["\displaystyle \frac{$new[3]\pi}{2}", "\displaystyle \frac{3\pi}{2}", 0, -1, -1, 0, Compute("DNE"), -1, Compute("DNE"), 0], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$alt[0] = "This is the graph of a unit circle,"; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + $graph[0]->stamps(closed_circle( $r, 0, red )); + $graph[0]->lb(new Label($r-0.1, 0,"$new[0] pi",'red','right','bottom',large)); + $alt[0] .= " and with $new[0] pi at (1, 0),"; +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + $graph[0]->stamps(closed_circle( 0, $r, red )); + $graph[0]->lb(new Label(-0.1, $r,"$new[1] pi/2",'red','right','bottom',large)); + $alt[0] .= " and with $new[1] pi/2 at (0, 1),"; +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + $graph[0]->stamps(closed_circle( -$r, 0, red )); + $graph[0]->lb(new Label(-$r+0.1, 0, "$new[2] pi",'red','left','top',large)); + $alt[0] .= " and with $new[2] pi at (-1, 0),"; +} +if ( ($perm[0]==3) || ($perm[1]==3) ){ + $graph[0]->stamps(closed_circle( 0, -$r, red )); + $graph[0]->lb(new Label(0.1,-$r,"$new[3] pi/2",'red','left','top',large)); + $alt[0] .= " and with $new[3] pi/2 at (0, -1),"; +} + + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +* [@KeyboardInstructions("If a value is undefined, type *DNE* (does not exist).")@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+2k\pi`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+2\cdot([$roundsN[$perm[0]]])\cdot\pi = [$problems[$perm[0]][1]]``] + +the angle [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+2\cdot([$roundsN[$perm[1]]])\cdot\pi = [$problems[$perm[1]][1]]``] + +the angle [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues21.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues21.pg new file mode 100644 index 0000000000..b73be54aac --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues21.pg @@ -0,0 +1,265 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("Numeric"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..3) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + if ($i==0) {$new[$i] = 2*$rounds[$i]*180;} + elsif ($i==1) {$new[$i] = (4*$rounds[$i]+1)*90;} + elsif ($i==2) {$new[$i] = (2*$rounds[$i]+1)*180;} + else {$new[$i] = (4*$rounds[$i]+3)*90;} +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle $new[0]^{\circ}", "\displaystyle 0^{\circ}", 1, 0, 0, 1, 0, Compute("DNE"), 1, Compute("DNE")], + ["\displaystyle $new[1]^{\circ}", "\displaystyle 90^{\circ}", 0, 1, 1, 0, Compute("DNE"), 1, Compute("DNE"), 0], + ["\displaystyle $new[2]^{\circ}", "\displaystyle 180^{\circ}", -1, 0, 0, -1, 0, Compute("DNE"), -1, Compute("DNE")], + ["\displaystyle $new[3]^{\circ}", "\displaystyle 270^{\circ}", 0, -1, -1, 0, Compute("DNE"), -1, Compute("DNE"), 0], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + +$alt[0] = "This is the graph of a unit circle,"; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + $graph[0]->stamps(closed_circle( $r, 0, red )); + $graph[0]->lb(new Label($r-0.1, 0,"$new[0] degrees",'red','right','bottom',large)); + $alt[0] .= " and with $new[0]^{\circ} at (1, 0),"; +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + $graph[0]->stamps(closed_circle( 0, $r, red )); + $graph[0]->lb(new Label(-0.1, $r,"$new[1] degrees",'red','right','bottom',large)); + $alt[0] .= " and with $new[1]^{\circ} at (0, 1),"; +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + $graph[0]->stamps(closed_circle( -$r, 0, red )); + $graph[0]->lb(new Label(-$r+0.1, 0, "$new[2] degrees",'red','left','top',large)); + $alt[0] .= " and with $new[2]^{\circ} at (-1, 0),"; +} +if ( ($perm[0]==3) || ($perm[1]==3) ){ + $graph[0]->stamps(closed_circle( 0, -$r, red )); + $graph[0]->lb(new Label(0.1,-$r,"$new[3] degrees",'red','left','top',large)); + $alt[0] .= " and with $new[3]^{\circ} at (0, -1),"; +} + + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +* [@KeyboardInstructions("If a value is undefined, type *DNE* (does not exist).")@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+360^{\circ}`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+([$roundsN[$perm[0]]])\cdot 360^{\circ} = [$problems[$perm[0]][1]]``] + +the angle [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+([$roundsN[$perm[1]]])\cdot 360^{\circ} = [$problems[$perm[1]][1]]``] + +the angle [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles: + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues30.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues30.pg new file mode 100644 index 0000000000..e723fcde46 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues30.pg @@ -0,0 +1,261 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +#[ angle, x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle \frac{\pi}{4}", Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), 1, Formula("sqrt(2)"), Formula("sqrt(2)"), 1], + ["\displaystyle \frac{3\pi}{4}", Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), -1, Formula("sqrt(2)"), Formula("-sqrt(2)"), -1], + ["\displaystyle \frac{5\pi}{4}", Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), 1, Formula("-sqrt(2)"), Formula("-sqrt(2)"), 1], + ["\displaystyle \frac{7\pi}{4}", Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), -1, Formula("-sqrt(2)"), Formula("sqrt(2)"), -1], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$A_pt = closed_circle( $r/sqrt(2), $r/sqrt(2), red ); +$B_pt = closed_circle( -$r/sqrt(2), $r/sqrt(2), red ); +$C_pt = closed_circle( -$r/sqrt(2), -$r/sqrt(2), red ); +$D_pt = closed_circle( $r/sqrt(2), -$r/sqrt(2), red ); +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt); + +for my $i (0..0) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/2, "A",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$r*sqrt(2)/2, $r*sqrt(2)/2, "B",'red','right','bottom',large)); + $graph[$i]->lb(new Label(-$r*sqrt(2)/2, -$r*sqrt(2)/2, "C",'red','right','top',large)); + $graph[$i]->lb(new Label($r*sqrt(2)/2, -$r*sqrt(2)/2, "D",'red','left','top',large)); +} + +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($r/sqrt(2),0,red,3); +$graph[0]->lineTo($r/sqrt(2),$r/sqrt(2),red,3); +$graph[0]->lineTo(0,0,red,3); +$graph[0]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','left','middle',large)); +$graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','top',large)); +$graph[0]->lb(new Label($r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','right','bottom',large)); +$graph[0]->lb(new Label(0.5,0, "45",'red','left','bottom',large)); +$graph[0]->lb(new Label($r*sqrt(2)/2-0.1, $r*sqrt(2)/2-0.5, "45",'red','right','top',large)); + +$graph[0]->moveTo($r*sqrt(2)/2,0.4); +$graph[0]->lineTo($r*sqrt(2)/2-0.4,0.4,red,2); +$graph[0]->lineTo($r*sqrt(2)/2-0.4,0,red,2); + +$alt[0] = "This is the graph of a unit circle, with Point A at (sqrt(2)/2,sqrt(2)/2), B at (-sqrt(2)/2,sqrt(2)/2), C at (-sqrt(2)/2,-sqrt(2)/2) and Point D at (sqrt(2)/2,-sqrt(2)/2)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][1]},[_____]{$problems[$perm[0]][2]})')], + [PF('([_____]{$problems[$perm[1]][1]},[_____]{$problems[$perm[1]][2]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][3]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][3]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][4]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +For those points on the Unit Circle, you should come up with values in the table fluently. Note that the triangle is a 45-45-90 special right triangle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@DataTable( + [ + [ + [PF('[`A\left(\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`B\left(-\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`C\left(-\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`D\left(\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right)`]')], + ], + [ + [PF('degree: [`\frac{\pi}{4}`]')], + [PF('degree: [`\frac{3\pi}{4}`]')], + [PF('degree: [`\frac{5\pi}{4}`]')], + [PF('degree: [`\frac{7\pi}{4}`]')], + ], + [ + [PF('[`\sin\left(\frac{\pi}{4}\right)=\frac{\sqrt{2}}{2}`]'),], + [PF('[`\sin\left(\frac{3\pi}{4}\right)=\frac{\sqrt{2}}{2}`]')], + [PF('[`\sin\left(\frac{5\pi}{4}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\sin\left(\frac{7\pi}{4}\right)=-\frac{\sqrt{2}}{2}`]')], + ], + [ + [PF('[`\cos\left(\frac{\pi}{4}\right)=\frac{\sqrt{2}}{2}`]'),], + [PF('[`\cos\left(\frac{3\pi}{4}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\cos\left(\frac{5\pi}{4}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\cos\left(\frac{7\pi}{4}\right)=\frac{\sqrt{2}}{2}`]')], + ], + [ + [PF('[`\tan\left(\frac{\pi}{4}\right)=1`]'),], + [PF('[`\tan\left(\frac{3\pi}{4}\right)=-1`]')], + [PF('[`\tan\left(\frac{5\pi}{4}\right)=1`]')], + [PF('[`\tan\left(\frac{7\pi}{4}\right)=-1`]')], + ], + [ + [PF('[`\csc\left(\frac{\pi}{4}\right)=\sqrt{2}`]'),], + [PF('[`\csc\left(\frac{3\pi}{4}\right)=\sqrt{2}`]')], + [PF('[`\csc\left(\frac{5\pi}{4}\right)=-\sqrt{2}`]')], + [PF('[`\csc\left(\frac{7\pi}{4}\right)=-\sqrt{2}`]')], + ], + [ + [PF('[`\sec\left(\frac{\pi}{4}\right)=\sqrt{2}`]'),], + [PF('[`\sec\left(\frac{3\pi}{4}\right)=-\sqrt{2}`]')], + [PF('[`\sec\left(\frac{5\pi}{4}\right)=-\sqrt{2}`]')], + [PF('[`\sec\left(\frac{7\pi}{4}\right)=\sqrt{2}`]')], + ], + [ + [PF('[`\cot\left(\frac{\pi}{4}\right)=1`]'),], + [PF('[`\cot\left(\frac{3\pi}{4}\right)=-1`]')], + [PF('[`\cot\left(\frac{5\pi}{4}\right)=1`]')], + [PF('[`\cot\left(\frac{7\pi}{4}\right)=-1`]')], + ], + ], + align => 'c|c|c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues31.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues31.pg new file mode 100644 index 0000000000..eeb0c0f3c3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues31.pg @@ -0,0 +1,261 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +#[ angle, x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle 45^{\circ}", Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), 1, Formula("sqrt(2)"), Formula("sqrt(2)"), 1], + ["\displaystyle 135^{\circ}", Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), -1, Formula("sqrt(2)"), Formula("-sqrt(2)"), -1], + ["\displaystyle 225^{\circ}", Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), 1, Formula("-sqrt(2)"), Formula("-sqrt(2)"), 1], + ["\displaystyle 315^{\circ}", Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), -1, Formula("-sqrt(2)"), Formula("sqrt(2)"), -1], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$A_pt = closed_circle( $r/sqrt(2), $r/sqrt(2), red ); +$B_pt = closed_circle( -$r/sqrt(2), $r/sqrt(2), red ); +$C_pt = closed_circle( -$r/sqrt(2), -$r/sqrt(2), red ); +$D_pt = closed_circle( $r/sqrt(2), -$r/sqrt(2), red ); +$graph[0] -> stamps($A_pt, $B_pt, $C_pt, $D_pt); + +for my $i (0..0) { + $graph[$i]->lb('reset'); + $graph[$i]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/2, "A",'red','left','bottom',large)); + $graph[$i]->lb(new Label(-$r*sqrt(2)/2, $r*sqrt(2)/2, "B",'red','right','bottom',large)); + $graph[$i]->lb(new Label(-$r*sqrt(2)/2, -$r*sqrt(2)/2, "C",'red','right','top',large)); + $graph[$i]->lb(new Label($r*sqrt(2)/2, -$r*sqrt(2)/2, "D",'red','left','top',large)); +} + +$graph[0]->moveTo(0,0); +$graph[0]->lineTo($r/sqrt(2),0,red,3); +$graph[0]->lineTo($r/sqrt(2),$r/sqrt(2),red,3); +$graph[0]->lineTo(0,0,red,3); +$graph[0]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','left','middle',large)); +$graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','top',large)); +$graph[0]->lb(new Label($r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','right','bottom',large)); +$graph[0]->lb(new Label(0.5,0, "45",'red','left','bottom',large)); +$graph[0]->lb(new Label($r*sqrt(2)/2-0.1, $r*sqrt(2)/2-0.5, "45",'red','right','top',large)); + +$graph[0]->moveTo($r*sqrt(2)/2,0.4); +$graph[0]->lineTo($r*sqrt(2)/2-0.4,0.4,red,2); +$graph[0]->lineTo($r*sqrt(2)/2-0.4,0,red,2); + +$alt[0] = "This is the graph of a unit circle, with Point A at (sqrt(2)/2,sqrt(2)/2), B at (-sqrt(2)/2,sqrt(2)/2), C at (-sqrt(2)/2,-sqrt(2)/2) and Point D at (sqrt(2)/2,-sqrt(2)/2)."; + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][1]},[_____]{$problems[$perm[0]][2]})')], + [PF('([_____]{$problems[$perm[1]][1]},[_____]{$problems[$perm[1]][2]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][3]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][3]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][4]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +For those points on the Unit Circle, you should come up with values in the table fluently. Note that the triangle is a 45-45-90 special right triangle. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@DataTable( + [ + [ + [PF('[`A\left(\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`B\left(-\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`C\left(-\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right)`]')], + [PF('[`D\left(\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right)`]')], + ], + [ + [PF('degree: [`45^{\circ}`]')], + [PF('degree: [`135^{\circ}`]')], + [PF('degree: [`225^{\circ}`]')], + [PF('degree: [`315^{\circ}`]')], + ], + [ + [PF('[`\sin\left(45^{\circ}\right)=\frac{\sqrt{2}}{2}`]'),], + [PF('[`\sin\left(135^{\circ}\right)=\frac{\sqrt{2}}{2}`]')], + [PF('[`\sin\left(225^{\circ}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\sin\left(315^{\circ}\right)=-\frac{\sqrt{2}}{2}`]')], + ], + [ + [PF('[`\cos\left(45^{\circ}\right)=\frac{\sqrt{2}}{2}`]'),], + [PF('[`\cos\left(135^{\circ}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\cos\left(225^{\circ}\right)=-\frac{\sqrt{2}}{2}`]')], + [PF('[`\cos\left(315^{\circ}\right)=\frac{\sqrt{2}}{2}`]')], + ], + [ + [PF('[`\tan\left(45^{\circ}\right)=1`]'),], + [PF('[`\tan\left(135^{\circ}\right)=-1`]')], + [PF('[`\tan\left(225^{\circ}\right)=1`]')], + [PF('[`\tan\left(315^{\circ}\right)=-1`]')], + ], + [ + [PF('[`\csc\left(45^{\circ}\right)=\sqrt{2}`]'),], + [PF('[`\csc\left(135^{\circ}\right)=\sqrt{2}`]')], + [PF('[`\csc\left(225^{\circ}\right)=-\sqrt{2}`]')], + [PF('[`\csc\left(315^{\circ}\right)=-\sqrt{2}`]')], + ], + [ + [PF('[`\sec\left(45^{\circ}\right)=\sqrt{2}`]'),], + [PF('[`\sec\left(135^{\circ}\right)=-\sqrt{2}`]')], + [PF('[`\sec\left(225^{\circ}\right)=-\sqrt{2}`]')], + [PF('[`\sec\left(315^{\circ}\right)=\sqrt{2}`]')], + ], + [ + [PF('[`\cot\left(45^{\circ}\right)=1`]'),], + [PF('[`\cot\left(135^{\circ}\right)=-1`]')], + [PF('[`\cot\left(225^{\circ}\right)=1`]')], + [PF('[`\cot\left(315^{\circ}\right)=-1`]')], + ], + ], + align => 'c|c|c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues40.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues40.pg new file mode 100644 index 0000000000..2388a4de22 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues40.pg @@ -0,0 +1,321 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..3) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + $new[$i] = 8*$rounds[$i]+2*$i+1; +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle \frac{$new[0] \pi}{4}", "\displaystyle \frac{\pi}{4}", Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), 1, Formula("sqrt(2)"), Formula("sqrt(2)"), 1], + ["\displaystyle \frac{$new[1] \pi}{4}", "\displaystyle \frac{3\pi}{4}", Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), -1, Formula("sqrt(2)"), Formula("-sqrt(2)"), -1], + ["\displaystyle \frac{$new[2] \pi}{4}", "\displaystyle \frac{5\pi}{4}", Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), 1, Formula("-sqrt(2)"), Formula("-sqrt(2)"), 1], + ["\displaystyle \frac{$new[3] \pi}{4}", "\displaystyle \frac{7\pi}{4}", Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), -1, Formula("-sqrt(2)"), Formula("sqrt(2)"), -1], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r/sqrt(2), $r/sqrt(2),-0.4,0.4); + $graph[0]->stamps(closed_circle( $r/sqrt(2), $r/sqrt(2), red )); + $graph[0]->lb(new Label($r/sqrt(2), $r/sqrt(2),"$new[0] pi/4",'red','left','bottom',large)); + $alt[0] .= " The number $new[0] pi/4 is marked at (sqrt(2)/2, sqrt(2)/2). The circle center (0,0), (sqrt(2)/2, sqrt(2)/2) and (sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"45",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"45",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = (-$r/sqrt(2), $r/sqrt(2),0.4,0.4); + $graph[0]->stamps(closed_circle( -$r/sqrt(2), $r/sqrt(2), red )); + $graph[0]->lb(new Label(-$r/sqrt(2), $r/sqrt(2),"$new[1] pi/4",'red','right','bottom',large)); + $alt[0] .= " The number $new[1] pi/4 is marked at (-sqrt(2)/2, sqrt(2)/2). The circle center (0,0), (-sqrt(2)/2, sqrt(2)/2) and (-sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"45",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"45",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, 0, "-sqrt(2)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r/sqrt(2), -$r/sqrt(2),0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r/sqrt(2), -$r/sqrt(2), red )); + $graph[0]->lb(new Label(-$r/sqrt(2), -$r/sqrt(2),"$new[2] pi/4",'red','right','top',large)); + $alt[0] .= " The number $new[2] pi/4 is marked at (-sqrt(2)/2, -sqrt(2)/2). The circle center (0,0), (-sqrt(2)/2, -sqrt(2)/2) and (-sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"45",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"45",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/2, -$r*sqrt(2)/4, "-sqrt(2)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, 0, "-sqrt(2)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, -$r*sqrt(2)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = ($r/sqrt(2), -$r/sqrt(2),-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r/sqrt(2), -$r/sqrt(2), red )); + $graph[0]->lb(new Label($r/sqrt(2), -$r/sqrt(2),"$new[3] pi/4",'red','left','top',large)); + $alt[0] .= " The number $new[3] pi/4 is marked at (sqrt(2)/2, -sqrt(2)/2). The circle center (0,0), (sqrt(2)/2, -sqrt(2)/2) and (sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"45",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"45",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(2)/2, -$r*sqrt(2)/4, "-sqrt(2)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, -$r*sqrt(2)/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+2k\pi`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+2\cdot([$roundsN[$perm[0]]])\cdot\pi = [$problems[$perm[0]][1]]``] + +the angles [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+2\cdot([$roundsN[$perm[1]]])\cdot\pi = [$problems[$perm[1]][1]]``] + +the angles [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles. Note that the triangles are 45-45-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues41.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues41.pg new file mode 100644 index 0000000000..0fd44a2cc0 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues41.pg @@ -0,0 +1,321 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..3) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + $new[$i] = (8*$rounds[$i]+2*$i+1)*45; +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle $new[0]^{\circ}", "\displaystyle 45^{\circ}", Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), 1, Formula("sqrt(2)"), Formula("sqrt(2)"), 1], + ["\displaystyle $new[1]^{\circ}", "\displaystyle 135^{\circ}", Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), -1, Formula("sqrt(2)"), Formula("-sqrt(2)"), -1], + ["\displaystyle $new[2]^{\circ}", "\displaystyle 225^{\circ}", Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), 1, Formula("-sqrt(2)"), Formula("-sqrt(2)"), 1], + ["\displaystyle $new[3]^{\circ}", "\displaystyle 315^{\circ}", Formula("sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("-sqrt(2)/2"), Formula("sqrt(2)/2"), -1, Formula("-sqrt(2)"), Formula("sqrt(2)"), -1], +); + +@perm = NchooseK(4,2); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-7.5,-7.5,7.5,7.5,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r/sqrt(2), $r/sqrt(2),-0.4,0.4); + $graph[0]->stamps(closed_circle( $r/sqrt(2), $r/sqrt(2), red )); + $graph[0]->lb(new Label($r/sqrt(2), $r/sqrt(2),"$new[0] degrees",'red','left','bottom',large)); + $alt[0] .= " $new[0] degrees is marked at (sqrt(2)/2, sqrt(2)/2). The circle center (0,0), (sqrt(2)/2, sqrt(2)/2) and (sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"45",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"45",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = (-$r/sqrt(2), $r/sqrt(2),0.4,0.4); + $graph[0]->stamps(closed_circle( -$r/sqrt(2), $r/sqrt(2), red )); + $graph[0]->lb(new Label(-$r/sqrt(2), $r/sqrt(2),"$new[1] degrees",'red','right','bottom',large)); + $alt[0] .= " $new[1] degrees is marked at (-sqrt(2)/2, sqrt(2)/2). The circle center (0,0), (-sqrt(2)/2, sqrt(2)/2) and (-sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"45",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"45",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/2, $r*sqrt(2)/4, "sqrt(2)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, 0, "-sqrt(2)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, $r*sqrt(2)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r/sqrt(2), -$r/sqrt(2),0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r/sqrt(2), -$r/sqrt(2), red )); + $graph[0]->lb(new Label(-$r/sqrt(2), -$r/sqrt(2),"$new[2] degrees",'red','right','top',large)); + $alt[0] .= " $new[2] degrees is marked at (-sqrt(2)/2, -sqrt(2)/2). The circle center (0,0), (-sqrt(2)/2, -sqrt(2)/2) and (-sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"45",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"45",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/2, -$r*sqrt(2)/4, "-sqrt(2)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, 0, "-sqrt(2)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(2)/4, -$r*sqrt(2)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = ($r/sqrt(2), -$r/sqrt(2),-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r/sqrt(2), -$r/sqrt(2), red )); + $graph[0]->lb(new Label($r/sqrt(2), -$r/sqrt(2),"$new[3] degrees",'red','left','top',large)); + $alt[0] .= " $new[3] degrees is marked at (sqrt(2)/2, -sqrt(2)/2). The circle center (0,0), (sqrt(2)/2, -sqrt(2)/2) and (sqrt(2)/2, 0) form a 45-45-90 right triangle. The length of the bottom leg is sqrt(2)/2, side leg is sqrt(2)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"45",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"45",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(2)/2, -$r*sqrt(2)/4, "-sqrt(2)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, 0, "sqrt(2)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(2)/4, -$r*sqrt(2)/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+360k`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+([$roundsN[$perm[0]]])\cdot360^{\circ} = [$problems[$perm[0]][1]]``] + +the angle [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+([$roundsN[$perm[1]]])\cdot360^{\circ} = [$problems[$perm[1]][1]]``] + +the angle [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles. Note that the triangles are 45-45-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues50.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues50.pg new file mode 100644 index 0000000000..db01e23945 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues50.pg @@ -0,0 +1,383 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle \frac{\pi}{6}", "\displaystyle \frac{\pi}{6}", Formula("sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("2"), Formula("2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle \frac{\pi}{3}", "\displaystyle \frac{\pi}{3}", Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("1/2"), Formula("sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("2"), Formula("sqrt(3)/3")], + ["\displaystyle \frac{2\pi}{3}", "\displaystyle \frac{2\pi}{3}", Formula("-1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("-2"), Formula("-sqrt(3)/3")], + ["\displaystyle \frac{5\pi}{6}", "\displaystyle \frac{5\pi}{6}", Formula("-sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("2"), Formula("-2*sqrt(3)/3"), Formula("-sqrt(3)")], + ["\displaystyle \frac{7\pi}{6}", "\displaystyle \frac{7\pi}{6}", Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("-2"), Formula("-2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle \frac{4\pi}{3}", "\displaystyle \frac{4\pi}{3}", Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("-2"), Formula("sqrt(3)/3")], + ["\displaystyle \frac{5\pi}{3}", "\displaystyle \frac{5\pi}{3}", Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("1/2"), Formula("-sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("2"), Formula("-sqrt(3)/3")], + ["\displaystyle \frac{11\pi}{6}", "\displaystyle \frac{11\pi}{6}", Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("-2"), Formula("2*sqrt(3)/3"), Formula("-sqrt(3)")], +); + +@perm = (); +do { + if (random(0,1,1)==0) { + $perm[0] = list_random(0,3,4,7); + $perm[1] = list_random(1,2,5,6); + } else { + $perm[1] = list_random(0,3,4,7); + $perm[0] = list_random(1,2,5,6); + } +} until ($problems[$perm[0]][2]*$problems[$perm[1]][2] < 0); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, $r/2,-0.4,0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, $r/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r/2,"pi/6",'red','left','bottom',large)); + $alt[0] .= " The number pi/6 is marked at (sqrt(3)/2, 1/2). The circle center (0,0), (sqrt(3)/2, 1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.6,0,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"60",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r*1/4, "1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, $r*1/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = ($r/2, $r*sqrt(3)/2, -0.4,0.4); + $graph[0]->stamps(closed_circle( $r/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r/2, $r*sqrt(3)/2, "pi/3",'red','left','bottom',large)); + $alt[0] .= " The number pi/3 is marked at (1/2, sqrt(3)/2). The circle center (0,0), (1/2, sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.9,"30",'red','right','top',large)); + $graph[0]->lb(new Label($r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*1/4, $r*sqrt(3)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, $r*sqrt(3)/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/2,"2pi/3",'red','right','bottom',large)); + $alt[0] .= " The number 2pi/3 is marked at (-1/2, sqrt(3)/2). The circle center (0,0), (-1/2, sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.9,"30",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*1/4, $r*sqrt(3)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, $r*1/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, $r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/2,"5pi/6",'red','right','bottom',large)); + $alt[0] .= " The number 5pi/6 is marked at (-sqrt(3)/2, 1/2). The circle center (0,0), (-sqrt(3)/2, 1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.6,0,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"60",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/4, "1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, $r*1/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==4) || ($perm[1]==4) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, -$r*1/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/2,"7pi/6",'red','right','top',large)); + $alt[0] .= " The number 7pi/6 is marked at (-sqrt(3)/2, -1/2). The circle center (0,0), (-sqrt(3)/2, -1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.6,0,"30",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/4, "-1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, -$r*1/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==5) || ($perm[1]==5) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, -$r*sqrt(3)/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/2,"4pi/3",'red','right','top',large)); + $alt[0] .= " The number 4pi/3 is marked at (-1/2, -sqrt(3)/2). The circle center (0,0), (-1/2, -sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.9,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*1/4, -$r*sqrt(3)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==6) || ($perm[1]==6) ) { + ($Px,$Py,$xShift,$yShift) = ($r*1/2, -$r*sqrt(3)/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/2, "5pi/3",'red','left','top',large)); + $alt[0] .= " The number 5pi/3 is marked at (1/2, -sqrt(3)/2). The circle center (0,0), (1/2, -sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.9,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*1/4, -$r*sqrt(3)/4, "1",'red','right','top',large)); +} +if ( ($perm[0]==7) || ($perm[1]==7) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, -$r*1/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/2, "11pi/6",'red','left','top',large)); + $alt[0] .= " The number 11pi/6 is marked at (sqrt(3)/2, -1/2). The circle center (0,0), (sqrt(3)/2, -1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.6,0,"30",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/4, "-1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, -$r*1/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Here are the locations of those two angles on the Unit Circle. Note that the triangles are 30-60-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues51.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues51.pg new file mode 100644 index 0000000000..9860012072 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues51.pg @@ -0,0 +1,383 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle 30^{\circ}", "\displaystyle 30^{\circ}", Formula("sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("2"), Formula("2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle 60^{\circ}", "\displaystyle 60^{\circ}", Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("1/2"), Formula("sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("2"), Formula("sqrt(3)/3")], + ["\displaystyle 120^{\circ}", "\displaystyle 120^{\circ}", Formula("-1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("-2"), Formula("-sqrt(3)/3")], + ["\displaystyle 150^{\circ}", "\displaystyle 150^{\circ}", Formula("-sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("2"), Formula("-2*sqrt(3)/3"), Formula("-sqrt(3)")], + ["\displaystyle 210^{\circ}", "\displaystyle 210^{\circ}", Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("-2"), Formula("-2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle 240^{\circ}", "\displaystyle 240^{\circ}", Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("-2"), Formula("sqrt(3)/3")], + ["\displaystyle 300^{\circ}", "\displaystyle 300^{\circ}", Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("1/2"), Formula("-sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("2"), Formula("-sqrt(3)/3")], + ["\displaystyle 330^{\circ}", "\displaystyle 330^{\circ}", Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("-2"), Formula("2*sqrt(3)/3"), Formula("-sqrt(3)")], +); + +@perm = (); +do { + if (random(0,1,1)==0) { + $perm[0] = list_random(0,3,4,7); + $perm[1] = list_random(1,2,5,6); + } else { + $perm[1] = list_random(0,3,4,7); + $perm[0] = list_random(1,2,5,6); + } +} until ($problems[$perm[0]][2]*$problems[$perm[1]][2] < 0); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-7.5,-7.5,7.5,7.5,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, $r/2,-0.4,0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, $r/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r/2,"30 degrees",'red','left','bottom',large)); + $alt[0] .= " 30 degrees is marked at (sqrt(3)/2, 1/2). The circle center (0,0), (sqrt(3)/2, 1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.8,0,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"60",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r*1/4, "1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, $r*1/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = ($r/2, $r*sqrt(3)/2, -0.4,0.4); + $graph[0]->stamps(closed_circle( $r/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r/2, $r*sqrt(3)/2, "60 degrees",'red','left','bottom',large)); + $alt[0] .= " 60 degrees is marked at (1/2, sqrt(3)/2). The circle center (0,0), (1/2, sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.9,"30",'red','right','top',large)); + $graph[0]->lb(new Label($r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*1/4, $r*sqrt(3)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, $r*sqrt(3)/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/2,"120 degrees",'red','right','bottom',large)); + $alt[0] .= " The number 120 degrees is marked at (-1/2, sqrt(3)/2). The circle center (0,0), (-1/2, sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.9,"30",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*1/4, $r*sqrt(3)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, $r*1/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, $r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/2,"150 degrees",'red','right','bottom',large)); + $alt[0] .= " 150 degrees is marked at (-sqrt(3)/2, 1/2). The circle center (0,0), (-sqrt(3)/2, 1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.8,0,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"60",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/4, "1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, $r*1/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==4) || ($perm[1]==4) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, -$r*1/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/2,"210 degrees",'red','right','top',large)); + $alt[0] .= " 210 degrees is marked at (-sqrt(3)/2, -1/2). The circle center (0,0), (-sqrt(3)/2, -1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.8,0,"30",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/4, "-1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, -$r*1/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==5) || ($perm[1]==5) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, -$r*sqrt(3)/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/2,"240 degrees",'red','right','top',large)); + $alt[0] .= " 240 degrees is marked at (-1/2, -sqrt(3)/2). The circle center (0,0), (-1/2, -sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.9,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*1/4, -$r*sqrt(3)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==6) || ($perm[1]==6) ) { + ($Px,$Py,$xShift,$yShift) = ($r*1/2, -$r*sqrt(3)/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/2, "300 degrees",'red','left','top',large)); + $alt[0] .= " 300 degrees is marked at (1/2, -sqrt(3)/2). The circle center (0,0), (1/2, -sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.9,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*1/4, -$r*sqrt(3)/4, "1",'red','right','top',large)); +} +if ( ($perm[0]==7) || ($perm[1]==7) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, -$r*1/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/2, "330 degrees",'red','left','top',large)); + $alt[0] .= " 330 degrees is marked at (sqrt(3)/2, -1/2). The circle center (0,0), (sqrt(3)/2, -1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.8,0,"30",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/4, "-1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, -$r*1/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +Here are the locations of those two angles on the Unit Circle. Note that the triangles are 30-60-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues60.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues60.pg new file mode 100644 index 0000000000..30c4a7a183 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues60.pg @@ -0,0 +1,422 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..7) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + if ($i==0) { + $new[$i] = 12*$rounds[$i]+1; + } elsif ($i==1) { + $new[$i] = 6*$rounds[$i]+1; + } elsif ($i==2) { + $new[$i] = 6*$rounds[$i]+2; + } elsif ($i==3) { + $new[$i] = 12*$rounds[$i]+5; + } elsif ($i==4) { + $new[$i] = 12*$rounds[$i]+7; + } elsif ($i==5) { + $new[$i] = 6*$rounds[$i]+4; + } elsif ($i==6) { + $new[$i] = 6*$rounds[$i]+5; + } else { + $new[$i] = 12*$rounds[$i]+11; + } +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle \frac{$new[0] \pi}{6}", "\displaystyle \frac{\pi}{6}", Formula("sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("2"), Formula("2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle \frac{$new[1] \pi}{3}", "\displaystyle \frac{\pi}{3}", Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("1/2"), Formula("sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("2"), Formula("sqrt(3)/3")], + ["\displaystyle \frac{$new[2] \pi}{3}", "\displaystyle \frac{2\pi}{3}", Formula("-1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("-2"), Formula("-sqrt(3)/3")], + ["\displaystyle \frac{$new[3] \pi}{6}", "\displaystyle \frac{5\pi}{6}", Formula("-sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("2"), Formula("-2*sqrt(3)/3"), Formula("-sqrt(3)")], + ["\displaystyle \frac{$new[4] \pi}{6}", "\displaystyle \frac{7\pi}{6}", Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("-2"), Formula("-2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle \frac{$new[5] \pi}{3}", "\displaystyle \frac{4\pi}{3}", Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("-2"), Formula("sqrt(3)/3")], + ["\displaystyle \frac{$new[6] \pi}{3}", "\displaystyle \frac{5\pi}{3}", Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("1/2"), Formula("-sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("2"), Formula("-sqrt(3)/3")], + ["\displaystyle \frac{$new[7] \pi}{6}", "\displaystyle \frac{11\pi}{6}", Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("-2"), Formula("2*sqrt(3)/3"), Formula("-sqrt(3)")], +); + +@perm = (); +do { + if (random(0,1,1)==0) { + $perm[0] = list_random(0,3,4,7); + $perm[1] = list_random(1,2,5,6); + } else { + $perm[1] = list_random(0,3,4,7); + $perm[0] = list_random(1,2,5,6); + } +} until ($problems[$perm[0]][2]*$problems[$perm[1]][2] < 0); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-6,-6,6,6,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, $r/2,-0.4,0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, $r/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r/2,"$new[0] pi/6",'red','left','bottom',large)); + $alt[0] .= " The number $new[0] pi/6 is marked at (sqrt(3)/2, 1/2). The circle center (0,0), (sqrt(3)/2, 1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.6,0,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"60",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r*1/4, "1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, $r*1/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = ($r/2, $r*sqrt(3)/2, -0.4,0.4); + $graph[0]->stamps(closed_circle( $r/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r/2, $r*sqrt(3)/2, "$new[1] pi/3",'red','left','bottom',large)); + $alt[0] .= " The number $new[1] pi/3 is marked at (1/2, sqrt(3)/2). The circle center (0,0), (1/2, sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.9,"30",'red','right','top',large)); + $graph[0]->lb(new Label($r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*1/4, $r*sqrt(3)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, $r*sqrt(3)/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/2,"$new[2] pi/3",'red','right','bottom',large)); + $alt[0] .= " The number $new[2] pi/3 is marked at (-1/2, sqrt(3)/2). The circle center (0,0), (-1/2, sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.9,"30",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*1/4, $r*sqrt(3)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, $r*1/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, $r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/2,"$new[3] pi/6",'red','right','bottom',large)); + $alt[0] .= " The number $new[3] pi/6 is marked at (-sqrt(3)/2, 1/2). The circle center (0,0), (-sqrt(3)/2, 1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.6,0,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"60",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/4, "1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, $r*1/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==4) || ($perm[1]==4) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, -$r*1/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/2,"$new[4] pi/6",'red','right','top',large)); + $alt[0] .= " The number $new[4] pi/6 is marked at (-sqrt(3)/2, -1/2). The circle center (0,0), (-sqrt(3)/2, -1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.6,0,"30",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/4, "-1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, -$r*1/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==5) || ($perm[1]==5) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, -$r*sqrt(3)/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/2,"$new[5] pi/3",'red','right','top',large)); + $alt[0] .= " The number $new[5] pi/3 is marked at (-1/2, -sqrt(3)/2). The circle center (0,0), (-1/2, -sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.9,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*1/4, -$r*sqrt(3)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==6) || ($perm[1]==6) ) { + ($Px,$Py,$xShift,$yShift) = ($r*1/2, -$r*sqrt(3)/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/2, "$new[6] pi/3",'red','left','top',large)); + $alt[0] .= " The number $new[6] pi/3 is marked at (1/2, -sqrt(3)/2). The circle center (0,0), (1/2, -sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.9,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*1/4, -$r*sqrt(3)/4, "1",'red','right','top',large)); +} +if ( ($perm[0]==7) || ($perm[1]==7) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, -$r*1/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/2, "$new[7] pi/6",'red','left','top',large)); + $alt[0] .= " The number $new[7] pi/6 is marked at (sqrt(3)/2, -1/2). The circle center (0,0), (sqrt(3)/2, -1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.6,0,"30",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/4, "-1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, -$r*1/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+2k\pi`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+2\cdot([$roundsN[$perm[0]]])\cdot\pi = [$problems[$perm[0]][1]]``] + +the angle [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+2\cdot([$roundsN[$perm[1]]])\cdot\pi = [$problems[$perm[1]][1]]``] + +the angle [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles. Note that the triangles are 30-60-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues61.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues61.pg new file mode 100644 index 0000000000..855ae74d2c --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues61.pg @@ -0,0 +1,422 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# Part of the algorithm by Adam Spiegler, +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "extraAnswerEvaluators.pl", + "PGgraphmacros.pl", + "MathObjects.pl", + "PGchoicemacros.pl", + "contextLimitedRadical.pl", + "PCCmacros.pl", + "unionTables.pl", + "niceTables.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGcourse.pl" +); +sub PF {PGML::Format(@_)}; + +TEXT(beginproblem()); + +Context("LimitedRadical"); + +$refreshCachedImages=1; + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..7) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + if ($i==0) { + $new[$i] = (12*$rounds[$i]+1)*30; + } elsif ($i==1) { + $new[$i] = (6*$rounds[$i]+1)*60; + } elsif ($i==2) { + $new[$i] = (6*$rounds[$i]+2)*60; + } elsif ($i==3) { + $new[$i] = (12*$rounds[$i]+5)*30; + } elsif ($i==4) { + $new[$i] = (12*$rounds[$i]+7)*30; + } elsif ($i==5) { + $new[$i] = (6*$rounds[$i]+4)*60; + } elsif ($i==6) { + $new[$i] = (6*$rounds[$i]+5)*60; + } else { + $new[$i] = (12*$rounds[$i]+11)*30; + } +} + +#[ angle, angle in [0,2pi], x, y, sine value, cosine value, tangent value, cosecant value, secant value, cotangent value +@problems = ( + ["\displaystyle $new[0]^{\circ}", "\displaystyle 30^{\circ}", Formula("sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("2"), Formula("2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle $new[1]^{\circ}", "\displaystyle 60^{\circ}", Formula("1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("1/2"), Formula("sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("2"), Formula("sqrt(3)/3")], + ["\displaystyle $new[2]^{\circ}", "\displaystyle 120^{\circ}", Formula("-1/2"), Formula("sqrt(3)/2"), Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-sqrt(3)"), Formula("2*sqrt(3)/3"), Formula("-2"), Formula("-sqrt(3)/3")], + ["\displaystyle $new[3]^{\circ}", "\displaystyle 150^{\circ}", Formula("-sqrt(3)/2"), Formula("1/2"), Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("2"), Formula("-2*sqrt(3)/3"), Formula("-sqrt(3)")], + ["\displaystyle $new[4]^{\circ}", "\displaystyle 210^{\circ}", Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("sqrt(3)/3"), Formula("-2"), Formula("-2*sqrt(3)/3"), Formula("sqrt(3)")], + ["\displaystyle $new[5]^{\circ}", "\displaystyle 240^{\circ}", Formula("-1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("-1/2"), Formula("sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("-2"), Formula("sqrt(3)/3")], + ["\displaystyle $new[6]^{\circ}", "\displaystyle 300^{\circ}", Formula("1/2"), Formula("-sqrt(3)/2"), Formula("-sqrt(3)/2"), Formula("1/2"), Formula("-sqrt(3)"), Formula("-2*sqrt(3)/3"), Formula("2"), Formula("-sqrt(3)/3")], + ["\displaystyle $new[7]^{\circ}", "\displaystyle 330^{\circ}", Formula("sqrt(3)/2"), Formula("-1/2"), Formula("-1/2"), Formula("sqrt(3)/2"), Formula("-sqrt(3)/3"), Formula("-2"), Formula("2*sqrt(3)/3"), Formula("-sqrt(3)")], +); + +@perm = (); +do { + if (random(0,1,1)==0) { + $perm[0] = list_random(0,3,4,7); + $perm[1] = list_random(1,2,5,6); + } else { + $perm[1] = list_random(0,3,4,7); + $perm[0] = list_random(1,2,5,6); + } +} until ($problems[$perm[0]][2]*$problems[$perm[1]][2] < 0); + +$r = 5; + +@graph = (); +$graph[0] = init_graph(-9,-9,9,9,'axes'=>[0,0],'grid'=>[1,1]); +$graph[0]->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph[0] ); +$fnAlpha->domain(0,2*pi); + + +$alt[0] = "This is the graph of a unit circle."; +if ( ($perm[0]==0) || ($perm[1]==0) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, $r/2,-0.4,0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, $r/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r/2,"$new[0] degrees",'red','left','bottom',large)); + $alt[0] .= " $new[0] degrees is marked at (sqrt(3)/2, 1/2). The circle center (0,0), (sqrt(3)/2, 1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.8,0,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-0.5,"60",'red','right','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, $r*1/4, "1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, $r*1/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==1) || ($perm[1]==1) ) { + ($Px,$Py,$xShift,$yShift) = ($r/2, $r*sqrt(3)/2, -0.4,0.4); + $graph[0]->stamps(closed_circle( $r/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r/2, $r*sqrt(3)/2, "$new[1] degrees",'red','left','bottom',large)); + $alt[0] .= " $new[1] degrees is marked at (1/2, sqrt(3)/2). The circle center (0,0), (1/2, sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label($Px-0.1,$Py-1.1,"30",'red','right','top',large)); + $graph[0]->lb(new Label($r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','top',large)); + $graph[0]->lb(new Label($r*1/4, $r*sqrt(3)/4, "1",'red','right','bottom',large)); +} +if ( ($perm[0]==2) || ($perm[1]==2) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, $r*sqrt(3)/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, $r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/2,"$new[2] degrees",'red','right','bottom',large)); + $alt[0] .= " $new[2] degrees is marked at (-1/2, sqrt(3)/2). The circle center (0,0), (-1/2, sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-1.1,"30",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*1/2, $r*sqrt(3)/4, "sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*1/4, $r*sqrt(3)/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==3) || ($perm[1]==3) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, $r*1/2,0.4,0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, $r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/2,"$new[3] degrees",'red','right','bottom',large)); + $alt[0] .= " $new[3] degrees is marked at (-sqrt(3)/2, 1/2). The circle center (0,0), (-sqrt(3)/2, 1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is 1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.8,0,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($Px+0.1,$Py-0.5,"60",'red','left','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, $r*1/4, "1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','top',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, $r*1/4, "1",'red','left','bottom',large)); +} +if ( ($perm[0]==4) || ($perm[1]==4) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*sqrt(3)/2, -$r*1/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/2,"$new[4] degrees",'red','right','top',large)); + $alt[0] .= " $new[4] degrees is marked at (-sqrt(3)/2, -1/2). The circle center (0,0), (-sqrt(3)/2, -1/2) and (-sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.8,0,"30",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+0.5,"60",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/2, -$r*1/4, "-1/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, 0, "-sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*sqrt(3)/4, -$r*1/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==5) || ($perm[1]==5) ) { + ($Px,$Py,$xShift,$yShift) = (-$r*1/2, -$r*sqrt(3)/2,0.4,-0.4); + $graph[0]->stamps(closed_circle( -$r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/2,"$new[5] degrees",'red','right','top',large)); + $alt[0] .= " $new[5] degrees is marked at (-1/2, -sqrt(3)/2). The circle center (0,0), (-1/2, -sqrt(3)/2) and (-1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is -1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(-0.4,0,"60",'red','right','top',large)); + $graph[0]->lb(new Label($Px+0.1,$Py+1.1,"30",'red','left','bottom',large)); + $graph[0]->lb(new Label(-$r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','right','middle',large)); + $graph[0]->lb(new Label(-$r*1/4, 0, "-1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label(-$r*1/4, -$r*sqrt(3)/4, "1",'red','left','top',large)); +} +if ( ($perm[0]==6) || ($perm[1]==6) ) { + ($Px,$Py,$xShift,$yShift) = ($r*1/2, -$r*sqrt(3)/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*1/2, -$r*sqrt(3)/2, red )); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/2, "$new[6] degrees",'red','left','top',large)); + $alt[0] .= " $new[6] degrees is marked at (1/2, -sqrt(3)/2). The circle center (0,0), (1/2, -sqrt(3)/2) and (1/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is 1/2, side leg is -sqrt(3)/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.4,0,"60",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+1.1,"30",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*1/2, -$r*sqrt(3)/4, "-sqrt(3)/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*1/4, 0, "1/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*1/4, -$r*sqrt(3)/4, "1",'red','right','top',large)); +} +if ( ($perm[0]==7) || ($perm[1]==7) ) { + ($Px,$Py,$xShift,$yShift) = ($r*sqrt(3)/2, -$r*1/2,-0.4,-0.4); + $graph[0]->stamps(closed_circle( $r*sqrt(3)/2, -$r*1/2, red )); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/2, "$new[7] degrees",'red','left','top',large)); + $alt[0] .= " $new[7] degrees is marked at (sqrt(3)/2, -1/2). The circle center (0,0), (sqrt(3)/2, -1/2) and (sqrt(3)/2, 0) form a 30-60-90 right triangle. The length of the bottom leg is sqrt(3)/2, side leg is -1/2, and hypotenuse is 1."; + $graph[0]->moveTo(0,0); + $graph[0]->lineTo($Px,$Py,red,2); + $graph[0]->lineTo($Px,0,red,2); + $graph[0]->lineTo(0,0,red,2); + $graph[0]->moveTo($Px,$yShift); + $graph[0]->lineTo($Px+$xShift,$yShift,red,2); + $graph[0]->lineTo($Px+$xShift,0,red,2); + $graph[0]->lb(new Label(0.8,0,"30",'red','left','top',large)); + $graph[0]->lb(new Label($Px-0.1,$Py+0.5,"60",'red','right','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/2, -$r*1/4, "-1/2",'red','left','middle',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, 0, "sqrt(3)/2",'red','center','bottom',large)); + $graph[0]->lb(new Label($r*sqrt(3)/4, -$r*1/4, "1",'red','right','top',large)); +} + +$fig0 = image(insertGraph($graph[0]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); + +############################################################## + +BEGIN_PGML + +Think about the Unit Circle and fill in blanks. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('([_____]{$problems[$perm[0]][2]},[_____]{$problems[$perm[0]][3]})')], + [PF('([_____]{$problems[$perm[1]][2]},[_____]{$problems[$perm[1]][3]})')], + ], + [ + [PF('[`\sin(\alpha)=`][_____]{$problems[$perm[0]][4]}'),], + [PF('[`\sin(\beta)=`][_____]{$problems[$perm[1]][4]}')], + ], + [ + [PF('[`\cos(\alpha)=`][_____]{$problems[$perm[0]][5]}')], + [PF('[`\cos(\beta)=`][_____]{$problems[$perm[1]][5]}')], + ], + [ + [PF('[`\tan(\alpha)=`][_____]{$problems[$perm[0]][6]}')], + [PF('[`\tan(\beta)=`][_____]{$problems[$perm[1]][6]}')], + ], + [ + [PF('[`\csc(\alpha)=`][_____]{$problems[$perm[0]][7]}')], + [PF('[`\csc(\beta)=`][_____]{$problems[$perm[1]][7]}')], + ], + [ + [PF('[`\sec(\alpha)=`][_____]{$problems[$perm[0]][8]}')], + [PF('[`\sec(\beta)=`][_____]{$problems[$perm[1]][8]}')], + ], + [ + [PF('[`\cot(\alpha)=`][_____]{$problems[$perm[0]][9]}')], + [PF('[`\cot(\beta)=`][_____]{$problems[$perm[1]][9]}')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + + + +END_PGML + +############################################################## + +$showPartialCorrectAnswers = 1; + + +############################################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+360k`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$problems[$perm[0]][0]]`], since + + [`` [$problems[$perm[0]][0]]+([$roundsN[$perm[0]]])\cdot180^{\circ} = [$problems[$perm[0]][1]]``] + +the angle [`[$problems[$perm[0]][0]]`] and [`[$problems[$perm[0]][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$problems[$perm[1]][0]]`], since + + [`` [$problems[$perm[1]][0]]+([$roundsN[$perm[1]]])\cdot180^{\circ} = [$problems[$perm[1]][1]]``] + +the angle [`[$problems[$perm[1]][0]]`] and [`[$problems[$perm[1]][1]]`] are coterminal, and have the same trigonometry values. + +Here are the locations of those two angles. Note that the triangles are 30-60-90 special right triangles. + +>>[@ $fig0 @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +If [`\theta`] corresponds to [`P(x,y)`] on the Unit Circle, then: + + [``\begin{aligned} + \cos(\theta) &=x \\ + \sin(\theta) &=y + \end{aligned}``] + +From the above two values, we can deduct the following trigonometry values: + + [``\begin{aligned} + \tan(\theta) &= \frac{\sin(\theta)}{\cos(\theta)} = \frac{y}{x} \\ + \csc(\theta) &= \frac{1}{\sin(\theta)} = \frac{1}{y} \\ + \sec(\theta) &= \frac{1}{\cos(\theta)} = \frac{1}{x} \\ + \cot(\theta) &= \frac{\cos(\theta)}{\sin(\theta)} = \frac{x}{y} \\ + \end{aligned}``] + +The solutions are: + +[@DataTable( + [ + [ + [PF('[`\alpha=[$problems[$perm[0]][0]]`]')], + [PF('[`\beta=[$problems[$perm[1]][0]]`]')], + ], + [ + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + [PF('Coordinates of the point on Unit Circle'), + rowcss => 'border-bottom: 0px solid; ', + cellcss => 'border-right: 0px solid; ',], + ], + [ + [PF('[`([$problems[$perm[0]][2]],[$problems[$perm[0]][3]])`]')], + [PF('[`([$problems[$perm[1]][2]],[$problems[$perm[1]][3]])`]')], + ], + [ + [PF('[`\sin(\alpha)=[$problems[$perm[0]][4]]`]'),], + [PF('[`\sin(\beta)=[$problems[$perm[1]][4]]`]')], + ], + [ + [PF('[`\cos(\alpha)=[$problems[$perm[0]][5]]`]')], + [PF('[`\cos(\beta)=[$problems[$perm[1]][5]]`]')], + ], + [ + [PF('[`\tan(\alpha)=[$problems[$perm[0]][6]]`]')], + [PF('[`\tan(\beta)=[$problems[$perm[1]][6]]`]')], + ], + [ + [PF('[`\csc(\alpha)=[$problems[$perm[0]][7]]`]')], + [PF('[`\csc(\beta)=[$problems[$perm[1]][7]]`]')], + ], + [ + [PF('[`\sec(\alpha)=[$problems[$perm[0]][8]]`]')], + [PF('[`\sec(\beta)=[$problems[$perm[1]][8]]`]')], + ], + [ + [PF('[`\cot(\alpha)=[$problems[$perm[0]][9]]`]')], + [PF('[`\cot(\beta)=[$problems[$perm[1]][9]]`]')], + ], + ], + align => 'c|c', + columnscss => + ['border-bottom: 1px solid;', + 'border-bottom: 1px solid;',], +);@]* + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues70.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues70.pg new file mode 100644 index 0000000000..fdd75464d3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues70.pg @@ -0,0 +1,255 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + Context("LimitedRadical"); + if (($numIn==0)||($numOut==0)) {return 0;} + + if ($d0==1) { + if ($numIn==1) {return Formula("$n0");} + elsif ($n0==1) {return Formula("sqrt($numIn)");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)");} + else {return Formula("$n0*sqrt($numIn)");} + } else { + if ($numIn==1) {return Formula("$n0/$d0");} + elsif ($n0==1) {return Formula("sqrt($numIn)/$d0");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)/$d0");} + else {return Formula("$n0*sqrt($numIn)/$d0");} + } +} + + +Context("LimitedRadical"); + +@angles = ( + #[displayed value, reference value, sin, cos, tan, csc, sec, cot] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + "\displaystyle 0", + "\displaystyle 0", + [Formula("0"), 0, 0, 1], + [Formula("1"), 1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("1"), 1, 1, 1], + ["DNE"] + ], + [ + "\displaystyle \frac{\pi}{6}", + "\displaystyle \frac{\pi}{6}", + [Formula("1/2"), 1, 1, 2], + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("sqrt(3)/3"), 1, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("sqrt(3)"), 1, 3, 1], + ], + [ + "\displaystyle \frac{\pi}{3}", + "\displaystyle \frac{\pi}{3}", + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("1/2"), 1, 1, 2], + [Formula("sqrt(3)"), 1, 3, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("sqrt(3)/3"), 1, 3, 3], + ], + [ + "\displaystyle \frac{\pi}{2}", + "\displaystyle \frac{\pi}{2}", + [Formula("1"), 1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("1"), 1, 1, 1], + ["DNE"], + [Formula("0"), 0, 0, 1], + ], + [ + "\displaystyle \frac{2\pi}{3}", + "\displaystyle \frac{2\pi}{3}", + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("-1/2"), -1, 1, 2], + [Formula("-sqrt(3)"), -1, 3, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("-sqrt(3)/3"), -1, 3, 3], + ], + [ + "\displaystyle \frac{5\pi}{6}", + "\displaystyle \frac{5\pi}{6}", + [Formula("1/2"), 1, 1, 2], + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("-sqrt(3)/3"), -1, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("-sqrt(3)"), -1, 3, 1], + ], + [ + "\displaystyle \pi", + "\displaystyle \pi", + [Formula("0"), 0, 0, 1], + [Formula("-1"), -1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("-1"), -1, 1, 1], + ["DNE"] + ], + [ + "\displaystyle \frac{7\pi}{6}", + "\displaystyle \frac{7\pi}{6}", + [Formula("-1/2"), -1, 1, 2], + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("sqrt(3)/3"), 1, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("sqrt(3)"), 1, 3, 1], + ], + [ + "\displaystyle \frac{4\pi}{3}", + "\displaystyle \frac{4\pi}{3}", + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("-1/2"), -1, 1, 2], + [Formula("sqrt(3)"), 1, 3, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("sqrt(3)/3"), 1, 3, 3], + ], + [ + "\displaystyle \frac{3\pi}{2}", + "\displaystyle \frac{3\pi}{2}", + [Formula("-1"), -1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("-1"), -1, 1, 1], + ["DNE"], + [Formula("0"), 0, 0, 1], + ], + [ + "\displaystyle \frac{5\pi}{3}", + "\displaystyle \frac{5\pi}{3}", + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("1/2"), 1, 1, 2], + [Formula("-sqrt(3)"), -1, 3, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("-sqrt(3)/3"), -1, 3, 3], + ], + [ + "\displaystyle \frac{11\pi}{6}", + "\displaystyle \frac{11\pi}{6}", + [Formula("-1/2"), -1, 1, 2], + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("-sqrt(3)/3"), -1, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("-sqrt(3)"), -1, 3, 1], + ], +); + +@funcs = ( + "", + "", + "\displaystyle \sin", + "\displaystyle \cos", + "\displaystyle \tan", + "\displaystyle \csc", + "\displaystyle \sec", + "\displaystyle \cot" +); + +do { + $angleInd0 = random(0,11,1); + $angleInd1 = random(0,11,1); + $funcInd0 = random(2,7,1); + $funcInd1 = random(2,7,1); +} until + ($funcInd0 != $funcInd1) && + ($angleInd0 != $angleInd1) && + ($angles[$angleInd0][$funcInd0][0] != "DNE") && + ($angles[$angleInd1][$funcInd1][0] != "DNE"); + +($numOut1, $numIn1, $den1) = ( + $angles[$angleInd0][$funcInd0][1]*$angles[$angleInd1][$funcInd1][1], + $angles[$angleInd0][$funcInd0][2]*$angles[$angleInd1][$funcInd1][2], + $angles[$angleInd0][$funcInd0][3]*$angles[$angleInd1][$funcInd1][3] +); + +if (sqrt($numIn1)==int(sqrt($numIn1))) { + $numOut1 *= sqrt($numIn1); + $numIn1 = 1; +} + +$value0 = &createRadical($angles[$angleInd0][$funcInd0][1],$angles[$angleInd0][$funcInd0][2],$angles[$angleInd0][$funcInd0][3]); + +$value1 = &createRadical($angles[$angleInd1][$funcInd1][1],$angles[$angleInd1][$funcInd1][2],$angles[$angleInd1][$funcInd1][3]); + +$ans = &createRadical($numOut1, $numIn1, $den1); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +Without using a calculator, calculate the expression with your knowledge about the Unit Circle. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + + [`` [$funcs[$funcInd0]]\left([$angles[$angleInd0][0]]\right) \cdot [$funcs[$funcInd1]]\left([$angles[$angleInd1][0]]\right) = ``][_________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + [$funcs[$funcInd0]]\left([$angles[$angleInd0][0]]\right) \cdot [$funcs[$funcInd1]]\left([$angles[$angleInd1][0]]\right) + &= \left([$value0]\right)\cdot\left([$value1]\right) \\ + &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues71.pg b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues71.pg new file mode 100644 index 0000000000..eb5c30fd92 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/UnitCircle/UnitCircleValues71.pg @@ -0,0 +1,290 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "contextLimitedRadical.pl", + "PGML.pl", + "PCCmacros.pl", + "PGcourse.pl" +); + +TEXT(beginproblem()); + +sub createRadical { + my ($numOut, $numIn, $den) = @_; + Context("LimitedFraction"); + my ($n0,$d0) = Fraction($numOut,$den)->reduce->value; + + Context("LimitedRadical"); + if (($numIn==0)||($numOut==0)) {return 0;} + + if ($d0==1) { + if ($numIn==1) {return Formula("$n0");} + elsif ($n0==1) {return Formula("sqrt($numIn)");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)");} + else {return Formula("$n0*sqrt($numIn)");} + } else { + if ($numIn==1) {return Formula("$n0/$d0");} + elsif ($n0==1) {return Formula("sqrt($numIn)/$d0");} + elsif ($n0==-1) {return Formula("-sqrt($numIn)/$d0");} + else {return Formula("$n0*sqrt($numIn)/$d0");} + } +} + + +Context("LimitedRadical"); + +@rounds = ( ); +@roundsN = ( ); +@new = ( ); +for my $i (0..11) { + $rounds[$i] = random(2,6,1)*random(-1,1,2); + $roundsN[$i] = -$rounds[$i]; + if ( ($i==0) || ($i==6) ) { + $new[$i] = 2*$rounds[$i] + $i/6; + } elsif ( ($i==1) || ($i==5) || ($i==7) || ($i==11) ) { + $new[$i] = 12*$rounds[$i]+$i; + } elsif ( ($i==2) || ($i==4) || ($i==8) || ($i==10) ) { + $new[$i] = 6*$rounds[$i]+$i/2; + } else { #( ($i==3) || ($i==9) ) + $new[$i] = 4*$rounds[$i]+$i/3; + } +} + +@angles = ( + #[displayed value, reference value, sin, cos, tan, csc, sec, cot] + #each value: [displayed value, $numeratorOut, $numeratorIn, $denominator] + [ + "\displaystyle $new[0]\pi", + "\displaystyle 0", + [Formula("0"), 0, 0, 1], + [Formula("1"), 1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("1"), 1, 1, 1], + ["DNE"] + ], + [ + "\displaystyle \frac{$new[1]\pi}{6}", + "\displaystyle \frac{\pi}{6}", + [Formula("1/2"), 1, 1, 2], + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("sqrt(3)/3"), 1, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("sqrt(3)"), 1, 3, 1], + ], + [ + "\displaystyle \frac{$new[2]\pi}{3}", + "\displaystyle \frac{\pi}{3}", + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("1/2"), 1, 1, 2], + [Formula("sqrt(3)"), 1, 3, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("sqrt(3)/3"), 1, 3, 3], + ], + [ + "\displaystyle \frac{$new[3]\pi}{2}", + "\displaystyle \frac{\pi}{2}", + [Formula("1"), 1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("1"), 1, 1, 1], + ["DNE"], + [Formula("0"), 0, 0, 1], + ], + [ + "\displaystyle \frac{$new[4]\pi}{3}", + "\displaystyle \frac{2\pi}{3}", + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("-1/2"), -1, 1, 2], + [Formula("-sqrt(3)"), -1, 3, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("-sqrt(3)/3"), -1, 3, 3], + ], + [ + "\displaystyle \frac{$new[5]\pi}{6}", + "\displaystyle \frac{5\pi}{6}", + [Formula("1/2"), 1, 1, 2], + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("-sqrt(3)/3"), -1, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("-sqrt(3)"), -1, 3, 1], + ], + [ + "\displaystyle $new[6]\pi", + "\displaystyle \pi", + [Formula("0"), 0, 0, 1], + [Formula("-1"), -1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("-1"), -1, 1, 1], + ["DNE"] + ], + [ + "\displaystyle \frac{$new[7]\pi}{6}", + "\displaystyle \frac{7\pi}{6}", + [Formula("-1/2"), -1, 1, 2], + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("sqrt(3)/3"), 1, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("sqrt(3)"), 1, 3, 1], + ], + [ + "\displaystyle \frac{$new[8]\pi}{3}", + "\displaystyle \frac{4\pi}{3}", + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("-1/2"), -1, 1, 2], + [Formula("sqrt(3)"), 1, 3, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("sqrt(3)/3"), 1, 3, 3], + ], + [ + "\displaystyle \frac{$new[9]\pi}{2}", + "\displaystyle \frac{3\pi}{2}", + [Formula("-1"), -1, 1, 1], + [Formula("0"), 0, 0, 1], + ["DNE"], + [Formula("-1"), -1, 1, 1], + ["DNE"], + [Formula("0"), 0, 0, 1], + ], + [ + "\displaystyle \frac{$new[10] \pi}{3}", + "\displaystyle \frac{5\pi}{3}", + [Formula("-sqrt(3)/2"), -1, 3, 2], + [Formula("1/2"), 1, 1, 2], + [Formula("-sqrt(3)"), -1, 3, 1], + [Formula("-2*sqrt(3)/3"), -2, 3, 3], + [Formula("2"), 2, 1, 1], + [Formula("-sqrt(3)/3"), -1, 3, 3], + ], + [ + "\displaystyle \frac{$new[11] \pi}{6}", + "\displaystyle \frac{11\pi}{6}", + [Formula("-1/2"), -1, 1, 2], + [Formula("sqrt(3)/2"), 1, 3, 2], + [Formula("-sqrt(3)/3"), -1, 3, 3], + [Formula("-2"), -2, 1, 1], + [Formula("2*sqrt(3)/3"), 2, 3, 3], + [Formula("-sqrt(3)"), -1, 3, 1], + ], +); + +@funcs = ( + "", + "", + "\displaystyle \sin", + "\displaystyle \cos", + "\displaystyle \tan", + "\displaystyle \csc", + "\displaystyle \sec", + "\displaystyle \cot" +); + +do { + $angleInd0 = random(0,11,1); + $angleInd1 = random(0,11,1); + $funcInd0 = random(2,7,1); + $funcInd1 = random(2,7,1); +} until + ($funcInd0 != $funcInd1) && + ($angleInd0 != $angleInd1) && + ($angles[$angleInd0][$funcInd0][0] != "DNE") && + ($angles[$angleInd1][$funcInd1][0] != "DNE"); + +($numOut1, $numIn1, $den1) = ( + $angles[$angleInd0][$funcInd0][1]*$angles[$angleInd1][$funcInd1][1], + $angles[$angleInd0][$funcInd0][2]*$angles[$angleInd1][$funcInd1][2], + $angles[$angleInd0][$funcInd0][3]*$angles[$angleInd1][$funcInd1][3] +); + +if (sqrt($numIn1)==int(sqrt($numIn1))) { + $numOut1 *= sqrt($numIn1); + $numIn1 = 1; +} + +$value0 = &createRadical($angles[$angleInd0][$funcInd0][1],$angles[$angleInd0][$funcInd0][2],$angles[$angleInd0][$funcInd0][3]); + +$value1 = &createRadical($angles[$angleInd1][$funcInd1][1],$angles[$angleInd1][$funcInd1][2],$angles[$angleInd1][$funcInd1][3]); + +$ans = &createRadical($numOut1, $numIn1, $den1); + +$showPartialCorrectAnswers = 1; + +############################################## + +BEGIN_PGML + +Without using a calculator, calculate the expression with your knowledge about the Unit Circle. + +[@KeyboardInstructions( +"\n" +.'* If a value is undefined, type *DNE* (does not exist).' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +."\n" +.'* Rationalize the denominator if needed.' +)@]** + + + [`` [$funcs[$funcInd0]]\left([$angles[$angleInd0][0]]\right) \cdot [$funcs[$funcInd1]]\left([$angles[$angleInd1][0]]\right) = ``][_________]{$ans} + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +On the Unit Circle, an angle [`\theta`] and [`\theta+2k\pi`], where [`k`] is any integer, are coterminal (at the same point). They would have the same trignometry values. + +For [`[$funcs[$funcInd0]]\left([$angles[$angleInd0][0]]\right)`], since + + [`` [$angles[$angleInd0][0]]+2\cdot([$roundsN[$angleInd0]])\cdot\pi = [$angles[$angleInd0][1]]``] + +the angles [`[$angles[$angleInd0][0]]`] and [`[$angles[$angleInd0][1]]`] are coterminal, and have the same trigonometry values. + +Similarly, for [`[$funcs[$funcInd1]]\left([$angles[$angleInd1][0]]\right)`], since + + [`` [$angles[$angleInd1][0]]+2\cdot([$roundsN[$angleInd1]])\cdot\pi = [$angles[$angleInd1][1]]``] + +the angles [`[$angles[$angleInd1][0]]`] and [`[$angles[$angleInd1][1]]`] are coterminal, and have the same trigonometry values. + +So we have: + + [``\begin{aligned} + [$funcs[$funcInd0]]\left([$angles[$angleInd0][0]]\right) \cdot [$funcs[$funcInd1]]\left([$angles[$angleInd1][0]]\right) + &= [$funcs[$funcInd0]]\left([$angles[$angleInd0][1]]\right) \cdot [$funcs[$funcInd1]]\left([$angles[$angleInd1][1]]\right) \\ + &= \left([$value0]\right)\cdot\left([$value1]\right) \\ + &= [$ans] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/DotProduct10.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/DotProduct10.pg new file mode 100644 index 0000000000..70cb18cd18 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/DotProduct10.pg @@ -0,0 +1,158 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("Fraction"); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@num = (); +@den = (); +@angle = (); + +do { + for my $i (0..1) { + do { + $den[$i] = list_random(3,4,6); + $num[$i] = random(1,2*$den[$i]-1,1); + } until gcd($num[$i],$den[$i])==1; + $angle[$i] = specialAngle($num[$i]*pi/$den[$i]); + } + $angle[2] = specialAngle(abs(Compute($angle[0])-Compute($angle[1])),(1,2,3,4,6,12)); + $angle[3] = specialAngle(abs(Compute($angle[0])-Compute($angle[1]))); +} until + Compute($angle[2]) == Compute($angle[3]) + && Compute($angle[2]) < pi + && Compute($angle[2]) > 0 + && Compute($angle[2]) != Compute(pi/2); + +@r = (); +do { + $r[0] = random(1,5,1)*6; + $r[1] = random(1,5,1)*6; +} until $r[0] != $r[1]; + +@Px = (); @Py = (); @v = (); +for my $i (0..1) { + $Px[$i] = specialRadical($r[$i]*cos(Compute($angle[$i]))); + $Py[$i] = specialRadical($r[$i]*sin(Compute($angle[$i]))); + Context()->variables->are( + i=>['Real','TeX'=>'\mathbf{i}'], + j=>['Real','TeX'=>'\mathbf{j}'], + ); + if ($Py[$i]>0) { + $v[$i] = Formula("$Px[$i]*i+$Py[$i]*j"); + } else { + my $a = specialRadical(-$r[$i]*sin(Compute($angle[$i]))); + Context()->variables->are( + i=>['Real','TeX'=>'\mathbf{i}'], + j=>['Real','TeX'=>'\mathbf{j}'], + ); + $v[$i] = Formula("$Px[$i]*i-$a*j"); + } +} +$pro0 = specialRadical(Compute($Px[0])*Compute($Px[1])); +$pro1 = specialRadical(Compute($Py[0])*Compute($Py[1])); +$dot = specialRadical(Compute($pro0+$pro1)); + +###################### +# Main text + +BEGIN_PGML + +a) If [`u=[$v[0]]`] and [`v=[$v[1]]`], find their dot product. + + [`u\cdot v=`][______________]{$dot} + +b) Find the measure of the angle, [`\theta`], between those two vectors. + + [`\theta=`][_________________]{$angle[2]} + +END_PGML + + +######################## + +$Px0r = Compute($Px[0]); +$Py0r = Compute($Py[0]); +$Px1r = Compute($Px[1]); +$Py1r = Compute($Py[1]); +$s1 = specialRadical(sqrt(($Px0r)**2+($Py0r)**2)*sqrt(($Px1r)**2+($Py1r)**2)); + +BEGIN_PGML_SOLUTION + +###Part a + +For [`u=`] and [`v=`], their product can be calculated by the formula + + [`` u\cdot v= ac+bd ``] + +We have: + + [``\begin{aligned} + u\cdot v &= ([$Px[0]])([$Px[1]])+([$Py[0]])([$Py[1]]) \\ + &= [$pro0]+([$pro1]) \\ + &= [$dot] + \end{aligned}``] + +###Part b + +To find the angle between [`u`] and [`v`], use the formula + + [`` \theta = \cos^{-1}\left( \frac{u\cdot v}{|u||v|}\right) ``] + +We have: + + [``\begin{aligned} + \theta &= \cos^{-1}\left( \frac{u\cdot v}{|u||v|}\right) \\ + &= \cos^{-1}\left( \frac{[$dot]}{\sqrt{([$Px[0]])^2+([$Py[0]])^2}\cdot \sqrt{([$Px[1]])^2+([$Py[1]])^2}} \right) \\ + &= \cos^{-1}\left( \frac{[$dot]}{[$s1]} \right) \\ + &= [$angle[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/DotProduct20.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/DotProduct20.pg new file mode 100644 index 0000000000..5c29afbf2b --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/DotProduct20.pg @@ -0,0 +1,159 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# + + + +Context("Fraction"); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +@num = (); +@den = (); +@angle = (); + +do { + for my $i (0..1) { + do { + $den[$i] = list_random(3,4,6); + $num[$i] = random(1,2*$den[$i]-1,1); + } until gcd($num[$i],$den[$i])==1; + $angle[$i] = specialAngle($num[$i]*pi/$den[$i]); + } + $angle[2] = specialAngle(abs(Compute($angle[0])-Compute($angle[1])),(1,2,3,4,6,12)); + $angle[3] = specialAngle(abs(Compute($angle[0])-Compute($angle[1]))); +} until + Compute($angle[2]) == Compute($angle[3]) + &&( Compute($angle[2]) == 0 + || Compute($angle[2]) == Compute(pi/2) + || Compute($angle[2]) == Compute(pi) ); + +@r = (); +do { + $r[0] = random(1,5,1)*6; + $r[1] = random(1,5,1)*6; +} until $r[0] != $r[1]; + +@Px = (); @Py = (); @v = (); +for my $i (0..1) { + $Px[$i] = specialRadical($r[$i]*cos(Compute($angle[$i]))); + $Py[$i] = specialRadical($r[$i]*sin(Compute($angle[$i]))); + Context()->variables->are( + i=>['Real','TeX'=>'\mathbf{i}'], + j=>['Real','TeX'=>'\mathbf{j}'], + ); + if ($Py[$i]>0) { + $v[$i] = Formula("$Px[$i]*i+$Py[$i]*j"); + } else { + my $a = specialRadical(-$r[$i]*sin(Compute($angle[$i]))); + Context()->variables->are( + i=>['Real','TeX'=>'\mathbf{i}'], + j=>['Real','TeX'=>'\mathbf{j}'], + ); + $v[$i] = Formula("$Px[$i]*i-$a*j"); + } +} +$pro0 = specialRadical(Compute($Px[0])*Compute($Px[1])); +$pro1 = specialRadical(Compute($Py[0])*Compute($Py[1])); +$dot = specialRadical(Compute($pro0+$pro1)); + +###################### +# Main text + +BEGIN_PGML + +a) If [`u=[$v[0]]`] and [`v=[$v[1]]`], find their dot product. + + [`u\cdot v=`][______________]{$dot} + +b) Find the measure of the angle, [`\theta`], between those two vectors. + + [`\theta=`][_________________]{$angle[2]} + +END_PGML + + +######################## + +$Px0r = Compute($Px[0]); +$Py0r = Compute($Py[0]); +$Px1r = Compute($Px[1]); +$Py1r = Compute($Py[1]); +$s1 = specialRadical(sqrt(($Px0r)**2+($Py0r)**2)*sqrt(($Px1r)**2+($Py1r)**2)); + +BEGIN_PGML_SOLUTION + +###Part a + +For [`u=`] and [`v=`], their product can be calculated by the formula + + [`` u\cdot v= ac+bd ``] + +We have: + + [``\begin{aligned} + u\cdot v &= ([$Px[0]])([$Px[1]])+([$Py[0]])([$Py[1]]) \\ + &= [$pro0]+([$pro1]) \\ + &= [$dot] + \end{aligned}``] + +###Part b + +To find the angle between [`u`] and [`v`], use the formula + + [`` \theta = \cos^{-1}\left( \frac{u\cdot v}{|u||v|}\right) ``] + +We have: + + [``\begin{aligned} + \theta &= \cos^{-1}\left( \frac{u\cdot v}{|u||v|}\right) \\ + &= \cos^{-1}\left( \frac{[$dot]}{\sqrt{([$Px[0]])^2+([$Py[0]])^2}\cdot \sqrt{([$Px[1]])^2+([$Py[1]])^2}} \right) \\ + &= \cos^{-1}\left( \frac{[$dot]}{[$s1]} \right) \\ + &= [$angle[2]] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/UnitVector10.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/UnitVector10.pg new file mode 100644 index 0000000000..93c4042b84 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/UnitVector10.pg @@ -0,0 +1,107 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextFraction.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("Fraction"); +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->variables->are( +i=>['Real','TeX'=>'\mathbf{i}'], +j=>['Real','TeX'=>'\mathbf{j}'], +); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$m = random(1,10,1); + +$Vx = $m*$triples[$in][0]*random(-1,1,2); +$Vy = $m*$triples[$in][1]*random(-1,1,2); +if (random(0,1,1)==0) {($Vx,$Vy)=($Vy,$Vx);} +$V = Formula("$Vx*i+$Vy*j")->reduce; +$mag = $m*$triples[$in][2]; + +$Ux = Fraction($Vx,$mag)->reduce; +$Uy = Fraction($Vy,$mag)->reduce; +$U = Formula("$Ux*i+$Uy*j"); + +###################### +# Main text + +BEGIN_PGML + +The unit vector in the direction of vector [`v=[$V]`] is: + +[@KeyboardInstructions( +"\n" +.'* Enter vectors in terms of [`i`] and [`j`].' +."\n" +.'* Use fractions in your answer.' +)@]** + + [_________________]{$U} + +END_PGML + + +######################## + +BEGIN_PGML_SOLUTION + +The unit vector of [`v`], call it [`u`], can be calculated by the formula + + [`` u=\frac{v}{|v|} ``] + +We have: + + [``\begin{aligned} + u &= \frac{v}{|v|} \\ + &= \frac{[$V]}{\sqrt{([$Vx])^2+([$Vy])^2}} \\ + &= \frac{[$V]}{[$mag]} \\ + &= [$U] + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics10.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics10.pg new file mode 100644 index 0000000000..f73060fbe4 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics10.pg @@ -0,0 +1,144 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +#Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "PGgraphmacros.pl", + "contextLimitedVector.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + +$refreshCachedImages = 1; + +############################# +# Setup + +Context("LimitedVector-coordinate")->variables->are(x=>'Real',y=>'Real'); +Context()->flags->set( ijk=>0 ); + +($Ax,$Ay) = (random(-5,5,1), random(-5,5,1)); +do { + ($Bx,$By) = (random(-5,5,1), random(-5,5,1)); +} until ($Bx != $Ax && $By != $Ay); +$A = Point($Ax,$Ay); +$B = Point($Bx,$By); +$OA = Vector("<$Ax,$Ay>")->reduce; +$OB = Vector("<$Bx,$By>")->reduce; +$AB = Vector("<$Bx - $Ax,$By - $Ay>")->reduce; + +################################ +# Begin construct graph & grid + +$pixels = 300; + +# +# Graph canvas +# +$gr = init_graph(-7,-7,7,7,axes=>[0,0],size=>[$pixels,$pixels]); +$gr -> lb('reset'); + +# manually draw the grid +foreach my $i (-6..6) { + $gr->moveTo($i,-7); + $gr->lineTo($i,7,'gray',1); + $gr->moveTo(-7,$i); + $gr->lineTo(7,$i,'gray',1); +} + + +# +# Graph labels and functions +# +$gr -> lb(new Label ( 6.5,0,'x','black','left','bottom')); +$gr -> lb(new Label ( 0.25,6.5,'y','black','left','bottom')); + +foreach my $i (1..6) { + $gr -> lb(new Label ( $i,-0.5, $i,'black','center','middle')); + $gr -> lb(new Label (-$i,-0.5,-$i,'black','center','middle')); + $gr -> lb(new Label (-0.5, $i, $i,'black','center','middle')); + $gr -> lb(new Label (-0.5,-$i,-$i,'black','center','middle')); +} + +# vector +$gr->moveTo($Ax,$Ay); +$gr->arrowTo($Bx,$By,'blue',3); + +# stamps and labels for vector +$gr -> stamps( closed_circle($Ax,$Ay,'black') ); +$gr -> stamps( closed_circle($Bx,$By,'black') ); +$gr -> lb(new Label ($Ax+0.5,$Ay+0.5,'A','black','center','middle')); +$gr -> lb(new Label ($Bx+0.5,$By+0.5,'B','black','center','middle')); + +$alt = "In a coordinate system, Point A is at ($Ax,$Ay), Point B is at ($Bx,$By). A vector starts at A and ends at B."; + +$fig = image(insertGraph($gr), width=>$pixels, height=>$pixels, tex_size=>700,extra_html_tags => "alt = '$alt' title = '$alt' " ); + +# End construct graph & grid +############################# + + + + + +###################### +# Main text + +BEGIN_PGML + +[@KeyboardInstructions( +"\n".'* Use the format [``] to enter vectors.' +)@]** + +By the graph, [`\overrightarrow{AB} =`][_____________]{$AB} + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +END_PGML + + +######################## + +BEGIN_PGML_SOLUTION + + [``\begin{aligned} + \overrightarrow{AB} &= \overrightarrow{OB} - \overrightarrow{OA} \\ + &= [$OB]-[$OA] \\ + &= [$AB] + \end{aligned}``] + + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics20.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics20.pg new file mode 100644 index 0000000000..0098654813 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics20.pg @@ -0,0 +1,108 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## MLT(GiveTwoPointsForVec) +## MLTleader(1) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('11') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "parserMultiAnswer.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("Vector2D"); +Context()->flags->set( ijk=>0 ); + +$A = non_zero_point2D(-9,9,1); +do { $B = non_zero_point2D(-9,9,1); } until ($A != $B); +$AB = Vector($B - $A); + +($a,$b) = $AB->value; + +$multians = MultiAnswer($A, $B)->with( + singleResult => 1, + checker => sub { + my ( $correct, $student, $self ) = @_; + my ( $Astu, $Bstu ) = @{$student}; + my ( $Acor, $Bcor ) = @{$correct}; + if ( $Astu == Point(0,0) || $Bstu == Point(0,0) ) { + return 0; + } + if ( Vector($Bstu - $Astu) == $AB ) { + return 1; + } else { + return 0; + } + } +); + + +###################### +# Main text + +BEGIN_PGML + +Find a representation of the vector [` \overrightarrow{AB} = [$AB] `] by giving appropriate values for the points [`A`] and [`B`] such that neither [`A`] nor [`B`] is the origin. + +[@KeyboardInstructions( +"\n".'* Enter points, like [`(0,1)`]' +)@]** + + [`A =`][__________________]{$multians} + + [`B =`][__________________]{$multians} + +END_PGML + + +######################## + +BEGIN_PGML_SOLUTION + +If [`A`] is at [`(0,0)`], then B would be at [`([$a],[$b])`]. + +Since we cannot use [`(0,0)`] for [`A`], we can simply add the same number to either [`x`] or [`y`] values of those two points. For example: + + [``\begin{aligned} + &A(0,0+1)\text{ and }B([$a],[$b]+1) \\ + &A(0+1,0)\text{ and }B([$a]+1,[$b]) \\ + &A(0+1,0+1)\text{ and }B([$a]+1,[$b]+1) \\ + ... + \end{aligned}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics30.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics30.pg new file mode 100644 index 0000000000..fe40e81c61 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics30.pg @@ -0,0 +1,172 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserOneOf.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +$den = list_random(3,4,6); +do {$num = random(1,2*$den-1,1);} until gcd($num,$den)==1; +$num = $num*random(-1,1,2); +$angle = specialAngle($num*pi/$den); +if ($angle>0) {$angle1 = specialAngle($num*pi/$den-2*pi);} + else {$angle1 = specialAngle($num*pi/$den+2*pi);} +$ansAngle = OneOf($angle,$angle1); + +$m = random(1,10,1); +$mag = ($den==4) ? Formula("$m*sqrt(2)") : Formula("2*$m")->reduce; +$Vx = specialRadical(Compute($mag)*cos(Compute($angle))); +$Vy = specialRadical(Compute($mag)*sin(Compute($angle))); + +if ($Vx>0) { + $Q = ($Vy>0) ? "I" : "IV"; +} else { + $Q = ($Vy>0) ? "II" : "III"; +} + +$r = 5; +($xmin,$xmax) = (-8,8); +($ymin,$ymax) = (-8,8); +$graph = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$Px = $r*cos(Compute($angle)); +$Py = $r*sin(Compute($angle)); + +$graph->moveTo(0,0); +$graph->arrowTo($Px,$Py,'red',2); +$graph->lineTo($Px,0,'red',2); +$graph->lineTo(0,0,'red',2); + +$ud = $Py>0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px, $Py,"$angle or $angle1",'red','center',$ud,large)); +$lr = $Px>0 ? 'left' : 'right'; +$graph->lb(new Label($Px, $Py/2, "$Vy",'red',$lr,'middle',large)); +$ud = $Py>0 ? 'top' : 'bottom'; +$graph->lb(new Label($Px/2, 0, "$Vx",'red','center',$ud,large)); +$lr = $Px>0 ? 'right' : 'left'; +$ud = $Py>0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px/2, $Py/2, "$mag",'red',$lr,$ud,large)); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$alt = "This is a circle with a vector starting at the origin, and ending at a point on the circle, marked as $angle or $angle1. From this point, a vertical line is drawn toward the x-axis. The intersection, the point and the origin form a right triangle. Its base is marked as $Vx, and its height is marked as $Vy. The vector's magnitude is marked as $mag."; + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +############################################## + +BEGIN_PGML + +It's given that vector [`v=<[$Vx],[$Vy]>`]. Answer the following questions. + +[@KeyboardInstructions( +"\n" +.'* Use [|pi|]* to input [`\pi`].' +."\n" +.'* Use fractions in your answers if needed.' +)@]** + +a) The vector's magnitude is [`|v|=`][__________]{$mag}. + +b) The vector's direction, in radians, is [_________________]{$ansAngle}. + +END_PGML + +############################################## + +$s1 = specialRadical(tan(Compute($angle))); +$s2 = specialAngle(arctan(Compute($s1))); +$s3 = specialAngle(Compute($s2)+pi); + +BEGIN_PGML_SOLUTION + +###Part a + +The magnitude of vector [`v=`] can be calculated by the formula + + [``|v|=\sqrt{x^2+y^2}``] + +In this problem, the magnitude of can be calculated by: + + [``\begin{aligned} + |v| &= \sqrt{([$Vx])^2+([$Vy])^2} \\ + &= [$mag] + \end{aligned}``] + +###Part b + +The direction of vector [`v=`], [`\theta`], can be calculated by the formula + + [`` \tan(\theta) = \frac{y}{x} ``] + +In this problem, we have: + + [``\begin{aligned} + \tan(\theta) &= \frac{[$Vy]}{[$Vx]} \\ + \tan(\theta) &= [$s1] \\ + \theta &= \tan^{-1}\left([$s1]\right) \\ + \theta &= [$s2] + \end{aligned}``] + +Recall that the range of [`y=\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], so there are two possible angles which make [`\tan(\theta) = [$s1]`] true: + + [`` \theta = [$s2]\text{ or }\theta = [$s2]+\pi=[$s3] ``] + +Since the given vector [`v=<[$Vx],[$Vy]>`] is in Quadrant [$Q], the vector's direction is [`[$ansAngle]`] (actually [`[$angle]+2k\pi`]). + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics40.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics40.pg new file mode 100644 index 0000000000..b114e0fab2 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics40.pg @@ -0,0 +1,181 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "PGgraphmacros.pl", + "contextFraction.pl", + "PCCmacros.pl", + "parserOneOf.pl", + "parserAssignment.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Numeric"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); + +@triples = ( + [3,4,5], + [5,12,13], + [7,24,25], + [8,15,17] +); +$in = random(0,3,1); +$m = random(1,10,1); + +$Vx = $m*$triples[$in][0]*random(-1,1,2); +$Vy = $m*$triples[$in][1]*random(-1,1,2); +$mag = $m*$triples[$in][2]; +if (random(0,1,1)==0) {($Vx,$Vy)=($Vy,$Vx);} + +if ($Vx>0) { + $Q = ($Vy>0) ? "I" : "IV"; +} else { + $Q = ($Vy>0) ? "II" : "III"; +} + +$invTan = arctan($Vy/$Vx); +if ($Vx>0) { + $angle0 = $invTan; + $angle1 = ($angle0>0) ? $angle0-2*pi : $angle0+2*pi; +} else { + $angle0 = $invTan+pi; + $angle1 = $angle0-2*pi; +} +$ansAngle = OneOf($angle0,$angle1); +$angle0Show = Round($angle0,2); +$angle1Show = Round($angle1,2); + +$r = 5; +($xmin,$xmax) = (-8,8); +($ymin,$ymax) = (-8,8); +$graph = init_graph($xmin,$ymin,$xmax,$ymax,'axes'=>[0,0]); +$graph->lb('reset'); + +$xfuncAlpha = sub { my $t = shift(); + return $r*cos($t); }; +$yfuncAlpha = sub { my $t = shift(); + return $r*sin($t); }; +$fnAlpha = new Fun( $xfuncAlpha, $yfuncAlpha, $graph ); +$fnAlpha->domain(0,2*pi); + +$Px = $r*cos($angle0); +$Py = $r*sin($angle0); + +$graph->moveTo(0,0); +$graph->arrowTo($Px,$Py,'red',2); +$graph->lineTo($Px,0,'red',2); +$graph->lineTo(0,0,'red',2); + +$ud = $Py>0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px, $Py,"$angle0Show or $angle1Show",'red','center',$ud,large)); +$lr = $Px>0 ? 'left' : 'right'; +$graph->lb(new Label($Px, $Py/2, "$Vy",'red',$lr,'middle',large)); +$ud = $Py>0 ? 'top' : 'bottom'; +$graph->lb(new Label($Px/2, 0, "$Vx",'red','center',$ud,large)); +$lr = $Px>0 ? 'right' : 'left'; +$ud = $Py>0 ? 'bottom' : 'top'; +$graph->lb(new Label($Px/2, $Py/2, "$mag",'red',$lr,$ud,large)); + +$xShift = ($Px>0) ? -0.4 : 0.4; +$yShift = ($Py>0) ? 0.4 : -0.4; +$graph->moveTo($Px, $yShift); +$graph->lineTo($Px+$xShift, $yShift, red, 2); +$graph->lineTo($Px+$xShift, 0, red, 2); + +$alt = "This is a circle with a vector starting at the origin, and ending at a point on the circle, marked as $angle0Show or $angle1Show. From this point, a vertical line is drawn toward the x-axis. The intersection, the point and the origin form a right triangle. Its base is marked as $Vx, and its height is marked as $Vy. The vector's magnitude is marked as $mag."; + +$fig = image(insertGraph($graph),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt' title = '$alt' "); + +############################################## + +BEGIN_PGML + +It's given that vector [`v=<[$Vx],[$Vy]>`]. Answer the following questions. + +[@KeyboardInstructions( +"\n" +.'* Use decimals in your answers if needed.' +)@]** + +a) The vector's magnitude is [`|v|=`][__________]{$mag}. + +b) The vector's direction, in radians, is [_________________]{$ansAngle}. + +END_PGML + +############################################## + +$s1 = Round($invTan+pi,4); +$invTanShow = Round($invTan,4); +$angle0Show = Round($angle0,4); +$angle1Show = Round($angle1,4); + +BEGIN_PGML_SOLUTION + +###Part a + +The magnitude of vector [`v=`] can be calculated by the formula + + [``|v|=\sqrt{x^2+y^2}``] + +In this problem, the magnitude of can be calculated by: + + [``\begin{aligned} + |v| &= \sqrt{([$Vx])^2+([$Vy])^2} \\ + &= [$mag] + \end{aligned}``] + +###Part b + +The direction of vector [`v=`], [`\theta`], can be calculated by the formula + + [`` \tan(\theta) = \frac{y}{x} ``] + +In this problem, we have: + + [``\begin{aligned} + \tan(\theta) &= \frac{[$Vy]}{[$Vx]} \\ + \theta &= \tan^{-1}\left(\frac{[$Vy]}{[$Vx]}\right) \\ + \theta &= [$invTan] + \end{aligned}``] + +Recall that the range of [`y=\tan^{-1}(x)`] is [`\left( -\frac{\pi}{2},\frac{\pi}{2} \right)`], so there are two possible angles which make [`\tan(\theta) = \frac{[$Vy]}{[$Vx]}`] true: + + [`` \theta = [$invTanShow]\text{ or }\theta = [$invTanShow]+\pi=[$s1] ``] + +Since the given vector [`v=<[$Vx],[$Vy]>`] is in Quadrant [$Q], the vector's direction is [`[$angle0Show]`] or [`[$angle1Show]`] (actually [`[$angle0Show]+2k\pi`]). + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics50.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics50.pg new file mode 100644 index 0000000000..46b57b40d3 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorBasics50.pg @@ -0,0 +1,133 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "PGML.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "PGchoicemacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("Vector2D"); +Context()->flags->set( ijk=>0 ); + +@Ax=(); @Ay=(); +@Bx=(); @By=(); +@V=(); + +do { + $Ax[0] = non_zero_random(-10,10,1); + $Ay[0] = non_zero_random(-10,10,1); + $Bx[0] = non_zero_random(-10,10,1); + $By[0] = non_zero_random(-10,10,1); + $V[0] = Vector($Bx[0]-$Ax[0],$By[0]-$Ay[0]); +} until $Bx[0]-$Ax[0]!=0 || $By[0]-$Ay[0]!=0; + +do { + for my $i (1..2) { + $xd = non_zero_random(-10,10,1); + do {$yd = non_zero_random(-10,10,1);} until ($xd != $yd); + $Ax[$i] = $Ax[0]+$xd; + $Bx[$i] = $Bx[0]+$xd; + $Ay[$i] = $Ay[0]+$yd; + $By[$i] = $By[0]+$yd; + $V[$i] = Vector($Bx[$i]-$Ax[$i],$By[$i]-$Ay[$i]); + } +} until ($Ax[1] != $Ax[2] || $Ay[1] != $Ay[2]); + +for my $i (3..4) { + $xd = non_zero_random(-10,10,1); + do {$yd = non_zero_random(-10,10,1);} until ($xd != $yd); + $Ax[$i] = $Ax[0]+$xd; + $Bx[$i] = $Bx[0]+$xd; + $Ay[$i] = $Ay[0]+$yd; + $By[$i] = $By[0]+$yd; +} +$Bx[3]++; +$By[4]--; +$V[3] = Vector($Bx[3]-$Ax[3],$By[3]-$Ay[3]); +$V[4] = Vector($Bx[4]-$Ax[4],$By[4]-$Ay[4]); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Check all vectors equal to \( $V[0] \). There may be more than one correct answer.", + "the vector from \( ($Ax[1],$Ay[1]) \) to \( ($Bx[1],$By[1]) \) $BR", + "the vector from \( ($Ax[2],$Ay[2]) \) to \( ($Bx[2],$By[2]) \) $BR", +); + +$mc -> extra( + "the vector from \( ($Ax[3],$Ay[3]) \) to \( ($Bx[3],$By[3]) \) $BR", + "the vector from \( ($Ax[4],$Ay[4]) \) to \( ($Bx[4],$By[4]) \) $BR", +); + +###################### +# Main text + +BEGIN_PGML + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + + +######################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +######################## + +BEGIN_PGML_SOLUTION + +The vector from [` ([$Ax[1]],[$Ay[1]]) `] to [` ([$Bx[1]],[$By[1]]) `] can be calculated by + + [`` <[$Bx[1]]-([$Ax[1]]),[$By[1]]-([$Ay[1]])>=[$V[0]] ``] + +The vector from [` ([$Ax[2]],[$Ay[2]]) `] to [` ([$Bx[2]],[$By[2]]) `] can be calculated by + + [`` <[$Bx[2]]-([$Ax[2]]),[$By[2]]-([$Ay[2]])>=[$V[0]] ``] + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents10.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents10.pg new file mode 100644 index 0000000000..3caa90c504 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents10.pg @@ -0,0 +1,122 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Fraction"); +Context()->flags->set( + requirePureFractions => 1, + showMixedNumbers => 0, + reduceConstants => 0, + reduceConstantFunctions => 0, +); + +do { + $den = list_random(3,4,6); + $num = random(1,2*$den-1,1); + ($num,$den) = Fraction($num,$den)->reduce->value; +} until $den!=2 && $den!=1; + +$frac0 = specialAngle($num*pi/$den); +$r0 = random(2,10,1); + +if ($den==3) { + $cos0 = Fraction(cos(Compute($frac0))); + $x0 = Fraction($r0*cos(Compute($frac0))); +} else { + $cos0 = specialRadical(cos(Compute($frac0))); + $x0 = specialRadical($r0*cos(Compute($frac0))); +} +if ($den==6) { + $sin0 = Fraction(sin(Compute($frac0))); + $y0 = Fraction($r0*sin(Compute($frac0))); +} else { + $sin0 = specialRadical(sin(Compute($frac0))); + $y0 = specialRadical($r0*sin(Compute($frac0))); +} + +Context()->noreduce("(-x)-y","(-x)+y"); +Context()->variables->are( +i=>['Real','TeX'=>'\mathbf{i}'], +j=>['Real','TeX'=>'\mathbf{j}'], +); +$ans = Formula("$x0*i+$y0*j"); + +############################################## + +BEGIN_PGML + +If vector [`v`] has a length of [`[$r0]`] and is in the direction of [`[$frac0]`], write the vector in terms of [`i`] and [`j`]. + +[@KeyboardInstructions( +"\n" +.'* Use fractions in your answer.' +."\n" +.'* Use [|sqrt()|]* for the square root symbol. For example: [`\sqrt{2}=`][|sqrt(2)|]*.' +)@]** + + [`v=`][_________________________]{$ans} + +END_PGML + +############################################## + + +BEGIN_PGML_SOLUTION + +Given a position vector [`v=`] and direction angle [`\theta`], we have: + + [`` x=|v|\cos(\theta)\text{ and }y=|v|\sin(\theta) ``] + +We have: + + [``\begin{aligned} + x &= |v|\cos(\theta) \\ + &= [$r0]\cos\left([$frac0]\right) \\ + &= [$r0]\left([$cos0]\right) \\ + &= [$x0] + \end{aligned}``] + +and + + [``\begin{aligned} + y &= |v|\sin(\theta) \\ + &= [$r0]\sin\left([$frac0]\right) \\ + &= [$r0]\left([$sin0]\right) \\ + &= [$y0] + \end{aligned}``] + +The solution is [`v=[$ans]`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents20.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents20.pg new file mode 100644 index 0000000000..bc25c181d7 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents20.pg @@ -0,0 +1,245 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Vector2D"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); +Context()->noreduce("(-x)-y","(-x)+y"); + +@x = (); @y = (); @xShow = (); @yShow = (); @bearing = (); @angle = (); +@mag = (); @dir = (); @vec = (); +$mag[0] = random(800,1200,10); +$bearing[0] = random(20,70,5); +$dir[0] = list_random('E','W','SE','SW'); +if ($dir[0] eq 'E') + {$angle[0] = 90-$bearing[0];} + elsif ($dir[0] eq 'W') + {$angle[0] = 90+$bearing[0];} + elsif ($dir[0] eq 'SE') { + $bearing[0] += 90; + $angle[0] = 450-$bearing[0]; + } else { + $bearing[0] += 90; + $angle[0] = 90+$bearing[0]; + } + +$mag[1] = random(10,30,1); +$dir[1] = list_random('N','S','W','E'); +if ($dir[1] eq 'E') { + $angle[1] = 0; + $dirWord = 'east'; +} elsif ($dir[1] eq 'N') { + $angle[1] = 90; + $dirWord = 'north'; +} elsif ($dir[1] eq 'W') { + $angle[1] = 180; + $dirWord = 'west'; +} else { + $angle[1] = 270; + $dirWord = 'south'; +} + +for my $i (0..1) { + $x[$i] = $mag[$i]*cos($angle[$i]*pi/180); + $y[$i] = $mag[$i]*sin($angle[$i]*pi/180); + $xShow[$i] = Round($x[$i],4); + $yShow[$i] = Round($y[$i],4); +} + +$x[2] = $x[0]+$x[1]; +$y[2] = $y[0]+$y[1]; +$xShow[2] = Round($x[2],4); +$yShow[2] = Round($y[2],4); + +@v = (); +for my $i (0..2) { + $v[$i] = Compute("$xShow[$i]*i + $yShow[$i]j"); +} + +$mag[2] = sqrt(($x[2])**2+($y[2])**2); +$angle[2] = arctan($y[2]/$x[2])*180/pi; +$angle2Show = Round($angle[2],4); +if ( ($x[2]>0) && ($y[2]>0) ) { + $dir[2] = 'E'; + $bearing[2] = 90-$angle[2]; + $Q = 'I'; +} elsif ( ($x[2]<0) && ($y[2]>0) ) { + $dir[2] = 'W'; + $bearing[2] = 90+$angle[2]; + $Q = 'II'; +} elsif ( ($x[2]<0) && ($y[2]<0) ) { + $dir[2] = 'SW'; + $bearing[2] = 90+$angle[2]; + $Q = 'III'; +} else { + $dir[2] = 'SE'; + $bearing[2] = 90-$angle[2]; + $Q = 'IV'; +} +$popup = PopUp(["?", "W", "SW", "SE", "E"], $dir[2]); + +@graph = (); @fig = (); @alt = (); +$bound = 6; + +@xGraph = (); @yGraph = (); +for my $i (0..1) { + $xGraph[$i] = ($bound-1)*cos($angle[$i]*pi/180); + $yGraph[$i] = ($bound-1)*sin($angle[$i]*pi/180); +} + +for my $i (0..0) { + $graph[$i] = init_graph(-$bound,-$bound,$bound,$bound); + $graph[$i]->lb('reset'); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,$bound-1,black,2); + $graph[$i]->lb(new Label(0,$bound-1,"N",'black','center','bottom',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,-$bound+1,black,2); + $graph[$i]->lb(new Label(0,-$bound+1,"S",'black','center','top',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($bound-1,0,black,2); + $graph[$i]->lb(new Label($bound-1,0,"E",'black','left','middle',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(-$bound+1,0,black,2); + $graph[$i]->lb(new Label(-$bound+1,0,"W",'black','right','middle',large)); + + $graph[$i]->stamps(closed_circle( 0,0, red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],$yGraph[$i],red,2); + $ud = ($y[$i]>0) ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($xGraph[$i],$yGraph[$i],$mag[$i],'red','center',$ud,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],0,red,2); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,$yGraph[$i],red,2); + + $graph[$i]->moveTo(0,$yGraph[$i]); + $graph[$i]->lineTo($xGraph[$i],$yGraph[$i],red,2,dashed); + $graph[$i]->lineTo($xGraph[$i],0,red,2,dashed); + + $alt[$i] = "There are 4 arrows pointing to 4 directions N, S, E and W. A vector starts at (0,0), pointing in the direction of $dir[0] bearing of $bearing[0] degrees. This vector is separated into two components along the x-axis and y-axis."; + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); +} + + + + + + +############################################## + +BEGIN_PGML + +An airplane is flying at an airspeed of [`[$mag[0]]`] miles per hour headed on a [$dir[0]] bearing of [`[$bearing[0]]^{\circ}`]. A wind blowing due [$dirWord] is blowing at [`[$mag[1]]`] miles per hour. What are the ground speed and actual bearing of the plane? + +[@KeyboardInstructions( +"\n" +.'* Use degrees in your answer.' +)@]** + +The plane has a [____]{$popup} bearing of [_________]{$bearing[2]}. The ground speed is [__________]{$mag[2]} miles per hour. + +END_PGML + +############################################## + +if ($Q eq 'I') { + $s1 = "\text{simply } $angle2Show^{\circ}"; +} elsif ($Q eq 'IV') { + my $an = 360+$angle2Show; + $s1 = "$angle2Show^{\circ}+360^{\circ}=$an^{\circ}"; +} else { + my $an = 180+$angle2Show; + $s1 = "$angle2Show^{\circ}+180^{\circ}=$an^{\circ}"; +} + + +BEGIN_PGML_SOLUTION + +The following is a graph for the plane's initial speed vector (without considering the wind's effect). + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +It has a [$dir[0]] bearing of [`[$bearing[0]]^{\circ}`], implying a direction of [`[$angle[0]]^{\circ}`] degrees if due east is the initial side. + +It's x-component can be calculated by + + [`` [$mag[0]]\cdot \cos([$angle[0]]^{\circ}) = [$xShow[0]] \frac{\text{mi}}{\text{hr}} ``] + +and its y-component can be calculated by + + [`` [$mag[0]]\cdot \sin([$angle[0]]^{\circ}) = [$yShow[0]] \frac{\text{mi}}{\text{hr}} ``] + +So the plane's speed vector can be written as + + [`` v_1=[$v[0]] ``] + +A wind blowing due [$dirWord] is blowing at [`[$mag[1]]`] miles per hour. Its speed vector can be written as + + [`` v_2=[$v[1]] ``] + +Add up those two vectors, we have: + + [``\begin{aligned} + v_3 &= v_1+v_2 \\ + &= [$v[0]]+([$v[1]]) \\ + &= [$v[2]] + \end{aligned}``] + +This is the new speed vector considering the wind's effect. Its magnitude, or ground speed, is: + + [`` |v_3| = \sqrt{([$xShow[2]])^2+([$yShow[2]])^2} = [$mag[2]] \frac{\text{mi}}{\text{hr}}``] + +Its direction can be calculated by: + + [`` \tan^{-1}\left( \frac{[$yShow[2]]}{[$xShow[2]]} \right) = [$angle2Show]^{\circ} + 180k \text{, where } k\in \mathbb{Z}``] + +Since the speed vector is in Quadrant [$Q], the angle of direction, with due east as the initial side, is [`[$s1]`]. + +Translating it into bearing format, the plane has a [$dir[2]] bearing of [`[$bearing[2]]^{\circ}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents30.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents30.pg new file mode 100644 index 0000000000..d75081405b --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents30.pg @@ -0,0 +1,238 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Vector2D"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); +Context()->noreduce("(-x)-y","(-x)+y"); + +@x = (); @y = (); @xShow = (); @yShow = (); @bearing = (); @angle = (); +@mag = (); @dir = (); @vec = (); + +$mag[0] = random(800,1200,10); +$mag[1] = random(10,30,1); +$bearing[0] = random(20,70,5); +$bearing[1] = random(10,80,5); + +for my $i (0..1) { + $dir[$i] = list_random('E','W','SE','SW'); + if ($dir[$i] eq 'E') + {$angle[$i] = 90-$bearing[$i];} + elsif ($dir[$i] eq 'W') + {$angle[$i] = 90+$bearing[$i];} + elsif ($dir[$i] eq 'SE') { + $bearing[$i] += 90; + $angle[$i] = 450-$bearing[$i]; + } else { + $bearing[$i] += 90; + $angle[$i] = 90+$bearing[$i]; + } +} +for my $i (0..1) { + $x[$i] = $mag[$i]*cos($angle[$i]*pi/180); + $y[$i] = $mag[$i]*sin($angle[$i]*pi/180); + $xShow[$i] = Round($x[$i],4); + $yShow[$i] = Round($y[$i],4); +} + +$x[2] = $x[0]+$x[1]; +$y[2] = $y[0]+$y[1]; +$xShow[2] = Round($x[2],4); +$yShow[2] = Round($y[2],4); + +@v = (); +for my $i (0..2) { + $v[$i] = Compute("$xShow[$i]*i + $yShow[$i]j"); +} + +$mag[2] = sqrt(($x[2])**2+($y[2])**2); +$angle[2] = arctan($y[2]/$x[2])*180/pi; +$angle2Show = Round($angle[2],4); +if ( ($x[2]>0) && ($y[2]>0) ) { + $dir[2] = 'E'; + $bearing[2] = 90-$angle[2]; + $Q = 'I'; +} elsif ( ($x[2]<0) && ($y[2]>0) ) { + $dir[2] = 'W'; + $bearing[2] = 90+$angle[2]; + $Q = 'II'; +} elsif ( ($x[2]<0) && ($y[2]<0) ) { + $dir[2] = 'SW'; + $bearing[2] = 90+$angle[2]; + $Q = 'III'; +} else { + $dir[2] = 'SE'; + $bearing[2] = 90-$angle[2]; + $Q = 'IV'; +} +$popup = PopUp(["?", "W", "SW", "SE", "E"], $dir[2]); + +@graph = (); @fig = (); @alt = (); +$bound = 6; + +@xGraph = (); @yGraph = (); +for my $i (0..1) { + $xGraph[$i] = ($bound-1)*cos($angle[$i]*pi/180); + $yGraph[$i] = ($bound-1)*sin($angle[$i]*pi/180); +} + +for my $i (0..0) { + $graph[$i] = init_graph(-$bound,-$bound,$bound,$bound); + $graph[$i]->lb('reset'); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,$bound-1,black,2); + $graph[$i]->lb(new Label(0,$bound-1,"N",'black','center','bottom',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,-$bound+1,black,2); + $graph[$i]->lb(new Label(0,-$bound+1,"S",'black','center','top',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($bound-1,0,black,2); + $graph[$i]->lb(new Label($bound-1,0,"E",'black','left','middle',large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(-$bound+1,0,black,2); + $graph[$i]->lb(new Label(-$bound+1,0,"W",'black','right','middle',large)); + + $graph[$i]->stamps(closed_circle( 0,0, red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],$yGraph[$i],red,2); + $ud = ($y[$i]>0) ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($xGraph[$i],$yGraph[$i],$mag[$i],'red','center',$ud,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],0,red,2); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,$yGraph[$i],red,2); + + $graph[$i]->moveTo(0,$yGraph[$i]); + $graph[$i]->lineTo($xGraph[$i],$yGraph[$i],red,2,dashed); + $graph[$i]->lineTo($xGraph[$i],0,red,2,dashed); + + $alt[$i] = "There are 4 arrows pointing to 4 directions N, S, E and W. A vector starts at (0,0), pointing in the direction of $dir[0] bearing of $bearing[0] degrees. This vector is separated into two components along the x-axis and y-axis."; + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); +} + + + + + + +############################################## + +BEGIN_PGML + +An airplane is flying at an airspeed of [`[$mag[0]]`] miles per hour headed on a [$dir[0]] bearing of [`[$bearing[0]]^{\circ}`]. A wind is blowing at [`[$mag[1]]`] miles per hour on a [$dir[1]] bearing of [`[$bearing[1]]^{\circ}`]. What are the ground speed and actual bearing of the plane? + +[@KeyboardInstructions( +"\n" +.'* Use degrees in your answer.' +)@]** + +The plane has a [____]{$popup} bearing of [_________]{$bearing[2]}. The ground speed is [__________]{$mag[2]} miles per hour. + +END_PGML + +############################################## + +if ($Q eq 'I') { + $s1 = "\text{simply } $angle2Show^{\circ}"; +} elsif ($Q eq 'IV') { + my $an = 360+$angle2Show; + $s1 = "$angle2Show^{\circ}+360^{\circ}=$an^{\circ}"; +} else { + my $an = 180+$angle2Show; + $s1 = "$angle2Show^{\circ}+180^{\circ}=$an^{\circ}"; +} + + +BEGIN_PGML_SOLUTION + +The following is a graph for the plane's initial speed vector (without considering the wind's effect). + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +It has a [$dir[0]] bearing of [`[$bearing[0]]^{\circ}`], implying a direction of [`[$angle[0]]^{\circ}`] degrees if due east is the initial side. + +It's x-component can be calculated by + + [`` [$mag[0]]\cdot \cos([$angle[0]]^{\circ}) = [$xShow[0]] \frac{\text{mi}}{\text{hr}} ``] + +and its y-component can be calculated by + + [`` [$mag[0]]\cdot \sin([$angle[0]]^{\circ}) = [$yShow[0]] \frac{\text{mi}}{\text{hr}} ``] + +So the plane's speed vector can be written as + + [`` v_1=[$v[0]] ``] + +A wind is blowing at [`[$mag[1]]`] miles per hour on a [$dir[1]] bearing of [`[$bearing[1]]^{\circ}`]. With similar calculations, we have: + + [``\begin{aligned} + [$mag[1]]\cdot \cos([$angle[1]]^{\circ}) &= [$xShow[1]] \frac{\text{mi}}{\text{hr}} \\ + [$mag[1]]\cdot \sin([$angle[1]]^{\circ}) &= [$yShow[1]] \frac{\text{mi}}{\text{hr}} \\ + v_2 &= [$v[1]] + \end{aligned}``] + +Add up those two vectors, we have: + + [``\begin{aligned} + v_3 &= v_1+v_2 \\ + &= [$v[0]]+([$v[1]]) \\ + &= [$v[2]] + \end{aligned}``] + +This is the new speed vector considering the wind's effect. Its magnitude, or ground speed, is: + + [`` |v_3| = \sqrt{([$xShow[2]])^2+([$yShow[2]])^2} = [$mag[2]] \frac{\text{mi}}{\text{hr}}``] + +Its direction can be calculated by: + + [`` \tan^{-1}\left( \frac{[$yShow[2]]}{[$xShow[2]]} \right) = [$angle2Show]^{\circ} + 180k \text{, where } k\in \mathbb{Z}``] + +Since the speed vector is in Quadrant [$Q], the angle of direction, with due east as the initial side, is [`[$s1]`]. + +Translating it into bearing format, the plane has a [$dir[2]] bearing of [`[$bearing[2]]^{\circ}`]. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents40.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents40.pg new file mode 100644 index 0000000000..aa2d538142 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorComponents40.pg @@ -0,0 +1,205 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "contextFraction.pl", + "PGML.pl", + "parserOneOf.pl", + "PCCmacros.pl", + "PGgraphmacros.pl", + "parserPopUp.pl", + "PGcourse.pl", +); +$refreshCachedImages=1; +TEXT(beginproblem()); + +Context("Vector2D"); +Context()->flags->set( + tolerance => 0.005, + tolType => "absolute", +); +Context()->noreduce("(-x)-y","(-x)+y"); + +@x = (); @y = (); @xShow = (); @yShow = (); +@angle = (); @mag = (); @vec = (); + +do { + for my $i (0..2) { + $mag[$i] = random(10,50,5); + $angle[$i] = random(20,70,5)+90*random(0,3,1); + $x[$i] = $mag[$i]*cos($angle[$i]*pi/180); + $y[$i] = $mag[$i]*sin($angle[$i]*pi/180); + $xShow[$i] = Round($x[$i],4); + $yShow[$i] = Round($y[$i],4); + } +} until +abs($mag[0]-$mag[1])>10 && +abs($mag[1]-$mag[2])>10 && +abs($angle[0]-$angle[1])>90 && +abs($angle[1]-$angle[2])>90; + +$x[3] = $x[0]+$x[1]+$x[2]; +$y[3] = $y[0]+$y[1]+$y[2]; +$xShow[3] = Round($x[3],4); +$yShow[3] = Round($y[3],4); + +@v = (); +for my $i (0..3) { + $v[$i] = Compute("$xShow[$i]*i + $yShow[$i]j"); +} + +$mag[3] = sqrt(($x[3])**2+($y[3])**2); +$angle[3] = arctan($y[3]/$x[3])*180/pi; +$angle3Show = Round($angle[3],4); +if ( ($x[3]>0) && ($y[3]>0) ) { + $Q = 'I'; +} elsif ( ($x[3]<0) && ($y[3]>0) ) { + $Q = 'II'; +} elsif ( ($x[3]<0) && ($y[3]<0) ) { + $Q = 'III'; +} else { + $Q = 'IV'; +} + +if ($Q eq 'I') { + $angleAns = $angle[3]; + $angleAnsShow = Round($angleAns,4); + $s1 = "\text{simply } $angleAnsShow^{\circ}"; +} elsif ($Q eq 'IV') { + $angleAns = $angle[3] + 360; + $angleAnsShow = Round($angleAns,4); + $s1 = "$angle3Show^{\circ}+360^{\circ}=$angleAnsShow^{\circ}"; +} else { + $angleAns = $angle[3] + 180; + $angleAnsShow = Round($angleAns,4); + $s1 = "$angle3Show^{\circ}+180^{\circ}=$angleAnsShow^{\circ}"; +} + + +@graph = (); @fig = (); @alt = (); +$bound = 6; + +@xGraph = (); @yGraph = (); +for my $i (0..0) { + $xGraph[$i] = ($bound-1)*cos($angle[$i]*pi/180); + $yGraph[$i] = ($bound-1)*sin($angle[$i]*pi/180); +} + +for my $i (0..0) { + $graph[$i] = init_graph(-$bound,-$bound,$bound,$bound,axes=>[0,0]); + $graph[$i]->lb('reset'); + + $graph[$i]->stamps(closed_circle( 0,0, red )); + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],$yGraph[$i],red,2); + $ud = ($y[$i]>0) ? 'bottom' : 'top'; + $graph[$i]->lb(new Label($xGraph[$i],$yGraph[$i],$mag[$i],'red','center',$ud,large)); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo($xGraph[$i],0,red,2); + + $graph[$i]->moveTo(0,0); + $graph[$i]->arrowTo(0,$yGraph[$i],red,2); + + $graph[$i]->moveTo(0,$yGraph[$i]); + $graph[$i]->lineTo($xGraph[$i],$yGraph[$i],red,2,dashed); + $graph[$i]->lineTo($xGraph[$i],0,red,2,dashed); + + $alt[$i] = "A vector starts at (0,0), pointing at $angle[0] degrees. This vector is separated into two components along the x-axis and y-axis."; + $fig[$i] = image(insertGraph($graph[$i]),'width'=>400,'height'=>400,'tex_size'=>700, extra_html_tags => "alt = '$alt[0]' title = '$alt[0]' "); +} + + + + + + +############################################## + +BEGIN_PGML + +Suppose a body has a force of [`[$mag[0]] \text{ lb}`] acting on it directed [`[$angle[0]]^{\circ}`] from due east, a second force of [`[$mag[1]] \text{ lb}`] acting on it [`[$angle[1]]^{\circ}`] from due east, and a third force of [`[$mag[2]] \text{ lb}`] acting on it [`[$angle[2]]^{\circ}`] from due east. What single force is the resultant force acting on the body? In which direction? (Enter a positive degree from due east.) + +The resulting force is [__________]{$mag[3]} pounds directed [__________]{$angleAns} degrees from due east. + +END_PGML + +############################################## + +BEGIN_PGML_SOLUTION + +A force of [`[$mag[0]] \text{ lb}`] acts on a body directed [`[$angle[0]]^{\circ}`] from due east. The following is a graph for the vector representing this force. + +>>[@ $fig[0] @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +It's x-component can be calculated by + + [`` [$mag[0]]\cdot \cos([$angle[0]]^{\circ}) = [$xShow[0]] \text{ lb} ``] + +and its y-component can be calculated by + + [`` [$mag[0]]\cdot \sin([$angle[0]]^{\circ}) = [$yShow[0]] \text{ lb} ``] + +So this vector can be written as: + + [`` v_1=[$v[0]] ``] + +The second force, [`[$mag[1]] \text{ lb}`] directed [`[$angle[1]]^{\circ}`] from due east, can be written as: + + [``\begin{aligned} + [$mag[1]]\cdot \cos([$angle[1]]^{\circ}) &= [$xShow[1]] \text{ lb} \\ + [$mag[1]]\cdot \sin([$angle[1]]^{\circ}) &= [$yShow[1]] \text{ lb} \\ + v_2 &= [$v[1]] + \end{aligned}``] + +The third force, [`[$mag[2]] \text{ lb}`] directed [`[$angle[2]]^{\circ}`] from due east, can be written as: + + [``\begin{aligned} + [$mag[2]]\cdot \cos([$angle[2]]^{\circ}) &= [$xShow[2]] \text{ lb} \\ + [$mag[2]]\cdot \sin([$angle[2]]^{\circ}) &= [$yShow[2]] \text{ lb} \\ + v_3 &= [$v[2]] + \end{aligned}``] + +Add up those three vectors, we have: + + [``\begin{aligned} + v_4 &= v_1+v_2+v_3 \\ + &= [$v[0]]+([$v[1]])+([$v[2]]) \\ + &= [$v[3]] + \end{aligned}``] + +This is the combined force, and we can see it is in Quadrant [$Q] by the values of [`i`] and [`j`]. Its magnitude is: + + [`` |v_4| = \sqrt{([$xShow[3]])^2+([$yShow[3]])^2} = [$mag[3]] \text{ lb}``] + +Its direction can be calculated by: + + [`` \tan^{-1}\left( \frac{[$yShow[3]]}{[$xShow[3]]} \right) = [$angle3Show]^{\circ} + 180^{\circ}\cdot k \text{, where } k\in \mathbb{Z}``] + +Since the combined forcer is in Quadrant [$Q], the angle of direction is [`[$s1]`] from due east. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations10.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations10.pg new file mode 100644 index 0000000000..8b01400e7f --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations10.pg @@ -0,0 +1,149 @@ +# DESCRIPTION +# WeBWorK problem written by Carl Yao +# Portland Community College +# +# ENDDESCRIPTION + +## DBsubject('') +## DBchapter('') +## DBsection('') +## KEYWORDS('') +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## Author('Carl Yao','Alex Jordan') +## Institution('PCC') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "parserPopUp.pl", + "PGgraphmacros.pl", + "contextLimitedVector.pl", + "PGML.pl", + "PGchoicemacros.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + +$refreshCachedImages = 1; + +############################# +# Setup + +Context("Numeric"); + +@p = ([1,1],[2,3],[3,1]); +@l = ('A','B','C'); +@s = NchooseK(3,3); +%v = ( + "01" => "\overrightarrow{AB}", + "02" => "\overrightarrow{AC}", + "10" => "\overrightarrow{BA}", + "12" => "\overrightarrow{BC}", + "20" => "\overrightarrow{CA}", + "21" => "\overrightarrow{CB}", +); + +@k = ( + $v{$s[0].$s[1]}, + $v{$s[1].$s[2]}, + $v{$s[0].$s[2]}, + $v{$s[1].$s[0]}, + $v{$s[2].$s[1]}, + $v{$s[2].$s[0]}, +); + +@k1 = ( + ALPHABET($s[0]).ALPHABET($s[1]), + ALPHABET($s[1]).ALPHABET($s[2]), + ALPHABET($s[0]).ALPHABET($s[2]), +); + +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ( +"Check all correct statements. There may be more than one correct answer.", + "\( $k[0]+$k[1]=$k[2] \) $BR", + "\( $k[2]-$k[0]=$k[1] \) $BR", +); + +$mc -> extra( + "\( $k[2]+$k[1]=$k[0] \) $BR", + "\( $k[1]-$k[0]=$k[2] \) $BR", + "\( $k[2]+$k[0]=$k[1] \) $BR", + "\( $k[0]-$k[1]=$k[2] \) $BR", +); + +################################ +# Begin construct graph & grid + +$pixels = 300; +$gr = init_graph(0,0,4,4,size=>[$pixels,$pixels]); +$gr -> lb('reset'); + +$gr -> stamps( closed_circle(1,1,'black') ); +$gr -> stamps( closed_circle(2,3,'black') ); +$gr -> stamps( closed_circle(3,1,'black') ); +$gr -> lb(new Label ( 1,1,'A','black','right','top',large)); +$gr -> lb(new Label ( 2,3,'B','black','center','bottom',large)); +$gr -> lb(new Label ( 3,1,'C','black','left','top',large)); +$gr->moveTo($p[$s[0]][0],$p[$s[0]][1]); +$gr->arrowTo($p[$s[1]][0],$p[$s[1]][1],'red',2); +$gr->arrowTo($p[$s[2]][0],$p[$s[2]][1],'red',2); +$gr->moveTo($p[$s[0]][0],$p[$s[0]][1]); +$gr->arrowTo($p[$s[2]][0],$p[$s[2]][1],'red',2); + +$alt = "Vectors $k1[0], $k1[1] and $k1[2] are drawn."; + +$fig = image(insertGraph($gr), width=>$pixels, height=>$pixels, tex_size=>700,extra_html_tags => "alt = '$alt' title = '$alt' " ); + +###################### + + +BEGIN_PGML + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +[@ $mc -> print_q() @]* + +[@ $mc -> print_a() @]* + +END_PGML + +############################################## + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +######################## + +BEGIN_PGML_SOLUTION + +In the graph, [`[$k[0]]+[$k[1]]=[$k[2]]`] because the tail of [`[$k[0]]`] connects to the head of [`[$k[1]]`]. This is called the Head to Tail Rule in vector addition. + +From [`[$k[0]]+[$k[1]]=[$k[2]]`], we can easily derive [`[$k[1]]=[$k[2]]-[$k[0]]`]. + +The correct answers are [@ $mc->correct_ans() @]*. + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations20.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations20.pg new file mode 100644 index 0000000000..ae93175b3a --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations20.pg @@ -0,0 +1,135 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(December 2015) +## Institution(Hope College) +## Author(Paul Pearson) +## Level(2) +## MO(1) +## KEYWORDS('vectors','vector operations') + + +############################## +# Initialization + +DOCUMENT(); + +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "contextLimitedVector.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "scaffold.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +TEXT(beginproblem()); +$refreshCachedImages = 1; +$showPartialCorrectAnswers = 1; + +############################# +# Setup + +Context("Numeric")->variables->are( +a=>['Real','TeX'=>'\mathbf{a}'], +b=>['Real','TeX'=>'\mathbf{b}'], +c=>['Real','TeX'=>'\mathbf{c}'], +); + +@l = ('a','b','c'); +@s = NchooseK(3,3); + +$ans0 = Compute("($l[$s[2]]-$l[$s[1]])/2"); +$ans1 = Compute("$l[$s[2]]-2*$l[$s[0]]"); +$ans2 = Compute("2*$l[$s[0]]+$l[$s[1]]"); + + +################################ +# Begin construct graph & grid + +$pixels = 300; +($xmin,$xmax) = (-7,7); +($ymin,$ymax) = (-7,7); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, size=>[$pixels,$pixels]); +$gr -> lb('reset'); + +# construct points (F, G, and H) +($fx,$fy) = (random(2,6,1), random(2,6,1)); +do { ($gx,$gy) = (random(-6,-2,1), random(1,6,1)); } until ($gy != $fy); +do { ($hx,$hy) = (0,random(-6,-3,1)); } until ($hx != $fx); + +# construct vectors A = FG, B = FH, C = GH +($ax,$ay) = ($gx - $fx, $gy - $fy); +($bx,$by) = ($hx - $fx, $hy - $fy); +($cx,$cy) = ($hx - $gx, $hy - $gy); + +# $gr: draw vectors A, B, C +$gr->moveTo($gx, $gy); $gr->arrowTo($gx - $ax/2, $gy - $ay/2,'black',2); +$gr->moveTo($gx - $ax/2, $gy - $ay/2); $gr->arrowTo($gx - $ax, $gy - $ay,'orange',2); +$gr->moveTo($fx, $fy); $gr->arrowTo($hx, $hy,'blue',2); +$gr->moveTo($gx, $gy); $gr->arrowTo($hx, $hy,'red',2); + +# $gr: add labels +$gr->lb(new Label ( $gx - $ax/4, $gy - $ay/4 + 0.5,$l[$s[0]],'black','middle','bottom')); +$gr->lb(new Label ( $gx - 3*$ax/4, $gy - 3*$ay/4 + 0.5,$l[$s[0]],'orange','middle','bottom')); +$gr->lb(new Label ( $fx + $bx/2 + 0.5, $fy + $by/2, $l[$s[1]], 'blue','left','top')); +$gr->lb(new Label ( $gx + $cx/2 - 0.5, $gy + $cy/2, $l[$s[2]], 'red','right','middle')); + + + +$alt = "Two vectors $l[$s[0]] are connected head to tail and point to the same direction. Vector $l[$s[1]] starts from the head of the second $l[$s[0]] and point to a different direction. $l[$s[2]] starts from the tail of the first $l[$s[0]] and ends at the head of $l[$s[1]]."; + +$fig = image(insertGraph($gr), width=>$pixels, height=>$pixels, tex_size=>700,extra_html_tags => "alt = '$alt' title = '$alt' " ); + +###################### + + +BEGIN_PGML + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Answer the following questions with vectors [`a, b`] and [`c`] shown in the graph. + ++ [`[$l[$s[0]]]=`][___________]{$ans0} ++ [`[$l[$s[1]]]=`][___________]{$ans1} ++ [`[$l[$s[2]]]=`][___________]{$ans2} + +END_PGML + +############################################## + + + +######################## + +BEGIN_PGML_SOLUTION + +By Head to Tail Rule of vector addition, we have: + + [``[$l[$s[2]]]=2[$l[$s[0]]]+[$l[$s[1]]]``] + +By this equation, we can derive: + + [``[$l[$s[1]]]=[$l[$s[2]]]-2[$l[$s[0]]]``] + +and + + [``[$l[$s[0]]]=\frac{[$l[$s[2]]]-[$l[$s[1]]]}{2}``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations30.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations30.pg new file mode 100644 index 0000000000..d4b426566e --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations30.pg @@ -0,0 +1,138 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(December 2015) +## Institution(Hope College) +## Author(Paul Pearson) +## Level(2) +## MO(1) +## KEYWORDS('vectors','vector operations') + + +############################## +# Initialization + +DOCUMENT(); + +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "contextLimitedVector.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PGchoicemacros.pl", + "parserPopUp.pl", + "scaffold.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +TEXT(beginproblem()); +$refreshCachedImages = 1; +$showPartialCorrectAnswers = 1; + +############################# +# Setup + +Context("Numeric")->variables->are( +a=>['Real','TeX'=>'\mathbf{a}'], +b=>['Real','TeX'=>'\mathbf{b}'], +c=>['Real','TeX'=>'\mathbf{c}'], +d=>['Real','TeX'=>'\mathbf{d}'], +); + +@l = ('a','b','c','d'); +@s = NchooseK(4,4); + +$ans0 = Compute("($l[$s[2]] - $l[$s[1]] - $l[$s[3]])/2"); +$ans1 = Compute("$l[$s[2]]-2*$l[$s[0]]- $l[$s[3]]"); +$ans2 = Compute("2*$l[$s[0]]+$l[$s[1]]+$l[$s[3]]"); +$ans3 = Compute("$l[$s[2]]-2*$l[$s[0]]-$l[$s[1]]"); + +################################ +# Begin construct graph & grid + +$pixels = 300; +($xmin,$xmax) = (-7,7); +($ymin,$ymax) = (-7,7); + +$gr = init_graph($xmin,$ymin,$xmax,$ymax, size=>[$pixels,$pixels]); +$gr -> lb('reset'); + +# construct points (F, G, and H) +($fx,$fy) = (random(2,6,1), random(2,6,1)); +do { ($gx,$gy) = (random(-6,-2,1), random(1,6,1)); } until ($gy != $fy); +do { ($hx,$hy) = (0,random(-6,-3,1)); } until ($hx != $fx); + +# construct vectors A = FG, B = FH, C = GH +($ax,$ay) = ($gx - $fx, $gy - $fy); +($bx,$by) = ($hx - $fx, $hy - $fy); +($cx,$cy) = ($hx - $gx, $hy - $gy); + +# $gr: draw vectors A, B, C +$gr->moveTo($gx, $gy); $gr->arrowTo($gx - $ax/2, $gy - $ay/2,'black',2); # a +$gr->moveTo($gx - $ax/2, $gy - $ay/2); $gr->arrowTo($gx - $ax, $gy - $ay,'orange',2); # a +$gr->moveTo($fx, $fy); $gr->arrowTo($hx, $hy,'blue',2); # b +$gr->moveTo($gx, $gy); $gr->arrowTo(0,0,'red',2); # c +$gr->moveTo($hx,$hy); $gr->arrowTo(0,0,'green',2); # d + +# $gr: add labels +$gr->lb(new Label ( $gx - $ax/4, $gy - $ay/4 + 0.5,$l[$s[0]],'black','middle','bottom')); +$gr->lb(new Label ( $gx - 3*$ax/4, $gy - 3*$ay/4 + 0.5,$l[$s[0]],'orange','middle','bottom')); +$gr->lb(new Label ( $fx + $bx/2 + 0.5, $fy + $by/2, $l[$s[1]], 'blue','left','top')); +$gr->lb(new Label ( $gx/2 - 0.5, $gy/2, $l[$s[2]], 'red','right','middle')); +$gr->lb(new Label ( - 0.5, $hy/2, $l[$s[3]], 'green','right','middle')); + + +$alt = "Two vectors $l[$s[0]] are connected head to tail and point to the same direction. Vector $l[$s[1]] starts from the head of the second $l[$s[0]] and point to a different direction. $l[$s[2]] starts from the tail of the first $l[$s[0]] and ends at the head of $l[$s[1]]."; + +$fig = image(insertGraph($gr), width=>$pixels, height=>$pixels, tex_size=>700,extra_html_tags => "alt = '$alt' title = '$alt' " ); + +###################### + + +BEGIN_PGML + +>>[@ $fig @]*<< + +>> (To enlarge, click on graph, then press Ctrl+ or Command+) << + +Answer the following questions with vectors [`a, b, c`] and [`d`] shown in the graph. + ++ [`[$l[$s[0]]]=`][___________]{$ans0} ++ [`[$l[$s[1]]]=`][___________]{$ans1} ++ [`[$l[$s[2]]]=`][___________]{$ans2} ++ [`[$l[$s[3]]]=`][___________]{$ans3} + +END_PGML + +############################################## + + + +######################## + +BEGIN_PGML_SOLUTION + +By Head to Tail Rule of vector addition, starting at the tail of the first vector [`c`], ending at the head of vector [`d`], we have: + + [``[$l[$s[2]]]=2[$l[$s[0]]]+[$l[$s[1]]]+[$l[$s[3]]]``] + +By this equation, we can derive: + + [``[$l[$s[0]]]=\frac{[$l[$s[2]]]-[$l[$s[1]]]-[$l[$s[3]]]}{2}``] + + [``[$l[$s[1]]]=[$l[$s[2]]]-2[$l[$s[0]]]-[$l[$s[3]]]``] + + [``[$l[$s[3]]]=[$l[$s[2]]]-2[$l[$s[0]]]-[$l[$s[1]]]``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations40.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations40.pg new file mode 100644 index 0000000000..52911e018f --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations40.pg @@ -0,0 +1,94 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## MLT(FindPointFrom_Vecandpoint) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('15') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextLimitedPoint.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("LimitedPoint"); + +($Ax,$Ay) = ( non_zero_random(-9,9,1), non_zero_random(-9,9,1) ); +do { + ($Bx,$By) = ( non_zero_random(-9,9,1), non_zero_random(-9,9,1) ); +} until ($Ax != $Bx && $Ay != $By); + +$A = Point($Ax,$Ay); +$B = Point($Bx,$By); +$AB = Vector($Bx - $Ax, $By - $Ay)->reduce; + +$OA = Vector($Ax,$Ay); +$OB = Vector($Bx,$By); + +###################### +# Main text + +BEGIN_PGML + +Suppose [` A = [$A] `] and [` \overrightarrow{AB} = [$AB] `], find the location of Point [`B`]. + +[@KeyboardInstructions( +"\n" +.'* Enter a point, like [`(0,1)`]' +)@]** + + [` B = `][_______________]{$B} + +END_PGML + + +######################## +# Answer evaluation + +BEGIN_PGML_SOLUTION + +Since [` \overrightarrow{OA} + \overrightarrow{AB} = \overrightarrow{OB} `], we have + + [``\begin{aligned} + \overrightarrow{OB} &= \overrightarrow{OA} + \overrightarrow{AB} \\ + &= [$OA] + [$AB] \\ + &= [$OB] + \end{aligned}``] + +Point B is at [`[$B]`]. + +END_PGML_SOLUTION + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations50.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations50.pg new file mode 100644 index 0000000000..8e4858a906 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations50.pg @@ -0,0 +1,93 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('15') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextLimitedPoint.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("LimitedPoint"); + +($Ax,$Ay) = ( non_zero_random(-9,9,1), non_zero_random(-9,9,1) ); +do { + ($Bx,$By) = ( non_zero_random(-9,9,1), non_zero_random(-9,9,1) ); +} until ($Ax != $Bx && $Ay != $By); + +$A = Point($Ax,$Ay); +$B = Point($Bx,$By); +$AB = Vector($Bx - $Ax, $By - $Ay)->reduce; + +$OA = Vector($Ax,$Ay); +$OB = Vector($Bx,$By); + +###################### +# Main text + +BEGIN_PGML + +Suppose [` B = [$B] `] and [` \overrightarrow{AB} = [$AB] `], find the location of Point [`A`]. + +[@KeyboardInstructions( +"\n" +.'* Enter a point, like [`(0,1)`]' +)@]** + + [` A = `][_______________]{$A} + +END_PGML + +######################## +# Answer evaluation + +BEGIN_PGML_SOLUTION + +Since [` \overrightarrow{OA} + \overrightarrow{AB} = \overrightarrow{OB} `], we have + + [``\begin{aligned} + \overrightarrow{OA} &= \overrightarrow{OB} - \overrightarrow{AB} \\ + &= [$OB] - [$AB] \\ + &= [$OA] + \end{aligned}``] + +Point A is at [`[$A]`]. + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations60.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations60.pg new file mode 100644 index 0000000000..d67e27b4d5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations60.pg @@ -0,0 +1,92 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## MLT(AddPointsForVec) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('17') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextLimitedVector.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("LimitedVector-coordinate")->variables->are(x=>'Real',y=>'Real'); +Context()->flags->set( ijk=>0 ); + +($Ax,$Ay) = (non_zero_random(-9,9,1), non_zero_random(-9,9,1)); +do { + ($Bx,$By) = (non_zero_random(-9,9,1), non_zero_random(-9,9,1)); +} until ($Bx != $Ax && $By != $Ay); +$A = Point($Ax,$Ay); +$B = Point($Bx,$By); +$AB = Vector("<$Bx - $Ax,$By - $Ay>")->reduce; + +$OA = Vector($Ax,$Ay); +$OB = Vector($Bx,$By); + +###################### +# Main text + +BEGIN_PGML + +Suppose [` A = [$A] `] and [` B = [$B] `], find the vector [`\overrightarrow{AB}`]. + +[@KeyboardInstructions( +"\n" +.'* Enter a vector, like [`<0,1>`]' +)@]** + + [` \overrightarrow{AB} = `][_______________]{$AB} + +END_PGML + +######################## +# Answer evaluation + +BEGIN_PGML_SOLUTION + +Since [` \overrightarrow{OA} + \overrightarrow{AB} = \overrightarrow{OB} `], we have + + [``\begin{aligned} + \overrightarrow{AB} &= \overrightarrow{OB} - \overrightarrow{OA} \\ + &= [$OB] - [$OA] \\ + &= [$AB] + \end{aligned}``] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations61.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations61.pg new file mode 100644 index 0000000000..0d8931cfe5 --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations61.pg @@ -0,0 +1,93 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(01/01/2013) +## Institution(Hope College) +## Author(Paul Pearson) +## MLT(AddPointsForVec) +## Level(1) +## TitleText1('Multivariable Mathematics') +## AuthorText1('Darin Stephenson') +## EditionText1('Version 3.0') +## Section1('1.1') +## Problem1('17') +## KEYWORDS('vectors') + + +############################## +# Initialization + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserVectorUtils.pl", + "contextLimitedVector.pl", + "PGML.pl", + "PCCmacros.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); + +TEXT(beginproblem()); + + +############################# +# Setup + +Context("Vector")->variables->are(x=>'Real',y=>'Real'); + +($Ax,$Ay) = (non_zero_random(-9,9,1), non_zero_random(-9,9,1)); +do { + ($Bx,$By) = (non_zero_random(-9,9,1), non_zero_random(-9,9,1)); +} until ($Bx != $Ax && $By != $Ay); +$A = Point($Ax,$Ay); +$B = Point($Bx,$By); +$Cx = $Bx - $Ax; +$Cy = $By - $Ay; +$AB = Compute("$Cx*i+$Cy*j")->reduce; + +$OA = Compute("$Ax*i+$Ay*j")->reduce; +$OB = Compute("$Bx*i+$By*j")->reduce; + +###################### +# Main text + +BEGIN_PGML + +Suppose [` A = [$A] `] and [` B = [$B] `], find the vector [`\overrightarrow{AB}`]. + +[@KeyboardInstructions( +"\n" +.'* Enter a vector in terms of [`i`] and [`j`].' +)@]** + + [` \overrightarrow{AB} = `][_______________]{$AB} + +END_PGML + +######################## +# Answer evaluation + +BEGIN_PGML_SOLUTION + +Since [` \overrightarrow{OA} + \overrightarrow{AB} = \overrightarrow{OB} `], we have + + [``\begin{aligned} + \overrightarrow{AB} &= \overrightarrow{OB} - \overrightarrow{OA} \\ + &= [$OB] - ([$OA]) \\ + &= [$AB] + \end{aligned}``] + +END_PGML_SOLUTION + + + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations70.pg b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations70.pg new file mode 100644 index 0000000000..74503a1adf --- /dev/null +++ b/OpenProblemLibrary/PCC/Trigonometry/Vectors/VectorOperations70.pg @@ -0,0 +1,151 @@ +## DESCRIPTION +## The geometry of vectors in R^n +## ENDDESCRIPTION + +## Edited by Carl Yao + +## DBsubject(Geometry) +## DBchapter(Vector geometry) +## DBsection(Vectors and vector arithmetic) +## Date(December 2015) +## Institution(Hope College) +## Author(Paul Pearson) +## Level(2) +## MO(1) +## KEYWORDS('vectors','vector operations') + +DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGgraphmacros.pl", + "contextLimitedVector.pl", + "AnswerFormatHelp.pl", + "PGML.pl", + "PCCmacros.pl", + "parserPopUp.pl", + "scaffold.pl", + "specialTrigValues.pl", + "PGcourse.pl", +); +TEXT(beginproblem()); +$refreshCachedImages = 1; +$showPartialCorrectAnswers = 1; + +############################################### + + +Context("LimitedVector-coordinate")->variables->are(x=>'Real',y=>'Real'); +Context()->flags->set( ijk=>0 ); + +# Construct graph canvas + +$pixels = 300; +$gr = init_graph(-7,-7,7,7, axes=>[0,0], size=>[$pixels,$pixels]); +$gr -> lb('reset'); + +# manually draw the grid +foreach my $j (-6..6) { + $gr -> moveTo($j,-7); + $gr -> lineTo($j,7,'gray',1); + $gr -> moveTo(-7,$j); + $gr -> lineTo(7,$j,'gray',1); +} + +# Graph labels and functions +$gr -> lb(new Label ( 6.5,0,'x','black','left','bottom')); +$gr -> lb(new Label ( 0.25,6.5,'y','black','left','bottom')); + +foreach my $j (1..6) { + $gr -> lb(new Label ( $j,-0.5, $j,'black','center','middle')); + $gr -> lb(new Label (-$j,-0.5,-$j,'black','center','middle')); + $gr -> lb(new Label (-0.5, $j, $j,'black','center','middle')); + $gr -> lb(new Label (-0.5,-$j,-$j,'black','center','middle')); +} + +# Vector coordinates +($Ax,$Ay) = (random(1,4,1), random(1,4,1)); +($Bx,$By) = (random(-4,-1,1), random(1,4,1)); +($Cx,$Cy) = (non_zero_random(-3,3,1),random(-4,-1,1)); + +# Plot coordinate vectors with tails at the origin +$gr->moveTo(0,0); $gr->arrowTo($Ax,$Ay,'blue',3); +$gr->moveTo(0,0); $gr->arrowTo($Bx,$By,'blue',3); +$gr->moveTo(0,0); $gr->arrowTo($Cx,$Cy,'blue',3); +$gr->lb(new Label ($Ax,$Ay+0.5,' a ','blue','left','middle')); +$gr->lb(new Label ($Bx,$By+0.5,' b ','blue','right','middle')); +$gr->lb(new Label ($Cx,$Cy-0.5,' c ','blue','left','middle')); + +$a = Vector("<$Ax,$Ay>"); +$b = Vector("<$Bx,$By>"); +$c = Vector("<$Cx,$Cy>"); + +$x1 = random(-5,-2,1); +do { $x2 = random(2,5,1)*random(-1,1,2); } until ($x1 != $x2); +do { $x3 = random(2,5,1)*random(-1,1,2); } until ($x3 != $x1 && $x3 != $x2); + +$alt = "In a coordinate system, 3 vectors start at the origin. Vector a points to ($Ax,$Ay); Vector b points to ($Bx,$By); Vector c points to ($Cx,$Cy)."; + +############################################### + +BEGIN_PGML + +>> [@ image(insertGraph($gr), width=>$pixels, height=>$pixels, tex_size=>900, extra_html_tags => "alt = '$alt' title = '$alt' ") @]* << + +[@KeyboardInstructions( +"\n" +.'* Enter a vector, like [`<0,1>`]' +)@]** + +Answer the following questions. + + + [`\vec{a}=`] [______________]{$a} + + [`\vec{b}=`] [______________]{$b} + + [`\vec{c}=`] [______________]{$c} + + [` \vec{a} + \vec{b} + \vec{c} = `] [___________________]{"<$Ax+$Bx+$Cx, $Ay+$By+$Cy>"} + + [` [$x1] \vec{a} + [$x2]\vec{b} + [$x3] \vec{c} = `] [___________________]{"<$x1*$Ax+$x2*$Bx+$x3*$Cx, $x1*$Ay+$x2*$By+$x3*$Cy>"} + +Find a vector [` \vec{d} `] such that [` \vec{a} + \vec{c} + \vec{d} = \vec{0} `]. + + + [` \vec{d} = `] [___________________]{"<-($Ax+$Cx), -($Ay+$Cy)>"} + +END_PGML + +############################################### + +$Dx = -1*$Ax-1*$Cx; +$Dy = -1*$Ay-1*$Cy; + +BEGIN_PGML_SOLUTION + +By the given graph, we can see + + [``\vec{a} = [$a], \vec{b} = [$b], \vec{c} = [$c] ``] + + [`` \begin{aligned} + \vec{a} + \vec{b} + \vec{c} &= [$a]+[$b]+[$c] \\ + &= <[$Ax]+([$Bx])+([$Cx]), [$Ay]+([$By])+([$Cy])> \\ + &= <[$Ax+$Bx+$Cx], [$Ay+$By+$Cy]> + \end{aligned} ``] + + [`` \begin{aligned} + [$x1] \vec{a} + [$x2]\vec{b} + [$x3] \vec{c} + &= [$x1]<[$Ax],[$Ay]> + [$x2]<[$Bx],[$By]> + [$x3]<[$Cx],[$Cy]> \\ + &= <[$x1*$Ax],[$x1*$Ay]> + <[$x2*$Bx],[$x2*$By]> + <[$x3*$Cx],[$x3*$Cy]> \\ + &= <[$x1*$Ax]+[$x2*$Bx]+[$x3*$Cx], [$x1*$Ay]+[$x2*$By]+[$x3*$Cy]> \\ + &= <[$x1*$Ax+$x2*$Bx+$x3*$Cx], [$x1*$Ay+$x2*$By+$x3*$Cy]> + \end{aligned} ``] + +If [` \vec{a} + \vec{c} + \vec{d} = \vec{0} `], we have: + + [`` \begin{aligned} + \vec{a} + \vec{c} + \vec{d} &= \vec{0} \\ + \vec{d} &= -\vec{a} - \vec{c} \\ + \vec{d} &= -<[$Ax],[$Ay]>-<[$Cx],[$Cy]> \\ + \vec{d} &= <-([$Ax])-([$Cx]),-([$Ay])-([$Cy])> \\ + \vec{d} &= <[$Dx],[$Dy]> + \end{aligned} ``] + +END_PGML_SOLUTION + +ENDDOCUMENT(); diff --git a/OpenProblemLibrary/PCC/checkLibDevsFull b/OpenProblemLibrary/PCC/checkLibDevsFull new file mode 100644 index 0000000000..e28f136de9 --- /dev/null +++ b/OpenProblemLibrary/PCC/checkLibDevsFull @@ -0,0 +1,6 @@ +for each in dear horton insalata jones jordan kling leavitt reynolds ross spoddeck vega yao +do ( cd /opt/webwork/courses/$each-LibDev/templates/local/PCC/; + echo "$each " + sudo git status; +) +done diff --git a/OpenProblemLibrary/PCC/pointToolExamples.tgz b/OpenProblemLibrary/PCC/pointToolExamples.tgz new file mode 100644 index 0000000000..2c154c3db9 Binary files /dev/null and b/OpenProblemLibrary/PCC/pointToolExamples.tgz differ diff --git a/OpenProblemLibrary/PCC/processLibDevsFull b/OpenProblemLibrary/PCC/processLibDevsFull new file mode 100644 index 0000000000..169e39532e --- /dev/null +++ b/OpenProblemLibrary/PCC/processLibDevsFull @@ -0,0 +1,28 @@ +echo "checking out develop" +sudo git checkout develop +# +for each in dear horton insalata jones jordan kling leavitt reynolds ross spoddeck vega yao +do ( echo "pulling from $each develop"; + sudo git fetch $each develop; + sudo git pull $each develop ) +done + +# +echo "checking out master" +sudo git checkout master +echo "merging develop into master" +sudo git merge develop +# +for each in dear horton insalata jones jordan kling leavitt reynolds ross spoddeck vega yao +do ( echo "pushing to $each master"; + sudo git push $each master ) +done +# +for each in dear horton insalata jones jordan kling leavitt reynolds ross spoddeck vega yao +do ( cd /opt/webwork/courses/$each-LibDev/templates/local/PCC/; + echo "merging $each master into $each develop"; + sudo git merge master; + echo "setting all files in $each develop to be owned by www-data"; + sudo chown -R www-data . +) +done diff --git a/OpenProblemLibrary/macros/PCC/PCCgraphMacros.pl b/OpenProblemLibrary/macros/PCC/PCCgraphMacros.pl index 3f4c90ced0..cee32f9471 100755 --- a/OpenProblemLibrary/macros/PCC/PCCgraphMacros.pl +++ b/OpenProblemLibrary/macros/PCC/PCCgraphMacros.pl @@ -17,7 +17,7 @@ =head1 DESCRIPTION =cut -loadMacros("PCCmacros.pl",); +loadMacros("PCCmacros.pl"); ############################### #Some standard values